1 /* Project 16 Source Code~
\r
2 * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669
\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"
26 #include "lib/modex16.h"
\r
28 void main(int argc, char near *argv[])
\r
36 //byte *pal, *pal2, fond;
41 //print the addresses of the fonts
\r
42 printf("ROM FONT Addresses\n");
\r
43 for(i=0; i<4; i++) {
\r
44 printf("%d: %x:%x\n", i, romFonts[i].seg, romFonts[i].off);
\r
47 // printf("*argv[1]=%d\n", *argv[1]);
\r
49 printf("Font type: ");
\r
52 printf("Character: ");
\r
95 //load the letter 'A'
\r
101 MOV AL, c ; the letter
\r
104 ADD SI, AX ;the address of charcter
\r
114 //modexLoadPalFile("data/default.pal", &pal2);
118 fontdata.palette=pal2;
120 fontdata.data=malloc(256);
127 fond=(byte)l[i] & j ? '1':'0';
128 fontdata.data=&(fond);
129 printf("%02x ", *(fontdata.data));
\r
135 printf("\n\nok hit a key~\n");
138 //DrawPBuf(&page, 0, 0, p, 0);
\r
141 // save the palette
\r
142 /*pal = modexNewPal();
\r
144 modexFadeOff(4, pal);
\r
148 /* modexPalBlack();*/
\r
150 // set up the page, but with 16 pixels on all borders in offscreen mem
\r
151 page=modexDefaultPage();
\r
152 //page.width += 32;
\r
154 modexShowPage(&page);
155 modexClearRegion(&page, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 1);
157 //modexFadeOn(4, pal2);
159 //render the letter in ascii art
\r
166 //printf("j=%d\n", j);
\r
167 //printf("%c", l[i] & j ? '*':' ');
168 //====printf("%02x ", l[i] & j);
169 //printf("l[i]=%d ", l[i]);
170 //printf("j=%d ", j);
171 //printf("%02x\n", l[i] & j);
172 //modexPutPixel(xp, i, l[i] & j ? 15:0);
173 //modexpixelwr(xp, i, 0, l[i] & j ? 15:0);
174 modexputPixel(xp, i, l[i] & j ? 15:0);
175 //modexClearRegion(&page, xp*4, i*4, 4, 4, l[i] & j ? 15:0);
183 //modexDrawSprite(&page, 0, 0, &fontdata);
186 //DrawPBuf(&page, 0, 0, p, 0);
\r
189 // fade back to text mode
\r
190 /*modexFadeOff(4, pal2);
\r
194 modexFadeOn(4, pal);*/
195 //render the letter in ascii art
\r
201 printf("%c", l[i] & j ? '*':' ');
202 //====printf("%02x ", l[i] & j);
208 printf("\ni=%d\n", i);