Author Topic: How closely does the FXPAK PRO cartridge's hardware behave to the actual hardwar  (Read 4980 times)

0 Members and 1 Guest are viewing this topic.

Offline EverNostalgic

  • Newbie
  • *
  • Posts: 35
  • Karma: +0/-0
    • View Profile
As I understand it, FXPAK PRO uses some sort of "approximation" (to avoid the word "emulation") of the hardware chips that were inside some of the physical SNES cartridges, such as Yoshi's Island, DOOM and Starwing/Star Fox. I assume that the reason for this is both practical and legal; producing the actual chips and stuffing them inside a single cartridge may be very expensive, and maybe couldn't even physically fit, and probably could never be done legally, even today.

This makes me a bit worried, knowing how horrible software emulators butcher all the games you throw at them. I'm wondering just how different the FXPAK PRO's "answer signals" that it sends back are to those that would be transmitted by the actual chips.

I realize that even two different SNES consoles, or two copies of the same SNES game cartridge, probably don't send the *exact* same electrons around in its circuits, so there is probably always room for some "philosophical" differences even on the "real thing". However, I'm asking whether there is a "major" difference in how the "simulated" chips inside the FXPAK PRO behave which would have actual, noticeable differences on the screen as a result. Or in the physics of the game, for that matter, or whatever the chip was actually used for in the game.

Most people seem utterly unable to tell the difference between even extremely butchered representations of a game and the actual thing run on the original console, but some of us do notice and do care about these "minor" (to me, they are major) differences. Of course, the whole point of investing in an EverDrive/FXPAK PRO cartridge is that emulators just aren't anywhere near good enough yet. (Probably won't be for many decades at this pace, although I know that many violently disagree on that...)

According to my limited understanding of how these "FX" chips work, they basically just are asked a question by the SNES/the main cartridge and then do some sort of complicated/specialized mathematical calculation and then return the answer. If so, it seems logical to me that, as long as this is done at the same speed as the original chip, it should be a 1:1 representation. It seems to me that either it would work perfectly, or not at all. After all, it's an isolated "digital island" that just returns numbers from input; it's not making a bunch of extra signals back and forth between difficult-to-simulate, analogue parts of the SNES?

Of course, it's possible and even probable that I'm missing something about how those chips work. If it really were that simple, I guess the Super EverDrive would just have a simple little "FPGA" or whatever they are called to simulate the chips, and not require a separate FXPAK PRO product in the first place?

Basically, if we put two TVs and identical SNES consoles next to each other where one is running DOOM on a real cartridge and the other is running DOOM on an FXPAK PRO, and the consoles are covered with blankets, could the most picky, hardcore retro game experts in the world be able to tell the difference after playing it for hours and really doing their best to notice any difference? A blind test, in other words. And the test would be repeated over and over, with the consoles randomly swapped, as to make it impossible for them to just guess 50/50.

Offline Richardragon87

  • SNESAdvance Revival Coder
  • Hero Member
  • *****
  • Posts: 666
  • Karma: +11/-0
    • View Profile
Basically, if we put two TVs and identical SNES consoles next to each other where one is running DOOM on a real cartridge and the other is running DOOM on an FXPAK PRO, and the consoles are covered with blankets, could the most picky, hardcore retro game experts in the world be able to tell the difference after playing it for hours and really doing their best to notice any difference?

Well one thing is for certain the one that catches fire the quickest under the blankets would be the FKPAK PRO xD
[quote Random dating spambotJ

Quote
Post changed:

Great, the photo didn't load! Does anyone know how to fix this?
In any case, my other photos can be viewed here, I will be glad to meet you, I love flirt))

P.S Richardragon87! Don't write me again, dude! You're in ignore list!

Offline FeverDrive

  • Hero Member
  • *****
  • Posts: 1315
  • Karma: +55/-0
  • Blast Processing advocate
    • View Profile
However, I'm asking whether there is a "major" difference in how the "simulated" chips inside the FXPAK PRO behave which would have actual, noticeable differences on the screen as a result. Or in the physics of the game, for that matter, or whatever the chip was actually used for in the game.
There is not a major difference at this moment in how the games work on the FXPAK pro versus the original game. At least from the point of view of a human player.

