Previous 199869 Revisions Next

r29437 Tuesday 8th April, 2014 at 08:02:28 UTC by Fabio Priuli
kan_pand: converted to use inline config. nw.
[src/mame/drivers]airbustr.c djboy.c galpanic.c hvyunit.c sandscrp.c snowbros.c
[src/mame/video]kan_pand.c kan_pand.h

trunk/src/mame/drivers/airbustr.c
r29436r29437
589589
590590/* Machine Driver */
591591
592static const kaneko_pandora_interface airbustr_pandora_config =
593{
594   1,  /* gfx_region */
595   0, 0    /* x_offs, y_offs */
596};
597
598592static MACHINE_CONFIG_START( airbustr, airbustr_state )
599593
600594   /* basic machine hardware */
r29436r29437
631625   MCFG_PALETTE_ADD("palette", 768)
632626   MCFG_PALETTE_FORMAT(xGGGGGRRRRRBBBBB)
633627
634   MCFG_KANEKO_PANDORA_ADD("pandora", airbustr_pandora_config)
628   MCFG_DEVICE_ADD("pandora", KANEKO_PANDORA, 0)
629   MCFG_KANEKO_PANDORA_GFX_REGION(1)
635630   MCFG_KANEKO_PANDORA_GFXDECODE("gfxdecode")
636631   MCFG_KANEKO_PANDORA_PALETTE("palette")
637632
trunk/src/mame/drivers/snowbros.c
r29436r29437
15091509      m_hyperpac_ram[0x2000/2 + i] = PROTDATA[i];
15101510}
15111511
1512static const kaneko_pandora_interface snowbros_pandora_config =
1513{
1514   0,  /* gfx_region */
1515   0, 0    /* x_offs, y_offs */
1516};
1517
15181512static MACHINE_CONFIG_START( snowbros, snowbros_state )
15191513
15201514   /* basic machine hardware */
r29436r29437
15401534   MCFG_PALETTE_ADD("palette", 256)
15411535   MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
15421536
1543   MCFG_KANEKO_PANDORA_ADD("pandora", snowbros_pandora_config)
1537   MCFG_DEVICE_ADD("pandora", KANEKO_PANDORA, 0)
15441538   MCFG_KANEKO_PANDORA_GFXDECODE("gfxdecode")
15451539   MCFG_KANEKO_PANDORA_PALETTE("palette")
15461540
trunk/src/mame/drivers/hvyunit.c
r29436r29437
625625      m_mastercpu->set_input_line_and_vector(0, HOLD_LINE, 0xff);
626626}
627627
628static const kaneko_pandora_interface hvyunit_pandora_config =
629{
630   0,          /* gfx_region */
631   0, 0        /* x_offs, y_offs */
632};
633
634
635628/*************************************
636629 *
637630 *  Machine driver
r29436r29437
660653
661654   MCFG_QUANTUM_TIME(attotime::from_hz(6000))
662655
663
664656   MCFG_SCREEN_ADD("screen", RASTER)
665657   MCFG_SCREEN_REFRESH_RATE(58)
666658   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
r29436r29437
674666   MCFG_PALETTE_ADD("palette", 0x800)
675667   MCFG_PALETTE_FORMAT(xxxxRRRRGGGGBBBB)
676668
677   MCFG_KANEKO_PANDORA_ADD("pandora", hvyunit_pandora_config)
669   MCFG_DEVICE_ADD("pandora", KANEKO_PANDORA, 0)
678670   MCFG_KANEKO_PANDORA_GFXDECODE("gfxdecode")
679671   MCFG_KANEKO_PANDORA_PALETTE("palette")
680672
trunk/src/mame/drivers/galpanic.c
r29436r29437
545545GFXDECODE_END
546546
547547
548static const kaneko_pandora_interface galpanic_pandora_config =
549{
550   0,  /* gfx_region */
551   0, -16  /* x_offs, y_offs */
552};
553
554
555548static MACHINE_CONFIG_START( galpanic, galpanic_state )
556549
557550   /* basic machine hardware */
r29436r29437
573566   MCFG_PALETTE_ADD("palette", 1024 + 32768)
574567   MCFG_PALETTE_INIT_OWNER(galpanic_state,galpanic)
575568
576   MCFG_KANEKO_PANDORA_ADD("pandora", galpanic_pandora_config)
569   MCFG_DEVICE_ADD("pandora", KANEKO_PANDORA, 0)
570   MCFG_KANEKO_PANDORA_OFFSETS(0, -16)
577571   MCFG_KANEKO_PANDORA_GFXDECODE("gfxdecode")
578572   MCFG_KANEKO_PANDORA_PALETTE("palette")
579573
580574   MCFG_DEVICE_ADD("calc1_mcu", KANEKO_HIT, 0)
581575   kaneko_hit_device::set_type(*device, 0);
582576
583
584
585
586577   MCFG_VIDEO_START_OVERRIDE(galpanic_state,galpanic)
587578
588579   /* sound hardware */
trunk/src/mame/drivers/djboy.c
r29436r29437
501501      m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xff);
502502}
503503
504static const kaneko_pandora_interface djboy_pandora_config =
505{
506   0,  /* gfx_region */
507   0, 0    /* x_offs, y_offs */
508};
509
510
511504void djboy_state::machine_start()
512505{
513506   UINT8 *MAIN = memregion("maincpu")->base();
r29436r29437
584577   MCFG_GFXDECODE_ADD("gfxdecode", "palette", djboy)
585578   MCFG_PALETTE_ADD("palette", 0x200)
586579
587   MCFG_KANEKO_PANDORA_ADD("pandora", djboy_pandora_config)
580   MCFG_DEVICE_ADD("pandora", KANEKO_PANDORA, 0)
588581   MCFG_KANEKO_PANDORA_GFXDECODE("gfxdecode")
589582   MCFG_KANEKO_PANDORA_PALETTE("palette")
590583
trunk/src/mame/drivers/sandscrp.c
r29436r29437
480480};
481481
482482
483static const kaneko_pandora_interface sandscrp_pandora_config =
484{
485   0,  /* gfx_region */
486   0, 0    /* x_offs, y_offs */
487};
488
489483static MACHINE_CONFIG_START( sandscrp, sandscrp_state )
490484
491485   /* basic machine hardware */
r29436r29437
499493
500494   MCFG_WATCHDOG_TIME_INIT(attotime::from_seconds(3))  /* a guess, and certainly wrong */
501495
502
503496   /* video hardware */
504497   MCFG_SCREEN_ADD("screen", RASTER)
505498   MCFG_SCREEN_REFRESH_RATE(60)
r29436r29437
522515   MCFG_DEVICE_ADD("calc1_mcu", KANEKO_HIT, 0)
523516   kaneko_hit_device::set_type(*device, 0);
524517
525   MCFG_KANEKO_PANDORA_ADD("pandora", sandscrp_pandora_config)
518   MCFG_DEVICE_ADD("pandora", KANEKO_PANDORA, 0)
526519   MCFG_KANEKO_PANDORA_GFXDECODE("gfxdecode")
527520   MCFG_KANEKO_PANDORA_PALETTE("palette")
528521
trunk/src/mame/video/kan_pand.c
r29436r29437
5555kaneko_pandora_device::kaneko_pandora_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
5656   : device_t(mconfig, KANEKO_PANDORA, "Kaneko Pandora - PX79C480FP-3", tag, owner, clock, "kaneko_pandora", __FILE__),
5757      device_video_interface(mconfig, *this),
58      m_gfx_region(0),
59      m_xoffset(0),
60      m_yoffset(0),
5861      m_gfxdecode(*this),
5962      m_palette(*this)
6063{
r29436r29437
8184}
8285
8386//-------------------------------------------------
84//  device_config_complete - perform any
85//  operations now that the configuration is
86//  complete
87//-------------------------------------------------
88
89void kaneko_pandora_device::device_config_complete()
90{
91   // inherit a copy of the static data
92   const kaneko_pandora_interface *intf = reinterpret_cast<const kaneko_pandora_interface *>(static_config());
93   if (intf != NULL)
94      *static_cast<kaneko_pandora_interface *>(this) = *intf;
95
96   // or initialize to defaults if none provided
97   else
98   {
99      m_gfx_region = 0;
100      m_xoffset = 0;
101      m_yoffset = 0;
102   }
103}
104
105//-------------------------------------------------
10687//  device_start - device-specific startup
10788//-------------------------------------------------
10889
trunk/src/mame/video/kan_pand.h
r29436r29437
1313    TYPE DEFINITIONS
1414***************************************************************************/
1515
16struct kaneko_pandora_interface
17{
18   UINT8      m_gfx_region;
19   int        m_xoffset;
20   int        m_yoffset;
21};
22
2316class kaneko_pandora_device : public device_t,
24                        public device_video_interface,
25                        public kaneko_pandora_interface
17                        public device_video_interface
2618{
2719public:
2820   kaneko_pandora_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
r29436r29437
3123   // static configuration
3224   static void static_set_gfxdecode_tag(device_t &device, const char *tag);
3325   static void static_set_palette_tag(device_t &device, const char *tag);
34
26   static void set_gfx_region(device_t &device, int gfxregion) { downcast<kaneko_pandora_device &>(device).m_gfx_region = gfxregion; }
27   static void set_offsets(device_t &device, int x_offset, int y_offset)
28   {
29      kaneko_pandora_device &dev = downcast<kaneko_pandora_device &>(device);
30      dev.m_xoffset = x_offset;
31      dev.m_yoffset = y_offset;
32   }
33   
3534   DECLARE_WRITE8_MEMBER ( spriteram_w );
3635   DECLARE_READ8_MEMBER( spriteram_r );
3736   DECLARE_WRITE16_MEMBER( spriteram_LSB_w );
r29436r29437
4342
4443protected:
4544   // device-level overrides
46   virtual void device_config_complete();
4745   virtual void device_start();
4846   virtual void device_reset();
4947
r29436r29437
5553   bitmap_ind16    *m_sprites_bitmap; /* bitmap to render sprites to, Pandora seems to be frame'buffered' */
5654   int             m_clear_bitmap;
5755   int             m_bg_pen; // might work some other way..
56   UINT8           m_gfx_region;
57   int             m_xoffset;
58   int             m_yoffset;
5859   required_device<gfxdecode_device> m_gfxdecode;
5960   required_device<palette_device> m_palette;
6061};
r29436r29437
6667    DEVICE CONFIGURATION MACROS
6768***************************************************************************/
6869
69#define MCFG_KANEKO_PANDORA_ADD(_tag, _interface) \
70   MCFG_DEVICE_ADD(_tag, KANEKO_PANDORA, 0) \
71   MCFG_DEVICE_CONFIG(_interface)
70#define MCFG_KANEKO_PANDORA_GFX_REGION(_region) \
71   kaneko_pandora_device::set_gfx_region(*device, _region);
7272
73#define MCFG_KANEKO_PANDORA_OFFSETS(_xoffs, _yoffs) \
74   kaneko_pandora_device::set_offsets(*device, _xoffs, _yoffs);
75
7376#define MCFG_KANEKO_PANDORA_GFXDECODE(_gfxtag) \
7477   kaneko_pandora_device::static_set_gfxdecode_tag(*device, "^" _gfxtag);
7578

Previous 199869 Revisions Next


© 1997-2024 The MAME Team