Previous 199869 Revisions Next

r29462 Tuesday 8th April, 2014 at 16:32:30 UTC by Fabio Priuli
pc090oj: updated to use inline configs. nw.
[src/mame/drivers]asuka.c opwolf.c rainbow.c rastan.c volfied.c
[src/mame/video]pc090oj.c pc090oj.h

trunk/src/mame/drivers/opwolf.c
r29461r29462
686686   0, 0, 0, 0  /* x_offset, y_offset, y_invert, dblwidth */
687687};
688688
689static const pc090oj_interface opwolf_pc090oj_intf =
690{
691   0, 0, 0, 0
692};
693
694689static MACHINE_CONFIG_START( opwolf, opwolf_state )
695690
696691   /* basic machine hardware */
r29461r29462
721716   MCFG_PC080SN_ADD("pc080sn", opwolf_pc080sn_intf)
722717   MCFG_PC080SN_GFXDECODE("gfxdecode")
723718   MCFG_PC080SN_PALETTE("palette")
724   MCFG_PC090OJ_ADD("pc090oj", opwolf_pc090oj_intf)
719
720   MCFG_DEVICE_ADD("pc090oj", PC090OJ, 0)
725721   MCFG_PC090OJ_GFXDECODE("gfxdecode")
726722   MCFG_PC090OJ_PALETTE("palette")
727723
r29461r29462
785781   MCFG_PC080SN_ADD("pc080sn", opwolf_pc080sn_intf)
786782   MCFG_PC080SN_GFXDECODE("gfxdecode")
787783   MCFG_PC080SN_PALETTE("palette")
788   MCFG_PC090OJ_ADD("pc090oj", opwolf_pc090oj_intf)
784
785   MCFG_DEVICE_ADD("pc090oj", PC090OJ, 0)
789786   MCFG_PC090OJ_GFXDECODE("gfxdecode")
790787   MCFG_PC090OJ_PALETTE("palette")
791788
trunk/src/mame/drivers/rastan.c
r29461r29462
362362   0, 0, 0, 0  /* x_offset, y_offset, y_invert, dblwidth */
363363};
364364
365static const pc090oj_interface rastan_pc090oj_intf =
366{
367   1, 0, 0, 0
368};
369
370365static MACHINE_CONFIG_START( rastan, rastan_state )
371366
372367   /* basic machine hardware */
r29461r29462
396391   MCFG_PC080SN_ADD("pc080sn", rastan_pc080sn_intf)
397392   MCFG_PC080SN_GFXDECODE("gfxdecode")
398393   MCFG_PC080SN_PALETTE("palette")
399   MCFG_PC090OJ_ADD("pc090oj", rastan_pc090oj_intf)
394
395   MCFG_DEVICE_ADD("pc090oj", PC090OJ, 0)
396   MCFG_PC090OJ_GFX_REGION(1)
400397   MCFG_PC090OJ_GFXDECODE("gfxdecode")
401398   MCFG_PC090OJ_PALETTE("palette")
402399
trunk/src/mame/drivers/asuka.c
r29461r29462
796796   0, 0
797797};
798798
799static const pc090oj_interface asuka_pc090oj_intf =
800{
801   0, 0, 8, 1
802};
803799
804static const pc090oj_interface bonzeadv_pc090oj_intf =
805{
806   0, 0, 8, 0
807};
808
809
810
811800void asuka_state::machine_start()
812801{
813802   /* configure the banks */
r29461r29462
875864   MCFG_GFXDECODE_ADD("gfxdecode", "palette", asuka)
876865   MCFG_PALETTE_ADD("palette", 4096)
877866
878   MCFG_PC090OJ_ADD("pc090oj", bonzeadv_pc090oj_intf)
867   MCFG_DEVICE_ADD("pc090oj", PC090OJ, 0)
868   MCFG_PC090OJ_OFFSETS(0, 8)
879869   MCFG_PC090OJ_GFXDECODE("gfxdecode")
880870   MCFG_PC090OJ_PALETTE("palette")
871
881872   MCFG_TC0100SCN_ADD("tc0100scn", asuka_tc0100scn_intf)
882873   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
883874   MCFG_TC0100SCN_PALETTE("palette")
r29461r29462
931922   MCFG_GFXDECODE_ADD("gfxdecode", "palette", asuka)
932923   MCFG_PALETTE_ADD("palette", 4096)
933924
934   MCFG_PC090OJ_ADD("pc090oj", asuka_pc090oj_intf)
925   MCFG_DEVICE_ADD("pc090oj", PC090OJ, 0)
926   MCFG_PC090OJ_OFFSETS(0, 8)
927   MCFG_PC090OJ_USEBUFFER(1)
935928   MCFG_PC090OJ_GFXDECODE("gfxdecode")
936929   MCFG_PC090OJ_PALETTE("palette")
930
937931   MCFG_TC0100SCN_ADD("tc0100scn", asuka_tc0100scn_intf)
938932   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
939933   MCFG_TC0100SCN_PALETTE("palette")
r29461r29462
996990   MCFG_GFXDECODE_ADD("gfxdecode", "palette", asuka)
997991   MCFG_PALETTE_ADD("palette", 4096)
998992
999   MCFG_PC090OJ_ADD("pc090oj", asuka_pc090oj_intf)
993   MCFG_DEVICE_ADD("pc090oj", PC090OJ, 0)
994   MCFG_PC090OJ_OFFSETS(0, 8)
995   MCFG_PC090OJ_USEBUFFER(1)
1000996   MCFG_PC090OJ_GFXDECODE("gfxdecode")
1001997   MCFG_PC090OJ_PALETTE("palette")
998
1002999   MCFG_TC0100SCN_ADD("tc0100scn", cadash_tc0100scn_intf)
10031000   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
10041001   MCFG_TC0100SCN_PALETTE("palette")
r29461r29462
10521049   MCFG_GFXDECODE_ADD("gfxdecode", "palette", asuka)
10531050   MCFG_PALETTE_ADD("palette", 4096)   /* only Mofflott uses full palette space */
10541051
1055   MCFG_PC090OJ_ADD("pc090oj", bonzeadv_pc090oj_intf)
1052   MCFG_DEVICE_ADD("pc090oj", PC090OJ, 0)
1053   MCFG_PC090OJ_OFFSETS(0, 8)
10561054   MCFG_PC090OJ_GFXDECODE("gfxdecode")
10571055   MCFG_PC090OJ_PALETTE("palette")
1056
10581057   MCFG_TC0100SCN_ADD("tc0100scn", cadash_tc0100scn_intf)
10591058   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
10601059   MCFG_TC0100SCN_PALETTE("palette")
r29461r29462
11131112   MCFG_GFXDECODE_ADD("gfxdecode", "palette", asuka)
11141113   MCFG_PALETTE_ADD("palette", 4096)   /* only Mofflott uses full palette space */
11151114
1116   MCFG_PC090OJ_ADD("pc090oj", bonzeadv_pc090oj_intf)
1115   MCFG_DEVICE_ADD("pc090oj", PC090OJ, 0)
1116   MCFG_PC090OJ_OFFSETS(0, 8)
11171117   MCFG_PC090OJ_GFXDECODE("gfxdecode")
11181118   MCFG_PC090OJ_PALETTE("palette")
1119
11191120   MCFG_TC0100SCN_ADD("tc0100scn", cadash_tc0100scn_intf)
11201121   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
11211122   MCFG_TC0100SCN_PALETTE("palette")
r29461r29462
11691170   MCFG_GFXDECODE_ADD("gfxdecode", "palette", asuka)
11701171   MCFG_PALETTE_ADD("palette", 4096)
11711172
1172   MCFG_PC090OJ_ADD("pc090oj", bonzeadv_pc090oj_intf)
1173   MCFG_DEVICE_ADD("pc090oj", PC090OJ, 0)
1174   MCFG_PC090OJ_OFFSETS(0, 8)
11731175   MCFG_PC090OJ_GFXDECODE("gfxdecode")
11741176   MCFG_PC090OJ_PALETTE("palette")
1177
11751178   MCFG_TC0100SCN_ADD("tc0100scn", cadash_tc0100scn_intf)
11761179   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
11771180   MCFG_TC0100SCN_PALETTE("palette")
trunk/src/mame/drivers/rainbow.c
r29461r29462
631631   0, 0, 1, 0  /* x_offset, y_offset, y_invert, dblwidth */
632632};
633633
634static const pc090oj_interface rbisland_pc090oj_intf =
635{
636   0, 0, 0, 0
637};
638
639634void rbisland_state::machine_start()
640635{
641636}
r29461r29462
669664   MCFG_PC080SN_ADD("pc080sn", rbisland_pc080sn_intf)
670665   MCFG_PC080SN_GFXDECODE("gfxdecode")
671666   MCFG_PC080SN_PALETTE("palette")
672   MCFG_PC090OJ_ADD("pc090oj", rbisland_pc090oj_intf)
667
668   MCFG_DEVICE_ADD("pc090oj", PC090OJ, 0)
673669   MCFG_PC090OJ_GFXDECODE("gfxdecode")
674670   MCFG_PC090OJ_PALETTE("palette")
675671
trunk/src/mame/drivers/volfied.c
r29461r29462
235235   volfied_cchip_reset();
236236}
237237
238static const pc090oj_interface volfied_pc090oj_intf =
239{
240   0, 0, 0, 0
241};
242
243238static MACHINE_CONFIG_START( volfied, volfied_state )
244239
245240   /* basic machine hardware */
r29461r29462
266261   MCFG_PALETTE_ADD("palette", 8192)
267262   MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
268263
269   MCFG_PC090OJ_ADD("pc090oj", volfied_pc090oj_intf)
264   MCFG_DEVICE_ADD("pc090oj", PC090OJ, 0)
270265   MCFG_PC090OJ_GFXDECODE("gfxdecode")
271266   MCFG_PC090OJ_PALETTE("palette")
272267
trunk/src/mame/video/pc090oj.c
r29461r29462
7171*****************************************************************************/
7272
7373
74
7574const device_type PC090OJ = &device_creator<pc090oj_device>;
7675
7776pc090oj_device::pc090oj_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
r29461r29462
8079   m_sprite_ctrl(0),
8180   m_ram(NULL),
8281   m_ram_buffered(0),
82   m_gfxnum(0),
83   m_x_offset(0),
84   m_y_offset(0),
85   m_use_buffer(0),
8386   m_gfxdecode(*this),
8487   m_palette(*this)
8588{
r29461r29462
106109}
107110
108111//-------------------------------------------------
109//  device_config_complete - perform any
110//  operations now that the configuration is
111//  complete
112//-------------------------------------------------
113
114void pc090oj_device::device_config_complete()
115{
116   // inherit a copy of the static data
117   const pc090oj_interface *intf = reinterpret_cast<const pc090oj_interface *>(static_config());
118   if (intf != NULL)
119   *static_cast<pc090oj_interface *>(this) = *intf;
120
121   // or initialize to defaults if none provided
122   else
123   {
124   }
125}
126
127//-------------------------------------------------
128112//  device_start - device-specific startup
129113//-------------------------------------------------
130114
trunk/src/mame/video/pc090oj.h
r29461r29462
1#ifndef _PC090OJ_H_
2#define _PC090OJ_H_
1#ifndef __PC090OJ_H__
2#define __PC090OJ_H__
33
4struct pc090oj_interface
4class pc090oj_device : public device_t
55{
6   int                m_gfxnum;
7
8   int                m_x_offset, m_y_offset;
9   int                m_use_buffer;
10};
11
12class pc090oj_device : public device_t,
13                  public pc090oj_interface
14{
156public:
167   pc090oj_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
178   ~pc090oj_device() {}
r29461r29462
1910   // static configuration
2011   static void static_set_gfxdecode_tag(device_t &device, const char *tag);
2112   static void static_set_palette_tag(device_t &device, const char *tag);
22
13   static void set_gfx_region(device_t &device, int gfxregion) { downcast<pc090oj_device &>(device).m_gfxnum = gfxregion; }
14   static void set_usebuffer(device_t &device, int use_buf) { downcast<pc090oj_device &>(device).m_use_buffer = use_buf; }
15   static void set_offsets(device_t &device, int x_offset, int y_offset)
16   {
17      pc090oj_device &dev = downcast<pc090oj_device &>(device);
18      dev.m_x_offset = x_offset;
19      dev.m_y_offset = y_offset;
20   }
21   
2322   DECLARE_READ16_MEMBER( word_r );
2423   DECLARE_WRITE16_MEMBER( word_w );
2524
r29461r29462
2928
3029protected:
3130   // device-level overrides
32   virtual void device_config_complete();
3331   virtual void device_start();
3432   virtual void device_reset();
3533
r29461r29462
4947
5048   UINT16 *   m_ram;
5149   UINT16 *   m_ram_buffered;
50
51   int        m_gfxnum;
52   int        m_x_offset, m_y_offset;
53   int        m_use_buffer;
54
5255   required_device<gfxdecode_device> m_gfxdecode;
5356   required_device<palette_device> m_palette;
5457};
5558
5659extern const device_type PC090OJ;
5760
58#define MCFG_PC090OJ_ADD(_tag, _interface) \
59   MCFG_DEVICE_ADD(_tag, PC090OJ, 0) \
60   MCFG_DEVICE_CONFIG(_interface)
6161
62#define MCFG_PC090OJ_GFX_REGION(_region) \
63   pc090oj_device::set_gfx_region(*device, _region);
64
65#define MCFG_PC090OJ_OFFSETS(_xoffs, _yoffs) \
66   pc090oj_device::set_offsets(*device, _xoffs, _yoffs);
67
68#define MCFG_PC090OJ_USEBUFFER(_use_buf) \
69   pc090oj_device::set_usebuffer(*device, _use_buf);
70
6271#define MCFG_PC090OJ_GFXDECODE(_gfxtag) \
6372   pc090oj_device::static_set_gfxdecode_tag(*device, "^" _gfxtag);
6473

Previous 199869 Revisions Next


© 1997-2024 The MAME Team