trunk/src/mame/drivers/crystal.cpp
r250349 | r250350 | |
140 | 140 | m_reset_patch(*this, "reset_patch"), |
141 | 141 | m_maincpu(*this, "maincpu"), |
142 | 142 | m_vr0(*this, "vr0"), |
143 | | m_ds1302(*this, "rtc") { } |
| 143 | m_ds1302(*this, "rtc"), |
| 144 | m_screen(*this, "screen") |
| 145 | { } |
144 | 146 | |
145 | 147 | /* memory pointers */ |
146 | 148 | required_shared_ptr<UINT32> m_sysregs; |
r250349 | r250350 | |
155 | 157 | required_device<cpu_device> m_maincpu; |
156 | 158 | required_device<vr0video_device> m_vr0; |
157 | 159 | required_device<ds1302_device> m_ds1302; |
| 160 | required_device<screen_device> m_screen; |
158 | 161 | |
159 | 162 | #ifdef IDLE_LOOP_SPEEDUP |
160 | 163 | UINT8 m_FlipCntRead; |
r250349 | r250350 | |
215 | 218 | void PatchReset( ); |
216 | 219 | UINT16 GetVidReg( address_space &space, UINT16 reg ); |
217 | 220 | void SetVidReg( address_space &space, UINT16 reg, UINT16 val ); |
| 221 | |
| 222 | |
218 | 223 | }; |
219 | 224 | |
220 | 225 | void crystal_state::IntReq( int num ) |
r250349 | r250350 | |
722 | 727 | |
723 | 728 | UINT32 crystal_state::screen_update_crystal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
724 | 729 | { |
| 730 | int xres = 320; |
| 731 | int yres = 240; |
| 732 | |
| 733 | // probably more registers around here control height / interlace enable etc. |
| 734 | // 0x341c looks like height, but doesn't change for interlace mode. |
| 735 | xres = m_sysregs[0x340c / 4]+1; |
| 736 | if (xres > 640) xres = 640; |
| 737 | |
| 738 | // force double height if 640 wide (probably a reg for this) |
| 739 | if (xres == 640) yres = 480; |
| 740 | |
| 741 | |
| 742 | rectangle visarea; |
| 743 | visarea.set(0, xres-1, 0, yres-1); |
| 744 | m_screen->configure(xres, yres, visarea, m_screen->frame_period().attoseconds() ); |
| 745 | |
| 746 | |
| 747 | |
725 | 748 | address_space &space = m_maincpu->space(AS_PROGRAM); |
726 | 749 | int DoFlip; |
727 | 750 | |
r250349 | r250350 | |
1056 | 1079 | MCFG_SCREEN_ADD("screen", RASTER) |
1057 | 1080 | MCFG_SCREEN_REFRESH_RATE(60) |
1058 | 1081 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
1059 | | MCFG_SCREEN_SIZE(320, 240) |
1060 | | MCFG_SCREEN_VISIBLE_AREA(0, 319, 0, 239) |
| 1082 | MCFG_SCREEN_SIZE(640, 480) |
| 1083 | MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 479) |
1061 | 1084 | MCFG_SCREEN_UPDATE_DRIVER(crystal_state, screen_update_crystal) |
1062 | 1085 | MCFG_SCREEN_VBLANK_DRIVER(crystal_state, screen_eof_crystal) |
1063 | 1086 | MCFG_SCREEN_PALETTE("palette") |
r250349 | r250350 | |
1077 | 1100 | MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) |
1078 | 1101 | MACHINE_CONFIG_END |
1079 | 1102 | |
1080 | | /* |
1081 | | Top blade screen is 32 pixels wider |
1082 | | */ |
1083 | | static MACHINE_CONFIG_DERIVED( topbladv, crystal ) |
1084 | 1103 | |
1085 | | MCFG_SCREEN_MODIFY("screen") |
1086 | | MCFG_SCREEN_SIZE(320+32, 240) |
1087 | | MCFG_SCREEN_VISIBLE_AREA(0, 319+32, 0, 239) |
1088 | | |
1089 | | MACHINE_CONFIG_END |
1090 | | |
1091 | 1104 | static MACHINE_CONFIG_DERIVED( trivrus, crystal ) |
1092 | 1105 | MCFG_CPU_MODIFY("maincpu") |
1093 | 1106 | MCFG_CPU_PROGRAM_MAP(trivrus_mem) |
1094 | | |
1095 | | MCFG_SCREEN_MODIFY("screen") |
1096 | | MCFG_SCREEN_SIZE(640, 480) |
1097 | | MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) |
1098 | 1107 | MACHINE_CONFIG_END |
1099 | 1108 | |
1100 | 1109 | |
r250349 | r250350 | |
1306 | 1315 | GAME( 2001, crysbios, 0, crystal, crystal, driver_device, 0, ROT0, "BrezzaSoft", "Crystal System BIOS", MACHINE_IS_BIOS_ROOT ) |
1307 | 1316 | GAME( 2001, crysking, crysbios, crystal, crystal, crystal_state, crysking, ROT0, "BrezzaSoft", "The Crystal of Kings", 0 ) |
1308 | 1317 | GAME( 2001, evosocc, crysbios, crystal, crystal, crystal_state, evosocc, ROT0, "Evoga", "Evolution Soccer", 0 ) |
1309 | | GAME( 2003, topbladv, crysbios, topbladv, crystal, crystal_state, topbladv, ROT0, "SonoKong / Expotato", "Top Blade V", 0 ) |
| 1318 | GAME( 2003, topbladv, crysbios, crystal, crystal, crystal_state, topbladv, ROT0, "SonoKong / Expotato", "Top Blade V", 0 ) |
1310 | 1319 | GAME( 2001, officeye, 0, crystal, officeye,crystal_state, officeye, ROT0, "Danbi", "Office Yeo In Cheon Ha (version 1.2)", MACHINE_NOT_WORKING ) // still has some instability issues |
1311 | 1320 | GAME( 2001, donghaer, 0, crystal, crystal, crystal_state, donghaer, ROT0, "Danbi", "Donggul Donggul Haerong", MACHINE_NOT_WORKING ) |
1312 | 1321 | GAME( 2009, trivrus, 0, trivrus, trivrus, driver_device, 0, ROT0, "AGT", "Trivia R Us (v1.07)", 0 ) |