diff options
| author | GaryOderNichts <12049776+GaryOderNichts@users.noreply.github.com> | 2024-06-19 23:15:00 +0200 |
|---|---|---|
| committer | Eblo <7004497+Eblo@users.noreply.github.com> | 2026-06-25 10:14:51 -0400 |
| commit | 121482348dcfa773cd778e7673b9404a1045d7b5 (patch) | |
| tree | b2da6634b23e3b9f4aab2d83f5d3d2080997e9c6 | |
| parent | ea1427fe88bd3bc0363ee693de867daba9059f41 (diff) | |
wiiu: Endianness fixes
| -rw-r--r-- | mm/2s2h/resource/importer/CutsceneFactory.cpp | 3 | ||||
| -rw-r--r-- | mm/include/color.h | 1 | ||||
| -rw-r--r-- | mm/include/command_macros_base.h | 2 |
3 files changed, 6 insertions, 0 deletions
diff --git a/mm/2s2h/resource/importer/CutsceneFactory.cpp b/mm/2s2h/resource/importer/CutsceneFactory.cpp index 59035ee55..ce75d5972 100644 --- a/mm/2s2h/resource/importer/CutsceneFactory.cpp +++ b/mm/2s2h/resource/importer/CutsceneFactory.cpp @@ -113,6 +113,9 @@ ResourceFactoryBinaryCutsceneV0::ReadResource(std::shared_ptr<Ship::File> file, uint32_t header1 = read_CMD_HH(reader); uint32_t numEntries = header1 & 0xFFFF; + if (reader->GetEndianness() != Ship::Endianness::Native) { + numEntries = header1 >> 16 & 0xFFFF; + } cutscene->commands.push_back(header1); if (numEntries == 0xFFFF) { diff --git a/mm/include/color.h b/mm/include/color.h index 72afeac63..5f15c23c9 100644 --- a/mm/include/color.h +++ b/mm/include/color.h @@ -1,6 +1,7 @@ #ifndef _COLOR_H_ #define _COLOR_H_ +#include <endianness.h> #include "PR/ultratypes.h" #include <libultraship/color.h> // For checking the alpha bit in an RGBA16 pixel diff --git a/mm/include/command_macros_base.h b/mm/include/command_macros_base.h index 22603821f..790af9a1c 100644 --- a/mm/include/command_macros_base.h +++ b/mm/include/command_macros_base.h @@ -1,6 +1,8 @@ #ifndef _COMMAND_MACROS_BASE_H_ #define _COMMAND_MACROS_BASE_H_ +#include <endianness.h> + /** * Command Base macros intended for use in designing of more specific command macros * Each macro packs bytes (B), halfwords (H) and words (W, for consistency) into a single word |
