Debugging my Z-Machine interpreter - Annoying problem

Hi everyone,
I’ve been working on my own Z-Machine interpreter here : [link][/link].
I have just finished writing the opcode implementations for V3 and fixing bugs, and now I’ve encountered this (very) annoying problem.
Running it on Zork 2 (z3), I get this output :

Zork II: The Wizard of Frobozz
Inside the Barrow 
.... You can see a faint glow at the far end.
(Fails to indicate the presence of the sword and lamp)
> (I input some text here)

And then the interpreter main loop starts this eternal loop.
Trying Gus’s Death (z3), I get the introduction etc line, and then it enters an eternal loop again, this time without executing a READ instruction.
Can anyone help me out? It might have been caused by an obscure bug hidden deep in the code.
Most code has been tested, EXCEPT for code in zopcode_impl.cpp (ZOpcodeImpl namespace).
Thanks in advance,

update : I discovered what caused the infinite loop.
Pretty sure I’ll have another baffling problem really soon :stuck_out_tongue:

If you can’t eyeball this sort of problem, you pretty much have to load up the game in two interpreters, single-step, and watch to see where they diverge. Although this is tedious by hand, and I don’t know if any interpreters support automated tracing of that sort.

For Z5/8 you’ll want to test with praxix.z5 ( … s/czech.z5).

thanks! any recommendations for what interpreter to use? I’m using Windows Frotz at the moment, and the UI is pretty much end-user oriented

Someone took the updated Frotz core from Windows Frotz and produced an ncurses-based version, called nfrotz, which might be of more help.

Hmmm ok. Currently I have been able to get the start-up screen of Zork II to work “byte perfect”. However, entering commands seem to have weird consequences.
I’ll try to compile frotz on linux and then step through.
If anyone is interested in helping, please do! :stuck_out_tongue: