I am pottering round a little I6 game every now and then, and the compiler tells me I’ve used 190 out of 233 global variables. I assume my computer will explode once I reach the limit. What can I do to extend it? The output format is currently z5, so I assume switching to z8 would help. How do I do that? And is there any other option?
You can change them into something that isn’t a global variable.
For example, create an object, and move some of the global variables to properties on that object.
Hrmpf. Okay, I could do that. But I picture myself spending half an hour of improving old code to free up memory for every hour I spend on programming new stuff. Can I have z8?
This is not a memory limit, it’s an architectural limit of the Z-machine. A global variable reference is an 8-bit number. So Z8 has the same number of global variables as Z5.
OTOH, 43 global variables available seem to me a sufficient margin for final touch (aka “varnish & veneer” and post-release debugging & improvements based on feedback.
So erm, is adding “-z8” to the .bat file enough to do the trick? I tried, but still get the message that there’s less than 10.000 bytes free in the Z-machine, and the output is still a z5 file.