emu/tilemap.cpp : Simplify handlers

This commit is contained in:
cam900 2019-04-24 09:11:04 +09:00
parent e4ad76e351
commit 78eb5011db
5 changed files with 27 additions and 27 deletions

View File

@ -1627,14 +1627,14 @@ tilemap_device::tilemap_device(const machine_config &mconfig, const char *tag, d
// write: Main memory writes
//-------------------------------------------------
WRITE8_MEMBER(tilemap_device::write8)
void tilemap_device::write8(offs_t offset, u8 data)
{
m_basemem.write8(offset, data);
offset /= m_bytes_per_entry;
mark_tile_dirty(offset);
}
WRITE16_MEMBER(tilemap_device::write16)
void tilemap_device::write16(offs_t offset, u16 data, u16 mem_mask)
{
m_basemem.write16(offset, data, mem_mask);
offset = offset * 2 / m_bytes_per_entry;
@ -1643,7 +1643,7 @@ WRITE16_MEMBER(tilemap_device::write16)
mark_tile_dirty(offset + 1);
}
WRITE32_MEMBER(tilemap_device::write32)
void tilemap_device::write32(offs_t offset, u32 data, u32 mem_mask)
{
m_basemem.write32(offset, data, mem_mask);
offset = offset * 4 / m_bytes_per_entry;
@ -1664,14 +1664,14 @@ WRITE32_MEMBER(tilemap_device::write32)
// write_entry_ext: Extension memory writes
//-------------------------------------------------
WRITE8_MEMBER(tilemap_device::write8_ext)
void tilemap_device::write8_ext(offs_t offset, u8 data)
{
m_extmem.write8(offset, data);
offset /= m_bytes_per_entry;
mark_tile_dirty(offset);
}
WRITE16_MEMBER(tilemap_device::write16_ext)
void tilemap_device::write16_ext(offs_t offset, u16 data, u16 mem_mask)
{
m_extmem.write16(offset, data, mem_mask);
offset = offset * 2 / m_bytes_per_entry;
@ -1680,7 +1680,7 @@ WRITE16_MEMBER(tilemap_device::write16_ext)
mark_tile_dirty(offset + 1);
}
WRITE32_MEMBER(tilemap_device::write32_ext)
void tilemap_device::write32_ext(offs_t offset, u32 data, u32 mem_mask)
{
m_extmem.write32(offset, data, mem_mask);
offset = offset * 4 / m_bytes_per_entry;

View File

@ -775,18 +775,18 @@ public:
memory_array &extmem() { return m_extmem; }
// write handlers
DECLARE_WRITE8_MEMBER(write8);
DECLARE_WRITE16_MEMBER(write16);
DECLARE_WRITE32_MEMBER(write32);
DECLARE_WRITE8_MEMBER(write8_ext);
DECLARE_WRITE16_MEMBER(write16_ext);
DECLARE_WRITE32_MEMBER(write32_ext);
void write8(offs_t offset, u8 data);
void write16(offs_t offset, u16 data, u16 mem_mask = ~0);
void write32(offs_t offset, u32 data, u32 mem_mask = ~0);
void write8_ext(offs_t offset, u8 data);
void write16_ext(offs_t offset, u16 data, u16 mem_mask = ~0);
void write32_ext(offs_t offset, u32 data, u32 mem_mask = ~0);
// optional memory accessors
u32 basemem_read(int index) { return m_basemem.read(index); }
u32 extmem_read(int index) { return m_extmem.read(index); }
void basemem_write(int index, u32 data) { m_basemem.write(index, data); mark_tile_dirty(index); }
void extmem_write(int index, u32 data) { m_extmem.write(index, data); mark_tile_dirty(index); }
u32 basemem_read(offs_t offset) { return m_basemem.read(offset); }
u32 extmem_read(offs_t offset) { return m_extmem.read(offset); }
void basemem_write(offs_t offset, u32 data) { m_basemem.write(offset, data); mark_tile_dirty(offset); }
void extmem_write(offs_t offset, u32 data) { m_extmem.write(offset, data); mark_tile_dirty(offset); }
// pick one to use to avoid ambiguity errors
using device_t::machine;

View File

@ -1313,7 +1313,7 @@ WRITE32_MEMBER(atarigt_state::tmek_pf_w)
if (pc == 0x25834 || pc == 0x25860)
logerror("%06X:PFW@%06X = %08X & %08X (src=%06X)\n", m_maincpu->pc(), 0xd72000 + offset*4, data, mem_mask, (uint32_t)m_maincpu->state_int(M68K_A3) - 2);
m_playfield_tilemap->write32(space, offset, data, mem_mask);
m_playfield_tilemap->write32(offset, data, mem_mask);
}
void atarigt_state::init_tmek()

View File

@ -91,7 +91,7 @@ READ16_MEMBER(atari_vad_device::control_read)
WRITE16_MEMBER(atari_vad_device::alpha_w)
{
m_alpha_tilemap->write16(space, offset, data, mem_mask);
m_alpha_tilemap->write16(offset, data, mem_mask);
}
@ -102,9 +102,9 @@ WRITE16_MEMBER(atari_vad_device::alpha_w)
WRITE16_MEMBER(atari_vad_device::playfield_upper_w)
{
m_playfield_tilemap->write16_ext(space, offset, data, mem_mask);
m_playfield_tilemap->write16_ext(offset, data, mem_mask);
if (m_playfield2_tilemap != nullptr)
m_playfield2_tilemap->write16_ext(space, offset, data, mem_mask);
m_playfield2_tilemap->write16_ext(offset, data, mem_mask);
}
@ -116,9 +116,9 @@ WRITE16_MEMBER(atari_vad_device::playfield_upper_w)
WRITE16_MEMBER(atari_vad_device::playfield_latched_lsb_w)
{
m_playfield_tilemap->write16(space, offset, data, mem_mask);
m_playfield_tilemap->write16(offset, data, mem_mask);
if ((m_control[0x0a] & 0x80) != 0)
m_playfield_tilemap->write16_ext(space, offset, m_control[0x1d], uint16_t(0x00ff));
m_playfield_tilemap->write16_ext(offset, m_control[0x1d], uint16_t(0x00ff));
}
@ -130,9 +130,9 @@ WRITE16_MEMBER(atari_vad_device::playfield_latched_lsb_w)
WRITE16_MEMBER(atari_vad_device::playfield_latched_msb_w)
{
m_playfield_tilemap->write16(space, offset, data, mem_mask);
m_playfield_tilemap->write16(offset, data, mem_mask);
if ((m_control[0x0a] & 0x80) != 0)
m_playfield_tilemap->write16_ext(space, offset, m_control[0x1c], uint16_t(0xff00));
m_playfield_tilemap->write16_ext(offset, m_control[0x1c], uint16_t(0xff00));
}
@ -144,9 +144,9 @@ WRITE16_MEMBER(atari_vad_device::playfield_latched_msb_w)
WRITE16_MEMBER(atari_vad_device::playfield2_latched_msb_w)
{
m_playfield2_tilemap->write16(space, offset, data, mem_mask);
m_playfield2_tilemap->write16(offset, data, mem_mask);
if ((m_control[0x0a] & 0x80) != 0)
m_playfield2_tilemap->write16_ext(space, offset, m_control[0x1c], uint16_t(0xff00));
m_playfield2_tilemap->write16_ext(offset, m_control[0x1c], uint16_t(0xff00));
}

View File

@ -161,7 +161,7 @@ WRITE16_MEMBER( skullxbo_state::playfield_latch_w )
WRITE16_MEMBER(skullxbo_state::playfield_latched_w)
{
m_playfield_tilemap->write16(space, offset, data, mem_mask);
m_playfield_tilemap->write16(offset, data, mem_mask);
if (m_playfield_latch != -1)
{
uint16_t oldval = m_playfield_tilemap->extmem_read(offset);