mirror of https://github.com/zeldaret/mm.git
`z_jpeg`, `jpegutils` and `jpegdecoder` OK (#322)
* this is a disaster * two more * func_800F470C * split and rename jpegutils and jpegdecoder * match jpegutils * match jpegdecoder.c * audio_rodata * data split * Split rsp * Steal documentation from OoT * cleanup * Format * remove removed members in JpegContext * Update include/z64.h Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * Update src/code/jpegdecoder.c Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * Update include/functions.h Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * Update src/code/jpegutils.c Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * review renames * true * Some type fixes * Update include/z64.h Co-authored-by: EllipticEllipsis <73679967+EllipticEllipsis@users.noreply.github.com> * add comment * Update src/code/z_jpeg.c Co-authored-by: EllipticEllipsis <73679967+EllipticEllipsis@users.noreply.github.com> * format * bss fix * decr * format * z64jpeg.h * Add stdbool * Rename audio_init_params * whoops * whoops++ * whoops# * remove extra dumb variables in variables.txt * fix Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> Co-authored-by: EllipticEllipsis <73679967+EllipticEllipsis@users.noreply.github.com>
This commit is contained in:
parent
c8b0ff3f74
commit
2854294009
5
Makefile
5
Makefile
|
@ -162,6 +162,11 @@ build/src/code/audio/%.o: OPTFLAGS := -O2
|
|||
build/src/boot_O2_g3/fault.o: CFLAGS += -trapuv
|
||||
build/src/boot_O2_g3/fault_drawer.o: CFLAGS += -trapuv
|
||||
|
||||
build/src/code/jpegutils.o: OPTFLAGS := -O2
|
||||
build/src/code/jpegdecoder.o: OPTFLAGS := -O2
|
||||
build/src/code/jpegutils.o: CC := $(CC_OLD)
|
||||
build/src/code/jpegdecoder.o: CC := $(CC_OLD)
|
||||
|
||||
build/src/libultra/libc/ll.o: OPTFLAGS := -O1
|
||||
build/src/libultra/libc/ll.o: MIPS_VERSION := -mips3 -32
|
||||
build/src/libultra/libc/llcvt.o: OPTFLAGS := -O1
|
||||
|
|
|
@ -1696,11 +1696,7 @@ void FireObj_Update(GlobalContext* globalCtx, FireObj* fire, Actor* actor);
|
|||
void func_800F40A0(GlobalContext* globalCtx, s32 param_2);
|
||||
// void func_800F415C(void);
|
||||
UNK_TYPE func_800F41E4(GlobalContext* globalCtx, ActorContext* actorCtx);
|
||||
// void func_800F42A0(void);
|
||||
// void func_800F43BC(void);
|
||||
// void func_800F44F4(void);
|
||||
// void func_800F4540(void);
|
||||
// s32 func_800F470C(UNK_TYPE4 param_1, UNK_TYPE4 param_2, s32 param_3, u32 param_4);
|
||||
|
||||
void func_800F4A10(GlobalContext* globalCtx);
|
||||
void func_800F4C0C(GlobalContext* globalCtx);
|
||||
void func_800F4E20(GlobalContext* globalCtx);
|
||||
|
@ -2067,7 +2063,7 @@ s32 func_8010BF58(Actor* actor, GlobalContext* globalCtx, s32* param_3, UNK_PTR
|
|||
void Nmi_Init(void);
|
||||
void Nmi_SetPrenmiStart(void);
|
||||
// s32 Nmi_GetPrenmiHasStarted(void);
|
||||
// void func_8010C1B0(void);
|
||||
void MsgEvent_SendNullTask(void);
|
||||
f32 OLib_Vec3fDist(Vec3f* a, Vec3f* b);
|
||||
f32 OLib_Vec3fDistOutDiff(Vec3f* a, Vec3f* b, Vec3f* dest);
|
||||
f32 OLib_Vec3fDistXZ(Vec3f* a, Vec3f* b);
|
||||
|
@ -3413,10 +3409,12 @@ void func_8018219C(MtxF* pfParm1, Vec3s* psParm2, s32 iParm3);
|
|||
// void func_801822C4(void);
|
||||
void Matrix_InsertRotationAroundUnitVector_f(f32 rotation, Vec3f* vector, s32 appendToState);
|
||||
void Matrix_InsertRotationAroundUnitVector_s(s16 rotation, Vec3f* vector, s32 appendToState);
|
||||
|
||||
u64* SysUcode_GetUCodeBoot(void);
|
||||
u32 SysUcode_GetUCodeBootSize(void);
|
||||
u64* SysUcode_GetUCode(void);
|
||||
u64* SysUcode_GetUCodeData(void);
|
||||
|
||||
// void func_80182CE0(void);
|
||||
// void func_80183020(void);
|
||||
// void func_80183058(void);
|
||||
|
@ -4025,18 +4023,7 @@ s32 func_801A8A50(s32 param1);
|
|||
// void func_801A982C(void);
|
||||
// void func_801A99B8(void);
|
||||
// void func_801A9A74(void);
|
||||
// void func_801A9B10(void);
|
||||
// void func_801A9B78(void);
|
||||
// void func_801A9BFC(void);
|
||||
// void func_801A9C68(void);
|
||||
// void func_801A9D10(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE1 param_5);
|
||||
// void func_801A9DCC(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE1 param_5);
|
||||
// void func_801A9EA4(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE2 param_5, UNK_TYPE1 param_6);
|
||||
// void func_801A9F4C(void);
|
||||
// void func_801AA020(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5);
|
||||
// void func_801AA248(void);
|
||||
// void func_801AA3E4(void);
|
||||
// void func_801AA520(void);
|
||||
|
||||
void GameOver_Init(GlobalContext* globalCtx);
|
||||
void GameOver_FadeLights(GlobalContext* globalCtx);
|
||||
void GameOver_Update(GlobalContext* globalCtx);
|
||||
|
|
|
@ -130,7 +130,7 @@ extern GraphicsContext* __gfxCtx;
|
|||
#define SQ(x) ((x) * (x))
|
||||
#define ABS(x) ((x) >= 0 ? (x) : -(x))
|
||||
#define ABS_ALT(x) ((x) < 0 ? -(x) : (x))
|
||||
#define DECR(x) ((x) == 0 ? 0 : ((x) -= 1))
|
||||
#define DECR(x) ((x) == 0 ? 0 : --(x))
|
||||
|
||||
#define CLAMP(x, min, max) ((x) < (min) ? (min) : (x) > (max) ? (max) : (x))
|
||||
#define CLAMP_MAX(x, max) ((x) > (max) ? (max) : (x))
|
||||
|
|
|
@ -360,7 +360,7 @@ extern u16 viRetrace;
|
|||
extern DmaEntry dmadata[1568];
|
||||
// extern UNK_TYPE1 D_80186028;
|
||||
// extern UNK_TYPE1 D_801AAAB0;
|
||||
// extern UNK_TYPE1 D_801AD370;
|
||||
extern u64 gJpegUCode[];
|
||||
extern ActorInit En_A_Obj_InitVars;
|
||||
extern ColliderCylinderInit enAObjCylinderInit;
|
||||
extern InitChainEntry enAObjInitVar;
|
||||
|
@ -3107,7 +3107,7 @@ extern UNK_PTR D_801E10B0;
|
|||
// extern UNK_TYPE1 D_801E1E80;
|
||||
// extern UNK_TYPE1 D_801E2160;
|
||||
// extern UNK_TYPE1 D_801E3790;
|
||||
// extern UNK_TYPE1 D_801E3F40;
|
||||
extern u64 gJpegUCodeData[];
|
||||
// extern UNK_TYPE1 D_801E3FA0;
|
||||
|
||||
// bss
|
||||
|
@ -3789,11 +3789,6 @@ extern OSMesg D_80203290[1];
|
|||
// extern UNK_TYPE4 D_80208E6C;
|
||||
// extern UNK_TYPE4 D_80208E70;
|
||||
// extern UNK_TYPE4 D_80208E74;
|
||||
// extern UNK_TYPE1 D_80208E90;
|
||||
// extern UNK_TYPE1 D_80208E94;
|
||||
// extern UNK_TYPE1 D_80208E98;
|
||||
// extern UNK_TYPE1 D_80208E99;
|
||||
// extern UNK_TYPE1 D_80208E9C;
|
||||
|
||||
// post-code buffers
|
||||
extern u8 gGfxSPTaskYieldBuffer[OS_YIELD_DATA_SIZE];
|
||||
|
|
|
@ -0,0 +1,99 @@
|
|||
#ifndef Z64_JPEG_H
|
||||
#define Z64_JPEG_H
|
||||
|
||||
#include "PR/ultratypes.h"
|
||||
#include "ultra64/message.h"
|
||||
#include "PR/sched.h"
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u16 table[8*8];
|
||||
} JpegQuantizationTable; // size = 0x80
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 codeOffs[16];
|
||||
/* 0x10 */ u16 codesA[16];
|
||||
/* 0x30 */ u16 codesB[16];
|
||||
/* 0x50 */ u8* symbols;
|
||||
} JpegHuffmanTable; // size = 0x54
|
||||
|
||||
// this struct might be inaccurate but it's not used outside jpegutils.c
|
||||
typedef struct {
|
||||
/* 0x000 */ u8 codeOffs[16];
|
||||
/* 0x010 */ u16 dcCodes[120];
|
||||
/* 0x100 */ u16 acCodes[256];
|
||||
} JpegHuffmanTableOld; // size = 0x300
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ void* address;
|
||||
/* 0x04 */ u32 mbCount;
|
||||
/* 0x08 */ u32 mode;
|
||||
/* 0x0C */ void* qTableYPtr;
|
||||
/* 0x10 */ void* qTableUPtr;
|
||||
/* 0x14 */ void* qTableVPtr;
|
||||
/* 0x18 */ char unk_18[0x8];
|
||||
} JpegTaskData; // size = 0x20
|
||||
|
||||
typedef struct {
|
||||
/* 0x000 */ JpegTaskData taskData;
|
||||
/* 0x020 */ char yieldData[0x200];
|
||||
/* 0x220 */ JpegQuantizationTable qTableY;
|
||||
/* 0x2A0 */ JpegQuantizationTable qTableU;
|
||||
/* 0x320 */ JpegQuantizationTable qTableV;
|
||||
/* 0x3A0 */ u8 codesLengths[0x110];
|
||||
/* 0x4B0 */ u16 codes[0x108];
|
||||
/* 0x6C0 */ u16 data[4][0x180];
|
||||
} JpegWork; // size = 0x12C0
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ void* imageData;
|
||||
/* 0x04 */ u8 mode;
|
||||
/* 0x05 */ u8 unk_05;
|
||||
/* 0x08 */ JpegHuffmanTable* hTablePtrs[4];
|
||||
/* 0x18 */ u8 unk_18;
|
||||
} JpegDecoder; // size = 0x1C
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 dqtCount;
|
||||
/* 0x04 */ u8* dqtPtr[3];
|
||||
/* 0x10 */ u8 dhtCount;
|
||||
/* 0x14 */ u8* dhtPtr[4];
|
||||
/* 0x24 */ void* imageData;
|
||||
/* 0x28 */ u8 mode; // 0 if Y V0 is 1 and 2 if Y V0 is 2
|
||||
/* 0x30 */ OSScTask scTask;
|
||||
/* 0x98 */ OSMesgQueue mq;
|
||||
/* 0xB0 */ OSMesg msg;
|
||||
/* 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
|
||||
|
||||
|
||||
void Jpeg_ScheduleDecoderTask(JpegContext* jpegCtx);
|
||||
void Jpeg_CopyToZbuffer(u16* src, u16* zbuffer, s32 x, s32 y);
|
||||
u16 Jpeg_GetUnalignedU16(u8* ptr);
|
||||
void Jpeg_ParseMarkers(u8* ptr, JpegContext* jpegCtx);
|
||||
s32 Jpeg_Decode(void* data, void* zbuffer, void* work, u32 workSize);
|
||||
|
||||
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);
|
||||
|
||||
#endif
|
10
spec
10
spec
|
@ -428,7 +428,7 @@ beginseg
|
|||
compress
|
||||
after "dmadata"
|
||||
include "build/src/code/z_en_a_keep.o"
|
||||
include "build/data/code/z_en_a_keep.data.o"
|
||||
include "build/data/code/rsp.data.o"
|
||||
include "build/data/code/code_801ADE60.data.o"
|
||||
include "build/data/code/code_801E3FA0.bss.o"
|
||||
include "build/src/code/z_en_item00.o"
|
||||
|
@ -492,8 +492,8 @@ beginseg
|
|||
include "build/src/code/z_horse.o"
|
||||
include "build/data/code/z_horse.data.o"
|
||||
include "build/src/code/z_jpeg.o"
|
||||
include "build/data/code/z_jpeg.data.o"
|
||||
include "build/src/code/z_kaleido_setup.o"
|
||||
include "build/data/code/z_kaleido_setup.data.o"
|
||||
include "build/src/code/z_kanfont.o"
|
||||
include "build/src/code/z_kankyo.o"
|
||||
include "build/data/code/z_kankyo.data.o"
|
||||
|
@ -679,11 +679,11 @@ beginseg
|
|||
include "build/data/code/code_801A7B10.bss.o"
|
||||
include "build/data/code/audio_init_params.rodata.o"
|
||||
include "build/src/code/jpegutils.o"
|
||||
include "build/src/code/code_801AA020.o"
|
||||
include "build/data/code/code_801AA020.bss.o"
|
||||
include "build/src/code/jpegdecoder.o"
|
||||
include_readonly "build/src/code/z_game_over.o"
|
||||
include "build/src/code/z_construct.o"
|
||||
include "build/data/code/code_801E1180.rodata.o"
|
||||
include "build/data/code/audio_sound_params.data.o"
|
||||
include "build/data/code/rsp.rodata.o"
|
||||
endseg
|
||||
|
||||
beginseg
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include "global.h"
|
||||
|
||||
// Blocks the current thread until all currently queued scheduler tasks have been completed
|
||||
void func_8010C1B0(void) {
|
||||
void MsgEvent_SendNullTask(void) {
|
||||
OSScTask task;
|
||||
OSMesgQueue queue;
|
||||
OSMesg msg;
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
#include "global.h"
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_801AA020/func_801AA020.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_801AA020/func_801AA248.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_801AA020/func_801AA3E4.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_801AA020/func_801AA520.s")
|
|
@ -0,0 +1,193 @@
|
|||
#include "z64jpeg.h"
|
||||
#include "libc/stdbool.h"
|
||||
#include "macros.h"
|
||||
|
||||
u8* sJpegBitStreamPtr;
|
||||
u32 sJpegBitStreamByteIdx;
|
||||
u8 sJpegBitStreamBitIdx;
|
||||
u8 sJpegBitStreamDontSkip;
|
||||
u32 sJpegBitStreamCurWord;
|
||||
|
||||
s32 JpegDecoder_Decode(JpegDecoder* decoder, u16* mcuBuff, s32 count, u8 isFollowing, JpegDecoderState* state) {
|
||||
s16 pad;
|
||||
s16 unk0;
|
||||
s16 unk1;
|
||||
s16 unk2;
|
||||
u32 idx;
|
||||
s32 inc;
|
||||
u16 unkCount;
|
||||
|
||||
JpegHuffmanTable* hTable0;
|
||||
JpegHuffmanTable* hTable1;
|
||||
JpegHuffmanTable* hTable2;
|
||||
JpegHuffmanTable* hTable3;
|
||||
|
||||
inc = 0;
|
||||
sJpegBitStreamPtr = decoder->imageData;
|
||||
if (decoder->mode == 0) {
|
||||
unkCount = 2;
|
||||
} else {
|
||||
unkCount = 4;
|
||||
if (decoder->unk_05 == 1) {
|
||||
inc = 8 * 8 * 2;
|
||||
}
|
||||
}
|
||||
|
||||
hTable0 = decoder->hTablePtrs[0];
|
||||
hTable1 = decoder->hTablePtrs[1];
|
||||
hTable2 = decoder->hTablePtrs[2];
|
||||
hTable3 = decoder->hTablePtrs[3];
|
||||
|
||||
if (!isFollowing) {
|
||||
sJpegBitStreamByteIdx = 0;
|
||||
sJpegBitStreamBitIdx = 32;
|
||||
sJpegBitStreamCurWord = 0;
|
||||
sJpegBitStreamDontSkip = 0;
|
||||
unk0 = 0;
|
||||
unk1 = 0;
|
||||
unk2 = 0;
|
||||
} else {
|
||||
sJpegBitStreamByteIdx = state->byteIdx;
|
||||
sJpegBitStreamBitIdx = state->bitIdx;
|
||||
sJpegBitStreamCurWord = state->curWord;
|
||||
sJpegBitStreamDontSkip = state->dontSkip;
|
||||
unk0 = state->unk_0C;
|
||||
unk1 = state->unk_0E;
|
||||
unk2 = state->unk_10;
|
||||
}
|
||||
|
||||
while (count != 0) {
|
||||
for (idx = 0; idx < unkCount; idx++) {
|
||||
if (JpegDecoder_ProcessMcu(hTable0, hTable1, mcuBuff, &unk0)) {
|
||||
return 2;
|
||||
}
|
||||
mcuBuff += 8 * 8;
|
||||
}
|
||||
|
||||
if (JpegDecoder_ProcessMcu(hTable2, hTable3, mcuBuff, &unk1)) {
|
||||
return 2;
|
||||
}
|
||||
mcuBuff += 8 * 8;
|
||||
|
||||
if (JpegDecoder_ProcessMcu(hTable2, hTable3, mcuBuff, &unk2)) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
count--;
|
||||
mcuBuff += 8 * 8;
|
||||
mcuBuff += inc;
|
||||
}
|
||||
|
||||
state->byteIdx = sJpegBitStreamByteIdx;
|
||||
state->bitIdx = sJpegBitStreamBitIdx;
|
||||
state->curWord = sJpegBitStreamCurWord;
|
||||
state->dontSkip = sJpegBitStreamDontSkip;
|
||||
state->unk_0C = unk0;
|
||||
state->unk_0E = unk1;
|
||||
state->unk_10 = unk2;
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 JpegDecoder_ProcessMcu(JpegHuffmanTable* hTable0, JpegHuffmanTable* hTable1, u16* mcu, s16* unk) {
|
||||
s8 i = 0;
|
||||
s8 zeroCount;
|
||||
s16 coeff;
|
||||
|
||||
if (JpegDecoder_ParseNextSymbol(hTable0, &coeff, &zeroCount)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
*unk += coeff;
|
||||
mcu[i++] = *unk;
|
||||
while (i < 8 * 8) {
|
||||
if (JpegDecoder_ParseNextSymbol(hTable1, &coeff, &zeroCount)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (coeff == 0) {
|
||||
if (zeroCount == 0xF) {
|
||||
while (zeroCount-- >= 0) {
|
||||
mcu[i++] = 0;
|
||||
}
|
||||
} else {
|
||||
while (i < 8 * 8) {
|
||||
mcu[i++] = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
while (0 < zeroCount--) {
|
||||
mcu[i++] = 0;
|
||||
}
|
||||
mcu[i++] = coeff;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
s32 JpegDecoder_ParseNextSymbol(JpegHuffmanTable* hTable, s16* outCoeff, s8* outZeroCount) {
|
||||
u8 codeIdx;
|
||||
u8 sym;
|
||||
u16 codeOff = 0;
|
||||
u16 buff = JpegDecoder_ReadBits(16);
|
||||
|
||||
for (codeIdx = 0; codeIdx < ARRAY_COUNT(hTable->codesB); codeIdx++) {
|
||||
if (hTable->codesB[codeIdx] == 0xFFFF) {
|
||||
continue;
|
||||
}
|
||||
|
||||
codeOff = buff >> (15 - codeIdx);
|
||||
if (codeOff <= hTable->codesB[codeIdx]) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (codeIdx >= ARRAY_COUNT(hTable->codesB)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
sym = hTable->symbols[hTable->codeOffs[codeIdx] + codeOff - hTable->codesA[codeIdx]];
|
||||
*outZeroCount = sym >> 4;
|
||||
sym &= 0xF;
|
||||
|
||||
sJpegBitStreamBitIdx += codeIdx - 15;
|
||||
*outCoeff = 0;
|
||||
if (sym) {
|
||||
*outCoeff = JpegDecoder_ReadBits(sym);
|
||||
if (*outCoeff < (1 << (sym - 1))) {
|
||||
*outCoeff += (-1 << sym) + 1;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
u16 JpegDecoder_ReadBits(u8 len) {
|
||||
u8 byteCount;
|
||||
u8 data;
|
||||
s32 ret;
|
||||
u32 temp;
|
||||
ret = 0; // this is required for some reason
|
||||
|
||||
for (byteCount = sJpegBitStreamBitIdx >> 3; byteCount > 0; byteCount--) {
|
||||
data = sJpegBitStreamPtr[sJpegBitStreamByteIdx++];
|
||||
if (sJpegBitStreamDontSkip) {
|
||||
if (data == 0) {
|
||||
data = sJpegBitStreamPtr[sJpegBitStreamByteIdx++];
|
||||
}
|
||||
}
|
||||
|
||||
sJpegBitStreamDontSkip = (data == 0xFF) ? true : false;
|
||||
|
||||
sJpegBitStreamCurWord <<= 8;
|
||||
sJpegBitStreamCurWord |= data;
|
||||
sJpegBitStreamBitIdx -= 8;
|
||||
}
|
||||
|
||||
ret = (sJpegBitStreamCurWord << (sJpegBitStreamBitIdx));
|
||||
temp = ret;
|
||||
ret = temp >> -len;
|
||||
sJpegBitStreamBitIdx += len;
|
||||
return ret;
|
||||
}
|
|
@ -1,17 +1,155 @@
|
|||
#include "global.h"
|
||||
#include "z64jpeg.h"
|
||||
#include "libc/stdbool.h"
|
||||
#include "macros.h"
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/jpegutils/func_801A9B10.s")
|
||||
void JpegUtils_ProcessQuantizationTable(u8* dqt, JpegQuantizationTable* qt, u8 count) {
|
||||
u8 i;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/jpegutils/func_801A9B78.s")
|
||||
for (i = 0; i < count; i++) {
|
||||
u8 j;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/jpegutils/func_801A9BFC.s")
|
||||
dqt++;
|
||||
for (j = 0; j < ARRAY_COUNT(qt[i].table); j++) {
|
||||
qt[i].table[j] = *dqt++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/jpegutils/func_801A9C68.s")
|
||||
s32 JpegUtils_ParseHuffmanCodesLengths(u8* ptr, u8* codesLengths) {
|
||||
u8 off = 1;
|
||||
s16 count = 0;
|
||||
s16 idx = 1;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/jpegutils/func_801A9D10.s")
|
||||
while (off <= 16) {
|
||||
while (idx <= ptr[off - 1]) {
|
||||
codesLengths[count++] = off;
|
||||
idx++;
|
||||
}
|
||||
idx = 1;
|
||||
off++;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/jpegutils/func_801A9DCC.s")
|
||||
codesLengths[count] = 0;
|
||||
return count;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/jpegutils/func_801A9EA4.s")
|
||||
s32 JpegUtils_GetHuffmanCodes(u8* codesLengths, u16* codes) {
|
||||
s16 idx = 0;
|
||||
u16 code = 0;
|
||||
u8 lastLen = codesLengths[0];
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/jpegutils/func_801A9F4C.s")
|
||||
while (true) {
|
||||
while (true) {
|
||||
codes[idx++] = code++;
|
||||
|
||||
if (codesLengths[idx] != lastLen) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (codesLengths[idx] == 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
while (true) {
|
||||
if (code <<= 1, codesLengths[idx] == ++lastLen) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return idx;
|
||||
}
|
||||
|
||||
s32 JpegUtils_SetHuffmanTable(u8* data, JpegHuffmanTable* ht, u16* codes) {
|
||||
u8 idx;
|
||||
u16 codeOff = 0;
|
||||
|
||||
for (idx = 0; idx < 16; idx++) {
|
||||
if (data[idx]) {
|
||||
ht->codeOffs[idx] = codeOff;
|
||||
ht->codesA[idx] = codes[codeOff];
|
||||
codeOff += data[idx] - 1;
|
||||
ht->codesB[idx] = codes[codeOff];
|
||||
codeOff++;
|
||||
} else {
|
||||
ht->codesB[idx] = 0xFFFF;
|
||||
}
|
||||
}
|
||||
|
||||
return codeOff;
|
||||
}
|
||||
|
||||
u32 JpegUtils_ProcessHuffmanTableImpl(u8* data, JpegHuffmanTable* ht, u8* codesLengths, u16* codes, u8 isAc) {
|
||||
s16 ret;
|
||||
s32 count = JpegUtils_ParseHuffmanCodesLengths(data, codesLengths);
|
||||
s32 temp;
|
||||
|
||||
ret = count;
|
||||
if (count == 0 || (isAc && count > 0x100) || (!isAc && count > 0x10)) {
|
||||
return 0;
|
||||
}
|
||||
if (ret != JpegUtils_GetHuffmanCodes(codesLengths, codes)) {
|
||||
return 0;
|
||||
}
|
||||
if (temp = JpegUtils_SetHuffmanTable(data, ht, codes), temp != ret) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
u32 JpegUtils_ProcessHuffmanTable(u8* dht, JpegHuffmanTable* ht, u8* codesLengths, u16* codes, u8 count) {
|
||||
u8 idx;
|
||||
u32 codeCount;
|
||||
|
||||
for (idx = 0; idx < count; idx++) {
|
||||
u32 ac = (*dht++ >> 4);
|
||||
|
||||
codeCount = JpegUtils_ProcessHuffmanTableImpl(dht, &ht[idx], codesLengths, codes, ac);
|
||||
if (codeCount == 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
dht += 16;
|
||||
ht[idx].symbols = dht;
|
||||
dht += codeCount;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void JpegUtils_SetHuffmanTableOld(u8* data, JpegHuffmanTableOld* ht, u8* codesLengths, u16* codes, s16 count, u8 isAc) {
|
||||
s16 idx;
|
||||
u8 a;
|
||||
|
||||
for (idx = 0; idx < count; idx++) {
|
||||
a = data[idx];
|
||||
if (isAc) {
|
||||
ht->acCodes[a] = codes[idx];
|
||||
ht->codeOffs[a] = codesLengths[idx];
|
||||
} else {
|
||||
ht->dcCodes[a] = codes[idx];
|
||||
ht->codeOffs[a] = codesLengths[idx];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
u32 JpegUtils_ProcessHuffmanTableImplOld(u8* dht, JpegHuffmanTableOld* ht, u8* codesLengths, u16* codes) {
|
||||
u8 isAc = *dht++ >> 4;
|
||||
s16 count2;
|
||||
s32 count;
|
||||
|
||||
count2 = count = JpegUtils_ParseHuffmanCodesLengths(dht, codesLengths);
|
||||
|
||||
if (count == 0 || (isAc && count > 0x100) || (!isAc && count > 0x10)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (JpegUtils_GetHuffmanCodes(codesLengths, codes) != count2) {
|
||||
return true;
|
||||
}
|
||||
|
||||
JpegUtils_SetHuffmanTableOld(dht + 0x10, ht, codesLengths, codes, count2, isAc);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -1,11 +1,304 @@
|
|||
#include "global.h"
|
||||
#include "z64jpeg.h"
|
||||
#include "libc/stdbool.h"
|
||||
#include "variables.h"
|
||||
#include "functions.h"
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_jpeg/func_800F42A0.s")
|
||||
#define MARKER_ESCAPE 0x00
|
||||
#define MARKER_SOI 0xD8
|
||||
#define MARKER_SOF 0xC0
|
||||
#define MARKER_DHT 0xC4
|
||||
#define MARKER_DQT 0xDB
|
||||
#define MARKER_DRI 0xDD
|
||||
#define MARKER_SOS 0xDA
|
||||
#define MARKER_APP0 0xE0
|
||||
#define MARKER_APP1 0xE1
|
||||
#define MARKER_APP2 0xE2
|
||||
#define MARKER_COM 0xFE
|
||||
#define MARKER_EOI 0xD9
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_jpeg/func_800F43BC.s")
|
||||
/**
|
||||
* Configures and schedules a JPEG decoder task and waits for it to finish.
|
||||
*/
|
||||
void Jpeg_ScheduleDecoderTask(JpegContext* jpegCtx) {
|
||||
static OSTask_t sJpegTask = {
|
||||
M_NJPEGTASK, // type
|
||||
0, // flags
|
||||
NULL, // ucode_boot
|
||||
0, // ucode_boot_size
|
||||
gJpegUCode, // ucode
|
||||
0x1000, // ucode_size
|
||||
gJpegUCodeData, // ucode_data
|
||||
0x800, // ucode_data_size
|
||||
NULL, // dram_stack
|
||||
0, // dram_stack_size
|
||||
NULL, // output_buff
|
||||
NULL, // output_buff_size
|
||||
NULL, // data_ptr
|
||||
sizeof(JpegTaskData), // data_size
|
||||
NULL, // yield_data_ptr
|
||||
0x200, // yield_data_size
|
||||
};
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_jpeg/func_800F44F4.s")
|
||||
JpegWork* workBuf = jpegCtx->workBuf;
|
||||
s32 pad[2];
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_jpeg/func_800F4540.s")
|
||||
workBuf->taskData.address = &workBuf->data;
|
||||
workBuf->taskData.mode = jpegCtx->mode;
|
||||
workBuf->taskData.mbCount = 4;
|
||||
workBuf->taskData.qTableYPtr = &workBuf->qTableY;
|
||||
workBuf->taskData.qTableUPtr = &workBuf->qTableU;
|
||||
workBuf->taskData.qTableVPtr = &workBuf->qTableV;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_jpeg/func_800F470C.s")
|
||||
sJpegTask.flags = 0;
|
||||
sJpegTask.ucodeBoot = SysUcode_GetUCodeBoot();
|
||||
sJpegTask.ucodeBootSize = SysUcode_GetUCodeBootSize();
|
||||
sJpegTask.yieldDataPtr = (u64*)&workBuf->yieldData;
|
||||
sJpegTask.dataPtr = (u64*)&workBuf->taskData;
|
||||
|
||||
jpegCtx->scTask.next = NULL;
|
||||
jpegCtx->scTask.flags = OS_SC_NEEDS_RSP;
|
||||
jpegCtx->scTask.msgQ = &jpegCtx->mq;
|
||||
jpegCtx->scTask.msg = NULL;
|
||||
jpegCtx->scTask.framebuffer = NULL;
|
||||
jpegCtx->scTask.list.t = sJpegTask;
|
||||
|
||||
osSendMesg(&gSchedContext.cmdQ, (OSMesg)&jpegCtx->scTask, OS_MESG_BLOCK);
|
||||
Sched_SendEntryMsg(&gSchedContext); // osScKickEntryMsg
|
||||
osRecvMesg(&jpegCtx->mq, NULL, OS_MESG_BLOCK);
|
||||
}
|
||||
|
||||
/**
|
||||
* Copies a 16x16 block of decoded image data to the Z-buffer.
|
||||
*/
|
||||
void Jpeg_CopyToZbuffer(u16* src, u16* zbuffer, s32 x, s32 y) {
|
||||
u16* dst = zbuffer + (((y * SCREEN_WIDTH) + x) * 16);
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < 16; i++) {
|
||||
dst[0] = src[0];
|
||||
dst[1] = src[1];
|
||||
dst[2] = src[2];
|
||||
dst[3] = src[3];
|
||||
dst[4] = src[4];
|
||||
dst[5] = src[5];
|
||||
dst[6] = src[6];
|
||||
dst[7] = src[7];
|
||||
dst[8] = src[8];
|
||||
dst[9] = src[9];
|
||||
dst[10] = src[10];
|
||||
dst[11] = src[11];
|
||||
dst[12] = src[12];
|
||||
dst[13] = src[13];
|
||||
dst[14] = src[14];
|
||||
dst[15] = src[15];
|
||||
|
||||
src += 16;
|
||||
dst += SCREEN_WIDTH;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads an u16 from a possibly unaligned address in memory.
|
||||
*
|
||||
* Replaces unaligned 16-bit reads with a pair of aligned reads, allowing for reading the possibly
|
||||
* unaligned values in JPEG header files.
|
||||
*/
|
||||
u16 Jpeg_GetUnalignedU16(u8* ptr) {
|
||||
if (((u32)ptr & 1) == 0) {
|
||||
// Read the value normally if it's aligned to a 16-bit address.
|
||||
return *(u16*)ptr;
|
||||
} else {
|
||||
// Read unaligned values using two separate aligned memory accesses when it's not.
|
||||
return *(u16*)(ptr - 1) << 8 | (*(u16*)(ptr + 1) >> 8);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses the markers in the JPEG file, storing information such as the pointer to the image data
|
||||
* in `jpegCtx` for later processing.
|
||||
*/
|
||||
void Jpeg_ParseMarkers(u8* ptr, JpegContext* jpegCtx) {
|
||||
u32 exit = false;
|
||||
|
||||
jpegCtx->dqtCount = 0;
|
||||
jpegCtx->dhtCount = 0;
|
||||
|
||||
while (true) {
|
||||
if (exit) {
|
||||
break;
|
||||
}
|
||||
|
||||
// 0xFF indicates the start of a JPEG marker, so look for the next.
|
||||
if (*ptr++ == 0xFF) {
|
||||
switch (*ptr++) {
|
||||
case MARKER_ESCAPE: {
|
||||
// Compressed value 0xFF is stored as 0xFF00 to escape it, so ignore it.
|
||||
break;
|
||||
}
|
||||
case MARKER_SOI: {
|
||||
// Start of Image
|
||||
break;
|
||||
}
|
||||
case MARKER_APP0: {
|
||||
// Application marker for JFIF
|
||||
ptr += Jpeg_GetUnalignedU16(ptr);
|
||||
break;
|
||||
}
|
||||
case MARKER_APP1: {
|
||||
// Application marker for EXIF
|
||||
ptr += Jpeg_GetUnalignedU16(ptr);
|
||||
break;
|
||||
}
|
||||
case MARKER_APP2: {
|
||||
ptr += Jpeg_GetUnalignedU16(ptr);
|
||||
break;
|
||||
}
|
||||
case MARKER_DQT: {
|
||||
// Define Quantization Table, stored for later processing
|
||||
jpegCtx->dqtPtr[jpegCtx->dqtCount++] = ptr + 2;
|
||||
ptr += Jpeg_GetUnalignedU16(ptr);
|
||||
break;
|
||||
}
|
||||
case MARKER_DHT: {
|
||||
// Define Huffman Table, stored for later processing
|
||||
jpegCtx->dhtPtr[jpegCtx->dhtCount++] = ptr + 2;
|
||||
ptr += Jpeg_GetUnalignedU16(ptr);
|
||||
break;
|
||||
}
|
||||
case MARKER_DRI: {
|
||||
// Define Restart Interval
|
||||
ptr += Jpeg_GetUnalignedU16(ptr);
|
||||
break;
|
||||
}
|
||||
case MARKER_SOF: {
|
||||
// Start of Frame, stores important metadata of the image.
|
||||
// Only used for extracting the sampling factors (jpegCtx->mode).
|
||||
|
||||
if (ptr[9] == 0x21) {
|
||||
// component Y : V0 == 1
|
||||
jpegCtx->mode = 0;
|
||||
} else if (ptr[9] == 0x22) {
|
||||
// component Y : V0 == 2
|
||||
jpegCtx->mode = 2;
|
||||
}
|
||||
ptr += Jpeg_GetUnalignedU16(ptr);
|
||||
break;
|
||||
}
|
||||
case MARKER_SOS: {
|
||||
// Start of Scan marker, indicates the start of the image data.
|
||||
ptr += Jpeg_GetUnalignedU16(ptr);
|
||||
jpegCtx->imageData = ptr;
|
||||
break;
|
||||
}
|
||||
case MARKER_EOI: {
|
||||
// End of Image
|
||||
exit = true;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
ptr += Jpeg_GetUnalignedU16(ptr);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
s32 Jpeg_Decode(void* data, void* zbuffer, void* work, u32 workSize) {
|
||||
s32 y;
|
||||
s32 x;
|
||||
s32 j;
|
||||
s32 i;
|
||||
JpegContext jpegCtx;
|
||||
JpegHuffmanTable hTables[4];
|
||||
JpegDecoder decoder;
|
||||
JpegDecoderState state;
|
||||
JpegWork* workBuff = work;
|
||||
|
||||
if (workSize < sizeof(JpegWork)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
osCreateMesgQueue(&jpegCtx.mq, &jpegCtx.msg, 1);
|
||||
MsgEvent_SendNullTask();
|
||||
|
||||
jpegCtx.workBuf = workBuff;
|
||||
|
||||
Jpeg_ParseMarkers(data, &jpegCtx);
|
||||
|
||||
switch (jpegCtx.dqtCount) {
|
||||
case 1:
|
||||
JpegUtils_ProcessQuantizationTable(jpegCtx.dqtPtr[0], &workBuff->qTableY, 3);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
JpegUtils_ProcessQuantizationTable(jpegCtx.dqtPtr[0], &workBuff->qTableY, 1);
|
||||
JpegUtils_ProcessQuantizationTable(jpegCtx.dqtPtr[1], &workBuff->qTableU, 1);
|
||||
JpegUtils_ProcessQuantizationTable(jpegCtx.dqtPtr[1], &workBuff->qTableV, 1);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
JpegUtils_ProcessQuantizationTable(jpegCtx.dqtPtr[0], &workBuff->qTableY, 1);
|
||||
JpegUtils_ProcessQuantizationTable(jpegCtx.dqtPtr[1], &workBuff->qTableU, 1);
|
||||
JpegUtils_ProcessQuantizationTable(jpegCtx.dqtPtr[2], &workBuff->qTableV, 1);
|
||||
break;
|
||||
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
|
||||
switch (jpegCtx.dhtCount) {
|
||||
case 1:
|
||||
if (JpegUtils_ProcessHuffmanTable(jpegCtx.dhtPtr[0], &hTables[0], workBuff->codesLengths, workBuff->codes,
|
||||
4)) {
|
||||
return -1;
|
||||
}
|
||||
break;
|
||||
|
||||
case 4:
|
||||
// This chained if-else has printfs inside it on debug
|
||||
if (JpegUtils_ProcessHuffmanTable(jpegCtx.dhtPtr[0], &hTables[0], workBuff->codesLengths, workBuff->codes,
|
||||
1)) {
|
||||
} else if (JpegUtils_ProcessHuffmanTable(jpegCtx.dhtPtr[1], &hTables[1], workBuff->codesLengths,
|
||||
workBuff->codes, 1)) {
|
||||
} else if (JpegUtils_ProcessHuffmanTable(jpegCtx.dhtPtr[2], &hTables[2], workBuff->codesLengths,
|
||||
workBuff->codes, 1)) {
|
||||
} else if (!JpegUtils_ProcessHuffmanTable(jpegCtx.dhtPtr[3], &hTables[3], workBuff->codesLengths,
|
||||
workBuff->codes, 1)) {
|
||||
break;
|
||||
}
|
||||
return -1;
|
||||
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
|
||||
decoder.imageData = jpegCtx.imageData;
|
||||
decoder.mode = jpegCtx.mode;
|
||||
decoder.unk_05 = 2;
|
||||
|
||||
decoder.hTablePtrs[0] = &hTables[0];
|
||||
decoder.hTablePtrs[1] = &hTables[1];
|
||||
decoder.hTablePtrs[2] = &hTables[2];
|
||||
decoder.hTablePtrs[3] = &hTables[3];
|
||||
decoder.unk_18 = 0;
|
||||
|
||||
x = y = 0;
|
||||
for (i = 0; i < 300; i += 4) {
|
||||
if (!JpegDecoder_Decode(&decoder, (u16*)workBuff->data, 4, (i != 0), &state)) {
|
||||
Jpeg_ScheduleDecoderTask(&jpegCtx);
|
||||
|
||||
for (j = 0; j < 4; j++) {
|
||||
Jpeg_CopyToZbuffer(workBuff->data[j], zbuffer, x, y);
|
||||
x++;
|
||||
|
||||
if (x >= 20) {
|
||||
x = 0;
|
||||
y++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -498,12 +498,12 @@
|
|||
0x801A5BD0 : "code_801A5BD0",
|
||||
0x801A7B10 : "code_801A7B10",
|
||||
0x801A9B10 : "jpegutils",
|
||||
0x801AA020 : "code_801AA020",
|
||||
0x801AA020 : "jpegdecoder",
|
||||
0x801AA610 : "z_game_over",
|
||||
0x801AAAA0 : "z_construct",
|
||||
|
||||
# .data section
|
||||
0x801AAAB0 : "z_en_a_keep",
|
||||
0x801AAAB0 : "rsp",
|
||||
0x801ADE60 : "",
|
||||
0x801ADEC0 : "z_en_item00",
|
||||
0x801AE240 : "z_eff_blure",
|
||||
|
@ -530,6 +530,7 @@
|
|||
0x801BD910 : "",
|
||||
0x801BDA70 : "z_horse",
|
||||
0x801BDAC0 : "z_jpeg",
|
||||
0x801BDB00 : "z_kaleido_setup",
|
||||
0x801BDB30 : "z_kanfont",
|
||||
0x801BDB90 : "z_kankyo",
|
||||
0x801BE960 : "z_lib",
|
||||
|
@ -672,7 +673,7 @@
|
|||
0x801E1070 : "code_801A7B10",
|
||||
0x801E1100 : "audio_init_params",
|
||||
0x801E1110 : "z_game_over",
|
||||
0x801E1180 : "",
|
||||
0x801E1180 : "rsp",
|
||||
|
||||
# .bss section
|
||||
0x801E3FA0 : "code_801E3FA0",
|
||||
|
@ -728,7 +729,7 @@
|
|||
0x801FD5A0 : "code_801A51F0",
|
||||
0x801FD710 : "code_801A5BD0",
|
||||
0x801FFD00 : "code_801A7B10",
|
||||
0x80208E90 : "code_801AA020",
|
||||
0x80208E90 : "jpegdecoder",
|
||||
0x80208EA0 : "gfxbuffers",
|
||||
0x8024A4C0 : "buffers",
|
||||
},
|
||||
|
|
|
@ -1693,11 +1693,11 @@
|
|||
0x800F40A0:("func_800F40A0",),
|
||||
0x800F415C:("func_800F415C",),
|
||||
0x800F41E4:("func_800F41E4",),
|
||||
0x800F42A0:("func_800F42A0",),
|
||||
0x800F43BC:("func_800F43BC",),
|
||||
0x800F44F4:("func_800F44F4",),
|
||||
0x800F4540:("func_800F4540",),
|
||||
0x800F470C:("func_800F470C",),
|
||||
0x800F42A0:("Jpeg_ScheduleDecoderTask",),
|
||||
0x800F43BC:("Jpeg_CopyToZbuffer",),
|
||||
0x800F44F4:("Jpeg_GetUnalignedU16",),
|
||||
0x800F4540:("Jpeg_ParseMarkers",),
|
||||
0x800F470C:("Jpeg_Decode",),
|
||||
0x800F4A10:("func_800F4A10",),
|
||||
0x800F4C0C:("func_800F4C0C",),
|
||||
0x800F4E20:("func_800F4E20",),
|
||||
|
@ -2064,7 +2064,7 @@
|
|||
0x8010C0C0:("Nmi_Init",),
|
||||
0x8010C164:("Nmi_SetPrenmiStart",),
|
||||
0x8010C19C:("Nmi_GetPrenmiHasStarted",),
|
||||
0x8010C1B0:("func_8010C1B0",),
|
||||
0x8010C1B0:("MsgEvent_SendNullTask",),
|
||||
0x8010C230:("OLib_Vec3fDist",),
|
||||
0x8010C274:("OLib_Vec3fDistOutDiff",),
|
||||
0x8010C2D0:("OLib_Vec3fDistXZ",),
|
||||
|
@ -4067,18 +4067,18 @@
|
|||
0x801A982C:("func_801A982C",),
|
||||
0x801A99B8:("func_801A99B8",),
|
||||
0x801A9A74:("func_801A9A74",),
|
||||
0x801A9B10:("func_801A9B10",),
|
||||
0x801A9B78:("func_801A9B78",),
|
||||
0x801A9BFC:("func_801A9BFC",),
|
||||
0x801A9C68:("func_801A9C68",),
|
||||
0x801A9D10:("func_801A9D10",),
|
||||
0x801A9DCC:("func_801A9DCC",),
|
||||
0x801A9EA4:("func_801A9EA4",),
|
||||
0x801A9F4C:("func_801A9F4C",),
|
||||
0x801AA020:("func_801AA020",),
|
||||
0x801AA248:("func_801AA248",),
|
||||
0x801AA3E4:("func_801AA3E4",),
|
||||
0x801AA520:("func_801AA520",),
|
||||
0x801A9B10:("JpegUtils_ProcessQuantizationTable",),
|
||||
0x801A9B78:("JpegUtils_ParseHuffmanCodesLengths",),
|
||||
0x801A9BFC:("JpegUtils_GetHuffmanCodes",),
|
||||
0x801A9C68:("JpegUtils_SetHuffmanTable",),
|
||||
0x801A9D10:("JpegUtils_ProcessHuffmanTableImpl",),
|
||||
0x801A9DCC:("JpegUtils_ProcessHuffmanTable",),
|
||||
0x801A9EA4:("JpegUtils_SetHuffmanTableOld",),
|
||||
0x801A9F4C:("JpegUtils_ProcessHuffmanTableImplOld",),
|
||||
0x801AA020:("JpegDecoder_Decode",),
|
||||
0x801AA248:("JpegDecoder_ProcessMcu",),
|
||||
0x801AA3E4:("JpegDecoder_ParseNextSymbol",),
|
||||
0x801AA520:("JpegDecoder_ReadBits",),
|
||||
0x801AA610:("GameOver_Init",),
|
||||
0x801AA624:("GameOver_FadeLights",),
|
||||
0x801AA68C:("GameOver_Update",),
|
||||
|
|
|
@ -367,7 +367,7 @@
|
|||
0x80186028:("D_80186028","s16","[1316]",0xa48),
|
||||
0x801AAAB0:("D_801AAAB0","UNK_TYPE1","",0x1),
|
||||
0x801ABAB0:("D_801ABAB0","UNK_TYPE1","",0x1),
|
||||
0x801AD370:("D_801AD370","UNK_TYPE1","",0x1),
|
||||
0x801AD370:("gJpegUCode","UNK_TYPE1","",0x1),
|
||||
0x801ADE60:("En_A_Obj_InitVars","ActorInit","",0x20),
|
||||
0x801ADE80:("enAObjCylinderInit","ColliderCylinderInit","",0x2c),
|
||||
0x801ADEAC:("enAObjInitVar","ActorInitVar","",0x4),
|
||||
|
@ -3894,7 +3894,7 @@
|
|||
0x801E2160:("D_801E2160","UNK_TYPE1","",0x1),
|
||||
0x801E3790:("D_801E3790","UNK_TYPE1","",0x1),
|
||||
0x801E3BB0:("D_801E3BB0","UNK_TYPE1","",0x1),
|
||||
0x801E3F40:("D_801E3F40","UNK_TYPE1","",0x1),
|
||||
0x801E3F40:("gJpegUCodeData","UNK_TYPE1","",0x1),
|
||||
0x801E3FA0:("D_801E3FA0","UNK_TYPE1","",0x1),
|
||||
0x801E3FB0:("sEffTable","EffTables","",0x98e0),
|
||||
0x801E4514:("D_801E4514","UNK_TYPE1","",0x1),
|
||||
|
@ -4585,11 +4585,11 @@
|
|||
0x80208E6C:("D_80208E6C","UNK_TYPE4","",0x4),
|
||||
0x80208E70:("D_80208E70","UNK_TYPE4","",0x4),
|
||||
0x80208E74:("D_80208E74","UNK_TYPE4","",0x4),
|
||||
0x80208E90:("D_80208E90","UNK_TYPE1","",0x1),
|
||||
0x80208E94:("D_80208E94","UNK_TYPE1","",0x1),
|
||||
0x80208E98:("D_80208E98","UNK_TYPE1","",0x1),
|
||||
0x80208E99:("D_80208E99","UNK_TYPE1","",0x1),
|
||||
0x80208E9C:("D_80208E9C","UNK_TYPE1","",0x1),
|
||||
0x80208E90:("sJpegBitStreamPtr","UNK_TYPE1","",0x1),
|
||||
0x80208E94:("sJpegBitStreamByteIdx","UNK_TYPE1","",0x1),
|
||||
0x80208E98:("sJpegBitStreamBitIdx","UNK_TYPE1","",0x1),
|
||||
0x80208E99:("sJpegBitStreamDontSkip","UNK_TYPE1","",0x1),
|
||||
0x80208E9C:("sJpegBitStreamCurWord","UNK_TYPE1","",0x1),
|
||||
0x80208EA0:("gGfxSPTaskYieldBuffer","u8","[OS_YIELD_DATA_SIZE]",0xC00),
|
||||
0x80209AA0:("gGfxSPTaskStack","u8","[0x400]",0x400),
|
||||
0x80209EA0:("gGfxPools","GfxPool","[2]",0x40620),
|
||||
|
@ -7917,11 +7917,6 @@
|
|||
0x8090DC1C:("D_8090DC1C","f32","",0x4),
|
||||
0x8090DC20:("D_8090DC20","f32","",0x4),
|
||||
0x8090DC24:("D_8090DC24","f32","",0x4),
|
||||
0x8090DC30:("enFishingOverlayInfo","OverlayRelocationSection","",0x14),
|
||||
0x8090DC44:("enFishingOverlayRelocations","u32","[2393]",0x2564),
|
||||
0x809101AC:("enFishingOverlayInfoOffset","u32","",0x4),
|
||||
0x80910000:("D_80910000","UNK_TYPE1","",0x1),
|
||||
0x80910001:("D_80910001","UNK_TYPE1","",0x1),
|
||||
0x809101B0:("D_809101B0","f32","",0x4),
|
||||
0x809101B4:("D_809101B4","f32","",0x4),
|
||||
0x809101B8:("D_809101B8","UNK_TYPE1","",0x1),
|
||||
|
@ -10994,9 +10989,6 @@
|
|||
0x80A0C55C:("D_80A0C55C","f32","",0x4),
|
||||
0x80A0C560:("D_80A0C560","f32","",0x4),
|
||||
0x80A0C7C0:("En_Boj_05_InitVars","UNK_TYPE1","",0x1),
|
||||
0x80A0C7E0:("enBoj05OverlayInfo","OverlayRelocationSection","",0x14),
|
||||
0x80A0C7F4:("enBoj05OverlayRelocations","u32","[4]",0x10),
|
||||
0x80A0C80C:("enBoj05OverlayInfoOffset","u32","",0x4),
|
||||
0x80A10860:("sAnimationsBombShopkeeper","UNK_PTR","",0x4),
|
||||
0x80A10890:("En_Sob1_InitVars","UNK_TYPE1","",0x1),
|
||||
0x80A108B0:("sObjectIds","UNK_TYPE2","",0x2),
|
||||
|
@ -12656,9 +12648,6 @@
|
|||
0x80A8B440:("jtbl_D_80A8B440","UNK_PTR","",0x4),
|
||||
0x80A8B478:("jtbl_D_80A8B478","UNK_PTR","",0x4),
|
||||
0x80A8B48C:("jtbl_D_80A8B48C","UNK_PTR","",0x4),
|
||||
0x80A8B4A0:("enTruOverlayInfo","OverlayRelocationSection","",0x14),
|
||||
0x80A8B4B4:("enTruOverlayRelocations","u32","[174]",0x2b8),
|
||||
0x80A8B76C:("enTruOverlayInfoOffset","u32","",0x4),
|
||||
0x80A8FE10:("sAnimations","UNK_TYPE1","",0x1),
|
||||
0x80A8FEB0:("En_Trt_InitVars","UNK_TYPE1","",0x1),
|
||||
0x80A8FED0:("sActorScale","UNK_TYPE4","",0x4),
|
||||
|
@ -13140,9 +13129,6 @@
|
|||
0x80AC027C:("jtbl_80AC027C","UNK_PTR","",0x4),
|
||||
0x80AC0300:("jtbl_80AC0300","UNK_PTR","",0x4),
|
||||
0x80AC03E4:("jtbl_80AC03E4","UNK_PTR","",0x4),
|
||||
0x80AC0400:("enMa4OverlayInfo","OverlayRelocationSection","",0x14),
|
||||
0x80AC0414:("enMa4OverlayRelocations","u32","[262]",0x418),
|
||||
0x80AC082C:("enMa4OverlayInfoOffset","u32","",0x4),
|
||||
0x80AC1090:("En_Twig_InitVars","UNK_TYPE1","",0x1),
|
||||
0x80AC10B0:("D_80AC10B0","UNK_TYPE1","",0x1),
|
||||
0x80AC10BC:("D_80AC10BC","UNK_TYPE2","",0x2),
|
||||
|
|
|
@ -1207,11 +1207,11 @@ asm/non_matchings/code/z_horse/func_800F3ED4.s,func_800F3ED4,0x800F3ED4,0x73
|
|||
asm/non_matchings/code/z_horse/func_800F40A0.s,func_800F40A0,0x800F40A0,0x2F
|
||||
asm/non_matchings/code/z_horse/func_800F415C.s,func_800F415C,0x800F415C,0x22
|
||||
asm/non_matchings/code/z_horse/func_800F41E4.s,func_800F41E4,0x800F41E4,0x2F
|
||||
asm/non_matchings/code/z_jpeg/func_800F42A0.s,func_800F42A0,0x800F42A0,0x47
|
||||
asm/non_matchings/code/z_jpeg/func_800F43BC.s,func_800F43BC,0x800F43BC,0x4E
|
||||
asm/non_matchings/code/z_jpeg/func_800F44F4.s,func_800F44F4,0x800F44F4,0x13
|
||||
asm/non_matchings/code/z_jpeg/func_800F4540.s,func_800F4540,0x800F4540,0x73
|
||||
asm/non_matchings/code/z_jpeg/func_800F470C.s,func_800F470C,0x800F470C,0xC1
|
||||
asm/non_matchings/code/z_jpeg/Jpeg_ScheduleDecoderTask.s,Jpeg_ScheduleDecoderTask,0x800F42A0,0x47
|
||||
asm/non_matchings/code/z_jpeg/Jpeg_CopyToZbuffer.s,Jpeg_CopyToZbuffer,0x800F43BC,0x4E
|
||||
asm/non_matchings/code/z_jpeg/Jpeg_GetUnalignedU16.s,Jpeg_GetUnalignedU16,0x800F44F4,0x13
|
||||
asm/non_matchings/code/z_jpeg/Jpeg_ParseMarkers.s,Jpeg_ParseMarkers,0x800F4540,0x73
|
||||
asm/non_matchings/code/z_jpeg/Jpeg_Decode.s,Jpeg_Decode,0x800F470C,0xC1
|
||||
asm/non_matchings/code/z_kaleido_setup/func_800F4A10.s,func_800F4A10,0x800F4A10,0x7F
|
||||
asm/non_matchings/code/z_kaleido_setup/func_800F4C0C.s,func_800F4C0C,0x800F4C0C,0x85
|
||||
asm/non_matchings/code/z_kaleido_setup/func_800F4E20.s,func_800F4E20,0x800F4E20,0x42
|
||||
|
@ -1578,7 +1578,7 @@ asm/non_matchings/code/z_msgevent/func_8010BF58.s,func_8010BF58,0x8010BF58,0x5A
|
|||
asm/non_matchings/code/z_nmi_buff/Nmi_Init.s,Nmi_Init,0x8010C0C0,0x29
|
||||
asm/non_matchings/code/z_nmi_buff/Nmi_SetPrenmiStart.s,Nmi_SetPrenmiStart,0x8010C164,0xE
|
||||
asm/non_matchings/code/z_nmi_buff/Nmi_GetPrenmiHasStarted.s,Nmi_GetPrenmiHasStarted,0x8010C19C,0x5
|
||||
asm/non_matchings/code/z_nmi_buff/func_8010C1B0.s,func_8010C1B0,0x8010C1B0,0x20
|
||||
asm/non_matchings/code/z_nmi_buff/MsgEvent_SendNullTask.s,MsgEvent_SendNullTask,0x8010C1B0,0x20
|
||||
asm/non_matchings/code/z_olib/OLib_Vec3fDist.s,OLib_Vec3fDist,0x8010C230,0x11
|
||||
asm/non_matchings/code/z_olib/OLib_Vec3fDistOutDiff.s,OLib_Vec3fDistOutDiff,0x8010C274,0x17
|
||||
asm/non_matchings/code/z_olib/OLib_Vec3fDistXZ.s,OLib_Vec3fDistXZ,0x8010C2D0,0xD
|
||||
|
@ -2907,10 +2907,10 @@ asm/non_matchings/code/sys_matrix/func_8018219C.s,func_8018219C,0x8018219C,0x4A
|
|||
asm/non_matchings/code/sys_matrix/func_801822C4.s,func_801822C4,0x801822C4,0x4A
|
||||
asm/non_matchings/code/sys_matrix/Matrix_InsertRotationAroundUnitVector_f.s,Matrix_InsertRotationAroundUnitVector_f,0x801823EC,0x118
|
||||
asm/non_matchings/code/sys_matrix/Matrix_InsertRotationAroundUnitVector_s.s,Matrix_InsertRotationAroundUnitVector_s,0x8018284C,0x111
|
||||
asm/non_matchings/code/sys_matrix/SysUcode_GetUCodeBoot.s,SysUcode_GetUCodeBoot,0x80182C90,0x4
|
||||
asm/non_matchings/code/sys_matrix/SysUcode_GetUCodeBootSize.s,SysUcode_GetUCodeBootSize,0x80182CA0,0x7
|
||||
asm/non_matchings/code/sys_matrix/SysUcode_GetUCode.s,SysUcode_GetUCode,0x80182CBC,0x4
|
||||
asm/non_matchings/code/sys_matrix/SysUcode_GetUCodeData.s,SysUcode_GetUCodeData,0x80182CCC,0x5
|
||||
asm/non_matchings/code/sys_ucode/SysUcode_GetUCodeBoot.s,SysUcode_GetUCodeBoot,0x80182C90,0x4
|
||||
asm/non_matchings/code/sys_ucode/SysUcode_GetUCodeBootSize.s,SysUcode_GetUCodeBootSize,0x80182CA0,0x7
|
||||
asm/non_matchings/code/sys_ucode/SysUcode_GetUCode.s,SysUcode_GetUCode,0x80182CBC,0x4
|
||||
asm/non_matchings/code/sys_ucode/SysUcode_GetUCodeData.s,SysUcode_GetUCodeData,0x80182CCC,0x5
|
||||
asm/non_matchings/code/sys_ucode/func_80182CE0.s,func_80182CE0,0x80182CE0,0xD0
|
||||
asm/non_matchings/code/sys_ucode/func_80183020.s,func_80183020,0x80183020,0xE
|
||||
asm/non_matchings/code/sys_ucode/func_80183058.s,func_80183058,0x80183058,0x6
|
||||
|
@ -3585,18 +3585,18 @@ asm/non_matchings/code/code_801A7B10/func_801A9768.s,func_801A9768,0x801A9768,0x
|
|||
asm/non_matchings/code/code_801A7B10/func_801A982C.s,func_801A982C,0x801A982C,0x63
|
||||
asm/non_matchings/code/code_801A7B10/func_801A99B8.s,func_801A99B8,0x801A99B8,0x2F
|
||||
asm/non_matchings/code/code_801A7B10/func_801A9A74.s,func_801A9A74,0x801A9A74,0x27
|
||||
asm/non_matchings/code/code_801A7B10/func_801A9B10.s,func_801A9B10,0x801A9B10,0x1A
|
||||
asm/non_matchings/code/code_801A7B10/func_801A9B78.s,func_801A9B78,0x801A9B78,0x21
|
||||
asm/non_matchings/code/code_801A7B10/func_801A9BFC.s,func_801A9BFC,0x801A9BFC,0x1B
|
||||
asm/non_matchings/code/code_801A7B10/func_801A9C68.s,func_801A9C68,0x801A9C68,0x2A
|
||||
asm/non_matchings/code/code_801A7B10/func_801A9D10.s,func_801A9D10,0x801A9D10,0x2F
|
||||
asm/non_matchings/code/code_801A7B10/func_801A9DCC.s,func_801A9DCC,0x801A9DCC,0x36
|
||||
asm/non_matchings/code/code_801A7B10/func_801A9EA4.s,func_801A9EA4,0x801A9EA4,0x2A
|
||||
asm/non_matchings/code/code_801A7B10/func_801A9F4C.s,func_801A9F4C,0x801A9F4C,0x35
|
||||
asm/non_matchings/code/code_801AA020/func_801AA020.s,func_801AA020,0x801AA020,0x8A
|
||||
asm/non_matchings/code/code_801AA020/func_801AA248.s,func_801AA248,0x801AA248,0x67
|
||||
asm/non_matchings/code/code_801AA020/func_801AA3E4.s,func_801AA3E4,0x801AA3E4,0x4F
|
||||
asm/non_matchings/code/code_801AA020/func_801AA520.s,func_801AA520,0x801AA520,0x3C
|
||||
asm/non_matchings/code/jpegutils/JpegUtils_ProcessQuantizationTable.s,JpegUtils_ProcessQuantizationTable,0x801A9B10,0x1A
|
||||
asm/non_matchings/code/jpegutils/JpegUtils_ParseHuffmanCodesLengths.s,JpegUtils_ParseHuffmanCodesLengths,0x801A9B78,0x21
|
||||
asm/non_matchings/code/jpegutils/JpegUtils_GetHuffmanCodes.s,JpegUtils_GetHuffmanCodes,0x801A9BFC,0x1B
|
||||
asm/non_matchings/code/jpegutils/JpegUtils_SetHuffmanTable.s,JpegUtils_SetHuffmanTable,0x801A9C68,0x2A
|
||||
asm/non_matchings/code/jpegutils/JpegUtils_ProcessHuffmanTableImpl.s,JpegUtils_ProcessHuffmanTableImpl,0x801A9D10,0x2F
|
||||
asm/non_matchings/code/jpegutils/JpegUtils_ProcessHuffmanTable.s,JpegUtils_ProcessHuffmanTable,0x801A9DCC,0x36
|
||||
asm/non_matchings/code/jpegutils/JpegUtils_SetHuffmanTableOld.s,JpegUtils_SetHuffmanTableOld,0x801A9EA4,0x2A
|
||||
asm/non_matchings/code/jpegutils/JpegUtils_ProcessHuffmanTableImplOld.s,JpegUtils_ProcessHuffmanTableImplOld,0x801A9F4C,0x35
|
||||
asm/non_matchings/code/jpegdecoder/JpegDecoder_Decode.s,JpegDecoder_Decode,0x801AA020,0x8A
|
||||
asm/non_matchings/code/jpegdecoder/JpegDecoder_ProcessMcu.s,JpegDecoder_ProcessMcu,0x801AA248,0x67
|
||||
asm/non_matchings/code/jpegdecoder/JpegDecoder_ParseNextSymbol.s,JpegDecoder_ParseNextSymbol,0x801AA3E4,0x4F
|
||||
asm/non_matchings/code/jpegdecoder/JpegDecoder_ReadBits.s,JpegDecoder_ReadBits,0x801AA520,0x3C
|
||||
asm/non_matchings/code/z_game_over/GameOver_Init.s,GameOver_Init,0x801AA610,0x5
|
||||
asm/non_matchings/code/z_game_over/GameOver_FadeLights.s,GameOver_FadeLights,0x801AA624,0x1A
|
||||
asm/non_matchings/code/z_game_over/GameOver_Update.s,GameOver_Update,0x801AA68C,0x105
|
||||
|
|
|
Loading…
Reference in New Issue