Troubleshooting a an interpreter with inform

Hey all, this is kind of not inform related, but kind of is…

I compiled my own interpreter and it can run Inform code, but it’s input system is kind of broken.

Here’s some example code that I’m running.

"game" by Halkun

lab is a room

after reading a command:
	say "Stream input was ---> '[player's command]'[line break]";

However, when I run it, it’s having issues understanding input.

Is there any way I can dig into the parser and see what it’s having a problem with? It’s strange that I can see the player’s command, but the input is somehow garbage. Any clues or tips?

== Edit ==
Oops I should probably say, this is a Glulx terp. I’m thinking it’s hanging up on some kind of Unicode magic.

Answered my own question. I found a Glk unit test and modded it to not take any input.

Glk opcode:

lowercase 'A'=0 (should be 97 FAIL), lowercase 'B'=0 (should be 98 FAIL), lowercase 'C'=0 (should be 99 FAIL)
lowercase 'A'=0 (should be 97 FAIL), lowercase 'B'=0 (should be 98 FAIL), lowercase 'C'=0 (should be 99 FAIL)
lowercase 'D'=0 (should be 100 FAIL), lowercase 'E'=0 (should be 101 FAIL), lowercase 'F'=0 (should be 102 FAIL)
lowercase 'D'=0 (should be 100 FAIL), lowercase 'E'=0 (should be 101 FAIL), lowercase 'F'=0 (should be 102 FAIL)
lowercase 'G'=0 (should be 103 FAIL), lowercase 'H'=0 (should be 104 FAIL), lowercase 'I'=0 (should be 105 FAIL)
guard=999
window=52, rock=201
window=52, rock=201
window=52, rock=201
window=52, rock=201
select_poll=0, result=0000
select_poll=0, result=0000
guard=999
len=14 "up-case ãä´µ4." len 14
15 tests failed.

it seems the glk opcode is ran, so the terp is fine, but it’s getting null values back.
It’s a seems to be a failure of @glk $A0

For what it’s worth, catch/throw is also failing, but that’s failing in Glulxe too.

glk call $A0 is glk_char_to_lower(), as listed in eblong.com/zarf/glk/glk-spec-074_12.html .

Fixed it! gli_initialize_misc() wasn’t being ran to create the upper and lower lookup tables for glk_char_to_lower() to use… It works now

That’s good.

The Glulxercise test doesn’t cover a whole lot of the Glk layer’s functionality. I have more test files posted at eblong.com/zarf/glulx/ . It’s kind of a miscellaneous bucket, but you can try them and compare the behavior to Windows Glulxe.