Skip to content

Commit 8ac24eb

Browse files
committed
split out hdae5000 into its own expansion board device
1 parent 85f9f0f commit 8ac24eb

File tree

6 files changed

+275
-53
lines changed

6 files changed

+275
-53
lines changed

scripts/src/bus.lua

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2318,6 +2318,21 @@ if (BUSES["SS50"]~=null) then
23182318
end
23192319

23202320

2321+
---------------------------------------------------
2322+
--
2323+
--@src/devices/bus/technics/hdae5000.h,BUSES["TECHNICS"] = true
2324+
---------------------------------------------------
2325+
2326+
if (BUSES["TECHNICS"]~=null) then
2327+
files {
2328+
MAME_DIR .. "src/devices/bus/technics/kn5000_extension.cpp",
2329+
MAME_DIR .. "src/devices/bus/technics/kn5000_extension.h",
2330+
MAME_DIR .. "src/devices/bus/technics/hdae5000.cpp",
2331+
MAME_DIR .. "src/devices/bus/technics/hdae5000.h",
2332+
}
2333+
end
2334+
2335+
23212336
---------------------------------------------------
23222337
--
23232338
--@src/devices/bus/tiki100/exp.h,BUSES["TIKI100"] = true

src/devices/bus/technics/hdae5000.cpp

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
// license:BSD-3-Clause
2+
// copyright-holders:Antoine Mine, Olivier Galibert, Felipe Sanches
3+
//
4+
// HD-AE5000, Hard Disk & Audio Extension for Technics KN5000 emulation
5+
//
6+
// The HD-AE5000 was an extension board for the Technics KN5000 musical keyboard.
7+
// It provided a hard-disk, additional audio outputs and a serial port to interface
8+
// with a computer to transfer files to/from the hard-drive.
9+
10+
#include "emu.h"
11+
#include "hdae5000.h"
12+
13+
DEFINE_DEVICE_TYPE(HDAE5000, hdae5000_device, "hdae5000", "HD-AE5000, Hard Disk & Audio Extension")
14+
15+
hdae5000_device::hdae5000_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
16+
device_t(mconfig, HDAE5000, tag, owner, clock)
17+
, kn5000_extension_interface(mconfig, *this)
18+
, m_hdd(*this, "hdd")
19+
, m_ppi(*this, "ppi")
20+
, m_rom(*this, "rom")
21+
{
22+
}
23+
24+
ROM_START(hdae5000)
25+
ROM_REGION16_LE(0x80000, "rom" , 0)
26+
ROM_DEFAULT_BIOS("v2.01i")
27+
28+
ROM_SYSTEM_BIOS(0, "v1.10i", "Version 1.10i - July 6th, 1998")
29+
ROMX_LOAD("hd-ae5000_v1_10i.ic4", 0x000000, 0x80000, CRC(7461374b) SHA1(6019f3c28b6277730418974dde4dc6893fced00e), ROM_BIOS(0))
30+
31+
ROM_SYSTEM_BIOS(1, "v1.15i", "Version 1.15i - October 13th, 1998")
32+
ROMX_LOAD("hd-ae5000_v1_15i.ic4", 0x000000, 0x80000, CRC(e76d4b9f) SHA1(581fa58e2cd6fe381cfc312c73771d25ff2e662c), ROM_BIOS(1))
33+
34+
// Version 2.01i is described as having "additions like lyrics display etc."
35+
ROM_SYSTEM_BIOS(2, "v2.01i", "Version 2.01i - January 15th, 1999") // installation file indicated "v2.0i" but signature inside the ROM is "v2.01i"
36+
ROMX_LOAD("hd-ae5000_v2_01i.ic4", 0x000000, 0x80000, CRC(961e6dcd) SHA1(0160c17baa7b026771872126d8146038a19ef53b), ROM_BIOS(2))
37+
ROM_END
38+
39+
void hdae5000_device::rom_map(address_map &map)
40+
{
41+
//map(0x130000, 0x13ffff).m(m_hddc, FUNC(?_device::?)); // Hard-drive Controller (model?) IC? on HD-AE5000 board
42+
//map(0x160000, 0x16ffff) ... Optional parallel port interface (NEC uPD71055) IC9
43+
map(0x160000, 0x160000).lrw8([this](offs_t a) { return m_ppi->read(0); }, "ppi_r0", [this](offs_t a, u8 data) { m_ppi->write(0, data); }, "ppi_w0");
44+
map(0x160002, 0x160002).lrw8([this](offs_t a) { return m_ppi->read(1); }, "ppi_r1", [this](offs_t a, u8 data) { m_ppi->write(1, data); }, "ppi_w1");
45+
map(0x160004, 0x160004).lrw8([this](offs_t a) { return m_ppi->read(2); }, "ppi_r2", [this](offs_t a, u8 data) { m_ppi->write(2, data); }, "ppi_w2");
46+
map(0x160006, 0x160006).lrw8([this](offs_t a) { return m_ppi->read(3); }, "ppi_r3", [this](offs_t a, u8 data) { m_ppi->write(3, data); }, "ppi_w3");
47+
map(0x200000, 0x27ffff).ram(); //optional hsram: 2 * 256k bytes Static RAM @ IC5, IC6 (CS5)
48+
map(0x280000, 0x2fffff).rom().region(m_rom, 0); // 512k bytes FLASH ROM @ IC4 (CS5)
49+
map(0x800000, 0x8fffff).ram(); // hack <- I think this is the SRAM from the HD-AE5000 board
50+
}
51+
52+
void hdae5000_device::io_map(address_map &map)
53+
{
54+
}
55+
56+
const tiny_rom_entry *hdae5000_device::device_rom_region() const
57+
{
58+
return ROM_NAME(hdae5000);
59+
}
60+
61+
void hdae5000_device::device_add_mconfig(machine_config &config)
62+
{
63+
/* Optional Hard Disk - HD-AE5000 */
64+
IDE_HARDDISK(config, m_hdd, 0);
65+
66+
/* Optional Parallel Port */
67+
I8255(config, m_ppi); // actual chip is a NEC uPD71055 @ IC9 on the HD-AE5000 board
68+
// m_ppi->in_pa_callback().set(FUNC(?_device::ppi_in_a));
69+
// m_ppi->out_pb_callback().set(FUNC(?_device::ppi_out_b));
70+
// m_ppi->in_pc_callback().set(FUNC(?_device::ppi_in_c));
71+
// m_ppi->out_pc_callback().set(FUNC(?_device::ppi_out_c));
72+
73+
// we may later add this, for the auxiliary audio output provided by this extension board:
74+
// SPEAKER(config, "mono").front_center();
75+
}
76+
77+
void hdae5000_device::device_start()
78+
{
79+
// save_item(NAME(m_...));
80+
}
81+
82+
void hdae5000_device::device_reset()
83+
{
84+
}

