src/mess/drivers/jaguar.c
| r5341 | r5342 | |
| 5 | 5 | Nathan Woods |
| 6 | 6 | based on MAME cojag driver by Aaron Giles |
| 7 | 7 | |
| 8 | | Game status: |
| 9 | | Working: Alien vs Predator, Zool2, Power Drive Rally. |
| 10 | | Raiden works until the end of the first stage, then hangs. |
| 11 | | Pinball Fantasies works but no sound. |
| 12 | | Rayman runs somewhat, with bad graphics and no sound. |
| 13 | | Brutal Sports and 2 other games get an access violation in the blitter. |
| 14 | | The rest do little or nothing. |
| 15 | | None of the homebrew/quickload do anything at all. |
| 16 | 8 | |
| 17 | | TODO: Lots... |
| 18 | | |
| 19 | 9 | **************************************************************************** |
| 20 | 10 | |
| 21 | 11 | Memory map (TBA) |
| r5341 | r5342 | |
| 63 | 53 | #define JAGUAR_CLOCK 26.6e6 |
| 64 | 54 | |
| 65 | 55 | static QUICKLOAD_LOAD( jaguar ); |
| 56 | static DEVICE_IMAGE_LOAD( jaguar ); |
| 66 | 57 | |
| 67 | 58 | /************************************* |
| 68 | 59 | * |
| r5341 | r5342 | |
| 110 | 101 | { |
| 111 | 102 | cpu_set_irq_callback(cputag_get_cpu(machine, "maincpu"), jaguar_irq_callback); |
| 112 | 103 | |
| 113 | | *((UINT32 *) jaguar_gpu_ram) = 0x3d0dead; |
| 104 | /* Break the protection */ |
| 105 | jaguar_gpu_ram[0] = 0x3d0dead; |
| 106 | rom_base[0x4da]=(rom_base[0x4da]&0xffff0000) | 1234; |
| 107 | rom_base[0x4db]=(rom_base[0x4db]&0xffff) | 56780000; |
| 114 | 108 | |
| 115 | | memset(jaguar_shared_ram, 0, 0x200000); |
| 109 | /* Set up pointers for Jaguar logo */ |
| 116 | 110 | memcpy(jaguar_shared_ram, rom_base, 0x10); |
| 117 | | if (cart_base[1] != 0) |
| 118 | | rom_base[0x53c / 4] = 0x67000002; |
| 119 | 111 | cpu_set_reg(cputag_get_cpu(machine, "maincpu"), REG_GENPC, rom_base[1]); |
| 120 | 112 | |
| 121 | 113 | #if 0 |
| r5341 | r5342 | |
| 203 | 195 | { |
| 204 | 196 | UINT16 joystick_result = 0xffff; |
| 205 | 197 | UINT16 joybuts_result = 0xffff; |
| 206 | | UINT32 result; |
| 207 | 198 | int i; |
| 208 | 199 | static const char *const keynames[2][8] = |
| 209 | 200 | { |
| r5341 | r5342 | |
| 236 | 227 | } |
| 237 | 228 | } |
| 238 | 229 | |
| 239 | | result = joystick_result; |
| 240 | | result <<= 16; |
| 241 | | result |= joybuts_result; |
| 242 | | return result; |
| 230 | return (joystick_result << 16) | joybuts_result; |
| 243 | 231 | } |
| 244 | 232 | |
| 245 | 233 | static WRITE32_HANDLER( joystick_w ) |
| r5341 | r5342 | |
| 304 | 292 | |
| 305 | 293 | |
| 306 | 294 | static ADDRESS_MAP_START( jaguar_map, ADDRESS_SPACE_PROGRAM, 32 ) |
| 307 | | AM_RANGE(0x000000, 0x1fffff) AM_RAM AM_BASE(&jaguar_shared_ram) AM_SHARE(1) AM_MIRROR(0x200000) |
| 308 | | AM_RANGE(0x800000, 0xdfffff) AM_ROM AM_BASE(&cart_base) AM_SIZE(&cart_size) |
| 309 | | AM_RANGE(0xe00000, 0xe1ffff) AM_ROM AM_BASE(&rom_base) AM_SIZE(&rom_size) |
| 295 | ADDRESS_MAP_GLOBAL_MASK(0xffffff) |
| 296 | AM_RANGE(0x000000, 0x1fffff) AM_RAM AM_BASE(&jaguar_shared_ram) AM_MIRROR(0x200000) AM_SHARE(1) AM_REGION("maincpu", 0) |
| 297 | AM_RANGE(0x800000, 0xdfffff) AM_ROM AM_BASE(&cart_base) AM_SIZE(&cart_size) AM_REGION("maincpu", 0x800000) |
| 298 | AM_RANGE(0xe00000, 0xe1ffff) AM_ROM AM_BASE(&rom_base) AM_SIZE(&rom_size) AM_REGION("maincpu", 0xe00000) |
| 310 | 299 | AM_RANGE(0xf00000, 0xf003ff) AM_READWRITE(jaguar_tom_regs32_r, jaguar_tom_regs32_w) |
| 311 | 300 | AM_RANGE(0xf00400, 0xf007ff) AM_RAM AM_BASE(&jaguar_gpu_clut) AM_SHARE(2) |
| 312 | | AM_RANGE(0xf00800, 0xf01d9f) AM_MIRROR(0x008000) AM_RAM // Line Buffer Test Areas |
| 301 | // AM_RANGE(0xf00800, 0xf01d9f) AM_MIRROR(0x008000) AM_RAM // Line Buffer Test Areas |
| 313 | 302 | AM_RANGE(0xf02100, 0xf021ff) AM_MIRROR(0x008000) AM_READWRITE(gpuctrl_r, gpuctrl_w) |
| 314 | 303 | AM_RANGE(0xf02200, 0xf022ff) AM_MIRROR(0x008000) AM_READWRITE(jaguar_blitter_r, jaguar_blitter_w) |
| 315 | 304 | AM_RANGE(0xf03000, 0xf03fff) AM_MIRROR(0x008000) AM_RAM AM_BASE(&jaguar_gpu_ram) AM_SHARE(3) |
| r5341 | r5342 | |
| 332 | 321 | |
| 333 | 322 | /************************************* |
| 334 | 323 | * |
| 335 | | * GPU memory handlers |
| 324 | * GPU/DSP memory handlers |
| 336 | 325 | * |
| 337 | 326 | *************************************/ |
| 338 | 327 | |
| 339 | 328 | static ADDRESS_MAP_START( gpu_map, ADDRESS_SPACE_PROGRAM, 32 ) |
| 340 | | AM_RANGE(0x000000, 0x1fffff) AM_RAM AM_SHARE(1) AM_MIRROR(0x200000) |
| 329 | ADDRESS_MAP_GLOBAL_MASK(0xffffff) |
| 330 | AM_RANGE(0x000000, 0x1fffff) AM_MIRROR(0x200000) AM_RAM AM_SHARE(1) |
| 341 | 331 | AM_RANGE(0x800000, 0xdfffff) AM_ROMBANK(15) |
| 342 | 332 | AM_RANGE(0xe00000, 0xe1ffff) AM_ROMBANK(16) |
| 343 | | |
| 344 | 333 | AM_RANGE(0xf00000, 0xf003ff) AM_READWRITE(jaguar_tom_regs32_r, jaguar_tom_regs32_w) |
| 345 | 334 | AM_RANGE(0xf00400, 0xf007ff) AM_RAM AM_SHARE(2) |
| 346 | | AM_RANGE(0xf02100, 0xf021ff) AM_READWRITE(gpuctrl_r, gpuctrl_w) |
| 347 | | AM_RANGE(0xf02200, 0xf022ff) AM_READWRITE(jaguar_blitter_r, jaguar_blitter_w) |
| 348 | | AM_RANGE(0xf03000, 0xf03fff) AM_RAM AM_SHARE(3) AM_MIRROR(0x008000) |
| 335 | AM_RANGE(0xf02100, 0xf021ff) AM_MIRROR(0x008000) AM_READWRITE(gpuctrl_r, gpuctrl_w) |
| 336 | AM_RANGE(0xf02200, 0xf022ff) AM_MIRROR(0x008000) AM_READWRITE(jaguar_blitter_r, jaguar_blitter_w) |
| 337 | AM_RANGE(0xf03000, 0xf03fff) AM_MIRROR(0x008000) AM_RAM AM_SHARE(3) |
| 349 | 338 | AM_RANGE(0xf10000, 0xf103ff) AM_READWRITE(jaguar_jerry_regs32_r, jaguar_jerry_regs32_w) |
| 350 | | ADDRESS_MAP_END |
| 351 | | |
| 352 | | |
| 353 | | |
| 354 | | /************************************* |
| 355 | | * |
| 356 | | * DSP memory handlers |
| 357 | | * |
| 358 | | *************************************/ |
| 359 | | |
| 360 | | static ADDRESS_MAP_START( dsp_map, ADDRESS_SPACE_PROGRAM, 32 ) |
| 361 | | AM_RANGE(0x000000, 0x1fffff) AM_RAM AM_SHARE(1) AM_MIRROR(0x200000) |
| 362 | | AM_RANGE(0x800000, 0xdfffff) AM_ROMBANK(15) |
| 363 | | AM_RANGE(0xe00000, 0xe1ffff) AM_ROMBANK(16) |
| 364 | | AM_RANGE(0xf10000, 0xf103ff) AM_READWRITE(jaguar_jerry_regs32_r, jaguar_jerry_regs32_w) |
| 339 | AM_RANGE(0xf14000, 0xf14003) AM_READWRITE(joystick_r, joystick_w) |
| 365 | 340 | AM_RANGE(0xf1a100, 0xf1a13f) AM_READWRITE(dspctrl_r, dspctrl_w) |
| 366 | 341 | AM_RANGE(0xf1a140, 0xf1a17f) AM_READWRITE(jaguar_serial_r, jaguar_serial_w) |
| 367 | 342 | AM_RANGE(0xf1b000, 0xf1cfff) AM_RAM AM_SHARE(4) |
| r5341 | r5342 | |
| 504 | 479 | |
| 505 | 480 | MDRV_CPU_ADD("audiocpu", JAGUARDSP, JAGUAR_CLOCK) |
| 506 | 481 | MDRV_CPU_CONFIG(dsp_config) |
| 507 | | MDRV_CPU_PROGRAM_MAP(dsp_map) |
| 482 | MDRV_CPU_PROGRAM_MAP(gpu_map) |
| 508 | 483 | |
| 509 | 484 | MDRV_MACHINE_RESET(jaguar) |
| 510 | 485 | |
| r5341 | r5342 | |
| 532 | 507 | /* cartridge */ |
| 533 | 508 | MDRV_CARTSLOT_ADD("cart") |
| 534 | 509 | MDRV_CARTSLOT_EXTENSION_LIST("jag,abs,rom,j64") |
| 510 | MDRV_CARTSLOT_LOAD(jaguar) |
| 535 | 511 | MACHINE_DRIVER_END |
| 536 | 512 | |
| 537 | 513 | |
| r5341 | r5342 | |
| 575 | 551 | |
| 576 | 552 | static QUICKLOAD_LOAD( jaguar ) |
| 577 | 553 | { |
| 554 | int i,j; |
| 578 | 555 | offs_t quickload_begin = 0x4000; |
| 556 | memset(jaguar_shared_ram, 0, 0x200000); |
| 579 | 557 | quickload_size = MIN(quickload_size, 0x200000 - quickload_begin); |
| 580 | 558 | image_fread(image, &memory_region(image->machine, "maincpu")[quickload_begin], quickload_size); |
| 559 | |
| 560 | /* Fix endian-ness */ |
| 561 | for (i = quickload_begin / 4; i < quickload_size / 4; i++) |
| 562 | { |
| 563 | j = jaguar_shared_ram[i]; |
| 564 | jaguar_shared_ram[i] = ((j & 0xff) << 24) | ((j & 0xff00) << 8) | ((j & 0xff0000) >> 8) | ((j & 0xff000000) >> 24); |
| 565 | } |
| 566 | |
| 567 | /* Transfer control to image */ |
| 581 | 568 | cpu_set_reg(cputag_get_cpu(image->machine, "maincpu"), REG_GENPC, quickload_begin); |
| 582 | 569 | return INIT_PASS; |
| 583 | 570 | } |
| 584 | 571 | |
| 572 | static DEVICE_IMAGE_LOAD( jaguar ) |
| 573 | { |
| 574 | int i,j; |
| 575 | image_fread(image, cart_base, image_length(image)); |
| 576 | memset(jaguar_shared_ram, 0, 0x200000); |
| 577 | memcpy(jaguar_shared_ram, rom_base, 0x10); |
| 585 | 578 | |
| 579 | /* Fix endian-ness */ |
| 580 | for (i = 0; i < image_length(image) / 4; i++) |
| 581 | { |
| 582 | j = cart_base[i]; |
| 583 | cart_base[i] = ((j & 0xff) << 24) | ((j & 0xff00) << 8) | ((j & 0xff0000) >> 8) | ((j & 0xff000000) >> 24); |
| 584 | } |
| 585 | |
| 586 | /* Disable logo - breaks Doom */ |
| 587 | rom_base[0x53c / 4] = 0x67000002; |
| 588 | |
| 589 | /* Transfer control to the bios */ |
| 590 | cpu_set_reg(cputag_get_cpu(image->machine, "maincpu"), REG_GENPC, rom_base[1]); |
| 591 | return INIT_PASS; |
| 592 | } |
| 593 | |
| 586 | 594 | /************************************* |
| 587 | 595 | * |
| 588 | 596 | * Game driver(s) |
| r5341 | r5342 | |
| 590 | 598 | *************************************/ |
| 591 | 599 | |
| 592 | 600 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME */ |
| 593 | | CONS( 1993, jaguar, 0, 0, jaguar, jaguar, jaguar, 0, "Atari", "Atari Jaguar", GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING) |
| 594 | | CONS( 1995, jaguarcd, jaguar, 0, jaguar, jaguar, jaguar, 0, "Atari", "Atari Jaguar CD", GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GA\ |
| 595 | | ME_NOT_WORKING) |
| 601 | CONS( 1993, jaguar, 0, 0, jaguar, jaguar, jaguar, 0, "Atari", "Atari Jag", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING) |
| 602 | CONS( 1995, jaguarcd, jaguar, 0, jaguar, jaguar, jaguar, 0, "Atari", "Atari Jaguar CD", GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING) |