Pikmin 4 plays at 60 fps and up to 120 on the Mac: Unreal's fixed frame rate takes GEngine from where FEngineLoop::Init makes the engine, in any Unreal 4.22 to 5 build, and the host writes it only while the engine's bUseFixedFrameRate is set

- ue_fixed_rate.py: GEngine is the global the engine is stored into after a reference to the UTF-16 config key "GameEngine" (alone or the tail of "UGameEngine"), loaded back into x0 and followed by a virtual call; xR resolved back through adrp, adrp + add or a GOT slot, and every such store must name one global. bUseFixedFrameRate's byte and bit come from its reflection entry's set-bit function (UE_FIXED_RATE_FLAG). The previous version needed a store of the property through a global, which only Sparking! ZERO's Switch frame pace makes; Pikmin 4 sets it from its config and reads it through this
- hle_fpslock.c / loader.c / dm.h: the fixed frame rate row is written only while the flag is set on the object (an engine stepping by the time that passed, Princess Peach: Showtime!, is left as it is)
- Pikmin 4: fps_target 60, fps_max 120 (GEngine main+0x9fbf880, the property at +0x7a8, the flag bit 0x40 of +0x7a4, read in a run: 0x47 and 30.0); its note, the reference entry, the gallery caption
- Sparking! ZERO: the same GEngine (main+0x9aefa30) and field, now from its engine creation, with the flag at +0x9c4; checked at 120 in a window (119.2-119.4 fps, the write 30 → 120)

Tests: test_ue_fixed_rate (both layouts, page and GOT forms, a store with no reload, two globals), t_fpslock 22-24 (the flag off); docs tests and the lint baseline unchanged. The user played Pikmin 4's prologue at 120 and found it right
This commit is contained in:
seedds committed 2026-11-08 01:43:15 +08:00
1 parent 267ef2d356
commit bd979ced3a
14 files changed
+207 -95

No files matched your search

