diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua index f0f2e9c0006..33e8258dd87 100644 --- a/scripts/src/bus.lua +++ b/scripts/src/bus.lua @@ -1991,6 +1991,8 @@ if (BUSES["MSX_SLOT"]~=null) then MAME_DIR .. "src/devices/bus/msx/cart/easi_speech.h", MAME_DIR .. "src/devices/bus/msx/cart/fmpac.cpp", MAME_DIR .. "src/devices/bus/msx/cart/fmpac.h", + MAME_DIR .. "src/devices/bus/msx/cart/franky.cpp", + MAME_DIR .. "src/devices/bus/msx/cart/franky.h", MAME_DIR .. "src/devices/bus/msx/cart/fs_sr021.cpp", MAME_DIR .. "src/devices/bus/msx/cart/fs_sr021.h", MAME_DIR .. "src/devices/bus/msx/cart/fs_sr022.cpp", diff --git a/src/devices/bus/msx/cart/cartridge.cpp b/src/devices/bus/msx/cart/cartridge.cpp index 7fc7e863349..9f499e48a29 100644 --- a/src/devices/bus/msx/cart/cartridge.cpp +++ b/src/devices/bus/msx/cart/cartridge.cpp @@ -13,6 +13,7 @@ #include "dooly.h" #include "easi_speech.h" #include "fmpac.h" +#include "franky.h" #include "fs_sr021.h" #include "fs_sr022.h" #include "halnote.h" @@ -100,6 +101,7 @@ void msx_cart(device_slot_interface &device, bool is_in_subslot) device.option_add_internal(slotoptions::EC701, MSX_CART_EC701); device.option_add(slotoptions::BEEPACK, MSX_CART_BEEPACK); device.option_add(slotoptions::BM_012, MSX_CART_BM_012); + device.option_add(slotoptions::FRANKY, MSX_CART_FRANKY); device.option_add(slotoptions::HBI55, MSX_CART_HBI55); device.option_add(slotoptions::MOONSOUND, MSX_CART_MOONSOUND); device.option_add(slotoptions::SOFTCARD, MSX_CART_SOFTCARD); diff --git a/src/devices/bus/msx/cart/franky.cpp b/src/devices/bus/msx/cart/franky.cpp new file mode 100644 index 00000000000..9602c262803 --- /dev/null +++ b/src/devices/bus/msx/cart/franky.cpp @@ -0,0 +1,86 @@ +// license:BSD-3-Clause +// copyright-holders:Wilbert Pol +/********************************************************************************** + +Emulation of SuperSoniqs' Franky cartridge, the predecessor of SuperSoniqs' +PlaySonic cartridge. + +**********************************************************************************/ + +#include "emu.h" +#include "franky.h" + +#include "video/315_5124.h" + +#include "speaker.h" + +namespace { + +class msx_cart_franky_device : public device_t, public msx_cart_interface +{ +public: + msx_cart_franky_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, MSX_CART_FRANKY, tag, owner, clock) + , msx_cart_interface(mconfig, *this) + , m_vdp(*this, "vdp") + , m_screen(*this, "screen") + { } + +protected: + virtual void device_start() override; + + // device_t implementation + virtual void device_add_mconfig(machine_config &config) override; + +private: + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + + required_device m_vdp; + required_device m_screen; +}; + + +void msx_cart_franky_device::device_add_mconfig(machine_config &config) +{ + SPEAKER(config, "franky").front_center(); + + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + + m_screen->set_raw(XTAL(10'738'635)/2, + sega315_5124_device::WIDTH, + sega315_5124_device::LBORDER_START + sega315_5124_device::LBORDER_WIDTH - 2, + sega315_5124_device::LBORDER_START + sega315_5124_device::LBORDER_WIDTH + 256 + 10, + sega315_5124_device::HEIGHT_NTSC, + sega315_5124_device::TBORDER_START + sega315_5124_device::NTSC_224_TBORDER_HEIGHT, + sega315_5124_device::TBORDER_START + sega315_5124_device::NTSC_224_TBORDER_HEIGHT + 224); + m_screen->set_refresh_hz(XTAL(10'738'635)/2 / (sega315_5124_device::WIDTH * sega315_5124_device::HEIGHT_NTSC)); + m_screen->set_screen_update(FUNC(msx_cart_franky_device::screen_update)); + + SEGA315_5246(config, m_vdp, XTAL(10'738'635)); + m_vdp->set_screen(m_screen); + m_vdp->set_is_pal(false); + m_vdp->n_int().set(*this, FUNC(msx_cart_franky_device::irq_out)); + // There is no NMI signal on the cartridge slot, so no way to hook this up +// m_vdp->n_nmi().set_inputline(maincpu, INPUT_LINE_NMI); + m_vdp->add_route(ALL_OUTPUTS, "franky", 1.00); +} + + +void msx_cart_franky_device::device_start() +{ + io_space().install_write_handler(0x48, 0x49, emu::rw_delegate(*m_vdp, FUNC(sega315_5124_device::psg_w))); + io_space().install_read_handler(0x48, 0x48, emu::rw_delegate(*m_vdp, FUNC(sega315_5124_device::vcount_read))); + io_space().install_read_handler(0x49, 0x49, emu::rw_delegate(*m_vdp, FUNC(sega315_5124_device::hcount_read))); + io_space().install_readwrite_handler(0x88, 0x88, emu::rw_delegate(*m_vdp, FUNC(sega315_5124_device::data_read)), emu::rw_delegate(*m_vdp, FUNC(sega315_5124_device::data_write))); + io_space().install_readwrite_handler(0x89, 0x89, emu::rw_delegate(*m_vdp, FUNC(sega315_5124_device::control_read)), emu::rw_delegate(*m_vdp, FUNC(sega315_5124_device::control_write))); +} + + +uint32_t msx_cart_franky_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + return m_vdp->screen_update(screen, bitmap, cliprect); +} + +} // anonymous namespace + +DEFINE_DEVICE_TYPE_PRIVATE(MSX_CART_FRANKY, msx_cart_interface, msx_cart_franky_device, "msx_cart_franky", "MSX Cartridge - Franky") diff --git a/src/devices/bus/msx/cart/franky.h b/src/devices/bus/msx/cart/franky.h new file mode 100644 index 00000000000..ea30405a4da --- /dev/null +++ b/src/devices/bus/msx/cart/franky.h @@ -0,0 +1,13 @@ +// license:BSD-3-Clause +// copyright-holders:Wilbert Pol +#ifndef MAME_BUS_MSX_CART_FRANKY_H +#define MAME_BUS_MSX_CART_FRANKY_H + +#pragma once + +#include "bus/msx/slot/cartridge.h" + + +DECLARE_DEVICE_TYPE(MSX_CART_FRANKY, msx_cart_interface) + +#endif // MAME_BUS_MSX_CART_FRANKY_H diff --git a/src/devices/bus/msx/cart/slotoptions.cpp b/src/devices/bus/msx/cart/slotoptions.cpp index 493f1d13ca3..c3f97dc8b1f 100644 --- a/src/devices/bus/msx/cart/slotoptions.cpp +++ b/src/devices/bus/msx/cart/slotoptions.cpp @@ -34,6 +34,7 @@ char const *const DOOLY = "dooly"; char const *const EASISPEECH = "easispeech"; char const *const EC701 = "ec701"; char const *const FMPAC = "fmpac"; +char const *const FRANKY = "franky"; char const *const FS_SR021 = "fs_sr021"; char const *const FS_SR022 = "fs_sr022"; char const *const GAMEMASTER2 = "gamemaster2"; diff --git a/src/devices/bus/msx/cart/slotoptions.h b/src/devices/bus/msx/cart/slotoptions.h index c2f96a782d6..c6505053745 100644 --- a/src/devices/bus/msx/cart/slotoptions.h +++ b/src/devices/bus/msx/cart/slotoptions.h @@ -37,6 +37,7 @@ extern char const *const DOOLY; extern char const *const EASISPEECH; extern char const *const EC701; extern char const *const FMPAC; +extern char const *const FRANKY; extern char const *const FS_SR021; extern char const *const FS_SR022; extern char const *const GAMEMASTER2;