00001 #ifndef _PA_Text
00002 #define _PA_Text
00003
00004
00005
00012
00013 #include "PA_Tile.h"
00014
00015
00017
00019
00020 extern const u16 PA_font_Map[256];
00021 extern const u8 PA_font_Tiles[6080];
00022
00023 extern const u16 PA_font2_Map[256];
00024 extern const u8 PA_font2_Tiles[6016];
00025
00026 extern u16 textcol[2];
00027 extern u8 PAbgtext[2];
00028
00029
00030 extern u16 *PA_textmap[2];
00031 extern u16 *PA_texttiles[2];
00032
00033 extern s8 PA_font[2];
00034
00035
00036
00037
00038
00039
00040 #include "text0.h"
00041 #include "text1.h"
00042 #include "text2.h"
00043 #include "text3.h"
00044 #include "text4.h"
00045
00046
00047
00048 typedef void(*letterfp)(u8 size, bool screen, u16 x, u16 y, char lettertemp, u8 color);
00049
00050 extern const u8 *textData[5];
00051 extern const u8 policeheight[5];
00052 extern const u16 policewidth[5];
00053 extern const u8 policesize[5][256];
00054
00055
00056 extern letterfp letters[5];
00057
00058
00059
00060
00061
00062
00063
00064
00084 void PA_InitText(bool screen, u8 bg_select);
00085
00086
00104 extern inline void PA_SetTileLetter(bool screen, u16 x, u16 y, char letter) {
00105 PA_SetMapTileAll(screen, PAbgtext[screen], x, y, PA_textmap[screen][(u16)letter]);
00106 }
00107
00125 void PA_OutputText(bool screen, u16 x, u16 y, char* text, ...);
00126
00144 u16 PA_OutputSimpleText(bool screen, u16 x, u16 y, const char *text);
00145
00172 u32 PA_BoxText(bool screen, u16 basex, u16 basey, u16 maxx, u16 maxy, const char *text, u32 limit);
00173
00200 u32 PA_BoxTextNoWrap(bool screen, u16 basex, u16 basey, u16 maxx, u16 maxy, const char *text, u32 limit);
00201
00202
00221 void PA_SetTextCol(bool screen, u8 r, u8 g, u8 b);
00222
00223
00224
00238 void PA_SetTextFont(bool screen, u8 font);
00239
00240
00250 #define PA_ShowFont(screen) PA_LoadBgMap(screen, PAbgtext[screen], (void*)PA_textmap[screen], BG_256X256)
00251
00252
00253
00270 void PA_SetTextCustomFont(bool screen, void* tiles, void* map);
00271
00272
00273
00309 s16 PA_SmartText(bool screen, s16 basex, s16 basey, s16 maxx, s16 maxy, char* text, u8 color, u8 size, u8 transp, s32 limit);
00310
00311
00312
00345 s16 PA_CenterSmartText(bool screen, s16 basex, s16 basey, s16 maxx, s16 maxy, char* text, u8 color, u8 size, u8 transp);
00346
00347
00348
00360 extern inline bool PA_CompareText(char *text1, char *text2){
00361 bool ok = 1;
00362 u8 i = 0;
00363 while(ok && text2[i]){
00364 if (text1[i] != text2[i]) ok = 0;
00365 i++;
00366 }
00367 return ok;
00368 }
00369
00370
00382 extern inline void PA_CopyText(char *text1, char *text2){
00383 u8 i = 0;
00384 text1[i] = text2[i];
00385 do{
00386 i++;
00387 text1[i] = text2[i];
00388 }
00389 while (text2[i]);
00390 }
00391
00392
00393
00394 void PA_OutputTextSpecial0(bool screen, int x1, int y,char *text);
00395 void PA_OutputTextSpecial1(bool screen, int x1, int y,char *text);
00396 void PA_OutputTextSpecial2(bool screen, int x1, int y,char *text);
00397 void PA_OutputTextSpecial3(bool screen, int x1, int y,char *text);
00398 void PA_OutputTextSpecial4(bool screen, int x1, int y,char *text);
00399 void PA_OutputTextSpecial5(bool screen, int x1, int y,char *text);
00400
00402
00403
00404
00405 #endif
00406
00407