From 1a986cdf39db235c4b1ca70e74b3460524a5d0bd Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Mon, 21 May 2018 09:25:19 +0200 Subject: vcombat.cpp device_finder (nw) --- src/mame/drivers/vcombat.cpp | 43 +++++++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/src/mame/drivers/vcombat.cpp b/src/mame/drivers/vcombat.cpp index 2b94f202bf6..01369bac338 100644 --- a/src/mame/drivers/vcombat.cpp +++ b/src/mame/drivers/vcombat.cpp @@ -54,7 +54,7 @@ NOTES : Shadow Fighters appears to have been dumped from an earlier from Virtual Combat have been used. The Shadow Fighters bottom board has an extra 20 mhz xtal on it. The data stored in "samples" is simply a series of - Creative Media VOC files concatenated to eachother. + Creative Media VOC files concatenated to each other. The sound program ("sound") is about 640 bytes long. The hardware is said to run at medium resolution. The SRAM module dump can likely be thrown away for both games. @@ -106,13 +106,29 @@ public: m_soundcpu(*this, "soundcpu"), m_vid_0(*this, "vid_0"), m_vid_1(*this, "vid_1"), - m_dac(*this, "dac") { } + m_dac(*this, "dac"), + m_crtc(*this, "crtc") { } - std::unique_ptr m_m68k_framebuffer[2]; - std::unique_ptr m_i860_framebuffer[2][2]; + void init_shadfgtr(); + void init_vcombat(); + + void shadfgtr(machine_config &config); + void vcombat(machine_config &config); + +private: required_device m_tlc34076; required_shared_ptr m_framebuffer_ctrl; + required_device m_maincpu; + required_device m_soundcpu; + required_device m_vid_0; + optional_device m_vid_1; + required_device m_dac; + optional_device m_crtc; + + std::unique_ptr m_m68k_framebuffer[2]; + std::unique_ptr m_i860_framebuffer[2][2]; int m_crtc_select; + DECLARE_WRITE16_MEMBER(main_video_write); DECLARE_READ16_MEMBER(control_1_r); DECLARE_READ16_MEMBER(control_2_r); @@ -126,20 +142,13 @@ public: DECLARE_WRITE16_MEMBER(crtc_w); DECLARE_WRITE16_MEMBER(vcombat_dac_w); DECLARE_WRITE_LINE_MEMBER(sound_update); - void init_shadfgtr(); - void init_vcombat(); + DECLARE_MACHINE_RESET(vcombat); DECLARE_MACHINE_RESET(shadfgtr); uint32_t update_screen(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int index); uint32_t screen_update_vcombat_main(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); uint32_t screen_update_vcombat_aux(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - required_device m_maincpu; - required_device m_soundcpu; - required_device m_vid_0; - optional_device m_vid_1; - required_device m_dac; - void shadfgtr(machine_config &config); - void vcombat(machine_config &config); + void main_map(address_map &map); void sound_map(address_map &map); void vid_0_map(address_map &map); @@ -335,15 +344,13 @@ WRITE64_MEMBER(vcombat_state::v1_fb_w) WRITE16_MEMBER(vcombat_state::crtc_w) { - mc6845_device *crtc = machine().device("crtc"); - - if (crtc == nullptr) + if (m_crtc == nullptr) return; if (m_crtc_select == 0) - crtc->address_w(space, 0, data >> 8); + m_crtc->address_w(space, 0, data >> 8); else - crtc->register_w(space, 0, data >> 8); + m_crtc->register_w(space, 0, data >> 8); m_crtc_select ^= 1; } -- cgit v1.2.3