3#include "absl/strings/str_format.h"
12 const Rom& rom, uint16_t sheet_id,
13 const std::vector<uint8_t>& expected_pixels,
18 return absl::DataLossError(absl::StrFormat(
19 "Sheet 0x%02X decodes (game decoder) to different pixels than were "
25 return absl::OkStatus();
32 rom.
data(),
static_cast<int>(pc), 0x800,
35 return absl::DataLossError(
36 absl::StrFormat(
"Sheet 0x%02X reopens (editor loader) with %zu bytes",
37 sheet_id, loaded.size()));
41 return absl::DataLossError(absl::StrFormat(
42 "Sheet 0x%02X reopens (editor loader) with different pixels than "
46 return absl::OkStatus();
51 return absl::StrFormat(
"Sheet 0x%02X: refused (%s)", entry.
sheet_id,
55 return absl::StrFormat(
56 "Sheet 0x%02X: relocated 0x%06X -> 0x%06X, %zu -> %zu bytes",
60 return absl::StrFormat(
"Sheet 0x%02X: in place at 0x%06X, %zu -> %zu bytes",
The Rom class is used to load, save, and modify Rom data. This is a generic SNES ROM container and do...
#define ASSIGN_OR_RETURN(type_variable_name, expression)
Editors are the view controllers for the application.
std::string DescribeGraphicsSavePlanEntry(const GraphicsSavePlanEntry &entry)
"Sheet 0x92: in place at 0x0AED16, 1476 -> 1473 bytes".
absl::Status VerifyWrittenSheetPixels(const Rom &rom, uint16_t sheet_id, const std::vector< uint8_t > &expected_pixels, const zelda3::GfxSheetPointerTables &tables)
absl::StatusOr< std::vector< uint8_t > > DecompressV2(const uint8_t *data, int offset, int size, int mode, size_t rom_size)
Decompresses a buffer of data using the LC_LZ2 algorithm.
std::vector< uint8_t > SnesTo8bppSheet(std::span< const uint8_t > sheet, int bpp, int num_sheets)
constexpr size_t kGfxSheet3bppBytes
absl::StatusOr< std::vector< uint8_t > > ReadGfxSheetData(const Rom &rom, uint16_t sheet_id, const GfxSheetPointerTables &tables)
Returns the sheet's decoded bytes (SNES planar data).
GfxSheetStorageKind GetGfxSheetStorageKind(uint16_t sheet_id)
absl::StatusOr< uint32_t > ReadGfxSheetPc(const Rom &rom, uint16_t sheet_id, const GfxSheetPointerTables &tables)
Resolves a sheet's pointer. Does not read the sheet data.
zelda3::GfxSheetPlacement placement
PC offsets of the bank, high and low byte pointer tables.