#include "asciizelda.h" const color_t zeralpha_palette[2] = {0x0000, 0xffff}; const unsigned char zeralpha[12] = {0x70,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x70,0x00}; const color_t un_alpha_palette[2] = {0x0000, 0xffff}; const unsigned char un_alpha[12] = {0x20,0x20,0x60,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x00}; const color_t deux_alpha_palette[2] = {0x0000, 0xffff}; const unsigned char deux_alpha[12] = {0x70,0x88,0x88,0x08,0x10,0x10,0x20,0x40,0x40,0x80,0xf8,0x00}; const color_t trois_alpha_palette[2] = {0x0000, 0xffff}; const unsigned char trois_alpha[12] = {0x70,0x88,0x88,0x08,0x08,0x30,0x08,0x08,0x88,0x88,0x70,0x00}; const color_t quatre_alpha_palette[2] = {0x0000, 0xffff}; const unsigned char quatre_alpha[12] = {0x08,0x18,0x18,0x28,0x48,0x48,0x88,0xfc,0x08,0x08,0x08,0x00}; const color_t cinq_alpha_palette[2] = {0xffff, 0x0000}; const unsigned char cinq_alpha[12] = {0x0c,0x7c,0x7c,0x7c,0x4c,0x34,0x74,0xf4,0xf4,0x74,0x8c,0xfc}; const color_t six_alpha_palette[2] = {0x0000, 0xffff}; const unsigned char six_alpha[12] = {0x70,0x88,0x80,0x80,0x80,0xf0,0x88,0x88,0x88,0x88,0x70,0x00}; const color_t sept_alpha_palette[2] = {0xffff, 0x0000}; const unsigned char sept_alpha[12] = {0x04,0xf4,0xf4,0xec,0xec,0xdc,0xdc,0xbc,0xbc,0xbc,0xbc,0xfc}; const color_t huit_alpha_palette[2] = {0x0000, 0xffff}; const unsigned char huit_alpha[12] = {0x30,0x48,0x84,0x84,0x48,0x30,0x48,0x84,0x84,0x48,0x30,0x00}; const color_t neuf_alpha_palette[2] = {0x0000, 0xffff}; const unsigned char neuf_alpha[12] = {0x70,0x88,0x88,0x88,0x88,0x98,0x68,0x08,0x08,0x88,0x70,0x00}; const color_t a_alpha_palette[2] = {0x0000, 0xffff}; const unsigned char a_alpha[12] = {0x00,0x00,0x00,0x00,0x70,0x88,0x08,0x78,0x88,0x88,0x74,0x00}; const color_t aalpha_palette[2] = {0x0000, 0xffff}; const unsigned char aalpha[12] = {0x20,0x20,0x50,0x50,0x50,0x50,0x88,0xf8,0x88,0x88,0x88,0x00}; const color_t apalpha_palette[2] = {0x0000, 0xffff}; const unsigned char apalpha[12] = {0x60,0x60,0x20,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; const color_t b_alpha_palette[2] = {0xffff, 0x0000}; const unsigned char b_alpha[12] = {0x7c,0x7c,0x7c,0x7c,0x4c,0x34,0x74,0x74,0x74,0x34,0x4c,0xfc}; const color_t bmalpha_palette[2] = {0xffff, 0x0000}; const unsigned char bmalpha[12] = {0x0c,0x74,0x74,0x74,0x74,0x0c,0x74,0x74,0x74,0x74,0x0c,0xfc}; const color_t c_alpha_palette[2] = {0x0000, 0xffff}; const unsigned char c_alpha[12] = {0x00,0x00,0x00,0x00,0x70,0x88,0x80,0x80,0x80,0x88,0x70,0x00}; const color_t cmalpha_palette[2] = {0x0000, 0xffff}; const unsigned char cmalpha[12] = {0x30,0x48,0x84,0x84,0x80,0x80,0x80,0x84,0x84,0x48,0x30,0x00}; const color_t d_alpha_palette[2] = {0x0000, 0xffff}; const unsigned char d_alpha[12] = {0x08,0x08,0x08,0x08,0x68,0x98,0x88,0x88,0x88,0x98,0x68,0x00}; const color_t dmalpha_palette[2] = {0xffff, 0x0000}; const unsigned char dmalpha[12] = {0x1c,0x6c,0x74,0x74,0x74,0x74,0x74,0x74,0x74,0x6c,0x1c,0xfc}; const color_t dpalpha_palette[2] = {0x0000, 0xffff}; const unsigned char dpalpha[12] = {0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x10,0x00}; const color_t e_alpha_palette[2] = {0x0000, 0xffff}; const unsigned char e_alpha[12] = {0x00,0x00,0x00,0x00,0x70,0x88,0x88,0xf8,0x80,0x88,0x70,0x00}; const color_t emalpha_palette[2] = {0xffff, 0x0000}; const unsigned char emalpha[12] = {0x04,0x7c,0x7c,0x7c,0x7c,0x0c,0x7c,0x7c,0x7c,0x7c,0x04,0xfc}; const color_t exalpha_palette[2] = {0x0000, 0xffff}; const unsigned char exalpha[12] = {0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x10,0x10,0x00}; const color_t f_alpha_palette[2] = {0x0000, 0xffff}; const unsigned char f_alpha[12] = {0x18,0x20,0x20,0x20,0x78,0x20,0x20,0x20,0x20,0x20,0x20,0x00}; const color_t fmalpha_palette[2] = {0xffff, 0x0000}; const unsigned char fmalpha[12] = {0x04,0x7c,0x7c,0x7c,0x7c,0x0c,0x7c,0x7c,0x7c,0x7c,0x7c,0xfc}; const color_t g_alpha_palette[2] = {0x0000, 0xffff}; const unsigned char g_alpha[12] = {0x00,0x00,0x00,0x00,0x34,0x48,0x48,0x30,0x40,0x78,0x84,0x78}; const color_t gualpha_palette[2] = {0x0000, 0xffff}; const unsigned char gualpha[12] = {0x50,0x50,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; const color_t gmalpha_palette[2] = {0x0000, 0xffff}; const unsigned char gmalpha[12] = {0x70,0x88,0x80,0x80,0x80,0x98,0x88,0x88,0x88,0x88,0x70,0x00}; const color_t h_alpha_palette[2] = {0xffff, 0x0000}; const unsigned char h_alpha[12] = {0x7c,0x7c,0x7c,0x7c,0x4c,0x34,0x74,0x74,0x74,0x74,0x74,0xfc}; const color_t hmalpha_palette[2] = {0xffff, 0x0000}; const unsigned char hmalpha[12] = {0x74,0x74,0x74,0x74,0x74,0x04,0x74,0x74,0x74,0x74,0x74,0xfc}; const color_t i_alpha_palette[2] = {0x0000, 0xffff}; const unsigned char i_alpha[12] = {0x00,0x40,0x40,0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00}; const color_t imalpha_palette[2] = {0x0000, 0xffff}; const unsigned char imalpha[12] = {0x70,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x00}; const color_t inalpha_palette[2] = {0x0000, 0xffff}; const unsigned char inalpha[12] = {0x70,0x88,0x88,0x08,0x10,0x20,0x20,0x20,0x00,0x20,0x20,0x00}; const color_t j_alpha_palette[2] = {0x0000, 0xffff}; const unsigned char j_alpha[12] = {0x00,0x00,0x00,0x00,0x78,0x10,0x10,0x10,0x10,0x10,0x90,0x60}; const color_t jmalpha_palette[2] = {0xffff, 0x0000}; const unsigned char jmalpha[12] = {0x04,0xec,0xec,0xec,0xec,0xec,0xec,0xec,0xec,0x6c,0x9c,0xfc}; const color_t k_alpha_palette[2] = {0x0000, 0xffff}; const unsigned char k_alpha[12] = {0x00,0x00,0x40,0x40,0x40,0x48,0x50,0x60,0x50,0x48,0x48,0x00}; const color_t kmalpha_palette[2] = {0xffff, 0x0000}; const unsigned char kmalpha[12] = {0x74,0x74,0x6c,0x6c,0x5c,0x3c,0x5c,0x6c,0x6c,0x74,0x74,0xfc}; const color_t l_alpha_palette[2] = {0x0000, 0xffdf}; const unsigned char l_alpha[12] = {0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x00}; const color_t lmalpha_palette[2] = {0xffff, 0x0000}; const unsigned char lmalpha[12] = {0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x04,0xfc}; const color_t m_alpha_palette[2] = {0x0000, 0xffff}; const unsigned char m_alpha[12] = {0x00,0x00,0x00,0x00,0xd0,0xa8,0xa8,0xa8,0xa8,0xa8,0xa8,0x00}; const color_t mmalpha_palette[2] = {0xffff, 0x0000}; const unsigned char mmalpha[12] = {0x74,0x74,0x24,0x24,0x54,0x54,0x74,0x74,0x74,0x74,0x74,0xfc}; const color_t n_alpha_palette[2] = {0x0000, 0xffff}; const unsigned char n_alpha[12] = {0x00,0x00,0x00,0x00,0xb0,0xc8,0x88,0x88,0x88,0x88,0x88,0x00}; const color_t nmalpha_palette[2] = {0xffff, 0x0000}; const unsigned char nmalpha[12] = {0x74,0x74,0x34,0x34,0x54,0x54,0x64,0x64,0x74,0x74,0x74,0xfc}; const color_t o_alpha_palette[2] = {0x0000, 0xffff}; const unsigned char o_alpha[12] = {0x00,0x00,0x00,0x00,0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x00}; const color_t omalpha_palette[2] = {0x0000, 0xffff}; const unsigned char omalpha[12] = {0x70,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x70,0x00}; const color_t p_alpha_palette[2] = {0x0000, 0xffff}; const unsigned char p_alpha[12] = {0x00,0x00,0x00,0x00,0xb0,0xc8,0x88,0x88,0xc8,0xb0,0x80,0x80}; const color_t pmalpha_palette[2] = {0xffff, 0x0000}; const unsigned char pmalpha[12] = {0x0c,0x74,0x74,0x74,0x74,0x0c,0x7c,0x7c,0x7c,0x7c,0x7c,0xfc}; const color_t q_alpha_palette[2] = {0x0000, 0xffff}; const unsigned char q_alpha[12] = {0x00,0x00,0x00,0x00,0x68,0x98,0x88,0x88,0x98,0x68,0x08,0x08}; const color_t qmalpha_palette[2] = {0x0000, 0xffff}; const unsigned char qmalpha[12] = {0x70,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0xa8,0x90,0x68,0x00}; const color_t r_alpha_palette[2] = {0x0000, 0xffff}; const unsigned char r_alpha[12] = {0x00,0x00,0x00,0x00,0x58,0x60,0x40,0x40,0x40,0x40,0x40,0x00}; const color_t rm_alpha_palette[2] = {0xffff, 0x0000}; const unsigned char rm_alpha[12] = {0x0c,0x74,0x74,0x74,0x74,0x0c,0x74,0x74,0x74,0x74,0x74,0xfc}; const color_t s_alpha_palette[2] = {0x0000, 0xffff}; const unsigned char s_alpha[12] = {0x00,0x00,0x00,0x00,0x70,0x88,0x80,0x70,0x08,0x88,0x70,0x00}; const color_t smalpha_palette[2] = {0x0000, 0xffff}; const unsigned char smalpha[12] = {0x70,0x88,0x88,0x80,0x40,0x20,0x10,0x88,0x88,0x88,0x70,0x00}; const color_t t_alpha_palette[2] = {0x0000, 0xffff}; const unsigned char t_alpha[12] = {0x00,0x40,0x40,0x40,0xe0,0x40,0x40,0x40,0x40,0x40,0x30,0x00}; const color_t tmalpha_palette[2] = {0xffff, 0x0000}; const unsigned char tmalpha[12] = {0x04,0xdc,0xdc,0xdc,0xdc,0xdc,0xdc,0xdc,0xdc,0xdc,0xdc,0xfc}; const color_t u_alpha_palette[2] = {0x0000, 0xffff}; const unsigned char u_alpha[12] = {0x00,0x00,0x00,0x00,0x88,0x88,0x88,0x88,0x88,0x98,0x68,0x00}; const color_t umalpha_palette[2] = {0xffff, 0x0000}; const unsigned char umalpha[12] = {0x74,0x74,0x74,0x74,0x74,0x74,0x74,0x74,0x74,0x74,0x8c,0xfc}; const color_t v_alpha_palette[2] = {0x0000, 0xffff}; const unsigned char v_alpha[12] = {0x00,0x00,0x00,0x00,0x88,0x88,0x50,0x50,0x50,0x20,0x20,0x00}; const color_t vmalpha_palette[2] = {0xffff, 0x0000}; const unsigned char vmalpha[12] = {0x74,0x74,0x74,0x74,0xac,0xac,0xac,0xac,0xdc,0xdc,0xdc,0xfc}; const color_t w_alpha_palette[2] = {0x0000, 0xffff}; const unsigned char w_alpha[12] = {0x00,0x00,0x00,0x00,0x88,0xa8,0xa8,0xa8,0xa8,0x50,0x50,0x00}; const color_t wmalpha_palette[2] = {0xffff, 0x0000}; const unsigned char wmalpha[12] = {0x74,0x74,0x74,0x74,0x54,0x54,0x54,0x54,0xac,0xac,0xac,0xfc}; const color_t x_alpha_palette[2] = {0x0000, 0xffff}; const unsigned char x_alpha[12] = {0x00,0x00,0x00,0x00,0x88,0x50,0x50,0x20,0x50,0x50,0x88,0x00}; const color_t xmalpha_palette[2] = {0xffff, 0x0000}; const unsigned char xmalpha[12] = {0x74,0x74,0x74,0xac,0xac,0xdc,0xac,0xac,0x74,0x74,0x74,0xfc}; const color_t y_alpha_palette[2] = {0x0000, 0xffff}; const unsigned char y_alpha[12] = {0x00,0x00,0x00,0x00,0x88,0x88,0x50,0x50,0x20,0x20,0x40,0x80}; const color_t ymalpha_palette[2] = {0xffff, 0x0000}; const unsigned char ymalpha[12] = {0x74,0x74,0x74,0xac,0xac,0xdc,0xdc,0xbc,0xbc,0x7c,0x7c,0xfc}; const color_t z_alpha_palette[2] = {0x0000, 0xffff}; const unsigned char z_alpha[12] = {0x00,0x00,0x00,0x00,0xf8,0x08,0x10,0x20,0x40,0x80,0xf8,0x00}; const color_t zmalpha_palette[2] = {0xffff, 0x0000}; const unsigned char zmalpha[12] = {0x04,0x74,0xf4,0xec,0xec,0xdc,0xbc,0xbc,0x7c,0x74,0x04,0xfc}; const color_t ptalpha_palette[2] = {0x0000, 0xffff}; const unsigned char ptalpha[12] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00}; const color_t slalpha_palette[2] = {0x0000, 0xffff}; const unsigned char slalpha[12] = {0x08,0x08,0x10,0x10,0x10,0x10,0x20,0x20,0x20,0x20,0x40,0x40}; const color_t tialpha_palette[2] = {0x0000, 0xffff}; const unsigned char tialpha[12] = {0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x00,0x00}; const color_t unalpha_palette[2] = {0x0000, 0xffff}; const unsigned char unalpha[12] = {0x54,0xa8,0x54,0xa8,0x54,0xa8,0x54,0xa8,0x54,0xa8,0x54,0xa8}; const color_t vialpha_palette[2] = {0x0000, 0xffff}; const unsigned char vialpha[12] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x60,0x20,0x40}; const color_t plus_alpha_palette[2] = {0x0000, 0xffff}; const unsigned char plus_alpha[12] = {0x00,0x00,0x00,0x00,0x20,0x20,0x20,0xf8,0x20,0x20,0x20,0x00}; const color_t crochet_ferme_alpha_palette[2] = {0xffff, 0x0000}; const unsigned char crochet_ferme_alpha[12] = { 0x3c, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0x3c, 0xfc }; const color_t crochet_ouvre_alpha_palette[2] = {0xffff, 0x0000}; const unsigned char crochet_ouvre_alpha[12] = { 0x3c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x3c, 0xfc }; const unsigned char* ascii[]= { exalpha, //33 gualpha, unalpha,//# unalpha,//$ unalpha,//% unalpha,//& apalpha, unalpha,//( unalpha,//) unalpha,//* plus_alpha, vialpha, tialpha, ptalpha, slalpha, //mini slash zeralpha, //48 un_alpha, deux_alpha, trois_alpha, quatre_alpha, cinq_alpha, six_alpha, sept_alpha, huit_alpha, neuf_alpha, dpalpha, unalpha, //point virgulr unalpha, //< unalpha, //= unalpha, //> inalpha, unalpha, //@ aalpha, bmalpha, cmalpha, dmalpha, emalpha, fmalpha, gmalpha, hmalpha, imalpha, jmalpha, kmalpha, lmalpha, mmalpha, nmalpha, omalpha, pmalpha, qmalpha, rm_alpha, smalpha, tmalpha, umalpha, vmalpha, wmalpha, xmalpha, ymalpha, zmalpha, crochet_ouvre_alpha, unalpha, // antislash crochet_ferme_alpha, unalpha, //^ tialpha, //- apalpha, //' a_alpha, b_alpha, c_alpha, d_alpha, e_alpha, f_alpha, g_alpha, h_alpha, i_alpha, j_alpha, k_alpha, l_alpha, m_alpha, n_alpha, o_alpha, p_alpha, q_alpha, r_alpha, s_alpha, t_alpha, u_alpha, v_alpha, w_alpha, x_alpha,//bug y_alpha,//bug z_alpha//bug }; const color_t* ascii_palette[]= { exalpha_palette, //33 gualpha_palette, unalpha_palette,//# unalpha_palette,//$ unalpha_palette,//% unalpha_palette,//& apalpha_palette, unalpha_palette,//( unalpha_palette,//) unalpha_palette,//* plus_alpha_palette, vialpha_palette, tialpha_palette, ptalpha_palette, slalpha_palette, //mini slash zeralpha_palette, //48 un_alpha_palette, deux_alpha_palette, trois_alpha_palette, quatre_alpha_palette, cinq_alpha_palette, six_alpha_palette, sept_alpha_palette, huit_alpha_palette, neuf_alpha_palette, dpalpha_palette, unalpha_palette, //point virgulr unalpha_palette, //< unalpha_palette, //= unalpha_palette, //> inalpha_palette, unalpha_palette, //@ aalpha_palette, bmalpha_palette, cmalpha_palette, dmalpha_palette, emalpha_palette, fmalpha_palette, gmalpha_palette, hmalpha_palette, imalpha_palette, jmalpha_palette, kmalpha_palette, lmalpha_palette, mmalpha_palette, nmalpha_palette, omalpha_palette, pmalpha_palette, qmalpha_palette, rm_alpha_palette, smalpha_palette, tmalpha_palette, umalpha_palette, vmalpha_palette, wmalpha_palette, xmalpha_palette, ymalpha_palette, zmalpha_palette, crochet_ouvre_alpha_palette, unalpha_palette, //antislash crochet_ferme_alpha_palette, unalpha_palette, //^ tialpha_palette, //- apalpha_palette, //' a_alpha_palette, b_alpha_palette, c_alpha_palette, d_alpha_palette, e_alpha_palette, f_alpha_palette, g_alpha_palette, h_alpha_palette, i_alpha_palette, j_alpha_palette, k_alpha_palette, l_alpha_palette, m_alpha_palette, n_alpha_palette, o_alpha_palette, p_alpha_palette, q_alpha_palette, r_alpha_palette, s_alpha_palette, t_alpha_palette, u_alpha_palette, v_alpha_palette, w_alpha_palette, x_alpha_palette, y_alpha_palette, z_alpha_palette }; const unsigned char* numChar[]= { zeralpha, un_alpha, deux_alpha, trois_alpha, quatre_alpha, cinq_alpha, six_alpha, sept_alpha, huit_alpha, neuf_alpha }; const color_t* numChar_palette[]= { zeralpha_palette, un_alpha_palette, deux_alpha_palette, trois_alpha_palette, quatre_alpha_palette, cinq_alpha_palette, six_alpha_palette, sept_alpha_palette, huit_alpha_palette, neuf_alpha_palette }; void* GetVRAMAddress() { asm("mov.l syscall_adress, r2\n" "mov.l getVRAM, r0\n" "jmp @r2\n" "nop\n" "syscall_adress: .long 0x80020070\n" "getVRAM: .long 0x01E6"); } int PrintChar(const unsigned char* data, int x, int y, const color_t* palette, color_t maskColor, unsigned int bitwidth,short colort) { color_t* VRAM = (color_t*)GetVRAMAddress(); VRAM += (LCD_WIDTH_PX*y + x); int offset = 0; int widthSprite = 0; unsigned char buf = 0; int i,j; for(j=y; j>(8-bitwidth)); color_t color = palette[thiss]; if(color != maskColor) { if (i-x>widthSprite) widthSprite = i-x+1; *VRAM = colort; } VRAM++; buf<<=bitwidth; availbits-=bitwidth; } VRAM += (LCD_WIDTH_PX-6); } return widthSprite; } int PrintText (int x,int y,char* string, const color_t color) { short i; i = 0; do { if ((string[i]-33)>=0 && (string[i]-33)<=122) x+= PrintChar(ascii[string[i]-33],x,y,ascii_palette[string[i]-33],0x0000,1,color) + 3 ; if (string[i] == ' ') x+=6; i++; }while (string[i] != '\0'); return x; } int nbreDeChiffre(long int nombre) { int chiffre = 0; if(nombre==0) chiffre = 1; while(nombre) { chiffre++; nombre/=10; } return chiffre; } int PrintNumber (int x,int y,int number, const color_t color) { int i,nbChif; if (number<0) { x = PrintChar(ascii['-'-33],x,y,ascii_palette['-'-33],0x0000,1,color) + 3 ; number*=-1; } nbChif = nbreDeChiffre(number); int chiffreDecompose[19]; for(i=nbChif-1;i>=0;i--) { chiffreDecompose[i]=number % 10; number =number/10; } for (i=0;i