the-infocom-files / zillib

Z-machine version 6 Parser Library
5 stars 3 forks source link

Build Zork Zero #2

Open AlexProudfoot opened 4 years ago

AlexProudfoot commented 4 years ago

Building Zork Zero reveals compilation errors in library files. See https://github.com/the-infocom-files/zork0/issues/2#issuecomment-588103888

AlexProudfoot commented 4 years ago

The compiler reports 3 errors in library files.

[error MDL0604]
..\zillib\parser\LALR.mud:9: USE-WHEN: file not found: SORT-MACROS
  in USE called at ..\zillib\parser\gram.zil:4
  in INSERT-FILE called at parser.zork0:15
  in INSERT-FILE called at zork0.zil:44

[error MDL0200]
..\zillib\parser\LALR.mud:276: calling unassigned atom: MERGESORT-MACRO!-ILALR
  in MERGESORT-STATES called at ..\zillib\parser\LALR.mud:279
  in 1 called at ..\zillib\parser\LALR.mud:279
  in SORT-STATES called at ..\zillib\parser\LALR.mud:312
  in MAKE-TABLES called at ..\zillib\parser\gram.zil:213
  in INSERT-FILE called at parser.zork0:15
  in INSERT-FILE called at zork0.zil:44

[error MDL0100]
..\zillib\clues.zil:26: syntax error: expected object but found '>'
AlexProudfoot commented 4 years ago

Add implementation of SORT-MACROS provided by Jesse McGrew.

AlexProudfoot commented 4 years ago

This reveals a large number of errors in basedefs.mud related to unaligned table reads. Change some constants in basedefs.mud as in the example provided by Jesse Mcgrew.

AlexProudfoot commented 4 years ago

Only the error in clues.zil remains. Remove two extraneous close angle brackets.

AlexProudfoot commented 4 years ago

See https://github.com/the-infocom-files/zork0/issues/2#issuecomment-588128795.

AlexProudfoot commented 4 years ago

The compiler reports 8 errors in library files.

[error MDL0226]
..\zillib\parser\parser.zil:566: WORD-CLASSIFICATION-NUMBER requires 1 or 2 args

[error MDL0226]
..\zillib\parser\parser.zil:885: WORD-CLASSIFICATION-NUMBER requires 1 or 2 args

[error MDL0226]
..\zillib\parser\parser.zil:913: WORD-CLASSIFICATION-NUMBER requires 1 or 2 args

[error MDL0226]
..\zillib\parser\parser.zil:1078: WORD-CLASSIFICATION-NUMBER requires 1 or 2 args

[error MDL0226]
..\zillib\parser\parser.zil:1126: WORD-CLASSIFICATION-NUMBER requires 1 or 2 args

[error MDL0226]
..\zillib\parser\parser.zil:1130: WORD-CLASSIFICATION-NUMBER requires 1 or 2 args

[error MDL0226]
..\zillib\parser\parser.zil:1551: WORD-CLASSIFICATION-NUMBER requires 1 or 2 args

[error ZIL0122]
..\zillib\parser\prare.zil:1038: unrecognized routine or instruction: ABS
AlexProudfoot commented 4 years ago

Fix WORD-CLASSIFICATION-NUMBER macro calls as in the example provided by Jesse Mcgrew.

AlexProudfoot commented 4 years ago

Export ABS from reds.zil as in the example provided by Jesse McGrew.

AlexProudfoot commented 4 years ago

The compiler reports a warning in a library file.

[warning ZIL0505]
..\zillib\parser\find.zil:487: IFFLAG: clauses after else part will never be evaluated
  [info ZIL0506] undeclared compilation flag 'P-ARTHUR'?
AlexProudfoot commented 4 years ago

See https://github.com/the-infocom-files/zork0/issues/2#issuecomment-588169678.

AlexProudfoot commented 4 years ago

No build errors.

AlexProudfoot commented 4 years ago

More issues on removing \<SET REDEFINE T>.

AlexProudfoot commented 4 years ago

Also, it would be a good idea to push the code updates.

AlexProudfoot commented 4 years ago

Delete parser.zork0 since there is a copy kept with the game and that is where it belongs.

AlexProudfoot commented 4 years ago

Convert includes and uses to lowercase for Linux compilations. Also remove references to standard packages (such as NEWSTRUC) which are not included in the closure.