src/mame/video/argus.c
| r3289 | r3290 | |
| 114 | 114 | ***************************************************************************/ |
| 115 | 115 | |
| 116 | 116 | #include "driver.h" |
| 117 | #include "jalblend.h" |
| 117 | 118 | |
| 118 | | #include "jalblend.c" |
| 119 | 119 | |
| 120 | | #define BUTASAN_TEXT_RAMSIZE 0x0800 |
| 121 | | #define BUTASAN_BG0_RAMSIZE 0x0800 |
| 122 | | #define BUTASAN_TXBACK_RAMSIZE 0x0800 |
| 123 | | #define BUTASAN_BG0BACK_RAMSIZE 0x0800 |
| 124 | | |
| 125 | | |
| 126 | 120 | UINT8 *argus_paletteram; |
| 127 | 121 | UINT8 *argus_txram; |
| 128 | 122 | UINT8 *argus_bg0_scrollx; |
| r3289 | r3290 | |
| 132 | 126 | UINT8 *argus_bg1_scrolly; |
| 133 | 127 | UINT8 *butasan_bg1ram; |
| 134 | 128 | |
| 129 | static int bg0_scrollx, bg0_scrolly; |
| 130 | static int bg1_scrollx, bg1_scrolly; |
| 131 | |
| 135 | 132 | static UINT8 *argus_dummy_bg0ram; |
| 136 | 133 | static UINT8 *butasan_txram; |
| 137 | 134 | static UINT8 *butasan_bg0ram; |
| 138 | 135 | static UINT8 *butasan_bg0backram; |
| 139 | 136 | static UINT8 *butasan_txbackram; |
| 137 | static UINT8 *butasan_pagedram[2]; |
| 138 | static UINT8 butasan_page_latch; |
| 140 | 139 | |
| 141 | 140 | static tilemap *tx_tilemap = NULL; |
| 142 | 141 | static tilemap *bg0_tilemap = NULL; |
| 143 | 142 | static tilemap *bg1_tilemap = NULL; |
| 144 | | static tilemap *bombsa_bg_tilemap = NULL; |
| 145 | 143 | |
| 146 | 144 | static UINT8 argus_bg_status; |
| 147 | 145 | static UINT8 butasan_bg1_status; |
| 148 | | static UINT8 argus_bg_purple = 0; |
| 149 | | static UINT8 argus_flipscreen = 0; |
| 146 | static UINT8 argus_flipscreen; |
| 150 | 147 | |
| 151 | | static int argus_palette_intensity = 0; |
| 148 | static UINT16 argus_palette_intensity; |
| 152 | 149 | |
| 153 | 150 | /* VROM scroll related for Argus */ |
| 154 | | static int lowbitscroll = 0; |
| 155 | | static int prvscrollx = 0; |
| 151 | static int lowbitscroll; |
| 152 | static int prvscrollx; |
| 156 | 153 | |
| 157 | | static UINT8 bombsa_ram_page; |
| 158 | | static UINT8* bomba_otherram; |
| 159 | | |
| 160 | | static int valtric_mosaic=0; |
| 154 | static UINT8 valtric_mosaic; |
| 161 | 155 | static bitmap_t *mosaicbitmap; |
| 162 | 156 | |
| 157 | static UINT8 valtric_unknown; |
| 158 | static UINT8 butasan_unknown; |
| 163 | 159 | |
| 160 | |
| 164 | 161 | /*************************************************************************** |
| 165 | 162 | Callbacks for the tilemap code |
| 166 | 163 | ***************************************************************************/ |
| 167 | 164 | |
| 168 | 165 | static TILE_GET_INFO( argus_get_tx_tile_info ) |
| 169 | 166 | { |
| 170 | | int hi, lo; |
| 167 | UINT8 hi, lo; |
| 171 | 168 | |
| 172 | | lo = argus_txram[ tile_index << 1 ]; |
| 173 | | hi = argus_txram[ (tile_index << 1) + 1 ]; |
| 169 | tile_index <<= 1; |
| 174 | 170 | |
| 171 | lo = argus_txram[tile_index]; |
| 172 | hi = argus_txram[tile_index + 1]; |
| 173 | |
| 175 | 174 | SET_TILE_INFO( |
| 176 | 175 | 3, |
| 177 | 176 | ((hi & 0xc0) << 2) | lo, |
| r3289 | r3290 | |
| 181 | 180 | |
| 182 | 181 | static TILE_GET_INFO( argus_get_bg0_tile_info ) |
| 183 | 182 | { |
| 184 | | int hi, lo; |
| 183 | UINT8 hi, lo; |
| 185 | 184 | |
| 186 | | lo = argus_dummy_bg0ram[ tile_index << 1 ]; |
| 187 | | hi = argus_dummy_bg0ram[ (tile_index << 1) + 1 ]; |
| 185 | tile_index <<= 1; |
| 188 | 186 | |
| 187 | lo = argus_dummy_bg0ram[tile_index]; |
| 188 | hi = argus_dummy_bg0ram[tile_index + 1]; |
| 189 | |
| 189 | 190 | SET_TILE_INFO( |
| 190 | 191 | 1, |
| 191 | 192 | ((hi & 0xc0) << 2) | lo, |
| r3289 | r3290 | |
| 195 | 196 | |
| 196 | 197 | static TILE_GET_INFO( argus_get_bg1_tile_info ) |
| 197 | 198 | { |
| 198 | | int hi, lo; |
| 199 | UINT8 hi, lo; |
| 199 | 200 | |
| 200 | | lo = argus_bg1ram[ tile_index << 1 ]; |
| 201 | | hi = argus_bg1ram[ (tile_index << 1) + 1 ]; |
| 201 | tile_index <<= 1; |
| 202 | 202 | |
| 203 | lo = argus_bg1ram[tile_index]; |
| 204 | hi = argus_bg1ram[tile_index + 1]; |
| 205 | |
| 203 | 206 | SET_TILE_INFO( |
| 204 | 207 | 2, |
| 205 | 208 | lo, |
| r3289 | r3290 | |
| 209 | 212 | |
| 210 | 213 | static TILE_GET_INFO( valtric_get_tx_tile_info ) |
| 211 | 214 | { |
| 212 | | int hi, lo; |
| 215 | UINT8 hi, lo; |
| 213 | 216 | |
| 214 | | lo = argus_txram[ tile_index << 1 ]; |
| 215 | | hi = argus_txram[ (tile_index << 1) + 1 ]; |
| 217 | tile_index <<= 1; |
| 216 | 218 | |
| 219 | lo = argus_txram[tile_index]; |
| 220 | hi = argus_txram[tile_index + 1]; |
| 221 | |
| 217 | 222 | SET_TILE_INFO( |
| 218 | 223 | 2, |
| 219 | 224 | ((hi & 0xc0) << 2) | lo, |
| r3289 | r3290 | |
| 223 | 228 | |
| 224 | 229 | static TILE_GET_INFO( valtric_get_bg_tile_info ) |
| 225 | 230 | { |
| 226 | | int hi, lo, color, tile; |
| 231 | UINT8 hi, lo; |
| 227 | 232 | |
| 228 | | lo = argus_bg1ram[ tile_index << 1 ]; |
| 229 | | hi = argus_bg1ram[ (tile_index << 1) + 1 ]; |
| 233 | tile_index <<= 1; |
| 230 | 234 | |
| 231 | | tile = ((hi & 0xc0) << 2) | ((hi & 0x20) << 5) | lo; |
| 232 | | color = hi & 0x0f; |
| 235 | lo = argus_bg1ram[tile_index]; |
| 236 | hi = argus_bg1ram[tile_index + 1]; |
| 233 | 237 | |
| 234 | 238 | SET_TILE_INFO( |
| 235 | 239 | 1, |
| 236 | | tile, |
| 237 | | color, |
| 240 | ((hi & 0xc0) << 2) | ((hi & 0x20) << 5) | lo, |
| 241 | hi & 0x0f, |
| 238 | 242 | 0); |
| 239 | 243 | } |
| 240 | 244 | |
| 241 | 245 | static TILE_GET_INFO( butasan_get_tx_tile_info ) |
| 242 | 246 | { |
| 243 | | int hi, lo; |
| 247 | UINT8 hi, lo; |
| 244 | 248 | |
| 245 | 249 | tile_index ^= 0x3e0; |
| 250 | tile_index <<= 1; |
| 246 | 251 | |
| 247 | | lo = butasan_txram[ tile_index << 1 ]; |
| 248 | | hi = butasan_txram[ (tile_index << 1) + 1 ]; |
| 252 | lo = butasan_txram[tile_index]; |
| 253 | hi = butasan_txram[tile_index + 1]; |
| 249 | 254 | |
| 250 | 255 | SET_TILE_INFO( |
| 251 | 256 | 3, |
| r3289 | r3290 | |
| 256 | 261 | |
| 257 | 262 | static TILE_GET_INFO( butasan_get_bg0_tile_info ) |
| 258 | 263 | { |
| 259 | | int hi, lo; |
| 264 | UINT8 hi, lo; |
| 260 | 265 | int attrib; |
| 261 | 266 | |
| 262 | | attrib = (tile_index & 0x00f) | ((tile_index & 0x1e0) >> 1); |
| 263 | | attrib |= ((tile_index & 0x200) >> 1) | ((tile_index & 0x010) << 5); |
| 267 | attrib = (tile_index & 0x00f) | ((tile_index & 0x3e0) >> 1) | ((tile_index & 0x010) << 5); |
| 264 | 268 | attrib ^= 0x0f0; |
| 269 | attrib <<= 1; |
| 265 | 270 | |
| 266 | | lo = butasan_bg0ram[ attrib << 1 ]; |
| 267 | | hi = butasan_bg0ram[ (attrib << 1) + 1 ]; |
| 271 | lo = butasan_bg0ram[attrib]; |
| 272 | hi = butasan_bg0ram[attrib + 1]; |
| 268 | 273 | |
| 269 | 274 | SET_TILE_INFO( |
| 270 | 275 | 1, |
| r3289 | r3290 | |
| 273 | 278 | TILE_FLIPYX((hi & 0x30) >> 4)); |
| 274 | 279 | } |
| 275 | 280 | |
| 276 | | |
| 277 | | |
| 278 | | |
| 279 | | |
| 280 | | |
| 281 | 281 | static TILE_GET_INFO( butasan_get_bg1_tile_info ) |
| 282 | 282 | { |
| 283 | | int bank, tile, attrib, color; |
| 283 | int attrib, tile; |
| 284 | 284 | |
| 285 | | attrib = (tile_index & 0x00f) | ((tile_index & 0x3e0) >> 1) |
| 286 | | | ((tile_index & 0x010) << 5); |
| 285 | attrib = (tile_index & 0x00f) | ((tile_index & 0x3e0) >> 1) | ((tile_index & 0x010) << 5); |
| 287 | 286 | attrib ^= 0x0f0; |
| 288 | 287 | |
| 289 | | bank = (butasan_bg1_status & 0x02) << 7; |
| 290 | | tile = butasan_bg1ram[ attrib ] | bank; |
| 291 | | color = (tile & 0x80) >> 7; |
| 288 | tile = butasan_bg1ram[attrib] | ((butasan_bg1_status & 2) << 7); |
| 292 | 289 | |
| 293 | 290 | SET_TILE_INFO( |
| 294 | 291 | 2, |
| 295 | 292 | tile, |
| 296 | | color, |
| 293 | (tile & 0x80) >> 7, |
| 297 | 294 | 0); |
| 298 | 295 | } |
| 299 | 296 | |
| r3289 | r3290 | |
| 302 | 299 | Initialize and destroy video hardware emulation |
| 303 | 300 | ***************************************************************************/ |
| 304 | 301 | |
| 305 | | static void reset_common(void) |
| 302 | static void reset_common(running_machine *machine) |
| 306 | 303 | { |
| 307 | 304 | argus_bg_status = 0x01; |
| 308 | | argus_bg_purple = 0; |
| 309 | 305 | argus_flipscreen = 0; |
| 310 | 306 | argus_palette_intensity = 0; |
| 307 | |
| 308 | if (jal_blend_table != NULL) |
| 309 | memset(jal_blend_table, 0, 0xc00); |
| 311 | 310 | } |
| 312 | 311 | |
| 313 | 312 | VIDEO_START( argus ) |
| 314 | 313 | { |
| 315 | | /* info offset type w h col row */ |
| 316 | | bg0_tilemap = tilemap_create(argus_get_bg0_tile_info, tilemap_scan_cols, 16, 16, 32, 32); |
| 317 | | bg1_tilemap = tilemap_create(argus_get_bg1_tile_info, tilemap_scan_cols, 16, 16, 32, 32); |
| 318 | | tx_tilemap = tilemap_create(argus_get_tx_tile_info, tilemap_scan_cols, 8, 8, 32, 32); |
| 314 | /* info offset w h col row */ |
| 315 | bg0_tilemap = tilemap_create(argus_get_bg0_tile_info, tilemap_scan_cols, 16, 16, 32, 32); |
| 316 | bg1_tilemap = tilemap_create(argus_get_bg1_tile_info, tilemap_scan_cols, 16, 16, 32, 32); |
| 317 | tx_tilemap = tilemap_create(argus_get_tx_tile_info, tilemap_scan_cols, 8, 8, 32, 32); |
| 319 | 318 | |
| 319 | tilemap_set_transparent_pen(bg1_tilemap, 15); |
| 320 | tilemap_set_transparent_pen(tx_tilemap, 15); |
| 321 | |
| 320 | 322 | /* dummy RAM for back ground */ |
| 321 | | argus_dummy_bg0ram = auto_malloc( 0x800 ); |
| 323 | argus_dummy_bg0ram = auto_malloc(0x800); |
| 322 | 324 | |
| 323 | | tilemap_set_transparent_pen( bg0_tilemap, 15 ); |
| 324 | | tilemap_set_transparent_pen( bg1_tilemap, 15 ); |
| 325 | | tilemap_set_transparent_pen( tx_tilemap, 15 ); |
| 326 | | |
| 327 | 325 | jal_blend_table = auto_malloc(0xc00); |
| 328 | 326 | } |
| 329 | 327 | |
| r3289 | r3290 | |
| 331 | 329 | { |
| 332 | 330 | lowbitscroll = 0; |
| 333 | 331 | prvscrollx = 0; |
| 334 | | |
| 335 | | memset( argus_dummy_bg0ram, 0, 0x800 ); |
| 336 | | memset( argus_bg0_scrollx, 0x00, 2 ); |
| 337 | | |
| 338 | | memset(jal_blend_table,0,0xc00); |
| 339 | | reset_common(); |
| 332 | argus_bg0_scrollx[0] = 0; |
| 333 | argus_bg0_scrollx[1] = 0; |
| 334 | memset(argus_dummy_bg0ram, 0, 0x800); |
| 335 | reset_common(machine); |
| 340 | 336 | } |
| 341 | 337 | |
| 342 | 338 | VIDEO_START( valtric ) |
| 343 | 339 | { |
| 344 | | /* info offset w h col row */ |
| 345 | | bg1_tilemap = tilemap_create(valtric_get_bg_tile_info, tilemap_scan_cols, 16, 16, 32, 32); |
| 346 | | tx_tilemap = tilemap_create(valtric_get_tx_tile_info, tilemap_scan_cols, 8, 8, 32, 32); |
| 340 | /* info offset w h col row */ |
| 341 | bg1_tilemap = tilemap_create(valtric_get_bg_tile_info, tilemap_scan_cols, 16, 16, 32, 32); |
| 342 | tx_tilemap = tilemap_create(valtric_get_tx_tile_info, tilemap_scan_cols, 8, 8, 32, 32); |
| 347 | 343 | |
| 348 | | tilemap_set_transparent_pen( bg1_tilemap, 15 ); |
| 349 | | tilemap_set_transparent_pen( tx_tilemap, 15 ); |
| 344 | tilemap_set_transparent_pen(tx_tilemap, 15); |
| 345 | |
| 350 | 346 | mosaicbitmap = video_screen_auto_bitmap_alloc(machine->primary_screen); |
| 347 | |
| 351 | 348 | jal_blend_table = auto_malloc(0xc00); |
| 352 | 349 | } |
| 353 | 350 | |
| 354 | 351 | VIDEO_RESET( valtric ) |
| 355 | 352 | { |
| 356 | | valtric_mosaic = 0; |
| 357 | | memset(jal_blend_table,0,0xc00); |
| 358 | | reset_common(); |
| 353 | valtric_mosaic = 0x0f; |
| 354 | reset_common(machine); |
| 359 | 355 | } |
| 360 | 356 | |
| 361 | 357 | VIDEO_START( butasan ) |
| 362 | 358 | { |
| 363 | | /* info offset type w h col row */ |
| 364 | | bg0_tilemap = tilemap_create(butasan_get_bg0_tile_info, tilemap_scan_rows, 16, 16, 32, 32); |
| 365 | | bg1_tilemap = tilemap_create(butasan_get_bg1_tile_info, tilemap_scan_rows, 16, 16, 32, 32); |
| 366 | | tx_tilemap = tilemap_create(butasan_get_tx_tile_info, tilemap_scan_rows, 8, 8, 32, 32); |
| 359 | /* info offset w h col row */ |
| 360 | bg0_tilemap = tilemap_create(butasan_get_bg0_tile_info, tilemap_scan_rows, 16, 16, 32, 32); |
| 361 | bg1_tilemap = tilemap_create(butasan_get_bg1_tile_info, tilemap_scan_rows, 16, 16, 32, 32); |
| 362 | tx_tilemap = tilemap_create(butasan_get_tx_tile_info, tilemap_scan_rows, 8, 8, 32, 32); |
| 367 | 363 | |
| 368 | | butasan_txram = auto_malloc( BUTASAN_TEXT_RAMSIZE ); |
| 369 | | butasan_bg0ram = auto_malloc( BUTASAN_BG0_RAMSIZE ); |
| 370 | | butasan_txbackram = auto_malloc( BUTASAN_TXBACK_RAMSIZE ); |
| 371 | | butasan_bg0backram = auto_malloc( BUTASAN_BG0BACK_RAMSIZE ); |
| 364 | tilemap_set_transparent_pen(bg1_tilemap, 15); |
| 365 | tilemap_set_transparent_pen(tx_tilemap, 15); |
| 372 | 366 | |
| 373 | | tilemap_set_transparent_pen( tx_tilemap, 15 ); |
| 367 | butasan_pagedram[0] = auto_malloc(0x1000); |
| 368 | butasan_pagedram[1] = auto_malloc(0x1000); |
| 374 | 369 | |
| 370 | butasan_bg0ram = &butasan_pagedram[0][0x000]; |
| 371 | butasan_bg0backram = &butasan_pagedram[0][0x800]; |
| 372 | butasan_txram = &butasan_pagedram[1][0x000]; |
| 373 | butasan_txbackram = &butasan_pagedram[1][0x800]; |
| 374 | |
| 375 | 375 | jal_blend_table = auto_malloc(0xc00); |
| 376 | //jal_blend_table = NULL; |
| 376 | 377 | } |
| 377 | 378 | |
| 378 | 379 | VIDEO_RESET( butasan ) |
| 379 | 380 | { |
| 381 | butasan_page_latch = 0; |
| 380 | 382 | butasan_bg1_status = 0x01; |
| 381 | | |
| 382 | | memset( butasan_txram, 0x00, BUTASAN_TEXT_RAMSIZE ); |
| 383 | | memset( butasan_bg0ram, 0x00, BUTASAN_BG0_RAMSIZE ); |
| 384 | | memset( butasan_txbackram, 0x00, BUTASAN_TXBACK_RAMSIZE ); |
| 385 | | memset( butasan_bg0backram, 0x00, BUTASAN_BG0BACK_RAMSIZE ); |
| 386 | | |
| 387 | | memset(jal_blend_table,0,0xc00); |
| 388 | | reset_common(); |
| 383 | memset(butasan_pagedram[0], 0, 0x1000); |
| 384 | memset(butasan_pagedram[1], 0, 0x1000); |
| 385 | reset_common(machine); |
| 389 | 386 | } |
| 390 | 387 | |
| 391 | | #if 0 |
| 392 | | static TILE_GET_INFO( bombsa_get_tx_alt_tile_info ) |
| 393 | | { |
| 394 | | int hi, lo; |
| 395 | 388 | |
| 396 | | lo = bombsa_tx_alt_ram[ tile_index << 1 ]; |
| 397 | | hi = bombsa_tx_alt_ram[ (tile_index << 1) + 1 ]; |
| 398 | | |
| 399 | | SET_TILE_INFO( |
| 400 | | 2, |
| 401 | | ((hi & 0xc0) << 2) | lo, |
| 402 | | hi & 0x0f, |
| 403 | | TILE_FLIPYX((hi & 0x30) >> 4)); |
| 404 | | } |
| 405 | | #endif |
| 406 | | |
| 407 | | static TILE_GET_INFO( bombsa_get_bg_tile_info ) |
| 408 | | { |
| 409 | | int tileno; |
| 410 | | int col; |
| 411 | | |
| 412 | | tileno = bomba_otherram[tile_index*2] | ( bomba_otherram[tile_index*2+1]<<8); |
| 413 | | col = 0; |
| 414 | | |
| 415 | | SET_TILE_INFO( |
| 416 | | 1, |
| 417 | | tileno, |
| 418 | | col, |
| 419 | | 0); |
| 420 | | } |
| 421 | | |
| 422 | | |
| 423 | | VIDEO_START( bombsa ) |
| 424 | | { |
| 425 | | /* info offset type w h col row */ |
| 426 | | // bg1_tilemap = tilemap_create(valtric_get_bg_tile_info, tilemap_scan_cols, 16, 16, 32, 32); |
| 427 | | tx_tilemap = tilemap_create(valtric_get_tx_tile_info, tilemap_scan_cols, 8, 8, 32, 32); |
| 428 | | |
| 429 | | #if 0 |
| 430 | | /* this might be wrong.. but it looks like there may be a tilemap here that can change between 8x8 and 16x16 mode.. */ |
| 431 | | /* when you start the game it gets 'corrupted' with data for another layer.. */ |
| 432 | | tx_alt_tilemap = tilemap_create(bombsa_get_tx_alt_tile_info, tilemap_scan_cols, 8, 8, 32, 32); |
| 433 | | #endif |
| 434 | | |
| 435 | | bombsa_bg_tilemap = tilemap_create(bombsa_get_bg_tile_info, tilemap_scan_cols, 16, 16, 64, 32); |
| 436 | | |
| 437 | | #if 0 |
| 438 | | bombsa_tx_alt_ram = auto_malloc(0x800); |
| 439 | | #endif |
| 440 | | |
| 441 | | // tilemap_set_transparent_pen( bg1_tilemap, 15 ); |
| 442 | | tilemap_set_transparent_pen( tx_tilemap, 15 ); |
| 443 | | #if 0 |
| 444 | | tilemap_set_transparent_pen( tx_alt_tilemap, 15 ); |
| 445 | | #endif |
| 446 | | // jal_blend_table = auto_malloc(0xc00); |
| 447 | | // memset(jal_blend_table,0,0xc00) ; |
| 448 | | |
| 449 | | bomba_otherram = auto_malloc(0x1000); |
| 450 | | } |
| 451 | | |
| 452 | | VIDEO_RESET( bombsa ) |
| 453 | | { |
| 454 | | bombsa_ram_page = 0; |
| 455 | | memset(bomba_otherram, 0, 0x1000); |
| 456 | | reset_common(); |
| 457 | | } |
| 458 | | |
| 459 | 389 | /*************************************************************************** |
| 460 | 390 | Functions for handler of MAP roms in Argus and palette color |
| 461 | 391 | ***************************************************************************/ |
| 462 | 392 | |
| 463 | 393 | /* Write bg0 pattern data to dummy bg0 ram */ |
| 464 | | static void argus_write_dummy_rams( running_machine *machine, int dramoffs, int vromoffs ) |
| 394 | static void argus_write_dummy_rams(running_machine *machine, int dramoffs, int vromoffs) |
| 465 | 395 | { |
| 466 | 396 | int i; |
| 467 | 397 | int voffs; |
| 468 | 398 | int offs; |
| 469 | 399 | |
| 470 | | UINT8 *VROM1 = memory_region( machine, "user1" ); /* "ag_15.bin" */ |
| 471 | | UINT8 *VROM2 = memory_region( machine, "user2" ); /* "ag_16.bin" */ |
| 400 | UINT8 *VROM1 = memory_region(machine, "user1"); /* "ag_15.bin" */ |
| 401 | UINT8 *VROM2 = memory_region(machine, "user2"); /* "ag_16.bin" */ |
| 472 | 402 | |
| 473 | 403 | /* offset in pattern data */ |
| 474 | | offs = VROM1[ vromoffs ] | ( VROM1[ vromoffs + 1 ] << 8 ); |
| 404 | offs = VROM1[vromoffs] | (VROM1[vromoffs + 1] << 8); |
| 475 | 405 | offs &= 0x7ff; |
| 476 | 406 | |
| 477 | 407 | voffs = offs * 16; |
| 478 | | for (i = 0 ; i < 8 ; i ++) |
| 408 | for (i = 0; i < 8; i++) |
| 479 | 409 | { |
| 480 | | argus_dummy_bg0ram[ dramoffs ] = VROM2[ voffs ]; |
| 481 | | argus_dummy_bg0ram[ dramoffs + 1 ] = VROM2[ voffs + 1 ]; |
| 482 | | tilemap_mark_tile_dirty( bg0_tilemap, dramoffs >> 1 ); |
| 410 | argus_dummy_bg0ram[dramoffs] = VROM2[voffs]; |
| 411 | argus_dummy_bg0ram[dramoffs + 1] = VROM2[voffs + 1]; |
| 412 | tilemap_mark_tile_dirty(bg0_tilemap, dramoffs >> 1); |
| 483 | 413 | dramoffs += 2; |
| 484 | 414 | voffs += 2; |
| 485 | 415 | } |
| 486 | 416 | } |
| 487 | 417 | |
| 488 | | |
| 489 | | static void bombsa_change_palette(running_machine *machine, int color, int data) |
| 418 | static void argus_change_palette(running_machine *machine, int color, int lo_offs, int hi_offs) |
| 490 | 419 | { |
| 491 | | palette_set_color_rgb(machine, color, pal4bit(data >> 12), pal4bit(data >> 8), pal4bit(data >> 4)); |
| 420 | UINT8 lo = argus_paletteram[lo_offs]; |
| 421 | UINT8 hi = argus_paletteram[hi_offs]; |
| 422 | if (jal_blend_table != NULL) jal_blend_table[color] = hi & 0x0f; |
| 423 | palette_set_color_rgb(machine, color, pal4bit(lo >> 4), pal4bit(lo), pal4bit(hi >> 4)); |
| 492 | 424 | } |
| 493 | 425 | |
| 494 | | |
| 495 | | static void argus_change_palette(running_machine *machine, int color, int data) |
| 426 | static void argus_change_bg_palette(running_machine *machine, int color, int lo_offs, int hi_offs) |
| 496 | 427 | { |
| 497 | | jal_blend_table[color] = data & 0x0f ; |
| 428 | UINT8 r,g,b,lo,hi,ir,ig,ib,ix; |
| 429 | rgb_t rgb,irgb; |
| 498 | 430 | |
| 499 | | palette_set_color_rgb(machine, color, pal4bit(data >> 12), pal4bit(data >> 8), pal4bit(data >> 4)); |
| 500 | | } |
| 431 | /* red,green,blue intensities */ |
| 432 | ir = pal4bit(argus_palette_intensity >> 12); |
| 433 | ig = pal4bit(argus_palette_intensity >> 8); |
| 434 | ib = pal4bit(argus_palette_intensity >> 4); |
| 435 | ix = argus_palette_intensity & 0x0f; |
| 501 | 436 | |
| 502 | | static void argus_change_bg_palette(running_machine *machine, int color, int data) |
| 503 | | { |
| 504 | | int r, g, b; |
| 505 | | int ir, ig, ib; |
| 437 | irgb = MAKE_RGB(ir,ig,ib); |
| 506 | 438 | |
| 507 | | r = (data >> 12) & 0x0f; |
| 508 | | g = (data >> 8) & 0x0f; |
| 509 | | b = (data >> 4) & 0x0f; |
| 439 | lo = argus_paletteram[lo_offs]; |
| 440 | hi = argus_paletteram[hi_offs]; |
| 510 | 441 | |
| 511 | | ir = (argus_palette_intensity >> 12) & 0x0f; |
| 512 | | ig = (argus_palette_intensity >> 8) & 0x0f; |
| 513 | | ib = (argus_palette_intensity >> 4) & 0x0f; |
| 442 | /* red,green,blue component */ |
| 443 | r = pal4bit(lo >> 4); |
| 444 | g = pal4bit(lo); |
| 445 | b = pal4bit(hi >> 4); |
| 514 | 446 | |
| 515 | | r = (r - ir > 0) ? r - ir : 0; |
| 516 | | g = (g - ig > 0) ? g - ig : 0; |
| 517 | | b = (b - ib > 0) ? b - ib : 0; |
| 518 | | |
| 519 | | if (argus_bg_status & 2) /* Gray / purple scale */ |
| 447 | /* Grey background enable */ |
| 448 | if (argus_bg_status & 2) |
| 520 | 449 | { |
| 521 | | r = (r + g + b) / 3; |
| 522 | | g = b = r; |
| 523 | | if (argus_bg_purple == 2) /* Purple */ |
| 524 | | g = 0; |
| 450 | UINT8 val = (r + g + b) / 3; |
| 451 | rgb = MAKE_RGB(val,val,val); |
| 525 | 452 | } |
| 453 | else |
| 454 | { |
| 455 | rgb = MAKE_RGB(r,g,b); |
| 456 | } |
| 526 | 457 | |
| 527 | | palette_set_color_rgb(machine, color, pal4bit(r), pal4bit(g), pal4bit(b)); |
| 458 | rgb = jal_blend_func(rgb,irgb,ix); |
| 459 | |
| 460 | palette_set_color(machine,color,rgb); |
| 528 | 461 | } |
| 529 | 462 | |
| 530 | 463 | |
| r3289 | r3290 | |
| 532 | 465 | Memory handler |
| 533 | 466 | ***************************************************************************/ |
| 534 | 467 | |
| 535 | | WRITE8_HANDLER(valtric_mosaic_w) |
| 468 | WRITE8_HANDLER( valtric_mosaic_w ) |
| 536 | 469 | { |
| 537 | | if(data!=0x80) |
| 538 | | { |
| 539 | | valtric_mosaic=0x0f-(data&0x0f); |
| 540 | | |
| 541 | | if(valtric_mosaic!=0) |
| 542 | | { |
| 543 | | valtric_mosaic++; |
| 544 | | } |
| 545 | | |
| 546 | | if(data&0x80) |
| 547 | | { |
| 548 | | valtric_mosaic*=-1; |
| 549 | | } |
| 550 | | } |
| 470 | valtric_mosaic = data; |
| 551 | 471 | } |
| 552 | 472 | |
| 553 | | |
| 554 | | WRITE8_HANDLER( bombsa_pageselect_w ) |
| 555 | | { |
| 556 | | bombsa_ram_page = data; |
| 557 | | } |
| 558 | | |
| 559 | 473 | READ8_HANDLER( argus_txram_r ) |
| 560 | 474 | { |
| 561 | | return argus_txram[ offset ]; |
| 475 | return argus_txram[offset]; |
| 562 | 476 | } |
| 563 | 477 | |
| 564 | 478 | WRITE8_HANDLER( argus_txram_w ) |
| 565 | 479 | { |
| 566 | | argus_txram[ offset ] = data; |
| 480 | argus_txram[offset] = data; |
| 567 | 481 | tilemap_mark_tile_dirty(tx_tilemap, offset >> 1); |
| 568 | 482 | } |
| 569 | 483 | |
| 570 | | READ8_HANDLER( bombsa_txram_r ) |
| 571 | | { |
| 572 | | #if 0 |
| 573 | | if (bombsa_ram_page == 1) |
| 574 | | { |
| 575 | | return argus_txram[ offset ]; |
| 576 | | } |
| 577 | | else |
| 578 | | { |
| 579 | | return bombsa_tx_alt_ram[ offset ]; |
| 580 | | } |
| 581 | | #endif |
| 582 | | |
| 583 | | return argus_txram[ offset ]; |
| 584 | | |
| 585 | | } |
| 586 | | |
| 587 | | WRITE8_HANDLER( bombsa_txram_w ) |
| 588 | | { |
| 589 | | #if 0 |
| 590 | | if (bombsa_ram_page == 1) |
| 591 | | { |
| 592 | | argus_txram[ offset ] = data; |
| 593 | | tilemap_mark_tile_dirty(tx_tilemap, offset >> 1); |
| 594 | | } |
| 595 | | else |
| 596 | | { |
| 597 | | /* 8x8 .. */ |
| 598 | | bombsa_tx_alt_ram[ offset ] = data; |
| 599 | | tilemap_mark_tile_dirty(tx_alt_tilemap, offset >> 1); |
| 600 | | /* also 16x16 ..? */ |
| 601 | | } |
| 602 | | #endif |
| 603 | | argus_txram[ offset ] = data; |
| 604 | | tilemap_mark_tile_dirty(tx_tilemap, offset >> 1); |
| 605 | | } |
| 606 | | |
| 607 | | READ8_HANDLER( butasan_txram_r ) |
| 608 | | { |
| 609 | | return butasan_txram[ offset ]; |
| 610 | | } |
| 611 | | |
| 612 | | WRITE8_HANDLER( butasan_txram_w ) |
| 613 | | { |
| 614 | | butasan_txram[ offset ] = data; |
| 615 | | tilemap_mark_tile_dirty(tx_tilemap, (offset ^ 0x7c0) >> 1); |
| 616 | | } |
| 617 | | |
| 618 | 484 | READ8_HANDLER( argus_bg1ram_r ) |
| 619 | 485 | { |
| 620 | | return argus_bg1ram[ offset ]; |
| 486 | return argus_bg1ram[offset]; |
| 621 | 487 | } |
| 622 | 488 | |
| 623 | 489 | WRITE8_HANDLER( argus_bg1ram_w ) |
| 624 | 490 | { |
| 625 | | argus_bg1ram[ offset ] = data; |
| 491 | argus_bg1ram[offset] = data; |
| 626 | 492 | tilemap_mark_tile_dirty(bg1_tilemap, offset >> 1); |
| 627 | 493 | } |
| 628 | 494 | |
| 629 | | READ8_HANDLER( butasan_bg0ram_r ) |
| 495 | WRITE8_HANDLER( argus_bg0_scrollx_w ) |
| 630 | 496 | { |
| 631 | | return butasan_bg0ram[ offset ]; |
| 497 | argus_bg0_scrollx[offset] = data; |
| 498 | bg0_scrollx = argus_bg0_scrollx[0] | (argus_bg0_scrollx[1] << 8); |
| 632 | 499 | } |
| 633 | 500 | |
| 634 | | WRITE8_HANDLER( butasan_bg0ram_w ) |
| 635 | | { |
| 636 | | int idx; |
| 637 | | |
| 638 | | butasan_bg0ram[ offset ] = data; |
| 639 | | |
| 640 | | idx = ((offset & 0x01f) >> 1) | ((offset & 0x400) >> 6); |
| 641 | | idx |= (offset & 0x3e0) ^ 0x1e0; |
| 642 | | |
| 643 | | tilemap_mark_tile_dirty(bg0_tilemap, idx); |
| 644 | | } |
| 645 | | |
| 646 | | READ8_HANDLER( butasan_bg1ram_r ) |
| 647 | | { |
| 648 | | return butasan_bg1ram[ offset ]; |
| 649 | | } |
| 650 | | |
| 651 | | WRITE8_HANDLER( butasan_bg1ram_w ) |
| 652 | | { |
| 653 | | int idx; |
| 654 | | |
| 655 | | butasan_bg1ram[ offset ] = data; |
| 656 | | |
| 657 | | idx = (offset & 0x00f) | ((offset & 0x200) >> 5) | ((offset & 0x1f0) << 1); |
| 658 | | idx ^= 0x0f0; |
| 659 | | |
| 660 | | tilemap_mark_tile_dirty(bg1_tilemap, idx); |
| 661 | | } |
| 662 | | |
| 663 | | WRITE8_HANDLER ( argus_bg0_scrollx_w ) |
| 664 | | { |
| 665 | | if (argus_bg0_scrollx[ offset ] != data) |
| 666 | | { |
| 667 | | argus_bg0_scrollx[ offset ] = data; |
| 668 | | } |
| 669 | | } |
| 670 | | |
| 671 | 501 | WRITE8_HANDLER( argus_bg0_scrolly_w ) |
| 672 | 502 | { |
| 673 | | if (argus_bg0_scrolly[ offset ] != data) |
| 674 | | { |
| 675 | | int scrolly; |
| 676 | | argus_bg0_scrolly[ offset ] = data; |
| 677 | | scrolly = argus_bg0_scrolly[0] | ( (argus_bg0_scrolly[1] & 0x01) << 8); |
| 678 | | if (!argus_flipscreen) |
| 679 | | tilemap_set_scrolly( bg0_tilemap, 0, scrolly ); |
| 680 | | else |
| 681 | | tilemap_set_scrolly( bg0_tilemap, 0, (scrolly + 256) & 0x1ff ); |
| 682 | | } |
| 503 | argus_bg0_scrolly[offset] = data; |
| 504 | bg0_scrolly = argus_bg0_scrolly[0] | (argus_bg0_scrolly[1] << 8); |
| 683 | 505 | } |
| 684 | 506 | |
| 685 | | WRITE8_HANDLER( butasan_bg0_scrollx_w ) |
| 686 | | { |
| 687 | | if (argus_bg0_scrollx[ offset ] != data) |
| 688 | | { |
| 689 | | int scrollx; |
| 690 | | argus_bg0_scrollx[ offset ] = data; |
| 691 | | scrollx = argus_bg0_scrollx[0] | ( (argus_bg0_scrollx[1] & 0x01) << 8); |
| 692 | | if (!argus_flipscreen) |
| 693 | | tilemap_set_scrollx( bg0_tilemap, 0, scrollx ); |
| 694 | | else |
| 695 | | tilemap_set_scrollx( bg0_tilemap, 0, (scrollx + 256) & 0x1ff ); |
| 696 | | } |
| 697 | | } |
| 698 | | |
| 699 | 507 | WRITE8_HANDLER( argus_bg1_scrollx_w ) |
| 700 | 508 | { |
| 701 | | if (argus_bg1_scrollx[ offset ] != data) |
| 702 | | { |
| 703 | | int scrollx; |
| 704 | | argus_bg1_scrollx[ offset ] = data; |
| 705 | | scrollx = argus_bg1_scrollx[0] | ( (argus_bg1_scrollx[1] & 0x01) << 8); |
| 706 | | if (!argus_flipscreen) |
| 707 | | tilemap_set_scrollx( bg1_tilemap, 0, scrollx ); |
| 708 | | else |
| 709 | | tilemap_set_scrollx( bg1_tilemap, 0, (scrollx + 256) & 0x1ff ); |
| 710 | | } |
| 509 | argus_bg1_scrollx[offset] = data; |
| 510 | bg1_scrollx = argus_bg1_scrollx[0] | (argus_bg1_scrollx[1] << 8); |
| 711 | 511 | } |
| 712 | 512 | |
| 713 | 513 | WRITE8_HANDLER( argus_bg1_scrolly_w ) |
| 714 | 514 | { |
| 715 | | if (argus_bg1_scrolly[ offset ] != data) |
| 716 | | { |
| 717 | | int scrolly; |
| 718 | | argus_bg1_scrolly[ offset ] = data; |
| 719 | | scrolly = argus_bg1_scrolly[0] | ( (argus_bg1_scrolly[1] & 0x01) << 8); |
| 720 | | if (!argus_flipscreen) |
| 721 | | tilemap_set_scrolly( bg1_tilemap, 0, scrolly ); |
| 722 | | else |
| 723 | | tilemap_set_scrolly( bg1_tilemap, 0, (scrolly + 256) & 0x1ff ); |
| 724 | | } |
| 515 | argus_bg1_scrolly[offset] = data; |
| 516 | bg1_scrolly = argus_bg1_scrolly[0] | (argus_bg1_scrolly[1] << 8); |
| 725 | 517 | } |
| 726 | 518 | |
| 727 | 519 | WRITE8_HANDLER( argus_bg_status_w ) |
| r3289 | r3290 | |
| 730 | 522 | { |
| 731 | 523 | argus_bg_status = data; |
| 732 | 524 | |
| 733 | | /* Backgound enable */ |
| 734 | | tilemap_set_enable(bg1_tilemap, argus_bg_status & 1); |
| 735 | | |
| 736 | 525 | /* Gray / purple scale */ |
| 737 | 526 | if (argus_bg_status & 2) |
| 738 | 527 | { |
| 739 | 528 | int offs; |
| 740 | 529 | |
| 741 | | for (offs = 0x400 ; offs < 0x500 ; offs ++) |
| 530 | for (offs = 0x400; offs < 0x500; offs++) |
| 742 | 531 | { |
| 743 | | argus_change_bg_palette( machine, (offs - 0x0400) + 128, |
| 744 | | (argus_paletteram[offs] << 8) | argus_paletteram[offs + 0x0400] ); |
| 532 | argus_change_bg_palette(machine, (offs - 0x400) + 0x080, offs, offs + 0x400); |
| 745 | 533 | } |
| 746 | 534 | } |
| 747 | 535 | } |
| r3289 | r3290 | |
| 753 | 541 | { |
| 754 | 542 | argus_bg_status = data; |
| 755 | 543 | |
| 756 | | /* Backgound enable */ |
| 757 | | tilemap_set_enable(bg1_tilemap, argus_bg_status & 1); |
| 758 | | |
| 759 | 544 | /* Gray / purple scale */ |
| 760 | 545 | if (argus_bg_status & 2) |
| 761 | 546 | { |
| 762 | 547 | int offs; |
| 763 | 548 | |
| 764 | | for (offs = 0x400 ; offs < 0x600 ; offs += 2) |
| 549 | for (offs = 0x400; offs < 0x600; offs += 2) |
| 765 | 550 | { |
| 766 | | argus_change_bg_palette( machine, ((offs - 0x0400) >> 1) + 256, |
| 767 | | argus_paletteram[offs | 1] | (argus_paletteram[offs & ~1] << 8)); |
| 551 | argus_change_bg_palette(machine, ((offs - 0x400) >> 1) + 0x100, offs & ~1, offs | 1); |
| 768 | 552 | } |
| 769 | 553 | } |
| 770 | 554 | } |
| r3289 | r3290 | |
| 772 | 556 | |
| 773 | 557 | WRITE8_HANDLER( butasan_bg0_status_w ) |
| 774 | 558 | { |
| 775 | | if (argus_bg_status != data) |
| 559 | argus_bg_status = data; |
| 560 | } |
| 561 | |
| 562 | WRITE8_HANDLER( butasan_bg1_status_w ) |
| 563 | { |
| 564 | if (butasan_bg1_status != data) |
| 776 | 565 | { |
| 777 | | argus_bg_status = data; |
| 566 | butasan_bg1_status = data; |
| 778 | 567 | |
| 779 | | /* Backgound enable */ |
| 780 | | tilemap_set_enable(bg0_tilemap, argus_bg_status & 1); |
| 568 | /* Bank changed */ |
| 569 | tilemap_mark_all_tiles_dirty(bg1_tilemap); |
| 781 | 570 | } |
| 782 | 571 | } |
| 783 | 572 | |
| 784 | 573 | WRITE8_HANDLER( argus_flipscreen_w ) |
| 785 | 574 | { |
| 786 | | if (argus_flipscreen != (data >> 7)) |
| 787 | | { |
| 788 | | argus_flipscreen = data >> 7; |
| 789 | | tilemap_set_flip( ALL_TILEMAPS, (argus_flipscreen) ? TILEMAP_FLIPY | TILEMAP_FLIPX : 0); |
| 790 | | if (!argus_flipscreen) |
| 791 | | { |
| 792 | | int scrollx, scrolly; |
| 793 | | |
| 794 | | if (bg0_tilemap != NULL) |
| 795 | | { |
| 796 | | scrollx = argus_bg0_scrollx[0] | ( (argus_bg0_scrollx[1] & 0x01) << 8); |
| 797 | | tilemap_set_scrollx(bg0_tilemap, 0, scrollx & 0x1ff); |
| 798 | | |
| 799 | | scrolly = argus_bg0_scrolly[0] | ( (argus_bg0_scrolly[1] & 0x01) << 8); |
| 800 | | tilemap_set_scrolly(bg0_tilemap, 0, scrolly); |
| 801 | | } |
| 802 | | scrollx = argus_bg1_scrollx[0] | ( (argus_bg1_scrollx[1] & 0x01) << 8); |
| 803 | | tilemap_set_scrollx(bg1_tilemap, 0, scrollx); |
| 804 | | |
| 805 | | scrolly = argus_bg1_scrolly[0] | ( (argus_bg1_scrolly[1] & 0x01) << 8); |
| 806 | | tilemap_set_scrolly(bg1_tilemap, 0, scrolly); |
| 807 | | } |
| 808 | | else |
| 809 | | { |
| 810 | | int scrollx, scrolly; |
| 811 | | |
| 812 | | if (bg0_tilemap != NULL) |
| 813 | | { |
| 814 | | scrollx = argus_bg0_scrollx[0] | ( (argus_bg0_scrollx[1] & 0x01) << 8); |
| 815 | | tilemap_set_scrollx(bg0_tilemap, 0, (scrollx + 256) & 0x1ff); |
| 816 | | |
| 817 | | scrolly = argus_bg0_scrolly[0] | ( (argus_bg0_scrolly[1] & 0x01) << 8); |
| 818 | | tilemap_set_scrolly(bg0_tilemap, 0, (scrolly + 256) & 0x1ff); |
| 819 | | } |
| 820 | | scrollx = argus_bg1_scrollx[0] | ( (argus_bg1_scrollx[1] & 0x01) << 8); |
| 821 | | tilemap_set_scrollx(bg1_tilemap, 0, (scrollx + 256) & 0x1ff); |
| 822 | | |
| 823 | | scrolly = argus_bg1_scrolly[0] | ( (argus_bg1_scrolly[1] & 0x01) << 8); |
| 824 | | tilemap_set_scrolly(bg1_tilemap, 0, (scrolly + 256) & 0x1ff); |
| 825 | | } |
| 826 | | } |
| 575 | argus_flipscreen = data & 0x80; |
| 827 | 576 | } |
| 828 | 577 | |
| 829 | 578 | READ8_HANDLER( argus_paletteram_r ) |
| 830 | 579 | { |
| 831 | | return argus_paletteram[ offset ]; |
| 580 | return argus_paletteram[offset]; |
| 832 | 581 | } |
| 833 | 582 | |
| 834 | 583 | WRITE8_HANDLER( argus_paletteram_w ) |
| 835 | 584 | { |
| 836 | 585 | int offs; |
| 837 | 586 | |
| 838 | | argus_paletteram[ offset ] = data; |
| 587 | argus_paletteram[offset] = data; |
| 839 | 588 | |
| 840 | | if (offset != 0x007f && offset != 0x00ff) |
| 589 | if (offset <= 0x0ff) /* sprite color */ |
| 841 | 590 | { |
| 842 | | if (offset >= 0x0000 && offset <= 0x00ff) /* sprite color */ |
| 843 | | { |
| 844 | | if (offset & 0x80) |
| 845 | | offset -= 0x80; |
| 591 | offset &= 0x07f; |
| 846 | 592 | |
| 847 | | argus_change_palette( machine, offset, |
| 848 | | (argus_paletteram[offset] << 8) | argus_paletteram[offset + 0x80] ); |
| 849 | | } |
| 593 | argus_change_palette(machine, offset, offset, offset + 0x080); |
| 850 | 594 | |
| 851 | | else if ( (offset >= 0x0400 && offset <= 0x04ff) || |
| 852 | | (offset >= 0x0800 && offset <= 0x08ff) ) /* BG0 color */ |
| 595 | if (offset == 0x07f || offset == 0x0ff) |
| 853 | 596 | { |
| 854 | | if (offset >= 0x0800) |
| 855 | | offset -= 0x0400; |
| 597 | argus_palette_intensity = argus_paletteram[0x0ff] | (argus_paletteram[0x07f] << 8); |
| 856 | 598 | |
| 857 | | argus_change_bg_palette( machine, (offset - 0x0400) + 128, |
| 858 | | (argus_paletteram[offset] << 8) | argus_paletteram[offset + 0x0400] ); |
| 599 | for (offs = 0x400; offs < 0x500; offs++) |
| 600 | argus_change_bg_palette(machine, (offs & 0xff) + 0x080, offs, offs + 0x400); |
| 859 | 601 | } |
| 602 | } |
| 603 | else if ((offset >= 0x400 && offset <= 0x4ff) || |
| 604 | (offset >= 0x800 && offset <= 0x8ff)) /* BG0 color */ |
| 605 | { |
| 606 | offs = offset & 0xff; |
| 607 | offset = offs | 0x400; |
| 860 | 608 | |
| 861 | | else if ( (offset >= 0x0500 && offset <= 0x05ff) || |
| 862 | | (offset >= 0x0900 && offset <= 0x09ff) ) /* BG1 color */ |
| 863 | | { |
| 864 | | if (offset >= 0x0900) |
| 865 | | offset -= 0x0400; |
| 609 | argus_change_bg_palette(machine, offs + 0x080, offset, offset + 0x400); |
| 610 | } |
| 611 | else if ((offset >= 0x500 && offset <= 0x5ff) || |
| 612 | (offset >= 0x900 && offset <= 0x9ff)) /* BG1 color */ |
| 613 | { |
| 614 | offs = offset & 0xff; |
| 615 | offset = offs | 0x500; |
| 866 | 616 | |
| 867 | | argus_change_palette( machine, (offset - 0x0500) + 384, |
| 868 | | (argus_paletteram[offset] << 8) | argus_paletteram[offset + 0x0400] ); |
| 869 | | } |
| 870 | | |
| 871 | | else if ( (offset >= 0x0700 && offset <= 0x07ff) || |
| 872 | | (offset >= 0x0b00 && offset <= 0x0bff) ) /* text color */ |
| 873 | | { |
| 874 | | if (offset >= 0x0b00) |
| 875 | | offset -= 0x0400; |
| 876 | | |
| 877 | | argus_change_palette( machine, (offset - 0x0700) + 640, |
| 878 | | (argus_paletteram[offset] << 8) | argus_paletteram[offset + 0x0400] ); |
| 879 | | } |
| 617 | argus_change_palette(machine, offs + 0x180, offset, offset + 0x400); |
| 880 | 618 | } |
| 881 | | else |
| 619 | else if ((offset >= 0x700 && offset <= 0x7ff) || |
| 620 | (offset >= 0xb00 && offset <= 0xbff)) /* text color */ |
| 882 | 621 | { |
| 883 | | argus_palette_intensity = (argus_paletteram[0x007f] << 8) | argus_paletteram[0x00ff]; |
| 622 | offs = offset & 0xff; |
| 623 | offset = offs | 0x700; |
| 884 | 624 | |
| 885 | | for (offs = 0x400 ; offs < 0x500 ; offs ++) |
| 886 | | { |
| 887 | | argus_change_bg_palette( machine, (offs - 0x0400) + 128, |
| 888 | | (argus_paletteram[offs] << 8) | argus_paletteram[offs + 0x0400] ); |
| 889 | | } |
| 890 | | |
| 891 | | argus_bg_purple = argus_paletteram[0x0ff] & 0x0f; |
| 625 | argus_change_palette(machine, offs + 0x280, offset, offset + 0x400); |
| 892 | 626 | } |
| 893 | 627 | } |
| 894 | 628 | |
| 895 | 629 | WRITE8_HANDLER( valtric_paletteram_w ) |
| 896 | 630 | { |
| 897 | | int offs; |
| 631 | argus_paletteram[offset] = data; |
| 898 | 632 | |
| 899 | | argus_paletteram[ offset ] = data; |
| 900 | | |
| 901 | | if (offset != 0x01fe && offset != 0x01ff) |
| 633 | if (offset <= 0x1ff) /* Sprite color */ |
| 902 | 634 | { |
| 903 | | if (offset >= 0x0000 && offset <= 0x01ff) |
| 635 | argus_change_palette(machine, offset >> 1, offset & ~1, offset | 1); |
| 636 | |
| 637 | if (offset == 0x1fe || offset == 0x1ff) |
| 904 | 638 | { |
| 905 | | argus_change_palette( machine, offset >> 1, |
| 906 | | argus_paletteram[offset | 1] | (argus_paletteram[offset & ~1] << 8)); |
| 639 | int offs; |
| 640 | |
| 641 | argus_palette_intensity = argus_paletteram[0x1ff] | (argus_paletteram[0x1fe] << 8); |
| 642 | |
| 643 | for (offs = 0x400; offs < 0x600; offs += 2) |
| 644 | argus_change_bg_palette(machine, ((offs & 0x1ff) >> 1) + 0x100, offs & ~1, offs | 1); |
| 907 | 645 | } |
| 908 | | else if (offset >= 0x0400 && offset <= 0x05ff ) |
| 909 | | { |
| 910 | | argus_change_bg_palette( machine, ((offset - 0x0400) >> 1) + 256, |
| 911 | | argus_paletteram[offset | 1] | (argus_paletteram[offset & ~1] << 8)); |
| 912 | | } |
| 913 | | else if (offset >= 0x0600 && offset <= 0x07ff ) |
| 914 | | { |
| 915 | | argus_change_palette( machine, ((offset - 0x0600) >> 1) + 512, |
| 916 | | argus_paletteram[offset | 1] | (argus_paletteram[offset & ~1] << 8)); |
| 917 | | } |
| 918 | 646 | } |
| 919 | | else |
| 647 | else if (offset >= 0x400 && offset <= 0x5ff) /* BG color */ |
| 920 | 648 | { |
| 921 | | argus_palette_intensity = (argus_paletteram[0x01fe] << 8) | argus_paletteram[0x01ff]; |
| 922 | | |
| 923 | | for (offs = 0x400 ; offs < 0x600 ; offs += 2) |
| 924 | | { |
| 925 | | argus_change_bg_palette( machine, ((offs - 0x0400) >> 1) + 256, |
| 926 | | argus_paletteram[offs | 1] | (argus_paletteram[offs & ~1] << 8)); |
| 927 | | } |
| 928 | | |
| 929 | | argus_bg_purple = argus_paletteram[0x01ff] & 0x0f; |
| 649 | argus_change_bg_palette(machine, ((offset & 0x1ff) >> 1) + 0x100, offset & ~1, offset | 1); |
| 930 | 650 | } |
| 651 | else if (offset >= 0x600 && offset <= 0x7ff) /* Text color */ |
| 652 | { |
| 653 | argus_change_palette(machine, ((offset & 0x1ff) >> 1) + 0x200, offset & ~1, offset | 1); |
| 654 | } |
| 931 | 655 | } |
| 932 | 656 | |
| 933 | 657 | WRITE8_HANDLER( butasan_paletteram_w ) |
| 934 | 658 | { |
| 935 | | argus_paletteram[ offset ] = data; |
| 659 | argus_paletteram[offset] = data; |
| 936 | 660 | |
| 937 | | if (offset < 0x0200 ) /* BG1 color */ |
| 661 | if (offset <= 0x1ff) /* BG0 color */ |
| 938 | 662 | { |
| 939 | | argus_change_palette( machine, ((offset - 0x0000) >> 1) + 256, |
| 940 | | argus_paletteram[offset | 1] | (argus_paletteram[offset & ~1] << 8)); |
| 663 | argus_change_palette(machine, (offset >> 1) + 0x100, offset & ~1, offset | 1); |
| 941 | 664 | } |
| 942 | | else if (offset < 0x0240 ) /* BG0 color */ |
| 665 | else if (offset <= 0x23f) /* BG1 color */ |
| 943 | 666 | { |
| 944 | | argus_change_palette( machine, ((offset - 0x0200) >> 1) + 192, |
| 945 | | argus_paletteram[offset | 1] | (argus_paletteram[offset & ~1] << 8)); |
| 667 | argus_change_palette(machine, ((offset & 0x3f) >> 1) + 0x0c0, offset & ~1, offset | 1); |
| 946 | 668 | } |
| 947 | | else if (offset >= 0x0400 && offset <= 0x04ff ) /* Sprite color */ |
| 948 | | { |
| 949 | | if (offset < 0x0480) /* 16 colors */ |
| 950 | | argus_change_palette( machine, ((offset - 0x0400) >> 1) + 0, |
| 951 | | argus_paletteram[offset | 1] | (argus_paletteram[offset & ~1] << 8)); |
| 952 | | else /* 8 colors */ |
| 953 | | { |
| 954 | | argus_change_palette( machine, (offset & 0x70) + ((offset & 0x00f) >> 1) + 64, |
| 955 | | argus_paletteram[offset | 1] | (argus_paletteram[offset & ~1] << 8)); |
| 956 | | argus_change_palette( machine, (offset & 0x70) + ((offset & 0x00f) >> 1) + 72, |
| 957 | | argus_paletteram[offset | 1] | (argus_paletteram[offset & ~1] << 8)); |
| 958 | | } |
| 669 | else if (offset >= 0x400 && offset <= 0x47f) /* Sprite color */ |
| 670 | { /* 16 colors */ |
| 671 | argus_change_palette(machine, (offset & 0x7f) >> 1, offset & ~1, offset | 1); |
| 959 | 672 | } |
| 960 | | else if (offset >= 0x0600 && offset <= 0x07ff ) /* Text color */ |
| 961 | | { |
| 962 | | argus_change_palette( machine, ((offset - 0x0600) >> 1) + 512, |
| 963 | | argus_paletteram[offset | 1] | (argus_paletteram[offset & ~1] << 8)); |
| 964 | | } |
| 965 | | } |
| 673 | else if (offset >= 0x480 && offset <= 0x4ff) /* Sprite color */ |
| 674 | { /* 8 colors */ |
| 675 | int offs = (offset & 0x070) | ((offset & 0x00f) >> 1); |
| 966 | 676 | |
| 967 | | READ8_HANDLER( bombsa_paletteram_r ) |
| 968 | | { |
| 969 | | if (bombsa_ram_page==1) |
| 970 | | { |
| 971 | | return argus_paletteram[ offset ]; |
| 677 | argus_change_palette(machine, offs + 0x040, offset & ~1, offset | 1); |
| 678 | argus_change_palette(machine, offs + 0x048, offset & ~1, offset | 1); |
| 972 | 679 | } |
| 973 | | else if (bombsa_ram_page==0) |
| 680 | else if (offset >= 0x600 && offset <= 0x7ff) /* Text color */ |
| 974 | 681 | { |
| 975 | | return bomba_otherram[ offset ]; |
| 682 | argus_change_palette(machine, ((offset & 0x1ff) >> 1) + 0x200, offset & ~1, offset | 1); |
| 976 | 683 | } |
| 977 | | else |
| 978 | | { |
| 979 | | mame_printf_debug("unknown bombsa_paletteram_r %02x %04x\n",bombsa_ram_page,offset); |
| 980 | | return 0x00; |
| 981 | | } |
| 684 | else if (offset >= 0x240 && offset <= 0x25f) // dummy |
| 685 | argus_change_palette(machine, ((offset & 0x1f) >> 1) + 0xe0, offset & ~1, offset | 1); |
| 686 | else if (offset >= 0x500 && offset <= 0x51f) // dummy |
| 687 | argus_change_palette(machine, ((offset & 0x1f) >> 1) + 0xf0, offset & ~1, offset | 1); |
| 982 | 688 | } |
| 983 | 689 | |
| 984 | | WRITE8_HANDLER( bombsa_paletteram_w ) |
| 690 | READ8_HANDLER( butasan_bg1ram_r ) |
| 985 | 691 | { |
| 986 | | if (bombsa_ram_page==1) |
| 987 | | { |
| 988 | | argus_paletteram[ offset ] = data; |
| 989 | | bombsa_change_palette( machine, offset>>1, argus_paletteram[offset | 1] | (argus_paletteram[offset & ~1] << 8)); |
| 990 | | } |
| 991 | | else if (bombsa_ram_page==0) |
| 992 | | { |
| 993 | | bomba_otherram[offset] = data; |
| 994 | | |
| 995 | | tilemap_mark_tile_dirty(bombsa_bg_tilemap, offset/2); |
| 996 | | } |
| 997 | | else |
| 998 | | { |
| 999 | | mame_printf_debug("unknown bombsa_paletteram_w %02x %04x %02x\n",bombsa_ram_page,offset, data); |
| 1000 | | } |
| 692 | return butasan_bg1ram[offset]; |
| 1001 | 693 | } |
| 1002 | 694 | |
| 1003 | | READ8_HANDLER( butasan_txbackram_r ) |
| 695 | WRITE8_HANDLER( butasan_bg1ram_w ) |
| 1004 | 696 | { |
| 1005 | | return butasan_txbackram[ offset ]; |
| 697 | int idx; |
| 698 | |
| 699 | butasan_bg1ram[offset] = data; |
| 700 | |
| 701 | idx = (offset & 0x00f) | ((offset & 0x200) >> 5) | ((offset & 0x1f0) << 1); |
| 702 | idx ^= 0x0f0; |
| 703 | |
| 704 | tilemap_mark_tile_dirty(bg1_tilemap, idx); |
| 1006 | 705 | } |
| 1007 | 706 | |
| 1008 | | WRITE8_HANDLER( butasan_txbackram_w ) |
| 707 | WRITE8_HANDLER( butasan_pageselect_w ) |
| 1009 | 708 | { |
| 1010 | | if (butasan_txbackram[ offset ] != data) |
| 1011 | | { |
| 1012 | | butasan_txbackram[ offset ] = data; |
| 1013 | | } |
| 709 | butasan_page_latch = data & 1; |
| 1014 | 710 | } |
| 1015 | 711 | |
| 1016 | | READ8_HANDLER( butasan_bg0backram_r ) |
| 712 | READ8_HANDLER( butasan_pagedram_r ) |
| 1017 | 713 | { |
| 1018 | | return butasan_bg0backram[ offset ]; |
| 714 | return butasan_pagedram[butasan_page_latch][offset]; |
| 1019 | 715 | } |
| 1020 | 716 | |
| 1021 | | WRITE8_HANDLER( butasan_bg0backram_w ) |
| 717 | WRITE8_HANDLER( butasan_pagedram_w ) |
| 1022 | 718 | { |
| 1023 | | if (butasan_bg0backram[ offset ] != data) |
| 719 | butasan_pagedram[butasan_page_latch][offset] = data; |
| 720 | |
| 721 | if (!butasan_page_latch) |
| 1024 | 722 | { |
| 1025 | | butasan_bg0backram[ offset ] = data; |
| 723 | if (offset <= 0x07ff) |
| 724 | { |
| 725 | int idx; |
| 726 | idx = ((offset & 0x01e) >> 1) | ((offset & 0x400) >> 6) | (offset & 0x3e0); |
| 727 | idx ^= 0x1e0; |
| 728 | tilemap_mark_tile_dirty(bg0_tilemap, idx); |
| 729 | } |
| 1026 | 730 | } |
| 731 | else |
| 732 | { |
| 733 | if (offset <= 0x07ff) |
| 734 | tilemap_mark_tile_dirty(tx_tilemap, (offset ^ 0x7c0) >> 1); |
| 735 | } |
| 1027 | 736 | } |
| 1028 | 737 | |
| 1029 | | WRITE8_HANDLER( butasan_bg1_status_w ) |
| 738 | WRITE8_HANDLER( valtric_unknown_w ) |
| 1030 | 739 | { |
| 1031 | | if (butasan_bg1_status != data) |
| 1032 | | { |
| 1033 | | butasan_bg1_status = data; |
| 740 | valtric_unknown = data; |
| 741 | } |
| 1034 | 742 | |
| 1035 | | tilemap_set_enable(bg1_tilemap, butasan_bg1_status & 0x01); /* Set enable flag */ |
| 1036 | | tilemap_mark_all_tiles_dirty( bg1_tilemap ); /* Bank changed */ |
| 1037 | | } |
| 743 | WRITE8_HANDLER( butasan_unknown_w ) |
| 744 | { |
| 745 | butasan_unknown = data; |
| 1038 | 746 | } |
| 1039 | 747 | |
| 1040 | 748 | |
| r3289 | r3290 | |
| 1042 | 750 | Screen refresh |
| 1043 | 751 | ***************************************************************************/ |
| 1044 | 752 | |
| 1045 | | static void argus_bg0_scroll_handle( running_machine *machine ) |
| 753 | static void bg_setting(void) |
| 1046 | 754 | { |
| 755 | tilemap_set_flip(ALL_TILEMAPS, argus_flipscreen ? TILEMAP_FLIPY|TILEMAP_FLIPX : 0); |
| 756 | |
| 757 | if (!argus_flipscreen) |
| 758 | { |
| 759 | if (bg0_tilemap != NULL) |
| 760 | { |
| 761 | tilemap_set_scrollx(bg0_tilemap, 0, bg0_scrollx & 0x1ff); |
| 762 | tilemap_set_scrolly(bg0_tilemap, 0, bg0_scrolly & 0x1ff); |
| 763 | } |
| 764 | tilemap_set_scrollx(bg1_tilemap, 0, bg1_scrollx & 0x1ff); |
| 765 | tilemap_set_scrolly(bg1_tilemap, 0, bg1_scrolly & 0x1ff); |
| 766 | } |
| 767 | else |
| 768 | { |
| 769 | if (bg0_tilemap != NULL) |
| 770 | { |
| 771 | tilemap_set_scrollx(bg0_tilemap, 0, (bg0_scrollx + 256) & 0x1ff); |
| 772 | tilemap_set_scrolly(bg0_tilemap, 0, (bg0_scrolly + 256) & 0x1ff); |
| 773 | } |
| 774 | tilemap_set_scrollx(bg1_tilemap, 0, (bg1_scrollx + 256) & 0x1ff); |
| 775 | tilemap_set_scrolly(bg1_tilemap, 0, (bg1_scrolly + 256) & 0x1ff); |
| 776 | } |
| 777 | } |
| 778 | |
| 779 | static void argus_bg0_scroll_handle(running_machine *machine) |
| 780 | { |
| 1047 | 781 | int delta; |
| 1048 | | int scrollx; |
| 1049 | 782 | int dcolumn; |
| 1050 | 783 | |
| 1051 | 784 | /* Deficit between previous and current scroll value */ |
| 1052 | | scrollx = argus_bg0_scrollx[0] | (argus_bg0_scrollx[1] << 8); |
| 1053 | | delta = scrollx - prvscrollx; |
| 1054 | | prvscrollx = scrollx; |
| 785 | delta = bg0_scrollx - prvscrollx; |
| 786 | prvscrollx = bg0_scrollx; |
| 1055 | 787 | |
| 1056 | | if ( delta == 0 ) |
| 788 | if (delta == 0) |
| 1057 | 789 | return; |
| 1058 | 790 | |
| 1059 | 791 | if (delta > 0) |
| r3289 | r3290 | |
| 1063 | 795 | |
| 1064 | 796 | if (lowbitscroll >= 16) |
| 1065 | 797 | { |
| 1066 | | dcolumn ++; |
| 798 | dcolumn++; |
| 1067 | 799 | lowbitscroll -= 16; |
| 1068 | 800 | } |
| 1069 | 801 | |
| r3289 | r3290 | |
| 1072 | 804 | int i, j; |
| 1073 | 805 | int col, woffs, roffs; |
| 1074 | 806 | |
| 1075 | | col = ( (scrollx / 16) + 16 ) % 32; |
| 807 | col = ((bg0_scrollx / 16) + 16) % 32; |
| 1076 | 808 | woffs = 32 * 2 * col; |
| 1077 | | roffs = ( ( (scrollx / 16) + 16 ) * 8 ) % 0x8000; |
| 809 | roffs = (((bg0_scrollx / 16) + 16) * 8) % 0x8000; |
| 1078 | 810 | |
| 1079 | | if ( dcolumn >= 18 ) |
| 811 | if (dcolumn >= 18) |
| 1080 | 812 | dcolumn = 18; |
| 1081 | 813 | |
| 1082 | | for ( i = 0 ; i < dcolumn ; i ++ ) |
| 814 | for (i = 0; i < dcolumn; i++) |
| 1083 | 815 | { |
| 1084 | | for ( j = 0 ; j < 4 ; j ++ ) |
| 816 | for (j = 0; j < 4; j++) |
| 1085 | 817 | { |
| 1086 | | argus_write_dummy_rams( machine, woffs, roffs ); |
| 818 | argus_write_dummy_rams(machine, woffs, roffs); |
| 1087 | 819 | woffs += 16; |
| 1088 | 820 | roffs += 2; |
| 1089 | 821 | } |
| r3289 | r3290 | |
| 1103 | 835 | |
| 1104 | 836 | if (lowbitscroll <= 0) |
| 1105 | 837 | { |
| 1106 | | dcolumn ++; |
| 838 | dcolumn++; |
| 1107 | 839 | lowbitscroll += 16; |
| 1108 | 840 | } |
| 1109 | 841 | |
| r3289 | r3290 | |
| 1112 | 844 | int i, j; |
| 1113 | 845 | int col, woffs, roffs; |
| 1114 | 846 | |
| 1115 | | col = ( (scrollx / 16) + 31 ) % 32; |
| 847 | col = ((bg0_scrollx / 16) + 31) % 32; |
| 1116 | 848 | woffs = 32 * 2 * col; |
| 1117 | | roffs = ( (scrollx / 16) - 1 ) * 8; |
| 849 | roffs = ((bg0_scrollx / 16) - 1) * 8; |
| 1118 | 850 | if (roffs < 0) |
| 1119 | 851 | roffs += 0x08000; |
| 1120 | 852 | |
| 1121 | 853 | if (dcolumn >= 18) |
| 1122 | 854 | dcolumn = 18; |
| 1123 | 855 | |
| 1124 | | for ( i = 0 ; i < dcolumn ; i ++ ) |
| 856 | for (i = 0; i < dcolumn; i++) |
| 1125 | 857 | { |
| 1126 | | for ( j = 0 ; j < 4 ; j ++ ) |
| 858 | for (j = 0; j < 4; j++) |
| 1127 | 859 | { |
| 1128 | | argus_write_dummy_rams( machine, woffs, roffs ); |
| 860 | argus_write_dummy_rams(machine, woffs, roffs); |
| 1129 | 861 | woffs += 16; |
| 1130 | 862 | roffs += 2; |
| 1131 | 863 | } |
| r3289 | r3290 | |
| 1136 | 868 | } |
| 1137 | 869 | } |
| 1138 | 870 | } |
| 1139 | | |
| 1140 | | if (!argus_flipscreen) |
| 1141 | | tilemap_set_scrollx(bg0_tilemap, 0, scrollx & 0x1ff); |
| 1142 | | else |
| 1143 | | tilemap_set_scrollx(bg0_tilemap, 0, (scrollx + 256) & 0x1ff); |
| 1144 | | |
| 1145 | 871 | } |
| 1146 | 872 | |
| 1147 | 873 | static void argus_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int priority) |
| r3289 | r3290 | |
| 1149 | 875 | int offs; |
| 1150 | 876 | |
| 1151 | 877 | /* Draw the sprites */ |
| 1152 | | for (offs = 11 ; offs < spriteram_size ; offs += 16) |
| 878 | for (offs = 0; offs < spriteram_size; offs += 16) |
| 1153 | 879 | { |
| 1154 | | if ( !(spriteram[offs+4] == 0 && spriteram[offs] == 0xf0) ) |
| 880 | if (!(spriteram[offs+15] == 0 && spriteram[offs+11] == 0xf0)) |
| 1155 | 881 | { |
| 1156 | 882 | int sx, sy, tile, flipx, flipy, color, pri; |
| 1157 | 883 | |
| 1158 | | sx = spriteram[offs + 1]; |
| 1159 | | sy = spriteram[offs]; |
| 884 | sx = spriteram[offs+12]; if (spriteram[offs+13] & 0x01) sx -= 256; |
| 885 | sy = spriteram[offs+11]; if (!(spriteram[offs+13] & 0x02)) sy -= 256; |
| 1160 | 886 | |
| 887 | tile = spriteram[offs+14] | ((spriteram[offs+13] & 0xc0) << 2); |
| 888 | flipx = spriteram[offs+13] & 0x10; |
| 889 | flipy = spriteram[offs+13] & 0x20; |
| 890 | color = spriteram[offs+15] & 0x07; |
| 891 | pri = (spriteram[offs+15] & 0x08) >> 3; |
| 892 | |
| 1161 | 893 | if (argus_flipscreen) |
| 1162 | 894 | { |
| 1163 | 895 | sx = 240 - sx; |
| 1164 | 896 | sy = 240 - sy; |
| 897 | flipx = !flipx; |
| 898 | flipy = !flipy; |
| 1165 | 899 | } |
| 1166 | 900 | |
| 1167 | | if (!argus_flipscreen) |
| 1168 | | { |
| 1169 | | if ( spriteram[offs+2] & 0x01) sx -= 256; |
| 1170 | | if (!(spriteram[offs+2] & 0x02)) sy -= 256; |
| 1171 | | } |
| 1172 | | else |
| 1173 | | { |
| 1174 | | if ( spriteram[offs+2] & 0x01) sx += 256; |
| 1175 | | if (!(spriteram[offs+2] & 0x02)) sy += 256; |
| 1176 | | } |
| 1177 | | |
| 1178 | | tile = spriteram[offs+3] + ((spriteram[offs+2] & 0xc0) << 2); |
| 1179 | | flipx = spriteram[offs+2] & 0x10; |
| 1180 | | flipy = spriteram[offs+2] & 0x20; |
| 1181 | | color = spriteram[offs+4] & 0x07; |
| 1182 | | pri = (spriteram[offs+4] & 0x08) >> 3; |
| 1183 | | |
| 1184 | | if (argus_flipscreen) |
| 1185 | | { |
| 1186 | | flipx ^= 0x10; |
| 1187 | | flipy ^= 0x20; |
| 1188 | | } |
| 1189 | | |
| 1190 | 901 | if (priority != pri) |
| 1191 | 902 | jal_blend_drawgfx(machine, |
| 1192 | 903 | bitmap,machine->gfx[0], |
| r3289 | r3290 | |
| 1195 | 906 | flipx, flipy, |
| 1196 | 907 | sx, sy, |
| 1197 | 908 | cliprect, |
| 1198 | | TRANSPARENCY_PEN, 15 |
| 1199 | | ); |
| 909 | TRANSPARENCY_PEN, 15); |
| 1200 | 910 | } |
| 1201 | 911 | } |
| 1202 | 912 | } |
| 1203 | 913 | |
| 914 | #if 1 |
| 915 | static void valtric_draw_mosaic(const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect) |
| 916 | { |
| 917 | static int mosaic=0; |
| 918 | |
| 919 | if (valtric_mosaic!=0x80) |
| 920 | { |
| 921 | mosaic=0x0f-(valtric_mosaic&0x0f); |
| 922 | if (mosaic!=0) mosaic++; |
| 923 | if (valtric_mosaic&0x80) mosaic*=-1; |
| 924 | } |
| 925 | |
| 926 | if (mosaic==0) |
| 927 | tilemap_draw(bitmap, cliprect, bg1_tilemap, 0, 0); |
| 928 | else |
| 929 | { |
| 930 | tilemap_draw(mosaicbitmap, cliprect, bg1_tilemap, 0, 0); |
| 931 | { |
| 932 | int step=mosaic; |
| 933 | UINT32 *dest; |
| 934 | int x,y,xx,yy; |
| 935 | int width = video_screen_get_width(screen); |
| 936 | int height = video_screen_get_height(screen); |
| 937 | |
| 938 | if (mosaic<0)step*=-1; |
| 939 | |
| 940 | for (y=0;y<width+step;y+=step) |
| 941 | for (x=0;x<height+step;x+=step) |
| 942 | { |
| 943 | static int c=0; |
| 944 | |
| 945 | if (y<height && x< width) |
| 946 | c=*BITMAP_ADDR32(mosaicbitmap, y, x); |
| 947 | |
| 948 | if (mosaic<0) |
| 949 | if (y+step-1<height && x+step-1< width) |
| 950 | c = *BITMAP_ADDR32(mosaicbitmap, y+step-1, x+step-1); |
| 951 | |
| 952 | for (yy=0;yy<step;yy++) |
| 953 | for (xx=0;xx<step;xx++) |
| 954 | { |
| 955 | if (xx+x < width && yy+y<height) |
| 956 | { |
| 957 | dest=BITMAP_ADDR32(bitmap, y+yy, x+xx); |
| 958 | *dest=c; |
| 959 | } |
| 960 | } |
| 961 | } |
| 962 | } |
| 963 | } |
| 964 | } |
| 965 | #else |
| 966 | static void valtric_draw_mosaic(const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect) |
| 967 | { |
| 968 | int step = 0x10 - (valtric_mosaic & 0x0f); |
| 969 | |
| 970 | if (step == 1) |
| 971 | tilemap_draw(bitmap, cliprect, bg1_tilemap, 0, 0); |
| 972 | else |
| 973 | { |
| 974 | tilemap_draw(mosaicbitmap, cliprect, bg1_tilemap, 0, 0); |
| 975 | { |
| 976 | UINT32 *dest; |
| 977 | int x,y,xx,yy; |
| 978 | int width = video_screen_get_width(screen); |
| 979 | int height = video_screen_get_height(screen); |
| 980 | |
| 981 | for (y = 0; y < width+step; y += step) |
| 982 | for (x = 0; x < height+step; x += step) |
| 983 | { |
| 984 | static int c = 0; |
| 985 | |
| 986 | if (y < height && x < width) |
| 987 | c = *BITMAP_ADDR32(mosaicbitmap, y, x); |
| 988 | |
| 989 | if (valtric_mosaic & 0x80) |
| 990 | if (y+step-1 < height && x+step-1 < width) |
| 991 | c = *BITMAP_ADDR32(mosaicbitmap, y+step-1, x+step-1); |
| 992 | |
| 993 | for (yy = 0; yy < step; yy++) |
| 994 | for (xx = 0; xx < step; xx++) |
| 995 | { |
| 996 | if (xx+x < width && yy+y < height) |
| 997 | { |
| 998 | dest = BITMAP_ADDR32(bitmap, y+yy, x+xx); |
| 999 | *dest = c; |
| 1000 | } |
| 1001 | } |
| 1002 | } |
| 1003 | } |
| 1004 | } |
| 1005 | } |
| 1006 | #endif |
| 1007 | |
| 1204 | 1008 | static void valtric_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) |
| 1205 | 1009 | { |
| 1206 | 1010 | int offs; |
| 1207 | 1011 | |
| 1208 | 1012 | /* Draw the sprites */ |
| 1209 | | for (offs = 11 ; offs < spriteram_size ; offs += 16) |
| 1013 | for (offs = 0; offs < spriteram_size; offs += 16) |
| 1210 | 1014 | { |
| 1211 | | if ( !(spriteram[offs+4] == 0 && spriteram[offs] == 0xf0) ) |
| 1015 | if (!(spriteram[offs+15] == 0 && spriteram[offs+11] == 0xf0)) |
| 1212 | 1016 | { |
| 1213 | 1017 | int sx, sy, tile, flipx, flipy, color; |
| 1214 | 1018 | |
| 1215 | | sx = spriteram[offs + 1]; |
| 1216 | | sy = spriteram[offs]; |
| 1019 | sx = spriteram[offs+12]; if (spriteram[offs+13] & 0x01) sx -= 256; |
| 1020 | sy = spriteram[offs+11]; if (!(spriteram[offs+13] & 0x02)) sy -= 256; |
| 1217 | 1021 | |
| 1022 | tile = spriteram[offs+14] | ((spriteram[offs+13] & 0xc0) << 2); |
| 1023 | flipx = spriteram[offs+13] & 0x10; |
| 1024 | flipy = spriteram[offs+13] & 0x20; |
| 1025 | color = spriteram[offs+15] & 0x0f; |
| 1026 | |
| 1218 | 1027 | if (argus_flipscreen) |
| 1219 | 1028 | { |
| 1220 | 1029 | sx = 240 - sx; |
| 1221 | 1030 | sy = 240 - sy; |
| 1031 | flipx = !flipx; |
| 1032 | flipy = !flipy; |
| 1222 | 1033 | } |
| 1223 | 1034 | |
| 1224 | | if (!argus_flipscreen) |
| 1225 | | { |
| 1226 | | if ( spriteram[offs+2] & 0x01) sx -= 256; |
| 1227 | | if (!(spriteram[offs+2] & 0x02)) sy -= 256; |
| 1228 | | } |
| 1229 | | else |
| 1230 | | { |
| 1231 | | if ( spriteram[offs+2] & 0x01) sx += 256; |
| 1232 | | if (!(spriteram[offs+2] & 0x02)) sy += 256; |
| 1233 | | } |
| 1234 | | |
| 1235 | | tile = spriteram[offs+3] + ((spriteram[offs+2] & 0xc0) << 2); |
| 1236 | | flipx = spriteram[offs+2] & 0x10; |
| 1237 | | flipy = spriteram[offs+2] & 0x20; |
| 1238 | | color = spriteram[offs+4] & 0x0f; |
| 1239 | | |
| 1240 | | if (argus_flipscreen) |
| 1241 | | { |
| 1242 | | flipx ^= 0x10; |
| 1243 | | flipy ^= 0x20; |
| 1244 | | } |
| 1245 | | |
| 1246 | 1035 | jal_blend_drawgfx(machine, |
| 1247 | 1036 | bitmap,machine->gfx[0], |
| 1248 | 1037 | tile, |
| r3289 | r3290 | |
| 1260 | 1049 | int offs; |
| 1261 | 1050 | |
| 1262 | 1051 | /* Draw the sprites */ |
| 1263 | | for (offs = 8 ; offs < spriteram_size ; offs += 16) |
| 1052 | for (offs = 0; offs < spriteram_size; offs += 16) |
| 1264 | 1053 | { |
| 1265 | 1054 | int sx, sy, tile, flipx, flipy, color; |
| 1055 | int fx, fy; |
| 1266 | 1056 | |
| 1267 | | sx = spriteram[offs + 2]; |
| 1268 | | sy = 240 - spriteram[offs + 4]; |
| 1057 | tile = spriteram[offs+14] | ((spriteram[offs+15] & 0x0f) << 8); |
| 1058 | flipx = spriteram[offs+8] & 0x01; |
| 1059 | flipy = spriteram[offs+8] & 0x04; |
| 1060 | color = spriteram[offs+9] & 0x0f; |
| 1269 | 1061 | |
| 1270 | | if (spriteram[offs + 3] & 0x01) sx -= 256; |
| 1271 | | if (spriteram[offs + 5] & 0x01) sy += 256; |
| 1062 | sx = spriteram[offs+10]; |
| 1063 | sy = spriteram[offs+12]; |
| 1272 | 1064 | |
| 1273 | | tile = spriteram[offs + 6] + ((spriteram[offs + 7] & 0x0f) << 8); |
| 1274 | | flipx = spriteram[offs + 0] & 0x01; |
| 1275 | | flipy = spriteram[offs + 0] & 0x04; |
| 1276 | | color = spriteram[offs + 1] & 0x0f; |
| 1065 | if (spriteram[offs+11] & 0x01) sx-=256; |
| 1066 | if (spriteram[offs+13] & 0x01) sy-=256; |
| 1277 | 1067 | |
| 1278 | | if (!argus_flipscreen) |
| 1279 | | { |
| 1280 | | if ( (offs >= 0x100 && offs < 0x300) || (offs >= 0x400 && offs < 0x580) ) |
| 1281 | | { |
| 1282 | | jal_blend_drawgfx(machine, |
| 1283 | | bitmap,machine->gfx[0], |
| 1284 | | tile, |
| 1285 | | color, |
| 1286 | | flipx, flipy, |
| 1287 | | sx, sy, |
| 1288 | | cliprect, |
| 1289 | | TRANSPARENCY_PEN, 7); |
| 1290 | | } |
| 1291 | | else if ( (offs >= 0x000 && offs < 0x100) || (offs >= 0x300 && offs < 0x400) ) |
| 1292 | | { |
| 1293 | | int i; |
| 1068 | sy = 240 - sy; |
| 1294 | 1069 | |
| 1295 | | for ( i = 0 ; i <= 1 ; i ++ ) |
| 1296 | | { |
| 1297 | | int td; |
| 1070 | fx = flipx; |
| 1071 | fy = flipy; |
| 1298 | 1072 | |
| 1299 | | td = (flipx) ? (1 - i) : i; |
| 1300 | | |
| 1301 | | jal_blend_drawgfx(machine, |
| 1302 | | bitmap,machine->gfx[0], |
| 1303 | | tile + td, |
| 1304 | | color, |
| 1305 | | flipx, flipy, |
| 1306 | | sx + i * 16, sy, |
| 1307 | | cliprect, |
| 1308 | | TRANSPARENCY_PEN, 7); |
| 1309 | | } |
| 1310 | | } |
| 1311 | | else if ( offs >= 0x580 && offs < 0x620 ) |
| 1312 | | { |
| 1313 | | int i, j; |
| 1314 | | |
| 1315 | | for ( i = 0 ; i <= 1 ; i ++ ) |
| 1316 | | { |
| 1317 | | for ( j = 0 ; j <= 1 ; j ++ ) |
| 1318 | | { |
| 1319 | | int td; |
| 1320 | | |
| 1321 | | if ( !flipy ) |
| 1322 | | td = (flipx) ? (i * 2) + 1 - j : i * 2 + j; |
| 1323 | | else |
| 1324 | | td = (flipx) ? ( (1 - i) * 2 ) + 1 - j : (1 - i) * 2 + j; |
| 1325 | | |
| 1326 | | jal_blend_drawgfx(machine, |
| 1327 | | bitmap,machine->gfx[0], |
| 1328 | | tile + td, |
| 1329 | | color, |
| 1330 | | flipx, flipy, |
| 1331 | | sx + j * 16, sy - i * 16, |
| 1332 | | cliprect, |
| 1333 | | TRANSPARENCY_PEN, 7); |
| 1334 | | } |
| 1335 | | } |
| 1336 | | } |
| 1337 | | else if ( offs >= 0x620 && offs < 0x680 ) |
| 1338 | | { |
| 1339 | | int i, j; |
| 1340 | | |
| 1341 | | for ( i = 0 ; i <= 3 ; i ++ ) |
| 1342 | | { |
| 1343 | | for ( j = 0 ; j <= 3 ; j ++ ) |
| 1344 | | { |
| 1345 | | int td; |
| 1346 | | |
| 1347 | | if ( !flipy ) |
| 1348 | | td = (flipx) ? (i * 4) + 3 - j : i * 4 + j; |
| 1349 | | else |
| 1350 | | td = (flipx) ? ( (3 - i) * 4 ) + 3 - j : (3 - i) * 4 + j; |
| 1351 | | |
| 1352 | | jal_blend_drawgfx(machine, |
| 1353 | | bitmap,machine->gfx[0], |
| 1354 | | tile + td, |
| 1355 | | color, |
| 1356 | | flipx, flipy, |
| 1357 | | sx + j * 16, sy - i * 16, |
| 1358 | | cliprect, |
| 1359 | | TRANSPARENCY_PEN, 7); |
| 1360 | | } |
| 1361 | | } |
| 1362 | | } |
| 1363 | | } |
| 1364 | | else |
| 1073 | if (argus_flipscreen) |
| 1365 | 1074 | { |
| 1366 | 1075 | sx = 240 - sx; |
| 1367 | 1076 | sy = 240 - sy; |
| 1368 | | flipx ^= 0x01; |
| 1369 | | flipy ^= 0x04; |
| 1077 | flipx = !flipx; |
| 1078 | flipy = !flipy; |
| 1079 | } |
| 1370 | 1080 | |
| 1371 | | if ( (offs >= 0x100 && offs < 0x300) || (offs >= 0x400 && offs < 0x580) ) |
| 1081 | { |
| 1082 | int i, j, td; |
| 1083 | |
| 1084 | if ((offs >= 0x100 && offs <= 0x2ff) || (offs >= 0x400 && offs <= 0x57f)) |
| 1372 | 1085 | { |
| 1373 | 1086 | jal_blend_drawgfx(machine, |
| 1374 | 1087 | bitmap,machine->gfx[0], |
| r3289 | r3290 | |
| 1379 | 1092 | cliprect, |
| 1380 | 1093 | TRANSPARENCY_PEN, 7); |
| 1381 | 1094 | } |
| 1382 | | else if ( (offs >= 0x000 && offs < 0x100) || (offs >= 0x300 && offs < 0x400) ) |
| 1095 | else if ((offs >= 0x000 && offs <= 0x0ff) || (offs >= 0x300 && offs <= 0x3ff)) |
| 1383 | 1096 | { |
| 1384 | | int i; |
| 1385 | | |
| 1386 | | for ( i = 0 ; i <= 1 ; i ++ ) |
| 1097 | for (i = 0; i <= 1; i++) |
| 1387 | 1098 | { |
| 1388 | | int td; |
| 1099 | td = (fx) ? (1 - i) : i; |
| 1389 | 1100 | |
| 1390 | | td = (flipx) ? i : (1 - i); |
| 1391 | | |
| 1392 | 1101 | jal_blend_drawgfx(machine, |
| 1393 | 1102 | bitmap,machine->gfx[0], |
| 1394 | 1103 | tile + td, |
| 1395 | 1104 | color, |
| 1396 | 1105 | flipx, flipy, |
| 1397 | | sx - i * 16, sy, |
| 1106 | sx + i * 16, sy, |
| 1398 | 1107 | cliprect, |
| 1399 | 1108 | TRANSPARENCY_PEN, 7); |
| 1400 | 1109 | } |
| 1401 | 1110 | } |
| 1402 | | else if ( offs >= 0x580 && offs < 0x620 ) |
| 1111 | else if (offs >= 0x580 && offs <= 0x61f) |
| 1403 | 1112 | { |
| 1404 | | int i, j; |
| 1405 | | |
| 1406 | | for ( i = 0 ; i <= 1 ; i ++ ) |
| 1113 | for (i = 0; i <= 1; i++) |
| 1407 | 1114 | { |
| 1408 | | for ( j = 0 ; j <= 1 ; j ++ ) |
| 1115 | for (j = 0; j <= 1; j++) |
| 1409 | 1116 | { |
| 1410 | | int td; |
| 1411 | | |
| 1412 | | if ( !flipy ) |
| 1413 | | td = (flipx) ? (1 - i) * 2 + j : ( (1 - i) * 2 ) + 1 - j; |
| 1117 | if (fy) |
| 1118 | td = (fx) ? ((1 - i) * 2) + 1 - j : (1 - i) * 2 + j; |
| 1414 | 1119 | else |
| 1415 | | td = (flipx) ? i * 2 + j : (i * 2) + 1 - j; |
| 1120 | td = (fx) ? (i * 2) + 1 - j : i * 2 + j; |
| 1416 | 1121 | |
| 1417 | 1122 | jal_blend_drawgfx(machine, |
| 1418 | 1123 | bitmap,machine->gfx[0], |
| 1419 | 1124 | tile + td, |
| 1420 | 1125 | color, |
| 1421 | 1126 | flipx, flipy, |
| 1422 | | sx - j * 16, sy + i * 16, |
| 1127 | sx + j * 16, sy - i * 16, |
| 1423 | 1128 | cliprect, |
| 1424 | 1129 | TRANSPARENCY_PEN, 7); |
| 1425 | 1130 | } |
| 1426 | 1131 | } |
| 1427 | 1132 | } |
| 1428 | | else if ( offs >= 0x620 && offs < 0x680 ) |
| 1133 | else if (offs >= 0x620 && offs <= 0x67f) |
| 1429 | 1134 | { |
| 1430 | | int i, j; |
| 1431 | | |
| 1432 | | for ( i = 0 ; i <= 3 ; i ++ ) |
| 1135 | for (i = 0; i <= 3; i++) |
| 1433 | 1136 | { |
| 1434 | | for ( j = 0 ; j <= 3 ; j ++ ) |
| 1137 | for (j = 0; j <= 3; j++) |
| 1435 | 1138 | { |
| 1436 | | int td; |
| 1437 | | |
| 1438 | | if ( !flipy ) |
| 1439 | | td = (flipx) ? (3 - i) * 4 + j : ( (3 - i) * 4 ) + 3 - j; |
| 1139 | if (fy) |
| 1140 | td = (fx) ? ((3 - i) * 4) + 3 - j : (3 - i) * 4 + j; |
| 1440 | 1141 | else |
| 1441 | | td = (flipx) ? i * 4 + j : (i * 4) + 3 - j; |
| 1142 | td = (fx) ? (i * 4) + 3 - j : i * 4 + j; |
| 1442 | 1143 | |
| 1443 | 1144 | jal_blend_drawgfx(machine, |
| 1444 | 1145 | bitmap,machine->gfx[0], |
| 1445 | 1146 | tile + td, |
| 1446 | 1147 | color, |
| 1447 | 1148 | flipx, flipy, |
| 1448 | | sx - j * 16, sy + i * 16, |
| 1149 | sx + j * 16, sy - i * 16, |
| 1449 | 1150 | cliprect, |
| 1450 | 1151 | TRANSPARENCY_PEN, 7); |
| 1451 | 1152 | } |
| r3289 | r3290 | |
| 1461 | 1162 | { |
| 1462 | 1163 | int offs; |
| 1463 | 1164 | |
| 1464 | | if ( input_code_pressed(KEYCODE_M) ) |
| 1165 | if (input_code_pressed(KEYCODE_M)) |
| 1465 | 1166 | { |
| 1466 | 1167 | int i; |
| 1467 | 1168 | logerror("\nSprite RAM\n"); |
| 1468 | 1169 | logerror("---------------------------------------\n"); |
| 1469 | 1170 | logerror(" +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +a +b +c +d +e +f\n"); |
| 1470 | | for (offs = 0 ; offs < spriteram_size ; offs += 16) |
| 1171 | for (offs = 0; offs < spriteram_size; offs += 16) |
| 1471 | 1172 | { |
| 1472 | | for (i = 0 ; i < 16 ; i ++) |
| 1173 | for (i = 0; i < 16; i++) |
| 1473 | 1174 | { |
| 1474 | 1175 | if (i == 0) |
| 1475 | 1176 | { |
| r3289 | r3290 | |
| 1487 | 1188 | logerror("\nColor RAM\n"); |
| 1488 | 1189 | logerror("---------------------------------------\n"); |
| 1489 | 1190 | logerror(" +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +a +b +c +d +e +f\n"); |
| 1490 | | for (offs = 0 ; offs < 0xbf0 ; offs += 16) |
| 1191 | for (offs = 0; offs < 0xbf0; offs += 16) |
| 1491 | 1192 | { |
| 1492 | | for (i = 0 ; i < 16 ; i ++) |
| 1193 | for (i = 0; i < 16; i++) |
| 1493 | 1194 | { |
| 1494 | 1195 | if (i == 0) |
| 1495 | 1196 | { |
| r3289 | r3290 | |
| 1508 | 1209 | } |
| 1509 | 1210 | #endif |
| 1510 | 1211 | |
| 1511 | | static void bombsa_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) |
| 1512 | | { |
| 1513 | | int offs; |
| 1514 | | |
| 1515 | | /* Draw the sprites */ |
| 1516 | | for (offs = 11 ; offs < spriteram_size ; offs += 16) |
| 1517 | | { |
| 1518 | | if ( !(spriteram[offs+4] == 0 && spriteram[offs] == 0xf0) ) |
| 1519 | | { |
| 1520 | | int sx, sy, tile, flipx, flipy, color, size; |
| 1521 | | |
| 1522 | | sx = spriteram[offs + 1]; |
| 1523 | | sy = spriteram[offs]; |
| 1524 | | |
| 1525 | | if (spriteram[offs+2] & 0x01) sx += 256; |
| 1526 | | if (spriteram[offs+2] & 0x02) sy += 256; |
| 1527 | | |
| 1528 | | |
| 1529 | | tile = spriteram[offs+3] + ((spriteram[offs+2] & 0xc0) << 2); |
| 1530 | | flipx = spriteram[offs+2] & 0x10; |
| 1531 | | flipy = spriteram[offs+2] & 0x20; |
| 1532 | | color = spriteram[offs+4] & 0x0f; |
| 1533 | | size = spriteram[offs+2] & 0x08; |
| 1534 | | |
| 1535 | | if(!size) |
| 1536 | | { |
| 1537 | | drawgfx(bitmap,machine->gfx[0],tile,color,flipx,flipy,sx,sy,cliprect,TRANSPARENCY_PEN,15); |
| 1538 | | } |
| 1539 | | else |
| 1540 | | { |
| 1541 | | if (!flipy && !flipx) |
| 1542 | | { |
| 1543 | | drawgfx(bitmap,machine->gfx[0],tile+0,color,flipx,flipy,sx,sy,cliprect,TRANSPARENCY_PEN,15); |
| 1544 | | drawgfx(bitmap,machine->gfx[0],tile+1,color,flipx,flipy,sx,sy+16,cliprect,TRANSPARENCY_PEN,15); |
| 1545 | | drawgfx(bitmap,machine->gfx[0],tile+2,color,flipx,flipy,sx+16,sy,cliprect,TRANSPARENCY_PEN,15); |
| 1546 | | drawgfx(bitmap,machine->gfx[0],tile+3,color,flipx,flipy,sx+16,sy+16,cliprect,TRANSPARENCY_PEN,15); |
| 1547 | | } |
| 1548 | | else if (!flipy && flipx) |
| 1549 | | { |
| 1550 | | drawgfx(bitmap,machine->gfx[0],tile+0,color,flipx,flipy,sx+16,sy,cliprect,TRANSPARENCY_PEN,15); |
| 1551 | | drawgfx(bitmap,machine->gfx[0],tile+1,color,flipx,flipy,sx+16,sy+16,cliprect,TRANSPARENCY_PEN,15); |
| 1552 | | drawgfx(bitmap,machine->gfx[0],tile+2,color,flipx,flipy,sx,sy,cliprect,TRANSPARENCY_PEN,15); |
| 1553 | | drawgfx(bitmap,machine->gfx[0],tile+3,color,flipx,flipy,sx,sy+16,cliprect,TRANSPARENCY_PEN,15); |
| 1554 | | } |
| 1555 | | else if (flipy && !flipx) |
| 1556 | | { |
| 1557 | | drawgfx(bitmap,machine->gfx[0],tile+0,color,flipx,flipy,sx,sy+16,cliprect,TRANSPARENCY_PEN,15); |
| 1558 | | drawgfx(bitmap,machine->gfx[0],tile+1,color,flipx,flipy,sx,sy,cliprect,TRANSPARENCY_PEN,15); |
| 1559 | | drawgfx(bitmap,machine->gfx[0],tile+2,color,flipx,flipy,sx+16,sy+16,cliprect,TRANSPARENCY_PEN,15); |
| 1560 | | drawgfx(bitmap,machine->gfx[0],tile+3,color,flipx,flipy,sx+16,sy,cliprect,TRANSPARENCY_PEN,15); |
| 1561 | | } |
| 1562 | | else if (flipy && flipx) |
| 1563 | | { |
| 1564 | | drawgfx(bitmap,machine->gfx[0],tile+0,color,flipx,flipy,sx+16,sy+16,cliprect,TRANSPARENCY_PEN,15); |
| 1565 | | drawgfx(bitmap,machine->gfx[0],tile+1,color,flipx,flipy,sx+16,sy,cliprect,TRANSPARENCY_PEN,15); |
| 1566 | | drawgfx(bitmap,machine->gfx[0],tile+2,color,flipx,flipy,sx,sy+16,cliprect,TRANSPARENCY_PEN,15); |
| 1567 | | drawgfx(bitmap,machine->gfx[0],tile+3,color,flipx,flipy,sx,sy,cliprect,TRANSPARENCY_PEN,15); |
| 1568 | | } |
| 1569 | | } |
| 1570 | | } |
| 1571 | | } |
| 1572 | | } |
| 1573 | | |
| 1574 | 1212 | VIDEO_UPDATE( argus ) |
| 1575 | 1213 | { |
| 1214 | bg_setting(); |
| 1215 | |
| 1576 | 1216 | /* scroll BG0 and render tile at proper position */ |
| 1577 | 1217 | argus_bg0_scroll_handle(screen->machine); |
| 1578 | 1218 | |
| 1579 | | fillbitmap(bitmap, screen->machine->pens[0], cliprect); |
| 1580 | | |
| 1581 | 1219 | tilemap_draw(bitmap, cliprect, bg0_tilemap, 0, 0); |
| 1582 | 1220 | argus_draw_sprites(screen->machine, bitmap, cliprect, 0); |
| 1583 | | tilemap_draw(bitmap, cliprect, bg1_tilemap, 0, 0); |
| 1221 | if (argus_bg_status & 1) /* Backgound enable */ |
| 1222 | tilemap_draw(bitmap, cliprect, bg1_tilemap, 0, 0); |
| 1584 | 1223 | argus_draw_sprites(screen->machine, bitmap, cliprect, 1); |
| 1585 | 1224 | tilemap_draw(bitmap, cliprect, tx_tilemap, 0, 0); |
| 1586 | 1225 | return 0; |
| r3289 | r3290 | |
| 1588 | 1227 | |
| 1589 | 1228 | VIDEO_UPDATE( valtric ) |
| 1590 | 1229 | { |
| 1591 | | fillbitmap(bitmap, screen->machine->pens[0], cliprect); |
| 1230 | bg_setting(); |
| 1592 | 1231 | |
| 1593 | | if(valtric_mosaic==0) |
| 1594 | | tilemap_draw(bitmap, cliprect, bg1_tilemap, 0, 0); |
| 1232 | if (argus_bg_status & 1) /* Backgound enable */ |
| 1233 | valtric_draw_mosaic(screen, bitmap, cliprect); |
| 1595 | 1234 | else |
| 1596 | | { |
| 1597 | | tilemap_draw(mosaicbitmap, cliprect, bg1_tilemap, 0, 0); |
| 1598 | | { |
| 1599 | | int step=valtric_mosaic; |
| 1600 | | UINT32 *dest; |
| 1601 | | int x,y,xx,yy; |
| 1602 | | int width = video_screen_get_width(screen); |
| 1603 | | int height = video_screen_get_height(screen); |
| 1604 | | |
| 1605 | | if(valtric_mosaic<0)step*=-1; |
| 1606 | | |
| 1607 | | for(y=0;y<width+step;y+=step) |
| 1608 | | for(x=0;x<height+step;x+=step) |
| 1609 | | { |
| 1610 | | static int c=0; |
| 1611 | | |
| 1612 | | if(y<height && x< width) |
| 1613 | | c=*BITMAP_ADDR32(mosaicbitmap, y, x); |
| 1614 | | |
| 1615 | | if(valtric_mosaic<0) |
| 1616 | | if(y+step-1<height && x+step-1< width) |
| 1617 | | c = *BITMAP_ADDR32(mosaicbitmap, y+step-1, x+step-1); |
| 1618 | | |
| 1619 | | for(yy=0;yy<step;yy++) |
| 1620 | | for(xx=0;xx<step;xx++) |
| 1621 | | { |
| 1622 | | if(xx+x < width && yy+y<height) |
| 1623 | | { |
| 1624 | | dest=BITMAP_ADDR32(bitmap, y+yy, x+xx); |
| 1625 | | *dest=c; |
| 1626 | | } |
| 1627 | | } |
| 1628 | | } |
| 1629 | | } |
| 1630 | | } |
| 1631 | | |
| 1235 | fillbitmap(bitmap, get_black_pen(screen->machine), cliprect); |
| 1632 | 1236 | valtric_draw_sprites(screen->machine, bitmap, cliprect); |
| 1633 | 1237 | tilemap_draw(bitmap, cliprect, tx_tilemap, 0, 0); |
| 1634 | 1238 | return 0; |
| r3289 | r3290 | |
| 1636 | 1240 | |
| 1637 | 1241 | VIDEO_UPDATE( butasan ) |
| 1638 | 1242 | { |
| 1639 | | fillbitmap(bitmap, screen->machine->pens[0], cliprect); |
| 1243 | bg_setting(); |
| 1640 | 1244 | |
| 1641 | | tilemap_draw(bitmap, cliprect, bg1_tilemap, 0, 0); |
| 1642 | | tilemap_draw(bitmap, cliprect, bg0_tilemap, 0, 0); |
| 1245 | if (argus_bg_status & 1) /* Backgound enable */ |
| 1246 | tilemap_draw(bitmap, cliprect, bg0_tilemap, 0, 0); |
| 1247 | else |
| 1248 | fillbitmap(bitmap, get_black_pen(screen->machine), cliprect); |
| 1249 | if (butasan_bg1_status & 1) tilemap_draw(bitmap, cliprect, bg1_tilemap, 0, 0); |
| 1643 | 1250 | butasan_draw_sprites(screen->machine, bitmap, cliprect); |
| 1644 | 1251 | tilemap_draw(bitmap, cliprect, tx_tilemap, 0, 0); |
| 1645 | 1252 | |
| r3289 | r3290 | |
| 1648 | 1255 | #endif |
| 1649 | 1256 | return 0; |
| 1650 | 1257 | } |
| 1651 | | |
| 1652 | | |
| 1653 | | VIDEO_UPDATE( bombsa ) |
| 1654 | | { |
| 1655 | | fillbitmap(bitmap, screen->machine->pens[0], cliprect); |
| 1656 | | |
| 1657 | | // tilemap_draw(bitmap, cliprect, bg1_tilemap, 0, 0); |
| 1658 | | // valtric_draw_sprites(screen->bitmap, cliprect); |
| 1659 | | tilemap_draw(bitmap, cliprect, bombsa_bg_tilemap, 0, 0); |
| 1660 | | |
| 1661 | | #if 0 |
| 1662 | | tilemap_draw(bitmap, cliprect, tx_alt_tilemap, 0, 0); |
| 1663 | | #endif |
| 1664 | | tilemap_draw(bitmap, cliprect, tx_tilemap, 0, 0); |
| 1665 | | bombsa_draw_sprites(screen->machine, bitmap,cliprect); |
| 1666 | | return 0; |
| 1667 | | } |
src/mame/video/psychic5.c
| r3289 | r3290 | |
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | Psychic 5 |
| 3 | Bombs Away |
| 3 | 4 | |
| 4 | 5 | Functions to emulate the video hardware of the machine. |
| 5 | 6 | |
| 6 | 7 | ***************************************************************************/ |
| 7 | 8 | |
| 8 | 9 | #include "driver.h" |
| 9 | | #include "jalblend.c" |
| 10 | #include "jalblend.h" |
| 10 | 11 | |
| 11 | 12 | #define BG_SCROLLX_LSB 0x308 |
| 12 | 13 | #define BG_SCROLLX_MSB 0x309 |
| r3289 | r3290 | |
| 16 | 17 | #define BG_PAL_INTENSITY_RG 0x1fe |
| 17 | 18 | #define BG_PAL_INTENSITY_BU 0x1ff |
| 18 | 19 | |
| 19 | | static int ps5_vram_page; |
| 20 | | static int bg_clip_mode; |
| 21 | | static int title_screen; |
| 20 | static UINT8 ps5_vram_page; |
| 21 | static UINT8 bg_clip_mode; |
| 22 | static UINT8 title_screen; |
| 23 | static UINT8 psychic5_bg_status; |
| 22 | 24 | |
| 25 | static UINT8 *ps5_pagedram[2]; |
| 26 | |
| 23 | 27 | /* Paged RAM 0 */ |
| 24 | 28 | static UINT8 *psychic5_bg_videoram; |
| 25 | 29 | static UINT8 *ps5_dummy_bg_ram; |
| r3289 | r3290 | |
| 31 | 35 | |
| 32 | 36 | static tilemap *bg_tilemap, *fg_tilemap; |
| 33 | 37 | |
| 34 | | MACHINE_RESET( psychic5 ) |
| 35 | | { |
| 36 | | bg_clip_mode = -10; |
| 37 | | flip_screen_set(0); |
| 38 | | } |
| 38 | static int bg_palette_ram_base; |
| 39 | static int bg_palette_base; |
| 39 | 40 | |
| 40 | | WRITE8_HANDLER( psychic5_vram_page_select_w ) |
| 41 | | { |
| 42 | | ps5_vram_page = data; |
| 43 | | } |
| 41 | static UINT16 palette_intensity; |
| 44 | 42 | |
| 45 | | READ8_HANDLER( psychic5_vram_page_select_r ) |
| 46 | | { |
| 47 | | return ps5_vram_page; |
| 48 | | } |
| 43 | static UINT8 bombsa_unknown; |
| 49 | 44 | |
| 50 | | WRITE8_HANDLER( psychic5_title_screen_w ) |
| 45 | |
| 46 | /*************************************************************************** |
| 47 | Palette color |
| 48 | ***************************************************************************/ |
| 49 | |
| 50 | static void psychic5_change_palette(running_machine *machine, int color, int offset) |
| 51 | 51 | { |
| 52 | | title_screen = data & 0x01; |
| 52 | UINT8 lo = ps5_palette_ram[offset & ~1]; |
| 53 | UINT8 hi = ps5_palette_ram[offset | 1]; |
| 54 | if (jal_blend_table != NULL) jal_blend_table[color] = hi & 0x0f; |
| 55 | palette_set_color_rgb(machine, color, pal4bit(lo >> 4), pal4bit(lo), pal4bit(hi >> 4)); |
| 53 | 56 | } |
| 54 | 57 | |
| 55 | | static void psychic5_paletteram_w(running_machine *machine, int color_offs, int offset, int data) |
| 58 | static void psychic5_change_bg_palette(running_machine *machine, int color, int lo_offs, int hi_offs) |
| 56 | 59 | { |
| 57 | | int r,g,b,a,val; |
| 60 | UINT8 r,g,b,lo,hi,ir,ig,ib,ix; |
| 61 | rgb_t irgb; |
| 58 | 62 | |
| 59 | | ps5_palette_ram[offset] = data; |
| 63 | /* red,green,blue intensities */ |
| 64 | ir = pal4bit(palette_intensity >> 12); |
| 65 | ig = pal4bit(palette_intensity >> 8); |
| 66 | ib = pal4bit(palette_intensity >> 4); |
| 67 | ix = palette_intensity & 0x0f; |
| 60 | 68 | |
| 61 | | /* red component */ |
| 62 | | r = (ps5_palette_ram[offset & ~1] >> 4) & 0x0f ; |
| 69 | irgb = MAKE_RGB(ir,ig,ib); |
| 63 | 70 | |
| 64 | | /* green component */ |
| 65 | | g = (ps5_palette_ram[offset & ~1]) & 0x0f ; |
| 71 | lo = ps5_palette_ram[lo_offs]; |
| 72 | hi = ps5_palette_ram[hi_offs]; |
| 66 | 73 | |
| 67 | | /* blue component */ |
| 68 | | b = (ps5_palette_ram[offset | 1] >> 4) & 0x0f ; |
| 74 | /* red,green,blue component */ |
| 75 | r = pal4bit(lo >> 4); |
| 76 | g = pal4bit(lo); |
| 77 | b = pal4bit(hi >> 4); |
| 69 | 78 | |
| 70 | | /* "alpha" component */ |
| 71 | | val = (ps5_palette_ram[offset | 1] & 0x0f) & 0x0f ; |
| 72 | | a = (val << 4) | val ; |
| 73 | | |
| 74 | | jal_blend_table[(offset / 2)-color_offs] = a ; |
| 75 | | |
| 76 | | palette_set_color_rgb(machine,(offset / 2)-color_offs,pal4bit(r),pal4bit(g),pal4bit(b)); |
| 79 | /* Grey background enable */ |
| 80 | if (psychic5_bg_status & 2) |
| 81 | { |
| 82 | UINT8 val = (r + g + b) / 3; /* Grey */ |
| 83 | /* Just leave plain grey */ |
| 84 | palette_set_color(machine,color,jal_blend_func(MAKE_RGB(val,val,val),irgb,ix)); |
| 85 | } |
| 86 | else |
| 87 | { |
| 88 | /* Seems fishy, but the title screen would be black otherwise... */ |
| 89 | if (!(title_screen & 1)) |
| 90 | { |
| 91 | /* Leave the world as-is */ |
| 92 | palette_set_color(machine,color,jal_blend_func(MAKE_RGB(r,g,b),irgb,ix)); |
| 93 | } |
| 94 | } |
| 77 | 95 | } |
| 78 | 96 | |
| 79 | 97 | static void set_background_palette_intensity(running_machine *machine) |
| 80 | 98 | { |
| 81 | | int i,r,g,b,val,lo,hi,ir,ig,ib,ix; |
| 99 | int i; |
| 100 | palette_intensity = ps5_palette_ram[BG_PAL_INTENSITY_BU] | |
| 101 | (ps5_palette_ram[BG_PAL_INTENSITY_RG]<<8); |
| 82 | 102 | |
| 83 | | /* red,green,blue intensites */ |
| 84 | | ir = ps5_palette_ram[BG_PAL_INTENSITY_RG] >> 4 ; ir = (ir << 4) | ir ; |
| 85 | | ig = ps5_palette_ram[BG_PAL_INTENSITY_RG] & 15 ; ig = (ig << 4) | ig ; |
| 86 | | ib = ps5_palette_ram[BG_PAL_INTENSITY_BU] >> 4 ; ib = (ib << 4) | ib ; |
| 87 | | ix = ps5_palette_ram[0x1ff] & 0x0f ; |
| 88 | | |
| 89 | 103 | /* for all of the background palette */ |
| 90 | 104 | for (i = 0; i < 0x100; i++) |
| 91 | | { |
| 92 | | lo = ps5_palette_ram[0x400+i*2]; |
| 93 | | hi = ps5_palette_ram[0x400+i*2+1]; |
| 105 | psychic5_change_bg_palette(machine,bg_palette_base+i,bg_palette_ram_base+i*2,bg_palette_ram_base+i*2+1); |
| 106 | } |
| 94 | 107 | |
| 95 | | /* red component */ |
| 96 | | val = (lo >> 4) & 0x0f; |
| 97 | | r = (val << 4) | val ; |
| 98 | 108 | |
| 99 | | /* green component */ |
| 100 | | val = (lo & 15) & 0x0f; |
| 101 | | g = (val << 4) | val ; |
| 109 | /*************************************************************************** |
| 110 | Memory handler |
| 111 | ***************************************************************************/ |
| 102 | 112 | |
| 103 | | /* blue component */ |
| 104 | | val = (hi >> 4) & 0x0f; |
| 105 | | b = (val << 4) | val ; |
| 106 | | |
| 107 | | /* Grey background enable */ |
| 108 | | if (ps5_io_ram[BG_SCREEN_MODE] & 0x02) |
| 109 | | { |
| 110 | | val = (UINT8)((r + g + b) / 3); /* Grey */ |
| 111 | | |
| 112 | | if (ix != 0x0) /* Tint the grey */ |
| 113 | | { |
| 114 | | UINT32 result = jal_blend_func(MAKE_RGB(val,val,val), MAKE_RGB(ir, ig, ib), jal_blend_table[0xff]) ; |
| 115 | | palette_set_color(machine, 0x100+i, result) ; |
| 116 | | } |
| 117 | | else /* Just leave plain grey */ |
| 118 | | { |
| 119 | | palette_set_color(machine,0x100+i,MAKE_RGB(val,val,val)); |
| 120 | | } |
| 121 | | } |
| 122 | | else |
| 123 | | { |
| 124 | | /* Seems fishy, but the title screen would be black otherwise... */ |
| 125 | | if (!title_screen) |
| 126 | | { |
| 127 | | if (ix != 0x0) /* Tint the world */ |
| 128 | | { |
| 129 | | UINT32 result = jal_blend_func(MAKE_RGB(r, g, b), MAKE_RGB(ir, ig, ib), jal_blend_table[0xff]) ; |
| 130 | | palette_set_color(machine, 0x100+i, result) ; |
| 131 | | } |
| 132 | | else /* Leave the world as-is */ |
| 133 | | { |
| 134 | | palette_set_color(machine,0x100+i,MAKE_RGB(r,g,b)) ; |
| 135 | | } |
| 136 | | } |
| 137 | | } |
| 138 | | } |
| 113 | READ8_HANDLER( psychic5_vram_page_select_r ) |
| 114 | { |
| 115 | return ps5_vram_page; |
| 139 | 116 | } |
| 140 | 117 | |
| 141 | | |
| 142 | | static WRITE8_HANDLER( psychic5_bg_videoram_w ) |
| 118 | WRITE8_HANDLER( psychic5_vram_page_select_w ) |
| 143 | 119 | { |
| 144 | | psychic5_bg_videoram[offset] = data; |
| 145 | | tilemap_mark_tile_dirty(bg_tilemap, offset / 2); |
| 120 | ps5_vram_page = data & 1; |
| 146 | 121 | } |
| 147 | 122 | |
| 148 | | static WRITE8_HANDLER( psychic5_fg_videoram_w ) |
| 123 | WRITE8_HANDLER( psychic5_title_screen_w ) |
| 149 | 124 | { |
| 150 | | psychic5_fg_videoram[offset] = data; |
| 151 | | tilemap_mark_tile_dirty(fg_tilemap, offset / 2); |
| 125 | title_screen = data; |
| 152 | 126 | } |
| 153 | 127 | |
| 154 | 128 | READ8_HANDLER( psychic5_paged_ram_r ) |
| 155 | 129 | { |
| 156 | | int val; |
| 130 | if (ps5_vram_page == 1) |
| 131 | { |
| 132 | switch (offset) |
| 133 | { |
| 134 | case 0x00: return input_port_read(machine, "SYSTEM"); |
| 135 | case 0x01: return input_port_read(machine, "P1"); |
| 136 | case 0x02: return input_port_read(machine, "P2"); |
| 137 | case 0x03: return input_port_read(machine, "DSW1"); |
| 138 | case 0x04: return input_port_read(machine, "DSW2"); |
| 139 | } |
| 140 | } |
| 157 | 141 | |
| 158 | | if (!ps5_vram_page) |
| 142 | return ps5_pagedram[ps5_vram_page][offset]; |
| 143 | } |
| 144 | |
| 145 | WRITE8_HANDLER( psychic5_paged_ram_w ) |
| 146 | { |
| 147 | ps5_pagedram[ps5_vram_page][offset] = data; |
| 148 | |
| 149 | if (ps5_vram_page == 0) |
| 159 | 150 | { |
| 160 | | if (offset < 0x1000) |
| 161 | | return psychic5_bg_videoram[offset]; |
| 162 | | else |
| 163 | | return ps5_dummy_bg_ram[offset & 0xfff]; |
| 151 | if (offset <= 0xfff) |
| 152 | tilemap_mark_tile_dirty(bg_tilemap, offset >> 1); |
| 164 | 153 | } |
| 165 | 154 | else |
| 166 | 155 | { |
| 167 | | if (offset < 0x400) |
| 156 | if (offset == BG_SCROLLX_LSB || offset == BG_SCROLLX_MSB) |
| 168 | 157 | { |
| 169 | | val = 0; |
| 170 | | switch(offset) |
| 171 | | { |
| 172 | | case 0x00: |
| 173 | | val = input_port_read(machine, "IN0"); |
| 174 | | break; |
| 175 | | case 0x01: |
| 176 | | val = input_port_read(machine, "P1"); |
| 177 | | break; |
| 178 | | case 0x02: |
| 179 | | val = input_port_read(machine, "P2"); |
| 180 | | break; |
| 181 | | case 0x03: |
| 182 | | val = input_port_read(machine, "DSW0"); |
| 183 | | break; |
| 184 | | case 0x04: |
| 185 | | val = input_port_read(machine, "DSW1"); |
| 186 | | break; |
| 187 | | default: |
| 188 | | val = ps5_io_ram[offset]; |
| 189 | | } |
| 190 | | return (val); |
| 158 | UINT16 bg_scrollx = ps5_io_ram[BG_SCROLLX_LSB] | (ps5_io_ram[BG_SCROLLX_MSB] << 8); |
| 159 | tilemap_set_scrollx(bg_tilemap, 0, bg_scrollx); |
| 191 | 160 | } |
| 192 | | else if (offset < 0x1000) |
| 161 | else if (offset == BG_SCROLLY_LSB || offset == BG_SCROLLY_MSB) |
| 193 | 162 | { |
| 194 | | return ps5_palette_ram[offset-0x400]; |
| 163 | UINT16 bg_scrolly = ps5_io_ram[BG_SCROLLY_LSB] | (ps5_io_ram[BG_SCROLLY_MSB] << 8); |
| 164 | tilemap_set_scrolly(bg_tilemap, 0, bg_scrolly); |
| 195 | 165 | } |
| 196 | | else |
| 166 | else if (offset == BG_SCREEN_MODE) |
| 197 | 167 | { |
| 198 | | return psychic5_fg_videoram[offset & 0xfff]; |
| 168 | psychic5_bg_status = ps5_io_ram[BG_SCREEN_MODE]; |
| 199 | 169 | } |
| 170 | else if (offset >= 0x400 && offset <= 0x5ff) /* Sprite color */ |
| 171 | psychic5_change_palette(machine,((offset >> 1) & 0xff)+0x000,offset-0x400); |
| 172 | else if (offset >= 0x800 && offset <= 0x9ff) /* BG color */ |
| 173 | psychic5_change_palette(machine,((offset >> 1) & 0xff)+0x100,offset-0x400); |
| 174 | else if (offset >= 0xa00 && offset <= 0xbff) /* Text color */ |
| 175 | psychic5_change_palette(machine,((offset >> 1) & 0xff)+0x200,offset-0x400); |
| 176 | else if (offset >= 0x1000) |
| 177 | tilemap_mark_tile_dirty(fg_tilemap, (offset-0x1000) >> 1); |
| 200 | 178 | } |
| 201 | 179 | } |
| 202 | 180 | |
| 203 | | WRITE8_HANDLER( psychic5_paged_ram_w ) |
| 181 | WRITE8_HANDLER( bombsa_paged_ram_w ) |
| 204 | 182 | { |
| 205 | | if (!ps5_vram_page) |
| 183 | ps5_pagedram[ps5_vram_page][offset] = data; |
| 184 | |
| 185 | if (ps5_vram_page == 0) |
| 206 | 186 | { |
| 207 | | if (offset < 0x1000) |
| 208 | | psychic5_bg_videoram_w(machine,offset,data); |
| 209 | | else |
| 210 | | ps5_dummy_bg_ram[offset & 0xfff] = data; |
| 187 | tilemap_mark_tile_dirty(bg_tilemap, offset >> 1); |
| 211 | 188 | } |
| 212 | 189 | else |
| 213 | 190 | { |
| 214 | | if (offset < 0x400) |
| 191 | if (offset == BG_SCROLLX_LSB || offset == BG_SCROLLX_MSB) |
| 215 | 192 | { |
| 216 | | ps5_io_ram[offset] = data; |
| 193 | UINT16 bg_scrollx = ps5_io_ram[BG_SCROLLX_LSB] | (ps5_io_ram[BG_SCROLLX_MSB] << 8); |
| 194 | tilemap_set_scrollx(bg_tilemap, 0, bg_scrollx); |
| 217 | 195 | } |
| 218 | | else if (offset < 0x600) |
| 196 | else if (offset == BG_SCROLLY_LSB || offset == BG_SCROLLY_MSB) |
| 219 | 197 | { |
| 220 | | psychic5_paletteram_w(machine, 000, offset-0x400, data); |
| 198 | UINT16 bg_scrolly = ps5_io_ram[BG_SCROLLY_LSB] | (ps5_io_ram[BG_SCROLLY_MSB] << 8); |
| 199 | tilemap_set_scrolly(bg_tilemap, 0, bg_scrolly); |
| 221 | 200 | } |
| 222 | | else if (offset > 0x5ff && offset< 0x800) |
| 201 | else if (offset == BG_SCREEN_MODE) |
| 223 | 202 | { |
| 224 | | ps5_palette_ram[offset-0x400] = data; |
| 203 | psychic5_bg_status = ps5_io_ram[BG_SCREEN_MODE]; |
| 225 | 204 | } |
| 226 | | else if (offset > 0x7ff && offset < 0xa00) |
| 227 | | { |
| 228 | | psychic5_paletteram_w(machine, 256, offset-0x400, data); |
| 229 | | } |
| 230 | | else if (offset > 0x9ff && offset < 0xc00) |
| 231 | | { |
| 232 | | psychic5_paletteram_w(machine, 256, offset-0x400, data); |
| 233 | | } |
| 234 | | else if (offset < 0x1000) |
| 235 | | { |
| 236 | | ps5_palette_ram[offset-0x400] = data; |
| 237 | | } |
| 238 | | else |
| 239 | | { |
| 240 | | psychic5_fg_videoram_w(machine, offset & 0xfff, data); |
| 241 | | } |
| 205 | else if (offset >= 0x0800 && offset <= 0x0fff) |
| 206 | tilemap_mark_tile_dirty(fg_tilemap, (offset & 0x7ff) >> 1); |
| 207 | else if (offset >= 0x1000 && offset <= 0x15ff) |
| 208 | psychic5_change_palette(machine, (offset >> 1) & 0x3ff, offset-0x1000); |
| 242 | 209 | } |
| 243 | 210 | } |
| 244 | 211 | |
| 212 | WRITE8_HANDLER( bombsa_unknown_w ) |
| 213 | { |
| 214 | bombsa_unknown = data; |
| 215 | } |
| 216 | |
| 217 | |
| 218 | /*************************************************************************** |
| 219 | Callbacks for the tilemap code |
| 220 | ***************************************************************************/ |
| 221 | |
| 245 | 222 | static TILE_GET_INFO( get_bg_tile_info ) |
| 246 | 223 | { |
| 247 | | int offs = tile_index * 2; |
| 224 | int offs = tile_index << 1; |
| 248 | 225 | int attr = psychic5_bg_videoram[offs + 1]; |
| 249 | | int code = psychic5_bg_videoram[offs] + ((attr & 0xc0) << 2); |
| 226 | int code = psychic5_bg_videoram[offs] | ((attr & 0xc0) << 2); |
| 250 | 227 | int color = attr & 0x0f; |
| 251 | | int flags = ((attr & 0x10) ? TILE_FLIPX : 0) + ((attr & 0x20) ? TILE_FLIPY : 0); |
| 228 | int flags = TILE_FLIPYX((attr & 0x30) >> 4); |
| 252 | 229 | |
| 253 | 230 | SET_TILE_INFO(1, code, color, flags); |
| 254 | 231 | } |
| 255 | 232 | |
| 256 | 233 | static TILE_GET_INFO( get_fg_tile_info ) |
| 257 | 234 | { |
| 258 | | int offs = tile_index * 2; |
| 235 | int offs = tile_index << 1; |
| 259 | 236 | int attr = psychic5_fg_videoram[offs + 1]; |
| 260 | | int code = psychic5_fg_videoram[offs] + ((attr & 0xc0) << 2); |
| 237 | int code = psychic5_fg_videoram[offs] | ((attr & 0xc0) << 2); |
| 261 | 238 | int color = attr & 0x0f; |
| 262 | | int flags = ((attr & 0x10) ? TILE_FLIPX : 0) + ((attr & 0x20) ? TILE_FLIPY : 0); |
| 239 | int flags = TILE_FLIPYX((attr & 0x30) >> 4); |
| 263 | 240 | |
| 264 | 241 | SET_TILE_INFO(2, code, color, flags); |
| 265 | 242 | } |
| 266 | 243 | |
| 244 | |
| 245 | /*************************************************************************** |
| 246 | Initialize and destroy video hardware emulation |
| 247 | ***************************************************************************/ |
| 248 | |
| 267 | 249 | VIDEO_START( psychic5 ) |
| 268 | 250 | { |
| 269 | | psychic5_bg_videoram = auto_malloc(0x1000); |
| 270 | | psychic5_fg_videoram = auto_malloc(0x1000); |
| 271 | | ps5_dummy_bg_ram = auto_malloc(0x1000); |
| 272 | | ps5_io_ram = auto_malloc(0x400); |
| 273 | | ps5_palette_ram = auto_malloc(0xc00); |
| 274 | | jal_blend_table = auto_malloc(0xc00); |
| 251 | /* info offset w h col row */ |
| 252 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols, 16, 16, 64, 32); |
| 253 | fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_cols, 8, 8, 32, 32); |
| 275 | 254 | |
| 276 | | memset(psychic5_bg_videoram, 0,0x1000); |
| 277 | | memset(psychic5_fg_videoram,0,0x1000); |
| 278 | | memset(ps5_dummy_bg_ram,0,0x1000); |
| 279 | | memset(ps5_io_ram,0,0x400); |
| 280 | | memset(ps5_palette_ram,0,0xc00); |
| 281 | | memset(jal_blend_table,0,0xc00) ; |
| 255 | tilemap_set_transparent_pen(fg_tilemap, 15); |
| 282 | 256 | |
| 283 | | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols, |
| 284 | | 16, 16, 64, 32); |
| 257 | ps5_pagedram[0] = auto_malloc(0x2000); |
| 258 | ps5_pagedram[1] = auto_malloc(0x2000); |
| 285 | 259 | |
| 286 | | fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_cols, |
| 287 | | 8, 8, 32, 32); |
| 260 | psychic5_bg_videoram = &ps5_pagedram[0][0x0000]; |
| 261 | ps5_dummy_bg_ram = &ps5_pagedram[0][0x1000]; |
| 262 | ps5_io_ram = &ps5_pagedram[1][0x0000]; |
| 263 | ps5_palette_ram = &ps5_pagedram[1][0x0400]; |
| 264 | psychic5_fg_videoram = &ps5_pagedram[1][0x1000]; |
| 288 | 265 | |
| 266 | jal_blend_table = auto_malloc(0xc00); |
| 267 | |
| 268 | bg_palette_ram_base = 0x400; |
| 269 | bg_palette_base = 0x100; |
| 270 | } |
| 271 | |
| 272 | VIDEO_START( bombsa ) |
| 273 | { |
| 274 | /* info offset w h col row */ |
| 275 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols, 16, 16, 128, 32); |
| 276 | fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_cols, 8, 8, 32, 32); |
| 277 | |
| 289 | 278 | tilemap_set_transparent_pen(fg_tilemap, 15); |
| 279 | |
| 280 | ps5_pagedram[0] = auto_malloc(0x2000); |
| 281 | ps5_pagedram[1] = auto_malloc(0x2000); |
| 282 | |
| 283 | psychic5_bg_videoram = &ps5_pagedram[0][0x0000]; |
| 284 | ps5_dummy_bg_ram = &ps5_pagedram[0][0x1000]; |
| 285 | ps5_io_ram = &ps5_pagedram[1][0x0000]; |
| 286 | psychic5_fg_videoram = &ps5_pagedram[1][0x0800]; |
| 287 | ps5_palette_ram = &ps5_pagedram[1][0x1000]; |
| 288 | |
| 289 | //jal_blend_table = auto_malloc(0xc00); |
| 290 | jal_blend_table = NULL; |
| 291 | |
| 292 | bg_palette_ram_base = 0x000; |
| 293 | bg_palette_base = 0x000; |
| 290 | 294 | } |
| 291 | 295 | |
| 296 | VIDEO_RESET( psychic5 ) |
| 297 | { |
| 298 | bg_clip_mode = 0; |
| 299 | ps5_vram_page = 0; |
| 300 | psychic5_bg_status = 0; |
| 301 | memset(ps5_pagedram[0],0,0x2000); |
| 302 | memset(ps5_pagedram[1],0,0x2000); |
| 303 | palette_intensity = 0; |
| 304 | if (jal_blend_table != NULL) memset(jal_blend_table,0,0xc00); |
| 305 | } |
| 306 | |
| 307 | VIDEO_RESET( bombsa ) |
| 308 | { |
| 309 | ps5_vram_page = 0; |
| 310 | psychic5_bg_status = 0; |
| 311 | title_screen = 0; |
| 312 | memset(ps5_pagedram[0],0,0x2000); |
| 313 | memset(ps5_pagedram[1],0,0x2000); |
| 314 | palette_intensity = 0; |
| 315 | if (jal_blend_table != NULL) memset(jal_blend_table,0,0xc00); |
| 316 | } |
| 317 | |
| 318 | |
| 319 | /*************************************************************************** |
| 320 | Screen refresh |
| 321 | ***************************************************************************/ |
| 322 | |
| 292 | 323 | #define DRAW_SPRITE(code, sx, sy) jal_blend_drawgfx(machine, bitmap, machine->gfx[0], code, color, flipx, flipy, sx, sy, cliprect, TRANSPARENCY_PEN, 15); |
| 293 | | /* #define DRAW_SPRITE(code, sx, sy) drawgfx(bitmap, machine->gfx[0], code, color, flipx, flipy, sx, sy, cliprect, TRANSPARENCY_PEN, 15); */ |
| 294 | 324 | |
| 295 | | static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) |
| 325 | static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) |
| 296 | 326 | { |
| 297 | 327 | int offs; |
| 298 | 328 | |
| 299 | | if (title_screen) |
| 300 | | return; |
| 301 | | else |
| 302 | | bg_clip_mode = -10; |
| 303 | | |
| 304 | | for (offs = 11; offs < spriteram_size; offs += 16) |
| 329 | /* Draw the sprites */ |
| 330 | for (offs = 0; offs < spriteram_size; offs += 16) |
| 305 | 331 | { |
| 306 | | int tileofs0, tileofs1, tileofs2, tileofs3, temp1, temp2; |
| 307 | | int attr = spriteram[offs + 2]; |
| 308 | | int code = spriteram[offs + 3] + ((attr & 0xc0) << 2); |
| 309 | | int color = spriteram[offs + 4] & 0x0f; |
| 332 | int attr = spriteram[offs + 13]; |
| 333 | int code = spriteram[offs + 14] | ((attr & 0xc0) << 2); |
| 334 | int color = spriteram[offs + 15] & 0x0f; |
| 310 | 335 | int flipx = attr & 0x10; |
| 311 | 336 | int flipy = attr & 0x20; |
| 312 | | int sx = spriteram[offs + 1]; |
| 313 | | int sy = spriteram[offs]; |
| 314 | | int size32 = attr & 0x08; |
| 337 | int sx = spriteram[offs + 12]; |
| 338 | int sy = spriteram[offs + 11]; |
| 339 | int size = (attr & 0x08) ? 32:16; |
| 315 | 340 | |
| 316 | 341 | if (attr & 0x01) sx -= 256; |
| 317 | 342 | if (attr & 0x04) sy -= 256; |
| r3289 | r3290 | |
| 324 | 349 | flipy = !flipy; |
| 325 | 350 | } |
| 326 | 351 | |
| 327 | | if (flipy) |
| 352 | if (size == 32) |
| 328 | 353 | { |
| 329 | | tileofs0 = 1; tileofs1 = 0; tileofs2 = 3; tileofs3 = 2; |
| 330 | | } |
| 331 | | else |
| 332 | | { |
| 333 | | tileofs0 = 0; tileofs1 = 1; tileofs2 = 2; tileofs3 = 3; |
| 334 | | } |
| 354 | int x0,x1,y0,y1; |
| 335 | 355 | |
| 336 | | if (flipx) |
| 337 | | { |
| 338 | | temp1 = tileofs0; |
| 339 | | temp2 = tileofs1; |
| 340 | | tileofs0 = tileofs2; |
| 341 | | tileofs1 = tileofs3; |
| 342 | | tileofs2 = temp1; |
| 343 | | tileofs3 = temp2; |
| 344 | | } |
| 356 | if (flipx) { x0 = 2; x1 = 0; } |
| 357 | else { x0 = 0; x1 = 2; } |
| 345 | 358 | |
| 346 | | if (size32) |
| 347 | | { |
| 348 | | DRAW_SPRITE(code + tileofs0, sx, sy) |
| 349 | | DRAW_SPRITE(code + tileofs1, sx, sy + 16) |
| 350 | | DRAW_SPRITE(code + tileofs2, sx + 16, sy) |
| 351 | | DRAW_SPRITE(code + tileofs3, sx + 16, sy + 16) |
| 359 | if (flipy) { y0 = 1; y1 = 0; } |
| 360 | else { y0 = 0; y1 = 1; } |
| 361 | |
| 362 | DRAW_SPRITE(code + x0 + y0, sx, sy) |
| 363 | DRAW_SPRITE(code + x0 + y1, sx, sy + 16) |
| 364 | DRAW_SPRITE(code + x1 + y0, sx + 16, sy) |
| 365 | DRAW_SPRITE(code + x1 + y1, sx + 16, sy + 16) |
| 352 | 366 | } |
| 353 | 367 | else |
| 354 | 368 | { |
| r3289 | r3290 | |
| 360 | 374 | } |
| 361 | 375 | } |
| 362 | 376 | |
| 363 | | static void draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) |
| 377 | static void draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) |
| 364 | 378 | { |
| 365 | | int bg_scrollx = (ps5_io_ram[BG_SCROLLX_LSB] + ((ps5_io_ram[BG_SCROLLX_MSB] & 0x03) << 8)) & 0x3ff; |
| 366 | | int bg_scrolly = (ps5_io_ram[BG_SCROLLY_LSB] + ((ps5_io_ram[BG_SCROLLY_MSB] & 0x01) << 8)) & 0x1ff; |
| 379 | static int sx1 = 0, sy1 = 0, sy2 = 0; |
| 367 | 380 | |
| 368 | | tilemap_set_scrollx(bg_tilemap, 0, bg_scrollx); |
| 369 | | tilemap_set_scrolly(bg_tilemap, 0, bg_scrolly); |
| 381 | rectangle clip = *cliprect; |
| 370 | 382 | |
| 371 | 383 | set_background_palette_intensity(machine); |
| 372 | 384 | |
| 373 | | if (ps5_io_ram[BG_SCREEN_MODE] & 0x01) /* background enable */ |
| 385 | if (!(title_screen & 1)) |
| 374 | 386 | { |
| 375 | | if (title_screen) |
| 376 | | { |
| 377 | | rectangle clip = *cliprect; |
| 387 | bg_clip_mode = 0; |
| 388 | sx1 = sy1 = sy2 = 0; |
| 389 | } |
| 390 | else |
| 391 | { |
| 392 | int sy1_old = sy1; |
| 393 | int sx1_old = sx1; |
| 394 | int sy2_old = sy2; |
| 378 | 395 | |
| 379 | | int sx1 = spriteram[12]; /* sprite 0 */ |
| 380 | | int sy1 = spriteram[11]; |
| 381 | | int tile = spriteram[14]; |
| 382 | | int sy2 = spriteram[11+128]; /* sprite 8 */ |
| 396 | sy1 = spriteram[11]; /* sprite 0 */ |
| 397 | sx1 = spriteram[12]; |
| 398 | sy2 = spriteram[11+128]; /* sprite 8 */ |
| 383 | 399 | |
| 384 | | if (bg_clip_mode >=0 && bg_clip_mode < 3 && sy1==240) bg_clip_mode = 0; |
| 385 | | if (bg_clip_mode > 2 && bg_clip_mode < 5 && sy2==240) bg_clip_mode = -10; |
| 386 | | if (bg_clip_mode > 4 && bg_clip_mode < 7 && sx1==240) bg_clip_mode = 0; |
| 387 | | if (bg_clip_mode > 6 && bg_clip_mode < 9 && (sx1==240 || sx1==0)) bg_clip_mode = -10; |
| 400 | switch (bg_clip_mode) |
| 401 | { |
| 402 | case 0: case 4: if (sy1_old != sy1) bg_clip_mode++; break; |
| 403 | case 2: case 6: if (sy2_old != sy2) bg_clip_mode++; break; |
| 404 | case 8: case 10: |
| 405 | case 12: case 14: if (sx1_old != sx1) bg_clip_mode++; break; |
| 406 | case 1: case 5: if (sy1 == 0xf0) bg_clip_mode++; break; |
| 407 | case 3: case 7: if (sy2 == 0xf0) bg_clip_mode++; break; |
| 408 | case 9: case 11: if (sx1 == 0xf0) bg_clip_mode++; break; |
| 409 | case 13: case 15: if (sx1_old == 0xf0) bg_clip_mode++; |
| 410 | case 16: if (sy1 != 0x00) bg_clip_mode = 0; break; |
| 411 | } |
| 388 | 412 | |
| 389 | | if (sy1!=240 && sy1!=0 && bg_clip_mode<=0) |
| 390 | | { |
| 391 | | if (sy1 > 128) |
| 392 | | bg_clip_mode = 1; |
| 393 | | else |
| 394 | | bg_clip_mode = 2; |
| 395 | | } |
| 413 | switch (bg_clip_mode) |
| 414 | { |
| 415 | case 0: case 4: case 8: case 12: case 16: |
| 416 | clip.min_x = clip.max_x = clip.min_y = clip.max_y = 0; |
| 417 | break; |
| 418 | case 1: clip.min_y = sy1; break; |
| 419 | case 3: clip.max_y = sy2; break; |
| 420 | case 5: clip.max_y = sy1; break; |
| 421 | case 7: clip.min_y = sy2; break; |
| 422 | case 9: case 15: clip.min_x = sx1; break; |
| 423 | case 11: case 13: clip.max_x = sx1; break; |
| 424 | } |
| 396 | 425 | |
| 397 | | if (sy2!=240 && sy2!=0 && bg_clip_mode<=0) |
| 398 | | { |
| 399 | | if (sy2 > 128) |
| 400 | | bg_clip_mode = 3; |
| 401 | | else |
| 402 | | bg_clip_mode = 4; |
| 403 | | } |
| 404 | | |
| 405 | | if (sx1!=240 && sx1!=0 && bg_clip_mode<=0 && tile==0x3c) |
| 406 | | { |
| 407 | | if (sx1 > 128) |
| 408 | | bg_clip_mode = 5; |
| 409 | | else |
| 410 | | bg_clip_mode = 6; |
| 411 | | } |
| 412 | | |
| 413 | | if (sx1!=240 && sx1!=0 && bg_clip_mode<=0 && tile==0x1c) |
| 414 | | { |
| 415 | | if (sx1 > 128) |
| 416 | | bg_clip_mode = 7; |
| 417 | | else |
| 418 | | bg_clip_mode = 8; |
| 419 | | } |
| 420 | | |
| 421 | | if (bg_clip_mode) |
| 422 | | { |
| 423 | | if (bg_clip_mode == 1) |
| 424 | | clip.min_y = sy1; |
| 425 | | else if (bg_clip_mode == 2) |
| 426 | | clip.max_y = sy1; |
| 427 | | else if (bg_clip_mode == 3) |
| 428 | | clip.max_y = sy2; |
| 429 | | else if (bg_clip_mode == 4) |
| 430 | | clip.min_y = sy2; |
| 431 | | else if (bg_clip_mode == 5) |
| 432 | | clip.min_x = sx1; |
| 433 | | else if (bg_clip_mode == 6) |
| 434 | | clip.max_x = sx1; |
| 435 | | else if (bg_clip_mode == 7) |
| 436 | | clip.max_x = sx1; |
| 437 | | else if (bg_clip_mode == 8) |
| 438 | | clip.min_x = sx1; |
| 439 | | else if (bg_clip_mode == -10) |
| 440 | | { |
| 441 | | clip.min_x = 0; |
| 442 | | clip.min_y = 0; |
| 443 | | clip.max_x = 0; |
| 444 | | clip.max_y = 0; |
| 445 | | } |
| 446 | | |
| 447 | | fillbitmap(bitmap, get_black_pen(machine), cliprect); |
| 448 | | tilemap_draw(bitmap, &clip, bg_tilemap, 0, 0); |
| 449 | | } |
| 450 | | else |
| 451 | | tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0); |
| 426 | if (flip_screen_get()) |
| 427 | { |
| 428 | int min_x,max_x,min_y,max_y; |
| 429 | min_x = 255 - clip.max_x; |
| 430 | max_x = 255 - clip.min_x; |
| 431 | min_y = 255 - clip.max_y; |
| 432 | max_y = 255 - clip.min_y; |
| 433 | clip.min_x = min_x; |
| 434 | clip.max_x = max_x; |
| 435 | clip.min_y = min_y; |
| 436 | clip.max_y = max_y; |
| 452 | 437 | } |
| 453 | | else |
| 454 | | tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0); |
| 455 | 438 | } |
| 456 | | else |
| 457 | | fillbitmap(bitmap, get_black_pen(machine), cliprect); |
| 439 | |
| 440 | tilemap_draw(bitmap, &clip, bg_tilemap, 0, 0); |
| 458 | 441 | } |
| 459 | 442 | |
| 460 | 443 | VIDEO_UPDATE( psychic5 ) |
| 461 | 444 | { |
| 462 | | draw_background(screen->machine, bitmap, cliprect); |
| 445 | fillbitmap(bitmap, get_black_pen(screen->machine), cliprect); |
| 446 | if (psychic5_bg_status & 1) /* Backgound enable */ |
| 447 | draw_background(screen->machine, bitmap, cliprect); |
| 448 | if (!(title_screen & 1)) |
| 449 | draw_sprites(screen->machine, bitmap, cliprect); |
| 450 | tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0); |
| 451 | return 0; |
| 452 | } |
| 453 | |
| 454 | VIDEO_UPDATE( bombsa ) |
| 455 | { |
| 456 | if (psychic5_bg_status & 1) /* Backgound enable */ |
| 457 | tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0); |
| 458 | else |
| 459 | fillbitmap(bitmap, screen->machine->pens[0x0ff], cliprect); |
| 463 | 460 | draw_sprites(screen->machine, bitmap, cliprect); |
| 464 | 461 | tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0); |
| 465 | 462 | return 0; |
src/mame/drivers/system1.c
| r3289 | r3290 | |
| 121 | 121 | cpu_spinuntil_time(ATTOTIME_IN_USEC(50)); |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | /* protection values from real hardware, these were verified to be the same on the title |
| 125 | screen and in the first level... they're all jumps that the MCU appears to put in RAM |
| 126 | at some point */ |
| 127 | static const int shtngtab[]= |
| 128 | { |
| 129 | 0xC3,0xC1,0x39, |
| 130 | 0xC3,0x6F,0x0A, |
| 131 | 0xC3,0x56,0x39, |
| 132 | 0xC3,0x57,0x0C, |
| 133 | 0xC3,0xE2,0x0B, |
| 134 | 0xC3,0x68,0x03, |
| 135 | 0xC3,0xF1,0x06, |
| 136 | 0xC3,0xCA,0x06, |
| 137 | 0xC3,0xC4,0x06, |
| 138 | 0xC3,0xD6,0x07, |
| 139 | 0xC3,0x89,0x13, |
| 140 | 0xC3,0x75,0x13, |
| 141 | 0xC3,0x9F,0x13, |
| 142 | 0xC3,0xFF,0x38, |
| 143 | 0xC3,0x60,0x13, |
| 144 | 0xC3,0x62,0x00, |
| 145 | 0xC3,0x39,0x04, |
| 146 | -1 |
| 147 | }; |
| 124 | 148 | |
| 149 | static WRITE8_HANDLER(mcuenable_hack_w) |
| 150 | { |
| 151 | //in fact it's gun feedback write, not mcu related |
| 152 | int i=0; |
| 153 | while(shtngtab[i]>=0) |
| 154 | { |
| 155 | system1_ram[i+0x40]=shtngtab[i]; |
| 156 | i++; |
| 157 | } |
| 125 | 158 | |
| 159 | system1_ram[0x2ff]=0x49; // I ? |
| 160 | system1_ram[0x3ff]=0x54; // T ? |
| 161 | } |
| 162 | |
| 163 | |
| 126 | 164 | static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 127 | 165 | AM_RANGE(0x0000, 0x7fff) AM_READ(SMH_ROM) |
| 128 | 166 | AM_RANGE(0x8000, 0xbfff) AM_READ(SMH_ROM) |
| r3289 | r3290 | |
| 238 | 276 | ADDRESS_MAP_END |
| 239 | 277 | |
| 240 | 278 | |
| 241 | | static ADDRESS_MAP_START( readport, ADDRESS_SPACE_IO, 8 ) |
| 279 | static ADDRESS_MAP_START( io_map, ADDRESS_SPACE_IO, 8 ) |
| 242 | 280 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 243 | 281 | AM_RANGE(0x00, 0x00) AM_READ_PORT("P1") |
| 244 | 282 | AM_RANGE(0x04, 0x04) AM_READ_PORT("P2") |
| r3289 | r3290 | |
| 246 | 284 | AM_RANGE(0x0c, 0x0c) AM_READ_PORT("DSW2") /* DIP2 */ |
| 247 | 285 | AM_RANGE(0x0e, 0x0e) AM_READ_PORT("DSW2") /* DIP2 blckgalb reads it from here */ |
| 248 | 286 | AM_RANGE(0x0d, 0x0d) AM_READ_PORT("DSW1") /* DIP1 some games read it from here... */ |
| 249 | | AM_RANGE(0x10, 0x10) AM_READ_PORT("DSW1") /* DIP1 ... and some others from here */ |
| 250 | | /* but there are games which check BOTH! */ |
| 251 | | |
| 287 | AM_RANGE(0x10, 0x10) AM_READ_PORT("DSW1") /* DIP1 ... and some others from here but there are games which check BOTH! */ |
| 252 | 288 | AM_RANGE(0x11, 0x11) AM_READ_PORT("DSW2") /* DIP2 ... blockgal */ |
| 253 | | |
| 254 | | |
| 255 | | AM_RANGE(0x15, 0x15) AM_READ(system1_videomode_r) |
| 256 | | AM_RANGE(0x19, 0x19) AM_READ(system1_videomode_r) /* mirror address */ |
| 289 | AM_RANGE(0x14, 0x14) AM_WRITE(system1_soundport_w) /* sound commands */ |
| 290 | AM_RANGE(0x15, 0x15) AM_READWRITE(system1_videomode_r, system1_videomode_w) /* video control and (in some games) bank switching */ |
| 291 | AM_RANGE(0x18, 0x18) AM_WRITE(system1_soundport_w) /* mirror address */ |
| 292 | AM_RANGE(0x19, 0x19) AM_READWRITE(system1_videomode_r, system1_videomode_w) /* mirror address */ |
| 257 | 293 | ADDRESS_MAP_END |
| 258 | 294 | |
| 259 | | static ADDRESS_MAP_START( writeport, ADDRESS_SPACE_IO, 8 ) |
| 295 | static ADDRESS_MAP_START( wbml_io_map, ADDRESS_SPACE_IO, 8 ) |
| 260 | 296 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 261 | | AM_RANGE(0x14, 0x14) AM_WRITE(system1_soundport_w) /* sound commands */ |
| 262 | | AM_RANGE(0x15, 0x15) AM_WRITE(system1_videomode_w) /* video control and (in some games) bank switching */ |
| 263 | | AM_RANGE(0x18, 0x18) AM_WRITE(system1_soundport_w) /* mirror address */ |
| 264 | | AM_RANGE(0x19, 0x19) AM_WRITE(system1_videomode_w) /* mirror address */ |
| 265 | | ADDRESS_MAP_END |
| 266 | | |
| 267 | | static ADDRESS_MAP_START( wbml_readport, ADDRESS_SPACE_IO, 8 ) |
| 268 | | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 269 | 297 | AM_RANGE(0x00, 0x00) AM_READ_PORT("P1") |
| 270 | 298 | AM_RANGE(0x04, 0x04) AM_READ_PORT("P2") |
| 271 | 299 | AM_RANGE(0x08, 0x08) AM_READ_PORT("SYSTEM") |
| 272 | 300 | AM_RANGE(0x0c, 0x0c) AM_READ_PORT("DSW2") /* DIP2 */ |
| 273 | 301 | AM_RANGE(0x0d, 0x0d) AM_READ_PORT("DSW1") /* DIP1 some games read it from here... */ |
| 274 | | AM_RANGE(0x10, 0x10) AM_READ_PORT("DSW1") /* DIP1 ... and some others from here */ |
| 275 | | /* but there are games which check BOTH! */ |
| 276 | | AM_RANGE(0x15, 0x15) AM_READ(system1_videomode_r) |
| 277 | | AM_RANGE(0x16, 0x16) AM_READ(wbml_videoram_bank_latch_r) |
| 302 | AM_RANGE(0x10, 0x10) AM_READ_PORT("DSW1") /* DIP1 ... and some others from here but there are games which check BOTH! */ |
| 303 | AM_RANGE(0x14, 0x14) AM_WRITE(system1_soundport_w) /* sound commands */ |
| 304 | AM_RANGE(0x15, 0x15) AM_READWRITE(system1_videomode_r, chplft_videomode_w) |
| 305 | AM_RANGE(0x16, 0x16) AM_READWRITE(wbml_videoram_bank_latch_r, wbml_videoram_bank_latch_w) |
| 278 | 306 | AM_RANGE(0x19, 0x19) AM_READ(system1_videomode_r) /* mirror address */ |
| 279 | 307 | ADDRESS_MAP_END |
| 280 | 308 | |
| 281 | | static ADDRESS_MAP_START( sht_readport, ADDRESS_SPACE_IO, 8 ) |
| 309 | static ADDRESS_MAP_START( sht_io_map, ADDRESS_SPACE_IO, 8 ) |
| 282 | 310 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 283 | 311 | /* AM_RANGE(0x00, 0x00) AM_READ_PORT("P1") */ |
| 284 | 312 | /* AM_RANGE(0x04, 0x04) AM_READ_PORT("P2") */ |
| 285 | 313 | AM_RANGE(0x08, 0x08) AM_READ_PORT("SYSTEM") |
| 286 | 314 | AM_RANGE(0x0c, 0x0c) AM_READ_PORT("DSW2") /* DIP2 */ |
| 287 | 315 | AM_RANGE(0x0d, 0x0d) AM_READ_PORT("DSW1") /* DIP1 some games read it from here... */ |
| 288 | | AM_RANGE(0x10, 0x10) AM_READ_PORT("DSW1") /* DIP1 ... and some others from here */ |
| 289 | | /* but there are games which check BOTH! */ |
| 290 | | |
| 316 | AM_RANGE(0x10, 0x10) AM_READ_PORT("DSW1") AM_WRITE(mcuenable_hack_w) |
| 317 | /* DIP1 ... and some others from here but there are games which check BOTH! */ |
| 291 | 318 | AM_RANGE(0x12, 0x12) AM_READ_PORT("TRIGGER") |
| 292 | | |
| 319 | AM_RANGE(0x14, 0x14) AM_WRITE(system1_soundport_w) /* sound commands */ |
| 320 | AM_RANGE(0x15, 0x15) AM_READWRITE(system1_videomode_r, chplft_videomode_w) |
| 321 | AM_RANGE(0x16, 0x16) AM_READWRITE(wbml_videoram_bank_latch_r, wbml_videoram_bank_latch_w) |
| 322 | AM_RANGE(0x18, 0x18) AM_READ_PORT("18") /* ?? */ |
| 323 | AM_RANGE(0x19, 0x19) AM_READ(system1_videomode_r) /* mirror address */ |
| 293 | 324 | AM_RANGE(0x1c, 0x1c) AM_READ_PORT("GUNX") |
| 294 | 325 | AM_RANGE(0x1d, 0x1d) AM_READ_PORT("GUNY") |
| 295 | | |
| 296 | | AM_RANGE(0x18, 0x18) AM_READ_PORT("18") /* ?? */ |
| 297 | | |
| 298 | | |
| 299 | | AM_RANGE(0x15, 0x15) AM_READ(system1_videomode_r) |
| 300 | | AM_RANGE(0x16, 0x16) AM_READ(wbml_videoram_bank_latch_r) |
| 301 | | AM_RANGE(0x19, 0x19) AM_READ(system1_videomode_r) /* mirror address */ |
| 302 | 326 | ADDRESS_MAP_END |
| 303 | 327 | |
| 304 | | |
| 305 | | |
| 306 | | static ADDRESS_MAP_START( nobo_readport, ADDRESS_SPACE_IO, 8 ) |
| 328 | static ADDRESS_MAP_START( nobo_io_map, ADDRESS_SPACE_IO, 8 ) |
| 307 | 329 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 308 | 330 | AM_RANGE(0x00, 0x00) AM_READ_PORT("P1") |
| 309 | 331 | AM_RANGE(0x04, 0x04) AM_READ_PORT("P2") |
| 310 | 332 | AM_RANGE(0x08, 0x08) AM_READ_PORT("SYSTEM") |
| 311 | | AM_RANGE(0x0c, 0x0c) AM_READ_PORT("DSW2") /* DIP2 */ |
| 312 | | AM_RANGE(0x0d, 0x0d) AM_READ_PORT("DSW1") /* DIP1 some games read it from here... */ |
| 313 | | AM_RANGE(0x15, 0x15) AM_READ(system1_videomode_r) |
| 314 | | AM_RANGE(0x16, 0x16) AM_READ(inport16_r) /* Used - check code at 0x05cb */ |
| 315 | | AM_RANGE(0x1c, 0x1c) AM_READ(inport1c_r) /* Shouldn't be called ! */ |
| 316 | | AM_RANGE(0x22, 0x22) AM_READ(inport22_r) /* Used - check code at 0xb253 */ |
| 317 | | AM_RANGE(0x23, 0x23) AM_READ(inport23_r) /* Used - check code at 0xb275 and 0xb283 */ |
| 333 | AM_RANGE(0x0c, 0x0c) AM_READ_PORT("DSW2") /* DIP2 */ |
| 334 | AM_RANGE(0x0d, 0x0d) AM_READ_PORT("DSW1") /* DIP1 some games read it from here... */ |
| 335 | AM_RANGE(0x14, 0x14) AM_WRITE(system1_soundport_w) /* sound commands ? */ |
| 336 | AM_RANGE(0x15, 0x15) AM_READWRITE(system1_videomode_r, brain_videomode_w) /* video control + bank switching */ |
| 337 | AM_RANGE(0x16, 0x16) AM_READWRITE(inport16_r, outport16_w) /* Used - check code at 0x05cb */ |
| 338 | AM_RANGE(0x17, 0x17) AM_WRITE(outport17_w) /* Not handled in emul. of other SS1/2 games */ |
| 339 | AM_RANGE(0x1c, 0x1c) AM_READ(inport1c_r) /* Shouldn't be called ! */ |
| 340 | AM_RANGE(0x22, 0x22) AM_READ(inport22_r) /* Used - check code at 0xb253 */ |
| 341 | AM_RANGE(0x23, 0x23) AM_READ(inport23_r) /* Used - check code at 0xb275 and 0xb283 */ |
| 342 | AM_RANGE(0x24, 0x24) AM_WRITE(outport24_w) /* Used - check code at 0xb24e and 0xb307 */ |
| 318 | 343 | ADDRESS_MAP_END |
| 319 | 344 | |
| 320 | | static ADDRESS_MAP_START( wbml_writeport, ADDRESS_SPACE_IO, 8 ) |
| 345 | static ADDRESS_MAP_START( hvymetal_io_map, ADDRESS_SPACE_IO, 8 ) |
| 321 | 346 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 322 | | AM_RANGE(0x14, 0x14) AM_WRITE(system1_soundport_w) /* sound commands */ |
| 323 | | AM_RANGE(0x15, 0x15) AM_WRITE(chplft_videomode_w) |
| 324 | | AM_RANGE(0x16, 0x16) AM_WRITE(wbml_videoram_bank_latch_w) |
| 325 | | ADDRESS_MAP_END |
| 326 | | |
| 327 | | static ADDRESS_MAP_START( hvymetal_writeport, ADDRESS_SPACE_IO, 8 ) |
| 328 | | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 347 | AM_RANGE(0x00, 0x00) AM_READ_PORT("P1") |
| 348 | AM_RANGE(0x04, 0x04) AM_READ_PORT("P2") |
| 349 | AM_RANGE(0x08, 0x08) AM_READ_PORT("SYSTEM") |
| 350 | AM_RANGE(0x0c, 0x0c) AM_READ_PORT("DSW2") /* DIP2 */ |
| 351 | AM_RANGE(0x0d, 0x0d) AM_READ_PORT("DSW1") /* DIP1 some games read it from here... */ |
| 352 | AM_RANGE(0x10, 0x10) AM_READ_PORT("DSW1") /* DIP1 ... and some others from here but there are games which check BOTH! */ |
| 353 | AM_RANGE(0x15, 0x15) AM_READ(system1_videomode_r) |
| 354 | AM_RANGE(0x16, 0x16) AM_READ(wbml_videoram_bank_latch_r) |
| 329 | 355 | AM_RANGE(0x18, 0x18) AM_WRITE(system1_soundport_w) /* sound commands */ |
| 330 | | AM_RANGE(0x19, 0x19) AM_WRITE(hvymetal_videomode_w) |
| 356 | AM_RANGE(0x19, 0x19) AM_READWRITE(system1_videomode_r, hvymetal_videomode_w) /* mirror address */ |
| 331 | 357 | ADDRESS_MAP_END |
| 332 | 358 | |
| 333 | | static ADDRESS_MAP_START( brain_writeport, ADDRESS_SPACE_IO, 8 ) |
| 359 | static ADDRESS_MAP_START( brain_io_map, ADDRESS_SPACE_IO, 8 ) |
| 334 | 360 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 335 | | AM_RANGE(0x18, 0x18) AM_WRITE(system1_soundport_w) /* sound commands */ |
| 336 | | AM_RANGE(0x19, 0x19) AM_WRITE(brain_videomode_w) |
| 361 | AM_RANGE(0x00, 0x00) AM_READ_PORT("P1") |
| 362 | AM_RANGE(0x04, 0x04) AM_READ_PORT("P2") |
| 363 | AM_RANGE(0x08, 0x08) AM_READ_PORT("SYSTEM") |
| 364 | AM_RANGE(0x0c, 0x0c) AM_READ_PORT("DSW2") /* DIP2 */ |
| 365 | AM_RANGE(0x0e, 0x0e) AM_READ_PORT("DSW2") /* DIP2 blckgalb reads it from here */ |
| 366 | AM_RANGE(0x0d, 0x0d) AM_READ_PORT("DSW1") /* DIP1 some games read it from here... */ |
| 367 | AM_RANGE(0x10, 0x10) AM_READ_PORT("DSW1") /* DIP1 ... and some others from here but there are games which check BOTH! */ |
| 368 | AM_RANGE(0x11, 0x11) AM_READ_PORT("DSW2") /* DIP2 ... blockgal */ |
| 369 | AM_RANGE(0x15, 0x15) AM_READ(system1_videomode_r) |
| 370 | AM_RANGE(0x18, 0x18) AM_WRITE(system1_soundport_w) /* sound commands */ |
| 371 | AM_RANGE(0x19, 0x19) AM_READWRITE(system1_videomode_r, brain_videomode_w) /* mirror address */ |
| 337 | 372 | ADDRESS_MAP_END |
| 338 | 373 | |
| 339 | | /* protection values from real hardware, these were verified to be the same on the title |
| 340 | | screen and in the first level... they're all jumps that the MCU appears to put in RAM |
| 341 | | at some point */ |
| 342 | | static const int shtngtab[]= |
| 343 | | { |
| 344 | | 0xC3,0xC1,0x39, |
| 345 | | 0xC3,0x6F,0x0A, |
| 346 | | 0xC3,0x56,0x39, |
| 347 | | 0xC3,0x57,0x0C, |
| 348 | | 0xC3,0xE2,0x0B, |
| 349 | | 0xC3,0x68,0x03, |
| 350 | | 0xC3,0xF1,0x06, |
| 351 | | 0xC3,0xCA,0x06, |
| 352 | | 0xC3,0xC4,0x06, |
| 353 | | 0xC3,0xD6,0x07, |
| 354 | | 0xC3,0x89,0x13, |
| 355 | | 0xC3,0x75,0x13, |
| 356 | | 0xC3,0x9F,0x13, |
| 357 | | 0xC3,0xFF,0x38, |
| 358 | | 0xC3,0x60,0x13, |
| 359 | | 0xC3,0x62,0x00, |
| 360 | | 0xC3,0x39,0x04, |
| 361 | | -1 |
| 362 | | }; |
| 363 | | static WRITE8_HANDLER(mcuenable_hack_w) |
| 364 | | { |
| 365 | | //in fact it's gun feedback write, not mcu related |
| 366 | | int i=0; |
| 367 | | while(shtngtab[i]>=0) |
| 368 | | { |
| 369 | | system1_ram[i+0x40]=shtngtab[i]; |
| 370 | | i++; |
| 371 | | } |
| 372 | | |
| 373 | | system1_ram[0x2ff]=0x49; // I ? |
| 374 | | system1_ram[0x3ff]=0x54; // T ? |
| 375 | | } |
| 376 | | |
| 377 | | static ADDRESS_MAP_START( sht_writeport, ADDRESS_SPACE_IO, 8 ) |
| 374 | static ADDRESS_MAP_START( chplft_io_map, ADDRESS_SPACE_IO, 8 ) |
| 378 | 375 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 379 | | AM_RANGE(0x10,0x10) AM_WRITE(mcuenable_hack_w) |
| 380 | | |
| 376 | AM_RANGE(0x00, 0x00) AM_READ_PORT("P1") |
| 377 | AM_RANGE(0x04, 0x04) AM_READ_PORT("P2") |
| 378 | AM_RANGE(0x08, 0x08) AM_READ_PORT("SYSTEM") |
| 379 | AM_RANGE(0x0c, 0x0c) AM_READ_PORT("DSW2") /* DIP2 */ |
| 380 | AM_RANGE(0x0d, 0x0d) AM_READ_PORT("DSW1") /* DIP1 some games read it from here... */ |
| 381 | AM_RANGE(0x10, 0x10) AM_READ_PORT("DSW1") /* DIP1 ... and some others from here but there are games which check BOTH! */ |
| 381 | 382 | AM_RANGE(0x14, 0x14) AM_WRITE(system1_soundport_w) /* sound commands */ |
| 382 | | AM_RANGE(0x15, 0x15) AM_WRITE(chplft_videomode_w) |
| 383 | | |
| 384 | | AM_RANGE(0x16, 0x16) AM_WRITE(wbml_videoram_bank_latch_w) |
| 383 | AM_RANGE(0x15, 0x15) AM_READWRITE(system1_videomode_r, chplft_videomode_w) |
| 384 | AM_RANGE(0x16, 0x16) AM_READ(wbml_videoram_bank_latch_r) |
| 385 | AM_RANGE(0x19, 0x19) AM_READ(system1_videomode_r) /* mirror address */ |
| 385 | 386 | ADDRESS_MAP_END |
| 386 | 387 | |
| 387 | 388 | |
| 388 | | static ADDRESS_MAP_START( chplft_writeport, ADDRESS_SPACE_IO, 8 ) |
| 389 | | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 390 | | AM_RANGE(0x14, 0x14) AM_WRITE(system1_soundport_w) /* sound commands */ |
| 391 | | AM_RANGE(0x15, 0x15) AM_WRITE(chplft_videomode_w) |
| 392 | | ADDRESS_MAP_END |
| 393 | | |
| 394 | | static ADDRESS_MAP_START( nobo_writeport, ADDRESS_SPACE_IO, 8 ) |
| 395 | | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 396 | | AM_RANGE(0x14, 0x14) AM_WRITE(system1_soundport_w) /* sound commands ? */ |
| 397 | | AM_RANGE(0x15, 0x15) AM_WRITE(brain_videomode_w) /* video control + bank switching */ |
| 398 | | AM_RANGE(0x16, 0x16) AM_WRITE(outport16_w) /* Used - check code at 0x05cb */ |
| 399 | | AM_RANGE(0x17, 0x17) AM_WRITE(outport17_w) /* Not handled in emul. of other SS1/2 games */ |
| 400 | | AM_RANGE(0x24, 0x24) AM_WRITE(outport24_w) /* Used - check code at 0xb24e and 0xb307 */ |
| 401 | | ADDRESS_MAP_END |
| 402 | | |
| 403 | | |
| 404 | 389 | static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 405 | 390 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 406 | 391 | AM_RANGE(0x8000, 0x87ff) AM_MIRROR(0x1800) AM_RAM |
| r3289 | r3290 | |
| 1810 | 1795 | /* basic machine hardware */ |
| 1811 | 1796 | MDRV_CPU_ADD("main", Z80, XTAL_4MHz) /* My Hero has 2 OSCs 8 & 20 MHz (Cabbe Info) */ |
| 1812 | 1797 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 1813 | | MDRV_CPU_IO_MAP(readport,writeport) |
| 1798 | MDRV_CPU_IO_MAP(io_map,0) |
| 1814 | 1799 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) |
| 1815 | 1800 | |
| 1816 | 1801 | MDRV_CPU_ADD("sound", Z80, XTAL_4MHz) |
| r3289 | r3290 | |
| 1874 | 1859 | MDRV_IMPORT_FROM( system1 ) |
| 1875 | 1860 | MDRV_CPU_MODIFY("main") |
| 1876 | 1861 | MDRV_CPU_PROGRAM_MAP(brain_readmem,writemem) |
| 1877 | | MDRV_CPU_IO_MAP(wbml_readport,hvymetal_writeport) |
| 1862 | MDRV_CPU_IO_MAP(hvymetal_io_map,0) |
| 1878 | 1863 | |
| 1879 | 1864 | MDRV_MACHINE_RESET(system1_banked) |
| 1880 | 1865 | |
| r3289 | r3290 | |
| 1887 | 1872 | MDRV_IMPORT_FROM( system1 ) |
| 1888 | 1873 | MDRV_CPU_MODIFY("main") |
| 1889 | 1874 | MDRV_CPU_PROGRAM_MAP(brain_readmem,chplft_writemem) |
| 1890 | | MDRV_CPU_IO_MAP(wbml_readport,chplft_writeport) |
| 1875 | MDRV_CPU_IO_MAP(chplft_io_map,0) |
| 1891 | 1876 | |
| 1892 | 1877 | MDRV_MACHINE_RESET(system1_banked) |
| 1893 | 1878 | |
| r3289 | r3290 | |
| 1904 | 1889 | MDRV_IMPORT_FROM( system1 ) |
| 1905 | 1890 | MDRV_CPU_MODIFY("main") |
| 1906 | 1891 | MDRV_CPU_PROGRAM_MAP(brain_readmem,writemem) |
| 1907 | | MDRV_CPU_IO_MAP(readport,brain_writeport) |
| 1892 | MDRV_CPU_IO_MAP(brain_io_map,0) |
| 1908 | 1893 | |
| 1909 | 1894 | MDRV_MACHINE_RESET(system1_banked) |
| 1910 | 1895 | |
| r3289 | r3290 | |
| 1917 | 1902 | MDRV_IMPORT_FROM( system1 ) |
| 1918 | 1903 | MDRV_CPU_MODIFY("main") |
| 1919 | 1904 | MDRV_CPU_PROGRAM_MAP(wbml_readmem,wbml_writemem) |
| 1920 | | MDRV_CPU_IO_MAP(wbml_readport,wbml_writeport) |
| 1905 | MDRV_CPU_IO_MAP(wbml_io_map,0) |
| 1921 | 1906 | |
| 1922 | 1907 | MDRV_MACHINE_RESET(wbml) |
| 1923 | 1908 | |
| r3289 | r3290 | |
| 1933 | 1918 | MDRV_IMPORT_FROM( system1 ) |
| 1934 | 1919 | MDRV_CPU_MODIFY("main") |
| 1935 | 1920 | MDRV_CPU_PROGRAM_MAP(brain_readmem,chplft_writemem) |
| 1936 | | MDRV_CPU_IO_MAP(sht_readport,sht_writeport) |
| 1921 | MDRV_CPU_IO_MAP(sht_io_map,0) |
| 1937 | 1922 | |
| 1938 | 1923 | MDRV_MACHINE_RESET(system1_banked) |
| 1939 | 1924 | |
| r3289 | r3290 | |
| 1953 | 1938 | MDRV_IMPORT_FROM( system1 ) |
| 1954 | 1939 | MDRV_CPU_REPLACE( "main", Z80, 8000000) /* ? guess ? */ |
| 1955 | 1940 | MDRV_CPU_PROGRAM_MAP(brain_readmem,nobo_writemem) |
| 1956 | | MDRV_CPU_IO_MAP(nobo_readport,nobo_writeport) |
| 1941 | MDRV_CPU_IO_MAP(nobo_io_map,0) |
| 1957 | 1942 | |
| 1958 | 1943 | MDRV_MACHINE_RESET(system1_banked) |
| 1959 | 1944 | |
src/mame/drivers/argus.c
| r3289 | r3290 | |
| 17 | 17 | Argus (C) 1986 NMK / Jaleco |
| 18 | 18 | Valtric (C) 1986 NMK / Jaleco |
| 19 | 19 | Butasan (C) 1987 NMK / Jaleco |
| 20 | | Bombs Away (C) 1988 Jaleco |
| 21 | 20 | |
| 22 | 21 | |
| 23 | 22 | System specs : |
| r3289 | r3290 | |
| 111 | 110 | VIDEO_START( argus ); |
| 112 | 111 | VIDEO_START( valtric ); |
| 113 | 112 | VIDEO_START( butasan ); |
| 114 | | VIDEO_START( bombsa ); |
| 115 | 113 | VIDEO_RESET( argus ); |
| 116 | 114 | VIDEO_RESET( valtric ); |
| 117 | 115 | VIDEO_RESET( butasan ); |
| 118 | | VIDEO_RESET( bombsa ); |
| 119 | 116 | VIDEO_UPDATE( argus ); |
| 120 | 117 | VIDEO_UPDATE( valtric ); |
| 121 | 118 | VIDEO_UPDATE( butasan ); |
| 122 | | VIDEO_UPDATE( bombsa ); |
| 123 | 119 | |
| 124 | | static UINT8 argus_bank_latch = 0x00; |
| 125 | | static UINT8 butasan_page_latch = 0x00; |
| 126 | | |
| 127 | 120 | READ8_HANDLER( argus_txram_r ); |
| 128 | | READ8_HANDLER( butasan_txram_r ); |
| 129 | | READ8_HANDLER( bombsa_txram_r ); |
| 130 | 121 | READ8_HANDLER( argus_bg1ram_r ); |
| 131 | | READ8_HANDLER( butasan_bg0ram_r ); |
| 132 | | READ8_HANDLER( butasan_bg1ram_r ); |
| 133 | 122 | READ8_HANDLER( argus_paletteram_r ); |
| 134 | | READ8_HANDLER( bombsa_paletteram_r ); |
| 135 | | READ8_HANDLER( butasan_txbackram_r ); |
| 136 | | READ8_HANDLER( butasan_bg0backram_r ); |
| 137 | 123 | |
| 138 | 124 | WRITE8_HANDLER( argus_txram_w ); |
| 139 | | WRITE8_HANDLER( butasan_txram_w ); |
| 140 | | WRITE8_HANDLER( bombsa_txram_w ); |
| 141 | 125 | WRITE8_HANDLER( argus_bg1ram_w ); |
| 142 | | WRITE8_HANDLER( butasan_bg0ram_w ); |
| 143 | | WRITE8_HANDLER( butasan_bg1ram_w ); |
| 144 | 126 | WRITE8_HANDLER( argus_bg0_scrollx_w ); |
| 145 | 127 | WRITE8_HANDLER( argus_bg0_scrolly_w ); |
| 146 | | WRITE8_HANDLER( butasan_bg0_scrollx_w ); |
| 147 | 128 | WRITE8_HANDLER( argus_bg1_scrollx_w ); |
| 148 | 129 | WRITE8_HANDLER( argus_bg1_scrolly_w ); |
| 149 | 130 | WRITE8_HANDLER( argus_bg_status_w ); |
| 150 | | WRITE8_HANDLER( valtric_bg_status_w ); |
| 151 | | WRITE8_HANDLER( butasan_bg0_status_w ); |
| 152 | 131 | WRITE8_HANDLER( argus_flipscreen_w ); |
| 153 | 132 | WRITE8_HANDLER( argus_paletteram_w ); |
| 133 | |
| 134 | WRITE8_HANDLER( valtric_bg_status_w ); |
| 154 | 135 | WRITE8_HANDLER( valtric_paletteram_w ); |
| 136 | WRITE8_HANDLER( valtric_mosaic_w ); |
| 137 | WRITE8_HANDLER( valtric_unknown_w ); |
| 138 | |
| 139 | READ8_HANDLER( butasan_pagedram_r ); |
| 140 | READ8_HANDLER( butasan_bg1ram_r ); |
| 141 | READ8_HANDLER( butasan_txbackram_r ); |
| 142 | READ8_HANDLER( butasan_bg0backram_r ); |
| 143 | WRITE8_HANDLER( butasan_pageselect_w ); |
| 144 | WRITE8_HANDLER( butasan_pagedram_w ); |
| 145 | WRITE8_HANDLER( butasan_bg1ram_w ); |
| 146 | WRITE8_HANDLER( butasan_bg0_status_w ); |
| 155 | 147 | WRITE8_HANDLER( butasan_paletteram_w ); |
| 156 | | WRITE8_HANDLER( bombsa_paletteram_w ); |
| 157 | 148 | WRITE8_HANDLER( butasan_txbackram_w ); |
| 158 | 149 | WRITE8_HANDLER( butasan_bg0backram_w ); |
| 159 | 150 | WRITE8_HANDLER( butasan_bg1_status_w ); |
| 160 | | WRITE8_HANDLER( bombsa_pageselect_w ); |
| 161 | | WRITE8_HANDLER( valtric_mosaic_w); |
| 151 | WRITE8_HANDLER( butasan_unknown_w ); |
| 162 | 152 | |
| 153 | |
| 163 | 154 | /*************************************************************************** |
| 164 | 155 | |
| 165 | 156 | Interrupt(s) |
| r3289 | r3290 | |
| 169 | 160 | static INTERRUPT_GEN( argus_interrupt ) |
| 170 | 161 | { |
| 171 | 162 | if (cpu_getiloops() == 0) |
| 172 | | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xd7); /* RST 10h */ |
| 163 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xd7); /* RST 10h */ |
| 173 | 164 | else |
| 174 | | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xcf); /* RST 08h */ |
| 165 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xcf); /* RST 08h */ |
| 175 | 166 | } |
| 176 | 167 | |
| 177 | 168 | /* Handler called by the YM2203 emulator when the internal timers cause an IRQ */ |
| r3289 | r3290 | |
| 197 | 188 | |
| 198 | 189 | ***************************************************************************/ |
| 199 | 190 | |
| 200 | | #if 0 |
| 201 | | static READ8_HANDLER( argus_bankselect_r ) |
| 202 | | { |
| 203 | | return argus_bank_latch; |
| 204 | | } |
| 205 | | #endif |
| 206 | | |
| 207 | 191 | static WRITE8_HANDLER( argus_bankselect_w ) |
| 208 | 192 | { |
| 209 | 193 | UINT8 *RAM = memory_region(machine, "main"); |
| 210 | 194 | int bankaddress; |
| 211 | 195 | |
| 212 | | argus_bank_latch = data; |
| 213 | 196 | bankaddress = 0x10000 + ((data & 7) * 0x4000); |
| 214 | 197 | memory_set_bankptr(1, &RAM[bankaddress]); /* Select 8 banks of 16k */ |
| 215 | 198 | } |
| 216 | 199 | |
| 217 | | static WRITE8_HANDLER( butasan_pageselect_w ) |
| 218 | | { |
| 219 | | butasan_page_latch = data; |
| 220 | | } |
| 221 | 200 | |
| 222 | | static READ8_HANDLER( butasan_pagedram_r ) |
| 223 | | { |
| 224 | | if (!(butasan_page_latch & 0x01)) |
| 225 | | { |
| 226 | | if (offset < 0x0800) /* BG0 RAM */ |
| 227 | | { |
| 228 | | return butasan_bg0ram_r( machine, offset ); |
| 229 | | } |
| 230 | | else if (offset < 0x1000) /* Back BG0 RAM */ |
| 231 | | { |
| 232 | | return butasan_bg0backram_r( machine, offset - 0x0800 ); |
| 233 | | } |
| 234 | | } |
| 235 | | else |
| 236 | | { |
| 237 | | if (offset < 0x0800) /* Text RAM */ |
| 238 | | { |
| 239 | | return butasan_txram_r( machine, offset ); |
| 240 | | } |
| 241 | | else if (offset < 0x1000) /* Back text RAM */ |
| 242 | | { |
| 243 | | return butasan_txbackram_r( machine, offset - 0x0800 ); |
| 244 | | } |
| 245 | | } |
| 246 | | |
| 247 | | return 0; |
| 248 | | } |
| 249 | | |
| 250 | | static WRITE8_HANDLER( butasan_pagedram_w ) |
| 251 | | { |
| 252 | | if (!(butasan_page_latch & 0x01)) |
| 253 | | { |
| 254 | | if (offset < 0x0800) /* BG0 RAM */ |
| 255 | | { |
| 256 | | butasan_bg0ram_w( machine, offset, data ); |
| 257 | | } |
| 258 | | else if (offset < 0x1000) /* Back BG0 RAM */ |
| 259 | | { |
| 260 | | butasan_bg0backram_w( machine, offset - 0x0800, data ); |
| 261 | | } |
| 262 | | } |
| 263 | | |
| 264 | | else |
| 265 | | { |
| 266 | | if (offset < 0x0800) /* Text RAM */ |
| 267 | | { |
| 268 | | butasan_txram_w( machine, offset, data ); |
| 269 | | } |
| 270 | | else if (offset < 0x1000) /* Back text RAM */ |
| 271 | | { |
| 272 | | butasan_txbackram_w( machine, offset - 0x0800, data ); |
| 273 | | } |
| 274 | | } |
| 275 | | } |
| 276 | | |
| 277 | | |
| 278 | 201 | /*************************************************************************** |
| 279 | 202 | |
| 280 | 203 | Memory Map(s) |
| r3289 | r3290 | |
| 316 | 239 | AM_RANGE(0xc200, 0xc200) AM_WRITE(soundlatch_w) |
| 317 | 240 | AM_RANGE(0xc201, 0xc201) AM_WRITE(argus_flipscreen_w) |
| 318 | 241 | AM_RANGE(0xc202, 0xc202) AM_WRITE(argus_bankselect_w) |
| 242 | AM_RANGE(0xc300, 0xc300) AM_WRITE(valtric_unknown_w) |
| 319 | 243 | AM_RANGE(0xc308, 0xc309) AM_WRITE(argus_bg1_scrollx_w) AM_BASE(&argus_bg1_scrollx) |
| 320 | 244 | AM_RANGE(0xc30a, 0xc30b) AM_WRITE(argus_bg1_scrolly_w) AM_BASE(&argus_bg1_scrolly) |
| 321 | 245 | AM_RANGE(0xc30c, 0xc30c) AM_WRITE(valtric_bg_status_w) |
| r3289 | r3290 | |
| 336 | 260 | AM_RANGE(0xc002, 0xc002) AM_READ_PORT("P2") |
| 337 | 261 | AM_RANGE(0xc003, 0xc003) AM_READ_PORT("DSW1") |
| 338 | 262 | AM_RANGE(0xc004, 0xc004) AM_READ_PORT("DSW2") |
| 263 | AM_RANGE(0xc100, 0xc100) AM_WRITE(butasan_unknown_w) |
| 339 | 264 | AM_RANGE(0xc200, 0xc200) AM_WRITE(soundlatch_w) |
| 340 | 265 | AM_RANGE(0xc201, 0xc201) AM_WRITE(argus_flipscreen_w) |
| 341 | 266 | AM_RANGE(0xc202, 0xc202) AM_WRITE(argus_bankselect_w) |
| 342 | 267 | AM_RANGE(0xc203, 0xc203) AM_WRITE(butasan_pageselect_w) |
| 343 | | AM_RANGE(0xc300, 0xc301) AM_WRITE(butasan_bg0_scrollx_w) AM_BASE(&argus_bg0_scrollx) |
| 268 | AM_RANGE(0xc300, 0xc301) AM_WRITE(argus_bg0_scrollx_w) AM_BASE(&argus_bg0_scrollx) |
| 344 | 269 | AM_RANGE(0xc302, 0xc303) AM_WRITE(argus_bg0_scrolly_w) AM_BASE(&argus_bg0_scrolly) |
| 345 | 270 | AM_RANGE(0xc304, 0xc304) AM_WRITE(butasan_bg0_status_w) |
| 346 | 271 | AM_RANGE(0xc308, 0xc309) AM_WRITE(argus_bg1_scrollx_w) AM_BASE(&argus_bg1_scrollx) |
| r3289 | r3290 | |
| 354 | 279 | AM_RANGE(0xf680, 0xffff) AM_RAM |
| 355 | 280 | ADDRESS_MAP_END |
| 356 | 281 | |
| 357 | | WRITE8_HANDLER( bombsa_txram_w ); |
| 358 | | READ8_HANDLER( bombsa_txram_r ); |
| 359 | | |
| 360 | | static ADDRESS_MAP_START( bombsa_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 361 | | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 362 | | AM_RANGE(0x8000, 0xbfff) AM_RAMBANK(1) |
| 363 | | AM_RANGE(0xc000, 0xcfff) AM_RAM |
| 364 | | |
| 365 | | /* ports look like the other games */ |
| 366 | | AM_RANGE(0xd000, 0xd000) AM_WRITE(soundlatch_w) // confirmed |
| 367 | | // AM_RANGE(0xd001, 0xd001) AM_WRITE(argus_flipscreen_w) |
| 368 | | AM_RANGE(0xd002, 0xd002) AM_WRITE(argus_bankselect_w) |
| 369 | | AM_RANGE(0xd003, 0xd003) AM_WRITE(bombsa_pageselect_w) // 0,1,0,1,0,1 etc. |
| 370 | | |
| 371 | | AM_RANGE(0xd000, 0xd1ff) AM_RAM |
| 372 | | AM_RANGE(0xd200, 0xd7ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 373 | | AM_RANGE(0xd800, 0xdfff) AM_RAM |
| 374 | | |
| 375 | | /* Input ports */ |
| 376 | | AM_RANGE(0xe000, 0xe000) AM_READ_PORT("SYSTEM") |
| 377 | | AM_RANGE(0xe001, 0xe001) AM_READ_PORT("P1") |
| 378 | | AM_RANGE(0xe002, 0xe002) AM_READ_PORT("P2") |
| 379 | | AM_RANGE(0xe003, 0xe003) AM_READ_PORT("DSW1") |
| 380 | | AM_RANGE(0xe004, 0xe004) AM_READ_PORT("DSW2") |
| 381 | | AM_RANGE(0xe000, 0xe7ff) AM_WRITE(SMH_RAM) // ?? |
| 382 | | AM_RANGE(0xe800, 0xefff) AM_READWRITE(bombsa_txram_r, bombsa_txram_w) AM_BASE(&argus_txram) // banked? it gets corrupted at game start, maybe its banked and one layer can be 16x16 or 8x8? |
| 383 | | AM_RANGE(0xf000, 0xffff) AM_READWRITE(bombsa_paletteram_r, bombsa_paletteram_w) AM_BASE(&argus_paletteram) // banked? |
| 384 | | ADDRESS_MAP_END |
| 385 | | |
| 386 | 282 | static ADDRESS_MAP_START( sound_map_a, ADDRESS_SPACE_PROGRAM, 8 ) |
| 387 | 283 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 388 | 284 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| r3289 | r3290 | |
| 395 | 291 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_r) |
| 396 | 292 | ADDRESS_MAP_END |
| 397 | 293 | |
| 398 | | static ADDRESS_MAP_START( sound_map_c, ADDRESS_SPACE_PROGRAM, 8 ) |
| 399 | | AM_RANGE(0x0000, 0xbfff) AM_ROM |
| 400 | | AM_RANGE(0xc000, 0xc7ff) AM_RAM |
| 401 | | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_r) |
| 402 | | AM_RANGE(0xf000, 0xf000) AM_WRITEONLY // Is this a confirm of some sort? |
| 403 | | ADDRESS_MAP_END |
| 404 | | |
| 294 | #if 0 |
| 405 | 295 | static ADDRESS_MAP_START( sound_portmap_1, ADDRESS_SPACE_IO, 8 ) |
| 406 | 296 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 407 | 297 | AM_RANGE(0x00, 0x00) AM_READWRITE(ym2203_status_port_0_r, ym2203_control_port_0_w) |
| 408 | 298 | AM_RANGE(0x01, 0x01) AM_READWRITE(ym2203_read_port_0_r, ym2203_write_port_0_w) |
| 409 | 299 | ADDRESS_MAP_END |
| 300 | #endif |
| 410 | 301 | |
| 411 | 302 | static ADDRESS_MAP_START( sound_portmap_2, ADDRESS_SPACE_IO, 8 ) |
| 412 | 303 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| r3289 | r3290 | |
| 461 | 352 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 462 | 353 | PORT_DIPNAME( 0x06, 0x06, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:6,7") |
| 463 | 354 | PORT_DIPSETTING( 0x04, DEF_STR( Easy ) ) |
| 464 | | PORT_DIPSETTING( 0x06, DEF_STR( Medium ) ) |
| 355 | PORT_DIPSETTING( 0x06, DEF_STR( Normal ) ) |
| 465 | 356 | PORT_DIPSETTING( 0x02, DEF_STR( Hard ) ) |
| 466 | 357 | PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) |
| 467 | 358 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW1:5") |
| 468 | 359 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 469 | 360 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 470 | | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Cabinet) ) PORT_DIPLOCATION("SW1:4") |
| 361 | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:4") |
| 471 | 362 | PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) |
| 472 | 363 | PORT_DIPSETTING( 0x10, DEF_STR( Cocktail ) ) |
| 473 | 364 | PORT_DIPNAME( 0x20, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:3") |
| r3289 | r3290 | |
| 491 | 382 | PORT_DIPSETTING( 0x18, DEF_STR( 1C_2C ) ) |
| 492 | 383 | PORT_DIPSETTING( 0x14, DEF_STR( 1C_3C ) ) |
| 493 | 384 | PORT_DIPSETTING( 0x10, DEF_STR( 1C_4C ) ) |
| 494 | | PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coin_A) ) PORT_DIPLOCATION("SW2:1,2,3") |
| 385 | PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:1,2,3") |
| 495 | 386 | PORT_DIPSETTING( 0x00, DEF_STR( 5C_1C ) ) |
| 496 | 387 | PORT_DIPSETTING( 0x20, DEF_STR( 4C_1C ) ) |
| 497 | 388 | PORT_DIPSETTING( 0x40, DEF_STR( 3C_1C ) ) |
| r3289 | r3290 | |
| 505 | 396 | static INPUT_PORTS_START( valtric ) |
| 506 | 397 | PORT_INCLUDE( argus ) |
| 507 | 398 | |
| 399 | PORT_MODIFY("DSW1") |
| 400 | PORT_DIPNAME( 0x06, 0x06, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:6,7") |
| 401 | PORT_DIPSETTING( 0x06, DEF_STR( Normal ) ) |
| 402 | PORT_DIPSETTING( 0x04, DEF_STR( Hard ) ) |
| 403 | PORT_DIPSETTING( 0x02, DEF_STR( Harder ) ) |
| 404 | PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) |
| 405 | PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2") |
| 406 | PORT_DIPSETTING( 0x00, "2" ) |
| 407 | PORT_DIPSETTING( 0xc0, "3" ) |
| 408 | PORT_DIPSETTING( 0x80, "4" ) |
| 409 | PORT_DIPSETTING( 0x40, "5" ) |
| 410 | |
| 508 | 411 | PORT_MODIFY("DSW2") |
| 509 | | PORT_DIPNAME( 0x01, 0x01, "Invulnerability (Cheat") PORT_DIPLOCATION("SW2:8") |
| 412 | PORT_DIPNAME( 0x01, 0x01, "Invulnerability (Cheat)" ) PORT_DIPLOCATION("SW2:8") |
| 510 | 413 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 511 | 414 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 512 | 415 | PORT_DIPNAME( 0x1c, 0x1c, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:4,5,6") |
| r3289 | r3290 | |
| 533 | 436 | PORT_INCLUDE( valtric ) |
| 534 | 437 | |
| 535 | 438 | PORT_MODIFY("SYSTEM") |
| 536 | | PORT_SERVICE( 0x20, IP_ACTIVE_LOW ) |
| 439 | PORT_SERVICE( 0x20, IP_ACTIVE_LOW ) |
| 537 | 440 | |
| 538 | 441 | PORT_MODIFY("DSW1") |
| 539 | 442 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW1:8") |
| 540 | 443 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 541 | 444 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 542 | | PORT_DIPNAME( 0x02, 0x02, "Invulnerability (Cheat)") PORT_DIPLOCATION("SW1:7") |
| 445 | PORT_DIPNAME( 0x02, 0x02, "Invulnerability (Cheat)" ) PORT_DIPLOCATION("SW1:7") |
| 543 | 446 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) |
| 544 | 447 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 545 | 448 | PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:5,6") |
| r3289 | r3290 | |
| 561 | 464 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 562 | 465 | INPUT_PORTS_END |
| 563 | 466 | |
| 564 | | static INPUT_PORTS_START( bombsa ) |
| 565 | | PORT_INCLUDE( argus ) |
| 566 | 467 | |
| 567 | | PORT_MODIFY("SYSTEM") |
| 568 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 569 | | |
| 570 | | PORT_MODIFY("DSW1") |
| 571 | | PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW1:8" ) // Coin_B |
| 572 | | PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW1:7" ) |
| 573 | | PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW1:6" ) // Coin_B |
| 574 | | PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW1:5" ) // Coin_B |
| 575 | | PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW1:4" ) |
| 576 | | PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW1:3" ) |
| 577 | | PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2") |
| 578 | | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) |
| 579 | | PORT_DIPSETTING( 0x40, "2 Coins 1 Credit/4 Coins 3 Credits" ) |
| 580 | | PORT_DIPSETTING( 0x80, DEF_STR( 3C_1C ) ) |
| 581 | | PORT_DIPSETTING( 0xc0, DEF_STR( 1C_4C ) ) |
| 582 | | |
| 583 | | PORT_MODIFY("DSW2") |
| 584 | | PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW2:8" ) |
| 585 | | PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW2:7" ) |
| 586 | | PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW2:6" ) |
| 587 | | PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW2:5" ) |
| 588 | | PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW2:4" ) |
| 589 | | PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW2:3" ) |
| 590 | | PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW2:2" ) |
| 591 | | PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW2:1" ) |
| 592 | | INPUT_PORTS_END |
| 593 | | |
| 594 | 468 | /*************************************************************************** |
| 595 | 469 | |
| 596 | 470 | Machine Driver(s) |
| r3289 | r3290 | |
| 600 | 474 | static const gfx_layout charlayout = |
| 601 | 475 | { |
| 602 | 476 | 8,8, /* 8x8 characters */ |
| 603 | | 1024, /* 1024 characters */ |
| 477 | 1024, /* 1024 characters */ |
| 604 | 478 | 4, /* 4 bits per pixel */ |
| 605 | 479 | { 0, 1, 2, 3 }, |
| 606 | 480 | { 0, 4, 8, 12, 16, 20, 24, 28 }, |
| r3289 | r3290 | |
| 611 | 485 | static const gfx_layout tilelayout_256 = |
| 612 | 486 | { |
| 613 | 487 | 16,16, /* 16x16 characters */ |
| 614 | | 256, /* 256 characters */ |
| 488 | 256, /* 256 characters */ |
| 615 | 489 | 4, /* 4 bits per pixel */ |
| 616 | 490 | { 0, 1, 2, 3 }, |
| 617 | 491 | { 0, 4, 8, 12, 16, 20, 24, 28, |
| r3289 | r3290 | |
| 624 | 498 | static const gfx_layout tilelayout_512 = |
| 625 | 499 | { |
| 626 | 500 | 16,16, /* 16x16 characters */ |
| 627 | | 512, /* 512 characters */ |
| 501 | 512, /* 512 characters */ |
| 628 | 502 | 4, /* 4 bits per pixel */ |
| 629 | 503 | { 0, 1, 2, 3 }, |
| 630 | 504 | { 0, 4, 8, 12, 16, 20, 24, 28, |
| r3289 | r3290 | |
| 637 | 511 | static const gfx_layout tilelayout_1024 = |
| 638 | 512 | { |
| 639 | 513 | 16,16, /* 16x16 characters */ |
| 640 | | 1024, /* 1024 characters */ |
| 514 | 1024, /* 1024 characters */ |
| 641 | 515 | 4, /* 4 bits per pixel */ |
| 642 | 516 | { 0, 1, 2, 3 }, |
| 643 | 517 | { 0, 4, 8, 12, 16, 20, 24, 28, |
| r3289 | r3290 | |
| 650 | 524 | static const gfx_layout tilelayout_2048 = |
| 651 | 525 | { |
| 652 | 526 | 16,16, /* 16x16 characters */ |
| 653 | | 2048, /* 2048 characters */ |
| 527 | 2048, /* 2048 characters */ |
| 654 | 528 | 4, /* 4 bits per pixel */ |
| 655 | 529 | { 0, 1, 2, 3 }, |
| 656 | 530 | { 0, 4, 8, 12, 16, 20, 24, 28, |
| r3289 | r3290 | |
| 663 | 537 | static const gfx_layout tilelayout_4096 = |
| 664 | 538 | { |
| 665 | 539 | 16,16, /* 16x16 characters */ |
| 666 | | 4096, /* 4096 characters */ |
| 540 | 4096, /* 4096 characters */ |
| 667 | 541 | 4, /* 4 bits per pixel */ |
| 668 | 542 | { 0, 1, 2, 3 }, |
| 669 | 543 | { 0, 4, 8, 12, 16, 20, 24, 28, |
| r3289 | r3290 | |
| 681 | 555 | GFXDECODE_END |
| 682 | 556 | |
| 683 | 557 | static GFXDECODE_START( valtric ) |
| 684 | | GFXDECODE_ENTRY( "gfx1", 0, tilelayout_1024, 0*16, 16 ) |
| 558 | GFXDECODE_ENTRY( "gfx1", 0, tilelayout_1024, 0*16, 16 ) |
| 685 | 559 | GFXDECODE_ENTRY( "gfx2", 0, tilelayout_2048, 16*16, 16 ) |
| 686 | 560 | GFXDECODE_ENTRY( "gfx3", 0, charlayout, 32*16, 16 ) |
| 687 | 561 | GFXDECODE_END |
| r3289 | r3290 | |
| 693 | 567 | GFXDECODE_ENTRY( "gfx4", 0, charlayout, 32*16, 16 ) |
| 694 | 568 | GFXDECODE_END |
| 695 | 569 | |
| 696 | | static GFXDECODE_START( bombsa ) |
| 697 | | GFXDECODE_ENTRY( "gfx1", 0, tilelayout_1024, 32*16, 16 ) |
| 698 | | GFXDECODE_ENTRY( "gfx2", 0, tilelayout_1024, 0*16, 16 ) |
| 699 | | GFXDECODE_ENTRY( "gfx3", 0, charlayout, 16*16, 16 ) |
| 700 | | GFXDECODE_END |
| 701 | 570 | |
| 702 | 571 | static MACHINE_DRIVER_START( argus ) |
| 703 | 572 | |
| r3289 | r3290 | |
| 708 | 577 | |
| 709 | 578 | MDRV_CPU_ADD("audio", Z80, 5000000) |
| 710 | 579 | MDRV_CPU_PROGRAM_MAP(sound_map_a,0) |
| 580 | #if 0 |
| 711 | 581 | MDRV_CPU_IO_MAP(sound_portmap_1,0) |
| 582 | #else |
| 583 | MDRV_CPU_IO_MAP(sound_portmap_2,0) |
| 584 | #endif |
| 712 | 585 | |
| 713 | 586 | MDRV_INTERLEAVE(10) |
| 714 | 587 | |
| r3289 | r3290 | |
| 719 | 592 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) |
| 720 | 593 | MDRV_SCREEN_SIZE(32*16, 32*16) |
| 721 | 594 | MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) |
| 595 | |
| 722 | 596 | MDRV_GFXDECODE(argus) |
| 723 | 597 | MDRV_PALETTE_LENGTH(896) |
| 724 | 598 | |
| r3289 | r3290 | |
| 729 | 603 | /* sound hardware */ |
| 730 | 604 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 731 | 605 | |
| 606 | #if 0 |
| 732 | 607 | MDRV_SOUND_ADD("ym", YM2203, 6000000 / 4) |
| 733 | 608 | MDRV_SOUND_CONFIG(ym2203_config) |
| 734 | 609 | MDRV_SOUND_ROUTE(0, "mono", 0.15) |
| 735 | 610 | MDRV_SOUND_ROUTE(1, "mono", 0.15) |
| 736 | 611 | MDRV_SOUND_ROUTE(2, "mono", 0.15) |
| 737 | 612 | MDRV_SOUND_ROUTE(3, "mono", 0.50) |
| 613 | #else |
| 614 | MDRV_SOUND_ADD("ym1", YM2203, 6000000 / 4) |
| 615 | MDRV_SOUND_CONFIG(ym2203_config) |
| 616 | MDRV_SOUND_ROUTE(0, "mono", 0.15) |
| 617 | MDRV_SOUND_ROUTE(1, "mono", 0.15) |
| 618 | MDRV_SOUND_ROUTE(2, "mono", 0.15) |
| 619 | MDRV_SOUND_ROUTE(3, "mono", 0.50) |
| 620 | |
| 621 | MDRV_SOUND_ADD("ym2", YM2203, 6000000 / 4) |
| 622 | MDRV_SOUND_ROUTE(0, "mono", 0.15) |
| 623 | MDRV_SOUND_ROUTE(1, "mono", 0.15) |
| 624 | MDRV_SOUND_ROUTE(2, "mono", 0.15) |
| 625 | MDRV_SOUND_ROUTE(3, "mono", 0.50) |
| 626 | #endif |
| 738 | 627 | MACHINE_DRIVER_END |
| 739 | 628 | |
| 740 | 629 | static MACHINE_DRIVER_START( valtric ) |
| r3289 | r3290 | |
| 757 | 646 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) |
| 758 | 647 | MDRV_SCREEN_SIZE(32*16, 32*16) |
| 759 | 648 | MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) |
| 649 | |
| 760 | 650 | MDRV_GFXDECODE(valtric) |
| 761 | 651 | MDRV_PALETTE_LENGTH(768) |
| 762 | 652 | |
| r3289 | r3290 | |
| 801 | 691 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) |
| 802 | 692 | MDRV_SCREEN_SIZE(32*16, 32*16) |
| 803 | 693 | MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1) |
| 694 | |
| 804 | 695 | MDRV_GFXDECODE(butasan) |
| 805 | 696 | MDRV_PALETTE_LENGTH(768) |
| 806 | 697 | |
| r3289 | r3290 | |
| 825 | 716 | MDRV_SOUND_ROUTE(3, "mono", 1.0) |
| 826 | 717 | MACHINE_DRIVER_END |
| 827 | 718 | |
| 828 | | static MACHINE_DRIVER_START( bombsa ) |
| 829 | 719 | |
| 830 | | /* basic machine hardware */ |
| 831 | | MDRV_CPU_ADD("main", Z80, 5000000) /* 5 MHz */ |
| 832 | | MDRV_CPU_PROGRAM_MAP(bombsa_map,0) |
| 833 | | MDRV_CPU_VBLANK_INT_HACK(argus_interrupt,2) |
| 834 | | |
| 835 | | MDRV_CPU_ADD("audio", Z80, 12000000 / 2) /* maybe CPU speeds are reversed? Probably not (ajg) */ |
| 836 | | MDRV_CPU_PROGRAM_MAP(sound_map_c,0) |
| 837 | | MDRV_CPU_IO_MAP(sound_portmap_2,0) |
| 838 | | |
| 839 | | MDRV_INTERLEAVE(10) |
| 840 | | |
| 841 | | /* video hardware */ |
| 842 | | MDRV_SCREEN_ADD("main", RASTER) |
| 843 | | MDRV_SCREEN_REFRESH_RATE(54) /* Guru says : VSync - 54Hz . HSync - 15.25kHz */ |
| 844 | | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| 845 | | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 846 | | MDRV_SCREEN_SIZE(32*16, 32*16) |
| 847 | | MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) |
| 848 | | MDRV_GFXDECODE(bombsa) |
| 849 | | MDRV_PALETTE_LENGTH(0x1000/2) |
| 850 | | |
| 851 | | MDRV_VIDEO_START(bombsa) |
| 852 | | MDRV_VIDEO_RESET(bombsa) |
| 853 | | MDRV_VIDEO_UPDATE(bombsa) |
| 854 | | |
| 855 | | /* sound hardware */ |
| 856 | | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 857 | | |
| 858 | | MDRV_SOUND_ADD("ym1", YM2203, 12000000 / 8) |
| 859 | | MDRV_SOUND_CONFIG(ym2203_config) |
| 860 | | MDRV_SOUND_ROUTE(0, "mono", 0.30) |
| 861 | | MDRV_SOUND_ROUTE(1, "mono", 0.30) |
| 862 | | MDRV_SOUND_ROUTE(2, "mono", 0.30) |
| 863 | | MDRV_SOUND_ROUTE(3, "mono", 1.0) |
| 864 | | |
| 865 | | MDRV_SOUND_ADD("ym2", YM2203, 12000000 / 8) |
| 866 | | MDRV_SOUND_ROUTE(0, "mono", 0.30) |
| 867 | | MDRV_SOUND_ROUTE(1, "mono", 0.30) |
| 868 | | MDRV_SOUND_ROUTE(2, "mono", 0.30) |
| 869 | | MDRV_SOUND_ROUTE(3, "mono", 1.0) |
| 870 | | MACHINE_DRIVER_END |
| 871 | | |
| 872 | | |
| 873 | 720 | /*************************************************************************** |
| 874 | 721 | |
| 875 | 722 | Game driver(s) |
| r3289 | r3290 | |
| 878 | 725 | |
| 879 | 726 | ROM_START( argus ) |
| 880 | 727 | ROM_REGION( 0x28000, "main", 0 ) /* Main CPU */ |
| 881 | | ROM_LOAD( "ag_02.bin", 0x00000, 0x08000, CRC(278a3f3d) SHA1(c5ac5a004ebf0194c33f71dab4020fa636cefbc2) ) |
| 882 | | ROM_LOAD( "ag_03.bin", 0x10000, 0x08000, CRC(3a7f3bfa) SHA1(b11e134c084fc3c982dfe31836c1cf3fc0d481fd) ) |
| 883 | | ROM_LOAD( "ag_04.bin", 0x18000, 0x08000, CRC(76adc9f6) SHA1(e223a8b2371c51f121958ee3687c777f597334c9) ) |
| 884 | | ROM_LOAD( "ag_05.bin", 0x20000, 0x08000, CRC(f76692d6) SHA1(1dc353a042cdda909eb9f1b1ca749a3b3eaa01e4) ) |
| 728 | ROM_LOAD( "ag_02.bin", 0x00000, 0x08000, CRC(278a3f3d) SHA1(c5ac5a004ebf0194c33f71dab4020fa636cefbc2) ) |
| 729 | ROM_LOAD( "ag_03.bin", 0x10000, 0x08000, CRC(3a7f3bfa) SHA1(b11e134c084fc3c982dfe31836c1cf3fc0d481fd) ) |
| 730 | ROM_LOAD( "ag_04.bin", 0x18000, 0x08000, CRC(76adc9f6) SHA1(e223a8b2371c51f121958ee3687c777f597334c9) ) |
| 731 | ROM_LOAD( "ag_05.bin", 0x20000, 0x08000, CRC(f76692d6) SHA1(1dc353a042cdda909eb9f1b1ca749a3b3eaa01e4) ) |
| 885 | 732 | |
| 886 | 733 | ROM_REGION( 0x10000, "audio", 0 ) /* Sound CPU */ |
| 887 | | ROM_LOAD( "ag_01.bin", 0x00000, 0x04000, CRC(769e3f57) SHA1(209160a96486ab0b90967c015143ec28fba2e2a4) ) |
| 734 | ROM_LOAD( "ag_01.bin", 0x00000, 0x04000, CRC(769e3f57) SHA1(209160a96486ab0b90967c015143ec28fba2e2a4) ) |
| 888 | 735 | |
| 889 | 736 | ROM_REGION( 0x20000, "gfx1", ROMREGION_DISPOSE ) /* Sprite */ |
| 890 | | ROM_LOAD( "ag_09.bin", 0x00000, 0x08000, CRC(6dbc1c58) SHA1(ef7b6901b702dd347b3a3f162162138175efe578) ) |
| 891 | | ROM_LOAD( "ag_08.bin", 0x08000, 0x08000, CRC(ce6e987e) SHA1(9de257d8061ec917f4d443ff509fd457f995d73b) ) |
| 892 | | ROM_LOAD( "ag_07.bin", 0x10000, 0x08000, CRC(bbb9638d) SHA1(61dec71d4d976bef3af26d0dc9c0355fd1098ffb) ) |
| 893 | | ROM_LOAD( "ag_06.bin", 0x18000, 0x08000, CRC(655b48f8) SHA1(4fce1dffe091b97e7055955743434e49e97b4b79) ) |
| 737 | ROM_LOAD( "ag_09.bin", 0x00000, 0x08000, CRC(6dbc1c58) SHA1(ef7b6901b702dd347b3a3f162162138175efe578) ) |
| 738 | ROM_LOAD( "ag_08.bin", 0x08000, 0x08000, CRC(ce6e987e) SHA1(9de257d8061ec917f4d443ff509fd457f995d73b) ) |
| 739 | ROM_LOAD( "ag_07.bin", 0x10000, 0x08000, CRC(bbb9638d) SHA1(61dec71d4d976bef3af26d0dc9c0355fd1098ffb) ) |
| 740 | ROM_LOAD( "ag_06.bin", 0x18000, 0x08000, CRC(655b48f8) SHA1(4fce1dffe091b97e7055955743434e49e97b4b79) ) |
| 894 | 741 | |
| 895 | 742 | ROM_REGION( 0x20000, "gfx2", ROMREGION_DISPOSE ) /* BG0 */ |
| 896 | | ROM_LOAD( "ag_13.bin", 0x00000, 0x08000, CRC(20274268) SHA1(9b7767d14bd169dabe6add0623d353bf4b59779b) ) |
| 897 | | ROM_LOAD( "ag_14.bin", 0x08000, 0x08000, CRC(ceb8860b) SHA1(90e094686d9d18e49e4848d18d1e31ac95f13937) ) |
| 898 | | ROM_LOAD( "ag_11.bin", 0x10000, 0x08000, CRC(99ce8556) SHA1(39caababd6e20ecb0375b85fb6490ee0b04f0949) ) |
| 899 | | ROM_LOAD( "ag_12.bin", 0x18000, 0x08000, CRC(e0e5377c) SHA1(b5981d832127d0b28b6a7bb0437716593e0ed71a) ) |
| 743 | ROM_LOAD( "ag_13.bin", 0x00000, 0x08000, CRC(20274268) SHA1(9b7767d14bd169dabe6add0623d353bf4b59779b) ) |
| 744 | ROM_LOAD( "ag_14.bin", 0x08000, 0x08000, CRC(ceb8860b) SHA1(90e094686d9d18e49e4848d18d1e31ac95f13937) ) |
| 745 | ROM_LOAD( "ag_11.bin", 0x10000, 0x08000, CRC(99ce8556) SHA1(39caababd6e20ecb0375b85fb6490ee0b04f0949) ) |
| 746 | ROM_LOAD( "ag_12.bin", 0x18000, 0x08000, CRC(e0e5377c) SHA1(b5981d832127d0b28b6a7bb0437716593e0ed71a) ) |
| 900 | 747 | |
| 901 | 748 | ROM_REGION( 0x08000, "gfx3", ROMREGION_DISPOSE ) /* BG1 */ |
| 902 | | ROM_LOAD( "ag_17.bin", 0x00000, 0x08000, CRC(0f12d09b) SHA1(718db4ff016526dddacdf6f0088f247ee97c6543) ) |
| 749 | ROM_LOAD( "ag_17.bin", 0x00000, 0x08000, CRC(0f12d09b) SHA1(718db4ff016526dddacdf6f0088f247ee97c6543) ) |
| 903 | 750 | |
| 904 | 751 | ROM_REGION( 0x08000, "gfx4", ROMREGION_DISPOSE ) /* Text */ |
| 905 | | ROM_LOAD( "ag_10.bin", 0x00000, 0x04000, CRC(2de696c4) SHA1(1ad0f1cde127a1618c2ea74a53e522963a79e5ce) ) |
| 752 | ROM_LOAD( "ag_10.bin", 0x00000, 0x04000, CRC(2de696c4) SHA1(1ad0f1cde127a1618c2ea74a53e522963a79e5ce) ) |
| 906 | 753 | |
| 907 | 754 | ROM_REGION( 0x08000, "user1", 0 ) /* Map */ |
| 908 | | ROM_LOAD( "ag_15.bin", 0x00000, 0x08000, CRC(99834c1b) SHA1(330f271771b158493b28bb178c8cda98efd1d90c) ) |
| 755 | ROM_LOAD( "ag_15.bin", 0x00000, 0x08000, CRC(99834c1b) SHA1(330f271771b158493b28bb178c8cda98efd1d90c) ) |
| 909 | 756 | |
| 910 | 757 | ROM_REGION( 0x08000, "user2", 0 ) /* Pattern */ |
| 911 | | ROM_LOAD( "ag_16.bin", 0x00000, 0x08000, CRC(39a51714) SHA1(ad89a630f1352eb4d8beeeebf909d5e2b5d7cc12) ) |
| 758 | ROM_LOAD( "ag_16.bin", 0x00000, 0x08000, CRC(39a51714) SHA1(ad89a630f1352eb4d8beeeebf909d5e2b5d7cc12) ) |
| 912 | 759 | ROM_END |
| 913 | 760 | |
| 914 | 761 | ROM_START( valtric ) |
| r3289 | r3290 | |
| 969 | 816 | ROM_END |
| 970 | 817 | |
| 971 | 818 | |
| 972 | | /* |
| 973 | | Bombs Away |
| 974 | | Jaleco, 1988 |
| 975 | | |
| 976 | | PCB Layout |
| 977 | | ---------- |
| 978 | | |
| 979 | | BB-8744 |
| 980 | | |------------------------------------------| |
| 981 | | | 1 Z80(1) 4 | |
| 982 | | | 6116 5MHz |-| |
| 983 | | |VOL YM2203 5 | | |
| 984 | | |4558 YM2203 Z80(2) | | |
| 985 | | |4558 YM3014 6 | | |
| 986 | | | YM3014 | | |
| 987 | | |J 6116 6264 | | |
| 988 | | |A |-| |
| 989 | | |M | |
| 990 | | |M | |
| 991 | | |A |-| |
| 992 | | | | | |
| 993 | | | | | |
| 994 | | | 2 62256 | | |
| 995 | | | DSW1 | | |
| 996 | | | 3 62256 | | |
| 997 | | | DSW2 82S137 |-| |
| 998 | | | | |
| 999 | | |------------------------------------------| |
| 1000 | | Notes: |
| 1001 | | Z80(1) clock - 5.000MHz |
| 1002 | | Z80(2) clock - 6.000MHz [12/2] |
| 1003 | | YM2203 clock - 1.500MHz [12/8, both] |
| 1004 | | VSync - 54Hz |
| 1005 | | HSync - 15.25kHz |
| 1006 | | |
| 1007 | | |
| 1008 | | BB-8745 |
| 1009 | | |--------------------------------| |
| 1010 | | | | |
| 1011 | | | |-----| |-| |
| 1012 | | | |N8633| | | |
| 1013 | | | |-S | | | |
| 1014 | | | |-----| | | |
| 1015 | | | 82S123 | | |
| 1016 | | | |-----| | | |
| 1017 | | | |N8633| |-| |
| 1018 | | | |-V | | |
| 1019 | | |2018 | | | |
| 1020 | | |2018 7 |6116 | 12MHz |-| |
| 1021 | | | |-----| | | |
| 1022 | | | |-----| | | |
| 1023 | | | |N8633| | | |
| 1024 | | | |-V64 | | | |
| 1025 | | | | | | | |
| 1026 | | | 9 8 |6264 | |-| |
| 1027 | | | |-----| | |
| 1028 | | |--------------------------------| |
| 1029 | | Notes: |
| 1030 | | 3 soldered-in 'modules' are located on this PCB. |
| 1031 | | N-8633-V 6-7 TOYOCOM |
| 1032 | | N-8633-V64 6-7 TOYOCOM |
| 1033 | | N-8633-S 6-7 TOYOCOM |
| 1034 | | The 2 larger ones have 62 pins, 31 pins on each side of a small PCB. The PCB contains some |
| 1035 | | surface mounted logic chips and some surface mounted RAM. |
| 1036 | | The smaller module has 40 pins, 20 pins on each side of a small PCB. The PCB contains only |
| 1037 | | logic on both sides. |
| 1038 | | */ |
| 1039 | | |
| 1040 | | ROM_START( bombsa ) |
| 1041 | | ROM_REGION( 0x30000, "main", 0 ) /* Main CPU */ |
| 1042 | | ROM_LOAD( "4.7a", 0x00000, 0x08000, CRC(0191f6a7) SHA1(10a0434abbf4be068751e65c81b1a211729e3742) ) |
| 1043 | | /* these fail their self-test... should be checked on real hw (hold start1+start2 on boot) */ |
| 1044 | | ROM_LOAD( "5.7c", 0x10000, 0x08000, BAD_DUMP CRC(095c451a) SHA1(892ca84376f89640ad4d28f1e548c26bc8f72c0e) ) // contains palettes etc. but fails rom check?? |
| 1045 | | ROM_LOAD( "6.7d", 0x20000, 0x10000, BAD_DUMP CRC(89f9dc0f) SHA1(5cf6a7aade3d56bc229d3771bc4141ad0c0e8da2) ) |
| 1046 | | |
| 1047 | | ROM_REGION( 0x10000, "audio", 0 ) /* Sound CPU */ |
| 1048 | | ROM_LOAD( "1.3a", 0x00000, 0x08000, CRC(92801404) SHA1(c4ff47989d355b18a909eaa88f138e2f68178ecc) ) |
| 1049 | | |
| 1050 | | ROM_REGION( 0x20000, "gfx1", ROMREGION_DISPOSE ) /* Sprite */ |
| 1051 | | ROM_LOAD( "2.4p", 0x00000, 0x10000, CRC(bd972ff4) SHA1(63bfb455bc0ae1d31e6f1066864ec0c8d2d0cf99) ) |
| 1052 | | ROM_LOAD( "3.4s", 0x10000, 0x10000, CRC(9a8a8a97) SHA1(13328631202c196c9d8791cc6063048eb6be0472) ) |
| 1053 | | |
| 1054 | | ROM_REGION( 0x20000, "gfx2", ROMREGION_DISPOSE ) /* BG0 */ |
| 1055 | | /* some corrupt 'blank' characters, should also be checked with a redump */ |
| 1056 | | ROM_LOAD( "8.2l", 0x00000, 0x10000, BAD_DUMP CRC(3391c769) SHA1(7ae7575ac81d6e0d915c279c1f57a9bc6d096bd6) ) |
| 1057 | | ROM_LOAD( "9.2m", 0x10000, 0x10000, BAD_DUMP CRC(5b315976) SHA1(d17cc1926f926bdd88b66ea6af88dac30880e7d4) ) |
| 1058 | | |
| 1059 | | ROM_REGION( 0x08000, "gfx3", ROMREGION_DISPOSE ) /* Text */ |
| 1060 | | ROM_LOAD( "7.4f", 0x00000, 0x08000, CRC(400114b9) SHA1(db2f3ba05a2005ae0e0e7d19c8739353032cbeab) ) |
| 1061 | | |
| 1062 | | ROM_REGION( 0x08000, "user1", ROMREGION_DISPOSE ) /* Proms */ |
| 1063 | | ROM_LOAD( "82s131.7l", 0x000, 0x200, CRC(6a7d13c0) SHA1(2a835a4ac1acb7663d0b915d0339af9800284da6) ) |
| 1064 | | ROM_LOAD( "82s137.3t", 0x000, 0x400, CRC(59e44236) SHA1(f53d99694fa5acd7cc51dd78e09f0d2ef730e7a4) ) |
| 1065 | | ROM_END |
| 1066 | | |
| 1067 | | |
| 1068 | | /* ( YEAR NAME PARENT MACHINE INPUT INIT MONITOR COMPANY FULLNAME ) */ |
| 819 | /* ( YEAR NAME PARENT MACHINE INPUT INIT MONITOR COMPANY FULLNAME ) */ |
| 1069 | 820 | GAME( 1986, argus, 0, argus, argus, 0, ROT270, "[NMK] (Jaleco license)", "Argus" , GAME_IMPERFECT_GRAPHICS ) |
| 1070 | 821 | GAME( 1986, valtric, 0, valtric, valtric, 0, ROT270, "[NMK] (Jaleco license)", "Valtric" , GAME_IMPERFECT_GRAPHICS ) |
| 1071 | 822 | GAME( 1987, butasan, 0, butasan, butasan, 0, ROT0, "[NMK] (Jaleco license)", "Butasan (Japan)", GAME_IMPERFECT_GRAPHICS ) |
| 1072 | | GAME( 1988, bombsa, 0, bombsa, bombsa, 0, ROT270, "Jaleco", "Bombs Away" , GAME_NOT_WORKING ) |
src/mame/drivers/namcona1.c
| r3289 | r3290 | |
| 18 | 18 | - X-Day 2 |
| 19 | 19 | |
| 20 | 20 | To Do: |
| 21 | - Remove remaining MCU simulation hacks |
| 22 | - View area / screen resolution controlled by registers? |
| 21 | 23 | |
| 22 | | - view area / screen resolution controlled by registers? |
| 23 | | |
| 24 | | - Xday 2: |
| 24 | - X-Day 2: |
| 25 | 25 | Rom board M112 |
| 26 | 26 | Rom board custom Key chip i.d. C394 |
| 27 | 27 | Game uses a small cash-register type printer (connects to rom board) |
| r3289 | r3290 | |
| 162 | 162 | #include "deprecat.h" |
| 163 | 163 | #include "namcona1.h" |
| 164 | 164 | #include "sound/c140.h" |
| 165 | | #include "sound/namcona.h" |
| 166 | 165 | #include "cpu/m37710/m37710.h" |
| 167 | 166 | |
| 168 | 167 | static UINT16 *mpBank0, *mpBank1; |
| 169 | | static UINT8 mCoinCount[4]; |
| 170 | | static UINT8 mCoinState; |
| 171 | | static UINT16 *mcu_ram; |
| 172 | 168 | static int mEnableInterrupts; |
| 173 | 169 | int namcona1_gametype; |
| 174 | | static int is_na2; |
| 175 | 170 | |
| 176 | 171 | /*************************************************************************/ |
| 177 | 172 | |
| r3289 | r3290 | |
| 370 | 365 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 371 | 366 | INPUT_PORTS_END |
| 372 | 367 | |
| 373 | | static INPUT_PORTS_START( namcona2_joy ) |
| 374 | | PORT_START("DSW") |
| 375 | | PORT_DIPNAME( 0x01, 0x00, "DIP2 (Freeze)" ) |
| 376 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 377 | | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) |
| 378 | | PORT_DIPNAME( 0x02, 0x00, "DIP1 (Test)" ) |
| 379 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 380 | | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) |
| 381 | | PORT_DIPNAME( 0x20, 0x00, DEF_STR( Test ) ) |
| 382 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 383 | | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 384 | | PORT_DIPNAME( 0x40, 0x00, "SERVICE" ) |
| 385 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 386 | | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 387 | | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE ) |
| 388 | 368 | |
| 389 | | PORT_START("P1") |
| 390 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY |
| 391 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY |
| 392 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY |
| 393 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY |
| 394 | | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) |
| 395 | | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) |
| 396 | | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON3 ) |
| 397 | | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START1 ) |
| 398 | | |
| 399 | | PORT_START("P2") |
| 400 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) |
| 401 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) |
| 402 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) |
| 403 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) |
| 404 | | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 405 | | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) |
| 406 | | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(2) |
| 407 | | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START2 ) |
| 408 | | |
| 409 | | PORT_START("P3") |
| 410 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3) |
| 411 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3) |
| 412 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3) |
| 413 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3) |
| 414 | | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(3) |
| 415 | | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(3) |
| 416 | | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(3) |
| 417 | | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START3 ) |
| 418 | | |
| 419 | | PORT_START("P4") |
| 420 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(4) |
| 421 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(4) |
| 422 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(4) |
| 423 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(4) |
| 424 | | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(4) |
| 425 | | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(4) |
| 426 | | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(4) |
| 427 | | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START4 ) |
| 428 | | |
| 429 | | PORT_START("COIN") |
| 430 | | PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 431 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 ) |
| 432 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN2 ) |
| 433 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN3 ) |
| 434 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN4 ) |
| 435 | | INPUT_PORTS_END |
| 436 | | |
| 437 | | static INPUT_PORTS_START( namcona2_quiz ) |
| 438 | | PORT_START("DSW") |
| 439 | | PORT_DIPNAME( 0x01, 0x00, "DIP2 (Freeze)" ) |
| 440 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 441 | | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) |
| 442 | | PORT_DIPNAME( 0x02, 0x00, "DIP1 (Test)" ) |
| 443 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 444 | | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) |
| 445 | | PORT_DIPNAME( 0x20, 0x00, DEF_STR( Test ) ) |
| 446 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 447 | | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 448 | | PORT_DIPNAME( 0x40, 0x00, "SERVICE" ) |
| 449 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 450 | | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 451 | | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE ) |
| 452 | | |
| 453 | | PORT_START("P1") |
| 454 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON4 ) |
| 455 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON3 ) |
| 456 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2 ) |
| 457 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 ) |
| 458 | | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 459 | | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 460 | | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 461 | | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START1 ) |
| 462 | | |
| 463 | | PORT_START("P2") |
| 464 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(2) |
| 465 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(2) |
| 466 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) |
| 467 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 468 | | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 469 | | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 470 | | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 471 | | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START2 ) |
| 472 | | |
| 473 | | PORT_START("P3") |
| 474 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(3) |
| 475 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(3) |
| 476 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(3) |
| 477 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(3) |
| 478 | | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 479 | | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 480 | | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 481 | | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START3 ) |
| 482 | | |
| 483 | | PORT_START("P4") |
| 484 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(4) |
| 485 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(4) |
| 486 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(4) |
| 487 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(4) |
| 488 | | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 489 | | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 490 | | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 491 | | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START4 ) |
| 492 | | |
| 493 | | PORT_START("COIN") |
| 494 | | PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 495 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 ) |
| 496 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN2 ) |
| 497 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN3 ) |
| 498 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN4 ) |
| 499 | | INPUT_PORTS_END |
| 500 | | |
| 501 | 369 | /***************************************************************************/ |
| 502 | 370 | |
| 503 | | static void |
| 504 | | simulate_mcu( running_machine *machine ) |
| 371 | /* FIXME: These two functions shouldn't be necessary? */ |
| 372 | static void simulate_mcu( running_machine *machine ) |
| 505 | 373 | { |
| 506 | | int i; |
| 507 | | UINT16 data; |
| 508 | | UINT8 poll_coins; |
| 509 | | static const char *const portnames[] = { "P1", "P2", "P3", "P4" }; |
| 510 | | |
| 511 | 374 | namcona1_workram[0xf60/2] = 0x0000; /* mcu ready */ |
| 512 | | |
| 513 | | if (is_na2) |
| 514 | | { |
| 515 | | mcu_ram[0xfc0/2] = input_port_read(machine, "DSW"); /* dipswitch */ |
| 516 | | |
| 517 | | for( i=1; i<=4; i++ ) |
| 518 | | { |
| 519 | | data = input_port_read(machine, portnames[i-1])<<8; |
| 520 | | switch( namcona1_gametype ) |
| 521 | | { |
| 522 | | case NAMCO_KNCKHEAD: |
| 523 | | case NAMCO_BKRTMAQ: |
| 524 | | case NAMCO_QUIZTOU: |
| 525 | | case NAMCO_EXBANIA: |
| 526 | | data |= data>>8; |
| 527 | | break; |
| 528 | | |
| 529 | | case NAMCO_XDAY2: |
| 530 | | data |= data>>8; /* wrong! */ |
| 531 | | break; |
| 532 | | |
| 533 | | case NAMCO_TINKLPIT: |
| 534 | | if( data&0x2000 ) data |= 0x20; /* throw */ |
| 535 | | if( data&0x4000 ) data |= 0x10; /* jump */ |
| 536 | | if( i==1 ) |
| 537 | | { |
| 538 | | if( input_port_read(machine, "P1") & 0x80 ) data |= 0x80; /* P1 start */ |
| 539 | | } |
| 540 | | if( i==2 ) |
| 541 | | { |
| 542 | | if( input_port_read(machine, "P2") & 0x80 ) data |= 0x80; /* P2 start */ |
| 543 | | } |
| 544 | | break; |
| 545 | | |
| 546 | | default: |
| 547 | | break; |
| 548 | | } |
| 549 | | mcu_ram[0xfc0/2+i] = data; |
| 550 | | } |
| 551 | | |
| 552 | | /* "analog" and "encoder" ports are polled during test mode, |
| 553 | | * but I haven't found any games that make use of them. |
| 554 | | */ |
| 555 | | mcu_ram[0xfc0/2+0x05] = 0xffff; /* analog0,1 */ |
| 556 | | mcu_ram[0xfc0/2+0x06] = 0xffff; /* analog2,3 */ |
| 557 | | mcu_ram[0xfc0/2+0x07] = 0xffff; /* analog4,5 */ |
| 558 | | mcu_ram[0xfc0/2+0x08] = 0xffff; /* analog6,7 */ |
| 559 | | mcu_ram[0xfc0/2+0x09] = 0xffff; /* encoder0,1 */ |
| 560 | | |
| 561 | | poll_coins = input_port_read(machine, "COIN"); /* coin input */ |
| 562 | | if( (poll_coins&0x8)&~(mCoinState&0x8) ) mCoinCount[0]++; |
| 563 | | if( (poll_coins&0x4)&~(mCoinState&0x4) ) mCoinCount[1]++; |
| 564 | | if( (poll_coins&0x2)&~(mCoinState&0x2) ) mCoinCount[2]++; |
| 565 | | if( (poll_coins&0x1)&~(mCoinState&0x1) ) mCoinCount[3]++; |
| 566 | | mCoinState = poll_coins; |
| 567 | | |
| 568 | | mcu_ram[0xfc0/2+0xa] = (mCoinCount[0]<<8)|mCoinCount[1]; |
| 569 | | mcu_ram[0xfc0/2+0xb] = (mCoinCount[2]<<8)|mCoinCount[3]; |
| 570 | | |
| 571 | | /* special handling for F/A */ |
| 572 | | data = ~((input_port_read(machine, "P1")<<8)|input_port_read(machine, "P2")); |
| 573 | | mcu_ram[0xffc/2] = data; |
| 574 | | mcu_ram[0xffe/2] = data; |
| 575 | | |
| 576 | | if( namcona1_gametype == NAMCO_XDAY2 ) |
| 577 | | { |
| 578 | | int p1 = input_port_read(machine, "P1"); |
| 579 | | int p2 = input_port_read(machine, "P2"); |
| 580 | | UINT32 code = 0; |
| 581 | | if( p2&0x40 ) code |= 0x2000; // enter (top-level of self-test) |
| 582 | | if( p2&0x20 ) code |= 0x1000; // exit (top-level of self-test) |
| 583 | | if( p1&0x40 ) code |= 0x0020; // next (top-level of self-test) |
| 584 | | if( p1&0x20 ) code |= 0x0010; // prev (top-level of self-test) |
| 585 | | code = ~code; |
| 586 | | mcu_ram[0xffc/2] = code>>16; |
| 587 | | mcu_ram[0xffe/2] = code&0xffff; |
| 588 | | } |
| 589 | | } |
| 590 | | } /* simulate_mcu */ |
| 591 | | |
| 592 | | #ifdef UNUSED_FUNCTION |
| 593 | | static READ16_HANDLER( namcona1_mcu_r ) |
| 594 | | { |
| 595 | | return mcu_ram[offset]; |
| 596 | 375 | } |
| 597 | | #endif |
| 598 | 376 | |
| 599 | | static WRITE16_HANDLER( namcona1_mcu_w ) |
| 600 | | { |
| 601 | | COMBINE_DATA( &mcu_ram[offset] ); |
| 602 | | if( offset>=0x400/2 && (offset<0x820/2 || (offset>=0xf30/2 && offset<0xf72/2)) ) |
| 603 | | { |
| 604 | | logerror( "0x%03x: 0x%04x\n", offset*2, mcu_ram[offset] ); |
| 605 | | } |
| 606 | | /* |
| 607 | | 400..53d code for MCU? |
| 608 | 377 | |
| 609 | | 820: song select |
| 610 | | 822: song control (volume? tempo?) |
| 611 | | 824,826,828,....89e: sample select |
| 612 | | 0x40 is written to odd addresses to signal the MCU that a sound command has been issued |
| 613 | | |
| 614 | | 8f0: 0x07 unknown |
| 615 | | 8f2: 0x01 unknown |
| 616 | | 8f4: 0xa4 unknown |
| 617 | | |
| 618 | | f30..f71 data for MCU |
| 619 | | f72: MCU command: |
| 620 | | 0x07 = identify version |
| 621 | | 0x03 = process data |
| 622 | | 0x87 = ? |
| 623 | | |
| 624 | | fc0..fc9: used by knuckleheads (NA2-specific?) |
| 625 | | |
| 626 | | fd8: ? |
| 627 | | |
| 628 | | fbf: watchdog |
| 629 | | */ |
| 630 | | } |
| 631 | | |
| 632 | 378 | /* NA2 hardware sends a special command to the MCU, then tests to |
| 633 | 379 | * see if the proper BIOS version string appears in shared memory. |
| 634 | 380 | */ |
| r3289 | r3290 | |
| 643 | 389 | { |
| 644 | 390 | namcona1_workram[0x1000/2+i] = source[i]; |
| 645 | 391 | } |
| 646 | | } /* write_version_info */ |
| 392 | } |
| 647 | 393 | |
| 648 | | static WRITE16_HANDLER( mcu_command_w ) |
| 649 | | { |
| 650 | | UINT16 cmd = mcu_ram[0xf72/2]>>8; |
| 651 | | |
| 652 | | switch( cmd ){ |
| 653 | | case 0x03: |
| 654 | | /* Process data at 0xf30..0xf71 |
| 655 | | * |
| 656 | | * f30: 0101 0020 0400 013e 8a00 0000 0000 011e |
| 657 | | * f40: 0301 0000 0000 0000 8a16 0000 0000 012c |
| 658 | | * f50: 0301 0000 0000 0000 8a61 0000 0000 019e |
| 659 | | * f60: 0301 0000 0000 0000 8a61 0000 0000 01ae |
| 660 | | * f70: 0000 |
| 661 | | * |
| 662 | | * f30: 0301 0000 0000 0000 8a88 0000 0000 0120 |
| 663 | | * f40: 0301 0000 0000 0000 8ad1 0000 0000 015a |
| 664 | | * f50: 0301 0000 0000 0000 8af6 0000 0000 011c |
| 665 | | * f60: 0301 0000 0000 0000 8b08 0000 0000 0114 |
| 666 | | * f70: 0000 |
| 667 | | * |
| 668 | | * f30: 0300 0000 0000 0000 8b1f 2004 0000 0000 |
| 669 | | * f40: 0301 0000 0000 0000 8b33 0000 0000 8902 |
| 670 | | * f50: 0000 |
| 671 | | */ |
| 672 | | break; |
| 673 | | |
| 674 | | case 0x07: |
| 675 | | /* This command is used to detect Namco NA-2 hardware; without it, |
| 676 | | * NA-2 games (Knuckleheads, Numan Athletics) refuse to run. |
| 677 | | */ |
| 678 | | write_version_info(); |
| 679 | | break; |
| 680 | | } |
| 681 | | } /* mcu_command_w */ |
| 682 | | |
| 683 | | /***************************************************************************/ |
| 684 | | /* sound |
| 685 | | * |
| 686 | | * 8 bit signed PCM data |
| 687 | | * copied to workram |
| 688 | | * |
| 689 | | * 0x01fffc: pointer |
| 690 | | * 0x020000: samples |
| 691 | | * 0x040000: samples |
| 692 | | * 0x060000: samples |
| 693 | | * |
| 694 | | * 0x070000: metadata; 10 byte frames |
| 695 | | */ |
| 696 | | |
| 697 | | /***************************************************************************/ |
| 698 | | |
| 699 | 394 | /** |
| 700 | 395 | * "Custom Key" Emulation |
| 701 | 396 | * |
| r3289 | r3290 | |
| 800 | 495 | return namcona1_vreg[offset]; |
| 801 | 496 | } /* namcona1_vreg_r */ |
| 802 | 497 | |
| 803 | | static int |
| 804 | | transfer_dword( running_machine *machine, UINT32 dest, UINT32 source ) |
| 498 | static int transfer_dword( running_machine *machine, UINT32 dest, UINT32 source ) |
| 805 | 499 | { |
| 806 | 500 | UINT16 data; |
| 807 | 501 | |
| r3289 | r3290 | |
| 846 | 540 | return 0; |
| 847 | 541 | } /* transfer_dword */ |
| 848 | 542 | |
| 849 | | static void |
| 850 | | blit_setup( int format, int *bytes_per_row, int *pitch, int mode ) |
| 543 | static void blit_setup( int format, int *bytes_per_row, int *pitch, int mode ) |
| 851 | 544 | { |
| 852 | 545 | if( mode == 3 ) |
| 853 | 546 | { /* TILE DATA */ |
| r3289 | r3290 | |
| 1027 | 720 | { |
| 1028 | 721 | // logerror("mailbox_w_68k: %x @ %x\n", data, offset); |
| 1029 | 722 | |
| 1030 | | if (offset == 4) cpunum_set_input_line(machine, 1, M37710_LINE_IRQ0, HOLD_LINE); |
| 723 | if (offset == 4) |
| 724 | cpunum_set_input_line(machine, 1, M37710_LINE_IRQ0, HOLD_LINE); |
| 1031 | 725 | |
| 1032 | 726 | COMBINE_DATA(&mcu_mailbox[offset%8]); |
| 727 | |
| 728 | /* FIXME: This shouldn't be necessary now that the C70 BIOS is implemented, |
| 729 | but for some reason the MCU never responds to the version string command */ |
| 730 | if ( (namcona1_gametype == NAMCO_NUMANATH) || (namcona1_gametype == NAMCO_KNCKHEAD) ) |
| 731 | { |
| 732 | if ((namcona1_workram[0xf72/2] >> 8) == 7) |
| 733 | write_version_info(); |
| 734 | } |
| 1033 | 735 | } |
| 1034 | 736 | |
| 1035 | 737 | static WRITE16_HANDLER( mcu_mailbox_w_mcu ) |
| r3289 | r3290 | |
| 1053 | 755 | AM_RANGE(0xfff000, 0xffffff) AM_RAM AM_BASE(&spriteram16) /* spriteram */ |
| 1054 | 756 | ADDRESS_MAP_END |
| 1055 | 757 | |
| 758 | |
| 759 | static ADDRESS_MAP_START( namcona2_main_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 760 | AM_RANGE(0x000000, 0x07ffff) AM_RAM AM_BASE(&namcona1_workram) |
| 761 | AM_RANGE(0x3f8000, 0x3fffff) AM_READWRITE(mcu_mailbox_r, mcu_mailbox_w_68k) |
| 762 | AM_RANGE(0x400000, 0xbfffff) AM_ROM AM_REGION("main", 0x280000) /* data */ |
| 763 | AM_RANGE(0xd00000, 0xd00001) AM_WRITE(SMH_NOP) /* xday: serial out? */ |
| 764 | AM_RANGE(0xd40000, 0xd40001) AM_WRITE(SMH_NOP) /* xday: serial out? */ |
| 765 | AM_RANGE(0xd80000, 0xd80001) AM_WRITE(SMH_NOP) /* xday: serial out? */ |
| 766 | AM_RANGE(0xdc0000, 0xdc001f) AM_WRITE(SMH_NOP) /* xday: serial config? */ |
| 767 | AM_RANGE(0xc00000, 0xdfffff) AM_ROM AM_REGION("main", 0x080000) /* code */ |
| 768 | AM_RANGE(0xe00000, 0xe00fff) AM_READWRITE(namcona1_nvram_r, namcona1_nvram_w) |
| 769 | /* xday: additional battery-backed ram at 00E024FA? */ |
| 770 | AM_RANGE(0xe40000, 0xe4000f) AM_READWRITE(custom_key_r, custom_key_w) |
| 771 | AM_RANGE(0xefff00, 0xefffff) AM_READWRITE(namcona1_vreg_r, namcona1_vreg_w) AM_BASE(&namcona1_vreg) |
| 772 | AM_RANGE(0xf00000, 0xf01fff) AM_READWRITE(namcona1_paletteram_r, namcona1_paletteram_w) AM_BASE(&paletteram16) |
| 773 | AM_RANGE(0xf40000, 0xf7ffff) AM_READWRITE(namcona1_gfxram_r, namcona1_gfxram_w) |
| 774 | AM_RANGE(0xff0000, 0xffbfff) AM_READWRITE(namcona1_videoram_r, namcona1_videoram_w) AM_BASE(&videoram16) |
| 775 | AM_RANGE(0xffd000, 0xffdfff) AM_RAM /* unknown */ |
| 776 | AM_RANGE(0xffe000, 0xffefff) AM_RAM AM_BASE(&namcona1_scroll) /* scroll registers */ |
| 777 | AM_RANGE(0xfff000, 0xffffff) AM_RAM AM_BASE(&spriteram16) /* spriteram */ |
| 778 | ADDRESS_MAP_END |
| 779 | |
| 780 | |
| 1056 | 781 | /* ----- NA-1 MCU handling ----------------------------------- */ |
| 1057 | 782 | |
| 1058 | 783 | static READ16_HANDLER( na1mcu_shared_r ) |
| r3289 | r3290 | |
| 1285 | 1010 | MDRV_CPU_PROGRAM_MAP(namcona1_main_map,0) |
| 1286 | 1011 | MDRV_CPU_VBLANK_INT_HACK(namcona1_interrupt,5) |
| 1287 | 1012 | |
| 1288 | | MDRV_CPU_ADD("mcu", M37710, 50113000/4) |
| 1013 | MDRV_CPU_ADD("mcu", M37702, 50113000/4) |
| 1289 | 1014 | MDRV_CPU_PROGRAM_MAP(namcona1_mcu_map, 0) |
| 1290 | 1015 | MDRV_CPU_IO_MAP( namcona1_mcu_io_map, 0 ) |
| 1291 | 1016 | MDRV_CPU_VBLANK_INT_HACK(mcu_interrupt, 2) |
| r3289 | r3290 | |
| 1331 | 1056 | MDRV_SCREEN_VISIBLE_AREA(0, 38*8-1-0, 4*8, 32*8-1) |
| 1332 | 1057 | MACHINE_DRIVER_END |
| 1333 | 1058 | |
| 1334 | | static ADDRESS_MAP_START( namcona2_readmem, ADDRESS_SPACE_PROGRAM, 16 ) |
| 1335 | | AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_RAM) /* work RAM */ |
| 1336 | | AM_RANGE(0x400000, 0xbfffff) AM_ROM AM_REGION("main", 0x280000) /* data */ |
| 1337 | | AM_RANGE(0xc00000, 0xdfffff) AM_ROM AM_REGION("main", 0x080000) /* code */ |
| 1338 | | AM_RANGE(0xe00000, 0xe00fff) AM_READ(namcona1_nvram_r) |
| 1339 | | /* xday: additional battery-backed ram at 00E024FA? */ |
| 1340 | | AM_RANGE(0xe40000, 0xe4000f) AM_READ(custom_key_r) |
| 1341 | | AM_RANGE(0xefff00, 0xefffff) AM_READ(namcona1_vreg_r) |
| 1342 | | AM_RANGE(0xf00000, 0xf01fff) AM_READ(namcona1_paletteram_r) |
| 1343 | | AM_RANGE(0xf40000, 0xf7ffff) AM_READ(namcona1_gfxram_r) |
| 1344 | | AM_RANGE(0xff0000, 0xffbfff) AM_READ(namcona1_videoram_r) |
| 1345 | | AM_RANGE(0xffd000, 0xffdfff) AM_READ(SMH_RAM) /* unknown */ |
| 1346 | | AM_RANGE(0xffe000, 0xffefff) AM_READ(SMH_RAM) /* scroll registers */ |
| 1347 | | AM_RANGE(0xfff000, 0xffffff) AM_READ(SMH_RAM) /* spriteram */ |
| 1348 | | ADDRESS_MAP_END |
| 1349 | 1059 | |
| 1350 | | static ADDRESS_MAP_START( namcona2_writemem, ADDRESS_SPACE_PROGRAM, 16 ) |
| 1351 | | AM_RANGE(0x000000, 0x000fff) AM_WRITE(namcona1_mcu_w) AM_BASE(&mcu_ram) |
| 1352 | | AM_RANGE(0x000000, 0x07ffff) AM_WRITE(SMH_RAM) AM_BASE(&namcona1_workram) |
| 1353 | | AM_RANGE(0x3f8008, 0x3f8009) AM_WRITE(mcu_command_w) |
| 1354 | | AM_RANGE(0xd00000, 0xd00001) AM_WRITE(SMH_NOP) /* xday: serial out? */ |
| 1355 | | AM_RANGE(0xd40000, 0xd40001) AM_WRITE(SMH_NOP) /* xday: serial out? */ |
| 1356 | | AM_RANGE(0xd80000, 0xd80001) AM_WRITE(SMH_NOP) /* xday: serial out? */ |
| 1357 | | AM_RANGE(0xdc0000, 0xdc001f) AM_WRITE(SMH_NOP) /* xday: serial config? */ |
| 1358 | | AM_RANGE(0x400000, 0xdfffff) AM_WRITE(SMH_ROM) /* data + code */ |
| 1359 | | AM_RANGE(0xe00000, 0xe00fff) AM_WRITE(namcona1_nvram_w) |
| 1360 | | AM_RANGE(0xe40000, 0xe4000f) AM_WRITE(custom_key_w) |
| 1361 | | AM_RANGE(0xefff00, 0xefffff) AM_WRITE(namcona1_vreg_w) AM_BASE(&namcona1_vreg) |
| 1362 | | AM_RANGE(0xf00000, 0xf01fff) AM_WRITE(namcona1_paletteram_w) AM_BASE(&paletteram16) |
| 1363 | | AM_RANGE(0xf40000, 0xf7ffff) AM_WRITE(namcona1_gfxram_w) |
| 1364 | | AM_RANGE(0xff0000, 0xffbfff) AM_WRITE(namcona1_videoram_w) AM_BASE(&videoram16) |
| 1365 | | AM_RANGE(0xffd000, 0xffdfff) AM_WRITE(SMH_RAM) /* unknown */ |
| 1366 | | AM_RANGE(0xffe000, 0xffefff) AM_WRITE(SMH_RAM) AM_BASE(&namcona1_scroll) |
| 1367 | | AM_RANGE(0xfff000, 0xffffff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) |
| 1368 | | ADDRESS_MAP_END |
| 1369 | | |
| 1370 | | static namcona_interface NAMCONA_interface = |
| 1371 | | { |
| 1372 | | NULL, |
| 1373 | | 0x70000/2 |
| 1374 | | }; |
| 1375 | | |
| 1376 | 1060 | static MACHINE_DRIVER_START( namcona2 ) |
| 1061 | |
| 1377 | 1062 | /* basic machine hardware */ |
| 1378 | | MDRV_CPU_ADD("main", M68000, 50113000/4) |
| 1379 | | MDRV_CPU_PROGRAM_MAP(namcona2_readmem,namcona2_writemem) |
| 1380 | | MDRV_CPU_VBLANK_INT_HACK(namcona1_interrupt,5) |
| 1063 | MDRV_IMPORT_FROM(namcona1) |
| 1381 | 1064 | |
| 1382 | | MDRV_NVRAM_HANDLER(namcosna1) |
| 1383 | | MDRV_INTERLEAVE(40) |
| 1384 | | |
| 1385 | | /* video hardware */ |
| 1386 | | MDRV_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS) |
| 1387 | | |
| 1388 | | MDRV_SCREEN_ADD("main", RASTER) |
| 1389 | | MDRV_SCREEN_REFRESH_RATE(60) |
| 1390 | | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) |
| 1391 | | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 1392 | | MDRV_SCREEN_SIZE(38*8, 32*8) |
| 1393 | | MDRV_SCREEN_VISIBLE_AREA(8, 38*8-1-8, 4*8, 32*8-1) |
| 1394 | | |
| 1395 | | MDRV_PALETTE_LENGTH(0x2000) |
| 1396 | | |
| 1397 | | MDRV_VIDEO_START(namcona1) |
| 1398 | | MDRV_VIDEO_UPDATE(namcona1) |
| 1399 | | |
| 1400 | | /* sound hardware */ |
| 1401 | | MDRV_SPEAKER_STANDARD_STEREO("left", "right") |
| 1402 | | |
| 1403 | | MDRV_SOUND_ADD("namco", NAMCONA, 4*8000) |
| 1404 | | MDRV_SOUND_CONFIG(NAMCONA_interface) |
| 1405 | | MDRV_SOUND_ROUTE(0, "left", 1.0) |
| 1406 | | MDRV_SOUND_ROUTE(1, "right", 1.0) |
| 1065 | MDRV_CPU_REPLACE("main", M68000, 50113000/4) |
| 1066 | MDRV_CPU_PROGRAM_MAP(namcona2_main_map, 0) |
| 1407 | 1067 | MACHINE_DRIVER_END |
| 1408 | 1068 | |
| 1409 | | static void |
| 1410 | | init_namcona1( running_machine *machine, int gametype ) |
| 1411 | | { |
| 1412 | | UINT16 *pMem = (UINT16 *)memory_region( machine, "main" ); |
| 1413 | 1069 | |
| 1414 | | namcona1_gametype = gametype; |
| 1415 | | mpBank0 = &pMem[0x80000/2]; |
| 1416 | | mpBank1 = mpBank0 + 0x200000/2; |
| 1417 | | |
| 1418 | | is_na2 = 0; |
| 1419 | | mEnableInterrupts = 0; |
| 1420 | | } |
| 1421 | | |
| 1422 | | static void |
| 1423 | | init_namcona2( running_machine *machine, int gametype ) |
| 1070 | static void init_namcona1( running_machine *machine, int gametype ) |
| 1424 | 1071 | { |
| 1425 | 1072 | UINT16 *pMem = (UINT16 *)memory_region( machine, "main" ); |
| 1426 | 1073 | |
| 1427 | | namcona1_workram[0] = 0x0007; namcona1_workram[1] = 0xfffc; /* (?) stack */ |
| 1428 | | namcona1_workram[2] = 0x00c0; namcona1_workram[3] = 0x0000; /* reset vector */ |
| 1429 | | |
| 1430 | 1074 | namcona1_gametype = gametype; |
| 1431 | 1075 | mpBank0 = &pMem[0x80000/2]; |
| 1432 | 1076 | mpBank1 = mpBank0 + 0x200000/2; |
| 1433 | 1077 | |
| 1434 | | is_na2 = 1; |
| 1435 | | mCoinCount[0] = mCoinCount[1] = mCoinCount[2] = mCoinCount[3] = 0; |
| 1436 | | mCoinState = 0; |
| 1437 | 1078 | mEnableInterrupts = 0; |
| 1438 | | |
| 1439 | | NAMCONA_interface.memory_base = namcona1_workram; |
| 1440 | | if (namcona1_gametype == NAMCO_KNCKHEAD) |
| 1441 | | NAMCONA_interface.metadata_offset = 0x10000/2; |
| 1442 | | else |
| 1443 | | NAMCONA_interface.metadata_offset = 0x70000/2; |
| 1444 | 1079 | } |
| 1445 | 1080 | |
| 1446 | 1081 | static DRIVER_INIT( bkrtmaq ){ init_namcona1(machine, NAMCO_BKRTMAQ); } |
| 1447 | 1082 | static DRIVER_INIT( cgangpzl ){ init_namcona1(machine, NAMCO_CGANGPZL); } |
| 1448 | | static DRIVER_INIT( emeralda ){ init_namcona2(machine, NAMCO_EMERALDA); } /* NA-2 Hardware */ |
| 1083 | static DRIVER_INIT( emeralda ){ init_namcona1(machine, NAMCO_EMERALDA); } /* NA-2 Hardware */ |
| 1449 | 1084 | static DRIVER_INIT( emeraldj ){ init_namcona1(machine, NAMCO_EMERALDA); } /* NA-1 Hardware */ |
| 1450 | 1085 | static DRIVER_INIT( exbania ){ init_namcona1(machine, NAMCO_EXBANIA); } |
| 1451 | 1086 | static DRIVER_INIT( fa ){ init_namcona1(machine, NAMCO_FA); } |
| 1452 | | static DRIVER_INIT( knckhead ){ init_namcona2(machine, NAMCO_KNCKHEAD); } |
| 1453 | | static DRIVER_INIT( numanath ){ init_namcona2(machine, NAMCO_NUMANATH); } |
| 1454 | | static DRIVER_INIT( quiztou ){ init_namcona2(machine, NAMCO_QUIZTOU); } |
| 1087 | static DRIVER_INIT( knckhead ){ init_namcona1(machine, NAMCO_KNCKHEAD); } |
| 1088 | static DRIVER_INIT( numanath ){ init_namcona1(machine, NAMCO_NUMANATH); } |
| 1089 | static DRIVER_INIT( quiztou ){ init_namcona1(machine, NAMCO_QUIZTOU); } |
| 1455 | 1090 | static DRIVER_INIT( swcourt ){ init_namcona1(machine, NAMCO_SWCOURT); } |
| 1456 | 1091 | static DRIVER_INIT( tinklpit ){ init_namcona1(machine, NAMCO_TINKLPIT); } |
| 1457 | | static DRIVER_INIT( xday2 ){ init_namcona2(machine, NAMCO_XDAY2); } |
| 1092 | static DRIVER_INIT( xday2 ){ init_namcona1(machine, NAMCO_XDAY2); } |
| 1458 | 1093 | |
| 1459 | 1094 | ROM_START( bkrtmaq ) |
| 1460 | 1095 | ROM_REGION( 0xa80000, "main", 0 ) |
| r3289 | r3290 | |
| 1633 | 1268 | ROM_LOAD16_BYTE( "em2-ep1u.7f", 0x180000, 0x080000, CRC(dee15a81) SHA1(474a264029bd77e4205773a7461dea695e65933f) ) |
| 1634 | 1269 | |
| 1635 | 1270 | /* M37702 BIOS - labeled as Namco custom C70 */ |
| 1636 | | ROM_REGION16_LE( 0x4000, "cpu1", 0 ) |
| 1637 | | ROM_LOAD( "c70.bin", 0x000000, 0x004000, NO_DUMP ) |
| 1271 | ROM_REGION16_LE( 0x4000, "mcu", 0 ) |
| 1272 | ROM_LOAD( "c70.bin", 0x000000, 0x004000, CRC(b4015f23) SHA1(7ce91eda76e86b5cab625e2b67c463b7d143832e) ) |
| 1638 | 1273 | ROM_END |
| 1639 | 1274 | |
| 1640 | 1275 | ROM_START( knckhead ) |
| r3289 | r3290 | |
| 1654 | 1289 | ROM_LOAD16_BYTE( "kh1-ma3u.bin", 0x880000, 0x100000, CRC(efeb768d) SHA1(15d016244549f3ea0d19f5cfb04bcebd65ac6134) ) |
| 1655 | 1290 | |
| 1656 | 1291 | /* M37702 BIOS - labeled as Namco custom C70 */ |
| 1657 | | ROM_REGION16_LE( 0x4000, "cpu1", 0 ) |
| 1658 | | ROM_LOAD( "c70.bin", 0x000000, 0x004000, NO_DUMP ) |
| 1292 | ROM_REGION16_LE( 0x4000, "mcu", 0 ) |
| 1293 | ROM_LOAD( "c70.bin", 0x000000, 0x004000, CRC(b4015f23) SHA1(7ce91eda76e86b5cab625e2b67c463b7d143832e) ) |
| 1659 | 1294 | ROM_END |
| 1660 | 1295 | |
| 1661 | 1296 | ROM_START( knckhedj ) |
| r3289 | r3290 | |
| 1675 | 1310 | ROM_LOAD16_BYTE( "kh1-ma3u.bin", 0x880000, 0x100000, CRC(efeb768d) SHA1(15d016244549f3ea0d19f5cfb04bcebd65ac6134) ) |
| 1676 | 1311 | |
| 1677 | 1312 | /* M37702 BIOS - labeled as Namco custom C70 */ |
| 1678 | | ROM_REGION16_LE( 0x4000, "cpu1", 0 ) |
| 1679 | | ROM_LOAD( "c70.bin", 0x000000, 0x004000, NO_DUMP ) |
| 1313 | ROM_REGION16_LE( 0x4000, "mcu", 0 ) |
| 1314 | ROM_LOAD( "c70.bin", 0x000000, 0x004000, CRC(b4015f23) SHA1(7ce91eda76e86b5cab625e2b67c463b7d143832e) ) |
| 1680 | 1315 | ROM_END |
| 1681 | 1316 | |
| 1682 | 1317 | ROM_START( numanath ) |
| r3289 | r3290 | |
| 1696 | 1331 | ROM_LOAD16_BYTE( "nm1-ma3u.bin", 0x880000, 0x100000, CRC(f79e2112) SHA1(8bb8639a9d3a5d3ac5c9bb78e72b3d76582a9c25) ) |
| 1697 | 1332 | |
| 1698 | 1333 | /* M37702 BIOS - labeled as Namco custom C70 */ |
| 1699 | | ROM_REGION16_LE( 0x4000, "cpu1", 0 ) |
| 1700 | | ROM_LOAD( "c70.bin", 0x000000, 0x004000, NO_DUMP ) |
| 1334 | ROM_REGION16_LE( 0x4000, "mcu", 0 ) |
| 1335 | ROM_LOAD( "c70.bin", 0x000000, 0x004000, CRC(b4015f23) SHA1(7ce91eda76e86b5cab625e2b67c463b7d143832e) ) |
| 1701 | 1336 | ROM_END |
| 1702 | 1337 | |
| 1703 | 1338 | ROM_START( numanatj ) |
| r3289 | r3290 | |
| 1717 | 1352 | ROM_LOAD16_BYTE( "nm1-ma3u.bin", 0x880000, 0x100000, CRC(f79e2112) SHA1(8bb8639a9d3a5d3ac5c9bb78e72b3d76582a9c25) ) |
| 1718 | 1353 | |
| 1719 | 1354 | /* M37702 BIOS - labeled as Namco custom C70 */ |
| 1720 | | ROM_REGION16_LE( 0x4000, "cpu1", 0 ) |
| 1721 | | ROM_LOAD( "c70.bin", 0x000000, 0x004000, NO_DUMP ) |
| 1355 | ROM_REGION16_LE( 0x4000, "mcu", 0 ) |
| 1356 | ROM_LOAD( "c70.bin", 0x000000, 0x004000, CRC(b4015f23) SHA1(7ce91eda76e86b5cab625e2b67c463b7d143832e) ) |
| 1722 | 1357 | ROM_END |
| 1723 | 1358 | |
| 1724 | 1359 | ROM_START( quiztou ) |
| r3289 | r3290 | |
| 1738 | 1373 | ROM_LOAD16_BYTE( "qt1ma3u.5f", 0x880000, 0x100000, CRC(14a5a163) SHA1(1107f50e491bedeb4ab7ac3f32cfe47727274ba9) ) |
| 1739 | 1374 | |
| 1740 | 1375 | /* M37702 BIOS - labeled as Namco custom C70 */ |
| 1741 | | ROM_REGION16_LE( 0x4000, "cpu1", 0 ) |
| 1742 | | ROM_LOAD( "c70.bin", 0x000000, 0x004000, NO_DUMP ) |
| 1376 | ROM_REGION16_LE( 0x4000, "mcu", 0 ) |
| 1377 | ROM_LOAD( "c70.bin", 0x000000, 0x004000, CRC(b4015f23) SHA1(7ce91eda76e86b5cab625e2b67c463b7d143832e) ) |
| 1743 | 1378 | ROM_END |
| 1744 | 1379 | |
| 1745 | 1380 | ROM_START( xday2 ) |
| r3289 | r3290 | |
| 1753 | 1388 | ROM_LOAD16_BYTE( "xds1-dat3.8c", 0x680000, 0x200000, CRC(8980acc4) SHA1(ecd94a3d3a38923e8e322cd8863671af26e30812) ) |
| 1754 | 1389 | |
| 1755 | 1390 | /* M37702 BIOS - labeled as Namco custom C70 */ |
| 1756 | | ROM_REGION16_LE( 0x4000, "cpu1", 0 ) |
| 1757 | | ROM_LOAD( "c70.bin", 0x000000, 0x004000, NO_DUMP ) |
| 1391 | ROM_REGION16_LE( 0x4000, "mcu", 0 ) |
| 1392 | ROM_LOAD( "c70.bin", 0x000000, 0x004000, CRC(b4015f23) SHA1(7ce91eda76e86b5cab625e2b67c463b7d143832e) ) |
| 1758 | 1393 | ROM_END |
| 1759 | 1394 | |
| 1760 | 1395 | // NA-1 (C69 MCU) |
| 1761 | 1396 | GAME( 1992,bkrtmaq, 0, namcona1w, namcona1_quiz,bkrtmaq, ROT0, "Namco", "Bakuretsu Quiz Ma-Q Dai Bouken (Japan)", 0 ) |
| 1762 | | GAME( 1992,cgangpzl, 0, namcona1w, namcona1_joy, cgangpzl, ROT0, "Namco", "Cosmo Gang the Puzzle (US)", 0 ) |
| 1763 | | GAME( 1992,cgangpzj, cgangpzl, namcona1w, namcona1_joy, cgangpzl, ROT0, "Namco", "Cosmo Gang the Puzzle (Japan)", 0 ) |
| 1764 | | GAME( 1992,exvania, 0, namcona1, namcona1_joy, exbania, ROT0, "Namco", "Exvania (Japan)", 0 ) |
| 1765 | | GAME( 1992,fghtatck, 0, namcona1, namcona1_joy, fa, ROT90,"Namco", "Fighter & Attacker (US)", 0 ) |
| 1766 | | GAME( 1992,fa, fghtatck, namcona1, namcona1_joy, fa, ROT90,"Namco", "F/A (Japan)", 0 ) |
| 1767 | | GAME( 1992,swcourt, 0, namcona1w, namcona1_joy, swcourt, ROT0, "Namco", "Super World Court (World)", 0 ) |
| 1768 | | GAME( 1992,swcourtj, swcourt, namcona1w, namcona1_joy, swcourt, ROT0, "Namco", "Super World Court (Japan)", 0 ) |
| 1769 | | GAME( 1993,emeraldj, emeralda, namcona1w, namcona1_joy, emeraldj, ROT0, "Namco", "Emeraldia (Japan Version B)", 0 ) /* Parent is below on NA-2 Hardware */ |
| 1770 | | GAME( 1993,emerldja, emeralda, namcona1w, namcona1_joy, emeraldj, ROT0, "Namco", "Emeraldia (Japan)", 0 ) /* Parent is below on NA-2 Hardware */ |
| 1771 | | GAME( 1993,tinklpit, 0, namcona1w, namcona1_joy, tinklpit, ROT0, "Namco", "Tinkle Pit (Japan)", 0 ) |
| 1397 | GAME( 1992,cgangpzl, 0, namcona1w, namcona1_joy, cgangpzl, ROT0, "Namco", "Cosmo Gang the Puzzle (US)", 0 ) |
| 1398 | GAME( 1992,cgangpzj, cgangpzl, namcona1w, namcona1_joy, cgangpzl, ROT0, "Namco", "Cosmo Gang the Puzzle (Japan)", 0 ) |
| 1399 | GAME( 1992,exvania, 0, namcona1, namcona1_joy, exbania, ROT0, "Namco", "Exvania (Japan)", 0 ) |
| 1400 | GAME( 1992,fghtatck, 0, namcona1, namcona1_joy, fa, ROT90,"Namco", "Fighter & Attacker (US)", 0 ) |
| 1401 | GAME( 1992,fa, fghtatck, namcona1, namcona1_joy, fa, ROT90,"Namco", "F/A (Japan)", 0 ) |
| 1402 | GAME( 1992,swcourt, 0, namcona1w, namcona1_joy, swcourt, ROT0, "Namco", "Super World Court (World)", 0 ) |
| 1403 | GAME( 1992,swcourtj, swcourt, namcona1w, namcona1_joy, swcourt, ROT0, "Namco", "Super World Court (Japan)", 0 ) |
| 1404 | GAME( 1993,emeraldj, emeralda, namcona1w, namcona1_joy, emeraldj, ROT0, "Namco", "Emeraldia (Japan Version B)", 0 ) /* Parent is below on NA-2 Hardware */ |
| 1405 | GAME( 1993,emerldja, emeralda, namcona1w, namcona1_joy, emeraldj, ROT0, "Namco", "Emeraldia (Japan)", 0 ) /* Parent is below on NA-2 Hardware */ |
| 1406 | GAME( 1993,tinklpit, 0, namcona1w, namcona1_joy, tinklpit, ROT0, "Namco", "Tinkle Pit (Japan)", 0 ) |
| 1772 | 1407 | |
| 1773 | 1408 | // NA-2 (C70 MCU) |
| 1774 | | GAME( 1992,knckhead, 0, namcona2, namcona2_joy, knckhead, ROT0, "Namco", "Knuckle Heads (World)", GAME_IMPERFECT_SOUND ) |
| 1775 | | GAME( 1992,knckhedj, knckhead, namcona2, namcona2_joy, knckhead, ROT0, "Namco", "Knuckle Heads (Japan)", GAME_IMPERFECT_SOUND ) |
| 1776 | | GAME( 1993,emeralda, 0, namcona2, namcona2_joy, emeralda, ROT0, "Namco", "Emeraldia (World)", GAME_IMPERFECT_SOUND ) |
| 1777 | | GAME( 1993,numanath, 0, namcona2, namcona2_joy, numanath, ROT0, "Namco", "Numan Athletics (World)", GAME_IMPERFECT_SOUND ) |
| 1778 | | GAME( 1993,numanatj, numanath, namcona2, namcona2_joy, numanath, ROT0, "Namco", "Numan Athletics (Japan)", GAME_IMPERFECT_SOUND ) |
| 1779 | | GAME( 1993,quiztou, 0, namcona2, namcona2_quiz,quiztou, ROT0, "Namco", "Nettou! Gekitou! Quiztou!! (Japan)", GAME_IMPERFECT_SOUND ) |
| 1780 | | GAME( 1995,xday2, 0, namcona2, namcona2_joy, xday2, ROT0, "Namco", "X-Day 2 (Japan)", GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 1409 | GAME( 1992,knckhead, 0, namcona2, namcona1_joy, knckhead, ROT0, "Namco", "Knuckle Heads (World)", 0 ) |
| 1410 | GAME( 1992,knckhedj, knckhead, namcona2, namcona1_joy, knckhead, ROT0, "Namco", "Knuckle Heads (Japan)", 0 ) |
| 1411 | GAME( 1993,emeralda, 0, namcona2, namcona1_joy, emeralda, ROT0, "Namco", "Emeraldia (World)", 0 ) |
| 1412 | GAME( 1993,numanath, 0, namcona2, namcona1_joy, numanath, ROT0, "Namco", "Numan Athletics (World)", 0 ) |
| 1413 | GAME( 1993,numanatj, numanath, namcona2, namcona1_joy, numanath, ROT0, "Namco", "Numan Athletics (Japan)", 0 ) |
| 1414 | GAME( 1993,quiztou, 0, namcona2, namcona1_quiz,quiztou, ROT0, "Namco", "Nettou! Gekitou! Quiztou!! (Japan)", 0 ) |
| 1415 | GAME( 1995,xday2, 0, namcona2, namcona1_joy, xday2, ROT0, "Namco", "X-Day 2 (Japan)", GAME_IMPERFECT_GRAPHICS ) |
src/mame/drivers/snk.c
| r3289 | r3290 | |
| 67 | 67 | 1988 fsoccer: use the service mode dip switch |
| 68 | 68 | 1988 fitegolf: use the service mode dip switch |
| 69 | 69 | |
| 70 | - in all games except jcross, credits are edded on the 0->1 transition of the |
| 71 | coin inputs. However declaring the inputs as ACTIVE_HIGH makes ikarijp |
| 72 | enter test mode on boot, therefore I have to assume that ACTIVE_LOW is the |
| 73 | correct setting and the games just wait for the pulse to finish before |
| 74 | adding a credit. |
| 75 | |
| 70 | 76 | - the I/O area (C000-CFFF) is probably mirrored in large part on the two main |
| 71 | 77 | CPUs, however I mapped only the addresses actually used by the games. |
| 72 | 78 | |
| r3289 | r3290 | |
| 1444 | 1450 | |
| 1445 | 1451 | static INPUT_PORTS_START( marvins ) |
| 1446 | 1452 | PORT_START("IN0") |
| 1447 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) |
| 1448 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) |
| 1449 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 ) |
| 1453 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 1454 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 1455 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 1450 | 1456 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) |
| 1451 | 1457 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) |
| 1452 | 1458 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| r3289 | r3290 | |
| 1527 | 1533 | |
| 1528 | 1534 | static INPUT_PORTS_START( vangrd2 ) |
| 1529 | 1535 | PORT_START("IN0") |
| 1530 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) |
| 1536 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 1531 | 1537 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1532 | 1538 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1533 | 1539 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) |
| r3289 | r3290 | |
| 1611 | 1617 | |
| 1612 | 1618 | static INPUT_PORTS_START( madcrash ) |
| 1613 | 1619 | PORT_START("IN0") |
| 1614 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) |
| 1615 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) |
| 1616 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 ) |
| 1620 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 1621 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 1622 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 1617 | 1623 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) |
| 1618 | 1624 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) |
| 1619 | 1625 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(marvins_sound_busy, NULL) /* sound CPU status */ |
| r3289 | r3290 | |
| 1774 | 1780 | |
| 1775 | 1781 | static INPUT_PORTS_START( sgladiat ) |
| 1776 | 1782 | PORT_START("IN0") |
| 1777 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) |
| 1783 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 1778 | 1784 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1779 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 ) |
| 1785 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 1780 | 1786 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) |
| 1781 | 1787 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) |
| 1782 | 1788 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0) |
| r3289 | r3290 | |
| 1858 | 1864 | |
| 1859 | 1865 | static INPUT_PORTS_START( hal21 ) |
| 1860 | 1866 | PORT_START("IN0") |
| 1861 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) |
| 1867 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 1862 | 1868 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1863 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 ) |
| 1869 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 1864 | 1870 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) |
| 1865 | 1871 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) |
| 1866 | 1872 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0) |
| r3289 | r3290 | |
| 1941 | 1947 | |
| 1942 | 1948 | static INPUT_PORTS_START( aso ) |
| 1943 | 1949 | PORT_START("IN0") |
| 1944 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) |
| 1950 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 1945 | 1951 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1946 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 ) /* uses "Coinage" settings - code at 0x2e04 */ |
| 1952 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) /* uses "Coinage" settings - code at 0x2e04 */ |
| 1947 | 1953 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) |
| 1948 | 1954 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) |
| 1949 | 1955 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0) |
| r3289 | r3290 | |
| 2028 | 2034 | |
| 2029 | 2035 | static INPUT_PORTS_START( alphamis ) |
| 2030 | 2036 | PORT_START("IN0") |
| 2031 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) |
| 2032 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) |
| 2033 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 ) /* uses "Coin A" settings - code at 0x2e17 */ |
| 2037 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 2038 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 2039 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) /* uses "Coin A" settings - code at 0x2e17 */ |
| 2034 | 2040 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) |
| 2035 | 2041 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) |
| 2036 | 2042 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0) |
| r3289 | r3290 | |
| 2110 | 2116 | |
| 2111 | 2117 | static INPUT_PORTS_START( tnk3 ) |
| 2112 | 2118 | PORT_START("IN0") |
| 2113 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) |
| 2119 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 2114 | 2120 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 2115 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 ) |
| 2121 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 2116 | 2122 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) |
| 2117 | 2123 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) |
| 2118 | 2124 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0) |
| r3289 | r3290 | |
| 2200 | 2206 | static INPUT_PORTS_START( athena ) |
| 2201 | 2207 | PORT_START("IN0") |
| 2202 | 2208 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0) |
| 2203 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 ) /* uses "Coin A" settings - code at 0x09d4 */ |
| 2209 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) /* uses "Coin A" settings - code at 0x09d4 */ |
| 2204 | 2210 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 2205 | 2211 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 2206 | | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 ) |
| 2207 | | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 ) |
| 2212 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 2213 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 2208 | 2214 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 ) |
| 2209 | 2215 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) |
| 2210 | 2216 | |
| r3289 | r3290 | |
| 2285 | 2291 | static INPUT_PORTS_START( fitegolf ) |
| 2286 | 2292 | PORT_START("IN0") |
| 2287 | 2293 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0) |
| 2288 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 ) /* uses "Coin A" settings - code at 0x045b */ |
| 2294 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) /* uses "Coin A" settings - code at 0x045b */ |
| 2289 | 2295 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT ) /* reset */ |
| 2290 | 2296 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) /* same as the dip switch */ |
| 2291 | | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 ) |
| 2292 | | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 ) |
| 2297 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 2298 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 2293 | 2299 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 ) |
| 2294 | 2300 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) |
| 2295 | 2301 | |
| r3289 | r3290 | |
| 2370 | 2376 | static INPUT_PORTS_START( countryc ) |
| 2371 | 2377 | PORT_START("IN0") |
| 2372 | 2378 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0) |
| 2373 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 ) /* uses "Coin A" settings - code at 0x0450 */ |
| 2379 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) /* uses "Coin A" settings - code at 0x0450 */ |
| 2374 | 2380 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT ) /* reset */ |
| 2375 | 2381 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) /* same as the dip switch */ |
| 2376 | | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 ) |
| 2377 | | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 ) |
| 2382 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 2383 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 2378 | 2384 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 ) |
| 2379 | 2385 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) |
| 2380 | 2386 | |
| r3289 | r3290 | |
| 2452 | 2458 | static INPUT_PORTS_START( ikari ) |
| 2453 | 2459 | PORT_START("IN0") |
| 2454 | 2460 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0) |
| 2455 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 ) |
| 2461 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 2456 | 2462 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 2457 | 2463 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 2458 | | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 ) |
| 2459 | | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 ) |
| 2464 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 2465 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 2460 | 2466 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 ) |
| 2461 | 2467 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) |
| 2462 | 2468 | |
| r3289 | r3290 | |
| 2539 | 2545 | // non-JAMMA system inputs |
| 2540 | 2546 | |
| 2541 | 2547 | PORT_MODIFY("IN0") |
| 2542 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) |
| 2543 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) |
| 2544 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 ) |
| 2548 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 2549 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 2550 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 2545 | 2551 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) |
| 2546 | 2552 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) |
| 2547 | 2553 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0) |
| r3289 | r3290 | |
| 2586 | 2592 | static INPUT_PORTS_START( victroad ) |
| 2587 | 2593 | PORT_START("IN0") |
| 2588 | 2594 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0) |
| 2589 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 ) |
| 2595 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 2590 | 2596 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT ) /* reset */ |
| 2591 | 2597 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 2592 | | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 ) |
| 2593 | | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 ) |
| 2598 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 2599 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 2594 | 2600 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 ) |
| 2595 | 2601 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) |
| 2596 | 2602 | |
| r3289 | r3290 | |
| 2688 | 2694 | static INPUT_PORTS_START( bermudat ) |
| 2689 | 2695 | PORT_START("IN0") |
| 2690 | 2696 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0) |
| 2691 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 ) |
| 2697 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 2692 | 2698 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT ) /* tilt? */ |
| 2693 | 2699 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 2694 | | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 ) |
| 2695 | | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 ) |
| 2700 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 2701 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 2696 | 2702 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 ) |
| 2697 | 2703 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) |
| 2698 | 2704 | |
| r3289 | r3290 | |
| 2809 | 2815 | static INPUT_PORTS_START( gwar ) |
| 2810 | 2816 | PORT_START("IN0") |
| 2811 | 2817 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0) |
| 2812 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 ) |
| 2818 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 2813 | 2819 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT ) /* tilt? causes reset */ |
| 2814 | 2820 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) |
| 2815 | | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 ) |
| 2816 | | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 ) |
| 2821 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 2822 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 2817 | 2823 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 ) |
| 2818 | 2824 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) |
| 2819 | 2825 | |
| r3289 | r3290 | |
| 2916 | 2922 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 2917 | 2923 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT ) /* reset */ |
| 2918 | 2924 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 2919 | | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 ) |
| 2920 | | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 ) |
| 2925 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 2926 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 2921 | 2927 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 ) |
| 2922 | 2928 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) |
| 2923 | 2929 | |
| r3289 | r3290 | |
| 2995 | 3001 | static INPUT_PORTS_START( chopper ) |
| 2996 | 3002 | PORT_START("IN0") |
| 2997 | 3003 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0) |
| 2998 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 ) |
| 3004 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 2999 | 3005 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT ) /* Reset */ |
| 3000 | 3006 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) |
| 3001 | | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 ) |
| 3002 | | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 ) |
| 3007 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 3008 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 3003 | 3009 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 ) |
| 3004 | 3010 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) |
| 3005 | 3011 | |
| r3289 | r3290 | |
| 3109 | 3115 | PORT_START("IN0") |
| 3110 | 3116 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 3111 | 3117 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) |
| 3112 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 ) |
| 3118 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 3113 | 3119 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0) |
| 3114 | | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN1 ) |
| 3115 | | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN2 ) |
| 3120 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 3121 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 3116 | 3122 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Start Game A") |
| 3117 | 3123 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 ) PORT_NAME("Start Game B") |
| 3118 | 3124 | |
| r3289 | r3290 | |
| 3250 | 3256 | PORT_START("IN0") |
| 3251 | 3257 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 3252 | 3258 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) // same as the dip switch |
| 3253 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 ) |
| 3259 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 3254 | 3260 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0) |
| 3255 | | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN1 ) |
| 3256 | | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN2 ) |
| 3261 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 3262 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 3257 | 3263 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Start Game A") |
| 3258 | 3264 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 ) PORT_NAME("Start Game B") |
| 3259 | 3265 | |
src/mame/drivers/namconb1.c
| r3289 | r3290 | |
| 12 | 12 | Main CPU : Motorola 68020 32-bit processor @ 25MHz |
| 13 | 13 | Secondary CPUs : C329 + 137 (both custom) |
| 14 | 14 | Custom Graphics Chips : GFX:123,145,156,C116 - Motion Objects:C355,187,C347 |
| 15 | | Sound CPU : C75 (custom) |
| 15 | Sound CPU : C75 (Mitsu M37702 with internal ROM) |
| 16 | 16 | PCM Sound chip : C352 (custom) |
| 17 | 17 | I/O Chip : 160 (custom) |
| 18 | 18 | Board composition : Single board |
| r3289 | r3290 | |
| 274 | 274 | #include "namconb1.h" |
| 275 | 275 | #include "namcos2.h" |
| 276 | 276 | #include "namcoic.h" |
| 277 | | #include "audio/namcoc7x.h" |
| 277 | #include "sound/c352.h" |
| 278 | #include "cpu/m37710/m37710.h" |
| 278 | 279 | |
| 279 | 280 | #define NB1_NVMEM_SIZE (0x800) |
| 280 | 281 | static UINT32 *nvmem32; |
| r3289 | r3290 | |
| 282 | 283 | UINT32 *namconb1_workram32; |
| 283 | 284 | UINT32 *namconb1_spritebank32; |
| 284 | 285 | UINT32 *namconb1_tilebank32; |
| 286 | static UINT16 *namconb_shareram; |
| 285 | 287 | |
| 286 | 288 | /****************************************************************************/ |
| 287 | 289 | |
| r3289 | r3290 | |
| 351 | 353 | } |
| 352 | 354 | } /* namconb1_interrupt */ |
| 353 | 355 | |
| 356 | static INTERRUPT_GEN( mcu_interrupt ) |
| 357 | { |
| 358 | if (cpu_getiloops() == 0) |
| 359 | { |
| 360 | cpunum_set_input_line(machine, 1, M37710_LINE_IRQ0, HOLD_LINE); |
| 361 | } |
| 362 | else if (cpu_getiloops() == 1) |
| 363 | { |
| 364 | cpunum_set_input_line(machine, 1, M37710_LINE_IRQ2, HOLD_LINE); |
| 365 | } |
| 366 | else |
| 367 | { |
| 368 | cpunum_set_input_line(machine, 1, M37710_LINE_ADC, HOLD_LINE); |
| 369 | } |
| 370 | } |
| 354 | 371 | |
| 355 | 372 | static TIMER_CALLBACK( namconb2_TriggerPOSIRQ ) |
| 356 | 373 | { |
| r3289 | r3290 | |
| 596 | 613 | memset( &pMem[0xe6f*8], 0, numBytes ); |
| 597 | 614 | |
| 598 | 615 | namcos2_gametype = NAMCONB1_NEBULRAY; |
| 599 | | |
| 600 | | namcoc7x_on_driver_init(machine); |
| 601 | 616 | } /* nebulray */ |
| 602 | 617 | |
| 603 | 618 | static DRIVER_INIT( gslgr94u ) |
| 604 | 619 | { |
| 605 | 620 | namcos2_gametype = NAMCONB1_GSLGR94U; |
| 606 | | namcoc7x_on_driver_init(machine); |
| 607 | 621 | } /* gslgr94u */ |
| 608 | 622 | |
| 609 | 623 | static DRIVER_INIT( sws95 ) |
| 610 | 624 | { |
| 611 | 625 | namcos2_gametype = NAMCONB1_SWS95; |
| 612 | | namcoc7x_on_driver_init(machine); |
| 613 | 626 | } /* sws95 */ |
| 614 | 627 | |
| 615 | 628 | static DRIVER_INIT( sws96 ) |
| 616 | 629 | { |
| 617 | 630 | namcos2_gametype = NAMCONB1_SWS96; |
| 618 | | namcoc7x_on_driver_init(machine); |
| 619 | 631 | } /* sws96 */ |
| 620 | 632 | |
| 621 | 633 | static DRIVER_INIT( sws97 ) |
| 622 | 634 | { |
| 623 | 635 | namcos2_gametype = NAMCONB1_SWS97; |
| 624 | | namcoc7x_on_driver_init(machine); |
| 625 | 636 | } /* sws97 */ |
| 626 | 637 | |
| 627 | 638 | static DRIVER_INIT( gunbulet ) |
| 628 | 639 | { |
| 629 | 640 | namcos2_gametype = NAMCONB1_GUNBULET; |
| 630 | | namcoc7x_on_driver_init(machine); |
| 631 | 641 | } /* gunbulet */ |
| 632 | 642 | |
| 633 | 643 | static DRIVER_INIT( vshoot ) |
| 634 | 644 | { |
| 635 | 645 | namcos2_gametype = NAMCONB1_VSHOOT; |
| 636 | | namcoc7x_on_driver_init(machine); |
| 637 | 646 | } /* vshoot */ |
| 638 | 647 | |
| 639 | 648 | static DRIVER_INIT( machbrkr ) |
| 640 | 649 | { |
| 641 | 650 | namcos2_gametype = NAMCONB2_MACH_BREAKERS; |
| 642 | | namcoc7x_on_driver_init(machine); |
| 643 | 651 | } |
| 644 | 652 | |
| 645 | 653 | static DRIVER_INIT( outfxies ) |
| 646 | 654 | { |
| 647 | 655 | namcos2_gametype = NAMCONB2_OUTFOXIES; |
| 648 | | namcoc7x_on_driver_init(machine); |
| 649 | 656 | } |
| 650 | 657 | |
| 651 | 658 | static READ32_HANDLER( custom_key_r ) |
| r3289 | r3290 | |
| 817 | 824 | */ |
| 818 | 825 | } /* srand_w */ |
| 819 | 826 | |
| 827 | static READ32_HANDLER(namconb_share_r) |
| 828 | { |
| 829 | return (namconb_shareram[offset*2] << 16) | namconb_shareram[offset*2+1]; |
| 830 | } |
| 831 | |
| 832 | static WRITE32_HANDLER(namconb_share_w) |
| 833 | { |
| 834 | COMBINE_DATA(namconb_shareram+offset*2+1); |
| 835 | data >>= 16; |
| 836 | mem_mask >>= 16; |
| 837 | COMBINE_DATA(namconb_shareram+offset*2); |
| 838 | } |
| 839 | |
| 820 | 840 | static ADDRESS_MAP_START( namconb1_am, ADDRESS_SPACE_PROGRAM, 32 ) |
| 821 | 841 | AM_RANGE(0x000000, 0x0fffff) AM_READ(SMH_ROM) AM_WRITE(SMH_ROM) |
| 822 | 842 | AM_RANGE(0x100000, 0x10001f) AM_READ(gunbulet_gun_r) |
| 823 | 843 | AM_RANGE(0x1c0000, 0x1cffff) AM_READ(SMH_RAM) AM_WRITE(SMH_RAM) |
| 824 | 844 | AM_RANGE(0x1e4000, 0x1e4003) AM_READWRITE(randgen_r,srand_w) |
| 825 | | AM_RANGE(0x200000, 0x207fff) AM_READWRITE(namcoc7x_soundram32_r, namcoc7x_soundram32_w) |
| 845 | AM_RANGE(0x200000, 0x207fff) AM_READWRITE(namconb_share_r, namconb_share_w) |
| 826 | 846 | AM_RANGE(0x208000, 0x2fffff) AM_RAM |
| 827 | 847 | AM_RANGE(0x400000, 0x40001f) AM_READWRITE(namconb_cpureg_r, namconb1_cpureg_w) |
| 828 | 848 | AM_RANGE(0x580000, 0x5807ff) AM_READ(SMH_RAM) AM_WRITE(SMH_RAM) AM_BASE(&nvmem32) |
| r3289 | r3290 | |
| 839 | 859 | AM_RANGE(0x000000, 0x0fffff) AM_READ(SMH_ROM) AM_WRITE(SMH_ROM) |
| 840 | 860 | AM_RANGE(0x1c0000, 0x1cffff) AM_READ(SMH_RAM) AM_WRITE(SMH_RAM) |
| 841 | 861 | AM_RANGE(0x1e4000, 0x1e4003) AM_READWRITE(randgen_r,srand_w) |
| 842 | | AM_RANGE(0x200000, 0x207fff) AM_READWRITE(namcoc7x_soundram32_r, namcoc7x_soundram32_w) |
| 862 | AM_RANGE(0x200000, 0x207fff) AM_READWRITE(namconb_share_r, namconb_share_w) |
| 843 | 863 | AM_RANGE(0x208000, 0x2fffff) AM_RAM |
| 844 | 864 | AM_RANGE(0x400000, 0x4fffff) AM_ROM AM_REGION("data", 0) |
| 845 | 865 | AM_RANGE(0x600000, 0x61ffff) AM_READWRITE(namco_obj32_r,namco_obj32_w) |
| r3289 | r3290 | |
| 858 | 878 | AM_RANGE(0xf00000, 0xf0001f) AM_READWRITE(namconb_cpureg_r, namconb2_cpureg_w) |
| 859 | 879 | ADDRESS_MAP_END /* namconb2_readmem */ |
| 860 | 880 | |
| 881 | static WRITE16_HANDLER( nbmcu_shared_w ) |
| 882 | { |
| 883 | // HACK! Many games data ROM routines redirect the vector from the sound command read to an RTS. |
| 884 | // This needs more investigation. nebulray and vshoot do NOT do this. |
| 885 | // Timers A2 and A3 are set up in "external input counter" mode, this may be related. |
| 886 | if ((offset == 0x647c/2) && (data != 0)) |
| 887 | { |
| 888 | data = 0xd2f6; |
| 889 | } |
| 890 | |
| 891 | COMBINE_DATA(&namconb_shareram[offset]); |
| 892 | |
| 893 | // C74 BIOS has a very short window on the CPU sync signal, so immediately let the '020 at it |
| 894 | if ((offset == 0x6000/2) && (data & 0x80)) |
| 895 | { |
| 896 | cpu_spinuntil_time(ATTOTIME_IN_CYCLES(300, 1)); |
| 897 | } |
| 898 | } |
| 899 | |
| 900 | static ADDRESS_MAP_START( namcoc75_am, ADDRESS_SPACE_PROGRAM, 16 ) |
| 901 | AM_RANGE(0x002000, 0x002fff) AM_READWRITE( c352_0_r, c352_0_w ) |
| 902 | AM_RANGE(0x004000, 0x00bfff) AM_RAM_WRITE(nbmcu_shared_w) AM_BASE(&namconb_shareram) |
| 903 | AM_RANGE(0x00c000, 0x00ffff) AM_ROM AM_REGION("c75", 0) |
| 904 | AM_RANGE(0x200000, 0x27ffff) AM_ROM AM_REGION("c75data", 0) |
| 905 | ADDRESS_MAP_END |
| 906 | |
| 907 | static UINT8 nbx_port6; |
| 908 | |
| 909 | static READ8_HANDLER( port6_r ) |
| 910 | { |
| 911 | return nbx_port6; |
| 912 | } |
| 913 | |
| 914 | static WRITE8_HANDLER( port6_w ) |
| 915 | { |
| 916 | nbx_port6 = data; |
| 917 | } |
| 918 | |
| 919 | static READ8_HANDLER( port7_r ) |
| 920 | { |
| 921 | switch (nbx_port6 & 0xf0) |
| 922 | { |
| 923 | case 0x00: |
| 924 | return input_port_read_safe(machine, "P4", 0xff); |
| 925 | break; |
| 926 | |
| 927 | case 0x20: |
| 928 | return input_port_read(machine, "MISC"); |
| 929 | break; |
| 930 | |
| 931 | case 0x40: |
| 932 | return input_port_read(machine, "P1"); |
| 933 | break; |
| 934 | |
| 935 | case 0x60: |
| 936 | return input_port_read(machine, "P2"); |
| 937 | break; |
| 938 | |
| 939 | default: |
| 940 | break; |
| 941 | } |
| 942 | |
| 943 | return 0xff; |
| 944 | } |
| 945 | |
| 946 | // Is this madness? No, this is Namco. They didn't have enough digital ports for all 4 players, |
| 947 | // so the 8 bits of player 3 got routed to the 8 analog inputs. +5V on the analog input will |
| 948 | // register full scale, so it works... |
| 949 | static READ8_HANDLER(dac7_r) // bit 7 |
| 950 | { |
| 951 | return input_port_read_safe(machine, "P3", 0xff)&0x80; |
| 952 | } |
| 953 | |
| 954 | static READ8_HANDLER(dac6_r) // bit 3 |
| 955 | { |
| 956 | return (input_port_read_safe(machine, "P3", 0xff)<<1)&0x80; |
| 957 | } |
| 958 | |
| 959 | static READ8_HANDLER(dac5_r) // bit 2 |
| 960 | { |
| 961 | return (input_port_read_safe(machine, "P3", 0xff)<<2)&0x80; |
| 962 | } |
| 963 | |
| 964 | static READ8_HANDLER(dac4_r) // bit 1 |
| 965 | { |
| 966 | return (input_port_read_safe(machine, "P3", 0xff)<<3)&0x80; |
| 967 | } |
| 968 | |
| 969 | static READ8_HANDLER(dac3_r) // bit 0 |
| 970 | { |
| 971 | return (input_port_read_safe(machine, "P3", 0xff)<<4)&0x80; |
| 972 | } |
| 973 | |
| 974 | static READ8_HANDLER(dac2_r) // bit 4 |
| 975 | { |
| 976 | return (input_port_read_safe(machine, "P3", 0xff)<<5)&0x80; |
| 977 | } |
| 978 | |
| 979 | static READ8_HANDLER(dac1_r) // bit 5 |
| 980 | { |
| 981 | return (input_port_read_safe(machine, "P3", 0xff)<<6)&0x80; |
| 982 | } |
| 983 | |
| 984 | static READ8_HANDLER(dac0_r) // bit 6 |
| 985 | { |
| 986 | return (input_port_read_safe(machine, "P3", 0xff)<<7)&0x80; |
| 987 | } |
| 988 | |
| 989 | static ADDRESS_MAP_START( namcoc75_io, ADDRESS_SPACE_IO, 8 ) |
| 990 | AM_RANGE(M37710_PORT6, M37710_PORT6) AM_READWRITE(port6_r, port6_w) |
| 991 | AM_RANGE(M37710_PORT7, M37710_PORT7) AM_READ(port7_r) |
| 992 | AM_RANGE(M37710_ADC7_L, M37710_ADC7_L) AM_READ(dac7_r) |
| 993 | AM_RANGE(M37710_ADC6_L, M37710_ADC6_L) AM_READ(dac6_r) |
| 994 | AM_RANGE(M37710_ADC5_L, M37710_ADC5_L) AM_READ(dac5_r) |
| 995 | AM_RANGE(M37710_ADC4_L, M37710_ADC4_L) AM_READ(dac4_r) |
| 996 | AM_RANGE(M37710_ADC3_L, M37710_ADC3_L) AM_READ(dac3_r) |
| 997 | AM_RANGE(M37710_ADC2_L, M37710_ADC2_L) AM_READ(dac2_r) |
| 998 | AM_RANGE(M37710_ADC1_L, M37710_ADC1_L) AM_READ(dac1_r) |
| 999 | AM_RANGE(M37710_ADC0_L, M37710_ADC0_L) AM_READ(dac0_r) |
| 1000 | ADDRESS_MAP_END |
| 1001 | |
| 861 | 1002 | #define MASTER_CLOCK_HZ 48384000 |
| 862 | 1003 | |
| 863 | 1004 | static MACHINE_DRIVER_START( namconb1 ) |
| r3289 | r3290 | |
| 865 | 1006 | MDRV_CPU_PROGRAM_MAP(namconb1_am,0) |
| 866 | 1007 | MDRV_CPU_VBLANK_INT("main", namconb1_interrupt) |
| 867 | 1008 | |
| 868 | | NAMCO_C7X_MCU(MASTER_CLOCK_HZ/3) |
| 1009 | MDRV_CPU_ADD("mcu", M37702, MASTER_CLOCK_HZ/3) |
| 1010 | MDRV_CPU_PROGRAM_MAP(namcoc75_am, 0) |
| 1011 | MDRV_CPU_IO_MAP(namcoc75_io, 0) |
| 1012 | MDRV_CPU_VBLANK_INT_HACK(mcu_interrupt, 3) |
| 869 | 1013 | |
| 870 | 1014 | MDRV_NVRAM_HANDLER(namconb1) |
| 871 | 1015 | MDRV_MACHINE_START(namconb) |
| r3289 | r3290 | |
| 882 | 1026 | MDRV_VIDEO_START(namconb1) |
| 883 | 1027 | MDRV_VIDEO_UPDATE(namconb1) |
| 884 | 1028 | |
| 885 | | NAMCO_C7X_SOUND(MASTER_CLOCK_HZ/3) |
| 1029 | MDRV_SPEAKER_STANDARD_STEREO("left", "right") |
| 1030 | MDRV_SOUND_ADD("c352", C352, MASTER_CLOCK_HZ/3) |
| 1031 | MDRV_SOUND_ROUTE(0, "right", 1.00) |
| 1032 | MDRV_SOUND_ROUTE(1, "left", 1.00) |
| 1033 | MDRV_SOUND_ROUTE(2, "right", 1.00) |
| 1034 | MDRV_SOUND_ROUTE(3, "left", 1.00) |
| 886 | 1035 | MACHINE_DRIVER_END |
| 887 | 1036 | |
| 888 | 1037 | static MACHINE_DRIVER_START( namconb2 ) |
| r3289 | r3290 | |
| 890 | 1039 | MDRV_CPU_PROGRAM_MAP(namconb2_am,0) |
| 891 | 1040 | MDRV_CPU_VBLANK_INT("main", namconb2_interrupt) |
| 892 | 1041 | |
| 893 | | NAMCO_C7X_MCU(MASTER_CLOCK_HZ/3) |
| 1042 | MDRV_CPU_ADD("mcu", M37702, MASTER_CLOCK_HZ/3) |
| 1043 | MDRV_CPU_PROGRAM_MAP(namcoc75_am, 0) |
| 1044 | MDRV_CPU_IO_MAP(namcoc75_io, 0) |
| 1045 | MDRV_CPU_VBLANK_INT_HACK(mcu_interrupt, 3) |
| 894 | 1046 | |
| 895 | 1047 | MDRV_NVRAM_HANDLER(namconb1) |
| 896 | 1048 | MDRV_MACHINE_START(namconb) |
| r3289 | r3290 | |
| 907 | 1059 | MDRV_VIDEO_START(namconb2) |
| 908 | 1060 | MDRV_VIDEO_UPDATE(namconb2) |
| 909 | 1061 | |
| 910 | | NAMCO_C7X_SOUND(MASTER_CLOCK_HZ/3) |
| 1062 | MDRV_SPEAKER_STANDARD_STEREO("left", "right") |
| 1063 | MDRV_SOUND_ADD("c352", C352, MASTER_CLOCK_HZ/3) |
| 1064 | MDRV_SOUND_ROUTE(0, "right", 1.00) |
| 1065 | MDRV_SOUND_ROUTE(1, "left", 1.00) |
| 1066 | MDRV_SOUND_ROUTE(2, "right", 1.00) |
| 1067 | MDRV_SOUND_ROUTE(3, "left", 1.00) |
| 911 | 1068 | MACHINE_DRIVER_END |
| 912 | 1069 | |
| 913 | 1070 | /***************************************************************/ |
| r3289 | r3290 | |
| 917 | 1074 | ROM_LOAD32_WORD( "gn2mprlb.15b", 0x00002, 0x80000, CRC(fe2d9425) SHA1(51b166a629cbb522720d63720558816b496b6b76) ) |
| 918 | 1075 | ROM_LOAD32_WORD( "gn2mprub.13b", 0x00000, 0x80000, CRC(3bf4985a) SHA1(f559e0d5f55d23d886fe61bd7d5ca556acc7f87c) ) |
| 919 | 1076 | |
| 920 | | ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */ |
| 1077 | ROM_REGION( 0x4000, "c75", 0 ) /* C75 program */ |
| 1078 | ROM_LOAD( "c75.bin", 0, 0x4000, CRC(42f539a5) SHA1(3103e5a0a2867620309fd4fe478a2be0effbeff8) ) |
| 1079 | |
| 1080 | ROM_REGION16_LE( 0x80000, "c75data", 0 ) /* sound data */ |
| 921 | 1081 | ROM_LOAD( "gn1-spr0.bin", 0, 0x20000, CRC(6836ba38) SHA1(6ea17ea4bbb59be108e8887acd7871409580732f) ) |
| 922 | | NAMCO_C7X_BIOS |
| 923 | 1082 | |
| 924 | 1083 | ROM_REGION( 0x200000, "c352", 0 ) |
| 925 | 1084 | ROM_LOAD( "gn1-voi0.bin", 0, 0x200000, CRC(05477eb7) SHA1(f2eaacb5dbac06c37c56b9b131230c9cf6602221) ) |
| r3289 | r3290 | |
| 945 | 1104 | ROM_LOAD32_WORD( "gn1-mprl.bin", 0x00002, 0x80000, CRC(f99e309e) SHA1(3fe0ddf756e6849f8effc7672456cbe32f65c98a) ) |
| 946 | 1105 | ROM_LOAD32_WORD( "gn1-mpru.bin", 0x00000, 0x80000, CRC(72a4db07) SHA1(8c5e1e51cd961b311d03f7b21f36a5bd5e8e9104) ) |
| 947 | 1106 | |
| 948 | | ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */ |
| 1107 | ROM_REGION( 0x4000, "c75", 0 ) /* C75 program */ |
| 1108 | ROM_LOAD( "c75.bin", 0, 0x4000, CRC(42f539a5) SHA1(3103e5a0a2867620309fd4fe478a2be0effbeff8) ) |
| 1109 | |
| 1110 | ROM_REGION16_LE( 0x80000, "c75data", 0 ) /* sound data */ |
| 949 | 1111 | ROM_LOAD( "gn1-spr0.bin", 0, 0x20000, CRC(6836ba38) SHA1(6ea17ea4bbb59be108e8887acd7871409580732f) ) |
| 950 | | NAMCO_C7X_BIOS |
| 951 | 1112 | |
| 952 | 1113 | ROM_REGION( 0x200000, "c352", 0 ) |
| 953 | 1114 | ROM_LOAD( "gn1-voi0.bin", 0, 0x200000, CRC(05477eb7) SHA1(f2eaacb5dbac06c37c56b9b131230c9cf6602221) ) |
| r3289 | r3290 | |
| 973 | 1134 | ROM_LOAD32_WORD( "nr2-mpru.13b", 0x00000, 0x80000, CRC(049b97cb) SHA1(0e344b29a4d4bdc854fa9849589772df2eeb0a05) ) |
| 974 | 1135 | ROM_LOAD32_WORD( "nr2-mprl.15b", 0x00002, 0x80000, CRC(0431b6d4) SHA1(54c96e8ac9e753956c31bdef79d390f1c20e10ff) ) |
| 975 | 1136 | |
| 976 | | ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */ |
| 1137 | ROM_REGION( 0x4000, "c75", 0 ) /* C75 program */ |
| 1138 | ROM_LOAD( "c75.bin", 0, 0x4000, CRC(42f539a5) SHA1(3103e5a0a2867620309fd4fe478a2be0effbeff8) ) |
| 1139 | |
| 1140 | ROM_REGION16_LE( 0x80000, "c75data", 0 ) /* sound data */ |
| 977 | 1141 | ROM_LOAD( "nr1-spr0", 0, 0x20000, CRC(1cc2b44b) SHA1(161f4ed39fabe89d7ee1d539f8b9f08cd0ff3111) ) |
| 978 | | NAMCO_C7X_BIOS |
| 979 | 1142 | |
| 980 | 1143 | ROM_REGION( 0x200000, "c352", 0 ) |
| 981 | 1144 | ROM_LOAD( "nr1-voi0", 0, 0x200000, CRC(332d5e26) SHA1(9daddac3fbe0709e25ed8e0b456bac15bfae20d7) ) |
| r3289 | r3290 | |
| 1008 | 1171 | ROM_LOAD32_WORD( "nr1-mpru", 0x00000, 0x80000, CRC(42ef71f9) SHA1(20e3cb63e1fde293c60c404b378d901d635c4b79) ) |
| 1009 | 1172 | ROM_LOAD32_WORD( "nr1-mprl", 0x00002, 0x80000, CRC(fae5f62c) SHA1(143d716abbc834aac6270db3bbb89ec71ea3804d) ) |
| 1010 | 1173 | |
| 1011 | | ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */ |
| 1174 | ROM_REGION( 0x4000, "c75", 0 ) /* C75 program */ |
| 1175 | ROM_LOAD( "c75.bin", 0, 0x4000, CRC(42f539a5) SHA1(3103e5a0a2867620309fd4fe478a2be0effbeff8) ) |
| 1176 | |
| 1177 | ROM_REGION16_LE( 0x80000, "c75data", 0 ) /* sound data */ |
| 1012 | 1178 | ROM_LOAD( "nr1-spr0", 0, 0x20000, CRC(1cc2b44b) SHA1(161f4ed39fabe89d7ee1d539f8b9f08cd0ff3111) ) |
| 1013 | | NAMCO_C7X_BIOS |
| 1014 | 1179 | |
| 1015 | 1180 | ROM_REGION( 0x200000, "c352", 0 ) |
| 1016 | 1181 | ROM_LOAD( "nr1-voi0", 0, 0x200000, CRC(332d5e26) SHA1(9daddac3fbe0709e25ed8e0b456bac15bfae20d7) ) |
| r3289 | r3290 | |
| 1043 | 1208 | ROM_LOAD32_WORD( "gse2mprl.bin", 0x00002, 0x80000, CRC(a514349c) SHA1(1f7ec81cd6193410d2f01e6f0f84878561fc8035) ) |
| 1044 | 1209 | ROM_LOAD32_WORD( "gse2mpru.bin", 0x00000, 0x80000, CRC(b6afd238) SHA1(438a3411ac8ce3d22d5da8c0800738cb8d2994a9) ) |
| 1045 | 1210 | |
| 1046 | | ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */ |
| 1211 | ROM_REGION( 0x4000, "c75", 0 ) /* C75 program */ |
| 1212 | ROM_LOAD( "c75.bin", 0, 0x4000, CRC(42f539a5) SHA1(3103e5a0a2867620309fd4fe478a2be0effbeff8) ) |
| 1213 | |
| 1214 | ROM_REGION16_LE( 0x80000, "c75data", 0 ) /* sound data */ |
| 1047 | 1215 | ROM_LOAD( "gse2spr0.bin", 0, 0x20000, CRC(17e87cfc) SHA1(9cbeadb6dfcb736e8c80eab344f70fc2f58469d6) ) |
| 1048 | | NAMCO_C7X_BIOS |
| 1049 | 1216 | |
| 1050 | 1217 | ROM_REGION( 0x200000, "c352", 0 ) |
| 1051 | 1218 | ROM_LOAD( "gse-voi0.bin", 0, 0x200000, CRC(d3480574) SHA1(0c468ed060769b36b7e41cf4919cb6d8691d64f6) ) |
| r3289 | r3290 | |
| 1195 | 1362 | ROM_LOAD32_WORD( "gs1mprl.15b", 0x00002, 0x80000, CRC(1e6c3626) SHA1(56abe21884fd87df10996db19c49ce14214d4b73) ) |
| 1196 | 1363 | ROM_LOAD32_WORD( "gs1mpru.13b", 0x00000, 0x80000, CRC(ef355179) SHA1(0ab0ef4301a318681bb5827d35734a0732b35484) ) |
| 1197 | 1364 | |
| 1198 | | ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */ |
| 1365 | ROM_REGION( 0x4000, "c75", 0 ) /* C75 program */ |
| 1366 | ROM_LOAD( "c75.bin", 0, 0x4000, CRC(42f539a5) SHA1(3103e5a0a2867620309fd4fe478a2be0effbeff8) ) |
| 1367 | |
| 1368 | ROM_REGION16_LE( 0x80000, "c75data", 0 ) /* sound data */ |
| 1199 | 1369 | ROM_LOAD( "gs1spr0.5b", 0, 0x80000, CRC(561ea20f) SHA1(adac6b77effc3a82079a9b228bafca0fcef72ba5) ) |
| 1200 | | NAMCO_C7X_BIOS |
| 1201 | 1370 | |
| 1202 | 1371 | ROM_REGION( 0x200000, "c352", 0 ) |
| 1203 | 1372 | ROM_LOAD( "gs1voi-0.5j", 0, 0x200000, CRC(6f8262aa) SHA1(beea98d9f8b927a572eb0bfcf678e9d6e40fc68d) ) |
| r3289 | r3290 | |
| 1221 | 1390 | ROM_LOAD32_WORD( "ss51mprl.bin", 0x00002, 0x80000, CRC(c9e0107d) SHA1(0f10582416023a86ea1ef2679f3f06016c086e08) ) |
| 1222 | 1391 | ROM_LOAD32_WORD( "ss51mpru.bin", 0x00000, 0x80000, CRC(0d93d261) SHA1(5edef26e2c86dbc09727d910af92747d022e4fed) ) |
| 1223 | 1392 | |
| 1224 | | ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */ |
| 1393 | ROM_REGION( 0x4000, "c75", 0 ) /* C75 program */ |
| 1394 | ROM_LOAD( "c75.bin", 0, 0x4000, CRC(42f539a5) SHA1(3103e5a0a2867620309fd4fe478a2be0effbeff8) ) |
| 1395 | |
| 1396 | ROM_REGION16_LE( 0x80000, "c75data", 0 ) /* sound data */ |
| 1225 | 1397 | ROM_LOAD( "ss51spr0.bin", 0, 0x80000, CRC(71cb12f5) SHA1(6e13bd16a5ba14d6e47a21875db3663ada3c06a5) ) |
| 1226 | | NAMCO_C7X_BIOS |
| 1227 | 1398 | |
| 1228 | 1399 | ROM_REGION( 0x200000, "c352", 0 ) |
| 1229 | 1400 | ROM_LOAD( "ss51voi0.bin", 0, 0x200000, CRC(2740ec72) SHA1(9694a7378ea72771d2b1d43db6d74ed347ba27d3) ) |
| r3289 | r3290 | |
| 1248 | 1419 | ROM_LOAD32_WORD( "ss61mprl.bin", 0x00002, 0x80000, CRC(06f55e73) SHA1(6be26f8a2ef600bf07c580f210d7b265ac464002) ) |
| 1249 | 1420 | ROM_LOAD32_WORD( "ss61mpru.bin", 0x00000, 0x80000, CRC(0abdbb83) SHA1(67e8b712291f9bcf2c3a52fbc451fad54679cab8) ) |
| 1250 | 1421 | |
| 1251 | | ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */ |
| 1422 | ROM_REGION( 0x4000, "c75", 0 ) /* C75 program */ |
| 1423 | ROM_LOAD( "c75.bin", 0, 0x4000, CRC(42f539a5) SHA1(3103e5a0a2867620309fd4fe478a2be0effbeff8) ) |
| 1424 | |
| 1425 | ROM_REGION16_LE( 0x80000, "c75data", 0 ) /* sound data */ |
| 1252 | 1426 | ROM_LOAD( "ss61spr0.bin", 0, 0x80000, CRC(71cb12f5) SHA1(6e13bd16a5ba14d6e47a21875db3663ada3c06a5) ) |
| 1253 | | NAMCO_C7X_BIOS |
| 1254 | 1427 | |
| 1255 | 1428 | ROM_REGION( 0x200000, "c352", 0 ) |
| 1256 | 1429 | ROM_LOAD( "ss61voi0.bin", 0, 0x200000, CRC(2740ec72) SHA1(9694a7378ea72771d2b1d43db6d74ed347ba27d3) ) |
| r3289 | r3290 | |
| 1274 | 1447 | ROM_LOAD32_WORD( "ss71mprl.bin", 0x00002, 0x80000, CRC(bd60b50e) SHA1(9e00bacd506182ab2af2c0efdd5cc401b3e46485) ) |
| 1275 | 1448 | ROM_LOAD32_WORD( "ss71mpru.bin", 0x00000, 0x80000, CRC(3444f5a8) SHA1(8d0f35b3ba8f65dbc67c3b2d273833227a8b8b2a) ) |
| 1276 | 1449 | |
| 1277 | | ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */ |
| 1450 | ROM_REGION( 0x4000, "c75", 0 ) /* C75 program */ |
| 1451 | ROM_LOAD( "c75.bin", 0, 0x4000, CRC(42f539a5) SHA1(3103e5a0a2867620309fd4fe478a2be0effbeff8) ) |
| 1452 | |
| 1453 | ROM_REGION16_LE( 0x80000, "c75data", 0 ) /* sound data */ |
| 1278 | 1454 | ROM_LOAD( "ss71spr0.bin", 0, 0x80000, CRC(71cb12f5) SHA1(6e13bd16a5ba14d6e47a21875db3663ada3c06a5) ) |
| 1279 | | NAMCO_C7X_BIOS |
| 1280 | 1455 | |
| 1281 | 1456 | ROM_REGION( 0x200000, "c352", 0 ) |
| 1282 | 1457 | ROM_LOAD( "ss71voi0.bin", 0, 0x200000, CRC(2740ec72) SHA1(9694a7378ea72771d2b1d43db6d74ed347ba27d3) ) |
| r3289 | r3290 | |
| 1300 | 1475 | ROM_LOAD32_WORD( "vsj1mprl.15b", 0x00002, 0x80000, CRC(83a60d92) SHA1(c3db0c79f772a79418914353a3d6ecc4883ea54e) ) |
| 1301 | 1476 | ROM_LOAD32_WORD( "vsj1mpru.13b", 0x00000, 0x80000, CRC(c63eb92d) SHA1(f93bd4b91daee645677955020dc8df14dc9bfd27) ) |
| 1302 | 1477 | |
| 1303 | | ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */ |
| 1478 | ROM_REGION( 0x4000, "c75", 0 ) /* C75 program */ |
| 1479 | ROM_LOAD( "c75.bin", 0, 0x4000, CRC(42f539a5) SHA1(3103e5a0a2867620309fd4fe478a2be0effbeff8) ) |
| 1480 | |
| 1481 | ROM_REGION16_LE( 0x80000, "c75data", 0 ) /* sound data */ |
| 1304 | 1482 | ROM_LOAD( "vsj1spr0.5b", 0, 0x80000, CRC(b0c71aa6) SHA1(a94fae02b46a645ff728d2f98827c85ff155892b) ) |
| 1305 | | NAMCO_C7X_BIOS |
| 1306 | 1483 | |
| 1307 | 1484 | ROM_REGION( 0x200000, "c352", 0 ) |
| 1308 | 1485 | ROM_LOAD( "vsjvoi-0.5j", 0, 0x200000, CRC(0528c9ed) SHA1(52b67978fdeb97b77065575774a7ddeb49fe1d81) ) |
| r3289 | r3290 | |
| 1486 | 1663 | ROM_LOAD32_WORD( "ou2mprl.11c", 0x00002, 0x80000, CRC(f414a32e) SHA1(9733ab087cfde1b8fb5b676d8a2eb5325ebdbb56) ) |
| 1487 | 1664 | ROM_LOAD32_WORD( "ou2mpru.11d", 0x00000, 0x80000, CRC(ab5083fb) SHA1(cb2e7a4838c2b80057edb83ea63116bccb1394d3) ) |
| 1488 | 1665 | |
| 1489 | | ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */ |
| 1666 | ROM_REGION( 0x4000, "c75", 0 ) /* C75 program */ |
| 1667 | ROM_LOAD( "c75.bin", 0, 0x4000, CRC(42f539a5) SHA1(3103e5a0a2867620309fd4fe478a2be0effbeff8) ) |
| 1668 | |
| 1669 | ROM_REGION16_LE( 0x80000, "c75data", 0 ) /* sound data */ |
| 1490 | 1670 | ROM_LOAD( "ou1spr0.5b", 0, 0x80000, CRC(60cee566) SHA1(2f3b96793816d90011586e0f9f71c58b636b6d4c) ) |
| 1491 | | NAMCO_C7X_BIOS |
| 1492 | 1671 | |
| 1493 | 1672 | ROM_REGION( 0x200000, "c352", 0 ) |
| 1494 | 1673 | ROM_LOAD( "ou1voi0.6n", 0, 0x200000, CRC(2d8fb271) SHA1(bde9d45979728f5a2cd8ec89f5f81bf16b694cc2) ) |
| r3289 | r3290 | |
| 1529 | 1708 | ROM_LOAD32_WORD( "ou1-mprl.11c", 0x00002, 0x80000, CRC(d3b9e530) SHA1(3f5fe5eea817a23dfe42e76f32912ce94d4c49c9) ) |
| 1530 | 1709 | ROM_LOAD32_WORD( "ou1-mpru.11d", 0x00000, 0x80000, CRC(d98308fb) SHA1(fdefeebf56464a20e3aaefd88df4eee9f7b5c4f3) ) |
| 1531 | 1710 | |
| 1532 | | ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */ |
| 1711 | ROM_REGION( 0x4000, "c75", 0 ) /* C75 program */ |
| 1712 | ROM_LOAD( "c75.bin", 0, 0x4000, CRC(42f539a5) SHA1(3103e5a0a2867620309fd4fe478a2be0effbeff8) ) |
| 1713 | |
| 1714 | ROM_REGION16_LE( 0x80000, "c75data", 0 ) /* sound data */ |
| 1533 | 1715 | ROM_LOAD( "ou1spr0.5b", 0, 0x80000, CRC(60cee566) SHA1(2f3b96793816d90011586e0f9f71c58b636b6d4c) ) |
| 1534 | | NAMCO_C7X_BIOS |
| 1535 | 1716 | |
| 1536 | 1717 | ROM_REGION( 0x200000, "c352", 0 ) |
| 1537 | 1718 | ROM_LOAD( "ou1voi0.6n", 0, 0x200000, CRC(2d8fb271) SHA1(bde9d45979728f5a2cd8ec89f5f81bf16b694cc2) ) |
| r3289 | r3290 | |
| 1573 | 1754 | ROM_LOAD32_WORD( "mb1_mprl.11c", 0x00002, 0x80000, CRC(86cf0644) SHA1(07eeadda1d94c9be2f882edb6f2eb0b98292e500) ) |
| 1574 | 1755 | ROM_LOAD32_WORD( "mb1_mpru.11d", 0x00000, 0x80000, CRC(fb1ff916) SHA1(e0ba96c1f26a60f87d8050e582e164d91e132183) ) |
| 1575 | 1756 | |
| 1576 | | ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */ |
| 1757 | ROM_REGION( 0x4000, "c75", 0 ) /* C75 program */ |
| 1758 | ROM_LOAD( "c75.bin", 0, 0x4000, CRC(42f539a5) SHA1(3103e5a0a2867620309fd4fe478a2be0effbeff8) ) |
| 1759 | |
| 1760 | ROM_REGION16_LE( 0x80000, "c75data", 0 ) /* sound data */ |
| 1577 | 1761 | ROM_LOAD( "mb1_spr0.5b", 0, 0x80000, CRC(d10f6272) SHA1(cb99e06e050dbf86998ea51ef2ca130b2acfb2f6) ) |
| 1578 | | NAMCO_C7X_BIOS |
| 1579 | 1762 | |
| 1580 | 1763 | ROM_REGION( 0x1000000, "c352", 0 ) |
| 1581 | 1764 | ROM_LOAD( "mb1_voi0.6n", 0x000000, 0x200000, CRC(d363ca3b) SHA1(71650b66ca3eb00f6ad7d3f1df0f37210b77b942) ) |
| r3289 | r3290 | |
| 1617 | 1800 | /***************************************************************/ |
| 1618 | 1801 | |
| 1619 | 1802 | static INPUT_PORTS_START( gunbulet ) |
| 1620 | | PORT_START("COIN") |
| 1621 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) |
| 1622 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) |
| 1623 | | |
| 1624 | | PORT_START("DSW") |
| 1625 | | PORT_DIPNAME( 0x01, 0x00, "DSW2 (Unused)" ) |
| 1803 | PORT_START("MISC") |
| 1804 | PORT_DIPNAME( 0x01, 0x00, "DSW2 (unused)" ) |
| 1626 | 1805 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1627 | 1806 | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) |
| 1628 | | PORT_DIPNAME( 0x02, 0x00, "DSW1 (Test)" ) |
| 1807 | PORT_DIPNAME( 0x02, 0x00, "DSW1 (unused)" ) |
| 1629 | 1808 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1630 | 1809 | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) |
| 1631 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SERVICE1 ) |
| 1632 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) /* C75 status */ |
| 1810 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1811 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1812 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 1813 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 1814 | PORT_DIPNAME( 0x40, 0x00, "Test switch" ) |
| 1815 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1816 | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 1817 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 1633 | 1818 | |
| 1634 | 1819 | PORT_START("P1") |
| 1635 | | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) |
| 1636 | | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START1 ) |
| 1820 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 1821 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) |
| 1637 | 1822 | |
| 1638 | 1823 | PORT_START("P2") |
| 1639 | | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 1640 | | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START2 ) |
| 1824 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 1825 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 ) |
| 1641 | 1826 | |
| 1642 | 1827 | PORT_START("LIGHT0_X") |
| 1643 | 1828 | PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(4) |
| r3289 | r3290 | |
| 1649 | 1834 | PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(4) PORT_PLAYER(2) |
| 1650 | 1835 | INPUT_PORTS_END |
| 1651 | 1836 | |
| 1652 | | #ifdef UNUSED_DEFINITION |
| 1653 | | static INPUT_PORTS_START( machbrkr ) |
| 1654 | | PORT_START("COIN") |
| 1655 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) |
| 1656 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) |
| 1837 | static INPUT_PORTS_START( outfxies ) |
| 1838 | PORT_START("P1") |
| 1839 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY |
| 1840 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY |
| 1841 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY |
| 1842 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY |
| 1843 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 1844 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) |
| 1845 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) |
| 1846 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) |
| 1657 | 1847 | |
| 1658 | | PORT_START("DSW") |
| 1659 | | PORT_DIPNAME( 0x01, 0x00, "Freeze Screen" ) |
| 1848 | PORT_START("P2") |
| 1849 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) |
| 1850 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) |
| 1851 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) |
| 1852 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) |
| 1853 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 1854 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) |
| 1855 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) |
| 1856 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 ) |
| 1857 | |
| 1858 | PORT_START("MISC") |
| 1859 | PORT_DIPNAME( 0x01, 0x01, "Freeze Screen" ) |
| 1660 | 1860 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1661 | 1861 | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) |
| 1662 | | PORT_DIPNAME( 0x02, 0x00, "DSW1 (Test)" ) |
| 1862 | PORT_DIPNAME( 0x02, 0x02, "DSW1 (Test)" ) |
| 1663 | 1863 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1664 | 1864 | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) |
| 1665 | | PORT_DIPNAME( 0x04, 0x00, "Alternate Test Switch" ) |
| 1666 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1667 | | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) |
| 1668 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SERVICE1 ) |
| 1669 | | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) |
| 1670 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1671 | | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| 1672 | | PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) |
| 1673 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1674 | | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 1675 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) |
| 1676 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1677 | | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 1678 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) /* C75 status */ |
| 1865 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 1866 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 1867 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1868 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1869 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1870 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 1871 | INPUT_PORTS_END |
| 1679 | 1872 | |
| 1873 | static INPUT_PORTS_START( nbsports ) |
| 1680 | 1874 | PORT_START("P1") |
| 1681 | | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) // self test: up |
| 1682 | | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) // self test: enter |
| 1683 | | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON3 ) // self test: down |
| 1684 | | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START1 ) |
| 1875 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY |
| 1876 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY |
| 1877 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY |
| 1878 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY |
| 1879 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 1880 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) |
| 1881 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) |
| 1882 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) |
| 1685 | 1883 | |
| 1686 | 1884 | PORT_START("P2") |
| 1687 | | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 1688 | | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) |
| 1689 | | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(2) |
| 1690 | | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START2 ) |
| 1885 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) |
| 1886 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) |
| 1887 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) |
| 1888 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) |
| 1889 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 1890 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) |
| 1891 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) |
| 1892 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 ) |
| 1691 | 1893 | |
| 1692 | | PORT_START("P3") |
| 1693 | | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(3) |
| 1694 | | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(3) |
| 1695 | | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(3) |
| 1696 | | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START3 ) |
| 1697 | | |
| 1698 | | PORT_START("P4") |
| 1699 | | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(4) |
| 1700 | | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(4) |
| 1701 | | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(4) |
| 1702 | | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START4 ) |
| 1703 | | INPUT_PORTS_END |
| 1704 | | #endif |
| 1705 | | |
| 1706 | | static INPUT_PORTS_START( outfxies ) |
| 1707 | | PORT_START("COIN") |
| 1708 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) |
| 1709 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) |
| 1710 | | |
| 1711 | | PORT_START("DSW") |
| 1712 | | PORT_DIPNAME( 0x01, 0x00, "Freeze Screen" ) |
| 1894 | PORT_START("MISC") |
| 1895 | PORT_DIPNAME( 0x01, 0x01, "Freeze Screen" ) |
| 1713 | 1896 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1714 | 1897 | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) |
| 1715 | | PORT_DIPNAME( 0x02, 0x00, "DSW1 (Test)" ) |
| 1898 | PORT_DIPNAME( 0x02, 0x02, "DSW1 (Test)" ) |
| 1716 | 1899 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1717 | 1900 | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) |
| 1718 | | PORT_DIPNAME( 0x04, 0x00, "Alternate Test Switch" ) |
| 1719 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1720 | | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) |
| 1721 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SERVICE1 ) |
| 1722 | | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) |
| 1723 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1724 | | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| 1725 | | PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) |
| 1726 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1727 | | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 1728 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) |
| 1729 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1730 | | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 1731 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) /* C75 status */ |
| 1901 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1902 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1903 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 1904 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 1905 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1906 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 1907 | INPUT_PORTS_END |
| 1732 | 1908 | |
| 1909 | static INPUT_PORTS_START( namconb1 ) |
| 1733 | 1910 | PORT_START("P1") |
| 1734 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY |
| 1735 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY |
| 1736 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY |
| 1737 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY |
| 1738 | | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) |
| 1739 | | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) |
| 1740 | | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON3 ) |
| 1741 | | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START1 ) |
| 1911 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY |
| 1912 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY |
| 1913 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY |
| 1914 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY |
| 1915 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 1916 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) |
| 1917 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) |
| 1918 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) |
| 1742 | 1919 | |
| 1743 | 1920 | PORT_START("P2") |
| 1744 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) |
| 1745 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) |
| 1746 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) |
| 1747 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) |
| 1748 | | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 1749 | | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) |
| 1750 | | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(2) |
| 1751 | | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START2 ) |
| 1752 | | INPUT_PORTS_END |
| 1921 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) |
| 1922 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) |
| 1923 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) |
| 1924 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) |
| 1925 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 1926 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) |
| 1927 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) |
| 1928 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 ) |
| 1753 | 1929 | |
| 1754 | | static INPUT_PORTS_START( namconb1 ) |
| 1755 | | PORT_START("COIN") |
| 1756 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) |
| 1757 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) |
| 1930 | PORT_START("P3") |
| 1931 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3) |
| 1932 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3) |
| 1933 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3) |
| 1934 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3) |
| 1935 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3) |
| 1936 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3) |
| 1937 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3) |
| 1938 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START3 ) |
| 1758 | 1939 | |
| 1759 | | PORT_START("DSW") |
| 1760 | | PORT_DIPNAME( 0x01, 0x00, "DSW2 (Unused)" ) |
| 1940 | PORT_START("P4") |
| 1941 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(4) |
| 1942 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(4) |
| 1943 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(4) |
| 1944 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(4) |
| 1945 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4) |
| 1946 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4) |
| 1947 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4) |
| 1948 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START4 ) |
| 1949 | |
| 1950 | PORT_START("MISC") |
| 1951 | PORT_DIPNAME( 0x01, 0x00, "DSW2 (unused)" ) |
| 1761 | 1952 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1762 | 1953 | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) |
| 1763 | | PORT_DIPNAME( 0x02, 0x00, "DSW1 (Test)" ) |
| 1954 | PORT_DIPNAME( 0x02, 0x00, "DSW1 (unused)" ) |
| 1764 | 1955 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1765 | 1956 | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) |
| 1766 | | PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) |
| 1957 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 1958 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 1959 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN3 ) |
| 1960 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN4 ) |
| 1961 | PORT_DIPNAME( 0x40, 0x00, "Test switch" ) |
| 1767 | 1962 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1768 | | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) |
| 1769 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SERVICE1 ) |
| 1770 | | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) |
| 1771 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1772 | | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| 1773 | | PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) |
| 1774 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1775 | | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 1776 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) |
| 1777 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1778 | 1963 | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 1779 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) /* C75 status */ |
| 1780 | | |
| 1781 | | PORT_START("P1") |
| 1782 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY |
| 1783 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY |
| 1784 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY |
| 1785 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY |
| 1786 | | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) |
| 1787 | | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) |
| 1788 | | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON3 ) |
| 1789 | | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START1 ) |
| 1790 | | |
| 1791 | | PORT_START("P2") |
| 1792 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) |
| 1793 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) |
| 1794 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) |
| 1795 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) |
| 1796 | | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 1797 | | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) |
| 1798 | | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(2) |
| 1799 | | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START2 ) |
| 1964 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 1800 | 1965 | INPUT_PORTS_END |
| 1801 | 1966 | |
| 1802 | | |
| 1803 | 1967 | GAME( 1994, nebulray, 0, namconb1, namconb1, nebulray, ROT90, "Namco", "Nebulas Ray (World)", GAME_IMPERFECT_SOUND ) |
| 1804 | 1968 | GAME( 1994, nebulryj, nebulray, namconb1, namconb1, nebulray, ROT90, "Namco", "Nebulas Ray (Japan)", GAME_IMPERFECT_SOUND ) |
| 1805 | 1969 | GAME( 1994, ptblank, 0, namconb1, gunbulet, gunbulet, ROT0, "Namco", "Point Blank", GAME_IMPERFECT_SOUND ) |
| 1806 | 1970 | GAME( 1994, gunbulet, ptblank, namconb1, gunbulet, gunbulet, ROT0, "Namco", "Gun Bullet (Japan)", GAME_IMPERFECT_SOUND ) |
| 1807 | | GAME( 1993, gslugrsj, 0, namconb1, namconb1, gslgr94u, ROT0, "Namco", "Great Sluggers (Japan)", GAME_IMPERFECT_SOUND ) |
| 1808 | | GAME( 1994, gslgr94u, 0, namconb1, namconb1, gslgr94u, ROT0, "Namco", "Great Sluggers '94", GAME_IMPERFECT_SOUND ) |
| 1809 | | GAME( 1995, sws95, 0, namconb1, namconb1, sws95, ROT0, "Namco", "Super World Stadium '95 (Japan)", GAME_IMPERFECT_SOUND ) |
| 1810 | | GAME( 1996, sws96, 0, namconb1, namconb1, sws96, ROT0, "Namco", "Super World Stadium '96 (Japan)", GAME_IMPERFECT_SOUND ) |
| 1811 | | GAME( 1997, sws97, 0, namconb1, namconb1, sws97, ROT0, "Namco", "Super World Stadium '97 (Japan)", GAME_IMPERFECT_SOUND ) |
| 1971 | GAME( 1993, gslugrsj, 0, namconb1, nbsports, gslgr94u, ROT0, "Namco", "Great Sluggers (Japan)", GAME_IMPERFECT_SOUND ) |
| 1972 | GAME( 1994, gslgr94u, 0, namconb1, nbsports, gslgr94u, ROT0, "Namco", "Great Sluggers '94", GAME_IMPERFECT_SOUND ) |
| 1973 | GAME( 1995, sws95, 0, namconb1, nbsports, sws95, ROT0, "Namco", "Super World Stadium '95 (Japan)", GAME_IMPERFECT_SOUND ) |
| 1974 | GAME( 1996, sws96, 0, namconb1, nbsports, sws96, ROT0, "Namco", "Super World Stadium '96 (Japan)", GAME_IMPERFECT_SOUND ) |
| 1975 | GAME( 1997, sws97, 0, namconb1, nbsports, sws97, ROT0, "Namco", "Super World Stadium '97 (Japan)", GAME_IMPERFECT_SOUND ) |
| 1812 | 1976 | GAME( 1994, vshoot, 0, namconb1, namconb1, vshoot, ROT0, "Namco", "J-League Soccer V-Shoot", GAME_IMPERFECT_SOUND ) |
| 1813 | 1977 | |
| 1814 | 1978 | /* YEAR, NAME, PARENT, MACHINE, INPUT, INIT, MNTR, COMPANY, FULLNAME, FLAGS */ |
| 1815 | 1979 | GAME( 1994, outfxies, 0, namconb2, outfxies, outfxies, ROT0, "Namco", "Outfoxies", GAME_IMPERFECT_SOUND ) |
| 1816 | | GAME( 1994, outfxesj, outfxies, namconb2, outfxies, outfxies, ROT0, "Namco", "Outfoxies (Japan)", GAME_IMPERFECT_SOUND ) |
| 1980 | GAME( 1994, outfxesj, outfxies, namconb2, outfxies , outfxies, ROT0, "Namco", "Outfoxies (Japan)", GAME_IMPERFECT_SOUND ) |
| 1817 | 1981 | GAME( 1995, machbrkr, 0, namconb2, namconb1, machbrkr, ROT0, "Namco", "Mach Breakers - Numan Athletics 2 (Japan)", GAME_IMPERFECT_SOUND ) |
src/mame/drivers/psikyo.c
| r3289 | r3290 | |
| 901 | 901 | PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 902 | 902 | PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 903 | 903 | PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 904 | | PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 905 | | PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 906 | | PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 907 | | PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_VBLANK ) // vblank |
| 908 | | PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 909 | | PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 910 | | PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_UNKNOWN ) // tested! |
| 911 | | PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 912 | | PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 913 | | PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 914 | | PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 915 | | PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // tested! |
| 916 | 904 | INPUT_PORTS_END |
| 917 | 905 | |
| 918 | 906 | |
| r3289 | r3290 | |
| 1038 | 1026 | Bit 0 1 2 3 |
| 1039 | 1027 | 1 1 1 1 Japan, anything but 0x0f = "World" |
| 1040 | 1028 | ************************************************/ |
| 1041 | | PORT_DIPNAME( 0x0000000f, 0x0000000e, "Country" ) |
| 1029 | PORT_DIPNAME( 0x0000000f, 0x0000000f, "Country" ) |
| 1042 | 1030 | PORT_DIPSETTING( 0x0000000f, DEF_STR( Japan ) ) |
| 1043 | 1031 | PORT_DIPSETTING( 0x0000000e, DEF_STR( World ) ) |
| 1044 | | PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1045 | | PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1046 | | PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1047 | | PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_VBLANK ) // vblank |
| 1048 | | PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1049 | | PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1050 | | PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_UNKNOWN ) // tested! |
| 1051 | | PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1052 | | PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1053 | | PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1054 | | PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1055 | | PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // tested! |
| 1056 | 1032 | INPUT_PORTS_END |
| 1057 | 1033 | |
| 1058 | 1034 | static INPUT_PORTS_START( s1945j ) |
| r3289 | r3290 | |
| 1064 | 1040 | PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1065 | 1041 | PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1066 | 1042 | PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1067 | | PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1068 | | PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1069 | | PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_VBLANK ) // vblank |
| 1070 | | PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1071 | | PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1072 | | PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_UNKNOWN ) // tested! |
| 1073 | | PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1074 | | PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1075 | | PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1076 | | PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1077 | | PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // tested! |
| 1078 | 1043 | INPUT_PORTS_END |
| 1079 | 1044 | |
| 1080 | 1045 | |
| r3289 | r3290 | |
| 1108 | 1073 | |
| 1109 | 1074 | This Dip port is bit based: |
| 1110 | 1075 | |
| 1111 | | If any of the bits are set it becomes World. |
| 1112 | | Text for other regions is present though. |
| 1076 | Bit 0 1 2 3 |
| 1077 | 1 1 1 1 World |
| 1078 | 0 1 1 1 USA & Canada |
| 1079 | 1 0 1 1 Korea |
| 1080 | 1 1 0 1 Hong Kong |
| 1081 | 1 1 1 0 Taiwan |
| 1113 | 1082 | |
| 1114 | 1083 | ************************************************/ |
| 1115 | | PORT_DIPNAME( 0x0000000f, 0x0000000e, "Country" ) |
| 1116 | | PORT_DIPSETTING( 0x0000000f, DEF_STR( Japan ) ) |
| 1117 | | PORT_DIPSETTING( 0x0000000e, DEF_STR( World ) ) |
| 1084 | PORT_DIPNAME( 0x0000000f, 0x0000000f, "Country" ) |
| 1085 | PORT_DIPSETTING( 0x0000000f, DEF_STR( World ) ) |
| 1086 | PORT_DIPSETTING( 0x0000000e, "U.S.A & Canada" ) |
| 1087 | PORT_DIPSETTING( 0x0000000d, "Korea" ) |
| 1088 | PORT_DIPSETTING( 0x0000000b, "Hong Kong" ) |
| 1089 | PORT_DIPSETTING( 0x00000007, "Taiwan" ) |
| 1118 | 1090 | PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1119 | 1091 | PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1120 | 1092 | PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| r3289 | r3290 | |
| 1174 | 1146 | PORT_DIPSETTING( 0x00000000, "On [Free Play]" ) // Forces 1C_1C |
| 1175 | 1147 | INPUT_PORTS_END |
| 1176 | 1148 | |
| 1149 | static INPUT_PORTS_START( tengaij ) |
| 1150 | PORT_INCLUDE( tengai ) |
| 1177 | 1151 | |
| 1152 | PORT_MODIFY("DSW") |
| 1153 | /*********************************************** |
| 1154 | |
| 1155 | This Dip port is bit based: |
| 1156 | |
| 1157 | Bit 0 1 2 3 |
| 1158 | 1 1 1 1 Japan, anything but 0x0f = "World" |
| 1159 | |
| 1160 | Text for other regions is present though. |
| 1161 | |
| 1162 | ************************************************/ |
| 1163 | PORT_DIPNAME( 0x0000000f, 0x0000000f, "Country" ) |
| 1164 | PORT_DIPSETTING( 0x0000000f, DEF_STR( Japan ) ) |
| 1165 | PORT_DIPSETTING( 0x0000000e, DEF_STR( World ) ) |
| 1166 | INPUT_PORTS_END |
| 1167 | |
| 1168 | |
| 1178 | 1169 | /*************************************************************************** |
| 1179 | 1170 | |
| 1180 | 1171 | |
| r3289 | r3290 | |
| 1971 | 1962 | ROM_START( tengai ) |
| 1972 | 1963 | |
| 1973 | 1964 | ROM_REGION( 0x100000, "main", 0 ) /* Main CPU Code */ |
| 1965 | ROM_LOAD32_WORD_SWAP( "5-u40.bin", 0x000000, 0x080000, CRC(90088195) SHA1(8ec48d581ecd14b3dad36edc65d5a273324cf3c1) ) // 1&0 |
| 1966 | ROM_LOAD32_WORD_SWAP( "4-u41.bin", 0x000002, 0x080000, CRC(0d53196c) SHA1(454bb4695b13ce44ca5dac7c6d4142a8b9afa798) ) // 3&2 |
| 1967 | |
| 1968 | ROM_REGION( 0x030000, "audio", 0 ) /* Sound CPU Code */ |
| 1969 | ROM_LOAD( "1-u63.bin", 0x00000, 0x20000, CRC(2025e387) SHA1(334b0eb3b416d46ccaadff3eee6f1abba63285fb) ) |
| 1970 | ROM_RELOAD( 0x10000, 0x20000 ) |
| 1971 | |
| 1972 | ROM_REGION( 0x000100, "cpu2", 0 ) /* MCU */ |
| 1973 | ROM_LOAD( "4-u59.bin", 0x00000, 0x00100, NO_DUMP ) |
| 1974 | |
| 1975 | ROM_REGION( 0x600000, "gfx1", ROMREGION_DISPOSE ) /* Sprites */ |
| 1976 | ROM_LOAD16_WORD_SWAP( "u20.bin", 0x000000, 0x200000, CRC(ed42ef73) SHA1(74693fcc83a2654ddb18fd513d528033863d6116) ) |
| 1977 | ROM_LOAD16_WORD_SWAP( "u22.bin", 0x200000, 0x200000, CRC(8d21caee) SHA1(2a68af8b2be2158dcb152c434e91a75871478d41) ) |
| 1978 | ROM_LOAD16_WORD_SWAP( "u21.bin", 0x400000, 0x200000, CRC(efe34eed) SHA1(7891495b443a5acc7b2f17fe694584f6cb0afacc) ) |
| 1979 | |
| 1980 | ROM_REGION( 0x400000, "gfx2", ROMREGION_DISPOSE ) /* Layer 0 + 1 */ |
| 1981 | ROM_LOAD16_WORD_SWAP( "u34.bin", 0x000000, 0x400000, CRC(2a2e2eeb) SHA1(f1d99353c0affc5c908985e6f2a5724e5223cccc) ) /* four banks of 0x100000 */ |
| 1982 | |
| 1983 | ROM_REGION( 0x400000, "ymf", 0 ) /* Samples */ |
| 1984 | ROM_LOAD( "u61.bin", 0x000000, 0x200000, CRC(a63633c5) SHA1(89e75a40518926ebcc7d88dea86c01ba0bb496e5) ) // 8 bit signed pcm (16KHz) |
| 1985 | ROM_LOAD( "u62.bin", 0x200000, 0x200000, CRC(3ad0c357) SHA1(35f78cfa2eafa93ab96b24e336f569ee84af06b6) ) |
| 1986 | |
| 1987 | ROM_REGION( 0x040000, "user1", 0 ) /* Sprites LUT */ |
| 1988 | ROM_LOAD( "u1.bin", 0x000000, 0x040000, CRC(681d7d55) SHA1(b0b28471440d747adbc4d22d1918f89f6ede1615) ) |
| 1989 | |
| 1990 | ROM_END |
| 1991 | |
| 1992 | ROM_START( tengaij ) |
| 1993 | |
| 1994 | ROM_REGION( 0x100000, "main", 0 ) /* Main CPU Code */ |
| 1974 | 1995 | ROM_LOAD32_WORD_SWAP( "2-u40.bin", 0x000000, 0x080000, CRC(ab6fe58a) SHA1(6687a3af192b3eab60d75ca286ebb8e0636297b5) ) // 1&0 |
| 1975 | 1996 | ROM_LOAD32_WORD_SWAP( "3-u41.bin", 0x000002, 0x080000, CRC(02e42e39) SHA1(6cdb7b1cebab50c0a44cd60cd437f0e878ccac5c) ) // 3&2 |
| 1976 | 1997 | |
| r3289 | r3290 | |
| 2029 | 2050 | GAME( 1994, gunbirdk, gunbird, gunbird, gunbirdj, gunbird, ROT270, "Psikyo", "Gunbird (Korea)", 0 ) |
| 2030 | 2051 | GAME( 1994, gunbirdj, gunbird, gunbird, gunbirdj, gunbird, ROT270, "Psikyo", "Gunbird (Japan)", 0 ) |
| 2031 | 2052 | GAME( 1994, btlkroad, 0, gunbird, btlkroad, gunbird, ROT0, "Psikyo", "Battle K-Road", 0 ) |
| 2032 | | GAME( 1995, s1945, 0, s1945, s1945, s1945, ROT270, "Psikyo", "Strikers 1945", 0 ) |
| 2033 | | GAME( 1995, s1945a, s1945, s1945, s1945a, s1945a, ROT270, "Psikyo", "Strikers 1945 (Alt)", 0) // Region dip - 0x0f=Japan, anything else=World |
| 2053 | GAME( 1995, s1945, 0, s1945, s1945, s1945, ROT270, "Psikyo", "Strikers 1945 (World)", 0 ) |
| 2054 | GAME( 1995, s1945a, s1945, s1945, s1945a, s1945a, ROT270, "Psikyo", "Strikers 1945 (Japan / World)", 0) // Region dip - 0x0f=Japan, anything else=World |
| 2034 | 2055 | GAME( 1995, s1945j, s1945, s1945, s1945j, s1945j, ROT270, "Psikyo", "Strikers 1945 (Japan)", 0 ) |
| 2035 | 2056 | GAME( 1995, s1945jn, s1945, gunbird, s1945j, s1945jn, ROT270, "Psikyo", "Strikers 1945 (Japan, unprotected)", 0 ) |
| 2036 | 2057 | GAME( 1995, s1945k, s1945, s1945, s1945j, s1945, ROT270, "Psikyo", "Strikers 1945 (Korea)", 0 ) |
| 2037 | | GAME( 1996, tengai, 0, s1945, tengai, tengai, ROT0, "Psikyo", "Tengai / Sengoku Blade: Sengoku Ace Episode II", 0 ) |
| 2058 | GAME( 1996, tengai, 0, s1945, tengai, tengai, ROT0, "Psikyo", "Tengai (World)", 0 ) |
| 2059 | GAME( 1996, tengaij, tengai, s1945, tengaij, tengai, ROT0, "Psikyo", "Sengoku Blade: Sengoku Ace Episode II / Tengai", 0 ) // Region dip - 0x0f=Japan, anything else=World |
| 2038 | 2060 | |
src/mame/drivers/epos.c
| r3289 | r3290 | |
| 141 | 141 | |
| 142 | 142 | static INPUT_PORTS_START( megadon ) |
| 143 | 143 | PORT_START("DSW") |
| 144 | | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Coinage ) ) |
| 144 | |
| 145 | // There are odd port mappings (old=new) |
| 146 | // 02=10, 04=40, 08=02, 10=20, 20=04, 40=08 |
| 147 | |
| 148 | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1") |
| 145 | 149 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) |
| 146 | 150 | PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) ) |
| 147 | | PORT_DIPNAME( 0x02, 0x00, "Fuel Consumption" ) |
| 151 | PORT_DIPNAME( 0x50, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:2,3") |
| 152 | PORT_DIPSETTING( 0x00, "3" ) |
| 153 | PORT_DIPSETTING( 0x10, "4" ) |
| 154 | PORT_DIPSETTING( 0x40, "5" ) |
| 155 | PORT_DIPSETTING( 0x50, "6" ) |
| 156 | PORT_DIPNAME( 0x02, 0x00, "Fuel Consumption" ) PORT_DIPLOCATION("SW1:4") |
| 148 | 157 | PORT_DIPSETTING( 0x00, "Slow" ) |
| 149 | 158 | PORT_DIPSETTING( 0x02, "Fast" ) |
| 150 | | PORT_DIPNAME( 0x04, 0x00, "Rotation" ) |
| 159 | PORT_DIPNAME( 0x20, 0x20, "Enemy Fire Rate" ) PORT_DIPLOCATION("SW1:5") |
| 160 | PORT_DIPSETTING( 0x20, "Slow" ) |
| 161 | PORT_DIPSETTING( 0x00, "Fast" ) |
| 162 | PORT_DIPNAME( 0x04, 0x00, "Rotation" ) PORT_DIPLOCATION("SW1:6") |
| 151 | 163 | PORT_DIPSETTING( 0x04, "Slow" ) |
| 152 | 164 | PORT_DIPSETTING( 0x00, "Fast" ) |
| 153 | | PORT_DIPNAME( 0x08, 0x08, "ERG" ) |
| 165 | PORT_DIPNAME( 0x08, 0x08, "ERG" ) PORT_DIPLOCATION("SW1:7") |
| 154 | 166 | PORT_DIPSETTING( 0x08, DEF_STR( Easy ) ) |
| 155 | 167 | PORT_DIPSETTING( 0x00, DEF_STR( Hard ) ) |
| 156 | | PORT_DIPNAME( 0x20, 0x20, "Enemy Fire Rate" ) |
| 157 | | PORT_DIPSETTING( 0x20, "Slow" ) |
| 158 | | PORT_DIPSETTING( 0x00, "Fast" ) |
| 159 | | PORT_DIPNAME( 0x50, 0x00, DEF_STR( Lives ) ) |
| 160 | | PORT_DIPSETTING( 0x00, "3" ) |
| 161 | | PORT_DIPSETTING( 0x10, "4" ) |
| 162 | | PORT_DIPSETTING( 0x40, "5" ) |
| 163 | | PORT_DIPSETTING( 0x50, "6" ) |
| 164 | | PORT_DIPNAME( 0x80, 0x00, "Game Mode" ) |
| 168 | PORT_DIPNAME( 0x80, 0x00, "Game Mode" ) PORT_DIPLOCATION("SW1:8") |
| 165 | 169 | PORT_DIPSETTING( 0x00, "Arcade" ) |
| 166 | 170 | PORT_DIPSETTING( 0x80, "Contest" ) |
| 167 | 171 | |
| r3289 | r3290 | |
| 189 | 193 | |
| 190 | 194 | static INPUT_PORTS_START( suprglob ) |
| 191 | 195 | PORT_START("DSW") |
| 192 | | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Coinage ) ) |
| 196 | |
| 197 | // There are odd port mappings (old=new) |
| 198 | // 02=10, 04=40, 08=20, 10=02, 20=04, 40=08 |
| 199 | |
| 200 | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1") |
| 193 | 201 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) |
| 194 | 202 | PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) ) |
| 195 | | PORT_DIPNAME( 0x26, 0x00, DEF_STR( Difficulty ) ) |
| 203 | PORT_DIPNAME( 0x50, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:2,3") |
| 204 | PORT_DIPSETTING( 0x00, "3" ) |
| 205 | PORT_DIPSETTING( 0x10, "4" ) |
| 206 | PORT_DIPSETTING( 0x40, "5" ) |
| 207 | PORT_DIPSETTING( 0x50, "6" ) |
| 208 | PORT_DIPNAME( 0x26, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:4,5,6") |
| 196 | 209 | PORT_DIPSETTING( 0x00, "1" ) |
| 197 | 210 | PORT_DIPSETTING( 0x02, "2" ) |
| 198 | 211 | PORT_DIPSETTING( 0x20, "3" ) |
| r3289 | r3290 | |
| 201 | 214 | PORT_DIPSETTING( 0x06, "6" ) |
| 202 | 215 | PORT_DIPSETTING( 0x24, "7" ) |
| 203 | 216 | PORT_DIPSETTING( 0x26, "8" ) |
| 204 | | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Bonus_Life ) ) |
| 217 | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:7") |
| 205 | 218 | PORT_DIPSETTING( 0x00, "10000 + Difficulty * 10000" ) |
| 206 | 219 | PORT_DIPSETTING( 0x08, "90000 + Difficulty * 10000" ) |
| 207 | | PORT_DIPNAME( 0x50, 0x00, DEF_STR( Lives ) ) |
| 208 | | PORT_DIPSETTING( 0x00, "3" ) |
| 209 | | PORT_DIPSETTING( 0x10, "4" ) |
| 210 | | PORT_DIPSETTING( 0x40, "5" ) |
| 211 | | PORT_DIPSETTING( 0x50, "6" ) |
| 212 | | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) |
| 220 | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:8") |
| 213 | 221 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 214 | 222 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 215 | 223 | |
| r3289 | r3290 | |
| 240 | 248 | |
| 241 | 249 | static INPUT_PORTS_START( igmo ) |
| 242 | 250 | PORT_START("DSW") |
| 243 | | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Coinage ) ) |
| 251 | |
| 252 | // There are odd port mappings (old=new) |
| 253 | // 02=10, 04=40, 08=20, 10=02, 20=04, 40=08 |
| 254 | |
| 255 | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1") |
| 244 | 256 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) |
| 245 | 257 | PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) ) |
| 246 | | PORT_DIPNAME( 0x22, 0x00, DEF_STR( Bonus_Life ) ) |
| 258 | PORT_DIPNAME( 0x50, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:2,3") |
| 259 | PORT_DIPSETTING( 0x00, "3" ) |
| 260 | PORT_DIPSETTING( 0x10, "4" ) |
| 261 | PORT_DIPSETTING( 0x40, "5" ) |
| 262 | PORT_DIPSETTING( 0x50, "6" ) |
| 263 | PORT_DIPNAME( 0x22, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:4,5") |
| 247 | 264 | PORT_DIPSETTING( 0x00, "20000" ) |
| 248 | 265 | PORT_DIPSETTING( 0x02, "40000" ) |
| 249 | 266 | PORT_DIPSETTING( 0x20, "60000" ) |
| 250 | 267 | PORT_DIPSETTING( 0x22, "80000" ) |
| 251 | | PORT_DIPNAME( 0x8c, 0x00, DEF_STR( Difficulty ) ) |
| 268 | PORT_DIPNAME( 0x8c, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:6,7,8") |
| 252 | 269 | PORT_DIPSETTING( 0x00, "1" ) |
| 253 | 270 | PORT_DIPSETTING( 0x04, "2" ) |
| 254 | 271 | PORT_DIPSETTING( 0x08, "3" ) |
| r3289 | r3290 | |
| 257 | 274 | PORT_DIPSETTING( 0x84, "6" ) |
| 258 | 275 | PORT_DIPSETTING( 0x88, "7" ) |
| 259 | 276 | PORT_DIPSETTING( 0x8c, "8" ) |
| 260 | | PORT_DIPNAME( 0x50, 0x00, DEF_STR( Lives ) ) |
| 261 | | PORT_DIPSETTING( 0x00, "3" ) |
| 262 | | PORT_DIPSETTING( 0x10, "4" ) |
| 263 | | PORT_DIPSETTING( 0x40, "5" ) |
| 264 | | PORT_DIPSETTING( 0x50, "6" ) |
| 265 | 277 | |
| 266 | 278 | PORT_START("SYSTEM") |
| 267 | 279 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) |
| r3289 | r3290 | |
| 287 | 299 | INPUT_PORTS_END |
| 288 | 300 | |
| 289 | 301 | |
| 302 | static INPUT_PORTS_START( catapult ) |
| 303 | PORT_INCLUDE(igmo) |
| 304 | PORT_MODIFY("DSW") |
| 305 | |
| 306 | // There are odd port mappings (old=new) |
| 307 | // 02=08, 04=20, 08=40, 10=02, 20=10, 40=04 |
| 308 | |
| 309 | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1") |
| 310 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) |
| 311 | PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) ) |
| 312 | PORT_DIPNAME( 0x50, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:2,3") |
| 313 | PORT_DIPSETTING( 0x00, "3" ) |
| 314 | PORT_DIPSETTING( 0x10, "4" ) |
| 315 | PORT_DIPSETTING( 0x40, "5" ) |
| 316 | PORT_DIPSETTING( 0x50, "6" ) |
| 317 | PORT_DIPNAME( 0x22, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:4,5") |
| 318 | PORT_DIPSETTING( 0x00, "1" ) |
| 319 | PORT_DIPSETTING( 0x02, "2" ) |
| 320 | PORT_DIPSETTING( 0x20, "3" ) |
| 321 | PORT_DIPSETTING( 0x22, "4" ) |
| 322 | PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:6,7") |
| 323 | PORT_DIPSETTING( 0x00, "20000" ) |
| 324 | PORT_DIPSETTING( 0x04, "40000" ) |
| 325 | PORT_DIPSETTING( 0x08, "60000" ) |
| 326 | PORT_DIPSETTING( 0x0c, "80000" ) |
| 327 | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:8") |
| 328 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 329 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 330 | INPUT_PORTS_END |
| 331 | |
| 332 | |
| 290 | 333 | static INPUT_PORTS_START( dealer ) |
| 291 | 334 | PORT_START("DSW") |
| 292 | | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) |
| 335 | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:1") |
| 293 | 336 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 294 | 337 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 295 | | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Free_Play ) ) |
| 338 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW1:2") |
| 296 | 339 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) |
| 297 | 340 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 298 | | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unused ) ) |
| 299 | | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) |
| 300 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 301 | | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unused ) ) |
| 302 | | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 303 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 304 | | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unused ) ) |
| 305 | | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 306 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 307 | | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unused ) ) |
| 308 | | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 309 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 310 | | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Cabinet ) ) |
| 341 | PORT_DIPUNUSED_DIPLOC( 0x0004, 0x0004, "SW1:4" ) |
| 342 | PORT_DIPUNUSED_DIPLOC( 0x0008, 0x0008, "SW1:5" ) |
| 343 | PORT_DIPUNUSED_DIPLOC( 0x0010, 0x0010, "SW1:6" ) |
| 344 | PORT_DIPUNUSED_DIPLOC( 0x0020, 0x0020, "SW1:7" ) |
| 345 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:7") |
| 311 | 346 | PORT_DIPSETTING( 0x40, DEF_STR( Upright ) ) |
| 312 | 347 | PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) ) |
| 313 | | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Flip_Screen ) ) |
| 348 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:8") |
| 314 | 349 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 315 | 350 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 316 | 351 | |
| r3289 | r3290 | |
| 612 | 647 | *************************************/ |
| 613 | 648 | |
| 614 | 649 | GAME( 1982, megadon, 0, epos, megadon, 0, ROT270, "Epos Corporation (Photar Industries license)", "Megadon", 0 ) |
| 615 | | GAME( 1982, catapult, 0, epos, igmo, 0, ROT270, "Epos Corporation", "Catapult", GAME_NOT_WORKING) /* bad rom, hold f2 for test mode */ |
| 650 | GAME( 1982, catapult, 0, epos, catapult, 0, ROT270, "Epos Corporation", "Catapult", GAME_NOT_WORKING) /* bad rom, hold f2 for test mode */ |
| 616 | 651 | GAME( 1983, suprglob, 0, epos, suprglob, 0, ROT270, "Epos Corporation", "Super Glob", 0 ) |
| 617 | 652 | GAME( 1983, theglob, suprglob, epos, suprglob, 0, ROT270, "Epos Corporation", "The Glob", 0 ) |
| 618 | 653 | GAME( 1983, theglob2, suprglob, epos, suprglob, 0, ROT270, "Epos Corporation", "The Glob (earlier)", 0 ) |
src/mame/drivers/dec0.c
| r3289 | r3290 | |
| 33 | 33 | Gouky's patch for Bad Dudes & YM3812 information! |
| 34 | 34 | Thanks to JC Alexander for fix to Robocop ending! |
| 35 | 35 | |
| 36 | All games' Dip Switches (except Boulder Dash) have been verified against |
| 37 | Original Service Manuals and Service Mode (when available). |
| 38 | |
| 39 | |
| 36 | 40 | ToDo: |
| 37 | 41 | Hook up the 68705 in Midnight Resistance (bootleg) |
| 38 | 42 | |
| r3289 | r3290 | |
| 426 | 430 | INPUT_PORTS_END |
| 427 | 431 | |
| 428 | 432 | #define DEC0_COIN_SETTING \ |
| 429 | | PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Coin_A ) ) \ |
| 433 | PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2")\ |
| 430 | 434 | PORT_DIPSETTING( 0x0000, DEF_STR( 3C_1C ) ) \ |
| 431 | 435 | PORT_DIPSETTING( 0x0001, DEF_STR( 2C_1C ) ) \ |
| 432 | 436 | PORT_DIPSETTING( 0x0003, DEF_STR( 1C_1C ) ) \ |
| 433 | 437 | PORT_DIPSETTING( 0x0002, DEF_STR( 1C_2C ) ) \ |
| 434 | | PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Coin_B ) ) \ |
| 438 | PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:3,4")\ |
| 435 | 439 | PORT_DIPSETTING( 0x0000, DEF_STR( 3C_1C ) ) \ |
| 436 | 440 | PORT_DIPSETTING( 0x0004, DEF_STR( 2C_1C ) ) \ |
| 437 | 441 | PORT_DIPSETTING( 0x000c, DEF_STR( 1C_1C ) ) \ |
| r3289 | r3290 | |
| 441 | 445 | PORT_INCLUDE( dec0 ) |
| 442 | 446 | |
| 443 | 447 | PORT_START("DSW") |
| 444 | | PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Coin_A ) ) |
| 448 | PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2") |
| 445 | 449 | PORT_DIPSETTING( 0x0000, DEF_STR( 2C_1C ) ) |
| 446 | 450 | PORT_DIPSETTING( 0x0003, DEF_STR( 1C_1C ) ) |
| 447 | 451 | PORT_DIPSETTING( 0x0002, DEF_STR( 1C_2C ) ) |
| 448 | 452 | PORT_DIPSETTING( 0x0001, DEF_STR( 1C_3C ) ) |
| 449 | | PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Coin_B ) ) |
| 453 | PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:3,4") |
| 450 | 454 | PORT_DIPSETTING( 0x0000, DEF_STR( 2C_1C ) ) |
| 451 | 455 | PORT_DIPSETTING( 0x000c, DEF_STR( 1C_1C ) ) |
| 452 | 456 | PORT_DIPSETTING( 0x0008, DEF_STR( 1C_2C ) ) |
| 453 | 457 | PORT_DIPSETTING( 0x0004, DEF_STR( 1C_3C ) ) |
| 454 | 458 | PORT_SERVICE( 0x0010, IP_ACTIVE_LOW ) |
| 455 | | PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Demo_Sounds ) ) |
| 459 | PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:6") |
| 456 | 460 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 457 | 461 | PORT_DIPSETTING( 0x0020, DEF_STR( On ) ) |
| 458 | | PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Flip_Screen ) ) |
| 462 | PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:7") |
| 459 | 463 | PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) |
| 460 | 464 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 461 | | PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unused ) ) // Always OFF |
| 462 | | PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) |
| 463 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 465 | PORT_DIPUNUSED_DIPLOC( 0x0080, 0x0080, "SW1:8" ) // Always OFF |
| 464 | 466 | |
| 465 | | PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) ) |
| 466 | | PORT_DIPSETTING( 0x0100, "1" ) |
| 467 | PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:1,2") |
| 467 | 468 | PORT_DIPSETTING( 0x0300, "3" ) |
| 468 | 469 | PORT_DIPSETTING( 0x0200, "5" ) |
| 470 | PORT_DIPSETTING( 0x0100, "1" ) |
| 469 | 471 | PORT_DIPSETTING( 0x0000, "Infinite (Cheat)") |
| 470 | | PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) ) |
| 472 | PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:3,4") |
| 471 | 473 | PORT_DIPSETTING( 0x0800, DEF_STR( Easy ) ) |
| 472 | 474 | PORT_DIPSETTING( 0x0c00, DEF_STR( Normal ) ) |
| 473 | 475 | PORT_DIPSETTING( 0x0400, DEF_STR( Hard ) ) |
| 474 | 476 | PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) |
| 475 | | PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Bonus_Life ) ) |
| 477 | PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:5,6") |
| 476 | 478 | PORT_DIPSETTING( 0x3000, "30k 80k 160k" ) |
| 477 | | PORT_DIPSETTING( 0x1000, "50k 120k 190k" ) |
| 478 | | PORT_DIPSETTING( 0x2000, "100k 200k 300k" ) |
| 479 | PORT_DIPSETTING( 0x2000, "50k 120k 190k" ) |
| 480 | PORT_DIPSETTING( 0x1000, "100k 200k 300k" ) |
| 479 | 481 | PORT_DIPSETTING( 0x0000, "150k 300k 450k" ) |
| 480 | | PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Allow_Continue ) ) |
| 482 | PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:7") |
| 481 | 483 | PORT_DIPSETTING( 0x4000, DEF_STR( No ) ) |
| 482 | 484 | PORT_DIPSETTING( 0x0000, DEF_STR( Yes ) ) |
| 483 | | PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unused ) ) // Always OFF |
| 484 | | PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) |
| 485 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 485 | PORT_DIPUNUSED_DIPLOC( 0x8000, 0x8000, "SW1:8" ) // Always OFF |
| 486 | 486 | |
| 487 | 487 | PORT_START("AN0") /* player 1 12-way rotary control - converted in controls_r() */ |
| 488 | 488 | PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X) PORT_REVERSE |
| r3289 | r3290 | |
| 496 | 496 | |
| 497 | 497 | PORT_START("DSW") |
| 498 | 498 | DEC0_COIN_SETTING |
| 499 | | PORT_SERVICE( 0x0010, IP_ACTIVE_LOW ) |
| 500 | | PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Demo_Sounds ) ) |
| 499 | PORT_SERVICE( 0x0010, IP_ACTIVE_LOW ) PORT_DIPLOCATION("SW1:5") |
| 500 | PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:6") |
| 501 | 501 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 502 | 502 | PORT_DIPSETTING( 0x0020, DEF_STR( On ) ) |
| 503 | | PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Flip_Screen ) ) |
| 503 | PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:7") |
| 504 | 504 | PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) |
| 505 | 505 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 506 | | PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) |
| 507 | | PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) |
| 508 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 506 | PORT_DIPUNUSED_DIPLOC( 0x0080, 0x0080, "SW1:8" ) // Always OFF |
| 509 | 507 | |
| 510 | | PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) |
| 511 | | PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) |
| 512 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 513 | | PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) |
| 514 | | PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) |
| 515 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 516 | | PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) |
| 517 | | PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) |
| 518 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 519 | | PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) |
| 520 | | PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) |
| 521 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 522 | | PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) |
| 508 | PORT_DIPNAME( 0x0300, 0x0300, "Difficulty (Extend)" ) PORT_DIPLOCATION("SW2:1,2") |
| 509 | PORT_DIPSETTING( 0x0300, DEF_STR( Normal ) ) |
| 510 | PORT_DIPSETTING( 0x0200, DEF_STR( Easy ) ) |
| 511 | PORT_DIPSETTING( 0x0100, DEF_STR( Hard ) ) |
| 512 | PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) |
| 513 | PORT_DIPNAME( 0x0c00, 0x0c00, "Difficulty (Course)" ) PORT_DIPLOCATION("SW2:3,4") |
| 514 | PORT_DIPSETTING( 0x0c00, DEF_STR( Normal ) ) |
| 515 | PORT_DIPSETTING( 0x0800, DEF_STR( Easy ) ) |
| 516 | PORT_DIPSETTING( 0x0400, DEF_STR( Hard ) ) |
| 517 | PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) |
| 518 | PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:5") |
| 523 | 519 | PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) |
| 524 | 520 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 525 | | PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) |
| 526 | | PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) |
| 527 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 528 | | PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) |
| 529 | | PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) |
| 530 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 531 | | PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) |
| 532 | | PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) |
| 533 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 521 | PORT_DIPNAME( 0x2000, 0x2000, "Timer" ) PORT_DIPLOCATION("SW2:6") |
| 522 | PORT_DIPSETTING( 0x2000, DEF_STR( Normal ) ) |
| 523 | PORT_DIPSETTING( 0x0000, "Fast" ) |
| 524 | PORT_DIPNAME( 0xc000, 0x0000, "Control Panel Type" ) PORT_DIPLOCATION("SW2:7,8") |
| 525 | PORT_DIPSETTING( 0xc000, "Type A - Cocktail" ) |
| 526 | PORT_DIPSETTING( 0x8000, "Type B - Cocktail 2" ) |
| 527 | PORT_DIPSETTING( 0x4000, DEF_STR( Unused ) ) |
| 528 | PORT_DIPSETTING( 0x0000, "Type C - Upright" ) |
| 534 | 529 | |
| 535 | 530 | PORT_START("AN0") /* player 1 12-way rotary control - converted in controls_r() */ |
| 536 | 531 | PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X) PORT_REVERSE |
| r3289 | r3290 | |
| 544 | 539 | |
| 545 | 540 | PORT_START("DSW") |
| 546 | 541 | DEC0_COIN_SETTING |
| 547 | | PORT_SERVICE( 0x0010, IP_ACTIVE_LOW ) |
| 548 | | PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Demo_Sounds ) ) |
| 542 | PORT_SERVICE( 0x0010, IP_ACTIVE_LOW ) PORT_DIPLOCATION("SW1:5") |
| 543 | PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:6") |
| 549 | 544 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 550 | 545 | PORT_DIPSETTING( 0x0020, DEF_STR( On ) ) |
| 551 | | PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Flip_Screen ) ) |
| 546 | PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:7") |
| 552 | 547 | PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) |
| 553 | 548 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 554 | | PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) // According to some technical sources should be "Cabinet" |
| 555 | | PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) |
| 556 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 549 | PORT_DIPUNUSED_DIPLOC( 0x0080, 0x0080, "SW1:8" ) // Always OFF |
| 557 | 550 | |
| 558 | | PORT_DIPNAME( 0x0300, 0x0200, DEF_STR( Lives ) ) |
| 551 | PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:1,2") |
| 552 | PORT_DIPSETTING( 0x0200, "5" ) |
| 553 | PORT_DIPSETTING( 0x0300, "3" ) |
| 559 | 554 | PORT_DIPSETTING( 0x0100, "1" ) |
| 560 | | PORT_DIPSETTING( 0x0300, "2" ) |
| 561 | | PORT_DIPSETTING( 0x0200, "3" ) |
| 562 | 555 | PORT_DIPSETTING( 0x0000, "Infinite (Cheat)") |
| 563 | | PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) ) |
| 556 | PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:3,4") |
| 564 | 557 | PORT_DIPSETTING( 0x0800, DEF_STR( Easy ) ) |
| 565 | 558 | PORT_DIPSETTING( 0x0c00, DEF_STR( Normal ) ) |
| 566 | 559 | PORT_DIPSETTING( 0x0400, DEF_STR( Hard ) ) |
| 567 | 560 | PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) |
| 568 | | PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Allow_Continue ) ) |
| 569 | | PORT_DIPSETTING( 0x0000, DEF_STR( No ) ) |
| 570 | | PORT_DIPSETTING( 0x1000, DEF_STR( Yes ) ) |
| 571 | | PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unused ) ) // Always OFF |
| 572 | | PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) |
| 573 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 574 | | PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unused ) ) // Always OFF |
| 575 | | PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) |
| 576 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 577 | | PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unused ) ) // Always OFF |
| 578 | | PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) |
| 579 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 561 | PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:5") |
| 562 | PORT_DIPSETTING( 0x1000, DEF_STR( No ) ) |
| 563 | PORT_DIPSETTING( 0x0000, DEF_STR( Yes ) ) |
| 564 | PORT_DIPUNUSED_DIPLOC( 0x2000, 0x2000, "SW2:6" ) // Always OFF |
| 565 | PORT_DIPUNUSED_DIPLOC( 0x4000, 0x4000, "SW2:7" ) // Always OFF |
| 566 | PORT_DIPUNUSED_DIPLOC( 0x8000, 0x8000, "SW2:8" ) // Always OFF |
| 580 | 567 | |
| 581 | 568 | PORT_START("AN0") /* player 1 12-way rotary control - converted in controls_r() */ |
| 582 | 569 | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* unused */ |
| r3289 | r3290 | |
| 590 | 577 | |
| 591 | 578 | PORT_START("DSW") |
| 592 | 579 | DEC0_COIN_SETTING |
| 593 | | PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unused ) ) // Always OFF |
| 594 | | PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) |
| 595 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 596 | | PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Demo_Sounds ) ) |
| 580 | PORT_DIPUNUSED_DIPLOC( 0x0010, 0x0010, "SW1:5" ) // Always OFF |
| 581 | PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:6") |
| 597 | 582 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 598 | 583 | PORT_DIPSETTING( 0x0020, DEF_STR( On ) ) |
| 599 | | PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Flip_Screen ) ) |
| 584 | PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:7") |
| 600 | 585 | PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) |
| 601 | 586 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 602 | | PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Cabinet ) ) |
| 587 | PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:8") |
| 603 | 588 | PORT_DIPSETTING( 0x0000, DEF_STR( Upright ) ) |
| 604 | 589 | PORT_DIPSETTING( 0x0080, DEF_STR( Cocktail ) ) |
| 605 | 590 | |
| 606 | | PORT_DIPNAME( 0x0300, 0x0300, "Player Energy" ) |
| 591 | PORT_DIPNAME( 0x0300, 0x0300, "Player Energy" ) PORT_DIPLOCATION("SW2:1,2") |
| 607 | 592 | PORT_DIPSETTING( 0x0100, DEF_STR( Low ) ) |
| 608 | 593 | PORT_DIPSETTING( 0x0300, DEF_STR( Medium ) ) |
| 609 | 594 | PORT_DIPSETTING( 0x0200, DEF_STR( High ) ) |
| 610 | 595 | PORT_DIPSETTING( 0x0000, DEF_STR( Very_High ) ) |
| 611 | | PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) ) |
| 596 | PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:3,4") |
| 612 | 597 | PORT_DIPSETTING( 0x0800, DEF_STR( Easy ) ) |
| 613 | 598 | PORT_DIPSETTING( 0x0c00, DEF_STR( Normal ) ) |
| 614 | 599 | PORT_DIPSETTING( 0x0400, DEF_STR( Hard ) ) |
| 615 | 600 | PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) |
| 616 | | PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Allow_Continue ) ) |
| 601 | PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:5") |
| 617 | 602 | PORT_DIPSETTING( 0x0000, DEF_STR( No ) ) |
| 618 | 603 | PORT_DIPSETTING( 0x1000, DEF_STR( Yes ) ) |
| 619 | | PORT_DIPNAME( 0x2000, 0x2000, "Bonus Stage Energy" ) |
| 604 | PORT_DIPNAME( 0x2000, 0x2000, "Bonus Stage Energy" ) PORT_DIPLOCATION("SW2:6") |
| 620 | 605 | PORT_DIPSETTING( 0x0000, DEF_STR( Low ) ) |
| 621 | 606 | PORT_DIPSETTING( 0x2000, DEF_STR( High ) ) |
| 622 | 607 | PORT_DIPNAME( 0x4000, 0x4000, "Brink Time" ) |
| 623 | | PORT_DIPSETTING( 0x4000, DEF_STR( Normal ) ) |
| 608 | PORT_DIPSETTING( 0x4000, DEF_STR( Normal ) ) PORT_DIPLOCATION("SW2:7") /* not mentioned in manual */ |
| 624 | 609 | PORT_DIPSETTING( 0x0000, "Less" ) |
| 625 | | PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unused ) ) // Always OFF |
| 626 | | PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) |
| 627 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 610 | PORT_DIPUNUSED_DIPLOC( 0x8000, 0x8000, "SW2:8" ) // Always OFF |
| 628 | 611 | INPUT_PORTS_END |
| 629 | 612 | |
| 630 | 613 | static INPUT_PORTS_START( hippodrm ) |
| r3289 | r3290 | |
| 632 | 615 | |
| 633 | 616 | PORT_START("DSW") |
| 634 | 617 | DEC0_COIN_SETTING |
| 635 | | PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unused ) ) // Always OFF |
| 636 | | PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) |
| 637 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 638 | | PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Demo_Sounds ) ) |
| 618 | PORT_DIPUNUSED_DIPLOC( 0x0010, 0x0010, "SW1:5" ) // Always OFF |
| 619 | PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:6") |
| 639 | 620 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 640 | 621 | PORT_DIPSETTING( 0x0020, DEF_STR( On ) ) |
| 641 | | PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Flip_Screen ) ) |
| 622 | PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:7") |
| 642 | 623 | PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) |
| 643 | 624 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 644 | | PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unused ) ) // Always OFF |
| 645 | | PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) |
| 646 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 625 | PORT_DIPUNUSED_DIPLOC( 0x0080, 0x0080, "SW1:8" ) // Always OFF |
| 647 | 626 | |
| 648 | | PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) ) |
| 627 | PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:1,2") |
| 649 | 628 | PORT_DIPSETTING( 0x0100, "1" ) |
| 650 | 629 | PORT_DIPSETTING( 0x0300, "2" ) |
| 651 | 630 | PORT_DIPSETTING( 0x0200, "3" ) |
| 652 | 631 | PORT_DIPSETTING( 0x0000, "5" ) |
| 653 | | PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) ) |
| 632 | PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:3,4") |
| 654 | 633 | PORT_DIPSETTING( 0x0800, DEF_STR( Easy ) ) |
| 655 | 634 | PORT_DIPSETTING( 0x0c00, DEF_STR( Normal ) ) |
| 656 | 635 | PORT_DIPSETTING( 0x0400, DEF_STR( Hard ) ) |
| 657 | 636 | PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) |
| 658 | | PORT_DIPNAME( 0x3000, 0x3000, "Player & Enemy Energy" ) |
| 659 | | PORT_DIPSETTING( 0x1000, DEF_STR( Low ) ) |
| 660 | | PORT_DIPSETTING( 0x2000, DEF_STR( Medium ) ) |
| 661 | | PORT_DIPSETTING( 0x3000, DEF_STR( High ) ) |
| 662 | | PORT_DIPSETTING( 0x0000, DEF_STR( Very_High ) ) |
| 663 | | PORT_DIPNAME( 0x4000, 0x4000, "Enemy Power on Continue" ) |
| 664 | | PORT_DIPSETTING( 0x4000, "3 Dots" ) // 3 Dots less |
| 665 | | PORT_DIPSETTING( 0x0000, "2 Dots" ) // 2 Dots less |
| 666 | | PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unused ) ) // Always OFF |
| 667 | | PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) |
| 668 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 637 | PORT_DIPNAME( 0x3000, 0x3000, "Player & Enemy Energy" ) PORT_DIPLOCATION("SW2:5,6") |
| 638 | PORT_DIPSETTING( 0x3000, DEF_STR( Medium ) ) |
| 639 | PORT_DIPSETTING( 0x2000, DEF_STR( Low ) ) |
| 640 | PORT_DIPSETTING( 0x1000, DEF_STR( Very_Low ) ) |
| 641 | PORT_DIPSETTING( 0x0000, DEF_STR( High ) ) |
| 642 | PORT_DIPNAME( 0x4000, 0x4000, "Enemy Power Decrease on Continue" ) PORT_DIPLOCATION("SW2:7") |
| 643 | PORT_DIPSETTING( 0x4000, "2 Dots" ) // 2 Dots less |
| 644 | PORT_DIPSETTING( 0x0000, "3 Dots" ) // 3 Dots less |
| 645 | PORT_DIPUNUSED_DIPLOC( 0x8000, 0x8000, "SW2:8" ) // Always OFF |
| 669 | 646 | |
| 670 | 647 | PORT_START("VBLANK") |
| 671 | 648 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK ) |
| r3289 | r3290 | |
| 677 | 654 | |
| 678 | 655 | PORT_START("DSW") |
| 679 | 656 | DEC0_COIN_SETTING |
| 680 | | PORT_SERVICE( 0x0010, IP_ACTIVE_LOW ) |
| 681 | | PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Demo_Sounds ) ) |
| 657 | PORT_SERVICE( 0x0010, IP_ACTIVE_LOW ) PORT_DIPLOCATION("SW1:5") |
| 658 | PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:6") |
| 682 | 659 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 683 | 660 | PORT_DIPSETTING( 0x0020, DEF_STR( On ) ) |
| 684 | | PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Flip_Screen ) ) |
| 661 | PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:7") |
| 685 | 662 | PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) |
| 686 | 663 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 687 | | PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Cabinet ) ) |
| 664 | PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:8") |
| 688 | 665 | PORT_DIPSETTING( 0x0000, DEF_STR( Upright ) ) |
| 689 | 666 | PORT_DIPSETTING( 0x0080, DEF_STR( Cocktail ) ) |
| 690 | 667 | |
| 691 | | PORT_DIPNAME( 0x0300, 0x0300, "Energy" ) |
| 692 | | PORT_DIPSETTING( 0x0200, DEF_STR( Low ) ) |
| 693 | | PORT_DIPSETTING( 0x0300, DEF_STR( Medium ) ) |
| 694 | | PORT_DIPSETTING( 0x0100, DEF_STR( High ) ) |
| 695 | | PORT_DIPSETTING( 0x0000, DEF_STR( Very_High ) ) |
| 696 | | PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) ) |
| 668 | PORT_DIPNAME( 0x0300, 0x0300, "Energy" ) PORT_DIPLOCATION("SW2:1,2") |
| 669 | PORT_DIPSETTING( 0x0200, "Low - 8 bars" ) |
| 670 | PORT_DIPSETTING( 0x0300, "Medium - 10 bars" ) |
| 671 | PORT_DIPSETTING( 0x0100, "High - 12 bars" ) |
| 672 | PORT_DIPSETTING( 0x0000, "Very High - 14 bars" ) |
| 673 | PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:3,4") /* not mentioned in manual */ |
| 697 | 674 | PORT_DIPSETTING( 0x0800, DEF_STR( Easy ) ) |
| 698 | 675 | PORT_DIPSETTING( 0x0c00, DEF_STR( Normal ) ) |
| 699 | 676 | PORT_DIPSETTING( 0x0400, DEF_STR( Hard ) ) |
| 700 | 677 | PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) |
| 701 | | PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Allow_Continue ) ) |
| 678 | PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:5") |
| 702 | 679 | PORT_DIPSETTING( 0x0000, DEF_STR( No ) ) |
| 703 | 680 | PORT_DIPSETTING( 0x1000, DEF_STR( Yes ) ) |
| 704 | | PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unused ) ) // Always OFF |
| 705 | | PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) |
| 706 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 707 | | PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unused ) ) // Always OFF |
| 708 | | PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) |
| 709 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 710 | | PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unused ) ) // Always OFF |
| 711 | | PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) |
| 712 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 681 | PORT_DIPUNUSED_DIPLOC( 0x2000, 0x2000, "SW2:6" ) // Always OFF |
| 682 | PORT_DIPUNUSED_DIPLOC( 0x4000, 0x4000, "SW2:7" ) // Always OFF |
| 683 | PORT_DIPUNUSED_DIPLOC( 0x8000, 0x8000, "SW2:8" ) // Always OFF |
| 713 | 684 | INPUT_PORTS_END |
| 714 | 685 | |
| 715 | 686 | static INPUT_PORTS_START( midres ) |
| r3289 | r3290 | |
| 717 | 688 | |
| 718 | 689 | PORT_START("DSW") |
| 719 | 690 | DEC0_COIN_SETTING |
| 720 | | PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unused ) ) // Always OFF |
| 721 | | PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) |
| 722 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 723 | | PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Demo_Sounds ) ) |
| 691 | PORT_DIPUNUSED_DIPLOC( 0x0010, 0x0010, "SW1:5" ) // Always OFF |
| 692 | PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:6") |
| 724 | 693 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 725 | 694 | PORT_DIPSETTING( 0x0020, DEF_STR( On ) ) |
| 726 | | PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Flip_Screen ) ) |
| 695 | PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:7") |
| 727 | 696 | PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) |
| 728 | 697 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 729 | | PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unused ) ) // Always OFF |
| 730 | | PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) |
| 731 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 698 | PORT_DIPUNUSED_DIPLOC( 0x0080, 0x0080, "SW1:8" ) // Always OFF |
| 732 | 699 | |
| 733 | | PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) ) |
| 734 | | PORT_DIPSETTING( 0x0100, "1" ) |
| 700 | PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:1,2") |
| 735 | 701 | PORT_DIPSETTING( 0x0300, "3" ) |
| 736 | | PORT_DIPSETTING( 0x0200, "5" ) |
| 702 | PORT_DIPSETTING( 0x0200, "4" ) |
| 703 | PORT_DIPSETTING( 0x0100, "5" ) |
| 737 | 704 | PORT_DIPSETTING( 0x0000, "Infinite (Cheat)") |
| 738 | | PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) ) |
| 705 | PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:3,4") |
| 739 | 706 | PORT_DIPSETTING( 0x0800, DEF_STR( Easy ) ) |
| 740 | 707 | PORT_DIPSETTING( 0x0c00, DEF_STR( Normal ) ) |
| 741 | 708 | PORT_DIPSETTING( 0x0400, DEF_STR( Hard ) ) |
| 742 | 709 | PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) |
| 743 | | PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) // Extra Lives? |
| 710 | PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:5") /* manual mentions Extra Lives - Default OFF */ |
| 744 | 711 | PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) |
| 745 | 712 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 746 | | PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) // Extra Lives? |
| 713 | PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:6") /* manual mentions Extra Lives - Default OFF */ |
| 747 | 714 | PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) |
| 748 | 715 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 749 | | PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Allow_Continue ) ) |
| 716 | PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:7") |
| 750 | 717 | PORT_DIPSETTING( 0x4000, DEF_STR( No ) ) |
| 751 | 718 | PORT_DIPSETTING( 0x0000, DEF_STR( Yes ) ) |
| 752 | | PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unused ) ) // Always OFF |
| 753 | | PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) |
| 754 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 719 | PORT_DIPUNUSED_DIPLOC( 0x8000, 0x8000, "SW2:8" ) // Always OFF |
| 755 | 720 | |
| 756 | 721 | PORT_START("AN0") /* player 1 12-way rotary control - converted in controls_r() */ |
| 757 | 722 | PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X) PORT_REVERSE |
| r3289 | r3290 | |
| 768 | 733 | |
| 769 | 734 | PORT_START("DSW") |
| 770 | 735 | /* Different Coinage. Just a few combinations from manual, the rest was figured out */ |
| 771 | | PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) ) |
| 736 | PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3") |
| 772 | 737 | PORT_DIPSETTING( 0x0000, DEF_STR( 3C_1C ) ) |
| 773 | 738 | PORT_DIPSETTING( 0x0001, DEF_STR( 2C_1C ) ) |
| 774 | 739 | PORT_DIPSETTING( 0x0007, DEF_STR( 1C_1C ) ) |
| r3289 | r3290 | |
| 777 | 742 | PORT_DIPSETTING( 0x0004, DEF_STR( 1C_4C ) ) |
| 778 | 743 | PORT_DIPSETTING( 0x0003, DEF_STR( 1C_5C ) ) |
| 779 | 744 | PORT_DIPSETTING( 0x0002, DEF_STR( 1C_6C ) ) |
| 780 | | PORT_DIPNAME( 0x0038, 0x0038, DEF_STR( Coin_B ) ) |
| 745 | PORT_DIPNAME( 0x0038, 0x0038, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:4,5,6") |
| 781 | 746 | PORT_DIPSETTING( 0x0000, DEF_STR( 3C_1C ) ) |
| 782 | 747 | PORT_DIPSETTING( 0x0008, DEF_STR( 2C_1C ) ) |
| 783 | 748 | PORT_DIPSETTING( 0x0038, DEF_STR( 1C_1C ) ) |
| r3289 | r3290 | |
| 786 | 751 | PORT_DIPSETTING( 0x0020, DEF_STR( 1C_4C ) ) |
| 787 | 752 | PORT_DIPSETTING( 0x0018, DEF_STR( 1C_5C ) ) |
| 788 | 753 | PORT_DIPSETTING( 0x0010, DEF_STR( 1C_6C ) ) |
| 789 | | PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Flip_Screen ) ) |
| 754 | PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:7") |
| 790 | 755 | PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) |
| 791 | 756 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 792 | | PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Cabinet ) ) |
| 757 | PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:8") |
| 793 | 758 | PORT_DIPSETTING( 0x0000, DEF_STR( Upright ) ) |
| 794 | 759 | PORT_DIPSETTING( 0x0080, DEF_STR( Cocktail ) ) |
| 795 | 760 | |
| 796 | | PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) ) |
| 761 | PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:1,2") |
| 797 | 762 | PORT_DIPSETTING( 0x0000, "2" ) |
| 798 | 763 | PORT_DIPSETTING( 0x0300, "3" ) |
| 799 | 764 | PORT_DIPSETTING( 0x0200, "4" ) |
| 800 | 765 | PORT_DIPSETTING( 0x0100, "5" ) |
| 801 | | PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) ) |
| 766 | PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:3,4") |
| 802 | 767 | PORT_DIPSETTING( 0x0800, DEF_STR( Easy ) ) |
| 803 | 768 | PORT_DIPSETTING( 0x0c00, DEF_STR( Normal ) ) |
| 804 | 769 | PORT_DIPSETTING( 0x0400, DEF_STR( Hard ) ) |
| 805 | 770 | PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) |
| 806 | | PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unused ) ) // Always OFF |
| 807 | | PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) |
| 808 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 809 | | PORT_DIPNAME( 0x2000, 0x2000, "Game Change Mode" ) |
| 771 | PORT_DIPUNUSED_DIPLOC( 0x1000, 0x1000, "SW2:5" ) // Always OFF |
| 772 | PORT_DIPNAME( 0x2000, 0x2000, "Game Change Mode" ) PORT_DIPLOCATION("SW2:6") |
| 810 | 773 | PORT_DIPSETTING( 0x2000, "Part 1" ) |
| 811 | 774 | PORT_DIPSETTING( 0x0000, "Part 2" ) |
| 812 | | PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Allow_Continue ) ) |
| 775 | PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:7") |
| 813 | 776 | PORT_DIPSETTING( 0x0000, DEF_STR( No ) ) |
| 814 | 777 | PORT_DIPSETTING( 0x4000, DEF_STR( Yes ) ) |
| 815 | | PORT_DIPNAME( 0x8000, 0x0000, DEF_STR( Demo_Sounds ) ) |
| 778 | PORT_DIPNAME( 0x8000, 0x0000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:8") |
| 816 | 779 | PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) |
| 817 | 780 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 818 | 781 | INPUT_PORTS_END |
src/mame/drivers/firefox.c
| r0 | r3290 | |
| 1 | /*************************************************************************** |
| 2 | |
| 3 | Atari Fire Fox hardware |
| 4 | |
| 5 | driver by smf, Aaron Giles, Chris Hardy & Scott Waye |
| 6 | |
| 7 | short term: |
| 8 | split driver/vidhrdw/sndhrdw/machine |
| 9 | add option to centre joystick to enter test menu |
| 10 | |
| 11 | it uses a quad pokey package 137323-1221-406??? |
| 12 | the laser disc is a philips lvp 22vp931 |
| 13 | ( but maybe this works too... Special Drive: Laser Disc Player - Philips VP-832A ) |
| 14 | |
| 15 | |
| 16 | AV# 60626 |
| 17 | Atari "Firefox" V |
| 18 | |
| 19 | Laser Disc - 30 minutes - Color - 1983 |
| 20 | |
| 21 | An interactive CAV laserdisc designed for use in the Atari video arcade game machine. |
| 22 | Contains over 100 visual and sound segments that include all of the branching possibilities of this game. |
| 23 | Each segment is two to five seconds long. This disc will play on any player, |
| 24 | but requires a special level III player for proper control. Video: CAV. Audio: Analog. |
| 25 | |
| 26 | */ |
| 27 | |
| 28 | #include "mame.h" |
| 29 | #include "deprecat.h" |
| 30 | #include "driver.h" |
| 31 | #include "cpu/m6809/m6809.h" |
| 32 | #include "cpu/m6502/m6502.h" |
| 33 | #include "sound/pokey.h" |
| 34 | #include "sound/tms5220.h" |
| 35 | #include "sound/5220intf.h" |
| 36 | #include "machine/laserdsc.h" |
| 37 | #include "machine/6532riot.h" |
| 38 | #include "machine/x2212.h" |
| 39 | |
| 40 | /* |
| 41 | fff6=firq e4a2 when dav goes active/low |
| 42 | fff8=irq e38f This is through a flip-flop so goes off (high as active low) only when reset_irq is active - low. |
| 43 | fffa=??? e38d |
| 44 | fffc=??? e38d |
| 45 | fffe=reset e7cc |
| 46 | */ |
| 47 | |
| 48 | /* 0x50-52 Used as a copy of the status |
| 49 | 0x59 = 6-length of laser disc return code |
| 50 | 0x53 = pointer to laser disc return |
| 51 | ( LaserDiscBits & 0x80 ) != 0 when return code available |
| 52 | DSKREAD = acknowledge |
| 53 | ReadDiscData = return code |
| 54 | */ |
| 55 | |
| 56 | /* FXXXXX for first field |
| 57 | AXXXXX for second field */ |
| 58 | |
| 59 | static int m_n_disc_lock; |
| 60 | static int m_n_disc_left_audio; |
| 61 | static int m_n_disc_right_audio; |
| 62 | static int m_n_disc_data; |
| 63 | static int command_offset; |
| 64 | static int command_data[ 3 ]; |
| 65 | static int manchester_data[ 6 ]; |
| 66 | static int manchester_offset; |
| 67 | static int disc_reset; |
| 68 | static int disk_opr = 0; |
| 69 | static int dav = 0x80; |
| 70 | static int dak_just_low = 0; /* simulate the 15 uS time for the player to read the data */ |
| 71 | static int dak = 0x40; /* DAK or DSKFULL active low indicates player has data, |
| 72 | reset when player has read data */ |
| 73 | static int disk_data; /* after a command is sent the first bit indicates an error, except of the data is 0x00 which indicates an invalid manchester data read (whatever that means) */ |
| 74 | |
| 75 | int laser_disc_speed = 0; |
| 76 | int laser_disc_field = 0; |
| 77 | void laser_seek_frame( int frame ) |
| 78 | { |
| 79 | } |
| 80 | |
| 81 | |
| 82 | /* 20 = DISKOPR - Active low |
| 83 | 40 = DISKFULL - Active low |
| 84 | 80 = DISKDAV - Active low data available |
| 85 | */ |
| 86 | READ8_HANDLER( firefox_disc_status_r ) |
| 87 | { |
| 88 | int n_data; |
| 89 | n_data = dav | dak | disk_opr; /* always operational */ |
| 90 | logerror( "%08x: disc status r %02x\n", activecpu_get_pc(), n_data & ( 0x80 | 0x40 | 0x20 ) ); |
| 91 | /* |
| 92 | fprintf(stderr, "%08x: reading disc status r %02x\n", activecpu_get_pc(), n_data & ( 0x80 | 0x40 | 0x20 ) ); |
| 93 | */ |
| 94 | if(dak_just_low) |
| 95 | { |
| 96 | /* assume that the next status read will be after 15uS */ |
| 97 | dak = 0x40; |
| 98 | dak_just_low = 0; |
| 99 | } |
| 100 | return n_data; |
| 101 | } |
| 102 | |
| 103 | /* 4105 - DREAD */ |
| 104 | /* this reset RDDSK (&DSKRD) */ |
| 105 | READ8_HANDLER( firefox_disc_data_r ) |
| 106 | { |
| 107 | return disk_data; |
| 108 | } |
| 109 | |
| 110 | /* DISK READ ENABLE */ |
| 111 | /* 4218 - DSKREAD, set RDDSK */ |
| 112 | WRITE8_HANDLER( firefox_disc_read_w ) |
| 113 | { |
| 114 | dav=0x80; |
| 115 | if( manchester_offset < 6 ) |
| 116 | { |
| 117 | disk_data = manchester_data[ manchester_offset++ ]; |
| 118 | if(manchester_offset < 6) |
| 119 | { |
| 120 | dav = 0; /* more data */ |
| 121 | cpunum_set_input_line( machine, 0, M6809_FIRQ_LINE, ASSERT_LINE ); |
| 122 | } |
| 123 | |
| 124 | } |
| 125 | } |
| 126 | |
| 127 | WRITE8_HANDLER( firefox_disc_lock_w ) |
| 128 | { |
| 129 | m_n_disc_lock = data & 0x80; |
| 130 | } |
| 131 | |
| 132 | WRITE8_HANDLER( firefox_disc_right_audio_enable_w ) |
| 133 | { |
| 134 | m_n_disc_right_audio = data & 0x80; |
| 135 | } |
| 136 | |
| 137 | WRITE8_HANDLER( firefox_disc_left_audio_enable_w ) |
| 138 | { |
| 139 | m_n_disc_left_audio = data & 0x80; |
| 140 | } |
| 141 | |
| 142 | WRITE8_HANDLER( firefox_disc_reset_w ) |
| 143 | { |
| 144 | disc_reset = (data & 0x80); |
| 145 | if(!disc_reset) |
| 146 | { |
| 147 | laser_disc_speed = 0; |
| 148 | manchester_offset = 6; /* no data available */ |
| 149 | command_offset = 0; |
| 150 | dak = 0x40; |
| 151 | dav = 0x80; |
| 152 | } |
| 153 | } |
| 154 | |
| 155 | /* active low on dbb7 */ |
| 156 | WRITE8_HANDLER( firefox_disc_write_w ) |
| 157 | { |
| 158 | if( ( data & 0x80 ) == 0 ) |
| 159 | { |
| 160 | dak = 0; /* should go high after 15 uS */ |
| 161 | dak_just_low = 1; |
| 162 | command_data[ command_offset++ ] = m_n_disc_data; |
| 163 | if( command_offset == 3 ) |
| 164 | { |
| 165 | command_offset = 0; |
| 166 | switch( command_data[ 0 ] & 0xf0 ) |
| 167 | { |
| 168 | case 0xf0: |
| 169 | logerror( "CMD: goto Frame #%01x%02x%02x & play forward\n", command_data[ 0 ] & 0x0f, command_data[ 1 ], command_data[ 2 ] ); |
| 170 | laser_disc_field = |
| 171 | ( ( command_data[ 0 ] & 0x0f ) * 20000 ) + |
| 172 | ( (( command_data[ 1 ] & 0xf0 ) >> 4) * 2000 ) + |
| 173 | ( ( command_data[ 1 ] & 0x0f ) * 200 ) + |
| 174 | ( (( command_data[ 2 ] & 0xf0 ) >> 4) * 20 ) + |
| 175 | ( ( command_data[ 2 ] & 0x0f ) * 2 ); |
| 176 | laser_seek_frame(laser_disc_field >> 1); |
| 177 | /* |
| 178 | fprintf(stderr, "CMD: goto frame #%01x%02x%02x & play forward disc_field %d\n", command_data[ 0 ] & 0x0f, command_data[ 1 ], command_data[ 2 ] , laser_disc_field); |
| 179 | */ |
| 180 | laser_disc_speed = 1; |
| 181 | return; |
| 182 | case 0xd0: |
| 183 | /* |
| 184 | fprintf(stderr, "CMD: goto Frame #%01x%02x%02x & halt (first field)\n", command_data[ 0 ] & 0x0f, command_data[ 1 ], command_data[ 2 ] ); |
| 185 | */ |
| 186 | laser_disc_field = |
| 187 | ( ( command_data[ 0 ] & 0x0f ) * 20000 ) + |
| 188 | ( (( command_data[ 1 ] & 0xf0 ) >> 4) * 2000 ) + |
| 189 | ( ( command_data[ 1 ] & 0x0f ) * 200 ) + |
| 190 | ( (( command_data[ 2 ] & 0xf0 ) >> 4) * 20 ) + |
| 191 | ( ( command_data[ 2 ] & 0x0f ) * 2 ); |
| 192 | laser_seek_frame(laser_disc_field >> 1); |
| 193 | laser_disc_speed = 0; |
| 194 | return; |
| 195 | case 0x00: |
| 196 | switch( command_data[ 0 ] & 0x0f ) |
| 197 | { |
| 198 | case 0x00: |
| 199 | switch( command_data[ 1 ] & 0xf0 ) |
| 200 | { |
| 201 | case 0x00: |
| 202 | laser_disc_speed = 1; |
| 203 | return; |
| 204 | case 0x10: |
| 205 | laser_disc_speed = -1; |
| 206 | return; |
| 207 | case 0x20: |
| 208 | laser_disc_speed = 0; |
| 209 | return; |
| 210 | case 0x40: |
| 211 | return; |
| 212 | case 0x50: |
| 213 | return; |
| 214 | case 0xa0: |
| 215 | laser_disc_speed = 75; |
| 216 | return; |
| 217 | case 0xb0: |
| 218 | laser_disc_speed = -75; |
| 219 | return; |
| 220 | case 0xe0: |
| 221 | return; |
| 222 | case 0xf0: |
| 223 | return; |
| 224 | } |
| 225 | break; |
| 226 | case 0x02: |
| 227 | switch( command_data[ 1 ] ) |
| 228 | { |
| 229 | case 0xb0: |
| 230 | logerror( "CMD: Video ON/OFF %02x\n", command_data[ 2 ] ); |
| 231 | return; |
| 232 | case 0xb1: |
| 233 | logerror( "CMD: Audio-I ON/OFF %02x\n", command_data[ 2 ] ); |
| 234 | return; |
| 235 | case 0xb2: |
| 236 | logerror( "CMD: Audio-II ON/OFF %02x\n", command_data[ 2 ] ); |
| 237 | return; |
| 238 | case 0xb3: |
| 239 | logerror( "CMD: CX ON/OFF %02x\n", command_data[ 2 ] ); |
| 240 | return; |
| 241 | } |
| 242 | break; |
| 243 | } |
| 244 | break; |
| 245 | } |
| 246 | logerror( "CMD: invalid %02x%02x%02x\n", command_data[ 0 ], command_data[ 1 ], command_data[ 2 ] ); |
| 247 | } |
| 248 | } |
| 249 | } |
| 250 | |
| 251 | /* latch the data */ |
| 252 | WRITE8_HANDLER( firefox_disc_data_w ) |
| 253 | { |
| 254 | m_n_disc_data = data; |
| 255 | } |
| 256 | |
| 257 | static TIMER_DEVICE_CALLBACK( laserdisk_timer_callback ) |
| 258 | { |
| 259 | if(param == 0 && laser_disc_speed != 0) |
| 260 | { |
| 261 | manchester_data[ 0 ] = ( ( laser_disc_field & 0x01 )?0xA0:0xF0 ) | ( ( laser_disc_field / 20000 ) % 10 ); |
| 262 | manchester_data[ 1 ] = ( ( ( laser_disc_field / 2000 ) % 10 ) << 4 ) | ( ( laser_disc_field / 200 ) % 10 ); |
| 263 | manchester_data[ 2 ] = ( ( ( laser_disc_field / 20 ) % 10 ) << 4 ) | ( ( laser_disc_field / 2 ) % 10 ); |
| 264 | manchester_data[ 3 ] = 0xff; |
| 265 | manchester_data[ 4 ] = 0xff; |
| 266 | manchester_data[ 5 ] = 0xff; |
| 267 | manchester_offset = 0; |
| 268 | cpunum_set_input_line( Machine, 0, M6809_FIRQ_LINE, ASSERT_LINE ); |
| 269 | dav = 0; /* buffer contains info */ |
| 270 | |
| 271 | laser_disc_field += laser_disc_speed; |
| 272 | } |
| 273 | } |
| 274 | |
| 275 | |
| 276 | |
| 277 | static unsigned char *tileram; |
| 278 | static size_t tileram_size; |
| 279 | static unsigned char *tile_palette; |
| 280 | static unsigned char *sprite_palette; |
| 281 | static const device_config *nvram_1c; |
| 282 | static const device_config *nvram_1d; |
| 283 | |
| 284 | static int control_num; |
| 285 | static UINT8 sound_to_main_flag; |
| 286 | static UINT8 main_to_sound_flag; |
| 287 | static int sprite_bank; |
| 288 | |
| 289 | /************************************* |
| 290 | * |
| 291 | * Video |
| 292 | * |
| 293 | *************************************/ |
| 294 | |
| 295 | static void draw_sprites( bitmap_t *bitmap, int priority, const rectangle *visarea ) |
| 296 | { |
| 297 | int sprite; |
| 298 | |
| 299 | for( sprite = 0; sprite < 32; sprite++ ) |
| 300 | { |
| 301 | UINT8 *sprite_data = spriteram + ( 0x200 * sprite_bank ) + ( sprite * 16 ); |
| 302 | int flags = sprite_data[ 0 ]; |
| 303 | int y = sprite_data[ 1 ] + ( 256 * ( ( flags >> 0 ) & 1 ) ); |
| 304 | int x = sprite_data[ 2 ] + ( 256 * ( ( flags >> 1 ) & 1 ) ); |
| 305 | |
| 306 | if( x != 0 ) |
| 307 | { |
| 308 | int row; |
| 309 | |
| 310 | for( row = 0; row < 8; row++ ) |
| 311 | { |
| 312 | int code = sprite_data[ 15 - row ] + ( 256 * ( ( flags >> 6 ) & 3 ) ); |
| 313 | int color = 2 * ( ( flags >> 2 ) & 0x03 ); |
| 314 | int flipx = flags & 0x20; |
| 315 | int flipy = flags & 0x10; |
| 316 | |
| 317 | if( ( flags & 1 ) == priority ) |
| 318 | { |
| 319 | drawgfx( bitmap, Machine->gfx[ 1 ], code, color, flipx, flipy, x + 16, 500 - y - ( row * 16 ), visarea, TRANSPARENCY_PEN, 0 ); |
| 320 | } |
| 321 | } |
| 322 | } |
| 323 | } |
| 324 | |
| 325 | } |
| 326 | |
| 327 | VIDEO_UPDATE( firefox ) |
| 328 | { |
| 329 | int x; |
| 330 | int y; |
| 331 | const rectangle *visarea = video_screen_get_visible_area( Machine->primary_screen ); |
| 332 | |
| 333 | fillbitmap( bitmap, 256, visarea ); |
| 334 | |
| 335 | draw_sprites( bitmap, 1, visarea ); |
| 336 | |
| 337 | for( y = 0; y < 64; y++ ) |
| 338 | { |
| 339 | for( x = 0; x < 64; x++ ) |
| 340 | { |
| 341 | drawgfx( bitmap, Machine->gfx[ 0 ], tileram[ x + ( y * 64 ) ], 0, 0, 0, x * 8, y * 8, visarea, TRANSPARENCY_PEN, 0 ); |
| 342 | } |
| 343 | } |
| 344 | |
| 345 | draw_sprites( bitmap, 0, visarea ); |
| 346 | |
| 347 | return 0; |
| 348 | } |
| 349 | |
| 350 | static TIMER_DEVICE_CALLBACK( video_timer_callback ) |
| 351 | { |
| 352 | video_screen_update_now(timer->machine->primary_screen); |
| 353 | |
| 354 | cpunum_set_input_line( Machine, 0, M6809_IRQ_LINE, ASSERT_LINE ); |
| 355 | } |
| 356 | |
| 357 | static void set_rgba( int start, int index, unsigned char *palette_ram ) |
| 358 | { |
| 359 | int r = palette_ram[ index ]; |
| 360 | int g = palette_ram[ index + 256 ]; |
| 361 | int b = palette_ram[ index + 512 ]; |
| 362 | int a = ( b & 3 ) * 0x55; |
| 363 | |
| 364 | palette_set_color( Machine, start + index, MAKE_RGB( r, g, b ) ); |
| 365 | render_container_set_palette_alpha(render_container_get_screen(Machine->primary_screen), start + index, a); |
| 366 | } |
| 367 | |
| 368 | static WRITE8_HANDLER( tile_palette_w ) |
| 369 | { |
| 370 | tile_palette[ offset ] = data; |
| 371 | set_rgba( 0, offset & 0xff, tile_palette ); |
| 372 | } |
| 373 | |
| 374 | static WRITE8_HANDLER( sprite_palette_w ) |
| 375 | { |
| 376 | sprite_palette[ offset ] = data; |
| 377 | set_rgba( 256, offset & 0xff, sprite_palette ); |
| 378 | } |
| 379 | |
| 380 | WRITE8_HANDLER( firefox_objram_bank_w ) |
| 381 | { |
| 382 | sprite_bank = data & 0x03; |
| 383 | } |
| 384 | |
| 385 | |
| 386 | |
| 387 | /************************************* |
| 388 | * |
| 389 | * Main <-> sound communication |
| 390 | * |
| 391 | *************************************/ |
| 392 | |
| 393 | static CUSTOM_INPUT( mainflag_r ) |
| 394 | { |
| 395 | return main_to_sound_flag; |
| 396 | } |
| 397 | |
| 398 | static CUSTOM_INPUT( soundflag_r ) |
| 399 | { |
| 400 | return sound_to_main_flag; |
| 401 | } |
| 402 | |
| 403 | static READ8_HANDLER( sound_to_main_r ) |
| 404 | { |
| 405 | sound_to_main_flag = 0; |
| 406 | return soundlatch2_r(machine, 0); |
| 407 | } |
| 408 | |
| 409 | static WRITE8_HANDLER( main_to_sound_w ) |
| 410 | { |
| 411 | main_to_sound_flag = 1; |
| 412 | soundlatch_w(Machine, 0, data); |
| 413 | cputag_set_input_line(Machine, "audio", INPUT_LINE_NMI, PULSE_LINE); |
| 414 | } |
| 415 | |
| 416 | static WRITE8_HANDLER( sound_reset_w ) |
| 417 | { |
| 418 | cputag_set_input_line(machine, "audio", INPUT_LINE_RESET, (data & 0x80) ? ASSERT_LINE : CLEAR_LINE); |
| 419 | if ((data & 0x80) != 0) |
| 420 | sound_to_main_flag = main_to_sound_flag = 0; |
| 421 | } |
| 422 | |
| 423 | static READ8_HANDLER( main_to_sound_r ) |
| 424 | { |
| 425 | main_to_sound_flag = 0; |
| 426 | return soundlatch_r(Machine, 0); |
| 427 | } |
| 428 | |
| 429 | static WRITE8_HANDLER( sound_to_main_w ) |
| 430 | { |
| 431 | sound_to_main_flag = 1; |
| 432 | soundlatch2_w(Machine, 0, data); |
| 433 | } |
| 434 | |
| 435 | |
| 436 | |
| 437 | /************************************* |
| 438 | * |
| 439 | * 6532 RIOT handlers |
| 440 | * |
| 441 | *************************************/ |
| 442 | |
| 443 | static UINT8 riot_porta_r(const device_config *device, UINT8 olddata) |
| 444 | { |
| 445 | /* bit 7 = MAINFLAG */ |
| 446 | /* bit 6 = SOUNDFLAG */ |
| 447 | /* bit 5 = PA5 */ |
| 448 | /* bit 4 = TEST */ |
| 449 | /* bit 3 = n/c */ |
| 450 | /* bit 2 = TMS /ready */ |
| 451 | /* bit 1 = TMS /read */ |
| 452 | /* bit 0 = TMS /write */ |
| 453 | |
| 454 | return (main_to_sound_flag << 7) | (sound_to_main_flag << 6) | 0x10 | (!tms5220_ready_r() << 2); |
| 455 | } |
| 456 | |
| 457 | |
| 458 | static void riot_porta_w(const device_config *device, UINT8 newdata, UINT8 olddata) |
| 459 | { |
| 460 | /* handle 5220 read */ |
| 461 | if ((olddata & 2) != 0 && (newdata & 2) == 0) |
| 462 | riot6532_portb_in_set(device, tms5220_status_r(device->machine, 0), 0xff); |
| 463 | |
| 464 | /* handle 5220 write */ |
| 465 | if ((olddata & 1) != 0 && (newdata & 1) == 0) |
| 466 | tms5220_data_w(device->machine, 0, riot6532_portb_out_get(device)); |
| 467 | } |
| 468 | |
| 469 | |
| 470 | static void riot_irq(const device_config *device, int state) |
| 471 | { |
| 472 | cputag_set_input_line(device->machine, "audio", M6502_IRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); |
| 473 | } |
| 474 | |
| 475 | |
| 476 | |
| 477 | /************************************* |
| 478 | * |
| 479 | * ADC input and control |
| 480 | * |
| 481 | *************************************/ |
| 482 | |
| 483 | static READ8_HANDLER( adc_r ) |
| 484 | { |
| 485 | if( control_num == 0 ) |
| 486 | { |
| 487 | return input_port_read( Machine, "PITCH" ); |
| 488 | } |
| 489 | |
| 490 | return input_port_read( Machine, "YAW" ); |
| 491 | } |
| 492 | |
| 493 | static WRITE8_HANDLER( adc_select_w ) |
| 494 | { |
| 495 | control_num = offset; |
| 496 | } |
| 497 | |
| 498 | |
| 499 | |
| 500 | /************************************* |
| 501 | * |
| 502 | * Non-Volatile RAM (NOVRAM) |
| 503 | * |
| 504 | *************************************/ |
| 505 | |
| 506 | static WRITE8_HANDLER( nvram_w ) |
| 507 | { |
| 508 | x2212_write( nvram_1c, offset, data >> 4 ); |
| 509 | x2212_write( nvram_1d, offset, data & 0xf ); |
| 510 | } |
| 511 | |
| 512 | static READ8_HANDLER( nvram_r ) |
| 513 | { |
| 514 | return ( x2212_read( nvram_1c, offset ) << 4 ) | x2212_read( nvram_1d, offset ); |
| 515 | } |
| 516 | |
| 517 | static WRITE8_HANDLER( novram_recall_w ) |
| 518 | { |
| 519 | x2212_array_recall( nvram_1c, ( data >> 7 ) & 1 ); |
| 520 | x2212_array_recall( nvram_1d, ( data >> 7 ) & 1 ); |
| 521 | } |
| 522 | |
| 523 | static WRITE8_HANDLER( novram_store_w ) |
| 524 | { |
| 525 | x2212_store( nvram_1c, ( data >> 7 ) & 1 ); |
| 526 | x2212_store( nvram_1d, ( data >> 7 ) & 1 ); |
| 527 | } |
| 528 | |
| 529 | |
| 530 | |
| 531 | /************************************* |
| 532 | * |
| 533 | * Main cpu |
| 534 | * |
| 535 | *************************************/ |
| 536 | |
| 537 | WRITE8_HANDLER( rom_bank_w ) |
| 538 | { |
| 539 | memory_set_bank(1, data & 0x1f); |
| 540 | } |
| 541 | |
| 542 | static WRITE8_HANDLER( main_irq_clear_w ) |
| 543 | { |
| 544 | cpunum_set_input_line( machine, 0, M6809_IRQ_LINE, CLEAR_LINE ); |
| 545 | } |
| 546 | |
| 547 | static WRITE8_HANDLER( main_firq_clear_w ) |
| 548 | { |
| 549 | cpunum_set_input_line( machine, 0, M6809_FIRQ_LINE, CLEAR_LINE ); |
| 550 | } |
| 551 | |
| 552 | WRITE8_HANDLER( self_reset_w ) |
| 553 | { |
| 554 | cpunum_set_input_line( Machine, 0, INPUT_LINE_RESET, PULSE_LINE ); |
| 555 | } |
| 556 | |
| 557 | |
| 558 | |
| 559 | /************************************* |
| 560 | * |
| 561 | * I/O |
| 562 | * |
| 563 | *************************************/ |
| 564 | |
| 565 | WRITE8_HANDLER( led_w ) |
| 566 | { |
| 567 | if( ( data & 0x80 ) != 0 ) |
| 568 | { |
| 569 | set_led_status( offset, 0 ); |
| 570 | } |
| 571 | else |
| 572 | { |
| 573 | set_led_status( offset, 1 ); |
| 574 | } |
| 575 | } |
| 576 | |
| 577 | WRITE8_HANDLER( firefox_coin_counter_w ) |
| 578 | { |
| 579 | coin_counter_w( offset, data & 0x80 ); |
| 580 | } |
| 581 | |
| 582 | |
| 583 | |
| 584 | MACHINE_START( firefox ) |
| 585 | { |
| 586 | memory_configure_bank(1, 0, 32, memory_region(machine, "main") + 0x10000, 0x1000); |
| 587 | nvram_1c = device_list_find_by_tag(machine->config->devicelist, X2212, "nvram_1c"); |
| 588 | nvram_1d = device_list_find_by_tag(machine->config->devicelist, X2212, "nvram_1d"); |
| 589 | |
| 590 | control_num = 0; |
| 591 | sprite_bank = 0; |
| 592 | |
| 593 | command_data[ 0 ] = 0; |
| 594 | command_data[ 1 ] = 0; |
| 595 | command_data[ 2 ] = 0; |
| 596 | command_offset = 0; |
| 597 | |
| 598 | laser_disc_field = 0; |
| 599 | laser_disc_speed = 0; |
| 600 | manchester_offset = 6; |
| 601 | } |
| 602 | |
| 603 | |
| 604 | /************************************* |
| 605 | * |
| 606 | * Main CPU memory handlers |
| 607 | * |
| 608 | *************************************/ |
| 609 | |
| 610 | static ADDRESS_MAP_START( main_map , ADDRESS_SPACE_PROGRAM, 8) |
| 611 | AM_RANGE(0x0000, 0x0fff) AM_RAM |
| 612 | AM_RANGE(0x1000, 0x1fff) AM_RAM AM_BASE(&tileram) AM_SIZE(&tileram_size) |
| 613 | AM_RANGE(0x2000, 0x27ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 614 | AM_RANGE(0x2800, 0x2aff) AM_READWRITE(SMH_RAM, sprite_palette_w) AM_BASE(&sprite_palette) |
| 615 | AM_RANGE(0x2b00, 0x2b00) AM_WRITE(firefox_objram_bank_w) |
| 616 | AM_RANGE(0x2b01, 0x2bff) AM_RAM |
| 617 | AM_RANGE(0x2c00, 0x2eff) AM_READWRITE(SMH_RAM, tile_palette_w) AM_BASE(&tile_palette) |
| 618 | AM_RANGE(0x2f00, 0x2fff) AM_RAM |
| 619 | AM_RANGE(0x3000, 0x3fff) AM_ROMBANK(1) |
| 620 | AM_RANGE(0x4000, 0x40ff) AM_READWRITE(nvram_r, nvram_w) |
| 621 | AM_RANGE(0x4100, 0x4100) AM_READ_PORT("IN0") |
| 622 | AM_RANGE(0x4101, 0x4101) AM_READ_PORT("IN1") |
| 623 | AM_RANGE(0x4102, 0x4102) AM_READ(firefox_disc_status_r) |
| 624 | AM_RANGE(0x4103, 0x4103) AM_READ_PORT("IN3") |
| 625 | AM_RANGE(0x4104, 0x4104) AM_READ_PORT("IN4") |
| 626 | AM_RANGE(0x4105, 0x4105) AM_READ(firefox_disc_data_r) |
| 627 | AM_RANGE(0x4106, 0x4106) AM_READ(sound_to_main_r) |
| 628 | AM_RANGE(0x4107, 0x4107) AM_READ(adc_r) |
| 629 | AM_RANGE(0x4200, 0x4200) AM_WRITE(main_irq_clear_w) |
| 630 | AM_RANGE(0x4208, 0x4208) AM_WRITE(main_firq_clear_w) |
| 631 | AM_RANGE(0x4210, 0x4210) AM_WRITE(watchdog_reset_w) |
| 632 | AM_RANGE(0x4218, 0x4218) AM_WRITE(firefox_disc_read_w) |
| 633 | AM_RANGE(0x4220, 0x4221) AM_WRITE(adc_select_w) |
| 634 | AM_RANGE(0x4230, 0x4230) AM_WRITE(self_reset_w) |
| 635 | AM_RANGE(0x4280, 0x4280) AM_WRITE(novram_recall_w) |
| 636 | AM_RANGE(0x4281, 0x4281) AM_WRITE(sound_reset_w) |
| 637 | AM_RANGE(0x4282, 0x4282) AM_WRITE(novram_store_w) |
| 638 | AM_RANGE(0x4283, 0x4283) AM_WRITE(firefox_disc_lock_w) |
| 639 | AM_RANGE(0x4284, 0x4284) AM_WRITE(firefox_disc_right_audio_enable_w) |
| 640 | AM_RANGE(0x4285, 0x4285) AM_WRITE(firefox_disc_left_audio_enable_w) |
| 641 | AM_RANGE(0x4286, 0x4286) AM_WRITE(firefox_disc_reset_w) |
| 642 | AM_RANGE(0x4287, 0x4287) AM_WRITE(firefox_disc_write_w) |
| 643 | AM_RANGE(0x4288, 0x4289) AM_WRITE(firefox_coin_counter_w) |
| 644 | AM_RANGE(0x428c, 0x428f) AM_WRITE(led_w) |
| 645 | AM_RANGE(0x4290, 0x4290) AM_WRITE(rom_bank_w) |
| 646 | AM_RANGE(0x4298, 0x4298) AM_WRITE(main_to_sound_w) |
| 647 | AM_RANGE(0x42a0, 0x42a7) AM_WRITE(firefox_disc_data_w) |
| 648 | AM_RANGE(0x4400, 0xffff) AM_ROM |
| 649 | ADDRESS_MAP_END |
| 650 | |
| 651 | |
| 652 | |
| 653 | /************************************* |
| 654 | * |
| 655 | * Sound CPU memory handlers |
| 656 | * |
| 657 | *************************************/ |
| 658 | |
| 659 | static ADDRESS_MAP_START(audio_map, ADDRESS_SPACE_PROGRAM, 8) |
| 660 | AM_RANGE(0x0000, 0x07ff) AM_RAM |
| 661 | AM_RANGE(0x0800, 0x087f) AM_MIRROR(0x0700) AM_RAM /* RIOT ram */ |
| 662 | AM_RANGE(0x0880, 0x089f) AM_MIRROR(0x07e0) AM_DEVREADWRITE(RIOT6532,"riot",riot6532_r, riot6532_w) |
| 663 | AM_RANGE(0x1000, 0x1000) AM_READ(main_to_sound_r) |
| 664 | AM_RANGE(0x1800, 0x1800) AM_WRITE(sound_to_main_w) |
| 665 | AM_RANGE(0x2000, 0x200f) AM_READWRITE(pokey1_r, pokey1_w) |
| 666 | AM_RANGE(0x2800, 0x280f) AM_READWRITE(pokey2_r, pokey2_w) |
| 667 | AM_RANGE(0x3000, 0x300f) AM_READWRITE(pokey3_r, pokey3_w) |
| 668 | AM_RANGE(0x3800, 0x380f) AM_READWRITE(pokey4_r, pokey4_w) |
| 669 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| 670 | ADDRESS_MAP_END |
| 671 | |
| 672 | |
| 673 | |
| 674 | /************************************* |
| 675 | * |
| 676 | * Port definitions |
| 677 | * |
| 678 | *************************************/ |
| 679 | |
| 680 | INPUT_PORTS_START( firefox ) |
| 681 | PORT_START("IN0") |
| 682 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 683 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) |
| 684 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) |
| 685 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) |
| 686 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_TILT ) |
| 687 | PORT_SERVICE( 0x04, IP_ACTIVE_LOW ) |
| 688 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 689 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 690 | |
| 691 | PORT_START("IN1") |
| 692 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(mainflag_r, NULL) |
| 693 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(soundflag_r, NULL) |
| 694 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_VBLANK ) |
| 695 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) |
| 696 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 697 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 698 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 699 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 700 | |
| 701 | PORT_START("IN3") |
| 702 | PORT_DIPNAME( 0x03, 0x00, "Coins Per Credit" ) |
| 703 | PORT_DIPSETTING( 0x00, "1 Coin 1 Credit" ) |
| 704 | PORT_DIPSETTING( 0x01, "2 Coins 1 Credit" ) |
| 705 | PORT_DIPSETTING( 0x02, "3 Coins 1 Credit" ) |
| 706 | PORT_DIPSETTING( 0x03, "4 Coins 1 Credit" ) |
| 707 | PORT_DIPNAME( 0x0c, 0x00, "Right Coin" ) |
| 708 | PORT_DIPSETTING( 0x00, "1 Coin for 1 Coin Unit" ) |
| 709 | PORT_DIPSETTING( 0x04, "1 Coin for 4 Coin Units" ) |
| 710 | PORT_DIPSETTING( 0x08, "1 Coin for 5 Coin Units" ) |
| 711 | PORT_DIPSETTING( 0x0c, "1 Coin for 6 Coin Units" ) |
| 712 | PORT_DIPNAME( 0x10, 0x00, "Left Coin" ) |
| 713 | PORT_DIPSETTING( 0x00, "1 Coin for 1 Coin Unit" ) |
| 714 | PORT_DIPSETTING( 0x10, "1 Coin for 2 Coin Units" ) |
| 715 | PORT_DIPNAME( 0xe0, 0x00, "Bonus Adder" ) |
| 716 | PORT_DIPSETTING( 0x00, DEF_STR( None ) ) |
| 717 | PORT_DIPSETTING( 0x20, "1 Credit for 2 Coin Units" ) |
| 718 | PORT_DIPSETTING( 0xa0, "1 Credit for 3 Coin Units" ) |
| 719 | PORT_DIPSETTING( 0x40, "1 Credit for 4 Coin Units" ) |
| 720 | PORT_DIPSETTING( 0x80, "1 Credit for 5 Coin Units" ) |
| 721 | PORT_DIPSETTING( 0x60, "2 Credits for 4 Coin Units" ) |
| 722 | PORT_DIPSETTING( 0xe0, DEF_STR( Free_Play ) ) |
| 723 | |
| 724 | PORT_START("IN4") |
| 725 | PORT_DIPNAME( 0x01, 0x00, "Missions" ) |
| 726 | PORT_DIPSETTING( 0x00, "All .50" ) |
| 727 | PORT_DIPSETTING( 0x01, ".50 .75" ) |
| 728 | PORT_DIPNAME( 0x06, 0x00, DEF_STR( Difficulty ) ) |
| 729 | PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) |
| 730 | PORT_DIPSETTING( 0x02, "Moderate" ) |
| 731 | PORT_DIPSETTING( 0x04, DEF_STR( Hard ) ) |
| 732 | PORT_DIPSETTING( 0x06, DEF_STR( Hardest ) ) |
| 733 | PORT_DIPNAME( 0x18, 0x00, "Gas Usage" ) |
| 734 | PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) |
| 735 | PORT_DIPSETTING( 0x08, "Moderate" ) |
| 736 | PORT_DIPSETTING( 0x10, DEF_STR( Hard ) ) |
| 737 | PORT_DIPSETTING( 0x18, DEF_STR( Hardest ) ) |
| 738 | PORT_DIPNAME( 0x60, 0x00, "Bonus Gas" ) |
| 739 | PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) |
| 740 | PORT_DIPSETTING( 0x20, "Moderate" ) |
| 741 | PORT_DIPSETTING( 0x40, DEF_STR( Hard ) ) |
| 742 | PORT_DIPSETTING( 0x60, DEF_STR( Hardest ) ) |
| 743 | PORT_DIPNAME( 0x80, 0x00, "Pro Limit" ) |
| 744 | PORT_DIPSETTING( 0x00, "Moderate" ) |
| 745 | PORT_DIPSETTING( 0x80, DEF_STR( Hardest ) ) |
| 746 | |
| 747 | PORT_START("PITCH") |
| 748 | PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(70) PORT_KEYDELTA(30) |
| 749 | |
| 750 | PORT_START("YAW") |
| 751 | PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(50) PORT_KEYDELTA(30) |
| 752 | INPUT_PORTS_END |
| 753 | |
| 754 | |
| 755 | |
| 756 | /************************************* |
| 757 | * |
| 758 | * Graphics definitions |
| 759 | * |
| 760 | *************************************/ |
| 761 | |
| 762 | static const gfx_layout tilelayout = |
| 763 | { |
| 764 | 8,8, |
| 765 | RGN_FRAC(1,1), |
| 766 | 4, |
| 767 | { STEP4(0,1) }, |
| 768 | { STEP8(0,4) }, |
| 769 | { STEP8(0,32) }, |
| 770 | 32*8 |
| 771 | }; |
| 772 | |
| 773 | static const gfx_layout spritelayout = |
| 774 | { |
| 775 | 16,16, |
| 776 | RGN_FRAC(1,5), |
| 777 | 5, |
| 778 | { RGN_FRAC(0,5), RGN_FRAC(1,5), RGN_FRAC(2,5), RGN_FRAC(3,5), RGN_FRAC(4,5) }, |
| 779 | { STEP16(0,1) }, |
| 780 | { STEP16(0,16) }, |
| 781 | 32*8 |
| 782 | }; |
| 783 | |
| 784 | static GFXDECODE_START( firefox ) |
| 785 | GFXDECODE_ENTRY("tiles", 0, tilelayout, 0, 16) |
| 786 | GFXDECODE_ENTRY("sprites", 0, spritelayout, 256, 32) |
| 787 | GFXDECODE_END |
| 788 | |
| 789 | |
| 790 | |
| 791 | /************************************* |
| 792 | * |
| 793 | * Machine driver |
| 794 | * |
| 795 | *************************************/ |
| 796 | |
| 797 | static const riot6532_interface riot_intf = |
| 798 | { |
| 799 | riot_porta_r, |
| 800 | NULL, |
| 801 | riot_porta_w, |
| 802 | NULL, |
| 803 | riot_irq |
| 804 | }; |
| 805 | |
| 806 | |
| 807 | static MACHINE_DRIVER_START( firefox ) |
| 808 | |
| 809 | /* basic machine hardware */ |
| 810 | MDRV_CPU_ADD("main", M6809, 4000000) |
| 811 | MDRV_CPU_PROGRAM_MAP(main_map, 0) |
| 812 | MDRV_TIMER_ADD_SCANLINE("32v", video_timer_callback, "main", 96, 128) |
| 813 | |
| 814 | MDRV_CPU_ADD("audio", M6502, 2000000) |
| 815 | MDRV_CPU_PROGRAM_MAP(audio_map, 0) |
| 816 | |
| 817 | MDRV_MACHINE_START(firefox) |
| 818 | |
| 819 | /* video hardware */ |
| 820 | MDRV_LASERDISC_SCREEN_ADD_NTSC("main", BITMAP_FORMAT_INDEXED16) |
| 821 | |
| 822 | MDRV_GFXDECODE(firefox) |
| 823 | MDRV_PALETTE_LENGTH(512) |
| 824 | |
| 825 | MDRV_LASERDISC_ADD("laserdisc", PIONEER_PR8210, "main", "ldsound") |
| 826 | MDRV_LASERDISC_OVERLAY(firefox, 64*8, 64*8, BITMAP_FORMAT_INDEXED16) |
| 827 | MDRV_LASERDISC_OVERLAY_CLIP(7*8, 53*8-1, 1*8, 62*8-1) |
| 828 | MDRV_TIMER_ADD_SCANLINE("laserdisk", laserdisk_timer_callback, "main", 0, 0) |
| 829 | |
| 830 | MDRV_DEVICE_ADD("nvram_1c",X2212) |
| 831 | MDRV_DEVICE_ADD("nvram_1d",X2212) |
| 832 | MDRV_RIOT6532_ADD("riot", 1500000, riot_intf) |
| 833 | |
| 834 | /* sound hardware */ |
| 835 | MDRV_SPEAKER_STANDARD_STEREO("left", "right") |
| 836 | |
| 837 | MDRV_SOUND_ADD("pokey1", POKEY, 1500000) |
| 838 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.20) |
| 839 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.20) |
| 840 | |
| 841 | MDRV_SOUND_ADD("pokey2", POKEY, 1500000) |
| 842 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.20) |
| 843 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.20) |
| 844 | |
| 845 | MDRV_SOUND_ADD("pokey3", POKEY, 1500000) |
| 846 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.20) |
| 847 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.20) |
| 848 | |
| 849 | MDRV_SOUND_ADD("pokey4", POKEY, 1500000) |
| 850 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.20) |
| 851 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.20) |
| 852 | |
| 853 | MDRV_SOUND_ADD("tms", TMS5220, 640000) |
| 854 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.50) |
| 855 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.50) |
| 856 | |
| 857 | MDRV_SOUND_ADD("ldsound", CUSTOM, 0) |
| 858 | MDRV_SOUND_CONFIG(laserdisc_custom_interface) |
| 859 | MDRV_SOUND_ROUTE(0, "left", 1.0) |
| 860 | MDRV_SOUND_ROUTE(1, "right", 1.0) |
| 861 | |
| 862 | MACHINE_DRIVER_END |
| 863 | |
| 864 | |
| 865 | |
| 866 | /************************************* |
| 867 | * |
| 868 | * ROM definitions |
| 869 | * |
| 870 | *************************************/ |
| 871 | |
| 872 | ROM_START( firefox ) |
| 873 | ROM_REGION( 0x30000, "main", 0 ) /* 64k for code + data & 128k for banked roms */ |
| 874 | ROM_LOAD( "136026.209", 0x04000, 0x4000, CRC(9f559f1b) SHA1(142d14cb5158ea77f6fc6d9bf0ce723842f345e2) ) /* 8b/c */ |
| 875 | ROM_LOAD( "136026.210", 0x08000, 0x4000, CRC(d769b40d) SHA1(2d354649a381f3399cb0161267bd1c36a8f2bb4b) ) /* 7b/c */ |
| 876 | ROM_LOAD( "136026.211", 0x0c000, 0x4000, CRC(7293ab03) SHA1(73d0d173da295ad59e431bab0a9814a71146cbc2) ) /* 6b/c */ |
| 877 | ROM_LOAD( "136026.201", 0x10000, 0x4000, CRC(c118547a) SHA1(4d3502cbde3116588ed944bf1750bab50e4c813c) ) /* 8a */ |
| 878 | /* empty 7a */ |
| 879 | /* empty 6a */ |
| 880 | /* empty 5a */ |
| 881 | ROM_LOAD( "136026.205", 0x20000, 0x4000, CRC(dc21677f) SHA1(576a96c1e07e1362a0a367e76dc369ee8a950144) ) /* 4a */ |
| 882 | ROM_LOAD( "136026.127", 0x24000, 0x2000, CRC(c0c765ab) SHA1(79f6c8c1d00684d7143b2d33a5669bdf5cd01e96) ) /* 3a */ |
| 883 | ROM_RELOAD( 0x26000, 0x2000 ) |
| 884 | /* empty 2a */ |
| 885 | /* empty 1a */ |
| 886 | |
| 887 | ROM_REGION( 0x10000, "audio", 0 ) /* 64k for code */ |
| 888 | /* empty 4k/l */ |
| 889 | ROM_LOAD( "136026.128", 0x08000, 0x2000, CRC(5358d870) SHA1(e8f2983a7e612e1a050a3c0b9f19b1077de4c146) ) /* 4m */ |
| 890 | ROM_RELOAD( 0x0a000, 0x2000 ) |
| 891 | ROM_LOAD( "136026.214", 0x0c000, 0x4000, CRC(92378b78) SHA1(62c7a1fee675fa3f9125f8e208b8207f0ce28bbe) ) /* 4n */ |
| 892 | |
| 893 | ROM_REGION( 0x2000, "tiles", ROMREGION_DISPOSE ) |
| 894 | ROM_LOAD( "136026.125", 0x0000, 0x2000, CRC(8a32f9f1) SHA1(f899174f55cd4a24a3be4a0f4bb44d3e8e938586) ) /* 6p */ |
| 895 | |
| 896 | ROM_REGION( 0x28000, "sprites", ROMREGION_DISPOSE ) |
| 897 | /* empty 6c */ |
| 898 | /* empty 6a */ |
| 899 | ROM_LOAD( "136026.124", 0x00000, 0x4000, CRC(5efe0f6c) SHA1(df35fd9267d966ab379c2f78ed418f4606741b28)) /* 5c */ |
| 900 | ROM_LOAD( "136026.123", 0x04000, 0x4000, CRC(dffe48b3) SHA1(559907651bb425e26a834b467959b15092d23d27)) /* 5a */ |
| 901 | ROM_LOAD( "136026.118", 0x08000, 0x4000, CRC(0ed4df15) SHA1(7aa599f428112fff4bfedf63fafc22f19fa66546)) /* 4c */ |
| 902 | ROM_LOAD( "136026.122", 0x0c000, 0x4000, CRC(8e2c6616) SHA1(59cbd585028bb634034a9dfd552275bd41f01989)) /* 4a */ |
| 903 | ROM_LOAD( "136026.117", 0x10000, 0x4000, CRC(79129084) SHA1(4219ff7cd444ad11e4cb9f1c30ac15fe0cfc5a17)) /* 3c */ |
| 904 | ROM_LOAD( "136026.121", 0x14000, 0x4000, CRC(494972d4) SHA1(fa0e24e911b233e9644d7794ba03f76bfd39aa8c)) /* 3a */ |
| 905 | ROM_LOAD( "136026.116", 0x18000, 0x4000, CRC(d5282d4e) SHA1(de5fdf82a615625aa77b39e035b4206216faaf9c)) /* 2c */ |
| 906 | ROM_LOAD( "136026.120", 0x1c000, 0x4000, CRC(e1b95923) SHA1(b6d0c0af0a8f55e728cd0f4c3222745eefd57f50)) /* 2a */ |
| 907 | ROM_LOAD( "136026.115", 0x20000, 0x4000, CRC(861abc82) SHA1(1845888d07162ae915364a2a91294731f1c5b3bd)) /* 1c */ |
| 908 | ROM_LOAD( "136026.119", 0x24000, 0x4000, CRC(959471b1) SHA1(a032209a209f51d34360d5c7ad32ec62150158d2)) /* 1a */ |
| 909 | ROM_END |
| 910 | |
| 911 | ROM_START( firefoxa ) |
| 912 | ROM_REGION( 0x30000, "main", 0 ) /* 64k for code + data & 128k for banked roms */ |
| 913 | ROM_LOAD( "136026.109", 0x04000, 0x4000, CRC(7639270c) SHA1(1b8f53c516d26aecb4478ac99783a37e5b1a107f)) /* 8b/c */ |
| 914 | ROM_LOAD( "136026.110", 0x08000, 0x4000, CRC(f3102944) SHA1(460f18180b19b6360c99c7e70f86d745f69ba95d)) /* 7b/c */ |
| 915 | ROM_LOAD( "136026.111", 0x0c000, 0x4000, CRC(8a230bb5) SHA1(0cfa1e981e4a8ccaf5903b4e761a2085b5a56181)) /* 6b/c */ |
| 916 | ROM_LOAD( "136026.101", 0x10000, 0x4000, CRC(91bba45a) SHA1(d584a8f60bbbdbe250978b7aeb3f5e7698f94d60)) /* 8a */ |
| 917 | ROM_LOAD( "136026.102", 0x14000, 0x4000, CRC(5f1e423d) SHA1(c55c27600877272c1ca94eab75c1eb25ff84d36f)) /* 7a */ |
| 918 | /* empty 6a */ |
| 919 | /* empty 5a */ |
| 920 | ROM_LOAD( "136026.105", 0x20000, 0x4000, CRC(83f1d4ed) SHA1(ed4b22b3473f16cbcca1415f6d81be558ab10ff3)) /* 4a */ |
| 921 | ROM_LOAD( "136026.106", 0x24000, 0x4000, CRC(c5d8d417) SHA1(6a29595b2c091bbcf413c7213c6577eaf9c507d1)) /* 3a */ |
| 922 | /* empty 2a */ |
| 923 | /* empty 1a */ |
| 924 | |
| 925 | ROM_REGION( 0x10000, "audio", 0 ) /* 64k for code */ |
| 926 | /* empty 4k/l */ |
| 927 | ROM_LOAD( "136026.113", 0x08000, 0x4000, CRC(90988b3b) SHA1(7571cf6b7e9e3e22f930d9ba991b730e734edfb7)) /* 4m */ |
| 928 | ROM_LOAD( "136026.114", 0x0c000, 0x4000, CRC(1437ce14) SHA1(eef14172b3935a4afb3470852f93d30926b139e4)) /* 4n */ |
| 929 | |
| 930 | ROM_REGION( 0x2000, "tiles", ROMREGION_DISPOSE ) |
| 931 | ROM_LOAD( "136026.125", 0x0000, 0x2000, CRC(8a32f9f1) SHA1(f899174f55cd4a24a3be4a0f4bb44d3e8e938586) ) /* 6p */ |
| 932 | |
| 933 | ROM_REGION( 0x28000, "sprites", ROMREGION_DISPOSE ) |
| 934 | /* empty 6c */ |
| 935 | /* empty 6a */ |
| 936 | ROM_LOAD( "136026.124", 0x00000, 0x4000, CRC(5efe0f6c) SHA1(df35fd9267d966ab379c2f78ed418f4606741b28)) /* 5c */ |
| 937 | ROM_LOAD( "136026.123", 0x04000, 0x4000, CRC(dffe48b3) SHA1(559907651bb425e26a834b467959b15092d23d27)) /* 5a */ |
| 938 | ROM_LOAD( "136026.118", 0x08000, 0x4000, CRC(0ed4df15) SHA1(7aa599f428112fff4bfedf63fafc22f19fa66546)) /* 4c */ |
| 939 | ROM_LOAD( "136026.122", 0x0c000, 0x4000, CRC(8e2c6616) SHA1(59cbd585028bb634034a9dfd552275bd41f01989)) /* 4a */ |
| 940 | ROM_LOAD( "136026.117", 0x10000, 0x4000, CRC(79129084) SHA1(4219ff7cd444ad11e4cb9f1c30ac15fe0cfc5a17)) /* 3c */ |
| 941 | ROM_LOAD( "136026.121", 0x14000, 0x4000, CRC(494972d4) SHA1(fa0e24e911b233e9644d7794ba03f76bfd39aa8c)) /* 3a */ |
| 942 | ROM_LOAD( "136026.116", 0x18000, 0x4000, CRC(d5282d4e) SHA1(de5fdf82a615625aa77b39e035b4206216faaf9c)) /* 2c */ |
| 943 | ROM_LOAD( "136026.120", 0x1c000, 0x4000, CRC(e1b95923) SHA1(b6d0c0af0a8f55e728cd0f4c3222745eefd57f50)) /* 2a */ |
| 944 | ROM_LOAD( "136026.115", 0x20000, 0x4000, CRC(861abc82) SHA1(1845888d07162ae915364a2a91294731f1c5b3bd)) /* 1c */ |
| 945 | ROM_LOAD( "136026.119", 0x24000, 0x4000, CRC(959471b1) SHA1(a032209a209f51d34360d5c7ad32ec62150158d2)) /* 1a */ |
| 946 | ROM_END |
| 947 | |
| 948 | |
| 949 | |
| 950 | /************************************* |
| 951 | * |
| 952 | * Game drivers |
| 953 | * |
| 954 | *************************************/ |
| 955 | |
| 956 | GAME( 1984, firefox, 0, firefox, firefox, 0, ROT0, "Atari", "Fire Fox (set 1)", 0 ) |
| 957 | GAME( 1984, firefoxa, firefox, firefox, firefox, 0, ROT0, "Atari", "Fire Fox (set 2)", 0 ) |
src/mame/drivers/psychic5.c
| r3289 | r3290 | |
| 86 | 86 | |
| 87 | 87 | 3) MAIN CPU MEMORY MAP. |
| 88 | 88 | |
| 89 | | 0000-7fff ROM |
| 90 | | 8000-bfff paged ROM |
| 91 | | c000-dfff paged RAM (RAM/VRAM/IO) |
| 89 | 0000-7fff ROM |
| 90 | 8000-bfff paged ROM |
| 91 | c000-dfff paged RAM (RAM/VRAM/IO) |
| 92 | 92 | f000-f1ff I/O |
| 93 | 93 | f200-f7ff Sprites registers (misc RAM) |
| 94 | | f800-ffff Work RAM |
| 94 | f800-ffff Work RAM |
| 95 | 95 | |
| 96 | 96 | -paged RAM memory map |
| 97 | 97 | |
| 98 | 98 | Bank 0 |
| 99 | 99 | |
| 100 | 100 | c000-cfff Background tile buffer |
| 101 | | e000-dfff RAM (dummy background image for software collisions) |
| 101 | d000-dfff RAM (dummy background image for software collisions) |
| 102 | 102 | |
| 103 | 103 | Bank 1 |
| 104 | 104 | |
| 105 | 105 | c000-c3ff I/O |
| 106 | | c400-cbff Palette RAM |
| 107 | | d000-d800 Foreground tile buffer |
| 106 | c400-cfff Palette RAM |
| 107 | d000-dfff Foreground tile buffer |
| 108 | 108 | |
| 109 | 109 | |
| 110 | 110 | 4) I/O |
| r3289 | r3290 | |
| 153 | 153 | |
| 154 | 154 | c309 BACKGROUND SCROLL Y most significant 2 bits |
| 155 | 155 | |
| 156 | | 76543210 |
| 157 | | || |
| 158 | | |^-- Y scroll bit 8 |
| 159 | | ^--- Y scroll bit 9 |
| 156 | 76543210 |
| 157 | || |
| 158 | |^-- Y scroll bit 8 |
| 159 | ^--- Y scroll bit 9 |
| 160 | 160 | |
| 161 | 161 | c30A BACKGROUND SCROLL X least significant 8 bits |
| 162 | 162 | |
| 163 | 163 | c30B BACKGROUND SCROLL X MSB |
| 164 | 164 | |
| 165 | | 76543210 |
| 166 | | |||||||| |
| 167 | | |||||||^-- X scroll bit 8 |
| 168 | | ||||||^--- Unknown (title screen) |
| 169 | | ^^^^^^---- Unknown (title screen: 0xff) |
| 165 | 76543210 |
| 166 | |||||||| |
| 167 | |||||||^-- X scroll bit 8 |
| 168 | ||||||^--- Unknown (title screen) |
| 169 | ^^^^^^---- Unknown (title screen: 0xff) |
| 170 | 170 | |
| 171 | 171 | c30C SCREEN MODE |
| 172 | 172 | |
| 173 | | 76543210 |
| 174 | | || |
| 175 | | |^-- background enable bit (0 means black BG) |
| 176 | | ^--- grey background enable bit |
| 173 | 76543210 |
| 174 | || |
| 175 | |^-- background enable bit (0 means black BG) |
| 176 | ^--- grey background enable bit |
| 177 | 177 | |
| 178 | 178 | c5fe BACKGROUND PALETTE INTENSITY (red and green) |
| 179 | 179 | |
| 180 | | 76543210 |
| 181 | | |||||||| |
| 182 | | ||||^^^^-- green intensity |
| 183 | | ^^^^------ red intensity |
| 180 | 76543210 |
| 181 | |||||||| |
| 182 | ||||^^^^-- green intensity |
| 183 | ^^^^------ red intensity |
| 184 | 184 | |
| 185 | 185 | c5ff BACKGROUND PALETTE INTENSITY (blue) |
| 186 | 186 | |
| 187 | | 76543210 |
| 188 | | |||||||| |
| 187 | 76543210 |
| 188 | |||||||| |
| 189 | 189 | ||||^^^^-- unknown (?) |
| 190 | | ^^^^------ blue intensity |
| 190 | ^^^^------ blue intensity |
| 191 | 191 | |
| 192 | 192 | -RAM f000-f1ff |
| 193 | 193 | |
| 194 | 194 | f000 SOUND COMMAND (?) |
| 195 | 195 | |
| 196 | 196 | f001 UNKNOWN |
| 197 | | maybe some external HW like a flashing light |
| 198 | | when a coin falls in slot (?) |
| 197 | maybe some external HW like a flashing light |
| 198 | when a coin falls in slot (?) |
| 199 | 199 | |
| 200 | 200 | f002 ROM PAGE SELECTOR |
| 201 | | select four (0-3) ROM pages at 8000-bfff. |
| 201 | select four (0-3) ROM pages at 8000-bfff. |
| 202 | 202 | |
| 203 | 203 | f003 VRAM PAGE SELECTOR |
| 204 | | selects two (0-1) VRAM pages at c000-dfff. |
| 204 | selects two (0-1) VRAM pages at c000-dfff. |
| 205 | 205 | |
| 206 | 206 | f004 UNKNOWN |
| 207 | 207 | |
| r3289 | r3290 | |
| 234 | 234 | Some additional palette effects are provided for background. |
| 235 | 235 | Sprite palette 15's transparent color (c5fe-c5ff) is the global |
| 236 | 236 | background intensity. |
| 237 | | Background Intensity is encoded in the same way of colors,and |
| 237 | Background intensity is encoded in the same way of colors,and |
| 238 | 238 | affects the intensity of each color component (BGR). |
| 239 | 239 | The least significant nibble of c5ff is unknown,it assumes value |
| 240 | 240 | 0xf occasionaly when the other nibbles are changed.The only |
| r3289 | r3290 | |
| 314 | 314 | #include "sound/2203intf.h" |
| 315 | 315 | |
| 316 | 316 | |
| 317 | | extern WRITE8_HANDLER( psychic5_paged_ram_w ); |
| 318 | | extern WRITE8_HANDLER( psychic5_vram_page_select_w ); |
| 319 | | extern WRITE8_HANDLER( psychic5_title_screen_w ); |
| 317 | WRITE8_HANDLER( psychic5_paged_ram_w ); |
| 318 | WRITE8_HANDLER( psychic5_vram_page_select_w ); |
| 319 | WRITE8_HANDLER( psychic5_title_screen_w ); |
| 320 | 320 | |
| 321 | | extern READ8_HANDLER( psychic5_paged_ram_r ); |
| 322 | | extern READ8_HANDLER( psychic5_vram_page_select_r ); |
| 321 | READ8_HANDLER( psychic5_paged_ram_r ); |
| 322 | READ8_HANDLER( psychic5_vram_page_select_r ); |
| 323 | 323 | |
| 324 | | extern MACHINE_RESET( psychic5 ); |
| 324 | VIDEO_START( psychic5 ); |
| 325 | VIDEO_RESET( psychic5 ); |
| 326 | VIDEO_UPDATE( psychic5 ); |
| 325 | 327 | |
| 326 | | extern VIDEO_START( psychic5 ); |
| 327 | | extern VIDEO_UPDATE( psychic5 ); |
| 328 | 328 | |
| 329 | | static int psychic5_bank_latch = 0x0; |
| 329 | extern UINT8 *bombsa_paletteram; |
| 330 | WRITE8_HANDLER( bombsa_paged_ram_w ); |
| 331 | WRITE8_HANDLER( bombsa_unknown_w ); |
| 330 | 332 | |
| 333 | VIDEO_START( bombsa ); |
| 334 | VIDEO_RESET( bombsa ); |
| 335 | VIDEO_UPDATE( bombsa ); |
| 331 | 336 | |
| 337 | |
| 338 | static UINT8 psychic5_bank_latch; |
| 339 | |
| 340 | static MACHINE_RESET( psychic5 ) |
| 341 | { |
| 342 | psychic5_bank_latch = 0xff; |
| 343 | flip_screen_set(0); |
| 344 | } |
| 345 | |
| 346 | /*************************************************************************** |
| 347 | |
| 348 | Interrupt(s) |
| 349 | |
| 350 | ***************************************************************************/ |
| 351 | |
| 352 | static INTERRUPT_GEN( psychic5_interrupt ) |
| 353 | { |
| 354 | if (cpu_getiloops() == 0) |
| 355 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xd7); /* RST 10h */ |
| 356 | else |
| 357 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xcf); /* RST 08h */ |
| 358 | } |
| 359 | |
| 360 | |
| 361 | /*************************************************************************** |
| 362 | |
| 363 | Memory Handler(s) |
| 364 | |
| 365 | ***************************************************************************/ |
| 366 | |
| 332 | 367 | static READ8_HANDLER( psychic5_bankselect_r ) |
| 333 | 368 | { |
| 334 | 369 | return psychic5_bank_latch; |
| r3289 | r3290 | |
| 339 | 374 | UINT8 *RAM = memory_region(machine, "main"); |
| 340 | 375 | int bankaddress; |
| 341 | 376 | |
| 342 | | if (data != psychic5_bank_latch) |
| 377 | if (psychic5_bank_latch != data) |
| 343 | 378 | { |
| 344 | 379 | psychic5_bank_latch = data; |
| 345 | 380 | bankaddress = 0x10000 + ((data & 3) * 0x4000); |
| r3289 | r3290 | |
| 347 | 382 | } |
| 348 | 383 | } |
| 349 | 384 | |
| 385 | static WRITE8_HANDLER( bombsa_bankselect_w ) |
| 386 | { |
| 387 | UINT8 *RAM = memory_region(machine, "main"); |
| 388 | int bankaddress; |
| 389 | |
| 390 | if (psychic5_bank_latch != data) |
| 391 | { |
| 392 | psychic5_bank_latch = data; |
| 393 | bankaddress = 0x10000 + ((data & 7) * 0x4000); |
| 394 | memory_set_bankptr(1, &RAM[bankaddress]); /* Select 8 banks of 16k */ |
| 395 | } |
| 396 | } |
| 397 | |
| 350 | 398 | static WRITE8_HANDLER( psychic5_coin_counter_w ) |
| 351 | 399 | { |
| 352 | 400 | coin_counter_w(0, data & 0x01); |
| r3289 | r3290 | |
| 359 | 407 | } |
| 360 | 408 | } |
| 361 | 409 | |
| 362 | | static INTERRUPT_GEN( psychic5_interrupt ) |
| 410 | static WRITE8_HANDLER( bombsa_flipscreen_w ) |
| 363 | 411 | { |
| 364 | | if (cpu_getiloops() == 0) |
| 365 | | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xd7); /* RST 10h */ |
| 366 | | else |
| 367 | | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xcf); /* RST 08h */ |
| 412 | // bit 7 toggles flip screen |
| 413 | if (data & 0x80) |
| 414 | { |
| 415 | flip_screen_set(!flip_screen_get()); |
| 416 | } |
| 368 | 417 | } |
| 369 | 418 | |
| 370 | 419 | |
| 371 | | static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 372 | | AM_RANGE(0x0000, 0x7fff) AM_READ(SMH_ROM) |
| 373 | | AM_RANGE(0x8000, 0xbfff) AM_READ(SMH_BANK1) |
| 374 | | AM_RANGE(0xc000, 0xdfff) AM_READ(psychic5_paged_ram_r) |
| 375 | | AM_RANGE(0xe000, 0xefff) AM_READ(SMH_RAM) |
| 376 | | AM_RANGE(0xf000, 0xf000) AM_READ(SMH_RAM) |
| 377 | | AM_RANGE(0xf001, 0xf001) AM_READ(SMH_NOP) // ??? |
| 378 | | AM_RANGE(0xf002, 0xf002) AM_READ(psychic5_bankselect_r) |
| 379 | | AM_RANGE(0xf003, 0xf003) AM_READ(psychic5_vram_page_select_r) |
| 380 | | AM_RANGE(0xf004, 0xf004) AM_READ(SMH_NOP) // ??? |
| 381 | | AM_RANGE(0xf005, 0xf005) AM_READ(SMH_NOP) // ??? |
| 382 | | AM_RANGE(0xf006, 0xf1ff) AM_READ(SMH_NOP) |
| 383 | | AM_RANGE(0xf200, 0xf7ff) AM_READ(SMH_RAM) |
| 384 | | AM_RANGE(0xf800, 0xffff) AM_READ(SMH_RAM) |
| 385 | | ADDRESS_MAP_END |
| 420 | /*************************************************************************** |
| 386 | 421 | |
| 387 | | static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 388 | | AM_RANGE(0x0000, 0x7fff) AM_WRITE(SMH_ROM) |
| 389 | | AM_RANGE(0x8000, 0xbfff) AM_WRITE(SMH_BANK1) |
| 390 | | AM_RANGE(0xc000, 0xdfff) AM_WRITE(psychic5_paged_ram_w) |
| 391 | | AM_RANGE(0xe000, 0xefff) AM_WRITE(SMH_RAM) |
| 392 | | AM_RANGE(0xf000, 0xf000) AM_WRITE(soundlatch_w) |
| 393 | | AM_RANGE(0xf001, 0xf001) AM_WRITE(psychic5_coin_counter_w) |
| 394 | | AM_RANGE(0xf002, 0xf002) AM_WRITE(psychic5_bankselect_w) |
| 395 | | AM_RANGE(0xf003, 0xf003) AM_WRITE(psychic5_vram_page_select_w) |
| 396 | | AM_RANGE(0xf004, 0xf004) AM_WRITE(SMH_NOP) // ??? |
| 397 | | AM_RANGE(0xf005, 0xf005) AM_WRITE(psychic5_title_screen_w) |
| 398 | | AM_RANGE(0xf006, 0xf1ff) AM_WRITE(SMH_NOP) |
| 399 | | AM_RANGE(0xf200, 0xf7ff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 400 | | AM_RANGE(0xf800, 0xffff) AM_WRITE(SMH_RAM) |
| 422 | Memory Map(s) |
| 423 | |
| 424 | ***************************************************************************/ |
| 425 | |
| 426 | static ADDRESS_MAP_START( psychic5_main_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 427 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 428 | AM_RANGE(0x8000, 0xbfff) AM_RAMBANK(1) |
| 429 | AM_RANGE(0xc000, 0xdfff) AM_READWRITE(psychic5_paged_ram_r, psychic5_paged_ram_w) |
| 430 | AM_RANGE(0xe000, 0xefff) AM_RAM |
| 431 | AM_RANGE(0xf000, 0xf000) AM_RAM_WRITE(soundlatch_w) |
| 432 | AM_RANGE(0xf001, 0xf001) AM_READWRITE(SMH_NOP, psychic5_coin_counter_w) |
| 433 | AM_RANGE(0xf002, 0xf002) AM_READWRITE(psychic5_bankselect_r, psychic5_bankselect_w) |
| 434 | AM_RANGE(0xf003, 0xf003) AM_READWRITE(psychic5_vram_page_select_r, psychic5_vram_page_select_w) |
| 435 | AM_RANGE(0xf004, 0xf004) AM_NOP // ??? |
| 436 | AM_RANGE(0xf005, 0xf005) AM_READWRITE(SMH_NOP, psychic5_title_screen_w) |
| 437 | AM_RANGE(0xf006, 0xf1ff) AM_NOP |
| 438 | AM_RANGE(0xf200, 0xf7ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 439 | AM_RANGE(0xf800, 0xffff) AM_RAM |
| 401 | 440 | ADDRESS_MAP_END |
| 402 | 441 | |
| 403 | | static ADDRESS_MAP_START( sound_readmem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 404 | | AM_RANGE(0x0000, 0x7fff) AM_READ(SMH_ROM) |
| 405 | | AM_RANGE(0xc000, 0xc7ff) AM_READ(SMH_RAM) |
| 442 | static ADDRESS_MAP_START( psychic5_sound_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 443 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 444 | AM_RANGE(0xc000, 0xc7ff) AM_RAM |
| 406 | 445 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_r) |
| 407 | 446 | ADDRESS_MAP_END |
| 408 | 447 | |
| 409 | | static ADDRESS_MAP_START( sound_writemem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 410 | | AM_RANGE(0x0000, 0x7fff) AM_WRITE(SMH_ROM) |
| 411 | | AM_RANGE(0xc000, 0xc7ff) AM_WRITE(SMH_RAM) |
| 412 | | ADDRESS_MAP_END |
| 413 | | |
| 414 | | static ADDRESS_MAP_START( sound_io_map, ADDRESS_SPACE_IO, 8 ) |
| 448 | static ADDRESS_MAP_START( psychic5_soundport_map, ADDRESS_SPACE_IO, 8 ) |
| 415 | 449 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 416 | 450 | AM_RANGE(0x00, 0x00) AM_WRITE(ym2203_control_port_0_w) |
| 417 | 451 | AM_RANGE(0x01, 0x01) AM_WRITE(ym2203_write_port_0_w) |
| r3289 | r3290 | |
| 420 | 454 | ADDRESS_MAP_END |
| 421 | 455 | |
| 422 | 456 | |
| 457 | static ADDRESS_MAP_START( bombsa_main_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 458 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 459 | AM_RANGE(0x8000, 0xbfff) AM_RAMBANK(1) |
| 460 | AM_RANGE(0xc000, 0xcfff) AM_RAM |
| 461 | |
| 462 | /* ports look like the other games */ |
| 463 | AM_RANGE(0xd000, 0xd000) AM_WRITE(soundlatch_w) // confirmed |
| 464 | AM_RANGE(0xd001, 0xd001) AM_WRITE(bombsa_flipscreen_w) |
| 465 | AM_RANGE(0xd002, 0xd002) AM_READWRITE(psychic5_bankselect_r, bombsa_bankselect_w) |
| 466 | AM_RANGE(0xd003, 0xd003) AM_READWRITE(psychic5_vram_page_select_r, psychic5_vram_page_select_w) |
| 467 | AM_RANGE(0xd005, 0xd005) AM_WRITE(bombsa_unknown_w) // ? |
| 468 | |
| 469 | AM_RANGE(0xd000, 0xd1ff) AM_RAM |
| 470 | AM_RANGE(0xd200, 0xd7ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 471 | AM_RANGE(0xd800, 0xdfff) AM_RAM |
| 472 | |
| 473 | AM_RANGE(0xe000, 0xffff) AM_READWRITE(psychic5_paged_ram_r, bombsa_paged_ram_w) |
| 474 | ADDRESS_MAP_END |
| 475 | |
| 476 | static ADDRESS_MAP_START( bombsa_sound_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 477 | AM_RANGE(0x0000, 0xbfff) AM_ROM |
| 478 | AM_RANGE(0xc000, 0xc7ff) AM_RAM |
| 479 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_r) |
| 480 | AM_RANGE(0xf000, 0xf000) AM_WRITEONLY // Is this a confirm of some sort? |
| 481 | ADDRESS_MAP_END |
| 482 | |
| 483 | static ADDRESS_MAP_START( bombsa_soundport_map, ADDRESS_SPACE_IO, 8 ) |
| 484 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 485 | AM_RANGE(0x00, 0x00) AM_READWRITE(ym2203_status_port_0_r, ym2203_control_port_0_w) |
| 486 | AM_RANGE(0x01, 0x01) AM_READWRITE(ym2203_read_port_0_r, ym2203_write_port_0_w) |
| 487 | AM_RANGE(0x80, 0x80) AM_READWRITE(ym2203_status_port_1_r, ym2203_control_port_1_w) |
| 488 | AM_RANGE(0x81, 0x81) AM_READWRITE(ym2203_read_port_1_r, ym2203_write_port_1_w) |
| 489 | ADDRESS_MAP_END |
| 490 | |
| 491 | |
| 423 | 492 | static INPUT_PORTS_START( psychic5 ) |
| 424 | | PORT_START("IN0") |
| 425 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) |
| 426 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) |
| 427 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 428 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 429 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 430 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 431 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 432 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 493 | PORT_START("SYSTEM") /* system control */ |
| 494 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) |
| 495 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) |
| 496 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 497 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 498 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 499 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 500 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 501 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 433 | 502 | |
| 434 | | PORT_START("P1") /* player 1 controls */ |
| 435 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY |
| 436 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY |
| 437 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY |
| 438 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY |
| 439 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) |
| 440 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 441 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 442 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 503 | PORT_START("P1") /* player 1 controls */ |
| 504 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY |
| 505 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY |
| 506 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY |
| 507 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY |
| 508 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) |
| 509 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 510 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 511 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 443 | 512 | |
| 444 | | PORT_START("P2") /* player 2 controls */ |
| 445 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL |
| 446 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL |
| 447 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL |
| 448 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL |
| 449 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL |
| 450 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL |
| 451 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 452 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 513 | PORT_START("P2") /* player 2 controls */ |
| 514 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL |
| 515 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL |
| 516 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL |
| 517 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL |
| 518 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL |
| 519 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL |
| 520 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 521 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 453 | 522 | |
| 454 | | PORT_START("DSW0") |
| 455 | | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) |
| 456 | | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 457 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 458 | | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) |
| 459 | | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) |
| 460 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 461 | | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) |
| 462 | | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) |
| 463 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 464 | | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Difficulty ) ) |
| 465 | | PORT_DIPSETTING( 0x08, DEF_STR( Normal ) ) |
| 466 | | PORT_DIPSETTING( 0x00, DEF_STR( Hard ) ) |
| 467 | | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Cabinet ) ) |
| 468 | | PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) |
| 469 | | PORT_DIPSETTING( 0x10, DEF_STR( Cocktail ) ) |
| 470 | | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) ) |
| 471 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 472 | | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 473 | | PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) ) |
| 474 | | PORT_DIPSETTING( 0x80, "2" ) |
| 475 | | PORT_DIPSETTING( 0xc0, "3" ) |
| 476 | | PORT_DIPSETTING( 0x40, "4" ) |
| 477 | | PORT_DIPSETTING( 0x00, "5" ) |
| 523 | PORT_START("DSW1") |
| 524 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) |
| 525 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 526 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 527 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unused ) ) |
| 528 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) |
| 529 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 530 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unused ) ) |
| 531 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) |
| 532 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 533 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Difficulty ) ) |
| 534 | PORT_DIPSETTING( 0x08, DEF_STR( Normal ) ) |
| 535 | PORT_DIPSETTING( 0x00, DEF_STR( Hard ) ) |
| 536 | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Cabinet ) ) |
| 537 | PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) |
| 538 | PORT_DIPSETTING( 0x10, DEF_STR( Cocktail ) ) |
| 539 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) ) |
| 540 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 541 | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 542 | PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) ) |
| 543 | PORT_DIPSETTING( 0x80, "2" ) |
| 544 | PORT_DIPSETTING( 0xc0, "3" ) |
| 545 | PORT_DIPSETTING( 0x40, "4" ) |
| 546 | PORT_DIPSETTING( 0x00, "5" ) |
| 478 | 547 | |
| 479 | | PORT_START("DSW1") |
| 480 | | PORT_DIPNAME( 0x01, 0x01, "Invulnerability (Cheat)") |
| 481 | | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 482 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 483 | | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) |
| 484 | | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) |
| 485 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 486 | | PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coin_A ) ) |
| 487 | | PORT_DIPSETTING( 0x00, DEF_STR( 5C_1C ) ) |
| 488 | | PORT_DIPSETTING( 0x20, DEF_STR( 4C_1C ) ) |
| 489 | | PORT_DIPSETTING( 0x40, DEF_STR( 3C_1C ) ) |
| 490 | | PORT_DIPSETTING( 0x60, DEF_STR( 2C_1C ) ) |
| 491 | | PORT_DIPSETTING( 0xe0, DEF_STR( 1C_1C ) ) |
| 492 | | PORT_DIPSETTING( 0xc0, DEF_STR( 1C_2C ) ) |
| 493 | | PORT_DIPSETTING( 0xa0, DEF_STR( 1C_3C ) ) |
| 494 | | PORT_DIPSETTING( 0x80, DEF_STR( 1C_4C ) ) |
| 495 | | PORT_DIPNAME( 0x1c, 0x1c, DEF_STR( Coin_B ) ) |
| 496 | | PORT_DIPSETTING( 0x00, DEF_STR( 5C_1C ) ) |
| 497 | | PORT_DIPSETTING( 0x04, DEF_STR( 4C_1C ) ) |
| 498 | | PORT_DIPSETTING( 0x08, DEF_STR( 3C_1C ) ) |
| 499 | | PORT_DIPSETTING( 0x0c, DEF_STR( 2C_1C ) ) |
| 500 | | PORT_DIPSETTING( 0x1c, DEF_STR( 1C_1C ) ) |
| 501 | | PORT_DIPSETTING( 0x18, DEF_STR( 1C_2C ) ) |
| 502 | | PORT_DIPSETTING( 0x14, DEF_STR( 1C_3C ) ) |
| 503 | | PORT_DIPSETTING( 0x10, DEF_STR( 1C_4C ) ) |
| 548 | PORT_START("DSW2") |
| 549 | PORT_DIPNAME( 0x01, 0x01, "Invulnerability (Cheat)" ) |
| 550 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 551 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 552 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unused ) ) |
| 553 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) |
| 554 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 555 | PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coin_A ) ) |
| 556 | PORT_DIPSETTING( 0x00, DEF_STR( 5C_1C ) ) |
| 557 | PORT_DIPSETTING( 0x20, DEF_STR( 4C_1C ) ) |
| 558 | PORT_DIPSETTING( 0x40, DEF_STR( 3C_1C ) ) |
| 559 | PORT_DIPSETTING( 0x60, DEF_STR( 2C_1C ) ) |
| 560 | PORT_DIPSETTING( 0xe0, DEF_STR( 1C_1C ) ) |
| 561 | PORT_DIPSETTING( 0xc0, DEF_STR( 1C_2C ) ) |
| 562 | PORT_DIPSETTING( 0xa0, DEF_STR( 1C_3C ) ) |
| 563 | PORT_DIPSETTING( 0x80, DEF_STR( 1C_4C ) ) |
| 564 | PORT_DIPNAME( 0x1c, 0x1c, DEF_STR( Coin_B ) ) |
| 565 | PORT_DIPSETTING( 0x00, DEF_STR( 5C_1C ) ) |
| 566 | PORT_DIPSETTING( 0x04, DEF_STR( 4C_1C ) ) |
| 567 | PORT_DIPSETTING( 0x08, DEF_STR( 3C_1C ) ) |
| 568 | PORT_DIPSETTING( 0x0c, DEF_STR( 2C_1C ) ) |
| 569 | PORT_DIPSETTING( 0x1c, DEF_STR( 1C_1C ) ) |
| 570 | PORT_DIPSETTING( 0x18, DEF_STR( 1C_2C ) ) |
| 571 | PORT_DIPSETTING( 0x14, DEF_STR( 1C_3C ) ) |
| 572 | PORT_DIPSETTING( 0x10, DEF_STR( 1C_4C ) ) |
| 504 | 573 | INPUT_PORTS_END |
| 505 | 574 | |
| 575 | static INPUT_PORTS_START( bombsa ) |
| 576 | PORT_START("SYSTEM") /* system control */ |
| 577 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) |
| 578 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) |
| 579 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 580 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 581 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 582 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 583 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 584 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 506 | 585 | |
| 586 | PORT_START("P1") /* player 1 control */ |
| 587 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY |
| 588 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY |
| 589 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY |
| 590 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY |
| 591 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 592 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) |
| 593 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 594 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 507 | 595 | |
| 596 | PORT_START("P2") /* player 2 control */ |
| 597 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL |
| 598 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL |
| 599 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL |
| 600 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL |
| 601 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL |
| 602 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL |
| 603 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 604 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 605 | |
| 606 | PORT_START("DSW1") |
| 607 | PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW1:8" ) // Coin_B |
| 608 | PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW1:7" ) |
| 609 | PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW1:6" ) // Coin_B |
| 610 | PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW1:5" ) // Coin_B |
| 611 | PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW1:4" ) |
| 612 | PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW1:3" ) |
| 613 | PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2") |
| 614 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) |
| 615 | PORT_DIPSETTING( 0x40, "2 Coins 1 Credit/4 Coins 3 Credits" ) |
| 616 | PORT_DIPSETTING( 0x80, DEF_STR( 3C_1C ) ) |
| 617 | PORT_DIPSETTING( 0xc0, DEF_STR( 1C_4C ) ) |
| 618 | |
| 619 | PORT_START("DSW2") |
| 620 | PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW2:8" ) |
| 621 | PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW2:7" ) |
| 622 | PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW2:6" ) |
| 623 | PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW2:5" ) |
| 624 | PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW2:4" ) |
| 625 | PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW2:3" ) |
| 626 | PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW2:2" ) |
| 627 | PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW2:1" ) // flip screen ? |
| 628 | INPUT_PORTS_END |
| 629 | |
| 630 | |
| 631 | |
| 508 | 632 | static const gfx_layout charlayout = |
| 509 | 633 | { |
| 510 | 634 | 8,8, /* 8x8 characters */ |
| r3289 | r3290 | |
| 533 | 657 | GFXDECODE_ENTRY( "gfx3", 0, charlayout, 32*16, 16 ) |
| 534 | 658 | GFXDECODE_END |
| 535 | 659 | |
| 660 | static GFXDECODE_START( bombsa ) |
| 661 | GFXDECODE_ENTRY( "gfx1", 0, spritelayout, 32*16, 16 ) |
| 662 | GFXDECODE_ENTRY( "gfx2", 0, spritelayout, 0*16, 16 ) |
| 663 | GFXDECODE_ENTRY( "gfx3", 0, charlayout, 16*16, 16 ) |
| 664 | GFXDECODE_END |
| 536 | 665 | |
| 537 | 666 | |
| 667 | |
| 538 | 668 | static void irqhandler(running_machine *machine, int irq) |
| 539 | 669 | { |
| 540 | 670 | cpunum_set_input_line(machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE); |
| r3289 | r3290 | |
| 553 | 683 | static MACHINE_DRIVER_START( psychic5 ) |
| 554 | 684 | |
| 555 | 685 | /* basic machine hardware */ |
| 556 | | MDRV_CPU_ADD("main", Z80, 6000000) |
| 557 | | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 686 | MDRV_CPU_ADD("main", Z80, XTAL_12MHz/2) |
| 687 | MDRV_CPU_PROGRAM_MAP(psychic5_main_map,0) |
| 558 | 688 | MDRV_CPU_VBLANK_INT_HACK(psychic5_interrupt,2) |
| 559 | 689 | |
| 560 | | MDRV_CPU_ADD("audio", Z80, 6000000) |
| 561 | | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 562 | | MDRV_CPU_IO_MAP(sound_io_map,0) |
| 690 | MDRV_CPU_ADD("audio", Z80, XTAL_12MHz/2) |
| 691 | MDRV_CPU_PROGRAM_MAP(psychic5_sound_map,0) |
| 692 | MDRV_CPU_IO_MAP(psychic5_soundport_map,0) |
| 563 | 693 | |
| 564 | | MDRV_INTERLEAVE(10) /* Allow time for 2nd cpu to interleave*/ |
| 694 | MDRV_INTERLEAVE(10) /* Allow time for 2nd cpu to interleave */ |
| 565 | 695 | MDRV_MACHINE_RESET(psychic5) |
| 566 | 696 | |
| 567 | 697 | /* video hardware */ |
| r3289 | r3290 | |
| 577 | 707 | MDRV_PALETTE_LENGTH(768) |
| 578 | 708 | |
| 579 | 709 | MDRV_VIDEO_START(psychic5) |
| 710 | MDRV_VIDEO_RESET(psychic5) |
| 580 | 711 | MDRV_VIDEO_UPDATE(psychic5) |
| 581 | 712 | |
| 582 | 713 | /* sound hardware */ |
| 583 | 714 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 584 | 715 | |
| 585 | | MDRV_SOUND_ADD("ym1", YM2203, 6000000/4) |
| 716 | MDRV_SOUND_ADD("ym1", YM2203, XTAL_12MHz/8) |
| 586 | 717 | MDRV_SOUND_CONFIG(ym2203_config) |
| 587 | 718 | MDRV_SOUND_ROUTE(0, "mono", 0.15) |
| 588 | 719 | MDRV_SOUND_ROUTE(1, "mono", 0.15) |
| 589 | 720 | MDRV_SOUND_ROUTE(2, "mono", 0.15) |
| 590 | 721 | MDRV_SOUND_ROUTE(3, "mono", 0.50) |
| 591 | 722 | |
| 592 | | MDRV_SOUND_ADD("ym2", YM2203, 6000000/4) |
| 723 | MDRV_SOUND_ADD("ym2", YM2203, XTAL_12MHz/8) |
| 593 | 724 | MDRV_SOUND_ROUTE(0, "mono", 0.15) |
| 594 | 725 | MDRV_SOUND_ROUTE(1, "mono", 0.15) |
| 595 | 726 | MDRV_SOUND_ROUTE(2, "mono", 0.15) |
| 596 | 727 | MDRV_SOUND_ROUTE(3, "mono", 0.50) |
| 597 | 728 | MACHINE_DRIVER_END |
| 598 | 729 | |
| 730 | static MACHINE_DRIVER_START( bombsa ) |
| 599 | 731 | |
| 732 | /* basic machine hardware */ |
| 733 | MDRV_CPU_ADD("main", Z80, XTAL_12MHz/2 ) /* 6 MHz */ |
| 734 | MDRV_CPU_PROGRAM_MAP(bombsa_main_map,0) |
| 735 | MDRV_CPU_VBLANK_INT_HACK(psychic5_interrupt,2) |
| 736 | |
| 737 | MDRV_CPU_ADD("audio", Z80, XTAL_5MHz ) |
| 738 | MDRV_CPU_PROGRAM_MAP(bombsa_sound_map,0) |
| 739 | MDRV_CPU_IO_MAP(bombsa_soundport_map,0) |
| 740 | |
| 741 | MDRV_INTERLEAVE(10) |
| 742 | MDRV_MACHINE_RESET(psychic5) |
| 743 | |
| 744 | /* video hardware */ |
| 745 | MDRV_SCREEN_ADD("main", RASTER) |
| 746 | MDRV_SCREEN_REFRESH_RATE(54) /* Guru says : VSync - 54Hz . HSync - 15.25kHz */ |
| 747 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| 748 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) |
| 749 | MDRV_SCREEN_SIZE(64*8, 32*8) |
| 750 | MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) |
| 751 | |
| 752 | MDRV_GFXDECODE(bombsa) |
| 753 | MDRV_PALETTE_LENGTH(768) |
| 754 | |
| 755 | MDRV_VIDEO_START(bombsa) |
| 756 | MDRV_VIDEO_RESET(bombsa) |
| 757 | MDRV_VIDEO_UPDATE(bombsa) |
| 758 | |
| 759 | /* sound hardware */ |
| 760 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 761 | |
| 762 | MDRV_SOUND_ADD("ym1", YM2203, XTAL_12MHz/8) |
| 763 | MDRV_SOUND_CONFIG(ym2203_config) |
| 764 | MDRV_SOUND_ROUTE(0, "mono", 0.30) |
| 765 | MDRV_SOUND_ROUTE(1, "mono", 0.30) |
| 766 | MDRV_SOUND_ROUTE(2, "mono", 0.30) |
| 767 | MDRV_SOUND_ROUTE(3, "mono", 1.0) |
| 768 | |
| 769 | MDRV_SOUND_ADD("ym2", YM2203, XTAL_12MHz/8) |
| 770 | MDRV_SOUND_ROUTE(0, "mono", 0.30) |
| 771 | MDRV_SOUND_ROUTE(1, "mono", 0.30) |
| 772 | MDRV_SOUND_ROUTE(2, "mono", 0.30) |
| 773 | MDRV_SOUND_ROUTE(3, "mono", 1.0) |
| 774 | MACHINE_DRIVER_END |
| 775 | |
| 776 | |
| 600 | 777 | /*************************************************************************** |
| 601 | 778 | |
| 602 | 779 | Game driver(s) |
| r3289 | r3290 | |
| 604 | 781 | ***************************************************************************/ |
| 605 | 782 | |
| 606 | 783 | ROM_START( psychic5 ) |
| 607 | | ROM_REGION( 0x20000, "main", 0 ) /* 2*64K for main CPU, Z80 */ |
| 784 | ROM_REGION( 0x20000, "main", 0 ) /* Main CPU */ |
| 608 | 785 | ROM_LOAD( "p5d", 0x00000, 0x08000, CRC(90259249) SHA1(ac2d8dd95f6c04b6ad726136931e37dcd537e977) ) |
| 609 | 786 | ROM_LOAD( "p5e", 0x10000, 0x10000, CRC(72298f34) SHA1(725be2fbf5f3622f646c0fb8e6677cbddf0b1fc2) ) |
| 610 | 787 | |
| 611 | | ROM_REGION( 0x10000, "audio", 0 ) /*64K for 2nd z80 CPU*/ |
| 788 | ROM_REGION( 0x10000, "audio", 0 ) /* Sound CPU */ |
| 612 | 789 | ROM_LOAD( "p5a", 0x00000, 0x08000, CRC(50060ecd) SHA1(e6051fb4a1fa9429cfb6084e8a5dfe994a08280b) ) |
| 613 | 790 | |
| 614 | | ROM_REGION( 0x20000, "gfx1", ROMREGION_DISPOSE ) |
| 615 | | ROM_LOAD( "p5b", 0x00000, 0x10000, CRC(7e3f87d4) SHA1(b8e7fa3f96d2e3937e4cb530f105bb84d5743b43) ) /* sprite tiles */ |
| 791 | ROM_REGION( 0x20000, "gfx1", ROMREGION_DISPOSE ) /* sprite tiles */ |
| 792 | ROM_LOAD( "p5b", 0x00000, 0x10000, CRC(7e3f87d4) SHA1(b8e7fa3f96d2e3937e4cb530f105bb84d5743b43) ) |
| 616 | 793 | ROM_LOAD( "p5c", 0x10000, 0x10000, CRC(8710fedb) SHA1(c7e8dc6b733e4ecce37d56fc429c00ade8736ff3) ) |
| 617 | 794 | |
| 618 | | ROM_REGION( 0x20000, "gfx2", ROMREGION_DISPOSE ) |
| 619 | | ROM_LOAD( "p5g", 0x00000, 0x10000, CRC(f9262f32) SHA1(bae2dc77be7024bd85f213e4da746c5903db6ea5) ) /* background tiles */ |
| 795 | ROM_REGION( 0x20000, "gfx2", ROMREGION_DISPOSE ) /* background tiles */ |
| 796 | ROM_LOAD( "p5g", 0x00000, 0x10000, CRC(f9262f32) SHA1(bae2dc77be7024bd85f213e4da746c5903db6ea5) ) |
| 620 | 797 | ROM_LOAD( "p5h", 0x10000, 0x10000, CRC(c411171a) SHA1(d5893563715ba231e42b084b88f5176bb94a4da9) ) |
| 621 | 798 | |
| 622 | | ROM_REGION( 0x08000, "gfx3", ROMREGION_DISPOSE ) |
| 623 | | ROM_LOAD( "p5f", 0x00000, 0x08000, CRC(04d7e21c) SHA1(6046c506bdedc233e3730f90c7897e847bec8758) ) /* foreground tiles */ |
| 799 | ROM_REGION( 0x08000, "gfx3", ROMREGION_DISPOSE ) /* foreground tiles */ |
| 800 | ROM_LOAD( "p5f", 0x00000, 0x08000, CRC(04d7e21c) SHA1(6046c506bdedc233e3730f90c7897e847bec8758) ) |
| 624 | 801 | ROM_END |
| 625 | 802 | |
| 626 | 803 | |
| 804 | /* |
| 805 | Bombs Away |
| 806 | Jaleco, 1988 |
| 627 | 807 | |
| 808 | PCB Layout |
| 809 | ---------- |
| 810 | |
| 811 | BB-8744 |
| 812 | |------------------------------------------| |
| 813 | | 1 Z80(1) 4 | |
| 814 | | 6116 5MHz |-| |
| 815 | |VOL YM2203 5 | | |
| 816 | |4558 YM2203 Z80(2) | | |
| 817 | |4558 YM3014 6 | | |
| 818 | | YM3014 | | |
| 819 | |J 6116 6264 | | |
| 820 | |A |-| |
| 821 | |M | |
| 822 | |M | |
| 823 | |A |-| |
| 824 | | | | |
| 825 | | | | |
| 826 | | 2 62256 | | |
| 827 | | DSW1 | | |
| 828 | | 3 62256 | | |
| 829 | | DSW2 82S137 |-| |
| 830 | | | |
| 831 | |------------------------------------------| |
| 832 | Notes: |
| 833 | Z80(1) clock - 5.000MHz |
| 834 | Z80(2) clock - 6.000MHz [12/2] |
| 835 | YM2203 clock - 1.500MHz [12/8, both] |
| 836 | VSync - 54Hz |
| 837 | HSync - 15.25kHz |
| 838 | |
| 839 | |
| 840 | BB-8745 |
| 841 | |--------------------------------| |
| 842 | | | |
| 843 | | |-----| |-| |
| 844 | | |N8633| | | |
| 845 | | |-S | | | |
| 846 | | |-----| | | |
| 847 | | 82S123 | | |
| 848 | | |-----| | | |
| 849 | | |N8633| |-| |
| 850 | | |-V | | |
| 851 | |2018 | | | |
| 852 | |2018 7 |6116 | 12MHz |-| |
| 853 | | |-----| | | |
| 854 | | |-----| | | |
| 855 | | |N8633| | | |
| 856 | | |-V64 | | | |
| 857 | | | | | | |
| 858 | | 9 8 |6264 | |-| |
| 859 | | |-----| | |
| 860 | |--------------------------------| |
| 861 | Notes: |
| 862 | 3 soldered-in 'modules' are located on this PCB. |
| 863 | N-8633-V 6-7 TOYOCOM |
| 864 | N-8633-V64 6-7 TOYOCOM |
| 865 | N-8633-S 6-7 TOYOCOM |
| 866 | The 2 larger ones have 62 pins, 31 pins on each side of a small PCB. The PCB contains some |
| 867 | surface mounted logic chips and some surface mounted RAM. |
| 868 | The smaller module has 40 pins, 20 pins on each side of a small PCB. The PCB contains only |
| 869 | logic on both sides. |
| 870 | */ |
| 871 | |
| 872 | ROM_START( bombsa ) |
| 873 | ROM_REGION( 0x30000, "main", 0 ) /* Main CPU */ |
| 874 | ROM_LOAD( "4.7a", 0x00000, 0x08000, CRC(0191f6a7) SHA1(10a0434abbf4be068751e65c81b1a211729e3742) ) |
| 875 | /* these fail their self-test... should be checked on real hw (hold start1+start2 on boot) */ |
| 876 | ROM_LOAD( "5.7c", 0x10000, 0x08000, BAD_DUMP CRC(095c451a) SHA1(892ca84376f89640ad4d28f1e548c26bc8f72c0e) ) // contains palettes etc. but fails rom check?? |
| 877 | ROM_LOAD( "6.7d", 0x20000, 0x10000, BAD_DUMP CRC(89f9dc0f) SHA1(5cf6a7aade3d56bc229d3771bc4141ad0c0e8da2) ) |
| 878 | |
| 879 | ROM_REGION( 0x10000, "audio", 0 ) /* Sound CPU */ |
| 880 | ROM_LOAD( "1.3a", 0x00000, 0x08000, CRC(92801404) SHA1(c4ff47989d355b18a909eaa88f138e2f68178ecc) ) |
| 881 | |
| 882 | ROM_REGION( 0x20000, "gfx1", ROMREGION_DISPOSE ) /* sprite tiles */ |
| 883 | ROM_LOAD( "2.4p", 0x00000, 0x10000, CRC(bd972ff4) SHA1(63bfb455bc0ae1d31e6f1066864ec0c8d2d0cf99) ) |
| 884 | ROM_LOAD( "3.4s", 0x10000, 0x10000, CRC(9a8a8a97) SHA1(13328631202c196c9d8791cc6063048eb6be0472) ) |
| 885 | |
| 886 | ROM_REGION( 0x20000, "gfx2", ROMREGION_DISPOSE ) /* background tiles */ |
| 887 | /* some corrupt 'blank' characters, should also be checked with a redump */ |
| 888 | ROM_LOAD( "8.2l", 0x00000, 0x10000, BAD_DUMP CRC(3391c769) SHA1(7ae7575ac81d6e0d915c279c1f57a9bc6d096bd6) ) |
| 889 | ROM_LOAD( "9.2m", 0x10000, 0x10000, BAD_DUMP CRC(5b315976) SHA1(d17cc1926f926bdd88b66ea6af88dac30880e7d4) ) |
| 890 | |
| 891 | ROM_REGION( 0x08000, "gfx3", ROMREGION_DISPOSE ) /* foreground tiles */ |
| 892 | ROM_LOAD( "7.4f", 0x00000, 0x08000, CRC(400114b9) SHA1(db2f3ba05a2005ae0e0e7d19c8739353032cbeab) ) |
| 893 | |
| 894 | ROM_REGION( 0x08000, "proms", ROMREGION_DISPOSE ) /* Proms */ |
| 895 | ROM_LOAD( "82s131.7l", 0x000, 0x200, CRC(6a7d13c0) SHA1(2a835a4ac1acb7663d0b915d0339af9800284da6) ) |
| 896 | ROM_LOAD( "82s137.3t", 0x200, 0x400, CRC(59e44236) SHA1(f53d99694fa5acd7cc51dd78e09f0d2ef730e7a4) ) |
| 897 | ROM_END |
| 898 | |
| 899 | |
| 628 | 900 | GAME( 1987, psychic5, 0, psychic5, psychic5, 0, ROT270, "Jaleco", "Psychic 5", 0 ) |
| 901 | GAME( 1988, bombsa, 0, bombsa, bombsa, 0, ROT270, "Jaleco", "Bombs Away", GAME_NOT_WORKING ) |
src/emu/machine/ldpr8210.c
| r3289 | r3290 | |
| 7 | 7 | Copyright Nicola Salmoria and the MAME Team. |
| 8 | 8 | Visit http://mamedev.org for licensing and usage restrictions. |
| 9 | 9 | |
| 10 | ************************************************************************** |
| 11 | |
| 12 | Still to do: |
| 13 | |
| 14 | * add overlay properly (need capture) |
| 15 | * implement SLOW TRG |
| 16 | * figure out Simutrek without jump hack |
| 17 | * figure out serial protocol issues (current hack works nicely) |
| 18 | * determine actual slow/fast speeds |
| 19 | |
| 10 | 20 | *************************************************************************/ |
| 11 | 21 | |
| 12 | 22 | #include "ldcore.h" |
| r3289 | r3290 | |
| 18 | 28 | DEBUGGING |
| 19 | 29 | ***************************************************************************/ |
| 20 | 30 | |
| 21 | | #define EMULATE_PR8210_ROM 0 |
| 31 | #define LOG_VBLANK_VBI 0 |
| 32 | #define LOG_SERIAL 0 |
| 33 | #define LOG_SIMUTREK 0 |
| 22 | 34 | |
| 23 | | #define PRINTF_COMMANDS 1 |
| 24 | | #define CMDPRINTF(x) do { if (PRINTF_COMMANDS) mame_printf_debug x; } while (0) |
| 25 | 35 | |
| 26 | 36 | |
| 27 | | |
| 28 | 37 | /*************************************************************************** |
| 29 | 38 | CONSTANTS |
| 30 | 39 | ***************************************************************************/ |
| 31 | 40 | |
| 32 | | /* Player-specific states */ |
| 33 | | enum |
| 34 | | { |
| 35 | | LDSTATE_STEPPING_BY_PARAMETER = LDSTATE_OTHER, |
| 36 | | LDSTATE_STEPPING_BY_PARAMETER_PAUSED |
| 37 | | }; |
| 38 | | |
| 39 | 41 | /* Pioneer PR-8210 specific information */ |
| 40 | | #define PR8210_SCAN_SPEED (2000 / 30) /* 2000 frames/second */ |
| 41 | | #define PR8210_SCAN_DURATION (10) /* scan for 10 vsyncs each time */ |
| 42 | | #define PR8210_SLOW_SPEED (5) /* 1/5x normal speed */ |
| 43 | | #define PR8210_FAST_SPEED (3) /* 3x normal speed */ |
| 44 | | #define PR8210_JUMP_REV_SPEED (15) /* 15x normal speed */ |
| 45 | | #define PR8210_SEEK_FAST_SPEED (1000) /* 1000x normal speed */ |
| 42 | #define PR8210_SCAN_SPEED (2000 / 30) /* 2000 frames/second */ |
| 43 | #define PR8210_SEEK_FAST_SPEED (4000 / 30) /* 4000 frames/second */ |
| 46 | 44 | |
| 47 | | /* Us vs. Them requires at least this much "non-video" time in order to work */ |
| 48 | | #define PR8210_MINIMUM_SEEK_TIME ATTOTIME_IN_MSEC(150) |
| 45 | /* serial timing, mostly from the service manual, derived from the XTAL */ |
| 46 | #define PR8210_SERIAL_CLOCK XTAL_455kHz |
| 47 | #define PR8210_0_BIT_TIME ATTOTIME_IN_HZ(PR8210_SERIAL_CLOCK / 512) |
| 48 | #define PR8210_1_BIT_TIME ATTOTIME_IN_HZ(PR8210_SERIAL_CLOCK / 1024) |
| 49 | #define PR8210_MIDPOINT_TIME ATTOTIME_IN_HZ(PR8210_SERIAL_CLOCK / 600) |
| 50 | #define PR8210_MAX_WORD_TIME ATTOTIME_IN_HZ(PR8210_SERIAL_CLOCK / 11520) |
| 51 | #define PR8210_REJECT_DUPLICATE_TIME ATTOTIME_IN_HZ(PR8210_SERIAL_CLOCK / 11520 / 4) |
| 49 | 52 | |
| 50 | 53 | |
| 51 | 54 | |
| r3289 | r3290 | |
| 53 | 56 | TYPE DEFINITIONS |
| 54 | 57 | ***************************************************************************/ |
| 55 | 58 | |
| 59 | /* PIA data */ |
| 60 | typedef struct _pioneer_pia pioneer_pia; |
| 61 | struct _pioneer_pia |
| 62 | { |
| 63 | UINT8 frame[7]; /* (20-26) 7 characters for the chapter/frame */ |
| 64 | UINT8 text[15]; /* (22-30) 15 characters for the display */ |
| 65 | UINT8 control; /* (40) control lines */ |
| 66 | UINT8 latchdisplay; /* flag: set if the display was latched */ |
| 67 | UINT8 portb; /* (60) port B value (LEDs) */ |
| 68 | UINT8 display; /* (80) display enable */ |
| 69 | UINT8 porta; /* (A0) port A value (from serial decoder) */ |
| 70 | UINT8 vbi1; /* (C0) VBI decoding state 1 */ |
| 71 | UINT8 vbi2; /* (E0) VBI decoding state 2 */ |
| 72 | }; |
| 73 | |
| 74 | |
| 75 | /* Simutrek-specific data */ |
| 76 | typedef struct _simutrek_data simutrek_data; |
| 77 | struct _simutrek_data |
| 78 | { |
| 79 | int cpunum; /* CPU index of the 8748 */ |
| 80 | UINT8 audio_squelch; /* audio squelch value */ |
| 81 | UINT8 data; /* parallel data for simutrek */ |
| 82 | UINT8 data_ready; /* ready flag for simutrek data */ |
| 83 | UINT8 port2; /* 8748 port 2 state */ |
| 84 | UINT8 jumphack; |
| 85 | }; |
| 86 | |
| 87 | |
| 56 | 88 | /* player-specific data */ |
| 57 | 89 | struct _ldplayer_data |
| 58 | 90 | { |
| 59 | | /* general modes and states */ |
| 60 | | UINT8 audio1disable; /* explicit disable for audio 1 */ |
| 61 | | UINT8 audio2disable; /* explicit disable for audio 2 */ |
| 62 | | UINT8 framedisplay; /* frame display */ |
| 63 | | INT32 parameter; /* parameter for numbers */ |
| 64 | | |
| 65 | 91 | /* serial/command interface processing */ |
| 66 | | UINT8 lastcommand; /* last command byte received */ |
| 67 | | UINT8 seekstate; /* state of the seek command */ |
| 92 | UINT8 lastcommand; /* last command seen */ |
| 68 | 93 | UINT16 accumulator; /* bit accumulator */ |
| 94 | attotime lastcommandtime; /* time of the last command */ |
| 69 | 95 | attotime lastbittime; /* time of last bit received */ |
| 70 | 96 | attotime firstbittime; /* time of first bit in command */ |
| 71 | 97 | |
| 72 | | /* Simutrek-specific data */ |
| 73 | | UINT8 cmdcnt; /* counter for multi-byte command */ |
| 74 | | UINT8 cmdbytes[3]; /* storage for multi-byte command */ |
| 75 | | void (*cmd_ack_callback)(void); /* callback to clear game command write flag */ |
| 76 | | |
| 77 | 98 | /* low-level emulation data */ |
| 78 | | int cpunum; |
| 79 | | UINT8 pia[0x100]; |
| 80 | | UINT8 vsync; |
| 81 | | UINT8 porta; |
| 82 | | UINT8 portb; |
| 83 | | UINT8 pia_porta; |
| 84 | | UINT8 pia_portb; |
| 99 | int cpunum; /* CPU index of the 8049 */ |
| 100 | attotime slowtrg; /* time of the last SLOW TRG */ |
| 101 | pioneer_pia pia; /* PIA state */ |
| 102 | UINT8 vsync; /* live VSYNC state */ |
| 103 | UINT8 port1; /* 8049 port 1 state */ |
| 104 | UINT8 port2; /* 8049 port 2 state */ |
| 105 | |
| 106 | /* Simutrek-specific data */ |
| 107 | simutrek_data simutrek; /* Simutrek-specific data */ |
| 85 | 108 | }; |
| 86 | 109 | |
| 87 | 110 | |
| r3289 | r3290 | |
| 91 | 114 | ***************************************************************************/ |
| 92 | 115 | |
| 93 | 116 | static void pr8210_init(laserdisc_state *ld); |
| 94 | | static void pr8210_soft_reset(laserdisc_state *ld); |
| 95 | | static void pr8210_update_squelch(laserdisc_state *ld); |
| 96 | | static int pr8210_switch_state(laserdisc_state *ld, UINT8 newstate, INT32 stateparam); |
| 97 | | static INT32 pr8210_hle_update(laserdisc_state *ld, const vbi_metadata *vbi, int fieldnum, attotime curtime); |
| 98 | | #if (EMULATE_PR8210_ROM) |
| 99 | | static void pr8210_vsync(laserdisc_state *ld); |
| 117 | static void pr8210_vsync(laserdisc_state *ld, const vbi_metadata *vbi, int fieldnum, attotime curtime); |
| 100 | 118 | static INT32 pr8210_update(laserdisc_state *ld, const vbi_metadata *vbi, int fieldnum, attotime curtime); |
| 101 | | #else |
| 102 | | static void pr8210_hle_command(laserdisc_state *ld); |
| 103 | | #endif |
| 119 | static void pr8210_overlay(laserdisc_state *ld, bitmap_t *bitmap); |
| 104 | 120 | static void pr8210_control_w(laserdisc_state *ld, UINT8 prev, UINT8 data); |
| 121 | static TIMER_CALLBACK( vsync_off ); |
| 122 | static TIMER_CALLBACK( vbi_data_fetch ); |
| 123 | static READ8_HANDLER( pr8210_pia_r ); |
| 124 | static WRITE8_HANDLER( pr8210_pia_w ); |
| 125 | static READ8_HANDLER( pr8210_bus_r ); |
| 126 | static WRITE8_HANDLER( pr8210_port1_w ); |
| 127 | static WRITE8_HANDLER( pr8210_port2_w ); |
| 128 | static READ8_HANDLER( pr8210_t0_r ); |
| 129 | static READ8_HANDLER( pr8210_t1_r ); |
| 105 | 130 | |
| 106 | 131 | static void simutrek_init(laserdisc_state *ld); |
| 132 | static void simutrek_vsync(laserdisc_state *ld, const vbi_metadata *vbi, int fieldnum, attotime curtime); |
| 133 | static INT32 simutrek_update(laserdisc_state *ld, const vbi_metadata *vbi, int fieldnum, attotime curtime); |
| 134 | static UINT8 simutrek_ready_r(laserdisc_state *ld); |
| 107 | 135 | static UINT8 simutrek_status_r(laserdisc_state *ld); |
| 108 | 136 | static void simutrek_data_w(laserdisc_state *ld, UINT8 prev, UINT8 data); |
| 137 | static TIMER_CALLBACK( simutrek_latched_data_w ); |
| 138 | static READ8_HANDLER( simutrek_port2_r ); |
| 139 | static WRITE8_HANDLER( simutrek_port2_w ); |
| 140 | static READ8_HANDLER( simutrek_data_r ); |
| 141 | static READ8_HANDLER( simutrek_t0_r ); |
| 109 | 142 | |
| 110 | 143 | |
| 111 | 144 | |
| 112 | 145 | /*************************************************************************** |
| 113 | | ROM AND MACHINE INTERFACES |
| 146 | INLINE FUNCTIONS |
| 114 | 147 | ***************************************************************************/ |
| 115 | 148 | |
| 116 | | MACHINE_DRIVER_EXTERN( pr8210 ); |
| 149 | /*------------------------------------------------- |
| 150 | find_pr8210 - find our device; assumes there |
| 151 | is only one |
| 152 | -------------------------------------------------*/ |
| 117 | 153 | |
| 118 | | #if EMULATE_PR8210_ROM |
| 154 | INLINE laserdisc_state *find_pr8210(running_machine *machine) |
| 155 | { |
| 156 | return ldcore_get_safe_token(device_list_first(machine->config->devicelist, LASERDISC)); |
| 157 | } |
| 158 | |
| 159 | |
| 160 | /*------------------------------------------------- |
| 161 | update_video_squelch - update the state of |
| 162 | the video squelch |
| 163 | -------------------------------------------------*/ |
| 164 | |
| 165 | INLINE void update_video_squelch(laserdisc_state *ld) |
| 166 | { |
| 167 | ldplayer_data *player = ld->player; |
| 168 | ldcore_set_video_squelch(ld, (player->port1 & 0x20) != 0); |
| 169 | } |
| 170 | |
| 171 | |
| 172 | /*------------------------------------------------- |
| 173 | update_audio_squelch - update the state of |
| 174 | the audio squelch |
| 175 | -------------------------------------------------*/ |
| 176 | |
| 177 | INLINE void update_audio_squelch(laserdisc_state *ld) |
| 178 | { |
| 179 | ldplayer_data *player = ld->player; |
| 180 | if (player->simutrek.cpunum == -1) |
| 181 | ldcore_set_audio_squelch(ld, (player->port1 & 0x40) || !(player->pia.portb & 0x01), (player->port1 & 0x40) || !(player->pia.portb & 0x02)); |
| 182 | else |
| 183 | ldcore_set_audio_squelch(ld, player->simutrek.audio_squelch, player->simutrek.audio_squelch); |
| 184 | } |
| 185 | |
| 186 | |
| 187 | |
| 188 | /*************************************************************************** |
| 189 | PR-8210 ROM AND MACHINE INTERFACES |
| 190 | ***************************************************************************/ |
| 191 | |
| 192 | static ADDRESS_MAP_START( pr8210_portmap, ADDRESS_SPACE_IO, 8 ) |
| 193 | AM_RANGE(0x00, 0xff) AM_READWRITE(pr8210_pia_r, pr8210_pia_w) |
| 194 | AM_RANGE(MCS48_PORT_BUS, MCS48_PORT_BUS) AM_READ(pr8210_bus_r) |
| 195 | AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_WRITE(pr8210_port1_w) |
| 196 | AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(pr8210_port2_w) |
| 197 | AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_READ(pr8210_t0_r) |
| 198 | AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(pr8210_t1_r) |
| 199 | ADDRESS_MAP_END |
| 200 | |
| 201 | |
| 202 | static MACHINE_DRIVER_START( pr8210 ) |
| 203 | MDRV_CPU_ADD("pr8210", I8049, XTAL_4_41MHz) |
| 204 | MDRV_CPU_IO_MAP(pr8210_portmap,0) |
| 205 | MACHINE_DRIVER_END |
| 206 | |
| 207 | |
| 119 | 208 | ROM_START( pr8210 ) |
| 120 | 209 | ROM_REGION( 0x800, "pr8210", ROMREGION_LOADBYNAME ) |
| 121 | 210 | ROM_LOAD( "pr-8210_mcu_ud6005a.bin", 0x000, 0x800, CRC(120fa83b) SHA1(b514326ca1f52d6d89056868f9d17eabd4e3f31d) ) |
| 122 | 211 | ROM_END |
| 123 | | #endif |
| 124 | 212 | |
| 125 | 213 | |
| 126 | 214 | |
| 127 | 215 | /*************************************************************************** |
| 128 | | INTERFACES |
| 216 | PR-8210 PLAYER INTERFACE |
| 129 | 217 | ***************************************************************************/ |
| 130 | 218 | |
| 131 | 219 | const ldplayer_interface pr8210_interface = |
| r3289 | r3290 | |
| 133 | 221 | LASERDISC_TYPE_PIONEER_PR8210, /* type of the player */ |
| 134 | 222 | sizeof(ldplayer_data), /* size of the state */ |
| 135 | 223 | "Pioneer PR-8210", /* name of the player */ |
| 136 | | #if EMULATE_PR8210_ROM |
| 137 | 224 | rom_pr8210, /* pointer to ROM region information */ |
| 138 | 225 | machine_config_pr8210, /* pointer to machine configuration */ |
| 139 | 226 | pr8210_init, /* initialization callback */ |
| 140 | 227 | pr8210_vsync, /* vsync callback */ |
| 141 | 228 | pr8210_update, /* update callback */ |
| 142 | | #else |
| 143 | | NULL, /* pointer to ROM region information */ |
| 144 | | NULL, /* pointer to machine configuration */ |
| 145 | | pr8210_init, /* initialization callback */ |
| 146 | | NULL, /* vsync callback */ |
| 147 | | pr8210_hle_update, /* update callback */ |
| 148 | | #endif |
| 229 | pr8210_overlay, /* overlay callback */ |
| 149 | 230 | NULL, /* parallel data write */ |
| 150 | 231 | { /* single line write: */ |
| 151 | 232 | NULL, /* LASERDISC_LINE_ENTER */ |
| r3289 | r3290 | |
| 161 | 242 | }; |
| 162 | 243 | |
| 163 | 244 | |
| 164 | | const ldplayer_interface simutrek_interface = |
| 165 | | { |
| 166 | | LASERDISC_TYPE_SIMUTREK_SPECIAL, /* type of the player */ |
| 167 | | sizeof(ldplayer_data), /* size of the state */ |
| 168 | | "Simutrek Modified PR-8210", /* name of the player */ |
| 169 | | NULL, /* pointer to ROM region information */ |
| 170 | | NULL, /* pointer to machine configuration */ |
| 171 | | simutrek_init, /* initialization callback */ |
| 172 | | NULL, /* vsync callback */ |
| 173 | | pr8210_hle_update, /* update callback */ |
| 174 | | simutrek_data_w, /* parallel data write */ |
| 175 | | { /* single line write: */ |
| 176 | | NULL, /* LASERDISC_LINE_ENTER */ |
| 177 | | NULL /* LASERDISC_LINE_CONTROL */ |
| 178 | | }, |
| 179 | | NULL, /* parallel data read */ |
| 180 | | { /* single line read: */ |
| 181 | | NULL, /* LASERDISC_LINE_READY */ |
| 182 | | simutrek_status_r, /* LASERDISC_LINE_STATUS */ |
| 183 | | NULL, /* LASERDISC_LINE_COMMAND */ |
| 184 | | NULL, /* LASERDISC_LINE_DATA_AVAIL */ |
| 185 | | } |
| 186 | | }; |
| 187 | 245 | |
| 188 | | |
| 189 | | |
| 190 | 246 | /*************************************************************************** |
| 191 | | INLINE FUNCTIONS |
| 192 | | ***************************************************************************/ |
| 193 | | |
| 194 | | /*------------------------------------------------- |
| 195 | | requires_state_save - returns TRUE if the |
| 196 | | given state will return to the previous |
| 197 | | state when done |
| 198 | | -------------------------------------------------*/ |
| 199 | | |
| 200 | | INLINE int requires_state_save(UINT8 state) |
| 201 | | { |
| 202 | | return (state == LDSTATE_SCANNING); |
| 203 | | } |
| 204 | | |
| 205 | | |
| 206 | | /*------------------------------------------------- |
| 207 | | requires_state_save - returns TRUE if the |
| 208 | | given state will return to the previous |
| 209 | | state when done |
| 210 | | -------------------------------------------------*/ |
| 211 | | |
| 212 | | INLINE void update_audio_squelch(laserdisc_state *ld) |
| 213 | | { |
| 214 | | ldplayer_data *player = ld->player; |
| 215 | | ldcore_set_audio_squelch(ld, (player->porta & 0x40) || !(player->pia_portb & 0x01), (player->porta & 0x40) || !(player->pia_portb & 0x02)); |
| 216 | | } |
| 217 | | |
| 218 | | |
| 219 | | |
| 220 | | |
| 221 | | /*************************************************************************** |
| 222 | 247 | PIONEER PR-8210 IMPLEMENTATION |
| 223 | 248 | ***************************************************************************/ |
| 224 | 249 | |
| r3289 | r3290 | |
| 230 | 255 | static void pr8210_init(laserdisc_state *ld) |
| 231 | 256 | { |
| 232 | 257 | astring *tempstring = astring_alloc(); |
| 258 | attotime curtime = timer_get_time(); |
| 259 | ldplayer_data *player = ld->player; |
| 233 | 260 | |
| 234 | 261 | /* find our CPU */ |
| 235 | 262 | astring_printf(tempstring, "%s:%s", ld->device->tag, "pr8210"); |
| 236 | | ld->player->cpunum = mame_find_cpu_index(ld->device->machine, astring_c(tempstring)); |
| 263 | player->cpunum = mame_find_cpu_index(ld->device->machine, astring_c(tempstring)); |
| 237 | 264 | astring_free(tempstring); |
| 238 | 265 | |
| 239 | 266 | /* do a soft reset */ |
| 240 | | pr8210_soft_reset(ld); |
| 241 | | } |
| 242 | | |
| 243 | | |
| 244 | | /*------------------------------------------------- |
| 245 | | pr8210_soft_reset - Pioneer PR-8210-specific |
| 246 | | soft reset |
| 247 | | -------------------------------------------------*/ |
| 248 | | |
| 249 | | static void pr8210_soft_reset(laserdisc_state *ld) |
| 250 | | { |
| 251 | | ldplayer_data *player = ld->player; |
| 252 | | attotime curtime = timer_get_time(); |
| 253 | | |
| 254 | | ld->state.state = LDSTATE_NONE; |
| 255 | | ld->state.substate = 0; |
| 256 | | ld->state.param = 0; |
| 257 | | ld->state.endtime = curtime; |
| 258 | | |
| 259 | | player->audio1disable = 0; |
| 260 | | player->audio2disable = 0; |
| 261 | | player->parameter = 0; |
| 262 | | |
| 263 | 267 | player->lastcommand = 0; |
| 264 | | player->seekstate = 0; |
| 265 | 268 | player->accumulator = 0; |
| 269 | player->lastcommandtime = curtime; |
| 266 | 270 | player->firstbittime = curtime; |
| 267 | 271 | player->lastbittime = curtime; |
| 272 | player->slowtrg = curtime; |
| 268 | 273 | |
| 269 | | pr8210_switch_state(ld, LDSTATE_PARKED, 0); |
| 274 | /* we don't have the Simutrek player overrides */ |
| 275 | player->simutrek.cpunum = -1; |
| 276 | player->simutrek.audio_squelch = FALSE; |
| 270 | 277 | } |
| 271 | 278 | |
| 272 | 279 | |
| 273 | 280 | /*------------------------------------------------- |
| 274 | | pr8210_update_squelch - update the squelch |
| 275 | | settings based on the current state |
| 281 | pr8210_vsync - VSYNC callback, called at the |
| 282 | start of the blanking period |
| 276 | 283 | -------------------------------------------------*/ |
| 277 | 284 | |
| 278 | | static void pr8210_update_squelch(laserdisc_state *ld) |
| 285 | static void pr8210_vsync(laserdisc_state *ld, const vbi_metadata *vbi, int fieldnum, attotime curtime) |
| 279 | 286 | { |
| 280 | 287 | ldplayer_data *player = ld->player; |
| 281 | 288 | |
| 282 | | switch (ld->state.state) |
| 289 | /* logging */ |
| 290 | if (LOG_VBLANK_VBI) |
| 283 | 291 | { |
| 284 | | /* video on, audio on */ |
| 285 | | case LDSTATE_PLAYING: |
| 286 | | ldcore_set_audio_squelch(ld, player->audio1disable, player->audio2disable); |
| 287 | | ldcore_set_video_squelch(ld, FALSE); |
| 288 | | break; |
| 289 | | |
| 290 | | /* video on, audio off */ |
| 291 | | case LDSTATE_PAUSING: |
| 292 | | case LDSTATE_PAUSED: |
| 293 | | case LDSTATE_PLAYING_SLOW_REVERSE: |
| 294 | | case LDSTATE_PLAYING_SLOW_FORWARD: |
| 295 | | case LDSTATE_PLAYING_FAST_REVERSE: |
| 296 | | case LDSTATE_PLAYING_FAST_FORWARD: |
| 297 | | case LDSTATE_STEPPING_REVERSE: |
| 298 | | case LDSTATE_STEPPING_FORWARD: |
| 299 | | case LDSTATE_SCANNING: |
| 300 | | ldcore_set_audio_squelch(ld, TRUE, TRUE); |
| 301 | | ldcore_set_video_squelch(ld, FALSE); |
| 302 | | break; |
| 303 | | |
| 304 | | /* video off, audio off */ |
| 305 | | case LDSTATE_NONE: |
| 306 | | case LDSTATE_EJECTED: |
| 307 | | case LDSTATE_EJECTING: |
| 308 | | case LDSTATE_PARKED: |
| 309 | | case LDSTATE_LOADING: |
| 310 | | case LDSTATE_SPINUP: |
| 311 | | case LDSTATE_SEEKING: |
| 312 | | ldcore_set_audio_squelch(ld, TRUE, TRUE); |
| 313 | | ldcore_set_video_squelch(ld, TRUE); |
| 314 | | break; |
| 315 | | |
| 316 | | /* Simutrek: stepping by parameter with explicit audio squelch controls */ |
| 317 | | case LDSTATE_STEPPING_BY_PARAMETER: |
| 318 | | case LDSTATE_STEPPING_BY_PARAMETER_PAUSED: |
| 319 | | ldcore_set_video_squelch(ld, FALSE); |
| 320 | | break; |
| 292 | if ((vbi->line1718 & VBI_MASK_CAV_PICTURE) == VBI_CODE_CAV_PICTURE) |
| 293 | printf("%3d:VSYNC(%d,%05d)\n", video_screen_get_vpos(ld->screen), fieldnum, VBI_CAV_PICTURE(vbi->line1718)); |
| 294 | else |
| 295 | printf("%3d:VSYNC(%d)\n", video_screen_get_vpos(ld->screen), fieldnum); |
| 321 | 296 | } |
| 322 | | } |
| 323 | 297 | |
| 298 | /* signal VSYNC and set a timer to turn it off */ |
| 299 | player->vsync = TRUE; |
| 300 | timer_set(attotime_mul(video_screen_get_scan_period(ld->screen), 4), ld, 0, vsync_off); |
| 324 | 301 | |
| 325 | | /*------------------------------------------------- |
| 326 | | pr8210_switch_state - attempt to switch states |
| 327 | | if appropriate, and ensure the squelch values |
| 328 | | are correct |
| 329 | | -------------------------------------------------*/ |
| 330 | | |
| 331 | | static int pr8210_switch_state(laserdisc_state *ld, UINT8 newstate, INT32 parameter) |
| 332 | | { |
| 333 | | attotime curtime = timer_get_time(); |
| 334 | | |
| 335 | | /* if this is the same state, ignore */ |
| 336 | | if (ld->state.state == newstate) |
| 337 | | return TRUE; |
| 338 | | |
| 339 | | /* if we're in a timed state, we ignore changes until the time elapses */ |
| 340 | | if (attotime_compare(curtime, ld->state.endtime) < 0) |
| 341 | | return FALSE; |
| 342 | | |
| 343 | | /* if moving to a state that requires it, save the old state */ |
| 344 | | if (requires_state_save(newstate) && !requires_state_save(ld->state.state)) |
| 345 | | ld->savestate = ld->state; |
| 346 | | |
| 347 | | /* set up appropriate squelch and timing */ |
| 348 | | ld->state.state = newstate; |
| 349 | | ld->state.substate = 0; |
| 350 | | ld->state.param = parameter; |
| 351 | | ld->state.endtime = curtime; |
| 352 | | pr8210_update_squelch(ld); |
| 353 | | |
| 354 | | /* if we're switching to a timed state, set the appropriate timer */ |
| 355 | | switch (ld->state.state) |
| 356 | | { |
| 357 | | case LDSTATE_EJECTING: |
| 358 | | ld->state.endtime = attotime_add(curtime, GENERIC_EJECT_TIME); |
| 359 | | break; |
| 360 | | |
| 361 | | case LDSTATE_LOADING: |
| 362 | | ld->state.endtime = attotime_add(curtime, GENERIC_LOAD_TIME); |
| 363 | | break; |
| 364 | | |
| 365 | | case LDSTATE_SPINUP: |
| 366 | | ld->state.endtime = attotime_add(curtime, GENERIC_SPINUP_TIME); |
| 367 | | break; |
| 368 | | |
| 369 | | case LDSTATE_SEEKING: |
| 370 | | ld->state.endtime = attotime_add(curtime, PR8210_MINIMUM_SEEK_TIME); |
| 371 | | break; |
| 372 | | } |
| 373 | | return TRUE; |
| 302 | /* also set a timer to fetch the VBI data when it is ready */ |
| 303 | timer_set(video_screen_get_time_until_pos(ld->screen, 19*2, 0), ld, 0, vbi_data_fetch); |
| 374 | 304 | } |
| 375 | 305 | |
| 376 | 306 | |
| 377 | 307 | /*------------------------------------------------- |
| 378 | | pr8210_vsync - Start of VSYNC callback |
| 308 | pr8210_update - update callback, called on |
| 309 | the first visible line of the frame |
| 379 | 310 | -------------------------------------------------*/ |
| 380 | 311 | |
| 381 | | #if (EMULATE_PR8210_ROM) |
| 382 | | static TIMER_CALLBACK( vsync_off ) |
| 383 | | { |
| 384 | | ldplayer_data *player = ptr; |
| 385 | | player->vsync = FALSE; |
| 386 | | } |
| 387 | | |
| 388 | | static void pr8210_vsync(laserdisc_state *ld) |
| 389 | | { |
| 390 | | ldplayer_data *player = ld->player; |
| 391 | | player->vsync = TRUE; |
| 392 | | timer_set(attotime_mul(video_screen_get_scan_period(ld->screen), 4), player, 0, vsync_off); |
| 393 | | } |
| 394 | | #endif |
| 395 | | |
| 396 | | |
| 397 | | /*------------------------------------------------- |
| 398 | | pr8210_update - Pioneer PR-8210-specific |
| 399 | | update callback when using a ROM |
| 400 | | -------------------------------------------------*/ |
| 401 | | |
| 402 | | #if (EMULATE_PR8210_ROM) |
| 403 | | |
| 404 | 312 | static INT32 pr8210_update(laserdisc_state *ld, const vbi_metadata *vbi, int fieldnum, attotime curtime) |
| 405 | 313 | { |
| 406 | 314 | ldplayer_data *player = ld->player; |
| 407 | | UINT8 focus_on = !(player->porta & 0x08); |
| 408 | | UINT8 laser_on = !(player->portb & 0x01); |
| 409 | | UINT8 spdl_on = !(player->porta & 0x10); |
| 410 | | INT32 advanceby = 0; |
| 411 | | int frame, chapter; |
| 315 | UINT8 spdl_on = !(player->port1 & 0x10); |
| 412 | 316 | |
| 413 | | /* update PIA registers based on vbi code */ |
| 414 | | frame = frame_from_metadata(vbi); |
| 415 | | chapter = chapter_from_metadata(vbi); |
| 416 | | if (focus_on && laser_on && !(player->pia[0x80] & 1)) |
| 417 | | { |
| 418 | | if (frame == FRAME_LEAD_IN) |
| 419 | | player->pia[0xc0] = 0x10; /* or 0x12 */ |
| 420 | | else if (frame == FRAME_LEAD_OUT) |
| 421 | | player->pia[0xc0] = 0x11; |
| 422 | | else if (frame != FRAME_NOT_PRESENT) |
| 423 | | { |
| 424 | | player->pia[0xc0] = 0x02; /* bit 0x02 must be set for forward scanning to work */ |
| 425 | | player->pia[0x22] = 0xf0 | ((frame / 10000) % 10); |
| 426 | | player->pia[0x23] = 0xf0 | ((frame / 1000) % 10); |
| 427 | | player->pia[0x24] = 0xf0 | ((frame / 100) % 10); |
| 428 | | player->pia[0x25] = 0xf0 | ((frame / 10) % 10); |
| 429 | | player->pia[0x26] = 0xf0 | ((frame / 1) % 10); |
| 430 | | printf("Frame:%05d\n", frame); |
| 431 | | } |
| 432 | | else if (chapter != CHAPTER_NOT_PRESENT) |
| 433 | | { |
| 434 | | player->pia[0xc0] = 0x13; |
| 435 | | player->pia[0x20] = 0xf0 | ((chapter / 10) % 10); |
| 436 | | player->pia[0x21] = 0xf0 | ((chapter / 1) % 10); |
| 437 | | } |
| 438 | | // else |
| 439 | | // player->pia[0xc0] = 0x00; |
| 440 | | } |
| 441 | | player->pia[0xc0] |= 12;//4;//fieldnum << 2; |
| 317 | /* logging */ |
| 318 | if (LOG_VBLANK_VBI) |
| 319 | printf("%3d:Update(%d)\n", video_screen_get_vpos(ld->screen), fieldnum); |
| 442 | 320 | |
| 443 | | if (spdl_on) |
| 444 | | advanceby = fieldnum; |
| 445 | | |
| 446 | 321 | /* update overlay */ |
| 447 | | if ((player->pia[0x80] & 1) || player->framedisplay) |
| 322 | if (player->pia.display || player->pia.latchdisplay) |
| 448 | 323 | { |
| 449 | 324 | char buffer[16] = { 0 }; |
| 450 | 325 | int i; |
| 451 | 326 | for (i = 0; i < 15; i++) |
| 452 | 327 | { |
| 453 | | UINT8 c = player->pia[0x22 + i]; |
| 328 | UINT8 c = player->pia.text[i]; |
| 454 | 329 | if (c >= 0xf0 && c <= 0xf9) |
| 455 | 330 | c = '0' + (c - 0xf0); |
| 456 | 331 | else if (c < 0x20 || c > 0x7f) |
| r3289 | r3290 | |
| 459 | 334 | } |
| 460 | 335 | popmessage("%s", buffer); |
| 461 | 336 | } |
| 462 | | player->framedisplay = 0; |
| 337 | else |
| 338 | popmessage(NULL); |
| 339 | player->pia.latchdisplay = 0; |
| 463 | 340 | |
| 464 | | if (advanceby != 0) |
| 465 | | printf("Advancing by %d\n", advanceby); |
| 466 | | return advanceby; |
| 341 | /* if the spindle is on, we advance by 1 track after completing field #1 */ |
| 342 | return (spdl_on) ? fieldnum : 0; |
| 467 | 343 | } |
| 468 | | #endif |
| 469 | 344 | |
| 470 | 345 | |
| 471 | 346 | /*------------------------------------------------- |
| 472 | | pr8210_hle_update - Pioneer PR-8210-specific |
| 473 | | update callback when using HLE |
| 347 | pr8210_overlay - overlay callback, called |
| 348 | during frame processing in update to overlay |
| 349 | player data |
| 474 | 350 | -------------------------------------------------*/ |
| 475 | 351 | |
| 476 | | static INT32 pr8210_hle_update(laserdisc_state *ld, const vbi_metadata *vbi, int fieldnum, attotime curtime) |
| 352 | void pr8210_overlay(laserdisc_state *ld, bitmap_t *bitmap) |
| 477 | 353 | { |
| 478 | | ldplayer_state newstate; |
| 479 | | INT32 advanceby = 0; |
| 480 | | int frame; |
| 481 | | |
| 482 | | /* handle things based on the state */ |
| 483 | | switch (ld->state.state) |
| 484 | | { |
| 485 | | case LDSTATE_EJECTING: |
| 486 | | case LDSTATE_EJECTED: |
| 487 | | case LDSTATE_PARKED: |
| 488 | | case LDSTATE_LOADING: |
| 489 | | case LDSTATE_SPINUP: |
| 490 | | case LDSTATE_PAUSING: |
| 491 | | case LDSTATE_PAUSED: |
| 492 | | case LDSTATE_PLAYING: |
| 493 | | case LDSTATE_PLAYING_SLOW_REVERSE: |
| 494 | | case LDSTATE_PLAYING_SLOW_FORWARD: |
| 495 | | case LDSTATE_PLAYING_FAST_REVERSE: |
| 496 | | case LDSTATE_PLAYING_FAST_FORWARD: |
| 497 | | case LDSTATE_STEPPING_REVERSE: |
| 498 | | case LDSTATE_STEPPING_FORWARD: |
| 499 | | case LDSTATE_SCANNING: |
| 500 | | /* generic behaviors are appropriate for all of these commands */ |
| 501 | | advanceby = ldcore_generic_update(ld, vbi, fieldnum, curtime, &newstate); |
| 502 | | pr8210_switch_state(ld, newstate.state, newstate.param); |
| 503 | | break; |
| 504 | | |
| 505 | | case LDSTATE_SEEKING: |
| 506 | | /* if we're in the final state, look for a matching frame and pause there */ |
| 507 | | frame = frame_from_metadata(vbi); |
| 508 | | if (ld->state.substate == 3 && is_start_of_frame(vbi) && frame == ld->state.param) |
| 509 | | pr8210_switch_state(ld, LDSTATE_PAUSED, fieldnum); |
| 510 | | |
| 511 | | /* otherwise, if we got frame data from the VBI, update our seeking logic */ |
| 512 | | else if (ld->state.substate < 3 && frame != FRAME_NOT_PRESENT) |
| 513 | | { |
| 514 | | static const INT32 seekspeed[] = { -PR8210_SEEK_FAST_SPEED, PR8210_SEEK_FAST_SPEED, -PR8210_JUMP_REV_SPEED }; |
| 515 | | INT32 curseekspeed = seekspeed[ld->state.substate]; |
| 516 | | INT32 delta = (ld->state.param - 1) - frame; |
| 517 | | |
| 518 | | if ((curseekspeed < 0 && delta <= 0) || (curseekspeed > 0 && delta >= 0)) |
| 519 | | advanceby = curseekspeed; |
| 520 | | else |
| 521 | | ld->state.substate++; |
| 522 | | } |
| 523 | | |
| 524 | | /* otherwise, keep advancing until we know what's up */ |
| 525 | | else if (fieldnum == 1) |
| 526 | | advanceby = 1; |
| 527 | | break; |
| 528 | | |
| 529 | | case LDSTATE_STEPPING_BY_PARAMETER: |
| 530 | | /* advance after the second field of each frame */ |
| 531 | | if (fieldnum == 1) |
| 532 | | { |
| 533 | | /* note that we switch directly to PAUSED as we are not looking for frames */ |
| 534 | | advanceby = ld->state.param; |
| 535 | | pr8210_switch_state(ld, LDSTATE_STEPPING_BY_PARAMETER_PAUSED, 0); |
| 536 | | } |
| 537 | | break; |
| 538 | | |
| 539 | | case LDSTATE_STEPPING_BY_PARAMETER_PAUSED: |
| 540 | | /* generic pause behavior */ |
| 541 | | ld->state.state = LDSTATE_PAUSED; |
| 542 | | advanceby = ldcore_generic_update(ld, vbi, fieldnum, curtime, &newstate); |
| 543 | | if (newstate.state != LDSTATE_PAUSED) |
| 544 | | pr8210_switch_state(ld, newstate.state, newstate.param); |
| 545 | | else |
| 546 | | ld->state.state = LDSTATE_STEPPING_BY_PARAMETER_PAUSED; |
| 547 | | break; |
| 548 | | } |
| 549 | | |
| 550 | | return advanceby; |
| 354 | // ldplayer_data *player = ld->player; |
| 551 | 355 | } |
| 552 | 356 | |
| 553 | 357 | |
| 554 | | |
| 555 | 358 | /*------------------------------------------------- |
| 556 | | pr8210_hle_command - Pioneer PR-8210-specific |
| 557 | | command processing |
| 558 | | -------------------------------------------------*/ |
| 559 | | |
| 560 | | #if (!EMULATE_PR8210_ROM) |
| 561 | | static void pr8210_hle_command(laserdisc_state *ld) |
| 562 | | { |
| 563 | | ldplayer_data *player = ld->player; |
| 564 | | UINT8 cmd = player->lastcommand; |
| 565 | | |
| 566 | | switch (cmd) |
| 567 | | { |
| 568 | | case 0x00: CMDPRINTF(("pr8210: EOC\n")); |
| 569 | | /* EOC marker - can be safely ignored */ |
| 570 | | break; |
| 571 | | |
| 572 | | case 0x01: CMDPRINTF(("pr8210: 0\n")); |
| 573 | | player->parameter = (player->parameter == -1) ? 0 : (player->parameter * 10 + 0); |
| 574 | | break; |
| 575 | | |
| 576 | | case 0x02: CMDPRINTF(("pr8210: Slow reverse\n")); |
| 577 | | pr8210_switch_state(ld, LDSTATE_PLAYING_SLOW_REVERSE, PR8210_SLOW_SPEED); |
| 578 | | break; |
| 579 | | |
| 580 | | case 0x03: CMDPRINTF(("pr8210: 8\n")); |
| 581 | | player->parameter = (player->parameter == -1) ? 8 : (player->parameter * 10 + 8); |
| 582 | | break; |
| 583 | | |
| 584 | | case 0x04: CMDPRINTF(("pr8210: Step forward\n")); |
| 585 | | pr8210_switch_state(ld, LDSTATE_STEPPING_FORWARD, 0); |
| 586 | | break; |
| 587 | | |
| 588 | | case 0x05: CMDPRINTF(("pr8210: 4\n")); |
| 589 | | player->parameter = (player->parameter == -1) ? 4 : (player->parameter * 10 + 4); |
| 590 | | break; |
| 591 | | |
| 592 | | case 0x06 : CMDPRINTF(("pr8210: Chapter\n")); |
| 593 | | /* chapter -- not implemented */ |
| 594 | | break; |
| 595 | | |
| 596 | | case 0x08: CMDPRINTF(("pr8210: Scan forward\n")); |
| 597 | | if (ld->state.state != LDSTATE_SCANNING) |
| 598 | | pr8210_switch_state(ld, LDSTATE_SCANNING, SCANNING_PARAM(PR8210_SCAN_SPEED, PR8210_SCAN_DURATION)); |
| 599 | | else |
| 600 | | ld->state.substate = 0; |
| 601 | | break; |
| 602 | | |
| 603 | | case 0x09: CMDPRINTF(("pr8210: 2\n")); |
| 604 | | player->parameter = (player->parameter == -1) ? 2 : (player->parameter * 10 + 2); |
| 605 | | break; |
| 606 | | |
| 607 | | case 0x0a: CMDPRINTF(("pr8210: Pause\n")); |
| 608 | | pr8210_switch_state(ld, LDSTATE_PAUSING, 0); |
| 609 | | break; |
| 610 | | |
| 611 | | case 0x0b : CMDPRINTF(("pr8210: Frame\n")); |
| 612 | | /* frame -- not implemented */ |
| 613 | | break; |
| 614 | | |
| 615 | | case 0x0c: CMDPRINTF(("pr8210: Fast reverse\n")); |
| 616 | | pr8210_switch_state(ld, LDSTATE_PLAYING_FAST_REVERSE, PR8210_FAST_SPEED); |
| 617 | | break; |
| 618 | | |
| 619 | | case 0x0d: CMDPRINTF(("pr8210: 6\n")); |
| 620 | | player->parameter = (player->parameter == -1) ? 6 : (player->parameter * 10 + 6); |
| 621 | | break; |
| 622 | | |
| 623 | | case 0x0e: CMDPRINTF(("pr8210: Ch1 toggle\n")); |
| 624 | | player->audio1disable = !player->audio1disable; |
| 625 | | pr8210_update_squelch(ld); |
| 626 | | break; |
| 627 | | |
| 628 | | case 0x10: CMDPRINTF(("pr8210: Fast forward\n")); |
| 629 | | pr8210_switch_state(ld, LDSTATE_PLAYING_FAST_FORWARD, PR8210_FAST_SPEED); |
| 630 | | break; |
| 631 | | |
| 632 | | case 0x11: CMDPRINTF(("pr8210: 1\n")); |
| 633 | | player->parameter = (player->parameter == -1) ? 1 : (player->parameter * 10 + 1); |
| 634 | | break; |
| 635 | | |
| 636 | | case 0x12: CMDPRINTF(("pr8210: Step reverse\n")); |
| 637 | | pr8210_switch_state(ld, LDSTATE_STEPPING_REVERSE, 0); |
| 638 | | break; |
| 639 | | |
| 640 | | case 0x13: CMDPRINTF(("pr8210: 9\n")); |
| 641 | | player->parameter = (player->parameter == -1) ? 9 : (player->parameter * 10 + 9); |
| 642 | | break; |
| 643 | | |
| 644 | | case 0x14: CMDPRINTF(("pr8210: Play\n")); |
| 645 | | if (ld->state.state == LDSTATE_EJECTED) |
| 646 | | pr8210_switch_state(ld, LDSTATE_LOADING, 0); |
| 647 | | else if (ld->state.state == LDSTATE_PARKED) |
| 648 | | pr8210_switch_state(ld, LDSTATE_SPINUP, 0); |
| 649 | | else |
| 650 | | pr8210_switch_state(ld, LDSTATE_PLAYING, 0); |
| 651 | | break; |
| 652 | | |
| 653 | | case 0x15: CMDPRINTF(("pr8210: 5\n")); |
| 654 | | player->parameter = (player->parameter == -1) ? 5 : (player->parameter * 10 + 5); |
| 655 | | break; |
| 656 | | |
| 657 | | case 0x16: CMDPRINTF(("pr8210: Ch2 toggle\n")); |
| 658 | | player->audio2disable = !player->audio2disable; |
| 659 | | pr8210_update_squelch(ld); |
| 660 | | break; |
| 661 | | |
| 662 | | case 0x18: CMDPRINTF(("pr8210: Slow forward\n")); |
| 663 | | pr8210_switch_state(ld, LDSTATE_PLAYING_SLOW_FORWARD, PR8210_SLOW_SPEED); |
| 664 | | break; |
| 665 | | |
| 666 | | case 0x19: CMDPRINTF(("pr8210: 3\n")); |
| 667 | | player->parameter = (player->parameter == -1) ? 3 : (player->parameter * 10 + 3); |
| 668 | | break; |
| 669 | | |
| 670 | | case 0x1a: CMDPRINTF(("pr8210: Seek\n")); |
| 671 | | if (player->seekstate) |
| 672 | | { |
| 673 | | /* we're ready to seek */ |
| 674 | | CMDPRINTF(("pr8210: Seeking to frame %d\n", player->parameter)); |
| 675 | | pr8210_switch_state(ld, LDSTATE_SEEKING, player->parameter); |
| 676 | | } |
| 677 | | else |
| 678 | | { |
| 679 | | /* waiting for digits indicating position */ |
| 680 | | player->parameter = 0; |
| 681 | | } |
| 682 | | player->seekstate ^= 1; |
| 683 | | break; |
| 684 | | |
| 685 | | case 0x1c: CMDPRINTF(("pr8210: Scan reverse\n")); |
| 686 | | if (ld->state.state != LDSTATE_SCANNING) |
| 687 | | pr8210_switch_state(ld, LDSTATE_SCANNING, SCANNING_PARAM(-PR8210_SCAN_SPEED, PR8210_SCAN_DURATION)); |
| 688 | | else |
| 689 | | ld->state.substate = 0; |
| 690 | | break; |
| 691 | | |
| 692 | | case 0x1d: CMDPRINTF(("pr8210: 7\n")); |
| 693 | | player->parameter = (player->parameter == -1) ? 7 : (player->parameter * 10 + 7); |
| 694 | | break; |
| 695 | | |
| 696 | | case 0x1e: CMDPRINTF(("pr8210: Reject\n")); |
| 697 | | pr8210_switch_state(ld, LDSTATE_EJECTING, 0); |
| 698 | | break; |
| 699 | | |
| 700 | | default: CMDPRINTF(("pr8210: Unknown command %02X\n", cmd)); |
| 701 | | break; |
| 702 | | } |
| 703 | | } |
| 704 | | #endif |
| 705 | | |
| 706 | | |
| 707 | | /*------------------------------------------------- |
| 708 | 359 | pr8210_control_w - write callback when the |
| 709 | 360 | CONTROL line is toggled |
| 710 | 361 | -------------------------------------------------*/ |
| r3289 | r3290 | |
| 713 | 364 | { |
| 714 | 365 | ldplayer_data *player = ld->player; |
| 715 | 366 | |
| 716 | | if (data == ASSERT_LINE) |
| 367 | /* handle rising edge */ |
| 368 | if (prev != ASSERT_LINE && data == ASSERT_LINE) |
| 717 | 369 | { |
| 718 | 370 | attotime curtime = timer_get_time(); |
| 719 | 371 | attotime delta; |
| 720 | 372 | int longpulse; |
| 721 | 373 | |
| 722 | | /* if we timed out, reset the accumulator */ |
| 374 | /* if we timed out since the first bit, reset the accumulator */ |
| 723 | 375 | delta = attotime_sub(curtime, player->firstbittime); |
| 724 | | if (delta.attoseconds > ATTOTIME_IN_USEC(25320).attoseconds) |
| 376 | if (attotime_compare(delta, PR8210_MAX_WORD_TIME) > 0) |
| 725 | 377 | { |
| 726 | 378 | player->firstbittime = curtime; |
| 727 | 379 | player->accumulator = 0x5555; |
| 728 | | // printf("Reset accumulator\n"); |
| 380 | if (LOG_SERIAL) |
| 381 | printf("Reset accumulator\n"); |
| 729 | 382 | } |
| 730 | 383 | |
| 731 | 384 | /* get the time difference from the last assert */ |
| r3289 | r3290 | |
| 734 | 387 | player->lastbittime = curtime; |
| 735 | 388 | |
| 736 | 389 | /* 0 bit delta is 1.05 msec, 1 bit delta is 2.11 msec */ |
| 737 | | longpulse = (delta.attoseconds < ATTOTIME_IN_USEC(1500).attoseconds) ? 0 : 1; |
| 390 | longpulse = (attotime_compare(delta, PR8210_MIDPOINT_TIME) < 0) ? 0 : 1; |
| 738 | 391 | player->accumulator = (player->accumulator << 1) | longpulse; |
| 739 | 392 | |
| 740 | | #if 0 |
| 393 | /* log the deltas for debugging */ |
| 394 | if (LOG_SERIAL) |
| 741 | 395 | { |
| 742 | 396 | int usecdiff = (int)(delta.attoseconds / ATTOSECONDS_IN_USEC(1)); |
| 743 | 397 | printf("bitdelta = %5d (%d) - accum = %04X\n", usecdiff, longpulse, player->accumulator); |
| 744 | 398 | } |
| 745 | | #endif |
| 746 | 399 | |
| 747 | 400 | /* if we have a complete command, signal it */ |
| 748 | 401 | /* a complete command is 0,0,1 followed by 5 bits, followed by 0,0 */ |
| 749 | 402 | if ((player->accumulator & 0x383) == 0x80) |
| 750 | 403 | { |
| 751 | 404 | UINT8 newcommand = (player->accumulator >> 2) & 0x1f; |
| 405 | attotime rejectuntil; |
| 752 | 406 | |
| 753 | | //printf("New command = %02X (last=%02X)\n", newcommand, player->lastcommand); |
| 407 | /* data is stored to the PIA in bit-reverse order */ |
| 408 | player->pia.porta = BITSWAP8(newcommand, 0,1,2,3,4,5,6,7); |
| 754 | 409 | |
| 755 | | #if EMULATE_PR8210_ROM |
| 756 | | printf("Command = %02X\n", newcommand); |
| 757 | | // player->pia_porta = BITSWAP8(newcommand, 4,3,2,1,0,5,6,7); |
| 758 | | player->pia_porta = BITSWAP8(newcommand, 0,1,2,3,4,5,6,7); |
| 759 | | #else |
| 760 | | /* if we got a double command, act on it */ |
| 761 | | if (newcommand == player->lastcommand) |
| 410 | /* the MCU logic requires a 0 to execute many commands; however, nobody |
| 411 | consistently sends a 0, whereas they do tend to send duplicate commands... |
| 412 | if we assume that each duplicate causes a 0, we get the correct results */ |
| 413 | rejectuntil = attotime_add(player->lastcommandtime, PR8210_REJECT_DUPLICATE_TIME); |
| 414 | player->lastcommandtime = curtime; |
| 415 | if (player->pia.porta == player->lastcommand && attotime_compare(curtime, rejectuntil) < 0) |
| 416 | player->pia.porta = 0x00; |
| 417 | else |
| 418 | player->lastcommand = player->pia.porta; |
| 419 | |
| 420 | /* log the command and wait for a keypress */ |
| 421 | if (LOG_SERIAL) |
| 762 | 422 | { |
| 763 | | pr8210_hle_command(ld); |
| 764 | | player->lastcommand = 0; |
| 423 | printf("--- Command = %02X\n", player->pia.porta >> 3); |
| 424 | while (input_code_pressed(KEYCODE_ENTER)) ; |
| 425 | while (!input_code_pressed(KEYCODE_ENTER)) ; |
| 765 | 426 | } |
| 766 | | else |
| 767 | | player->lastcommand = newcommand; |
| 768 | | #endif |
| 427 | |
| 428 | /* reset the first bit time so that the accumulator clears on the next write */ |
| 429 | player->firstbittime = attotime_sub(curtime, PR8210_MAX_WORD_TIME); |
| 769 | 430 | } |
| 770 | 431 | } |
| 771 | 432 | } |
| 772 | 433 | |
| 773 | 434 | |
| 774 | | |
| 775 | | /*************************************************************************** |
| 776 | | SIMUTREK MODIFIED PR-8210 PLAYER IMPLEMENTATION |
| 777 | | ***************************************************************************/ |
| 778 | | |
| 779 | 435 | /*------------------------------------------------- |
| 780 | | |
| 781 | | Command Set: |
| 782 | | |
| 783 | | FX XX XX : Seek to frame XXXXX |
| 784 | | 01-19 : Skip forward 1-19 frames |
| 785 | | 99-81 : Skip back 1-19 frames |
| 786 | | 5a : Toggle frame display |
| 787 | | |
| 436 | vsync_off - timer callback to clear the VSYNC |
| 437 | flag |
| 788 | 438 | -------------------------------------------------*/ |
| 789 | 439 | |
| 790 | | /*------------------------------------------------- |
| 791 | | simutrek_init - Simutrek-specific |
| 792 | | initialization |
| 793 | | -------------------------------------------------*/ |
| 794 | | |
| 795 | | static void simutrek_init(laserdisc_state *ld) |
| 440 | static TIMER_CALLBACK( vsync_off ) |
| 796 | 441 | { |
| 797 | | /* do a soft reset */ |
| 798 | | pr8210_soft_reset(ld); |
| 442 | laserdisc_state *ld = ptr; |
| 443 | ld->player->vsync = FALSE; |
| 799 | 444 | } |
| 800 | 445 | |
| 801 | 446 | |
| 802 | 447 | /*------------------------------------------------- |
| 803 | | simutrek_status_r - Simutrek-specific |
| 804 | | command processing |
| 448 | vbi_data_fetch - timer callback to update the |
| 449 | VBI data in the PIA as soon as it is ready; |
| 450 | this must happy early in the frame because |
| 451 | the player logic relies on fetching it here |
| 805 | 452 | -------------------------------------------------*/ |
| 806 | 453 | |
| 807 | | static UINT8 simutrek_status_r(laserdisc_state *ld) |
| 454 | static TIMER_CALLBACK( vbi_data_fetch ) |
| 808 | 455 | { |
| 809 | | return (ld->state.state != LDSTATE_SEEKING) ? ASSERT_LINE : CLEAR_LINE; |
| 456 | laserdisc_state *ld = ptr; |
| 457 | ldplayer_data *player = ld->player; |
| 458 | UINT8 focus_on = !(player->port1 & 0x08); |
| 459 | UINT8 laser_on = !(player->port2 & 0x01); |
| 460 | UINT32 line16 = laserdisc_get_field_code(ld->device, LASERDISC_CODE_LINE16); |
| 461 | UINT32 line1718 = laserdisc_get_field_code(ld->device, LASERDISC_CODE_LINE1718); |
| 462 | |
| 463 | /* logging */ |
| 464 | if (LOG_VBLANK_VBI) |
| 465 | { |
| 466 | if ((line1718 & VBI_MASK_CAV_PICTURE) == VBI_CODE_CAV_PICTURE) |
| 467 | printf("%3d:VBI(%05d)\n", video_screen_get_vpos(ld->screen), VBI_CAV_PICTURE(line1718)); |
| 468 | else |
| 469 | printf("%3d:VBI()\n", video_screen_get_vpos(ld->screen)); |
| 470 | } |
| 471 | |
| 472 | /* update PIA registers based on vbi code */ |
| 473 | player->pia.vbi1 = 0xff; |
| 474 | player->pia.vbi2 = 0xff; |
| 475 | if (focus_on && laser_on) |
| 476 | { |
| 477 | if (line1718 == VBI_CODE_LEADIN) |
| 478 | player->pia.vbi1 &= ~0x01; |
| 479 | if (line1718 == VBI_CODE_LEADOUT) |
| 480 | player->pia.vbi1 &= ~0x02; |
| 481 | if (line16 == VBI_CODE_STOP) |
| 482 | player->pia.vbi1 &= ~0x04; |
| 483 | /* unsure what this bit means: player->pia.vbi1 &= ~0x08; */ |
| 484 | if ((line1718 & VBI_MASK_CAV_PICTURE) == VBI_CODE_CAV_PICTURE) |
| 485 | { |
| 486 | player->pia.vbi1 &= ~0x10; |
| 487 | player->pia.frame[2] = 0xf0 | ((line1718 >> 16) & 0x07); |
| 488 | player->pia.frame[3] = 0xf0 | ((line1718 >> 12) & 0x0f); |
| 489 | player->pia.frame[4] = 0xf0 | ((line1718 >> 8) & 0x0f); |
| 490 | player->pia.frame[5] = 0xf0 | ((line1718 >> 4) & 0x0f); |
| 491 | player->pia.frame[6] = 0xf0 | ((line1718 >> 0) & 0x0f); |
| 492 | } |
| 493 | if ((line1718 & VBI_MASK_CHAPTER) == VBI_CODE_CHAPTER) |
| 494 | { |
| 495 | player->pia.vbi2 &= ~0x01; |
| 496 | player->pia.frame[0] = 0xf0 | ((line1718 >> 16) & 0x07); |
| 497 | player->pia.frame[1] = 0xf0 | ((line1718 >> 12) & 0x0f); |
| 498 | } |
| 499 | } |
| 810 | 500 | } |
| 811 | 501 | |
| 812 | 502 | |
| 813 | 503 | /*------------------------------------------------- |
| 814 | | simutrek_data_w - Simutrek-specific |
| 815 | | data processing |
| 504 | pr8210_pia_r - handle reads from the mystery |
| 505 | Pioneer PIA |
| 816 | 506 | -------------------------------------------------*/ |
| 817 | 507 | |
| 818 | | static void simutrek_data_w(laserdisc_state *ld, UINT8 prev, UINT8 data) |
| 508 | static READ8_HANDLER( pr8210_pia_r ) |
| 819 | 509 | { |
| 510 | laserdisc_state *ld = find_pr8210(machine); |
| 820 | 511 | ldplayer_data *player = ld->player; |
| 512 | UINT8 result = 0xff; |
| 821 | 513 | |
| 822 | | /* Acknowledge every command byte */ |
| 823 | | if (player->cmd_ack_callback != NULL) |
| 824 | | (*player->cmd_ack_callback)(); |
| 825 | | |
| 826 | | /* Is this byte part of a multi-byte seek command? */ |
| 827 | | if (player->cmdcnt > 0) |
| 514 | switch (offset) |
| 828 | 515 | { |
| 829 | | CMDPRINTF(("Simutrek: Seek to frame byte %d of 3\n", player->cmdcnt + 1)); |
| 830 | | player->cmdbytes[player->cmdcnt++] = data; |
| 516 | /* (20-26) 7 characters for the chapter/frame */ |
| 517 | case 0x20: case 0x21: |
| 518 | case 0x22: case 0x23: case 0x24: case 0x25: case 0x26: |
| 519 | result = player->pia.frame[offset - 0x20]; |
| 520 | break; |
| 831 | 521 | |
| 832 | | if (player->cmdcnt == 3) |
| 833 | | { |
| 834 | | player->parameter = ((player->cmdbytes[0] & 0xf) * 10000) + |
| 835 | | ((player->cmdbytes[1] >> 4) * 1000) + |
| 836 | | ((player->cmdbytes[1] & 0xf) * 100) + |
| 837 | | ((player->cmdbytes[2] >> 4) * 10) + |
| 838 | | (player->cmdbytes[2] & 0xf); |
| 522 | /* (A0) port A value (from serial decoder) */ |
| 523 | case 0xa0: |
| 524 | result = player->pia.porta; |
| 525 | break; |
| 839 | 526 | |
| 840 | | CMDPRINTF(("Simutrek: Seek to frame %d\n", player->parameter)); |
| 527 | /* (C0) VBI decoding state 1 */ |
| 528 | case 0xc0: |
| 529 | if (LOG_VBLANK_VBI) |
| 530 | printf("%3d:PIA(C0)\n", video_screen_get_vpos(ld->screen)); |
| 531 | result = player->pia.vbi1; |
| 532 | break; |
| 841 | 533 | |
| 842 | | pr8210_switch_state(ld, LDSTATE_SEEKING, player->parameter); |
| 843 | | player->cmdcnt = 0; |
| 844 | | } |
| 534 | /* (E0) VBI decoding state 2 */ |
| 535 | case 0xe0: |
| 536 | if (LOG_VBLANK_VBI) |
| 537 | printf("%3d:PIA(E0)\n", video_screen_get_vpos(ld->screen)); |
| 538 | result = player->pia.vbi2; |
| 539 | break; |
| 540 | |
| 541 | default: |
| 542 | mame_printf_debug("%03X:Unknown PR-8210 PIA read from offset %02X\n", activecpu_get_pc(), offset); |
| 543 | break; |
| 845 | 544 | } |
| 846 | | else if (data == 0) |
| 847 | | { |
| 848 | | CMDPRINTF(("Simutrek: 0 ?\n")); |
| 849 | | } |
| 850 | | else if ((data & 0xf0) == 0xf0) |
| 851 | | { |
| 852 | | CMDPRINTF(("Simutrek: Seek to frame byte 1 of 3\n")); |
| 853 | | player->cmdbytes[player->cmdcnt++] = data; |
| 854 | | } |
| 855 | | else if (data >= 1 && data <= 0x19) |
| 856 | | { |
| 857 | | int count = ((data >> 4) * 10) + (data & 0xf); |
| 858 | | CMDPRINTF(("Simutrek: Step forwards by %d frame(s)\n", count)); |
| 859 | | pr8210_switch_state(ld, LDSTATE_STEPPING_BY_PARAMETER, count); |
| 860 | | } |
| 861 | | else if (data >= 0x81 && data <= 0x99) |
| 862 | | { |
| 863 | | int count = (((data >> 4) * 10) + (data & 0xf)) - 100; |
| 864 | | CMDPRINTF(("Simutrek: Step backwards by %d frame(s)\n", count)); |
| 865 | | pr8210_switch_state(ld, LDSTATE_STEPPING_BY_PARAMETER, count); |
| 866 | | } |
| 867 | | else if (data == 0x5a) |
| 868 | | { |
| 869 | | CMDPRINTF(("Simutrek: Frame window toggle\n")); |
| 870 | | player->framedisplay ^= 1; |
| 871 | | } |
| 872 | | else |
| 873 | | { |
| 874 | | CMDPRINTF(("Simutrek: Unknown command (%.2x)\n", data)); |
| 875 | | } |
| 545 | return result; |
| 876 | 546 | } |
| 877 | 547 | |
| 878 | 548 | |
| 879 | 549 | /*------------------------------------------------- |
| 880 | | simutrek_set_audio_squelch - Simutrek-specific |
| 881 | | command to enable/disable audio squelch |
| 550 | pr8210_pia_w - handle writes to the mystery |
| 551 | Pioneer PIA |
| 882 | 552 | -------------------------------------------------*/ |
| 883 | 553 | |
| 884 | | void simutrek_set_audio_squelch(const device_config *device, int state) |
| 554 | static WRITE8_HANDLER( pr8210_pia_w ) |
| 885 | 555 | { |
| 886 | | laserdisc_state *ld = ldcore_get_safe_token(device); |
| 887 | | int squelch = (state == 0); |
| 888 | | if (squelch) |
| 889 | | ldcore_set_audio_squelch(ld, squelch, squelch); |
| 890 | | else |
| 891 | | ldcore_set_audio_squelch(ld, squelch, squelch); |
| 892 | | } |
| 893 | | |
| 894 | | |
| 895 | | /*------------------------------------------------- |
| 896 | | simutrek_set_audio_squelch - Simutrek-specific |
| 897 | | command to set callback function for |
| 898 | | player/interface command acknowledge |
| 899 | | -------------------------------------------------*/ |
| 900 | | |
| 901 | | void simutrek_set_cmd_ack_callback(const device_config *device, void (*callback)(void)) |
| 902 | | { |
| 903 | | laserdisc_state *ld = ldcore_get_safe_token(device); |
| 556 | laserdisc_state *ld = find_pr8210(machine); |
| 904 | 557 | ldplayer_data *player = ld->player; |
| 558 | UINT8 value; |
| 905 | 559 | |
| 906 | | player->cmd_ack_callback = callback; |
| 907 | | } |
| 560 | switch (offset) |
| 561 | { |
| 562 | /* (22-30) 15 characters for the display */ |
| 563 | case 0x22: case 0x23: case 0x24: case 0x25: case 0x26: |
| 564 | case 0x27: case 0x28: case 0x29: case 0x2a: case 0x2b: |
| 565 | case 0x2c: case 0x2d: case 0x2e: case 0x2f: case 0x30: |
| 566 | player->pia.text[offset - 0x22] = data; |
| 567 | break; |
| 908 | 568 | |
| 569 | /* (40) control lines */ |
| 570 | case 0x40: |
| 909 | 571 | |
| 572 | /* toggle bit 0 to latch chapter number into display area */ |
| 573 | if (!(data & 0x01) && (player->pia.control & 0x01)) |
| 574 | { |
| 575 | memcpy(&player->pia.text[0], &player->pia.frame[0], 2); |
| 576 | memset(&player->pia.text[3], 0, 10); |
| 577 | player->pia.latchdisplay = 1; |
| 578 | } |
| 910 | 579 | |
| 911 | | /*************************************************************************** |
| 912 | | RE-IMPLEMENTATION USING ACTUAL ROMS |
| 913 | | ***************************************************************************/ |
| 580 | /* toggle bit 1 to latch frame number into display area */ |
| 581 | if (!(data & 0x02) && (player->pia.control & 0x02)) |
| 582 | { |
| 583 | memcpy(&player->pia.text[0], &player->pia.frame[2], 5); |
| 584 | memset(&player->pia.text[5], 0, 10); |
| 585 | player->pia.latchdisplay = 1; |
| 586 | } |
| 587 | player->pia.control = data; |
| 588 | break; |
| 914 | 589 | |
| 915 | | /************************************* |
| 916 | | * |
| 917 | | * Test PR-8210 ROM emulation |
| 918 | | * |
| 919 | | *************************************/ |
| 590 | /* (60) port B value (LEDs) */ |
| 591 | case 0x60: |
| 920 | 592 | |
| 921 | | static laserdisc_state *find_pr8210(running_machine *machine) |
| 922 | | { |
| 923 | | return ldcore_get_safe_token(device_list_first(machine->config->devicelist, LASERDISC)); |
| 924 | | } |
| 593 | /* these 4 are direct-connect */ |
| 594 | output_set_value("pr8210_audio1", (data & 0x01) != 0); |
| 595 | output_set_value("pr8210_audio2", (data & 0x02) != 0); |
| 596 | output_set_value("pr8210_clv", (data & 0x04) != 0); |
| 597 | output_set_value("pr8210_cav", (data & 0x08) != 0); |
| 925 | 598 | |
| 599 | /* remaining 3 bits select one of 5 LEDs via a mux */ |
| 600 | value = ((data & 0x40) >> 6) | ((data & 0x20) >> 4) | ((data & 0x10) >> 2); |
| 601 | output_set_value("pr8210_srev", (value == 0)); |
| 602 | output_set_value("pr8210_sfwd", (value == 1)); |
| 603 | output_set_value("pr8210_play", (value == 2)); |
| 604 | output_set_value("pr8210_step", (value == 3)); |
| 605 | output_set_value("pr8210_pause", (value == 4)); |
| 926 | 606 | |
| 927 | | static READ8_HANDLER( pr8210_pia_r ) |
| 928 | | { |
| 929 | | laserdisc_state *ld = find_pr8210(machine); |
| 930 | | ldplayer_data *player = ld->player; |
| 931 | | UINT8 result = player->pia[offset]; |
| 932 | | switch (offset) |
| 933 | | { |
| 934 | | case 0x22: |
| 935 | | case 0x23: |
| 936 | | case 0x24: |
| 937 | | case 0x25: |
| 938 | | case 0x26: |
| 939 | | case 0x27: |
| 940 | | case 0xc0: |
| 941 | | case 0xe0: |
| 607 | player->pia.portb = data; |
| 608 | update_audio_squelch(ld); |
| 942 | 609 | break; |
| 943 | 610 | |
| 944 | | case 0xa0: |
| 945 | | // printf("%03X:pia_r(%02X) = %02X\n", activecpu_get_pc(), offset, player->pia_porta); |
| 946 | | result = player->pia_porta; |
| 947 | | // player->pia_porta = 0; |
| 611 | /* (80) display enable */ |
| 612 | case 0x80: |
| 613 | player->pia.display = data & 0x01; |
| 948 | 614 | break; |
| 949 | 615 | |
| 616 | /* no other writes known */ |
| 950 | 617 | default: |
| 951 | | printf("%03X:pia_r(%02X)\n", activecpu_get_pc(), offset); |
| 618 | mame_printf_debug("%03X:Unknown PR-8210 PIA write to offset %02X = %02X\n", activecpu_get_pc(), offset, data); |
| 952 | 619 | break; |
| 953 | 620 | } |
| 954 | | return result; |
| 955 | 621 | } |
| 956 | 622 | |
| 957 | | static WRITE8_HANDLER( pr8210_pia_w ) |
| 958 | | { |
| 959 | | /* |
| 960 | | $22-26 (R) = read and copied to memory $23-27 |
| 961 | | $23 (R) = something compared against $F4 |
| 962 | | $22-26 (W) = SRCH. text |
| 963 | | $27-2B (W) = FRAME/CHAP. text |
| 964 | | $2C-30 (W) = frame or chapter number |
| 965 | | $40 (W) = $CF at initialization, tracked by ($78) |
| 966 | | $60 (W) = port B output, tracked by ($77) |
| 967 | | $80 = n/c |
| 968 | | $40 = (out) LED3 |
| 969 | | $20 = (out) LED2 |
| 970 | | $10 = (out) LED1 |
| 971 | | 123 -> LHL = Play |
| 972 | | -> HLL = Slow fwd |
| 973 | | -> LLL = Slow rev |
| 974 | | -> HHL = Still |
| 975 | | -> LLH = Pause |
| 976 | | -> HHH = all off |
| 977 | | $08 = (out) CAV LED |
| 978 | | $04 = (out) CLV LED |
| 979 | | $02 = (out) A2 LED/AUDIO 2 |
| 980 | | $01 = (out) A1 LED/AUDIO 1 |
| 981 | | $80 (W) = 0 or 1 |
| 982 | | $A0 (R) = port A input |
| 983 | | $C0 (R) = stored to ($2E) |
| 984 | | $E0 (R) = stored to ($2F) |
| 985 | | */ |
| 986 | | laserdisc_state *ld = find_pr8210(machine); |
| 987 | | ldplayer_data *player = ld->player; |
| 988 | | if (player->pia[offset] != data) |
| 989 | | { |
| 990 | | switch (offset) |
| 991 | | { |
| 992 | | case 0x40: |
| 993 | | if (!(data & 0x02) && (player->pia[offset] & 0x02)) |
| 994 | | player->framedisplay = 1; |
| 995 | | printf("%03X:pia_w(%02X) = %02X\n", activecpu_get_pc(), offset, data); |
| 996 | | break; |
| 997 | 623 | |
| 998 | | case 0x60: |
| 999 | | printf("%03X:pia_w(%02X) = %02X (PORT B LEDS:", activecpu_get_pc(), offset, data); |
| 1000 | | output_set_value("pr8210_audio1", (data & 0x01) != 0); |
| 1001 | | output_set_value("pr8210_audio2", (data & 0x02) != 0); |
| 1002 | | output_set_value("pr8210_clv", (data & 0x04) != 0); |
| 1003 | | output_set_value("pr8210_cav", (data & 0x08) != 0); |
| 1004 | | output_set_value("pr8210_led1", (data & 0x10) == 0); |
| 1005 | | output_set_value("pr8210_led2", (data & 0x20) == 0); |
| 1006 | | output_set_value("pr8210_led3", (data & 0x40) == 0); |
| 1007 | | if (!(data & 0x80)) printf(" ???"); |
| 1008 | | printf(")\n"); |
| 1009 | | player->pia_portb = data; |
| 1010 | | update_audio_squelch(ld); |
| 1011 | | break; |
| 624 | /*------------------------------------------------- |
| 625 | pr8210_bus_r - handle reads from the 8049 BUS |
| 626 | input, which is enabled via the PIA above |
| 627 | -------------------------------------------------*/ |
| 1012 | 628 | |
| 1013 | | default: |
| 1014 | | printf("%03X:pia_w(%02X) = %02X\n", activecpu_get_pc(), offset, data); |
| 1015 | | break; |
| 1016 | | } |
| 1017 | | player->pia[offset] = data; |
| 1018 | | } |
| 1019 | | } |
| 1020 | | |
| 1021 | 629 | static READ8_HANDLER( pr8210_bus_r ) |
| 1022 | 630 | { |
| 1023 | 631 | /* |
| r3289 | r3290 | |
| 1033 | 641 | laserdisc_state *ld = find_pr8210(machine); |
| 1034 | 642 | ldplayer_data *player = ld->player; |
| 1035 | 643 | slider_position sliderpos = ldcore_get_slider_position(ld); |
| 1036 | | UINT8 focus_on = !(player->porta & 0x08); |
| 1037 | | UINT8 spdl_on = !(player->porta & 0x10); |
| 644 | UINT8 focus_on = !(player->port1 & 0x08); |
| 645 | UINT8 spdl_on = !(player->port1 & 0x10); |
| 1038 | 646 | UINT8 result = 0x00; |
| 1039 | 647 | |
| 1040 | 648 | /* bus bit 6: slider position limit detector, inside and outside */ |
| r3289 | r3290 | |
| 1053 | 661 | if (!spdl_on) |
| 1054 | 662 | result |= 0x02; |
| 1055 | 663 | |
| 664 | /* bus bit 0: SLOW TIMER OUT */ |
| 665 | // if (attotime_compare(attotime_sub(timer_get_time(), player->slowtrg), |
| 666 | |
| 1056 | 667 | /* loop at beginning waits for $40=0, $02=1 */ |
| 1057 | 668 | return result; |
| 1058 | 669 | } |
| 1059 | 670 | |
| 1060 | | static WRITE8_HANDLER( pr8210_porta_w ) |
| 671 | |
| 672 | /*------------------------------------------------- |
| 673 | pr8210_port1_w - handle writes to the 8049 |
| 674 | port #1 |
| 675 | -------------------------------------------------*/ |
| 676 | |
| 677 | static WRITE8_HANDLER( pr8210_port1_w ) |
| 1061 | 678 | { |
| 1062 | 679 | /* |
| 1063 | 680 | $80 = (out) SCAN C (F/R) |
| r3289 | r3290 | |
| 1071 | 688 | */ |
| 1072 | 689 | laserdisc_state *ld = find_pr8210(machine); |
| 1073 | 690 | ldplayer_data *player = ld->player; |
| 1074 | | if ((data & 0xfe) != (player->porta & 0xfe)) |
| 1075 | | { |
| 1076 | | int direction = (data & 0x80) ? 1 : -1; |
| 691 | UINT8 prev = player->port1; |
| 692 | int direction; |
| 1077 | 693 | |
| 1078 | | printf("%03X:porta_w = %02X", activecpu_get_pc(), data); |
| 1079 | | if (!(data & 0x01) && (player->porta & 0x01)) |
| 1080 | | ldcore_advance_slider(ld, direction); |
| 1081 | | if (!(data & 0x02)) |
| 1082 | | printf(" SCAN:%c:%c", (data & 0x80) ? 'F' : 'R', (data & 0x04) ? 'L' : 'H'); |
| 1083 | | if (!(data & 0x08)) printf(" /FOCUSON"); |
| 1084 | | if (!(data & 0x10)) printf(" /SPDLON"); |
| 1085 | | if (data & 0x20) printf(" VIDEOSQ"); |
| 1086 | | if (data & 0x40) printf(" AUDIOSQ"); |
| 1087 | | printf("\n"); |
| 1088 | | player->porta = data; |
| 694 | /* set the new value */ |
| 695 | player->port1 = data; |
| 1089 | 696 | |
| 1090 | | ldcore_set_video_squelch(ld, (data & 0x20) != 0); |
| 1091 | | update_audio_squelch(ld); |
| 1092 | | if (!(data & 0x02)) |
| 697 | /* bit 7 selects the direction of slider movement for JUMP TRG and scanning */ |
| 698 | direction = (data & 0x80) ? 1 : -1; |
| 699 | |
| 700 | /* on the falling edge of bit 0, jump one track in either direction */ |
| 701 | if (!(data & 0x01) && (prev & 0x01)) |
| 702 | { |
| 703 | /* special override for the Simutrek, which takes over control of this is some situations */ |
| 704 | if (player->simutrek.cpunum == -1 || (player->simutrek.port2 & 0x04) != 0 || player->simutrek.jumphack) |
| 1093 | 705 | { |
| 1094 | | int delta = (data & 0x04) ? PR8210_SCAN_SPEED : PR8210_SEEK_FAST_SPEED; |
| 1095 | | ldcore_set_slider_speed(ld, delta * direction); |
| 706 | if (LOG_SIMUTREK) |
| 707 | printf("%3d:JUMP TRG\n", video_screen_get_vpos(ld->screen)); |
| 708 | ldcore_advance_slider(ld, direction); |
| 709 | player->simutrek.jumphack = 0; |
| 1096 | 710 | } |
| 1097 | | else |
| 1098 | | ldcore_set_slider_speed(ld, 0); |
| 711 | else if (LOG_SIMUTREK) |
| 712 | printf("%3d:Skipped JUMP TRG\n", video_screen_get_vpos(ld->screen)); |
| 1099 | 713 | } |
| 714 | |
| 715 | /* bit 1 low enables scanning */ |
| 716 | if (!(data & 0x02)) |
| 717 | { |
| 718 | /* bit 2 selects the speed */ |
| 719 | int delta = (data & 0x04) ? PR8210_SCAN_SPEED : PR8210_SEEK_FAST_SPEED; |
| 720 | ldcore_set_slider_speed(ld, delta * direction); |
| 721 | } |
| 722 | |
| 723 | /* bit 1 high stops scanning */ |
| 724 | else |
| 725 | ldcore_set_slider_speed(ld, 0); |
| 726 | |
| 727 | /* video squelch is controlled by bit 5 */ |
| 728 | update_video_squelch(ld); |
| 729 | |
| 730 | /* audio squelch is controlled by bit 6 */ |
| 731 | update_audio_squelch(ld); |
| 1100 | 732 | } |
| 1101 | 733 | |
| 1102 | | static WRITE8_HANDLER( pr8210_portb_w ) |
| 734 | |
| 735 | /*------------------------------------------------- |
| 736 | pr8210_port2_w - handle writes to the 8049 |
| 737 | port #2 |
| 738 | -------------------------------------------------*/ |
| 739 | |
| 740 | static WRITE8_HANDLER( pr8210_port2_w ) |
| 1103 | 741 | { |
| 1104 | 742 | /* |
| 1105 | 743 | $80 = (out) /CS on PIA |
| r3289 | r3290 | |
| 1113 | 751 | */ |
| 1114 | 752 | laserdisc_state *ld = find_pr8210(machine); |
| 1115 | 753 | ldplayer_data *player = ld->player; |
| 1116 | | cpunum_set_input_line(machine, player->cpunum, 0, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE); |
| 1117 | | if ((data & 0x7f) != (player->portb & 0x7f)) |
| 1118 | | { |
| 1119 | | printf("%03X:portb_w = %02X", activecpu_get_pc(), data); |
| 1120 | | if (!(data & 0x01)) printf(" LASERON"); |
| 1121 | | if (!(data & 0x02)) printf(" ???"); |
| 1122 | | if (!(data & 0x04)) printf(" TP1"); |
| 1123 | | if (!(data & 0x08)) printf(" TP2"); |
| 1124 | | output_set_value("pr8210_standby", !(data & 0x10)); |
| 1125 | | if (!(data & 0x20)) printf(" SLOWTRG"); |
| 1126 | | if (!(data & 0x40)) printf(" IRQGEN"); |
| 1127 | | // if (data & 0x80) printf(" PIASEL"); |
| 1128 | | printf("\n"); |
| 1129 | | player->portb = data; |
| 1130 | | } |
| 754 | UINT8 prev = player->port2; |
| 755 | |
| 756 | /* set the new value */ |
| 757 | player->port2 = data; |
| 758 | |
| 759 | /* on the falling edge of bit 5, start the slow timer */ |
| 760 | if (!(data & 0x20) && (prev & 0x20)) |
| 761 | player->slowtrg = timer_get_time(); |
| 762 | |
| 763 | /* bit 6 when low triggers an IRQ on the MCU */ |
| 764 | cpunum_set_input_line(machine, player->cpunum, MCS48_INPUT_IRQ, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE); |
| 765 | |
| 766 | /* standby LED is set accordingl to bit 4 */ |
| 767 | output_set_value("pr8210_standby", (data & 0x10) != 0); |
| 1131 | 768 | } |
| 1132 | 769 | |
| 1133 | 770 | |
| 771 | /*------------------------------------------------- |
| 772 | pr8210_t0_r - return the state of the 8049 |
| 773 | T0 input (connected to VSYNC) |
| 774 | -------------------------------------------------*/ |
| 775 | |
| 1134 | 776 | static READ8_HANDLER( pr8210_t0_r ) |
| 1135 | 777 | { |
| 1136 | 778 | /* returns VSYNC state */ |
| r3289 | r3290 | |
| 1139 | 781 | } |
| 1140 | 782 | |
| 1141 | 783 | |
| 784 | /*------------------------------------------------- |
| 785 | pr8210_t1_r - return the state of the 8049 |
| 786 | T1 input (pulled high) |
| 787 | -------------------------------------------------*/ |
| 788 | |
| 1142 | 789 | static READ8_HANDLER( pr8210_t1_r ) |
| 1143 | 790 | { |
| 1144 | | /* must return 1 or else it tries to jump to an external ROM */ |
| 1145 | 791 | return 1; |
| 1146 | 792 | } |
| 1147 | 793 | |
| 1148 | 794 | |
| 1149 | | static ADDRESS_MAP_START( pr8210_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 1150 | | AM_RANGE(0x000, 0x7ff) AM_ROM |
| 1151 | | ADDRESS_MAP_END |
| 1152 | 795 | |
| 796 | /*************************************************************************** |
| 797 | SIMUTREK ROM AND MACHINE INTERFACES |
| 798 | ***************************************************************************/ |
| 1153 | 799 | |
| 1154 | | static ADDRESS_MAP_START( pr8210_portmap, ADDRESS_SPACE_IO, 8 ) |
| 1155 | | AM_RANGE(0x00, 0xff) AM_READWRITE(pr8210_pia_r, pr8210_pia_w) |
| 1156 | | AM_RANGE(MCS48_PORT_BUS, MCS48_PORT_BUS) AM_READ(pr8210_bus_r) |
| 1157 | | AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_WRITE(pr8210_porta_w) |
| 1158 | | AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(pr8210_portb_w) |
| 1159 | | AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_READ(pr8210_t0_r) |
| 1160 | | AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(pr8210_t1_r) |
| 800 | static ADDRESS_MAP_START( simutrek_portmap, ADDRESS_SPACE_IO, 8 ) |
| 801 | AM_RANGE(0x00, 0xff) AM_READ(simutrek_data_r) |
| 802 | AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_READWRITE(simutrek_port2_r, simutrek_port2_w) |
| 803 | AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_READ(simutrek_t0_r) |
| 1161 | 804 | ADDRESS_MAP_END |
| 1162 | 805 | |
| 1163 | 806 | |
| 1164 | | MACHINE_DRIVER_START( pr8210 ) |
| 1165 | | MDRV_CPU_ADD("pr8210", I8049, XTAL_4_41MHz) |
| 1166 | | MDRV_CPU_PROGRAM_MAP(pr8210_map,0) |
| 1167 | | MDRV_CPU_IO_MAP(pr8210_portmap,0) |
| 807 | MACHINE_DRIVER_START( simutrek ) |
| 808 | MDRV_CPU_ADD("simutrek", I8748, XTAL_6MHz) |
| 809 | MDRV_CPU_IO_MAP(simutrek_portmap,0) |
| 810 | |
| 811 | MDRV_IMPORT_FROM(pr8210) |
| 1168 | 812 | MACHINE_DRIVER_END |
| 813 | |
| 814 | |
| 815 | ROM_START( simutrek ) |
| 816 | ROM_REGION( 0x800, "pr8210", ROMREGION_LOADBYNAME ) |
| 817 | ROM_LOAD( "pr-8210_mcu_ud6005a.bin", 0x000, 0x800, CRC(120fa83b) SHA1(b514326ca1f52d6d89056868f9d17eabd4e3f31d) ) |
| 818 | |
| 819 | ROM_REGION( 0x400, "simutrek", ROMREGION_LOADBYNAME) |
| 820 | ROM_LOAD( "laser_player_interface_d8748_a308.bin", 0x0000, 0x0400, CRC(eed3e728) SHA1(1eb3467f1c41553375b2c21952cd593b167f5416) ) |
| 821 | ROM_END |
| 822 | |
| 823 | |
| 824 | |
| 825 | /*************************************************************************** |
| 826 | SIMUTREK PLAYER INTERFACE |
| 827 | ***************************************************************************/ |
| 828 | |
| 829 | const ldplayer_interface simutrek_interface = |
| 830 | { |
| 831 | LASERDISC_TYPE_SIMUTREK_SPECIAL, /* type of the player */ |
| 832 | sizeof(ldplayer_data), /* size of the state */ |
| 833 | "Simutrek Modified PR-8210", /* name of the player */ |
| 834 | rom_simutrek, /* pointer to ROM region information */ |
| 835 | machine_config_simutrek, /* pointer to machine configuration */ |
| 836 | simutrek_init, /* initialization callback */ |
| 837 | simutrek_vsync, /* vsync callback */ |
| 838 | simutrek_update, /* update callback */ |
| 839 | pr8210_overlay, /* overlay callback */ |
| 840 | simutrek_data_w, /* parallel data write */ |
| 841 | { /* single line write: */ |
| 842 | NULL, /* LASERDISC_LINE_ENTER */ |
| 843 | NULL /* LASERDISC_LINE_CONTROL */ |
| 844 | }, |
| 845 | NULL, /* parallel data read */ |
| 846 | { /* single line read: */ |
| 847 | simutrek_ready_r, /* LASERDISC_LINE_READY */ |
| 848 | simutrek_status_r, /* LASERDISC_LINE_STATUS */ |
| 849 | NULL, /* LASERDISC_LINE_COMMAND */ |
| 850 | NULL, /* LASERDISC_LINE_DATA_AVAIL */ |
| 851 | } |
| 852 | }; |
| 853 | |
| 854 | |
| 855 | |
| 856 | /*************************************************************************** |
| 857 | SIMUTREK IMPLEMENTATION |
| 858 | ***************************************************************************/ |
| 859 | |
| 860 | /*------------------------------------------------- |
| 861 | simutrek_set_audio_squelch - Simutrek-specific |
| 862 | command to enable/disable audio squelch |
| 863 | -------------------------------------------------*/ |
| 864 | |
| 865 | void simutrek_set_audio_squelch(const device_config *device, int state) |
| 866 | { |
| 867 | laserdisc_state *ld = ldcore_get_safe_token(device); |
| 868 | ldplayer_data *player = ld->player; |
| 869 | player->simutrek.audio_squelch = (state == 0); |
| 870 | update_audio_squelch(ld); |
| 871 | } |
| 872 | |
| 873 | |
| 874 | /*------------------------------------------------- |
| 875 | simutrek_init - Simutrek-specific |
| 876 | initialization |
| 877 | -------------------------------------------------*/ |
| 878 | |
| 879 | static void simutrek_init(laserdisc_state *ld) |
| 880 | { |
| 881 | astring *tempstring = astring_alloc(); |
| 882 | |
| 883 | /* standard PR-8210 initialization */ |
| 884 | pr8210_init(ld); |
| 885 | |
| 886 | /* find the Simutrek CPU */ |
| 887 | astring_printf(tempstring, "%s:%s", ld->device->tag, "simutrek"); |
| 888 | ld->player->simutrek.cpunum = mame_find_cpu_index(ld->device->machine, astring_c(tempstring)); |
| 889 | astring_free(tempstring); |
| 890 | } |
| 891 | |
| 892 | |
| 893 | /*------------------------------------------------- |
| 894 | simutrek_vsync - VSYNC callback, called at the |
| 895 | start of the blanking period |
| 896 | -------------------------------------------------*/ |
| 897 | |
| 898 | static TIMER_CALLBACK( irq_off ) |
| 899 | { |
| 900 | laserdisc_state *ld = ptr; |
| 901 | ldplayer_data *player = ld->player; |
| 902 | cpunum_set_input_line(ld->device->machine, player->simutrek.cpunum, MCS48_INPUT_IRQ, CLEAR_LINE); |
| 903 | if (LOG_SIMUTREK) |
| 904 | printf("%3d:**** Simutrek IRQ clear\n", video_screen_get_vpos(ld->screen)); |
| 905 | } |
| 906 | |
| 907 | static void simutrek_vsync(laserdisc_state *ld, const vbi_metadata *vbi, int fieldnum, attotime curtime) |
| 908 | { |
| 909 | ldplayer_data *player = ld->player; |
| 910 | |
| 911 | if (LOG_SIMUTREK) |
| 912 | printf("%3d:VSYNC(%d)\n", video_screen_get_vpos(ld->screen), fieldnum); |
| 913 | pr8210_vsync(ld, vbi, fieldnum, curtime); |
| 914 | |
| 915 | if (player->simutrek.data_ready) |
| 916 | { |
| 917 | if (LOG_SIMUTREK) |
| 918 | printf("%3d:VSYNC IRQ\n", video_screen_get_vpos(ld->screen)); |
| 919 | cpunum_set_input_line(ld->device->machine, player->simutrek.cpunum, MCS48_INPUT_IRQ, ASSERT_LINE); |
| 920 | timer_set(video_screen_get_scan_period(ld->screen), ld, 0, irq_off); |
| 921 | } |
| 922 | } |
| 923 | |
| 924 | |
| 925 | /*------------------------------------------------- |
| 926 | simutrek_update - update callback, called on |
| 927 | the first visible line of the frame |
| 928 | -------------------------------------------------*/ |
| 929 | |
| 930 | static INT32 simutrek_update(laserdisc_state *ld, const vbi_metadata *vbi, int fieldnum, attotime curtime) |
| 931 | { |
| 932 | return pr8210_update(ld, vbi, fieldnum, curtime); |
| 933 | } |
| 934 | |
| 935 | |
| 936 | /*------------------------------------------------- |
| 937 | simutrek_ready_r - read callback when the |
| 938 | READY line is read |
| 939 | -------------------------------------------------*/ |
| 940 | |
| 941 | static UINT8 simutrek_ready_r(laserdisc_state *ld) |
| 942 | { |
| 943 | return !ld->player->simutrek.data_ready; |
| 944 | } |
| 945 | |
| 946 | |
| 947 | /*------------------------------------------------- |
| 948 | simutrek_status_r - read callback when the |
| 949 | STATUS line is read |
| 950 | -------------------------------------------------*/ |
| 951 | |
| 952 | static UINT8 simutrek_status_r(laserdisc_state *ld) |
| 953 | { |
| 954 | return ((ld->player->simutrek.port2 & 0x03) == 0x03) ? ASSERT_LINE : CLEAR_LINE; |
| 955 | } |
| 956 | |
| 957 | |
| 958 | /*------------------------------------------------- |
| 959 | simutrek_data_w - write callback when the |
| 960 | parallel data port is written to |
| 961 | -------------------------------------------------*/ |
| 962 | |
| 963 | static void simutrek_data_w(laserdisc_state *ld, UINT8 prev, UINT8 data) |
| 964 | { |
| 965 | timer_call_after_resynch(ld, data, simutrek_latched_data_w); |
| 966 | if (LOG_SIMUTREK) |
| 967 | printf("%03d:**** Simutrek Command = %02X\n", video_screen_get_vpos(ld->screen), data); |
| 968 | } |
| 969 | |
| 970 | |
| 971 | /*------------------------------------------------- |
| 972 | simutrek_latched_data_w - deferred write |
| 973 | callback for when data is written |
| 974 | -------------------------------------------------*/ |
| 975 | |
| 976 | static TIMER_CALLBACK( simutrek_latched_data_w ) |
| 977 | { |
| 978 | laserdisc_state *ld = ptr; |
| 979 | ldplayer_data *player = ld->player; |
| 980 | |
| 981 | /* store the data and set the ready flag */ |
| 982 | player->simutrek.data = param; |
| 983 | player->simutrek.data_ready = TRUE; |
| 984 | } |
| 985 | |
| 986 | |
| 987 | /*------------------------------------------------- |
| 988 | simutrek_port2_r - handle reads from the 8748 |
| 989 | port #2 |
| 990 | -------------------------------------------------*/ |
| 991 | |
| 992 | static READ8_HANDLER( simutrek_port2_r ) |
| 993 | { |
| 994 | laserdisc_state *ld = find_pr8210(machine); |
| 995 | ldplayer_data *player = ld->player; |
| 996 | |
| 997 | /* bit $80 is the pr8210 video squelch */ |
| 998 | return (player->port1 & 0x20) ? 0x00 : 0x80; |
| 999 | } |
| 1000 | |
| 1001 | |
| 1002 | /*------------------------------------------------- |
| 1003 | simutrek_port2_w - handle writes to the 8748 |
| 1004 | port #2 |
| 1005 | -------------------------------------------------*/ |
| 1006 | |
| 1007 | static WRITE8_HANDLER( simutrek_port2_w ) |
| 1008 | { |
| 1009 | laserdisc_state *ld = find_pr8210(machine); |
| 1010 | ldplayer_data *player = ld->player; |
| 1011 | UINT8 prev = player->simutrek.port2; |
| 1012 | |
| 1013 | /* update stat */ |
| 1014 | player->simutrek.port2 = data; |
| 1015 | |
| 1016 | /* bit $20 goes to the serial line */ |
| 1017 | if ((data ^ prev) & 0x20) |
| 1018 | pr8210_control_w(ld, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE, (data & 0x20) ? CLEAR_LINE : ASSERT_LINE); |
| 1019 | |
| 1020 | /* bit $10 goes to JUMP TRG */ |
| 1021 | /* bit $08 controls direction */ |
| 1022 | if (!(data & 0x10) && (prev & 0x10)) |
| 1023 | { |
| 1024 | int direction = (data & 0x08) ? 1 : -1; |
| 1025 | if (LOG_SIMUTREK) |
| 1026 | printf("%3d:JUMP TRG (Simutrek PC=%03X)\n", video_screen_get_vpos(ld->screen), activecpu_get_pc()); |
| 1027 | ldcore_advance_slider(ld, direction); |
| 1028 | } |
| 1029 | |
| 1030 | /* bit $04 controls who owns the JUMP TRG command */ |
| 1031 | if (!(data & 0x04) && (prev & 0x04)) |
| 1032 | player->simutrek.jumphack = 1; |
| 1033 | |
| 1034 | /* bits $03 control something (status?) */ |
| 1035 | if (LOG_SIMUTREK && ((data ^ prev) & 0x03)) |
| 1036 | printf("Simutrek Status = %d\n", data & 0x03); |
| 1037 | } |
| 1038 | |
| 1039 | |
| 1040 | /*------------------------------------------------- |
| 1041 | simutrek_data_r - handle external 8748 data |
| 1042 | reads |
| 1043 | -------------------------------------------------*/ |
| 1044 | |
| 1045 | static READ8_HANDLER( simutrek_data_r ) |
| 1046 | { |
| 1047 | laserdisc_state *ld = find_pr8210(machine); |
| 1048 | ldplayer_data *player = ld->player; |
| 1049 | |
| 1050 | /* acknowledge the read and clear the data ready flag */ |
| 1051 | player->simutrek.data_ready = FALSE; |
| 1052 | return player->simutrek.data; |
| 1053 | } |
| 1054 | |
| 1055 | |
| 1056 | /*------------------------------------------------- |
| 1057 | simutrek_t0_r - return the status of the |
| 1058 | 8748 T0 input |
| 1059 | -------------------------------------------------*/ |
| 1060 | |
| 1061 | static READ8_HANDLER( simutrek_t0_r ) |
| 1062 | { |
| 1063 | /* return 1 if data is waiting from main CPU */ |
| 1064 | laserdisc_state *ld = find_pr8210(machine); |
| 1065 | return ld->player->simutrek.data_ready; |
| 1066 | } |
src/emu/machine/ldcore.c
| r3289 | r3290 | |
| 23 | 23 | DEBUGGING |
| 24 | 24 | ***************************************************************************/ |
| 25 | 25 | |
| 26 | | #define LOG_POSITION(x) /*printf x*/ |
| 26 | #define LOG_SLIDER 0 |
| 27 | 27 | |
| 28 | 28 | |
| 29 | 29 | |
| r3289 | r3290 | |
| 42 | 42 | TYPE DEFINITIONS |
| 43 | 43 | ***************************************************************************/ |
| 44 | 44 | |
| 45 | /* video frame data */ |
| 46 | typedef struct _frame_data frame_data; |
| 47 | struct _frame_data |
| 48 | { |
| 49 | bitmap_t * bitmap; /* cached bitmap */ |
| 50 | bitmap_t * visbitmap; /* wrapper around bitmap with only visible lines */ |
| 51 | UINT8 numfields; /* number of fields in this frame */ |
| 52 | INT32 lastfield; /* last absolute field number */ |
| 53 | }; |
| 54 | |
| 55 | |
| 45 | 56 | /* core-specific data */ |
| 46 | 57 | struct _ldcore_data |
| 47 | 58 | { |
| r3289 | r3290 | |
| 51 | 62 | |
| 52 | 63 | /* disc parameters */ |
| 53 | 64 | chd_file * disc; /* handle to the disc itself */ |
| 65 | UINT8 * vbidata; /* pointer to precomputed VBI data */ |
| 54 | 66 | int width; /* width of video */ |
| 55 | 67 | int height; /* height of video */ |
| 56 | 68 | UINT32 fps_times_1million; /* frame rate of video */ |
| 57 | 69 | int samplerate; /* audio samplerate */ |
| 58 | | UINT8 readpending; /* true if a read is pending */ |
| 70 | chd_error readresult; /* result of the most recent read */ |
| 59 | 71 | UINT32 chdtracks; /* number of tracks in the CHD */ |
| 60 | 72 | av_codec_decompress_config avconfig; /* decompression configuration */ |
| 61 | 73 | |
| r3289 | r3290 | |
| 69 | 81 | attotime sliderupdate; /* time of last slider update */ |
| 70 | 82 | |
| 71 | 83 | /* video data */ |
| 72 | | bitmap_t * videoframe[3]; /* currently cached frames */ |
| 73 | | bitmap_t * videovisframe[3]; /* wrapper around videoframe with only visible lines */ |
| 74 | | UINT8 videofields[3]; /* number of fields in each frame */ |
| 75 | | UINT32 videoframenum[3]; /* frame number contained in each frame */ |
| 84 | frame_data frame[3]; /* circular list of frames */ |
| 76 | 85 | UINT8 videoindex; /* index of the current video buffer */ |
| 77 | 86 | bitmap_t videotarget; /* fake target bitmap for decompression */ |
| 78 | 87 | bitmap_t * emptyframe; /* blank frame */ |
| r3289 | r3290 | |
| 88 | 97 | |
| 89 | 98 | /* metadata */ |
| 90 | 99 | vbi_metadata metadata[2]; /* metadata parsed from the stream, for each field */ |
| 91 | | int last_frame; /* last seen frame number */ |
| 92 | | int last_chapter; /* last seen chapter number */ |
| 93 | 100 | |
| 94 | 101 | /* I/O data */ |
| 95 | 102 | UINT8 datain; /* current input data value */ |
| r3289 | r3290 | |
| 122 | 129 | ***************************************************************************/ |
| 123 | 130 | |
| 124 | 131 | /* generic helper functions */ |
| 132 | static TIMER_CALLBACK( perform_player_update ); |
| 125 | 133 | static void read_track_data(laserdisc_state *ld); |
| 126 | 134 | static void process_track_data(const device_config *device); |
| 127 | | static void fake_metadata(UINT32 track, UINT8 which, vbi_metadata *metadata); |
| 128 | 135 | //static void render_display(UINT16 *videodata, UINT32 rowpixels, UINT32 width, int frame); |
| 129 | 136 | static void *custom_start(int clock, const custom_sound_interface *config); |
| 130 | 137 | static void custom_stream_callback(void *param, stream_sample_t **inputs, stream_sample_t **outputs, int samples); |
| r3289 | r3290 | |
| 377 | 384 | /* update current track based on slider speed */ |
| 378 | 385 | update_slider_pos(ldcore, curtime); |
| 379 | 386 | |
| 380 | | /* on rising edge, call the player-specific VSYNC function */ |
| 387 | /* on rising edge, process previously-read frame and inform the player */ |
| 381 | 388 | if (vblank_state) |
| 382 | 389 | { |
| 390 | /* call the player's VSYNC callback */ |
| 383 | 391 | if (ldcore->intf.vsync != NULL) |
| 384 | | (*ldcore->intf.vsync)(ld); |
| 385 | | return; |
| 392 | (*ldcore->intf.vsync)(ld, &ldcore->metadata[ldcore->fieldnum], ldcore->fieldnum, curtime); |
| 393 | |
| 394 | /* set a timer to begin fetching the next frame just before the VBI data would be fetched */ |
| 395 | timer_set(video_screen_get_time_until_pos(screen, 16*2, 0), ld, 0, perform_player_update); |
| 386 | 396 | } |
| 397 | } |
| 387 | 398 | |
| 388 | | /* on falling edge, do the bulk of the processing */ |
| 399 | |
| 400 | /*------------------------------------------------- |
| 401 | vblank_state_changed - called on each state |
| 402 | change of the VBLANK signal |
| 403 | -------------------------------------------------*/ |
| 404 | |
| 405 | static TIMER_CALLBACK( perform_player_update ) |
| 406 | { |
| 407 | laserdisc_state *ld = ptr; |
| 408 | ldcore_data *ldcore = ld->core; |
| 409 | attotime curtime = timer_get_time(); |
| 410 | |
| 389 | 411 | /* wait for previous read and decode to finish */ |
| 390 | | process_track_data(device); |
| 412 | process_track_data(ld->device); |
| 391 | 413 | |
| 414 | /* update current track based on slider speed */ |
| 415 | update_slider_pos(ldcore, curtime); |
| 416 | |
| 392 | 417 | /* update the state */ |
| 393 | 418 | if (ldcore->intf.update != NULL) |
| 394 | 419 | add_and_clamp_track(ldcore, (*ldcore->intf.update)(ld, &ldcore->metadata[ldcore->fieldnum], ldcore->fieldnum, curtime)); |
| r3289 | r3290 | |
| 501 | 526 | |
| 502 | 527 | /*------------------------------------------------- |
| 503 | 528 | laserdisc_get_video - return the current |
| 504 | | video frame |
| 529 | video frame; return TRUE if valid or FALSE |
| 530 | if video off |
| 505 | 531 | -------------------------------------------------*/ |
| 506 | 532 | |
| 507 | | UINT32 laserdisc_get_video(const device_config *device, bitmap_t **bitmap) |
| 533 | int laserdisc_get_video(const device_config *device, bitmap_t **bitmap) |
| 508 | 534 | { |
| 509 | 535 | laserdisc_state *ld = get_safe_token(device); |
| 510 | 536 | ldcore_data *ldcore = ld->core; |
| 511 | | int frameindex; |
| 537 | frame_data *frame; |
| 512 | 538 | |
| 513 | 539 | /* determine the most recent live set of frames */ |
| 514 | | frameindex = ldcore->videoindex; |
| 515 | | if (ldcore->videofields[frameindex] < 2) |
| 516 | | frameindex = (frameindex + ARRAY_LENGTH(ldcore->videofields) - 1) % ARRAY_LENGTH(ldcore->videofields); |
| 540 | frame = &ldcore->frame[ldcore->videoindex]; |
| 541 | if (frame->numfields < 2) |
| 542 | frame = &ldcore->frame[(ldcore->videoindex + ARRAY_LENGTH(ldcore->frame) - 1) % ARRAY_LENGTH(ldcore->frame)]; |
| 517 | 543 | |
| 518 | 544 | /* if no video present, return the empty frame */ |
| 519 | | if (ldcore->videosquelch || ldcore->videofields[frameindex] < 2) |
| 545 | if (ldcore->videosquelch || frame->numfields < 2) |
| 520 | 546 | { |
| 521 | 547 | *bitmap = ldcore->emptyframe; |
| 522 | | return 0; |
| 548 | return FALSE; |
| 523 | 549 | } |
| 524 | 550 | else |
| 525 | 551 | { |
| 526 | | *bitmap = ldcore->videovisframe[frameindex]; |
| 527 | | return ldcore->videoframenum[frameindex]; |
| 552 | *bitmap = frame->visbitmap; |
| 553 | return TRUE; |
| 528 | 554 | } |
| 529 | 555 | } |
| 530 | 556 | |
| r3289 | r3290 | |
| 538 | 564 | { |
| 539 | 565 | laserdisc_state *ld = get_safe_token(device); |
| 540 | 566 | ldcore_data *ldcore = ld->core; |
| 541 | | int field = ldcore->fieldnum ^ 1; |
| 567 | int field = ldcore->fieldnum; |
| 542 | 568 | |
| 543 | | /* if no video present, return */ |
| 544 | | if (ldcore->videosquelch) |
| 545 | | return 0; |
| 546 | | |
| 547 | 569 | switch (code) |
| 548 | 570 | { |
| 549 | 571 | case LASERDISC_CODE_WHITE_FLAG: |
| r3289 | r3290 | |
| 557 | 579 | |
| 558 | 580 | case LASERDISC_CODE_LINE18: |
| 559 | 581 | return ldcore->metadata[field].line18; |
| 582 | |
| 583 | case LASERDISC_CODE_LINE1718: |
| 584 | return ldcore->metadata[field].line1718; |
| 560 | 585 | } |
| 561 | 586 | |
| 562 | 587 | return 0; |
| r3289 | r3290 | |
| 626 | 651 | else |
| 627 | 652 | ldcore->attospertrack = -attotime_to_attoseconds(attotime_div(vsyncperiod, -tracks_per_vsync)); |
| 628 | 653 | |
| 629 | | printf("Slider speed = %d\n", tracks_per_vsync); |
| 654 | if (LOG_SLIDER) |
| 655 | printf("Slider speed = %d\n", tracks_per_vsync); |
| 630 | 656 | } |
| 631 | 657 | |
| 632 | 658 | |
| r3289 | r3290 | |
| 641 | 667 | |
| 642 | 668 | update_slider_pos(ldcore, timer_get_time()); |
| 643 | 669 | add_and_clamp_track(ldcore, numtracks); |
| 644 | | printf("Advance by %d\n", numtracks); |
| 670 | if (LOG_SLIDER) |
| 671 | printf("Advance by %d\n", numtracks); |
| 645 | 672 | } |
| 646 | 673 | |
| 647 | 674 | |
| r3289 | r3290 | |
| 861 | 888 | ldcore_data *ldcore = ld->core; |
| 862 | 889 | UINT32 tracknum = ldcore->curtrack; |
| 863 | 890 | UINT32 fieldnum = ldcore->fieldnum; |
| 864 | | chd_error err; |
| 891 | frame_data *frame; |
| 892 | UINT32 vbiframe; |
| 893 | UINT32 readhunk; |
| 894 | INT32 chdtrack; |
| 865 | 895 | |
| 866 | | /* if the previous field had the white flag, force the new field to pair with it */ |
| 867 | | if (ldcore->metadata[fieldnum ^ 1].white) |
| 868 | | ldcore->videofields[ldcore->videoindex] = 1; |
| 896 | /* if the previous field had a frame number, and the new field immediately follows it, |
| 897 | force the new field to pair with the previous one */ |
| 898 | frame = &ldcore->frame[ldcore->videoindex]; |
| 899 | if ((ldcore->metadata[fieldnum ^ 1].line1718 & VBI_MASK_CAV_PICTURE) == VBI_CODE_CAV_PICTURE && (tracknum * 2 + fieldnum == frame->lastfield + 1)) |
| 900 | frame->numfields = 1; |
| 869 | 901 | |
| 902 | /* otherwise, keep the frames in sync with the absolute field numbers */ |
| 903 | else if (frame->numfields == 2 && fieldnum != 0) |
| 904 | frame->numfields--; |
| 905 | |
| 870 | 906 | /* if we already have both fields on the current videoindex, advance */ |
| 871 | | if (ldcore->videofields[ldcore->videoindex] >= 2) |
| 907 | else if (frame->numfields >= 2) |
| 872 | 908 | { |
| 873 | | ldcore->videoindex = (ldcore->videoindex + 1) % ARRAY_LENGTH(ldcore->videofields); |
| 874 | | ldcore->videofields[ldcore->videoindex] = 0; |
| 909 | ldcore->videoindex = (ldcore->videoindex + 1) % ARRAY_LENGTH(ldcore->frame); |
| 910 | frame = &ldcore->frame[ldcore->videoindex]; |
| 911 | frame->numfields = 0; |
| 875 | 912 | } |
| 876 | 913 | |
| 914 | /* if we're squelched, reset the frame counter */ |
| 915 | if (ldcore->videosquelch) |
| 916 | frame->numfields = 0; |
| 917 | |
| 918 | /* remember the last field number */ |
| 919 | frame->lastfield = tracknum * 2 + fieldnum; |
| 920 | |
| 877 | 921 | /* set the video target information */ |
| 878 | | ldcore->videotarget = *ldcore->videoframe[ldcore->videoindex]; |
| 922 | ldcore->videotarget = *frame->bitmap; |
| 879 | 923 | ldcore->videotarget.base = BITMAP_ADDR16(&ldcore->videotarget, fieldnum, 0); |
| 880 | 924 | ldcore->videotarget.height /= 2; |
| 881 | 925 | ldcore->videotarget.rowpixels *= 2; |
| r3289 | r3290 | |
| 900 | 944 | ldcore->avconfig.actsamples = &ldcore->audiocursamples; |
| 901 | 945 | ldcore->audiocursamples = 0; |
| 902 | 946 | |
| 947 | /* compute the chdhunk number we are going to read */ |
| 948 | chdtrack = tracknum - 1 - VIRTUAL_LEAD_IN_TRACKS; |
| 949 | chdtrack = MAX(chdtrack, 0); |
| 950 | chdtrack = MIN(chdtrack, ldcore->chdtracks - 1); |
| 951 | readhunk = chdtrack * 2 + fieldnum; |
| 952 | |
| 953 | /* set the VBI data for the new field from our precomputed data */ |
| 954 | if (ldcore->vbidata != NULL) |
| 955 | vbi_metadata_unpack(&ldcore->metadata[fieldnum], &vbiframe, &ldcore->vbidata[readhunk * VBI_PACKED_BYTES]); |
| 956 | |
| 903 | 957 | /* configure the codec and then read */ |
| 904 | | if (ldcore->disc != NULL) |
| 958 | ldcore->readresult = CHDERR_FILE_NOT_FOUND; |
| 959 | if (ldcore->disc != NULL && !ldcore->videosquelch) |
| 905 | 960 | { |
| 906 | | err = chd_codec_config(ldcore->disc, AV_CODEC_DECOMPRESS_CONFIG, &ldcore->avconfig); |
| 907 | | if (err == CHDERR_NONE) |
| 908 | | { |
| 909 | | INT32 chdtrack = tracknum - 1 - VIRTUAL_LEAD_IN_TRACKS; |
| 910 | | |
| 911 | | /* clamp the track */ |
| 912 | | chdtrack = MAX(chdtrack, 0); |
| 913 | | chdtrack = MIN(chdtrack, ldcore->chdtracks - 1); |
| 914 | | err = chd_read_async(ldcore->disc, chdtrack * 2 + fieldnum, NULL); |
| 915 | | ldcore->readpending = TRUE; |
| 916 | | } |
| 961 | ldcore->readresult = chd_codec_config(ldcore->disc, AV_CODEC_DECOMPRESS_CONFIG, &ldcore->avconfig); |
| 962 | if (ldcore->readresult == CHDERR_NONE) |
| 963 | ldcore->readresult = chd_read_async(ldcore->disc, readhunk, NULL); |
| 917 | 964 | } |
| 918 | 965 | } |
| 919 | 966 | |
| r3289 | r3290 | |
| 927 | 974 | { |
| 928 | 975 | laserdisc_state *ld = get_safe_token(device); |
| 929 | 976 | ldcore_data *ldcore = ld->core; |
| 930 | | UINT32 tracknum = ldcore->curtrack; |
| 931 | | UINT32 fieldnum = ldcore->fieldnum; |
| 932 | | int frame, chapter; |
| 933 | | chd_error chderr; |
| 934 | 977 | |
| 935 | 978 | /* wait for the async operation to complete */ |
| 936 | | if (ldcore->disc != NULL && ldcore->readpending) |
| 937 | | { |
| 938 | | /* complete the async operation */ |
| 939 | | chderr = chd_async_complete(ldcore->disc); |
| 940 | | if (chderr != CHDERR_NONE && chderr != CHDERR_NO_ASYNC_OPERATION) |
| 941 | | ldcore->avconfig.video = NULL; |
| 942 | | } |
| 943 | | ldcore->readpending = FALSE; |
| 979 | if (ldcore->readresult == CHDERR_OPERATION_PENDING) |
| 980 | ldcore->readresult = chd_async_complete(ldcore->disc); |
| 944 | 981 | |
| 945 | | /* parse the metadata */ |
| 946 | | if (ldcore->disc != NULL && ldcore->avconfig.video != NULL) |
| 947 | | vbi_parse_all((const UINT16 *)ldcore->avconfig.video->base, ldcore->avconfig.video->rowpixels, ldcore->avconfig.video->width, 8, &ldcore->metadata[fieldnum]); |
| 948 | | else |
| 949 | | fake_metadata(tracknum, fieldnum, &ldcore->metadata[fieldnum]); |
| 950 | | // printf("Track %5d: Metadata = %d %08X %08X %08X %08X\n", tracknum, ldcore->metadata[fieldnum].white, ldcore->metadata[fieldnum].line16, ldcore->metadata[fieldnum].line17, ldcore->metadata[fieldnum].line18, ldcore->metadata[fieldnum].line1718); |
| 982 | /* remove the video if we had an error */ |
| 983 | if (ldcore->readresult != CHDERR_NONE) |
| 984 | ldcore->avconfig.video = NULL; |
| 951 | 985 | |
| 952 | | /* update the last seen frame and chapter */ |
| 953 | | frame = frame_from_metadata(&ldcore->metadata[fieldnum]); |
| 954 | | if (frame >= 1 && frame < 99999) |
| 955 | | ldcore->last_frame = frame; |
| 956 | | chapter = chapter_from_metadata(&ldcore->metadata[fieldnum]); |
| 957 | | if (chapter != -1) |
| 958 | | ldcore->last_chapter = chapter; |
| 986 | /* count the field as read if we are successful */ |
| 987 | if (ldcore->avconfig.video != NULL) |
| 988 | ldcore->frame[ldcore->videoindex].numfields++; |
| 959 | 989 | |
| 960 | 990 | /* render the display if present */ |
| 961 | 991 | // if (ldcore->display && ldcore->avconfig.video != NULL) |
| 962 | 992 | // render_display((UINT16 *)ldcore->avconfig.video->base, ldcore->avconfig.video->rowpixels, ldcore->avconfig.video->width, ldcore->last_frame); |
| 963 | 993 | |
| 964 | | /* update video field */ |
| 965 | | if (ldcore->avconfig.video != NULL) |
| 966 | | { |
| 967 | | ldcore->videofields[ldcore->videoindex]++; |
| 968 | | ldcore->videoframenum[ldcore->videoindex] = ldcore->last_frame; |
| 969 | | } |
| 970 | | |
| 971 | 994 | /* pass the audio to the callback */ |
| 972 | 995 | if (ldcore->config.audio != NULL) |
| 973 | 996 | (*ldcore->config.audio)(device, ldcore->samplerate, ldcore->audiocursamples, ldcore->avconfig.audio[0], ldcore->avconfig.audio[1]); |
| r3289 | r3290 | |
| 1000 | 1023 | |
| 1001 | 1024 | |
| 1002 | 1025 | /*------------------------------------------------- |
| 1003 | | fake_metadata - fake metadata when there's |
| 1004 | | no disc present |
| 1005 | | -------------------------------------------------*/ |
| 1006 | | |
| 1007 | | static void fake_metadata(UINT32 track, UINT8 which, vbi_metadata *metadata) |
| 1008 | | { |
| 1009 | | if (which == 0) |
| 1010 | | { |
| 1011 | | metadata->white = 1; |
| 1012 | | metadata->line16 = 0; |
| 1013 | | metadata->line17 = metadata->line18 = 0xf80000 | |
| 1014 | | (((track / 10000) % 10) << 16) | |
| 1015 | | (((track / 1000) % 10) << 12) | |
| 1016 | | (((track / 100) % 10) << 8) | |
| 1017 | | (((track / 10) % 10) << 4) | |
| 1018 | | (((track / 1) % 10) << 0); |
| 1019 | | } |
| 1020 | | else |
| 1021 | | memset(metadata, 0, sizeof(*metadata)); |
| 1022 | | } |
| 1023 | | |
| 1024 | | |
| 1025 | | /*------------------------------------------------- |
| 1026 | 1026 | render_display - draw the frame display |
| 1027 | 1027 | -------------------------------------------------*/ |
| 1028 | 1028 | |
| r3289 | r3290 | |
| 1321 | 1321 | const device_config *laserdisc = device_list_first(screen->machine->config->devicelist, LASERDISC); |
| 1322 | 1322 | if (laserdisc != NULL) |
| 1323 | 1323 | { |
| 1324 | const rectangle *visarea = video_screen_get_visible_area(screen); |
| 1324 | 1325 | laserdisc_state *ld = laserdisc->token; |
| 1325 | 1326 | ldcore_data *ldcore = ld->core; |
| 1326 | 1327 | bitmap_t *overbitmap = ldcore->overbitmap[ldcore->overindex]; |
| r3289 | r3290 | |
| 1335 | 1336 | clip.min_x = 0; |
| 1336 | 1337 | clip.max_x = ldcore->config.overwidth - 1; |
| 1337 | 1338 | clip.min_y = cliprect->min_y * overbitmap->height / bitmap->height; |
| 1339 | if (cliprect->min_y == visarea->min_y) |
| 1340 | clip.min_y = MIN(clip.min_y, ldcore->config.overclip.min_y); |
| 1338 | 1341 | clip.max_y = (cliprect->max_y + 1) * overbitmap->height / bitmap->height - 1; |
| 1339 | 1342 | (*ldcore->config.overupdate)(screen, overbitmap, &clip); |
| 1340 | 1343 | } |
| 1341 | 1344 | |
| 1342 | 1345 | /* if this is the last update, do the rendering */ |
| 1343 | | if (cliprect->max_y == video_screen_get_visible_area(screen)->max_y) |
| 1346 | if (cliprect->max_y == visarea->max_y) |
| 1344 | 1347 | { |
| 1345 | 1348 | float x0, y0, x1, y1; |
| 1346 | 1349 | |
| r3289 | r3290 | |
| 1443 | 1446 | ldcore->maxtrack = VIRTUAL_LEAD_IN_TRACKS + MAX_TOTAL_TRACKS + VIRTUAL_LEAD_OUT_TRACKS; |
| 1444 | 1447 | if (ldcore->disc != NULL) |
| 1445 | 1448 | { |
| 1449 | UINT32 totalhunks = chd_get_header(ldcore->disc)->totalhunks; |
| 1446 | 1450 | int fps, fpsfrac, interlaced, channels; |
| 1447 | 1451 | char metadata[256]; |
| 1452 | UINT32 vbilength; |
| 1448 | 1453 | |
| 1449 | 1454 | /* require the A/V codec */ |
| 1450 | 1455 | if (chd_get_header(ldcore->disc)->compression != CHDCOMPRESSION_AV) |
| r3289 | r3290 | |
| 1466 | 1471 | fatalerror("Laserdisc video must be interlaced!"); |
| 1467 | 1472 | |
| 1468 | 1473 | /* determine the maximum track and allocate a frame buffer */ |
| 1469 | | ldcore->chdtracks = chd_get_header(ldcore->disc)->totalhunks / 2; |
| 1474 | ldcore->chdtracks = totalhunks / 2; |
| 1475 | |
| 1476 | /* allocate memory for the precomputed per-frame metadata */ |
| 1477 | ldcore->vbidata = auto_malloc(totalhunks * VBI_PACKED_BYTES); |
| 1478 | err = chd_get_metadata(ldcore->disc, AV_LD_METADATA_TAG, 0, ldcore->vbidata, totalhunks * VBI_PACKED_BYTES, &vbilength, NULL); |
| 1479 | if (err != CHDERR_NONE || vbilength != totalhunks * VBI_PACKED_BYTES) |
| 1480 | fatalerror("Precomputed VBI metadata missing or incorrect size"); |
| 1470 | 1481 | } |
| 1471 | 1482 | ldcore->maxtrack = MAX(ldcore->maxtrack, VIRTUAL_LEAD_IN_TRACKS + VIRTUAL_LEAD_OUT_TRACKS + ldcore->chdtracks); |
| 1472 | 1483 | } |
| r3289 | r3290 | |
| 1487 | 1498 | video_screen_register_vblank_callback(ld->screen, vblank_state_changed, (void *)device); |
| 1488 | 1499 | |
| 1489 | 1500 | /* allocate video frames */ |
| 1490 | | for (index = 0; index < ARRAY_LENGTH(ldcore->videofields); index++) |
| 1501 | for (index = 0; index < ARRAY_LENGTH(ldcore->frame); index++) |
| 1491 | 1502 | { |
| 1503 | frame_data *frame = &ldcore->frame[index]; |
| 1504 | |
| 1492 | 1505 | /* first allocate a YUY16 bitmap at 2x the height */ |
| 1493 | | ldcore->videoframe[index] = auto_bitmap_alloc(ldcore->width, ldcore->height * 2, BITMAP_FORMAT_YUY16); |
| 1494 | | fillbitmap_yuy16(ldcore->videoframe[index], 40, 109, 240); |
| 1506 | frame->bitmap = auto_bitmap_alloc(ldcore->width, ldcore->height * 2, BITMAP_FORMAT_YUY16); |
| 1507 | fillbitmap_yuy16(frame->bitmap, 40, 109, 240); |
| 1495 | 1508 | |
| 1496 | 1509 | /* make a copy of the bitmap that clips out the VBI and horizontal blanking areas */ |
| 1497 | | ldcore->videovisframe[index] = auto_malloc(sizeof(*ldcore->videovisframe[index])); |
| 1498 | | *ldcore->videovisframe[index] = *ldcore->videoframe[index]; |
| 1499 | | ldcore->videovisframe[index]->base = BITMAP_ADDR16(ldcore->videovisframe[index], 44, ldcore->videoframe[index]->width * 8 / 720); |
| 1500 | | ldcore->videovisframe[index]->height -= 44; |
| 1501 | | ldcore->videovisframe[index]->width -= 2 * ldcore->videoframe[index]->width * 8 / 720; |
| 1510 | frame->visbitmap = auto_malloc(sizeof(*frame->visbitmap)); |
| 1511 | *frame->visbitmap = *frame->bitmap; |
| 1512 | frame->visbitmap->base = BITMAP_ADDR16(frame->visbitmap, 44, frame->bitmap->width * 8 / 720); |
| 1513 | frame->visbitmap->height -= 44; |
| 1514 | frame->visbitmap->width -= 2 * frame->bitmap->width * 8 / 720; |
| 1502 | 1515 | } |
| 1503 | 1516 | |
| 1504 | 1517 | /* allocate an empty frame of the same size */ |
| r3289 | r3290 | |
| 1674 | 1687 | ldcore->attospertrack = 0; |
| 1675 | 1688 | ldcore->sliderupdate = curtime; |
| 1676 | 1689 | |
| 1677 | | /* reset metadata */ |
| 1678 | | ldcore->last_frame = 0; |
| 1679 | | ldcore->last_chapter = 0; |
| 1680 | | |
| 1681 | 1690 | /* reset the I/O lines */ |
| 1682 | 1691 | for (line = 0; line < LASERDISC_INPUT_LINES; line++) |
| 1683 | 1692 | ldcore->linein[line] = CLEAR_LINE; |