mirror of
https://github.com/mnaberez/py65.git
synced 2025-01-19 23:31:03 +00:00
Remove the old "debug" mode
This commit is contained in:
parent
456a345b23
commit
9831529f4b
@ -22,9 +22,8 @@ class MPU:
|
||||
ADDR_WIDTH = 16
|
||||
ADDR_FORMAT = "%04x"
|
||||
|
||||
def __init__(self, memory=None, pc=0x0000, debug=False):
|
||||
def __init__(self, memory=None, pc=0x0000):
|
||||
# config
|
||||
self.debug = debug
|
||||
self.name = '6502'
|
||||
self.byteMask = ((1<<self.BYTE_WIDTH)-1)
|
||||
self.addrMask = ((1<<self.ADDR_WIDTH)-1)
|
||||
@ -494,8 +493,6 @@ class MPU:
|
||||
# instructions
|
||||
|
||||
def inst_not_implemented(self):
|
||||
if self.debug:
|
||||
raise NotImplementedError
|
||||
self.pc += 1
|
||||
|
||||
instruct = [inst_not_implemented] * 256
|
||||
|
@ -5215,11 +5215,6 @@ class MPUTests(unittest.TestCase, Common6502Tests):
|
||||
mpu = self._make_mpu()
|
||||
self.assert_("6502" in repr(mpu))
|
||||
|
||||
def test_stz_not_supported(self):
|
||||
mpu = self._make_mpu(debug=True)
|
||||
mpu.memory[0x0000] = 0x64 #=> stz (on 65c02)
|
||||
self.assertRaises(NotImplementedError, mpu.step)
|
||||
|
||||
def _get_target_class(self):
|
||||
return py65.devices.mpu6502.MPU
|
||||
|
||||
|
@ -918,7 +918,7 @@ class MPUTests(unittest.TestCase, Common6502Tests):
|
||||
# STZ Zero Page
|
||||
|
||||
def test_stz_zp_stores_zero(self):
|
||||
mpu = self._make_mpu(debug=True)
|
||||
mpu = self._make_mpu()
|
||||
mpu.memory[0x0032] = 0x88
|
||||
mpu.memory[0x0000:0x0000+2] = [0x64, 0x32] #=> STZ $32
|
||||
self.assertEqual(0x88, mpu.memory[0x0032])
|
||||
@ -930,7 +930,7 @@ class MPUTests(unittest.TestCase, Common6502Tests):
|
||||
# STZ Zero Page, X-Indexed
|
||||
|
||||
def test_stz_zp_x_stores_zero(self):
|
||||
mpu = self._make_mpu(debug=True)
|
||||
mpu = self._make_mpu()
|
||||
mpu.memory[0x0032] = 0x88
|
||||
mpu.memory[0x0000:0x0000+2] = [0x74, 0x32] #=> STZ $32,X
|
||||
self.assertEqual(0x88, mpu.memory[0x0032])
|
||||
@ -942,7 +942,7 @@ class MPUTests(unittest.TestCase, Common6502Tests):
|
||||
# STZ Absolute
|
||||
|
||||
def test_stz_abs_stores_zero(self):
|
||||
mpu = self._make_mpu(debug=True)
|
||||
mpu = self._make_mpu()
|
||||
mpu.memory[0xFEED] = 0x88
|
||||
mpu.memory[0x0000:0x0000+3] = [0x9C, 0xED, 0xFE] #=> STZ $FEED
|
||||
self.assertEqual(0x88, mpu.memory[0xFEED])
|
||||
@ -954,7 +954,7 @@ class MPUTests(unittest.TestCase, Common6502Tests):
|
||||
# STZ Absolute, X-Indexed
|
||||
|
||||
def test_stz_abs_stores_zero(self):
|
||||
mpu = self._make_mpu(debug=True)
|
||||
mpu = self._make_mpu()
|
||||
mpu.memory[0xFEED] = 0x88
|
||||
mpu.x = 0x0D
|
||||
mpu.memory[0x0000:0x0000+3] = [0x9E, 0xE0, 0xFE] #=> STZ $FEE0,X
|
||||
@ -968,7 +968,7 @@ class MPUTests(unittest.TestCase, Common6502Tests):
|
||||
# TSB Zero Page
|
||||
|
||||
def test_tsb_sp_ones(self):
|
||||
mpu = self._make_mpu(debug=True)
|
||||
mpu = self._make_mpu()
|
||||
mpu.memory[0x00BB] = 0xE0
|
||||
self._write(mpu.memory, 0x0000, [0x04, 0xBB]) #=> TSB $BD
|
||||
mpu.a = 0x70
|
||||
@ -980,7 +980,7 @@ class MPUTests(unittest.TestCase, Common6502Tests):
|
||||
self.assertEqual(5, mpu.processorCycles)
|
||||
|
||||
def test_tsb_sp_zeros(self):
|
||||
mpu = self._make_mpu(debug=True)
|
||||
mpu = self._make_mpu()
|
||||
mpu.memory[0x00BB] = 0x80
|
||||
self._write(mpu.memory, 0x0000, [0x04, 0xBB]) #=> TSB $BD
|
||||
mpu.a = 0x60
|
||||
@ -995,7 +995,7 @@ class MPUTests(unittest.TestCase, Common6502Tests):
|
||||
# TSB Absolute
|
||||
|
||||
def test_tsb_abs_ones(self):
|
||||
mpu = self._make_mpu(debug=True)
|
||||
mpu = self._make_mpu()
|
||||
mpu.memory[0xFEED] = 0xE0
|
||||
self._write(mpu.memory, 0x0000, [0x0C, 0xED, 0xFE]) #=> TSB $FEED
|
||||
mpu.a = 0x70
|
||||
@ -1007,7 +1007,7 @@ class MPUTests(unittest.TestCase, Common6502Tests):
|
||||
self.assertEqual(6, mpu.processorCycles)
|
||||
|
||||
def test_tsb_abs_zeros(self):
|
||||
mpu = self._make_mpu(debug=True)
|
||||
mpu = self._make_mpu()
|
||||
mpu.memory[0xFEED] = 0x80
|
||||
self._write(mpu.memory, 0x0000, [0x0C, 0xED, 0xFE]) #=> TSB $FEED
|
||||
mpu.a = 0x60
|
||||
@ -1021,7 +1021,7 @@ class MPUTests(unittest.TestCase, Common6502Tests):
|
||||
# TRB Zero Page
|
||||
|
||||
def test_trb_sp_ones(self):
|
||||
mpu = self._make_mpu(debug=True)
|
||||
mpu = self._make_mpu()
|
||||
mpu.memory[0x00BB] = 0xE0
|
||||
self._write(mpu.memory, 0x0000, [0x14, 0xBB]) #=> TRB $BD
|
||||
mpu.a = 0x70
|
||||
@ -1033,7 +1033,7 @@ class MPUTests(unittest.TestCase, Common6502Tests):
|
||||
self.assertEqual(5, mpu.processorCycles)
|
||||
|
||||
def test_trb_sp_zeros(self):
|
||||
mpu = self._make_mpu(debug=True)
|
||||
mpu = self._make_mpu()
|
||||
mpu.memory[0x00BB] = 0x80
|
||||
self._write(mpu.memory, 0x0000, [0x14, 0xBB]) #=> TRB $BD
|
||||
mpu.a = 0x60
|
||||
@ -1048,7 +1048,7 @@ class MPUTests(unittest.TestCase, Common6502Tests):
|
||||
# TRB Absolute
|
||||
|
||||
def test_trb_abs_ones(self):
|
||||
mpu = self._make_mpu(debug=True)
|
||||
mpu = self._make_mpu()
|
||||
mpu.memory[0xFEED] = 0xE0
|
||||
self._write(mpu.memory, 0x0000, [0x1C, 0xED, 0xFE]) #=> TRB $FEED
|
||||
mpu.a = 0x70
|
||||
@ -1060,7 +1060,7 @@ class MPUTests(unittest.TestCase, Common6502Tests):
|
||||
self.assertEqual(6, mpu.processorCycles)
|
||||
|
||||
def test_trb_abs_zeros(self):
|
||||
mpu = self._make_mpu(debug=True)
|
||||
mpu = self._make_mpu()
|
||||
mpu.memory[0xFEED] = 0x80
|
||||
self._write(mpu.memory, 0x0000, [0x1C, 0xED, 0xFE]) #=> TRB $FEED
|
||||
mpu.a = 0x60
|
||||
@ -1072,7 +1072,7 @@ class MPUTests(unittest.TestCase, Common6502Tests):
|
||||
self.assertEqual(6, mpu.processorCycles)
|
||||
|
||||
def test_dec_a_decreases_a(self):
|
||||
mpu = self._make_mpu(debug=True)
|
||||
mpu = self._make_mpu()
|
||||
self._write(mpu.memory, 0x0000, [0x3A]) #=> DEC A
|
||||
mpu.a = 0x48
|
||||
mpu.step()
|
||||
@ -1081,7 +1081,7 @@ class MPUTests(unittest.TestCase, Common6502Tests):
|
||||
self.assertEqual(0x47, mpu.a)
|
||||
|
||||
def test_dec_a_sets_zero_flag(self):
|
||||
mpu = self._make_mpu(debug=True)
|
||||
mpu = self._make_mpu()
|
||||
self._write(mpu.memory, 0x0000, [0x3A]) #=> DEC A
|
||||
mpu.a = 0x01
|
||||
mpu.step()
|
||||
@ -1090,7 +1090,7 @@ class MPUTests(unittest.TestCase, Common6502Tests):
|
||||
self.assertEqual(0x00, mpu.a)
|
||||
|
||||
def test_dec_a_wraps_at_zero(self):
|
||||
mpu = self._make_mpu(debug=True)
|
||||
mpu = self._make_mpu()
|
||||
self._write(mpu.memory, 0x0000, [0x3A]) #=> DEC A
|
||||
mpu.a = 0x00
|
||||
mpu.step()
|
||||
@ -1099,14 +1099,14 @@ class MPUTests(unittest.TestCase, Common6502Tests):
|
||||
self.assertEqual(0xFF, mpu.a)
|
||||
|
||||
def test_bra_forward(self):
|
||||
mpu = self._make_mpu(debug=True)
|
||||
mpu = self._make_mpu()
|
||||
self._write(mpu.memory, 0x0000, [0x80, 0x10]) #=> BRA $10
|
||||
mpu.step()
|
||||
self.assertEqual(0x12, mpu.pc)
|
||||
self.assertEqual(2, mpu.processorCycles)
|
||||
|
||||
def test_bra_backward(self):
|
||||
mpu = self._make_mpu(debug=True)
|
||||
mpu = self._make_mpu()
|
||||
self._write(mpu.memory, 0x0204, [0x80, 0xF0]) #=> BRA $F0
|
||||
mpu.pc = 0x0204
|
||||
mpu.step()
|
||||
|
Loading…
x
Reference in New Issue
Block a user