From 25a100d773579751d4dd58c9d4276eabdb648c3a Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Wed, 24 Jul 2013 19:20:59 +0000 Subject: Created new device_video_interface. Right now its sole purpose is to house a screen tag and to find the screen at startup, providing an m_screen object that can be used. One nice feature is that if there is only one screen and no screen has been specified, it will auto configure to that screen. This removes the need to explicitly specify a screen in the configuration for a large chunk of drivers (though doing so never hurts). A new macro MCFG_VIDEO_SET_SCREEN is provided, though devices are encouraged to define their own that maps there so it is obvious which device is being targeted. The device_video_interface's validation function will error if an invalid screen is specified or if no screen is provided but there are multiple screens present. Updated all devices that currently had an m_screen in them to use the device_video_interface instead. This also has the nice benefit of flagging video-related devices for categorization purposes. It also means all these devices inherit the same screen-finding behaviors. For devices that had interfaces that specified a screen tag, those have been removed and all existing structs updated. Added an optional_device m_screen to the base driver_device. If you name your screen "screen" (as most drivers do), you will have free access to your screen this way. Future updates include: * Updating all devices referencing machine.primary_screen to use the device_video_interface instead * Updating all drivers referencing machine.primary_screen to use the m_screen instead * Removing machine.primary_screen entirely --- src/mame/drivers/backfire.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mame/drivers/backfire.c') diff --git a/src/mame/drivers/backfire.c b/src/mame/drivers/backfire.c index 48c9158dd69..c76a6c76076 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); -- cgit v1.2.3