Helper for ROM version detection and feature gating. More...
#include <overworld_version_helper.h>
Static Public Member Functions | |
| static OverworldVersion | GetVersion (const Rom &rom) |
| Detect ROM version from ASM marker byte. | |
| static uint8_t | GetAsmVersion (const Rom &rom) |
| Get raw ASM version byte from ROM. | |
| static bool | SupportsAreaEnum (OverworldVersion version) |
| Check if ROM supports area enum system (v3+ only) | |
| static bool | SupportsExpandedSpace (OverworldVersion version) |
| Check if ROM uses expanded ROM space for overworld data. | |
| static bool | SupportsCustomBGColors (OverworldVersion version) |
| Check if ROM supports custom background colors per area (v2+) | |
| static bool | SupportsCustomTileGFX (OverworldVersion version) |
| Check if ROM supports custom tile GFX groups (v3+) | |
| static bool | SupportsAnimatedGFX (OverworldVersion version) |
| Check if ROM supports animated GFX selection (v3+) | |
| static bool | SupportsSubscreenOverlay (OverworldVersion version) |
| Check if ROM supports subscreen overlays (v3+) | |
| static const char * | GetVersionName (OverworldVersion version) |
| Get human-readable version name for display/logging. | |
Helper for ROM version detection and feature gating.
Provides consistent version checking across the codebase to replace scattered inline checks like:
With semantic helpers:
| Feature | Vanilla | v1 | v2 | v3 |
|---|---|---|---|---|
| Expanded Pointers | No | Yes | Yes | Yes |
| Custom BG Colors | No | No | Yes | Yes |
| Main Palette Select | No | No | Yes | Yes |
| Area Size Enum | No | No | No | Yes |
| Wide/Tall Areas | No | No | No | Yes |
| Custom Tile GFX | No | No | No | Yes |
| Animated GFX | No | No | No | Yes |
| Subscreen Overlays | No | No | No | Yes |
| Mosaic Effect | No | No | No | Yes |
Definition at line 140 of file overworld_version_helper.h.
|
inlinestatic |
Detect ROM version from ASM marker byte.
| rom | ROM to check |
Reads the version marker at OverworldCustomASMHasBeenApplied (0x140145). Returns kVanilla for unpatched ROMs (marker = 0xFF or 0x00).
Definition at line 154 of file overworld_version_helper.h.
References yaze::Rom::data(), yaze::zelda3::kVanilla, yaze::zelda3::kZSCustomV1, yaze::zelda3::kZSCustomV2, yaze::zelda3::kZSCustomV3, yaze::zelda3::OverworldCustomASMHasBeenApplied, and yaze::Rom::size().
Referenced by yaze::zelda3::Overworld::AssembleMap16Tiles(), yaze::zelda3::Overworld::AssembleMap32Tiles(), yaze::zelda3::OverworldMap::BuildMapWithCache(), yaze::editor::OverworldEditor::CheckForCurrentMap(), yaze::zelda3::Overworld::ConfigureMultiAreaMap(), yaze::editor::OverworldToolbar::Draw(), yaze::editor::MapPropertiesSystem::DrawCanvasToolbar(), yaze::editor::OverworldSidebar::DrawConfiguration(), yaze::editor::MapPropertiesSystem::DrawCustomBackgroundColorEditor(), yaze::editor::MapPropertiesSystem::DrawCustomFeaturesTab(), yaze::editor::MapPropertiesSystem::DrawGraphicsPopup(), yaze::editor::OverworldSidebar::DrawGraphicsSettings(), yaze::editor::MapPropertiesSystem::DrawMapPropertiesPanel(), yaze::editor::MapPropertiesSystem::DrawMosaicControls(), yaze::editor::MapPropertiesSystem::DrawOverlayControls(), yaze::editor::MapPropertiesSystem::DrawOverlayEditor(), yaze::editor::OverworldSidebar::DrawPaletteSettings(), yaze::editor::MapPropertiesSystem::DrawPalettesPopup(), yaze::editor::MapPropertiesSystem::DrawTileGraphicsTab(), yaze::gui::FlagsMenu::DrawZSCustomOverworldFlags(), yaze::zelda3::Overworld::EnsureMapBuilt(), yaze::zelda3::Overworld::InvalidateSiblingMapCaches(), yaze::zelda3::Overworld::Load(), yaze::zelda3::OverworldMap::LoadAreaGraphics(), yaze::zelda3::OverworldMap::LoadAreaInfo(), yaze::zelda3::LoadItems(), yaze::zelda3::OverworldMap::LoadOverlay(), yaze::zelda3::OverworldMap::LoadPalette(), yaze::zelda3::Overworld::LoadSprites(), yaze::editor::RomLoadOptionsDialog::Open(), yaze::zelda3::OverworldMap::OverworldMap(), yaze::editor::OverworldEditor::RefreshChildMapOnDemand(), yaze::editor::OverworldEditor::RefreshMapPalette(), yaze::editor::OverworldEditor::RefreshMapProperties(), yaze::zelda3::Overworld::SaveAreaSpecificBGColors(), yaze::zelda3::Overworld::SaveCustomOverworldASM(), yaze::zelda3::Overworld::SaveDiggableTiles(), yaze::zelda3::Overworld::SaveLargeMaps(), yaze::editor::MapPropertiesSystem::SetupCanvasContextMenu(), and yaze::zelda3::OverworldMap::SetupCustomTileset().

|
inlinestatic |
Get raw ASM version byte from ROM.
| rom | ROM to check |
Definition at line 184 of file overworld_version_helper.h.
References yaze::Rom::data(), and yaze::zelda3::OverworldCustomASMHasBeenApplied.
Referenced by yaze::zelda3::OverworldMap::OverworldMap().

