From de37edae975be0f2cf34c26a5813c0f8e88783ba Mon Sep 17 00:00:00 2001 From: Mike Naberezny Date: Thu, 18 Dec 2014 22:24:03 -0800 Subject: [PATCH] Add test for WAI instruction --- py65/tests/devices/test_mpu65c02.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/py65/tests/devices/test_mpu65c02.py b/py65/tests/devices/test_mpu65c02.py index 480323a..612dedd 100644 --- a/py65/tests/devices/test_mpu65c02.py +++ b/py65/tests/devices/test_mpu65c02.py @@ -1375,6 +1375,19 @@ class MPUTests(unittest.TestCase, Common6502Tests): self.assertEqual(0x1F6, mpu.pc) self.assertEqual(3, mpu.processorCycles) # Crossed boundry + # WAI + + def test_wai_sets_waiting(self): + mpu = self._make_mpu() + self.assertFalse(mpu.waiting) + # $0240 WAI + self._write(mpu.memory, 0x0204, [0xCB]) + mpu.pc = 0x0204 + mpu.step() + self.assertTrue(mpu.waiting) + self.assertEqual(0x0205, mpu.pc) + self.assertEqual(3, mpu.processorCycles) + # Test Helpers def _get_target_class(self):