mirror of
https://github.com/autinerd/game_and_watch_emulator.git
synced 2025-12-16 07:16:26 +01:00
17 lines
494 B
Python
17 lines
494 B
Python
from .periph import Periph
|
|
|
|
class FLASH(Periph):
|
|
BASE_ADDR = 0x5200_2000
|
|
|
|
def __init__(self):
|
|
self._ACR = 0x13
|
|
|
|
def read_mem(self, address: int, size: int) -> int:
|
|
if address == self.BASE_ADDR or address == self.BASE_ADDR + 0x100:
|
|
return self._ACR
|
|
return 0
|
|
|
|
def write_mem(self, address: int, size: int, data: int):
|
|
if address == self.BASE_ADDR or address == self.BASE_ADDR + 0x100:
|
|
self.set_reg('_ACR', 0x0000_003F, data)
|