You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c5fe6b5
Browse filesBrowse the repository at this point in the historyBrowse files
Find iOS DLC in Documents and replace stale content (#486)
The iOS launcher searched only the app bundle for DLC, even when the base
RomFS was deployed separately. Preserve DM_AOC_DIR overrides, then search
Documents/aoc before the bundle, and exclude external DLC from backups.
Push the complete DLC set from resources.env with replacement semantics.
Directory merges retained removed indices, which the host still counted
and mounted. Send an empty directory for builds without DLC, reject a
missing declared source before transfer, and preserve DLC for image-only
pushes that carry no DLC metadata.
Add synthetic transfer regression tests and retain the author's Foundation
startup tests. Document the mechanism and regenerate the symptom index.
Validation: 59 tests passed, one disk-image test skipped; 185 iOS sources
compiled; Python lint has no new findings. Regression risk is low: only
iOS discovery and transfer change, so no game regression run was needed.
Device transfers remain untested.
Co-authored-by: v0lumehi <[email protected]>
Copy file name to clipboardExpand all lines: dm/ios/Sources/main.m
+18-4Lines changed: 18 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
// iOS App entry: set the environment (game files, saves, shader libraries), write the host log to Documents/log.txt, create the window (front_ios.m), then run the host's dm_main on a big-stack thread.
2
-
// The game files (RomFS) ship inside the App at <App>/romfs; Documents/romfs.img (one image, scripts/push_romfs.sh; its name in any letter case) or a Documents/romfs folder is also accepted (lets you swap them without reinstalling).
2
+
// The game files (RomFS) ship inside the App at <App>/romfs; Documents/romfs.img (one image, scripts/push_romfs.sh; its name in any letter case) or a Documents/romfs folder is also accepted (lets you swap them without reinstalling). The DLC folder aoc/ likewise: Documents/aoc, else <App>/aoc.
3
3
#import<UIKit/UIKit.h>
4
4
#import<Metal/Metal.h>
5
5
#include<pthread.h>
@@ -78,6 +78,21 @@ static int romfs_identity_accepts(NSString *img) {
78
78
returnnil;
79
79
}
80
80
81
+
// Add-on content (DLC): each DLC's RomFS image at <dir>/<index>.img (or a legacy <index>/ folder). Like the game files, Documents/aoc comes before <App>/aoc.
82
+
// A DM_AOC_DIR that is already set (env.txt, the launch environment) wins. The host mounts and counts the DLC from DM_AOC_DIR (hle_fs.c, hle_misc.c)
fprintf(stderr, "boot: DLC from %s\n", d.fileSystemRepresentation);
92
+
return;
93
+
}
94
+
}
95
+
81
96
// Boot prerequisites (done before UIApplicationMain): directories / environment variables / log -- the host's early load reads these
82
97
// Why a slim build found no usable game files: the verdict on Documents/romfs.img (the first of romfs_document_images), in the log and for the screen (front_ios_boot_message). NULL when the build has no romfs.id
83
98
staticchar g_boot_message[640];
@@ -101,7 +116,7 @@ static int boot_env(void) {
101
116
NSString *res = NSBundle.mainBundle.resourcePath;
102
117
for (NSString *d in @[@"save", @"temp"]) [fm createDirectoryAtPath:[doc stringByAppendingPathComponent:d] withIntermediateDirectories:YESattributes:nilerror:nil];
103
118
// Keep game files and scratch data out of device backups (Documents is backed up by default; a RomFS placed there is many GB). Saves, logs and the pipeline list stay in the backup
104
-
for (NSString *d in [@[@"romfs", @"temp"] arrayByAddingObjectsFromArray:[romfs_document_images(doc) valueForKey:@"lastPathComponent"]]) {
119
+
for (NSString *d in [@[@"romfs", @"aoc", @"temp"] arrayByAddingObjectsFromArray:[romfs_document_images(doc) valueForKey:@"lastPathComponent"]]) {
if ([fm fileExistsAtPath:u.path] && ![u setResourceValue:@YESforKey:NSURLIsExcludedFromBackupKeyerror:&e]) fprintf(stderr, "boot: %s could not be excluded from backup: %s\n", d.UTF8String, e.localizedDescription.UTF8String);
setenv("DM_FONT_DIR", [dm stringByAppendingPathComponent:@"font"].fileSystemRepresentation, 0); // Shared-font stand-ins (standard.ttf / nintendo_ext.ttf): iOS lacks the macOS font path
163
-
NSString *aoc = [res stringByAppendingPathComponent:@"aoc"]; // add-on content: build_ipa.sh puts the RomFS extracted from the player's DLC NSPs at <App>/aoc/<index>/
164
-
if ([fm fileExistsAtPath:aoc]) setenv("DM_AOC_DIR", aoc.fileSystemRepresentation, 0);
178
+
aoc_locate(); // add-on content: Documents/aoc, else <App>/aoc; an empty Documents/aoc explicitly selects no DLC
165
179
NSString *pso = [res stringByAppendingPathComponent:@"pso"]; // the pipeline archive made offline (build_ipa.sh, dm/gfx/tools/pso_offline.py): the shader pairs' bases, which the device then does not build
166
180
if ([fm fileExistsAtPath:pso]) setenv("DM_PSO_BUNDLE", pso.fileSystemRepresentation, 0);
Copy file name to clipboardExpand all lines: docs/agents/symptoms.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,7 @@ One line per symptom in the [subsystem references](../reference/): what you see
13
13
- a `--romfs separate` app whose image was copied into its Documents folder by hand (Finder, the Files app, a LiveContainer guest) logs `boot: game files not found (Documents/romfs.img, Documents/romfs or <App>/romfs)`, and a build with `romfs.id` shows "There is no game file image on this device.", though the complete image is there. Renaming it to `romfs.img` makes the game start. → [A hand-copied RomFS.img is not found on iOS](../reference/packing.md#a-hand-copied-romfsimg-is-not-found-on-ios)
14
14
- reducing the iPhone transfer to one image still creates thousands of resource files on the Mac, and build scanners require the expanded folder. → [Building creates a full RomFS tree before packing its image](../reference/packing.md#building-creates-a-full-romfs-tree-before-packing-its-image)
15
15
- the NSP script stops at the shader split of a registered profile with `[RED] 13744 file(s) could not be read, their shaders are left out (first: AI/FileEntry/FileEntry.Product.100.byml.zs: CalledProcessError: Command ['zstd', '-d', '-c', '-q', '…/extract/v0/RomFS.img/AI/…'] returned non-zero exit status 1.)`. → [The zstd command given a path inside the image](../reference/packing.md#the-zstd-command-given-a-path-inside-the-image)
16
+
- a game's DLC works only when packed inside its IPA, although its base RomFS can be deployed separately. After pushing a smaller DLC set, removed indices can remain reported as owned and mounted. → [DLC in Documents is ignored or removed DLC remains installed](../reference/packing.md#dlc-in-documents-is-ignored-or-removed-dlc-remains-installed)
16
17
- starting a Mac app through a front end with unchanged settings enables the encode thread, and can disable Metal 4 pipelines and the pipeline archive; starting the same app from Finder keeps the host's defaults. → [A Mac front end's default settings change Metal execution paths](../reference/packing.md#a-mac-front-ends-default-settings-change-metal-execution-paths)
17
18
- with the NSP folder on an exFAT or FAT drive, the build leaves out an update whose name has no `[v…]` tag (the folder seems to hold two), or a stage stops with `FileNotFoundError` on a `._<name>` path inside `<id>_build/` and the next run fails on the half-deleted folder. → [A game folder on an exFAT drive reads one update as two, or fails to remove a folder](../reference/packing.md#a-game-folder-on-an-exfat-drive-reads-one-update-as-two-or-fails-to-remove-a-folder)
18
19
- with the build folder on an exFAT or FAT drive, the shader step compiles every library and then stops in `c1_guard.py` with `UnicodeDecodeError: 'utf-8' codec can't decode byte …` (dmsh_build.py: `[RED] c1_guard.py failed`), reading a `._<key>_b.metal`. → [The c1 guard stops on an AppleDouble file after the shader build](../reference/packing.md#the-c1-guard-stops-on-an-appledouble-file-after-the-shader-build)
0 commit comments