Hacker News new | past | comments | ask | show | jobs | submit login
Man Rewrites SNES Racing Game to Improve Its Framerate Sevenfold (kotaku.com)
51 points by DrinkWater 11 days ago | hide | past | favorite | 15 comments





That headline is very misleading.

The guy didn't just "rewrite" the game, he ported it to a completely different hardware!

The rewrite takes advantage of a separate CPU (the SA-1), so while the original was rendered entirely in software, his version is hardware accelerated. That hardly counts as a "rewrite" (which would imply that his code changes led to the speed-up), but an actual port to a different platform.

So it wasn't his code changes that are responsible for the performance increase, it's the use of additional dedicated hardware...


The article suggests otherwise.

A total of 34 SNES games used the SA-1 “Super Accelerator” chip, which features much faster clock speeds and RAM

and

Each conversion, Vilela says, takes over a hundred hours of work reverse-engineering existing code, remapping RAM, and adjusting the game to make sure it doesn’t run too quickly on the SA-1. In this case, Vilela estimates they touched some 90% of the game’s code.


So? Yes, ports can be very intricate, but that doesn't change the fact that it's still a port, not a rewrite, which would run on the same target hardware but with a different runtime behaviour.

The first games with an SA1 chip were released two years after Race Drivin' hit the shelves, so my point still stands and is factually correct. The original Race Drivin' cartridge doesn't contain any enhancement chips and the game runs entirely on the SNES' internal hardware.

"Rewriting" usually doesn't mean making it run on different hardware - that'd be porting. So a game using hardware acceleration runs way faster than its software rendered equivalent? What a shocker! :D

That's not to diminish the guy's efforts by any means - I specifically criticised the headline, not the work of the guy.


I think the confusion is that other games on that system used this chip. It was not uncommon for games to ship with extra processors in those days.

So, it wasn't ported to a different system architecture, completely. But it was ported to have a new coprocessor, effectively.

Right? (I'm underlining your point on cartridges having this chip two years later.)


See my reply below - the SA-1 was much more than just a co-processor. It was an entire SoC with its own timers, DMA controller, MMU, RAM and interrupt controller that could actively interrupt the main CPU and transfer control to itself.

A co-processor would be controlled by the CPU, the SA-1 was its own CPU and could use the 65C816 (the main CPU) to "do its bidding" (e.g. for access to the video chip, etc.). The SA-1 was 2.8x faster than the 65C816 and even had faster internal RAM.

Extra processors came in many varieties, but the SA-1 in particular was much more than your typical DSP(1-4) or data-decompression chip.

Edit: I guess what I'm trying to say is that an SNES + a cartridge with an SA-1 is effectively a different console with different capabilities than an SNES without an SA-1 attached. This concept is lost on so many people these days because they can't wrap their head around the idea that games sometimes used to ship with additional hardware built-in, turning the cartridge itself into a mini-console of sorts.


I think your point is certainly correct. The headline makes it sound like this is only a software optimization, and it is definitely not.

Yeah they had to touch 90% of the code. But only to make it work with the different hardware. Sure, hardware that was still found in the SNES, but what you're saying about these chips being added to cartridges effectively turning them into a different console is very interesting.

I wish I knew more about the inner workings of electronic circuits, processors and the like. It's at the top of my TODO list to learn. These 90's era SNES cartridges seem like an interesting era as far as that's concerned. The wiki the article links to in regards to the lineage of special chips many of these games contained is cool. https://en.wikipedia.org/wiki/List_of_Super_NES_enhancement_...

On this topic, another nostalgic memory I'll never forget (I'm 35) is walking into a K-mart as a boy and playing Starfox at a demo station for the first time. It was right up front as you walked in. There was a TV & SNES playing the game. It was surrounded by poster board marketing material with flashy pictures. It clearly emphasizied the brand new 'Super FX' chip that made the cutting edge polygon graphics possible.

As if anyone knew what the heck that meant, but a 'Super FX' chip sounds really cool to the layperson. But they were some of the best 3D graphics my young eyes had ever witnessed back in '93 :)


Apologies, I didn't mean it to be that it is merely a coprocessor. But I think modern gamers are completely unused to buying a game effectively upgrading the system at the same time. I can't think of a modern analog.

If you have an Amiga game, and you hack support into it for an FPU, does that make it a port?

I think you misunderstand. The SA-1 isn't just a co-processor. It's basically an entire SoC in and of itself - running with the same privileges as the SNES's main CPU and having the ability to even interrupt the 65C816.

So your analogy doesn't hold - it's not a co-processor, it's a powerful second CPU with more horsepower than the main chip (~10MHz vs ~3.6MHz) and even features its own internal RAM (which also was faster than the RAM in the SNES), it had its own timers, DMA controllers, memory mapping, etc.

The SA-1 was basically an entire SoC in and of itself that could talk to the main console and use the console's resources. Just to put into perspective what we're talking about here. And yes, I would indeed consider that a port, rather than a "hack" to support some co-processor that adds faster maths.


Reminds me of the Ray Tracing fpga for SNES that was making headlines a couple months ago.

https://www.shironekolabs.com/posts/superrt/


Oh hey it's Victor Viela. He's known in the Super Mario World ROM hacking community on a patch that adds SA-1 functionality to that game too, with some truly insane effects:

https://www.smwcentral.net/?p=viewthread&t=104830


Seeing that game gives me some nostalgia. I remember playing it as a little boy. There was one in the corner of the local department store that got it’s fair share of quarters from me.

For as great as the SNES was, it’s kind of disappointing Nintendo out of such a poor quality port. Cool to see folks still working on these old games.


The title credits Tengen, not Nintendo. Weren’t they infamous for releasing games not approved by Nintendo? I remember their NES era cartridges were black instead of gray and shaped differently.

I wonder if he can improve on F-Zero?

TLDR: Adding an extra co-processor makes the game run faster



Applications are open for YC Summer 2021

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: