Document write_word permission model in zmemory
This commit is contained in:
parent
1bcb83961a
commit
9a0bacd581
1 changed files with 6 additions and 1 deletions
|
|
@ -258,7 +258,12 @@ class ZMemory:
|
|||
return (self._memory[address] << 8) + self._memory[(address + 1)]
|
||||
|
||||
def write_word(self, address, value):
|
||||
"""Write the given 16-bit value at ADDRESS, ADDRESS+1."""
|
||||
"""Write the given 16-bit value at ADDRESS, ADDRESS+1.
|
||||
|
||||
_check_static() is sufficient for permission checking because the
|
||||
dynamic memory region (which includes the header) is always writable
|
||||
by the game per Z-machine spec.
|
||||
"""
|
||||
if address < 0 or address >= (self._total_size - 1):
|
||||
raise ZMemoryOutOfBounds
|
||||
value_msb = (value >> 8) & 0xFF
|
||||
|
|
|
|||
Loading…
Reference in a new issue