News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: SNES Slowdown: FastROM?  (Read 211 times)

redmagejoe

  • Jr. Member
  • **
  • Posts: 21
    • View Profile
SNES Slowdown: FastROM?
« on: March 18, 2019, 10:36:35 am »
Now that I've finished with hack work for the time being, I'm back to steadily improving my ROM collection through polish patches and the like. That brings me to the whole "fastrom" discussion, and my curiosity about pros and cons.

http://bszelda.zeldalegends.net/stuff/Con/alttp_fastrom.zip

I found this while looking around online, and I'm wondering if anyone might give me insight on how fastrom patches might address infamous slowdown issues in certain games before I just blindly apply it to my ROM and hope for the best. Specifically, if the benefits outweigh the problems. Link to the Past, for instance, has a very few, not flow-breaking moments where slowdown occurs, but I can certainly think of other games that could benefit from being able to handle more sprites/activity/calculations on-screen before it.

I am compiling a list of SNES games infamous for slowdown, for anyone who might give thought down the road to working on a FastROM or optimization patch.
  • Gradius III
  • Seiken Densetsu 3
  • Super Castlevania 4
  • Super R-Type
  • The Legend of Zelda: A Link to the Past - Solution
« Last Edit: March 18, 2019, 11:23:07 pm by redmagejoe »

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 6743
  • *sigh* A changed avatar. Big deal.
    • View Profile
Re: NES & SNES Slowdown: FastROM?
« Reply #1 on: March 18, 2019, 10:46:52 am »
NES does not have "FastROM" to my knowledge.
"My watch says 30 chickens" Google, 2018

redmagejoe

  • Jr. Member
  • **
  • Posts: 21
    • View Profile
Re: NES & SNES Slowdown: FastROM?
« Reply #2 on: March 18, 2019, 10:53:32 am »
NES does not have "FastROM" to my knowledge.

So in the case of NES, "it is what it is" then. :-\

Disch

  • Hero Member
  • *****
  • Posts: 2656
  • NES Junkie
    • View Profile
Re: NES & SNES Slowdown: FastROM?
« Reply #3 on: March 18, 2019, 11:21:20 am »
Slowdown is ultimately caused by a game having too much work to do in a single frame than it has time for.  Hacking a game to use FastRom is one [simple] option that works for SNES.  But another option would be to just go in and optimize the code so it doesn't use as much CPU time.

There are a number of games, particularly on the NES, which infamously do a TON of work during a single frame.  Battletoads is well known for its optimization efforts, and I know nothing about the game code, but Recca on the NES does an INSANE about of splitscreening and spritework every frame with no noticable slowdown.

So while FastROM is a nice crutch to speed up a poorly optimized game, it isn't strictly necessary.  You could just make the game not so poorly optimized.  Of course, that is more difficult because it involves analyzing the code, figuring out what it's doing, and finding a smarter way to do it.

But often, small improvements make a big difference.  Code slowdowns often pile up in looped code.  So shaving 5 cycles off some code that is called 40 times per frame makes the game effectively 1.5 scanlines faster, which MIGHT be enough to make it not miss the next frame and eliminate all in-game slowdown.

redmagejoe

  • Jr. Member
  • **
  • Posts: 21
    • View Profile
Re: NES & SNES Slowdown: FastROM?
« Reply #4 on: March 18, 2019, 02:45:20 pm »
There's quite a few patches in the database that bundle FastROM (and other things) into these omnibus patches, but I'm all for more options. For instance, I'm sure Zelda - Link to the Past DX/Redux/Etc is amazing, but I much more appreciate that some kind souls made individual L/R item switching and Controlled Pegasus Dashing patches I could apply. I was thinking of doing the same for FastROM, but I don't know if the one included in the patch(es) hosted on this site are the same as what I linked above.

How difficult would it be to create a FastROM patch (amount of code modified, tools and time required, etc) for those games that don't already have a FastROM bundle patch (which I could probably just try to diff out and extract into a separate upload), and what are some infamous examples of SNES games that could benefit from this treatment? I'd like to compile such a list here as I may set out to make this my newest project.

Disch

  • Hero Member
  • *****
  • Posts: 2656
  • NES Junkie
    • View Profile
Re: SNES Slowdown: FastROM?
« Reply #5 on: March 18, 2019, 04:36:00 pm »
Quote
How difficult would it be to create a FastROM patch (amount of code modified, tools and time required, etc) for those games that don't already have a FastROM bundle patch

Doing a FastROM hack involves two (3?) basic things:

1)  Enable FastROM some time after game startup (hook into the reset routine and perform a single write to a specific register)
2)  Change all ROM memory accesses to use the FastROM mirror addresses
3?) Change the in cart header to emus recognize that the game uses FastROM  (I don't know if this is actually necessary, but I'd probably do it because whynot)


#2 is really the big step here, as tracking down each and every memory access might be tedious.  Or the game might already be using the appropriate addresses and you won't have to do anything.  It really depends entirely on the game and how it's structured.


Quote
what are some infamous examples of SNES games that could benefit from this treatment?

This isn't really my area, but the one game I remember that had some REALLY annoying and sluggish menus was Seiken Densetsu 3.  It seemed like the equip menus and whatnot were extremely unresponsive.

I kind of doubt that'd be a simple FastROM hack though -- that might take a bit of a closer look to figure out what's actually going on.

redmagejoe

  • Jr. Member
  • **
  • Posts: 21
    • View Profile
Re: SNES Slowdown: FastROM?
« Reply #6 on: March 18, 2019, 04:52:41 pm »
Okay yeah that... I admit that sounds a little beyond my experience level just yet. Still, I am always for the idea of "de-bundling" bundle patches that add several different features into individual option patches. As someone said in my other thread, it's always nice to have options. And now that I'm looking at the Link to the Past DX page, it seems that "Con" is a contributor to it. That's evidence enough for me to believe that the fastrom included is the same one I linked from "Con's stuff", and thus I feel comfortable enough in it to apply it to my ROM.

Seiken Densetsu 3 is another game in my collection, along with Castlevania 4, so if there isn't already a finished/in-progress FastROM project for those (or for Seiken, an analysis as you mentioned), it would be nice to see interest in that. Any other SNES games that anyone can think of with known slowdown issues, please post here. I'm going to compile a list for reference.

Zimgief

  • Jr. Member
  • **
  • Posts: 47
    • View Profile
Re: SNES Slowdown: FastROM?
« Reply #7 on: March 18, 2019, 05:07:56 pm »
Gradius III and Super R-Type would benefit a lot from it.

redmagejoe

  • Jr. Member
  • **
  • Posts: 21
    • View Profile
Re: SNES Slowdown: FastROM?
« Reply #8 on: March 18, 2019, 05:36:46 pm »
Added to the list.

Also I seem to be running into a curious problem. Two, rather. I applied the fastrom patch to both the clean LttP and to my fully patched one. SNES9x does not seem to want to even start the clean fastrom, related perhaps to it still saying LoROM on load, but ZSNES plays it just fine. The second problem is more likely an issue of load order, as catastrophic failure occurs on either emulator (at least S9x loads it though!) once I select a game file in the fully patched ROM. Should I be applying FastROM last or first? Or does it simply not play nicely with other patches when not properly integrated?

It was indeed a load order issue. Be sure to apply FastROM patches to a CLEAN ROM.
« Last Edit: March 18, 2019, 11:22:49 pm by redmagejoe »