Most emulators i've tested don't do dual emphasis bits right

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

User avatar
FrankenGraphics
Formerly WheelInventor
Posts: 2030
Joined: Thu Apr 14, 2016 2:55 am
Location: Gothenburg, Sweden
Contact:

Re: Most emulators i've tested don't do dual emphasis bits r

Post by FrankenGraphics » Tue Feb 05, 2019 12:06 pm

Is there a significant difference between nintendulator and NDX when it comes to emphasis and palettes? If so I'll add it to the bunch when doing the reexamination tomorrow.

Firebrand got back to me:
Firebrand via mail wrote:Yeah I have a test ROM that lets me set full-screen for each emphasis
color. It's just a thing where the lack of being able to actually
program them as a palette entry in stuff like the NESRGB makes it kind
of a moot point. Until such time as we have user control over full
palette with emphasis bits, I haven't been interested in spending the
several hours it would take to do a direct capture (much less a PVM
comparative capture).

Also unfortunately I've become way too busy with my electrical
engineering projects to set aside time for these investigations. Perhaps
in a couple months I can review the situation.
The NESRGB programming issue is sort of a second onion layer to the egg and chicken problem. (this is beginning to sound like a recipe).
http://www.frankengraphics.com - personal NES blog

User avatar
cpow
NESICIDE developer
Posts: 1089
Joined: Mon Oct 13, 2008 7:55 pm
Location: Minneapolis, MN
Contact:

Re: Most emulators i've tested don't do dual emphasis bits r

Post by cpow » Tue Feb 05, 2019 12:57 pm

FrankenGraphics wrote:Here's a comparison of how nintaco, mesen and nnnesterJ
Taking requests? nesicide? :beer:

User avatar
rainwarrior
Posts: 7642
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Most emulators i've tested don't do dual emphasis bits r

Post by rainwarrior » Tue Feb 05, 2019 4:39 pm

Over in my palette test ROM thread, I added a program to help take samples captured from the palette test.
viewtopic.php?p=233739#p233739

For a quick point of reference, my front loader NES / AV modded Famicom vs. Diamond VC500 / Framemeister XRGB mini + Avermedia LGX.
Image

The relevant 512-entry palette files etc. are attached in that post.

User avatar
rainwarrior
Posts: 7642
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Most emulators i've tested don't do dual emphasis bits r

Post by rainwarrior » Tue Feb 05, 2019 10:50 pm

BTW, I think the only real solution to this is creating 512-entry palettes. Conveniently, though, that solution will work the same way in every emulator that supports them, so it doesn't really have to be an emulation issue, they could all get it "right" just by using a suitable palette.

I think Drag's NES Palette Generator does a good job of illustrating why. No matter how you generate an RGB palette to represent the NES output, there's some compromise of saturation or clamping or other distortion of what should be a more continuous (and vivid) set of colours. Proper modelling of emphasis has to be done before that compromise, not after.

If you hand a 64-entry palette to an NES emulator and expect it to come up with proper emphasis, there's really no way to recover the information already lost from clamping or other compromises.

What zeromus ended up implementing for FCEUX is roughly:
  • Generate a reference YIQ colour and its emphasis counterpart for the given NES palette entry (based on Bisqwit's implementation on the Wiki).
  • Convert the two YIQ reference colours to RGB.
  • Apply the relative adjustment of RGB components between these two reference colours as a multiplier on the given RGB palette colour.
  • Clamp the result.
This is obviously not ideal, and there's probably a bunch of different ways to approach the same problem, but it's a solution that makes about as much sense as it can with the information given. The real problem is only being given 64 colour entries to work with, and being expected to synthesize emphasis for it. If the palette already contained this information there'd be no problem to solve, and no additional compromise to make here.

User avatar
Zepper
Formerly Fx3
Posts: 3190
Joined: Fri Nov 12, 2004 4:59 pm
Location: Brazil
Contact:

Re: Most emulators i've tested don't do dual emphasis bits r

Post by Zepper » Wed Feb 06, 2019 11:18 am

The time flies... Perhaps I was acting like a moron though. :beer:

User avatar
zeroone
Posts: 929
Joined: Mon Dec 29, 2014 1:46 pm
Location: New York, NY
Contact:

Re: Most emulators i've tested don't do dual emphasis bits r

Post by zeroone » Thu Feb 07, 2019 8:16 am

Zepper wrote:The time flies... Perhaps I was acting like a moron though. :beer:
I remember that thread. For Nintaco, I borrowed the emphasis logic from Blargg's NTSC filter. With some adjustments, I got it to work for PAL as well.

Until Firebrand repeats his tests on the full 512 palette, Blargg's math is the best approximation that I could find.

Sour
Posts: 736
Joined: Sun Feb 07, 2016 6:16 pm

Re: Most emulators i've tested don't do dual emphasis bits r

Post by Sour » Thu Feb 07, 2019 5:51 pm

rainwarrior wrote:BTW, I think the only real solution to this is creating 512-entry palettes.
Agreed, and it makes a lot of sense, too. I just added support for 512-color palette files in Mesen, so hopefully that helps a bit.

Post Reply