yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
inventory.h
Go to the documentation of this file.
1#ifndef YAZE_APP_ZELDA3_INVENTORY_H
2#define YAZE_APP_ZELDA3_INVENTORY_H
3
4#include "absl/status/status.h"
9#include "app/rom.h"
10
11namespace yaze {
12namespace zelda3 {
13
14constexpr int kInventoryStart = 0x6564A;
15// ItemIcons base address in SNES format (0x0DF629)
16constexpr int kItemIconsPtr = 0x0DF629;
17
21struct ItemIcon {
22 uint16_t tile_tl; // Top-left tile word (vhopppcc cccccccc format)
23 uint16_t tile_tr; // Top-right tile word
24 uint16_t tile_bl; // Bottom-left tile word
25 uint16_t tile_br; // Bottom-right tile word
26 std::string name; // Human-readable name for debugging
27};
28
35class Inventory {
36 public:
41 absl::Status Create(Rom* rom);
42
43 auto &bitmap() { return bitmap_; }
44 auto &tilesheet() { return tilesheets_bmp_; }
45 auto &palette() { return palette_; }
46 auto &item_icons() { return item_icons_; }
47
48 private:
53 absl::Status BuildTileset(Rom* rom);
54
59 absl::Status LoadItemIcons(Rom* rom);
60
61 std::vector<uint8_t> data_;
63
64 std::vector<uint8_t> tilesheets_;
65 std::vector<uint8_t> test_;
68
70 std::vector<gfx::TileInfo> tiles_;
71 std::vector<ItemIcon> item_icons_;
72};
73
74} // namespace zelda3
75} // namespace yaze
76
77#endif // YAZE_APP_ZELDA3_INVENTORY_H
The Rom class is used to load, save, and modify Rom data.
Definition rom.h:74
Represents a bitmap image optimized for SNES ROM hacking.
Definition bitmap.h:66
Represents a palette of colors for the Super Nintendo Entertainment System (SNES).
Modern, robust canvas for drawing and manipulating graphics.
Definition canvas.h:59
Inventory manages the inventory screen graphics and layout.
Definition inventory.h:35
absl::Status BuildTileset(Rom *rom)
Build the tileset from 2BPP graphics.
Definition inventory.cc:42
gfx::SnesPalette palette_
Definition inventory.h:67
std::vector< uint8_t > data_
Definition inventory.h:61
std::vector< ItemIcon > item_icons_
Definition inventory.h:71
gfx::Bitmap tilesheets_bmp_
Definition inventory.h:66
std::vector< uint8_t > test_
Definition inventory.h:65
absl::Status LoadItemIcons(Rom *rom)
Load individual item icons from ROM.
Definition inventory.cc:65
std::vector< gfx::TileInfo > tiles_
Definition inventory.h:70
absl::Status Create(Rom *rom)
Initialize and load inventory screen data from ROM.
Definition inventory.cc:14
std::vector< uint8_t > tilesheets_
Definition inventory.h:64
constexpr int kItemIconsPtr
Definition inventory.h:16
constexpr int kInventoryStart
Definition inventory.h:14
Main namespace for the application.
Definition controller.cc:20
Represents a single item icon (2x2 tiles = 4 tile words)
Definition inventory.h:21