Previous 199869 Revisions Next

r29492 Wednesday 9th April, 2014 at 16:20:33 UTC by Fabio Priuli
mb_vcu: updated to use inline configs. nw.
[src/emu/video]mb_vcu.c mb_vcu.h
[src/mame/drivers]mazerbla.c

trunk/src/emu/video/mb_vcu.c
r29491r29492
156156      device_video_interface(mconfig, *this),
157157      m_videoram_space_config("videoram", ENDIANNESS_LITTLE, 8, 19, 0, NULL, *ADDRESS_MAP_NAME(mb_vcu_vram)),
158158      m_paletteram_space_config("palram", ENDIANNESS_LITTLE, 8, 16, 0, NULL, *ADDRESS_MAP_NAME(mb_vcu_pal_ram)),
159      m_cpu(*this),
159160      m_palette(*this)
160161{
161162}
162163
163164//-------------------------------------------------
164//  device_config_complete - perform any
165//  operations now that the configuration is
166//  complete
167//-------------------------------------------------
168
169void mb_vcu_device::device_config_complete()
170{
171   // inherit a copy of the static data
172   const mb_vcu_interface *intf = reinterpret_cast<const mb_vcu_interface *>(static_config());
173   if (intf != NULL)
174   {
175      *static_cast<mb_vcu_interface *>(this) = *intf;
176   }
177
178   // or initialize to defaults if none provided
179   else
180   {
181      m_cpu_tag = NULL;
182      //m_screen_tag = NULL;
183   }
184}
185
186//-------------------------------------------------
187165//  device_validity_check - perform validity checks
188166//  on this device
189167//-------------------------------------------------
r29491r29492
200178void mb_vcu_device::device_start()
201179{
202180   // TODO: m_screen_tag
203   m_cpu = machine().device<cpu_device>(m_cpu_tag);
204181   m_ram = auto_alloc_array_clear(machine(), UINT8, 0x800);
205182   m_palram = auto_alloc_array_clear(machine(), UINT8, 0x100);
206183
trunk/src/emu/video/mb_vcu.h
r29491r29492
11// license: ?
22// copyright-holders: Angelo Salese
3/***************************************************************************
4
5Template for skeleton device
6
7***************************************************************************/
8
93#pragma once
104
115#ifndef __MB_VCUDEV_H__
126#define __MB_VCUDEV_H__
137
148
15
169//**************************************************************************
17//  INTERFACE CONFIGURATION MACROS
18//**************************************************************************
19
20#define MCFG_MB_VCU_ADD(_tag,_freq,_config, _palette_tag) \
21   MCFG_DEVICE_ADD(_tag, MB_VCU, _freq) \
22   MCFG_DEVICE_CONFIG(_config) \
23   mb_vcu_device::static_set_palette_tag(*device, "^" _palette_tag);
24
25//**************************************************************************
2610//  TYPE DEFINITIONS
2711//**************************************************************************
2812
29// ======================> mb_vcu_interface
30
31struct mb_vcu_interface
32{
33   const char         *m_cpu_tag;
34};
35
3613// ======================> mb_vcu_device
3714
3815class mb_vcu_device : public device_t,
3916                  public device_memory_interface,
40                  public device_video_interface,
41                  public mb_vcu_interface
17                  public device_video_interface
4218{
4319public:
4420   // construction/destruction
r29491r29492
4622
4723   // static configuration
4824   static void static_set_palette_tag(device_t &device, const char *tag);
25   static void set_cpu_tag(device_t &device, const char *tag) { downcast<mb_vcu_device &>(device).m_cpu.set_tag(tag); }
4926
5027   // I/O operations
5128   DECLARE_WRITE8_MEMBER( write_vregs );
r29491r29492
6542
6643protected:
6744   // device-level overrides
68   virtual void device_config_complete();
6945   virtual void device_validity_check(validity_checker &valid) const;
7046   virtual void device_start();
7147   virtual void device_reset();
r29491r29492
8157   UINT8 m_status;
8258   UINT8 *m_ram;
8359   UINT8 *m_palram;
84   cpu_device *m_cpu;
8560   UINT16 m_param_offset_latch;
8661
8762   INT16 m_xpos, m_ypos;
r29491r29492
9570   double m_weights_r[2];
9671   double m_weights_g[3];
9772   double m_weights_b[3];
73   required_device<cpu_device>     m_cpu;
9874   required_device<palette_device> m_palette;
9975};
10076
r29491r29492
10379extern const device_type MB_VCU;
10480
10581
106
10782//**************************************************************************
108//  GLOBAL VARIABLES
83//  INTERFACE CONFIGURATION MACROS
10984//**************************************************************************
11085
86#define MCFG_MB_VCU_CPU(_tag) \
87   mb_vcu_device::set_cpu_tag(*device, "^"_tag);
11188
89#define MCFG_MB_VCU_PALETTE(_palette_tag) \
90   mb_vcu_device::static_set_palette_tag(*device, "^" _palette_tag);
11291
11392#endif
trunk/src/mame/drivers/mazerbla.c
r29491r29492
14661466   m_maincpu->set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(mazerbla_state::irq_callback),this));
14671467}
14681468
1469static const mb_vcu_interface vcu_interface =
1470{
1471   "sub2"
1472};
1473
14741469static MACHINE_CONFIG_START( mazerbla, mazerbla_state )
14751470
14761471   /* basic machine hardware */
r29491r29492
14931488   MCFG_CPU_VBLANK_INT_DRIVER("screen", mazerbla_state,  irq0_line_hold)
14941489
14951490   /* synchronization forced on the fly */
1496   MCFG_MB_VCU_ADD("vcu",SOUND_CLOCK/4,vcu_interface,"palette")
1491   MCFG_DEVICE_ADD("vcu", MB_VCU, SOUND_CLOCK/4)
1492   MCFG_MB_VCU_CPU("sub2")
1493   MCFG_MB_VCU_PALETTE("palette")
14971494
14981495   /* video hardware */
14991496   MCFG_SCREEN_ADD("screen", RASTER)
r29491r29492
15301527    */
15311528   MCFG_CPU_VBLANK_INT_DRIVER("screen", mazerbla_state,  irq0_line_hold)
15321529
1533   MCFG_MB_VCU_ADD("vcu",SOUND_CLOCK/4,vcu_interface,"palette")
1530   MCFG_DEVICE_ADD("vcu", MB_VCU, SOUND_CLOCK/4)
1531   MCFG_MB_VCU_CPU("sub2")
1532   MCFG_MB_VCU_PALETTE("palette")
15341533
15351534   /* video hardware */
15361535   MCFG_SCREEN_ADD("screen", RASTER)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team