(empty log message)
@@ -7,8 +7,8 @@ | ||
7 | 7 | void CHNMain(void) |
8 | 8 | { |
9 | 9 | unsigned char s[24]; |
10 | - struct BOOTINFO *binfo = (struct BOOTINFO *) ADR_BOOTINFO; | |
11 | - struct VESAINFO *vinfo = (struct VESAINFO *) ADR_VESAINFO; | |
10 | +// struct BOOTINFO *binfo = (struct BOOTINFO *) ADR_BOOTINFO; | |
11 | +// struct VESAINFO *vinfo = (struct VESAINFO *) ADR_VESAINFO; | |
12 | 12 | struct FIFO32 sysfifo; |
13 | 13 | struct MOUSE_DECODE mdec; |
14 | 14 | static struct TIMERCTL timerctl; |
@@ -15,12 +15,13 @@ | ||
15 | 15 | struct MEMMAN *memman = (struct MEMMAN *) MEMMAN_ADDR; |
16 | 16 | struct SHEET32 *sht_back, *sht_mouse; |
17 | 17 | struct WINDOWINFO *winfo1; |
18 | - int fifobuf[256], i = 0,mx = binfo->scrnx / 2, my = binfo->scrny / 2; | |
18 | + int fifobuf[256], i = 0,mx , my; | |
19 | 19 | int scrool = 0; |
20 | 20 | volatile int time_tick; |
21 | 21 | unsigned int all_mem_size = memtest(0x00400000, 0xbffffffff); |
22 | 22 | unsigned int free_mem_size = 0; |
23 | 23 | unsigned int *buf_back, buf_mouse[576], *buf_win; |
24 | + int scrnx,scrny; | |
24 | 25 | |
25 | 26 | |
26 | 27 | init_system(&system); |
@@ -28,6 +29,11 @@ | ||
28 | 29 | init_pic(); |
29 | 30 | io_sti(); |
30 | 31 | |
32 | + scrnx = system.info.boot.scrnx; | |
33 | + scrny = system.info.boot.scrny ; | |
34 | + mx = scrnx/2; | |
35 | + my = scrny/2; | |
36 | + | |
31 | 37 | system.io.memory.init(memman); |
32 | 38 | system.io.memory.free(0x00400000,all_mem_size - 0x00400000); |
33 | 39 |
@@ -36,7 +42,7 @@ | ||
36 | 42 | system.data.fifo.init(&sysfifo, 256, fifobuf); |
37 | 43 | system.io.keyboard.init(&sysfifo, SYSFIFO_KEYB); |
38 | 44 | system.io.mouse.init(&sysfifo, SYSFIFO_MOUSE, &mdec); |
39 | - system.draw.sheet.init(vinfo->PhysBasePtr,binfo->scrnx,binfo->scrny); | |
45 | + system.draw.sheet.init(system.info.vesa.PhysBasePtr,scrnx,scrny); | |
40 | 46 | |
41 | 47 | system.draw.window.init(); |
42 | 48 | system.io.beep.off(); |
@@ -43,16 +49,17 @@ | ||
43 | 49 | system.io.serial.init(); |
44 | 50 | |
45 | 51 | |
52 | + | |
46 | 53 | sht_back = system.draw.sheet.alloc(); |
47 | 54 | sht_mouse = system.draw.sheet.alloc(); |
48 | 55 | |
49 | - buf_back = (unsigned int *) system.io.memory.alloc(binfo->scrnx * binfo->scrny * 4); | |
56 | + buf_back = (unsigned int *) system.io.memory.alloc(scrnx * scrny * 4); | |
50 | 57 | buf_win = (unsigned int *) system.io.memory.alloc(INT_MONITOR_LONG * 150 * 4); |
51 | 58 | |
52 | - system.draw.sheet.set(sht_back, buf_back, binfo->scrnx, binfo->scrny, VOID_INV_COL32); | |
59 | + system.draw.sheet.set(sht_back, buf_back, scrnx, scrny, VOID_INV_COL32); | |
53 | 60 | system.draw.sheet.set(sht_mouse, buf_mouse, 24, 24, INV_COL32); |
54 | 61 | |
55 | - system.draw.init_scrn(buf_back, binfo->scrnx, binfo->scrny, vinfo->BitsPerPixel,buf_mouse); | |
62 | + system.draw.init_scrn(buf_back, scrnx, scrny, system.info.vesa.BitsPerPixel,buf_mouse); | |
56 | 63 | |
57 | 64 | system.draw.sheet.slide(sht_back, 0,0); |
58 | 65 | system.draw.sheet.slide(sht_mouse, mx, my); |
@@ -63,7 +70,7 @@ | ||
63 | 70 | |
64 | 71 | system.draw.sheet.updown(sht_mouse, 6); |
65 | 72 | |
66 | -// system.draw.circle(buf_back, 100,100, 0xff0000, binfo->scrnx, 100); | |
73 | +// system.draw.circle(buf_back, 100,100, 0xff0000, scrnx, 100); | |
67 | 74 | |
68 | 75 | sprintf(s,"memory %d Byte(%d KB,%d MB) ",all_mem_size,all_mem_size/1024, all_mem_size/(1024*1024)); |
69 | 76 | system.draw.boxfill(buf_win, INT_MONITOR_LONG, mix_color(0x0000ff00, 0x7fff0000), 0,0,INT_MONITOR_LONG,16); |
@@ -118,14 +125,14 @@ | ||
118 | 125 | my += mdec.y; |
119 | 126 | if(mx < 0) mx = 0; |
120 | 127 | if(my < 0) my = 0; |
121 | - if(mx > binfo->scrnx - 1) mx = binfo->scrnx - 1; | |
122 | - if(my > binfo->scrny - 1) my = binfo->scrny - 1; | |
128 | + if(mx > scrnx - 1) mx = scrnx - 1; | |
129 | + if(my > scrny - 1) my = scrny - 1; | |
123 | 130 | |
124 | 131 | system.draw.sheet.slide(sht_mouse, mx,my); |
125 | 132 | system.draw.boxfill(buf_win, INT_MONITOR_LONG, 0x000000, 0,96,INT_MONITOR_LONG,112); |
126 | 133 | if(mdec.scrool == 0xffffffff) scrool++; |
127 | 134 | if(mdec.scrool == 0x00000001) scrool--; |
128 | - sprintf(s,"(%4d,%4d) %d,%X",mx,my,scrool,vinfo->PhysBasePtr,mdec.scrool); | |
135 | + sprintf(s,"(%4d,%4d) %d,%X",mx,my,scrool,system.info.vesa.PhysBasePtr,mdec.scrool); | |
129 | 136 | system.draw.putfonts(buf_win, INT_MONITOR_LONG, 0,96,0xffffff,s); |
130 | 137 | system.draw.sheet.refresh(winfo1->center, 0,64,INT_MONITOR_LONG , 112); |
131 | 138 | } |