From 744c49ffc8271e9ed127fd3fdfe322f96d24b5e2 Mon Sep 17 00:00:00 2001 From: scawful Date: Sun, 5 Oct 2025 12:21:53 -0400 Subject: [PATCH] feat: Implement ROM Saving Functionality and Update Success Message - Added functionality to save the modified graphics sheet to the ROM after import, ensuring changes are preserved. - Updated success message to confirm the ROM has been saved and display the filename for better user feedback. --- src/cli/handlers/gfx.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/cli/handlers/gfx.cc b/src/cli/handlers/gfx.cc index 3ca67913..fb907c38 100644 --- a/src/cli/handlers/gfx.cc +++ b/src/cli/handlers/gfx.cc @@ -81,9 +81,13 @@ absl::Status GfxImport::Run(const std::vector& arg_vec) { sheet.set_data(cgx_loaded); // TODO: Implement saving the modified graphics sheet back to the ROM. + auto save_status = rom_.SaveToFile({.save_new = false}); + if (!save_status.ok()) { + return save_status; + } std::cout << "Successfully imported graphics sheet " << sheet_id << " from " << input_file << std::endl; - std::cout << "(Saving to ROM not yet implemented)" << std::endl; + std::cout << "✅ ROM saved to: " << rom_.filename() << std::endl; return absl::OkStatus(); }