changes
This commit is contained in:
@@ -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 << ' ';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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<u64>(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));
|
||||
|
||||
Reference in New Issue
Block a user