2 * Acess2 VM8086 BIOS Interface
3 * - By John Hodge (thePowersGang)
13 * \note Semi-opaque - Past \a .IP, the implementation may add any data
14 * it needs to the state.
16 typedef struct sVM8086
18 Uint16 AX, CX, DX, BX;
19 Uint16 BP, SP, SI, DI;
25 struct sVM8086_InternalData *Internal;
30 * \brief Create an instance of the VM8086 Emulator
31 * \note Do not free this pointer with ::free, instead use ::VM8086_Free
32 * \return Pointer to a tVM8086 structure, this structure may be larger than
33 * tVM8086 due to internal data.
35 extern tVM8086 *VM8086_Init(void);
37 * \brief Free an allocated tVM8086 structure
38 * \param State Emulator state to free
40 extern void VM8086_Free(tVM8086 *State);
42 * \brief Allocate a piece of memory in the emulated address space and
43 * return a host and emulated pointer to it.
44 * \param State Emulator state
45 * \param Size Size of memory block
46 * \param Segment Pointer to location to store the allocated memory's segment
47 * \param Offset Pointet to location to store the allocated memory's offset
48 * \return Host pointer to the allocated memory
50 extern void *VM8086_Allocate(tVM8086 *State, int Size, Uint16 *Segment, Uint16 *Offset);
52 * \brief Gets a pointer to a piece of emulated memory
53 * \todo Only 1 machine page is garenteed to be contiguous
54 * \param State Emulator State
55 * \param Segment Source Segment
56 * \param Offset Source Offset
57 * \return Host pointer to the emulated memory
59 extern void *VM8086_GetPointer(tVM8086 *State, Uint16 Segment, Uint16 Ofs);
61 * \brief Calls a real-mode interrupt described by the current state of the IVT.
62 * \param State Emulator State
63 * \param Interrupt BIOS Interrupt to call
65 extern void VM8086_Int(tVM8086 *State, Uint8 Interrupt);