yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
sprite_sheet_slots.h
Go to the documentation of this file.
1#ifndef YAZE_ZELDA3_SPRITE_SPRITE_SHEET_SLOTS_H
2#define YAZE_ZELDA3_SPRITE_SPRITE_SHEET_SLOTS_H
3
4#include <array>
5#include <cstdint>
6#include <set>
7#include <vector>
8
9#include "rom/rom.h"
10
11namespace yaze::zelda3 {
12
25constexpr bool IsUnderworldSpriteset(int spriteset) {
26 return spriteset >= 0x40;
27}
28
30std::array<uint8_t, 8> SpriteSheetSlots(
31 const std::array<uint8_t, 4>& spriteset_values, bool underworld);
32
34constexpr int SpriteSlotForTile(int tile) {
35 return (tile & 0x1FF) / 0x40;
36}
37
39 enum class Kind {
40 kBlank, // the referenced 8x8 tile is all zero
41 kReservedSheet, // the slot's sheet is reserved by the project
42 kUnreadableSheet, // the slot names a sheet that cannot be read
43 };
45 int tile = 0;
46 int slot = 0;
47 uint16_t sheet = 0;
48};
49
53std::vector<SpriteTileIssue> CheckSpriteTiles(
54 const Rom& rom, const std::vector<int>& tiles,
55 const std::array<uint8_t, 8>& slots,
56 const std::set<uint16_t>& reserved_sheets = {});
57
58} // namespace yaze::zelda3
59
60#endif // YAZE_ZELDA3_SPRITE_SPRITE_SHEET_SLOTS_H
The Rom class is used to load, save, and modify Rom data. This is a generic SNES ROM container and do...
Definition rom.h:49
Zelda 3 specific classes and functions.
constexpr bool IsUnderworldSpriteset(int spriteset)
Dungeon rooms use spritesets 0x40-0x8F (room header value + 0x40).
constexpr int SpriteSlotForTile(int tile)
Slot (0-7) holding 8x8 OAM tile tile (name-table bit included).
std::array< uint8_t, 8 > SpriteSheetSlots(const std::array< uint8_t, 4 > &spriteset_values, bool underworld)
The eight sheets for a spriteset's four values.
std::vector< SpriteTileIssue > CheckSpriteTiles(const Rom &rom, const std::vector< int > &tiles, const std::array< uint8_t, 8 > &slots, const std::set< uint16_t > &reserved_sheets)