Skip to content

Fix various bugs in NES NTSC filter and PPU palettes#31

Open
Gumball2415 wants to merge 3 commits into
SourMesen:masterfrom
Gumball2415:master
Open

Fix various bugs in NES NTSC filter and PPU palettes#31
Gumball2415 wants to merge 3 commits into
SourMesen:masterfrom
Gumball2415:master

Conversation

@Gumball2415
Copy link
Copy Markdown
Contributor

@Gumball2415 Gumball2415 commented Oct 22, 2023

This PR aims to fix some small bugs regarding NES NTSC filters.

Changes in this PR:

  • Correct dot crawl phase offset calculation
  • Use standard RGB-YIQ matrix coefficients for Bisqwit NTSC
  • Fix RGB PPU default palette emphasis behavior

@Gumball2415 Gumball2415 marked this pull request as ready for review October 25, 2023 07:08
@Gumball2415 Gumball2415 marked this pull request as draft October 25, 2023 07:24
@Gumball2415 Gumball2415 marked this pull request as ready for review October 27, 2023 18:21
@Gumball2415 Gumball2415 changed the title Fix various bugs in NES NTSC filters Fix various bugs in NES NTSC filter and PPU palettes Dec 11, 2023
- Thanks lidnariq!
- The new formula is based on the color generator clock cycle count per
  frame.
https://forums.nesdev.org/viewtopic.php?p=172817#p172817

Bisqwit originally intended to match a certain palette using different
display primaries ("FCC D65"). This resulted in colors that looked off.
The modification here is to more closely match Bisqwit's own palette
generator, which uses a more standard RGB-YIQ matrix.
at hue 0, saturation 1.0, contrast 1.0, brightness 1.0, gamma 2.2
https://bisqwit.iki.fi/utils/nespalette.php

IQ component coefficients are derived from the NTSC base matrix of
luminance and color-difference. with color reduction factors and an
additional 33 degree rotation of each respective component.
https://www.nesdev.org/wiki/NTSC_video#Converting_YUV_to_signal_RGB
Sunlitspace542 pushed a commit to Sunlitspace542/Mesen2 that referenced this pull request Apr 17, 2026
…Mesen#31)

The NES header editor is currently unable to save a ROM if it was loaded from an archive (such as .zip) or if the ROM was soft-patched. This is because the editor reloads the ROM from disk to then apply the new header and save a copy, but the C# compnent is not able to open archives or apply patches. If the ROM file is in an archive, it throws an Unexpected Error and fails.

This change instead makes the editor use the current PRG and CHR ROM. This means it doesn't need to reload the ROM, so it can save it regardless of how it was loaded. It also means that it saves any changes that have been made to the ROM in the session, either by self-flashing or by editing them via tools, which could be seen as a pro or a con. Also, because Mesen does not currently use misc ROM, it is unable to include that in the saved ROM, but this is something we could feasibly add later.

This change was written by Sour.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant