From 48ade6ac7b4368eb76888667c9cdc2b4bd689a1a Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Thu, 8 Mar 2018 18:18:17 +0100 Subject: misc first_screen() removal (nw) --- src/mame/drivers/apple1.cpp | 41 +++++++++++++++++++++++------------------ src/mame/drivers/casloopy.cpp | 31 ++++++++++++++++++++----------- src/mame/drivers/lynx.cpp | 3 +-- src/mame/drivers/popper.cpp | 40 +++++++++++++++++++++------------------- src/mame/drivers/rungun.cpp | 2 +- src/mame/drivers/tk2000.cpp | 39 ++++++++++++++++++++++----------------- 6 files changed, 88 insertions(+), 68 deletions(-) (limited to 'src/mame/drivers') diff --git a/src/mame/drivers/apple1.cpp b/src/mame/drivers/apple1.cpp index 46396fcc91e..b513796eb9e 100644 --- a/src/mame/drivers/apple1.cpp +++ b/src/mame/drivers/apple1.cpp @@ -96,6 +96,7 @@ public: m_maincpu(*this, A1_CPU_TAG), m_pia(*this, A1_PIA_TAG), m_ram(*this, RAM_TAG), + m_screen(*this, "screen"), m_basicram(*this, A1_BASICRAM_TAG), m_kb0(*this, "KEY0"), m_kb1(*this, "KEY1"), @@ -104,14 +105,33 @@ public: m_kbspecial(*this, "KBSPECIAL") { } + void apple1(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + +private: required_device m_maincpu; required_device m_pia; required_device m_ram; + required_device m_screen; required_shared_ptr m_basicram; required_ioport m_kb0, m_kb1, m_kb2, m_kb3, m_kbspecial; - virtual void machine_start() override; - virtual void machine_reset() override; + uint8_t *m_ram_ptr, *m_char_ptr; + int m_ram_size, m_char_size; + + uint8_t m_vram[40*24]; + int m_cursx, m_cursy; + + bool m_reset_down; + bool m_clear_down; + + uint8_t m_transchar; + uint16_t m_lastports[4]; + + emu_timer *m_ready_start_timer, *m_ready_end_timer, *m_kbd_strobe_timer; DECLARE_PALETTE_INIT(apple2); uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); @@ -126,25 +146,10 @@ public: TIMER_CALLBACK_MEMBER(ready_end_cb); TIMER_CALLBACK_MEMBER(keyboard_strobe_cb); - void apple1(machine_config &config); void apple1_map(address_map &map); -private: - uint8_t *m_ram_ptr, *m_char_ptr; - int m_ram_size, m_char_size; - - uint8_t m_vram[40*24]; - int m_cursx, m_cursy; - - bool m_reset_down; - bool m_clear_down; - - uint8_t m_transchar; - uint16_t m_lastports[4]; void plot_text_character(bitmap_ind16 &bitmap, int xpos, int ypos, int xscale, uint32_t code, const uint8_t *textgfx_data, uint32_t textgfx_datalen); void poll_keyboard(); - - emu_timer *m_ready_start_timer, *m_ready_end_timer, *m_kbd_strobe_timer; }; static const uint8_t apple1_keymap[] = @@ -493,7 +498,7 @@ WRITE_LINE_MEMBER(apple1_state::pia_display_gate_w) // falling edge means start the display timer if (state == CLEAR_LINE) { - m_ready_start_timer->adjust(machine().first_screen()->time_until_pos(m_cursy, m_cursx)); + m_ready_start_timer->adjust(m_screen->time_until_pos(m_cursy, m_cursx)); } } diff --git a/src/mame/drivers/casloopy.cpp b/src/mame/drivers/casloopy.cpp index 7c4eaf05e1b..a4eadcd402d 100644 --- a/src/mame/drivers/casloopy.cpp +++ b/src/mame/drivers/casloopy.cpp @@ -167,25 +167,34 @@ public: m_maincpu(*this, "maincpu"), m_cart(*this, "cartslot"), m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") { } + m_palette(*this, "palette"), + m_screen(*this, "screen") { } + void casloopy(machine_config &config); + + DECLARE_DRIVER_INIT(casloopy); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; + +private: required_shared_ptr m_bios_rom; required_shared_ptr m_vregs; required_device m_maincpu; required_device m_cart; required_device m_gfxdecode; required_device m_palette; + required_device m_screen; std::unique_ptr m_paletteram; std::unique_ptr m_vram; std::unique_ptr m_bitmap_vram; uint16_t sh7021_regs[0x100]; int m_gfx_index; - DECLARE_DRIVER_INIT(casloopy); - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; - uint32_t screen_update_casloopy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_READ16_MEMBER(vregs_r); DECLARE_WRITE16_MEMBER(vregs_w); DECLARE_READ16_MEMBER(pal_r); @@ -198,7 +207,7 @@ public: DECLARE_READ8_MEMBER(bitmap_r); DECLARE_WRITE8_MEMBER(bitmap_w); DECLARE_DEVICE_IMAGE_LOAD_MEMBER(loopy_cart); - void casloopy(machine_config &config); + void casloopy_map(address_map &map); void casloopy_sub_map(address_map &map); }; @@ -244,7 +253,7 @@ void casloopy_state::video_start() m_gfxdecode->set_gfx(m_gfx_index+1, std::make_unique(m_palette, casloopy_8bpp_layout, m_vram.get(), 0, 1, 0)); } -uint32_t casloopy_state::screen_update_casloopy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t casloopy_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { gfx_element *gfx = m_gfxdecode->gfx(m_gfx_index); int x,y; @@ -308,11 +317,11 @@ READ16_MEMBER(casloopy_state::vregs_r) { if(offset == 4/2) { - return (machine().first_screen()->vblank() << 8) | (machine().rand() & 0xff); // vblank + vpos? + return (m_screen->vblank() << 8) | (machine().rand() & 0xff); // vblank + vpos? } if(offset == 2/2) - return machine().rand();/*(machine().first_screen()->hblank() << 8) | (machine().first_screen()->hpos() & 0xff);*/ // hblank + hpos? + return machine().rand();/*(m_screen->hblank() << 8) | (m_screen->hpos() & 0xff);*/ // hblank + hpos? if(offset == 0/2) return machine().rand(); // pccllect @@ -522,7 +531,7 @@ MACHINE_CONFIG_START(casloopy_state::casloopy) // MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) // MCFG_SCREEN_SIZE(444, 263) // MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1) - MCFG_SCREEN_UPDATE_DRIVER(casloopy_state, screen_update_casloopy) + MCFG_SCREEN_UPDATE_DRIVER(casloopy_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_PALETTE_ADD("palette", 512) diff --git a/src/mame/drivers/lynx.cpp b/src/mame/drivers/lynx.cpp index 24d89a0a289..3e7d54aa1a6 100644 --- a/src/mame/drivers/lynx.cpp +++ b/src/mame/drivers/lynx.cpp @@ -13,7 +13,6 @@ #include "audio/lynx.h" #include "cpu/m6502/m65sc02.h" -#include "screen.h" #include "softlist.h" #include "speaker.h" @@ -60,7 +59,7 @@ PALETTE_INIT_MEMBER(lynx_state, lynx) void lynx_state::video_start() { - machine().first_screen()->register_screen_bitmap(m_bitmap); + m_screen->register_screen_bitmap(m_bitmap); } uint32_t lynx_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) diff --git a/src/mame/drivers/popper.cpp b/src/mame/drivers/popper.cpp index f1b6be4c994..13bd773ca13 100644 --- a/src/mame/drivers/popper.cpp +++ b/src/mame/drivers/popper.cpp @@ -69,25 +69,8 @@ public: m_nmi_enable(0), m_back_color(0), m_vram_page(0) { } - DECLARE_PALETTE_INIT(popper); - uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - TILE_GET_INFO_MEMBER(layer0_tile_info); - TILE_GET_INFO_MEMBER(layer1_tile_info); - - DECLARE_WRITE8_MEMBER(nmi_control_w); - DECLARE_WRITE8_MEMBER(crt_direction_w); - DECLARE_WRITE8_MEMBER(back_color_select_w); - DECLARE_WRITE8_MEMBER(vram_page_select_w); - DECLARE_WRITE8_MEMBER(intcycle_w); - DECLARE_READ8_MEMBER(subcpu_nmi_r); - DECLARE_READ8_MEMBER(subcpu_reset_r); - DECLARE_WRITE8_MEMBER(ay1_w); - DECLARE_READ8_MEMBER(watchdog_clear_r); - DECLARE_READ8_MEMBER(inputs_r); - void popper(machine_config &config); - void main_map(address_map &map); - void sub_map(address_map &map); + protected: virtual void machine_start() override; virtual void machine_reset() override; @@ -111,6 +94,25 @@ private: int m_nmi_enable; int m_back_color; int m_vram_page; + + void main_map(address_map &map); + void sub_map(address_map &map); + + DECLARE_PALETTE_INIT(popper); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + TILE_GET_INFO_MEMBER(layer0_tile_info); + TILE_GET_INFO_MEMBER(layer1_tile_info); + + DECLARE_WRITE8_MEMBER(nmi_control_w); + DECLARE_WRITE8_MEMBER(crt_direction_w); + DECLARE_WRITE8_MEMBER(back_color_select_w); + DECLARE_WRITE8_MEMBER(vram_page_select_w); + DECLARE_WRITE8_MEMBER(intcycle_w); + DECLARE_READ8_MEMBER(subcpu_nmi_r); + DECLARE_READ8_MEMBER(subcpu_reset_r); + DECLARE_WRITE8_MEMBER(ay1_w); + DECLARE_READ8_MEMBER(watchdog_clear_r); + DECLARE_READ8_MEMBER(inputs_r); }; @@ -509,7 +511,7 @@ void popper_state::machine_start() // allocate and start scanline timer m_scanline_timer = timer_alloc(0); - m_scanline_timer->adjust(machine().first_screen()->time_until_pos(0, 0)); + m_scanline_timer->adjust(m_screen->time_until_pos(0, 0)); // register for save states save_item(NAME(m_nmi_enable)); diff --git a/src/mame/drivers/rungun.cpp b/src/mame/drivers/rungun.cpp index 0be791f2a65..400fae0b805 100644 --- a/src/mame/drivers/rungun.cpp +++ b/src/mame/drivers/rungun.cpp @@ -69,7 +69,7 @@ READ16_MEMBER(rungun_state::rng_sysregs_r) bit9 : screen output select */ { - uint8_t field_bit = machine().first_screen()->frame_number() & 1; + uint8_t field_bit = m_screen->frame_number() & 1; if(m_single_screen_mode == true) field_bit = 1; return (ioport("SYSTEM")->read() & 0xfdff) | (field_bit << 9); diff --git a/src/mame/drivers/tk2000.cpp b/src/mame/drivers/tk2000.cpp index 40fe47e4fec..567a5856e4c 100644 --- a/src/mame/drivers/tk2000.cpp +++ b/src/mame/drivers/tk2000.cpp @@ -2,7 +2,7 @@ // copyright-holders:R. Belmont /*************************************************************************** - tk2000.c - Microdigital TK2000 + tk2000.cpp - Microdigital TK2000 Driver by R. Belmont @@ -45,6 +45,7 @@ public: : driver_device(mconfig, type, tag), m_maincpu(*this, A2_CPU_TAG), m_ram(*this, RAM_TAG), + m_screen(*this, "screen"), m_video(*this, A2_VIDEO_TAG), m_row0(*this, "ROW0"), m_row1(*this, "ROW1"), @@ -59,10 +60,18 @@ public: m_speaker(*this, A2_SPEAKER_TAG), m_cassette(*this, A2_CASSETTE_TAG), m_upperbank(*this, A2_UPPERBANK_TAG) - { } + { } + void tk2000(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + +private: required_device m_maincpu; required_device m_ram; + required_device m_screen; required_device m_video; required_ioport m_row0, m_row1, m_row2, m_row3, m_row4, m_row5, m_row6, m_row7; required_ioport m_kbspecial; @@ -71,10 +80,17 @@ public: required_device m_cassette; required_device m_upperbank; - TIMER_DEVICE_CALLBACK_MEMBER(apple2_interrupt); + int m_speaker_state; + int m_cassette_state; - virtual void machine_start() override; - virtual void machine_reset() override; + uint8_t m_strobe; + + bool m_page2; + + uint8_t *m_ram_ptr; + int m_ram_size; + + TIMER_DEVICE_CALLBACK_MEMBER(apple2_interrupt); DECLARE_PALETTE_INIT(tk2000); uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); @@ -88,19 +104,8 @@ public: DECLARE_READ8_MEMBER(c100_r); DECLARE_WRITE8_MEMBER(c100_w); - void tk2000(machine_config &config); void apple2_map(address_map &map); void inhbank_map(address_map &map); -private: - int m_speaker_state; - int m_cassette_state; - - uint8_t m_strobe; - - bool m_page2; - - uint8_t *m_ram_ptr; - int m_ram_size; void do_io(address_space &space, int offset); uint8_t read_floatingbus(); @@ -148,7 +153,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(tk2000_state::apple2_interrupt) int scanline = param; if((scanline % 8) == 0) - machine().first_screen()->update_partial(machine().first_screen()->vpos()); + m_screen->update_partial(m_screen->vpos()); // update the video system's shadow copy of the system config at the end of the frame if (scanline == 192) -- cgit v1.2.3