X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=platform%2Fcommon%2Femu.c;h=44e15a64f1037b513dc5f15ba69a7a8140c67ba1;hb=c060a9ab9c428e1ed9c4159b56529a2a36031e44;hp=e88859b65b83bbf652434d7efca4a1f445327e9c;hpb=9037e45d9f2752fdd6ebbc01328148839403a84f;p=picodrive.git diff --git a/platform/common/emu.c b/platform/common/emu.c index e88859b..44e15a6 100644 --- a/platform/common/emu.c +++ b/platform/common/emu.c @@ -43,6 +43,7 @@ int state_slot = 0; int config_slot = 0, config_slot_current = 0; char lastRomFile[512]; int kb_combo_keys = 0, kb_combo_acts = 0; // keys and actions which need button combos +int pico_inp_mode = 0; unsigned char *movie_data = NULL; static int movie_size = 0; @@ -224,7 +225,7 @@ int emu_cdCheck(int *pregion) return type; } -static int extract_text(char *dest, unsigned char *src, int len, int swab) +static int extract_text(char *dest, const unsigned char *src, int len, int swab) { char *p = dest; int i; @@ -427,8 +428,6 @@ int emu_ReloadRom(void) return 0; } - Pico.m.frame_count = 0; - // insert CD if it was detected if (cd_state != CIT_NOT_CD) { ret = Insert_CD(romFileName, cd_state); @@ -452,7 +451,7 @@ int emu_ReloadRom(void) if(movie_data[0x14] == '6') PicoOpt |= POPT_6BTN_PAD; // 6 button pad else PicoOpt &= ~POPT_6BTN_PAD; - PicoOpt |= POPT_DIS_VDP_FIFO|POPT_ACC_TIMING; // accurate timing, no VDP fifo timing + PicoOpt |= POPT_DIS_VDP_FIFO; // no VDP fifo timing if(movie_data[0xF] >= 'A') { if(movie_data[0x16] & 0x80) { PicoRegionOverride = 8; @@ -973,3 +972,60 @@ int emu_SaveLoadGame(int load, int sram) } } +void emu_changeFastForward(int set_on) +{ + static void *set_PsndOut = NULL; + static int set_Frameskip, set_EmuOpt, is_on = 0; + + if (set_on && !is_on) { + set_PsndOut = PsndOut; + set_Frameskip = currentConfig.Frameskip; + set_EmuOpt = currentConfig.EmuOpt; + PsndOut = NULL; + currentConfig.Frameskip = 8; + currentConfig.EmuOpt &= ~4; + currentConfig.EmuOpt |= 0x40000; + is_on = 1; + strcpy(noticeMsg, "FAST FORWARD "); + emu_noticeMsgUpdated(); + } + else if (!set_on && is_on) { + PsndOut = set_PsndOut; + currentConfig.Frameskip = set_Frameskip; + currentConfig.EmuOpt = set_EmuOpt; + PsndRerate(1); + is_on = 0; + } +} + +void emu_RunEventsPico(unsigned int events) +{ + if (events & (1 << 3)) { + pico_inp_mode++; + if (pico_inp_mode > 2) pico_inp_mode = 0; + switch (pico_inp_mode) { + case 2: strcpy(noticeMsg, "Input: Pen on Pad "); break; + case 1: strcpy(noticeMsg, "Input: Pen on Storyware"); break; + case 0: strcpy(noticeMsg, "Input: Joytick "); + PicoPicohw.pen_pos[0] = PicoPicohw.pen_pos[1] = 0x8000; + break; + } + emu_noticeMsgUpdated(); + } + if (events & (1 << 4)) { + PicoPicohw.page--; + if (PicoPicohw.page < 0) PicoPicohw.page = 0; + sprintf(noticeMsg, "Page %i ", PicoPicohw.page); + emu_noticeMsgUpdated(); + } + if (events & (1 << 5)) { + PicoPicohw.page++; + if (PicoPicohw.page > 6) PicoPicohw.page = 6; + sprintf(noticeMsg, "Page %i ", PicoPicohw.page); + emu_noticeMsgUpdated(); + } +} + + + +