From 4327ec372f8cf9cfbbc5204a8091996761019266 Mon Sep 17 00:00:00 2001 From: notaz Date: Sun, 16 Sep 2007 15:44:18 +0000 Subject: [PATCH] updated EEPROM code, gmv fixed git-svn-id: file:///home/notaz/opt/svn/PicoDrive/platform@249 be3aeb3a-fb24-0410-a615-afba39da0efa --- gp2x/Makefile | 7 ++++++- gp2x/emu.c | 20 +++++++++++++------- gp2x/port_config.h | 2 +- linux/port_config.h | 2 +- 4 files changed, 21 insertions(+), 10 deletions(-) diff --git a/gp2x/Makefile b/gp2x/Makefile index c6f9fe9..1458a34 100644 --- a/gp2x/Makefile +++ b/gp2x/Makefile @@ -32,7 +32,12 @@ use_cyclone = 1 endif DEFINC = -I../.. -I. -DARM -D__GP2X__ -D_UNZIP_SUPPORT # -DBENCHMARK -COPT_COMMON = -static -Wall -O2 -ftracer -fstrength-reduce -fomit-frame-pointer -fstrict-aliasing -ffast-math -Winline +COPT_COMMON = -static -Wall -Winline +ifeq ($(DEBUG),) +COPT_COMMON += -O2 -ftracer -fstrength-reduce -fomit-frame-pointer -fstrict-aliasing -ffast-math +else +COPT_COMMON += -ggdb +endif ifeq "$(profile)" "1" COPT_COMMON += -fprofile-generate endif diff --git a/gp2x/emu.c b/gp2x/emu.c index adb10a3..3096edd 100644 --- a/gp2x/emu.c +++ b/gp2x/emu.c @@ -26,6 +26,7 @@ #include #include +//#define PFRAMES #ifdef BENCHMARK #define OSD_FPS_X 220 @@ -348,11 +349,11 @@ int emu_ReloadRom(void) } // additional movie stuff - if(movie_data) { + if (movie_data) { if(movie_data[0x14] == '6') PicoOpt |= 0x20; // 6 button pad else PicoOpt &= ~0x20; - PicoOpt |= 0x40; // accurate timing + PicoOpt |= 0x10040; // accurate timing, no VDP fifo timing if(movie_data[0xF] >= 'A') { if(movie_data[0x16] & 0x80) { PicoRegionOverride = 8; @@ -367,6 +368,7 @@ int emu_ReloadRom(void) } else { + PicoOpt &= ~0x10000; if(Pico.m.pal) { strcpy(noticeMsg, "PAL SYSTEM / 50 FPS"); } else { @@ -1185,17 +1187,18 @@ void emu_Loop(void) // prepare sound stuff if(currentConfig.EmuOpt & 4) { int snd_excess_add; - if(PsndRate != PsndRate_old || (PicoOpt&0x20b) != (PicoOpt_old&0x20b) || Pico.m.pal != pal_old || crashed_940) { + if (PsndRate != PsndRate_old || (PicoOpt&0x20b) != (PicoOpt_old&0x20b) || Pico.m.pal != pal_old || + ((PicoOpt&0x200) && crashed_940)) { /* if 940 is turned off, we need it to be put back to sleep */ if (!(PicoOpt&0x200) && ((PicoOpt^PicoOpt_old)&0x200)) { Reset940(1, 2); Pause940(1); } - sound_rerate(1); + sound_rerate(Pico.m.frame_count ? 1 : 0); } - //excess_samples = PsndRate - PsndLen*target_fps; snd_excess_add = ((PsndRate - PsndLen*target_fps)<<16) / target_fps; - printf("starting audio: %i len: %i (ex: %04x) stereo: %i, pal: %i\n", PsndRate, PsndLen, snd_excess_add, (PicoOpt&8)>>3, Pico.m.pal); + printf("starting audio: %i len: %i (ex: %04x) stereo: %i, pal: %i\n", + PsndRate, PsndLen, snd_excess_add, (PicoOpt&8)>>3, Pico.m.pal); gp2x_start_sound(PsndRate, 16, (PicoOpt&8)>>3); gp2x_sound_volume(currentConfig.volume, currentConfig.volume); PicoWriteSound = updateSound; @@ -1307,6 +1310,9 @@ void emu_Loop(void) if (frames_shown > frames_done) frames_shown = frames_done; } } +#ifdef PFRAMES + sprintf(fpsbuff, "%i", Pico.m.frame_count); +#endif lim_time = (frames_done+1) * target_frametime + vsync_offset; if(currentConfig.Frameskip >= 0) { // frameskip enabled @@ -1571,7 +1577,7 @@ int emu_SaveLoadGame(int load, int sram) } } else { sram_size = SRam.end-SRam.start+1; - if(SRam.reg_back & 4) sram_size=0x2000; + if(Pico.m.sram_reg & 4) sram_size=0x2000; sram_data = SRam.data; } if (!sram_data) return 0; // SRam forcefully disabled for this game diff --git a/gp2x/port_config.h b/gp2x/port_config.h index 7bfe247..02a3706 100644 --- a/gp2x/port_config.h +++ b/gp2x/port_config.h @@ -13,7 +13,7 @@ #define CAN_HANDLE_240_LINES 1 // logging emu events -#define EL_LOGMASK 0 // (EL_STATUS|EL_ANOMALY) // xffff +#define EL_LOGMASK 0 // (EL_STATUS|EL_ANOMALY|EL_UIO) // xffff //#define dprintf(f,...) printf("%05i:%03i: " f "\n",Pico.m.frame_count,Pico.m.scanline,##__VA_ARGS__) #define dprintf(x...) diff --git a/linux/port_config.h b/linux/port_config.h index 2e0eb54..0d439c4 100644 --- a/linux/port_config.h +++ b/linux/port_config.h @@ -13,7 +13,7 @@ // pico.c #define CAN_HANDLE_240_LINES 1 -#define EL_LOGMASK (EL_ANOMALY|EL_STATUS|EL_VDPDMA|EL_ASVDP|EL_SR) // |EL_BUSREQ|EL_Z80BNK) +#define EL_LOGMASK (EL_ANOMALY|EL_STATUS|EL_SRAMIO|EL_EEPROM) // EL_VDPDMA|EL_ASVDP|EL_SR) // |EL_BUSREQ|EL_Z80BNK) //#define dprintf(f,...) printf("%05i:%03i: " f "\n",Pico.m.frame_count,Pico.m.scanline,##__VA_ARGS__) #define dprintf(x...) -- 2.39.5