feat(runtime): implement shared transactional memcard with async saves
Intrepid/Prometeu/Runtime/pipeline/pr-master This commit looks good

This commit is contained in:
2026-10-13 15:24:01 +01:00
parent 0af8b2b1fe
commit 6c2a07e579
65 changed files with 6222 additions and 985 deletions
@@ -156,6 +156,26 @@ pub struct HostRunner {
}
impl HostRunner {
pub fn install_memcard(
&mut self,
path: std::path::PathBuf,
create: bool,
) -> prometeu_system::memcard::image::Result<()> {
self.firmware.os.memcard().mount_card_with(move || {
use prometeu_drivers::memcard::FileMemcard;
use prometeu_system::memcard::{image::IMAGE_BYTES, transaction::Card};
let storage = if create {
FileMemcard::create(&path, IMAGE_BYTES, |storage, id| {
Card::format(storage, id)
.map_err(|_| prometeu_hal::memcard::MemcardIoError::IoError)
})?
} else {
FileMemcard::open(&path, false)?
};
Ok(Box::new(storage))
})
}
/// Configures the boot target (Hub or specific Cartridge).
pub(crate) fn set_boot_target(&mut self, boot_target: BootTarget) {
self.firmware.boot_target = boot_target.clone();