Of course, it's possible and even probable that I'm missing something about how those chips work. If it really were that simple, I guess the Super EverDrive would just have a simple little "FPGA" or whatever they are called to simulate the chips, and not require a separate FXPAK PRO product in the first place?
FPGAs have varying capacities and cost $$$. So the Super Everdrive has a less capable FPGA which can run 95% of the SNES library at a reduced cost. The other 5% of games need the special chips which can be emulated by the more powerful FXPAK FPGA.
WELCO
METOT
HENEX
TLEVEL

Offline nuu

  • Hero Member
  • *****
  • Posts: 2340
  • Karma: +99/-2
    • View Profile
As I understand it, FXPAK PRO uses some sort of "approximation" (to avoid the word "emulation") of the hardware chips that were inside some of the physical SNES cartridges...
The more simpler enhancement chips like the DSP are used as simple math co-processors like you describe but the Super FX and the SA-1 are much more capable CPUs than the main CPU in the SNES. The SA-1 is actually the exact same 65816 CPU as the SNES CPU but able to run much faster (at 10MHz instead of 3.58MHz). It may be ironic that the cartridge is partly more powerful than the actual console, but this is because a faster 65816 CPU quickly became available and much cheaper than when the SNES was designed, so it wasn't so expensive to put them in cartridges at the end of the SNES' life.

The Super FX chip was initially developed by Argonaut Games by using FPGA hardware to prototype on. The logic was then mass produced into ASIC chips which are cheap and hardwired, unlike FPGA chips which are expensive but reconfigurable. So I don't think there is any doubt that FPGA technology is capable of doing a 1:1 reproduction of digital logic hardware like the Super FX chip (unlike a software emulator), since it was designed on an FPGA from the start.

The problem is that the Super FX chip and other SNES enhancement chips are confidental and has no public documentation. It's not a legal problem as the patents for these chips have probably already run out. The problem is that we don't know how they look like on the inside. Years of reverse engineering is what allows the FXPAK to reproduce these chips, and I think all of them are still not fully understood. There are no major differences AFAIK, but I wouldn't be surprised if very small differences are eventually discovered in the games running on the current version of the FXPAK's FPGA configuration files. They will hopefully be continued to be updated when such differences are discovered.
Many of the chips have been "decapped" and photographed so that we can see exactly how they work. But this is not cheap or a trivial task, and the process destroys the chip. Documenting how they work from the photos is also labor, especially the larger more complicated chips.

Reproducing the ASIC chips would be way too expensive for a small run such as the FXPAK. Although each ASIC chip is very cheap to produce, the mass production process costs several millions to start. After that every chip is very cheap but you would have to sell tons of FXPAKs before you could make a profit. Although FPGAs are expensive, they are much more affordable now than when Argonaut Games prototyped the Super FX and as FPGAs are reconfigurable on-the-fly it can reproduce any enhancement chip or other logic that a SNES cartridge might use.

Games that doesn't use enhancement chips are relatively trivial to fully understand and reproduce in FPGA, so they probably don't have any problem in their logic implementation. They often use simple and common logic chips that you can buy anywhere and are not confidential.

A few games may have initialization problems though, as most games probably wasn't designed to be warm boot loaded from a menu, but from a cold boot. Nintendo's own flashcarts Nintendo Power SF Memory would have the same type of problems though as they are also loaded from a menu.
« Last Edit: May 30, 2021, 02:44 PM by nuu »

Offline EverNostalgic

  • Newbie
  • *
  • Posts: 35
  • Karma: +0/-0
    • View Profile
Games that doesn't use enhancement chips are relatively trivial to fully understand and reproduce in FPGA, so they probably don't have any problem in their logic implementation. They often use simple and common logic chips that you can buy anywhere and are not confidential.

A few games may have initialization problems though, as most games probably wasn't designed to be warm boot loaded from a menu, but from a cold boot.

