mirror of
https://github.com/holub/mame
synced 2025-10-05 00:38:58 +03:00
electron: Added Rombox, Rombox+ expansion devices, and electron_rom software list.
This commit is contained in:
parent
a04c3c4a7c
commit
8cd0b2545e
@ -728,6 +728,10 @@ if (BUSES["ELECTRON"]~=null) then
|
||||
MAME_DIR .. "src/devices/bus/electron/plus3.h",
|
||||
MAME_DIR .. "src/devices/bus/electron/pwrjoy.cpp",
|
||||
MAME_DIR .. "src/devices/bus/electron/pwrjoy.h",
|
||||
MAME_DIR .. "src/devices/bus/electron/rombox.cpp",
|
||||
MAME_DIR .. "src/devices/bus/electron/rombox.h",
|
||||
MAME_DIR .. "src/devices/bus/electron/romboxp.cpp",
|
||||
MAME_DIR .. "src/devices/bus/electron/romboxp.h",
|
||||
MAME_DIR .. "src/devices/bus/electron/m2105.cpp",
|
||||
MAME_DIR .. "src/devices/bus/electron/m2105.h",
|
||||
}
|
||||
|
@ -106,22 +106,21 @@ void electron_expansion_slot_device::device_reset()
|
||||
#include "plus1.h"
|
||||
#include "plus3.h"
|
||||
#include "pwrjoy.h"
|
||||
//#include "rombox.h"
|
||||
//#include "romboxp.h"
|
||||
#include "rombox.h"
|
||||
#include "romboxp.h"
|
||||
#include "m2105.h"
|
||||
//#include "voxbox.h"
|
||||
|
||||
|
||||
SLOT_INTERFACE_START( electron_expansion_devices )
|
||||
//SLOT_INTERFACE("ap1", ELECTRON_AP1)
|
||||
SLOT_INTERFACE("fbjoy", ELECTRON_FBJOY)
|
||||
//SLOT_INTERFACE("fbprint", ELECTRON_FBPRINT)
|
||||
//SLOT_INTERFACE("jafamode7", ELECTRON_JAFAMODE7)
|
||||
SLOT_INTERFACE("plus1", ELECTRON_PLUS1)
|
||||
SLOT_INTERFACE("plus3", ELECTRON_PLUS3)
|
||||
SLOT_INTERFACE("pwrjoy", ELECTRON_PWRJOY)
|
||||
//SLOT_INTERFACE("rombox", ELECTRON_ROMBOX)
|
||||
//SLOT_INTERFACE("romboxp", ELECTRON_ROMBOXP)
|
||||
SLOT_INTERFACE("rombox", ELECTRON_ROMBOX)
|
||||
SLOT_INTERFACE("romboxp", ELECTRON_ROMBOXP)
|
||||
SLOT_INTERFACE("m2105", ELECTRON_M2105)
|
||||
//SLOT_INTERFACE("voxbox", ELECTRON_VOXBOX)
|
||||
SLOT_INTERFACE_END
|
||||
|
179
src/devices/bus/electron/rombox.cpp
Normal file
179
src/devices/bus/electron/rombox.cpp
Normal file
@ -0,0 +1,179 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Nigel Barnes
|
||||
/**********************************************************************
|
||||
|
||||
Slogger Rombox
|
||||
|
||||
The Rombox offers the following facilities
|
||||
- 8 Sideways ROM / RAM slots
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
|
||||
#include "emu.h"
|
||||
#include "rombox.h"
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// DEVICE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
DEFINE_DEVICE_TYPE(ELECTRON_ROMBOX, electron_rombox_device, "electron_rombox", "Slogger Rombox")
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// MACHINE_DRIVER( rombox )
|
||||
//-------------------------------------------------
|
||||
|
||||
static INPUT_PORTS_START( rombox )
|
||||
PORT_START("OPTION")
|
||||
PORT_CONFNAME(0x01, 0x00, "A1") // not implemented
|
||||
PORT_CONFSETTING(0x00, "ROM")
|
||||
PORT_CONFSETTING(0x01, "RAM")
|
||||
PORT_CONFNAME(0x02, 0x00, "A2") // not implemented
|
||||
PORT_CONFSETTING(0x00, "8K or 16K")
|
||||
PORT_CONFSETTING(0x01, "4K")
|
||||
PORT_CONFNAME(0x04, 0x00, "B")
|
||||
PORT_CONFSETTING(0x00, "ROM 0,1,2,3")
|
||||
PORT_CONFSETTING(0x02, "ROM 12,13,14,15")
|
||||
INPUT_PORTS_END
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_add_mconfig - add device configuration
|
||||
//-------------------------------------------------
|
||||
|
||||
ioport_constructor electron_rombox_device::device_input_ports() const
|
||||
{
|
||||
return INPUT_PORTS_NAME( rombox );
|
||||
}
|
||||
|
||||
MACHINE_CONFIG_MEMBER( electron_rombox_device::device_add_mconfig )
|
||||
/* rom sockets */
|
||||
MCFG_GENERIC_SOCKET_ADD("rom1", generic_plain_slot, "electron_rom")
|
||||
MCFG_GENERIC_EXTENSIONS("bin,rom")
|
||||
MCFG_GENERIC_LOAD(electron_rombox_device, rom1_load)
|
||||
MCFG_GENERIC_SOCKET_ADD("rom2", generic_plain_slot, "electron_rom")
|
||||
MCFG_GENERIC_EXTENSIONS("bin,rom")
|
||||
MCFG_GENERIC_LOAD(electron_rombox_device, rom2_load)
|
||||
MCFG_GENERIC_SOCKET_ADD("rom3", generic_plain_slot, "electron_rom")
|
||||
MCFG_GENERIC_EXTENSIONS("bin,rom")
|
||||
MCFG_GENERIC_LOAD(electron_rombox_device, rom3_load)
|
||||
MCFG_GENERIC_SOCKET_ADD("rom4", generic_plain_slot, "electron_rom")
|
||||
MCFG_GENERIC_EXTENSIONS("bin,rom")
|
||||
MCFG_GENERIC_LOAD(electron_rombox_device, rom4_load)
|
||||
MCFG_GENERIC_SOCKET_ADD("rom5", generic_plain_slot, "electron_rom")
|
||||
MCFG_GENERIC_EXTENSIONS("bin,rom")
|
||||
MCFG_GENERIC_LOAD(electron_rombox_device, rom5_load)
|
||||
MCFG_GENERIC_SOCKET_ADD("rom6", generic_plain_slot, "electron_rom")
|
||||
MCFG_GENERIC_EXTENSIONS("bin,rom")
|
||||
MCFG_GENERIC_LOAD(electron_rombox_device, rom6_load)
|
||||
MCFG_GENERIC_SOCKET_ADD("rom7", generic_plain_slot, "electron_rom")
|
||||
MCFG_GENERIC_EXTENSIONS("bin,rom")
|
||||
MCFG_GENERIC_LOAD(electron_rombox_device, rom7_load)
|
||||
MCFG_GENERIC_SOCKET_ADD("rom8", generic_plain_slot, "electron_rom")
|
||||
MCFG_GENERIC_EXTENSIONS("bin,rom")
|
||||
MCFG_GENERIC_LOAD(electron_rombox_device, rom8_load)
|
||||
|
||||
/* pass-through */
|
||||
MCFG_ELECTRON_PASSTHRU_EXPANSION_SLOT_ADD(nullptr)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
//**************************************************************************
|
||||
// LIVE DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// electron_rombox_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
electron_rombox_device::electron_rombox_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: device_t(mconfig, ELECTRON_ROMBOX, tag, owner, clock),
|
||||
device_electron_expansion_interface(mconfig, *this),
|
||||
m_rom1(*this, "rom1"),
|
||||
m_rom2(*this, "rom2"),
|
||||
m_rom3(*this, "rom3"),
|
||||
m_rom4(*this, "rom4"),
|
||||
m_rom5(*this, "rom5"),
|
||||
m_rom6(*this, "rom6"),
|
||||
m_rom7(*this, "rom7"),
|
||||
m_rom8(*this, "rom8"),
|
||||
m_option(*this, "OPTION")
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
||||
void electron_rombox_device::device_start()
|
||||
{
|
||||
m_slot = dynamic_cast<electron_expansion_slot_device *>(owner());
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset - device-specific reset
|
||||
//-------------------------------------------------
|
||||
|
||||
void electron_rombox_device::device_reset()
|
||||
{
|
||||
std::string region_tag;
|
||||
memory_region *tmp_reg;
|
||||
int rom_base;
|
||||
|
||||
rom_base = 4;
|
||||
if (m_rom1 && (tmp_reg = memregion(region_tag.assign(m_rom1->tag()).append(GENERIC_ROM_REGION_TAG).c_str())))
|
||||
{
|
||||
machine().root_device().membank("bank2")->configure_entry(rom_base + 0, tmp_reg->base());
|
||||
}
|
||||
if (m_rom2 && (tmp_reg = memregion(region_tag.assign(m_rom2->tag()).append(GENERIC_ROM_REGION_TAG).c_str())))
|
||||
{
|
||||
machine().root_device().membank("bank2")->configure_entry(rom_base + 1, tmp_reg->base());
|
||||
}
|
||||
if (m_rom3 && (tmp_reg = memregion(region_tag.assign(m_rom3->tag()).append(GENERIC_ROM_REGION_TAG).c_str())))
|
||||
{
|
||||
machine().root_device().membank("bank2")->configure_entry(rom_base + 2, tmp_reg->base());
|
||||
}
|
||||
if (m_rom4 && (tmp_reg = memregion(region_tag.assign(m_rom4->tag()).append(GENERIC_ROM_REGION_TAG).c_str())))
|
||||
{
|
||||
machine().root_device().membank("bank2")->configure_entry(rom_base + 3, tmp_reg->base());
|
||||
}
|
||||
|
||||
rom_base = (m_option->read() & 0x04) ? 0 : 12;
|
||||
if (m_rom5 && (tmp_reg = memregion(region_tag.assign(m_rom5->tag()).append(GENERIC_ROM_REGION_TAG).c_str())))
|
||||
{
|
||||
machine().root_device().membank("bank2")->configure_entry(rom_base + 0, tmp_reg->base());
|
||||
}
|
||||
if (m_rom6 && (tmp_reg = memregion(region_tag.assign(m_rom6->tag()).append(GENERIC_ROM_REGION_TAG).c_str())))
|
||||
{
|
||||
machine().root_device().membank("bank2")->configure_entry(rom_base + 1, tmp_reg->base());
|
||||
}
|
||||
if (m_rom7 && (tmp_reg = memregion(region_tag.assign(m_rom7->tag()).append(GENERIC_ROM_REGION_TAG).c_str())))
|
||||
{
|
||||
machine().root_device().membank("bank2")->configure_entry(rom_base + 2, tmp_reg->base());
|
||||
}
|
||||
if (m_rom8 && (tmp_reg = memregion(region_tag.assign(m_rom8->tag()).append(GENERIC_ROM_REGION_TAG).c_str())))
|
||||
{
|
||||
machine().root_device().membank("bank2")->configure_entry(rom_base + 3, tmp_reg->base());
|
||||
}
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
// IMPLEMENTATION
|
||||
//**************************************************************************
|
||||
|
||||
image_init_result electron_rombox_device::load_rom(device_image_interface &image, generic_slot_device *slot)
|
||||
{
|
||||
uint32_t size = slot->common_get_size("rom");
|
||||
|
||||
// socket accepts 8K and 16K ROM only
|
||||
if (size != 0x2000 && size != 0x4000)
|
||||
{
|
||||
image.seterror(IMAGE_ERROR_UNSPECIFIED, "Invalid size: Only 8K/16K is supported");
|
||||
return image_init_result::FAIL;
|
||||
}
|
||||
|
||||
slot->rom_alloc(size, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE);
|
||||
slot->common_load_rom(slot->get_rom_base(), size, "rom");
|
||||
|
||||
return image_init_result::PASS;
|
||||
}
|
65
src/devices/bus/electron/rombox.h
Normal file
65
src/devices/bus/electron/rombox.h
Normal file
@ -0,0 +1,65 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Nigel Barnes
|
||||
/**********************************************************************
|
||||
|
||||
Slogger Rombox
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
|
||||
#ifndef MAME_BUS_ELECTRON_ROMBOX_H
|
||||
#define MAME_BUS_ELECTRON_ROMBOX_H
|
||||
|
||||
#include "exp.h"
|
||||
#include "bus/generic/slot.h"
|
||||
#include "bus/generic/carts.h"
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
class electron_rombox_device:
|
||||
public device_t,
|
||||
public device_electron_expansion_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
electron_rombox_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
// optional information overrides
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
virtual ioport_constructor device_input_ports() const override;
|
||||
|
||||
private:
|
||||
image_init_result load_rom(device_image_interface &image, generic_slot_device *slot);
|
||||
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(rom1_load) { return load_rom(image, m_rom1); }
|
||||
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(rom2_load) { return load_rom(image, m_rom2); }
|
||||
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(rom3_load) { return load_rom(image, m_rom3); }
|
||||
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(rom4_load) { return load_rom(image, m_rom4); }
|
||||
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(rom5_load) { return load_rom(image, m_rom5); }
|
||||
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(rom6_load) { return load_rom(image, m_rom6); }
|
||||
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(rom7_load) { return load_rom(image, m_rom7); }
|
||||
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(rom8_load) { return load_rom(image, m_rom8); }
|
||||
|
||||
required_device<generic_slot_device> m_rom1;
|
||||
required_device<generic_slot_device> m_rom2;
|
||||
required_device<generic_slot_device> m_rom3;
|
||||
required_device<generic_slot_device> m_rom4;
|
||||
required_device<generic_slot_device> m_rom5;
|
||||
required_device<generic_slot_device> m_rom6;
|
||||
required_device<generic_slot_device> m_rom7;
|
||||
required_device<generic_slot_device> m_rom8;
|
||||
required_ioport m_option;
|
||||
};
|
||||
|
||||
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE(ELECTRON_ROMBOX, electron_rombox_device)
|
||||
|
||||
|
||||
#endif /* MAME_BUS_ELECTRON_ROMBOX_H */
|
264
src/devices/bus/electron/romboxp.cpp
Normal file
264
src/devices/bus/electron/romboxp.cpp
Normal file
@ -0,0 +1,264 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Nigel Barnes
|
||||
/**********************************************************************
|
||||
|
||||
Slogger Rombox Plus
|
||||
|
||||
The Electron Rombox+ by Slogger has been designed to be
|
||||
compatible with the Acorn Plus 1 but with the added facility to allow
|
||||
the popular ROM based software to be used on the Electron microcomputer.
|
||||
The Rombox+ offers the following facilities
|
||||
- 2 cartridge slots
|
||||
- 4 Sideways ROM / RAM slots
|
||||
- Centronics Printer interface
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
|
||||
#include "emu.h"
|
||||
#include "romboxp.h"
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// DEVICE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
DEFINE_DEVICE_TYPE(ELECTRON_ROMBOXP, electron_romboxp_device, "electron_romboxp", "Slogger Rombox+")
|
||||
|
||||
//-------------------------------------------------
|
||||
// MACHINE_DRIVER( romboxp )
|
||||
//-------------------------------------------------
|
||||
|
||||
ROM_START( romboxp )
|
||||
// Bank 12 Expansion module operating system
|
||||
ROM_REGION(0x2000, "exp_rom", 0)
|
||||
ROM_DEFAULT_BIOS("exp100")
|
||||
ROM_SYSTEM_BIOS(0, "exp100", "ROMBOX+ Expansion 1.00")
|
||||
ROMX_LOAD("romboxplus.rom", 0x0000, 0x2000, CRC(0520ab6d) SHA1(2f551bea279a64e09fd4d31024799f7459fb9938), ROM_BIOS(1))
|
||||
|
||||
ROM_SYSTEM_BIOS(1, "presap2", "PRES AP2 Support 1.23")
|
||||
ROMX_LOAD("presap2rb_123.rom", 0x0000, 0x2000, CRC(04931d2c) SHA1(84a27fd30adea4e7f7c53e7875f63cf9e6928688), ROM_BIOS(2))
|
||||
|
||||
ROM_SYSTEM_BIOS(2, "exp101", "Slogger Expansion 1.01")
|
||||
ROMX_LOAD("exprom101.rom", 0x0000, 0x2000, CRC(6f854419) SHA1(1f3e7e0c2843e1a364b4b3f96c890fe70ef03200), ROM_BIOS(3))
|
||||
|
||||
ROM_SYSTEM_BIOS(3, "exp200", "Slogger Expansion 2.00")
|
||||
ROMX_LOAD("elkexp200.rom", 0x0000, 0x2000, CRC(dee02843) SHA1(5c9b940b4ddb46e9a223160310683a32266300c8), ROM_BIOS(4))
|
||||
|
||||
ROM_SYSTEM_BIOS(4, "exp201", "Slogger Expansion 2.01")
|
||||
ROMX_LOAD("elkexp201.rom", 0x0000, 0x2000, CRC(0e896892) SHA1(4e0794f1083fe529b01bd4fa100996a533ed8b10), ROM_BIOS(5))
|
||||
|
||||
ROM_SYSTEM_BIOS(5, "exp202", "Slogger Expansion 2.02")
|
||||
ROMX_LOAD("elkexp202.rom", 0x0000, 0x2000, CRC(32b440be) SHA1(dbc73e8d919c5615d0241d99db60e06324e16c86), ROM_BIOS(6))
|
||||
|
||||
ROM_SYSTEM_BIOS(6, "exp210", "Slogger Expansion 2.10 (dev)")
|
||||
ROMX_LOAD("elkexp210.rom", 0x0000, 0x2000, CRC(12442575) SHA1(eb8609991a9a8fb017b8100bfca4248d65faeea8), ROM_BIOS(7))
|
||||
ROM_END
|
||||
|
||||
|
||||
static INPUT_PORTS_START( romboxp )
|
||||
PORT_START("OPTION")
|
||||
PORT_CONFNAME(0x01, 0x01, "A1") // not implemented
|
||||
PORT_CONFSETTING(0x00, "RAM")
|
||||
PORT_CONFSETTING(0x01, "ROM")
|
||||
PORT_CONFNAME(0x02, 0x02, "A2")
|
||||
PORT_CONFSETTING(0x00, "ROM 12-15")
|
||||
PORT_CONFSETTING(0x02, "ROM 4-7")
|
||||
INPUT_PORTS_END
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_add_mconfig - add device configuration
|
||||
//-------------------------------------------------
|
||||
|
||||
ioport_constructor electron_romboxp_device::device_input_ports() const
|
||||
{
|
||||
return INPUT_PORTS_NAME( romboxp );
|
||||
}
|
||||
|
||||
MACHINE_CONFIG_MEMBER( electron_romboxp_device::device_add_mconfig )
|
||||
/* printer */
|
||||
MCFG_CENTRONICS_ADD("centronics", centronics_devices, "printer")
|
||||
MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(electron_romboxp_device, busy_w))
|
||||
MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics")
|
||||
|
||||
/* rom sockets */
|
||||
MCFG_GENERIC_SOCKET_ADD("rom1", generic_plain_slot, "electron_rom") // ROM SLOT 4/12
|
||||
MCFG_GENERIC_EXTENSIONS("bin,rom")
|
||||
MCFG_GENERIC_LOAD(electron_romboxp_device, rom1_load)
|
||||
MCFG_GENERIC_SOCKET_ADD("rom2", generic_plain_slot, "electron_rom") // ROM SLOT 5/13
|
||||
MCFG_GENERIC_EXTENSIONS("bin,rom")
|
||||
MCFG_GENERIC_LOAD(electron_romboxp_device, rom2_load)
|
||||
MCFG_GENERIC_SOCKET_ADD("rom3", generic_plain_slot, "electron_rom") // ROM SLOT 6/14 also ROM/RAM
|
||||
MCFG_GENERIC_EXTENSIONS("bin,rom")
|
||||
MCFG_GENERIC_LOAD(electron_romboxp_device, rom3_load)
|
||||
MCFG_GENERIC_SOCKET_ADD("rom4", generic_plain_slot, "electron_rom") // ROM SLOT 7/15
|
||||
MCFG_GENERIC_EXTENSIONS("bin,rom")
|
||||
MCFG_GENERIC_LOAD(electron_romboxp_device, rom4_load)
|
||||
|
||||
/* cartridges */
|
||||
MCFG_GENERIC_CARTSLOT_ADD("cart_sk1", generic_plain_slot, "electron_cart") // ROM SLOT 2/3
|
||||
MCFG_GENERIC_LOAD(electron_romboxp_device, electron_cart_sk1)
|
||||
MCFG_GENERIC_CARTSLOT_ADD("cart_sk2", generic_plain_slot, "electron_cart") // ROM SLOT 0/1
|
||||
MCFG_GENERIC_LOAD(electron_romboxp_device, electron_cart_sk2)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
const tiny_rom_entry *electron_romboxp_device::device_rom_region() const
|
||||
{
|
||||
return ROM_NAME( romboxp );
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
// LIVE DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// electron_romboxp_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
electron_romboxp_device::electron_romboxp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: device_t(mconfig, ELECTRON_ROMBOXP, tag, owner, clock),
|
||||
device_electron_expansion_interface(mconfig, *this),
|
||||
m_exp_rom(*this, "exp_rom"),
|
||||
m_rom1(*this, "rom1"),
|
||||
m_rom2(*this, "rom2"),
|
||||
m_rom3(*this, "rom3"),
|
||||
m_rom4(*this, "rom4"),
|
||||
m_cart_sk1(*this, "cart_sk1"),
|
||||
m_cart_sk2(*this, "cart_sk2"),
|
||||
m_centronics(*this, "centronics"),
|
||||
m_cent_data_out(*this, "cent_data_out"),
|
||||
m_option(*this, "OPTION")
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
||||
void electron_romboxp_device::device_start()
|
||||
{
|
||||
address_space& space = machine().device("maincpu")->memory().space(AS_PROGRAM);
|
||||
m_slot = dynamic_cast<electron_expansion_slot_device *>(owner());
|
||||
|
||||
space.install_write_handler(0xfc71, 0xfc71, WRITE8_DEVICE_DELEGATE("cent_data_out", output_latch_device, write));
|
||||
space.install_read_handler(0xfc72, 0xfc72, READ8_DELEGATE(electron_romboxp_device, status_r));
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset - device-specific reset
|
||||
//-------------------------------------------------
|
||||
|
||||
void electron_romboxp_device::device_reset()
|
||||
{
|
||||
std::string region_tag;
|
||||
memory_region *tmp_reg;
|
||||
|
||||
int rom_base = (m_option->read() & 0x02) ? 4 : 12;
|
||||
if (m_rom1 && (tmp_reg = memregion(region_tag.assign(m_rom1->tag()).append(GENERIC_ROM_REGION_TAG).c_str())))
|
||||
{
|
||||
machine().root_device().membank("bank2")->configure_entry(rom_base + 0, tmp_reg->base());
|
||||
}
|
||||
if (m_rom2 && (tmp_reg = memregion(region_tag.assign(m_rom2->tag()).append(GENERIC_ROM_REGION_TAG).c_str())))
|
||||
{
|
||||
machine().root_device().membank("bank2")->configure_entry(rom_base + 1, tmp_reg->base());
|
||||
}
|
||||
if (m_rom3 && (tmp_reg = memregion(region_tag.assign(m_rom3->tag()).append(GENERIC_ROM_REGION_TAG).c_str())))
|
||||
{
|
||||
machine().root_device().membank("bank2")->configure_entry(rom_base + 2, tmp_reg->base());
|
||||
}
|
||||
if (m_rom4 && (tmp_reg = memregion(region_tag.assign(m_rom4->tag()).append(GENERIC_ROM_REGION_TAG).c_str())))
|
||||
{
|
||||
machine().root_device().membank("bank2")->configure_entry(rom_base + 3, tmp_reg->base());
|
||||
}
|
||||
|
||||
if (m_cart_sk2 && (tmp_reg = memregion(region_tag.assign(m_cart_sk2->tag()).append(GENERIC_ROM_REGION_TAG).c_str())))
|
||||
{
|
||||
machine().root_device().membank("bank2")->configure_entries(0, 2, tmp_reg->base(), 0x4000);
|
||||
}
|
||||
if (m_cart_sk1 && (tmp_reg = memregion(region_tag.assign(m_cart_sk1->tag()).append(GENERIC_ROM_REGION_TAG).c_str())))
|
||||
{
|
||||
machine().root_device().membank("bank2")->configure_entries(2, 2, tmp_reg->base(), 0x4000);
|
||||
}
|
||||
|
||||
machine().root_device().membank("bank2")->configure_entry(12, memregion("exp_rom")->base());
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
// IMPLEMENTATION
|
||||
//**************************************************************************
|
||||
|
||||
READ8_MEMBER(electron_romboxp_device::status_r)
|
||||
{
|
||||
// Status: b7: printer Busy
|
||||
return m_centronics_busy << 7;
|
||||
}
|
||||
|
||||
|
||||
WRITE_LINE_MEMBER(electron_romboxp_device::busy_w)
|
||||
{
|
||||
m_centronics_busy = state;
|
||||
}
|
||||
|
||||
|
||||
image_init_result electron_romboxp_device::load_rom(device_image_interface &image, generic_slot_device *slot)
|
||||
{
|
||||
uint32_t size = slot->common_get_size("rom");
|
||||
|
||||
// socket accepts 8K and 16K ROM only
|
||||
if (size != 0x2000 && size != 0x4000)
|
||||
{
|
||||
image.seterror(IMAGE_ERROR_UNSPECIFIED, "Invalid size: Only 8K/16K is supported");
|
||||
return image_init_result::FAIL;
|
||||
}
|
||||
|
||||
slot->rom_alloc(size, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE);
|
||||
slot->common_load_rom(slot->get_rom_base(), size, "rom");
|
||||
|
||||
return image_init_result::PASS;
|
||||
}
|
||||
|
||||
|
||||
image_init_result electron_romboxp_device::load_cart(device_image_interface &image, generic_slot_device *slot)
|
||||
{
|
||||
if (image.software_entry() == nullptr)
|
||||
{
|
||||
uint32_t filesize = image.length();
|
||||
|
||||
if (filesize != 16384)
|
||||
{
|
||||
image.seterror(IMAGE_ERROR_UNSPECIFIED, "Invalid size: Only 16K is supported");
|
||||
return image_init_result::FAIL;
|
||||
}
|
||||
|
||||
slot->rom_alloc(filesize, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE);
|
||||
image.fread(slot->get_rom_base(), filesize);
|
||||
return image_init_result::PASS;
|
||||
}
|
||||
else
|
||||
{
|
||||
int upsize = image.get_software_region_length("uprom");
|
||||
int losize = image.get_software_region_length("lorom");
|
||||
|
||||
if (upsize != 16384 && upsize != 0)
|
||||
{
|
||||
image.seterror(IMAGE_ERROR_UNSPECIFIED, "Invalid size for uprom");
|
||||
return image_init_result::FAIL;
|
||||
}
|
||||
|
||||
if (losize != 16384 && losize != 0)
|
||||
{
|
||||
image.seterror(IMAGE_ERROR_UNSPECIFIED, "Invalid size for lorom");
|
||||
return image_init_result::FAIL;
|
||||
}
|
||||
|
||||
slot->rom_alloc(upsize + losize, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE);
|
||||
|
||||
if (upsize)
|
||||
memcpy(slot->get_rom_base(), image.get_software_region("uprom"), upsize);
|
||||
|
||||
if (losize)
|
||||
memcpy(slot->get_rom_base() + upsize, image.get_software_region("lorom"), losize);
|
||||
|
||||
return image_init_result::PASS;
|
||||
}
|
||||
}
|
73
src/devices/bus/electron/romboxp.h
Normal file
73
src/devices/bus/electron/romboxp.h
Normal file
@ -0,0 +1,73 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Nigel Barnes
|
||||
/**********************************************************************
|
||||
|
||||
Slogger Rombox Plus
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
|
||||
#ifndef MAME_BUS_ELECTRON_ROMBOXP_H
|
||||
#define MAME_BUS_ELECTRON_ROMBOXP_H
|
||||
|
||||
#include "exp.h"
|
||||
#include "bus/centronics/ctronics.h"
|
||||
#include "bus/generic/slot.h"
|
||||
#include "bus/generic/carts.h"
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
class electron_romboxp_device:
|
||||
public device_t,
|
||||
public device_electron_expansion_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
electron_romboxp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
// optional information overrides
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
virtual const tiny_rom_entry *device_rom_region() const override;
|
||||
virtual ioport_constructor device_input_ports() const override;
|
||||
|
||||
private:
|
||||
DECLARE_READ8_MEMBER(status_r);
|
||||
DECLARE_WRITE_LINE_MEMBER(busy_w);
|
||||
|
||||
image_init_result load_rom(device_image_interface &image, generic_slot_device *slot);
|
||||
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(rom1_load) { return load_rom(image, m_rom1); }
|
||||
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(rom2_load) { return load_rom(image, m_rom2); }
|
||||
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(rom3_load) { return load_rom(image, m_rom3); }
|
||||
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(rom4_load) { return load_rom(image, m_rom4); }
|
||||
|
||||
image_init_result load_cart(device_image_interface &image, generic_slot_device *slot);
|
||||
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(electron_cart_sk1) { return load_cart(image, m_cart_sk1); }
|
||||
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(electron_cart_sk2) { return load_cart(image, m_cart_sk2); }
|
||||
|
||||
required_memory_region m_exp_rom;
|
||||
required_device<generic_slot_device> m_rom1;
|
||||
required_device<generic_slot_device> m_rom2;
|
||||
required_device<generic_slot_device> m_rom3;
|
||||
required_device<generic_slot_device> m_rom4;
|
||||
required_device<generic_slot_device> m_cart_sk1;
|
||||
required_device<generic_slot_device> m_cart_sk2;
|
||||
required_device<centronics_device> m_centronics;
|
||||
required_device<output_latch_device> m_cent_data_out;
|
||||
required_ioport m_option;
|
||||
|
||||
int m_centronics_busy;
|
||||
};
|
||||
|
||||
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE(ELECTRON_ROMBOXP, electron_romboxp_device)
|
||||
|
||||
|
||||
#endif /* MAME_BUS_ELECTRON_ROMBOXP_H */
|
@ -233,6 +233,7 @@ static MACHINE_CONFIG_START( electron )
|
||||
MCFG_SOFTWARE_LIST_ADD("cass_list", "electron_cass")
|
||||
MCFG_SOFTWARE_LIST_ADD("cart_list", "electron_cart")
|
||||
MCFG_SOFTWARE_LIST_ADD("flop_list", "electron_flop")
|
||||
MCFG_SOFTWARE_LIST_ADD("rom_list", "electron_rom")
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user