}
bios_video_initialized = 1;
+
+ /* The BIOS text screen starts blank; remove any previous host output. */
+ fputs ("\033[2J\033[H", stdout);
+ fflush (stdout);
}
bios_cursor_start = (uint8_t) (cpu->regs[REG_CX] >> 8);
bios_cursor_end = (uint8_t) cpu->regs[REG_CX];
+ fputs ((bios_cursor_start & 0x20) ? "\033[?25l" : "\033[?25h", stdout);
+ fflush (stdout);
+
break;
case 0x02: { /* set cursor position */
#define MEM_SIZE (640UL << 10)
#define EXE_LOAD_SEG 0x0060
+static void restore_terminal_cursor (void) {
+
+ fputs ("\033[?25h", stdout);
+ fflush (stdout);
+
+}
+
static void usage (const char *argv0) {
fprintf (stderr, "Usage: %s [--trace] program.com\n", argv0);
}
}
+ if (atexit (restore_terminal_cursor) != 0) {
+
+ fprintf (stderr, "Failed to register terminal cursor cleanup\n");
+
+ free (mem);
+ return 1;
+
+ }
+
/* init_dos_heap(&cpu, 0x2000); */
init_ivt (&cpu);