From 8b1cd8c99bc10c8600b009c8353f36e45705a47c Mon Sep 17 00:00:00 2001 From: shokre Date: Thu, 16 Sep 2021 16:07:58 +0200 Subject: [PATCH] fix: pass cpu to mem_listener --- orao/cpu.py | 2 +- orao/video.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/orao/cpu.py b/orao/cpu.py index 3bb05bb..d9dba41 100755 --- a/orao/cpu.py +++ b/orao/cpu.py @@ -103,7 +103,7 @@ class CPU(object): self.memory[addr] = val & 0xFF for listener in self.store_mem_listeners: - listener(addr, val) + listener(addr, val, self) def stack_push(self, value): self.store_byte(256 + self.sp, value & 0xFF) diff --git a/orao/video.py b/orao/video.py index f7126ad..6bedc73 100644 --- a/orao/video.py +++ b/orao/video.py @@ -4,7 +4,7 @@ terminal = pygame.Surface((256, 256), pygame.SRCALPHA, depth=32) terminal.fill((255, 255, 255)) alphaarray = pygame.surfarray.pixels_alpha(terminal) -def mem_listener(addr, val): +def mem_listener(addr, val, cpu): if 0x6000 <= addr <= 0x7FFF: # Video RAM y, x = divmod((addr - 0x6000) * 8, 256) for i in range(8):