Skip to content

Commit 86e676d

Browse files
Expose verified native resolution controls in the Air menu
1 parent 9c9a5d8 commit 86e676d

2 files changed

Lines changed: 31 additions & 7 deletions

File tree

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,7 @@ checked before using the fallback; native PC ports stay on their own paths.
7878
Handheld mode is named as such because it does not promise 720p. The patch was
7979
compiled and linked into the candidate mixed-engine shell; install and
8080
gameplay validation are pending.
81+
82+
The same patch exposes the existing 3D render scale for Tears of the Kingdom
83+
and the existing dynamic-resolution switch for NieR. The fallback only shows
84+
these controls if the signed framework advertises the respective fixup.

‎dm/ios/Engines/NxNative/air-native-quality-defaults.patch‎

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,50 @@
11
--- a/GameSettings.h
22
+++ b/GameSettings.h
3-
@@ -30,12 +30,19 @@
3+
@@ -30,12 +30,30 @@
44
static NSDictionary *TTChoice(NSString *env,NSString *label,NSString *def,NSArray *options){
55
return @{@"env":env,@"label":label,@"default":def,@"kind":@"choice",@"section":@"Game",@"options":options};
66
}
77
-// MKW's native NVN host supports these settings even for data-only imports
88
-// that did not ship a launcher schema.
99
+// Signed Switch frameworks can arrive with a data-only import and no
1010
+// launcher.json. Both controls are implemented by the native host.
11-
+static BOOL TTIsSignedSwitchTitle(NSString *title){
11+
+static NSString *TTNativeSwitchFramework(NSString *title){
1212
+ NSString *upper=title.uppercaseString;
13-
+ if(upper.length!=16||(![upper hasPrefix:@"01"]&&![upper hasPrefix:@"04"]))return NO;
14-
+ if([upper rangeOfCharacterFromSet:[[NSCharacterSet characterSetWithCharactersInString:@"0123456789ABCDEF"] invertedSet]].location!=NSNotFound)return NO;
15-
+ NSString *name=[NSString stringWithFormat:@"DmGame%@.framework/DmGame",upper];
16-
+ return [NSFileManager.defaultManager fileExistsAtPath:[NSBundle.mainBundle.privateFrameworksPath stringByAppendingPathComponent:name]];
13+
+ if(upper.length!=16||(![upper hasPrefix:@"01"]&&![upper hasPrefix:@"04"]))return nil;
14+
+ if([upper rangeOfCharacterFromSet:[[NSCharacterSet characterSetWithCharactersInString:@"0123456789ABCDEF"] invertedSet]].location!=NSNotFound)return nil;
15+
+ NSString *name=[NSString stringWithFormat:@"DmGame%@.framework",upper];
16+
+ NSString *framework=[NSBundle.mainBundle.privateFrameworksPath stringByAppendingPathComponent:name];
17+
+ return [NSFileManager.defaultManager fileExistsAtPath:[framework stringByAppendingPathComponent:@"DmGame"]]?framework:nil;
1718
+}
1819
static NSDictionary *TTNativeGraphicsSetting(NSString *title,NSString *key){
1920
- if(![title.lowercaseString isEqual:@"0400c3f00006e000"])return nil;
2021
- if([key isEqual:@"DM_OPMODE"])return TTChoice(key,@"运行模式",@"1",@[@[@"0",@"掌机(720p 档)"],@[@"1",@"底座(1080p 档)"]]);
2122
- if([key isEqual:@"DM_PRESENT_UPSCALE"])return TTChoice(key,@"画面超分",@"off",@[@[@"off",@"关闭"],@[@"metalfx",@"MetalFX"]]);
22-
+ if(!TTIsSignedSwitchTitle(title))return nil;
23+
+ NSString *framework=TTNativeSwitchFramework(title);
24+
+ if(!framework)return nil;
2325
+ if([key isEqual:@"DM_OPMODE"])return TTChoice(key,@"运行模式",@"0",@[@[@"0",@"掌机"],@[@"1",@"底座"]]);
2426
+ if([key isEqual:@"DM_PRESENT_UPSCALE"])return TTChoice(key,@"画面超分",@"metalfx",@[@[@"off",@"关闭"],@[@"metalfx",@"MetalFX"]]);
27+
+ if(![@[@"DM_RENDER_SCALE",@"DM_DYNAMIC_RESOLUTION"] containsObject:key])return nil;
28+
+ NSString *fixups=[NSString stringWithContentsOfFile:[framework stringByAppendingPathComponent:@"dm/main.fixups.tsv"]
29+
+ encoding:NSUTF8StringEncoding error:nil];
30+
+ if([key isEqual:@"DM_RENDER_SCALE"]&&[title.lowercaseString isEqual:@"0100f2c0115b6000"]&&
31+
+ [fixups containsString:@"\n# RENDER_SCALE\t1\n"])
32+
+ return @{@"env":key,@"label":@"3D 渲染比例",@"kind":@"range",@"section":@"Game",@"default":@"0.75",@"min":@0.50,@"max":@1.00,@"step":@0.05};
33+
+ if([key isEqual:@"DM_DYNAMIC_RESOLUTION"]&&[title.lowercaseString isEqual:@"0100b8e016f76000"]&&
34+
+ [fixups containsString:@"\n# DYNAMIC_RESOLUTION\t1\n"])
35+
+ return @{@"env":key,@"label":@"动态分辨率",@"kind":@"toggle",@"section":@"Game",@"default":@"1",@"on":@"1",@"off":@"0"};
2536
return nil;
2637
}
2738
static NSArray *TTGTASettingSpecs(void){
39+
@@ -70,7 +88,7 @@
40+
if(![@[@"DM_PRESENT_ASPECT",@"DM_TOUCH_SIZE",@"DM_TOUCH_STICK"] containsObject:row[@"env"]])[out addObject:row];
41+
}break;
42+
}
43+
- for(NSString *key in @[@"DM_OPMODE",@"DM_PRESENT_UPSCALE"]){
44+
+ for(NSString *key in @[@"DM_OPMODE",@"DM_PRESENT_UPSCALE",@"DM_RENDER_SCALE",@"DM_DYNAMIC_RESOLUTION"]){
45+
NSDictionary *native=TTNativeGraphicsSetting(title,key);
46+
if(!native)continue;
47+
BOOL hasSetting=NO;
2848
--- a/main.m
2949
+++ b/main.m
3050
@@ -109,7 +109,7 @@

0 commit comments

Comments
 (0)