// Unusual region 'code'\r
if (rom_strcmp(0x1f0, "EUROPE") == 0)\r
*(int *) (Pico.rom+0x1f0) = 0x20204520;\r
+\r
+ // SVP detection\r
+ if (name_cmp("Virtua Racing") == 0)\r
+ {\r
+ PicoSVPInit();\r
+ PicoRead16Hook = PicoSVPRead16;\r
+ PicoWrite8Hook = PicoSVPWrite8;\r
+ }\r
}\r
\r
}\r
\r
// for nonstandard reads\r
-#ifndef _ASM_MEMORY_C\r
-static\r
-#endif\r
-u32 OtherRead16End(u32 a, int realsize)\r
+static u32 OtherRead16End(u32 a, int realsize)\r
{\r
u32 d=0;\r
\r
\r
\r
// -----------------------------------------------------------------\r
+\r
+// TODO: asm code\r
+u32 (*PicoRead16Hook)(u32 a, int realsize) = OtherRead16End;\r
+void (*PicoWrite8Hook)(u32 a, u32 d, int realsize) = OtherWrite8End;\r
+\r
PICO_INTERNAL void PicoMemSetup(void)\r
{\r
+ // default unmapped/cart specific handlers\r
+ PicoRead16Hook = OtherRead16End;\r
+ PicoWrite8Hook = OtherWrite8End;\r
+\r
// Setup memory callbacks:\r
#ifdef EMU_C68K\r
PicoCpuCM68k.checkpc=PicoCheckPc;\r
goto end;
}
- d = OtherRead16End(a, realsize);
+ d = PicoRead16Hook(a, realsize);
end:
return d;
return;
}
- OtherWrite8End(a, d, 8);
+ PicoWrite8Hook(a, d, 8);
}
SRAMWrite(a, d);
return;
}
-#else
- OtherWrite8End(a, d>>8, 16);
- OtherWrite8End(a+1,d&0xff, 16);
#endif
+
+ PicoWrite8Hook(a, d>>8, 16);
+ PicoWrite8Hook(a+1,d&0xff, 16);
}
#include <stdlib.h>\r
#include <string.h>\r
#include "Pico.h"\r
+#include "carthw/carthw.h"\r
\r
//\r
#define USE_POLL_DETECT\r
#else\r
PICO_INTERNAL_ASM void z80_write(unsigned int a, unsigned char data);\r
#endif\r
+extern unsigned int (*PicoRead16Hook)(unsigned int a, int realsize);\r
+extern void (*PicoWrite8Hook)(unsigned int a,unsigned int d,int realsize);\r
\r
// cd/Memory.c\r
PICO_INTERNAL void PicoMemSetupCD(void);\r
--- /dev/null
+
+
+/* svp */
+void PicoSVPInit(void);
+
+unsigned int PicoSVPRead16(unsigned int a, int realsize);
+void PicoSVPWrite8(unsigned int a,unsigned int d,int realsize);
+
--- /dev/null
+#include "../../PicoInt.h"
+
+unsigned int PicoSVPRead16(unsigned int a, int realsize)
+{
+ unsigned int d = 0;
+
+ elprintf(EL_UIO, "SVP r%i: [%06x] %04x @%06x", realsize, a&0xffffff, d, SekPc);
+
+ return d;
+}
+
+void PicoSVPWrite8(unsigned int a, unsigned int d, int realsize)
+{
+ elprintf(EL_UIO, "SVP w%i: %06x, %08x @%06x", realsize, a&0xffffff, d, SekPc);
+}
+
--- /dev/null
+#include "../../PicoInt.h"
+
+void PicoSVPInit(void)
+{
+ elprintf(0xffff, "SVP");
+}
+
\r
PICO_INTERNAL void PicoMemSetupCD(void)\r
{\r
+ // additional handlers for common code\r
+ PicoRead16Hook = OtherRead16End;\r
+ PicoWrite8Hook = OtherWrite8End;\r
+\r
#ifdef EMU_C68K\r
// Setup m68k memory callbacks:\r
PicoCpuCM68k.checkpc=PicoCheckPcM68k;\r
Pico/cd/Area.o Pico/cd/Misc.o Pico/cd/pcm.o Pico/cd/buffering.o
# Pico - sound
OBJS += Pico/sound/sound.o Pico/sound/sn76496.o Pico/sound/ym2612.o Pico/sound/mix.o
+# Pico - carthw
+OBJS += Pico/carthw/svp/svp.o Pico/carthw/svp/Memory.o
# zlib
OBJS += zlib/gzio.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o zlib/trees.o \
zlib/deflate.o zlib/crc32.o zlib/adler32.o zlib/zutil.o zlib/compress.o zlib/uncompr.o
endif
vpath %.c = ../..
-DIRS = platform platform/gp2x platform/common Pico Pico/cd Pico/sound zlib unzip \
- cpu cpu/musashi cpu/fame cpu/mz80 cpu/cz80
+DIRS = platform platform/gp2x platform/common Pico Pico/cd Pico/sound Pico/carthw/svp \
+ zlib unzip cpu cpu/musashi cpu/fame cpu/mz80 cpu/cz80
all: mkdirs PicoDrive
clean: tidy
// dummies
char *ext_menu = 0, *ext_state = 0;
+int mix_32_to_16l_level;
/* gtk */
struct gtk_global_struct
// pico.c
#define CAN_HANDLE_240_LINES 1
-#define EL_LOGMASK (EL_ANOMALY|EL_STATUS|EL_SRAMIO|EL_EEPROM) // EL_VDPDMA|EL_ASVDP|EL_SR) // |EL_BUSREQ|EL_Z80BNK)
+#define mix_32_to_16l_stereo_lvl mix_32_to_16l_stereo
+
+#define EL_LOGMASK (EL_ANOMALY|EL_STATUS|EL_SRAMIO|EL_EEPROM|EL_UIO) // 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...)