updated EEPROM code, gmv fixed

git-svn-id: file:///home/notaz/opt/svn/PicoDrive/platform@249 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
notaz 2007-09-16 15:44:18 +00:00
parent 31a77bded3
commit 4327ec372f
4 changed files with 21 additions and 10 deletions

View file

@ -32,7 +32,12 @@ use_cyclone = 1
endif endif
DEFINC = -I../.. -I. -DARM -D__GP2X__ -D_UNZIP_SUPPORT # -DBENCHMARK 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" ifeq "$(profile)" "1"
COPT_COMMON += -fprofile-generate COPT_COMMON += -fprofile-generate
endif endif

View file

@ -26,6 +26,7 @@
#include <Pico/Patch.h> #include <Pico/Patch.h>
#include <zlib/zlib.h> #include <zlib/zlib.h>
//#define PFRAMES
#ifdef BENCHMARK #ifdef BENCHMARK
#define OSD_FPS_X 220 #define OSD_FPS_X 220
@ -352,7 +353,7 @@ int emu_ReloadRom(void)
if(movie_data[0x14] == '6') if(movie_data[0x14] == '6')
PicoOpt |= 0x20; // 6 button pad PicoOpt |= 0x20; // 6 button pad
else PicoOpt &= ~0x20; else PicoOpt &= ~0x20;
PicoOpt |= 0x40; // accurate timing PicoOpt |= 0x10040; // accurate timing, no VDP fifo timing
if(movie_data[0xF] >= 'A') { if(movie_data[0xF] >= 'A') {
if(movie_data[0x16] & 0x80) { if(movie_data[0x16] & 0x80) {
PicoRegionOverride = 8; PicoRegionOverride = 8;
@ -367,6 +368,7 @@ int emu_ReloadRom(void)
} }
else else
{ {
PicoOpt &= ~0x10000;
if(Pico.m.pal) { if(Pico.m.pal) {
strcpy(noticeMsg, "PAL SYSTEM / 50 FPS"); strcpy(noticeMsg, "PAL SYSTEM / 50 FPS");
} else { } else {
@ -1185,17 +1187,18 @@ void emu_Loop(void)
// prepare sound stuff // prepare sound stuff
if(currentConfig.EmuOpt & 4) { if(currentConfig.EmuOpt & 4) {
int snd_excess_add; 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 940 is turned off, we need it to be put back to sleep */
if (!(PicoOpt&0x200) && ((PicoOpt^PicoOpt_old)&0x200)) { if (!(PicoOpt&0x200) && ((PicoOpt^PicoOpt_old)&0x200)) {
Reset940(1, 2); Reset940(1, 2);
Pause940(1); 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; 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_start_sound(PsndRate, 16, (PicoOpt&8)>>3);
gp2x_sound_volume(currentConfig.volume, currentConfig.volume); gp2x_sound_volume(currentConfig.volume, currentConfig.volume);
PicoWriteSound = updateSound; PicoWriteSound = updateSound;
@ -1307,6 +1310,9 @@ void emu_Loop(void)
if (frames_shown > frames_done) frames_shown = frames_done; 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; lim_time = (frames_done+1) * target_frametime + vsync_offset;
if(currentConfig.Frameskip >= 0) { // frameskip enabled if(currentConfig.Frameskip >= 0) { // frameskip enabled
@ -1571,7 +1577,7 @@ int emu_SaveLoadGame(int load, int sram)
} }
} else { } else {
sram_size = SRam.end-SRam.start+1; 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; sram_data = SRam.data;
} }
if (!sram_data) return 0; // SRam forcefully disabled for this game if (!sram_data) return 0; // SRam forcefully disabled for this game

View file

@ -13,7 +13,7 @@
#define CAN_HANDLE_240_LINES 1 #define CAN_HANDLE_240_LINES 1
// logging emu events // 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(f,...) printf("%05i:%03i: " f "\n",Pico.m.frame_count,Pico.m.scanline,##__VA_ARGS__)
#define dprintf(x...) #define dprintf(x...)

View file

@ -13,7 +13,7 @@
// pico.c // pico.c
#define CAN_HANDLE_240_LINES 1 #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(f,...) printf("%05i:%03i: " f "\n",Pico.m.frame_count,Pico.m.scanline,##__VA_ARGS__)
#define dprintf(x...) #define dprintf(x...)