X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=platform%2Fpsp%2Femu.c;h=11b5e3f13000698cb6b1aaaa4efacdc2ebe07717;hb=2b02d6e533b114456785f39a356476eb97306fcf;hp=bdf6a6ed9451a02062d62d0c06f4f09f725bf002;hpb=c060a9ab9c428e1ed9c4159b56529a2a36031e44;p=picodrive.git diff --git a/platform/psp/emu.c b/platform/psp/emu.c index bdf6a6e..11b5e3f 100644 --- a/platform/psp/emu.c +++ b/platform/psp/emu.c @@ -22,6 +22,7 @@ #include "../common/config.h" #include "../common/lprintf.h" #include "../../Pico/PicoInt.h" +#include "../../Pico/cd/cue.h" #define OSD_FPS_X 432 @@ -34,7 +35,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 = PGS_Menu; +int engineState = PGS_Menu, engineStateSuspend; static unsigned int noticeMsgTime = 0; int reset_timing = 0; // do we need this? @@ -151,6 +152,7 @@ void emu_prepareDefaultConfig(void) defaultConfig.scale = 1.20; // fullscreen defaultConfig.hscale40 = 1.25; defaultConfig.hscale32 = 1.56; + defaultConfig.turbo_rate = 15; } void emu_setDefaultConfig(void) @@ -292,7 +294,8 @@ static void EmuScanPrepare(void) HighCol = (unsigned char *)VRAM_CACHED_STUFF + 8; if (!(Pico.video.reg[1]&8)) HighCol += 8*512; - dynamic_palette = 0; + if (dynamic_palette > 0) + dynamic_palette--; if (Pico.m.dirtyPal) do_pal_update(1, 1); if ((rendstatus & PDRAW_ACC_SPRITES) && !(Pico.video.reg[0xC]&8)) @@ -317,7 +320,7 @@ static int EmuScanSlowEnd(unsigned int num) if (Pico.m.dirtyPal) { if (!dynamic_palette) { do_slowmode_lines(num); - dynamic_palette = 1; + dynamic_palette = 3; // last for 2 more frames } do_pal_update(1, 0); } @@ -861,8 +864,11 @@ static void updateKeys(void) } } - PicoPad[0] = (unsigned short) allActions[0]; - PicoPad[1] = (unsigned short) allActions[1]; + PicoPad[0] = allActions[0] & 0xfff; + PicoPad[1] = allActions[1] & 0xfff; + + if (allActions[0] & 0x7000) emu_DoTurbo(&PicoPad[0], allActions[0]); + if (allActions[1] & 0x7000) emu_DoTurbo(&PicoPad[1], allActions[1]); events = (allActions[0] | allActions[1]) >> 16; @@ -1113,15 +1119,31 @@ void emu_HandleResume(void) { if (!(PicoAHW & PAHW_MCD)) return; - // reopen files.. + // reopen first CD track if (Pico_mcd->TOC.Tracks[0].F != NULL) { - lprintf("emu_HandleResume: reopen %s\n", romFileName); + char *fname = romFileName; + int len = strlen(romFileName); + cue_data_t *cue_data = NULL; + + if (len > 4 && strcasecmp(fname + len - 4, ".cue") == 0) + { + cue_data = cue_parse(romFileName); + if (cue_data != NULL) + fname = cue_data->tracks[1].fname; + } + + lprintf("emu_HandleResume: reopen %s\n", fname); pm_close(Pico_mcd->TOC.Tracks[0].F); - Pico_mcd->TOC.Tracks[0].F = pm_open(romFileName); + Pico_mcd->TOC.Tracks[0].F = pm_open(fname); lprintf("reopen %s\n", Pico_mcd->TOC.Tracks[0].F != NULL ? "ok" : "failed"); + + if (cue_data != NULL) cue_destroy(cue_data); } mp3_reopen_file(); + + if (!(Pico_mcd->s68k_regs[0x36] & 1) && (Pico_mcd->scd.Status_CDC & 1)) + cdda_start_play(); }