Add ZScreamCustomOverworld ASM v3 and integrate area size support

- Introduced ZScream Custom Overworld ASM to enhance customization of the ALTTP overworld, allowing users to modify various aspects such as palettes, backgrounds, and transitions.
- Updated OverworldEditor to include area size selection for v3 support, enabling users to choose between different area sizes (Small, Large, Wide, Tall).
- Enhanced OverworldMap to load area size information based on the applied ASM version, ensuring compatibility with expanded features.
- Implemented SaveAreaSizes method in Overworld to persist area size settings in the ROM, supporting the new customization capabilities.
- Refactored related classes and methods to accommodate the new area size logic and ensure seamless integration with existing functionalities.
This commit is contained in:
scawful
2025-09-24 15:36:29 -04:00
parent 3ab82a9567
commit 49b4f6d677
6 changed files with 6203 additions and 224 deletions

View File

@@ -527,6 +527,7 @@ absl::Status Overworld::Save(Rom *rom) {
RETURN_IF_ERROR(SaveOverworldMaps())
RETURN_IF_ERROR(SaveEntrances())
RETURN_IF_ERROR(SaveExits())
RETURN_IF_ERROR(SaveAreaSizes())
return absl::OkStatus();
}
@@ -1596,5 +1597,29 @@ absl::Status Overworld::SaveMapProperties() {
return absl::OkStatus();
}
absl::Status Overworld::SaveAreaSizes() {
util::logf("Saving V3 Area Sizes");
// Check if this is a v3 ROM
uint8_t asm_version = (*rom_)[zelda3::OverworldCustomASMHasBeenApplied];
if (asm_version < 3 || asm_version == 0xFF) {
return absl::OkStatus(); // Not a v3 ROM, nothing to do
}
// Save area sizes to the expanded table
for (int i = 0; i < kNumOverworldMaps; i++) {
uint8_t area_size_byte = static_cast<uint8_t>(overworld_maps_[i].area_size());
RETURN_IF_ERROR(rom()->WriteByte(kOverworldScreenSize + i, area_size_byte));
}
// Save message IDs to expanded table
for (int i = 0; i < kNumOverworldMaps; i++) {
uint16_t message_id = overworld_maps_[i].message_id();
RETURN_IF_ERROR(rom()->WriteShort(kOverworldMessagesExpanded + (i * 2), message_id));
}
return absl::OkStatus();
}
} // namespace zelda3
} // namespace yaze