Closed ZornsLemma closed 1 year ago
Thanks for the idea!
We have a bit of a complex mess of build options, so depending on those, we may or may not have 48 bytes to spare in stack space.
E.g. If you build a z5 game for C64 with full error checking enabled (option -re), there's just 39 unused bytes in stack space.
Thus, we're careful about adding more code there.
We really should be putting together a test suite that builds a bunch of different games with different options, to make us more confident that additions and changes don't break something else.
Thanks Fredrik, that makes sense - I forgot how tight space can be in the Z-machine stack during initialisation. And I definitely know the feeling of having a complex mess of build options to worry about. :-)
I think parse_terminating_characters is only called once during initialisation, so 48 bytes can be saved for Z5+ games by moving it into the Z-machine stack. I've just done this on the Acorn port and it seems to work fine after five minutes' testing and I don't see any obvious reason this wouldn't work on the Commodore either. Maybe I've overlooked something, but this seems a nice little saving if I haven't...