mirror of
https://github.com/zeldaret/oot
synced 2026-07-09 22:51:52 -04:00
Decompile jpegdecoder.c, padsetup.c and code_800C3C20.c (#217)
* Decompile jpegdecoder.c, padsetup.c and code_800C3C20.c * change func_800C3C20's prototype and rename some fields in jpeg related structs * Fix comment in Jpeg_GetU16 and change func_800C3C20 * use a switch in padsetup.c
This commit is contained in:
+7
-7
@@ -1566,7 +1566,7 @@ u32 THA_IsCrash(TwoHeadArena* tha);
|
||||
void THA_Init(TwoHeadArena* tha);
|
||||
void THA_Ct(TwoHeadArena* tha, void* ptr, u32 size);
|
||||
void THA_Dt(TwoHeadArena* tha);
|
||||
// ? func_800C3C20(?);
|
||||
void func_800C3C20(void);
|
||||
void func_800C3C80(AudioMgr* audioMgr);
|
||||
void AudioMgr_HandleRetrace(AudioMgr* audioMgr);
|
||||
void AudioMgr_HandlePRENMI(AudioMgr* audioMgr);
|
||||
@@ -2306,7 +2306,7 @@ s8 PadUtils_GetRelYImpl(Input* input);
|
||||
s8 PadUtils_GetRelX(Input* input);
|
||||
s8 PadUtils_GetRelY(Input* input);
|
||||
void PadUtils_UpdateRelXY(Input* input);
|
||||
// ? func_800FCD40(?);
|
||||
s32 PadSetup_Init(OSMesgQueue* mq, u8* outMask, OSContStatus* status);
|
||||
f32 Math_tanf(f32 x);
|
||||
f32 Math_nearbyintf(f32 x);
|
||||
f32 Math_atanf_taylor_q(f32 x);
|
||||
@@ -2391,17 +2391,17 @@ void Sleep_Usec(u32 usec);
|
||||
void Sleep_Msec(u32 ms);
|
||||
void Sleep_Sec(u32 sec);
|
||||
void JpegUtils_ProcessQuantizationTable(u8* dqt, JpegQuantizationTable* qt, u8 count);
|
||||
s32 JpegUtils_ParseHuffmancodesLengths(u8* ptr, u8* codesLengths);
|
||||
s32 JpegUtils_ParseHuffmanCodesLengths(u8* ptr, u8* codesLengths);
|
||||
s32 JpegUtils_GetHuffmanCodes(u8* codesLengths, u16* codes);
|
||||
s32 JpegUtils_SetHuffmanTable(u8* data, JpegHuffmanTable* ht, u16* codes);
|
||||
u32 JpegUtils_ProcessHuffmanTableImpl(u8* data, JpegHuffmanTable* ht, u8* codesLengths, u16* codes, u8 isAc);
|
||||
u32 JpegUtils_ProcessHuffmanTable(u8* dht, JpegHuffmanTable* ht, u8* codesLengths, u16* codes, u8 count);
|
||||
void JpegUtils_SetHuffmanTableOld(u8* data, JpegHuffmanTableOld* ht, u8* codesLengths, u16* codes, s16 count, u8 isAc);
|
||||
u32 JpegUtils_ProcessHuffmanTableImplOld(u8* dht, JpegHuffmanTableOld* ht, u8* codesLengths, u16* codes);
|
||||
u32 func_800FFA50(JpegDecoder* decoder, u16*, u32, u8, u32*);
|
||||
// ? func_800FFC78(?);
|
||||
// ? func_800FFE14(?);
|
||||
// ? func_800FFF50(?);
|
||||
s32 JpegDecoder_Decode(JpegDecoder* decoder, u16* mcuBuff, s32 count, u8 isFollowing, JpegDecoderState* state);
|
||||
s32 JpegDecoder_ProcessMcu(JpegHuffmanTable* hTable0, JpegHuffmanTable* hTable1, s16* mcu, s16* unk);
|
||||
s32 JpegDecoder_ParseNextSymbol(JpegHuffmanTable* hTable, s16* outCoeff, u8* outZeroCount);
|
||||
u16 JpegDecoder_ReadBits(u8 len);
|
||||
s32 osPfsFreeBlocks(OSPfs* pfs, s32 *bytes_not_used);
|
||||
void guScale(Mtx* m, f32 x, f32 y, f32 z);
|
||||
f32 sinf(f32);
|
||||
|
||||
@@ -3723,11 +3723,6 @@ extern NotePool gNoteFreeLists;
|
||||
//extern ? D_801755D0;
|
||||
extern u32 __osMalloc_FreeBlockTest_Enable;
|
||||
//extern ? D_80175640;
|
||||
//extern ? D_80175660;
|
||||
//extern ? D_80175664;
|
||||
//extern ? D_80175668;
|
||||
//extern ? D_80175669;
|
||||
//extern ? D_8017566C;
|
||||
//extern ? D_80175670;
|
||||
//extern ? D_80175680;
|
||||
//extern ? D_80175688;
|
||||
|
||||
+20
-7
@@ -1841,17 +1841,21 @@ typedef struct {
|
||||
} JpegHuffmanTableOld; // size = 0x300
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u32 unk_00;
|
||||
/* 0x04 */ u32 unk_04;
|
||||
/* 0x08 */ u32 unk_08;
|
||||
/* 0x0C */ u32 qTablePtrs[3];
|
||||
/* 0x00 */ u32 address;
|
||||
/* 0x04 */ u32 mbCount;
|
||||
/* 0x08 */ u32 mode;
|
||||
/* 0x0C */ u32 qTableYPtr;
|
||||
/* 0x10 */ u32 qTableUPtr;
|
||||
/* 0x14 */ u32 qTableVPtr;
|
||||
/* 0x18 */ char unk_18[0x8];
|
||||
} JpegTaskData; // size = 0x20
|
||||
|
||||
typedef struct {
|
||||
/* 0x000 */ JpegTaskData taskData;
|
||||
/* 0x020 */ char yieldData[0x200];
|
||||
/* 0x220 */ JpegQuantizationTable qTables[3];
|
||||
/* 0x220 */ JpegQuantizationTable qTableY;
|
||||
/* 0x2A0 */ JpegQuantizationTable qTableU;
|
||||
/* 0x320 */ JpegQuantizationTable qTableV;
|
||||
/* 0x3A0 */ u8 codesLengths[0x110];
|
||||
/* 0x4B0 */ u16 codes[0x108];
|
||||
/* 0x6C0 */ u16 unk_6C0[4][0x180];
|
||||
@@ -1859,7 +1863,7 @@ typedef struct {
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ void* imageData;
|
||||
/* 0x04 */ u8 unk_04;
|
||||
/* 0x04 */ u8 mode;
|
||||
/* 0x05 */ u8 unk_05;
|
||||
/* 0x08 */ JpegHuffmanTable* hTablePtrs[4];
|
||||
/* 0x18 */ u8 unk_18;
|
||||
@@ -1871,7 +1875,7 @@ typedef struct {
|
||||
/* 0x10 */ u8 dhtCount;
|
||||
/* 0x14 */ u8* dhtPtr[4];
|
||||
/* 0x24 */ void* imageData;
|
||||
/* 0x28 */ u32 unk_28; // 0 if Y V0 is 0 and 2 if Y V0 is 2
|
||||
/* 0x28 */ u32 mode; // 0 if Y V0 is 1 and 2 if Y V0 is 2
|
||||
/* 0x2C */ char unk_2C[4];
|
||||
/* 0x30 */ OSScTask scTask;
|
||||
/* 0x88 */ char unk_88[0x10];
|
||||
@@ -1880,6 +1884,15 @@ typedef struct {
|
||||
/* 0xB4 */ JpegWork* workBuf;
|
||||
} JpegContext; // size = 0xB8
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u32 byteIdx;
|
||||
/* 0x04 */ u8 bitIdx;
|
||||
/* 0x05 */ u8 dontSkip;
|
||||
/* 0x08 */ u32 curWord;
|
||||
/* 0x0C */ s16 unk_0C;
|
||||
/* 0x0E */ s16 unk_0E;
|
||||
/* 0x10 */ s16 unk_10;
|
||||
} JpegDecoderState; // size = 0x14
|
||||
|
||||
// Vis...
|
||||
typedef struct {
|
||||
|
||||
Reference in New Issue
Block a user