cleanup constants

This commit is contained in:
scawful
2024-08-20 23:09:10 -04:00
parent 10c46e6db1
commit a9d365f3b4
6 changed files with 589 additions and 609 deletions

View File

@@ -9,7 +9,6 @@
#include "app/gui/input.h"
#include "app/rom.h"
#include "app/zelda3/dungeon/object_names.h"
#include "app/zelda3/dungeon/room_names.h"
#include "imgui/imgui.h"
#include "zelda3/dungeon/room.h"

View File

@@ -37,8 +37,6 @@ class DungeonObjectRenderer : public SharedRom {
auto mutable_memory() { return &memory_; }
private:
uint16_t pc_with_rts_;
std::vector<uint8_t> tilemap_;
std::vector<uint8_t> rom_data_;

View File

@@ -2,6 +2,9 @@
#define YAZE_APP_ZELDA3_DUNGEON_ROOM_H
#include <cstdint>
#include <fstream>
#include <string>
#include <string_view>
#include <vector>
#include "app/core/constants.h"
@@ -10,7 +13,6 @@
#include "app/gfx/snes_tile.h"
#include "app/gui/canvas.h"
#include "app/rom.h"
#include "app/zelda3/dungeon/room_names.h"
#include "app/zelda3/dungeon/room_object.h"
#include "app/zelda3/sprite/sprite.h"
@@ -208,6 +210,441 @@ class Room : public SharedRom {
std::vector<int> room_addresses_;
};
constexpr std::string_view kRoomNames[] = {
"Ganon",
"Hyrule Castle (North Corridor)",
"Behind Sanctuary (Switch)",
"Houlihan",
"Turtle Rock (Crysta-Roller)",
"Empty",
"Swamp Palace (Arrghus[Boss])",
"Tower of Hera (Moldorm[Boss])",
"Cave (Healing Fairy)",
"Palace of Darkness",
"Palace of Darkness (Stalfos Trap)",
"Palace of Darkness (Turtle)",
"Ganon's Tower (Entrance)",
"Ganon's Tower (Agahnim2[Boss])",
"Ice Palace (Entrance )",
"Empty Clone ",
"Ganon Evacuation Route",
"Hyrule Castle (Bombable Stock )",
"Sanctuary",
"Turtle Rock (Hokku-Bokku Key 2)",
"Turtle Rock (Big Key )",
"Turtle Rock",
"Swamp Palace (Swimming Treadmill)",
"Tower of Hera (Moldorm Fall )",
"Cave",
"Palace of Darkness (Dark Maze)",
"Palace of Darkness (Big Chest )",
"Palace of Darkness (Mimics / Moving Wall )",
"Ganon's Tower (Ice Armos)",
"Ganon's Tower (Final Hallway)",
"Ice Palace (Bomb Floor / Bari )",
"Ice Palace (Pengator / Big Key )",
"Agahnim's Tower (Agahnim[Boss])",
"Hyrule Castle (Key-rat )",
"Hyrule Castle (Sewer Text Trigger )",
"Turtle Rock (West Exit to Balcony)",
"Turtle Rock (Double Hokku-Bokku / Big chest )",
"Empty Clone ",
"Swamp Palace (Statue )",
"Tower of Hera (Big Chest)",
"Swamp Palace (Entrance )",
"Skull Woods (Mothula[Boss])",
"Palace of Darkness (Big Hub )",
"Palace of Darkness (Map Chest / Fairy )",
"Cave",
"Empty Clone ",
"Ice Palace (Compass )",
"Cave (Kakariko Well HP)",
"Agahnim's Tower (Maiden Sacrifice Chamber)",
"Tower of Hera (Hardhat Beetles )",
"Hyrule Castle (Sewer Key Chest )",
"Desert Palace (Lanmolas[Boss])",
"Swamp Palace (Push Block Puzzle / Pre-Big Key )",
"Swamp Palace (Big Key / BS )",
"Swamp Palace (Big Chest )",
"Swamp Palace (Map Chest / Water Fill )",
"Swamp Palace (Key Pot )",
"Skull Woods (Gibdo Key / Mothula Hole )",
"Palace of Darkness (Bombable Floor )",
"Palace of Darkness (Spike Block / Conveyor )",
"Cave",
"Ganon's Tower (Torch 2)",
"Ice Palace (Stalfos Knights / Conveyor Hellway)",
"Ice Palace (Map Chest )",
"Agahnim's Tower (Final Bridge )",
"Hyrule Castle (First Dark )",
"Hyrule Castle (6 Ropes )",
"Desert Palace (Torch Puzzle / Moving Wall )",
"Thieves Town (Big Chest )",
"Thieves Town (Jail Cells )",
"Swamp Palace (Compass Chest )",
"Empty Clone ",
"Empty Clone ",
"Skull Woods (Gibdo Torch Puzzle )",
"Palace of Darkness (Entrance )",
"Palace of Darkness (Warps / South Mimics )",
"Ganon's Tower (Mini-Helmasaur Conveyor )",
"Ganon's Tower (Moldorm )",
"Ice Palace (Bomb-Jump )",
"Ice Palace Clone (Fairy )",
"Hyrule Castle (West Corridor)",
"Hyrule Castle (Throne )",
"Hyrule Castle (East Corridor)",
"Desert Palace (Popos 2 / Beamos Hellway )",
"Swamp Palace (Upstairs Pits )",
"Castle Secret Entrance / Uncle Death ",
"Skull Woods (Key Pot / Trap )",
"Skull Woods (Big Key )",
"Skull Woods (Big Chest )",
"Skull Woods (Final Section Entrance )",
"Palace of Darkness (Helmasaur King[Boss])",
"Ganon's Tower (Spike Pit )",
"Ganon's Tower (Ganon-Ball Z)",
"Ganon's Tower (Gauntlet 1/2/3)",
"Ice Palace (Lonely Firebar)",
"Ice Palace (Hidden Chest / Spike Floor )",
"Hyrule Castle (West Entrance )",
"Hyrule Castle (Main Entrance )",
"Hyrule Castle (East Entrance )",
"Desert Palace (Final Section Entrance )",
"Thieves Town (West Attic )",
"Thieves Town (East Attic )",
"Swamp Palace (Hidden Chest / Hidden Door )",
"Skull Woods (Compass Chest )",
"Skull Woods (Key Chest / Trap )",
"Empty Clone ",
"Palace of Darkness (Rupee )",
"Ganon's Tower (Mimics s)",
"Ganon's Tower (Lanmolas )",
"Ganon's Tower (Gauntlet 4/5)",
"Ice Palace (Pengators )",
"Empty Clone ",
"Hyrule Castle (Small Corridor to Jail Cells)",
"Hyrule Castle (Boomerang Chest )",
"Hyrule Castle (Map Chest )",
"Desert Palace (Big Chest )",
"Desert Palace (Map Chest )",
"Desert Palace (Big Key Chest )",
"Swamp Palace (Water Drain )",
"Tower of Hera (Entrance )",
"Empty Clone ",
"Empty Clone ",
"Empty Clone ",
"Ganon's Tower",
"Ganon's Tower (East Side Collapsing Bridge / Exploding Wall )",
"Ganon's Tower (Winder / Warp Maze )",
"Ice Palace (Hidden Chest / Bombable Floor )",
"Ice Palace ( Big Spike Traps )",
"Hyrule Castle (Jail Cell )",
"Hyrule Castle",
"Hyrule Castle (Basement Chasm )",
"Desert Palace (West Entrance )",
"Desert Palace (Main Entrance )",
"Desert Palace (East Entrance )",
"Empty Clone ",
"Tower of Hera (Tile )",
"Empty Clone ",
"Eastern Palace (Fairy )",
"Empty Clone ",
"Ganon's Tower (Block Puzzle / Spike Skip / Map Chest )",
"Ganon's Tower (East and West Downstairs / Big Chest )",
"Ganon's Tower (Tile / Torch Puzzle )",
"Ice Palace",
"Empty Clone ",
"Misery Mire (Vitreous[Boss])",
"Misery Mire (Final Switch )",
"Misery Mire (Dark Bomb Wall / Switches )",
"Misery Mire (Dark Cane Floor Switch Puzzle )",
"Empty Clone ",
"Ganon's Tower (Final Collapsing Bridge )",
"Ganon's Tower (Torches 1 )",
"Misery Mire (Torch Puzzle / Moving Wall )",
"Misery Mire (Entrance )",
"Eastern Palace (Eyegore Key )",
"Empty Clone ",
"Ganon's Tower (Many Spikes / Warp Maze )",
"Ganon's Tower (Invisible Floor Maze )",
"Ganon's Tower (Compass Chest / Invisible Floor )",
"Ice Palace (Big Chest )",
"Ice Palace",
"Misery Mire (Pre-Vitreous )",
"Misery Mire (Fish )",
"Misery Mire (Bridge Key Chest )",
"Misery Mire",
"Turtle Rock (Trinexx[Boss])",
"Ganon's Tower (Wizzrobes s)",
"Ganon's Tower (Moldorm Fall )",
"Tower of Hera (Fairy )",
"Eastern Palace (Stalfos Spawn )",
"Eastern Palace (Big Chest )",
"Eastern Palace (Map Chest )",
"Thieves Town (Moving Spikes / Key Pot )",
"Thieves Town (Blind The Thief[Boss])",
"Empty Clone ",
"Ice Palace",
"Ice Palace (Ice Bridge )",
"Agahnim's Tower (Circle of Pots)",
"Misery Mire (Hourglass )",
"Misery Mire (Slug )",
"Misery Mire (Spike Key Chest )",
"Turtle Rock (Pre-Trinexx )",
"Turtle Rock (Dark Maze)",
"Turtle Rock (Chain Chomps )",
"Turtle Rock (Map Chest / Key Chest / Roller )",
"Eastern Palace (Big Key )",
"Eastern Palace (Lobby Cannonballs )",
"Eastern Palace (Dark Antifairy / Key Pot )",
"Thieves Town (Hellway)",
"Thieves Town (Conveyor Toilet)",
"Empty Clone ",
"Ice Palace (Block Puzzle )",
"Ice Palace Clone (Switch )",
"Agahnim's Tower (Dark Bridge )",
"Misery Mire (Compass Chest / Tile )",
"Misery Mire (Big Hub )",
"Misery Mire (Big Chest )",
"Turtle Rock (Final Crystal Switch Puzzle )",
"Turtle Rock (Laser Bridge)",
"Turtle Rock",
"Turtle Rock (Torch Puzzle)",
"Eastern Palace (Armos Knights[Boss])",
"Eastern Palace (Entrance )",
"??",
"Thieves Town (North West Entrance )",
"Thieves Town (North East Entrance )",
"Empty Clone ",
"Ice Palace (Hole to Kholdstare )",
"Empty Clone ",
"Agahnim's Tower (Dark Maze)",
"Misery Mire (Conveyor Slug / Big Key )",
"Misery Mire (Mire02 / Wizzrobes )",
"Empty Clone ",
"Empty Clone ",
"Turtle Rock (Laser Key )",
"Turtle Rock (Entrance )",
"Empty Clone ",
"Eastern Palace (Zeldagamer / Pre-Armos Knights )",
"Eastern Palace (Canonball ",
"Eastern Palace",
"Thieves Town (Main (South West) Entrance )",
"Thieves Town (South East Entrance )",
"Empty Clone ",
"Ice Palace (Kholdstare[Boss])",
"Cave",
"Agahnim's Tower (Entrance )",
"Cave (Lost Woods HP)",
"Cave (Lumberjack's Tree HP)",
"Cave (1/2 Magic)",
"Cave (Lost Old Man Final Cave)",
"Cave (Lost Old Man Final Cave)",
"Cave",
"Cave",
"Cave",
"Empty Clone ",
"Cave (Spectacle Rock HP)",
"Cave",
"Empty Clone ",
"Cave",
"Cave (Spiral Cave)",
"Cave (Crystal Switch / 5 Chests )",
"Cave (Lost Old Man Starting Cave)",
"Cave (Lost Old Man Starting Cave)",
"House",
"House (Old Woman (Sahasrahla's Wife?))",
"House (Angry Brothers)",
"House (Angry Brothers)",
"Empty Clone ",
"Empty Clone ",
"Cave",
"Cave",
"Cave",
"Cave",
"Empty Clone ",
"Cave",
"Cave",
"Cave",
"Chest Minigame",
"Houses",
"Sick Boy house",
"Tavern",
"Link's House",
"Sarashrala Hut",
"Chest Minigame",
"Library",
"Chicken House",
"Witch Shop",
"A Aginah's Cave",
"Dam",
"Mimic Cave",
"Mire Shed",
"Cave",
"Shop",
"Shop",
"Archery Minigame",
"DW Church/Shop",
"Grave Cave",
"Fairy Fountain",
"Fairy Upgrade",
"Pyramid Fairy",
"Spike Cave",
"Chest Minigame",
"Blind Hut",
"Bonzai Cave",
"Circle of bush Cave",
"Big Bomb Shop, C-House",
"Blind Hut 2",
"Hype Cave",
"Shop",
"Ice Cave",
"Smith",
"Fortune Teller",
"MiniMoldorm Cave",
"Under Rock Caves",
"Smith",
"Cave",
"Mazeblock Cave",
"Smith Peg Cave"};
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
} // namespace app

