// Execute a single cpu step int executeCPU(Cpu *cpu) { #ifdef DEBUG if (debug(false, cpu)) { return 1; } #endif int errNum = executeNextInstruction(cpu); if (errNum) { #ifdef DEBUG // Force a run/runto to stop when an error has occurred return (debug(true, cpu)) ? 1 : 0; #else // Exit if non-debug. TODO: output some sort of error message (Maybe method that can popup a box on display builds) return errNum; #endif } else { return 0; } }
void LLCCEP_exec::softcore::executeProgram() { SOFTCORE_OK; pc = reader->getProgramData().main_id; QEventLoop ev; while (!quit) { executeNextInstruction(); ev.processEvents(QEventLoop::AllEvents, 100); } if (windows.size()) { for (const auto &i: windows) i->setMayClose(); } else { QApplication::quit(); } SOFTCORE_OK; }