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 // Roomsets override blockset slots 4..7.
40 if (slot_index < 0 || slot_index > 3) {
42 }
43 return RoleForBlocksetSlot(slot_index + 4);
44}
45
47 if (slot_index < 0 || slot_index > 3) {
49 }
51}
52
54 if (sheet_id < 0)
56 if (sheet_id < kDungeonSheetIdEnd)
58 if (sheet_id < kSpriteSheetIdEnd)
60 return SheetRole::kHud;
61}
62
64 switch (role) {
66 // Slot 0 routes to AUX1 region; tile16 reports cgram row 2.
67 return {"ow_aux", 0, 2};
69 return {"ow_main", 0, 2};
71 return {"ow_aux", 0, 2};
73 return {"ow_aux", 1, 5};
75 return {"ow_animated", 0, 7};
77 return {"sprites_aux1", 0, 0};
78 case SheetRole::kHud:
79 return {"hud", 0, 0};
81 return {"dungeon_main", 0, 0};
83 default:
84 return {"", 0, 0};
85 }
86}
87
88} // namespace gfx
89} // 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)