heasm66 / mdlzork

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

Add info/help-doc to mdlzorks #34

Closed heasm66 closed 1 year ago

heasm66 commented 1 year ago

Add the different help and info textfiles so they work under Confusion.

madadv.help 770606 https://github.com/MITDDC/zork-1977-07/blob/main/zork/9006255/madman/madadv.help 771214 https://github.com/MITDDC/zork/blob/master/zork/madman/madadv.help 780111 780124 https://github.com/MITDDC/zork-1978-01/blob/main/zork/madman/madadv.help 780808 790317 , identical to 890108 890108 https://github.com/MITDDC/zork-1989-01/tree/main/zork/cstacy 010815

madadv.info 770607 https://github.com/MITDDC/zork-1977-07/blob/main/zork/9006255/madman/madadv.info 770614 https://github.com/MITDDC/zork-1977-07/blob/main/zork/9005183/madman/madadv.info 790317 890108 https://github.com/MITDDC/zork-1989-01/blob/main/zork/cstacy/madadv.info 010815

madadv.doc 790406 , ver 1, broken but identical to ver 2 up to that part. 790406 , ver 2

Games (source code or executables) understand only HELP and INFO up until the 780402 version. The 1979 version is the first that also understands DOC.

The most suitable distribution of the text-files among the known executables and snapshots of source code:

770612 Executable
    HELP        MADADV HELP     (770606)
    INFO        MADADV INFO     (770607)
770614 Executable
    HELP        MADADV HELP     (770606)
    INFO        MADADV INFO     (770614)
770701 Executable
    HELP        MADADV HELP     (770606)
    INFO        MADADV INFO     (770614)
771212 Executable/source code
    HELP        MADADV HELP     (771215)
    INFO        MADADV INFO     (770614)
780123 Executable
    HELP        MADADV HELP     (780111)
    INFO        MADADV INFO     (770614)
780124 Executable/source code
    HELP        MADADV HELP     (780111)
    INFO        MADADV INFO     (770614)
780126 Executable
    HELP        MADADV HELP     (780125)
    INFO        MADADV INFO     (770614)
780128 Executable
    HELP        MADADV HELP     (780125)
    INFO        MADADV INFO     (770614)
780402 Source code
    HELP        MADADV HELP     (780125)
    INFO        MADADV INFO     (770614)
791211 Source code
    HELP        MADADV HELP     (790317 or 890108 (identical))
    INFO        MADADV INFO     (790317 or 890108 (identical))
    DOC     MADADV DOC      (7090406, ver 2)
810722 Source code
    HELP        MADADV HELP     (790317 or 890108 (identical))
    INFO        MADADV INFO     (790317 or 890108 (identical))
    DOC     MADADV DOC      (790406, ver 2)
eriktorbjorn commented 1 year ago

I tried the recently added help files for 810722, but I had to make this change to Confusion to get the help file to display properly.

diff --git a/confusion_patched/macros.cpp b/confusion_patched/macros.cpp
index a25eb6a..cfb19db 100644
--- a/confusion_patched/macros.cpp
+++ b/confusion_patched/macros.cpp
@@ -7413,7 +7413,7 @@ mdl_value_t *mdl_builtin_eval_file_length(mdl_value_t *form, mdl_value_t *args)
         return mdl_call_error_ext("CHANNEL-CLOSED", "Channel closed but nonzero", NULL); // shouldn't happen
     if (fgetpos(f,&savepos) == -1) 
         return mdl_call_error("FILE-LENGTH-UNAVAILABLE", NULL); // not an original MDL error
-    if (fseek(f, SEEK_END, 0) == -1)
+    if (fseek(f, 0, SEEK_END) == -1)
         return mdl_call_error("FILE-LENGTH-UNAVAILABLE", NULL); // not an original MDL error
     endpos = ftello(f);
     fsetpos(f, &savepos);

(And you don't want to know how long I stared at that before noticing the error!)

heasm66 commented 1 year ago

Yeah, I noticed yesterday that it didn't work but it was past my bedtime...

I got as far as noticing that when reading an external file it couldn't iterate over the file multiple times but just read the buffer full, printed it and then exited. Obviously it always returned that it reached the end. My first impulse was to use a big enough buffer (memory isn't such a contraint any more on modern machines) to get all text on the first reading but your solution to fix the root of the problem is much better, Thank you!

heasm66 commented 1 year ago

@eswenson1 supplied me with more files (from not publically available sources). I updated the firt post with information.

eriktorbjorn commented 1 year ago

I saw you filed an upstreams bug report. Thanks! That was something I didn't have the time to do this morning. I barely had the time to write a proper bug report here.

It took me an embarrassingly long time to figure out why it always reported a file size of 2 bytes, but of course it was in essence doing fseek(f, 2, SEEK_SET) instead of fseek(f, 0, SEEK_END). :-)