void Label::create_texture(const char *text) { void *font = get_romfont_address(); int l = strlen(text); if (l>64) l=64; int w = 14*l; for (tex_u=TA_POLYMODE2_U_SIZE_8, u=8; u<w; u<<=1, tex_u += 1<<3); int tsz = u*32; unsigned short *tex = (unsigned short *)ta_txalloc(tsz*2); for (int i=0; i<tsz; i++) tex[i] = 0; int p=l*14; while (l>0) draw_char(tex+(p-=14), u, text[--l], font); texture = tex; }
static void create(const char *str, Label *dst) { unsigned short *texture; int w = strlen(str)*14; int u; int usize; for(u=8,usize=0; u<w; u<<=1,usize+=(1<<3)); texture = (unsigned short *)ta_txalloc(u*32*2); unsigned short *tex = texture; memset(texture, 0 , u*32*2); draw_romfont_str(tex, u, str); dst->tex = texture; dst->usize = usize; dst->w = w; dst->u = u; }
bool ronin_init() { memset(dc_screen, 0, sizeof(dc_screen)); vram = (uint16_t *)dc_screen; *(volatile unsigned int*)(0xa05f80e4) = SCREEN_WIDTH >> 5; //for stride for (int i=0; i<SCREEN_BUFFER_SIZE; i++) screen_tx[i] = ta_txalloc(VRAM_SIZE); #ifdef USE_ARM memcpy4((void*)0xa0800000+EXPANSION_BASE_ADDR, arm_pxt_code, sizeof(arm_pxt_code)); #endif #ifdef __SDCARD__ sd_init(); #endif return 0; }