[headers 11] stackcheck.h, jpeg functions (#2171)

* [headers 11] stackcheck.h, jpeg functions

* bss
This commit is contained in:
Dragorn421
2024-09-08 18:02:38 +02:00
committed by GitHub
parent c39323a336
commit de1a08c061
9 changed files with 47 additions and 37 deletions
+2 -17
View File
@@ -25,10 +25,6 @@ NORETURN void func_80002384(const char* exp, const char* file, int line);
#endif
OSPiHandle* osDriveRomInit(void);
void Mio0_Decompress(u8* src, u8* dst);
void StackCheck_Init(StackEntry* entry, void* stackBottom, void* stackTop, u32 initValue, s32 minSpace,
const char* name);
void StackCheck_Cleanup(StackEntry* entry);
u32 StackCheck_Check(StackEntry* entry);
#if OOT_DEBUG
void LogUtils_LogHexDump(void* ptr, s32 size0);
void LogUtils_CheckNullPointer(const char* exp, void* ptr, const char* file, int line);
@@ -687,7 +683,7 @@ void func_8006D0EC(PlayState* play, Player* player);
void func_8006D684(PlayState* play, Player* player);
void func_8006DC68(PlayState* play, Player* player);
void func_8006DD9C(Actor* actor, Vec3f* arg1, s16 arg2);
s32 Jpeg_Decode(void* data, void* zbuffer, void* work, u32 workSize);
void KaleidoSetup_Update(PlayState* play);
void KaleidoSetup_Init(PlayState* play);
void KaleidoSetup_Destroy(PlayState* play);
@@ -1419,18 +1415,7 @@ void Sleep_Nsec(u32 nsec);
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_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);
s32 JpegDecoder_Decode(JpegDecoder* decoder, u16* mcuBuff, s32 count, u8 isFollowing, JpegDecoderState* state);
s32 JpegDecoder_ProcessMcu(JpegHuffmanTable* hTable0, JpegHuffmanTable* hTable1, u16* mcu, s16* unk);
s32 JpegDecoder_ParseNextSymbol(JpegHuffmanTable* hTable, s16* outCoeff, s8* outZeroCount);
u16 JpegDecoder_ReadBits(u8 len);
s32 osPfsFreeBlocks(OSPfs* pfs, s32* leftoverBytes);
void guScale(Mtx* m, f32 x, f32 y, f32 z);
OSTask* _VirtualToPhysicalTask(OSTask* intp);
+7
View File
@@ -77,4 +77,11 @@ typedef struct JpegDecoderState {
/* 0x10 */ s16 unk_10;
} JpegDecoderState; // size = 0x14
s32 Jpeg_Decode(void* data, void* zbuffer, void* work, u32 workSize);
void JpegUtils_ProcessQuantizationTable(u8* dqt, JpegQuantizationTable* qt, u8 count);
u32 JpegUtils_ProcessHuffmanTable(u8* dht, JpegHuffmanTable* ht, u8* codesLengths, u16* codes, u8 count);
s32 JpegDecoder_Decode(JpegDecoder* decoder, u16* mcuBuff, s32 count, u8 isFollowing, JpegDecoderState* state);
#endif
+2
View File
@@ -1,6 +1,8 @@
#ifndef STACK_H
#define STACK_H
#include "alignment.h"
#define STACK(stack, size) \
u64 stack[ALIGN8(size) / sizeof(u64)]
+27
View File
@@ -0,0 +1,27 @@
#ifndef STACKCHECK_H
#define STACKCHECK_H
#include "ultra64.h"
typedef enum StackStatus {
/* 0 */ STACK_STATUS_OK,
/* 1 */ STACK_STATUS_WARNING,
/* 2 */ STACK_STATUS_OVERFLOW
} StackStatus;
typedef struct StackEntry {
/* 0x00 */ struct StackEntry* next;
/* 0x04 */ struct StackEntry* prev;
/* 0x08 */ u32* head;
/* 0x0C */ u32* tail;
/* 0x10 */ u32 initValue;
/* 0x14 */ s32 minSpace;
/* 0x18 */ const char* name;
} StackEntry;
void StackCheck_Init(StackEntry* entry, void* stackBottom, void* stackTop, u32 initValue, s32 minSpace,
const char* name);
void StackCheck_Cleanup(StackEntry* entry);
u32 StackCheck_Check(StackEntry* entry);
#endif
+1 -16
View File
@@ -69,6 +69,7 @@
#include "sys_matrix.h"
#include "main.h"
#include "segmented_address.h"
#include "stackcheck.h"
#define SCREEN_WIDTH 320
#define SCREEN_HEIGHT 240
@@ -397,22 +398,6 @@ typedef struct DebugDispObject {
/* 0x28 */ struct DebugDispObject* next;
} DebugDispObject; // size = 0x2C
typedef struct StackEntry {
/* 0x00 */ struct StackEntry* next;
/* 0x04 */ struct StackEntry* prev;
/* 0x08 */ u32* head;
/* 0x0C */ u32* tail;
/* 0x10 */ u32 initValue;
/* 0x14 */ s32 minSpace;
/* 0x18 */ const char* name;
} StackEntry;
typedef enum StackStatus {
/* 0 */ STACK_STATUS_OK,
/* 1 */ STACK_STATUS_WARNING,
/* 2 */ STACK_STATUS_OVERFLOW
} StackStatus;
typedef struct ISVDbg {
/* 0x00 */ u32 magic; // IS64
/* 0x04 */ u32 get;