Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
98535ae
bus/megadrive/cart: initial pass at a new cart slot interface
angelosa Sep 21, 2025
9c36260
chore: cherry-pick 226a5d3068d7881ee8d33bf05ca61a71471a5d06
ArcadeShadow Sep 18, 2025
b453e1c
New working software list items
angelosa Sep 21, 2025
3300ac1
hash/megadriv: sskid is a J-Cart
angelosa Sep 21, 2025
554f68f
bus/megadrive/cart: hookup EEPROM and J-Cart options
angelosa Sep 21, 2025
d44e48e
machine/i2cmem: add 24C65 alias for bighurt/brianl96/collslam/shanewa…
angelosa Sep 22, 2025
6fa113c
bus/megadrive/cart: add tc2000, tekkensp, topf, pokestad mappers
angelosa Sep 23, 2025
58b5fae
bus/megadrive: retire md_rom_topf_device
angelosa Sep 23, 2025
89a0bb0
bus/megadrive/cart: implement Chinese Fighter III, 1800-in-1, 3-in-1,…
angelosa Sep 25, 2025
f8ac77f
bus/megadrive/cart: implement Beggar Prince (rev 1) and Golden Mega 2…
angelosa Sep 26, 2025
6fe3c31
bus/megadrive/cart: implement remaining Super Fighter Team, Futbol Ar…
angelosa Sep 27, 2025
c7ac464
bus/megadrive/cart: add psolar mapper, fix SRAM in barkley2, hookup V…
angelosa Sep 28, 2025
5832b83
New working software list items
angelosa Oct 9, 2025
025fc5b
machine/intelfsh.cpp: add ST_M29W640FT, implement unlock bypass command
angelosa Oct 9, 2025
d7dbd08
bus/megadrive/cart: preliminary Everdrive-MD hookup
angelosa Oct 9, 2025
f791fb6
bus/megadrive/cart/everdrive.cpp: work-around SD card filesystem loading
angelosa Oct 9, 2025
543de49
video/ym7101: fix prohibited plane size modes
angelosa Oct 11, 2025
0538263
bus/megadrive/cart/everdrive: make SD card transfer speed more realistic
angelosa Oct 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
481 changes: 356 additions & 125 deletions hash/megadriv.xml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion hash/supracan.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Broken [video] during intro, uses bitmap mode with ROZ layer
<software name="staiwbbl" supported="no">
<description>Super Taiwanese Baseball League ~ Chao Ji Zhong Hua Zhi Bang Lian Meng</description>
<year>1995</year>
<publisher>C&amp;E Soft</publisher>
<publisher>C&amp;E</publisher>
<notes><![CDATA[
[video] ROZ is misaligned during intro, and initially concealed (blending?).
[sound] missing crowd noise during gameplay, tries to play an empty buffer in the $2xxx range. (fixed with internal sound BIOS dump for attract)
Expand Down
54 changes: 54 additions & 0 deletions scripts/src/bus.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3877,6 +3877,60 @@ if (BUSES["MEGADRIVE"]~=null) then
}
end

---------------------------------------------------
--
--@src/devices/bus/megadrive/cart/slot.h,BUSES["MEGADRIVE_CART"] = true
---------------------------------------------------

if (BUSES["MEGADRIVE_CART"]~=null) then
files {
MAME_DIR .. "src/devices/bus/megadrive/cart/action_replay.cpp",
MAME_DIR .. "src/devices/bus/megadrive/cart/action_replay.h",
MAME_DIR .. "src/devices/bus/megadrive/cart/avartisan.cpp",
MAME_DIR .. "src/devices/bus/megadrive/cart/avartisan.h",
MAME_DIR .. "src/devices/bus/megadrive/cart/eeprom.cpp",
MAME_DIR .. "src/devices/bus/megadrive/cart/eeprom.h",
MAME_DIR .. "src/devices/bus/megadrive/cart/everdrive.cpp",
MAME_DIR .. "src/devices/bus/megadrive/cart/everdrive.h",
MAME_DIR .. "src/devices/bus/megadrive/cart/gamtec.cpp",
MAME_DIR .. "src/devices/bus/megadrive/cart/gamtec.h",
MAME_DIR .. "src/devices/bus/megadrive/cart/jcart.cpp",
MAME_DIR .. "src/devices/bus/megadrive/cart/jcart.h",
MAME_DIR .. "src/devices/bus/megadrive/cart/options.cpp",
MAME_DIR .. "src/devices/bus/megadrive/cart/options.h",
MAME_DIR .. "src/devices/bus/megadrive/cart/mcpirate.cpp",
MAME_DIR .. "src/devices/bus/megadrive/cart/mcpirate.h",
MAME_DIR .. "src/devices/bus/megadrive/cart/miky.cpp",
MAME_DIR .. "src/devices/bus/megadrive/cart/miky.h",
MAME_DIR .. "src/devices/bus/megadrive/cart/multigame.cpp",
MAME_DIR .. "src/devices/bus/megadrive/cart/multigame.h",
MAME_DIR .. "src/devices/bus/megadrive/cart/rockworld.cpp",
MAME_DIR .. "src/devices/bus/megadrive/cart/rockworld.h",
MAME_DIR .. "src/devices/bus/megadrive/cart/rom.cpp",
MAME_DIR .. "src/devices/bus/megadrive/cart/rom.h",
MAME_DIR .. "src/devices/bus/megadrive/cart/seganet.cpp",
MAME_DIR .. "src/devices/bus/megadrive/cart/seganet.h",
MAME_DIR .. "src/devices/bus/megadrive/cart/sfteam.cpp",
MAME_DIR .. "src/devices/bus/megadrive/cart/sfteam.h",
MAME_DIR .. "src/devices/bus/megadrive/cart/smb.cpp",
MAME_DIR .. "src/devices/bus/megadrive/cart/smb.h",
MAME_DIR .. "src/devices/bus/megadrive/cart/smw64.cpp",
MAME_DIR .. "src/devices/bus/megadrive/cart/smw64.h",
MAME_DIR .. "src/devices/bus/megadrive/cart/slot.cpp",
MAME_DIR .. "src/devices/bus/megadrive/cart/slot.h",
MAME_DIR .. "src/devices/bus/megadrive/cart/sram.cpp",
MAME_DIR .. "src/devices/bus/megadrive/cart/sram.h",
MAME_DIR .. "src/devices/bus/megadrive/cart/ssf.cpp",
MAME_DIR .. "src/devices/bus/megadrive/cart/ssf.h",
MAME_DIR .. "src/devices/bus/megadrive/cart/t5740.cpp",
MAME_DIR .. "src/devices/bus/megadrive/cart/t5740.h",
MAME_DIR .. "src/devices/bus/megadrive/cart/tekkensp.cpp",
MAME_DIR .. "src/devices/bus/megadrive/cart/tekkensp.h",
MAME_DIR .. "src/devices/bus/megadrive/cart/xboy.cpp",
MAME_DIR .. "src/devices/bus/megadrive/cart/xboy.h",
}
end


---------------------------------------------------
--
Expand Down
12 changes: 12 additions & 0 deletions scripts/src/machine.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2140,6 +2140,18 @@ if (MACHINES["M950X0"]~=null) then
}
end

