From 7b00e0838f65aa2ecbec7b946c52d4b6c3935ae2 Mon Sep 17 00:00:00 2001 From: Justin Scofield Date: Tue, 31 Dec 2024 18:53:33 -0500 Subject: [PATCH] Fix ROM title extraction in LoadZelda3 function Resized the `title_` variable to `kTitleStringLength` to ensure it can hold the ROM title string. Used `std::copy` to copy the ROM title from `rom_data_` starting at `kTitleStringOffset` to `kTitleStringOffset + kTitleStringLength` into the `title_` variable. This change ensures that the `title_` variable correctly stores the ROM title extracted from the `rom_data_`. --- src/app/rom.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/rom.cc b/src/app/rom.cc index 402edb17..9a6397a8 100644 --- a/src/app/rom.cc +++ b/src/app/rom.cc @@ -244,6 +244,7 @@ absl::Status Rom::LoadZelda3() { // Copy ROM title constexpr uint32_t kTitleStringOffset = 0x7FC0; constexpr uint32_t kTitleStringLength = 20; + title_.resize(kTitleStringLength); std::copy(rom_data_.begin() + kTitleStringOffset, rom_data_.begin() + kTitleStringOffset + kTitleStringLength, title_.begin());