Hacking Fixing/reducing GBA slowdowns

july

New Member
OP
Newbie
Joined
Aug 14, 2006
Messages
2
Trophies
0
XP
37
Country
I spent a few hours searching the forums for information on how to get roms like yoshi's island to run better. I finally got yoshi's island in a quite playable state, and thought I'd put all the information in one place to make it easier for other people to find.

Keywords: prefetch, pfpatch, fastrestart, restart patch, slowdowns, gba, yoshi, mario kart.

I've placed the information on a wiki page at PHwiki:
http://wiki.pocketheaven.com/SupercardGBASlowdowns

Reproduced below for convenience:

Due to the design of the Supercard, many people experience slowdowns
when playing GBA games. There are three main reasons for this.

* '''Slow SDRAM on the Supercard.'''
* ''''Restart' patch problems.'''
* '''Lack of prefetch when not using the restart patch.'''

More information is below.

= Slow SDRAM =

There's not much that you can do about this, short of taking your
Supercard apart and putting in a faster SDRAM module. Thankfully for
most games, you don't need to go that far.

= 'Restart' patch problems =

The 'restart' patch in the Supercard software enables the use of
shortcut keys to jump back to the Supercard screen - this makes saving
and exiting a game easier.

This patch works by hooking into the DS's redraw interrupt, which is
(usually) called at 60 times per second. If games push the limits of
what can be done in the redraw interrupt, there won't be enough time
left for the restart patch to check keystrokes, and thus slowdown
occurs.

There are two options available. One is to disable the 'restart'
patch. This can make saving cumbersome (see QPC saving), and it also
disables prefetching (see the next section).

The alternative is to use [[Bubble2k]]'s fastrestart patch, which attempts
to optimise the restart patch. It's a good idea to try this first, but
if you continue to have speed problems, see below.

= Lack of prefetch =

Prefetching can result in significant speedups in some games, with an
approximate 10% hit in battery life. For some reason, the Supercard
software only enables prefetching if the 'restart' patch is applied -
so disabling the 'restart' patch in order to increase performance can
in some cases make things run even slower.

A program called 'pfpatch' (again by [[Bubble2k]]) solves this problem
by enabling prefetching on ROMs patched without the 'restart' patch.
QPC saving can be cumbersome, but if you're still experiencing
slowdowns, this method is the best.

= Links =

*# Fast restart (SD): http://l33t.spod.org/ratx/DS/SC/misc/fastrestart-v0.1.zip
*# Fast restart (CF): http://l33t.spod.org/ratx/DS/SC/misc/fastrestart-cf-v0.1.zip
*# Prefetch: http://l33t.spod.org/ratx/DS/SC/misc/pfpatch.zip

Have fun :-)
 

july

New Member
OP
Newbie
Joined
Aug 14, 2006
Messages
2
Trophies
0
XP
37
Country
I've added usage instructions to the wiki page. Reproduced below for convenience.

fastrestart

1. Make sure you have a backup copy of the ROMs you want to use.
2. Select some files and drag them onto fastrestart.exe, or from the commandline, type 'fastrestart nameOfRom.gba'
3. Process the ROMs with the Supercard software. Make sure 'saver' and 'restart' patching are enabled. You only need 'saver', not 'save'.
4. Copy the .sav file fastrestart generated, and the output from the Supercard software to your Supercard.

pfpatch

1. Make sure you have a backup copy of the ROMs you want to use.
2. Load the roms into Supercard. Enable 'saver' and 'save', and make sure 'restart' is disabled.
3. Run pfpatch on each generated ROM in turn. Unlike fastrestart, you need to drag files onto pfpatch one at a time. From the commandline, run 'pfpatch nameOfRom.gba'
4. Copy the updated ROMs and .sav files to your Supercard.

To save, use the QPC method (see Supercard).
 

badger

Active Member
Newcomer
Joined
May 22, 2006
Messages
31
Trophies
0
Age
45
Location
Arlington, MA
Website
Visit site
XP
111
Country
United States
wow july - thanks for the great advice! I was able to get yoshi's island running PERFECTLY at last! I had to use pfpatch and can only save with QPC method, but thats no problem. Thanks again
grog.gif
 

thaddius

Charmander is not pleased.
Member
Joined
May 5, 2008
Messages
1,345
Trophies
1
Age
111
Website
Visit site
XP
1,268
Country
Canada
Well the thread is from '06. I'm not surprised the link doesn't work.

That being said, here's the current location of the page. There are some mirror's for the files there. I didn't check them though.

EDIT: Maybe you'd consider uploading the files to fileTrip when you're done? It'd be a great help to anyone looking for the files in the future when the site goes down. If you do so don't forget to post about it here so future Tempers will know.
 
  • Like
Reactions: SILENT_Pavel

SILENT_Pavel