Great reply, which cleared up a whole bunch of stuff. The only parts that confuse me are the ones I have just quoted above:

1. What do you mean by "Games that doesn't use enhancement chips are relatively trivial to fully understand and reproduce in FPGA" and "often use simple and common logic chips that you can buy anywhere and are not confidential"? Aren't games without special chips just a simple, standard ROM and nothing else? Why would they have to be "reproduced in FPGA"? Common logic chips? I thought the vast majority of SNES cartridges were nothing but a ROM and a little connector, to simply feed data to the SNES?

2. "A few games may have initialization problems though, as most games probably wasn't designed to be warm boot loaded from a menu, but from a cold boot." Hmm... Which games are those? And does that mean that they don't run? I thought that the SNES and the cartridge had no clue that an FXPAK PRO (or anything exotic/modern) is involved whatsoever.

Offline Richardragon87

  • SNESAdvance Revival Coder
  • Hero Member
  • *****
  • Posts: 666
  • Karma: +11/-0
    • View Profile
Well one thing is for certain the one that catches fire the quickest under the blankets would be the FKPAK PRO xD

This likely blew up so the inside joke was when Street Fighter 2 had a refurbished red cart and many said it would catch fire if it was inserted into the device, this can also be said with a device that replicates the chips that many feared would cause the console to catch fire too mainly around the time the Super FX and SDD-1 were in their beta stages and many were fearing it wasn't safe to use on their SD2SNES and FX PAKS... moral of the story the original is always the best and the one replicating the game would burn up faster.
[quote Random dating spambotJ

Quote
Post changed:

Great, the photo didn't load! Does anyone know how to fix this?
In any case, my other photos can be viewed here, I will be glad to meet you, I love flirt))

P.S Richardragon87! Don't write me again, dude! You're in ignore list!

Offline nuu

  • Hero Member
  • *****
  • Posts: 2340
  • Karma: +99/-2
    • View Profile
