Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/devices/bus/spectrum/nemoide.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ void nemoide_device::ata_w(offs_t offset, u8 data)

void nemoide_device::map_io(address_map &map)
{
map(0x00011, 0x00011).mirror(0xff00).lrw8(NAME([this]() { return m_ata_data_latch; })
map(0x0011, 0x0011).mirror(0xff00).lrw8(NAME([this]() { return m_ata_data_latch; })
, NAME([this](offs_t offset, u8 data) { m_ata_data_latch = data; }));
map(0x00010, 0x00010).select(0xffe0).rw(FUNC(nemoide_device::ata_r), FUNC(nemoide_device::ata_w));
map(0x000c8, 0x000c8).mirror(0xff00).lrw8(NAME([this]() { return m_ata->cs1_r(6); })
map(0x0010, 0x0010).select(0xffe0).rw(FUNC(nemoide_device::ata_r), FUNC(nemoide_device::ata_w));
map(0x00c8, 0x00c8).mirror(0xff00).lrw8(NAME([this]() { return m_ata->cs1_r(6); })
, NAME([this](offs_t offset, u8 data) { m_ata->cs1_w(6, data); }));
}

Expand All @@ -75,7 +75,7 @@ void nemoide_device::device_start()
{
save_item(NAME(m_ata_data_latch));

m_zxbus->install_device(0x00000, 0x1ffff, *this, &nemoide_device::map_io);
m_zxbus->install_device(0x0000, 0xffff, *this, &nemoide_device::map_io);
}

} // anonymous namespace
Expand Down
6 changes: 3 additions & 3 deletions src/devices/bus/spectrum/neogs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -440,9 +440,9 @@ const tiny_rom_entry *neogs_device::device_rom_region() const

void neogs_device::neogsmap(address_map &map)
{
map(0x000bb, 0x000bb).mirror(0xff00).rw(FUNC(neogs_device::neogs_status_r), FUNC(neogs_device::neogs_command_w));
map(0x000b3, 0x000b3).mirror(0xff00).rw(FUNC(neogs_device::neogs_data_r), FUNC(neogs_device::neogs_data_w));
map(0x00033, 0x00033).mirror(0xff00).w(FUNC(neogs_device::neogs_ctrl_w));
map(0x00bb, 0x00bb).mirror(0xff00).rw(FUNC(neogs_device::neogs_status_r), FUNC(neogs_device::neogs_command_w));
map(0x00b3, 0x00b3).mirror(0xff00).rw(FUNC(neogs_device::neogs_data_r), FUNC(neogs_device::neogs_data_w));
map(0x0033, 0x0033).mirror(0xff00).w(FUNC(neogs_device::neogs_ctrl_w));
}

void neogs_device::device_start()
Expand Down
25 changes: 13 additions & 12 deletions src/devices/bus/spectrum/smuc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ class smuc_device : public device_t, public device_zxbus_card_interface
, m_ata(*this, "ata")
{ }

virtual void map_shadow_io(address_map &map) override ATTR_COLD;

protected:
virtual void device_add_mconfig(machine_config &config) override ATTR_COLD;
virtual void device_start() override ATTR_COLD;
virtual void device_reset() override ATTR_COLD;

private:
void map_io(address_map &map) ATTR_COLD;
void map_io(address_map &map) ATTR_COLD {}

void port_ffba_w(offs_t offset, u8 data);
u8 ata_r(offs_t offset);
Expand Down Expand Up @@ -81,26 +83,25 @@ void smuc_device::ata_w(offs_t offset, u8 data)
m_ata->cs0_w(ata_offset, ata_data);
}


