Help understanding how to take an address and turn it into a gct entry

Started by schooluser, February 26, 2010, 04:44:57 AM

Previous topic - Next topic

live2play

Thanks!  Is it true to state the following?

You should never use a WiiRD code type for a 32-bit write to memory addresses that end with 2, 6, A, and E and you should never use a WiiRD code type for a 16-bit write to memory addresses that end with 1, 3, 5, 7, 9, B, D, and F.

dcx2

Quote from: live2play on March 17, 2010, 09:56:32 PMYou should never use a WiiRD code type for a 32-bit write to memory addresses that end with 2, 6, A, and E and you should never use a WiiRD code type for a 16-bit write to memory addresses that end with 1, 3, 5, 7, 9, B, D, and F.
What you say is all correct, but not the whole story.

1) Not just WiiRD, but the PowerPC processor inside the Wii cannot do unaligned memory accesses.
2) This applies not only to writes, but reads as well.  Any memory access must be aligned.
3) Not only can 32-bit memory accesses never end in 2/6/A/E, but they cannot ever be 1/3/5/7/9/B/D/F either.  In other words, they must end in 0/4/8/C, which is a multiple of 4, which is how many bytes a word is.