def reset(self): MapperBase.reset(self) # 5 bit buffer self.regBuffer = 0 self.regBufferCounter = 0 # Register 0: self.mirroring = 0 self.oneScreenMirroring = 0 self.prgSwitchingArea = 1 self.prgSwitchingSize = 1 self.vromSwitchingSize = 0 # Register 1: self.romSelectionReg0 = 0 # Register 2: self.romSelectionReg1 = 0 # Register 3: self.romBankSelect = 0
def write(self, address, value): if address < 0x8000: MapperBase.write(self, address, value) return if not ((value&128) == 0): # reset buffer self.regBufferCounter = 0 self.regBuffer = 0 # reset register if self.getRegNumber(address) == 0: self.prgSwitchingArea = 1 self.prgSwitchingSize = 1 else: # Continue buffering: self.regBuffer = (self.regBuffer & (0xFF-(1<<self.regBufferCounter))) | ((value&1)<<self.regBufferCounter) self.regBufferCounter += 1 if self.regBufferCounter == 5: self.setReg(self.getRegNumber(address), self.regBuffer) #reset buffer self.regBufferCounter = 0 self.regBuffer = 0
def write(self, address, value): MapperBase.write(self, address, value)
def reset(self): MapperBase.reset(self)
def __init__(self, nes): MapperBase.__init__(self, nes)