void emu_close() { vid_close(); pcm_close(); loader_unload(); emu_run = 0; }
void gbcUnloadRom() { gbcSaveSRAM(); loader_unload(); }
int menu(){ char *dir; int mexit=0; static char *loadrom; int old_upscale = 0, new_upscale = 0; old_upscale = rc_getint("upscaler"); gui_begin(); while(!mexit){ dialog_begin(rom.name,"ohBoy"); dialog_text("Back to Game",NULL,FIELD_SELECTABLE); dialog_text("Load State",NULL,FIELD_SELECTABLE); dialog_text("Save State",NULL,FIELD_SELECTABLE); dialog_text("Reset Game",NULL,FIELD_SELECTABLE); dialog_text(NULL,NULL,0); dialog_text("Load ROM",NULL,FIELD_SELECTABLE); dialog_text("Options",NULL,FIELD_SELECTABLE); dialog_text("Controls",NULL,FIELD_SELECTABLE); dialog_text("About",NULL,FIELD_SELECTABLE); dialog_text("Quit","",FIELD_SELECTABLE); #ifdef DINGOO_NATIVE dialog_text(NULL, NULL, 0); /* blank line */ dialog_text("Menu:", NULL, 0); dialog_text(" Slide Power", NULL, 0); #endif /* DINGOO_NATIVE */ switch(dialog_end()){ case 2: if(menu_state(0)) mexit=1; break; case 3: if(menu_state(1)) mexit=1; break; case 4: rc_command("reset"); mexit=1; break; case 6: dir = rc_getstr("romdir"); if(loadrom = menu_requestfile(NULL,"Select Rom",dir,"gb;gbc;zip")) { loader_unload(); ohb_loadrom(loadrom); mexit=1; } break; case 7: if(menu_options()) mexit=1; break; case 8: if(menu_controls()) mexit=1; break; case 9: if(menu_about()) mexit=0; break; case 10: exit(0); break; default: mexit=1; break; } } new_upscale = rc_getint("upscaler"); if (old_upscale != new_upscale) scaler_init(new_upscale); gui_end(); return 0; }