[NTVDM]
[reactos.git] / reactos / subsystems / ntvdm / bios / bios32 / bios32.c
index aab15d3..46d139f 100644 (file)
@@ -14,8 +14,9 @@
 #include <reactos/buildno.h>
 
 #include "emulator.h"
-#include "callback.h"
-#include "bop.h"
+#include "cpu/cpu.h" // for EMULATOR_FLAG_CF
+#include "int32.h"
+// #include "bop.h"
 
 #include "../bios.h"
 #include "../rom.h"
@@ -146,6 +147,16 @@ static VOID WINAPI BiosMiscService(LPWORD Stack)
 {
     switch (getAH())
     {
+        /* Keyboard intercept */
+        case 0x4F:
+        {
+            /* CF should be set but let's just set it again just in case */
+            /* Do not modify AL (the hardware scan code), but set CF to continue processing */
+            // setCF(1);
+            Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF;
+            break;
+        }
+
         /* Wait */
         case 0x86:
         {
@@ -230,10 +241,22 @@ static VOID WINAPI BiosMiscService(LPWORD Stack)
             break;
         }
 
+        /* Return Extended-Bios Data-Area Segment Address (PS) */
         case 0xC1:
+        {
+            // Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_CF;
+            // setES(???);
+
+            /* We do not support EBDA yet */
+            Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF;
+
+            break;
+        }
+
+        /* Pointing Device BIOS Interface (PS) */
         case 0xC2:
         {
-            DPRINT1("INT 15h, AH = 0x%02X must be implemented in order to support vendor mouse drivers\n");
+            DPRINT1("INT 15h, AH = C2h must be implemented in order to support vendor mouse drivers\n");
             break;
         }
 
@@ -489,11 +512,13 @@ static VOID InitializeBiosInt32(VOID)
 
 static VOID InitializeBiosInfo(VOID)
 {
+    RtlZeroMemory(Bct, sizeof(*Bct));
+
     Bct->Length     = sizeof(*Bct);
     Bct->Model      = BIOS_MODEL;
     Bct->SubModel   = BIOS_SUBMODEL;
     Bct->Revision   = BIOS_REVISION;
-    Bct->Feature[0] = 0x64; // At the moment we don't support "INT 15/AH=4Fh called upon INT 09h" nor "wait for external event (INT 15/AH=41h) supported"; see http://www.ctyme.com/intr/rb-1594.htm#Table510
+    Bct->Feature[0] = 0x70; // At the moment we don't support "wait for external event (INT 15/AH=41h)", we also don't have any "extended BIOS area allocated (usually at top of RAM)"; see http://www.ctyme.com/intr/rb-1594.htm#Table510
     Bct->Feature[1] = 0x00; // We don't support anything from here; see http://www.ctyme.com/intr/rb-1594.htm#Table511
     Bct->Feature[2] = 0x00;
     Bct->Feature[3] = 0x00;
@@ -517,6 +542,7 @@ static VOID InitializeBiosData(VOID)
     *(PBYTE)(SEG_OFF_TO_PTR(0xF000, 0xFFFE)) = BIOS_MODEL;
 
     /* Initialize the BDA contents */
+    RtlZeroMemory(Bda, sizeof(*Bda));
     Bda->EquipmentList = BIOS_EQUIPMENT_LIST;
 
     /*