From 2d0b15bb2c532cacdbc8fcecb915177b1bd5f2af Mon Sep 17 00:00:00 2001 From: notaz Date: Thu, 5 Jul 2007 20:34:02 +0000 Subject: [PATCH] cyclone_debug improvements pt. 2 git-svn-id: file:///home/notaz/opt/svn/PicoDrive@185 be3aeb3a-fb24-0410-a615-afba39da0efa --- Pico/Memory.c | 69 +++++++++++++++++++++++++++++++----------- Pico/Pico.c | 2 +- Pico/PicoInt.h | 13 ++++++-- Pico/Sek.c | 8 +++++ Pico/VideoPort.c | 2 +- Pico/cd/Sek.c | 6 ++-- platform/gp2x/Makefile | 23 +++++++++++--- 7 files changed, 95 insertions(+), 28 deletions(-) diff --git a/Pico/Memory.c b/Pico/Memory.c index 21db15e4..48f1fedb 100644 --- a/Pico/Memory.c +++ b/Pico/Memory.c @@ -7,7 +7,7 @@ // For commercial use, separate licencing terms must be obtained. -//#define __debug_io +#define __debug_io #include "PicoInt.h" @@ -307,7 +307,7 @@ u8 CPU_CALL PicoRead8(u32 a) dprintf("r8 : %06x, %02x @%06x", a&0xffffff, (u8)d, SekPc); #endif #if defined(EMU_C68K) && defined(EMU_M68K) - if(a>=Pico.romsize&&(ppop&0x3f)!=0x3a&&(ppop&0x3f)!=0x3b) { + if(a>=Pico.romsize/*&&(ppop&0x3f)!=0x3a&&(ppop&0x3f)!=0x3b*/) { lastread_a = a; lastread_d[lrp_cyc++&15] = (u8)d; } @@ -343,7 +343,7 @@ u16 CPU_CALL PicoRead16(u32 a) dprintf("r16: %06x, %04x @%06x", a&0xffffff, d, SekPc); #endif #if defined(EMU_C68K) && defined(EMU_M68K) - if(a>=Pico.romsize&&(ppop&0x3f)!=0x3a&&(ppop&0x3f)!=0x3b) { + if(a>=Pico.romsize/*&&(ppop&0x3f)!=0x3a&&(ppop&0x3f)!=0x3b*/) { lastread_a = a; lastread_d[lrp_cyc++&15] = d; } @@ -374,7 +374,7 @@ u32 CPU_CALL PicoRead32(u32 a) dprintf("r32: %06x, %08x @%06x", a&0xffffff, d, SekPc); #endif #if defined(EMU_C68K) && defined(EMU_M68K) - if(a>=Pico.romsize&&(ppop&0x3f)!=0x3a&&(ppop&0x3f)!=0x3b) { + if(a>=Pico.romsize/*&&(ppop&0x3f)!=0x3a&&(ppop&0x3f)!=0x3b*/) { lastread_a = a; lastread_d[lrp_cyc++&15] = d; } @@ -500,39 +500,72 @@ unsigned int m68k_read_pcrelative_CD16(unsigned int a); unsigned int m68k_read_pcrelative_CD32(unsigned int a); // these are allowed to access RAM -unsigned int m68k_read_pcrelative_8 (unsigned int a) { +static unsigned int m68k_read_8 (unsigned int a, int do_fake) { a&=0xffffff; if(PicoMCD&1) return m68k_read_pcrelative_CD8(a); if(a %i", level, level_new); @@ -82,7 +82,7 @@ int SekInitS68k() m68k_set_context(&PicoS68kCPU); m68k_set_cpu_type(M68K_CPU_TYPE_68000); m68k_init(); - m68k_set_int_ack_callback(SekIntAckS68k); + m68k_set_int_ack_callback(SekIntAckS68kM); // m68k_pulse_reset(); // not yet, memmap is not set up m68k_set_context(oldcontext); } @@ -111,6 +111,8 @@ int SekResetS68k() void *oldcontext = m68ki_cpu_p; m68k_set_context(&PicoS68kCPU); + m68ki_cpu.sp[0]=0; + m68k_set_irq(0); m68k_pulse_reset(); m68k_set_context(oldcontext); } diff --git a/platform/gp2x/Makefile b/platform/gp2x/Makefile index abb6be4c..1654dfa6 100644 --- a/platform/gp2x/Makefile +++ b/platform/gp2x/Makefile @@ -5,9 +5,8 @@ CROSS = arm-linux- #CROSS = $(devkit_path)bin/arm-linux- # settings -dprint = 1 #mz80 = 1 -#debug_cyclone = 1 +debug_cyclone = 0 asm_memory = 1 asm_render = 1 asm_ym2612 = 1 @@ -18,8 +17,19 @@ asm_cdmemory = 1 #use_musashi = 1 #up = 1 + +ifeq "$(debug_cyclone)" "1" +use_cyclone = 1 +use_musashi = 1 +asm_memory = 0 +asm_cdmemory = 0 +endif +ifneq "$(use_musashi)" "1" +use_cyclone = 1 +endif + DEFINC = -I../.. -I. -DARM -D__GP2X__ -D_UNZIP_SUPPORT # -DBENCHMARK -COPT_COMMON = -static -O3 -ftracer -fstrength-reduce -Wall -funroll-loops -fomit-frame-pointer -fstrict-aliasing -ffast-math # -s +COPT_COMMON = -static -Wall -O3 -ftracer -fstrength-reduce -funroll-loops -fomit-frame-pointer -fstrict-aliasing -ffast-math # -s ifeq "$(profile)" "1" COPT_COMMON += -fprofile-generate endif @@ -82,12 +92,17 @@ OBJS += ../../zlib/gzio.o ../../zlib/inffast.o ../../zlib/inflate.o ../../zlib/i OBJS += ../../unzip/unzip.o ../../unzip/unzip_stream.o # mp3 OBJS += mp3.o +# debug +ifeq "$(debug_cyclone)" "1" +OBJS += ../../Pico/_cyclone_debug.o ../../cpu/musashi/m68kdasm.o +endif # CPU cores ifeq "$(use_musashi)" "1" DEFINC += -DEMU_M68K OBJS += ../../cpu/musashi/m68kcpu.o ../../cpu/musashi/m68kopac.o ../../cpu/musashi/m68kopdm.o OBJS += ../../cpu/musashi/m68kopnz.o ../../cpu/musashi/m68kops.o -else +endif +ifeq "$(use_cyclone)" "1" DEFINC += -DEMU_C68K OBJS += ../../cpu/Cyclone/proj/Cyclone.o endif -- 2.39.5