|
inlinestatic |
Check if ROM supports area enum system (v3+ only)
| version | Detected ROM version |
The area enum system (v3+) replaces the simple large_map_ boolean with an AreaSizeEnum that supports:
Vanilla/v1/v2 ROMs use the legacy parent system with only large_map_ flag. When this returns false, use FetchLargeMaps() instead of AssignMapSizes().
Definition at line 207 of file overworld_version_helper.h.
References yaze::zelda3::kZSCustomV3.
Referenced by yaze::zelda3::Overworld::AssembleMap16Tiles(), yaze::zelda3::Overworld::AssembleMap32Tiles(), yaze::editor::OverworldEditor::CheckForCurrentMap(), yaze::zelda3::Overworld::ConfigureMultiAreaMap(), yaze::editor::OverworldToolbar::Draw(), yaze::editor::MapPropertiesSystem::DrawCanvasToolbar(), yaze::editor::OverworldSidebar::DrawConfiguration(), yaze::editor::MapPropertiesSystem::DrawCustomFeaturesTab(), yaze::editor::MapPropertiesSystem::DrawOverlayControls(), yaze::zelda3::Overworld::InvalidateSiblingMapCaches(), yaze::zelda3::Overworld::Load(), yaze::zelda3::LoadItems(), yaze::zelda3::OverworldMap::LoadPalette(), yaze::zelda3::Overworld::LoadSprites(), yaze::editor::OverworldEditor::RefreshChildMapOnDemand(), yaze::editor::OverworldEditor::RefreshMapPalette(), yaze::editor::OverworldEditor::RefreshMapProperties(), yaze::zelda3::Overworld::SaveCustomOverworldASM(), yaze::zelda3::Overworld::SaveDiggableTiles(), yaze::zelda3::Overworld::SaveLargeMaps(), yaze::editor::MapPropertiesSystem::SetupCanvasContextMenu(), and yaze::zelda3::OverworldMap::SetupCustomTileset().
|
inlinestatic |
Check if ROM uses expanded ROM space for overworld data.
| version | Detected ROM version |
v1+ ROMs use expanded pointers to store data beyond vanilla limits:
Vanilla ROMs store all data within original game space.
Definition at line 224 of file overworld_version_helper.h.
References yaze::zelda3::kVanilla.
Referenced by yaze::zelda3::Overworld::ConfigureMultiAreaMap(), yaze::editor::MapPropertiesSystem::DrawGraphicsPopup(), yaze::editor::OverworldSidebar::DrawGraphicsSettings(), and yaze::editor::MapPropertiesSystem::DrawTileGraphicsTab().
|
inlinestatic |
Check if ROM supports custom background colors per area (v2+)
| version | Detected ROM version |
v2+ enables per-area background color customization stored at:
When supported, each overworld area can have a unique BG color.
Definition at line 239 of file overworld_version_helper.h.
References yaze::zelda3::kZSCustomV2, and yaze::zelda3::kZSCustomV3.
Referenced by yaze::editor::OverworldSidebar::DrawConfiguration(), yaze::editor::MapPropertiesSystem::DrawCustomBackgroundColorEditor(), yaze::editor::MapPropertiesSystem::DrawCustomFeaturesTab(), yaze::editor::MapPropertiesSystem::DrawMosaicControls(), yaze::editor::OverworldSidebar::DrawPaletteSettings(), yaze::editor::MapPropertiesSystem::DrawPalettesPopup(), yaze::gui::FlagsMenu::DrawZSCustomOverworldFlags(), yaze::zelda3::OverworldMap::LoadPalette(), yaze::zelda3::Overworld::SaveAreaSpecificBGColors(), and yaze::zelda3::Overworld::SaveCustomOverworldASM().
|
inlinestatic |
Check if ROM supports custom tile GFX groups (v3+)
| version | Detected ROM version |
v3 enables per-area tile graphics group customization stored at:
Each area can use a different set of 8 graphics sheets.
Definition at line 255 of file overworld_version_helper.h.
References yaze::zelda3::kZSCustomV3.
Referenced by yaze::zelda3::OverworldMap::LoadAreaGraphics().
|
inlinestatic |
Check if ROM supports animated GFX selection (v3+)
| version | Detected ROM version |
v3 enables per-area animated graphics customization stored at:
Controls which animated tile set (waterfalls, flowers, etc.) to use.
Definition at line 270 of file overworld_version_helper.h.
References yaze::zelda3::kZSCustomV3.
Referenced by yaze::editor::MapPropertiesSystem::DrawCustomFeaturesTab(), yaze::editor::MapPropertiesSystem::DrawGraphicsPopup(), and yaze::editor::OverworldSidebar::DrawGraphicsSettings().
|
inlinestatic |
Check if ROM supports subscreen overlays (v3+)
| version | Detected ROM version |
v3 enables per-area subscreen overlay customization stored at:
Overlays provide additional visual layers (rain, fog, etc.).
Definition at line 285 of file overworld_version_helper.h.
References yaze::zelda3::kZSCustomV3.
|
inlinestatic |
Get human-readable version name for display/logging.
| version | Detected ROM version |
Definition at line 298 of file overworld_version_helper.h.
References yaze::zelda3::kVanilla, yaze::zelda3::kZSCustomV1, yaze::zelda3::kZSCustomV2, and yaze::zelda3::kZSCustomV3.
Referenced by yaze::zelda3::Overworld::ConfigureMultiAreaMap(), yaze::editor::MapPropertiesSystem::DrawOverlayControls(), yaze::editor::RomLoadOptionsDialog::DrawUpgradeOptions(), and yaze::editor::RomLoadOptionsDialog::DrawVersionInfo().