Previous 199869 Revisions Next

r31119 Thursday 26th June, 2014 at 10:34:36 UTC by Fabio Priuli
k053246/k055673: updated to use delegates and inline configs. nw.

as before, these changes are mostly driver-level, so I hope they do
not conflict with anyone else's work. the only relevant change for the
device code is the removal of some redundant variables (from the
interface) and of  alt_k055673_vh_start + k053247_set_sprite_offs,
which have been replaced by the proper machine configs.
[src/mame/drivers]dbz.c gijoe.c konamigx.c moo.c mystwarr.c overdriv.c rungun.c simpsons.c tasman.c vendetta.c xexex.c xmen.c
[src/mame/includes]dbz.h gijoe.h konamigx.h moo.h mystwarr.h overdriv.h rungun.h simpsons.h vendetta.h xexex.h xmen.h
[src/mame/video]dbz.c gijoe.c k053246_k053247_k055673.c k053246_k053247_k055673.h konamigx.c moo.c mystwarr.c overdriv.c rungun.c simpsons.c vendetta.c xexex.c xmen.c

trunk/src/mame/drivers/xmen.c
r31118r31119
308308   m_vblank_irq_mask = 0;
309309}
310310
311static const k053247_interface xmen_k053246_intf =
312{
313   "gfx2", 1,
314   NORMAL_PLANE_ORDER,
315   53, -2,
316   xmen_sprite_callback
317};
318
319311TIMER_DEVICE_CALLBACK_MEMBER(xmen_state::xmen_scanline)
320312{
321313   int scanline = param;
r31118r31119
361353   MCFG_GFX_PALETTE("palette")
362354   MCFG_K052109_CB(xmen_state, tile_callback)
363355
364   MCFG_K053246_ADD("k053246", xmen_k053246_intf)
356   MCFG_DEVICE_ADD("k053246", K053246, 0)
357   MCFG_K053246_CB(xmen_state, sprite_callback)
358   MCFG_K053246_CONFIG("gfx2", 1, NORMAL_PLANE_ORDER, 53, -2)
365359   MCFG_K053246_GFXDECODE("gfxdecode")
366360   MCFG_K053246_PALETTE("palette")
361
367362   MCFG_K053251_ADD("k053251")
368363
369364   /* sound hardware */
r31118r31119
378373   MCFG_SOUND_ROUTE(1, "rspeaker", 1.00)
379374MACHINE_CONFIG_END
380375
381static const k053247_interface xmen6p_k053246_intf =
382{
383   "gfx2", 1,
384   NORMAL_PLANE_ORDER,
385   53, -2,
386   xmen_sprite_callback
387};
388
389376static MACHINE_CONFIG_START( xmen6p, xmen_state )
390377
391378   /* basic machine hardware */
r31118r31119
396383   MCFG_CPU_ADD("audiocpu", Z80, XTAL_16MHz/2)
397384   MCFG_CPU_PROGRAM_MAP(sound_map)
398385
399
400386   MCFG_EEPROM_SERIAL_ER5911_8BIT_ADD("eeprom")
401387
402388   /* video hardware */
r31118r31119
430416   MCFG_GFX_PALETTE("palette")
431417   MCFG_K052109_CB(xmen_state, tile_callback)
432418
433   MCFG_K053246_ADD("k053246", xmen6p_k053246_intf)
419   MCFG_DEVICE_ADD("k053246", K053246, 0)
420   MCFG_K053246_CB(xmen_state, sprite_callback)
421   MCFG_K053246_CONFIG("gfx2", 1, NORMAL_PLANE_ORDER, 53, -2)
434422   MCFG_K053246_SET_SCREEN("screen")
435423   MCFG_K053246_GFXDECODE("gfxdecode")
436424   MCFG_K053246_PALETTE("palette")
425
437426   MCFG_K053251_ADD("k053251")
438427
439428   /* sound hardware */
trunk/src/mame/drivers/tasman.c
r31118r31119
4141   UINT32 screen_update_kongambl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
4242   TIMER_DEVICE_CALLBACK_MEMBER(kongambl_vblank);
4343   K056832_CB_MEMBER(tile_callback);
44   K053246_CB_MEMBER(sprite_callback);
4445};
4546
4647
r31118r31119
534535   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, cs_write)
535536INPUT_PORTS_END
536537
537static void kongambl_sprite_callback( running_machine &machine, int *code, int *color, int *priority_mask )
538
539K053246_CB_MEMBER(kongambl_state::sprite_callback)
538540{
539541}
540542
541
542543K056832_CB_MEMBER(kongambl_state::tile_callback)
543544{
544545}
545546
546547
547
548548static const gfx_layout charlayout8_tasman =
549549{
550550   8,8,
r31118r31119
561561GFXDECODE_END
562562
563563
564static const k053247_interface k053247_intf =
565{
566   "gfx2", 1,
567   TASMAN_PLANE_ORDER,
568   -48+1, 23,
569   kongambl_sprite_callback
570};
571
572564TIMER_DEVICE_CALLBACK_MEMBER(kongambl_state::kongambl_vblank)
573565{
574566   int scanline = param;
r31118r31119
603595
604596   MCFG_VIDEO_START_OVERRIDE(kongambl_state,kongambl)
605597
606   MCFG_K053246_ADD("k053246", k053247_intf)
598   MCFG_DEVICE_ADD("k053246", K053246, 0)
599   MCFG_K053246_CB(kongambl_state, sprite_callback)
600   MCFG_K053246_CONFIG("gfx2", 1, TASMAN_PLANE_ORDER, -48+1, 23)
607601   MCFG_K053246_GFXDECODE("gfxdecode")
608602   MCFG_K053246_PALETTE("palette")
603
609604   MCFG_K055555_ADD("k055555")
610   MCFG_K055673_ADD_NOINTF("k055673")
605
606   MCFG_DEVICE_ADD("k055673", K055673, 0)
607   // FIXME: for the moment copy the same cb & config as k053246, not being sure which chips has access to the gfx2 roms
608   MCFG_K055673_CB(kongambl_state, sprite_callback)
609   MCFG_K055673_CONFIG("gfx2", 1, K055673_LAYOUT_GX, -48+1, -23)
611610   MCFG_K055673_GFXDECODE("gfxdecode")
612611   MCFG_K055673_PALETTE("palette")
613612
trunk/src/mame/drivers/dbz.c
r31118r31119
289289
290290/**********************************************************************************/
291291
292static const k053247_interface dbz_k053246_intf =
293{
294   "gfx2", 3,
295   NORMAL_PLANE_ORDER,
296   -52, 16,
297   dbz_sprite_callback
298};
299
300292WRITE_LINE_MEMBER(dbz_state::dbz_irq2_ack_w)
301293{
302294   m_maincpu->set_input_line(M68K_IRQ_2, CLEAR_LINE);
r31118r31119
356348   MCFG_K056832_GFXDECODE("gfxdecode")
357349   MCFG_K056832_PALETTE("palette")
358350
359   MCFG_K053246_ADD("k053246", dbz_k053246_intf)
351   MCFG_DEVICE_ADD("k053246", K053246, 0)
352   MCFG_K053246_CB(dbz_state, sprite_callback)
353   MCFG_K053246_CONFIG("gfx2", 3, NORMAL_PLANE_ORDER, -87, 32)   // or -52, 16?
360354   MCFG_K053246_GFXDECODE("gfxdecode")
361355   MCFG_K053246_PALETTE("palette")
362356
trunk/src/mame/drivers/gijoe.c
r31118r31119
295295   NULL,
296296};
297297
298static const k053247_interface gijoe_k053247_intf =
299{
300   "gfx2", 1,
301   NORMAL_PLANE_ORDER,
302   -37, 20,
303   gijoe_sprite_callback
304};
305
306298void gijoe_state::machine_start()
307299{
308300   m_dmadelay_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gijoe_state::dmaend_callback),this));
r31118r31119
349341   MCFG_K056832_GFXDECODE("gfxdecode")
350342   MCFG_K056832_PALETTE("palette")
351343
352   MCFG_K053246_ADD("k053246", gijoe_k053247_intf)
344   MCFG_DEVICE_ADD("k053246", K053246, 0)
345   MCFG_K053246_CB(gijoe_state, sprite_callback)
346   MCFG_K053246_CONFIG("gfx2", 1, NORMAL_PLANE_ORDER, -37, 20)
353347   MCFG_K053246_GFXDECODE("gfxdecode")
354348   MCFG_K053246_PALETTE("palette")
349
355350   MCFG_K053251_ADD("k053251")
356351
357352   /* sound hardware */
trunk/src/mame/drivers/simpsons.c
r31118r31119
313313      device.execute().set_input_line(KONAMI_IRQ_LINE, HOLD_LINE);
314314}
315315
316static const k053247_interface simpsons_k053246_intf =
317{
318   "gfx2", 1,
319   NORMAL_PLANE_ORDER,
320   53, 23,
321   simpsons_sprite_callback
322};
323
324316static MACHINE_CONFIG_START( simpsons, simpsons_state )
325317
326318   /* basic machine hardware */
r31118r31119
330322   MCFG_KONAMICPU_LINE_CB(WRITE8(simpsons_state, banking_callback))
331323
332324   MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz) /* verified on pcb */
333   MCFG_CPU_PROGRAM_MAP(z80_map)
334                        /* NMIs are generated by the 053260 */
325   MCFG_CPU_PROGRAM_MAP(z80_map)   /* NMIs are generated by the 053260 */
335326
336327   MCFG_DEVICE_ADD("bank0000", ADDRESS_MAP_BANK, 0)
337328   MCFG_DEVICE_PROGRAM_MAP(bank0000_map)
r31118r31119
370361   MCFG_GFX_PALETTE("palette")
371362   MCFG_K052109_CB(simpsons_state, tile_callback)
372363
373   MCFG_K053246_ADD("k053246", simpsons_k053246_intf)
364   MCFG_DEVICE_ADD("k053246", K053246, 0)
365   MCFG_K053246_CB(simpsons_state, sprite_callback)
366   MCFG_K053246_CONFIG("gfx2", 1, NORMAL_PLANE_ORDER, 53, 23)
374367   MCFG_K053246_GFXDECODE("gfxdecode")
375368   MCFG_K053246_PALETTE("palette")
369
376370   MCFG_K053251_ADD("k053251")
377371
378372   /* sound hardware */
trunk/src/mame/drivers/xexex.c
r31118r31119
454454   ym_set_mixing
455455};
456456
457static const k053247_interface xexex_k053246_intf =
458{
459   "gfx2", 1,
460   NORMAL_PLANE_ORDER,
461   -48, 32,
462   xexex_sprite_callback
463};
464
465457void xexex_state::xexex_postload()
466458{
467459   parse_control2();
r31118r31119
542534   MCFG_K056832_GFXDECODE("gfxdecode")
543535   MCFG_K056832_PALETTE("palette")
544536
545   MCFG_K053246_ADD("k053246", xexex_k053246_intf)
537   MCFG_DEVICE_ADD("k053246", K053246, 0)
538   MCFG_K053246_CB(xexex_state, sprite_callback)
539   MCFG_K053246_CONFIG("gfx2", 1, NORMAL_PLANE_ORDER, -48, 32)
546540   MCFG_K053246_GFXDECODE("gfxdecode")
547541   MCFG_K053246_PALETTE("palette")
542
548543   MCFG_K053250_ADD("k053250", "palette", "screen", -5, -16)
544
549545   MCFG_K053251_ADD("k053251")
550546
551547   MCFG_DEVICE_ADD("k053252", K053252, XTAL_32MHz/4)
trunk/src/mame/drivers/overdriv.c
r31118r31119
260260INPUT_PORTS_END
261261
262262
263static const k053247_interface overdriv_k053246_intf =
264{
265   "gfx1", 0,
266   NORMAL_PLANE_ORDER,
267   77, 22,
268   overdriv_sprite_callback
269};
270
271263void overdriv_state::machine_start()
272264{
273265   save_item(NAME(m_cpuB_ctrl));
r31118r31119
328320
329321   MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty)
330322
331   MCFG_K053246_ADD("k053246", overdriv_k053246_intf)
323   MCFG_DEVICE_ADD("k053246", K053246, 0)
324   MCFG_K053246_CB(overdriv_state, sprite_callback)
325   MCFG_K053246_CONFIG("gfx1", 0, NORMAL_PLANE_ORDER, 77, 22)
332326   MCFG_K053246_GFXDECODE("gfxdecode")
333327   MCFG_K053246_PALETTE("palette")
334328
trunk/src/mame/drivers/mystwarr.c
r31118r31119
10161016
10171017   MCFG_K055555_ADD("k055555")
10181018
1019   MCFG_K055673_ADD_NOINTF("k055673")
1019   MCFG_DEVICE_ADD("k055673", K055673, 0)
1020   MCFG_K055673_CB(mystwarr_state, mystwarr_sprite_callback)
1021   MCFG_K055673_CONFIG("gfx2", 0, 0, -48, -24)
10201022   MCFG_K055673_GFXDECODE("gfxdecode")
10211023   MCFG_K055673_PALETTE("palette")
10221024
r31118r31119
10241026   MCFG_K054338_ALPHAINV(1)
10251027   MCFG_K054338_MIXER("k055555")
10261028   
1027   MCFG_VIDEO_START_OVERRIDE(mystwarr_state,mystwarr)
1029   MCFG_VIDEO_START_OVERRIDE(mystwarr_state, mystwarr)
10281030
10291031   /* sound hardware */
10301032   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
r31118r31119
10531055   MCFG_TIMER_DRIVER_CALLBACK(mystwarr_state, metamrph_interrupt)
10541056
10551057   /* video hardware */
1056   MCFG_VIDEO_START_OVERRIDE(mystwarr_state,viostorm)
1058   MCFG_VIDEO_START_OVERRIDE(mystwarr_state, viostorm)
10571059   MCFG_SCREEN_MODIFY("screen")
10581060   MCFG_SCREEN_UPDATE_DRIVER(mystwarr_state, screen_update_metamrph)
10591061
r31118r31119
10641066
10651067   MCFG_DEVICE_MODIFY("k056832")
10661068   MCFG_K056832_CB(mystwarr_state, game4bpp_tile_callback)
1069
1070   MCFG_DEVICE_MODIFY("k055673")
1071   MCFG_K055673_CB(mystwarr_state, metamrph_sprite_callback)
1072   MCFG_K055673_CONFIG("gfx2", 0, 1, -62, -23)
10671073MACHINE_CONFIG_END
10681074
10691075static MACHINE_CONFIG_DERIVED( metamrph, mystwarr )
r31118r31119
10821088   MCFG_K053250_ADD("k053250_1", "palette", "screen", -7, 0)
10831089
10841090   /* video hardware */
1085   MCFG_VIDEO_START_OVERRIDE(mystwarr_state,metamrph)
1091   MCFG_VIDEO_START_OVERRIDE(mystwarr_state, metamrph)
10861092   MCFG_SCREEN_MODIFY("screen")
10871093   MCFG_SCREEN_UPDATE_DRIVER(mystwarr_state, screen_update_metamrph)
10881094
r31118r31119
10931099
10941100   MCFG_DEVICE_MODIFY("k056832")
10951101   MCFG_K056832_CB(mystwarr_state, game4bpp_tile_callback)
1102
1103   MCFG_DEVICE_MODIFY("k055673")
1104   MCFG_K055673_CB(mystwarr_state, metamrph_sprite_callback)
1105   MCFG_K055673_CONFIG("gfx2", 0, 1, -51, -24)
10961106MACHINE_CONFIG_END
10971107
10981108static MACHINE_CONFIG_DERIVED( dadandrn, mystwarr )
r31118r31119
11111121   MCFG_GFXDECODE_MODIFY("gfxdecode", dadandrn)
11121122
11131123   /* video hardware */
1114   MCFG_VIDEO_START_OVERRIDE(mystwarr_state,dadandrn)
1124   MCFG_VIDEO_START_OVERRIDE(mystwarr_state, dadandrn)
11151125   MCFG_SCREEN_MODIFY("screen")
11161126   MCFG_SCREEN_UPDATE_DRIVER(mystwarr_state, screen_update_dadandrn)
11171127
r31118r31119
11221132
11231133   MCFG_DEVICE_MODIFY("k056832")
11241134   MCFG_K056832_CB(mystwarr_state, game5bpp_tile_callback)
1135
1136   MCFG_DEVICE_MODIFY("k055673")
1137   MCFG_K055673_CB(mystwarr_state, gaiapols_sprite_callback)
1138   MCFG_K055673_CONFIG("gfx2", 0, 0, -42, -22)
11251139MACHINE_CONFIG_END
11261140
11271141static MACHINE_CONFIG_DERIVED( gaiapols, mystwarr )
r31118r31119
11421156   MCFG_GFXDECODE_MODIFY("gfxdecode", gaiapols)
11431157
11441158   /* video hardware */
1145   MCFG_VIDEO_START_OVERRIDE(mystwarr_state,gaiapols)
1159   MCFG_VIDEO_START_OVERRIDE(mystwarr_state, gaiapols)
11461160   MCFG_SCREEN_MODIFY("screen")
11471161   MCFG_SCREEN_UPDATE_DRIVER(mystwarr_state, screen_update_dadandrn)
11481162
r31118r31119
11541168
11551169   MCFG_DEVICE_MODIFY("k056832")
11561170   MCFG_K056832_CB(mystwarr_state, game4bpp_tile_callback)
1171
1172   MCFG_DEVICE_MODIFY("k055673")
1173   MCFG_K055673_CB(mystwarr_state, gaiapols_sprite_callback)
1174   MCFG_K055673_CONFIG("gfx2", 0, 1, -61, -22) // stage2 brick walls
11571175MACHINE_CONFIG_END
11581176
11591177static MACHINE_CONFIG_DERIVED( martchmp, mystwarr )
r31118r31119
11741192   MCFG_PALETTE_ENABLE_SHADOWS()
11751193   MCFG_PALETTE_ENABLE_HILIGHTS()
11761194
1177   MCFG_VIDEO_START_OVERRIDE(mystwarr_state,martchmp)
1195   MCFG_VIDEO_START_OVERRIDE(mystwarr_state, martchmp)
11781196
11791197   MCFG_SCREEN_MODIFY("screen")
11801198   MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
r31118r31119
11851203
11861204   MCFG_DEVICE_MODIFY("k056832")
11871205   MCFG_K056832_CB(mystwarr_state, game5bpp_tile_callback)
1206
1207   MCFG_DEVICE_MODIFY("k055673")
1208   MCFG_K055673_CB(mystwarr_state, martchmp_sprite_callback)
1209   MCFG_K055673_CONFIG("gfx2", 0, 0, -58, -23)
11881210MACHINE_CONFIG_END
11891211
11901212/**********************************************************************************/
trunk/src/mame/drivers/konamigx.c
r31118r31119
16471647   MCFG_K054338_SET_SCREEN("screen")
16481648   MCFG_K054338_ALPHAINV(1)
16491649
1650   MCFG_K055673_ADD_NOINTF("k055673")
1650   MCFG_DEVICE_ADD("k055673", K055673, 0)
1651   MCFG_K055673_CB(konamigx_state, type2_sprite_callback)
1652   MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_GX, -26, -23)
16511653   MCFG_K055673_SET_SCREEN("screen")
16521654   MCFG_K055673_GFXDECODE("gfxdecode")
16531655   MCFG_K055673_PALETTE("palette")
16541656
1655   MCFG_VIDEO_START_OVERRIDE(konamigx_state,konamigx_5bpp)
1657   MCFG_VIDEO_START_OVERRIDE(konamigx_state, konamigx_5bpp)
16561658
16571659   /* sound hardware */
16581660   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
r31118r31119
16781680   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
16791681MACHINE_CONFIG_END
16801682
1683static MACHINE_CONFIG_DERIVED( gokuparo, konamigx )
1684   MCFG_DEVICE_MODIFY("k055673")
1685   MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_GX, -46, -23)
1686MACHINE_CONFIG_END
1687
16811688static MACHINE_CONFIG_DERIVED( sexyparo, konamigx )
16821689   MCFG_DEVICE_MODIFY("k056832")
16831690   MCFG_K056832_CB(konamigx_state, alpha_tile_callback)
1691
1692   MCFG_DEVICE_MODIFY("k055673")
1693   MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_GX, -42, -23)
16841694MACHINE_CONFIG_END
16851695
16861696static MACHINE_CONFIG_DERIVED( tbyahhoo, konamigx )
r31118r31119
16911701static MACHINE_CONFIG_DERIVED( dragoonj, konamigx )
16921702   MCFG_SCREEN_MODIFY("screen")
16931703   MCFG_SCREEN_VISIBLE_AREA(40, 40+384-1, 16, 16+224-1)
1694   MCFG_VIDEO_START_OVERRIDE(konamigx_state,dragoonj)
1704   MCFG_VIDEO_START_OVERRIDE(konamigx_state, dragoonj)
16951705
16961706   MCFG_DEVICE_MODIFY("k056832")
16971707   MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_5, 1, 0, "none")
1708
1709   MCFG_DEVICE_MODIFY("k055673")
1710   MCFG_K055673_CB(konamigx_state, dragoonj_sprite_callback)
1711   MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_RNG, -53, -23)
16981712MACHINE_CONFIG_END
16991713
17001714static MACHINE_CONFIG_DERIVED( le2, konamigx )
1701   MCFG_VIDEO_START_OVERRIDE(konamigx_state,le2)
1715   MCFG_VIDEO_START_OVERRIDE(konamigx_state, le2)
17021716
17031717   MCFG_DEVICE_MODIFY("k056832")
17041718   MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_8, 1, 0, "none")
1719
1720   MCFG_DEVICE_MODIFY("k055673")
1721   MCFG_K055673_CB(konamigx_state, le2_sprite_callback)
1722   MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_LE2, -46, -23)
17051723MACHINE_CONFIG_END
17061724
17071725static MACHINE_CONFIG_DERIVED( konamigx_6bpp, konamigx )
1708   MCFG_VIDEO_START_OVERRIDE(konamigx_state,konamigx_6bpp)
1726   MCFG_VIDEO_START_OVERRIDE(konamigx_state, konamigx_6bpp)
17091727
17101728   MCFG_DEVICE_MODIFY("k056832")
17111729   MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_6, 0, 0, "none")
1730
1731   MCFG_DEVICE_MODIFY("k055673")
1732   MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_GX, -46, -23)
17121733MACHINE_CONFIG_END
17131734
1714static MACHINE_CONFIG_DERIVED( konamigx_6bpp_2, konamigx )
1715   MCFG_VIDEO_START_OVERRIDE(konamigx_state,konamigx_6bpp_2)
1716
1735static MACHINE_CONFIG_DERIVED( salmndr2, konamigx )
17171736   MCFG_DEVICE_MODIFY("k056832")
17181737   MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_6, 1, 0, "none")
1738
1739   MCFG_DEVICE_MODIFY("k055673")
1740   MCFG_K055673_CB(konamigx_state, salmndr2_sprite_callback)
1741   MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_GX6, -48, -23)
17191742MACHINE_CONFIG_END
17201743
17211744static MACHINE_CONFIG_DERIVED( opengolf, konamigx )
r31118r31119
17231746   MCFG_SCREEN_RAW_PARAMS(8000000, 384+24+64+40, 0, 383, 224+16+8+16, 0, 223)
17241747   MCFG_SCREEN_VISIBLE_AREA(40, 40+384-1, 16, 16+224-1)
17251748   MCFG_GFXDECODE_MODIFY("gfxdecode", opengolf)
1726   MCFG_VIDEO_START_OVERRIDE(konamigx_state,opengolf)
1749   MCFG_VIDEO_START_OVERRIDE(konamigx_state, opengolf)
17271750
1751   MCFG_DEVICE_MODIFY("k055673")
1752   MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_GX6, -53, -23)
1753
17281754   MCFG_CPU_MODIFY("maincpu")
17291755   MCFG_CPU_PROGRAM_MAP(gx_type1_map)
17301756
r31118r31119
17371763   MCFG_SCREEN_RAW_PARAMS(8000000, 384+24+64+40, 0, 383, 224+16+8+16, 0, 223)
17381764   MCFG_SCREEN_VISIBLE_AREA(32, 32+384-1, 16, 16+224-1)
17391765   MCFG_GFXDECODE_MODIFY("gfxdecode", racinfrc)
1740   MCFG_VIDEO_START_OVERRIDE(konamigx_state,racinfrc)
1766   MCFG_VIDEO_START_OVERRIDE(konamigx_state, racinfrc)
17411767
17421768   MCFG_DEVICE_MODIFY("k056832")
17431769   MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_6, 0, 0, "none")
17441770
1771   MCFG_DEVICE_MODIFY("k055673")
1772   MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_GX, -53, -23)
1773
17451774   MCFG_CPU_MODIFY("maincpu")
17461775   MCFG_CPU_PROGRAM_MAP(gx_type1_map)
17471776
r31118r31119
17571786
17581787   MCFG_DEFAULT_LAYOUT(layout_dualhsxs)
17591788
1760   MCFG_VIDEO_START_OVERRIDE(konamigx_state,konamigx_type3)
1789   MCFG_VIDEO_START_OVERRIDE(konamigx_state, konamigx_type3)
17611790
17621791   MCFG_DEVICE_MODIFY("k056832")
17631792   MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_6, 0, 0, "none")
17641793
1794   MCFG_DEVICE_MODIFY("k055673")
1795   MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_GX6, -132, -23)
1796
17651797   MCFG_PALETTE_MODIFY("palette")
17661798   MCFG_PALETTE_ENTRIES(16384)
17671799   MCFG_PALETTE_ENABLE_SHADOWS()
r31118r31119
18101842   MCFG_PALETTE_ENABLE_HILIGHTS()
18111843
18121844   MCFG_GFXDECODE_MODIFY("gfxdecode", type4)
1813   MCFG_VIDEO_START_OVERRIDE(konamigx_state,konamigx_type4)
1845   MCFG_VIDEO_START_OVERRIDE(konamigx_state, konamigx_type4)
18141846
18151847   MCFG_DEVICE_MODIFY("k056832")
18161848   MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_8, 0, 0, "none")
1849
1850   MCFG_DEVICE_MODIFY("k055673")
1851   MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_GX6, -79, -24) // -23 looks better in intro
18171852MACHINE_CONFIG_END
18181853
18191854static MACHINE_CONFIG_DERIVED( gxtype4_vsn, gxtype4 )
r31118r31119
18271862   MCFG_SCREEN_SIZE(128*8, 32*8)
18281863   MCFG_SCREEN_VISIBLE_AREA(0, 576-1, 16, 32*8-1-16)
18291864
1830   MCFG_VIDEO_START_OVERRIDE(konamigx_state,konamigx_type4_vsn)
1865   MCFG_VIDEO_START_OVERRIDE(konamigx_state, konamigx_type4_vsn)
18311866
18321867   MCFG_DEVICE_MODIFY("k056832")
18331868   MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_8, 0, 2, "none")   // set djmain_hack to 2 to kill layer association or half the tilemaps vanish on screen 0
1869
1870   MCFG_DEVICE_MODIFY("k055673")
1871   MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_GX6, -132, -23)
18341872MACHINE_CONFIG_END
18351873
18361874static MACHINE_CONFIG_DERIVED( gxtype4sd2, gxtype4 )
1837   MCFG_VIDEO_START_OVERRIDE(konamigx_state,konamigx_type4_sd2)
1875   MCFG_VIDEO_START_OVERRIDE(konamigx_state, konamigx_type4_sd2)
1876
1877   MCFG_DEVICE_MODIFY("k055673")
1878   MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_GX6, -81, -23)
18381879MACHINE_CONFIG_END
18391880
1840
1841
18421881static MACHINE_CONFIG_DERIVED( winspike, konamigx )
18431882   MCFG_SCREEN_MODIFY("screen")
18441883   MCFG_SCREEN_VISIBLE_AREA(38, 38+384-1, 16, 16+224-1)
1845   MCFG_VIDEO_START_OVERRIDE(konamigx_state,winspike)
18461884
18471885   MCFG_DEVICE_MODIFY("k056832")
18481886   MCFG_K056832_CB(konamigx_state, alpha_tile_callback)
18491887   MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_8, 0, 2, "none")
1888
1889   MCFG_DEVICE_MODIFY("k055673")
1890   MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_LE2, -53, -23)
18501891MACHINE_CONFIG_END
18511892
18521893
r31118r31119
38013842GAME( 1994, le2u,     le2,      le2,      le2_flip, konamigx_state, konamigx, ORIENTATION_FLIP_Y, "Konami", "Lethal Enforcers II: Gun Fighters (ver UAA)", GAME_IMPERFECT_GRAPHICS )
38023843GAME( 1994, le2j,     le2,      le2,      le2_flip, konamigx_state, konamigx, ORIENTATION_FLIP_Y, "Konami", "Lethal Enforcers II: The Western (ver JAA)", GAME_IMPERFECT_GRAPHICS )
38033844
3804GAME( 1994, fantjour, konamigx, konamigx, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Fantastic Journey (ver EAA)", GAME_IMPERFECT_GRAPHICS )
3805GAME( 1994, fantjoura,fantjour, konamigx, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Fantastic Journey (ver AAA)", GAME_IMPERFECT_GRAPHICS )
3806GAME( 1994, gokuparo, fantjour, konamigx, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Gokujyou Parodius (ver JAD)", GAME_IMPERFECT_GRAPHICS )
3845GAME( 1994, fantjour, konamigx, gokuparo, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Fantastic Journey (ver EAA)", GAME_IMPERFECT_GRAPHICS )
3846GAME( 1994, fantjoura,fantjour, gokuparo, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Fantastic Journey (ver AAA)", GAME_IMPERFECT_GRAPHICS )
3847GAME( 1994, gokuparo, fantjour, gokuparo, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Gokujyou Parodius (ver JAD)", GAME_IMPERFECT_GRAPHICS )
38073848
3808GAME( 1994, crzcross, konamigx, konamigx, puzldama, konamigx_state, konamigx, ROT0, "Konami", "Crazy Cross (ver EAA)", GAME_IMPERFECT_GRAPHICS )
3809GAME( 1994, puzldama, crzcross, konamigx, puzldama, konamigx_state, konamigx, ROT0, "Konami", "Taisen Puzzle-dama (ver JAA)", GAME_IMPERFECT_GRAPHICS )
3849GAME( 1994, crzcross, konamigx, gokuparo, puzldama, konamigx_state, konamigx, ROT0, "Konami", "Crazy Cross (ver EAA)", GAME_IMPERFECT_GRAPHICS )
3850GAME( 1994, puzldama, crzcross, gokuparo, puzldama, konamigx_state, konamigx, ROT0, "Konami", "Taisen Puzzle-dama (ver JAA)", GAME_IMPERFECT_GRAPHICS )
38103851
38113852GAME( 1995, tbyahhoo, konamigx, tbyahhoo, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Twin Bee Yahhoo! (ver JAA)", GAME_IMPERFECT_GRAPHICS )
38123853
r31118r31119
38233864GAME( 1996, tokkae,   konamigx, konamigx_6bpp, puzldama, konamigx_state, konamigx, ROT0, "Konami", "Taisen Tokkae-dama (ver JAA)", GAME_IMPERFECT_GRAPHICS )
38243865
38253866/* protection controls player ship direction in attract mode - doesn't impact playability */
3826GAME( 1996, salmndr2, konamigx, konamigx_6bpp_2, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Salamander 2 (ver JAA)", GAME_IMPERFECT_GRAPHICS|GAME_UNEMULATED_PROTECTION )
3827GAME( 1996, salmndr2a,salmndr2, konamigx_6bpp_2, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Salamander 2 (ver AAB)", GAME_IMPERFECT_GRAPHICS|GAME_UNEMULATED_PROTECTION )
3867GAME( 1996, salmndr2, konamigx, salmndr2, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Salamander 2 (ver JAA)", GAME_IMPERFECT_GRAPHICS|GAME_UNEMULATED_PROTECTION )
3868GAME( 1996, salmndr2a,salmndr2, salmndr2, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Salamander 2 (ver AAB)", GAME_IMPERFECT_GRAPHICS|GAME_UNEMULATED_PROTECTION )
38283869
38293870/* bad sprite colours, part of tilemap gets blanked out when a game starts (might be more protection) */
38303871GAME( 1997, winspike, konamigx, winspike, konamigx, konamigx_state, konamigx, ROT0, "Konami", "Winning Spike (ver EAA)", GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_GRAPHICS )
trunk/src/mame/drivers/vendetta.c
r31118r31119
396396      device.execute().set_input_line(KONAMI_IRQ_LINE, HOLD_LINE);
397397}
398398
399static const k053247_interface vendetta_k053246_intf =
400{
401   "gfx2", 1,
402   NORMAL_PLANE_ORDER,
403   53, 6,
404   vendetta_sprite_callback
405};
406
407static const k053247_interface esckids_k053246_intf =
408{
409   "gfx2", 1,
410   NORMAL_PLANE_ORDER,
411   101, 6,
412   vendetta_sprite_callback
413};
414
415
416399void vendetta_state::machine_start()
417400{
418401   UINT8 *ROM = memregion("maincpu")->base();
r31118r31119
486469   MCFG_GFX_PALETTE("palette")
487470   MCFG_K052109_CB(vendetta_state, vendetta_tile_callback)
488471
489   MCFG_K053246_ADD("k053246", vendetta_k053246_intf)
472   MCFG_DEVICE_ADD("k053246", K053246, 0)
473   MCFG_K053246_CB(vendetta_state, sprite_callback)
474   MCFG_K053246_CONFIG("gfx2", 1, NORMAL_PLANE_ORDER, 53, 6)
490475   MCFG_K053246_GFXDECODE("gfxdecode")
491476   MCFG_K053246_PALETTE("palette")
477
492478   MCFG_K053251_ADD("k053251")
479
493480   MCFG_K054000_ADD("k054000")
494481
495482   /* sound hardware */
r31118r31119
522509   MCFG_GFX_PALETTE("palette")
523510   MCFG_K052109_CB(vendetta_state, esckids_tile_callback)
524511
525   MCFG_DEVICE_REMOVE("k053246")
526   MCFG_K053246_ADD("k053246", esckids_k053246_intf)
527   MCFG_K053246_GFXDECODE("gfxdecode")
528   MCFG_K053246_PALETTE("palette")
512   MCFG_DEVICE_MODIFY("k053246")
513   MCFG_K053246_CONFIG("gfx2", 1, NORMAL_PLANE_ORDER, 101, 6)
514
529515   MCFG_DEVICE_ADD("k053252", K053252, 6000000)
530516   MCFG_K053252_OFFSETS(12*8, 1*8)
531517MACHINE_CONFIG_END
trunk/src/mame/drivers/rungun.c
r31118r31119
330330};
331331
332332
333static const k053247_interface rng_k055673_intf =
334{
335   "gfx2", 1,
336   K055673_LAYOUT_RNG,
337   -8, 15,
338   rng_sprite_callback
339};
340
341333void rungun_state::machine_start()
342334{
343335   UINT8 *ROM = memregion("soundcpu")->base();
r31118r31119
395387   MCFG_DEVICE_ADD("k053936", K053936, 0)
396388   MCFG_K053936_OFFSETS(34, 9)
397389
398   MCFG_K055673_ADD("k055673", rng_k055673_intf)
390   MCFG_DEVICE_ADD("k055673", K055673, 0)
391   MCFG_K055673_CB(rungun_state, sprite_callback)
392   MCFG_K055673_CONFIG("gfx2", 1, K055673_LAYOUT_RNG, -8, 15)
399393   MCFG_K055673_GFXDECODE("gfxdecode")
400394   MCFG_K055673_PALETTE("palette")
401395
trunk/src/mame/drivers/moo.c
r31118r31119
514514   m_sprite_colorbase = 0;
515515}
516516
517static const k053247_interface moo_k053247_intf =
518{
519   "gfx2", 1,
520   NORMAL_PLANE_ORDER,
521   -48+1, 23,
522   moo_sprite_callback
523};
524
525static const k053247_interface bucky_k053247_intf =
526{
527   "gfx2", 1,
528   NORMAL_PLANE_ORDER,
529   -48, 23,
530   moo_sprite_callback
531};
532
533517static k054539_interface k054539_config;
534518
535519static MACHINE_CONFIG_START( moo, moo_state )
r31118r31119
567551   MCFG_VIDEO_START_OVERRIDE(moo_state,moo)
568552
569553   MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty)
570   MCFG_K053246_ADD("k053246", moo_k053247_intf)
554
555   MCFG_DEVICE_ADD("k053246", K053246, 0)
556   MCFG_K053246_CB(moo_state, sprite_callback)
557   MCFG_K053246_CONFIG("gfx2", 1, NORMAL_PLANE_ORDER, -48+1, 23)
571558   MCFG_K053246_GFXDECODE("gfxdecode")
572559   MCFG_K053246_PALETTE("palette")
573560
r31118r31119
622609   MCFG_VIDEO_START_OVERRIDE(moo_state,moo)
623610
624611   MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty)
625   MCFG_K053246_ADD("k053246", moo_k053247_intf)
612
613   MCFG_DEVICE_ADD("k053246", K053246, 0)
614   MCFG_K053246_CB(moo_state, sprite_callback)
615   MCFG_K053246_CONFIG("gfx2", 1, NORMAL_PLANE_ORDER, -48+1, 23)
626616   MCFG_K053246_GFXDECODE("gfxdecode")
627617   MCFG_K053246_PALETTE("palette")
628618
r31118r31119
651641
652642   MCFG_K054000_ADD("k054000")
653643
654   MCFG_DEVICE_REMOVE("k053246")
655   MCFG_K053246_ADD("k053246", bucky_k053247_intf)     // diff x offset
656   MCFG_K053246_GFXDECODE("gfxdecode")
657   MCFG_K053246_PALETTE("palette")
644   MCFG_DEVICE_MODIFY("k053246")
645   MCFG_K053246_CONFIG("gfx2", 1, NORMAL_PLANE_ORDER, -48, 23)
646
658647   /* video hardware */
659648   MCFG_PALETTE_MODIFY("palette")
660649   MCFG_PALETTE_ENTRIES(4096)
trunk/src/mame/includes/xexex.h
r31118r31119
9595   void xexex_objdma( int limiter );
9696   void parse_control2(  );
9797   K056832_CB_MEMBER(tile_callback);
98   K053246_CB_MEMBER(sprite_callback);
9899};
99
100/*----------- defined in video/xexex.c -----------*/
101
102extern void xexex_sprite_callback(running_machine &machine, int *code, int *color, int *priority_mask);
trunk/src/mame/includes/overdriv.h
r31118r31119
7171   DECLARE_WRITE16_MEMBER( overdriv_k053246_word_w );
7272   K051316_CB_MEMBER(zoom_callback_1);
7373   K051316_CB_MEMBER(zoom_callback_2);
74   K053246_CB_MEMBER(sprite_callback);
7475};
75
76/*----------- defined in video/overdriv.c -----------*/
77extern void overdriv_sprite_callback(running_machine &machine, int *code,int *color,int *priority_mask);
trunk/src/mame/includes/mystwarr.h
r31118r31119
9696   K056832_CB_MEMBER(mystwarr_tile_callback);
9797   K056832_CB_MEMBER(game5bpp_tile_callback);
9898   K056832_CB_MEMBER(game4bpp_tile_callback);
99   K055673_CB_MEMBER(mystwarr_sprite_callback);
100   K055673_CB_MEMBER(metamrph_sprite_callback);
101   K055673_CB_MEMBER(gaiapols_sprite_callback);
102   K055673_CB_MEMBER(martchmp_sprite_callback);
99103};
trunk/src/mame/includes/konamigx.h
r31118r31119
115115   DECLARE_VIDEO_START(dragoonj);
116116   DECLARE_VIDEO_START(le2);
117117   DECLARE_VIDEO_START(konamigx_6bpp);
118   DECLARE_VIDEO_START(konamigx_6bpp_2);
119118   DECLARE_VIDEO_START(opengolf);
120119   DECLARE_VIDEO_START(racinfrc);
121120   DECLARE_VIDEO_START(konamigx_type3);
122121   DECLARE_VIDEO_START(konamigx_type4);
123122   DECLARE_VIDEO_START(konamigx_type4_vsn);
124123   DECLARE_VIDEO_START(konamigx_type4_sd2);
125   DECLARE_VIDEO_START(winspike);
126124   UINT32 screen_update_konamigx(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
127125   UINT32 screen_update_konamigx_left(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
128126   UINT32 screen_update_konamigx_right(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
r31118r31119
135133   ADC083X_INPUT_CB(adc0834_callback);
136134   K056832_CB_MEMBER(type2_tile_callback);
137135   K056832_CB_MEMBER(alpha_tile_callback);
136   K055673_CB_MEMBER(type2_sprite_callback);
137   K055673_CB_MEMBER(dragoonj_sprite_callback);
138   K055673_CB_MEMBER(salmndr2_sprite_callback);
139   K055673_CB_MEMBER(le2_sprite_callback);
138140
139   void _gxcommoninitnosprites(running_machine &machine);
140   void _gxcommoninit(running_machine &machine);
141   void common_init();
141142   DECLARE_READ32_MEMBER( k_6bpp_rom_long_r );
142143   void konamigx_mixer     (screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect,tilemap_t *sub1, int sub1flags,tilemap_t *sub2, int sub2flags,int mixerflags, bitmap_ind16 *extra_bitmap, int rushingheroes_hack);
143144   void konamigx_mixer_draw(screen_device &Screen, bitmap_rgb32 &bitmap, const rectangle &cliprect,
trunk/src/mame/includes/rungun.h
r31118r31119
4141
4242   required_device<gfxdecode_device> m_gfxdecode;
4343   required_device<palette_device> m_palette;
44//  UINT16 *    m_paletteram;    // currently this uses generic palette handling
4544
4645   /* video-related */
4746   tilemap_t   *m_ttl_tilemap;
r31118r31119
6968   TILE_GET_INFO_MEMBER(ttl_get_tile_info);
7069   TILE_GET_INFO_MEMBER(get_rng_936_tile_info);
7170   DECLARE_WRITE_LINE_MEMBER(k054539_nmi_gen);
71   K055673_CB_MEMBER(sprite_callback);
7272
7373   virtual void machine_start();
7474   virtual void machine_reset();
r31118r31119
7777   INTERRUPT_GEN_MEMBER(rng_interrupt);
7878   INTERRUPT_GEN_MEMBER(audio_interrupt);
7979};
80/*----------- defined in video/rungun.c -----------*/
81
82extern void rng_sprite_callback(running_machine &machine, int *code, int *color, int *priority_mask);
trunk/src/mame/includes/vendetta.h
r31118r31119
7272   K052109_CB_MEMBER(vendetta_tile_callback);
7373   K052109_CB_MEMBER(esckids_tile_callback);
7474   DECLARE_WRITE8_MEMBER(banking_callback);
75   K053246_CB_MEMBER(sprite_callback);
7576
7677protected:
7778   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
7879};
79
80/*----------- defined in video/vendetta.c -----------*/
81
82extern void vendetta_sprite_callback(running_machine &machine, int *code,int *color,int *priority_mask);
trunk/src/mame/includes/moo.h
r31118r31119
8383   TIMER_CALLBACK_MEMBER(dmaend_callback);
8484   void moo_objdma();
8585   K056832_CB_MEMBER(tile_callback);
86   K053246_CB_MEMBER(sprite_callback);
8687};
87
88/*----------- defined in video/moo.c -----------*/
89extern void moo_sprite_callback(running_machine &machine, int *code, int *color, int *priority_mask);
trunk/src/mame/includes/gijoe.h
r31118r31119
6262   TIMER_CALLBACK_MEMBER(dmaend_callback);
6363   void gijoe_objdma();
6464   K056832_CB_MEMBER(tile_callback);
65   K053246_CB_MEMBER(sprite_callback);
6566};
66
67/*----------- defined in video/gijoe.c -----------*/
68extern void gijoe_sprite_callback(running_machine &machine, int *code, int *color, int *priority_mask);
trunk/src/mame/includes/simpsons.h
r31118r31119
6767   void simpsons_objdma();
6868   K052109_CB_MEMBER(tile_callback);
6969   DECLARE_WRITE8_MEMBER(banking_callback);
70   K053246_CB_MEMBER(sprite_callback);
7071
7172protected:
7273   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
7374};
74
75
76/*----------- defined in video/simpsons.c -----------*/
77extern void simpsons_sprite_callback(running_machine &machine, int *code,int *color,int *priority_mask);
trunk/src/mame/includes/dbz.h
r31118r31119
7272   UINT32 screen_update_dbz(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
7373   TIMER_DEVICE_CALLBACK_MEMBER(dbz_scanline);
7474   K056832_CB_MEMBER(tile_callback);
75   K053246_CB_MEMBER(sprite_callback);
7576};
76
77/*----------- defined in video/dbz.c -----------*/
78extern void dbz_sprite_callback(running_machine &machine, int *code, int *color, int *priority_mask);
trunk/src/mame/includes/xmen.h
r31118r31119
6767   TIMER_DEVICE_CALLBACK_MEMBER(xmen_scanline);
6868   void sound_reset_bank();
6969   K052109_CB_MEMBER(tile_callback);
70   K053246_CB_MEMBER(sprite_callback);
7071};
71
72/*----------- defined in video/xmen.c -----------*/
73
74void xmen_sprite_callback(running_machine &machine, int *code,int *color,int *priority_mask);
trunk/src/mame/video/rungun.c
r31118r31119
2525   SET_TILE_INFO_MEMBER(m_ttl_gfx_index, code, attr, 0);
2626}
2727
28void rng_sprite_callback( running_machine &machine, int *code, int *color, int *priority_mask )
28K055673_CB_MEMBER(rungun_state::sprite_callback)
2929{
30   rungun_state *state = machine.driver_data<rungun_state>();
31   *color = state->m_sprite_colorbase | (*color & 0x001f);
30   *color = m_sprite_colorbase | (*color & 0x001f);
3231}
3332
3433READ16_MEMBER(rungun_state::rng_ttl_ram_r)
trunk/src/mame/video/gijoe.c
r31118r31119
11#include "emu.h"
22#include "includes/gijoe.h"
33
4void gijoe_sprite_callback( running_machine &machine, int *code, int *color, int *priority_mask )
4K053246_CB_MEMBER(gijoe_state::sprite_callback)
55{
6   gijoe_state *state = machine.driver_data<gijoe_state>();
76   int pri = (*color & 0x03e0) >> 4;
87
9   if (pri <= state->m_layer_pri[3])
8   if (pri <= m_layer_pri[3])
109      *priority_mask = 0;
11   else if (pri >  state->m_layer_pri[3] && pri <= state->m_layer_pri[2])
10   else if (pri >  m_layer_pri[3] && pri <= m_layer_pri[2])
1211      *priority_mask = 0xff00;
13   else if (pri >  state->m_layer_pri[2] && pri <= state->m_layer_pri[1])
12   else if (pri >  m_layer_pri[2] && pri <= m_layer_pri[1])
1413      *priority_mask = 0xff00 | 0xf0f0;
15   else if (pri >  state->m_layer_pri[1] && pri <= state->m_layer_pri[0])
14   else if (pri >  m_layer_pri[1] && pri <= m_layer_pri[0])
1615      *priority_mask = 0xff00 | 0xf0f0 | 0xcccc;
1716   else
1817      *priority_mask = 0xff00 | 0xf0f0 | 0xcccc | 0xaaaa;
1918
20   *color = state->m_sprite_colorbase | (*color & 0x001f);
19   *color = m_sprite_colorbase | (*color & 0x001f);
2120}
2221
2322K056832_CB_MEMBER(gijoe_state::tile_callback)
trunk/src/mame/video/overdriv.c
r31118r31119
77
88***************************************************************************/
99
10void overdriv_sprite_callback( running_machine &machine, int *code, int *color, int *priority_mask )
10K053246_CB_MEMBER(overdriv_state::sprite_callback)
1111{
12   overdriv_state *state = machine.driver_data<overdriv_state>();
1312   int pri = (*color & 0xffe0) >> 5;   /* ??????? */
1413   if (pri)
1514      *priority_mask = 0x02;
1615   else
1716      *priority_mask = 0x00;
1817
19   *color = state->m_sprite_colorbase + (*color & 0x001f);
18   *color = m_sprite_colorbase + (*color & 0x001f);
2019}
2120
2221
trunk/src/mame/video/dbz.c
r31118r31119
1717   *color = (m_layer_colorbase[layer] << 1) + ((*color & 0x3c) >> 2);
1818}
1919
20void dbz_sprite_callback( running_machine &machine, int *code, int *color, int *priority_mask )
20K053246_CB_MEMBER(dbz_state::sprite_callback)
2121{
22   dbz_state *state = machine.driver_data<dbz_state>();
2322   int pri = (*color & 0x3c0) >> 5;
2423
25   if (pri <= state->m_layerpri[3])
24   if (pri <= m_layerpri[3])
2625      *priority_mask = 0xff00;
27   else if (pri > state->m_layerpri[3] && pri <= state->m_layerpri[2])
26   else if (pri > m_layerpri[3] && pri <= m_layerpri[2])
2827      *priority_mask = 0xfff0;
29   else if (pri > state->m_layerpri[2] && pri <= state->m_layerpri[1])
28   else if (pri > m_layerpri[2] && pri <= m_layerpri[1])
3029      *priority_mask = 0xfffc;
3130   else
3231      *priority_mask = 0xfffe;
3332
34   *color = (state->m_sprite_colorbase << 1) + (*color & 0x1f);
33   *color = (m_sprite_colorbase << 1) + (*color & 0x1f);
3534}
3635
3736/* Background Tilemaps */
r31118r31119
8584
8685   m_k056832->set_layer_offs(1, -31, -16);
8786   m_k056832->set_layer_offs(3, -31, -16); //?
88
89   m_k053246->k053247_set_sprite_offs( -87, 32);
9087}
9188
9289UINT32 dbz_state::screen_update_dbz(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
trunk/src/mame/video/mystwarr.c
r31118r31119
7474   *color = m_layer_colorbase[layer] | (*color >> 2 & 0x0f);
7575}
7676
77static void mystwarr_sprite_callback(running_machine &machine, int *code, int *color, int *priority)
77K055673_CB_MEMBER(mystwarr_state::mystwarr_sprite_callback)
7878{
79   mystwarr_state *state = machine.driver_data<mystwarr_state>();
8079   int c = *color;
81
82   *color = state->m_sprite_colorbase | (c & 0x001f);
83   *priority = c & 0x00f0;
80   *color = m_sprite_colorbase | (c & 0x001f);
81   *priority_mask = c & 0x00f0;
8482}
8583
86static void metamrph_sprite_callback(running_machine &machine, int *code, int *color, int *priority)
84K055673_CB_MEMBER(mystwarr_state::metamrph_sprite_callback)
8785{
88   mystwarr_state *state = machine.driver_data<mystwarr_state>();
8986   int c = *color;
9087   int attr = c;
9188
92   c = (c & 0x1f) | state->m_sprite_colorbase;
89   c = (c & 0x1f) | m_sprite_colorbase;
9390
9491   // Bit8 & 9 are effect attributes. It is not known whether the effects are generated by external logic.
9592   if ((attr & 0x300) != 0x300)
9693   {
9794      *color = c;
98      *priority = (attr & 0xe0) >> 2;
95      *priority_mask = (attr & 0xe0) >> 2;
9996   }
10097   else
10198   {
10299      *color = c | 3<<K055555_MIXSHIFT | K055555_SKIPSHADOW; // reflection?
103      *priority = 0x1c;
100      *priority_mask = 0x1c;
104101   }
105102}
106103
107static void gaiapols_sprite_callback(running_machine &machine, int *code, int *color, int *priority)
104K055673_CB_MEMBER(mystwarr_state::gaiapols_sprite_callback)
108105{
109   mystwarr_state *state = machine.driver_data<mystwarr_state>();
110106   int c = *color;
111107
112   *color = state->m_sprite_colorbase | (c>>4 & 0x20) | (c & 0x001f);
113   *priority = c & 0x00e0;
108   *color = m_sprite_colorbase | (c>>4 & 0x20) | (c & 0x001f);
109   *priority_mask = c & 0x00e0;
114110}
115111
116static void martchmp_sprite_callback(running_machine &machine, int *code, int *color, int *priority)
112K055673_CB_MEMBER(mystwarr_state::martchmp_sprite_callback)
117113{
118   mystwarr_state *state = machine.driver_data<mystwarr_state>();
119114   int c = *color;
120115
121116   // Bit8 & 9 are effect attributes. It is not known whether the effects are generated by external logic.
122117   if ((c & 0x3ff) == 0x11f)
123118      *color = K055555_FULLSHADOW;
124119   else
125      *color = state->m_sprite_colorbase | (c & 0x1f);
120      *color = m_sprite_colorbase | (c & 0x1f);
126121
127   if (state->m_oinprion & 0xf0)
128      *priority = state->m_cbparam;  // use PCU2 internal priority
122   if (m_oinprion & 0xf0)
123      *priority_mask = m_cbparam;  // use PCU2 internal priority
129124   else
130      *priority = c & 0xf0; // use color implied priority
125      *priority_mask = c & 0xf0; // use color implied priority
131126}
132127
133128
r31118r31119
152147   SET_TILE_INFO_MEMBER(0, tileno, colour, 0);
153148}
154149
155VIDEO_START_MEMBER(mystwarr_state,gaiapols)
150VIDEO_START_MEMBER(mystwarr_state, gaiapols)
156151{
157152   m_gametype = 0;
158153
159154   mystwarr_decode_tiles(machine());
160155
161   m_k055673->alt_k055673_vh_start(machine(), "gfx2", 1, -61, -22, gaiapols_sprite_callback); // stage2 brick walls
162
163156   konamigx_mixer_init(*m_screen, 0);
164157
165158   m_k056832->set_layer_offs(0, -2+2-1, 0-1);
r31118r31119
187180   SET_TILE_INFO_MEMBER(0, tileno, colour, (dat1[tile_index]&0x40) ? TILE_FLIPX : 0);
188181}
189182
190VIDEO_START_MEMBER(mystwarr_state,dadandrn)
183VIDEO_START_MEMBER(mystwarr_state, dadandrn)
191184{
192185   m_gametype = 1;
193186
194187   mystwarr_decode_tiles(machine());
195188
196   m_k055673->alt_k055673_vh_start(machine(), "gfx2", 0, -42, -22, gaiapols_sprite_callback);
197
198189   konamigx_mixer_init(*m_screen, 0);
199190
200191   konamigx_mixer_primode(1);
r31118r31119
211202   m_ult_936_tilemap->set_transparent_pen(0);
212203}
213204
214VIDEO_START_MEMBER(mystwarr_state,mystwarr)
205VIDEO_START_MEMBER(mystwarr_state, mystwarr)
215206{
216207   m_gametype = 0;
217208
218209   mystwarr_decode_tiles(machine());
219210
220   m_k055673->alt_k055673_vh_start(machine(), "gfx2", 0, -48, -24, mystwarr_sprite_callback);
221
222211   konamigx_mixer_init(*m_screen, 0);
223212
224213   m_k056832->set_layer_offs(0, -2-3, 0);
r31118r31119
229218   m_cbparam = 0;
230219}
231220
232VIDEO_START_MEMBER(mystwarr_state,metamrph)
221VIDEO_START_MEMBER(mystwarr_state, metamrph)
233222{
234223   m_gametype = 0;
235224
236225   mystwarr_decode_tiles(machine());
237226
238   m_k055673->alt_k055673_vh_start(machine(), "gfx2", 1, -51, -24, metamrph_sprite_callback);
239
240227   konamigx_mixer_init(*m_screen, 0);
241228
242229   // other reference, floor at first boss
r31118r31119
246233   m_k056832->set_layer_offs(3,  3+4, 0); // attract sky background to sea
247234}
248235
249VIDEO_START_MEMBER(mystwarr_state,viostorm)
236VIDEO_START_MEMBER(mystwarr_state, viostorm)
250237{
251238   m_gametype = 0;
252239
253240   mystwarr_decode_tiles(machine());
254241
255   m_k055673->alt_k055673_vh_start(machine(), "gfx2", 1, -62, -23, metamrph_sprite_callback);
256
257242   konamigx_mixer_init(*m_screen, 0);
258243
259244   m_k056832->set_layer_offs(0, -2+1, 0);
r31118r31119
262247   m_k056832->set_layer_offs(3,  3+1, 0);
263248}
264249
265VIDEO_START_MEMBER(mystwarr_state,martchmp)
250VIDEO_START_MEMBER(mystwarr_state, martchmp)
266251{
267252   m_gametype = 0;
268253
269254   mystwarr_decode_tiles(machine());
270255
271   m_k055673->alt_k055673_vh_start(machine(), "gfx2", 0, -58, -23, martchmp_sprite_callback);
272
273256   konamigx_mixer_init(*m_screen, 0);
274257
275258   m_k056832->set_layer_offs(0, -2-4, 0);
trunk/src/mame/video/konamigx.c
r31118r31119
152152   return(c18 | op);
153153}
154154
155static void konamigx_type2_sprite_callback(running_machine &machine, int *code, int *color, int *priority)
155K055673_CB_MEMBER(konamigx_state::type2_sprite_callback)
156156{
157157   int num = *code;
158158   int c18 = *color;
r31118r31119
160160   *code = k053247_vrcbk[num>>14] | (num & 0x3fff);
161161   c18 = K053247GX_combine_c18(c18);
162162   *color = K055555GX_decode_objcolor(c18);
163   *priority = K055555GX_decode_inpri(c18);
163   *priority_mask = K055555GX_decode_inpri(c18);
164164}
165165
166static void konamigx_dragoonj_sprite_callback(running_machine &machine, int *code, int *color, int *priority)
166K055673_CB_MEMBER(konamigx_state::dragoonj_sprite_callback)
167167{
168168   int num, op, pri, c18;
169169
r31118r31119
175175   pri  = (pri & 0x200) ? 4 : pri>>4 & 0xf;
176176   op  &= oinprion;
177177   pri &=~oinprion;
178   *priority = pri | op;
178   *priority_mask = pri | op;
179179
180180   c18 = K053247GX_combine_c18(c18);
181181   *color = K055555GX_decode_objcolor(c18);
182182}
183183
184static void konamigx_salmndr2_sprite_callback(running_machine &machine, int *code, int *color, int *priority)
184K055673_CB_MEMBER(konamigx_state::salmndr2_sprite_callback)
185185{
186186   int num, op, pri, c18;
187187
r31118r31119
193193   pri  = pri>>4 & 0x3f;
194194   op  &= oinprion;
195195   pri &=~oinprion;
196   *priority = pri | op;
196   *priority_mask = pri | op;
197197
198198   c18 = K053247GX_combine_c18(c18);
199199   *color = K055555GX_decode_objcolor(c18);
200200}
201201
202static void konamigx_le2_sprite_callback(running_machine &machine, int *code, int *color, int *priority)
202K055673_CB_MEMBER(konamigx_state::le2_sprite_callback)
203203{
204204   int num, op, pri;
205205
r31118r31119
213213   pri &= 0xf0;
214214   op  &= oinprion;
215215   pri &=~oinprion;
216   *priority = pri | op;
216   *priority_mask = pri | op;
217217}
218218
219219static int K055555GX_decode_vmixcolor(int layer, int *color) // (see p.62 7.2.6 and p.27 3.3)
r31118r31119
341341static struct GX_OBJ { int order, offs, code, color; } *gx_objpool;
342342static UINT16 *gx_spriteram;
343343
344// mirrored K053247 and K054338 settings
345static void (*k053247_callback)(running_machine &machine, int *code,int *color,int *priority);
346
347
344// mirrored K054338 settings
348345static int *K054338_shdRGB;
349346
350347
r31118r31119
357354   gx_shdzbuf = auto_alloc_array(machine(), UINT8, GX_ZBUFSIZE);
358355   gx_objpool = auto_alloc_array(machine(), struct GX_OBJ, GX_MAX_OBJECTS);
359356
360   m_k055673->alt_k053247_export_config(&k053247_callback);
361357   m_k054338->export_config(&K054338_shdRGB);
362358
363359   if (objdma)
r31118r31119
574570      int color = k = gx_spriteram[offs+6];
575571      l     = gx_spriteram[offs+7];
576572
577      (*k053247_callback)(machine(), &code, &color, &pri);
573      m_k055673->m_k053247_cb(&code, &color, &pri);
578574
579575      /*
580576          shadow = shadow code
r31118r31119
11631159> so, well, the top bits of the code are suspicious
11641160*/
11651161
1166void konamigx_state::_gxcommoninitnosprites(running_machine &machine)
1162void konamigx_state::common_init()
11671163{
1168   int i;
1169
11701164   konamigx_mixer_init(*m_screen, 0);
11711165
1172   for (i = 0; i < 8; i++)
1166   for (int i = 0; i < 8; i++)
11731167   {
11741168      gx_tilebanks[i] = gx_oldbanks[i] = 0;
11751169   }
11761170
1177   machine.save().save_item(NAME(gx_tilebanks));
1171   machine().save().save_item(NAME(gx_tilebanks));
11781172
11791173   gx_tilemode = 0;
11801174
r31118r31119
11971191   m_konamigx_current_frame = 0;
11981192}
11991193
1200void konamigx_state::_gxcommoninit(running_machine &machine)
1201{
1202   // (+ve values move objects to the right and -ve values move objects to the left)
1203   m_k055673->alt_k055673_vh_start(machine, "gfx2", K055673_LAYOUT_GX, -26, -23, konamigx_type2_sprite_callback);
12041194
1205   _gxcommoninitnosprites(machine);
1206}
1207
1208
1209VIDEO_START_MEMBER(konamigx_state,konamigx_5bpp)
1195VIDEO_START_MEMBER(konamigx_state, konamigx_5bpp)
12101196{
1211   _gxcommoninit(machine());
1212
1213   /* here are some hand tuned per game scroll offsets to go with the per game visible areas,
1214      i see no better way of doing this for now... */
1215
1197   common_init();
1198   
12161199   if (!strcmp(machine().system().name,"tbyahhoo"))
1217   {
12181200      gx_tilemode = 1;
1219   } else
1220
1221   if (!strcmp(machine().system().name,"crzcross") || !strcmp(machine().system().name,"puzldama"))
1222   {
1223      m_k055673->k053247_set_sprite_offs(-46, -23);
1201   else if (!strcmp(machine().system().name,"crzcross") || !strcmp(machine().system().name,"puzldama"))
12241202      konamigx_mixer_primode(5);
1225   } else
1226
1227   if (!strcmp(machine().system().name,"daiskiss"))
1228   {
1203   else if (!strcmp(machine().system().name,"daiskiss"))
12291204      konamigx_mixer_primode(4);
1230   } else
1231
1232   if (!strcmp(machine().system().name,"gokuparo") || !strcmp(machine().system().name,"fantjour") || !strcmp(machine().system().name,"fantjoura"))
1233   {
1234      m_k055673->k053247_set_sprite_offs(-46, -23);
1235   } else
1236
1237   if (!strcmp(machine().system().name,"sexyparo") || !strcmp(machine().system().name,"sexyparoa"))
1238   {
1239      m_k055673->k053247_set_sprite_offs(-42, -23);
1240   }
12411205}
12421206
1243VIDEO_START_MEMBER(konamigx_state,winspike)
1207VIDEO_START_MEMBER(konamigx_state, dragoonj)
12441208{
1245   m_k055673->alt_k055673_vh_start(machine(), "gfx2", K055673_LAYOUT_LE2, -53, -23, konamigx_type2_sprite_callback);
1209   common_init();
12461210
1247   _gxcommoninitnosprites(machine());
1248}
1249
1250VIDEO_START_MEMBER(konamigx_state,dragoonj)
1251{
1252   m_k055673->alt_k055673_vh_start(machine(), "gfx2", K055673_LAYOUT_RNG, -53, -23, konamigx_dragoonj_sprite_callback);
1253
1254   _gxcommoninitnosprites(machine());
1255
12561211   m_k056832->set_layer_offs(0, -2+1, 0);
12571212   m_k056832->set_layer_offs(1,  0+1, 0);
12581213   m_k056832->set_layer_offs(2,  2+1, 0);
12591214   m_k056832->set_layer_offs(3,  3+1, 0);
12601215}
12611216
1262VIDEO_START_MEMBER(konamigx_state,le2)
1217VIDEO_START_MEMBER(konamigx_state, le2)
12631218{
1264   m_k055673->alt_k055673_vh_start(machine(), "gfx2", K055673_LAYOUT_LE2, -46, -23, konamigx_le2_sprite_callback);
1219   common_init();
12651220
1266   _gxcommoninitnosprites(machine());
1267
12681221   konamigx_mixer_primode(-1); // swapped layer B and C priorities?
12691222
12701223   gx_le2_textcolour_hack = 1; // force text layer to use the right palette
12711224   m_k055555->K055555_write_reg(K55_INPUT_ENABLES, 1); // it doesn't turn on the video output at first for the test screens, maybe it should default to ON?
12721225}
12731226
1274VIDEO_START_MEMBER(konamigx_state,konamigx_6bpp)
1227VIDEO_START_MEMBER(konamigx_state, konamigx_6bpp)
12751228{
1276   _gxcommoninit(machine());
1277
1278   if (!strcmp(machine().system().name,"tokkae") || !strcmp(machine().system().name,"tkmmpzdm"))
1279   {
1280      m_k055673->k053247_set_sprite_offs(-46, -23);
1281      konamigx_mixer_primode(5);
1282   }
1229   common_init();
1230   konamigx_mixer_primode(5);
12831231}
12841232
1285VIDEO_START_MEMBER(konamigx_state,konamigx_type3)
1233VIDEO_START_MEMBER(konamigx_state, konamigx_type3)
12861234{
12871235   int width = m_screen->width();
12881236   int height = m_screen->height();
1289   m_k055673->alt_k055673_vh_start(machine(), "gfx2", K055673_LAYOUT_GX6, -132, -23, konamigx_type2_sprite_callback);
12901237
12911238   dualscreen_left_tempbitmap = auto_bitmap_rgb32_alloc(machine(), width, height);
12921239   dualscreen_right_tempbitmap = auto_bitmap_rgb32_alloc(machine(), width, height);
12931240
1294   _gxcommoninitnosprites(machine());
1241   common_init();
12951242
12961243   gx_psac_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(konamigx_state::get_gx_psac3_tile_info),this), TILEMAP_SCAN_COLS,  16, 16, 256, 256);
12971244   gx_psac_tilemap_alt = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(konamigx_state::get_gx_psac3_alt_tile_info),this), TILEMAP_SCAN_COLS,  16, 16, 256, 256);
r31118r31119
13191266   konamigx_palformat = 1;
13201267}
13211268
1322VIDEO_START_MEMBER(konamigx_state,konamigx_type4)
1269VIDEO_START_MEMBER(konamigx_state, konamigx_type4)
13231270{
13241271   int width = m_screen->width();
13251272   int height = m_screen->height();
13261273
1327   m_k055673->alt_k055673_vh_start(machine(), "gfx2", K055673_LAYOUT_GX6, -79, -24, konamigx_type2_sprite_callback); // -23 looks better in intro
1328
13291274   dualscreen_left_tempbitmap = auto_bitmap_rgb32_alloc(machine(), width, height);
13301275   dualscreen_right_tempbitmap = auto_bitmap_rgb32_alloc(machine(), width, height);
13311276
1332   _gxcommoninitnosprites(machine());
1277   common_init();
13331278
13341279   gx_psac_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(konamigx_state::get_gx_psac_tile_info),this), TILEMAP_SCAN_COLS,  16, 16, 128, 128);
13351280   gx_rozenable = 0;
r31118r31119
13491294
13501295}
13511296
1352VIDEO_START_MEMBER(konamigx_state,konamigx_type4_vsn)
1297VIDEO_START_MEMBER(konamigx_state, konamigx_type4_vsn)
13531298{
13541299   int width = m_screen->width();
13551300   int height = m_screen->height();
13561301
1357   m_k055673->alt_k055673_vh_start(machine(), "gfx2", K055673_LAYOUT_GX6, -132, -23, konamigx_type2_sprite_callback);
1358
13591302   dualscreen_left_tempbitmap = auto_bitmap_rgb32_alloc(machine(), width, height);
13601303   dualscreen_right_tempbitmap = auto_bitmap_rgb32_alloc(machine(), width, height);
13611304
1362   _gxcommoninitnosprites(machine());
1305   common_init();
13631306
13641307   gx_psac_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(konamigx_state::get_gx_psac_tile_info),this), TILEMAP_SCAN_COLS,  16, 16, 128, 128);
13651308   gx_rozenable = 0;
r31118r31119
13781321   konamigx_palformat = 0;
13791322}
13801323
1381VIDEO_START_MEMBER(konamigx_state,konamigx_type4_sd2)
1324VIDEO_START_MEMBER(konamigx_state, konamigx_type4_sd2)
13821325{
13831326   int width = m_screen->width();
13841327   int height = m_screen->height();
13851328
1386   m_k055673->alt_k055673_vh_start(machine(), "gfx2", K055673_LAYOUT_GX6, -81, -23, konamigx_type2_sprite_callback);
1387
13881329   dualscreen_left_tempbitmap = auto_bitmap_rgb32_alloc(machine(), width, height);
13891330   dualscreen_right_tempbitmap = auto_bitmap_rgb32_alloc(machine(), width, height);
13901331
1391   _gxcommoninitnosprites(machine());
1332   common_init();
13921333
13931334   gx_psac_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(konamigx_state::get_gx_psac_tile_info),this), TILEMAP_SCAN_COLS,  16, 16, 128, 128);
13941335   gx_rozenable = 0;
r31118r31119
14101351
14111352}
14121353
1413
1414VIDEO_START_MEMBER(konamigx_state,konamigx_6bpp_2)
1354VIDEO_START_MEMBER(konamigx_state, opengolf)
14151355{
1416   if (!strcmp(machine().system().name,"salmndr2") || !strcmp(machine().system().name,"salmndr2a"))
1417   {
1418      m_k055673->alt_k055673_vh_start(machine(), "gfx2", K055673_LAYOUT_GX6, -48, -23, konamigx_salmndr2_sprite_callback);
1356   common_init();
14191357
1420      _gxcommoninitnosprites(machine());
1421   }
1422   else
1423   {
1424      _gxcommoninit(machine());
1425   }
1426}
1427
1428VIDEO_START_MEMBER(konamigx_state,opengolf)
1429{
1430   m_k055673->alt_k055673_vh_start(machine(), "gfx2", K055673_LAYOUT_GX6, -53, -23, konamigx_type2_sprite_callback);
1431
1432   _gxcommoninitnosprites(machine());
1433
14341358   m_k056832->set_layer_offs(0, -2+1, 0);
14351359   m_k056832->set_layer_offs(1,  0+1, 0);
14361360   m_k056832->set_layer_offs(2,  2+1, 0);
r31118r31119
14621386
14631387}
14641388
1465VIDEO_START_MEMBER(konamigx_state,racinfrc)
1389VIDEO_START_MEMBER(konamigx_state, racinfrc)
14661390{
1467   m_k055673->alt_k055673_vh_start(machine(), "gfx2", K055673_LAYOUT_GX, -53, -23, konamigx_type2_sprite_callback);
1391   common_init();
14681392
1469   _gxcommoninitnosprites(machine());
1470
14711393   m_k056832->set_layer_offs(0, -2+1, 0);
14721394   m_k056832->set_layer_offs(1,  0+1, 0);
14731395   m_k056832->set_layer_offs(2,  2+1, 0);
trunk/src/mame/video/vendetta.c
r31118r31119
2626
2727***************************************************************************/
2828
29void vendetta_sprite_callback( running_machine &machine, int *code, int *color, int *priority_mask )
29K053246_CB_MEMBER(vendetta_state::sprite_callback)
3030{
31   vendetta_state *state = machine.driver_data<vendetta_state>();
3231   int pri = (*color & 0x03e0) >> 4;   /* ??????? */
33   if (pri <= state->m_layerpri[2])
32   if (pri <= m_layerpri[2])
3433      *priority_mask = 0;
35   else if (pri > state->m_layerpri[2] && pri <= state->m_layerpri[1])
34   else if (pri > m_layerpri[2] && pri <= m_layerpri[1])
3635      *priority_mask = 0xf0;
37   else if (pri > state->m_layerpri[1] && pri <= state->m_layerpri[0])
36   else if (pri > m_layerpri[1] && pri <= m_layerpri[0])
3837      *priority_mask = 0xf0 | 0xcc;
3938   else
4039      *priority_mask = 0xf0 | 0xcc | 0xaa;
4140
42   *color = state->m_sprite_colorbase + (*color & 0x001f);
41   *color = m_sprite_colorbase + (*color & 0x001f);
4342}
4443
4544
trunk/src/mame/video/k053246_k053247_k055673.c
r31118r31119
5656   for (int i=0;i<16;i++)
5757      m_kx47_regs[i] = 0;
5858
59   m_dx = m_dy = 0;
6059   m_objcha_line = 0;
6160   m_z_rejection = 0;
6261
63   m_callback = 0;
64
6562   m_memory_region = 0;
66
67   m_intf_gfx_memory_region = 0;
68   m_intf_gfx_num = -1;
69   m_intf_plane_order = 0;
70   m_intf_dx = m_intf_dy = 0;
71   m_intf_callback = 0;
7263}
7364
7465void k053247_device::k053247_get_ram( UINT16 **ram )
r31118r31119
9687   return(m_kx47_regs[regnum]);
9788}
9889
99void k053247_device::k053247_set_sprite_offs( int offsx, int offsy )
100{
101   m_dx = offsx;
102   m_dy = offsy;
103}
10490
105
106
10791WRITE16_MEMBER( k053247_device::k053247_reg_word_w ) // write-only OBJSET2 registers (see p.43 table 6.1)
10892{
10993   COMBINE_DATA(m_kx47_regs + offset);
r31118r31119
462446      shadow = color = m_ram[offs + 6];
463447      primask = 0;
464448
465      m_callback(machine(), &code, &color, &primask);
449      m_k053247_cb(&code, &color, &primask);
466450
467451      k053247_draw_single_sprite_gxcore( bitmap, cliprect,
468452            NULL, NULL,
r31118r31119
979963
980964void k055673_device::device_start()
981965{
982   /* early out for the non-interface cases for now */
983   if (m_intf_gfx_num == -1)
984      return;
985
986   alt_k055673_vh_start(machine(), m_intf_gfx_memory_region, m_intf_plane_order, m_intf_dx, m_intf_dy, m_intf_callback);
966   int gfx_index;
967   UINT32 total;
968   
969   static const gfx_layout spritelayout =  /* System GX sprite layout */
970   {
971      16,16,
972      0,
973      5,
974      { 32, 24, 16, 8, 0 },
975      { 0, 1, 2, 3, 4, 5, 6, 7, 40, 41, 42, 43, 44, 45, 46, 47 },
976      { 0, 10*8, 10*8*2, 10*8*3, 10*8*4, 10*8*5, 10*8*6, 10*8*7, 10*8*8,
977         10*8*9, 10*8*10, 10*8*11, 10*8*12, 10*8*13, 10*8*14, 10*8*15 },
978      16*16*5
979   };
980   static const gfx_layout spritelayout2 = /* Run and Gun sprite layout */
981   {
982      16,16,
983      0,
984      4,
985      { 24, 16, 8, 0 },
986      { 0, 1, 2, 3, 4, 5, 6, 7, 32, 33, 34, 35, 36, 37, 38, 39 },
987      { 0, 64, 128, 192, 256, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960 },
988      16*16*4
989   };
990   static const gfx_layout spritelayout3 = /* Lethal Enforcers II sprite layout */
991   {
992      16,16,
993      0,
994      8,
995      { 8*1,8*0,8*3,8*2,8*5,8*4,8*7,8*6 },
996      {  0,1,2,3,4,5,6,7,64+0,64+1,64+2,64+3,64+4,64+5,64+6,64+7 },
997      { 128*0, 128*1, 128*2,  128*3,  128*4,  128*5,  128*6,  128*7,
998         128*8, 128*9, 128*10, 128*11, 128*12, 128*13, 128*14, 128*15 },
999      128*16
1000   };
1001   static const gfx_layout spritelayout4 = /* System GX 6bpp sprite layout */
1002   {
1003      16,16,
1004      0,
1005      6,
1006      { 40, 32, 24, 16, 8, 0 },
1007      { 0, 1, 2, 3, 4, 5, 6, 7, 48, 49, 50, 51, 52, 53, 54, 55 },
1008      { 0, 12*8, 12*8*2, 12*8*3, 12*8*4, 12*8*5, 12*8*6, 12*8*7, 12*8*8,
1009         12*8*9, 12*8*10, 12*8*11, 12*8*12, 12*8*13, 12*8*14, 12*8*15 },
1010      16*16*6
1011   };
1012   UINT8 *s1, *s2, *d;
1013   long i;
1014   UINT16 *alt_k055673_rom;
1015   int size4;
1016   
1017   /* find first empty slot to decode gfx */
1018   for (gfx_index = 0; gfx_index < MAX_GFX_ELEMENTS; gfx_index++)
1019      if (m_gfxdecode->gfx(gfx_index) == 0)
1020         break;
1021   assert(gfx_index != MAX_GFX_ELEMENTS);
1022   
1023   alt_k055673_rom = (UINT16 *)machine().root_device().memregion(m_memory_region)->base();
1024   
1025   /* decode the graphics */
1026   switch (m_plane_order)
1027   {
1028      case K055673_LAYOUT_GX:
1029         size4 = (machine().root_device().memregion(m_memory_region)->bytes()/(1024*1024))/5;
1030         size4 *= 4*1024*1024;
1031         /* set the # of tiles based on the 4bpp section */
1032         alt_k055673_rom = auto_alloc_array(machine(), UINT16, size4 * 5 / 2);
1033         d = (UINT8 *)alt_k055673_rom;
1034         // now combine the graphics together to form 5bpp
1035         s1 = machine().root_device().memregion(m_memory_region)->base(); // 4bpp area
1036         s2 = s1 + (size4);   // 1bpp area
1037         for (i = 0; i < size4; i+= 4)
1038         {
1039            *d++ = *s1++;
1040            *d++ = *s1++;
1041            *d++ = *s1++;
1042            *d++ = *s1++;
1043            *d++ = *s2++;
1044         }
1045         
1046         total = size4 / 128;
1047         konami_decode_gfx(machine(), m_gfxdecode, m_palette, gfx_index, (UINT8 *)alt_k055673_rom, total, &spritelayout, 5);
1048         break;
1049         
1050      case K055673_LAYOUT_RNG:
1051         total = machine().root_device().memregion(m_memory_region)->bytes() / (16*16/2);
1052         konami_decode_gfx(machine(), m_gfxdecode, m_palette, gfx_index, (UINT8 *)alt_k055673_rom, total, &spritelayout2, 4);
1053         break;
1054         
1055      case K055673_LAYOUT_LE2:
1056         total = machine().root_device().memregion(m_memory_region)->bytes() / (16*16);
1057         konami_decode_gfx(machine(), m_gfxdecode, m_palette, gfx_index, (UINT8 *)alt_k055673_rom, total, &spritelayout3, 8);
1058         break;
1059         
1060      case K055673_LAYOUT_GX6:
1061         total = machine().root_device().memregion(m_memory_region)->bytes() / (16*16*6/8);
1062         konami_decode_gfx(machine(), m_gfxdecode, m_palette, gfx_index, (UINT8 *)alt_k055673_rom, total, &spritelayout4, 6);
1063         break;
1064         
1065      default:
1066         fatalerror("Unsupported layout\n");
1067   }
1068   
1069   if (VERBOSE && !(m_palette->shadows_enabled()))
1070      popmessage("driver should use VIDEO_HAS_SHADOWS");
1071   
1072   m_z_rejection = -1;
1073   m_gfx = m_gfxdecode->gfx(gfx_index);
1074   m_objcha_line = CLEAR_LINE;
1075   m_ram = auto_alloc_array(machine(), UINT16, 0x1000/2);
1076   
1077   memset(m_ram,  0, 0x1000);
1078   memset(m_kx46_regs, 0, 8);
1079   memset(m_kx47_regs, 0, 32);
1080   
1081   machine().save().save_pointer(NAME(m_ram), 0x800);
1082   machine().save().save_item(NAME(m_kx46_regs));
1083   machine().save().save_item(NAME(m_kx47_regs));
1084   machine().save().save_item(NAME(m_objcha_line));
9871085}
9881086
9891087//-------------------------------------------------
r31118r31119
10331131}
10341132
10351133//-------------------------------------------------
1036//  device_config_complete - perform any
1037//  operations now that the configuration is
1038//  complete
1039//-------------------------------------------------
1040
1041void k053247_device::device_config_complete()
1042{
1043   // inherit a copy of the static data
1044   const k053247_interface *intf = reinterpret_cast<const k053247_interface *>(static_config());
1045   if (intf != NULL)
1046   *static_cast<k053247_interface *>(this) = *intf;
1047
1048   // or initialize to defaults if none provided
1049   else
1050   {
1051   }
1052
1053}
1054
1055//-------------------------------------------------
10561134//  device_start - device-specific startup
10571135//-------------------------------------------------
10581136
r31118r31119
10871165   };
10881166
10891167   /* decode the graphics */
1090   switch (m_intf_plane_order)
1168   switch (m_plane_order)
10911169   {
10921170   case NORMAL_PLANE_ORDER:
1093      total = machine().root_device().memregion(m_intf_gfx_memory_region)->bytes() / 128;
1094      konami_decode_gfx(machine(), m_gfxdecode, m_palette, m_intf_gfx_num, machine().root_device().memregion(m_intf_gfx_memory_region)->base(), total, &spritelayout, 4);
1171      total = machine().root_device().memregion(m_memory_region)->bytes() / 128;
1172      konami_decode_gfx(machine(), m_gfxdecode, m_palette, m_gfx_num, machine().root_device().memregion(m_memory_region)->base(), total, &spritelayout, 4);
10951173      break;
10961174
10971175   case TASMAN_PLANE_ORDER:
1098      total = machine().root_device().memregion(m_intf_gfx_memory_region)->bytes() / 128;
1099      konami_decode_gfx(machine(), m_gfxdecode, m_palette, m_intf_gfx_num, machine().root_device().memregion(m_intf_gfx_memory_region)->base(), total, &tasman_16x16_layout, 4);
1176      total = machine().root_device().memregion(m_memory_region)->bytes() / 128;
1177      konami_decode_gfx(machine(), m_gfxdecode, m_palette, m_gfx_num, machine().root_device().memregion(m_memory_region)->base(), total, &tasman_16x16_layout, 4);
11001178      break;
11011179
11021180   default:
r31118r31119
11171195      }
11181196   }
11191197
1120   m_dx = m_intf_dx;
1121   m_dy = m_intf_dy;
1122   m_memory_region = m_intf_gfx_memory_region;
1123   m_gfx = m_gfxdecode->gfx(m_intf_gfx_num);
1124   m_callback = m_intf_callback;
1198   m_gfx = m_gfxdecode->gfx(m_gfx_num);
11251199
11261200   m_ram = auto_alloc_array_clear(machine(), UINT16, 0x1000 / 2);
11271201
r31118r31119
11851259   return (k053247_reg_word_r( space, offset + 1, 0xffff) | k053247_reg_word_r( space, offset, 0xffff) << 16);
11861260}
11871261
1188
1189/***************************************************************************/
1190/*                                                                         */
1191/*                                 053246/053247                           */
1192/* stuff GX still relies on                                                */
1193/*                                                                         */
1194/***************************************************************************/
1195
1196
1197void k053247_device::alt_k053247_export_config(void (**callback)(running_machine &, int *, int *, int *))
1198{
1199   if(callback)
1200      *callback = m_callback;
1201}
1202
1203/* alt_K055673 used with the 54246 in PreGX/Run and Gun/System GX games */
1204void k053247_device::alt_k055673_vh_start(running_machine &machine, const char *gfx_memory_region, int layout, int dx, int dy, void (*callback)(running_machine &machine, int *code,int *color,int *priority))
1205{
1206   int gfx_index;
1207   UINT32 total;
1208
1209   static const gfx_layout spritelayout =  /* System GX sprite layout */
1210   {
1211      16,16,
1212      0,
1213      5,
1214      { 32, 24, 16, 8, 0 },
1215      { 0, 1, 2, 3, 4, 5, 6, 7, 40, 41, 42, 43, 44, 45, 46, 47 },
1216      { 0, 10*8, 10*8*2, 10*8*3, 10*8*4, 10*8*5, 10*8*6, 10*8*7, 10*8*8,
1217         10*8*9, 10*8*10, 10*8*11, 10*8*12, 10*8*13, 10*8*14, 10*8*15 },
1218      16*16*5
1219   };
1220   static const gfx_layout spritelayout2 = /* Run and Gun sprite layout */
1221   {
1222      16,16,
1223      0,
1224      4,
1225      { 24, 16, 8, 0 },
1226      { 0, 1, 2, 3, 4, 5, 6, 7, 32, 33, 34, 35, 36, 37, 38, 39 },
1227      { 0, 64, 128, 192, 256, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960 },
1228      16*16*4
1229   };
1230   static const gfx_layout spritelayout3 = /* Lethal Enforcers II sprite layout */
1231   {
1232      16,16,
1233      0,
1234      8,
1235      { 8*1,8*0,8*3,8*2,8*5,8*4,8*7,8*6 },
1236      {  0,1,2,3,4,5,6,7,64+0,64+1,64+2,64+3,64+4,64+5,64+6,64+7 },
1237      { 128*0, 128*1, 128*2,  128*3,  128*4,  128*5,  128*6,  128*7,
1238         128*8, 128*9, 128*10, 128*11, 128*12, 128*13, 128*14, 128*15 },
1239      128*16
1240   };
1241   static const gfx_layout spritelayout4 = /* System GX 6bpp sprite layout */
1242   {
1243      16,16,
1244      0,
1245      6,
1246      { 40, 32, 24, 16, 8, 0 },
1247      { 0, 1, 2, 3, 4, 5, 6, 7, 48, 49, 50, 51, 52, 53, 54, 55 },
1248      { 0, 12*8, 12*8*2, 12*8*3, 12*8*4, 12*8*5, 12*8*6, 12*8*7, 12*8*8,
1249         12*8*9, 12*8*10, 12*8*11, 12*8*12, 12*8*13, 12*8*14, 12*8*15 },
1250      16*16*6
1251   };
1252   UINT8 *s1, *s2, *d;
1253   long i;
1254   UINT16 *alt_k055673_rom;
1255   int size4;
1256
1257   /* find first empty slot to decode gfx */
1258   for (gfx_index = 0; gfx_index < MAX_GFX_ELEMENTS; gfx_index++)
1259      if (m_gfxdecode->gfx(gfx_index) == 0)
1260         break;
1261   assert(gfx_index != MAX_GFX_ELEMENTS);
1262
1263   alt_k055673_rom = (UINT16 *)machine.root_device().memregion(gfx_memory_region)->base();
1264
1265   /* decode the graphics */
1266   switch(layout)
1267   {
1268   case K055673_LAYOUT_GX:
1269      size4 = (machine.root_device().memregion(gfx_memory_region)->bytes()/(1024*1024))/5;
1270      size4 *= 4*1024*1024;
1271      /* set the # of tiles based on the 4bpp section */
1272      alt_k055673_rom = auto_alloc_array(machine, UINT16, size4 * 5 / 2);
1273      d = (UINT8 *)alt_k055673_rom;
1274      // now combine the graphics together to form 5bpp
1275      s1 = machine.root_device().memregion(gfx_memory_region)->base(); // 4bpp area
1276      s2 = s1 + (size4);   // 1bpp area
1277      for (i = 0; i < size4; i+= 4)
1278      {
1279         *d++ = *s1++;
1280         *d++ = *s1++;
1281         *d++ = *s1++;
1282         *d++ = *s1++;
1283         *d++ = *s2++;
1284      }
1285
1286      total = size4 / 128;
1287      konami_decode_gfx(machine, m_gfxdecode, m_palette, gfx_index, (UINT8 *)alt_k055673_rom, total, &spritelayout, 5);
1288      break;
1289
1290   case K055673_LAYOUT_RNG:
1291      total = machine.root_device().memregion(gfx_memory_region)->bytes() / (16*16/2);
1292      konami_decode_gfx(machine, m_gfxdecode, m_palette, gfx_index, (UINT8 *)alt_k055673_rom, total, &spritelayout2, 4);
1293      break;
1294
1295   case K055673_LAYOUT_LE2:
1296      total = machine.root_device().memregion(gfx_memory_region)->bytes() / (16*16);
1297      konami_decode_gfx(machine, m_gfxdecode, m_palette, gfx_index, (UINT8 *)alt_k055673_rom, total, &spritelayout3, 8);
1298      break;
1299
1300   case K055673_LAYOUT_GX6:
1301      total = machine.root_device().memregion(gfx_memory_region)->bytes() / (16*16*6/8);
1302      konami_decode_gfx(machine, m_gfxdecode, m_palette, gfx_index, (UINT8 *)alt_k055673_rom, total, &spritelayout4, 6);
1303      break;
1304
1305   default:
1306      fatalerror("Unsupported layout\n");
1307   }
1308
1309   if (VERBOSE && !(m_palette->shadows_enabled()))
1310      popmessage("driver should use VIDEO_HAS_SHADOWS");
1311
1312   m_dx = dx;
1313   m_dy = dy;
1314   m_z_rejection = -1;
1315   m_memory_region = gfx_memory_region;
1316   m_gfx = m_gfxdecode->gfx(gfx_index);
1317   m_callback = callback;
1318   m_objcha_line = CLEAR_LINE;
1319   m_ram = auto_alloc_array(machine, UINT16, 0x1000/2);
1320
1321   memset(m_ram,  0, 0x1000);
1322   memset(m_kx46_regs, 0, 8);
1323   memset(m_kx47_regs, 0, 32);
1324
1325   machine.save().save_pointer(NAME(m_ram), 0x800);
1326   machine.save().save_item(NAME(m_kx46_regs));
1327   machine.save().save_item(NAME(m_kx47_regs));
1328   machine.save().save_item(NAME(m_objcha_line));
1329}
trunk/src/mame/video/k053246_k053247_k055673.h
r31118r31119
99#define NORMAL_PLANE_ORDER 0x0123
1010#define TASMAN_PLANE_ORDER 0x1616
1111
12typedef void (*k05324x_callback)(running_machine &machine, int *code, int *color, int *priority);
12typedef device_delegate<void (int *code, int *color, int *priority_mask)> k053247_cb_delegate;
13#define K053246_CB_MEMBER(_name)   void _name(int *code, int *color, int *priority_mask)
14#define K055673_CB_MEMBER(_name)   void _name(int *code, int *color, int *priority_mask)
1315
16#define MCFG_K053246_CB(_class, _method) \
17   k053247_device::set_k053247_callback(*device, k053247_cb_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner)));
1418
19#define MCFG_K053246_CONFIG(_gfx_reg, _gfx_num, _order, _dx, _dy) \
20   k053247_device::set_config(*device, _gfx_reg, _gfx_num, _order, _dx, _dy);
21
22#define MCFG_K055673_CB(_class, _method) \
23   k053247_device::set_k053247_callback(*device, k053247_cb_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner)));
24
25#define MCFG_K055673_CONFIG(_gfx_reg, _gfx_num, _order, _dx, _dy) \
26   k053247_device::set_config(*device, _gfx_reg, _gfx_num, _order, _dx, _dy);
27
28
1529/**  Konami 053246 / 053247 / 055673  **/
1630#define K055673_LAYOUT_GX  0
1731#define K055673_LAYOUT_RNG 1
r31118r31119
4256#endif
4357
4458
45struct k053247_interface
46{
47   const char         *m_intf_gfx_memory_region;
48   int                m_intf_gfx_num;
49   int                m_intf_plane_order;
50   int                m_intf_dx, m_intf_dy;
51   k05324x_callback   m_intf_callback;
52};
53
5459class k053247_device : public device_t,
55                  public device_video_interface,
56                  public k053247_interface
60                  public device_video_interface
5761{
5862public:
5963   k053247_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
r31118r31119
6468   // static configuration
6569   static void static_set_gfxdecode_tag(device_t &device, const char *tag);
6670   static void static_set_palette_tag(device_t &device, const char *tag);
67
71   static void set_k053247_callback(device_t &device, k053247_cb_delegate callback) { downcast<k053247_device &>(device).m_k053247_cb = callback; }
72   static void set_config(device_t &device, const char *gfx_reg, int gfx_num, int order, int dx, int dy)
73   {
74      k053247_device &dev = downcast<k053247_device &>(device);
75      dev.m_memory_region = gfx_reg;
76      dev.m_gfx_num = gfx_num;
77      dev.m_plane_order = order;
78      dev.m_dx = dx;
79      dev.m_dy = dy;
80   }
81   
6882   void clear_all();
6983
7084   DECLARE_READ16_MEMBER( k055673_rom_word_r );
r31118r31119
8296   void k053247_sprites_draw( bitmap_ind16 &bitmap,const rectangle &cliprect);
8397   void k053247_sprites_draw( bitmap_rgb32 &bitmap,const rectangle &cliprect);
8498   int k053247_read_register( int regnum);
85   void k053247_set_sprite_offs( int offsx, int offsy);
8699   void k053247_set_z_rejection( int zcode); // common to k053246/7
87100   void k053247_get_ram( UINT16 **ram);
88101   int k053247_get_dx( void );
r31118r31119
113126   UINT8    m_objcha_line;
114127   int      m_z_rejection;
115128
116   k05324x_callback m_callback;
129   k053247_cb_delegate m_k053247_cb;
117130
131   //FIXME: device should be updated to use device_gfx_interface to get rid of most of these!
118132   const char *m_memory_region;
133   int m_gfx_num;
134   int m_plane_order;
119135   required_device<gfxdecode_device> m_gfxdecode;
120136   required_device<palette_device> m_palette;
121137
122138   /* alt implementation - to be collapsed */
123   void alt_k055673_vh_start(running_machine &machine, const char *gfx_memory_region, int alt_layout, int dx, int dy,
124         void (*callback)(running_machine &machine, int *code,int *color,int *priority));
125
126   void alt_k053247_export_config(void (**callback)(running_machine &, int *, int *, int *));
127
128139   void zdrawgfxzoom32GP(
129140      bitmap_rgb32 &bitmap, const rectangle &cliprect,
130141      UINT32 code, UINT32 color, int flipx, int flipy, int sx, int sy,
r31118r31119
469480
470481protected:
471482   // device-level overrides
472   virtual void device_config_complete();
473483   virtual void device_start();
474484   virtual void device_reset();
475485private:
r31118r31119
487497
488498protected:
489499   // device-level overrides
490//  virtual void device_config_complete();
491500   virtual void device_start();
492501//  virtual void device_reset();
493502private:
r31118r31119
497506extern const device_type K055673;
498507
499508
500#define MCFG_K053246_ADD(_tag, _interface) \
501   MCFG_DEVICE_ADD(_tag, K053246, 0) \
502   MCFG_DEVICE_CONFIG(_interface)
503
504509#define MCFG_K053246_SET_SCREEN MCFG_VIDEO_SET_SCREEN
505510
506511#define MCFG_K053246_GFXDECODE(_gfxtag) \
r31118r31119
510515   k053247_device::static_set_palette_tag(*device, "^" _palette_tag);
511516
512517
513#define MCFG_K055673_ADD(_tag, _interface) \
514   MCFG_DEVICE_ADD(_tag, K055673, 0) \
515   MCFG_DEVICE_CONFIG(_interface)
516
517#define MCFG_K055673_ADD_NOINTF(_tag ) \
518   MCFG_DEVICE_ADD(_tag, K055673, 0)
519
520518#define MCFG_K055673_SET_SCREEN MCFG_VIDEO_SET_SCREEN
521519
522520#define MCFG_K055673_GFXDECODE(_gfxtag) \
r31118r31119
526524   k055673_device::static_set_palette_tag(*device, "^" _palette_tag);
527525
528526
529/* old non-device stuff */
530
531
532
533
534
535
536527#endif
trunk/src/mame/video/xmen.c
r31118r31119
2323
2424***************************************************************************/
2525
26void xmen_sprite_callback( running_machine &machine, int *code, int *color, int *priority_mask )
26K053246_CB_MEMBER(xmen_state::sprite_callback)
2727{
28   xmen_state *state = machine.driver_data<xmen_state>();
2928   int pri = (*color & 0x00e0) >> 4;   /* ??????? */
3029
31   if (pri <= state->m_layerpri[2])
30   if (pri <= m_layerpri[2])
3231      *priority_mask = 0;
33   else if (pri > state->m_layerpri[2] && pri <= state->m_layerpri[1])
32   else if (pri > m_layerpri[2] && pri <= m_layerpri[1])
3433      *priority_mask = 0xf0;
35   else if (pri > state->m_layerpri[1] && pri <= state->m_layerpri[0])
34   else if (pri > m_layerpri[1] && pri <= m_layerpri[0])
3635      *priority_mask = 0xf0 | 0xcc;
3736   else
3837      *priority_mask = 0xf0 | 0xcc | 0xaa;
3938
40   *color = state->m_sprite_colorbase + (*color & 0x001f);
39   *color = m_sprite_colorbase + (*color & 0x001f);
4140}
4241
4342
trunk/src/mame/video/simpsons.c
r31118r31119
2020
2121***************************************************************************/
2222
23void simpsons_sprite_callback( running_machine &machine, int *code, int *color, int *priority_mask )
23K053246_CB_MEMBER(simpsons_state::sprite_callback)
2424{
25   simpsons_state *state = machine.driver_data<simpsons_state>();
2625   int pri = (*color & 0x0f80) >> 6;   /* ??????? */
2726
28   if (pri <= state->m_layerpri[2])
27   if (pri <= m_layerpri[2])
2928      *priority_mask = 0;
30   else if (pri > state->m_layerpri[2] && pri <= state->m_layerpri[1])
29   else if (pri > m_layerpri[2] && pri <= m_layerpri[1])
3130      *priority_mask = 0xf0;
32   else if (pri > state->m_layerpri[1] && pri <= state->m_layerpri[0])
31   else if (pri > m_layerpri[1] && pri <= m_layerpri[0])
3332      *priority_mask = 0xf0 | 0xcc;
3433   else
3534      *priority_mask = 0xf0 | 0xcc | 0xaa;
3635
37   *color = state->m_sprite_colorbase + (*color & 0x001f);
36   *color = m_sprite_colorbase + (*color & 0x001f);
3837}
3938
4039
trunk/src/mame/video/xexex.c
r31118r31119
11#include "emu.h"
22#include "includes/xexex.h"
33
4void xexex_sprite_callback( running_machine &machine, int *code, int *color, int *priority_mask )
4K053246_CB_MEMBER(xexex_state::sprite_callback)
55{
6   xexex_state *state = machine.driver_data<xexex_state>();
7   int pri;
8
96   // Xexex doesn't seem to use bit8 and 9 as effect selectors so this should be safe.
107   // (pdrawgfx() still needs change to fix Elaine's end-game graphics)
11   pri = (*color & 0x3e0) >> 4;
8   int pri = (*color & 0x3e0) >> 4;
129
13   if (pri <= state->m_layerpri[3])
10   if (pri <= m_layerpri[3])
1411      *priority_mask = 0;
15   else if (pri > state->m_layerpri[3] && pri <= state->m_layerpri[2])
12   else if (pri > m_layerpri[3] && pri <= m_layerpri[2])
1613      *priority_mask = 0xff00;
17   else if (pri > state->m_layerpri[2] && pri <= state->m_layerpri[1])
14   else if (pri > m_layerpri[2] && pri <= m_layerpri[1])
1815      *priority_mask = 0xff00 | 0xf0f0;
19   else if (pri > state->m_layerpri[1] && pri <= state->m_layerpri[0])
16   else if (pri > m_layerpri[1] && pri <= m_layerpri[0])
2017      *priority_mask = 0xff00 | 0xf0f0 | 0xcccc;
2118   else
2219      *priority_mask = 0xff00 | 0xf0f0 | 0xcccc | 0xaaaa;
2320
24   *color = state->m_sprite_colorbase | (*color & 0x001f);
21   *color = m_sprite_colorbase | (*color & 0x001f);
2522}
2623
2724K056832_CB_MEMBER(xexex_state::tile_callback)
trunk/src/mame/video/moo.c
r31118r31119
1111#include "emu.h"
1212#include "includes/moo.h"
1313
14void moo_sprite_callback( running_machine &machine, int *code, int *color, int *priority_mask )
14K053246_CB_MEMBER(moo_state::sprite_callback)
1515{
16   moo_state *state = machine.driver_data<moo_state>();
1716   int pri = (*color & 0x03e0) >> 4;
1817
19   if (pri <= state->m_layerpri[2])
18   if (pri <= m_layerpri[2])
2019      *priority_mask = 0;
21   else if (pri <= state->m_layerpri[1])
20   else if (pri <= m_layerpri[1])
2221      *priority_mask = 0xf0;
23   else if (pri <= state->m_layerpri[0])
22   else if (pri <= m_layerpri[0])
2423      *priority_mask = 0xf0|0xcc;
2524   else
2625      *priority_mask = 0xf0|0xcc|0xaa;
2726
28   *color = state->m_sprite_colorbase | (*color & 0x001f);
27   *color = m_sprite_colorbase | (*color & 0x001f);
2928}
3029
3130K056832_CB_MEMBER(moo_state::tile_callback)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team