1. What do you mean by "Games that doesn't use enhancement chips are relatively trivial to fully understand and reproduce in FPGA" and "often use simple and common logic chips that you can buy anywhere and are not confidential"? Aren't games without special chips just a simple, standard ROM and nothing else? Why would they have to be "reproduced in FPGA"? Common logic chips? I thought the vast majority of SNES cartridges were nothing but a ROM and a little connector, to simply feed data to the SNES?
The simplest cartridges for other consoles like NES is basically just ROM chips connected directly to the address and data lines so that the ROM appears linearly in the memory map. But the SNES is a bit more complicated as it maps its own hardware (the video chips, audio chips, controller I/O hardware etc) to many different places in the memory map for convenience, it has much more of this hardware than the NES has and a much larger memory map (4MB instead of the 64kB of the NES) for mapping memory and hardware to. This setup requires the cartridge to map its ROM in a certain way to avoid conflicts with the internal hardware. The two most common SNES cartridge types are informally called LoROM and HiROM by the emulator scene (Nintendo officially calls them Mode 20 and Mode 21) and they both have some simple logic circuits to make the ROM only appear in the free areas of the SNES memory map that are not used by the internal hardware.
There are a dozen variations of LoROM and HiROM that each maps the ROM (and often cartridge RAM) slightly differently. Older SNES emulators used to take various shortcuts and even use crude on-the-fly hacks to make each game work, but a flashcart must map each ROM correctly to work (older copier devices also did use crude hacks though as they didn't have powerful FPGAs like modern flashcarts do). Thankfully the author of bsnes/higan among others have done some outstanding work in order to figure out all these variations (by photographing the cartridge PCBs), so modern flashcarts can support about all non-enhancement-chip games without requiring any ROM hacking. And the FXPAK goes further in also supporting most enhancement chips as well.

I said before that Nintendo used common logic chips that you can buy anywhere, but I know that they often used some custom mapper chips as well that you can't buy. I think these are quite simple though, fully understood and reproducible using common logic chips (no need for an FPGA if you just want to make a reproduction cartridge for a single game).


2. "A few games may have initialization problems though, as most games probably wasn't designed to be warm boot loaded from a menu, but from a cold boot." Hmm... Which games are those? And does that mean that they don't run? I thought that the SNES and the cartridge had no clue that an FXPAK PRO (or anything exotic/modern) is involved whatsoever.
It doesn't, but due to how hardware work there are differences between a warm boot and a cold boot, and the games was probably only tested with a cold boot (Games released on the Nintendo Power memory cartridges was probably tested for warm boot though). For example, RAM is in an undefined state (so it can have any random values) when you turn power on, but since the FXPAK menu uses RAM for its menu, RAM will still have the same values as the menu left it with when you load the game. A game should ideally clear the RAM after it starts to all zeroes, but not all programmers always did that. This may lead to different behavior from what the developers predicted. Other hardware are initialized by some logic in the SNES when you turn power on, and if the flashcart menu uses this hardware without re-initializing them again to the startup values, games that relies on the startup values may have glitches.

I don't know what games have initialization errors, as they are fixed when they are discovered by making sure the hardware is left in a state that works with all games before loading the ROM. I'm just saying that initialization errors is something that is to be expected on any cartridge that loads a ROM from a menu. Cartridges that can program the ROM to a FLASHROM and then "becomes" that cartridge (and thus works from a cold boot) will not have these problems. The Omega Definitive Edition flashcart for GBA as well as some of the Neo Geo flashcarts has this feature. On the GB and the GBA this is required for linking to work with certain devices (N64 Transfer Pak, GBA-GC link cable and the GBA-NDS linking feature). None of the Everdrives can do this properly, not even the ones that uses FLASHROM as they load the menu before the ROM anyway.

Here are some examples for the SNES that are already fixed in the FXPAK:

Sim City was reported to boot with a glitched title screen (which was easily fixed by resetting) on the Super Everdrive, but this doesn't seem to happen on the SD2SNES/FXPAK, so this is an initialization error on the SED but not the FXPAK. It doesn't seem to be a game-breaking error.

Look at update v0.1.7e (https://sd2snes.de/blog/archives/833) for the SD2SNES/FXPAK. It changes the initial SRAM fill value to fix some initialization errors with a couple of games that fails to correctly initialize SRAM (cartridge RAM).

Offline EverNostalgic

  • Newbie
  • *
  • Posts: 35
  • Karma: +0/-0
    • View Profile
RAM is in an undefined state (so it can have any random values) when you turn power on, but since the FXPAK menu uses RAM for its menu, RAM will still have the same values as the menu left it with when you load the game. A game should ideally clear the RAM after it starts to all zeroes, but not all programmers always did that. This may lead to different behavior from what the developers predicted.

But can't the FKPAK PRO simply read the RAM immediately when starting, store it, and then, just before it "terminates" to start the game, puts the RAM back to how it was when it first started? Or even just "clear" it completely, so there is no trace of any menu software left for the game to be confused about?

Offline nuu

  • Hero Member
  • *****
  • Posts: 2340
  • Karma: +99/-2
    • View Profile
Probably, it was just one example of difference between a warm and a cold boot that may change the behavior of specific games. Most of these initialization errors are fixable if you know about them, it's just that they may be hard to predict and are probably quite rare. And fixing one game might break another.

If you simply clear RAM, you will break certain games such as Final Fantasy 1 that relies on the undefined state of RAM. It uses an undefined part of the RAM as a random seed to its RNG. If you clear RAM so it's all 0, it gets seeded with the same value every time you start the game so you will encounter the same types of enemies every time and things like that. The Everdrive N8 have this problem, but I'm not sure if the Pro has changed this. Many emulators that simply clears RAM or fills it with a constant value has the exact same problem. Lately some emulators such as bsnes, Mesen and others offers to randomize RAM to make a possibly more authentic experience and expose initialization bugs for homebrew developers.

Relying on undefined state of RAM isn't very good design though, as it's not always that random and highly dependent on things like temperature and what brand of RAM chip were used etc. So the random seed may be quite consistent when played on one NES in some cases, and very random when played on another NES. But some games did this anyway.