Jump to content
InsaneMultitasker

TI-99 Infocom Interpreter Dev

Recommended Posts

A few weeks ago, someone ( @Shift838 ? )  posted a comment that there were some Z3 games that were too small for the current interpreters.  I'm looking for an example or two for test purposes.  I'd like to test whether or not my native Z3 file interpreter code will now properly load and play smaller files.

Share this post


Link to post
Share on other sites

Quick update. I held off on the testing so that I could disassemble and review the LTOI 40 column interpreter.  Most of the differences are related to VDP memory usage for the PABs, screen, and character patterns.  The scoring routine is different taking into account the limited real estate, and there are a few differences with the input routine.  Having completed the review, I am almost ready to commit to the native Z3 file format.  I need to map out a few things before I finalize my approach. 

  • Like 3

Share this post


Link to post
Share on other sites

I've been tracking down, documenting, and 'fixing' hard-coded routines and data.  One routine in particular has raised a few questions.   It extracts the keyboard input codes (word separators) from the game dictionary and places them into "unreserved" memory at 0x2662.  There is also a hard-coded list of codes (space, enter, period, comma, question mark, backspace, termination(NULL)) that is being appended to what is extracted.  My guess is an older iteration of the interpreter was not using the game file dictionary codes.

 

From what I've read the period comma and double-quote are the three standard separators for V3 and the separators should always be in the game file dictionary.  Is this accurate? 

 

This weekend I'll remove the hard-coded list to see what happens.  Current code is located in the spoiler.




;  n     list of keyboard input codes   entry-length  number-of-entries
; byte  ------n bytes-----------------      byte         2-byte word
;
;The keyboard input codes are "word-separators": typically (and under Inform mandatorily) these are the ZSCII ;codes for full stop, comma and double-quote. Note that a space character (32) should never be a word-separator. ;The "entry length" is the length of each word's entry in the dictionary table. (It must be at least 4 in ;Versions 1 to 3, and at least 6 in later Versions
;
;
       CLR  *R8            ok
       LI   R0,>2662    ; another pointer but hardcoded. $Fix to equate
       MOV  R0,@ZBB    ;save pointer to what we extract from dictionary (2662)

       MOV  @ZAV,R2    ;dictionary header 'n byte' [based on dictonary A008 value + >A000 offset]
       MOVB *R2+,R1    ;get 'n' total codes
       SRL  R1,8    
ZBC    MOVB *R2+,*R0+    and move the keyboard input codes into 2662+
       DEC  R1
       JNE  ZBC

;

; I -think- the following table represents the separators. Input routine doesn't seem to use them.
;      Codes:  space, enter, period, comma, question mark, backspace, termination(NULL)
;
; ZBE DATA >200D,>2E2C,>3F09,0     ;guessing this was moved earlier so it can be overwritten?
;
; It is possible this list (ZBE) is an artifact that is no longer needed,
; perhaps it was used before the interpreter processed the dictionary? Note that the 0x20 space character

; is in the list, yet the interpreter guide states that is not allowed as a word separator.

;
       LI   R1,ZBE    that are hardcoded at ZBE
ZBF    MOVB *R1+,*R0+
       JNE  ZBF        0?  no, get next

Share this post


Link to post
Share on other sites

I'm not 100% sure of what's going on here because I don't understand what the interpreter does. As far as I know, the parser is supposed to "process the input", then "recognize the words" (take a word, find it in the dictionary, match it with the corresponding word/token), then look to see if this corresponds to a line in the grammar. I believe the "process the input stage" is where stuff like "take key. open door with key" or "take key then open door with key" gets transformed in the right format. (But I can't remember if it's the parser or the interpreter that does this...)
I have a vague memory of a technical difficulty that can occur if you type "ask Ms. Belgrave about butler" in the Infocom detective games, because the "." is not a command separator then, but I don't know if it's the interpreter or the parser that is in charge of fixing that. (But maybe the period shouldn't be deleted in that case? I don't know) You might want to use "Deadline" or "Witness" to test if anything was broken.

Sorry, I'm not very helpful!

  • Like 1

Share this post


Link to post
Share on other sites
41 minutes ago, hlabrand said:

I'm not 100% sure of what's going on here because I don't understand what the interpreter does. As far as I know, the parser is supposed to "process the input", then "recognize the words" (take a word, find it in the dictionary, match it with the corresponding word/token), then look to see if this corresponds to a line in the grammar. I believe the "process the input stage" is where stuff like "take key. open door with key" or "take key then open door with key" gets transformed in the right format. (But I can't remember if it's the parser or the interpreter that does this...)
I have a vague memory of a technical difficulty that can occur if you type "ask Ms. Belgrave about butler" in the Infocom detective games, because the "." is not a command separator then, but I don't know if it's the interpreter or the parser that is in charge of fixing that. (But maybe the period shouldn't be deleted in that case? I don't know) You might want to use "Deadline" or "Witness" to test if anything was broken.

Sorry, I'm not very helpful!

no, this is helpful, as I hadn't even considered the cases in your examples!  My "paper trace" of the code strongly suggests that game file dictates the separation and the online documentation agrees with the code. As far as I can tell, the extra characters in the list are never compared against what has been parsed.  I'll need to run a quick debug session to confirm my suspicions.   Could I leave the extra characters in place?  Yes, but I'd like to clean house and have this well documented.   I like the idea of testing Deadline or Witness, and since the memory location is static in the current interpreters, I should be able to see what is in the older game dictionaries.  :)      

 

Here is what happens with Deadline if I use a period as a separator.  The action is parsed and acted upon but the game also 'complains' that a verb is needed.   When I check the debugger, the three separators (comma, period, quotes) were provided to the interpreter by the gamefile.

image.png.eb449a8f3e0fc8aba46a5cb58877f046.png

Share this post


Link to post
Share on other sites

I tested a few more game files and so far they all contain the same three separators in the dictionary: comma, period, and double quote.   The interpreter appends six more separators to the list:  space, enter, period, comma, question mark, backspace.  These separators are used by the parser to clean up the input for the word interpreter.  The good news is that I was able to document the routine and clear up a few of my misconceptions. The Infocom interpreter code can be almost as puzzling as one of their games!

  • Like 1

Share this post


Link to post
Share on other sites

I've identified all of the hard-coded screen output/input routines, so that I can now tell the interpreter to operate in either 40 or 80 column mode by adjusting a few DATA statements. Wordwrap was a bit tricky to find but as you can see, that is working as well.  I haven't yet finalized how to deal with the status line. 

 

image.thumb.png.bb54ec14b7d34b5be86d6865543376ed.png

(The 40 col display in an 80 col window is intentional - for debugging)

  • Like 3

Share this post


Link to post
Share on other sites
On 10/1/2020 at 7:25 PM, Torrax said:

Here's three small Z3 games

Made some progress with native Z3 files to cap the weekend.  Screenshot of DEJA VU running in the updated interpreter.  The only change to the file was to prepend a DIS/FIX128 TIFILES header via TI99Dir so that it could be recognized by the disk system.  

 

(Is unlocking the iron door possible with this demo?  One page I read says this isn't a game. If the iron key does unlock the door, the interpreter is not working properly with this z3 file).

 

image.thumb.png.90dde5db2f3f50d19ef74af4285476d0.png

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...