1#ifndef YAZE_ZELDA3_GFX_SHEET_STORAGE_H
2#define YAZE_ZELDA3_GFX_SHEET_STORAGE_H
13#include "absl/status/status.h"
14#include "absl/status/statusor.h"
48 uint32_t
low = 0x513E;
76 const Rom& rom, uint16_t sheet_id,
82 const Rom& rom, uint16_t sheet_id,
83 const GfxSheetPointerTables& tables = {});
87 const Rom& rom, uint16_t sheet_id,
88 const GfxSheetPointerTables& tables = {});
114 std::function<absl::Status(uint32_t begin, uint32_t end)>
check_write;
145 Rom& rom, uint16_t sheet_id,
const std::vector<uint8_t>& snes_3bpp,
The Rom class is used to load, save, and modify Rom data. This is a generic SNES ROM container and do...
Zelda 3 specific classes and functions.
absl::StatusOr< GfxSheetExtent > ReadGfxSheetExtent(const Rom &rom, uint16_t sheet_id, const GfxSheetPointerTables &tables)
constexpr size_t kGfxSheet3bppBytes
std::array< int, 4 > GfxSheetBlockTiles(int block)
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).
absl::StatusOr< GfxSheetWriteResult > WriteGfxSheet(Rom &rom, uint16_t sheet_id, const std::vector< uint8_t > &snes_3bpp, const GfxSheetWritePolicy &policy, const GfxSheetPointerTables &tables)
Writes one edited 3bpp sheet to the ROM buffer.
constexpr size_t kGfxSheet2bppBytes
bool IsGfxSheetBlockEmpty(const std::vector< uint8_t > &data, int block, int bpp)
GfxSheetStorageKind GetGfxSheetStorageKind(uint16_t sheet_id)
constexpr size_t kGfxSheetCount
bool UsesJapaneseGfxSheetTables(const Rom &rom)
constexpr int kGfxSheetBlockCount
16x16 blocks per sheet: 8 columns x 2 rows over the 128x32 sheet.
const char * GfxSheetStorageKindName(GfxSheetStorageKind kind)
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.
Where one sheet's bytes live and how many bytes they occupy.
Half-open PC range [begin, end).
PC offsets of the bank, high and low byte pointer tables.
Rules a sheet write must follow.
std::set< uint16_t > reserved_sheets
std::vector< GfxSheetPcRange > allocation_regions
std::function< absl::Status(uint32_t begin, uint32_t end)> check_write
std::map< uint16_t, std::vector< uint16_t > > reserved_blocks
GfxSheetPlacement placement