src/devices/bus/technics/hdae5000.h

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// license:BSD-3-Clause
2+
// copyright-holders:Antoine Mine, Olivier Galibert, Felipe Sanches
3+
//
4+
// HD-AE5000 emulation
5+
//
6+
#ifndef MAME_BUS_HD_AE5000_H
7+
#define MAME_BUS_HD_AE5000_H
8+
9+
#include "kn5000_extension.h"
10+
#include "bus/ata/idehd.h"
11+
#include "machine/i8255.h"
12+
13+
class hdae5000_device : public device_t, public kn5000_extension_interface
14+
{
15+
public:
16+
hdae5000_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
17+
virtual ~hdae5000_device() = default;
18+
19+
virtual void rom_map(address_map &map) override;
20+
virtual void io_map(address_map &map) override;
21+
22+
protected:
23+
virtual void device_add_mconfig(machine_config &config) override;
24+
virtual void device_start() override;
25+
virtual void device_reset() override;
26+
virtual const tiny_rom_entry *device_rom_region() const override;
27+
28+
private:
29+
required_device<ide_hdd_device> m_hdd;
30+
required_device<i8255_device> m_ppi;
31+
required_memory_region m_rom;
32+
};
33+
34+
DECLARE_DEVICE_TYPE(HDAE5000, hdae5000_device)
35+
36+
#endif
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
// license:BSD-3-Clause
2+
// copyright-holders:Olivier Galibert, Felipe Sanches
3+
4+
// Generic Technics KN5000 extension slot
5+
6+
7+
#include "emu.h"
8+
#include "kn5000_extension.h"
9+
10+
DEFINE_DEVICE_TYPE(KN5000_EXTENSION, kn5000_extension_device, "kn5000_extension", "Technics KN5000 extension port")
11+
12+
kn5000_extension_device::kn5000_extension_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
13+
device_t(mconfig, KN5000_EXTENSION, tag, owner, clock),
14+
device_single_card_slot_interface<kn5000_extension_interface>(mconfig, *this)
15+
// FIXME: do we need these?
16+
// m_firq_callback(*this),
17+
// m_irq_callback(*this)
18+
{
19+
}
20+
21+
void kn5000_extension_device::rom_map(address_space_installer &space, offs_t start, offs_t end)
22+
{
23+
auto dev = get_card_device();
24+
if(dev)
25+
space.install_device(start, end, *dev, &kn5000_extension_interface::rom_map);
26+
}
27+
28+
void kn5000_extension_device::io_map(address_space_installer &space, offs_t start, offs_t end)
29+
{
30+
auto dev = get_card_device();
31+
if(dev)
32+
space.install_device(start, end, *dev, &kn5000_extension_interface::io_map);
33+
}
34+
35+
// FIXME: do we need these?
36+
//void kn5000_extension_device::device_resolve_objects()
37+
//{
38+
// m_firq_callback.resolve_safe();
39+
// m_irq_callback.resolve_safe();
40+
//}
41+
42+
void kn5000_extension_device::device_start()
43+
{
44+
}
45+
46+
kn5000_extension_interface::kn5000_extension_interface(const machine_config &mconfig, device_t &device) :
47+
device_interface(device, "extension"),
48+
m_ext(dynamic_cast<kn5000_extension_device *>(device.owner()))
49+
{
50+
}
51+
52+
// FIXME: do we need these?
53+
//WRITE_LINE_MEMBER(kn5000_extension_interface::firq_w)
54+
//{
55+
// if(m_ext)
56+
// m_ext->m_firq_callback(state);
57+
//}
58+
//
59+
//WRITE_LINE_MEMBER(kn5000_extension_interface::irq_w)
60+
//{
61+
// if(m_ext)
62+
// m_ext->m_irq_callback(state);
63+
//}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
// license:BSD-3-Clause
2+
// copyright-holders:Olivier Galibert, Felipe Sanches
3+
4+
// Generic Technics KN5000 extension slot
5+
6+
#ifndef MAME_BUS_KN5000_EXTENSION_H
7+
#define MAME_BUS_KN5000_EXTENSION_H
8+
9+
class kn5000_extension_device;
10+
11+
class kn5000_extension_interface : public device_interface
12+
{
13+
public:
14+
kn5000_extension_interface(const machine_config &mconfig, device_t &device);
15+
virtual ~kn5000_extension_interface() = default;
16+
17+
virtual void rom_map(address_map &map) = 0;
18+
19+
virtual void io_map(address_map &map) = 0;
20+
21+
// FIXME: do we need these?
22+
//protected:
23+
// DECLARE_WRITE_LINE_MEMBER(firq_w);
24+
// DECLARE_WRITE_LINE_MEMBER(irq_w);
25+
26+
private:
27+
kn5000_extension_device *const m_ext;
28+
};
29+
30+
31+
class kn5000_extension_device : public device_t, public device_single_card_slot_interface<kn5000_extension_interface>
32+
{
33+
friend class kn5000_extension_interface;
34+
35+
public:
36+
kn5000_extension_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
37+
virtual ~kn5000_extension_device() = default;
38+
39+
// FIXME: do we need these?
40+
// auto firq_callback() { return m_firq_callback.bind(); }
41+
// auto irq_callback() { return m_irq_callback.bind(); }
42+
43+
void rom_map(address_space_installer &space, offs_t start, offs_t end);
44+
void io_map(address_space_installer &space, offs_t start, offs_t end);
45+
46+
protected:
47+
// FIXME: do we need these?
48+
// virtual void device_resolve_objects() override;
49+
virtual void device_start() override;
50+
51+
// FIXME: do we need these?
52+
// devcb_write_line m_firq_callback;
53+
// devcb_write_line m_irq_callback;
54+
};
55+
56+
DECLARE_DEVICE_TYPE(KN5000_EXTENSION, kn5000_extension_device)
57+
58+
#endif

0 commit comments

Comments
 (0)