summaryrefslogtreecommitdiff
path: root/nandgame/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'nandgame/cpp')
-rw-r--r--nandgame/cpp/CMakeLists.txt2
-rw-r--r--nandgame/cpp/Vcomputer__main.cpp2
-rw-r--r--nandgame/cpp/simpc_config.h2
-rw-r--r--nandgame/cpp/simpc_ui.cpp9
4 files changed, 5 insertions, 10 deletions
diff --git a/nandgame/cpp/CMakeLists.txt b/nandgame/cpp/CMakeLists.txt
index 99318c1..b87ccaa 100644
--- a/nandgame/cpp/CMakeLists.txt
+++ b/nandgame/cpp/CMakeLists.txt
@@ -4,7 +4,7 @@ project(simpc)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
-find_package(verilator HINTS $ENV{VERILATOR_ROOT})
+find_package(verilator REQUIRED HINTS $ENV{VERILATOR_ROOT})
find_package(Curses)
find_package(FLTK)
diff --git a/nandgame/cpp/Vcomputer__main.cpp b/nandgame/cpp/Vcomputer__main.cpp
index 77e291f..a09deea 100644
--- a/nandgame/cpp/Vcomputer__main.cpp
+++ b/nandgame/cpp/Vcomputer__main.cpp
@@ -57,7 +57,7 @@ int main(int argc, char **argv, char **) {
!topp->halt) {
auto i = contextp->time();
- if (i != 0 && (i % TICKS_PER_INS) == 0) {
+ if (i != 0 && (i % TICKS_PER_CLOCK_PERIOD) == 0) {
topp->clk_in = !topp->clk_in;
}
diff --git a/nandgame/cpp/simpc_config.h b/nandgame/cpp/simpc_config.h
index 39ad7b5..d021861 100644
--- a/nandgame/cpp/simpc_config.h
+++ b/nandgame/cpp/simpc_config.h
@@ -1,4 +1,4 @@
#pragma once
-#define TICKS_PER_INS 2
+#define TICKS_PER_CLOCK_PERIOD 1
#define NCUR_DELAY_MS 10
diff --git a/nandgame/cpp/simpc_ui.cpp b/nandgame/cpp/simpc_ui.cpp
index 64d799d..c87c62e 100644
--- a/nandgame/cpp/simpc_ui.cpp
+++ b/nandgame/cpp/simpc_ui.cpp
@@ -2,6 +2,7 @@
#include "simpc_config.h"
#include "disas.h"
+#include <cassert>
#define MEMORY_CONTEXT 3
@@ -16,6 +17,7 @@
if (resized) { \
/* ????*/ \
resized = 0; \
+ clear(); \
} \
refresh(); \
wrefresh(status_top); \
@@ -174,13 +176,6 @@ void simpc_ui_init(void) {
RAM2 = newwin(numlines, 15, 10, romwidth + ram1width);
wrefresh(RAM2);
- int rc;
-
- rc = wresize(stdscr, getmaxy(stdscr) - 3, getmaxx(stdscr));
- assert(rc == 0);
- rc = mvwin(stdscr, 3, 0);
- assert(rc == 0);
-
nodelay(stdscr, TRUE);
noecho();
cbreak();