Skip to content

Commit

Permalink
使用结构体
Browse files Browse the repository at this point in the history
  • Loading branch information
yourtion committed Sep 10, 2014
1 parent f2fcd66 commit 94fa987
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions 05_day/bootpack.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 94fa987

Please sign in to comment.