daelsepara / war-torn-kingdom

ZIL Implementation of War-Torn Kingdom (Quest / Fabled Lands Game book) by Dave Morris and Jamie Thomson
MIT License
1 stars 0 forks source link

Heavy dynamic memory requirement #2

Open jpcompton opened 4 years ago

jpcompton commented 4 years ago

Not a true bug, but maybe an unintended consequence: the way you've implemented this particular game, there's a much heavier dynamic memory requirement than your other gamebooks, so it's not possible to convert it to a playable C64 title with Ozmoo. (Your previous ZIL implementations have all worked well in that interpreter.)

Reading file wartorn.z5...
Dynmem blocks: 87
$zmachine_memory_size = 207656
$story_size = 207872
acme-crossass-code-0-r273-trunk/acme --setpc 2049 -DCACHE_PAGES=4 -DSTACK_PAGES=4 -DZ5=1 -DCONF_TRK=1 --cpu 6510 --format cbm -DBGCOL=8 -DFGCOL=4 -DBORDERCOL=0 -DBGCOLDM=2 -DFGCOLDM=5 -DBORDERCOLDM=0 -DSMALLBLOCK=1 -DVMEM=1 -DALLRAM=1 -l "ozmoo/temp/acme_labels.txt" --outfile "ozmoo/temp/ozmoo" ozmoo.asm
Interpreter size: 11215 bytes.
ERROR: Dynamic memory is too big (44544 bytes), would pass $D000. Maximum dynmem size is 37888 bytes.
jpcompton commented 4 years ago

So, I did a brute-force find-and-replace turning all 1200+ <LTABLEs into <PLTABLEs.

The good news is that the resulting .z5 binary (attached below) works for quite a while in Ozmoo! (up to a point, anyway, I did eventually get an error message, attached)

The bad news is that the resulting .z5 binary crashes after a few [more]s in WIndows Frotz with a "Store out of dynamic memory" message!

wartorn_pltable.zip

image

jpcompton commented 4 years ago

Not sure if you still look at the ZIL Discord, but Jesse just dropped some knowledge and recommendations (including highlighting some other issues about a combat bug): https://discord.com/channels/602406342363316226/602418155641503744/755118938387382353

daelsepara commented 4 years ago

Thanks. Will take a look.

daelsepara commented 4 years ago

I did the LTABLE -> PLTABLE conversions on some LTABLEs and indeed, it does the trick. Also tested it on oozmo. I also got the "Store out of dynamic memory" at one point and it seems to happen on story sections where some PLTABLEs are being modified or written to. I reverted these tables back to LTABLE. I also fixed story sections that had incorrect choices (in the attached image, the story section was using the wrong menu) or types or requirements.

Also made fixes to the COMBAT-MONSTER routine (changing PUTs to PUTPs).

I put in another release with these fixes. I'm keeping this issue open for now as I still need to test this on Windows. Thanks again.

fredrikr commented 1 year ago

I (barely) managed to build this with Ozmoo for C64 now. It requires turning off all bells and whistles and deep knowledge of Ozmoo to do it, so it's not perfect. It's easier on the other platforms supported by Ozmoo, where the dynamic memory can be larger.

daelsepara commented 1 year ago

I will have to review this again and revert back some of the PLTABLEs to LTABLEs.