src/mess/video/jaguar.c
| r5112 | r5113 | |
| 464 | 464 | |
| 465 | 465 | /* others */
|
| 466 | 466 | default: // RGB24, DIRECT16
|
| 467 | | logerror("Can't handle mode %X\n", vmode);
|
| 467 | printf("Can't handle mode %X\n", vmode);
|
| 468 | 468 | break;
|
| 469 | 469 | }
|
| 470 | 470 | }
|
| r5112 | r5113 | |
| 549 | 549 | return;
|
| 550 | 550 | }
|
| 551 | 551 | #endif
|
| 552 | | |
| 553 | | |
| 554 | | if (LOG_BLITTER_STATS)
|
| 555 | | {
|
| 556 | | static UINT32 blitter_stats[1000][4];
|
| 557 | | static UINT64 blitter_pixels[1000];
|
| 558 | | static int blitter_count = 0;
|
| 559 | | static int reps = 0;
|
| 560 | | int i;
|
| 561 | | for (i = 0; i < blitter_count; i++)
|
| 562 | | if (blitter_stats[i][0] == (blitter_regs[B_CMD] & STATIC_COMMAND_MASK) &&
|
| 563 | | blitter_stats[i][1] == (blitter_regs[A1_FLAGS] & STATIC_FLAGS_MASK) &&
|
| 564 | | blitter_stats[i][2] == (blitter_regs[A2_FLAGS] & STATIC_FLAGS_MASK))
|
| 565 | | break;
|
| 566 | | if (i == blitter_count)
|
| 567 | | {
|
| 568 | | blitter_stats[i][0] = blitter_regs[B_CMD] & STATIC_COMMAND_MASK;
|
| 569 | | blitter_stats[i][1] = blitter_regs[A1_FLAGS] & STATIC_FLAGS_MASK;
|
| 570 | | blitter_stats[i][2] = blitter_regs[A2_FLAGS] & STATIC_FLAGS_MASK;
|
| 571 | | blitter_stats[i][3] = 0;
|
| 572 | | blitter_pixels[i] = 0;
|
| 573 | | blitter_count++;
|
| 574 | | }
|
| 575 | | blitter_stats[i][3]++;
|
| 576 | | blitter_pixels[i] += (blitter_regs[B_COUNT] & 0xffff) * (blitter_regs[B_COUNT] >> 16);
|
| 577 | | if (++reps % 100 == 99)
|
| 578 | | {
|
| 579 | | mame_printf_debug("---\nBlitter stats:\n");
|
| 580 | | for (i = 0; i < blitter_count; i++)
|
| 581 | | mame_printf_debug(" CMD=%08X A1=%08X A2=%08X %6d times, %08X%08X pixels\n",
|
| 582 | | blitter_stats[i][0], blitter_stats[i][1], blitter_stats[i][2],
|
| 583 | | blitter_stats[i][3], (UINT32)(blitter_pixels[i] >> 32), (UINT32)(blitter_pixels[i]));
|
| 584 | | mame_printf_debug("---\n");
|
| 585 | | }
|
| 586 | | }
|
| 587 | | |
| 588 | 552 | generic_blitter(machine, blitter_regs[B_CMD], blitter_regs[A1_FLAGS], blitter_regs[A2_FLAGS]);
|
| 589 | | // profiler_mark(PROFILER_END);
|
| 590 | 553 | }
|
| 591 | 554 | |
| 592 | | |
| 593 | 555 | READ32_HANDLER( jaguar_blitter_r )
|
| 594 | 556 | {
|
| 595 | 557 | switch (offset)
|
| r5112 | r5113 | |
| 737 | 699 | |
| 738 | 700 | |
| 739 | 701 | |
| 702 | |
| 740 | 703 | /*************************************
|
| 741 | 704 | *
|
| 742 | 705 | * Gun input
|
| r5112 | r5113 | |
| 857 | 820 | VIDEO_UPDATE( cojag )
|
| 858 | 821 | {
|
| 859 | 822 | /* if not enabled, just blank */
|
| 860 | | if (!(gpu_regs[VMODE] & 1))
|
| 861 | | {
|
| 823 | if (gpu_regs[VMODE] & 1)
|
| 824 | copybitmap(bitmap, screen_bitmap, 0, 0, 0, 0, cliprect);
|
| 825 | else
|
| 862 | 826 | bitmap_fill(bitmap, cliprect, 0);
|
| 863 | | return 0;
|
| 864 | | }
|
| 865 | 827 | |
| 866 | | /* render the object list */
|
| 867 | | copybitmap(bitmap, screen_bitmap, 0, 0, 0, 0, cliprect);
|
| 868 | 828 | return 0;
|
| 869 | 829 | }
|
| 870 | 830 | |
src/mess/drivers/jaguar.c
| r5112 | r5113 | |
| 52 | 52 | #include "sound/dac.h" |
| 53 | 53 | |
| 54 | 54 | #define JAGUAR_CLOCK XTAL_52MHz |
| 55 | | #define R3000_CLOCK XTAL_40MHz |
| 56 | | #define M68K_CLOCK XTAL_50MHz |
| 55 | #define M68K_CLOCK XTAL_50MHz |
| 57 | 56 | |
| 58 | 57 | static QUICKLOAD_LOAD( jaguar ); |
| 59 | 58 | |
| r5112 | r5113 | |
| 130 | 129 | jaguar_dsp_resume(machine); |
| 131 | 130 | |
| 132 | 131 | /* halt the CPUs */ |
| 133 | | jaguargpu_ctrl_w(cputag_get_cpu(machine, "gpu"), G_CTRL, 0, 0); |
| 134 | | jaguardsp_ctrl_w(cputag_get_cpu(machine, "audiocpu"), D_CTRL, 0, 0); |
| 132 | jaguargpu_ctrl_w(cputag_get_cpu(machine, "gpu"), G_CTRL, 0, 0xffffffff); |
| 133 | jaguardsp_ctrl_w(cputag_get_cpu(machine, "audiocpu"), D_CTRL, 0, 0xffffffff); |
| 135 | 134 | |
| 136 | 135 | /* init the sound system */ |
| 137 | 136 | cojag_sound_reset(machine); |
| r5112 | r5113 | |
| 177 | 176 | } |
| 178 | 177 | |
| 179 | 178 | |
| 179 | static READ32_HANDLER( jaguar_wave_rom_r ) |
| 180 | { |
| 181 | return jaguar_wave_rom[offset]; |
| 182 | } |
| 180 | 183 | |
| 181 | 184 | /************************************* |
| 182 | 185 | * |
| r5112 | r5113 | |
| 283 | 286 | |
| 284 | 287 | |
| 285 | 288 | |
| 289 | |
| 286 | 290 | /************************************* |
| 287 | 291 | * |
| 288 | 292 | * Main CPU memory handlers |
| r5112 | r5113 | |
| 291 | 295 | |
| 292 | 296 | |
| 293 | 297 | static ADDRESS_MAP_START( jaguar_map, ADDRESS_SPACE_PROGRAM, 32 ) |
| 294 | | AM_RANGE(0x000000, 0x1fffff) AM_RAM AM_BASE(&jaguar_shared_ram) AM_SHARE(1)// AM_MIRROR(0x200000) |
| 298 | AM_RANGE(0x000000, 0x1fffff) AM_RAM AM_BASE(&jaguar_shared_ram) AM_SHARE(1) AM_MIRROR(0x200000) |
| 295 | 299 | AM_RANGE(0x800000, 0xdfffff) AM_ROM AM_BASE(&cart_base) AM_SIZE(&cart_size) |
| 296 | 300 | AM_RANGE(0xe00000, 0xe1ffff) AM_ROM AM_BASE(&rom_base) AM_SIZE(&rom_size) |
| 297 | 301 | AM_RANGE(0xf00000, 0xf003ff) AM_READWRITE(jaguar_tom_regs32_r, jaguar_tom_regs32_w) |
| 298 | 302 | AM_RANGE(0xf00400, 0xf007ff) AM_RAM AM_BASE(&jaguar_gpu_clut) AM_SHARE(2) |
| 303 | AM_RANGE(0xf00800, 0xf01d9f) AM_MIRROR(0x008000) AM_RAM // Line Buffer Test Areas |
| 299 | 304 | AM_RANGE(0xf02100, 0xf021ff) AM_MIRROR(0x008000) AM_READWRITE(gpuctrl_r, gpuctrl_w) |
| 300 | 305 | AM_RANGE(0xf02200, 0xf022ff) AM_MIRROR(0x008000) AM_READWRITE(jaguar_blitter_r, jaguar_blitter_w) |
| 301 | 306 | AM_RANGE(0xf03000, 0xf03fff) AM_MIRROR(0x008000) AM_RAM AM_BASE(&jaguar_gpu_ram) AM_SHARE(3) |
| r5112 | r5113 | |
| 303 | 308 | AM_RANGE(0xf14000, 0xf14003) AM_READWRITE(joystick_r, joystick_w) |
| 304 | 309 | AM_RANGE(0xf14800, 0xf14fff) AM_NOP // GPI00 |
| 305 | 310 | AM_RANGE(0xf15000, 0xf15fff) AM_NOP // GPI01 |
| 306 | | //AM_RANGE(0xf16000, 0xf1600b) AM_READ(cojag_gun_input_r) // GPI02 |
| 311 | AM_RANGE(0xf16000, 0xf1600b) AM_READ(cojag_gun_input_r) // GPI02 |
| 307 | 312 | AM_RANGE(0xf17000, 0xf177ff) AM_NOP // GPI03 |
| 308 | 313 | //AM_RANGE(0xf17800, 0xf17803) AM_WRITE(latch_w) // GPI04 |
| 309 | 314 | AM_RANGE(0xf17800, 0xf17bff) AM_NOP // GPI04 |
| r5112 | r5113 | |
| 311 | 316 | AM_RANGE(0xf1a100, 0xf1a13f) AM_READWRITE(dspctrl_r, dspctrl_w) |
| 312 | 317 | AM_RANGE(0xf1a140, 0xf1a17f) AM_READWRITE(jaguar_serial_r, jaguar_serial_w) |
| 313 | 318 | AM_RANGE(0xf1b000, 0xf1cfff) AM_RAM AM_BASE(&jaguar_dsp_ram) AM_SHARE(4) |
| 314 | | //AM_SHARE(0xf1d00, 0xf1dfff) AM_READ(jaguar_wave_table_r) //p78 |
| 319 | AM_RANGE(0xf1d000, 0xf1dfff) AM_READ(jaguar_wave_rom_r) |
| 315 | 320 | ADDRESS_MAP_END |
| 316 | 321 | |
| 317 | 322 | |
| r5112 | r5113 | |
| 437 | 442 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON5) PORT_NAME(DEF_STR(Pause)) PORT_CODE(KEYCODE_ENTER_PAD) PORT_CODE(JOYCODE_BUTTON5 ) PORT_PLAYER(2) |
| 438 | 443 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_NAME("A") PORT_CODE(KEYCODE_SLASH_PAD) PORT_CODE(JOYCODE_BUTTON1 ) PORT_PLAYER(2) |
| 439 | 444 | PORT_BIT( 0xfffc, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 445 | |
| 446 | /* The remaining ports are needed by the game "Flip Out" */ |
| 447 | PORT_START("FAKE1_X") /* fake analog X */ |
| 448 | // PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 320.0/(320.0 - 7 -7), 0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) |
| 449 | |
| 450 | PORT_START("FAKE1_Y") /* fake analog Y */ |
| 451 | // PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, (240.0 - 1)/240, 0.0, 0) PORT_SENSITIVITY(70) PORT_KEYDELTA(10) |
| 452 | |
| 453 | PORT_START("FAKE2_X") /* fake analog X */ |
| 454 | // PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 320.0/(320.0 - 7 -7), 0.0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_PLAYER(2) |
| 455 | |
| 456 | PORT_START("FAKE2_Y") /* fake analog Y */ |
| 457 | // PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, (240.0 - 1)/240, 0.0, 0) PORT_SENSITIVITY(70) PORT_KEYDELTA(10) PORT_PLAYER(2) |
| 458 | |
| 459 | PORT_START("IN3") /* gun triggers */ |
| 460 | // PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_SPECIAL ) // gun data valid |
| 461 | // PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_SPECIAL ) // gun data valid |
| 462 | // PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 463 | // PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) |
| 464 | // PORT_BIT( 0xfff00000, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 440 | 465 | INPUT_PORTS_END |
| 441 | 466 | |
| 442 | 467 | |