Game Boy Advance idle loop patches (i.e. speedhacks)

Discussion in '3DS - Homebrew Development and Emulators' started by Vague Rant, Sep 1, 2015.

  1. Vague Rant
    OP

    Vague Rant Deceptively cute

    Member
    2,053
    414
    Aug 7, 2008
    Melbourne
    Game Boy Advance emulation on 3DS is generally slow. One of the factors in this is that It's difficult to emulate a GBA that's working hard, and many games are quite taxing on the GBA's CPU. Fortunately, it's easier to emulate a GBA that's not working hard. Simple, well-programmed games shouldn't tax the GBA hardware all that much and should therefore be easier to emulate at full speed.

    The problem here is that we can't assume that all GBA games are well-programmed. There is a particular way which some games are programmed which causes the GBA to work hard for no gain. Picture a car sitting in neutral while the driver revs the engine. The car isn't going anywhere, but the engine doesn't know or care.

    On the up side, it is possible for talented hackers to improve these games' performance by optimizing their idle loops (so they're not revving the engine all the time, only when they're actually trying to drive fast). So here's a few patches for GBA games which hopefully should work just as well as their unpatched equivalents.

    These patches are also useful on a real GBA, as driving the CPU less hard means lower power usage, so your batteries will last longer. On the 3DS, though, we're shooting for faster emulation rather than less battery drain.
    Note: it's important to temper your expectations for these patches. They're not going to take a game from running 10FPS to 60FPS. However, for me on a New 3DS, WarioWare and Pokémon run much better with these patches than they do without. Drill Dozer, on the other hand, does still dip frequently--the game does genuinely appear to be working the CPU hard sometimes, and you can't just patch that out (although it's possible there are further optimizations to be had). While they shouldn't break anything, of course it's always possible they might.

    If anyone else has created any idle loop patches, I'm sure people would be grateful to see them posted. Please try not to turn this into a request thread; people can't just optimize any game that currently runs slow, it has to run slow and run inefficiently and in a way which someone can improve without breaking.
     

    Attached Files:

    XanLoves likes this.
  2. FAST6191

    FAST6191 Techromancer

    pip Reporter
    23,865
    9,780
    Nov 21, 2005
    United Kingdom
    Most of the time when I do emulator focused hacks it is usually to sort scaling issues, however I have toyed with a few things like this in the past (mainly analysing patches you have already linked). If it is purely for speedup then there might be other relatively simple hacks that you can do, though they might not be advisable on real hardware if power consumption is your thing ( http://problemkaputt.de/gbatek.htm#gbacartridgerom ). Also no$gba debug (which is free these days) has a nice CPU bar on it that you might be able to figure out things from.

    Oh and by most accounts the problem with Golden Sun is the interesting, though with the results it gets that is not a bad thing, approach it takes to the music so probably best not to expect anything there.