ReactOS  0.4.14-dev-50-g13bb5e2
vidbios32.c
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: GPL - See COPYING in the top level directory
3  * PROJECT: ReactOS Virtual DOS Machine
4  * FILE: subsystems/mvdm/ntvdm/bios/bios32/vidbios32.c
5  * PURPOSE: VDM 32-bit Video BIOS
6  * PROGRAMMERS: Hermes Belusca-Maito (hermes.belusca@sfr.fr)
7  *
8  * NOTE: All of the real code is in bios/vidbios.c
9  */
10 
11 /* INCLUDES *******************************************************************/
12 
13 #include "ntvdm.h"
14 
15 #define NDEBUG
16 #include <debug.h>
17 
18 #include "emulator.h"
19 #include "cpu/bop.h"
20 #include "int32.h"
21 
22 #include "vidbios32.h"
23 #include <bios/vidbios.h>
24 #include "bios32p.h"
25 
26 /* DEFINES ********************************************************************/
27 
28 /* BOP Identifiers */
29 #define BOP_VIDEO_INT 0x10
30 
31 /* PUBLIC FUNCTIONS ***********************************************************/
32 
35 {
36  /*
37  * Set up a false stack to hardwire the BOP function (that can directly
38  * manipulate CPU registers) to the 32-bit interrupt function (which uses
39  * the stack to be able to modify the original CS:IP and FLAGS).
40  *
41  * See int32.h stack codes.
42  */
43  WORD EmuStack[4];
44  DWORD Flags = getEFLAGS();
45 
46  DPRINT1("Calling BOP VidBiosINT\n");
47 
48  EmuStack[STACK_FLAGS] = LOWORD(Flags);
49  EmuStack[STACK_CS] = getCS();
50  EmuStack[STACK_IP] = getIP();
51  EmuStack[STACK_INT_NUM] = BOP_VIDEO_INT;
52 
53  VidBiosVideoService(EmuStack);
54 
55  setIP(EmuStack[STACK_IP]);
56  setCS(EmuStack[STACK_CS]);
58 }
59 
61 {
62  /* Register the BIOS support BOPs */
64  return TRUE;
65 }
66 
68 {
69  /* Unregister the BIOS support BOPs */
71 }
72 
73 /* EOF */
VOID VidBios32Cleanup(VOID)
Definition: vidbios32.c:67
#define STACK_INT_NUM
Definition: int32.h:30
VOID WINAPI setIP(USHORT)
Definition: registers.c:471
#define TRUE
Definition: types.h:120
VOID RegisterBop(BYTE BopCode, EMULATOR_BOP_PROC BopHandler)
Definition: bop.c:29
VOID WINAPI VidBiosVideoService(LPWORD Stack)
Definition: vidbios.c:2947
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
ULONG WINAPI getEFLAGS(VOID)
Definition: registers.c:680
#define MAKELONG(a, b)
Definition: typedefs.h:248
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
#define STACK_FLAGS
Definition: int32.h:35
USHORT WINAPI getIP(VOID)
Definition: registers.c:464
#define WINAPI
Definition: msvc.h:8
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOLEAN VidBios32Initialize(VOID)
Definition: vidbios32.c:60
static VOID WINAPI VidBiosINT(LPWORD Stack)
Definition: vidbios32.c:34
VOID WINAPI setEFLAGS(ULONG)
Definition: registers.c:687
#define STACK_CS
Definition: int32.h:34
uint16_t * LPWORD
Definition: typedefs.h:54
VOID WINAPI setCS(USHORT)
Definition: registers.c:487
#define DPRINT1
Definition: precomp.h:8
#define HIWORD(l)
Definition: typedefs.h:246
#define BOP_VIDEO_INT
Definition: vidbios32.c:29
#define STACK_IP
Definition: int32.h:33
USHORT WINAPI getCS(VOID)
Definition: registers.c:480
#define LOWORD(l)
Definition: pedump.c:82