PicoIn.AHW = PAHW_SVP;\r
else if (strcmp(p, "pico") == 0)\r
PicoIn.AHW = PAHW_PICO;\r
+ else if (strcmp(p, "j_cart") == 0)\r
+ carthw_jcart_startup();\r
else if (strcmp(p, "prot") == 0)\r
carthw_sprot_startup();\r
else if (strcmp(p, "flash") == 0)\r
# pico - Sega Pico (not really cart hw, but convenient to support here)
# prot - simple copy protection devices in unlicensed cartridges (see prot. below)
# flash - protection through reading the flash chip ID
+# j_cart - 2 additional joypad ports on cart
#
# cartridge properties (prop = ...):
# no_sram - don't emulate sram/EEPROM even if ROM headers tell it's there
check_str = 0x150, "DINO DINI'S SOCCER"
prop = filled_sram
-[Micro Machines 2 - Turbo Tournament]
-check_str = 0x150, "MICRO MACHINES II"
-prop = filled_sram
-
# bad headers
[HardBall III]
check_str = 0x150, " HardBall III"
sram_range = 0x200000,0x20ffff
+# J-Cart
+[Super Skidmarks, Micro Machines Military]
+check_str = 0x150, " "
+check_csum = 0x168b
+hw = j_cart
+
+[Pete Sampras Tennis, Micro Machines Turbo Tournament 96]
+check_str = 0x150, " "
+check_csum = 0x165e
+hw = j_cart
+
+[Micro Machines 2 - Turbo Tournament]
+check_str = 0x150, "MICRO MACHINES II"
+hw = j_cart
+
+[Pete Sampras Tennis 96]
+check_str = 0x150, "PETE SAMPRAS TENNIS '96"
+hw = j_cart
+
# The SSF2 mapper
[Mega Everdrive]
check_str = 0x100, "SEGA SSF"
eeprom_type = 1
eeprom_lines = 1,0,0
-[MICRO MACHINES II]
+[Micro Machines 2 - Turbo Tournament]
check_str = 0x150, "MICRO MACHINES II"
-sram_range = 0x300000,0x380001
+prop = filled_sram
+sram_range = 0x300000,0x37ffff
eeprom_type = 2
eeprom_lines = 9,8,7
[Micro Machines - Turbo Tournament '96]
check_str = 0x150, " "
check_csum = 0x165e
-sram_range = 0x300000,0x380001
+sram_range = 0x300000,0x37ffff
eeprom_type = 2
eeprom_lines = 9,8,7
[Micro Machines - Turbo Tournament '96]
check_str = 0x150, " "
check_csum = 0x2c41
-sram_range = 0x300000,0x380001
+sram_range = 0x300000,0x37ffff
eeprom_type = 2
eeprom_lines = 9,8,7
[Micro Machines Military]
check_str = 0x150, " "
check_csum = 0x168b
-sram_range = 0x300000,0x380001
+sram_range = 0x300000,0x37ffff
eeprom_type = 2
eeprom_lines = 9,8,7
[Micro Machines Military]
check_str = 0x150, " "
check_csum = 0xcee0
-sram_range = 0x300000,0x380001
+sram_range = 0x300000,0x37ffff
+eeprom_type = 2
+eeprom_lines = 9,8,7
+
+[Brian Lara Cricket]
+check_str = 0x150, "BRIAN LARA CRICKET"
+sram_range = 0x300000,0x3fffff
+eeprom_type = 2
+eeprom_lines = 9,8,7
+
+[Brian Lara Cricket 96]
+check_str = 0x150, "BRIAN LARA 96"
+sram_range = 0x300000,0x3fffff
eeprom_type = 2
eeprom_lines = 9,8,7
/*
* Support for a few cart mappers and some protection.
* (C) notaz, 2008-2011
- * (C) irixxxx, 2021-2022
+ * (C) irixxxx, 2021-2024
*
* This work is licensed under the terms of MAME license.
* See COPYING file in the top-level directory.
carthw_chunks = carthw_smw64_state;
}
+/* J-Cart */
+unsigned char carthw_jcart_th;
+
+static carthw_state_chunk carthw_jcart_state[] =
+{
+ { CHUNK_CARTHW, sizeof(carthw_jcart_th), &carthw_jcart_th },
+ { 0, 0, NULL }
+};
+
+static void carthw_jcart_write8(u32 a, u32 d)
+{
+ carthw_jcart_th = (d&1) << 6;
+}
+
+static void carthw_jcart_write16(u32 a, u32 d)
+{
+ carthw_jcart_write8(a+1, d);
+}
+
+static u32 carthw_jcart_read8(u32 a)
+{
+ u32 v = PicoReadPad(2 + (a&1), 0x3f | carthw_jcart_th);
+ // some carts additionally have an EEPROM; SDA is also readable in this range
+ if (Pico.m.sram_reg & SRR_MAPPED)
+ v |= EEPROM_read() & 0x80; // SDA is always on bit 7 for J-Carts
+ return v;
+}
+
+static u32 carthw_jcart_read16(u32 a)
+{
+ return carthw_jcart_read8(a) | (carthw_jcart_read8(a+1) << 8);
+}
+
+static void carthw_jcart_mem_setup(void)
+{
+ cpu68k_map_set(m68k_write8_map, 0x380000, 0x3fffff, carthw_jcart_write8, 1);
+ cpu68k_map_set(m68k_write16_map, 0x380000, 0x3fffff, carthw_jcart_write16, 1);
+ cpu68k_map_set(m68k_read8_map, 0x380000, 0x3fffff, carthw_jcart_read8, 1);
+ cpu68k_map_set(m68k_read16_map, 0x380000, 0x3fffff, carthw_jcart_read16, 1);
+}
+
+void carthw_jcart_startup(void)
+{
+ elprintf(EL_STATUS, "J-Cart startup");
+
+ PicoCartMemSetup = carthw_jcart_mem_setup;
+ carthw_chunks = carthw_jcart_state;
+}
+
// vim:ts=2:sw=2:expandtab
void carthw_lk3_startup(void);
void carthw_smw64_startup(void);
+
+void carthw_jcart_startup(void);
"check_str=0x150,\"DINO DINI'S SOCCER\"\n"
"prop=filled_sram\n"
"[]\n"
- "check_str=0x150,\"MICRO MACHINES II\"\n"
- "prop=filled_sram\n"
- "[]\n"
"check_str=0x150,\" HardBall III\"\n"
"sram_range=0x200000,0x20ffff\n"
"[]\n"
+ "check_str=0x150,\" \"\n"
+ "check_csum=0x168b\n"
+ "hw=j_cart\n"
+ "[]\n"
+ "check_str=0x150,\" \"\n"
+ "check_csum=0x165e\n"
+ "hw=j_cart\n"
+ "[]\n"
+ "check_str=0x150,\"MICRO MACHINES II\"\n"
+ "hw=j_cart\n"
+ "[]\n"
+ "check_str=0x150,\"PETE SAMPRAS TENNIS '96\"\n"
+ "hw=j_cart\n"
+ "[]\n"
"check_str=0x100,\"SEGA SSF\"\n"
"hw=ssf2_mapper\n"
"[]\n"
"eeprom_lines=1,0,0\n"
"[]\n"
"check_str=0x150,\"MICRO MACHINES II\"\n"
- "sram_range=0x300000,0x380001\n"
+ "prop=filled_sram\n"
+ "sram_range=0x300000,0x37ffff\n"
"eeprom_type=2\n"
"eeprom_lines=9,8,7\n"
"[]\n"
"check_str=0x150,\" \"\n"
"check_csum=0x165e\n"
- "sram_range=0x300000,0x380001\n"
+ "sram_range=0x300000,0x37ffff\n"
"eeprom_type=2\n"
"eeprom_lines=9,8,7\n"
"[]\n"
"check_str=0x150,\" \"\n"
"check_csum=0x2c41\n"
- "sram_range=0x300000,0x380001\n"
+ "sram_range=0x300000,0x37ffff\n"
"eeprom_type=2\n"
"eeprom_lines=9,8,7\n"
"[]\n"
"check_str=0x150,\" \"\n"
"check_csum=0x168b\n"
- "sram_range=0x300000,0x380001\n"
+ "sram_range=0x300000,0x37ffff\n"
"eeprom_type=2\n"
"eeprom_lines=9,8,7\n"
"[]\n"
"check_str=0x150,\" \"\n"
"check_csum=0xcee0\n"
- "sram_range=0x300000,0x380001\n"
+ "sram_range=0x300000,0x37ffff\n"
+ "eeprom_type=2\n"
+ "eeprom_lines=9,8,7\n"
+ "[]\n"
+ "check_str=0x150,\"BRIAN LARA CRICKET\"\n"
+ "sram_range=0x300000,0x3fffff\n"
+ "eeprom_type=2\n"
+ "eeprom_lines=9,8,7\n"
+ "[]\n"
+ "check_str=0x150,\"BRIAN LARA 96\"\n"
+ "sram_range=0x300000,0x3fffff\n"
"eeprom_type=2\n"
"eeprom_lines=9,8,7\n"
"[]\n"
return (in & ~ctrl_reg) | (data_reg & ctrl_reg);\r
}\r
\r
+// pad export for J-Cart\r
+u32 PicoReadPad(int i, u32 out_bits)\r
+{\r
+ return read_pad_3btn(i, out_bits);\r
+}\r
+\r
void PicoSetInputDevice(int port, enum input_device device)\r
{\r
port_read_func *func;\r
u32 PicoRead16_io(u32 a);\r
void PicoWrite8_io(u32 a, u32 d);\r
void PicoWrite16_io(u32 a, u32 d);\r
+u32 PicoReadPad(int i, u32 mask);\r
\r
// pico/memory.c\r
PICO_INTERNAL void PicoMemSetupPico(void);\r
const char *indev1_names[] = { "none", "3 button pad", "6 button pad", NULL };
static char h_play34[] = "Works only for Mega Drive/CD/32X games having\n"
- "support for Team player or 4 way play";
+ "support for Team player, 4 way play, or J-cart";
static menu_entry e_menu_keyconfig[] =
{
-Subproject commit fbbf5e3fc0aff858e206dd98ce4605b960d397cb
+Subproject commit 86a086ed64aadc1e87fc58a90703a07d91c9cdbe