Previous 199869 Revisions Next

r31114 Thursday 26th June, 2014 at 07:22:24 UTC by Fabio Priuli
k056832: updated to use delegates and inline configs. nw.

these changes are mostly driver-level, so I think they should not conflict
with anyone else's work. the only relevant change for the device code
is the removal of altK056832_vh_start. no further work on this chip is
planned (it requires major rework)
[src/mame/drivers]asterix.c bishi.c dbz.c djmain.c gijoe.c konamigx.c lethal.c moo.c mystwarr.c qdrmfgp.c tasman.c xexex.c zr107.c
[src/mame/includes]asterix.h bishi.h dbz.h djmain.h gijoe.h konamigx.h lethal.h moo.h mystwarr.h qdrmfgp.h xexex.h
[src/mame/video]asterix.c bishi.c dbz.c djmain.c gijoe.c k054156_k054157_k056832.c k054156_k054157_k056832.h konamigx.c lethal.c moo.c mystwarr.c qdrmfgp.c xexex.c

trunk/src/mame/drivers/asterix.c
r31113r31114
215215INPUT_PORTS_END
216216
217217
218static const k056832_interface asterix_k056832_intf =
219{
220   "gfx1", 0,
221   K056832_BPP_4,
222   1, 1,
223   asterix_tile_callback, "none"
224};
225
226218void asterix_state::machine_start()
227219{
228220   save_item(NAME(m_cur_control2));
r31113r31114
238230
239231void asterix_state::machine_reset()
240232{
241   int i;
242
243233   m_cur_control2 = 0;
244234   m_prot[0] = 0;
245235   m_prot[1] = 0;
r31113r31114
250240   m_layerpri[1] = 0;
251241   m_layerpri[2] = 0;
252242
253   for (i = 0; i < 4; i++)
243   for (int i = 0; i < 4; i++)
254244   {
255245      m_layer_colorbase[i] = 0;
256246      m_tilebanks[i] = 0;
r31113r31114
284274   MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
285275
286276   MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty)
287   MCFG_K056832_ADD("k056832", asterix_k056832_intf)
277
278   MCFG_DEVICE_ADD("k056832", K056832, 0)
279   MCFG_K056832_CB(asterix_state, tile_callback)
280   MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_4, 1, 1, "none")
288281   MCFG_K056832_GFXDECODE("gfxdecode")
289282   MCFG_K056832_PALETTE("palette")
290283
trunk/src/mame/drivers/lethal.c
r31113r31114
491491   m_bank4800->set_bank(0);
492492}
493493
494static const k056832_interface lethalen_k056832_intf =
495{
496   "gfx1", 0,
497   K056832_BPP_8LE,
498   1, 0,
499   lethalen_tile_callback, "none"
500};
501
502
503494static MACHINE_CONFIG_START( lethalen, lethal_state )
504495
505496   /* basic machine hardware */
r31113r31114
534525   MCFG_PALETTE_ENABLE_SHADOWS()
535526   MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
536527
537   MCFG_K056832_ADD("k056832", lethalen_k056832_intf)
528   MCFG_DEVICE_ADD("k056832", K056832, 0)
529   MCFG_K056832_CB(lethal_state, tile_callback)
530   MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_8LE, 1, 0, "none")
538531   MCFG_K056832_GFXDECODE("gfxdecode")
539532   MCFG_K056832_PALETTE("palette")
540533
trunk/src/mame/drivers/bishi.c
r31113r31114
363363}
364364
365365
366static const k056832_interface bishi_k056832_intf =
367{
368   "gfx1", 0,
369   K056832_BPP_8,
370   1, 0,
371   bishi_tile_callback, "none"
372};
373
374366void bishi_state::machine_start()
375367{
376368   save_item(NAME(m_cur_control));
r31113r31114
390382   MCFG_CPU_PROGRAM_MAP(main_map)
391383   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", bishi_state, bishi_scanline, "screen", 0, 1)
392384
393
394385   /* video hardware */
395386   MCFG_SCREEN_ADD("screen", RASTER)
396387   MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK)
r31113r31114
406397   MCFG_PALETTE_ENABLE_HILIGHTS()
407398
408399   MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty)
409   MCFG_K056832_ADD("k056832", bishi_k056832_intf)
400
401   MCFG_DEVICE_ADD("k056832", K056832, 0)
402   MCFG_K056832_CB(bishi_state, tile_callback)
403   MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_8, 1, 0, "none")
410404   MCFG_K056832_GFXDECODE("gfxdecode")
411405   MCFG_K056832_PALETTE("palette")
412406
trunk/src/mame/drivers/gijoe.c
r31113r31114
295295   NULL,
296296};
297297
298static const k056832_interface gijoe_k056832_intf =
299{
300   "gfx1", 0,
301   K056832_BPP_4,
302   1, 0,
303   gijoe_tile_callback, "none"
304};
305
306298static const k053247_interface gijoe_k053247_intf =
307299{
308300   "gfx2", 1,
r31113r31114
350342   MCFG_PALETTE_ENABLE_SHADOWS()
351343
352344   MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty)
353   MCFG_K056832_ADD("k056832", gijoe_k056832_intf)
345
346   MCFG_DEVICE_ADD("k056832", K056832, 0)
347   MCFG_K056832_CB(gijoe_state, tile_callback)
348   MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_4, 1, 0, "none")
354349   MCFG_K056832_GFXDECODE("gfxdecode")
355350   MCFG_K056832_PALETTE("palette")
351
356352   MCFG_K053246_ADD("k053246", gijoe_k053247_intf)
357353   MCFG_K053246_GFXDECODE("gfxdecode")
358354   MCFG_K053246_PALETTE("palette")
trunk/src/mame/drivers/qdrmfgp.c
r31113r31114
547547 *
548548 *************************************/
549549
550static const k056832_interface qdrmfgp_k056832_intf =
551{
552   "gfx1", 0,
553   K056832_BPP_4dj,
554   1, 0,
555   qdrmfgp_tile_callback, "none"
556};
557
558static const k056832_interface qdrmfgp2_k056832_intf =
559{
560   "gfx1", 0,
561   K056832_BPP_4dj,
562   1, 0,
563   qdrmfgp2_tile_callback, "none"
564};
565
566550MACHINE_START_MEMBER(qdrmfgp_state,qdrmfgp)
567551{
568552   save_item(NAME(m_control));
r31113r31114
620604   MCFG_VIDEO_START_OVERRIDE(qdrmfgp_state,qdrmfgp)
621605
622606   MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty)
623   MCFG_K056832_ADD("k056832", qdrmfgp_k056832_intf)
607
608   MCFG_DEVICE_ADD("k056832", K056832, 0)
609   MCFG_K056832_CB(qdrmfgp_state, qdrmfgp_tile_callback)
610   MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_4dj, 1, 0, "none")
624611   MCFG_K056832_GFXDECODE("gfxdecode")
625612   MCFG_K056832_PALETTE("palette")
626613
r31113r31114
664651   MCFG_VIDEO_START_OVERRIDE(qdrmfgp_state,qdrmfgp2)
665652
666653   MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty)
667   MCFG_K056832_ADD("k056832", qdrmfgp2_k056832_intf)
654
655   MCFG_DEVICE_ADD("k056832", K056832, 0)
656   MCFG_K056832_CB(qdrmfgp_state, qdrmfgp2_tile_callback)
657   MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_4dj, 1, 0, "none")
668658   MCFG_K056832_GFXDECODE("gfxdecode")
669659   MCFG_K056832_PALETTE("palette")
670660
trunk/src/mame/drivers/moo.c
r31113r31114
514514   m_sprite_colorbase = 0;
515515}
516516
517static const k056832_interface moo_k056832_intf =
518{
519   "gfx1", 0,
520   K056832_BPP_4,
521   1, 0,
522   moo_tile_callback, "none"
523};
524
525517static const k053247_interface moo_k053247_intf =
526518{
527519   "gfx2", 1,
r31113r31114
578570   MCFG_K053246_ADD("k053246", moo_k053247_intf)
579571   MCFG_K053246_GFXDECODE("gfxdecode")
580572   MCFG_K053246_PALETTE("palette")
581   MCFG_K056832_ADD("k056832", moo_k056832_intf)
573
574   MCFG_DEVICE_ADD("k056832", K056832, 0)
575   MCFG_K056832_CB(moo_state, tile_callback)
576   MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_4, 1, 0, "none")
582577   MCFG_K056832_GFXDECODE("gfxdecode")
583578   MCFG_K056832_PALETTE("palette")
584579
r31113r31114
630625   MCFG_K053246_ADD("k053246", moo_k053247_intf)
631626   MCFG_K053246_GFXDECODE("gfxdecode")
632627   MCFG_K053246_PALETTE("palette")
633   MCFG_K056832_ADD("k056832", moo_k056832_intf)
628
629   MCFG_DEVICE_ADD("k056832", K056832, 0)
630   MCFG_K056832_CB(moo_state, tile_callback)
631   MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_4, 1, 0, "none")
634632   MCFG_K056832_GFXDECODE("gfxdecode")
635633   MCFG_K056832_PALETTE("palette")
636634
trunk/src/mame/drivers/xexex.c
r31113r31114
454454   ym_set_mixing
455455};
456456
457static const k056832_interface xexex_k056832_intf =
458{
459   "gfx1", 0,
460   K056832_BPP_4,
461   1, 0,
462   xexex_tile_callback, "none"
463};
464
465457static const k053247_interface xexex_k053246_intf =
466458{
467459   "gfx2", 1,
r31113r31114
543535   MCFG_PALETTE_ENABLE_HILIGHTS()
544536
545537   MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty)
546   MCFG_K056832_ADD("k056832", xexex_k056832_intf)
538
539   MCFG_DEVICE_ADD("k056832", K056832, 0)
540   MCFG_K056832_CB(xexex_state, tile_callback)
541   MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_4, 1, 0, "none")
547542   MCFG_K056832_GFXDECODE("gfxdecode")
548543   MCFG_K056832_PALETTE("palette")
544
549545   MCFG_K053246_ADD("k053246", xexex_k053246_intf)
550546   MCFG_K053246_GFXDECODE("gfxdecode")
551547   MCFG_K053246_PALETTE("palette")
trunk/src/mame/drivers/dbz.c
r31113r31114
289289
290290/**********************************************************************************/
291291
292static const k056832_interface dbz_k056832_intf =
293{
294   "gfx1", 2,
295   K056832_BPP_4,
296   1, 1,
297   dbz_tile_callback, "none"
298};
299
300292static const k053247_interface dbz_k053246_intf =
301293{
302294   "gfx2", 3,
r31113r31114
343335   MCFG_CPU_PROGRAM_MAP(dbz_sound_map)
344336   MCFG_CPU_IO_MAP(dbz_sound_io_map)
345337
346
347338   /* video hardware */
348339   MCFG_SCREEN_ADD("screen", RASTER)
349340   MCFG_SCREEN_REFRESH_RATE(55)
r31113r31114
359350   MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
360351   MCFG_PALETTE_ENABLE_SHADOWS()
361352
362   MCFG_K056832_ADD("k056832", dbz_k056832_intf)
353   MCFG_DEVICE_ADD("k056832", K056832, 0)
354   MCFG_K056832_CB(dbz_state, tile_callback)
355   MCFG_K056832_CONFIG("gfx1", 2, K056832_BPP_4, 1, 1, "none")
363356   MCFG_K056832_GFXDECODE("gfxdecode")
364357   MCFG_K056832_PALETTE("palette")
365358
trunk/src/mame/drivers/djmain.c
r31113r31114
13901390 *
13911391 *************************************/
13921392
1393static const k056832_interface djmain_k056832_intf =
1394{
1395   "gfx2", 1,
1396   K056832_BPP_4dj,
1397   1, 1,
1398   djmain_tile_callback, "none"
1399};
1400
14011393static MACHINE_CONFIG_START( djmain, djmain_state )
14021394
14031395   /* basic machine hardware */
r31113r31114
14071399   MCFG_CPU_PROGRAM_MAP(memory_map)
14081400   MCFG_CPU_VBLANK_INT_DRIVER("screen", djmain_state,  vb_interrupt)
14091401
1410
14111402   MCFG_ATA_INTERFACE_ADD("ata", ata_devices, "hdd", NULL, true)
14121403   MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE(djmain_state, ide_interrupt))
14131404
r31113r31114
14221413   MCFG_PALETTE_ADD("palette", 0x4440/4)
14231414   MCFG_GFXDECODE_ADD("gfxdecode", "palette", djmain)
14241415
1425   MCFG_K056832_ADD("k056832", djmain_k056832_intf)
1416   MCFG_DEVICE_ADD("k056832", K056832, 0)
1417   MCFG_K056832_CB(djmain_state, tile_callback)
1418   MCFG_K056832_CONFIG("gfx2", 1, K056832_BPP_4dj, 1, 1, "none")
14261419   MCFG_K056832_GFXDECODE("gfxdecode")
14271420   MCFG_K056832_PALETTE("palette")
1421
14281422   MCFG_K055555_ADD("k055555")
14291423
14301424   /* sound hardware */
trunk/src/mame/drivers/zr107.c
r31113r31114
253253   INTERRUPT_GEN_MEMBER(zr107_vblank);
254254   WRITE_LINE_MEMBER(k054539_irq_gen);
255255   ADC083X_INPUT_CB(adc0838_callback);
256   K056832_CB_MEMBER(tile_callback);
256257
257258protected:
258259   virtual void machine_start();
r31113r31114
298299
299300#define NUM_LAYERS  2
300301
301static void game_tile_callback(running_machine &machine, int layer, int *code, int *color, int *flags)
302K056832_CB_MEMBER(zr107_state::tile_callback)
302303{
303304   *color += layer * 0x40;
304305}
r31113r31114
737738}
738739
739740
740static const k056832_interface zr107_k056832_intf =
741{
742   "gfx2", 1,
743   K056832_BPP_8,
744   1, 0,
745   game_tile_callback, "none"
746};
747
748741/* PowerPC interrupts
749742
750743    IRQ0:  Vblank
r31113r31114
796789
797790   MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty)
798791
799   MCFG_K056832_ADD("k056832", zr107_k056832_intf)
792   MCFG_DEVICE_ADD("k056832", K056832, 0)
793   MCFG_K056832_CB(zr107_state, tile_callback)
794   MCFG_K056832_CONFIG("gfx2", 1, K056832_BPP_8, 1, 0, "none")
800795   MCFG_K056832_GFXDECODE("gfxdecode")
801796   MCFG_K056832_PALETTE("palette")
802797
trunk/src/mame/drivers/tasman.c
r31113r31114
4040   DECLARE_VIDEO_START(kongambl);
4141   UINT32 screen_update_kongambl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
4242   TIMER_DEVICE_CALLBACK_MEMBER(kongambl_vblank);
43   K056832_CB_MEMBER(tile_callback);
4344};
4445
4546
r31113r31114
538539}
539540
540541
541static void kongambl_tile_callback( running_machine &machine, int layer, int *code, int *color, int *flags )
542K056832_CB_MEMBER(kongambl_state::tile_callback)
542543{
543544}
544545
r31113r31114
560561GFXDECODE_END
561562
562563
563static const k056832_interface k056832_intf =
564{
565   "gfx1", 0,
566   K056832_BPP_8TASMAN,
567   0, 0,
568   kongambl_tile_callback, "none"
569};
570
571
572564static const k053247_interface k053247_intf =
573565{
574566   "gfx2", 1,
r31113r31114
621613
622614   MCFG_GFXDECODE_ADD("gfxdecode", "palette", tasman)
623615
624   MCFG_K056832_ADD("k056832", k056832_intf)
616   MCFG_DEVICE_ADD("k056832", K056832, 0)
617   MCFG_K056832_CB(kongambl_state, tile_callback)
618   MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_8TASMAN, 0, 0, "none")
625619   MCFG_K056832_GFXDECODE("gfxdecode")
626620   MCFG_K056832_PALETTE("palette")
627621
trunk/src/mame/drivers/mystwarr.c
r31113r31114
10061006   MCFG_PALETTE_ENABLE_SHADOWS()
10071007   MCFG_PALETTE_ENABLE_HILIGHTS()
10081008
1009   MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty)
10091010
1010   MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty)
1011   MCFG_K056832_ADD_NOINTF("k056832"/*, mystwarr_k056832_intf*/)
1011   MCFG_DEVICE_ADD("k056832", K056832, 0)
1012   MCFG_K056832_CB(mystwarr_state, mystwarr_tile_callback)
1013   MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_5, 0, 0, "none")
10121014   MCFG_K056832_GFXDECODE("gfxdecode")
10131015   MCFG_K056832_PALETTE("palette")
1016
10141017   MCFG_K055555_ADD("k055555")
1018
10151019   MCFG_K055673_ADD_NOINTF("k055673")
10161020   MCFG_K055673_GFXDECODE("gfxdecode")
10171021   MCFG_K055673_PALETTE("palette")
r31113r31114
10571061   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(900))
10581062   MCFG_SCREEN_SIZE(64*8, 32*8)
10591063   MCFG_SCREEN_VISIBLE_AREA(40, 40+384-1, 16, 16+224-1)
1064
1065   MCFG_DEVICE_MODIFY("k056832")
1066   MCFG_K056832_CB(mystwarr_state, game4bpp_tile_callback)
10601067MACHINE_CONFIG_END
10611068
10621069static MACHINE_CONFIG_DERIVED( metamrph, mystwarr )
r31113r31114
10831090   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(900))
10841091   MCFG_SCREEN_SIZE(64*8, 32*8)
10851092   MCFG_SCREEN_VISIBLE_AREA(24, 24+288-1, 15, 15+224-1)
1093
1094   MCFG_DEVICE_MODIFY("k056832")
1095   MCFG_K056832_CB(mystwarr_state, game4bpp_tile_callback)
10861096MACHINE_CONFIG_END
10871097
10881098static MACHINE_CONFIG_DERIVED( dadandrn, mystwarr )
r31113r31114
11091119   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(600))
11101120   MCFG_SCREEN_SIZE(64*8, 32*8)
11111121   MCFG_SCREEN_VISIBLE_AREA(24, 24+288-1, 17, 17+224-1)
1122
1123   MCFG_DEVICE_MODIFY("k056832")
1124   MCFG_K056832_CB(mystwarr_state, game5bpp_tile_callback)
11121125MACHINE_CONFIG_END
11131126
11141127static MACHINE_CONFIG_DERIVED( gaiapols, mystwarr )
r31113r31114
11381151   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(600))
11391152   MCFG_SCREEN_SIZE(64*8, 32*8)
11401153   MCFG_SCREEN_VISIBLE_AREA(40, 40+376-1, 16, 16+224-1)
1154
1155   MCFG_DEVICE_MODIFY("k056832")
1156   MCFG_K056832_CB(mystwarr_state, game4bpp_tile_callback)
11411157MACHINE_CONFIG_END
11421158
11431159static MACHINE_CONFIG_DERIVED( martchmp, mystwarr )
r31113r31114
11661182   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
11671183   MCFG_SCREEN_SIZE(64*8, 32*8)
11681184   MCFG_SCREEN_VISIBLE_AREA(32, 32+384-1, 16, 16+224-1)
1185
1186   MCFG_DEVICE_MODIFY("k056832")
1187   MCFG_K056832_CB(mystwarr_state, game5bpp_tile_callback)
11691188MACHINE_CONFIG_END
11701189
11711190/**********************************************************************************/
trunk/src/mame/drivers/konamigx.c
r31113r31114
16331633   MCFG_PALETTE_ENABLE_HILIGHTS()
16341634
16351635   MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty)
1636   MCFG_K056832_ADD_NOINTF("k056832"/*, konamigx_k056832_intf*/)
1636
1637   MCFG_DEVICE_ADD("k056832", K056832, 0)
1638   MCFG_K056832_CB(konamigx_state, type2_tile_callback)
1639   MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_5, 0, 0, "none")
16371640   MCFG_K056832_GFXDECODE("gfxdecode")
16381641   MCFG_K056832_PALETTE("palette")
1642
16391643   MCFG_K055555_ADD("k055555")
16401644
16411645   MCFG_DEVICE_ADD("k054338", K054338, 0)
r31113r31114
16741678   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
16751679MACHINE_CONFIG_END
16761680
1681static MACHINE_CONFIG_DERIVED( sexyparo, konamigx )
1682   MCFG_DEVICE_MODIFY("k056832")
1683   MCFG_K056832_CB(konamigx_state, alpha_tile_callback)
1684MACHINE_CONFIG_END
1685
1686static MACHINE_CONFIG_DERIVED( tbyahhoo, konamigx )
1687   MCFG_DEVICE_MODIFY("k056832")
1688   MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_5, 0, 0, "k055555")
1689MACHINE_CONFIG_END
1690
16771691static MACHINE_CONFIG_DERIVED( dragoonj, konamigx )
16781692   MCFG_SCREEN_MODIFY("screen")
16791693   MCFG_SCREEN_VISIBLE_AREA(40, 40+384-1, 16, 16+224-1)
16801694   MCFG_VIDEO_START_OVERRIDE(konamigx_state,dragoonj)
1695
1696   MCFG_DEVICE_MODIFY("k056832")
1697   MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_5, 1, 0, "none")
16811698MACHINE_CONFIG_END
16821699
16831700static MACHINE_CONFIG_DERIVED( le2, konamigx )
16841701   MCFG_VIDEO_START_OVERRIDE(konamigx_state,le2)
1702
1703   MCFG_DEVICE_MODIFY("k056832")
1704   MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_8, 1, 0, "none")
16851705MACHINE_CONFIG_END
16861706
16871707static MACHINE_CONFIG_DERIVED( konamigx_6bpp, konamigx )
16881708   MCFG_VIDEO_START_OVERRIDE(konamigx_state,konamigx_6bpp)
1709
1710   MCFG_DEVICE_MODIFY("k056832")
1711   MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_6, 0, 0, "none")
16891712MACHINE_CONFIG_END
16901713
16911714static MACHINE_CONFIG_DERIVED( konamigx_6bpp_2, konamigx )
16921715   MCFG_VIDEO_START_OVERRIDE(konamigx_state,konamigx_6bpp_2)
1716
1717   MCFG_DEVICE_MODIFY("k056832")
1718   MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_6, 1, 0, "none")
16931719MACHINE_CONFIG_END
16941720
16951721static MACHINE_CONFIG_DERIVED( opengolf, konamigx )
r31113r31114
17131739   MCFG_GFXDECODE_MODIFY("gfxdecode", racinfrc)
17141740   MCFG_VIDEO_START_OVERRIDE(konamigx_state,racinfrc)
17151741
1742   MCFG_DEVICE_MODIFY("k056832")
1743   MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_6, 0, 0, "none")
1744
17161745   MCFG_CPU_MODIFY("maincpu")
17171746   MCFG_CPU_PROGRAM_MAP(gx_type1_map)
17181747
r31113r31114
17301759
17311760   MCFG_VIDEO_START_OVERRIDE(konamigx_state,konamigx_type3)
17321761
1762   MCFG_DEVICE_MODIFY("k056832")
1763   MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_6, 0, 0, "none")
17331764
17341765   MCFG_PALETTE_MODIFY("palette")
17351766   MCFG_PALETTE_ENTRIES(16384)
r31113r31114
17801811
17811812   MCFG_GFXDECODE_MODIFY("gfxdecode", type4)
17821813   MCFG_VIDEO_START_OVERRIDE(konamigx_state,konamigx_type4)
1814
1815   MCFG_DEVICE_MODIFY("k056832")
1816   MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_8, 0, 0, "none")
17831817MACHINE_CONFIG_END
17841818
17851819static MACHINE_CONFIG_DERIVED( gxtype4_vsn, gxtype4 )
1786
17871820   MCFG_DEFAULT_LAYOUT(layout_dualhsxs)
17881821
17891822   MCFG_SCREEN_MODIFY("screen")
r31113r31114
17951828   MCFG_SCREEN_VISIBLE_AREA(0, 576-1, 16, 32*8-1-16)
17961829
17971830   MCFG_VIDEO_START_OVERRIDE(konamigx_state,konamigx_type4_vsn)
1831
1832   MCFG_DEVICE_MODIFY("k056832")
1833   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
17981834MACHINE_CONFIG_END
17991835
18001836static MACHINE_CONFIG_DERIVED( gxtype4sd2, gxtype4 )
1801
18021837   MCFG_VIDEO_START_OVERRIDE(konamigx_state,konamigx_type4_sd2)
18031838MACHINE_CONFIG_END
18041839
18051840
18061841
18071842static MACHINE_CONFIG_DERIVED( winspike, konamigx )
1808
18091843   MCFG_SCREEN_MODIFY("screen")
18101844   MCFG_SCREEN_VISIBLE_AREA(38, 38+384-1, 16, 16+224-1)
18111845   MCFG_VIDEO_START_OVERRIDE(konamigx_state,winspike)
1846
1847   MCFG_DEVICE_MODIFY("k056832")
1848   MCFG_K056832_CB(konamigx_state, alpha_tile_callback)
1849   MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_8, 0, 2, "none")
18121850MACHINE_CONFIG_END
18131851
18141852
r31113r31114
37703808GAME( 1994, crzcross, konamigx, konamigx, puzldama, konamigx_state, konamigx, ROT0, "Konami", "Crazy Cross (ver EAA)", GAME_IMPERFECT_GRAPHICS )
37713809GAME( 1994, puzldama, crzcross, konamigx, puzldama, konamigx_state, konamigx, ROT0, "Konami", "Taisen Puzzle-dama (ver JAA)", GAME_IMPERFECT_GRAPHICS )
37723810
3773GAME( 1995, tbyahhoo, konamigx, konamigx, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Twin Bee Yahhoo! (ver JAA)", GAME_IMPERFECT_GRAPHICS )
3811GAME( 1995, tbyahhoo, konamigx, tbyahhoo, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Twin Bee Yahhoo! (ver JAA)", GAME_IMPERFECT_GRAPHICS )
37743812
37753813GAME( 1995, tkmmpzdm, konamigx, konamigx_6bpp, puzldama, konamigx_state, konamigx, ROT0, "Konami", "Tokimeki Memorial Taisen Puzzle-dama (ver JAB)", GAME_IMPERFECT_GRAPHICS )
37763814
37773815GAME( 1995, dragoona, konamigx, dragoonj, dragoonj, konamigx_state, konamigx, ROT0, "Konami", "Dragoon Might (ver AAB)", GAME_IMPERFECT_GRAPHICS )
37783816GAME( 1995, dragoonj, dragoona, dragoonj, dragoonj, konamigx_state, konamigx, ROT0, "Konami", "Dragoon Might (ver JAA)", GAME_IMPERFECT_GRAPHICS )
37793817
3780GAME( 1996, sexyparo, konamigx, konamigx, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Sexy Parodius (ver JAA)", GAME_IMPERFECT_GRAPHICS )
3781GAME( 1996, sexyparoa,sexyparo, konamigx, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Sexy Parodius (ver AAA)", GAME_IMPERFECT_GRAPHICS )
3818GAME( 1996, sexyparo, konamigx, sexyparo, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Sexy Parodius (ver JAA)", GAME_IMPERFECT_GRAPHICS )
3819GAME( 1996, sexyparoa,sexyparo, sexyparo, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Sexy Parodius (ver AAA)", GAME_IMPERFECT_GRAPHICS )
37823820
37833821GAME( 1996, daiskiss, konamigx, konamigx, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Daisu-Kiss (ver JAA)", GAME_IMPERFECT_GRAPHICS )
37843822
trunk/src/mame/includes/asterix.h
r31113r31114
6161   UINT32 screen_update_asterix(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
6262   INTERRUPT_GEN_MEMBER(asterix_interrupt);
6363   K05324X_CB_MEMBER(sprite_callback);
64   K056832_CB_MEMBER(tile_callback);
6465
6566protected:
6667   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
6768};
68
69/*----------- defined in video/asterix.c -----------*/
70
71extern void asterix_tile_callback(running_machine &machine, int layer, int *code, int *color, int *flags);
trunk/src/mame/includes/mystwarr.h
r31113r31114
9393   TIMER_DEVICE_CALLBACK_MEMBER(metamrph_interrupt);
9494   TIMER_DEVICE_CALLBACK_MEMBER(mchamp_interrupt);
9595   void reset_sound_region();
96   K056832_CB_MEMBER(mystwarr_tile_callback);
97   K056832_CB_MEMBER(game5bpp_tile_callback);
98   K056832_CB_MEMBER(game4bpp_tile_callback);
9699};
trunk/src/mame/includes/konamigx.h
r31113r31114
133133   TIMER_CALLBACK_MEMBER(boothack_callback);
134134   TIMER_DEVICE_CALLBACK_MEMBER(konamigx_hbinterrupt);
135135   ADC083X_INPUT_CB(adc0834_callback);
136   K056832_CB_MEMBER(type2_tile_callback);
137   K056832_CB_MEMBER(alpha_tile_callback);
136138
137139   void _gxcommoninitnosprites(running_machine &machine);
138140   void _gxcommoninit(running_machine &machine);
trunk/src/mame/includes/xexex.h
r31113r31114
9494   void xexex_postload();
9595   void xexex_objdma( int limiter );
9696   void parse_control2(  );
97   K056832_CB_MEMBER(tile_callback);
9798};
9899
99100/*----------- defined in video/xexex.c -----------*/
100101
101102extern void xexex_sprite_callback(running_machine &machine, int *code, int *color, int *priority_mask);
102extern void xexex_tile_callback(running_machine &machine, int layer, int *code, int *color, int *flags);
trunk/src/mame/includes/qdrmfgp.h
r31113r31114
6464   DECLARE_WRITE_LINE_MEMBER(ide_interrupt);
6565   DECLARE_WRITE_LINE_MEMBER(gp2_ide_interrupt);
6666   DECLARE_WRITE_LINE_MEMBER(k054539_irq1_gen);
67   K056832_CB_MEMBER(qdrmfgp_tile_callback);
68   K056832_CB_MEMBER(qdrmfgp2_tile_callback);
6769};
68
69/*----------- defined in video/qdrmfgp.c -----------*/
70void qdrmfgp_tile_callback(running_machine &machine, int layer, int *code, int *color, int *flags);
71void qdrmfgp2_tile_callback(running_machine &machine, int layer, int *code, int *color, int *flags);
trunk/src/mame/includes/bishi.h
r31113r31114
5656   UINT32 screen_update_bishi(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
5757   TIMER_DEVICE_CALLBACK_MEMBER(bishi_scanline);
5858   DECLARE_WRITE_LINE_MEMBER(sound_irq_gen);
59   K056832_CB_MEMBER(tile_callback);
5960};
60
61/*----------- defined in video/bishi.c -----------*/
62extern void bishi_tile_callback(running_machine &machine, int layer, int *code, int *color, int *flags);
trunk/src/mame/includes/moo.h
r31113r31114
8282   INTERRUPT_GEN_MEMBER(moobl_interrupt);
8383   TIMER_CALLBACK_MEMBER(dmaend_callback);
8484   void moo_objdma();
85   K056832_CB_MEMBER(tile_callback);
8586};
8687
8788/*----------- defined in video/moo.c -----------*/
88extern void moo_tile_callback(running_machine &machine, int layer, int *code, int *color, int *flags);
8989extern void moo_sprite_callback(running_machine &machine, int *code, int *color, int *priority_mask);
trunk/src/mame/includes/gijoe.h
r31113r31114
6060   UINT32 screen_update_gijoe(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
6161   INTERRUPT_GEN_MEMBER(gijoe_interrupt);
6262   TIMER_CALLBACK_MEMBER(dmaend_callback);
63   void gijoe_objdma(  );
63   void gijoe_objdma();
64   K056832_CB_MEMBER(tile_callback);
6465};
6566
6667/*----------- defined in video/gijoe.c -----------*/
6768extern void gijoe_sprite_callback(running_machine &machine, int *code, int *color, int *priority_mask);
68extern void gijoe_tile_callback(running_machine &machine, int layer, int *code, int *color, int *flags);
trunk/src/mame/includes/lethal.h
r31113r31114
5353   UINT32 screen_update_lethalen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5454   INTERRUPT_GEN_MEMBER(lethalen_interrupt);
5555   K05324X_CB_MEMBER(sprite_callback);
56   K056832_CB_MEMBER(tile_callback);
5657};
57
58/*----------- defined in video/lethal.c -----------*/
59extern void lethalen_tile_callback(running_machine &machine, int layer, int *code, int *color, int *flags);
trunk/src/mame/includes/djmain.h
r31113r31114
7575   required_device<gfxdecode_device> m_gfxdecode;
7676   required_device<palette_device> m_palette;
7777   required_shared_ptr<UINT32> m_generic_paletteram_32;
78   K056832_CB_MEMBER(tile_callback);
7879};
79
80/*----------- defined in video/djmain.c -----------*/
81void djmain_tile_callback(running_machine& machine, int layer, int *code, int *color, int *flags);
trunk/src/mame/includes/dbz.h
r31113r31114
7171   virtual void video_start();
7272   UINT32 screen_update_dbz(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
7373   TIMER_DEVICE_CALLBACK_MEMBER(dbz_scanline);
74   K056832_CB_MEMBER(tile_callback);
7475};
7576
7677/*----------- defined in video/dbz.c -----------*/
7778extern void dbz_sprite_callback(running_machine &machine, int *code, int *color, int *priority_mask);
78extern void dbz_tile_callback(running_machine &machine, int layer, int *code, int *color, int *flags);
trunk/src/mame/video/konamigx.c
r31113r31114
6060static bitmap_ind16 *gxtype1_roz_dstbitmap2;
6161static rectangle gxtype1_roz_dstbitmapclip;
6262
63static void (*game_tile_callback)(running_machine &machine, int layer, int *code, int *color, int *flags);
64
65
66
6763/***************************************************************************/
6864/*                                                                         */
6965/*                 1st-Tier GX/MW Variables and Functions                  */
r31113r31114
11101106   SET_TILE_INFO_MEMBER(0, tileno, colour, flip);
11111107}
11121108
1113static void konamigx_type2_tile_callback(running_machine &machine, int layer, int *code, int *color, int *flags)
1109K056832_CB_MEMBER(konamigx_state::type2_tile_callback)
11141110{
11151111   int d = *code;
11161112
r31113r31114
11181114   K055555GX_decode_vmixcolor(layer, color);
11191115}
11201116
1121static void konamigx_alpha_tile_callback(running_machine &machine, int layer, int *code, int *color, int *flags)
1117K056832_CB_MEMBER(konamigx_state::alpha_tile_callback)
11221118{
11231119   int mixcode;
11241120   int d = *code;
r31113r31114
12121208
12131209VIDEO_START_MEMBER(konamigx_state,konamigx_5bpp)
12141210{
1215   if (!strcmp(machine().system().name,"sexyparo") || !strcmp(machine().system().name,"sexyparoa"))
1216      game_tile_callback = konamigx_alpha_tile_callback;
1217   else
1218      game_tile_callback = konamigx_type2_tile_callback;
1219
1220   m_k056832->altK056832_vh_start(machine(), "gfx1", K056832_BPP_5, 0, NULL, game_tile_callback, 0);
1221
12221211   _gxcommoninit(machine());
12231212
12241213   /* here are some hand tuned per game scroll offsets to go with the per game visible areas,
r31113r31114
12261215
12271216   if (!strcmp(machine().system().name,"tbyahhoo"))
12281217   {
1229      m_k056832->K056832_set_k055555(m_k055555);
12301218      gx_tilemode = 1;
12311219   } else
12321220
r31113r31114
12541242
12551243VIDEO_START_MEMBER(konamigx_state,winspike)
12561244{
1257   m_k056832->altK056832_vh_start(machine(), "gfx1", K056832_BPP_8, 0, NULL, konamigx_alpha_tile_callback, 2);
12581245   m_k055673->alt_k055673_vh_start(machine(), "gfx2", K055673_LAYOUT_LE2, -53, -23, konamigx_type2_sprite_callback);
12591246
12601247   _gxcommoninitnosprites(machine());
r31113r31114
12621249
12631250VIDEO_START_MEMBER(konamigx_state,dragoonj)
12641251{
1265   m_k056832->altK056832_vh_start(machine(), "gfx1", K056832_BPP_5, 1, NULL, konamigx_type2_tile_callback, 0);
12661252   m_k055673->alt_k055673_vh_start(machine(), "gfx2", K055673_LAYOUT_RNG, -53, -23, konamigx_dragoonj_sprite_callback);
12671253
12681254   _gxcommoninitnosprites(machine());
r31113r31114
12751261
12761262VIDEO_START_MEMBER(konamigx_state,le2)
12771263{
1278   m_k056832->altK056832_vh_start(machine(), "gfx1", K056832_BPP_8, 1, NULL, konamigx_type2_tile_callback, 0);
12791264   m_k055673->alt_k055673_vh_start(machine(), "gfx2", K055673_LAYOUT_LE2, -46, -23, konamigx_le2_sprite_callback);
12801265
12811266   _gxcommoninitnosprites(machine());
r31113r31114
12881273
12891274VIDEO_START_MEMBER(konamigx_state,konamigx_6bpp)
12901275{
1291   m_k056832->altK056832_vh_start(machine(), "gfx1", K056832_BPP_6, 0, NULL, konamigx_type2_tile_callback, 0);
1292
12931276   _gxcommoninit(machine());
12941277
12951278   if (!strcmp(machine().system().name,"tokkae") || !strcmp(machine().system().name,"tkmmpzdm"))
r31113r31114
13031286{
13041287   int width = m_screen->width();
13051288   int height = m_screen->height();
1306
1307   m_k056832->altK056832_vh_start(machine(), "gfx1", K056832_BPP_6, 0, NULL, konamigx_type2_tile_callback, 1);
13081289   m_k055673->alt_k055673_vh_start(machine(), "gfx2", K055673_LAYOUT_GX6, -132, -23, konamigx_type2_sprite_callback);
13091290
13101291   dualscreen_left_tempbitmap = auto_bitmap_rgb32_alloc(machine(), width, height);
r31113r31114
13431324   int width = m_screen->width();
13441325   int height = m_screen->height();
13451326
1346   m_k056832->altK056832_vh_start(machine(), "gfx1", K056832_BPP_8, 0, NULL, konamigx_type2_tile_callback, 0);
13471327   m_k055673->alt_k055673_vh_start(machine(), "gfx2", K055673_LAYOUT_GX6, -79, -24, konamigx_type2_sprite_callback); // -23 looks better in intro
13481328
13491329   dualscreen_left_tempbitmap = auto_bitmap_rgb32_alloc(machine(), width, height);
r31113r31114
13741354   int width = m_screen->width();
13751355   int height = m_screen->height();
13761356
1377   m_k056832->altK056832_vh_start(machine(), "gfx1", K056832_BPP_8, 0, NULL, konamigx_type2_tile_callback, 2);   // set djmain_hack to 2 to kill layer association or half the tilemaps vanish on screen 0
13781357   m_k055673->alt_k055673_vh_start(machine(), "gfx2", K055673_LAYOUT_GX6, -132, -23, konamigx_type2_sprite_callback);
13791358
13801359   dualscreen_left_tempbitmap = auto_bitmap_rgb32_alloc(machine(), width, height);
r31113r31114
14041383   int width = m_screen->width();
14051384   int height = m_screen->height();
14061385
1407   m_k056832->altK056832_vh_start(machine(), "gfx1", K056832_BPP_8, 0, NULL, konamigx_type2_tile_callback, 0);
14081386   m_k055673->alt_k055673_vh_start(machine(), "gfx2", K055673_LAYOUT_GX6, -81, -23, konamigx_type2_sprite_callback);
14091387
14101388   dualscreen_left_tempbitmap = auto_bitmap_rgb32_alloc(machine(), width, height);
r31113r31114
14351413
14361414VIDEO_START_MEMBER(konamigx_state,konamigx_6bpp_2)
14371415{
1438   m_k056832->altK056832_vh_start(machine(), "gfx1", K056832_BPP_6, 1, NULL, konamigx_type2_tile_callback, 0);
1439
14401416   if (!strcmp(machine().system().name,"salmndr2") || !strcmp(machine().system().name,"salmndr2a"))
14411417   {
14421418      m_k055673->alt_k055673_vh_start(machine(), "gfx2", K055673_LAYOUT_GX6, -48, -23, konamigx_salmndr2_sprite_callback);
r31113r31114
14511427
14521428VIDEO_START_MEMBER(konamigx_state,opengolf)
14531429{
1454   m_k056832->altK056832_vh_start(machine(), "gfx1", K056832_BPP_5, 0, NULL, konamigx_type2_tile_callback, 0);
14551430   m_k055673->alt_k055673_vh_start(machine(), "gfx2", K055673_LAYOUT_GX6, -53, -23, konamigx_type2_sprite_callback);
14561431
14571432   _gxcommoninitnosprites(machine());
r31113r31114
14891464
14901465VIDEO_START_MEMBER(konamigx_state,racinfrc)
14911466{
1492   m_k056832->altK056832_vh_start(machine(), "gfx1", K056832_BPP_6, 0, NULL, konamigx_type2_tile_callback, 0);
14931467   m_k055673->alt_k055673_vh_start(machine(), "gfx2", K055673_LAYOUT_GX, -53, -23, konamigx_type2_sprite_callback);
14941468
14951469   _gxcommoninitnosprites(machine());
trunk/src/mame/video/xexex.c
r31113r31114
2424   *color = state->m_sprite_colorbase | (*color & 0x001f);
2525}
2626
27void xexex_tile_callback(running_machine &machine, int layer, int *code, int *color, int *flags)
27K056832_CB_MEMBER(xexex_state::tile_callback)
2828{
29   xexex_state *state = machine.driver_data<xexex_state>();
30   *color = state->m_layer_colorbase[layer] | (*color >> 2 & 0x0f);
29   *color = m_layer_colorbase[layer] | (*color >> 2 & 0x0f);
3130}
3231
3332void xexex_state::video_start()
trunk/src/mame/video/dbz.c
r31113r31114
1212#include "includes/dbz.h"
1313
1414
15void dbz_tile_callback( running_machine &machine, int layer, int *code, int *color, int *flags )
15K056832_CB_MEMBER(dbz_state::tile_callback)
1616{
17   dbz_state *state = machine.driver_data<dbz_state>();
18   *color = (state->m_layer_colorbase[layer] << 1) + ((*color & 0x3c) >> 2);
17   *color = (m_layer_colorbase[layer] << 1) + ((*color & 0x3c) >> 2);
1918}
2019
2120void dbz_sprite_callback( running_machine &machine, int *code, int *color, int *priority_mask )
trunk/src/mame/video/asterix.c
r31113r31114
3434}
3535
3636
37void asterix_tile_callback( running_machine &machine, int layer, int *code, int *color, int *flags )
37K056832_CB_MEMBER(asterix_state::tile_callback)
3838{
39   asterix_state *state = machine.driver_data<asterix_state>();
40
4139   *flags = *code & 0x1000 ? TILE_FLIPX : 0;
42   *color = (state->m_layer_colorbase[layer] + ((*code & 0xe000) >> 13)) & 0x7f;
43   *code = (*code & 0x03ff) | state->m_tilebanks[(*code >> 10) & 3];
40   *color = (m_layer_colorbase[layer] + ((*code & 0xe000) >> 13)) & 0x7f;
41   *code = (*code & 0x03ff) | m_tilebanks[(*code >> 10) & 3];
4442}
4543
4644UINT32 asterix_state::screen_update_asterix(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
trunk/src/mame/video/bishi.c
r31113r31114
1111#include "includes/bishi.h"
1212
1313
14void bishi_tile_callback( running_machine &machine, int layer, int *code, int *color, int *flags )
14K056832_CB_MEMBER(bishi_state::tile_callback)
1515{
16   bishi_state *state = machine.driver_data<bishi_state>();
17
1816//  *code -= '0';
19//  *color = state->m_layer_colorbase[layer] | (*color>>2 & 0x0f);
17//  *color = m_layer_colorbase[layer] | (*color>>2 & 0x0f);
2018//  K055555GX_decode_vmixcolor(layer, color);
2119//  if (*color) osd_printf_debug("plane %x col %x [55 %x %x]\n", layer, *color, layer_colorbase[layer], K055555_get_palette_index(layer));
2220
23   *color = state->m_layer_colorbase[layer] + ((*color & 0xf0));
21   *color = m_layer_colorbase[layer] + ((*color & 0xf0));
2422}
2523
2624void bishi_state::video_start()
trunk/src/mame/video/lethal.c
r31113r31114
4040   *code = (*code & 0x3fff); // | spritebanks[(*code >> 12) & 3];
4141}
4242
43void lethalen_tile_callback( running_machine &machine, int layer, int *code, int *color, int *flags )
43K056832_CB_MEMBER(lethal_state::tile_callback)
4444{
45   lethal_state *state = machine.driver_data<lethal_state>();
46   *color = state->m_layer_colorbase[layer] + ((*color & 0x3c) << 2);
45   *color = m_layer_colorbase[layer] + ((*color & 0x3c) << 2);
4746}
4847
4948void lethal_state::video_start()
trunk/src/mame/video/djmain.c
r31113r31114
127127}
128128
129129
130void djmain_tile_callback(running_machine& machine, int layer, int *code, int *color, int *flags)
130K056832_CB_MEMBER(djmain_state::tile_callback)
131131{
132132}
133133
trunk/src/mame/video/k054156_k054157_k056832.c
r31113r31114
189189   m_videoram(NULL),
190190   m_num_gfx_banks(0),
191191   m_cur_gfx_banks(0),
192   m_rom_half(0),
192   m_gfx_memory_region(NULL),
193   m_gfx_num(0),
194   m_bpp(-1),
195   m_big(0),
196   m_djmain_hack(0),
197   m_k055555_tag(NULL),
193198   //m_layer_assoc_with_page[K056832_PAGE_COUNT],
194199   //m_layer_offs[8][2],
195200   //m_lsram_page[8][2],
r31113r31114
213218   m_use_ext_linescroll(0),
214219   m_uses_tile_banks(0),
215220   m_cur_tile_bank(0),
216   m_k055555(0),
221   m_k055555(NULL),
217222   m_gfxdecode(*this),
218223   m_palette(*this)
219224{
r31113r31114
240245   downcast<k056832_device &>(device).m_palette.set_tag(tag);
241246}
242247
243//-------------------------------------------------
244//  device_config_complete - perform any
245//  operations now that the configuration is
246//  complete
247//-------------------------------------------------
248
249void k056832_device::device_config_complete()
250{
251   // inherit a copy of the static data
252   const k056832_interface *intf = reinterpret_cast<const k056832_interface *>(static_config());
253   if (intf != NULL)
254   *static_cast<k056832_interface *>(this) = *intf;
255
256   // or initialize to defaults if none provided
257   else
258   {
259   m_gfx_memory_region = "";
260   m_gfx_num = 0;
261   m_bpp = -1;
262   m_big = 0;
263   m_djmain_hack = 0;
264   m_callback = NULL;
265   m_k055555_tag = "";
266   };
267}
268
269248void k056832_device::create_tilemaps(running_machine &machine)
270249{
271250   tilemap_t *tmap;
r31113r31114
387366   memset(m_regs,     0x00, sizeof(m_regs) );
388367   memset(m_regsb,    0x00, sizeof(m_regsb) );
389368
390   // for non-interface cases we still use the vh_start call
391   if (m_bpp == -1)
392      return;
369   if (m_k055555_tag)
370      m_k055555 = machine().device<k055555_device>(m_k055555_tag);
393371
394   m_k055555 = machine().device<k055555_device>(m_k055555_tag);
395
396372/* TODO: understand which elements MUST be init here (to keep correct layer
397373   associations) and which ones can can be init at RESET, if any */
398374
r31113r31114
401377   create_tilemaps(machine());
402378
403379   finalize_init(machine());
404
380   
381   // bind callbacks
382   m_k056832_cb.bind_relative_to(*owner());
405383}
406384
407385/*****************************************************************************
r31113r31114
557535   color = (attr & smptr->palm1) | (attr >> smptr->pals2 & smptr->palm2);
558536   flags = TILE_FLIPYX(flip);
559537
560   m_callback(machine(), layer, &code, &color, &flags);
538   m_k056832_cb(layer, &code, &color, &flags);
561539
562540   SET_TILE_INFO_MEMBER(m_gfx_num,
563541         code,
r31113r31114
21852163}
21862164
21872165
2188
2189void k056832_device::altK056832_vh_start(running_machine &machine, const char *gfx_memory_region, int bpp, int big,
2190   int (*scrolld)[4][2],
2191   void (*callback)(running_machine &machine, int layer, int *code, int *color, int *flags),
2192   int djmain_hack)
2193{
2194   m_k055555 = 0;
2195   m_callback = callback;
2196   m_djmain_hack = djmain_hack;
2197
2198   create_gfx(machine, gfx_memory_region, bpp, big);
2199
2200   create_tilemaps(machine);
2201
2202   finalize_init(machine);
2203}
2204
2205
2206
22072166int k056832_device::altK056832_update_linemap(screen_device &screen, bitmap_rgb32 &bitmap, int page, int flags)
22082167{
22092168   if (m_page_tile_mode[page]) return(0);
r31113r31114
26142573   return(m_layer_association);
26152574}
26162575
2617void k056832_device::K056832_set_k055555(k055555_device * mode)
2618{
2619   m_k055555 = mode;
2620}
trunk/src/mame/video/k054156_k054157_k056832.h
r31113r31114
88#include "video/k055555.h"// still needs k055555_get_palette_index
99
1010
11typedef void (*k056832_callback)(running_machine &machine, int layer, int *code, int *color, int *flags);
11typedef device_delegate<void (int layer, int *code, int *color, int *flags)> k056832_cb_delegate;
12#define K056832_CB_MEMBER(_name)   void _name(int layer, int *code, int *color, int *flags)
1213
14#define MCFG_K056832_CB(_class, _method) \
15   k056832_device::set_k056832_callback(*device, k056832_cb_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner)));
1316
17#define MCFG_K056832_CONFIG(_gfx_reg, _gfx_num, _bpp, _big, _djmain_hack, _k055555) \
18   k056832_device::set_config(*device, _gfx_reg, _gfx_num, _bpp, _big, _djmain_hack, _k055555);
19
20
21
1422#define MCFG_K056832_ADD(_tag, _interface) \
1523   MCFG_DEVICE_ADD(_tag, K056832, 0) \
1624   MCFG_DEVICE_CONFIG(_interface)
r31113r31114
2129
2230struct k056832_interface
2331{
24   const char         *m_gfx_memory_region;
25   int                m_gfx_num;
26   int                m_bpp;
27   int                m_big;
28   int                m_djmain_hack;
29   k056832_callback   m_callback;
30
31   const char         *m_k055555_tag;    // tbyahhoo uses the k056832 together with a k055555
3232};
3333
3434
r31113r31114
5858      m_k055555 = 0;
5959   }
6060
61   static void set_k056832_callback(device_t &device, k056832_cb_delegate callback) { downcast<k056832_device &>(device).m_k056832_cb = callback; }
62   static void set_config(device_t &device, const char *gfx_reg, int gfx_num, int bpp, int big, int djmain_hack, const char *k055555)
63   {
64      k056832_device &dev = downcast<k056832_device &>(device);
65      dev.m_gfx_memory_region = gfx_reg;
66      dev.m_gfx_num = gfx_num;
67      dev.m_bpp = bpp;
68      dev.m_big = big;
69      dev.m_djmain_hack = djmain_hack;
70      dev.m_k055555_tag = k055555;
71   }
72   
6173   // static configuration
6274   static void static_set_gfxdecode_tag(device_t &device, const char *tag);
6375   static void static_set_palette_tag(device_t &device, const char *tag);
r31113r31114
122134
123135protected:
124136   // device-level overrides
125   virtual void device_config_complete();
126137   virtual void device_start();
127138
128139private:
r31113r31114
138149   int       m_num_gfx_banks;    // depends on size of graphics ROMs
139150   int       m_cur_gfx_banks;        // cached info for K056832_regs[0x1a]
140151
152   k056832_cb_delegate   m_k056832_cb;
141153
154   //FIXME: device should be updated to use device_gfx_interface to get rid of most of these!
155   const char         *m_gfx_memory_region;
156   int                m_gfx_num;
157   int                m_bpp;
158   int                m_big;
159   int                m_djmain_hack;
160   
161   const char         *m_k055555_tag;    // tbyahhoo uses the k056832 together with a k055555
162   
142163
143
144
145
146
147
148
149164   // ROM readback involves reading 2 halves of a word
150165   // from the same location in a row.  Reading the
151166   // RAM window resets this state so you get the first half.
r31113r31114
178193
179194
180195
181
182
183
184
185196   k055555_device *m_k055555;  /* used to choose colorbase */
186197
187198   void get_tile_info(  tile_data &tileinfo, int tile_index, int pageIndex );
r31113r31114
222233
223234   required_device<gfxdecode_device> m_gfxdecode;
224235   required_device<palette_device> m_palette;
236
225237public:
238   void m_tilemap_draw(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int num, UINT32 flags, UINT32 priority);
226239
227   // todo: collapse these into above
228   void altK056832_vh_start(running_machine &machine, const char *gfx_memory_region, int bpp, int big,
229            int (*scrolld)[4][2],
230            void (*callback)(running_machine &machine, int layer, int *code, int *color, int *flags),
231            int djmain_hack);
232
233   void K056832_set_k055555(k055555_device* mode); // k055555 hook
234
235
236   void m_tilemap_draw(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int num, UINT32 flags, UINT32 priority);
237240private:
238241   int altK056832_update_linemap(screen_device &screen, bitmap_rgb32 &bitmap, int page, int flags);
239
240
241242};
242243
243244extern const device_type K056832;
trunk/src/mame/video/gijoe.c
r31113r31114
2020   *color = state->m_sprite_colorbase | (*color & 0x001f);
2121}
2222
23void gijoe_tile_callback( running_machine &machine, int layer, int *code, int *color, int *flags )
23K056832_CB_MEMBER(gijoe_state::tile_callback)
2424{
25   gijoe_state *state = machine.driver_data<gijoe_state>();
2625   int tile = *code;
2726
2827   if (tile >= 0xf000 && tile <= 0xf4ff)
r31113r31114
3029      tile &= 0x0fff;
3130      if (tile < 0x0310)
3231      {
33         state->m_avac_occupancy[layer] |= 0x0f00;
34         tile |= state->m_avac_bits[0];
32         m_avac_occupancy[layer] |= 0x0f00;
33         tile |= m_avac_bits[0];
3534      }
3635      else if (tile < 0x0470)
3736      {
38         state->m_avac_occupancy[layer] |= 0xf000;
39         tile |= state->m_avac_bits[1];
37         m_avac_occupancy[layer] |= 0xf000;
38         tile |= m_avac_bits[1];
4039      }
4140      else
4241      {
43         state->m_avac_occupancy[layer] |= 0x00f0;
44         tile |= state->m_avac_bits[2];
42         m_avac_occupancy[layer] |= 0x00f0;
43         tile |= m_avac_bits[2];
4544      }
4645      *code = tile;
4746   }
4847
49   *color = (*color >> 2 & 0x0f) | state->m_layer_colorbase[layer];
48   *color = (*color >> 2 & 0x0f) | m_layer_colorbase[layer];
5049}
5150
5251void gijoe_state::video_start()
trunk/src/mame/video/qdrmfgp.c
r31113r31114
88#include "includes/qdrmfgp.h"
99
1010
11
12void qdrmfgp_tile_callback(running_machine &machine, int layer, int *code, int *color, int *flags)
11K056832_CB_MEMBER(qdrmfgp_state::qdrmfgp_tile_callback)
1312{
14   qdrmfgp_state *state = machine.driver_data<qdrmfgp_state>();
15   *color = ((*color>>2) & 0x0f) | state->m_pal;
13   *color = ((*color>>2) & 0x0f) | m_pal;
1614}
1715
18void qdrmfgp2_tile_callback(running_machine &machine, int layer, int *code, int *color, int *flags)
16K056832_CB_MEMBER(qdrmfgp_state::qdrmfgp2_tile_callback)
1917{
2018   *color = (*color>>1) & 0x7f;
2119}
trunk/src/mame/video/moo.c
r31113r31114
2828   *color = state->m_sprite_colorbase | (*color & 0x001f);
2929}
3030
31void moo_tile_callback( running_machine &machine, int layer, int *code, int *color, int *flags )
31K056832_CB_MEMBER(moo_state::tile_callback)
3232{
33   moo_state *state = machine.driver_data<moo_state>();
34   *color = state->m_layer_colorbase[layer] | (*color >> 2 & 0x0f);
33   *color = m_layer_colorbase[layer] | (*color >> 2 & 0x0f);
3534}
3635
3736VIDEO_START_MEMBER(moo_state,moo)
trunk/src/mame/video/mystwarr.c
r31113r31114
5656
5757
5858// Mystic Warriors requires tile based blending.
59static void mystwarr_tile_callback(running_machine &machine, int layer, int *code, int *color, int *flags)
59K056832_CB_MEMBER(mystwarr_state::mystwarr_tile_callback)
6060{
61   mystwarr_state *state = machine.driver_data<mystwarr_state>();
62   if (layer==1) {if ((*code&0xff00)+(*color)==0x4101) state->m_cbparam++; else state->m_cbparam--;} //* water hack (TEMPORARY)
63
64   *color = state->m_layer_colorbase[layer] | (*color>>1 & 0x1e);
61   if (layer == 1) {if ((*code & 0xff00) + (*color) == 0x4101) m_cbparam++; else m_cbparam--;} //* water hack (TEMPORARY)
62   *color = m_layer_colorbase[layer] | (*color >> 1 & 0x1e);
6563}
6664
6765// for games with 5bpp tile data
68static void game5bpp_tile_callback(running_machine &machine, int layer, int *code, int *color, int *flags)
66K056832_CB_MEMBER(mystwarr_state::game5bpp_tile_callback)
6967{
70   mystwarr_state *state = machine.driver_data<mystwarr_state>();
71   *color = state->m_layer_colorbase[layer] | (*color>>1 & 0x1e);
68   *color = m_layer_colorbase[layer] | (*color >> 1 & 0x1e);
7269}
7370
7471// for games with 4bpp tile data
75static void game4bpp_tile_callback(running_machine &machine, int layer, int *code, int *color, int *flags)
72K056832_CB_MEMBER(mystwarr_state::game4bpp_tile_callback)
7673{
77   mystwarr_state *state = machine.driver_data<mystwarr_state>();
78   *color = state->m_layer_colorbase[layer] | (*color>>2 & 0x0f);
74   *color = m_layer_colorbase[layer] | (*color >> 2 & 0x0f);
7975}
8076
8177static void mystwarr_sprite_callback(running_machine &machine, int *code, int *color, int *priority)
r31113r31114
160156{
161157   m_gametype = 0;
162158
163   m_k056832->altK056832_vh_start(machine(), "gfx1", K056832_BPP_5, 0, NULL, game4bpp_tile_callback, 0);
164
165159   mystwarr_decode_tiles(machine());
166160
167161   m_k055673->alt_k055673_vh_start(machine(), "gfx2", 1, -61, -22, gaiapols_sprite_callback); // stage2 brick walls
r31113r31114
197191{
198192   m_gametype = 1;
199193
200   m_k056832->altK056832_vh_start(machine(), "gfx1", K056832_BPP_5, 0, NULL, game5bpp_tile_callback, 0);
201
202194   mystwarr_decode_tiles(machine());
203195
204196   m_k055673->alt_k055673_vh_start(machine(), "gfx2", 0, -42, -22, gaiapols_sprite_callback);
r31113r31114
223215{
224216   m_gametype = 0;
225217
226   m_k056832->altK056832_vh_start(machine(), "gfx1", K056832_BPP_5, 0, NULL, mystwarr_tile_callback, 0);
227
228218   mystwarr_decode_tiles(machine());
229219
230220   m_k055673->alt_k055673_vh_start(machine(), "gfx2", 0, -48, -24, mystwarr_sprite_callback);
r31113r31114
243233{
244234   m_gametype = 0;
245235
246   m_k056832->altK056832_vh_start(machine(), "gfx1", K056832_BPP_5, 0, NULL, game4bpp_tile_callback, 0);
247
248236   mystwarr_decode_tiles(machine());
249237
250238   m_k055673->alt_k055673_vh_start(machine(), "gfx2", 1, -51, -24, metamrph_sprite_callback);
r31113r31114
262250{
263251   m_gametype = 0;
264252
265   m_k056832->altK056832_vh_start(machine(), "gfx1", K056832_BPP_5, 0, NULL, game4bpp_tile_callback, 0);
266
267253   mystwarr_decode_tiles(machine());
268254
269255   m_k055673->alt_k055673_vh_start(machine(), "gfx2", 1, -62, -23, metamrph_sprite_callback);
r31113r31114
280266{
281267   m_gametype = 0;
282268
283   m_k056832->altK056832_vh_start(machine(), "gfx1", K056832_BPP_5, 0, NULL, game5bpp_tile_callback, 0);
284
285269   mystwarr_decode_tiles(machine());
286270
287271   m_k055673->alt_k055673_vh_start(machine(), "gfx2", 0, -58, -23, martchmp_sprite_callback);

Previous 199869 Revisions Next


© 1997-2024 The MAME Team