A couple days ago, @eriktorbjorn pointed out that Infocom’s “Cutthroats” does something strange with the in-game time at the status line. If you’re wearing your watch, you’ll see the current time. If not, something else. With most Infocom terps: for Apple II, C64, CP/M, DOS, and Macintosh; you’ll see Time: 99:99 pm
. For the Amiga interpreter, you’ll see Time: 3:99 pm
. This is also what Frotz and Jzip do. Going through the source code to “Cutthroats”, we see this:
<ROUTINE WATCH-UPDATE ()
<COND (<IN? ,WATCH ,PLAYER>
<SETG MOVES ,WATCH-MOVES>
<SETG SCORE ,WATCH-SCORE>)
(T
<SETG MOVES 99>
<SETG SCORE 111>)>>
For V3, time is encoded with the moves representing minutes and score representing hours. Here, if you’re not wearing the watch, the hour is set to 111. Then, in the interpreter, this is checked and if the hours are invalid, then subtract 12 and you get 99. Here’s a snippet of the assembly code to an Infocom interpreter for the Tandy Color Computer:
; PRINT TIME (HOURS)
PTIME: LDA TEMP+1
BNE PTIME1 ; 00 IS REALLY 24
LDA #24
PTIME1: CMPA #12
BLE PTIME2 ; IF HOURS IS GREATER THAN 12,
SUBA #12 ; CONVERT TO 12-HOUR TIME
STA TEMP+1
PTIME2: JSR NUMBER ; SHOW HOURS VALUE
LDA #$3A ; ASCII COLON
If the hour is greater than 12, the interpreter assumes that 24-hour notation is used, and so subtracts 12. The author of “Cutthroats” obviously was aware of this behavior and used it to create a sensible “invalid” value.
Here’s what Frotz has always done for the time in a V3 game:
zword hours = (global1 + 11) % 12 + 1;
That performs the conversion of 24-hour to am/pm correctly, rather than the quick-and-dirty approach Infocom used and results in 3
instead of 99
. Clearly the Amiga interpreter did this too. I don’t know how this would be discovered to this depth without the availability of the ZIL code of Infocom’s games.
So, I’ll alter the Frotz core to check if “Cutthroats” is being played and to return what the implementors expected.
This was first reported at https://gitlab.com/DavidGriffith/frotz/issues/187