Can a z machine property live in static memory?

According to the spec, the property address should point to dynamic memory. But if none of the properties of an object/room are going to change at runtime, it seems like you could conserve dynamic memory, which is important for older 8 bit machines. Obviously some properties change at runtime, but even that could be handled by pointing the object at a new property table.

Just wondering if any interpreters actually care? (I guess, specifically, Ozmoo)

(The object header obviously needs to be in dynamic memory since that contains the linked list nodes and the property address)

Thanks,

-Dave

I guess my real question here is do any interpreters allow static memory to be backed by “virtual” memory like high memory can.

Otherwise, the only difference between dynamic and static memory is that static memory doesn’t have to be recorded in save game state, which I guess… helps?

Well, and only dynamic memory needs to be recorded for UNDO state (although that often just computes deltas anyway).

I doubt any interpreters care but the wording of the standard means they can. Any story file that does that is technically malformed and invalid.

1 Like

Reading through this (relatively old) thread

It does seem like static memory can be “paged”. Of course, if your working set is too large it’s still going to be pretty slow.

-Dave

As far as I can tell from glancing at the Ozmoo code, this would work in Ozmoo, on all platforms.

You could create a story file to test it. Include the data needed for a certain property table as a static array, then alter the pointer in the object table.

And yes, On builds that use paging, like a normal build for C64, Ozmoo only keeps dynamic memory permanently in RAM. All static memory is subject to paging. The header contains a value with a suggestion on how much of the story file to keep permanently in RAM, but Ozmoo ignores this value.

2 Likes