forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Uploading Microcode

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development
View previous topic :: View next topic  
Author Message
tumnes



Joined: 17 Sep 2004
Posts: 23

PostPosted: Thu Mar 16, 2006 6:25 am    Post subject: Uploading Microcode Reply with quote

Ok, so now I've got a tiny microcode program that I would like to upload to vu1. I have been successful using the code provided by Saotome in a prevous thread, but would like to try it using libpacket and libdma. So according to the EE user's manual I need something like this:

[MPG|num|addr] [NOP|..|..] [NOP|..|..] [NOP|..|..]
[ Code ... ] [ Code ...]

The NOP's are so that it aligns to 128 bits.

So I have my VIFcodes:
0x4a080000 0x00000000 0x00000000 0x00000000
Followed by 64bits x 8 instructions

And then I try to upload the code using:
packet_send(&packet,DMA_CHANNEL_VIF1,DMA_FLAG_NORMAL);

Now, I noticed when I was going through this with uploading data that the figures in the manual appear to be backwards. It showed something like:
[z][y][x][vifcode]
[w]

but I had to do:
[vifcode][x][y][z]
[w]

to get it to work properly.

So I tried the same with this and it still didnt work. It just seems to block at packet_send(). Any ideas what is going wrong here?
Back to top
View user's profile Send private message Visit poster's website AIM Address
tumnes



Joined: 17 Sep 2004
Posts: 23

PostPosted: Thu Mar 16, 2006 6:51 am    Post subject: Reply with quote

Alrighty, I found the answer on my own which I will share.

Basically the vifcode MPG has to be aligned to a 64bit boundry, so in my case I want somethign like:

[NOP][MPG] [Code]
[Code] [Code]
...

Since each instruction is 64 bits and the vifcode is only 32 there needs to be a NOP vifcode before the MPG tag for alignment.

It appears to be backwards from the way its shown in the EE user's manual for some reason.
Back to top
View user's profile Send private message Visit poster's website AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group