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:
parent
5802220fc5
commit
c437d3ee3f
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user