Skip to content

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

@LydiaMarieWilliamson

Description

@LydiaMarieWilliamson

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions