Hacking TempGBA: NDSGBA revival

Do GBA games make your nono parts happy?


  • Total voters
    429
Got another Guru Meditation, it looks the same as before, I dont know if its usefull.

Golden sun 2 during battle again.

Guru Meditation
Jump to unmapped address E1A00800
at adress 03000B94
The game has encountered an unrecoverable error. Please restart the emulator to load another game.

CPU lvl 5, frameskip auto, Beta 11.
 
Results of the overnight test. I left it running on frameskip 1, lowest CPU setting for about 8 hours. As expected, when I woke up it hadn't crashed. I then put it into frameskip 0 before I left home to see if anything would happen. It's now about 6 hours later and it hasn't crashed. I've now put it on frameskip 0, CPU 396 MHz and will leave it running for a couple hours to see if it crashes. EDIT: Been 4 hours no with no crash, so I'm turning it off.

Game tested: Boktai (E) (patched)
Situation: idling in the very first map right after the intro

Frameskip: 1
FPS rendered: 26-29
FPS emulated: 55-59
CPU: [0] 240 MHz
Duration: ~8 hours
Crash: No

Frameskip: 0
FPS rendered: 31-35
FPS emulated: 35-38
CPU: [0] 240 MHz
Duration: ~6 hours
Crash: No

Frameskip: 0
FPS rendered: 44-47
FPS emulated: 48-52
CPU: [5] 396 MHz
Duration: ~4 hours
Crash: No
 
I tried to make a recording today to show the various framerates and speed settings and improvements, but the highest FPS my camera will physically record is 30, in VGA mode. XD Drops to 24FPS in 720p.
So what you're trying to say is, you need a new camera? Or are you looking for someone with a 60 FPS camera who can do the testing? Or are you just stating your failed attempt at testing?
 
I mentioned to Nebuleon recording a video a while back, so yeah just letting him know I tried and it didn't come out well. While physically I can tell a big difference between the frameskip levels, it doesn't show up in the video until like, frameskip 3 or so.

If somebody actually does have a 60FPS camera that'd be cool, but they'd need to put the video elsewhere as youtube downscales to 30FPS.

So I think just mentioning FPS numbers (since we have a nice counter now) is the easiest thing to do. I can go compile some later to show how it performs in certain games at certain frameskip settings, so people can know at a glance how well this performs.
 
  • Like
Reactions: Aeter
Was it a crash with guru meditation or one without?

Also, can you reproduce the crash easily? If so, I'd like a saved state in an issue on GitHub.

EDIT: Forgot to read "frameskip 0" in your message. So never mind that, you were probably just confirming the bug for another game. I can continue using Pokémon Leaf Green for testing, since I know it crashes in a battle at frameskip 0.

I think the DSTwo-DS link is too congested, similar to what happened in CATSFC. So I need to either:
* Introduce a delay between sending the previous frame and the next one. If I do this, all sound will crackle at frameskip 0, but games might crash less.
* Make 0 frameskip silently equal to 1. If I do this, sound will not crackle and games will not crash, but you will get 30 FPS.
* Drop 0 frameskip entirely. If I do this, either frameskip 1 will be interpreted as 2 in existing settings files (2 as 3, 3 as 4, ...) OR you will have to reset the setting for all games.
For reference, the DSTwo-DS link can handle sending 42 frames per second plus 44100 Hz audio.

Would it be possible to use lower quality sound instead for better framerates?
 
I was really disappointed when Nintendo removed the GBA processor when creating the DSi, because, in my opinion, the DSi XL is by far the best device to play GBA games on.

I'm really glad and thankful this project exists and I hope that there will be progress.

I played a bit of 0169 Wario Land 4. I used the following settings when playing: Frame skipping [0], CPU frequency [5], the rest default.

The sound quality didn't feel very high, I tried this in other games, too.

I felt like when running backwards (after jumping on the timer) the emulation is not smooth. In addition, once, when running back, at a screen transition, the emulator just hanged and didn't react to anything (felt like stuck in an infinite loop).
 
I played a bit of 0169 Wario Land 4. I used the following settings when playing: Frame skipping [0], CPU frequency [5], the rest default.

