diff options
| author | Henny022p <info@henny022.de> | 2021-11-23 05:40:41 +0100 |
|---|---|---|
| committer | Henny022p <info@henny022.de> | 2021-11-23 05:40:41 +0100 |
| commit | bc4a8577f3f139a8d0b420e2decbbb9701d25c4c (patch) | |
| tree | 180a00ab6fb3a51ec6776747610e56e231f4140e /tools/src/asset_processor/assets/exitlist.cpp | |
| parent | 47a3e614a01598cf28f9f484c5405b522fd789fe (diff) | |
moved asset_processor to new location
Diffstat (limited to 'tools/src/asset_processor/assets/exitlist.cpp')
| -rw-r--r-- | tools/src/asset_processor/assets/exitlist.cpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/tools/src/asset_processor/assets/exitlist.cpp b/tools/src/asset_processor/assets/exitlist.cpp new file mode 100644 index 00000000..c4e193c6 --- /dev/null +++ b/tools/src/asset_processor/assets/exitlist.cpp @@ -0,0 +1,48 @@ +#include "exitlist.h" +#include "reader.h" +#include <fstream> +#include <iostream> + +void ExitListAsset::convertToHumanReadable(const std::vector<char>& baserom) { + Reader reader(baserom, this->start, this->size); + std::vector<std::string> lines; + while (reader.cursor < this->size) { + u16 transition_type = reader.read_u16(); + u16 x_pos = reader.read_u16(); + u16 y_pos = reader.read_u16(); + u16 dest_x = reader.read_u16(); + u16 dest_y = reader.read_u16(); + u8 screen_edge = reader.read_u8(); + u8 dest_area = reader.read_u8(); + u8 dest_room = reader.read_u8(); + u8 unknown_2 = reader.read_u8(); + u8 unknown_3 = reader.read_u8(); + u8 unknown_4 = reader.read_u8(); + u16 unknown_5 = reader.read_u16(); + u16 padding_1 = reader.read_u16(); + if (transition_type == 0xffff) { + lines.push_back("\texit_list_end\n"); + break; + } + lines.push_back(string_format("\texit transition=%d", transition_type)); + lines.push_back(opt_param(", x=0x%x", 0, x_pos)); + lines.push_back(opt_param(", y=0x%x", 0, y_pos)); + lines.push_back(opt_param(", destX=0x%x", 0, dest_x)); + lines.push_back(opt_param(", destY=0x%x", 0, dest_y)); + lines.push_back(opt_param(", screenEdge=0x%x", 0, screen_edge)); + lines.push_back(opt_param(", destArea=0x%x", 0, dest_area)); + lines.push_back(opt_param(", destRoom=0x%x", 0, dest_room)); + lines.push_back(opt_param(", unknown=0x%x", 0, unknown_2)); + lines.push_back(opt_param(", unknown2=0x%x", 0, unknown_3)); + lines.push_back(opt_param(", unknown3=0x%x", 0, unknown_4)); + lines.push_back(opt_param(", unknown4=0x%x", 0, unknown_5)); + lines.push_back(opt_param(", padding=0x%x", 0, padding_1)); + lines.push_back("\n"); + } + + std::ofstream out(this->assetPath); + for (const auto& line : lines) { + out << line; + } + out.close(); +}
\ No newline at end of file |
