Add support for JP rom and headered ROMs
This commit is contained in:
@@ -16,6 +16,8 @@
|
||||
#include "app/gfx/snes_tile.h"
|
||||
#include "app/gui/canvas.h"
|
||||
#include "app/gui/icons.h"
|
||||
#include "app/gui/input.h"
|
||||
#include "app/gui/style.h"
|
||||
#include "app/rom.h"
|
||||
#include "app/zelda3/overworld.h"
|
||||
|
||||
@@ -75,9 +77,16 @@ absl::Status OverworldEditor::DrawToolset() {
|
||||
TEXT_COLUMN(ICON_MD_MORE_VERT) // Separator
|
||||
ImGui::TableNextColumn(); // Palette
|
||||
palette_editor_.DisplayPalette(palette_, overworld_.isLoaded());
|
||||
TEXT_COLUMN(ICON_MD_MORE_VERT) // Separator
|
||||
ImGui::TableNextColumn(); // Experimental
|
||||
ImGui::Checkbox("Experimental", &show_experimental);
|
||||
|
||||
ImGui::EndTable();
|
||||
}
|
||||
|
||||
if (show_experimental) {
|
||||
RETURN_IF_ERROR(DrawExperimentalModal())
|
||||
}
|
||||
return absl::OkStatus();
|
||||
}
|
||||
|
||||
@@ -364,6 +373,50 @@ absl::Status OverworldEditor::LoadSpriteGraphics() {
|
||||
return absl::OkStatus();
|
||||
}
|
||||
|
||||
absl::Status OverworldEditor::DrawExperimentalModal() {
|
||||
ImGui::Begin("Experimental", &show_experimental);
|
||||
|
||||
gui::TextWithSeparators("PROTOTYPE OVERWORLD TILEMAP LOADER");
|
||||
ImGui::Text("Please provide two files:");
|
||||
ImGui::Text("One based on MAPn.DAT, which represents the overworld tilemap");
|
||||
ImGui::Text("One based on MAPDATn.DAT, which is the tile32 configurations.");
|
||||
ImGui::Text("Currently, loading CGX for this component is NOT supported. ");
|
||||
ImGui::Text("Please load a US ROM of LTTP (JP ROM support coming soon).");
|
||||
ImGui::Text(
|
||||
"Once you've loaded the files, you can click the button below to load "
|
||||
"the tilemap into the editor");
|
||||
|
||||
ImGui::InputText("##TilemapFile", &ow_tilemap_filename_);
|
||||
ImGui::SameLine();
|
||||
core::FileDialogPipeline(
|
||||
"ImportTilemapsKey", ".CGX,.cgx\0", "Tilemap Hex File", [this]() {
|
||||
ow_tilemap_filename_ = ImGuiFileDialog::Instance()->GetFilePathName();
|
||||
});
|
||||
|
||||
ImGui::InputText("##Tile32ConfigurationFile",
|
||||
&tile32_configuration_filename_);
|
||||
ImGui::SameLine();
|
||||
core::FileDialogPipeline("ImportTile32Key", ".CGX,.cgx\0", "Tile32 Hex File",
|
||||
[this]() {
|
||||
tile32_configuration_filename_ =
|
||||
ImGuiFileDialog::Instance()->GetFilePathName();
|
||||
});
|
||||
|
||||
ImGui::Button("Load Prototype Overworld with ROM graphics");
|
||||
|
||||
gui::TextWithSeparators("Configuration");
|
||||
|
||||
gui::InputHexShort("Tilemap File Offset (High)", &tilemap_file_offset_high_);
|
||||
gui::InputHexShort("Tilemap File Offset (Low)", &tilemap_file_offset_low_);
|
||||
|
||||
gui::InputHexShort("LW Maps to Load", &light_maps_to_load_);
|
||||
gui::InputHexShort("DW Maps to Load", &dark_maps_to_load_);
|
||||
gui::InputHexShort("SP Maps to Load", &sp_maps_to_load_);
|
||||
|
||||
ImGui::End();
|
||||
return absl::OkStatus();
|
||||
}
|
||||
|
||||
} // namespace editor
|
||||
} // namespace app
|
||||
} // namespace yaze
|
||||
@@ -33,10 +33,10 @@ static constexpr uint kTile8DisplayHeight = 64;
|
||||
static constexpr float kInputFieldSize = 30.f;
|
||||
|
||||
static constexpr absl::string_view kToolsetColumnNames[] = {
|
||||
"#undoTool", "#redoTool", "#drawTool", "#separator2",
|
||||
"#zoomOutTool", "#zoomInTool", "#separator", "#history",
|
||||
"#entranceTool", "#exitTool", "#itemTool", "#spriteTool",
|
||||
"#transportTool", "#musicTool"};
|
||||
"#undoTool", "#redoTool", "#drawTool", "#separator2",
|
||||
"#zoomOutTool", "#zoomInTool", "#separator", "#history",
|
||||
"#entranceTool", "#exitTool", "#itemTool", "#spriteTool",
|
||||
"#transportTool", "#musicTool", "#separator3", "#tilemapTool"};
|
||||
|
||||
static constexpr absl::string_view kOverworldSettingsColumnNames[] = {
|
||||
"##1stCol", "##gfxCol", "##palCol", "##sprgfxCol",
|
||||
@@ -78,6 +78,8 @@ class OverworldEditor : public Editor, public SharedROM {
|
||||
absl::Status LoadGraphics();
|
||||
absl::Status LoadSpriteGraphics();
|
||||
|
||||
absl::Status DrawExperimentalModal();
|
||||
|
||||
int current_world_ = 0;
|
||||
int current_map_ = 0;
|
||||
int current_tile16_ = 0;
|
||||
@@ -90,12 +92,22 @@ class OverworldEditor : public Editor, public SharedROM {
|
||||
char message_id_[5] = "";
|
||||
char staticgfx[16];
|
||||
|
||||
uint32_t tilemap_file_offset_high_ = 0;
|
||||
uint32_t tilemap_file_offset_low_ = 0;
|
||||
uint32_t light_maps_to_load_ = 0x51;
|
||||
uint32_t dark_maps_to_load_ = 0x2A;
|
||||
uint32_t sp_maps_to_load_ = 0x07;
|
||||
|
||||
bool opt_enable_grid = true;
|
||||
bool all_gfx_loaded_ = false;
|
||||
bool map_blockset_loaded_ = false;
|
||||
bool selected_tile_loaded_ = false;
|
||||
bool update_selected_tile_ = true;
|
||||
|
||||
bool show_experimental = false;
|
||||
std::string ow_tilemap_filename_ = "";
|
||||
std::string tile32_configuration_filename_ = "";
|
||||
|
||||
Bytes selected_tile_data_;
|
||||
std::vector<Bytes> tile16_individual_data_;
|
||||
std::vector<gfx::Bitmap> tile16_individual_;
|
||||
|
||||
Reference in New Issue
Block a user