Maya Grab [Day 3] – Peeking into memory

Today I was busy taking screenshots of all the rooms and their states in the game. The complete solution for the game can be found here. Oh, did I say that the game is in german only? But no worries, I’ll make an english version too. Anyways, 46 screenshots of rooms and states are waiting for conversion back to C64 character graphics. It has to be done manually, or with a image to PETSCII tool, since the program is protected and can’t be listed. But that’s ok, I want to do it manually so I can practice a little bit creating graphics like this.

Having a solution for the game is fine, but there are surely more possibilities for writing commands to the interpreter and since, like mentioned before, the program is protected, there is only one thing left to try out – make a memory dump of the C64 and hope that the commands aren’t crunched or somehow hidden or crypted. Almost every emulator (I’m using VICE) has a built in Monitor, a powerful tool which you can use to write machine code or look into and alter specific memory addresses. So I’ve started the game, did a soft reset and started the tool. With the command “I” you can output a memory part, for example “I 0000 FFFF” will output all 64kb. I’ve mentioned before that the BASIC program is starting at address $0801 and there is also a 4kb upper RAM at $C000 which in this case was empty. What I’ve found out is that all the commands are stored from $2080 to $23A0. There are 35 verbs, 40 adverbs and 66 nouns for use. By looking further from $5000 to $7AA8, there were more strings which show up in the game, mixed with some other data or code probably for interpreting the commands.

Since I know now all the words that can be used I can, more or less, guess how the interpreter works. If you look at the solution you’ll notice that all the commands are build up verb + noun. Obviously, the adverbs, that come usually between those two words, are completely optional or just ignored. One more interesting thing is that the words are shortened to 5 or 6 characters. The word “schluessel” (“key” on german) is shortened to “schlu”. Basically you can write: “nimm schlu” to take the key. It’s valid and the interpreter understands it… like this also: “nimm schluabcdefghijklmn”. I assume that this is done for speeding up the interpreter, since there is enough memory to store whole words. You can also take an item more then once, the interpreter will say every time “OK”.

* * * * *