From 5519f3806d7b2923980b3772e74042ed68da931a Mon Sep 17 00:00:00 2001 From: Robert Pengelly Date: Tue, 20 Oct 2026 21:16:47 +0100 Subject: [PATCH] Added BIOS video character reads and font-call handling --- interrupts.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/interrupts.c b/interrupts.c index fdc95fc..33a31b9 100644 --- a/interrupts.c +++ b/interrupts.c @@ -9520,6 +9520,31 @@ static void int_10 (CPU8086 *cpu) { } + case 0x08: { /* read character and attribute at cursor */ + + uint8_t page = (uint8_t) (cpu->regs[REG_BX] >> 8); + + unsigned row, col; + uint32_t address; + + if (page >= bios_video_page_count ()) { + break; + } + + row = bios_cursor_row[page]; + col = bios_cursor_col[page]; + + if (row >= bios_video_rows || col >= bios_video_columns) { + break; + } + + address = bios_video_page_base (page) + (row * bios_video_columns + col) * 2; + + cpu->regs[REG_AX] = mem_read8 (cpu->mem, cpu->mem_size, address) | ((uint16_t) mem_read8 (cpu->mem, cpu->mem_size, address + 1) << 8); + break; + + } + case 0x09: { /* write character and attribute */ uint8_t page = (uint8_t) (cpu->regs[REG_BX] >> 8); @@ -9657,6 +9682,11 @@ static void int_10 (CPU8086 *cpu) { set_reg8 (cpu, 4, (uint8_t) bios_video_columns); break; + case 0x11: /* EGA/VGA character generator */ + + /* The emulated CGA/MDA text adapters have no programmable fonts. */ + break; + case 0x12: /* EGA/VGA alternate function select */ /* No EGA/VGA: leave BL=10h unchanged for EGA detection. */ -- 2.34.1