Purpose:
Used when writing a value to continuous addresses which have the same offset (between each other). Possiblity to increment the written value after each write with another fixed value (negative to substract since adding a negative value is the same as subtracting a positive one).
A replacement for multiple "direct ram write" code lines to shorten codes.
Template:
??SSSSSS XXXXXXXX
TNNNZZZZ VVVVVVVV
?? stands for the codetype:
For addresses / offsets greater than 0x80FFFFFF, add 0x1 to the codetype. When using pointer add 0x10 to the codetype.
SSSSSS stands for the address you start at when using base address or the offset to add when using pointer,
XXXXXXXX for the value to write,
T for the value size (0 is 8 bit, 1 is 16 bit and 2 is 32 bit),
NNN for the amount of additional (!) RAM writes to perform,
ZZZZ for the distance in bytes between each RAM write,
VVVVVVVV for the amount which is added to the value after each write.
Example #1:
We want to write the value 0x00000000 to address 0x80E3A200 using pointer with a value size of 32 bit, 0x14 additional addresses with a value increment of -1 and no distance between each write:
18E3A200 00000000
20140004 FFFFFFFF
Note:
The default distance for 32 bit is 0004 bytes in order to reach the next address. It is 0002 for 16 bit and 0001 for 8 bit. Using 0000 would make it write to the same address over and over again.
Example #2:
We want to write the value 0x00000055 to address 0x8103A200 using base address with a value size of 8 bit, 0x004 additional addresses with a value increment of 0x00000005 and a distance of 0x0040 between each write:
0903A200 00000055
00040040 00000005
Remember:
0x in front of something means that it is already in a hexadecimal. Otherwise it is decimal.
Used when writing a value to continuous addresses which have the same offset (between each other). Possiblity to increment the written value after each write with another fixed value (negative to substract since adding a negative value is the same as subtracting a positive one).
A replacement for multiple "direct ram write" code lines to shorten codes.
Template:
??SSSSSS XXXXXXXX
TNNNZZZZ VVVVVVVV
?? stands for the codetype:
Base address & address less than 0x81000000 or 0x91000000 | 08 |
Base address & address greater than 0x80FFFFFF or 0x90FFFFFF | 09 |
Pointer & address less than 0x81000000 or 0x91000000 | 18 |
Pointer & address greater than 0x80FFFFFF or 0x90FFFFFF | 19 |
SSSSSS stands for the address you start at when using base address or the offset to add when using pointer,
XXXXXXXX for the value to write,
T for the value size (0 is 8 bit, 1 is 16 bit and 2 is 32 bit),
NNN for the amount of additional (!) RAM writes to perform,
ZZZZ for the distance in bytes between each RAM write,
VVVVVVVV for the amount which is added to the value after each write.
Example #1:
We want to write the value 0x00000000 to address 0x80E3A200 using pointer with a value size of 32 bit, 0x14 additional addresses with a value increment of -1 and no distance between each write:
18E3A200 00000000
20140004 FFFFFFFF
Note:
The default distance for 32 bit is 0004 bytes in order to reach the next address. It is 0002 for 16 bit and 0001 for 8 bit. Using 0000 would make it write to the same address over and over again.
Example #2:
We want to write the value 0x00000055 to address 0x8103A200 using base address with a value size of 8 bit, 0x004 additional addresses with a value increment of 0x00000005 and a distance of 0x0040 between each write:
0903A200 00000055
00040040 00000005
Remember:
0x in front of something means that it is already in a hexadecimal. Otherwise it is decimal.
Last edited by Bully@WiiPlaza on 8/9/2012, 10:23 pm; edited 2 times in total