16 return absl::InvalidArgumentError(
"ROM is not loaded");
27 data_.reserve(256 * 256);
28 for (
int i = 0; i < 256 * 256; i++) {
29 data_.push_back(0xFF);
39 return absl::OkStatus();
44 for (
int i = 0; i < 6 * 0x2000; i++)
tilesheets_.push_back(0xFF);
46 std::vector<uint8_t> test;
47 for (
int i = 0; i < 0x4000; i++) {
50 for (
int i = 0x8000; i < +0x8000 + 0x2000; i++) {
62 return absl::OkStatus();
77 std::vector<IconDef> bow_icons = {
80 {0x10,
"Bow and arrows"},
81 {0x18,
"Empty silvers bow"},
82 {0x20,
"Silver bow and arrows"}
86 std::vector<IconDef> boom_icons = {
87 {0x28,
"No boomerang"},
88 {0x30,
"Blue boomerang"},
89 {0x38,
"Red boomerang"}
93 std::vector<IconDef> hook_icons = {
94 {0x40,
"No hookshot"},
99 std::vector<IconDef> bomb_icons = {
105 auto load_icons = [&](
const std::vector<IconDef>& icons) -> absl::Status {
106 for (
const auto& icon_def : icons) {
108 int icon_addr = pc_addr + icon_def.offset;
114 icon.
name = icon_def.name;
118 return absl::OkStatus();
152 return absl::OkStatus();
The Rom class is used to load, save, and modify Rom data.
auto palette_group() const
absl::StatusOr< uint16_t > ReadWord(int offset)
void QueueTextureCommand(TextureCommandType type, Bitmap *bitmap)
void Create(int width, int height, int depth, std::span< uint8_t > data)
Create a bitmap with the given dimensions and data.
void SetPalette(const SnesPalette &palette)
Set the palette for the bitmap.
absl::Status BuildTileset(Rom *rom)
Build the tileset from 2BPP graphics.
gfx::SnesPalette palette_
std::vector< uint8_t > data_
std::vector< ItemIcon > item_icons_
gfx::Bitmap tilesheets_bmp_
std::vector< uint8_t > test_
absl::Status LoadItemIcons(Rom *rom)
Load individual item icons from ROM.
absl::Status Create(Rom *rom)
Initialize and load inventory screen data from ROM.
std::vector< uint8_t > tilesheets_
#define RETURN_IF_ERROR(expression)
#define ASSIGN_OR_RETURN(type_variable_name, expression)
constexpr int kItemIconsPtr
Main namespace for the application.
absl::StatusOr< std::vector< uint8_t > > Load2BppGraphics(const Rom &rom)
Loads 2bpp graphics from Rom data.
uint32_t SnesToPc(uint32_t addr) noexcept
Represents a single item icon (2x2 tiles = 4 tile words)