---------------------------------------------------
--
--@src/devices/machine/m95320.h,MACHINES["M95320"] = true
---------------------------------------------------

if (MACHINES["M95320"]~=null) then
files {
MAME_DIR .. "src/devices/machine/m95320.cpp",
MAME_DIR .. "src/devices/machine/m95320.h",
}
end

---------------------------------------------------
--
--@src/devices/machine/macseconds.h,MACHINES["MACSECONDS"] = true
Expand Down
66 changes: 66 additions & 0 deletions src/devices/bus/megadrive/cart/action_replay.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// license: BSD-3-Clause
// copyright-holders: Angelo Salese
/***********************************************************************************************

Datel Action Replay lock-on carts

TODO:
- Actual cheat interface (needs a dynamic overlay for user work RAM mods)

***********************************************************************************************/

#include "emu.h"
#include "action_replay.h"

#include "options.h"

DEFINE_DEVICE_TYPE(MEGADRIVE_ACTION_REPLAY, megadrive_action_replay_device, "megadrive_ar", "Megadrive Datel Action Replay cart")

megadrive_action_replay_device::megadrive_action_replay_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
: megadrive_rom_device(mconfig, type, tag, owner, clock)
, m_lockon_cart(*this, "cart")
, m_ar_view(*this, "ar_view")
{
}

