Hacking TempGBA: NDSGBA revival

Do GBA games make your nono parts happy?


  • Total voters
    429
Silly question, but would this work on just any flashcard? Or at the very least on a 3DS? I figured the extra power of the 3DS might help.
It only works on the DSTwo, and 3DS-mode is not available. Nothing gets a speed boost from being on the 3DS, period.
 
Trying to load up (Super) Money Ball Jr. gives this.

Monkey_Ball_Jr_0906144916.png
 
TempGBA version 1.45 is here. I had some cross-platform fixes and improvements in the pipeline from my derived project ReGBA, and the last one was too good to pass up. So here's release 1.45 of TempGBA, or ReGBA/DSTwo :)

In this release:
  • An open-source replacement for the GBA BIOS made from VBA-M's BIOS emulation code. Thanks to Normmatt for this! You can still use the Nintendo BIOS if you have it in the /TEMPGBA folder of your storage card, but if you extract all of the files in this release, you will replace it with Normmatt's BIOS.
  • A workaround for a desynchronisation between the Direct Sound music channels and the PSG (Game Boy beeper) channels. If you load a saved state made in TempGBA betas 12-15 or versions 1.40-1.44, and the desynchronisation was below 186 milliseconds, it will be retroactively fixed. If it was already above 186 milliseconds, then the desynchronisation will fix itself after about an hour of play.

    This was most apparent in the following games:
    • Bomberman Story, Japan, and Bomberman Tournament, USA;
    • Castlevania games;
    • Donkey Kong Country games;
    • Dr. Mario & Panel de Pon, Japan;
    • Earthworm Jim games;
    • Final Fantasy games;
    • Golden Sun games;
    • Kurukuru Kururin;
    • Mario Golf: Advance Tour;
    • Mario Kart: Super Circuit;
    • Mario Tennis: Power Tour;
    • Mega Man Battle Network games, US/Europe, and Rockman.EXE games, Japan;
    • Pokémon games;
    • Puyo Pop, US, Puyo Pop Fever, Europe, and Puyo Puyo Fever, Japan;
    • Sonic Advance games;
    • Super Mario Advance games;
    • Yu-Gi-Oh! games.
  • A fix for a bug whereby uncompressed ROMs in zip files would not load if they were larger than 8 MiB.
  • All high-level BIOS emulation is disabled except SWI 06h, Div, and 07h, DivARM.
  • The plugin is now 290 KiB smaller, out of a previous 2237 KiB.
Enjoy!
 
Sonic Advance doesn't work for me.
Game loads, music starts, and then the game is stuck when on screen there are four grey Lines on blue background, the music keeps playing...
 
Ups, the fix was to enable ''boot to gba logo'' option instead of ''boot to cartridge ROM'', other games worked fine before!
 
Wow, Urbz works on this latest 1.45 release !

Payback however on the other hand - like I expected - still doesn't.
 
Under the hood:
  • Assembler optimisations. Move some load-memory instructions so that they occur at least 4 cycles before the first instruction that will use the loaded value.
Wait, what? This sounds like an optimization for x86. If not, then wow. I was unaware the DS had OoO execution.
But if so: I thought people were trying to remove all assembly code from the PC version, not add more...
 
Wait, what? This sounds like an optimization for x86. If not, then wow. I was unaware the DS had OoO execution.
But if so: I thought people were trying to remove all assembly code from the PC version, not add more...
You have to keep in mind that I am running this on a MIPS processor inside the DSTwo cartridge, not the ARM processors of the DS. And what that MIPS processor has is not out-of-order execution, it's actually a pipeline interlock that prevents using the value of a register before it's fully loaded, if it was the target of a recent load-memory instruction. It just stops executing anything for up to 4 cycles - that's a lot of wasted time. I tested this optimisation on the GCW Zero and found it to be the same on the DSTwo.*

Assembly code is needed for at least some elements of the core, because accessing memory is so slow (and you have the 4 cycles of wasted time every access) and using the processor's registers is so much faster. This assembly code does make it so that a ReGBA porter needs to make a recompiler and assembly core for a platform that doesn't have them yet... however, without this assembly code, ReGBA would give exactly the same performance as VisualBoyAdvance on any platform.

In other words, the assembly code makes ReGBA what it is - remove the assembly code from ReGBA, and it becomes nothing.

_________
* If you are so inclined, you can run a program with this code block in a loop and benchmark it, varying the amount of NOP instructions between the load (LW) and the use of $2:
Code:
unsigned int data = 0x12345678;
volatile unsigned int* dataptr = &data;
unsigned int j = 0;
__asm__ __volatile__ (
  ".set noreorder \n"
  ".set noat \n"
  "lw    $2, (%1) \n"
  "nop \n"
  "nop \n"
  "nop \n"
  "nop \n"
  "addu  %0, %0, $2 \n"
  ".set reorder \n"
  ".set at \n"
  : /* output */  "=r" (j)
  : /* input */   "r" (dataptr)
  : /* clobber */ "2"
);
 
Just updated to 1.45 now. Though one thing that seems strange is that lately when I start games that I know worked (this was with 1.44 even), I get the audio from the game fine, but then I see no video. What is up with that?
 
Just updated to 1.45 now. Though one thing that seems strange is that lately when I start games that I know worked (this was with 1.44 even), I get the audio from the game fine, but then I see no video. What is up with that?
Can you be a bit more specific? Which games? (And which BIOS? Did you overwrite the Nintendo BIOS you already had with Normmatt's?)
 
Fire emblem should be work to some degree, you can check the compatibility list. If you mean specifically this update though, probably not.
i heard fire emblem run with minor hiccup. i'm not really care about it cus i already have ezflash 3 in 1 and m3 perfect to run gba games from ndslite but i'm really look forward to play gba games using dsi. ^_^
 
Can you be a bit more specific? Which games? (And which BIOS? Did you overwrite the Nintendo BIOS you already had with Normmatt's?)
It was happening with my install on 1.44 as well.

First one I tried was Teen Titans simply because I remember around 1.43 it did play, but was really slow. I put the Nintendo GBA BIOS in place; same as what I had in 1.44 and before.

Trying to find some others as I type this, but - strangely enough - those that I thought black-screened like that are working now. I wonder if maybe the games I'm thinking about are on tempGBA or on the SFC. I suppose I need to do some more digging.
Sega Arcade Gallery starts, but the intro/splash screens are all jumbled together and won't proceed any further. :(
 

Site & Scene News

Popular threads in this forum