def __init__(self, romfile = './roms/tec1a.rom'): self.rom = memory.rom(11) self.rom.load_file(0, romfile) self.ram = memory.ram(11) self.empty = memory.null()
def __init__(self, romfile = './roms/ace.rom'): self.rom = memory.rom(13) self.rom.load_file(0, romfile) self.video = memory.ram(10) self.char = memory.wom(10) self.ram = memory.ram(10) self.empty = memory.null()
def test_rom(self): val = 0xab rom = memory.rom(13) self.assertEqual(rom[0], 0) rom[0] = val self.assertEqual(rom[0], 0) rom.load(2, (7,8,9,10)) self.assertEqual(rom[2], 7) self.assertEqual(rom[3], 8) self.assertEqual(rom[4], 9) self.assertEqual(rom[5], 10) rom[2] = val self.assertEqual(rom[2], 7) rom.load_file(0, './roms/ace.rom') self.assertEqual(rom[0], 0xf3) self.assertEqual(rom[1], 0x21) self.assertEqual(rom[8190], 0x1d) self.assertEqual(rom[8191], 0x00)
def test_rom(self): val = 0xab rom = memory.rom(13) self.assertEqual(rom[0], 0) rom[0] = val self.assertEqual(rom[0], 0) rom.load(2, (7, 8, 9, 10)) self.assertEqual(rom[2], 7) self.assertEqual(rom[3], 8) self.assertEqual(rom[4], 9) self.assertEqual(rom[5], 10) rom[2] = val self.assertEqual(rom[2], 7) rom.load_file(0, './roms/ace.rom') self.assertEqual(rom[0], 0xf3) self.assertEqual(rom[1], 0x21) self.assertEqual(rom[8190], 0x1d) self.assertEqual(rom[8191], 0x00)