1 /* Project 16 Source Code~
\r
2 * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover
\r
4 * This file is part of Project 16.
\r
6 * Project 16 is free software; you can redistribute it and/or modify
\r
7 * it under the terms of the GNU General Public License as published by
\r
8 * the Free Software Foundation; either version 3 of the License, or
\r
9 * (at your option) any later version.
\r
11 * Project 16 is distributed in the hope that it will be useful,
\r
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
14 * GNU General Public License for more details.
\r
16 * You should have received a copy of the GNU General Public License
\r
17 * along with this program. If not, see <http://www.gnu.org/licenses/>, or
\r
18 * write to the Free Software Foundation, Inc., 51 Franklin Street,
\r
19 * Fifth Floor, Boston, MA 02110-1301 USA.
\r
24 #include "lib/types.h"
\r
25 #include "lib/16text.h"
\r
26 #include "lib/modex16.h"
\r
28 global_game_variables_t gvar;
\r
30 void main(int argc, char near *argv[])
\r
37 word addr = (word) l;
\r
38 //byte *pal, *pal2, fond;
\r
39 //bitmap_t fontdata;
\r
43 //print the addresses of the fonts
\r
44 printf("ROM FONT Addresses\n");
\r
45 for(i=0; i<4; i++) {
\r
46 printf("%d: %x:%x\n", i, romFonts[i].seg, romFonts[i].off);
\r
49 // printf("*argv[1]=%d\n", *argv[1]);
\r
51 printf("Font type: ");
\r
54 printf("Character: ");
\r
97 //load the letter 'A'
\r
103 MOV AL, c ; the letter
\r
106 ADD SI, AX ;the address of charcter
\r
116 //modexLoadPalFile("data/default.pal", &pal2);
\r
118 /*fontdata.width=8;
\r
120 fontdata.palette=pal2;
\r
122 fontdata.data=malloc(256);
\r
129 fond=(byte)l[i] & j ? '1':'0';
\r
130 fontdata.data=&(fond);
\r
131 printf("%02x ", *(fontdata.data));
\r
137 printf("\n\nok hit a key~\n");
\r
140 //DrawPBuf(&page, 0, 0, p, 0);
\r
143 // save the palette
\r
144 /*pal = modexNewPal();
\r
146 modexFadeOff(4, pal);
\r
149 VGAmodeX(1, &gvar);
\r
150 /* modexPalBlack();*/
\r
152 // set up the page, but with 16 pixels on all borders in offscreen mem
\r
153 page=modexDefaultPage();
\r
154 //page.width += 32;
\r
155 //page.height += 32;
\r
156 modexShowPage(&page);
\r
157 modexClearRegion(&page, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 1);
\r
159 //modexFadeOn(4, pal2);
\r
161 //render the letter in ascii art
\r
168 //printf("j=%d\n", j);
\r
169 //printf("%c", l[i] & j ? '*':' ');
\r
170 //====printf("%02x ", l[i] & j);
\r
171 //printf("l[i]=%d ", l[i]);
\r
172 //printf("j=%d ", j);
\r
173 //printf("%02x\n", l[i] & j);
\r
174 //modexPutPixel(xp, i, l[i] & j ? 15:0);
\r
175 //modexpixelwr(xp, i, 0, l[i] & j ? 15:0);
\r
176 modexputPixel(&page, xp, i, l[i] & j ? 15:0);
\r
177 //modexClearRegion(&page, xp*4, i*4, 4, 4, l[i] & j ? 15:0);
\r
185 //modexDrawSprite(&page, 0, 0, &fontdata);
\r
188 //DrawPBuf(&page, 0, 0, p, 0);
\r
191 // fade back to text mode
\r
192 /*modexFadeOff(4, pal2);
\r
194 VGAmodeX(0, &gvar);
\r
196 modexFadeOn(4, pal);*/
\r
197 //render the letter in ascii art
\r
203 printf("%c", l[i] & j ? '*':' ');
\r
204 //====printf("%02x ", l[i] & j);
\r
210 printf("\ni=%d\n", i);
\r
211 printf("j=%d\n", j);
\r