ReactOS 0.4.15-dev-8116-gf69e256
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];
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 */
unsigned char BOOLEAN
#define DPRINT1
Definition: precomp.h:8
VOID RegisterBop(BYTE BopCode, EMULATOR_BOP_PROC BopHandler)
Definition: bop.c:29
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
#define STACK_IP
Definition: int32.h:33
#define STACK_FLAGS
Definition: int32.h:35
#define STACK_INT_NUM
Definition: int32.h:30
#define STACK_CS
Definition: int32.h:34
#define LOWORD(l)
Definition: pedump.c:82
uint16_t * LPWORD
Definition: typedefs.h:56
#define MAKELONG(a, b)
Definition: typedefs.h:249
#define HIWORD(l)
Definition: typedefs.h:247
USHORT WINAPI getIP(VOID)
Definition: registers.c:464
VOID WINAPI setEFLAGS(ULONG)
Definition: registers.c:687
VOID WINAPI setCS(USHORT)
Definition: registers.c:487
USHORT WINAPI getCS(VOID)
Definition: registers.c:480
ULONG WINAPI getEFLAGS(VOID)
Definition: registers.c:680
VOID WINAPI setIP(USHORT)
Definition: registers.c:471
static VOID WINAPI VidBiosINT(LPWORD Stack)
Definition: vidbios32.c:34
VOID WINAPI VidBiosVideoService(LPWORD Stack)
Definition: vidbios.c:2947
VOID VidBios32Cleanup(VOID)
Definition: vidbios32.c:67
BOOLEAN VidBios32Initialize(VOID)
Definition: vidbios32.c:60
#define BOP_VIDEO_INT
Definition: vidbios32.c:29
_In_ WDFREQUEST _In_ PIO_STACK_LOCATION Stack
Definition: wdfrequest.h:639
#define WINAPI
Definition: msvc.h:6
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170