From ab20588a88535c71ea28e91d8eaa9e3cf7e7e16e Mon Sep 17 00:00:00 2001 From: Sonic Dreamcaster Date: Wed, 29 Jan 2025 16:46:33 -0300 Subject: [PATCH] fix endianess issue --- include/sf64audio_provisional.h | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/include/sf64audio_provisional.h b/include/sf64audio_provisional.h index 0629b588..a7c90fe3 100644 --- a/include/sf64audio_provisional.h +++ b/include/sf64audio_provisional.h @@ -398,12 +398,12 @@ typedef struct { } AdsrState; // size = 0x24 typedef struct { - /* 0x00 */ u8 stereoHeadsetEffects : 1; - /* 0x00 */ u8 usesHeadsetPanEffects : 1; - /* 0x00 */ u8 unused : 2; - /* 0x00 */ u8 bit2 : 2; - /* 0x00 */ u8 strongRight : 1; /* 0x00 */ u8 strongLeft : 1; + /* 0x00 */ u8 strongRight : 1; + /* 0x00 */ u8 bit2 : 2; + /* 0x00 */ u8 unused : 2; + /* 0x00 */ u8 usesHeadsetPanEffects : 1; + /* 0x00 */ u8 stereoHeadsetEffects : 1; } StereoData; // size = 0x1 typedef union { @@ -773,13 +773,22 @@ typedef struct { }; }; union { - void* data; + uintptr_t asPtr; + u32 data; f32 asFloat; s32 asInt; - uintptr_t asPtr; - u16 asUShort; - s8 asSbyte; - u8 asUbyte; + struct { + u8 pad2[2]; + u16 asUShort; + }; + struct { + u8 pad1[3]; + s8 asSbyte; + }; + struct { + u8 pad0[3]; + u8 asUbyte; + }; u32 asUInt; }; } AudioCmd; // size = 0x8