From 00286343c14cb3d70930c76668d9364cc29a2c0e Mon Sep 17 00:00:00 2001 From: AJR Date: Tue, 3 Apr 2018 17:14:51 -0400 Subject: [PATCH] Separate a few Atari drivers from atarigen_state (nw) --- src/mame/drivers/badlands.cpp | 22 +++++++--------------- src/mame/drivers/badlandsbl.cpp | 1 - src/mame/drivers/batman.cpp | 12 ++---------- src/mame/drivers/cybstorm.cpp | 12 ++---------- src/mame/drivers/offtwall.cpp | 17 ++--------------- src/mame/includes/badlands.h | 13 +++++++++---- src/mame/includes/batman.h | 9 ++++++--- src/mame/includes/cybstorm.h | 11 ++++++++--- src/mame/includes/offtwall.h | 7 ++++--- 9 files changed, 40 insertions(+), 64 deletions(-) diff --git a/src/mame/drivers/badlands.cpp b/src/mame/drivers/badlands.cpp index afe7d0eb395..4b93296610d 100644 --- a/src/mame/drivers/badlands.cpp +++ b/src/mame/drivers/badlands.cpp @@ -174,17 +174,6 @@ Measurements - * *************************************/ -void badlands_state::update_interrupts() -{ - m_maincpu->set_input_line(1, m_video_int_state ? ASSERT_LINE : CLEAR_LINE); -} - - -void badlands_state::scanline_update(screen_device &screen, int scanline) -{ - // sound CPU irq is scanline controlled, we update it below to make bootlegs happy -} - TIMER_DEVICE_CALLBACK_MEMBER(badlands_state::sound_scanline) { int scanline = param; @@ -198,7 +187,6 @@ TIMER_DEVICE_CALLBACK_MEMBER(badlands_state::sound_scanline) MACHINE_START_MEMBER(badlands_state,badlands) { - atarigen_state::machine_start(); save_item(NAME(m_pedal_value)); } @@ -207,7 +195,6 @@ MACHINE_RESET_MEMBER(badlands_state,badlands) { m_pedal_value[0] = m_pedal_value[1] = 0x80; - atarigen_state::machine_reset(); //scanline_timer_reset(*m_screen, 32); membank("soundbank")->set_entry(0); @@ -235,7 +222,12 @@ INTERRUPT_GEN_MEMBER(badlands_state::vblank_int) m_pedal_value[i]++; } - video_int_write_line(1); + m_maincpu->set_input_line(M68K_IRQ_1, ASSERT_LINE); +} + +WRITE16_MEMBER(badlands_state::video_int_ack_w) +{ + m_maincpu->set_input_line(M68K_IRQ_1, CLEAR_LINE); } @@ -383,7 +375,7 @@ void badlands_state::main_map(address_map &map) map(0xfea000, 0xfebfff).r(m_soundcomm, FUNC(atari_sound_comm_device::main_response_r)).umask16(0xff00); map(0xfec000, 0xfedfff).w(this, FUNC(badlands_state::badlands_pf_bank_w)); map(0xfee000, 0xfeffff).w("eeprom", FUNC(eeprom_parallel_28xx_device::unlock_write16)); - map(0xffc000, 0xffc3ff).rw(m_palette, FUNC(palette_device::read8), FUNC(palette_device::write8)).umask16(0xff00).share("palette"); + map(0xffc000, 0xffc3ff).rw("palette", FUNC(palette_device::read8), FUNC(palette_device::write8)).umask16(0xff00).share("palette"); map(0xffe000, 0xffefff).ram().w(m_playfield_tilemap, FUNC(tilemap_device::write16)).share("playfield"); map(0xfff000, 0xfff1ff).ram().share("mob"); map(0xfff200, 0xffffff).ram(); diff --git a/src/mame/drivers/badlandsbl.cpp b/src/mame/drivers/badlandsbl.cpp index 29b99ec8f8f..396c329d206 100644 --- a/src/mame/drivers/badlandsbl.cpp +++ b/src/mame/drivers/badlandsbl.cpp @@ -203,7 +203,6 @@ GFXDECODE_END void badlandsbl_state::machine_reset() { // m_pedal_value[0] = m_pedal_value[1] = 0x80; - atarigen_state::machine_reset(); // scanline_timer_reset(*m_screen, 32); // memcpy(m_bank_base, &m_bank_source_data[0x0000], 0x1000); diff --git a/src/mame/drivers/batman.cpp b/src/mame/drivers/batman.cpp index 38a9a222834..b1b794d0673 100644 --- a/src/mame/drivers/batman.cpp +++ b/src/mame/drivers/batman.cpp @@ -35,16 +35,8 @@ * *************************************/ -void batman_state::update_interrupts() -{ - m_maincpu->set_input_line(4, m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); -} - - void batman_state::machine_start() { - atarigen_state::machine_start(); - save_item(NAME(m_latch_data)); save_item(NAME(m_alpha_tile_bank)); } @@ -103,7 +95,7 @@ void batman_state::main_map(address_map &map) map(0x260050, 0x260051).mirror(0x11ff8e).w(this, FUNC(batman_state::latch_w)); map(0x260060, 0x260061).mirror(0x11ff8e).w("eeprom", FUNC(eeprom_parallel_28xx_device::unlock_write16)); map(0x2a0000, 0x2a0001).mirror(0x11fffe).w("watchdog", FUNC(watchdog_timer_device::reset16_w)); - map(0x2e0000, 0x2e0fff).mirror(0x100000).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); + map(0x2e0000, 0x2e0fff).mirror(0x100000).ram().w("palette", FUNC(palette_device::write16)).share("palette"); map(0x2effc0, 0x2effff).mirror(0x100000).rw(m_vad, FUNC(atari_vad_device::control_read), FUNC(atari_vad_device::control_write)); map(0x2f0000, 0x2fffff).mirror(0x100000).ram(); map(0x2f0000, 0x2f1fff).mirror(0x100000).w(m_vad, FUNC(atari_vad_device::playfield2_latched_msb_w)).share("vad:playfield2"); @@ -207,7 +199,7 @@ MACHINE_CONFIG_START(batman_state::batman) MCFG_PALETTE_ADD("palette", 2048) MCFG_PALETTE_FORMAT(IRRRRRGGGGGBBBBB) - MCFG_ATARI_VAD_ADD("vad", "screen", WRITELINE(batman_state, scanline_int_write_line)) + MCFG_ATARI_VAD_ADD("vad", "screen", INPUTLINE("maincpu", M68K_IRQ_4)) MCFG_ATARI_VAD_PLAYFIELD(batman_state, "gfxdecode", get_playfield_tile_info) MCFG_ATARI_VAD_PLAYFIELD2(batman_state, "gfxdecode", get_playfield2_tile_info) MCFG_ATARI_VAD_ALPHA(batman_state, "gfxdecode", get_alpha_tile_info) diff --git a/src/mame/drivers/cybstorm.cpp b/src/mame/drivers/cybstorm.cpp index 5c8a5c11be4..a66b73c1050 100644 --- a/src/mame/drivers/cybstorm.cpp +++ b/src/mame/drivers/cybstorm.cpp @@ -29,15 +29,8 @@ * *************************************/ -void cybstorm_state::update_interrupts() -{ - m_maincpu->set_input_line(4, m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); -} - - void cybstorm_state::machine_start() { - atarigen_state::machine_start(); save_item(NAME(m_latch_data)); save_item(NAME(m_alpha_tile_bank)); } @@ -90,7 +83,7 @@ WRITE32_MEMBER(cybstorm_state::latch_w) void cybstorm_state::main_map(address_map &map) { map(0x000000, 0x1fffff).rom(); - map(0x200000, 0x20ffff).ram().w(m_palette, FUNC(palette_device::write32)).share("palette"); + map(0x200000, 0x20ffff).ram().w("palette", FUNC(palette_device::write32)).share("palette"); map(0x3effc0, 0x3effff).rw(m_vad, FUNC(atari_vad_device::control_read), FUNC(atari_vad_device::control_write)); map(0x3f0000, 0x3fffff).m(m_vadbank, FUNC(address_map_bank_device::amap16)); map(0x9f0000, 0x9f0003).portr("9F0000"); @@ -240,7 +233,7 @@ MACHINE_CONFIG_START(cybstorm_state::round2) MCFG_WATCHDOG_ADD("watchdog") /* video hardware */ - MCFG_ATARI_VAD_ADD("vad", "screen", WRITELINE(cybstorm_state, scanline_int_write_line)) + MCFG_ATARI_VAD_ADD("vad", "screen", INPUTLINE("maincpu", M68K_IRQ_4)) MCFG_ATARI_VAD_PLAYFIELD(cybstorm_state, "gfxdecode", get_playfield_tile_info) MCFG_ATARI_VAD_PLAYFIELD2(cybstorm_state, "gfxdecode", get_playfield2_tile_info) MCFG_ATARI_VAD_ALPHA(cybstorm_state, "gfxdecode", get_alpha_tile_info) @@ -262,7 +255,6 @@ MACHINE_CONFIG_START(cybstorm_state::round2) /* note: these parameters are from published specs, not derived */ /* the board uses an SOS-2 chip to generate video signals */ MCFG_SCREEN_RAW_PARAMS(ATARI_CLOCK_14MHz/2, 456, 0, 336, 262, 0, 240) - MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(cybstorm_state, video_int_write_line)) MCFG_SCREEN_UPDATE_DRIVER(cybstorm_state, screen_update_cybstorm) MACHINE_CONFIG_END diff --git a/src/mame/drivers/offtwall.cpp b/src/mame/drivers/offtwall.cpp index a4045420152..2869a62d376 100644 --- a/src/mame/drivers/offtwall.cpp +++ b/src/mame/drivers/offtwall.cpp @@ -29,19 +29,6 @@ -/************************************* - * - * Interrupt handling - * - *************************************/ - -void offtwall_state::update_interrupts() -{ - m_maincpu->set_input_line(4, m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); -} - - - /************************************* * * I/O handling @@ -238,7 +225,7 @@ void offtwall_state::main_map(address_map &map) map(0x260050, 0x260051).w(this, FUNC(offtwall_state::io_latch_w)); map(0x260060, 0x260061).w("eeprom", FUNC(eeprom_parallel_28xx_device::unlock_write16)); map(0x2a0000, 0x2a0001).w("watchdog", FUNC(watchdog_timer_device::reset16_w)); - map(0x3e0000, 0x3e0fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); + map(0x3e0000, 0x3e0fff).ram().w("palette", FUNC(palette_device::write16)).share("palette"); map(0x3effc0, 0x3effff).rw(m_vad, FUNC(atari_vad_device::control_read), FUNC(atari_vad_device::control_write)); map(0x3f4000, 0x3f5eff).ram().w(m_vad, FUNC(atari_vad_device::playfield_latched_msb_w)).share("vad:playfield"); map(0x3f5f00, 0x3f5f7f).ram().share("vad:eof"); @@ -364,7 +351,7 @@ MACHINE_CONFIG_START(offtwall_state::offtwall) MCFG_PALETTE_ADD("palette", 2048) MCFG_PALETTE_FORMAT(IRRRRRGGGGGBBBBB) - MCFG_ATARI_VAD_ADD("vad", "screen", WRITELINE(offtwall_state, scanline_int_write_line)) + MCFG_ATARI_VAD_ADD("vad", "screen", INPUTLINE("maincpu", M68K_IRQ_4)) MCFG_ATARI_VAD_PLAYFIELD(offtwall_state, "gfxdecode", get_playfield_tile_info) MCFG_ATARI_VAD_MOB(offtwall_state::s_mob_config, "gfxdecode") diff --git a/src/mame/includes/badlands.h b/src/mame/includes/badlands.h index 34ff6203b4b..e7f2ad95ba7 100644 --- a/src/mame/includes/badlands.h +++ b/src/mame/includes/badlands.h @@ -29,25 +29,29 @@ INPUT_PORTS_EXTERN(badlands); -class badlands_state : public atarigen_state +class badlands_state : public driver_device { public: badlands_state(const machine_config &mconfig, device_type type, const char *tag) - : atarigen_state(mconfig, type, tag), + : driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu"), m_soundcomm(*this, "soundcomm"), + m_screen(*this, "screen"), + m_gfxdecode(*this, "gfxdecode"), m_playfield_tilemap(*this, "playfield"), m_mob(*this, "mob") { } + required_device m_maincpu; optional_device m_audiocpu; optional_device m_soundcomm; + required_device m_screen; + required_device m_gfxdecode; required_device m_playfield_tilemap; optional_device m_mob; - virtual void update_interrupts() override; - virtual void scanline_update(screen_device &screen, int scanline) override; DECLARE_READ16_MEMBER(sound_busy_r); DECLARE_READ16_MEMBER(pedal_0_r); DECLARE_READ16_MEMBER(pedal_1_r); @@ -60,6 +64,7 @@ public: DECLARE_VIDEO_START(badlands); uint32_t screen_update_badlands(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vblank_int); + DECLARE_WRITE16_MEMBER(video_int_ack_w); TIMER_DEVICE_CALLBACK_MEMBER(sound_scanline); DECLARE_WRITE16_MEMBER( badlands_pf_bank_w ); diff --git a/src/mame/includes/batman.h b/src/mame/includes/batman.h index 4118e09ef6c..91cc513dca7 100644 --- a/src/mame/includes/batman.h +++ b/src/mame/includes/batman.h @@ -14,11 +14,13 @@ #include "audio/atarijsa.h" #include "video/atarimo.h" -class batman_state : public atarigen_state +class batman_state : public driver_device { public: batman_state(const machine_config &mconfig, device_type type, const char *tag) : - atarigen_state(mconfig, type, tag), + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_screen(*this, "screen"), m_jsa(*this, "jsa"), m_vad(*this, "vad") { } @@ -34,10 +36,11 @@ protected: TILE_GET_INFO_MEMBER(get_playfield2_tile_info); uint32_t screen_update_batman(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - virtual void update_interrupts() override; void main_map(address_map &map); private: + required_device m_maincpu; + required_device m_screen; required_device m_jsa; required_device m_vad; diff --git a/src/mame/includes/cybstorm.h b/src/mame/includes/cybstorm.h index f8699235027..0fc5c2012e1 100644 --- a/src/mame/includes/cybstorm.h +++ b/src/mame/includes/cybstorm.h @@ -15,14 +15,17 @@ #include "machine/bankdev.h" -class cybstorm_state : public atarigen_state +class cybstorm_state : public driver_device { public: cybstorm_state(const machine_config &mconfig, device_type type, const char *tag) - : atarigen_state(mconfig, type, tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") , m_jsa(*this, "jsa") , m_vad(*this, "vad") , m_vadbank(*this, "vadbank") + , m_screen(*this, "screen") + , m_gfxdecode(*this, "gfxdecode") { } DECLARE_DRIVER_INIT(cybstorm); @@ -31,7 +34,6 @@ public: protected: virtual void machine_start() override; virtual void video_start() override; - virtual void update_interrupts() override; DECLARE_READ32_MEMBER(special_port1_r); DECLARE_WRITE32_MEMBER(latch_w); @@ -48,9 +50,12 @@ protected: void vadbank_map(address_map &map); private: + required_device m_maincpu; optional_device m_jsa; required_device m_vad; required_device m_vadbank; + required_device m_screen; + required_device m_gfxdecode; uint32_t m_latch_data; uint8_t m_alpha_tile_bank; diff --git a/src/mame/includes/offtwall.h b/src/mame/includes/offtwall.h index 7b414e3d3c2..d229e835ca7 100644 --- a/src/mame/includes/offtwall.h +++ b/src/mame/includes/offtwall.h @@ -14,11 +14,12 @@ #include "audio/atarijsa.h" #include "video/atarimo.h" -class offtwall_state : public atarigen_state +class offtwall_state : public driver_device { public: offtwall_state(const machine_config &mconfig, device_type type, const char *tag) : - atarigen_state(mconfig, type, tag), + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), m_jsa(*this, "jsa"), m_vad(*this, "vad"), m_mainram(*this, "mainram"), @@ -31,7 +32,6 @@ public: void offtwall(machine_config &config); protected: - virtual void update_interrupts() override; DECLARE_WRITE16_MEMBER(io_latch_w); DECLARE_READ16_MEMBER(bankswitch_r); DECLARE_READ16_MEMBER(bankrom_r); @@ -42,6 +42,7 @@ protected: void main_map(address_map &map); private: + required_device m_maincpu; required_device m_jsa; required_device m_vad; required_shared_ptr m_mainram;