The switched duty bug on clones - an evidence

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
The switched duty bug on clones - an evidence
by on (#85979)
I heard about it many times here, but never observed the problem in real life, although I saw really many Famiclones in the past, like hundreds. Now here is an evidence created by Eugene.S and HardWareMan. I think it is a good thing to have certain information about this posted on the forum, so if someone else became interested in this in the future, he'll be able to find it.

The bug is observed on UA6527P, HA6527P and some other early 2A03 clones, except for TA-03NP1-6527P. I often heard that the bug is common for newer clones, but in fact these chips are found in really old ones, newer were all-SoC (a glop or integrated CPU+PPU T1818P and UM6561) and didn't have the bug.

Here is a recording (53MB, FLAC) of songs from Bucky O'Hare and first level of Batman. It was done from a clone with one of the buggy chips, with good audio output, and SB X-Fi soundcard on PC, without any additional processing.

Here is a test program and recordings (8MB) that were made with 6 different chips.

by on (#85980)
I've seen enough videos on Youtube to know about this bug. Look for "Onestation", and you'll find wrong duty cycles.

by on (#85991)
And here is correct recording from TA-03NP1 6527P chip.
alternate link (mediafire)

by on (#86220)
Hey, it's pretty interesting to have an evidence, I already heard about the duty cycle swapping bug, but hearing tracks with swapped duty cycles is definitely more interesting.

Apparently, duty cycle 0 (87.5%) is emulated right, while 1 sounds like 2 (50%) and 2 sounds like 1 (75%), and 3 sounds like 1 anyways so you don't care if it's 25% or 75% (WHY Nindendo ?? They could have added one more duty cycle instead and it would increase the musical possibilities of the console !! Oh well...)

So yeah it's fun to hear the music with duty cycles swapped.
Is there an emulator that can optionally enable duty cycle swapping ?

by on (#86221)
Only Rocknes, but it's NTSC-only. No PAL or Dendy("Hybrid") modes.
I very like to play NTSC roms and listen nsf-music at 50FPS in Dendy-mode.
Good old memories :)

by on (#86223)
Well, in many games this swap is surprisingly unnoticeable. Many modern NES games switch duty cycles quickly during notes anyways, so this make the swap less noticeable than in old games where the just use plain notes of the same duty cycle for a whole song.

Where the swap the most noticeable is in Mega Man games and Mario games. In Mega Man games I find it actually makes sound effects better.

by on (#86230)
I don't know alot about the NES APU so I thought I'd ask, what is the equal of this to register writes. Or to put it another way, what would you do to APU writes to simulate this swapped duty cycle?

Do you just swap bits 7 and 6 on $4000 and $4004?

by on (#86231)
xx......:
00 = 12.5% on both
01 = 25% (or 50% on crappy clones)
10 = 50% (or 25% on crappy clones)
11 = 75% on both

So interchanging bits 6 and 7 seems to be correct.

by on (#86232)
Electrical engineering question then. Is it possible for a device on the bus to detect writes to the registers and swap the bits, fixing the duty cycles on clones that have them messed up?

by on (#86234)
I discussed this with HardWareMan few days ago, the conclusion is - no, it is not possible, because these registers are internal to the CPU, and you can't intercept writes into them.

by on (#86235)
That's too bad. For fun though I added an option to my own emulator to swap duty cycles on the fly. As I remember with the HandiFamiEight clone I had, SMB1 has odd sound effects with swapped duty cycles. I really don't understand how anyone could have missed that mistake. Maybe they knew it but didn't bother to fix it. It's a shame since I've heard the clones are basically exact clones otherwise.

by on (#86238)
Technically a game genie style device COULD detect writes to $4000 and $4004 and invert D6 and D7 on those writes.

But I find it kind of fun how they messed up, like if this was here to say it loud "I'm a pirated game".
It's not like this changed gameplay, or even music, significantly. The more noticeable part is sound effects in SMB and Mega Man as I've said.

by on (#86241)
How would a Game Genie change writes to the APU? The data goes from A inside the CPU to the APU ports inside the CPU. It'd have to intercept the instrument data and change that before it gets into the CPU.

Bregalad wrote:
But I find it kind of fun how they messed up, like if this was here to say it loud "I'm a pirated game".

It'd be possible to "say it loud" more literally. Make a 1-bit PCM sample (not the same as 1-bit DPCM). Play it back with zeroes alternating rapidly between 50% (1/3) and 12.5% (2/3) and ones at 25%. If you can hear it, you're on a problematic clone. I'd make a demo myself, but the clones that have this problem also tend not to work with a PowerPak.

by on (#86252)
Right, I don't know why I was thinking about the bus. Since you'd be able in theory to see the address being targeted via the bus doesn't help when the data being written is an internal cpu register which you cannot manipulate since it won't appear on the bus.

by on (#86935)
Does this one have that issue?
Gold Leopard King famiclone: http://www.goear.com/listen/5e9d115/int ... lk-unknown
Original PAL NES: http://www.goear.com/listen/b7dfd64/int ... es-unknown

Image
(on top, the original NES. On the bottom this famiclone)

Actually I prefer the "happier" sound from the Famiclone

by on (#86965)
socram8888 wrote:
Does this one have that issue?
Gold Leopard King famiclone: http://www.goear.com/listen/5e9d115/int ... lk-unknown
Original PAL NES: http://www.goear.com/listen/b7dfd64/int ... es-unknown

(on top, the original NES. On the bottom this famiclone)

Actually I prefer the "happier" sound from the Famiclone

The second chart shows a insufficiency of separating capacitance in the sound channel. It is necessary to make records directly from the output of the chip.

by on (#87069)
I have seen at least 100 famiclones myself and I can also say that not a whole lot of them have wrong sound. There were not too many different "chipsets". UMC based clones were the ones with wrong sound. I got one TA-03 based clone and it is really nice except DPCM has wrong pitches (very evident in Super C orchestra hit sounds).
My fav clone is Ending-Man S-500, aka Terminator, aka Toyo, aka BS-500AS etc. etc. etc.

Here's few recordings from it (2x ~10MB FLAC)
http://www.fileden.com/files/2008/4/21/ ... tage2.flac
http://www.fileden.com/files/2008/4/21/ ... tage3.flac

It has no duty cycle bug, but its DPCM + noise + triangle are much louder than normal NES (which is a quality I like personally), DPCM pitches are right, but there is significant video noise in the sound due to it being a globtop type

by on (#87365)
What chip goes with this clone?

T2-Stage3.flac:
Image
20kHz, awesome.

by on (#87589)
Here is 2 pictures of the PCB of the clone, it is in a wrong shell now, but it came from an Ending Man S-500 aka Terminator aka BS-500AS etc.

http://www.fileden.com/files/2008/4/21/ ... Clone0.jpg
http://www.fileden.com/files/2008/4/21/ ... Clone1.jpg

This is much older clone board that uses same chipset and is from an Ending Man S-500 also (but sadly no longer works) :
http://www.fileden.com/files/2008/4/21/ ... iginal.jpg
This board should be from 1992 or 1993

JP1 changes PAL/NTSC colorburst
JP2 changes 50/60Hz
JP3 changes clock divider for 26 or 21MHz crystal.

I wish original NES had such features haha

by on (#92627)
socram8888 wrote:
Does this one have that issue?
Gold Leopard King famiclone: http://www.goear.com/listen/5e9d115/int ... lk-unknown
Original PAL NES: http://www.goear.com/listen/b7dfd64/int ... es-unknown
(on top, the original NES. On the bottom this famiclone)

Actually I prefer the "happier" sound from the Famiclone


What game does this song came from? I fell in love in that.. :oops:

by on (#92635)
It's from D-Pad Hero 1 or 2, I don't remember which one was.

by on (#92641)
It's dpad-hero 2's title screen.
Thanks man!
http://www.dpadhero.com/Download.html
Re: The switched duty bug on clones - an evidence
by on (#98070)
UA6527P [manufactured: april 1993]:

Image

Does it have swapped duty cycles? http://youtu.be/6AVqrOqQLfM
Re: The switched duty bug on clones - an evidence
by on (#98071)
Yes.
Re: The switched duty bug on clones - an evidence
by on (#98231)
I made some records from TA-03NP1-chip (it has no duty cycles bug) on Famicom AV PCB:
Famicom 1989 PCB
Famicom AV 1993 PCB

Power Blade - Sector 3
Bucky O'Hare - Escape!
It sounds clean and nice. I've recorded it via M-Audio Revolution 5.1

Here is a recording (53MB, FLAC) of songs from Bucky O'Hare and first level of Batman.
It was done from a clone with UA6527P duty-buggy chip, with good audio output, and SB X-Fi soundcard on PC, without any additional processing.
Here is a test program and recordings (8MB) that were made with 6 different chips.

All deadlinks fixed.
Re: The switched duty bug on clones - an evidence
by on (#98370)
I got a TA-03NP1 based clone too, and it works very nicely !
Only problem is that PAL games have wrong DPCM pitches, like with NTSC CPU. Probotector II notably, it sounds very wrong on NTSC CPU and that clone CPU.
But at leas it uses divider of 15 instead of 16 like PAL CPU does so a lot of games don't slow down :)

The TA-03NP1 has 6527P written on it, and the mathcing PPU TA-02NP has 6538 on it. UM6527P and UM6538... ?
Re: The switched duty bug on clones - an evidence
by on (#98379)
Quote:
Only problem is that PAL games have wrong DPCM pitches, like with NTSC CPU.

These pirate chips are designed for NTSC games (Japan, USA) and not for european PAL.
Quote:
The TA-03NP1 has 6527P written on it, and the mathcing PPU TA-02NP has 6538 on it. UM6527P and UM6538... ?

viewtopic.php?p=45889#p45889
Re: The switched duty bug on clones - an evidence
by on (#98388)
Did you notice that TA-01 was in Atari 2600 clone, TA-02/TA-03 was in Famicom clone and TA-04/TA-05/TA-06/TA-07 was in Sega Megadrive clone? Same manufacturer?
Re: The switched duty bug on clones - an evidence
by on (#98395)
Thät's a nice notice !
Re: The switched duty bug on clones - an evidence
by on (#98533)
Somebody knows, what chips-clones have appeared earlier: normal or with switched duty cycle?
Re: The switched duty bug on clones - an evidence
by on (#98581)
I don't know but most modern clones I've seen and the ones I've had all had switched duty cycles. I would guess earlier clones didn't. I've heard the Tristar clone had good sound.
Re: The switched duty bug on clones - an evidence
by on (#98582)
I can confirm from a unit I received recently that the Generation NEX Messiah has the swapped cycle bits, as does the Super Joy 3.
Re: The switched duty bug on clones - an evidence
by on (#98607)
puNES 0.69 will be support "swap duty cycles" bug (25% <-> 50%)
Re: The switched duty bug on clones - an evidence
by on (#99225)
Only clone CPUs made by UMC have the duty cycle bug. But it happens to be the UMC was the most common ones.

There are clones which have issues with the DPCM, too. Some have no duty cycle bug and bad DPCM. Others have perfect DPCM but do have the duty cycle inverted.

Oh well...
Re: The switched duty bug on clones - an evidence
by on (#100896)
Yesterday I've spent some time to test a batch of TA-03NP (datecode 9228). All of them works fine. No duty swap neither DPCM bug. I'm very happy.
Re: The switched duty bug on clones - an evidence
by on (#100898)
small correction: TA-03NP1, not TA-03NP.
Re: The switched duty bug on clones - an evidence
by on (#100907)
I have a TA-03NP chip and it's HORRIBLE. It has the worst DPCM on all clone chips I have. Also, it runs VERY HOT.
But it's the only clone chip I have that has correct duty cycle. :roll:

Not that I dislike the sound on swapped duty cycle chips, the DPCM problem annoys me a lot more. SMB3 sound is horrible on that TA-03NP chip.
Glad to hear that the PAL chip is better. Perhaps it's a newer version of the TA-03 chip?

By the way, I am almost sure that the TA-xxx chips are from some South Korea company.
Re: The switched duty bug on clones - an evidence
by on (#100910)
Yesterday record (on Famiclone PCB), just listen:
http://www.fileden.com/files/2012/4/10/ ... 03NP1.flac
Re: The switched duty bug on clones - an evidence
by on (#100931)
l_oliveira wrote:
By the way, I am almost sure that the TA-xxx chips are from some South Korea company.

Information for consideration: TA-01 was seen in clone Atari 2600, TA-02 & TA-03 in clone NES, a set of TA-04/TA-05/TA-06/TA-07 in clone Sega MegaDrive. :3
Re: The switched duty bug on clones - an evidence
by on (#100958)
My TA-03NP1 also has 9228 date code, and apart from PAL games having wrong DPCM pitches, everything NTSC plays great on it !
Re: The switched duty bug on clones - an evidence
by on (#101079)
Quote:
PAL games having wrong DPCM pitches, everything NTSC plays great on it !

This is correct behavior.
Re: The switched duty bug on clones - an evidence
by on (#101198)
Yes I am aware of that. At first I thought the CPU was faulty bun later I got a real NTSC CPU and it caused same behaviour so I knew I got gold there :P