wwww
Révision | 54e80274a159f2c8f12bbb284403927616c686c5 (tree) |
---|---|
l'heure | 2016-04-17 12:34:29 |
Auteur | Jonathan Campbell <jonathan@cast...> |
Commiter | Jonathan Campbell |
don't use printf. use modexprint. explain why. fontgfx shows grid of
font chars correctly now. not sure what the long pause at startup is.
@@ -38,7 +38,7 @@ void main(int argc, char near *argv[]) | ||
38 | 38 | //JMOJI |
39 | 39 | static byte e; |
40 | 40 | //word ri; |
41 | - byte pee[2]; | |
41 | + byte pee[6]; // must be large enough for sprintf("%zc",...) and sprintf("%u",(byte value)) | |
42 | 42 | static byte ibmlogo[]="IIIIIII BBBBBBBBB MMMMM MMMMM\n\ |
43 | 43 | IIIIIII BBBBBBBBBBB MMMMMM MMMMMM\n\ |
44 | 44 | III BBB BBB MMMMMM MMMMMM\n\ |
@@ -67,7 +67,7 @@ IIIIIII BBBBBBBBB MMMM M MMMM\n\ | ||
67 | 67 | ,'___...---~~~\n\ |
68 | 68 | "; |
69 | 69 | // static byte *rosa; |
70 | -// static word chx;//, chy, colpee; | |
70 | + static word chx, chy, colpee; | |
71 | 71 | static word z; |
72 | 72 | textInit(); |
73 | 73 |
@@ -107,42 +107,43 @@ IIIIIII BBBBBBBBB MMMM M MMMM\n\ | ||
107 | 107 | gvar.video.page[0].width += (16*2); |
108 | 108 | gvar.video.page[0].height += (16*2); |
109 | 109 | modexShowPage(&gvar.video.page[0]); |
110 | + vga_read_crtc_mode(&cm); | |
111 | + // NTS: We're in Mode-X now. printf() is useless. Do not use printf(). Or INT 10h text printing. Or DOS console output. | |
110 | 112 | //modexprint(16, 16, 1, 15, "wwww"); |
111 | 113 | //getch(); |
112 | -// chx=0; | |
113 | -// chy=0; | |
114 | + chx=0; | |
115 | + chy=0; | |
114 | 116 | // colpee=32; |
115 | - bios_cls(); | |
117 | +// bios_cls(); | |
116 | 118 | /* position the cursor to home */ |
117 | - vga_moveto(0,0); | |
118 | - vga_sync_bios_cursor(); | |
119 | +// vga_moveto(0,0); | |
120 | +// vga_sync_bios_cursor(); | |
119 | 121 | for(e=0x00, z=0; e<=0xFE; e++, z++) |
120 | 122 | { |
121 | 123 | //if(chx+8>(gvar.video.page[0].width/2)) |
122 | 124 | if((z)+1>16) |
123 | 125 | { |
124 | -// chx=0; | |
125 | -// chy+=8; | |
126 | -// sprintf(pee,"%u", colpee); | |
127 | -// modexprint(&gvar.video.page[0], 200, 200, 1, 47, 0, &pee, 1); | |
126 | + chx=0; | |
127 | + chy+=8; | |
128 | + sprintf(pee,"%u", colpee); | |
129 | + modexprint(&gvar.video.page[0], 200, 200, 1, 47, 0, &pee, 1); | |
128 | 130 | z=0; |
129 | - printf("\n"); | |
131 | +// printf("\n"); | |
130 | 132 | //getch(); |
131 | 133 | } |
132 | - printf("%zc", e); | |
133 | -// modexprint(&gvar.video.page[0], chx, chy, 1, 0, colpee, &e, 1); | |
134 | -// chx+=9; | |
135 | -// colpee++; | |
134 | + sprintf(pee, "%zc", e); | |
135 | + modexprint(&gvar.video.page[0], chx, chy, 1, 0, colpee, &e, 1); | |
136 | + chx+=9; | |
137 | + colpee++; | |
136 | 138 | // if(colpee>=32+24) colpee=32; |
137 | 139 | } |
138 | - //modexprint(100, 100, 1, 47, 0, "wwww"); | |
139 | 140 | getch(); |
141 | + //modexprint(100, 100, 1, 47, 0, "wwww"); | |
140 | 142 | // modexprint(0, 0, 1, 0, colpee, &rose); |
141 | 143 | //++++ modexprint(&gvar.video.page[0], 0, 0, 0, 0, colpee, &ibmlogo); |
142 | 144 | // modexprintbig(&gvar.video.page[0], 0, 0, 1, colpee, 0, "IBM"); |
143 | 145 | // modexprint(0, 0, 1, 0, colpee, ROSE); |
144 | 146 | //++++ getch(); |
145 | - vga_read_crtc_mode(&cm); | |
146 | 147 | VGAmodeX(0, 1, &gvar); |
147 | 148 | // rosa=malloc(sizeof(ROSE)); |
148 | 149 | // (*rosa)=(byte)ROSE; |