Previous 199869 Revisions Next

r29441 Tuesday 8th April, 2014 at 10:31:03 UTC by Fabio Priuli
vrender0: converted to use inline config. nw.
[src/mame/drivers]crystal.c
[src/mame/video]vrender0.c vrender0.h

trunk/src/mame/video/vrender0.c
r29440r29441
2424const device_type VIDEO_VRENDER0 = &device_creator<vr0video_device>;
2525
2626vr0video_device::vr0video_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
27   : device_t(mconfig, VIDEO_VRENDER0, "VRender0 Video", tag, owner, clock, "vr0video", __FILE__)
27   : device_t(mconfig, VIDEO_VRENDER0, "VRender0 Video", tag, owner, clock, "vr0video", __FILE__),
28      m_cpu(*this)
2829{
2930}
3031
3132//-------------------------------------------------
32//  device_config_complete - perform any
33//  operations now that the configuration is
34//  complete
35//-------------------------------------------------
36
37void vr0video_device::device_config_complete()
38{
39   // inherit a copy of the static data
40   const vr0video_interface *intf = reinterpret_cast<const vr0video_interface *>(static_config());
41   if (intf != NULL)
42      *static_cast<vr0video_interface *>(this) = *intf;
43
44   // or initialize to defaults if none provided
45   else
46   {
47      m_cpu_tag = "";
48   }
49}
50
51//-------------------------------------------------
5233//  device_start - device-specific startup
5334//-------------------------------------------------
5435
5536void vr0video_device::device_start()
5637{
57   m_cpu = machine().device(m_cpu_tag);
58
5938   save_item(NAME(m_InternalPalette));
6039   save_item(NAME(m_LastPalUpdate));
6140
r29440r29441
418397//Returns TRUE if the operation was a flip (sync or async)
419398int vr0video_device::vrender0_ProcessPacket(UINT32 PacketPtr, UINT16 *Dest, UINT8 *TEXTURE)
420399{
421   address_space &space = m_cpu->memory().space(AS_PROGRAM);
400   address_space &space = m_cpu->space(AS_PROGRAM);
422401   UINT32 Dx = Packet(1) & 0x3ff;
423402   UINT32 Dy = Packet(2) & 0x1ff;
424403   UINT32 Endx = Packet(3) & 0x3ff;
trunk/src/mame/video/vrender0.h
r29440r29441
66 TYPE DEFINITIONS
77 ***************************************************************************/
88
9struct vr0video_interface
10{
11   const char *m_cpu_tag;
12};
13
149struct RenderStateInfo
1510{
1611   UINT32 Tx;
r29440r29441
3530   UINT32 Height;
3631};
3732
38
39class vr0video_device : public device_t,
40                              vr0video_interface
33class vr0video_device : public device_t
4134{
4235public:
4336   vr0video_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
r29440r29441
4538
4639   int vrender0_ProcessPacket(UINT32 PacketPtr, UINT16 *Dest, UINT8 *TEXTURE);
4740
41   static void set_cpu_tag(device_t &device, const char *tag) { downcast<vr0video_device &>(device).m_cpu.set_tag(tag); }
42
4843protected:
4944   // device-level overrides
50   virtual void device_config_complete();
5145   virtual void device_start();
5246   virtual void device_reset();
5347
5448private:
5549   // internal state
56   device_t *m_cpu;
50   required_device<cpu_device> m_cpu;
5751
5852   UINT16 m_InternalPalette[256];
5953   UINT32 m_LastPalUpdate;
r29440r29441
6660extern const device_type VIDEO_VRENDER0;
6761
6862
69#define MCFG_VIDEO_VRENDER0_ADD(_tag, _interface) \
70MCFG_DEVICE_ADD(_tag, VIDEO_VRENDER0, 0) \
71MCFG_DEVICE_CONFIG(_interface)
63#define MCFG_VIDEO_VRENDER0_CPU(_tag) \
64   vr0video_device::set_cpu_tag(*device, "^"_tag);
7265
7366#endif /* __VR0VIDEO_H__ */
trunk/src/mame/drivers/crystal.c
r29440r29441
900900   0x04800000
901901};
902902
903static const vr0video_interface vr0video_config =
904{
905   "maincpu"
906};
907
908903static MACHINE_CONFIG_START( crystal, crystal_state )
909904
910905   MCFG_CPU_ADD("maincpu", SE3208, 43000000)
911906   MCFG_CPU_PROGRAM_MAP(crystal_mem)
912907   MCFG_CPU_VBLANK_INT_DRIVER("screen", crystal_state,  crystal_interrupt)
913908
914
915909   MCFG_NVRAM_ADD_0FILL("nvram")
916910
917911   MCFG_SCREEN_ADD("screen", RASTER)
r29440r29441
923917   MCFG_SCREEN_VBLANK_DRIVER(crystal_state, screen_eof_crystal)
924918   MCFG_SCREEN_PALETTE("palette")
925919
926   MCFG_VIDEO_VRENDER0_ADD("vr0", vr0video_config)
920   MCFG_DEVICE_ADD("vr0", VIDEO_VRENDER0, 0)
921   MCFG_VIDEO_VRENDER0_CPU("maincpu")
927922
928923   MCFG_PALETTE_ADD_RRRRRGGGGGGBBBBB("palette")
929924
r29440r29441
11441139}
11451140
11461141
1147
1148
11491142GAME( 2001, crysbios,        0, crystal,  crystal, driver_device,         0, ROT0, "BrezzaSoft", "Crystal System BIOS", GAME_IS_BIOS_ROOT )
11501143GAME( 2001, crysking, crysbios, crystal,  crystal, crystal_state,  crysking, ROT0, "BrezzaSoft", "The Crystal of Kings", 0 )
11511144GAME( 2001, evosocc,  crysbios, crystal,  crystal, crystal_state,  evosocc,  ROT0, "Evoga", "Evolution Soccer", 0 )

Previous 199869 Revisions Next


© 1997-2024 The MAME Team