From eaddecd0b402c12a780831e3139d7a35e78322e6 Mon Sep 17 00:00:00 2001 From: Lywx Date: Wed, 15 Nov 2023 15:11:15 -0600 Subject: Torch v0.1 (#12) * Splitted version yamls and implemented wip geo and dlist extraction * Fixed linux compilation * Added PoC WSL 2 detection * Add undefined behaviour * Added gfxdis as submodule * update * Removed gfxdis as a submodule * Code works * Replace ByteSwap with BSWAP * Cleanup vertice factory * readability * readability 2 * Cleanup gfxfactory * last one * Rename name to symbol * More implementation * Implemented first PoC of C file generation * Added output formatting on factories * changes * Moved generated dlists onto their respective folder * Migrated more factories onto the new extractor system * Fully ported all factories and added header generation * Some updates * Added Lights factory * fix * Fixed vtx extraction * Lights work now * delete old startup_logo yaml * Generate all sections in single file * Added support to generate header and code for textures * Added O3 for release builds * Added WIP dlist extraction and moved to use f3dold microcode * Added segment support, autogeneration and fixed C generation * Added symbol names on display list extraction * Removed warnings * Moved back to transform and replace * Removed unnecesary macros * Added extraction order and reversed vtx order * Implemented true backwards sort * [WIP] Implemented runtime gbi, more headers and a few config features * Fix CLI11 on WSL and variety of fixes * Fixes * Update DisplayListFactory.h * Update TextureFactory.cpp * wip lights * fix * Correct callback * Added waypoints * Update ceremony_data.yml * Changes * Update TextureFactory.cpp * Update commandline args * Update comment * Remove printf * Update couple commands * Renamed cubeos to torch * Removed unused stuff and added an example config file --------- Co-authored-by: KiritoDv Co-authored-by: MegaMech --- src/utils/MIODecoder.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/utils/MIODecoder.cpp') diff --git a/src/utils/MIODecoder.cpp b/src/utils/MIODecoder.cpp index 0a1698e..7574e55 100644 --- a/src/utils/MIODecoder.cpp +++ b/src/utils/MIODecoder.cpp @@ -1,14 +1,13 @@ #include "MIODecoder.h" +#include extern "C" { #include } -#include -#include -std::unordered_map> MIO0Decoder::gCachedChunks; +std::unordered_map> MIO0Decoder::gCachedChunks; -std::vector& MIO0Decoder::Decode(std::vector& buffer, uint32_t offset) { +std::vector& MIO0Decoder::Decode(std::vector& buffer, uint32_t offset) { const unsigned char* in_buf = buffer.data() + offset; mio0_header_t head; @@ -16,9 +15,9 @@ std::vector& MIO0Decoder::Decode(std::vector& buffer, uint32_t of throw std::runtime_error("Failed to decode MIO0 header"); } - uint8_t* decompressed = new uint8_t[head.dest_size]; + auto decompressed = new uint8_t[head.dest_size]; mio0_decode(in_buf, decompressed, nullptr); - gCachedChunks[offset] = std::vector(decompressed, decompressed + head.dest_size); + gCachedChunks[offset] = std::vector(decompressed, decompressed + head.dest_size); delete[] decompressed; return gCachedChunks[offset]; -- cgit v1.2.3