Open eriktorbjorn opened 1 year ago
Here is an untested version of the patch I'm going to use. Where possible I have used the code formatting from Trinity. The resulting data file is 20 bytes larger than before. I don't think that will be a problem.
Oops, found a bug in my patch. (I accidentally kept COULDNTS
as a TABLE
instead of an LTABLE
.) Here's a new version:
What I'm doing here is triggering repeated calls to the
WASTE-OF-TIME
routine:The
PNEXT
token is defined inTELL-TOKENS
as:The
PRINT-PICK-NEXT
routine is defined simply as:Which finally leads us to the subject matter of
PICK-NEXT
:When I asked in the Facebook group, the general consensus was that there is a bug in this routine, and not - as I had first thought - a bug in the way ZILF handles tables. So fixing it would be the simplest solution. However, disassembling (with txd) the released version of the game suggests that the routine was originally the same as in e.g. Trinity:
In that game,
WASTE-OF-TIME
is defined as:So it would probably be more historically correct to revert to this implementation of
PICK-NEXT
, and change every table defined for it to match the expected format. The downside of that is that this is not a very small list.I found these by searching for "LENGTH PATTERN". Some tables contain more than one sub-table.
Simply change "TABLE (LENGTH PATTERN (BYTE [REST WORD])) to "LTABLE 2". This is probably what I will be doing for the remainder of the testing.