dos-vga-arena-shooter-game/pc_stuff.c

24 lines
438 B
C
Raw Normal View History

2024-02-15 01:15:55 +00:00
#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, &regs, &regs);
}
void waitStartVbl() {
while (inp(INPUT_STATUS) & VBLANK);
}
void waitEndVbl() {
while (!(inp(INPUT_STATUS) & VBLANK));
}