X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=common%2Femu.c;h=9e0726037d634b1ed6610c33f3d68ce4d69bd45c;hb=2951214ea65ce2e2ac40671511b8d5a9ea2d2842;hp=99fca4979005f145e3d32b78012a2f472c8969e4;hpb=f013066e974c7d35b818a6fca43a9deba1ce5c3e;p=libpicofe.git diff --git a/common/emu.c b/common/emu.c index 99fca49..9e07260 100644 --- a/common/emu.c +++ b/common/emu.c @@ -26,7 +26,11 @@ #elif defined(__GIZ__) #include "../gizmondo/giz.h" #define SCREEN_WIDTH 321 - #define SCREEN_BUFFER giz_screen // ? + #define SCREEN_BUFFER giz_screen +#elif defined(PSP) + #include "../psp/psp.h" + #define SCREEN_WIDTH 512 + #define SCREEN_BUFFER psp_screen #endif char *PicoConfigFile = "picoconfig.bin"; @@ -446,12 +450,13 @@ int emu_ReadConfig(int game, int no_defaults) if (currentConfig.CPUclock < 10 || currentConfig.CPUclock > 4096) currentConfig.CPUclock = 200; if (currentConfig.gamma < 10 || currentConfig.gamma > 300) currentConfig.gamma = 100; if (currentConfig.volume < 0 || currentConfig.volume > 99) currentConfig.volume = 50; +#ifdef __GP2X__ // if volume keys are unbound, bind them to volume control if (!currentConfig.KeyBinds[23] && !currentConfig.KeyBinds[22]) { currentConfig.KeyBinds[23] = 1<<29; // vol up currentConfig.KeyBinds[22] = 1<<30; // vol down } - +#endif if (bread > 0) config_slot_current = config_slot; return (bread > 0); // == sizeof(currentConfig)); } @@ -686,7 +691,8 @@ int emu_SaveLoadGame(int load, int sram) lprintf("saveLoad (%i, %i): %s\n", load, sram, saveFname); - if(sram) { + if (sram) + { FILE *sramFile; int sram_size; unsigned char *sram_data; @@ -739,10 +745,11 @@ int emu_SaveLoadGame(int load, int sram) else { void *PmovFile = NULL; - if (strcmp(saveFname + strlen(saveFname) - 3, ".gz") == 0) { + if (strcmp(saveFname + strlen(saveFname) - 3, ".gz") == 0) + { if( (PmovFile = gzopen(saveFname, load ? "rb" : "wb")) ) { emu_setSaveStateCbs(1); - if(!load) gzsetparams(PmovFile, 9, Z_DEFAULT_STRATEGY); + if (!load) gzsetparams(PmovFile, 9, Z_DEFAULT_STRATEGY); } } else