X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=psp%2Femu.c;h=4af44b9866694bf896978863fb9451b1aedcfce7;hb=367b6f1f939dcd7930d372aee0ca900b0b8790b1;hp=4292615ba5036822bf38c15b141f093acf625979;hpb=93c0d147a19160bcf970edac8d0e27f93537ae8d;p=libpicofe.git diff --git a/psp/emu.c b/psp/emu.c index 4292615..4af44b9 100644 --- a/psp/emu.c +++ b/psp/emu.c @@ -33,7 +33,7 @@ int sceAudioOutput2GetRestSample(); char romFileName[PATH_MAX]; unsigned char *PicoDraw2FB = (unsigned char *)VRAM_CACHED_STUFF + 8; // +8 to be able to skip border with 1 quadword.. -int engineState; +int engineState = PGS_Menu; static int combo_keys = 0, combo_acts = 0; // keys and actions which need button combos static unsigned int noticeMsgTime = 0; @@ -111,19 +111,8 @@ void emu_Deinit(void) SRam.changed = 0; } - if (!(currentConfig.EmuOpt & 0x20)) { - FILE *f = fopen(PicoConfigFile, "r+b"); - if (!f) emu_WriteConfig(0); - else { - // if we already have config, reload it, except last ROM - fseek(f, sizeof(currentConfig.lastRomFile), SEEK_SET); - fread(¤tConfig.EmuOpt, 1, sizeof(currentConfig) - sizeof(currentConfig.lastRomFile), f); - fseek(f, 0, SEEK_SET); - fwrite(¤tConfig, 1, sizeof(currentConfig), f); - fflush(f); - fclose(f); - } - } + if (!(currentConfig.EmuOpt & 0x20)) + config_writelrom(PicoConfigFile); PicoExit(); sound_deinit(); @@ -535,7 +524,7 @@ static int sound_thread(SceSize args, void *argp) // shouln't happen, but just in case if (samples_made - samples_done >= samples_block*3) { - lprintf("sthr: block skip (%i)\n", samples_made - samples_done); + //lprintf("sthr: block skip (%i)\n", samples_made - samples_done); samples_done += samples_block; // skip snd_playptr += samples_block; } @@ -1075,3 +1064,19 @@ void emu_ResetGame(void) reset_timing = 1; } +void emu_HandleResume(void) +{ + if (!(PicoMCD & 1)) return; + + // reopen files.. + if (Pico_mcd->TOC.Tracks[0].F != NULL) + { + lprintf("emu_HandleResume: reopen %s\n", romFileName); + pm_close(Pico_mcd->TOC.Tracks[0].F); + Pico_mcd->TOC.Tracks[0].F = pm_open(romFileName); + lprintf("reopen %s\n", Pico_mcd->TOC.Tracks[0].F != NULL ? "ok" : "failed"); + } + + mp3_reopen_file(); +} +