Author: hbelusca
Date: Fri Nov 1 02:28:47 2013
New Revision: 60818
URL:
http://svn.reactos.org/svn/reactos?rev=60818&view=rev
Log:
[FAST486]
Fix the type of a variable.
[NTVDM]
Introduce a BOP handler table for the 256 possible BOP functions and use it.
Modified:
branches/ntvdm/lib/fast486/fast486.c
branches/ntvdm/subsystems/ntvdm/bop.c
branches/ntvdm/subsystems/ntvdm/bop.h
branches/ntvdm/subsystems/ntvdm/emulator.c
branches/ntvdm/subsystems/ntvdm/emulator.h
Modified: branches/ntvdm/lib/fast486/fast486.c
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/fast486/fast486.c?rev…
==============================================================================
--- branches/ntvdm/lib/fast486/fast486.c [iso-8859-1] (original)
+++ branches/ntvdm/lib/fast486/fast486.c [iso-8859-1] Fri Nov 1 02:28:47 2013
@@ -219,7 +219,7 @@
NTAPI
Fast486Reset(PFAST486_STATE State)
{
- USHORT i;
+ FAST486_SEG_REGS i;
FAST486_MEM_READ_PROC MemReadCallback = State->MemReadCallback;
FAST486_MEM_WRITE_PROC MemWriteCallback = State->MemWriteCallback;
Modified: branches/ntvdm/subsystems/ntvdm/bop.c
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/bop.c?re…
==============================================================================
--- branches/ntvdm/subsystems/ntvdm/bop.c [iso-8859-1] (original)
+++ branches/ntvdm/subsystems/ntvdm/bop.c [iso-8859-1] Fri Nov 1 02:28:47 2013
@@ -13,12 +13,12 @@
#include "emulator.h"
#include "bios.h"
+#include "bop.h"
#include "dos.h"
-#include "vga.h"
-#include "pic.h"
-#include "ps2.h"
-#include "timer.h"
-
+//#include "vga.h"
+//#include "pic.h"
+//#include "ps2.h"
+//#include "timer.h"
LPCWSTR ExceptionName[] =
{
@@ -30,6 +30,266 @@
L"Bound Range Exceeded",
L"Invalid Opcode",
L"FPU Not Available"
+};
+
+EMULATOR_BOP_PROC BopProc[EMULATOR_MAX_BOP_NUM] =
+{
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ ControlBop
};
VOID WINAPI Exception(BYTE ExceptionNumber, LPWORD Stack)
Modified: branches/ntvdm/subsystems/ntvdm/bop.h
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/bop.h?re…
==============================================================================
--- branches/ntvdm/subsystems/ntvdm/bop.h [iso-8859-1] (original)
+++ branches/ntvdm/subsystems/ntvdm/bop.h [iso-8859-1] Fri Nov 1 02:28:47 2013
@@ -7,4 +7,10 @@
* Hermes Belusca-Maito (hermes.belusca(a)sfr.fr)
*/
+typedef VOID (WINAPI *EMULATOR_BOP_PROC)(LPWORD Stack);
+
+extern EMULATOR_BOP_PROC BopProc[EMULATOR_MAX_BOP_NUM];
+
+VOID WINAPI ControlBop(LPWORD Stack);
+
/* EOF */
Modified: branches/ntvdm/subsystems/ntvdm/emulator.c
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/emulator…
==============================================================================
--- branches/ntvdm/subsystems/ntvdm/emulator.c [iso-8859-1] (original)
+++ branches/ntvdm/subsystems/ntvdm/emulator.c [iso-8859-1] Fri Nov 1 02:28:47 2013
@@ -12,6 +12,7 @@
#include "emulator.h"
#include "bios.h"
+#include "bop.h"
#include "dos.h"
#include "vga.h"
#include "pic.h"
@@ -225,7 +226,6 @@
}
}
-VOID WINAPI ControlBop(LPWORD Stack);
static VOID WINAPI EmulatorBiosOperation(PFAST486_STATE State, UCHAR BopCode)
{
WORD StackSegment, StackPointer;
@@ -238,16 +238,10 @@
/* Get the stack */
Stack = (LPWORD)SEG_OFF_TO_PTR(StackSegment, StackPointer);
- switch (BopCode)
- {
- case EMULATOR_INT_BOP:
- ControlBop(Stack);
- break;
-
- default:
- DPRINT1("Invalid BOP code %u\n", BopCode);
- break;
- }
+ if (BopProc[BopCode] != NULL)
+ BopProc[BopCode](Stack);
+ else
+ DPRINT1("Invalid BOP code %u\n", BopCode);
}
static UCHAR WINAPI EmulatorIntAcknowledge(PFAST486_STATE State)
Modified: branches/ntvdm/subsystems/ntvdm/emulator.h
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/emulator…
==============================================================================
--- branches/ntvdm/subsystems/ntvdm/emulator.h [iso-8859-1] (original)
+++ branches/ntvdm/subsystems/ntvdm/emulator.h [iso-8859-1] Fri Nov 1 02:28:47 2013
@@ -35,8 +35,9 @@
#define EMULATOR_FLAG_ID (1 << 21)
/* Common definitions */
-#define EMULATOR_BOP 0xC4C4
-#define EMULATOR_INT_BOP 0xFF
+#define EMULATOR_BOP 0xC4C4
+#define EMULATOR_INT_BOP 0xFF
+#define EMULATOR_MAX_BOP_NUM 0xFF + 1
#define STACK_COUNTER 0
#define STACK_INT_NUM 1