From 94fa9878d6fe8c2813e4c2cdbe5d4e3e3965c529 Mon Sep 17 00:00:00 2001 From: Yourtion <yourtion@gmail.com> Date: Wed, 10 Sep 2014 17:40:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8=E7=BB=93=E6=9E=84=E4=BD=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 05_day/bootpack.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/05_day/bootpack.c b/05_day/bootpack.c index 0843d39..b3de470 100644 --- a/05_day/bootpack.c +++ b/05_day/bootpack.c @@ -26,20 +26,23 @@ void init_screen(char *vram, int x, int y); #define COL8_008484 14 #define COL8_848484 15 +struct BOOTINFO { + char cyls, leds, vmode, reserve; + short scrnx, scrny; + char *vram; +}; + void HariMain(void) { char *vram;/* 声明变量vram、用于BYTE [...]地址 */ int xsize, ysize; - short *binfo_scrnx, *binfo_scrny; - int *binfo_vram; + struct BOOTINFO *binfo; init_palette(); - binfo_scrnx = (short *) 0x0ff4; - binfo_scrny = (short *) 0x0ff6; - binfo_vram = (int *) 0x0ff8; - xsize = *binfo_scrnx; - ysize = *binfo_scrny; - vram = (char *) *binfo_vram; + binfo = (struct BOOTINFO *) 0x0ff0; + xsize = (*binfo).scrnx; + ysize = (*binfo).scrny; + vram = (*binfo).vram; init_screen(vram, xsize, ysize);