yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
dungeon_stream_allocator.cc File Reference
#include "zelda3/dungeon/dungeon_stream_allocator.h"
#include <algorithm>
#include <cstddef>
#include <cstdint>
#include <limits>
#include <map>
#include <span>
#include <tuple>
#include <utility>
#include <vector>
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_format.h"
#include "rom/rom.h"
#include "rom/snes.h"
#include "rom/write_fence.h"
#include "util/macro.h"
#include "util/rom_hash.h"
#include "zelda3/dungeon/dungeon_rom_addresses.h"

Go to the source code of this file.

Namespaces

namespace  yaze
 
namespace  yaze::zelda3
 Zelda 3 specific classes and functions.
 
namespace  yaze::zelda3::anonymous_namespace{dungeon_stream_allocator.cc}
 

Functions

bool yaze::zelda3::anonymous_namespace{dungeon_stream_allocator.cc}::IntersectsWramMappedPc (uint32_t begin, uint32_t end)
 
uint32_t yaze::zelda3::anonymous_namespace{dungeon_stream_allocator.cc}::PointerWidth (DungeonPointerEncoding encoding)
 
bool yaze::zelda3::anonymous_namespace{dungeon_stream_allocator.cc}::Contains (const DungeonStreamPcRange &outer, const DungeonStreamPcRange &inner)
 
bool yaze::zelda3::anonymous_namespace{dungeon_stream_allocator.cc}::Intersects (const DungeonStreamPcRange &a, const DungeonStreamPcRange &b)
 
bool yaze::zelda3::anonymous_namespace{dungeon_stream_allocator.cc}::ContainsAddress (const DungeonStreamPcRange &range, uint32_t address)
 
absl::StatusOr< std::vector< DungeonStreamPcRange > > yaze::zelda3::anonymous_namespace{dungeon_stream_allocator.cc}::NormalizeRanges (const std::vector< DungeonStreamPcRange > &input, uint32_t rom_size, const char *label, bool allow_empty)
 
absl::Status yaze::zelda3::anonymous_namespace{dungeon_stream_allocator.cc}::ValidateAllocationSubset (const std::vector< DungeonStreamPcRange > &data_ranges, const std::vector< DungeonStreamPcRange > &allocation_ranges)
 
absl::StatusOr< uint32_t > yaze::zelda3::anonymous_namespace{dungeon_stream_allocator.cc}::ReadWordAt (const Rom &rom, uint32_t address)
 
absl::StatusOr< uint32_t > yaze::zelda3::anonymous_namespace{dungeon_stream_allocator.cc}::ReadLongAt (const Rom &rom, uint32_t address)
 
absl::Status yaze::zelda3::anonymous_namespace{dungeon_stream_allocator.cc}::ValidateKnownPointerTableSource (const Rom &rom, const DungeonStreamLayout &layout)
 
DungeonStreamPcRange yaze::zelda3::anonymous_namespace{dungeon_stream_allocator.cc}::KnownPointerSourceRange (DungeonStreamKind kind)
 
absl::StatusOr< DungeonStreamLayoutyaze::zelda3::anonymous_namespace{dungeon_stream_allocator.cc}::ValidateAndNormalizeLayout (const Rom &rom, const DungeonStreamLayout &input)
 
absl::StatusOr< uint32_t > yaze::zelda3::anonymous_namespace{dungeon_stream_allocator.cc}::DecodePointer (const Rom &rom, const DungeonStreamLayout &layout, uint32_t room_id)
 
const DungeonStreamPcRangeyaze::zelda3::anonymous_namespace{dungeon_stream_allocator.cc}::FindContainingRange (const std::vector< DungeonStreamPcRange > &ranges, uint32_t address)
 
absl::StatusOr< uint32_t > yaze::zelda3::anonymous_namespace{dungeon_stream_allocator.cc}::ParseObjectStream (std::span< const uint8_t > bytes, uint32_t start, uint32_t limit, uint32_t *door_list_pc=nullptr)
 
