Add stepping mode in runner
MODIFY
src/main.cpp
src/main.cpp
@@ -22,7 +22,6 @@ int main(int argc, char** argv) {
}
Runner runner(&parser);
- runner.exec();
QApplication app(argc, argv);
MainWindow m(&runner, &parser);
m.show();

MODIFY
src/runner.cpp
src/runner.cpp
@@ -46,6 +46,12 @@ int Runner::exec() {
return 0;
}
+int Runner::step() {
+ getInstruction(m_pc);
+ err = execInstruction(m_currentInstruction);
+ return 0;
+}
+
bool Runner::getInstruction(int pc) {
uint32_t word;
word = m_memory[pc] + (m_memory[pc + 1] << 8) + (m_memory[pc + 2] << 16) + (m_memory[pc + 3] << 24);

MODIFY
src/runner.h
src/runner.h
@@ -16,6 +16,7 @@ public:
~Runner();
int exec();
+ int step();
RunnerCache* getRunnerCachePtr() { return &m_cache; }
memory* getMemoryPtr() { return &m_memory; }

Add stepping mode in runner