Full PAL Emulation w/ NES pixel decoding (Integer-only)

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

Post Reply
EMMIR
Posts: 6
Joined: Sat Feb 11, 2023 3:30 pm

Full PAL Emulation w/ NES pixel decoding (Integer-only)

Post by EMMIR »

I wrote a PAL emulator to complement my NTSC emulator. Like the NTSC emulator, it is a software implementation written in C using integers only.

Image



GitHub Link:
https://github.com/LMP88959/PAL-CRT

Acknowledgements:
Thank you to the NESDev Discord server for help.
And thank you to the following people (in no particular order):
lidnariq
Persune
Eugene.S
L. Spiro
org
feos
EMMIR
Posts: 6
Joined: Sat Feb 11, 2023 3:30 pm

Re: Full PAL Emulation w/ NES pixel decoding (Integer-only)

Post by EMMIR »

Chroma patterns:

Image


Thanks to HardWareMan and feos for helping me with understanding this issue.
L. Spiro
Posts: 14
Joined: Sun Jan 29, 2023 11:27 pm

Re: Full PAL Emulation w/ NES pixel decoding (Integer-only)

Post by L. Spiro »

Here are screenshots.
BeesNES_0OVGGz8Jke.png
BeesNES_dthkEosHEW.png
BeesNES_AIHhmK9oYa.png
BeesNES_bY1xDoDvav.png
BeesNES_ibAFeXIOAf.png
L. Spiro
L. Spiro
Posts: 14
Joined: Sun Jan 29, 2023 11:27 pm

Re: Full PAL Emulation w/ NES pixel decoding (Integer-only)

Post by L. Spiro »

cmr
Posts: 8
Joined: Tue Jul 19, 2022 7:38 am

Re: Full PAL Emulation w/ NES pixel decoding (Integer-only)

Post by cmr »

Very nice! I've been using https://github.com/libretro/common-shad ... 57shell.cg so far but I'm very curious to see how this compares.
User avatar
Dwedit
Posts: 4924
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Re: Full PAL Emulation w/ NES pixel decoding (Integer-only)

Post by Dwedit »

Weirdly enough, in captures of NES video (at least on NTSC), vertical edges between two monochrome colors (such as white or gray on black) look artifact-free, and don't have the jagged edges that you see on colored vertical edges. Might just be the capture device at work here.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
creaothceann
Posts: 611
Joined: Mon Jan 23, 2006 7:47 am
Location: Germany
Contact:

Re: Full PAL Emulation w/ NES pixel decoding (Integer-only)

Post by creaothceann »

Brightness is encoded differently from color, which NTSC was created for, and "can go anywhere up to about 4x [of the color bandwidth]"[1].
Artifacts can still occur when there are fine details in brightness and the video encoder sends a color burst before the actual image data (which afaik can't be disabled on most consoles).

The jagged edges are usually there because the NES alternates between ending a line after 227 1/3 color clock cycles, not 227.5 (NTSC standard) or 227 or 228. They're also averaged over time because one out of two NES fields is slightly shorter.

[1] [2] [3] [4]
My current setup:
Super Famicom ("2/1/3" SNS-CPU-GPM-02) → SCART → OSSC → StarTech USB3HDCAP → AmaRecTV 3.10
EMMIR
Posts: 6
Joined: Sat Feb 11, 2023 3:30 pm

Re: Full PAL Emulation w/ NES pixel decoding (Integer-only)

Post by EMMIR »

cmr wrote: Wed Oct 25, 2023 12:34 pm Very nice! I've been using https://github.com/libretro/common-shad ... 57shell.cg so far but I'm very curious to see how this compares.
Thank you! puNES just recently added both my NTSC and PAL filters (called the LMP88959 filters) so they should be easy to try out now! :D
Post Reply