andreas-jonsson / virtualxt

Portable, lightweight Turbo PC/XT emulator written in C.
https://virtualxt.org
zlib License
78 stars 17 forks source link

Terminal frontend #25

Open andreas-jonsson opened 2 years ago

andreas-jonsson commented 2 years ago

Port the old terminal frontend to edge branch.

fmahnke commented 2 years ago

Is this a terminal emulator UI for text modes? If so, I'd use it. Although I currently hack in debug output to port 0xe9 (like Bochs), and it works just fine.

diff --git a/lib/vxt/system.c b/lib/vxt/system.c
index f55e489..d59069d 100644
--- a/lib/vxt/system.c
+++ b/lib/vxt/system.c
@@ -306,4 +306,9 @@ void system_out(CONSTP(vxt_system) s, vxt_word port, vxt_byte data) {
     CONSTSP(vxt_pirepheral) dev = s->devices[s->io_map[port]];
     VALIDATOR_DISCARD(&s->cpu);
     dev->io.out(dev, port, data);
+
+    if (port == 0xe9) {
+        VXT_PRINT("%c", data);
+    }
 }
andreas-jonsson commented 2 years ago

That's more like the postcard.c device available with the -Dat build option. It can be useful. But I was thinking more like using the mda.c to render a full-blown TUI in the terminal with Termbox (available in the lib directory)

andreas-jonsson commented 9 months ago

It boots and render! https://github.com/andreas-jonsson/virtualxt/tree/terminal-frontend (Requires static modules)