diff --git a/src/mame/drivers/88games.c b/src/mame/drivers/88games.c index fdadb419cdf..aaf79d13888 100644 --- a/src/mame/drivers/88games.c +++ b/src/mame/drivers/88games.c @@ -324,14 +324,6 @@ static const k051960_interface _88games_k051960_intf = _88games_sprite_callback }; -static const k051316_interface _88games_k051316_intf = -{ - "gfx3", 2, - 4, FALSE, 0, - 0, 0, 0, - _88games_zoom_callback -}; - static MACHINE_CONFIG_START( 88games, _88games_state ) /* basic machine hardware */ @@ -366,9 +358,11 @@ static MACHINE_CONFIG_START( 88games, _88games_state ) MCFG_K051960_ADD("k051960", _88games_k051960_intf) MCFG_K051960_GFXDECODE("gfxdecode") MCFG_K051960_PALETTE("palette") - MCFG_K051316_ADD("k051316", _88games_k051316_intf) - MCFG_K051316_GFXDECODE("gfxdecode") - MCFG_K051316_PALETTE("palette") + + MCFG_DEVICE_ADD("k051316", K051316, 0) + MCFG_GFX_PALETTE("palette") + MCFG_K051316_BPP(4) + MCFG_K051316_CB(_88games_state, zoom_callback) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") @@ -428,7 +422,7 @@ ROM_START( 88games ) ROM_LOAD16_BYTE( "861a06.d", 0x0e0000, 0x10000, CRC(bc70ab39) SHA1(a6fa0502ceb6862e7b1e4815326e268fd6511881) ) ROM_LOAD16_BYTE( "861a06.h", 0x0e0001, 0x10000, CRC(d906b79b) SHA1(905814ce708d80fd4d1a398f60faa0bc680fccaf) ) - ROM_REGION( 0x040000, "gfx3", 0 ) /* graphics */ + ROM_REGION( 0x040000, "k051316", 0 ) ROM_LOAD( "861a04.a", 0x000000, 0x10000, CRC(092a8b15) SHA1(d98a81bfa4bba73805f0236f8a80da130fcb378d) ) /* zoom/rotate */ ROM_LOAD( "861a04.b", 0x010000, 0x10000, CRC(75744b56) SHA1(5133d8f6622796ed6b9e6a0d0f1df28f00331fc7) ) ROM_LOAD( "861a04.c", 0x020000, 0x10000, CRC(a00021c5) SHA1(f73f88af33387d73b4262e8652507e699926fabe) ) @@ -482,7 +476,7 @@ ROM_START( konami88 ) ROM_LOAD16_BYTE( "861a06.d", 0x0e0000, 0x10000, CRC(bc70ab39) SHA1(a6fa0502ceb6862e7b1e4815326e268fd6511881) ) ROM_LOAD16_BYTE( "861a06.h", 0x0e0001, 0x10000, CRC(d906b79b) SHA1(905814ce708d80fd4d1a398f60faa0bc680fccaf) ) - ROM_REGION( 0x040000, "gfx3", 0 ) /* graphics */ + ROM_REGION( 0x040000, "k051316", 0 ) ROM_LOAD( "861a04.a", 0x000000, 0x10000, CRC(092a8b15) SHA1(d98a81bfa4bba73805f0236f8a80da130fcb378d) ) /* zoom/rotate */ ROM_LOAD( "861a04.b", 0x010000, 0x10000, CRC(75744b56) SHA1(5133d8f6622796ed6b9e6a0d0f1df28f00331fc7) ) ROM_LOAD( "861a04.c", 0x020000, 0x10000, CRC(a00021c5) SHA1(f73f88af33387d73b4262e8652507e699926fabe) ) @@ -536,7 +530,7 @@ ROM_START( hypsptsp ) ROM_LOAD16_BYTE( "861a06.d", 0x0e0000, 0x10000, CRC(bc70ab39) SHA1(a6fa0502ceb6862e7b1e4815326e268fd6511881) ) ROM_LOAD16_BYTE( "861a06.h", 0x0e0001, 0x10000, CRC(d906b79b) SHA1(905814ce708d80fd4d1a398f60faa0bc680fccaf) ) - ROM_REGION( 0x040000, "gfx3", 0 ) /* graphics */ + ROM_REGION( 0x040000, "k051316", 0 ) ROM_LOAD( "861a04.a", 0x000000, 0x10000, CRC(092a8b15) SHA1(d98a81bfa4bba73805f0236f8a80da130fcb378d) ) /* zoom/rotate */ ROM_LOAD( "861a04.b", 0x010000, 0x10000, CRC(75744b56) SHA1(5133d8f6622796ed6b9e6a0d0f1df28f00331fc7) ) ROM_LOAD( "861a04.c", 0x020000, 0x10000, CRC(a00021c5) SHA1(f73f88af33387d73b4262e8652507e699926fabe) ) diff --git a/src/mame/drivers/ajax.c b/src/mame/drivers/ajax.c index 42fa0c33eb2..ef522467c89 100644 --- a/src/mame/drivers/ajax.c +++ b/src/mame/drivers/ajax.c @@ -183,14 +183,6 @@ static const k051960_interface ajax_k051960_intf = ajax_sprite_callback }; -static const k051316_interface ajax_k051316_intf = -{ - "gfx3", 2, - 7, FALSE, 0, - 0, 0, 0, - ajax_zoom_callback -}; - static MACHINE_CONFIG_START( ajax, ajax_state ) /* basic machine hardware */ @@ -228,9 +220,11 @@ static MACHINE_CONFIG_START( ajax, ajax_state ) MCFG_K051960_ADD("k051960", ajax_k051960_intf) MCFG_K051960_GFXDECODE("gfxdecode") MCFG_K051960_PALETTE("palette") - MCFG_K051316_ADD("k051316", ajax_k051316_intf) - MCFG_K051316_GFXDECODE("gfxdecode") - MCFG_K051316_PALETTE("palette") + + MCFG_DEVICE_ADD("k051316", K051316, 0) + MCFG_GFX_PALETTE("palette") + MCFG_K051316_BPP(7) + MCFG_K051316_CB(ajax_state, zoom_callback) /* sound hardware */ MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") @@ -306,7 +300,7 @@ ROM_START( ajax ) ROM_LOAD16_BYTE( "770c08-d.c10", 0x0e0000, 0x010000, CRC(91591777) SHA1(53f416a51f7075f070168bced7b6f925f54c7b84) ) ROM_LOAD16_BYTE( "770c08-h.c11", 0x0e0001, 0x010000, CRC(d97d4b15) SHA1(e3d7d7adeec8c8c808acb9f84641fd3a6bf249be) ) - ROM_REGION( 0x080000, "gfx3", 0 ) /* graphics (addressable by the main CPU) */ + ROM_REGION( 0x080000, "k051316", 0 ) ROM_LOAD( "770c06", 0x000000, 0x040000, CRC(d0c592ee) SHA1(c1be73dd259f2779d715659b177e47513776a0d4) ) /* zoom/rotate (F4) */ ROM_LOAD( "770c07", 0x040000, 0x040000, CRC(0b399fb1) SHA1(fbe26f9aa9a655d08bebcdd79719d35134ca4dd5) ) /* zoom/rotate (H4) */ @@ -352,7 +346,7 @@ ROM_START( typhoon ) ROM_LOAD( "770c09", 0x000000, 0x080000, CRC(1ab4a7ff) SHA1(fa007b41027f95d29d2a9f931a2fe235844db637) ) /* sprites (N4) */ ROM_LOAD( "770c08", 0x080000, 0x080000, CRC(a8e80586) SHA1(0401f59baa691905287cef94427f39e0c3f0adc6) ) /* sprites (K4) */ - ROM_REGION( 0x080000, "gfx3", 0 ) /* graphics (addressable by the main CPU) */ + ROM_REGION( 0x080000, "k051316", 0 ) ROM_LOAD( "770c06", 0x000000, 0x040000, CRC(d0c592ee) SHA1(c1be73dd259f2779d715659b177e47513776a0d4) ) /* zoom/rotate (F4) */ ROM_LOAD( "770c07", 0x040000, 0x040000, CRC(0b399fb1) SHA1(fbe26f9aa9a655d08bebcdd79719d35134ca4dd5) ) /* zoom/rotate (H4) */ @@ -388,7 +382,7 @@ ROM_START( ajaxj ) ROM_LOAD( "770c09", 0x000000, 0x080000, CRC(1ab4a7ff) SHA1(fa007b41027f95d29d2a9f931a2fe235844db637) ) /* sprites (N4) */ ROM_LOAD( "770c08", 0x080000, 0x080000, CRC(a8e80586) SHA1(0401f59baa691905287cef94427f39e0c3f0adc6) ) /* sprites (K4) */ - ROM_REGION( 0x080000, "gfx3", 0 ) /* graphics (addressable by the main CPU) */ + ROM_REGION( 0x080000, "k051316", 0 ) ROM_LOAD( "770c06", 0x000000, 0x040000, CRC(d0c592ee) SHA1(c1be73dd259f2779d715659b177e47513776a0d4) ) /* zoom/rotate (F4) */ ROM_LOAD( "770c07", 0x040000, 0x040000, CRC(0b399fb1) SHA1(fbe26f9aa9a655d08bebcdd79719d35134ca4dd5) ) /* zoom/rotate (H4) */ diff --git a/src/mame/drivers/bottom9.c b/src/mame/drivers/bottom9.c index 3983099b7fe..7e6bdbc0a60 100644 --- a/src/mame/drivers/bottom9.c +++ b/src/mame/drivers/bottom9.c @@ -287,14 +287,6 @@ static const k051960_interface bottom9_k051960_intf = bottom9_sprite_callback }; -static const k051316_interface bottom9_k051316_intf = -{ - "gfx3", 2, - 4, FALSE, 0, - 0, 0, 0, - bottom9_zoom_callback -}; - void bottom9_state::machine_start() { UINT8 *ROM = memregion("maincpu")->base(); @@ -347,9 +339,11 @@ static MACHINE_CONFIG_START( bottom9, bottom9_state ) MCFG_K051960_ADD("k051960", bottom9_k051960_intf) MCFG_K051960_GFXDECODE("gfxdecode") MCFG_K051960_PALETTE("palette") - MCFG_K051316_ADD("k051316", bottom9_k051316_intf) - MCFG_K051316_GFXDECODE("gfxdecode") - MCFG_K051316_PALETTE("palette") + + MCFG_DEVICE_ADD("k051316", K051316, 0) + MCFG_GFX_PALETTE("palette") + MCFG_K051316_BPP(4) + MCFG_K051316_CB(bottom9_state, zoom_callback) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") @@ -409,7 +403,7 @@ ROM_START( bottom9 ) ROM_LOAD16_BYTE( "891e05h", 0xe0000, 0x10000, CRC(b0aba53b) SHA1(e76b345ae354533959ed06217b91ce3c93b22a23) ) ROM_LOAD16_BYTE( "891e05d", 0xe0001, 0x10000, CRC(f6d3f886) SHA1(b8bdcc9470aa93849b8c8a1f03971281cacc6d44) ) - ROM_REGION( 0x020000, "gfx3", 0 ) /* graphics ( dont dispose as the program can read them, 0 ) */ + ROM_REGION( 0x020000, "k051316", 0 ) ROM_LOAD( "891e07a", 0x00000, 0x10000, CRC(b8d8b939) SHA1(ee91fb46d70db2d17f5909c4ea7ee1cf2d317d10) ) /* zoom/rotate */ ROM_LOAD( "891e07b", 0x10000, 0x10000, CRC(83b2f92d) SHA1(c4972018e1f8109656784fae3e023a5522622c4b) ) @@ -466,7 +460,7 @@ ROM_START( bottom9n ) ROM_LOAD16_BYTE( "891e05h", 0xe0000, 0x10000, CRC(b0aba53b) SHA1(e76b345ae354533959ed06217b91ce3c93b22a23) ) ROM_LOAD16_BYTE( "891e05d", 0xe0001, 0x10000, CRC(f6d3f886) SHA1(b8bdcc9470aa93849b8c8a1f03971281cacc6d44) ) - ROM_REGION( 0x020000, "gfx3", 0 ) /* graphics ( dont dispose as the program can read them, 0 ) */ + ROM_REGION( 0x020000, "k051316", 0 ) ROM_LOAD( "891e07a", 0x00000, 0x10000, CRC(b8d8b939) SHA1(ee91fb46d70db2d17f5909c4ea7ee1cf2d317d10) ) /* zoom/rotate */ ROM_LOAD( "891e07b", 0x10000, 0x10000, CRC(83b2f92d) SHA1(c4972018e1f8109656784fae3e023a5522622c4b) ) @@ -523,7 +517,7 @@ ROM_START( mstadium ) ROM_LOAD16_BYTE( "891e05h", 0xe0000, 0x10000, CRC(b0aba53b) SHA1(e76b345ae354533959ed06217b91ce3c93b22a23) ) ROM_LOAD16_BYTE( "891e05d", 0xe0001, 0x10000, CRC(f6d3f886) SHA1(b8bdcc9470aa93849b8c8a1f03971281cacc6d44) ) - ROM_REGION( 0x020000, "gfx3", 0 ) /* graphics ( dont dispose as the program can read them, 0 ) */ + ROM_REGION( 0x020000, "k051316", 0 ) ROM_LOAD( "891e07a", 0x00000, 0x10000, CRC(b8d8b939) SHA1(ee91fb46d70db2d17f5909c4ea7ee1cf2d317d10) ) /* zoom/rotate */ ROM_LOAD( "891e07b", 0x10000, 0x10000, CRC(83b2f92d) SHA1(c4972018e1f8109656784fae3e023a5522622c4b) ) diff --git a/src/mame/drivers/chqflag.c b/src/mame/drivers/chqflag.c index ad3381ed22d..a71844ee06e 100644 --- a/src/mame/drivers/chqflag.c +++ b/src/mame/drivers/chqflag.c @@ -276,22 +276,6 @@ static const k051960_interface chqflag_k051960_intf = chqflag_sprite_callback }; -static const k051316_interface chqflag_k051316_intf_1 = -{ - "gfx2", 1, - 4, FALSE, 0, - 0, 7, 0, - chqflag_zoom_callback_0 -}; - -static const k051316_interface chqflag_k051316_intf_2 = -{ - "gfx3", 2, - 8, TRUE, 0xc0, - 1, 0, 0, - chqflag_zoom_callback_1 -}; - void chqflag_state::machine_start() { UINT8 *ROM = memregion("maincpu")->base(); @@ -349,12 +333,20 @@ static MACHINE_CONFIG_START( chqflag, chqflag_state ) MCFG_K051960_ADD("k051960", chqflag_k051960_intf) MCFG_K051960_GFXDECODE("gfxdecode") MCFG_K051960_PALETTE("palette") - MCFG_K051316_ADD("k051316_1", chqflag_k051316_intf_1) - MCFG_K051316_GFXDECODE("gfxdecode") - MCFG_K051316_PALETTE("palette") - MCFG_K051316_ADD("k051316_2", chqflag_k051316_intf_2) - MCFG_K051316_GFXDECODE("gfxdecode") - MCFG_K051316_PALETTE("palette") + + MCFG_DEVICE_ADD("k051316_1", K051316, 0) + MCFG_GFX_PALETTE("palette") + MCFG_K051316_BPP(4) + MCFG_K051316_OFFSETS(7, 0) + MCFG_K051316_CB(chqflag_state, zoom_callback_1) + + MCFG_DEVICE_ADD("k051316_2", K051316, 0) + MCFG_GFX_PALETTE("palette") + MCFG_K051316_BPP(8) + MCFG_K051316_SETUP_PENS(true, 0xc0) + MCFG_K051316_WRAP(1) + MCFG_K051316_CB(chqflag_state, zoom_callback_2) + MCFG_K051733_ADD("k051733") /* sound hardware */ @@ -392,10 +384,10 @@ ROM_START( chqflag ) ROM_LOAD( "717e04", 0x000000, 0x080000, CRC(1a50a1cc) SHA1(bc16fab84c637ed124e37b115ddc0149560b727d) ) /* sprites */ ROM_LOAD( "717e05", 0x080000, 0x080000, CRC(46ccb506) SHA1(3ed1f54744fc5cdc0f48e42f250c366267a8199a) ) /* sprites */ - ROM_REGION( 0x020000, "gfx2", 0 ) /* graphics (addressable by the main CPU) */ + ROM_REGION( 0x020000, "k051316_1", 0 ) ROM_LOAD( "717e06", 0x000000, 0x020000, CRC(1ec26c7a) SHA1(05b5b522c5ebf5d0a71a7fc39ec9382008ef33c8) ) /* zoom/rotate (N16) */ - ROM_REGION( 0x100000, "gfx3", 0 ) /* graphics (addressable by the main CPU) */ + ROM_REGION( 0x100000, "k051316_2", 0 ) ROM_LOAD( "717e07", 0x000000, 0x040000, CRC(b9a565a8) SHA1(a11782f7336e5ad58a4c6ea81f2eeac35d5e7d0a) ) /* zoom/rotate (L20) */ ROM_LOAD( "717e08", 0x040000, 0x040000, CRC(b68a212e) SHA1(b2bd121a43552c3ade528ac763a0df40c3e648e0) ) /* zoom/rotate (L22) */ ROM_LOAD( "717e11", 0x080000, 0x040000, CRC(ebb171ec) SHA1(d65d4a6b169ce03e4427b2a397484634f938236b) ) /* zoom/rotate (N20) */ @@ -422,10 +414,10 @@ ROM_START( chqflagj ) ROM_LOAD( "717e04", 0x000000, 0x080000, CRC(1a50a1cc) SHA1(bc16fab84c637ed124e37b115ddc0149560b727d) ) /* sprites */ ROM_LOAD( "717e05", 0x080000, 0x080000, CRC(46ccb506) SHA1(3ed1f54744fc5cdc0f48e42f250c366267a8199a) ) /* sprites */ - ROM_REGION( 0x020000, "gfx2", 0 ) /* graphics (addressable by the main CPU) */ + ROM_REGION( 0x020000, "k051316_1", 0 ) ROM_LOAD( "717e06", 0x000000, 0x020000, CRC(1ec26c7a) SHA1(05b5b522c5ebf5d0a71a7fc39ec9382008ef33c8) ) /* zoom/rotate (N16) */ - ROM_REGION( 0x100000, "gfx3", 0 ) /* graphics (addressable by the main CPU) */ + ROM_REGION( 0x100000, "k051316_2", 0 ) ROM_LOAD( "717e07", 0x000000, 0x040000, CRC(b9a565a8) SHA1(a11782f7336e5ad58a4c6ea81f2eeac35d5e7d0a) ) /* zoom/rotate (L20) */ ROM_LOAD( "717e08", 0x040000, 0x040000, CRC(b68a212e) SHA1(b2bd121a43552c3ade528ac763a0df40c3e648e0) ) /* zoom/rotate (L22) */ ROM_LOAD( "717e11", 0x080000, 0x040000, CRC(ebb171ec) SHA1(d65d4a6b169ce03e4427b2a397484634f938236b) ) /* zoom/rotate (N20) */ diff --git a/src/mame/drivers/overdriv.c b/src/mame/drivers/overdriv.c index 035d97b320a..0f413344cab 100644 --- a/src/mame/drivers/overdriv.c +++ b/src/mame/drivers/overdriv.c @@ -269,23 +269,6 @@ static const k053247_interface overdriv_k053246_intf = overdriv_sprite_callback }; -static const k051316_interface overdriv_k051316_intf_1 = -{ - "gfx2", 1, - 4, TRUE, 0, - 1, 14, -1, - overdriv_zoom_callback_0 -}; - -static const k051316_interface overdriv_k051316_intf_2 = -{ - "gfx3", 2, - 4, FALSE, 0, - 0, 15, 1, - overdriv_zoom_callback_1 -}; - - void overdriv_state::machine_start() { save_item(NAME(m_cpuB_ctrl)); @@ -349,12 +332,21 @@ static MACHINE_CONFIG_START( overdriv, overdriv_state ) MCFG_K053246_ADD("k053246", overdriv_k053246_intf) MCFG_K053246_GFXDECODE("gfxdecode") MCFG_K053246_PALETTE("palette") - MCFG_K051316_ADD("k051316_1", overdriv_k051316_intf_1) - MCFG_K051316_GFXDECODE("gfxdecode") - MCFG_K051316_PALETTE("palette") - MCFG_K051316_ADD("k051316_2", overdriv_k051316_intf_2) - MCFG_K051316_GFXDECODE("gfxdecode") - MCFG_K051316_PALETTE("palette") + + MCFG_DEVICE_ADD("k051316_1", K051316, 0) + MCFG_GFX_PALETTE("palette") + MCFG_K051316_BPP(4) + MCFG_K051316_OFFSETS(14, -1) + MCFG_K051316_WRAP(1) + MCFG_K051316_SETUP_PENS(true, 0) + MCFG_K051316_CB(overdriv_state, zoom_callback_1) + + MCFG_DEVICE_ADD("k051316_2", K051316, 0) + MCFG_GFX_PALETTE("palette") + MCFG_K051316_BPP(4) + MCFG_K051316_OFFSETS(15, 1) + MCFG_K051316_CB(overdriv_state, zoom_callback_2) + MCFG_K053251_ADD("k053251") MCFG_K053250_ADD("k053250_1", "palette", "screen", 0, 0) MCFG_K053250_ADD("k053250_2", "palette", "screen", 0, 0) @@ -406,18 +398,18 @@ ROM_START( overdriv ) ROM_LOAD64_WORD( "e14.r10", 0x000004, 0x100000, CRC(b5eca14b) SHA1(a1c5f5e9cd8bbcfc875e2acb33be024724da63aa) ) ROM_LOAD64_WORD( "e15.r15", 0x000006, 0x100000, CRC(5d93e0c3) SHA1(d5cb7666c0c28fd465c860c7f9dbb18a7f739a93) ) - ROM_REGION( 0x020000, "gfx2", 0 ) /* graphics (addressable by the CPU) */ + ROM_REGION( 0x020000, "k051316_1", 0 ) ROM_LOAD( "e06.a21", 0x000000, 0x020000, CRC(14a085e6) SHA1(86dad6f223e13ff8af7075c3d99bb0a83784c384) ) /* zoom/rotate */ - ROM_REGION( 0x020000, "gfx3", 0 ) /* graphics (addressable by the CPU) */ + ROM_REGION( 0x020000, "k051316_2", 0 ) ROM_LOAD( "e07.c23", 0x000000, 0x020000, CRC(8a6ceab9) SHA1(1a52b7361f71a6126cd648a76af00223d5b25c7a) ) /* zoom/rotate */ - ROM_REGION( 0x0c0000, "k053250_1", 0 ) /* graphics (addressable by the CPU) */ + ROM_REGION( 0x0c0000, "k053250_1", 0 ) ROM_LOAD( "e18.p22", 0x000000, 0x040000, CRC(985a4a75) SHA1(b726166c295be6fbec38a9d11098cc4a4a5de456) ) ROM_LOAD( "e19.r22", 0x040000, 0x040000, CRC(15c54ea2) SHA1(5b10bd28e48e51613359820ba8c75d4a91c2d322) ) ROM_LOAD( "e20.s22", 0x080000, 0x040000, CRC(ea204acd) SHA1(52b8c30234eaefcba1074496028a4ac2bca48e95) ) - ROM_REGION( 0x080000, "k053250_2", 0 ) /* graphics (addressable by the CPU) */ + ROM_REGION( 0x080000, "k053250_2", 0 ) ROM_LOAD( "e17.p17", 0x000000, 0x040000, CRC(04c07248) SHA1(873445002cbf90c9fc5a35bf4a8f6c43193ee342) ) ROM_LOAD( "e16.p12", 0x040000, 0x040000, CRC(9348dee1) SHA1(367193373e28962b5b0e54cc15d68ed88ab83f12) ) diff --git a/src/mame/drivers/rollerg.c b/src/mame/drivers/rollerg.c index 63de2c04752..181baeb603d 100644 --- a/src/mame/drivers/rollerg.c +++ b/src/mame/drivers/rollerg.c @@ -217,14 +217,6 @@ INPUT_PORTS_END ***************************************************************************/ -static const k051316_interface rollerg_k051316_intf = -{ - "gfx2", 1, - 4, FALSE, 0, - 0, 22, 1, - rollerg_zoom_callback -}; - WRITE_LINE_MEMBER(rollerg_state::rollerg_irq_ack_w) { m_maincpu->set_input_line(0, CLEAR_LINE); @@ -272,16 +264,16 @@ static MACHINE_CONFIG_START( rollerg, rollerg_state ) MCFG_PALETTE_ENABLE_SHADOWS() MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) - MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty) - MCFG_DEVICE_ADD("k053244", K053244, 0) MCFG_GFX_PALETTE("palette") MCFG_K05324X_OFFSETS(-3, -1) MCFG_K05324X_CB(rollerg_state, sprite_callback) - MCFG_K051316_ADD("k051316", rollerg_k051316_intf) - MCFG_K051316_GFXDECODE("gfxdecode") - MCFG_K051316_PALETTE("palette") + MCFG_DEVICE_ADD("k051316", K051316, 0) + MCFG_GFX_PALETTE("palette") + MCFG_K051316_BPP(4) + MCFG_K051316_OFFSETS(22, 1) + MCFG_K051316_CB(rollerg_state, zoom_callback) MCFG_DEVICE_ADD("k053252", K053252, 3000000*2) MCFG_K053252_INT1_ACK_CB(WRITELINE(rollerg_state,rollerg_irq_ack_w)) @@ -313,11 +305,11 @@ ROM_START( rollerg ) ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the sound CPU */ ROM_LOAD( "999m01.e11", 0x0000, 0x8000, CRC(1fcfb22f) SHA1(ef058a7de6ba7cf310b91975345113acc6078f8a) ) - ROM_REGION( 0x200000, "k053244", 0 ) /* graphics ( don't dispose as the program can read them, 0 ) */ + ROM_REGION( 0x200000, "k053244", 0 ) ROM_LOAD32_WORD( "999h06.k2", 0x000000, 0x100000, CRC(eda05130) SHA1(b52073a4a4651035d5f1e112601ceb2d004b2143) ) /* sprites */ ROM_LOAD32_WORD( "999h05.k8", 0x000002, 0x100000, CRC(5f321c7d) SHA1(d60a3480891b83ac109f2fecfe2b958bac310c15) ) - ROM_REGION( 0x080000, "gfx2", 0 ) /* graphics ( don't dispose as the program can read them, 0 ) */ + ROM_REGION( 0x080000, "k051316", 0 ) ROM_LOAD( "999h03.d23", 0x000000, 0x040000, CRC(ea1edbd2) SHA1(a17d19f873384287e1e47222d46274e7408b40d4) ) /* zoom */ ROM_LOAD( "999h04.f23", 0x040000, 0x040000, CRC(c1a35355) SHA1(615606d30500a8f2be19171893e985b085fff2fc) ) @@ -333,11 +325,11 @@ ROM_START( rollergj ) ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the sound CPU */ ROM_LOAD( "999m01.e11", 0x0000, 0x8000, CRC(1fcfb22f) SHA1(ef058a7de6ba7cf310b91975345113acc6078f8a) ) - ROM_REGION( 0x200000, "k053244", 0 ) /* graphics ( don't dispose as the program can read them, 0 ) */ + ROM_REGION( 0x200000, "k053244", 0 ) ROM_LOAD32_WORD( "999h06.k2", 0x000000, 0x100000, CRC(eda05130) SHA1(b52073a4a4651035d5f1e112601ceb2d004b2143) ) /* sprites */ ROM_LOAD32_WORD( "999h05.k8", 0x000002, 0x100000, CRC(5f321c7d) SHA1(d60a3480891b83ac109f2fecfe2b958bac310c15) ) - ROM_REGION( 0x080000, "gfx2", 0 ) /* graphics ( don't dispose as the program can read them, 0 ) */ + ROM_REGION( 0x080000, "k051316", 0 ) ROM_LOAD( "999h03.d23", 0x000000, 0x040000, CRC(ea1edbd2) SHA1(a17d19f873384287e1e47222d46274e7408b40d4) ) /* zoom */ ROM_LOAD( "999h04.f23", 0x040000, 0x040000, CRC(c1a35355) SHA1(615606d30500a8f2be19171893e985b085fff2fc) ) diff --git a/src/mame/drivers/tail2nos.c b/src/mame/drivers/tail2nos.c index 1bcaf8eb1d7..50c5299ffe2 100644 --- a/src/mame/drivers/tail2nos.c +++ b/src/mame/drivers/tail2nos.c @@ -180,14 +180,6 @@ WRITE_LINE_MEMBER(tail2nos_state::irqhandler) m_audiocpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE); } -static const k051316_interface tail2nos_k051316_intf = -{ - "gfx3", 2, - -4, TRUE, 0, - 1, -89, -14, - tail2nos_zoom_callback -}; - void tail2nos_state::machine_start() { UINT8 *ROM = memregion("audiocpu")->base(); @@ -236,10 +228,13 @@ static MACHINE_CONFIG_START( tail2nos, tail2nos_state ) MCFG_PALETTE_ADD("palette", 2048) MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB) - - MCFG_K051316_ADD("k051316", tail2nos_k051316_intf) - MCFG_K051316_GFXDECODE("gfxdecode") - MCFG_K051316_PALETTE("palette") + MCFG_DEVICE_ADD("k051316", K051316, 0) + MCFG_GFX_PALETTE("palette") + MCFG_K051316_BPP(-4) + MCFG_K051316_OFFSETS(-89, -14) + MCFG_K051316_SETUP_PENS(true, 0) + MCFG_K051316_WRAP(1) + MCFG_K051316_CB(tail2nos_state, zoom_callback) /* sound hardware */ MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") @@ -283,7 +278,7 @@ ROM_START( tail2nos ) ROM_LOAD( "oj1", 0x000000, 0x40000, CRC(39c36b35) SHA1(a97480696bf6d81bf415737e03cc5324d439ab84) ) ROM_LOAD( "oj2", 0x040000, 0x40000, CRC(77ccaea2) SHA1(e38175859c75c6d0f2f01752fad6e167608c4662) ) - ROM_REGION( 0x20000, "gfx3", ROMREGION_ERASE00 ) /* gfx data for the 051316 */ + ROM_REGION( 0x20000, "k051316", ROMREGION_ERASE00 ) /* RAM, not ROM - handled at run time */ ROM_REGION( 0x20000, "ymsnd", 0 ) /* sound samples */ @@ -318,7 +313,7 @@ ROM_START( sformula ) ROM_LOAD( "oj1", 0x000000, 0x40000, CRC(39c36b35) SHA1(a97480696bf6d81bf415737e03cc5324d439ab84) ) ROM_LOAD( "oj2", 0x040000, 0x40000, CRC(77ccaea2) SHA1(e38175859c75c6d0f2f01752fad6e167608c4662) ) - ROM_REGION( 0x20000, "gfx3", ROMREGION_ERASE00 ) /* gfx data for the 051316 */ + ROM_REGION( 0x20000, "k051316", ROMREGION_ERASE00 ) /* RAM, not ROM - handled at run time */ ROM_REGION( 0x20000, "ymsnd", 0 ) /* sound samples */ diff --git a/src/mame/drivers/ultraman.c b/src/mame/drivers/ultraman.c index 4c01a1d40b6..2918dd433df 100644 --- a/src/mame/drivers/ultraman.c +++ b/src/mame/drivers/ultraman.c @@ -164,30 +164,6 @@ static const k051960_interface ultraman_k051960_intf = ultraman_sprite_callback }; -static const k051316_interface ultraman_k051316_intf_0 = -{ - "gfx2", 1, - 4, FALSE, 0, - 0, 8, 0, - ultraman_zoom_callback_0 -}; - -static const k051316_interface ultraman_k051316_intf_1 = -{ - "gfx3", 2, - 4, FALSE, 0, - 0, 8, 0, - ultraman_zoom_callback_1 -}; - -static const k051316_interface ultraman_k051316_intf_2 = -{ - "gfx4", 3, - 4, TRUE, 0, - 0, 8, 0, - ultraman_zoom_callback_2 -}; - void ultraman_state::machine_start() { save_item(NAME(m_bank0)); @@ -235,17 +211,24 @@ static MACHINE_CONFIG_START( ultraman, ultraman_state ) MCFG_K051960_GFXDECODE("gfxdecode") MCFG_K051960_PALETTE("palette") - MCFG_K051316_ADD("k051316_1", ultraman_k051316_intf_0) - MCFG_K051316_GFXDECODE("gfxdecode") - MCFG_K051316_PALETTE("palette") + MCFG_DEVICE_ADD("k051316_1", K051316, 0) + MCFG_GFX_PALETTE("palette") + MCFG_K051316_BPP(4) + MCFG_K051316_OFFSETS(8, 0) + MCFG_K051316_CB(ultraman_state, zoom_callback_1) - MCFG_K051316_ADD("k051316_2", ultraman_k051316_intf_1) - MCFG_K051316_GFXDECODE("gfxdecode") - MCFG_K051316_PALETTE("palette") + MCFG_DEVICE_ADD("k051316_2", K051316, 0) + MCFG_GFX_PALETTE("palette") + MCFG_K051316_BPP(4) + MCFG_K051316_OFFSETS(8, 0) + MCFG_K051316_CB(ultraman_state, zoom_callback_2) - MCFG_K051316_ADD("k051316_3", ultraman_k051316_intf_2) - MCFG_K051316_GFXDECODE("gfxdecode") - MCFG_K051316_PALETTE("palette") + MCFG_DEVICE_ADD("k051316_3", K051316, 0) + MCFG_GFX_PALETTE("palette") + MCFG_K051316_BPP(4) + MCFG_K051316_SETUP_PENS(true, 0) + MCFG_K051316_OFFSETS(8, 0) + MCFG_K051316_CB(ultraman_state, zoom_callback_3) /* sound hardware */ MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") @@ -273,19 +256,19 @@ ROM_START( ultraman ) ROM_LOAD( "910-a19.l04", 0x000000, 0x080000, CRC(2dc9ffdc) SHA1(aa34247c82d48c8d13f5209be292127938a4a682) ) ROM_LOAD( "910-a20.l01", 0x080000, 0x080000, CRC(a4298dce) SHA1(62faf8f0c0490a9562b75ce27909fbee6e84b22a) ) - ROM_REGION( 0x080000, "gfx2", 0 ) /* BG 1 */ + ROM_REGION( 0x080000, "k051316_1", 0 ) ROM_LOAD( "910-a07.j15", 0x000000, 0x020000, CRC(8b43a64e) SHA1(e373d0fd88b59fb01782dfaeccb1e13673a35766) ) ROM_LOAD( "910-a08.j16", 0x020000, 0x020000, CRC(c3829826) SHA1(0d383a7afac2a3b5da692375a2b2cd675848861a) ) ROM_LOAD( "910-a09.j18", 0x040000, 0x020000, CRC(ee10b519) SHA1(a34bd7d89bb8a19af7252ed96ffce212788c586b) ) ROM_LOAD( "910-a10.j19", 0x060000, 0x020000, CRC(cffbb0c3) SHA1(e9ebe350289f0436de10a6289b04eed3b6a9f98e) ) - ROM_REGION( 0x080000, "gfx3", 0 ) /* BG 2 */ + ROM_REGION( 0x080000, "k051316_2", 0 ) ROM_LOAD( "910-a11.l15", 0x000000, 0x020000, CRC(17a5581d) SHA1(aca5d465a0e181a266a165aeb0112a4696b0cd18) ) ROM_LOAD( "910-a12.l16", 0x020000, 0x020000, CRC(39763fb5) SHA1(0e1795af4bae545a0a2be265398837fb2d623232) ) ROM_LOAD( "910-a13.l18", 0x040000, 0x020000, CRC(66b25a4f) SHA1(954552b005582c90d570ae32c715108ec4b088f1) ) ROM_LOAD( "910-a14.l19", 0x060000, 0x020000, CRC(09fbd412) SHA1(d11587db7b03f3a75ad8964523bb34f4453bbaca) ) - ROM_REGION( 0x080000, "gfx4", 0 ) /* BG 3 */ + ROM_REGION( 0x080000, "k051316_3", 0 ) ROM_LOAD( "910-a15.m15", 0x000000, 0x020000, CRC(6d5bfbb7) SHA1(e98c594446b506cb32cc5cc958d2f0de22ebed5e) ) ROM_LOAD( "910-a16.m16", 0x020000, 0x020000, CRC(5f6f8c3d) SHA1(e365836d2263f36aa4602f0618bf7ce693d2e106) ) ROM_LOAD( "910-a17.m18", 0x040000, 0x020000, CRC(1f3ec4ff) SHA1(875f53516f47decc4ce31154cf4694c8429ee4ea) ) diff --git a/src/mame/drivers/wecleman.c b/src/mame/drivers/wecleman.c index 1f0b8e0abab..383b2044d5a 100644 --- a/src/mame/drivers/wecleman.c +++ b/src/mame/drivers/wecleman.c @@ -1092,22 +1092,6 @@ INTERRUPT_GEN_MEMBER(wecleman_state::hotchase_sound_timer) device.execute().set_input_line(M6809_FIRQ_LINE, HOLD_LINE); } -static const k051316_interface hotchase_k051316_intf_0 = -{ - "gfx2", 1, - 4, FALSE, 0, - 1, -0xb0 / 2, -16, - hotchase_zoom_callback_0 -}; - -static const k051316_interface hotchase_k051316_intf_1 = -{ - "gfx3", 2, - 4, FALSE, 0, - 0, -0xb0 / 2, -16, - hotchase_zoom_callback_1 -}; - MACHINE_RESET_MEMBER(wecleman_state,hotchase) { int i; @@ -1152,15 +1136,20 @@ static MACHINE_CONFIG_START( hotchase, wecleman_state ) MCFG_GFXDECODE_ADD("gfxdecode", "palette", hotchase) MCFG_PALETTE_ADD("palette", 2048*2) - MCFG_VIDEO_START_OVERRIDE(wecleman_state,hotchase) + MCFG_VIDEO_START_OVERRIDE(wecleman_state, hotchase) - MCFG_K051316_ADD("k051316_1", hotchase_k051316_intf_0) - MCFG_K051316_GFXDECODE("gfxdecode") - MCFG_K051316_PALETTE("palette") + MCFG_DEVICE_ADD("k051316_1", K051316, 0) + MCFG_GFX_PALETTE("palette") + MCFG_K051316_BPP(4) + MCFG_K051316_OFFSETS(-0xb0 / 2, -16) + MCFG_K051316_WRAP(1) + MCFG_K051316_CB(wecleman_state, hotchase_zoom_callback_1) - MCFG_K051316_ADD("k051316_2", hotchase_k051316_intf_1) - MCFG_K051316_GFXDECODE("gfxdecode") - MCFG_K051316_PALETTE("palette") + MCFG_DEVICE_ADD("k051316_2", K051316, 0) + MCFG_GFX_PALETTE("palette") + MCFG_K051316_BPP(4) + MCFG_K051316_OFFSETS(-0xb0 / 2, -16) + MCFG_K051316_CB(wecleman_state, hotchase_zoom_callback_2) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") @@ -1381,10 +1370,10 @@ ROM_START( hotchase ) ROM_LOAD16_WORD_SWAP( "763e19", 0x200000, 0x080000, CRC(a2622e56) SHA1(0a0ed9713882b987518e6f06a02dba417c1f4f32) ) ROM_LOAD16_WORD_SWAP( "763e22", 0x280000, 0x080000, CRC(967c49d1) SHA1(01979d216a9fd8085298445ac5f7870d1598db74) ) - ROM_REGION( 0x20000, "gfx2", 0 ) /* bg */ + ROM_REGION( 0x20000, "k051316_1", 0 ) /* bg */ ROM_LOAD( "763e14", 0x000000, 0x020000, CRC(60392aa1) SHA1(8499eb40a246587e24f6fd00af2eaa6d75ee6363) ) - ROM_REGION( 0x10000, "gfx3", 0 ) /* fg (patched) */ + ROM_REGION( 0x10000, "k051316_2", 0 ) /* fg (patched) */ ROM_LOAD( "763a13", 0x000000, 0x010000, CRC(8bed8e0d) SHA1(ccff330abc23fe499e76c16cab5783c3daf155dd) ) ROM_REGION( 0x20000, "gfx4", 0 ) /* road */ @@ -1471,7 +1460,7 @@ DRIVER_INIT_MEMBER(wecleman_state,hotchase) hotchase_sprite_decode(3,0x80000*2); // num banks, bank len /* Let's copy the second half of the fg layer gfx (charset) over the first */ - RAM = memregion("gfx3")->base(); + RAM = memregion("k051316_2")->base(); memcpy(&RAM[0], &RAM[0x10000/2], 0x10000/2); m_spr_color_offs = 0; diff --git a/src/mame/includes/88games.h b/src/mame/includes/88games.h index 06d16aa1d4e..631f6207698 100644 --- a/src/mame/includes/88games.h +++ b/src/mame/includes/88games.h @@ -62,9 +62,9 @@ public: virtual void machine_reset(); UINT32 screen_update_88games(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(k88games_interrupt); + K051316_CB_MEMBER(zoom_callback); }; /*----------- defined in video/88games.c -----------*/ void _88games_sprite_callback(running_machine &machine, int *code, int *color, int *priority, int *shadow); void _88games_tile_callback(running_machine &machine, int layer, int bank, int *code, int *color, int *flags, int *priority); -void _88games_zoom_callback(running_machine &machine, int *code, int *color, int *flags); diff --git a/src/mame/includes/ajax.h b/src/mame/includes/ajax.h index 45bc2d453ed..14d53eb947c 100644 --- a/src/mame/includes/ajax.h +++ b/src/mame/includes/ajax.h @@ -55,10 +55,9 @@ public: INTERRUPT_GEN_MEMBER(ajax_interrupt); DECLARE_WRITE8_MEMBER(volume_callback0); DECLARE_WRITE8_MEMBER(volume_callback1); - + K051316_CB_MEMBER(zoom_callback); }; /*----------- defined in video/ajax.c -----------*/ extern void ajax_tile_callback(running_machine &machine, int layer,int bank,int *code,int *color,int *flags,int *priority); extern void ajax_sprite_callback(running_machine &machine, int *code,int *color,int *priority,int *shadow); -extern void ajax_zoom_callback(running_machine &machine, int *code,int *color,int *flags); diff --git a/src/mame/includes/bottom9.h b/src/mame/includes/bottom9.h index 5a799801ad6..1692ec8ece1 100644 --- a/src/mame/includes/bottom9.h +++ b/src/mame/includes/bottom9.h @@ -23,9 +23,6 @@ public: m_k051316(*this, "k051316"), m_palette(*this, "palette") { } - /* memory pointers */ -// UINT8 * m_paletteram; // currently this uses generic palette handling - /* video-related */ int m_layer_colorbase[3]; int m_sprite_colorbase; @@ -65,10 +62,10 @@ public: INTERRUPT_GEN_MEMBER(bottom9_sound_interrupt); DECLARE_WRITE8_MEMBER(volume_callback0); DECLARE_WRITE8_MEMBER(volume_callback1); + K051316_CB_MEMBER(zoom_callback); }; /*----------- defined in video/bottom9.c -----------*/ extern void bottom9_tile_callback(running_machine &machine, int layer,int bank,int *code,int *color,int *flags,int *priority); extern void bottom9_sprite_callback(running_machine &machine, int *code,int *color,int *priority,int *shadow); -extern void bottom9_zoom_callback(running_machine &machine, int *code,int *color,int *flags); diff --git a/src/mame/includes/chqflag.h b/src/mame/includes/chqflag.h index b778daeb001..d6de44b1c8e 100644 --- a/src/mame/includes/chqflag.h +++ b/src/mame/includes/chqflag.h @@ -62,10 +62,10 @@ public: TIMER_DEVICE_CALLBACK_MEMBER(chqflag_scanline); DECLARE_WRITE8_MEMBER(volume_callback0); DECLARE_WRITE8_MEMBER(volume_callback1); + K051316_CB_MEMBER(zoom_callback_1); + K051316_CB_MEMBER(zoom_callback_2); }; /*----------- defined in video/chqflag.c -----------*/ extern void chqflag_sprite_callback(running_machine &machine, int *code,int *color,int *priority,int *shadow); -extern void chqflag_zoom_callback_0(running_machine &machine, int *code,int *color,int *flags); -extern void chqflag_zoom_callback_1(running_machine &machine, int *code,int *color,int *flags); diff --git a/src/mame/includes/overdriv.h b/src/mame/includes/overdriv.h index 76115bfcfc7..a372cd409c2 100644 --- a/src/mame/includes/overdriv.h +++ b/src/mame/includes/overdriv.h @@ -69,9 +69,9 @@ public: TIMER_DEVICE_CALLBACK_MEMBER(overdriv_cpuA_scanline); DECLARE_WRITE16_MEMBER( overdriv_k053246_word_w ); + K051316_CB_MEMBER(zoom_callback_1); + K051316_CB_MEMBER(zoom_callback_2); }; /*----------- defined in video/overdriv.c -----------*/ extern void overdriv_sprite_callback(running_machine &machine, int *code,int *color,int *priority_mask); -extern void overdriv_zoom_callback_0(running_machine &machine, int *code,int *color,int *flags); -extern void overdriv_zoom_callback_1(running_machine &machine, int *code,int *color,int *flags); diff --git a/src/mame/includes/rollerg.h b/src/mame/includes/rollerg.h index 77b380eddf4..5e03c71fd8c 100644 --- a/src/mame/includes/rollerg.h +++ b/src/mame/includes/rollerg.h @@ -56,10 +56,8 @@ public: virtual void video_start(); UINT32 screen_update_rollerg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); MCFG_K05324X_CB_MEMBER(sprite_callback); + K051316_CB_MEMBER(zoom_callback); protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); }; - -/*----------- defined in video/rollerg.c -----------*/ -extern void rollerg_zoom_callback(running_machine &machine, int *code, int *color, int *flags); diff --git a/src/mame/includes/tail2nos.h b/src/mame/includes/tail2nos.h index e8938caf05a..1c2dec8120d 100644 --- a/src/mame/includes/tail2nos.h +++ b/src/mame/includes/tail2nos.h @@ -52,7 +52,5 @@ public: void tail2nos_postload(); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); DECLARE_WRITE_LINE_MEMBER(irqhandler); + K051316_CB_MEMBER(zoom_callback); }; - -/*----------- defined in video/tail2nos.c -----------*/ -extern void tail2nos_zoom_callback(running_machine &machine, int *code,int *color,int *flags); diff --git a/src/mame/includes/ultraman.h b/src/mame/includes/ultraman.h index 2c22aaa65e4..38d94c9803d 100644 --- a/src/mame/includes/ultraman.h +++ b/src/mame/includes/ultraman.h @@ -44,10 +44,10 @@ public: virtual void machine_reset(); virtual void video_start(); UINT32 screen_update_ultraman(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + K051316_CB_MEMBER(zoom_callback_1); + K051316_CB_MEMBER(zoom_callback_2); + K051316_CB_MEMBER(zoom_callback_3); }; /*----------- defined in video/ultraman.c -----------*/ extern void ultraman_sprite_callback(running_machine &machine, int *code,int *color,int *priority,int *shadow); -extern void ultraman_zoom_callback_0(running_machine &machine, int *code,int *color,int *flags); -extern void ultraman_zoom_callback_1(running_machine &machine, int *code,int *color,int *flags); -extern void ultraman_zoom_callback_2(running_machine &machine, int *code,int *color,int *flags); diff --git a/src/mame/includes/wecleman.h b/src/mame/includes/wecleman.h index 086d99ff932..e5b512d81fa 100644 --- a/src/mame/includes/wecleman.h +++ b/src/mame/includes/wecleman.h @@ -107,6 +107,8 @@ public: template void sprite_draw(_BitmapClass &bitmap, const rectangle &cliprect); void wecleman_draw_road(bitmap_rgb32 &bitmap, const rectangle &cliprect, int priority); void hotchase_draw_road(bitmap_ind16 &bitmap, const rectangle &cliprect); + K051316_CB_MEMBER(hotchase_zoom_callback_1); + K051316_CB_MEMBER(hotchase_zoom_callback_2); required_device m_maincpu; required_device m_audiocpu; @@ -122,7 +124,3 @@ public: required_device m_screen; required_shared_ptr m_generic_paletteram_16; }; - -/*----------- defined in video/wecleman.c -----------*/ -void hotchase_zoom_callback_0(running_machine &machine, int *code,int *color,int *flags); -void hotchase_zoom_callback_1(running_machine &machine, int *code,int *color,int *flags); diff --git a/src/mame/video/88games.c b/src/mame/video/88games.c index d7c96d13b29..5ccd5685550 100644 --- a/src/mame/video/88games.c +++ b/src/mame/video/88games.c @@ -38,13 +38,11 @@ void _88games_sprite_callback( running_machine &machine, int *code, int *color, ***************************************************************************/ -void _88games_zoom_callback( running_machine &machine, int *code, int *color, int *flags ) +K051316_CB_MEMBER(_88games_state::zoom_callback) { - _88games_state *state = machine.driver_data<_88games_state>(); - *flags = (*color & 0x40) ? TILE_FLIPX : 0; *code |= ((*color & 0x07) << 8); - *color = state->m_zoom_colorbase + ((*color & 0x38) >> 3) + ((*color & 0x80) >> 4); + *color = m_zoom_colorbase + ((*color & 0x38) >> 3) + ((*color & 0x80) >> 4); } /*************************************************************************** diff --git a/src/mame/video/ajax.c b/src/mame/video/ajax.c index 2e85503d09a..670c148ef05 100644 --- a/src/mame/video/ajax.c +++ b/src/mame/video/ajax.c @@ -53,11 +53,10 @@ void ajax_sprite_callback( running_machine &machine, int *code, int *color, int ***************************************************************************/ -void ajax_zoom_callback( running_machine &machine, int *code, int *color, int *flags ) +K051316_CB_MEMBER(ajax_state::zoom_callback) { - ajax_state *state = machine.driver_data(); *code |= ((*color & 0x07) << 8); - *color = state->m_zoom_colorbase + ((*color & 0x08) >> 3); + *color = m_zoom_colorbase + ((*color & 0x08) >> 3); } diff --git a/src/mame/video/bottom9.c b/src/mame/video/bottom9.c index 777f1c1a132..97c3f01e67e 100644 --- a/src/mame/video/bottom9.c +++ b/src/mame/video/bottom9.c @@ -38,12 +38,11 @@ void bottom9_sprite_callback( running_machine &machine, int *code, int *color, i ***************************************************************************/ -void bottom9_zoom_callback( running_machine &machine, int *code, int *color, int *flags ) +K051316_CB_MEMBER(bottom9_state::zoom_callback) { - bottom9_state *state = machine.driver_data(); *flags = (*color & 0x40) ? TILE_FLIPX : 0; *code |= ((*color & 0x03) << 8); - *color = state->m_zoom_colorbase + ((*color & 0x3c) >> 2); + *color = m_zoom_colorbase + ((*color & 0x3c) >> 2); } diff --git a/src/mame/video/chqflag.c b/src/mame/video/chqflag.c index 26df39ce3b1..77479dc1f4f 100644 --- a/src/mame/video/chqflag.c +++ b/src/mame/video/chqflag.c @@ -30,19 +30,17 @@ void chqflag_sprite_callback( running_machine &machine, int *code, int *color, i ***************************************************************************/ -void chqflag_zoom_callback_0( running_machine &machine, int *code, int *color, int *flags ) +K051316_CB_MEMBER(chqflag_state::zoom_callback_1) { - chqflag_state *state = machine.driver_data(); *code |= ((*color & 0x03) << 8); - *color = state->m_zoom_colorbase[0] + ((*color & 0x3c) >> 2); + *color = m_zoom_colorbase[0] + ((*color & 0x3c) >> 2); } -void chqflag_zoom_callback_1( running_machine &machine, int *code, int *color, int *flags ) +K051316_CB_MEMBER(chqflag_state::zoom_callback_2) { - chqflag_state *state = machine.driver_data(); *flags = TILE_FLIPYX((*color & 0xc0) >> 6); *code |= ((*color & 0x0f) << 8); - *color = state->m_zoom_colorbase[1] + ((*color & 0x10) >> 4); + *color = m_zoom_colorbase[1] + ((*color & 0x10) >> 4); } /*************************************************************************** diff --git a/src/mame/video/k051316.c b/src/mame/video/k051316.c index 9ad2ce1d8c5..f0f85b12058 100644 --- a/src/mame/video/k051316.c +++ b/src/mame/video/k051316.c @@ -36,170 +36,145 @@ control registers #include "emu.h" #include "k051316.h" -#include "konami_helper.h" + #define VERBOSE 0 #define LOG(x) do { if (VERBOSE) logerror x; } while (0) -#define XOR(a) WORD_XOR_BE(a) - const device_type K051316 = &device_creator; + +const gfx_layout k051316_device::charlayout4 = +{ + 16,16, + RGN_FRAC(1,1), + 4, + { 0, 1, 2, 3 }, + { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4, + 8*4, 9*4, 10*4, 11*4, 12*4, 13*4, 14*4, 15*4 }, + { 0*64, 1*64, 2*64, 3*64, 4*64, 5*64, 6*64, 7*64, + 8*64, 9*64, 10*64, 11*64, 12*64, 13*64, 14*64, 15*64 }, + 128*8 +}; + +const gfx_layout k051316_device::charlayout7 = +{ + 16,16, + RGN_FRAC(1,1), + 7, + { 1,2,3,4,5,6,7 }, + { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, + 8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 }, + { 0*128, 1*128, 2*128, 3*128, 4*128, 5*128, 6*128, 7*128, + 8*128, 9*128, 10*128, 11*128, 12*128, 13*128, 14*128, 15*128 }, + 256*8 +}; + +const gfx_layout k051316_device::charlayout8 = +{ + 16,16, + RGN_FRAC(1,1), + 8, + { 0,1,2,3,4,5,6,7 }, + { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, + 8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 }, + { 0*128, 1*128, 2*128, 3*128, 4*128, 5*128, 6*128, 7*128, + 8*128, 9*128, 10*128, 11*128, 12*128, 13*128, 14*128, 15*128 }, + 256*8 +}; + +const gfx_layout k051316_device::charlayout_tail2nos = +{ + 16,16, + RGN_FRAC(1,1), + 4, + { 0, 1, 2, 3 }, + { WORD_XOR_BE(0)*4, WORD_XOR_BE(1)*4, WORD_XOR_BE(2)*4, WORD_XOR_BE(3)*4, + WORD_XOR_BE(4)*4, WORD_XOR_BE(5)*4, WORD_XOR_BE(6)*4, WORD_XOR_BE(7)*4, + WORD_XOR_BE(8)*4, WORD_XOR_BE(9)*4, WORD_XOR_BE(10)*4, WORD_XOR_BE(11)*4, + WORD_XOR_BE(12)*4, WORD_XOR_BE(13)*4, WORD_XOR_BE(14)*4, WORD_XOR_BE(15)*4 }, + { 0*64, 1*64, 2*64, 3*64, 4*64, 5*64, 6*64, 7*64, + 8*64, 9*64, 10*64, 11*64, 12*64, 13*64, 14*64, 15*64 }, + 128*8 +}; + + +GFXDECODE_MEMBER( k051316_device::gfxinfo ) + GFXDECODE_DEVICE(DEVICE_SELF, 0, charlayout4, 0, 1) +GFXDECODE_END + +GFXDECODE_MEMBER( k051316_device::gfxinfo7 ) + GFXDECODE_DEVICE(DEVICE_SELF, 0, charlayout7, 0, 1) +GFXDECODE_END + +GFXDECODE_MEMBER( k051316_device::gfxinfo8 ) + GFXDECODE_DEVICE(DEVICE_SELF, 0, charlayout8, 0, 1) +GFXDECODE_END + +GFXDECODE_MEMBER( k051316_device::gfxinfo4_tail2nos ) + GFXDECODE_DEVICE(DEVICE_SELF, 0, charlayout_tail2nos, 0, 1) +GFXDECODE_END + + k051316_device::k051316_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, K051316, "K051316 Video Controller", tag, owner, clock, "k051316", __FILE__), - m_ram(NULL), - //m_tmap, - //m_ctrlram[16], - m_gfxdecode(*this), - m_palette(*this) + device_gfx_interface(mconfig, *this, gfxinfo), + m_ram(NULL), + m_zoom_rom(NULL), + m_zoom_size(0), + m_dx(0), + m_dy(0), + m_wrap(0), + m_pen_is_mask(false), + m_bpp(0), + m_transparent_pen(0) { } -//------------------------------------------------- -// static_set_gfxdecode_tag: Set the tag of the -// gfx decoder -//------------------------------------------------- - -void k051316_device::static_set_gfxdecode_tag(device_t &device, const char *tag) +void k051316_device::set_bpp(device_t &device, int bpp) { - downcast(device).m_gfxdecode.set_tag(tag); -} + k051316_device &dev = downcast(device); + dev.m_bpp = bpp; - -//------------------------------------------------- -// static_set_palette_tag: Set the tag of the -// palette device -//------------------------------------------------- - -void k051316_device::static_set_palette_tag(device_t &device, const char *tag) -{ - downcast(device).m_palette.set_tag(tag); -} - -//------------------------------------------------- -// device_config_complete - perform any -// operations now that the configuration is -// complete -//------------------------------------------------- - -void k051316_device::device_config_complete() -{ - // inherit a copy of the static data - const k051316_interface *intf = reinterpret_cast(static_config()); - if (intf != NULL) - *static_cast(this) = *intf; - - // or initialize to defaults if none provided - else + switch(bpp) { - m_gfx_memory_region_tag = ""; - m_gfx_num = 0; - m_bpp = 0; - m_pen_is_mask = 0; - m_transparent_pen = 0; - m_wrap = 0; - m_xoffs = 0; - m_yoffs = 0; - m_callback = NULL; + case 4: + device_gfx_interface::static_set_info(dev, gfxinfo); + break; + case 7: + device_gfx_interface::static_set_info(dev, gfxinfo7); + break; + case 8: + device_gfx_interface::static_set_info(dev, gfxinfo8); + break; + case -4: + device_gfx_interface::static_set_info(dev, gfxinfo4_tail2nos); + dev.m_bpp = 4; + break; + default: + fatalerror("Unsupported bpp\n"); } } + + //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- void k051316_device::device_start() { - if(!m_gfxdecode->started()) - throw device_missing_dependencies(); + m_zoom_rom = region()->base(); + m_zoom_size = region()->bytes(); - int is_tail2nos = 0; - UINT32 total; - - static const gfx_layout charlayout4 = - { - 16,16, - 0, - 4, - { 0, 1, 2, 3 }, - { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4, - 8*4, 9*4, 10*4, 11*4, 12*4, 13*4, 14*4, 15*4 }, - { 0*64, 1*64, 2*64, 3*64, 4*64, 5*64, 6*64, 7*64, - 8*64, 9*64, 10*64, 11*64, 12*64, 13*64, 14*64, 15*64 }, - 128*8 - }; - - static const gfx_layout charlayout7 = - { - 16,16, - 0, - 7, - { 1,2,3,4,5,6,7 }, - { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, - 8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 }, - { 0*128, 1*128, 2*128, 3*128, 4*128, 5*128, 6*128, 7*128, - 8*128, 9*128, 10*128, 11*128, 12*128, 13*128, 14*128, 15*128 }, - 256*8 - }; - - static const gfx_layout charlayout8 = - { - 16,16, - 0, - 8, - { 0,1,2,3,4,5,6,7 }, - { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, - 8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 }, - { 0*128, 1*128, 2*128, 3*128, 4*128, 5*128, 6*128, 7*128, - 8*128, 9*128, 10*128, 11*128, 12*128, 13*128, 14*128, 15*128 }, - 256*8 - }; - - static const gfx_layout charlayout_tail2nos = - { - 16,16, - 0, - 4, - { 0, 1, 2, 3 }, - { XOR(0)*4, XOR(1)*4, XOR(2)*4, XOR(3)*4, XOR(4)*4, XOR(5)*4, XOR(6)*4, XOR(7)*4, - XOR(8)*4, XOR(9)*4, XOR(10)*4, XOR(11)*4, XOR(12)*4, XOR(13)*4, XOR(14)*4, XOR(15)*4 }, - { 0*64, 1*64, 2*64, 3*64, 4*64, 5*64, 6*64, 7*64, - 8*64, 9*64, 10*64, 11*64, 12*64, 13*64, 14*64, 15*64 }, - 128*8 - }; - - /* decode the graphics */ - switch (m_bpp) - { - case -4: - total = 0x400; - is_tail2nos = 1; - konami_decode_gfx(machine(), m_gfxdecode, m_palette, m_gfx_num, machine().root_device().memregion(m_gfx_memory_region_tag)->base(), total, &charlayout_tail2nos, 4); - break; - - case 4: - total = machine().root_device().memregion(m_gfx_memory_region_tag)->bytes() / 128; - konami_decode_gfx(machine(), m_gfxdecode, m_palette, m_gfx_num, machine().root_device().memregion(m_gfx_memory_region_tag)->base(), total, &charlayout4, 4); - break; - - case 7: - total = machine().root_device().memregion(m_gfx_memory_region_tag)->bytes() / 256; - konami_decode_gfx(machine(), m_gfxdecode, m_palette, m_gfx_num, machine().root_device().memregion(m_gfx_memory_region_tag)->base(), total, &charlayout7, 7); - break; - - case 8: - total = machine().root_device().memregion(m_gfx_memory_region_tag)->bytes() / 256; - konami_decode_gfx(machine(), m_gfxdecode, m_palette, m_gfx_num, machine().root_device().memregion(m_gfx_memory_region_tag)->base(), total, &charlayout8, 8); - break; - - default: - fatalerror("Unsupported bpp\n"); - } - - m_bpp = is_tail2nos ? 4 : m_bpp; // tail2nos is passed with bpp = -4 to setup the custom charlayout! - - m_tmap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k051316_device::get_tile_info0),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32); + decode_gfx(); + gfx(0)->set_colors(palette()->entries() / gfx(0)->depth()); + if (m_bpp == 4) + gfx(0)->set_source_and_total(m_zoom_rom, m_zoom_size / 128); + else + gfx(0)->set_source_and_total(m_zoom_rom, m_zoom_size / 256); + m_tmap = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(k051316_device::get_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32); m_ram = auto_alloc_array_clear(machine(), UINT8, 0x800); if (!m_pen_is_mask) @@ -210,6 +185,9 @@ void k051316_device::device_start() m_tmap->map_pens_to_layer(0, m_transparent_pen, m_transparent_pen, TILEMAP_PIXEL_LAYER0); } + // bind callbacks + m_k051316_cb.bind_relative_to(*owner()); + save_pointer(NAME(m_ram), 0x800); save_item(NAME(m_ctrlram)); save_item(NAME(m_wrap)); @@ -222,7 +200,7 @@ void k051316_device::device_start() void k051316_device::device_reset() { - memset(m_ctrlram, 0, 0x10); + memset(m_ctrlram, 0, 0x10); } /***************************************************************************** @@ -248,11 +226,11 @@ READ8_MEMBER( k051316_device::rom_r ) int addr = offset + (m_ctrlram[0x0c] << 11) + (m_ctrlram[0x0d] << 19); if (m_bpp <= 4) addr /= 2; - addr &= space.machine().root_device().memregion(m_gfx_memory_region_tag)->bytes() - 1; + addr &= m_zoom_size - 1; // popmessage("%s: offset %04x addr %04x", space.machine().describe_context(), offset, addr); - return space.machine().root_device().memregion(m_gfx_memory_region_tag)->base()[addr]; + return m_zoom_rom[addr]; } else { @@ -279,24 +257,21 @@ void k051316_device::wraparound_enable( int status ) ***************************************************************************/ -void k051316_device::get_tile_info( tile_data &tileinfo, int tile_index ) -{ +TILE_GET_INFO_MEMBER(k051316_device::get_tile_info) +{ int code = m_ram[tile_index]; int color = m_ram[tile_index + 0x400]; int flags = 0; - - m_callback(machine(), &code, &color, &flags); - - SET_TILE_INFO_MEMBER(m_gfx_num, - code, - color, - flags); + + m_k051316_cb(&code, &color, &flags); + + SET_TILE_INFO_MEMBER(0, + code, + color, + flags); } -TILE_GET_INFO_MEMBER(k051316_device::get_tile_info0) { get_tile_info(tileinfo, tile_index); } - - void k051316_device::zoom_draw( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int flags, UINT32 priority ) { UINT32 startx, starty; @@ -309,16 +284,16 @@ void k051316_device::zoom_draw( screen_device &screen, bitmap_ind16 &bitmap, con incxy = (INT16)(256 * m_ctrlram[0x08] + m_ctrlram[0x09]); incyy = (INT16)(256 * m_ctrlram[0x0a] + m_ctrlram[0x0b]); - startx -= (16 + m_yoffs) * incyx; - starty -= (16 + m_yoffs) * incyy; + startx -= (16 + m_dy) * incyx; + starty -= (16 + m_dy) * incyy; - startx -= (89 + m_xoffs) * incxx; - starty -= (89 + m_xoffs) * incxy; + startx -= (89 + m_dx) * incxx; + starty -= (89 + m_dx) * incxy; - m_tmap->draw_roz(screen, bitmap, cliprect, startx << 5,starty << 5, - incxx << 5,incxy << 5,incyx << 5,incyy << 5, + m_tmap->draw_roz(screen, bitmap, cliprect, startx << 5, starty << 5, + incxx << 5, incxy << 5, incyx << 5, incyy << 5, m_wrap, - flags,priority); + flags, priority); #if 0 popmessage("%02x%02x%02x%02x %02x%02x%02x%02x %02x%02x%02x%02x %02x%02x%02x%02x", diff --git a/src/mame/video/k051316.h b/src/mame/video/k051316.h index 885e8c65365..bccf18432c9 100644 --- a/src/mame/video/k051316.h +++ b/src/mame/video/k051316.h @@ -2,27 +2,58 @@ #ifndef __K051316_H__ #define __K051316_H__ -typedef void (*k051316_callback)(running_machine &machine, int *code, int *color, int *flags); +typedef device_delegate k051316_cb_delegate; +#define K051316_CB_MEMBER(_name) void _name(int *code, int *color, int *flags) + + +#define MCFG_K051316_CB(_class, _method) \ + k051316_device::set_k051316_callback(*device, k051316_cb_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner))); + +#define MCFG_K051316_OFFSETS(_xoffs, _yoffs) \ + k051316_device::set_offsets(*device, _xoffs, _yoffs); + +#define MCFG_K051316_BPP(_bpp) \ + k051316_device::set_bpp(*device, _bpp); + +#define MCFG_K051316_SETUP_PENS(_mask, _pen) \ + k051316_device::set_pens(*device, _mask, _pen); + +#define MCFG_K051316_WRAP(_wrap) \ + k051316_device::set_wrap(*device, _wrap); -struct k051316_interface -{ - const char *m_gfx_memory_region_tag; - int m_gfx_num; - int m_bpp, m_pen_is_mask, m_transparent_pen; - int m_wrap, m_xoffs, m_yoffs; - k051316_callback m_callback; -}; class k051316_device : public device_t, - public k051316_interface + public device_gfx_interface { public: k051316_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); ~k051316_device() {} + static const gfx_layout charlayout4; + static const gfx_layout charlayout7; + static const gfx_layout charlayout8; + static const gfx_layout charlayout_tail2nos; + DECLARE_GFXDECODE_MEMBER(gfxinfo); + DECLARE_GFXDECODE_MEMBER(gfxinfo7); + DECLARE_GFXDECODE_MEMBER(gfxinfo8); + DECLARE_GFXDECODE_MEMBER(gfxinfo4_tail2nos); + // static configuration - static void static_set_gfxdecode_tag(device_t &device, const char *tag); - static void static_set_palette_tag(device_t &device, const char *tag); + static void set_k051316_callback(device_t &device, k051316_cb_delegate callback) { downcast(device).m_k051316_cb = callback; } + static void set_wrap(device_t &device, int wrap) { downcast(device).m_wrap = wrap; } + static void set_bpp(device_t &device, int bpp); + static void set_pens(device_t &device, bool mask, int transp) + { + k051316_device &dev = downcast(device); + dev.m_pen_is_mask = mask; + dev.m_transparent_pen = transp; + } + static void set_offsets(device_t &device, int x_offset, int y_offset) + { + k051316_device &dev = downcast(device); + dev.m_dx = x_offset; + dev.m_dy = y_offset; + } /* The callback is passed: @@ -43,32 +74,31 @@ public: void zoom_draw(screen_device &screen, bitmap_ind16 &bitmap,const rectangle &cliprect,int flags,UINT32 priority); void wraparound_enable(int status); + void zoomram_updated(UINT32 offs) { gfx(0)->mark_dirty(offs); } + protected: // device-level overrides - virtual void device_config_complete(); virtual void device_start(); virtual void device_reset(); + private: // internal state - UINT8 *m_ram; - tilemap_t *m_tmap; - UINT8 m_ctrlram[16]; - required_device m_gfxdecode; - required_device m_palette; + UINT8 *m_ram; + UINT8 m_ctrlram[16]; + tilemap_t *m_tmap; - TILE_GET_INFO_MEMBER(get_tile_info0); - void get_tile_info( tile_data &tileinfo, int tile_index ); + UINT8 *m_zoom_rom; + UINT32 m_zoom_size; + + int m_dx, m_dy; + int m_wrap; + bool m_pen_is_mask; + int m_bpp, m_transparent_pen; + k051316_cb_delegate m_k051316_cb; + + TILE_GET_INFO_MEMBER(get_tile_info); }; extern const device_type K051316; -#define MCFG_K051316_ADD(_tag, _interface) \ - MCFG_DEVICE_ADD(_tag, K051316, 0) \ - MCFG_DEVICE_CONFIG(_interface) - -#define MCFG_K051316_GFXDECODE(_gfxtag) \ - k051316_device::static_set_gfxdecode_tag(*device, "^" _gfxtag); - -#define MCFG_K051316_PALETTE(_palette_tag) \ - k051316_device::static_set_palette_tag(*device, "^" _palette_tag); #endif diff --git a/src/mame/video/overdriv.c b/src/mame/video/overdriv.c index 1947c2f9e32..2aab988874f 100644 --- a/src/mame/video/overdriv.c +++ b/src/mame/video/overdriv.c @@ -26,20 +26,18 @@ void overdriv_sprite_callback( running_machine &machine, int *code, int *color, ***************************************************************************/ -void overdriv_zoom_callback_0( running_machine &machine, int *code, int *color, int *flags ) +K051316_CB_MEMBER(overdriv_state::zoom_callback_1) { - overdriv_state *state = machine.driver_data(); *flags = (*color & 0x40) ? TILE_FLIPX : 0; *code |= ((*color & 0x03) << 8); - *color = state->m_zoom_colorbase[0] + ((*color & 0x3c) >> 2); + *color = m_zoom_colorbase[0] + ((*color & 0x3c) >> 2); } -void overdriv_zoom_callback_1( running_machine &machine, int *code, int *color, int *flags ) +K051316_CB_MEMBER(overdriv_state::zoom_callback_2) { - overdriv_state *state = machine.driver_data(); *flags = (*color & 0x40) ? TILE_FLIPX : 0; *code |= ((*color & 0x03) << 8); - *color = state->m_zoom_colorbase[1] + ((*color & 0x3c) >> 2); + *color = m_zoom_colorbase[1] + ((*color & 0x3c) >> 2); } diff --git a/src/mame/video/rollerg.c b/src/mame/video/rollerg.c index 0cc5a574f4d..d8d562f7f5c 100644 --- a/src/mame/video/rollerg.c +++ b/src/mame/video/rollerg.c @@ -26,16 +26,14 @@ MCFG_K05324X_CB_MEMBER(rollerg_state::sprite_callback) ***************************************************************************/ -void rollerg_zoom_callback( running_machine &machine, int *code, int *color, int *flags ) +K051316_CB_MEMBER(rollerg_state::zoom_callback) { - rollerg_state *state = machine.driver_data(); *flags = TILE_FLIPYX((*color & 0xc0) >> 6); *code |= ((*color & 0x0f) << 8); - *color = state->m_zoom_colorbase + ((*color & 0x30) >> 4); + *color = m_zoom_colorbase + ((*color & 0x30) >> 4); } - /*************************************************************************** Start the video hardware emulation. @@ -49,7 +47,6 @@ void rollerg_state::video_start() } - /*************************************************************************** Display refresh diff --git a/src/mame/video/tail2nos.c b/src/mame/video/tail2nos.c index c827608816a..624ebf2f92f 100644 --- a/src/mame/video/tail2nos.c +++ b/src/mame/video/tail2nos.c @@ -26,7 +26,7 @@ TILE_GET_INFO_MEMBER(tail2nos_state::get_tile_info) ***************************************************************************/ -void tail2nos_zoom_callback( running_machine &machine, int *code, int *color, int *flags ) +K051316_CB_MEMBER(tail2nos_state::zoom_callback) { *code |= ((*color & 0x03) << 8); *color = 32 + ((*color & 0x38) >> 3); @@ -56,7 +56,7 @@ void tail2nos_state::video_start() m_bg_tilemap->set_transparent_pen(15); - m_zoomdata = (UINT16 *)memregion("gfx3")->base(); + m_zoomdata = (UINT16 *)memregion("k051316")->base(); save_pointer(NAME(m_zoomdata), 0x20000 / 2); machine().save().register_postload(save_prepost_delegate(FUNC(tail2nos_state::tail2nos_postload), this)); @@ -86,8 +86,9 @@ WRITE16_MEMBER(tail2nos_state::tail2nos_zoomdata_w) int oldword = m_zoomdata[offset]; COMBINE_DATA(&m_zoomdata[offset]); + // mark dirty the tilemap inside K051316 device if (oldword != m_zoomdata[offset]) - m_gfxdecode->gfx(2)->mark_dirty(offset / 64); + m_k051316->zoomram_updated(offset / 64); } WRITE16_MEMBER(tail2nos_state::tail2nos_gfxbank_w) diff --git a/src/mame/video/ultraman.c b/src/mame/video/ultraman.c index 6c12fef94e6..ba316e199f8 100644 --- a/src/mame/video/ultraman.c +++ b/src/mame/video/ultraman.c @@ -23,25 +23,22 @@ void ultraman_sprite_callback( running_machine &machine, int *code, int *color, ***************************************************************************/ -void ultraman_zoom_callback_0(running_machine &machine, int *code, int *color, int *flags ) +K051316_CB_MEMBER(ultraman_state::zoom_callback_1) { - ultraman_state *state = machine.driver_data(); - *code |= ((*color & 0x07) << 8) | (state->m_bank0 << 11); - *color = state->m_zoom_colorbase[0] + ((*color & 0xf8) >> 3); + *code |= ((*color & 0x07) << 8) | (m_bank0 << 11); + *color = m_zoom_colorbase[0] + ((*color & 0xf8) >> 3); } -void ultraman_zoom_callback_1(running_machine &machine, int *code, int *color, int *flags ) +K051316_CB_MEMBER(ultraman_state::zoom_callback_2) { - ultraman_state *state = machine.driver_data(); - *code |= ((*color & 0x07) << 8) | (state->m_bank1 << 11); - *color = state->m_zoom_colorbase[1] + ((*color & 0xf8) >> 3); + *code |= ((*color & 0x07) << 8) | (m_bank1 << 11); + *color = m_zoom_colorbase[1] + ((*color & 0xf8) >> 3); } -void ultraman_zoom_callback_2(running_machine &machine, int *code, int *color, int *flags ) +K051316_CB_MEMBER(ultraman_state::zoom_callback_3) { - ultraman_state *state = machine.driver_data(); - *code |= ((*color & 0x07) << 8) | (state->m_bank2 << 11); - *color = state->m_zoom_colorbase[2] + ((*color & 0xf8) >> 3); + *code |= ((*color & 0x07) << 8) | (m_bank2 << 11); + *color = m_zoom_colorbase[2] + ((*color & 0xf8) >> 3); } diff --git a/src/mame/video/wecleman.c b/src/mame/video/wecleman.c index 8bfdb5bae6c..b72cc0900aa 100644 --- a/src/mame/video/wecleman.c +++ b/src/mame/video/wecleman.c @@ -962,18 +962,19 @@ VIDEO_START_MEMBER(wecleman_state,wecleman) // Callbacks for the K051316 -void hotchase_zoom_callback_0(running_machine &machine, int *code,int *color,int *flags) +K051316_CB_MEMBER(wecleman_state::hotchase_zoom_callback_1) { *code |= (*color & 0x03) << 8; *color = (*color & 0xfc) >> 2; } -void hotchase_zoom_callback_1(running_machine &machine, int *code,int *color,int *flags) +K051316_CB_MEMBER(wecleman_state::hotchase_zoom_callback_2) { *code |= (*color & 0x01) << 8; *color = ((*color & 0x3f) << 1) | ((*code & 0x80) >> 7); } + VIDEO_START_MEMBER(wecleman_state,hotchase) { /*