From 3b9fa5f3c69ea498be27bc74d3c9fc25f9b6bde6 Mon Sep 17 00:00:00 2001 From: wilbertpol Date: Fri, 2 Dec 2022 15:46:39 +0000 Subject: [PATCH] bus/msx: Added support for Hudson Soft Bee Card and Electric Software Astron Softcard media. (#10610) * Copied or moved Bee Cards entries from msx1_cart.xml to msx1_bee_card.xml. * Copied or moved SoftCard entries from msx1_cart.xml to msx_softcard.xml. --- hash/msx1_bee_card.xml | 153 ++++++++++++++++++++++ hash/msx1_cart.xml | 112 +--------------- hash/msx_softcard.xml | 67 ++++++++++ scripts/src/bus.lua | 8 ++ src/devices/bus/msx/beecard/beecard.cpp | 55 ++++++++ src/devices/bus/msx/beecard/beecard.h | 12 ++ src/devices/bus/msx/cart/beepack.cpp | 100 ++++++++++++++ src/devices/bus/msx/cart/beepack.h | 58 ++++++++ src/devices/bus/msx/cart/cartridge.cpp | 4 + src/devices/bus/msx/cart/softcard.cpp | 99 ++++++++++++++ src/devices/bus/msx/cart/softcard.h | 58 ++++++++ src/devices/bus/msx/slot/cartridge.cpp | 4 +- src/devices/bus/msx/softcard/softcard.cpp | 54 ++++++++ src/devices/bus/msx/softcard/softcard.h | 12 ++ 14 files changed, 683 insertions(+), 113 deletions(-) create mode 100644 hash/msx1_bee_card.xml create mode 100644 hash/msx_softcard.xml create mode 100644 src/devices/bus/msx/beecard/beecard.cpp create mode 100644 src/devices/bus/msx/beecard/beecard.h create mode 100644 src/devices/bus/msx/cart/beepack.cpp create mode 100644 src/devices/bus/msx/cart/beepack.h create mode 100644 src/devices/bus/msx/cart/softcard.cpp create mode 100644 src/devices/bus/msx/cart/softcard.h create mode 100644 src/devices/bus/msx/softcard/softcard.cpp create mode 100644 src/devices/bus/msx/softcard/softcard.h diff --git a/hash/msx1_bee_card.xml b/hash/msx1_bee_card.xml new file mode 100644 index 00000000000..300061e3099 --- /dev/null +++ b/hash/msx1_bee_card.xml @@ -0,0 +1,153 @@ + + + + + + + + + Bomber Man Special (Japan) + 1986 + Hudson Soft + + + + + + + + + + + Jet Set Willy + 1985 + Hudson Soft + + + + + + + + + + + Pooyan (Japan) + 1985 + Hudson Soft + + + + + + + + + + + Star Force (Japan) + 1985 + Hudson Soft + + + + + + + + + + + Star Force (Japan, alt) + 1985 + Hudson Soft + + + + + + + + + + + Star Soldier (Japan) + 1986 + Hudson Soft + + + + + + + + + + + Star Soldier (Japan, alt) + 1986 + Hudson Soft + + + + + + + + + + + Takahashi Meijin no Boukenjima (Japan) + 1986 + Hudson Soft + + + + + + + + + + + Takahashi Meijin no Boukenjima (Japan, alt) + 1986 + Hudson Soft + + + + + + + + + + + Yakyuu Kyou (Japan) + 1985 + Hudson Soft + + + + + + + + + + diff --git a/hash/msx1_cart.xml b/hash/msx1_cart.xml index 8dfc2deff6e..0eef52d56e7 100644 --- a/hash/msx1_cart.xml +++ b/hash/msx1_cart.xml @@ -1932,18 +1932,6 @@ kept for now until finding out what those bytes affect... - - - Backgammon (Euro) - 1984 - Electric Software - - - - - - - Back Gammon (Jpn) 1984 @@ -2497,20 +2485,6 @@ kept for now until finding out what those bytes affect... - - - Bomber Man Special (Jpn) - 1986 - Hudson Soft - - - - - - - - - Boogie Woogi Jungle (Jpn) 1983 @@ -7587,19 +7561,6 @@ kept for now until finding out what those bytes affect... - - - Le Mans 2 (Euro) - 1984 - Electric Software - - - - - - - - Legendly Knight - Daemaseong (Kor) @@ -9834,20 +9795,6 @@ kept for now until finding out what those bytes affect... - - - Pooyan (Jpn) - 1985 - Hudson Soft - - - - - - - - - Poppaq the Fish (Jpn) 1984 @@ -11074,60 +11021,6 @@ kept for now until finding out what those bytes affect... - - Star Force (Jpn) - 1985 - Hudson Soft - - - - - - - - - - - Star Force (Jpn, Alt) - 1985 - Hudson Soft - - - - - - - - - - - - Star Soldier (Jpn) - 1986 - Hudson Soft - - - - - - - - - - - - Star Soldier (Jpn, Alt) - 1986 - Hudson Soft - - - - - - - - - Star Trap (Jpn) 1987 @@ -12507,12 +12400,11 @@ kept for now until finding out what those bytes affect... - The Wreck (Euro) 1984 Electric Software - + @@ -12580,7 +12472,7 @@ kept for now until finding out what those bytes affect... - + Yakyu Kyo (Jpn) 1985 diff --git a/hash/msx_softcard.xml b/hash/msx_softcard.xml new file mode 100644 index 00000000000..5568c3a7980 --- /dev/null +++ b/hash/msx_softcard.xml @@ -0,0 +1,67 @@ + + + + + + + + + Backgammon (UK) + 1984 + Electric Software + + + + + + + + + + Le Mans 2 (UK) + 1984 + Electric Software + + + + + + + + + + The Wreck (UK) + 1984 + Electric Software + + + + + + + + + diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua index 5aef3a467b2..bd98fa8d8d3 100644 --- a/scripts/src/bus.lua +++ b/scripts/src/bus.lua @@ -1855,10 +1855,14 @@ if (BUSES["MSX_SLOT"]~=null) then MAME_DIR .. "src/devices/bus/msx/slot/slot.h", MAME_DIR .. "src/devices/bus/msx/slot/sony08.cpp", MAME_DIR .. "src/devices/bus/msx/slot/sony08.h", + MAME_DIR .. "src/devices/bus/msx/beecard/beecard.cpp", + MAME_DIR .. "src/devices/bus/msx/beecard/beecard.h", MAME_DIR .. "src/devices/bus/msx/cart/arc.cpp", MAME_DIR .. "src/devices/bus/msx/cart/arc.h", MAME_DIR .. "src/devices/bus/msx/cart/ascii.cpp", MAME_DIR .. "src/devices/bus/msx/cart/ascii.h", + MAME_DIR .. "src/devices/bus/msx/cart/beepack.cpp", + MAME_DIR .. "src/devices/bus/msx/cart/beepack.h", MAME_DIR .. "src/devices/bus/msx/cart/bm_012.cpp", MAME_DIR .. "src/devices/bus/msx/cart/bm_012.h", MAME_DIR .. "src/devices/bus/msx/cart/cartridge.cpp", @@ -1903,12 +1907,16 @@ if (BUSES["MSX_SLOT"]~=null) then MAME_DIR .. "src/devices/bus/msx/cart/nomapper.h", MAME_DIR .. "src/devices/bus/msx/cart/rtype.cpp", MAME_DIR .. "src/devices/bus/msx/cart/rtype.h", + MAME_DIR .. "src/devices/bus/msx/cart/softcard.cpp", + MAME_DIR .. "src/devices/bus/msx/cart/softcard.h", MAME_DIR .. "src/devices/bus/msx/cart/superloderunner.cpp", MAME_DIR .. "src/devices/bus/msx/cart/superloderunner.h", MAME_DIR .. "src/devices/bus/msx/cart/super_swangi.cpp", MAME_DIR .. "src/devices/bus/msx/cart/super_swangi.h", MAME_DIR .. "src/devices/bus/msx/cart/yamaha.cpp", MAME_DIR .. "src/devices/bus/msx/cart/yamaha.h", + MAME_DIR .. "src/devices/bus/msx/softcard/softcard.cpp", + MAME_DIR .. "src/devices/bus/msx/softcard/softcard.h", } end diff --git a/src/devices/bus/msx/beecard/beecard.cpp b/src/devices/bus/msx/beecard/beecard.cpp new file mode 100644 index 00000000000..5885a892445 --- /dev/null +++ b/src/devices/bus/msx/beecard/beecard.cpp @@ -0,0 +1,55 @@ +// license:BSD-3-Clause +// copyright-holders:Wilbert Pol + +#include "emu.h" +#include "beecard.h" +#include "bus/msx/cart/beepack.h" + + +DECLARE_DEVICE_TYPE(BEE_CARD_NOMAPPER, bee_card_interface) + + +void bee_card(device_slot_interface &device) +{ + device.option_add_internal("nomapper", BEE_CARD_NOMAPPER); +} + + +namespace { + +class bee_card_nomapper_device : public device_t + , public bee_card_interface +{ +public: + bee_card_nomapper_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + +protected: + // device-level overrides + virtual void device_start() override { } + + virtual void initialize_cartridge() override; + +}; + + +bee_card_nomapper_device::bee_card_nomapper_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, BEE_CARD_NOMAPPER, tag, owner, clock) + , bee_card_interface(mconfig, *this) +{ +} + +void bee_card_nomapper_device::initialize_cartridge() +{ + if (!cart_rom_region()) + { + fatalerror("bee_card_nomapper: ROM region not setup\n"); + } + + page(1)->install_rom(0x4000, 0x7fff, cart_rom_region()->base()); + if (cart_rom_region()->bytes() == 0x8000) + page(2)->install_rom(0x8000, 0xbfff, cart_rom_region()->base() + 0x4000); +} + +} // anonymous namespace + +DEFINE_DEVICE_TYPE_PRIVATE(BEE_CARD_NOMAPPER, bee_card_interface, bee_card_nomapper_device, "bee_card_nomapper", "Bee Card ROM") diff --git a/src/devices/bus/msx/beecard/beecard.h b/src/devices/bus/msx/beecard/beecard.h new file mode 100644 index 00000000000..63bf77533aa --- /dev/null +++ b/src/devices/bus/msx/beecard/beecard.h @@ -0,0 +1,12 @@ +// license:BSD-3-Clause +// copyright-holders:Wilbert Pol +#ifndef MAME_BUS_MSX_BEECARD_BEECARD_H +#define MAME_BUS_MSX_BEECARD_BEECARD_H + +#pragma once + + +void bee_card(device_slot_interface &device); + + +#endif // MAME_BUS_MSX_BEECARD_BEECARD_H diff --git a/src/devices/bus/msx/cart/beepack.cpp b/src/devices/bus/msx/cart/beepack.cpp new file mode 100644 index 00000000000..6567dc96a03 --- /dev/null +++ b/src/devices/bus/msx/cart/beepack.cpp @@ -0,0 +1,100 @@ +// license:BSD-3-Clause +// copyright-holders:Wilbert Pol +/*********************************************************************************** + +Emulation for the Hudson Soft BP-0001 Bee Pack card reader cartridge. + +This cartridge allows Bee Cards (a predecessor of HuCards) to be used on an MSX system. + +***********************************************************************************/ + +#include "emu.h" +#include "beepack.h" +#include "bus/msx/beecard/beecard.h" +#include "softlist_dev.h" + + +DEFINE_DEVICE_TYPE(MSX_CART_BEEPACK, msx_cart_beepack_device, "msx_cart_beepack", "Hudson Soft BP-0001 Bee Pack card reader") + + +msx_cart_beepack_device::msx_cart_beepack_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, MSX_CART_BEEPACK, tag, owner, clock) + , device_cartrom_image_interface(mconfig, *this) + , device_single_card_slot_interface(mconfig, *this) + , msx_cart_interface(mconfig, *this) +{ +} + +void msx_cart_beepack_device::device_resolve_objects() +{ + m_beecard = get_card_device(); + if (m_beecard) + { + m_beecard->set_views(page(0), page(1), page(2), page(3)); + } +} + +void msx_cart_beepack_device::device_add_mconfig(machine_config &config) +{ + bee_card(*this); + SOFTWARE_LIST(config, "bee_card_list").set_original("msx1_bee_card"); +} + +image_init_result msx_cart_beepack_device::call_load() +{ + if (m_beecard) + { + if (loaded_through_softlist()) + { + u32 length = get_software_region_length("rom"); + // Only 16KB or 32KB images are supported + if (length != 0x4000 && length != 0x8000) + { + seterror(image_error::UNSPECIFIED, "Invalid file size for a bee card"); + return image_init_result::FAIL; + } + } + else + { + u32 length = this->length(); + // Only 16KB or 32KB images are supported + if (length != 0x4000 && length != 0x8000) + { + seterror(image_error::UNSPECIFIED, "Invalid file size for a bee card"); + return image_init_result::FAIL; + } + + memory_region *const romregion = machine().memory().region_alloc(subtag("rom"), length, 1, ENDIANNESS_LITTLE); + if (fread(romregion->base(), length) != length) + { + seterror(image_error::UNSPECIFIED, "Unable to fully read file"); + return image_init_result::FAIL; + } + } + + m_beecard->initialize_cartridge(); + } + return image_init_result::PASS; +} + +std::string msx_cart_beepack_device::get_default_card_software(get_default_card_software_hook &hook) const +{ + return software_get_default_slot("nomapper"); +} + + + +bee_card_interface::bee_card_interface(const machine_config &mconfig, device_t &device) + : device_interface(device, "beecard") + , m_page{nullptr, nullptr, nullptr, nullptr} + , m_slot(dynamic_cast(device.owner())) +{ +} + +void bee_card_interface::set_views(memory_view::memory_view_entry *page0, memory_view::memory_view_entry *page1, memory_view::memory_view_entry *page2, memory_view::memory_view_entry *page3) +{ + m_page[0] = page0; + m_page[1] = page1; + m_page[2] = page2; + m_page[3] = page3; +} diff --git a/src/devices/bus/msx/cart/beepack.h b/src/devices/bus/msx/cart/beepack.h new file mode 100644 index 00000000000..9926f831124 --- /dev/null +++ b/src/devices/bus/msx/cart/beepack.h @@ -0,0 +1,58 @@ +// license:BSD-3-Clause +// copyright-holders:Wilbert Pol +#ifndef MAME_BUS_MSX_CART_BEEPACK_H +#define MAME_BUS_MSX_CART_BEEPACK_H + +#pragma once + +#include "cartridge.h" +#include "imagedev/cartrom.h" + + +DECLARE_DEVICE_TYPE(MSX_CART_BEEPACK, msx_cart_beepack_device) + +class bee_card_interface; + + +class msx_cart_beepack_device : public device_t + , public device_cartrom_image_interface + , public device_single_card_slot_interface + , public msx_cart_interface +{ +public: + msx_cart_beepack_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + + // image-level overrides + virtual image_init_result call_load() override; + virtual bool is_reset_on_load() const noexcept override { return true; } + virtual const char *image_interface() const noexcept override { return "bee_card"; } + virtual const char *file_extensions() const noexcept override { return "bin,rom"; } + +protected: + virtual void device_resolve_objects() override; + virtual void device_start() override { } + virtual void device_add_mconfig(machine_config &config) override; + virtual std::string get_default_card_software(get_default_card_software_hook &hook) const override; + + bee_card_interface *m_beecard; +}; + + +class bee_card_interface : public device_interface +{ +public: + virtual void initialize_cartridge() { } + void set_views(memory_view::memory_view_entry *page0, memory_view::memory_view_entry *page1, memory_view::memory_view_entry *page2, memory_view::memory_view_entry *page3); + +protected: + bee_card_interface(const machine_config &mconfig, device_t &device); + memory_region *cart_rom_region() { return m_slot ? m_slot->memregion("rom") : nullptr; } + memory_view::memory_view_entry *page(int i) { return m_page[i]; } + +private: + memory_view::memory_view_entry *m_page[4]; + msx_cart_beepack_device *const m_slot; +}; + + +#endif // MAME_BUS_MSX_CART_BEEPACK_H diff --git a/src/devices/bus/msx/cart/cartridge.cpp b/src/devices/bus/msx/cart/cartridge.cpp index 71910f71ac5..115a1a918c2 100644 --- a/src/devices/bus/msx/cart/cartridge.cpp +++ b/src/devices/bus/msx/cart/cartridge.cpp @@ -5,6 +5,7 @@ #include "cartridge.h" #include "arc.h" #include "ascii.h" +#include "beepack.h" #include "bm_012.h" #include "crossblaim.h" #include "disk.h" @@ -25,6 +26,7 @@ #include "msxdos2.h" #include "nomapper.h" #include "rtype.h" +#include "softcard.h" #include "superloderunner.h" #include "super_swangi.h" #include "yamaha.h" @@ -71,8 +73,10 @@ void msx_cart(device_slot_interface &device) device.option_add_internal("superloderunner", MSX_CART_SUPERLODERUNNER); device.option_add_internal("synthesizer", MSX_CART_SYNTHESIZER); device.option_add_internal("ec701", MSX_CART_EC701); + device.option_add("beepack", MSX_CART_BEEPACK); device.option_add("bm_012", MSX_CART_BM_012); device.option_add("moonsound", MSX_CART_MOONSOUND); + device.option_add("softcard", MSX_CART_SOFTCARD); } diff --git a/src/devices/bus/msx/cart/softcard.cpp b/src/devices/bus/msx/cart/softcard.cpp new file mode 100644 index 00000000000..b5f5583b26d --- /dev/null +++ b/src/devices/bus/msx/cart/softcard.cpp @@ -0,0 +1,99 @@ +// license:BSD-3-Clause +// copyright-holders:Wilbert Pol +/*********************************************************************************** + +Emulation for the Electric Software Astron SoftCard Adaptor cartridge. + +This cartridge allows SoftCards to be used on an MSX system. + +***********************************************************************************/ + +#include "emu.h" +#include "softcard.h" +#include "bus/msx/softcard/softcard.h" +#include "softlist_dev.h" + + +DEFINE_DEVICE_TYPE(MSX_CART_SOFTCARD, msx_cart_softcard_device, "msx_cart_softcard", "Electric Softward Astron SoftCard Adaptor") + + +msx_cart_softcard_device::msx_cart_softcard_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, MSX_CART_SOFTCARD, tag, owner, clock) + , device_cartrom_image_interface(mconfig, *this) + , device_single_card_slot_interface(mconfig, *this) + , msx_cart_interface(mconfig, *this) +{ +} + +void msx_cart_softcard_device::device_resolve_objects() +{ + m_softcard = get_card_device(); + if (m_softcard) + { + m_softcard->set_views(page(0), page(1), page(2), page(3)); + } +} + +void msx_cart_softcard_device::device_add_mconfig(machine_config &config) +{ + softcard(*this); + SOFTWARE_LIST(config, "softcard_list").set_original("msx_softcard"); +} + +image_init_result msx_cart_softcard_device::call_load() +{ + if (m_softcard) + { + if (loaded_through_softlist()) + { + u32 length = get_software_region_length("rom"); + // Only 32KB images are supported + if (length != 0x8000) + { + seterror(image_error::UNSPECIFIED, "Invalid file size for a softcard"); + return image_init_result::FAIL; + } + } + else + { + u32 length = this->length(); + // Only 32KB images are supported + if (length != 0x8000) + { + seterror(image_error::UNSPECIFIED, "Invalid file size for a softcard"); + return image_init_result::FAIL; + } + + memory_region *const romregion = machine().memory().region_alloc(subtag("rom"), length, 1, ENDIANNESS_LITTLE); + if (fread(romregion->base(), length) != length) + { + seterror(image_error::UNSPECIFIED, "Unable to fully read file"); + return image_init_result::FAIL; + } + } + + m_softcard->initialize_cartridge(); + } + return image_init_result::PASS; +} + +std::string msx_cart_softcard_device::get_default_card_software(get_default_card_software_hook &hook) const +{ + return software_get_default_slot("nomapper"); +} + + +softcard_interface::softcard_interface(const machine_config &mconfig, device_t &device) + : device_interface(device, "softcard") + , m_page{nullptr, nullptr, nullptr, nullptr} + , m_slot(dynamic_cast(device.owner())) +{ +} + +void softcard_interface::set_views(memory_view::memory_view_entry *page0, memory_view::memory_view_entry *page1, memory_view::memory_view_entry *page2, memory_view::memory_view_entry *page3) +{ + m_page[0] = page0; + m_page[1] = page1; + m_page[2] = page2; + m_page[3] = page3; +} diff --git a/src/devices/bus/msx/cart/softcard.h b/src/devices/bus/msx/cart/softcard.h new file mode 100644 index 00000000000..6174b0939a8 --- /dev/null +++ b/src/devices/bus/msx/cart/softcard.h @@ -0,0 +1,58 @@ +// license:BSD-3-Clause +// copyright-holders:Wilbert Pol +#ifndef MAME_BUS_MSX_CART_SOFTCARD_H +#define MAME_BUS_MSX_CART_SOFTCARD_H + +#pragma once + +#include "cartridge.h" +#include "imagedev/cartrom.h" + + +DECLARE_DEVICE_TYPE(MSX_CART_SOFTCARD, msx_cart_softcard_device) + +class softcard_interface; + + +class msx_cart_softcard_device : public device_t + , public device_cartrom_image_interface + , public device_single_card_slot_interface + , public msx_cart_interface +{ +public: + msx_cart_softcard_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + + // image-level overrides + virtual image_init_result call_load() override; + virtual bool is_reset_on_load() const noexcept override { return true; } + virtual const char *image_interface() const noexcept override { return "softcard"; } + virtual const char *file_extensions() const noexcept override { return "bin,rom"; } + +protected: + virtual void device_resolve_objects() override; + virtual void device_start() override { } + virtual void device_add_mconfig(machine_config &config) override; + virtual std::string get_default_card_software(get_default_card_software_hook &hook) const override; + + softcard_interface *m_softcard; +}; + + +class softcard_interface : public device_interface +{ +public: + virtual void initialize_cartridge() { } + void set_views(memory_view::memory_view_entry *page0, memory_view::memory_view_entry *page1, memory_view::memory_view_entry *page2, memory_view::memory_view_entry *page3); + +protected: + softcard_interface(const machine_config &mconfig, device_t &device); + memory_region *cart_rom_region() { return m_slot ? m_slot->memregion("rom") : nullptr; } + memory_view::memory_view_entry *page(int i) { return m_page[i]; } + +private: + memory_view::memory_view_entry *m_page[4]; + msx_cart_softcard_device *const m_slot; +}; + + +#endif // MAME_BUS_MSX_CART_SOFTCARD_H diff --git a/src/devices/bus/msx/slot/cartridge.cpp b/src/devices/bus/msx/slot/cartridge.cpp index 958004d43df..4d7b81bfb0f 100644 --- a/src/devices/bus/msx/slot/cartridge.cpp +++ b/src/devices/bus/msx/slot/cartridge.cpp @@ -113,10 +113,8 @@ image_init_result msx_slot_cartridge_device::call_load() { if (loaded_through_softlist()) { - u32 length; - // Allocate and copy rom contents - length = get_software_region_length("rom"); + u32 length = get_software_region_length("rom"); m_cartridge->rom_alloc(length); if (length > 0) { diff --git a/src/devices/bus/msx/softcard/softcard.cpp b/src/devices/bus/msx/softcard/softcard.cpp new file mode 100644 index 00000000000..a489749de8a --- /dev/null +++ b/src/devices/bus/msx/softcard/softcard.cpp @@ -0,0 +1,54 @@ +// license:BSD-3-Clause +// copyright-holders:Wilbert Pol + +#include "emu.h" +#include "bus/msx/cart/softcard.h" + + +DECLARE_DEVICE_TYPE(SOFTCARD_NOMAPPER, softcard_interface) + + +void softcard(device_slot_interface &device) +{ + device.option_add_internal("nomapper", SOFTCARD_NOMAPPER); +} + + +namespace { + +class softcard_nomapper_device : public device_t + , public softcard_interface +{ +public: + softcard_nomapper_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + +protected: + // device-level overrides + virtual void device_start() override { } + + virtual void initialize_cartridge() override; + +}; + + +softcard_nomapper_device::softcard_nomapper_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, SOFTCARD_NOMAPPER, tag, owner, clock) + , softcard_interface(mconfig, *this) +{ +} + +void softcard_nomapper_device::initialize_cartridge() +{ + if (!cart_rom_region()) + { + fatalerror("softcard_nomapper: ROM region not setup\n"); + } + + page(1)->install_rom(0x4000, 0x7fff, cart_rom_region()->base()); + page(2)->install_rom(0x8000, 0xbfff, cart_rom_region()->base() + 0x4000); + +} + +} // anonymous namespace + +DEFINE_DEVICE_TYPE_PRIVATE(SOFTCARD_NOMAPPER, softcard_interface, softcard_nomapper_device, "softcard_nomapper", "SoftCard ROM") diff --git a/src/devices/bus/msx/softcard/softcard.h b/src/devices/bus/msx/softcard/softcard.h new file mode 100644 index 00000000000..c47c5c8d6ac --- /dev/null +++ b/src/devices/bus/msx/softcard/softcard.h @@ -0,0 +1,12 @@ +// license:BSD-3-Clause +// copyright-holders:Wilbert Pol +#ifndef MAME_BUS_MSX_SOFTCARD_SOFTCARD_H +#define MAME_BUS_MSX_SOFTCARD_SOFTCARD_H + +#pragma once + + +void softcard(device_slot_interface &device); + + +#endif // MAME_BUS_MSX_SOFTCARD_SOFTCARD_H