mirror of
https://github.com/reactos/reactos.git
synced 2025-05-19 00:54:18 +00:00
[NTVDM]: Break the BIOS into the BIOS and the video BIOS.
svn path=/branches/ntvdm/; revision=61586
This commit is contained in:
parent
3d36bf4451
commit
25105f6bec
6 changed files with 1635 additions and 1543 deletions
|
@ -7,6 +7,7 @@ spec2def(ntvdm.exe ntvdm.spec)
|
|||
|
||||
list(APPEND SOURCE
|
||||
bios/bios.c
|
||||
bios/vidbios.c
|
||||
hardware/cmos.c
|
||||
hardware/pic.c
|
||||
hardware/ps2.c
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -12,6 +12,7 @@
|
|||
/* INCLUDES *******************************************************************/
|
||||
|
||||
#include "ntvdm.h"
|
||||
#include "vidbios.h"
|
||||
|
||||
/* DEFINES ********************************************************************/
|
||||
|
||||
|
@ -24,7 +25,6 @@
|
|||
#define BIOS_PIC_MASTER_INT 0x08
|
||||
#define BIOS_PIC_SLAVE_INT 0x70
|
||||
|
||||
#define BIOS_VIDEO_INTERRUPT 0x10
|
||||
#define BIOS_EQUIPMENT_INTERRUPT 0x11
|
||||
#define BIOS_MEMORY_SIZE 0x12
|
||||
#define BIOS_MISC_INTERRUPT 0x15
|
||||
|
@ -32,18 +32,9 @@
|
|||
#define BIOS_TIME_INTERRUPT 0x1A
|
||||
#define BIOS_SYS_TIMER_INTERRUPT 0x1C
|
||||
|
||||
#define CONSOLE_FONT_HEIGHT 8
|
||||
#define BIOS_KBD_BUFFER_SIZE 16
|
||||
#define BIOS_EQUIPMENT_LIST 0x2C // HACK: Disable FPU for now
|
||||
|
||||
#define BIOS_DEFAULT_VIDEO_MODE 0x03
|
||||
#define BIOS_MAX_PAGES 8
|
||||
#define BIOS_MAX_VIDEO_MODE 0x13
|
||||
#define DEFAULT_ATTRIBUTE 0x07
|
||||
|
||||
#define GRAPHICS_VIDEO_SEG 0xA000
|
||||
#define TEXT_VIDEO_SEG 0xB800
|
||||
|
||||
#define BDA_KBDFLAG_RSHIFT (1 << 0)
|
||||
#define BDA_KBDFLAG_LSHIFT (1 << 1)
|
||||
#define BDA_KBDFLAG_CTRL (1 << 2)
|
||||
|
@ -61,14 +52,6 @@
|
|||
#define BDA_KBDFLAG_CAPSLOCK (1 << 14)
|
||||
#define BDA_KBDFLAG_INSERT (1 << 15)
|
||||
|
||||
enum
|
||||
{
|
||||
SCROLL_DIRECTION_UP,
|
||||
SCROLL_DIRECTION_DOWN,
|
||||
SCROLL_DIRECTION_LEFT,
|
||||
SCROLL_DIRECTION_RIGHT
|
||||
};
|
||||
|
||||
/*
|
||||
* BIOS Data Area at 0040:XXXX
|
||||
*
|
||||
|
@ -153,7 +136,6 @@ extern PBIOS_DATA_AREA Bda;
|
|||
|
||||
WORD BiosPeekCharacter(VOID);
|
||||
WORD BiosGetCharacter(VOID);
|
||||
VOID BiosPrintCharacter(CHAR Character, BYTE Attribute, BYTE Page);
|
||||
|
||||
BOOLEAN BiosInitialize(VOID);
|
||||
VOID BiosCleanup(VOID);
|
||||
|
|
1581
subsystems/ntvdm/bios/vidbios.c
Normal file
1581
subsystems/ntvdm/bios/vidbios.c
Normal file
File diff suppressed because it is too large
Load diff
46
subsystems/ntvdm/bios/vidbios.h
Normal file
46
subsystems/ntvdm/bios/vidbios.h
Normal file
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* COPYRIGHT: GPL - See COPYING in the top level directory
|
||||
* PROJECT: ReactOS Virtual DOS Machine
|
||||
* FILE: vidbios.h
|
||||
* PURPOSE: VDM Video BIOS
|
||||
* PROGRAMMERS: Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org>
|
||||
*/
|
||||
|
||||
#ifndef _VIDBIOS_H_
|
||||
#define _VIDBIOS_H_
|
||||
|
||||
/* INCLUDES *******************************************************************/
|
||||
|
||||
#include "ntvdm.h"
|
||||
|
||||
/* DEFINES ********************************************************************/
|
||||
|
||||
#define BIOS_VIDEO_INTERRUPT 0x10
|
||||
|
||||
#define CONSOLE_FONT_HEIGHT 8
|
||||
#define BIOS_DEFAULT_VIDEO_MODE 0x03
|
||||
#define BIOS_MAX_PAGES 8
|
||||
#define BIOS_MAX_VIDEO_MODE 0x13
|
||||
#define DEFAULT_ATTRIBUTE 0x07
|
||||
|
||||
#define GRAPHICS_VIDEO_SEG 0xA000
|
||||
#define TEXT_VIDEO_SEG 0xB800
|
||||
|
||||
enum
|
||||
{
|
||||
SCROLL_DIRECTION_UP,
|
||||
SCROLL_DIRECTION_DOWN,
|
||||
SCROLL_DIRECTION_LEFT,
|
||||
SCROLL_DIRECTION_RIGHT
|
||||
};
|
||||
|
||||
/* FUNCTIONS ******************************************************************/
|
||||
|
||||
VOID VidBiosPrintCharacter(CHAR Character, BYTE Attribute, BYTE Page);
|
||||
|
||||
BOOLEAN VidBiosInitialize(HANDLE BiosConsoleOutput);
|
||||
VOID VidBiosCleanup(VOID);
|
||||
|
||||
#endif // _VIDBIOS_H_
|
||||
|
||||
/* EOF */
|
|
@ -732,7 +732,7 @@ WORD DosWriteFile(WORD FileHandle, LPVOID Buffer, WORD Count, LPWORD BytesWritte
|
|||
for (i = 0; i < Count; i++)
|
||||
{
|
||||
/* Call the BIOS to print the character */
|
||||
BiosPrintCharacter(((LPBYTE)Buffer)[i], DOS_CHAR_ATTRIBUTE, Bda->VideoPage);
|
||||
VidBiosPrintCharacter(((LPBYTE)Buffer)[i], DOS_CHAR_ATTRIBUTE, Bda->VideoPage);
|
||||
BytesWritten32++;
|
||||
}
|
||||
}
|
||||
|
@ -2679,11 +2679,11 @@ VOID WINAPI DosFastConOut(LPWORD Stack)
|
|||
|
||||
/*
|
||||
* The default handler under DOS 2.x and 3.x simply calls INT 10/AH=0Eh.
|
||||
* Do better and call directly BiosPrintCharacter: it's what INT 10/AH=0Eh
|
||||
* Do better and call directly VidBiosPrintCharacter: it's what INT 10/AH=0Eh
|
||||
* does. Otherwise we would have to set BL to DOS_CHAR_ATTRIBUTE and
|
||||
* BH to Bda->VideoPage.
|
||||
*/
|
||||
BiosPrintCharacter(getAL(), DOS_CHAR_ATTRIBUTE, Bda->VideoPage);
|
||||
VidBiosPrintCharacter(getAL(), DOS_CHAR_ATTRIBUTE, Bda->VideoPage);
|
||||
}
|
||||
|
||||
VOID WINAPI DosInt2Fh(LPWORD Stack)
|
||||
|
|
Loading…
Reference in a new issue