View File

@@ -15,55 +15,55 @@ namespace dungeon {
// ============================================================================
// 0x14577 word value for each room
constexpr int entrance_room = 0x14813;
constexpr int kEntranceroom = 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 kEntrancescrolledge = 0x1491D; // 0x14681
constexpr int kEntranceyscroll = 0x14D45; // 0x14AA9 2 bytes each room
constexpr int kEntrancexscroll = 0x14E4F; // 0x14BB3 2 bytes
constexpr int kEntranceyposition = 0x14F59; // 0x14CBD 2bytes
constexpr int kEntrancexposition = 0x15063; // 0x14DC7 2bytes
constexpr int kEntrancecameraytrigger = 0x1516D; // 0x14ED1 2bytes
constexpr int kEntrancecameraxtrigger = 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
constexpr int kEntranceblockset = 0x15381; // 0x150E5 1byte
constexpr int kEntrancefloor = 0x15406; // 0x1516A 1byte
constexpr int kEntrancedungeon = 0x1548B; // 0x151EF 1byte (dungeon id)
constexpr int kEntrancedoor = 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
constexpr int kEntranceladderbg = 0x15595; // 0x152F9
constexpr int kEntrancescrolling = 0x1561A; // 0x1537E 1byte --h- --v-
constexpr int kEntrancescrollquadrant = 0x1569F; // 0x15403 1byte
constexpr int kEntranceexit = 0x15724; // 0x15488 2byte word
constexpr int kEntrancemusic = 0x1582E; // 0x15592
// word value for each room
constexpr int startingentrance_room = 0x15B6E; // 0x158D2
constexpr int kStartingEntranceroom = 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 kStartingEntrancescrolledge = 0x15B7C; // 0x158E0
constexpr int kStartingEntranceyscroll = 0x15BB4; // 0x14AA9 //2bytes each room
constexpr int kStartingEntrancexscroll = 0x15BC2; // 0x14BB3 //2bytes
constexpr int kStartingEntranceyposition = 0x15BD0; // 0x14CBD 2bytes
constexpr int kStartingEntrancexposition = 0x15BDE; // 0x14DC7 2bytes
constexpr int kStartingEntrancecameraytrigger = 0x15BEC; // 0x14ED1 2bytes
constexpr int kStartingEntrancecameraxtrigger = 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 kStartingEntranceblockset = 0x15C08; // 0x150E5 1byte
constexpr int kStartingEntrancefloor = 0x15C0F; // 0x1516A 1byte
constexpr int kStartingEntrancedungeon = 0x15C16; // 0x151EF 1byte (dungeon id)
constexpr int startingentrance_door = 0x15C2B; // 0x15274 1byte
constexpr int kStartingEntrancedoor = 0x15C2B; // 0x15274 1byte
// 1 byte, ---b ---a b = bg2, a = need to check
constexpr int startingentrance_ladderbg = 0x15C1D; // 0x152F9
constexpr int kStartingEntranceladderbg = 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 kStartingEntrancescrolling = 0x15C24; // 0x1537E
constexpr int kStartingEntrancescrollquadrant = 0x15C2B; // 0x15403 1byte
constexpr int kStartingEntranceexit = 0x15C32; // 0x15488 //2byte word
constexpr int kStartingEntrancemusic = 0x15C4E; // 0x15592
constexpr int kStartingEntranceentrance = 0x15C40;
constexpr int items_data_start = 0xDDE9; // save purpose
constexpr int items_data_end = 0xE6B2; // save purpose
@@ -106,214 +106,214 @@ class RoomEntrance {
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)]);
static_cast<short>((rom[kEntranceroom + (entrance_id * 2) + 1] << 8) +
rom[kEntranceroom + (entrance_id * 2)]);
y_position_ = static_cast<ushort>(
(rom[entrance_yposition + (entrance_id * 2) + 1] << 8) +
rom[entrance_yposition + (entrance_id * 2)]);
(rom[kEntranceyposition + (entrance_id * 2) + 1] << 8) +
rom[kEntranceyposition + (entrance_id * 2)]);
x_position_ = static_cast<ushort>(
(rom[entrance_xposition + (entrance_id * 2) + 1] << 8) +
rom[entrance_xposition + (entrance_id * 2)]);
(rom[kEntrancexposition + (entrance_id * 2) + 1] << 8) +
rom[kEntrancexposition + (entrance_id * 2)]);
camera_x_ = static_cast<ushort>(
(rom[entrance_xscroll + (entrance_id * 2) + 1] << 8) +
rom[entrance_xscroll + (entrance_id * 2)]);
(rom[kEntrancexscroll + (entrance_id * 2) + 1] << 8) +
rom[kEntrancexscroll + (entrance_id * 2)]);
camera_y_ = static_cast<ushort>(
(rom[entrance_yscroll + (entrance_id * 2) + 1] << 8) +
rom[entrance_yscroll + (entrance_id * 2)]);
(rom[kEntranceyscroll + (entrance_id * 2) + 1] << 8) +
rom[kEntranceyscroll + (entrance_id * 2)]);
camera_trigger_y_ = static_cast<ushort>(
(rom[(entrance_cameraytrigger + (entrance_id * 2)) + 1] << 8) +
rom[entrance_cameraytrigger + (entrance_id * 2)]);
(rom[(kEntrancecameraytrigger + (entrance_id * 2)) + 1] << 8) +
rom[kEntrancecameraytrigger + (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];
(rom[(kEntrancecameraxtrigger + (entrance_id * 2)) + 1] << 8) +
rom[kEntrancecameraxtrigger + (entrance_id * 2)]);
blockset_ = rom[kEntranceblockset + entrance_id];
music_ = rom[kEntrancemusic + entrance_id];
dungeon_id_ = rom[kEntrancedungeon + entrance_id];
floor_ = rom[kEntrancefloor + entrance_id];
door_ = rom[kEntrancedoor + entrance_id];
ladder_bg_ = rom[kEntranceladderbg + entrance_id];
scrolling_ = rom[kEntrancescrolling + entrance_id];
scroll_quadrant_ = rom[kEntrancescrollquadrant + entrance_id];
exit_ =
static_cast<short>((rom[entrance_exit + (entrance_id * 2) + 1] << 8) +
rom[entrance_exit + (entrance_id * 2)]);
static_cast<short>((rom[kEntranceexit + (entrance_id * 2) + 1] << 8) +
rom[kEntranceexit + (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)];
camera_boundary_qn_ = rom[kEntrancescrolledge + 0 + (entrance_id * 8)];
camera_boundary_fn_ = rom[kEntrancescrolledge + 1 + (entrance_id * 8)];
camera_boundary_qs_ = rom[kEntrancescrolledge + 2 + (entrance_id * 8)];
camera_boundary_fs_ = rom[kEntrancescrolledge + 3 + (entrance_id * 8)];
camera_boundary_qw_ = rom[kEntrancescrolledge + 4 + (entrance_id * 8)];
camera_boundary_fw_ = rom[kEntrancescrolledge + 5 + (entrance_id * 8)];
camera_boundary_qe_ = rom[kEntrancescrolledge + 6 + (entrance_id * 8)];
camera_boundary_fe_ = rom[kEntrancescrolledge + 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)]);
(rom[kStartingEntranceroom + (entrance_id * 2) + 1] << 8) +
rom[kStartingEntranceroom + (entrance_id * 2)]);
y_position_ = static_cast<ushort>(
(rom[startingentrance_yposition + (entrance_id * 2) + 1] << 8) +
rom[startingentrance_yposition + (entrance_id * 2)]);
(rom[kStartingEntranceyposition + (entrance_id * 2) + 1] << 8) +
rom[kStartingEntranceyposition + (entrance_id * 2)]);
x_position_ = static_cast<ushort>(
(rom[startingentrance_xposition + (entrance_id * 2) + 1] << 8) +
rom[startingentrance_xposition + (entrance_id * 2)]);
(rom[kStartingEntrancexposition + (entrance_id * 2) + 1] << 8) +
rom[kStartingEntrancexposition + (entrance_id * 2)]);
camera_x_ = static_cast<ushort>(
(rom[startingentrance_xscroll + (entrance_id * 2) + 1] << 8) +
rom[startingentrance_xscroll + (entrance_id * 2)]);
(rom[kStartingEntrancexscroll + (entrance_id * 2) + 1] << 8) +
rom[kStartingEntrancexscroll + (entrance_id * 2)]);
camera_y_ = static_cast<ushort>(
(rom[startingentrance_yscroll + (entrance_id * 2) + 1] << 8) +
rom[startingentrance_yscroll + (entrance_id * 2)]);
(rom[kStartingEntranceyscroll + (entrance_id * 2) + 1] << 8) +
rom[kStartingEntranceyscroll + (entrance_id * 2)]);
camera_trigger_y_ = static_cast<ushort>(
(rom[startingentrance_cameraytrigger + (entrance_id * 2) + 1] << 8) +
rom[startingentrance_cameraytrigger + (entrance_id * 2)]);
(rom[kStartingEntrancecameraytrigger + (entrance_id * 2) + 1] << 8) +
rom[kStartingEntrancecameraytrigger + (entrance_id * 2)]);
camera_trigger_x_ = static_cast<ushort>(
(rom[startingentrance_cameraxtrigger + (entrance_id * 2) + 1] << 8) +
rom[startingentrance_cameraxtrigger + (entrance_id * 2)]);
(rom[kStartingEntrancecameraxtrigger + (entrance_id * 2) + 1] << 8) +
rom[kStartingEntrancecameraxtrigger + (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];
blockset_ = rom[kStartingEntranceblockset + entrance_id];
music_ = rom[kStartingEntrancemusic + entrance_id];
dungeon_id_ = rom[kStartingEntrancedungeon + entrance_id];
floor_ = rom[kStartingEntrancefloor + entrance_id];
door_ = rom[kStartingEntrancedoor + entrance_id];
ladder_bg_ = rom[startingentrance_ladderbg + entrance_id];
scrolling_ = rom[startingentrance_scrolling + entrance_id];
scroll_quadrant_ = rom[startingentrance_scrollquadrant + entrance_id];
ladder_bg_ = rom[kStartingEntranceladderbg + entrance_id];
scrolling_ = rom[kStartingEntrancescrolling + entrance_id];
scroll_quadrant_ = rom[kStartingEntrancescrollquadrant + entrance_id];
exit_ = static_cast<short>(
((rom[startingentrance_exit + (entrance_id * 2) + 1] & 0x01) << 8) +
rom[startingentrance_exit + (entrance_id * 2)]);
((rom[kStartingEntranceexit + (entrance_id * 2) + 1] & 0x01) << 8) +
rom[kStartingEntranceexit + (entrance_id * 2)]);
camera_boundary_qn_ =
rom[startingentrance_scrolledge + 0 + (entrance_id * 8)];
rom[kStartingEntrancescrolledge + 0 + (entrance_id * 8)];
camera_boundary_fn_ =
rom[startingentrance_scrolledge + 1 + (entrance_id * 8)];
rom[kStartingEntrancescrolledge + 1 + (entrance_id * 8)];
camera_boundary_qs_ =
rom[startingentrance_scrolledge + 2 + (entrance_id * 8)];
rom[kStartingEntrancescrolledge + 2 + (entrance_id * 8)];
camera_boundary_fs_ =
rom[startingentrance_scrolledge + 3 + (entrance_id * 8)];
rom[kStartingEntrancescrolledge + 3 + (entrance_id * 8)];
camera_boundary_qw_ =
rom[startingentrance_scrolledge + 4 + (entrance_id * 8)];
rom[kStartingEntrancescrolledge + 4 + (entrance_id * 8)];
camera_boundary_fw_ =
rom[startingentrance_scrolledge + 5 + (entrance_id * 8)];
rom[kStartingEntrancescrolledge + 5 + (entrance_id * 8)];
camera_boundary_qe_ =
rom[startingentrance_scrolledge + 6 + (entrance_id * 8)];
rom[kStartingEntrancescrolledge + 6 + (entrance_id * 8)];
camera_boundary_fe_ =
rom[startingentrance_scrolledge + 7 + (entrance_id * 8)];
rom[kStartingEntrancescrolledge + 7 + (entrance_id * 8)];
}
}
absl::Status Save(Rom& rom, int entrance_id, bool is_spawn_point = false) {
if (!is_spawn_point) {
RETURN_IF_ERROR(
rom.WriteShort(entrance_yposition + (entrance_id * 2), y_position_));
rom.WriteShort(kEntranceyposition + (entrance_id * 2), y_position_));
RETURN_IF_ERROR(
rom.WriteShort(entrance_xposition + (entrance_id * 2), x_position_));
rom.WriteShort(kEntrancexposition + (entrance_id * 2), x_position_));
RETURN_IF_ERROR(
rom.WriteShort(entrance_yscroll + (entrance_id * 2), camera_y_));
rom.WriteShort(kEntranceyscroll + (entrance_id * 2), camera_y_));
RETURN_IF_ERROR(
rom.WriteShort(entrance_xscroll + (entrance_id * 2), camera_x_));
rom.WriteShort(kEntrancexscroll + (entrance_id * 2), camera_x_));
RETURN_IF_ERROR(rom.WriteShort(
entrance_cameraxtrigger + (entrance_id * 2), camera_trigger_x_));
kEntrancecameraxtrigger + (entrance_id * 2), camera_trigger_x_));
RETURN_IF_ERROR(rom.WriteShort(
entrance_cameraytrigger + (entrance_id * 2), camera_trigger_y_));
RETURN_IF_ERROR(rom.WriteShort(entrance_exit + (entrance_id * 2), exit_));
RETURN_IF_ERROR(rom.Write(entrance_blockset + entrance_id,
kEntrancecameraytrigger + (entrance_id * 2), camera_trigger_y_));
RETURN_IF_ERROR(rom.WriteShort(kEntranceexit + (entrance_id * 2), exit_));
RETURN_IF_ERROR(rom.Write(kEntranceblockset + entrance_id,
(uint8_t)(blockset_ & 0xFF)));
RETURN_IF_ERROR(
rom.Write(entrance_music + entrance_id, (uint8_t)(music_ & 0xFF)));
RETURN_IF_ERROR(rom.Write(entrance_dungeon + entrance_id,
rom.Write(kEntrancemusic + entrance_id, (uint8_t)(music_ & 0xFF)));
RETURN_IF_ERROR(rom.Write(kEntrancedungeon + entrance_id,
(uint8_t)(dungeon_id_ & 0xFF)));
RETURN_IF_ERROR(
rom.Write(entrance_door + entrance_id, (uint8_t)(door_ & 0xFF)));
rom.Write(kEntrancedoor + entrance_id, (uint8_t)(door_ & 0xFF)));
RETURN_IF_ERROR(
rom.Write(entrance_floor + entrance_id, (uint8_t)(floor_ & 0xFF)));
RETURN_IF_ERROR(rom.Write(entrance_ladderbg + entrance_id,
rom.Write(kEntrancefloor + entrance_id, (uint8_t)(floor_ & 0xFF)));
RETURN_IF_ERROR(rom.Write(kEntranceladderbg + entrance_id,
(uint8_t)(ladder_bg_ & 0xFF)));
RETURN_IF_ERROR(rom.Write(entrance_scrolling + entrance_id,
RETURN_IF_ERROR(rom.Write(kEntrancescrolling + entrance_id,
(uint8_t)(scrolling_ & 0xFF)));
RETURN_IF_ERROR(rom.Write(entrance_scrollquadrant + entrance_id,
RETURN_IF_ERROR(rom.Write(kEntrancescrollquadrant + entrance_id,
(uint8_t)(scroll_quadrant_ & 0xFF)));
RETURN_IF_ERROR(rom.Write(entrance_scrolledge + 0 + (entrance_id * 8),
RETURN_IF_ERROR(rom.Write(kEntrancescrolledge + 0 + (entrance_id * 8),
camera_boundary_qn_));
RETURN_IF_ERROR(rom.Write(entrance_scrolledge + 1 + (entrance_id * 8),
RETURN_IF_ERROR(rom.Write(kEntrancescrolledge + 1 + (entrance_id * 8),
camera_boundary_fn_));
RETURN_IF_ERROR(rom.Write(entrance_scrolledge + 2 + (entrance_id * 8),
RETURN_IF_ERROR(rom.Write(kEntrancescrolledge + 2 + (entrance_id * 8),
camera_boundary_qs_));
RETURN_IF_ERROR(rom.Write(entrance_scrolledge + 3 + (entrance_id * 8),
RETURN_IF_ERROR(rom.Write(kEntrancescrolledge + 3 + (entrance_id * 8),
camera_boundary_fs_));
RETURN_IF_ERROR(rom.Write(entrance_scrolledge + 4 + (entrance_id * 8),
RETURN_IF_ERROR(rom.Write(kEntrancescrolledge + 4 + (entrance_id * 8),
camera_boundary_qw_));
RETURN_IF_ERROR(rom.Write(entrance_scrolledge + 5 + (entrance_id * 8),
RETURN_IF_ERROR(rom.Write(kEntrancescrolledge + 5 + (entrance_id * 8),
camera_boundary_fw_));
RETURN_IF_ERROR(rom.Write(entrance_scrolledge + 6 + (entrance_id * 8),
RETURN_IF_ERROR(rom.Write(kEntrancescrolledge + 6 + (entrance_id * 8),
camera_boundary_qe_));
RETURN_IF_ERROR(rom.Write(entrance_scrolledge + 7 + (entrance_id * 8),
RETURN_IF_ERROR(rom.Write(kEntrancescrolledge + 7 + (entrance_id * 8),
camera_boundary_fe_));
} else {
RETURN_IF_ERROR(
rom.WriteShort(startingentrance_room + (entrance_id * 2), room_));
rom.WriteShort(kStartingEntranceroom + (entrance_id * 2), room_));
RETURN_IF_ERROR(rom.WriteShort(
startingentrance_yposition + (entrance_id * 2), y_position_));
kStartingEntranceyposition + (entrance_id * 2), y_position_));
RETURN_IF_ERROR(rom.WriteShort(
startingentrance_xposition + (entrance_id * 2), x_position_));
kStartingEntrancexposition + (entrance_id * 2), x_position_));
RETURN_IF_ERROR(rom.WriteShort(
startingentrance_yscroll + (entrance_id * 2), camera_y_));
kStartingEntranceyscroll + (entrance_id * 2), camera_y_));
RETURN_IF_ERROR(rom.WriteShort(
startingentrance_xscroll + (entrance_id * 2), camera_x_));
kStartingEntrancexscroll + (entrance_id * 2), camera_x_));
RETURN_IF_ERROR(
rom.WriteShort(startingentrance_cameraxtrigger + (entrance_id * 2),
rom.WriteShort(kStartingEntrancecameraxtrigger + (entrance_id * 2),
camera_trigger_x_));
RETURN_IF_ERROR(
rom.WriteShort(startingentrance_cameraytrigger + (entrance_id * 2),
rom.WriteShort(kStartingEntrancecameraytrigger + (entrance_id * 2),
camera_trigger_y_));
RETURN_IF_ERROR(
rom.WriteShort(startingentrance_exit + (entrance_id * 2), exit_));
RETURN_IF_ERROR(rom.Write(startingentrance_blockset + entrance_id,
rom.WriteShort(kStartingEntranceexit + (entrance_id * 2), exit_));
RETURN_IF_ERROR(rom.Write(kStartingEntranceblockset + entrance_id,
(uint8_t)(blockset_ & 0xFF)));
RETURN_IF_ERROR(rom.Write(startingentrance_music + entrance_id,
RETURN_IF_ERROR(rom.Write(kStartingEntrancemusic + entrance_id,
(uint8_t)(music_ & 0xFF)));
RETURN_IF_ERROR(rom.Write(startingentrance_dungeon + entrance_id,
RETURN_IF_ERROR(rom.Write(kStartingEntrancedungeon + entrance_id,
(uint8_t)(dungeon_id_ & 0xFF)));
RETURN_IF_ERROR(rom.Write(startingentrance_door + entrance_id,
RETURN_IF_ERROR(rom.Write(kStartingEntrancedoor + entrance_id,
(uint8_t)(door_ & 0xFF)));
RETURN_IF_ERROR(rom.Write(startingentrance_floor + entrance_id,
RETURN_IF_ERROR(rom.Write(kStartingEntrancefloor + entrance_id,
(uint8_t)(floor_ & 0xFF)));
RETURN_IF_ERROR(rom.Write(startingentrance_ladderbg + entrance_id,
RETURN_IF_ERROR(rom.Write(kStartingEntranceladderbg + entrance_id,
(uint8_t)(ladder_bg_ & 0xFF)));
RETURN_IF_ERROR(rom.Write(startingentrance_scrolling + entrance_id,
RETURN_IF_ERROR(rom.Write(kStartingEntrancescrolling + entrance_id,
(uint8_t)(scrolling_ & 0xFF)));
RETURN_IF_ERROR(rom.Write(startingentrance_scrollquadrant + entrance_id,
RETURN_IF_ERROR(rom.Write(kStartingEntrancescrollquadrant + entrance_id,
(uint8_t)(scroll_quadrant_ & 0xFF)));
RETURN_IF_ERROR(
rom.Write(startingentrance_scrolledge + 0 + (entrance_id * 8),
rom.Write(kStartingEntrancescrolledge + 0 + (entrance_id * 8),
camera_boundary_qn_));
RETURN_IF_ERROR(
rom.Write(startingentrance_scrolledge + 1 + (entrance_id * 8),
rom.Write(kStartingEntrancescrolledge + 1 + (entrance_id * 8),
camera_boundary_fn_));
RETURN_IF_ERROR(
rom.Write(startingentrance_scrolledge + 2 + (entrance_id * 8),
rom.Write(kStartingEntrancescrolledge + 2 + (entrance_id * 8),
camera_boundary_qs_));
RETURN_IF_ERROR(
rom.Write(startingentrance_scrolledge + 3 + (entrance_id * 8),
rom.Write(kStartingEntrancescrolledge + 3 + (entrance_id * 8),
camera_boundary_fs_));
RETURN_IF_ERROR(
rom.Write(startingentrance_scrolledge + 4 + (entrance_id * 8),
rom.Write(kStartingEntrancescrolledge + 4 + (entrance_id * 8),
camera_boundary_qw_));
RETURN_IF_ERROR(
rom.Write(startingentrance_scrolledge + 5 + (entrance_id * 8),
rom.Write(kStartingEntrancescrolledge + 5 + (entrance_id * 8),
camera_boundary_fw_));
RETURN_IF_ERROR(
rom.Write(startingentrance_scrolledge + 6 + (entrance_id * 8),
rom.Write(kStartingEntrancescrolledge + 6 + (entrance_id * 8),
camera_boundary_qe_));
RETURN_IF_ERROR(
rom.Write(startingentrance_scrolledge + 7 + (entrance_id * 8),
rom.Write(kStartingEntrancescrolledge + 7 + (entrance_id * 8),
camera_boundary_fe_));
}
return absl::OkStatus();

View File

@@ -1,453 +0,0 @@
#ifndef YAZE_APP_ZELDA3_DUNGEON_ROOM_NAMES_H
#define YAZE_APP_ZELDA3_DUNGEON_ROOM_NAMES_H
#include <fstream>
#include <string>
#include <string_view>
namespace yaze {
namespace app {
namespace zelda3 {
namespace dungeon {
constexpr std::string_view kRoomNames[] = {
"Ganon",
"Hyrule Castle (North Corridor)",
"Behind Sanctuary (Switch)",
"Houlihan",
"Turtle Rock (Crysta-Roller)",
"Empty",
"Swamp Palace (Arrghus[Boss])",
"Tower of Hera (Moldorm[Boss])",
"Cave (Healing Fairy)",
"Palace of Darkness",
"Palace of Darkness (Stalfos Trap)",
"Palace of Darkness (Turtle)",
"Ganon's Tower (Entrance)",
"Ganon's Tower (Agahnim2[Boss])",
"Ice Palace (Entrance )",
"Empty Clone ",
"Ganon Evacuation Route",
"Hyrule Castle (Bombable Stock )",
"Sanctuary",
"Turtle Rock (Hokku-Bokku Key 2)",
"Turtle Rock (Big Key )",
"Turtle Rock",
"Swamp Palace (Swimming Treadmill)",
"Tower of Hera (Moldorm Fall )",
"Cave",
"Palace of Darkness (Dark Maze)",
"Palace of Darkness (Big Chest )",
"Palace of Darkness (Mimics / Moving Wall )",
"Ganon's Tower (Ice Armos)",
"Ganon's Tower (Final Hallway)",
"Ice Palace (Bomb Floor / Bari )",
"Ice Palace (Pengator / Big Key )",
"Agahnim's Tower (Agahnim[Boss])",
"Hyrule Castle (Key-rat )",
"Hyrule Castle (Sewer Text Trigger )",
"Turtle Rock (West Exit to Balcony)",
"Turtle Rock (Double Hokku-Bokku / Big chest )",
"Empty Clone ",
"Swamp Palace (Statue )",
"Tower of Hera (Big Chest)",
"Swamp Palace (Entrance )",
"Skull Woods (Mothula[Boss])",
"Palace of Darkness (Big Hub )",
"Palace of Darkness (Map Chest / Fairy )",
"Cave",
"Empty Clone ",
"Ice Palace (Compass )",
"Cave (Kakariko Well HP)",
"Agahnim's Tower (Maiden Sacrifice Chamber)",
"Tower of Hera (Hardhat Beetles )",
"Hyrule Castle (Sewer Key Chest )",
"Desert Palace (Lanmolas[Boss])",
"Swamp Palace (Push Block Puzzle / Pre-Big Key )",
"Swamp Palace (Big Key / BS )",
"Swamp Palace (Big Chest )",
"Swamp Palace (Map Chest / Water Fill )",
"Swamp Palace (Key Pot )",
"Skull Woods (Gibdo Key / Mothula Hole )",
"Palace of Darkness (Bombable Floor )",
"Palace of Darkness (Spike Block / Conveyor )",
"Cave",
"Ganon's Tower (Torch 2)",
"Ice Palace (Stalfos Knights / Conveyor Hellway)",
"Ice Palace (Map Chest )",
"Agahnim's Tower (Final Bridge )",
"Hyrule Castle (First Dark )",
"Hyrule Castle (6 Ropes )",
"Desert Palace (Torch Puzzle / Moving Wall )",
"Thieves Town (Big Chest )",
"Thieves Town (Jail Cells )",
"Swamp Palace (Compass Chest )",
"Empty Clone ",
"Empty Clone ",
"Skull Woods (Gibdo Torch Puzzle )",
"Palace of Darkness (Entrance )",
"Palace of Darkness (Warps / South Mimics )",
"Ganon's Tower (Mini-Helmasaur Conveyor )",
"Ganon's Tower (Moldorm )",
"Ice Palace (Bomb-Jump )",
"Ice Palace Clone (Fairy )",
"Hyrule Castle (West Corridor)",
"Hyrule Castle (Throne )",
"Hyrule Castle (East Corridor)",
"Desert Palace (Popos 2 / Beamos Hellway )",
"Swamp Palace (Upstairs Pits )",
"Castle Secret Entrance / Uncle Death ",
"Skull Woods (Key Pot / Trap )",
"Skull Woods (Big Key )",
"Skull Woods (Big Chest )",
"Skull Woods (Final Section Entrance )",
"Palace of Darkness (Helmasaur King[Boss])",
"Ganon's Tower (Spike Pit )",
"Ganon's Tower (Ganon-Ball Z)",
"Ganon's Tower (Gauntlet 1/2/3)",
"Ice Palace (Lonely Firebar)",
"Ice Palace (Hidden Chest / Spike Floor )",
"Hyrule Castle (West Entrance )",
"Hyrule Castle (Main Entrance )",
"Hyrule Castle (East Entrance )",
"Desert Palace (Final Section Entrance )",
"Thieves Town (West Attic )",
"Thieves Town (East Attic )",
"Swamp Palace (Hidden Chest / Hidden Door )",
"Skull Woods (Compass Chest )",
"Skull Woods (Key Chest / Trap )",
"Empty Clone ",
"Palace of Darkness (Rupee )",
"Ganon's Tower (Mimics s)",
"Ganon's Tower (Lanmolas )",
"Ganon's Tower (Gauntlet 4/5)",
"Ice Palace (Pengators )",
"Empty Clone ",
"Hyrule Castle (Small Corridor to Jail Cells)",
"Hyrule Castle (Boomerang Chest )",
"Hyrule Castle (Map Chest )",
"Desert Palace (Big Chest )",
"Desert Palace (Map Chest )",
"Desert Palace (Big Key Chest )",
"Swamp Palace (Water Drain )",
"Tower of Hera (Entrance )",
"Empty Clone ",
"Empty Clone ",
"Empty Clone ",
"Ganon's Tower",
"Ganon's Tower (East Side Collapsing Bridge / Exploding Wall )",
"Ganon's Tower (Winder / Warp Maze )",
"Ice Palace (Hidden Chest / Bombable Floor )",
"Ice Palace ( Big Spike Traps )",
"Hyrule Castle (Jail Cell )",
"Hyrule Castle",
"Hyrule Castle (Basement Chasm )",
"Desert Palace (West Entrance )",
"Desert Palace (Main Entrance )",
"Desert Palace (East Entrance )",
"Empty Clone ",
"Tower of Hera (Tile )",
"Empty Clone ",
"Eastern Palace (Fairy )",
"Empty Clone ",
"Ganon's Tower (Block Puzzle / Spike Skip / Map Chest )",
"Ganon's Tower (East and West Downstairs / Big Chest )",
"Ganon's Tower (Tile / Torch Puzzle )",
"Ice Palace",
"Empty Clone ",
"Misery Mire (Vitreous[Boss])",
"Misery Mire (Final Switch )",
"Misery Mire (Dark Bomb Wall / Switches )",
"Misery Mire (Dark Cane Floor Switch Puzzle )",
"Empty Clone ",
"Ganon's Tower (Final Collapsing Bridge )",
"Ganon's Tower (Torches 1 )",
"Misery Mire (Torch Puzzle / Moving Wall )",
"Misery Mire (Entrance )",
"Eastern Palace (Eyegore Key )",
"Empty Clone ",
"Ganon's Tower (Many Spikes / Warp Maze )",
"Ganon's Tower (Invisible Floor Maze )",
"Ganon's Tower (Compass Chest / Invisible Floor )",
"Ice Palace (Big Chest )",
"Ice Palace",
"Misery Mire (Pre-Vitreous )",
"Misery Mire (Fish )",
"Misery Mire (Bridge Key Chest )",
"Misery Mire",
"Turtle Rock (Trinexx[Boss])",
"Ganon's Tower (Wizzrobes s)",
"Ganon's Tower (Moldorm Fall )",
"Tower of Hera (Fairy )",
"Eastern Palace (Stalfos Spawn )",
"Eastern Palace (Big Chest )",
"Eastern Palace (Map Chest )",
"Thieves Town (Moving Spikes / Key Pot )",
"Thieves Town (Blind The Thief[Boss])",
"Empty Clone ",
"Ice Palace",
"Ice Palace (Ice Bridge )",
"Agahnim's Tower (Circle of Pots)",
"Misery Mire (Hourglass )",
"Misery Mire (Slug )",
"Misery Mire (Spike Key Chest )",
"Turtle Rock (Pre-Trinexx )",
"Turtle Rock (Dark Maze)",
"Turtle Rock (Chain Chomps )",
"Turtle Rock (Map Chest / Key Chest / Roller )",
"Eastern Palace (Big Key )",
"Eastern Palace (Lobby Cannonballs )",
"Eastern Palace (Dark Antifairy / Key Pot )",
"Thieves Town (Hellway)",
"Thieves Town (Conveyor Toilet)",
"Empty Clone ",
"Ice Palace (Block Puzzle )",
"Ice Palace Clone (Switch )",
"Agahnim's Tower (Dark Bridge )",
"Misery Mire (Compass Chest / Tile )",
"Misery Mire (Big Hub )",
"Misery Mire (Big Chest )",
"Turtle Rock (Final Crystal Switch Puzzle )",
"Turtle Rock (Laser Bridge)",
"Turtle Rock",
"Turtle Rock (Torch Puzzle)",
"Eastern Palace (Armos Knights[Boss])",
"Eastern Palace (Entrance )",
"??",
"Thieves Town (North West Entrance )",
"Thieves Town (North East Entrance )",
"Empty Clone ",
"Ice Palace (Hole to Kholdstare )",
"Empty Clone ",
"Agahnim's Tower (Dark Maze)",
"Misery Mire (Conveyor Slug / Big Key )",
"Misery Mire (Mire02 / Wizzrobes )",
"Empty Clone ",
"Empty Clone ",
"Turtle Rock (Laser Key )",
"Turtle Rock (Entrance )",
"Empty Clone ",
"Eastern Palace (Zeldagamer / Pre-Armos Knights )",
"Eastern Palace (Canonball ",
"Eastern Palace",
"Thieves Town (Main (South West) Entrance )",
"Thieves Town (South East Entrance )",
"Empty Clone ",
"Ice Palace (Kholdstare[Boss])",
"Cave",
"Agahnim's Tower (Entrance )",
"Cave (Lost Woods HP)",
"Cave (Lumberjack's Tree HP)",
"Cave (1/2 Magic)",
"Cave (Lost Old Man Final Cave)",
"Cave (Lost Old Man Final Cave)",
"Cave",
"Cave",
"Cave",
"Empty Clone ",
"Cave (Spectacle Rock HP)",
"Cave",
"Empty Clone ",
"Cave",
"Cave (Spiral Cave)",
"Cave (Crystal Switch / 5 Chests )",
"Cave (Lost Old Man Starting Cave)",
"Cave (Lost Old Man Starting Cave)",
"House",
"House (Old Woman (Sahasrahla's Wife?))",
"House (Angry Brothers)",
"House (Angry Brothers)",
"Empty Clone ",
"Empty Clone ",
"Cave",
"Cave",
"Cave",
"Cave",
"Empty Clone ",
"Cave",
"Cave",
"Cave",
"Chest Minigame",
"Houses",
"Sick Boy house",
"Tavern",
"Link's House",
"Sarashrala Hut",
"Chest Minigame",
"Library",
"Chicken House",
"Witch Shop",
"A Aginah's Cave",
"Dam",
"Mimic Cave",
"Mire Shed",
"Cave",
"Shop",
"Shop",
"Archery Minigame",
"DW Church/Shop",
"Grave Cave",
"Fairy Fountain",
"Fairy Upgrade",
"Pyramid Fairy",
"Spike Cave",
"Chest Minigame",
"Blind Hut",
"Bonzai Cave",
"Circle of bush Cave",
"Big Bomb Shop, C-House",
"Blind Hut 2",
"Hype Cave",
"Shop",
"Ice Cave",
"Smith",
"Fortune Teller",
"MiniMoldorm Cave",
"Under Rock Caves",
"Smith",
"Cave",
"Mazeblock Cave",
"Smith Peg Cave"};
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
} // namespace app
} // namespace yaze
#endif // YAZE_APP_ZELDA3_DUNGEON_ROOM_NAMES_H

View File

@@ -2,7 +2,6 @@
#include <cstdint>
#include "app/gfx/bitmap.h"
#include "app/gfx/snes_tile.h"
#include "app/rom.h"
@@ -13,10 +12,10 @@ namespace zelda3 {
namespace screen {
void TitleScreen::Create() {
tiles8Bitmap.Create(128, 512, 8, std::vector<uint8_t>(0, 0x20000));
tilesBG1Bitmap.Create(256, 256, 8, std::vector<uint8_t>(0, 0x80000));
tilesBG2Bitmap.Create(256, 256, 8, std::vector<uint8_t>(0, 0x80000));
oamBGBitmap.Create(256, 256, 8, std::vector<uint8_t>(0, 0x80000));
tiles8Bitmap.Create(128, 512, 8, std::vector<uint8_t>(0x20000));
tilesBG1Bitmap.Create(256, 256, 8, std::vector<uint8_t>(0x80000));
tilesBG2Bitmap.Create(256, 256, 8, std::vector<uint8_t>(0x80000));
oamBGBitmap.Create(256, 256, 8, std::vector<uint8_t>(0x80000));
BuildTileset();
LoadTitleScreen();
}
@@ -44,7 +43,7 @@ void TitleScreen::BuildTileset() {
uchar* currentmapgfx8Data = tiles8Bitmap.mutable_data().data();
// All gfx of the game pack of 2048 bytes (4bpp)
uchar* allgfxData = nullptr; // rom_.GetMasterGraphicsBin();
uchar* allgfxData = nullptr;
for (int i = 0; i < 16; i++) {
for (int j = 0; j < 2048; j++) {
uchar mapByte = allgfxData[j + (staticgfx[i] * 2048)];