Previous 199869 Revisions Next

r29448 Tuesday 8th April, 2014 at 14:53:52 UTC by Fabio Priuli
tc0180vcu: updated to use inline configs. nw.
[src/mame/drivers]taito_b.c
[src/mame/video]tc0180vcu.c tc0180vcu.h

trunk/src/mame/video/tc0180vcu.c
r29447r29448
1919   //m_tx_rambank(0),
2020   m_framebuffer_page(0),
2121   m_video_control(0),
22   m_bg_color_base(0),
23   m_fg_color_base(0),
24   m_tx_color_base(0),
2225   m_gfxdecode(*this)
2326{
2427}
r29447r29448
3336   downcast<tc0180vcu_device &>(device).m_gfxdecode.set_tag(tag);
3437}
3538
36
3739//-------------------------------------------------
38//  device_config_complete - perform any
39//  operations now that the configuration is
40//  complete
41//-------------------------------------------------
42
43void tc0180vcu_device::device_config_complete()
44{
45   // inherit a copy of the static data
46   const tc0180vcu_interface *intf = reinterpret_cast<const tc0180vcu_interface *>(static_config());
47   if (intf != NULL)
48   *static_cast<tc0180vcu_interface *>(this) = *intf;
49
50   // or initialize to defaults if none provided
51   else
52   {
53   }
54}
55
56//-------------------------------------------------
5740//  device_start - device-specific startup
5841//-------------------------------------------------
5942
trunk/src/mame/video/tc0180vcu.h
r29447r29448
1#ifndef _TC0180VCU_H_
2#define _TC0180VCU_H_
1#ifndef __TC0180VCU_H__
2#define __TC0180VCU_H__
33
4struct tc0180vcu_interface
4class tc0180vcu_device : public device_t
55{
6   int            m_bg_color_base;
7   int            m_fg_color_base;
8   int            m_tx_color_base;
9};
10
11class tc0180vcu_device : public device_t,
12                                 public tc0180vcu_interface
13{
146public:
157   tc0180vcu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
168   ~tc0180vcu_device() {}
179
1810   // static configuration
1911   static void static_set_gfxdecode_tag(device_t &device, const char *tag);
12   static void set_bg_colorbase(device_t &device, int color) { downcast<tc0180vcu_device &>(device).m_bg_color_base = color; }
13   static void set_fg_colorbase(device_t &device, int color) { downcast<tc0180vcu_device &>(device).m_fg_color_base = color; }
14   static void set_tx_colorbase(device_t &device, int color) { downcast<tc0180vcu_device &>(device).m_tx_color_base = color; }
2015
2116   DECLARE_READ8_MEMBER( get_fb_page );
2217   DECLARE_WRITE8_MEMBER( set_fb_page );
r29447r29448
3126
3227protected:
3328   // device-level overrides
34   virtual void device_config_complete();
3529   virtual void device_start();
3630   virtual void device_reset();
3731
38   private:
32private:
3933   // internal state
4034   UINT16         m_ctrl[0x10];
4135
r29447r29448
4741   UINT16         m_bg_rambank[2], m_fg_rambank[2], m_tx_rambank;
4842   UINT8          m_framebuffer_page;
4943   UINT8          m_video_control;
44
45   int            m_bg_color_base;
46   int            m_fg_color_base;
47   int            m_tx_color_base;
48
5049   required_device<gfxdecode_device> m_gfxdecode;
5150
5251   TILE_GET_INFO_MEMBER(get_bg_tile_info);
r29447r29448
5857
5958extern const device_type TC0180VCU;
6059
61#define MCFG_TC0180VCU_ADD(_tag, _interface) \
62   MCFG_DEVICE_ADD(_tag, TC0180VCU, 0) \
63   MCFG_DEVICE_CONFIG(_interface)
60#define MCFG_TC0180VCU_BG_COLORBASE(_color) \
61   tc0180vcu_device::set_bg_colorbase(*device, _color);
6462
63#define MCFG_TC0180VCU_FG_COLORBASE(_color) \
64   tc0180vcu_device::set_fg_colorbase(*device, _color);
65
66#define MCFG_TC0180VCU_TX_COLORBASE(_color) \
67   tc0180vcu_device::set_tx_colorbase(*device, _color);
68
6569#define MCFG_TC0180VCU_GFXDECODE(_gfxtag) \
6670   tc0180vcu_device::static_set_gfxdecode_tag(*device, "^" _gfxtag);
71
6772#endif
trunk/src/mame/drivers/taito_b.c
r29447r29448
19061906   }
19071907}
19081908
1909/* this is the basic layout used in: Nastar, Ashura Blaster, Hit the Ice, Rambo3, Tetris */
1910static const tc0180vcu_interface color0_tc0180vcu_intf =
1911{
1912   0xc0,       /* background */
1913   0x80,       /* foreground */
1914   0x00        /* text       */
1915};
19161909
1917/* this is the reversed layout used in: Crime City, Puzzle Bobble */
1918static const tc0180vcu_interface color1_tc0180vcu_intf =
1919{
1920   0x00,       /* background */
1921   0x40,       /* foreground */
1922   0xc0        /* text       */
1923};
1924
1925/* this is used in: rambo3a, masterw, silentd, selfeena, ryujin */
1926static const tc0180vcu_interface color2_tc0180vcu_intf =
1927{
1928   0x30,       /* background */
1929   0x20,       /* foreground */
1930   0x00        /* text       */
1931};
1932
1933
19341910void taitob_state::machine_start()
19351911{
19361912   m_ym = machine().device("ymsnd");
r29447r29448
19811957
19821958   MCFG_VIDEO_START_OVERRIDE(taitob_state,taitob_color_order0)
19831959
1984   MCFG_TC0180VCU_ADD("tc0180vcu", color0_tc0180vcu_intf)
1960   MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0)
1961   MCFG_TC0180VCU_BG_COLORBASE(0xc0)
1962   MCFG_TC0180VCU_FG_COLORBASE(0x80)
1963   MCFG_TC0180VCU_TX_COLORBASE(0x00)
19851964   MCFG_TC0180VCU_GFXDECODE("gfxdecode")
19861965
19871966   /* sound hardware */
r29447r29448
20342013
20352014   MCFG_VIDEO_START_OVERRIDE(taitob_state,taitob_color_order2)
20362015
2037   MCFG_TC0180VCU_ADD("tc0180vcu", color2_tc0180vcu_intf)
2016   MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0)
2017   MCFG_TC0180VCU_BG_COLORBASE(0x30)
2018   MCFG_TC0180VCU_FG_COLORBASE(0x20)
2019   MCFG_TC0180VCU_TX_COLORBASE(0x00)
20382020   MCFG_TC0180VCU_GFXDECODE("gfxdecode")
20392021
20402022   /* sound hardware */
r29447r29448
21062088
21072089   MCFG_VIDEO_START_OVERRIDE(taitob_state,taitob_color_order0)
21082090
2109   MCFG_TC0180VCU_ADD("tc0180vcu", color0_tc0180vcu_intf)
2091   MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0)
2092   MCFG_TC0180VCU_BG_COLORBASE(0xc0)
2093   MCFG_TC0180VCU_FG_COLORBASE(0x80)
2094   MCFG_TC0180VCU_TX_COLORBASE(0x00)
21102095   MCFG_TC0180VCU_GFXDECODE("gfxdecode")
21112096
21122097   /* sound hardware */
r29447r29448
21592144
21602145   MCFG_VIDEO_START_OVERRIDE(taitob_state,taitob_color_order1)
21612146
2162   MCFG_TC0180VCU_ADD("tc0180vcu", color1_tc0180vcu_intf)
2147   MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0)
2148   MCFG_TC0180VCU_BG_COLORBASE(0x00)
2149   MCFG_TC0180VCU_FG_COLORBASE(0x40)
2150   MCFG_TC0180VCU_TX_COLORBASE(0xc0)
21632151   MCFG_TC0180VCU_GFXDECODE("gfxdecode")
21642152
21652153   /* sound hardware */
r29447r29448
22132201   MCFG_VIDEO_START_OVERRIDE(taitob_state,hitice)
22142202   MCFG_VIDEO_RESET_OVERRIDE(taitob_state,hitice)
22152203
2216   MCFG_TC0180VCU_ADD("tc0180vcu", color0_tc0180vcu_intf)
2204   MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0)
2205   MCFG_TC0180VCU_BG_COLORBASE(0xc0)
2206   MCFG_TC0180VCU_FG_COLORBASE(0x80)
2207   MCFG_TC0180VCU_TX_COLORBASE(0x00)
22172208   MCFG_TC0180VCU_GFXDECODE("gfxdecode")
22182209
22192210   /* sound hardware */
r29447r29448
22712262
22722263   MCFG_VIDEO_START_OVERRIDE(taitob_state,taitob_color_order0)
22732264
2274   MCFG_TC0180VCU_ADD("tc0180vcu", color0_tc0180vcu_intf)
2265   MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0)
2266   MCFG_TC0180VCU_BG_COLORBASE(0xc0)
2267   MCFG_TC0180VCU_FG_COLORBASE(0x80)
2268   MCFG_TC0180VCU_TX_COLORBASE(0x00)
22752269   MCFG_TC0180VCU_GFXDECODE("gfxdecode")
22762270
22772271   /* sound hardware */
r29447r29448
23242318
23252319   MCFG_VIDEO_START_OVERRIDE(taitob_state,taitob_color_order2)
23262320
2327   MCFG_TC0180VCU_ADD("tc0180vcu", color2_tc0180vcu_intf)
2321   MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0)
2322   MCFG_TC0180VCU_BG_COLORBASE(0x30)
2323   MCFG_TC0180VCU_FG_COLORBASE(0x20)
2324   MCFG_TC0180VCU_TX_COLORBASE(0x00)
23282325   MCFG_TC0180VCU_GFXDECODE("gfxdecode")
23292326
23302327   /* sound hardware */
r29447r29448
23832380
23842381   MCFG_VIDEO_START_OVERRIDE(taitob_state,taitob_color_order1)
23852382
2386   MCFG_TC0180VCU_ADD("tc0180vcu", color1_tc0180vcu_intf)
2383   MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0)
2384   MCFG_TC0180VCU_BG_COLORBASE(0x00)
2385   MCFG_TC0180VCU_FG_COLORBASE(0x40)
2386   MCFG_TC0180VCU_TX_COLORBASE(0xc0)
23872387   MCFG_TC0180VCU_GFXDECODE("gfxdecode")
23882388
23892389   /* sound hardware */
r29447r29448
24422442
24432443   MCFG_VIDEO_START_OVERRIDE(taitob_state,taitob_color_order1)
24442444
2445   MCFG_TC0180VCU_ADD("tc0180vcu", color1_tc0180vcu_intf)
2445   MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0)
2446   MCFG_TC0180VCU_BG_COLORBASE(0x00)
2447   MCFG_TC0180VCU_FG_COLORBASE(0x40)
2448   MCFG_TC0180VCU_TX_COLORBASE(0xc0)
24462449   MCFG_TC0180VCU_GFXDECODE("gfxdecode")
24472450
24482451   /* sound hardware */
r29447r29448
24952498
24962499   MCFG_VIDEO_START_OVERRIDE(taitob_state,taitob_color_order2)
24972500
2498   MCFG_TC0180VCU_ADD("tc0180vcu", color2_tc0180vcu_intf)
2501   MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0)
2502   MCFG_TC0180VCU_BG_COLORBASE(0x30)
2503   MCFG_TC0180VCU_FG_COLORBASE(0x20)
2504   MCFG_TC0180VCU_TX_COLORBASE(0x00)
24992505   MCFG_TC0180VCU_GFXDECODE("gfxdecode")
25002506
25012507   /* sound hardware */
r29447r29448
25542560
25552561   MCFG_VIDEO_START_OVERRIDE(taitob_state,taitob_color_order1)
25562562
2557   MCFG_TC0180VCU_ADD("tc0180vcu", color1_tc0180vcu_intf)
2563   MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0)
2564   MCFG_TC0180VCU_BG_COLORBASE(0x00)
2565   MCFG_TC0180VCU_FG_COLORBASE(0x40)
2566   MCFG_TC0180VCU_TX_COLORBASE(0xc0)
25582567   MCFG_TC0180VCU_GFXDECODE("gfxdecode")
25592568
25602569   /* sound hardware */
r29447r29448
26072616
26082617   MCFG_VIDEO_START_OVERRIDE(taitob_state,taitob_color_order2)
26092618
2610   MCFG_TC0180VCU_ADD("tc0180vcu", color2_tc0180vcu_intf)
2619   MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0)
2620   MCFG_TC0180VCU_BG_COLORBASE(0x30)
2621   MCFG_TC0180VCU_FG_COLORBASE(0x20)
2622   MCFG_TC0180VCU_TX_COLORBASE(0x00)
26112623   MCFG_TC0180VCU_GFXDECODE("gfxdecode")
26122624
26132625   /* sound hardware */
r29447r29448
26652677
26662678   MCFG_VIDEO_START_OVERRIDE(taitob_state,taitob_color_order2)
26672679
2668   MCFG_TC0180VCU_ADD("tc0180vcu", color2_tc0180vcu_intf)
2680   MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0)
2681   MCFG_TC0180VCU_BG_COLORBASE(0x30)
2682   MCFG_TC0180VCU_FG_COLORBASE(0x20)
2683   MCFG_TC0180VCU_TX_COLORBASE(0x00)
26692684   MCFG_TC0180VCU_GFXDECODE("gfxdecode")
26702685
26712686   /* sound hardware */
r29447r29448
27182733
27192734   MCFG_VIDEO_START_OVERRIDE(taitob_state,taitob_color_order2)
27202735
2721   MCFG_TC0180VCU_ADD("tc0180vcu", color2_tc0180vcu_intf)
2736   MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0)
2737   MCFG_TC0180VCU_BG_COLORBASE(0x30)
2738   MCFG_TC0180VCU_FG_COLORBASE(0x20)
2739   MCFG_TC0180VCU_TX_COLORBASE(0x00)
27222740   MCFG_TC0180VCU_GFXDECODE("gfxdecode")
27232741
27242742   /* sound hardware */
r29447r29448
27802798
27812799   MCFG_VIDEO_START_OVERRIDE(taitob_state,taitob_color_order2)
27822800
2783   MCFG_TC0180VCU_ADD("tc0180vcu", color2_tc0180vcu_intf)
2801   MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0)
2802   MCFG_TC0180VCU_BG_COLORBASE(0x30)
2803   MCFG_TC0180VCU_FG_COLORBASE(0x20)
2804   MCFG_TC0180VCU_TX_COLORBASE(0x00)
27842805   MCFG_TC0180VCU_GFXDECODE("gfxdecode")
27852806
27862807   /* sound hardware */
r29447r29448
28402861
28412862   MCFG_VIDEO_START_OVERRIDE(taitob_state,taitob_color_order0)
28422863
2843   MCFG_TC0180VCU_ADD("tc0180vcu", color0_tc0180vcu_intf)
2864   MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0)
2865   MCFG_TC0180VCU_BG_COLORBASE(0xc0)
2866   MCFG_TC0180VCU_FG_COLORBASE(0x80)
2867   MCFG_TC0180VCU_TX_COLORBASE(0x00)
28442868   MCFG_TC0180VCU_GFXDECODE("gfxdecode")
28452869
28462870   /* sound hardware */
r29447r29448
28992923
29002924   MCFG_HD63484_ADD("hd63484", realpunc_hd63484_intf)
29012925
2902   MCFG_TC0180VCU_ADD("tc0180vcu", color0_tc0180vcu_intf)
2926   MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0)
2927   MCFG_TC0180VCU_BG_COLORBASE(0xc0)
2928   MCFG_TC0180VCU_FG_COLORBASE(0x80)
2929   MCFG_TC0180VCU_TX_COLORBASE(0x00)
29032930   MCFG_TC0180VCU_GFXDECODE("gfxdecode")
29042931
29052932   /* sound hardware */

Previous 199869 Revisions Next


© 1997-2024 The MAME Team