From 5a265b1a096cd992c91d04737a77a698a49ff688 Mon Sep 17 00:00:00 2001 From: Robert Pengelly Date: Thu, 29 Oct 2026 09:25:25 +0000 Subject: [PATCH] Fix VGA status polling and parallel port detection for Wolfenstein 3D --- cpu.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cpu.c b/cpu.c index a7e69b3..accde9c 100644 --- a/cpu.c +++ b/cpu.c @@ -2074,12 +2074,16 @@ static uint8_t io_read8 (CPU8086 *cpu, uint16_t port) { } + case 0x379: case 0x3BD: case 0x279: /* Parallel port status */ + + return 0xFF; + case 0x3BA: case 0x3DA: /* VGA input status 1 */ cpu->vga_attr_flipflop = 0; cpu->vga_status_flip++; - return (uint8_t) ((cpu->vga_status_flip & 0x01) | ((cpu->vga_status_flip & 0xE0) == 0xE0 ? 0x08 : 0x00)); + return (uint8_t) (((cpu->vga_status_flip & 0x1F) >= 24 ? 0x01 : 0x00) | ((cpu->vga_status_flip & 0xE0) == 0xE0 ? 0x08 : 0x00)); case 0x3C0: /* VGA attribute controller index */ -- 2.34.1