Trying to support the clone systems (Attn. qbradq)

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
Trying to support the clone systems (Attn. qbradq)
by on (#76602)
In this post, qbradq wrote:
Incidentally [lockout] is another major reason I am trying to support the clone systems with my products. There is no need for the CIClone or other method of bypassing the DMA lockout on the toaster model.

For those choosing to go down this path, what's the easiest way to test one's program on a famiclone? I ordinarily rely on the PowerPak, which is known not to work. Must one solder together a ReproPak and invest in an EPROM programmer?

And is there a way to detect swapped pulse duty cycles on power-up, in much the same way I'm currently detecting and adjusting to the TV system (NTSC, PAL, or Dendy)? Some clones have reasonably correct audio; others don't. If not, a game designed to work on the clones would have to include a battery save circuit to remember whether or not the user specified in the "Options" menu that his machine has swapped duty cycles.

by on (#76604)
Run Blargg's tests on a NEX and see which ones fail in order to identify the console? Like a fingerprint, those exact tests need to fail, and other tests need to succeed, so an emulator isn't mis-identified as a NOAC.
Not just pass/fail, but also how it failed (how many cycles it was off by, etc).

by on (#76605)
Or just give an option to "fix" the issue in a config menu so you don't have to care about that? Like the games that had a switch on the back to disable the many lock chip?

by on (#76606)
Dwedit wrote:
tepples wrote:
the PowerPak, which is known not to work

Run Blargg's tests on a NEX and see which ones fail in order to identify the console?

For one thing, if the PowerPak doesn't boot on an NEX, I can't run blargg's tests on my PowerPak. Even with an EPROM programmer and a ReproPak, I might still not be able to do so on a front-loading famiclone such as the NEX because the socketed flash chips would protrude.

For another, a later model famiclone might fix the audio defect but leave other behavior defects unfixed. This "fingerprint" scheme you mention might misdetect one famiclone as another famiclone, and besides, it'd still take a long time to run unless I hide it behind a long, unskippable copyright screen the way HackMii Installer for Wii does.

Banshaku wrote:
tepples wrote:
remember whether or not the user specified in the "Options" menu that his machine has swapped duty cycles

just give an option to "fix" the issue in a config menu

That's what I said. But how would the game remember the values in the config menu across a power cycle?

by on (#76610)
tepples wrote:
That's what I said. But how would the game remember the values in the config menu across a power cycle?


Sorry about that. I'm just too tired and stress these days with the current event in Japan that I didn't read properly the end of the message. Just felt like posting back on nesdev ;) That help remove some stress.

As for power cycle, this is a good question. But I guess you don't have to worry that much. It's not like we make games for an active console like the psp, 3ds etc. People would be able to understand that if they reset the game, they need to set back the option. I think it still the better compromise at the lowest cost. Works normal on the real nes and clones can be supported by doing one simple step before using it. Don't you think?

by on (#76612)
While it would be nice for the user not to have to select an option to fix it, I don't think there is a reasonable alternative. The best you could do is note in the options menu some button to hold down when powering on to also enable the audio fix for clones unless you actually have a battery backup or something else.

Is the fix just as simple as having your audio engine swap the duty cycle parameter writes in some way?

by on (#76613)
tepples wrote:
But how would the game remember the values in the config menu across a power cycle?

I guess you don't. At least not before a password is entered, if you decide to dedicate one bit for this.

It might be a little annoying to select an option to fix the audio every time, but you can't expect to get the perfect experience out of a clone. Something's gotta give. You could maybe offer a quick way to enable the sound fix, like holding a certain button (or button combination) on power on, and document that in the manual, to make the process less annoying.

Personally I have currently no plans to implement this kind of feature. People who own these clones are used to having wrong audio in every single game they play, including great classics, so I don't think my game being different is a big deal.

EDIT: Ninja'd by MottZilla!

by on (#76614)
I've thought about a duty cycle selection, but the problem is that this isn't like listening to NSFs - the user has never heard the music before. They can't know if it sounds right or not, and putting the option there makes it possible for people using a real system (or a clone with good sound) to make it play wrong.

If they know the clone has wrong sound, they're either dealing with it already or probably have a real system that they could use, as well. Detection would be better, but likely isn't possible in reliable way (hope I'm wrong).

by on (#76615)
Glad to see I've sparked some interest Tepples :D

I have noticed that the music and sound effects on my Yobo famiclone sound fine in most games, have minor hiccups in others (TMNT), and are outright awful in some (Crystalis, what a crying shame!)

I think it has to do with how the sound engines of these games handle duty cycle changes. Crystalis changes the duty cycles of the square waves at fixed frequencies to create specific musical effects (and TMNT does this for certain sound effects). When this occurs the difference in duty cycle produces different periods within the sound wave causing dissonance with the other channels that have correct periods.

So one way to ensure that your music sounds the same on all platforms would be to use constant duty cycles. I am not thrilled with this limitation myself, but it is something to think about.

Also, regarding PowerPak compatibility, config settings and all that jazz, I'd like to briefly mention that this community is in dire need of an affordable, capable development cartridge with a clean and cheep path to production carts. I know there is work going on with several folks to supply this (Münchhausen, Squweedo(sp?), my own MMC3 cart that's still too early to mention :D) and until we get this sorted out and made approachable it will be difficult to grow the platform.

Like assembly programming for a 35-year-old chip isn't intimidating enough :D

by on (#76616)
So clone users would have to go into the menu every time, and this would be documented in the manual, just as the code to hide the ghost piece is mentioned in LJ65's manual.

This leaves testing. The trouble with waiting for the Munchausen cart is that since blargg left, I'm not sure those will ever get made.

I also worry about how other "abuses" of the NES hardware, such as the DPCM split that tokumaru and I discussed before, would fail on a clone. Unlike the NES, the clones are still manufactured and thus could be thought of as an "active console" in the sense that Banshaku mentioned.

qbradq: Does SMB1 sound correct on your famiclone? The "Power Player Super Joy III" had wrong duty cycles on it: it sounded like 25% and 50% were switched. But I've tried other clones where SMB1 sounded correct (FC Twin?).

by on (#76645)
What happens when other clones have worse/different problems? Will you add those options on top of the sound problem?


I know I won't be doing anything for these clones. If anything, I will make my game not work in them if I can find a way.

by on (#76650)
There are subtle differences between different Android-powered devices, yet app developers are supposed to support all of them. There are subtle differences between different web browsers, yet web developers are supposed to support all of them. Likewise, there are subtle differences between different famiclones. And as I understand qbradq's approach, it's not unlike best practice in JavaScript: test for the features you use.

If a defect in a clone prevents a game from running at all or causes severe graphical glitches, then it's probably detectable with code not unlike the game's kernel. If the workaround is easy, such as the slower field rate on PAL units or the music pitch on Dendy style PAL clones, I can add a workaround into the game's next revision. But if not, such as a famiclone that behaves like Nesticle, I can detect and freeze, just like a lot of web sites have recently started to detect features not supported by Internet Explorer 6 and redirect to the Google Chrome Frame download page.

by on (#76655)
So who actually has a NOAC famiclone and flash cartridge?

by on (#76658)
tepples wrote:
\qbradq: Does SMB1 sound correct on your famiclone? The "Power Player Super Joy III" had wrong duty cycles on it: it sounded like 25% and 50% were switched. But I've tried other clones where SMB1 sounded correct (FC Twin?).


I played through to 2-2 (so we could hear all the music except the "you beat the game" theme) while my Wife and I took separate notes. We agree that the snare hits do not sound 100% correct. I assume this is because the noise pattern generated is not the same as the original 2A03. Also, when sound effects start the volume is sometimes increased to max for a short period. This seems to be random and is observable on all games I have played on this hardware.

by on (#76659)
Dwedit wrote:
So who actually has a NOAC famiclone and flash cartridge?


My MMC1 flash cart is ready to go, but my crap-in-a-FR4-wafer called a Willem PCB5 is not agreeing with my flash ROM.