src/mame/video/snes.c
| r5365 | r5366 | |
| 461 | 461 | UINT16 vscroll, hscroll, vtilescroll; |
| 462 | 462 | UINT8 vshift, hshift, tile_size; |
| 463 | 463 | /* variables depending on color_depth */ |
| 464 | | UINT8 color_shift = 0; |
| 465 | | UINT8 color_planes = 2; |
| 464 | UINT8 color_shift = 0; |
| 465 | UINT8 color_planes = 2; |
| 466 | 466 | UINT8 tile_divider = 1; |
| 467 | 467 | |
| 468 | 468 | #ifdef MAME_DEBUG |
| r5365 | r5366 | |
| 585 | 585 | /* below, only color_planes depends on color_depth */ |
| 586 | 586 | if (tile_size) |
| 587 | 587 | { |
| 588 | #if 0 |
| 589 | /* Bishoujo Janshi SuchiiPai and Desert Fighter sets this in hires, no noticeable difference apart that x must be doubled somehow... */ |
| 588 | 590 | if (hires) /* Hi-Res: 2bpp & 4bpp */ |
| 589 | 591 | { |
| 590 | 592 | if (hflip) |
| r5365 | r5366 | |
| 599 | 601 | } |
| 600 | 602 | } |
| 601 | 603 | else /* No Hi-Res: 2bpp, 4bpp & 8bpp */ |
| 604 | #endif |
| 602 | 605 | { |
| 603 | 606 | snes_draw_tile_x2(screen, color_planes, layer, snes_ppu.layer[layer].data + (tile * 8 * color_planes) + tile_line, ((ii >> 1) * (8 << tile_size)) - hshift, priority, hflip, pal); |
| 604 | 607 | } |
| r5365 | r5366 | |
| 619 | 622 | * |
| 620 | 623 | * Update an entire line of mode7 tiles. |
| 621 | 624 | * |
| 622 | | * 2009-08: Missing MOSAIC in Mode 7 |
| 625 | * 2009-08: Missing MOSAIC in Mode 7 |
| 623 | 626 | * (different behaviors in BG1 & BG2) |
| 624 | 627 | *********************************************/ |
| 625 | 628 | static void snes_update_line_mode7(UINT8 screen, UINT8 priority_a, UINT8 priority_b, UINT8 layer, UINT16 curline ) |
| r5365 | r5366 | |
| 758 | 761 | INT16 i, x, y; |
| 759 | 762 | UINT8 *oamram = (UINT8 *)snes_oam; |
| 760 | 763 | UINT32 name_sel = 0; |
| 761 | | static const UINT8 table_obj_priority[10][4] = { |
| 764 | static const UINT8 table_obj_priority[10][4] = { |
| 762 | 765 | {2, 5, 8, 11}, // mode 0 |
| 763 | 766 | {1, 3, 6, 9}, // mode 1 |
| 764 | 767 | {1, 3, 5, 7}, // mode 2 |
| r5365 | r5366 | |
| 766 | 769 | {1, 3, 5, 7}, // mode 4 |
| 767 | 770 | {1, 3, 5, 7}, // mode 5 |
| 768 | 771 | {0, 2, 3, 5}, // mode 6 |
| 769 | | {0, 2, 3, 4}, // mode 7 |
| 772 | {0, 2, 3, 4}, // mode 7 |
| 770 | 773 | {1, 3, 5, 6}, // mode 7 EXTBG |
| 771 | 774 | {1, 2, 5, 8} // mode 1 + BG3 priority bit |
| 772 | 775 | }; |
| r5365 | r5366 | |
| 967 | 970 | if (snes_ram[bg_enable_reg] & 0x10) snes_update_objects(screen, 8, curline); |
| 968 | 971 | if (snes_ram[bg_enable_reg] & 0x01) snes_update_line_mode7(screen, 2, 2, 0, curline); |
| 969 | 972 | if (snes_ram[bg_enable_reg] & 0x02) snes_update_line_mode7(screen, 0, 4, 1, curline); |
| 970 | | } |
| 973 | } |
| 971 | 974 | } |
| 972 | 975 | |
| 973 | 976 | /********************************************* |
| r5365 | r5366 | |
| 979 | 982 | { |
| 980 | 983 | switch (snes_ppu.mode) |
| 981 | 984 | { |
| 982 | | case 0: snes_update_mode_0(screen, curline); break; /* Mode 0 */ |
| 983 | | case 1: snes_update_mode_1(screen, curline); break; /* Mode 1 */ |
| 984 | | case 2: snes_update_mode_2(screen, curline); break; /* Mode 2 - Supports offset per tile */ |
| 985 | | case 3: snes_update_mode_3(screen, curline); break; /* Mode 3 - Supports direct colour */ |
| 986 | | case 4: snes_update_mode_4(screen, curline); break; /* Mode 4 - Supports offset per tile and direct colour */ |
| 987 | | case 5: snes_update_mode_5(screen, curline); break; /* Mode 5 - Supports hires */ |
| 988 | | case 6: snes_update_mode_6(screen, curline); break; /* Mode 6 - Supports offset per tile and hires */ |
| 989 | | case 7: snes_update_mode_7(screen, curline); break; /* Mode 7 - Supports direct colour */ |
| 985 | case 0: snes_update_mode_0(screen, curline); break; /* Mode 0 */ |
| 986 | case 1: snes_update_mode_1(screen, curline); break; /* Mode 1 */ |
| 987 | case 2: snes_update_mode_2(screen, curline); break; /* Mode 2 - Supports offset per tile */ |
| 988 | case 3: snes_update_mode_3(screen, curline); break; /* Mode 3 - Supports direct colour */ |
| 989 | case 4: snes_update_mode_4(screen, curline); break; /* Mode 4 - Supports offset per tile and direct colour */ |
| 990 | case 5: snes_update_mode_5(screen, curline); break; /* Mode 5 - Supports hires */ |
| 991 | case 6: snes_update_mode_6(screen, curline); break; /* Mode 6 - Supports offset per tile and hires */ |
| 992 | case 7: snes_update_mode_7(screen, curline); break; /* Mode 7 - Supports direct colour */ |
| 990 | 993 | } |
| 991 | 994 | } |
| 992 | 995 | |