Add RoomEntrance class, move entrance constants
This commit is contained in:
@@ -195,96 +195,7 @@ constexpr int text_data2 = 0x75F40;
|
||||
constexpr int pointers_dictionaries = 0x74703;
|
||||
constexpr int characters_width = 0x74ADF;
|
||||
|
||||
// ============================================================================
|
||||
// Dungeon Entrances Related Variables
|
||||
// ============================================================================
|
||||
|
||||
// 0x14577 word value for each room
|
||||
constexpr int entrance_room = 0x14813;
|
||||
|
||||
// 8 bytes per room, HU, FU, HD, FD, HL, FL, HR, FR
|
||||
constexpr int entrance_scrolledge = 0x1491D; // 0x14681
|
||||
constexpr int entrance_yscroll = 0x14D45; // 0x14AA9 2 bytes each room
|
||||
constexpr int entrance_xscroll = 0x14E4F; // 0x14BB3 2 bytes
|
||||
constexpr int entrance_yposition = 0x14F59; // 0x14CBD 2bytes
|
||||
constexpr int entrance_xposition = 0x15063; // 0x14DC7 2bytes
|
||||
constexpr int entrance_camerayposition = 0x1516D; // 0x14ED1 2bytes
|
||||
constexpr int entrance_cameraxposition = 0x15277; // 0x14FDB 2bytes
|
||||
|
||||
constexpr int entrance_gfx_group = 0x5D97;
|
||||
constexpr int entrance_blockset = 0x15381; // 0x150E5 1byte
|
||||
constexpr int entrance_floor = 0x15406; // 0x1516A 1byte
|
||||
constexpr int entrance_dungeon = 0x1548B; // 0x151EF 1byte (dungeon id)
|
||||
constexpr int entrance_door = 0x15510; // 0x15274 1byte
|
||||
|
||||
// 1 byte, ---b ---a b = bg2, a = need to check
|
||||
constexpr int entrance_ladderbg = 0x15595; // 0x152F9
|
||||
constexpr int entrance_scrolling = 0x1561A; // 0x1537E 1byte --h- --v-
|
||||
constexpr int entrance_scrollquadrant = 0x1569F; // 0x15403 1byte
|
||||
constexpr int entrance_exit = 0x15724; // 0x15488 2byte word
|
||||
constexpr int entrance_music = 0x1582E; // 0x15592
|
||||
|
||||
// word value for each room
|
||||
constexpr int startingentrance_room = 0x15B6E; // 0x158D2
|
||||
|
||||
// 8 bytes per room, HU, FU, HD, FD, HL, FL, HR, FR
|
||||
constexpr int startingentrance_scrolledge = 0x15B7C; // 0x158E0
|
||||
constexpr int startingentrance_yscroll = 0x15BB4; // 0x14AA9 //2bytes each room
|
||||
constexpr int startingentrance_xscroll = 0x15BC2; // 0x14BB3 //2bytes
|
||||
constexpr int startingentrance_yposition = 0x15BD0; // 0x14CBD 2bytes
|
||||
constexpr int startingentrance_xposition = 0x15BDE; // 0x14DC7 2bytes
|
||||
constexpr int startingentrance_camerayposition = 0x15BEC; // 0x14ED1 2bytes
|
||||
constexpr int startingentrance_cameraxposition = 0x15BFA; // 0x14FDB 2bytes
|
||||
|
||||
constexpr int startingentrance_blockset = 0x15C08; // 0x150E5 1byte
|
||||
constexpr int startingentrance_floor = 0x15C0F; // 0x1516A 1byte
|
||||
constexpr int startingentrance_dungeon = 0x15C16; // 0x151EF 1byte (dungeon id)
|
||||
|
||||
constexpr int startingentrance_door = 0x15C2B; // 0x15274 1byte
|
||||
|
||||
// 1 byte, ---b ---a b = bg2, a = need to check
|
||||
constexpr int startingentrance_ladderbg = 0x15C1D; // 0x152F9
|
||||
// 1byte --h- --v-
|
||||
constexpr int startingentrance_scrolling = 0x15C24; // 0x1537E
|
||||
constexpr int startingentrance_scrollquadrant = 0x15C2B; // 0x15403 1byte
|
||||
constexpr int startingentrance_exit = 0x15C32; // 0x15488 //2byte word
|
||||
constexpr int startingentrance_music = 0x15C4E; // 0x15592
|
||||
constexpr int startingentrance_entrance = 0x15C40;
|
||||
|
||||
constexpr int items_data_start = 0xDDE9; // save purpose
|
||||
constexpr int items_data_end = 0xE6B2; // save purpose
|
||||
constexpr int initial_equipement = 0x271A6;
|
||||
constexpr int messages_id_dungeon = 0x3F61D;
|
||||
|
||||
// item id you get instead if you already have that item
|
||||
constexpr int chests_backupitems = 0x3B528;
|
||||
constexpr int chests_yoffset = 0x4836C;
|
||||
constexpr int chests_xoffset = 0x4836C + (76 * 1);
|
||||
constexpr int chests_itemsgfx = 0x4836C + (76 * 2);
|
||||
constexpr int chests_itemswide = 0x4836C + (76 * 3);
|
||||
constexpr int chests_itemsproperties = 0x4836C + (76 * 4);
|
||||
constexpr int chests_sramaddress = 0x4836C + (76 * 5);
|
||||
constexpr int chests_sramvalue = 0x4836C + (76 * 7);
|
||||
constexpr int chests_msgid = 0x442DD;
|
||||
|
||||
constexpr int dungeons_startrooms = 0x7939;
|
||||
constexpr int dungeons_endrooms = 0x792D;
|
||||
constexpr int dungeons_bossrooms = 0x10954; // short value
|
||||
|
||||
// Bed Related Values (Starting location)
|
||||
constexpr int bedPositionX = 0x039A37; // short value
|
||||
constexpr int bedPositionY = 0x039A32; // short value
|
||||
|
||||
// short value (on 2 different bytes)
|
||||
constexpr int bedPositionResetXLow = 0x02DE53;
|
||||
constexpr int bedPositionResetXHigh = 0x02DE58;
|
||||
|
||||
// short value (on 2 different bytes)
|
||||
constexpr int bedPositionResetYLow = 0x02DE5D;
|
||||
constexpr int bedPositionResetYHigh = 0x02DE62;
|
||||
|
||||
constexpr int bedSheetPositionX = 0x0480BD; // short value
|
||||
constexpr int bedSheetPositionY = 0x0480B8; // short value
|
||||
|
||||
// ============================================================================
|
||||
// Gravestones related variables
|
||||
|
||||
@@ -39,7 +39,6 @@ namespace dungeon {
|
||||
constexpr int room_object_layout_pointer = 0x882D;
|
||||
constexpr int room_object_pointer = 0x874C; // Long pointer
|
||||
|
||||
constexpr int entrance_gfx_group = 0x5D97;
|
||||
constexpr int dungeons_main_bg_palette_pointers = 0xDEC4B; // JP Same
|
||||
constexpr int dungeons_palettes = 0xDD734;
|
||||
constexpr int room_items_pointers = 0xDB69; // JP 0xDB67
|
||||
|
||||
331
src/app/zelda3/dungeon/room_entrance.h
Normal file
331
src/app/zelda3/dungeon/room_entrance.h
Normal file
@@ -0,0 +1,331 @@
|
||||
#ifndef YAZE_APP_ZELDA3_DUNGEON_ROOM_ENTRANCE_H
|
||||
#define YAZE_APP_ZELDA3_DUNGEON_ROOM_ENTRANCE_H
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#include "app/rom.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace app {
|
||||
namespace zelda3 {
|
||||
namespace dungeon {
|
||||
|
||||
// ============================================================================
|
||||
// Dungeon Entrances Related Variables
|
||||
// ============================================================================
|
||||
|
||||
// 0x14577 word value for each room
|
||||
constexpr int entrance_room = 0x14813;
|
||||
|
||||
// 8 bytes per room, HU, FU, HD, FD, HL, FL, HR, FR
|
||||
constexpr int entrance_scrolledge = 0x1491D; // 0x14681
|
||||
constexpr int entrance_yscroll = 0x14D45; // 0x14AA9 2 bytes each room
|
||||
constexpr int entrance_xscroll = 0x14E4F; // 0x14BB3 2 bytes
|
||||
constexpr int entrance_yposition = 0x14F59; // 0x14CBD 2bytes
|
||||
constexpr int entrance_xposition = 0x15063; // 0x14DC7 2bytes
|
||||
constexpr int entrance_cameraytrigger = 0x1516D; // 0x14ED1 2bytes
|
||||
constexpr int entrance_cameraxtrigger = 0x15277; // 0x14FDB 2bytes
|
||||
|
||||
constexpr int entrance_blockset = 0x15381; // 0x150E5 1byte
|
||||
constexpr int entrance_floor = 0x15406; // 0x1516A 1byte
|
||||
constexpr int entrance_dungeon = 0x1548B; // 0x151EF 1byte (dungeon id)
|
||||
constexpr int entrance_door = 0x15510; // 0x15274 1byte
|
||||
|
||||
// 1 byte, ---b ---a b = bg2, a = need to check
|
||||
constexpr int entrance_ladderbg = 0x15595; // 0x152F9
|
||||
constexpr int entrance_scrolling = 0x1561A; // 0x1537E 1byte --h- --v-
|
||||
constexpr int entrance_scrollquadrant = 0x1569F; // 0x15403 1byte
|
||||
constexpr int entrance_exit = 0x15724; // 0x15488 2byte word
|
||||
constexpr int entrance_music = 0x1582E; // 0x15592
|
||||
|
||||
// word value for each room
|
||||
constexpr int startingentrance_room = 0x15B6E; // 0x158D2
|
||||
|
||||
// 8 bytes per room, HU, FU, HD, FD, HL, FL, HR, FR
|
||||
constexpr int startingentrance_scrolledge = 0x15B7C; // 0x158E0
|
||||
constexpr int startingentrance_yscroll = 0x15BB4; // 0x14AA9 //2bytes each room
|
||||
constexpr int startingentrance_xscroll = 0x15BC2; // 0x14BB3 //2bytes
|
||||
constexpr int startingentrance_yposition = 0x15BD0; // 0x14CBD 2bytes
|
||||
constexpr int startingentrance_xposition = 0x15BDE; // 0x14DC7 2bytes
|
||||
constexpr int startingentrance_cameraytrigger = 0x15BEC; // 0x14ED1 2bytes
|
||||
constexpr int startingentrance_cameraxtrigger = 0x15BFA; // 0x14FDB 2bytes
|
||||
|
||||
constexpr int startingentrance_blockset = 0x15C08; // 0x150E5 1byte
|
||||
constexpr int startingentrance_floor = 0x15C0F; // 0x1516A 1byte
|
||||
constexpr int startingentrance_dungeon = 0x15C16; // 0x151EF 1byte (dungeon id)
|
||||
|
||||
constexpr int startingentrance_door = 0x15C2B; // 0x15274 1byte
|
||||
|
||||
// 1 byte, ---b ---a b = bg2, a = need to check
|
||||
constexpr int startingentrance_ladderbg = 0x15C1D; // 0x152F9
|
||||
// 1byte --h- --v-
|
||||
constexpr int startingentrance_scrolling = 0x15C24; // 0x1537E
|
||||
constexpr int startingentrance_scrollquadrant = 0x15C2B; // 0x15403 1byte
|
||||
constexpr int startingentrance_exit = 0x15C32; // 0x15488 //2byte word
|
||||
constexpr int startingentrance_music = 0x15C4E; // 0x15592
|
||||
constexpr int startingentrance_entrance = 0x15C40;
|
||||
|
||||
constexpr int items_data_start = 0xDDE9; // save purpose
|
||||
constexpr int items_data_end = 0xE6B2; // save purpose
|
||||
constexpr int initial_equipement = 0x271A6;
|
||||
|
||||
// item id you get instead if you already have that item
|
||||
constexpr int chests_backupitems = 0x3B528;
|
||||
constexpr int chests_yoffset = 0x4836C;
|
||||
constexpr int chests_xoffset = 0x4836C + (76 * 1);
|
||||
constexpr int chests_itemsgfx = 0x4836C + (76 * 2);
|
||||
constexpr int chests_itemswide = 0x4836C + (76 * 3);
|
||||
constexpr int chests_itemsproperties = 0x4836C + (76 * 4);
|
||||
constexpr int chests_sramaddress = 0x4836C + (76 * 5);
|
||||
constexpr int chests_sramvalue = 0x4836C + (76 * 7);
|
||||
constexpr int chests_msgid = 0x442DD;
|
||||
|
||||
constexpr int dungeons_startrooms = 0x7939;
|
||||
constexpr int dungeons_endrooms = 0x792D;
|
||||
constexpr int dungeons_bossrooms = 0x10954; // short value
|
||||
|
||||
// Bed Related Values (Starting location)
|
||||
constexpr int bedPositionX = 0x039A37; // short value
|
||||
constexpr int bedPositionY = 0x039A32; // short value
|
||||
|
||||
// short value (on 2 different bytes)
|
||||
constexpr int bedPositionResetXLow = 0x02DE53;
|
||||
constexpr int bedPositionResetXHigh = 0x02DE58;
|
||||
|
||||
// short value (on 2 different bytes)
|
||||
constexpr int bedPositionResetYLow = 0x02DE5D;
|
||||
constexpr int bedPositionResetYHigh = 0x02DE62;
|
||||
|
||||
constexpr int bedSheetPositionX = 0x0480BD; // short value
|
||||
constexpr int bedSheetPositionY = 0x0480B8; // short value
|
||||
|
||||
class RoomEntrance {
|
||||
public:
|
||||
RoomEntrance() = default;
|
||||
|
||||
RoomEntrance(ROM& rom, uint8_t entrance_id, bool is_spawn_point = false)
|
||||
: entrance_id_(entrance_id) {
|
||||
room_ =
|
||||
static_cast<short>((rom[entrance_room + (entrance_id * 2) + 1] << 8) +
|
||||
rom[entrance_room + (entrance_id * 2)]);
|
||||
y_position_ = static_cast<ushort>(
|
||||
(rom[entrance_yposition + (entrance_id * 2) + 1] << 8) +
|
||||
rom[entrance_yposition + (entrance_id * 2)]);
|
||||
x_position_ = static_cast<ushort>(
|
||||
(rom[entrance_xposition + (entrance_id * 2) + 1] << 8) +
|
||||
rom[entrance_xposition + (entrance_id * 2)]);
|
||||
camera_x_ = static_cast<ushort>(
|
||||
(rom[entrance_xscroll + (entrance_id * 2) + 1] << 8) +
|
||||
rom[entrance_xscroll + (entrance_id * 2)]);
|
||||
camera_y_ = static_cast<ushort>(
|
||||
(rom[entrance_yscroll + (entrance_id * 2) + 1] << 8) +
|
||||
rom[entrance_yscroll + (entrance_id * 2)]);
|
||||
camera_trigger_y_ = static_cast<ushort>(
|
||||
(rom[(entrance_cameraytrigger + (entrance_id * 2)) + 1] << 8) +
|
||||
rom[entrance_cameraytrigger + (entrance_id * 2)]);
|
||||
camera_trigger_x_ = static_cast<ushort>(
|
||||
(rom[(entrance_cameraxtrigger + (entrance_id * 2)) + 1] << 8) +
|
||||
rom[entrance_cameraxtrigger + (entrance_id * 2)]);
|
||||
blockset_ = rom[entrance_blockset + entrance_id];
|
||||
music_ = rom[entrance_music + entrance_id];
|
||||
dungeon_id_ = rom[entrance_dungeon + entrance_id];
|
||||
floor_ = rom[entrance_floor + entrance_id];
|
||||
door_ = rom[entrance_door + entrance_id];
|
||||
ladder_bg_ = rom[entrance_ladderbg + entrance_id];
|
||||
scrolling_ = rom[entrance_scrolling + entrance_id];
|
||||
scroll_quadrant_ = rom[entrance_scrollquadrant + entrance_id];
|
||||
exit_ =
|
||||
static_cast<short>((rom[entrance_exit + (entrance_id * 2) + 1] << 8) +
|
||||
rom[entrance_exit + (entrance_id * 2)]);
|
||||
|
||||
camera_boundary_qn_ = rom[entrance_scrolledge + 0 + (entrance_id * 8)];
|
||||
camera_boundary_fn_ = rom[entrance_scrolledge + 1 + (entrance_id * 8)];
|
||||
camera_boundary_qs_ = rom[entrance_scrolledge + 2 + (entrance_id * 8)];
|
||||
camera_boundary_fs_ = rom[entrance_scrolledge + 3 + (entrance_id * 8)];
|
||||
camera_boundary_qw_ = rom[entrance_scrolledge + 4 + (entrance_id * 8)];
|
||||
camera_boundary_fw_ = rom[entrance_scrolledge + 5 + (entrance_id * 8)];
|
||||
camera_boundary_qe_ = rom[entrance_scrolledge + 6 + (entrance_id * 8)];
|
||||
camera_boundary_fe_ = rom[entrance_scrolledge + 7 + (entrance_id * 8)];
|
||||
|
||||
if (is_spawn_point) {
|
||||
room_ = static_cast<short>(
|
||||
(rom[startingentrance_room + (entrance_id * 2) + 1] << 8) +
|
||||
rom[startingentrance_room + (entrance_id * 2)]);
|
||||
|
||||
y_position_ = static_cast<ushort>(
|
||||
(rom[startingentrance_yposition + (entrance_id * 2) + 1] << 8) +
|
||||
rom[startingentrance_yposition + (entrance_id * 2)]);
|
||||
|
||||
x_position_ = static_cast<ushort>(
|
||||
(rom[startingentrance_xposition + (entrance_id * 2) + 1] << 8) +
|
||||
rom[startingentrance_xposition + (entrance_id * 2)]);
|
||||
|
||||
camera_x_ = static_cast<ushort>(
|
||||
(rom[startingentrance_xscroll + (entrance_id * 2) + 1] << 8) +
|
||||
rom[startingentrance_xscroll + (entrance_id * 2)]);
|
||||
|
||||
camera_y_ = static_cast<ushort>(
|
||||
(rom[startingentrance_yscroll + (entrance_id * 2) + 1] << 8) +
|
||||
rom[startingentrance_yscroll + (entrance_id * 2)]);
|
||||
|
||||
camera_trigger_y_ = static_cast<ushort>(
|
||||
(rom[startingentrance_cameraytrigger + (entrance_id * 2) + 1] << 8) +
|
||||
rom[startingentrance_cameraytrigger + (entrance_id * 2)]);
|
||||
|
||||
camera_trigger_x_ = static_cast<ushort>(
|
||||
(rom[startingentrance_cameraxtrigger + (entrance_id * 2) + 1] << 8) +
|
||||
rom[startingentrance_cameraxtrigger + (entrance_id * 2)]);
|
||||
|
||||
blockset_ = rom[startingentrance_blockset + entrance_id];
|
||||
music_ = rom[startingentrance_music + entrance_id];
|
||||
dungeon_id_ = rom[startingentrance_dungeon + entrance_id];
|
||||
floor_ = rom[startingentrance_floor + entrance_id];
|
||||
door_ = rom[startingentrance_door + entrance_id];
|
||||
|
||||
ladder_bg_ = rom[startingentrance_ladderbg + entrance_id];
|
||||
scrolling_ = rom[startingentrance_scrolling + entrance_id];
|
||||
scroll_quadrant_ = rom[startingentrance_scrollquadrant + entrance_id];
|
||||
|
||||
exit_ = static_cast<short>(
|
||||
((rom[startingentrance_exit + (entrance_id * 2) + 1] & 0x01) << 8) +
|
||||
rom[startingentrance_exit + (entrance_id * 2)]);
|
||||
|
||||
camera_boundary_qn_ =
|
||||
rom[startingentrance_scrolledge + 0 + (entrance_id * 8)];
|
||||
camera_boundary_fn_ =
|
||||
rom[startingentrance_scrolledge + 1 + (entrance_id * 8)];
|
||||
camera_boundary_qs_ =
|
||||
rom[startingentrance_scrolledge + 2 + (entrance_id * 8)];
|
||||
camera_boundary_fs_ =
|
||||
rom[startingentrance_scrolledge + 3 + (entrance_id * 8)];
|
||||
camera_boundary_qw_ =
|
||||
rom[startingentrance_scrolledge + 4 + (entrance_id * 8)];
|
||||
camera_boundary_fw_ =
|
||||
rom[startingentrance_scrolledge + 5 + (entrance_id * 8)];
|
||||
camera_boundary_qe_ =
|
||||
rom[startingentrance_scrolledge + 6 + (entrance_id * 8)];
|
||||
camera_boundary_fe_ =
|
||||
rom[startingentrance_scrolledge + 7 + (entrance_id * 8)];
|
||||
}
|
||||
}
|
||||
|
||||
void Save(ROM& rom, int entrance_id, bool is_spawn_point = false) {
|
||||
if (!is_spawn_point) {
|
||||
rom.WriteShort(entrance_room + (entrance_id * 2), room_);
|
||||
rom.WriteShort(entrance_yposition + (entrance_id * 2), y_position_);
|
||||
rom.WriteShort(entrance_xposition + (entrance_id * 2), x_position_);
|
||||
rom.WriteShort(entrance_yscroll + (entrance_id * 2), camera_y_);
|
||||
rom.WriteShort(entrance_xscroll + (entrance_id * 2), camera_x_);
|
||||
rom.WriteShort(entrance_cameraxtrigger + (entrance_id * 2),
|
||||
camera_trigger_x_);
|
||||
rom.WriteShort(entrance_cameraytrigger + (entrance_id * 2),
|
||||
camera_trigger_y_);
|
||||
|
||||
rom.WriteShort(entrance_exit + (entrance_id * 2), exit_);
|
||||
rom.Write(entrance_blockset + entrance_id, (uint8_t)(blockset_ & 0xFF));
|
||||
rom.Write(entrance_music + entrance_id, (uint8_t)(music_ & 0xFF));
|
||||
rom.Write(entrance_dungeon + entrance_id, (uint8_t)(dungeon_id_ & 0xFF));
|
||||
rom.Write(entrance_door + entrance_id, (uint8_t)(door_ & 0xFF));
|
||||
rom.Write(entrance_floor + entrance_id, (uint8_t)(floor_ & 0xFF));
|
||||
rom.Write(entrance_ladderbg + entrance_id, (uint8_t)(ladder_bg_ & 0xFF));
|
||||
rom.Write(entrance_scrolling + entrance_id, (uint8_t)(scrolling_ & 0xFF));
|
||||
rom.Write(entrance_scrollquadrant + entrance_id,
|
||||
(uint8_t)(scroll_quadrant_ & 0xFF));
|
||||
|
||||
rom.Write(entrance_scrolledge + 0 + (entrance_id * 8),
|
||||
camera_boundary_qn_);
|
||||
rom.Write(entrance_scrolledge + 1 + (entrance_id * 8),
|
||||
camera_boundary_fn_);
|
||||
rom.Write(entrance_scrolledge + 2 + (entrance_id * 8),
|
||||
camera_boundary_qs_);
|
||||
rom.Write(entrance_scrolledge + 3 + (entrance_id * 8),
|
||||
camera_boundary_fs_);
|
||||
rom.Write(entrance_scrolledge + 4 + (entrance_id * 8),
|
||||
camera_boundary_qw_);
|
||||
rom.Write(entrance_scrolledge + 5 + (entrance_id * 8),
|
||||
camera_boundary_fw_);
|
||||
rom.Write(entrance_scrolledge + 6 + (entrance_id * 8),
|
||||
camera_boundary_qe_);
|
||||
rom.Write(entrance_scrolledge + 7 + (entrance_id * 8),
|
||||
camera_boundary_fe_);
|
||||
} else {
|
||||
rom.WriteShort(startingentrance_room + (entrance_id * 2), room_);
|
||||
rom.WriteShort(startingentrance_yposition + (entrance_id * 2),
|
||||
y_position_);
|
||||
rom.WriteShort(startingentrance_xposition + (entrance_id * 2),
|
||||
x_position_);
|
||||
rom.WriteShort(startingentrance_yscroll + (entrance_id * 2), camera_y_);
|
||||
rom.WriteShort(startingentrance_xscroll + (entrance_id * 2), camera_x_);
|
||||
rom.WriteShort(startingentrance_cameraxtrigger + (entrance_id * 2),
|
||||
camera_trigger_x_);
|
||||
rom.WriteShort(startingentrance_cameraytrigger + (entrance_id * 2),
|
||||
camera_trigger_y_);
|
||||
rom.WriteShort(startingentrance_exit + (entrance_id * 2), exit_);
|
||||
|
||||
rom.Write(startingentrance_blockset + entrance_id,
|
||||
(uint8_t)(blockset_ & 0xFF));
|
||||
rom.Write(startingentrance_music + entrance_id, (uint8_t)(music_ & 0xFF));
|
||||
rom.Write(startingentrance_dungeon + entrance_id,
|
||||
(uint8_t)(dungeon_id_ & 0xFF));
|
||||
rom.Write(startingentrance_door + entrance_id, (uint8_t)(door_ & 0xFF));
|
||||
rom.Write(startingentrance_floor + entrance_id, (uint8_t)(floor_ & 0xFF));
|
||||
rom.Write(startingentrance_ladderbg + entrance_id,
|
||||
(uint8_t)(ladder_bg_ & 0xFF));
|
||||
rom.Write(startingentrance_scrolling + entrance_id,
|
||||
(uint8_t)(scrolling_ & 0xFF));
|
||||
rom.Write(startingentrance_scrollquadrant + entrance_id,
|
||||
(uint8_t)(scroll_quadrant_ & 0xFF));
|
||||
rom.Write(startingentrance_scrolledge + 0 + (entrance_id * 8),
|
||||
camera_boundary_qn_);
|
||||
rom.Write(startingentrance_scrolledge + 1 + (entrance_id * 8),
|
||||
camera_boundary_fn_);
|
||||
rom.Write(startingentrance_scrolledge + 2 + (entrance_id * 8),
|
||||
camera_boundary_qs_);
|
||||
rom.Write(startingentrance_scrolledge + 3 + (entrance_id * 8),
|
||||
camera_boundary_fs_);
|
||||
rom.Write(startingentrance_scrolledge + 4 + (entrance_id * 8),
|
||||
camera_boundary_qw_);
|
||||
rom.Write(startingentrance_scrolledge + 5 + (entrance_id * 8),
|
||||
camera_boundary_fw_);
|
||||
rom.Write(startingentrance_scrolledge + 6 + (entrance_id * 8),
|
||||
camera_boundary_qe_);
|
||||
rom.Write(startingentrance_scrolledge + 7 + (entrance_id * 8),
|
||||
camera_boundary_fe_);
|
||||
}
|
||||
}
|
||||
|
||||
uint16_t entrance_id_;
|
||||
uint16_t x_position_;
|
||||
uint16_t y_position_;
|
||||
uint16_t camera_x_;
|
||||
uint16_t camera_y_;
|
||||
uint16_t camera_trigger_x_;
|
||||
uint16_t camera_trigger_y_;
|
||||
|
||||
int16_t room_;
|
||||
uint8_t blockset_;
|
||||
uint8_t floor_;
|
||||
uint8_t dungeon_id_;
|
||||
uint8_t ladder_bg_;
|
||||
uint8_t scrolling_;
|
||||
uint8_t scroll_quadrant_;
|
||||
int16_t exit_;
|
||||
uint8_t music_;
|
||||
uint8_t door_;
|
||||
|
||||
uint8_t camera_boundary_qn_;
|
||||
uint8_t camera_boundary_fn_;
|
||||
uint8_t camera_boundary_qs_;
|
||||
uint8_t camera_boundary_fs_;
|
||||
uint8_t camera_boundary_qw_;
|
||||
uint8_t camera_boundary_fw_;
|
||||
uint8_t camera_boundary_qe_;
|
||||
uint8_t camera_boundary_fe_;
|
||||
};
|
||||
|
||||
} // namespace dungeon
|
||||
} // namespace zelda3
|
||||
} // namespace app
|
||||
} // namespace yaze
|
||||
|
||||
#endif // YAZE_APP_ZELDA3_DUNGEON_ROOM_ENTRANCE_H
|
||||
@@ -310,39 +310,140 @@ constexpr std::string_view kRoomNames[] = {
|
||||
"Mazeblock Cave",
|
||||
"Smith Peg Cave"};
|
||||
|
||||
class Room_Name {
|
||||
public:
|
||||
static std::vector<std::string> room_name;
|
||||
|
||||
static void loadFromFile(const std::string& file = "DefaultNames.txt") {
|
||||
std::ifstream ifs(file);
|
||||
std::string line;
|
||||
int l = 0;
|
||||
bool found = false;
|
||||
|
||||
while (getline(ifs, line)) {
|
||||
if (line == "[Rooms Names]") {
|
||||
l = 0;
|
||||
found = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (found) {
|
||||
if (line.length() > 0) {
|
||||
if (line[0] == '/' && line[1] == '/') {
|
||||
continue;
|
||||
}
|
||||
if (l >= 0x4B) {
|
||||
break;
|
||||
}
|
||||
|
||||
room_name[l] = line;
|
||||
l++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
constexpr std::string_view kEntranceNames[] = {
|
||||
"Link's House Intro",
|
||||
"Link's House Post-intro",
|
||||
"Sanctuary",
|
||||
"Hyrule Castle West",
|
||||
"Hyrule Castle Central",
|
||||
"Hyrule Castle East",
|
||||
"Death Mountain Express (Lower)",
|
||||
"Death Mountain Express (Upper)",
|
||||
"Eastern Palace",
|
||||
"Desert Palace Central",
|
||||
"Desert Palace East",
|
||||
"Desert Palace West",
|
||||
"Desert Palace Boss Lair",
|
||||
"Kakariko Elder's House West",
|
||||
"Kakariko Elder's House East",
|
||||
"Kakariko Angry Bros West",
|
||||
"Kakariko Angry Bros East",
|
||||
"Mad Batter Lair",
|
||||
"Under Lumberjacks' Weird Tree",
|
||||
"Death Mountain Maze 0000",
|
||||
"Death Mountain Maze 0001",
|
||||
"Turtle Rock Mountainface 1",
|
||||
"Death Mountain Cape Heart Piece Cave (Lower)",
|
||||
"Death Mountain Cape Heart Piece Cave (Upper)",
|
||||
"Turtle Rock Mountainface 2",
|
||||
"Turtle Rock Mountainface 3",
|
||||
"Death Mountain Maze 0002",
|
||||
"Death Mountain Maze 0003",
|
||||
"Death Mountain Maze 0004",
|
||||
"Death Mountain Maze 0005",
|
||||
"Death Mountain Maze 0006",
|
||||
"Death Mountain Maze 0007",
|
||||
"Death Mountain Maze 0008",
|
||||
"Spectacle Rock Maze 1",
|
||||
"Spectacle Rock Maze 2",
|
||||
"Spectacle Rock Maze 3",
|
||||
"Hyrule Castle Tower",
|
||||
"Swamp Palace",
|
||||
"Palace of Darkness",
|
||||
"Misery Mire",
|
||||
"Skull Woods 1",
|
||||
"Skull Woods 2",
|
||||
"Skull Woods Big Chest",
|
||||
"Skull Woods Boss Lair",
|
||||
"Lost Woods Thieves' Lair",
|
||||
"Ice Palace",
|
||||
"Death Mountain Escape West",
|
||||
"Death Mountain Escape East",
|
||||
"Death Mountain Elder's Cave (Lower)",
|
||||
"Death Mountain Elder's Cave (Upper)",
|
||||
"Hyrule Castle Secret Cellar",
|
||||
"Tower of Hera",
|
||||
"Thieves's Town",
|
||||
"Turtle Rock Main",
|
||||
"Ganon's Pyramid Sanctum (Lower)",
|
||||
"Ganon's Tower",
|
||||
"Fairy Cave 1",
|
||||
"Kakariko Western Well",
|
||||
"Death Mountain Maze 0009",
|
||||
"Death Mountain Maze 0010",
|
||||
"Treasure Shell Game 1",
|
||||
"Storyteller Cave 1",
|
||||
"Snitch House 1",
|
||||
"Snitch House 2",
|
||||
"SickBoy House",
|
||||
"Byrna Gauntlet",
|
||||
"Kakariko Pub South",
|
||||
"Kakariko Pub North",
|
||||
"Kakariko Inn",
|
||||
"Sahasrahlah's Disco Infernum",
|
||||
"Kakariko's Lame Shop",
|
||||
"Village of Outcasts Chest Game",
|
||||
"Village of Outcasts Orphanage",
|
||||
"Kakariko Library",
|
||||
"Kakariko Storage Shed",
|
||||
"Kakariko Sweeper Lady's House",
|
||||
"Potion Shop",
|
||||
"Aginah's Desert Cottage",
|
||||
"Watergate",
|
||||
"Death Mountain Maze 0011",
|
||||
"Fairy Cave 2",
|
||||
"Refill Cave 0001",
|
||||
"Refill Cave 0002",
|
||||
"The Bomb \"Shop\"",
|
||||
"Village of Outcasts Retirement Center",
|
||||
"Fairy Cave 3",
|
||||
"Good Bee Cave",
|
||||
"General Store 1",
|
||||
"General Store 2",
|
||||
"Archery Game",
|
||||
"Storyteller Cave 2",
|
||||
"Hall of the Invisibility Cape",
|
||||
"Pond of Wishing",
|
||||
"Pond of Happiness",
|
||||
"Fairy Cave 4",
|
||||
"Swamp of Evil Heart Piece Hall",
|
||||
"General Store 3",
|
||||
"Blind's Old Hideout",
|
||||
"Storyteller Cave 3",
|
||||
"Warped Pond of Wishing",
|
||||
"Chez Smithies",
|
||||
"Fortune Teller 1",
|
||||
"Fortune Teller 2",
|
||||
"Chest Shell Game 2",
|
||||
"Storyteller Cave 4",
|
||||
"Storyteller Cave 5",
|
||||
"Storyteller Cave 6",
|
||||
"Village House 1",
|
||||
"Thief Hideout 1",
|
||||
"Thief Hideout 2",
|
||||
"Heart Piece Cave 1",
|
||||
"Thief Hideout 3",
|
||||
"Refill Cave 3",
|
||||
"Fairy Cave 5",
|
||||
"Heart Piece Cave 2",
|
||||
"Hyrule Castle Prison",
|
||||
"Hyrule Castle Throne Room",
|
||||
"Hyrule Tower Agahnim's Sanctum",
|
||||
"Skull Woods 3 (Drop In)",
|
||||
"Skull Woods 4 (Drop In)",
|
||||
"Skull Woods 5 (Drop In)",
|
||||
"Skull Woods 6 (Drop In)",
|
||||
"Lost Woods Thieves' Hideout (Drop In)",
|
||||
"Ganon's Pyramid Sanctum (Upper)",
|
||||
"Fairy Cave 6 (Drop In)",
|
||||
"Hyrule Castle Secret Cellar (Drop In)",
|
||||
"Mad Batter Lair (Drop In)",
|
||||
"Under Lumberjacks' Weird Tree (Drop In)",
|
||||
"Kakariko Western Well (Drop In)",
|
||||
"Hyrule Sewers Goodies Room (Drop In)",
|
||||
"Chris Houlihan Room (Drop In)",
|
||||
"Heart Piece Cave 3 (Drop In)",
|
||||
"Ice Rod Cave"};
|
||||
|
||||
} // namespace dungeon
|
||||
} // namespace zelda3
|
||||
|
||||
Reference in New Issue
Block a user