summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author angelosa <lordkale4@gmail.com>2025-06-23 12:15:06 +0200
committer angelosa <lordkale4@gmail.com>2025-06-23 12:19:56 +0200
commit1215098bc79734695f1b2b2cb538d420f211acdb (patch)
tree2c694236377786a4b56a58bf1a03e3bdf9f9a38b
parent4826ad997f631a000cb17bfb90849dcf49ae901d (diff)
sharp/mz2500.cpp: preliminary MZ80 bus slot implementation:
* Move MZ-1E30 SASI, MZ-1R37 EMM from mz2500 base emulation; * Fix range of EMM to 640KB max RAM; * Add basic MZ-1E35 ADPCM emulation; * Add SuperTurboZ EH-SASI ROM BIOS to MZ-1E30; * implicitly fix dustbx01-dustbx02-dustbx03 bootups: they are incompatible with MZ-1E30 Sharp BIOS;
-rw-r--r--hash/mz2500_flop.xml20
-rw-r--r--scripts/src/bus.lua17
-rw-r--r--src/devices/bus/mz80/mz1e30.cpp74
-rw-r--r--src/devices/bus/mz80/mz1e30.h40
-rw-r--r--src/devices/bus/mz80/mz1e35.cpp43
-rw-r--r--src/devices/bus/mz80/mz1e35.h30
-rw-r--r--src/devices/bus/mz80/mz1r37.cpp61
-rw-r--r--src/devices/bus/mz80/mz1r37.h38
-rw-r--r--src/devices/bus/mz80/mz80_exp.cpp78
-rw-r--r--src/devices/bus/mz80/mz80_exp.h82
-rw-r--r--src/mame/sharp/mz2500.cpp86
-rw-r--r--src/mame/sharp/mz2500.h14
12 files changed, 488 insertions, 95 deletions
diff --git a/hash/mz2500_flop.xml b/hash/mz2500_flop.xml
index c4d1f9c3161..864696b25d5 100644
--- a/hash/mz2500_flop.xml
+++ b/hash/mz2500_flop.xml
@@ -497,17 +497,15 @@ Moans about missing Master Disk after title screen
</part>
</software>
- <software name="dustbx01" supported="no">
+ <software name="dustbx01" supported="partial">
<description>Dust Box Vol. 1 - '90/4</description>
<year>1990</year>
<publisher>&lt;coverdisk&gt;</publisher>
- <notes><![CDATA[
-"Data error in 290", falls back to BASIC prompt, keeps pushing NL control char to output
-]]></notes>
+ <info name="usage" value="Incompatible with MZ-1E30 bios 0 (crashes at startup)" />
<part name="flop1" interface="floppy_3_5">
<dataarea name="flop" size="697008">
- <rom name="dust box vol 1.d88" size="697008" crc="170fc283" sha1="d67798df7b07ff69afa6d58872d315d1ab7eaab8" status="baddump" />
+ <rom name="dust box vol 1.d88" size="697008" crc="170fc283" sha1="d67798df7b07ff69afa6d58872d315d1ab7eaab8" />
</dataarea>
</part>
</software>
@@ -516,9 +514,7 @@ Moans about missing Master Disk after title screen
<description>Dust Box Vol. 2</description>
<year>1990</year>
<publisher>&lt;coverdisk&gt;</publisher>
- <notes><![CDATA[
-Hangs on title screen with stuck note
-]]></notes>
+ <info name="usage" value="Incompatible with MZ-1E30 bios 0 (crashes at startup)" />
<part name="flop1" interface="floppy_3_5">
<dataarea name="flop" size="697008">
@@ -527,17 +523,15 @@ Hangs on title screen with stuck note
</part>
</software>
- <software name="dustbx03" supported="no">
+ <software name="dustbx03" supported="partial">
<description>Dust Box Vol. 3 - '90/9</description>
<year>1990</year>
<publisher>&lt;coverdisk&gt;</publisher>
- <notes><![CDATA[
-"Data error in 270", falls back to BASIC prompt, keeps pushing NL control char to output
-]]></notes>
+ <info name="usage" value="Incompatible with MZ-1E30 bios 0 (crashes at startup)" />
<part name="flop1" interface="floppy_3_5">
<dataarea name="flop" size="697008">
- <rom name="dust box vol 3.d88" size="697008" crc="84e61343" sha1="721d2369a268ddef97a363f35ed7bbb4974ae79b" status="baddump" />
+ <rom name="dust box vol 3.d88" size="697008" crc="84e61343" sha1="721d2369a268ddef97a363f35ed7bbb4974ae79b" />
</dataarea>
</part>
</software>
diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua
index 9d58af56c11..ec9498f2976 100644
--- a/scripts/src/bus.lua
+++ b/scripts/src/bus.lua
@@ -2170,6 +2170,23 @@ if (BUSES["MTX"]~=null) then
}
end
+---------------------------------------------------
+--
+--@src/devices/bus/mz80/mz80_exp.h,BUSES["MZ80"] = true
+---------------------------------------------------
+
+if (BUSES["MZ80"]~=null) then
+ files {
+ MAME_DIR .. "src/devices/bus/mz80/mz1e30.cpp",
+ MAME_DIR .. "src/devices/bus/mz80/mz1e30.h",
+ MAME_DIR .. "src/devices/bus/mz80/mz1e35.cpp",
+ MAME_DIR .. "src/devices/bus/mz80/mz1e35.h",
+ MAME_DIR .. "src/devices/bus/mz80/mz1r37.cpp",
+ MAME_DIR .. "src/devices/bus/mz80/mz1r37.h",
+ MAME_DIR .. "src/devices/bus/mz80/mz80_exp.cpp",
+ MAME_DIR .. "src/devices/bus/mz80/mz80_exp.h",
+ }
+end
---------------------------------------------------
--
diff --git a/src/devices/bus/mz80/mz1e30.cpp b/src/devices/bus/mz80/mz1e30.cpp
new file mode 100644
index 00000000000..5c9695fb378
--- /dev/null
+++ b/src/devices/bus/mz80/mz1e30.cpp
@@ -0,0 +1,74 @@
+// license:BSD-3-Clause
+// copyright-holders:Angelo Salese
+/**************************************************************************************************
+
+Sharp MZ-1E30 SASI I/F "IPLPRO"
+
+http://retropc.net/ohishi/museum/mz1e30.htm
+https://github.com/SuperTurboZ/Enhanced-SASI-driver-for-MZ-2500
+
+TODO:
+- just enough to make it load the ROM;
+
+**************************************************************************************************/
+
+
+#include "emu.h"
+#include "mz1e30.h"
+
+#include "speaker.h"
+
+DEFINE_DEVICE_TYPE(MZ1E30, mz1e30_device, "mz1e30", "Sharp MZ-1E30 SASI I/F")
+
+mz1e30_device::mz1e30_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : mz80_exp_device(mconfig, MZ1E30, tag, owner, clock)
+{
+}
+
+ROM_START( mz1e30 )
+ ROM_REGION( 0x10000, "iplpro", ROMREGION_ERASEFF )
+ ROM_SYSTEM_BIOS(0, "hd_v10a", "Sharp HD System V1.0A")
+ ROMX_LOAD( "sasi.rom", 0x0000, 0x8000, CRC(a7bf39ce) SHA1(3f4a237fc4f34bac6fe2bbda4ce4d16d42400081), ROM_BIOS(0) )
+ ROM_SYSTEM_BIOS(1, "eh2022", "SuperTurboZ Enhanced SASI Ver.20220524")
+ ROMX_LOAD( "sasirom.bin", 0x0000, 0x8000, CRC(f486b66b) SHA1(8b4f722e9a61c3e6aacebcda03c67253b8d9f468), ROM_BIOS(1) )
+ROM_END
+
+const tiny_rom_entry *mz1e30_device::device_rom_region() const
+{
+ return ROM_NAME( mz1e30 );
+}
+
+
+void mz1e30_device::device_start()
+{
+ m_iplpro_rom = memregion("iplpro")->base();
+}
+
+void mz1e30_device::io_map(address_map &map)
+{
+// map(0xa4, 0xa5).mirror(0xff00).rw(FUNC(mz1e30_device::sasi_r), FUNC(mz1e30_device::sasi_w));
+ map(0xa8, 0xa8).select(0xff00).w(FUNC(mz1e30_device::rom_w));
+ map(0xa9, 0xa9).select(0xff00).r(FUNC(mz1e30_device::rom_r));
+}
+
+void mz1e30_device::device_add_mconfig(machine_config &config)
+{
+ // TODO: SASI I/F
+}
+
+u8 mz1e30_device::rom_r(offs_t offset)
+{
+ m_lrom_index = (offset >> 8) & 0xff;
+
+ m_rom_index = (m_rom_index & 0xffff00) | (m_lrom_index & 0xff);
+
+ return m_iplpro_rom[m_rom_index];
+}
+
+void mz1e30_device::rom_w(offs_t offset, u8 data)
+{
+ m_hrom_index = (offset >> 8) & 0xff;
+
+ m_rom_index = (data << 8) | (m_rom_index & 0x0000ff) | ((m_hrom_index & 0xff)<<16);
+ //logerror("%02x\n",data);
+}
diff --git a/src/devices/bus/mz80/mz1e30.h b/src/devices/bus/mz80/mz1e30.h
new file mode 100644
index 00000000000..322e24976f1
--- /dev/null
+++ b/src/devices/bus/mz80/mz1e30.h
@@ -0,0 +1,40 @@
+// license:BSD-3-Clause
+// copyright-holders:Angelo Salese
+
+#ifndef MAME_BUS_MZ80_MZ1E30_H
+#define MAME_BUS_MZ80_MZ1E30_H
+
+#pragma once
+
+#include "mz80_exp.h"
+#include "sound/ymopl.h"
+
+class mz1e30_device : public mz80_exp_device
+{
+public:
+ mz1e30_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+ static constexpr feature_type unemulated_features() { return feature::DISK; }
+
+ virtual void io_map(address_map &map) override ATTR_COLD;
+
+protected:
+ virtual void device_start() override ATTR_COLD;
+ virtual void device_add_mconfig(machine_config &config) override ATTR_COLD;
+ virtual const tiny_rom_entry *device_rom_region() const override ATTR_COLD;
+
+private:
+ u8 *m_iplpro_rom = nullptr;
+
+ uint32_t m_rom_index = 0;
+ u8 m_hrom_index = 0;
+ u8 m_lrom_index = 0;
+
+ u8 rom_r(offs_t offset);
+ void rom_w(offs_t offset, u8 data);
+};
+
+DECLARE_DEVICE_TYPE(MZ1E30, mz1e30_device)
+
+
+#endif // MAME_BUS_MZ80_MZ1E35_H
diff --git a/src/devices/bus/mz80/mz1e35.cpp b/src/devices/bus/mz80/mz1e35.cpp
new file mode 100644
index 00000000000..425991f032d
--- /dev/null
+++ b/src/devices/bus/mz80/mz1e35.cpp
@@ -0,0 +1,43 @@
+// license:BSD-3-Clause
+// copyright-holders:Angelo Salese
+/**************************************************************************************************
+
+Sharp MZ-1E35 (for MZ-2800) & MZ-2500 Dust Box equivalent
+
+TODO:
+- Just enough to make it being recognized by Dust Box;
+- How to reproduce sound? Are .opn files requiring a TSR sound driver or it's just for
+ specific Dust Box games?
+
+**************************************************************************************************/
+
+
+#include "emu.h"
+#include "mz1e35.h"
+
+#include "speaker.h"
+
+DEFINE_DEVICE_TYPE(MZ1E35, mz1e35_device, "mz1e35", "Sharp MZ-1E35 ADPCM")
+
+mz1e35_device::mz1e35_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : mz80_exp_device(mconfig, MZ1E35, tag, owner, clock)
+ , m_opl(*this, "opl")
+{
+}
+
+void mz1e35_device::io_map(address_map &map)
+{
+ map(0x98, 0x99).mirror(0xff00).rw("opl", FUNC(y8950_device::read), FUNC(y8950_device::write));
+}
+
+void mz1e35_device::device_add_mconfig(machine_config &config)
+{
+ // SP OUT
+ SPEAKER(config, "mono").front_center();
+
+ // TODO: check how it draws clock from expansion I/F
+ Y8950(config, m_opl, XTAL(4'000'000));
+ m_opl->add_route(ALL_OUTPUTS, "mono", 1.0, 0);
+
+ // TODO: LINE IN / LINE OUT / MIC IN
+}
diff --git a/src/devices/bus/mz80/mz1e35.h b/src/devices/bus/mz80/mz1e35.h
new file mode 100644
index 00000000000..49c78d40410
--- /dev/null
+++ b/src/devices/bus/mz80/mz1e35.h
@@ -0,0 +1,30 @@
+// license:BSD-3-Clause
+// copyright-holders:Angelo Salese
+
+#ifndef MAME_BUS_MZ80_MZ1E35_H
+#define MAME_BUS_MZ80_MZ1E35_H
+
+#pragma once
+
+#include "mz80_exp.h"
+#include "sound/ymopl.h"
+
+class mz1e35_device : public mz80_exp_device
+{
+public:
+ mz1e35_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+ static constexpr feature_type unemulated_features() { return feature::SOUND; }
+
+ virtual void io_map(address_map &map) override ATTR_COLD;
+
+private:
+ virtual void device_add_mconfig(machine_config &config) override ATTR_COLD;
+
+ required_device<y8950_device> m_opl;
+};
+
+DECLARE_DEVICE_TYPE(MZ1E35, mz1e35_device)
+
+
+#endif // MAME_BUS_MZ80_MZ1E35_H
diff --git a/src/devices/bus/mz80/mz1r37.cpp b/src/devices/bus/mz80/mz1r37.cpp
new file mode 100644
index 00000000000..1d6eb6a69f0
--- /dev/null
+++ b/src/devices/bus/mz80/mz1r37.cpp
@@ -0,0 +1,61 @@
+// license:BSD-3-Clause
+// copyright-holders:Angelo Salese
+/**************************************************************************************************
+
+Sharp MZ-1R37 640KB EMM for MZ-2500
+
+**************************************************************************************************/
+
+
+#include "emu.h"
+#include "mz1r37.h"
+
+#include "speaker.h"
+
+DEFINE_DEVICE_TYPE(MZ1R37, mz1r37_device, "mz1r37", "Sharp MZ-1R37 EMM")
+
+mz1r37_device::mz1r37_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : mz80_exp_device(mconfig, MZ1R37, tag, owner, clock)
+{
+}
+
+void mz1r37_device::device_start()
+{
+ m_emm_ram = make_unique_clear<u8[]>(MAX_EMM_SIZE);
+ save_pointer(NAME(m_emm_ram), MAX_EMM_SIZE);
+}
+
+void mz1r37_device::io_map(address_map &map)
+{
+ map(0xac, 0xac).select(0xff00).w(FUNC(mz1r37_device::address_w));
+ map(0xad, 0xad).select(0xff00).r(FUNC(mz1r37_device::data_r)).w(FUNC(mz1r37_device::data_w));
+}
+
+void mz1r37_device::address_w(offs_t offset, u8 data)
+{
+ const u8 emm_hi_index = (offset >> 8) & 0xff;
+
+ m_emm_offset = ((emm_hi_index & 0xff) << 16) | ((data & 0xff) << 8) | (m_emm_offset & 0xff);
+}
+
+u8 mz1r37_device::data_r(offs_t offset)
+{
+ const u8 emm_lo_index = (offset >> 8) & 0xff;
+
+ m_emm_offset = (m_emm_offset & 0xffff00) | (emm_lo_index & 0xff);
+
+ if(m_emm_offset < MAX_EMM_SIZE)
+ return m_emm_ram[m_emm_offset];
+
+ return 0xff;
+}
+
+void mz1r37_device::data_w(offs_t offset, u8 data)
+{
+ const u8 emm_lo_index = (offset >> 8) & 0xff;
+
+ m_emm_offset = (m_emm_offset & 0xffff00) | (emm_lo_index & 0xff);
+
+ if(m_emm_offset < MAX_EMM_SIZE)
+ m_emm_ram[m_emm_offset] = data;
+}
diff --git a/src/devices/bus/mz80/mz1r37.h b/src/devices/bus/mz80/mz1r37.h
new file mode 100644
index 00000000000..94f787cfa32
--- /dev/null
+++ b/src/devices/bus/mz80/mz1r37.h
@@ -0,0 +1,38 @@
+// license:BSD-3-Clause
+// copyright-holders:Angelo Salese
+
+#ifndef MAME_BUS_MZ80_MZ1R37_H
+#define MAME_BUS_MZ80_MZ1R37_H
+
+#pragma once
+
+#include "mz80_exp.h"
+#include "sound/ymopl.h"
+
+class mz1r37_device : public mz80_exp_device
+{
+public:
+ mz1r37_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+ static constexpr feature_type unemulated_features() { return feature::DISK; }
+
+ virtual void io_map(address_map &map) override ATTR_COLD;
+
+protected:
+ virtual void device_start() override ATTR_COLD;
+
+private:
+ static constexpr u32 MAX_EMM_SIZE = 640 * 1024;
+
+ std::unique_ptr<u8[]> m_emm_ram;
+ uint32_t m_emm_offset = 0;
+
+ u8 data_r(offs_t offset);
+ void address_w(offs_t offset, u8 data);
+ void data_w(offs_t offset, u8 data);
+};
+
+DECLARE_DEVICE_TYPE(MZ1R37, mz1r37_device)
+
+
+#endif // MAME_BUS_MZ80_MZ1E35_H
diff --git a/src/devices/bus/mz80/mz80_exp.cpp b/src/devices/bus/mz80/mz80_exp.cpp
new file mode 100644
index 00000000000..fe88ade0461
--- /dev/null
+++ b/src/devices/bus/mz80/mz80_exp.cpp
@@ -0,0 +1,78 @@
+// license:BSD-3-Clause
+// copyright-holders:Angelo Salese
+/**************************************************************************************************
+
+Sharp MZ-80 I/O Expansion board
+
+https://www.sharpmz.org/hwindex.htm
+
+TODO:
+- preliminary, just enough to have a base to map in MZ based machines;
+
+**************************************************************************************************/
+
+#include "emu.h"
+#include "mz80_exp.h"
+
+DEFINE_DEVICE_TYPE(MZ80_EXP_SLOT, mz80_exp_slot_device, "mz80_exp_slot", "MZ-80 Expansion Slot")
+
+mz80_exp_slot_device::mz80_exp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, MZ80_EXP_SLOT, tag, owner, clock)
+ , device_single_card_slot_interface<device_mz80_exp_interface>(mconfig, *this)
+ , m_iospace(*this, finder_base::DUMMY_TAG, -1)
+{
+}
+
+mz80_exp_slot_device::~mz80_exp_slot_device()
+{
+}
+
+void mz80_exp_slot_device::device_start()
+{
+}
+
+device_mz80_exp_interface::device_mz80_exp_interface(const machine_config &mconfig, device_t &device)
+ : device_interface(device, "mz80exp")
+{
+ m_slot = dynamic_cast<mz80_exp_slot_device *>(device.owner());
+}
+
+device_mz80_exp_interface::~device_mz80_exp_interface()
+{
+}
+
+void device_mz80_exp_interface::interface_pre_start()
+{
+ if (!m_slot->started())
+ throw device_missing_dependencies();
+}
+
+void device_mz80_exp_interface::interface_post_start()
+{
+ m_slot->install_io_device(*this, &device_mz80_exp_interface::io_map);
+}
+
+mz80_exp_device::mz80_exp_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, type, tag, owner, clock)
+ , device_mz80_exp_interface(mconfig, *this)
+{
+}
+
+void mz80_exp_device::device_start()
+{
+
+}
+
+
+// slot devices
+
+#include "mz1e30.h"
+#include "mz1e35.h"
+#include "mz1r37.h"
+
+void mz2500_exp_devices(device_slot_interface &device)
+{
+ device.option_add("mz1e30", MZ1E30);
+ device.option_add("mz1e35", MZ1E35);
+ device.option_add("mz1r37", MZ1R37);
+}
diff --git a/src/devices/bus/mz80/mz80_exp.h b/src/devices/bus/mz80/mz80_exp.h
new file mode 100644
index 00000000000..2eb296b0c3c
--- /dev/null
+++ b/src/devices/bus/mz80/mz80_exp.h
@@ -0,0 +1,82 @@
+// license:BSD-3-Clause
+// copyright-holders:Angelo Salese
+
+#ifndef MAME_BUS_MZ80_MZ80_EXP_H
+#define MAME_BUS_MZ80_MZ80_EXP_H
+
+#pragma once
+
+class device_mz80_exp_interface;
+class mz80_exp_device;
+
+class mz80_exp_slot_device : public device_t, public device_single_card_slot_interface<device_mz80_exp_interface>
+{
+ friend class device_mz80_exp_interface;
+public:
+ // construction/destruction
+ template <typename T>
+ mz80_exp_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&opts, char const *dflt)
+ : mz80_exp_slot_device(mconfig, tag, owner, (uint32_t)0)
+ {
+ option_reset();
+ opts(*this);
+ set_default_option(dflt);
+ set_fixed(false);
+ }
+ mz80_exp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ virtual ~mz80_exp_slot_device();
+
+ template <typename T> void set_iospace(T &&tag, int spacenum) { m_iospace.set_tag(std::forward<T>(tag), spacenum); }
+
+ template<typename T> void install_io_device(T &device, void (T::*map)(class address_map &map))
+ {
+ m_iospace->install_device(0x0000, 0xffff, device, map);
+ }
+
+protected:
+ // device_t implementation
+ virtual void device_start() override ATTR_COLD;
+
+private:
+ required_address_space m_iospace;
+
+// device_mz80_exp_interface *m_exp;
+};
+
+class device_mz80_exp_interface : public device_interface
+{
+public:
+ // construction/destruction
+ virtual ~device_mz80_exp_interface();
+
+ virtual void io_map(address_map &map) { }
+
+protected:
+ device_mz80_exp_interface(const machine_config &mconfig, device_t &device);
+
+ virtual void interface_pre_start() override;
+ virtual void interface_post_start() override;
+
+ mz80_exp_slot_device *m_slot;
+};
+
+class mz80_exp_device : public device_t, public device_mz80_exp_interface
+{
+public:
+ // construction/destruction
+ mz80_exp_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
+
+protected:
+// virtual void device_add_mconfig(machine_config &config) override ATTR_COLD;
+ virtual void device_start() override ATTR_COLD;
+
+
+};
+
+// device type definition
+DECLARE_DEVICE_TYPE(MZ80_EXP_SLOT, mz80_exp_slot_device)
+
+void mz2500_exp_devices(device_slot_interface &device);
+
+#endif // MAME_MACHINE_PC8801_mz80_exp_H
diff --git a/src/mame/sharp/mz2500.cpp b/src/mame/sharp/mz2500.cpp
index 44e4bdcee44..8dd52eea01c 100644
--- a/src/mame/sharp/mz2500.cpp
+++ b/src/mame/sharp/mz2500.cpp
@@ -915,23 +915,6 @@ u8 mz2500_state::dict_rom_r(offs_t offset)
return m_dic_rom[(offset & 0x1fff) + ((m_dic_bank & 0x1f)*0x2000)];
}
-u8 mz2500_state::rom_r(offs_t offset)
-{
- m_lrom_index = (offset >> 8) & 0xff;
-
- m_rom_index = (m_rom_index & 0xffff00) | (m_lrom_index & 0xff);
-
- return m_iplpro_rom[m_rom_index];
-}
-
-void mz2500_state::rom_w(offs_t offset, u8 data)
-{
- m_hrom_index = (offset >> 8) & 0xff;
-
- m_rom_index = (data << 8) | (m_rom_index & 0x0000ff) | ((m_hrom_index & 0xff)<<16);
- //logerror("%02x\n",data);
-}
-
/* sets 16 color entries out of 4096 possible combinations */
void mz2500_state::palette4096_io_w(offs_t offset, u8 data)
{
@@ -1147,42 +1130,6 @@ void mz2500_state::rp5c15_8_w(offs_t offset, u8 data)
m_rtc->write(rtc_index, data);
}
-
-u8 mz2500_state::emm_data_r(offs_t offset)
-{
- u8 emm_lo_index;
-
- emm_lo_index = (offset >> 8) & 0xff;
-
- m_emm_offset = (m_emm_offset & 0xffff00) | (emm_lo_index & 0xff);
-
- if(m_emm_offset < 0x100000) //emm max size
- return m_emm_ram[m_emm_offset];
-
- return 0xff;
-}
-
-void mz2500_state::emm_address_w(offs_t offset, u8 data)
-{
- u8 emm_hi_index;
-
- emm_hi_index = (offset >> 8) & 0xff;
-
- m_emm_offset = ((emm_hi_index & 0xff) << 16) | ((data & 0xff) << 8) | (m_emm_offset & 0xff);
-}
-
-void mz2500_state::emm_data_w(offs_t offset, u8 data)
-{
- u8 emm_lo_index;
-
- emm_lo_index = (offset >> 8) & 0xff;
-
- m_emm_offset = (m_emm_offset & 0xffff00) | (emm_lo_index & 0xff);
-
- if(m_emm_offset < 0x100000) //emm max size
- m_emm_ram[m_emm_offset] = data;
-}
-
void mz2500_state::z80_map(address_map &map)
{
map(0x0000, 0x1fff).m(m_rambank[0], FUNC(address_map_bank_device::amap8));
@@ -1222,13 +1169,12 @@ void mz2500_state::z80_io(address_map &map)
map.unmap_value_high();
// map(0x60, 0x63).mirror(0xff00).w(FUNC(mz2500_state::w3100a_w));
// map(0x63, 0x63).mirror(0xff00).r(FUNC(mz2500_state::w3100a_r));
-// map(0x98, 0x99) Y8950 ADPCM, from MZ-1E35 expansion unit
+// map(0x98, 0x99) MZ-1E35 ADPCM
map(0xa0, 0xa3).mirror(0xff00).rw("z80sio", FUNC(z80sio_device::ba_cd_r), FUNC(z80sio_device::ba_cd_w));
-// map(0xa4, 0xa5).rw(FUNC(mz2500_state::sasi_r), FUNC(mz2500_state::sasi_w));
- map(0xa8, 0xa8).select(0xff00).w(FUNC(mz2500_state::rom_w));
- map(0xa9, 0xa9).select(0xff00).r(FUNC(mz2500_state::rom_r));
- map(0xac, 0xac).select(0xff00).w(FUNC(mz2500_state::emm_address_w));
- map(0xad, 0xad).select(0xff00).r(FUNC(mz2500_state::emm_data_r)).w(FUNC(mz2500_state::emm_data_w));
+// map(0xa4, 0xa5) MZ-1E30 SASI
+// map(0xa8, 0xa9) ^
+// map(0xac, 0xac) MZ-1R37 EMM
+// map(0xad, 0xad) ^
map(0xae, 0xae).select(0xff00).w(FUNC(mz2500_state::palette4096_io_w));
// map(0xb0, 0xb3).rw(FUNC(mz2500_state::sio_r), FUNC(mz2500_state::sio_w));
map(0xb4, 0xb4).mirror(0xff00).rw(FUNC(mz2500_state::bank_addr_r), FUNC(mz2500_state::bank_addr_w));
@@ -1482,13 +1428,10 @@ void mz2500_state::machine_start()
m_ipl_rom = memregion("ipl")->base();
m_kanji_rom = memregion("kanji")->base();
m_kanji2_rom = memregion("kanji2")->base();
- m_emm_ram = make_unique_clear<u8[]>(0x100000);
m_dic_rom = memregion("dictionary")->base();
m_phone_rom = memregion("phone")->base();
- m_iplpro_rom = memregion("iplpro")->base();
save_pointer(NAME(m_pcg_ram), 0x2000);
- save_pointer(NAME(m_emm_ram), 0x100000);
m_gfxdecode->set_gfx(3, std::make_unique<gfx_element>(m_palette, pcg_layout_1bpp, m_pcg_ram.get(), 0, 0x10, 0));
m_gfxdecode->set_gfx(4, std::make_unique<gfx_element>(m_palette, pcg_layout_3bpp, m_pcg_ram.get(), 0, 4, 0));
@@ -1819,9 +1762,6 @@ void mz2500_state::mz2500(machine_config &config)
FLOPPY_CONNECTOR(config, "fdc:2", mz2500_floppies, nullptr, floppy_image_device::default_mfm_floppy_formats).enable_sound(true);
FLOPPY_CONNECTOR(config, "fdc:3", mz2500_floppies, nullptr, floppy_image_device::default_mfm_floppy_formats).enable_sound(true);
- SOFTWARE_LIST(config, "flop_list").set_original("mz2500_flop");
- SOFTWARE_LIST(config, "flop_list2").set_compatible("mz2000_flop");
-
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
m_screen->set_raw(42.954545_MHz_XTAL / 2, 640+108, 0, 640, 480, 0, 200); //unknown clock / divider
m_screen->set_screen_update(FUNC(mz2500_state::screen_update));
@@ -1843,6 +1783,16 @@ void mz2500_state::mz2500(machine_config &config)
ym.add_route(3, "mono", 0.50);
SPEAKER_SOUND(config, m_dac1bit).add_route(ALL_OUTPUTS, "mono", 0.50);
+
+ // MZ-1U09, built-in 2 slots
+ for (unsigned i = 0; i < 2; i++)
+ {
+ MZ80_EXP_SLOT(config, m_exp[i], mz2500_exp_devices, nullptr);
+ m_exp[i]->set_iospace(m_maincpu, AS_IO);
+ }
+
+ SOFTWARE_LIST(config, "flop_list").set_original("mz2500_flop");
+ SOFTWARE_LIST(config, "flop_list2").set_compatible("mz2000_flop");
}
@@ -1864,9 +1814,6 @@ ROM_START( mz2500 )
ROM_REGION( 0x40000, "dictionary", 0 )
ROM_LOAD( "dict.rom", 0x00000, 0x40000, CRC(aa957c2b) SHA1(19a5ba85055f048a84ed4e8d471aaff70fcf0374) )
- ROM_REGION( 0x8000, "iplpro", ROMREGION_ERASEFF )
- ROM_LOAD( "sasi.rom", 0x00000, 0x8000, CRC(a7bf39ce) SHA1(3f4a237fc4f34bac6fe2bbda4ce4d16d42400081) )
-
ROM_REGION( 0x8000, "phone", ROMREGION_ERASEFF )
ROM_LOAD( "phone.rom", 0x00000, 0x4000, CRC(8e49e4dc) SHA1(2589f0c95028037a41ca32a8fd799c5f085dab51) )
ROM_END
@@ -1888,9 +1835,6 @@ ROM_START( mz2520 )
ROM_REGION( 0x40000, "dictionary", 0 )
ROM_LOAD( "dict.rom", 0x00000, 0x40000, CRC(aa957c2b) SHA1(19a5ba85055f048a84ed4e8d471aaff70fcf0374) )
- ROM_REGION( 0x8000, "iplpro", ROMREGION_ERASEFF )
- ROM_LOAD( "sasi.rom", 0x00000, 0x8000, CRC(a7bf39ce) SHA1(3f4a237fc4f34bac6fe2bbda4ce4d16d42400081) )
-
ROM_REGION( 0x8000, "phone", ROMREGION_ERASEFF )
ROM_LOAD( "phone.rom", 0x00000, 0x4000, CRC(8e49e4dc) SHA1(2589f0c95028037a41ca32a8fd799c5f085dab51) )
ROM_END
diff --git a/src/mame/sharp/mz2500.h b/src/mame/sharp/mz2500.h
index 8d23e647bb4..7696f004c00 100644
--- a/src/mame/sharp/mz2500.h
+++ b/src/mame/sharp/mz2500.h
@@ -9,6 +9,7 @@
#pragma once
#include "bus/msx/ctrl/ctrl.h"
+#include "bus/mz80/mz80_exp.h"
#include "cpu/z80/z80.h"
#include "machine/i8255.h"
#include "machine/pit8253.h"
@@ -49,6 +50,7 @@ public:
, m_tvram(*this, "tvram")
, m_cgram(*this, "cgram")
, m_wram(*this, "wram")
+ , m_exp(*this, "exp%u", 0U)
{ }
void mz2500(machine_config &config);
@@ -72,15 +74,14 @@ private:
required_shared_ptr<u8> m_tvram;
required_shared_ptr<u8> m_cgram;
required_shared_ptr<u8> m_wram;
+ required_device_array<mz80_exp_slot_device, 2> m_exp;
u8 *m_ipl_rom = nullptr;
u8 *m_kanji_rom = nullptr;
u8 *m_kanji2_rom = nullptr;
std::unique_ptr<u8[]> m_pcg_ram;
- std::unique_ptr<u8[]> m_emm_ram;
u8 *m_dic_rom = nullptr;
u8 *m_phone_rom = nullptr;
- u8 *m_iplpro_rom = nullptr;
emu_timer *m_ipl_reset_timer = nullptr;
@@ -117,13 +118,9 @@ private:
int m_scr_x_size = 0;
int m_scr_y_size = 0;
u8 m_cg_clear_flag = 0;
- uint32_t m_rom_index = 0;
- u8 m_hrom_index = 0;
- u8 m_lrom_index = 0;
struct { u8 r = 0, g = 0, b = 0; } m_pal[16];
u8 m_joy_mode = 0;
uint16_t m_kanji_index = 0;
- uint32_t m_emm_offset = 0;
u8 m_old_portc = 0;
u8 m_prev_col_val = 0;
u8 m_pio_latchb = 0;
@@ -141,8 +138,6 @@ private:
void tv_crtc_w(offs_t offset, u8 data);
void irq_sel_w(u8 data);
void irq_data_w(u8 data);
- u8 rom_r(offs_t offset);
- void rom_w(offs_t offset, u8 data);
void palette4096_io_w(offs_t offset, u8 data);
u8 bplane_latch_r();
u8 rplane_latch_r();
@@ -157,9 +152,6 @@ private:
void kanji_w(offs_t offset, u8 data);
u8 rp5c15_8_r(offs_t offset);
void rp5c15_8_w(offs_t offset, u8 data);
- u8 emm_data_r(offs_t offset);
- void emm_address_w(offs_t offset, u8 data);
- void emm_data_w(offs_t offset, u8 data);
u8 rmw_r(offs_t offset);
void rmw_w(offs_t offset, u8 data);