summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices')
-rw-r--r--src/devices/bus/psx/gamebooster.cpp158
-rw-r--r--src/devices/bus/psx/gamebooster.h49
-rw-r--r--src/devices/bus/psx/parallel.cpp114
-rw-r--r--src/devices/bus/psx/parallel.h74
4 files changed, 395 insertions, 0 deletions
diff --git a/src/devices/bus/psx/gamebooster.cpp b/src/devices/bus/psx/gamebooster.cpp
new file mode 100644
index 00000000000..0a04ec215a5
--- /dev/null
+++ b/src/devices/bus/psx/gamebooster.cpp
@@ -0,0 +1,158 @@
+// license:BSD-3-Clause
+// copyright-holders:David Haywood
+/**********************************************************************
+
+ Datel Game Booster for Playstation 1
+
+ Gameboy emulator with Gameboy cartridge slot
+
+**********************************************************************/
+
+#include "emu.h"
+#include "gamebooster.h"
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(PSX_GAMEBOOSTER, psx_gamebooster_device, "psxgboost", "Datel Game Booster for Playstation")
+
+//-------------------------------------------------
+// ROM( psxgboost )
+//-------------------------------------------------
+
+ROM_START( psxgboost )
+ ROM_REGION(0x40000, "rom", 0)
+ ROM_LOAD("Game Booster.rom", 0x0000, 0x40000, CRC(c8e459b8) SHA1(c20ab073f61242f37665f12199b95cfa3a83e9fc) )
+ROM_END
+
+//-------------------------------------------------
+// rom_region - device-specific ROM region
+//-------------------------------------------------
+
+const tiny_rom_entry *psx_gamebooster_device::device_rom_region() const
+{
+ return ROM_NAME( psxgboost );
+}
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// psx_gamebooster_device - constructor
+//-------------------------------------------------
+
+psx_gamebooster_device::psx_gamebooster_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, PSX_GAMEBOOSTER, tag, owner, clock)
+ , psx_parallel_interface(mconfig, *this)
+ , m_rom(*this, "rom")
+ , m_cartslot(*this, "gbslot")
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void psx_gamebooster_device::device_start()
+{
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void psx_gamebooster_device::device_reset()
+{
+}
+
+//**************************************************************************
+// IMPLEMENTATION
+//**************************************************************************
+
+READ16_MEMBER(psx_gamebooster_device::exp_r)
+{
+ if (offset < 0x20000)
+ {
+ return m_rom->base()[(offset * 2) & 0x3ffff] | (m_rom->base()[((offset * 2) + 1) & 0x3ffff] << 8);
+ }
+ else if (offset < 0x24000)
+ {
+ offset -= 0x20000;
+ uint16_t retval = 0;;
+
+ if (mem_mask & 0xff00) retval |= (m_cartslot->read_rom(space, (offset*2)+1))<<8;
+ if (mem_mask & 0x00ff) retval |= m_cartslot->read_rom(space, (offset*2)+0);
+
+ return retval;
+ }
+ else
+ {
+ logerror("%s: psx_gamebooster_device::exp_r %04x\n", machine().describe_context(), offset*2);
+ }
+
+ return 0x0000;
+}
+
+WRITE16_MEMBER(psx_gamebooster_device::exp_w)
+{
+
+ if (offset < 0x20000)
+ {
+ logerror("%s: psx_gamebooster_device::exp_w %04x %04x\n", machine().describe_context(), offset*2, data);
+ }
+ else if (offset < 0x24000)
+ {
+ offset -= 0x20000;
+ logerror("%s: psx_gamebooster_device::exp_w %04x %04x\n", machine().describe_context(), offset*2, data);
+
+ if (mem_mask & 0xff00) m_cartslot->write_bank(space, (offset*2)+1, data>>8);
+ if (mem_mask & 0x00ff) m_cartslot->write_bank(space, (offset*2)+0, data); // send this 2nd or it erases the bank with the above
+
+ }
+ else
+ {
+ logerror("%s: psx_gamebooster_device::exp_w %04x %04x\n", machine().describe_context(), offset*2, data);
+ }
+}
+
+static SLOT_INTERFACE_START(gb_cart)
+ SLOT_INTERFACE_INTERNAL("rom", GB_STD_ROM)
+ SLOT_INTERFACE_INTERNAL("rom_mbc1", GB_ROM_MBC1)
+ SLOT_INTERFACE_INTERNAL("rom_mbc1col", GB_ROM_MBC1)
+ SLOT_INTERFACE_INTERNAL("rom_mbc2", GB_ROM_MBC2)
+ SLOT_INTERFACE_INTERNAL("rom_mbc3", GB_ROM_MBC3)
+ SLOT_INTERFACE_INTERNAL("rom_huc1", GB_ROM_MBC3)
+ SLOT_INTERFACE_INTERNAL("rom_huc3", GB_ROM_MBC3)
+ SLOT_INTERFACE_INTERNAL("rom_mbc5", GB_ROM_MBC5)
+ SLOT_INTERFACE_INTERNAL("rom_mbc6", GB_ROM_MBC6)
+ SLOT_INTERFACE_INTERNAL("rom_mbc7", GB_ROM_MBC7)
+ SLOT_INTERFACE_INTERNAL("rom_tama5", GB_ROM_TAMA5)
+ SLOT_INTERFACE_INTERNAL("rom_mmm01", GB_ROM_MMM01)
+ SLOT_INTERFACE_INTERNAL("rom_m161", GB_ROM_M161)
+ SLOT_INTERFACE_INTERNAL("rom_sachen1", GB_ROM_SACHEN1)
+ SLOT_INTERFACE_INTERNAL("rom_sachen2", GB_ROM_SACHEN2)
+ SLOT_INTERFACE_INTERNAL("rom_wisdom", GB_ROM_WISDOM)
+ SLOT_INTERFACE_INTERNAL("rom_yong", GB_ROM_YONG)
+ SLOT_INTERFACE_INTERNAL("rom_lasama", GB_ROM_LASAMA)
+ SLOT_INTERFACE_INTERNAL("rom_atvrac", GB_ROM_ATVRAC)
+ SLOT_INTERFACE_INTERNAL("rom_camera", GB_STD_ROM)
+ SLOT_INTERFACE_INTERNAL("rom_188in1", GB_ROM_188IN1)
+ SLOT_INTERFACE_INTERNAL("rom_sintax", GB_ROM_SINTAX)
+ SLOT_INTERFACE_INTERNAL("rom_chong", GB_ROM_CHONGWU)
+ SLOT_INTERFACE_INTERNAL("rom_licheng", GB_ROM_LICHENG)
+ SLOT_INTERFACE_INTERNAL("rom_digimon", GB_ROM_DIGIMON)
+ SLOT_INTERFACE_INTERNAL("rom_rock8", GB_ROM_ROCKMAN8)
+ SLOT_INTERFACE_INTERNAL("rom_sm3sp", GB_ROM_SM3SP)
+// SLOT_INTERFACE_INTERNAL("rom_dkong5", GB_ROM_DKONG5)
+// SLOT_INTERFACE_INTERNAL("rom_unk01", GB_ROM_UNK01)
+SLOT_INTERFACE_END
+
+MACHINE_CONFIG_START(psx_gamebooster_device::device_add_mconfig)
+ /* cartslot */
+ MCFG_GB_CARTRIDGE_ADD("gbslot", gb_cart, nullptr)
+
+ MCFG_SOFTWARE_LIST_ADD("cart_list","gameboy")
+ MCFG_SOFTWARE_LIST_COMPATIBLE_ADD("gbc_list","gbcolor")
+MACHINE_CONFIG_END
diff --git a/src/devices/bus/psx/gamebooster.h b/src/devices/bus/psx/gamebooster.h
new file mode 100644
index 00000000000..a6c06844d7e
--- /dev/null
+++ b/src/devices/bus/psx/gamebooster.h
@@ -0,0 +1,49 @@
+// license:BSD-3-Clause
+// copyright-holders:David Haywood
+
+#ifndef MAME_BUS_PSX_GAMEBOOSTER_H
+#define MAME_BUS_PSX_GAMEBOOSTER_H
+
+#pragma once
+
+
+#include "parallel.h"
+#include "bus/gameboy/rom.h"
+#include "bus/gameboy/mbc.h"
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> psx_gamebooster_device
+
+class psx_gamebooster_device :
+ public device_t,
+ public psx_parallel_interface
+{
+public:
+ // construction/destruction
+ psx_gamebooster_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+ virtual void device_reset() override;
+
+ // optional information overrides
+ virtual const tiny_rom_entry *device_rom_region() const override;
+ virtual void device_add_mconfig(machine_config &config) override;
+
+ virtual DECLARE_READ16_MEMBER(exp_r) override;
+ virtual DECLARE_WRITE16_MEMBER(exp_w) override;
+
+private:
+ required_memory_region m_rom;
+ required_device<gb_cart_slot_device> m_cartslot;
+};
+
+
+// device type definition
+DECLARE_DEVICE_TYPE(PSX_GAMEBOOSTER, psx_gamebooster_device)
+
+#endif // MAME_BUS_PSX_GAMEBOOSTER_H
diff --git a/src/devices/bus/psx/parallel.cpp b/src/devices/bus/psx/parallel.cpp
new file mode 100644
index 00000000000..4fa5b29da66
--- /dev/null
+++ b/src/devices/bus/psx/parallel.cpp
@@ -0,0 +1,114 @@
+// license:BSD-3-Clause
+// copyright-holders:David Haywood
+/**********************************************************************
+
+ Sony Playstation 'Parallel' slot
+
+**********************************************************************/
+
+#include "emu.h"
+#include "parallel.h"
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(PSX_PARALLEL_SLOT, psx_parallel_slot_device, "psx_parallel_slot", "Playstation Parallel Slot")
+
+
+//**************************************************************************
+// DEVICE SPECTRUM_EXPANSION CARD INTERFACE
+//**************************************************************************
+
+//-------------------------------------------------
+// psx_parallel_interface - constructor
+//-------------------------------------------------
+
+psx_parallel_interface::psx_parallel_interface(const machine_config &mconfig, device_t &device)
+ : device_slot_card_interface(mconfig, device)
+{
+}
+
+
+//-------------------------------------------------
+// ~psx_parallel_interface - destructor
+//-------------------------------------------------
+
+psx_parallel_interface::~psx_parallel_interface()
+{
+}
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// psx_parallel_slot_device - constructor
+//-------------------------------------------------
+
+psx_parallel_slot_device::psx_parallel_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
+ device_t(mconfig, PSX_PARALLEL_SLOT, tag, owner, clock),
+ device_slot_interface(mconfig, *this),
+ m_card(nullptr)
+{
+}
+
+//-------------------------------------------------
+// expansion_slot_device - destructor
+//-------------------------------------------------
+
+psx_parallel_slot_device::~psx_parallel_slot_device()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void psx_parallel_slot_device::device_start()
+{
+ m_card = dynamic_cast<psx_parallel_interface *>(get_card_device());
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void psx_parallel_slot_device::device_reset()
+{
+}
+
+//-------------------------------------------------
+// exp_r
+//-------------------------------------------------
+
+READ16_MEMBER(psx_parallel_slot_device::exp_r)
+{
+ if (m_card)
+ return m_card->exp_r(space, offset);
+ else
+ return 0xff;
+}
+
+//-------------------------------------------------
+// exp_w
+//-------------------------------------------------
+
+WRITE16_MEMBER(psx_parallel_slot_device::exp_w)
+{
+ if (m_card)
+ m_card->exp_w(space, offset, data);
+}
+
+//-------------------------------------------------
+// SLOT_INTERFACE( spectrum_expansion_devices )
+//-------------------------------------------------
+
+
+// slot devices
+#include "gamebooster.h"
+
+SLOT_INTERFACE_START( psx_parallel_devices )
+ SLOT_INTERFACE("gamebooster", PSX_GAMEBOOSTER)
+SLOT_INTERFACE_END
+
diff --git a/src/devices/bus/psx/parallel.h b/src/devices/bus/psx/parallel.h
new file mode 100644
index 00000000000..4ef05c52233
--- /dev/null
+++ b/src/devices/bus/psx/parallel.h
@@ -0,0 +1,74 @@
+// license:BSD-3-Clause
+// copyright-holders:David Haywood
+
+#ifndef MAME_BUS_PSX_PARALLEL_H
+#define MAME_BUS_PSX_PARALLEL_H
+
+#pragma once
+
+//**************************************************************************
+// INTERFACE CONFIGURATION MACROS
+//**************************************************************************
+
+#define MCFG_PSX_PARALLEL_SLOT_ADD(_tag, _slot_intf, _def_slot) \
+ MCFG_DEVICE_ADD(_tag, PSX_PARALLEL_SLOT, 0) \
+ MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> psx_parallel_slot_device
+
+class psx_parallel_interface;
+
+class psx_parallel_slot_device : public device_t, public device_slot_interface
+{
+public:
+ // construction/destruction
+ psx_parallel_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ virtual ~psx_parallel_slot_device();
+
+ DECLARE_READ16_MEMBER(exp_r);
+ DECLARE_WRITE16_MEMBER(exp_w);
+
+ const bool hascard() const
+ {
+ return bool(m_card);
+ };
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+ virtual void device_reset() override;
+
+ psx_parallel_interface *m_card;
+
+private:
+};
+
+
+// ======================> psx_parallel_interface
+
+class psx_parallel_interface : public device_slot_card_interface
+{
+public:
+ // construction/destruction
+ virtual ~psx_parallel_interface();
+
+ // reading and writing
+ virtual DECLARE_READ16_MEMBER(exp_r) { return 0xff; }
+ virtual DECLARE_WRITE16_MEMBER(exp_w) { }
+
+protected:
+ psx_parallel_interface(const machine_config &mconfig, device_t &device);
+};
+
+
+// device type definition
+DECLARE_DEVICE_TYPE(PSX_PARALLEL_SLOT, psx_parallel_slot_device)
+
+SLOT_INTERFACE_EXTERN( psx_parallel_devices );
+
+
+#endif // MAME_BUS_PSX_PARALLEL_H