1
0
mirror of https://github.com/mnaberez/py65.git synced 2025-02-06 02:31:08 +00:00

monitor: add memory-mapped blocking getc

This commit is contained in:
BigEd 2011-08-22 15:45:20 +01:00
parent 5802220fc5
commit c437d3ee3f

View File

@ -136,9 +136,13 @@ class Monitor(cmd.Cmd):
byte = 0
return byte
def blocking_getc(address):
return ord(console.getch(self.stdin))
m = ObservableMemory(addrWidth=self.addrWidth)
m.subscribe_to_write([0xF001], putc)
m.subscribe_to_read([0xF004], getc)
m.subscribe_to_read([0xF005], blocking_getc)
self._mpu.memory = m