From: Robert Pengelly Date: Tue, 20 Oct 2026 18:58:04 +0000 (+0100) Subject: Added INT 10h video palette support X-Git-Url: https://git.candlhat.org/?a=commitdiff_plain;h=508579307a10eba3598e28e8fe831e8686334fe0;p=dosemu.git Added INT 10h video palette support --- diff --git a/interrupts.c b/interrupts.c index 6d91ffd..050a284 100644 --- a/interrupts.c +++ b/interrupts.c @@ -8673,6 +8673,7 @@ static void bios_video_update_bda (CPU8086 *cpu) { mem_write8 (cpu->mem, cpu->mem_size, 0x462, 0); mem_write16 (cpu->mem, cpu->mem_size, 0x463, bios_video_mode == 7 ? 0x3B4 : 0x3D4); + mem_write8 (cpu->mem, cpu->mem_size, 0x466, 0); cpu->crtc_base = bios_video_mode == 7 ? 0x3B4 : 0x3D4; cpu_crtc_set_cursor (cpu, bios_cursor_row[0], bios_cursor_col[0], bios_video_columns); @@ -9083,6 +9084,25 @@ static void int_10 (CPU8086 *cpu) { } + case 0x0B: { /* set background/border colour or CGA palette */ + + uint8_t bh = (uint8_t) (cpu->regs[REG_BX] >> 8); + + if (bh == 0 && bios_video_mode <= 0x03) { + + uint8_t color = mem_read8 (cpu->mem, cpu->mem_size, 0x466); + uint8_t border = (uint8_t) (cpu->regs[REG_BX] & 0x1F); + + /* Text modes only change the border, not character attributes. */ + mem_write8 (cpu->mem, cpu->mem_size, 0x466, (uint8_t) ((color & 0xE0) | border)); + + } + + /* BH=01h selects a CGA graphics palette; graphics modes are not supported. */ + break; + + } + case 0x0E: { uint8_t al = get_reg8 (cpu, 0);