feat: Implement ROM Saving After Patch Application

- Added functionality to save the patched ROM after applying the patch, ensuring changes are preserved.
- Updated success message to include the filename of the saved ROM for better user feedback.
This commit is contained in:
scawful
2025-10-05 12:21:46 -04:00
parent 5034e1e97d
commit cbe8a3c6d1

View File

@@ -72,9 +72,13 @@ absl::Status AsarPatch::Run(const std::vector<std::string>& arg_vec) {
return absl::AbortedError(absl::StrJoin(result.errors, "; "));
}
// TODO: Save the patched ROM
rom_.LoadFromData(rom_data);
auto save_status = rom_.SaveToFile({.save_new = false});
if (!save_status.ok()) {
return save_status;
}
std::cout << "Patch applied successfully!" << std::endl;
std::cout << "Patch applied successfully and ROM saved to: " << rom_.filename() << std::endl;
return absl::OkStatus();
}