I've been poking around in the world map events, has anyone else had a look at the opcodes?
So far I have:
-----------------------------------
0x17
!(bool) stack top (resulting value pushed as if 0x110 was used)
-----------------------------------
0x100
Reset stack pointer to base (0xE3A7F0)
-----------------------------------
0x110
Push value to stack as word
-----------------------------------
0x114
Push value to stack as single bit from memory starting at offset *0xE3A7E0:
addr bit
|0000000000000|000|
-----------------------------------
0x201
if (!pop) jump to value as offset
-----------------------------------
0x203
End script
-----------------------------------
0x307
0xDE6B5C = stack top // Enable / disable controls
0xDFC4A8 = 3
-----------------------------------
0x32b // No idea
e3a890 = stack top
-----------------------------------
0x321 // Again no idea
*0xE2BB94 (ptr to 1 of 16 structs) = 0xE28CE0 + arg1 * 0x24
val1 = *(*E2BB94 + 8) - *(*E39AD8 + C + 8)
val2 = **E2BB94 - *(*E39AD8 + C)
*(*0xE39AD8 + 4C) = *(*0xE39AD8 + 40) = *(*0xE39AD8 + 3C) =
(((val1 << 8) / val2) *2) + 0xE37120
*0xE39AD8 + 3E = 0
-----------------------------------
0x324
Creates window using the top 4 values on stack, from bottom to top values are x, y, width, height
-----------------------------------
0x325
Places text using index on top of stack, text is read from mes.
-----------------------------------
0x326
Displays a question and saves user input (presumably to address on top of stack, haven't looked yet)
-----------------------------------
Stack base is always 0xE3A7F0, top of stack is stored at 0xE39ADC.
0x765E09 is a table of function pointers for 3xx opcodes.
0xE3A810 is a pointer to the current script op
The *.ev files have the following structure:
struct {
struct {
uint16_t id; // No idea yet
uint16_t offset;
} Header[0x100];
uint16_t data[0x3600];
};