megadrive_action_replay_device::megadrive_action_replay_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: megadrive_action_replay_device(mconfig, MEGADRIVE_ACTION_REPLAY, tag, owner, clock)
{
}

void megadrive_action_replay_device::device_add_mconfig(machine_config &config)
{
MEGADRIVE_CART_SLOT(config, m_lockon_cart, this->clock(), megadrive_cart_options, nullptr).set_must_be_loaded(false);
}

void megadrive_action_replay_device::device_start()
{
megadrive_rom_device::device_start();
}

void megadrive_action_replay_device::device_reset()
{
megadrive_rom_device::device_reset();
m_ar_view.select(0);
}

void megadrive_action_replay_device::unlock_cart_w(offs_t offset, u16 data, u16 mem_mask)
{
if (data == 0xffff)
{
m_ar_view.disable();
}
}

void megadrive_action_replay_device::cart_map(address_map &map)
{
map(0x00'0000, 0x7f'ffff).rw(m_lockon_cart, FUNC(megadrive_cart_slot_device::base_r), FUNC(megadrive_cart_slot_device::base_w));
map(0x00'0000, 0x01'ffff).view(m_ar_view);
m_ar_view[0](0x00'0000, 0x00'7fff).mirror(0x00'8000).bankr(m_rom);
m_ar_view[0](0x01'0006, 0x01'0007).w(FUNC(megadrive_action_replay_device::unlock_cart_w));
}

void megadrive_action_replay_device::time_io_map(address_map &map)
{
map(0x00, 0xff).rw(m_lockon_cart, FUNC(megadrive_cart_slot_device::time_r), FUNC(megadrive_cart_slot_device::time_w));
}
37 changes: 37 additions & 0 deletions src/devices/bus/megadrive/cart/action_replay.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// license: BSD-3-Clause
// copyright-holders: Angelo Salese

#ifndef MAME_BUS_MEGADRIVE_CART_ACTION_REPLAY_H
#define MAME_BUS_MEGADRIVE_CART_ACTION_REPLAY_H

#pragma once

#include "rom.h"
#include "slot.h"

class megadrive_action_replay_device : public megadrive_rom_device
{
public:
megadrive_action_replay_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);

virtual void cart_map(address_map &map) override ATTR_COLD;
virtual void time_io_map(address_map &map) override ATTR_COLD;

protected:
megadrive_action_replay_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);

virtual void device_add_mconfig(machine_config &config) override ATTR_COLD;

virtual void device_start() override ATTR_COLD;
virtual void device_reset() override ATTR_COLD;

required_device<megadrive_cart_slot_device> m_lockon_cart;
memory_view m_ar_view;

void unlock_cart_w(offs_t offset, u16 data, u16 mem_mask);
};

DECLARE_DEVICE_TYPE(MEGADRIVE_ACTION_REPLAY, megadrive_action_replay_device)


#endif // MAME_BUS_MEGADRIVE_CART_ACTION_REPLAY_H
74 changes: 74 additions & 0 deletions src/devices/bus/megadrive/cart/avartisan.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
// license: BSD-3-Clause
// copyright-holders: Angelo Salese
/**************************************************************************************************

AV Artisan/Realtec cart mappers

Goofy banking scheme. Maps every bank with $7e000 page at startup, remaps in $20000 chunks
depending on masked values between $404000 and $402000 then locks the mapper.

Practically only funnywld sets these to non-zero values, everything else just writes 0 to both
regs.

**************************************************************************************************/

