Kyra disassembled!

It’s a day later than I’d estimated, but last night, I finished the Kyra disassembler, including function detection.

For now, I’m only handling one game – Hand of Fate – but it would be pretty simple to add the other Kyra games as well, as the only things different between them are the “magic” functions, and they’re all referred to by a parameter to a specific opcode. However, there’s not much point in doing that right now; it won’t help me to decompile the bytecode.

Here’s an excerpt from the disassembly of a small script:

00000016: jumpTo 0x0 (0)
00000018: push 6 (1)
0000001a: push 3 (1)
0000001c: setCharacterPos (0)
0000001e: addSP 2 (-2)
00000020: push 6 (1)
00000022: push 2 (1)
00000024: setCharacterPos (0)
00000026: addSP 2 (-2)

The next step is to get the code flow analysis working with KYRA, and then it’s on to the code generation.