【プロアクション】NINTENDODSのPAR【リプレイ】
PS : most AR codes look like this :
ZXXXXXXX YYYYYYY
Z is the code type, XXXXXXX is the address, YYYYYYYY is the value.
Note : everytime the code handler is called, it clears all the value it uses (ie. the offset, the code status, the Dx registers), and then executes all the code 'at once'.
Official codes types :
0 : 32 bits write (str)
0XXXXXXX YYYYYYYY : writes word YYYYYYYY to [XXXXXXXX].
1 : 16 bits write (strh)
1XXXXXXX 0000YYYY : writes halfword YYYY to [XXXXXXXX].
2 : 8 bits write (strb)
2XXXXXXX 000000YY : writes byte YY to [XXXXXXXX].
For all the If codes, if the check is false, execution status is stopped (ie. following codes are disabled)
Also, these If codes don't support the offset :/...
3 : 32 bits If (code value)>(data at address) (bhi, "unsigned higher")
3XXXXXXX YYYYYYYY : checks if YYYYYYYY > (word at [XXXXXXXX]).
If no, the code(s) following this one are not executed (ie. execution status is set to false) untila code type D0 or D2 is encountered, or until the end of the code list is reached.
4 : 32 bits If (code value)<(data at address) (bcc, 'unsigned lower")
4XXXXXXX YYYYYYYY : checks if YYYYYYYY < (word at [XXXXXXXX]).
If no, the code(s) following this one are not executed (ie. execution status is set to false) untila code type D0 or D2 is encountered, or until the end of the code list is reached.
5 : 32 bits If ==
5XXXXXXX YYYYYYYY : checks if YYYYYYYY == (word at [XXXXXXXX]).
If no, the code(s) following this one are not executed (ie. execution status is set to false) untila code type D0 or D2 is encountered, or until the end of the code list is reached.
6 : 32 bits If !=
6XXXXXXX YYYYYYYY : checks if YYYYYYYY != (word at [XXXXXXXX]).
If no, the code(s) following this one are not executed (ie. execution status is set to false) untila code type D0 or D2 is encountered, or until the end of the code list is reached.
Code 7, 8, 9, A are perfect for any 'joker' code (to check the pad status). They should also be used for event flag check.
7 : 16 bits If (code value)>(data at address) (unsigned)
7XXXXXXX ZZZZYYYY : checks if (not (XXXX) &YYYY) > (halfword at [XXXX]).
If no, the code(s) following this one are not executed (ie. execution status is set to false) untila code type D0 or D2 is encountered, or until the end of the code list is reached.
8 : 16 bits if (code value)<(data at address) (unsigned)
8XXXXXXX ZZZZYYYY : checks if (not (XXXX) &YYYY) < (halfword at [XXXX]).
If no, the code(s) following this one are not executed (ie. execution status is set to false) untila code type D0 or D2 is encountered, or until the end of the code list is reached.
9 : 16 bits if ==
9XXXXXXX ZZZZYYYY : checks if (not (XXXX) &YYYY) == (halfword at [XXXX]).
If no, the code(s) following this one are not executed (ie. execution status is set to false) untila code type D0 or D2 is encountered, or until the end of the code list is reached.
A : 16 bits if !=
9XXXXXXX ZZZZYYYY : checks if (not (XXXX) &YYYY) != (halfword at [XXXX]).
If no, the code(s) following this one are not executed (ie. execution status is set to false) untila code type D0 or D2 is encountered, or until the end of the code list is reached.
B : adds the offset stored in 'address' to all the next codes addresses. (?) (used to execute all the code type on a pointer address !).
BXXXXXXXX 00000000 : offset = word at [0XXXXXXX].
C : pushes/stores code value, position of current code and execution status in some registers. The code value will then be use to know how much time to repeat the next code. (?)
C0000000 YYYYYYYY : set the 'Dx repeat value' to YYYYYYYY, saves the 'Dx next code to be executed' and the 'Dx execution status'. Repeat will be executed when a D1/2 code is encountered.
When repeat is executed, the AR reloads the 'next code position in code list' and the 'execution status'.
D0 : 'terminator' (clears execution status).
D0000000 00000000 : loads the previous execution status (if none exists, execution status is set to 'execute codes').
D1 : Used to apply the code type C setting (executes the code after type C several times, but does not clear them upon finishing).
D1000000 00000000 : if the 'Dx repeat value', set by code type C, is different than 0, it is decremented and then the AR loads the
'Dx next code to be executed' and the 'execution status' (=jumps back to the code following the type C code).
When the repeat value is 0, this code will load the saved code status value.
D2 : Used to apply the code type C setting (executes the code after type C several times). 'full terminator' (clears all temporary data, ie. execution status, offsets, code C settings...). (?).
D2000000 00000000 : if the 'Dx repeat value', set by code type C, is different than 0, it is decremented and then the AR loads the
'Dx next code to be executed' and the 'execution status' (=jumps back to the code following the type C code).
When the repeat value is 0, this code will clear the code status, the offset value, and the Dx data value (which can be set by codes DA, DB and DC).
D3 : set the 'offset' to the value of the code.
D3000000 XXXXXXXX : set the offset value to XXXXXXXX.
Codes D4~DB use what I called the Dx registers. They are 4 32-bits, located before the code list, which is used by the are to store/load data. I call them 'Dx repeat value', 'Dx next code to be executed', 'Dx code status' and 'Dx data'.
D4 : adds the value of the code to the data register used by D6~DB. Kind of add code ?. (?)
D4000000 XXXXXXXX : adds XXXXXXXX to the 'Dx data'.
D5 : sets the data register used by D6~DB to the value of the code.
D5000000 XXXXXXXX : sets the 'Dx data' to XXXXXXXX. XXXXXXXX to the 'Dx data'.
D6 : write to pointer (str) *. (?)
D6000000 XXXXXXXX : writes the 'Dx data' word to (XXXXXXXX+offset), and increments the offset by 4.
D7 : write to pointer (strh) *. (?)
D7000000 XXXXXXXX : writes the 'Dx data' halfword to (XXXXXXXX+offset), and increments the offset by 2.
D8 : write to pointer (strb) *. (?)
D8000000 XXXXXXXX : writes the 'Dx data' byte to (XXXXXXXX+offset), and increments the offset by 1.
D9 : read from pointer (ldr) *. (?)
D9000000 XXXXXXXX : loads the word at (XXXXXXXX+offset) and stores it in the 'Dx data'.
DA : read from pointer (ldrh) *. (?)
D9000000 XXXXXXXX : loads the halfword at (XXXXXXXX+offset) and stores it in the 'Dx data'.
DB : read from pointer (ldrb) *. (?)
D9000000 XXXXXXXX : loads the byte at (XXXXXXXX+offset) and stores it in the 'Dx data'.
DC : adds the offset 'data' to the current offset (some kind of dual offset ?). (?)
DC000000 XXXXXXXX : offset = (offset + XXXXXXXX).
225 :
ひみつの文字列さん:2024/12/05(木) 06:08:06 ID:MarkedRes
日本国またはアメリカ合衆国、もしくはその両方の著作権法に触れる内容であると疑われることから表示できません。