yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
prototype_research_view.cc
Go to the documentation of this file.
2
3#include <algorithm>
4#include <cfloat>
5#include <cstring>
6#include <filesystem>
7#include <string>
8
13#include "app/gui/core/color.h"
14#include "app/gui/core/icons.h"
15#include "app/gui/core/input.h"
16#include "app/gui/core/style.h"
19#include "imgui/imgui.h"
20#include "imgui/misc/cpp/imgui_stdlib.h"
21#include "util/file_util.h"
22#include "util/macro.h"
23
24namespace yaze {
25namespace editor {
26
27namespace {
28
29constexpr uint64_t kDefaultClipboardDecompressSize = 0x40000;
30
31const std::string kSuperDonkeyTiles[] = {
32 "97C05", "98219", "9871E", "98C00", "99084", "995AF", "99DE0", "9A27E",
33 "9A741", "9AC31", "9B07E", "9B55C", "9B963", "9BB99", "9C009", "9C4B4",
34 "9C92B", "9CDD6", "9D2C2", "9E037", "9E527", "9EA56", "9EF65", "9FCD1",
35 "A0193", "A059E", "A0B17", "A0FB6", "A14A5", "A1988", "A1E66", "A232B",
36 "A27F0", "A2B6E", "A302C", "A3453", "A38CA", "A42BB", "A470C", "A4BA9",
37 "A5089", "A5385", "A5742", "A5BCC", "A6017", "A6361", "A66F8"};
38
39const std::string kSuperDonkeySprites[] = {
40 "A8E5D", "A9435", "A9934", "A9D83", "AA2F1", "AA6D4", "AABE4", "AB127",
41 "AB65A", "ABBDD", "AC38D", "AC797", "ACCC8", "AD0AE", "AD245", "AD554",
42 "ADAAC", "ADECC", "AE453", "AE9D2", "AEF40", "AF3C9", "AF92E", "AFE9D",
43 "B03D2", "B09AC", "B0F0C", "B1430", "B1859", "B1E01", "B229A", "B2854",
44 "B2D27", "B31D7", "B3B58", "B40B5", "B45A5", "B4D64", "B5031", "B555F",
45 "B5F30", "B6858", "B70DD", "B7526", "B79EC", "B7C83", "B80F7", "B85CC",
46 "B8A3F", "B8F97", "B94F2", "B9A20", "B9E9A", "BA3A2", "BA8F6", "BACDC",
47 "BB1F9", "BB781", "BBCCA", "BC26D", "BC7D4", "BCBB0", "BD082", "BD5FC",
48 "BE115", "BE5C2", "BEB63", "BF0CB", "BF607", "BFA55", "BFD71", "C017D",
49 "C0567", "C0981", "C0BA7", "C116D", "C166A", "C1FE0", "C24CE", "C2B19"};
50
51std::string NormalizeSelectedPath(const std::string& path) {
52 if (path.empty()) {
53 return path;
54 }
55 return std::filesystem::absolute(path).string();
56}
57
59 if (!bitmap || !bitmap->is_active() || !bitmap->surface()) {
60 return;
61 }
62
66 bitmap);
67}
68
69} // namespace
70
76
77void PrototypeResearchView::Draw(bool* p_open) {
78 Update().IgnoreError();
79}
80
84
85 constexpr ImGuiTableFlags kWorkspaceFlags =
86 ImGuiTableFlags_Resizable | ImGuiTableFlags_SizingStretchProp |
87 ImGuiTableFlags_NoSavedSettings;
88
89 if (ImGui::BeginTable("##PrototypeWorkspace", 2, kWorkspaceFlags)) {
90 ImGui::TableSetupColumn("Inspector", ImGuiTableColumnFlags_WidthFixed,
91 420.0f);
92 ImGui::TableSetupColumn("Preview", ImGuiTableColumnFlags_WidthStretch,
93 0.0f);
94 ImGui::TableNextColumn();
96 ImGui::TableNextColumn();
98 ImGui::EndTable();
99 }
100
101 return status_;
102}
103
105 gui::SectionHeader(ICON_MD_TRAVEL_EXPLORE, "Prototype Research",
107 ImGui::TextWrapped(
108 "Decode CGX, SCR, COL, and raw prototype data directly inside the "
109 "graphics workspace so research assets can be compared without leaving "
110 "the editor.");
112 "SCR files are SNES tilemaps. Pair them with matching CGX and COL data "
113 "to reconstruct early HUDs, menus, and screen layouts.",
116
117 if (!status_.ok()) {
118 gui::ColoredTextF(gui::GetErrorColor(), "%s", status_.message().data());
119 } else if (!HasGraphicsPreview() && !HasScreenPreview() &&
122 "Load a CGX, BIN, or Super Donkey source to start previewing.",
124 }
125}
126
128 if (!cgx_loaded_ && !scr_loaded_ && !col_file_ && !gfx_loaded_ &&
130 gui::StatusBadge("No assets loaded", gui::ButtonType::Info);
131 return;
132 }
133
134 bool first = true;
135 auto draw_badge = [&](const char* label, gui::ButtonType type) {
136 if (!first) {
137 ImGui::SameLine();
138 }
139 gui::StatusBadge(label, type);
140 first = false;
141 };
142
143 if (cgx_loaded_) {
144 draw_badge("CGX", gui::ButtonType::Success);
145 }
146 if (scr_loaded_) {
147 draw_badge("SCR", gui::ButtonType::Success);
148 }
149 if (col_file_) {
150 draw_badge(UsingExternalPalette() ? "COL Palette" : "COL Loaded",
153 }
154 if (gfx_loaded_) {
155 draw_badge("BIN Preview", gui::ButtonType::Success);
156 }
157 if (super_donkey_) {
158 draw_badge("Super Donkey", gui::ButtonType::Warning);
159 }
160 if (obj_loaded_) {
161 draw_badge("OBJ Bytes", gui::ButtonType::Default);
162 }
163 if (tilemap_loaded_) {
164 draw_badge("Tilemap Bytes", gui::ButtonType::Default);
165 }
166}
167
169 ImGui::BeginChild("##PrototypeInspector", ImVec2(0, 0), false,
170 ImGuiWindowFlags_AlwaysVerticalScrollbar);
171
172 auto sync_status = [this](const absl::Status& section_status) {
173 status_ = section_status;
174 };
175
176 if (ImGui::CollapsingHeader(ICON_MD_IMAGE_SEARCH " Graphics Sources",
177 ImGuiTreeNodeFlags_DefaultOpen)) {
178 sync_status(DrawCgxImportSection());
179 sync_status(DrawScrImportSection());
180 sync_status(DrawBinImportSection());
181 }
182
183 if (ImGui::CollapsingHeader(ICON_MD_PALETTE " Preview Palette",
184 ImGuiTreeNodeFlags_DefaultOpen)) {
185 sync_status(DrawPaletteSection());
186 }
187
188 if (ImGui::CollapsingHeader(ICON_MD_BUILD " Advanced Inputs",
189 ImGuiTreeNodeFlags_DefaultOpen)) {
190 sync_status(DrawClipboardSection());
191 sync_status(DrawObjImportSection());
192 sync_status(DrawTilemapImportSection());
193 sync_status(DrawExperimentalSection());
194 }
195
196 ImGui::EndChild();
197}
198
200 ImGui::BeginChild("##PrototypePreview", ImVec2(0, 0), false,
201 ImGuiWindowFlags_AlwaysVerticalScrollbar);
203
204 if (ImGui::BeginTabBar("##PrototypePreviewTabs")) {
205 if (ImGui::BeginTabItem("Graphics")) {
207 ImGui::EndTabItem();
208 }
209 if (ImGui::BeginTabItem("Screen")) {
211 ImGui::EndTabItem();
212 }
213 if (ImGui::BeginTabItem("Super Donkey")) {
215 ImGui::EndTabItem();
216 }
217 ImGui::EndTabBar();
218 }
219
220 ImGui::EndChild();
221}
222
224 if (!HasGraphicsPreview()) {
225 DrawEmptyState("No graphics preview available",
226 "Load a CGX tilesheet or decode a BIN source.");
227 return;
228 }
229
230 const bool has_cgx_preview = cgx_loaded_ && cgx_bitmap_.is_active();
231 const bool has_bin_preview = gfx_loaded_ && bin_bitmap_.is_active();
232
233 if (has_cgx_preview && has_bin_preview) {
236 }
237 ImGui::SameLine();
240 }
241 ImGui::SameLine();
243 "Switch between the direct CGX decode and the generic BIN preview.");
244 } else {
245 active_graphics_preview_ = has_bin_preview ? 1 : 0;
246 }
247
248 gfx::Bitmap* active_bitmap =
250 const char* preview_label =
251 active_graphics_preview_ == 1 ? "BIN Decode" : "CGX Tilesheet";
252
253 gui::ColoredTextF(gui::GetInfoColor(), "%s %dx%d", preview_label,
254 active_bitmap->width(), active_bitmap->height());
256 active_bitmap->width(), active_bitmap->height(),
257 0x20, true, true, active_graphics_preview_ + 1);
258}
259
261 if (!HasScreenPreview()) {
263 "No screen preview available",
264 "Load SCR data after CGX to reconstruct a prototype screen.");
265 return;
266 }
267
268 gui::ColoredTextF(gui::GetInfoColor(), "SCR Composite %dx%d",
271 scr_bitmap_.height(), 0x20, true, true, 99);
272}
273
276 DrawEmptyState("Super Donkey sheets not decoded",
277 "Use the experimental decoder after loading the prototype "
278 "BIN source.");
279 return;
280 }
281
282 ImGui::SetNextItemWidth(120.0f);
283 gui::SliderFloatWheel("Scale", &prototype_sheet_scale_, 1.0f, 4.0f, "%.1fx");
284 ImGui::SameLine();
285 ImGui::SetNextItemWidth(120.0f);
286 ImGui::SliderInt("Columns", &prototype_sheet_columns_, 1, 6);
287
288 const float tile_width = 128.0f * prototype_sheet_scale_;
289 const float tile_height = 32.0f * prototype_sheet_scale_;
290 int current_column = 0;
291
292 ImGui::BeginChild("##SuperDonkeySheets", ImVec2(0, 0), true,
293 ImGuiWindowFlags_AlwaysVerticalScrollbar);
294 for (size_t i = 0; i < num_sheets_to_load_ && i < gfx_sheets_.size(); ++i) {
295 auto& bitmap = gfx_sheets_[i];
296 if (!bitmap.is_active() || !bitmap.texture()) {
297 continue;
298 }
299
300 ImGui::BeginGroup();
301 ImGui::Image((ImTextureID)(intptr_t)bitmap.texture(),
302 ImVec2(tile_width, tile_height));
303 ImGui::Text("Sheet %02zu", i);
304 ImGui::EndGroup();
305
306 current_column++;
307 if (current_column < prototype_sheet_columns_) {
308 ImGui::SameLine();
309 } else {
310 current_column = 0;
311 }
312 }
313 ImGui::EndChild();
314}
315
317 const char* detail) {
319 ImGui::Spacing();
320 ImGui::TextWrapped("%s", detail);
321}
322
325 return;
326 }
327
328 ImGui::SetNextWindowSize(ImVec2(900.0f, 540.0f), ImGuiCond_FirstUseEver);
329 ImGui::SetNextWindowSizeConstraints(ImVec2(720.0f, 420.0f),
330 ImVec2(1600.0f, FLT_MAX));
331 if (!ImGui::Begin(ICON_MD_MEMORY " Prototype Memory Inspector",
332 &open_memory_editor_, ImGuiWindowFlags_NoScrollbar)) {
333 ImGui::End();
334 return;
335 }
336
337 static gui::MemoryEditorWidget memory_editor;
339 ImGui::End();
340}
341
342bool PrototypeResearchView::DrawPathEditor(const char* id, const char* hint,
343 std::string* path,
344 const char* browse_label,
345 const char* browse_spec) {
346 bool changed = false;
348 options.filters.push_back({browse_label, browse_spec});
349 options.filters.push_back({"All Files", "*"});
350
351 ImGui::PushID(id);
352 ImGui::SetNextItemWidth(-68.0f);
353 changed = ImGui::InputTextWithHint("##Path", hint, path);
354 ImGui::SameLine();
355 if (ImGui::Button(ICON_MD_FOLDER_OPEN "##BrowsePath")) {
356 const auto selected = util::FileDialogWrapper::ShowOpenFileDialog(options);
357 if (!selected.empty()) {
358 *path = NormalizeSelectedPath(selected);
359 changed = true;
360 }
361 }
362 if (ImGui::IsItemHovered()) {
363 ImGui::SetTooltip("Browse");
364 }
365 ImGui::SameLine();
366 ImGui::BeginDisabled(path->empty());
367 if (ImGui::Button(ICON_MD_CONTENT_COPY "##CopyPath")) {
368 ImGui::SetClipboardText(path->c_str());
369 }
370 if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) {
371 ImGui::SetTooltip("Copy path");
372 }
373 ImGui::EndDisabled();
374 ImGui::PopID();
375 return changed;
376}
377
379 ImGui::SeparatorText("CGX Tilesheet");
380 DrawPathEditor("cgx", "Select a .cgx or prototype graphics blob", &cgx_path_,
381 "CGX Files", "cgx,bin");
382
383 ImGui::SetNextItemWidth(120.0f);
384 if (ImGui::InputInt("Bits Per Pixel", &current_bpp_)) {
385 current_bpp_ = std::clamp(current_bpp_, 1, 8);
386 }
387 ImGui::SameLine();
388 ImGui::BeginDisabled(cgx_path_.empty());
391 return status_;
392 }
393 ImGui::EndDisabled();
394
395 return status_;
396}
397
399 ImGui::SeparatorText("SCR Screen");
400 DrawPathEditor("scr", "Select a .scr or prototype screen blob", &scr_path_,
401 "SCR Files", "scr,pnl,bin,bak");
402
403 ImGui::SetNextItemWidth(120.0f);
404 ImGui::InputInt("SCR Mod", &scr_mod_value_);
405 ImGui::SameLine();
406 ImGui::BeginDisabled(scr_path_.empty() || decoded_cgx_.empty());
410 return status_;
411 }
412 ImGui::EndDisabled();
413 if (decoded_cgx_.empty()) {
415 "SCR preview depends on an already decoded CGX tilesheet. Use this "
416 "to reconstruct prototype HUDs and menus from raw SNES tilemaps.");
417 }
418
419 return status_;
420}
421
423 ImGui::SeparatorText("Palette Source");
424
425 DrawPathEditor("col", "Select a .col or backup palette", &col_path_,
426 "COL Files", "col,bak,bin");
427
428 ImGui::BeginDisabled(col_path_.empty());
431 return status_;
432 }
433 ImGui::EndDisabled();
434
435 if (col_file_) {
436 if (ImGui::Checkbox("Prefer external COL palette",
439 }
440 } else {
441 bool disabled_toggle = false;
442 ImGui::BeginDisabled();
443 ImGui::Checkbox("Prefer external COL palette", &disabled_toggle);
444 ImGui::EndDisabled();
445 }
446
447 if (UsingExternalPalette()) {
448 bool refresh_palette = false;
449 gui::ColoredText("Using COL palette rows for preview",
453 if (refresh_palette) {
455 }
456 } else if (rom_ && rom_->is_loaded() && game_data_) {
458
459 ImGui::SetNextItemWidth(220.0f);
460 bool palette_changed = ImGui::Combo(
461 "ROM Group", &rom_palette_group_index_, kPaletteGroupAddressesKeys,
462 IM_ARRAYSIZE(kPaletteGroupAddressesKeys));
463
464 int palette_index = static_cast<int>(rom_palette_index_);
465 ImGui::SetNextItemWidth(120.0f);
466 if (ImGui::InputInt("ROM Palette", &palette_index)) {
467 rom_palette_index_ = static_cast<uint64_t>(std::max(0, palette_index));
468 palette_changed = true;
469 }
470
471 if (palette_changed) {
473 }
474 } else {
476 "Load a ROM or a COL file to apply palette data to prototype previews.",
478 }
479
480 return status_;
481}
482
484 ImGui::SeparatorText("Raw BIN / ROM Decompression");
485 DrawPathEditor("bin", "Select a .bin, .hex, or ROM source", &bin_path_,
486 "Binary Sources", "bin,hex,sfc,smc");
487
488 gui::InputHex("BIN Offset", &current_offset_);
489 gui::InputHex("BIN Size", &bin_size_);
490
491 ImGui::BeginDisabled(bin_path_.empty());
495 return status_;
496 }
497 ImGui::EndDisabled();
498
499 return status_;
500}
501
503 ImGui::SeparatorText("Clipboard Source");
504
505 if (ImGui::Button(ICON_MD_CONTENT_PASTE " Paste Raw Bytes")) {
507 return status_;
508 }
509 ImGui::SameLine();
510 ImGui::BeginDisabled(!source_rom_.is_loaded());
511 if (ImGui::Button(ICON_MD_MEMORY " Inspect")) {
512 open_memory_editor_ = true;
513 }
514 ImGui::EndDisabled();
515
516 gui::InputHex("Clipboard Offset", &clipboard_offset_);
517 gui::InputHex("Clipboard Size", &clipboard_size_);
518
519 ImGui::BeginDisabled(!source_rom_.is_loaded());
520 if (gui::ColoredButton(ICON_MD_PREVIEW " Decode Clipboard",
523 const int decode_size =
524 static_cast<int>(clipboard_size_ == 0 ? kDefaultClipboardDecompressSize
526 status_ = DecompressImportData(decode_size);
527 return status_;
528 }
529 ImGui::EndDisabled();
530
531 return status_;
532}
533
535 ImGui::SeparatorText("OBJ Source");
536 DrawPathEditor("obj", "Select an .obj or backup file", &obj_path_,
537 "OBJ Files", "obj,bak");
538
539 ImGui::BeginDisabled(obj_path_.empty());
540 if (ImGui::Button(ICON_MD_DOWNLOAD " Load OBJ")) {
542 return status_;
543 }
544 ImGui::EndDisabled();
545
546 if (obj_loaded_) {
547 gui::ColoredText("OBJ bytes loaded. Preview integration is not wired yet.",
549 }
550
551 return status_;
552}
553
555 ImGui::SeparatorText("Tilemap Source");
556 DrawPathEditor("tilemap", "Select a tilemap dump", &tilemap_path_,
557 "Tilemap Files", "dat,bin,hex");
558
559 ImGui::BeginDisabled(tilemap_path_.empty());
560 if (ImGui::Button(ICON_MD_DOWNLOAD " Load Tilemap")) {
562 return status_;
563 }
564 ImGui::EndDisabled();
565
566 if (tilemap_loaded_) {
568 "Tilemap bytes loaded for research. Structured preview is pending.",
570 }
571
572 return status_;
573}
574
576 ImGui::SeparatorText("Experimental");
577 ImGui::BeginDisabled(bin_path_.empty());
578 if (gui::ColoredButton(ICON_MD_BUILD " Decode Super Donkey Pack",
581 if (!status_.ok()) {
582 return status_;
583 }
585 return status_;
586 }
587 ImGui::EndDisabled();
589 "Run the prototype sheet decoder against the currently selected BIN "
590 "source.");
591
592 return status_;
593}
594
608
613
615 if (scr_data_.empty()) {
616 return absl::FailedPreconditionError("SCR data is not loaded.");
617 }
618 if (decoded_cgx_.empty()) {
619 return absl::FailedPreconditionError(
620 "Decode a CGX tilesheet before reconstructing the SCR preview.");
621 }
622
623 decoded_scr_data_.assign(0x100 * 0x100, 0);
626
627 scr_bitmap_.Create(0x100, 0x100, 8, decoded_scr_data_);
629 scr_loaded_ = true;
630 return absl::OkStatus();
631}
632
651
656
659 obj_loaded_ = true;
660 return absl::OkStatus();
661}
662
665 auto decomp_sheet = gfx::lc_lz2::DecompressV2(tilemap_rom_.data(), 0, 0x800,
668 if (!decomp_sheet.ok()) {
669 return decomp_sheet.status();
670 }
671 tilemap_loaded_ = true;
672 return absl::OkStatus();
673}
674
676 const char* text = ImGui::GetClipboardText();
677 if (!text || *text == '\0') {
678 return absl::InvalidArgumentError("Clipboard is empty.");
679 }
680
681 const auto clipboard_data = std::vector<uint8_t>(text, text + strlen(text));
683 open_memory_editor_ = true;
684 return absl::OkStatus();
685}
686
690 1, source_rom_.size()));
691
692 auto converted_sheet = gfx::SnesTo8bppSheet(import_data_, 3);
694 converted_sheet);
696 gfx_loaded_ = true;
698
699 return absl::OkStatus();
700}
701
703 int i = 0;
704 for (const auto& offset : kSuperDonkeyTiles) {
705 const int offset_value = std::stoi(offset, nullptr, 16);
706 ASSIGN_OR_RETURN(auto decompressed_data,
708 0x1000, 1, source_rom_.size()));
709 auto converted_sheet = gfx::SnesTo8bppSheet(decompressed_data, 3);
711 gfx::kTilesheetDepth, converted_sheet);
713 ++i;
714 }
715
716 for (const auto& offset : kSuperDonkeySprites) {
717 const int offset_value = std::stoi(offset, nullptr, 16);
718 ASSIGN_OR_RETURN(auto decompressed_data,
720 0x1000, 1, source_rom_.size()));
721 auto converted_sheet = gfx::SnesTo8bppSheet(decompressed_data, 3);
723 gfx::kTilesheetDepth, converted_sheet);
725 ++i;
726 }
727
728 super_donkey_ = true;
730 return absl::OkStatus();
731}
732
736 }
739 }
742 }
743 if (super_donkey_) {
744 for (size_t i = 0; i < num_sheets_to_load_ && i < gfx_sheets_.size(); ++i) {
745 if (gfx_sheets_[i].is_active()) {
747 }
748 }
749 }
750}
751
753 if (UsingExternalPalette()) {
754 if (col_file_palette_group_.size() > 0 &&
757 } else if (col_file_palette_.size() > 0) {
759 } else if (!decoded_col_.empty()) {
760 bitmap.SetPalette(decoded_col_);
761 }
762 } else if (rom_ && rom_->is_loaded() && game_data_) {
764 auto palette_group = game_data_->palette_groups.get_group(
765 kPaletteGroupAddressesKeys[rom_palette_group_index_]);
766 if (palette_group && rom_palette_index_ < palette_group->size()) {
767 bitmap.SetPalette(palette_group->palette(rom_palette_index_));
768 }
769 } else if (col_file_palette_.size() > 0) {
771 }
772
773 QueueTextureRefresh(&bitmap);
774}
775
779
784
788
792
793} // namespace editor
794} // namespace yaze
absl::Status LoadFromFile(const std::string &filename, const LoadOptions &options=LoadOptions::Defaults())
Definition rom.cc:155
auto mutable_data()
Definition rom.h:140
auto data() const
Definition rom.h:139
auto size() const
Definition rom.h:138
absl::Status LoadFromData(const std::vector< uint8_t > &data, const LoadOptions &options=LoadOptions::Defaults())
Definition rom.cc:255
bool is_loaded() const
Definition rom.h:132
void DrawEmptyState(const char *title, const char *detail)
std::array< gfx::Bitmap, zelda3::kNumGfxSheets > gfx_sheets_
bool DrawPathEditor(const char *id, const char *hint, std::string *path, const char *browse_label, const char *browse_spec)
void Draw(bool *p_open) override
Draw the panel content.
void QueueTextureCommand(TextureCommandType type, Bitmap *bitmap)
Definition arena.cc:36
static Arena & Get()
Definition arena.cc:21
Represents a bitmap image optimized for SNES ROM hacking.
Definition bitmap.h:67
void Create(int width, int height, int depth, std::span< uint8_t > data)
Create a bitmap with the given dimensions and data.
Definition bitmap.cc:201
TextureHandle texture() const
Definition bitmap.h:380
bool is_active() const
Definition bitmap.h:384
int height() const
Definition bitmap.h:374
void SetPalette(const SnesPalette &palette)
Set the palette for the bitmap using SNES palette format.
Definition bitmap.cc:384
int width() const
Definition bitmap.h:373
SDL_Surface * surface() const
Definition bitmap.h:379
Represents a palette of colors for the Super Nintendo Entertainment System (SNES).
static std::string ShowOpenFileDialog()
ShowOpenFileDialog opens a file dialog and returns the selected filepath. Uses global feature flag to...
#define ICON_MD_FOLDER_OPEN
Definition icons.h:813
#define ICON_MD_MEMORY
Definition icons.h:1195
#define ICON_MD_SCREEN_SEARCH_DESKTOP
Definition icons.h:1664
#define ICON_MD_TRAVEL_EXPLORE
Definition icons.h:2012
#define ICON_MD_CONTENT_PASTE
Definition icons.h:467
#define ICON_MD_IMAGE_SEARCH
Definition icons.h:985
#define ICON_MD_DOWNLOAD
Definition icons.h:618
#define ICON_MD_PREVIEW
Definition icons.h:1512
#define ICON_MD_BUILD
Definition icons.h:328
#define ICON_MD_PALETTE
Definition icons.h:1370
#define ICON_MD_CONTENT_COPY
Definition icons.h:465
#define ASSIGN_OR_RETURN(type_variable_name, expression)
Definition macro.h:62
const std::string kSuperDonkeySprites[]
const std::string kSuperDonkeyTiles[]
absl::StatusOr< std::vector< uint8_t > > DecompressV2(const uint8_t *data, int offset, int size, int mode, size_t rom_size)
Decompresses a buffer of data using the LC_LZ2 algorithm.
constexpr int kNintendoMode1
Definition compression.h:54
absl::Status LoadScr(std::string_view filename, uint8_t input_value, std::vector< uint8_t > &map_data)
Load Scr file (screen data)
std::vector< SDL_Color > DecodeColFile(const std::string_view filename)
Decode color file.
constexpr int kTilesheetHeight
Definition snes_tile.h:17
constexpr int kTilesheetWidth
Definition snes_tile.h:16
absl::Status LoadCgx(uint8_t bpp, std::string_view filename, std::vector< uint8_t > &cgx_data, std::vector< uint8_t > &cgx_loaded, std::vector< uint8_t > &cgx_header)
Load Cgx file (graphical content)
constexpr const char * kPaletteGroupAddressesKeys[]
absl::Status DrawScrWithCgx(uint8_t bpp, std::vector< uint8_t > &map_bitmap_data, std::vector< uint8_t > &map_data, std::vector< uint8_t > &cgx_loaded)
Draw screen tilemap with graphical data.
constexpr int kTilesheetDepth
Definition snes_tile.h:18
std::vector< uint8_t > SnesTo8bppSheet(std::span< const uint8_t > sheet, int bpp, int num_sheets)
Definition snes_tile.cc:132
absl::StatusOr< PaletteGroup > CreatePaletteGroupFromColFile(std::vector< SnesColor > &palette_rows)
std::vector< SnesColor > GetColFileData(uint8_t *data)
Definition snes_color.cc:89
void BitmapCanvasPipeline(gui::Canvas &canvas, gfx::Bitmap &bitmap, int width, int height, int tile_size, bool is_loaded, bool scrollbar, int canvas_id)
Definition canvas.cc:1751
void ColoredText(const char *text, const ImVec4 &color)
ImVec4 GetSuccessColor()
Definition ui_helpers.cc:48
bool SliderFloatWheel(const char *label, float *v, float v_min, float v_max, const char *format, float wheel_step, ImGuiSliderFlags flags)
Definition input.cc:759
void SectionHeader(const char *icon, const char *label, const ImVec4 &color)
bool ToggleButton(const char *label, bool active, const ImVec2 &size)
bool InputHex(const char *label, uint64_t *data)
Definition input.cc:335
bool ColoredButton(const char *label, ButtonType type, const ImVec2 &size)
ImVec4 GetDisabledColor()
Definition ui_helpers.cc:73
void ColoredTextF(const ImVec4 &color, const char *fmt,...)
ImVec4 GetErrorColor()
Definition ui_helpers.cc:58
void SelectablePalettePipeline(uint64_t &palette_id, bool &refresh_graphics, gfx::SnesPalette &palette)
Definition color.cc:312
ImVec4 GetInfoColor()
Definition ui_helpers.cc:63
void HelpMarker(const char *desc)
void StatusBadge(const char *text, ButtonType type)
ImVec4 GetAccentColor()
Definition ui_helpers.cc:68
#define RETURN_IF_ERROR(expr)
Definition snes.cc:22
PaletteGroup * get_group(const std::string &group_name)
void DrawContents(void *mem_data_void, size_t mem_size, size_t base_display_addr=0x0000)
std::vector< FileDialogFilter > filters
Definition file_util.h:17
gfx::PaletteGroupMap palette_groups
Definition game_data.h:91