diff --git a/src/devices/video/hp1ll3.cpp b/src/devices/video/hp1ll3.cpp index dc6164cbbc2..175167811b7 100644 --- a/src/devices/video/hp1ll3.cpp +++ b/src/devices/video/hp1ll3.cpp @@ -183,7 +183,7 @@ void hp1ll3_device::device_start() // register for state saving save_item(NAME(m_conf)); - machine().first_screen()->register_screen_bitmap(m_bitmap); + screen().register_screen_bitmap(m_bitmap); m_cursor.allocate(16, 16); m_sprite.allocate(16, 16); diff --git a/src/mame/drivers/samcoupe.cpp b/src/mame/drivers/samcoupe.cpp index b6b705dd6b7..a639ffb80b8 100644 --- a/src/mame/drivers/samcoupe.cpp +++ b/src/mame/drivers/samcoupe.cpp @@ -117,12 +117,11 @@ WRITE8_MEMBER(samcoupe_state::samcoupe_disk_w) READ8_MEMBER(samcoupe_state::samcoupe_pen_r) { - screen_device *scr = machine().first_screen(); uint8_t data; if (offset & 0x100) { - int vpos = scr->vpos(); + int vpos = m_screen->vpos(); /* return the current screen line or 192 for the border area */ if (vpos < SAM_BORDER_TOP || vpos >= SAM_BORDER_TOP + SAM_SCREEN_HEIGHT) @@ -133,7 +132,7 @@ READ8_MEMBER(samcoupe_state::samcoupe_pen_r) else { /* horizontal position is encoded into bits 3 to 8 */ - data = scr->hpos() & 0xfc; + data = m_screen->hpos() & 0xfc; } return data; diff --git a/src/mame/includes/atarist.h b/src/mame/includes/atarist.h index 2f6ef3425f2..6910ad20956 100644 --- a/src/mame/includes/atarist.h +++ b/src/mame/includes/atarist.h @@ -20,6 +20,7 @@ #include "machine/wd_fdc.h" #include "sound/ay8910.h" #include "sound/lmc1992.h" +#include "screen.h" #define M68000_TAG "m68000" #define HD6301V1_TAG "hd6301" @@ -120,7 +121,8 @@ public: m_ikbd_mouse_pc(0), m_ikbd_joy(1), m_monochrome(1), - m_palette(*this, "palette") + m_palette(*this, "palette"), + m_screen(*this, "screen") { } required_device m_maincpu; @@ -333,6 +335,7 @@ public: int m_monochrome; required_device m_palette; + required_device m_screen; DECLARE_WRITE_LINE_MEMBER( write_monochrome ); void st(machine_config &config); diff --git a/src/mame/includes/samcoupe.h b/src/mame/includes/samcoupe.h index adc560d9788..983636b8761 100644 --- a/src/mame/includes/samcoupe.h +++ b/src/mame/includes/samcoupe.h @@ -19,6 +19,7 @@ #include "machine/ram.h" #include "machine/wd_fdc.h" #include "sound/spkrdev.h" +#include "screen.h" /* screen dimensions */ #define SAM_BLOCK 8 @@ -53,6 +54,7 @@ public: samcoupe_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), + m_screen(*this, "screen"), m_speaker(*this, "speaker"), m_cassette(*this, "cassette"), m_lpt1(*this, "lpt1"), @@ -156,6 +158,7 @@ public: uint8_t* sam_bank_write_ptr[4]; DECLARE_FLOPPY_FORMATS( floppy_formats ); required_device m_maincpu; + required_device m_screen; required_device m_speaker; required_device m_cassette; required_device m_lpt1; diff --git a/src/mame/machine/samcoupe.cpp b/src/mame/machine/samcoupe.cpp index 85be0128bbf..4a8d451fba5 100644 --- a/src/mame/machine/samcoupe.cpp +++ b/src/mame/machine/samcoupe.cpp @@ -8,7 +8,6 @@ #include "emu.h" #include "includes/samcoupe.h" -#include "screen.h" /*************************************************************************** CONSTANTS @@ -297,7 +296,7 @@ void samcoupe_state::machine_start() /* schedule our video updates */ m_video_update_timer = timer_alloc(TIMER_VIDEO_UPDATE); - m_video_update_timer->adjust(machine().first_screen()->time_until_pos(0, 0)); + m_video_update_timer->adjust(m_screen->time_until_pos(0, 0)); } /*************************************************************************** diff --git a/src/mame/video/atarist.cpp b/src/mame/video/atarist.cpp index 045a76a7a1d..11285b4872e 100644 --- a/src/mame/video/atarist.cpp +++ b/src/mame/video/atarist.cpp @@ -15,10 +15,6 @@ #include "video/atarist.h" #include "includes/atarist.h" -#include "cpu/m68000/m68000.h" -#include "machine/ram.h" -#include "screen.h" - //************************************************************************** @@ -136,8 +132,8 @@ inline pen_t st_state::shift_mode_2() void st_state::shifter_tick() { - int y = machine().first_screen()->vpos(); - int x = machine().first_screen()->hpos(); + int y = m_screen->vpos(); + int x = m_screen->hpos(); pen_t pen; @@ -201,8 +197,8 @@ void st_state::draw_pixel(int x, int y, u32 pen) void st_state::glue_tick() { - int y = machine().first_screen()->vpos(); - int x = machine().first_screen()->hpos(); + int y = m_screen->vpos(); + int x = m_screen->hpos(); int v = (y >= m_shifter_y_start) && (y < m_shifter_y_end); int h = (x >= m_shifter_x_start) && (x < m_shifter_x_end); @@ -1077,10 +1073,10 @@ void st_state::video_start() m_shifter_timer = timer_alloc(TIMER_SHIFTER_TICK); m_glue_timer = timer_alloc(TIMER_GLUE_TICK); -// m_shifter_timer->adjust(machine().first_screen()->time_until_pos(0), 0, attotime::from_hz(Y2/4)); // 125 ns - m_glue_timer->adjust(machine().first_screen()->time_until_pos(0), 0, attotime::from_hz(Y2/16)); // 500 ns +// m_shifter_timer->adjust(m_screen->time_until_pos(0), 0, attotime::from_hz(Y2/4)); // 125 ns + m_glue_timer->adjust(m_screen->time_until_pos(0), 0, attotime::from_hz(Y2/16)); // 500 ns - machine().first_screen()->register_screen_bitmap(m_bitmap); + m_screen->register_screen_bitmap(m_bitmap); /* register for state saving */ save_item(NAME(m_shifter_base)); diff --git a/src/mame/video/samcoupe.cpp b/src/mame/video/samcoupe.cpp index b3bd8d82649..57e924ecde1 100644 --- a/src/mame/video/samcoupe.cpp +++ b/src/mame/video/samcoupe.cpp @@ -8,7 +8,6 @@ #include "emu.h" #include "includes/samcoupe.h" -#include "screen.h" /*************************************************************************** @@ -29,7 +28,7 @@ void samcoupe_state::video_start() { - machine().first_screen()->register_screen_bitmap(m_bitmap); + m_screen->register_screen_bitmap(m_bitmap); } uint32_t samcoupe_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) @@ -124,8 +123,8 @@ void samcoupe_state::draw_mode1_line(int y, int hpos) TIMER_CALLBACK_MEMBER(samcoupe_state::sam_video_update_callback) { - int vpos = machine().first_screen()->vpos(); - int hpos = machine().first_screen()->hpos(); + int vpos = m_screen->vpos(); + int hpos = m_screen->hpos(); int next_vpos = vpos; int next_hpos = hpos + SAM_BLOCK*2; @@ -168,5 +167,5 @@ TIMER_CALLBACK_MEMBER(samcoupe_state::sam_video_update_callback) samcoupe_irq(SAM_LINE_INT); /* schedule next update */ - m_video_update_timer->adjust(machine().first_screen()->time_until_pos(next_vpos, next_hpos)); + m_video_update_timer->adjust(m_screen->time_until_pos(next_vpos, next_hpos)); }