summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices
diff options
context:
space:
mode:
author angelosa <salese_corp_ltd@email.it>2018-05-25 19:33:19 +0200
committer angelosa <salese_corp_ltd@email.it>2018-05-25 19:55:15 +0200
commit57545da189ae62a85b21d44c7c617fe64a723b1d (patch)
treeff77d78e90090834a57c116362cbc77f5fd7d589 /src/devices
parent1011769f3742602f091f448d871ddd0c864a3c83 (diff)
pc9801.cpp: Improved and reorganized -26 and -86 sound card ROM readbacks [Angelo Salese, Takahiro Nogi]
Diffstat (limited to 'src/devices')
-rw-r--r--src/devices/bus/cbus/pc9801_26.cpp32
-rw-r--r--src/devices/bus/cbus/pc9801_26.h5
-rw-r--r--src/devices/bus/cbus/pc9801_86.cpp32
-rw-r--r--src/devices/bus/cbus/pc9801_86.h4
-rw-r--r--src/devices/bus/cbus/pc9801_cbus.h1
5 files changed, 58 insertions, 16 deletions
diff --git a/src/devices/bus/cbus/pc9801_26.cpp b/src/devices/bus/cbus/pc9801_26.cpp
index 6a31ef19ecc..d19bf57f522 100644
--- a/src/devices/bus/cbus/pc9801_26.cpp
+++ b/src/devices/bus/cbus/pc9801_26.cpp
@@ -61,6 +61,27 @@ MACHINE_CONFIG_START(pc9801_26_device::device_add_mconfig)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
MACHINE_CONFIG_END
+// to load a different bios for slots:
+// -cbus0 pc9801_26,bios=N
+ROM_START( pc9801_26 )
+ ROM_REGION( 0x4000, "sound_bios", ROMREGION_ERASEFF )
+ // PC9801_26k is a minor change that applies to 286+ CPUs
+ ROM_SYSTEM_BIOS( 0, "26k", "nec26k" )
+ ROMX_LOAD( "26k_wyka01_00.bin", 0x0000, 0x2000, CRC(f071bf69) SHA1(f3cdef94e9fee116cf4a9b54881e77c6cd903815), ROM_SKIP(1) | ROM_BIOS(1) )
+ ROMX_LOAD( "26k_wyka02_00.bin", 0x0001, 0x2000, CRC(eaa01052) SHA1(5d47edae49aad591f139d5599fe04b61aefd5ecd), ROM_SKIP(1) | ROM_BIOS(1) )
+ // regular BIOS, for V30 and downward CPUs
+ ROM_SYSTEM_BIOS( 1, "26", "nec26" )
+ ROMX_LOAD( "sound.rom", 0x0000, 0x4000, CRC(80eabfde) SHA1(e09c54152c8093e1724842c711aed6417169db23), ROM_BIOS(2) )
+ // following rom is unchecked and of dubious quality
+ // we also currently mark it based off where they originally belonged to, lacking a better info
+ ROM_SYSTEM_BIOS( 2, "26_9821", "nec26_9821" )
+ ROMX_LOAD( "sound_9821.rom", 0x0000, 0x4000, BAD_DUMP CRC(a21ef796) SHA1(34137c287c39c44300b04ee97c1e6459bb826b60), ROM_BIOS(3) )
+ROM_END
+
+const tiny_rom_entry *pc9801_26_device::device_rom_region() const
+{
+ return ROM_NAME( pc9801_26 );
+}
//-------------------------------------------------
// input_ports - device-specific input ports
@@ -149,6 +170,7 @@ void pc9801_26_device::install_device(offs_t start, offs_t end, read8_delegate r
void pc9801_26_device::device_start()
{
+ m_bus->program_space().install_rom(0xcc000,0xcffff,memregion(this->subtag("sound_bios").c_str())->base());
}
@@ -159,7 +181,9 @@ void pc9801_26_device::device_start()
void pc9801_26_device::device_reset()
{
uint16_t port_base = (ioport("OPN_DSW")->read() & 1) << 8;
- install_device(port_base + 0x0088, port_base + 0x008b, read8_delegate(FUNC(pc9801_26_device::pc9801_26_r), this), write8_delegate(FUNC(pc9801_26_device::pc9801_26_w), this) );
+
+ m_bus->io_space().unmap_readwrite(0x0088, 0x008b, 0x100);
+ install_device(port_base + 0x0088, port_base + 0x008b, read8_delegate(FUNC(pc9801_26_device::opn_r), this), write8_delegate(FUNC(pc9801_26_device::opn_w), this) );
}
@@ -167,8 +191,8 @@ void pc9801_26_device::device_reset()
// READ/WRITE HANDLERS
//**************************************************************************
-
-READ8_MEMBER(pc9801_26_device::pc9801_26_r)
+// TODO: leftover mirrors? Doesn't match to what installs above
+READ8_MEMBER(pc9801_26_device::opn_r)
{
if((offset & 1) == 0)
{
@@ -182,7 +206,7 @@ READ8_MEMBER(pc9801_26_device::pc9801_26_r)
}
-WRITE8_MEMBER(pc9801_26_device::pc9801_26_w)
+WRITE8_MEMBER(pc9801_26_device::opn_w)
{
if((offset & 5) == 0)
m_opn->write(space, offset >> 1, data);
diff --git a/src/devices/bus/cbus/pc9801_26.h b/src/devices/bus/cbus/pc9801_26.h
index 0a7857242d8..250d38a6d8a 100644
--- a/src/devices/bus/cbus/pc9801_26.h
+++ b/src/devices/bus/cbus/pc9801_26.h
@@ -27,8 +27,8 @@ public:
// construction/destruction
pc9801_26_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- DECLARE_READ8_MEMBER(pc9801_26_r);
- DECLARE_WRITE8_MEMBER(pc9801_26_w);
+ DECLARE_READ8_MEMBER(opn_r);
+ DECLARE_WRITE8_MEMBER(opn_w);
protected:
// device-level overrides
@@ -38,6 +38,7 @@ protected:
// optional information overrides
virtual void device_add_mconfig(machine_config &config) override;
virtual ioport_constructor device_input_ports() const override;
+ virtual const tiny_rom_entry *device_rom_region() const override;
void install_device(offs_t start, offs_t end, read8_delegate rhandler, write8_delegate whandler);
private:
diff --git a/src/devices/bus/cbus/pc9801_86.cpp b/src/devices/bus/cbus/pc9801_86.cpp
index 82715c4e718..d5a8badf609 100644
--- a/src/devices/bus/cbus/pc9801_86.cpp
+++ b/src/devices/bus/cbus/pc9801_86.cpp
@@ -71,8 +71,20 @@ MACHINE_CONFIG_START(pc9801_86_device::device_add_mconfig)
MCFG_SOUND_ROUTE(0, "rdac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "rdac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
-// RAM
+// to load a different bios for slots:
+// -cbusX pc9801_86,bios=N
ROM_START( pc9801_86 )
+ ROM_REGION( 0x4000, "sound_bios", ROMREGION_ERASEFF )
+ // following roms are unchecked and of dubious quality
+ // we currently mark bios names based off where they originally belonged to, lacking of a better info
+ // supposedly these are -86 roms according to eikanwa2 sound card detection,
+ // loading a -26 rom in a -86 environment causes an hang there.
+ ROM_SYSTEM_BIOS( 0, "86rx", "nec86rx" )
+ ROMX_LOAD( "sound_rx.rom", 0x0000, 0x4000, BAD_DUMP CRC(fe9f57f2) SHA1(d5dbc4fea3b8367024d363f5351baecd6adcd8ef), ROM_BIOS(1) )
+ ROM_SYSTEM_BIOS( 1, "86mu", "nec86mu" )
+ ROMX_LOAD( "sound_486mu.rom", 0x0000, 0x4000, BAD_DUMP CRC(6cdfa793) SHA1(4b8250f9b9db66548b79f961d61010558d6d6e1c), ROM_BIOS(2) )
+
+ // RAM
ROM_REGION( 0x100000, "opna", ROMREGION_ERASE00 )
ROM_END
@@ -170,6 +182,12 @@ void pc9801_86_device::install_device(offs_t start, offs_t end, read8_delegate r
void pc9801_86_device::device_start()
{
+ m_bus->program_space().install_rom(0xcc000,0xcffff,memregion(this->subtag("sound_bios").c_str())->base());
+ install_device(0xa460, 0xa463, read8_delegate(FUNC(pc9801_86_device::id_r), this), write8_delegate(FUNC(pc9801_86_device::mask_w), this));
+ install_device(0xa464, 0xa46f, read8_delegate(FUNC(pc9801_86_device::pcm_r), this), write8_delegate(FUNC(pc9801_86_device::pcm_w), this));
+ install_device(0xa66c, 0xa66f, read8_delegate([this](address_space &s, offs_t o, u8 mm){ return o == 2 ? m_pcm_mute : 0xff; }, "pc9801_86_mute_r"),
+ write8_delegate([this](address_space &s, offs_t o, u8 d, u8 mm){ if(o == 2) m_pcm_mute = d; }, "pc9801_86_mute_w"));
+
m_dac_timer = timer_alloc();
save_item(NAME(m_count));
save_item(NAME(m_queue));
@@ -184,11 +202,9 @@ void pc9801_86_device::device_start()
void pc9801_86_device::device_reset()
{
uint16_t port_base = (ioport("OPNA_DSW")->read() & 1) << 8;
- install_device(port_base + 0x0088, port_base + 0x008f, read8_delegate(FUNC(pc9801_86_device::opn_r), this), write8_delegate(FUNC(pc9801_86_device::opn_w), this) );
- install_device(0xa460, 0xa463, read8_delegate(FUNC(pc9801_86_device::id_r), this), write8_delegate(FUNC(pc9801_86_device::mask_w), this));
- install_device(0xa464, 0xa46f, read8_delegate(FUNC(pc9801_86_device::pcm_r), this), write8_delegate(FUNC(pc9801_86_device::pcm_w), this));
- install_device(0xa66c, 0xa66f, read8_delegate([this](address_space &s, offs_t o, u8 mm){ return o == 2 ? m_pcm_mute : 0xff; }, "pc9801_86_mute_r"),
- write8_delegate([this](address_space &s, offs_t o, u8 d, u8 mm){ if(o == 2) m_pcm_mute = d; }, "pc9801_86_mute_w"));
+ m_bus->io_space().unmap_readwrite(0x0088, 0x008f, 0x100);
+ install_device(port_base + 0x0088, port_base + 0x008f, read8_delegate(FUNC(pc9801_86_device::opna_r), this), write8_delegate(FUNC(pc9801_86_device::opna_w), this) );
+
m_mask = 0;
m_head = m_tail = m_count = 0;
m_fmirq = m_pcmirq = m_init = false;
@@ -205,7 +221,7 @@ void pc9801_86_device::device_reset()
//**************************************************************************
-READ8_MEMBER(pc9801_86_device::opn_r)
+READ8_MEMBER(pc9801_86_device::opna_r)
{
if((offset & 1) == 0)
return m_opna->read(space, offset >> 1);
@@ -216,7 +232,7 @@ READ8_MEMBER(pc9801_86_device::opn_r)
}
}
-WRITE8_MEMBER(pc9801_86_device::opn_w)
+WRITE8_MEMBER(pc9801_86_device::opna_w)
{
if((offset & 1) == 0)
m_opna->write(space, offset >> 1,data);
diff --git a/src/devices/bus/cbus/pc9801_86.h b/src/devices/bus/cbus/pc9801_86.h
index a4711f08462..4a1551ef07c 100644
--- a/src/devices/bus/cbus/pc9801_86.h
+++ b/src/devices/bus/cbus/pc9801_86.h
@@ -27,8 +27,8 @@ public:
// construction/destruction
pc9801_86_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- DECLARE_READ8_MEMBER(opn_r);
- DECLARE_WRITE8_MEMBER(opn_w);
+ DECLARE_READ8_MEMBER(opna_r);
+ DECLARE_WRITE8_MEMBER(opna_w);
DECLARE_READ8_MEMBER(id_r);
DECLARE_WRITE8_MEMBER(mask_w);
DECLARE_READ8_MEMBER(pcm_r);
diff --git a/src/devices/bus/cbus/pc9801_cbus.h b/src/devices/bus/cbus/pc9801_cbus.h
index 51787dec1ae..4b5dba8fa76 100644
--- a/src/devices/bus/cbus/pc9801_cbus.h
+++ b/src/devices/bus/cbus/pc9801_cbus.h
@@ -81,6 +81,7 @@ public:
// configuration access
template<int I, class Object> devcb_base &set_int_callback(Object &&cb) { return m_int_callback[I].set_callback(std::forward<Object>(cb)); }
+ address_space &program_space() const { return m_cpu->space(AS_PROGRAM); }
address_space &io_space() const { return m_cpu->space(AS_IO); }
template<int I> void int_w(bool state) { m_int_callback[I](state); }