trunk/src/mame/video/vrender0.c
| r29440 | r29441 | |
| 24 | 24 | const device_type VIDEO_VRENDER0 = &device_creator<vr0video_device>; |
| 25 | 25 | |
| 26 | 26 | vr0video_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) |
| 28 | 29 | { |
| 29 | 30 | } |
| 30 | 31 | |
| 31 | 32 | //------------------------------------------------- |
| 32 | | // device_config_complete - perform any |
| 33 | | // operations now that the configuration is |
| 34 | | // complete |
| 35 | | //------------------------------------------------- |
| 36 | | |
| 37 | | void 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 | | //------------------------------------------------- |
| 52 | 33 | // device_start - device-specific startup |
| 53 | 34 | //------------------------------------------------- |
| 54 | 35 | |
| 55 | 36 | void vr0video_device::device_start() |
| 56 | 37 | { |
| 57 | | m_cpu = machine().device(m_cpu_tag); |
| 58 | | |
| 59 | 38 | save_item(NAME(m_InternalPalette)); |
| 60 | 39 | save_item(NAME(m_LastPalUpdate)); |
| 61 | 40 | |
| r29440 | r29441 | |
| 418 | 397 | //Returns TRUE if the operation was a flip (sync or async) |
| 419 | 398 | int vr0video_device::vrender0_ProcessPacket(UINT32 PacketPtr, UINT16 *Dest, UINT8 *TEXTURE) |
| 420 | 399 | { |
| 421 | | address_space &space = m_cpu->memory().space(AS_PROGRAM); |
| 400 | address_space &space = m_cpu->space(AS_PROGRAM); |
| 422 | 401 | UINT32 Dx = Packet(1) & 0x3ff; |
| 423 | 402 | UINT32 Dy = Packet(2) & 0x1ff; |
| 424 | 403 | UINT32 Endx = Packet(3) & 0x3ff; |
trunk/src/mame/video/vrender0.h
| r29440 | r29441 | |
| 6 | 6 | TYPE DEFINITIONS |
| 7 | 7 | ***************************************************************************/ |
| 8 | 8 | |
| 9 | | struct vr0video_interface |
| 10 | | { |
| 11 | | const char *m_cpu_tag; |
| 12 | | }; |
| 13 | | |
| 14 | 9 | struct RenderStateInfo |
| 15 | 10 | { |
| 16 | 11 | UINT32 Tx; |
| r29440 | r29441 | |
| 35 | 30 | UINT32 Height; |
| 36 | 31 | }; |
| 37 | 32 | |
| 38 | | |
| 39 | | class vr0video_device : public device_t, |
| 40 | | vr0video_interface |
| 33 | class vr0video_device : public device_t |
| 41 | 34 | { |
| 42 | 35 | public: |
| 43 | 36 | vr0video_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| r29440 | r29441 | |
| 45 | 38 | |
| 46 | 39 | int vrender0_ProcessPacket(UINT32 PacketPtr, UINT16 *Dest, UINT8 *TEXTURE); |
| 47 | 40 | |
| 41 | static void set_cpu_tag(device_t &device, const char *tag) { downcast<vr0video_device &>(device).m_cpu.set_tag(tag); } |
| 42 | |
| 48 | 43 | protected: |
| 49 | 44 | // device-level overrides |
| 50 | | virtual void device_config_complete(); |
| 51 | 45 | virtual void device_start(); |
| 52 | 46 | virtual void device_reset(); |
| 53 | 47 | |
| 54 | 48 | private: |
| 55 | 49 | // internal state |
| 56 | | device_t *m_cpu; |
| 50 | required_device<cpu_device> m_cpu; |
| 57 | 51 | |
| 58 | 52 | UINT16 m_InternalPalette[256]; |
| 59 | 53 | UINT32 m_LastPalUpdate; |
| r29440 | r29441 | |
| 66 | 60 | extern const device_type VIDEO_VRENDER0; |
| 67 | 61 | |
| 68 | 62 | |
| 69 | | #define MCFG_VIDEO_VRENDER0_ADD(_tag, _interface) \ |
| 70 | | MCFG_DEVICE_ADD(_tag, VIDEO_VRENDER0, 0) \ |
| 71 | | MCFG_DEVICE_CONFIG(_interface) |
| 63 | #define MCFG_VIDEO_VRENDER0_CPU(_tag) \ |
| 64 | vr0video_device::set_cpu_tag(*device, "^"_tag); |
| 72 | 65 | |
| 73 | 66 | #endif /* __VR0VIDEO_H__ */ |
trunk/src/mame/drivers/crystal.c
| r29440 | r29441 | |
| 900 | 900 | 0x04800000 |
| 901 | 901 | }; |
| 902 | 902 | |
| 903 | | static const vr0video_interface vr0video_config = |
| 904 | | { |
| 905 | | "maincpu" |
| 906 | | }; |
| 907 | | |
| 908 | 903 | static MACHINE_CONFIG_START( crystal, crystal_state ) |
| 909 | 904 | |
| 910 | 905 | MCFG_CPU_ADD("maincpu", SE3208, 43000000) |
| 911 | 906 | MCFG_CPU_PROGRAM_MAP(crystal_mem) |
| 912 | 907 | MCFG_CPU_VBLANK_INT_DRIVER("screen", crystal_state, crystal_interrupt) |
| 913 | 908 | |
| 914 | | |
| 915 | 909 | MCFG_NVRAM_ADD_0FILL("nvram") |
| 916 | 910 | |
| 917 | 911 | MCFG_SCREEN_ADD("screen", RASTER) |
| r29440 | r29441 | |
| 923 | 917 | MCFG_SCREEN_VBLANK_DRIVER(crystal_state, screen_eof_crystal) |
| 924 | 918 | MCFG_SCREEN_PALETTE("palette") |
| 925 | 919 | |
| 926 | | MCFG_VIDEO_VRENDER0_ADD("vr0", vr0video_config) |
| 920 | MCFG_DEVICE_ADD("vr0", VIDEO_VRENDER0, 0) |
| 921 | MCFG_VIDEO_VRENDER0_CPU("maincpu") |
| 927 | 922 | |
| 928 | 923 | MCFG_PALETTE_ADD_RRRRRGGGGGGBBBBB("palette") |
| 929 | 924 | |
| r29440 | r29441 | |
| 1144 | 1139 | } |
| 1145 | 1140 | |
| 1146 | 1141 | |
| 1147 | | |
| 1148 | | |
| 1149 | 1142 | GAME( 2001, crysbios, 0, crystal, crystal, driver_device, 0, ROT0, "BrezzaSoft", "Crystal System BIOS", GAME_IS_BIOS_ROOT ) |
| 1150 | 1143 | GAME( 2001, crysking, crysbios, crystal, crystal, crystal_state, crysking, ROT0, "BrezzaSoft", "The Crystal of Kings", 0 ) |
| 1151 | 1144 | GAME( 2001, evosocc, crysbios, crystal, crystal, crystal_state, evosocc, ROT0, "Evoga", "Evolution Soccer", 0 ) |