absl::StatusOr< uint32_t > yaze::zelda3::anonymous_namespace{dungeon_stream_allocator.cc}::ParseSpriteStream (std::span< const uint8_t > bytes, uint32_t start, uint32_t limit)
 
absl::StatusOr< uint32_t > yaze::zelda3::anonymous_namespace{dungeon_stream_allocator.cc}::ParsePotItemStream (std::span< const uint8_t > bytes, uint32_t start, uint32_t limit)
 
absl::StatusOr< uint32_t > yaze::zelda3::anonymous_namespace{dungeon_stream_allocator.cc}::ParseStream (std::span< const uint8_t > bytes, DungeonStreamKind kind, uint32_t start, uint32_t limit)
 
absl::Status yaze::zelda3::anonymous_namespace{dungeon_stream_allocator.cc}::ValidateCompleteEncodedStream (DungeonStreamKind kind, const std::vector< uint8_t > &encoded)
 
absl::StatusOr< uint32_t > yaze::zelda3::anonymous_namespace{dungeon_stream_allocator.cc}::ObjectDoorListOffset (const std::vector< uint8_t > &encoded)
 
std::vector< DungeonStreamPcRangeyaze::zelda3::anonymous_namespace{dungeon_stream_allocator.cc}::UnionIntervals (std::vector< DungeonStreamPcRange > intervals)
 
std::vector< DungeonStreamPcRangeyaze::zelda3::anonymous_namespace{dungeon_stream_allocator.cc}::ComplementIntervals (const std::vector< DungeonStreamPcRange > &containers, const std::vector< DungeonStreamPcRange > &occupied)
 
absl::StatusOr< std::vector< uint8_t > > yaze::zelda3::anonymous_namespace{dungeon_stream_allocator.cc}::EncodePointer (const DungeonStreamLayout &layout, uint32_t pc)
 
absl::StatusOr< uint32_t > yaze::zelda3::anonymous_namespace{dungeon_stream_allocator.cc}::FindFirstFit (const std::vector< DungeonStreamPcRange > &free_intervals, const DungeonStreamLayout &layout, uint32_t size)
 
void yaze::zelda3::anonymous_namespace{dungeon_stream_allocator.cc}::ConsumeInterval (std::vector< DungeonStreamPcRange > *free_intervals, DungeonStreamPcRange consumed)
 
bool yaze::zelda3::anonymous_namespace{dungeon_stream_allocator.cc}::IsSortedUniqueByRoom (const std::vector< DungeonStreamWrite > &writes)
 
absl::Status yaze::zelda3::anonymous_namespace{dungeon_stream_allocator.cc}::ValidatePlanAgainstInventory (const DungeonStreamWritePlan &plan, const DungeonStreamInventory &inventory)
 
absl::StatusOr< DungeonStreamInventoryyaze::zelda3::InventoryDungeonStreams (const Rom &rom, const DungeonStreamLayout &requested_layout)
 
absl::StatusOr< DungeonStreamWritePlanyaze::zelda3::PlanDungeonStreamWrites (const DungeonStreamInventory &inventory, const std::vector< DungeonStreamReplacement > &requested_replacements)
 
absl::StatusOr< DungeonStreamWritePlanyaze::zelda3::PlanDungeonStreamRepack (const DungeonStreamInventory &inventory, const std::vector< DungeonStreamReplacement > &requested_replacements)
 
absl::Status yaze::zelda3::ApplyDungeonStreamWritePlan (Rom *rom, const DungeonStreamWritePlan &plan)
 

Variables

constexpr uint32_t yaze::zelda3::anonymous_namespace{dungeon_stream_allocator.cc}::kLoRomBankSize = 0x8000
 
constexpr uint32_t yaze::zelda3::anonymous_namespace{dungeon_stream_allocator.cc}::kWramMappedPcBegin = 0x3F0000
 
constexpr uint32_t yaze::zelda3::anonymous_namespace{dungeon_stream_allocator.cc}::kWramMappedPcEnd = 0x400000