mirror of
https://github.com/mnaberez/py65.git
synced 2025-08-15 11:27:26 +00:00
Fill memory with $AA to prevent false positives with tests expecting $00.
This commit is contained in:
@@ -2096,7 +2096,7 @@ class Common6502Tests:
|
|||||||
mpu.a = 0xFF
|
mpu.a = 0xFF
|
||||||
mpu.x = 0x03
|
mpu.x = 0x03
|
||||||
self._write(mpu.memory, 0x0000, (0xBD, 0xCD, 0xAB)) #=> LDA $ABCD,X
|
self._write(mpu.memory, 0x0000, (0xBD, 0xCD, 0xAB)) #=> LDA $ABCD,X
|
||||||
mpu.memory[0xABCD + mpu.y] = 0x00
|
mpu.memory[0xABCD + mpu.x] = 0x00
|
||||||
mpu.step()
|
mpu.step()
|
||||||
self.assertEquals(0x0003, mpu.pc)
|
self.assertEquals(0x0003, mpu.pc)
|
||||||
self.assertEquals(0x00, mpu.a)
|
self.assertEquals(0x00, mpu.a)
|
||||||
@@ -3865,7 +3865,7 @@ class Common6502Tests:
|
|||||||
mpu.a = 0x00
|
mpu.a = 0x00
|
||||||
mpu.y = 0x03
|
mpu.y = 0x03
|
||||||
self._write(mpu.memory, 0x0000, (0xF1, 0x10)) #=> SBC ($10),Y
|
self._write(mpu.memory, 0x0000, (0xF1, 0x10)) #=> SBC ($10),Y
|
||||||
self._write(mpu.memory, 0x0013, (0xED, 0xFE)) #=> Vector to $FEED
|
self._write(mpu.memory, 0x0010, (0xED, 0xFE)) #=> Vector to $FEED
|
||||||
mpu.memory[0xFEED + mpu.y] = 0x00
|
mpu.memory[0xFEED + mpu.y] = 0x00
|
||||||
mpu.step()
|
mpu.step()
|
||||||
self.assertEquals(0x00, mpu.a)
|
self.assertEquals(0x00, mpu.a)
|
||||||
@@ -4617,7 +4617,10 @@ class Common6502Tests:
|
|||||||
|
|
||||||
def _make_mpu(self, *args, **kargs):
|
def _make_mpu(self, *args, **kargs):
|
||||||
klass = self._get_target_class()
|
klass = self._get_target_class()
|
||||||
return klass(*args, **kargs)
|
mpu = klass(*args, **kargs)
|
||||||
|
if not kargs.has_key('memory'):
|
||||||
|
mpu.memory = 0x10000 * [0xAA]
|
||||||
|
return mpu
|
||||||
|
|
||||||
def _get_target_class(self):
|
def _get_target_class(self):
|
||||||
raise NotImplementedError, "Target class not specified"
|
raise NotImplementedError, "Target class not specified"
|
||||||
|
Reference in New Issue
Block a user