diff --git a/hash/msx1_cart.xml b/hash/msx1_cart.xml index aad8da971aa..7e8119775bd 100644 --- a/hash/msx1_cart.xml +++ b/hash/msx1_cart.xml @@ -7922,6 +7922,19 @@ kept for now until finding out what those bytes affect... + + The Love Plus Pack 0 (Korea, pirate) + + 19?? + <unknown> + + + + + + + + Lunar Ball (Japan) 1985 @@ -12027,6 +12040,19 @@ kept for now until finding out what those bytes affect... + + + Tel-Tron (Netherlands) + 1986 + DCS + + + + + + + + Telebunnie (Japan) 1984 @@ -12313,6 +12339,7 @@ kept for now until finding out what those bytes affect... Toshiba + @@ -12462,6 +12489,18 @@ kept for now until finding out what those bytes affect... + + Trun (demo) + 2016 + VG Source + + + + + + + + Turboat (Japan) 1984 @@ -12529,6 +12568,30 @@ kept for now until finding out what those bytes affect... + + Twin Hammer (Europe, alt) + 1989 + Best + + + + + + + + + + Twin Hammer (Europe, alt 2) + 1989 + Best + + + + + + + + TZR - GrandPrix Rider (Japan) 1986 @@ -12603,6 +12666,21 @@ kept for now until finding out what those bytes affect... + + + Video Hustler (Japan, alt 2) + 1984 + Konami + + + + + + + + + + Vifam (Japan) 1984 @@ -12660,6 +12738,20 @@ kept for now until finding out what those bytes affect... + + Volguard (Japan, alt) + 1985 + dB-Soft + + + + + + + + + + Warp & Warp (Japan) 1984 @@ -16108,6 +16200,18 @@ legacy FM implementations cannot find it. + + TT Racer (Al Alamiah) + 1987 + Al Alamiah + + + + + + + + Who? (Arab, v1.14) 1987 @@ -16213,6 +16317,21 @@ legacy FM implementations cannot find it. + + Voyage to Mecca (Arab, alt 3) + 1985 + Al Alamiah + + + + + + + + + + + Wonderful Child (Arab, v1.02) 1985 @@ -17567,6 +17686,1232 @@ legacy FM implementations cannot find it. + + T-Game 4 + 2019 + <homebrew> + + + + + + + + + + + T-Game 4 (alt) + 2019 + <homebrew> + + + + + + + + + + + T-Virus + 2019 + <homebrew> + + + + + + + + + + + Tales of Popolon (English, v1.3.1) + 2017 + <homebrew> + + + + + + + + + + + Tales of Popolon (Spanish, v1.3.1) + 2017 + <homebrew> + + + + + + + + + + + Tales of Popolon (English, v1.3) + 2017 + <homebrew> + + + + + + + + + + + Tales of Popolon (Spanish, v1.3) + 2017 + <homebrew> + + + + + + + + + + + Tales of Popolon (English, v1.2) + 2017 + <homebrew> + + + + + + + + + + + Tales of Popolon (Spanish, v1.2) + 2017 + <homebrew> + + + + + + + + + + + Tales of Popolon (English, v1.1.1) + 2017 + <homebrew> + + + + + + + + + + + Tales of Popolon (English, v1.1) + 2017 + <homebrew> + + + + + + + + + + + Tales of Popolon (English, v1.0) + 2017 + <homebrew> + + + + + + + + + + + Teki-Paki + 2003 + <homebrew> + + + + + + + + + + + Teki-Paki (beta) + 2003 + <homebrew> + + + + + + + + + + + Tekmo 400 + 2016 + <homebrew> + + + + + + + + + + + Teodoro no Sabe Volar (English) + 2012 + <homebrew> + + + + + + + + + + + Teodoro no Sabe Volar (Spanish) + 2012 + <homebrew> + + + + + + + + + + + The Circus Mystery (v1.4) + 2022 + <homebrew> + + + + + + + + + + + The Circus Mystery (v1.3) + 2022 + <homebrew> + + + + + + + + + + + The Cure + 2005 + <homebrew> + + + + + + + + + + + The Cure (alt) + 2005 + <homebrew> + + + + + + + + + + + The Lost Mines + 2015 + <homebrew> + + + + + + + + + + + The Mansion (English) + 2005 + <homebrew> + + + + + + + + + + + The Mansion (Spanish) + 2005 + <homebrew> + + + + + + + + + + + The Menace from Triton (v1.2) + 2020 + <homebrew> + + + + + + + + + + + The Menace from Triton (v1.1) + 2020 + <homebrew> + + + + + + + + + + + The Menace from Triton (v1.0.2) + 2020 + <homebrew> + + + + + + + + + + + The Menace from Triton (v1.0.1) + 2020 + <homebrew> + + + + + + + + + + + The Menace from Triton (v1.0.0) + 2020 + <homebrew> + + + + + + + + + + + The Queen's Footsteps (v1.1.1) + 2020 + <homebrew> + + + + + + + + + + + + + + + + + + + + + + + + + + The Queen's Footsteps (v1.0) + 2020 + <homebrew> + + + + + + + + + + + + + + + + + + + + + + + + + + Tiles of Shalom + 2007 + <homebrew> + + + + + + + + + + + Tilez + 2022 + <homebrew> + + + + + + + + + + + Tina's Adventure Island + 2017 + <homebrew> + + + + + + + + + + + Tiny Slot Checker (v3.2) + 2021 + <homebrew> + + + + + + + + + + + Tiny Slot Checker (v2) + 2020 + <homebrew> + + + + + + + + + + + Tiny Slot Checker (older) + 2018 + <homebrew> + + + + + + + + + + + Tomb of Genghis Khan + 2009 + <homebrew> + + + + + + + + + + + Tool Blocks + 2021 + <homebrew> + + + + + + + + + + + Tortilla Sunrise (English, v1.1) + 2021 + <homebrew> + + + + + + + + + + + Tortilla Sunrise (Spanish, v1.1) + 2021 + <homebrew> + + + + + + + + + + + Tortilla Sunrise (English, v1.0) + 2021 + <homebrew> + + + + + + + + + + + Toss a Coin to your Witcher + 2020 + <homebrew> + + + + + + + + + + + Traffic Jam + 2006 + <homebrew> + + + + + + + + + + + Traffic Jam (alt) + 2006 + <homebrew> + + + + + + + + + + + Tragaperras (Spanish) + 2005 + <homebrew> + + + + + + + + + + + Trail 2 + 2012 + <doujin> + + + + + + + + + + + Transball (v1.3.2, English) + 2016 + <homebrew> + + + + + + + + + + + Transball (v1.3.2?, English, alt) + 2016 + <homebrew> + + + + + + + + + + + Transball (v1.3.2, Spanish) + 2016 + <homebrew> + + + + + + + + + + + Transball (v1.3.1, English) + 2016 + <homebrew> + + + + + + + + + + + Transball (v1.3.1, Spanish) + 2016 + <homebrew> + + + + + + + + + + + Transball (v1.3, English) + 2016 + <homebrew> + + + + + + + + + + + Transball (v1.3, Spanish) + 2016 + <homebrew> + + + + + + + + + + + Transball (v1.2.1, English) + 2016 + <homebrew> + + + + + + + + + + + Transball (v1.2.1, Spanish) + 2016 + <homebrew> + + + + + + + + + + + Transball (v1.2, English) + 2016 + <homebrew> + + + + + + + + + + + Transball (v1.2, Spanish) + 2016 + <homebrew> + + + + + + + + + + + Transball (v1.1.1, English) + 2016 + <homebrew> + + + + + + + + + + + Transball (v1.1.1, Spanish) + 2016 + <homebrew> + + + + + + + + + + + Transball (v1.1, English) + 2016 + <homebrew> + + + + + + + + + + + Transball (v1.1, Spanish) + 2016 + <homebrew> + + + + + + + + + + + Transball (v1.0.1, Spanish) + 2016 + <homebrew> + + + + + + + + + + + Transball (v1.0, English) + 2016 + <homebrew> + + + + + + + + + + + Transball (v1.0, Spanish) + 2016 + <homebrew> + + + + + + + + + + + Turfy (2019 version) + 2019 + <homebrew> + + + + + + + + + + + Turfy (2016 version) + 2016 + <homebrew> + + + + + + + + + + + Twinlight + 2019 + <homebrew> + + + + + + + + + + + Twinlight (alt) + 2019 + <homebrew> + + + + + + + + + + + Txupinazo! + 2007 + <homebrew> + + + + + + + + + + + U-Do + 1990 + <doujin> + + + + + + + + + + + U.F.O. + 20?? + <homebrew> + + + + + + + + + + + UnidentifiedFlyingObject + 2020 + <homebrew> + + + + + + + + + + + Universe Unknown + 2005 + <homebrew> + + + + + + + + + + + Universe Unknown (alt) + 2005 + <homebrew> + + + + + + + + + + + Up Tack + 2019 + <homebrew> + + + + + + + + + + + Uridium + 2014 + <homebrew> + + + + + + + + + + + Uridium (alt) + 2014 + <homebrew> + + + + + + + + + + + Uridium (alt 2) + 2014 + <homebrew> + + + + + + + + + + + Uridium (alt 3) + 2014 + <homebrew> + + + + + + + + + + + Utopia + 2008 + <homebrew> + + + + + + + + + + + veejingSX (v0.996b) + 2013 + <homebrew> + + + + + + + + + + + veejingSX (v0.99b) + 2012 + <homebrew> + + + + + + + + + + + veejingSX (v0.9b) + 2011 + <homebrew> + + + + + + + + + + + 9918-veejing (v0.7b, Russian) + 2011 + <homebrew> + + + + + + + + + + + 9918-veejing (v0.1b) + 2010 + <homebrew> + + + + + + + + + + + Viking (English) + 2005 + <homebrew> + + + + + + + + + + + Viking (Spanish) + 2005 + <homebrew> + + + + + + + + + + + Virus LPQ-79 (v1.20) + 2018 + <homebrew> + + + + + + + + + + + Virus LPQ-79 (v1.10) + 2018 + <homebrew> + + + + + + + + + + + Virus LPQ-79 (v1.00) + 2018 + <homebrew> + + + + + + + + + + + VVVVVV (unfinished) + 2012 + <homebrew> + + + + + + + + + Westen House (English, v1.3.1) 2021 diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua index b7160a04435..57f321e2af4 100644 --- a/scripts/src/bus.lua +++ b/scripts/src/bus.lua @@ -1928,6 +1928,8 @@ if (BUSES["MSX_SLOT"]~=null) then MAME_DIR .. "src/devices/bus/msx/cart/konami.h", MAME_DIR .. "src/devices/bus/msx/cart/korean.cpp", MAME_DIR .. "src/devices/bus/msx/cart/korean.h", + MAME_DIR .. "src/devices/bus/msx/cart/loveplus.cpp", + MAME_DIR .. "src/devices/bus/msx/cart/loveplus.h", MAME_DIR .. "src/devices/bus/msx/cart/majutsushi.cpp", MAME_DIR .. "src/devices/bus/msx/cart/majutsushi.h", MAME_DIR .. "src/devices/bus/msx/cart/moonsound.h", diff --git a/src/devices/bus/msx/cart/loveplus.cpp b/src/devices/bus/msx/cart/loveplus.cpp new file mode 100644 index 00000000000..7e6f30ac015 --- /dev/null +++ b/src/devices/bus/msx/cart/loveplus.cpp @@ -0,0 +1,119 @@ +// license:BSD-3-Clause +// copyright-holders:Wilbert Pol +/****************************************************************************** + +Banking for Love Plus Pack 0, Korean 83-in-1 pirate. + +******************************************************************************/ +#include "emu.h" +#include "loveplus.h" + + +namespace { + +class msx_cart_loveplus_device : public device_t, public msx_cart_interface +{ +public: + msx_cart_loveplus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + virtual std::error_condition initialize_cartridge(std::string &message) override; + +protected: + // device-level overrides + virtual void device_start() override; + virtual void device_reset() override; + +private: + template void bank_w(u8 data); + void bank_9000_w(u8 data); + + memory_bank_array_creator<4> m_rombank; + + u8 m_bank_mask; + bool m_bank_locked[4]; +}; + + +msx_cart_loveplus_device::msx_cart_loveplus_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, MSX_CART_LOVEPLUS, tag, owner, clock) + , msx_cart_interface(mconfig, *this) + , m_rombank(*this, "rombank%u", 0U) +{ +} + +void msx_cart_loveplus_device::device_start() +{ + save_item(NAME(m_bank_locked)); +} + +void msx_cart_loveplus_device::device_reset() +{ + m_rombank[0]->set_entry(0); + m_rombank[1]->set_entry(1); + m_rombank[2]->set_entry(2); + m_rombank[3]->set_entry(3); +} + +std::error_condition msx_cart_loveplus_device::initialize_cartridge(std::string &message) +{ + if (!cart_rom_region()) + { + message = "msx_cart_loveplus_device: Required region 'rom' was not found."; + return image_error::INTERNAL; + } + + const u32 size = cart_rom_region()->bytes(); + const u16 banks = size / 0x2000; + + if (size > 256 * 0x8000 || size < 0x10000 || size != banks * 0x2000 || (~(banks - 1) % banks)) + { + message = "msx_cart_loveplus_device: Region 'rom' has unsupported size."; + return image_error::INVALIDLENGTH; + } + + m_bank_mask = banks - 1; + + m_rombank[0]->configure_entries(0, banks, cart_rom_region()->base(), 0x2000); + m_rombank[1]->configure_entries(0, banks, cart_rom_region()->base(), 0x2000); + m_rombank[2]->configure_entries(0, banks, cart_rom_region()->base(), 0x2000); + m_rombank[3]->configure_entries(0, banks, cart_rom_region()->base(), 0x2000); + + page(1)->install_read_bank(0x4000, 0x5fff, m_rombank[0]); + page(1)->install_read_bank(0x6000, 0x7fff, m_rombank[1]); + page(1)->nop_write(0x5000, 0x5000); // Referenced from code but never used + page(1)->install_write_handler(0x6000, 0x6000, emu::rw_delegate(*this, FUNC(msx_cart_loveplus_device::bank_w<0>))); + page(1)->install_write_handler(0x6800, 0x6800, emu::rw_delegate(*this, FUNC(msx_cart_loveplus_device::bank_w<1>))); + page(1)->install_write_handler(0x7000, 0x7000, emu::rw_delegate(*this, FUNC(msx_cart_loveplus_device::bank_w<2>))); + page(1)->install_write_handler(0x7800, 0x7800, emu::rw_delegate(*this, FUNC(msx_cart_loveplus_device::bank_w<3>))); + page(2)->install_read_bank(0x8000, 0x9fff, m_rombank[2]); + page(2)->install_read_bank(0xa000, 0xbfff, m_rombank[3]); + page(2)->install_write_handler(0x9000, 0x9000, emu::rw_delegate(*this, FUNC(msx_cart_loveplus_device::bank_9000_w))); + page(2)->nop_write(0xb000, 0xb000); // Referenced from code but never used + + return std::error_condition(); +} + +template +void msx_cart_loveplus_device::bank_w(u8 data) +{ + // The banking registers can be only written to once otherwise Q-Bert will not + // start and drop back to Basic. + if (!m_bank_locked[Bank]) + { + m_rombank[Bank]->set_entry(data & m_bank_mask); + m_bank_locked[Bank] = true; + } +} + +void msx_cart_loveplus_device::bank_9000_w(u8 data) +{ + // Before switching to a game the sequence 00, 3f, c2 is written here. + // This unlocks and/or configures the write-once banking somehow + for (int i = 0; i < 4; i++) + m_bank_locked[i] = false; +} + +} // anonymous namespace + + +DEFINE_DEVICE_TYPE_PRIVATE(MSX_CART_LOVEPLUS, msx_cart_interface, msx_cart_loveplus_device, "msx_cart_loveplus", "MSX Cartridge - Love Plus Pack") diff --git a/src/devices/bus/msx/cart/loveplus.h b/src/devices/bus/msx/cart/loveplus.h new file mode 100644 index 00000000000..1a8b0b1afe5 --- /dev/null +++ b/src/devices/bus/msx/cart/loveplus.h @@ -0,0 +1,14 @@ +// license:BSD-3-Clause +// copyright-holders:Wilbert Pol +#ifndef MAME_BUS_MSX_CART_LOVEPLUS_H +#define MAME_BUS_MSX_CART_LOVEPLUS_H + +#pragma once + +#include "bus/msx/slot/cartridge.h" + + +DECLARE_DEVICE_TYPE(MSX_CART_LOVEPLUS, msx_cart_interface) + + +#endif // MAME_BUS_MSX_CART_LOVEPLUS_H diff --git a/src/devices/bus/msx/cart/slotoptions.cpp b/src/devices/bus/msx/cart/slotoptions.cpp index 0108baa3265..0269dfbaac8 100644 --- a/src/devices/bus/msx/cart/slotoptions.cpp +++ b/src/devices/bus/msx/cart/slotoptions.cpp @@ -47,6 +47,7 @@ char const *const KONAMI_SCC = "konami_scc"; char const *const KOREAN_80IN1 = "korean_80in1"; char const *const KOREAN_90IN1 = "korean_90in1"; char const *const KOREAN_126IN1 = "korean_126in1"; +char const *const LOVEPLUS = "loveplus"; char const *const MAJUSTUSHI = "majutsushi"; char const *const MM256K = "mm256k"; char const *const MM512K = "mm512k"; diff --git a/src/devices/bus/msx/cart/slotoptions.h b/src/devices/bus/msx/cart/slotoptions.h index ba5d1a24436..557b887ffd1 100644 --- a/src/devices/bus/msx/cart/slotoptions.h +++ b/src/devices/bus/msx/cart/slotoptions.h @@ -50,6 +50,7 @@ extern char const *const KONAMI_SCC; extern char const *const KOREAN_80IN1; extern char const *const KOREAN_90IN1; extern char const *const KOREAN_126IN1; +extern char const *const LOVEPLUS; extern char const *const MAJUSTUSHI; extern char const *const MM256K; extern char const *const MM512K;