npc_gnd finished, movie_player almost done (#2818)

* movie_player mostly done

* d_a_npc_gnd done

* fix fshop debug match
This commit is contained in:
TakaRikka
2025-11-18 01:34:34 -08:00
committed by GitHub
parent bd2def28db
commit 638c0b968c
11 changed files with 2019 additions and 1795 deletions
+1 -1
View File
@@ -1870,7 +1870,7 @@ config.libs = [
ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_du"),
ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_fairy"),
ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_fguard"),
ActorRel(NonMatching, "d_a_npc_gnd"),
ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_gnd"),
ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_gra", extra_cflags=[DANPCF_C_HACK]),
ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_grc", extra_cflags=[DANPCF_C_HACK]),
ActorRel(NonMatching, "d_a_npc_grd"),
+22 -26
View File
@@ -19,7 +19,7 @@ struct fs_weed_s {
struct fs_tsubo_s {
/* 0x00 */ cXyz field_0x00;
/* 0x0C */ u8 field_0x0c[0x14 - 0x0c];
/* 0x14 */ J3DModel* field_0x14;
/* 0x14 */ J3DModel* model;
/* 0x18 */ u8 field_0x18[0x1C - 0x18];
/* 0x1C */ f32 field_0x1c;
/* 0x20 */ s16 field_0x20;
@@ -30,13 +30,13 @@ struct fs_tsubo_s {
struct fs_rod_s {
/* 0x00 */ cXyz field_0x00;
/* 0x0C */ u8 field_0x0C[0x14 - 0x0C];
/* 0x14 */ J3DModel* field_0x14;
/* 0x18 */ J3DModel* field_0x18[6];
/* 0x14 */ J3DModel* model;
/* 0x18 */ J3DModel* ringModel[6];
/* 0x30 */ mDoExt_3DlineMat0_c line_mat;
/* 0x4C */ int field_0x4c;
/* 0x50 */ u8 field_0x50[0x54 - 0x50];
/* 0x54 */ f32 field_0x54;
/* 0x58 */ s16 field_0x58;
/* 0x58 */ s16 rot_x;
};
struct fs_lure_s {
@@ -44,9 +44,8 @@ struct fs_lure_s {
/* 0x0C */ s16 field_0x0c;
/* 0x0E */ s16 field_0x0e;
/* 0x10 */ s16 field_0x10;
/* 0x12 */ u8 field_0x12[0x14 - 0x12];
/* 0x14 */ J3DModel* field_0x14;
/* 0x18 */ J3DModel* field_0x18[2];
/* 0x14 */ J3DModel* model;
/* 0x18 */ J3DModel* hookModel[2];
/* 0x20 */ u8 field_0x20[0x24 - 0x20];
/* 0x24 */ int field_0x24;
/* 0x28 */ f32 field_0x28;
@@ -60,18 +59,15 @@ struct fs_lure_s {
};
struct fs_koro2_s {
/* 0x00 */ J3DModel* mpModel;
/* 0x04 */ Mtx field_0x04;
/* 0x34 */ s8 field_0x34;
/* 0x35 */ u8 field_0x35[0x38 - 0x35];
/* 0x38 */ cXyz field_0x38;
/* 0x44 */ cXyz field_0x44;
/* 0x50 */ s16 field_0x50;
/* 0x52 */ u8 field_0x52[0x54 - 0x52];
/* 0x54 */ cXyz field_0x54;
/* 0x00 */ J3DModel* model;
/* 0x04 */ Mtx bgMtx;
/* 0x34 */ s8 part_id;
/* 0x38 */ cXyz pos;
/* 0x44 */ cXyz size;
/* 0x50 */ s16 rot_y;
/* 0x54 */ cXyz world_pos;
/* 0x60 */ u8 field_0x60;
/* 0x61 */ u8 field_0x61[0x64 - 0x61];
/* 0x64 */ dBgW* mpBgW;
/* 0x64 */ dBgW* bgw;
};
/**
@@ -93,12 +89,12 @@ public:
/* 0x1288 */ fs_weed_s mWeed[60];
/* 0x3F88 */ mDoExt_3DlineMat0_c field_0x3f88;
/* 0x3FA4 */ fs_tsubo_s mTsubo[2];
/* 0x3FF4 */ J3DModel* field_0x3ff4;
/* 0x3FF4 */ J3DModel* hatModel;
/* 0x3FF8 */ s16 field_0x3ff8;
/* 0x3FFA */ s16 field_0x3ffa;
/* 0x3FFC */ f32 field_0x3ffc;
/* 0x4000 */ f32 field_0x4000;
/* 0x4004 */ J3DModel* field_0x4004;
/* 0x4004 */ J3DModel* photoModel;
/* 0x4008 */ fshop_class* field_0x4008;
/* 0x400C */ u8 field_0x400c;
/* 0x400D */ u8 field_0x400d;
@@ -107,21 +103,21 @@ public:
/* 0x4014 */ cXyz field_0x4014;
/* 0x4020 */ csXyz field_0x4020;
/* 0x4028 */ J3DModel* mpA_crwaku_model;
/* 0x402C */ dBgW* field_0x402c;
/* 0x402C */ dBgW* koro2WakuBgw;
/* 0x4030 */ Mtx field_0x4030;
/* 0x4060 */ s16 field_0x4060;
/* 0x4062 */ s16 field_0x4062;
/* 0x4064 */ cXyz field_0x4064;
/* 0x4070 */ J3DModel* field_0x4070;
/* 0x4074 */ dBgS_AcchCir field_0x4074;
/* 0x40B4 */ dBgS_ObjAcch field_0x40b4;
/* 0x4070 */ J3DModel* ballModel;
/* 0x4074 */ dBgS_AcchCir ballAcchcir;
/* 0x40B4 */ dBgS_ObjAcch ballAcch;
/* 0x428C */ u8 field_0x428c;
/* 0x428D */ u8 field_0x428d;
/* 0x4290 */ fs_koro2_s mKoro2[100];
/* 0x6B30 */ J3DModel* field_0x6b30;
/* 0x6B30 */ J3DModel* canoeModel;
/* 0x6B34 */ s16 field_0x6b34;
/* 0x6B38 */ Mtx field_0x6b38;
/* 0x6B68 */ dBgW* field_0x6b68;
/* 0x6B68 */ dBgW* tableBgw;
/* 0x6B6C */ u32 field_0x6b6c[2];
/* 0x6B74 */ u8 field_0x6B74[0x6B7C - 0x6B74];
/* 0x6B7C */ u8 field_0x6b7c;
+44 -197
View File
@@ -1,106 +1,53 @@
#ifndef D_A_MOVIE_PLAYER_H
#define D_A_MOVIE_PLAYER_H
#include <dolphin/thp.h>
#include "f_op/f_op_actor.h"
#include "d/d_drawlist.h"
#ifdef __cplusplus
extern "C" {
#endif
struct daMP_THPReadBuffer {
u8* ptr;
s32 frameNumber;
BOOL isValid;
};
typedef u8 THPSample;
typedef s16 THPCoeff;
typedef f32 THPQuantTab[64];
typedef struct _THPHuffmanTab {
u8 quick[32];
u8 increment[32];
u8* Vij;
s32 maxCode[18];
s32 valPtr[18];
u8 Vij1;
u8 pad[11];
} THPHuffmanTab;
typedef struct _THPComponent {
u8 quantizationTableSelector;
u8 DCTableSelector;
u8 ACTableSelector;
THPCoeff predDC;
} THPComponent;
typedef struct _THPFileInfo {
THPQuantTab quantTabs[3];
THPHuffmanTab huffmanTabs[4];
THPComponent components[3];
u16 xPixelSize;
u16 yPixelSize;
u16 MCUsPerRow;
u16 decompressedY;
u8* c;
u32 currByte;
u32 cnt;
u8 validHuffmanTabs;
u8 RST;
u16 nMCU;
u16 currMCU;
u8* dLC[3];
} THPFileInfo;
typedef struct THPAudioRecordHeader {
u32 offsetNextChannel;
u32 sampleSize;
s16 lCoef[8][2];
s16 rCoef[8][2];
s16 lYn1;
s16 lYn2;
s16 rYn1;
s16 rYn2;
} THPAudioRecordHeader;
typedef struct THPAudioDecodeInfo {
u8* encodeData;
u32 offsetNibbles;
u8 predictor;
u8 scale;
s16 yn1;
s16 yn2;
} THPAudioDecodeInfo;
static u32 THPAudioDecode(s16* audioBuffer, u8* audioFrame, s32 flag);
static s32 __THPAudioGetNewSample(THPAudioDecodeInfo* info);
static void __THPAudioInitialize(THPAudioDecodeInfo* info, u8* ptr);
s32 __THPAudioGetNewSample(THPAudioDecodeInfo*);
void __THPAudioInitialize(THPAudioDecodeInfo*, u8*);
static void __THPSetupBuffers(void);
static u8 __THPReadFrameHeader(void);
static u8 __THPReadScaneHeader(void);
static u8 __THPReadQuantizationTable(void);
static u8 __THPReadHuffmanTableSpecification(void);
static void __THPHuffGenerateSizeTable(void);
static void __THPHuffGenerateCodeTable(void);
static void __THPHuffGenerateDecoderTables(u8 tabIndex);
static void __THPRestartDefinition(void);
static void __THPPrepBitStream(void);
static void __THPDecompressYUV(void* tileY, void* tileU, void* tileV);
static void __THPGQRRestore(void);
static void __THPDecompressiMCURow512x448(void);
static void __THPDecompressiMCURow640x480(void);
static void __THPDecompressiMCURowNxN(void);
static void __THPInverseDCTNoYPos(THPCoeff* in, u32 xPos);
static void __THPHuffDecodeDCTCompY(THPFileInfo* info, THPCoeff* block);
static void __THPHuffDecodeDCTCompU(THPFileInfo* info, THPCoeff* block);
static void __THPHuffDecodeDCTCompV(THPFileInfo* info, THPCoeff* block);
static void __THPInverseDCTY8(THPCoeff* in, u32 xPos);
static void __THPGQRSetup();
static s32 __THPHuffDecodeTab(THPFileInfo* info, THPHuffmanTab* h);
#ifdef __cplusplus
}
#endif
struct daMP_THPPlayer {
/* 0x000 */ DVDFileInfo fileInfo;
/* 0x03C */ THPHeader header;
/* 0x06C */ THPFrameCompInfo compInfo;
/* 0x080 */ THPVideoInfo videoInfo;
/* 0x08C */ THPAudioInfo audioInfo;
/* 0x09C */ void* thpWork;
/* 0x0A0 */ BOOL open;
/* 0x0A4 */ u8 state;
/* 0x0A5 */ u8 internalState;
/* 0x0A6 */ u8 playFlag;
/* 0x0A7 */ u8 audioExist;
/* 0x0A8 */ s32 dvdError;
/* 0x0AC */ s32 videoError;
/* 0x0B0 */ BOOL onMemory;
/* 0x0B4 */ u8* movieData;
/* 0x0B8 */ s32 initOffset;
/* 0x0BC */ s32 initReadSize;
/* 0x0C0 */ s32 initReadFrame;
/* 0x0C4 */ u32 curField;
/* 0x0C8 */ s64 retaceCount;
/* 0x0D0 */ s32 prevCount;
/* 0x0D4 */ s32 curCount;
/* 0x0D8 */ s32 videoDecodeCount;
/* 0x0DC */ f32 curVolume;
/* 0x0E0 */ f32 targetVolume;
/* 0x0E4 */ f32 deltaVolume;
/* 0x0E8 */ s32 rampCount;
/* 0x0EC */ s32 curAudioTrack;
/* 0x0F0 */ s32 curVideoNumber;
/* 0x0F4 */ s32 curAudioNumber;
/* 0x0F8 */ THPTextureSet* dispTextureSet;
/* 0x0FC */ THPAudioBuffer* playAudioBuffer;
/* 0x100 */ daMP_THPReadBuffer readBuffer[10];
/* 0x000 */ THPTextureSet textureSet[THP_TEXTURE_SET_COUNT];
/* 0x000 */ THPAudioBuffer audioBuffer[THP_AUDIO_BUFFER_COUNT];
};
/**
* @ingroup actors-unsorted
@@ -142,11 +89,6 @@ private:
STATIC_ASSERT(sizeof(daMP_c) == 0x580);
struct daMP_THPReadBuffer {
/* 0x00 */ void* m00;
/* 0x04 */ s32 m04;
};
class daMP_Dlst_base_c : public dDlst_base_c {
public:
/* 80878FD8 */ daMP_Dlst_base_c() {}
@@ -154,103 +96,8 @@ public:
/* 80878DB8 */ virtual void draw();
};
struct THPVideoInfo {
/* 0x00 */ u32 field_0x0;
/* 0x04 */ u32 field_0x4;
/* 0x08 */ u8 field_0x8[0x0C - 0x08];
};
struct THPAudioInfo {
/* 0x00 */ u8 field_0x0[0xC - 0x0];
/* 0x0C */ u32 field_0xc;
};
// made up
struct daMP_Player_c {
/* 0x000 */ DVDFileInfo mFileInfo;
/* 0x03C */ char* field_0x3c;
/* 0x040 */ int field_0x40;
/* 0x044 */ int field_0x44;
/* 0x048 */ int field_0x48;
/* 0x04C */ f32 field_0x4c;
/* 0x050 */ u32 mTotalFrames;
/* 0x054 */ int field_0x54;
/* 0x058 */ int field_0x58;
/* 0x05C */ int field_0x5c;
/* 0x060 */ int field_0x60;
/* 0x064 */ int field_0x64;
/* 0x068 */ u8 field_0x68[0x06C - 0x068];
struct {
u32 _0;
u8 _4;
u8 _5[0x14 - 0x5];
} /* 0x06C */ field_0x6c; // not sure if this is right
/* 0x080 */ THPVideoInfo mVideoInfo;
/* 0x08C */ THPAudioInfo mAudioInfo;
/* 0x09C */ int field_0x9c;
/* 0x0A0 */ int field_0xa0;
/* 0x0A4 */ u8 mState;
/* 0x0A5 */ u8 field_0xa5;
/* 0x0A6 */ u8 field_0xa6;
/* 0x0A7 */ u8 field_0xa7;
/* 0x0A8 */ int field_0xa8;
/* 0x0AC */ int field_0xac;
/* 0x0B0 */ int field_0xb0;
/* 0x0B4 */ int field_0xb4;
/* 0x0B8 */ int field_0xb8;
/* 0x0BC */ int field_0xbc;
/* 0x0C0 */ int field_0xc0;
/* 0x0C4 */ u8 field_0xC4[0x0C8 - 0x0C4];
/* 0x0C8 */ s64 field_0xc8;
/* 0x0D0 */ int field_0xd0;
/* 0x0D4 */ int field_0xd4;
/* 0x0D8 */ int field_0xd8;
/* 0x0DC */ f32 field_0xdc;
/* 0x0E0 */ f32 field_0xe0;
/* 0x0E4 */ f32 field_0xe4;
/* 0x0E8 */ int field_0xe8;
/* 0x0EC */ int field_0xec;
/* 0x0F0 */ int field_0xf0;
/* 0x0F4 */ int field_0xf4;
/* 0x0F8 */ int field_0xf8;
/* 0x0FC */ int field_0xfc;
/* 0x100 */ int field_0x100;
/* 0x104 */ u8 field_0x104[0x10C - 0x104];
/* 0x10C */ int field_0x10c;
/* 0x110 */ u8 field_0x110[0x118 - 0x110];
/* 0x118 */ int field_0x118;
/* 0x11C */ u8 field_0x11C[0x124 - 0x11C];
/* 0x124 */ int field_0x124;
/* 0x128 */ u8 field_0x128[0x130 - 0x128];
/* 0x130 */ int field_0x130;
/* 0x134 */ u8 field_0x134[0x13C - 0x134];
/* 0x13C */ int field_0x13c;
/* 0x140 */ u8 field_0x140[0x148 - 0x140];
/* 0x148 */ int field_0x148;
/* 0x14C */ u8 field_0x14C[0x154 - 0x14C];
/* 0x154 */ int field_0x154;
/* 0x158 */ u8 field_0x158[0x160 - 0x158];
/* 0x160 */ int field_0x160;
/* 0x164 */ u8 field_0x164[0x16C - 0x164];
/* 0x16C */ int field_0x16c;
/* 0x170 */ u8 field_0x170[0x178 - 0x170];
/* 0x178 */ int field_0x178;
/* 0x17C */ int field_0x17c;
/* 0x180 */ int field_0x180;
/* 0x184 */ u8 field_0x184[0x1A8 - 0x184];
/* 0x1A8 */ int field_0x1a8;
/* 0x1AC */ int field_0x1ac;
/* 0x1B0 */ int field_0x1b0;
/* 0x1B4 */ int field_0x1b4;
/* 0x1B8 */ int field_0x1b8;
/* 0x1BC */ int field_0x1bc;
/* 0x1C0 */ int field_0x1c0;
/* 0x1C4 */ int field_0x1c4;
/* 0x1C8 */ int field_0x1c8;
};
inline s32 daMP_NEXT_READ_SIZE(daMP_THPReadBuffer* readBuf) {
return *(s32*)readBuf->m00;
return *(s32*)readBuf->ptr;
}
void daMP_PrepareReady(int);
+8 -9
View File
@@ -72,11 +72,11 @@ public:
/* 809BCA14 */ void setCollision();
/* 809BCB48 */ int drawDbgInfo();
/* 809BCB50 */ bool afterSetMotionAnm(int, int, f32, int);
/* 809BCCE8 */ void selectAction();
/* 809BCD30 */ void chkAction(int (daNpc_Gnd_c::*)(void*));
/* 809BCD5C */ void setAction(int (daNpc_Gnd_c::*)(void*));
/* 809BCE04 */ void wait(void*);
/* 809BD050 */ void talk(void*);
/* 809BCCE8 */ int selectAction();
/* 809BCD30 */ int chkAction(int (daNpc_Gnd_c::*)(void*));
/* 809BCD5C */ int setAction(int (daNpc_Gnd_c::*)(void*));
/* 809BCE04 */ int wait(void*);
/* 809BD050 */ int talk(void*);
/* 809BE2D0 */ daNpc_Gnd_c(
daNpcT_faceMotionAnmData_c const* i_faceMotionAnmData,
daNpcT_motionAnmData_c const* i_motionAnmData,
@@ -96,16 +96,15 @@ public:
/* 809BE424 */ s32 getNeckJointNo() { return 3; }
/* 809BE42C */ s32 getBackboneJointNo() { return 1; }
static char* mCutNameList;
static char* mCutNameList[1];
static cutFunc mCutList[1];
private:
/* 0xE40 */ NPC_GND_HIO_CLASS* mpHIO;
/* 0xE44 */ dCcD_Cyl mCyl1;
/* 0xF80 */ u8 mType;
/* 0xF81 */ u8 field_0xf81[0xF84 - 0xF81];
/* 0xF84 */ u8 field_0xF84;
/* 0xF85 */ u8 field_0xF85[0xF9C - 0xF85];
/* 0xF84 */ int (daNpc_Gnd_c::*mNextAction)(void*);
/* 0xF90 */ int (daNpc_Gnd_c::*mAction)(void*);
/* 0xF9C */ u8 field_0xF9C;
};
+158
View File
@@ -0,0 +1,158 @@
#ifndef _DOLPHIN_THP_H_
#define _DOLPHIN_THP_H_
#ifdef __REVOLUTION_SDK__
#include <revolution/thp.h>
#else
#include <dolphin/types.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef u8 THPSample;
typedef s16 THPCoeff;
typedef f32 THPQuantTab[64];
typedef struct _THPHuffmanTab {
u8 quick[32];
u8 increment[32];
u8* Vij;
s32 maxCode[18];
s32 valPtr[18];
u8 Vij1;
u8 pad[11];
} THPHuffmanTab;
typedef struct _THPComponent {
u8 quantizationTableSelector;
u8 DCTableSelector;
u8 ACTableSelector;
THPCoeff predDC;
} THPComponent;
typedef struct _THPFileInfo {
THPQuantTab quantTabs[3];
THPHuffmanTab huffmanTabs[4];
THPComponent components[3];
u16 xPixelSize;
u16 yPixelSize;
u16 MCUsPerRow;
u16 decompressedY;
u8* c;
u32 currByte;
u32 cnt;
u8 validHuffmanTabs;
u8 RST;
u16 nMCU;
u16 currMCU;
u8* dLC[3];
} THPFileInfo;
typedef struct THPAudioRecordHeader {
u32 offsetNextChannel;
u32 sampleSize;
s16 lCoef[8][2];
s16 rCoef[8][2];
s16 lYn1;
s16 lYn2;
s16 rYn1;
s16 rYn2;
} THPAudioRecordHeader;
typedef struct THPAudioDecodeInfo {
u8* encodeData;
u32 offsetNibbles;
u8 predictor;
u8 scale;
s16 yn1;
s16 yn2;
} THPAudioDecodeInfo;
typedef struct THPTextureSet {
u8* ytexture;
u8* utexture;
u8* vtexture;
s32 frameNumber;
} THPTextureSet;
typedef struct THPAudioBuffer {
s16* buffer;
s16* curPtr;
u32 validSample;
} THPAudioBuffer;
typedef struct THPVideoInfo {
u32 xSize;
u32 ySize;
u32 videoType;
} THPVideoInfo;
typedef struct THPAudioInfo {
u32 sndChannels;
u32 sndFrequency;
u32 sndNumSamples;
u32 sndNumTracks;
} THPAudioInfo;
typedef struct THPFrameCompInfo {
u32 numComponents;
u8 frameComp[16];
} THPFrameCompInfo;
typedef struct THPHeader {
/* 0x00 */ char magic[4];
/* 0x04 */ u32 version;
/* 0x08 */ u32 bufsize;
/* 0x0C */ u32 audioMaxSamples;
/* 0x10 */ f32 frameRate;
/* 0x14 */ u32 numFrames;
/* 0x18 */ u32 firstFrameSize;
/* 0x1C */ u32 movieDataSize;
/* 0x20 */ u32 compInfoDataOffsets;
/* 0x24 */ u32 offsetDataOffsets;
/* 0x28 */ u32 movieDataOffsets;
/* 0x2C */ u32 finalFrameDataOffsets;
} THPHeader;
#define THP_AUDIO_BUFFER_COUNT 3
#define THP_READ_BUFFER_COUNT 10
#define THP_TEXTURE_SET_COUNT 3
static u32 THPAudioDecode(s16* audioBuffer, u8* audioFrame, s32 flag);
static s32 __THPAudioGetNewSample(THPAudioDecodeInfo* info);
static void __THPAudioInitialize(THPAudioDecodeInfo* info, u8* ptr);
s32 __THPAudioGetNewSample(THPAudioDecodeInfo*);
void __THPAudioInitialize(THPAudioDecodeInfo*, u8*);
static void __THPSetupBuffers(void);
static u8 __THPReadFrameHeader(void);
static u8 __THPReadScaneHeader(void);
static u8 __THPReadQuantizationTable(void);
static u8 __THPReadHuffmanTableSpecification(void);
static void __THPHuffGenerateSizeTable(void);
static void __THPHuffGenerateCodeTable(void);
static void __THPHuffGenerateDecoderTables(u8 tabIndex);
static void __THPRestartDefinition(void);
static void __THPPrepBitStream(void);
static void __THPDecompressYUV(void* tileY, void* tileU, void* tileV);
static void __THPGQRRestore(void);
static void __THPDecompressiMCURow512x448(void);
static void __THPDecompressiMCURow640x480(void);
static void __THPDecompressiMCURowNxN(void);
static void __THPInverseDCTNoYPos(THPCoeff* in, u32 xPos);
static void __THPHuffDecodeDCTCompY(THPFileInfo* info, THPCoeff* block);
static void __THPHuffDecodeDCTCompU(THPFileInfo* info, THPCoeff* block);
static void __THPHuffDecodeDCTCompV(THPFileInfo* info, THPCoeff* block);
static void __THPInverseDCTY8(THPCoeff* in, u32 xPos);
static void __THPGQRSetup();
static s32 __THPHuffDecodeTab(THPFileInfo* info, THPHuffmanTab* h);
#ifdef __cplusplus
}
#endif
#endif
#endif // _DOLPHIN_THP_H_
+4
View File
@@ -78,6 +78,10 @@ public:
/* 80008078 */ static void onBlure();
/* 80008330 */ static void calcFade();
static void fadeIn(f32 fadeSpeed) {
fadeOut(-fadeSpeed);
}
static JUTFader* getFader() { return mFader; }
static void setFader(JUTFader* fader) {
JFWDisplay::getManager()->setFader(fader);
+154
View File
@@ -0,0 +1,154 @@
#ifndef _REVOLUTION_THP_H_
#define _REVOLUTION_THP_H_
#include <revolution/types.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef u8 THPSample;
typedef s16 THPCoeff;
typedef f32 THPQuantTab[64];
typedef struct _THPHuffmanTab {
u8 quick[32];
u8 increment[32];
u8* Vij;
s32 maxCode[18];
s32 valPtr[18];
u8 Vij1;
u8 pad[11];
} THPHuffmanTab;
typedef struct _THPComponent {
u8 quantizationTableSelector;
u8 DCTableSelector;
u8 ACTableSelector;
THPCoeff predDC;
} THPComponent;
typedef struct _THPFileInfo {
THPQuantTab quantTabs[3];
THPHuffmanTab huffmanTabs[4];
THPComponent components[3];
u16 xPixelSize;
u16 yPixelSize;
u16 MCUsPerRow;
u16 decompressedY;
u8* c;
u32 currByte;
u32 cnt;
u8 validHuffmanTabs;
u8 RST;
u16 nMCU;
u16 currMCU;
u8* dLC[3];
} THPFileInfo;
typedef struct THPAudioRecordHeader {
u32 offsetNextChannel;
u32 sampleSize;
s16 lCoef[8][2];
s16 rCoef[8][2];
s16 lYn1;
s16 lYn2;
s16 rYn1;
s16 rYn2;
} THPAudioRecordHeader;
typedef struct THPAudioDecodeInfo {
u8* encodeData;
u32 offsetNibbles;
u8 predictor;
u8 scale;
s16 yn1;
s16 yn2;
} THPAudioDecodeInfo;
typedef struct THPTextureSet {
u8* ytexture;
u8* utexture;
u8* vtexture;
s32 frameNumber;
} THPTextureSet;
typedef struct THPAudioBuffer {
s16* buffer;
s16* curPtr;
u32 validSample;
} THPAudioBuffer;
typedef struct THPVideoInfo {
u32 xSize;
u32 ySize;
u32 videoType;
} THPVideoInfo;
typedef struct THPAudioInfo {
u32 sndChannels;
u32 sndFrequency;
u32 sndNumSamples;
u32 sndNumTracks;
} THPAudioInfo;
typedef struct THPFrameCompInfo {
u32 numComponents;
u8 frameComp[16];
} THPFrameCompInfo;
typedef struct THPHeader {
/* 0x00 */ char magic[4];
/* 0x04 */ u32 version;
/* 0x08 */ u32 bufsize;
/* 0x0C */ u32 audioMaxSamples;
/* 0x10 */ f32 frameRate;
/* 0x14 */ u32 numFrames;
/* 0x18 */ u32 firstFrameSize;
/* 0x1C */ u32 movieDataSize;
/* 0x20 */ u32 compInfoDataOffsets;
/* 0x24 */ u32 offsetDataOffsets;
/* 0x28 */ u32 movieDataOffsets;
/* 0x2C */ u32 finalFrameDataOffsets;
} THPHeader;
#define THP_AUDIO_BUFFER_COUNT 3
#define THP_READ_BUFFER_COUNT 10
#define THP_TEXTURE_SET_COUNT 3
static u32 THPAudioDecode(s16* audioBuffer, u8* audioFrame, s32 flag);
static s32 __THPAudioGetNewSample(THPAudioDecodeInfo* info);
static void __THPAudioInitialize(THPAudioDecodeInfo* info, u8* ptr);
s32 __THPAudioGetNewSample(THPAudioDecodeInfo*);
void __THPAudioInitialize(THPAudioDecodeInfo*, u8*);
static void __THPSetupBuffers(void);
static u8 __THPReadFrameHeader(void);
static u8 __THPReadScaneHeader(void);
static u8 __THPReadQuantizationTable(void);
static u8 __THPReadHuffmanTableSpecification(void);
static void __THPHuffGenerateSizeTable(void);
static void __THPHuffGenerateCodeTable(void);
static void __THPHuffGenerateDecoderTables(u8 tabIndex);
static void __THPRestartDefinition(void);
static void __THPPrepBitStream(void);
static void __THPDecompressYUV(void* tileY, void* tileU, void* tileV);
static void __THPGQRRestore(void);
static void __THPDecompressiMCURow512x448(void);
static void __THPDecompressiMCURow640x480(void);
static void __THPDecompressiMCURowNxN(void);
static void __THPInverseDCTNoYPos(THPCoeff* in, u32 xPos);
static void __THPHuffDecodeDCTCompY(THPFileInfo* info, THPCoeff* block);
static void __THPHuffDecodeDCTCompU(THPFileInfo* info, THPCoeff* block);
static void __THPHuffDecodeDCTCompV(THPFileInfo* info, THPCoeff* block);
static void __THPInverseDCTY8(THPCoeff* in, u32 xPos);
static void __THPGQRSetup();
static s32 __THPHuffDecodeTab(THPFileInfo* info, THPHuffmanTab* h);
#ifdef __cplusplus
}
#endif
#endif // _REVOLUTION_THP_H_
+322 -1004
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -1857,8 +1857,8 @@ static void demo_camera_shop(npc_henna_class* i_this) {
i_this->field_0x7b9 = 1;
for (s32 i = 0; i < 100; i++) {
koro = &fshop->field_0x4008->mKoro2[i];
if ((koro->field_0x34 >= 2 && koro->field_0x34 <= 5) ||
(koro->field_0x34 >= 8 && koro->field_0x34 <= 11))
if ((koro->part_id >= 2 && koro->part_id <= 5) ||
(koro->part_id >= 8 && koro->part_id <= 11))
{
fshop->field_0x4008->mKoro2[i].field_0x60 = 1;
}