mirror of
https://github.com/holub/mame
synced 2025-06-07 05:13:46 +03:00
nec/pc98_sdip.cpp: drop template i/f
This commit is contained in:
parent
f4b1881edc
commit
8ac83f8b02
@ -1244,18 +1244,17 @@ void pc9801us_state::pc9801us_io(address_map &map)
|
||||
else
|
||||
logerror("SDIP: I/O $00f6 unrecognized write %02x\n", data);
|
||||
}));
|
||||
map(0x841e, 0x841e).rw(m_sdip, FUNC(pc98_sdip_device::read<0x0>), FUNC(pc98_sdip_device::write<0x0>));
|
||||
map(0x851e, 0x851e).rw(m_sdip, FUNC(pc98_sdip_device::read<0x1>), FUNC(pc98_sdip_device::write<0x1>));
|
||||
map(0x861e, 0x861e).rw(m_sdip, FUNC(pc98_sdip_device::read<0x2>), FUNC(pc98_sdip_device::write<0x2>));
|
||||
map(0x871e, 0x871e).rw(m_sdip, FUNC(pc98_sdip_device::read<0x3>), FUNC(pc98_sdip_device::write<0x3>));
|
||||
map(0x881e, 0x881e).rw(m_sdip, FUNC(pc98_sdip_device::read<0x4>), FUNC(pc98_sdip_device::write<0x4>));
|
||||
map(0x891e, 0x891e).rw(m_sdip, FUNC(pc98_sdip_device::read<0x5>), FUNC(pc98_sdip_device::write<0x5>));
|
||||
map(0x8a1e, 0x8a1e).rw(m_sdip, FUNC(pc98_sdip_device::read<0x6>), FUNC(pc98_sdip_device::write<0x6>));
|
||||
map(0x8b1e, 0x8b1e).rw(m_sdip, FUNC(pc98_sdip_device::read<0x7>), FUNC(pc98_sdip_device::write<0x7>));
|
||||
map(0x8c1e, 0x8c1e).rw(m_sdip, FUNC(pc98_sdip_device::read<0x8>), FUNC(pc98_sdip_device::write<0x8>));
|
||||
map(0x8d1e, 0x8d1e).rw(m_sdip, FUNC(pc98_sdip_device::read<0x9>), FUNC(pc98_sdip_device::write<0x9>));
|
||||
map(0x8e1e, 0x8e1e).rw(m_sdip, FUNC(pc98_sdip_device::read<0xa>), FUNC(pc98_sdip_device::write<0xa>));
|
||||
map(0x8f1e, 0x8f1e).rw(m_sdip, FUNC(pc98_sdip_device::read<0xb>), FUNC(pc98_sdip_device::write<0xb>));
|
||||
|
||||
// 0x841e ~ 0x8f1e SDIP I/O mapping
|
||||
// NOTE: split in half for pleasing emumem
|
||||
map(0x841e, 0x841e).select(0x300).lrw8(
|
||||
NAME([this] (offs_t offset) { return m_sdip->read(offset >> 8); }),
|
||||
NAME([this] (offs_t offset, u8 data) { m_sdip->write(offset >> 8, data); })
|
||||
);
|
||||
map(0x881e, 0x881e).select(0x700).lrw8(
|
||||
NAME([this] (offs_t offset) { return m_sdip->read((offset >> 8) + 4); }),
|
||||
NAME([this] (offs_t offset, u8 data) { m_sdip->write((offset >> 8) + 4, data); })
|
||||
);
|
||||
// map(0x8f1f, 0x8f1f).w(m_sdip, FUNC(pc98_sdip_device::bank_w));
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,7 @@ References:
|
||||
- https://bitchinbits.foolproofdesigns.com/pc-9821/pc-9821-cheat-sheet/
|
||||
|
||||
TODO:
|
||||
- Discards saved settings in PC-9821 and later;
|
||||
- Discards saved settings in PC-9821 and later, access thru MMIO?
|
||||
|
||||
===================================================================================================
|
||||
|
||||
@ -65,16 +65,16 @@ bool pc98_sdip_device::nvram_write(util::write_stream &file)
|
||||
}
|
||||
|
||||
|
||||
template<unsigned port> u8 pc98_sdip_device::read(offs_t offset)
|
||||
u8 pc98_sdip_device::read(offs_t offset)
|
||||
{
|
||||
u8 sdip_offset = port + (m_bank * 12);
|
||||
u8 sdip_offset = offset + (m_bank * 12);
|
||||
|
||||
return m_sdip_ram[sdip_offset];
|
||||
}
|
||||
|
||||
template<unsigned port> void pc98_sdip_device::write(offs_t offset, u8 data)
|
||||
void pc98_sdip_device::write(offs_t offset, u8 data)
|
||||
{
|
||||
u8 sdip_offset = port + (m_bank * 12);
|
||||
u8 sdip_offset = offset + (m_bank * 12);
|
||||
|
||||
m_sdip_ram[sdip_offset] = data;
|
||||
}
|
||||
@ -83,29 +83,3 @@ void pc98_sdip_device::bank_w(int state)
|
||||
{
|
||||
m_bank = !!(state);
|
||||
}
|
||||
|
||||
template u8 pc98_sdip_device::read<0>(offs_t offset);
|
||||
template u8 pc98_sdip_device::read<1>(offs_t offset);
|
||||
template u8 pc98_sdip_device::read<2>(offs_t offset);
|
||||
template u8 pc98_sdip_device::read<3>(offs_t offset);
|
||||
template u8 pc98_sdip_device::read<4>(offs_t offset);
|
||||
template u8 pc98_sdip_device::read<5>(offs_t offset);
|
||||
template u8 pc98_sdip_device::read<6>(offs_t offset);
|
||||
template u8 pc98_sdip_device::read<7>(offs_t offset);
|
||||
template u8 pc98_sdip_device::read<8>(offs_t offset);
|
||||
template u8 pc98_sdip_device::read<9>(offs_t offset);
|
||||
template u8 pc98_sdip_device::read<10>(offs_t offset);
|
||||
template u8 pc98_sdip_device::read<11>(offs_t offset);
|
||||
|
||||
template void pc98_sdip_device::write<0>(offs_t offset, u8 data);
|
||||
template void pc98_sdip_device::write<1>(offs_t offset, u8 data);
|
||||
template void pc98_sdip_device::write<2>(offs_t offset, u8 data);
|
||||
template void pc98_sdip_device::write<3>(offs_t offset, u8 data);
|
||||
template void pc98_sdip_device::write<4>(offs_t offset, u8 data);
|
||||
template void pc98_sdip_device::write<5>(offs_t offset, u8 data);
|
||||
template void pc98_sdip_device::write<6>(offs_t offset, u8 data);
|
||||
template void pc98_sdip_device::write<7>(offs_t offset, u8 data);
|
||||
template void pc98_sdip_device::write<8>(offs_t offset, u8 data);
|
||||
template void pc98_sdip_device::write<9>(offs_t offset, u8 data);
|
||||
template void pc98_sdip_device::write<10>(offs_t offset, u8 data);
|
||||
template void pc98_sdip_device::write<11>(offs_t offset, u8 data);
|
||||
|
@ -15,8 +15,8 @@ class pc98_sdip_device : public device_t,
|
||||
public:
|
||||
pc98_sdip_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
template <unsigned port> u8 read(offs_t offset);
|
||||
template <unsigned port> void write(offs_t offset, u8 data);
|
||||
u8 read(offs_t offset);
|
||||
void write(offs_t offset, u8 data);
|
||||
void bank_w(int state);
|
||||
|
||||
protected:
|
||||
|
Loading…
Reference in New Issue
Block a user