The sound quality didn't feel very high, I tried this in other games, too.

I felt like when running backwards (after jumping on the timer) the emulation is not smooth. In addition, once, when running back, at a screen transition, the emulator just hanged and didn't react to anything (felt like stuck in an infinite loop).
In Wario Land 4, during the escape sequences, the game uses a whole bunch of visual effects; the exit portal rotates, the background starts waving and level colors start to glow in several colors. This is probably too much for the emulator to handle, so the emulator starts lagging behind the game. In these cases, setting frameskip to 1 (so that the game runs at 30 FPS) tends to help immensely. I just tried it, and the game seems to run at a smooth 30 rendered, 60 emulated in escape sequences at frameskip 1.

You can also try adding this entry to game_config.txt. It won't have a lot of effect since it's mainly the graphics rendering that's slowing everything down (correct me if wrong!), though.

# Wario Land 4 (UE)
game_name = WARIOLANDE
game_code = AWAE
vender_code = 01
idle_loop_eliminate_target = 08000662

I'm not too experienced at making these, but I believe this counts as an idle loop. Nebuleon, how does the emulator handle SWI 2 (Halt); does it emulate it with the BIOS, or is it just ignored?

As for the emulator hanging, that's a known issue in beta 11 when using frameskip 0.
 
In Wario Land 4, during the escape sequences, the game uses a whole bunch of visual effects; the exit portal rotates, the background starts waving and level colors start to glow in several colors. This is probably too much for the emulator to handle, so the emulator starts lagging behind the game. In these cases, setting frameskip to 1 (so that the game runs at 30 FPS) tends to help immensely. I just tried it, and the game seems to run at a smooth 30 rendered, 60 emulated in escape sequences at frameskip 1.

You can also try adding this entry to game_config.txt. It won't have a lot of effect since it's mainly the graphics rendering that's slowing everything down (correct me if wrong!), though.

# Wario Land 4 (UE)
game_name = WARIOLANDE
game_code = AWAE
vender_code = 01
idle_loop_eliminate_target = 08000662

I'm not too experienced at making these, but I believe this counts as an idle loop. Nebuleon, how does the emulator handle SWI 2 (Halt); does it emulate it with the BIOS, or is it just ignored?

As for the emulator hanging, that's a known issue in beta 11 when using frameskip 0.

I was playing since my last posting using frameskip [1]; the game ran more smoothly and the emulator never hanged, but there were occasional slowdowns when running back, e.g. in the water level where there is a big octopus near the time frog.
 
# Wario Land 4 (UE)
game_name = WARIOLANDE
game_code = AWAE
vender_code = 01
idle_loop_eliminate_target = 08000662

I'm not too experienced at making these, but I believe this counts as an idle loop. Nebuleon, how does the emulator handle SWI 2 (Halt); does it emulate it with the BIOS, or is it just ignored?

As for the emulator hanging, that's a known issue in beta 11 when using frameskip 0.
Wait, what? Did you just make that entry? If you know how to make these, I think wolfmanz51 would love your input on his thread -> http://gbatemp.net/threads/iplayer-supercard-gbaemu-game_config-txt-improvement-project.248619/

(That also reminds me to make a ROM info interface for the emulator)

Regarding SWI 2, it's handled like this.
  1. The BIOS likely issues a write to IO register 300h, HALTCNT.
  2. In source/nds/memory.c, lines 1237 (8-bit IO write) and 1576 (16-bit IO write), you find this:
    Code:
        case 0x300:
          if(value & 0x8000)
            reg[CPU_HALT_STATE] = CPU_STOP;
          else
            reg[CPU_HALT_STATE] = CPU_HALT;
    
          return CPU_ALERT_HALT;
  3. This in turn is directed to write_io_epilogue (mips_stub.S, line 3207), which checks this CPU alert value, calls update_gba (gpsp_main.c, line 497) and it does a fast loop, only checking for interrupts.
    Code:
      do
        {
          cpu_ticks += execute_cycles;
          /* [...] lines 501 to 703 */
      } while(reg[CPU_HALT_STATE] != CPU_ACTIVE);
      return execute_cycles;
