reactos/subsystems/ntvdm/bop.c
Hermès Bélusca-Maïto d944afa5c7 [NTVDM]
Shut up few DPRINT1s, and demote some DPRINT1s to DPRINTs but disable NDEBUG for now (enable it and you'll shut up the DPRINTs).

svn path=/branches/ntvdm/; revision=61451
2013-12-27 19:51:43 +00:00

51 lines
1.4 KiB
C

/*
* COPYRIGHT: GPL - See COPYING in the top level directory
* PROJECT: ReactOS Virtual DOS Machine
* FILE: bop.c
* PURPOSE: BIOS Operation Handlers
* PROGRAMMERS: Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org>
* Hermes Belusca-Maito (hermes.belusca@sfr.fr)
*/
/* INCLUDES *******************************************************************/
// #define NDEBUG
#include "emulator.h"
#include "bop.h"
/* PRIVATE VARIABLES **********************************************************/
/*
* This is the list of registered BOP handlers.
*/
EMULATOR_BOP_PROC BopProc[EMULATOR_MAX_BOP_NUM] = { NULL };
/* PUBLIC FUNCTIONS ***********************************************************/
VOID RegisterBop(BYTE BopCode, EMULATOR_BOP_PROC BopHandler)
{
BopProc[BopCode] = BopHandler;
}
VOID WINAPI EmulatorBiosOperation(PFAST486_STATE State, UCHAR BopCode)
{
WORD StackSegment, StackPointer;
LPWORD Stack;
/* Get the SS:SP */
StackSegment = State->SegmentRegs[FAST486_REG_SS].Selector;
StackPointer = State->GeneralRegs[FAST486_REG_ESP].LowWord;
/* Get the stack */
Stack = (LPWORD)SEG_OFF_TO_PTR(StackSegment, StackPointer);
/* Call the BOP handler */
if (BopProc[BopCode] != NULL)
BopProc[BopCode](Stack);
else
DPRINT("Invalid BOP code: 0x%02X\n", BopCode);
}
/* EOF */