src/mame/video/jagobj.c
| r5396 | r5397 | |
| 84 | 84 | while (firstpix & 7) |
| 85 | 85 | { |
| 86 | 86 | int pix = (pixsrc >> (4 * (~firstpix & 7))) & 0x0f; |
| 87 | | if ((!(flags & 4) || pix) && (UINT32)xpos < 360) |
| 87 | if ((!(flags & 4) || pix) && (UINT32)xpos < 760) |
| 88 | 88 | { |
| 89 | 89 | if (!(flags & 2)) |
| 90 | 90 | scanline[xpos] = clutbase[BYTE_XOR_BE(pix)]; |
| r5396 | r5397 | |
| 105 | 105 | UINT32 pix = src[firstpix++]; |
| 106 | 106 | if (!(flags & 4) || pix) |
| 107 | 107 | { |
| 108 | | if ((!(flags & 4) || (pix & 0xf0000000)) && (UINT32)xpos < 360) |
| 108 | if ((!(flags & 4) || (pix & 0xf0000000)) && (UINT32)xpos < 760) |
| 109 | 109 | { |
| 110 | 110 | if (!(flags & 2)) |
| 111 | 111 | scanline[xpos] = clutbase[BYTE_XOR_BE(pix >> 28)]; |
| r5396 | r5397 | |
| 114 | 114 | } |
| 115 | 115 | xpos += dxpos; |
| 116 | 116 | |
| 117 | | if ((!(flags & 4) || (pix & 0x0f000000)) && (UINT32)xpos < 360) |
| 117 | if ((!(flags & 4) || (pix & 0x0f000000)) && (UINT32)xpos < 760) |
| 118 | 118 | { |
| 119 | 119 | if (!(flags & 2)) |
| 120 | 120 | scanline[xpos] = clutbase[BYTE_XOR_BE((pix >> 24) & 0x0f)]; |
| r5396 | r5397 | |
| 123 | 123 | } |
| 124 | 124 | xpos += dxpos; |
| 125 | 125 | |
| 126 | | if ((!(flags & 4) || (pix & 0x00f00000)) && (UINT32)xpos < 360) |
| 126 | if ((!(flags & 4) || (pix & 0x00f00000)) && (UINT32)xpos < 760) |
| 127 | 127 | { |
| 128 | 128 | if (!(flags & 2)) |
| 129 | 129 | scanline[xpos] = clutbase[BYTE_XOR_BE((pix >> 20) & 0x0f)]; |
| r5396 | r5397 | |
| 132 | 132 | } |
| 133 | 133 | xpos += dxpos; |
| 134 | 134 | |
| 135 | | if ((!(flags & 4) || (pix & 0x000f0000)) && (UINT32)xpos < 360) |
| 135 | if ((!(flags & 4) || (pix & 0x000f0000)) && (UINT32)xpos < 760) |
| 136 | 136 | { |
| 137 | 137 | if (!(flags & 2)) |
| 138 | 138 | scanline[xpos] = clutbase[BYTE_XOR_BE((pix >> 16) & 0x0f)]; |
| r5396 | r5397 | |
| 141 | 141 | } |
| 142 | 142 | xpos += dxpos; |
| 143 | 143 | |
| 144 | | if ((!(flags & 4) || (pix & 0x0000f000)) && (UINT32)xpos < 360) |
| 144 | if ((!(flags & 4) || (pix & 0x0000f000)) && (UINT32)xpos < 760) |
| 145 | 145 | { |
| 146 | 146 | if (!(flags & 2)) |
| 147 | 147 | scanline[xpos] = clutbase[BYTE_XOR_BE((pix >> 12) & 0x0f)]; |
| r5396 | r5397 | |
| 150 | 150 | } |
| 151 | 151 | xpos += dxpos; |
| 152 | 152 | |
| 153 | | if ((!(flags & 4) || (pix & 0x00000f00)) && (UINT32)xpos < 360) |
| 153 | if ((!(flags & 4) || (pix & 0x00000f00)) && (UINT32)xpos < 760) |
| 154 | 154 | { |
| 155 | 155 | if (!(flags & 2)) |
| 156 | 156 | scanline[xpos] = clutbase[BYTE_XOR_BE((pix >> 8) & 0x0f)]; |
| r5396 | r5397 | |
| 159 | 159 | } |
| 160 | 160 | xpos += dxpos; |
| 161 | 161 | |
| 162 | | if ((!(flags & 4) || (pix & 0x000000f0)) && (UINT32)xpos < 360) |
| 162 | if ((!(flags & 4) || (pix & 0x000000f0)) && (UINT32)xpos < 760) |
| 163 | 163 | { |
| 164 | 164 | if (!(flags & 2)) |
| 165 | 165 | scanline[xpos] = clutbase[BYTE_XOR_BE((pix >> 4) & 0x0f)]; |
| r5396 | r5397 | |
| 168 | 168 | } |
| 169 | 169 | xpos += dxpos; |
| 170 | 170 | |
| 171 | | if ((!(flags & 4) || (pix & 0x0000000f)) && (UINT32)xpos < 360) |
| 171 | if ((!(flags & 4) || (pix & 0x0000000f)) && (UINT32)xpos < 760) |
| 172 | 172 | { |
| 173 | 173 | if (!(flags & 2)) |
| 174 | 174 | scanline[xpos] = clutbase[BYTE_XOR_BE(pix & 0x0f)]; |
| r5396 | r5397 | |
| 250 | 250 | while (firstpix & 3) |
| 251 | 251 | { |
| 252 | 252 | UINT8 pix = pixsrc >> (8 * (~firstpix & 3)); |
| 253 | | if ((!(flags & 4) || pix) && (UINT32)xpos < 360) |
| 253 | if ((!(flags & 4) || pix) && (UINT32)xpos < 760) |
| 254 | 254 | { |
| 255 | 255 | if (!(flags & 2)) |
| 256 | 256 | scanline[xpos] = clutbase[BYTE_XOR_BE(pix)]; |
| r5396 | r5397 | |
| 271 | 271 | UINT32 pix = src[firstpix++]; |
| 272 | 272 | if (!(flags & 4) || pix) |
| 273 | 273 | { |
| 274 | | if ((!(flags & 4) || (pix & 0xff000000)) && (UINT32)xpos < 360) |
| 274 | if ((!(flags & 4) || (pix & 0xff000000)) && (UINT32)xpos < 760) |
| 275 | 275 | { |
| 276 | 276 | if (!(flags & 2)) |
| 277 | 277 | scanline[xpos] = clutbase[BYTE_XOR_BE(pix >> 24)]; |
| r5396 | r5397 | |
| 280 | 280 | } |
| 281 | 281 | xpos += dxpos; |
| 282 | 282 | |
| 283 | | if ((!(flags & 4) || (pix & 0x00ff0000)) && (UINT32)xpos < 360) |
| 283 | if ((!(flags & 4) || (pix & 0x00ff0000)) && (UINT32)xpos < 760) |
| 284 | 284 | { |
| 285 | 285 | if (!(flags & 2)) |
| 286 | 286 | scanline[xpos] = clutbase[BYTE_XOR_BE((pix >> 16) & 0xff)]; |
| r5396 | r5397 | |
| 289 | 289 | } |
| 290 | 290 | xpos += dxpos; |
| 291 | 291 | |
| 292 | | if ((!(flags & 4) || (pix & 0x0000ff00)) && (UINT32)xpos < 360) |
| 292 | if ((!(flags & 4) || (pix & 0x0000ff00)) && (UINT32)xpos < 760) |
| 293 | 293 | { |
| 294 | 294 | if (!(flags & 2)) |
| 295 | 295 | scanline[xpos] = clutbase[BYTE_XOR_BE((pix >> 8) & 0xff)]; |
| r5396 | r5397 | |
| 298 | 298 | } |
| 299 | 299 | xpos += dxpos; |
| 300 | 300 | |
| 301 | | if ((!(flags & 4) || (pix & 0x000000ff)) && (UINT32)xpos < 360) |
| 301 | if ((!(flags & 4) || (pix & 0x000000ff)) && (UINT32)xpos < 760) |
| 302 | 302 | { |
| 303 | 303 | if (!(flags & 2)) |
| 304 | 304 | scanline[xpos] = clutbase[BYTE_XOR_BE(pix & 0xff)]; |
| r5396 | r5397 | |
| 377 | 377 | if (firstpix & 1) |
| 378 | 378 | { |
| 379 | 379 | UINT16 pix = src[firstpix / 2]; |
| 380 | | if ((!(flags & 4) || pix) && (UINT32)xpos < 360) |
| 380 | if ((!(flags & 4) || pix) && (UINT32)xpos < 760) |
| 381 | 381 | { |
| 382 | 382 | if (!(flags & 2)) |
| 383 | 383 | scanline[xpos] = pix; |
| r5396 | r5397 | |
| 396 | 396 | UINT32 pix = src[firstpix++]; |
| 397 | 397 | if (!(flags & 4) || pix) |
| 398 | 398 | { |
| 399 | | if ((!(flags & 4) || (pix >> 16)) && (UINT32)xpos < 360) |
| 399 | if ((!(flags & 4) || (pix >> 16)) && (UINT32)xpos < 760) |
| 400 | 400 | { |
| 401 | 401 | if (!(flags & 2)) |
| 402 | 402 | scanline[xpos] = pix >> 16; |
| r5396 | r5397 | |
| 405 | 405 | } |
| 406 | 406 | xpos += dxpos; |
| 407 | 407 | |
| 408 | | if ((!(flags & 4) || (pix & 0xffff)) && (UINT32)xpos < 360) |
| 408 | if ((!(flags & 4) || (pix & 0xffff)) && (UINT32)xpos < 760) |
| 409 | 409 | { |
| 410 | 410 | if (!(flags & 2)) |
| 411 | 411 | scanline[xpos] = pix; |
| r5396 | r5397 | |
| 557 | 557 | { |
| 558 | 558 | UINT8 pix = lookup_pixel(src, i, pitch, 1); |
| 559 | 559 | |
| 560 | | if (xpos >= 0 && xpos < 360 && (pix || !(flags & 4))) |
| 560 | if (xpos >= 0 && xpos < 760 && (pix || !(flags & 4))) |
| 561 | 561 | scanline[xpos] = clut[BYTE_XOR_BE(pix)]; |
| 562 | 562 | xpos += dxpos; |
| 563 | 563 | } |
| r5396 | r5397 | |
| 570 | 570 | { |
| 571 | 571 | UINT8 pix = lookup_pixel(src, i, pitch, 1); |
| 572 | 572 | |
| 573 | | if (xpos >= 0 && xpos < 360 && (pix || !(flags & 4))) |
| 573 | if (xpos >= 0 && xpos < 760 && (pix || !(flags & 4))) |
| 574 | 574 | BLEND(scanline[xpos], clut[BYTE_XOR_BE(pix)]); |
| 575 | 575 | xpos += dxpos; |
| 576 | 576 | } |
| r5396 | r5397 | |
| 591 | 591 | { |
| 592 | 592 | UINT8 pix = lookup_pixel(src, i, pitch, 2); |
| 593 | 593 | |
| 594 | | if (xpos >= 0 && xpos < 360 && (pix || !(flags & 4))) |
| 594 | if (xpos >= 0 && xpos < 760 && (pix || !(flags & 4))) |
| 595 | 595 | scanline[xpos] = clut[BYTE_XOR_BE(pix)]; |
| 596 | 596 | xpos += dxpos; |
| 597 | 597 | } |
| r5396 | r5397 | |
| 604 | 604 | { |
| 605 | 605 | UINT8 pix = lookup_pixel(src, i, pitch, 2); |
| 606 | 606 | |
| 607 | | if (xpos >= 0 && xpos < 360 && (pix || !(flags & 4))) |
| 607 | if (xpos >= 0 && xpos < 760 && (pix || !(flags & 4))) |
| 608 | 608 | BLEND(scanline[xpos], clut[BYTE_XOR_BE(pix)]); |
| 609 | 609 | xpos += dxpos; |
| 610 | 610 | } |
| r5396 | r5397 | |
| 754 | 754 | |
| 755 | 755 | while (xleft > 0) |
| 756 | 756 | { |
| 757 | | if (xpos >= 0 && xpos < 360 && (pix || !(flags & 4))) |
| 757 | if (xpos >= 0 && xpos < 760 && (pix || !(flags & 4))) |
| 758 | 758 | scanline[xpos] = clut[BYTE_XOR_BE(pix)]; |
| 759 | 759 | xpos += dxpos; |
| 760 | 760 | xleft -= 0x20; |
| r5396 | r5397 | |
| 776 | 776 | |
| 777 | 777 | while (xleft > 0) |
| 778 | 778 | { |
| 779 | | if (xpos >= 0 && xpos < 360 && (pix || !(flags & 4))) |
| 779 | if (xpos >= 0 && xpos < 760 && (pix || !(flags & 4))) |
| 780 | 780 | scanline[xpos] = clut[BYTE_XOR_BE(pix)]; |
| 781 | 781 | xpos += dxpos; |
| 782 | 782 | xleft -= 0x20; |
| r5396 | r5397 | |
| 794 | 794 | |
| 795 | 795 | while (xleft > 0) |
| 796 | 796 | { |
| 797 | | if (xpos >= 0 && xpos < 360 && (pix || !(flags & 4))) |
| 797 | if (xpos >= 0 && xpos < 760 && (pix || !(flags & 4))) |
| 798 | 798 | scanline[xpos] = pix; |
| 799 | 799 | xpos += dxpos; |
| 800 | 800 | xleft -= 0x20; |
| r5396 | r5397 | |
| 908 | 908 | |
| 909 | 909 | /* erase the scanline first */ |
| 910 | 910 | scanline = _scanline; |
| 911 | | for (x = 0; x < 360; x++) |
| 911 | for (x = 0; x < 760; x++) |
| 912 | 912 | scanline[x] = gpu_regs[BG]; |
| 913 | 913 | |
| 914 | 914 | logit = LOG_OBJECTS; |
src/mame/video/jaguar.c
| r5396 | r5397 | |
| 435 | 435 | |
| 436 | 436 | /* YCC/RGB VARMOD */ |
| 437 | 437 | case 0x100: |
| 438 | | case 0x107: |
| 438 | case 0x106: |
| 439 | 439 | for (i = 0; i < 65536; i++) |
| 440 | 440 | { |
| 441 | 441 | UINT8 r = (red_lookup[i >> 8] * (i & 0xff)) >> 8; |
| r5396 | r5397 | |
| 646 | 646 | |
| 647 | 647 | WRITE16_HANDLER( jaguar_tom_regs_w ) |
| 648 | 648 | { |
| 649 | UINT32 reg_store = gpu_regs[offset]; |
| 650 | |
| 649 | 651 | if (offset < GPU_REGS) |
| 650 | 652 | { |
| 651 | 653 | COMBINE_DATA(&gpu_regs[offset]); |
| r5396 | r5397 | |
| 658 | 660 | break; |
| 659 | 661 | |
| 660 | 662 | case VMODE: |
| 661 | | jaguar_set_palette(gpu_regs[VMODE]); |
| 663 | if (reg_store != gpu_regs[offset]) |
| 664 | jaguar_set_palette(gpu_regs[VMODE]); |
| 662 | 665 | break; |
| 663 | 666 | |
| 664 | 667 | case OBF: /* clear GPU interrupt */ |
| r5396 | r5397 | |
| 678 | 681 | case VDB: |
| 679 | 682 | case VDE: |
| 680 | 683 | { |
| 681 | | int hperiod = 2 * ((gpu_regs[HP] & 0x3ff) + 1); |
| 682 | | int hbend = effective_hvalue(ENABLE_BORDERS ? gpu_regs[HBE] : MIN(gpu_regs[HDB1], gpu_regs[HDB2])); |
| 683 | | int hbstart = effective_hvalue(gpu_regs[ENABLE_BORDERS ? HBB : HDE]); |
| 684 | | int vperiod = (gpu_regs[VP] & 0x7ff) + 1; |
| 685 | | int vbend = gpu_regs[VBE] & 0x7ff; |
| 686 | | int vbstart = gpu_regs[VBB] & 0x7ff; |
| 684 | if (reg_store != gpu_regs[offset]) |
| 685 | { |
| 686 | int hperiod = 2 * ((gpu_regs[HP] & 0x3ff) + 1); |
| 687 | int hbend = effective_hvalue(ENABLE_BORDERS ? gpu_regs[HBE] : MIN(gpu_regs[HDB1], gpu_regs[HDB2])); |
| 688 | int hbstart = effective_hvalue(gpu_regs[ENABLE_BORDERS ? HBB : HDE]); |
| 689 | int vperiod = (gpu_regs[VP] & 0x7ff) + 1; |
| 690 | int vbend = gpu_regs[VBE] & 0x7ff; |
| 691 | int vbstart = gpu_regs[VBB] & 0x7ff; |
| 687 | 692 | |
| 688 | | /* adjust for the half-lines */ |
| 689 | | if (hperiod != 0 && vperiod != 0 && hbend < hbstart && vbend < vbstart && hbstart < hperiod) |
| 690 | | { |
| 691 | | rectangle visarea; |
| 692 | | visarea.min_x = hbend / 2; |
| 693 | | visarea.max_x = MIN((hbstart >> 1) - 1, 0x19c); |
| 694 | | // visarea.max_x = hbstart / 2 - 1; |
| 695 | | visarea.min_y = vbend / 2; |
| 696 | | visarea.max_y = vbstart / 2 - 1; |
| 697 | | video_screen_configure(space->machine->primary_screen, hperiod / 2, vperiod / 2, &visarea, HZ_TO_ATTOSECONDS((double)COJAG_PIXEL_CLOCK * 2 / hperiod / vperiod)); |
| 693 | /* adjust for the half-lines */ |
| 694 | if (hperiod != 0 && vperiod != 0 && hbend < hbstart && vbend < vbstart && hbstart < hperiod) |
| 695 | { |
| 696 | rectangle visarea; |
| 697 | visarea.min_x = hbend / 2; |
| 698 | visarea.max_x = hbstart / 2 - 1; |
| 699 | visarea.min_y = vbend / 2; |
| 700 | visarea.max_y = vbstart / 2 - 1; |
| 701 | video_screen_configure(space->machine->primary_screen, hperiod / 2, vperiod / 2, &visarea, HZ_TO_ATTOSECONDS((double)COJAG_PIXEL_CLOCK * 2 / hperiod / vperiod)); |
| 702 | } |
| 698 | 703 | } |
| 699 | 704 | break; |
| 700 | 705 | } |
| r5396 | r5397 | |
| 772 | 777 | UINT32 *dest = BITMAP_ADDR32(screen_bitmap, vc / 2, 0); |
| 773 | 778 | int maxx = visarea->max_x; |
| 774 | 779 | int hde = effective_hvalue(gpu_regs[HDE]) / 2; |
| 775 | | UINT16 scanline[360]; |
| 776 | | int x; |
| 780 | UINT16 x,scanline[760]; |
| 781 | UINT8 y,pixel_width = ((gpu_regs[VMODE]>>10)&3)+1; |
| 777 | 782 | |
| 778 | 783 | /* if we are first on this scanline, clear to the border color */ |
| 779 | 784 | if (ENABLE_BORDERS && vc % 2 == 0) |
| r5396 | r5397 | |
| 787 | 792 | process_object_list(machine, vc, scanline); |
| 788 | 793 | |
| 789 | 794 | /* copy the data to the target, clipping */ |
| 790 | | for (x = 0; x < 360 && hdb <= maxx && hdb < hde; x++, hdb++) |
| 791 | | dest[hdb] = pen_table[scanline[x]]; |
| 795 | for (x = 0; x < 760 && hdb <= maxx && hdb < hde; x++) |
| 796 | for (y = 0; y < pixel_width; y++) |
| 797 | dest[hdb++] = pen_table[scanline[x]]; |
| 792 | 798 | } |
| 793 | 799 | |
| 794 | 800 | /* adjust the timer in a loop, to handle missed cases */ |
| r5396 | r5397 | |
| 822 | 828 | object_timer = timer_alloc(machine, cojag_scanline_update, NULL); |
| 823 | 829 | adjust_object_timer(machine, 0); |
| 824 | 830 | |
| 825 | | screen_bitmap = auto_bitmap_alloc(machine, 720, 512, BITMAP_FORMAT_RGB32); |
| 831 | screen_bitmap = auto_bitmap_alloc(machine, 760, 512, BITMAP_FORMAT_RGB32); |
| 826 | 832 | |
| 827 | 833 | jagobj_init(machine); |
| 828 | 834 | |
src/mess/drivers/jaguar.c
| r5396 | r5397 | |
| 563 | 563 | |
| 564 | 564 | /* cartridge */ |
| 565 | 565 | MDRV_CARTSLOT_ADD("cart") |
| 566 | | MDRV_CARTSLOT_EXTENSION_LIST("jag,abs,rom,j64") |
| 566 | MDRV_CARTSLOT_EXTENSION_LIST("jag,abs,rom,j64,j01") |
| 567 | 567 | MDRV_CARTSLOT_LOAD(jaguar) |
| 568 | 568 | MACHINE_DRIVER_END |
| 569 | 569 | |
| r5396 | r5397 | |
| 635 | 635 | memcpy(jaguar_shared_ram, rom_base, 0x10); |
| 636 | 636 | |
| 637 | 637 | /* Fix endian-ness */ |
| 638 | if (!mame_stricmp(image_filetype(image), "j01")) |
| 639 | { |
| 640 | for (i = 0; i < image_length(image) / 4; i++) |
| 641 | { |
| 642 | j = cart_base[i]; |
| 643 | cart_base[i] = ((j & 0xff) << 16) | ((j & 0xff00) << 16) | ((j & 0xff0000) >> 16) | ((j & 0xff000000) >> 16); |
| 644 | } |
| 645 | } |
| 646 | else |
| 638 | 647 | for (i = 0; i < image_length(image) / 4; i++) |
| 639 | 648 | { |
| 640 | 649 | j = cart_base[i]; |
| r5396 | r5397 | |
| 656 | 665 | *************************************/ |
| 657 | 666 | |
| 658 | 667 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME */ |
| 659 | | CONS( 1993, jaguar, 0, 0, jaguar, jaguar, jaguar, 0, "Atari", "Atari Jaguar", GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) |
| 668 | CONS( 1993, jaguar, 0, 0, jaguar, jaguar, jaguar, 0, "Atari", "Atari Jaguar", GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND) |
| 660 | 669 | 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) |