void smuc_device::map_io(address_map &map)
void smuc_device::map_shadow_io(address_map &map)
{
map(0x118a2, 0x118a2).mirror(0x4718) // 5fba | 0x011xxx101xx010 | Version: 2
map(0x18a2, 0x18a2).mirror(0x4718) // 5fba | 0x011xxx101xx010 | Version: 2
.lr8(NAME([]() { return 0x40; }));
map(0x118a6, 0x118a6).mirror(0x4718) // 5fbe | 0x011xxx101xx110 | Revision: 0
map(0x18a6, 0x18a6).mirror(0x4718) // 5fbe | 0x011xxx101xx110 | Revision: 0
.lr8(NAME([]() { return 0x28; }));
map(0x138a2, 0x138a2).mirror(0x4718) // 7fba | 0x111xxx101xx010 | VirtualFDD
map(0x38a2, 0x38a2).mirror(0x4718) // 7fba | 0x111xxx101xx010 | VirtualFDD
.lrw8(NAME([this]() { return m_port_7fba_data | 0x37; })
, NAME([this](u8 data) { m_port_7fba_data = data; }));
map(0x138a6, 0x138a6).mirror(0x4718) // 7[ef]be | 0x111xxN101xx110 | i8259 - absent in 2.0
map(0x38a6, 0x38a6).mirror(0x4718) // 7[ef]be | 0x111xxN101xx110 | i8259 - absent in 2.0
.lr8(NAME([]() { return 0x57; })).nopw();
map(0x198a2, 0x198a2).mirror(0x4718) // dfba | 1x011xxx101xx010 | DS1685RTC
map(0x98a2, 0x98a2).mirror(0x4718) // dfba | 1x011xxx101xx010 | DS1685RTC
.lrw8(NAME([this]() { return m_rtc->data_r(); })
, NAME([this](u8 data) { if (BIT(m_port_ffba_data, 7)) m_rtc->data_w(data); else m_rtc->address_w(data); }));
map(0x198a6, 0x198a6).mirror(0x4718) // d8be | 1x011xxx101xx110 | IDE-Hi
map(0x98a6, 0x98a6).mirror(0x4718) // d8be | 1x011xxx101xx110 | IDE-Hi
.lrw8(NAME([this]() { return m_ide_hi; }), NAME([this](u8 data) { m_ide_hi = data; }));
map(0x1b8a2, 0x1b8a2).mirror(0x4718) // ffba | 1x111xxx101xx010 | SYS
map(0xb8a2, 0xb8a2).mirror(0x4718) // ffba | 1x111xxx101xx010 | SYS
.lr8(NAME([this]() { return m_eeprom->read_sda() ? 0xff : 0xbf; })).w(FUNC(smuc_device::port_ffba_w));
map(0x1b8a6, 0x1b8a6).select(0x4718) // f[8-f]be | 1x111NNN101xx110 | IDE#1Fx/#3F6
map(0xb8a6, 0xb8a6).select(0x4718) // f[8-f]be | 1x111NNN101xx110 | IDE#1Fx/#3F6
.rw(FUNC(smuc_device::ata_r), FUNC(smuc_device::ata_w));
}

Expand All @@ -125,7 +126,7 @@ void smuc_device::device_start()
save_item(NAME(m_port_ffba_data));
save_item(NAME(m_ide_hi));

m_zxbus->install_device(0x00000, 0x1ffff, *this, &smuc_device::map_io);
m_zxbus->install_device(0x0000, 0xffff, *this, &smuc_device::map_io);
}

void smuc_device::device_reset()
Expand Down
16 changes: 16 additions & 0 deletions src/devices/bus/spectrum/zxbus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ zxbus_device::zxbus_device(const machine_config &mconfig, const char *tag, devic
zxbus_device::zxbus_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, type, tag, owner, clock)
, m_iospace(*this, finder_base::DUMMY_TAG, -1)
, m_shadow_io_view(nullptr)
{
}

Expand All @@ -51,6 +52,11 @@ void zxbus_device::device_start()
void zxbus_device::add_slot(zxbus_slot_device &slot)
{
m_slot_list.push_front(&slot);
if (m_shadow_io_view)
{
device_zxbus_card_interface *dev = slot.get_card_device();
(*m_shadow_io_view).install_device(0x0000, 0xffff, *dev, &device_zxbus_card_interface::map_shadow_io);
}
}

device_zxbus_card_interface::device_zxbus_card_interface(const machine_config &mconfig, device_t &device)
Expand All @@ -59,6 +65,11 @@ device_zxbus_card_interface::device_zxbus_card_interface(const machine_config &m
{
}

void zxbus_device::install_shadow_io(memory_view::memory_view_entry &io_view)
{
m_shadow_io_view = &io_view;
}

void device_zxbus_card_interface::interface_pre_start()
{
if (!m_zxbus)
Expand All @@ -74,5 +85,10 @@ void zxbus_cards(device_slot_interface &device)
{
device.option_add("nemoide", ZXBUS_NEMOIDE);
device.option_add("neogs", ZXBUS_NEOGS);
}

void zxbus_gmx_cards(device_slot_interface &device)
{
zxbus_cards(device);
device.option_add("smuc", ZXBUS_SMUC);
}
7 changes: 6 additions & 1 deletion src/devices/bus/spectrum/zxbus.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ class zxbus_device : public device_t
}

void add_slot(zxbus_slot_device &slot);
void install_shadow_io(memory_view::memory_view_entry &io_view);

protected:
zxbus_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock);
Expand All @@ -100,6 +101,7 @@ class zxbus_device : public device_t

private:
required_address_space m_iospace;
memory_view::memory_view_entry *m_shadow_io_view;

std::forward_list<zxbus_slot_device *> m_slot_list;
};
Expand All @@ -111,6 +113,9 @@ class device_zxbus_card_interface : public device_interface
{
friend class zxbus_slot_device;

public:
virtual void map_shadow_io(address_map &map) ATTR_COLD {}

protected:
device_zxbus_card_interface(const machine_config &mconfig, device_t &device);

Expand All @@ -123,6 +128,6 @@ class device_zxbus_card_interface : public device_interface


void zxbus_cards(device_slot_interface &device);

void zxbus_gmx_cards(device_slot_interface &device);

#endif // MAME_BUS_SPECTRUM_ZXBUS_H
Loading