 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
tumnes
Joined: 17 Sep 2004 Posts: 23
|
Posted: Thu Mar 16, 2006 6:25 am Post subject: Uploading Microcode |
|
|
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 |
|
 |
tumnes
Joined: 17 Sep 2004 Posts: 23
|
Posted: Thu Mar 16, 2006 6:51 am Post subject: |
|
|
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 |
|
 |
|
|
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
|