trunk/src/mame/video/snes.c
| r21561 | r21562 | |
| 117 | 117 | SNES_COLOR_DEPTH_8BPP |
| 118 | 118 | }; |
| 119 | 119 | |
| 120 | |
| 121 | #define PPU_REG(a) m_regs[a - 0x2100] |
| 122 | |
| 123 | |
| 120 | 124 | /***************************************** |
| 121 | 125 | * get_bgcolor() |
| 122 | 126 | * |
| r21561 | r21562 | |
| 1536 | 1540 | update_obsel(); |
| 1537 | 1541 | |
| 1538 | 1542 | #if SNES_LAYER_DEBUG |
| 1539 | | if (dbg_video(machine, curline, snes_ram)) |
| 1543 | if (dbg_video(machine, curline)) |
| 1540 | 1544 | { |
| 1541 | 1545 | g_profiler.stop(); |
| 1542 | 1546 | return; |
| r21561 | r21562 | |
| 1960 | 1964 | writing to the 'expected' address set by |
| 1961 | 1965 | $2102,$2103. |
| 1962 | 1966 | |
| 1963 | | Notice that, since snes_ram[OAMDATA] is never |
| 1967 | Notice that, since PPU_REG(OAMDATA) is never |
| 1964 | 1968 | read/written directly, we use it as an index |
| 1965 | 1969 | to choose the high/low byte of the snes_oam word. |
| 1966 | 1970 | *************************************************/ |
| r21561 | r21562 | |
| 1980 | 1984 | offset = 0x010c; |
| 1981 | 1985 | } |
| 1982 | 1986 | |
| 1983 | | return (m_oam_ram[offset] >> (snes_ram[OAMDATA] << 3)) & 0xff; |
| 1987 | return (m_oam_ram[offset] >> (PPU_REG(OAMDATA) << 3)) & 0xff; |
| 1984 | 1988 | } |
| 1985 | 1989 | |
| 1986 | 1990 | WRITE8_MEMBER( snes_ppu_class::oam_write ) |
| r21561 | r21562 | |
| 1998 | 2002 | offset = 0x010c; |
| 1999 | 2003 | } |
| 2000 | 2004 | |
| 2001 | | if (!(snes_ram[OAMDATA])) |
| 2005 | if (!(PPU_REG(OAMDATA))) |
| 2002 | 2006 | m_oam_ram[offset] = (m_oam_ram[offset] & 0xff00) | (data << 0); |
| 2003 | 2007 | else |
| 2004 | 2008 | m_oam_ram[offset] = (m_oam_ram[offset] & 0x00ff) | (data << 8); |
| r21561 | r21562 | |
| 2077 | 2081 | ((UINT8 *)m_cgram)[offset] = data; |
| 2078 | 2082 | } |
| 2079 | 2083 | |
| 2080 | | UINT8 snes_ppu_class::read(address_space &space, UINT32 offset, UINT8 *ram_ptr) |
| 2084 | UINT8 snes_ppu_class::read(address_space &space, UINT32 offset, UINT8 wrio_bit7) |
| 2081 | 2085 | { |
| 2082 | 2086 | UINT8 value; |
| 2083 | 2087 | |
| r21561 | r21562 | |
| 2129 | 2133 | return snes_open_bus_r(space, 0); /* Return value is meaningless */ |
| 2130 | 2134 | case ROAMDATA: /* Read data from OAM (DR) */ |
| 2131 | 2135 | m_ppu1_open_bus = oam_read(space, m_oam.address); |
| 2132 | | ram_ptr[OAMDATA] = (ram_ptr[OAMDATA] + 1) % 2; |
| 2133 | | if (!ram_ptr[OAMDATA]) |
| 2136 | PPU_REG(OAMDATA) = (PPU_REG(OAMDATA) + 1) % 2; |
| 2137 | if (!PPU_REG(OAMDATA)) |
| 2134 | 2138 | { |
| 2135 | 2139 | m_oam.address++; |
| 2136 | 2140 | m_oam.address &= 0x1ff; |
| r21561 | r21562 | |
| 2213 | 2217 | case STAT78: /* PPU status flag and version number */ |
| 2214 | 2218 | m_read_ophct = 0; |
| 2215 | 2219 | m_read_opvct = 0; |
| 2216 | | if(ram_ptr[WRIO] & 0x80) |
| 2220 | if (wrio_bit7) |
| 2217 | 2221 | m_stat78 &= ~0x40; //clear ext latch if bit 7 of WRIO is set |
| 2218 | 2222 | m_stat78 = (m_stat78 & ~0x2f) | (m_ppu2_open_bus & 0x20) | (m_ppu2_version & 0x0f); |
| 2219 | 2223 | m_ppu2_open_bus = m_stat78; |
| r21561 | r21562 | |
| 2225 | 2229 | } |
| 2226 | 2230 | |
| 2227 | 2231 | |
| 2228 | | void snes_ppu_class::write(address_space &space, UINT32 offset, UINT8 data, UINT8 *ram_ptr) |
| 2232 | void snes_ppu_class::write(address_space &space, UINT32 offset, UINT8 data) |
| 2229 | 2233 | { |
| 2230 | 2234 | switch (offset) |
| 2231 | 2235 | { |
| r21561 | r21562 | |
| 2248 | 2252 | m_oam.saved_address_low = data; |
| 2249 | 2253 | m_oam.address = (m_oam.address & 0xff00) + data; |
| 2250 | 2254 | m_oam.first_sprite = m_oam.priority_rotation ? (m_oam.address >> 1) & 127 : 0; |
| 2251 | | ram_ptr[OAMDATA] = 0; |
| 2255 | PPU_REG(OAMDATA) = 0; |
| 2252 | 2256 | break; |
| 2253 | 2257 | case OAMADDH: /* Address for accessing OAM (high) */ |
| 2254 | 2258 | m_oam.saved_address_high = data; |
| 2255 | 2259 | m_oam.address = (m_oam.address & 0x00ff) | ((data & 0x01) << 8); |
| 2256 | 2260 | m_oam.priority_rotation = BIT(data, 7); |
| 2257 | 2261 | m_oam.first_sprite = m_oam.priority_rotation ? (m_oam.address >> 1) & 127 : 0; |
| 2258 | | ram_ptr[OAMDATA] = 0; |
| 2262 | PPU_REG(OAMDATA) = 0; |
| 2259 | 2263 | break; |
| 2260 | 2264 | case OAMDATA: /* Data for OAM write (DW) */ |
| 2261 | 2265 | if (m_oam.address >= 0x100) |
| 2262 | 2266 | oam_write(space, m_oam.address, data); |
| 2263 | 2267 | else |
| 2264 | 2268 | { |
| 2265 | | if (!ram_ptr[OAMDATA]) |
| 2269 | if (!PPU_REG(OAMDATA)) |
| 2266 | 2270 | m_oam.write_latch = data; |
| 2267 | 2271 | else |
| 2268 | 2272 | { |
| 2269 | 2273 | // in this case, we not only write data to the upper byte of the word, |
| 2270 | 2274 | // but also m_oam.write_latch to the lower byte (recall that |
| 2271 | | // ram_ptr[OAMDATA] is used to select high/low byte) |
| 2275 | // PPU_REG(OAMDATA) is used to select high/low byte) |
| 2272 | 2276 | oam_write(space, m_oam.address, data); |
| 2273 | | ram_ptr[OAMDATA] = 0; |
| 2277 | PPU_REG(OAMDATA) = 0; |
| 2274 | 2278 | oam_write(space, m_oam.address, m_oam.write_latch); |
| 2275 | | ram_ptr[OAMDATA] = 1; |
| 2279 | PPU_REG(OAMDATA) = 1; |
| 2276 | 2280 | } |
| 2277 | 2281 | } |
| 2278 | | ram_ptr[OAMDATA] = (ram_ptr[OAMDATA] + 1) % 2; |
| 2279 | | if (!ram_ptr[OAMDATA]) |
| 2282 | PPU_REG(OAMDATA) = (PPU_REG(OAMDATA) + 1) % 2; |
| 2283 | if (!PPU_REG(OAMDATA)) |
| 2280 | 2284 | { |
| 2281 | 2285 | m_oam.address++; |
| 2282 | 2286 | m_oam.address &= 0x1ff; |
| r21561 | r21562 | |
| 2458 | 2462 | m_cgram_address = (m_cgram_address + 1) % (SNES_CGRAM_SIZE - 2); |
| 2459 | 2463 | break; |
| 2460 | 2464 | case W12SEL: /* Window mask settings for BG1-2 */ |
| 2461 | | if (data != ram_ptr[W12SEL]) |
| 2465 | if (data != PPU_REG(W12SEL)) |
| 2462 | 2466 | { |
| 2463 | 2467 | m_layer[SNES_BG1].window1_invert = BIT(data, 0); |
| 2464 | 2468 | m_layer[SNES_BG1].window1_enabled = BIT(data, 1); |
| r21561 | r21562 | |
| 2472 | 2476 | } |
| 2473 | 2477 | break; |
| 2474 | 2478 | case W34SEL: /* Window mask settings for BG3-4 */ |
| 2475 | | if (data != ram_ptr[W34SEL]) |
| 2479 | if (data != PPU_REG(W34SEL)) |
| 2476 | 2480 | { |
| 2477 | 2481 | m_layer[SNES_BG3].window1_invert = BIT(data, 0); |
| 2478 | 2482 | m_layer[SNES_BG3].window1_enabled = BIT(data, 1); |
| r21561 | r21562 | |
| 2486 | 2490 | } |
| 2487 | 2491 | break; |
| 2488 | 2492 | case WOBJSEL: /* Window mask settings for objects */ |
| 2489 | | if (data != ram_ptr[WOBJSEL]) |
| 2493 | if (data != PPU_REG(WOBJSEL)) |
| 2490 | 2494 | { |
| 2491 | 2495 | m_layer[SNES_OAM].window1_invert = BIT(data, 0); |
| 2492 | 2496 | m_layer[SNES_OAM].window1_enabled = BIT(data, 1); |
| r21561 | r21562 | |
| 2500 | 2504 | } |
| 2501 | 2505 | break; |
| 2502 | 2506 | case WH0: /* Window 1 left position */ |
| 2503 | | if (data != ram_ptr[WH0]) |
| 2507 | if (data != PPU_REG(WH0)) |
| 2504 | 2508 | { |
| 2505 | 2509 | m_window1_left = data; |
| 2506 | 2510 | m_update_windows = 1; |
| 2507 | 2511 | } |
| 2508 | 2512 | break; |
| 2509 | 2513 | case WH1: /* Window 1 right position */ |
| 2510 | | if (data != ram_ptr[WH1]) |
| 2514 | if (data != PPU_REG(WH1)) |
| 2511 | 2515 | { |
| 2512 | 2516 | m_window1_right = data; |
| 2513 | 2517 | m_update_windows = 1; |
| 2514 | 2518 | } |
| 2515 | 2519 | break; |
| 2516 | 2520 | case WH2: /* Window 2 left position */ |
| 2517 | | if (data != ram_ptr[WH2]) |
| 2521 | if (data != PPU_REG(WH2)) |
| 2518 | 2522 | { |
| 2519 | 2523 | m_window2_left = data; |
| 2520 | 2524 | m_update_windows = 1; |
| 2521 | 2525 | } |
| 2522 | 2526 | break; |
| 2523 | 2527 | case WH3: /* Window 2 right position */ |
| 2524 | | if (data != ram_ptr[WH3]) |
| 2528 | if (data != PPU_REG(WH3)) |
| 2525 | 2529 | { |
| 2526 | 2530 | m_window2_right = data; |
| 2527 | 2531 | m_update_windows = 1; |
| 2528 | 2532 | } |
| 2529 | 2533 | break; |
| 2530 | 2534 | case WBGLOG: /* Window mask logic for BG's */ |
| 2531 | | if (data != ram_ptr[WBGLOG]) |
| 2535 | if (data != PPU_REG(WBGLOG)) |
| 2532 | 2536 | { |
| 2533 | 2537 | m_layer[SNES_BG1].wlog_mask = data & 0x03; |
| 2534 | 2538 | m_layer[SNES_BG2].wlog_mask = (data & 0x0c) >> 2; |
| r21561 | r21562 | |
| 2538 | 2542 | } |
| 2539 | 2543 | break; |
| 2540 | 2544 | case WOBJLOG: /* Window mask logic for objects */ |
| 2541 | | if (data != ram_ptr[WOBJLOG]) |
| 2545 | if (data != PPU_REG(WOBJLOG)) |
| 2542 | 2546 | { |
| 2543 | 2547 | m_layer[SNES_OAM].wlog_mask = data & 0x03; |
| 2544 | 2548 | m_layer[SNES_COLOR].wlog_mask = (data & 0x0c) >> 2; |
| r21561 | r21562 | |
| 2579 | 2583 | m_sub_add_mode = BIT(data, 1); |
| 2580 | 2584 | m_direct_color = BIT(data, 0); |
| 2581 | 2585 | #ifdef SNES_DBG_REG_W |
| 2582 | | if ((data & 0x2) != (ram_ptr[CGWSEL] & 0x2)) |
| 2586 | if ((data & 0x2) != (PPU_REG(CGWSEL) & 0x2)) |
| 2583 | 2587 | mame_printf_debug("Add/Sub Layer: %s\n", ((data & 0x2) >> 1) ? "Subscreen" : "Fixed colour"); |
| 2584 | 2588 | #endif |
| 2585 | 2589 | break; |
| r21561 | r21562 | |
| 2618 | 2622 | m_mode7.extbg = BIT(data, 6); |
| 2619 | 2623 | dynamic_res_change(space.machine()); |
| 2620 | 2624 | #ifdef SNES_DBG_REG_W |
| 2621 | | if ((data & 0x8) != (ram_ptr[SETINI] & 0x8)) |
| 2625 | if ((data & 0x8) != (PPU_REG(SETINI) & 0x8)) |
| 2622 | 2626 | mame_printf_debug("Pseudo 512 mode: %s\n", (data & 0x8) ? "on" : "off"); |
| 2623 | 2627 | #endif |
| 2624 | 2628 | break; |
| 2625 | 2629 | } |
| 2626 | 2630 | |
| 2627 | | ram_ptr[offset] = data; |
| 2631 | PPU_REG(offset) = data; |
| 2628 | 2632 | } |
| 2629 | 2633 | |
| 2630 | 2634 | /***** Debug Functions *****/ |
| r21561 | r21562 | |
| 2643 | 2647 | popmessage MSG2; \ |
| 2644 | 2648 | } |
| 2645 | 2649 | |
| 2646 | | static UINT8 dbg_video( running_machine &machine, UINT16 curline, UINT8 *ram_ptr ) |
| 2650 | static UINT8 dbg_video( running_machine &machine, UINT16 curline ) |
| 2647 | 2651 | { |
| 2648 | 2652 | int i; |
| 2649 | 2653 | UINT8 toggles = machine.root_device().ioport("DEBUG1")->read_safe(0); |
| r21561 | r21562 | |
| 2678 | 2682 | logerror("%s", debug_options.windows_disabled?" ":"W"); |
| 2679 | 2683 | logerror("%s1 %s%s%s%s%s%c%s%s%d%s %d %4X %4X", |
| 2680 | 2684 | debug_options.bg_disabled[0]?" ":"*", |
| 2681 | | (ram_ptr[TM] & 0x1)?"M":" ", |
| 2682 | | (ram_ptr[TS] & 0x1)?"S":" ", |
| 2683 | | (ram_ptr[CGADSUB] & 0x1)?"B":" ", |
| 2684 | | (ram_ptr[TMW] & 0x1)?"m":" ", |
| 2685 | | (ram_ptr[TSW] & 0x1)?"s":" ", |
| 2686 | | WINLOGIC[(ram_ptr[WBGLOG] & 0x3)], |
| 2687 | | (ram_ptr[W12SEL] & 0x2)?((ram_ptr[W12SEL] & 0x1)?"o":"i"):" ", |
| 2688 | | (ram_ptr[W12SEL] & 0x8)?((ram_ptr[W12SEL] & 0x4)?"o":"i"):" ", |
| 2685 | (PPU_REG(TM) & 0x1)?"M":" ", |
| 2686 | (PPU_REG(TS) & 0x1)?"S":" ", |
| 2687 | (PPU_REG(CGADSUB) & 0x1)?"B":" ", |
| 2688 | (PPU_REG(TMW) & 0x1)?"m":" ", |
| 2689 | (PPU_REG(TSW) & 0x1)?"s":" ", |
| 2690 | WINLOGIC[(PPU_REG(WBGLOG) & 0x3)], |
| 2691 | (PPU_REG(W12SEL) & 0x2)?((PPU_REG(W12SEL) & 0x1)?"o":"i"):" ", |
| 2692 | (PPU_REG(W12SEL) & 0x8)?((PPU_REG(W12SEL) & 0x4)?"o":"i"):" ", |
| 2689 | 2693 | m_layer[SNES_BG1].tile_size + 1, |
| 2690 | | (ram_ptr[MOSAIC] & 0x1)?"m":" ", |
| 2691 | | ram_ptr[BG1SC] & 0x3, |
| 2692 | | (ram_ptr[BG1SC] & 0xfc) << 9, |
| 2694 | (PPU_REG(MOSAIC) & 0x1)?"m":" ", |
| 2695 | PPU_REG(BG1SC) & 0x3, |
| 2696 | (PPU_REG(BG1SC) & 0xfc) << 9, |
| 2693 | 2697 | m_layer[SNES_BG1].charmap << 13); |
| 2694 | 2698 | logerror("%s2 %s%s%s%s%s%c%s%s%d%s %d %4X %4X", |
| 2695 | 2699 | debug_options.bg_disabled[1]?" ":"*", |
| 2696 | | (ram_ptr[TM] & 0x2)?"M":" ", |
| 2697 | | (ram_ptr[TS] & 0x2)?"S":" ", |
| 2698 | | (ram_ptr[CGADSUB] & 0x2)?"B":" ", |
| 2699 | | (ram_ptr[TMW] & 0x2)?"m":" ", |
| 2700 | | (ram_ptr[TSW] & 0x2)?"s":" ", |
| 2701 | | WINLOGIC[(ram_ptr[WBGLOG] & 0xc) >> 2], |
| 2702 | | (ram_ptr[W12SEL] & 0x20)?((ram_ptr[W12SEL] & 0x10)?"o":"i"):" ", |
| 2703 | | (ram_ptr[W12SEL] & 0x80)?((ram_ptr[W12SEL] & 0x40)?"o":"i"):" ", |
| 2700 | (PPU_REG(TM) & 0x2)?"M":" ", |
| 2701 | (PPU_REG(TS) & 0x2)?"S":" ", |
| 2702 | (PPU_REG(CGADSUB) & 0x2)?"B":" ", |
| 2703 | (PPU_REG(TMW) & 0x2)?"m":" ", |
| 2704 | (PPU_REG(TSW) & 0x2)?"s":" ", |
| 2705 | WINLOGIC[(PPU_REG(WBGLOG) & 0xc) >> 2], |
| 2706 | (PPU_REG(W12SEL) & 0x20)?((PPU_REG(W12SEL) & 0x10)?"o":"i"):" ", |
| 2707 | (PPU_REG(W12SEL) & 0x80)?((PPU_REG(W12SEL) & 0x40)?"o":"i"):" ", |
| 2704 | 2708 | m_layer[SNES_BG2].tile_size + 1, |
| 2705 | | (ram_ptr[MOSAIC] & 0x2)?"m":" ", |
| 2706 | | ram_ptr[BG2SC] & 0x3, |
| 2707 | | (ram_ptr[BG2SC] & 0xfc) << 9, |
| 2709 | (PPU_REG(MOSAIC) & 0x2)?"m":" ", |
| 2710 | PPU_REG(BG2SC) & 0x3, |
| 2711 | (PPU_REG(BG2SC) & 0xfc) << 9, |
| 2708 | 2712 | m_layer[SNES_BG2].charmap << 13); |
| 2709 | 2713 | logerror("%s3 %s%s%s%s%s%c%s%s%d%s%s%d %4X %4X", |
| 2710 | 2714 | debug_options.bg_disabled[2]?" ":"*", |
| 2711 | | (ram_ptr[TM] & 0x4)?"M":" ", |
| 2712 | | (ram_ptr[TS] & 0x4)?"S":" ", |
| 2713 | | (ram_ptr[CGADSUB] & 0x4)?"B":" ", |
| 2714 | | (ram_ptr[TMW] & 0x4)?"m":" ", |
| 2715 | | (ram_ptr[TSW] & 0x4)?"s":" ", |
| 2716 | | WINLOGIC[(ram_ptr[WBGLOG] & 0x30)>>4], |
| 2717 | | (ram_ptr[W34SEL] & 0x2)?((ram_ptr[W34SEL] & 0x1)?"o":"i"):" ", |
| 2718 | | (ram_ptr[W34SEL] & 0x8)?((ram_ptr[W34SEL] & 0x4)?"o":"i"):" ", |
| 2715 | (PPU_REG(TM) & 0x4)?"M":" ", |
| 2716 | (PPU_REG(TS) & 0x4)?"S":" ", |
| 2717 | (PPU_REG(CGADSUB) & 0x4)?"B":" ", |
| 2718 | (PPU_REG(TMW) & 0x4)?"m":" ", |
| 2719 | (PPU_REG(TSW) & 0x4)?"s":" ", |
| 2720 | WINLOGIC[(PPU_REG(WBGLOG) & 0x30)>>4], |
| 2721 | (PPU_REG(W34SEL) & 0x2)?((PPU_REG(W34SEL) & 0x1)?"o":"i"):" ", |
| 2722 | (PPU_REG(W34SEL) & 0x8)?((PPU_REG(W34SEL) & 0x4)?"o":"i"):" ", |
| 2719 | 2723 | m_layer[SNES_BG3].tile_size + 1, |
| 2720 | | (ram_ptr[MOSAIC] & 0x4)?"m":" ", |
| 2721 | | (ram_ptr[BGMODE] & 0x8)?"P":" ", |
| 2722 | | ram_ptr[BG3SC] & 0x3, |
| 2723 | | (ram_ptr[BG3SC] & 0xfc) << 9, |
| 2724 | (PPU_REG(MOSAIC) & 0x4)?"m":" ", |
| 2725 | (PPU_REG(BGMODE) & 0x8)?"P":" ", |
| 2726 | PPU_REG(BG3SC) & 0x3, |
| 2727 | (PPU_REG(BG3SC) & 0xfc) << 9, |
| 2724 | 2728 | m_layer[SNES_BG3].charmap << 13); |
| 2725 | 2729 | logerror("%s4 %s%s%s%s%s%c%s%s%d%s %d %4X %4X", |
| 2726 | 2730 | debug_options.bg_disabled[3]?" ":"*", |
| 2727 | | (ram_ptr[TM] & 0x8)?"M":" ", |
| 2728 | | (ram_ptr[TS] & 0x8)?"S":" ", |
| 2729 | | (ram_ptr[CGADSUB] & 0x8)?"B":" ", |
| 2730 | | (ram_ptr[TMW] & 0x8)?"m":" ", |
| 2731 | | (ram_ptr[TSW] & 0x8)?"s":" ", |
| 2732 | | WINLOGIC[(ram_ptr[WBGLOG] & 0xc0)>>6], |
| 2733 | | (ram_ptr[W34SEL] & 0x20)?((ram_ptr[W34SEL] & 0x10)?"o":"i"):" ", |
| 2734 | | (ram_ptr[W34SEL] & 0x80)?((ram_ptr[W34SEL] & 0x40)?"o":"i"):" ", |
| 2731 | (PPU_REG(TM) & 0x8)?"M":" ", |
| 2732 | (PPU_REG(TS) & 0x8)?"S":" ", |
| 2733 | (PPU_REG(CGADSUB) & 0x8)?"B":" ", |
| 2734 | (PPU_REG(TMW) & 0x8)?"m":" ", |
| 2735 | (PPU_REG(TSW) & 0x8)?"s":" ", |
| 2736 | WINLOGIC[(PPU_REG(WBGLOG) & 0xc0)>>6], |
| 2737 | (PPU_REG(W34SEL) & 0x20)?((PPU_REG(W34SEL) & 0x10)?"o":"i"):" ", |
| 2738 | (PPU_REG(W34SEL) & 0x80)?((PPU_REG(W34SEL) & 0x40)?"o":"i"):" ", |
| 2735 | 2739 | m_layer[SNES_BG4].tile_size + 1, |
| 2736 | | (ram_ptr[MOSAIC] & 0x8)?"m":" ", |
| 2737 | | ram_ptr[BG4SC] & 0x3, |
| 2738 | | (ram_ptr[BG4SC] & 0xfc) << 9, |
| 2740 | (PPU_REG(MOSAIC) & 0x8)?"m":" ", |
| 2741 | PPU_REG(BG4SC) & 0x3, |
| 2742 | (PPU_REG(BG4SC) & 0xfc) << 9, |
| 2739 | 2743 | m_layer[SNES_BG4].charmap << 13 ); |
| 2740 | 2744 | logerror("%sO %s%s%s%s%s%c%s%s %4X", |
| 2741 | 2745 | debug_options.bg_disabled[4]?" ":"*", |
| 2742 | | (ram_ptr[TM] & 0x10)?"M":" ", |
| 2743 | | (ram_ptr[TS] & 0x10)?"S":" ", |
| 2744 | | (ram_ptr[CGADSUB] & 0x10)?"B":" ", |
| 2745 | | (ram_ptr[TMW] & 0x10)?"m":" ", |
| 2746 | | (ram_ptr[TSW] & 0x10)?"s":" ", |
| 2747 | | WINLOGIC[(ram_ptr[WOBJLOG] & 0x3)], |
| 2748 | | (ram_ptr[WOBJSEL] & 0x2)?((ram_ptr[WOBJSEL] & 0x1)?"o":"i"):" ", |
| 2749 | | (ram_ptr[WOBJSEL] & 0x8)?((ram_ptr[WOBJSEL] & 0x4)?"o":"i"):" ", |
| 2746 | (PPU_REG(TM) & 0x10)?"M":" ", |
| 2747 | (PPU_REG(TS) & 0x10)?"S":" ", |
| 2748 | (PPU_REG(CGADSUB) & 0x10)?"B":" ", |
| 2749 | (PPU_REG(TMW) & 0x10)?"m":" ", |
| 2750 | (PPU_REG(TSW) & 0x10)?"s":" ", |
| 2751 | WINLOGIC[(PPU_REG(WOBJLOG) & 0x3)], |
| 2752 | (PPU_REG(WOBJSEL) & 0x2)?((PPU_REG(WOBJSEL) & 0x1)?"o":"i"):" ", |
| 2753 | (PPU_REG(WOBJSEL) & 0x8)?((PPU_REG(WOBJSEL) & 0x4)?"o":"i"):" ", |
| 2750 | 2754 | m_layer[SNES_OAM].charmap << 13 ); |
| 2751 | 2755 | logerror("%sB %s %c%s%s", |
| 2752 | 2756 | debug_options.colormath_disabled?" ":"*", |
| 2753 | | (ram_ptr[CGADSUB] & 0x20)?"B":" ", |
| 2754 | | WINLOGIC[(ram_ptr[WOBJLOG] & 0xc)>>2], |
| 2755 | | (ram_ptr[WOBJSEL] & 0x20)?((ram_ptr[WOBJSEL] & 0x10)?"o":"i"):" ", |
| 2756 | | (ram_ptr[WOBJSEL] & 0x80)?((ram_ptr[WOBJSEL] & 0x40)?"o":"i"):" " ); |
| 2757 | (PPU_REG(CGADSUB) & 0x20)?"B":" ", |
| 2758 | WINLOGIC[(PPU_REG(WOBJLOG) & 0xc)>>2], |
| 2759 | (PPU_REG(WOBJSEL) & 0x20)?((PPU_REG(WOBJSEL) & 0x10)?"o":"i"):" ", |
| 2760 | (PPU_REG(WOBJSEL) & 0x80)?((PPU_REG(WOBJSEL) & 0x40)?"o":"i"):" " ); |
| 2757 | 2761 | logerror("1) %3d %3d 2) %3d %3d", (m_bgd_offset.horizontal[0] & 0x3ff) >> 3, (m_bgd_offset.vertical[0] & 0x3ff) >> 3, (m_bgd_offset.horizontal[1] & 0x3ff) >> 3, (m_bgd_offset.vertical[1] & 0x3ff) >> 3 ); |
| 2758 | 2762 | logerror("3) %3d %3d 4) %3d %3d", (m_bgd_offset.horizontal[2] & 0x3ff) >> 3, (m_bgd_offset.vertical[2] & 0x3ff) >> 3, (m_bgd_offset.horizontal[3] & 0x3ff) >> 3, (m_bgd_offset.vertical[3] & 0x3ff) >> 3 ); |
| 2759 | | logerror("Flags: %s%s%s %s %2d", (ram_ptr[CGWSEL] & 0x2)?"S":"F", (ram_ptr[CGADSUB] & 0x80)?"-":"+", (ram_ptr[CGADSUB] & 0x40)?" 50%":"100%",(ram_ptr[CGWSEL] & 0x1)?"D":"P", (ram_ptr[MOSAIC] & 0xf0) >> 4 ); |
| 2760 | | logerror("SetINI: %s %s %s %s %s %s", (ram_ptr[SETINI] & 0x1)?" I":"NI", (ram_ptr[SETINI] & 0x2)?"P":"R", (ram_ptr[SETINI] & 0x4)?"240":"225",(ram_ptr[SETINI] & 0x8)?"512":"256",(ram_ptr[SETINI] & 0x40)?"E":"N",(ram_ptr[SETINI] & 0x80)?"ES":"NS" ); |
| 2763 | logerror("Flags: %s%s%s %s %2d", (PPU_REG(CGWSEL) & 0x2)?"S":"F", (PPU_REG(CGADSUB) & 0x80)?"-":"+", (PPU_REG(CGADSUB) & 0x40)?" 50%":"100%",(PPU_REG(CGWSEL) & 0x1)?"D":"P", (PPU_REG(MOSAIC) & 0xf0) >> 4 ); |
| 2764 | logerror("SetINI: %s %s %s %s %s %s", (PPU_REG(SETINI) & 0x1)?" I":"NI", (PPU_REG(SETINI) & 0x2)?"P":"R", (PPU_REG(SETINI) & 0x4)?"240":"225",(PPU_REG(SETINI) & 0x8)?"512":"256",(PPU_REG(SETINI) & 0x40)?"E":"N",(PPU_REG(SETINI) & 0x80)?"ES":"NS" ); |
| 2761 | 2765 | logerror("Mode7: A %5d B %5d", m_mode7.matrix_a, m_mode7.matrix_b ); |
| 2762 | | logerror(" %s%s%s C %5d D %5d", (ram_ptr[M7SEL] & 0xc0)?((ram_ptr[M7SEL] & 0x40)?"0":"C"):"R", (ram_ptr[M7SEL] & 0x1)?"H":" ", (ram_ptr[M7SEL] & 0x2)?"V":" ", m_mode7.matrix_c, m_mode7.matrix_d ); |
| 2766 | logerror(" %s%s%s C %5d D %5d", (PPU_REG(M7SEL) & 0xc0)?((PPU_REG(M7SEL) & 0x40)?"0":"C"):"R", (PPU_REG(M7SEL) & 0x1)?"H":" ", (PPU_REG(M7SEL) & 0x2)?"V":" ", m_mode7.matrix_c, m_mode7.matrix_d ); |
| 2763 | 2767 | logerror(" X %5d Y %5d", m_mode7.origin_x, m_mode7.origin_y ); |
| 2764 | 2768 | } |
| 2765 | 2769 | #endif |