void load_warning_scr() { copymem((void *)0x78000, (void*)font_pc, 8192); /* Clear out any leftover characters from previous BG. */ setmem((void*)BGMap(0), 0, 0x2000); WA[31].head = WRLD_ON; WA[31].gx = 0; WA[31].gp = 0; //No parallax for now. WA[31].gy = CENTER_Y(5)*8; WA[31].mx = 0; WA[31].mp = 0; WA[31].my = 0; WA[31].w = 384; WA[31].h = (5*8 - 1); WA[31].ovr = 0; WA[31].param = 0; WA[30].head = WRLD_END; print_message(msg_warn[0], 0, CENTER_X(27), 0, 0); print_message(msg_warn[1], 0, CENTER_X(23), 2, 0); print_message(msg_warn[2], 0, CENTER_X(16), 4, 0); }
int main() { //Initial setup vbDisplayOn(); //Copy tileset and tilemap into memory copymem((void*)CharSeg0, (void*)CHADJUSTMENT, 256*16); copymem((void*)BGMap(0), (void*)BGADJUSTMENT, 450*16); //Setup worlds //(This uses structs to access world data, the old method using functions is commented out) WA[31].head = (WRLD_LON|WRLD_OVR); WA[31].w = 384; WA[31].h = 224; //vbSetWorld(31, (WRLD_LON|WRLD_OVR), 0, 0, 0, 0, 0, 0, 384, 224); WA[30].head = (WRLD_RON|WRLD_OVR); WA[30].my = 224; WA[30].w = 384; WA[30].h = 224; //vbSetWorld(30, (WRLD_RON|WRLD_OVR), 0, 0, 0, 0, 0, 224, 384, 224); WA[29].head = WRLD_END; //vbSetWorld(29, WRLD_END, 0, 0, 0, 0, 0, 0, 0, 0); //Set brightness registers vbDisplayShow(); //Main loop (Empty because we're done but don't want to reach the end) for (;;); return 0; }
/* Todo: turn into a text-box routine. */ void print_message(const char * message, short bg_no, short x_pos, short y_pos, short font_bias) { unsigned short count; short initial_tile_pos = (y_pos*64) + x_pos; for(count = 0; message[count] != '\0'; count++) { /* Convert the ASCII character to a short that is an appropriate offset into the character table, and set the relevant tiles of the BGMap to display the appropriate tiles. */ (* ((short *) BGMap(bg_no) + initial_tile_pos + count)) = (short) (message[count] + font_bias); } }
void load_ipdfoc_scr() { /* Load focus screen tiles into memory. */ /* copymem((void *)0x78000, (void*)cgx_sample, 8192*2); copymem((void*)BGMap(0), (void*)scr_ipd_foc, 4096*2); */ copymem((void *)0x78000, (void*)char_cfoc, 8192*2); copymem((void*)BGMap(0), (void*)bg_vblogo_r, 4096*2); copymem((void*)BGMap(1), (void*)bg_vblogo_l, 4096*2); /* Reload the worlds to point to the appropriate. Screen. */ WA[31].head = WRLD_RON; WA[31].gx = 0; WA[31].gp = 0; WA[31].gy = 0; WA[31].mx = 0; WA[31].mp = 0; WA[31].my = 0; WA[31].w = 383; WA[31].h = 223; WA[31].ovr = 0; WA[31].param = 0; WA[30].head = WRLD_LON + 1; WA[30].gx = 0; WA[30].gp = 0; //No parallax for now. WA[30].gy = 0; WA[30].mx = 0; WA[30].mp = 0; WA[30].my = 0; WA[30].w = 383; WA[30].h = 223; WA[30].ovr = 0; WA[30].param = 0; WA[29].head = WRLD_END; }