使用结构体

This commit is contained in:
Yourtion
2014-09-10 17:40:15 +08:00
parent f2fcd66a31
commit 94fa9878d6

View File

@@ -26,20 +26,23 @@ void init_screen(char *vram, int x, int y);
#define COL8_008484 14 #define COL8_008484 14
#define COL8_848484 15 #define COL8_848484 15
struct BOOTINFO {
char cyls, leds, vmode, reserve;
short scrnx, scrny;
char *vram;
};
void HariMain(void) void HariMain(void)
{ {
char *vram;/* 声明变量vram、用于BYTE [...]地址 */ char *vram;/* 声明变量vram、用于BYTE [...]地址 */
int xsize, ysize; int xsize, ysize;
short *binfo_scrnx, *binfo_scrny; struct BOOTINFO *binfo;
int *binfo_vram;
init_palette(); init_palette();
binfo_scrnx = (short *) 0x0ff4; binfo = (struct BOOTINFO *) 0x0ff0;
binfo_scrny = (short *) 0x0ff6; xsize = (*binfo).scrnx;
binfo_vram = (int *) 0x0ff8; ysize = (*binfo).scrny;
xsize = *binfo_scrnx; vram = (*binfo).vram;
ysize = *binfo_scrny;
vram = (char *) *binfo_vram;
init_screen(vram, xsize, ysize); init_screen(vram, xsize, ysize);