From f9ef8589ef2bd692df1b75f9f56efea5c065693b Mon Sep 17 00:00:00 2001 From: arbee Date: Sun, 12 May 2024 14:15:45 -0400 Subject: sega/segaybd.cpp: Switch Sega Y-Board games back to Musashi (MT08783). [R. Belmont] cpu/m68000: added option to use Musashi for M68000 emulation. [R. Belmont] --- scripts/src/cpu.lua | 2 ++ src/devices/cpu/m68000/m68000musashi.cpp | 25 +++++++++++++++++++++++++ src/devices/cpu/m68000/m68000musashi.h | 27 +++++++++++++++++++++++++++ src/mame/sega/segaybd.cpp | 6 +++--- src/mame/sega/segaybd.h | 8 ++++---- 5 files changed, 61 insertions(+), 7 deletions(-) create mode 100755 src/devices/cpu/m68000/m68000musashi.cpp create mode 100755 src/devices/cpu/m68000/m68000musashi.h diff --git a/scripts/src/cpu.lua b/scripts/src/cpu.lua index ed31d24dbdc..f40e4815cce 100644 --- a/scripts/src/cpu.lua +++ b/scripts/src/cpu.lua @@ -2042,6 +2042,8 @@ if CPUS["M680X0"] then MAME_DIR .. "src/devices/cpu/m68000/m68008-sip8.cpp", MAME_DIR .. "src/devices/cpu/m68000/m68008.h", MAME_DIR .. "src/devices/cpu/m68000/m68008.cpp", + MAME_DIR .. "src/devices/cpu/m68000/m68000musashi.h", + MAME_DIR .. "src/devices/cpu/m68000/m68000musashi.cpp", MAME_DIR .. "src/devices/cpu/m68000/m68010.h", MAME_DIR .. "src/devices/cpu/m68000/m68010.cpp", MAME_DIR .. "src/devices/cpu/m68000/m68020.h", diff --git a/src/devices/cpu/m68000/m68000musashi.cpp b/src/devices/cpu/m68000/m68000musashi.cpp new file mode 100755 index 00000000000..41b4c746458 --- /dev/null +++ b/src/devices/cpu/m68000/m68000musashi.cpp @@ -0,0 +1,25 @@ +// license:BSD-3-Clause +// copyright-holders:Karl Stenerud + +#include "emu.h" +#include "m68000musashi.h" +#include "m68kdasm.h" + +DEFINE_DEVICE_TYPE(M68000MUSASHI, m68000msh_device, "m68000msh", "Motorola MC68000 (Musashi)") + +std::unique_ptr m68000msh_device::create_disassembler() +{ + return std::make_unique(m68k_disassembler::TYPE_68010); +} + + +m68000msh_device::m68000msh_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : m68000_musashi_device(mconfig, tag, owner, clock, M68000MUSASHI, 16, 24) +{ +} + +void m68000msh_device::device_start() +{ + m68000_musashi_device::device_start(); + init_cpu_m68000(); +} diff --git a/src/devices/cpu/m68000/m68000musashi.h b/src/devices/cpu/m68000/m68000musashi.h new file mode 100755 index 00000000000..0d025d05e44 --- /dev/null +++ b/src/devices/cpu/m68000/m68000musashi.h @@ -0,0 +1,27 @@ +// license:BSD-3-Clause +// copyright-holders:Karl Stenerud +#ifndef MAME_CPU_M68000_M68000MUSASHI_H +#define MAME_CPU_M68000_M68000MUSASHI_H + +#pragma once + +#include "m68kmusashi.h" + +class m68000msh_device : public m68000_musashi_device +{ +public: + // construction/destruction + m68000msh_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + + virtual std::unique_ptr create_disassembler() override; + + virtual u32 execute_min_cycles() const noexcept override { return 4; } + virtual u32 execute_max_cycles() const noexcept override { return 158; } + + // device-level overrides + virtual void device_start() override; +}; + +DECLARE_DEVICE_TYPE(M68000MUSASHI, m68000msh_device) + +#endif diff --git a/src/mame/sega/segaybd.cpp b/src/mame/sega/segaybd.cpp index 0c132c8ae2f..776f211a8a9 100644 --- a/src/mame/sega/segaybd.cpp +++ b/src/mame/sega/segaybd.cpp @@ -1428,13 +1428,13 @@ INPUT_PORTS_END void segaybd_state::yboard(machine_config &config) { // basic machine hardware - M68000(config, m_maincpu, MASTER_CLOCK/4); + M68000MUSASHI(config, m_maincpu, MASTER_CLOCK/4); m_maincpu->set_addrmap(AS_PROGRAM, &segaybd_state::main_map); - M68000(config, m_subx, MASTER_CLOCK/4); + M68000MUSASHI(config, m_subx, MASTER_CLOCK/4); m_subx->set_addrmap(AS_PROGRAM, &segaybd_state::subx_map); - M68000(config, m_suby, MASTER_CLOCK/4); + M68000MUSASHI(config, m_suby, MASTER_CLOCK/4); m_suby->set_addrmap(AS_PROGRAM, &segaybd_state::suby_map); Z80(config, m_soundcpu, SOUND_CLOCK/8); diff --git a/src/mame/sega/segaybd.h b/src/mame/sega/segaybd.h index 864f9b877fa..c38b74558c2 100644 --- a/src/mame/sega/segaybd.h +++ b/src/mame/sega/segaybd.h @@ -10,7 +10,7 @@ #pragma once -#include "cpu/m68000/m68000.h" +#include "cpu/m68000/m68000musashi.h" #include "cpu/z80/z80.h" #include "machine/mb3773.h" #include "segaic16.h" @@ -123,9 +123,9 @@ private: void update_irqs(); // devices - required_device m_maincpu; - required_device m_subx; - required_device m_suby; + required_device m_maincpu; + required_device m_subx; + required_device m_suby; required_device m_soundcpu; optional_device m_linkcpu; required_device m_watchdog; -- cgit v1.2.3