yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
sheet_role_palette_table.cc
Go to the documentation of this file.
2
3namespace yaze {
4namespace gfx {
5
6namespace {
7
8// Sheet-id partition mirrors zelda3/game_data.cc ProcessSheetBitmap defaults:
9// id < 113 -> dungeon_main
10// id < 128 -> sprites_aux1
11// id >= 128 -> hud
12constexpr int kDungeonSheetIdEnd = 113;
13constexpr int kSpriteSheetIdEnd = 128;
14
15} // namespace
16
18 // Mirrors Tile16Editor::GetPaletteSlotForSheet/GetPaletteBaseForSheet.
19 switch (slot_index) {
20 case 0:
22 case 1:
23 case 2:
25 case 3:
26 case 4:
28 case 5:
29 case 6:
31 case 7:
33 default:
35 }
36}
37
39 // Room::LoadRoomGraphics writes entry i into blocks_[3 + i].
40 // OverworldMap::LoadAreaGraphicsBlocksets writes it into
41 // static_graphics_[3 + i]. Slot 7 is the animated sheet, not a roomset.
42 if (slot_index < 0 || slot_index > 3) {
44 }
45 return RoleForBlocksetSlot(slot_index + 3);
46}
47
49 if (slot_index < 0 || slot_index > 3) {
51 }
53}
54
56 if (sheet_id < 0)
58 if (sheet_id < kDungeonSheetIdEnd)
60 if (sheet_id < kSpriteSheetIdEnd)
62 return SheetRole::kHud;
63}
64
66 switch (role) {
68 // Slot 0 routes to AUX1 region; tile16 reports cgram row 2.
69 return {"ow_aux", 0, 2};
71 return {"ow_main", 0, 2};
73 return {"ow_aux", 0, 2};
75 return {"ow_aux", 1, 5};
77 return {"ow_animated", 0, 7};
79 return {"sprites_aux1", 0, 0};
80 case SheetRole::kHud:
81 return {"hud", 0, 0};
83 return {"dungeon_main", 0, 0};
85 default:
86 return {"", 0, 0};
87 }
88}
89
90} // namespace gfx
91} // namespace yaze
SheetRole RoleForSheetId(int sheet_id)
SheetRolePaletteBinding DefaultBindingFor(SheetRole role)
SheetRole RoleForRoomsetSlot(int slot_index)
SheetRole RoleForBlocksetSlot(int slot_index)
SheetRole RoleForSpritesetSlot(int slot_index)