Thanks, yes it was a lot of work.
But it was lots of fun figuring this out for old times sake.
Kroah wrote:I see you've documented some parts (the doc folder i'm actually reading), nice
.
Since January, have you tried to do a full run of the game ?
I got quite far, but didn't finish the game. But I think everything important works now.
The last barrier was the age-old copy protection still doing its thing... It's defeated though not in a particularly elegant way
Do you have implemented something to dump the p-code to readable pseudo-C ?
Sort of - tools/list_pcode.py has a mode 9 which tries this. It builds expression trees and statements and outputs in this format:
- Code: Select all
$ tools/list_pcode.py -m 2 files/SYSTEM.STARTUP
...
Procedure MAINLIB_0x02_WaitMouseRelease
===========
bb001a:
001c: T1 = GEMBIND_1F_GetMouseButton(0x0)
0020: T2 = GEMBIND_1F_GetMouseButton(0x1)
0023: tjp(0x1a, lor(T1, T2))
bb0025:
0025: rpu(0x0)
Procedure MAINLIB_0x03_Sound(x)
===========
bb002c:
003c: MAINLIB_03_L1 = sbi(sind0(ixa(0x1, &MAINLIB_G53f, inci(MAINLIB_03_P0))), sind0(ixa(0x1, &MAINLIB_G53f, MAINLIB_03_P0)))
004c: KERNEL_0F_moveleft(&MAINLIB_G563, sind0(ixa(0x1, &MAINLIB_G53f, MAINLIB_03_P0)), &MAINLIB_G6e6, 0x0, MAINLIB_03_L1)
0062: KERNEL_0F_moveleft(&MAINLIB_G563, sind0(ixa(0x1, &MAINLIB_G53f, MAINLIB_G6e5)), &MAINLIB_G6e6, MAINLIB_03_L1, sbi(0x80, MAINLIB_03_L1))
0067: GEMBIND_08_DoSound(&MAINLIB_G6e6)
0069: rpu(0x2)
Its implementation is in tools/decompiler. Still needs some polishing, that's for sure.
If you'd like to play with it and wonder about something I didn't document, or if I missed some file, please let me know!