Skip to content

Commit 75f30d7

Browse files
Default the Air library to game-paced presentation
1 parent 86e676d commit 75f30d7

2 files changed

Lines changed: 78 additions & 0 deletions

File tree

‎dm/ios/Engines/NxNative/README.md‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,17 @@ gameplay validation are pending.
8282
The same patch exposes the existing 3D render scale for Tears of the Kingdom
8383
and the existing dynamic-resolution switch for NieR. The fallback only shows
8484
these controls if the signed framework advertises the respective fixup.
85+
86+
## Air Gamebox: default frame pacing
87+
88+
Apply `air-library-paced-default.patch` to the Air mixed-engine shell after
89+
the native graphics settings patch. The library defaults to the game's
90+
pacing profile. It keeps an explicit environment profile and lets a saved
91+
per-game choice override it. The display-link fallback now follows the final
92+
choice after the menu and no longer sets 120 Hz pacing before that choice.
93+
The launcher records the effective mode and the explicit present rate, if
94+
any. This does not unlock a game's simulation rate or promise 60 fps.
95+
96+
The two changed shell objects compiled and linked against the Air 60.60
97+
base without rebuilding any cartridge or shader. Installation and gameplay
98+
validation of the revised shell are pending.
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
--- a/Sources/main.m
2+
+++ b/Sources/main.m
3+
@@ -286,14 +286,18 @@
4+
}
5+
// Default for every iPhone/iPad, independent of device/GPU generation.
6+
// Explicit launch/environment preferences can retain original game pacing.
7+
+#ifndef DM_LIBRARY_HOST
8+
if (!getenv("DM_FRAME_LIMIT")) setenv("DM_FRAME_LIMIT", "unlimited", 0);
9+
+#endif
10+
#if defined(DM_AIR_PERFORMANCE_BUILD) && DM_AIR_PERFORMANCE_BUILD
11+
// Build bases on demand on Air. Avoid the whole-library startup prebuild
12+
// and keep explicit per-game diagnostic preferences above these defaults.
13+
if (!getenv("DM_PSO_MTL4")) setenv("DM_PSO_MTL4", "1", 0);
14+
if (!getenv("DM_PSO_PREBUILD")) setenv("DM_PSO_PREBUILD", "0", 0);
15+
#endif
16+
+#ifndef DM_LIBRARY_HOST
17+
if (dm_frame_limit_unlimited()) setenv("DM_PRESENT_LINK", "2", 1);
18+
+#endif
19+
setenv("DM_ENV_FILE_KEYS", [from_file componentsJoinedByString:@" "].UTF8String, 1); // the launcher keeps what an env file set (LauncherSettings.swift)
20+
setenv("DM_ENV_LAUNCH_KEYS", [from_launch componentsJoinedByString:@" "].UTF8String, 1); // and what the launch environment set (docs/frontends.md, Saved choices)
21+
front_hud_env(); // an env file's DM_METAL_HUD; nothing in this process makes a Metal device before startGame (front_ios.m), which applies the launcher's
22+
@@ -436,6 +440,11 @@
23+
[owner.window.rootViewController presentViewController:alert animated:YES completion:nil];return;
24+
}
25+
TonTonApplyGlobalSettings(titleID);
26+
+ if (!getenv("DM_FRAME_LIMIT")) setenv("DM_FRAME_LIMIT", "game", 0);
27+
+ if (dm_frame_limit_unlimited() && !getenv("DM_PRESENT_LINK"))
28+
+ setenv("DM_PRESENT_LINK", "2", 0);
29+
+ fprintf(stderr, "boot: effective frame pacing %s, present Hz %s\n",
30+
+ getenv("DM_FRAME_LIMIT"), getenv("DM_PRESENT_HZ") ?: "engine default");
31+
if (g_independent_host.start) {
32+
g_independent_host.setCatalog(independent_catalog);
33+
const char *error = g_independent_host.start((const char *const *)g_argv, g_argc, g_independent_image);
34+
--- a/LibraryApp/Sources/main.m
35+
+++ b/LibraryApp/Sources/main.m
36+
@@ -36,7 +36,7 @@
37+
// launcher.json. Game-specific settings still require an entry in that schema.
38+
static NSArray<NSDictionary *> *libraryPreferences(void){
39+
return @[
40+
- @{@"key":@"DM_FRAME_LIMIT",@"title":@"帧率限制",@"default":@"unlimited",@"choices":@[@[@"unlimited",@"不限制"],@[@"game",@"游戏原始设置"]]},
41+
+ @{@"key":@"DM_FRAME_LIMIT",@"title":@"帧率限制",@"default":@"game",@"choices":@[@[@"unlimited",@"不限制"],@[@"game",@"游戏原始设置"]]},
42+
@{@"key":@"DM_LANG",@"title":@"游戏语言",@"choices":@[@[@"auto",@"游戏默认"],@[@"chinese",@"优先中文"],@[@"english",@"英语"]]},
43+
@{@"key":@"DM_OPMODE",@"title":@"运行模式",@"default":@"0",@"choices":@[@[@"auto",@"游戏默认"],@[@"0",@"掌机(通常为 720p 档)"],@[@"1",@"底座"]]},
44+
@{@"key":@"DM_PRESENT_ASPECT",@"title":@"画面适配",@"choices":@[@[@"auto",@"游戏默认"],@[@"fit",@"保持原比例"],@[@"fill",@"铺满屏幕"]]},
45+
@@ -70,7 +70,7 @@
46+
// Keep an explicit game pacing profile over the library default.
47+
// A saved setting for this title still wins below.
48+
const char *profile=getenv("DM_FRAME_LIMIT");
49+
- if(profile && !strcmp(profile,"game"))continue;
50+
+ if(profile && (!strcmp(profile,"game") || !strcmp(profile,"unlimited")))continue;
51+
if([choice isEqual:@"unlimited"]||[choice isEqual:@"game"])setenv(key.UTF8String,choice.UTF8String,1);
52+
continue;
53+
}
54+
--- a/LibraryApp/Sources/GameSettings.h
55+
+++ b/LibraryApp/Sources/GameSettings.h
56+
@@ -74,7 +74,7 @@
57+
NSArray *paths=@[[documents stringByAppendingPathComponent:[NSString stringWithFormat:@"Games/%@/Resources/dm/launcher.json",title.lowercaseString]],
58+
[NSBundle.mainBundle.resourcePath stringByAppendingPathComponent:[NSString stringWithFormat:@"GameResources/%@/Resources/dm/launcher.json",title.lowercaseString]]];
59+
NSMutableArray *out=[NSMutableArray arrayWithArray:@[
60+
- TTChoice(@"DM_FRAME_LIMIT",@"帧率限制",@"unlimited",@[@[@"unlimited",@"不限制"],@[@"game",@"游戏原始设置"]]),
61+
+ TTChoice(@"DM_FRAME_LIMIT",@"帧率限制",@"game",@[@[@"unlimited",@"不限制"],@[@"game",@"游戏原始设置"]]),
62+
TTChoice(@"DM_PRESENT_ASPECT",@"画面适配",@"auto",@[@[@"auto",@"游戏默认"],@[@"fit",@"保持原比例"],@[@"fill",@"铺满屏幕"]]),
63+
TTChoice(@"DM_TOUCH_SIZE",@"虚拟按键大小",@"medium",@[@[@"small",@"小"],@[@"medium",@"中"],@[@"large",@"大"]]),
64+
TTChoice(@"DM_TOUCH_STICK",@"虚拟左摇杆位置",@"corner",@[@[@"corner",@"左下"],@[@"higher",@"靠上"],@[@"inward",@"靠内"]])]];

0 commit comments

Comments
 (0)