From daab0484c3007441a2e2079845f74b1eba997116 Mon Sep 17 00:00:00 2001 From: "Adrian.Conlon" Date: Tue, 29 Aug 2017 22:35:56 +0100 Subject: [PATCH] Use corrected LR35902 library to run test loop. Signed-off-by: Adrian.Conlon --- LR35902/fusetest_LR35902/FuseTestRunner.cpp | 7 ++----- LR35902/inc/LR35902.h | 3 ++- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/LR35902/fusetest_LR35902/FuseTestRunner.cpp b/LR35902/fusetest_LR35902/FuseTestRunner.cpp index 9b275c6..c887c37 100644 --- a/LR35902/fusetest_LR35902/FuseTestRunner.cpp +++ b/LR35902/fusetest_LR35902/FuseTestRunner.cpp @@ -181,12 +181,9 @@ void Fuse::TestRunner::run() { initialise(); auto allowedCycles = m_test.registerState.tstates; try { - auto cycles = 0; - do { - cycles += m_cpu.step(); - } while (allowedCycles > cycles); + m_cpu.run(allowedCycles); check(); - } catch (std::logic_error& error) { + } catch (std::logic_error& error) { m_unimplemented = true; std::cerr << "**** Error: " << error.what() << std::endl; } diff --git a/LR35902/inc/LR35902.h b/LR35902/inc/LR35902.h index 0be15c8..ca02dc2 100644 --- a/LR35902/inc/LR35902.h +++ b/LR35902/inc/LR35902.h @@ -69,8 +69,9 @@ namespace EightBit { return cycles; } - protected: int run(int limit); + + protected: virtual int execute(uint8_t opcode); int step();