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#include "util/i18n/tr.h"
3
4#include <algorithm>
5#include <cfloat>
6#include <cstring>
7#include <filesystem>
8#include <string>
9
14#include "app/gui/core/color.h"
15#include "app/gui/core/icons.h"
16#include "app/gui/core/input.h"
17#include "app/gui/core/style.h"
20#include "imgui/imgui.h"
21#include "imgui/misc/cpp/imgui_stdlib.h"
22#include "util/file_util.h"
23#include "util/macro.h"
24
25namespace yaze {
26namespace editor {
27
28namespace {
29
30constexpr uint64_t kDefaultClipboardDecompressSize = 0x40000;
31
32const std::string kSuperDonkeyTiles[] = {
33 "97C05", "98219", "9871E", "98C00", "99084", "995AF", "99DE0", "9A27E",
34 "9A741", "9AC31", "9B07E", "9B55C", "9B963", "9BB99", "9C009", "9C4B4",
35 "9C92B", "9CDD6", "9D2C2", "9E037", "9E527", "9EA56", "9EF65", "9FCD1",
36 "A0193", "A059E", "A0B17", "A0FB6", "A14A5", "A1988", "A1E66", "A232B",
37 "A27F0", "A2B6E", "A302C", "A3453", "A38CA", "A42BB", "A470C", "A4BA9",
38 "A5089", "A5385", "A5742", "A5BCC", "A6017", "A6361", "A66F8"};
39
40const std::string kSuperDonkeySprites[] = {
41 "A8E5D", "A9435", "A9934", "A9D83", "AA2F1", "AA6D4", "AABE4", "AB127",
42 "AB65A", "ABBDD", "AC38D", "AC797", "ACCC8", "AD0AE", "AD245", "AD554",
43 "ADAAC", "ADECC", "AE453", "AE9D2", "AEF40", "AF3C9", "AF92E", "AFE9D",
44 "B03D2", "B09AC", "B0F0C", "B1430", "B1859", "B1E01", "B229A", "B2854",
45 "B2D27", "B31D7", "B3B58", "B40B5", "B45A5", "B4D64", "B5031", "B555F",
46 "B5F30", "B6858", "B70DD", "B7526", "B79EC", "B7C83", "B80F7", "B85CC",
47 "B8A3F", "B8F97", "B94F2", "B9A20", "B9E9A", "BA3A2", "BA8F6", "BACDC",
48 "BB1F9", "BB781", "BBCCA", "BC26D", "BC7D4", "BCBB0", "BD082", "BD5FC",
49 "BE115", "BE5C2", "BEB63", "BF0CB", "BF607", "BFA55", "BFD71", "C017D",
50 "C0567", "C0981", "C0BA7", "C116D", "C166A", "C1FE0", "C24CE", "C2B19"};
51
52std::string NormalizeSelectedPath(const std::string& path) {
53 if (path.empty()) {
54 return path;
55 }
56 return std::filesystem::absolute(path).string();
57}
58
60 if (!bitmap || !bitmap->is_active() || !bitmap->surface()) {
61 return;
62 }
63
67 bitmap);
68}
69
70} // namespace
71
77
78void PrototypeResearchView::Draw(bool* p_open) {
79 Update().IgnoreError();
80}
81
85
86 constexpr ImGuiTableFlags kWorkspaceFlags =
87 ImGuiTableFlags_Resizable | ImGuiTableFlags_SizingStretchProp |
88 ImGuiTableFlags_NoSavedSettings;
89
90 if (ImGui::BeginTable("##PrototypeWorkspace", 2, kWorkspaceFlags)) {
91 ImGui::TableSetupColumn("Inspector", ImGuiTableColumnFlags_WidthFixed,
92 420.0f);
93 ImGui::TableSetupColumn("Preview", ImGuiTableColumnFlags_WidthStretch,
94 0.0f);
95 ImGui::TableNextColumn();
97 ImGui::TableNextColumn();
99 ImGui::EndTable();
100 }
101
102 return status_;
103}
104
106 gui::SectionHeader(ICON_MD_TRAVEL_EXPLORE, "Prototype Research",
108 ImGui::TextWrapped(tr(
109 "Decode CGX, SCR, COL, and raw prototype data directly inside the "
110 "graphics workspace so research assets can be compared without leaving "
111 "the editor."));
113 "SCR files are SNES tilemaps. Pair them with matching CGX and COL data "
114 "to reconstruct early HUDs, menus, and screen layouts.",
117
118 if (!status_.ok()) {
119 gui::ColoredTextF(gui::GetErrorColor(), "%s", status_.message().data());
120 } else if (!HasGraphicsPreview() && !HasScreenPreview() &&
123 "Load a CGX, BIN, or Super Donkey source to start previewing.",
125 }
126}
127
129 if (!cgx_loaded_ && !scr_loaded_ && !col_file_ && !gfx_loaded_ &&
131 gui::StatusBadge("No assets loaded", gui::ButtonType::Info);
132 return;
133 }
134
135 bool first = true;
136 auto draw_badge = [&](const char* label, gui::ButtonType type) {
137 if (!first) {
138 ImGui::SameLine();
139 }
140 gui::StatusBadge(label, type);
141 first = false;
142 };
143
144 if (cgx_loaded_) {
145 draw_badge("CGX", gui::ButtonType::Success);
146 }
147 if (scr_loaded_) {
148 draw_badge("SCR", gui::ButtonType::Success);
149 }
150 if (col_file_) {
151 draw_badge(UsingExternalPalette() ? "COL Palette" : "COL Loaded",
154 }
155 if (gfx_loaded_) {
156 draw_badge("BIN Preview", gui::ButtonType::Success);
157 }
158 if (super_donkey_) {
159 draw_badge("Super Donkey", gui::ButtonType::Warning);
160 }
161 if (obj_loaded_) {
162 draw_badge("OBJ Bytes", gui::ButtonType::Default);
163 }
164 if (tilemap_loaded_) {
165 draw_badge("Tilemap Bytes", gui::ButtonType::Default);
166 }
167}
168
170 ImGui::BeginChild("##PrototypeInspector", ImVec2(0, 0), false,
171 ImGuiWindowFlags_AlwaysVerticalScrollbar);
172
173 auto sync_status = [this](const absl::Status& section_status) {
174 status_ = section_status;
175 };
176
177 if (ImGui::CollapsingHeader(ICON_MD_IMAGE_SEARCH " Graphics Sources",
178 ImGuiTreeNodeFlags_DefaultOpen)) {
179 sync_status(DrawCgxImportSection());
180 sync_status(DrawScrImportSection());
181 sync_status(DrawBinImportSection());
182 }
183
184 if (ImGui::CollapsingHeader(ICON_MD_PALETTE " Preview Palette",
185 ImGuiTreeNodeFlags_DefaultOpen)) {
186 sync_status(DrawPaletteSection());
187 }
188
189 if (ImGui::CollapsingHeader(ICON_MD_BUILD " Advanced Inputs",
190 ImGuiTreeNodeFlags_DefaultOpen)) {
191 sync_status(DrawClipboardSection());
192 sync_status(DrawObjImportSection());
193 sync_status(DrawTilemapImportSection());
194 sync_status(DrawExperimentalSection());
195 }
196
197 ImGui::EndChild();
198}
199
201 ImGui::BeginChild("##PrototypePreview", ImVec2(0, 0), false,
202 ImGuiWindowFlags_AlwaysVerticalScrollbar);
204
205 if (ImGui::BeginTabBar("##PrototypePreviewTabs")) {
206 if (ImGui::BeginTabItem(tr("Graphics"))) {
208 ImGui::EndTabItem();
209 }
210 if (ImGui::BeginTabItem(tr("Screen"))) {
212 ImGui::EndTabItem();
213 }
214 if (ImGui::BeginTabItem(tr("Super Donkey"))) {
216 ImGui::EndTabItem();
217 }
218 ImGui::EndTabBar();
219 }
220
221 ImGui::EndChild();
222}
223
225 if (!HasGraphicsPreview()) {
226 DrawEmptyState("No graphics preview available",
227 "Load a CGX tilesheet or decode a BIN source.");
228 return;
229 }
230
231 const bool has_cgx_preview = cgx_loaded_ && cgx_bitmap_.is_active();
232 const bool has_bin_preview = gfx_loaded_ && bin_bitmap_.is_active();
233
234 if (has_cgx_preview && has_bin_preview) {
237 }
238 ImGui::SameLine();
241 }
242 ImGui::SameLine();
244 "Switch between the direct CGX decode and the generic BIN preview.");
245 } else {
246 active_graphics_preview_ = has_bin_preview ? 1 : 0;
247 }
248
249 gfx::Bitmap* active_bitmap =
251 const char* preview_label =
252 active_graphics_preview_ == 1 ? "BIN Decode" : "CGX Tilesheet";
253
254 gui::ColoredTextF(gui::GetInfoColor(), "%s %dx%d", preview_label,
255 active_bitmap->width(), active_bitmap->height());
257 active_bitmap->width(), active_bitmap->height(),
258 0x20, true, true, active_graphics_preview_ + 1);
259}
260
262 if (!HasScreenPreview()) {
264 "No screen preview available",
265 "Load SCR data after CGX to reconstruct a prototype screen.");
266 return;
267 }
268
269 gui::ColoredTextF(gui::GetInfoColor(), "SCR Composite %dx%d",
272 scr_bitmap_.height(), 0x20, true, true, 99);
273}
274
277 DrawEmptyState("Super Donkey sheets not decoded",
278 "Use the experimental decoder after loading the prototype "
279 "BIN source.");
280 return;
281 }
282
283 ImGui::SetNextItemWidth(120.0f);
284 gui::SliderFloatWheel("Scale", &prototype_sheet_scale_, 1.0f, 4.0f, "%.1fx");
285 ImGui::SameLine();
286 ImGui::SetNextItemWidth(120.0f);
287 ImGui::SliderInt(tr("Columns"), &prototype_sheet_columns_, 1, 6);
288
289 const float tile_width = 128.0f * prototype_sheet_scale_;
290 const float tile_height = 32.0f * prototype_sheet_scale_;
291 int current_column = 0;
292
293 ImGui::BeginChild("##SuperDonkeySheets", ImVec2(0, 0), true,
294 ImGuiWindowFlags_AlwaysVerticalScrollbar);
295 for (size_t i = 0; i < num_sheets_to_load_ && i < gfx_sheets_.size(); ++i) {
296 auto& bitmap = gfx_sheets_[i];
297 if (!bitmap.is_active() || !bitmap.texture()) {
298 continue;
299 }
300
301 ImGui::BeginGroup();
302 ImGui::Image((ImTextureID)(intptr_t)bitmap.texture(),
303 ImVec2(tile_width, tile_height));
304 ImGui::Text(tr("Sheet %02zu"), i);
305 ImGui::EndGroup();
306
307 current_column++;
308 if (current_column < prototype_sheet_columns_) {
309 ImGui::SameLine();
310 } else {
311 current_column = 0;
312 }
313 }
314 ImGui::EndChild();
315}
316
318 const char* detail) {
320 ImGui::Spacing();
321 ImGui::TextWrapped("%s", detail);
322}
323
326 return;
327 }
328
329 ImGui::SetNextWindowSize(ImVec2(900.0f, 540.0f), ImGuiCond_FirstUseEver);
330 ImGui::SetNextWindowSizeConstraints(ImVec2(720.0f, 420.0f),
331 ImVec2(1600.0f, FLT_MAX));
332 if (!ImGui::Begin(ICON_MD_MEMORY " Prototype Memory Inspector",
333 &open_memory_editor_, ImGuiWindowFlags_NoScrollbar)) {
334 ImGui::End();
335 return;
336 }
337
338 static gui::MemoryEditorWidget memory_editor;
340 ImGui::End();
341}
342
343bool PrototypeResearchView::DrawPathEditor(const char* id, const char* hint,
344 std::string* path,
345 const char* browse_label,
346 const char* browse_spec) {
347 bool changed = false;
349 options.filters.push_back({browse_label, browse_spec});
350 options.filters.push_back({"All Files", "*"});
351
352 ImGui::PushID(id);
353 ImGui::SetNextItemWidth(-68.0f);
354 changed = ImGui::InputTextWithHint("##Path", hint, path);
355 ImGui::SameLine();
356 if (ImGui::Button(ICON_MD_FOLDER_OPEN "##BrowsePath")) {
357 const auto selected = util::FileDialogWrapper::ShowOpenFileDialog(options);
358 if (!selected.empty()) {
359 *path = NormalizeSelectedPath(selected);
360 changed = true;
361 }
362 }
363 if (ImGui::IsItemHovered()) {
364 ImGui::SetTooltip(tr("Browse"));
365 }
366 ImGui::SameLine();
367 ImGui::BeginDisabled(path->empty());
368 if (ImGui::Button(ICON_MD_CONTENT_COPY "##CopyPath")) {
369 ImGui::SetClipboardText(path->c_str());
370 }
371 if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) {
372 ImGui::SetTooltip(tr("Copy path"));
373 }
374 ImGui::EndDisabled();
375 ImGui::PopID();
376 return changed;
377}
378
380 ImGui::SeparatorText(tr("CGX Tilesheet"));
381 DrawPathEditor("cgx", "Select a .cgx or prototype graphics blob", &cgx_path_,
382 "CGX Files", "cgx,bin");
383
384 ImGui::SetNextItemWidth(120.0f);
385 if (ImGui::InputInt(tr("Bits Per Pixel"), &current_bpp_)) {
386 current_bpp_ = std::clamp(current_bpp_, 1, 8);
387 }
388 ImGui::SameLine();
389 ImGui::BeginDisabled(cgx_path_.empty());
392 return status_;
393 }
394 ImGui::EndDisabled();
395
396 return status_;
397}
398
400 ImGui::SeparatorText(tr("SCR Screen"));
401 DrawPathEditor("scr", "Select a .scr or prototype screen blob", &scr_path_,
402 "SCR Files", "scr,pnl,bin,bak");
403
404 ImGui::SetNextItemWidth(120.0f);
405 ImGui::InputInt(tr("SCR Mod"), &scr_mod_value_);
406 ImGui::SameLine();
407 ImGui::BeginDisabled(scr_path_.empty() || decoded_cgx_.empty());
411 return status_;
412 }
413 ImGui::EndDisabled();
414 if (decoded_cgx_.empty()) {
416 "SCR preview depends on an already decoded CGX tilesheet. Use this "
417 "to reconstruct prototype HUDs and menus from raw SNES tilemaps.");
418 }
419
420 return status_;
421}
422
424 ImGui::SeparatorText(tr("Palette Source"));
425
426 DrawPathEditor("col", "Select a .col or backup palette", &col_path_,
427 "COL Files", "col,bak,bin");
428
429 ImGui::BeginDisabled(col_path_.empty());
432 return status_;
433 }
434 ImGui::EndDisabled();
435
436 if (col_file_) {
437 if (ImGui::Checkbox(tr("Prefer external COL palette"),
440 }
441 } else {
442 bool disabled_toggle = false;
443 ImGui::BeginDisabled();
444 ImGui::Checkbox(tr("Prefer external COL palette"), &disabled_toggle);
445 ImGui::EndDisabled();
446 }
447
448 if (UsingExternalPalette()) {
449 bool refresh_palette = false;
450 gui::ColoredText("Using COL palette rows for preview",
454 if (refresh_palette) {
456 }
457 } else if (rom_ && rom_->is_loaded() && game_data_) {
459
460 ImGui::SetNextItemWidth(220.0f);
461 bool palette_changed = ImGui::Combo(
462 tr("ROM Group"), &rom_palette_group_index_, kPaletteGroupAddressesKeys,
463 IM_ARRAYSIZE(kPaletteGroupAddressesKeys));
464
465 int palette_index = static_cast<int>(rom_palette_index_);
466 ImGui::SetNextItemWidth(120.0f);
467 if (ImGui::InputInt(tr("ROM Palette"), &palette_index)) {
468 rom_palette_index_ = static_cast<uint64_t>(std::max(0, palette_index));
469 palette_changed = true;
470 }
471
472 if (palette_changed) {
474 }
475 } else {
477 "Load a ROM or a COL file to apply palette data to prototype previews.",
479 }
480
481 return status_;
482}
483
485 ImGui::SeparatorText(tr("Raw BIN / ROM Decompression"));
486 DrawPathEditor("bin", "Select a .bin, .hex, or ROM source", &bin_path_,
487 "Binary Sources", "bin,hex,sfc,smc");
488
489 gui::InputHex("BIN Offset", &current_offset_);
490 gui::InputHex("BIN Size", &bin_size_);
491
492 ImGui::BeginDisabled(bin_path_.empty());
496 return status_;
497 }
498 ImGui::EndDisabled();
499
500 return status_;
501}
502
504 ImGui::SeparatorText(tr("Clipboard Source"));
505
506 if (ImGui::Button(ICON_MD_CONTENT_PASTE " Paste Raw Bytes")) {
508 return status_;
509 }
510 ImGui::SameLine();
511 ImGui::BeginDisabled(!source_rom_.is_loaded());
512 if (ImGui::Button(ICON_MD_MEMORY " Inspect")) {
513 open_memory_editor_ = true;
514 }
515 ImGui::EndDisabled();
516
517 gui::InputHex("Clipboard Offset", &clipboard_offset_);
518 gui::InputHex("Clipboard Size", &clipboard_size_);
519
520 ImGui::BeginDisabled(!source_rom_.is_loaded());
521 if (gui::ColoredButton(ICON_MD_PREVIEW " Decode Clipboard",
524 const int decode_size =
525 static_cast<int>(clipboard_size_ == 0 ? kDefaultClipboardDecompressSize
527 status_ = DecompressImportData(decode_size);
528 return status_;
529 }
530 ImGui::EndDisabled();
531
532 return status_;
533}
534
536 ImGui::SeparatorText(tr("OBJ Source"));
537 DrawPathEditor("obj", "Select an .obj or backup file", &obj_path_,
538 "OBJ Files", "obj,bak");
539
540 ImGui::BeginDisabled(obj_path_.empty());
541 if (ImGui::Button(ICON_MD_DOWNLOAD " Load OBJ")) {
543 return status_;
544 }
545 ImGui::EndDisabled();
546
547 if (obj_loaded_) {
548 gui::ColoredText("OBJ bytes loaded. Preview integration is not wired yet.",
550 }
551
552 return status_;
553}
554
556 ImGui::SeparatorText(tr("Tilemap Source"));
557 DrawPathEditor("tilemap", "Select a tilemap dump", &tilemap_path_,
558 "Tilemap Files", "dat,bin,hex");
559
560 ImGui::BeginDisabled(tilemap_path_.empty());
561 if (ImGui::Button(ICON_MD_DOWNLOAD " Load Tilemap")) {
563 return status_;
564 }
565 ImGui::EndDisabled();
566
567 if (tilemap_loaded_) {
569 "Tilemap bytes loaded for research. Structured preview is pending.",
571 }
572
573 return status_;
574}
575
577 ImGui::SeparatorText(tr("Experimental"));
578 ImGui::BeginDisabled(bin_path_.empty());
579 if (gui::ColoredButton(ICON_MD_BUILD " Decode Super Donkey Pack",
582 if (!status_.ok()) {
583 return status_;
584 }
586 return status_;
587 }
588 ImGui::EndDisabled();
590 "Run the prototype sheet decoder against the currently selected BIN "
591 "source.");
592
593 return status_;
594}
595
609
614
616 if (scr_data_.empty()) {
617 return absl::FailedPreconditionError("SCR data is not loaded.");
618 }
619 if (decoded_cgx_.empty()) {
620 return absl::FailedPreconditionError(
621 "Decode a CGX tilesheet before reconstructing the SCR preview.");
622 }
623
624 decoded_scr_data_.assign(0x100 * 0x100, 0);
627
628 scr_bitmap_.Create(0x100, 0x100, 8, decoded_scr_data_);
630 scr_loaded_ = true;
631 return absl::OkStatus();
632}
633
652
657
660 obj_loaded_ = true;
661 return absl::OkStatus();
662}
663
666 auto decomp_sheet = gfx::lc_lz2::DecompressV2(tilemap_rom_.data(), 0, 0x800,
669 if (!decomp_sheet.ok()) {
670 return decomp_sheet.status();
671 }
672 tilemap_loaded_ = true;
673 return absl::OkStatus();
674}
675
677 const char* text = ImGui::GetClipboardText();
678 if (!text || *text == '\0') {
679 return absl::InvalidArgumentError("Clipboard is empty.");
680 }
681
682 const auto clipboard_data = std::vector<uint8_t>(text, text + strlen(text));
684 open_memory_editor_ = true;
685 return absl::OkStatus();
686}
687
691 1, source_rom_.size()));
692
693 auto converted_sheet = gfx::SnesTo8bppSheet(import_data_, 3);
695 converted_sheet);
697 gfx_loaded_ = true;
699
700 return absl::OkStatus();
701}
702
704 int i = 0;
705 for (const auto& offset : kSuperDonkeyTiles) {
706 const int offset_value = std::stoi(offset, nullptr, 16);
707 ASSIGN_OR_RETURN(auto decompressed_data,
709 0x1000, 1, source_rom_.size()));
710 auto converted_sheet = gfx::SnesTo8bppSheet(decompressed_data, 3);
712 gfx::kTilesheetDepth, converted_sheet);
714 ++i;
715 }
716
717 for (const auto& offset : kSuperDonkeySprites) {
718 const int offset_value = std::stoi(offset, nullptr, 16);
719 ASSIGN_OR_RETURN(auto decompressed_data,
721 0x1000, 1, source_rom_.size()));
722 auto converted_sheet = gfx::SnesTo8bppSheet(decompressed_data, 3);
724 gfx::kTilesheetDepth, converted_sheet);
726 ++i;
727 }
728
729 super_donkey_ = true;
731 return absl::OkStatus();
732}
733
737 }
740 }
743 }
744 if (super_donkey_) {
745 for (size_t i = 0; i < num_sheets_to_load_ && i < gfx_sheets_.size(); ++i) {
746 if (gfx_sheets_[i].is_active()) {
748 }
749 }
750 }
751}
752
754 if (UsingExternalPalette()) {
755 if (col_file_palette_group_.size() > 0 &&
758 } else if (col_file_palette_.size() > 0) {
760 } else if (!decoded_col_.empty()) {
761 bitmap.SetPalette(decoded_col_);
762 }
763 } else if (rom_ && rom_->is_loaded() && game_data_) {
765 auto palette_group = game_data_->palette_groups.get_group(
766 kPaletteGroupAddressesKeys[rom_palette_group_index_]);
767 if (palette_group && rom_palette_index_ < palette_group->size()) {
768 bitmap.SetPalette(palette_group->palette(rom_palette_index_));
769 }
770 } else if (col_file_palette_.size() > 0) {
772 }
773
774 QueueTextureRefresh(&bitmap);
775}
776
780
785
789
793
794} // namespace editor
795} // namespace yaze
absl::Status LoadFromFile(const std::string &filename, const LoadOptions &options=LoadOptions::Defaults())
Definition rom.cc:227
auto mutable_data()
Definition rom.h:152
auto data() const
Definition rom.h:151
auto size() const
Definition rom.h:150
absl::Status LoadFromData(const std::vector< uint8_t > &data, const LoadOptions &options=LoadOptions::Defaults())
Definition rom.cc:335
bool is_loaded() const
Definition rom.h:144
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:401
bool is_active() const
Definition bitmap.h:405
int height() const
Definition bitmap.h:395
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:394
SDL_Surface * surface() const
Definition bitmap.h:400
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 ColoredText(const char *text, const ImVec4 &color)
ImVec4 GetSuccessColor()
Definition ui_helpers.cc:49
bool SliderFloatWheel(const char *label, float *v, float v_min, float v_max, const char *format, float wheel_step, ImGuiSliderFlags flags)
Definition input.cc:746
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:336
bool ColoredButton(const char *label, ButtonType type, const ImVec2 &size)
ImVec4 GetDisabledColor()
Definition ui_helpers.cc:74
void ColoredTextF(const ImVec4 &color, const char *fmt,...)
ImVec4 GetErrorColor()
Definition ui_helpers.cc:59
void SelectablePalettePipeline(uint64_t &palette_id, bool &refresh_graphics, gfx::SnesPalette &palette)
Definition color.cc:314
void BitmapCanvasPipeline(Canvas &canvas, gfx::Bitmap &bitmap, int width, int height, int tile_size, bool is_loaded, bool scrollbar, int canvas_id)
ImVec4 GetInfoColor()
Definition ui_helpers.cc:64
void HelpMarker(const char *desc)
void StatusBadge(const char *text, ButtonType type)
ImVec4 GetAccentColor()
Definition ui_helpers.cc:69
#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:92