Ys VIII scripts use RPN arithmetics to perform conditions and some arithmetic calculations.
There are many different types of operations managed by the game, 63 in total apprently, with codes going from 0x1 up to 0x45, stored as 16 bits integers.
Find bellow some of these operators codes.
The main function found by weaknespase is located at the address .text+0x0029E876 from the unpatched japanese vita eboot. It contains a simple switch on these opcodes.
Testing them is also quite simple : for instance you can modify the 1stload/talk.bin script and change the GetExp item scripts to perform calculation tests. Their result will be added as experience points when you use the item.
RPN code : 1a 00 13 00 00 00 1f 00 1a 00 05 00 00 00 0e 00 1d 00
This decodes into : *0x13 5 ==
Which means : (*0x13 == 5)
Opcode | Operation |
---|---|
0x0002 | ! (Logical NOT) |
0x0008 | >> |
0x0009 | >= |
0x000A | > |
0x000B | << |
0x000C | <= |
0x000D | < |
0x000E | == |
0x0010 | && |
0x0011 | & |
0x0012 | || |
0x0013 | | |
0x0014 | ~ (Bitwise NOT) [untested] |
0x001A | push int |
0x001B | push float |
0x001D | end of stream |
0x001F | load var |
0x0042 | negate float ? [untested] |
0x0045 | sqrt float ? [untested] |