Skip to content

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

@bfirsh

Description

@bfirsh

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    accuracyHardware accuracy improvementbugcomponent: ppuPPU / graphics (ppu/)difficulty: easySmall, localized change (1-2 lines)priority: lowMinor inaccuracy or code quality issue

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions