mirror of
https://github.com/holub/mame
synced 2025-04-20 23:42:22 +03:00
vtech: Rework expansion bus emulation
- Use memory taps instead of directly installing into the memory map - Use address_maps to specify address ranges - Add missing save states - Support the BennVenn SD Loader (preliminary) - Move lightpen skeleton to a device
This commit is contained in:
parent
de1f1265ba
commit
fa08c5f552
@ -4014,6 +4014,8 @@ if (BUSES["VTECH_MEMEXP"]~=null) then
|
||||
MAME_DIR .. "src/devices/bus/vtech/memexp/rs232.h",
|
||||
MAME_DIR .. "src/devices/bus/vtech/memexp/rtty.cpp",
|
||||
MAME_DIR .. "src/devices/bus/vtech/memexp/rtty.h",
|
||||
MAME_DIR .. "src/devices/bus/vtech/memexp/sdloader.cpp",
|
||||
MAME_DIR .. "src/devices/bus/vtech/memexp/sdloader.h",
|
||||
MAME_DIR .. "src/devices/bus/vtech/memexp/wordpro.cpp",
|
||||
MAME_DIR .. "src/devices/bus/vtech/memexp/wordpro.h",
|
||||
}
|
||||
@ -4030,6 +4032,8 @@ if (BUSES["VTECH_IOEXP"]~=null) then
|
||||
MAME_DIR .. "src/devices/bus/vtech/ioexp/ioexp.h",
|
||||
MAME_DIR .. "src/devices/bus/vtech/ioexp/carts.cpp",
|
||||
MAME_DIR .. "src/devices/bus/vtech/ioexp/carts.h",
|
||||
MAME_DIR .. "src/devices/bus/vtech/ioexp/lpen.cpp",
|
||||
MAME_DIR .. "src/devices/bus/vtech/ioexp/lpen.h",
|
||||
MAME_DIR .. "src/devices/bus/vtech/ioexp/joystick.cpp",
|
||||
MAME_DIR .. "src/devices/bus/vtech/ioexp/joystick.h",
|
||||
MAME_DIR .. "src/devices/bus/vtech/ioexp/printer.cpp",
|
||||
|
@ -1,5 +1,5 @@
|
||||
// license:GPL-2.0+
|
||||
// copyright-holders:Dirk Best
|
||||
// license: GPL-2.0+
|
||||
// copyright-holders: Dirk Best
|
||||
/***************************************************************************
|
||||
|
||||
VTech Laser/VZ I/O Expansion Slot
|
||||
@ -30,7 +30,7 @@ DEFINE_DEVICE_TYPE(VTECH_IOEXP_SLOT, vtech_ioexp_slot_device, "vtech_ioexp_slot"
|
||||
vtech_ioexp_slot_device::vtech_ioexp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
||||
device_t(mconfig, VTECH_IOEXP_SLOT, tag, owner, clock),
|
||||
device_single_card_slot_interface<device_vtech_ioexp_interface>(mconfig, *this),
|
||||
m_io(*this, finder_base::DUMMY_TAG, -1)
|
||||
m_iospace(*this, finder_base::DUMMY_TAG, -1)
|
||||
{
|
||||
}
|
||||
|
||||
@ -48,6 +48,24 @@ vtech_ioexp_slot_device::~vtech_ioexp_slot_device()
|
||||
|
||||
void vtech_ioexp_slot_device::device_start()
|
||||
{
|
||||
// get inserted module
|
||||
m_module = get_card_device();
|
||||
|
||||
// install io access taps
|
||||
m_iospace->install_readwrite_tap
|
||||
(
|
||||
0x00, 0xff, "io_tap",
|
||||
[this](offs_t offset, uint8_t &data, uint8_t mem_mask)
|
||||
{
|
||||
if (m_module)
|
||||
data &= m_module->iorq_r(offset);
|
||||
},
|
||||
[this](offs_t offset, uint8_t &data, uint8_t mem_mask)
|
||||
{
|
||||
if (m_module)
|
||||
m_module->iorq_w(offset, data);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -72,3 +90,52 @@ device_vtech_ioexp_interface::device_vtech_ioexp_interface(const machine_config
|
||||
device_vtech_ioexp_interface::~device_vtech_ioexp_interface()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// BASE DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// vtech_ioexp_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
vtech_ioexp_device::vtech_ioexp_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_vtech_ioexp_interface(mconfig, *this),
|
||||
m_io(*this, "iospace")
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_add_mconfig - add device configuration
|
||||
//-------------------------------------------------
|
||||
|
||||
void vtech_ioexp_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
ADDRESS_MAP_BANK(config, m_io);
|
||||
m_io->set_addrmap(AS_PROGRAM, &vtech_ioexp_device::io_map);
|
||||
m_io->set_data_width(8);
|
||||
m_io->set_addr_width(16);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
||||
void vtech_ioexp_device::device_start()
|
||||
{
|
||||
// silence unmapped warnings, or we'll get them for everything the
|
||||
// expansion device doesn't handle
|
||||
m_io->set_log_unmap(false);
|
||||
}
|
||||
|
||||
uint8_t vtech_ioexp_device::iorq_r(offs_t offset)
|
||||
{
|
||||
return m_io->read8(offset);
|
||||
}
|
||||
|
||||
void vtech_ioexp_device::iorq_w(offs_t offset, uint8_t data)
|
||||
{
|
||||
m_io->write8(offset, data);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
// license:GPL-2.0+
|
||||
// copyright-holders:Dirk Best
|
||||
// license: GPL-2.0+
|
||||
// copyright-holders: Dirk Best
|
||||
/***************************************************************************
|
||||
|
||||
VTech Laser/VZ I/O Expansion Slot
|
||||
@ -29,9 +29,12 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "machine/bankdev.h"
|
||||
|
||||
// include here so drivers don't need to
|
||||
#include "carts.h"
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
@ -54,13 +57,16 @@ public:
|
||||
vtech_ioexp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
virtual ~vtech_ioexp_slot_device();
|
||||
|
||||
template <typename T> void set_io_space(T &&tag, int spacenum) { m_io.set_tag(std::forward<T>(tag), spacenum); }
|
||||
template <typename T> void set_iospace(T &&tag, int spacenum) { m_iospace.set_tag(std::forward<T>(tag), spacenum); }
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
|
||||
required_address_space m_io;
|
||||
private:
|
||||
required_address_space m_iospace;
|
||||
|
||||
device_vtech_ioexp_interface *m_module;
|
||||
};
|
||||
|
||||
// class representing interface-specific live ioexp device
|
||||
@ -70,14 +76,35 @@ public:
|
||||
// construction/destruction
|
||||
virtual ~device_vtech_ioexp_interface();
|
||||
|
||||
virtual uint8_t iorq_r(offs_t offset) { return 0xff; }
|
||||
virtual void iorq_w(offs_t offset, uint8_t data) { }
|
||||
|
||||
protected:
|
||||
device_vtech_ioexp_interface(const machine_config &mconfig, device_t &device);
|
||||
|
||||
address_space &io_space() { return *m_slot->m_io; }
|
||||
|
||||
vtech_ioexp_slot_device *m_slot;
|
||||
};
|
||||
|
||||
// base io expansion device
|
||||
class vtech_ioexp_device : public device_t, public device_vtech_ioexp_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
vtech_ioexp_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
// from host
|
||||
virtual uint8_t iorq_r(offs_t offset) override;
|
||||
virtual void iorq_w(offs_t offset, uint8_t data) override;
|
||||
|
||||
protected:
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
virtual void device_start() override;
|
||||
|
||||
virtual void io_map(address_map &map) { };
|
||||
|
||||
required_device<address_map_bank_device> m_io;
|
||||
};
|
||||
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE(VTECH_IOEXP_SLOT, vtech_ioexp_slot_device)
|
||||
|
||||
|
@ -19,6 +19,16 @@
|
||||
|
||||
DEFINE_DEVICE_TYPE(VTECH_JOYSTICK_INTERFACE, vtech_joystick_interface_device, "vtech_joystick", "Laser/VZ Joystick Interface")
|
||||
|
||||
//-------------------------------------------------
|
||||
// io_map - memory space address map
|
||||
//-------------------------------------------------
|
||||
|
||||
void vtech_joystick_interface_device::io_map(address_map &map)
|
||||
{
|
||||
map.unmap_value_high();
|
||||
map(0x20, 0x2f).r(FUNC(vtech_joystick_interface_device::joystick_r));
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// input_ports - device-specific input ports
|
||||
//-------------------------------------------------
|
||||
@ -66,8 +76,7 @@ ioport_constructor vtech_joystick_interface_device::device_input_ports() const
|
||||
//-------------------------------------------------
|
||||
|
||||
vtech_joystick_interface_device::vtech_joystick_interface_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
||||
device_t(mconfig, VTECH_JOYSTICK_INTERFACE, tag, owner, clock),
|
||||
device_vtech_ioexp_interface(mconfig, *this),
|
||||
vtech_ioexp_device(mconfig, VTECH_JOYSTICK_INTERFACE, tag, owner, clock),
|
||||
m_joy0(*this, "joystick_0"),
|
||||
m_joy0_arm(*this, "joystick_0_arm"),
|
||||
m_joy1(*this, "joystick_1"),
|
||||
@ -81,15 +90,7 @@ vtech_joystick_interface_device::vtech_joystick_interface_device(const machine_c
|
||||
|
||||
void vtech_joystick_interface_device::device_start()
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset - device-specific reset
|
||||
//-------------------------------------------------
|
||||
|
||||
void vtech_joystick_interface_device::device_reset()
|
||||
{
|
||||
io_space().install_read_handler(0x20, 0x2f, read8sm_delegate(*this, FUNC(vtech_joystick_interface_device::joystick_r)));
|
||||
vtech_ioexp_device::device_start();
|
||||
}
|
||||
|
||||
|
||||
|
@ -21,9 +21,9 @@
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
// ======================> joystick_interface_device
|
||||
// ======================> vtech_joystick_interface_device
|
||||
|
||||
class vtech_joystick_interface_device : public device_t, public device_vtech_ioexp_interface
|
||||
class vtech_joystick_interface_device : public vtech_ioexp_device
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
@ -34,7 +34,8 @@ public:
|
||||
protected:
|
||||
virtual ioport_constructor device_input_ports() const override;
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
virtual void io_map(address_map &map) override;
|
||||
|
||||
private:
|
||||
required_ioport m_joy0;
|
||||
|
63
src/devices/bus/vtech/ioexp/lpen.cpp
Normal file
63
src/devices/bus/vtech/ioexp/lpen.cpp
Normal file
@ -0,0 +1,63 @@
|
||||
// license: GPL-2.0+
|
||||
// copyright-holders: Dirk Best
|
||||
/***************************************************************************
|
||||
|
||||
VTech Laser Lightpen Interface
|
||||
|
||||
Skeleton just to document the I/O ports used
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "lpen.h"
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// DEVICE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
DEFINE_DEVICE_TYPE(VTECH_LPEN_INTERFACE, vtech_lpen_interface_device, "vtech_lpen", "Laser/VZ Lightpen Interface")
|
||||
|
||||
//-------------------------------------------------
|
||||
// io_map - memory space address map
|
||||
//-------------------------------------------------
|
||||
|
||||
void vtech_lpen_interface_device::io_map(address_map &map)
|
||||
{
|
||||
map.unmap_value_high();
|
||||
map(0x40, 0x4f).r(FUNC(vtech_lpen_interface_device::lpen_r));
|
||||
}
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// LIVE DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// vtech_lpen_interface_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
vtech_lpen_interface_device::vtech_lpen_interface_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
||||
vtech_ioexp_device(mconfig, VTECH_LPEN_INTERFACE, tag, owner, clock)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
||||
void vtech_lpen_interface_device::device_start()
|
||||
{
|
||||
vtech_ioexp_device::device_start();
|
||||
}
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// IMPLEMENTATION
|
||||
//**************************************************************************
|
||||
|
||||
uint8_t vtech_lpen_interface_device::lpen_r(offs_t offset)
|
||||
{
|
||||
logerror("lpen_r %02x\n", offset);
|
||||
return 0xff;
|
||||
}
|
43
src/devices/bus/vtech/ioexp/lpen.h
Normal file
43
src/devices/bus/vtech/ioexp/lpen.h
Normal file
@ -0,0 +1,43 @@
|
||||
// license: GPL-2.0+
|
||||
// copyright-holders: Dirk Best
|
||||
/***************************************************************************
|
||||
|
||||
VTech Laser Lightpen Interface
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef MAME_BUS_VTECH_IOEXP_LPEN_H
|
||||
#define MAME_BUS_VTECH_IOEXP_LPEN_H
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "ioexp.h"
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
// ======================> vtech_lpen_interface_device
|
||||
|
||||
class vtech_lpen_interface_device : public vtech_ioexp_device
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
vtech_lpen_interface_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
static constexpr feature_type unemulated_features() { return feature::CONTROLS; }
|
||||
|
||||
protected:
|
||||
virtual void device_start() override;
|
||||
|
||||
virtual void io_map(address_map &map) override;
|
||||
|
||||
private:
|
||||
uint8_t lpen_r(offs_t offset);
|
||||
};
|
||||
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE(VTECH_LPEN_INTERFACE, vtech_lpen_interface_device)
|
||||
|
||||
#endif // MAME_BUS_VTECH_IOEXP_LPEN_H
|
@ -19,12 +19,26 @@
|
||||
|
||||
DEFINE_DEVICE_TYPE(VTECH_PRINTER_INTERFACE, vtech_printer_interface_device, "vtech_printer", "Laser/VZ Printer Interface")
|
||||
|
||||
//-------------------------------------------------
|
||||
// io_map - memory space address map
|
||||
//-------------------------------------------------
|
||||
|
||||
void vtech_printer_interface_device::io_map(address_map &map)
|
||||
{
|
||||
map.unmap_value_high();
|
||||
map(0x00, 0x00).r(FUNC(vtech_printer_interface_device::busy_r));
|
||||
map(0x0d, 0x0d).w(FUNC(vtech_printer_interface_device::strobe_w));
|
||||
map(0x0e, 0x0e).w(m_latch, FUNC(output_latch_device::write));
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_add_mconfig - add device configuration
|
||||
//-------------------------------------------------
|
||||
|
||||
void vtech_printer_interface_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
vtech_ioexp_device::device_add_mconfig(config);
|
||||
|
||||
CENTRONICS(config, m_centronics, centronics_devices, "printer");
|
||||
m_centronics->busy_handler().set(FUNC(vtech_printer_interface_device::busy_w));
|
||||
|
||||
@ -42,8 +56,7 @@ void vtech_printer_interface_device::device_add_mconfig(machine_config &config)
|
||||
//-------------------------------------------------
|
||||
|
||||
vtech_printer_interface_device::vtech_printer_interface_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
||||
device_t(mconfig, VTECH_PRINTER_INTERFACE, tag, owner, clock),
|
||||
device_vtech_ioexp_interface(mconfig, *this),
|
||||
vtech_ioexp_device(mconfig, VTECH_PRINTER_INTERFACE, tag, owner, clock),
|
||||
m_centronics(*this, "centronics"),
|
||||
m_latch(*this, "latch"),
|
||||
m_centronics_busy(0)
|
||||
@ -56,17 +69,10 @@ vtech_printer_interface_device::vtech_printer_interface_device(const machine_con
|
||||
|
||||
void vtech_printer_interface_device::device_start()
|
||||
{
|
||||
}
|
||||
vtech_ioexp_device::device_start();
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset - device-specific reset
|
||||
//-------------------------------------------------
|
||||
|
||||
void vtech_printer_interface_device::device_reset()
|
||||
{
|
||||
io_space().install_read_handler(0x00, 0x00, read8smo_delegate(*this, FUNC(vtech_printer_interface_device::busy_r)));
|
||||
io_space().install_write_handler(0x0d, 0x0d, write8smo_delegate(*this, FUNC(vtech_printer_interface_device::strobe_w)));
|
||||
io_space().install_write_handler(0x0e, 0x0e, write8smo_delegate(*m_latch, FUNC(output_latch_device::write)));
|
||||
// register for save states
|
||||
save_item(NAME(m_centronics_busy));
|
||||
}
|
||||
|
||||
|
||||
|
@ -21,9 +21,9 @@
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
// ======================> printer_interface_device
|
||||
// ======================> vtech_printer_interface_device
|
||||
|
||||
class vtech_printer_interface_device : public device_t, public device_vtech_ioexp_interface
|
||||
class vtech_printer_interface_device : public vtech_ioexp_device
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
@ -32,16 +32,17 @@ public:
|
||||
protected:
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
virtual void io_map(address_map &map) override;
|
||||
|
||||
private:
|
||||
required_device<centronics_device> m_centronics;
|
||||
required_device<output_latch_device> m_latch;
|
||||
|
||||
DECLARE_WRITE_LINE_MEMBER( busy_w );
|
||||
uint8_t busy_r();
|
||||
void strobe_w(uint8_t data);
|
||||
|
||||
required_device<centronics_device> m_centronics;
|
||||
required_device<output_latch_device> m_latch;
|
||||
|
||||
int m_centronics_busy;
|
||||
};
|
||||
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "memory.h"
|
||||
#include "rs232.h"
|
||||
#include "rtty.h"
|
||||
#include "sdloader.h"
|
||||
#include "wordpro.h"
|
||||
|
||||
|
||||
@ -25,5 +26,6 @@ void vtech_memexp_carts(device_slot_interface &device)
|
||||
device.option_add("laser_64k", VTECH_LASER_64K);
|
||||
device.option_add("rs232", VTECH_RS232_INTERFACE);
|
||||
device.option_add("rtty", VTECH_RTTY_INTERFACE);
|
||||
device.option_add("sdloader", VTECH_SDLOADER);
|
||||
device.option_add("wordpro", VTECH_WORDPRO);
|
||||
}
|
||||
|
@ -21,12 +21,27 @@
|
||||
|
||||
DEFINE_DEVICE_TYPE(VTECH_FLOPPY_CONTROLLER, vtech_floppy_controller_device, "vtech_fdc", "Laser/VZ Floppy Disk Controller")
|
||||
|
||||
void vtech_floppy_controller_device::map(address_map &map)
|
||||
//-------------------------------------------------
|
||||
// mem_map - memory space address map
|
||||
//-------------------------------------------------
|
||||
|
||||
void vtech_floppy_controller_device::mem_map(address_map &map)
|
||||
{
|
||||
map(0, 0).w(FUNC(vtech_floppy_controller_device::latch_w));
|
||||
map(1, 1).r(FUNC(vtech_floppy_controller_device::shifter_r));
|
||||
map(2, 2).r(FUNC(vtech_floppy_controller_device::rd_r));
|
||||
map(3, 3).r(FUNC(vtech_floppy_controller_device::wpt_r));
|
||||
map.unmap_value_high();
|
||||
map(0x4000, 0x5fff).rom().region("software", 0);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// io_map - io space address map
|
||||
//-------------------------------------------------
|
||||
|
||||
void vtech_floppy_controller_device::io_map(address_map &map)
|
||||
{
|
||||
map.unmap_value_high();
|
||||
map(0x10, 0x10).w(FUNC(vtech_floppy_controller_device::latch_w));
|
||||
map(0x11, 0x11).r(FUNC(vtech_floppy_controller_device::shifter_r));
|
||||
map(0x12, 0x12).r(FUNC(vtech_floppy_controller_device::rd_r));
|
||||
map(0x13, 0x13).r(FUNC(vtech_floppy_controller_device::wpt_r));
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
@ -34,7 +49,7 @@ void vtech_floppy_controller_device::map(address_map &map)
|
||||
//-------------------------------------------------
|
||||
|
||||
ROM_START( floppy )
|
||||
ROM_REGION(0x3000, "software", 0)
|
||||
ROM_REGION(0x2000, "software", 0)
|
||||
ROM_LOAD("vzdos.rom", 0x0000, 0x2000, CRC(b6ed6084) SHA1(59d1cbcfa6c5e1906a32704fbf0d9670f0d1fd8b))
|
||||
ROM_END
|
||||
|
||||
@ -61,7 +76,12 @@ void vtech_floppy_controller_device::floppy_formats(format_registration &fr)
|
||||
|
||||
void vtech_floppy_controller_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
vtech_memexp_device::device_add_mconfig(config);
|
||||
|
||||
VTECH_MEMEXP_SLOT(config, m_memexp);
|
||||
m_memexp->set_memspace(m_mem, AS_PROGRAM);
|
||||
m_memexp->set_iospace(m_io, AS_PROGRAM);
|
||||
|
||||
FLOPPY_CONNECTOR(config, m_floppy0, laser_floppies, "525", floppy_formats);
|
||||
FLOPPY_CONNECTOR(config, m_floppy1, laser_floppies, "525", floppy_formats);
|
||||
}
|
||||
@ -76,8 +96,7 @@ void vtech_floppy_controller_device::device_add_mconfig(machine_config &config)
|
||||
//-------------------------------------------------
|
||||
|
||||
vtech_floppy_controller_device::vtech_floppy_controller_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
||||
device_t(mconfig, VTECH_FLOPPY_CONTROLLER, tag, owner, clock),
|
||||
device_vtech_memexp_interface(mconfig, *this),
|
||||
vtech_memexp_device(mconfig, VTECH_FLOPPY_CONTROLLER, tag, owner, clock),
|
||||
m_memexp(*this, "mem"),
|
||||
m_floppy0(*this, "0"),
|
||||
m_floppy1(*this, "1"),
|
||||
@ -91,6 +110,9 @@ vtech_floppy_controller_device::vtech_floppy_controller_device(const machine_con
|
||||
|
||||
void vtech_floppy_controller_device::device_start()
|
||||
{
|
||||
vtech_memexp_device::device_start();
|
||||
|
||||
// register for save states
|
||||
save_item(NAME(m_latch));
|
||||
save_item(NAME(m_shifter));
|
||||
save_item(NAME(m_latching_inverter));
|
||||
@ -101,13 +123,11 @@ void vtech_floppy_controller_device::device_start()
|
||||
|
||||
// TODO: save m_write_buffer and rebuild m_floppy after load
|
||||
|
||||
uint8_t *bios = memregion("software")->base();
|
||||
|
||||
// Obvious bugs... must have worked by sheer luck and very subtle
|
||||
// timings. Our current z80 is not subtle enough.
|
||||
|
||||
bios[0x1678] = 0x75;
|
||||
bios[0x1688] = 0x85;
|
||||
uint8_t *rom = memregion("software")->base();
|
||||
rom[0x1678] = 0x75;
|
||||
rom[0x1688] = 0x85;
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
@ -116,10 +136,6 @@ void vtech_floppy_controller_device::device_start()
|
||||
|
||||
void vtech_floppy_controller_device::device_reset()
|
||||
{
|
||||
program_space().install_rom(0x4000, 0x5fff, memregion("software")->base());
|
||||
|
||||
io_space().install_device(0x10, 0x1f, *this, &vtech_floppy_controller_device::map);
|
||||
|
||||
m_latch = 0x00;
|
||||
m_floppy = nullptr;
|
||||
m_current_cyl = 0;
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
// ======================> vtech_floppy_controller_device
|
||||
|
||||
class vtech_floppy_controller_device : public device_t, public device_vtech_memexp_interface
|
||||
class vtech_floppy_controller_device : public vtech_memexp_device
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
@ -36,8 +36,15 @@ protected:
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
virtual void mem_map(address_map &map) override;
|
||||
virtual void io_map(address_map &map) override;
|
||||
|
||||
private:
|
||||
void map(address_map &map);
|
||||
required_device<vtech_memexp_slot_device> m_memexp;
|
||||
required_device<floppy_connector> m_floppy0, m_floppy1;
|
||||
floppy_image_device *m_floppy;
|
||||
|
||||
static void floppy_formats(format_registration &fr);
|
||||
|
||||
void latch_w(uint8_t data);
|
||||
uint8_t shifter_r();
|
||||
@ -48,12 +55,6 @@ private:
|
||||
void update_latching_inverter();
|
||||
void flush_writes(bool keep_margin = false);
|
||||
|
||||
static void floppy_formats(format_registration &fr);
|
||||
|
||||
required_device<vtech_memexp_slot_device> m_memexp;
|
||||
required_device<floppy_connector> m_floppy0, m_floppy1;
|
||||
floppy_image_device *m_floppy;
|
||||
|
||||
uint8_t m_latch, m_shifter;
|
||||
bool m_latching_inverter;
|
||||
int m_current_cyl;
|
||||
|
@ -1,5 +1,5 @@
|
||||
// license:GPL-2.0+
|
||||
// copyright-holders:Dirk Best
|
||||
// license: GPL-2.0+
|
||||
// copyright-holders: Dirk Best
|
||||
/***************************************************************************
|
||||
|
||||
VTech Laser/VZ Memory Expansion Slot
|
||||
@ -30,8 +30,8 @@ DEFINE_DEVICE_TYPE(VTECH_MEMEXP_SLOT, vtech_memexp_slot_device, "vtech_memexp_sl
|
||||
vtech_memexp_slot_device::vtech_memexp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
||||
device_t(mconfig, VTECH_MEMEXP_SLOT, tag, owner, clock),
|
||||
device_single_card_slot_interface<device_vtech_memexp_interface>(mconfig, *this),
|
||||
m_program(*this, finder_base::DUMMY_TAG, -1),
|
||||
m_io(*this, finder_base::DUMMY_TAG, -1),
|
||||
m_memspace(*this, finder_base::DUMMY_TAG, -1),
|
||||
m_iospace(*this, finder_base::DUMMY_TAG, -1),
|
||||
m_int_handler(*this),
|
||||
m_nmi_handler(*this),
|
||||
m_reset_handler(*this)
|
||||
@ -46,34 +46,47 @@ vtech_memexp_slot_device::~vtech_memexp_slot_device()
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_config_complete - perform any
|
||||
// operations now that the configuration is
|
||||
// complete
|
||||
//-------------------------------------------------
|
||||
|
||||
void vtech_memexp_slot_device::device_config_complete()
|
||||
{
|
||||
// for passthrough connectors, use the parent slot's spaces
|
||||
if (dynamic_cast<device_vtech_memexp_interface *>(owner()) != nullptr)
|
||||
{
|
||||
auto parent = dynamic_cast<vtech_memexp_slot_device *>(owner()->owner());
|
||||
if (parent != nullptr)
|
||||
{
|
||||
if (m_program.finder_tag() == finder_base::DUMMY_TAG)
|
||||
m_program.set_tag(parent->m_program, parent->m_program.spacenum());
|
||||
if (m_io.finder_tag() == finder_base::DUMMY_TAG)
|
||||
m_io.set_tag(parent->m_io, parent->m_io.spacenum());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
||||
void vtech_memexp_slot_device::device_start()
|
||||
{
|
||||
// get inserted module
|
||||
m_module = get_card_device();
|
||||
|
||||
// install memory access taps
|
||||
m_memspace->install_readwrite_tap
|
||||
(
|
||||
0x0000, 0xffff, "mem_tap",
|
||||
[this](offs_t offset, uint8_t &data, uint8_t mem_mask)
|
||||
{
|
||||
if (m_module)
|
||||
data &= m_module->mreq_r(offset);
|
||||
},
|
||||
[this](offs_t offset, uint8_t &data, uint8_t mem_mask)
|
||||
{
|
||||
if (m_module)
|
||||
m_module->mreq_w(offset, data);
|
||||
}
|
||||
);
|
||||
|
||||
// install io access taps
|
||||
m_iospace->install_readwrite_tap
|
||||
(
|
||||
0x00, 0xff, "io_tap",
|
||||
[this](offs_t offset, uint8_t &data, uint8_t mem_mask)
|
||||
{
|
||||
if (m_module)
|
||||
data &= m_module->iorq_r(offset);
|
||||
},
|
||||
[this](offs_t offset, uint8_t &data, uint8_t mem_mask)
|
||||
{
|
||||
if (m_module)
|
||||
m_module->iorq_w(offset, data);
|
||||
}
|
||||
);
|
||||
|
||||
// resolve callbacks
|
||||
m_int_handler.resolve_safe();
|
||||
m_nmi_handler.resolve_safe();
|
||||
@ -102,3 +115,69 @@ device_vtech_memexp_interface::device_vtech_memexp_interface(const machine_confi
|
||||
device_vtech_memexp_interface::~device_vtech_memexp_interface()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// BASE DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// vtech_memexp_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
vtech_memexp_device::vtech_memexp_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_vtech_memexp_interface(mconfig, *this),
|
||||
m_mem(*this, "memspace"),
|
||||
m_io(*this, "iospace")
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_add_mconfig - add device configuration
|
||||
//-------------------------------------------------
|
||||
|
||||
void vtech_memexp_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
ADDRESS_MAP_BANK(config, m_mem);
|
||||
m_mem->set_addrmap(AS_PROGRAM, &vtech_memexp_device::mem_map);
|
||||
m_mem->set_data_width(8);
|
||||
m_mem->set_addr_width(16);
|
||||
|
||||
ADDRESS_MAP_BANK(config, m_io);
|
||||
m_io->set_addrmap(AS_PROGRAM, &vtech_memexp_device::io_map);
|
||||
m_io->set_data_width(8);
|
||||
m_io->set_addr_width(16);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
||||
void vtech_memexp_device::device_start()
|
||||
{
|
||||
// silence unmapped warnings, or we'll get them for everything the
|
||||
// expansion device doesn't handle
|
||||
m_mem->set_log_unmap(false);
|
||||
m_io->set_log_unmap(false);
|
||||
}
|
||||
|
||||
uint8_t vtech_memexp_device::mreq_r(offs_t offset)
|
||||
{
|
||||
return m_mem->read8(offset);
|
||||
}
|
||||
|
||||
void vtech_memexp_device::mreq_w(offs_t offset, uint8_t data)
|
||||
{
|
||||
m_mem->write8(offset, data);
|
||||
}
|
||||
|
||||
uint8_t vtech_memexp_device::iorq_r(offs_t offset)
|
||||
{
|
||||
return m_io->read8(offset);
|
||||
}
|
||||
|
||||
void vtech_memexp_device::iorq_w(offs_t offset, uint8_t data)
|
||||
{
|
||||
m_io->write8(offset, data);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
// license:GPL-2.0+
|
||||
// copyright-holders:Dirk Best
|
||||
// license: GPL-2.0+
|
||||
// copyright-holders: Dirk Best
|
||||
/***************************************************************************
|
||||
|
||||
VTech Laser/VZ Memory Expansion Slot
|
||||
@ -36,9 +36,12 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "machine/bankdev.h"
|
||||
|
||||
// include here so drivers don't need to
|
||||
#include "carts.h"
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
@ -61,8 +64,8 @@ public:
|
||||
vtech_memexp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
virtual ~vtech_memexp_slot_device();
|
||||
|
||||
template <typename T> void set_program_space(T &&tag, int spacenum) { m_program.set_tag(std::forward<T>(tag), spacenum); }
|
||||
template <typename T> void set_io_space(T &&tag, int spacenum) { m_io.set_tag(std::forward<T>(tag), spacenum); }
|
||||
template <typename T> void set_memspace(T &&tag, int spacenum) { m_memspace.set_tag(std::forward<T>(tag), spacenum); }
|
||||
template <typename T> void set_iospace(T &&tag, int spacenum) { m_iospace.set_tag(std::forward<T>(tag), spacenum); }
|
||||
|
||||
// callbacks
|
||||
auto int_handler() { return m_int_handler.bind(); }
|
||||
@ -76,16 +79,17 @@ public:
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_config_complete() override;
|
||||
virtual void device_start() override;
|
||||
|
||||
required_address_space m_program;
|
||||
required_address_space m_io;
|
||||
|
||||
private:
|
||||
required_address_space m_memspace;
|
||||
required_address_space m_iospace;
|
||||
|
||||
devcb_write_line m_int_handler;
|
||||
devcb_write_line m_nmi_handler;
|
||||
devcb_write_line m_reset_handler;
|
||||
|
||||
device_vtech_memexp_interface *m_module;
|
||||
};
|
||||
|
||||
// class representing interface-specific live memexp device
|
||||
@ -96,13 +100,39 @@ public:
|
||||
device_vtech_memexp_interface(const machine_config &mconfig, device_t &device);
|
||||
virtual ~device_vtech_memexp_interface();
|
||||
|
||||
protected:
|
||||
address_space &program_space() { return *m_slot->m_program; }
|
||||
address_space &io_space() { return *m_slot->m_io; }
|
||||
virtual uint8_t mreq_r(offs_t offset) { return 0xff; }
|
||||
virtual void mreq_w(offs_t offset, uint8_t data) { }
|
||||
virtual uint8_t iorq_r(offs_t offset) { return 0xff; }
|
||||
virtual void iorq_w(offs_t offset, uint8_t data) { }
|
||||
|
||||
protected:
|
||||
vtech_memexp_slot_device *m_slot;
|
||||
};
|
||||
|
||||
// base memory expansion device
|
||||
class vtech_memexp_device : public device_t, public device_vtech_memexp_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
vtech_memexp_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
// from host
|
||||
virtual uint8_t mreq_r(offs_t offset) override;
|
||||
virtual void mreq_w(offs_t offset, uint8_t data) override;
|
||||
virtual uint8_t iorq_r(offs_t offset) override;
|
||||
virtual void iorq_w(offs_t offset, uint8_t data) override;
|
||||
|
||||
protected:
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
virtual void device_start() override;
|
||||
|
||||
virtual void mem_map(address_map &map) { };
|
||||
virtual void io_map(address_map &map) { };
|
||||
|
||||
required_device<address_map_bank_device> m_mem;
|
||||
required_device<address_map_bank_device> m_io;
|
||||
};
|
||||
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE(VTECH_MEMEXP_SLOT, vtech_memexp_slot_device)
|
||||
|
||||
|
@ -24,13 +24,22 @@ DEFINE_DEVICE_TYPE(VTECH_LASER_64K, vtech_laser_64k_device, "vtech_laser_6
|
||||
// LASER 110 16K DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// mem_map - memory space address map
|
||||
//-------------------------------------------------
|
||||
|
||||
void vtech_laser110_16k_device::mem_map(address_map &map)
|
||||
{
|
||||
map.unmap_value_high();
|
||||
map(0x8000, 0xbfff).ram();
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// laser110_16k_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
vtech_laser110_16k_device::vtech_laser110_16k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
||||
device_t(mconfig, VTECH_LASER110_16K, tag, owner, clock),
|
||||
device_vtech_memexp_interface(mconfig, *this)
|
||||
vtech_memexp_device(mconfig, VTECH_LASER110_16K, tag, owner, clock)
|
||||
{
|
||||
}
|
||||
|
||||
@ -40,16 +49,7 @@ vtech_laser110_16k_device::vtech_laser110_16k_device(const machine_config &mconf
|
||||
|
||||
void vtech_laser110_16k_device::device_start()
|
||||
{
|
||||
m_ram.resize(16 * 1024);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset - device-specific reset
|
||||
//-------------------------------------------------
|
||||
|
||||
void vtech_laser110_16k_device::device_reset()
|
||||
{
|
||||
program_space().install_ram(0x8000, 0xbfff, &m_ram[0]);
|
||||
vtech_memexp_device::device_start();
|
||||
}
|
||||
|
||||
|
||||
@ -57,13 +57,22 @@ void vtech_laser110_16k_device::device_reset()
|
||||
// LASER 210 16K DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// mem_map - memory space address map
|
||||
//-------------------------------------------------
|
||||
|
||||
void vtech_laser210_16k_device::mem_map(address_map &map)
|
||||
{
|
||||
map.unmap_value_high();
|
||||
map(0x9000, 0xcfff).ram();
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// vtech_laser210_16k_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
vtech_laser210_16k_device::vtech_laser210_16k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
||||
device_t(mconfig, VTECH_LASER210_16K, tag, owner, clock),
|
||||
device_vtech_memexp_interface(mconfig, *this)
|
||||
vtech_memexp_device(mconfig, VTECH_LASER210_16K, tag, owner, clock)
|
||||
{
|
||||
}
|
||||
|
||||
@ -73,16 +82,7 @@ vtech_laser210_16k_device::vtech_laser210_16k_device(const machine_config &mconf
|
||||
|
||||
void vtech_laser210_16k_device::device_start()
|
||||
{
|
||||
m_ram.resize(16 * 1024);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset - device-specific reset
|
||||
//-------------------------------------------------
|
||||
|
||||
void vtech_laser210_16k_device::device_reset()
|
||||
{
|
||||
program_space().install_ram(0x9000, 0xcfff, &m_ram[0]);
|
||||
vtech_memexp_device::device_start();
|
||||
}
|
||||
|
||||
|
||||
@ -90,13 +90,22 @@ void vtech_laser210_16k_device::device_reset()
|
||||
// VZ300 16K DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// mem_map - memory space address map
|
||||
//-------------------------------------------------
|
||||
|
||||
void vtech_laser310_16k_device::mem_map(address_map &map)
|
||||
{
|
||||
map.unmap_value_high();
|
||||
map(0xb800, 0xf7ff).ram();
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// vtech_laser310_16k_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
vtech_laser310_16k_device::vtech_laser310_16k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
||||
device_t(mconfig, VTECH_LASER310_16K, tag, owner, clock),
|
||||
device_vtech_memexp_interface(mconfig, *this)
|
||||
vtech_memexp_device(mconfig, VTECH_LASER310_16K, tag, owner, clock)
|
||||
{
|
||||
}
|
||||
|
||||
@ -106,16 +115,7 @@ vtech_laser310_16k_device::vtech_laser310_16k_device(const machine_config &mconf
|
||||
|
||||
void vtech_laser310_16k_device::device_start()
|
||||
{
|
||||
m_ram.resize(16 * 1024);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset - device-specific reset
|
||||
//-------------------------------------------------
|
||||
|
||||
void vtech_laser310_16k_device::device_reset()
|
||||
{
|
||||
program_space().install_ram(0xb800, 0xf7ff, &m_ram[0]);
|
||||
vtech_memexp_device::device_start();
|
||||
}
|
||||
|
||||
|
||||
@ -123,13 +123,34 @@ void vtech_laser310_16k_device::device_reset()
|
||||
// VZ300 64K DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// mem_map - memory space address map
|
||||
//-------------------------------------------------
|
||||
|
||||
void vtech_laser_64k_device::mem_map(address_map &map)
|
||||
{
|
||||
map.unmap_value_high();
|
||||
map(0x8000, 0xbfff).bankrw(m_fixed_bank);
|
||||
map(0xc000, 0xffff).bankrw(m_bank);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// io_map - memory space address map
|
||||
//-------------------------------------------------
|
||||
|
||||
void vtech_laser_64k_device::io_map(address_map &map)
|
||||
{
|
||||
map.unmap_value_high();
|
||||
map(0x70, 0x70).mirror(0x0f).lw8(NAME([this] (uint8_t data) { m_bank->set_entry(data & 0x03); }));
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// vtech_laser_64k_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
vtech_laser_64k_device::vtech_laser_64k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
||||
device_t(mconfig, VTECH_LASER_64K, tag, owner, clock),
|
||||
device_vtech_memexp_interface(mconfig, *this),
|
||||
vtech_memexp_device(mconfig, VTECH_LASER_64K, tag, owner, clock),
|
||||
m_fixed_bank(*this, "fixed_bank"),
|
||||
m_bank(*this, "bank")
|
||||
{
|
||||
}
|
||||
@ -140,29 +161,17 @@ vtech_laser_64k_device::vtech_laser_64k_device(const machine_config &mconfig, co
|
||||
|
||||
void vtech_laser_64k_device::device_start()
|
||||
{
|
||||
m_ram.resize(64 * 1024);
|
||||
}
|
||||
vtech_memexp_device::device_start();
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset - device-specific reset
|
||||
//-------------------------------------------------
|
||||
// init ram
|
||||
m_ram = std::make_unique<uint8_t[]>(0x10000);
|
||||
|
||||
void vtech_laser_64k_device::device_reset()
|
||||
{
|
||||
// fixed first bank
|
||||
program_space().install_ram(0x8000, 0xbfff, &m_ram[0]);
|
||||
// configure banking
|
||||
m_fixed_bank->set_base(m_ram.get());
|
||||
|
||||
// other banks
|
||||
program_space().install_readwrite_bank(0xc000, 0xffff, m_bank);
|
||||
|
||||
m_bank->configure_entries(0, 4, &m_ram[0], 0x4000);
|
||||
m_bank->configure_entries(0, 4, m_ram.get(), 0x4000);
|
||||
m_bank->set_entry(1);
|
||||
|
||||
// bank switch
|
||||
io_space().install_write_handler(0x70, 0x7f, write8smo_delegate(*this, FUNC(vtech_laser_64k_device::bankswitch_w)));
|
||||
}
|
||||
|
||||
void vtech_laser_64k_device::bankswitch_w(uint8_t data)
|
||||
{
|
||||
m_bank->set_entry(data & 0x03);
|
||||
// register for savestates
|
||||
save_pointer(NAME(m_ram), 0x10000);
|
||||
}
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
// ======================> vtech_laser110_16k_device
|
||||
|
||||
class vtech_laser110_16k_device : public device_t, public device_vtech_memexp_interface
|
||||
class vtech_laser110_16k_device : public vtech_memexp_device
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
@ -28,15 +28,13 @@ public:
|
||||
|
||||
protected:
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
private:
|
||||
std::vector<uint8_t> m_ram;
|
||||
virtual void mem_map(address_map &map) override;
|
||||
};
|
||||
|
||||
// ======================> vtech_laser210_16k_device
|
||||
|
||||
class vtech_laser210_16k_device : public device_t, public device_vtech_memexp_interface
|
||||
class vtech_laser210_16k_device : public vtech_memexp_device
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
@ -44,15 +42,13 @@ public:
|
||||
|
||||
protected:
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
private:
|
||||
std::vector<uint8_t> m_ram;
|
||||
virtual void mem_map(address_map &map) override;
|
||||
};
|
||||
|
||||
// ======================> vtech_laser310_16k_device
|
||||
|
||||
class vtech_laser310_16k_device : public device_t, public device_vtech_memexp_interface
|
||||
class vtech_laser310_16k_device : public vtech_memexp_device
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
@ -60,29 +56,29 @@ public:
|
||||
|
||||
protected:
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
private:
|
||||
std::vector<uint8_t> m_ram;
|
||||
virtual void mem_map(address_map &map) override;
|
||||
};
|
||||
|
||||
// ======================> vtech_laser_64k_device
|
||||
|
||||
class vtech_laser_64k_device : public device_t, public device_vtech_memexp_interface
|
||||
class vtech_laser_64k_device : public vtech_memexp_device
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
vtech_laser_64k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
void bankswitch_w(uint8_t data);
|
||||
|
||||
protected:
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
virtual void mem_map(address_map &map) override;
|
||||
virtual void io_map(address_map &map) override;
|
||||
|
||||
private:
|
||||
memory_bank_creator m_bank;
|
||||
std::vector<uint8_t> m_ram;
|
||||
required_memory_bank m_fixed_bank;
|
||||
required_memory_bank m_bank;
|
||||
|
||||
std::unique_ptr<uint8_t[]> m_ram;
|
||||
};
|
||||
|
||||
// device type definition
|
||||
|
@ -16,6 +16,18 @@
|
||||
|
||||
DEFINE_DEVICE_TYPE(VTECH_RS232_INTERFACE, vtech_rs232_interface_device, "vtech_rs232", "DSE VZ-200/300 RS-232 Interface")
|
||||
|
||||
//-------------------------------------------------
|
||||
// mem_map - memory space address map
|
||||
//-------------------------------------------------
|
||||
|
||||
void vtech_rs232_interface_device::mem_map(address_map &map)
|
||||
{
|
||||
map.unmap_value_high();
|
||||
map(0x4000, 0x47ff).rom().region("software", 0);
|
||||
map(0x5000, 0x5000).mirror(0x7ff).r(FUNC(vtech_rs232_interface_device::receive_data_r));
|
||||
map(0x5800, 0x5800).mirror(0x7ff).w(FUNC(vtech_rs232_interface_device::transmit_data_w));
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// rom_region - device-specific ROM region
|
||||
//-------------------------------------------------
|
||||
@ -40,8 +52,10 @@ const tiny_rom_entry *vtech_rs232_interface_device::device_rom_region() const
|
||||
|
||||
void vtech_rs232_interface_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
vtech_memexp_device::device_add_mconfig(config);
|
||||
|
||||
RS232_PORT(config, m_rs232, default_rs232_devices, nullptr);
|
||||
m_rs232->rxd_handler().set(FUNC(vtech_rs232_interface_device::rs232_rx_w));
|
||||
m_rs232->rxd_handler().set([this](int state) { m_rx = state; });
|
||||
}
|
||||
|
||||
|
||||
@ -54,8 +68,7 @@ void vtech_rs232_interface_device::device_add_mconfig(machine_config &config)
|
||||
//-------------------------------------------------
|
||||
|
||||
vtech_rs232_interface_device::vtech_rs232_interface_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
||||
device_t(mconfig, VTECH_RS232_INTERFACE, tag, owner, clock),
|
||||
device_vtech_memexp_interface(mconfig, *this),
|
||||
vtech_memexp_device(mconfig, VTECH_RS232_INTERFACE, tag, owner, clock),
|
||||
m_rs232(*this, "rs232"),
|
||||
m_rx(1)
|
||||
{
|
||||
@ -67,20 +80,10 @@ vtech_rs232_interface_device::vtech_rs232_interface_device(const machine_config
|
||||
|
||||
void vtech_rs232_interface_device::device_start()
|
||||
{
|
||||
}
|
||||
vtech_memexp_device::device_start();
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset - device-specific reset
|
||||
//-------------------------------------------------
|
||||
|
||||
void vtech_rs232_interface_device::device_reset()
|
||||
{
|
||||
// program
|
||||
program_space().install_rom(0x4000, 0x47ff, 0x800, memregion("software")->base());
|
||||
|
||||
// data
|
||||
program_space().install_read_handler(0x5000, 0x57ff, read8smo_delegate(*this, FUNC(vtech_rs232_interface_device::receive_data_r)));
|
||||
program_space().install_write_handler(0x5800, 0x5fff, write8smo_delegate(*this, FUNC(vtech_rs232_interface_device::transmit_data_w)));
|
||||
// register for save states
|
||||
save_item(NAME(m_rx));
|
||||
}
|
||||
|
||||
|
||||
@ -88,11 +91,6 @@ void vtech_rs232_interface_device::device_reset()
|
||||
// IMPLEMENTATION
|
||||
//**************************************************************************
|
||||
|
||||
WRITE_LINE_MEMBER( vtech_rs232_interface_device::rs232_rx_w )
|
||||
{
|
||||
m_rx = state;
|
||||
}
|
||||
|
||||
uint8_t vtech_rs232_interface_device::receive_data_r()
|
||||
{
|
||||
return 0x7f | (m_rx << 7);
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
// ======================> vtech_rs232_interface_device
|
||||
|
||||
class vtech_rs232_interface_device : public device_t, public device_vtech_memexp_interface
|
||||
class vtech_rs232_interface_device : public vtech_memexp_device
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
@ -31,15 +31,15 @@ protected:
|
||||
virtual const tiny_rom_entry *device_rom_region() const override;
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
virtual void mem_map(address_map &map) override;
|
||||
|
||||
private:
|
||||
DECLARE_WRITE_LINE_MEMBER( rs232_rx_w );
|
||||
required_device<rs232_port_device> m_rs232;
|
||||
|
||||
uint8_t receive_data_r();
|
||||
void transmit_data_w(uint8_t data);
|
||||
|
||||
required_device<rs232_port_device> m_rs232;
|
||||
|
||||
|
||||
int m_rx;
|
||||
};
|
||||
|
||||
|
@ -16,6 +16,19 @@
|
||||
|
||||
DEFINE_DEVICE_TYPE(VTECH_RTTY_INTERFACE, vtech_rtty_interface_device, "vtech_rtty", "DSE VZ-200/300 RTTY Interface")
|
||||
|
||||
//-------------------------------------------------
|
||||
// mem_map - memory space address map
|
||||
//-------------------------------------------------
|
||||
|
||||
void vtech_rtty_interface_device::mem_map(address_map &map)
|
||||
{
|
||||
map.unmap_value_high();
|
||||
map(0x4000, 0x4fff).rom().region("software", 0);
|
||||
map(0x5000, 0x5000).mirror(0x7ff).r(FUNC(vtech_rtty_interface_device::receive_data_r));
|
||||
map(0x5800, 0x5800).mirror(0x7ff).w(FUNC(vtech_rtty_interface_device::transmit_data_w));
|
||||
map(0x6000, 0x6000).mirror(0x7ff).w(FUNC(vtech_rtty_interface_device::relay_w));
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// rom_region - device-specific ROM region
|
||||
//-------------------------------------------------
|
||||
@ -40,8 +53,7 @@ const tiny_rom_entry *vtech_rtty_interface_device::device_rom_region() const
|
||||
//-------------------------------------------------
|
||||
|
||||
vtech_rtty_interface_device::vtech_rtty_interface_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
||||
device_t(mconfig, VTECH_RTTY_INTERFACE, tag, owner, clock),
|
||||
device_vtech_memexp_interface(mconfig, *this)
|
||||
vtech_memexp_device(mconfig, VTECH_RTTY_INTERFACE, tag, owner, clock)
|
||||
{
|
||||
}
|
||||
|
||||
@ -51,21 +63,7 @@ vtech_rtty_interface_device::vtech_rtty_interface_device(const machine_config &m
|
||||
|
||||
void vtech_rtty_interface_device::device_start()
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset - device-specific reset
|
||||
//-------------------------------------------------
|
||||
|
||||
void vtech_rtty_interface_device::device_reset()
|
||||
{
|
||||
// program
|
||||
program_space().install_rom(0x4000, 0x4fff, 0x1000, memregion("software")->base());
|
||||
|
||||
// data
|
||||
program_space().install_read_handler(0x5000, 0x57ff, read8smo_delegate(*this, FUNC(vtech_rtty_interface_device::receive_data_r)));
|
||||
program_space().install_write_handler(0x5800, 0x5fff, write8smo_delegate(*this, FUNC(vtech_rtty_interface_device::transmit_data_w)));
|
||||
program_space().install_write_handler(0x6000, 0x67ff, write8smo_delegate(*this, FUNC(vtech_rtty_interface_device::relay_w)));
|
||||
vtech_memexp_device::device_start();
|
||||
}
|
||||
|
||||
|
||||
|
@ -20,20 +20,22 @@
|
||||
|
||||
// ======================> vtech_rtty_interface_device
|
||||
|
||||
class vtech_rtty_interface_device : public device_t, public device_vtech_memexp_interface
|
||||
class vtech_rtty_interface_device : public vtech_memexp_device
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
vtech_rtty_interface_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
uint8_t receive_data_r();
|
||||
void transmit_data_w(uint8_t data);
|
||||
void relay_w(uint8_t data);
|
||||
|
||||
protected:
|
||||
virtual const tiny_rom_entry *device_rom_region() const override;
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
virtual void mem_map(address_map &map) override;
|
||||
|
||||
private:
|
||||
uint8_t receive_data_r();
|
||||
void transmit_data_w(uint8_t data);
|
||||
void relay_w(uint8_t data);
|
||||
};
|
||||
|
||||
// device type definition
|
||||
|
180
src/devices/bus/vtech/memexp/sdloader.cpp
Normal file
180
src/devices/bus/vtech/memexp/sdloader.cpp
Normal file
@ -0,0 +1,180 @@
|
||||
// license: GPL-2.0+
|
||||
// copyright-holders: Dirk Best
|
||||
/***************************************************************************
|
||||
|
||||
BennVenn SD Loader for VZ300
|
||||
|
||||
Notes:
|
||||
- Also works for VZ200
|
||||
|
||||
TODO:
|
||||
- No SD card emulation, so only the memory expansion part works
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "sdloader.h"
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// DEVICE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
DEFINE_DEVICE_TYPE(VTECH_SDLOADER, vtech_sdloader_device, "vtech_sdloader", "BennVenn SD Loader")
|
||||
|
||||
//-------------------------------------------------
|
||||
// mem_map - memory space address map
|
||||
//-------------------------------------------------
|
||||
|
||||
void vtech_sdloader_device::mem_map(address_map &map)
|
||||
{
|
||||
map.unmap_value_high();
|
||||
map(0x4000, 0x67ff).view(m_dosview);
|
||||
m_dosview[0](0x4000, 0x67ff).rom().region("software", 0).bankw(m_dosbank);
|
||||
m_dosview[1](0x4000, 0x67ff).bankrw(m_dosbank);
|
||||
map(0x9000, 0xffff).rw(FUNC(vtech_sdloader_device::exp_ram_r), FUNC(vtech_sdloader_device::exp_ram_w));
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// io_map - io space address map
|
||||
//-------------------------------------------------
|
||||
|
||||
void vtech_sdloader_device::io_map(address_map &map)
|
||||
{
|
||||
map.unmap_value_high();
|
||||
map(0x37, 0x37).w(FUNC(vtech_sdloader_device::mapper_w));
|
||||
map(0x38, 0x38).w(FUNC(vtech_sdloader_device::sdcfg_w));
|
||||
map(0x39, 0x39).rw(FUNC(vtech_sdloader_device::sdio_r), FUNC(vtech_sdloader_device::sdio_w));
|
||||
map(0x3a, 0x3a).w(FUNC(vtech_sdloader_device::mode_w));
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// rom_region - device-specific ROM region
|
||||
//-------------------------------------------------
|
||||
|
||||
ROM_START( sdloader )
|
||||
ROM_REGION(0x2800, "software", 0)
|
||||
ROM_DEFAULT_BIOS("18")
|
||||
ROM_SYSTEM_BIOS(0, "15", "Version 1.5")
|
||||
ROMX_LOAD("vzdos15.bin", 0x0000, 0x16c2, CRC(828f7703) SHA1(150c6e5a8f20416c0dab1fa96f68726f415a8b7e), ROM_BIOS(0))
|
||||
ROM_SYSTEM_BIOS(1, "17", "Version 1.7")
|
||||
ROMX_LOAD("vzdos17.bin", 0x0000, 0x1783, CRC(7ef7fb1e) SHA1(6278ac675d6c08dca39a5a7f4c72988a178eff8a), ROM_BIOS(1))
|
||||
ROM_SYSTEM_BIOS(2, "18", "Version 1.8")
|
||||
ROMX_LOAD("vzdos18.bin", 0x0000, 0x1795, CRC(2b1cec28) SHA1(d4f8fa0c7a70984334be3e5c831017cfc53683b2), ROM_BIOS(2))
|
||||
ROM_END
|
||||
|
||||
const tiny_rom_entry *vtech_sdloader_device::device_rom_region() const
|
||||
{
|
||||
return ROM_NAME( sdloader );
|
||||
}
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// LIVE DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// vtech_sdloader_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
vtech_sdloader_device::vtech_sdloader_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
||||
vtech_memexp_device(mconfig, VTECH_SDLOADER, tag, owner, clock),
|
||||
m_dosbank(*this, "dosbank"),
|
||||
m_dosview(*this, "dosview"),
|
||||
m_expbank(*this, "expbank"),
|
||||
m_vz300_mode(false)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
||||
void vtech_sdloader_device::device_start()
|
||||
{
|
||||
vtech_memexp_device::device_start();
|
||||
|
||||
// init ram
|
||||
m_ram = std::make_unique<uint8_t[]>(0x20000);
|
||||
|
||||
// configure banks
|
||||
m_dosbank->configure_entry(0, m_ram.get() + 0x00000);
|
||||
m_dosbank->configure_entry(1, m_ram.get() + 0x08000);
|
||||
m_expbank->configure_entry(0, m_ram.get() + 0x10000);
|
||||
m_expbank->configure_entry(1, m_ram.get() + 0x18000);
|
||||
|
||||
// register for savestates
|
||||
save_item(NAME(m_vz300_mode));
|
||||
save_pointer(NAME(m_ram), 0x20000);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
||||
void vtech_sdloader_device::device_reset()
|
||||
{
|
||||
// startup in vz200 mode
|
||||
m_vz300_mode = false;
|
||||
|
||||
// rom enabled
|
||||
m_dosview.select(0);
|
||||
}
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// IMPLEMENTATION
|
||||
//**************************************************************************
|
||||
|
||||
void vtech_sdloader_device::mapper_w(uint8_t data)
|
||||
{
|
||||
// 7654---- not used
|
||||
// ----3--- led
|
||||
// -----2-- expansion ram bank
|
||||
// ------1- dos ram bank
|
||||
// -------0 dos rom/ram switch
|
||||
|
||||
m_dosview.select(BIT(data, 0));
|
||||
m_dosbank->set_entry(BIT(data, 1));
|
||||
m_expbank->set_entry(BIT(data, 2));
|
||||
}
|
||||
|
||||
void vtech_sdloader_device::sdcfg_w(uint8_t data)
|
||||
{
|
||||
logerror("sdcfg_w: %02x\n", data);
|
||||
}
|
||||
|
||||
uint8_t vtech_sdloader_device::sdio_r()
|
||||
{
|
||||
logerror("sdio_r\n");
|
||||
return 0xff;
|
||||
}
|
||||
|
||||
void vtech_sdloader_device::sdio_w(uint8_t data)
|
||||
{
|
||||
logerror("sdio_w: %02x\n", data);
|
||||
}
|
||||
|
||||
void vtech_sdloader_device::mode_w(uint8_t data)
|
||||
{
|
||||
logerror("Switching to %s mode\n", BIT(data, 0) ? "VZ-300" : "VZ-200");
|
||||
m_vz300_mode = bool(BIT(data, 0));
|
||||
}
|
||||
|
||||
uint8_t vtech_sdloader_device::exp_ram_r(offs_t offset)
|
||||
{
|
||||
offset += 0x9000;
|
||||
|
||||
if (!m_vz300_mode || (m_vz300_mode && offset >= 0xb800))
|
||||
return reinterpret_cast<uint8_t *>(m_expbank->base())[offset & 0x7fff];
|
||||
|
||||
return 0xff;
|
||||
}
|
||||
|
||||
void vtech_sdloader_device::exp_ram_w(offs_t offset, uint8_t data)
|
||||
{
|
||||
offset += 0x9000;
|
||||
|
||||
if (!m_vz300_mode || (m_vz300_mode && offset >= 0xb800))
|
||||
reinterpret_cast<uint8_t *>(m_expbank->base())[offset & 0x7fff] = data;
|
||||
}
|
60
src/devices/bus/vtech/memexp/sdloader.h
Normal file
60
src/devices/bus/vtech/memexp/sdloader.h
Normal file
@ -0,0 +1,60 @@
|
||||
// license: GPL-2.0+
|
||||
// copyright-holders: Dirk Best
|
||||
/***************************************************************************
|
||||
|
||||
BennVenn SD Loader for VZ300
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef MAME_BUS_VTECH_MEMEXP_SDLOADER_H
|
||||
#define MAME_BUS_VTECH_MEMEXP_SDLOADER_H
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "memexp.h"
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
// ======================> vtech_sdloader_device
|
||||
|
||||
class vtech_sdloader_device : public vtech_memexp_device
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
vtech_sdloader_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
static constexpr feature_type unemulated_features() { return feature::DISK; }
|
||||
|
||||
protected:
|
||||
virtual const tiny_rom_entry *device_rom_region() const override;
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
virtual void mem_map(address_map &map) override;
|
||||
virtual void io_map(address_map &map) override;
|
||||
|
||||
private:
|
||||
required_memory_bank m_dosbank;
|
||||
memory_view m_dosview;
|
||||
memory_bank_creator m_expbank;
|
||||
|
||||
void mapper_w(uint8_t data);
|
||||
void sdcfg_w(uint8_t data);
|
||||
uint8_t sdio_r();
|
||||
void sdio_w(uint8_t data);
|
||||
void mode_w(uint8_t data);
|
||||
|
||||
uint8_t exp_ram_r(offs_t offset);
|
||||
void exp_ram_w(offs_t offset, uint8_t data);
|
||||
|
||||
std::unique_ptr<uint8_t[]> m_ram;
|
||||
bool m_vz300_mode;
|
||||
};
|
||||
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE(VTECH_SDLOADER, vtech_sdloader_device)
|
||||
|
||||
#endif // MAME_BUS_VTECH_MEMEXP_SDLOADER_H
|
@ -16,6 +16,17 @@
|
||||
|
||||
DEFINE_DEVICE_TYPE(VTECH_WORDPRO, vtech_wordpro_device, "vtech_wordpro", "DSE VZ-300 WordPro")
|
||||
|
||||
//-------------------------------------------------
|
||||
// mem_map - memory space address map
|
||||
//-------------------------------------------------
|
||||
|
||||
void vtech_wordpro_device::mem_map(address_map &map)
|
||||
{
|
||||
map.unmap_value_high();
|
||||
map(0x6000, 0x67ff).rom().region("software", 0);
|
||||
map(0xd000, 0xffff).rom().region("software", 0);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// rom_region - device-specific ROM region
|
||||
//-------------------------------------------------
|
||||
@ -42,8 +53,7 @@ const tiny_rom_entry *vtech_wordpro_device::device_rom_region() const
|
||||
//-------------------------------------------------
|
||||
|
||||
vtech_wordpro_device::vtech_wordpro_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
||||
device_t(mconfig, VTECH_WORDPRO, tag, owner, clock),
|
||||
device_vtech_memexp_interface(mconfig, *this)
|
||||
vtech_memexp_device(mconfig, VTECH_WORDPRO, tag, owner, clock)
|
||||
{
|
||||
}
|
||||
|
||||
@ -53,14 +63,5 @@ vtech_wordpro_device::vtech_wordpro_device(const machine_config &mconfig, const
|
||||
|
||||
void vtech_wordpro_device::device_start()
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset - device-specific reset
|
||||
//-------------------------------------------------
|
||||
|
||||
void vtech_wordpro_device::device_reset()
|
||||
{
|
||||
program_space().install_rom(0x6000, 0x67ff, memregion("software")->base());
|
||||
program_space().install_rom(0xd000, 0xffff, memregion("software")->base());
|
||||
vtech_memexp_device::device_start();
|
||||
}
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
// ======================> vtech_wordpro_device
|
||||
|
||||
class vtech_wordpro_device : public device_t, public device_vtech_memexp_interface
|
||||
class vtech_wordpro_device : public vtech_memexp_device
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
@ -29,7 +29,8 @@ public:
|
||||
protected:
|
||||
virtual const tiny_rom_entry *device_rom_region() const override;
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
virtual void mem_map(address_map &map) override;
|
||||
};
|
||||
|
||||
// device type definition
|
||||
|
@ -95,7 +95,6 @@ protected:
|
||||
|
||||
DECLARE_SNAPSHOT_LOAD_MEMBER(snapshot_cb);
|
||||
|
||||
uint8_t lightpen_r(offs_t offset);
|
||||
uint8_t keyboard_r(offs_t offset);
|
||||
virtual void latch_w(uint8_t data);
|
||||
uint8_t vram_r(memory_share_creator<uint8_t> &vram, offs_t offset);
|
||||
@ -228,12 +227,6 @@ SNAPSHOT_LOAD_MEMBER(vtech1_base_state::snapshot_cb)
|
||||
INPUTS
|
||||
***************************************************************************/
|
||||
|
||||
uint8_t vtech1_base_state::lightpen_r(offs_t offset)
|
||||
{
|
||||
logerror("vtech1_lightpen_r(%d)\n", offset);
|
||||
return 0xff;
|
||||
}
|
||||
|
||||
uint8_t vtech1_base_state::keyboard_r(offs_t offset)
|
||||
{
|
||||
uint8_t result = 0x3f;
|
||||
@ -340,10 +333,13 @@ void laser310h_state::machine_start()
|
||||
|
||||
void vtech1_base_state::laser110_mem(address_map &map)
|
||||
{
|
||||
map.unmap_value_high();
|
||||
map(0x0000, 0x3fff).rom(); // basic rom
|
||||
map(0x4000, 0x67ff).noprw(); // cartridge space
|
||||
map(0x6800, 0x6fff).rw(FUNC(vtech1_base_state::keyboard_r), FUNC(vtech1_base_state::latch_w));
|
||||
map(0x7000, 0x77ff).bankrw("vbank");
|
||||
map(0x7800, 0x7fff).ram(); // 2k user ram
|
||||
map(0x8000, 0xffff).noprw(); // expansion ram
|
||||
}
|
||||
|
||||
void vtech1_base_state::laser210_mem(address_map &map)
|
||||
@ -360,8 +356,9 @@ void vtech1_base_state::laser310_mem(address_map &map)
|
||||
|
||||
void vtech1_base_state::vtech1_io(address_map &map)
|
||||
{
|
||||
map.unmap_value_high();
|
||||
map.global_mask(0xff);
|
||||
map(0x40, 0x4f).r(FUNC(vtech1_base_state::lightpen_r));
|
||||
map(0x00, 0xff).noprw(); // completely handled by expansion devices
|
||||
}
|
||||
|
||||
void laser310h_state::vtech1_shrg_mem(address_map &map)
|
||||
@ -479,11 +476,11 @@ void vtech1_base_state::vtech1(machine_config &config)
|
||||
|
||||
// peripheral and memory expansion slots
|
||||
VTECH_IOEXP_SLOT(config, m_ioexp);
|
||||
m_ioexp->set_io_space(m_maincpu, AS_IO);
|
||||
m_ioexp->set_iospace(m_maincpu, AS_IO);
|
||||
|
||||
VTECH_MEMEXP_SLOT(config, m_memexp);
|
||||
m_memexp->set_program_space(m_maincpu, AS_PROGRAM);
|
||||
m_memexp->set_io_space(m_maincpu, AS_IO);
|
||||
m_memexp->set_memspace(m_maincpu, AS_PROGRAM);
|
||||
m_memexp->set_iospace(m_maincpu, AS_IO);
|
||||
|
||||
// snapshot
|
||||
snapshot_image_device &snapshot(SNAPSHOT(config, "snapshot", "vz"));
|
||||
|
@ -92,6 +92,8 @@ void vtech2_state::mem_map(address_map &map)
|
||||
void vtech2_state::io_map(address_map &map)
|
||||
{
|
||||
map.global_mask(0xff);
|
||||
map.unmap_value_high();
|
||||
map(0x00, 0xff).noprw();
|
||||
map(0x10, 0x1f).rw(FUNC(vtech2_state::laser_fdc_r), FUNC(vtech2_state::laser_fdc_w));
|
||||
map(0x40, 0x40).lw8(NAME([this] (u8 data) { m_banka->set_bank(data & 15); }));
|
||||
map(0x41, 0x41).lw8(NAME([this] (u8 data) { m_bankb->set_bank(data & 15); }));
|
||||
@ -494,7 +496,8 @@ void vtech2_state::laser350(machine_config &config)
|
||||
m_cassette->set_default_state(CASSETTE_STOPPED);
|
||||
m_cassette->add_route(ALL_OUTPUTS, "mono", 0.05);
|
||||
|
||||
VTECH_IOEXP_SLOT(config, "io").set_io_space(m_maincpu, AS_IO);
|
||||
VTECH_IOEXP_SLOT(config, m_ioexp);
|
||||
m_ioexp->set_iospace(m_maincpu, AS_IO);
|
||||
|
||||
/* cartridge */
|
||||
GENERIC_CARTSLOT(config, "cartslot", generic_plain_slot, "vtech_cart", "rom,bin").set_device_load(FUNC(vtech2_state::cart_load));
|
||||
|
Loading…
Reference in New Issue
Block a user