From ed505a2205217cb1d5ed63e2567fbe8f23fbaf55 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Tue, 17 Apr 2012 16:18:43 +0000 Subject: [PATCH] Removed the rest DIRECT_UPDATE_HANDLERS from mame section (no whatsnew) --- src/mame/includes/snes.h | 3 +++ src/mame/machine/atarigen.c | 16 +++++++--------- src/mame/machine/atarigen.h | 2 ++ src/mame/machine/snes.c | 10 +++++----- 4 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/mame/includes/snes.h b/src/mame/includes/snes.h index 5b4cb85196b..8abb063a541 100644 --- a/src/mame/includes/snes.h +++ b/src/mame/includes/snes.h @@ -487,6 +487,9 @@ public: cpu_device *m_superfx; upd7725_device *m_upd7725; upd96050_device *m_upd96050; + + DECLARE_DIRECT_UPDATE_MEMBER(snes_spc_direct); + DECLARE_DIRECT_UPDATE_MEMBER(snes_direct); }; /* Special chips, checked at init and used in memory handlers */ diff --git a/src/mame/machine/atarigen.c b/src/mame/machine/atarigen.c index 0d3a7b7a414..e10a1a8f366 100644 --- a/src/mame/machine/atarigen.c +++ b/src/mame/machine/atarigen.c @@ -455,21 +455,19 @@ static void slapstic_postload(running_machine &machine) } -DIRECT_UPDATE_HANDLER( atarigen_slapstic_setdirect ) +DIRECT_UPDATE_MEMBER(atarigen_state::atarigen_slapstic_setdirect) { - atarigen_state *state = machine.driver_data(); - /* if we jump to an address in the slapstic region, tweak the slapstic at that address and return ~0; this will cause us to be called on subsequent fetches as well */ - address &= ~state->m_slapstic_mirror; - if (address >= state->m_slapstic_base && address < state->m_slapstic_base + 0x8000) + address &= ~m_slapstic_mirror; + if (address >= m_slapstic_base && address < m_slapstic_base + 0x8000) { offs_t pc = cpu_get_previouspc(&direct.space().device()); - if (pc != state->m_slapstic_last_pc || address != state->m_slapstic_last_address) + if (pc != m_slapstic_last_pc || address != m_slapstic_last_address) { - state->m_slapstic_last_pc = pc; - state->m_slapstic_last_address = address; + m_slapstic_last_pc = pc; + m_slapstic_last_address = address; atarigen_slapstic_r(&direct.space(), (address >> 1) & 0x3fff, 0xffff); } return ~0; @@ -514,7 +512,7 @@ void atarigen_slapstic_init(device_t *device, offs_t base, offs_t mirror, int ch state->m_slapstic_mirror = mirror; address_space *space = downcast(device)->space(AS_PROGRAM); - space->set_direct_update_handler(direct_update_delegate(FUNC(atarigen_slapstic_setdirect), &device->machine())); + space->set_direct_update_handler(direct_update_delegate(FUNC(atarigen_state::atarigen_slapstic_setdirect), state)); } } diff --git a/src/mame/machine/atarigen.h b/src/mame/machine/atarigen.h index 9c26cba0522..5d6e67bef8d 100644 --- a/src/mame/machine/atarigen.h +++ b/src/mame/machine/atarigen.h @@ -188,6 +188,8 @@ public: UINT32 m_playfield2_latch; atarigen_screen_timer m_screen_timer[2]; + + DECLARE_DIRECT_UPDATE_MEMBER(atarigen_slapstic_setdirect); }; diff --git a/src/mame/machine/snes.c b/src/mame/machine/snes.c index bfe8f8aae5d..82dec0a4a93 100644 --- a/src/mame/machine/snes.c +++ b/src/mame/machine/snes.c @@ -1838,13 +1838,13 @@ static void snes_init_ram( running_machine &machine ) } -DIRECT_UPDATE_HANDLER( snes_spc_direct ) +DIRECT_UPDATE_MEMBER(snes_state::snes_spc_direct) { - direct.explicit_configure(0x0000, 0xffff, 0xffff, spc_get_ram(machine.device("spc700"))); + direct.explicit_configure(0x0000, 0xffff, 0xffff, spc_get_ram(machine().device("spc700"))); return ~0; } -DIRECT_UPDATE_HANDLER( snes_direct ) +DIRECT_UPDATE_MEMBER(snes_state::snes_direct) { direct.explicit_configure(0x0000, 0xffff, 0xffff, snes_ram); return ~0; @@ -1860,8 +1860,8 @@ MACHINE_START( snes ) state->m_spc700 = machine.device("spc700"); state->m_superfx = machine.device("superfx"); - state->m_maincpu->space(AS_PROGRAM)->set_direct_update_handler(direct_update_delegate(FUNC(snes_direct), &machine)); - state->m_soundcpu->space(AS_PROGRAM)->set_direct_update_handler(direct_update_delegate(FUNC(snes_spc_direct), &machine)); + state->m_maincpu->space(AS_PROGRAM)->set_direct_update_handler(direct_update_delegate(FUNC(snes_state::snes_direct), state)); + state->m_soundcpu->space(AS_PROGRAM)->set_direct_update_handler(direct_update_delegate(FUNC(snes_state::snes_spc_direct), state)); // power-on sets these registers like this snes_ram[WRIO] = 0xff;