diff --git a/src/spider/ByteCodeContent.cpp b/src/spider/ByteCodeContent.cpp index 9698042..0303a3c 100644 --- a/src/spider/ByteCodeContent.cpp +++ b/src/spider/ByteCodeContent.cpp @@ -32,6 +32,10 @@ namespace spider { u32 offX = u32(block * 8 + col); int ascii_index = col + block * 8; + // Is currently on cpu.RI? + bool onRI = offset == runtime.cpu.RI; + if(onRI) t << backg::B_WHITE << color::BLACK; + // Is currently selected thing? bool selected = offX == ipX && u32(row) == ipY && menuSelected && mainMenuID == 0x13; if(selected) t << backg::B_GREEN << color::BLACK; @@ -62,7 +66,18 @@ namespace spider { // --- ASCII Output Loop --- for (int i = 0; i < 16; ++i) { + u64 offset = u64(row * 16 + i); + + // Is currently on cpu.RI? + bool onRI = offset == runtime.cpu.RI; + if(onRI) t << backg::B_WHITE << color::BLACK; + + // Is currently selected thing? + bool selected = u32(i) == ipX && u32(row) == ipY && menuSelected && mainMenuID == 0x13; + if(selected) t << backg::B_GREEN << color::BLACK; + t << ascii[i]; + t << style::RESET << color::WHITE; if (i == 7) t << ' '; } } diff --git a/src/spider/DrawVM.cpp b/src/spider/DrawVM.cpp index af88022..3354d35 100644 --- a/src/spider/DrawVM.cpp +++ b/src/spider/DrawVM.cpp @@ -49,6 +49,7 @@ namespace spider { }; t << style::RESET; + t << pos(0, 0) << cpu.RA._u64; for (i32 i = 0; i < 8; i++) { t << alt[i & 1]; t << pos(c, r + i * 2); diff --git a/src/spider/LiveDebug.cpp b/src/spider/LiveDebug.cpp index c7a329b..87324fc 100644 --- a/src/spider/LiveDebug.cpp +++ b/src/spider/LiveDebug.cpp @@ -90,12 +90,20 @@ namespace spider { void panelAction() { switch(mainMenuID) { case 1: // STEP - //runtime.step(); + runtime.step(); cyclesRan++; + updateRAM = true; + updateReel = true; break; case 2: // RUN + runVM = true; + updateRAM = true; + updateReel = true; break; case 3: // STOP + runVM = false; + updateRAM = true; + updateReel = true; break; case 4: // MENU break; // TODO: DO THIS @@ -189,8 +197,6 @@ namespace spider { u64 ip = std::min(reel_content.ipX + reel_content.ipY * 16, maxIP); reel_content.ipX = ip % 16; reel_content.ipY = ip / 16; - auto& t = *term; - t << pos(0, 0) << ip << ", " << maxIP; reel_content.input.accept(char(k)); updateReel = true; } @@ -239,6 +245,9 @@ namespace spider { // Favour the thread doing other stuff if(runVM) { // IF the vm is not continously running + cyclesRan += runtime.run(50); // run for 50 ms + updateRAM = true; + updateReel = true; std::this_thread::yield(); } else { std::this_thread::sleep_for(std::chrono::milliseconds(50));