nesdev.com
http://forums.nesdev.com/

PPUMASK emphasize bits on NTSC and PAL
http://forums.nesdev.com/viewtopic.php?f=2&t=15558
Page 1 of 3

Author:  DRW [ Sun Feb 19, 2017 6:57 am ]
Post subject:  PPUMASK emphasize bits on NTSC and PAL

The NESDev wiki says that the emphasize bits for red and green are switched around on a PAL console:

Quote:
Bit 5 emphasizes red on the NTSC PPU, and green on the PAL & Dendy PPUs.
Bit 6 emphasizes green on the NTSC PPU, and red on the PAL & Dendy PPUs.

Source: https://wiki.nesdev.com/w/index.php?tit ... rs#PPUMASK

But it looks like none of the most popular emulators (fceux, Nestopia, Nintendulator) implements the PAL switch.

I made a little test program where I can go through all eight emphasize values with the d-pad. And no matter if I set the emulator to PAL or NTSC (of course, I do a hard reset after switching the region if the emulator doesn't already do it itself), the first value is always the red tint. PAL and NTSC behave identically.

So, is this a thing that all the emulators missed to implement? Or is this an error in the wiki? Or am I misunderstanding anything here?

Author:  Quietust [ Sun Feb 19, 2017 7:04 am ]
Post subject:  Re: PPUMASK emphasize bits on NTSC and PAL

DRW wrote:
But it looks like none of the most popular emulators (fceux, Nestopia, Nintendulator) implements the PAL switch.


Nintendulator definitely does, but only in the "unstable" 0.975 build.

I really need to just go ahead and release that version, whether or not it's "complete" enough (the original plan was to incorporate discoveries from Visual 2A03/2C02, but those have been rather infrequent).

Author:  rainwarrior [ Sun Feb 19, 2017 7:36 am ]
Post subject:  Re: PPUMASK emphasize bits on NTSC and PAL

Reasons why you might see it in very few emulators:
  • Wasn't really a well known thing in this community until August 2014 (and didn't appear in the wiki before then): thread
  • Not a lot of games use emphasis, and almost none use emphasis bits for individual colours (e.g. usually all 3 at once for dimming, or cycling through all 3 quickly). The most notable game that does use an individual one (Noah's Ark) only uses blue.
  • Since it doesn't affect timing or CPU emulation, it's a purely cosmetic effect. Getting it wrong has a very isolated effect on the colour and doesn't break anything else.

Author:  DRW [ Sun Feb 19, 2017 8:02 am ]
Post subject:  Re: PPUMASK emphasize bits on NTSC and PAL

Maybe this should be put into the bug tracker at
https://sourceforge.net/p/fceultra/bugs
(It requires you to register, otherwise I would have done it myself.)

I assume it should be a pretty mundane issue to fix for someone who knows the code and knows where to look at it. So, maybe it gets done for the next version if they are informed.

Author:  calima [ Sun Feb 19, 2017 10:00 am ]
Post subject:  Re: PPUMASK emphasize bits on NTSC and PAL

SF doesn't spam you, they're quite decent with the current owners again.

Author:  rainwarrior [ Sun Feb 19, 2017 10:10 am ]
Post subject:  Re: PPUMASK emphasize bits on NTSC and PAL

If you need the functionality now, in FCEUX you can use 512 entry palettes to customize emphasis behaviour. If you're looking for colour accuracy you'd probably want to use a separate palette for NTSC and PAL anyway. It's not like the flipped emphasis is the only difference in colour, everything's a different hue at least.

There are some RGB PPU palettes that come with it that do this, for example, but I don't think any of the included palettes are for PAL. Does anyone know a good PAL palette generator? (Or just a good reference palette?) I only know of NTSC ones like Bisqwit's or Drag's.

Yes, the code that expands 64 entry palettes to the internal 512 version should flip the bits for PAL though, as a very minimal approximation. It doesn't currently do this. (Probably there should be separate settings for PAL / NTSC mode palettes, so it will automatically switch when you change modes.)

Author:  DRW [ Sun Feb 19, 2017 12:02 pm ]
Post subject:  Re: PPUMASK emphasize bits on NTSC and PAL

rainwarrior wrote:
If you need the functionality now

I myself don't need the functionality at all. It's merely about emulator accuracy and since fceux is still developed, pointing the developers to this issue might actually fix it.

Author:  Pokun [ Sun Feb 19, 2017 3:41 pm ]
Post subject:  Re: PPUMASK emphasize bits on NTSC and PAL

The emphasis swap also applies to certain PAL Famiclones so it should probably go with the "Dendy mode" too. Then there is the duty cycle swap in these CPU clones (that FCEUX apparently already emulates in the next version).

For emulator accuracy, I'd also like if there were options for disabling the readability of $2004 and the looped noise feature of the APU to emulate earlier PPU and CPU revisions.

Author:  DRW [ Sun Feb 19, 2017 3:48 pm ]
Post subject:  Re: PPUMASK emphasize bits on NTSC and PAL

Pokun wrote:
to emulate earlier PPU and CPU revisions.

The NES has different PPU and CPU revisions? I alwas thought the NES versions only differ regarding the lockout chip, but otherwise work identically.

Author:  lidnariq [ Sun Feb 19, 2017 4:11 pm ]
Post subject:  Re: PPUMASK emphasize bits on NTSC and PAL

The very earliest of NESes—launch ones, I think, and basically no later—use the 2A03E and 2C02E.

We should probably have a page somewhere on the wiki keeping track of which revisions are in what hardware, and what functional changes happened.

Author:  DRW [ Sun Feb 19, 2017 4:17 pm ]
Post subject:  Re: PPUMASK emphasize bits on NTSC and PAL

lidnariq wrote:
The very earliest of NESes—launch ones, I think, and basically no later—use the 2A03E and 2C02E.

And what would that mean in practice, i.e. for the funcationality of the games?

Author:  lidnariq [ Sun Feb 19, 2017 4:25 pm ]
Post subject:  Re: PPUMASK emphasize bits on NTSC and PAL

I think I remember reading that the the 2C02E lacks readback from $2004?

The 2A03E does have the tonal noise mode.

Author:  Pokun [ Mon Feb 20, 2017 2:29 am ]
Post subject:  Re: PPUMASK emphasize bits on NTSC and PAL

Yeah Codemaster games often rely on reading the $2004, which does not work on, I guess, half of the Famicoms and maybe early NTSC NES systems. I guess this is because Codemaster reverse-engineered the NES so they had no idea that reading $2004 was bad for compatibility.
I remember these jumpy menus in Micro Machines happened in Nesticle too, so I guess it didn't allow reading $2004.

They say $2004 became readable from revision G-0 and later PPUs.
Looped noise feature was added to revision E CPUs or sometime earlier. The unrevised RP2A03 used in VS systems and certain non-VS System arcade boards as a sound chip (like the Donkey Kong 3 and Punch Out arcade boards) does reportedly not have looped noise. I suspect very early Famicoms also doesn't have looped noise.

My Famicom is the very common 1984 HVC-CPU-07 (round buttons, rough bottom) and has a RP2A03E CPU and RP2C02E-0 PPU. As expected, looped noise works but reading $2004 does not.

DRW wrote:
The NES has different PPU and CPU revisions?

I guess most revisions was just changes to the dye that lowered manufacturing costs, but some had new features, and these are the ones we currently know about.

Author:  Quietust [ Mon Feb 20, 2017 6:23 am ]
Post subject:  Re: PPUMASK emphasize bits on NTSC and PAL

Pokun wrote:
The unrevised RP2A03 used in VS systems and certain non-VS System arcade boards as a sound chip (like the Donkey Kong 3 and Punch Out arcade boards) does reportedly not have looped noise.

Such a chip was depackaged and photographed some time ago, and I was able to confirm by visual inspection that the looped noise was definitely not present - the LFSR's feedback was hardwired to use the last 2 bits, and the flip-flop for $400E.7 was entirely absent.

Author:  Eugene.S [ Mon Feb 20, 2017 11:13 pm ]
Post subject:  Re: PPUMASK emphasize bits on NTSC and PAL

Emphasis bit swap already emulated in FCEUX.
But it's user controlled, not automatic:

Image

About audio:
Dendy mode don't have "swap duty cycles" by default
because only certain CPUs/NOACs (UA6527P, T1818) have this bug,
but some other chips (TA-03NP1-6527P CPU, for example) is correct.

Page 1 of 3 All times are UTC - 7 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/