int main (int argc, char *argv []) { SifInitRpc (0); init_scr (); scr_printf (APP_NAME "-" VERSION "\n"); /* decide whether to load TCP/IP or it is already loaded */ SifExitIopHeap (); SifLoadFileExit (); SifExitRpc (); SifIopReset (NULL /* "rom0:UDNL rom0:EELOADCNF" */, 0); while (SifIopSync ()) ; SifInitRpc (0); if (load_modules () == 0) { scr_printf ("Ready\n"); } else scr_printf ("Failed to load\n"); /* our job is done; IOP would handle the rest */ SleepThread (); return (0); }
static PSD VB_open(PSD psd) { /* allocate space for the colour map */ if ((pr_cmap = (int *)malloc((size_t)(256 * sizeof(int)))) == NULL) { perror("malloc cmap"); return(0); } memset(pr_cmap, 0, (256 * sizeof(int))); /* clear colour map */ /* init driver variables */ psd->xres = psd->xvirtres = 1280; psd->yres = psd->yvirtres = 1024; psd->planes = 1; psd->bpp = 8; psd->ncolors = 256; psd->pixtype = MWPF_PALETTE; #if HAVEBLIT psd->flags = PSF_SCREEN | PSF_HAVEBLIT; #else psd->flags = PSF_SCREEN; #endif psd->addr = (void *)MY_PSD_ADDR; /* dummy addr. */ psd->linelen = 1280; init_scr(); /* init VB and clear screen */ printf("VB_open: finished open\n"); /* DEBUG */ return psd; }
int main() { WINDOW *menubar, *statusbar, *about; int key; init_scr(); bkgd(COLOR_PAIR(1)); menubar = subwin(stdscr, 1, 80, 0, 0); statusbar = subwin(stdscr, 1, 79, 23, 1); make_menubar(menubar); move(2, 1); printw("Press 'a' or 'h' to open the menus. "); printw("ESC or 'q' quits."); refresh(); while(1) { WINDOW **menu_items; int selected_item; key = getch(); werase(statusbar); wrefresh(statusbar); if (key == 'a') { menu_items=file_menu_list(0); selected_item = scroll_menu(menu_items, 4, 20, 0); delete_menu(menu_items, 5); if (selected_item < 0) wprintw(statusbar, "You haven't selected any item"); else wprintw(statusbar, "You have selected menu item %d.", selected_item); touchwin(stdscr); refresh(); } if (key == 'h') { menu_items=help_menu_list(20); selected_item = scroll_menu(menu_items, 2, 0, 1); delete_menu(menu_items, 3); if (selected_item == 1) { about_window(); } if (selected_item < 0) wprintw(statusbar, "You haven't selected any item"); } if (key == ESCAPE || key == 'q') { if (check_quit() == 1) break; } touchwin(stdscr); refresh(); } endwin(); }
void iopException(int cause, int badvaddr, int status, int epc, u32 *regs, int repc, char* name) { int i; int code; // extern void printf(char *, ...); static void (* excpPrintf)(const char *, ...); FlushCache(0); FlushCache(2); #if 1 if (userThreadID) { TerminateThread(userThreadID); DeleteThread(userThreadID); } #endif code = cause & 0x7c; if(excepscrdump) { init_scr(); excpPrintf = scr_printf; } else excpPrintf = (void*)printf; excpPrintf("\n\n IOP Exception handler: %s exception\n\n", codeTxt[code>>2]); excpPrintf(" Module Name \"%s\" Relative EPC %08X\n\n", name, repc); excpPrintf(" Cause %08X BadVAddr %08X Status %08X EPC %08X\n\n", cause, badvaddr, status, epc); for(i = 0; i < 32/4; i++) { excpPrintf(" %4s: %08X %4s: %08X %4s: %08X %4s: %08X\n", regName[i], regs[i], regName[i+8], regs[i+8], regName[i+16], regs[i+16], regName[i+24], regs[i+24]); } excpPrintf("\n"); SleepThread(); }
int main (int argc, char *argv[]) { /* * Program header request increments and other data. */ init_scr(); menu_window(); disp_menu(); get_choice(); quit_prg(); return 0; }
int main(void) { SifInitRpc(0); init_scr(); //LoadIRX(); initalise(); if (remove("mc0:/cheat.bin") < 0) { scr_printf(" Could not delete mc0:/cheat.bin"); } scr_printf(" CN-CHEAT!\n"); StartMenu(); return 0; }
int main() { int state=0; init_scr(); init_gamewin(); init_wall(); begain_game(); draw_wall(); draw_bird(); char c=getch(); while((state=refresh_game())>0) ; if(state==-2) game_over(); endwin(); return 0; }
//////////////////////////////////////////////////////////////////////// // The 'ee exception handler', only dumps registers to console or screen atm void pkoDebug(int cause, int badvaddr, int status, int epc, eeReg *regs) { int i; int code; // extern void printf(char *, ...); static void (* excpPrintf)(const char *, ...); FlushCache(0); FlushCache(2); #if 1 if (userThreadID) { TerminateThread(userThreadID); DeleteThread(userThreadID); } #endif code = cause & 0x7c; if (excepscrdump) { init_scr(); excpPrintf = scr_printf; } else excpPrintf = (void*)printf; excpPrintf("\n\n EE Exception handler: %s exception\n\n", codeTxt[code>>2]); excpPrintf(" Cause %08X BadVAddr %08X Status %08X EPC %08X\n\n", cause, badvaddr, status, epc); for(i = 0; i < 32/2; i++) { excpPrintf("%4s: %016lX%016lX %4s: %016lX%016lX\n", regName[i], regs[i].uint64[1], regs[i].uint64[0], regName[i+16], regs[i+16].uint64[1], regs[i+16].uint64[0]); } excpPrintf("\n"); SleepThread(); }