SRam.eeprom_bit_out= 7;\r
}\r
\r
+ // SVP detection\r
+ else if (name_cmp("Virtua Racing") == 0 ||\r
+ name_cmp("VIRTUA RACING") == 0)\r
+ {\r
+ PicoSVPStartup();\r
+ }\r
+\r
+ // Detect 4-in-1 and 12-in-1\r
+ else if ((name_cmp("ROBOCOP 3") && Pico.romsize == 0x200000) ||\r
+ (rom_strcmp(0x160, "FLICKY") && Pico.romsize == 0x200000))\r
+ {\r
+ carthw_12in1_startup();\r
+ }\r
+\r
// Some games malfunction if SRAM is not filled with 0xff\r
if (name_cmp("DINO DINI'S SOCCER") == 0 ||\r
name_cmp("MICRO MACHINES II") == 0)\r
+ {\r
memset(SRam.data, 0xff, sram_size);\r
+ }\r
\r
// 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
- name_cmp("VIRTUA RACING") == 0)\r
- {\r
- PicoSVPStartup();\r
- }\r
}\r
\r
#endif\r
elprintf(EL_UIO, "strange w%i: %06x, %08x @%06x", realsize, a&0xffffff, d, SekPc);\r
\r
- if(a >= 0xA13004 && a < 0xA13040) {\r
- // dumb 12-in-1 or 4-in-1 banking support\r
- int len;\r
- a &= 0x3f; a <<= 16;\r
- len = Pico.romsize - a;\r
- if (len <= 0) return; // invalid/missing bank\r
- if (len > 0x200000) len = 0x200000; // 2 megs\r
- memcpy(Pico.rom, Pico.rom+a, len); // code which does this is in RAM so this is safe.\r
- return;\r
- }\r
-\r
// for games with simple protection devices, discovered by Haze\r
- else if ((a>>22) == 1)\r
+ if ((a>>22) == 1)\r
Pico.m.prot_bytes[(a>>2)&1] = (u8)d;\r
}\r
\r
--- /dev/null
+#include "../PicoInt.h"
+
+/* 12-in-1 */
+static unsigned int carthw_12in1_read16(unsigned int a, int realsize)
+{
+ // ??
+ elprintf(EL_UIO, "12-in-1: read [%06x] @ %06x", a, SekPc);
+ return 0;
+}
+
+static void carthw_12in1_write8(unsigned int a, unsigned int d, int realsize)
+{
+ int len;
+
+ if (a < 0xA13000 || a >= 0xA13040) {
+ elprintf(EL_ANOMALY, "12-in-1: unexpected write [%06x] %02x @ %06x", a, d, SekPc);
+ }
+
+ a &= 0x3f; a <<= 16;
+ len = Pico.romsize - a;
+ if (len <= 0) {
+ elprintf(EL_ANOMALY, "12-in-1: missing bank @ %06x", a);
+ return;
+ }
+
+ memcpy(Pico.rom, Pico.rom + 0x200000 + a, len);
+}
+
+static void carthw_12in1_reset(void)
+{
+ carthw_12in1_write8(0xA13000, 0, 0);
+}
+
+void carthw_12in1_startup(void)
+{
+ void *tmp;
+
+ elprintf(EL_STATUS, "12-in-1 mapper detected");
+
+ tmp = realloc(Pico.rom, 0x200000 + 0x200000);
+ if (tmp == NULL)
+ {
+ elprintf(EL_STATUS, "OOM");
+ return;
+ }
+ memcpy(Pico.rom + 0x200000, Pico.rom, 0x200000);
+
+ PicoRead16Hook = carthw_12in1_read16;
+ PicoWrite8Hook = carthw_12in1_write8;
+ PicoResetHook = carthw_12in1_reset;
+}
+
void PicoSVPWrite8 (unsigned int a, unsigned int d, int realsize);
void PicoSVPWrite16(unsigned int a, unsigned int d, int realsize);
+/* 12-in-1 */
+void carthw_12in1_startup(void);
+
# 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 Pico/carthw/svp/ssp16.o Pico/carthw/svp/compiler.o
+OBJS += Pico/carthw/carthw.o Pico/carthw/svp/svp.o Pico/carthw/svp/Memory.o \
+ Pico/carthw/svp/ssp16.o Pico/carthw/svp/compiler.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
"NJ: CZ80\n"\r
"MAME devs: YM2612 and SN76496 cores\n"\r
"Stéphane Dallongeville: Gens code, base of Fame/C (C68K), CZ80\n"\r
- "Tasco Deluxe: SVP RE work\n",\r
+ "Tasco Deluxe: SVP RE work\n"\r
+ "Pierpaolo Prazzoli: info about SSP16 chips\n",\r
"About", 0);\r
return 0;\r
}\r
For more info, visit http://notaz.gp2x.de/svp.php\r
\r
\r
+Releases\r
+--------\r
+\r
+1.40 - first release.\r
+1.40a - Tasco Deluxe's dithering fix.\r
+1.40b - Perspective fix thanks to Pierpaolo Prazzoli's info.\r
+\r
+\r
Controls\r
--------\r
\r
-------\r
\r
A lot of work on making SVP emulation happen was done by Tasco Deluxe, my\r
-stuff is a continuation of his.\r
+stuff is a continuation of his. Pierpaolo Prazzoli's information and his\r
+SSP1610 disassebler in MAME code helped a lot too.\r
+\r
The original PicoDrive was written by fDave from finalburn.com\r
\r
This PicoDrive version uses bits and pieces of from other projects:\r