yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
common.h
Go to the documentation of this file.
1#ifndef YAZE_APP_ZELDA3_COMMON_H
2#define YAZE_APP_ZELDA3_COMMON_H
3
4#include <cstdint>
5#include <string>
6
11namespace yaze::zelda3 {
12
32 public:
44
45 // World coordinates (0-4095 for overworld)
46 // ZScream: PlayerX/PlayerY (exits), GlobalX/GlobalY (entrances)
47 int x_ = 0;
48 int y_ = 0;
49
50 // Map-local game coordinates (0-63 tiles, or 0-31 for small areas)
51 // ZScream: AreaX/AreaY (exits), GameX/GameY (items/sprites)
52 int game_x_ = 0;
53 int game_y_ = 0;
54
55 // Entity index in array (for display/debugging)
56 int entity_id_ = 0;
57
58 // Parent map ID (accounting for large/wide/tall areas)
59 // ZScream: MapID property
60 uint16_t map_id_ = 0;
61
62 auto set_x(int x) { x_ = x; }
63 auto set_y(int y) { y_ = y; }
64
65 GameEntity() = default;
66 virtual ~GameEntity() {}
67
81 virtual void UpdateMapProperties(uint16_t map_id,
82 const void* context = nullptr) = 0;
83};
84
85constexpr int kNumOverworldMaps = 160;
86
87// 1 byte, not 0 if enabled
88// vanilla, v2, v3
89constexpr int OverworldCustomASMHasBeenApplied = 0x140145;
90
91constexpr const char* kEntranceNames[] = {
92 "Link's House Intro",
93 "Link's House Post-intro",
94 "Sanctuary",
95 "Hyrule Castle West",
96 "Hyrule Castle Central",
97 "Hyrule Castle East",
98 "Death Mountain Express (Lower)",
99 "Death Mountain Express (Upper)",
100 "Eastern Palace",
101 "Desert Palace Central",
102 "Desert Palace East",
103 "Desert Palace West",
104 "Desert Palace Boss Lair",
105 "Kakariko Elder's House West",
106 "Kakariko Elder's House East",
107 "Kakariko Angry Bros West",
108 "Kakariko Angry Bros East",
109 "Mad Batter Lair",
110 "Under Lumberjacks' Weird Tree",
111 "Death Mountain Maze 0000",
112 "Death Mountain Maze 0001",
113 "Turtle Rock Mountainface 1",
114 "Death Mountain Cape Heart Piece Cave (Lower)",
115 "Death Mountain Cape Heart Piece Cave (Upper)",
116 "Turtle Rock Mountainface 2",
117 "Turtle Rock Mountainface 3",
118 "Death Mountain Maze 0002",
119 "Death Mountain Maze 0003",
120 "Death Mountain Maze 0004",
121 "Death Mountain Maze 0005",
122 "Death Mountain Maze 0006",
123 "Death Mountain Maze 0007",
124 "Death Mountain Maze 0008",
125 "Spectacle Rock Maze 1",
126 "Spectacle Rock Maze 2",
127 "Spectacle Rock Maze 3",
128 "Hyrule Castle Tower",
129 "Swamp Palace",
130 "Palace of Darkness",
131 "Misery Mire",
132 "Skull Woods 1",
133 "Skull Woods 2",
134 "Skull Woods Big Chest",
135 "Skull Woods Boss Lair",
136 "Lost Woods Thieves' Lair",
137 "Ice Palace",
138 "Death Mountain Escape West",
139 "Death Mountain Escape East",
140 "Death Mountain Elder's Cave (Lower)",
141 "Death Mountain Elder's Cave (Upper)",
142 "Hyrule Castle Secret Cellar",
143 "Tower of Hera",
144 "Thieves's Town",
145 "Turtle Rock Main",
146 "Ganon's Pyramid Sanctum (Lower)",
147 "Ganon's Tower",
148 "Fairy Cave 1",
149 "Kakariko Western Well",
150 "Death Mountain Maze 0009",
151 "Death Mountain Maze 0010",
152 "Treasure Shell Game 1",
153 "Storyteller Cave 1",
154 "Snitch House 1",
155 "Snitch House 2",
156 "SickBoy House",
157 "Byrna Gauntlet",
158 "Kakariko Pub South",
159 "Kakariko Pub North",
160 "Kakariko Inn",
161 "Sahasrahlah's Disco Infernum",
162 "Kakariko's Lame Shop",
163 "Village of Outcasts Chest Game",
164 "Village of Outcasts Orphanage",
165 "Kakariko Library",
166 "Kakariko Storage Shed",
167 "Kakariko Sweeper Lady's House",
168 "Potion Shop",
169 "Aginah's Desert Cottage",
170 "Watergate",
171 "Death Mountain Maze 0011",
172 "Fairy Cave 2",
173 "Refill Cave 0001",
174 "Refill Cave 0002",
175 "The Bomb \"Shop\"",
176 "Village of Outcasts Retirement Center",
177 "Fairy Cave 3",
178 "Good Bee Cave",
179 "General Store 1",
180 "General Store 2",
181 "Archery Game",
182 "Storyteller Cave 2",
183 "Hall of the Invisibility Cape",
184 "Pond of Wishing",
185 "Pond of Happiness",
186 "Fairy Cave 4",
187 "Swamp of Evil Heart Piece Hall",
188 "General Store 3",
189 "Blind's Old Hideout",
190 "Storyteller Cave 3",
191 "Warped Pond of Wishing",
192 "Chez Smithies",
193 "Fortune Teller 1",
194 "Fortune Teller 2",
195 "Chest Shell Game 2",
196 "Storyteller Cave 4",
197 "Storyteller Cave 5",
198 "Storyteller Cave 6",
199 "Village House 1",
200 "Thief Hideout 1",
201 "Thief Hideout 2",
202 "Heart Piece Cave 1",
203 "Thief Hideout 3",
204 "Refill Cave 3",
205 "Fairy Cave 5",
206 "Heart Piece Cave 2",
207 "Hyrule Castle Prison",
208 "Hyrule Castle Throne Room",
209 "Hyrule Tower Agahnim's Sanctum",
210 "Skull Woods 3 (Drop In)",
211 "Skull Woods 4 (Drop In)",
212 "Skull Woods 5 (Drop In)",
213 "Skull Woods 6 (Drop In)",
214 "Lost Woods Thieves' Hideout (Drop In)",
215 "Ganon's Pyramid Sanctum (Upper)",
216 "Fairy Cave 6 (Drop In)",
217 "Hyrule Castle Secret Cellar (Drop In)",
218 "Mad Batter Lair (Drop In)",
219 "Under Lumberjacks' Weird Tree (Drop In)",
220 "Kakariko Western Well (Drop In)",
221 "Hyrule Sewers Goodies Room (Drop In)",
222 "Chris Houlihan Room (Drop In)",
223 "Heart Piece Cave 3 (Drop In)",
224 "Ice Rod Cave"};
225
226// TileTypeNames defined in common.cc to avoid static initialization order issues
227extern const std::string TileTypeNames[256];
228
229} // namespace yaze::zelda3
230
231#endif // YAZE_APP_ZELDA3_COMMON_H
Base class for all overworld and dungeon entities.
Definition common.h:31
virtual void UpdateMapProperties(uint16_t map_id, const void *context=nullptr)=0
Update entity properties based on map position.
enum yaze::zelda3::GameEntity::EntityType entity_type_
virtual ~GameEntity()
Definition common.h:66
auto set_x(int x)
Definition common.h:62
auto set_y(int y)
Definition common.h:63
Zelda 3 specific classes and functions.
Definition editor.h:35
constexpr int kNumOverworldMaps
Definition common.h:85
constexpr int OverworldCustomASMHasBeenApplied
Definition common.h:89
constexpr const char * kEntranceNames[]
Definition common.h:91
const std::string TileTypeNames[256]
Definition common.cc:6