+1 -1
View File
@@ -225,7 +225,7 @@ Under a game, "60 fps with 1.2.0" means it runs at 60 fps (30 on the console) wi
<td align="center" valign="top" width="33%"><img src="docs/images/persona-5-royal.jpg" width="256" alt="Persona 5 Royal"><br><small><b><a href="dm/games/01005CA01580E000/README.md">Persona 5 Royal</a></b></small></td>
</tr>
<tr>
<td align="center" valign="top" width="33%"><img src="docs/images/pikmin-4.jpg" width="256" alt="Pikmin 4"><br><small><b><a href="dm/games/0100B7C00933A000/README.md">Pikmin 4</a></b></small></td>
<td align="center" valign="top" width="33%"><img src="docs/images/pikmin-4.jpg" width="256" alt="Pikmin 4"><br><small><b><a href="dm/games/0100B7C00933A000/README.md">Pikmin 4</a></b><br>60 fps, up to 120 on the Mac</small></td>
<td align="center" valign="top" width="33%"><img src="docs/images/pokemon-brilliant-diamond.jpg" width="256" alt="Pokémon Brilliant Diamond"><br><small><b><a href="dm/games/0100000011D90000/README.md">Pokémon Brilliant Diamond</a></b><br>60 fps with 1.3.0</small></td>
<td align="center" valign="top" width="33%"><img src="docs/images/pokemon-legends-z-a.jpg" width="256" alt="Pokémon Legends: Z-A"><br><small><b><a href="dm/games/0100F43008C44000/README.md">Pokémon Legends: Z-A</a></b></small></td>
</tr>
+7 -4
View File
@@ -2,7 +2,7 @@
Update 1.1.1 (v262144) over the base game, SDK 10.4.8 (its own `sdk` build). Nintendo EPD / Eighting, Unreal Engine 4.26.2 (`Carrot4`; `SDK MW+EpicGames+UnrealEngine-4_26_2` in `main`), NVN, PhysX 3.4, Wwise (its own `AudioOut` sink, Opus through the host's software decoder), VP9 movies through Unreal's Switch media player and the SDK's movie module. Modules `main`, `subsdk0` (the movie module: the title and the opening are VP9 movies) and `sdk`. Plays on the iPhone (IPA 10.8 GB); 30 fps, as on the Switch.
Status: on the Mac, the boot, the title (a VP9 movie behind the logo), the main menu, a new game (the auto-save notice, players, creature activity level), the opening (the shadow-play story, the cutscenes with Olimar and Moss) and the Olimar prologue in play, Continue from a save; 30 fps as on the Switch, Wwise sound, about 2.6–2.8 GB resident and 1.7 GB of Metal allocations, no red line. The title is up about 25 s after launch. The prewarm list covers that route (806 lines).
Status: on the Mac, the boot, the title (a VP9 movie behind the logo), the main menu, a new game (the auto-save notice, players, creature activity level), the opening (the shadow-play story, the cutscenes with Olimar and Moss) and the Olimar prologue in play, Continue from a save; 60 fps (30 on the Switch), 120 on the Mac when chosen, Wwise sound, about 2.6–2.8 GB resident and 1.7 GB of Metal allocations, no red line. The title is up about 25 s after launch. The prewarm list covers that route (806 lines).
## What it needs
@@ -14,12 +14,14 @@ Status: on the Mac, the boot, the title (a VP9 movie behind the logo), the main
| Engage's 5 GB block: `mem_reserve 0x140000000`, `mem_alias 0x118000000`, `mem_stack 0x10000000`, `app_pool 0xCD500000` | [`game.tsv`](game.tsv) | 256 MB in front + 4.375 GB alias region + 256 MB stack region + 128 MB heap region, as FINAL FANTASY RESONANCE's |
| `sys_resource 0x5000000` | `game.tsv` | the NPDM declares 80 MB of system resource |
| `pad_layout full` | `game.tsv` | a 3D game with a free camera on the right stick; it plays with the controller, so it stays docked (1920x1080) |
| `fps_target 60` | `game.tsv`, `hle_fpslock.c` | the host writes `rhi.SyncInterval` 1 and the engine's fixed frame rate 60 (`dm/tools/ue_fixed_rate.py`, no build ID); see [Frame rate](#frame-rate) |
| `fps_max 120` | `game.tsv` | **Frame rate** offers 120 on the Mac: the user found it right; see [Frame rate](#frame-rate) |
## Frame rate
- **Current:** 30 fps, as on the Switch. The game steps a fixed frame time (`bUseFixedFrameRate=True` in `DefaultEngine.ini`, Unreal's default `FixedFrameRate` of 30) and asks for present interval 2 (`rhi.SyncInterval=2` in `SwitchDeviceProfiles.ini`, `r.VSync=1`), so a faster present rate would speed the game up, not smooth it. No `fps_target`.
- **Open: 60 fps.** [Unreal's fixed frame rate](../../../docs/reference/frame-rate.md#unreals-fixed-frame-rate-found-by-its-reflection-entry) is the way, but the rule cannot reach this game's engine object. The property is at `UEngine+0x7a8` (its reflection entry at `main+0x90ccc10`, `MinDesiredFrameRate` at `+0x908`), and no code stores it through a global. The one load at that offset through a global (`main+0x1689a70`, through `main+0x9350560`) reads another object, which held -980 there in a run on 2026-11-08; the next four globals by hits on `UEngine`'s offsets held no frame rate there either. With `fps_target 60` and only `rhi.SyncInterval` written (1), the game stayed at 30 fps on the Mac (the user, in a window at 120). Finding `GEngine` (for one, through the object `FEngineLoop` stores after making the engine) is the next step.
- **Current:** 60 fps (30 on the Switch), 120 on the Mac when chosen (`fps_max 120`). The game steps a fixed frame time (`bUseFixedFrameRate=True` in `DefaultEngine.ini`, Unreal's default `FixedFrameRate` of 30) and asks for present interval 2 (`rhi.SyncInterval=2` in `SwitchDeviceProfiles.ini`, `r.VSync=1`). The host writes `rhi.SyncInterval` 1 and the engine's fixed frame rate: `main: Unreal fixed frame rate (GEngine->FixedFrameRate) 30 → 120 fps`, at 120 following the hold (60 while a movie plays): [Unreal's fixed frame rate, found by its reflection entry](../../../docs/reference/frame-rate.md#unreals-fixed-frame-rate-found-by-its-reflection-entry). With the rate the step shrinks with the frame, so the game's speed holds; a faster present rate alone would have sped it up.
- `GEngine` is `main+0x9fbf880` (stored where `FEngineLoop::Init` makes the engine, `main+0x9e5f68` and `main+0x9e9224`), `FixedFrameRate` is at `+0x7a8` (its reflection entry at `main+0x90ccc10`) and `bUseFixedFrameRate` is bit 0x40 of `+0x7a4`. Read in a run on 2026-11-08: the flag byte 0x47 and 30.0. The rule's first two versions missed it: a load at the offset through `main+0x9350560` (`main+0x1689a70`) reads another object (-980 there), and no code stores the property through a global.
- **Checked 2026-11-08:** the user played the prologue in a window at 120 with the Metal HUD and sound and found it right: 119.4 fps in most windows of 300 frames, 60–98 in a few (the hold at 60 for a movie and the fades). Not measured with inputs repeated at 30, 60 and 120.
## Memory
@@ -63,6 +65,7 @@ General host changes first needed here; each applies to every game:
- **A network request kept on hold before it settles** (`hle_net.c`, `nn::nifm`): [Network requests stay on hold before they settle](../../../docs/reference/services.md#network-requests-stay-on-hold-before-they-settle).
- **Rewriter:** an `adrp` re-encoded inside a copied exclusive window (`window_adrp`) and gates before a `ret` (`scratch_dead`): [`adrp` inside an exclusive window](../../../docs/reference/rewriter.md#adrp-inside-an-exclusive-window), [Observation gates on any relocatable instruction](../../../docs/reference/rewriter.md#observation-gates-on-any-relocatable-instruction) (the `scratch_dead` rule, removed on 2026-10-31). Spin waits that store (`patch_nso.py` "Spin waits"): [development.md, Power](../../../docs/development.md#power).
- **An Unreal engine region that `-SwitchVirtualAddressSpaceSize=` cannot size**, given what the alias region has room for at its default path's store (`dm/tools/ue_region.py`; a cut in this build's `patches.py` until 2026-10-31): [Unreal's engine address region and its options](../../../docs/reference/memory.md#unreals-engine-address-region-and-its-options).
- **GEngine found where the engine is made, and the fixed frame rate written only while its flag is set** (`ue_fixed_rate.py`, `hle_fpslock.c`): [Unreal's fixed frame rate, found by its reflection entry](../../../docs/reference/frame-rate.md#unreals-fixed-frame-rate-found-by-its-reflection-entry).
## Open
+6
View File
@@ -43,6 +43,12 @@ app_pool 0xCD500000
# the NPDM declares 80 MB of system resource
sys_resource 0x5000000
# ---- Frame rate ----
# 60 fps (30 on the Switch): the game steps a fixed frame time (bUseFixedFrameRate=True), so the host writes GEngine->FixedFrameRate (dm/tools/ue_fixed_rate.py) and rhi.SyncInterval 1
fps_target 60
# 120 on the Mac when chosen: under test (the note's Frame rate)
fps_max 120
# ---- Input ----
# A 3D game with a free camera on the right stick: the 3D pad layout. It plays with the controller, so it stays docked (1920x1080)
pad_layout full
1 # Pikmin 4: Nintendo EPD / Eighting, Unreal Engine 4.26.2 (IoStore containers beside one pak, PhysX 3.4, MallocBinned3), SDK 10.4.8, NVN, Wwise sound, VP9 movies through the SDK's
43 # The shader code archives of Carrot4-Switch.pak (ShaderArchive-*.ushaderbytecode, stored), each shader LZ4-compressed (uepak.py lz4_shaders): the engine's global shaders and the game's fps_max
44 # material shaders. Unreal combines vertex and pixel shaders per draw from its pipeline state, so every vertex shader is made to link with any pixel shader (shader_split.py separable_pairs) # ---- Input ----
45 shader_groups # A 3D game with a free camera on the right stick: the 3D pad layout. It plays with the controller, so it stays docked (1920x1080)
46 pad_layout
47 # ---- Shader split ----
48 # The shader code archives of Carrot4-Switch.pak (ShaderArchive-*.ushaderbytecode, stored), each shader LZ4-compressed (uepak.py lz4_shaders): the engine's global shaders and the game's
49 # material shaders. Unreal combines vertex and pixel shaders per draw from its pipeline state, so every vertex shader is made to link with any pixel shader (shader_split.py separable_pairs)
50 shader_groups
51 shader_note
52
53
54
+1 -1
View File
@@ -224,7 +224,7 @@ One row per profile; the notes are each profile's `README.md`.
| `pso_mtl4` | `on` / `off` (the default): on iOS, render pipelines through MTL4Compiler by default, with the pipeline archive, the prepare step, the hybrid pipelines and the prebuild (on by default on the Mac; `DM_PSO_MTL4=1` / `0` overrides). A setting the game was tested with on an iPhone. It also gives the app the [pipeline archive made offline](../../docs/development.md#the-pipeline-archive-made-offline) (`build_ipa.sh` builds it for the `pso_gpu` key's list when present, else for `g18p`, unless `DM_PSO_GPUS` says otherwise) and the pulling libraries (`_bp`). Profiles with `pso_mtl4 off` get no archive unless a build override selects one. Breath of the Wild sets it on |
| `pso_gpu` | Optional, whitespace-separated GPU architectures: the ones the [pipeline archive made offline](../../docs/development.md#the-pipeline-archive-made-offline) is made for when the profile also sets `pso_mtl4 on`. The bases are made per GPU family and each family's archive costs its own `metal-tt` run, so a profile names exactly the devices it serves. 1-4 tokens, each alphanumeric, with or without the `applegpu_` prefix (for example `g18p applegpu_g19p`); `none` is not a value. Without this key, `pso_mtl4 on` keeps the A19 / A19 Pro default `g18p`; `pso_mtl4 off` gets no archive. The `DM_PSO_GPUS` switch / the NSP script's `--gpu` overrides the archive selection; this key does not enable Metal 4 pipelines |
| `enc_thread` | `on` / `off` (the default): on the Mac, Metal encoding on its own thread by default, as on iOS for every game (`nvn_rec.h` `rec_on`; `DM_NVN_ENC_THREAD=1` / `0` and the launcher's Encode thread override it). For a game that waits on its fence every frame, whose submit thread would otherwise also encode before the wait: Need for Speed: Hot Pursuit Remastered's 60 fps frame took 18.1 ms with encoding on the submit thread and 16.7 on its own |
| `fps_target` | Frame rate cap of the rewriter's frame step, for builds that have one (`FRAME_STEP` in the profile's `patches.py`: Tears of the Kingdom 1.4.3, Breath of the Wild 1.9.0, Hyrule Warriors: Age of Calamity 1.3.0, Paper Mario: The Thousand-Year Door 1.0.1, ASTRAL CHAIN 1.0.1), or the engine's own frame limit the host writes into game memory (`hle_fpslock.c`: Monster Hunter Rise 16.0.2, which also needs `present_interval display`; any Unreal Engine 4.2x / 5 build, its `t.MaxFPS` (or `ue_fps_cvar`) and `rhi.SyncInterval` or `nvn.SyncInterval`, found by name by the rewriter, so the game asks for present interval 1 itself, and its fixed frame rate `GEngine->FixedFrameRate`, found by its reflection entry (DRAGON BALL: Sparking! ZERO's battles); Luigi's Mansion 3 1.4.0, its frame limiter's milliseconds per frame, with `present_interval display`; Pokémon Brilliant Diamond 1.3.0, Unity's integer `Application.targetFrameRate`, also with `present_interval display`; EA SPORTS FC 27, Frostbite's simulation rate, found by name on any build, and on 1.8d.310c its frame regulator, also with `present_interval display`; Fire Emblem Fortune's Weave, a target frame rate the game steps by, found by its readers on any build, so the game asks for present interval 1 itself). `0` (the default): the game's own step. `30` / `60`: the host decides each frame's step in whole vsyncs and keeps the frame on screen that long (`hle_nvn.c` `fstep_tick`, `nvn_fstep.h`): 1 at a 60 cap, 2 when 60 does not hold or at a 30 cap (and while a prerendered movie plays), plus one vsync while the game is behind real time after a late frame. Presents follow that hold instead of the interval the game sets. `DM_FPS_TARGET` overrides it, also from `Documents/env.txt`; the log line `frame step: game time … of real time` checks the game's speed. A derived profile (`derive_profile`) whose `main` has no `FRAME_STEP` stubs, while the profile has them for other builds, gets `fps_target 0`: without the stubs the host would present every vsync and the game would run at double speed. On a main with neither a frame step nor an engine limit the host writes, the host keeps the game's own present interval whatever `fps_target` or `DM_FPS_TARGET` says (`hle_fpslock.c` `dm_fps_lock_engine`) |
| `fps_target` | Frame rate cap of the rewriter's frame step, for builds that have one (`FRAME_STEP` in the profile's `patches.py`: Tears of the Kingdom 1.4.3, Breath of the Wild 1.9.0, Hyrule Warriors: Age of Calamity 1.3.0, Paper Mario: The Thousand-Year Door 1.0.1, ASTRAL CHAIN 1.0.1), or the engine's own frame limit the host writes into game memory (`hle_fpslock.c`: Monster Hunter Rise 16.0.2, which also needs `present_interval display`; any Unreal Engine 4.2x / 5 build, its `t.MaxFPS` (or `ue_fps_cvar`) and `rhi.SyncInterval` or `nvn.SyncInterval`, found by name by the rewriter, so the game asks for present interval 1 itself, and its fixed frame rate `GEngine->FixedFrameRate`, found by its reflection entry and written while the engine's `bUseFixedFrameRate` is set (DRAGON BALL: Sparking! ZERO's battles, Pikmin 4); Luigi's Mansion 3 1.4.0, its frame limiter's milliseconds per frame, with `present_interval display`; Pokémon Brilliant Diamond 1.3.0, Unity's integer `Application.targetFrameRate`, also with `present_interval display`; EA SPORTS FC 27, Frostbite's simulation rate, found by name on any build, and on 1.8d.310c its frame regulator, also with `present_interval display`; Fire Emblem Fortune's Weave, a target frame rate the game steps by, found by its readers on any build, so the game asks for present interval 1 itself). `0` (the default): the game's own step. `30` / `60`: the host decides each frame's step in whole vsyncs and keeps the frame on screen that long (`hle_nvn.c` `fstep_tick`, `nvn_fstep.h`): 1 at a 60 cap, 2 when 60 does not hold or at a 30 cap (and while a prerendered movie plays), plus one vsync while the game is behind real time after a late frame. Presents follow that hold instead of the interval the game sets. `DM_FPS_TARGET` overrides it, also from `Documents/env.txt`; the log line `frame step: game time … of real time` checks the game's speed. A derived profile (`derive_profile`) whose `main` has no `FRAME_STEP` stubs, while the profile has them for other builds, gets `fps_target 0`: without the stubs the host would present every vsync and the game would run at double speed. On a main with neither a frame step nor an engine limit the host writes, the host keeps the game's own present interval whatever `fps_target` or `DM_FPS_TARGET` says (`hle_fpslock.c` `dm_fps_lock_engine`) |
| `fps_max` | `60` (the default) or `120`: the highest rate `fps_target` and the player's **Frame rate** take. `120` only for a game with an engine limit the host writes and whose speed was measured at 120 against 60 over the same inputs: the target then follows the frames that fit, 120 or 60 ([120 fps follows the frame step](../../docs/reference/frame-rate.md#120-fps-follows-the-frame-step)). |
| `fps_hold` | `on` (the default): with `fps_target`, three late frames in a row raise the hold above the cap's vsyncs (30 or 20 fps), and steady frames that fit try the lower hold again. `off`: frames are never held longer than the cap's vsyncs; each is shown as soon as it is ready. For a game whose updates do not wait for the presents and step by the cap whatever the hold (Age of Calamity): there the hold only paces the screen. `DM_FPS_HOLD=on` / `off` overrides it, also from `Documents/env.txt` Paper Mario: The Thousand-Year Door sets it off too: its frame waits for three render worker threads, and holding frames left them idle, so a frame cost more the longer the hold (the hold stuck at 3 vsyncs, 20 fps, on a loaded Mac; 32–58 fps without holds) |
| `ue_fps_cvar` | Unreal Engine games: the console variable the host writes `fps_target` into (`hle_fpslock.c`). `t.MaxFPS` (the default) is the engine's frame limit; a game whose settings apply a variable of its own to `t.MaxFPS` names that one, or the next settings change sets the game's 30 again (SHIN MEGAMI TENSEI V: Vengeance: `Project.FrameRateLimit`). The rewriter finds it by its registered name, so a name set here must be in `dm/tools/ue_cvar.py`'s `NAMES` (a red line otherwise): [Unreal's frame limit and present interval, found by name](../../docs/reference/frame-rate.md#unreals-frame-limit-and-present-interval-found-by-name) |
+1
View File
@@ -57,6 +57,7 @@ typedef struct {
uint32_t fps_target_field;
uint64_t ue_fixed_ptr; // Unreal's GEngine (main's offset of the global) and UEngine::FixedFrameRate in it, a float (patch_nso.py, ue_fixed_rate.py; hle_fpslock.c); 0 = none
uint32_t ue_fixed_field;
uint32_t ue_fixed_flag; // bUseFixedFrameRate in UEngine: byte offset << 8 | bit mask; the rate is written only while it is set
uint64_t fps_state_off; // frame step state page (patch_nso.py FRAME_STEP: Tears of the Kingdom 1.4.3 and Breath of the Wild 1.9.0 main); 0 = none
int64_t patch_off; // patch area relative to the base; negative = before the base (image too large, see patch_nso.py FAR), and size does not include it
uint64_t image_size, file_image_len, patch_len; // only with the patch area before the base: whole image (with bss and key page), length of the image part of the file, patch area length
+6 -4
View File
@@ -6,8 +6,9 @@
// the frame limit, the profile's ue_fps_cvar (t.MaxFPS, or a game's own variable its settings apply to t.MaxFPS: SHIN MEGAMI TENSEI V: Vengeance's Project.FrameRateLimit), and the
// present interval, rhi.SyncInterval (nvn.SyncInterval in UE 4.18's Switch RHI: DRAGON QUEST XI S). Each is a TAutoConsoleVariable whose +0x10 points to its value, the game thread's
// copy then the render thread's. The games' configs set the limit to 30 and the interval to 2 (their notes name the .ini files). An engine with a fixed frame rate (bUseFixedFrameRate) steps
// by and holds to UEngine::FixedFrameRate instead, which the rewriter finds through its reflection entry and GEngine (dm/tools/ue_fixed_rate.py, main's fixups UE_FIXED_RATE_PTR / _FIELD):
// DRAGON BALL: Sparking! ZERO's battles, which Unreal's Switch frame pace sets to 30. The engine reads it only while the fixed frame rate is on, so writing it changes nothing on the others
// by and holds to UEngine::FixedFrameRate instead, which the rewriter finds through its reflection entry and GEngine where the engine is made (dm/tools/ue_fixed_rate.py, main's fixups
// UE_FIXED_RATE_PTR / _FIELD / _FLAG): DRAGON BALL: Sparking! ZERO's battles and Pikmin 4. It is written only while the object's bUseFixedFrameRate is set (_FLAG), so an engine stepping by
// the time that passed is left as it is
#include "hle.h"
#include <mach/mach.h>
@@ -23,7 +24,7 @@
enum { FPS_F32, VSYNCS_I32, MS_F32, FPS_I32, TICKS_U32, SECS_F32, MODE_U32, FPS_F64 };
#define MS_MARGIN 0.5f
static float ms_want(int fps) { return 1000.0f / (float)fps - (fps == 60 ? MS_MARGIN : 0); }
typedef struct { const char *build, *what; uint64_t ptr_off; uint32_t field; uint8_t kind, copies; uint32_t scale; } lock_t;
typedef struct { const char *build, *what; uint64_t ptr_off; uint32_t field; uint8_t kind, copies; uint32_t scale; uint32_t flag; } lock_t; // flag: byte offset << 8 | bit mask the object must have set for the write (0: none)
static const lock_t k_locks[] = {
// Pokemon Brilliant Diamond 1.3.0: Unity's Application.targetFrameRate. Its icall registration (main+0xe34e60) resolves to main+0xdc8e70 -> +0x5fa640,
// which stores w0 at main+0x4afc868; the getter at +0x5fa630 reads the same int32. The game sets 30 when entering the field; display pacing alone does not remove that cap.
@@ -196,7 +197,7 @@ static int target_row(const module_t *m, lock_t *out) {
// not an Unreal main). *missing: an Unreal main (the rewriter found some of its variables) without the profile's frame-limit variable
static int ue_rows(const module_t *m, lock_t *out, int *missing) {
static char what[4][48]; int n = 0, have = 0;
if (m->ue_fixed_ptr) out[n++] = (lock_t){ "", "Unreal fixed frame rate (GEngine->FixedFrameRate)", m->ue_fixed_ptr, m->ue_fixed_field, FPS_F32, 1, 0 };
if (m->ue_fixed_ptr && m->ue_fixed_flag) out[n++] = (lock_t){ "", "Unreal fixed frame rate (GEngine->FixedFrameRate)", m->ue_fixed_ptr, m->ue_fixed_field, FPS_F32, 1, 0, m->ue_fixed_flag };
for (int k = 0; k < m->n_ue_cvar && n < 4; k++) {
const char *name = m->ue_cvar[k].name; int fps = !strcmp(name, DM_GAME_UE_FPS_CVAR);
if (!fps && strcmp(name, "rhi.SyncInterval") && strcmp(name, "nvn.SyncInterval")) continue;
@@ -270,6 +271,7 @@ void dm_fps_lock_tick(void) {
for (int r = 0; r < nrow; r++) {
const lock_t *L = rows[r]; uint64_t obj = (uint64_t)(uintptr_t)base;
if (L->ptr_off && (!rd((uint64_t)(uintptr_t)(base + L->ptr_off), &obj, sizeof obj) || !obj)) continue; // not created yet
if (L->flag) { uint8_t b; if (!rd(obj + (L->flag >> 8), &b, 1) || !(b & (L->flag & 0xff))) continue; } // the object's flag is off (Unreal: no fixed frame rate in use)
if (L->kind == FPS_F64) {
for (int c = 0; c < L->copies; c++) {
uint64_t a = obj + L->field + 8 * (uint64_t)c; double cur, want = target;
+1
View File
@@ -271,6 +271,7 @@ static void read_layout(module_t *m, const char *dir) {
else if (!strcmp(key, "FPS_TARGET_FIELD")) m->fps_target_field = (uint32_t)v;
else if (!strcmp(key, "UE_FIXED_RATE_PTR")) m->ue_fixed_ptr = v;
else if (!strcmp(key, "UE_FIXED_RATE_FIELD")) m->ue_fixed_field = (uint32_t)v;
else if (!strcmp(key, "UE_FIXED_RATE_FLAG")) m->ue_fixed_flag = (uint32_t)v;
else if (!strncmp(key, "UE_CVAR:", 8)) {
if (m->n_ue_cvar == (int)(sizeof m->ue_cvar / sizeof *m->ue_cvar) || strlen(key + 8) >= sizeof m->ue_cvar[0].name) die("%s: too many Unreal console variables, or too long a name: %s", path, key);
strcpy(m->ue_cvar[m->n_ue_cvar].name, key + 8); m->ue_cvar[m->n_ue_cvar++].off = v;
+8 -3
View File
@@ -52,7 +52,7 @@ static void check(int which) {
assert(base != MAP_FAILED);
g_nmod = 1; strcpy(g_mod[0].name, "main"); g_mod[0].base = base;
strcpy(g_mod[0].build_id, "94ceae325c205c4b9d6f7235552f28fd");
setenv("DM_FPS_TARGET", which == 22 ? "60" : which >= 19 ? "120" : which == 1 || which == 10 || which == 18 ? "30" : which == 2 || which == 11 ? "0" : "60", 1);
setenv("DM_FPS_TARGET", which == 22 || which == 24 ? "60" : which >= 19 ? "120" : which == 1 || which == 10 || which == 18 ? "30" : which == 2 || which == 11 ? "0" : "60", 1);
if (which == 20) test_fps_max = 60;
int32_t *unity = (int32_t *)(base + 0x4afc868);
*unity = which == 1 ? 60 : which == 4 ? -1 : which == 5 ? 0 : 30;
@@ -89,7 +89,8 @@ static void check(int which) {
*(uintptr_t *)(base + 0x7b32690 + 0x10) = (uintptr_t)(object + 16);
f = (float *)object; f[0] = f[1] = 30;
sync = (int32_t *)(object + 16); sync[0] = sync[1] = 2;
} else if (which == 22 || which == 23) { // DRAGON BALL: Sparking! ZERO: GEngine->FixedFrameRate (+0x9c8), which the Switch frame pace sets to 30, and the present interval
} else if (which == 22 || which == 23 || which == 24) { // DRAGON BALL: Sparking! ZERO: GEngine->FixedFrameRate (+0x9c8), which the Switch frame pace sets to 30, and the present interval;
// bUseFixedFrameRate (bit 0x40 of +0x9c4) set, except in 24 (an engine stepping by the time that passed, Princess Peach: Showtime!)
strcpy(g_mod[0].build_id, "0123456789abcdef0123456789abcdef");
cvar(DM_GAME_UE_FPS_CVAR, 0x7c738d0); cvar("rhi.SyncInterval", 0x7b32690); // t.MaxFPS registered but never set: 0 stays
*(uintptr_t *)(base + 0x7b32690 + 0x10) = (uintptr_t)(object + 16);
@@ -97,6 +98,9 @@ static void check(int which) {
g_mod[0].ue_fixed_ptr = 0x9aefa30; g_mod[0].ue_fixed_field = 0x9c8;
*(uintptr_t *)(base + 0x9aefa30) = (uintptr_t)(object + 0x100) - 0x9c8; // the engine object, placed so its field at +0x9c8 lands inside object
f = (float *)(object + 0x100); *f = 30;
g_mod[0].ue_fixed_flag = 0x9c4 << 8 | 0x40;
if (which != 24) object[0x100 - 4] = 0x47; // the flag byte at +0x9c4, bit 0x40 set among others (Pikmin 4: 0x47)
else object[0x100 - 4] = 0x07;
} else if (which == 17 || which == 18 || which == 19 || which == 20) { // Fire Emblem Fortune's Weave: the target the rewriter found, 30 in gameplay (17) or 60 in a menu (18, at DM_FPS_TARGET=30)
strcpy(g_mod[0].build_id, "0123456789abcdef0123456789abcdef");
g_mod[0].fps_target_ptr = 0x21e60d8; g_mod[0].fps_target_field = 0x1dc;
@@ -126,6 +130,7 @@ static void check(int which) {
*f = 30; dm_fps_lock_tick(); assert(*f == 60 && writes == 4);
munmap(base, len); return;
}
if (which == 24) { assert(*f == 30 && sync[0] == 1 && sync[1] == 1 && writes == 2); munmap(base, len); return; } // flag off: the rate is left, the interval written
if (which == 23) { // 120: the fixed rate follows the hold, the interval stays one vsync
assert(*f == 120 && sync[0] == 1 && sync[1] == 1);
test_high = 60; dm_fps_lock_tick(); assert(*f == 60);
@@ -178,7 +183,7 @@ static void check(int which) {
int main(void) {
// Each process starts the production one-time initialization with a fresh build and target.
for (int i = 0; i < 24; i++) {
for (int i = 0; i < 25; i++) {
pid_t p = fork(); assert(p >= 0);
if (!p) { check(i); _exit(0); }
int status; assert(waitpid(p, &status, 0) == p); assert(WIFEXITED(status) && WEXITSTATUS(status) == 0);
+4 -4
View File
@@ -169,10 +169,10 @@ FPS_TARGET_PTR, FPS_TARGET_FIELD, fps_target_why = fps_target.find(bytes(IMG), T
if FPS_TARGET_PTR is not None: print(f'{NAME}: {fps_target_why} (fps_target.py)')
elif fps_target_why.startswith('[RED] '): print(f'[RED] {NAME}: {fps_target_why[6:]}: the host cannot write it')
# ---- Unreal's fixed frame rate (main: dm/tools/ue_fixed_rate.py finds UEngine::FixedFrameRate by its reflection entry and GEngine by the code that reaches it, without a build ID) ----
# The fixups table names GEngine's offset and the property's (UE_FIXED_RATE_PTR, UE_FIXED_RATE_FIELD); the host writes the profile's fps_target there (hle_fpslock.c)
# ---- Unreal's fixed frame rate (main: dm/tools/ue_fixed_rate.py finds UEngine::FixedFrameRate and bUseFixedFrameRate by their reflection entries and GEngine where the engine is made, without a build ID) ----
# The fixups table names GEngine's offset, the property's and the flag's (UE_FIXED_RATE_PTR, UE_FIXED_RATE_FIELD, UE_FIXED_RATE_FLAG); the host writes the profile's fps_target there while the flag is set (hle_fpslock.c)
import ue_fixed_rate
UE_FIXED_PTR, UE_FIXED_FIELD, ue_fixed_why = ue_fixed_rate.find(bytes(IMG), TEXT_END, RO_OFF, DATA_OFF) if NAME == 'main' and UE_CVARS else (None, None, '')
UE_FIXED_PTR, UE_FIXED_FIELD, UE_FIXED_FLAG, ue_fixed_why = ue_fixed_rate.find(bytes(IMG), TEXT_END, RO_OFF, DATA_OFF) if NAME == 'main' and UE_CVARS else (None, None, None, '')
if UE_FIXED_PTR is not None: print(f'{NAME}: {ue_fixed_why} (ue_fixed_rate.py)')
elif ue_fixed_why.startswith('[RED] '): print(f'[RED] {NAME}: {ue_fixed_why[6:]}: the host cannot write it')
@@ -1879,7 +1879,7 @@ with open(P('fixups.tsv'), 'w') as f:
if FS_STATE_OFF: f.write(f'# FPS_STATE_OFF\t{FS_STATE_OFF:#x}\n') # frame step state page (FRAME_STEP): the loader writes the target fps there
if UE_CALLS: f.write(f'# UE_MALLOC_VT\t{UE_VT:#x}\n# UE_MALLOC_SLOT\t{UE_SLOT:#x}\n') # Unreal's FMallocBinned3 (ue_malloc.py): its vtable and the slot of its name getter, which names the slot layout
if FPS_TARGET_PTR is not None: f.write(f'# FPS_TARGET_PTR\t{FPS_TARGET_PTR:#x}\n# FPS_TARGET_FIELD\t{FPS_TARGET_FIELD:#x}\n') # a target frame rate the game steps by (fps_target.py)
if UE_FIXED_PTR is not None: f.write(f'# UE_FIXED_RATE_PTR\t{UE_FIXED_PTR:#x}\n# UE_FIXED_RATE_FIELD\t{UE_FIXED_FIELD:#x}\n') # Unreal's GEngine and UEngine::FixedFrameRate (ue_fixed_rate.py)
if UE_FIXED_PTR is not None: f.write(f'# UE_FIXED_RATE_PTR\t{UE_FIXED_PTR:#x}\n# UE_FIXED_RATE_FIELD\t{UE_FIXED_FIELD:#x}\n# UE_FIXED_RATE_FLAG\t{UE_FIXED_FLAG:#x}\n') # Unreal's GEngine, UEngine::FixedFrameRate and bUseFixedFrameRate (ue_fixed_rate.py)
for n, o in UE_CVARS.items(): f.write(f'# UE_CVAR:{n}\t{o:#x}\n') # Unreal console variables (ue_cvar.py): the TAutoConsoleVariable registered under each name
if RENDER_SCALE: f.write('# RENDER_SCALE\t1\n') # a render-scale stub reads state +0x10 (the loader ignores the key; dm/games/settings.py offers the setting by it)
if NAME == 'main':
+42 -33
View File
@@ -1,38 +1,48 @@
"""Unreal's UEngine::FixedFrameRate found by its reflection entry and GEngine by the code that reaches it (dm/tools/ue_fixed_rate.py), on synthetic images, no game files: the offset after
the array size (UE 4.22-5.0) and after a setter and a getter (UE 5.1+, DRAGON BALL: Sparking! ZERO), the name shared with bUseFixedFrameRate's tail, GEngine through its GOT slot, no code
reaching it (nothing, no red line), two globals (red), and an entry of another kind (not taken), and a load alone (no proof: Pikmin 4's coincides with another object's field)."""
"""Unreal's UEngine::FixedFrameRate and bUseFixedFrameRate found by their reflection entries and GEngine where FEngineLoop::Init makes the engine (dm/tools/ue_fixed_rate.py), on
synthetic images, no game files: the offset after the array size (UE 4.22-5.0, Pikmin 4) and after a setter and a getter (UE 5.1+, DRAGON BALL: Sparking! ZERO), the name shared with
bUseFixedFrameRate's tail, the flag from its set-bit function, GEngine as a page plus offset (Pikmin 4) and through a GOT slot (Sparking! ZERO, the key the tail of "UGameEngine"), a store
with no reload or virtual call after it (not taken), two creations naming different globals (red), and an entry of another kind (not taken)."""
import struct
import sys
import unittest
from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
from nso_asm import ADRP, LDRX
from nso_asm import ADRP, ADDI, LDRX, STRX
import ue_fixed_rate
RET = 0xd65f03c0
RET, NOP = 0xd65f03c0, 0xd503201f
TEXT, RO, DATA, END = 0x8000, 0x8000, 0xa000, 0xc000
MOD0, DYN, RELA, NAME, ENTRY, GOT, GOT2, GENGINE, OTHER, FIELD = 0x40, 0x9000, 0x9100, 0x8100, 0xa100, 0xa200, 0xa208, 0xa5d8, 0xa600, 0x9c8
MOD0, DYN, RELA, NAME, KEY, ENTRY, BOOL, GOT, GENGINE, OTHER, FIELD, SETBIT = 0x40, 0x9000, 0x9100, 0x8100, 0x8200, 0xa100, 0xa180, 0xa200, 0xa5d8, 0xa608, 0x9c8, 0x3000
def ldr_s(t, n, off): return 0xBD400000 | (off // 4) << 10 | n << 5 | t
def str_s(t, n, off): return 0xBD000000 | (off // 4) << 10 | n << 5 | t
def blr(n): return 0xD63F0000 | n << 5
def creation(at, base, got, lo=0):
"""FEngineLoop::Init in miniature at word offset at: the key's address into x2, a call, the new object stored at [x25, #lo] (x25 the page of base, or the address its GOT slot
holds), a call, the reload into x0 and a virtual call"""
load = [ADRP(25, at, GOT), LDRX(25, 25, (GOT & 0xfff) // 8)] if got else [ADRP(25, at, base)]
a = at + 4 * len(load)
return load + [ADRP(2, a, KEY), ADDI(2, 2, KEY & 0xfff), 0x94000000, NOP, STRX(0, 25, lo // 8), 0x94000000,
LDRX(0, 25, lo // 8), LDRX(8, 0), LDRX(8, 8, 0x298 // 8), blr(8), RET]
def image(ue51=True, kind=ue_fixed_rate.FLOAT, users=(GOT,), store=True):
"""main with the name, its reflection entry and code that loads GEngine from each GOT slot of users and stores (or loads) a float at FIELD"""
def image(ue51=True, kind=ue_fixed_rate.FLOAT, creations=((GENGINE, False),), reload=True, tail=False):
img = bytearray(END)
struct.pack_into('<I', img, 4, MOD0); img[MOD0:MOD0 + 4] = b'MOD0'; struct.pack_into('<i', img, MOD0 + 4, DYN - MOD0)
img[NAME:NAME + 19] = b'bUseFixedFrameRate\0' # the linker shares "FixedFrameRate" with its tail: NAME + 4
img[ENTRY + 24] = kind; struct.pack_into('<i', img, ENTRY + 32, 1)
struct.pack_into('<I', img, ENTRY + (56 if ue51 else 36), FIELD)
rel = [(ENTRY, NAME + 4), (GOT, GENGINE), (GOT2, OTHER)] # R_AARCH64_RELATIVE: the entry's name, the GOT slots of GEngine and of another global
img[NAME:NAME + 19] = b'bUseFixedFrameRate\0' # "FixedFrameRate" is its tail: NAME + 4
key = ('UGameEngine' if tail else 'GameEngine').encode('utf-16-le') + b'\0\0'
k0 = KEY - (2 if tail else 0); img[k0:k0 + len(key)] = key # Sparking! ZERO: the key is the tail of "UGameEngine"
img[ENTRY + 24] = kind; struct.pack_into('<i', img, ENTRY + 32, 1); struct.pack_into('<I', img, ENTRY + (56 if ue51 else 36), FIELD)
img[BOOL + 24] = 0x0C; struct.pack_into('<i', img, BOOL + 32, 1)
struct.pack_into('<4I', img, SETBIT, 0x39400000 | 0x9c4 << 10 | 8, 0x32000000 | 26 << 16 | 8 << 5 | 8, 0x39000000 | 0x9c4 << 10 | 8, RET) # ldrb / orr #0x40 / strb / ret
rel = [(ENTRY, NAME + 4), (BOOL, NAME), (BOOL + 0x48, SETBIT), (GOT, GENGINE)] # R_AARCH64_RELATIVE: names, the set-bit function, GEngine's GOT slot
struct.pack_into('<qQqQqQ', img, DYN, 7, RELA, 8, 24 * len(rel), 0, 0)
for k, (at, v) in enumerate(rel): struct.pack_into('<QQq', img, RELA + 24 * k, at, 1027, v)
at = 0x1000
for slot in users:
words = [ADRP(8, at, slot), LDRX(8, 8, (slot & 0xfff) // 8), LDRX(8, 8), (str_s if store else ldr_s)(0, 8, FIELD), RET]
struct.pack_into('<' + 'I' * len(words), img, at, *words); at += 0x40
for g, got in creations:
words = creation(at, g & ~0xfff, got, 0 if got else g & 0xfff)
if not reload: words[-5] = NOP # no load of GEngine back into x0
struct.pack_into('<' + 'I' * len(words), img, at, *words); at += 0x100
return img
@@ -40,31 +50,30 @@ def find(img): return ue_fixed_rate.find(bytes(img), TEXT, RO, DATA)
class FindTest(unittest.TestCase):
def test_ue51_layout(self):
g, f, why = find(image())
self.assertEqual((g, f), (GENGINE, FIELD), why)
def test_ue51_layout_through_the_got_slot(self): # Sparking! ZERO
g, f, fl, why = find(image(creations=((GENGINE, True),), tail=True))
self.assertEqual((g, f, fl), (GENGINE, FIELD, 0x9c4 << 8 | 0x40), why)
def test_ue4_layout(self):
g, f, why = find(image(ue51=False))
self.assertEqual((g, f), (GENGINE, FIELD), why)
def test_ue4_layout_page_and_offset(self): # Pikmin 4: str x0, [x19, #0x880] with x19 the page
g, f, fl, why = find(image(ue51=False))
self.assertEqual((g, f, fl), (GENGINE, FIELD, 0x9c4 << 8 | 0x40), why)
def test_a_load_alone_is_no_proof(self): # Pikmin 4: a load at the offset through another object's global (a gravity of -980 there)
g, f, why = find(image(store=False))
def test_two_creations_naming_one_global(self):
g, f, fl, why = find(image(creations=((GENGINE, False), (GENGINE, True))))
self.assertEqual(g, GENGINE, why)
def test_a_store_without_its_reload_is_no_creation(self):
g, f, fl, why = find(image(reload=False))
self.assertIsNone(g)
self.assertFalse(why.startswith('[RED] '), why)
def test_no_code_reaches_it(self): # Princess Peach: Showtime!: the fixed frame rate stays the config's, and that is no red line
g, f, why = find(image(users=()))
self.assertIsNone(g)
self.assertFalse(why.startswith('[RED] '), why)
def test_two_globals_are_red(self):
g, f, why = find(image(users=(GOT, GOT2)))
def test_creations_naming_two_globals_are_red(self):
g, f, fl, why = find(image(creations=((GENGINE, False), (OTHER, False))))
self.assertIsNone(g)
self.assertTrue(why.startswith('[RED] ') and 'more than one global' in why, why)
def test_an_entry_of_another_kind(self): # bUseFixedFrameRate's own entry is a bool (0x0C)
g, f, why = find(image(kind=0x0C))
g, f, fl, why = find(image(kind=0x0C))
self.assertIsNone(g)
self.assertEqual(why, 'no UEngine::FixedFrameRate')
+110 -30
View File
@@ -2,27 +2,40 @@
"""Unreal Engine's fixed frame rate, UEngine::FixedFrameRate on the engine object GEngine points to, found in main without a build ID: patch_nso.py writes its place into main's fixups
(UE_FIXED_RATE_PTR, GEngine's offset in main, and UE_FIXED_RATE_FIELD, the property's offset in UEngine), and the host writes the profile's fps_target there (hle_fpslock.c).
With bUseFixedFrameRate on, the engine steps every frame by exactly 1 / FixedFrameRate seconds and holds its tick to that rate, whatever rhi.SyncInterval and t.MaxFPS say
(ue_cvar.py). Unreal's Switch frame pace sets both: DRAGON BALL: Sparking! ZERO (UE 5.1.1, main+0x1e1e904) caches rhi.SyncInterval, sets it to 1 for its 60 fps mode and 2 for the others,
then stores {30, 24, 60}[mode] into GEngine->FixedFrameRate; its config turns the fixed frame rate on (bUseFixedFrameRate=True, FixedFrameRate=30), so its battles stayed at 30 with
the present interval raised. The value is the frame rate, so the game's speed holds at any rate, as far as the game's own code steps by the engine's delta time.
The chain, each link unique or nothing is written:
(ue_cvar.py). DRAGON BALL: Sparking! ZERO (UE 5.1.1) and Pikmin 4 (UE 4.26.2) turn it on in their configs (bUseFixedFrameRate=True; 30, set by Sparking! ZERO's config and Unreal's
Switch frame pace, main+0x1e1e904, and Pikmin 4's by the engine's default), so their gameplay stayed at 30 with the present interval raised. The value is the frame rate, so the game's speed
holds at any rate, as far as the game's own code steps by the engine's delta time. Both links hold in any Unreal 4.22 to 5 build, each unique or nothing is written:
- the property's reflection entry: the data word holding the address of its UTF-8 name "FixedFrameRate" (the module's relative relocations applied; the linker may share the string with the
tail of "bUseFixedFrameRate"), whose generated-property kind is Float (0x0A at +24) and whose array size is 1 (+32). The offset follows the array size (+36, Unreal Engine 4.22 to 5.0)
or, from Unreal Engine 5.1 on, a setter and a getter pointer after it (+56): Sparking! ZERO's is 0x9c8, at +56;
- GEngine: the one global through which main's code stores a float at that offset (str sT, [xB, #field], xB loaded from the global: fps_target.globals_of), the engine or the game
setting the rate (Sparking! ZERO's frame pace, main+0x1e1ea04). A load alone proves nothing: Pikmin 4 (UE 4.26, the property at +0x7a8) has one through main+0x9350560, whose object
holds -980 there (a gravity), not its engine's 30; the offset only coincides. Such a main gets no fixups, and the host writes nothing.
tail of "bUseFixedFrameRate"), whose generated-property kind is Float (0x0A at +24) and whose array size is 1 (+32). The offset follows the array size (+36, Unreal Engine 4.22 to 5.0:
Pikmin 4's 0x7a8) or, from Unreal Engine 5.1 on, a setter and a getter pointer after it (+56: Sparking! ZERO's 0x9c8);
- GEngine, where FEngineLoop::Init makes the engine: it reads the engine class from the config key TEXT("GameEngine") (UTF-16; Sparking! ZERO's linker shares it with the tail of
"UGameEngine"), makes the object and stores it into GEngine (str xV, [xR, #lo]), then loads it back and makes a virtual call on it (ParseCommandline: ldr x0, [xR, #lo], then a blr).
xR is the global's page (adrp; Pikmin 4: main+0x9fbf000 + 0x880), that plus an offset (adrp + add), or the address a GOT slot holds (adrp + ldr; Sparking! ZERO: the slot main+0x8dbfb40
→ main+0x9aefa30). Every reference with that shape must name the same global. Until 2026-11-08 the rule took the global through which code stores the property, which only Sparking! ZERO's
frame pace does (main+0x1e1ea04), and before that any global through which code reached the offset: Pikmin 4's one load there (main+0x1689a70) reads another object
(main+0x9350560, -980 at +0x7a8), and the host's range check refused it.
- the flag bUseFixedFrameRate, a bitfield bool: its reflection entry (kind Bool, 0x0C) holds the function that sets it on an object (ldrb w, [x0, #byte]; orr w, w, #bit; strb; ret:
Sparking! ZERO +0x9c4, Pikmin 4 and Princess Peach: Showtime! +0x7a4, bit 0x40). The host writes the rate only while the flag is set on the object, so a game whose engine steps by the
time that passed (Princess Peach: Showtime!, at 60 by the present interval alone) is left as it is, and an object that is not the engine would also need the flag's bit and a frame rate.
Usage on its own: ue_fixed_rate.py <module>... (what it finds in each)"""
import struct, sys, os
import re, struct, sys, os
NAME = b'FixedFrameRate\0'
FLOAT = 0x0A # EPropertyGenFlags::Float (Unreal Engine 4.22 and later)
KEY = 'GameEngine'.encode('utf-16-le') + b'\0\0' # FEngineLoop::Init's config key for the engine class
STORE_REACH, RELOAD_REACH, CALL_REACH, BACK_REACH = 0x100, 8, 6, 0x4000 # bytes after the key's reference; instructions to the reload and from it to the call; bytes back to xR's value
def relocated(img):
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from loader_census import got_values
return got_values(img)
def adrp_page(w, pc):
imm = ((((w >> 5) & 0x7FFFF) << 2) | ((w >> 29) & 3)) << 12
if imm & (1 << 32): imm -= 1 << 33
return (pc & ~0xFFF) + imm
def is_adrp(w): return (w & 0x9F000000) == 0x90000000
def fields(img, ro_off, data_off, rel):
"""{reflection entry offset: the property's offset in its class} of the float properties named FixedFrameRate"""
names, s = [], img.find(NAME, ro_off, data_off)
@@ -36,28 +49,95 @@ def fields(img, ro_off, data_off, rel):
if f and f % 4 == 0 and f < 0x4000: out[o] = f
return out
def flag(img, text_end, ro_off, data_off, rel):
"""(byte offset, bit mask) of bUseFixedFrameRate in UEngine, from the set-bit function of its reflection entry, or None"""
s = img.find(b'bUseFixedFrameRate\0', ro_off, data_off)
word = lambda a: struct.unpack_from('<I', img, a)[0]
for o, v in rel.items():
if v != s or o < data_off or img[o + 24] != 0x0C: continue
fn = next((rel[k] for k in range(o + 8, o + 0x50, 8) if 0 < rel.get(k, 0) < text_end), None)
if fn is None: continue
ld, orr, st, ret = (word(fn + 4 * k) for k in range(4))
if (ld & 0xFFC003E0) != 0x39400000 or st != (ld & ~0x00400000) or ret != 0xD65F03C0: continue # ldrb wA, [x0, #off] / strb wA, [x0, #off] / ret
a = ld & 31
if (orr & 0xFFC003FF) != (0x32000000 | a << 5 | a) or (orr >> 10) & 0x3F: continue # orr wA, wA, #(one bit): N 0, imms 0
mask = 1 << ((32 - ((orr >> 16) & 0x3F)) % 32)
if mask < 0x100: return (ld >> 10) & 0xFFF, mask
return None
def key_refs(img, text_end, ro_off, data_off):
"""Word offsets of the add xD, xN, #lo that make the address of a UTF-16 "GameEngine" (alone or a longer string's tail) after an adrp xN of its page"""
word = lambda a: struct.unpack_from('<I', img, a)[0]
out = []
s = img.find(KEY, ro_off, data_off)
while s >= 0:
if s % 2 == 0:
lo = s & 0xFFF
b1 = b''.join(re.escape(bytes([(lo & 0x3F) << 2 | r])) for r in range(4)) # imm bits 0-5 and the top two bits of Xn (ue_cvar.py)
for m in re.finditer(rb'(?=[' + b1 + rb']' + re.escape(bytes([lo >> 6])) + rb'\x91)', img[:text_end]):
j = m.start() - 1
if j % 4 or j < 0: continue
w = word(j)
if (w & 0xFFC00000) != 0x91000000 or (w >> 10) & 0xFFF != lo: continue
n = (w >> 5) & 31
if any(is_adrp(word(i)) and word(i) & 31 == n and adrp_page(word(i), i) == s & ~0xFFF for i in range(max(0, j - 20), j, 4)): out.append(j)
s = img.find(KEY, s + 2, data_off)
return sorted(set(out))
def engine_global(img, text_end, ro_off, data_off, rel):
"""({GEngine candidate: [store offsets]}): at each reference to the key, the first store of a register to [xR, #lo] after which [xR, #lo] is loaded into x0 and a blr follows; the
candidate is xR's value (resolved back: adrp, adrp + add, a GOT slot's address) plus lo"""
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from fps_target import writes
word = lambda a: struct.unpack_from('<I', img, a)[0]
def value(i, r, depth=0):
"""The address register r holds at word offset i, from the last instruction before it that writes r (up to BACK_REACH bytes back), or None"""
if depth > 3: return None
for k in range(i - 4, max(0, i - BACK_REACH), -4):
u = word(k)
if is_adrp(u) and u & 31 == r: return adrp_page(u, k)
if writes(u) != r: continue
n = (u >> 5) & 31
if (u & 0xFFC00000) == 0x91000000: # add xr, xn, #imm
b = value(k, n, depth + 1); return b + ((u >> 10) & 0xFFF) if b is not None else None
if (u & 0xFFC00000) == 0xF9400000: # ldr xr, [xn, #imm]: a GOT slot holds the address
b = value(k, n, depth + 1)
return rel.get(b + ((u >> 10) & 0xFFF) * 8) if b is not None else None
if (u & 0xFFE0FFE0) == 0xAA0003E0: return value(k, (u >> 16) & 31, depth + 1) # mov xr, xs
return None
return None
found = {}
for ref in key_refs(img, text_end, ro_off, data_off):
for k in range(ref + 4, min(text_end, ref + STORE_REACH), 4):
u = word(k)
if (u & 0xFFC00000) != 0xF9000000: continue # str xV, [xR, #lo]
r, lo = (u >> 5) & 31, ((u >> 10) & 0xFFF) * 8
reload = 0xF9400000 | (lo // 8) << 10 | r << 5 # ldr x0, [xR, #lo]
at = next((q for q in range(k + 4, min(text_end, k + 4 * RELOAD_REACH), 4) if word(q) == reload), None)
if at is None or any(writes(word(q)) == r for q in range(k + 4, at, 4)): continue
if not any((word(q) & 0xFFFFFC1F) == 0xD63F0000 for q in range(at + 4, min(text_end, at + 4 * CALL_REACH), 4)): continue # blr
b = value(k, r)
if b is not None and b + lo >= data_off and (b + lo) % 8 == 0: found.setdefault(b + lo, []).append(k) # in data or the bss (past the file image)
break
return found
def find(img, text_end, ro_off, data_off):
"""(GEngine's offset in main, FixedFrameRate's offset in UEngine, reason), or (None, None, why not); why starts '[RED] ' when more than one global stores the property. A main whose
code stores it through no global (Princess Peach: Showtime!, Pikmin 4) gets no fixups, and the host has nothing to write"""
"""(GEngine's offset in main, FixedFrameRate's offset in UEngine, bUseFixedFrameRate as byte offset << 8 | bit mask, reason), or (None, None, None, why not); why starts
'[RED] ' when the property is there and the engine's creation names more than one global, the property has more than one offset or its flag is not found"""
rel = relocated(img)
fs = fields(img, ro_off, data_off, rel)
if not fs: return None, None, 'no UEngine::FixedFrameRate'
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from fps_target import globals_of
global_of = globals_of(img)
want = set(fs.values()); word = lambda a: struct.unpack_from('<I', img, a)[0]
users = {}
for i in range(0, text_end, 4):
u = word(i)
if (u & 0xFFC00000) != 0xBD000000: continue # str sT, [xB, #imm * 4]
f = ((u >> 10) & 0xFFF) * 4
if f not in want: continue
g = global_of(i, (u >> 5) & 31)
if g is not None and g >= data_off: users.setdefault((g, f), []).append(i)
if not users: return None, None, f'UEngine::FixedFrameRate at +{min(want):#x}: no code stores it through a global (GEngine), so the object is not known'
if len(users) > 1: return None, None, '[RED] UEngine::FixedFrameRate: ' + ', '.join(f'[{g:#x}]+{f:#x} ({len(a)})' for (g, f), a in sorted(users.items())) + ': stored through more than one global'
(g, f), at = users.popitem()
return g, f, f'UEngine::FixedFrameRate at [{g:#x}]+{f:#x} (GEngine; reflection entry {min(o for o, v in fs.items() if v == f):#x}; stored at ' + ', '.join(f'{a:#x}' for a in at[:4]) + ')'
if not fs: return None, None, None, 'no UEngine::FixedFrameRate'
offs = sorted(set(fs.values()))
if len(offs) > 1: return None, None, None, '[RED] UEngine::FixedFrameRate: float properties of that name at ' + ', '.join(f'+{f:#x}' for f in offs)
f = offs[0]
fl = flag(img, text_end, ro_off, data_off, rel)
if fl is None: return None, None, None, f'[RED] UEngine::FixedFrameRate at +{f:#x}: no set-bit function of bUseFixedFrameRate of the known form'
gs = engine_global(img, text_end, ro_off, data_off, rel)
if not gs: return None, None, None, f'UEngine::FixedFrameRate at +{f:#x}: no engine creation (the "GameEngine" key, a store, its reload and a virtual call) names GEngine'
if len(gs) > 1: return None, None, None, '[RED] UEngine::FixedFrameRate: the engine creation names ' + ', '.join(f'{g:#x} (at {", ".join(f"{a:#x}" for a in at)})' for g, at in sorted(gs.items())) + ': more than one global'
g, at = gs.popitem()
return g, f, fl[0] << 8 | fl[1], (f'UEngine::FixedFrameRate at [{g:#x}]+{f:#x}, used while bit {fl[1]:#x} of +{fl[0]:#x} is set (GEngine, stored where the engine is made at '
+ ', '.join(f'{a:#x}' for a in at) + f'; reflection entry {min(fs):#x})')
if __name__ == '__main__':
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
@@ -65,5 +145,5 @@ if __name__ == '__main__':
for path in sys.argv[1:]:
try: m = nso.read(path)
except nso.Error as e: print(f'{path}\t-\t{e}'); continue
g, f, why = find(bytes(m.image), m.text_end, m.segments[1][0], m.segments[2][0])
g, f, fl, why = find(bytes(m.image), m.text_end, m.segments[1][0], m.segments[2][0])
print(f'{path}\t{m.build_id[:16].hex()}\t{why}')
+11 -11
View File
@@ -280,7 +280,7 @@ Every patch bound tighter than it could be: the open gaps, then the blocked, kep
- **`build` → `engine`**, frame rate, blocked: one Frostbite game here, judgement: Frostbite's frame regulator at a fixed pointer. Engine code other Frostbite games ship (the simulation's own rate is already set by name)
- **1.8d.310c `main`** `a48c0de3…`
- host [hle_fpslock.c:54](../../dm/host/hle_fpslock.c#L54): engine frame limit set to fps_target: FIFA frame regulator
- host [hle_fpslock.c:55](../../dm/host/hle_fpslock.c#L55): engine frame limit set to fps_target: FIFA frame regulator
### FINAL FANTASY CRYSTAL CHRONICLES Remastered Edition
@@ -358,7 +358,7 @@ Every patch bound tighter than it could be: the open gaps, then the blocked, kep
- **`build` → `engine`**, frame rate, blocked: one game on that engine here, judgement: Next Level Games' frame limiter target at a fixed address. The studio's engine, which its other games ship
- **1.4.0 `main`** `79e5950f…`
- host [hle_fpslock.c:39](../../dm/host/hle_fpslock.c#L39): engine frame limit set to fps_target: NLG frame limiter target
- host [hle_fpslock.c:40](../../dm/host/hle_fpslock.c#L40): engine frame limit set to fps_target: NLG frame limiter target
### Mario + Rabbids® Sparks of Hope
@@ -376,7 +376,7 @@ Every patch bound tighter than it could be: the open gaps, then the blocked, kep
- **`build` → `engine`**, frame rate, blocked: one RE Engine game here, judgement: RE Engine's frame limit at a fixed pointer. Engine code other RE Engine games ship
- **16.0.2 `main`** `c9a3dd77…`
- host [hle_fpslock.c:35](../../dm/host/hle_fpslock.c#L35): engine frame limit set to fps_target: RE Engine frame limit
- host [hle_fpslock.c:36](../../dm/host/hle_fpslock.c#L36): engine frame limit set to fps_target: RE Engine frame limit
### Need For Speed™ Hot Pursuit Remastered
@@ -387,11 +387,11 @@ Every patch bound tighter than it could be: the open gaps, then the blocked, kep
- **1.0.3 `main`** `799d1061…` ([patches.py:7](../../dm/games/010029B0118E8000/patches.py#L7))
- cut `+0x4835a4`: frame limiter spin: b.gt main+0x483588 → nop (the host paces the frames)
- host [hle_fpslock.c:44](../../dm/host/hle_fpslock.c#L44): engine frame limit set to fps_target: Criterion 60 fps mode
- host [hle_fpslock.c:45](../../dm/host/hle_fpslock.c#L45): engine frame limit set to fps_target: Criterion frame ticks
- host [hle_fpslock.c:46](../../dm/host/hle_fpslock.c#L46): engine frame limit set to fps_target: Criterion frame ticks / 10
- host [hle_fpslock.c:47](../../dm/host/hle_fpslock.c#L47): engine frame limit set to fps_target: Criterion 2D game step
- host [hle_fpslock.c:48](../../dm/host/hle_fpslock.c#L48): engine frame limit set to fps_target: Criterion 3D game step
- host [hle_fpslock.c:45](../../dm/host/hle_fpslock.c#L45): engine frame limit set to fps_target: Criterion 60 fps mode
- host [hle_fpslock.c:46](../../dm/host/hle_fpslock.c#L46): engine frame limit set to fps_target: Criterion frame ticks
- host [hle_fpslock.c:47](../../dm/host/hle_fpslock.c#L47): engine frame limit set to fps_target: Criterion frame ticks / 10
- host [hle_fpslock.c:48](../../dm/host/hle_fpslock.c#L48): engine frame limit set to fps_target: Criterion 2D game step
- host [hle_fpslock.c:49](../../dm/host/hle_fpslock.c#L49): engine frame limit set to fps_target: Criterion 3D game step
### NieR:Automata The End of YoRHa Edition (010056B015FE8000)
@@ -410,7 +410,7 @@ Every patch bound tighter than it could be: the open gaps, then the blocked, kep
- cut `+0x9bf4d4`: dynamic resolution: optimal frame cost 32.01 -> 16.005 ms at 60 fps (second load)
- cut `+0x9bf4f8`: dynamic resolution: good frame cost 30 -> 15 ms at 60 fps
- launcher capabilities: DYNAMIC_RESOLUTION
- host [hle_fpslock.c:70](../../dm/host/hle_fpslock.c#L70): frame interval and dynamic-resolution floor
- host [hle_fpslock.c:71](../../dm/host/hle_fpslock.c#L71): frame interval and dynamic-resolution floor
### NieR:Automata The End of YoRHa Edition (0100B8E016F76000)
@@ -429,7 +429,7 @@ Every patch bound tighter than it could be: the open gaps, then the blocked, kep
- cut `+0x9c08e8`: dynamic resolution lower bound follows the selected preset
- cut `+0x9c08f4`: dynamic resolution lower bound follows the selected preset
- launcher capabilities: DYNAMIC_RESOLUTION
- host [hle_fpslock.c:71](../../dm/host/hle_fpslock.c#L71): frame interval and dynamic-resolution floor
- host [hle_fpslock.c:72](../../dm/host/hle_fpslock.c#L72): frame interval and dynamic-resolution floor
### Paper Mario: The Thousand-Year Door
@@ -448,7 +448,7 @@ Every patch bound tighter than it could be: the open gaps, then the blocked, kep
- **`build` → `engine`**, frame rate, gap, judgement: Unity's Application.targetFrameRate at a fixed address. An IL2CPP player registers the setter by its icall name, so the field can be found in any Unity game; whether to raise it stays the profile's
- **1.3.0 `main`** `94ceae32…`
- host [hle_fpslock.c:30](../../dm/host/hle_fpslock.c#L30): engine frame limit set to fps_target: Unity targetFrameRate
- host [hle_fpslock.c:31](../../dm/host/hle_fpslock.c#L31): engine frame limit set to fps_target: Unity targetFrameRate
### Pokémon Legends: Arceus
+1 -1
View File
@@ -66,7 +66,7 @@ octopath-traveler-0.jpg Octopath Traveler 0 60 fps with 1.0.5 01005270232F2000
octopath-traveler-ii.jpg Octopath Traveler II 60 fps with 1.1.1 0100A3501946E000
patricks-parabox.jpg Patrick's Parabox 0100E44016C22000
persona-5-royal.jpg Persona 5 Royal 01005CA01580E000
pikmin-4.jpg Pikmin 4 0100B7C00933A000
pikmin-4.jpg Pikmin 4 60 fps, up to 120 on the Mac 0100B7C00933A000
pokemon-brilliant-diamond.jpg Pokémon Brilliant Diamond 60 fps with 1.3.0 0100000011D90000
pokemon-legends-z-a.jpg Pokémon Legends: Z-A 0100F43008C44000
pokemon-scarlet.png Pokémon Scarlet 0100A3D008C5C000
Can't render this file because it contains an unexpected character in line 2 and column 118.
+8 -3
View File
@@ -178,9 +178,14 @@ Frame pacing: the host's frame step, engine frame limiters, present intervals an
- **Symptom:** an Unreal Engine game with `fps_target 60` asks for present interval 1 (`main: Unreal rhi.SyncInterval … 2 → 1 vsyncs`), and its menus reach 60, but its gameplay holds 30.0 fps with spare CPU and GPU time; the game sets no `t.MaxFPS`.
- **Cause:** the engine's fixed frame rate. The game's config turns it on (`bUseFixedFrameRate=True`, `FixedFrameRate=30.000000` in its `DefaultEngine.ini`), and the engine then steps every frame by exactly 1 / `FixedFrameRate` seconds and holds its tick to that rate, whatever the console variables say. `FixedFrameRate` is a `UEngine` property on the engine object `GEngine` points to, not a console variable. Unreal's Switch frame pace sets it with the present interval: Sparking! ZERO's (`main+0x1e1e904`) caches `rhi.SyncInterval`, sets 1 for its 60 fps mode and 2 for the others, and stores {30, 24, 60}[mode] into `GEngine->FixedFrameRate`.
- **Fix:** the rewriter finds the property and its object in any Unreal main, with no address per build (`dm/tools/ue_fixed_rate.py`, run by `patch_nso.py` on a main whose console variables it found), and names them in the fixups (`UE_FIXED_RATE_PTR`, GEngine's offset in main; `UE_FIXED_RATE_FIELD`, the property's offset in `UEngine`). The property comes from its reflection entry: the data word holding the address of its UTF-8 name (the module's relative relocations applied; the linker may share the string with the tail of `bUseFixedFrameRate`), with the generated-property kind Float (0x0A at +24) and array size 1 (+32). Its offset follows the array size (+36, UE 4.22 to 5.0), or a setter and a getter pointer after it (+56, UE 5.1 and later). `GEngine` is the one global through which code stores a float at that offset (`fps_target.py`'s `globals_of`: `adrp` + `add`, or the GOT slot by `adrp` + `ldr`, then `ldr xB, [xA]`): the engine or the game setting the rate, as the Switch frame pace does. A load alone is no proof, as its offset can belong to another object (Pikmin 4, below), so a main with none gets no fixups; two globals give a `[RED]` line and nothing is written. The host writes `fps_target` there as a frame rate (`hle_fpslock.c`, a row beside the console variables): at 120 it follows the frame step's hold, 120 or 60 ([120 fps follows the frame step](#120-fps-follows-the-frame-step)). The engine reads the property only while the fixed frame rate is on, so on a game without one the write changes nothing. The step stays the time one frame stands for, so the game's speed holds as far as its own code steps by the engine's delta time: a game this reaches needs its speed checked at 60 (and at 120 for `fps_max 120`).
- **Found on:** [DRAGON BALL: Sparking! ZERO](../../dm/games/010035F022078000/README.md) (UE 5.1.1, `GEngine` at `main+0x9aefa30`, `FixedFrameRate` at `+0x9c8`): its battles at 56–60 fps, at 119.3 in most windows at 120. Not reached: Pikmin 4 (UE 4.26, the property at `+0x7a8`, its offset at +36 of the entry), whose engine steps a fixed 30 too (`bUseFixedFrameRate=True`). Its only access is a load through `main+0x9350560`, and on 2026-11-08 the object there held -980 at `+0x7a8` (a gravity), not 30. The first version of the rule took any load or store, and on main for a few hours it named that global; the host wrote nothing, as -980 is outside the range it accepts, and the game stayed at 30. Since then a store is required. Its `GEngine` is still to be found another way ([its note](../../dm/games/0100B7C00933A000/README.md#frame-rate)). Princess Peach: Showtime! has the property and no store through a global; Octopath Traveler 0 and the first OCTOPATH TRAVELER have no such entry.
- **Check:** `dm/tools/tests/test_ue_fixed_rate.py` (synthetic images: both layouts, the shared name, `GEngine` through its GOT slot, no store, a load alone, two globals, another kind); `t_fpslock` cases 22 and 23 (60, a 30 the game sets again, 120 following the hold); `ue_fixed_rate.py <main>...` prints what it finds in each.
- **Fix:** the rewriter finds the property, its flag and its object in any Unreal 4.22 to 5 main, with no address per build (`dm/tools/ue_fixed_rate.py`, run by `patch_nso.py` on a main whose console variables it found), and names them in the fixups (`UE_FIXED_RATE_PTR`, GEngine's offset in main; `UE_FIXED_RATE_FIELD`, the property's offset in `UEngine`; `UE_FIXED_RATE_FLAG`, `bUseFixedFrameRate` as byte offset << 8 | bit mask).
- The property comes from its reflection entry: the data word holding the address of its UTF-8 name (the module's relative relocations applied; the linker may share the string with the tail of `bUseFixedFrameRate`), with the generated-property kind Float (0x0A at +24) and array size 1 (+32). Its offset follows the array size (+36, UE 4.22 to 5.0), or a setter and a getter pointer after it (+56, UE 5.1 and later).
- The flag comes from `bUseFixedFrameRate`'s entry (kind Bool, 0x0C): the function it holds that sets the bit on an object, `ldrb w, [x0, #byte]; orr w, w, #bit; strb; ret`.
- `GEngine` comes from where `FEngineLoop::Init` makes the engine: after a reference to the UTF-16 config key `GameEngine` (the engine class's name; the linker may share it with the tail of `UGameEngine`), the first store of a register to `[xR, #lo]` that is loaded back into `x0` and followed by a virtual call (`ParseCommandline`). `xR` is resolved back to the global's page (`adrp`), that plus an offset (`adrp` + `add`), or the address a GOT slot holds (`adrp` + `ldr`). Every such store must name the same global, or the line is `[RED]` and nothing is written.
- The host writes `fps_target` there as a frame rate (`hle_fpslock.c`, a row beside the console variables) only while the object's flag is set, so an engine stepping by the time that passed is left as it is; at 120 it follows the frame step's hold, 120 or 60 ([120 fps follows the frame step](#120-fps-follows-the-frame-step)). The step stays the time one frame stands for, so the game's speed holds as far as its own code steps by the engine's delta time: a game this reaches needs its speed checked at 60 (and at 120 for `fps_max 120`).
- **Earlier versions (2026-11-08):** `GEngine` was first the one global through which code loaded or stored a float at the property's offset. On Pikmin 4 that was a load through `main+0x9350560` (`main+0x1689a70`), whose object held -980 at `+0x7a8` (a gravity), not 30: the offset only coincided, and the host wrote nothing, as -980 is outside the range it accepts. The second version took only a store, which only Sparking! ZERO's frame pace makes (`main+0x1e1ea04`); Pikmin 4 sets the property from its config through the reflection loader and reads it through `this`, so it got nothing. The engine's creation is in every build.
- **Found on:** [DRAGON BALL: Sparking! ZERO](../../dm/games/010035F022078000/README.md) (UE 5.1.1: `GEngine` at `main+0x9aefa30` through the GOT slot `main+0x8dbfb40`, stored at `main+0x789c`; `FixedFrameRate` at `+0x9c8`, the flag bit 0x40 of `+0x9c4`): its battles at 56–60 fps, at 119.3 in most windows at 120. [Pikmin 4](../../dm/games/0100B7C00933A000/README.md) (UE 4.26.2: `GEngine` at `main+0x9fbf880`, stored at `main+0x9e5f68` and `main+0x9e9224`; `FixedFrameRate` at `+0x7a8`, the flag bit 0x40 of `+0x7a4`; the object read in a run: flag byte 0x47, 30.0): the write `30 → 120`, 119.4 fps in most windows, the speed right to the user in the prologue (2026-11-08). Offline: Princess Peach: Showtime! (`GEngine` at `main+0xaeaf988`, the property at `+0x7a8`) runs at 60 by the present interval alone, so its flag is off and the host writes nothing there; Octopath Traveler 0 and the first OCTOPATH TRAVELER have no such entry.
- **Check:** `dm/tools/tests/test_ue_fixed_rate.py` (synthetic images: both layouts, the shared names, the flag, `GEngine` as a page plus offset and through a GOT slot, a store with no reload, two globals, another kind); `t_fpslock` cases 22 to 24 (60, a 30 the game sets again, 120 following the hold, the flag off); `ue_fixed_rate.py <main>...` prints what it finds in each.
### Frostbite's simulation rate, found by name