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_`.
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user