diff --git a/.gitattributes b/.gitattributes index 850d91dea3d7d..04a8b21ceaed3 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1048,6 +1048,8 @@ src/emu/disound.c svneol=native#text/plain src/emu/disound.h svneol=native#text/plain src/emu/distate.c svneol=native#text/plain src/emu/distate.h svneol=native#text/plain +src/emu/divideo.c svneol=native#text/plain +src/emu/divideo.h svneol=native#text/plain src/emu/drawgfx.c svneol=native#text/plain src/emu/drawgfx.h svneol=native#text/plain src/emu/drawgfxm.h svneol=native#text/plain diff --git a/src/emu/divideo.c b/src/emu/divideo.c new file mode 100644 index 0000000000000..5844754e0e164 --- /dev/null +++ b/src/emu/divideo.c @@ -0,0 +1,144 @@ +/*************************************************************************** + + divideo.c + + Device video interfaces. + +**************************************************************************** + + Copyright Aaron Giles + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name 'MAME' nor the names of its contributors may be + used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +***************************************************************************/ + +#include "emu.h" + + + +//************************************************************************** +// DEVICE VIDEO INTERFACE +//************************************************************************** + +//------------------------------------------------- +// device_video_interface - constructor +//------------------------------------------------- + +device_video_interface::device_video_interface(const machine_config &mconfig, device_t &device, bool screen_required) + : device_interface(device), + m_screen_required(screen_required), + m_screen_tag(NULL), + m_screen(NULL) +{ +} + + +//------------------------------------------------- +// ~device_video_interface - destructor +//------------------------------------------------- + +device_video_interface::~device_video_interface() +{ +} + + +//------------------------------------------------- +// static_add_route - configuration helper to add +// a new route to the device +//------------------------------------------------- + +void device_video_interface::static_set_screen(device_t &device, const char *tag) +{ + // find our video interface + device_video_interface *video; + if (!device.interface(video)) + throw emu_fatalerror("MCFG_VIDEO_SET_SCREEN called on device '%s' with no video interface", device.tag()); + video->m_screen_tag = tag; +} + + +//------------------------------------------------- +// interface_validity_check - validation for a +// device after the configuration has been +// constructed +//------------------------------------------------- + +void device_video_interface::interface_validity_check(validity_checker &valid) const +{ + // find the screen device + screen_device *screen = NULL; + if (m_screen_tag != NULL) + { + screen = device().siblingdevice(m_screen_tag); + if (screen == NULL) + mame_printf_error("Screen '%s' not found, explicitly set for device '%s'", m_screen_tag, device().tag()); + } + + // if no device, look for a single match + if (screen == NULL) + { + screen_device_iterator iter(device().mconfig().root_device()); + screen = iter.first(); + if (screen == NULL && m_screen_required) + mame_printf_error("Device '%s' requires a screen", device().tag()); + if (iter.next() != NULL) + mame_printf_error("No screen specified for device '%s', but multiple screens found", device().tag()); + } +} + + +//------------------------------------------------- +// interface_pre_start - make sure all our input +// devices are started +//------------------------------------------------- + +void device_video_interface::interface_pre_start() +{ + // find the screen device + if (m_screen_tag != NULL) + { + m_screen = device().siblingdevice(m_screen_tag); + if (m_screen == NULL) + throw emu_fatalerror("Screen '%s' not found, explicitly set for device '%s'", m_screen_tag, device().tag()); + } + + // if no device, look for a single match + if (m_screen == NULL) + { + screen_device_iterator iter(device().machine().root_device()); + m_screen = iter.first(); + if (m_screen == NULL && m_screen_required) + throw emu_fatalerror("Device '%s' requires a screen", device().tag()); + if (iter.next() != NULL) + throw emu_fatalerror("No screen specified for device '%s', but multiple screens found", device().tag()); + } + + // if we have a screen and it's not started, wait for it + if (m_screen != NULL && !m_screen->started()) + throw device_missing_dependencies(); +} diff --git a/src/emu/divideo.h b/src/emu/divideo.h new file mode 100644 index 0000000000000..5b037e3b86552 --- /dev/null +++ b/src/emu/divideo.h @@ -0,0 +1,95 @@ +/*************************************************************************** + + divideo.h + + Device video interfaces. + +**************************************************************************** + + Copyright Aaron Giles + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name 'MAME' nor the names of its contributors may be + used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +***************************************************************************/ + +#pragma once + +#ifndef __EMU_H__ +#error Dont include this file directly; include emu.h instead. +#endif + +#ifndef __DIVIDEO_H__ +#define __DIVIDEO_H__ + + +//************************************************************************** +// INTERFACE CONFIGURATION MACROS +//************************************************************************** + +#define MCFG_VIDEO_SET_SCREEN(_tag) \ + device_video_interface::static_set_screen(*device, _tag); + + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> device_video_interface + +class device_video_interface : public device_interface +{ +public: + // construction/destruction + device_video_interface(const machine_config &mconfig, device_t &device, bool screen_required = true); + virtual ~device_video_interface(); + + // static configuration + static void static_set_screen(device_t &device, const char *tag); + + // getters + screen_device &screen() const { return *m_screen; } + +protected: + // optional operation overrides + virtual void interface_validity_check(validity_checker &valid) const; + virtual void interface_pre_start(); + + // configuration state + bool m_screen_required; // is a screen required? + const char * m_screen_tag; // configured tag for the target screen + + // internal state + screen_device * m_screen; // pointer to the screen device +}; + +// iterator +typedef device_interface_iterator video_interface_iterator; + + +#endif /* __DIVIDEO_H__ */ diff --git a/src/emu/driver.c b/src/emu/driver.c index deab4dbe73b33..6bb2a087846a3 100644 --- a/src/emu/driver.c +++ b/src/emu/driver.c @@ -63,6 +63,7 @@ ADDRESS_MAP_END driver_device::driver_device(const machine_config &mconfig, device_type type, const char *tag) : device_t(mconfig, type, "Driver Device", tag, NULL, 0, "", __FILE__), device_memory_interface(mconfig, *this), + m_screen(*this, "screen"), m_generic_paletteram_8(*this, "paletteram"), m_generic_paletteram2_8(*this, "paletteram2"), m_generic_paletteram_16(*this, "paletteram"), diff --git a/src/emu/driver.h b/src/emu/driver.h index 5f614d5aa70f2..af43ab408e108 100644 --- a/src/emu/driver.h +++ b/src/emu/driver.h @@ -422,6 +422,9 @@ class driver_device : public device_t, inline UINT32 paletteram32_be(offs_t offset) const { return m_generic_paletteram_16[offset | 1] | (m_generic_paletteram_16[offset & ~1] << 16); } public: + // generic devices + optional_device m_screen; + // generic pointers optional_shared_ptr m_generic_paletteram_8; optional_shared_ptr m_generic_paletteram2_8; diff --git a/src/emu/emu.h b/src/emu/emu.h index f7d8ee6bdb71a..d46e94f838ebb 100644 --- a/src/emu/emu.h +++ b/src/emu/emu.h @@ -101,6 +101,7 @@ typedef device_t * (*machine_config_constructor)(machine_config &config, device_ #include "diserial.h" #include "dislot.h" #include "disound.h" +#include "divideo.h" #include "dinvram.h" #include "dirtc.h" #include "didisasm.h" diff --git a/src/emu/emu.mak b/src/emu/emu.mak index 03012f7c80b71..5639cf85f4b5e 100644 --- a/src/emu/emu.mak +++ b/src/emu/emu.mak @@ -71,6 +71,7 @@ EMUOBJS = \ $(EMUOBJ)/dislot.o \ $(EMUOBJ)/disound.o \ $(EMUOBJ)/distate.o \ + $(EMUOBJ)/divideo.o \ $(EMUOBJ)/drawgfx.o \ $(EMUOBJ)/driver.o \ $(EMUOBJ)/drivenum.o \ diff --git a/src/emu/machine/k053252.c b/src/emu/machine/k053252.c index b798e83b203de..2fcc98f06d66a 100644 --- a/src/emu/machine/k053252.c +++ b/src/emu/machine/k053252.c @@ -59,7 +59,8 @@ xexex: 01 FF 00 21 00 37 01 00 00 20 0C 0E 54 00 00 00 384x256 ~ 384x256 (*) const device_type K053252 = &device_creator; k053252_device::k053252_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : device_t(mconfig, K053252, "Konami 053252", tag, owner, clock, "k053252", __FILE__) + : device_t(mconfig, K053252, "Konami 053252", tag, owner, clock, "k053252", __FILE__), + device_video_interface(mconfig, *this) { } @@ -79,7 +80,6 @@ void k053252_device::device_config_complete() // or initialize to defaults if none provided else { - m_screen_tag = ""; memset(&m_int1_en, 0, sizeof(m_int1_en)); memset(&m_int2_en, 0, sizeof(m_int2_en)); memset(&m_int1_ack, 0, sizeof(m_int1_ack)); @@ -95,7 +95,6 @@ void k053252_device::device_config_complete() void k053252_device::device_start() { save_item(NAME(m_regs)); - m_screen = machine().device(m_screen_tag); m_int1_en_func.resolve(m_int1_en, *this); m_int2_en_func.resolve(m_int2_en, *this); m_int1_ack_func.resolve(m_int1_ack, *this); @@ -141,28 +140,25 @@ READ8_MEMBER( k053252_device::read ) void k053252_device::res_change() { - if(m_screen != NULL) + if(m_hc && m_vc && + m_hbp && m_hfp && + m_vbp && m_vfp && + m_hsw && m_vsw) //safety checks { - if(m_hc && m_vc && - m_hbp && m_hfp && - m_vbp && m_vfp && - m_hsw && m_vsw) //safety checks - { - rectangle visarea; - //(HC+1) - HFP - HBP - 8*(HSW+1) - //VC - VFP - VBP - (VSW+1) - attoseconds_t refresh = HZ_TO_ATTOSECONDS(clock()) * (m_hc) * m_vc; - - //printf("H %d %d %d %d\n",m_hc,m_hfp,m_hbp,m_hsw); - //printf("V %d %d %d %d\n",m_vc,m_vfp,m_vbp,m_vsw); - - visarea.min_x = m_offsx; - visarea.min_y = m_offsy; - visarea.max_x = m_offsx + m_hc - m_hfp - m_hbp - 8*(m_hsw) - 1; - visarea.max_y = m_offsy + m_vc - m_vfp - m_vbp - (m_vsw) - 1; - - m_screen->configure(m_hc, m_vc, visarea, refresh); - } + rectangle visarea; + //(HC+1) - HFP - HBP - 8*(HSW+1) + //VC - VFP - VBP - (VSW+1) + attoseconds_t refresh = HZ_TO_ATTOSECONDS(clock()) * (m_hc) * m_vc; + + //printf("H %d %d %d %d\n",m_hc,m_hfp,m_hbp,m_hsw); + //printf("V %d %d %d %d\n",m_vc,m_vfp,m_vbp,m_vsw); + + visarea.min_x = m_offsx; + visarea.min_y = m_offsy; + visarea.max_x = m_offsx + m_hc - m_hfp - m_hbp - 8*(m_hsw) - 1; + visarea.max_y = m_offsy + m_vc - m_vfp - m_vbp - (m_vsw) - 1; + + m_screen->configure(m_hc, m_vc, visarea, refresh); } } diff --git a/src/emu/machine/k053252.h b/src/emu/machine/k053252.h index 1eef2e67b36a2..d3fb67144885c 100644 --- a/src/emu/machine/k053252.h +++ b/src/emu/machine/k053252.h @@ -8,7 +8,6 @@ struct k053252_interface { - const char *m_screen_tag; devcb_write_line m_int1_en; devcb_write_line m_int2_en; devcb_write_line m_int1_ack; @@ -19,6 +18,7 @@ struct k053252_interface }; class k053252_device : public device_t, + public device_video_interface, public k053252_interface { public: @@ -43,7 +43,6 @@ class k053252_device : public device_t, UINT16 m_vc,m_vfp,m_vbp; UINT8 m_vsw,m_hsw; - screen_device *m_screen; devcb_resolved_write_line m_int1_en_func; devcb_resolved_write_line m_int2_en_func; devcb_resolved_write_line m_int1_ack_func; diff --git a/src/emu/machine/laserdsc.c b/src/emu/machine/laserdsc.c index 8d4dc3eb2a18f..2feb73638acb2 100644 --- a/src/emu/machine/laserdsc.c +++ b/src/emu/machine/laserdsc.c @@ -89,7 +89,7 @@ const UINT32 VIRTUAL_LEAD_OUT_TRACKS = LEAD_OUT_MIN_SIZE_IN_UM * 1000 / NOMINAL_ laserdisc_device::laserdisc_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source), device_sound_interface(mconfig, *this), - m_screen_name(NULL), + device_video_interface(mconfig, *this), m_overwidth(0), m_overheight(0), m_overclip(0, -1, 0, -1), @@ -235,16 +235,6 @@ UINT32 laserdisc_device::screen_update(screen_device &screen, bitmap_rgb32 &bitm } -//------------------------------------------------- -// static_set_screen - set the screen name -//------------------------------------------------- - -void laserdisc_device::static_set_screen(device_t &device, const char *screen) -{ - downcast(device).m_screen_name = screen; -} - - //------------------------------------------------- // static_set_get_disc - set the get disc // delegate @@ -340,12 +330,6 @@ void laserdisc_device::static_set_overlay_scale(device_t &device, float scalex, void laserdisc_device::device_start() { - // ensure that our screen is started first - m_screen = machine().device(m_screen_name); - assert(m_screen != NULL); - if (!m_screen->started()) - throw device_missing_dependencies(); - // initialize the various pieces init_disc(); init_video(); diff --git a/src/emu/machine/laserdsc.h b/src/emu/machine/laserdsc.h index 2960a948f9ea5..4c5c3b1650ae4 100644 --- a/src/emu/machine/laserdsc.h +++ b/src/emu/machine/laserdsc.h @@ -158,6 +158,7 @@ struct laserdisc_overlay_config // base laserdisc class class laserdisc_device : public device_t, public device_sound_interface, + public device_video_interface, public laserdisc_overlay_config { protected: @@ -186,7 +187,6 @@ class laserdisc_device : public device_t, void set_overlay_config(const laserdisc_overlay_config &config) { static_cast(*this) = config; } // static configuration helpers - static void static_set_screen(device_t &device, const char *screen); static void static_set_get_disc(device_t &device, laserdisc_get_disc_delegate callback); static void static_set_audio(device_t &device, laserdisc_audio_delegate callback); static void static_set_overlay(device_t &device, UINT32 width, UINT32 height, screen_update_ind16_delegate update); @@ -270,7 +270,6 @@ class laserdisc_device : public device_t, virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); // subclass helpers - screen_device &screen() { assert(m_screen != NULL); return *m_screen; } void set_audio_squelch(bool squelchleft, bool squelchright) { m_stream->update(); m_audiosquelch = (squelchleft ? 1 : 0) | (squelchright ? 2 : 0); } void set_video_squelch(bool squelch) { m_videosquelch = squelch; } void set_slider_speed(INT32 tracks_per_vsync); @@ -314,7 +313,6 @@ class laserdisc_device : public device_t, // configuration laserdisc_get_disc_delegate m_getdisc_callback; laserdisc_audio_delegate m_audio_callback; // audio streaming callback - const char * m_screen_name; // name of the screen device laserdisc_overlay_config m_orig_config; // original overlay configuration UINT32 m_overwidth; // overlay screen width UINT32 m_overheight; // overlay screen height @@ -347,7 +345,6 @@ class laserdisc_device : public device_t, attotime m_sliderupdate; // time of last slider update // video data - screen_device * m_screen; // pointer to the screen device frame_data m_frame[3]; // circular list of frames UINT8 m_videoindex; // index of the current video buffer bitmap_yuy16 m_emptyframe; // blank frame diff --git a/src/emu/sound/cdp1864.c b/src/emu/sound/cdp1864.c index 22a81b3b36b64..d33fb89a55785 100644 --- a/src/emu/sound/cdp1864.c +++ b/src/emu/sound/cdp1864.c @@ -100,6 +100,7 @@ inline void cdp1864_device::initialize_palette() cdp1864_device::cdp1864_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, CDP1864, "CDP1864", tag, owner, clock, "cdp1864", __FILE__), device_sound_interface(mconfig, *this), + device_video_interface(mconfig, *this), m_read_inlace(*this), m_read_rdata(*this), m_read_bdata(*this), @@ -147,7 +148,6 @@ void cdp1864_device::device_start() m_hsync_timer = timer_alloc(TIMER_HSYNC); // find devices - m_screen = machine().device(m_screen_tag); m_screen->register_screen_bitmap(m_bitmap); // register for state saving diff --git a/src/emu/sound/cdp1864.h b/src/emu/sound/cdp1864.h index 56d12771ea255..0b5407715eaf5 100644 --- a/src/emu/sound/cdp1864.h +++ b/src/emu/sound/cdp1864.h @@ -82,7 +82,7 @@ #define MCFG_CDP1864_ADD(_tag, _screen_tag, _clock, _inlace, _irq, _dma_out, _efx, _hsync, _rdata, _bdata, _gdata) \ MCFG_SOUND_ADD(_tag, CDP1864, _clock) \ - downcast(device)->set_screen_tag(_screen_tag); \ + MCFG_VIDEO_SET_SCREEN(_screen_tag) \ downcast(device)->set_inlace_callback(DEVCB2_##_inlace); \ downcast(device)->set_irq_callback(DEVCB2_##_irq); \ downcast(device)->set_dma_out_callback(DEVCB2_##_dma_out); \ @@ -108,13 +108,13 @@ // ======================> cdp1864_device class cdp1864_device : public device_t, - public device_sound_interface + public device_sound_interface, + public device_video_interface { public: // construction/destruction cdp1864_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - void set_screen_tag(const char *screen_tag) { m_screen_tag = screen_tag; } template void set_inlace_callback(_inlace inlace) { m_read_inlace.set_callback(inlace); } template void set_irq_callback(_irq irq) { m_write_irq.set_callback(irq); } template void set_dma_out_callback(_dma_out dma_out) { m_write_dma_out.set_callback(dma_out); } @@ -168,8 +168,6 @@ class cdp1864_device : public device_t, devcb2_write_line m_write_efx; devcb2_write_line m_write_hsync; - const char *m_screen_tag; - screen_device *m_screen; // screen bitmap_rgb32 m_bitmap; // bitmap sound_stream *m_stream; // sound output diff --git a/src/emu/sound/cdp1869.c b/src/emu/sound/cdp1869.c index 4f51520b76c6f..0238ac8d194fb 100644 --- a/src/emu/sound/cdp1869.c +++ b/src/emu/sound/cdp1869.c @@ -344,6 +344,7 @@ inline int cdp1869_device::get_pen(int ccb0, int ccb1, int pcb) cdp1869_device::cdp1869_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, CDP1869, "RCA CDP1869", tag, owner, clock, "cdp1869", __FILE__), device_sound_interface(mconfig, *this), + device_video_interface(mconfig, *this), device_memory_interface(mconfig, *this), m_stream(NULL), m_space_config("pageram", ENDIANNESS_LITTLE, 8, 11, 0, NULL, *ADDRESS_MAP_NAME(cdp1869)) @@ -382,10 +383,6 @@ void cdp1869_device::device_config_complete() void cdp1869_device::device_start() { - // get the screen device - m_screen = machine().device(screen_tag); - assert(m_screen != NULL); - // resolve callbacks m_in_pal_ntsc_func.resolve(in_pal_ntsc_cb, *this); m_out_prd_func.resolve(out_prd_cb, *this); diff --git a/src/emu/sound/cdp1869.h b/src/emu/sound/cdp1869.h index 6eb0cd45e7474..ee8f02722a08f 100644 --- a/src/emu/sound/cdp1869.h +++ b/src/emu/sound/cdp1869.h @@ -155,6 +155,8 @@ #define CDP1869_INTERFACE(_name) \ const cdp1869_interface (_name) = +#define MCFG_CDP1869_SET_SCREEN MCFG_VIDEO_SET_SCREEN + #define CDP1869_CHAR_RAM_READ(name) UINT8 name(device_t *device, UINT16 pma, UINT8 cma, UINT8 pmd) #define CDP1869_CHAR_RAM_WRITE(name) void name(device_t *device, UINT16 pma, UINT8 cma, UINT8 pmd, UINT8 data) #define CDP1869_PCB_READ(name) int name(device_t *device, UINT16 pma, UINT8 cma, UINT8 pmd) @@ -180,8 +182,6 @@ typedef int (*cdp1869_pcb_read_func)(device_t *device, UINT16 pma, UINT8 cma, UI struct cdp1869_interface { - const char *screen_tag; // screen we are acting on - // pixel clock of the chip is the device clock int color_clock; // the chroma clock of the chip @@ -207,6 +207,7 @@ struct cdp1869_interface class cdp1869_device : public device_t, public device_sound_interface, + public device_video_interface, public device_memory_interface, public cdp1869_interface { @@ -272,7 +273,6 @@ class cdp1869_device : public device_t, cdp1869_char_ram_read_func m_in_char_ram_func; cdp1869_char_ram_write_func m_out_char_ram_func; - screen_device *m_screen; //address_space *m_page_ram; emu_timer *m_prd_timer; sound_stream *m_stream; diff --git a/src/emu/sound/mos6560.c b/src/emu/sound/mos6560.c index cd63a0e8c599c..5b37431a4ab57 100644 --- a/src/emu/sound/mos6560.c +++ b/src/emu/sound/mos6560.c @@ -690,6 +690,7 @@ mos6560_device::mos6560_device(const machine_config &mconfig, device_type type, : device_t(mconfig, type, name, tag, owner, clock, shortname, source), device_memory_interface(mconfig, *this), device_sound_interface(mconfig, *this), + device_video_interface(mconfig, *this), m_variant(variant), m_videoram_space_config("videoram", ENDIANNESS_LITTLE, 8, 14, 0, NULL, *ADDRESS_MAP_NAME(mos6560_videoram_map)), m_colorram_space_config("colorram", ENDIANNESS_LITTLE, 8, 10, 0, NULL, *ADDRESS_MAP_NAME(mos6560_colorram_map)), @@ -702,6 +703,7 @@ mos6560_device::mos6560_device(const machine_config &mconfig, const char *tag, d : device_t(mconfig, MOS6560, "MOS6560", tag, owner, clock, "mos6560", __FILE__), device_memory_interface(mconfig, *this), device_sound_interface(mconfig, *this), + device_video_interface(mconfig, *this), m_variant(TYPE_6560), m_videoram_space_config("videoram", ENDIANNESS_LITTLE, 8, 14, 0, NULL, *ADDRESS_MAP_NAME(mos6560_videoram_map)), m_colorram_space_config("colorram", ENDIANNESS_LITTLE, 8, 10, 0, NULL, *ADDRESS_MAP_NAME(mos6560_colorram_map)), @@ -739,9 +741,7 @@ const address_space_config *mos6560_device::memory_space_config(address_spacenum void mos6560_device::device_start() { - m_screen = machine().device(m_screen_tag); m_screen->register_screen_bitmap(m_bitmap); - assert(m_screen); // resolve callbacks m_read_potx.resolve_safe(0xff); diff --git a/src/emu/sound/mos6560.h b/src/emu/sound/mos6560.h index 0d83aa58b4f99..605c0a8b0e2a1 100644 --- a/src/emu/sound/mos6560.h +++ b/src/emu/sound/mos6560.h @@ -51,7 +51,8 @@ MCFG_SCREEN_VISIBLE_AREA(MOS6560_MAME_XPOS, MOS6560_MAME_XPOS + MOS6560_MAME_XSIZE - 1, MOS6560_MAME_YPOS, MOS6560_MAME_YPOS + MOS6560_MAME_YSIZE - 1) \ MCFG_SCREEN_UPDATE_DEVICE(_tag, mos6560_device, screen_update) \ MCFG_SOUND_ADD(_tag, MOS6560, _clock) \ - downcast(device)->set_callbacks(_screen_tag, DEVCB2_##_potx, DEVCB2_##_poty); \ + MCFG_VIDEO_SET_SCREEN(_screen_tag) \ + downcast(device)->set_callbacks(DEVCB2_##_potx, DEVCB2_##_poty); \ MCFG_DEVICE_ADDRESS_MAP(AS_0, _videoram_map) \ MCFG_DEVICE_ADDRESS_MAP(AS_1, _colorram_map) @@ -63,7 +64,8 @@ MCFG_SCREEN_VISIBLE_AREA(MOS6561_MAME_XPOS, MOS6561_MAME_XPOS + MOS6561_MAME_XSIZE - 1, MOS6561_MAME_YPOS, MOS6561_MAME_YPOS + MOS6561_MAME_YSIZE - 1) \ MCFG_SCREEN_UPDATE_DEVICE(_tag, mos6560_device, screen_update) \ MCFG_SOUND_ADD(_tag, MOS6561, _clock) \ - downcast(device)->set_callbacks(_screen_tag, DEVCB2_##_potx, DEVCB2_##_poty); \ + MCFG_VIDEO_SET_SCREEN(_screen_tag) \ + downcast(device)->set_callbacks(DEVCB2_##_potx, DEVCB2_##_poty); \ MCFG_DEVICE_ADDRESS_MAP(AS_0, _videoram_map) \ MCFG_DEVICE_ADDRESS_MAP(AS_1, _colorram_map) @@ -75,7 +77,8 @@ MCFG_SCREEN_VISIBLE_AREA(0, 23*8 - 1, 0, 22*8 - 1) \ MCFG_SCREEN_UPDATE_DEVICE(_tag, mos6560_device, screen_update) \ MCFG_SOUND_ADD(_tag, MOS656X_ATTACK_UFO, _clock) \ - downcast(device)->set_callbacks(_screen_tag, DEVCB2_NULL, DEVCB2_NULL); \ + MCFG_VIDEO_SET_SCREEN(_screen_tag) \ + downcast(device)->set_callbacks(DEVCB2_NULL, DEVCB2_NULL); \ MCFG_DEVICE_ADDRESS_MAP(AS_0, _videoram_map) \ MCFG_DEVICE_ADDRESS_MAP(AS_1, _colorram_map) @@ -125,14 +128,14 @@ class mos6560_device : public device_t, public device_memory_interface, - public device_sound_interface + public device_sound_interface, + public device_video_interface { public: mos6560_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, const char *shortname, const char *source); mos6560_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - template void set_callbacks(const char *screen_tag, _potx potx, _poty poty) { - m_screen_tag = screen_tag; + template void set_callbacks(_potx potx, _poty poty) { m_read_potx.set_callback(potx); m_read_poty.set_callback(poty); } @@ -187,9 +190,6 @@ class mos6560_device : public device_t, devcb2_read8 m_read_potx; devcb2_read8 m_read_poty; - const char *m_screen_tag; - screen_device *m_screen; - UINT8 m_reg[16]; bitmap_rgb32 m_bitmap; diff --git a/src/emu/sound/mos7360.c b/src/emu/sound/mos7360.c index b90867ee92166..51614edf0cad2 100644 --- a/src/emu/sound/mos7360.c +++ b/src/emu/sound/mos7360.c @@ -258,6 +258,7 @@ mos7360_device::mos7360_device(const machine_config &mconfig, const char *tag, d : device_t(mconfig, MOS7360, "MOS7360", tag, owner, clock, "mos7360", __FILE__), device_memory_interface(mconfig, *this), device_sound_interface(mconfig, *this), + device_video_interface(mconfig, *this), m_videoram_space_config("videoram", ENDIANNESS_LITTLE, 8, 16, 0, NULL, *ADDRESS_MAP_NAME(mos7360_videoram_map)), m_write_irq(*this), m_read_k(*this), @@ -272,10 +273,6 @@ mos7360_device::mos7360_device(const machine_config &mconfig, const char *tag, d void mos7360_device::device_start() { - // get the screen device - m_screen = machine().device(m_screen_tag); - assert(m_screen != NULL); - // get the CPU device m_cpu = machine().device(m_cpu_tag); assert(m_cpu != NULL); diff --git a/src/emu/sound/mos7360.h b/src/emu/sound/mos7360.h index 29d9761398bfd..4693a97b2b398 100644 --- a/src/emu/sound/mos7360.h +++ b/src/emu/sound/mos7360.h @@ -52,7 +52,8 @@ MCFG_SCREEN_UPDATE_DEVICE(_tag, mos7360_device, screen_update) \ MCFG_DEVICE_ADD(_tag, MOS7360, _clock) \ MCFG_DEVICE_ADDRESS_MAP(AS_0, _videoram_map) \ - downcast(device)->set_callbacks(_screen_tag, _cpu_tag, DEVCB2_##_irq, DEVCB2_##_k); + MCFG_VIDEO_SET_SCREEN(_screen_tag) \ + downcast(device)->set_callbacks(_cpu_tag, DEVCB2_##_irq, DEVCB2_##_k); @@ -89,15 +90,15 @@ class mos7360_device : public device_t, public device_memory_interface, - public device_sound_interface + public device_sound_interface, + public device_video_interface { public: // construction/destruction //mos7360_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); mos7360_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - template void set_callbacks(const char *screen_tag, const char *cpu_tag, _irq irq, _k k) { - m_screen_tag = screen_tag; + template void set_callbacks(const char *cpu_tag, _irq irq, _k k) { m_cpu_tag = cpu_tag; m_write_irq.set_callback(irq); m_read_k.set_callback(k); @@ -156,9 +157,7 @@ class mos7360_device : public device_t, devcb2_write_line m_write_irq; devcb2_read8 m_read_k; - const char *m_screen_tag; const char *m_cpu_tag; - screen_device *m_screen; // screen which sets bitmap properties cpu_device *m_cpu; sound_stream *m_stream; diff --git a/src/emu/video/315_5124.c b/src/emu/video/315_5124.c index a30f9c62d4c94..e9b8fe524cea7 100644 --- a/src/emu/video/315_5124.c +++ b/src/emu/video/315_5124.c @@ -141,6 +141,7 @@ ADDRESS_MAP_END sega315_5124_device::sega315_5124_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t( mconfig, SEGA315_5124, "Sega 315-5124", tag, owner, clock, "sega315_5124", __FILE__) , device_memory_interface(mconfig, *this) + , device_video_interface(mconfig, *this) , m_cram_size( SEGA315_5124_CRAM_SIZE ) , m_palette_offset( 0 ) , m_supports_224_240( false ) @@ -152,6 +153,7 @@ sega315_5124_device::sega315_5124_device(const machine_config &mconfig, const ch sega315_5124_device::sega315_5124_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 cram_size, UINT8 palette_offset, bool supports_224_240, const char *shortname, const char *source) : device_t( mconfig, type, name, tag, owner, clock, shortname, source) , device_memory_interface(mconfig, *this) + , device_video_interface(mconfig, *this) , m_cram_size( cram_size ) , m_palette_offset( palette_offset ) , m_supports_224_240( supports_224_240 ) @@ -1703,8 +1705,6 @@ void sega315_5124_device::vdp_postload() void sega315_5124_device::device_start() { - m_screen = machine().device( m_screen_tag ); - /* Resolve callbacks */ m_cb_int.resolve( m_int_callback, *this ); m_cb_pause.resolve( m_pause_callback, *this ); diff --git a/src/emu/video/315_5124.h b/src/emu/video/315_5124.h index bbdfb819fc038..e5d0ee7433c9d 100644 --- a/src/emu/video/315_5124.h +++ b/src/emu/video/315_5124.h @@ -53,7 +53,6 @@ PALETTE_INIT( sega315_5378 ); struct sega315_5124_interface { bool m_is_pal; /* false = NTSC, true = PAL */ - const char *m_screen_tag; devcb_write_line m_int_callback; /* Interrupt callback function */ devcb_write_line m_pause_callback; /* Pause callback function */ }; @@ -66,7 +65,8 @@ extern const device_type SEGA315_5378; /* aka Gamegear vdp */ class sega315_5124_device : public device_t, public sega315_5124_interface, - public device_memory_interface + public device_memory_interface, + public device_video_interface { public: // construction/destruction @@ -158,7 +158,6 @@ class sega315_5124_device : public device_t, emu_timer *m_check_hint_timer; emu_timer *m_check_vint_timer; emu_timer *m_draw_timer; - screen_device *m_screen; const address_space_config m_space_config; @@ -204,12 +203,18 @@ class sega315_5378_device : public sega315_5124_device MCFG_DEVICE_ADD(_tag, SEGA315_5124, 0) \ MCFG_DEVICE_CONFIG(_interface) +#define MCFG_SEGA315_5124_SET_SCREEN MCFG_VIDEO_SET_SCREEN + #define MCFG_SEGA315_5246_ADD(_tag, _interface) \ MCFG_DEVICE_ADD(_tag, SEGA315_5246, 0) \ MCFG_DEVICE_CONFIG(_interface) +#define MCFG_SEGA315_5246_SET_SCREEN MCFG_VIDEO_SET_SCREEN + #define MCFG_SEGA315_5378_ADD(_tag, _interface) \ MCFG_DEVICE_ADD(_tag, SEGA315_5378, 0) \ MCFG_DEVICE_CONFIG(_interface) +#define MCFG_SEGA315_5378_SET_SCREEN MCFG_VIDEO_SET_SCREEN + #endif /* __SEGA315_5124_H__ */ diff --git a/src/emu/video/cdp1861.c b/src/emu/video/cdp1861.c index 23a6157e3e023..b2fb9c904a4da 100644 --- a/src/emu/video/cdp1861.c +++ b/src/emu/video/cdp1861.c @@ -41,6 +41,7 @@ const device_type CDP1861 = &device_creator; cdp1861_device::cdp1861_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, CDP1861, "CDP1861", tag, owner, clock, "cdp1861", __FILE__), + device_video_interface(mconfig, *this), m_write_irq(*this), m_write_dma_out(*this), m_write_efx(*this) @@ -65,7 +66,6 @@ void cdp1861_device::device_start() m_dma_timer = timer_alloc(TIMER_DMA); // find devices - m_screen = machine().device(m_screen_tag); m_screen->register_screen_bitmap(m_bitmap); // register for state saving diff --git a/src/emu/video/cdp1861.h b/src/emu/video/cdp1861.h index 67478835883bd..f7e69f066a669 100644 --- a/src/emu/video/cdp1861.h +++ b/src/emu/video/cdp1861.h @@ -67,7 +67,7 @@ #define MCFG_CDP1861_ADD(_tag, _screen_tag, _clock, _irq, _dma_out, _efx) \ MCFG_DEVICE_ADD(_tag, CDP1861, _clock) \ - downcast(device)->set_screen_tag(_screen_tag); \ + MCFG_VIDEO_SET_SCREEN(_screen_tag) \ downcast(device)->set_irq_callback(DEVCB2_##_irq); \ downcast(device)->set_dma_out_callback(DEVCB2_##_dma_out); \ downcast(device)->set_efx_callback(DEVCB2_##_efx); @@ -85,13 +85,13 @@ // ======================> cdp1861_device -class cdp1861_device : public device_t +class cdp1861_device : public device_t, + public device_video_interface { public: // construction/destruction cdp1861_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - void set_screen_tag(const char *screen_tag) { m_screen_tag = screen_tag; } template void set_irq_callback(_irq irq) { m_write_irq.set_callback(irq); } template void set_dma_out_callback(_dma_out dma_out) { m_write_dma_out.set_callback(dma_out); } template void set_efx_callback(_efx efx) { m_write_efx.set_callback(efx); } @@ -120,8 +120,6 @@ class cdp1861_device : public device_t devcb2_write_line m_write_dma_out; devcb2_write_line m_write_efx; - const char *m_screen_tag; - screen_device *m_screen; // screen bitmap_rgb32 m_bitmap; // bitmap int m_disp; // display enabled diff --git a/src/emu/video/cdp1862.c b/src/emu/video/cdp1862.c index d57b2678f18f4..350dae54248fb 100644 --- a/src/emu/video/cdp1862.c +++ b/src/emu/video/cdp1862.c @@ -78,6 +78,7 @@ inline void cdp1862_device::initialize_palette() cdp1862_device::cdp1862_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, CDP1862, "CDP1862", tag, owner, clock, "cdp1862", __FILE__), + device_video_interface(mconfig, *this), m_read_rd(*this), m_read_bd(*this), m_read_gd(*this) @@ -97,7 +98,6 @@ void cdp1862_device::device_start() m_read_gd.resolve_safe(0); // find devices - m_screen = machine().device(m_screen_tag); m_screen->register_screen_bitmap(m_bitmap); // init palette diff --git a/src/emu/video/cdp1862.h b/src/emu/video/cdp1862.h index 256993d976a4e..9273ad03c6b70 100644 --- a/src/emu/video/cdp1862.h +++ b/src/emu/video/cdp1862.h @@ -45,7 +45,7 @@ #define MCFG_CDP1862_ADD(_tag, _screen_tag, _clock, _rd, _bd, _gd) \ MCFG_DEVICE_ADD(_tag, CDP1862, _clock) \ - downcast(device)->set_screen_tag(_screen_tag); \ + MCFG_VIDEO_SET_SCREEN(_screen_tag) \ downcast(device)->set_rd_callback(DEVCB2_##_rd); \ downcast(device)->set_bd_callback(DEVCB2_##_bd); \ downcast(device)->set_gd_callback(DEVCB2_##_gd); @@ -64,13 +64,13 @@ // ======================> cdp1862_device -class cdp1862_device : public device_t +class cdp1862_device : public device_t, + public device_video_interface { public: // construction/destruction cdp1862_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - void set_screen_tag(const char *screen_tag) { m_screen_tag = screen_tag; } template void set_rd_callback(_rd rd) { m_read_rd.set_callback(rd); } template void set_bd_callback(_bd bd) { m_read_bd.set_callback(bd); } template void set_gd_callback(_gd gd) { m_read_gd.set_callback(gd); } @@ -95,8 +95,6 @@ class cdp1862_device : public device_t devcb2_read_line m_read_bd; devcb2_read_line m_read_gd; - const char *m_screen_tag; - screen_device *m_screen; // screen bitmap_rgb32 m_bitmap; // bitmap double m_lum_r; // red luminance resistor value diff --git a/src/emu/video/crt9007.c b/src/emu/video/crt9007.c index 5fcf834e7d4b8..ea32be6420ab1 100644 --- a/src/emu/video/crt9007.c +++ b/src/emu/video/crt9007.c @@ -448,6 +448,7 @@ inline void crt9007_device::recompute_parameters() crt9007_device::crt9007_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, CRT9007, "SMC CRT9007", tag, owner, clock, "crt9007", __FILE__), device_memory_interface(mconfig, *this), + device_video_interface(mconfig, *this), m_space_config("videoram", ENDIANNESS_LITTLE, 8, 14, 0, NULL, *ADDRESS_MAP_NAME(crt9007)) { for (int i = 0; i < 0x3d; i++) @@ -511,10 +512,6 @@ void crt9007_device::device_start() m_out_slg_func.resolve(m_out_slg_cb, *this); m_out_sld_func.resolve(m_out_sld_cb, *this); - // get the screen device - m_screen = machine().device(m_screen_tag); - assert(m_screen != NULL); - // set horizontal pixels per column m_hpixels_per_column = hpixels_per_column; diff --git a/src/emu/video/crt9007.h b/src/emu/video/crt9007.h index cb77f38b7844f..12790ee4ffad1 100644 --- a/src/emu/video/crt9007.h +++ b/src/emu/video/crt9007.h @@ -70,7 +70,6 @@ struct crt9007_interface { - const char *m_screen_tag; /* screen we are acting on */ int hpixels_per_column; /* number of pixels per video memory address */ devcb_write_line m_out_int_cb; @@ -94,6 +93,7 @@ struct crt9007_interface class crt9007_device : public device_t, public device_memory_interface, + public device_video_interface, public crt9007_interface { public: @@ -152,8 +152,6 @@ class crt9007_device : public device_t, devcb_resolved_write_line m_out_slg_func; devcb_resolved_write_line m_out_sld_func; - screen_device *m_screen; - // registers UINT8 m_reg[0x3d]; UINT8 m_status; diff --git a/src/emu/video/crt9021.c b/src/emu/video/crt9021.c index 08615054fbea3..1eeaa6412680b 100644 --- a/src/emu/video/crt9021.c +++ b/src/emu/video/crt9021.c @@ -82,7 +82,8 @@ enum //------------------------------------------------- crt9021_device::crt9021_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : device_t(mconfig, CRT9021, "SMC CRT9021", tag, owner, clock, "crt9021", __FILE__) + : device_t(mconfig, CRT9021, "SMC CRT9021", tag, owner, clock, "crt9021", __FILE__), + device_video_interface(mconfig, *this) { } @@ -123,10 +124,6 @@ void crt9021_device::device_start() m_in_attr_func.resolve(in_attr_cb, *this); m_in_atten_func.resolve(in_atten_cb, *this); - // get the screen device - m_screen = machine().device(screen_tag); - assert(m_screen != NULL); - // register for state saving save_item(NAME(m_slg)); save_item(NAME(m_sld)); diff --git a/src/emu/video/crt9021.h b/src/emu/video/crt9021.h index f3cc54e61ec50..a58c6bd79a4e8 100644 --- a/src/emu/video/crt9021.h +++ b/src/emu/video/crt9021.h @@ -63,8 +63,6 @@ struct crt9021_interface { - const char *screen_tag; /* screen we are acting on */ - devcb_read8 in_data_cb; devcb_read8 in_attr_cb; @@ -76,6 +74,7 @@ struct crt9021_interface // ======================> crt9021_device class crt9021_device : public device_t, + public device_video_interface, public crt9021_interface { public: @@ -102,8 +101,6 @@ class crt9021_device : public device_t, devcb_resolved_read8 m_in_attr_func; devcb_resolved_read_line m_in_atten_func; - screen_device *m_screen; - int m_slg; int m_sld; int m_cursor; diff --git a/src/emu/video/ef9340_1.c b/src/emu/video/ef9340_1.c index 1265e0f840a76..57cffe7f714cc 100644 --- a/src/emu/video/ef9340_1.c +++ b/src/emu/video/ef9340_1.c @@ -23,8 +23,7 @@ static const UINT8 bgr2rgb[8] = ef9340_1_device::ef9340_1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, EF9340_1, "EF9340+EF9341", tag, owner, clock, "ef9340_1", __FILE__) - , m_screen_tag(NULL) - , m_screen(NULL) + , device_video_interface(mconfig, *this) //, m_start_vpos(START_Y) //, m_start_vblank(START_Y + SCREEN_HEIGHT) //, m_screen_lines(LINES) @@ -34,10 +33,6 @@ ef9340_1_device::ef9340_1_device(const machine_config &mconfig, const char *tag, void ef9340_1_device::device_start() { - assert( m_screen_tag != NULL ); - m_screen = machine().device(m_screen_tag); - assert( m_screen != NULL ); - // Let the screen create our temporary bitmap with the screen's dimensions m_screen->register_screen_bitmap(m_tmp_bitmap); diff --git a/src/emu/video/ef9340_1.h b/src/emu/video/ef9340_1.h index e6dee063a8491..bb255e752f313 100644 --- a/src/emu/video/ef9340_1.h +++ b/src/emu/video/ef9340_1.h @@ -17,17 +17,15 @@ #define MCFG_EF9340_1_ADD(_tag, _clock, _screen_tag) \ MCFG_DEVICE_ADD(_tag, EF9340_1, _clock) \ - ef9340_1_device::set_screen_tag(*device, _screen_tag); + MCFG_VIDEO_SET_SCREEN(_screen_tag) -class ef9340_1_device : public device_t +class ef9340_1_device : public device_t, + public device_video_interface { public: // construction/destruction ef9340_1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - // static configuration helpers - static void set_screen_tag(device_t &device, const char *screen_tag) { downcast(device).m_screen_tag = screen_tag; } - inline bitmap_ind16 *get_bitmap() { return &m_tmp_bitmap; } void ef9341_write( UINT8 command, UINT8 b, UINT8 data ); @@ -52,9 +50,6 @@ class ef9340_1_device : public device_t emu_timer *m_line_timer; - const char *m_screen_tag; - screen_device *m_screen; - bitmap_ind16 m_tmp_bitmap; struct diff --git a/src/emu/video/h63484.c b/src/emu/video/h63484.c index 42a3b1a4c94ac..bacfec41437f7 100644 --- a/src/emu/video/h63484.c +++ b/src/emu/video/h63484.c @@ -27,7 +27,8 @@ ADDRESS_MAP_END h63484_device::h63484_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, H63484, "H63484", tag, owner, clock, "h63484", __FILE__), - device_memory_interface(mconfig, *this), + device_memory_interface(mconfig, *this), + device_video_interface(mconfig, *this), m_ar(0), m_sr(0), m_fifo_ptr(-1), @@ -1139,8 +1140,6 @@ WRITE16_MEMBER( h63484_device::data_w ) void h63484_device::device_start() { - m_screen = machine().device(m_screen_tag); - //h63484->space = device->memory().space(AS_0); m_vram = auto_alloc_array_clear(machine(), UINT8, 1 << 20); } diff --git a/src/emu/video/h63484.h b/src/emu/video/h63484.h index 58286b51781a4..aad3235965208 100644 --- a/src/emu/video/h63484.h +++ b/src/emu/video/h63484.h @@ -33,7 +33,6 @@ typedef void (*h63484_display_pixels_func)(device_t *device, bitmap_ind16 &bitma struct h63484_interface { - const char *m_screen_tag; /* screen we are acting on */ h63484_display_pixels_func m_display_cb; }; @@ -41,6 +40,7 @@ struct h63484_interface class h63484_device : public device_t, public device_memory_interface, + public device_video_interface, public h63484_interface { public: @@ -92,8 +92,6 @@ class h63484_device : public device_t, void draw_graphics_line(bitmap_ind16 &bitmap, const rectangle &cliprect, int y, int layer_n); - screen_device *m_screen; - UINT8 *m_vram; UINT8 m_ar; UINT8 m_vreg[0x100]; diff --git a/src/emu/video/hd44102.c b/src/emu/video/hd44102.c index fbfa65687af4c..ab59168901ae4 100644 --- a/src/emu/video/hd44102.c +++ b/src/emu/video/hd44102.c @@ -70,6 +70,7 @@ inline void hd44102_device::count_up_or_down() hd44102_device::hd44102_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, HD44102, "HD44102", tag, owner, clock, "hd44102", __FILE__), + device_video_interface(mconfig, *this), m_cs2(0), m_page(0), m_x(0), @@ -82,13 +83,10 @@ hd44102_device::hd44102_device(const machine_config &mconfig, const char *tag, d // static_set_config - configuration helper //------------------------------------------------- -void hd44102_device::static_set_config(device_t &device, const char *screen_tag, int sx, int sy) +void hd44102_device::static_set_config(device_t &device, int sx, int sy) { hd44102_device &hd44102 = downcast(device); - assert(screen_tag != NULL); - - hd44102.m_screen_tag = screen_tag; hd44102.m_sx = sx; hd44102.m_sy = sy; } @@ -100,9 +98,6 @@ void hd44102_device::static_set_config(device_t &device, const char *screen_tag, void hd44102_device::device_start() { - // find screen - m_screen = machine().device(m_screen_tag); - // register for state saving save_item(NAME(m_ram[0])); save_item(NAME(m_ram[1])); diff --git a/src/emu/video/hd44102.h b/src/emu/video/hd44102.h index d95c2e668c75e..3491aefe61543 100644 --- a/src/emu/video/hd44102.h +++ b/src/emu/video/hd44102.h @@ -22,7 +22,8 @@ #define MCFG_HD44102_ADD(_tag, _screen_tag, _sx, _sy) \ MCFG_DEVICE_ADD(_tag, HD44102, 0) \ - hd44102_device::static_set_config(*device, _screen_tag, _sx, _sy); + MCFG_VIDEO_SET_SCREEN(_screen_tag) \ + hd44102_device::static_set_config(*device, _sx, _sy); @@ -32,14 +33,15 @@ // ======================> hd44102_device -class hd44102_device : public device_t +class hd44102_device : public device_t, + public device_video_interface { public: // construction/destruction hd44102_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); // inline configuration helpers - static void static_set_config(device_t &device, const char *screen_tag, int sx, int sy); + static void static_set_config(device_t &device, int sx, int sy); DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); @@ -62,8 +64,6 @@ class hd44102_device : public device_t inline void count_up_or_down(); - screen_device *m_screen; // screen - UINT8 m_ram[4][50]; // display memory UINT8 m_status; // status register @@ -74,7 +74,6 @@ class hd44102_device : public device_t int m_x; // X address int m_y; // Y address - const char *m_screen_tag; int m_sx; int m_sy; }; diff --git a/src/emu/video/hd61830.c b/src/emu/video/hd61830.c index 72a8431fc04c8..b6616dc73770d 100644 --- a/src/emu/video/hd61830.c +++ b/src/emu/video/hd61830.c @@ -108,6 +108,7 @@ inline void hd61830_device::writebyte(offs_t address, UINT8 data) hd61830_device::hd61830_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, HD61830, "Hitachi HD61830", tag, owner, clock, "hd61830", __FILE__), device_memory_interface(mconfig, *this), + device_video_interface(mconfig, *this), m_bf(false), m_cac(0), m_blink(0), @@ -161,8 +162,6 @@ void hd61830_device::device_start() // resolve callbacks m_in_rd_func.resolve(m_in_rd_cb, *this); - m_screen = machine().device(screen_tag); - // register for state saving save_item(NAME(m_bf)); save_item(NAME(m_ir)); diff --git a/src/emu/video/hd61830.h b/src/emu/video/hd61830.h index 8d29920cb3972..07ff5bde8875d 100644 --- a/src/emu/video/hd61830.h +++ b/src/emu/video/hd61830.h @@ -45,8 +45,6 @@ struct hd61830_interface { - const char *screen_tag; - devcb_read8 m_in_rd_cb; }; @@ -56,6 +54,7 @@ struct hd61830_interface class hd61830_device : public device_t, public device_memory_interface, + public device_video_interface, public hd61830_interface { public: @@ -94,7 +93,6 @@ class hd61830_device : public device_t, devcb_resolved_read8 m_in_rd_func; - screen_device *m_screen; emu_timer *m_busy_timer; //address_space *m_data; diff --git a/src/emu/video/huc6260.c b/src/emu/video/huc6260.c index 050c44bda8dd3..02c52b7d428af 100644 --- a/src/emu/video/huc6260.c +++ b/src/emu/video/huc6260.c @@ -62,7 +62,8 @@ void huc6260_device::device_config_complete() huc6260_device::huc6260_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : device_t(mconfig, HUC6260, "HuC6260", tag, owner, clock, "huc6260", __FILE__) + : device_t(mconfig, HUC6260, "HuC6260", tag, owner, clock, "huc6260", __FILE__), + device_video_interface(mconfig, *this) { } @@ -250,11 +251,7 @@ WRITE8_MEMBER( huc6260_device::write ) void huc6260_device::device_start() { - /* Make sure we are supplied a screen tag */ - assert( screen_tag != NULL ); - m_timer = timer_alloc(); - m_screen = machine().device( screen_tag ); m_bmp = auto_bitmap_ind16_alloc( machine(), HUC6260_WPF, HUC6260_LPF ); /* Resolve callbacks */ @@ -264,7 +261,6 @@ void huc6260_device::device_start() m_get_time_til_next_event.resolve( get_time_til_next_event, *this ); /* We want to have a valid screen and valid callbacks */ - assert( m_screen != NULL ); assert( ! m_hsync_changed.isnull() ); assert( ! m_vsync_changed.isnull() ); assert( ! m_get_next_pixel_data.isnull() ); diff --git a/src/emu/video/huc6260.h b/src/emu/video/huc6260.h index 3046fa0b454f7..327b0c43c348f 100644 --- a/src/emu/video/huc6260.h +++ b/src/emu/video/huc6260.h @@ -28,9 +28,6 @@ PALETTE_INIT( huc6260 ); struct huc6260_interface { - /* Tag for the screen we will be drawing on */ - const char *screen_tag; - /* Callback function to retrieve pixel data */ devcb_read16 get_next_pixel_data; @@ -47,6 +44,7 @@ struct huc6260_interface class huc6260_device : public device_t, + public device_video_interface, public huc6260_interface { public: @@ -65,7 +63,6 @@ class huc6260_device : public device_t, virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); private: - screen_device *m_screen; int m_last_h; int m_last_v; int m_height; diff --git a/src/emu/video/huc6261.c b/src/emu/video/huc6261.c index 7d5eb9eafb7b6..3067c4ffa517d 100644 --- a/src/emu/video/huc6261.c +++ b/src/emu/video/huc6261.c @@ -38,7 +38,8 @@ void huc6261_device::device_config_complete() huc6261_device::huc6261_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : device_t(mconfig, HUC6261, "HuC6261", tag, owner, clock, "huc6261", __FILE__) + : device_t(mconfig, HUC6261, "HuC6261", tag, owner, clock, "huc6261", __FILE__), + device_video_interface(mconfig, *this) { // Set up UV lookup table for ( int ur = 0; ur < 256; ur++ ) @@ -402,19 +403,16 @@ WRITE16_MEMBER( huc6261_device::write ) void huc6261_device::device_start() { /* Make sure we are supplied all our mandatory tags */ - assert( screen_tag != NULL ); assert( huc6270_a_tag != NULL ); assert( huc6270_b_tag != NULL ); m_timer = timer_alloc(); - m_screen = machine().device( screen_tag ); m_huc6270_a = machine().device( huc6270_a_tag ); m_huc6270_b = machine().device( huc6270_b_tag ); m_bmp = auto_bitmap_rgb32_alloc( machine(), HUC6261_WPF, HUC6261_LPF ); /* We want to have valid devices */ - assert( m_screen != NULL ); assert( m_huc6270_a != NULL ); assert( m_huc6270_b != NULL ); diff --git a/src/emu/video/huc6261.h b/src/emu/video/huc6261.h index 55a2fbd04699d..f0452cbaff14d 100644 --- a/src/emu/video/huc6261.h +++ b/src/emu/video/huc6261.h @@ -24,9 +24,6 @@ struct huc6261_interface { - /* Tag for the screen we will be drawing on */ - const char *screen_tag; - /* Tags for the 2 HuC6270 devices */ const char *huc6270_a_tag; const char *huc6270_b_tag; @@ -34,6 +31,7 @@ struct huc6261_interface class huc6261_device : public device_t, + public device_video_interface, public huc6261_interface { public: @@ -54,7 +52,6 @@ class huc6261_device : public device_t, virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); private: - screen_device *m_screen; huc6270_device *m_huc6270_a; huc6270_device *m_huc6270_b; int m_last_h; diff --git a/src/emu/video/i8244.c b/src/emu/video/i8244.c index 32908dfabbfa9..71b90672bcedb 100644 --- a/src/emu/video/i8244.c +++ b/src/emu/video/i8244.c @@ -100,10 +100,9 @@ static const UINT8 bgr2rgb[8] = i8244_device::i8244_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, I8244, "I8244", tag, owner, clock, "i8244", __FILE__) , device_sound_interface(mconfig, *this) + , device_video_interface(mconfig, *this) , m_irq_func(*this) , m_postprocess_func(*this) - , m_screen_tag(NULL) - , m_screen(NULL) , m_start_vpos(START_Y) , m_start_vblank(START_Y + SCREEN_HEIGHT) , m_screen_lines(LINES) @@ -114,10 +113,9 @@ i8244_device::i8244_device(const machine_config &mconfig, const char *tag, devic i8244_device::i8244_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, int lines, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source) , device_sound_interface(mconfig, *this) + , device_video_interface(mconfig, *this) , m_irq_func(*this) , m_postprocess_func(*this) - , m_screen_tag(NULL) - , m_screen(NULL) , m_start_vpos(START_Y) , m_start_vblank(START_Y + SCREEN_HEIGHT) , m_screen_lines(lines) @@ -137,10 +135,6 @@ i8245_device::i8245_device(const machine_config &mconfig, const char *tag, devic void i8244_device::device_start() { - assert( m_screen_tag != NULL ); - m_screen = machine().device(m_screen_tag); - assert( m_screen != NULL ); - // Let the screen create our temporary bitmap with the screen's dimensions m_screen->register_screen_bitmap(m_tmp_bitmap); diff --git a/src/emu/video/i8244.h b/src/emu/video/i8244.h index 82c330aa86bd5..22b5c1f4546d4 100644 --- a/src/emu/video/i8244.h +++ b/src/emu/video/i8244.h @@ -20,18 +20,16 @@ #define MCFG_I8244_ADD(_tag, _clock, _screen_tag, _irq_cb, _postprocess_cb) \ MCFG_DEVICE_ADD(_tag, I8244, _clock) \ - MCFG_I8244_SCREEN_TAG(_screen_tag) \ + MCFG_VIDEO_SET_SCREEN(_screen_tag) \ MCFG_I8244_IRQ_CB(_irq_cb) \ MCFG_I8244_POSTPROCESS_CB(_postprocess_cb) -#define MCFG_I8244_SCREEN_TAG(_screen_tag) \ - i8244_device::set_screen_tag(*device, _screen_tag); #define MCFG_I8244_IRQ_CB(_devcb) \ devcb = &i8244_device::set_irq_cb(*device, DEVCB2_##_devcb); #define MCFG_I8244_POSTPROCESS_CB(_devcb) \ devcb = &i8244_device::set_postprocess_cb(*device, DEVCB2_##_devcb); #define MCFG_I8245_ADD(_tag, _clock, _screen_tag, _irq_cb, _postprocess_cb) \ MCFG_DEVICE_ADD(_tag, I8245, _clock) \ - MCFG_I8244_SCREEN_TAG(_screen_tag) \ + MCFG_VIDEO_SET_SCREEN(_screen_tag) \ MCFG_I8244_IRQ_CB(_irq_cb) \ MCFG_I8244_POSTPROCESS_CB(_postprocess_cb ) @@ -76,6 +74,7 @@ union vdc_t { class i8244_device : public device_t , public device_sound_interface + , public device_video_interface { public: // construction/destruction @@ -132,8 +131,6 @@ class i8244_device : public device_t devcb2_write_line m_irq_func; devcb2_write16 m_postprocess_func; - const char *m_screen_tag; - screen_device *m_screen; bitmap_ind16 m_tmp_bitmap; emu_timer *m_line_timer; emu_timer *m_hblank_timer; diff --git a/src/emu/video/i8275.c b/src/emu/video/i8275.c index 3a0e282a2271c..331d29e8a91e4 100644 --- a/src/emu/video/i8275.c +++ b/src/emu/video/i8275.c @@ -410,7 +410,8 @@ UINT32 i8275_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const device_type I8275 = &device_creator; i8275_device::i8275_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : device_t(mconfig, I8275, "Intel 8275", tag, owner, clock, "i8275", __FILE__) + : device_t(mconfig, I8275, "Intel 8275", tag, owner, clock, "i8275", __FILE__), + device_video_interface(mconfig, *this) { } @@ -446,8 +447,6 @@ void i8275_device::device_config_complete() void i8275_device::device_start() { /* get the screen device */ - m_screen = machine().device(m_screen_tag); - assert(m_screen != NULL); m_screen->register_screen_bitmap(m_bitmap); /* resolve callbacks */ diff --git a/src/emu/video/i8275.h b/src/emu/video/i8275.h index 0730fb1d316e4..b92f6385faa6e 100644 --- a/src/emu/video/i8275.h +++ b/src/emu/video/i8275.h @@ -46,7 +46,6 @@ typedef void (*i8275_display_pixels_func)(i8275_device *device, bitmap_rgb32 &bi struct i8275_interface { - const char *m_screen_tag; /* screen we are acting on */ int m_width; /* char width in pixels */ int m_char_delay; /* delay of display char */ @@ -60,7 +59,8 @@ struct i8275_interface }; -class i8275_device : public device_t, +class i8275_device : public device_t, + public device_video_interface, public i8275_interface { public: @@ -90,7 +90,6 @@ class i8275_device : public device_t, devcb_resolved_write_line m_out_hrtc_func; devcb_resolved_write_line m_out_vrtc_func; - screen_device *m_screen; bitmap_rgb32 m_bitmap; UINT8 m_status_reg; /* value of status reggister */ diff --git a/src/emu/video/i8275x.c b/src/emu/video/i8275x.c index 4ff6ea40edd1a..e205f6d5f469c 100644 --- a/src/emu/video/i8275x.c +++ b/src/emu/video/i8275x.c @@ -81,6 +81,7 @@ const device_type I8275x = &device_creator; i8275x_device::i8275x_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, I8275x, "I8275", tag, owner, clock, "i8275x", __FILE__), + device_video_interface(mconfig, *this), m_status(0), m_param_idx(0), m_param_end(0), @@ -132,8 +133,6 @@ void i8275x_device::device_config_complete() void i8275x_device::device_start() { // get the screen device - m_screen = machine().device(m_screen_tag); - assert(m_screen != NULL); m_screen->register_screen_bitmap(m_bitmap); // resolve callbacks diff --git a/src/emu/video/i8275x.h b/src/emu/video/i8275x.h index 172cc62b4c825..7fc31ab9f1bbc 100644 --- a/src/emu/video/i8275x.h +++ b/src/emu/video/i8275x.h @@ -70,7 +70,6 @@ typedef void (*i8275_display_pixels_func)(i8275x_device *device, bitmap_rgb32 &b struct i8275_interface { - const char *m_screen_tag; int m_hpixels_per_column; int m_dummy; @@ -88,6 +87,7 @@ struct i8275_interface // ======================> i8275x_device class i8275x_device : public device_t, + public device_video_interface, public i8275_interface { public: @@ -177,7 +177,6 @@ class i8275x_device : public device_t, devcb_resolved_write_line m_out_hrtc_func; devcb_resolved_write_line m_out_vrtc_func; - screen_device *m_screen; bitmap_rgb32 m_bitmap; UINT8 m_status; diff --git a/src/emu/video/m50458.c b/src/emu/video/m50458.c index 5deb24ea064ab..ea0c89984d22a 100644 --- a/src/emu/video/m50458.c +++ b/src/emu/video/m50458.c @@ -173,6 +173,7 @@ inline void m50458_device::write_word(offs_t address, UINT16 data) m50458_device::m50458_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, M50458, "m50458", tag, owner, clock, "m50458", __FILE__), device_memory_interface(mconfig, *this), + device_video_interface(mconfig, *this), m_space_config("videoram", ENDIANNESS_LITTLE, 16, 16, 0, NULL, *ADDRESS_MAP_NAME(m50458_vram)) { } @@ -188,20 +189,6 @@ void m50458_device::device_validity_check(validity_checker &valid) const } -void m50458_device::device_config_complete() -{ - // inherit a copy of the static data - const m50458_interface *intf = reinterpret_cast(static_config()); - if (intf != NULL) - *static_cast(this) = *intf; - - // or initialize to defaults if none provided - else - { - // ... - } -} - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- @@ -249,14 +236,6 @@ void m50458_device::device_start() m_shadow_gfx[dst] |= (tmp >> 8); } } - - // find screen - m_screen = machine().device(m_screen_tag); - - if (m_screen == NULL) - { - m_screen = owner()->subdevice(m_screen_tag); - } } diff --git a/src/emu/video/m50458.h b/src/emu/video/m50458.h index 7efcd0eb88fec..0574a4153ff38 100644 --- a/src/emu/video/m50458.h +++ b/src/emu/video/m50458.h @@ -15,12 +15,9 @@ Mitsubishi M50458 OSD chip // INTERFACE CONFIGURATION MACROS //************************************************************************** -#define MCFG_M50458_ADD(_tag,_config,_freq) \ +#define MCFG_M50458_ADD(_tag,_freq,_screen) \ MCFG_DEVICE_ADD(_tag, M50458,_freq) \ - MCFG_DEVICE_CONFIG(_config) - -#define M50458_INTERFACE(name) \ - const m50458_interface (name) = + MCFG_VIDEO_SET_SCREEN(_screen) //************************************************************************** @@ -33,18 +30,11 @@ enum m50458_state_t OSD_SET_DATA }; -// ======================> upd7220_interface - -struct m50458_interface -{ - const char *m_screen_tag; -}; - // ======================> m50458_device class m50458_device : public device_t, public device_memory_interface, - public m50458_interface + public device_video_interface { public: // construction/destruction @@ -72,9 +62,6 @@ class m50458_device : public device_t, virtual void device_start(); virtual void device_reset(); virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const; - virtual void device_config_complete(); - - screen_device *m_screen; int m_latch; int m_reset_line; diff --git a/src/emu/video/mc6845.c b/src/emu/video/mc6845.c index 141bfe0237940..07a1e297561c1 100644 --- a/src/emu/video/mc6845.c +++ b/src/emu/video/mc6845.c @@ -99,7 +99,6 @@ void mc6845_device::device_config_complete() } else { - m_screen_tag = NULL; m_show_border_area = false; m_hpixels_per_column = 0; m_begin_update = NULL; @@ -115,12 +114,14 @@ void mc6845_device::device_config_complete() mc6845_device::mc6845_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) - : device_t(mconfig, type, name, tag, owner, clock, shortname, source) + : device_t(mconfig, type, name, tag, owner, clock, shortname, source), + device_video_interface(mconfig, *this, false) { } mc6845_device::mc6845_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : device_t(mconfig, MC6845, "mc6845", tag, owner, clock, "mc6845", __FILE__) + : device_t(mconfig, MC6845, "mc6845", tag, owner, clock, "mc6845", __FILE__), + device_video_interface(mconfig, *this, false) { } @@ -1000,16 +1001,6 @@ void mc6845_device::device_start() m_res_out_hsync_func.resolve(m_out_hsync_func, *this); m_res_out_vsync_func.resolve(m_out_vsync_func, *this); - /* get the screen device */ - if ( m_screen_tag != NULL ) - { - astring tempstring; - m_screen = downcast(machine().device(siblingtag(tempstring,m_screen_tag))); - assert(m_screen != NULL); - } - else - m_screen = NULL; - /* create the timers */ m_line_timer = timer_alloc(TIMER_LINE); m_de_off_timer = timer_alloc(TIMER_DE_OFF); diff --git a/src/emu/video/mc6845.h b/src/emu/video/mc6845.h index a7b05ed7c2159..b9f765f03bbd5 100644 --- a/src/emu/video/mc6845.h +++ b/src/emu/video/mc6845.h @@ -16,12 +16,14 @@ #define MC6845_INTERFACE(name) \ const mc6845_interface (name) = -#define MCFG_MC6845_ADD(_tag, _variant, _clock, _config) \ +#define MCFG_MC6845_ADD(_tag, _variant, _screen_tag, _clock, _config) \ MCFG_DEVICE_ADD(_tag, _variant, _clock) \ + MCFG_VIDEO_SET_SCREEN(_screen_tag) \ MCFG_DEVICE_CONFIG(_config) #define MCFG_MOS8563_ADD(_tag, _screen_tag, _clock, _config, _map) \ MCFG_DEVICE_ADD(_tag, MOS8563, _clock) \ + MCFG_VIDEO_SET_SCREEN(_screen_tag) \ MCFG_DEVICE_CONFIG(_config) \ MCFG_DEVICE_ADDRESS_MAP(AS_0, _map) \ MCFG_SCREEN_ADD(_screen_tag, RASTER) \ @@ -32,6 +34,7 @@ #define MCFG_MOS8568_ADD(_tag, _screen_tag, _clock, _config, _map) \ MCFG_DEVICE_ADD(_tag, MOS8568, _clock) \ + MCFG_VIDEO_SET_SCREEN(_screen_tag) \ MCFG_DEVICE_CONFIG(_config) \ MCFG_DEVICE_ADDRESS_MAP(AS_0, _map) \ MCFG_SCREEN_ADD(_screen_tag, RASTER) \ @@ -69,7 +72,6 @@ typedef void (*mc6845_on_update_addr_changed_func)(mc6845_device *device, int ad /* interface */ struct mc6845_interface { - const char *m_screen_tag; /* screen we are acting on */ bool m_show_border_area; /* visible screen area (false) active display (true) active display + blanking */ int m_hpixels_per_column; /* number of pixels per video memory address */ @@ -108,6 +110,7 @@ struct mc6845_interface class mc6845_device : public device_t, + public device_video_interface, public mc6845_interface { friend class mc6845_1_device; @@ -189,8 +192,6 @@ class mc6845_device : public device_t, devcb_resolved_write_line m_res_out_hsync_func; devcb_resolved_write_line m_res_out_vsync_func; - screen_device *m_screen; - /* register file */ UINT8 m_horiz_char_total; /* 0x00 */ UINT8 m_horiz_disp; /* 0x01 */ diff --git a/src/emu/video/msm6255.c b/src/emu/video/msm6255.c index c8180244d1541..6ddbefd829ec6 100644 --- a/src/emu/video/msm6255.c +++ b/src/emu/video/msm6255.c @@ -120,6 +120,7 @@ inline UINT8 msm6255_device::read_byte(UINT16 ma, UINT8 ra) msm6255_device::msm6255_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, MSM6255, "MSM6255", tag, owner, clock, "msm6255", __FILE__), device_memory_interface(mconfig, *this), + device_video_interface(mconfig, *this), m_space_config("videoram", ENDIANNESS_LITTLE, 8, 20, 0, NULL, *ADDRESS_MAP_NAME(msm6255)), m_cursor(0) { @@ -130,14 +131,11 @@ msm6255_device::msm6255_device(const machine_config &mconfig, const char *tag, d // static_set_config - configuration helper //------------------------------------------------- -void msm6255_device::static_set_config(device_t &device, int char_clock, const char *screen_tag) +void msm6255_device::static_set_config(device_t &device, int char_clock) { msm6255_device &msm6255 = downcast(device); - assert(screen_tag != NULL); - msm6255.m_char_clock = char_clock; - msm6255.m_screen_tag = screen_tag; } @@ -147,9 +145,6 @@ void msm6255_device::static_set_config(device_t &device, int char_clock, const c void msm6255_device::device_start() { - // find screen - m_screen = machine().device(m_screen_tag); - // register for state saving save_item(NAME(m_ir)); save_item(NAME(m_mor)); diff --git a/src/emu/video/msm6255.h b/src/emu/video/msm6255.h index b0baf3036396c..a5d5ec8777b87 100644 --- a/src/emu/video/msm6255.h +++ b/src/emu/video/msm6255.h @@ -23,7 +23,8 @@ #define MCFG_MSM6255_ADD(_tag, _clock, _char_clock, _screen_tag, _map) \ MCFG_DEVICE_ADD(_tag, MSM6255, _clock) \ MCFG_DEVICE_ADDRESS_MAP(AS_0, _map) \ - msm6255_device::static_set_config(*device, _char_clock, _screen_tag); + MCFG_VIDEO_SET_SCREEN(_screen_tag) \ + msm6255_device::static_set_config(*device, _char_clock); @@ -34,14 +35,15 @@ // ======================> msm6255_device class msm6255_device : public device_t, - public device_memory_interface + public device_memory_interface, + public device_video_interface { public: // construction/destruction msm6255_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); // inline configuration helpers - static void static_set_config(device_t &device, int char_clock, const char *screen_tag); + static void static_set_config(device_t &device, int char_clock); virtual DECLARE_ADDRESS_MAP(map, 8); @@ -70,8 +72,6 @@ class msm6255_device : public device_t, void update_text(bitmap_ind16 &bitmap, const rectangle &cliprect); const address_space_config m_space_config; - const char *m_screen_tag; - screen_device *m_screen; int m_char_clock; UINT8 m_ir; // instruction register diff --git a/src/emu/video/pc_cga.c b/src/emu/video/pc_cga.c index 3bfd3af71c9fc..5b7986f8d80c0 100644 --- a/src/emu/video/pc_cga.c +++ b/src/emu/video/pc_cga.c @@ -184,7 +184,6 @@ static VIDEO_START( cga_mc1502 ); static MC6845_INTERFACE( mc6845_cga_intf ) { - CGA_SCREEN_NAME, /* screen number */ false, /* show border area */ 8, /* numbers of pixels per video memory address */ NULL, /* begin_update */ @@ -209,7 +208,7 @@ MACHINE_CONFIG_FRAGMENT( pcvideo_cga ) MCFG_PALETTE_LENGTH(/* CGA_PALETTE_SETS * 16*/ 65536 ) MCFG_PALETTE_INIT(pc_cga) - MCFG_MC6845_ADD(CGA_MC6845_NAME, MC6845, XTAL_14_31818MHz/8, mc6845_cga_intf) + MCFG_MC6845_ADD(CGA_MC6845_NAME, MC6845, CGA_SCREEN_NAME, XTAL_14_31818MHz/8, mc6845_cga_intf) MCFG_VIDEO_START( pc_cga ) MACHINE_CONFIG_END @@ -234,7 +233,7 @@ MACHINE_CONFIG_FRAGMENT( pcvideo_mc1502 ) MCFG_PALETTE_LENGTH(/* CGA_PALETTE_SETS * 16*/ 65536 ) MCFG_PALETTE_INIT(pc_cga) - MCFG_MC6845_ADD(CGA_MC6845_NAME, MC6845, XTAL_16MHz/8, mc6845_cga_intf) + MCFG_MC6845_ADD(CGA_MC6845_NAME, MC6845, CGA_SCREEN_NAME, XTAL_16MHz/8, mc6845_cga_intf) MCFG_VIDEO_START( cga_mc1502 ) MACHINE_CONFIG_END diff --git a/src/emu/video/sed1330.c b/src/emu/video/sed1330.c index 549f693c3c309..b06d1f779b48a 100644 --- a/src/emu/video/sed1330.c +++ b/src/emu/video/sed1330.c @@ -142,26 +142,13 @@ inline void sed1330_device::increment_csr() sed1330_device::sed1330_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, SED1330, "SED1330", tag, owner, clock, "sed1330", __FILE__), device_memory_interface(mconfig, *this), + device_video_interface(mconfig, *this), m_bf(0), m_space_config("videoram", ENDIANNESS_LITTLE, 8, 16, 0, NULL, *ADDRESS_MAP_NAME(sed1330)) { } -//------------------------------------------------- -// static_set_config - configuration helper -//------------------------------------------------- - -void sed1330_device::static_set_config(device_t &device, const char *screen_tag) -{ - sed1330_device &sed1330 = downcast(device); - - assert(screen_tag != NULL); - - sed1330.m_screen_tag = screen_tag; -} - - //------------------------------------------------- // rom_region - device-specific ROM region //------------------------------------------------- diff --git a/src/emu/video/sed1330.h b/src/emu/video/sed1330.h index 94652d402716c..202335be921e3 100644 --- a/src/emu/video/sed1330.h +++ b/src/emu/video/sed1330.h @@ -23,7 +23,7 @@ #define MCFG_SED1330_ADD(_tag, _clock, _screen_tag, _map) \ MCFG_DEVICE_ADD(_tag, SED1330, _clock) \ MCFG_DEVICE_ADDRESS_MAP(AS_0, _map) \ - sed1330_device::static_set_config(*device, _screen_tag); + MCFG_VIDEO_SET_SCREEN(_screen_tag) @@ -34,15 +34,13 @@ // ======================> sed1330_device class sed1330_device : public device_t, - public device_memory_interface + public device_memory_interface, + public device_video_interface { public: // construction/destruction sed1330_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - // inline configuration helpers - static void static_set_config(device_t &device, const char *screen_tag); - // optional information overrides virtual const rom_entry *device_rom_region() const; @@ -116,12 +114,8 @@ class sed1330_device : public device_t, int m_dm; // display mode for pages 1, 3 int m_ov; // graphics mode layer composition - // devices - //screen_device *m_screen; - // address space configurations const address_space_config m_space_config; - const char *m_screen_tag; }; diff --git a/src/emu/video/tms34061.c b/src/emu/video/tms34061.c index 4764374f8eefe..77ca4f3ab1b8e 100644 --- a/src/emu/video/tms34061.c +++ b/src/emu/video/tms34061.c @@ -29,6 +29,7 @@ const device_type TMS34061 = &device_creator; tms34061_device::tms34061_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, TMS34061, "tms34061", tag, owner, clock, "tms34061", __FILE__), + device_video_interface(mconfig, *this), //m_regs[TMS34061_REGCOUNT], m_xmask(0), m_yshift(0), @@ -63,7 +64,6 @@ void tms34061_device::device_config_complete() // or initialize to defaults if none provided else { - m_screen_tag = ""; m_rowshift = 0; m_vramsize = 0; //(*m_interrupt)(int state) @@ -77,7 +77,6 @@ void tms34061_device::device_config_complete() void tms34061_device::device_start() { /* reset the data */ - m_screen = machine().device(m_screen_tag); m_vrammask = m_vramsize - 1; /* allocate memory for VRAM */ diff --git a/src/emu/video/tms34061.h b/src/emu/video/tms34061.h index 745c0e76ccbf4..fc0dc9a6e3374 100644 --- a/src/emu/video/tms34061.h +++ b/src/emu/video/tms34061.h @@ -38,7 +38,6 @@ enum /* interface structure */ struct tms34061_interface { - const char *m_screen_tag; /* the screen we are acting on */ UINT8 m_rowshift; /* VRAM address is (row << rowshift) | col */ UINT32 m_vramsize; /* size of video RAM */ void (*m_interrupt)(running_machine &machine, int state); /* interrupt gen callback */ @@ -60,7 +59,8 @@ struct tms34061_display // ======================> tms34061_device class tms34061_device : public device_t, - public tms34061_interface + public device_video_interface, + public tms34061_interface { public: // construction/destruction @@ -95,7 +95,6 @@ class tms34061_device : public device_t, UINT8 m_latchdata; UINT8 * m_shiftreg; emu_timer * m_timer; - screen_device *m_screen; void update_interrupts(void); TIMER_CALLBACK_MEMBER( interrupt ); diff --git a/src/emu/video/tms9927.c b/src/emu/video/tms9927.c index 975cceba0b6fd..831c088b2dced 100644 --- a/src/emu/video/tms9927.c +++ b/src/emu/video/tms9927.c @@ -36,12 +36,14 @@ const device_type CRT5037 = &device_creator; const device_type CRT5057 = &device_creator; tms9927_device::tms9927_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : device_t(mconfig, TMS9927, "TMS9927", tag, owner, clock, "tms9927", __FILE__) + : device_t(mconfig, TMS9927, "TMS9927", tag, owner, clock, "tms9927", __FILE__), + device_video_interface(mconfig, *this) { } tms9927_device::tms9927_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) - : device_t(mconfig, type, name, tag, owner, clock, shortname, source) + : device_t(mconfig, type, name, tag, owner, clock, shortname, source), + device_video_interface(mconfig, *this) { } @@ -89,10 +91,6 @@ void tms9927_device::device_start() /* copy the initial parameters */ m_clock = clock(); - /* get the screen device */ - m_screen = downcast(machine().device(m_screen_tag)); - assert(m_screen != NULL); - /* get the self-load PROM */ if (m_selfload_region != NULL) { diff --git a/src/emu/video/tms9927.h b/src/emu/video/tms9927.h index 4e13d22e2548b..2405fbd127464 100644 --- a/src/emu/video/tms9927.h +++ b/src/emu/video/tms9927.h @@ -13,13 +13,13 @@ /* interface */ struct tms9927_interface { - const char *m_screen_tag; /* screen we are acting on */ int m_hpixels_per_column; /* number of pixels per video memory address */ const char *m_selfload_region; /* name of the region with self-load data */ }; class tms9927_device : public device_t, + public device_video_interface, public tms9927_interface { public: @@ -48,7 +48,6 @@ class tms9927_device : public device_t, void generic_access(address_space &space, offs_t offset); // internal state - screen_device *m_screen; const UINT8 *m_selfload; /* live state */ diff --git a/src/emu/video/tms9928a.c b/src/emu/video/tms9928a.c index 781d1a65bd4f7..408bf7ed290cf 100644 --- a/src/emu/video/tms9928a.c +++ b/src/emu/video/tms9928a.c @@ -93,6 +93,7 @@ static const rgb_t tms9928a_palette[TMS9928A_PALETTE_SIZE] = tms9928a_device::tms9928a_device( const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, bool is_50hz, bool is_reva, bool is_99, const char *shortname, const char *source) : device_t( mconfig, type, name, tag, owner, clock, shortname, source), device_memory_interface(mconfig, *this), + device_video_interface(mconfig, *this), m_space_config("vram",ENDIANNESS_BIG, 8, 14, 0, NULL, *ADDRESS_MAP_NAME(memmap)) { m_50hz = is_50hz; @@ -105,6 +106,7 @@ tms9928a_device::tms9928a_device( const machine_config &mconfig, device_type typ tms9928a_device::tms9928a_device( const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock ) : device_t( mconfig, TMS9928A, "TMS9928A", tag, owner, clock, "tms9928a", __FILE__), device_memory_interface(mconfig, *this), + device_video_interface(mconfig, *this), m_space_config("vram",ENDIANNESS_BIG, 8, 14, 0, NULL, *ADDRESS_MAP_NAME(memmap)) { m_50hz = false; @@ -629,8 +631,6 @@ void tms9928a_device::device_config_complete() void tms9928a_device::device_start() { astring tempstring; - m_screen = downcast(machine().device(siblingtag(tempstring,m_screen_tag))); - assert( m_screen != NULL ); m_top_border = m_50hz ? TMS9928A_VERT_DISPLAY_START_PAL : TMS9928A_VERT_DISPLAY_START_NTSC; m_vertical_size = m_50hz ? TMS9928A_TOTAL_VERT_PAL : TMS9928A_TOTAL_VERT_NTSC; diff --git a/src/emu/video/tms9928a.h b/src/emu/video/tms9928a.h index 53fea59e4605a..bada6b3e2e879 100644 --- a/src/emu/video/tms9928a.h +++ b/src/emu/video/tms9928a.h @@ -48,6 +48,8 @@ MCFG_DEVICE_ADD(_tag, _variant, XTAL_10_738635MHz / 2 ) \ MCFG_DEVICE_CONFIG(_config) +#define MCFG_TMS9928A_SET_SCREEN MCFG_VIDEO_SET_SCREEN + #define MCFG_TMS9928A_SCREEN_ADD_NTSC(_screen_tag) \ MCFG_SCREEN_ADD( _screen_tag, RASTER ) \ @@ -73,7 +75,6 @@ extern const device_type TMS9129; struct tms9928a_interface { - const char *m_screen_tag; int m_vram_size; /* 4K, 8K, or 16K. This should be replaced by fetching data from an address space? */ devcb_write_line m_out_int_line; /* Callback is called whenever the state of the INT output changes */ const char *m_regionname; // Alternatively, get the name of the region (if vram size is 0) @@ -82,6 +83,7 @@ struct tms9928a_interface class tms9928a_device : public device_t, public device_memory_interface, + public device_video_interface, public tms9928a_interface { public: @@ -119,8 +121,6 @@ class tms9928a_device : public device_t, static const device_timer_id TIMER_LINE = 0; - screen_device *m_screen; - /* TMS9928A internal settings */ UINT8 m_ReadAhead; UINT8 m_Regs[8]; diff --git a/src/emu/video/upd3301.c b/src/emu/video/upd3301.c index 959b5138d6946..68ab2b7a7b16f 100644 --- a/src/emu/video/upd3301.c +++ b/src/emu/video/upd3301.c @@ -194,6 +194,7 @@ inline void upd3301_device::recompute_parameters() upd3301_device::upd3301_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, UPD3301, "UPD3301", tag, owner, clock, "upd3301", __FILE__), + device_video_interface(mconfig, *this), m_status(0), m_param_count(0), m_data_fifo_pos(0), @@ -257,10 +258,6 @@ void upd3301_device::device_start() m_out_hrtc_func.resolve(m_out_hrtc_cb, *this); m_out_vrtc_func.resolve(m_out_vrtc_cb, *this); - // get the screen device - m_screen = machine().device(m_screen_tag); - assert(m_screen != NULL); - // state saving save_item(NAME(m_y)); save_item(NAME(m_hrtc)); diff --git a/src/emu/video/upd3301.h b/src/emu/video/upd3301.h index 5f6f46caf263d..a4d020564cf28 100644 --- a/src/emu/video/upd3301.h +++ b/src/emu/video/upd3301.h @@ -74,7 +74,6 @@ typedef void (*upd3301_display_pixels_func)(device_t *device, bitmap_rgb32 &bitm struct upd3301_interface { - const char *m_screen_tag; // screen we are acting on int m_width; // char width in pixels upd3301_display_pixels_func m_display_cb; @@ -90,6 +89,7 @@ struct upd3301_interface // ======================> upd3301_device class upd3301_device : public device_t, + public device_video_interface, public upd3301_interface { public: @@ -133,8 +133,6 @@ class upd3301_device : public device_t, devcb_resolved_write_line m_out_hrtc_func; devcb_resolved_write_line m_out_vrtc_func; - screen_device *m_screen; - // screen drawing bitmap_rgb32 *m_bitmap; // bitmap int m_y; // current scanline diff --git a/src/emu/video/upd7220.c b/src/emu/video/upd7220.c index 50cd18a28892c..41b780c1fe3aa 100644 --- a/src/emu/video/upd7220.c +++ b/src/emu/video/upd7220.c @@ -682,6 +682,7 @@ inline void upd7220_device::get_graphics_partition(int index, UINT32 *sad, UINT1 upd7220_device::upd7220_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, UPD7220, "uPD7220", tag, owner, clock, "upd7220", __FILE__), device_memory_interface(mconfig, *this), + device_video_interface(mconfig, *this), m_mask(0), m_pitch(0), m_ead(0), @@ -756,16 +757,6 @@ void upd7220_device::device_start() m_out_vsync_func.resolve(m_out_vsync_cb, *this); m_out_blank_func.resolve(m_out_blank_cb, *this); - // find screen - m_screen = machine().device(m_screen_tag); - - if (m_screen == NULL) - { - m_screen = owner()->subdevice(m_screen_tag); - } - - assert(m_screen); - // register for state saving save_item(NAME(m_ra)); save_item(NAME(m_sr)); diff --git a/src/emu/video/upd7220.h b/src/emu/video/upd7220.h index a9318ba9d133a..9662f1c87a4a7 100644 --- a/src/emu/video/upd7220.h +++ b/src/emu/video/upd7220.h @@ -75,8 +75,6 @@ typedef void (*upd7220_draw_text_line)(device_t *device, bitmap_rgb32 &bitmap, U struct upd7220_interface { - const char *m_screen_tag; - upd7220_display_pixels_func m_display_cb; upd7220_draw_text_line m_draw_text_cb; @@ -90,6 +88,7 @@ struct upd7220_interface class upd7220_device : public device_t, public device_memory_interface, + public device_video_interface, public upd7220_interface { public: @@ -159,8 +158,6 @@ class upd7220_device : public device_t, devcb_resolved_write_line m_out_vsync_func; devcb_resolved_write_line m_out_blank_func; - screen_device *m_screen; - UINT16 m_mask; // mask register UINT8 m_pitch; // number of word addresses in display memory in the horizontal direction UINT32 m_ead; // execute word address diff --git a/src/emu/video/v9938.c b/src/emu/video/v9938.c index 056e0fe8a1815..987fd3b817183 100644 --- a/src/emu/video/v9938.c +++ b/src/emu/video/v9938.c @@ -65,6 +65,7 @@ const device_type V9958 = &device_creator; v99x8_device::v99x8_device(const machine_config &mconfig, device_type type, const char *name, const char *shortname, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, type, name, tag, owner, clock, shortname, __FILE__), device_memory_interface(mconfig, *this), + device_video_interface(mconfig, *this), m_space_config("vram", ENDIANNESS_BIG, 8, 18), m_model(0), m_offset_x(0), @@ -90,8 +91,6 @@ v99x8_device::v99x8_device(const machine_config &mconfig, device_type type, cons m_mx_delta(0), m_my_delta(0), m_button_state(0), - m_screen(NULL), - m_screen_name(NULL), m_vdp_ops_count(0), m_vdp_engine(NULL) { @@ -568,11 +567,6 @@ void v99x8_device::register_w(UINT8 data) m_cont_reg[17] = (m_cont_reg[17] + 1) & 0x3f; } -void v99x8_device::static_set_screen(device_t &device, const char *screen_name) -{ - downcast(device).m_screen_name = screen_name; -} - void v99x8_device::static_set_vram_size(device_t &device, UINT32 vram_size) { downcast(device).m_vram_size = vram_size; @@ -586,12 +580,6 @@ void v99x8_device::static_set_vram_size(device_t &device, UINT32 vram_size) void v99x8_device::device_start() { - // find our devices - m_screen = machine().device(m_screen_name); - assert(m_screen != NULL); - if (!m_screen->started()) - throw device_missing_dependencies(); - m_int_callback.resolve_safe(); m_vdp_ops_count = 1; m_vdp_engine = NULL; diff --git a/src/emu/video/v9938.h b/src/emu/video/v9938.h index 1892bc0fff0bc..e07cf80ec92ec 100644 --- a/src/emu/video/v9938.h +++ b/src/emu/video/v9938.h @@ -17,11 +17,11 @@ #define MCFG_V9938_ADD(_tag, _screen, _vramsize) \ MCFG_DEVICE_ADD(_tag, V9938, 0) \ - v9938_device::static_set_screen(*device, _screen); \ + MCFG_VIDEO_SET_SCREEN(_screen) \ v9938_device::static_set_vram_size(*device, _vramsize); #define MCFG_V9958_ADD(_tag, _screen, _vramsize) \ MCFG_DEVICE_ADD(_tag, V9958, 0) \ - v9938_device::static_set_screen(*device, _screen); \ + MCFG_VIDEO_SET_SCREEN(_screen) \ v9938_device::static_set_vram_size(*device, _vramsize); #define MCFG_V99X8_INTERRUPT_CALLBACK(_irq) \ @@ -55,7 +55,9 @@ extern const device_type V9958; // ======================> v99x8_device -class v99x8_device : public device_t, public device_memory_interface +class v99x8_device : public device_t, + public device_memory_interface, + public device_video_interface { friend PALETTE_INIT( v9958 ); @@ -85,7 +87,6 @@ class v99x8_device : public device_t, public device_memory_interface void command_w(UINT8 data); void register_w(UINT8 data); - static void static_set_screen(device_t &device, const char *screen_name); static void static_set_vram_size(device_t &device, UINT32 vram_size); /* RESET pin */ @@ -204,9 +205,6 @@ class v99x8_device : public device_t, public device_memory_interface // palette UINT16 m_pal_ind16[16]; UINT16 m_pal_ind256[256]; - // render screen - screen_device *m_screen; - const char *m_screen_name; // render bitmap bitmap_ind16 m_bitmap; // Command unit diff --git a/src/mame/drivers/4roses.c b/src/mame/drivers/4roses.c index 4fc1ed2c6c171..f612906ad3791 100644 --- a/src/mame/drivers/4roses.c +++ b/src/mame/drivers/4roses.c @@ -364,7 +364,6 @@ static const ay8910_interface ay8910_intf = static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -405,7 +404,7 @@ static MACHINE_CONFIG_START( 4roses, _4roses_state ) MCFG_PALETTE_INIT_OVERRIDE(_4roses_state,funworld) MCFG_VIDEO_START_OVERRIDE(_4roses_state,funworld) -// MCFG_MC6845_ADD("crtc", MC6845, MASTER_CLOCK/8, mc6845_intf) /* 2MHz, guess */ +// MCFG_MC6845_ADD("crtc", MC6845, "screen", MASTER_CLOCK/8, mc6845_intf) /* 2MHz, guess */ /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/5clown.c b/src/mame/drivers/5clown.c index 6fc2a184b8fa2..5674b0e4078f4 100644 --- a/src/mame/drivers/5clown.c +++ b/src/mame/drivers/5clown.c @@ -997,7 +997,6 @@ GFXDECODE_END static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -1094,7 +1093,7 @@ static MACHINE_CONFIG_START( fclown, _5clown_state ) MCFG_PALETTE_LENGTH(256) - MCFG_MC6845_ADD("crtc", MC6845, MASTER_CLOCK/16, mc6845_intf) /* guess */ + MCFG_MC6845_ADD("crtc", MC6845, "screen", MASTER_CLOCK/16, mc6845_intf) /* guess */ /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/adp.c b/src/mame/drivers/adp.c index 68f0e320dfd08..a4ec67b560032 100644 --- a/src/mame/drivers/adp.c +++ b/src/mame/drivers/adp.c @@ -628,7 +628,6 @@ ADDRESS_MAP_END static H63484_INTERFACE( adp_h63484_intf ) { - "screen", acrtc_display_pixels }; diff --git a/src/mame/drivers/airbustr.c b/src/mame/drivers/airbustr.c index 785ebed7037b3..1f045004940f3 100644 --- a/src/mame/drivers/airbustr.c +++ b/src/mame/drivers/airbustr.c @@ -601,7 +601,6 @@ void airbustr_state::machine_reset() static const kaneko_pandora_interface airbustr_pandora_config = { - "screen", /* screen tag */ 1, /* gfx_region */ 0, 0 /* x_offs, y_offs */ }; diff --git a/src/mame/drivers/albazg.c b/src/mame/drivers/albazg.c index ff36f9e70ac11..54c955f155a4f 100644 --- a/src/mame/drivers/albazg.c +++ b/src/mame/drivers/albazg.c @@ -211,7 +211,6 @@ static const ay8910_interface ay8910_config = static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -400,7 +399,7 @@ static MACHINE_CONFIG_START( yumefuda, albazg_state ) MCFG_SCREEN_VISIBLE_AREA(0, 32*8-1, 0, 32*8-1) MCFG_SCREEN_UPDATE_DRIVER(albazg_state, screen_update_yumefuda) - MCFG_MC6845_ADD("crtc", H46505, MASTER_CLOCK/16, mc6845_intf) /* hand tuned to get ~60 fps */ + MCFG_MC6845_ADD("crtc", H46505, "screen", MASTER_CLOCK/16, mc6845_intf) /* hand tuned to get ~60 fps */ MCFG_GFXDECODE( yumefuda ) MCFG_PALETTE_LENGTH(0x80) diff --git a/src/mame/drivers/amaticmg.c b/src/mame/drivers/amaticmg.c index 7addd8e300b0a..db68248b90489 100644 --- a/src/mame/drivers/amaticmg.c +++ b/src/mame/drivers/amaticmg.c @@ -795,7 +795,6 @@ GFXDECODE_END static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 4, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -878,7 +877,7 @@ static MACHINE_CONFIG_START( amaticmg, amaticmg_state ) MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 0, 256-1) MCFG_SCREEN_UPDATE_DRIVER(amaticmg_state, screen_update_amaticmg) - MCFG_MC6845_ADD("crtc", MC6845, CRTC_CLOCK, mc6845_intf) + MCFG_MC6845_ADD("crtc", MC6845, "screen", CRTC_CLOCK, mc6845_intf) MCFG_GFXDECODE(amaticmg) diff --git a/src/mame/drivers/aristmk4.c b/src/mame/drivers/aristmk4.c index b0fc123f35b3c..a98d0b463e415 100644 --- a/src/mame/drivers/aristmk4.c +++ b/src/mame/drivers/aristmk4.c @@ -1565,7 +1565,6 @@ static MC6845_INTERFACE( mc6845_intf ) /* in fact is a mc6845 driving 4 pixels by memory address. that's why the big horizontal parameters */ - "screen", /* screen we are acting on */ false, /* show border area */ 4, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -1707,7 +1706,7 @@ static MACHINE_CONFIG_START( aristmk4, aristmk4_state ) MCFG_I8255A_ADD( "ppi8255_0", ppi8255_intf ) MCFG_VIA6522_ADD("via6522_0", 0, via_interface) /* 1 MHz.(only 1 or 2 MHz.are valid) */ MCFG_PIA6821_ADD("pia6821_0", aristmk4_pia1_intf) - MCFG_MC6845_ADD("crtc", C6545_1, MAIN_CLOCK/8, mc6845_intf) // TODO: type is unknown + MCFG_MC6845_ADD("crtc", C6545_1, "screen", MAIN_CLOCK/8, mc6845_intf) // TODO: type is unknown MCFG_MC146818_ADD("rtc", MC146818_IGNORE_CENTURY) MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/asuka.c b/src/mame/drivers/asuka.c index 8f9c763e61a25..2fd39da312c08 100644 --- a/src/mame/drivers/asuka.c +++ b/src/mame/drivers/asuka.c @@ -787,7 +787,6 @@ static const msm5205_interface msm5205_config = static const tc0100scn_interface asuka_tc0100scn_intf = { - "screen", 1, 2, /* gfxnum, txnum */ 0, 0, /* x_offset, y_offset */ 0, 0, /* flip_xoff, flip_yoff */ @@ -797,7 +796,6 @@ static const tc0100scn_interface asuka_tc0100scn_intf = static const tc0100scn_interface cadash_tc0100scn_intf = { - "screen", 1, 2, /* gfxnum, txnum */ 1, 0, /* x_offset, y_offset */ 0, 0, /* flip_xoff, flip_yoff */ diff --git a/src/mame/drivers/avt.c b/src/mame/drivers/avt.c index fff191ffd7f52..aae829d746738 100644 --- a/src/mame/drivers/avt.c +++ b/src/mame/drivers/avt.c @@ -849,7 +849,6 @@ GFXDECODE_END static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -909,7 +908,7 @@ static MACHINE_CONFIG_START( avt, avt_state ) MCFG_PALETTE_LENGTH(8*16) - MCFG_MC6845_ADD("crtc", MC6845, CRTC_CLOCK, mc6845_intf) /* guess */ + MCFG_MC6845_ADD("crtc", MC6845, "screen", CRTC_CLOCK, mc6845_intf) /* guess */ /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/backfire.c b/src/mame/drivers/backfire.c index 48c9158dd6960..c76a6c76076b8 100644 --- a/src/mame/drivers/backfire.c +++ b/src/mame/drivers/backfire.c @@ -456,7 +456,6 @@ static int backfire_bank_callback( int bank ) static const deco16ic_interface backfire_deco16ic_tilegen1_intf = { - "lscreen", 0, 1, 0x0f, 0x0f, /* trans masks (default values) */ 0x00, 0x40, /* color base */ @@ -468,7 +467,6 @@ static const deco16ic_interface backfire_deco16ic_tilegen1_intf = static const deco16ic_interface backfire_deco16ic_tilegen2_intf = { - "lscreen", 0, 1, 0x0f, 0x0f, /* trans masks (default values) */ 0x10, 0x50, /* color base */ @@ -525,7 +523,9 @@ static MACHINE_CONFIG_START( backfire, backfire_state ) MCFG_DECO16IC_ADD("tilegen1", backfire_deco16ic_tilegen1_intf) + MCFG_DECO16IC_SET_SCREEN("lscreen") MCFG_DECO16IC_ADD("tilegen2", backfire_deco16ic_tilegen2_intf) + MCFG_DECO16IC_SET_SCREEN("lscreen") MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0) decospr_device::set_gfx_region(*device, 4); diff --git a/src/mame/drivers/bishi.c b/src/mame/drivers/bishi.c index 2f99068349296..8aa51d6708542 100644 --- a/src/mame/drivers/bishi.c +++ b/src/mame/drivers/bishi.c @@ -374,7 +374,6 @@ static const k056832_interface bishi_k056832_intf = static const k054338_interface bishi_k054338_intf = { - "screen", 0, "none" }; diff --git a/src/mame/drivers/blitz.c b/src/mame/drivers/blitz.c index b1a9fbf740ca8..b31d6654885ea 100644 --- a/src/mame/drivers/blitz.c +++ b/src/mame/drivers/blitz.c @@ -742,7 +742,6 @@ static const pia6821_interface megadpkr_pia1_intf = static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -815,7 +814,7 @@ static MACHINE_CONFIG_START( megadpkr, blitz_state ) MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1) MCFG_SCREEN_UPDATE_DRIVER(blitz_state, screen_update_megadpkr) - MCFG_MC6845_ADD("crtc", MC6845, CPU_CLOCK, mc6845_intf) + MCFG_MC6845_ADD("crtc", MC6845, "screen", CPU_CLOCK, mc6845_intf) MCFG_GFXDECODE(megadpkr) MCFG_PALETTE_LENGTH(256) diff --git a/src/mame/drivers/blitz68k.c b/src/mame/drivers/blitz68k.c index 6122ba70aa891..3e5b9d8144878 100644 --- a/src/mame/drivers/blitz68k.c +++ b/src/mame/drivers/blitz68k.c @@ -1667,7 +1667,6 @@ WRITE_LINE_MEMBER(blitz68k_state::crtc_vsync_irq5) static MC6845_INTERFACE( mc6845_intf_irq1 ) { - "screen", /* screen we are acting on */ false, /* show border area */ 4, /* number of pixels per video memory address */ /* Horizontal Display programmed to 160 characters */ NULL, /* before pixel update callback */ @@ -1682,7 +1681,6 @@ static MC6845_INTERFACE( mc6845_intf_irq1 ) static MC6845_INTERFACE( mc6845_intf_irq3 ) { - "screen", /* screen we are acting on */ false, /* show border area */ 4, /* number of pixels per video memory address */ /* Horizontal Display programmed to 160 characters */ NULL, /* before pixel update callback */ @@ -1697,7 +1695,6 @@ static MC6845_INTERFACE( mc6845_intf_irq3 ) static MC6845_INTERFACE( mc6845_intf_irq5 ) { - "screen", /* screen we are acting on */ false, /* show border area */ 4, /* number of pixels per video memory address */ /* Horizontal Display programmed to 160 characters */ NULL, /* before pixel update callback */ @@ -1805,7 +1802,7 @@ static MACHINE_CONFIG_START( cjffruit, blitz68k_state ) MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 0, 256-8-1) MCFG_SCREEN_UPDATE_DRIVER(blitz68k_state, screen_update_blitz68k) - MCFG_MC6845_ADD("crtc", R6545_1, XTAL_22_1184MHz/8, mc6845_intf_irq1) + MCFG_MC6845_ADD("crtc", R6545_1, "screen", XTAL_22_1184MHz/8, mc6845_intf_irq1) MCFG_PALETTE_LENGTH(0x100) @@ -1837,7 +1834,7 @@ static MACHINE_CONFIG_START( bankrob, blitz68k_state ) MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 0+4, 256-1-4) MCFG_SCREEN_UPDATE_DRIVER(blitz68k_state, screen_update_blitz68k) - MCFG_MC6845_ADD("crtc", H46505, XTAL_11_0592MHz/4, mc6845_intf_irq3) + MCFG_MC6845_ADD("crtc", H46505, "screen", XTAL_11_0592MHz/4, mc6845_intf_irq3) MCFG_PALETTE_LENGTH(0x100) @@ -1867,7 +1864,7 @@ static MACHINE_CONFIG_START( bankroba, blitz68k_state ) MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 0+7, 256-1) MCFG_SCREEN_UPDATE_DRIVER(blitz68k_state, screen_update_blitz68k) - MCFG_MC6845_ADD("crtc", H46505, XTAL_11_0592MHz/4, mc6845_intf_irq5) + MCFG_MC6845_ADD("crtc", H46505, "screen", XTAL_11_0592MHz/4, mc6845_intf_irq5) MCFG_PALETTE_LENGTH(0x100) @@ -1896,7 +1893,7 @@ static MACHINE_CONFIG_START( deucesw2, blitz68k_state ) MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 0, 256-1) MCFG_SCREEN_UPDATE_DRIVER(blitz68k_state, screen_update_blitz68k) - MCFG_MC6845_ADD("crtc", R6545_1, XTAL_22_1184MHz/8, mc6845_intf_irq3) + MCFG_MC6845_ADD("crtc", R6545_1, "screen", XTAL_22_1184MHz/8, mc6845_intf_irq3) MCFG_PALETTE_LENGTH(0x100) @@ -1927,7 +1924,7 @@ static MACHINE_CONFIG_START( dualgame, blitz68k_state ) MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 0+4, 256-1-4) MCFG_SCREEN_UPDATE_DRIVER(blitz68k_state, screen_update_blitz68k) - MCFG_MC6845_ADD("crtc", H46505, XTAL_11_0592MHz/4, mc6845_intf_irq3) + MCFG_MC6845_ADD("crtc", H46505, "screen", XTAL_11_0592MHz/4, mc6845_intf_irq3) MCFG_PALETTE_LENGTH(0x100) @@ -1956,7 +1953,7 @@ static MACHINE_CONFIG_START( hermit, blitz68k_state ) MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 0+4, 256-1-4) MCFG_SCREEN_UPDATE_DRIVER(blitz68k_state, screen_update_blitz68k) - MCFG_MC6845_ADD("crtc", H46505, XTAL_22_1184MHz/8, mc6845_intf_irq1) + MCFG_MC6845_ADD("crtc", H46505, "screen", XTAL_22_1184MHz/8, mc6845_intf_irq1) MCFG_PALETTE_LENGTH(0x100) @@ -1990,7 +1987,7 @@ static MACHINE_CONFIG_START( maxidbl, blitz68k_state ) MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 0, 256-1) MCFG_SCREEN_UPDATE_DRIVER(blitz68k_state, screen_update_blitz68k_noblit) - MCFG_MC6845_ADD("crtc", H46505, XTAL_11_0592MHz/4, mc6845_intf_irq3) + MCFG_MC6845_ADD("crtc", H46505, "screen", XTAL_11_0592MHz/4, mc6845_intf_irq3) MCFG_PALETTE_LENGTH(0x100) MCFG_RAMDAC_ADD("ramdac", ramdac_intf, ramdac_map) diff --git a/src/mame/drivers/bloodbro.c b/src/mame/drivers/bloodbro.c index 3758c386aff3b..392baf1fed5c0 100644 --- a/src/mame/drivers/bloodbro.c +++ b/src/mame/drivers/bloodbro.c @@ -453,7 +453,6 @@ WRITE16_MEMBER( bloodbro_state::layer_scroll_w ) SEIBU_CRTC_INTERFACE(crtc_intf) { - "screen", DEVCB_DRIVER_MEMBER16(bloodbro_state, layer_en_w), DEVCB_DRIVER_MEMBER16(bloodbro_state, layer_scroll_w), }; diff --git a/src/mame/drivers/boogwing.c b/src/mame/drivers/boogwing.c index e9408865ae00f..477a9eaa81c7c 100644 --- a/src/mame/drivers/boogwing.c +++ b/src/mame/drivers/boogwing.c @@ -311,14 +311,8 @@ static int boogwing_bank_callback2( const int bank ) return offset; } -static const decocomn_interface boogwing_decocomn_intf = -{ - "screen", -}; - static const deco16ic_interface boogwing_deco16ic_tilegen1_intf = { - "screen", 0, 1, 0x0f, 0x1f, /* trans masks (pf2 has 5bpp graphics) */ 0, 0, /* color base (pf2 is non default) */ @@ -330,7 +324,6 @@ static const deco16ic_interface boogwing_deco16ic_tilegen1_intf = static const deco16ic_interface boogwing_deco16ic_tilegen2_intf = { - "screen", 0, 1, 0x0f, 0x0f, 0, 16, @@ -366,7 +359,7 @@ static MACHINE_CONFIG_START( boogwing, boogwing_state ) MCFG_BUFFERED_SPRITERAM16_ADD("spriteram") MCFG_BUFFERED_SPRITERAM16_ADD("spriteram2") - MCFG_DECOCOMN_ADD("deco_common", boogwing_decocomn_intf) + MCFG_DECOCOMN_ADD("deco_common") MCFG_DECO16IC_ADD("tilegen1", boogwing_deco16ic_tilegen1_intf) MCFG_DECO16IC_ADD("tilegen2", boogwing_deco16ic_tilegen2_intf) diff --git a/src/mame/drivers/buster.c b/src/mame/drivers/buster.c index 34dc51c1d7646..460d25d7d73b4 100644 --- a/src/mame/drivers/buster.c +++ b/src/mame/drivers/buster.c @@ -310,7 +310,6 @@ GFXDECODE_END static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -345,7 +344,7 @@ static MACHINE_CONFIG_START( buster, buster_state ) MCFG_SCREEN_SIZE(256, 256) MCFG_SCREEN_VISIBLE_AREA(0, 256-1, 16, 256-16-1) MCFG_SCREEN_UPDATE_DRIVER(buster_state, screen_update_buster) - MCFG_MC6845_ADD("crtc", MC6845, XTAL_3_579545MHz/4, mc6845_intf) //unknown clock / type + MCFG_MC6845_ADD("crtc", MC6845, "screen", XTAL_3_579545MHz/4, mc6845_intf) //unknown clock / type MCFG_GFXDECODE(buster) MCFG_PALETTE_LENGTH(8) diff --git a/src/mame/drivers/byvid.c b/src/mame/drivers/byvid.c index a91db1289cbe4..6eb41b4291e52 100644 --- a/src/mame/drivers/byvid.c +++ b/src/mame/drivers/byvid.c @@ -109,7 +109,6 @@ WRITE_LINE_MEMBER(by133_state::vdp_interrupt) static TMS9928A_INTERFACE(byvid_tms9928a_interface) { - "screen", 0x4000, DEVCB_DRIVER_LINE_MEMBER(by133_state,vdp_interrupt) }; diff --git a/src/mame/drivers/calomega.c b/src/mame/drivers/calomega.c index d1118065ef612..1053b3c3645df 100644 --- a/src/mame/drivers/calomega.c +++ b/src/mame/drivers/calomega.c @@ -2716,7 +2716,6 @@ static const ay8910_interface sys906_ay8912_intf = static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -2757,7 +2756,7 @@ static MACHINE_CONFIG_START( sys903, calomega_state ) MCFG_PALETTE_LENGTH(1024) - MCFG_MC6845_ADD("crtc", MC6845, CPU_CLOCK, mc6845_intf) /* 6845 @ CPU clock */ + MCFG_MC6845_ADD("crtc", MC6845, "screen", CPU_CLOCK, mc6845_intf) /* 6845 @ CPU clock */ /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/capbowl.c b/src/mame/drivers/capbowl.c index b1eb11b107e9f..f3385105f8233 100644 --- a/src/mame/drivers/capbowl.c +++ b/src/mame/drivers/capbowl.c @@ -348,7 +348,6 @@ static void generate_interrupt( running_machine &machine, int state ) static const struct tms34061_interface tms34061intf = { - "screen", /* the screen we are acting on */ 8, /* VRAM address is (row << rowshift) | col */ 0x10000, /* size of video RAM */ generate_interrupt /* interrupt gen callback */ diff --git a/src/mame/drivers/carrera.c b/src/mame/drivers/carrera.c index 673130232e10b..03ea4e2cca7f3 100644 --- a/src/mame/drivers/carrera.c +++ b/src/mame/drivers/carrera.c @@ -313,7 +313,6 @@ void carrera_state::palette_init() static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -342,7 +341,7 @@ static MACHINE_CONFIG_START( carrera, carrera_state ) MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 0, 256-1) MCFG_SCREEN_UPDATE_DRIVER(carrera_state, screen_update_carrera) - MCFG_MC6845_ADD("crtc", MC6845, MASTER_CLOCK / 16, mc6845_intf) + MCFG_MC6845_ADD("crtc", MC6845, "screen", MASTER_CLOCK / 16, mc6845_intf) MCFG_GFXDECODE(carrera) MCFG_PALETTE_LENGTH(32) diff --git a/src/mame/drivers/cbuster.c b/src/mame/drivers/cbuster.c index 6c5696bb2c66d..2df2be78651c1 100644 --- a/src/mame/drivers/cbuster.c +++ b/src/mame/drivers/cbuster.c @@ -265,7 +265,6 @@ static int twocrude_bank_callback( const int bank ) static const deco16ic_interface twocrude_deco16ic_tilegen1_intf = { - "screen", 0, 1, 0x0f, 0x0f, /* trans masks (default values) */ 0x00, 0x20, /* color base (default values) */ @@ -277,7 +276,6 @@ static const deco16ic_interface twocrude_deco16ic_tilegen1_intf = static const deco16ic_interface twocrude_deco16ic_tilegen2_intf = { - "screen", 0, 1, 0x0f, 0x0f, /* trans masks (default values) */ 0x30, 0x40, /* color base (default values) */ diff --git a/src/mame/drivers/cham24.c b/src/mame/drivers/cham24.c index 572a56222f13d..9a6dc0b06dad7 100644 --- a/src/mame/drivers/cham24.c +++ b/src/mame/drivers/cham24.c @@ -295,7 +295,6 @@ void cham24_state::ppu_irq(int *ppu_regs) static const ppu2c0x_interface ppu_interface = { "maincpu", - "screen", 0, /* gfxlayout num */ 0, /* color base */ PPU_MIRROR_NONE /* mirroring */ diff --git a/src/mame/drivers/chance32.c b/src/mame/drivers/chance32.c index c1efe35fb8aca..42bac3392e8cd 100644 --- a/src/mame/drivers/chance32.c +++ b/src/mame/drivers/chance32.c @@ -448,7 +448,6 @@ void chance32_state::machine_reset() static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 16, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -480,7 +479,7 @@ static MACHINE_CONFIG_START( chance32, chance32_state ) MCFG_SCREEN_VISIBLE_AREA(0, 35*16-1, 0, 29*8-1) MCFG_SCREEN_UPDATE_DRIVER(chance32_state, screen_update_chance32) - MCFG_MC6845_ADD("crtc", H46505, 12000000/16, mc6845_intf) /* 52.786 Hz (similar to Major Poker) */ + MCFG_MC6845_ADD("crtc", H46505, "screen", 12000000/16, mc6845_intf) /* 52.786 Hz (similar to Major Poker) */ MCFG_GFXDECODE(chance32) MCFG_PALETTE_LENGTH(0x800) diff --git a/src/mame/drivers/cliffhgr.c b/src/mame/drivers/cliffhgr.c index e81f1b119418e..c486d7c603745 100644 --- a/src/mame/drivers/cliffhgr.c +++ b/src/mame/drivers/cliffhgr.c @@ -677,7 +677,6 @@ INPUT_PORTS_END static TMS9928A_INTERFACE(cliffhgr_tms9928a_interface) { - "screen", 0x4000, DEVCB_DRIVER_LINE_MEMBER(cliffhgr_state,vdp_interrupt) }; diff --git a/src/mame/drivers/cninja.c b/src/mame/drivers/cninja.c index 176d19ec5eac6..d1843afa0af3f 100644 --- a/src/mame/drivers/cninja.c +++ b/src/mame/drivers/cninja.c @@ -813,14 +813,8 @@ static int mutantf_2_bank_callback( const int bank ) return ((bank >> 5) & 0x1) << 14; } -static const decocomn_interface cninja_decocomn_intf = -{ - "screen", -}; - static const deco16ic_interface cninja_deco16ic_tilegen1_intf = { - "screen", 1, 1, 0x0f, 0x0f, /* trans masks (default values) */ 0, 16, /* color base */ @@ -832,7 +826,6 @@ static const deco16ic_interface cninja_deco16ic_tilegen1_intf = static const deco16ic_interface cninja_deco16ic_tilegen2_intf = { - "screen", 0, 1, 0x0f, 0x0f, /* trans masks (default values) */ 0, 48, /* color base */ @@ -846,7 +839,6 @@ static const deco16ic_interface cninja_deco16ic_tilegen2_intf = static const deco16ic_interface edrandy_deco16ic_tilegen1_intf = { - "screen", 0, 1, 0x0f, 0x0f, /* trans masks (default values) */ 0, 16, /* color base */ @@ -858,7 +850,6 @@ static const deco16ic_interface edrandy_deco16ic_tilegen1_intf = static const deco16ic_interface edrandy_deco16ic_tilegen2_intf = { - "screen", 0, 1, 0x0f, 0x0f, /* trans masks (default values) */ 0, 48, /* color base */ @@ -871,7 +862,6 @@ static const deco16ic_interface edrandy_deco16ic_tilegen2_intf = static const deco16ic_interface robocop2_deco16ic_tilegen1_intf = { - "screen", 0, 1, 0x0f, 0x0f, /* trans masks (default values) */ 0, 16, /* color base */ @@ -883,7 +873,6 @@ static const deco16ic_interface robocop2_deco16ic_tilegen1_intf = static const deco16ic_interface robocop2_deco16ic_tilegen2_intf = { - "screen", 0, 1, 0x0f, 0x0f, /* trans masks (default values) */ 0, 48, /* color base */ @@ -896,7 +885,6 @@ static const deco16ic_interface robocop2_deco16ic_tilegen2_intf = static const deco16ic_interface mutantf_deco16ic_tilegen1_intf = { - "screen", 0, 1, 0x0f, 0x0f, /* trans masks (default values) */ 0, 0x30, /* color base */ @@ -908,7 +896,6 @@ static const deco16ic_interface mutantf_deco16ic_tilegen1_intf = static const deco16ic_interface mutantf_deco16ic_tilegen2_intf = { - "screen", 0, 1, 0x0f, 0x0f, /* trans masks (default values) */ 0x20, 0x40, /* color base */ @@ -972,7 +959,7 @@ static MACHINE_CONFIG_START( cninja, cninja_state ) MCFG_BUFFERED_SPRITERAM16_ADD("spriteram") - MCFG_DECOCOMN_ADD("deco_common", cninja_decocomn_intf) + MCFG_DECOCOMN_ADD("deco_common") MCFG_DECO16IC_ADD("tilegen1", cninja_deco16ic_tilegen1_intf) MCFG_DECO16IC_ADD("tilegen2", cninja_deco16ic_tilegen2_intf) @@ -1031,7 +1018,7 @@ static MACHINE_CONFIG_START( stoneage, cninja_state ) MCFG_BUFFERED_SPRITERAM16_ADD("spriteram") - MCFG_DECOCOMN_ADD("deco_common", cninja_decocomn_intf) + MCFG_DECOCOMN_ADD("deco_common") MCFG_DECO16IC_ADD("tilegen1", cninja_deco16ic_tilegen1_intf) MCFG_DECO16IC_ADD("tilegen2", cninja_deco16ic_tilegen2_intf) @@ -1085,7 +1072,7 @@ static MACHINE_CONFIG_START( cninjabl, cninja_state ) MCFG_BUFFERED_SPRITERAM16_ADD("spriteram") - MCFG_DECOCOMN_ADD("deco_common", cninja_decocomn_intf) + MCFG_DECOCOMN_ADD("deco_common") MCFG_DECO16IC_ADD("tilegen1", cninja_deco16ic_tilegen1_intf) MCFG_DECO16IC_ADD("tilegen2", cninja_deco16ic_tilegen2_intf) @@ -1128,7 +1115,7 @@ static MACHINE_CONFIG_START( edrandy, cninja_state ) MCFG_BUFFERED_SPRITERAM16_ADD("spriteram") - MCFG_DECOCOMN_ADD("deco_common", cninja_decocomn_intf) + MCFG_DECOCOMN_ADD("deco_common") MCFG_DECO16IC_ADD("tilegen1", edrandy_deco16ic_tilegen1_intf) MCFG_DECO16IC_ADD("tilegen2", edrandy_deco16ic_tilegen2_intf) @@ -1184,7 +1171,7 @@ static MACHINE_CONFIG_START( robocop2, cninja_state ) MCFG_BUFFERED_SPRITERAM16_ADD("spriteram") - MCFG_DECOCOMN_ADD("deco_common", cninja_decocomn_intf) + MCFG_DECOCOMN_ADD("deco_common") MCFG_DECO16IC_ADD("tilegen1", robocop2_deco16ic_tilegen1_intf) MCFG_DECO16IC_ADD("tilegen2", robocop2_deco16ic_tilegen2_intf) @@ -1246,7 +1233,7 @@ static MACHINE_CONFIG_START( mutantf, cninja_state ) MCFG_BUFFERED_SPRITERAM16_ADD("spriteram") MCFG_BUFFERED_SPRITERAM16_ADD("spriteram2") - MCFG_DECOCOMN_ADD("deco_common", cninja_decocomn_intf) + MCFG_DECOCOMN_ADD("deco_common") MCFG_DECO16IC_ADD("tilegen1", mutantf_deco16ic_tilegen1_intf) MCFG_DECO16IC_ADD("tilegen2", mutantf_deco16ic_tilegen2_intf) diff --git a/src/mame/drivers/coinmstr.c b/src/mame/drivers/coinmstr.c index b9f12a43adef0..4bee8d8684371 100644 --- a/src/mame/drivers/coinmstr.c +++ b/src/mame/drivers/coinmstr.c @@ -996,7 +996,6 @@ static const ay8910_interface ay8912_interface = static MC6845_INTERFACE( h46505_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -1031,7 +1030,7 @@ static MACHINE_CONFIG_START( coinmstr, coinmstr_state ) MCFG_PALETTE_LENGTH(46*32*4) - MCFG_MC6845_ADD("crtc", H46505, 14000000 / 16, h46505_intf) + MCFG_MC6845_ADD("crtc", H46505, "screen", 14000000 / 16, h46505_intf) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/darkseal.c b/src/mame/drivers/darkseal.c index 0276bae76f9f3..99b0aa2a039f3 100644 --- a/src/mame/drivers/darkseal.c +++ b/src/mame/drivers/darkseal.c @@ -222,7 +222,6 @@ GFXDECODE_END static const deco16ic_interface darkseal_deco16ic_tilegen1_intf = { - "screen", 0, 3, // both these tilemaps need to be twice the y size of usual! 0x0f, 0x0f, /* trans masks (default values) */ 0x00, 0x00, /* color base */ @@ -235,7 +234,6 @@ static const deco16ic_interface darkseal_deco16ic_tilegen1_intf = static const deco16ic_interface darkseal_deco16ic_tilegen2_intf = { - "screen", 0, 1, 0x0f, 0x0f, /* trans masks (default values) */ 0x00, 0x00, /* color base */ diff --git a/src/mame/drivers/dassault.c b/src/mame/drivers/dassault.c index 8eefa0e3036b4..182788aaf500c 100644 --- a/src/mame/drivers/dassault.c +++ b/src/mame/drivers/dassault.c @@ -450,11 +450,6 @@ WRITE8_MEMBER(dassault_state::sound_bankswitch_w) /**********************************************************************************/ -static const decocomn_interface dassault_decocomn_intf = -{ - "screen", -}; - static int dassault_bank_callback( const int bank ) { return ((bank >> 4) & 0xf) << 12; @@ -462,7 +457,6 @@ static int dassault_bank_callback( const int bank ) static const deco16ic_interface dassault_deco16ic_tilegen1_intf = { - "screen", 0, 1, 0x0f, 0x0f, /* trans masks (default values) */ 0, 16, /* color base (default values) */ @@ -474,7 +468,6 @@ static const deco16ic_interface dassault_deco16ic_tilegen1_intf = static const deco16ic_interface dassault_deco16ic_tilegen2_intf = { - "screen", 0, 1, 0x0f, 0x0f, /* trans masks (default values) */ 0, 16, /* color base (default values) */ @@ -517,7 +510,7 @@ static MACHINE_CONFIG_START( dassault, dassault_state ) MCFG_BUFFERED_SPRITERAM16_ADD("spriteram") MCFG_BUFFERED_SPRITERAM16_ADD("spriteram2") - MCFG_DECOCOMN_ADD("deco_common", dassault_decocomn_intf) + MCFG_DECOCOMN_ADD("deco_common") MCFG_DECO16IC_ADD("tilegen1", dassault_deco16ic_tilegen1_intf) MCFG_DECO16IC_ADD("tilegen2", dassault_deco16ic_tilegen2_intf) diff --git a/src/mame/drivers/dblewing.c b/src/mame/drivers/dblewing.c index a4b0968f70547..6ea1cc0f3692d 100644 --- a/src/mame/drivers/dblewing.c +++ b/src/mame/drivers/dblewing.c @@ -346,7 +346,6 @@ static int dblewing_bank_callback( const int bank ) static const deco16ic_interface dblewing_deco16ic_tilegen1_intf = { - "screen", 0, 1, 0x0f, 0x0f, /* trans masks (default values) */ 0, 16, /* color base (default values) */ diff --git a/src/mame/drivers/dbz.c b/src/mame/drivers/dbz.c index 8f7583dffb8fc..cd6c689f4d548 100644 --- a/src/mame/drivers/dbz.c +++ b/src/mame/drivers/dbz.c @@ -300,7 +300,6 @@ static const k056832_interface dbz_k056832_intf = static const k053247_interface dbz_k053246_intf = { - "screen", "gfx2", 3, NORMAL_PLANE_ORDER, -52, 16, @@ -322,7 +321,6 @@ WRITE_LINE_MEMBER(dbz_state::dbz_irq2_ack_w) static const k053252_interface dbz_k053252_intf = { - "screen", DEVCB_NULL, DEVCB_NULL, DEVCB_DRIVER_LINE_MEMBER(dbz_state,dbz_irq2_ack_w), diff --git a/src/mame/drivers/dcon.c b/src/mame/drivers/dcon.c index 97ca77bb57715..dbd952b7792a1 100644 --- a/src/mame/drivers/dcon.c +++ b/src/mame/drivers/dcon.c @@ -258,7 +258,6 @@ WRITE16_MEMBER( dcon_state::layer_scroll_w ) SEIBU_CRTC_INTERFACE(crtc_intf) { - "screen", DEVCB_DRIVER_MEMBER16(dcon_state, layer_en_w), DEVCB_DRIVER_MEMBER16(dcon_state, layer_scroll_w), }; diff --git a/src/mame/drivers/deco156.c b/src/mame/drivers/deco156.c index 26ac3d3813fed..295bca8c94dd7 100644 --- a/src/mame/drivers/deco156.c +++ b/src/mame/drivers/deco156.c @@ -326,7 +326,6 @@ static int deco156_bank_callback(const int bank) static const deco16ic_interface deco156_deco16ic_tilegen1_intf = { - "screen", 0, 1, 0x0f, 0x0f, /* trans masks (default values) */ 0, 16, /* color base (default values) */ diff --git a/src/mame/drivers/deco32.c b/src/mame/drivers/deco32.c index 8329bc72174eb..b68a2acc43d2b 100644 --- a/src/mame/drivers/deco32.c +++ b/src/mame/drivers/deco32.c @@ -248,7 +248,6 @@ static int fghthist_bank_callback( int bank ) static const deco16ic_interface fghthist_deco16ic_tilegen1_intf = { - "screen", 0, 1, 0x0f, 0x0f, /* trans masks (default values) */ 0x00, 0x10, /* color base */ @@ -260,7 +259,6 @@ static const deco16ic_interface fghthist_deco16ic_tilegen1_intf = static const deco16ic_interface fghthist_deco16ic_tilegen2_intf = { - "screen", 0, 1, 0x0f, 0x0f, /* trans masks (default values) */ 0x20, 0x30, /* color base */ @@ -1720,7 +1718,6 @@ static int captaven_bank_callback( int bank ) // pf4 not used (pf3 is in 8bpp mode) static const deco16ic_interface captaven_deco16ic_tilegen1_intf = { - "screen", 0, 1, // pf12only, split, fullwidth12 / fullwidth34 0x0f, 0x0f, /* trans masks (default values) */ 0x20, 0x30, /* color base */ @@ -1732,7 +1729,6 @@ static const deco16ic_interface captaven_deco16ic_tilegen1_intf = static const deco16ic_interface captaven_deco16ic_tilegen2_intf = { - "screen", 0, 0, // pf12only, split, fullwidth12 / fullwidth34 0xff, 0x00, /* trans masks (default values) */ 0x10, 0x00, /* color base */ @@ -1940,7 +1936,6 @@ static int dragngun_bank2_callback( int bank ) static const deco16ic_interface dragngun_deco16ic_tilegen1_intf = { - "screen", 0, 1, // dragon gun definitely needs pf3/4 full width, bgs in 2nd attract demo. 0x0f, 0x0f, /* trans masks (default values) */ 0x20, 0x30, /* color base */ @@ -1952,7 +1947,6 @@ static const deco16ic_interface dragngun_deco16ic_tilegen1_intf = static const deco16ic_interface dragngun_deco16ic_tilegen2_intf = { - "screen", 0, 1, // dragon gun definitely needs pf3/4 full width, bgs in 2nd attract demo. 0xff, 0xff, /* trans masks (default values) */ 0x04, 0x04, /* color base */ @@ -1964,7 +1958,6 @@ static const deco16ic_interface dragngun_deco16ic_tilegen2_intf = static const deco16ic_interface lockload_deco16ic_tilegen1_intf = { - "screen", 0, 1, // lockload definitely wants pf34 half width.. 0x0f, 0x0f, /* trans masks (default values) */ 0x20, 0x30, /* color base */ @@ -1976,7 +1969,6 @@ static const deco16ic_interface lockload_deco16ic_tilegen1_intf = static const deco16ic_interface lockload_deco16ic_tilegen2_intf = { - "screen", 0, 0, // lockload definitely wants pf34 half width.. 0xff, 0xff, /* trans masks (default values) */ 0x04, 0x04, /* color base */ @@ -2140,7 +2132,6 @@ static int tattass_bank_callback( int bank ) static const deco16ic_interface tattass_deco16ic_tilegen1_intf = { - "screen", 0, 1, 0x0f, 0x0f, /* trans masks (default values) */ 0x00, 0x10, /* color base */ @@ -2152,7 +2143,6 @@ static const deco16ic_interface tattass_deco16ic_tilegen1_intf = static const deco16ic_interface tattass_deco16ic_tilegen2_intf = { - "screen", 0, 1, 0x0f, 0x0f, /* trans masks (default values) */ 0x20, 0x30, /* color base */ diff --git a/src/mame/drivers/dietgo.c b/src/mame/drivers/dietgo.c index 138222086ac55..038d526781f57 100644 --- a/src/mame/drivers/dietgo.c +++ b/src/mame/drivers/dietgo.c @@ -195,14 +195,8 @@ static int dietgo_bank_callback(const int bank) return ((bank >> 4) & 0x7) * 0x1000; } -static const decocomn_interface dietgo_decocomn_intf = -{ - "screen", -}; - static const deco16ic_interface dietgo_deco16ic_tilegen1_intf = { - "screen", 0, 1, 0x0f, 0x0f, /* trans masks (default values) */ 0, 16, /* color base (default values) */ @@ -239,7 +233,7 @@ static MACHINE_CONFIG_START( dietgo, dietgo_state ) MCFG_PALETTE_LENGTH(1024) MCFG_GFXDECODE(dietgo) - MCFG_DECOCOMN_ADD("deco_common", dietgo_decocomn_intf) + MCFG_DECOCOMN_ADD("deco_common") MCFG_DECO16IC_ADD("tilegen1", dietgo_deco16ic_tilegen1_intf) diff --git a/src/mame/drivers/djboy.c b/src/mame/drivers/djboy.c index 725f237755b1a..a5d317a54622d 100644 --- a/src/mame/drivers/djboy.c +++ b/src/mame/drivers/djboy.c @@ -503,7 +503,6 @@ TIMER_DEVICE_CALLBACK_MEMBER(djboy_state::djboy_scanline) static const kaneko_pandora_interface djboy_pandora_config = { - "screen", /* screen tag */ 0, /* gfx_region */ 0, 0 /* x_offs, y_offs */ }; diff --git a/src/mame/drivers/dreambal.c b/src/mame/drivers/dreambal.c index 720e4e0511f9a..3c20c74974717 100644 --- a/src/mame/drivers/dreambal.c +++ b/src/mame/drivers/dreambal.c @@ -292,7 +292,6 @@ static int dreambal_bank_callback( const int bank ) static const deco16ic_interface dreambal_deco16ic_tilegen1_intf = { - "screen", 0, 1, 0x0f, 0x0f, /* trans masks (default values) */ 0, 16, /* color base (default values) */ diff --git a/src/mame/drivers/famibox.c b/src/mame/drivers/famibox.c index d43f5d02b19e3..87ca1aed02044 100644 --- a/src/mame/drivers/famibox.c +++ b/src/mame/drivers/famibox.c @@ -529,7 +529,6 @@ void famibox_state::ppu_irq(int *ppu_regs) static const ppu2c0x_interface ppu_interface = { "maincpu", - "screen", 0, /* gfxlayout num */ 0, /* color base */ PPU_MIRROR_NONE /* mirroring */ diff --git a/src/mame/drivers/flipjack.c b/src/mame/drivers/flipjack.c index c65e4d6a0d5a3..c692b1db18b89 100644 --- a/src/mame/drivers/flipjack.c +++ b/src/mame/drivers/flipjack.c @@ -429,7 +429,6 @@ static const ay8910_interface ay8910_config_2 = static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -494,7 +493,7 @@ static MACHINE_CONFIG_START( flipjack, flipjack_state ) MCFG_SCREEN_RAW_PARAMS(VIDEO_CLOCK, 0x188, 0, 0x100, 0x100, 0, 0xc0) // from crtc MCFG_SCREEN_UPDATE_DRIVER(flipjack_state, screen_update_flipjack) - MCFG_MC6845_ADD("crtc", HD6845, VIDEO_CLOCK/8, mc6845_intf) + MCFG_MC6845_ADD("crtc", HD6845, "screen", VIDEO_CLOCK/8, mc6845_intf) MCFG_GFXDECODE(flipjack) diff --git a/src/mame/drivers/forte2.c b/src/mame/drivers/forte2.c index d03aab4060f53..d495e21e87c94 100644 --- a/src/mame/drivers/forte2.c +++ b/src/mame/drivers/forte2.c @@ -106,7 +106,6 @@ WRITE_LINE_MEMBER(forte2_state::vdp_interrupt) static TMS9928A_INTERFACE(forte2_tms9928a_interface) { - "screen", 0x4000, DEVCB_DRIVER_LINE_MEMBER(forte2_state,vdp_interrupt) }; diff --git a/src/mame/drivers/fortecar.c b/src/mame/drivers/fortecar.c index 6007b1673b23d..175ce332f4905 100644 --- a/src/mame/drivers/fortecar.c +++ b/src/mame/drivers/fortecar.c @@ -535,7 +535,6 @@ static const ay8910_interface ay8910_config = static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -713,7 +712,7 @@ static MACHINE_CONFIG_START( fortecar, fortecar_state ) MCFG_PALETTE_LENGTH(0x200) - MCFG_MC6845_ADD("crtc", MC6845, CRTC_CLOCK, mc6845_intf) /* 1.5 MHz, measured */ + MCFG_MC6845_ADD("crtc", MC6845, "screen", CRTC_CLOCK, mc6845_intf) /* 1.5 MHz, measured */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/funkyjet.c b/src/mame/drivers/funkyjet.c index e0eba57676aad..ec48a6bcab5d6 100644 --- a/src/mame/drivers/funkyjet.c +++ b/src/mame/drivers/funkyjet.c @@ -303,7 +303,6 @@ GFXDECODE_END static const deco16ic_interface funkyjet_deco16ic_tilegen1_intf = { - "screen", 0, 1, 0x0f, 0x0f, /* trans masks (default values) */ 0, 16, /* color base (default values) */ diff --git a/src/mame/drivers/funworld.c b/src/mame/drivers/funworld.c index 427d2cdf27a0a..c0e2d0bf6c5ed 100644 --- a/src/mame/drivers/funworld.c +++ b/src/mame/drivers/funworld.c @@ -2533,7 +2533,6 @@ static const ay8910_interface funquiz_ay8910_intf = static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 4, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -2577,7 +2576,7 @@ static MACHINE_CONFIG_START( fw1stpal, funworld_state ) MCFG_PALETTE_INIT_OVERRIDE(funworld_state, funworld) MCFG_VIDEO_START_OVERRIDE(funworld_state, funworld) - MCFG_MC6845_ADD("crtc", MC6845, MASTER_CLOCK/8, mc6845_intf) /* 2MHz, veryfied on jollycrd & royalcrd */ + MCFG_MC6845_ADD("crtc", MC6845, "screen", MASTER_CLOCK/8, mc6845_intf) /* 2MHz, veryfied on jollycrd & royalcrd */ /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/gaelco.c b/src/mame/drivers/gaelco.c index b307e433461fc..d2bf4132d40e1 100644 --- a/src/mame/drivers/gaelco.c +++ b/src/mame/drivers/gaelco.c @@ -84,7 +84,7 @@ WRITE16_MEMBER(gaelco_state::gaelco_encrypted_w) { // mame_printf_debug("gaelco_encrypted_w!!\n"); data = gaelco_decrypt(space, offset, data, 0x0f, 0x4228); - COMBINE_DATA(&m_screen[offset]); + COMBINE_DATA(&m_screenram[offset]); } /*********** Thunder Hoop Encryption Related Code ******************/ @@ -102,7 +102,7 @@ WRITE16_MEMBER(gaelco_state::thoop_encrypted_w) { // mame_printf_debug("gaelco_encrypted_w!!\n"); data = gaelco_decrypt(space, offset, data, 0x0e, 0x4228); - COMBINE_DATA(&m_screen[offset]); + COMBINE_DATA(&m_screenram[offset]); } /************************************* diff --git a/src/mame/drivers/galastrm.c b/src/mame/drivers/galastrm.c index 79621fe8b376c..c5070f03dfd72 100644 --- a/src/mame/drivers/galastrm.c +++ b/src/mame/drivers/galastrm.c @@ -290,7 +290,6 @@ static const eeprom_interface galastrm_eeprom_interface = static const tc0100scn_interface galastrm_tc0100scn_intf = { - "screen", 0, 2, /* gfxnum, txnum */ -48, -56, /* x_offset, y_offset */ 0, 0, /* flip_xoff, flip_yoff */ diff --git a/src/mame/drivers/galpanic.c b/src/mame/drivers/galpanic.c index 1757ebb272ac9..5d1efdd72697d 100644 --- a/src/mame/drivers/galpanic.c +++ b/src/mame/drivers/galpanic.c @@ -543,7 +543,6 @@ GFXDECODE_END static const kaneko_pandora_interface galpanic_pandora_config = { - "screen", /* screen tag */ 0, /* gfx_region */ 0, -16 /* x_offs, y_offs */ }; diff --git a/src/mame/drivers/ggconnie.c b/src/mame/drivers/ggconnie.c index 56132e01258f7..f91e7e2ef0688 100644 --- a/src/mame/drivers/ggconnie.c +++ b/src/mame/drivers/ggconnie.c @@ -207,7 +207,6 @@ static const huc6270_interface pce_huc6270_config = static const huc6260_interface pce_huc6260_config = { - "screen", DEVCB_DEVICE_MEMBER16( "huc6270", huc6270_device, next_pixel ), DEVCB_DEVICE_MEMBER16( "huc6270", huc6270_device, time_until_next_event ), DEVCB_DEVICE_LINE_MEMBER( "huc6270", huc6270_device, vsync_changed ), @@ -248,7 +247,6 @@ static const huc6202_interface sgx_huc6202_config = static const huc6260_interface sgx_huc6260_config = { - "screen", DEVCB_DEVICE_MEMBER16( "huc6202", huc6202_device, next_pixel ), DEVCB_DEVICE_MEMBER16( "huc6202", huc6202_device, time_until_next_event ), DEVCB_DEVICE_LINE_MEMBER( "huc6202", huc6202_device, vsync_changed ), diff --git a/src/mame/drivers/gijoe.c b/src/mame/drivers/gijoe.c index 5e4e657c460cd..d8bdd5f8dec68 100644 --- a/src/mame/drivers/gijoe.c +++ b/src/mame/drivers/gijoe.c @@ -256,7 +256,6 @@ static const k056832_interface gijoe_k056832_intf = static const k053247_interface gijoe_k053247_intf = { - "screen", "gfx2", 1, NORMAL_PLANE_ORDER, -37, 20, diff --git a/src/mame/drivers/gluck2.c b/src/mame/drivers/gluck2.c index 5fab34bd2e30d..cbda3c36c67fb 100644 --- a/src/mame/drivers/gluck2.c +++ b/src/mame/drivers/gluck2.c @@ -507,7 +507,6 @@ GFXDECODE_END static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -569,7 +568,7 @@ static MACHINE_CONFIG_START( gluck2, gluck2_state ) MCFG_PALETTE_LENGTH(0x100) MCFG_PALETTE_INIT_OVERRIDE(gluck2_state, gluck2) - MCFG_MC6845_ADD("crtc", MC6845, MASTER_CLOCK/16, mc6845_intf) /* guess */ + MCFG_MC6845_ADD("crtc", MC6845, "screen", MASTER_CLOCK/16, mc6845_intf) /* guess */ /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/goldnpkr.c b/src/mame/drivers/goldnpkr.c index 0ba6010503e05..2dd6299e65a78 100644 --- a/src/mame/drivers/goldnpkr.c +++ b/src/mame/drivers/goldnpkr.c @@ -3642,7 +3642,6 @@ static const pia6821_interface bchancep_pia1_intf = static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -3831,7 +3830,7 @@ static MACHINE_CONFIG_START( goldnpkr_base, goldnpkr_state ) MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 29*8-1) /* From MC6845 init, registers 01 & 06. */ MCFG_SCREEN_UPDATE_DRIVER(goldnpkr_state, screen_update_goldnpkr) - MCFG_MC6845_ADD("crtc", MC6845, CPU_CLOCK, mc6845_intf) /* 68B45 or 6845s @ CPU clock */ + MCFG_MC6845_ADD("crtc", MC6845, "screen", CPU_CLOCK, mc6845_intf) /* 68B45 or 6845s @ CPU clock */ MCFG_GFXDECODE(goldnpkr) MCFG_PALETTE_LENGTH(256) diff --git a/src/mame/drivers/goodejan.c b/src/mame/drivers/goodejan.c index 463a8be4a9172..83177c40022a2 100644 --- a/src/mame/drivers/goodejan.c +++ b/src/mame/drivers/goodejan.c @@ -641,7 +641,6 @@ WRITE16_MEMBER( goodejan_state::layer_scroll_w ) SEIBU_CRTC_INTERFACE(crtc_intf) { - "screen", DEVCB_DRIVER_MEMBER16(goodejan_state, layer_en_w), DEVCB_DRIVER_MEMBER16(goodejan_state, layer_scroll_w), diff --git a/src/mame/drivers/groundfx.c b/src/mame/drivers/groundfx.c index 42c4d48bc6f41..e651afc59d66d 100644 --- a/src/mame/drivers/groundfx.c +++ b/src/mame/drivers/groundfx.c @@ -342,7 +342,6 @@ GFXDECODE_END static const tc0100scn_interface groundfx_tc0100scn_intf = { - "screen", 2, 3, /* gfxnum, txnum */ 50, 8, /* x_offset, y_offset */ 0, 0, /* flip_xoff, flip_yoff */ diff --git a/src/mame/drivers/guab.c b/src/mame/drivers/guab.c index 1e13cab91faba..da8a169e04461 100644 --- a/src/mame/drivers/guab.c +++ b/src/mame/drivers/guab.c @@ -144,7 +144,6 @@ static void tms_interrupt(running_machine &machine, int state) static const struct tms34061_interface tms34061intf = { - "screen", /* The screen we are acting on */ 8, /* VRAM address is (row << rowshift) | col */ 0x40000, /* Size of video RAM */ tms_interrupt /* Interrupt gen callback */ diff --git a/src/mame/drivers/hexion.c b/src/mame/drivers/hexion.c index c4e9bfa965de0..e75321001d784 100644 --- a/src/mame/drivers/hexion.c +++ b/src/mame/drivers/hexion.c @@ -210,7 +210,6 @@ TIMER_DEVICE_CALLBACK_MEMBER(hexion_state::hexion_scanline) static const k053252_interface hexion_k053252_intf = { - "screen", DEVCB_NULL, DEVCB_NULL, DEVCB_DRIVER_LINE_MEMBER(hexion_state,hexion_irq_ack_w), diff --git a/src/mame/drivers/hitpoker.c b/src/mame/drivers/hitpoker.c index 013205da0eb55..b6f335b596ffb 100644 --- a/src/mame/drivers/hitpoker.c +++ b/src/mame/drivers/hitpoker.c @@ -458,7 +458,6 @@ GFXDECODE_END static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -510,7 +509,7 @@ static MACHINE_CONFIG_START( hitpoker, hitpoker_state ) MCFG_SCREEN_VISIBLE_AREA(0, 648-1, 0, 240-1) MCFG_SCREEN_UPDATE_DRIVER(hitpoker_state, screen_update_hitpoker) - MCFG_MC6845_ADD("crtc", H46505, CRTC_CLOCK/2, mc6845_intf) /* hand tuned to get ~60 fps */ + MCFG_MC6845_ADD("crtc", H46505, "screen", CRTC_CLOCK/2, mc6845_intf) /* hand tuned to get ~60 fps */ MCFG_GFXDECODE(hitpoker) MCFG_PALETTE_LENGTH(0x800) diff --git a/src/mame/drivers/hornet.c b/src/mame/drivers/hornet.c index bcf3d24ef220b..90b93aefd3b5d 100644 --- a/src/mame/drivers/hornet.c +++ b/src/mame/drivers/hornet.c @@ -980,21 +980,6 @@ static const k033906_interface hornet_k033906_intf_1 = "voodoo1" }; -static const k037122_interface hornet_k037122_intf = -{ - "screen", 0 -}; - -static const k037122_interface hornet_k037122_intf_l = -{ - "lscreen", 0 -}; - -static const k037122_interface hornet_k037122_intf_r = -{ - "rscreen", 1 -}; - static const voodoo_config hornet_voodoo_intf = { 2, // fbmem; @@ -1038,7 +1023,7 @@ static MACHINE_CONFIG_START( hornet, hornet_state ) MCFG_PALETTE_LENGTH(65536) - MCFG_K037122_ADD("k037122_1", hornet_k037122_intf) + MCFG_K037122_ADD("k037122_1", "screen", 0) MCFG_K056800_ADD("k056800", hornet_k056800_interface, XTAL_64MHz/4) @@ -1106,8 +1091,8 @@ static MACHINE_CONFIG_DERIVED( hornet_2board, hornet ) MCFG_DEVICE_REMOVE("k037122_1") - MCFG_K037122_ADD("k037122_1", hornet_k037122_intf_l) - MCFG_K037122_ADD("k037122_2", hornet_k037122_intf_r) + MCFG_K037122_ADD("k037122_1", "lscreen", 0) + MCFG_K037122_ADD("k037122_2", "rscreen", 1) MCFG_DEVICE_REMOVE("voodoo0") MCFG_3DFX_VOODOO_1_ADD("voodoo0", STD_VOODOO_1_CLOCK, voodoo_l_intf) diff --git a/src/mame/drivers/hvyunit.c b/src/mame/drivers/hvyunit.c index b21c002511bfe..a854584b2778c 100644 --- a/src/mame/drivers/hvyunit.c +++ b/src/mame/drivers/hvyunit.c @@ -622,7 +622,6 @@ TIMER_DEVICE_CALLBACK_MEMBER(hvyunit_state::hvyunit_scanline) static const kaneko_pandora_interface hvyunit_pandora_config = { - "screen", /* screen tag */ 0, /* gfx_region */ 0, 0 /* x_offs, y_offs */ }; diff --git a/src/mame/drivers/itech8.c b/src/mame/drivers/itech8.c index 8f8b301474f91..5242a7f5ee1f0 100644 --- a/src/mame/drivers/itech8.c +++ b/src/mame/drivers/itech8.c @@ -1661,7 +1661,6 @@ static void generate_interrupt(running_machine &machine, int state_num) static const struct tms34061_interface tms34061intf = { - "screen", /* the screen we are acting on */ 8, /* VRAM address is (row << rowshift) | col */ 0x40000, /* size of video RAM */ generate_interrupt /* interrupt gen callback */ diff --git a/src/mame/drivers/jokrwild.c b/src/mame/drivers/jokrwild.c index 782e3b4c7f933..5afa6febd618c 100644 --- a/src/mame/drivers/jokrwild.c +++ b/src/mame/drivers/jokrwild.c @@ -460,7 +460,6 @@ static const pia6821_interface pia1_intf = static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -501,7 +500,7 @@ static MACHINE_CONFIG_START( jokrwild, jokrwild_state ) MCFG_GFXDECODE(jokrwild) MCFG_PALETTE_LENGTH(512) - MCFG_MC6845_ADD("crtc", MC6845, MASTER_CLOCK/16, mc6845_intf) /* guess */ + MCFG_MC6845_ADD("crtc", MC6845, "screen", MASTER_CLOCK/16, mc6845_intf) /* guess */ MACHINE_CONFIG_END diff --git a/src/mame/drivers/jpmsys5.c b/src/mame/drivers/jpmsys5.c index 271aeddec9da2..d6a475abf6075 100644 --- a/src/mame/drivers/jpmsys5.c +++ b/src/mame/drivers/jpmsys5.c @@ -67,7 +67,6 @@ static void tms_interrupt(running_machine &machine, int state) static const struct tms34061_interface tms34061intf = { - "screen", /* The screen we are acting on */ 8, /* VRAM address is (row << rowshift) | col */ 0x40000, /* Size of video RAM - FIXME: Should be 128kB + 32kB */ tms_interrupt /* Interrupt gen callback */ diff --git a/src/mame/drivers/jubilee.c b/src/mame/drivers/jubilee.c index 9fb0214638d21..c2b50b96dd0b5 100644 --- a/src/mame/drivers/jubilee.c +++ b/src/mame/drivers/jubilee.c @@ -396,7 +396,6 @@ GFXDECODE_END static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -435,7 +434,7 @@ static MACHINE_CONFIG_START( jubileep, jubilee_state ) MCFG_PALETTE_LENGTH(256) - MCFG_MC6845_ADD("crtc", MC6845, MASTER_CLOCK/4, mc6845_intf) /* guess */ + MCFG_MC6845_ADD("crtc", MC6845, "screen", MASTER_CLOCK/4, mc6845_intf) /* guess */ MACHINE_CONFIG_END diff --git a/src/mame/drivers/kingdrby.c b/src/mame/drivers/kingdrby.c index c55bdc2833c83..17004b0cbb283 100644 --- a/src/mame/drivers/kingdrby.c +++ b/src/mame/drivers/kingdrby.c @@ -916,7 +916,6 @@ GFXDECODE_END static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -1047,7 +1046,7 @@ static MACHINE_CONFIG_START( kingdrby, kingdrby_state ) MCFG_SCREEN_UPDATE_DRIVER(kingdrby_state, screen_update_kingdrby) - MCFG_MC6845_ADD("crtc", MC6845, CLK_1/32, mc6845_intf) /* 53.333 Hz. guess */ + MCFG_MC6845_ADD("crtc", MC6845, "screen", CLK_1/32, mc6845_intf) /* 53.333 Hz. guess */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/kingpin.c b/src/mame/drivers/kingpin.c index 502aeb40a198c..963fb965fdf7e 100644 --- a/src/mame/drivers/kingpin.c +++ b/src/mame/drivers/kingpin.c @@ -149,7 +149,6 @@ WRITE_LINE_MEMBER(kingpin_state::vdp_interrupt) static TMS9928A_INTERFACE(kingpin_tms9928a_interface) { - "screen", 0x4000, DEVCB_DRIVER_LINE_MEMBER(kingpin_state, vdp_interrupt) }; diff --git a/src/mame/drivers/konamigx.c b/src/mame/drivers/konamigx.c index 77339beb42be4..3d0e284f585e6 100644 --- a/src/mame/drivers/konamigx.c +++ b/src/mame/drivers/konamigx.c @@ -1796,7 +1796,9 @@ static MACHINE_CONFIG_START( konamigx, konamigx_state ) MCFG_K056832_ADD_NOINTF("k056832"/*, konamigx_k056832_intf*/) MCFG_K055555_ADD("k055555") + MCFG_K055673_ADD_NOINTF("k055673") + MCFG_K055673_SET_SCREEN("screen") MCFG_VIDEO_START_OVERRIDE(konamigx_state,konamigx_5bpp) diff --git a/src/mame/drivers/laserbas.c b/src/mame/drivers/laserbas.c index 9ca630f84a115..ab8b86faebf13 100644 --- a/src/mame/drivers/laserbas.c +++ b/src/mame/drivers/laserbas.c @@ -240,7 +240,6 @@ void laserbas_state::machine_reset() static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -315,7 +314,7 @@ static MACHINE_CONFIG_START( laserbas, laserbas_state ) MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1) MCFG_SCREEN_UPDATE_DRIVER(laserbas_state, screen_update_laserbas) - MCFG_MC6845_ADD("crtc", H46505, 3000000/4, mc6845_intf) /* unknown clock, hand tuned to get ~60 fps */ + MCFG_MC6845_ADD("crtc", H46505, "screen", 3000000/4, mc6845_intf) /* unknown clock, hand tuned to get ~60 fps */ MCFG_PALETTE_LENGTH(32) MACHINE_CONFIG_END diff --git a/src/mame/drivers/luckgrln.c b/src/mame/drivers/luckgrln.c index 869044e1ead4f..be8d8d6b14863 100644 --- a/src/mame/drivers/luckgrln.c +++ b/src/mame/drivers/luckgrln.c @@ -977,7 +977,6 @@ GFXDECODE_END static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -1002,7 +1001,7 @@ static MACHINE_CONFIG_START( luckgrln, luckgrln_state ) MCFG_CPU_IO_MAP(portmap) MCFG_CPU_VBLANK_INT_DRIVER("screen", luckgrln_state, luckgrln_irq) - MCFG_MC6845_ADD("crtc", H46505, 6000000/4, mc6845_intf) /* unknown clock, hand tuned to get ~60 fps */ + MCFG_MC6845_ADD("crtc", H46505, "screen", 6000000/4, mc6845_intf) /* unknown clock, hand tuned to get ~60 fps */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) diff --git a/src/mame/drivers/magicfly.c b/src/mame/drivers/magicfly.c index e78d22041f2e0..3c8c8b8953c05 100644 --- a/src/mame/drivers/magicfly.c +++ b/src/mame/drivers/magicfly.c @@ -921,7 +921,6 @@ GFXDECODE_END static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -960,7 +959,7 @@ static MACHINE_CONFIG_START( magicfly, magicfly_state ) MCFG_PALETTE_LENGTH(32) MCFG_PALETTE_INIT_OVERRIDE(magicfly_state, magicfly) - MCFG_MC6845_ADD("crtc", MC6845, MASTER_CLOCK/16, mc6845_intf) /* guess */ + MCFG_MC6845_ADD("crtc", MC6845, "screen", MASTER_CLOCK/16, mc6845_intf) /* guess */ /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/majorpkr.c b/src/mame/drivers/majorpkr.c index 9b1acac874081..e3e369d183954 100644 --- a/src/mame/drivers/majorpkr.c +++ b/src/mame/drivers/majorpkr.c @@ -1003,7 +1003,6 @@ GFXDECODE_END static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 16, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -1042,7 +1041,7 @@ static MACHINE_CONFIG_START( majorpkr, majorpkr_state ) MCFG_SCREEN_UPDATE_DRIVER(majorpkr_state, screen_update_majorpkr) - MCFG_MC6845_ADD("crtc", MC6845, CRTC_CLOCK, mc6845_intf) /* verified */ + MCFG_MC6845_ADD("crtc", MC6845, "screen", CRTC_CLOCK, mc6845_intf) /* verified */ /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/megatech.c b/src/mame/drivers/megatech.c index 0c3d78fff77d4..2d700719c1c52 100644 --- a/src/mame/drivers/megatech.c +++ b/src/mame/drivers/megatech.c @@ -495,7 +495,6 @@ WRITE_LINE_MEMBER( mtech_state::int_callback ) static const sega315_5124_interface _vdp_intf = { false, - "menu", DEVCB_DRIVER_LINE_MEMBER(mtech_state, int_callback), DEVCB_NULL, }; @@ -535,6 +534,7 @@ static MACHINE_CONFIG_START( megatech, mtech_state ) MCFG_PALETTE_INIT(sega315_5124) MCFG_SEGA315_5246_ADD("vdp1", _vdp_intf) + MCFG_SEGA315_5246_SET_SCREEN("menu") MCFG_SCREEN_MODIFY("megadriv") diff --git a/src/mame/drivers/merit.c b/src/mame/drivers/merit.c index d47c3017bdc14..c122c2543b731 100644 --- a/src/mame/drivers/merit.c +++ b/src/mame/drivers/merit.c @@ -317,7 +317,6 @@ WRITE_LINE_MEMBER(merit_state::vsync_changed) static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ begin_update, /* before pixel update callback */ @@ -1208,7 +1207,7 @@ static MACHINE_CONFIG_START( pitboss, merit_state ) MCFG_SCREEN_RAW_PARAMS(PIXEL_CLOCK, 512, 0, 512, 256, 0, 256) /* temporary, CRTC will configure screen */ MCFG_SCREEN_UPDATE_DEVICE("crtc", mc6845_device, screen_update) - MCFG_MC6845_ADD("crtc", MC6845, CRTC_CLOCK, mc6845_intf) + MCFG_MC6845_ADD("crtc", MC6845, "screen", CRTC_CLOCK, mc6845_intf) /* sound hardware */ diff --git a/src/mame/drivers/miniboy7.c b/src/mame/drivers/miniboy7.c index 61d63209aaba1..c90ca649967e3 100644 --- a/src/mame/drivers/miniboy7.c +++ b/src/mame/drivers/miniboy7.c @@ -395,7 +395,6 @@ GFXDECODE_END static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -471,7 +470,7 @@ static MACHINE_CONFIG_START( miniboy7, miniboy7_state ) MCFG_PALETTE_LENGTH(256) - MCFG_MC6845_ADD("crtc", MC6845, MASTER_CLOCK/12, mc6845_intf) /* guess */ + MCFG_MC6845_ADD("crtc", MC6845, "screen", MASTER_CLOCK/12, mc6845_intf) /* guess */ /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/mirage.c b/src/mame/drivers/mirage.c index f98f3a0768a0e..479820870231f 100644 --- a/src/mame/drivers/mirage.c +++ b/src/mame/drivers/mirage.c @@ -293,7 +293,6 @@ static int mirage_bank_callback( const int bank ) static const deco16ic_interface mirage_deco16ic_tilegen1_intf = { - "screen", 0, 1, 0x0f, 0x0f, /* trans masks (default values) */ 0, 16, /* color base (default values) */ diff --git a/src/mame/drivers/moo.c b/src/mame/drivers/moo.c index a16ded50256ff..3b94074dd1cf9 100644 --- a/src/mame/drivers/moo.c +++ b/src/mame/drivers/moo.c @@ -462,7 +462,6 @@ static const k056832_interface moo_k056832_intf = static const k053247_interface moo_k053247_intf = { - "screen", "gfx2", 1, NORMAL_PLANE_ORDER, -48+1, 23, @@ -472,7 +471,6 @@ static const k053247_interface moo_k053247_intf = static const k053247_interface bucky_k053247_intf = { - "screen", "gfx2", 1, NORMAL_PLANE_ORDER, -48, 23, @@ -482,14 +480,12 @@ static const k053247_interface bucky_k053247_intf = static const k054338_interface moo_k054338_intf = { - "screen", 0, "none" }; static const k053252_interface moo_k053252_intf = { - "screen", DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, diff --git a/src/mame/drivers/mpu12wbk.c b/src/mame/drivers/mpu12wbk.c index b32c0c9c888ed..738a06e69a2c1 100644 --- a/src/mame/drivers/mpu12wbk.c +++ b/src/mame/drivers/mpu12wbk.c @@ -495,7 +495,6 @@ static const ay8910_interface ay8910_config = static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 4, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -533,7 +532,7 @@ static MACHINE_CONFIG_START( mpu12wbk, mpu12wbk_state ) MCFG_GFXDECODE(mpu12wbk) MCFG_PALETTE_LENGTH(512) - MCFG_MC6845_ADD("crtc", MC6845, MASTER_CLOCK/4, mc6845_intf) /* guess */ + MCFG_MC6845_ADD("crtc", MC6845, "screen", MASTER_CLOCK/4, mc6845_intf) /* guess */ /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/mpu4dealem.c b/src/mame/drivers/mpu4dealem.c index b590582fa3100..4bed52c15d48d 100644 --- a/src/mame/drivers/mpu4dealem.c +++ b/src/mame/drivers/mpu4dealem.c @@ -146,7 +146,6 @@ WRITE_LINE_MEMBER(mpu4dealem_state::dealem_vsync_changed) static MC6845_INTERFACE( hd6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -233,7 +232,7 @@ static MACHINE_CONFIG_START( dealem, mpu4dealem_state ) MCFG_PALETTE_LENGTH(32) MCFG_PALETTE_INIT_OVERRIDE(mpu4dealem_state,dealem) - MCFG_MC6845_ADD("crtc", HD6845, MPU4_MASTER_CLOCK / 4 / 8, hd6845_intf) /* HD68B45 */ + MCFG_MC6845_ADD("crtc", HD6845, "screen", MPU4_MASTER_CLOCK / 4 / 8, hd6845_intf) /* HD68B45 */ MACHINE_CONFIG_END diff --git a/src/mame/drivers/multigam.c b/src/mame/drivers/multigam.c index d3de01d7485df..14f9d48069f93 100644 --- a/src/mame/drivers/multigam.c +++ b/src/mame/drivers/multigam.c @@ -1106,7 +1106,6 @@ void multigam_state::ppu_irq(int *ppu_regs) static const ppu2c0x_interface ppu_interface = { "maincpu", - "screen", 0, /* gfxlayout num */ 0, /* color base */ PPU_MIRROR_NONE /* mirroring */ diff --git a/src/mame/drivers/murogem.c b/src/mame/drivers/murogem.c index 6c581f4647e82..772db62e35f8a 100644 --- a/src/mame/drivers/murogem.c +++ b/src/mame/drivers/murogem.c @@ -234,7 +234,6 @@ UINT32 murogem_state::screen_update_murogem(screen_device &screen, bitmap_ind16 static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -266,7 +265,7 @@ static MACHINE_CONFIG_START( murogem, murogem_state ) MCFG_PALETTE_LENGTH(0x100) - MCFG_MC6845_ADD("crtc", MC6845, 750000, mc6845_intf) /* ? MHz */ + MCFG_MC6845_ADD("crtc", MC6845, "screen", 750000, mc6845_intf) /* ? MHz */ /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/mystwarr.c b/src/mame/drivers/mystwarr.c index f10adfba8cdbf..d5bc20afb8e4d 100644 --- a/src/mame/drivers/mystwarr.c +++ b/src/mame/drivers/mystwarr.c @@ -909,7 +909,6 @@ MACHINE_RESET_MEMBER(mystwarr_state,gaiapols) static const k053252_interface mystwarr_k053252_intf = { - "screen", DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, @@ -919,7 +918,6 @@ static const k053252_interface mystwarr_k053252_intf = static const k053252_interface viostorm_k053252_intf = { - "screen", DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, @@ -929,7 +927,6 @@ static const k053252_interface viostorm_k053252_intf = static const k053252_interface metamrph_k053252_intf = { - "screen", DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, @@ -939,7 +936,6 @@ static const k053252_interface metamrph_k053252_intf = static const k053252_interface martchmp_k053252_intf = { - "screen", DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, @@ -949,7 +945,6 @@ static const k053252_interface martchmp_k053252_intf = static const k053252_interface dadandrm_k053252_intf = { - "screen", DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, @@ -959,7 +954,6 @@ static const k053252_interface dadandrm_k053252_intf = static const k053252_interface gaiapols_k053252_intf = { - "screen", DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, diff --git a/src/mame/drivers/ninjaw.c b/src/mame/drivers/ninjaw.c index 93550a9f8de54..596b72c93e8fc 100644 --- a/src/mame/drivers/ninjaw.c +++ b/src/mame/drivers/ninjaw.c @@ -735,7 +735,6 @@ Darius2: arbitrary interleaving of 10 to keep cpus synced. static const tc0100scn_interface darius2_tc0100scn_intf_l = { - "lscreen", 1, 3, /* gfxnum, txnum */ 22, 0, /* x_offset, y_offset */ 0, 0, /* flip_xoff, flip_yoff */ @@ -745,7 +744,6 @@ static const tc0100scn_interface darius2_tc0100scn_intf_l = static const tc0100scn_interface darius2_tc0100scn_intf_m = { - "mscreen", 2, 3, /* gfxnum, txnum */ 22, 0, /* x_offset, y_offset */ 0, 0, /* flip_xoff, flip_yoff */ @@ -755,7 +753,6 @@ static const tc0100scn_interface darius2_tc0100scn_intf_m = static const tc0100scn_interface darius2_tc0100scn_intf_r = { - "rscreen", 2, 3, /* gfxnum, txnum */ 22, 0, /* x_offset, y_offset */ 0, 0, /* flip_xoff, flip_yoff */ @@ -852,8 +849,11 @@ static MACHINE_CONFIG_START( ninjaw, ninjaw_state ) MCFG_TC0100SCN_ADD("tc0100scn_1", darius2_tc0100scn_intf_l) + MCFG_TC0100SCN_SET_SCREEN("lscreen") MCFG_TC0100SCN_ADD("tc0100scn_2", darius2_tc0100scn_intf_m) + MCFG_TC0100SCN_SET_SCREEN("mscreen") MCFG_TC0100SCN_ADD("tc0100scn_3", darius2_tc0100scn_intf_r) + MCFG_TC0100SCN_SET_SCREEN("rscreen") MCFG_TC0110PCR_ADD("tc0110pcr_1", darius2_tc0110pcr_intf_l) MCFG_TC0110PCR_ADD("tc0110pcr_2", darius2_tc0110pcr_intf_m) MCFG_TC0110PCR_ADD("tc0110pcr_3", darius2_tc0110pcr_intf_r) @@ -932,8 +932,11 @@ static MACHINE_CONFIG_START( darius2, ninjaw_state ) MCFG_TC0100SCN_ADD("tc0100scn_1", darius2_tc0100scn_intf_l) + MCFG_TC0100SCN_SET_SCREEN("lscreen") MCFG_TC0100SCN_ADD("tc0100scn_2", darius2_tc0100scn_intf_m) + MCFG_TC0100SCN_SET_SCREEN("mscreen") MCFG_TC0100SCN_ADD("tc0100scn_3", darius2_tc0100scn_intf_r) + MCFG_TC0100SCN_SET_SCREEN("rscreen") MCFG_TC0110PCR_ADD("tc0110pcr_1", darius2_tc0110pcr_intf_l) MCFG_TC0110PCR_ADD("tc0110pcr_2", darius2_tc0110pcr_intf_m) MCFG_TC0110PCR_ADD("tc0110pcr_3", darius2_tc0110pcr_intf_r) diff --git a/src/mame/drivers/nss.c b/src/mame/drivers/nss.c index 5bdddd4d4e358..499db0d5d1bfe 100644 --- a/src/mame/drivers/nss.c +++ b/src/mame/drivers/nss.c @@ -800,11 +800,6 @@ void nss_state::machine_reset() m_joy_flag = 1; } -static M50458_INTERFACE( m50458_intf ) -{ - "osd" -}; - static MACHINE_CONFIG_START( nss, nss_state ) /* base snes hardware */ @@ -822,7 +817,7 @@ static MACHINE_CONFIG_START( nss, nss_state ) MCFG_CPU_IO_MAP(bios_io_map) MCFG_CPU_VBLANK_INT_DRIVER("screen", nss_state, nss_vblank_irq) - MCFG_M50458_ADD("m50458",m50458_intf,4000000) /* TODO: correct clock */ + MCFG_M50458_ADD("m50458", 4000000, "osd") /* TODO: correct clock */ MCFG_S3520CF_ADD("s3520cf") /* RTC */ MCFG_RP5H01_ADD("rp5h01") MCFG_M6M80011AP_ADD("m6m80011ap") diff --git a/src/mame/drivers/nyny.c b/src/mame/drivers/nyny.c index ae7954cd2ab43..63d135425a1e0 100644 --- a/src/mame/drivers/nyny.c +++ b/src/mame/drivers/nyny.c @@ -427,7 +427,6 @@ WRITE_LINE_MEMBER(nyny_state::display_enable_changed) static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ begin_update, /* before pixel update callback */ @@ -721,7 +720,7 @@ static MACHINE_CONFIG_START( nyny, nyny_state ) MCFG_SCREEN_RAW_PARAMS(PIXEL_CLOCK, 256, 0, 256, 256, 0, 256) /* temporary, CRTC will configure screen */ MCFG_SCREEN_UPDATE_DEVICE("crtc", mc6845_device, screen_update) - MCFG_MC6845_ADD("crtc", MC6845, CRTC_CLOCK, mc6845_intf) + MCFG_MC6845_ADD("crtc", MC6845, "screen", CRTC_CLOCK, mc6845_intf) /* 74LS123 */ MCFG_TTL74123_ADD("ic48_1", ic48_1_config) diff --git a/src/mame/drivers/othello.c b/src/mame/drivers/othello.c index 4e903291c658b..17ef1e1643422 100644 --- a/src/mame/drivers/othello.c +++ b/src/mame/drivers/othello.c @@ -371,7 +371,6 @@ INPUT_PORTS_END static MC6845_INTERFACE( h46505_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ TILE_WIDTH, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -436,7 +435,7 @@ static MACHINE_CONFIG_START( othello, othello_state ) MCFG_PALETTE_LENGTH(0x10) - MCFG_MC6845_ADD("crtc", H46505, 1000000 /* ? MHz */, h46505_intf) /* H46505 @ CPU clock */ + MCFG_MC6845_ADD("crtc", H46505, "screen", 1000000 /* ? MHz */, h46505_intf) /* H46505 @ CPU clock */ /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/othunder.c b/src/mame/drivers/othunder.c index f311091e49894..77e9dd62fcfb4 100644 --- a/src/mame/drivers/othunder.c +++ b/src/mame/drivers/othunder.c @@ -636,7 +636,6 @@ WRITE_LINE_MEMBER(othunder_state::irqhandler) static const tc0100scn_interface othunder_tc0100scn_intf = { - "screen", 1, 2, /* gfxnum, txnum */ 4, 0, /* x_offset, y_offset */ 0, 0, /* flip_xoff, flip_yoff */ diff --git a/src/mame/drivers/overdriv.c b/src/mame/drivers/overdriv.c index d31f38360d7cd..ffb10daa2693b 100644 --- a/src/mame/drivers/overdriv.c +++ b/src/mame/drivers/overdriv.c @@ -278,7 +278,6 @@ static const k053260_interface k053260_config = static const k053247_interface overdriv_k053246_intf = { - "screen", "gfx1", 0, NORMAL_PLANE_ORDER, 77, 22, @@ -326,7 +325,6 @@ void overdriv_state::machine_reset() static const k053252_interface overdriv_k053252_intf = { - "screen", DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, diff --git a/src/mame/drivers/pachifev.c b/src/mame/drivers/pachifev.c index 044c7771f4a84..5ade3dffe376d 100644 --- a/src/mame/drivers/pachifev.c +++ b/src/mame/drivers/pachifev.c @@ -348,7 +348,6 @@ INTERRUPT_GEN_MEMBER(pachifev_state::pachifev_vblank_irq) static TMS9928A_INTERFACE(pachifev_tms9928a_interface) { - "screen", 0x4000, DEVCB_NULL }; diff --git a/src/mame/drivers/pengadvb.c b/src/mame/drivers/pengadvb.c index 8506875c3fa02..752215e1d87e4 100644 --- a/src/mame/drivers/pengadvb.c +++ b/src/mame/drivers/pengadvb.c @@ -243,7 +243,6 @@ WRITE_LINE_MEMBER(pengadvb_state::vdp_interrupt) static TMS9928A_INTERFACE(pengadvb_tms9928a_interface) { - "screen", 0x4000, DEVCB_DRIVER_LINE_MEMBER(pengadvb_state,vdp_interrupt) }; diff --git a/src/mame/drivers/peplus.c b/src/mame/drivers/peplus.c index 03c44ffae6463..242078a1b2627 100644 --- a/src/mame/drivers/peplus.c +++ b/src/mame/drivers/peplus.c @@ -304,7 +304,6 @@ static MC6845_ON_UPDATE_ADDR_CHANGED(crtc_addr); static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -1378,7 +1377,7 @@ static MACHINE_CONFIG_START( peplus, peplus_state ) MCFG_GFXDECODE(peplus) MCFG_PALETTE_LENGTH(16*16*2) - MCFG_MC6845_ADD("crtc", R6545_1, MC6845_CLOCK, mc6845_intf) + MCFG_MC6845_ADD("crtc", R6545_1, "screen", MC6845_CLOCK, mc6845_intf) MCFG_I2CMEM_ADD("i2cmem", i2cmem_interface) diff --git a/src/mame/drivers/pktgaldx.c b/src/mame/drivers/pktgaldx.c index 25d3747b44ca1..be6a0750fb61c 100644 --- a/src/mame/drivers/pktgaldx.c +++ b/src/mame/drivers/pktgaldx.c @@ -290,14 +290,8 @@ static int pktgaldx_bank_callback( const int bank ) return ((bank >> 4) & 0x7) * 0x1000; } -static const decocomn_interface pktgaldx_decocomn_intf = -{ - "screen", -}; - static const deco16ic_interface pktgaldx_deco16ic_tilegen1_intf = { - "screen", 0, 1, 0x0f, 0x0f, /* trans masks (default values) */ 0, 16, /* color base (default values) */ @@ -332,7 +326,7 @@ static MACHINE_CONFIG_START( pktgaldx, pktgaldx_state ) MCFG_PALETTE_LENGTH(4096) MCFG_GFXDECODE(pktgaldx) - MCFG_DECOCOMN_ADD("deco_common", pktgaldx_decocomn_intf) + MCFG_DECOCOMN_ADD("deco_common") MCFG_DECO16IC_ADD("tilegen1", pktgaldx_deco16ic_tilegen1_intf) diff --git a/src/mame/drivers/playch10.c b/src/mame/drivers/playch10.c index bc8f9baca40bb..92cf554fa0d26 100644 --- a/src/mame/drivers/playch10.c +++ b/src/mame/drivers/playch10.c @@ -702,6 +702,7 @@ static MACHINE_CONFIG_START( playch10, playch10_state ) MCFG_PPU2C03B_ADD("ppu", playch10_ppu_interface) + MCFG_PPU2C0X_SET_SCREEN("bottom") MCFG_PPU2C0X_SET_NMI(playch10_state, ppu_irq) // sound hardware diff --git a/src/mame/drivers/progolf.c b/src/mame/drivers/progolf.c index 5c4cbff5adcba..2788b879205a8 100644 --- a/src/mame/drivers/progolf.c +++ b/src/mame/drivers/progolf.c @@ -374,7 +374,6 @@ GFXDECODE_END static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -438,7 +437,7 @@ static MACHINE_CONFIG_START( progolf, progolf_state ) MCFG_GFXDECODE(progolf) MCFG_PALETTE_LENGTH(32*3) - MCFG_MC6845_ADD("crtc", MC6845, 3000000/4, mc6845_intf) /* hand tuned to get ~57 fps */ + MCFG_MC6845_ADD("crtc", MC6845, "screen", 3000000/4, mc6845_intf) /* hand tuned to get ~57 fps */ /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/qdrmfgp.c b/src/mame/drivers/qdrmfgp.c index 2438061e1066f..1b6be6be88961 100644 --- a/src/mame/drivers/qdrmfgp.c +++ b/src/mame/drivers/qdrmfgp.c @@ -555,7 +555,6 @@ WRITE_LINE_MEMBER(qdrmfgp_state::qdrmfgp_irq4_ack_w) static const k053252_interface qdrmfgp_k053252_intf = { - "screen", DEVCB_NULL, DEVCB_NULL, DEVCB_DRIVER_LINE_MEMBER(qdrmfgp_state,qdrmfgp_irq3_ack_w), @@ -565,7 +564,6 @@ static const k053252_interface qdrmfgp_k053252_intf = static const k053252_interface qdrmfgp2_k053252_intf = { - "screen", DEVCB_NULL, DEVCB_NULL, DEVCB_DRIVER_LINE_MEMBER(qdrmfgp_state,qdrmfgp_irq4_ack_w), diff --git a/src/mame/drivers/r2dtank.c b/src/mame/drivers/r2dtank.c index 7b5701e90fad1..1f877aaf85f0d 100644 --- a/src/mame/drivers/r2dtank.c +++ b/src/mame/drivers/r2dtank.c @@ -398,7 +398,6 @@ WRITE_LINE_MEMBER(r2dtank_state::display_enable_changed) static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ begin_update, /* before pixel update callback */ @@ -552,7 +551,7 @@ static MACHINE_CONFIG_START( r2dtank, r2dtank_state ) MCFG_SCREEN_RAW_PARAMS(PIXEL_CLOCK, 256, 0, 256, 256, 0, 256) /* temporary, CRTC will configure screen */ MCFG_SCREEN_UPDATE_DEVICE("crtc", mc6845_device, screen_update) - MCFG_MC6845_ADD("crtc", MC6845, CRTC_CLOCK, mc6845_intf) + MCFG_MC6845_ADD("crtc", MC6845, "screen", CRTC_CLOCK, mc6845_intf) /* 74LS123 */ diff --git a/src/mame/drivers/raiden.c b/src/mame/drivers/raiden.c index c84acadb7ff6d..8f36abb710706 100644 --- a/src/mame/drivers/raiden.c +++ b/src/mame/drivers/raiden.c @@ -318,7 +318,6 @@ WRITE16_MEMBER( raiden_state::raidenb_layer_scroll_w ) SEIBU_CRTC_INTERFACE(crtc_intf) { - "screen", DEVCB_DRIVER_MEMBER16(raiden_state, raidenb_layer_enable_w), DEVCB_DRIVER_MEMBER16(raiden_state, raidenb_layer_scroll_w), }; diff --git a/src/mame/drivers/raiden2.c b/src/mame/drivers/raiden2.c index 05acd847c6e72..f05a7585987e7 100644 --- a/src/mame/drivers/raiden2.c +++ b/src/mame/drivers/raiden2.c @@ -1863,7 +1863,6 @@ GFXDECODE_END SEIBU_CRTC_INTERFACE(crtc_intf) { - "screen", DEVCB_DRIVER_MEMBER16(raiden2_state, tilemap_enable_w), DEVCB_DRIVER_MEMBER16(raiden2_state, tile_scroll_w), }; diff --git a/src/mame/drivers/re900.c b/src/mame/drivers/re900.c index e1fe638f894eb..eb89171420f77 100644 --- a/src/mame/drivers/re900.c +++ b/src/mame/drivers/re900.c @@ -373,7 +373,6 @@ INPUT_PORTS_END static TMS9928A_INTERFACE(re900_tms9928a_interface) { - "screen", 0x4000, DEVCB_DRIVER_LINE_MEMBER(re900_state,vdp_interrupt) }; diff --git a/src/mame/drivers/rgum.c b/src/mame/drivers/rgum.c index 0ea36a4d28a1f..16cc18afa9ec3 100644 --- a/src/mame/drivers/rgum.c +++ b/src/mame/drivers/rgum.c @@ -232,7 +232,6 @@ GFXDECODE_END static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -280,7 +279,7 @@ static MACHINE_CONFIG_START( rgum, rgum_state ) MCFG_SCREEN_VISIBLE_AREA(0, 256-1, 0, 256-1) MCFG_SCREEN_UPDATE_DRIVER(rgum_state, screen_update_royalgum) - MCFG_MC6845_ADD("crtc", MC6845, 24000000/16, mc6845_intf) /* unknown clock & type, hand tuned to get ~50 fps (?) */ + MCFG_MC6845_ADD("crtc", MC6845, "screen", 24000000/16, mc6845_intf) /* unknown clock & type, hand tuned to get ~50 fps (?) */ MCFG_I8255A_ADD( "ppi8255", ppi8255_intf ) diff --git a/src/mame/drivers/rltennis.c b/src/mame/drivers/rltennis.c index 98107751fbff6..a8a3f57241409 100644 --- a/src/mame/drivers/rltennis.c +++ b/src/mame/drivers/rltennis.c @@ -153,7 +153,6 @@ INTERRUPT_GEN_MEMBER(rltennis_state::rltennis_interrupt) void rltennis_state::machine_start() { - m_screen = machine().device( "screen"); m_samples_1 = memregion("samples1")->base(); m_samples_2 = memregion("samples2")->base(); m_gfx = memregion("gfx1")->base(); diff --git a/src/mame/drivers/rohga.c b/src/mame/drivers/rohga.c index 11fb9eb24ebaa..22b078995165c 100644 --- a/src/mame/drivers/rohga.c +++ b/src/mame/drivers/rohga.c @@ -763,11 +763,6 @@ WRITE8_MEMBER(rohga_state::sound_bankswitch_w) /**********************************************************************************/ -static const decocomn_interface rohga_decocomn_intf = -{ - "screen", -}; - static int rohga_bank_callback( const int bank ) { return ((bank >> 4) & 0x3) << 12; @@ -775,7 +770,6 @@ static int rohga_bank_callback( const int bank ) static const deco16ic_interface rohga_deco16ic_tilegen1_intf = { - "screen", 0, 1, 0x0f, 0x0f, /* trans masks (default values) */ 0, 16,/* color base (default values) */ @@ -787,7 +781,6 @@ static const deco16ic_interface rohga_deco16ic_tilegen1_intf = static const deco16ic_interface rohga_deco16ic_tilegen2_intf = { - "screen", 0, 1, 0x0f, 0x0f, /* trans masks (default values) */ 0, 16, /* color base (default values) */ @@ -799,7 +792,6 @@ static const deco16ic_interface rohga_deco16ic_tilegen2_intf = static const deco16ic_interface nitrobal_deco16ic_tilegen1_intf = { - "screen", 0, 0, 0x0f, 0x0f, /* trans masks (default values) */ 0, 16, /* color base (pf4 is not default) */ @@ -811,7 +803,6 @@ static const deco16ic_interface nitrobal_deco16ic_tilegen1_intf = static const deco16ic_interface nitrobal_deco16ic_tilegen2_intf = { - "screen", 0, 0, 0x0f, 0x0f, /* trans masks (default values) */ 0, 0, /* color base (pf4 is not default) */ @@ -846,7 +837,7 @@ static MACHINE_CONFIG_START( rohga, rohga_state ) MCFG_VIDEO_START_OVERRIDE(rohga_state,rohga) - MCFG_DECOCOMN_ADD("deco_common", rohga_decocomn_intf) + MCFG_DECOCOMN_ADD("deco_common") MCFG_DECO16IC_ADD("tilegen1", rohga_deco16ic_tilegen1_intf) MCFG_DECO16IC_ADD("tilegen2", rohga_deco16ic_tilegen2_intf) @@ -898,7 +889,7 @@ static MACHINE_CONFIG_START( wizdfire, rohga_state ) MCFG_GFXDECODE(wizdfire) MCFG_PALETTE_LENGTH(2048) - MCFG_DECOCOMN_ADD("deco_common", rohga_decocomn_intf) + MCFG_DECOCOMN_ADD("deco_common") MCFG_DECO16IC_ADD("tilegen1", rohga_deco16ic_tilegen1_intf) MCFG_DECO16IC_ADD("tilegen2", rohga_deco16ic_tilegen2_intf) @@ -956,7 +947,7 @@ static MACHINE_CONFIG_START( nitrobal, rohga_state ) MCFG_GFXDECODE(wizdfire) MCFG_PALETTE_LENGTH(2048) - MCFG_DECOCOMN_ADD("deco_common", rohga_decocomn_intf) + MCFG_DECOCOMN_ADD("deco_common") MCFG_DECO16IC_ADD("tilegen1", nitrobal_deco16ic_tilegen1_intf) MCFG_DECO16IC_ADD("tilegen2", nitrobal_deco16ic_tilegen2_intf) @@ -1017,7 +1008,7 @@ static MACHINE_CONFIG_START( schmeisr, rohga_state ) MCFG_VIDEO_START_OVERRIDE(rohga_state,schmeisr) - MCFG_DECOCOMN_ADD("deco_common", rohga_decocomn_intf) + MCFG_DECOCOMN_ADD("deco_common") MCFG_DECO16IC_ADD("tilegen1", rohga_deco16ic_tilegen1_intf) MCFG_DECO16IC_ADD("tilegen2", rohga_deco16ic_tilegen2_intf) diff --git a/src/mame/drivers/rollerg.c b/src/mame/drivers/rollerg.c index dae9fa5a94a33..b74b43e02c8c5 100644 --- a/src/mame/drivers/rollerg.c +++ b/src/mame/drivers/rollerg.c @@ -241,7 +241,6 @@ WRITE_LINE_MEMBER(rollerg_state::rollerg_irq_ack_w) static const k053252_interface rollerg_k053252_intf = { - "screen", DEVCB_NULL, DEVCB_NULL, DEVCB_DRIVER_LINE_MEMBER(rollerg_state,rollerg_irq_ack_w), diff --git a/src/mame/drivers/rungun.c b/src/mame/drivers/rungun.c index d3f589e8b8d9c..92246635a0a27 100644 --- a/src/mame/drivers/rungun.c +++ b/src/mame/drivers/rungun.c @@ -336,7 +336,6 @@ static const k053936_interface rng_k053936_intf = static const k053247_interface rng_k055673_intf = { - "screen", "gfx2", 1, K055673_LAYOUT_RNG, -8, 15, @@ -346,7 +345,6 @@ static const k053247_interface rng_k055673_intf = static const k053252_interface rng_k053252_intf = { - "screen", DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, diff --git a/src/mame/drivers/sandscrp.c b/src/mame/drivers/sandscrp.c index 0a735e5013267..762934b519443 100644 --- a/src/mame/drivers/sandscrp.c +++ b/src/mame/drivers/sandscrp.c @@ -482,7 +482,6 @@ static const ay8910_interface ay8910_config = static const kaneko_pandora_interface sandscrp_pandora_config = { - "screen", /* screen tag */ 0, /* gfx_region */ 0, 0 /* x_offs, y_offs */ }; diff --git a/src/mame/drivers/sanremo.c b/src/mame/drivers/sanremo.c index 10b30f72482c2..b10b26ffa92bd 100644 --- a/src/mame/drivers/sanremo.c +++ b/src/mame/drivers/sanremo.c @@ -345,7 +345,6 @@ static const mc6845_interface mc6845_intf = */ { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -396,7 +395,7 @@ static MACHINE_CONFIG_START( sanremo, sanremo_state ) MCFG_SCREEN_VISIBLE_AREA(0, 48*8-1, 0, 38*8-1) MCFG_SCREEN_UPDATE_DRIVER(sanremo_state, screen_update_sanremo) - MCFG_MC6845_ADD("crtc", MC6845, CRTC_CLOCK, mc6845_intf) + MCFG_MC6845_ADD("crtc", MC6845, "screen", CRTC_CLOCK, mc6845_intf) MCFG_GFXDECODE(sanremo) MCFG_PALETTE_LENGTH(0x10) diff --git a/src/mame/drivers/segac2.c b/src/mame/drivers/segac2.c index 4c8051f39ca23..48bb6988f7164 100644 --- a/src/mame/drivers/segac2.c +++ b/src/mame/drivers/segac2.c @@ -1335,7 +1335,6 @@ void genesis_vdp_lv4irqline_callback_segac2(running_machine &machine, bool state static const sega315_5124_interface sms_vdp_ntsc_intf = { false, - "megadriv", DEVCB_NULL, DEVCB_NULL, }; @@ -1358,6 +1357,7 @@ static MACHINE_CONFIG_START( segac, segac2_state ) // MCFG_FRAGMENT_ADD(megadriv_timers) MCFG_DEVICE_ADD("gen_vdp", SEGA_GEN_VDP, 0) + MCFG_VIDEO_SET_SCREEN("megadriv") MCFG_DEVICE_CONFIG( sms_vdp_ntsc_intf ) sega_genesis_vdp_device::set_genesis_vdp_sndirqline_callback(*device, genesis_vdp_sndirqline_callback_segac2); sega_genesis_vdp_device::set_genesis_vdp_lv6irqline_callback(*device, genesis_vdp_lv6irqline_callback_segac2); diff --git a/src/mame/drivers/segae.c b/src/mame/drivers/segae.c index 79be947383c29..e7bf0b243e80a 100644 --- a/src/mame/drivers/segae.c +++ b/src/mame/drivers/segae.c @@ -1060,7 +1060,6 @@ WRITE_LINE_MEMBER( systeme_state::int_callback ) static const sega315_5124_interface _315_5124_1_intf = { false, - "screen", DEVCB_NULL, DEVCB_NULL, }; @@ -1069,7 +1068,6 @@ static const sega315_5124_interface _315_5124_1_intf = static const sega315_5124_interface _315_5124_2_intf = { false, - "screen", DEVCB_DRIVER_LINE_MEMBER(systeme_state, int_callback), DEVCB_NULL, }; diff --git a/src/mame/drivers/segas18.c b/src/mame/drivers/segas18.c index 1682138abffe5..036a2f6512830 100644 --- a/src/mame/drivers/segas18.c +++ b/src/mame/drivers/segas18.c @@ -1237,7 +1237,6 @@ void genesis_vdp_lv4irqline_callback_segas18(running_machine &machine, bool stat static const sega315_5124_interface sms_vdp_ntsc_intf = { false, - "screen", DEVCB_NULL, DEVCB_NULL, }; diff --git a/src/mame/drivers/sengokmj.c b/src/mame/drivers/sengokmj.c index ca416fa730cc6..e6ed614a083c3 100644 --- a/src/mame/drivers/sengokmj.c +++ b/src/mame/drivers/sengokmj.c @@ -557,7 +557,6 @@ WRITE16_MEMBER( sengokmj_state::layer_scroll_w ) SEIBU_CRTC_INTERFACE(crtc_intf) { - "screen", DEVCB_DRIVER_MEMBER16(sengokmj_state, layer_en_w), DEVCB_DRIVER_MEMBER16(sengokmj_state, layer_scroll_w), }; diff --git a/src/mame/drivers/sg1000a.c b/src/mame/drivers/sg1000a.c index 33e8dcf48feda..ccf8fbdd5c850 100644 --- a/src/mame/drivers/sg1000a.c +++ b/src/mame/drivers/sg1000a.c @@ -247,7 +247,6 @@ WRITE_LINE_MEMBER(sg1000a_state::vdp_interrupt) static TMS9928A_INTERFACE(sg1000a_tms9928a_interface) { - "screen", 0x4000, DEVCB_DRIVER_LINE_MEMBER(sg1000a_state,vdp_interrupt) }; diff --git a/src/mame/drivers/simpl156.c b/src/mame/drivers/simpl156.c index 54ac8c1742a7f..91157f552ba78 100644 --- a/src/mame/drivers/simpl156.c +++ b/src/mame/drivers/simpl156.c @@ -394,7 +394,6 @@ static int simpl156_bank_callback(const int bank) static const deco16ic_interface simpl156_deco16ic_tilegen1_intf = { - "screen", 0, 1, 0x0f, 0x0f, /* trans masks (default values) */ 0, 16,/* color base (default values) */ diff --git a/src/mame/drivers/simpsons.c b/src/mame/drivers/simpsons.c index 6ef1d53ddd735..8d5bbb4d9b8d6 100644 --- a/src/mame/drivers/simpsons.c +++ b/src/mame/drivers/simpsons.c @@ -284,7 +284,6 @@ static const k052109_interface simpsons_k052109_intf = static const k053247_interface simpsons_k053246_intf = { - "screen", "gfx2", 1, NORMAL_PLANE_ORDER, 53, 23, diff --git a/src/mame/drivers/slotcarn.c b/src/mame/drivers/slotcarn.c index b72eded3444d0..3a626fc24d47c 100644 --- a/src/mame/drivers/slotcarn.c +++ b/src/mame/drivers/slotcarn.c @@ -170,7 +170,6 @@ WRITE_LINE_MEMBER(slotcarn_state::vsync_changed) static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ begin_update, /* before pixel update callback */ @@ -623,7 +622,7 @@ static MACHINE_CONFIG_START( slotcarn, slotcarn_state ) MCFG_SCREEN_RAW_PARAMS(PIXEL_CLOCK, 512, 0, 512, 256, 0, 256) /* temporary, CRTC will configure screen */ MCFG_SCREEN_UPDATE_DEVICE("crtc", mc6845_device, screen_update) - MCFG_MC6845_ADD("crtc", MC6845, CRTC_CLOCK, mc6845_intf) + MCFG_MC6845_ADD("crtc", MC6845, "screen", CRTC_CLOCK, mc6845_intf) MCFG_GFXDECODE(slotcarn) MCFG_PALETTE_LENGTH(0x400) diff --git a/src/mame/drivers/snk6502.c b/src/mame/drivers/snk6502.c index 14bb709e0d870..38084948e00fe 100644 --- a/src/mame/drivers/snk6502.c +++ b/src/mame/drivers/snk6502.c @@ -755,7 +755,6 @@ INTERRUPT_GEN_MEMBER(snk6502_state::snk6502_interrupt) static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -837,7 +836,7 @@ static MACHINE_CONFIG_START( sasuke, snk6502_state ) MCFG_PALETTE_INIT_OVERRIDE(snk6502_state,satansat) MCFG_VIDEO_START_OVERRIDE(snk6502_state,satansat) - MCFG_MC6845_ADD("crtc", MC6845, MASTER_CLOCK / 16, mc6845_intf) + MCFG_MC6845_ADD("crtc", MC6845, "screen", MASTER_CLOCK / 16, mc6845_intf) MCFG_TIMER_DRIVER_ADD_PERIODIC("sasuke_timer", snk6502_state, sasuke_update_counter, attotime::from_hz(MASTER_CLOCK / 8)) @@ -910,7 +909,7 @@ static MACHINE_CONFIG_START( vanguard, snk6502_state ) MCFG_PALETTE_INIT_OVERRIDE(snk6502_state,snk6502) MCFG_VIDEO_START_OVERRIDE(snk6502_state,snk6502) - MCFG_MC6845_ADD("crtc", MC6845, MASTER_CLOCK / 16, mc6845_intf) + MCFG_MC6845_ADD("crtc", MC6845, "screen", MASTER_CLOCK / 16, mc6845_intf) // sound hardware MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/snowbros.c b/src/mame/drivers/snowbros.c index 1bd9446457647..a1e85de4b23a3 100644 --- a/src/mame/drivers/snowbros.c +++ b/src/mame/drivers/snowbros.c @@ -1512,7 +1512,6 @@ MACHINE_RESET_MEMBER(snowbros_state,finalttr) static const kaneko_pandora_interface snowbros_pandora_config = { - "screen", /* screen tag */ 0, /* gfx_region */ 0, 0 /* x_offs, y_offs */ }; diff --git a/src/mame/drivers/speedatk.c b/src/mame/drivers/speedatk.c index 075c0649bcfa0..857fa4bd11f32 100644 --- a/src/mame/drivers/speedatk.c +++ b/src/mame/drivers/speedatk.c @@ -285,7 +285,6 @@ GFXDECODE_END static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -333,7 +332,7 @@ static MACHINE_CONFIG_START( speedatk, speedatk_state ) MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1) MCFG_SCREEN_UPDATE_DRIVER(speedatk_state, screen_update_speedatk) - MCFG_MC6845_ADD("crtc", H46505, MASTER_CLOCK/16, mc6845_intf) /* hand tuned to get ~60 fps */ + MCFG_MC6845_ADD("crtc", H46505, "screen", MASTER_CLOCK/16, mc6845_intf) /* hand tuned to get ~60 fps */ MCFG_GFXDECODE(speedatk) MCFG_PALETTE_LENGTH(0x100) diff --git a/src/mame/drivers/spiders.c b/src/mame/drivers/spiders.c index 65d207674b45c..5ed67c7a017f1 100644 --- a/src/mame/drivers/spiders.c +++ b/src/mame/drivers/spiders.c @@ -507,7 +507,6 @@ WRITE_LINE_MEMBER(spiders_state::display_enable_changed) static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ begin_update, /* before pixel update callback */ @@ -706,7 +705,7 @@ static MACHINE_CONFIG_START( spiders, spiders_state ) MCFG_SCREEN_RAW_PARAMS(PIXEL_CLOCK, 256, 0, 256, 256, 0, 256) /* temporary, CRTC will configure screen */ MCFG_SCREEN_UPDATE_DEVICE("crtc", mc6845_device, screen_update) - MCFG_MC6845_ADD("crtc", MC6845, CRTC_CLOCK, mc6845_intf) + MCFG_MC6845_ADD("crtc", MC6845, "screen", CRTC_CLOCK, mc6845_intf) /* 74LS123 */ diff --git a/src/mame/drivers/sshangha.c b/src/mame/drivers/sshangha.c index d10269571d60c..c8257642994c0 100644 --- a/src/mame/drivers/sshangha.c +++ b/src/mame/drivers/sshangha.c @@ -387,7 +387,6 @@ static int sshangha_bank_callback( int bank ) static const deco16ic_interface sshangha_deco16ic_tilegen1_intf = { - "screen", 0, 1, 0x0f, 0x0f, /* trans masks (default values) */ 0x10, 0x00, /* color base */ diff --git a/src/mame/drivers/ssingles.c b/src/mame/drivers/ssingles.c index 9e2870189e0e6..8e6aab8d7031d 100644 --- a/src/mame/drivers/ssingles.c +++ b/src/mame/drivers/ssingles.c @@ -270,7 +270,6 @@ static MC6845_UPDATE_ROW( atamanot_update_row ) static MC6845_INTERFACE( ssingles_mc6845_intf ) { - "screen", false, 8, NULL, /* before pixel update callback */ @@ -285,7 +284,6 @@ static MC6845_INTERFACE( ssingles_mc6845_intf ) static MC6845_INTERFACE( atamanot_mc6845_intf ) { - "screen", false, 8, NULL, /* before pixel update callback */ @@ -580,7 +578,7 @@ static MACHINE_CONFIG_START( ssingles, ssingles_state ) MCFG_GFXDECODE(ssingles) - MCFG_MC6845_ADD("crtc", MC6845, 1000000 /* ? MHz */, ssingles_mc6845_intf) + MCFG_MC6845_ADD("crtc", MC6845, "screen", 1000000 /* ? MHz */, ssingles_mc6845_intf) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") @@ -606,7 +604,7 @@ static MACHINE_CONFIG_DERIVED( atamanot, ssingles ) MCFG_DEVICE_REMOVE("crtc") - MCFG_MC6845_ADD("crtc", MC6845, 1000000 /* ? MHz */, atamanot_mc6845_intf) + MCFG_MC6845_ADD("crtc", MC6845, "screen", 1000000 /* ? MHz */, atamanot_mc6845_intf) MCFG_GFXDECODE(atamanot) MACHINE_CONFIG_END diff --git a/src/mame/drivers/statriv2.c b/src/mame/drivers/statriv2.c index ad499d9ccd089..c789d2b0e6253 100644 --- a/src/mame/drivers/statriv2.c +++ b/src/mame/drivers/statriv2.c @@ -589,7 +589,6 @@ GFXDECODE_END static const tms9927_interface tms9927_intf = { - "screen", 8, NULL }; diff --git a/src/mame/drivers/supbtime.c b/src/mame/drivers/supbtime.c index 8b2b10b3cf104..13897faf478ed 100644 --- a/src/mame/drivers/supbtime.c +++ b/src/mame/drivers/supbtime.c @@ -308,7 +308,6 @@ GFXDECODE_END static const deco16ic_interface supbtime_deco16ic_tilegen1_intf = { - "screen", 0, 1, 0x0f, 0x0f, /* trans masks (default values) */ 0, 16, /* color base (default values) */ diff --git a/src/mame/drivers/supercrd.c b/src/mame/drivers/supercrd.c index cd633511f9148..ab70d8493f9e9 100644 --- a/src/mame/drivers/supercrd.c +++ b/src/mame/drivers/supercrd.c @@ -408,7 +408,6 @@ GFXDECODE_END //static MC6845_INTERFACE( mc6845_intf ) //{ -// "screen", /* screen we are acting on */ // false, // 4, /* number of pixels per video memory address */ // NULL, /* before pixel update callback */ @@ -477,7 +476,7 @@ static MACHINE_CONFIG_START( supercrd, supercrd_state ) MCFG_PALETTE_INIT_OVERRIDE(supercrd_state, supercrd) MCFG_VIDEO_START_OVERRIDE(supercrd_state, supercrd) -// MCFG_MC6845_ADD("crtc", MC6845, MASTER_CLOCK/8, mc6845_intf) +// MCFG_MC6845_ADD("crtc", MC6845, "screen", MASTER_CLOCK/8, mc6845_intf) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/taito_f2.c b/src/mame/drivers/taito_f2.c index a306727657c5e..9e0b264061b20 100644 --- a/src/mame/drivers/taito_f2.c +++ b/src/mame/drivers/taito_f2.c @@ -2835,7 +2835,6 @@ static const ay8910_interface ay8910_config = static const tc0100scn_interface taitof2_tc0100scn_intf = { - "screen", 1, 2, /* gfxnum, txnum */ 0, 0, /* x_offset, y_offset */ 0, 0, /* flip_xoff, flip_yoff */ @@ -2845,7 +2844,6 @@ static const tc0100scn_interface taitof2_tc0100scn_intf = static const tc0100scn_interface liquidk_tc0100scn_intf = { - "screen", 1, 2, /* gfxnum, txnum */ 3, 0, /* x_offset, y_offset */ 0, 0, /* flip_xoff, flip_yoff */ @@ -2855,7 +2853,6 @@ static const tc0100scn_interface liquidk_tc0100scn_intf = static const tc0100scn_interface dondokod_tc0100scn_intf = { - "screen", 1, 3, /* gfxnum, txnum */ 3, 0, /* x_offset, y_offset */ 0, 0, /* flip_xoff, flip_yoff */ @@ -2865,7 +2862,6 @@ static const tc0100scn_interface dondokod_tc0100scn_intf = static const tc0100scn_interface finalb_tc0100scn_intf = { - "screen", 1, 2, /* gfxnum, txnum */ 1, 0, /* x_offset, y_offset */ 0, 0, /* flip_xoff, flip_yoff */ @@ -2875,7 +2871,6 @@ static const tc0100scn_interface finalb_tc0100scn_intf = static const tc0100scn_interface ninjak_tc0100scn_intf = { - "screen", 1, 2, /* gfxnum, txnum */ 0, 0, /* x_offset, y_offset */ 0, 0, /* flip_xoff, flip_yoff */ @@ -2885,7 +2880,6 @@ static const tc0100scn_interface ninjak_tc0100scn_intf = static const tc0100scn_interface qzchikyu_tc0100scn_intf = { - "screen", 1, 2, /* gfxnum, txnum */ 0, 0, /* x_offset, y_offset */ -4, 0, /* flip_xoff, flip_yoff */ @@ -2895,7 +2889,6 @@ static const tc0100scn_interface qzchikyu_tc0100scn_intf = static const tc0100scn_interface solfigtr_tc0100scn_intf = { - "screen", 1, 2, /* gfxnum, txnum */ 3, 0, /* x_offset, y_offset */ 6, 0, /* flip_xoff, flip_yoff */ @@ -2905,7 +2898,6 @@ static const tc0100scn_interface solfigtr_tc0100scn_intf = static const tc0100scn_interface koshien_tc0100scn_intf = { - "screen", 1, 2, /* gfxnum, txnum */ 1, 0, /* x_offset, y_offset */ 2, 0, /* flip_xoff, flip_yoff */ @@ -2915,7 +2907,6 @@ static const tc0100scn_interface koshien_tc0100scn_intf = static const tc0100scn_interface thundfox_tc0100scn_intf_1 = { - "screen", 1, 3, /* gfxnum, txnum */ 3, 0, /* x_offset, y_offset */ 5, 0, /* flip_xoff, flip_yoff */ @@ -2925,7 +2916,6 @@ static const tc0100scn_interface thundfox_tc0100scn_intf_1 = static const tc0100scn_interface thundfox_tc0100scn_intf_2 = { - "screen", 2, 4, /* gfxnum, txnum */ 3, 0, /* x_offset, y_offset */ 5, 0, /* flip_xoff, flip_yoff */ diff --git a/src/mame/drivers/taito_z.c b/src/mame/drivers/taito_z.c index c826713cdbed3..f643e4c8743f4 100644 --- a/src/mame/drivers/taito_z.c +++ b/src/mame/drivers/taito_z.c @@ -2947,7 +2947,6 @@ Contcirc road glitchiness in attract? static const tc0100scn_interface taitoz_tc0100scn_intf = { - "screen", 1, 2, /* gfxnum, txnum */ 0, 0, /* x_offset, y_offset */ 0, 0, /* flip_xoff, flip_yoff */ @@ -2957,7 +2956,6 @@ static const tc0100scn_interface taitoz_tc0100scn_intf = static const tc0100scn_interface chasehq_tc0100scn_intf = { - "screen", 1, 3, /* gfxnum, txnum */ 0, 0, /* x_offset, y_offset */ 0, 0, /* flip_xoff, flip_yoff */ @@ -2967,7 +2965,6 @@ static const tc0100scn_interface chasehq_tc0100scn_intf = static const tc0100scn_interface spacegun_tc0100scn_intf = { - "screen", 1, 2, /* gfxnum, txnum */ 4, 0, /* x_offset, y_offset */ 0, 0, /* flip_xoff, flip_yoff */ diff --git a/src/mame/drivers/tapatune.c b/src/mame/drivers/tapatune.c index 1d0ff31a1c56d..f96b0b8ceb053 100644 --- a/src/mame/drivers/tapatune.c +++ b/src/mame/drivers/tapatune.c @@ -365,7 +365,6 @@ WRITE_LINE_MEMBER(tapatune_state::crtc_vsync) static MC6845_INTERFACE( h46505_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 5, /* number of pixels per video memory address */ begin_update,/* before pixel update callback */ @@ -400,7 +399,7 @@ static MACHINE_CONFIG_START( tapatune, tapatune_state ) MCFG_PALETTE_LENGTH(16) - MCFG_MC6845_ADD("crtc", H46505, 24000000/16, h46505_intf) /* H46505 */ + MCFG_MC6845_ADD("crtc", H46505, "screen", 24000000/16, h46505_intf) /* H46505 */ MCFG_TICKET_DISPENSER_ADD("ticket", attotime::from_msec(100), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_LOW) diff --git a/src/mame/drivers/tasman.c b/src/mame/drivers/tasman.c index 6ff97394910b5..9887c8d56dcdc 100644 --- a/src/mame/drivers/tasman.c +++ b/src/mame/drivers/tasman.c @@ -570,7 +570,6 @@ static const k056832_interface k056832_intf = static const k053247_interface k053247_intf = { - "screen", "gfx2", 1, TASMAN_PLANE_ORDER, -48+1, 23, diff --git a/src/mame/drivers/thief.c b/src/mame/drivers/thief.c index 7ffce58f001a0..b4e8220f81070 100644 --- a/src/mame/drivers/thief.c +++ b/src/mame/drivers/thief.c @@ -426,7 +426,6 @@ static const samples_interface natodef_samples_interface = static const tms9927_interface tms9927_intf = { - "screen", 8, NULL }; diff --git a/src/mame/drivers/tmspoker.c b/src/mame/drivers/tmspoker.c index 4658ff199fde7..666a3c96a0615 100644 --- a/src/mame/drivers/tmspoker.c +++ b/src/mame/drivers/tmspoker.c @@ -548,7 +548,6 @@ GFXDECODE_END static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -589,7 +588,7 @@ static MACHINE_CONFIG_START( tmspoker, tmspoker_state ) MCFG_SCREEN_UPDATE_DRIVER(tmspoker_state, screen_update_tmspoker) - MCFG_MC6845_ADD("crtc", MC6845, MASTER_CLOCK/4, mc6845_intf) /* guess */ + MCFG_MC6845_ADD("crtc", MC6845, "screen", MASTER_CLOCK/4, mc6845_intf) /* guess */ MACHINE_CONFIG_END diff --git a/src/mame/drivers/truco.c b/src/mame/drivers/truco.c index d4425d22f4b40..188d2464d105c 100644 --- a/src/mame/drivers/truco.c +++ b/src/mame/drivers/truco.c @@ -434,7 +434,6 @@ static const pia6821_interface pia0_intf = static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 4, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -473,7 +472,7 @@ static MACHINE_CONFIG_START( truco, truco_state ) MCFG_PALETTE_LENGTH(16) - MCFG_MC6845_ADD("crtc", MC6845, CRTC_CLOCK, mc6845_intf) /* Identified as UM6845 */ + MCFG_MC6845_ADD("crtc", MC6845, "screen", CRTC_CLOCK, mc6845_intf) /* Identified as UM6845 */ /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/tumblep.c b/src/mame/drivers/tumblep.c index 7432744286708..af6da098102e8 100644 --- a/src/mame/drivers/tumblep.c +++ b/src/mame/drivers/tumblep.c @@ -273,7 +273,6 @@ GFXDECODE_END static const deco16ic_interface tumblep_deco16ic_tilegen1_intf = { - "screen", 0, 1, 0x0f, 0x0f, /* trans masks (default values) */ 0, 16, /* color base (default values) */ diff --git a/src/mame/drivers/twincobr.c b/src/mame/drivers/twincobr.c index 2fe614415b654..2f255a22d85f8 100644 --- a/src/mame/drivers/twincobr.c +++ b/src/mame/drivers/twincobr.c @@ -690,7 +690,7 @@ static MACHINE_CONFIG_START( twincobr, twincobr_state ) MCFG_MACHINE_RESET_OVERRIDE(twincobr_state,twincobr) /* video hardware */ - MCFG_MC6845_ADD("crtc", HD6845, XTAL_28MHz/8, twincobr_mc6845_intf) /* 3.5MHz measured on CLKin */ + MCFG_MC6845_ADD("crtc", HD6845, "screen", XTAL_28MHz/8, twincobr_mc6845_intf) /* 3.5MHz measured on CLKin */ MCFG_TOAPLAN_SCU_ADD("toaplan_scu") diff --git a/src/mame/drivers/undrfire.c b/src/mame/drivers/undrfire.c index 97761c15e1029..1ef0be17bf62d 100644 --- a/src/mame/drivers/undrfire.c +++ b/src/mame/drivers/undrfire.c @@ -710,7 +710,6 @@ INTERRUPT_GEN_MEMBER(undrfire_state::undrfire_interrupt) static const tc0100scn_interface undrfire_tc0100scn_intf = { - "screen", 2, 3, /* gfxnum, txnum */ 50, 8, /* x_offset, y_offset */ 0, 0, /* flip_xoff, flip_yoff */ diff --git a/src/mame/drivers/usgames.c b/src/mame/drivers/usgames.c index 1289a73ef78d1..86218e646566a 100644 --- a/src/mame/drivers/usgames.c +++ b/src/mame/drivers/usgames.c @@ -216,7 +216,6 @@ GFXDECODE_END static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -251,7 +250,7 @@ static MACHINE_CONFIG_START( usg32, usgames_state ) MCFG_PALETTE_LENGTH(2*256) - MCFG_MC6845_ADD("crtc", MC6845, XTAL_18MHz / 16, mc6845_intf) + MCFG_MC6845_ADD("crtc", MC6845, "screen", XTAL_18MHz / 16, mc6845_intf) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/vaportra.c b/src/mame/drivers/vaportra.c index 541f9477270dc..b610ecfeca4aa 100644 --- a/src/mame/drivers/vaportra.c +++ b/src/mame/drivers/vaportra.c @@ -204,7 +204,6 @@ static int vaportra_bank_callback( const int bank ) static const deco16ic_interface vaportra_deco16ic_tilegen1_intf = { - "screen", 0, 1, 0x0f, 0x0f, /* trans masks (default values) */ 0x00, 0x20, /* color base */ @@ -217,7 +216,6 @@ static const deco16ic_interface vaportra_deco16ic_tilegen1_intf = static const deco16ic_interface vaportra_deco16ic_tilegen2_intf = { - "screen", 0, 1, 0x0f, 0x0f, /* trans masks (default values) */ 0x30, 0x40, /* color base */ diff --git a/src/mame/drivers/vcombat.c b/src/mame/drivers/vcombat.c index 97240c905ec83..32054b9925fd5 100644 --- a/src/mame/drivers/vcombat.c +++ b/src/mame/drivers/vcombat.c @@ -573,7 +573,6 @@ WRITE_LINE_MEMBER(vcombat_state::sound_update) static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 16, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -617,7 +616,7 @@ static MACHINE_CONFIG_START( vcombat, vcombat_state ) MCFG_TLC34076_ADD("tlc34076", TLC34076_6_BIT) /* Disabled for now as it can't handle multiple screens */ -// MCFG_MC6845_ADD("crtc", MC6845, 6000000 / 16, mc6845_intf) +// MCFG_MC6845_ADD("crtc", MC6845, "screen", 6000000 / 16, mc6845_intf) MCFG_DEFAULT_LAYOUT(layout_dualhsxs) MCFG_SCREEN_ADD("screen", RASTER) @@ -653,7 +652,7 @@ static MACHINE_CONFIG_START( shadfgtr, vcombat_state ) MCFG_TLC34076_ADD("tlc34076", TLC34076_6_BIT) - MCFG_MC6845_ADD("crtc", MC6845, XTAL_20MHz / 4 / 16, mc6845_intf) + MCFG_MC6845_ADD("crtc", MC6845, "screen", XTAL_20MHz / 4 / 16, mc6845_intf) MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_RAW_PARAMS(XTAL_20MHz / 4, 320, 0, 256, 277, 0, 224) diff --git a/src/mame/drivers/vendetta.c b/src/mame/drivers/vendetta.c index 9f87b322e5099..4295666c88529 100644 --- a/src/mame/drivers/vendetta.c +++ b/src/mame/drivers/vendetta.c @@ -428,7 +428,6 @@ static const k052109_interface esckids_k052109_intf = static const k053247_interface vendetta_k053246_intf = { - "screen", "gfx2", 1, NORMAL_PLANE_ORDER, 53, 6, @@ -438,7 +437,6 @@ static const k053247_interface vendetta_k053246_intf = static const k053247_interface esckids_k053246_intf = { - "screen", "gfx2", 1, NORMAL_PLANE_ORDER, 101, 6, @@ -448,7 +446,6 @@ static const k053247_interface esckids_k053246_intf = static const k053252_interface esckids_k053252_intf = { - "screen", DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, diff --git a/src/mame/drivers/vlc.c b/src/mame/drivers/vlc.c index ddd105f5a61e1..36f77e3302431 100644 --- a/src/mame/drivers/vlc.c +++ b/src/mame/drivers/vlc.c @@ -233,7 +233,6 @@ static const UINT8 pal35[256] = { static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -660,7 +659,7 @@ static MACHINE_CONFIG_START( nevada, nevada_state ) MCFG_GFXDECODE(nevada) MCFG_PALETTE_LENGTH(256) - MCFG_MC6845_ADD("crtc", MC6845, MC6845_CLOCK, mc6845_intf) + MCFG_MC6845_ADD("crtc", MC6845, "screen", MC6845_CLOCK, mc6845_intf) // sound hardware MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/vsnes.c b/src/mame/drivers/vsnes.c index bdc7b96e14ad7..cd2ed05065025 100644 --- a/src/mame/drivers/vsnes.c +++ b/src/mame/drivers/vsnes.c @@ -1706,6 +1706,7 @@ static MACHINE_CONFIG_START( vsnes, vsnes_state ) MCFG_VIDEO_START_OVERRIDE(vsnes_state,vsnes) MCFG_PPU2C04_ADD("ppu1", vsnes_ppu_interface_1) + MCFG_PPU2C0X_SET_SCREEN("screen1") MCFG_PPU2C0X_SET_NMI(vsnes_state, ppu_irq_1) /* sound hardware */ @@ -1723,6 +1724,7 @@ static MACHINE_CONFIG_DERIVED( jajamaru, vsnes ) MCFG_DEVICE_REMOVE( "ppu1" ) MCFG_PPU2C05_01_ADD("ppu1", vsnes_ppu_interface_1) + MCFG_PPU2C0X_SET_SCREEN("screen1") MCFG_PPU2C0X_SET_NMI(vsnes_state, ppu_irq_1) MACHINE_CONFIG_END @@ -1730,6 +1732,7 @@ static MACHINE_CONFIG_DERIVED( mightybj, vsnes ) MCFG_DEVICE_REMOVE( "ppu1" ) MCFG_PPU2C05_02_ADD("ppu1", vsnes_ppu_interface_1) + MCFG_PPU2C0X_SET_SCREEN("screen1") MCFG_PPU2C0X_SET_NMI(vsnes_state, ppu_irq_1) MACHINE_CONFIG_END @@ -1737,6 +1740,7 @@ static MACHINE_CONFIG_DERIVED( vsgshoe, vsnes ) MCFG_DEVICE_REMOVE( "ppu1" ) MCFG_PPU2C05_03_ADD("ppu1", vsnes_ppu_interface_1) + MCFG_PPU2C0X_SET_SCREEN("screen1") MCFG_PPU2C0X_SET_NMI(vsnes_state, ppu_irq_1) MACHINE_CONFIG_END @@ -1744,6 +1748,7 @@ static MACHINE_CONFIG_DERIVED( topgun, vsnes ) MCFG_DEVICE_REMOVE( "ppu1" ) MCFG_PPU2C05_04_ADD("ppu1", vsnes_ppu_interface_1) + MCFG_PPU2C0X_SET_SCREEN("screen1") MCFG_PPU2C0X_SET_NMI(vsnes_state, ppu_irq_1) MACHINE_CONFIG_END @@ -1779,8 +1784,10 @@ static MACHINE_CONFIG_START( vsdual, vsnes_state ) MCFG_VIDEO_START_OVERRIDE(vsnes_state,vsdual) MCFG_PPU2C04_ADD("ppu1", vsnes_ppu_interface_1) + MCFG_PPU2C0X_SET_SCREEN("screen1") MCFG_PPU2C0X_SET_NMI(vsnes_state, ppu_irq_1) MCFG_PPU2C04_ADD("ppu2", vsnes_ppu_interface_2) + MCFG_PPU2C0X_SET_SCREEN("screen2") MCFG_PPU2C0X_SET_NMI(vsnes_state, ppu_irq_2) /* sound hardware */ diff --git a/src/mame/drivers/wardner.c b/src/mame/drivers/wardner.c index 14facbaf28f97..71b3b96b27750 100644 --- a/src/mame/drivers/wardner.c +++ b/src/mame/drivers/wardner.c @@ -403,7 +403,7 @@ static MACHINE_CONFIG_START( wardner, wardner_state ) MCFG_MACHINE_RESET_OVERRIDE(wardner_state,wardner) /* video hardware */ - MCFG_MC6845_ADD("crtc", HD6845, XTAL_14MHz/4, twincobr_mc6845_intf) /* 3.5MHz measured on CLKin */ + MCFG_MC6845_ADD("crtc", HD6845, "screen", XTAL_14MHz/4, twincobr_mc6845_intf) /* 3.5MHz measured on CLKin */ MCFG_TOAPLAN_SCU_ADD("toaplan_scu") diff --git a/src/mame/drivers/warriorb.c b/src/mame/drivers/warriorb.c index 2f9aba61ee2a2..bc8747a42b66f 100644 --- a/src/mame/drivers/warriorb.c +++ b/src/mame/drivers/warriorb.c @@ -425,7 +425,6 @@ WRITE_LINE_MEMBER(warriorb_state::irqhandler) static const tc0100scn_interface darius2d_tc0100scn_intf_l = { - "lscreen", 1, 3, /* gfxnum, txnum */ 4, 0, /* x_offset, y_offset */ 0, 0, /* flip_xoff, flip_yoff */ @@ -435,7 +434,6 @@ static const tc0100scn_interface darius2d_tc0100scn_intf_l = static const tc0100scn_interface darius2d_tc0100scn_intf_r = { - "rscreen", 2, 3, /* gfxnum, txnum */ 4, 0, /* x_offset, y_offset */ 0, 0, /* flip_xoff, flip_yoff */ @@ -445,7 +443,6 @@ static const tc0100scn_interface darius2d_tc0100scn_intf_r = static const tc0100scn_interface warriorb_tc0100scn_intf_l = { - "lscreen", 1, 3, /* gfxnum, txnum */ 4, 0, /* x_offset, y_offset */ 0, 0, /* flip_xoff, flip_yoff */ @@ -455,7 +452,6 @@ static const tc0100scn_interface warriorb_tc0100scn_intf_l = static const tc0100scn_interface warriorb_tc0100scn_intf_r = { - "rscreen", 2, 3, /* gfxnum, txnum */ 4, 0, /* x_offset, y_offset */ 0, 0, /* flip_xoff, flip_yoff */ @@ -543,7 +539,9 @@ static MACHINE_CONFIG_START( darius2d, warriorb_state ) MCFG_TC0100SCN_ADD("tc0100scn_1", darius2d_tc0100scn_intf_l) + MCFG_TC0100SCN_SET_SCREEN("lscreen") MCFG_TC0100SCN_ADD("tc0100scn_2", darius2d_tc0100scn_intf_r) + MCFG_TC0100SCN_SET_SCREEN("rscreen") MCFG_TC0110PCR_ADD("tc0110pcr_1", darius2d_tc0110pcr_intf_l) MCFG_TC0110PCR_ADD("tc0110pcr_2", darius2d_tc0110pcr_intf_r) @@ -606,7 +604,9 @@ static MACHINE_CONFIG_START( warriorb, warriorb_state ) MCFG_TC0100SCN_ADD("tc0100scn_1", warriorb_tc0100scn_intf_l) + MCFG_TC0100SCN_SET_SCREEN("lscreen") MCFG_TC0100SCN_ADD("tc0100scn_2", warriorb_tc0100scn_intf_r) + MCFG_TC0100SCN_SET_SCREEN("rscreen") MCFG_TC0110PCR_ADD("tc0110pcr_1", darius2d_tc0110pcr_intf_l) MCFG_TC0110PCR_ADD("tc0110pcr_2", darius2d_tc0110pcr_intf_r) diff --git a/src/mame/drivers/wgp.c b/src/mame/drivers/wgp.c index 4bcf92603c353..a8ceb1a2a3dc5 100644 --- a/src/mame/drivers/wgp.c +++ b/src/mame/drivers/wgp.c @@ -935,7 +935,6 @@ void wgp_state::machine_start() static const tc0100scn_interface wgp_tc0100scn_intf = { - "screen", 1, 3, /* gfxnum, txnum */ 0, 0, /* x_offset, y_offset */ 0, 0, /* flip_xoff, flip_yoff */ @@ -945,7 +944,6 @@ static const tc0100scn_interface wgp_tc0100scn_intf = static const tc0100scn_interface wgp2_tc0100scn_intf = { - "screen", 1, 3, /* gfxnum, txnum */ 4, 2, /* x_offset, y_offset */ 0, 0, /* flip_xoff, flip_yoff */ diff --git a/src/mame/drivers/wheelfir.c b/src/mame/drivers/wheelfir.c index 915dd89870005..b548bf3f48b2f 100644 --- a/src/mame/drivers/wheelfir.c +++ b/src/mame/drivers/wheelfir.c @@ -235,7 +235,6 @@ class wheelfir_state : public driver_device required_device m_maincpu; required_device m_subcpu; - device_t *m_screen; INT32 *m_zoom_table; UINT16 *m_blitter_data; @@ -764,8 +763,6 @@ void wheelfir_state::machine_reset() void wheelfir_state::machine_start() { - m_screen = machine().device("screen"); - m_zoom_table = auto_alloc_array(machine(), INT32, ZOOM_TABLE_SIZE); m_blitter_data = auto_alloc_array(machine(), UINT16, 16); diff --git a/src/mame/drivers/xexex.c b/src/mame/drivers/xexex.c index e1a84705a321c..12d1351a6ffc8 100644 --- a/src/mame/drivers/xexex.c +++ b/src/mame/drivers/xexex.c @@ -401,7 +401,6 @@ static const k054539_interface k054539_config = static const k054338_interface xexex_k054338_intf = { - "screen", 0, "none" }; @@ -417,7 +416,6 @@ static const k056832_interface xexex_k056832_intf = static const k053247_interface xexex_k053246_intf = { - "screen", "gfx2", 1, NORMAL_PLANE_ORDER, -48, 32, @@ -427,7 +425,6 @@ static const k053247_interface xexex_k053246_intf = static const k053252_interface xexex_k053252_intf = { - "screen", DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, diff --git a/src/mame/drivers/xmen.c b/src/mame/drivers/xmen.c index 77f43a7c0d97b..ceebc3a74f14e 100644 --- a/src/mame/drivers/xmen.c +++ b/src/mame/drivers/xmen.c @@ -329,7 +329,6 @@ static const k052109_interface xmen_k052109_intf = static const k053247_interface xmen_k053246_intf = { - "screen", "gfx2", 1, NORMAL_PLANE_ORDER, 53, -2, @@ -393,7 +392,6 @@ MACHINE_CONFIG_END static const k053247_interface xmen6p_k053246_intf = { - "lscreen", /* is this correct? */ "gfx2", 1, NORMAL_PLANE_ORDER, 53, -2, @@ -438,6 +436,7 @@ static MACHINE_CONFIG_START( xmen6p, xmen_state ) MCFG_K052109_ADD("k052109", xmen_k052109_intf) MCFG_K053246_ADD("k053246", xmen6p_k053246_intf) + MCFG_K053246_SET_SCREEN("lscreen") MCFG_K053251_ADD("k053251") /* sound hardware */ diff --git a/src/mame/includes/gaelco.h b/src/mame/includes/gaelco.h index 2afab97fb3b70..1ea824e4881ce 100644 --- a/src/mame/includes/gaelco.h +++ b/src/mame/includes/gaelco.h @@ -12,7 +12,7 @@ class gaelco_state : public driver_device m_videoram(*this, "videoram"), m_vregs(*this, "vregs"), m_spriteram(*this, "spriteram"), - m_screen(*this, "screen"), + m_screenram(*this, "screenram"), m_audiocpu(*this, "audiocpu"), m_maincpu(*this, "maincpu") { } @@ -20,7 +20,7 @@ class gaelco_state : public driver_device required_shared_ptr m_videoram; required_shared_ptr m_vregs; required_shared_ptr m_spriteram; - optional_shared_ptr m_screen; + optional_shared_ptr m_screenram; // UINT16 * paletteram; // currently this uses generic palette handling /* video-related */ diff --git a/src/mame/includes/rltennis.h b/src/mame/includes/rltennis.h index 5dfed21d6e8d3..bfc60e1d4000d 100644 --- a/src/mame/includes/rltennis.h +++ b/src/mame/includes/rltennis.h @@ -16,7 +16,6 @@ class rltennis_state : public driver_device m_dac_2(*this, "dac2") { } required_device m_maincpu; - device_t *m_screen; UINT16 m_blitter[RLT_NUM_BLITTER_REGS]; diff --git a/src/mame/machine/atarigen.c b/src/mame/machine/atarigen.c index 4586800039d8e..8088fff0866a3 100644 --- a/src/mame/machine/atarigen.c +++ b/src/mame/machine/atarigen.c @@ -385,14 +385,13 @@ const device_type ATARI_VAD = &device_creator; atari_vad_device::atari_vad_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, ATARI_VAD, "Atari VAD", tag, owner, clock, "atarivad", __FILE__), - m_screen_tag(NULL), + device_video_interface(mconfig, *this), m_scanline_int_cb(*this), m_alpha_tilemap(*this, "alpha"), m_playfield_tilemap(*this, "playfield"), m_playfield2_tilemap(*this, "playfield2"), m_mob(*this, "mob"), m_eof_data(*this, "eof"), - m_screen(NULL), m_scanline_int_timer(NULL), m_tilerow_update_timer(NULL), m_eof_timer(NULL), @@ -407,16 +406,6 @@ atari_vad_device::atari_vad_device(const machine_config &mconfig, const char *ta } -//------------------------------------------------- -// static_set_screen: Set the tag of the screen -//------------------------------------------------- - -void atari_vad_device::static_set_screen(device_t &device, const char *screentag) -{ - downcast(device).m_screen_tag = screentag; -} - - //------------------------------------------------- // control_write: Does the bulk of the word for an I/O // write. @@ -531,13 +520,6 @@ void atari_vad_device::device_start() if (m_eof_data == NULL) throw emu_fatalerror("EOF data not found!"); - // find the screen - if (m_screen_tag == NULL) - throw emu_fatalerror("No screen specified!"); - m_screen = siblingdevice(m_screen_tag); - if (m_screen == NULL) - throw emu_fatalerror("Screen '%s' not found!", m_screen_tag); - // resolve callbacks m_scanline_int_cb.resolve_safe(); diff --git a/src/mame/machine/atarigen.h b/src/mame/machine/atarigen.h index e1ba2105f4ab2..f10e6ce2de197 100644 --- a/src/mame/machine/atarigen.h +++ b/src/mame/machine/atarigen.h @@ -68,7 +68,7 @@ #define MCFG_ATARI_VAD_ADD(_tag, _screen, _intcb) \ MCFG_DEVICE_ADD(_tag, ATARI_VAD, 0) \ - atari_vad_device::static_set_screen(*device, _screen); \ + MCFG_VIDEO_SET_SCREEN(_screen) \ devcb = &atari_vad_device::static_set_scanline_int_cb(*device, DEVCB2_##_intcb); #define MCFG_ATARI_VAD_PLAYFIELD(_class, _getinfo) \ { astring fulltag(device->tag(), ":playfield"); device_t *device; \ @@ -191,14 +191,14 @@ class atari_motion_objects_device; // device type definition extern const device_type ATARI_VAD; -class atari_vad_device : public device_t +class atari_vad_device : public device_t, + public device_video_interface { public: // construction/destruction atari_vad_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); // static configuration helpers - static void static_set_screen(device_t &device, const char *screentag); template static devcb2_base &static_set_scanline_int_cb(device_t &device, _Object object) { return downcast(device).m_scanline_int_cb.set_callback(object); } // getters @@ -241,7 +241,6 @@ class atari_vad_device : public device_t void eof_update(emu_timer &timer); // configuration state - const char * m_screen_tag; devcb2_write_line m_scanline_int_cb; // internal state @@ -251,7 +250,6 @@ class atari_vad_device : public device_t optional_device m_mob; optional_shared_ptr m_eof_data; - screen_device * m_screen; emu_timer * m_scanline_int_timer; emu_timer * m_tilerow_update_timer; emu_timer * m_eof_timer; diff --git a/src/mame/machine/megadriv.c b/src/mame/machine/megadriv.c index 3c143eeba56b4..cbec27cb2b0aa 100644 --- a/src/mame/machine/megadriv.c +++ b/src/mame/machine/megadriv.c @@ -975,7 +975,6 @@ MACHINE_CONFIG_END static const sega315_5124_interface sms_vdp_ntsc_intf = { false, - "megadriv", DEVCB_NULL, DEVCB_NULL, }; @@ -983,7 +982,6 @@ static const sega315_5124_interface sms_vdp_ntsc_intf = static const sega315_5124_interface sms_vdp_pal_intf = { true, - "megadriv", DEVCB_NULL, DEVCB_NULL, }; @@ -1013,6 +1011,7 @@ MACHINE_CONFIG_FRAGMENT( md_ntsc ) MCFG_DEVICE_ADD("gen_vdp", SEGA_GEN_VDP, 0) MCFG_DEVICE_CONFIG( sms_vdp_ntsc_intf ) + MCFG_VIDEO_SET_SCREEN("megadriv") sega_genesis_vdp_device::set_genesis_vdp_sndirqline_callback(*device, genesis_vdp_sndirqline_callback_genesis_z80); sega_genesis_vdp_device::set_genesis_vdp_lv6irqline_callback(*device, genesis_vdp_lv6irqline_callback_genesis_68k); sega_genesis_vdp_device::set_genesis_vdp_lv4irqline_callback(*device, genesis_vdp_lv4irqline_callback_genesis_68k); @@ -1066,6 +1065,7 @@ MACHINE_CONFIG_FRAGMENT( md_pal ) MCFG_DEVICE_ADD("gen_vdp", SEGA_GEN_VDP, 0) MCFG_DEVICE_CONFIG( sms_vdp_pal_intf ) + MCFG_VIDEO_SET_SCREEN("megadriv") sega_genesis_vdp_device::set_genesis_vdp_sndirqline_callback(*device, genesis_vdp_sndirqline_callback_genesis_z80); sega_genesis_vdp_device::set_genesis_vdp_lv6irqline_callback(*device, genesis_vdp_lv6irqline_callback_genesis_68k); sega_genesis_vdp_device::set_genesis_vdp_lv4irqline_callback(*device, genesis_vdp_lv4irqline_callback_genesis_68k); diff --git a/src/mame/video/atarimo.c b/src/mame/video/atarimo.c index 438b4b18598c4..cd21b2f9cd5ca 100644 --- a/src/mame/video/atarimo.c +++ b/src/mame/video/atarimo.c @@ -154,6 +154,7 @@ const device_type ATARI_MOTION_OBJECTS = &device_creator(device).m_screen_tag = screentag; -} - - //------------------------------------------------- // static_set_config: Set the tag of the // sound CPU @@ -305,13 +296,6 @@ void atari_motion_objects_device::device_start() if (gfx == NULL) throw emu_fatalerror("No gfxelement #%d!", m_gfxindex); - // find the screen - if (m_screen_tag == NULL) - throw emu_fatalerror("No screen specified!"); - m_screen = siblingdevice(m_screen_tag); - if (m_screen == NULL) - throw emu_fatalerror("Screen '%s' not found!", m_screen_tag); - // determine the masks m_linkmask.set(m_link_entry); m_codemask.set(m_code_entry); diff --git a/src/mame/video/atarimo.h b/src/mame/video/atarimo.h index 0caef79c87c82..b8b08b2b2f89e 100644 --- a/src/mame/video/atarimo.h +++ b/src/mame/video/atarimo.h @@ -49,7 +49,7 @@ #define MCFG_ATARI_MOTION_OBJECTS_ADD(_tag, _screen, _config) \ MCFG_DEVICE_ADD(_tag, ATARI_MOTION_OBJECTS, 0) \ - atari_motion_objects_device::static_set_screen(*device, _screen); \ + MCFG_VIDEO_SET_SCREEN(_screen) \ atari_motion_objects_device::static_set_config(*device, _config); \ @@ -103,6 +103,7 @@ struct atari_motion_objects_config extern const device_type ATARI_MOTION_OBJECTS; class atari_motion_objects_device : public sprite16_device_ind16, + public device_video_interface, public atari_motion_objects_config { static const int MAX_PER_BANK = 1024; @@ -112,7 +113,6 @@ class atari_motion_objects_device : public sprite16_device_ind16, atari_motion_objects_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); // static configuration helpers - static void static_set_screen(device_t &device, const char *screentag); static void static_set_config(device_t &device, const atari_motion_objects_config &config); // getters @@ -193,9 +193,6 @@ class atari_motion_objects_device : public sprite16_device_ind16, UINT16 m_uppershift; // upper shift }; - // configuration state - const char * m_screen_tag; // pointer to the screen - // parameter masks sprite_parameter m_linkmask; // mask for the link sprite_parameter m_gfxmask; // mask for the graphics bank @@ -234,7 +231,6 @@ class atari_motion_objects_device : public sprite16_device_ind16, int m_slipramsize; // total size of SLIP RAM, in entries // live state - screen_device * m_screen; // pointer to our screen emu_timer * m_force_update_timer; // timer for forced updating UINT32 m_bank; // current bank number UINT32 m_xscroll; // xscroll offset diff --git a/src/mame/video/cidelsa.c b/src/mame/video/cidelsa.c index 592b894ae1308..b85b1585ac03c 100644 --- a/src/mame/video/cidelsa.c +++ b/src/mame/video/cidelsa.c @@ -127,7 +127,6 @@ ADDRESS_MAP_END static CDP1869_INTERFACE( destryer_vis_intf ) { - SCREEN_TAG, 0, CDP1869_PAL, cidelsa_pcb_r, @@ -138,7 +137,6 @@ static CDP1869_INTERFACE( destryer_vis_intf ) static CDP1869_INTERFACE( altair_vis_intf ) { - SCREEN_TAG, 0, CDP1869_PAL, cidelsa_pcb_r, @@ -149,7 +147,6 @@ static CDP1869_INTERFACE( altair_vis_intf ) static CDP1869_INTERFACE( draco_vis_intf ) { - SCREEN_TAG, 0, CDP1869_PAL, draco_pcb_r, diff --git a/src/mame/video/deco16ic.c b/src/mame/video/deco16ic.c index 0d51467dde7a1..a55884a37daae 100644 --- a/src/mame/video/deco16ic.c +++ b/src/mame/video/deco16ic.c @@ -168,7 +168,7 @@ const device_type DECO16IC = &device_creator; deco16ic_device::deco16ic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, DECO16IC, "Data East IC 55 / 56 / 74 / 141", tag, owner, clock, "deco16ic", __FILE__), - //m_screen(NULL), + device_video_interface(mconfig, *this), m_pf1_data(NULL), m_pf2_data(NULL), m_pf12_control(NULL), @@ -200,7 +200,6 @@ void deco16ic_device::device_config_complete() // or initialize to defaults if none provided else { - m_screen_tag = ""; m_bank_cb0 = NULL; m_bank_cb1 = NULL; } @@ -618,7 +617,7 @@ READ16_MEMBER( deco16ic_device::pf2_data_r ) WRITE16_MEMBER( deco16ic_device::pf_control_w ) { - space.machine().primary_screen->update_partial(space.machine().primary_screen->vpos()); + m_screen->update_partial(m_screen->vpos()); COMBINE_DATA(&m_pf12_control[offset]); } diff --git a/src/mame/video/deco16ic.h b/src/mame/video/deco16ic.h index 6924b7ffc718d..6be2141299b82 100644 --- a/src/mame/video/deco16ic.h +++ b/src/mame/video/deco16ic.h @@ -22,7 +22,6 @@ typedef int (*deco16_bank_cb)( const int bank ); struct deco16ic_interface { - const char *m_screen_tag; int m_split; int m_full_width12; @@ -34,7 +33,8 @@ struct deco16ic_interface }; class deco16ic_device : public device_t, - public deco16ic_interface + public device_video_interface, + public deco16ic_interface { public: deco16ic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); @@ -119,8 +119,6 @@ class deco16ic_device : public device_t, private: // internal state - //screen_device *m_screen; - UINT16 *m_pf1_data, *m_pf2_data; UINT16 *m_pf12_control; @@ -158,5 +156,6 @@ extern const device_type DECO16IC; MCFG_DEVICE_ADD(_tag, DECO16IC, 0) \ MCFG_DEVICE_CONFIG(_interface) +#define MCFG_DECO16IC_SET_SCREEN MCFG_VIDEO_SET_SCREEN #endif diff --git a/src/mame/video/decocomn.c b/src/mame/video/decocomn.c index f0a8086187328..d6e1eea1109cb 100644 --- a/src/mame/video/decocomn.c +++ b/src/mame/video/decocomn.c @@ -13,7 +13,7 @@ const device_type DECOCOMN = &device_creator; decocomn_device::decocomn_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, DECOCOMN, "Data East Common Video Functions", tag, owner, clock, "decocomn", __FILE__), - m_screen(NULL), + device_video_interface(mconfig, *this), m_dirty_palette(NULL), m_priority(0) { @@ -27,16 +27,6 @@ decocomn_device::decocomn_device(const machine_config &mconfig, const char *tag, void decocomn_device::device_config_complete() { - // inherit a copy of the static data - const decocomn_interface *intf = reinterpret_cast(static_config()); - if (intf != NULL) - *static_cast(this) = *intf; - - // or initialize to defaults if none provided - else - { - m_screen_tag = ""; - } } //------------------------------------------------- @@ -47,7 +37,6 @@ void decocomn_device::device_start() { // int width, height; - m_screen = machine().device(m_screen_tag); // width = m_screen->width(); // height = m_screen->height(); diff --git a/src/mame/video/decocomn.h b/src/mame/video/decocomn.h index 34fe85608f3b3..5b3d76ff3009f 100644 --- a/src/mame/video/decocomn.h +++ b/src/mame/video/decocomn.h @@ -14,13 +14,8 @@ ***************************************************************************/ -struct decocomn_interface -{ - const char *m_screen_tag; -}; - class decocomn_device : public device_t, - public decocomn_interface + public device_video_interface { public: decocomn_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); @@ -41,7 +36,6 @@ class decocomn_device : public device_t, private: // internal state - screen_device *m_screen; UINT8 *m_dirty_palette; UINT16 m_priority; }; @@ -54,8 +48,7 @@ extern const device_type DECOCOMN; DEVICE CONFIGURATION MACROS ***************************************************************************/ -#define MCFG_DECOCOMN_ADD(_tag, _interface) \ - MCFG_DEVICE_ADD(_tag, DECOCOMN, 0) \ - MCFG_DEVICE_CONFIG(_interface) +#define MCFG_DECOCOMN_ADD(_tag) \ + MCFG_DEVICE_ADD(_tag, DECOCOMN, 0) #endif diff --git a/src/mame/video/decodmd2.c b/src/mame/video/decodmd2.c index 628ba0e2c21d8..8ef8f8c3f1cff 100644 --- a/src/mame/video/decodmd2.c +++ b/src/mame/video/decodmd2.c @@ -117,7 +117,6 @@ MC6845_UPDATE_ROW( dmd_update_row ) MC6845_INTERFACE( decodmd2_6845_intf ) { - NULL, /* screen name */ false, /* show border area */ 8, /* number of pixels per video memory address */ NULL, /* begin_update */ @@ -149,7 +148,7 @@ static MACHINE_CONFIG_FRAGMENT( decodmd2 ) MCFG_TIMER_DRIVER_ADD_PERIODIC("firq_timer",decodmd_type2_device,dmd_firq,attotime::from_hz(80)) - MCFG_MC6845_ADD("dmd6845",MC6845,XTAL_8MHz / 8,decodmd2_6845_intf) // TODO: confirm clock speed + MCFG_MC6845_ADD("dmd6845",MC6845,NULL,XTAL_8MHz / 8,decodmd2_6845_intf) // TODO: confirm clock speed MCFG_DEFAULT_LAYOUT(layout_lcd) diff --git a/src/mame/video/k001006.c b/src/mame/video/k001006.c index 8b48eddc5140d..2f83cd5dafc25 100644 --- a/src/mame/video/k001006.c +++ b/src/mame/video/k001006.c @@ -17,7 +17,6 @@ const device_type K001006 = &device_creator; k001006_device::k001006_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, K001006, "Konami 001006", tag, owner, clock, "k001006", __FILE__), - //m_screen(NULL), m_pal_ram(NULL), m_unknown_ram(NULL), m_addr(0), diff --git a/src/mame/video/k001006.h b/src/mame/video/k001006.h index 434ea20fc7f3c..463aaa0ec1ed7 100644 --- a/src/mame/video/k001006.h +++ b/src/mame/video/k001006.h @@ -14,7 +14,7 @@ struct k001006_interface class k001006_device : public device_t, - public k001006_interface + public k001006_interface { public: k001006_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); @@ -33,8 +33,6 @@ class k001006_device : public device_t, private: // internal state - //screen_device *m_screen; - UINT16 * m_pal_ram; UINT16 * m_unknown_ram; UINT32 m_addr; diff --git a/src/mame/video/k001604.c b/src/mame/video/k001604.c index b0e2c9eeeabcc..13a33344f12c5 100644 --- a/src/mame/video/k001604.c +++ b/src/mame/video/k001604.c @@ -17,7 +17,6 @@ const device_type K001604 = &device_creator; k001604_device::k001604_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, K001604, "Konami 001604", tag, owner, clock, "k001604", __FILE__), - //m_screen(NULL), m_tile_ram(NULL), m_char_ram(NULL), m_reg(NULL) diff --git a/src/mame/video/k001604.h b/src/mame/video/k001604.h index 4f77017eb7388..97e22464a8383 100644 --- a/src/mame/video/k001604.h +++ b/src/mame/video/k001604.h @@ -37,7 +37,6 @@ class k001604_device : public device_t, virtual void device_reset(); private: // internal state - //screen_device *m_screen; tilemap_t *m_layer_8x8[2]; tilemap_t *m_layer_roz; int m_gfx_index[2]; diff --git a/src/mame/video/k037122.c b/src/mame/video/k037122.c index 3ba639afb1145..2d19817a9557e 100644 --- a/src/mame/video/k037122.c +++ b/src/mame/video/k037122.c @@ -15,34 +15,14 @@ const device_type K037122 = &device_creator; k037122_device::k037122_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, K037122, "Konami 0371222", tag, owner, clock, "k037122", __FILE__), - m_screen(NULL), + device_video_interface(mconfig, *this), m_tile_ram(NULL), m_char_ram(NULL), - m_reg(NULL) + m_reg(NULL), + m_gfx_index(0) { } -//------------------------------------------------- -// device_config_complete - perform any -// operations now that the configuration is -// complete -//------------------------------------------------- - -void k037122_device::device_config_complete() -{ - // inherit a copy of the static data - const k037122_interface *intf = reinterpret_cast(static_config()); - if (intf != NULL) - *static_cast(this) = *intf; - - // or initialize to defaults if none provided - else - { - m_screen_tag = ""; - m_gfx_index = 0; - } -} - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- @@ -60,8 +40,6 @@ void k037122_device::device_start() 8*128 }; - m_screen = machine().device(m_screen_tag); - m_char_ram = auto_alloc_array_clear(machine(), UINT32, 0x200000 / 4); m_tile_ram = auto_alloc_array_clear(machine(), UINT32, 0x20000 / 4); m_reg = auto_alloc_array_clear(machine(), UINT32, 0x400 / 4); diff --git a/src/mame/video/k037122.h b/src/mame/video/k037122.h index 4b2bdf0f023a2..05d4117a1e71d 100644 --- a/src/mame/video/k037122.h +++ b/src/mame/video/k037122.h @@ -2,18 +2,14 @@ #ifndef __K037122_H__ #define __K037122_H__ -struct k037122_interface -{ - const char *m_screen_tag; - int m_gfx_index; -}; - class k037122_device : public device_t, - public k037122_interface + public device_video_interface { public: k037122_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); ~k037122_device() {} + + static void static_set_gfx_index(device_t &device, int index) { downcast(device).m_gfx_index = index; } void tile_draw( bitmap_rgb32 &bitmap, const rectangle &cliprect ); DECLARE_READ32_MEMBER( sram_r ); @@ -25,19 +21,19 @@ class k037122_device : public device_t, protected: // device-level overrides - virtual void device_config_complete(); virtual void device_start(); virtual void device_reset(); private: // internal state - screen_device *m_screen; tilemap_t *m_layer[2]; UINT32 * m_tile_ram; UINT32 * m_char_ram; UINT32 * m_reg; + int m_gfx_index; + TILE_GET_INFO_MEMBER(tile_info_layer0); TILE_GET_INFO_MEMBER(tile_info_layer1); void update_palette_color( UINT32 palette_base, int color ); @@ -45,8 +41,9 @@ class k037122_device : public device_t, extern const device_type K037122; -#define MCFG_K037122_ADD(_tag, _interface) \ +#define MCFG_K037122_ADD(_tag, _screen, _gfxindex) \ MCFG_DEVICE_ADD(_tag, K037122, 0) \ - MCFG_DEVICE_CONFIG(_interface) + MCFG_VIDEO_SET_SCREEN(_screen) \ + k037122_device::static_set_gfx_index(*device, _gfxindex); #endif diff --git a/src/mame/video/k053246_k053247_k055673.c b/src/mame/video/k053246_k053247_k055673.c index ce64c65f8029e..7c42dd2df9ef2 100644 --- a/src/mame/video/k053246_k053247_k055673.c +++ b/src/mame/video/k053246_k053247_k055673.c @@ -64,9 +64,7 @@ void k053247_device::clear_all() m_callback = 0; m_memory_region = 0; - m_screen = 0; - m_intf_screen = 0; m_intf_gfx_memory_region = 0; m_intf_gfx_num = -1; m_intf_plane_order = 0; @@ -988,8 +986,6 @@ void k055673_device::device_start() return; alt_k055673_vh_start(machine(), m_intf_gfx_memory_region, m_intf_plane_order, m_intf_dx, m_intf_dy, m_intf_callback); - - m_screen = machine().device(m_intf_screen); } //------------------------------------------------- @@ -1001,13 +997,15 @@ void k055673_device::device_start() const device_type K053246 = &device_creator; k053247_device::k053247_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : device_t(mconfig, K053246, "Konami 053246 & 053247", tag, owner, clock, "k053247", __FILE__) + : device_t(mconfig, K053246, "Konami 053246 & 053247", tag, owner, clock, "k053247", __FILE__), + device_video_interface(mconfig, *this) { clear_all(); } k053247_device::k053247_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) - : device_t(mconfig, type, name, tag, owner, clock, shortname, source) + : device_t(mconfig, type, name, tag, owner, clock, shortname, source), + device_video_interface(mconfig, *this) { clear_all(); } @@ -1067,8 +1065,6 @@ void k053247_device::device_start() 16*64 }; - m_screen = machine().device(m_intf_screen); - /* decode the graphics */ switch (m_intf_plane_order) { @@ -1303,7 +1299,6 @@ void k053247_device::alt_k055673_vh_start(running_machine &machine, const char * m_callback = callback; m_objcha_line = CLEAR_LINE; m_ram = auto_alloc_array(machine, UINT16, 0x1000/2); - m_screen = machine.primary_screen; memset(m_ram, 0, 0x1000); memset(m_kx46_regs, 0, 8); diff --git a/src/mame/video/k053246_k053247_k055673.h b/src/mame/video/k053246_k053247_k055673.h index 273d33374eda5..f8256ed1ff07f 100644 --- a/src/mame/video/k053246_k053247_k055673.h +++ b/src/mame/video/k053246_k053247_k055673.h @@ -44,7 +44,6 @@ Callback procedures for non-standard shadows: struct k053247_interface { - const char *m_intf_screen; const char *m_intf_gfx_memory_region; int m_intf_gfx_num; int m_intf_plane_order; @@ -54,6 +53,7 @@ struct k053247_interface }; class k053247_device : public device_t, + public device_video_interface, public k053247_interface { public: @@ -113,7 +113,6 @@ class k053247_device : public device_t, k05324x_callback m_callback; const char *m_memory_region; - screen_device *m_screen; /* alt implementation - to be collapsed */ void alt_k055673_vh_start(running_machine &machine, const char *gfx_memory_region, int alt_layout, int dx, int dy, @@ -182,7 +181,7 @@ class k053247_device : public device_t, // for Escape Kids (GX975) if ( objset1 & 8 ) // Check only "Bit #3 is '1'?" { - int screenwidth = machine().primary_screen->width(); + int screenwidth = m_screen->width(); zoomx = zoomx>>1; // Fix sprite width to HALF size ox = (ox>>1) + 1; // Fix sprite draw position @@ -497,6 +496,8 @@ extern const device_type K055673; MCFG_DEVICE_ADD(_tag, K053246, 0) \ MCFG_DEVICE_CONFIG(_interface) +#define MCFG_K053246_SET_SCREEN MCFG_VIDEO_SET_SCREEN + #define MCFG_K055673_ADD(_tag, _interface) \ MCFG_DEVICE_ADD(_tag, K055673, 0) \ MCFG_DEVICE_CONFIG(_interface) @@ -504,6 +505,7 @@ extern const device_type K055673; #define MCFG_K055673_ADD_NOINTF(_tag ) \ MCFG_DEVICE_ADD(_tag, K055673, 0) +#define MCFG_K055673_SET_SCREEN MCFG_VIDEO_SET_SCREEN /* old non-device stuff */ diff --git a/src/mame/video/k054338.c b/src/mame/video/k054338.c index 82ac5bd9b1279..8df873bf77047 100644 --- a/src/mame/video/k054338.c +++ b/src/mame/video/k054338.c @@ -85,13 +85,13 @@ void K054338_update_all_shadows(running_machine &machine, int rushingheroes_hack // Unified K054338/K055555 BG color fill -void K054338_fill_backcolor(running_machine &machine, bitmap_rgb32 &bitmap, int mode) // (see p.67) +void K054338_fill_backcolor(running_machine &machine, screen_device &screen, bitmap_rgb32 &bitmap, int mode) // (see p.67) { int clipx, clipy, clipw, cliph, i, dst_pitch; int BGC_CBLK, BGC_SET; UINT32 *dst_ptr, *pal_ptr; int bgcolor; - const rectangle &visarea = machine.primary_screen->visible_area(); + const rectangle &visarea = screen.visible_area(); driver_device *state = machine.driver_data(); clipx = visarea.min_x & ~3; @@ -236,7 +236,8 @@ void K054338_export_config(int **shdRGB) const device_type K054338 = &device_creator; k054338_device::k054338_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : device_t(mconfig, K054338, "Konami 054338", tag, owner, clock, "k054338", __FILE__) + : device_t(mconfig, K054338, "Konami 054338", tag, owner, clock, "k054338", __FILE__), + device_video_interface(mconfig, *this) //m_regs[32], //m_shd_rgb[9], { @@ -258,7 +259,6 @@ void k054338_device::device_config_complete() // or initialize to defaults if none provided else { - m_screen_tag = ""; m_alpha_inv = 0; m_k055555_tag = ""; }; @@ -270,7 +270,6 @@ void k054338_device::device_config_complete() void k054338_device::device_start() { - m_screen = machine().device(m_screen_tag); m_k055555 = machine().device(m_k055555_tag); save_item(NAME(m_regs)); diff --git a/src/mame/video/k054338.h b/src/mame/video/k054338.h index 277480e88dce3..04afeac277c61 100644 --- a/src/mame/video/k054338.h +++ b/src/mame/video/k054338.h @@ -18,7 +18,7 @@ DECLARE_WRITE32_HANDLER( K054338_long_w ); int K054338_read_register(int reg); void K054338_update_all_shadows(running_machine &machine, int rushingheroes_hack); // called at the beginning of SCREEN_UPDATE() void K054338_fill_solid_bg(bitmap_ind16 &bitmap); // solid backcolor fill -void K054338_fill_backcolor(running_machine &machine, bitmap_rgb32 &bitmap, int mode); // unified fill, 0=solid, 1=gradient +void K054338_fill_backcolor(running_machine &machine, screen_device &screen, bitmap_rgb32 &bitmap, int mode); // unified fill, 0=solid, 1=gradient int K054338_set_alpha_level(int pblend); // blend style 0-2 void K054338_invert_alpha(int invert); // 0=0x00(invis)-0x1f(solid), 1=0x1f(invis)-0x00(solod) void K054338_export_config(int **shdRGB); @@ -40,13 +40,13 @@ void K054338_export_config(int **shdRGB); struct k054338_interface { - const char *m_screen_tag; int m_alpha_inv; const char *m_k055555_tag; }; class k054338_device : public device_t, + public device_video_interface, public k054338_interface { public: @@ -77,7 +77,6 @@ class k054338_device : public device_t, UINT16 m_regs[32]; int m_shd_rgb[9]; - screen_device *m_screen; k055555_device *m_k055555; /* used to fill BG color */ }; diff --git a/src/mame/video/kan_pand.c b/src/mame/video/kan_pand.c index 7356d465eb917..729bce61160e6 100644 --- a/src/mame/video/kan_pand.c +++ b/src/mame/video/kan_pand.c @@ -53,7 +53,8 @@ const device_type KANEKO_PANDORA = &device_creator; kaneko_pandora_device::kaneko_pandora_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : device_t(mconfig, KANEKO_PANDORA, "Kaneko Pandora - PX79C480FP-3", tag, owner, clock, "kaneko_pandora", __FILE__) + : device_t(mconfig, KANEKO_PANDORA, "Kaneko Pandora - PX79C480FP-3", tag, owner, clock, "kaneko_pandora", __FILE__), + device_video_interface(mconfig, *this) { } @@ -73,7 +74,6 @@ void kaneko_pandora_device::device_config_complete() // or initialize to defaults if none provided else { - m_screen_tag = ""; m_gfx_region = 0; m_xoffset = 0; m_yoffset = 0; @@ -86,7 +86,6 @@ void kaneko_pandora_device::device_config_complete() void kaneko_pandora_device::device_start() { - m_screen = machine().device(m_screen_tag); m_bg_pen = 0; m_spriteram = auto_alloc_array(machine(), UINT8, 0x1000); diff --git a/src/mame/video/kan_pand.h b/src/mame/video/kan_pand.h index 47bdcdad78528..76be9f90504e6 100644 --- a/src/mame/video/kan_pand.h +++ b/src/mame/video/kan_pand.h @@ -15,13 +15,13 @@ struct kaneko_pandora_interface { - const char *m_screen_tag; UINT8 m_gfx_region; int m_xoffset; int m_yoffset; }; class kaneko_pandora_device : public device_t, + public device_video_interface, public kaneko_pandora_interface { public: @@ -47,7 +47,6 @@ class kaneko_pandora_device : public device_t, private: // internal state - screen_device *m_screen; UINT8 * m_spriteram; bitmap_ind16 *m_sprites_bitmap; /* bitmap to render sprites to, Pandora seems to be frame'buffered' */ int m_clear_bitmap; diff --git a/src/mame/video/konamigx.c b/src/mame/video/konamigx.c index 57a7d028cc4d0..78bca2f2cb656 100644 --- a/src/mame/video/konamigx.c +++ b/src/mame/video/konamigx.c @@ -410,7 +410,7 @@ void konamigx_state::konamigx_mixer(running_machine &machine, bitmap_rgb32 &bitm if (!objpool) return; // clear screen with backcolor and update flicker pulse - K054338_fill_backcolor(machine, bitmap, konamigx_wrport1_0 & 0x20); + K054338_fill_backcolor(machine, m_screen, bitmap, konamigx_wrport1_0 & 0x20); // abort if video has been disabled diff --git a/src/mame/video/madalien.c b/src/mame/video/madalien.c index 5a2feec9ff66b..1ca48d5527aa5 100644 --- a/src/mame/video/madalien.c +++ b/src/mame/video/madalien.c @@ -376,7 +376,6 @@ GFXDECODE_END static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -400,5 +399,5 @@ MACHINE_CONFIG_FRAGMENT( madalien_video ) MCFG_PALETTE_INIT_OVERRIDE(madalien_state,madalien) MCFG_VIDEO_START_OVERRIDE(madalien_state,madalien) - MCFG_MC6845_ADD("crtc", MC6845, PIXEL_CLOCK / 8, mc6845_intf) + MCFG_MC6845_ADD("crtc", MC6845, "screen", PIXEL_CLOCK / 8, mc6845_intf) MACHINE_CONFIG_END diff --git a/src/mame/video/playch10.c b/src/mame/video/playch10.c index dd60373c83e88..8fdbee81d015b 100644 --- a/src/mame/video/playch10.c +++ b/src/mame/video/playch10.c @@ -71,7 +71,6 @@ void playch10_state::ppu_irq(int *ppu_regs) const ppu2c0x_interface playch10_ppu_interface = { "cart", - "bottom", 1, /* gfxlayout num */ 256, /* color base */ PPU_MIRROR_NONE /* mirroring */ diff --git a/src/mame/video/ppu2c0x.c b/src/mame/video/ppu2c0x.c index 33cb0ce242f16..100404e63165b 100644 --- a/src/mame/video/ppu2c0x.c +++ b/src/mame/video/ppu2c0x.c @@ -123,12 +123,12 @@ void ppu2c0x_device::device_config_complete() m_color_base = config->color_base; m_cpu_tag = config->cpu_tag; - m_screen_tag = config->screen_tag; } ppu2c0x_device::ppu2c0x_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source), device_memory_interface(mconfig, *this), + device_video_interface(mconfig, *this), m_space_config("videoram", ENDIANNESS_LITTLE, 8, 17, 0, NULL, *ADDRESS_MAP_NAME(ppu2c0x)), m_scanline(0), // reset the scanline count m_refresh_data(0), @@ -208,10 +208,9 @@ ppu2c05_04_device::ppu2c05_04_device(const machine_config &mconfig, const char * void ppu2c0x_device::device_start() { - m_screen = machine().device( m_screen_tag ); m_cpu = machine().device( m_cpu_tag ); - assert(m_screen && m_cpu); + assert(m_cpu); // bind our handler m_nmi_callback_proc.bind_relative_to(*owner()); diff --git a/src/mame/video/ppu2c0x.h b/src/mame/video/ppu2c0x.h index 3c7a2757e8443..39e3e492104d5 100644 --- a/src/mame/video/ppu2c0x.h +++ b/src/mame/video/ppu2c0x.h @@ -100,6 +100,8 @@ enum #define MCFG_PPU2C05_04_ADD(_tag, _intrf) \ MCFG_PPU2C0X_ADD(_tag, PPU_2C05_04, _intrf) +#define MCFG_PPU2C0X_SET_SCREEN MCFG_VIDEO_SET_SCREEN + #define MCFG_PPU2C0X_SET_NMI( _class, _method) \ ppu2c0x_device::set_nmi_delegate(*device, ppu2c0x_nmi_delegate(&_class::_method, #_class "::" #_method, NULL, (_class *)0)); @@ -118,7 +120,6 @@ typedef device_delegate ppu2c0x_latch_delegate; struct ppu2c0x_interface { const char *cpu_tag; - const char *screen_tag; int gfx_layout_number; /* gfx layout number used by each chip */ int color_base; /* color base to use per ppu */ int mirroring; /* mirroring options (PPU_MIRROR_* flag) */ @@ -129,6 +130,7 @@ struct ppu2c0x_interface class ppu2c0x_device : public device_t, public device_memory_interface, + public device_video_interface, public ppu2c0x_interface { public: @@ -177,7 +179,6 @@ class ppu2c0x_device : public device_t, // void update_screen(bitmap_t &bitmap, const rectangle &cliprect); cpu_device *m_cpu; - screen_device *m_screen; bitmap_ind16 *m_bitmap; /* target bitmap */ UINT8 *m_spriteram; /* sprite ram */ pen_t *m_colortable; /* color table modified at run time */ @@ -212,7 +213,6 @@ class ppu2c0x_device : public device_t, emu_timer *m_scanline_timer; /* scanline timer */ const char *m_cpu_tag; - const char *m_screen_tag; private: static const device_timer_id TIMER_HBLANK = 0; diff --git a/src/mame/video/qix.c b/src/mame/video/qix.c index 478c6c9c231f2..f52a7fe7c61db 100644 --- a/src/mame/video/qix.c +++ b/src/mame/video/qix.c @@ -384,7 +384,6 @@ ADDRESS_MAP_END static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ begin_update, /* before pixel update callback */ @@ -404,7 +403,7 @@ MACHINE_CONFIG_FRAGMENT( qix_video ) MCFG_VIDEO_START_OVERRIDE(qix_state,qix) - MCFG_MC6845_ADD(MC6845_TAG, MC6845, QIX_CHARACTER_CLOCK, mc6845_intf) + MCFG_MC6845_ADD(MC6845_TAG, MC6845, "screen", QIX_CHARACTER_CLOCK, mc6845_intf) MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_RAW_PARAMS(QIX_CHARACTER_CLOCK*8, 0x148, 0, 0x100, 0x111, 0, 0x100) /* from CRTC */ diff --git a/src/mame/video/seibu_crtc.c b/src/mame/video/seibu_crtc.c index 4b78f7dec4e5e..364193d2949a7 100644 --- a/src/mame/video/seibu_crtc.c +++ b/src/mame/video/seibu_crtc.c @@ -204,6 +204,7 @@ WRITE16_MEMBER( seibu_crtc_device::layer_scroll_w) seibu_crtc_device::seibu_crtc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, SEIBU_CRTC, "Seibu CRT Controller", tag, owner, clock, "seibu_crtc", __FILE__), device_memory_interface(mconfig, *this), + device_video_interface(mconfig, *this), m_space_config("vregs", ENDIANNESS_LITTLE, 16, 7, 0, NULL, *ADDRESS_MAP_NAME(seibu_crtc_vregs)) { } @@ -235,7 +236,6 @@ void seibu_crtc_device::device_config_complete() // or initialize to defaults if none provided else { - m_screen_tag = ""; // memset(&m_layer_en, 0, sizeof(m_layer_en)); } } @@ -246,7 +246,6 @@ void seibu_crtc_device::device_config_complete() void seibu_crtc_device::device_start() { - m_screen = machine().device(m_screen_tag); m_layer_en_func.resolve(m_layer_en_cb, *this); m_layer_scroll_func.resolve(m_layer_scroll_cb, *this); diff --git a/src/mame/video/seibu_crtc.h b/src/mame/video/seibu_crtc.h index 7740570b7d62a..45fe558206bd5 100644 --- a/src/mame/video/seibu_crtc.h +++ b/src/mame/video/seibu_crtc.h @@ -11,7 +11,6 @@ Template for skeleton device struct seibu_crtc_interface { - const char *m_screen_tag; devcb_write16 m_layer_en_cb; devcb_write16 m_layer_scroll_cb; @@ -37,6 +36,7 @@ struct seibu_crtc_interface class seibu_crtc_device : public device_t, public device_memory_interface, + public device_video_interface, public seibu_crtc_interface { public: @@ -60,7 +60,6 @@ class seibu_crtc_device : public device_t, virtual void device_reset(); virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const; - screen_device *m_screen; devcb_resolved_write16 m_layer_en_func; devcb_resolved_write16 m_layer_scroll_func; private: diff --git a/src/mame/video/taitoic.h b/src/mame/video/taitoic.h index 6d870c01287f1..7df3eb7a6126a 100644 --- a/src/mame/video/taitoic.h +++ b/src/mame/video/taitoic.h @@ -45,8 +45,6 @@ struct tc0080vco_interface struct tc0100scn_interface { - const char *m_screen_tag; - int m_gfxnum; int m_txnum; @@ -255,6 +253,7 @@ class tc0080vco_device : public device_t, extern const device_type TC0080VCO; class tc0100scn_device : public device_t, + public device_video_interface, public tc0100scn_interface { public: @@ -327,8 +326,6 @@ class tc0100scn_device : public device_t, INT32 m_bg0_colbank, m_bg1_colbank, m_tx_colbank; int m_dblwidth; - screen_device *m_screen; - TILE_GET_INFO_MEMBER(get_bg_tile_info); TILE_GET_INFO_MEMBER(get_fg_tile_info); TILE_GET_INFO_MEMBER(get_tx_tile_info); diff --git a/src/mame/video/tc0100scn.c b/src/mame/video/tc0100scn.c index a47f1d9d6de96..a6a9c5073f4be 100644 --- a/src/mame/video/tc0100scn.c +++ b/src/mame/video/tc0100scn.c @@ -121,6 +121,7 @@ const device_type TC0100SCN = &device_creator; tc0100scn_device::tc0100scn_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, TC0100SCN, "Taito TC0100SCN", tag, owner, clock, "tc0100scn", __FILE__), + device_video_interface(mconfig, *this), m_ram(NULL), m_bg_ram(NULL), m_fg_ram(NULL), @@ -141,8 +142,7 @@ tc0100scn_device::tc0100scn_device(const machine_config &mconfig, const char *ta m_bg0_colbank(0), m_bg1_colbank(0), m_tx_colbank(0), - m_dblwidth(0), - m_screen(NULL) + m_dblwidth(0) { } @@ -184,8 +184,6 @@ void tc0100scn_device::device_start() int xd, yd; - m_screen = machine().device(m_screen_tag); - /* Set up clipping for multi-TC0100SCN games. We assume this code won't ever affect single screen games: Thundfox is the only one of those with two chips, and diff --git a/src/mame/video/tc0100scn.h b/src/mame/video/tc0100scn.h index 56dc18b4cdc9b..5524085a42df4 100644 --- a/src/mame/video/tc0100scn.h +++ b/src/mame/video/tc0100scn.h @@ -3,8 +3,6 @@ struct tc0100scn_interface { - const char *m_screen_tag; - int m_gfxnum; int m_txnum; @@ -17,6 +15,7 @@ struct tc0100scn_interface }; class tc0100scn_device : public device_t, + public device_video_interface, public tc0100scn_interface { public: @@ -89,8 +88,6 @@ class tc0100scn_device : public device_t, INT32 m_bg0_colbank, m_bg1_colbank, m_tx_colbank; int m_dblwidth; - screen_device *m_screen; - TILE_GET_INFO_MEMBER(get_bg_tile_info); TILE_GET_INFO_MEMBER(get_fg_tile_info); TILE_GET_INFO_MEMBER(get_tx_tile_info); @@ -112,4 +109,6 @@ extern const device_type TC0100SCN; MCFG_DEVICE_ADD(_tag, TC0100SCN, 0) \ MCFG_DEVICE_CONFIG(_interface) +#define MCFG_TC0100SCN_SET_SCREEN MCFG_VIDEO_SET_SCREEN + #endif diff --git a/src/mame/video/twincobr.c b/src/mame/video/twincobr.c index 717dab05a7bc5..ac527391d9de7 100644 --- a/src/mame/video/twincobr.c +++ b/src/mame/video/twincobr.c @@ -20,7 +20,6 @@ /* 6845 used for video sync signals only */ MC6845_INTERFACE( twincobr_mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 2, /* number of pixels per video memory address */ /* Horizontal Display programmed to 160 characters */ NULL, /* before pixel update callback */ diff --git a/src/mame/video/vsnes.c b/src/mame/video/vsnes.c index e8007ab926252..6dbd69279788b 100644 --- a/src/mame/video/vsnes.c +++ b/src/mame/video/vsnes.c @@ -31,7 +31,6 @@ void vsnes_state::ppu_irq_2(int *ppu_regs) const ppu2c0x_interface vsnes_ppu_interface_1 = { "maincpu", - "screen1", 0, /* gfxlayout num */ 0, /* color base */ PPU_MIRROR_NONE /* mirroring */ @@ -41,7 +40,6 @@ const ppu2c0x_interface vsnes_ppu_interface_1 = const ppu2c0x_interface vsnes_ppu_interface_2 = { "sub", - "screen2", 1, /* gfxlayout num */ 512, /* color base */ PPU_MIRROR_NONE /* mirroring */ diff --git a/src/mess/drivers/a5105.c b/src/mess/drivers/a5105.c index 8ccea5953c7f1..554b830934689 100644 --- a/src/mess/drivers/a5105.c +++ b/src/mess/drivers/a5105.c @@ -535,7 +535,6 @@ void a5105_state::video_start() static UPD7220_INTERFACE( hgdc_intf ) { - "screen", hgdc_display_pixels, hgdc_draw_text, DEVCB_NULL, diff --git a/src/mess/drivers/a6809.c b/src/mess/drivers/a6809.c index 21fe94d0f5a09..048e779c48c5b 100644 --- a/src/mess/drivers/a6809.c +++ b/src/mess/drivers/a6809.c @@ -85,7 +85,6 @@ static MC6845_UPDATE_ROW( a6809_update_row ) static MC6845_INTERFACE( a6809_crtc6845_interface ) { - "screen", false, 12 /*?*/, NULL, @@ -196,7 +195,7 @@ static MACHINE_CONFIG_START( a6809, a6809_state ) /* Devices */ MCFG_VIA6522_ADD("via", XTAL_4MHz / 4, via_intf) - MCFG_MC6845_ADD("mc6845", MC6845, XTAL_4MHz / 2, a6809_crtc6845_interface) + MCFG_MC6845_ADD("mc6845", MC6845, "screen", XTAL_4MHz / 2, a6809_crtc6845_interface) MCFG_ASCII_KEYBOARD_ADD("keyboard", kb_intf) MCFG_CASSETTE_ADD( "cassette", default_cassette_interface ) MCFG_TIMER_DRIVER_ADD_PERIODIC("a6809_c", a6809_state, a6809_c, attotime::from_hz(4800)) diff --git a/src/mess/drivers/adam.c b/src/mess/drivers/adam.c index d9e3de5564778..db2bff612829a 100644 --- a/src/mess/drivers/adam.c +++ b/src/mess/drivers/adam.c @@ -970,7 +970,6 @@ WRITE_LINE_MEMBER( adam_state::vdc_int_w ) static TMS9928A_INTERFACE( vdc_intf ) { - SCREEN_TAG, 0x4000, DEVCB_DRIVER_LINE_MEMBER(adam_state, vdc_int_w) }; diff --git a/src/mess/drivers/alphatro.c b/src/mess/drivers/alphatro.c index 93d492f4271be..54fb6cbc6fc37 100644 --- a/src/mess/drivers/alphatro.c +++ b/src/mess/drivers/alphatro.c @@ -401,7 +401,6 @@ void alphatro_state::palette_init() static MC6845_INTERFACE( alphatro_crtc6845_interface ) { - "screen", false, 8, NULL, @@ -485,7 +484,7 @@ static MACHINE_CONFIG_START( alphatro, alphatro_state ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) /* Devices */ - MCFG_MC6845_ADD("crtc", MC6845, XTAL_12_288MHz / 8, alphatro_crtc6845_interface) // clk unknown + MCFG_MC6845_ADD("crtc", MC6845, "screen", XTAL_12_288MHz / 8, alphatro_crtc6845_interface) // clk unknown MCFG_I8251_ADD("usart", alphatro_usart_interface) diff --git a/src/mess/drivers/amstrad.c b/src/mess/drivers/amstrad.c index fa987ec7f78b8..08346a70f7997 100644 --- a/src/mess/drivers/amstrad.c +++ b/src/mess/drivers/amstrad.c @@ -856,7 +856,7 @@ static MACHINE_CONFIG_START( amstrad_nofdc, amstrad_state ) MCFG_PALETTE_LENGTH(32) MCFG_PALETTE_INIT_OVERRIDE(amstrad_state,amstrad_cpc) - MCFG_MC6845_ADD( "mc6845", MC6845, XTAL_16MHz / 16, amstrad_mc6845_intf ) + MCFG_MC6845_ADD( "mc6845", MC6845, NULL, XTAL_16MHz / 16, amstrad_mc6845_intf ) MCFG_VIDEO_START_OVERRIDE(amstrad_state,amstrad) @@ -930,7 +930,7 @@ static MACHINE_CONFIG_START( cpcplus, amstrad_state ) MCFG_PALETTE_LENGTH(4096) MCFG_PALETTE_INIT_OVERRIDE(amstrad_state,amstrad_plus) - MCFG_MC6845_ADD( "mc6845", MC6845, XTAL_40MHz / 40, amstrad_plus_mc6845_intf ) + MCFG_MC6845_ADD( "mc6845", MC6845, NULL, XTAL_40MHz / 40, amstrad_plus_mc6845_intf ) MCFG_VIDEO_START_OVERRIDE(amstrad_state,amstrad) @@ -989,7 +989,7 @@ static MACHINE_CONFIG_START( gx4000, amstrad_state ) MCFG_PALETTE_LENGTH(4096) MCFG_PALETTE_INIT_OVERRIDE(amstrad_state,amstrad_plus) - MCFG_MC6845_ADD( "mc6845", MC6845, XTAL_40MHz / 40, amstrad_plus_mc6845_intf ) + MCFG_MC6845_ADD( "mc6845", MC6845, NULL, XTAL_40MHz / 40, amstrad_plus_mc6845_intf ) MCFG_VIDEO_START_OVERRIDE(amstrad_state,amstrad) diff --git a/src/mess/drivers/apc.c b/src/mess/drivers/apc.c index fd6ea27915345..0f2c636c823d6 100644 --- a/src/mess/drivers/apc.c +++ b/src/mess/drivers/apc.c @@ -780,7 +780,6 @@ void apc_state::palette_init() static UPD7220_INTERFACE( hgdc_1_intf ) { - "screen", NULL, hgdc_draw_text, DEVCB_NULL, @@ -791,7 +790,6 @@ static UPD7220_INTERFACE( hgdc_1_intf ) static UPD7220_INTERFACE( hgdc_2_intf ) { - "screen", hgdc_display_pixels, NULL, DEVCB_NULL, diff --git a/src/mess/drivers/applix.c b/src/mess/drivers/applix.c index c14a0c6bd582d..c0372c0e2b94b 100644 --- a/src/mess/drivers/applix.c +++ b/src/mess/drivers/applix.c @@ -823,7 +823,6 @@ static MC6845_UPDATE_ROW( applix_update_row ) static MC6845_INTERFACE( applix_crtc ) { - "screen", /* name of screen */ false, // should show a border 8, /* number of dots per character */ NULL, @@ -921,7 +920,7 @@ static MACHINE_CONFIG_START( applix, applix_state ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50) /* Devices */ - MCFG_MC6845_ADD("crtc", MC6845, 1875000, applix_crtc) // 6545 + MCFG_MC6845_ADD("crtc", MC6845, "screen", 1875000, applix_crtc) // 6545 MCFG_VIA6522_ADD("via6522", 0, applix_via) MCFG_CENTRONICS_PRINTER_ADD("centronics", applix_centronics_config) MCFG_CASSETTE_ADD("cassette", applix_cassette_interface) diff --git a/src/mess/drivers/apricot.c b/src/mess/drivers/apricot.c index 7f91e2b39a42d..8cb9f8bd0334b 100644 --- a/src/mess/drivers/apricot.c +++ b/src/mess/drivers/apricot.c @@ -241,7 +241,6 @@ WRITE_LINE_MEMBER( apricot_state::apricot_mc6845_de ) static MC6845_INTERFACE( apricot_mc6845_intf ) { - "screen", false, 10, NULL, @@ -395,7 +394,7 @@ static MACHINE_CONFIG_START( apricot, apricot_state ) MCFG_RAM_EXTRA_OPTIONS("384k,512k") /* with 1 or 2 128k expansion boards */ /* Devices */ - MCFG_MC6845_ADD("ic30", MC6845, XTAL_15MHz / 10, apricot_mc6845_intf) + MCFG_MC6845_ADD("ic30", MC6845, "screen", XTAL_15MHz / 10, apricot_mc6845_intf) MCFG_I8255A_ADD("ic17", apricot_i8255a_intf) MCFG_PIC8259_ADD("ic31", INPUTLINE("maincpu",0), VCC, NULL) MCFG_PIT8253_ADD("ic16", apricot_pit8253_intf) diff --git a/src/mess/drivers/apricotp.c b/src/mess/drivers/apricotp.c index 581542fb36229..a11a0e498d29e 100644 --- a/src/mess/drivers/apricotp.c +++ b/src/mess/drivers/apricotp.c @@ -59,7 +59,6 @@ static MC6845_UPDATE_ROW( fp_update_row ) static MC6845_INTERFACE( crtc_intf ) { - SCREEN_CRT_TAG, false, 8, NULL, @@ -641,7 +640,7 @@ static MACHINE_CONFIG_START( fp, fp_state ) MCFG_PALETTE_LENGTH(16) MCFG_GFXDECODE(act_f1) - MCFG_MC6845_ADD(MC6845_TAG, MC6845, 4000000, crtc_intf) + MCFG_MC6845_ADD(MC6845_TAG, MC6845, SCREEN_CRT_TAG, 4000000, crtc_intf) // sound hardware MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mess/drivers/attache.c b/src/mess/drivers/attache.c index e09ad4b636883..b366c42048077 100644 --- a/src/mess/drivers/attache.c +++ b/src/mess/drivers/attache.c @@ -940,7 +940,6 @@ static const z80_daisy_config attache_daisy_chain[] = static const tms9927_interface crtc_interface = { - "screen", 8, // guessing for now NULL }; diff --git a/src/mess/drivers/b16.c b/src/mess/drivers/b16.c index e4c603380792d..d212238986d5e 100644 --- a/src/mess/drivers/b16.c +++ b/src/mess/drivers/b16.c @@ -253,7 +253,6 @@ void b16_state::machine_reset() static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -305,7 +304,7 @@ static MACHINE_CONFIG_START( b16, b16_state ) MCFG_SCREEN_SIZE(640, 400) MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 400-1) - MCFG_MC6845_ADD("crtc", H46505, XTAL_14_31818MHz/5, mc6845_intf) /* unknown clock, hand tuned to get ~60 fps */ + MCFG_MC6845_ADD("crtc", H46505, "screen", XTAL_14_31818MHz/5, mc6845_intf) /* unknown clock, hand tuned to get ~60 fps */ MCFG_I8237_ADD("8237dma", XTAL_14_31818MHz/2, b16_dma8237_interface) MCFG_GFXDECODE(b16) diff --git a/src/mess/drivers/bbc.c b/src/mess/drivers/bbc.c index af23ee653638d..5bfe3b0bc9836 100644 --- a/src/mess/drivers/bbc.c +++ b/src/mess/drivers/bbc.c @@ -868,7 +868,7 @@ static MACHINE_CONFIG_START( bbca, bbc_state ) MCFG_PALETTE_INIT_OVERRIDE(bbc_state,bbc) MCFG_SAA5050_ADD("saa505x", XTAL_12MHz/2, trom_intf) - MCFG_MC6845_ADD("mc6845",MC6845,2000000, bbc_mc6845_intf) + MCFG_MC6845_ADD("mc6845",MC6845,"screen",2000000, bbc_mc6845_intf) MCFG_VIDEO_START_OVERRIDE(bbc_state,bbca) @@ -963,7 +963,7 @@ static MACHINE_CONFIG_START( bbcm, bbc_state ) MCFG_SAA5050_ADD("saa505x", XTAL_12MHz/2, trom_intf) - MCFG_MC6845_ADD("mc6845",MC6845,2000000, bbc_mc6845_intf) + MCFG_MC6845_ADD("mc6845",MC6845,"screen",2000000, bbc_mc6845_intf) MCFG_VIDEO_START_OVERRIDE(bbc_state,bbcm) diff --git a/src/mess/drivers/bbcbc.c b/src/mess/drivers/bbcbc.c index be99563a24557..a21a0e2a56ba9 100644 --- a/src/mess/drivers/bbcbc.c +++ b/src/mess/drivers/bbcbc.c @@ -108,7 +108,6 @@ WRITE_LINE_MEMBER(bbcbc_state::tms_interrupt) static TMS9928A_INTERFACE(tms9129_interface) { - "screen", 0x4000, DEVCB_DRIVER_LINE_MEMBER(bbcbc_state, tms_interrupt) }; diff --git a/src/mess/drivers/bigbord2.c b/src/mess/drivers/bigbord2.c index 0dda0765d928c..1b7a5c98938f1 100644 --- a/src/mess/drivers/bigbord2.c +++ b/src/mess/drivers/bigbord2.c @@ -701,7 +701,6 @@ MC6845_UPDATE_ROW( bigbord2_update_row ) static MC6845_INTERFACE( bigbord2_crtc ) { - SCREEN_TAG, /* name of screen */ false, 8, /* number of dots per character */ NULL, @@ -744,7 +743,7 @@ static MACHINE_CONFIG_START( bigbord2, bigbord2_state ) MCFG_Z80CTC_ADD(Z80CTCB_TAG, MAIN_CLOCK / 6, ctcb_intf) MCFG_FD1793_ADD("fdc", fdc_intf) MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(bigbord2_floppy_interface) - MCFG_MC6845_ADD("crtc", MC6845, XTAL_16MHz / 8, bigbord2_crtc) + MCFG_MC6845_ADD("crtc", MC6845, SCREEN_TAG, XTAL_16MHz / 8, bigbord2_crtc) MCFG_ASCII_KEYBOARD_ADD(KEYBOARD_TAG, keyboard_intf) /* sound hardware */ diff --git a/src/mess/drivers/bml3.c b/src/mess/drivers/bml3.c index b4acc1898a44f..53f993e0a5dd1 100644 --- a/src/mess/drivers/bml3.c +++ b/src/mess/drivers/bml3.c @@ -703,7 +703,6 @@ INPUT_PORTS_END static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -1015,7 +1014,7 @@ static MACHINE_CONFIG_START( bml3_common, bml3_state ) /* Devices */ // CRTC clock should be synchronous with the CPU clock. - MCFG_MC6845_ADD("crtc", H46505, CPU_CLOCK, mc6845_intf) + MCFG_MC6845_ADD("crtc", H46505, "screen", CPU_CLOCK, mc6845_intf) // fire once per scan of an individual key // According to the service manual (p.65), the keyboard timer is driven by the horizontal video sync clock. MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard_timer", bml3_state, keyboard_callback, attotime::from_hz(H_CLOCK/2)) diff --git a/src/mess/drivers/bw12.c b/src/mess/drivers/bw12.c index 657ac56c3f2be..7f3df287ea9e1 100644 --- a/src/mess/drivers/bw12.c +++ b/src/mess/drivers/bw12.c @@ -355,7 +355,6 @@ static MC6845_UPDATE_ROW( bw12_update_row ) static MC6845_INTERFACE( bw12_mc6845_interface ) { - SCREEN_TAG, false, 8, NULL, @@ -665,7 +664,7 @@ static MACHINE_CONFIG_START( common, bw12_state ) MCFG_GFXDECODE(bw12) - MCFG_MC6845_ADD(MC6845_TAG, MC6845, XTAL_16MHz/8, bw12_mc6845_interface) + MCFG_MC6845_ADD(MC6845_TAG, MC6845, SCREEN_TAG, XTAL_16MHz/8, bw12_mc6845_interface) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mess/drivers/c128.c b/src/mess/drivers/c128.c index 1314dad0d56e7..350dadc490eaf 100644 --- a/src/mess/drivers/c128.c +++ b/src/mess/drivers/c128.c @@ -873,7 +873,6 @@ GFXDECODE_END static MC6845_INTERFACE( vdc_intf ) { - SCREEN_VDC_TAG, false, 8, NULL, diff --git a/src/mess/drivers/c65.c b/src/mess/drivers/c65.c index 180acf22c53af..e834cc201279b 100644 --- a/src/mess/drivers/c65.c +++ b/src/mess/drivers/c65.c @@ -362,7 +362,6 @@ READ8_MEMBER(c65_state::c65_c64_mem_r) } static const vic3_interface c65_vic3_ntsc_intf = { - "screen", "maincpu", VIC4567_NTSC, DEVCB_DRIVER_MEMBER(c65_state,c65_lightpen_x_cb), @@ -376,7 +375,6 @@ static const vic3_interface c65_vic3_ntsc_intf = { }; static const vic3_interface c65_vic3_pal_intf = { - "screen", "maincpu", VIC4567_PAL, DEVCB_DRIVER_MEMBER(c65_state,c65_lightpen_x_cb), diff --git a/src/mess/drivers/camplynx.c b/src/mess/drivers/camplynx.c index dcd17b40cef79..89452a913ba94 100644 --- a/src/mess/drivers/camplynx.c +++ b/src/mess/drivers/camplynx.c @@ -433,7 +433,6 @@ void camplynx_state::video_start() static MC6845_INTERFACE( lynx48k_crtc6845_interface ) { - "screen", false, 8, NULL, @@ -449,7 +448,6 @@ static MC6845_INTERFACE( lynx48k_crtc6845_interface ) static MC6845_INTERFACE( lynx128k_crtc6845_interface ) { - "screen", /* screen name */ false, 8, /* dots per character */ NULL, @@ -485,7 +483,7 @@ static MACHINE_CONFIG_START( lynx48k, camplynx_state ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.8) /* Devices */ - MCFG_MC6845_ADD("crtc", MC6845, XTAL_12MHz / 8 /*? dot clock divided by dots per char */, lynx48k_crtc6845_interface) + MCFG_MC6845_ADD("crtc", MC6845, "screen", XTAL_12MHz / 8 /*? dot clock divided by dots per char */, lynx48k_crtc6845_interface) MACHINE_CONFIG_END static MACHINE_CONFIG_START( lynx128k, camplynx_state ) @@ -512,7 +510,7 @@ static MACHINE_CONFIG_START( lynx128k, camplynx_state ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.8) /* Devices */ - MCFG_MC6845_ADD("crtc", MC6845, XTAL_12MHz / 8 /*? dot clock divided by dots per char */, lynx128k_crtc6845_interface) + MCFG_MC6845_ADD("crtc", MC6845, "screen", XTAL_12MHz / 8 /*? dot clock divided by dots per char */, lynx128k_crtc6845_interface) MACHINE_CONFIG_END DRIVER_INIT_MEMBER(camplynx_state,lynx48k) diff --git a/src/mess/drivers/cbm2.c b/src/mess/drivers/cbm2.c index fce11759cda5b..ff0663b3a7496 100644 --- a/src/mess/drivers/cbm2.c +++ b/src/mess/drivers/cbm2.c @@ -1130,7 +1130,6 @@ static MC6845_UPDATE_ROW( crtc_update_row ) static MC6845_INTERFACE( crtc_intf ) { - SCREEN_TAG, false, 9, NULL, @@ -2296,7 +2295,7 @@ static MACHINE_CONFIG_START( cbm2lp_ntsc, cbm2_state ) MCFG_SCREEN_SIZE(768, 312) MCFG_SCREEN_VISIBLE_AREA(0, 768-1, 0, 312-1) - MCFG_MC6845_ADD(MC68B45_TAG, MC6845, XTAL_18MHz/9, crtc_intf) + MCFG_MC6845_ADD(MC68B45_TAG, MC6845, SCREEN_TAG, XTAL_18MHz/9, crtc_intf) // sound hardware MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mess/drivers/coleco.c b/src/mess/drivers/coleco.c index 04128229adbe8..f6f69ea7eff77 100644 --- a/src/mess/drivers/coleco.c +++ b/src/mess/drivers/coleco.c @@ -233,7 +233,6 @@ TIMER_DEVICE_CALLBACK_MEMBER(coleco_state::paddle_update_callback) static TMS9928A_INTERFACE(coleco_tms9928a_interface) { - "screen", 0x4000, DEVCB_DRIVER_LINE_MEMBER(coleco_state,coleco_vdp_interrupt) }; diff --git a/src/mess/drivers/compis.c b/src/mess/drivers/compis.c index 572fc931b6631..fb2451df97f43 100644 --- a/src/mess/drivers/compis.c +++ b/src/mess/drivers/compis.c @@ -135,7 +135,6 @@ static UPD7220_DISPLAY_PIXELS( hgdc_display_pixels ) static UPD7220_INTERFACE( hgdc_intf ) { - "screen", hgdc_display_pixels, NULL, DEVCB_NULL, diff --git a/src/mess/drivers/cortex.c b/src/mess/drivers/cortex.c index c35520fd656d5..a4d1ef0f1f509 100644 --- a/src/mess/drivers/cortex.c +++ b/src/mess/drivers/cortex.c @@ -81,7 +81,6 @@ static const struct tms9995reset_param cortex_processor_config = static TMS9928A_INTERFACE(cortex_tms9929a_interface) { - "screen", // screen tag 0x4000, // vram size DEVCB_NULL // write line if int changes }; diff --git a/src/mess/drivers/crvision.c b/src/mess/drivers/crvision.c index 2c4417d1a487e..cd8d15c93fc63 100644 --- a/src/mess/drivers/crvision.c +++ b/src/mess/drivers/crvision.c @@ -499,7 +499,6 @@ INPUT_PORTS_END static TMS9928A_INTERFACE( vdp_intf ) { - SCREEN_TAG, 0x4000, DEVCB_CPU_INPUT_LINE(M6502_TAG, INPUT_LINE_IRQ0) }; diff --git a/src/mess/drivers/dgn_beta.c b/src/mess/drivers/dgn_beta.c index 88eeb746d3889..5ce16d3a115d5 100644 --- a/src/mess/drivers/dgn_beta.c +++ b/src/mess/drivers/dgn_beta.c @@ -348,7 +348,7 @@ static MACHINE_CONFIG_START( dgnbeta, dgn_beta_state ) MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(dgnbeta_floppy_interface) - MCFG_MC6845_ADD("crtc", HD6845, XTAL_12_288MHz / 16, dgnbeta_crtc6845_interface) //XTAL is guessed + MCFG_MC6845_ADD("crtc", HD6845, "screen", XTAL_12_288MHz / 16, dgnbeta_crtc6845_interface) //XTAL is guessed /* internal ram */ MCFG_RAM_ADD(RAM_TAG) diff --git a/src/mess/drivers/dim68k.c b/src/mess/drivers/dim68k.c index 0d1532644e48d..681993679e0d9 100644 --- a/src/mess/drivers/dim68k.c +++ b/src/mess/drivers/dim68k.c @@ -292,7 +292,6 @@ GFXDECODE_END static MC6845_INTERFACE( dim68k_crtc ) { - "screen", /* name of screen */ false, 8, /* number of dots per character - switchable 7 or 8 */ NULL, @@ -344,7 +343,7 @@ static MACHINE_CONFIG_START( dim68k, dim68k_state ) MCFG_UPD765A_ADD("fdc", true, true) // these options unknown MCFG_FLOPPY_DRIVE_ADD("fdc:0", dim68k_floppies, "525hd", floppy_image_device::default_floppy_formats) MCFG_FLOPPY_DRIVE_ADD("fdc:1", dim68k_floppies, "525hd", floppy_image_device::default_floppy_formats) - MCFG_MC6845_ADD("crtc", MC6845, 1790000, dim68k_crtc) + MCFG_MC6845_ADD("crtc", MC6845, "screen", 1790000, dim68k_crtc) MCFG_ASCII_KEYBOARD_ADD("keyboard", kb_intf) MACHINE_CONFIG_END diff --git a/src/mess/drivers/dmv.c b/src/mess/drivers/dmv.c index dab479967c3b8..ce91aebd07fd5 100644 --- a/src/mess/drivers/dmv.c +++ b/src/mess/drivers/dmv.c @@ -264,7 +264,6 @@ GFXDECODE_END static UPD7220_INTERFACE( hgdc_intf ) { - "screen", hgdc_display_pixels, hgdc_draw_text, DEVCB_NULL, diff --git a/src/mess/drivers/ec65.c b/src/mess/drivers/ec65.c index a65a87fc5946a..e85c285b4c072 100644 --- a/src/mess/drivers/ec65.c +++ b/src/mess/drivers/ec65.c @@ -216,7 +216,6 @@ static MC6845_UPDATE_ROW( ec65_update_row ) static MC6845_INTERFACE( ec65_crtc6845_interface ) { - "screen", false, 8 /*?*/, NULL, @@ -267,7 +266,7 @@ static MACHINE_CONFIG_START( ec65, ec65_state ) MCFG_PALETTE_LENGTH(2) MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white) - MCFG_MC6845_ADD(MC6845_TAG, MC6845, XTAL_16MHz / 8, ec65_crtc6845_interface) + MCFG_MC6845_ADD(MC6845_TAG, MC6845, "screen", XTAL_16MHz / 8, ec65_crtc6845_interface) /* devices */ @@ -298,7 +297,7 @@ static MACHINE_CONFIG_START( ec65k, ec65_state ) MCFG_PALETTE_LENGTH(2) MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white) - MCFG_MC6845_ADD(MC6845_TAG, MC6845, XTAL_16MHz / 8, ec65_crtc6845_interface) + MCFG_MC6845_ADD(MC6845_TAG, MC6845, "screen", XTAL_16MHz / 8, ec65_crtc6845_interface) MACHINE_CONFIG_END diff --git a/src/mess/drivers/einstein.c b/src/mess/drivers/einstein.c index c5e5ddd5b935c..f36af1c7ba2fc 100644 --- a/src/mess/drivers/einstein.c +++ b/src/mess/drivers/einstein.c @@ -383,7 +383,6 @@ WRITE8_MEMBER(einstein_state::einstein_fire_int_w) static TMS9928A_INTERFACE(einstein_tms9929a_interface) { - "screen", 0x4000, /* 16k RAM, provided by IC i040 and i041 */ DEVCB_NULL }; @@ -695,7 +694,6 @@ static const centronics_interface einstein_centronics_config = static MC6845_INTERFACE( einstein_crtc6845_interface ) { - "80column", false, 8, NULL, @@ -756,6 +754,7 @@ static MACHINE_CONFIG_START( einstein, einstein_state ) /* video hardware */ MCFG_TMS9928A_ADD( "tms9929a", TMS9929A, einstein_tms9929a_interface ) + MCFG_TMS9928A_SET_SCREEN( "screen" ) MCFG_TMS9928A_SCREEN_ADD_PAL( "screen" ) MCFG_SCREEN_UPDATE_DEVICE( "tms9929a", tms9929a_device, screen_update ) @@ -810,7 +809,7 @@ static MACHINE_CONFIG_DERIVED( einstei2, einstein ) /* 2 additional colors for the 80 column screen */ MCFG_PALETTE_LENGTH(TMS9928A_PALETTE_SIZE + 2) - MCFG_MC6845_ADD("crtc", MC6845, XTAL_X002 / 4, einstein_crtc6845_interface) + MCFG_MC6845_ADD("crtc", MC6845, "80column", XTAL_X002 / 4, einstein_crtc6845_interface) MACHINE_CONFIG_END diff --git a/src/mess/drivers/fp1100.c b/src/mess/drivers/fp1100.c index 4bdc4bbd2aa16..5110b805808f8 100644 --- a/src/mess/drivers/fp1100.c +++ b/src/mess/drivers/fp1100.c @@ -320,7 +320,6 @@ static const UPD7810_CONFIG fp1100_slave_cpu_config = { TYPE_7801, NULL }; static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -364,7 +363,7 @@ static MACHINE_CONFIG_START( fp1100, fp1100_state ) MCFG_GFXDECODE(fp1100) /* Devices */ - MCFG_MC6845_ADD("crtc", H46505, MAIN_CLOCK/2, mc6845_intf) /* hand tuned to get ~60 fps */ + MCFG_MC6845_ADD("crtc", H46505, "screen", MAIN_CLOCK/2, mc6845_intf) /* hand tuned to get ~60 fps */ MACHINE_CONFIG_END /* ROM definition */ diff --git a/src/mess/drivers/fp6000.c b/src/mess/drivers/fp6000.c index 5f4ed501f9e1f..2518acd26bacc 100644 --- a/src/mess/drivers/fp6000.c +++ b/src/mess/drivers/fp6000.c @@ -284,7 +284,6 @@ void fp6000_state::machine_reset() static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -312,7 +311,7 @@ static MACHINE_CONFIG_START( fp6000, fp6000_state ) MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) MCFG_SCREEN_UPDATE_DRIVER(fp6000_state, screen_update_fp6000) - MCFG_MC6845_ADD("crtc", H46505, 16000000/5, mc6845_intf) /* unknown clock, hand tuned to get ~60 fps */ + MCFG_MC6845_ADD("crtc", H46505, "screen", 16000000/5, mc6845_intf) /* unknown clock, hand tuned to get ~60 fps */ MCFG_PALETTE_LENGTH(8) // MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white) diff --git a/src/mess/drivers/h19.c b/src/mess/drivers/h19.c index 6f93b5fef31d7..7f091214cbd74 100644 --- a/src/mess/drivers/h19.c +++ b/src/mess/drivers/h19.c @@ -367,7 +367,6 @@ static const ins8250_interface h19_ace_interface = static MC6845_INTERFACE( h19_crtc6845_interface ) { - "screen", false, 8 /*?*/, NULL, @@ -427,7 +426,7 @@ static MACHINE_CONFIG_START( h19, h19_state ) MCFG_PALETTE_LENGTH(2) MCFG_PALETTE_INIT_OVERRIDE(driver_device, monochrome_green) - MCFG_MC6845_ADD("crtc", MC6845, XTAL_12_288MHz / 8, h19_crtc6845_interface) // clk taken from schematics + MCFG_MC6845_ADD("crtc", MC6845, "screen", XTAL_12_288MHz / 8, h19_crtc6845_interface) // clk taken from schematics MCFG_INS8250_ADD( "ins8250", h19_ace_interface, XTAL_12_288MHz / 4) // 3.072mhz clock which gets divided down for the various baud rates MCFG_ASCII_KEYBOARD_ADD(KEYBOARD_TAG, keyboard_intf) diff --git a/src/mess/drivers/hp9k.c b/src/mess/drivers/hp9k.c index a62e6226d548e..86428c1deb7ad 100644 --- a/src/mess/drivers/hp9k.c +++ b/src/mess/drivers/hp9k.c @@ -138,7 +138,7 @@ class hp9k_state : public driver_device required_device m_6845; UINT8 m_videoram[0x4000]; - UINT8 m_screen[0x800]; + UINT8 m_screenram[0x800]; DECLARE_DRIVER_INIT(hp9k); @@ -271,7 +271,7 @@ WRITE16_MEMBER( hp9k_state::hp9k_videoram_w ) if (mem_mask==0xff00) { - m_screen[offset&0x7ff]=data>>8; + m_screenram[offset&0x7ff]=data>>8; m_videoram[offset&0x3fff]=data>>8; //UINT8 *rom = machine().region("bootrom")->base(); @@ -279,7 +279,7 @@ WRITE16_MEMBER( hp9k_state::hp9k_videoram_w ) } else { - m_screen[offset&0x7ff]=data; + m_screenram[offset&0x7ff]=data; m_videoram[offset&0x3fff]=data; } } @@ -359,7 +359,7 @@ void hp9k_state::putChar(UINT8 thec,int x,int y,bitmap_ind16 &bitmap) UINT32 hp9k_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - //UINT8* pvram=&m_screen[1]; + //UINT8* pvram=&m_screenram[1]; int startAddr=((crtc_addrStartLow&0xff)|((crtc_addrStartHi<<8)))&0x3fff; int chStart=startAddr&0x1fff; @@ -370,7 +370,7 @@ UINT32 hp9k_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, co { //UINT8 thec=pvram[((c+(r*80))+160+47)&0x7ff]; //UINT8 thec=m_videoram[((c+(r*80))+startAddr)]; - UINT8 thec=m_screen[chStart&0x7ff]; + UINT8 thec=m_screenram[chStart&0x7ff]; putChar(thec,c,r,bitmap); chStart++; } @@ -388,7 +388,6 @@ WRITE8_MEMBER( hp9k_state::kbd_put ) static MC6845_INTERFACE( hp9k_mc6845_intf ) { - "screen", /* name of screen */ false, 8, /* number of dots per character */ NULL, @@ -420,7 +419,7 @@ static MACHINE_CONFIG_START( hp9k, hp9k_state ) MCFG_PALETTE_LENGTH(2) MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white) - MCFG_MC6845_ADD( "mc6845", MC6845, XTAL_16MHz / 16, hp9k_mc6845_intf ) + MCFG_MC6845_ADD( "mc6845", MC6845, "screen", XTAL_16MHz / 16, hp9k_mc6845_intf ) MACHINE_CONFIG_END /* ROM definition */ diff --git a/src/mess/drivers/if800.c b/src/mess/drivers/if800.c index 4b73288909f26..eb5004cb9a130 100644 --- a/src/mess/drivers/if800.c +++ b/src/mess/drivers/if800.c @@ -74,7 +74,6 @@ void if800_state::machine_reset() static UPD7220_INTERFACE( hgdc_intf ) { - "screen", hgdc_display_pixels, NULL, DEVCB_NULL, diff --git a/src/mess/drivers/ipds.c b/src/mess/drivers/ipds.c index 451b00a9a3d6b..c3c00873971da 100644 --- a/src/mess/drivers/ipds.c +++ b/src/mess/drivers/ipds.c @@ -98,7 +98,6 @@ static I8275_DISPLAY_PIXELS(ipds_display_pixels) const i8275_interface ipds_i8275_interface = { - "screen", 6, 0, DEVCB_NULL, diff --git a/src/mess/drivers/kaypro.c b/src/mess/drivers/kaypro.c index 4da7a62257a45..37f9ec3d3549b 100644 --- a/src/mess/drivers/kaypro.c +++ b/src/mess/drivers/kaypro.c @@ -151,7 +151,6 @@ static const z80_daisy_config kaypro2x_daisy_chain[] = static MC6845_INTERFACE( kaypro2x_crtc ) { - "screen", /* name of screen */ false, 7, /* number of dots per character */ NULL, @@ -295,7 +294,7 @@ static MACHINE_CONFIG_START( kaypro2x, kaypro_state ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) /* devices */ - MCFG_MC6845_ADD("crtc", MC6845, 2000000, kaypro2x_crtc) /* comes out of ULA - needs to be measured */ + MCFG_MC6845_ADD("crtc", MC6845, "screen", 2000000, kaypro2x_crtc) /* comes out of ULA - needs to be measured */ MCFG_QUICKLOAD_ADD("quickload", kaypro_state, kaypro2x, "com,cpm", 3) MCFG_FD1793_ADD("wd1793", kaypro_wd1793_interface ) MCFG_CENTRONICS_PRINTER_ADD("centronics", standard_centronics) diff --git a/src/mess/drivers/m20.c b/src/mess/drivers/m20.c index eb9136dabb744..b1a2ef6b76ea4 100644 --- a/src/mess/drivers/m20.c +++ b/src/mess/drivers/m20.c @@ -835,7 +835,6 @@ void m20_state::machine_reset() static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 16, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -991,7 +990,7 @@ static MACHINE_CONFIG_START( m20, m20_state ) MCFG_FD1797x_ADD("fd1797", 1000000) MCFG_FLOPPY_DRIVE_ADD("fd1797:0", m20_floppies, "5dd", m20_state::floppy_formats) MCFG_FLOPPY_DRIVE_ADD("fd1797:1", m20_floppies, "5dd", m20_state::floppy_formats) - MCFG_MC6845_ADD("crtc", MC6845, PIXEL_CLOCK/8, mc6845_intf) /* hand tuned to get ~50 fps */ + MCFG_MC6845_ADD("crtc", MC6845, "screen", PIXEL_CLOCK/8, mc6845_intf) /* hand tuned to get ~50 fps */ MCFG_I8255A_ADD("ppi8255", ppi_interface) MCFG_I8251_ADD("i8251_1", kbd_i8251_intf) MCFG_I8251_ADD("i8251_2", tty_i8251_intf) diff --git a/src/mess/drivers/m5.c b/src/mess/drivers/m5.c index 4d375d89ef61d..612f99ec9864a 100644 --- a/src/mess/drivers/m5.c +++ b/src/mess/drivers/m5.c @@ -440,7 +440,6 @@ WRITE_LINE_MEMBER(m5_state::sordm5_video_interrupt_callback) static TMS9928A_INTERFACE(m5_tms9928a_interface) { - "screen", 0x4000, DEVCB_DRIVER_LINE_MEMBER(m5_state,sordm5_video_interrupt_callback) }; diff --git a/src/mess/drivers/mbc200.c b/src/mess/drivers/mbc200.c index de11198e8b84a..800194f61f754 100644 --- a/src/mess/drivers/mbc200.c +++ b/src/mess/drivers/mbc200.c @@ -139,7 +139,6 @@ MC6845_UPDATE_ROW( mbc200_update_row ) static MC6845_INTERFACE( mbc200_crtc ) { - "screen", /* name of screen */ false, 8, /* number of dots per character */ NULL, @@ -274,7 +273,7 @@ static MACHINE_CONFIG_START( mbc200, mbc200_state ) MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white) - MCFG_MC6845_ADD("crtc", H46505, XTAL_8MHz / 4, mbc200_crtc) // HD46505SP + MCFG_MC6845_ADD("crtc", H46505, "screen", XTAL_8MHz / 4, mbc200_crtc) // HD46505SP MCFG_I8255_ADD("ppi8255_1", mbc200_ppi8255_interface_1) // i8255AC-5 MCFG_I8255_ADD("ppi8255_2", mbc200_ppi8255_interface_2) // i8255AC-5 MCFG_I8251_ADD("i8251_1", default_i8251_interface) // INS8251N diff --git a/src/mess/drivers/mbc55x.c b/src/mess/drivers/mbc55x.c index 4e72f8a8e9759..e7d8caaa0ce47 100644 --- a/src/mess/drivers/mbc55x.c +++ b/src/mess/drivers/mbc55x.c @@ -261,7 +261,7 @@ static MACHINE_CONFIG_START( mbc55x, mbc55x_state ) MCFG_PIT8253_ADD( PIT8253_TAG, mbc55x_pit8253_config ) MCFG_PIC8259_ADD( PIC8259_TAG, INPUTLINE(MAINCPU_TAG, INPUT_LINE_IRQ0), VCC, NULL ) MCFG_I8255_ADD( PPI8255_TAG, mbc55x_ppi8255_interface ) - MCFG_MC6845_ADD(VID_MC6845_NAME, MC6845, XTAL_14_31818MHz/8, mb55x_mc6845_intf) + MCFG_MC6845_ADD(VID_MC6845_NAME, MC6845, SCREEN_TAG, XTAL_14_31818MHz/8, mb55x_mc6845_intf) /* Backing storage */ MCFG_FD1793_ADD(FDC_TAG, mbc55x_wd17xx_interface ) diff --git a/src/mess/drivers/mbee.c b/src/mess/drivers/mbee.c index f0e901a11c90a..42e441a099651 100644 --- a/src/mess/drivers/mbee.c +++ b/src/mess/drivers/mbee.c @@ -659,7 +659,6 @@ SLOT_INTERFACE_END static MC6845_INTERFACE( mbee_crtc ) { - "screen", /* name of screen */ false, 8, /* number of dots per character */ NULL, @@ -675,7 +674,6 @@ static MC6845_INTERFACE( mbee_crtc ) static MC6845_INTERFACE( mbeeic_crtc ) { - "screen", /* name of screen */ false, 8, /* number of dots per character */ NULL, @@ -690,7 +688,6 @@ static MC6845_INTERFACE( mbeeic_crtc ) static MC6845_INTERFACE( mbeeppc_crtc ) { - "screen", /* name of screen */ false, 8, /* number of dots per character */ NULL, @@ -705,7 +702,6 @@ static MC6845_INTERFACE( mbeeppc_crtc ) static MC6845_INTERFACE( mbee256_crtc ) { - "screen", /* name of screen */ false, 8, /* number of dots per character */ NULL, @@ -750,7 +746,7 @@ static MACHINE_CONFIG_START( mbee, mbee_state ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) /* devices */ - MCFG_MC6845_ADD("crtc", SY6545_1, XTAL_12MHz / 8, mbee_crtc) + MCFG_MC6845_ADD("crtc", SY6545_1, "screen", XTAL_12MHz / 8, mbee_crtc) MCFG_QUICKLOAD_ADD("quickload", mbee_state, mbee, "mwb,com", 2) MCFG_QUICKLOAD_ADD("quickload2", mbee_state, mbee_z80bin, "bin", 2) MCFG_CENTRONICS_PRINTER_ADD("centronics", standard_centronics) @@ -791,7 +787,7 @@ static MACHINE_CONFIG_START( mbeeic, mbee_state ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) /* devices */ - MCFG_MC6845_ADD("crtc", SY6545_1, XTAL_13_5MHz / 8, mbeeic_crtc) + MCFG_MC6845_ADD("crtc", SY6545_1, "screen", XTAL_13_5MHz / 8, mbeeic_crtc) MCFG_QUICKLOAD_ADD("quickload", mbee_state, mbee, "mwb,com", 2) MCFG_QUICKLOAD_ADD("quickload2", mbee_state, mbee_z80bin, "bin", 2) MCFG_CENTRONICS_PRINTER_ADD("centronics", standard_centronics) @@ -823,7 +819,7 @@ static MACHINE_CONFIG_DERIVED( mbeeppc, mbeeic ) MCFG_PALETTE_LENGTH(16) MCFG_PALETTE_INIT_OVERRIDE(mbee_state,mbeeppc) MCFG_DEVICE_REMOVE("crtc") - MCFG_MC6845_ADD("crtc", SY6545_1, XTAL_13_5MHz / 8, mbeeppc_crtc) + MCFG_MC6845_ADD("crtc", SY6545_1, "screen", XTAL_13_5MHz / 8, mbeeppc_crtc) MACHINE_CONFIG_END static MACHINE_CONFIG_DERIVED( mbee56, mbeeic ) @@ -859,7 +855,7 @@ static MACHINE_CONFIG_DERIVED( mbee256, mbee128 ) MCFG_MACHINE_RESET_OVERRIDE(mbee_state, mbee256 ) MCFG_MC146818_ADD( "rtc", MC146818_STANDARD ) MCFG_DEVICE_REMOVE("crtc") - MCFG_MC6845_ADD("crtc", SY6545_1, XTAL_13_5MHz / 8, mbee256_crtc) + MCFG_MC6845_ADD("crtc", SY6545_1, "screen", XTAL_13_5MHz / 8, mbee256_crtc) MACHINE_CONFIG_END static MACHINE_CONFIG_DERIVED( mbeett, mbeeppc ) @@ -869,7 +865,7 @@ static MACHINE_CONFIG_DERIVED( mbeett, mbeeppc ) MCFG_MACHINE_RESET_OVERRIDE(mbee_state, mbeett ) MCFG_MC146818_ADD( "rtc", MC146818_STANDARD ) MCFG_DEVICE_REMOVE("crtc") - MCFG_MC6845_ADD("crtc", SY6545_1, XTAL_13_5MHz / 8, mbee256_crtc) + MCFG_MC6845_ADD("crtc", SY6545_1, "screen", XTAL_13_5MHz / 8, mbee256_crtc) MACHINE_CONFIG_END /* Unused roms: diff --git a/src/mess/drivers/mc10.c b/src/mess/drivers/mc10.c index d744884431c08..e1d397c873c62 100644 --- a/src/mess/drivers/mc10.c +++ b/src/mess/drivers/mc10.c @@ -529,11 +529,6 @@ static MACHINE_CONFIG_START( mc10, mc10_state ) MCFG_RAM_EXTRA_OPTIONS("4K") MACHINE_CONFIG_END -static const ef9345_interface alice32_ef9345_config = -{ - "screen" /* screen we are acting on */ -}; - static MACHINE_CONFIG_START( alice32, mc10_state ) /* basic machine hardware */ @@ -549,7 +544,7 @@ static MACHINE_CONFIG_START( alice32, mc10_state ) MCFG_SCREEN_VISIBLE_AREA(00, 336-1, 00, 270-1) MCFG_PALETTE_LENGTH(8) - MCFG_EF9345_ADD("ef9345", alice32_ef9345_config) + MCFG_EF9345_ADD("ef9345", "screen") MCFG_TIMER_DRIVER_ADD_SCANLINE("alice32_sl", mc10_state, alice32_scanline, "screen", 0, 10) /* sound hardware */ diff --git a/src/mess/drivers/micronic.c b/src/mess/drivers/micronic.c index ffce7eb764866..ab87ec56dc724 100644 --- a/src/mess/drivers/micronic.c +++ b/src/mess/drivers/micronic.c @@ -330,7 +330,6 @@ void micronic_state::palette_init() static HD61830_INTERFACE( lcdc_intf ) { - SCREEN_TAG, DEVCB_NULL }; diff --git a/src/mess/drivers/msx.c b/src/mess/drivers/msx.c index 326852541d2f3..8ee2ca2f1fd77 100644 --- a/src/mess/drivers/msx.c +++ b/src/mess/drivers/msx.c @@ -1111,7 +1111,6 @@ MACHINE_CONFIG_END static TMS9928A_INTERFACE(msx_tms9928a_interface) { - "screen", 0x4000, DEVCB_CPU_INPUT_LINE("maincpu", INPUT_LINE_IRQ0) }; diff --git a/src/mess/drivers/mtx.c b/src/mess/drivers/mtx.c index 4afad71c965d0..408a1bd4dc3e1 100644 --- a/src/mess/drivers/mtx.c +++ b/src/mess/drivers/mtx.c @@ -323,7 +323,6 @@ WRITE_LINE_MEMBER(mtx_state::mtx_tms9929a_interrupt) static TMS9928A_INTERFACE(mtx_tms9928a_interface) { - "screen", 0x4000, DEVCB_DRIVER_LINE_MEMBER(mtx_state,mtx_tms9929a_interrupt) }; diff --git a/src/mess/drivers/multi16.c b/src/mess/drivers/multi16.c index f1204faaf38fe..7766f965795de 100644 --- a/src/mess/drivers/multi16.c +++ b/src/mess/drivers/multi16.c @@ -141,7 +141,6 @@ void multi16_state::machine_reset() static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -171,7 +170,7 @@ static MACHINE_CONFIG_START( multi16, multi16_state ) MCFG_PALETTE_LENGTH(8) /* Devices */ - MCFG_MC6845_ADD("crtc", H46505, 16000000/5, mc6845_intf) /* unknown clock, hand tuned to get ~60 fps */ + MCFG_MC6845_ADD("crtc", H46505, "screen", 16000000/5, mc6845_intf) /* unknown clock, hand tuned to get ~60 fps */ MCFG_PIC8259_ADD( "pic8259", WRITELINE(multi16_state, multi16_set_int_line), GND, NULL ) MACHINE_CONFIG_END diff --git a/src/mess/drivers/multi8.c b/src/mess/drivers/multi8.c index 66c221704d10e..63b940dcb0f4d 100644 --- a/src/mess/drivers/multi8.c +++ b/src/mess/drivers/multi8.c @@ -560,7 +560,6 @@ GFXDECODE_END static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -684,7 +683,7 @@ static MACHINE_CONFIG_START( multi8, multi8_state ) /* Devices */ MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard_timer", multi8_state, keyboard_callback, attotime::from_hz(240/32)) - MCFG_MC6845_ADD("crtc", H46505, XTAL_3_579545MHz/2, mc6845_intf) /* unknown clock, hand tuned to get ~60 fps */ + MCFG_MC6845_ADD("crtc", H46505, "screen", XTAL_3_579545MHz/2, mc6845_intf) /* unknown clock, hand tuned to get ~60 fps */ MCFG_I8255_ADD( "ppi8255_0", ppi8255_intf_0 ) MACHINE_CONFIG_END diff --git a/src/mess/drivers/myb3k.c b/src/mess/drivers/myb3k.c index 1294cbf1ceeca..fbb81323c0bd7 100644 --- a/src/mess/drivers/myb3k.c +++ b/src/mess/drivers/myb3k.c @@ -232,7 +232,6 @@ GFXDECODE_END static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -287,7 +286,7 @@ static MACHINE_CONFIG_START( myb3k, myb3k_state ) MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white) /* Devices */ - MCFG_MC6845_ADD("crtc", H46505, XTAL_3_579545MHz/4, mc6845_intf) /* unknown clock, hand tuned to get ~60 fps */ + MCFG_MC6845_ADD("crtc", H46505, "screen", XTAL_3_579545MHz/4, mc6845_intf) /* unknown clock, hand tuned to get ~60 fps */ MCFG_MB8877_ADD("fdc", myb3k_wd17xx_interface ) //unknown type MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(myb3k_floppy_interface) MACHINE_CONFIG_END diff --git a/src/mess/drivers/mycom.c b/src/mess/drivers/mycom.c index 2508496ee78a4..c9e09d6a75cb8 100644 --- a/src/mess/drivers/mycom.c +++ b/src/mess/drivers/mycom.c @@ -333,7 +333,6 @@ GFXDECODE_END static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -604,7 +603,7 @@ static MACHINE_CONFIG_START( mycom, mycom_state ) /* Manual states clock is 1.008mhz for 40 cols, and 2.016 mhz for 80 cols. The CRTC is a HD46505S - same as a 6845. The start registers need to be readable. */ - MCFG_MC6845_ADD("crtc", MC6845, 1008000, mc6845_intf) + MCFG_MC6845_ADD("crtc", MC6845, "screen", 1008000, mc6845_intf) MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") diff --git a/src/mess/drivers/mz3500.c b/src/mess/drivers/mz3500.c index bfa9832e9c383..56b13ce1c8ecb 100644 --- a/src/mess/drivers/mz3500.c +++ b/src/mess/drivers/mz3500.c @@ -238,7 +238,6 @@ UINT32 mz3500_state::screen_update( screen_device &screen, bitmap_rgb32 &bitmap, static UPD7220_INTERFACE( hgdc_1_intf ) { - "screen", NULL, hgdc_draw_text, DEVCB_NULL, @@ -248,7 +247,6 @@ static UPD7220_INTERFACE( hgdc_1_intf ) static UPD7220_INTERFACE( hgdc_2_intf ) { - "screen", hgdc_display_pixels, NULL, DEVCB_NULL, diff --git a/src/mess/drivers/mz6500.c b/src/mess/drivers/mz6500.c index 0507a5cebd98c..49720c5bc817e 100644 --- a/src/mess/drivers/mz6500.c +++ b/src/mess/drivers/mz6500.c @@ -127,7 +127,6 @@ SLOT_INTERFACE_END static UPD7220_INTERFACE( hgdc_intf ) { - "screen", hgdc_display_pixels, NULL, DEVCB_NULL, diff --git a/src/mess/drivers/nes.c b/src/mess/drivers/nes.c index 713fb515232af..0cd4a962a4396 100644 --- a/src/mess/drivers/nes.c +++ b/src/mess/drivers/nes.c @@ -662,7 +662,6 @@ void nes_state::ppu_nmi(int *ppu_regs) static const ppu2c0x_interface nes_ppu_interface = { "maincpu", - "screen", 0, 0, PPU_MIRROR_NONE diff --git a/src/mess/drivers/odyssey2.c b/src/mess/drivers/odyssey2.c index 5cb1b874fcbbe..917f87a015374 100644 --- a/src/mess/drivers/odyssey2.c +++ b/src/mess/drivers/odyssey2.c @@ -27,7 +27,6 @@ class odyssey2_state : public driver_device odyssey2_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_i8244(*this, "i8244"), m_sp0256(*this, "sp0256_speech"), m_user1(*this, "user1"), @@ -43,7 +42,6 @@ class odyssey2_state : public driver_device m_joy1(*this, "JOY1") { } required_device m_maincpu; - required_device m_screen; required_device m_i8244; required_device m_sp0256; diff --git a/src/mess/drivers/paso1600.c b/src/mess/drivers/paso1600.c index 389ee13823248..2aad38c19734c 100644 --- a/src/mess/drivers/paso1600.c +++ b/src/mess/drivers/paso1600.c @@ -270,7 +270,6 @@ GFXDECODE_END static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -353,7 +352,7 @@ static MACHINE_CONFIG_START( paso1600, paso1600_state ) // MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white) /* Devices */ - MCFG_MC6845_ADD("crtc", H46505, 16000000/4, mc6845_intf) /* unknown clock, hand tuned to get ~60 fps */ + MCFG_MC6845_ADD("crtc", H46505, "screen", 16000000/4, mc6845_intf) /* unknown clock, hand tuned to get ~60 fps */ MCFG_PIC8259_ADD( "pic8259", WRITELINE(paso1600_state, paso1600_set_int_line), GND, NULL ) MCFG_I8237_ADD("8237dma", 16000000/4, paso1600_dma8237_interface) MACHINE_CONFIG_END diff --git a/src/mess/drivers/pasopia.c b/src/mess/drivers/pasopia.c index 0159cf33b8169..a340f841c6023 100644 --- a/src/mess/drivers/pasopia.c +++ b/src/mess/drivers/pasopia.c @@ -303,7 +303,6 @@ static Z80PIO_INTERFACE( z80pio_intf ) static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -373,7 +372,7 @@ static MACHINE_CONFIG_START( pasopia, pasopia_state ) MCFG_PALETTE_LENGTH(8) /* Devices */ - MCFG_MC6845_ADD("crtc", H46505, XTAL_4MHz/4, mc6845_intf) /* unknown clock, hand tuned to get ~60 fps */ + MCFG_MC6845_ADD("crtc", H46505, "screen", XTAL_4MHz/4, mc6845_intf) /* unknown clock, hand tuned to get ~60 fps */ MCFG_I8255A_ADD( "ppi8255_0", ppi8255_intf_0 ) MCFG_I8255A_ADD( "ppi8255_1", ppi8255_intf_1 ) MCFG_I8255A_ADD( "ppi8255_2", ppi8255_intf_2 ) diff --git a/src/mess/drivers/pasopia7.c b/src/mess/drivers/pasopia7.c index 094601184854b..101138636a457 100644 --- a/src/mess/drivers/pasopia7.c +++ b/src/mess/drivers/pasopia7.c @@ -726,7 +726,6 @@ GFXDECODE_END static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -1033,7 +1032,7 @@ static MACHINE_CONFIG_DERIVED( p7_raster, p7_base ) MCFG_PALETTE_INIT_OVERRIDE(pasopia7_state,p7_raster) MCFG_GFXDECODE( pasopia7 ) - MCFG_MC6845_ADD("crtc", H46505, VDP_CLOCK, mc6845_intf) /* unknown clock, hand tuned to get ~60 fps */ + MCFG_MC6845_ADD("crtc", H46505, "screen", VDP_CLOCK, mc6845_intf) /* unknown clock, hand tuned to get ~60 fps */ MACHINE_CONFIG_END @@ -1049,7 +1048,7 @@ static MACHINE_CONFIG_DERIVED( p7_lcd, p7_base ) MCFG_PALETTE_INIT_OVERRIDE(pasopia7_state,p7_lcd) MCFG_GFXDECODE( pasopia7 ) - MCFG_MC6845_ADD("crtc", H46505, LCD_CLOCK, mc6845_intf) /* unknown clock, hand tuned to get ~60 fps */ + MCFG_MC6845_ADD("crtc", H46505, "screen", LCD_CLOCK, mc6845_intf) /* unknown clock, hand tuned to get ~60 fps */ MCFG_DEFAULT_LAYOUT( layout_lcd ) MACHINE_CONFIG_END diff --git a/src/mess/drivers/pc8001.c b/src/mess/drivers/pc8001.c index 28f220d4e86e2..d7a5f205e9641 100644 --- a/src/mess/drivers/pc8001.c +++ b/src/mess/drivers/pc8001.c @@ -391,7 +391,6 @@ static UPD3301_DISPLAY_PIXELS( pc8001_display_pixels ) static UPD3301_INTERFACE( pc8001_upd3301_intf ) { - SCREEN_TAG, 8, pc8001_display_pixels, DEVCB_NULL, diff --git a/src/mess/drivers/pc9801.c b/src/mess/drivers/pc9801.c index ffb926767f12e..c6b7209f6d00e 100644 --- a/src/mess/drivers/pc9801.c +++ b/src/mess/drivers/pc9801.c @@ -911,7 +911,6 @@ static UPD7220_DRAW_TEXT_LINE( hgdc_draw_text ) static UPD7220_INTERFACE( hgdc_1_intf ) { - "screen", NULL, hgdc_draw_text, DEVCB_NULL, @@ -921,7 +920,6 @@ static UPD7220_INTERFACE( hgdc_1_intf ) static UPD7220_INTERFACE( hgdc_2_intf ) { - "screen", hgdc_display_pixels, NULL, DEVCB_NULL, diff --git a/src/mess/drivers/pce.c b/src/mess/drivers/pce.c index 780cc3f1cd30b..8f45dba660fd3 100644 --- a/src/mess/drivers/pce.c +++ b/src/mess/drivers/pce.c @@ -310,7 +310,6 @@ static const huc6270_interface pce_huc6270_config = static const huc6260_interface pce_huc6260_config = { - "screen", DEVCB_DEVICE_MEMBER16( "huc6270", huc6270_device, next_pixel ), DEVCB_DEVICE_MEMBER16( "huc6270", huc6270_device, time_until_next_event ), DEVCB_DEVICE_LINE_MEMBER( "huc6270", huc6270_device, vsync_changed ), @@ -351,7 +350,6 @@ static const huc6202_interface sgx_huc6202_config = static const huc6260_interface sgx_huc6260_config = { - "screen", DEVCB_DEVICE_MEMBER16( "huc6202", huc6202_device, next_pixel ), DEVCB_DEVICE_MEMBER16( "huc6202", huc6202_device, time_until_next_event ), DEVCB_DEVICE_LINE_MEMBER( "huc6202", huc6202_device, vsync_changed ), diff --git a/src/mess/drivers/pcfx.c b/src/mess/drivers/pcfx.c index d206f9f2ce09b..766760df361f5 100644 --- a/src/mess/drivers/pcfx.c +++ b/src/mess/drivers/pcfx.c @@ -459,7 +459,6 @@ WRITE_LINE_MEMBER( pcfx_state::irq15_w ) static const huc6261_interface pcfx_huc6261_config = { - "screen", "huc6270_a", "huc6270_b" }; diff --git a/src/mess/drivers/pencil2.c b/src/mess/drivers/pencil2.c index 3bb4b400690d2..ca0950378b88b 100644 --- a/src/mess/drivers/pencil2.c +++ b/src/mess/drivers/pencil2.c @@ -275,7 +275,6 @@ static const sn76496_config psg_intf = static TMS9928A_INTERFACE(pencil2_tms9929a_interface) { - "screen", // screen tag 0x4000, // vram size DEVCB_NULL // write line if int changes }; diff --git a/src/mess/drivers/pet.c b/src/mess/drivers/pet.c index 1e9d1c9fc5887..697714102bd7e 100644 --- a/src/mess/drivers/pet.c +++ b/src/mess/drivers/pet.c @@ -1193,7 +1193,6 @@ static MC6845_UPDATE_ROW( pet80_update_row ) static MC6845_INTERFACE( crtc_intf ) { - SCREEN_TAG, false, 2*8, NULL, @@ -1257,7 +1256,6 @@ static MC6845_UPDATE_ROW( cbm8296_update_row ) static MC6845_INTERFACE( cbm8296_crtc_intf ) { - SCREEN_TAG, false, 2*8, NULL, @@ -1738,7 +1736,7 @@ static MACHINE_CONFIG_START( pet80, pet80_state ) MCFG_SCREEN_SIZE(640, 250) MCFG_SCREEN_VISIBLE_AREA(0, 640 - 1, 0, 250 - 1) MCFG_SCREEN_UPDATE_DEVICE(MC6845_TAG, mc6845_device, screen_update) - MCFG_MC6845_ADD(MC6845_TAG, MC6845, XTAL_16MHz/16, crtc_intf) + MCFG_MC6845_ADD(MC6845_TAG, MC6845, SCREEN_TAG, XTAL_16MHz/16, crtc_intf) // sound hardware MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mess/drivers/portfoli.c b/src/mess/drivers/portfoli.c index 0a6f5bc89c781..766c4217ac57c 100644 --- a/src/mess/drivers/portfoli.c +++ b/src/mess/drivers/portfoli.c @@ -693,7 +693,6 @@ READ8_MEMBER(portfolio_state::hd61830_rd_r) static HD61830_INTERFACE( lcdc_intf ) { - SCREEN_TAG, DEVCB_DRIVER_MEMBER(portfolio_state,hd61830_rd_r) }; diff --git a/src/mess/drivers/pv1000.c b/src/mess/drivers/pv1000.c index 4d35938b27316..6b1cdf99df22b 100644 --- a/src/mess/drivers/pv1000.c +++ b/src/mess/drivers/pv1000.c @@ -143,7 +143,6 @@ class pv1000_state : public driver_device : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_sound(*this, "pv1000_sound"), - m_screen(*this, "screen"), m_p_videoram(*this, "p_videoram") { } @@ -165,7 +164,6 @@ class pv1000_state : public driver_device required_device m_maincpu; required_device m_sound; - required_device m_screen; required_shared_ptr m_p_videoram; virtual void machine_start(); virtual void machine_reset(); diff --git a/src/mess/drivers/pv2000.c b/src/mess/drivers/pv2000.c index c511f15dea0be..a6d4ab95535ed 100644 --- a/src/mess/drivers/pv2000.c +++ b/src/mess/drivers/pv2000.c @@ -341,7 +341,6 @@ WRITE_LINE_MEMBER( pv2000_state::pv2000_vdp_interrupt ) static TMS9928A_INTERFACE(pv2000_tms9928a_interface) { - "screen", 0x4000, DEVCB_DRIVER_LINE_MEMBER(pv2000_state, pv2000_vdp_interrupt) }; diff --git a/src/mess/drivers/pyl601.c b/src/mess/drivers/pyl601.c index 253c1cc0be2a7..90bef623a806b 100644 --- a/src/mess/drivers/pyl601.c +++ b/src/mess/drivers/pyl601.c @@ -468,7 +468,6 @@ static MC6845_UPDATE_ROW( pyl601a_update_row ) static MC6845_INTERFACE( pyl601_crtc6845_interface ) { - "screen", false, 8 /*?*/, NULL, @@ -483,7 +482,6 @@ static MC6845_INTERFACE( pyl601_crtc6845_interface ) static MC6845_INTERFACE( pyl601a_crtc6845_interface ) { - "screen", false, 8 /*?*/, NULL, @@ -574,7 +572,7 @@ static MACHINE_CONFIG_START( pyl601, pyl601_state ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) /* Devices */ - MCFG_MC6845_ADD("crtc", MC6845, XTAL_2MHz, pyl601_crtc6845_interface) + MCFG_MC6845_ADD("crtc", MC6845, "screen", XTAL_2MHz, pyl601_crtc6845_interface) MCFG_UPD765A_ADD("upd765", true, true) MCFG_FLOPPY_DRIVE_ADD("upd765:0", pyl601_floppies, "525hd", pyl601_state::floppy_formats) MCFG_FLOPPY_DRIVE_ADD("upd765:1", pyl601_floppies, "525hd", pyl601_state::floppy_formats) @@ -591,7 +589,7 @@ static MACHINE_CONFIG_DERIVED( pyl601a, pyl601 ) MCFG_GFXDECODE(pyl601a) MCFG_DEVICE_REMOVE("crtc") - MCFG_MC6845_ADD("crtc", MC6845, XTAL_2MHz, pyl601a_crtc6845_interface) + MCFG_MC6845_ADD("crtc", MC6845, "screen", XTAL_2MHz, pyl601a_crtc6845_interface) MACHINE_CONFIG_END /* ROM definition */ diff --git a/src/mess/drivers/qx10.c b/src/mess/drivers/qx10.c index 047d4d7925aa5..901e627e40aa7 100644 --- a/src/mess/drivers/qx10.c +++ b/src/mess/drivers/qx10.c @@ -805,7 +805,6 @@ void qx10_state::video_start() static UPD7220_INTERFACE( hgdc_intf ) { - "screen", hgdc_display_pixels, hgdc_draw_text, DEVCB_NULL, diff --git a/src/mess/drivers/rainbow.c b/src/mess/drivers/rainbow.c index 960d3ee9bfdf4..744a49efad9af 100644 --- a/src/mess/drivers/rainbow.c +++ b/src/mess/drivers/rainbow.c @@ -398,7 +398,6 @@ TIMER_DEVICE_CALLBACK_MEMBER(rainbow_state::keyboard_tick) static const vt_video_interface video_interface = { - "screen", "chargen", DEVCB_DRIVER_MEMBER(rainbow_state, read_video_ram_r), DEVCB_DRIVER_MEMBER(rainbow_state, clear_video_interrupt) diff --git a/src/mess/drivers/rt1715.c b/src/mess/drivers/rt1715.c index 3d4442ebfcc0a..849e7988d4620 100644 --- a/src/mess/drivers/rt1715.c +++ b/src/mess/drivers/rt1715.c @@ -158,7 +158,6 @@ GFXDECODE_END static const i8275_interface rt1715_i8275_intf = { - "screen", 8, 0, DEVCB_NULL, diff --git a/src/mess/drivers/sg1000.c b/src/mess/drivers/sg1000.c index c0b24fc1603cf..9594ea4b49158 100644 --- a/src/mess/drivers/sg1000.c +++ b/src/mess/drivers/sg1000.c @@ -462,7 +462,6 @@ WRITE_LINE_MEMBER(sg1000_state::sg1000_vdp_interrupt) static TMS9928A_INTERFACE(sg1000_tms9918a_interface) { - SCREEN_TAG, 0x4000, DEVCB_DRIVER_LINE_MEMBER(sg1000_state,sg1000_vdp_interrupt) }; diff --git a/src/mess/drivers/sm1800.c b/src/mess/drivers/sm1800.c index 68359c9b70ba4..5c46f81ebfbf4 100644 --- a/src/mess/drivers/sm1800.c +++ b/src/mess/drivers/sm1800.c @@ -104,7 +104,6 @@ static I8275_DISPLAY_PIXELS(sm1800_display_pixels) } const i8275_interface sm1800_i8275_interface = { - "screen", 8, 0, DEVCB_NULL, diff --git a/src/mess/drivers/smc777.c b/src/mess/drivers/smc777.c index ff7eb069539f8..f08a93ad7dbee 100644 --- a/src/mess/drivers/smc777.c +++ b/src/mess/drivers/smc777.c @@ -999,7 +999,6 @@ void smc777_state::machine_reset() static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ true, /* show border area */ 8, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -1104,7 +1103,7 @@ static MACHINE_CONFIG_START( smc777, smc777_state ) MCFG_PALETTE_LENGTH(0x20) // 16 + 8 colors (SMC-777 + SMC-70) + 8 empty entries (SMC-70) - MCFG_MC6845_ADD("crtc", H46505, MASTER_CLOCK/2, mc6845_intf) /* unknown clock, hand tuned to get ~60 fps */ + MCFG_MC6845_ADD("crtc", H46505, "screen", MASTER_CLOCK/2, mc6845_intf) /* unknown clock, hand tuned to get ~60 fps */ MCFG_MB8876_ADD("fdc",smc777_mb8876_interface) MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(smc777_floppy_interface) diff --git a/src/mess/drivers/sms.c b/src/mess/drivers/sms.c index 6a524afda2014..34953896923ab 100644 --- a/src/mess/drivers/sms.c +++ b/src/mess/drivers/sms.c @@ -424,7 +424,6 @@ WRITE_LINE_MEMBER(sms_state::sms_int_callback) static const sega315_5124_interface _315_5124_ntsc_intf = { false, - "screen", DEVCB_DRIVER_LINE_MEMBER(sms_state,sms_int_callback), DEVCB_DRIVER_LINE_MEMBER(sms_state,sms_pause_callback) }; @@ -432,7 +431,6 @@ static const sega315_5124_interface _315_5124_ntsc_intf = static const sega315_5124_interface _315_5124_pal_intf = { true, - "screen", DEVCB_DRIVER_LINE_MEMBER(sms_state,sms_int_callback), DEVCB_DRIVER_LINE_MEMBER(sms_state,sms_pause_callback) }; @@ -440,7 +438,6 @@ static const sega315_5124_interface _315_5124_pal_intf = static const sega315_5124_interface sms_store_intf = { false, - "screen", DEVCB_DRIVER_LINE_MEMBER(smssdisp_state,sms_store_int_callback), DEVCB_DRIVER_LINE_MEMBER(sms_state,sms_pause_callback) }; @@ -534,6 +531,7 @@ static MACHINE_CONFIG_DERIVED( sms2_ntsc, sms_ntsc_base ) MCFG_PALETTE_INIT(sega315_5124) MCFG_SEGA315_5246_ADD("sms_vdp", _315_5124_ntsc_intf) + MCFG_SEGA315_5246_SET_SCREEN("screen") MACHINE_CONFIG_END static MACHINE_CONFIG_DERIVED( sms1_ntsc, sms_ntsc_base ) @@ -571,6 +569,7 @@ static MACHINE_CONFIG_DERIVED( sms1_ntsc, sms_ntsc_base ) MCFG_VIDEO_START_OVERRIDE(sms_state,sms1) MCFG_SEGA315_5124_ADD("sms_vdp", _315_5124_ntsc_intf) + MCFG_SEGA315_5124_SET_SCREEN("screen") // cardslot, not present in Master System II MCFG_SMS_CARD_ADD("mycard", sms_cart, NULL) @@ -605,6 +604,7 @@ static MACHINE_CONFIG_START( sms_sdisp, smssdisp_state ) MCFG_PALETTE_INIT(sega315_5124) MCFG_SEGA315_5246_ADD("sms_vdp", sms_store_intf) + MCFG_SEGA315_5246_SET_SCREEN("screen") MCFG_CPU_ADD("control", Z80, XTAL_53_693175MHz/15) MCFG_CPU_PROGRAM_MAP(sms_store_mem) @@ -699,6 +699,7 @@ static MACHINE_CONFIG_DERIVED( sms2_pal, sms_pal_base ) MCFG_PALETTE_INIT(sega315_5124) MCFG_SEGA315_5246_ADD("sms_vdp", _315_5124_pal_intf) + MCFG_SEGA315_5246_SET_SCREEN("screen") MACHINE_CONFIG_END static MACHINE_CONFIG_DERIVED( sms1_pal, sms_pal_base ) @@ -736,6 +737,7 @@ static MACHINE_CONFIG_DERIVED( sms1_pal, sms_pal_base ) MCFG_VIDEO_START_OVERRIDE(sms_state,sms1) MCFG_SEGA315_5124_ADD("sms_vdp", _315_5124_pal_intf) + MCFG_SEGA315_5124_SET_SCREEN("screen") // cardslot, not present in Master System II MCFG_SMS_CARD_ADD("mycard", sms_cart, NULL) @@ -787,6 +789,7 @@ static MACHINE_CONFIG_START( gamegear, sms_state ) MCFG_VIDEO_START_OVERRIDE(sms_state,gamegear) MCFG_SEGA315_5378_ADD("sms_vdp", _315_5124_ntsc_intf) + MCFG_SEGA315_5378_SET_SCREEN("screen") /* sound hardware */ MCFG_SPEAKER_STANDARD_STEREO("lspeaker","rspeaker") diff --git a/src/mess/drivers/socrates.c b/src/mess/drivers/socrates.c index dbfabbd61dc85..cbc82427b0aee 100644 --- a/src/mess/drivers/socrates.c +++ b/src/mess/drivers/socrates.c @@ -88,11 +88,9 @@ class socrates_state : public driver_device socrates_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_sound(*this, "soc_snd") { } required_device m_maincpu; - required_device m_screen; required_device m_sound; rgb_t m_palette[256]; diff --git a/src/mess/drivers/super80.c b/src/mess/drivers/super80.c index 5dd74b1e35763..c2422b9935b35 100644 --- a/src/mess/drivers/super80.c +++ b/src/mess/drivers/super80.c @@ -615,7 +615,6 @@ static const cassette_interface super80_cassette_interface = static MC6845_INTERFACE( super80v_crtc ) { - "screen", /* name of screen */ false, SUPER80V_DOTS, /* number of dots per character */ NULL, @@ -713,7 +712,7 @@ static MACHINE_CONFIG_START( super80v, super80_state ) MCFG_PALETTE_LENGTH(16) MCFG_PALETTE_INIT_OVERRIDE(super80_state,super80m) - MCFG_MC6845_ADD("crtc", MC6845, MASTER_CLOCK / SUPER80V_DOTS, super80v_crtc) + MCFG_MC6845_ADD("crtc", MC6845, "screen", MASTER_CLOCK / SUPER80V_DOTS, super80v_crtc) MCFG_GFXDECODE(super80v) MCFG_DEFAULT_LAYOUT( layout_super80 ) diff --git a/src/mess/drivers/svi318.c b/src/mess/drivers/svi318.c index c31171f8d32a7..3b91184ef439d 100644 --- a/src/mess/drivers/svi318.c +++ b/src/mess/drivers/svi318.c @@ -267,7 +267,6 @@ WRITE_LINE_MEMBER(svi318_state::vdp_interrupt) static TMS9928A_INTERFACE(svi318_tms9928a_interface) { - "screen", 0x4000, DEVCB_DRIVER_LINE_MEMBER(svi318_state,vdp_interrupt) }; @@ -388,7 +387,6 @@ MACHINE_CONFIG_END static MC6845_INTERFACE( svi806_crtc6845_interface ) { - "svi806", false, 8 /*?*/, NULL, @@ -438,6 +436,7 @@ static MACHINE_CONFIG_START( svi328_806, svi318_state ) MCFG_DEFAULT_LAYOUT( layout_dualhsxs ) MCFG_TMS9928A_ADD( "tms9928a", TMS9929A, svi318_tms9928a_interface ) + MCFG_TMS9928A_SET_SCREEN( "screen" ) MCFG_TMS9928A_SCREEN_ADD_PAL( "screen" ) MCFG_SCREEN_UPDATE_DEVICE( "tms9928a", tms9929a_device, screen_update ) MCFG_PALETTE_LENGTH(TMS9928A_PALETTE_SIZE + 2) /* 2 additional entries for monochrome svi806 output */ @@ -451,7 +450,7 @@ static MACHINE_CONFIG_START( svi328_806, svi318_state ) MCFG_GFXDECODE(svi328) - MCFG_MC6845_ADD("crtc", MC6845, XTAL_12MHz / 8, svi806_crtc6845_interface) + MCFG_MC6845_ADD("crtc", MC6845, "svi806", XTAL_12MHz / 8, svi806_crtc6845_interface) MCFG_VIDEO_START_OVERRIDE(svi318_state, svi328_806 ) diff --git a/src/mess/drivers/tandy2k.c b/src/mess/drivers/tandy2k.c index d0466948e2fee..45ad307990624 100644 --- a/src/mess/drivers/tandy2k.c +++ b/src/mess/drivers/tandy2k.c @@ -354,7 +354,6 @@ WRITE_LINE_MEMBER( tandy2k_state::vpac_drb_w ) static CRT9007_INTERFACE( vpac_intf ) { - SCREEN_TAG, 10, DEVCB_DEVICE_LINE_MEMBER(I8259A_1_TAG, pic8259_device, ir1_w), DEVCB_NULL, // DMAR 80186 HOLD @@ -388,7 +387,6 @@ static CRT9212_INTERFACE( drb1_intf ) static CRT9021_INTERFACE( vac_intf ) { - SCREEN_TAG, DEVCB_DEVICE_MEMBER(CRT9212_0_TAG, crt9212_device, read), // data DEVCB_DEVICE_MEMBER(CRT9212_1_TAG, crt9212_device, read), // attributes DEVCB_LINE_VCC // ATTEN diff --git a/src/mess/drivers/tdv2324.c b/src/mess/drivers/tdv2324.c index 373ddbf99de19..11580fe8aaa54 100644 --- a/src/mess/drivers/tdv2324.c +++ b/src/mess/drivers/tdv2324.c @@ -347,7 +347,6 @@ static Z80SIO_INTERFACE( sio_intf ) static const tms9927_interface vtac_intf = { - SCREEN_TAG, 8, NULL }; diff --git a/src/mess/drivers/ti99_4x.c b/src/mess/drivers/ti99_4x.c index 97c3aad4ffad6..d93d67b686879 100644 --- a/src/mess/drivers/ti99_4x.c +++ b/src/mess/drivers/ti99_4x.c @@ -703,7 +703,6 @@ WRITE_LINE_MEMBER( ti99_4x_state::notconnected ) static TMS9928A_INTERFACE(ti99_4_tms9928a_interface) { - SCREEN_TAG, 0x4000, DEVCB_DRIVER_LINE_MEMBER(ti99_4x_state, set_tms9901_INT2) }; diff --git a/src/mess/drivers/ti99_8.c b/src/mess/drivers/ti99_8.c index b657877a92772..dbc1eb7fb62ad 100644 --- a/src/mess/drivers/ti99_8.c +++ b/src/mess/drivers/ti99_8.c @@ -765,7 +765,6 @@ WRITE_LINE_MEMBER( ti99_8_state::notconnected ) static TMS9928A_INTERFACE(ti99_8_tms9118a_interface) { - SCREEN_TAG, 0x4000, DEVCB_DRIVER_LINE_MEMBER(ti99_8_state, set_tms9901_INT2) }; diff --git a/src/mess/drivers/tim100.c b/src/mess/drivers/tim100.c index 3618a9ab981b1..4349137b5e029 100644 --- a/src/mess/drivers/tim100.c +++ b/src/mess/drivers/tim100.c @@ -107,7 +107,6 @@ static I8275_DISPLAY_PIXELS(tim100_display_pixels) } static const i8275_interface tim100_i8276_interface = { - "screen", 16, //12 0, DEVCB_CPU_INPUT_LINE("maincpu", I8085_RST65_LINE), diff --git a/src/mess/drivers/tm990189.c b/src/mess/drivers/tm990189.c index e30285cdea934..a52dbef10d72e 100644 --- a/src/mess/drivers/tm990189.c +++ b/src/mess/drivers/tm990189.c @@ -175,7 +175,6 @@ MACHINE_START_MEMBER(tm990189_state,tm990_189) static TMS9928A_INTERFACE(tms9918_interface) { - "screen", 0x4000, DEVCB_NULL }; diff --git a/src/mess/drivers/trs80m2.c b/src/mess/drivers/trs80m2.c index feae156b73e60..78d0e462810fa 100644 --- a/src/mess/drivers/trs80m2.c +++ b/src/mess/drivers/trs80m2.c @@ -428,7 +428,6 @@ WRITE_LINE_MEMBER( trs80m2_state::vsync_w ) static MC6845_INTERFACE( mc6845_intf ) { - SCREEN_TAG, false, 8, NULL, @@ -825,7 +824,7 @@ static MACHINE_CONFIG_START( trs80m2, trs80m2_state ) MCFG_PALETTE_LENGTH(2) MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white) - MCFG_MC6845_ADD(MC6845_TAG, MC6845, XTAL_12_48MHz/8, mc6845_intf) + MCFG_MC6845_ADD(MC6845_TAG, MC6845, SCREEN_TAG, XTAL_12_48MHz/8, mc6845_intf) // devices MCFG_FD1791x_ADD(FD1791_TAG, XTAL_8MHz/4) @@ -875,7 +874,7 @@ static MACHINE_CONFIG_START( trs80m16, trs80m16_state ) MCFG_SCREEN_SIZE(640, 480) MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 479) - MCFG_MC6845_ADD(MC6845_TAG, MC6845, XTAL_12_48MHz/8, mc6845_intf) + MCFG_MC6845_ADD(MC6845_TAG, MC6845, SCREEN_TAG, XTAL_12_48MHz/8, mc6845_intf) // devices MCFG_FD1791x_ADD(FD1791_TAG, XTAL_8MHz/4) diff --git a/src/mess/drivers/tutor.c b/src/mess/drivers/tutor.c index 4dcba0d12e942..1c98fd9f52ddc 100644 --- a/src/mess/drivers/tutor.c +++ b/src/mess/drivers/tutor.c @@ -246,7 +246,6 @@ DRIVER_INIT_MEMBER(tutor_state,pyuuta) static TMS9928A_INTERFACE(tutor_tms9928a_interface) { - "screen", 0x4000, DEVCB_NULL }; diff --git a/src/mess/drivers/tvc.c b/src/mess/drivers/tvc.c index 02557bfd84a9b..c54793420da28 100644 --- a/src/mess/drivers/tvc.c +++ b/src/mess/drivers/tvc.c @@ -633,7 +633,6 @@ QUICKLOAD_LOAD_MEMBER( tvc_state,tvc64) static MC6845_INTERFACE( tvc_crtc6845_interface ) { - "screen", false, 8 /*?*/, NULL, @@ -694,7 +693,7 @@ static MACHINE_CONFIG_START( tvc, tvc_state ) MCFG_PALETTE_LENGTH( 16 ) - MCFG_MC6845_ADD("crtc", MC6845, 3125000/2, tvc_crtc6845_interface) // clk taken from schematics + MCFG_MC6845_ADD("crtc", MC6845, "screen", 3125000/2, tvc_crtc6845_interface) // clk taken from schematics /* internal ram */ MCFG_RAM_ADD(RAM_TAG) diff --git a/src/mess/drivers/v6809.c b/src/mess/drivers/v6809.c index 3a6b800bb7d72..0f35aed9e2f3c 100644 --- a/src/mess/drivers/v6809.c +++ b/src/mess/drivers/v6809.c @@ -176,7 +176,6 @@ void v6809_state::video_start() static MC6845_INTERFACE( v6809_crtc ) { - "screen", /* name of screen */ false, 8, /* number of dots per character */ NULL, @@ -267,7 +266,7 @@ static MACHINE_CONFIG_START( v6809, v6809_state ) MCFG_GFXDECODE(v6809) /* Devices */ - MCFG_MC6845_ADD("crtc", SY6545_1, XTAL_16MHz / 8, v6809_crtc) + MCFG_MC6845_ADD("crtc", SY6545_1, "screen", XTAL_16MHz / 8, v6809_crtc) MCFG_ASCII_KEYBOARD_ADD(KEYBOARD_TAG, keyboard_intf) MACHINE_CONFIG_END diff --git a/src/mess/drivers/vg5k.c b/src/mess/drivers/vg5k.c index bda40943abdca..082b96ee44e5e 100644 --- a/src/mess/drivers/vg5k.c +++ b/src/mess/drivers/vg5k.c @@ -349,11 +349,6 @@ DRIVER_INIT_MEMBER(vg5k_state,vg5k) } -static const ef9345_interface vg5k_ef9345_config = -{ - "screen" /* screen we are acting on */ -}; - static const struct CassetteOptions vg5k_cassette_options = { 1, /* channels */ @@ -382,7 +377,7 @@ static MACHINE_CONFIG_START( vg5k, vg5k_state ) MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_timer", vg5k_state, z80_irq, attotime::from_msec(20)) - MCFG_EF9345_ADD("ef9345", vg5k_ef9345_config) + MCFG_EF9345_ADD("ef9345", "screen") /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mess/drivers/victor9k.c b/src/mess/drivers/victor9k.c index 43b728e3c1219..6476ae5dab4e2 100644 --- a/src/mess/drivers/victor9k.c +++ b/src/mess/drivers/victor9k.c @@ -299,7 +299,6 @@ static MC6845_UPDATE_ROW( victor9k_update_row ) static MC6845_INTERFACE( hd46505s_intf ) { - SCREEN_TAG, false, 10, NULL, @@ -1257,7 +1256,7 @@ static MACHINE_CONFIG_START( victor9k, victor9k_state ) MCFG_PALETTE_LENGTH(2) MCFG_PALETTE_INIT_OVERRIDE(driver_device, monochrome_green) - MCFG_MC6845_ADD(HD46505S_TAG, HD6845, 1000000, hd46505s_intf) // HD6845 == HD46505S + MCFG_MC6845_ADD(HD46505S_TAG, HD6845, SCREEN_TAG, 1000000, hd46505s_intf) // HD6845 == HD46505S // sound hardware MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mess/drivers/vidbrain.c b/src/mess/drivers/vidbrain.c index 9f2b2060f6012..b971734d455ef 100644 --- a/src/mess/drivers/vidbrain.c +++ b/src/mess/drivers/vidbrain.c @@ -457,7 +457,6 @@ READ8_MEMBER(vidbrain_state::memory_read_byte) static UV201_INTERFACE( uv_intf ) { - SCREEN_TAG, DEVCB_DRIVER_LINE_MEMBER(vidbrain_state, ext_int_w), DEVCB_DRIVER_LINE_MEMBER(vidbrain_state, hblank_w), DEVCB_DRIVER_MEMBER(vidbrain_state, memory_read_byte) diff --git a/src/mess/drivers/vii.c b/src/mess/drivers/vii.c index 5cfa21feec965..8db216df407b7 100644 --- a/src/mess/drivers/vii.c +++ b/src/mess/drivers/vii.c @@ -123,7 +123,7 @@ class vii_state : public driver_device { UINT8 r, g, b; } - m_screen[320*240]; + m_screenram[320*240]; UINT16 m_io_regs[0x200]; UINT16 m_uart_rx_count; @@ -225,16 +225,16 @@ inline UINT8 vii_state::vii_mix_channel(UINT8 a, UINT8 b) void vii_state::vii_mix_pixel(UINT32 offset, UINT16 rgb) { - m_screen[offset].r = vii_mix_channel(m_screen[offset].r, expand_rgb5_to_rgb8(rgb >> 10)); - m_screen[offset].g = vii_mix_channel(m_screen[offset].g, expand_rgb5_to_rgb8(rgb >> 5)); - m_screen[offset].b = vii_mix_channel(m_screen[offset].b, expand_rgb5_to_rgb8(rgb)); + m_screenram[offset].r = vii_mix_channel(m_screenram[offset].r, expand_rgb5_to_rgb8(rgb >> 10)); + m_screenram[offset].g = vii_mix_channel(m_screenram[offset].g, expand_rgb5_to_rgb8(rgb >> 5)); + m_screenram[offset].b = vii_mix_channel(m_screenram[offset].b, expand_rgb5_to_rgb8(rgb)); } void vii_state::vii_set_pixel(UINT32 offset, UINT16 rgb) { - m_screen[offset].r = expand_rgb5_to_rgb8(rgb >> 10); - m_screen[offset].g = expand_rgb5_to_rgb8(rgb >> 5); - m_screen[offset].b = expand_rgb5_to_rgb8(rgb); + m_screenram[offset].r = expand_rgb5_to_rgb8(rgb >> 10); + m_screenram[offset].g = expand_rgb5_to_rgb8(rgb >> 5); + m_screenram[offset].b = expand_rgb5_to_rgb8(rgb); } void vii_state::vii_blit(bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT32 xoff, UINT32 yoff, UINT32 attr, UINT32 ctrl, UINT32 bitmap_addr, UINT16 tile) @@ -439,7 +439,7 @@ UINT32 vii_state::screen_update_vii(screen_device &screen, bitmap_rgb32 &bitmap, bitmap.fill(0, cliprect); - memset(m_screen, 0, sizeof(m_screen)); + memset(m_screenram, 0, sizeof(m_screenram)); for(i = 0; i < 4; i++) { @@ -452,7 +452,7 @@ UINT32 vii_state::screen_update_vii(screen_device &screen, bitmap_rgb32 &bitmap, { for(x = 0; x < 320; x++) { - bitmap.pix32(y, x) = (m_screen[x + 320*y].r << 16) | (m_screen[x + 320*y].g << 8) | m_screen[x + 320*y].b; + bitmap.pix32(y, x) = (m_screenram[x + 320*y].r << 16) | (m_screenram[x + 320*y].g << 8) | m_screenram[x + 320*y].b; } } diff --git a/src/mess/drivers/vk100.c b/src/mess/drivers/vk100.c index f3323842ceb76..53d08c3674ac9 100644 --- a/src/mess/drivers/vk100.c +++ b/src/mess/drivers/vk100.c @@ -167,7 +167,6 @@ class vk100_state : public driver_device vk100_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_crtc(*this, "crtc"), m_speaker(*this, "beeper"), m_uart(*this, "i8251"), @@ -180,7 +179,6 @@ class vk100_state : public driver_device m_dipsw(*this, "SWITCHES") { } required_device m_maincpu; - required_device m_screen; required_device m_crtc; required_device m_speaker; required_device m_uart; @@ -995,7 +993,6 @@ static MC6845_UPDATE_ROW( vk100_update_row ) static MC6845_INTERFACE( mc6845_intf ) { - "screen", false, 12, NULL, @@ -1042,7 +1039,7 @@ static MACHINE_CONFIG_START( vk100, vk100_state ) MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_RAW_PARAMS(XTAL_45_6192Mhz/3, 882, 0, 720, 370, 0, 350 ) // fake screen timings for startup until 6845 sets real ones MCFG_SCREEN_UPDATE_DEVICE( "crtc", mc6845_device, screen_update ) - MCFG_MC6845_ADD( "crtc", H46505, XTAL_45_6192Mhz/3/12, mc6845_intf) + MCFG_MC6845_ADD( "crtc", H46505, "screen", XTAL_45_6192Mhz/3/12, mc6845_intf) /* i8251 uart */ MCFG_I8251_ADD("i8251", i8251_intf) diff --git a/src/mess/drivers/vt100.c b/src/mess/drivers/vt100.c index 8a578b2545aef..2205603203f9d 100644 --- a/src/mess/drivers/vt100.c +++ b/src/mess/drivers/vt100.c @@ -376,7 +376,6 @@ WRITE8_MEMBER( vt100_state::vt100_clear_video_interrupt ) static const vt_video_interface vt100_video_interface = { - "screen", "chargen", DEVCB_DRIVER_MEMBER(vt100_state, vt100_read_video_ram_r), DEVCB_DRIVER_MEMBER(vt100_state, vt100_clear_video_interrupt) diff --git a/src/mess/drivers/vt240.c b/src/mess/drivers/vt240.c index 7aef8f539ba2d..fd2cc8cd74ca1 100644 --- a/src/mess/drivers/vt240.c +++ b/src/mess/drivers/vt240.c @@ -133,7 +133,6 @@ void vt240_state::machine_reset() static UPD7220_INTERFACE( hgdc_intf ) { - "screen", NULL, hgdc_draw_text, DEVCB_NULL, diff --git a/src/mess/drivers/x1.c b/src/mess/drivers/x1.c index 1d18ad42b5031..348382b941645 100644 --- a/src/mess/drivers/x1.c +++ b/src/mess/drivers/x1.c @@ -1882,7 +1882,6 @@ static I8255A_INTERFACE( ppi8255_intf ) static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ true, /* show border area */ 8, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -2581,7 +2580,7 @@ static MACHINE_CONFIG_START( x1, x1_state ) MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) MCFG_SCREEN_UPDATE_DRIVER(x1_state, screen_update_x1) - MCFG_MC6845_ADD("crtc", H46505, (VDP_CLOCK/48), mc6845_intf) //unknown divider + MCFG_MC6845_ADD("crtc", H46505, "screen", (VDP_CLOCK/48), mc6845_intf) //unknown divider MCFG_PALETTE_LENGTH(0x10+0x1000) MCFG_PALETTE_INIT_OVERRIDE(x1_state,x1) diff --git a/src/mess/drivers/x1twin.c b/src/mess/drivers/x1twin.c index 4de8043244774..08d80ea3c6396 100644 --- a/src/mess/drivers/x1twin.c +++ b/src/mess/drivers/x1twin.c @@ -90,7 +90,6 @@ static I8255A_INTERFACE( ppi8255_intf ) static MC6845_INTERFACE( mc6845_intf ) { - "x1_screen", /* screen we are acting on */ false, /* show border area*/ 8, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -556,7 +555,7 @@ static MACHINE_CONFIG_START( x1twin, x1twin_state ) MCFG_SCREEN_RAW_PARAMS(PCE_MAIN_CLOCK/2, VDC_WPF, 70, 70 + 512 + 32, VDC_LPF, 14, 14+242) MCFG_SCREEN_UPDATE_DRIVER(x1twin_state, screen_update_x1pce) - MCFG_MC6845_ADD("crtc", H46505, (VDP_CLOCK/48), mc6845_intf) //unknown divider + MCFG_MC6845_ADD("crtc", H46505, "x1_screen", (VDP_CLOCK/48), mc6845_intf) //unknown divider MCFG_PALETTE_LENGTH(0x10+0x1000) MCFG_PALETTE_INIT_OVERRIDE(x1twin_state,x1) diff --git a/src/mess/drivers/z100.c b/src/mess/drivers/z100.c index b324bca90233a..7ef6a6d4020a5 100644 --- a/src/mess/drivers/z100.c +++ b/src/mess/drivers/z100.c @@ -616,7 +616,6 @@ READ8_MEMBER( z100_state::get_slave_ack ) static MC6845_INTERFACE( mc6845_intf ) { - "screen", /* screen we are acting on */ false, /* show border area */ 8, /* number of pixels per video memory address */ NULL, /* before pixel update callback */ @@ -774,7 +773,7 @@ static MACHINE_CONFIG_START( z100, z100_state ) MCFG_PALETTE_LENGTH(8) /* Devices */ - MCFG_MC6845_ADD("crtc", MC6845, XTAL_14_31818MHz/8, mc6845_intf) /* unknown clock, hand tuned to get ~50/~60 fps */ + MCFG_MC6845_ADD("crtc", MC6845, "screen", XTAL_14_31818MHz/8, mc6845_intf) /* unknown clock, hand tuned to get ~50/~60 fps */ MCFG_PIC8259_ADD( "pic8259_master", WRITELINE(z100_state, z100_pic_irq), VCC, READ8(z100_state, get_slave_ack) ) MCFG_PIC8259_ADD( "pic8259_slave", DEVWRITELINE("pic8259_master", pic8259_device, ir3_w), GND, NULL ) diff --git a/src/mess/drivers/zrt80.c b/src/mess/drivers/zrt80.c index a00efbdcfc3a3..e4d171f7dbae0 100644 --- a/src/mess/drivers/zrt80.c +++ b/src/mess/drivers/zrt80.c @@ -245,7 +245,6 @@ static MC6845_UPDATE_ROW( zrt80_update_row ) static MC6845_INTERFACE( zrt80_crtc6845_interface ) { - "screen", false, 8 /*?*/, NULL, @@ -321,7 +320,7 @@ static MACHINE_CONFIG_START( zrt80, zrt80_state ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) /* Devices */ - MCFG_MC6845_ADD("crtc", MC6845, XTAL_20MHz / 8, zrt80_crtc6845_interface) + MCFG_MC6845_ADD("crtc", MC6845, "screen", XTAL_20MHz / 8, zrt80_crtc6845_interface) MCFG_INS8250_ADD( "ins8250", zrt80_com_interface, 2457600 ) MCFG_ASCII_KEYBOARD_ADD(KEYBOARD_TAG, keyboard_intf) MACHINE_CONFIG_END diff --git a/src/mess/includes/a7800.h b/src/mess/includes/a7800.h index 41ae67393555f..7e37f3b068d55 100644 --- a/src/mess/includes/a7800.h +++ b/src/mess/includes/a7800.h @@ -21,7 +21,6 @@ class a7800_state : public driver_device m_maincpu(*this, "maincpu"), m_pokey(*this, "pokey"), m_tia(*this, "tia"), - m_screen(*this, "screen"), m_region_maincpu(*this, "maincpu"), m_bank1(*this, "bank1"), m_bank2(*this, "bank2"), @@ -100,7 +99,6 @@ class a7800_state : public driver_device required_device m_maincpu; required_device m_pokey; required_device m_tia; - required_device m_screen; required_memory_region m_region_maincpu; required_memory_bank m_bank1; required_memory_bank m_bank2; diff --git a/src/mess/includes/amstrad.h b/src/mess/includes/amstrad.h index cae9910b2eeca..d20585d558f20 100644 --- a/src/mess/includes/amstrad.h +++ b/src/mess/includes/amstrad.h @@ -105,7 +105,6 @@ class amstrad_state : public driver_device m_ay(*this, "ay"), m_fdc(*this, "upd765"), m_crtc(*this, "mc6845"), - m_screen(*this, "screen"), m_ppi(*this, "ppi8255"), m_centronics(*this, "centronics"), m_cassette(*this, "cassette"), @@ -152,7 +151,6 @@ class amstrad_state : public driver_device required_device m_ay; optional_device m_fdc; // not on a GX4000 required_device m_crtc; - required_device m_screen; required_device m_ppi; optional_device m_centronics; // not on a GX4000 optional_device m_cassette; // not on a GX4000, (or technically, the 6128+) diff --git a/src/mess/includes/aquarius.h b/src/mess/includes/aquarius.h index f83fe291fbf56..d1c61ec925863 100644 --- a/src/mess/includes/aquarius.h +++ b/src/mess/includes/aquarius.h @@ -23,7 +23,6 @@ class aquarius_state : public driver_device m_maincpu(*this, "maincpu"), m_cassette(*this, "cassette"), m_speaker(*this, "speaker"), - m_screen(*this, "screen"), m_ram(*this, RAM_TAG), m_rom(*this, "maincpu"), m_videoram(*this, "videoram"), @@ -41,7 +40,6 @@ class aquarius_state : public driver_device required_device m_maincpu; required_device m_cassette; required_device m_speaker; - required_device m_screen; required_device m_ram; required_memory_region m_rom; required_shared_ptr m_videoram; diff --git a/src/mess/includes/mac.h b/src/mess/includes/mac.h index 77b433f2e0ebb..837683fe7102a 100644 --- a/src/mess/includes/mac.h +++ b/src/mess/includes/mac.h @@ -201,7 +201,6 @@ class mac_state : public driver_device m_egret(*this, EGRET_TAG), m_cuda(*this, CUDA_TAG), m_ram(*this, RAM_TAG), - m_screen(*this, MAC_SCREEN_NAME), m_539x_1(*this, MAC_539X_1_TAG), m_539x_2(*this, MAC_539X_2_TAG), m_ncr5380(*this, "scsi:ncr5380"), @@ -230,7 +229,6 @@ class mac_state : public driver_device optional_device m_egret; optional_device m_cuda; required_device m_ram; - optional_device m_screen; optional_device m_539x_1; optional_device m_539x_2; optional_device m_ncr5380; diff --git a/src/mess/includes/macpci.h b/src/mess/includes/macpci.h index ba7b47f11852a..8fbb1f7e6f493 100644 --- a/src/mess/includes/macpci.h +++ b/src/mess/includes/macpci.h @@ -85,7 +85,6 @@ class macpci_state : public driver_device m_awacs(*this, "awacs"), m_cuda(*this, CUDA_TAG), m_ram(*this, RAM_TAG), - m_screen(*this, MAC_SCREEN_NAME), m_539x_1(*this, MAC_539X_1_TAG), m_539x_2(*this, MAC_539X_2_TAG) { } @@ -95,7 +94,6 @@ class macpci_state : public driver_device optional_device m_awacs; required_device m_cuda; required_device m_ram; - optional_device m_screen; optional_device m_539x_1; optional_device m_539x_2; diff --git a/src/mess/includes/mz700.h b/src/mess/includes/mz700.h index a22821549b600..e4e3a7095ed70 100644 --- a/src/mess/includes/mz700.h +++ b/src/mess/includes/mz700.h @@ -49,7 +49,7 @@ class mz_state : public driver_device int m_mz800_ram_monitor; /* 1 if monitor rom banked in */ int m_hires_mode; /* 1 if in 640x200 mode */ - int m_screen; /* screen designation */ + int m_screennum; /* screen designation */ UINT8 *m_colorram; UINT8 *m_videoram; UINT8 m_speaker_level; diff --git a/src/mess/includes/pcw.h b/src/mess/includes/pcw.h index a1b449994ca5a..0d109503ae131 100644 --- a/src/mess/includes/pcw.h +++ b/src/mess/includes/pcw.h @@ -29,7 +29,6 @@ class pcw_state : public driver_device pcw_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_fdc(*this, "upd765"), m_ram(*this, RAM_TAG), m_beeper(*this, "beeper") @@ -118,7 +117,6 @@ class pcw_state : public driver_device void pcw_fdc_interrupt(bool state); required_device m_maincpu; - required_device m_screen; required_device m_fdc; required_device m_ram; required_device m_beeper; diff --git a/src/mess/includes/zx.h b/src/mess/includes/zx.h index bf38c07bd4294..b1eb6d26cd6d0 100644 --- a/src/mess/includes/zx.h +++ b/src/mess/includes/zx.h @@ -30,7 +30,6 @@ class zx_state : public driver_device : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_ram(*this, RAM_TAG), - m_screen(*this, "screen"), m_cassette(*this, "cassette"), m_speaker(*this, "speaker"), m_region_maincpu(*this, "maincpu"), @@ -88,7 +87,6 @@ class zx_state : public driver_device protected: required_device m_maincpu; required_device m_ram; - required_device m_screen; required_device m_cassette; required_device m_speaker; required_memory_region m_region_maincpu; diff --git a/src/mess/machine/a2arcadebd.c b/src/mess/machine/a2arcadebd.c index 393459897b22b..7de1209735a40 100644 --- a/src/mess/machine/a2arcadebd.c +++ b/src/mess/machine/a2arcadebd.c @@ -38,7 +38,6 @@ static const ay8910_interface arcadeboard_ay8910_interface = static TMS9928A_INTERFACE(arcadeboard_tms9918a_interface) { - SCREEN_TAG, 0x4000, // 16k of VRAM DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, a2bus_arcboard_device, tms_irq_w) }; diff --git a/src/mess/machine/a2videoterm.c b/src/mess/machine/a2videoterm.c index ca01d5ad2578a..35b14f2c3c745 100644 --- a/src/mess/machine/a2videoterm.c +++ b/src/mess/machine/a2videoterm.c @@ -50,7 +50,6 @@ static MC6845_UPDATE_ROW( videoterm_update_row ); static MC6845_INTERFACE( mc6845_mda_intf ) { - VIDEOTERM_SCREEN_NAME, /* screen number */ false, /* show border area */ 8, /* number of pixels per video memory address */ NULL, /* begin_update */ @@ -68,7 +67,7 @@ MACHINE_CONFIG_FRAGMENT( a2videoterm ) MCFG_SCREEN_RAW_PARAMS(MDA_CLOCK, 882, 0, 720, 370, 0, 350 ) MCFG_SCREEN_UPDATE_DEVICE( VIDEOTERM_MC6845_NAME, mc6845_device, screen_update ) - MCFG_MC6845_ADD( VIDEOTERM_MC6845_NAME, MC6845, MDA_CLOCK/9, mc6845_mda_intf) + MCFG_MC6845_ADD( VIDEOTERM_MC6845_NAME, MC6845, VIDEOTERM_SCREEN_NAME, MDA_CLOCK/9, mc6845_mda_intf) MACHINE_CONFIG_END ROM_START( a2videoterm ) diff --git a/src/mess/machine/amstrad.c b/src/mess/machine/amstrad.c index d735d96646d72..aeb0c664953e8 100644 --- a/src/mess/machine/amstrad.c +++ b/src/mess/machine/amstrad.c @@ -1085,7 +1085,6 @@ UINT32 amstrad_state::screen_update_amstrad(screen_device &screen, bitmap_ind16 MC6845_INTERFACE( amstrad_mc6845_intf ) { - NULL, /* screen name */ false, /* show border area */ 16, /* number of pixels per video memory address */ NULL, /* begin_update */ @@ -1101,7 +1100,6 @@ MC6845_INTERFACE( amstrad_mc6845_intf ) MC6845_INTERFACE( amstrad_plus_mc6845_intf ) { - NULL, /* screen name */ false, /* show border area */ 16, /* number of pixels per video memory address */ NULL, /* begin_update */ diff --git a/src/mess/machine/c64/xl80.c b/src/mess/machine/c64/xl80.c index 488a8f8169a80..5f43efe36f4b9 100644 --- a/src/mess/machine/c64/xl80.c +++ b/src/mess/machine/c64/xl80.c @@ -112,7 +112,6 @@ static MC6845_UPDATE_ROW( c64_xl80_update_row ) static MC6845_INTERFACE( crtc_intf ) { - MC6845_SCREEN_TAG, false, 8, NULL, @@ -149,7 +148,7 @@ static MACHINE_CONFIG_FRAGMENT( c64_xl80 ) //MCFG_GFXDECODE(c64_xl80) - MCFG_MC6845_ADD(HD46505SP_TAG, H46505, XTAL_14_31818MHz, crtc_intf) + MCFG_MC6845_ADD(HD46505SP_TAG, H46505, MC6845_SCREEN_TAG, XTAL_14_31818MHz, crtc_intf) MACHINE_CONFIG_END diff --git a/src/mess/machine/comx_clm.c b/src/mess/machine/comx_clm.c index ad560115dda79..7422a52f73c9e 100644 --- a/src/mess/machine/comx_clm.c +++ b/src/mess/machine/comx_clm.c @@ -131,7 +131,6 @@ static MC6845_UPDATE_ROW( comx_clm_update_row ) static MC6845_INTERFACE( crtc_intf ) { - MC6845_SCREEN_TAG, false, 8, NULL, @@ -168,7 +167,7 @@ static MACHINE_CONFIG_FRAGMENT( comx_clm ) //MCFG_GFXDECODE(comx_clm) - MCFG_MC6845_ADD(MC6845_TAG, MC6845, XTAL_14_31818MHz/7, crtc_intf) + MCFG_MC6845_ADD(MC6845_TAG, MC6845, MC6845_SCREEN_TAG, XTAL_14_31818MHz/7, crtc_intf) MACHINE_CONFIG_END diff --git a/src/mess/machine/ecb_grip.c b/src/mess/machine/ecb_grip.c index f591765e2adf5..9893f4247bd75 100644 --- a/src/mess/machine/ecb_grip.c +++ b/src/mess/machine/ecb_grip.c @@ -284,7 +284,6 @@ static const speaker_interface speaker_intf = static MC6845_INTERFACE( crtc_intf ) { - SCREEN_TAG, false, 8, NULL, @@ -300,7 +299,6 @@ static MC6845_INTERFACE( crtc_intf ) static MC6845_INTERFACE( grip5_crtc_intf ) { - SCREEN_TAG, false, 8, NULL, @@ -550,8 +548,8 @@ static MACHINE_CONFIG_FRAGMENT( grip ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) // devices - MCFG_MC6845_ADD(MC6845_TAG, MC6845, XTAL_16MHz/4, crtc_intf) -// MCFG_MC6845_ADD(HD6345_TAG, HD6345, XTAL_16MHz/4, grip5_crtc_intf) + MCFG_MC6845_ADD(MC6845_TAG, MC6845, SCREEN_TAG, XTAL_16MHz/4, crtc_intf) +// MCFG_MC6845_ADD(HD6345_TAG, HD6345, SCREEN_TAG, XTAL_16MHz/4, grip5_crtc_intf) MCFG_I8255A_ADD(I8255A_TAG, ppi_intf) MCFG_Z80STI_ADD(Z80STI_TAG, XTAL_16MHz/4, sti_intf) MCFG_CENTRONICS_PRINTER_ADD(CENTRONICS_TAG, standard_centronics) diff --git a/src/mess/machine/mz700.c b/src/mess/machine/mz700.c index bbea4a37fda10..4a570205c5073 100644 --- a/src/mess/machine/mz700.c +++ b/src/mess/machine/mz700.c @@ -610,7 +610,7 @@ WRITE8_MEMBER(mz_state::mz800_display_mode_w) { m_mz700_mode = BIT(data, 3); m_hires_mode = BIT(data, 2); - m_screen = data & 0x03; + m_screennum = data & 0x03; /* change memory maps if we switched mode */ // if (BIT(data, 3) != m_mz700_mode) diff --git a/src/mess/machine/radio86.c b/src/mess/machine/radio86.c index 24aef2220da3d..448b4f1322b9e 100644 --- a/src/mess/machine/radio86.c +++ b/src/mess/machine/radio86.c @@ -250,7 +250,6 @@ I8255A_INTERFACE( mikrosha_ppi8255_interface_2 ) }; const i8275_interface radio86_i8275_interface = { - "screen", 6, 0, DEVCB_DEVICE_LINE_MEMBER("dma8257", i8257_device, i8257_drq2_w), @@ -261,7 +260,6 @@ const i8275_interface radio86_i8275_interface = { }; const i8275_interface mikrosha_i8275_interface = { - "screen", 6, 0, DEVCB_DEVICE_LINE_MEMBER("dma8257", i8257_device, i8257_drq2_w), @@ -272,7 +270,6 @@ const i8275_interface mikrosha_i8275_interface = { }; const i8275_interface apogee_i8275_interface = { - "screen", 6, 0, DEVCB_DEVICE_LINE_MEMBER("dma8257", i8257_device, i8257_drq2_w), @@ -283,7 +280,6 @@ const i8275_interface apogee_i8275_interface = { }; const i8275_interface partner_i8275_interface = { - "screen", 6, 1, DEVCB_DEVICE_LINE_MEMBER("dma8257", i8257_device, i8257_drq2_w), diff --git a/src/mess/machine/sms_lphaser.c b/src/mess/machine/sms_lphaser.c index e24a0b5a08849..25d5f4273e4e2 100644 --- a/src/mess/machine/sms_lphaser.c +++ b/src/mess/machine/sms_lphaser.c @@ -71,6 +71,7 @@ ioport_constructor sms_light_phaser_device::device_input_ports() const sms_light_phaser_device::sms_light_phaser_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, SMS_LIGHT_PHASER, "Light Phaser", tag, owner, clock, "sms_light_phaser", __FILE__), + device_video_interface(mconfig, *this), device_sms_control_port_interface(mconfig, *this), m_lphaser_pins(*this, "CTRL_PORT"), m_lphaser_x(*this, "LPHASER_X"), @@ -85,7 +86,6 @@ sms_light_phaser_device::sms_light_phaser_device(const machine_config &mconfig, void sms_light_phaser_device::device_start() { - m_screen = machine().first_screen(); m_lphaser_timer = timer_alloc(TIMER_LPHASER); m_last_state = 1; } diff --git a/src/mess/machine/sms_lphaser.h b/src/mess/machine/sms_lphaser.h index 8f0c9ea933a06..3f115e5f0cf03 100644 --- a/src/mess/machine/sms_lphaser.h +++ b/src/mess/machine/sms_lphaser.h @@ -25,6 +25,7 @@ // ======================> sms_light_phaser_device class sms_light_phaser_device : public device_t, + public device_video_interface, public device_sms_control_port_interface { public: @@ -50,7 +51,6 @@ class sms_light_phaser_device : public device_t, required_ioport m_lphaser_y; int m_last_state; - screen_device *m_screen; emu_timer *m_lphaser_timer; static const device_timer_id TIMER_LPHASER = 0; diff --git a/src/mess/machine/wangpc_lvc.c b/src/mess/machine/wangpc_lvc.c index f274846797088..20c103f0e48f3 100644 --- a/src/mess/machine/wangpc_lvc.c +++ b/src/mess/machine/wangpc_lvc.c @@ -119,7 +119,6 @@ WRITE_LINE_MEMBER( wangpc_lvc_device::vsync_w ) static MC6845_INTERFACE( crtc_intf ) { - SCREEN_TAG, false, 8, NULL, @@ -145,7 +144,7 @@ static MACHINE_CONFIG_FRAGMENT( wangpc_lvc ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) MCFG_SCREEN_REFRESH_RATE(60) - MCFG_MC6845_ADD(MC6845_TAG, MC6845_1, XTAL_14_31818MHz/16, crtc_intf) + MCFG_MC6845_ADD(MC6845_TAG, MC6845_1, SCREEN_TAG, XTAL_14_31818MHz/16, crtc_intf) MACHINE_CONFIG_END diff --git a/src/mess/machine/wangpc_mvc.c b/src/mess/machine/wangpc_mvc.c index bff1c5a56412f..c4a19abda5622 100644 --- a/src/mess/machine/wangpc_mvc.c +++ b/src/mess/machine/wangpc_mvc.c @@ -139,7 +139,6 @@ WRITE_LINE_MEMBER( wangpc_mvc_device::vsync_w ) static MC6845_INTERFACE( crtc_intf ) { - SCREEN_TAG, false, 10, NULL, @@ -165,7 +164,7 @@ static MACHINE_CONFIG_FRAGMENT( wangpc_mvc ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) MCFG_SCREEN_REFRESH_RATE(60) - MCFG_MC6845_ADD(MC6845_TAG, MC6845_1, XTAL_14_31818MHz/16, crtc_intf) + MCFG_MC6845_ADD(MC6845_TAG, MC6845_1, SCREEN_TAG, XTAL_14_31818MHz/16, crtc_intf) MACHINE_CONFIG_END diff --git a/src/mess/machine/wangpc_tig.c b/src/mess/machine/wangpc_tig.c index f2d4fd8a6130d..a0b99469b927b 100644 --- a/src/mess/machine/wangpc_tig.c +++ b/src/mess/machine/wangpc_tig.c @@ -93,7 +93,6 @@ static UPD7220_DRAW_TEXT_LINE( hgdc_display_text) static UPD7220_INTERFACE( hgdc0_intf ) { - SCREEN_TAG, NULL, hgdc_display_text, DEVCB_NULL, @@ -117,7 +116,6 @@ static UPD7220_DISPLAY_PIXELS( hgdc_display_pixels ) static UPD7220_INTERFACE( hgdc1_intf ) { - SCREEN_TAG, hgdc_display_pixels, NULL, DEVCB_NULL, diff --git a/src/mess/video/abc1600.c b/src/mess/video/abc1600.c index 39b90d06f7938..a6084d166704d 100644 --- a/src/mess/video/abc1600.c +++ b/src/mess/video/abc1600.c @@ -1026,7 +1026,6 @@ static MC6845_ON_UPDATE_ADDR_CHANGED( crtc_update ) static MC6845_INTERFACE( crtc_intf ) { - SCREEN_TAG, false, 32, NULL, @@ -1119,5 +1118,5 @@ MACHINE_CONFIG_FRAGMENT( abc1600_video ) MCFG_SCREEN_SIZE(958, 1067) MCFG_SCREEN_VISIBLE_AREA(0, 958-1, 0, 1067-1) - MCFG_MC6845_ADD(SY6845E_TAG, SY6845E, XTAL_64MHz/32, crtc_intf) + MCFG_MC6845_ADD(SY6845E_TAG, SY6845E, SCREEN_TAG, XTAL_64MHz/32, crtc_intf) MACHINE_CONFIG_END diff --git a/src/mess/video/abc800.c b/src/mess/video/abc800.c index 869377f16bc13..3d28a653c215d 100644 --- a/src/mess/video/abc800.c +++ b/src/mess/video/abc800.c @@ -273,7 +273,6 @@ static MC6845_UPDATE_ROW( abc800m_update_row ) static MC6845_INTERFACE( crtc_intf ) { - SCREEN_TAG, false, ABC800_CHAR_WIDTH, NULL, @@ -317,7 +316,7 @@ UINT32 abc800m_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, //------------------------------------------------- MACHINE_CONFIG_FRAGMENT( abc800m_video ) - MCFG_MC6845_ADD(MC6845_TAG, MC6845, ABC800_CCLK, crtc_intf) + MCFG_MC6845_ADD(MC6845_TAG, MC6845, SCREEN_TAG, ABC800_CCLK, crtc_intf) MCFG_SCREEN_ADD(SCREEN_TAG, RASTER) MCFG_SCREEN_UPDATE_DRIVER(abc800m_state, screen_update) diff --git a/src/mess/video/abc802.c b/src/mess/video/abc802.c index b3364eef3ebdf..b05b9beaffa19 100644 --- a/src/mess/video/abc802.c +++ b/src/mess/video/abc802.c @@ -189,7 +189,6 @@ WRITE_LINE_MEMBER( abc802_state::vs_w ) static MC6845_INTERFACE( crtc_intf ) { - SCREEN_TAG, false, ABC800_CHAR_WIDTH, NULL, @@ -237,7 +236,7 @@ UINT32 abc802_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, //------------------------------------------------- MACHINE_CONFIG_FRAGMENT( abc802_video ) - MCFG_MC6845_ADD(MC6845_TAG, MC6845, ABC800_CCLK, crtc_intf) + MCFG_MC6845_ADD(MC6845_TAG, MC6845, SCREEN_TAG, ABC800_CCLK, crtc_intf) MCFG_SCREEN_ADD(SCREEN_TAG, RASTER) MCFG_SCREEN_UPDATE_DRIVER(abc802_state, screen_update) diff --git a/src/mess/video/abc806.c b/src/mess/video/abc806.c index fd5908b3ad8eb..13ada077d7a10 100644 --- a/src/mess/video/abc806.c +++ b/src/mess/video/abc806.c @@ -411,7 +411,6 @@ WRITE_LINE_MEMBER( abc806_state::vs_w ) static MC6845_INTERFACE( crtc_intf ) { - SCREEN_TAG, false, ABC800_CHAR_WIDTH, NULL, @@ -527,7 +526,7 @@ UINT32 abc806_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, //------------------------------------------------- MACHINE_CONFIG_FRAGMENT( abc806_video ) - MCFG_MC6845_ADD(MC6845_TAG, MC6845, ABC800_CCLK, crtc_intf) + MCFG_MC6845_ADD(MC6845_TAG, MC6845, SCREEN_TAG, ABC800_CCLK, crtc_intf) MCFG_SCREEN_ADD(SCREEN_TAG, RASTER) MCFG_SCREEN_UPDATE_DRIVER(abc806_state, screen_update) diff --git a/src/mess/video/bbc.c b/src/mess/video/bbc.c index 8bf66580a8c26..5aadc335da694 100644 --- a/src/mess/video/bbc.c +++ b/src/mess/video/bbc.c @@ -257,7 +257,6 @@ WRITE_LINE_MEMBER(bbc_state::bbc_vsync) MC6845_INTERFACE( bbc_mc6845_intf ) { - "screen", /* screen number */ false, /* show border area */ 8, /* numbers of pixels per video memory address */ NULL, /* begin_update */ diff --git a/src/mess/video/comx35.c b/src/mess/video/comx35.c index ef6580927f4b5..ba3e73296f1e7 100644 --- a/src/mess/video/comx35.c +++ b/src/mess/video/comx35.c @@ -80,7 +80,6 @@ WRITE_LINE_MEMBER( comx35_state::prd_w ) static CDP1869_INTERFACE( pal_cdp1869_intf ) { - SCREEN_TAG, CDP1869_COLOR_CLK_PAL, CDP1869_PAL, comx35_pcb_r, @@ -91,7 +90,6 @@ static CDP1869_INTERFACE( pal_cdp1869_intf ) static CDP1869_INTERFACE( ntsc_cdp1869_intf ) { - SCREEN_TAG, CDP1869_COLOR_CLK_NTSC, CDP1869_NTSC, comx35_pcb_r, @@ -115,6 +113,7 @@ MACHINE_CONFIG_FRAGMENT( comx35_pal_video ) MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_CDP1869_ADD(CDP1869_TAG, CDP1869_DOT_CLK_PAL, pal_cdp1869_intf, cdp1869_page_ram) + MCFG_CDP1869_SET_SCREEN(SCREEN_TAG) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") @@ -128,6 +127,7 @@ MACHINE_CONFIG_FRAGMENT( comx35_ntsc_video ) MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_CDP1869_ADD(CDP1869_TAG, CDP1869_DOT_CLK_NTSC, ntsc_cdp1869_intf, cdp1869_page_ram) + MCFG_CDP1869_SET_SCREEN(SCREEN_TAG) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") diff --git a/src/mess/video/crtc_ega.c b/src/mess/video/crtc_ega.c index 88bdf7a393271..8aa7237c9cc63 100644 --- a/src/mess/video/crtc_ega.c +++ b/src/mess/video/crtc_ega.c @@ -26,7 +26,6 @@ void crtc_ega_device::device_config_complete() } else { - m_screen_tag = NULL; m_hpixels_per_column = 0; m_begin_update = NULL; m_update_row = NULL; @@ -40,7 +39,8 @@ void crtc_ega_device::device_config_complete() crtc_ega_device::crtc_ega_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : device_t(mconfig, CRTC_EGA, "crtc_EGA", tag, owner, clock, "crtc_ega", __FILE__) + : device_t(mconfig, CRTC_EGA, "crtc_EGA", tag, owner, clock, "crtc_ega", __FILE__), + device_video_interface(mconfig, *this, false) { } @@ -600,16 +600,6 @@ void crtc_ega_device::device_start() m_res_out_vsync_func.resolve(m_out_vsync_func, *this); m_res_out_vblank_func.resolve(m_out_vblank_func, *this); - /* get the screen device */ - if ( m_screen_tag != NULL ) - { - astring tempstring; - m_screen = downcast(machine().device(siblingtag(tempstring,m_screen_tag))); - assert(m_screen != NULL); - } - else - m_screen = NULL; - /* create the timers */ m_line_timer = timer_alloc(TIMER_LINE); m_de_off_timer = timer_alloc(TIMER_DE_OFF); diff --git a/src/mess/video/crtc_ega.h b/src/mess/video/crtc_ega.h index ef87ca959c3d4..d211a63b888d3 100644 --- a/src/mess/video/crtc_ega.h +++ b/src/mess/video/crtc_ega.h @@ -16,6 +16,8 @@ MCFG_DEVICE_ADD(_tag, CRTC_EGA, _clock) \ MCFG_DEVICE_CONFIG(_intrf) +#define MCFG_CRTC_EGA_SET_SCREEN MCFG_VIDEO_SET_SCREEN + class crtc_ega_device; @@ -37,7 +39,6 @@ typedef void (*crtc_ega_end_update_func)(crtc_ega_device *device, bitmap_ind16 & /* interface */ struct crtc_ega_interface { - const char *m_screen_tag; /* screen we are acting on */ int m_hpixels_per_column; /* number of pixels per video memory address */ /* if specified, this gets called before any pixel update, @@ -68,6 +69,7 @@ struct crtc_ega_interface class crtc_ega_device : public device_t, + public device_video_interface, public crtc_ega_interface { public: @@ -111,8 +113,6 @@ class crtc_ega_device : public device_t, virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); private: - screen_device *m_screen; - devcb_resolved_write_line m_res_out_de_func; devcb_resolved_write_line m_res_out_cur_func; devcb_resolved_write_line m_res_out_hsync_func; diff --git a/src/mess/video/dgn_beta.c b/src/mess/video/dgn_beta.c index a93ee93685552..77f7cbc78b882 100644 --- a/src/mess/video/dgn_beta.c +++ b/src/mess/video/dgn_beta.c @@ -258,7 +258,6 @@ WRITE_LINE_MEMBER(dgn_beta_state::dgnbeta_vsync_changed) MC6845_INTERFACE( dgnbeta_crtc6845_interface ) { - "screen", false, 16 /*?*/, NULL, diff --git a/src/mess/video/ef9345.c b/src/mess/video/ef9345.c index 044d01786bce3..50e2f582cac29 100644 --- a/src/mess/video/ef9345.c +++ b/src/mess/video/ef9345.c @@ -43,29 +43,6 @@ const address_space_config *ef9345_device::memory_space_config(address_spacenum return (spacenum == AS_0) ? &m_space_config : NULL; } -//------------------------------------------------- -// device_config_complete - perform any -// operations now that the configuration is -// complete -//------------------------------------------------- - -void ef9345_device::device_config_complete() -{ - // inherit a copy of the static data - const ef9345_interface *intf = reinterpret_cast(static_config()); - - if (intf != NULL) - { - *static_cast(this) = *intf; - } - // or initialize to defaults if none provided - else - { - screen_tag = NULL; - } -} - - //************************************************************************** // INLINE HELPERS //************************************************************************** @@ -123,6 +100,7 @@ inline void ef9345_device::inc_y(UINT8 r) ef9345_device::ef9345_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, EF9345, "EF9345", tag, owner, clock, "ef9345", __FILE__), device_memory_interface(mconfig, *this), + device_video_interface(mconfig, *this), m_space_config("videoram", ENDIANNESS_LITTLE, 8, 16, 0, NULL, *ADDRESS_MAP_NAME(ef9345)) { } @@ -133,10 +111,6 @@ ef9345_device::ef9345_device(const machine_config &mconfig, const char *tag, dev void ef9345_device::device_start() { - m_screen = machine().device(screen_tag); - - assert(m_screen != NULL); - m_busy_timer = timer_alloc(BUSY_TIMER); m_blink_timer = timer_alloc(BLINKING_TIMER); diff --git a/src/mess/video/ef9345.h b/src/mess/video/ef9345.h index d77ceb483e9e7..037f3e355fd67 100644 --- a/src/mess/video/ef9345.h +++ b/src/mess/video/ef9345.h @@ -21,18 +21,11 @@ // TYPE DEFINITIONS //************************************************************************** -// ======================> ef9345_interface - -struct ef9345_interface -{ - const char *screen_tag; // screen we are acting on -}; - // ======================> ef9345_device class ef9345_device : public device_t, public device_memory_interface, - public ef9345_interface + public device_video_interface { public: // construction/destruction @@ -49,8 +42,6 @@ class ef9345_device : public device_t, virtual void device_start(); virtual void device_reset(); virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); - // device_config overrides - virtual void device_config_complete(); // device_config_memory_interface overrides virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const; @@ -92,8 +83,6 @@ class ef9345_device : public device_t, memory_region *m_charset; address_space *m_videoram; - screen_device *m_screen; //screen we are acting on - UINT8 m_bf; //busy flag UINT8 m_char_mode; //40 or 80 chars for line UINT8 m_acc_char[0x2000]; //accented chars diff --git a/src/mess/video/gb_lcd.c b/src/mess/video/gb_lcd.c index 6d46cb7dcc7c2..b72706fb9264c 100644 --- a/src/mess/video/gb_lcd.c +++ b/src/mess/video/gb_lcd.c @@ -180,12 +180,14 @@ const device_type GB_LCD_CGB = &device_creator; gb_lcd_device::gb_lcd_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source), + device_video_interface(mconfig, *this), m_sgb_border_hack(0) { } gb_lcd_device::gb_lcd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, GB_LCD_DMG, "DMG LCD", tag, owner, clock, "dmg_lcd", __FILE__), + device_video_interface(mconfig, *this), m_sgb_border_hack(0) { } @@ -219,7 +221,6 @@ void gb_lcd_device::common_start() machine().save().register_postload(save_prepost_delegate(FUNC(gb_lcd_device::videoptr_restore), this)); m_maincpu = machine().device("maincpu"); - m_screen = machine().device("screen"); save_pointer(NAME(m_oam), 0x100); save_item(NAME(m_window_lines_drawn)); diff --git a/src/mess/video/gb_lcd.h b/src/mess/video/gb_lcd.h index 96e257f110451..1ca596aab74a3 100644 --- a/src/mess/video/gb_lcd.h +++ b/src/mess/video/gb_lcd.h @@ -36,7 +36,8 @@ struct layer_struct { }; -class gb_lcd_device : public device_t +class gb_lcd_device : public device_t, + public device_video_interface { public: gb_lcd_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); @@ -70,7 +71,6 @@ class gb_lcd_device : public device_t // pointer to the main system cpu_device *m_maincpu; - screen_device *m_screen; // state variables bitmap_ind16 m_bitmap; diff --git a/src/mess/video/isa_cga.c b/src/mess/video/isa_cga.c index 12b0b1d93296e..b8ef7d6418357 100644 --- a/src/mess/video/isa_cga.c +++ b/src/mess/video/isa_cga.c @@ -606,7 +606,6 @@ static MC6845_UPDATE_ROW( cga_update_row ) static MC6845_INTERFACE( mc6845_cga_intf ) { - CGA_SCREEN_NAME, /* screen number */ false, /* show border area */ 8, /* numbers of pixels per video memory address */ NULL, /* begin_update */ @@ -630,7 +629,7 @@ static MACHINE_CONFIG_FRAGMENT( cga ) MCFG_PALETTE_LENGTH(/* CGA_PALETTE_SETS * 16*/ 65536 ) - MCFG_MC6845_ADD(CGA_MC6845_NAME, MC6845, XTAL_14_31818MHz/8, mc6845_cga_intf) + MCFG_MC6845_ADD(CGA_MC6845_NAME, MC6845, CGA_SCREEN_NAME, XTAL_14_31818MHz/8, mc6845_cga_intf) MACHINE_CONFIG_END diff --git a/src/mess/video/isa_ega.c b/src/mess/video/isa_ega.c index 99853b7e6180c..6fa4f9a23d373 100644 --- a/src/mess/video/isa_ega.c +++ b/src/mess/video/isa_ega.c @@ -456,7 +456,6 @@ static CRTC_EGA_UPDATE_ROW( ega_update_row ); static CRTC_EGA_INTERFACE( crtc_ega_ega_intf ) { - EGA_SCREEN_NAME, /* screen number */ 8, /* numbers of pixels per video memory address */ NULL, /* begin_update */ ega_update_row, /* update_row */ @@ -475,6 +474,7 @@ MACHINE_CONFIG_FRAGMENT( pcvideo_ega ) MCFG_PALETTE_LENGTH( 64 ) MCFG_CRTC_EGA_ADD(EGA_CRTC_NAME, 16257000/8, crtc_ega_ega_intf) + MCFG_CRTC_EGA_SET_SCREEN(EGA_SCREEN_NAME) MACHINE_CONFIG_END ROM_START( ega ) diff --git a/src/mess/video/isa_mda.c b/src/mess/video/isa_mda.c index 1b8165cb6f019..299daf4536f2e 100644 --- a/src/mess/video/isa_mda.c +++ b/src/mess/video/isa_mda.c @@ -77,7 +77,6 @@ GFXDECODE_END static MC6845_INTERFACE( mc6845_mda_intf ) { - MDA_SCREEN_NAME, /* screen number */ false, /* show border area */ 9, /* number of pixels per video memory address */ NULL, /* begin_update */ @@ -108,7 +107,7 @@ MACHINE_CONFIG_FRAGMENT( pcvideo_mda ) MCFG_PALETTE_LENGTH( 4 ) - MCFG_MC6845_ADD( MDA_MC6845_NAME, MC6845, MDA_CLOCK/9, mc6845_mda_intf) + MCFG_MC6845_ADD( MDA_MC6845_NAME, MC6845, MDA_SCREEN_NAME, MDA_CLOCK/9, mc6845_mda_intf) //MCFG_GFXDECODE(pcmda) @@ -498,7 +497,6 @@ The divder/pixels per 6845 clock is 9 for text mode and 16 for graphics mode. static MC6845_INTERFACE( mc6845_hercules_intf ) { - HERCULES_SCREEN_NAME, /* screen number */ false, /* show border area */ 9, /* number of pixels per video memory address */ NULL, /* begin_update */ @@ -522,7 +520,7 @@ MACHINE_CONFIG_FRAGMENT( pcvideo_hercules ) MCFG_PALETTE_LENGTH( 4 ) - MCFG_MC6845_ADD( HERCULES_MC6845_NAME, MC6845, MDA_CLOCK/9, mc6845_hercules_intf) + MCFG_MC6845_ADD( HERCULES_MC6845_NAME, MC6845, HERCULES_SCREEN_NAME, MDA_CLOCK/9, mc6845_hercules_intf) //MCFG_GFXDECODE(pcherc) diff --git a/src/mess/video/k1ge.c b/src/mess/video/k1ge.c index c05ee880e13a2..5282282e448f0 100644 --- a/src/mess/video/k1ge.c +++ b/src/mess/video/k1ge.c @@ -810,7 +810,6 @@ void k1ge_device::device_start() m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(k1ge_device::timer_callback), this)); m_hblank_on_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(k1ge_device::hblank_on_timer_callback), this)); - m_screen = machine().device(m_screen_tag); m_vram = auto_alloc_array_clear(machine(), UINT8, 0x4000); m_bitmap = auto_bitmap_ind16_alloc( machine(), m_screen->width(), m_screen->height() ); @@ -874,6 +873,7 @@ const device_type K1GE = &device_creator; k1ge_device::k1ge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, K1GE, "K1GE Monochrome Graphics + LCD", tag, owner, clock, "k1ge", __FILE__) + , device_video_interface(mconfig, *this) , m_vblank_pin_w(*this) , m_hblank_pin_w(*this) { @@ -881,6 +881,7 @@ k1ge_device::k1ge_device(const machine_config &mconfig, const char *tag, device_ k1ge_device::k1ge_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source) + , device_video_interface(mconfig, *this) , m_vblank_pin_w(*this) , m_hblank_pin_w(*this) { diff --git a/src/mess/video/k1ge.h b/src/mess/video/k1ge.h index 9651f86ad498c..66bdd1b97fbcd 100644 --- a/src/mess/video/k1ge.h +++ b/src/mess/video/k1ge.h @@ -5,18 +5,19 @@ #define MCFG_K1GE_ADD(_tag, _clock, _screen, _vblank, _hblank ) \ MCFG_DEVICE_ADD( _tag, K1GE, _clock ) \ - k1ge_device::static_set_screen( *device, _screen ); \ + MCFG_VIDEO_SET_SCREEN( _screen ) \ devcb = &k1ge_device::static_set_vblank_callback( *device, DEVCB2_##_vblank ); \ devcb = &k1ge_device::static_set_hblank_callback( *device, DEVCB2_##_hblank ); #define MCFG_K2GE_ADD(_tag, _clock, _screen, _vblank, _hblank ) \ MCFG_DEVICE_ADD( _tag, K2GE, _clock ) \ - k1ge_device::static_set_screen( *device, _screen ); \ + MCFG_VIDEO_SET_SCREEN( _screen ) \ devcb = &k1ge_device::static_set_vblank_callback( *device, DEVCB2_##_vblank ); \ devcb = &k1ge_device::static_set_hblank_callback( *device, DEVCB2_##_hblank ); -class k1ge_device : public device_t +class k1ge_device : public device_t, + public device_video_interface { public: k1ge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); @@ -30,7 +31,6 @@ class k1ge_device : public device_t void update( bitmap_ind16 &bitmap, const rectangle &cliprect ); // Static methods - static void static_set_screen(device_t &device, const char *screen_name) { downcast(device).m_screen_tag = screen_name; } template static devcb2_base &static_set_vblank_callback(device_t &device, _Object object) { return downcast(device).m_vblank_pin_w.set_callback(object); } template static devcb2_base &static_set_hblank_callback(device_t &device, _Object object) { return downcast(device).m_hblank_pin_w.set_callback(object); } @@ -40,8 +40,6 @@ class k1ge_device : public device_t virtual void device_start(); virtual void device_reset(); - const char *m_screen_tag; - screen_device *m_screen; devcb2_write_line m_vblank_pin_w; devcb2_write_line m_hblank_pin_w; UINT8 *m_vram; diff --git a/src/mess/video/kyocera.c b/src/mess/video/kyocera.c index 0043b10a33e5d..dac55133b9634 100644 --- a/src/mess/video/kyocera.c +++ b/src/mess/video/kyocera.c @@ -37,7 +37,6 @@ UINT32 tandy200_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap static HD61830_INTERFACE( lcdc_intf ) { - SCREEN_TAG, DEVCB_NULL }; diff --git a/src/mess/video/mbc55x.c b/src/mess/video/mbc55x.c index 64bb0200c40b1..85b0a0b344760 100644 --- a/src/mess/video/mbc55x.c +++ b/src/mess/video/mbc55x.c @@ -160,7 +160,6 @@ WRITE_LINE_MEMBER( mbc55x_state::vid_vsync_changed ) MC6845_INTERFACE( mb55x_mc6845_intf ) { - SCREEN_TAG, /* screen number */ false, /* show border area */ 8, /* numbers of pixels per video memory address */ NULL, /* begin_update */ diff --git a/src/mess/video/mikromik.c b/src/mess/video/mikromik.c index ba6056de72521..516c58a952367 100644 --- a/src/mess/video/mikromik.c +++ b/src/mess/video/mikromik.c @@ -35,7 +35,6 @@ static I8275_DISPLAY_PIXELS( crtc_display_pixels ) static const i8275_interface crtc_intf = { - SCREEN_TAG, 8, 0, DEVCB_DEVICE_LINE_MEMBER(I8237_TAG, am9517a_device, dreq0_w), @@ -74,7 +73,6 @@ static UPD7220_DISPLAY_PIXELS( hgdc_display_pixels ) static UPD7220_INTERFACE( hgdc_intf ) { - SCREEN_TAG, hgdc_display_pixels, NULL, DEVCB_NULL, diff --git a/src/mess/video/mos6566.c b/src/mess/video/mos6566.c index 2c8183197adda..6ee73e4774c45 100644 --- a/src/mess/video/mos6566.c +++ b/src/mess/video/mos6566.c @@ -582,6 +582,7 @@ inline void mos6566_device::draw_multi( UINT16 p, UINT8 c0, UINT8 c1, UINT8 c2, mos6566_device::mos6566_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, MOS6566, "MOS6566", tag, owner, clock, "mos6566", __FILE__), device_memory_interface(mconfig, *this), + device_video_interface(mconfig, *this), device_execute_interface(mconfig, *this), m_icount(0), m_variant(TYPE_6566), @@ -597,6 +598,7 @@ mos6566_device::mos6566_device(const machine_config &mconfig, const char *tag, d mos6566_device::mos6566_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source), device_memory_interface(mconfig, *this), + device_video_interface(mconfig, *this), device_execute_interface(mconfig, *this), m_icount(0), m_variant(variant), @@ -657,7 +659,6 @@ void mos6566_device::device_start() else m_cpu = machine().firstcpu; - m_screen = machine().device(m_screen_tag); m_screen->register_screen_bitmap(m_bitmap); for (int i = 0; i < 256; i++) diff --git a/src/mess/video/mos6566.h b/src/mess/video/mos6566.h index 713ee68c8af67..fe4ca992d6a2b 100644 --- a/src/mess/video/mos6566.h +++ b/src/mess/video/mos6566.h @@ -93,7 +93,8 @@ #define MCFG_MOS6566_ADD(_tag, _screen_tag, _clock, _videoram_map, _colorram_map, _irq) \ MCFG_DEVICE_ADD(_tag, MOS6566, _clock) \ - downcast(device)->set_callbacks(_screen_tag, NULL, DEVCB2_##_irq, DEVCB2_NULL); \ + MCFG_VIDEO_SET_SCREEN(_screen_tag) \ + downcast(device)->set_callbacks(NULL, DEVCB2_##_irq, DEVCB2_NULL); \ MCFG_DEVICE_ADDRESS_MAP(AS_0, _videoram_map) \ MCFG_DEVICE_ADDRESS_MAP(AS_1, _colorram_map) \ MCFG_SCREEN_ADD(_screen_tag, RASTER) \ @@ -104,7 +105,8 @@ #define MCFG_MOS6567_ADD(_tag, _screen_tag, _clock, _videoram_map, _colorram_map, _irq) \ MCFG_DEVICE_ADD(_tag, MOS6567, _clock) \ - downcast(device)->set_callbacks(_screen_tag, NULL, DEVCB2_##_irq, DEVCB2_NULL); \ + MCFG_VIDEO_SET_SCREEN(_screen_tag) \ + downcast(device)->set_callbacks(NULL, DEVCB2_##_irq, DEVCB2_NULL); \ MCFG_DEVICE_ADDRESS_MAP(AS_0, _videoram_map) \ MCFG_DEVICE_ADDRESS_MAP(AS_1, _colorram_map) \ MCFG_SCREEN_ADD(_screen_tag, RASTER) \ @@ -115,7 +117,8 @@ #define MCFG_MOS8562_ADD(_tag, _screen_tag, _clock, _videoram_map, _colorram_map, _irq) \ MCFG_DEVICE_ADD(_tag, MOS8562, _clock) \ - downcast(device)->set_callbacks(_screen_tag, NULL, DEVCB2_##_irq, DEVCB2_NULL); \ + MCFG_VIDEO_SET_SCREEN(_screen_tag) \ + downcast(device)->set_callbacks(NULL, DEVCB2_##_irq, DEVCB2_NULL); \ MCFG_DEVICE_ADDRESS_MAP(AS_0, _videoram_map) \ MCFG_DEVICE_ADDRESS_MAP(AS_1, _colorram_map) \ MCFG_SCREEN_ADD(_screen_tag, RASTER) \ @@ -126,7 +129,8 @@ #define MCFG_MOS8564_ADD(_tag, _screen_tag, _cpu_tag, _clock, _videoram_map, _colorram_map, _irq, _k) \ MCFG_DEVICE_ADD(_tag, MOS8564, _clock) \ - downcast(device)->set_callbacks(_screen_tag, _cpu_tag, DEVCB2_##_irq, DEVCB2_##_k); \ + MCFG_VIDEO_SET_SCREEN(_screen_tag) \ + downcast(device)->set_callbacks(_cpu_tag, DEVCB2_##_irq, DEVCB2_##_k); \ MCFG_DEVICE_ADDRESS_MAP(AS_0, _videoram_map) \ MCFG_DEVICE_ADDRESS_MAP(AS_1, _colorram_map) \ MCFG_SCREEN_ADD(_screen_tag, RASTER) \ @@ -137,7 +141,8 @@ #define MCFG_MOS6569_ADD(_tag, _screen_tag, _clock, _videoram_map, _colorram_map, _irq) \ MCFG_DEVICE_ADD(_tag, MOS6569, _clock) \ - downcast(device)->set_callbacks(_screen_tag, NULL, DEVCB2_##_irq, DEVCB2_NULL); \ + MCFG_VIDEO_SET_SCREEN(_screen_tag) \ + downcast(device)->set_callbacks(NULL, DEVCB2_##_irq, DEVCB2_NULL); \ MCFG_DEVICE_ADDRESS_MAP(AS_0, _videoram_map) \ MCFG_DEVICE_ADDRESS_MAP(AS_1, _colorram_map) \ MCFG_SCREEN_ADD(_screen_tag, RASTER) \ @@ -148,7 +153,8 @@ #define MCFG_MOS8565_ADD(_tag, _screen_tag, _clock, _videoram_map, _colorram_map, _irq) \ MCFG_DEVICE_ADD(_tag, MOS8565, _clock) \ - downcast(device)->set_callbacks(_screen_tag, NULL, DEVCB2_##_irq, DEVCB2_NULL); \ + MCFG_VIDEO_SET_SCREEN(_screen_tag) \ + downcast(device)->set_callbacks(NULL, DEVCB2_##_irq, DEVCB2_NULL); \ MCFG_DEVICE_ADDRESS_MAP(AS_0, _videoram_map) \ MCFG_DEVICE_ADDRESS_MAP(AS_1, _colorram_map) \ MCFG_SCREEN_ADD(_screen_tag, RASTER) \ @@ -159,7 +165,8 @@ #define MCFG_MOS8566_ADD(_tag, _screen_tag, _cpu_tag, _clock, _videoram_map, _colorram_map, _irq, _k) \ MCFG_DEVICE_ADD(_tag, MOS8566, _clock) \ - downcast(device)->set_callbacks(_screen_tag, _cpu_tag, DEVCB2_##_irq, DEVCB2_##_k); \ + MCFG_VIDEO_SET_SCREEN(_screen_tag) \ + downcast(device)->set_callbacks(_cpu_tag, DEVCB2_##_irq, DEVCB2_##_k); \ MCFG_DEVICE_ADDRESS_MAP(AS_0, _videoram_map) \ MCFG_DEVICE_ADDRESS_MAP(AS_1, _colorram_map) \ MCFG_SCREEN_ADD(_screen_tag, RASTER) \ @@ -269,6 +276,7 @@ class mos6566_device : public device_t, public device_memory_interface, + public device_video_interface, public device_execute_interface { public: @@ -276,8 +284,7 @@ class mos6566_device : public device_t, mos6566_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, const char *shortname, const char *source); mos6566_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - template void set_callbacks(const char *screen_tag, const char *cpu_tag, _irq irq, _k k) { - m_screen_tag = screen_tag; + template void set_callbacks(const char *cpu_tag, _irq irq, _k k) { m_cpu_tag = cpu_tag; m_write_irq.set_callback(irq); m_write_k.set_callback(k); @@ -355,9 +362,7 @@ class mos6566_device : public device_t, devcb2_write_line m_write_aec; devcb2_write8 m_write_k; - const char *m_screen_tag; const char *m_cpu_tag; - screen_device *m_screen; // screen which sets bitmap properties cpu_device *m_cpu; int m_phi0; diff --git a/src/mess/video/nick.c b/src/mess/video/nick.c index 883feb96708f0..90a38a2fc22be 100644 --- a/src/mess/video/nick.c +++ b/src/mess/video/nick.c @@ -105,6 +105,7 @@ ADDRESS_MAP_END nick_device::nick_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, NICK, "NICK", tag, owner, clock, "nick", __FILE__), device_memory_interface(mconfig, *this), + device_video_interface(mconfig, *this), m_space_config("vram", ENDIANNESS_LITTLE, 8, 16, 0, *ADDRESS_MAP_NAME(nick_map)), m_write_virq(*this), horizontal_clock(0), @@ -126,7 +127,6 @@ nick_device::nick_device(const machine_config &mconfig, const char *tag, device_ void nick_device::device_start() { - m_screen = machine().device(m_screen_tag); m_screen->register_screen_bitmap(m_bitmap); calc_visible_clocks(ENTERPRISE_SCREEN_WIDTH); diff --git a/src/mess/video/nick.h b/src/mess/video/nick.h index efd6f942a4098..f71010cd14d08 100644 --- a/src/mess/video/nick.h +++ b/src/mess/video/nick.h @@ -30,7 +30,7 @@ MCFG_SCREEN_VISIBLE_AREA(0, ENTERPRISE_SCREEN_WIDTH-1, 0, ENTERPRISE_SCREEN_HEIGHT-1) \ MCFG_SCREEN_UPDATE_DEVICE(_tag, nick_device, screen_update) \ MCFG_DEVICE_ADD(_tag, NICK, _clock) \ - downcast(device)->set_screen_tag(_screen_tag); \ + MCFG_VIDEO_SET_SCREEN(_screen_tag) \ downcast(device)->set_virq_callback(DEVCB2_##_virq); @@ -66,13 +66,13 @@ struct LPT_ENTRY // ======================> nick_device class nick_device : public device_t, - public device_memory_interface + public device_memory_interface, + public device_video_interface { public: // construction/destruction nick_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - void set_screen_tag(const char *screen_tag) { m_screen_tag = screen_tag; } template void set_virq_callback(_virq virq) { m_write_virq.set_callback(virq); } virtual DECLARE_ADDRESS_MAP(vram_map, 8); @@ -161,8 +161,6 @@ class nick_device : public device_t, int m_virq; - const char *m_screen_tag; - screen_device *m_screen; bitmap_rgb32 m_bitmap; rgb_t m_palette[256]; diff --git a/src/mess/video/nubus_m2hires.c b/src/mess/video/nubus_m2hires.c index 81912b13b83d1..85de8ea3d229f 100644 --- a/src/mess/video/nubus_m2hires.c +++ b/src/mess/video/nubus_m2hires.c @@ -65,14 +65,18 @@ const rom_entry *nubus_m2hires_device::device_rom_region() const nubus_m2hires_device::nubus_m2hires_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, NUBUS_M2HIRES, "Macintosh II Hi-Resolution video card", tag, owner, clock, "nb_m2hr", __FILE__), + device_video_interface(mconfig, *this), device_nubus_card_interface(mconfig, *this) { + m_screen_tag = M2HIRES_SCREEN_NAME; } nubus_m2hires_device::nubus_m2hires_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source), + device_video_interface(mconfig, *this), device_nubus_card_interface(mconfig, *this) { + m_screen_tag = M2HIRES_SCREEN_NAME; } //------------------------------------------------- @@ -99,7 +103,7 @@ void nubus_m2hires_device::device_start() m_nubus->install_device(slotspace+0x80000, slotspace+0xeffff, read32_delegate(FUNC(nubus_m2hires_device::m2hires_r), this), write32_delegate(FUNC(nubus_m2hires_device::m2hires_w), this)); m_timer = timer_alloc(0, NULL); - m_screen = NULL; // can we look this up now? + m_timer->adjust(m_screen->time_until_pos(479, 0), 0); } //------------------------------------------------- @@ -142,13 +146,6 @@ UINT32 nubus_m2hires_device::screen_update(screen_device &screen, bitmap_rgb32 & int x, y; UINT8 pixels, *vram; - // first time? kick off the VBL timer - if (!m_screen) - { - m_screen = &screen; - m_timer->adjust(m_screen->time_until_pos(479, 0), 0); - } - vram = m_vram + 0x20; switch (m_mode) diff --git a/src/mess/video/nubus_m2hires.h b/src/mess/video/nubus_m2hires.h index 18b73226731e0..6f89514aaaa62 100644 --- a/src/mess/video/nubus_m2hires.h +++ b/src/mess/video/nubus_m2hires.h @@ -14,6 +14,7 @@ class nubus_m2hires_device : public device_t, + public device_video_interface, public device_nubus_card_interface { public: @@ -42,7 +43,6 @@ class nubus_m2hires_device : UINT32 *m_vram32; UINT32 m_mode, m_vbl_disable, m_toggle; UINT32 m_palette[256], m_colors[3], m_count, m_clutoffs; - screen_device *m_screen; emu_timer *m_timer; }; diff --git a/src/mess/video/nubus_m2video.c b/src/mess/video/nubus_m2video.c index 711a1dbfe33af..5da60d0c475dd 100644 --- a/src/mess/video/nubus_m2video.c +++ b/src/mess/video/nubus_m2video.c @@ -66,14 +66,18 @@ const rom_entry *nubus_m2video_device::device_rom_region() const nubus_m2video_device::nubus_m2video_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, NUBUS_M2VIDEO, "Macintosh II Video Card", tag, owner, clock, "nb_m2vc", __FILE__), + device_video_interface(mconfig, *this), device_nubus_card_interface(mconfig, *this) { + m_screen_tag = M2VIDEO_SCREEN_NAME; } nubus_m2video_device::nubus_m2video_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source), + device_video_interface(mconfig, *this), device_nubus_card_interface(mconfig, *this) { + m_screen_tag = M2VIDEO_SCREEN_NAME; } //------------------------------------------------- @@ -100,7 +104,7 @@ void nubus_m2video_device::device_start() m_nubus->install_device(slotspace+0x80000, slotspace+0xeffff, read32_delegate(FUNC(nubus_m2video_device::m2video_r), this), write32_delegate(FUNC(nubus_m2video_device::m2video_w), this)); m_timer = timer_alloc(0, NULL); - m_screen = NULL; // can we look this up now? + m_timer->adjust(m_screen->time_until_pos(479, 0), 0); } //------------------------------------------------- @@ -143,13 +147,6 @@ UINT32 nubus_m2video_device::screen_update(screen_device &screen, bitmap_rgb32 & int x, y; UINT8 pixels, *vram; - // first time? kick off the VBL timer - if (!m_screen) - { - m_screen = &screen; - m_timer->adjust(m_screen->time_until_pos(479, 0), 0); - } - vram = m_vram + 0x20; switch (m_mode) diff --git a/src/mess/video/nubus_m2video.h b/src/mess/video/nubus_m2video.h index 00708d1048054..5dcdd15b6838c 100644 --- a/src/mess/video/nubus_m2video.h +++ b/src/mess/video/nubus_m2video.h @@ -14,6 +14,7 @@ class nubus_m2video_device : public device_t, + public device_video_interface, public device_nubus_card_interface { public: @@ -42,7 +43,6 @@ class nubus_m2video_device : UINT32 *m_vram32; UINT32 m_mode, m_vbl_disable, m_toggle; UINT32 m_palette[256], m_colors[3], m_count, m_clutoffs; - screen_device *m_screen; emu_timer *m_timer; }; diff --git a/src/mess/video/nubus_radiustpd.c b/src/mess/video/nubus_radiustpd.c index b4fe9c46ca187..3eaaaa8b643fc 100644 --- a/src/mess/video/nubus_radiustpd.c +++ b/src/mess/video/nubus_radiustpd.c @@ -65,14 +65,18 @@ const rom_entry *nubus_radiustpd_device::device_rom_region() const nubus_radiustpd_device::nubus_radiustpd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, NUBUS_RADIUSTPD, "Radius Two Page Display video card", tag, owner, clock, "nb_rtpd", __FILE__), + device_video_interface(mconfig, *this), device_nubus_card_interface(mconfig, *this) { + m_screen_tag = RADIUSTPD_SCREEN_NAME; } nubus_radiustpd_device::nubus_radiustpd_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source), + device_video_interface(mconfig, *this), device_nubus_card_interface(mconfig, *this) { + m_screen_tag = RADIUSTPD_SCREEN_NAME; } //------------------------------------------------- @@ -100,7 +104,7 @@ void nubus_radiustpd_device::device_start() m_nubus->install_device(slotspace+0x980000, slotspace+0x9effff, read32_delegate(FUNC(nubus_radiustpd_device::radiustpd_r), this), write32_delegate(FUNC(nubus_radiustpd_device::radiustpd_w), this)); m_timer = timer_alloc(0, NULL); - m_screen = NULL; // can we look this up now? + m_timer->adjust(m_screen->time_until_pos(479, 0), 0); } //------------------------------------------------- @@ -143,13 +147,6 @@ UINT32 nubus_radiustpd_device::screen_update(screen_device &screen, bitmap_rgb32 int x, y; UINT8 pixels, *vram; - // first time? kick off the VBL timer - if (!m_screen) - { - m_screen = &screen; - m_timer->adjust(m_screen->time_until_pos(479, 0), 0); - } - vram = m_vram + 0x200; for (y = 0; y < 880; y++) diff --git a/src/mess/video/nubus_radiustpd.h b/src/mess/video/nubus_radiustpd.h index f1e7578a7b818..15dc5454b0e29 100644 --- a/src/mess/video/nubus_radiustpd.h +++ b/src/mess/video/nubus_radiustpd.h @@ -14,6 +14,7 @@ class nubus_radiustpd_device : public device_t, + public device_video_interface, public device_nubus_card_interface { public: @@ -42,7 +43,6 @@ class nubus_radiustpd_device : UINT32 *m_vram32; UINT32 m_mode, m_vbl_disable, m_toggle; UINT32 m_palette[256], m_colors[3], m_count, m_clutoffs; - screen_device *m_screen; emu_timer *m_timer; }; diff --git a/src/mess/video/nubus_spec8.c b/src/mess/video/nubus_spec8.c index 59c534b743da2..f10cee7b37e5a 100644 --- a/src/mess/video/nubus_spec8.c +++ b/src/mess/video/nubus_spec8.c @@ -67,14 +67,18 @@ const rom_entry *nubus_spec8s3_device::device_rom_region() const nubus_spec8s3_device::nubus_spec8s3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, NUBUS_SPEC8S3, "SuperMac Spectrum/8 Series III video card", tag, owner, clock, "nb_sp8s3", __FILE__), + device_video_interface(mconfig, *this), device_nubus_card_interface(mconfig, *this) { + m_screen_tag = SPEC8S3_SCREEN_NAME; } nubus_spec8s3_device::nubus_spec8s3_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source), + device_video_interface(mconfig, *this), device_nubus_card_interface(mconfig, *this) { + m_screen_tag = SPEC8S3_SCREEN_NAME; } //------------------------------------------------- @@ -100,7 +104,7 @@ void nubus_spec8s3_device::device_start() m_nubus->install_device(slotspace+0xd0000, slotspace+0xfffff, read32_delegate(FUNC(nubus_spec8s3_device::spec8s3_r), this), write32_delegate(FUNC(nubus_spec8s3_device::spec8s3_w), this)); m_timer = timer_alloc(0, NULL); - m_screen = NULL; // can we look this up now? + m_timer->adjust(m_screen->time_until_pos(767, 0), 0); } //------------------------------------------------- @@ -146,12 +150,6 @@ UINT32 nubus_spec8s3_device::screen_update(screen_device &screen, bitmap_rgb32 & int x, y; UINT8 pixels, *vram; - // first time? kick off the VBL timer - if (!m_screen) - { - m_screen = &screen; - m_timer->adjust(m_screen->time_until_pos(767, 0), 0); - } vram = m_vram + 0x400; switch (m_mode) diff --git a/src/mess/video/nubus_spec8.h b/src/mess/video/nubus_spec8.h index 87e47f21b095c..8dd02cf09b94c 100644 --- a/src/mess/video/nubus_spec8.h +++ b/src/mess/video/nubus_spec8.h @@ -14,6 +14,7 @@ class nubus_spec8s3_device : public device_t, + public device_video_interface, public device_nubus_card_interface { public: @@ -42,7 +43,6 @@ class nubus_spec8s3_device : UINT32 *m_vram32; UINT32 m_mode, m_vbl_disable; UINT32 m_palette[256], m_colors[3], m_count, m_clutoffs; - screen_device *m_screen; emu_timer *m_timer; private: diff --git a/src/mess/video/nubus_specpdq.c b/src/mess/video/nubus_specpdq.c index a2e4befcd400d..5c4236b1197fe 100644 --- a/src/mess/video/nubus_specpdq.c +++ b/src/mess/video/nubus_specpdq.c @@ -80,14 +80,18 @@ const rom_entry *nubus_specpdq_device::device_rom_region() const nubus_specpdq_device::nubus_specpdq_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, NUBUS_SPECPDQ, "SuperMac Spectrum PDQ video card", tag, owner, clock, "nb_spdq", __FILE__), + device_video_interface(mconfig, *this), device_nubus_card_interface(mconfig, *this) { + m_screen_tag = SPECPDQ_SCREEN_NAME; } nubus_specpdq_device::nubus_specpdq_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source), + device_video_interface(mconfig, *this), device_nubus_card_interface(mconfig, *this) { + m_screen_tag = SPECPDQ_SCREEN_NAME; } //------------------------------------------------- @@ -112,7 +116,7 @@ void nubus_specpdq_device::device_start() m_nubus->install_device(slotspace+0x400000, slotspace+0xfbffff, read32_delegate(FUNC(nubus_specpdq_device::specpdq_r), this), write32_delegate(FUNC(nubus_specpdq_device::specpdq_w), this)); m_timer = timer_alloc(0, NULL); - m_screen = NULL; // can we look this up now? + m_timer->adjust(m_screen->time_until_pos(843, 0), 0); } //------------------------------------------------- @@ -156,11 +160,6 @@ UINT32 nubus_specpdq_device::screen_update(screen_device &screen, bitmap_rgb32 & UINT8 pixels, *vram; // first time? kick off the VBL timer - if (!m_screen) - { - m_screen = &screen; - m_timer->adjust(m_screen->time_until_pos(843, 0), 0); - } vram = m_vram + 0x9000; switch (m_mode) diff --git a/src/mess/video/nubus_specpdq.h b/src/mess/video/nubus_specpdq.h index a55c8f18b44d0..30e39e54d6e29 100644 --- a/src/mess/video/nubus_specpdq.h +++ b/src/mess/video/nubus_specpdq.h @@ -14,6 +14,7 @@ class nubus_specpdq_device : public device_t, + public device_video_interface, public device_nubus_card_interface { public: @@ -42,7 +43,6 @@ class nubus_specpdq_device : UINT32 *m_vram32; UINT32 m_mode, m_vbl_disable; UINT32 m_palette[256], m_colors[3], m_count, m_clutoffs; - screen_device *m_screen; emu_timer *m_timer; private: diff --git a/src/mess/video/nubus_wsportrait.c b/src/mess/video/nubus_wsportrait.c index edaf558710b01..b083a7b802b1b 100644 --- a/src/mess/video/nubus_wsportrait.c +++ b/src/mess/video/nubus_wsportrait.c @@ -68,14 +68,18 @@ const rom_entry *nubus_wsportrait_device::device_rom_region() const nubus_wsportrait_device::nubus_wsportrait_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, NUBUS_WSPORTRAIT, "Macintosh II Portrait Video Card", tag, owner, clock, "nb_wspt", __FILE__), + device_video_interface(mconfig, *this), device_nubus_card_interface(mconfig, *this) { + m_screen_tag = WSPORTRAIT_SCREEN_NAME; } nubus_wsportrait_device::nubus_wsportrait_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source), + device_video_interface(mconfig, *this), device_nubus_card_interface(mconfig, *this) { + m_screen_tag = WSPORTRAIT_SCREEN_NAME; } //------------------------------------------------- @@ -102,7 +106,7 @@ void nubus_wsportrait_device::device_start() m_nubus->install_device(slotspace+0x80000, slotspace+0xeffff, read32_delegate(FUNC(nubus_wsportrait_device::wsportrait_r), this), write32_delegate(FUNC(nubus_wsportrait_device::wsportrait_w), this)); m_timer = timer_alloc(0, NULL); - m_screen = NULL; // can we look this up now? + m_timer->adjust(m_screen->time_until_pos(869, 0), 0); } //------------------------------------------------- @@ -143,12 +147,6 @@ UINT32 nubus_wsportrait_device::screen_update(screen_device &screen, bitmap_rgb3 UINT8 pixels, *vram; // first time? kick off the VBL timer - if (!m_screen) - { - m_screen = &screen; - m_timer->adjust(m_screen->time_until_pos(869, 0), 0); - } - vram = m_vram + 0x80; switch (m_mode) diff --git a/src/mess/video/nubus_wsportrait.h b/src/mess/video/nubus_wsportrait.h index 6c8ee02a43a3b..2ac3f8b436e5f 100644 --- a/src/mess/video/nubus_wsportrait.h +++ b/src/mess/video/nubus_wsportrait.h @@ -14,6 +14,7 @@ class nubus_wsportrait_device : public device_t, + public device_video_interface, public device_nubus_card_interface { public: @@ -42,7 +43,6 @@ class nubus_wsportrait_device : UINT32 *m_vram32; UINT32 m_mode, m_vbl_disable, m_toggle; UINT32 m_palette[256], m_colors[3], m_count, m_clutoffs; - screen_device *m_screen; emu_timer *m_timer; }; diff --git a/src/mess/video/pc1512.c b/src/mess/video/pc1512.c index 9a6591ef8ca94..623e56d558248 100644 --- a/src/mess/video/pc1512.c +++ b/src/mess/video/pc1512.c @@ -528,7 +528,6 @@ static MC6845_UPDATE_ROW( pc1512_update_row ) static MC6845_INTERFACE( crtc_intf ) { - SCREEN_TAG, false, 8, NULL, @@ -623,5 +622,5 @@ MACHINE_CONFIG_FRAGMENT( pc1512_video ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) MCFG_SCREEN_REFRESH_RATE(50) - MCFG_MC6845_ADD(AMS40041_TAG, AMS40041, XTAL_28_63636MHz/32, crtc_intf) + MCFG_MC6845_ADD(AMS40041_TAG, AMS40041, SCREEN_TAG, XTAL_28_63636MHz/32, crtc_intf) MACHINE_CONFIG_END diff --git a/src/mess/video/pc8401a.c b/src/mess/video/pc8401a.c index 8b6a2c3475052..f8bee5742aa16 100644 --- a/src/mess/video/pc8401a.c +++ b/src/mess/video/pc8401a.c @@ -58,7 +58,6 @@ static MC6845_UPDATE_ROW( pc8441a_update_row ) static MC6845_INTERFACE( pc8441a_mc6845_interface ) { - CRT_SCREEN_TAG, false, 6, NULL, @@ -112,5 +111,5 @@ MACHINE_CONFIG_FRAGMENT( pc8500_video ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) MCFG_SCREEN_REFRESH_RATE(50) - MCFG_MC6845_ADD(MC6845_TAG, MC6845, 400000, pc8441a_mc6845_interface) + MCFG_MC6845_ADD(MC6845_TAG, MC6845, CRT_SCREEN_TAG, 400000, pc8441a_mc6845_interface) MACHINE_CONFIG_END diff --git a/src/mess/video/pc_aga.c b/src/mess/video/pc_aga.c index f46d60a74cd77..357ddcca39a44 100644 --- a/src/mess/video/pc_aga.c +++ b/src/mess/video/pc_aga.c @@ -31,7 +31,6 @@ static VIDEO_START( pc200 ); static MC6845_INTERFACE( mc6845_aga_intf ) { - AGA_SCREEN_NAME, /* screen number */ false, /* show border area */ 8, /* numbers of pixels per video memory address */ NULL, /* begin_update */ @@ -75,7 +74,7 @@ MACHINE_CONFIG_FRAGMENT( pcvideo_aga ) MCFG_PALETTE_LENGTH( CGA_PALETTE_SETS * 16 ) MCFG_PALETTE_INIT( pc_aga ) - MCFG_MC6845_ADD( AGA_MC6845_NAME, MC6845, XTAL_14_31818MHz/8, mc6845_aga_intf ) + MCFG_MC6845_ADD( AGA_MC6845_NAME, MC6845, AGA_SCREEN_NAME, XTAL_14_31818MHz/8, mc6845_aga_intf ) MCFG_VIDEO_START( pc_aga ) MACHINE_CONFIG_END diff --git a/src/mess/video/pc_t1t.c b/src/mess/video/pc_t1t.c index 16da9872fa961..7467fe7f30310 100644 --- a/src/mess/video/pc_t1t.c +++ b/src/mess/video/pc_t1t.c @@ -32,7 +32,6 @@ static WRITE_LINE_DEVICE_HANDLER( pcjr_vsync_changed ); static MC6845_INTERFACE( mc6845_t1000_intf ) { - T1000_SCREEN_NAME, /* screen number */ false, /* show border area */ 8, /* numbers of pixels per video memory address */ NULL, /* begin_update */ @@ -54,7 +53,7 @@ MACHINE_CONFIG_FRAGMENT( pcvideo_t1000 ) MCFG_PALETTE_LENGTH( 32 ) MCFG_PALETTE_INIT(pcjr) - MCFG_MC6845_ADD(T1000_MC6845_NAME, MC6845, XTAL_14_31818MHz/8, mc6845_t1000_intf) + MCFG_MC6845_ADD(T1000_MC6845_NAME, MC6845, T1000_SCREEN_NAME, XTAL_14_31818MHz/8, mc6845_t1000_intf) MCFG_VIDEO_START(pc_t1t) MACHINE_CONFIG_END @@ -62,7 +61,6 @@ MACHINE_CONFIG_END static MC6845_INTERFACE( mc6845_pcjr_intf ) { - T1000_SCREEN_NAME, /* screen number */ false, /* show border area */ 8, /* numbers of pixels per video memory address */ NULL, /* begin_update */ @@ -84,7 +82,7 @@ MACHINE_CONFIG_FRAGMENT( pcvideo_pcjr ) MCFG_PALETTE_LENGTH( 32 ) MCFG_PALETTE_INIT(pcjr) - MCFG_MC6845_ADD(T1000_MC6845_NAME, MC6845, XTAL_14_31818MHz/16, mc6845_pcjr_intf) + MCFG_MC6845_ADD(T1000_MC6845_NAME, MC6845, T1000_SCREEN_NAME, XTAL_14_31818MHz/16, mc6845_pcjr_intf) MCFG_VIDEO_START(pc_pcjr) MACHINE_CONFIG_END diff --git a/src/mess/video/pds30_30hr.c b/src/mess/video/pds30_30hr.c index b18bbaf601bd0..6aed0e16d76db 100644 --- a/src/mess/video/pds30_30hr.c +++ b/src/mess/video/pds30_30hr.c @@ -68,14 +68,18 @@ const rom_entry *nubus_xceed30hr_device::device_rom_region() const nubus_xceed30hr_device::nubus_xceed30hr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, PDS030_XCEED30HR, "Micron/XCEED Technology Color 30HR", tag, owner, clock, "pd3_30hr", __FILE__), + device_video_interface(mconfig, *this), device_nubus_card_interface(mconfig, *this) { + m_screen_tag = XCEED30HR_SCREEN_NAME; } nubus_xceed30hr_device::nubus_xceed30hr_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source), + device_video_interface(mconfig, *this), device_nubus_card_interface(mconfig, *this) { + m_screen_tag = XCEED30HR_SCREEN_NAME; } //------------------------------------------------- @@ -101,7 +105,7 @@ void nubus_xceed30hr_device::device_start() m_nubus->install_device(slotspace+0x800000, slotspace+0xefffff, read32_delegate(FUNC(nubus_xceed30hr_device::xceed30hr_r), this), write32_delegate(FUNC(nubus_xceed30hr_device::xceed30hr_w), this)); m_timer = timer_alloc(0, NULL); - m_screen = NULL; // can we look this up now? + m_timer->adjust(m_screen->time_until_pos(479, 0), 0); } //------------------------------------------------- @@ -144,13 +148,6 @@ UINT32 nubus_xceed30hr_device::screen_update(screen_device &screen, bitmap_rgb32 int x, y; UINT8 pixels, *vram; - // first time? kick off the VBL timer - if (!m_screen) - { - m_screen = &screen; - m_timer->adjust(m_screen->time_until_pos(479, 0), 0); - } - vram = m_vram + 1024; switch (m_mode) diff --git a/src/mess/video/pds30_30hr.h b/src/mess/video/pds30_30hr.h index ec0b561fc02b2..ce3c6f2723cde 100644 --- a/src/mess/video/pds30_30hr.h +++ b/src/mess/video/pds30_30hr.h @@ -14,6 +14,7 @@ class nubus_xceed30hr_device : public device_t, + public device_video_interface, public device_nubus_card_interface { public: @@ -42,7 +43,6 @@ class nubus_xceed30hr_device : UINT32 *m_vram32; UINT32 m_mode, m_vbl_disable, m_toggle; UINT32 m_palette[256], m_colors[3], m_count, m_clutoffs; - screen_device *m_screen; emu_timer *m_timer; }; diff --git a/src/mess/video/pds30_cb264.c b/src/mess/video/pds30_cb264.c index 8b1af10f3a7d6..b4ee628228474 100644 --- a/src/mess/video/pds30_cb264.c +++ b/src/mess/video/pds30_cb264.c @@ -61,14 +61,18 @@ const rom_entry *nubus_cb264se30_device::device_rom_region() const nubus_cb264se30_device::nubus_cb264se30_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, PDS030_CB264SE30, "RasterOps Colorboard 264/SE30", tag, owner, clock, "pd3_c264", __FILE__), + device_video_interface(mconfig, *this), device_nubus_card_interface(mconfig, *this) { + m_screen_tag = CB264SE30_SCREEN_NAME; } nubus_cb264se30_device::nubus_cb264se30_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source), + device_video_interface(mconfig, *this), device_nubus_card_interface(mconfig, *this) { + m_screen_tag = CB264SE30_SCREEN_NAME; } //------------------------------------------------- @@ -94,7 +98,7 @@ void nubus_cb264se30_device::device_start() m_nubus->install_device(slotspace+0xf00000, slotspace+0xfeffff, read32_delegate(FUNC(nubus_cb264se30_device::cb264se30_r), this), write32_delegate(FUNC(nubus_cb264se30_device::cb264se30_w), this)); m_timer = timer_alloc(0, NULL); - m_screen = NULL; // can we look this up now? + m_timer->adjust(m_screen->time_until_pos(479, 0), 0); } //------------------------------------------------- @@ -137,13 +141,6 @@ UINT32 nubus_cb264se30_device::screen_update(screen_device &screen, bitmap_rgb32 int x, y; UINT8 pixels, *vram; - // first time? kick off the VBL timer - if (!m_screen) - { - m_screen = &screen; - m_timer->adjust(m_screen->time_until_pos(479, 0), 0); - } - vram = m_vram + (8*1024); switch (m_mode) diff --git a/src/mess/video/pds30_cb264.h b/src/mess/video/pds30_cb264.h index ddf80e5d96745..98e4f255d3a42 100644 --- a/src/mess/video/pds30_cb264.h +++ b/src/mess/video/pds30_cb264.h @@ -14,6 +14,7 @@ class nubus_cb264se30_device : public device_t, + public device_video_interface, public device_nubus_card_interface { public: @@ -42,7 +43,6 @@ class nubus_cb264se30_device : UINT32 *m_vram32; UINT32 m_mode, m_vbl_disable, m_toggle; UINT32 m_palette[256], m_colors[3], m_count, m_clutoffs; - screen_device *m_screen; emu_timer *m_timer; }; diff --git a/src/mess/video/pds30_mc30.c b/src/mess/video/pds30_mc30.c index 4c63e60b71030..6669c407b9c9f 100644 --- a/src/mess/video/pds30_mc30.c +++ b/src/mess/video/pds30_mc30.c @@ -64,14 +64,18 @@ const rom_entry *nubus_xceedmc30_device::device_rom_region() const nubus_xceedmc30_device::nubus_xceedmc30_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, PDS030_XCEEDMC30, "Micron/XCEED Technology MacroColor 30", tag, owner, clock, "pd3_mclr", __FILE__), + device_video_interface(mconfig, *this), device_nubus_card_interface(mconfig, *this) { + m_screen_tag = XCEEDMC30_SCREEN_NAME; } nubus_xceedmc30_device::nubus_xceedmc30_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source), + device_video_interface(mconfig, *this), device_nubus_card_interface(mconfig, *this) { + m_screen_tag = XCEEDMC30_SCREEN_NAME; } //------------------------------------------------- @@ -97,7 +101,7 @@ void nubus_xceedmc30_device::device_start() m_nubus->install_device(slotspace+0x800000, slotspace+0xefffff, read32_delegate(FUNC(nubus_xceedmc30_device::xceedmc30_r), this), write32_delegate(FUNC(nubus_xceedmc30_device::xceedmc30_w), this)); m_timer = timer_alloc(0, NULL); - m_screen = NULL; // can we look this up now? + m_timer->adjust(m_screen->time_until_pos(479, 0), 0); } //------------------------------------------------- @@ -140,13 +144,6 @@ UINT32 nubus_xceedmc30_device::screen_update(screen_device &screen, bitmap_rgb32 int x, y; UINT8 pixels, *vram; - // first time? kick off the VBL timer - if (!m_screen) - { - m_screen = &screen; - m_timer->adjust(m_screen->time_until_pos(479, 0), 0); - } - vram = m_vram + (4*1024); switch (m_mode) diff --git a/src/mess/video/pds30_mc30.h b/src/mess/video/pds30_mc30.h index 6fcefce41e25c..492125c461caf 100644 --- a/src/mess/video/pds30_mc30.h +++ b/src/mess/video/pds30_mc30.h @@ -14,6 +14,7 @@ class nubus_xceedmc30_device : public device_t, + public device_video_interface, public device_nubus_card_interface { public: @@ -42,7 +43,6 @@ class nubus_xceedmc30_device : UINT32 *m_vram32; UINT32 m_mode, m_vbl_disable, m_toggle; UINT32 m_palette[256], m_colors[3], m_count, m_clutoffs; - screen_device *m_screen; emu_timer *m_timer; }; diff --git a/src/mess/video/pds30_procolor816.c b/src/mess/video/pds30_procolor816.c index 659b68c621874..254cfebb8b889 100644 --- a/src/mess/video/pds30_procolor816.c +++ b/src/mess/video/pds30_procolor816.c @@ -67,14 +67,18 @@ const rom_entry *nubus_procolor816_device::device_rom_region() const nubus_procolor816_device::nubus_procolor816_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, PDS030_PROCOLOR816, "Lapis ProColor Server 8*16", tag, owner, clock, "pd3_pc16", __FILE__), + device_video_interface(mconfig, *this), device_nubus_card_interface(mconfig, *this) { + m_screen_tag = PROCOLOR816_SCREEN_NAME; } nubus_procolor816_device::nubus_procolor816_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source), + device_video_interface(mconfig, *this), device_nubus_card_interface(mconfig, *this) { + m_screen_tag = PROCOLOR816_SCREEN_NAME; } //------------------------------------------------- @@ -101,7 +105,7 @@ void nubus_procolor816_device::device_start() m_nubus->install_device(slotspace+0xf00000, slotspace+0xff7fff, read32_delegate(FUNC(nubus_procolor816_device::procolor816_r), this), write32_delegate(FUNC(nubus_procolor816_device::procolor816_w), this)); m_timer = timer_alloc(0, NULL); - m_screen = NULL; // can we look this up now? + m_timer->adjust(m_screen->time_until_pos(479, 0), 0); } //------------------------------------------------- @@ -144,13 +148,6 @@ UINT32 nubus_procolor816_device::screen_update(screen_device &screen, bitmap_rgb int x, y; UINT8 pixels, *vram; - // first time? kick off the VBL timer - if (!m_screen) - { - m_screen = &screen; - m_timer->adjust(m_screen->time_until_pos(479, 0), 0); - } - vram = m_vram + 4; switch (m_mode) diff --git a/src/mess/video/pds30_procolor816.h b/src/mess/video/pds30_procolor816.h index c4d9ab1d02ed2..600ff402f593e 100644 --- a/src/mess/video/pds30_procolor816.h +++ b/src/mess/video/pds30_procolor816.h @@ -14,6 +14,7 @@ class nubus_procolor816_device : public device_t, + public device_video_interface, public device_nubus_card_interface { public: @@ -42,7 +43,6 @@ class nubus_procolor816_device : UINT32 *m_vram32; UINT32 m_mode, m_vbl_disable, m_toggle; UINT32 m_palette[256], m_colors[3], m_count, m_clutoffs; - screen_device *m_screen; emu_timer *m_timer; }; diff --git a/src/mess/video/pds30_sigmalview.c b/src/mess/video/pds30_sigmalview.c index 8942af434d319..6fcb2a8611523 100644 --- a/src/mess/video/pds30_sigmalview.c +++ b/src/mess/video/pds30_sigmalview.c @@ -61,12 +61,14 @@ const rom_entry *nubus_lview_device::device_rom_region() const nubus_lview_device::nubus_lview_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, PDS030_LVIEW, "Sigma Designs L-View", tag, owner, clock, "pd3_lviw", __FILE__), + device_video_interface(mconfig, *this), device_nubus_card_interface(mconfig, *this) { } nubus_lview_device::nubus_lview_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source), + device_video_interface(mconfig, *this), device_nubus_card_interface(mconfig, *this) { } @@ -95,7 +97,7 @@ void nubus_lview_device::device_start() m_nubus->install_device(slotspace+0xb0000, slotspace+0xbffff, read32_delegate(FUNC(nubus_lview_device::lview_r), this), write32_delegate(FUNC(nubus_lview_device::lview_w), this)); m_timer = timer_alloc(0, NULL); - m_screen = NULL; // can we look this up now? + m_timer->adjust(m_screen->time_until_pos(599, 0), 0); } //------------------------------------------------- @@ -136,13 +138,6 @@ UINT32 nubus_lview_device::screen_update(screen_device &screen, bitmap_rgb32 &bi int x, y; UINT8 pixels, *vram; - // first time? kick off the VBL timer - if (!m_screen) - { - m_screen = &screen; - m_timer->adjust(m_screen->time_until_pos(599, 0), 0); - } - vram = m_vram + 0x20; for (y = 0; y < 600; y++) diff --git a/src/mess/video/pds30_sigmalview.h b/src/mess/video/pds30_sigmalview.h index 4c8da94dc0969..073b05eec8353 100644 --- a/src/mess/video/pds30_sigmalview.h +++ b/src/mess/video/pds30_sigmalview.h @@ -14,6 +14,7 @@ class nubus_lview_device : public device_t, + public device_video_interface, public device_nubus_card_interface { public: @@ -42,7 +43,6 @@ class nubus_lview_device : UINT32 *m_vram32; UINT32 m_vbl_disable, m_toggle; UINT32 m_palette[256]; - screen_device *m_screen; emu_timer *m_timer; int m_protstate; }; diff --git a/src/mess/video/pds_tpdfpd.c b/src/mess/video/pds_tpdfpd.c index 8692ae2687726..1a5c5b2877bcc 100644 --- a/src/mess/video/pds_tpdfpd.c +++ b/src/mess/video/pds_tpdfpd.c @@ -85,14 +85,18 @@ const rom_entry *macpds_sedisplay_device::device_rom_region() const macpds_sedisplay_device::macpds_sedisplay_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, PDS_SEDISPLAY, "Radius SE Full Page Display", tag, owner, clock, "pds_sefp", __FILE__), + device_video_interface(mconfig, *this), device_macpds_card_interface(mconfig, *this) { + m_screen_tag = SEDISPLAY_SCREEN_NAME; } macpds_sedisplay_device::macpds_sedisplay_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source), + device_video_interface(mconfig, *this), device_macpds_card_interface(mconfig, *this) { + m_screen_tag = SEDISPLAY_SCREEN_NAME; } //------------------------------------------------- @@ -115,7 +119,7 @@ void macpds_sedisplay_device::device_start() m_macpds->install_device(0xc10000, 0xc2ffff, read16_delegate(FUNC(macpds_sedisplay_device::sedisplay_r), this), write16_delegate(FUNC(macpds_sedisplay_device::sedisplay_w), this)); m_timer = timer_alloc(0, NULL); - m_screen = NULL; // can we look this up now? + m_timer->adjust(m_screen->time_until_pos(879, 0), 0); } //------------------------------------------------- @@ -157,12 +161,6 @@ UINT32 macpds_sedisplay_device::screen_update(screen_device &screen, bitmap_rgb3 int x, y; UINT8 pixels, *vram; - // first time? kick off the VBL timer - if (!m_screen) - { - m_screen = &screen; - m_timer->adjust(m_screen->time_until_pos(879, 0), 0); - } vram = m_vram; for (y = 0; y < 870; y++) diff --git a/src/mess/video/pds_tpdfpd.h b/src/mess/video/pds_tpdfpd.h index 741a265f7093c..653d6e92aeaf9 100644 --- a/src/mess/video/pds_tpdfpd.h +++ b/src/mess/video/pds_tpdfpd.h @@ -14,6 +14,7 @@ class macpds_sedisplay_device : public device_t, + public device_video_interface, public device_macpds_card_interface { public: @@ -41,7 +42,6 @@ class macpds_sedisplay_device : UINT8 *m_vram; UINT32 m_vbl_disable; UINT32 m_palette[256], m_colors[3], m_count, m_clutoffs; - screen_device *m_screen; emu_timer *m_timer; }; diff --git a/src/mess/video/pecom.c b/src/mess/video/pecom.c index cd91caf901c13..5a66bd9d91a33 100644 --- a/src/mess/video/pecom.c +++ b/src/mess/video/pecom.c @@ -82,7 +82,6 @@ WRITE_LINE_MEMBER(pecom_state::pecom_prd_w) static CDP1869_INTERFACE( pecom_cdp1869_intf ) { - SCREEN_TAG, CDP1869_COLOR_CLK_PAL, CDP1869_PAL, pecom_pcb_r, diff --git a/src/mess/video/tmc600.c b/src/mess/video/tmc600.c index ebfb18190e20f..8bf59846beb37 100644 --- a/src/mess/video/tmc600.c +++ b/src/mess/video/tmc600.c @@ -98,7 +98,6 @@ static CDP1869_PCB_READ( tmc600_pcb_r ) static CDP1869_INTERFACE( vis_intf ) { - SCREEN_TAG, CDP1869_COLOR_CLK_PAL, CDP1869_PAL, tmc600_pcb_r, diff --git a/src/mess/video/uv201.c b/src/mess/video/uv201.c index f46bd240f5175..696e0d25ed116 100644 --- a/src/mess/video/uv201.c +++ b/src/mess/video/uv201.c @@ -98,7 +98,8 @@ const device_type UV201 = &device_creator; //------------------------------------------------- uv201_device::uv201_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : device_t(mconfig, UV201, "UV201", tag, owner, clock, "uv201", __FILE__) + : device_t(mconfig, UV201, "UV201", tag, owner, clock, "uv201", __FILE__), + device_video_interface(mconfig, *this) { } @@ -143,9 +144,6 @@ void uv201_device::device_start() m_timer_hblank_on = timer_alloc(TIMER_HBLANK_ON); m_timer_hblank_off = timer_alloc(TIMER_HBLANK_OFF); - // find devices - m_screen = machine().device(m_screen_tag); - initialize_palette(); memset(m_ram, 0x00, sizeof(m_ram)); diff --git a/src/mess/video/uv201.h b/src/mess/video/uv201.h index 6abab346dbda5..d0d83baf236fb 100644 --- a/src/mess/video/uv201.h +++ b/src/mess/video/uv201.h @@ -67,6 +67,7 @@ #define MCFG_UV201_ADD(_tag, _screen_tag, _clock, _config) \ MCFG_DEVICE_ADD(_tag, UV201, _clock) \ + MCFG_VIDEO_SET_SCREEN(_screen_tag) \ MCFG_DEVICE_CONFIG(_config) \ MCFG_SCREEN_ADD(_screen_tag, RASTER) \ MCFG_SCREEN_UPDATE_DEVICE(_tag, uv201_device, screen_update) \ @@ -86,8 +87,6 @@ struct uv201_interface { - const char *m_screen_tag; - devcb_write_line m_out_ext_int_cb; devcb_write_line m_out_hblank_cb; devcb_read8 m_in_db_cb; @@ -97,6 +96,7 @@ struct uv201_interface // ======================> uv201_device class uv201_device : public device_t, + public device_video_interface, public uv201_interface { public: @@ -137,8 +137,6 @@ class uv201_device : public device_t, devcb_resolved_write_line m_out_hblank_func; devcb_resolved_read8 m_in_db_func; - screen_device *m_screen; - rgb_t m_palette[32]; UINT8 m_ram[0x90]; UINT8 m_y_int; diff --git a/src/mess/video/v1050.c b/src/mess/video/v1050.c index f70a2a3939511..8d11b9a161d97 100644 --- a/src/mess/video/v1050.c +++ b/src/mess/video/v1050.c @@ -95,7 +95,6 @@ WRITE_LINE_MEMBER( v1050_state::crtc_vs_w ) static MC6845_INTERFACE( crtc_intf ) { - SCREEN_TAG, false, 8, NULL, @@ -122,7 +121,7 @@ void v1050_state::video_start() /* Machine Drivers */ MACHINE_CONFIG_FRAGMENT( v1050_video ) - MCFG_MC6845_ADD(H46505_TAG, H46505, XTAL_15_36MHz/8, crtc_intf) + MCFG_MC6845_ADD(H46505_TAG, H46505, SCREEN_TAG, XTAL_15_36MHz/8, crtc_intf) MCFG_SCREEN_ADD(SCREEN_TAG, RASTER) MCFG_SCREEN_UPDATE_DEVICE(H46505_TAG, h46505_device, screen_update) diff --git a/src/mess/video/vic4567.c b/src/mess/video/vic4567.c index 35ef8b4d019fd..55b629657e684 100644 --- a/src/mess/video/vic4567.c +++ b/src/mess/video/vic4567.c @@ -143,7 +143,8 @@ const device_type VIC3 = &device_creator; vic3_device::vic3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : device_t(mconfig, VIC3, "4567 VIC III", tag, owner, clock, "vic3", __FILE__) + : device_t(mconfig, VIC3, "4567 VIC III", tag, owner, clock, "vic3", __FILE__), + device_video_interface(mconfig, *this) { } @@ -171,7 +172,6 @@ void vic3_device::device_config_complete() memset(&irq, 0, sizeof(irq)); memset(&port_changed, 0, sizeof(port_changed)); memset(&c64_mem_r, 0, sizeof(c64_mem_r)); - screen_tag = ""; cpu_tag = ""; vic_type = VIC4567_NTSC; } @@ -186,9 +186,8 @@ void vic3_device::device_start() int width, height; m_cpu = machine().device(cpu_tag); - m_main_screen = machine().device(screen_tag); - width = m_main_screen->width(); - height = m_main_screen->height(); + width = m_screen->width(); + height = m_screen->height(); m_bitmap = auto_bitmap_ind16_alloc(machine(), width, height); @@ -206,10 +205,10 @@ void vic3_device::device_start() m_lightpen_x_cb.resolve(x_cb, *this); m_lightpen_y_cb.resolve(y_cb, *this); - m_screen[0] = auto_alloc_array(machine(), UINT8, 216 * 656 / 8); + m_screenptr[0] = auto_alloc_array(machine(), UINT8, 216 * 656 / 8); for (int i = 1; i < 216; i++) - m_screen[i] = m_screen[i - 1] + 656 / 8; + m_screenptr[i] = m_screenptr[i - 1] + 656 / 8; for (int i = 0; i < 256; i++) { @@ -385,12 +384,12 @@ void vic3_device::device_reset() inline int vic3_device::getforeground( int y, int x ) { - return ((m_screen[y][x >> 3] << 8) | (m_screen[y][(x >> 3) + 1])) >> (8 - (x & 7)); + return ((m_screenptr[y][x >> 3] << 8) | (m_screenptr[y][(x >> 3) + 1])) >> (8 - (x & 7)); } inline int vic3_device::getforeground16( int y, int x ) { - return ((m_screen[y][x >> 3] << 16) | (m_screen[y][(x >> 3) + 1] << 8) | (m_screen[y][(x >> 3) + 2])) >> (8 - (x & 7)); + return ((m_screenptr[y][x >> 3] << 16) | (m_screenptr[y][(x >> 3) + 1] << 8) | (m_screenptr[y][(x >> 3) + 2])) >> (8 - (x & 7)); } void vic3_device::set_interrupt( int mask ) @@ -443,7 +442,7 @@ void vic3_device::draw_character( int ybegin, int yend, int ch, int yoff, int xo for (int y = ybegin; y <= yend; y++) { code = m_dma_read(m_chargenaddr + ch * 8 + y); - m_screen[y + yoff][xoff >> 3] = code; + m_screenptr[y + yoff][xoff >> 3] = code; if ((xoff + 0 > start_x) && (xoff + 0 < end_x)) m_bitmap->pix16(y + yoff + FIRSTLINE, xoff + 0) = color[code >> 7]; if ((xoff + 1 > start_x) && (xoff + 0 < end_x)) m_bitmap->pix16(y + yoff + FIRSTLINE, xoff + 1) = color[(code >> 6) & 1]; if ((xoff + 2 > start_x) && (xoff + 0 < end_x)) m_bitmap->pix16(y + yoff + FIRSTLINE, xoff + 2) = color[(code >> 5) & 1]; @@ -462,7 +461,7 @@ void vic3_device::draw_character_multi( int ybegin, int yend, int ch, int yoff, for (int y = ybegin; y <= yend; y++) { code = m_dma_read(m_chargenaddr + ch * 8 + y); - m_screen[y + yoff][xoff >> 3] = m_foreground[code]; + m_screenptr[y + yoff][xoff >> 3] = m_foreground[code]; if ((xoff + 0 > start_x) && (xoff + 0 < end_x)) m_bitmap->pix16(y + yoff + FIRSTLINE, xoff + 0) = m_multi[code >> 6]; if ((xoff + 1 > start_x) && (xoff + 1 < end_x)) m_bitmap->pix16(y + yoff + FIRSTLINE, xoff + 1) = m_multi[code >> 6]; if ((xoff + 2 > start_x) && (xoff + 2 < end_x)) m_bitmap->pix16(y + yoff + FIRSTLINE, xoff + 2) = m_multi[(code >> 4) & 3]; @@ -481,7 +480,7 @@ void vic3_device::draw_bitmap( int ybegin, int yend, int ch, int yoff, int xoff, for (int y = ybegin; y <= yend; y++) { code = m_dma_read((m_chargenaddr & 0x2000) + ch * 8 + y); - m_screen[y + yoff][xoff >> 3] = code; + m_screenptr[y + yoff][xoff >> 3] = code; if ((xoff + 0 > start_x) && (xoff + 0 < end_x)) m_bitmap->pix16(y + yoff + FIRSTLINE, xoff + 0) = m_c64_bitmap[code >> 7]; if ((xoff + 1 > start_x) && (xoff + 1 < end_x)) m_bitmap->pix16(y + yoff + FIRSTLINE, xoff + 1) = m_c64_bitmap[(code >> 6) & 1]; if ((xoff + 2 > start_x) && (xoff + 2 < end_x)) m_bitmap->pix16(y + yoff + FIRSTLINE, xoff + 2) = m_c64_bitmap[(code >> 5) & 1]; @@ -500,7 +499,7 @@ void vic3_device::draw_bitmap_multi( int ybegin, int yend, int ch, int yoff, int for (int y = ybegin; y <= yend; y++) { code = m_dma_read((m_chargenaddr & 0x2000) + ch * 8 + y); - m_screen[y + yoff][xoff >> 3] = m_foreground[code]; + m_screenptr[y + yoff][xoff >> 3] = m_foreground[code]; if ((xoff + 0 > start_x) && (xoff + 0 < end_x)) m_bitmap->pix16(y + yoff + FIRSTLINE, xoff + 0) = m_bitmapmulti[code >> 6]; if ((xoff + 1 > start_x) && (xoff + 1 < end_x)) m_bitmap->pix16(y + yoff + FIRSTLINE, xoff + 1) = m_bitmapmulti[code >> 6]; if ((xoff + 2 > start_x) && (xoff + 2 < end_x)) m_bitmap->pix16(y + yoff + FIRSTLINE, xoff + 2) = m_bitmapmulti[(code >> 4) & 3]; @@ -1885,7 +1884,7 @@ void vic3_device::draw_bitplanes() { int x, y, y1s, offset; rectangle vis; - const rectangle &visarea = m_main_screen->visible_area(); + const rectangle &visarea = m_screen->visible_area(); if (VIC3_LINES == 400) { /* interlaced! */ @@ -1989,13 +1988,13 @@ void vic3_device::raster_interrupt_gen() m_rows = new_rows; m_columns = new_columns; if (m_type == VIC4567_PAL) - m_main_screen->set_visible_area( + m_screen->set_visible_area( VIC2_STARTVISIBLECOLUMNS + 32, VIC2_STARTVISIBLECOLUMNS + 32 + m_columns + 16 - 1, VIC2_STARTVISIBLELINES + 34, VIC2_STARTVISIBLELINES + 34 + m_rows + 16 - 1); else - m_main_screen->set_visible_area( + m_screen->set_visible_area( VIC2_STARTVISIBLECOLUMNS + 34, VIC2_STARTVISIBLECOLUMNS + 34 + m_columns + 16 - 1, VIC2_STARTVISIBLELINES + 10, diff --git a/src/mess/video/vic4567.h b/src/mess/video/vic4567.h index 0f32ff35f6401..350a11b1d153e 100644 --- a/src/mess/video/vic4567.h +++ b/src/mess/video/vic4567.h @@ -20,7 +20,6 @@ enum vic3_type struct vic3_interface { - const char *screen_tag; const char *cpu_tag; vic3_type vic_type; @@ -140,6 +139,7 @@ struct vic3_sprite ***************************************************************************/ class vic3_device : public device_t, + public device_video_interface, public vic3_interface { public: @@ -185,8 +185,6 @@ class vic3_device : public device_t, vic3_type m_type; - screen_device *m_main_screen; // screen which sets bitmap properties - device_t *m_cpu; UINT8 m_reg[0x80]; @@ -208,7 +206,7 @@ class vic3_device : public device_t, int m_columns, m_rows; /* background/foreground for sprite collision */ - UINT8 *m_screen[216], m_shift[216]; + UINT8 *m_screenptr[216], m_shift[216]; /* convert multicolor byte to background/foreground for sprite collision */ UINT8 m_foreground[256]; diff --git a/src/mess/video/vtvideo.c b/src/mess/video/vtvideo.c index cc52a0333596b..d9dca7cd32d0a 100644 --- a/src/mess/video/vtvideo.c +++ b/src/mess/video/vtvideo.c @@ -27,13 +27,15 @@ const device_type RAINBOW_VIDEO = &device_creator; vt100_video_device::vt100_video_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) - : device_t(mconfig, type, name, tag, owner, clock, shortname, source) + : device_t(mconfig, type, name, tag, owner, clock, shortname, source), + device_video_interface(mconfig, *this) { } vt100_video_device::vt100_video_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : device_t(mconfig, VT100_VIDEO, "VT100 Video", tag, owner, clock, "vt100_video", __FILE__) + : device_t(mconfig, VT100_VIDEO, "VT100 Video", tag, owner, clock, "vt100_video", __FILE__), + device_video_interface(mconfig, *this) { } @@ -62,7 +64,6 @@ void vt100_video_device::device_config_complete() { memset(&m_in_ram_cb, 0, sizeof(m_in_ram_cb)); memset(&m_clear_video_cb, 0, sizeof(m_clear_video_cb)); - m_screen_tag = ""; m_char_rom_tag = ""; } } @@ -77,10 +78,6 @@ void vt100_video_device::device_start() m_in_ram_func.resolve(m_in_ram_cb, *this); m_clear_video_interrupt.resolve(m_clear_video_cb, *this); - /* get the screen device */ - m_screen = machine().device(m_screen_tag); - assert(m_screen != NULL); - m_gfx = machine().root_device().memregion(m_char_rom_tag)->base(); assert(m_gfx != NULL); diff --git a/src/mess/video/vtvideo.h b/src/mess/video/vtvideo.h index 678697a2074d5..df6ac5cf8d2cb 100644 --- a/src/mess/video/vtvideo.h +++ b/src/mess/video/vtvideo.h @@ -17,7 +17,6 @@ struct vt_video_interface { - const char *m_screen_tag; /* screen we are acting on */ const char *m_char_rom_tag; /* character rom region */ /* this gets called for every memory read */ @@ -27,6 +26,7 @@ struct vt_video_interface class vt100_video_device : public device_t, + public device_video_interface, public vt_video_interface { public: @@ -55,7 +55,6 @@ class vt100_video_device : public device_t, devcb_resolved_read8 m_in_ram_func; devcb_resolved_write8 m_clear_video_interrupt; - screen_device *m_screen; /* screen */ UINT8 *m_gfx; /* content of char rom */ int m_lba7; diff --git a/src/mess/video/zx8301.c b/src/mess/video/zx8301.c index f8075eb6d32ce..13a10579d3814 100644 --- a/src/mess/video/zx8301.c +++ b/src/mess/video/zx8301.c @@ -129,6 +129,7 @@ inline void zx8301_device::writebyte(offs_t address, UINT8 data) zx8301_device::zx8301_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, ZX8301, "Sinclair ZX8301", tag, owner, clock, "zx8301", __FILE__), device_memory_interface(mconfig, *this), + device_video_interface(mconfig, *this), m_space_config("videoram", ENDIANNESS_LITTLE, 8, 17, 0, NULL, *ADDRESS_MAP_NAME(zx8301)), m_dispoff(1), m_mode8(0), @@ -150,10 +151,6 @@ void zx8301_device::device_start() m_cpu = machine().device(cpu_tag); assert(m_cpu != NULL); - // get the screen device - m_screen = machine().device(screen_tag); - assert(m_screen != NULL); - // resolve callbacks m_out_vsync_func.resolve(out_vsync_cb, *this); diff --git a/src/mess/video/zx8301.h b/src/mess/video/zx8301.h index 577fa7ada7c2e..3fb94c7023868 100644 --- a/src/mess/video/zx8301.h +++ b/src/mess/video/zx8301.h @@ -76,6 +76,7 @@ struct zx8301_interface class zx8301_device : public device_t, public device_memory_interface, + public device_video_interface, public zx8301_interface { public: @@ -113,7 +114,6 @@ class zx8301_device : public device_t, devcb_resolved_write_line m_out_vsync_func; cpu_device *m_cpu; - screen_device *m_screen; //address_space *m_data; int m_dispoff; // display off