#include "emu.h"
#include "avartisan.h"

#include "bus/generic/slot.h"

DEFINE_DEVICE_TYPE(MEGADRIVE_UNL_AVARTISAN, megadrive_unl_avartisan_device, "megadrive_unl_avartisan", "Megadrive AV Artisan cart")

megadrive_unl_avartisan_device::megadrive_unl_avartisan_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, MEGADRIVE_UNL_AVARTISAN, tag, owner, clock)
, device_megadrive_cart_interface( mconfig, *this )
, m_rom_bank(*this, "rom_bank_%u", 0U)
{
}

void megadrive_unl_avartisan_device::device_start()
{
memory_region *const romregion(cart_rom_region());
const u32 page_size = 0x00'2000;
device_generic_cart_interface::map_non_power_of_two(
unsigned(romregion->bytes() / page_size),
[this, base = &romregion->as_u8()] (unsigned entry, unsigned page)
{
for (int i = 0; i < 0x40; i++)
m_rom_bank[i]->configure_entry(entry, &base[page * page_size]);
});
}

void megadrive_unl_avartisan_device::device_reset()
{
// TODO: default
// GPGX uses /VRES to bypass TMSS with a read at $100, is it even possible?
for (int i = 0; i < 0x40; i++)
m_rom_bank[i]->set_entry(0x3f);
m_lock_config = false;
}

void megadrive_unl_avartisan_device::cart_map(address_map &map)
{
for (int i = 0; i < 0x40; i++)
map(0x00'0000 | (i * 0x2000), 0x00'1fff | (i * 0x2000)).mirror(0x380000).bankr(m_rom_bank[i]);
map(0x40'2000, 0x40'2000).lw8(NAME([this] (offs_t offset, u8 data) { m_bank_size = (data & 3) << 4; }));
map(0x40'4000, 0x40'4000).lw8(NAME([this] (offs_t offset, u8 data) { m_bank_sel = (data & 3) << 4; }));
map(0x40'0000, 0x40'0000).lw8(
NAME([this] (offs_t offset, u8 data) {
// 0 -> 1 transitions
if (!m_lock_config && BIT(data, 0))
{
logerror("size %02x sel %02x (%02x)\n", m_bank_size, m_bank_sel, ~m_bank_size);
u8 bank_base = m_bank_sel & m_bank_size;
for (int i = 0; i < 0x40; i++)
{
m_rom_bank[i]->set_entry(((i & ~m_bank_size) | bank_base) & 0x3f);
}

m_lock_config = !!BIT(data, 0);
}
})
);
}

33 changes: 33 additions & 0 deletions src/devices/bus/megadrive/cart/avartisan.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// license: BSD-3-Clause
// copyright-holders: Angelo Salese

#ifndef MAME_BUS_MEGADRIVE_CART_AVARTISAN_H
#define MAME_BUS_MEGADRIVE_CART_AVARTISAN_H

#pragma once

#include "rom.h"
#include "slot.h"

class megadrive_unl_avartisan_device : public device_t,
public device_megadrive_cart_interface
{
public:
megadrive_unl_avartisan_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);

virtual void cart_map(address_map &map) override ATTR_COLD;

protected:
virtual void device_start() override ATTR_COLD;
virtual void device_reset() override ATTR_COLD;

memory_bank_array_creator<0x40> m_rom_bank;
u8 m_bank_size;
u8 m_bank_sel;
bool m_lock_config;
};

DECLARE_DEVICE_TYPE(MEGADRIVE_UNL_AVARTISAN, megadrive_unl_avartisan_device)


#endif // MAME_BUS_MEGADRIVE_CART_AVARTISAN_H
Loading
Loading