trunk/src/mame/drivers/mcr3.c
| r26319 | r26320 | |
| 1061 | 1061 | |
| 1062 | 1062 | static const gfx_layout spyhuntpr_alphalayout = |
| 1063 | 1063 | { |
| 1064 | | 16,16, |
| 1064 | 16,8, |
| 1065 | 1065 | RGN_FRAC(1,1), |
| 1066 | 1066 | 2, |
| 1067 | 1067 | { 0, 4}, |
| 1068 | 1068 | { 0, 0, 1, 1, 2, 2, 3, 3, 8, 8, 9, 9, 10, 10, 11, 11 }, |
| 1069 | | { 0, 0, 2*8, 2*8, 4*8, 4*8, 6*8, 6*8, 8*8, 8*8, 10*8, 10*8, 12*8, 12*8, 14*8, 14*8 }, |
| 1069 | { 0, 2*8, 4*8, 6*8, 8*8, 10*8, 12*8, 14*8 }, |
| 1070 | 1070 | 16*8 |
| 1071 | 1071 | }; |
| 1072 | 1072 | |
| r26319 | r26320 | |
| 1074 | 1074 | // not quite right |
| 1075 | 1075 | const gfx_layout spyhuntpr_sprite_layout = |
| 1076 | 1076 | { |
| 1077 | | 32,32, |
| 1077 | 32,16, |
| 1078 | 1078 | RGN_FRAC(1,4), |
| 1079 | 1079 | 4, |
| 1080 | 1080 | { RGN_FRAC(0,4), RGN_FRAC(1,4), RGN_FRAC(2,4), RGN_FRAC(3,4) }, |
| 1081 | 1081 | { 6,7, 4,5, 2,3, 0,1, 14,15, 12,13, 10,11, 8,9, 22,23, 20,21, 18,19, 16,17, 30,31, 28,29, 26,27, 24,25 }, |
| 1082 | | { 0*32,0*32,1*32,1*32,2*32,2*32,3*32,3*32,4*32,4*32,5*32,5*32,6*32,6*32,7*32,7*32,8*32,8*32,9*32,9*32,10*32,10*32,11*32,11*32,12*32,12*32,13*32,13*32,14*32,14*32,15*32,15*32 }, |
| 1082 | { 0*32,1*32,2*32,3*32,4*32,5*32,6*32,7*32,8*32,9*32,10*32,11*32,12*32,13*32,14*32,15*32 }, |
| 1083 | 1083 | |
| 1084 | 1084 | 16*32 |
| 1085 | 1085 | }; |
| r26319 | r26320 | |
| 1096 | 1096 | |
| 1097 | 1097 | static const gfx_layout spyhuntpr_charlayout = |
| 1098 | 1098 | { |
| 1099 | | 64,32, |
| 1099 | 64,16, |
| 1100 | 1100 | RGN_FRAC(1,8), |
| 1101 | 1101 | 4, |
| 1102 | 1102 | { 0, 2*8, 0x4000*8 + 0, 0x4000*8 + 2*8}, |
| 1103 | 1103 | EXTENDED_XOFFS, |
| 1104 | | { 0*8,0*8, 4*8,4*8, 8*8,8*8, 12*8,12*8, 16*8,16*8, 20*8,20*8, 24*8,24*8, 28*8,28*8, 1*8,1*8, 5*8,5*8, 9*8,9*8, 13*8,13*8, 17*8,17*8, 21*8,21*8, 25*8,25*8, 29*8,29*8 }, |
| 1104 | { 0*8, 4*8, 8*8, 12*8, 16*8, 20*8, 24*8, 28*8, 1*8, 5*8, 9*8, 13*8, 17*8, 21*8, 25*8, 29*8 }, |
| 1105 | 1105 | 32*8, |
| 1106 | 1106 | spyhuntp_charlayout_xoffset, |
| 1107 | 1107 | NULL |
| r26319 | r26320 | |
| 1228 | 1228 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 1229 | 1229 | MACHINE_CONFIG_END |
| 1230 | 1230 | |
| 1231 | | /* Spy Hunter prototype */ |
| 1232 | | static MACHINE_CONFIG_DERIVED( spyhuntpr, mcrscroll ) |
| 1233 | 1231 | |
| 1232 | static MACHINE_CONFIG_START( spyhuntpr, mcr3_state ) |
| 1233 | |
| 1234 | /* basic machine hardware */ |
| 1235 | MCFG_CPU_ADD("maincpu", Z80, MASTER_CLOCK/4) |
| 1236 | MCFG_CPU_PROGRAM_MAP(spyhunt_map) |
| 1237 | MCFG_CPU_IO_MAP(spyhunt_portmap) |
| 1238 | MCFG_CPU_CONFIG(mcr_daisy_chain) |
| 1239 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", mcr3_state, mcr_interrupt, "screen", 0, 1) |
| 1240 | |
| 1241 | MCFG_Z80CTC_ADD("ctc", MASTER_CLOCK/4 /* same as "maincpu" */, mcr_ctc_intf) |
| 1242 | |
| 1243 | MCFG_WATCHDOG_VBLANK_INIT(16) |
| 1244 | MCFG_MACHINE_START_OVERRIDE(mcr3_state,mcr) |
| 1245 | MCFG_MACHINE_RESET_OVERRIDE(mcr3_state,mcr) |
| 1246 | MCFG_NVRAM_ADD_0FILL("nvram") |
| 1247 | |
| 1248 | // sound hardware |
| 1249 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 1250 | |
| 1251 | /* video hardware */ |
| 1252 | MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK) |
| 1253 | |
| 1254 | /* basic machine hardware */ |
| 1255 | MCFG_MIDWAY_SSIO_ADD("ssio") |
| 1256 | MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) |
| 1257 | MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) |
| 1258 | |
| 1259 | /* video hardware */ |
| 1260 | MCFG_SCREEN_ADD("screen", RASTER) |
| 1261 | MCFG_SCREEN_REFRESH_RATE(60) |
| 1262 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) |
| 1263 | MCFG_SCREEN_SIZE(30*16, 30*8) |
| 1264 | MCFG_SCREEN_VISIBLE_AREA(0, 30*16-1, 0, 30*8-1) |
| 1265 | |
| 1234 | 1266 | MCFG_GFXDECODE(spyhuntpr) |
| 1267 | MCFG_PALETTE_LENGTH(64+4) |
| 1235 | 1268 | |
| 1269 | MCFG_PALETTE_INIT_OVERRIDE(mcr3_state,spyhunt) |
| 1270 | MCFG_VIDEO_START_OVERRIDE(mcr3_state,spyhuntpr) |
| 1271 | MCFG_SCREEN_UPDATE_DRIVER(mcr3_state, screen_update_spyhuntpr) |
| 1236 | 1272 | MACHINE_CONFIG_END |
| 1237 | 1273 | |
| 1238 | 1274 | |
| 1275 | |
| 1276 | |
| 1239 | 1277 | /************************************* |
| 1240 | 1278 | * |
| 1241 | 1279 | * ROM definitions |
| r26319 | r26320 | |
| 1807 | 1845 | /* MCR scrolling games */ |
| 1808 | 1846 | GAMEL(1983, spyhunt, 0, mcrsc_csd, spyhunt, mcr3_state, spyhunt, ROT90, "Bally Midway", "Spy Hunter", GAME_SUPPORTS_SAVE, layout_spyhunt ) |
| 1809 | 1847 | GAMEL(1983, spyhuntp, spyhunt, mcrsc_csd, spyhunt, mcr3_state, spyhunt, ROT90, "Bally Midway (Playtronic license)", "Spy Hunter (Playtronic license)", GAME_SUPPORTS_SAVE, layout_spyhunt ) |
| 1810 | | GAME (1983, spyhuntpr, spyhunt, spyhuntpr, spyhunt, mcr3_state, spyhuntpr, ROT0, "Bally Midway", "Spy Hunter (prototype)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) |
| 1848 | GAME (1983, spyhuntpr, spyhunt, spyhuntpr, spyhunt, mcr3_state, spyhuntpr, ROT90, "Bally Midway", "Spy Hunter (prototype)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) // or bootleg?? |
| 1811 | 1849 | GAME( 1984, crater, 0, mcrscroll, crater, mcr3_state, crater, ORIENTATION_FLIP_X, "Bally Midway", "Crater Raider", GAME_SUPPORTS_SAVE ) |
| 1812 | 1850 | GAMEL(1985, turbotag, 0, mcrsc_csd, turbotag, mcr3_state, turbotag, ROT90, "Bally Midway", "Turbo Tag (prototype)", GAME_SUPPORTS_SAVE, layout_turbotag ) |
trunk/src/mame/video/mcr3.c
| r26319 | r26320 | |
| 118 | 118 | save_item(NAME(m_spyhunt_scroll_offset)); |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | VIDEO_START_MEMBER(mcr3_state,spyhuntpr) |
| 122 | { |
| 123 | /* initialize the background tilemap */ |
| 124 | m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(mcr3_state::spyhunt_get_bg_tile_info),this), tilemap_mapper_delegate(FUNC(mcr3_state::spyhunt_bg_scan),this), 64,16, 64,32); |
| 121 | 125 | |
| 126 | /* initialize the text tilemap */ |
| 127 | m_alpha_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(mcr3_state::spyhunt_get_alpha_tile_info),this), TILEMAP_SCAN_COLS, 16,8, 32,32); |
| 128 | m_alpha_tilemap->set_transparent_pen(0); |
| 129 | m_alpha_tilemap->set_scrollx(0, 16); |
| 122 | 130 | |
| 131 | save_item(NAME(m_spyhunt_sprite_color_mask)); |
| 132 | save_item(NAME(m_spyhunt_scrollx)); |
| 133 | save_item(NAME(m_spyhunt_scrolly)); |
| 134 | save_item(NAME(m_spyhunt_scroll_offset)); |
| 135 | } |
| 136 | |
| 137 | |
| 123 | 138 | /************************************* |
| 124 | 139 | * |
| 125 | 140 | * Palette RAM writes |
| r26319 | r26320 | |
| 196 | 211 | * |
| 197 | 212 | *************************************/ |
| 198 | 213 | |
| 199 | | void mcr3_state::mcr3_update_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int color_mask, int code_xor, int dx, int dy) |
| 214 | void mcr3_state::mcr3_update_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int color_mask, int code_xor, int dx, int dy, int interlaced) |
| 200 | 215 | { |
| 201 | 216 | UINT8 *spriteram = m_spriteram; |
| 202 | 217 | int offs; |
| r26319 | r26320 | |
| 230 | 245 | flipx = flags & 0x10; |
| 231 | 246 | flipy = flags & 0x20; |
| 232 | 247 | sx = (spriteram[offs + 3] - 3) * 2; |
| 233 | | sy = (241 - spriteram[offs]) * 2; |
| 248 | sy = (241 - spriteram[offs]); |
| 234 | 249 | |
| 250 | if (interlaced == 1) sy *= 2; |
| 251 | |
| 235 | 252 | code ^= code_xor; |
| 236 | 253 | |
| 237 | 254 | sx += dx; |
| r26319 | r26320 | |
| 279 | 296 | m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); |
| 280 | 297 | |
| 281 | 298 | /* draw the sprites */ |
| 282 | | mcr3_update_sprites(screen, bitmap, cliprect, 0x03, 0, 0, 0); |
| 299 | mcr3_update_sprites(screen, bitmap, cliprect, 0x03, 0, 0, 0, 1); |
| 283 | 300 | return 0; |
| 284 | 301 | } |
| 285 | 302 | |
| r26319 | r26320 | |
| 293 | 310 | m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); |
| 294 | 311 | |
| 295 | 312 | /* draw the sprites */ |
| 296 | | mcr3_update_sprites(screen, bitmap, cliprect, m_spyhunt_sprite_color_mask, 0, -12, 0); |
| 313 | mcr3_update_sprites(screen, bitmap, cliprect, m_spyhunt_sprite_color_mask, 0, -12, 0, 1); |
| 297 | 314 | |
| 298 | 315 | /* render any characters on top */ |
| 299 | 316 | m_alpha_tilemap->draw(screen, bitmap, cliprect, 0, 0); |
| 300 | 317 | return 0; |
| 301 | 318 | } |
| 319 | |
| 320 | |
| 321 | UINT32 mcr3_state::screen_update_spyhuntpr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 322 | { |
| 323 | /* for every character in the Video RAM, check if it has been modified */ |
| 324 | /* since last time and update it accordingly. */ |
| 325 | m_bg_tilemap->set_scrollx(0, m_spyhunt_scrollx * 2 + m_spyhunt_scroll_offset); |
| 326 | m_bg_tilemap->set_scrolly(0, m_spyhunt_scrolly * 2); |
| 327 | m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); |
| 328 | |
| 329 | /* draw the sprites */ |
| 330 | mcr3_update_sprites(screen, bitmap, cliprect, m_spyhunt_sprite_color_mask, 0, -12, 0, 0); |
| 331 | |
| 332 | /* render any characters on top */ |
| 333 | m_alpha_tilemap->draw(screen, bitmap, cliprect, 0, 0); |
| 334 | return 0; |
| 335 | } |