Fix EMM386 and OPTi audio detection
authorRobert Pengelly <robertapengelly@hotmail.com>
Thu, 29 Oct 2026 20:24:09 +0000 (20:24 +0000)
committerRobert Pengelly <robertapengelly@hotmail.com>
Thu, 29 Oct 2026 20:24:09 +0000 (20:24 +0000)
cpu.c
interrupts.c

diff --git a/cpu.c b/cpu.c
index f0e09ecc24d09ba28dba6b55a59e27fce20959c8..a6d4fa3e63ab466a113d5ad3e419138a16a32913 100644 (file)
--- a/cpu.c
+++ b/cpu.c
@@ -1743,7 +1743,7 @@ static int io_absent_sound_port (uint16_t port) {
     }
     
     if ((port >= 0x788 && port <= 0x78B) || (port >= 0xB88 && port <= 0xB8B) ||
-            (port >= 0xF88 && port <= 0xF8B) || (port >= 0x1388 && port <= 0x138B) ||
+        (port >= 0xF88 && port <= 0xF8F) || (port >= 0x1388 && port <= 0x138B) ||
             (port >= 0x1788 && port <= 0x178B) || (port >= 0x1B88 && port <= 0x1B8B)) {
         return 1;
     }
index 5ff82c933cf39d4d63cd2b0b630ee186d4139306..d3adf6c47b4b1a592e433555e42a3864b778563e 100644 (file)
@@ -12270,6 +12270,10 @@ void native_interrupt (CPU8086 *cpu, uint8_t interrupt_number) {
          
         case 0x67:
         
+            if (cpu->regs[REG_AX] == 0xFFA5) {
+                break;                  /* EMM386 installation check: not installed */
+            }
+            
             if (cpu->regs[REG_AX] == 0xDE00) {
                 cpu->regs[REG_AX] = 0x8400;
             } else {