Member
Newcomer
Joined
Apr 6, 2014
Messages
18
Trophies
0
XP
107
Country
Canada
Maybe you'd consider uploading the files to fileTrip when you're done? It'd be a great help to anyone looking for the files in the future when the site goes down. If you do so don't forget to post about it here so future Tempers will know.
No problem. fastrestart-cf-v0.1 + fastrestart-v0.1 + Prefetch_patcher - attached on this post

Code:
Due to the design of the [[Supercard]], many people experience '''slowdowns when playing GBA games'''.
There are three main reasons for this:
* '''Slow SDRAM on the Supercard.'''
* ''''Restart' patch problems.'''
* '''Lack of prefetch when not using the restart patch.'''

More information is below.

== Slow SDRAM ==

The GBA starts up with its ROM interface set to a wait state of 4/2 cycles: it will wait 4 cycles for the first 16-bit word of a transfer and 2 cycles for each additional 16-bit word.
Official GBA Game Paks are capable of a wait state of 3/1 cycles, and one of the first thing that an official game will usually do is reprogram the GBA's ROM interface to work at 3/1 wait state.
However, the 32 MB RAM in the SuperCard does not work at 3/1; to allow games to work, the SuperCard patcher prevents the game from reprogramming the ROM interface.
(If you have a DS, a SuperCard, and a [[SuperKey]] or other [[NoPass]] card, you can demonstrate this using [http://www.pineight.com/ds/#memtestARM memtestARM]:  the RAM tests will fail for any speed faster than 4/2.)

The GBA CPU runs 280,896 cycles in each frame.
Some games are designed to use all the cycles in a frame at 3/1 wait state, and 4/2 just makes each read from ROM take more cycles, possibly causing computation to spill over to the next frame.
There's not much that you can do about this, short of taking your Supercard apart and putting in a faster SDRAM module (not feasible; see below) or buying an M3.
Some games that require this include
* Doom, Doom 2, Duke Nukem Advance, and other games that use a software 3D engine
* Mario Kart Super Circuit
But for most other games, you don't need to go that far.

===Why not replace SDRAM?=== 
Replacing the SDRAM in a SuperCard is not a very feasible option.  See the following quote by a user named rarefluid [http://www.scdev.org/forum/index.php?topic=11759]:

''The SDRAM chip is a Hynix HY57V561620CT-H (133MHz) http://www.chipcatalog.com/Hynix/HY57V561620CT.htm''
''As you can see here http://www.kurobox.com/downloads/Hardware/kurosdram.pdf you could use a Hynix HY57V561620CT-6 (166MHz), which is faster. It has different cycle times etc. though, so you wouldn't be able to use it without a changed firmware, which you probably won't get...''

''Also the Supercard seems to have a 50MHz clock generator, so I presume the CPLD (Lattice LC4128V 75T100, 7.5ns tPD (propagation delay)) and the SDRAM are running at that speed too. So to get a faster system I'd say you'd first have to replace the CPLD. There are versions with 2.7 and 5ns tPD, but they are pricey: ~40/30$ (http://www.mouser.com/catalog/624/188.pdf).''

''Maybe there are some more hardware specialist around that can clarify things...''
''As much as I'd love to do this myself: It is stupid, expensive and probably won't work out because of missing firmware. So we'd better leave this alone altogether :/''

== 'Restart' patch problems ==

The 'restart' patch in the Supercard software enables the use of
shortcut keys to jump back to the Supercard screen - this makes saving
and exiting a game easier.

This patch works by hooking into the DS's "vertical blanking" interrupt, which is (usually) called as soon as the screen finishes displaying one frame of animation, which happens at 60 times per second.
If games push the limits of what can be done in vblank, there won't be enough time left for the restart patch to check keystrokes,
and thus slowdown occurs.

There are two options available. One is to disable the 'restart'
patch. This can make saving cumbersome (requiring a quick power cycle, or QPC), and it also
disables prefetching (see the next section).

The alternative is to use [[Bubble2k]]'s fastrestart patch, which attempts
to optimise the restart patch. It's a good idea to try this first as saving
will be easier, but it may not be as effective as the solutions below.

==Lack of prefetching ==

Another thing the GBA ROM controller can do is fetch more instructions from ROM while the program is reading or writing data in the GBA's internal RAM.
This "Fetching" can result in significant speedups in some games, as the CPU doesn't have to wait as long for the next instruction to come in (giving an effective 4/1 wait state),
with an approximate 10% hit in battery life.

A program called 'pfpatch' (again by [[Bubble2k]]) solves this problem
by enabling prefetching on ROMs patched without the 'restart' patch.
QPC saving can be cumbersome, but if you're still experiencing
slowdowns, this method is the best.

== Instructions ==

Before you try either procedure below, '''make sure you have a backup copy''' of the roms you want to use. This could be the original Game Pak (for fair use backups of authentic cartridges) or the original zipfile (for pirated games).

=== fastrestart ===

# Select some files and drag them onto fastrestart.exe, or from the commandline, type 'fastrestart nameOfRom.gba'
# Process the roms with the Supercard software. Make sure 'saver' and 'restart' patching are enabled. You only need 'saver', not 'save'.  '''Reports have come in that the "restart" patch is not needed and causes issues when using fastrestart.  Try using ONLY "enable saver patch" for best results.'''
# Copy the .sav file fastrestart generated, and the output from the Supercard software to your Supercard.

=== pfpatch ===

# Load the roms into Supercard. Enable 'saver' and 'save', and make sure 'restart' is disabled.
# Run pfpatch on each generated rom in turn. Unlike fastrestart, you need to drag files onto pfpatch one at a time. From the commandline, run 'pfpatch nameOfRom.gba'
# Copy the updated roms and .sav files to your Supercard.

To save, use the QPC method (see [[Supercard]]).

== External links ==
Old mirrors (broken as of April 2007):
* Fast restart (SD): http://l33t.spod.org/ratx/DS/SC/misc/fastrestart-v0.1.zip
* Fast restart (CF): http://l33t.spod.org/ratx/DS/SC/misc/fastrestart-cf-v0.1.zip
* Prefetch: http://l33t.spod.org/ratx/DS/SC/misc/pfpatch.zip

[[User:Dantheman|DanTheMan]]'s mirrors:
* Fast restart (SD): http://dannysied.googlepages.com/fastrestart-v0.1.zip
* Fast restart (CF): http://dannysied.googlepages.com/fastrestart-cf-v0.1.zip
* Prefetch: http://dannysied.googlepages.com/Prefetch_patcher.zip
 

Attachments

  • SupercardGBASlowdowns.zip
    146.4 KB · Views: 644

DanTheManMS

aka Ricochet Otter
Member
Joined
Jun 2, 2007
Messages
4,453
Trophies
1
Age
34
Location
Georgia
XP
751
Country
United States
Not gonna lie, I had a long day at work today, and it really warmed my heart to see someone still making use of the wiki pages I helped edit "back in the day" hehe. I'm surprised my mirror links still work there, to be honest. Gotta hand it to Google - even though they shut down Google Pages years ago, they still haven't deleted the files I used to host there.
 

Hanafuda

Well-Known Member
Member
Joined
Nov 21, 2005
Messages
4,490
Trophies
2
XP
6,947
Country
United States
I get slowdowns in Yoshi's Island on a retail cart. Happens especially when you bust out a bunch of little stars all at once.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
  • BakerMan @ BakerMan:
    fuck ubisoft, and fuck activision
    +1
  • realtimesave @ realtimesave:
    Nintendo needs to release a new console, switch is getting such shitty little games lately lol it's pathetic
  • Purple_Heart @ Purple_Heart:
    Lmao a new flashcart... The Unlock Switch... I knew it's not fake xD
    +1
  • NinStar @ NinStar:
    A new consoles won't solve that problem
  • NinStar @ NinStar:
    It will actually make it worse
  • The Real Jdbye @ The Real Jdbye:
    well actually
    a new console won't do anything right now, because the games are still in development, that's why there are few games being released
  • The Real Jdbye @ The Real Jdbye:
    it won't make the games finish any faster
  • Veho @ Veho:
    2/3rds of launch titles for the Switch 2 will just be lazy ports of Switch games anyway.
  • The Real Jdbye @ The Real Jdbye:
    probably
  • The Real Jdbye @ The Real Jdbye:
    maybe mario kart 9 will be a launch title
  • The Real Jdbye @ The Real Jdbye:
    i really want a new mario kart
  • Veho @ Veho:
    What, you mean the endless stream of DLCs doesn't count?
  • Veho @ Veho:
    Why develop a new game when you can just sell season passes forever?
  • Veho @ Veho:
    I'm still on MKDS so I'm not bothered :tpi:
  • The Real Jdbye @ The Real Jdbye:
    i like the dlc tbh, i'd like a new game more
  • ZeroT21 @ ZeroT21:
    but the current version is still selling fine at full price
  • SylverReZ @ SylverReZ:
    Hello
  • ZeroT21 @ ZeroT21:
    sup
    +1
  • SylverReZ @ SylverReZ:
    @realtimesave, You seen the Unlock Switch flashcart yet?
  • K3Nv2 @ K3Nv2:
    I'll see the 19.0 update that blocks use ability to it
    +1
  • K3Nv2 @ K3Nv2:
    Lol newegg+
    Screenshot-20240423-053504-Gmail.jpg
  • S @ salazarcosplay:
    does update 19 really block it
  • SylverReZ @ SylverReZ:
    Update 19 never came out yet. Just the 18.1.
    SylverReZ @ SylverReZ: Update 19 never came out yet. Just the 18.1.