From a4bd56c62dec6b85df7111e99db3ade4334ea97d Mon Sep 17 00:00:00 2001 From: notaz Date: Sat, 5 Sep 2009 21:13:30 +0000 Subject: [PATCH] Finish migrating to new mem handling. Make carthw db external. Still need to fix asm and protection emulation. git-svn-id: file:///home/notaz/opt/svn/PicoDrive/platform@769 be3aeb3a-fb24-0410-a615-afba39da0efa --- common/emu.c | 6 ++---- gp2x/Makefile | 5 +++-- gp2x/emu.c | 2 +- linux/Makefile | 6 +++--- linux/gp2x.c | 1 + linux/port_config.h | 2 +- pandora/emu.c | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/common/emu.c b/common/emu.c index 4fcb792..6fc25b4 100644 --- a/common/emu.c +++ b/common/emu.c @@ -977,7 +977,7 @@ int emu_save_load_game(int load, int sram) int truncate = 1; if (PicoAHW & PAHW_MCD) { - if (PicoOpt&POPT_EN_MCD_RAMCART) { + if (PicoOpt & POPT_EN_MCD_RAMCART) { sram_size = 0x12000; sram_data = SRam.data; if (sram_data) @@ -988,9 +988,7 @@ int emu_save_load_game(int load, int sram) truncate = 0; // the .brm may contain RAM cart data after normal brm } } else { - sram_size = SRam.end-SRam.start+1; - if (Pico.m.sram_status & SRS_EEPROM) - sram_size = 0x2000; + sram_size = SRam.size; sram_data = SRam.data; } if (!sram_data) return 0; // SRam forcefully disabled for this game diff --git a/gp2x/Makefile b/gp2x/Makefile index ef63199..817237a 100644 --- a/gp2x/Makefile +++ b/gp2x/Makefile @@ -64,8 +64,9 @@ OBJS += platform/common/emu.o platform/common/menu.o platform/common/fonts.o pla ifeq "$(amalgamate)" "1" OBJS += ../../picoAll.o else -OBJS += pico/area.o pico/cart.o pico/memory.o pico/misc.o pico/pico.o pico/sek.o pico/z80if.o \ - pico/videoport.o pico/draw2.o pico/draw.o pico/mode4.o pico/sms.o pico/patch.o pico/debug.o +OBJS += pico/area.o pico/cart.o pico/memory.o pico/pico.o pico/sek.o pico/z80if.o \ + pico/videoport.o pico/draw2.o pico/draw.o pico/mode4.o pico/sms.o \ + pico/misc.o pico/eeprom.o pico/patch.o pico/debug.o # Pico - CD OBJS += pico/cd/pico.o pico/cd/memory.o pico/cd/sek.o pico/cd/LC89510.o \ pico/cd/cd_sys.o pico/cd/cd_file.o pico/cd/cue.o pico/cd/gfx_cd.o \ diff --git a/gp2x/emu.c b/gp2x/emu.c index 77e33f2..97b28b6 100644 --- a/gp2x/emu.c +++ b/gp2x/emu.c @@ -327,7 +327,7 @@ void pemu_update_display(const char *fps, const char *notice) gp2x_video_setpalette(localPal, ret); } // a hack for VR - if (PicoRead16Hook == PicoSVPRead16) + if (PicoAHW & PAHW_SVP) memset32((int *)(PicoDraw2FB+328*8+328*223), 0xe0e0e0e0, 328); // do actual copy vidcpyM2(g_screen_ptr, PicoDraw2FB+328*8, diff --git a/linux/Makefile b/linux/Makefile index 2202db2..3ec56b9 100644 --- a/linux/Makefile +++ b/linux/Makefile @@ -32,9 +32,9 @@ OBJS += platform/gp2x/in_gp2x.o endif # Pico -OBJS += pico/area.o pico/cart.o pico/memory.o pico/misc.o pico/pico.o pico/sek.o \ +OBJS += pico/area.o pico/cart.o pico/memory.o pico/pico.o pico/sek.o \ pico/videoport.o pico/draw2.o pico/draw.o pico/z80if.o pico/patch.o \ - pico/mode4.o pico/sms.o pico/debug.o + pico/mode4.o pico/sms.o pico/misc.o pico/eeprom.o pico/debug.o # Pico - CD OBJS += pico/cd/pico.o pico/cd/memory.o pico/cd/sek.o pico/cd/LC89510.o \ pico/cd/cd_sys.o pico/cd/cd_file.o pico/cd/cue.o pico/cd/gfx_cd.o \ @@ -55,7 +55,7 @@ OBJS += unzip/unzip.o unzip/unzip_stream.o ifeq "$(use_musashi)" "1" DEFINES += EMU_M68K OBJS += cpu/musashi/m68kops.o cpu/musashi/m68kcpu.o -OBJS += cpu/musashi/m68kdasm.o +#OBJS += cpu/musashi/m68kdasm.o endif ifeq "$(use_fame)" "1" DEFINES += EMU_F68K diff --git a/linux/gp2x.c b/linux/gp2x.c index 27216ee..e1b8c97 100644 --- a/linux/gp2x.c +++ b/linux/gp2x.c @@ -425,6 +425,7 @@ void *gp2x_video_setpalette = gp2x_video_setpalette_; void *gp2x_video_RGB_setscaling = do_nothing; void *gp2x_video_wait_vsync = do_nothing; void *gp2x_set_cpuclk = do_nothing; +void *gp2x_read_battery = do_nothing; void *set_lcd_custom_rate = do_nothing; void *unset_lcd_custom_rate = do_nothing; void *set_lcd_gamma = do_nothing; diff --git a/linux/port_config.h b/linux/port_config.h index fc2e118..05a903c 100644 --- a/linux/port_config.h +++ b/linux/port_config.h @@ -26,7 +26,7 @@ #define SIMPLE_WRITE_SOUND 0 #define mix_32_to_16l_stereo_lvl mix_32_to_16l_stereo -#define EL_LOGMASK (EL_ANOMALY|EL_STATUS|EL_UIO|EL_IDLE)//|EL_VDPDMA|EL_HVCNT|EL_ASVDP)//|EL_SVP) +#define EL_LOGMASK (EL_ANOMALY|EL_STATUS|EL_UIO|EL_IDLE|EL_SRAMIO|EL_EEPROM)//|EL_VDPDMA|EL_HVCNT|EL_ASVDP)//|EL_SVP) // 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__) diff --git a/pandora/emu.c b/pandora/emu.c index 3fbda4a..af3474a 100644 --- a/pandora/emu.c +++ b/pandora/emu.c @@ -253,7 +253,7 @@ static void blit(const char *fps, const char *notice) // gp2x_video_setpalette(localPal, 0x40); } // a hack for VR - if (PicoRead16Hook == PicoSVPRead16) + if (PicoAHW & PAHW_SVP) memset32((int *)(PicoDraw2FB+328*8+328*223), 0xe0e0e0e0, 328); // do actual copy vidCpyM2((unsigned char *)g_screen_ptr+g_screen_width*8, PicoDraw2FB+328*8); -- 2.39.5