writeback GB ram files (#762)

This commit is contained in:
Logan McNaughton
2026-04-17 08:56:53 +02:00
committed by GitHub
parent be117214c3
commit cb87f79710
2 changed files with 9 additions and 3 deletions
+1 -1
View File
@@ -12,7 +12,7 @@
<true/>
<key>com.apple.security.device.bluetooth</key>
<true/>
<key>com.apple.security.files.user-selected.read-only</key>
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
</dict>
</plist>
+8 -2
View File
@@ -184,8 +184,8 @@ async fn main() -> std::io::Result<()> {
{
device.netplay = Some(netplay::init(peer_addr.parse().unwrap(), player_number));
} else {
if let Some(gb_roms) = args.gb_rom
&& let Some(gb_rams) = args.gb_ram
if let Some(gb_roms) = &args.gb_rom
&& let Some(gb_rams) = &args.gb_ram
{
for i in 0..4 {
if let Some(gb_rom) = gb_roms.get(i)
@@ -229,6 +229,12 @@ async fn main() -> std::io::Result<()> {
if device.netplay.is_some() {
netplay::close(&mut device);
} else if let Some(gb_rams) = &args.gb_ram {
for i in 0..4 {
if let Some(gb_ram) = gb_rams.get(i) {
std::fs::write(gb_ram, &device.transferpaks[i].cart.ram).unwrap();
}
}
}
if let Some(shutdown_tx) = &shutdown_tx {
ui::usb::close(shutdown_tx);