How to Change Game Speed Independently of FPS (Example with Pokémon ORAS)

Hi everyone! Today I’m sharing a little discovery that will let you speed up your 3DS games.
I’ll use Pokémon Alpha Sapphire v1.4 as the demo.
After reverse engineering, here’s roughly the function that is called each frame:

C:
// mode = 0 => 60 FPS (16,666 µs)
// mode = 1 => 30 FPS (33,333 µs)
void runEachFrame() { // function is located at address: 0x0010E34C

  // This is what seems to speed up the game when switching from 30 -> 60 FPS
  // using Reshiban's codes 
  // https://gbatemp.net/threads/60-fps-patches-cheat-codes-releases-and-discussion.550527/
  bool shouldUpdate = true;
  if(mode) { // If 30 FPS, skip every other frame
    count ^= true;
    shouldUpdate = count;
  }

  if(shouldUpdate) {
    // Update game state: weather, lighting, game events, etc.
    update();
  } else {
    // ...
  }

  if(!mode || !shouldUpdate) {
    // Helps avoid major lags
    // If CPU and/or GPU are too slow, skip rendering the next frame
    // Keep the previous framebuffer because the previous render is not finished
    if(!skip) { 
      u64 start = GetSystemTick(); // svc 0x28
      // Draw everything on screen, swap buffers, etc.
      draw();

      u64 delta = GetSystemTick() - start;

      bool shouldSkip = false;
      u32 limit = mode ? 33333 : 16666; // 33,333 µs => 30 FPS

      // Measure GPU time, skip if overloaded (limit ~10,300 µs => 97 FPS)
      if(isGpuOverloaded() && getGpuProcessingTime() > limit) {
        shouldSkip = true;
      }

      // Check CPU time, skip if frame took too long (limit 16,666 µs => 60 FPS)
      if(isCpuOverloaded() && delta > 16666) {
        shouldSkip = true;
      }

      // Skip the next frame if overloaded
      if(shouldSkip) {
        skip = true;
      }

    } else {
      skip = false;
    }
  }
}

The idea to speed up the game is simple: just call all the functions inside update() multiple times (with a loop).
To slow down, it’s the same idea: call the function only every X frames.
Here’s the code for Pokémon:

Code:
[60 FPS + GAME SPEED]
0010E36C E3A06001 // mov r6, #1
0010E370 E3A0C00X // mov r12, #X
0010E374 E58FC010 // str r12, [pc, #0x10]
0010E378 E59FC00C // ldr r12, [pc, #0xC]
0010E37C E25CC001 // subs r12, r12, #1
0010E380 0A000075 // beq 0x0010E55C : update the view (draw()) and exit function
0010E384 E58FC000 // str r12, [pc, #0]
0010E388 EA00000E // b 0x0010E3C8 : update the model (update())
0010E38C FFFFFFFF // counter: .word 0xFFFFFFFF
0010E528 EAFFFF92 // b 0x0010E378 : loop again

Simply replace X with the value you want:
  • X=2 gives normal speed,
  • X=3 gives double speed, etc.
Note: I ignored the conditions if(!mode || !shouldUpdate) and if(!skip) to have true 60 FPS.

If you have any questions, feel free to ask.
The logic is the same for all 3DS games.

 
no just follow the first steps x)
it didnt work, i enabled it then as soon as i clicked r the game crashed, i tried taking the "CTRPluginFramework-BlankTemplate.3gx" file out (not the CTRPFData.bin) but it didnt help (this is how the screen looked when it crashed):
thank you anyways btw
IMG_4338.jpg

edit: i deleted the update of pokemon sun so instead of v1.2 now its probably v1.0, it looked like it worked, i enabled it, the clicked r and in the bottom right corner it said "speed 3" or something like that, but the speed of the game didnt actually change, i also tried making it "speed 5" and holding r instead of pressing but it didnt work
 
Last edited by Oran223,
it didnt work, i enabled it then as soon as i clicked r the game crashed, i tried taking the "CTRPluginFramework-BlankTemplate.3gx" file out (not the CTRPFData.bin) but it didnt help (this is how the screen looked when it crashed):
thank you anyways btw
View attachment 573191
edit: i deleted the update of pokemon sun so instead of v1.2 now its probably v1.0, it looked like it worked, i enabled it, the clicked r and in the bottom right corner it said "speed 3" or something like that, but the speed of the game didnt actually change, i also tried making it "speed 5" and holding r instead of pressing but it didnt work
I'll install the game when I have time and try to fix the code x)
 
  • Like
Reactions: Oran223
it didnt work, i enabled it then as soon as i clicked r the game crashed, i tried taking the "CTRPluginFramework-BlankTemplate.3gx" file out (not the CTRPFData.bin) but it didnt help (this is how the screen looked when it crashed):
thank you anyways btw
View attachment 573191
edit: i deleted the update of pokemon sun so instead of v1.2 now its probably v1.0, it looked like it worked, i enabled it, the clicked r and in the bottom right corner it said "speed 3" or something like that, but the speed of the game didnt actually change, i also tried making it "speed 5" and holding r instead of pressing but it didnt work

I reproduced exactly the same code as in Pokémon ORAS, I hook the same function, etc., and I end up with this x')
I’ll try to investigate when I have time.

1779047414259.png
 
  • Like
Reactions: Oran223
I reproduced exactly the same code as in Pokémon ORAS, I hook the same function, etc., and I end up with this x')
I’ll try to investigate when I have time.

View attachment 573464
thank you! also as i said the v1.2 crashed instantly when i clicked r but v1.0 of pokemon sun didn’t crash and it looked like it worked (it said “speed 3”) but the speed of the game didn’t actually change, Do you want me to create a new dump file for v1.0? could that help?
 
thank you! also as i said the v1.2 crashed instantly when i clicked r but v1.0 of pokemon sun didn’t crash and it looked like it worked (it said “speed 3”) but the speed of the game didn’t actually change, Do you want me to create a new dump file for v1.0? could that help?
It doesn’t crash because it’s not hooking the right function, so no, it’s useless. There will be the same issue on version 1.0 x)
 
  • Like
Reactions: Oran223

Site & Scene News

Popular threads in this forum