heasm66 / mdlzork

Different versions of original mainframe Zork reconstructed and patched to run under Confusion.
15 stars 6 forks source link

Bug when examining/reading the free brochure after removing the stamp #41

Closed eriktorbjorn closed 5 months ago

eriktorbjorn commented 1 year ago

When you examine or read the free brochure while the stamp is still there, the text will end correctly:

                William Barton Flathead, Founder

(The brochure continues in this vein for a few hundred more pages.)
Affixed loosely to the brochure is a small stamp.

(By the way, this text and some others use tabs. Is it well-defined how many spaces a TAB is when running in Confusion?)

But once you remove the stamp, if you examine the brochure:

                William Barton Flathead, Founder

(The brochure continues in this vein for a few hundred more pages.)
I see nothing special about the free brochure.

And if you read it:

                William Barton Flathead, Founder

(The brochure continues in this vein for a few hundred more pages.)
Buffer for PRINTSTRING must be STRING

LISTENING-AT-LEVEL 1 PROCESS 1

The problem appears to be this bit in BROCHURE:

          (<AND <VERB? "EXAMI" "LKAT" "READ">
            <==? <PRSO> <SFIND-OBJ "BROCH">>>
           <TELL ,BRO1 1 ,USER-NAME ,BRO2>
           <AND <OCAN .STAMP>
            <TELL "Affixed loosely to the brochure is a small stamp.">>)

Which means that it can return <> instead of T, I believe. So perhaps simply add a T at the end?

heasm66 commented 1 year ago

I verfied this on ITS and examine is the same but read works as expected (without bug). This is a specific bug for Confusion.

I think tab is well defined because the text looks the same on both platforms.

eriktorbjorn commented 1 year ago

I verfied this on ITS and examine is the same but read works as expected (without bug). This is a specific bug for Confusion.

Fortunately, I think the fix I suggested fixes both of them.

I think tab is well defined because the text looks the same on both platforms.

But at least in Linux it's possible to configure the tab stops, in which case things might end up not looking right. I don't know if that's also the case in ITS?

larsbrinkhoff commented 1 year ago

ITS normally considers tab stops to be every eighth column, regardless of the terminal type. On output, a TAB character is converted to the appropriate cursor movement.

eriktorbjorn commented 1 year ago

This is what I tried in Linux. Normally, it looks like this:

>READ TUBE
---> Frobozz Magic Gunk Company <---
          All-Purpose Gunk

But after doing

stty tab0
tabs -4

It looks like this:

>READ TUBE
---> Frobozz Magic Gunk Company <---
      All-Purpose Gunk

So maybe Confusion should convert tabs to spaces, just to be safe, assuming it can be done without too much pain.

heasm66 commented 1 year ago

I'll branch off the tab to a seperate issue.

heasm66 commented 1 year ago

The difference between MDL on ITS and Confusion and the error message "Buffer for PRINTSTRING must be STRING" on Confusion is because there's a replacement routine for TELL that don't check that the input is a string. This could be fixed with <AND <TYPE? .S1 STRING> <PRINTSTRING .S1 .OUTCHAN .L>>. Now the behaviour is the same and the bug can be fixed by the proposed solution.