So in summary, I think it should handle SWI 2 Halt by skipping lots of CPU emulation, as well as any write to HALTCNT.
 
I was really disappointed when Nintendo removed the GBA processor when creating the DSi, because, in my opinion, the DSi XL is by far the best device to play GBA games on.

I'm really glad and thankful this project exists and I hope that there will be progress.

I played a bit of 0169 Wario Land 4. I used the following settings when playing: Frame skipping [0], CPU frequency [5], the rest default.

The sound quality didn't feel very high, I tried this in other games, too.

I felt like when running backwards (after jumping on the timer) the emulation is not smooth. In addition, once, when running back, at a screen transition, the emulator just hanged and didn't react to anything (felt like stuck in an infinite loop).
That's a known issue, one which will get a slight workaround in beta 12 (see TempGBA issue 3 on GitHub). However, it will still not enable games to work with flawless audio at frameskip 0. Frameskip 0 is there for only the very simple-to-emulate games, like the Mario Advances and the Pokémons. Frameskip auto or 1 should be used for the rest.
 
Wait, what? Did you just make that entry? If you know how to make these, I think wolfmanz51 would love your input on his thread ->http://gbatemp.net/threads/iplayer-supercard-gbaemu-game_config-txt-improvement-project.248619/
Well, I don't know if I did it right. It doesn't seem to have any effect on the framerate... is there a better way to measure the effect on emulation speed?
So in summary, I think it should handle SWI 2 Halt by skipping lots of CPU emulation, as well as any write to HALTCNT.
Okay, so that gives it more time to build the frame buffer, then? Or is that time just wasted? The reason I ask is because Wario Land 4 issues a SWI 2 Halt followed by an idle loop, and you have to nop out both to get a speedup; just removing the idle loop won't do it, because then the game is halted until a timer interrupt is issued or whatever, and just removing the SWI doesn't do it either, because then the idle loop will force the game to wait till the next frame.
 
a) Well, I don't know if I did it right. It doesn't seem to have any effect on the framerate... is there a better way to measure the effect on emulation speed?

b) Okay, so that gives it more time to build the frame buffer, then? Or is that time just wasted? The reason I ask is because Wario Land 4 issues a SWI 2 Halt followed by an idle loop, and you have to nop out both to get a speedup; just removing the idle loop won't do it, because then the game is halted until a timer interrupt is issued or whatever, and just removing the SWI doesn't do it either, because then the idle loop will force the game to wait till the next frame.
a) Not that I know of, sorry :( You'll have to rely on the FPS counter, and reducing the CPU frequency if it's always 60 emulated at a certain frequency.

b) It skips CPU emulation to spend more time on the video, yeah, but in Wario Land 4 it may be too complex and the time saved would not be enough.

Removing those idle loops could help, but because they're turned into MIPS code, they may be faster than you'd expect from an emulator! A 1-instruction idle loop (your standard 'JMP Self' idle loop) would be turned into many CPU instructions by an emulator (one to check the opcode, another to gather the branch offset, another to set the Program Counter, etc.), but could become 1 instruction in TempGBA because it uses gpSP's ARM-to-MIPS compiler.
 
TempGBA beta 12, the Compatibility Edition, is now available.

This version changes drastically the game compatibility and speed of TempGBA. See below for details. There may need to be a new wiki page to list compatibility for this version and beyond.

* Crashes are now far less likely, but still possible, when manual frame skip 0 is selected.

* Accelerate games that use self-modifying code in IWRAM or EWRAM. (This list is incomplete.)
-> Doom (+30%) is almost flawless at 396 MHz.
-> Doom II (+100%) is greatly improved over NDSGBA 1.21, but still struggles with high polygon counts, even at 396 MHz.
-> Duke Nukem Advance (+40%) is somewhat improved, but struggles in many parts of the game, even at 396 MHz.
-> Golden Sun (+70%) is now playable without hiccups at 336 MHz and above, even in battles with critical hits, and fast-forwards to 120-150 FPS at 396 MHz.
-> Golden Sun 2 is now playable with few hiccups at 396 MHz, even during graphics-heavy cutscenes, and fast-forwards 50% quicker.
-> Mario Golf: Advance Tour should now have fewer sound glitches.
-> Mario Tennis: Power Tour (+60%) is now playable with slight hiccups at 396 MHz. These hiccups are dependent upon the complexity of the music that is playing.

