Previous 199869 Revisions Next

r29460 Tuesday 8th April, 2014 at 16:11:51 UTC by Fabio Priuli
tc0080vco: updated to use inline configs. nw.
[src/mame/drivers]taito_h.c taito_o.c taitoair.c
[src/mame/video]tc0080vco.c tc0080vco.h

trunk/src/mame/drivers/taito_o.c
r29459r29460
230230   DEVCB_NULL, DEVCB_NULL,
231231};
232232
233static const tc0080vco_interface parentj_intf =
234{
235   0, 1,   /* gfxnum, txnum */
236   1, 1, -2,
237   0
238};
239
240233void taitoo_state::machine_start()
241234{
242235}
r29459r29460
260253   MCFG_PALETTE_ADD("palette", 33*16)
261254   MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
262255
263   MCFG_TC0080VCO_ADD("tc0080vco", parentj_intf)
256   MCFG_DEVICE_ADD("tc0080vco", TC0080VCO, 0)
257   MCFG_TC0080VCO_GFX_REGION(0)
258   MCFG_TC0080VCO_TX_REGION(1)
259   MCFG_TC0080VCO_OFFSETS(1, 1)
260   MCFG_TC0080VCO_BGFLIP_OFFS(-2)
264261   MCFG_TC0080VCO_GFXDECODE("gfxdecode")
265262   MCFG_TC0080VCO_PALETTE("palette")
266263
trunk/src/mame/drivers/taito_h.c
r29459r29460
646646}
647647
648648
649static const tc0080vco_interface syvalion_tc0080vco_intf =
650{
651   0, 1,   /* gfxnum, txnum */
652   1, 1, -2,
653   1
654};
655
656static const tc0080vco_interface recordbr_tc0080vco_intf =
657{
658   0, 1,   /* gfxnum, txnum */
659   1, 1, -2,
660   0
661};
662
663649static MACHINE_CONFIG_START( syvalion, taitoh_state )
664650
665651   /* basic machine hardware */
r29459r29460
693679   MCFG_PALETTE_ADD("palette", 33*16)
694680   MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
695681
696   MCFG_TC0080VCO_ADD("tc0080vco", syvalion_tc0080vco_intf)
682   MCFG_DEVICE_ADD("tc0080vco", TC0080VCO, 0)
683   MCFG_TC0080VCO_GFX_REGION(0)
684   MCFG_TC0080VCO_TX_REGION(1)
685   MCFG_TC0080VCO_OFFSETS(1, 1)
686   MCFG_TC0080VCO_BGFLIP_OFFS(-2)
697687   MCFG_TC0080VCO_GFXDECODE("gfxdecode")
698688   MCFG_TC0080VCO_PALETTE("palette")
699689
r29459r29460
745735   MCFG_PALETTE_ADD("palette", 32*16)
746736   MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
747737
748   MCFG_TC0080VCO_ADD("tc0080vco", recordbr_tc0080vco_intf)
738   MCFG_DEVICE_ADD("tc0080vco", TC0080VCO, 0)
739   MCFG_TC0080VCO_GFX_REGION(0)
740   MCFG_TC0080VCO_TX_REGION(1)
741   MCFG_TC0080VCO_OFFSETS(1, 1)
742   MCFG_TC0080VCO_BGFLIP_OFFS(-2)
749743   MCFG_TC0080VCO_GFXDECODE("gfxdecode")
750744   MCFG_TC0080VCO_PALETTE("palette")
751745
r29459r29460
805799   MCFG_PALETTE_ADD("palette", 33*16)
806800   MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
807801
808   MCFG_TC0080VCO_ADD("tc0080vco", recordbr_tc0080vco_intf)
802   MCFG_DEVICE_ADD("tc0080vco", TC0080VCO, 0)
803   MCFG_TC0080VCO_GFX_REGION(0)
804   MCFG_TC0080VCO_TX_REGION(1)
805   MCFG_TC0080VCO_OFFSETS(1, 1)
806   MCFG_TC0080VCO_BGFLIP_OFFS(-2)
809807   MCFG_TC0080VCO_GFXDECODE("gfxdecode")
810808   MCFG_TC0080VCO_PALETTE("palette")
811809
trunk/src/mame/drivers/taitoair.c
r29459r29460
638638                MACHINE DRIVERS
639639************************************************************/
640640
641static const tc0080vco_interface airsys_tc0080vco_intf =
642{
643   0, 1,   /* gfxnum, txnum */
644   1, 1, -2,
645   0
646};
647
648641void taitoair_state::machine_start()
649642{
650643   UINT8 *ROM = memregion("audiocpu")->base();
r29459r29460
716709
717710   MCFG_PALETTE_ADD_INIT_BLACK("palette", 512*16+512*16)
718711
719   MCFG_TC0080VCO_ADD("tc0080vco", airsys_tc0080vco_intf)
712   MCFG_DEVICE_ADD("tc0080vco", TC0080VCO, 0)
713   MCFG_TC0080VCO_GFX_REGION(0)
714   MCFG_TC0080VCO_TX_REGION(1)
715   MCFG_TC0080VCO_OFFSETS(1, 1)
716   MCFG_TC0080VCO_BGFLIP_OFFS(-2)
720717   MCFG_TC0080VCO_GFXDECODE("gfxdecode")
721718   MCFG_TC0080VCO_PALETTE("palette")
722719
trunk/src/mame/video/tc0080vco.c
r29459r29460
9595   m_bg1_scrollx(0),
9696   m_bg1_scrolly(0),
9797   m_flipscreen(0),
98   m_gfxnum(0),
99   m_txnum(0),
100   m_bg_xoffs(0),
101   m_bg_yoffs(0),
102   m_bg_flip_yoffs(0),
103   m_has_fg0(1),
98104   m_gfxdecode(*this),
99105   m_palette(*this)
100106{
r29459r29460
121127}
122128
123129//-------------------------------------------------
124//  device_config_complete - perform any
125//  operations now that the configuration is
126//  complete
127//-------------------------------------------------
128
129void tc0080vco_device::device_config_complete()
130{
131   // inherit a copy of the static data
132   const tc0080vco_interface *intf = reinterpret_cast<const tc0080vco_interface *>(static_config());
133   if (intf != NULL)
134   *static_cast<tc0080vco_interface *>(this) = *intf;
135
136   // or initialize to defaults if none provided
137   else
138   {
139   }
140}
141
142//-------------------------------------------------
143130//  device_start - device-specific startup
144131//-------------------------------------------------
145132
trunk/src/mame/video/tc0080vco.h
r29459r29460
11#ifndef __TC0080VCO_H__
22#define __TC0080VCO_H__
33
4struct tc0080vco_interface
4class tc0080vco_device : public device_t
55{
6   int                m_gfxnum;
7   int                m_txnum;
8
9   int                m_bg_xoffs, m_bg_yoffs;
10   int                m_bg_flip_yoffs;
11
12   int                m_has_fg0; /* for debug */
13};
14
15class tc0080vco_device : public device_t,
16                     public tc0080vco_interface
17{
186public:
197   tc0080vco_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
208   ~tc0080vco_device() {}
r29459r29460
2210   // static configuration
2311   static void static_set_gfxdecode_tag(device_t &device, const char *tag);
2412   static void static_set_palette_tag(device_t &device, const char *tag);
25
13   static void set_gfx_region(device_t &device, int gfxnum) { downcast<tc0080vco_device &>(device).m_gfxnum = gfxnum; }
14   static void set_tx_region(device_t &device, int txnum) { downcast<tc0080vco_device &>(device).m_txnum = txnum; }
15   static void set_offsets(device_t &device, int x_offset, int y_offset)
16   {
17      tc0080vco_device &dev = downcast<tc0080vco_device &>(device);
18      dev.m_bg_xoffs = x_offset;
19      dev.m_bg_yoffs = y_offset;
20   }
21   static void set_bgflip_yoffs(device_t &device, int offs) { downcast<tc0080vco_device &>(device).m_bg_flip_yoffs = offs; }
22   
2623   DECLARE_READ16_MEMBER( word_r );
2724   DECLARE_WRITE16_MEMBER( word_w );
2825
2926   void tilemap_update();
3027   void tilemap_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority);
28   void set_fg0_debug(bool debug) { m_has_fg0 = debug ? 0 : 1; }
3129
3230   DECLARE_READ16_MEMBER( cram_0_r );
3331   DECLARE_READ16_MEMBER( cram_1_r );
r29459r29460
3735   READ_LINE_MEMBER( flipscreen_r );
3836   void postload();
3937
40   protected:
38protected:
4139   // device-level overrides
42   virtual void device_config_complete();
4340   virtual void device_start();
4441
45   private:
42private:
4643   // internal state
4744   UINT16 *       m_ram;
4845   UINT16 *       m_bg0_ram_0;
r29459r29460
5451   UINT16 *       m_char_ram;
5552   UINT16 *       m_bgscroll_ram;
5653
57/* FIXME: This sprite related stuff still needs to be accessed in
58   video/taito_h */
54/* FIXME: This sprite related stuff still needs to be accessed in video/taito_h */
5955   UINT16 *       m_chain_ram_0;
6056   UINT16 *       m_chain_ram_1;
6157   UINT16 *       m_spriteram;
r29459r29460
6662   UINT16         m_bg1_scrollx;
6763   UINT16         m_bg1_scrolly;
6864
69   tilemap_t        *m_tilemap[3];
65   tilemap_t      *m_tilemap[3];
7066
7167   INT32          m_flipscreen;
68   
69   int            m_gfxnum;
70   int            m_txnum;
71   int            m_bg_xoffs, m_bg_yoffs;
72   int            m_bg_flip_yoffs;
73   int            m_has_fg0; // for debug, it can be enabled with set_fg0_debug(true)
74
7275   required_device<gfxdecode_device> m_gfxdecode;
7376   required_device<palette_device> m_palette;
7477
r29459r29460
8184
8285extern const device_type TC0080VCO;
8386
84#define MCFG_TC0080VCO_ADD(_tag, _interface) \
85   MCFG_DEVICE_ADD(_tag, TC0080VCO, 0) \
86   MCFG_DEVICE_CONFIG(_interface)
87#define MCFG_TC0080VCO_GFX_REGION(_region) \
88   tc0080vco_device::set_gfx_region(*device, _region);
8789
90#define MCFG_TC0080VCO_TX_REGION(_region) \
91   tc0080vco_device::set_tx_region(*device, _region);
92
93#define MCFG_TC0080VCO_OFFSETS(_xoffs, _yoffs) \
94   tc0080vco_device::set_offsets(*device, _xoffs, _yoffs);
95
96#define MCFG_TC0080VCO_BGFLIP_OFFS(_offs) \
97   tc0080vco_device::set_bgflip_yoffs(*device, _offs);
98
8899#define MCFG_TC0080VCO_GFXDECODE(_gfxtag) \
89100   tc0080vco_device::static_set_gfxdecode_tag(*device, "^" _gfxtag);
90101

Previous 199869 Revisions Next


© 1997-2024 The MAME Team