Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugs in the block initialization & elsewhere; some which were inherited from the Fortran version. #18

Open
LydiaMarieWilliamson opened this issue Sep 21, 2021 · 2 comments

Comments

@LydiaMarieWilliamson
Copy link

I'm retranslating the Fortran version to C99, and have also updated my branch of your archive to C99, while progressively bringing them into convergence with each other and the Fortran original (which is also undergoing update to Fortran 2018).
The process has uncovered several bugs in both the Fortran original and the 1991 C translation.

In particular, there are several inconsistencies in the initializations done in blkdata.f (which corresponds to your parse.h with INIT defined).
There are mismatches in the following places:
∙ (1RS, 29560): Mismatched value (it should be 30400); 29560 corresponds to 2RRS.
∙ (3RPAP, 256656): Mismatched value (it should be 25656).
∙ (1RO, 0): Mismatched value (it should be 24000).
∙ (1RY, 4000): Mismatched value (it should be 40000).
∙ (3RMIN, 21175): Mismatched value (it should be 21174).

The first two of these inconsistencies were corrected by the 1991 translation to C,
and are not present in the C version.
The ‟1RS” in (1RS, 29560) was already changed to ‟2RRS”.
This involved words starting in ‟HOURS⋯”, but did not affect them, since the mistake was in the comment, not the code.
The 256656 in (3RPAP, 256656) was already changed to 25656, is for words beginning in ‟PAPER⋯” and affects the code.

The remaining inconsistencies, which affect words that start in ‟INTO⋯”, ‟CLAY⋯”, ‟CRIMIN⋯”, respectively,
have all been inherited by the translations of Zork into C and are present in your copy, as well.
For now, they've been kept intact in our copy, but will soon be corrected.

The ability to see this was obscured by the fact that the 1991 C translation mangled the layout of the initializations, relative to the layout listed in the comments, and failed to keep the comments aligned with the code. A translation project should not be considered complete until the comments are also translated and realigned; and the 1991 translation left this unfinished. This is one of the reasons why.

In most of the *.c files, the function header comment for the first function definition was misplaced at the top of the file, separated from the function it is in reference to, and should be moved down back next to the function.

In gdt.c, at one point, a file output has eqo misaligned as eqo[j + k * 200 - 201] at 200, when it should be aligned as eqo[j + k * 220 - 221] at 220. This was a error made in the 1991 C translation. The error will mangle the display of the object table during debug mode.

Also, in gdt.c, after L35500 should be
printf("Old= %c New= ", cevent_1.cflag[j - 1] ? 'T' : 'F');
to match the Fortran original. This omission was an error, as can be seen by the fact that the "fflush(stdout);" statement was left intact ... with nothing left to flush. This affects the display of clock interrupt events during debug mode.

@john-peterson
Copy link

john-peterson commented Sep 5, 2023

I saw that you split out the text index to readable form but the game text itself is still illegible to me

This is a problem because i want to remove the sentence breaks from the game text so it can be played on a phone primarily or any terminal that is not exactly 70 columns

notice and cringe at the out of place break in the opening message

./Zork
Welcome to Dungeon. This version created 2021-10-31.
You are in an open field west of a big white house with a boarded <-- BREAK
front door.
There is a small mailbox here.
>

the text printer likewise prints breaks everywhere

gdt
dt
4
The parser tries to be clever about what to do in the case of
        actions which require objects that are not explicitly specified.

it seems to break at 70 columns so it will look right only on that column width. anything else will look strange. a phone has around 40 colums

echo "You are in an open field west of a big white house with a boarded"|wc
      1      15      66
echo "You are in an open field west of a big white house with a boarded front"|wc
      1      16      72
tput cols
44
termux-info
Android version:
12
Kernel build information:
Linux localhost 5.4.147-qgki-g3eeb1d6e489b #1 SMP PREEMPT Thu Jul 28 11:17:53 UTC 2022 aarch64 Android
Device manufacturer:
HMD Global
Device model:
Nokia G60 5G

have you seen if it tries to determine column width during runtime?

or are the line feeds hard coded into the text file?

in that case how do i change the text. or read it to begin with? do you have a command for reading the text

head -c 30 dtext.dat
=��a��ՠ�
        ��Q

the emulator does not suffer from this. maybe the text can be copied from that data file if its free of line breaks

http://www.infocom-if.org/downloads/zork1.zip
frotz DATA/ZORK1.DAT

ZORK I: The Great Underground Empire
Copyright (c) 1981, 1982, 1983 Infocom, Inc.
All rights reserved.
ZORK is a registered trademark of Infocom,
Inc.
Revision 88 / Serial number 840726

West of House
You are standing in an open field west of a
white house, with a boarded front door. <-- COMPLETE SENTENCE 
There is a small mailbox here.

>

it talks about rows

grep -wr rows
Makefile:## The Dungeon/Zork program provides a ‟more” facility which tries to figure out how many rows the terminal has.
Makefile:## more option 3: assume all terminals have 24 rows
local.c://      MORE_TERMCAP    Use termcap routines to get rows of terminal
local.c://      MORE_TERMINFO   Use terminfo routines to get rows of terminal
local.c://      MORE_AMOS       Use AMOS monitor calls to get rows of terminal
local.c:// Initialize the more waiting facility (determine how many rows the terminal has).

but not about columns

a@e:~/zork$ grep -wr columns
a@e:~/zork$ 

which makes me think the sentence breaks are in the data file

@LydiaMarieWilliamson
Copy link
Author

LydiaMarieWilliamson commented Oct 10, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants