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

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

Author:  Sour [ Tue Feb 21, 2017 6:58 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
Mesen probably doesn't count as popular, but it automatically swaps the emphasis bits when in PAL/Dendy mode.
There's a manual option to swap the duty cycle for the square channels, too.

Author:  Pokun [ Wed Feb 22, 2017 2:00 am ]
Post subject:  Re: PPUMASK emphasize bits on NTSC and PAL

Quietust wrote:
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.

Yes this is the best kind of confirmation we could ask for. Thanks a lot!


Eugene.S wrote:
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.

Yeah I think "Dendy mode" is a bit weird naming as there are several kinds of Dendy which these bugs may or may not apply to. And also other clones that also may or may not have them.
The general popular term for clones are "Famiclone", not "Dendy". But on the other hand, a "Famiclone mode" would be even vaguer.

Author:  DRW [ Wed Feb 22, 2017 1:38 pm ]
Post subject:  Re: PPUMASK emphasize bits on NTSC and PAL

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

O.k., but I doubt many people know this, so the default configuration should be dependent on whether NTSC or PAL/Dendy was used.


About the PPU and APU revisions (or any revisions for that matter):

Is there any known situation where a licensed game behaves differently on different NES revisions? Or do the differences only refer to stuff that the official developers were discouraged to use anyway, so it only affects some obscure games that rely on "undocumented" commands?

For example, I don't know what the looped noise feature is, but is this something where the same game might output different audio on different NESes?

Author:  lidnariq [ Wed Feb 22, 2017 1:52 pm ]
Post subject:  Re: PPUMASK emphasize bits on NTSC and PAL

DRW wrote:
I don't know what the looped noise feature is, but is this something where the same game might output different audio on different NESes?
Not NESes, no, because all US (and European) ones support that.

But yes, there are a few games released in Japan that will sound different on older Famicoms vs newer ones. (e.g. Balloon Fight and Mega Man 1)

Author:  DRW [ Wed Feb 22, 2017 2:00 pm ]
Post subject:  Re: PPUMASK emphasize bits on NTSC and PAL

O.k., Famicom is secondary to me. I only really care for the American front loader NES.

So, there are no noticable differences between all of the front loader NTSC NESes, independent from their manufacturing date?


But out of curiosity: Do you have an example of the noise effect on the Famicom that sounds different in the revisions? Or of any other difference?

Author:  rainwarrior [ Wed Feb 22, 2017 2:12 pm ]
Post subject:  Re: PPUMASK emphasize bits on NTSC and PAL

The earlier Famicom revision just replaces the periodic noise with regular noise.

If you want a demonstration, open a suitable NSF with NSFPlay and use the APU2 settings to disable periodic noise.

Examples:
  • Solstice track 2 (main game music)
  • Mega Man 2 track 9 (quick man)

Or just open Famitracker and play with the noise channel. An effect of V01 turns on periodic noise, and V00 sets it to regular noise.

Author:  lidnariq [ Wed Feb 22, 2017 2:16 pm ]
Post subject:  Re: PPUMASK emphasize bits on NTSC and PAL

DRW wrote:
So, there are no noticeable differences between all of the front loader NTSC NESes, independent from their manufacturing date?
No, the 2C02G added the ability to read $2004. Most famously this affects Micro Machines.

Author:  Pokun [ Wed Feb 22, 2017 3:29 pm ]
Post subject:  Re: PPUMASK emphasize bits on NTSC and PAL

DRW wrote:
O.k., Famicom is secondary to me. I only really care for the American front loader NES.

I wouldn't worry about looped noise too much. Only very early Famicoms doesn't support it, and the only thing they will miss out on is a bit less cool sound.
I'd avoid reading $2004 though (I won't be able to play your game if you rely on it! :)). $2004 is a pretty useless register anyway.

Quote:
But out of curiosity: Do you have an example of the noise effect on the Famicom that sounds different in the revisions? Or of any other difference?

I made an NSF in ppMCK (download in attachment) that plays all 16 possible notes of the noise channel with the looped noise flag clear (normal white noise), then it plays all 16 again with the flag set (looped noise). You can clearly hear the difference. Looped noise is more tonal and has metallic characteristics while white noise is more buzzing and is often used for explosions and similar sound effects.


This is the Family Basic version.
Just copy and paste (F12) in Nestopia with Family BASIC V3 (or any Famibe) and then enter RUN:
Code:
10 CLS
20 LOCATE 5,10
30 PRINT"NOISE CHANNEL TEST"
40 POKE &H4015,&H0F
41 REM ENABLE NOISE CHANNEL
50 POKE &H400C,&H0F
51 REM SET NOISE VOLUME TO 15 (MAX)
55 POKE &H400F,0
56 REM SET NOISE LENGTH
60 N=0
77 REM NORMAL NOISE TEST ALL 16 NOTES:
70 FOR N=0 TO 15
80 POKE &H400E,N
85 PRINT HEX$(N)
90 PAUSE 30
95 POKE &H400E,0
98 POKE &H400F,0
99 REM REINITIALIZE NOISE SETTINGS
100 NEXT
107 REM LOOPED NOISE TEST ALL 16 NOTES:
110 FOR N=&H80 TO &H8F
120 POKE &H400E,N
130 PRINT HEX$(N)
140 PAUSE 30
150 POKE &H400E,0
160 POKE &H400F,0
170 NEXT
 



Looped noise is the very cool metalic/electric drums you hear in Megaman 1 Fireman song and Megaman 2 Quickman music.
I believe the looped noise in Balloon Fight (at the end of the Game Over tune) is unintentional though. It might even been made before the looped noise feature was introduced in the APU. Plus it was simultaneously developed for the VS System which doesn't have it, as confirmed by Quietust.

Attachments:
File comment: Noise Test
loopn.nsf [8 KiB]
Downloaded 22 times

Author:  Sour [ Wed Feb 22, 2017 6:47 pm ]
Post subject:  Re: PPUMASK emphasize bits on NTSC and PAL

Pokun wrote:
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.
I just added both of these options to Mesen - thanks for the NSF file, made it easy to test the noise channel option!
For $2004 reads, I have it returning the same as reads to any other write-only reg, based on what blargg said in an old thread about this:
blargg wrote:
$2004 reads back no differently than say $2000; it's a write-only register.
So the value read is based on the decay of the values in the PPU's 8-bit latch (if someone knows this to be incorrect, please let me know)

Are there any other known differences between the different revisions (NES, PAL NES, Famicom, Dendy) that I'm missing in this list?
-$2004 reads
-Emphasis bits
-Noise loop
-Square duty swap
-Reset not resetting the PPU on Famicom (this one I have not have implemented yet)

Author:  tepples [ Wed Feb 22, 2017 6:55 pm ]
Post subject:  Re: PPUMASK emphasize bits on NTSC and PAL

These quirks distinguish NES-001 from NES-101:

  1. $4016 D2 is zero on NES-001 but open bus on NES-101.
  2. NES-101 reset button doesn't reset the PPU.

My controller test uses $4016 D2 to tell the difference between rectangle and dogbone controllers.

And the obvious:

  • Dot to CPU cycle ratio: 3.2:1 for PAL NES; 3:1 for other
  • OAM writing: Lines 241-260 for PAL NES; during vertical or forced blanking on other
  • NMI scanline: 291 for PAL famiclones; 241 for other
  • Field length: 262 lines for NTSC and RGB; 312 for PAL
  • Black border: 2 pixels on each side and 1 on top for PAL; none for NTSC and RGB

Author:  lidnariq [ Wed Feb 22, 2017 7:08 pm ]
Post subject:  Re: PPUMASK emphasize bits on NTSC and PAL

The palette is readable on later revisions of the 2C02 and not on earlier ones. I don't know when this changed, however.

The 2C03/4/5, and thus presumably also early versions of the 2C02, don't have the OAMADDR bug.

The 2C07 both supports reading OAMDATA and lacks the OAMADDR bug.

I don't know of anything where we know it has an effect, but the 2A03letterless emits a 3/4 duty cycle value for M2 instead of 5/8 (as in the 2A03E,G,H).


I'm probably forgetting some more...

Author:  Pokun [ Thu Feb 23, 2017 12:19 am ]
Post subject:  Re: PPUMASK emphasize bits on NTSC and PAL

According to the wiki RP2A03G has a test mode for the APU.
If pin 30 is pulled high on revision G, extra diagnostic registers are enabled on $4018~$401A, and the I/O ports $4016 and $4017 becomes open bus (so controllers won't work). On older revisions of the CPU, pulling pin 30 high instead causes the CPU to stop execution. It is normally connected to GND to be always low though.

Author:  lidnariq [ Thu Feb 23, 2017 1:03 am ]
Post subject:  Re: PPUMASK emphasize bits on NTSC and PAL

Pokun wrote:
On older revisions of the CPU, pulling pin 30 high instead causes the CPU to stop execution.
In the 2A03letterless – see here – pin 30 is directly connected to the silicon substrate (see right center) while pin 20 (bottom center) is connected to the intentional ground.

I'm really not clear why pin 30 was bonded at all... but given how MOSFETs work, changing the body voltage (which is what I think pin 30 controls) would definitely cause everything to not work!

Author:  Pokun [ Thu Feb 23, 2017 2:28 am ]
Post subject:  Re: PPUMASK emphasize bits on NTSC and PAL

So the wiki is incorrect?

Author:  Quietust [ Thu Feb 23, 2017 5:50 am ]
Post subject:  Re: PPUMASK emphasize bits on NTSC and PAL

lidnariq wrote:
Pokun wrote:
On older revisions of the CPU, pulling pin 30 high instead causes the CPU to stop execution.
In the 2A03letterless – see here – pin 30 is directly connected to the silicon substrate (see right center) while pin 20 (bottom center) is connected to the intentional ground.

I'm really not clear why pin 30 was bonded at all... but given how MOSFETs work, changing the body voltage (which is what I think pin 30 controls) would definitely cause everything to not work!


Pin 30 isn't connected "to the substrate" - it's connected to a "pin pad" (just like all of the other pins), which happens to consist of a square of conductive silicon with another square of metal layered on top of it, but that pin pad happens to be totally isolated from the rest of the circuit.

It's highly likely that pin 30 was simply unused in the letterless RP2A03 and was specifically implemented as a "clock halt" in one of the middle revisions prior to G; if anybody can get one of those chips depackaged, we'll be able to find out what's really going on.

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