mirror of
https://github.com/jtauber/applepy.git
synced 2024-11-23 10:31:02 +00:00
don't allow writes to ROM area (this caused the ][+ ROM to hang on boot)
This commit is contained in:
parent
108ebd3769
commit
56e82f7cb6
@ -31,10 +31,14 @@ class Memory:
|
|||||||
self.__mem[0xC000] = self.__mem[0xC000] & 0x7F # clear keyboard
|
self.__mem[0xC000] = self.__mem[0xC000] & 0x7F # clear keyboard
|
||||||
return self.__mem[address]
|
return self.__mem[address]
|
||||||
|
|
||||||
|
def write_byte_io(self, address, value):
|
||||||
|
self.__mem[address] = value
|
||||||
|
|
||||||
def write_byte(self, address, value):
|
def write_byte(self, address, value):
|
||||||
if 0x400 <= address < 0x800:
|
if 0x400 <= address < 0x800:
|
||||||
self.write_screen(address, value)
|
self.write_screen(address, value)
|
||||||
self.__mem[address] = value
|
if address < 0xC000:
|
||||||
|
self.__mem[address] = value
|
||||||
|
|
||||||
def read_word(self, address):
|
def read_word(self, address):
|
||||||
return self.read_byte(address) + (self.read_byte(address + 1) << 8)
|
return self.read_byte(address) + (self.read_byte(address + 1) << 8)
|
||||||
@ -298,7 +302,7 @@ class CPU:
|
|||||||
elif key == 0x7F:
|
elif key == 0x7F:
|
||||||
key = 0x8
|
key = 0x8
|
||||||
# win.addstr(15, 50, hex(key))
|
# win.addstr(15, 50, hex(key))
|
||||||
self.memory.write_byte(0xC000, 0x80 + key)
|
self.memory.write_byte_io(0xC000, 0x80 + key)
|
||||||
except curses.error:
|
except curses.error:
|
||||||
pass
|
pass
|
||||||
except TypeError:
|
except TypeError:
|
||||||
|
Loading…
Reference in New Issue
Block a user