Skip to content

Commit 6d4706d

Browse files
committed
使用箭头方法
1 parent 94fa987 commit 6d4706d

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

05_day/bootpack.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,10 @@ struct BOOTINFO {
3434

3535
void HariMain(void)
3636
{
37-
char *vram;/* 声明变量vram、用于BYTE [...]地址 */
38-
int xsize, ysize;
39-
struct BOOTINFO *binfo;
37+
struct BOOTINFO *binfo = (struct BOOTINFO *) 0x0ff0;
4038

4139
init_palette();
42-
binfo = (struct BOOTINFO *) 0x0ff0;
43-
xsize = (*binfo).scrnx;
44-
ysize = (*binfo).scrny;
45-
vram = (*binfo).vram;
46-
47-
init_screen(vram, xsize, ysize);
40+
init_screen(binfo->vram, binfo->scrnx, binfo->scrny);
4841

4942
for (;;) {
5043
io_hlt();

0 commit comments

Comments
 (0)