iff-ilbm-on-pc-vga/vgapal.c

37 lines
590 B
C

/*
* Cycle through every greyscale value that VGA can handle.
*
* Copyright 2024 John Bintz. Licensed under the MIT
* License. Visit https://theindustriousrabbit.com
* for more!
*/
#include <dos.h>
#include <conio.h>
char far *VGA = (char*)0xA0000;
int main(void) {
union REGS regs;
int i;
regs.h.ah = 0x00;
regs.h.al = 0x13;
int386(0x10, &regs, &regs);
for (i = 0; i < 63; ++i) {
outp(0x3c8, 0);
outp(0x3c9, i);
outp(0x3c9, i);
outp(0x3c9, i);
delay(10);
}
regs.h.ah = 0x00;
regs.h.al = 0x03;
int386(0x10, &regs, &regs);
return 0;
}