yaze 0.2.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
dungeon_map.h
Go to the documentation of this file.
1#ifndef YAZE_APP_ZELDA3_SCREEN_DUNGEON_MAP_H
2#define YAZE_APP_ZELDA3_SCREEN_DUNGEON_MAP_H
3
4#include <array>
5#include <vector>
6
7#include "absl/status/status.h"
8#include "app/gfx/tilesheet.h"
9#include "app/rom.h"
10
11namespace yaze {
12namespace zelda3 {
13
14constexpr int kDungeonMapRoomsPtr = 0x57605; // 14 pointers of map data
15constexpr int kDungeonMapFloors = 0x575D9; // 14 words values
16
17constexpr int kDungeonMapGfxPtr = 0x57BE4; // 14 pointers of gfx data
18
19// data start for floors/gfx MUST skip 575D9 to 57621 (pointers)
20constexpr int kDungeonMapDataStart = 0x57039;
21
22// IF Byte = 0xB9 dungeon maps are not expanded
23constexpr int kDungeonMapExpCheck = 0x56652; // $0A:E652
24constexpr int kDungeonMapTile16 = 0x57009; // $0A:F009
25constexpr int kDungeonMapTile16Expanded = 0x109010; // $21:9010
26
27// 14 words values 0x000F = no boss
28constexpr int kDungeonMapBossRooms = 0x56807;
29constexpr int kTriforceVertices = 0x04FFD2; // group of 3, X, Y ,Z
30constexpr int kTriforceFaces = 0x04FFE4; // group of 5
31
32constexpr int kCrystalVertices = 0x04FF98;
33
34struct DungeonMap {
35 unsigned short boss_room = 0xFFFF;
36 unsigned char nbr_of_floor = 0;
37 unsigned char nbr_of_basement = 0;
38 std::vector<std::array<uint8_t, 25>> floor_rooms;
39 std::vector<std::array<uint8_t, 25>> floor_gfx;
40
41 DungeonMap(unsigned short boss_room, unsigned char nbr_of_floor,
42 unsigned char nbr_of_basement,
43 const std::vector<std::array<uint8_t, 25>> &floor_rooms,
44 const std::vector<std::array<uint8_t, 25>> &floor_gfx)
50};
51
52absl::Status LoadDungeonMapTile16(const std::vector<uint8_t> &gfx_data,
53 bool bin_mode);
54
55absl::Status LoadDungeonMapGfxFromBinary(Rom &rom,
56 std::array<gfx::Bitmap, 4> &sheets,
57 gfx::Tilesheet &tile16_sheet,
58 std::vector<uint8_t> &gfx_bin_data);
59
60} // namespace zelda3
61} // namespace yaze
62
63#endif // YAZE_APP_ZELDA3_SCREEN_DUNGEON_MAP_H
The Rom class is used to load, save, and modify Rom data.
Definition rom.h:59
Represents a tilesheet, which is a collection of tiles stored in a bitmap.
Definition tilesheet.h:28
Zelda 3 specific classes and functions.
constexpr int kCrystalVertices
Definition dungeon_map.h:32
constexpr int kDungeonMapDataStart
Definition dungeon_map.h:20
constexpr int kDungeonMapExpCheck
Definition dungeon_map.h:23
absl::Status LoadDungeonMapTile16(const std::vector< uint8_t > &gfx_data, bool bin_mode)
absl::Status LoadDungeonMapGfxFromBinary(Rom &rom, std::array< gfx::Bitmap, 4 > &sheets, gfx::Tilesheet &tile16_sheet, std::vector< uint8_t > &gfx_bin_data)
constexpr int kDungeonMapFloors
Definition dungeon_map.h:15
constexpr int kDungeonMapTile16
Definition dungeon_map.h:24
constexpr int kDungeonMapTile16Expanded
Definition dungeon_map.h:25
constexpr int kDungeonMapBossRooms
Definition dungeon_map.h:28
constexpr int kDungeonMapRoomsPtr
Definition dungeon_map.h:14
constexpr int kTriforceVertices
Definition dungeon_map.h:29
constexpr int kTriforceFaces
Definition dungeon_map.h:30
constexpr int kDungeonMapGfxPtr
Definition dungeon_map.h:17
Main namespace for the application.
Definition controller.cc:18
DungeonMap(unsigned short boss_room, unsigned char nbr_of_floor, unsigned char nbr_of_basement, const std::vector< std::array< uint8_t, 25 > > &floor_rooms, const std::vector< std::array< uint8_t, 25 > > &floor_gfx)
Definition dungeon_map.h:41
unsigned char nbr_of_floor
Definition dungeon_map.h:36
std::vector< std::array< uint8_t, 25 > > floor_gfx
Definition dungeon_map.h:39
std::vector< std::array< uint8_t, 25 > > floor_rooms
Definition dungeon_map.h:38
unsigned char nbr_of_basement
Definition dungeon_map.h:37
unsigned short boss_room
Definition dungeon_map.h:35