Previous 199869 Revisions Next

r29463 Tuesday 8th April, 2014 at 16:51:43 UTC by Fabio Priuli
pc080sn: updated to use inline configs. nw.
[src/mame/drivers]darius.c opwolf.c rainbow.c rastan.c topspeed.c
[src/mame/video]pc080sn.c pc080sn.h

trunk/src/mame/drivers/opwolf.c
r29462r29463
680680                 MACHINE DRIVERS
681681***********************************************************/
682682
683static const pc080sn_interface opwolf_pc080sn_intf =
684{
685   1,   /* gfxnum */
686   0, 0, 0, 0  /* x_offset, y_offset, y_invert, dblwidth */
687};
688
689683static MACHINE_CONFIG_START( opwolf, opwolf_state )
690684
691685   /* basic machine hardware */
r29462r29463
713707   MCFG_PALETTE_ADD("palette", 8192)
714708   MCFG_PALETTE_FORMAT(xxxxRRRRGGGGBBBB)
715709
716   MCFG_PC080SN_ADD("pc080sn", opwolf_pc080sn_intf)
710   MCFG_DEVICE_ADD("pc080sn", PC080SN, 0)
711   MCFG_PC080SN_GFX_REGION(1)
717712   MCFG_PC080SN_GFXDECODE("gfxdecode")
718713   MCFG_PC080SN_PALETTE("palette")
719714
r29462r29463
778773   MCFG_PALETTE_ADD("palette", 8192)
779774   MCFG_PALETTE_FORMAT(xxxxRRRRGGGGBBBB)
780775
781   MCFG_PC080SN_ADD("pc080sn", opwolf_pc080sn_intf)
776   MCFG_DEVICE_ADD("pc080sn", PC080SN, 0)
777   MCFG_PC080SN_GFX_REGION(1)
782778   MCFG_PC080SN_GFXDECODE("gfxdecode")
783779   MCFG_PC080SN_PALETTE("palette")
784780
trunk/src/mame/drivers/rastan.c
r29462r29463
356356}
357357
358358
359static const pc080sn_interface rastan_pc080sn_intf =
360{
361   0,   /* gfxnum */
362   0, 0, 0, 0  /* x_offset, y_offset, y_invert, dblwidth */
363};
364
365359static MACHINE_CONFIG_START( rastan, rastan_state )
366360
367361   /* basic machine hardware */
r29462r29463
388382   MCFG_PALETTE_ADD("palette", 8192)
389383   MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
390384
391   MCFG_PC080SN_ADD("pc080sn", rastan_pc080sn_intf)
385   MCFG_DEVICE_ADD("pc080sn", PC080SN, 0)
392386   MCFG_PC080SN_GFXDECODE("gfxdecode")
393387   MCFG_PC080SN_PALETTE("palette")
394388
trunk/src/mame/drivers/rainbow.c
r29462r29463
619619                      MACHINE DRIVERS
620620***********************************************************/
621621
622static const pc080sn_interface rbisland_pc080sn_intf =
623{
624   1,   /* gfxnum */
625   0, 0, 0, 0  /* x_offset, y_offset, y_invert, dblwidth */
626};
627
628static const pc080sn_interface jumping_pc080sn_intf =
629{
630   1,   /* gfxnum */
631   0, 0, 1, 0  /* x_offset, y_offset, y_invert, dblwidth */
632};
633
634622void rbisland_state::machine_start()
635623{
636624}
r29462r29463
661649   MCFG_PALETTE_ADD("palette", 8192)
662650   MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
663651
664   MCFG_PC080SN_ADD("pc080sn", rbisland_pc080sn_intf)
652   MCFG_DEVICE_ADD("pc080sn", PC080SN, 0)
653   MCFG_PC080SN_GFX_REGION(1)
665654   MCFG_PC080SN_GFXDECODE("gfxdecode")
666655   MCFG_PC080SN_PALETTE("palette")
667656
r29462r29463
713702
714703   MCFG_VIDEO_START_OVERRIDE(rbisland_state,jumping)
715704
716   MCFG_PC080SN_ADD("pc080sn", jumping_pc080sn_intf)
705   MCFG_DEVICE_ADD("pc080sn", PC080SN, 0)
706   MCFG_PC080SN_GFX_REGION(1)
707   MCFG_PC080SN_YINVERT(1)
717708   MCFG_PC080SN_GFXDECODE("gfxdecode")
718709   MCFG_PC080SN_PALETTE("palette")
719710
trunk/src/mame/drivers/topspeed.c
r29462r29463
525525                     DEVICES
526526***********************************************************/
527527
528static const pc080sn_interface pc080sn_intf =
529{
530   1,          // gfxnum
531   0, 8, 0, 0  // x_offset, y_offset, y_invert, dblwidth
532};
533
534528static Z80CTC_INTERFACE( ctc_intf )
535529{
536530   DEVCB_NULL, // Interrupt handler
r29462r29463
591585
592586   MCFG_Z80CTC_ADD("ctc", XTAL_16MHz / 4, ctc_intf)
593587
594   MCFG_PC080SN_ADD("pc080sn_1", pc080sn_intf)
588   MCFG_DEVICE_ADD("pc080sn_1", PC080SN, 0)
589   MCFG_PC080SN_GFX_REGION(1)
590   MCFG_PC080SN_OFFSETS(0, 8)
595591   MCFG_PC080SN_GFXDECODE("gfxdecode")
596592   MCFG_PC080SN_PALETTE("palette")
597   MCFG_PC080SN_ADD("pc080sn_2", pc080sn_intf)
593
594   MCFG_DEVICE_ADD("pc080sn_2", PC080SN, 0)
595   MCFG_PC080SN_GFX_REGION(1)
596   MCFG_PC080SN_OFFSETS(0, 8)
598597   MCFG_PC080SN_GFXDECODE("gfxdecode")
599598   MCFG_PC080SN_PALETTE("palette")
600599
trunk/src/mame/drivers/darius.c
r29462r29463
784784                       MACHINE DRIVERS
785785***********************************************************/
786786
787static const pc080sn_interface darius_pc080sn_intf =
788{
789   1,   /* gfxnum */
790   -16, 8, 0, 1    /* x_offset, y_offset, y_invert, dblwidth */
791};
792
793787void darius_state::darius_postload()
794788{
795789   parse_control();
r29462r29463
891885   MCFG_SCREEN_UPDATE_DRIVER(darius_state, screen_update_darius_right)
892886   MCFG_SCREEN_PALETTE("palette")
893887
894
895   MCFG_PC080SN_ADD("pc080sn", darius_pc080sn_intf)
888   MCFG_DEVICE_ADD("pc080sn", PC080SN, 0)
889   MCFG_PC080SN_GFX_REGION(1)
890   MCFG_PC080SN_OFFSETS(-16, 8)
891   MCFG_PC080SN_YINVERT(0)
892   MCFG_PC080SN_DBLWIDTH(1)
896893   MCFG_PC080SN_GFXDECODE("gfxdecode")
897894   MCFG_PC080SN_PALETTE("palette")
898895
trunk/src/mame/video/pc080sn.c
r29462r29463
5252pc080sn_device::pc080sn_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
5353   : device_t(mconfig, PC080SN, "Taito PC080SN", tag, owner, clock, "pc080sn", __FILE__),
5454   m_ram(NULL),
55   m_gfxnum(0),
56   m_x_offset(0),
57   m_y_offset(0),
58   m_y_invert(0),
59   m_dblwidth(0),
5560   m_gfxdecode(*this),
5661   m_palette(*this)
5762   //m_bg_ram[0](NULL),
r29462r29463
8287}
8388
8489//-------------------------------------------------
85//  device_config_complete - perform any
86//  operations now that the configuration is
87//  complete
88//-------------------------------------------------
89
90void pc080sn_device::device_config_complete()
91{
92   // inherit a copy of the static data
93   const pc080sn_interface *intf = reinterpret_cast<const pc080sn_interface *>(static_config());
94   if (intf != NULL)
95   *static_cast<pc080sn_interface *>(this) = *intf;
96
97   // or initialize to defaults if none provided
98   else
99   {
100   }
101}
102
103//-------------------------------------------------
10490//  device_start - device-specific startup
10591//-------------------------------------------------
10692
trunk/src/mame/video/pc080sn.h
r29462r29463
11#ifndef __PC080SN_H__
22#define __PC080SN_H__
33
4struct pc080sn_interface
4class pc080sn_device : public device_t
55{
6   int                m_gfxnum;
7
8   int                m_x_offset, m_y_offset;
9   int                m_y_invert;
10   int                m_dblwidth;
11};
12
13class pc080sn_device : public device_t,
14                              public pc080sn_interface
15{
166public:
177   pc080sn_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
188   ~pc080sn_device() {}
r29462r29463
2010   // static configuration
2111   static void static_set_gfxdecode_tag(device_t &device, const char *tag);
2212   static void static_set_palette_tag(device_t &device, const char *tag);
23
13   static void set_gfx_region(device_t &device, int gfxregion) { downcast<pc080sn_device &>(device).m_gfxnum = gfxregion; }
14   static void set_yinvert(device_t &device, int y_inv) { downcast<pc080sn_device &>(device).m_y_invert = y_inv; }
15   static void set_dblwidth(device_t &device, int dblwidth) { downcast<pc080sn_device &>(device).m_dblwidth = dblwidth; }
16   static void set_offsets(device_t &device, int x_offset, int y_offset)
17   {
18      pc080sn_device &dev = downcast<pc080sn_device &>(device);
19      dev.m_x_offset = x_offset;
20      dev.m_y_offset = y_offset;
21   }
22   
2423   DECLARE_READ16_MEMBER( word_r );
2524   DECLARE_WRITE16_MEMBER( word_w );
2625   DECLARE_WRITE16_MEMBER( xscroll_word_w );
r29462r29463
4847
4948   protected:
5049   // device-level overrides
51   virtual void device_config_complete();
5250   virtual void device_start();
5351
5452   private:
r29462r29463
6260   int            m_bgscrollx[2], m_bgscrolly[2];
6361
6462   tilemap_t      *m_tilemap[2];
63
64   int            m_gfxnum;
65   int            m_x_offset, m_y_offset;
66   int            m_y_invert;
67   int            m_dblwidth;
68   
6569   required_device<gfxdecode_device> m_gfxdecode;
6670   required_device<palette_device> m_palette;
6771};
6872
6973extern const device_type PC080SN;
7074
71#define MCFG_PC080SN_ADD(_tag, _interface) \
72   MCFG_DEVICE_ADD(_tag, PC080SN, 0) \
73   MCFG_DEVICE_CONFIG(_interface)
7475
76#define MCFG_PC080SN_GFX_REGION(_region) \
77   pc080sn_device::set_gfx_region(*device, _region);
78
79#define MCFG_PC080SN_OFFSETS(_xoffs, _yoffs) \
80   pc080sn_device::set_offsets(*device, _xoffs, _yoffs);
81
82#define MCFG_PC080SN_YINVERT(_yinv) \
83   pc080sn_device::set_yinvert(*device, _yinv);
84
85#define MCFG_PC080SN_DBLWIDTH(_dbl) \
86   pc080sn_device::set_dblwidth(*device, _dbl);
87
7588#define MCFG_PC080SN_GFXDECODE(_gfxtag) \
7689   pc080sn_device::static_set_gfxdecode_tag(*device, "^" _gfxtag);
7790

Previous 199869 Revisions Next


© 1997-2024 The MAME Team