yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
diggable_tiles_patch.h
Go to the documentation of this file.
1#ifndef YAZE_ZELDA3_OVERWORLD_DIGGABLE_TILES_PATCH_H
2#define YAZE_ZELDA3_OVERWORLD_DIGGABLE_TILES_PATCH_H
3
4#include <cstdint>
5#include <string>
6
7#include "absl/status/status.h"
8#include "rom/rom.h"
10
11namespace yaze::zelda3 {
12
19 // Hook location - default is vanilla, but ZS may move this
20 uint32_t hook_address = 0x1BBDF4; // Where to insert JSL
21 uint32_t diggable_handler = 0x1BBE3E; // OverworldTileAction_Diggable
22 uint32_t exit_address = 0x1BBE3B; // .not_digging exit point
23
24 // Table location in expanded ROM space
25 uint32_t table_address = 0x140980; // 64 bytes for bitfield
26
27 // ZS feature detection
28 bool detect_zs_hooks = true; // Auto-detect if ZS modified this area
29 bool use_zs_compatible_mode = false; // Use alternate hook strategy for ZS ROMs
30
31 // Code placement
32 uint32_t freespace_address = 0x1BF000; // Where to put new lookup routine
33};
34
42 public:
50 static std::string GeneratePatch(
51 const DiggableTiles& diggable_tiles,
52 const DiggableTilesPatchConfig& config = {});
53
62 static absl::Status ExportPatchFile(
63 const DiggableTiles& diggable_tiles,
64 const std::string& output_path,
65 const DiggableTilesPatchConfig& config = {});
66
75 static bool DetectZSDiggingHooks(const Rom& rom);
76
87
88 private:
92 static std::string GenerateVanillaRoutine(
93 const DiggableTiles& diggable_tiles,
94 const DiggableTilesPatchConfig& config);
95
99 static std::string GenerateZSCompatibleRoutine(
100 const DiggableTiles& diggable_tiles,
101 const DiggableTilesPatchConfig& config);
102
106 static std::string GenerateDataTable(const DiggableTiles& diggable_tiles,
107 uint32_t table_address);
108};
109
110} // namespace yaze::zelda3
111
112#endif // YAZE_ZELDA3_OVERWORLD_DIGGABLE_TILES_PATCH_H
The Rom class is used to load, save, and modify Rom data. This is a generic SNES ROM container and do...
Definition rom.h:24
Generates ASM patches for table-based diggable tile lookup.
static std::string GenerateDataTable(const DiggableTiles &diggable_tiles, uint32_t table_address)
Generate the data table section of the patch.
static bool DetectZSDiggingHooks(const Rom &rom)
Detect if ROM has ZSCustomOverworld modifications to digging code.
static std::string GenerateVanillaRoutine(const DiggableTiles &diggable_tiles, const DiggableTilesPatchConfig &config)
Generate the vanilla-mode lookup routine ASM.
static std::string GenerateZSCompatibleRoutine(const DiggableTiles &diggable_tiles, const DiggableTilesPatchConfig &config)
Generate the ZS-compatible lookup routine ASM.
static absl::Status ExportPatchFile(const DiggableTiles &diggable_tiles, const std::string &output_path, const DiggableTilesPatchConfig &config={})
Export ASM patch to a file.
static std::string GeneratePatch(const DiggableTiles &diggable_tiles, const DiggableTilesPatchConfig &config={})
Generate ASM patch code for the diggable tiles table.
static DiggableTilesPatchConfig GetRecommendedConfig(const Rom &rom)
Get recommended patch configuration based on ROM analysis.
Manages diggable tile state as a 512-bit bitfield.
Zelda 3 specific classes and functions.
Definition editor.h:35
Configuration for diggable tiles ASM patch generation.