24 lines
438 B
C
24 lines
438 B
C
#include "pc_stuff.h"
|
|
|
|
#define INPUT_STATUS (0x03da)
|
|
#define VBLANK (0x08)
|
|
#define BIOS_SET_VIDEO_MODE (0x00)
|
|
|
|
byte *VGA = (byte *)0xA0000;
|
|
|
|
void setVideoMode(byte videoMode) {
|
|
union REGS regs;
|
|
|
|
regs.h.ah = BIOS_SET_VIDEO_MODE;
|
|
regs.h.al = videoMode;
|
|
int386(BIOS_VIDEO_INTERRUPT, ®s, ®s);
|
|
}
|
|
|
|
void waitStartVbl() {
|
|
while (inp(INPUT_STATUS) & VBLANK);
|
|
}
|
|
|
|
void waitEndVbl() {
|
|
while (!(inp(INPUT_STATUS) & VBLANK));
|
|
}
|