#607·jsnes

PPU: minor rendering issues (odd-frame skip, monochrome bg, sprite 0 left-column)

Author: bfirshCreated Feb 28, 2026Updated Feb 28, 2026
Labelsbugpriority: lowdifficulty: easycomponent: ppuaccuracy

Summary

Three small PPU issues:

1. Odd-frame cycle skip is dead code (ppu/index.js:402-406)

dummyCycleToggle is initialized to false and never set to true anywhere, so odd frames are never shortened by 1 dot. Real NTSC NES alternates between 341-dot and 340-dot frames (when rendering is enabled).

2. Monochrome mode background color is nonsensical (ppu/index.js:502-527)

When f_dispType === 1 (monochrome), the code picks hardcoded RGB colors (green, blue, red) based on the emphasis bits. Real hardware doesn't work this way — emphasis attenuates color channels regardless of greyscale mode.

3. Sprite 0 hit missing left-column and x=255 checks

Per nesdev, sprite 0 hit should not fire when:

  • Background or sprite left-column clipping is active (left 8 pixels hidden via PPUMASK bits 1-2)
  • At x=255

The current checkSprite0() doesn't check these conditions.