Only changed dwords go back into title memory; cheap safe copies; title's own arguments; more shader forms

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
localandClaude Opus 5.5 committed 2026-11-24 20:28:42 -06:00
1 parent d9a31188be
commit 7fa012814f
16 files changed
+973 -29

No files matched your search

+12
View File
@@ -55,6 +55,18 @@ pub fn image_named(file: &str) -> Option<usize> {
.map(|(b, _)| *b)
}
static TITLE_ARGS: std::sync::OnceLock<Vec<String>> = std::sync::OnceLock::new();
/// The arguments the title's `main` gets (those after `--`). Set once, before
/// the title starts; later calls are ignored.
pub fn set_title_args(args: Vec<String>) {
let _ = TITLE_ARGS.set(args);
}
pub fn title_args() -> &'static [String] {
TITLE_ARGS.get().map_or(&[], Vec::as_slice)
}
/// Maps a title DLL the title loads itself (`LoadLibrary`) and returns its
/// base; `Ok(None)` if `file` is not one of the title's DLLs.
pub type TitleDllLoader = Box<dyn Fn(&str) -> Result<Option<usize>, String> + Send + Sync>;