* Games that execute the same code as ARM and Thumb should now work. (This list is incomplete.)
-> Golden Sun 2 should not crash anymore with a "Guru Meditation, Jump to unmapped address E1A00800 from 030xxxxx" or return abruptly to the EOS Plugin Menu in battles.
-> Tales of Phantasia should not crash anymore with a "Guru Meditation, Jump to unmapped address E17xxxxx" screen or return abruptly to the EOS Plugin Menu at the title screen.

* Accelerate games that use ROM mirror addresses.
* Slightly smoother return from fast-forward.
* A ROM information interface is now found under /Tools/Debugging. It gives the values for game IDs as game_config.txt expects them.
* The bundled game_config.txt has had all translation_gate entries disabled.

* 4 rewind steps are removed. 10 are left.
 
~

http://wiki.gbatemp.net/wiki/TempGBA_Compatibility

EDIT: And no, those numbers I added aren't stretching it. Many games that needed frameskip 1 previously now work with frameskip 0. The only game that needs more than 1 that I've tested has been Wario Land 4, it needs frameskip 2 during the background seizure things.
 
  • Like
Reactions: tbgtbg
TempGBA beta 12, the Compatibility Edition, is now available.

This version changes drastically the game compatibility and speed of TempGBA. See below for details. There may need to be a new wiki page to list compatibility for this version and beyond.

* Crashes are now far less likely, but still possible, when manual frame skip 0 is selected.

* Accelerate games that use self-modifying code in IWRAM or EWRAM. (This list is incomplete.)
-> Doom (+30%) is almost flawless at 396 MHz.
-> Doom II (+100%) is greatly improved over NDSGBA 1.21, but still struggles with high polygon counts, even at 396 MHz.
-> Duke Nukem Advance (+40%) is somewhat improved, but struggles in many parts of the game, even at 396 MHz.
-> Golden Sun (+70%) is now playable without hiccups at 336 MHz and above, even in battles with critical hits, and fast-forwards to 120-150 FPS at 396 MHz.
-> Golden Sun 2 is now playable with few hiccups at 396 MHz, even during graphics-heavy cutscenes, and fast-forwards 50% quicker.
-> Mario Golf: Advance Tour should now have fewer sound glitches.
-> Mario Tennis: Power Tour (+60%) is now playable with slight hiccups at 396 MHz. These hiccups are dependent upon the complexity of the music that is playing.

* Games that execute the same code as ARM and Thumb should now work. (This list is incomplete.)
-> Golden Sun 2 should not crash anymore with a "Guru Meditation, Jump to unmapped address E1A00800 from 030xxxxx" or return abruptly to the EOS Plugin Menu in battles.
-> Tales of Phantasia should not crash anymore with a "Guru Meditation, Jump to unmapped address E17xxxxx" screen or return abruptly to the EOS Plugin Menu at the title screen.

* Accelerate games that use ROM mirror addresses.
* Slightly smoother return from fast-forward.
* A ROM information interface is now found under /Tools/Debugging. It gives the values for game IDs as game_config.txt expects them.
* The bundled game_config.txt has had all translation_gate entries disabled.

* 4 rewind steps are removed. 10 are left.


Golden sun 2 became worse, it was better in beta 11...

The sound now has more crackles in it, it laggs more and the visual effects are less smooth.
Its like the beta 10 test build you gave me.

Cpu at 5, frameskip [-] keep up with the game
 
Alright, with tj_cool's help I got the new Wiki page sorted out. Beta 12 is pretty crazy. I never thought I'd see so many games running at 30, even 60 FPS without a skip even in battle.

Gonna' see if I can't get an article on the front page pointing out the improvements and calling for a new batch of testing.
 

Site & Scene News

Popular threads in this forum