diff --git a/src/app/core/constants.h b/src/app/core/constants.h index 54107f5c..97ff6e4a 100644 --- a/src/app/core/constants.h +++ b/src/app/core/constants.h @@ -324,30 +324,6 @@ constexpr int customAreaSpecificBGASM = 0x140150; constexpr int customAreaSpecificBGEnabled = 0x140140; // 1 byte, not 0 if enabled -// ============================================================================ -// Dungeon Map Related Variables -// ============================================================================ - -constexpr int dungeonMap_rooms_ptr = 0x57605; // 14 pointers of map data -constexpr int dungeonMap_floors = 0x575D9; // 14 words values - -constexpr int dungeonMap_gfx_ptr = 0x57BE4; // 14 pointers of gfx data - -// data start for floors/gfx MUST skip 575D9 to 57621 (pointers) -constexpr int dungeonMap_datastart = 0x57039; - -// IF Byte = 0xB9 dungeon maps are not expanded -constexpr int dungeonMap_expCheck = 0x56652; -constexpr int dungeonMap_tile16 = 0x57009; -constexpr int dungeonMap_tile16Exp = 0x109010; - -// 14 words values 0x000F = no boss -constexpr int dungeonMap_bossrooms = 0x56807; -constexpr int triforceVertices = 0x04FFD2; // group of 3, X, Y ,Z -constexpr int TriforceFaces = 0x04FFE4; // group of 5 - -constexpr int crystalVertices = 0x04FF98; - // ============================================================================ // Names // ============================================================================ diff --git a/src/app/zelda3/screen/dungeon_map.h b/src/app/zelda3/screen/dungeon_map.h new file mode 100644 index 00000000..6b9588ec --- /dev/null +++ b/src/app/zelda3/screen/dungeon_map.h @@ -0,0 +1,54 @@ +#ifndef YAZE_APP_ZELDA3_SCREEN_DUNGEON_MAP_H +#define YAZE_APP_ZELDA3_SCREEN_DUNGEON_MAP_H + +#include +#include + +namespace yaze { +namespace app { +namespace zelda3 { + +constexpr int kDungeonMapRoomsPtr = 0x57605; // 14 pointers of map data +constexpr int kDungeonMapFloors = 0x575D9; // 14 words values + +constexpr int kDungeonMapGfxPtr = 0x57BE4; // 14 pointers of gfx data + +// data start for floors/gfx MUST skip 575D9 to 57621 (pointers) +constexpr int kDungeonMapDataStart = 0x57039; + +// IF Byte = 0xB9 dungeon maps are not expanded +constexpr int kDungeonMapExpCheck = 0x56652; +constexpr int kDungeonMapTile16 = 0x57009; +constexpr int kDungeonMapTile16Expanded = 0x109010; + +// 14 words values 0x000F = no boss +constexpr int kDungeonMapBossRooms = 0x56807; +constexpr int kTriforceVertices = 0x04FFD2; // group of 3, X, Y ,Z +constexpr int TriforceFaces = 0x04FFE4; // group of 5 + +constexpr int crystalVertices = 0x04FF98; + +class DungeonMap { + public: + unsigned short boss_room = 0xFFFF; + unsigned char nbr_of_floor = 0; + unsigned char nbr_of_basement = 0; + std::vector> floor_rooms; + std::vector> floor_gfx; + + DungeonMap(unsigned short boss_room, unsigned char nbr_of_floor, + unsigned char nbr_of_basement, + const std::vector>& floor_rooms, + const std::vector>& floor_gfx) + : boss_room(boss_room), + nbr_of_floor(nbr_of_floor), + nbr_of_basement(nbr_of_basement), + floor_rooms(floor_rooms), + floor_gfx(floor_gfx) {} +}; + +} // namespace zelda3 +} // namespace app +} // namespace yaze + +#endif // YAZE_APP_ZELDA3_SCREEN_DUNGEON_MAP_H \ No newline at end of file