unsigned char supervision_load(uint8 *rom, uint32 romSize) { memorymap_load(rom, romSize); supervision_reset(); return(1); }
void CheckKeys(void) { unsigned long pad=gp2x_joystick_read(0); if(pad & GP2X_VOL_DOWN) if(pad & GP2X_START) { supervision_done(); //shutsdown the system //gp2x_deinit(); exit(0); } if(pad & GP2X_L) if(pad & GP2X_R) //Checks if L and R are pushed supervision_reset(); //Reset emulator if(pad & GP2X_L) if(pad & GP2X_LEFT) //Checks if L and LEFT pushed supervision_set_colour_scheme(COLOUR_SCHEME_DEFAULT); //Changes the color scheme if(pad & GP2X_L) if(pad & GP2X_RIGHT) //Checks if L and RIGHT are pushed supervision_set_colour_scheme(COLOUR_SCHEME_AMBER); //Changes the color scheme if(pad & GP2X_L) if(pad & GP2X_UP) //Checks if L and UP pushed supervision_set_colour_scheme(COLOUR_SCHEME_GREEN); //Changes the color scheme if(pad & GP2X_L) if(pad & GP2X_DOWN) //Checks if L and DOWN pushed supervision_set_colour_scheme(COLOUR_SCHEME_BLUE); //Changes the color scheme if(pad & GP2X_Y) { paused=TRUE; textClear(); handleMainMenu(); // File menu paused=FALSE;} if (pad & (GP2X_VOL_UP|GP2X_VOL_DOWN)) { int vol = currentConfig.volume; if (pad & GP2X_VOL_UP) { if (vol < 255) vol++; } else { if (vol > 0) vol--; } gp2x_sound_volume(vol, vol); currentConfig.volume = vol; } }
void handleMainMenu(void) { BOOL isSelected = FALSE; int menuOption = 0; textClear(); gp2x_video_RGB_setscaling(320, 240); while(!isSelected) { unsigned long pad = gp2x_joystick_read(0); printMenuOptions(); gp2x_printf(0, 170, 1, "MenuOption = %d",menuOption); gp2x_printf(0, 0, (31 + (menuOption*8)), "->"); gp2x_video_RGB_flip(0); if(pad & GP2X_RIGHT) { if((menuOption == MMOPTION_SAVESTATE) || (menuOption == MMOPTION_LOADSTATE)) saveSlot++; } if(pad & GP2X_LEFT) { if((menuOption == MMOPTION_SAVESTATE) || (menuOption == MMOPTION_LOADSTATE)) saveSlot--; } if(pad & GP2X_DOWN) { menuOption++; textClear(); } if(pad & GP2X_UP) { menuOption--; textClear(); } if(pad & GP2X_VOL_DOWN) if(pad & GP2X_START) exitMenu(); if(pad & GP2X_X) { switch(menuOption){ case MMOPTION_CONTINUE: RESIZE(); textClear(); return; case MMOPTION_RESTART: RESIZE(); supervision_reset(); textClear(); return; case MMOPTION_SELECTOR: handleFileMenu(); return; case MMOPTION_OPTIONS: handleOptionsMenu(); textClear(); return; case MMOPTION_SAVESTATE: sv_saveState(romname,saveSlot); textClear();return; case MMOPTION_LOADSTATE: sv_loadState(romname,saveSlot); textClear();return; case MMOPTION_EXIT: exitMenu(); break; default: return; } } /*if(pad & GP2X_B) { textClear(); return; }*/ if(menuOption < 0) menuOption = 0; if(menuOption > 6) menuOption = 6; if(saveSlot < 0) saveSlot = 0; if(saveSlot > 9) saveSlot = 9; while(pad == gp2x_joystick_read(0)); pad = gp2x_joystick_read(0); textClear(); } }