mirror of
https://github.com/zeldaret/oot
synced 2026-05-23 15:01:47 -04:00
Merge branch 'master' into ovl_Bg_Gate_Shutter
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
IndentWidth: 4
|
||||
Language: Cpp
|
||||
UseTab: Never
|
||||
ColumnLimit: 120
|
||||
PointerAlignment: Left
|
||||
BreakBeforeBraces: Attach
|
||||
SpaceAfterCStyleCast: false
|
||||
Cpp11BracedListStyle: false
|
||||
IndentCaseLabels: true
|
||||
BinPackArguments: true
|
||||
BinPackParameters: true
|
||||
AlignAfterOpenBracket: Align
|
||||
AlignOperands: true
|
||||
BreakBeforeTernaryOperators: true
|
||||
BreakBeforeBinaryOperators: None
|
||||
AllowShortBlocksOnASingleLine: true
|
||||
AllowShortIfStatementsOnASingleLine: false
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AllowShortCaseLabelsOnASingleLine: false
|
||||
AllowShortFunctionsOnASingleLine: false
|
||||
AlignEscapedNewlines: Left
|
||||
AlignTrailingComments: true
|
||||
SortIncludes: false
|
||||
@@ -0,0 +1,5 @@
|
||||
Checks: '-*,readability-braces-around-statements'
|
||||
WarningsAsErrors: ''
|
||||
HeaderFilterRegex: '(src|include)\/.*\.h$'
|
||||
FormatStyle: 'file'
|
||||
CheckOptions:
|
||||
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
FORMAT_OPTS="-i -style=file"
|
||||
TIDY_OPTS="-p . --fix --fix-errors"
|
||||
COMPILER_OPTS="-fno-builtin -std=gnu90 -Iinclude -Isrc -D_LANGUAGE_C"
|
||||
|
||||
shopt -s globstar
|
||||
|
||||
if (( $# > 0 )); then
|
||||
echo "Formatting file(s) $*"
|
||||
echo "Running clang-format..."
|
||||
clang-format ${FORMAT_OPTS} "$@"
|
||||
echo "Running clang-tidy..."
|
||||
clang-tidy ${TIDY_OPTS} "$@" -- ${COMPILER_OPTS} &> /dev/null
|
||||
echo "Adding missing final new lines..."
|
||||
sed -i -e '$a\' "$@"
|
||||
echo "Done formatting file(s) $*"
|
||||
exit
|
||||
fi
|
||||
|
||||
echo "Formatting C files. This will take a bit"
|
||||
echo "Running clang-format..."
|
||||
clang-format ${FORMAT_OPTS} src/**/*.c
|
||||
echo "Running clang-tidy..."
|
||||
clang-tidy ${TIDY_OPTS} src/**/*.c -- ${COMPILER_OPTS} &> /dev/null
|
||||
echo "Adding missing final new lines..."
|
||||
find src/ -type f -name "*.c" -exec sed -i -e '$a\' {} \;
|
||||
echo "Done formatting all files."
|
||||
+3
-6
@@ -1,18 +1,15 @@
|
||||
#ifndef _COLOR_H_
|
||||
#define _COLOR_H_
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
u8 r, g, b;
|
||||
} Color_RGB8;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
u8 r, g, b, a;
|
||||
} Color_RGBA8;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
f32 r, g, b, a;
|
||||
} Color_RGBAf;
|
||||
|
||||
|
||||
+109
-85
@@ -26,7 +26,8 @@ void DmaMgr_ThreadEntry(void* arg0);
|
||||
s32 DmaMgr_SendRequestImpl(DmaRequest* req, u32 ram, u32 vrom, u32 size, u32 unk, OSMesgQueue* queue, OSMesg msg);
|
||||
s32 DmaMgr_SendRequest0(u32 ram, u32 vrom, u32 size);
|
||||
void DmaMgr_Start();
|
||||
s32 DmaMgr_SendRequest2(DmaRequest* req, u32 ram, u32 vrom, u32 size, u32 unk5, OSMesgQueue* queue, OSMesg msg, const char* file, s32 line);
|
||||
s32 DmaMgr_SendRequest2(DmaRequest* req, u32 ram, u32 vrom, u32 size, u32 unk5, OSMesgQueue* queue, OSMesg msg,
|
||||
const char* file, s32 line);
|
||||
s32 DmaMgr_SendRequest1(void* ram0, u32 vrom, u32 size, const char* file, s32 line);
|
||||
void* Yaz0_FirstDMA();
|
||||
void* Yaz0_NextDMA(void* curSrcPos);
|
||||
@@ -42,26 +43,29 @@ void isPrintfInit();
|
||||
void osSyncPrintfUnused(const char* fmt, ...);
|
||||
void osSyncPrintf(const char* fmt, ...);
|
||||
void rmonPrintf(const char* fmt, ...);
|
||||
u32 is_proutSyncPrintf(void* arg0, const char *str, s32 count);
|
||||
u32 is_proutSyncPrintf(void* arg0, const char* str, s32 count);
|
||||
void func_80002384(const char* exp, const char* file, u32 line);
|
||||
OSPiHandle* osDriveRomInit();
|
||||
void Yaz0_Old_DecompressImpl(Yaz0Header* hdr, u8* dst);
|
||||
void StackCheck_Init(StackEntry* entry, void* stackTop, void* stackBottom, u32 initValue, s32 minSpace, const char* name);
|
||||
void StackCheck_Init(StackEntry* entry, void* stackTop, void* stackBottom, u32 initValue, s32 minSpace,
|
||||
const char* name);
|
||||
void StackCheck_Cleanup(StackEntry* entry);
|
||||
StackStatus StackCheck_GetState(StackEntry* entry);
|
||||
u32 StackCheck_CheckAll();
|
||||
u32 StackCheck_Check(StackEntry* entry);
|
||||
float LogUtils_CheckFloatRange(const char* exp, s32 arg1, const char* var1Name, float var1, const char* var2Name, float var2, const char* var3Name, float var3);
|
||||
s32 LogUtils_CheckIntRange(const char* exp, s32 arg1, const char* var1Name, s32 var1, const char* var2Name, s32 var2, const char* var3Name, s32 var3);
|
||||
float LogUtils_CheckFloatRange(const char* exp, s32 arg1, const char* var1Name, float var1, const char* var2Name,
|
||||
float var2, const char* var3Name, float var3);
|
||||
s32 LogUtils_CheckIntRange(const char* exp, s32 arg1, const char* var1Name, s32 var1, const char* var2Name, s32 var2,
|
||||
const char* var3Name, s32 var3);
|
||||
void LogUtils_LogHexDump(void* ptr, s32 size0);
|
||||
void LogUtils_LogPointer(s32 value, u32 max, void* ptr, const char *name, const char *file, s32 line);
|
||||
void LogUtils_LogPointer(s32 value, u32 max, void* ptr, const char* name, const char* file, s32 line);
|
||||
void LogUtils_CheckBoundary(const char* name, s32 value, s32 unk, const char* file, s32 line);
|
||||
void LogUtils_CheckNullPointer(const char* exp, void* ptr, const char* file, s32 line);
|
||||
void LogUtils_CheckValidPointer(const char* exp, void* ptr0, const char* file, s32 line);
|
||||
void LogUtils_LogThreadId(const char* name, s32 line);
|
||||
void LogUtils_HungupThread(const char* name, s32 line);
|
||||
void LogUtils_ResetHungup();
|
||||
char* proutSprintf(char* dst, const char *fmt, size_t size);
|
||||
char* proutSprintf(char* dst, const char* fmt, size_t size);
|
||||
s32 vsprintf(char* dst, const char* fmt, va_list args);
|
||||
s32 sprintf(char* dst, const char* fmt, ...);
|
||||
void __osPiCreateAccessQueue(void);
|
||||
@@ -88,55 +92,55 @@ void __osExceptionPreamble();
|
||||
// ? __osException(?);
|
||||
void __osEnqueueAndYield(OSThread**);
|
||||
void __osEnqueueThread(OSThread**, OSThread*);
|
||||
OSThread *__osPopThread(OSThread**);
|
||||
OSThread* __osPopThread(OSThread**);
|
||||
// ? __osNop(?);
|
||||
void __osDispatchThread();
|
||||
void __osCleanupThread(void);
|
||||
void __osDequeueThread(OSThread **queue, OSThread *thread);
|
||||
void osDestroyThread(OSThread *thread);
|
||||
void bzero(void *__s, u32 __n);
|
||||
void __osDequeueThread(OSThread** queue, OSThread* thread);
|
||||
void osDestroyThread(OSThread* thread);
|
||||
void bzero(void* __s, u32 __n);
|
||||
void osCreateThread(OSThread* thread, OSId id, void (*entry)(void*), void* arg, void* sp, OSPri pri);
|
||||
void __osSetSR(u32);
|
||||
u32 __osGetSR();
|
||||
void osWritebackDCache(void *vaddr, s32 nbytes);
|
||||
void osWritebackDCache(void* vaddr, s32 nbytes);
|
||||
void* osViGetNextFramebuffer();
|
||||
void osCreatePiManager(OSPri pri, OSMesgQueue *cmdQ, OSMesg *cmdBuf, s32 cmdMsgCnt);
|
||||
void osCreatePiManager(OSPri pri, OSMesgQueue* cmdQ, OSMesg* cmdBuf, s32 cmdMsgCnt);
|
||||
void __osDevMgrMain(void* arg);
|
||||
s32 __osPiRawStartDma(s32 dir, u32 cart_addr, void *dram_addr, size_t size);
|
||||
s32 __osPiRawStartDma(s32 dir, u32 cart_addr, void* dram_addr, size_t size);
|
||||
u32 osVirtualToPhysical(void* vaddr);
|
||||
void osViBlack(u8 active);
|
||||
s32 __osSiRawReadIo(void *a0, u32 *a1);
|
||||
s32 __osSiRawReadIo(void* a0, u32* a1);
|
||||
OSId osGetThreadId(OSThread* thread);
|
||||
OSIntMask osSetIntMask(OSIntMask);
|
||||
void osViSetMode(OSViMode *mode);
|
||||
u32 __osProbeTLB(void *);
|
||||
void osViSetMode(OSViMode* mode);
|
||||
u32 __osProbeTLB(void*);
|
||||
u32 osGetMemSize(void);
|
||||
void osSetEventMesg(OSEvent e, OSMesgQueue *mq, OSMesg msg);
|
||||
s32 _Printf(char *(*pfn)(char *, const char *, size_t), char *arg, const char *fmt, va_list ap);
|
||||
void osSetEventMesg(OSEvent e, OSMesgQueue* mq, OSMesg msg);
|
||||
s32 _Printf(char* (*pfn)(char*, const char*, size_t), char* arg, const char* fmt, va_list ap);
|
||||
void osUnmapTLBAll(void);
|
||||
s32 osEPiStartDma(OSPiHandle* handle, OSIoMesg* mb, s32 direction);
|
||||
const u8 *strchr(const u8 *str, s32 ch);
|
||||
size_t strlen(const u8 *str);
|
||||
void *memcpy(void *dst, const void *src, size_t size);
|
||||
const u8* strchr(const u8* str, s32 ch);
|
||||
size_t strlen(const u8* str);
|
||||
void* memcpy(void* dst, const void* src, size_t size);
|
||||
void osInvalICache(void* vaddr, s32 nbytes);
|
||||
void osCreateMesgQueue(OSMesgQueue* mq, OSMesg* msg, s32 count);
|
||||
void osInvalDCache(void* vaddr, s32 nbytes);
|
||||
u32 __osSiDeviceBusy();
|
||||
void osSetThreadPri(OSThread* thread, OSPri pri);
|
||||
OSPri osGetThreadPri(OSThread* thread);
|
||||
s32 __osEPiRawReadIo(OSPiHandle *handle, u32 devAddr, u32 *data);
|
||||
void osViSwapBuffer(void *vaddr);
|
||||
s32 __osEPiRawStartDma(OSPiHandle *handle, s32 direction, u32 cartAddr, void* dramAddr, size_t size);
|
||||
u32 bcmp(void *__sl,void *__s2,u32 __n);
|
||||
s32 __osEPiRawReadIo(OSPiHandle* handle, u32 devAddr, u32* data);
|
||||
void osViSwapBuffer(void* vaddr);
|
||||
s32 __osEPiRawStartDma(OSPiHandle* handle, s32 direction, u32 cartAddr, void* dramAddr, size_t size);
|
||||
u32 bcmp(void* __sl, void* __s2, u32 __n);
|
||||
OSTime osGetTime(void);
|
||||
void __osTimerServicesInit();
|
||||
void __osTimerInterrupt();
|
||||
void __osSetTimerIntr(OSTime tim);
|
||||
OSTime __osInsertTimer(OSTimer *a0);
|
||||
OSTime __osInsertTimer(OSTimer* a0);
|
||||
u32 osGetCount(void);
|
||||
void __osSetGlobalIntMask(u32 mask);
|
||||
void __osSetCompare(u32);
|
||||
void* bcopy(void *__src,void *__dest,u32 __n);
|
||||
void* bcopy(void* __src, void* __dest, u32 __n);
|
||||
void __osResetGlobalIntMask(u32 mask);
|
||||
s32 __osDisableInt(void);
|
||||
void __osRestoreInt(s32);
|
||||
@@ -151,9 +155,9 @@ u32 __osGetFpcCsr();
|
||||
s32 osEPiWriteIo(OSPiHandle* handle, u32 devAddr, u32 data);
|
||||
void osMapTLBRdb(void);
|
||||
u32 __osGetCause();
|
||||
s32 __osEPiRawWriteIo(OSPiHandle *handle, u32 devAddr, u32 data);
|
||||
s32 __osEPiRawWriteIo(OSPiHandle* handle, u32 devAddr, u32 data);
|
||||
void osCreateViManager(OSPri pri);
|
||||
void viMgrMain(void *vargs);
|
||||
void viMgrMain(void* vargs);
|
||||
OSViContext* __osViGetCurrentContext();
|
||||
void osStartThread(OSThread* thread);
|
||||
void osViSetYScale(float scale);
|
||||
@@ -223,8 +227,8 @@ void func_80028B74(GlobalContext*, Vec3f*, UNK_PTR, UNK_PTR, Color_RGB8*, Color_
|
||||
// ? func_80028FD8(?);
|
||||
// ? func_80029060(?);
|
||||
void Effect_SpawnFragment(GlobalContext* globalCtx, Vec3f* burstDepthY, Vec3f* burstDepthX, Vec3f* burstOrigin,
|
||||
s16 gravityInfluence, s16 u0, s16 rotSpeed, s16 burstVel, u8 u1, s16 scale, u8 u2,
|
||||
s16 jitter, s32 duration, s16 u3, s16 objNumber, u32 dList);
|
||||
s16 gravityInfluence, s16 u0, s16 rotSpeed, s16 burstVel, u8 u1, s16 scale, u8 u2, s16 jitter,
|
||||
s32 duration, s16 u3, s16 objNumber, u32 dList);
|
||||
// ? func_800292DC(?);
|
||||
// ? func_80029320(?);
|
||||
// ? func_80029444(?);
|
||||
@@ -238,7 +242,8 @@ void Effect_SpawnFragment(GlobalContext* globalCtx, Vec3f* burstDepthY, Vec3f* b
|
||||
// ? func_8002A32C(?);
|
||||
// ? func_8002A3C4(?);
|
||||
void func_8002A65C(GlobalContext* globalCtx, Actor* actor, Vec3f* pos, u32 arg3, u32 arg4);
|
||||
void func_8002A6B8(GlobalContext* globalCtx, Vec3f* pos, Vec3f* arg2, Vec3f* arg3, u32 arg4, s32 arg5, u32 arg6, u32 arg7, u32 arg8, u32 arg9, u32 arg10, u32 arg11, u32 arg12, u32 arg13, u32 arg14, u32 arg15);
|
||||
void func_8002A6B8(GlobalContext* globalCtx, Vec3f* pos, Vec3f* arg2, Vec3f* arg3, u32 arg4, s32 arg5, u32 arg6,
|
||||
u32 arg7, u32 arg8, u32 arg9, u32 arg10, u32 arg11, u32 arg12, u32 arg13, u32 arg14, u32 arg15);
|
||||
// ? func_8002A894(?);
|
||||
// ? func_8002A95C(?);
|
||||
// ? func_8002A9F4(?);
|
||||
@@ -268,10 +273,10 @@ void Flags_SetTempClear(GlobalContext* globalCtx, s32 flag);
|
||||
void Flags_UnsetTempClear(GlobalContext* globalCtx, s32 flag);
|
||||
s32 Flags_GetCollectible(GlobalContext* globalCtx, s32 flag);
|
||||
void Flags_SetCollectible(GlobalContext* globalCtx, s32 flag);
|
||||
void TitleCard_InitBossName(GlobalContext* globalCtx, TitleCardContext* titleCtx, u32 texture,
|
||||
s16 arg3, s16 arg4, u8 arg5, u8 arg6);
|
||||
void TitleCard_InitPlaceName(GlobalContext* globalCtx, TitleCardContext* titleCtx, u32 texture,
|
||||
s32 arg3, s32 arg4, s32 arg5, s32 arg6, s32 arg7);
|
||||
void TitleCard_InitBossName(GlobalContext* globalCtx, TitleCardContext* titleCtx, u32 texture, s16 arg3, s16 arg4,
|
||||
u8 arg5, u8 arg6);
|
||||
void TitleCard_InitPlaceName(GlobalContext* globalCtx, TitleCardContext* titleCtx, u32 texture, s32 arg3, s32 arg4,
|
||||
s32 arg5, s32 arg6, s32 arg7);
|
||||
s32 func_8002D53C(GlobalContext* globalCtx, TitleCardContext* titleCtx);
|
||||
void Actor_Kill(Actor* actor);
|
||||
void Actor_SetHeight(Actor* actor, f32 offset);
|
||||
@@ -357,18 +362,18 @@ void func_800304DC(GlobalContext* globalCtx, ActorContext* actorCtx, ActorEntry*
|
||||
void Actor_UpdateAll(GlobalContext* globalCtx, ActorContext* actorCtx);
|
||||
s32 func_800314D4(GlobalContext* globalCtx, Actor* actorB, Vec3f* arg2, f32 arg3);
|
||||
void func_80031B14(GlobalContext* globalCtx, ActorContext* actorCtx);
|
||||
Actor* Actor_Spawn(ActorContext* actorCtx, GlobalContext* globalCtx, s16 actorId,
|
||||
f32 posX, f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ, s16 params);
|
||||
Actor* Actor_SpawnAttached(ActorContext* actorCtx, Actor* attachedTo, GlobalContext* globalCtx, s16 actorId,
|
||||
f32 posX, f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ, s16 params);
|
||||
Actor* Actor_Spawn(ActorContext* actorCtx, GlobalContext* globalCtx, s16 actorId, f32 posX, f32 posY, f32 posZ,
|
||||
s16 rotX, s16 rotY, s16 rotZ, s16 params);
|
||||
Actor* Actor_SpawnAttached(ActorContext* actorCtx, Actor* attachedTo, GlobalContext* globalCtx, s16 actorId, f32 posX,
|
||||
f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ, s16 params);
|
||||
void Actor_SpawnTransitionActors(GlobalContext* globalCtx, ActorContext* actorCtx);
|
||||
Actor* Actor_SpawnEntry(ActorContext* actorCtx, ActorEntry* actorEntry, GlobalContext* globalCtx);
|
||||
Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, GlobalContext* globalCtx);
|
||||
Actor* func_80032AF0(GlobalContext* globalCtx, ActorContext* actorCtx, Actor** actorPtr, Player* player);
|
||||
Actor* Actor_Find(ActorContext* actorCtx, s32 actorId, s32 actorType);
|
||||
void func_80032C7C(GlobalContext* globalCtx, Actor* actor);
|
||||
void func_80033260(GlobalContext* globalCtx, Actor* actor, Vec3f* arg2, f32 arg3,
|
||||
s32 arg4, f32 arg5, s16 arg6, s16 arg7, u8 arg8);
|
||||
void func_80033260(GlobalContext* globalCtx, Actor* actor, Vec3f* arg2, f32 arg3, s32 arg4, f32 arg5, s16 arg6,
|
||||
s16 arg7, u8 arg8);
|
||||
void func_80033480(GlobalContext* globalCtx, Vec3f* arg1, f32 arg2, s32 arg3, s16 arg4, s16 arg5, u8 arg6);
|
||||
Actor* func_80033640(GlobalContext* globalCtx, Collider* collider);
|
||||
Actor* func_80033684(GlobalContext* globalCtx, Actor* explosiveActor);
|
||||
@@ -389,10 +394,13 @@ void func_8003424C(GlobalContext* globalCtx, Vec3f* arg1);
|
||||
void func_8003426C(Actor* actor, s16 arg1, s16 arg2, s16 arg3, s16 arg4);
|
||||
Hilite* func_800342EC(Vec3f* object, GlobalContext* globalCtx);
|
||||
Hilite* func_8003435C(Vec3f* object, GlobalContext* globalCtx);
|
||||
s32 func_800343CC(GlobalContext* globalCtx, Actor* actor, s16* arg2, f32 arg3, u16 (*unkFunc1)(GlobalContext*, Actor*), s16 (*unkFunc2)(GlobalContext*, Actor*));
|
||||
s32 func_800343CC(GlobalContext* globalCtx, Actor* actor, s16* arg2, f32 arg3, u16 (*unkFunc1)(GlobalContext*, Actor*),
|
||||
s16 (*unkFunc2)(GlobalContext*, Actor*));
|
||||
s16 func_800347E8(s16 arg0);
|
||||
void func_80034BA0(GlobalContext* globalCtx, SkelAnime* skelAnime, void* unkFunc1, void* unkFunc2, Actor* actor, s16 alpha);
|
||||
void func_80034CC4(GlobalContext* globalCtx, SkelAnime* skelAnime, void* unkFunc1, void* unkFunc2, Actor* actor, s16 alpha);
|
||||
void func_80034BA0(GlobalContext* globalCtx, SkelAnime* skelAnime, void* unkFunc1, void* unkFunc2, Actor* actor,
|
||||
s16 alpha);
|
||||
void func_80034CC4(GlobalContext* globalCtx, SkelAnime* skelAnime, void* unkFunc1, void* unkFunc2, Actor* actor,
|
||||
s16 alpha);
|
||||
void func_80034EC0(SkelAnime* skelAnime, struct_80034EC0_Entry* arg1, s32 arg2);
|
||||
void Actor_Noop(Actor* actor, GlobalContext* globalCtx);
|
||||
void Draw_DListOpa(GlobalContext* globalCtx, u32 dlist);
|
||||
@@ -649,7 +657,7 @@ s16 func_8005A9F4(Camera* camera);
|
||||
// ? func_8005AFB4(?);
|
||||
// ? func_8005B044(?);
|
||||
// ? func_8005B1A4(?);
|
||||
s32 CollisionBtlTbl_Get(s32 index);
|
||||
s32 CollisionBtlTbl_Get(s32 index);
|
||||
// ? func_8005B280(?);
|
||||
// ? func_8005B2AC(?);
|
||||
// ? func_8005B65C(?);
|
||||
@@ -688,7 +696,8 @@ s32 func_8005C328(GlobalContext* globalCtx, ColliderDimensions* dest, ColliderDi
|
||||
s32 ActorCollider_AllocCylinder(GlobalContext* globalCtx, ColliderCylinderMain* collision);
|
||||
s32 ActorCollider_FreeCylinder(GlobalContext* globalCtx, ColliderCylinderMain* collision);
|
||||
s32 func_8005C3F4(GlobalContext* globalCtx, ColliderCylinderMain* collision, ColliderCylinderInit* arg2);
|
||||
s32 ActorCollider_InitCylinder(GlobalContext* globalCtx, ColliderCylinderMain* collision, Actor* actor, ColliderCylinderInit* src);
|
||||
s32 ActorCollider_InitCylinder(GlobalContext* globalCtx, ColliderCylinderMain* collision, Actor* actor,
|
||||
ColliderCylinderInit* src);
|
||||
s32 func_8005C508(GlobalContext* globalCtx, ColliderCylinderMain* collision);
|
||||
s32 func_8005C540(GlobalContext* globalCtx, ColliderCylinderMain* collision);
|
||||
s32 func_8005C578(GlobalContext* globalCtx, ColliderCylinderMain* collision);
|
||||
@@ -721,9 +730,12 @@ void func_8005D400(UNK_TYPE, UNK_TYPE);
|
||||
// ? func_8005D40C(?);
|
||||
// ? func_8005D4DC(?);
|
||||
// ? func_8005D62C(?);
|
||||
s32 Actor_CollisionCheck_SetAT(GlobalContext* globalCtx, SubGlobalContext11E60* simpleBodyGroups, ColliderCylinderMain* collision);
|
||||
s32 Actor_CollisionCheck_SetAC(GlobalContext* globalCtx, SubGlobalContext11E60* simpleBodyGroups, ColliderCylinderMain* collision);
|
||||
s32 Actor_CollisionCheck_SetOT(GlobalContext* globalCtx, SubGlobalContext11E60* simpleBodyGroups, ColliderCylinderMain* collision);
|
||||
s32 Actor_CollisionCheck_SetAT(GlobalContext* globalCtx, SubGlobalContext11E60* simpleBodyGroups,
|
||||
ColliderCylinderMain* collision);
|
||||
s32 Actor_CollisionCheck_SetAC(GlobalContext* globalCtx, SubGlobalContext11E60* simpleBodyGroups,
|
||||
ColliderCylinderMain* collision);
|
||||
s32 Actor_CollisionCheck_SetOT(GlobalContext* globalCtx, SubGlobalContext11E60* simpleBodyGroups,
|
||||
ColliderCylinderMain* collision);
|
||||
// ? func_8005DF2C(?);
|
||||
// ? func_8005DF50(?);
|
||||
// ? func_8005DF74(?);
|
||||
@@ -744,8 +756,8 @@ s32 Actor_CollisionCheck_SetOT(GlobalContext* globalCtx, SubGlobalContext11E60*
|
||||
// ? func_80061C98(?);
|
||||
// ? func_80061E48(?);
|
||||
// ? func_80061E8C(?);
|
||||
void func_80061ED4(SubActorStruct98 *sub98, ActorDamageChart *damageChart, SubActor98Init *subActor98Init);
|
||||
void func_80061EFC(SubActorStruct98 *sub98, ActorDamageChart *damageChart, SubActor98Init *subActor98Init);
|
||||
void func_80061ED4(SubActorStruct98* sub98, ActorDamageChart* damageChart, SubActor98Init* subActor98Init);
|
||||
void func_80061EFC(SubActorStruct98* sub98, ActorDamageChart* damageChart, SubActor98Init* subActor98Init);
|
||||
// ? func_80061F64(?);
|
||||
// ? func_800622E4(?);
|
||||
// ? func_80062530(?);
|
||||
@@ -768,9 +780,9 @@ void func_8006375C(s32 arg0, s32 arg1, float* d_80855320);
|
||||
// ? func_80063C04(?);
|
||||
// ? func_80063D7C(?);
|
||||
void DebugDisplay_Init(void);
|
||||
DebugDispObject* DebugDisplay_AddObject(f32 posX, f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ,
|
||||
f32 scaleX, f32 scaleY, f32 scaleZ, u8 red, u8 green, u8 blue, u8 alpha,
|
||||
s16 type, GraphicsContext* gfxCtx);
|
||||
DebugDispObject* DebugDisplay_AddObject(f32 posX, f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ, f32 scaleX,
|
||||
f32 scaleY, f32 scaleZ, u8 red, u8 green, u8 blue, u8 alpha, s16 type,
|
||||
GraphicsContext* gfxCtx);
|
||||
void DebugDisplay_DrawObjects(GlobalContext* globalCtx);
|
||||
void func_8006450C(GlobalContext* globalCtx, CutsceneContext* csCtx);
|
||||
void func_80064534(GlobalContext* globalCtx, CutsceneContext* csCtx);
|
||||
@@ -884,9 +896,12 @@ void Health_InitData(GlobalContext* globalCtx);
|
||||
void Health_UpdateData(GlobalContext* globalCtx);
|
||||
void Interface_DrawHealth(GlobalContext* globalCtx);
|
||||
void Health_HandleCriticalAlarm(GlobalContext* globalCtx);
|
||||
void Lights_InitPositionalLight(LightInfoPositional* info, s16 posX, s16 posY, s16 posZ, u8 red, u8 green, u8 blue, s16 radius, u32 type);
|
||||
void Lights_InitType0PositionalLight(LightInfoPositional* info, s16 posX, s16 posY, s16 posZ, u8 red, u8 green, u8 blue, s16 radius);
|
||||
void Lights_InitType2PositionalLight(LightInfoPositional* info, s16 posX, s16 posY, s16 posZ, u8 red, u8 green, u8 blue, s16 radius);
|
||||
void Lights_InitPositionalLight(LightInfoPositional* info, s16 posX, s16 posY, s16 posZ, u8 red, u8 green, u8 blue,
|
||||
s16 radius, u32 type);
|
||||
void Lights_InitType0PositionalLight(LightInfoPositional* info, s16 posX, s16 posY, s16 posZ, u8 red, u8 green, u8 blue,
|
||||
s16 radius);
|
||||
void Lights_InitType2PositionalLight(LightInfoPositional* info, s16 posX, s16 posY, s16 posZ, u8 red, u8 green, u8 blue,
|
||||
s16 radius);
|
||||
void Lights_SetPositionalLightColorAndRadius(LightInfoPositional* info, u8 red, u8 green, u8 blue, s16 radius);
|
||||
void Lights_InitDirectional(LightInfoDirectional* info, s8 dirX, s8 dirY, s8 dirZ, u8 red, u8 green, u8 blue);
|
||||
void Lights_MapperInit(LightMapper* mapper, u8 red, u8 green, u8 blue);
|
||||
@@ -1066,7 +1081,7 @@ void func_80093D18(GraphicsContext* gfxCtx);
|
||||
void func_80093D84(GraphicsContext* gfxCtx);
|
||||
// ? func_80093F34(?);
|
||||
// ? func_80093F58(?);
|
||||
void func_80094044(GraphicsContext *gfxCtx);
|
||||
void func_80094044(GraphicsContext* gfxCtx);
|
||||
// ? func_800940B0(?);
|
||||
// ? func_800942F0(?);
|
||||
// ? func_8009435C(?);
|
||||
@@ -1082,8 +1097,10 @@ Gfx* func_800946E4(Gfx* a0);
|
||||
// ? func_80094DB8(?);
|
||||
Gfx* func_80094E78(GraphicsContext* gfxCtx, u32 x, u32 y);
|
||||
Gfx* Draw_TexScroll(GraphicsContext* gfxCtx, u32 x, u32 y, s32 width, s32 height);
|
||||
Gfx* Draw_TwoTexScroll(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1, s32 tile2, u32 x2, u32 y2, s32 width2, s32 height2);
|
||||
Gfx* Draw_TwoTexScrollEnvColor(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1, s32 tile2, u32 x2, u32 y2, s32 width2, s32 height2, s32 red, s32 green, s32 blue, s32 alpha);
|
||||
Gfx* Draw_TwoTexScroll(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1, s32 tile2, u32 x2,
|
||||
u32 y2, s32 width2, s32 height2);
|
||||
Gfx* Draw_TwoTexScrollEnvColor(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1, s32 tile2,
|
||||
u32 x2, u32 y2, s32 width2, s32 height2, s32 red, s32 green, s32 blue, s32 alpha);
|
||||
// ? func_80095248(?);
|
||||
void func_80095AA0(GlobalContext* globalCtx, Room* room, UNK_TYPE arg2, UNK_TYPE arg3);
|
||||
// ? func_8009638C(?);
|
||||
@@ -1116,15 +1133,18 @@ void Scene_Draw(GlobalContext* globalCtx);
|
||||
// ? func_800A0D94(?);
|
||||
// ? func_800A106C(?);
|
||||
// ? func_800A1344(?);
|
||||
void SkelAnime_Draw(GlobalContext* globalCtx, u32 limbIndex, u32 adt, u8 limbDListCnt, void* internal0, void* internal1);
|
||||
void SkelAnime_Draw(GlobalContext* globalCtx, u32 limbIndex, u32 adt, u8 limbDListCnt, void* internal0,
|
||||
void* internal1);
|
||||
// ? func_800A180C(?);
|
||||
void func_800A1AC8(GlobalContext *globalCtx, u32 limbIndex, u32 actorDrawTbl, u32 dListCount, void* posUpdateFunc, void *drawFunc, Actor* actor);
|
||||
void func_800A1AC8(GlobalContext* globalCtx, u32 limbIndex, u32 actorDrawTbl, u32 dListCount, void* posUpdateFunc,
|
||||
void* drawFunc, Actor* actor);
|
||||
// ? func_800A1D8C(?);
|
||||
// ? func_800A1FC8(?);
|
||||
s32 SkelAnime_GetFrameCount(u32 animation);
|
||||
// ? func_800A2044(?);
|
||||
// ? func_800A24A0(?);
|
||||
Gfx* func_800A273C(GlobalContext* globalCtx, u32 limbIndex, u32 adt, u8 limbDListCnt, void* internal0, void* internal1, Actor* actor, Gfx* gfx);
|
||||
Gfx* func_800A273C(GlobalContext* globalCtx, u32 limbIndex, u32 adt, u8 limbDListCnt, void* internal0, void* internal1,
|
||||
Actor* actor, Gfx* gfx);
|
||||
// ? func_800A2E70(?);
|
||||
// ? func_800A32EC(?);
|
||||
// ? func_800A3334(?);
|
||||
@@ -1139,8 +1159,10 @@ Gfx* func_800A273C(GlobalContext* globalCtx, u32 limbIndex, u32 adt, u8 limbDLis
|
||||
// ? func_800A3F08(?);
|
||||
// ? func_800A3D70(?);
|
||||
// ? func_800A4478(?);
|
||||
void SkelAnime_Init(GlobalContext* globalCtx, SkelAnime* skelAnime, u32 skeleton, u32 animation, u16* unk0, u16* unk1, u8 unk2);
|
||||
void func_800A46F8(GlobalContext* globalCtx, SkelAnime* skelAnime, u32 skeleton, u32 animation, u16* unk0, u16* unk1, u8 unk2);
|
||||
void SkelAnime_Init(GlobalContext* globalCtx, SkelAnime* skelAnime, u32 skeleton, u32 animation, u16* unk0, u16* unk1,
|
||||
u8 unk2);
|
||||
void func_800A46F8(GlobalContext* globalCtx, SkelAnime* skelAnime, u32 skeleton, u32 animation, u16* unk0, u16* unk1,
|
||||
u8 unk2);
|
||||
// ? func_800A4A20(?);
|
||||
// ? func_800A4AD8(?);
|
||||
// ? func_800A4D9C(?);
|
||||
@@ -1150,10 +1172,11 @@ void func_800A46F8(GlobalContext* globalCtx, SkelAnime* skelAnime, u32 skeleton,
|
||||
s32 SkelAnime_FrameUpdateMatrix(SkelAnime* skelAnime);
|
||||
// ? func_800A4C58(?);
|
||||
// ? func_800A4FE4(?);
|
||||
void SkelAnime_ChangeAnimation(SkelAnime* skelAnime, u32 animation, f32 playbackSpeed, f32 unk0, f32 frameCount, u8 unk1, f32 transitionRate);
|
||||
void func_800A51E8(SkelAnime *skelAnime, u32 animation);
|
||||
void func_800A5240(SkelAnime *skelAnime, u32 animation, f32 unk0);
|
||||
void func_800A529C(SkelAnime *skelAnime, u32 animation, f32 unk0, Actor *actor);
|
||||
void SkelAnime_ChangeAnimation(SkelAnime* skelAnime, u32 animation, f32 playbackSpeed, f32 unk0, f32 frameCount,
|
||||
u8 unk1, f32 transitionRate);
|
||||
void func_800A51E8(SkelAnime* skelAnime, u32 animation);
|
||||
void func_800A5240(SkelAnime* skelAnime, u32 animation, f32 unk0);
|
||||
void func_800A529C(SkelAnime* skelAnime, u32 animation, f32 unk0, Actor* actor);
|
||||
// ? func_800A52F8(?);
|
||||
// ? func_800A54FC(?);
|
||||
s32 func_800A56C8(SkelAnime* skelAnime, f32 arg1);
|
||||
@@ -1348,7 +1371,7 @@ void KaleidoScopeCall_LoadPlayer();
|
||||
void KaleidoScopeCall_Init(GlobalContext* globalCtx);
|
||||
void KaleidoScopeCall_Destroy(GlobalContext* globalCtx);
|
||||
void KaleidoScopeCall_Update(GlobalContext* globalCtx);
|
||||
void KaleidoScopeCall_Draw(GlobalContext *globalCtx);
|
||||
void KaleidoScopeCall_Draw(GlobalContext* globalCtx);
|
||||
// ? func_800BC450(?);
|
||||
// ? func_800BC490(?);
|
||||
s32 func_800BC56C(GlobalContext*, s16);
|
||||
@@ -1379,7 +1402,7 @@ void func_800C0704(GlobalContext*, s16, f32);
|
||||
// ? func_800C078C(?);
|
||||
// ? func_800C0808(?);
|
||||
// ? func_800C0874(?);
|
||||
void func_800C0C88(GlobalContext *globalCtx);
|
||||
void func_800C0C88(GlobalContext* globalCtx);
|
||||
// ? func_800C0A44(?);
|
||||
// ? func_800C0A88(?);
|
||||
void func_800C0AF4(GlobalContext*, s8, s16);
|
||||
@@ -1479,7 +1502,7 @@ void* Graph_Alloc(GraphicsContext* gfxCtx, size_t size);
|
||||
void func_800C6AC4(Gfx** a0, GraphicsContext* gfxCtx, char* file, s32 line);
|
||||
void func_800C6B54(Gfx** a0, GraphicsContext* gfxCtx, char* file, s32 line);
|
||||
Gfx* func_800C6C20(Gfx* a0);
|
||||
Gfx* func_800C6C28(Gfx* a0, Gfx* dlist); //branch dlist
|
||||
Gfx* func_800C6C28(Gfx* a0, Gfx* dlist); // branch dlist
|
||||
// ? func_800C6C3C(?);
|
||||
ListAlloc* ListAlloc_Init(ListAlloc* this);
|
||||
void* ListAlloc_Alloc(ListAlloc* this, u32 size);
|
||||
@@ -1499,7 +1522,7 @@ void Main(void*);
|
||||
// ? func_800C7C14(?);
|
||||
// ? func_800C7DD0(?);
|
||||
void func_800C7E08(Input*, u32);
|
||||
//void PadMgr_Init(PadMgr* padmgr, OSMesg mesg, UNK_TYPE arg2, OSId id, OSPri priority, void* stack);
|
||||
// void PadMgr_Init(PadMgr* padmgr, OSMesg mesg, UNK_TYPE arg2, OSId id, OSPri priority, void* stack);
|
||||
// ? func_800C82A0(?);
|
||||
// ? func_800C84E4(?);
|
||||
// ? func_800C8534(?);
|
||||
@@ -1649,7 +1672,7 @@ void IrqMgr_AddClient(IrqMgr* this, IrqMgrClient* c, OSMesgQueue* msgQ);
|
||||
void IrqMgr_RemoveClient(IrqMgr* this, IrqMgrClient* c);
|
||||
void IrqMgr_SendMesgForClient(IrqMgr* this, OSMesg msg);
|
||||
void IrqMgr_JamMesgForClient(IrqMgr* this, OSMesg msg);
|
||||
void IrqMgr_HandlePreNMI(IrqMgr *this);
|
||||
void IrqMgr_HandlePreNMI(IrqMgr* this);
|
||||
void IrqMgr_CheckStack();
|
||||
void IrqMgr_HandlePRENMI450(IrqMgr* this);
|
||||
void IrqMgr_HandlePRENMI480(IrqMgr* this);
|
||||
@@ -1731,7 +1754,7 @@ void FaultDrawer_VPrintf(const char*, char*);
|
||||
void FaultDrawer_Printf(const char*, ...);
|
||||
void FaultDrawer_DrawText(s32, s32, const char*, ...);
|
||||
void FaultDrawer_SetDrawerFB(void*, u16, u16);
|
||||
void FaultDrawer_SetInputCallback(void(*)());
|
||||
void FaultDrawer_SetInputCallback(void (*)());
|
||||
void FaultDrawer_SetDefault();
|
||||
// ? func_800D7CD0(?);
|
||||
// ? func_800D7D04(?);
|
||||
@@ -2150,14 +2173,14 @@ void GfxPrint_VPrintf(GfxPrint*, const char*, va_list);
|
||||
void GfxPrint_Printf(GfxPrint*, const char*, ...);
|
||||
void func_800FBCE0();
|
||||
void func_800FBFD8();
|
||||
void *Overlay_AllocateAndLoad(u32 vRomStart, u32 vRomEnd, void *vRamStart, void *vRamEnd);
|
||||
void* Overlay_AllocateAndLoad(u32 vRomStart, u32 vRomEnd, void* vRamStart, void* vRamEnd);
|
||||
// ? func_800FC258(?);
|
||||
void Overlay_DoRelocation(void *allocatedVRamAddress, OverlayRelocationSection *overlayInfo, void *vRamAddress);
|
||||
s32 Overlay_Load(u32 vRomStart, u32 vRomEnd, void *vRamStart, void *vRamEnd, void *allocatedVRamAddress);
|
||||
void Overlay_DoRelocation(void* allocatedVRamAddress, OverlayRelocationSection* overlayInfo, void* vRamAddress);
|
||||
s32 Overlay_Load(u32 vRomStart, u32 vRomEnd, void* vRamStart, void* vRamEnd, void* allocatedVRamAddress);
|
||||
// ? func_800FC800(?);
|
||||
// ? func_800FC83C(?);
|
||||
// ? func_800FCAB4(?);
|
||||
void SystemHeap_Init(void *start, u32 size);
|
||||
void SystemHeap_Init(void* start, u32 size);
|
||||
// ? func_800FCC00(?);
|
||||
// ? func_800FCC08(?);
|
||||
// ? func_800FCC10(?);
|
||||
@@ -2220,10 +2243,10 @@ u8 __osMallocIsInitalized(Arena* arena);
|
||||
void __osMalloc_FreeBlockTest(Arena* arena, ArenaNode* node);
|
||||
void* __osMalloc_NoLockDebug(Arena* arena, u32 size, const char* file, s32 line);
|
||||
void* __osMallocDebug(Arena* arena, u32 size, const char* file, s32 line);
|
||||
void* __osMallocRDebug(Arena *arena, u32 size, const char *file, s32 line);
|
||||
void* __osMalloc_NoLock(Arena *arena, u32 size);
|
||||
void* __osMallocRDebug(Arena* arena, u32 size, const char* file, s32 line);
|
||||
void* __osMalloc_NoLock(Arena* arena, u32 size);
|
||||
void* __osMalloc(Arena* arena, u32 size);
|
||||
void* __osMallocR(Arena *arena, u32 size);
|
||||
void* __osMallocR(Arena* arena, u32 size);
|
||||
void __osFree_NoLock(Arena* arena, void* ptr);
|
||||
void __osFree(Arena* arena, void* ptr);
|
||||
void __osFree_NoLockDebug(Arena* arena, void* ptr, const char* file, s32 line);
|
||||
@@ -2296,7 +2319,8 @@ s16 sins(u16);
|
||||
// ? func_80103210(?);
|
||||
// ? func_8010328C(?);
|
||||
// ? func_801032B0(?);
|
||||
void func_80103A70(UNK_PTR, Gfx*, Hilite*, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, s32, s32);
|
||||
void func_80103A70(UNK_PTR, Gfx*, Hilite*, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32,
|
||||
s32, s32);
|
||||
// ? func_80103B30(?);
|
||||
// ? func_80103B60(?);
|
||||
// ? func_80103BB0(?);
|
||||
|
||||
+2
-4
@@ -1,8 +1,7 @@
|
||||
#ifndef _ICHAIN_H_
|
||||
#define _ICHAIN_H_
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
u32 cont: 1;
|
||||
u32 type: 4;
|
||||
u32 offset: 11;
|
||||
@@ -11,8 +10,7 @@ typedef struct
|
||||
|
||||
#define OFFSETOF(structure, member) ((size_t)&(((structure*)0)->member))
|
||||
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
/* 0x0 */ ICHAINTYPE_U8, // sets byte
|
||||
/* 0x1 */ ICHAINTYPE_S8,
|
||||
/* 0x2 */ ICHAINTYPE_U16, // sets short
|
||||
|
||||
@@ -35,4 +35,8 @@
|
||||
#define CAPACITY(upg, value) gUpgradeCapacities[upg][value]
|
||||
#define CUR_CAPACITY(upg) CAPACITY(upg, CUR_UPG_VALUE(upg))
|
||||
|
||||
#define SET_NEXT_GAMESTATE(curState, newInit, newStruct) \
|
||||
(curState)->init = newInit; \
|
||||
(curState)->size = sizeof(newStruct);
|
||||
|
||||
#endif
|
||||
|
||||
+5
-6
@@ -6,8 +6,7 @@
|
||||
|
||||
#include <ultra64/controller.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x0000 */ OSContStatus pad_status[4];
|
||||
/* 0x0010 */ OSMesg msgbuf1[1];
|
||||
/* 0x0014 */ OSMesg msgbuf2[1];
|
||||
@@ -24,10 +23,10 @@ typedef struct
|
||||
/* 0x02A8 */ u8 unk_2A8;
|
||||
/* 0x02A9 */ u8 unk_2A9;
|
||||
/* 0x02AA */ u8 unk_2AA[4];
|
||||
/* 0x02AA */ u8 unk_2AE[4]; //Looks like 1 if vibration pack, 2 if (maybe controller pack)?
|
||||
/* 0x02AA */ u8 unk_2AE[4]; // Looks like 1 if vibration pack, 2 if (maybe controller pack)?
|
||||
/* 0x02B2 */ u8 unk_2B2[4];
|
||||
/* 0x02B6 */ u8 unk_2B6[4];
|
||||
/* 0x02BA */ char unk_2BA[0x02]; //probably padding
|
||||
/* 0x02BA */ char unk_2BA[0x02]; // probably padding
|
||||
/* 0x02BC */ unk_controller_t unk_controller[4];
|
||||
/* 0x045C */ u8 unk_45C;
|
||||
/* 0x045D */ u8 unk_45D;
|
||||
@@ -37,5 +36,5 @@ typedef struct
|
||||
/* 0x0464 */ s32 unk_464;
|
||||
} PadMgr; // size = 0x468
|
||||
|
||||
|
||||
#endif //_PADMGR_H_
|
||||
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
#ifndef _REGS_H_
|
||||
#define _REGS_H_
|
||||
|
||||
#define REG_GROUPS 29 //number of REG groups, i.e. REG, SREG, OREG, etc.
|
||||
#define REG_GROUPS 29 // number of REG groups, i.e. REG, SREG, OREG, etc.
|
||||
#define REG_PAGES 6
|
||||
#define REG_PER_PAGE 16
|
||||
#define REG_PER_GROUP REG_PAGES * REG_PER_PAGE
|
||||
|
||||
+3
-6
@@ -13,8 +13,7 @@
|
||||
#define OS_SC_RCP_MASK 0x0003
|
||||
#define OS_SC_TYPE_MASK 0x0007
|
||||
|
||||
typedef struct OSScTask
|
||||
{
|
||||
typedef struct OSScTask {
|
||||
/* 0x00 */ struct OSScTask* next;
|
||||
/* 0x04 */ u32 state;
|
||||
/* 0x08 */ u32 flags;
|
||||
@@ -24,14 +23,12 @@ typedef struct OSScTask
|
||||
/* 0x54 */ OSMesg msg;
|
||||
} OSScTask;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ char unk_00[0x12];
|
||||
/* 0x12 */ s8 unk_12;
|
||||
} struct_800C8BC4;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x0000 */ OSMesgQueue interruptQ;
|
||||
/* 0x0018 */ OSMesg intBuf[8];
|
||||
/* 0x0038 */ OSMesgQueue cmdQ;
|
||||
|
||||
@@ -3,20 +3,20 @@
|
||||
|
||||
#include <z64.h>
|
||||
|
||||
#define DECLARE_SEGMENT(name) \
|
||||
#define DECLARE_SEGMENT(name) \
|
||||
extern u8 _##name##SegmentStart[]; \
|
||||
extern u8 _##name##SegmentEnd[];
|
||||
|
||||
#define DECLARE_ROM_SEGMENT(name) \
|
||||
#define DECLARE_ROM_SEGMENT(name) \
|
||||
extern u8 _##name##SegmentRomStart[]; \
|
||||
extern u8 _##name##SegmentRomEnd[];
|
||||
|
||||
#define DECLARE_BSS_SEGMENT(name) \
|
||||
#define DECLARE_BSS_SEGMENT(name) \
|
||||
extern u8 _##name##SegmentBssStart[]; \
|
||||
extern u8 _##name##SegmentBssEnd[];
|
||||
|
||||
#define DECLARE_OVERLAY_SEGMENT(name) \
|
||||
DECLARE_SEGMENT(ovl_##name) \
|
||||
DECLARE_SEGMENT(ovl_##name) \
|
||||
DECLARE_ROM_SEGMENT(ovl_##name)
|
||||
|
||||
DECLARE_SEGMENT(boot)
|
||||
@@ -1091,5 +1091,4 @@ DECLARE_ROM_SEGMENT(testroom_room_2)
|
||||
DECLARE_ROM_SEGMENT(testroom_room_3)
|
||||
DECLARE_ROM_SEGMENT(testroom_room_4)
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
+4
-4
@@ -1,13 +1,13 @@
|
||||
#ifndef _STDBOOL
|
||||
#define _STDBOOL
|
||||
|
||||
#define __bool_true_false_are_defined 1
|
||||
#define __bool_true_false_are_defined 1
|
||||
|
||||
#ifndef __cplusplus
|
||||
|
||||
#define bool u32
|
||||
#define false 0
|
||||
#define true 1
|
||||
#define bool u32
|
||||
#define false 0
|
||||
#define true 1
|
||||
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
#ifndef _STDDEF_H_
|
||||
#define _STDDEF_H_
|
||||
|
||||
#define NULL ((void *)0)
|
||||
#define NULL ((void*)0)
|
||||
|
||||
typedef unsigned long size_t;
|
||||
|
||||
|
||||
+2
-4
@@ -1,14 +1,12 @@
|
||||
#ifndef _STDLIB_H_
|
||||
#define _STDLIB_H_
|
||||
|
||||
typedef struct lldiv_t
|
||||
{
|
||||
typedef struct lldiv_t {
|
||||
long long quot;
|
||||
long long rem;
|
||||
} lldiv_t;
|
||||
|
||||
typedef struct ldiv_t
|
||||
{
|
||||
typedef struct ldiv_t {
|
||||
long quot;
|
||||
long rem;
|
||||
} ldiv_t;
|
||||
|
||||
+4
-2
@@ -1,8 +1,10 @@
|
||||
#ifndef _STRING_H_
|
||||
#define _STRING_H_
|
||||
|
||||
#include <ultra64/types.h>
|
||||
|
||||
void* memcpy(void*, const void*, size_t);
|
||||
size_t strlen(const u8 *str);
|
||||
const u8 *strchr(const u8 *str, s32 ch);
|
||||
size_t strlen(const u8* str);
|
||||
const u8* strchr(const u8* str, s32 ch);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -24,15 +24,13 @@ typedef double f64;
|
||||
|
||||
|
||||
typedef long int Mtx_t[4][4];
|
||||
typedef union
|
||||
{
|
||||
typedef union {
|
||||
Mtx_t m;
|
||||
long long int forc_structure_alignment;
|
||||
} Mtx;
|
||||
|
||||
typedef float MtxF_t[4][4];
|
||||
typedef union
|
||||
{
|
||||
typedef union {
|
||||
MtxF_t mf;
|
||||
struct
|
||||
{
|
||||
|
||||
+2
-2
@@ -21,11 +21,11 @@
|
||||
|
||||
#define VT_ESC "\x1b"
|
||||
#define VT_CSI "["
|
||||
#define VT_CUP(x, y) VT_ESC VT_CSI #y ";" #x "H"
|
||||
#define VT_CUP(x, y) VT_ESC VT_CSI y ";" x "H"
|
||||
#define VT_ED(n) VT_ESC VT_CSI #n "J"
|
||||
#define VT_SGR(n) VT_ESC VT_CSI n "m"
|
||||
|
||||
//Add more macros if necessary
|
||||
// Add more macros if necessary
|
||||
#define VT_COL(back, fore) VT_SGR(VT_COLOR(BACKGROUND, back) ";" VT_COLOR(FOREGROUND, fore))
|
||||
#define VT_FGCOL(color) VT_SGR(VT_COLOR(FOREGROUND, color))
|
||||
#define VT_BGCOL(color) VT_SGR(VT_COLOR(BACKGROUND, color))
|
||||
|
||||
+124
-227
@@ -31,25 +31,22 @@
|
||||
|
||||
// Game Info aka. Static Context (dbg ram start: 80210A10)
|
||||
// Data normally accessed through REG macros (see regs.h)
|
||||
typedef struct
|
||||
{
|
||||
/* 0x00 */ s32 regPage; //1 is first page
|
||||
/* 0x04 */ s32 regGroup; //"register" group (R, RS, RO, RP etc.)
|
||||
/* 0x08 */ s32 regCur; //selected register within page
|
||||
typedef struct {
|
||||
/* 0x00 */ s32 regPage; // 1 is first page
|
||||
/* 0x04 */ s32 regGroup; // "register" group (R, RS, RO, RP etc.)
|
||||
/* 0x08 */ s32 regCur; // selected register within page
|
||||
/* 0x0C */ s32 dpadLast;
|
||||
/* 0x10 */ s32 repeat;
|
||||
/* 0x14 */ s16 data[REG_GROUPS * REG_PER_GROUP]; //0xAE0
|
||||
/* 0x14 */ s16 data[REG_GROUPS * REG_PER_GROUP]; // 0xAE0 bytes
|
||||
} GameInfo; // size = 0x15D4
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 button_items[4];
|
||||
/* 0x04 */ u8 c_button_slots[3];
|
||||
/* 0x08 */ u16 equipment;
|
||||
} ItemEquips; // size = 0x0A
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u32 chest;
|
||||
/* 0x04 */ u32 swch;
|
||||
/* 0x08 */ u32 clear;
|
||||
@@ -59,15 +56,13 @@ typedef struct
|
||||
/* 0x18 */ u32 rooms_2;
|
||||
} SaveSceneFlags; // size = 0x1C
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ s16 scene;
|
||||
/* 0x02 */ Vec3s pos;
|
||||
/* 0x08 */ s16 angle;
|
||||
} HorseData; // size = 0x0A
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ Vec3f pos;
|
||||
/* 0x0C */ s16 yaw;
|
||||
/* 0x0E */ s16 player_params;
|
||||
@@ -78,22 +73,19 @@ typedef struct
|
||||
/* 0x18 */ u32 temp_collect_flags;
|
||||
} RespawnData; // size = 0x1C
|
||||
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
/* 0x00 */ RESPAWN_MODE_DOWN, /* Normal Void Outs */
|
||||
/* 0x01 */ RESPAWN_MODE_RETURN, /* Grotto Returnpoints */
|
||||
/* 0x02 */ RESPAWN_MODE_TOP /* Farore's Wind */
|
||||
} RespawnMode;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
/* 0x00 */ BTN_ENABLED,
|
||||
/* 0xFF */ BTN_DISABLED = 0xFF
|
||||
} ButtonStatus;
|
||||
|
||||
// Save Context (dbg ram start: 8015E660)
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x0000 */ s32 entrance_index;
|
||||
/* 0x0004 */ s32 link_age; // 0: Adult; 1: Child
|
||||
/* 0x0008 */ s32 cutscene_index;
|
||||
@@ -133,8 +125,7 @@ typedef struct
|
||||
/* 0x00CF */ s8 defense_hearts;
|
||||
/* 0x00D0 */ s16 gs_tokens;
|
||||
/* 0x00D4 */ SaveSceneFlags scene_flags[124];
|
||||
struct
|
||||
{
|
||||
struct {
|
||||
/* 0x0E64 */ s32 pos_x;
|
||||
/* 0x0E68 */ s32 pos_y;
|
||||
/* 0x0E6C */ s32 pos_z;
|
||||
@@ -217,8 +208,7 @@ typedef struct
|
||||
/* 0x1424 */ s16 health_accumulator;
|
||||
} SaveContext; // size = 0x1428
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00000 */ u16 headMagic; // 1234
|
||||
/* 0x00008 */ Gfx polyOpaBuffer[0x17E0];
|
||||
/* 0x0BF08 */ Gfx polyXluBuffer[0x800];
|
||||
@@ -228,24 +218,21 @@ typedef struct
|
||||
/* 0x12408 */ u16 tailMagic; // 5678
|
||||
} GfxPool; // size = 0x12410
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x0000 */ u32 size;
|
||||
/* 0x0004 */ u8* bufp;
|
||||
/* 0x0008 */ u8* head;
|
||||
/* 0x000C */ u8* tail;
|
||||
} TwoHeadArena; // size = 0x10
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x0000 */ u32 size;
|
||||
/* 0x0004 */ Gfx* bufp;
|
||||
/* 0x0008 */ Gfx* p;
|
||||
/* 0x000C */ Gfx* d;
|
||||
} TwoHeadGfxArena; // size = 0x10
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x0000 */ char unk_00[0x01B4];
|
||||
/* 0x01B4 */ TwoHeadGfxArena work;
|
||||
/* 0x01C4 */ char unk_1C4[0x00E4];
|
||||
@@ -254,12 +241,9 @@ typedef struct
|
||||
/* 0x02C8 */ TwoHeadGfxArena polyXlu;
|
||||
} GraphicsContext;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/* 0x00 */ union
|
||||
{
|
||||
struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ union {
|
||||
struct {
|
||||
u16 a : 1;
|
||||
u16 b : 1;
|
||||
u16 z : 1;
|
||||
@@ -282,8 +266,7 @@ typedef struct
|
||||
/* 0x03 */ s8 y;
|
||||
} RawInput; // size = 0x4
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ RawInput raw;
|
||||
/* 0x04 */ u16 status;
|
||||
/* 0x06 */ RawInput rawPrev;
|
||||
@@ -298,8 +281,7 @@ typedef struct
|
||||
/* 0x16 */ char unk_16[0x02];
|
||||
} Input; // size = 0x18
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x0000 */ char unk_00[0x28];
|
||||
/* 0x0028 */ Vec3f eye;
|
||||
/* 0x0034 */ char unk_34[0xEC];
|
||||
@@ -307,15 +289,13 @@ typedef struct
|
||||
/* 0x0124 */ char unk_124[4];
|
||||
} View; // size = 0x128
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
f32 unk_00;
|
||||
s16 unk_04;
|
||||
s16 unk_06;
|
||||
} struct_80045714; // used in z_camera.c and code_8007BF90
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x0000 */ s32 unk_00;
|
||||
/* 0x0004 */ s16 unk_04;
|
||||
/* 0x0006 */ s16 unk_06;
|
||||
@@ -372,49 +352,42 @@ typedef struct
|
||||
/* 0x016A */ s16 unk_16A; // unknown if used
|
||||
} Camera; // size = 0x16C
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x0000 */ Camera activeCameras[4];
|
||||
/* 0x05B0 */ Camera* activeCameraPtrs[4];
|
||||
/* 0x05C0 */ s16 unk_5C0;
|
||||
/* 0x05C2 */ s16 unk_5C2;
|
||||
} CameraContext; // size = 0x5C4
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 musicSeq;
|
||||
/* 0x01 */ u8 nighttimeSFX;
|
||||
/* 0x02 */ char unk_02[0x2];
|
||||
} SoundContext; // size = 0x4
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ char unk_00[0x50];
|
||||
} StaticCollisionContext; // size = 0x50
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x0000 */ char unk_00[0x04];
|
||||
/* 0x0004 */ ActorMesh actorMeshArr[50];
|
||||
/* 0x138C */ u16 flags[50];
|
||||
/* 0x13F0 */ char unk_13F0[0x24];
|
||||
} DynaCollisionContext; // size = 0x1414
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x0000 */ StaticCollisionContext stat;
|
||||
/* 0x0050 */ DynaCollisionContext dyna;
|
||||
} CollisionContext; // size = 0x1464
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ Vec3f pos;
|
||||
/* 0x0C */ f32 unk_0C; // radius?
|
||||
/* 0x10 */ Color_RGB8 color;
|
||||
} TargetContextEntry; // size = 0x14
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ Vec3f naviRefPos; // possibly wrong
|
||||
/* 0x0C */ Vec3f targetCenterPos;
|
||||
/* 0x18 */ Color_RGBAf naviInner;
|
||||
@@ -434,8 +407,7 @@ typedef struct
|
||||
/* 0x94 */ Actor* unk_94;
|
||||
} TargetContext; // size = 0x98
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u32 texture;
|
||||
/* 0x04 */ s16 unk_4;
|
||||
/* 0x06 */ s16 unk_6;
|
||||
@@ -447,14 +419,12 @@ typedef struct
|
||||
/* 0x0E */ s16 unk_E;
|
||||
} TitleCardContext; // size = 0x10
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u32 length; // number of actors loaded of this type
|
||||
/* 0x04 */ Actor* first; // pointer to first actor of this type
|
||||
} ActorListEntry; // size = 0x08
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x0000 */ u8 unk_00;
|
||||
/* 0x0001 */ char unk_01[0x01];
|
||||
/* 0x0002 */ u8 unk_02;
|
||||
@@ -464,8 +434,7 @@ typedef struct
|
||||
/* 0x0009 */ char unk_09[0x03];
|
||||
/* 0x000C */ ActorListEntry actorList[12];
|
||||
/* 0x006C */ TargetContext targetCtx;
|
||||
struct
|
||||
{
|
||||
struct {
|
||||
/* 0x0104 */ u32 swch;
|
||||
/* 0x0108 */ u32 tempSwch;
|
||||
/* 0x010C */ u32 unk0;
|
||||
@@ -481,19 +450,16 @@ typedef struct
|
||||
/* 0x013C */ void* absoluteSpace; // Space used to allocate actor overlays of alloc type 1
|
||||
} ActorContext; // size = 0x140
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ char unk_00[0x4];
|
||||
/* 0x04 */ void* segment;
|
||||
/* 0x08 */ u8 state;
|
||||
/* 0x0C */ f32 unk_0C;
|
||||
/* 0x10 */ u16 frames;
|
||||
/* 0x12 */ u16 unk_12;
|
||||
union
|
||||
{
|
||||
union {
|
||||
/* 0x14 */ s32 unk_14_all;
|
||||
struct
|
||||
{
|
||||
struct {
|
||||
s16 unk_14;
|
||||
s16 unk_16;
|
||||
};
|
||||
@@ -507,8 +473,7 @@ typedef struct
|
||||
/* 0x28 */ CsCmdActorAction* actorActions[10];
|
||||
} CutsceneContext; // size = 0x50
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x0000 */ View view;
|
||||
/* 0x0128 */ char unk_128[0xE188];
|
||||
/* 0xE2B0 */ void* textboxSegment; // "fukidashiSegment"
|
||||
@@ -534,8 +499,7 @@ typedef struct
|
||||
/* 0xE40E */ char unk_E40E[0x0A];
|
||||
} MessageContext; // size = 0xE418
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u32 vromAddr; // VROM address (source)
|
||||
/* 0x04 */ void* dramAddr; // DRAM address (destination)
|
||||
/* 0x08 */ u32 size; // File Transfer size
|
||||
@@ -546,8 +510,7 @@ typedef struct
|
||||
/* 0x1C */ OSMesg notifyMsg; // Completion notification message
|
||||
} DmaRequest; // size = 0x20
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x0000 */ View view;
|
||||
/* 0x0128 */ Vtx* vtx_128;
|
||||
/* 0x012C */ Vtx* vtx_12C;
|
||||
@@ -602,8 +565,7 @@ typedef struct
|
||||
/* 0x025E */ char unk_25E[0x002];
|
||||
/* 0x0260 */ u8 unk_260;
|
||||
/* 0x0261 */ u8 unk_261;
|
||||
struct
|
||||
{
|
||||
struct {
|
||||
/* 0x0262 */ u8 hGauge; // "h_gage"; unknown?
|
||||
/* 0x0263 */ u8 bButton; // "b_button"
|
||||
/* 0x0264 */ u8 aButton; // "a_button"
|
||||
@@ -619,8 +581,7 @@ typedef struct
|
||||
} restrictions;
|
||||
} InterfaceContext; // size = 0x270
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x0000 */ View view;
|
||||
/* 0x0128 */ void* unk_128;
|
||||
/* 0x012C */ char unk_12C[0x03C];
|
||||
@@ -645,8 +606,7 @@ typedef struct
|
||||
/* 0x025A */ char unk_25A[0x066];
|
||||
} PauseContext; // size = 0x2C0
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ s16 id;
|
||||
/* 0x04 */ void* segment;
|
||||
/* 0x08 */ DmaRequest dmaRequest;
|
||||
@@ -654,8 +614,7 @@ typedef struct
|
||||
/* 0x40 */ OSMesg loadMsg;
|
||||
} ObjectStatus; // size = 0x44
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x0000 */ void* spaceStart;
|
||||
/* 0x0004 */ void* spaceEnd; // original name: "endSegment"
|
||||
/* 0x0008 */ u8 num; // number of objects in bank
|
||||
@@ -665,30 +624,26 @@ typedef struct
|
||||
/* 0x000C */ ObjectStatus status[OBJECT_EXCHANGE_BANK_MAX];
|
||||
} ObjectContext; // size = 0x514
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ Gfx* opa;
|
||||
/* 0x04 */ Gfx* xlu;
|
||||
} PolygonDlist; // size = 0x8
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 type;
|
||||
/* 0x01 */ u8 num; // number of dlist entries
|
||||
/* 0x04 */ void* start;
|
||||
/* 0x08 */ void* end;
|
||||
} Polygon; // size = 0xC
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 type;
|
||||
/* 0x01 */ u8 num; // number of dlist entries
|
||||
/* 0x04 */ void* start;
|
||||
/* 0x08 */ void* end;
|
||||
} PolygonType0; // size = 0xC
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u16 unk_00;
|
||||
/* 0x02 */ u8 id;
|
||||
/* 0x04 */ u32 source;
|
||||
@@ -702,15 +657,12 @@ typedef struct
|
||||
/* 0x18 */ u16 tlutCount;
|
||||
} BgImage; // size = 0x1C
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 type;
|
||||
/* 0x01 */ u8 format; // 1 = single, 2 = multi
|
||||
/* 0x04 */ void* dlist;
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
union {
|
||||
struct {
|
||||
/* 0x08 */ u32 source;
|
||||
/* 0x0C */ u32 unk_0C;
|
||||
/* 0x10 */ u32 tlut;
|
||||
@@ -721,40 +673,35 @@ typedef struct
|
||||
/* 0x1A */ u16 mode0;
|
||||
/* 0x1C */ u16 tlutCount;
|
||||
} single;
|
||||
struct
|
||||
{
|
||||
struct {
|
||||
/* 0x08 */ u8 count;
|
||||
/* 0x0C */ BgImage* list;
|
||||
} multi;
|
||||
};
|
||||
} PolygonType1;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ Vec3s pos;
|
||||
/* 0x06 */ s16 unk_06;
|
||||
/* 0x08 */ Gfx* opa;
|
||||
/* 0x0C */ Gfx* xlu;
|
||||
} PolygonDlist2; // size = 0x8
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 type;
|
||||
/* 0x01 */ u8 num; // number of dlist entries
|
||||
/* 0x04 */ void* start;
|
||||
/* 0x08 */ void* end;
|
||||
} PolygonType2; // size = 0xC
|
||||
|
||||
typedef union
|
||||
{
|
||||
typedef union {
|
||||
Polygon polygon;
|
||||
PolygonType0 polygon0;
|
||||
PolygonType1 polygon1;
|
||||
PolygonType2 polygon2;
|
||||
} Mesh; // "Ground Shape"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ s8 num;
|
||||
/* 0x01 */ u8 unk_01;
|
||||
/* 0x02 */ u8 unk_02;
|
||||
@@ -766,8 +713,7 @@ typedef struct
|
||||
/* 0x10 */ char unk_10[0x4];
|
||||
} Room; // size = 0x14
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ Room curRoom;
|
||||
/* 0x14 */ Room prevRoom;
|
||||
/* 0x28 */ void* bufPtrs[2];
|
||||
@@ -779,21 +725,18 @@ typedef struct
|
||||
/* 0x70 */ OSMesg loadMsg;
|
||||
} RoomContext; // size = 0x74
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ char unk_00[0x028C];
|
||||
} SubGlobalContext11E60; // size = 0x28C
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ s16 id;
|
||||
/* 0x02 */ Vec3s pos;
|
||||
/* 0x08 */ Vec3s rot;
|
||||
/* 0x0E */ s16 params;
|
||||
} ActorEntry; // size = 0x10
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ s8 frontRoom; // Room to switch to when triggered from the front of the object
|
||||
/* 0x01 */ s8 frontEffects; // How the camera reacts during the front transition
|
||||
/* 0x02 */ s8 backRoom; // Room to switch to when triggered from the back of the object
|
||||
@@ -804,39 +747,33 @@ typedef struct
|
||||
/* 0x0E */ s16 params;
|
||||
} TransitionActorEntry; // size = 0x10
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 spawn;
|
||||
/* 0x01 */ u8 room;
|
||||
} EntranceEntry;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u32 vromStart;
|
||||
/* 0x04 */ u32 vromEnd;
|
||||
} RomFile; // size = 0x8
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ void* read_buff;
|
||||
} Sram; // size = 0x4
|
||||
|
||||
typedef struct GameAllocEntry
|
||||
{
|
||||
typedef struct GameAllocEntry {
|
||||
/* 0x00 */ struct GameAllocEntry* next;
|
||||
/* 0x04 */ struct GameAllocEntry* prev;
|
||||
/* 0x08 */ u32 size;
|
||||
/* 0x0C */ u32 unk_0C;
|
||||
} GameAllocEntry; //size = 0x10
|
||||
} GameAllocEntry; // size = 0x10
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ GameAllocEntry base;
|
||||
/* 0x10 */ GameAllocEntry* head;
|
||||
} GameAlloc; // size = 0x14
|
||||
|
||||
typedef struct GameState
|
||||
{
|
||||
typedef struct GameState {
|
||||
/* 0x00 */ GraphicsContext* gfxCtx;
|
||||
/* 0x04 */ void (*main)(struct GameState*);
|
||||
/* 0x08 */ void (*destroy)(struct GameState*); // "cleanup"
|
||||
@@ -850,8 +787,7 @@ typedef struct GameState
|
||||
/* 0xA0 */ u32 unk_A0;
|
||||
} GameState; // size = 0xA4
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x0000 */ GameState state;
|
||||
/* 0x00A4 */ void* staticSegment;
|
||||
/* 0x00A8 */ View view;
|
||||
@@ -875,8 +811,7 @@ typedef struct
|
||||
} SampleContext;
|
||||
|
||||
// Global Context (dbg ram start: 80212020)
|
||||
typedef struct GlobalContext
|
||||
{
|
||||
typedef struct GlobalContext {
|
||||
/* 0x00000 */ GameState state;
|
||||
/* 0x000A4 */ s16 sceneNum;
|
||||
/* 0x000A6 */ u8 sceneConfig;
|
||||
@@ -997,22 +932,19 @@ typedef struct GlobalContext
|
||||
/* 0x12430 */ char unk_12430[0xE8];
|
||||
} GlobalContext; // size = 0x12518
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x0000 */ GameState state;
|
||||
/* 0x00A4 */ char unk_A4[4];
|
||||
/* 0x00A8 */ View view;
|
||||
} OpeningContext; // size = 0x1D0
|
||||
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
DPM_UNK = 0,
|
||||
DPM_PLAYER = 1,
|
||||
DPM_ENEMY = 2
|
||||
} DynaPolyMoveFlag;
|
||||
|
||||
typedef struct LoadedParticleEntry
|
||||
{
|
||||
typedef struct LoadedParticleEntry {
|
||||
/* 0x0000 */ Vec3f position;
|
||||
/* 0x000C */ Vec3f velocity;
|
||||
/* 0x0018 */ Vec3f acceleration;
|
||||
@@ -1031,8 +963,7 @@ typedef struct LoadedParticleEntry
|
||||
} LoadedParticleEntry; // size = 0x60
|
||||
|
||||
// Some animation related structure
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u32 animation;
|
||||
/* 0x04 */ f32 playbackSpeed;
|
||||
/* 0x08 */ f32 unk_08;
|
||||
@@ -1041,8 +972,7 @@ typedef struct
|
||||
/* 0x14 */ f32 transitionRate;
|
||||
} struct_80034EC0_Entry; // size = 0x18
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 limbCount;
|
||||
/* 0x01 */ char unk_01[0x01];
|
||||
/* 0x02 */ u8 dListCount;
|
||||
@@ -1067,14 +997,12 @@ typedef struct
|
||||
/* 0x42 */ u16 unk_42;
|
||||
} SkelAnime; // size = 0x44
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u32 unk_00;
|
||||
/* 0x04 */ u32(*init)(GlobalContext*, u32, LoadedParticleEntry*, void*);
|
||||
} ParticleOverlayInfo;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u32 vromStart;
|
||||
/* 0x04 */ u32 vromEnd;
|
||||
/* 0x0C */ void* vramStart;
|
||||
@@ -1084,15 +1012,13 @@ typedef struct
|
||||
/* 0x18 */ u32 unk_18; // Always 0x01000000?
|
||||
} ParticleOverlay;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ LoadedParticleEntry* data_table; // Name from debug assert
|
||||
/* 0x04 */ s32 searchIndex;
|
||||
/* 0x08 */ s32 size;
|
||||
} EffectTableInfo;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ s8 scene;
|
||||
/* 0x01 */ s8 spawn;
|
||||
/* 0x02 */ u16 continueBgm : 1;
|
||||
@@ -1101,8 +1027,7 @@ typedef struct
|
||||
/* 0x02 */ u16 fadeOutTransition : 7;
|
||||
} EntranceInfo; // size = 0x4
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ void* loadedRamAddr;
|
||||
/* 0x04 */ u32 vromStart; // if applicable
|
||||
/* 0x08 */ u32 vromEnd; // if applicable
|
||||
@@ -1117,21 +1042,18 @@ typedef struct
|
||||
/* 0x2C */ u32 instanceSize;
|
||||
} GameStateOverlay; // size = 0x30
|
||||
|
||||
typedef struct PreNMIContext
|
||||
{
|
||||
typedef struct PreNMIContext {
|
||||
/* 0x00 */ GameState state;
|
||||
/* 0xA4 */ u32 timer;
|
||||
/* 0xA8 */ UNK_TYPE unk_A8;
|
||||
} PreNMIContext; // size = 0xAC
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ s8 chestFlag; // chest icon is only displayed if this flag is not set for the current room
|
||||
/* 0x01 */ u8 x, y; // coordinates to place the icon (top-left corner), relative to the minimap texture
|
||||
} MapMarkPoint; // size = 0x3
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ s8 markType; // 0 for the chest icon, 1 for the boss skull icon, -1 for none
|
||||
/* 0x01 */ u8 count; // number of icons to display
|
||||
/* 0x02 */ MapMarkPoint points[12];
|
||||
@@ -1139,8 +1061,7 @@ typedef struct
|
||||
|
||||
typedef MapMarkData MapMarksData[3]; // size = 0x72
|
||||
|
||||
typedef struct DebugDispObject
|
||||
{
|
||||
typedef struct DebugDispObject {
|
||||
/* 0x00 */ Vec3f pos;
|
||||
/* 0x0C */ Vec3s rot;
|
||||
/* 0x14 */ Vec3f scale;
|
||||
@@ -1149,8 +1070,7 @@ typedef struct DebugDispObject
|
||||
/* 0x28 */ struct DebugDispObject* next;
|
||||
} DebugDispObject; // size = 0x2C
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ Vec3s colAbsMin;
|
||||
/* 0x06 */ Vec3s colAbsMax;
|
||||
/* 0x0C */ s16 nbVertices;
|
||||
@@ -1163,30 +1083,26 @@ typedef struct
|
||||
/* 0x28 */ void* waterBoxes;
|
||||
} CollisionHeader;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
MTXMODE_NEW, // generates a new matrix
|
||||
MTXMODE_APPLY // applies transformation to the current matrix
|
||||
} MatrixMode;
|
||||
|
||||
typedef struct FaultClient
|
||||
{
|
||||
typedef struct FaultClient {
|
||||
struct FaultClient* next;
|
||||
u32 callback;
|
||||
u32 param1;
|
||||
u32 param2;
|
||||
} FaultClient;
|
||||
|
||||
typedef struct FaultAddrConvClient
|
||||
{
|
||||
typedef struct FaultAddrConvClient {
|
||||
struct FaultAddrConvClient* next;
|
||||
u32 callback;
|
||||
u32 param;
|
||||
} FaultAddrConvClient;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
u32 (*callback)(u32, u32);
|
||||
u32 param0;
|
||||
u32 param1;
|
||||
@@ -1195,8 +1111,7 @@ typedef struct
|
||||
OSMesg msg;
|
||||
} FaultClientContext;
|
||||
|
||||
typedef struct FaultThreadStruct
|
||||
{
|
||||
typedef struct FaultThreadStruct {
|
||||
OSThread thread;
|
||||
u8 unk_1B0[0x600];
|
||||
OSMesgQueue queue;
|
||||
@@ -1217,8 +1132,7 @@ typedef struct FaultThreadStruct
|
||||
u8 unk_84C[4];
|
||||
} FaultThreadStruct;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
u16* fb;
|
||||
u16 w;
|
||||
u16 h;
|
||||
@@ -1236,13 +1150,12 @@ typedef struct
|
||||
s8 charWPad;
|
||||
s8 charHPad;
|
||||
u16 printColors[10];
|
||||
u8 escCode; //bool
|
||||
u8 escCode; // bool
|
||||
u8 osSyncPrintfEnabled;
|
||||
void(*inputCallback)();
|
||||
} FaultDrawer;
|
||||
|
||||
typedef struct GfxPrint
|
||||
{
|
||||
typedef struct GfxPrint {
|
||||
/* 0x00 */ struct GfxPrint*(*callback)(struct GfxPrint*, const char*, size_t);
|
||||
/* 0x04 */ Gfx* dlist;
|
||||
/* 0x08 */ u16 posX;
|
||||
@@ -1253,8 +1166,7 @@ typedef struct GfxPrint
|
||||
/* 0x10 */ Color_RGBA8 color;
|
||||
} GfxPrint;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
GFXPRINT_FLAG1 = 1,
|
||||
GFXPRINT_USE_RGBA16 = 2,
|
||||
GFXPRINT_FLAG4 = 4,
|
||||
@@ -1263,8 +1175,7 @@ typedef enum
|
||||
GFXPRINT_OPEN = 0x80
|
||||
} GfxPrintFlag;
|
||||
|
||||
typedef struct StackEntry
|
||||
{
|
||||
typedef struct StackEntry {
|
||||
/* 0x00 */ struct StackEntry* next;
|
||||
/* 0x04 */ struct StackEntry* prev;
|
||||
/* 0x08 */ u32 head;
|
||||
@@ -1274,16 +1185,14 @@ typedef struct StackEntry
|
||||
/* 0x18 */ const char* name;
|
||||
} StackEntry;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
STACK_STATUS_OK = 0,
|
||||
STACK_STATUS_WARNING = 1,
|
||||
STACK_STATUS_OVERFLOW = 2
|
||||
} StackStatus;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/* 0x00 */ u32 magic; //IS64
|
||||
typedef struct {
|
||||
/* 0x00 */ u32 magic; // IS64
|
||||
/* 0x04 */ u32 get;
|
||||
/* 0x08 */ u8 unk_08[0x14-0x08];
|
||||
/* 0x14 */ u32 put;
|
||||
@@ -1291,22 +1200,18 @@ typedef struct
|
||||
/* 0x20 */ u8 data[0x10000-0x20];
|
||||
} ISVDbg;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u32 vromStart;
|
||||
/* 0x04 */ u32 vromEnd;
|
||||
/* 0x08 */ u32 romStart;
|
||||
/* 0x0C */ u32 romEnd;
|
||||
} DmaEntry;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
char name[0x18];
|
||||
u32 mediaFormat;
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
union {
|
||||
struct {
|
||||
u16 cartId;
|
||||
u8 countryCode;
|
||||
u8 version;
|
||||
@@ -1315,18 +1220,17 @@ typedef struct
|
||||
};
|
||||
} LocaleCartInfo;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char magic[4]; //Yaz0
|
||||
typedef struct {
|
||||
char magic[4]; // Yaz0
|
||||
u32 decSize;
|
||||
u32 compInfoOffset; //only used in yaz0_old.c
|
||||
u32 uncompDataOffset; //only used in yaz0_old.c
|
||||
u32 compInfoOffset; // only used in yaz0_old.c
|
||||
u32 uncompDataOffset; // only used in yaz0_old.c
|
||||
u32 data[1];
|
||||
} Yaz0Header;
|
||||
|
||||
#define OS_SC_RETRACE_MSG 1
|
||||
#define OS_SC_DONE_MSG 2
|
||||
#define OS_SC_NMI_MSG 3 //name is made up, 3 is OS_SC_RDP_DONE_MSG in the original sched.c
|
||||
#define OS_SC_NMI_MSG 3 // name is made up, 3 is OS_SC_RDP_DONE_MSG in the original sched.c
|
||||
#define OS_SC_PRE_NMI_MSG 4
|
||||
|
||||
typedef struct {
|
||||
@@ -1334,16 +1238,14 @@ typedef struct {
|
||||
char misc[30];
|
||||
} OSScMsg;
|
||||
|
||||
typedef struct IrqMgrClient
|
||||
{
|
||||
typedef struct IrqMgrClient {
|
||||
struct IrqMgrClient* prev;
|
||||
OSMesgQueue* queue;
|
||||
} IrqMgrClient;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/* 0x000 */ OSScMsg retraceMsg; //this apparently got moved from OSSched
|
||||
/* 0x020 */ OSScMsg prenmiMsg; //this apparently got moved from OSSched
|
||||
typedef struct {
|
||||
/* 0x000 */ OSScMsg retraceMsg; // this apparently got moved from OSSched
|
||||
/* 0x020 */ OSScMsg prenmiMsg; // this apparently got moved from OSSched
|
||||
/* 0x040 */ OSScMsg nmiMsg;
|
||||
/* 0x060 */ OSMesgQueue queue;
|
||||
/* 0x078 */ OSMesg msgBuf[8];
|
||||
@@ -1353,22 +1255,20 @@ typedef struct
|
||||
/* 0x250 */ OSTime resetTime;
|
||||
/* 0x258 */ OSTimer timer;
|
||||
/* 0x278 */ OSTime retraceTime;
|
||||
} IrqMgr; //size = 0x280
|
||||
} IrqMgr; // size = 0x280
|
||||
|
||||
struct ArenaNode;
|
||||
|
||||
typedef struct Arena
|
||||
{
|
||||
typedef struct Arena {
|
||||
/* 0x00 */ struct ArenaNode* head;
|
||||
/* 0x04 */ void* start;
|
||||
/* 0x08 */ OSMesgQueue lock;
|
||||
/* 0x20 */ u8 unk_20;
|
||||
/* 0x21 */ u8 isInit;
|
||||
/* 0x22 */ u8 flag;
|
||||
} Arena; //size = 0x24
|
||||
} Arena; // size = 0x24
|
||||
|
||||
typedef struct ArenaNode
|
||||
{
|
||||
typedef struct ArenaNode {
|
||||
/* 0x00 */ s16 magic;
|
||||
/* 0x02 */ s16 isFree;
|
||||
/* 0x04 */ u32 size;
|
||||
@@ -1379,8 +1279,8 @@ typedef struct ArenaNode
|
||||
/* 0x18 */ OSId threadId;
|
||||
/* 0x1C */ Arena* arena;
|
||||
/* 0x20 */ OSTime time;
|
||||
/* 0x28 */ u8 unk_28[0x30-0x28]; //probably padding
|
||||
} ArenaNode; //size = 0x30
|
||||
/* 0x28 */ u8 unk_28[0x30-0x28]; // probably padding
|
||||
} ArenaNode; // size = 0x30
|
||||
|
||||
typedef struct OverlayRelocationSection {
|
||||
/* 0x00 */ u32 textSize;
|
||||
@@ -1391,33 +1291,30 @@ typedef struct OverlayRelocationSection {
|
||||
/* 0x14 */ u32 relocations[1];
|
||||
} OverlayRelocationSection; // size >= 0x18
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ void* loadedRamAddr;
|
||||
/* 0x04 */ u32 vromStart;
|
||||
/* 0x08 */ u32 vromEnd;
|
||||
/* 0x0C */ u8* vramStart;
|
||||
/* 0x10 */ u8* vramEnd;
|
||||
/* 0x14 */ u32 off; //loadedRamAddr - vram
|
||||
/* 0x14 */ u32 off; // loadedRamAddr - vram
|
||||
/* 0x18 */ const char* name;
|
||||
} KaleidoManagerOvl; //size = 0x1C
|
||||
} KaleidoManagerOvl; // size = 0x1C
|
||||
|
||||
#define KALEIDO_OVL_KALEIDO_SCOPE 0
|
||||
#define KALEIDO_OVL_PLAYER_ACTOR 1
|
||||
#define KALEIDO_OVL_COUNT 2
|
||||
|
||||
typedef struct ListAlloc
|
||||
{
|
||||
typedef struct ListAlloc {
|
||||
/* 0x00 */ struct ListAlloc* prev;
|
||||
/* 0x04 */ struct ListAlloc* next;
|
||||
} ListAlloc; //size = 0x8
|
||||
} ListAlloc; // size = 0x8
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u32 resetting;
|
||||
/* 0x04 */ u32 resetCount;
|
||||
/* 0x08 */ OSTime duration;
|
||||
/* 0x10 */ OSTime resetTime;
|
||||
} PreNmiBuff; //size = 0x18 (actually osAppNmiBuffer is 0x40 bytes large but the rest is unused)
|
||||
} PreNmiBuff; // size = 0x18 (actually osAppNmiBuffer is 0x40 bytes large but the rest is unused)
|
||||
|
||||
#endif
|
||||
|
||||
+32
-63
@@ -13,34 +13,28 @@ struct GlobalContext;
|
||||
// From z64light.h
|
||||
struct LightMapper;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
f32 x, y;
|
||||
} Vec2f;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
f32 x, y, z;
|
||||
} Vec3f;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
s16 x, y, z;
|
||||
} Vec3s;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
s32 x, y, z;
|
||||
} Vec3i;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
Vec3f pos;
|
||||
Vec3s rot;
|
||||
} PosRot; // size = 0x14
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ char unk_00[0x8];
|
||||
/* 0x08 */ Vec3s norm; // Normal vector
|
||||
/* 0x0E */ s16 dist; // Plane distance from origin
|
||||
@@ -48,8 +42,7 @@ typedef struct
|
||||
|
||||
typedef void (*ActorFunc)(struct Actor*, struct GlobalContext*);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ s16 id;
|
||||
/* 0x02 */ u8 type; // Classifies actor and determines when actor will execute
|
||||
/* 0x03 */ u8 room; // Room instance was spawned in. If value set to FF in rom, instance does not despawn when swapping rooms
|
||||
@@ -62,15 +55,13 @@ typedef struct
|
||||
/* 0x1C */ ActorFunc draw; // Draw function
|
||||
} ActorInit; // size = 0x20
|
||||
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
ALLOCTYPE_NORMAL,
|
||||
ALLOCTYPE_ABSOLUTE,
|
||||
ALLOCTYPE_PERMANENT
|
||||
} AllocType;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u32 vromStart;
|
||||
/* 0x04 */ u32 vromEnd;
|
||||
/* 0x08 */ void* vramStart;
|
||||
@@ -82,25 +73,21 @@ typedef struct
|
||||
/* 0x1E */ s8 nbLoaded; // original name: "clients"
|
||||
} ActorOverlay; // size = 0x20
|
||||
|
||||
typedef struct
|
||||
{
|
||||
struct
|
||||
{
|
||||
typedef struct {
|
||||
struct {
|
||||
char damage : 4;
|
||||
char effect : 4;
|
||||
} attack[32];
|
||||
} ActorDamageChart;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 health;
|
||||
/* 0x02 */ s16 unk_02;
|
||||
/* 0x04 */ s16 unk_04;
|
||||
/* 0x06 */ u8 mass;
|
||||
} SubActor98Init;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ ActorDamageChart* damageChart; // For actors which contain a damage chart (example: Stalfos)...
|
||||
/* 0x04 */ Vec3f displacement; // Amount to correct velocity (0x5C) by when colliding into a body
|
||||
/* 0x10 */ s16 unk_10;
|
||||
@@ -114,8 +101,7 @@ typedef struct
|
||||
/* 0x1B */ u8 unk_1B;
|
||||
} SubActorStruct98; // size = 0x1C
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ Vec3s rot; // Current actor shape rotation
|
||||
/* 0x06 */ u8 unk_06;
|
||||
/* 0x08 */ f32 unk_08; // Model y axis offset. Represents model space units. collision mesh related
|
||||
@@ -125,8 +111,7 @@ typedef struct
|
||||
/* 0x15 */ u8 unk_15;
|
||||
} ActorShape; // size = 0x18
|
||||
|
||||
typedef struct Actor
|
||||
{
|
||||
typedef struct Actor {
|
||||
/* 0x000 */ s16 id; // Actor Id
|
||||
/* 0x002 */ u8 type; // Actor Type. Refer to the corresponding enum for values
|
||||
/* 0x003 */ s8 room; // Room number the actor is part of. FF denotes that the actor won't despawn on a room change
|
||||
@@ -198,16 +183,14 @@ typedef struct Actor
|
||||
/* From here on, the structure and size varies for each actor */
|
||||
} Actor; // size = 0x14C
|
||||
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
COLTYPE_CYLINDER = 1,
|
||||
COLTYPE_CYLINDER_GROUP = 0,
|
||||
COLTYPE_QUAD = 3,
|
||||
COLTYPE_TRIANGLE_GROUP = 2
|
||||
} ColliderType;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ Actor* actor;
|
||||
/* 0x04 */ Actor* at;
|
||||
/* 0x08 */ Actor* ac;
|
||||
@@ -220,15 +203,13 @@ typedef struct
|
||||
/* 0x15 */ u8 type; /* Cylinder Collection, Cylinder, Triangle Collection, Quad */
|
||||
} Collider; // size = 0x18
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ s32 flags; /* Toucher Attack Identifier Flags */
|
||||
/* 0x04 */ u8 unk_04;
|
||||
/* 0x05 */ u8 damage; /* Damage or Stun Timer */
|
||||
} ColliderTouch; // size = 0x08
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ s32 flags; /* Collision Exclusion Mask */
|
||||
/* 0x04 */ u8 effect; /* Damage Effect (Knockback, Fire, etc.) */
|
||||
/* 0x05 */ u8 unk_05;
|
||||
@@ -237,8 +218,7 @@ typedef struct
|
||||
/* 0x0A */ s16 unk_0A;
|
||||
} ColliderBump; // size = 0x0C
|
||||
|
||||
typedef struct ColliderBody
|
||||
{
|
||||
typedef struct ColliderBody {
|
||||
/* 0x00 */ ColliderTouch toucher;
|
||||
/* 0x08 */ ColliderBump bumper;
|
||||
/* 0x14 */ u8 flags;
|
||||
@@ -251,14 +231,12 @@ typedef struct ColliderBody
|
||||
/* 0x24 */ struct ColliderBody* colliding;
|
||||
} ColliderBody; // size = 0x28
|
||||
|
||||
typedef struct ColliderBodyEntry
|
||||
{
|
||||
typedef struct ColliderBodyEntry {
|
||||
/* 0x00 */ ColliderBody c;
|
||||
/* 0x28 */ char unk_28[0x18];
|
||||
} ColliderBodyEntry; // size = 0x40
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 bodyFlags;
|
||||
/* 0x01 */ u8 unk_09[0x3]; /* 000000 */
|
||||
/* 0x04 */ s32 toucherMask; /* Attack Toucher Exclusion Mask */
|
||||
@@ -273,8 +251,7 @@ typedef struct
|
||||
/* 0x17 */ u8 unk_1F; /* 00 */
|
||||
} ColliderBodyInfoInner; // size = 0x1A
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 unk_00;
|
||||
/* 0x01 */ u8 colliderFlags; /* Collider Flags */
|
||||
/* 0x02 */ u8 collideFlags; /* Collide Flags */
|
||||
@@ -284,30 +261,26 @@ typedef struct
|
||||
/* 0x06 */ u8 unk_06[0x2]; /* 0000 */
|
||||
} ColliderBodyInfo; // size = 0x08
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ s16 radius; /* Cylinder Radius */
|
||||
/* 0x02 */ s16 height; /* Cylinder Height */
|
||||
/* 0x04 */ s16 yShift; /* Shift Cylinder on Y Axis */
|
||||
/* 0x06 */ Vec3s position; /* {X, Y, Z} position of Cylinder */
|
||||
} ColliderDimensions; // size = 0xC
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ Collider base;
|
||||
/* 0x18 */ ColliderBody body;
|
||||
/* 0x40 */ ColliderDimensions dim;
|
||||
} ColliderCylinderMain; // size = 0x4C
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ ColliderBodyInfo body;
|
||||
/* 0x06 */ ColliderBodyInfoInner inner;
|
||||
/* 0x20 */ ColliderDimensions dim;
|
||||
} ColliderCylinderInit; // size = 0x2C
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ Actor* actor;
|
||||
/* 0x04 */ char unk_04[0x10];
|
||||
/* 0x14 */ Vec3f scale1;
|
||||
@@ -319,8 +292,7 @@ typedef struct
|
||||
/* 0x54 */ char unk_54[0x10];
|
||||
} ActorMesh; // size = 0x64
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x14C */ u32 dynaPolyId;
|
||||
/* 0x150 */ f32 unk_150;
|
||||
@@ -332,8 +304,7 @@ typedef struct
|
||||
/* 0x162 */ s16 unk_162;
|
||||
} DynaPolyActor; // size = 0x164
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x0000 */ Actor actor;
|
||||
/* 0x014C */ s8 currentTunic;
|
||||
/* 0x014D */ s8 currentSword;
|
||||
@@ -408,10 +379,9 @@ typedef struct
|
||||
/* 0x0A60 */ char unk_A60[0x18];
|
||||
/* 0x0A78 */ s8 unk_A78;
|
||||
/* 0x0A79 */ char unk_A79[0x1B];
|
||||
} Player; //size = 0xA94
|
||||
} Player; // size = 0xA94
|
||||
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
/* 0x00 */ ACTORTYPE_SWITCH,
|
||||
/* 0x01 */ ACTORTYPE_BG,
|
||||
/* 0x02 */ ACTORTYPE_PLAYER,
|
||||
@@ -426,8 +396,7 @@ typedef enum
|
||||
/* 0x0B */ ACTORTYPE_CHEST
|
||||
} ActorType;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
/* 0x0000 */ ACTOR_PLAYER,
|
||||
/* 0x0001 */ ACTOR_UNSET_1,
|
||||
/* 0x0002 */ ACTOR_EN_TEST,
|
||||
|
||||
+12
-24
@@ -1,16 +1,14 @@
|
||||
#ifndef _Z64CUTSCENE_H_
|
||||
#define _Z64CUTSCENE_H_
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u16 entrance; // entrance index upon which the cutscene should trigger
|
||||
/* 0x02 */ u8 ageRestriction; // 0 for adult only, 1 for child only, 2 for both ages
|
||||
/* 0x03 */ u8 flag; // event_chk_inf flag bound to the entrance cutscene
|
||||
/* 0x04 */ u32 segAddr; // segment offset location of the cutscene
|
||||
} EntranceCutscene; // size = 0x8
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ s8 continueFlag;
|
||||
/* 0x01 */ s8 cameraRoll;
|
||||
/* 0x02 */ s16 nextPointFrame;
|
||||
@@ -18,38 +16,33 @@ typedef struct
|
||||
/* 0x08 */ Vec3s pos;
|
||||
} CutsceneCameraPoint; // size = 0x10
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u16 base;
|
||||
/* 0x02 */ u16 startFrame;
|
||||
/* 0x04 */ u16 endFrame;
|
||||
} CsCmdBase;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 unk_00;
|
||||
/* 0x01 */ u8 setting;
|
||||
/* 0x02 */ u16 startFrame;
|
||||
/* 0x04 */ u16 endFrame;
|
||||
} CsCmdEnvLighting;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 unk_00;
|
||||
/* 0x01 */ u8 sequence;
|
||||
/* 0x02 */ u16 startFrame;
|
||||
/* 0x04 */ u16 endFrame;
|
||||
} CsCmdMusicChange;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u16 type;
|
||||
/* 0x02 */ u16 startFrame;
|
||||
/* 0x04 */ u16 endFrame;
|
||||
} CsCmdMusicFade;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u16 unk_00;
|
||||
/* 0x02 */ u16 startFrame;
|
||||
/* 0x04 */ u16 endFrame;
|
||||
@@ -58,8 +51,7 @@ typedef struct
|
||||
/* 0x08 */ u8 unk_08;
|
||||
} CsCmdUnknown9;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u16 unk_00;
|
||||
/* 0x02 */ u16 startFrame;
|
||||
/* 0x04 */ u16 endFrame;
|
||||
@@ -67,8 +59,7 @@ typedef struct
|
||||
/* 0x07 */ u8 minute;
|
||||
} CsCmdDayTime;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u16 base;
|
||||
/* 0x02 */ u16 startFrame;
|
||||
/* 0x04 */ u16 endFrame;
|
||||
@@ -77,8 +68,7 @@ typedef struct
|
||||
/* 0x0A */ u16 textId2;
|
||||
} CsCmdTextbox; // size = 0xC
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u16 action;
|
||||
/* 0x02 */ u16 startFrame;
|
||||
/* 0x04 */ u16 endFrame;
|
||||
@@ -88,8 +78,7 @@ typedef struct
|
||||
/* 0x24 */ Vec3i normal;
|
||||
} CsCmdActorAction; // size = 0x30
|
||||
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
CS_STATE_IDLE,
|
||||
CS_STATE_SKIPPABLE_INIT,
|
||||
CS_STATE_SKIPPABLE_EXEC,
|
||||
@@ -97,8 +86,7 @@ typedef enum
|
||||
CS_STATE_UNSKIPPABLE_EXEC
|
||||
} CutsceneState;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
CS_CMD_00 = 0x0000,
|
||||
CS_CMD_CAMERA_POS = 0x0001,
|
||||
CS_CMD_CAMERA_FOCUS = 0x0002,
|
||||
|
||||
+4
-5
@@ -2,18 +2,17 @@
|
||||
#define _Z64EFFECT_H_
|
||||
#include <color.h>
|
||||
|
||||
/* gz has trail related structs but they seem to be different in dbg*/
|
||||
typedef struct
|
||||
{
|
||||
// gz has trail related structs but they seem to be different in dbg
|
||||
typedef struct {
|
||||
/* 0x0000 */ char unk_00[0x184];
|
||||
/* 0x0184 */ Color_RGBA8 p1Start;
|
||||
/* 0x0188 */ Color_RGBA8 p2Start;
|
||||
/* 0x018C */ Color_RGBA8 p1End;
|
||||
/* 0x0190 */ Color_RGBA8 p2End;
|
||||
/* 0x0194 */ u32 unk_194; //these are proably bytes
|
||||
/* 0x0194 */ u32 unk_194; // these are proably bytes
|
||||
/* 0x0198 */ u32 unk_198;
|
||||
/* 0x019C */ u32 unk_19C;
|
||||
/* 0x01A0 */
|
||||
} TrailEffect; //size = unk
|
||||
} TrailEffect; // size = unk
|
||||
|
||||
#endif
|
||||
|
||||
+7
-12
@@ -1,16 +1,14 @@
|
||||
#ifndef _Z64ITEM_H_
|
||||
#define _Z64ITEM_H_
|
||||
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
/* 0x00 */ EQUIP_SWORD,
|
||||
/* 0x01 */ EQUIP_SHIELD,
|
||||
/* 0x02 */ EQUIP_TUNIC,
|
||||
/* 0x03 */ EQUIP_BOOTS
|
||||
} EquipmentType;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
/* 0x00 */ UPG_QUIVER,
|
||||
/* 0x01 */ UPG_BOMB_BAG,
|
||||
/* 0x02 */ UPG_STRENGTH,
|
||||
@@ -21,8 +19,7 @@ typedef enum
|
||||
/* 0x07 */ UPG_NUTS
|
||||
} UpgradeType;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
/* 0x00 */ SLOT_STICK,
|
||||
/* 0x01 */ SLOT_NUT,
|
||||
/* 0x02 */ SLOT_BOMB,
|
||||
@@ -50,8 +47,7 @@ typedef enum
|
||||
/* 0xFF */ SLOT_NONE = 0xFF
|
||||
} InventorySlot;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
/* 0x00 */ ITEM_STICK,
|
||||
/* 0x01 */ ITEM_NUT,
|
||||
/* 0x02 */ ITEM_BOMB,
|
||||
@@ -212,8 +208,7 @@ typedef enum
|
||||
} ItemID;
|
||||
|
||||
// Get Item result may vary depending on context (chest/shop/scrub/drop)
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
/* 0x00 */ GI_INVALID, // Link picks up chest and it sends him flying upwards
|
||||
/* 0x01 */ GI_BOMBS_5,
|
||||
/* 0x02 */ GI_NUTS_5,
|
||||
@@ -258,8 +253,8 @@ typedef enum
|
||||
/* 0x29 */ GI_SHIELD_DEKU, // or blue rupee if you have the shield
|
||||
/* 0x2A */ GI_SHIELD_HYLIAN, // or blue rupee if you have the shield
|
||||
/* 0x2B */ GI_SHIELD_MIRROR,
|
||||
/* 0x2C */ GI_TUNIC_GORON, // or blue rupee if you have the tunic
|
||||
/* 0x2D */ GI_TUNIC_ZORA, // or blue rupee if you have the tunic
|
||||
/* 0x2C */ GI_TUNIC_GORON, // or blue rupee if you have the tunic
|
||||
/* 0x2D */ GI_TUNIC_ZORA, // or blue rupee if you have the tunic
|
||||
/* 0x2E */ GI_BOOTS_IRON,
|
||||
/* 0x2F */ GI_BOOTS_HOVER,
|
||||
/* 0x30 */ GI_QUIVER_40,
|
||||
|
||||
+9
-18
@@ -4,15 +4,13 @@
|
||||
#include <ultra64.h>
|
||||
#include <ultra64/gbi.h>
|
||||
|
||||
typedef struct z_Light_t
|
||||
{
|
||||
typedef struct z_Light_t {
|
||||
/* 0x0 */ struct LightInfo* info;
|
||||
/* 0x4 */ struct z_Light_t* prev;
|
||||
/* 0x8 */ struct z_Light_t* next;
|
||||
} z_Light;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x0 */ z_Light* lightsHead;
|
||||
/* 0x4 */ u8 ambientRed;
|
||||
/* 0x5 */ u8 ambientGreen;
|
||||
@@ -24,21 +22,18 @@ typedef struct
|
||||
/* 0xC */ s16 unk_0C;
|
||||
} LightingContext;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x000 */ int numOccupied;
|
||||
/* 0x004 */ int nextFree;
|
||||
/* 0x008 */ z_Light lights[32];
|
||||
} LightsList;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 type;
|
||||
/* 0x2 */ u16 params[6];
|
||||
} LightInfo;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x0 */ s8 dirX;
|
||||
/* 0x1 */ s8 dirY;
|
||||
/* 0x2 */ s8 dirZ;
|
||||
@@ -48,8 +43,7 @@ typedef struct
|
||||
/* 0x6 */ u16 pad[3];
|
||||
} LightInfoDirectionalParams;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x0 */ s16 posX;
|
||||
/* 0x2 */ s16 posY;
|
||||
/* 0x4 */ s16 posZ;
|
||||
@@ -60,8 +54,7 @@ typedef struct
|
||||
/* 0xA */ s16 radius;
|
||||
} LightInfoPositionalParams;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 numLights;
|
||||
/* 0x01 */ u8 enablePosLights;
|
||||
/* 0x02 */ UNK_TYPE1 pad2[6];
|
||||
@@ -69,14 +62,12 @@ typedef struct
|
||||
/* 0x10 */ Light lights[7];
|
||||
} LightMapper;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 type;
|
||||
/* 0x2 */ LightInfoDirectionalParams params;
|
||||
} LightInfoDirectional;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 type;
|
||||
/* 0x2 */ LightInfoPositionalParams params;
|
||||
} LightInfoPositional;
|
||||
|
||||
+1
-2
@@ -3,8 +3,7 @@
|
||||
|
||||
#define OBJECT_EXCHANGE_BANK_MAX 19
|
||||
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
/* 0x0000 */ OBJECT_UNSET_0,
|
||||
/* 0x0001 */ OBJECT_GAMEPLAY_KEEP,
|
||||
/* 0x0002 */ OBJECT_GAMEPLAY_FIELD_KEEP,
|
||||
|
||||
+94
-160
@@ -1,8 +1,7 @@
|
||||
#ifndef _Z64SCENE_H_
|
||||
#define _Z64SCENE_H_
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u32 sceneVromStart;
|
||||
/* 0x04 */ u32 sceneVromEnd;
|
||||
/* 0x08 */ u32 titleVromStart;
|
||||
@@ -13,50 +12,43 @@ typedef struct
|
||||
/* 0x13 */ u8 unk_13;
|
||||
} Scene; // size = 0x14
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x04 */ u32 data2;
|
||||
} SCmdBase;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x04 */ u32 segment;
|
||||
} SCmdSpawnList;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 num;
|
||||
/* 0x04 */ u32 segment;
|
||||
} SCmdActorList;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x04 */ u32 segment;
|
||||
} SCmdCsCameraList;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x04 */ u32 segment;
|
||||
} SCmdColHeader;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 num;
|
||||
/* 0x04 */ u32 segment;
|
||||
} SCmdRoomList;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x02 */ char pad[2];
|
||||
@@ -66,71 +58,61 @@ typedef struct
|
||||
/* 0x07 */ u8 unk_07;
|
||||
} SCmdWindSettings;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x04 */ u32 segment;
|
||||
} SCmdEntranceList;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 naviMsgNum;
|
||||
/* 0x04 */ u32 keepObjectId;
|
||||
} SCmdSpecialFiles;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 gpFlag1;
|
||||
/* 0x04 */ u32 gpFlag2;
|
||||
} SCmdRoomBehavior;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x04 */ u32 segment;
|
||||
} SCmdMesh;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 num;
|
||||
/* 0x04 */ u32 segment;
|
||||
} SCmdObjectList;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 num;
|
||||
/* 0x04 */ u32 segment;
|
||||
} SCmdLightList;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x04 */ u32 segment;
|
||||
} SCmdPathList;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 num;
|
||||
/* 0x04 */ u32 segment;
|
||||
} SCmdTransiActorList;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 num;
|
||||
/* 0x04 */ u32 segment;
|
||||
} SCmdLightSettingList;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x02 */ char pad[2];
|
||||
@@ -139,8 +121,7 @@ typedef struct
|
||||
/* 0x06 */ u8 unk_06;
|
||||
} SCmdTimeSettings;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x02 */ char pad[2];
|
||||
@@ -149,8 +130,7 @@ typedef struct
|
||||
/* 0x06 */ u8 unk_06;
|
||||
} SCmdSkyboxSettings;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x02 */ char pad[2];
|
||||
@@ -158,22 +138,19 @@ typedef struct
|
||||
/* 0x05 */ u8 unk_05;
|
||||
} SCmdSkyboxDisables;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x04 */ u32 data2;
|
||||
} SCmdEndMarker;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x04 */ u32 segment;
|
||||
} SCmdExitList;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 bgmId;
|
||||
/* 0x02 */ char pad[4];
|
||||
@@ -181,42 +158,36 @@ typedef struct
|
||||
/* 0x07 */ u8 musicSeq;
|
||||
} SCmdSoundSettings;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x02 */ char pad[5];
|
||||
/* 0x07 */ u8 echo;
|
||||
} SCmdEchoSettings;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x04 */ u32 segment;
|
||||
} SCmdCutsceneData;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x04 */ u32 segment;
|
||||
} SCmdAltHeaders;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 cameraMovement;
|
||||
/* 0x04 */ u32 area;
|
||||
} SCmdMiscSettings;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
u8 headerType;
|
||||
} MeshHeaderBase;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
MeshHeaderBase base;
|
||||
|
||||
u8 numEntries;
|
||||
@@ -224,180 +195,144 @@ typedef struct
|
||||
u32 dListEnd;
|
||||
} MeshHeader0;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
u32 opaqueDList;
|
||||
u32 translucentDList;
|
||||
u32 translucentDList;
|
||||
} MeshEntry0;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
MeshHeaderBase base;
|
||||
|
||||
u8 format;
|
||||
u32 entryRecord;
|
||||
} MeshHeader1Base;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
MeshHeader1Base base;
|
||||
|
||||
u32 imagePtr; // 0x08
|
||||
|
||||
u32 unknown; // 0x0C
|
||||
u32 unknown2; // 0x10
|
||||
|
||||
u16 bgWidth; // 0x14
|
||||
u16 bgHeight; // 0x16
|
||||
|
||||
u8 imageFormat; // 0x18
|
||||
u8 imageSize; // 0x19
|
||||
u16 imagePal; // 0x1A
|
||||
u16 imageFlip; // 0x1C
|
||||
|
||||
u32 unknown; // 0x0C
|
||||
u32 unknown2; // 0x10
|
||||
u16 bgWidth; // 0x14
|
||||
u16 bgHeight; // 0x16
|
||||
u8 imageFormat; // 0x18
|
||||
u8 imageSize; // 0x19
|
||||
u16 imagePal; // 0x1A
|
||||
u16 imageFlip; // 0x1C
|
||||
} MeshHeader1Single;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
MeshHeader1Base base;
|
||||
|
||||
u8 bgCnt;
|
||||
u32 bgRecordPtr;
|
||||
|
||||
} MeshHeader1Multi;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
u16 unknown; // 0x00
|
||||
s8 bgID; // 0x02
|
||||
|
||||
u32 imagePtr; // 0x04
|
||||
u32 unknown2; // 0x08
|
||||
u32 unknown3; // 0x0C
|
||||
|
||||
u16 bgWidth; // 0x10
|
||||
u16 bgHeight; // 0x12
|
||||
|
||||
u8 imageFmt; // 0x14
|
||||
u8 imageSize; // 0x15
|
||||
u16 imagePal; // 0x16
|
||||
u16 imageFlip; // 0x18
|
||||
s8 bgID; // 0x02
|
||||
u32 imagePtr; // 0x04
|
||||
u32 unknown2; // 0x08
|
||||
u32 unknown3; // 0x0C
|
||||
u16 bgWidth; // 0x10
|
||||
u16 bgHeight; // 0x12
|
||||
u8 imageFmt; // 0x14
|
||||
u8 imageSize; // 0x15
|
||||
u16 imagePal; // 0x16
|
||||
u16 imageFlip; // 0x18
|
||||
} BackgroundRecord;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
s16 playerXMax, playerZMax;
|
||||
s16 playerXMin, playerZMin;
|
||||
|
||||
u32 opaqueDList;
|
||||
u32 translucentDList;
|
||||
typedef struct {
|
||||
s16 playerXMax, playerZMax;
|
||||
s16 playerXMin, playerZMin;
|
||||
u32 opaqueDList;
|
||||
u32 translucentDList;
|
||||
} MeshEntry2;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
MeshHeaderBase base;
|
||||
|
||||
u8 numEntries;
|
||||
u32 dListStart;
|
||||
u32 dListEnd;
|
||||
u32 dListStart;
|
||||
u32 dListEnd;
|
||||
} MeshHeader2;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
u8 ambientClrR, ambientClrG, ambientClrB;
|
||||
|
||||
u8 diffuseClrA_R, diffuseClrA_G, diffuseClrA_B;
|
||||
u8 diffuseDirA_X, diffuseDirA_Y, diffuseDirA_Z;
|
||||
u8 diffuseClrB_R, diffuseClrB_G, diffuseClrB_B;
|
||||
u8 diffuseDirB_X, diffuseDirB_Y, diffuseDirB_Z;
|
||||
|
||||
u8 fogClrR, fogClrG, fogClrB;
|
||||
u16 unk;
|
||||
u16 drawDistance;
|
||||
} LightSettings;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
s16 absMinX, absMinY, absMinZ;
|
||||
s16 absMaxX, absMaxY, absMaxZ;
|
||||
s16 numVerts;
|
||||
s32 vtxSegmentOffset;
|
||||
s16 numPolygons;
|
||||
s32 polySegmentOffset;
|
||||
s32 polyTypeDefSegmentOffset;
|
||||
s32 camDataSegmentOffset;
|
||||
|
||||
s16 numWaterBoxes;
|
||||
s32 waterBoxSegmentOffset;
|
||||
s16 numVerts;
|
||||
s32 vtxSegmentOffset;
|
||||
s16 numPolygons;
|
||||
s32 polySegmentOffset;
|
||||
s32 polyTypeDefSegmentOffset;
|
||||
s32 camDataSegmentOffset;
|
||||
s16 numWaterBoxes;
|
||||
s32 waterBoxSegmentOffset;
|
||||
} ColHeader;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
s16 cameraSType; // 0x00
|
||||
s16 numCameras; // 0x02
|
||||
s32 camPosDataSeg; // 0x04
|
||||
s16 numCameras; // 0x02
|
||||
s32 camPosDataSeg; // 0x04
|
||||
} CamData;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
u32 unknown;
|
||||
u32 camPosDataSeg;
|
||||
} CamPosDataEntry;
|
||||
|
||||
|
||||
/*
|
||||
typedef union
|
||||
{
|
||||
typedef union {
|
||||
_CamData data;
|
||||
long long int forceStructAlignment;
|
||||
} CamData;
|
||||
*/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
s16 posX, posY, posZ;
|
||||
s16 rotX, rotY, rotZ;
|
||||
s16 fov;
|
||||
s16 jfifId;
|
||||
s16 unk;
|
||||
//s16 unk2;
|
||||
//s32 unk;
|
||||
s16 rotX, rotY, rotZ;
|
||||
s16 fov;
|
||||
s16 jfifId;
|
||||
s16 unk;
|
||||
} CamPosData;
|
||||
|
||||
/*
|
||||
typedef union
|
||||
{
|
||||
typedef union {
|
||||
_CamPosData data;
|
||||
long long int forceStructAlignment;
|
||||
} CamPosData;
|
||||
*/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
s16 type;
|
||||
s16 vtxA, vtxB, vtxC;
|
||||
s16 a, b, c, d;
|
||||
s16 vtxA, vtxB, vtxC;
|
||||
s16 a, b, c, d;
|
||||
} RoomPoly;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
s16 xMin;
|
||||
s16 ySurface;
|
||||
s16 zMin;
|
||||
s16 xLength;
|
||||
s16 zLength;
|
||||
s32 properties;
|
||||
s16 ySurface;
|
||||
s16 zMin;
|
||||
s16 xLength;
|
||||
s16 zLength;
|
||||
s32 properties;
|
||||
} WaterBoxHeader;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 count; // Total number of points in the path for the actor to follow
|
||||
/* 0x04 */ Vec3s* path; // Segment Address of the start of the path list
|
||||
} Path; // size = 0x8
|
||||
|
||||
typedef union
|
||||
{
|
||||
typedef union {
|
||||
SCmdBase base;
|
||||
SCmdSpawnList spawnList;
|
||||
SCmdActorList actorList;
|
||||
@@ -426,8 +361,7 @@ typedef union
|
||||
SCmdAltHeaders altHeaders;
|
||||
} SceneCmd; // size = 0x8
|
||||
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
/* 0x00 */ SCENE_YDAN,
|
||||
/* 0x01 */ SCENE_DDAN,
|
||||
/* 0x02 */ SCENE_BDAN,
|
||||
|
||||
+1
-2
@@ -1,7 +1,6 @@
|
||||
#include <z64.h>
|
||||
|
||||
void __assert(const char* exp, const char* file, s32 line)
|
||||
{
|
||||
void __assert(const char* exp, const char* file, s32 line) {
|
||||
char msg[256];
|
||||
osSyncPrintf("Assertion failed: %s, file %s, line %d, thread %d\n", exp, file, line, osGetThreadId(NULL));
|
||||
sprintf(msg, "ASSERT: %s:%d(%d)", file, line, osGetThreadId(NULL));
|
||||
|
||||
@@ -7,14 +7,12 @@ u8 sIdleThreadStack[0x400];
|
||||
StackEntry sIdleThreadInfo;
|
||||
u8 sBootThreadStack[0x400];
|
||||
|
||||
void cleararena(void)
|
||||
{
|
||||
void cleararena(void) {
|
||||
bzero(_dmadataSegmentStart, (u8*)osMemSize - OS_K0_TO_PHYSICAL(_dmadataSegmentStart));
|
||||
}
|
||||
|
||||
void bootproc(void)
|
||||
{
|
||||
StackCheck_Init(&sBootThreadInfo, sBootThreadStack, sBootThreadStack+sizeof(sBootThreadStack), 0, -1, "boot");
|
||||
void bootproc(void) {
|
||||
StackCheck_Init(&sBootThreadInfo, sBootThreadStack, sBootThreadStack + sizeof(sBootThreadStack), 0, -1, "boot");
|
||||
|
||||
osMemSize = osGetMemSize();
|
||||
cleararena();
|
||||
@@ -25,8 +23,8 @@ void bootproc(void)
|
||||
osDriveRomInit();
|
||||
isPrintfInit();
|
||||
Locale_Init();
|
||||
|
||||
StackCheck_Init(&sIdleThreadInfo, sIdleThreadStack, sIdleThreadStack+sizeof(sIdleThreadStack), 0, 256, "idle");
|
||||
osCreateThread(&sIdleThread, 1, Idle_ThreadEntry, 0, sIdleThreadStack+sizeof(sIdleThreadStack), 10);
|
||||
|
||||
StackCheck_Init(&sIdleThreadInfo, sIdleThreadStack, sIdleThreadStack + sizeof(sIdleThreadStack), 0, 256, "idle");
|
||||
osCreateThread(&sIdleThread, 1, Idle_ThreadEntry, 0, sIdleThreadStack + sizeof(sIdleThreadStack), 10);
|
||||
osStartThread(&sIdleThread);
|
||||
}
|
||||
|
||||
+9
-10
@@ -17,15 +17,15 @@ u32 gViConfigFeatures = OS_VI_DITHER_FILTER_ON | OS_VI_GAMMA_OFF;
|
||||
f32 gViConfigXScale = 1.0;
|
||||
f32 gViConfigYScale = 1.0;
|
||||
|
||||
void Main_ThreadEntry(void* arg0)
|
||||
{
|
||||
void Main_ThreadEntry(void* arg0) {
|
||||
OSTime var1;
|
||||
|
||||
osSyncPrintf("mainx 実行開始\n");
|
||||
DmaMgr_Start();
|
||||
osSyncPrintf("codeセグメントロード中...");
|
||||
var1 = osGetTime();
|
||||
DmaMgr_SendRequest1((u32)_dmadataSegmentEnd, (u32)_codeSegmentRomStart, _codeSegmentRomEnd - _codeSegmentRomStart, "../idle.c", 238);
|
||||
DmaMgr_SendRequest1((u32)_dmadataSegmentEnd, (u32)_codeSegmentRomStart, _codeSegmentRomEnd - _codeSegmentRomStart,
|
||||
"../idle.c", 238);
|
||||
var1 -= osGetTime();
|
||||
osSyncPrintf("\rcodeセグメントロード中...完了\n");
|
||||
osSyncPrintf("転送時間 %6.3f\n");
|
||||
@@ -35,8 +35,7 @@ void Main_ThreadEntry(void* arg0)
|
||||
osSyncPrintf("mainx 実行終了\n");
|
||||
}
|
||||
|
||||
void Idle_ThreadEntry(void* a0)
|
||||
{
|
||||
void Idle_ThreadEntry(void* a0) {
|
||||
osSyncPrintf("アイドルスレッド(idleproc)実行開始\n");
|
||||
osSyncPrintf("作製者 : %s\n", gBuildTeam);
|
||||
osSyncPrintf("作成日時 : %s\n", gBuildDate);
|
||||
@@ -57,8 +56,7 @@ void Idle_ThreadEntry(void* a0)
|
||||
gViConfigXScale = 1.0f;
|
||||
gViConfigYScale = 1.0f;
|
||||
|
||||
switch (osTvType)
|
||||
{
|
||||
switch (osTvType) {
|
||||
case 1:
|
||||
D_80013960 = 2;
|
||||
gViConfigMode = osViModeNtscLan1;
|
||||
@@ -82,11 +80,12 @@ void Idle_ThreadEntry(void* a0)
|
||||
osViBlack(1);
|
||||
osViSwapBuffer(0x803da80);
|
||||
osCreatePiManager(0x96, &gPiMgrCmdQ, sPiMgrCmdBuff, 0x32);
|
||||
StackCheck_Init(&sMainStackInfo, sMainStack, sMainStack+sizeof(sMainStack), 0, 0x400, "main");
|
||||
osCreateThread(&sMainThread, 3, Main_ThreadEntry, a0, sMainStack+sizeof(sMainStack), 10);
|
||||
StackCheck_Init(&sMainStackInfo, sMainStack, sMainStack + sizeof(sMainStack), 0, 0x400, "main");
|
||||
osCreateThread(&sMainThread, 3, Main_ThreadEntry, a0, sMainStack + sizeof(sMainStack), 10);
|
||||
osStartThread(&sMainThread);
|
||||
osSetThreadPri(NULL, 0);
|
||||
|
||||
while(1)
|
||||
while (1) {
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
+23
-29
@@ -1,82 +1,76 @@
|
||||
#include <z64.h>
|
||||
#include <global.h>
|
||||
|
||||
OSPiHandle* sISVHandle; //official name : is_Handle
|
||||
OSPiHandle* sISVHandle; // official name : is_Handle
|
||||
|
||||
#define gISVDbgPrnAdrs ((ISVDbg*)0xb3ff0000)
|
||||
#define ASCII_TO_U32(a, b, c, d) ((u32)((a << 24) | (b << 16) | (c << 8) | (d << 0)))
|
||||
|
||||
void isPrintfInit()
|
||||
{
|
||||
void isPrintfInit() {
|
||||
sISVHandle = osCartRomInit();
|
||||
osEPiWriteIo(sISVHandle, (u32)&gISVDbgPrnAdrs->put, 0);
|
||||
osEPiWriteIo(sISVHandle, (u32)&gISVDbgPrnAdrs->get, 0);
|
||||
osEPiWriteIo(sISVHandle, (u32)&gISVDbgPrnAdrs->magic, ASCII_TO_U32('I','S','6','4'));
|
||||
osEPiWriteIo(sISVHandle, (u32)&gISVDbgPrnAdrs->magic, ASCII_TO_U32('I', 'S', '6', '4'));
|
||||
}
|
||||
|
||||
void osSyncPrintfUnused(const char* fmt, ...)
|
||||
{
|
||||
void osSyncPrintfUnused(const char* fmt, ...) {
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
|
||||
_Printf(&is_proutSyncPrintf, NULL, fmt, args);
|
||||
}
|
||||
|
||||
void osSyncPrintf(const char* fmt, ...)
|
||||
{
|
||||
void osSyncPrintf(const char* fmt, ...) {
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
|
||||
_Printf(&is_proutSyncPrintf, NULL, fmt, args);
|
||||
}
|
||||
|
||||
//assumption
|
||||
void rmonPrintf(const char* fmt, ...)
|
||||
{
|
||||
// assumption
|
||||
void rmonPrintf(const char* fmt, ...) {
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
|
||||
_Printf(&is_proutSyncPrintf, NULL, fmt, args);
|
||||
}
|
||||
|
||||
u32 is_proutSyncPrintf(void* arg0, const char *str, s32 count)
|
||||
{
|
||||
u32 is_proutSyncPrintf(void* arg0, const char* str, s32 count) {
|
||||
u32 data;
|
||||
s32 pos;
|
||||
s32 start;
|
||||
s32 end;
|
||||
|
||||
osEPiReadIo(sISVHandle, (u32)&gISVDbgPrnAdrs->magic, &data);
|
||||
if (data != ASCII_TO_U32('I','S','6','4'))
|
||||
if (data != ASCII_TO_U32('I', 'S', '6', '4')) {
|
||||
return 1;
|
||||
}
|
||||
osEPiReadIo(sISVHandle, (u32)&gISVDbgPrnAdrs->get, &data);
|
||||
pos = data;
|
||||
osEPiReadIo(sISVHandle, (u32)&gISVDbgPrnAdrs->put, &data);
|
||||
start = data;
|
||||
end = start + count;
|
||||
if (end >= 0xffe0)
|
||||
{
|
||||
if (end >= 0xffe0) {
|
||||
end -= 0xffe0;
|
||||
if (pos < end || start < pos)
|
||||
if (pos < end || start < pos) {
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (start < pos && pos < end)
|
||||
}
|
||||
} else {
|
||||
if (start < pos && pos < end) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
while (count)
|
||||
{
|
||||
while (count) {
|
||||
u32 addr = (u32)&gISVDbgPrnAdrs->data + (start & 0xffffffc);
|
||||
s32 shift = ((3 - (start & 3)) * 8);
|
||||
if (*str)
|
||||
{
|
||||
if (*str) {
|
||||
osEPiReadIo(sISVHandle, addr, &data);
|
||||
osEPiWriteIo(sISVHandle, addr, (*str << shift) | (data & ~(0xff << shift)));
|
||||
|
||||
start++;
|
||||
if (start >= 0xffe0)
|
||||
if (start >= 0xffe0) {
|
||||
start -= 0xffe0;
|
||||
}
|
||||
}
|
||||
count--;
|
||||
str++;
|
||||
@@ -85,9 +79,9 @@ u32 is_proutSyncPrintf(void* arg0, const char *str, s32 count)
|
||||
return 1;
|
||||
}
|
||||
|
||||
void func_80002384(const char* exp, const char* file, u32 line)
|
||||
{
|
||||
void func_80002384(const char* exp, const char* file, u32 line) {
|
||||
osSyncPrintf("File:%s Line:%d %s \n", file, line, exp);
|
||||
while (true)
|
||||
while (true) {
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
+46
-47
@@ -2,22 +2,25 @@
|
||||
#include <global.h>
|
||||
#include <vt.h>
|
||||
|
||||
float LogUtils_CheckFloatRange(const char* exp, s32 arg1, const char* var1Name, float var1, const char* var2Name, float var2, const char* var3Name, float var3)
|
||||
{
|
||||
if (var1 < var2 || var3 < var1)
|
||||
osSyncPrintf("%s %d: range error %s(%f) < %s(%f) < %s(%f)\n", exp, arg1, var2Name, var2, var1Name, var1, var3Name, var3);
|
||||
float LogUtils_CheckFloatRange(const char* exp, s32 arg1, const char* var1Name, float var1, const char* var2Name,
|
||||
float var2, const char* var3Name, float var3) {
|
||||
if (var1 < var2 || var3 < var1) {
|
||||
osSyncPrintf("%s %d: range error %s(%f) < %s(%f) < %s(%f)\n", exp, arg1, var2Name, var2, var1Name, var1,
|
||||
var3Name, var3);
|
||||
}
|
||||
return var1;
|
||||
}
|
||||
|
||||
s32 LogUtils_CheckIntRange(const char* exp, s32 arg1, const char* var1Name, s32 var1, const char* var2Name, s32 var2, const char* var3Name, s32 var3)
|
||||
{
|
||||
if (var1 < var2 || var3 < var1)
|
||||
osSyncPrintf("%s %d: range error %s(%d) < %s(%d) < %s(%d)\n", exp, arg1, var2Name, var2, var1Name, var1, var3Name, var3);
|
||||
s32 LogUtils_CheckIntRange(const char* exp, s32 arg1, const char* var1Name, s32 var1, const char* var2Name, s32 var2,
|
||||
const char* var3Name, s32 var3) {
|
||||
if (var1 < var2 || var3 < var1) {
|
||||
osSyncPrintf("%s %d: range error %s(%d) < %s(%d) < %s(%d)\n", exp, arg1, var2Name, var2, var1Name, var1,
|
||||
var3Name, var3);
|
||||
}
|
||||
return var1;
|
||||
}
|
||||
|
||||
void LogUtils_LogHexDump(void* ptr, s32 size0)
|
||||
{
|
||||
void LogUtils_LogHexDump(void* ptr, s32 size0) {
|
||||
u8* addr = (u8*)ptr;
|
||||
s32 size = (s32)size0;
|
||||
s32 rest;
|
||||
@@ -28,40 +31,39 @@ void LogUtils_LogHexDump(void* ptr, s32 size0)
|
||||
osSyncPrintf("address off +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +a +b +c +d +e +f 0123456789abcdef\n");
|
||||
|
||||
off = 0;
|
||||
while (size > 0)
|
||||
{
|
||||
while (size > 0) {
|
||||
|
||||
osSyncPrintf("%08x %04x", addr, off);
|
||||
rest = (size < 0x10) ? size : 0x10;
|
||||
|
||||
i = 0;
|
||||
while (true)
|
||||
{
|
||||
if(i < rest)
|
||||
while (true) {
|
||||
if (i < rest) {
|
||||
osSyncPrintf(" %02x", *((u8*)addr + i));
|
||||
else
|
||||
} else {
|
||||
osSyncPrintf(" ");
|
||||
}
|
||||
|
||||
i++;
|
||||
if (i > 0xf)
|
||||
if (i > 0xf) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
osSyncPrintf(" ");
|
||||
|
||||
i = 0;
|
||||
while (true)
|
||||
{
|
||||
if(i < rest)
|
||||
{
|
||||
u8 a = *(addr+i);
|
||||
while (true) {
|
||||
if (i < rest) {
|
||||
u8 a = *(addr + i);
|
||||
osSyncPrintf("%c", (a >= 0x20 && a < 0x7f) ? a : '.');
|
||||
}
|
||||
else
|
||||
} else {
|
||||
osSyncPrintf(" ");
|
||||
}
|
||||
|
||||
i++;
|
||||
if (i > 0xf)
|
||||
if (i > 0xf) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
osSyncPrintf("\n");
|
||||
size -= rest;
|
||||
@@ -70,46 +72,43 @@ void LogUtils_LogHexDump(void* ptr, s32 size0)
|
||||
}
|
||||
}
|
||||
|
||||
void LogUtils_LogPointer(s32 value, u32 max, void* ptr, const char *name, const char *file, s32 line)
|
||||
{
|
||||
void LogUtils_LogPointer(s32 value, u32 max, void* ptr, const char* name, const char* file, s32 line) {
|
||||
osSyncPrintf(VT_COL(RED, WHITE) "%s %d %s[%d] max=%u ptr=%08x\n" VT_RST, file, line, name, value, max, ptr);
|
||||
}
|
||||
|
||||
void LogUtils_CheckBoundary(const char* name, s32 value, s32 unk, const char* file, s32 line)
|
||||
{
|
||||
u32 mask = (unk - 1);
|
||||
if (value & mask)
|
||||
osSyncPrintf(VT_COL(RED, WHITE) "%s %d:%s(%08x) は バウンダリ(%d)違反です\n" VT_RST, file, line, name, value, unk);
|
||||
void LogUtils_CheckBoundary(const char* name, s32 value, s32 unk, const char* file, s32 line) {
|
||||
u32 mask = (unk - 1);
|
||||
if (value & mask) {
|
||||
osSyncPrintf(VT_COL(RED, WHITE) "%s %d:%s(%08x) は バウンダリ(%d)違反です\n" VT_RST, file, line, name, value,
|
||||
unk);
|
||||
}
|
||||
}
|
||||
|
||||
void LogUtils_CheckNullPointer(const char* exp, void* ptr, const char* file, s32 line)
|
||||
{
|
||||
if (!ptr)
|
||||
void LogUtils_CheckNullPointer(const char* exp, void* ptr, const char* file, s32 line) {
|
||||
if (!ptr) {
|
||||
osSyncPrintf(VT_COL(RED, WHITE) "%s %d:%s は はヌルポインタです\n" VT_RST, file, line, exp);
|
||||
}
|
||||
}
|
||||
|
||||
//check valid pointer
|
||||
void LogUtils_CheckValidPointer(const char* exp, void* ptr0, const char* file, s32 line)
|
||||
{
|
||||
// check valid pointer
|
||||
void LogUtils_CheckValidPointer(const char* exp, void* ptr0, const char* file, s32 line) {
|
||||
u32 ptr = (u32)ptr0;
|
||||
if (!ptr || ptr < 0x80000000U || (0x80000000U + osMemSize) <= ptr)
|
||||
if (!ptr || ptr < 0x80000000U || (0x80000000U + osMemSize) <= ptr) {
|
||||
osSyncPrintf(VT_COL(RED, WHITE) "%s %d:ポインタ %s(%08x) が異常です\n" VT_RST, file, line, exp, ptr);
|
||||
}
|
||||
}
|
||||
|
||||
//there's probalby a macro like this : MACRO(exp) LogUtils_LogThreadId(__FILE__, __LINE__); osSyncPrintf(exp)
|
||||
void LogUtils_LogThreadId(const char* name, s32 line)
|
||||
{
|
||||
// there's probalby a macro like this : MACRO(exp) LogUtils_LogThreadId(__FILE__, __LINE__); osSyncPrintf(exp)
|
||||
void LogUtils_LogThreadId(const char* name, s32 line) {
|
||||
osSyncPrintf("<%d %s %d>", osGetThreadId(NULL), name, line);
|
||||
}
|
||||
|
||||
void LogUtils_HungupThread(const char* name, s32 line)
|
||||
{
|
||||
void LogUtils_HungupThread(const char* name, s32 line) {
|
||||
osSyncPrintf("*** HungUp in thread %d, [%s:%d] ***\n", osGetThreadId(NULL), name, line);
|
||||
Fault_AddHungupAndCrash(name, line);
|
||||
}
|
||||
|
||||
void LogUtils_ResetHungup()
|
||||
{
|
||||
void LogUtils_ResetHungup() {
|
||||
osSyncPrintf("*** Reset ***\n");
|
||||
Fault_AddHungupAndCrash("Reset", 0);
|
||||
}
|
||||
}
|
||||
|
||||
+50
-57
@@ -5,137 +5,130 @@
|
||||
StackEntry* sStackInfoListStart = NULL;
|
||||
StackEntry* sStackInfoListEnd = NULL;
|
||||
|
||||
void StackCheck_Init(StackEntry* entry, void* stackTop, void* stackBottom, u32 initValue, s32 minSpace, const char* name)
|
||||
{
|
||||
void StackCheck_Init(StackEntry* entry, void* stackTop, void* stackBottom, u32 initValue, s32 minSpace,
|
||||
const char* name) {
|
||||
StackEntry* iter;
|
||||
u32* addr;
|
||||
|
||||
if (!entry)
|
||||
if (!entry) {
|
||||
sStackInfoListStart = NULL;
|
||||
else
|
||||
{
|
||||
} else {
|
||||
entry->head = (u32)stackTop;
|
||||
entry->tail = (u32)stackBottom;
|
||||
entry->initValue = initValue;
|
||||
entry->minSpace = minSpace;
|
||||
entry->name = name;
|
||||
iter = sStackInfoListStart;
|
||||
while (iter)
|
||||
{
|
||||
if (iter == entry)
|
||||
{
|
||||
while (iter) {
|
||||
if (iter == entry) {
|
||||
osSyncPrintf(VT_COL(RED, WHITE) "stackcheck_init: %08x は既にリスト中にある\n" VT_RST, entry);
|
||||
return;
|
||||
}
|
||||
iter = iter->next;
|
||||
}
|
||||
|
||||
|
||||
entry->prev = sStackInfoListEnd;
|
||||
entry->next = NULL;
|
||||
|
||||
if (sStackInfoListEnd)
|
||||
|
||||
if (sStackInfoListEnd) {
|
||||
sStackInfoListEnd->next = entry;
|
||||
}
|
||||
|
||||
sStackInfoListEnd = entry;
|
||||
if (!sStackInfoListStart)
|
||||
if (!sStackInfoListStart) {
|
||||
sStackInfoListStart = entry;
|
||||
}
|
||||
|
||||
if (entry->minSpace != -1)
|
||||
{
|
||||
if (entry->minSpace != -1) {
|
||||
addr = (u32*)entry->head;
|
||||
while ((u32)addr < entry->tail)
|
||||
while ((u32)addr < entry->tail) {
|
||||
*addr++ = entry->initValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void StackCheck_Cleanup(StackEntry* entry)
|
||||
{
|
||||
void StackCheck_Cleanup(StackEntry* entry) {
|
||||
bool inconsistency = false;
|
||||
|
||||
if (!entry->prev)
|
||||
{
|
||||
if (entry == sStackInfoListStart)
|
||||
if (!entry->prev) {
|
||||
if (entry == sStackInfoListStart) {
|
||||
sStackInfoListStart = entry->next;
|
||||
else
|
||||
} else {
|
||||
inconsistency = true;
|
||||
}
|
||||
else
|
||||
}
|
||||
} else {
|
||||
entry->prev->next = entry->next;
|
||||
|
||||
if (!entry->next)
|
||||
{
|
||||
if (entry == sStackInfoListEnd)
|
||||
sStackInfoListEnd = entry->prev;
|
||||
else
|
||||
inconsistency = true;
|
||||
}
|
||||
if (inconsistency)
|
||||
|
||||
if (!entry->next) {
|
||||
if (entry == sStackInfoListEnd) {
|
||||
sStackInfoListEnd = entry->prev;
|
||||
} else {
|
||||
inconsistency = true;
|
||||
}
|
||||
}
|
||||
if (inconsistency) {
|
||||
osSyncPrintf(VT_COL(RED, WHITE) "stackcheck_cleanup: %08x リスト不整合です\n" VT_RST, entry);
|
||||
}
|
||||
}
|
||||
|
||||
StackStatus StackCheck_GetState(StackEntry* entry)
|
||||
{
|
||||
StackStatus StackCheck_GetState(StackEntry* entry) {
|
||||
u32* last;
|
||||
u32 used;
|
||||
u32 free;
|
||||
s32 ret;
|
||||
|
||||
for (last = (u32*)entry->head; (u32)last < entry->tail; last++)
|
||||
{
|
||||
if (entry->initValue != *last)
|
||||
for (last = (u32*)entry->head; (u32)last < entry->tail; last++) {
|
||||
if (entry->initValue != *last) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
used = entry->tail - (u32)last;
|
||||
free = (u32)last - entry->head;
|
||||
|
||||
if (free == 0)
|
||||
{
|
||||
if (free == 0) {
|
||||
ret = STACK_STATUS_OVERFLOW;
|
||||
osSyncPrintf(VT_FGCOL(RED));
|
||||
}
|
||||
else if (free < entry->minSpace && entry->minSpace != -1)
|
||||
{
|
||||
} else if (free < entry->minSpace && entry->minSpace != -1) {
|
||||
ret = STACK_STATUS_WARNING;
|
||||
osSyncPrintf(VT_FGCOL(YELLOW));
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
osSyncPrintf(VT_FGCOL(GREEN));
|
||||
ret = STACK_STATUS_OK;
|
||||
}
|
||||
|
||||
osSyncPrintf("head=%08x tail=%08x last=%08x used=%08x free=%08x [%s]\n", entry->head, entry->tail, last, used, free, entry->name ? entry->name : "(null)");
|
||||
osSyncPrintf("head=%08x tail=%08x last=%08x used=%08x free=%08x [%s]\n", entry->head, entry->tail, last, used, free,
|
||||
entry->name ? entry->name : "(null)");
|
||||
osSyncPrintf(VT_RST);
|
||||
|
||||
if (ret != STACK_STATUS_OK)
|
||||
if (ret != STACK_STATUS_OK) {
|
||||
LogUtils_LogHexDump(entry->head, entry->tail - entry->head);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
u32 StackCheck_CheckAll()
|
||||
{
|
||||
u32 StackCheck_CheckAll() {
|
||||
u32 ret = 0;
|
||||
|
||||
StackEntry* iter = sStackInfoListStart;
|
||||
while(iter)
|
||||
{
|
||||
while (iter) {
|
||||
u32 state = StackCheck_GetState(iter);
|
||||
if (state != STACK_STATUS_OK)
|
||||
if (state != STACK_STATUS_OK) {
|
||||
ret = 1;
|
||||
}
|
||||
iter = iter->next;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
u32 StackCheck_Check(StackEntry* entry)
|
||||
{
|
||||
if (!entry)
|
||||
u32 StackCheck_Check(StackEntry* entry) {
|
||||
if (!entry) {
|
||||
return StackCheck_CheckAll();
|
||||
else
|
||||
} else {
|
||||
return StackCheck_GetState(entry);
|
||||
}
|
||||
}
|
||||
|
||||
+17
-18
@@ -2,35 +2,34 @@
|
||||
#include <global.h>
|
||||
#include <vt.h>
|
||||
|
||||
//this should probably go elsewhere but right now viconfig.o is the only object between idle and z_std_dma
|
||||
// this should probably go elsewhere but right now viconfig.o is the only object between idle and z_std_dma
|
||||
OSPiHandle* gCartHandle = 0;
|
||||
|
||||
void ViConfig_UpdateVi(u32 arg0)
|
||||
{
|
||||
if (arg0 != 0)
|
||||
{
|
||||
void ViConfig_UpdateVi(u32 arg0) {
|
||||
if (arg0 != 0) {
|
||||
osSyncPrintf(VT_COL(YELLOW, BLACK) "osViSetYScale1(%f);\n" VT_RST, 1.0f);
|
||||
|
||||
if (osTvType == 0)
|
||||
if (osTvType == 0) {
|
||||
osViSetMode(&osViModePalLan1);
|
||||
}
|
||||
|
||||
osViSetYScale(1.0f);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
osViSetMode(&gViConfigMode);
|
||||
|
||||
if (gViConfigAdditionalScanLines != 0)
|
||||
if (gViConfigAdditionalScanLines != 0) {
|
||||
osViExtendVStart(gViConfigAdditionalScanLines);
|
||||
}
|
||||
|
||||
if (gViConfigFeatures != 0)
|
||||
if (gViConfigFeatures != 0) {
|
||||
osViSetSpecialFeatures(gViConfigFeatures);
|
||||
}
|
||||
|
||||
if (gViConfigXScale != 1.0f)
|
||||
if (gViConfigXScale != 1.0f) {
|
||||
osViSetXScale(gViConfigXScale);
|
||||
}
|
||||
|
||||
if (gViConfigYScale != 1.0f)
|
||||
{
|
||||
if (gViConfigYScale != 1.0f) {
|
||||
osSyncPrintf(VT_COL(YELLOW, BLACK) "osViSetYScale3(%f);\n" VT_RST, gViConfigYScale);
|
||||
osViSetYScale(gViConfigYScale);
|
||||
}
|
||||
@@ -39,10 +38,10 @@ void ViConfig_UpdateVi(u32 arg0)
|
||||
gViConfigUseDefault = arg0;
|
||||
}
|
||||
|
||||
void ViConfig_UpdateBlack()
|
||||
{
|
||||
if (gViConfigUseDefault != 0)
|
||||
void ViConfig_UpdateBlack() {
|
||||
if (gViConfigUseDefault != 0) {
|
||||
osViBlack(1);
|
||||
else
|
||||
} else {
|
||||
osViBlack(0);
|
||||
}
|
||||
}
|
||||
|
||||
+20
-32
@@ -7,50 +7,45 @@ u32 sYaz0CurRomStart;
|
||||
u32 sYaz0CurSize;
|
||||
u32 sYaz0MaxPtr;
|
||||
|
||||
void* Yaz0_FirstDMA()
|
||||
{
|
||||
void* Yaz0_FirstDMA() {
|
||||
u32 pad0;
|
||||
u32 pad1;
|
||||
u32 dmaSize;
|
||||
u32 curSize;
|
||||
|
||||
sYaz0MaxPtr = sYaz0CurDataEnd - 0x19;
|
||||
|
||||
|
||||
curSize = sYaz0CurDataEnd - (u32)sYaz0DataBuffer;
|
||||
dmaSize = (curSize > sYaz0CurSize)
|
||||
? sYaz0CurSize
|
||||
: curSize;
|
||||
|
||||
dmaSize = (curSize > sYaz0CurSize) ? sYaz0CurSize : curSize;
|
||||
|
||||
DmaMgr_DMARomToRam(sYaz0CurRomStart, sYaz0DataBuffer, dmaSize);
|
||||
sYaz0CurRomStart += dmaSize;
|
||||
sYaz0CurSize -= dmaSize;
|
||||
return sYaz0DataBuffer;
|
||||
}
|
||||
|
||||
void* Yaz0_NextDMA(void* curSrcPos)
|
||||
{
|
||||
void* Yaz0_NextDMA(void* curSrcPos) {
|
||||
u8* dst;
|
||||
u32 restSize;
|
||||
u32 dmaSize;
|
||||
|
||||
restSize = sYaz0CurDataEnd - (u32)curSrcPos;
|
||||
|
||||
dst = (restSize & 7)
|
||||
? (sYaz0DataBuffer - (restSize & 7)) + 8
|
||||
: sYaz0DataBuffer;
|
||||
dst = (restSize & 7) ? (sYaz0DataBuffer - (restSize & 7)) + 8 : sYaz0DataBuffer;
|
||||
|
||||
bcopy(curSrcPos, dst, restSize);
|
||||
dmaSize = (sYaz0CurDataEnd - (u32)dst) - restSize;
|
||||
if (sYaz0CurSize < dmaSize)
|
||||
if (sYaz0CurSize < dmaSize) {
|
||||
dmaSize = sYaz0CurSize;
|
||||
}
|
||||
|
||||
if (dmaSize != 0)
|
||||
{
|
||||
if (dmaSize != 0) {
|
||||
DmaMgr_DMARomToRam(sYaz0CurRomStart, (u32)dst + restSize, dmaSize);
|
||||
sYaz0CurRomStart += dmaSize;
|
||||
sYaz0CurSize -= dmaSize;
|
||||
if (!sYaz0CurSize)
|
||||
if (!sYaz0CurSize) {
|
||||
sYaz0MaxPtr = (u32)dst + restSize + dmaSize;
|
||||
}
|
||||
}
|
||||
|
||||
return dst;
|
||||
@@ -60,8 +55,7 @@ void* Yaz0_NextDMA(void* curSrcPos)
|
||||
// has an extra check at the start of the small compressed loop
|
||||
// along with an extra move instruction
|
||||
// maybe some regalloc differences besides these issues
|
||||
void Yaz0_DecompressImpl(Yaz0Header* hdr, u8* dst)
|
||||
{
|
||||
void Yaz0_DecompressImpl(Yaz0Header* hdr, u8* dst) {
|
||||
u32 bitIdx;
|
||||
u8* src;
|
||||
u8* dstEnd;
|
||||
@@ -76,10 +70,8 @@ void Yaz0_DecompressImpl(Yaz0Header* hdr, u8* dst)
|
||||
src = hdr->data;
|
||||
dstEnd = dst + hdr->decSize;
|
||||
|
||||
do
|
||||
{
|
||||
if (bitIdx == 0)
|
||||
{
|
||||
do {
|
||||
if (bitIdx == 0) {
|
||||
if ((sYaz0MaxPtr < (u32)src) && (sYaz0CurSize != 0))
|
||||
src = Yaz0_NextDMA(src);
|
||||
|
||||
@@ -90,19 +82,16 @@ void Yaz0_DecompressImpl(Yaz0Header* hdr, u8* dst)
|
||||
curDecBit = chunkHeader & (1 << 7);
|
||||
chunkHeader <<= 1;
|
||||
|
||||
if (curDecBit) // uncompressed
|
||||
{
|
||||
if (curDecBit) { // uncompressed
|
||||
*dst++ = *src++;
|
||||
}
|
||||
else // compressed
|
||||
{
|
||||
} else { // compressed
|
||||
nibble = *src >> 4;
|
||||
backPtr = dst - (*(src + 1) | (*src & 0xF) << 8);
|
||||
src += 2;
|
||||
|
||||
chunkSize = (nibble == 0) // N = chunkSize; B = back offset
|
||||
? *src++ + 0x12 // 3 bytes 0B BB NN
|
||||
: nibble + 2; // 2 bytes NB BB
|
||||
chunkSize = (nibble == 0) // N = chunkSize; B = back offset
|
||||
? *src++ + 0x12 // 3 bytes 0B BB NN
|
||||
: nibble + 2; // 2 bytes NB BB
|
||||
|
||||
for (off = chunkSize; off > 0; off--)
|
||||
*dst++ = *(backPtr++ - 1);
|
||||
@@ -115,8 +104,7 @@ void Yaz0_DecompressImpl(Yaz0Header* hdr, u8* dst)
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/boot/yaz0/Yaz0_DecompressImpl.s")
|
||||
#endif
|
||||
|
||||
void Yaz0_Decompress(u32 romStart, void* dst, u32 size)
|
||||
{
|
||||
void Yaz0_Decompress(u32 romStart, void* dst, u32 size) {
|
||||
sYaz0CurRomStart = romStart;
|
||||
sYaz0CurSize = size;
|
||||
sYaz0CurDataEnd = sYaz0DataBuffer + sizeof(sYaz0DataBuffer);
|
||||
|
||||
+17
-19
@@ -6,16 +6,14 @@
|
||||
u32 gCurrentRegion = 0;
|
||||
LocaleCartInfo sCartInfo;
|
||||
|
||||
//temporary
|
||||
// temporary
|
||||
extern PadMgr gPadMgr;
|
||||
|
||||
void Locale_Init()
|
||||
{
|
||||
void Locale_Init() {
|
||||
osEPiReadIo(gCartHandle, 0x38, &sCartInfo.mediaFormat);
|
||||
osEPiReadIo(gCartHandle, 0x3C, &sCartInfo.regionInfo);
|
||||
|
||||
switch (sCartInfo.countryCode)
|
||||
{
|
||||
switch (sCartInfo.countryCode) {
|
||||
case 'J': // "NTSC-U (North America)"
|
||||
gCurrentRegion = REGION_US;
|
||||
break;
|
||||
@@ -36,39 +34,39 @@ void Locale_Init()
|
||||
osSyncPrintf("z_locale_init:日本用かアメリカ用か3コンで判断させる\n");
|
||||
}
|
||||
|
||||
void Locale_ResetRegion()
|
||||
{
|
||||
void Locale_ResetRegion() {
|
||||
gCurrentRegion = REGION_NULL;
|
||||
}
|
||||
|
||||
u32 func_80001F48()
|
||||
{
|
||||
PadMgr* padMgr = (PadMgr*)(u32)&gPadMgr; //cast required to match
|
||||
u32 func_80001F48() {
|
||||
PadMgr* padMgr = (PadMgr*)(u32)&gPadMgr; // cast required to match
|
||||
|
||||
if (gCurrentRegion == REGION_NATIVE)
|
||||
if (gCurrentRegion == REGION_NATIVE) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (padMgr->unk_2A8 & 4)
|
||||
if (padMgr->unk_2A8 & 4) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
u32 func_80001F8C()
|
||||
{
|
||||
PadMgr* padMgr = (PadMgr*)(u32)&gPadMgr; //cast required to match
|
||||
u32 func_80001F8C() {
|
||||
PadMgr* padMgr = (PadMgr*)(u32)&gPadMgr; // cast required to match
|
||||
|
||||
if (gCurrentRegion == REGION_NATIVE)
|
||||
if (gCurrentRegion == REGION_NATIVE) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (padMgr->unk_2A8 & 4)
|
||||
if (padMgr->unk_2A8 & 4) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// This function appears to be unused?
|
||||
u32 Locale_IsRegionNative()
|
||||
{
|
||||
u32 Locale_IsRegionNative() {
|
||||
return gCurrentRegion == REGION_NATIVE;
|
||||
}
|
||||
|
||||
+1660
-1662
File diff suppressed because it is too large
Load Diff
@@ -4,7 +4,7 @@
|
||||
u64 gGfxSPTaskOutputBuffer[0x3000];
|
||||
|
||||
// 0xC00 bytes
|
||||
u8 gGfxSPTaskYieldBuffer[OS_YIELD_DATA_SIZE];
|
||||
u8 gGfxSPTaskYieldBuffer[OS_YIELD_DATA_SIZE];
|
||||
|
||||
// 0x400 bytes
|
||||
u8 gGfxSPTaskStack[0x400];
|
||||
|
||||
+36
-67
@@ -1,172 +1,141 @@
|
||||
#include <global.h>
|
||||
|
||||
void THGA_Ct(TwoHeadGfxArena* thga, Gfx* start, u32 size)
|
||||
{
|
||||
void THGA_Ct(TwoHeadGfxArena* thga, Gfx* start, u32 size) {
|
||||
THA_Ct((TwoHeadArena*)thga, start, size);
|
||||
}
|
||||
|
||||
void THGA_Dt(TwoHeadGfxArena* thga)
|
||||
{
|
||||
void THGA_Dt(TwoHeadGfxArena* thga) {
|
||||
THA_Dt((TwoHeadArena*)thga);
|
||||
}
|
||||
|
||||
u32 THGA_IsCrash(TwoHeadGfxArena* thga)
|
||||
{
|
||||
u32 THGA_IsCrash(TwoHeadGfxArena* thga) {
|
||||
return THA_IsCrash((TwoHeadArena*)thga);
|
||||
}
|
||||
|
||||
void THGA_Init(TwoHeadGfxArena* thga)
|
||||
{
|
||||
void THGA_Init(TwoHeadGfxArena* thga) {
|
||||
THA_Init((TwoHeadArena*)thga);
|
||||
}
|
||||
|
||||
s32 THGA_GetSize(TwoHeadGfxArena* thga)
|
||||
{
|
||||
s32 THGA_GetSize(TwoHeadGfxArena* thga) {
|
||||
return THA_GetSize((TwoHeadArena*)thga);
|
||||
}
|
||||
|
||||
Gfx* THGA_GetHead(TwoHeadGfxArena* thga)
|
||||
{
|
||||
Gfx* THGA_GetHead(TwoHeadGfxArena* thga) {
|
||||
return THA_GetHead((TwoHeadArena*)thga);
|
||||
}
|
||||
|
||||
void THGA_SetHead(TwoHeadGfxArena* thga, Gfx* start)
|
||||
{
|
||||
void THGA_SetHead(TwoHeadGfxArena* thga, Gfx* start) {
|
||||
THA_SetHead((TwoHeadArena*)thga, start);
|
||||
}
|
||||
|
||||
Gfx* THGA_GetTail(TwoHeadGfxArena* thga)
|
||||
{
|
||||
Gfx* THGA_GetTail(TwoHeadGfxArena* thga) {
|
||||
return THA_GetTail((TwoHeadArena*)thga);
|
||||
}
|
||||
|
||||
Gfx* THGA_AllocStartArray8(TwoHeadGfxArena* thga, u32 count)
|
||||
{
|
||||
Gfx* THGA_AllocStartArray8(TwoHeadGfxArena* thga, u32 count) {
|
||||
return THA_AllocStart((TwoHeadArena*)thga, count * 8);
|
||||
}
|
||||
|
||||
Gfx* THGA_AllocStart8(TwoHeadGfxArena* thga)
|
||||
{
|
||||
Gfx* THGA_AllocStart8(TwoHeadGfxArena* thga) {
|
||||
return THGA_AllocStartArray8(thga, 1);
|
||||
}
|
||||
|
||||
Gfx* THGA_AllocStart8Wrapper(TwoHeadGfxArena* thga)
|
||||
{
|
||||
Gfx* THGA_AllocStart8Wrapper(TwoHeadGfxArena* thga) {
|
||||
return THGA_AllocStart8(thga);
|
||||
}
|
||||
|
||||
Gfx* THGA_AllocEnd(TwoHeadGfxArena* thga, u32 size)
|
||||
{
|
||||
Gfx* THGA_AllocEnd(TwoHeadGfxArena* thga, u32 size) {
|
||||
return THA_AllocEnd((TwoHeadArena*)thga, size);
|
||||
}
|
||||
|
||||
Gfx* THGA_AllocEndArray64(TwoHeadGfxArena* thga, u32 count)
|
||||
{
|
||||
Gfx* THGA_AllocEndArray64(TwoHeadGfxArena* thga, u32 count) {
|
||||
return THGA_AllocEnd(thga, count * 0x40);
|
||||
}
|
||||
|
||||
Gfx* THGA_AllocEnd64(TwoHeadGfxArena* thga)
|
||||
{
|
||||
Gfx* THGA_AllocEnd64(TwoHeadGfxArena* thga) {
|
||||
return THGA_AllocEnd(thga, 0x40);
|
||||
}
|
||||
|
||||
Gfx* THGA_AllocEndArray16(TwoHeadGfxArena* thga, u32 count)
|
||||
{
|
||||
Gfx* THGA_AllocEndArray16(TwoHeadGfxArena* thga, u32 count) {
|
||||
return THGA_AllocEnd(thga, count * 0x10);
|
||||
}
|
||||
|
||||
Gfx* THGA_AllocEnd16(TwoHeadGfxArena* thga)
|
||||
{
|
||||
Gfx* THGA_AllocEnd16(TwoHeadGfxArena* thga) {
|
||||
return THGA_AllocEnd(thga, 0x10);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void* THA_GetHead(TwoHeadArena* tha)
|
||||
{
|
||||
void* THA_GetHead(TwoHeadArena* tha) {
|
||||
return tha->head;
|
||||
}
|
||||
|
||||
void THA_SetHead(TwoHeadArena* tha, void* start)
|
||||
{
|
||||
void THA_SetHead(TwoHeadArena* tha, void* start) {
|
||||
tha->head = start;
|
||||
}
|
||||
|
||||
void* THA_GetTail(TwoHeadArena* tha)
|
||||
{
|
||||
void* THA_GetTail(TwoHeadArena* tha) {
|
||||
return tha->tail;
|
||||
}
|
||||
|
||||
void* THA_AllocStart(TwoHeadArena* tha, u32 size)
|
||||
{
|
||||
void* THA_AllocStart(TwoHeadArena* tha, u32 size) {
|
||||
void* start = tha->head;
|
||||
tha->head += size;
|
||||
return start;
|
||||
}
|
||||
|
||||
void* THA_AllocStart1(TwoHeadArena* tha)
|
||||
{
|
||||
void* THA_AllocStart1(TwoHeadArena* tha) {
|
||||
return THA_AllocStart(tha, 1);
|
||||
}
|
||||
|
||||
void* THA_AllocEnd(TwoHeadArena* tha, u32 size)
|
||||
{
|
||||
void* THA_AllocEnd(TwoHeadArena* tha, u32 size) {
|
||||
u32 mask;
|
||||
u32* temp;
|
||||
|
||||
if (size == 8)
|
||||
if (size == 8) {
|
||||
mask = ~7;
|
||||
else if (size == 4 || size == 12)
|
||||
} else if (size == 4 || size == 12) {
|
||||
mask = ~3;
|
||||
else if (size == 2 || size == 6 || size == 10 || size == 12 || size == 14)
|
||||
} else if (size == 2 || size == 6 || size == 10 || size == 12 || size == 14) {
|
||||
mask = ~1;
|
||||
else
|
||||
} else {
|
||||
mask = (size >= 0x10) ? ~0xF : 0;
|
||||
}
|
||||
|
||||
temp = (u32*)&tha->tail; // required to match
|
||||
return tha->tail = (void*)(((*temp & mask) - size) & mask);
|
||||
}
|
||||
|
||||
void* THA_AllocEndAlign16(TwoHeadArena *tha, u32 size)
|
||||
{
|
||||
void* ret = (void*)(u32)((((u32)tha->tail & ~0xF) - size) & ((~(0xF & 0xFFFFFFFFFFFFFFFF)) & 0xFFFFFFFFu)); // required to match
|
||||
void* THA_AllocEndAlign16(TwoHeadArena* tha, u32 size) {
|
||||
void* ret = (void*)(u32)((((u32)tha->tail & ~0xF) - size) &
|
||||
((~(0xF & 0xFFFFFFFFFFFFFFFF)) & 0xFFFFFFFFu)); // required to match
|
||||
tha->tail = ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
void* THA_AllocEndAlign(TwoHeadArena* tha, u32 size, u32 mask)
|
||||
{
|
||||
void* THA_AllocEndAlign(TwoHeadArena* tha, u32 size, u32 mask) {
|
||||
void* ret = (void*)((((u32)tha->tail & mask) - size) & mask);
|
||||
tha->tail = ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
s32 THA_GetSize(TwoHeadArena* tha)
|
||||
{
|
||||
s32 THA_GetSize(TwoHeadArena* tha) {
|
||||
return tha->tail - tha->head;
|
||||
}
|
||||
|
||||
u32 THA_IsCrash(TwoHeadArena* tha)
|
||||
{
|
||||
u32 THA_IsCrash(TwoHeadArena* tha) {
|
||||
return THA_GetSize(tha) < 0;
|
||||
}
|
||||
|
||||
void THA_Init(TwoHeadArena* tha)
|
||||
{
|
||||
void THA_Init(TwoHeadArena* tha) {
|
||||
tha->head = tha->bufp;
|
||||
tha->tail = tha->bufp + tha->size;
|
||||
}
|
||||
|
||||
void THA_Ct(TwoHeadArena* tha, void* ptr, u32 size)
|
||||
{
|
||||
void THA_Ct(TwoHeadArena* tha, void* ptr, u32 size) {
|
||||
tha->bufp = ptr;
|
||||
tha->size = size;
|
||||
THA_Init(tha);
|
||||
}
|
||||
|
||||
void THA_Dt(TwoHeadArena* tha)
|
||||
{
|
||||
void THA_Dt(TwoHeadArena* tha) {
|
||||
bzero(tha, sizeof(TwoHeadArena));
|
||||
}
|
||||
|
||||
+249
-332
File diff suppressed because it is too large
Load Diff
@@ -14,4 +14,3 @@
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/audioMgr/func_800C3FC4.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/audioMgr/func_800C3FEC.s")
|
||||
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
GlobalContext* func_80026B00(void)
|
||||
{
|
||||
GlobalContext* func_80026B00(void) {
|
||||
return D_80157DA0;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_80026B00/func_80026B0C.s")
|
||||
|
||||
void func_80026C1C(u8* arg0)
|
||||
{
|
||||
void func_80026C1C(u8* arg0) {
|
||||
arg0[0] = 0;
|
||||
arg0[1] = 0;
|
||||
arg0[2] = 0;
|
||||
|
||||
+18
-21
@@ -3,59 +3,56 @@
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_800430A0/func_800430A0.s")
|
||||
|
||||
void func_800432A0(CollisionContext* colCtx, u32 floorPolySource, Actor* actor)
|
||||
{
|
||||
if (func_8003E934(floorPolySource) != 0)
|
||||
{
|
||||
void func_800432A0(CollisionContext* colCtx, u32 floorPolySource, Actor* actor) {
|
||||
if (func_8003E934(floorPolySource) != 0) {
|
||||
s16 v1 = colCtx->dyna.actorMeshArr[floorPolySource].rot2.y - colCtx->dyna.actorMeshArr[floorPolySource].rot1.y;
|
||||
|
||||
if (actor->id == 0)
|
||||
if (actor->id == 0) {
|
||||
((Player*)actor)->unk_83C += v1;
|
||||
}
|
||||
|
||||
actor->shape.rot.y += v1;
|
||||
actor->posRot.rot.y += v1;
|
||||
}
|
||||
}
|
||||
|
||||
void func_80043334(CollisionContext* colCtx, Actor* actor, u32 floorPolySource)
|
||||
{
|
||||
if (func_8003E934(floorPolySource) != 0)
|
||||
{
|
||||
void func_80043334(CollisionContext* colCtx, Actor* actor, u32 floorPolySource) {
|
||||
if (func_8003E934(floorPolySource) != 0) {
|
||||
DynaPolyActor* dynaActor = DynaPolyInfo_GetActor(colCtx, floorPolySource);
|
||||
if (dynaActor != NULL)
|
||||
{
|
||||
if (dynaActor != NULL) {
|
||||
func_800434A8(dynaActor);
|
||||
|
||||
if ((actor->flags & 0x4000000) == 0x4000000)
|
||||
if ((actor->flags & 0x4000000) == 0x4000000) {
|
||||
func_80043538(dynaActor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
s32 func_800433A4(CollisionContext* colCtx, u32 floorPolySource, Actor* actor)
|
||||
{
|
||||
s32 func_800433A4(CollisionContext* colCtx, u32 floorPolySource, Actor* actor) {
|
||||
s32 sp24 = 0;
|
||||
DynaPolyActor* dynaActor;
|
||||
|
||||
if (func_8003E934(floorPolySource) == 0)
|
||||
if (func_8003E934(floorPolySource) == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((colCtx->dyna.flags[floorPolySource] & 2) || !(colCtx->dyna.flags[floorPolySource] & 1))
|
||||
if ((colCtx->dyna.flags[floorPolySource] & 2) || !(colCtx->dyna.flags[floorPolySource] & 1)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
dynaActor = DynaPolyInfo_GetActor(colCtx, floorPolySource);
|
||||
|
||||
if (dynaActor == NULL)
|
||||
if (dynaActor == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (dynaActor->unk_15C & 1)
|
||||
{
|
||||
if (dynaActor->unk_15C & 1) {
|
||||
func_800430A0(colCtx, floorPolySource, actor);
|
||||
sp24 = 1;
|
||||
}
|
||||
|
||||
if (dynaActor->unk_15C & 2)
|
||||
{
|
||||
if (dynaActor->unk_15C & 2) {
|
||||
func_800432A0(colCtx, floorPolySource, actor);
|
||||
sp24 = 1;
|
||||
}
|
||||
|
||||
+30
-36
@@ -1,8 +1,7 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
void DynaPolyInfo_SetActorMove(DynaPolyActor* dynaActor, DynaPolyMoveFlag flags)
|
||||
{
|
||||
void DynaPolyInfo_SetActorMove(DynaPolyActor* dynaActor, DynaPolyMoveFlag flags) {
|
||||
dynaActor->dynaPolyId = -1;
|
||||
dynaActor->unk_15C = flags;
|
||||
dynaActor->unk_160 = 0;
|
||||
@@ -10,77 +9,72 @@ void DynaPolyInfo_SetActorMove(DynaPolyActor* dynaActor, DynaPolyMoveFlag flags)
|
||||
dynaActor->unk_154 = 0.0f;
|
||||
}
|
||||
|
||||
void func_800434A0(DynaPolyActor *dynaActor)
|
||||
{
|
||||
void func_800434A0(DynaPolyActor* dynaActor) {
|
||||
dynaActor->unk_160 = 0;
|
||||
}
|
||||
|
||||
void func_800434A8(DynaPolyActor *dynaActor)
|
||||
{
|
||||
void func_800434A8(DynaPolyActor* dynaActor) {
|
||||
dynaActor->unk_160 |= 1;
|
||||
}
|
||||
|
||||
void func_800434B8(DynaPolyActor *dynaActor)
|
||||
{
|
||||
void func_800434B8(DynaPolyActor* dynaActor) {
|
||||
dynaActor->unk_160 |= 2;
|
||||
}
|
||||
|
||||
void func_800434C8(CollisionContext* colCtx, u32 floorPolySource)
|
||||
{
|
||||
DynaPolyActor *dynaActor = DynaPolyInfo_GetActor(colCtx, floorPolySource);
|
||||
void func_800434C8(CollisionContext* colCtx, u32 floorPolySource) {
|
||||
DynaPolyActor* dynaActor = DynaPolyInfo_GetActor(colCtx, floorPolySource);
|
||||
|
||||
if (dynaActor != NULL)
|
||||
if (dynaActor != NULL) {
|
||||
func_800434B8(dynaActor);
|
||||
}
|
||||
}
|
||||
|
||||
void func_800434F8(DynaPolyActor* dynaActor)
|
||||
{
|
||||
void func_800434F8(DynaPolyActor* dynaActor) {
|
||||
dynaActor->unk_160 |= 4;
|
||||
}
|
||||
|
||||
void func_80043508(CollisionContext* colCtx, u32 floorPolySource)
|
||||
{
|
||||
DynaPolyActor *dynaActor = DynaPolyInfo_GetActor(colCtx, floorPolySource);
|
||||
void func_80043508(CollisionContext* colCtx, u32 floorPolySource) {
|
||||
DynaPolyActor* dynaActor = DynaPolyInfo_GetActor(colCtx, floorPolySource);
|
||||
|
||||
if (dynaActor != NULL)
|
||||
if (dynaActor != NULL) {
|
||||
func_800434F8(dynaActor);
|
||||
}
|
||||
}
|
||||
|
||||
void func_80043538(DynaPolyActor* dynaActor)
|
||||
{
|
||||
void func_80043538(DynaPolyActor* dynaActor) {
|
||||
dynaActor->unk_160 |= 8;
|
||||
}
|
||||
|
||||
s32 func_80043548(DynaPolyActor* dynaActor)
|
||||
{
|
||||
if (dynaActor->unk_160 & 1)
|
||||
s32 func_80043548(DynaPolyActor* dynaActor) {
|
||||
if (dynaActor->unk_160 & 1) {
|
||||
return 1;
|
||||
else
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
s32 func_8004356C(DynaPolyActor* dynaActor)
|
||||
{
|
||||
if (dynaActor->unk_160 & 2)
|
||||
s32 func_8004356C(DynaPolyActor* dynaActor) {
|
||||
if (dynaActor->unk_160 & 2) {
|
||||
return 1;
|
||||
else
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
s32 func_80043590(DynaPolyActor* dynaActor)
|
||||
{
|
||||
if (dynaActor->unk_160 & 4)
|
||||
s32 func_80043590(DynaPolyActor* dynaActor) {
|
||||
if (dynaActor->unk_160 & 4) {
|
||||
return 1;
|
||||
else
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
s32 func_800435B4(DynaPolyActor* dynaActor)
|
||||
{
|
||||
if (dynaActor->unk_160 & 8)
|
||||
s32 func_800435B4(DynaPolyActor* dynaActor) {
|
||||
if (dynaActor->unk_160 & 8) {
|
||||
return 1;
|
||||
else
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_80043480/func_800435D8.s")
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
void* MemCopy(void* dest, void* src, s32 size)
|
||||
{
|
||||
void* MemCopy(void* dest, void* src, s32 size) {
|
||||
u8* destu = (u8*)dest;
|
||||
u8* srcu = (u8*)src;
|
||||
|
||||
while (size > 0)
|
||||
{
|
||||
while (size > 0) {
|
||||
*destu++ = *srcu++;
|
||||
size--;
|
||||
}
|
||||
@@ -15,13 +13,11 @@ void* MemCopy(void* dest, void* src, s32 size)
|
||||
return dest;
|
||||
}
|
||||
|
||||
void* MemSet(void* dest, s32 val, s32 size)
|
||||
{
|
||||
void* MemSet(void* dest, s32 val, s32 size) {
|
||||
u8* destu = (u8*)dest;
|
||||
s32 s = size;
|
||||
|
||||
while (s > 0)
|
||||
{
|
||||
while (s > 0) {
|
||||
*destu++ = val;
|
||||
s--;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
u16 D_8011F3F0[60][9] =
|
||||
{
|
||||
u16 D_8011F3F0[60][9] = {
|
||||
{ 0x0000, 0x7124, 0x7127, 0x7126, 0x7125, 0x7127, 0x7124, 0x7125, 0x7127 },
|
||||
{ 0x0000, 0x7128, 0x7129, 0x7128, 0x7128, 0x7128, 0x7128, 0x712A, 0x712B },
|
||||
{ 0x0000, 0x7128, 0x712B, 0x7128, 0x7128, 0x7129, 0x7128, 0x712B, 0x7128 },
|
||||
@@ -65,8 +64,7 @@ u16 D_8011F3F0[60][9] =
|
||||
{ 0x0000, 0x7104, 0x7105, 0x7107, 0x7105, 0x710C, 0x7105, 0x7107, 0x7107 },
|
||||
};
|
||||
|
||||
u16 func_8006C360(GlobalContext* globalCtx, u32 idx)
|
||||
{
|
||||
u16 func_8006C360(GlobalContext* globalCtx, u32 idx) {
|
||||
u8 mask = func_8008F080(globalCtx);
|
||||
return D_8011F3F0[idx][mask];
|
||||
}
|
||||
|
||||
@@ -8,4 +8,3 @@
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_8006C3A0/func_8006C438.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_8006C3A0/func_8006C4A4.s")
|
||||
|
||||
|
||||
@@ -4,4 +4,3 @@
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_8006C510/func_8006C510.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_8006C510/func_8006C5A8.s")
|
||||
|
||||
|
||||
@@ -5,10 +5,7 @@
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_8006EA30/func_8006ECF4.s")
|
||||
|
||||
void func_8006EE48(UNK_TYPE arg0)
|
||||
{
|
||||
|
||||
void func_8006EE48(UNK_TYPE arg0) {
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_8006EA30/func_8006EE50.s")
|
||||
|
||||
|
||||
+10
-21
@@ -3,8 +3,7 @@
|
||||
|
||||
Vec3f* func_8007C1AC(Vec3f* dest, struct_80045714* arg1);
|
||||
|
||||
f32 func_8007BF90(Vec3f* a, Vec3f* b)
|
||||
{
|
||||
f32 func_8007BF90(Vec3f* a, Vec3f* b) {
|
||||
f32 dx = a->x - b->x;
|
||||
f32 dy = a->y - b->y;
|
||||
f32 dz = a->z - b->z;
|
||||
@@ -12,8 +11,7 @@ f32 func_8007BF90(Vec3f* a, Vec3f* b)
|
||||
return sqrtf(SQ(dx) + SQ(dy) + SQ(dz));
|
||||
}
|
||||
|
||||
f32 func_8007BFD0(Vec3f* a, Vec3f* b, Vec3f* dest)
|
||||
{
|
||||
f32 func_8007BFD0(Vec3f* a, Vec3f* b, Vec3f* dest) {
|
||||
dest->x = a->x - b->x;
|
||||
dest->y = a->y - b->y;
|
||||
dest->z = a->z - b->z;
|
||||
@@ -21,20 +19,17 @@ f32 func_8007BFD0(Vec3f* a, Vec3f* b, Vec3f* dest)
|
||||
return sqrtf(SQ(dest->x) + SQ(dest->y) + SQ(dest->z));
|
||||
}
|
||||
|
||||
f32 func_8007C028(Vec3f* a, Vec3f* b)
|
||||
{
|
||||
f32 func_8007C028(Vec3f* a, Vec3f* b) {
|
||||
return sqrtf(SQ(a->x - b->x) + SQ(a->z - b->z));
|
||||
}
|
||||
|
||||
f32 func_8007C058(f32 arg0, f32 arg1)
|
||||
{
|
||||
f32 func_8007C058(f32 arg0, f32 arg1) {
|
||||
return (arg1 <= fabsf(arg0)) ? arg0 : ((arg0 >= 0) ? arg1 : -arg1);
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_8007BF90/func_8007C0A8.s")
|
||||
|
||||
Vec3f* func_8007C0F8(Vec3f* dest, Vec3f* a, Vec3f* b)
|
||||
{
|
||||
Vec3f* func_8007C0F8(Vec3f* dest, Vec3f* a, Vec3f* b) {
|
||||
Vec3f v1;
|
||||
Vec3f v2;
|
||||
f32 temp;
|
||||
@@ -54,8 +49,7 @@ Vec3f* func_8007C0F8(Vec3f* dest, Vec3f* a, Vec3f* b)
|
||||
return dest;
|
||||
}
|
||||
|
||||
Vec3f* func_8007C1AC(Vec3f* dest, struct_80045714* arg1)
|
||||
{
|
||||
Vec3f* func_8007C1AC(Vec3f* dest, struct_80045714* arg1) {
|
||||
Vec3f v;
|
||||
f32 sin4;
|
||||
f32 cos4;
|
||||
@@ -78,8 +72,7 @@ Vec3f* func_8007C1AC(Vec3f* dest, struct_80045714* arg1)
|
||||
|
||||
void func_8007C3F4(struct_80045714* arg0, Vec3f* arg1);
|
||||
|
||||
void func_8007C25C(Vec3f* dest, struct_80045714* arg1)
|
||||
{
|
||||
void func_8007C25C(Vec3f* dest, struct_80045714* arg1) {
|
||||
struct_80045714 var;
|
||||
|
||||
var.unk_00 = arg1->unk_00;
|
||||
@@ -95,8 +88,7 @@ void func_8007C25C(Vec3f* dest, struct_80045714* arg1)
|
||||
|
||||
void func_8007C29C(struct_80045714* arg0, Vec3f* arg1);
|
||||
|
||||
void func_8007C440(struct_80045714* arg0, Vec3f* a, Vec3f* b)
|
||||
{
|
||||
void func_8007C440(struct_80045714* arg0, Vec3f* a, Vec3f* b) {
|
||||
Vec3f var;
|
||||
|
||||
var.x = b->x - a->x;
|
||||
@@ -106,8 +98,7 @@ void func_8007C440(struct_80045714* arg0, Vec3f* a, Vec3f* b)
|
||||
func_8007C29C(arg0, &var);
|
||||
}
|
||||
|
||||
void func_8007C490(struct_80045714* arg0, Vec3f* a, Vec3f* b)
|
||||
{
|
||||
void func_8007C490(struct_80045714* arg0, Vec3f* a, Vec3f* b) {
|
||||
Vec3f var;
|
||||
|
||||
var.x = b->x - a->x;
|
||||
@@ -117,8 +108,7 @@ void func_8007C490(struct_80045714* arg0, Vec3f* a, Vec3f* b)
|
||||
func_8007C3F4(arg0, &var);
|
||||
}
|
||||
|
||||
Vec3f* func_8007C4E0(Vec3f* dest, Vec3f* a, Vec3f* b)
|
||||
{
|
||||
Vec3f* func_8007C4E0(Vec3f* dest, Vec3f* a, Vec3f* b) {
|
||||
Vec3f var;
|
||||
|
||||
var.x = Math_atan2f(b->z - a->z, b->y - a->y);
|
||||
@@ -133,4 +123,3 @@ Vec3f* func_8007C4E0(Vec3f* dest, Vec3f* a, Vec3f* b)
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_8007BF90/func_8007C574.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_8007BF90/func_8007C5E0.s")
|
||||
|
||||
|
||||
+55
-224
@@ -2,244 +2,77 @@
|
||||
#include <global.h>
|
||||
|
||||
// Bit Flag array in which gBitFlags[n] is literally (1 << n)
|
||||
u32 gBitFlags[] =
|
||||
{
|
||||
(1 << 0), (1 << 1), (1 << 2), (1 << 3),
|
||||
(1 << 4), (1 << 5), (1 << 6), (1 << 7),
|
||||
(1 << 8), (1 << 9), (1 << 10), (1 << 11),
|
||||
(1 << 12), (1 << 13), (1 << 14), (1 << 15),
|
||||
(1 << 16), (1 << 17), (1 << 18), (1 << 19),
|
||||
(1 << 20), (1 << 21), (1 << 22), (1 << 23),
|
||||
(1 << 24), (1 << 25), (1 << 26), (1 << 27),
|
||||
(1 << 28), (1 << 29), (1 << 30), (1 << 31),
|
||||
u32 gBitFlags[] = {
|
||||
(1 << 0), (1 << 1), (1 << 2), (1 << 3), (1 << 4), (1 << 5), (1 << 6), (1 << 7),
|
||||
(1 << 8), (1 << 9), (1 << 10), (1 << 11), (1 << 12), (1 << 13), (1 << 14), (1 << 15),
|
||||
(1 << 16), (1 << 17), (1 << 18), (1 << 19), (1 << 20), (1 << 21), (1 << 22), (1 << 23),
|
||||
(1 << 24), (1 << 25), (1 << 26), (1 << 27), (1 << 28), (1 << 29), (1 << 30), (1 << 31),
|
||||
};
|
||||
|
||||
u16 gEquipMasks[] = { 0x000F, 0x00F0, 0x0F00, 0xF000 };
|
||||
u16 gEquipNegMasks[] = { 0xFFF0, 0xFF0F, 0xF0FF, 0x0FFF };
|
||||
u32 gUpgradeMasks[] = { 0x00000007, 0x00000038, 0x000001C0, 0x00000E00, 0x00003000, 0x0001C000, 0x000E0000, 0x00700000 };
|
||||
u32 gUpgradeNegMasks[] = { 0xFFFFFFF8, 0xFFFFFFC7, 0xFFFFFE3F, 0xFFFFF1FF, 0xFFFFCFFF, 0xFFFE3FFF, 0xFFF1FFFF, 0xFF8FFFFF };
|
||||
u32 gUpgradeMasks[] = {
|
||||
0x00000007, 0x00000038, 0x000001C0, 0x00000E00, 0x00003000, 0x0001C000, 0x000E0000, 0x00700000,
|
||||
};
|
||||
u32 gUpgradeNegMasks[] = {
|
||||
0xFFFFFFF8, 0xFFFFFFC7, 0xFFFFFE3F, 0xFFFFF1FF, 0xFFFFCFFF, 0xFFFE3FFF, 0xFFF1FFFF, 0xFF8FFFFF,
|
||||
};
|
||||
u8 gEquipShifts[] = { 0, 4, 8, 12 };
|
||||
u8 gUpgradeShifts[] = { 0, 3, 6, 9, 12, 14, 17, 20 };
|
||||
|
||||
u16 gUpgradeCapacities[][4] =
|
||||
{
|
||||
{ 0, 30, 40, 50 }, // Quivers
|
||||
{ 0, 20, 30, 40 }, // Bomb Bags
|
||||
{ 0, 0, 0, 0 }, // Unused (Scale)
|
||||
{ 0, 0, 0, 0 }, // Unused (Strength)
|
||||
{ 99, 200, 500, 500 }, // Wallets
|
||||
{ 0, 30, 40, 50 }, // Deku Seed Bullet Bags
|
||||
{ 0, 10, 20, 30 }, // Deku Stick Upgrades
|
||||
{ 0, 20, 30, 40 }, // Deku Nut Upgrades
|
||||
u16 gUpgradeCapacities[][4] = {
|
||||
{ 0, 30, 40, 50 }, // Quivers
|
||||
{ 0, 20, 30, 40 }, // Bomb Bags
|
||||
{ 0, 0, 0, 0 }, // Unused (Scale)
|
||||
{ 0, 0, 0, 0 }, // Unused (Strength)
|
||||
{ 99, 200, 500, 500 }, // Wallets
|
||||
{ 0, 30, 40, 50 }, // Deku Seed Bullet Bags
|
||||
{ 0, 10, 20, 30 }, // Deku Stick Upgrades
|
||||
{ 0, 20, 30, 40 }, // Deku Nut Upgrades
|
||||
};
|
||||
|
||||
u32 D_8012723C[] = { 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000 }; // Unused
|
||||
u32 D_8012724C[] = { 0, 8, 16, 24 }; // Unused
|
||||
u32 D_8012724C[] = { 0, 8, 16, 24 }; // Unused
|
||||
|
||||
// TODO: use symbols for these icon textures once textures are properly in C
|
||||
u32 gItemIcons[] =
|
||||
{
|
||||
0x08000000,
|
||||
0x08001000,
|
||||
0x08002000,
|
||||
0x08003000,
|
||||
0x08004000,
|
||||
0x08005000,
|
||||
0x08006000,
|
||||
0x08007000,
|
||||
0x08008000,
|
||||
0x08009000,
|
||||
0x0800A000,
|
||||
0x0800B000,
|
||||
0x0800C000,
|
||||
0x0800D000,
|
||||
0x0800E000,
|
||||
0x0800F000,
|
||||
0x08010000,
|
||||
0x08011000,
|
||||
0x08012000,
|
||||
0x08013000,
|
||||
0x08014000,
|
||||
0x08015000,
|
||||
0x08016000,
|
||||
0x08017000,
|
||||
0x08018000,
|
||||
0x08019000,
|
||||
0x0801A000,
|
||||
0x0801B000,
|
||||
0x0801C000,
|
||||
0x0801D000,
|
||||
0x0801E000,
|
||||
0x0801F000,
|
||||
0x08020000,
|
||||
0x08021000,
|
||||
0x08022000,
|
||||
0x08023000,
|
||||
0x08024000,
|
||||
0x08025000,
|
||||
0x08026000,
|
||||
0x08027000,
|
||||
0x08028000,
|
||||
0x08029000,
|
||||
0x0802A000,
|
||||
0x0802B000,
|
||||
0x0802C000,
|
||||
0x0802D000,
|
||||
0x0802E000,
|
||||
0x0802F000,
|
||||
0x08030000,
|
||||
0x08031000,
|
||||
0x08032000,
|
||||
0x08033000,
|
||||
0x08034000,
|
||||
0x08035000,
|
||||
0x08036000,
|
||||
0x08037000,
|
||||
0x08038000,
|
||||
0x08039000,
|
||||
0x0803A000,
|
||||
0x0803B000,
|
||||
0x0803C000,
|
||||
0x0803D000,
|
||||
0x0803E000,
|
||||
0x0803F000,
|
||||
0x08040000,
|
||||
0x08041000,
|
||||
0x08042000,
|
||||
0x08043000,
|
||||
0x08044000,
|
||||
0x08045000,
|
||||
0x08046000,
|
||||
0x08047000,
|
||||
0x08048000,
|
||||
0x08049000,
|
||||
0x0804A000,
|
||||
0x0804B000,
|
||||
0x0804C000,
|
||||
0x0804D000,
|
||||
0x0804E000,
|
||||
0x0804F000,
|
||||
0x08050000,
|
||||
0x08051000,
|
||||
0x08052000,
|
||||
0x08053000,
|
||||
0x08054000,
|
||||
0x08055000,
|
||||
0x08056000,
|
||||
0x08057000,
|
||||
0x08058000,
|
||||
0x08059000,
|
||||
0x08089440,
|
||||
0x08089440,
|
||||
0x08089440,
|
||||
0x08089440,
|
||||
0x08089440,
|
||||
0x08089440,
|
||||
0x08089440,
|
||||
0x08089440,
|
||||
0x08089440,
|
||||
0x08089440,
|
||||
0x08089440,
|
||||
0x08089440,
|
||||
0x09000000,
|
||||
0x09000900,
|
||||
0x09001200,
|
||||
0x09001B00,
|
||||
0x09002400,
|
||||
0x09002D00,
|
||||
0x09003600,
|
||||
0x09003F00,
|
||||
0x09004800,
|
||||
0x09005100,
|
||||
0x09005A00,
|
||||
0x09006300,
|
||||
0x09006C00,
|
||||
0x09007500,
|
||||
0x09007E00,
|
||||
0x09009000,
|
||||
0x09008700,
|
||||
0x09007E00,
|
||||
0x0900A200,
|
||||
0x0900AB00,
|
||||
0x0805A000,
|
||||
0x0805A900,
|
||||
0x0805B200,
|
||||
0x02002D40,
|
||||
0x02002A40,
|
||||
0x02002C40,
|
||||
0x02002B40,
|
||||
0x02002940,
|
||||
u32 gItemIcons[] = {
|
||||
0x08000000, 0x08001000, 0x08002000, 0x08003000, 0x08004000, 0x08005000, 0x08006000, 0x08007000, 0x08008000,
|
||||
0x08009000, 0x0800A000, 0x0800B000, 0x0800C000, 0x0800D000, 0x0800E000, 0x0800F000, 0x08010000, 0x08011000,
|
||||
0x08012000, 0x08013000, 0x08014000, 0x08015000, 0x08016000, 0x08017000, 0x08018000, 0x08019000, 0x0801A000,
|
||||
0x0801B000, 0x0801C000, 0x0801D000, 0x0801E000, 0x0801F000, 0x08020000, 0x08021000, 0x08022000, 0x08023000,
|
||||
0x08024000, 0x08025000, 0x08026000, 0x08027000, 0x08028000, 0x08029000, 0x0802A000, 0x0802B000, 0x0802C000,
|
||||
0x0802D000, 0x0802E000, 0x0802F000, 0x08030000, 0x08031000, 0x08032000, 0x08033000, 0x08034000, 0x08035000,
|
||||
0x08036000, 0x08037000, 0x08038000, 0x08039000, 0x0803A000, 0x0803B000, 0x0803C000, 0x0803D000, 0x0803E000,
|
||||
0x0803F000, 0x08040000, 0x08041000, 0x08042000, 0x08043000, 0x08044000, 0x08045000, 0x08046000, 0x08047000,
|
||||
0x08048000, 0x08049000, 0x0804A000, 0x0804B000, 0x0804C000, 0x0804D000, 0x0804E000, 0x0804F000, 0x08050000,
|
||||
0x08051000, 0x08052000, 0x08053000, 0x08054000, 0x08055000, 0x08056000, 0x08057000, 0x08058000, 0x08059000,
|
||||
0x08089440, 0x08089440, 0x08089440, 0x08089440, 0x08089440, 0x08089440, 0x08089440, 0x08089440, 0x08089440,
|
||||
0x08089440, 0x08089440, 0x08089440, 0x09000000, 0x09000900, 0x09001200, 0x09001B00, 0x09002400, 0x09002D00,
|
||||
0x09003600, 0x09003F00, 0x09004800, 0x09005100, 0x09005A00, 0x09006300, 0x09006C00, 0x09007500, 0x09007E00,
|
||||
0x09009000, 0x09008700, 0x09007E00, 0x0900A200, 0x0900AB00, 0x0805A000, 0x0805A900, 0x0805B200, 0x02002D40,
|
||||
0x02002A40, 0x02002C40, 0x02002B40, 0x02002940,
|
||||
};
|
||||
|
||||
// Used to map item IDs to inventory slots
|
||||
u8 gItemSlots[] =
|
||||
{
|
||||
SLOT_STICK,
|
||||
SLOT_NUT,
|
||||
SLOT_BOMB,
|
||||
SLOT_BOW,
|
||||
SLOT_ARROW_FIRE,
|
||||
SLOT_DINS_FIRE,
|
||||
SLOT_SLINGSHOT,
|
||||
SLOT_OCARINA,
|
||||
SLOT_OCARINA,
|
||||
SLOT_BOMBCHU,
|
||||
SLOT_HOOKSHOT,
|
||||
SLOT_HOOKSHOT,
|
||||
SLOT_ARROW_ICE,
|
||||
SLOT_FARORES_WIND,
|
||||
SLOT_BOOMERANG,
|
||||
SLOT_LENS,
|
||||
SLOT_BEAN,
|
||||
SLOT_HAMMER,
|
||||
SLOT_ARROW_LIGHT,
|
||||
SLOT_NAYRUS_LOVE,
|
||||
SLOT_BOTTLE_1,
|
||||
SLOT_BOTTLE_1,
|
||||
SLOT_BOTTLE_1,
|
||||
SLOT_BOTTLE_1,
|
||||
SLOT_BOTTLE_1,
|
||||
SLOT_BOTTLE_1,
|
||||
SLOT_BOTTLE_1,
|
||||
SLOT_BOTTLE_1,
|
||||
SLOT_BOTTLE_1,
|
||||
SLOT_BOTTLE_1,
|
||||
SLOT_BOTTLE_1,
|
||||
SLOT_BOTTLE_1,
|
||||
SLOT_BOTTLE_1,
|
||||
SLOT_TRADE_CHILD,
|
||||
SLOT_TRADE_CHILD,
|
||||
SLOT_TRADE_CHILD,
|
||||
SLOT_TRADE_CHILD,
|
||||
SLOT_TRADE_CHILD,
|
||||
SLOT_TRADE_CHILD,
|
||||
SLOT_TRADE_CHILD,
|
||||
SLOT_TRADE_CHILD,
|
||||
SLOT_TRADE_CHILD,
|
||||
SLOT_TRADE_CHILD,
|
||||
SLOT_TRADE_CHILD,
|
||||
SLOT_TRADE_CHILD,
|
||||
SLOT_TRADE_ADULT,
|
||||
SLOT_TRADE_ADULT,
|
||||
SLOT_TRADE_ADULT,
|
||||
SLOT_TRADE_ADULT,
|
||||
SLOT_TRADE_ADULT,
|
||||
SLOT_TRADE_ADULT,
|
||||
SLOT_TRADE_ADULT,
|
||||
SLOT_TRADE_ADULT,
|
||||
SLOT_TRADE_ADULT,
|
||||
SLOT_TRADE_ADULT,
|
||||
SLOT_TRADE_ADULT
|
||||
u8 gItemSlots[] = {
|
||||
SLOT_STICK, SLOT_NUT, SLOT_BOMB, SLOT_BOW, SLOT_ARROW_FIRE, SLOT_DINS_FIRE,
|
||||
SLOT_SLINGSHOT, SLOT_OCARINA, SLOT_OCARINA, SLOT_BOMBCHU, SLOT_HOOKSHOT, SLOT_HOOKSHOT,
|
||||
SLOT_ARROW_ICE, SLOT_FARORES_WIND, SLOT_BOOMERANG, SLOT_LENS, SLOT_BEAN, SLOT_HAMMER,
|
||||
SLOT_ARROW_LIGHT, SLOT_NAYRUS_LOVE, SLOT_BOTTLE_1, SLOT_BOTTLE_1, SLOT_BOTTLE_1, SLOT_BOTTLE_1,
|
||||
SLOT_BOTTLE_1, SLOT_BOTTLE_1, SLOT_BOTTLE_1, SLOT_BOTTLE_1, SLOT_BOTTLE_1, SLOT_BOTTLE_1,
|
||||
SLOT_BOTTLE_1, SLOT_BOTTLE_1, SLOT_BOTTLE_1, SLOT_TRADE_CHILD, SLOT_TRADE_CHILD, SLOT_TRADE_CHILD,
|
||||
SLOT_TRADE_CHILD, SLOT_TRADE_CHILD, SLOT_TRADE_CHILD, SLOT_TRADE_CHILD, SLOT_TRADE_CHILD, SLOT_TRADE_CHILD,
|
||||
SLOT_TRADE_CHILD, SLOT_TRADE_CHILD, SLOT_TRADE_CHILD, SLOT_TRADE_ADULT, SLOT_TRADE_ADULT, SLOT_TRADE_ADULT,
|
||||
SLOT_TRADE_ADULT, SLOT_TRADE_ADULT, SLOT_TRADE_ADULT, SLOT_TRADE_ADULT, SLOT_TRADE_ADULT, SLOT_TRADE_ADULT,
|
||||
SLOT_TRADE_ADULT, SLOT_TRADE_ADULT,
|
||||
};
|
||||
|
||||
void Inventory_ChangeEquipment(s16 equipment, u16 value)
|
||||
{
|
||||
void Inventory_ChangeEquipment(s16 equipment, u16 value) {
|
||||
gSaveContext.equips.equipment &= gEquipNegMasks[equipment];
|
||||
gSaveContext.equips.equipment |= value << gEquipShifts[equipment];
|
||||
}
|
||||
|
||||
u8 Inventory_DeleteEquipment(GlobalContext* globalCtx, s16 equipment)
|
||||
{
|
||||
u8 Inventory_DeleteEquipment(GlobalContext* globalCtx, s16 equipment) {
|
||||
Player* player = PLAYER;
|
||||
s32 pad;
|
||||
u16 sp26;
|
||||
@@ -249,18 +82,17 @@ u8 Inventory_DeleteEquipment(GlobalContext* globalCtx, s16 equipment)
|
||||
// Translates to: "Erasing equipment item = %d zzz=%d"
|
||||
osSyncPrintf("装備アイテム抹消 = %d zzz=%d\n", equipment, sp26);
|
||||
|
||||
if (sp26)
|
||||
{
|
||||
if (sp26) {
|
||||
sp26 >>= gEquipShifts[equipment];
|
||||
|
||||
gSaveContext.equips.equipment &= gEquipNegMasks[equipment];
|
||||
gSaveContext.equipment ^= gBitFlags[sp26 - 1] << gEquipShifts[equipment];
|
||||
|
||||
if (equipment == EQUIP_TUNIC)
|
||||
if (equipment == EQUIP_TUNIC) {
|
||||
gSaveContext.equips.equipment |= 0x0100;
|
||||
}
|
||||
|
||||
if (equipment == EQUIP_SWORD)
|
||||
{
|
||||
if (equipment == EQUIP_SWORD) {
|
||||
gSaveContext.equips.button_items[0] = ITEM_NONE;
|
||||
gSaveContext.inf_table[29] = 1;
|
||||
}
|
||||
@@ -272,8 +104,7 @@ u8 Inventory_DeleteEquipment(GlobalContext* globalCtx, s16 equipment)
|
||||
return sp26;
|
||||
}
|
||||
|
||||
void Inventory_ChangeUpgrade(s16 upgrade, s16 value)
|
||||
{
|
||||
void Inventory_ChangeUpgrade(s16 upgrade, s16 value) {
|
||||
gSaveContext.upgrades &= gUpgradeNegMasks[upgrade];
|
||||
gSaveContext.upgrades |= value << gUpgradeShifts[upgrade];
|
||||
}
|
||||
|
||||
@@ -1,23 +1,20 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ OSPiHandle piHandle;
|
||||
/* 0x74 */ OSIoMesg ioMesg;
|
||||
/* 0x8C */ OSMesgQueue mesgQ;
|
||||
} struct_800A9D40;
|
||||
|
||||
struct_800A9D40 D_8012A690 = {0};
|
||||
struct_800A9D40 D_8012A690 = { 0 };
|
||||
|
||||
void func_800A9D40(u32 addr, u8 handleType, u8 handleDomain, u8 handleLatency, u8 handlePageSize, u8 handleRelDuration,
|
||||
u8 handlePulse, u32 handleSpeed)
|
||||
{
|
||||
u8 handlePulse, u32 handleSpeed) {
|
||||
u32 int_disabled;
|
||||
|
||||
OSPiHandle *handle = &D_8012A690.piHandle;
|
||||
if ((u32) OS_PHYSICAL_TO_K1(addr) != (*handle).baseAddress)
|
||||
{
|
||||
OSPiHandle* handle = &D_8012A690.piHandle;
|
||||
if ((u32)OS_PHYSICAL_TO_K1(addr) != (*handle).baseAddress) {
|
||||
D_8012A690.piHandle.type = handleType;
|
||||
(*handle).baseAddress = OS_PHYSICAL_TO_K1(addr);
|
||||
D_8012A690.piHandle.latency = handleLatency;
|
||||
@@ -37,8 +34,7 @@ void func_800A9D40(u32 addr, u8 handleType, u8 handleDomain, u8 handleLatency, u
|
||||
}
|
||||
}
|
||||
|
||||
void func_800A9E14(UNK_PTR dramAddr, size_t size, UNK_TYPE arg2)
|
||||
{
|
||||
void func_800A9E14(UNK_PTR dramAddr, size_t size, UNK_TYPE arg2) {
|
||||
OSMesg mesg;
|
||||
|
||||
osCreateMesgQueue(&D_8012A690.mesgQ, &mesg, 1);
|
||||
@@ -50,8 +46,7 @@ void func_800A9E14(UNK_PTR dramAddr, size_t size, UNK_TYPE arg2)
|
||||
osInvalDCache(dramAddr, size);
|
||||
}
|
||||
|
||||
void Sram_ReadWrite(UNK_TYPE arg0, UNK_PTR dramAddr, size_t size, UNK_TYPE arg3)
|
||||
{
|
||||
void Sram_ReadWrite(UNK_TYPE arg0, UNK_PTR dramAddr, size_t size, UNK_TYPE arg3) {
|
||||
osSyncPrintf("ssSRAMReadWrite:%08x %08x %08x %d\n", arg0, dramAddr, size, arg3);
|
||||
func_800A9D40(arg0, 3, 1, 5, 0xd, 2, 0xc, 0);
|
||||
func_800A9E14(dramAddr, size, arg3);
|
||||
|
||||
+15
-25
@@ -5,26 +5,23 @@
|
||||
extern u8 D_80160FD0[];
|
||||
extern PadMgr gPadMgr;
|
||||
|
||||
void func_800A9F30(s32 a, s32 b)
|
||||
{
|
||||
void func_800A9F30(s32 a, s32 b) {
|
||||
func_800D2E30(&D_80160FD0);
|
||||
func_800C7948(a, &D_80160FD0);
|
||||
}
|
||||
|
||||
void func_800A9F6C(f32 a, u8 b, u8 c, u8 d)
|
||||
{
|
||||
void func_800A9F6C(f32 a, u8 b, u8 c, u8 d) {
|
||||
s32 temp1, temp2;
|
||||
|
||||
if (1000000.0f < a)
|
||||
if (1000000.0f < a) {
|
||||
temp1 = 1000;
|
||||
else
|
||||
} else {
|
||||
temp1 = sqrtf(a);
|
||||
}
|
||||
|
||||
if ((temp1 < 1000) && (b != 0) && (d != 0))
|
||||
{
|
||||
if ((temp1 < 1000) && (b != 0) && (d != 0)) {
|
||||
temp2 = b - (temp1 * 255) / 1000;
|
||||
if (temp2 > 0)
|
||||
{
|
||||
if (temp2 > 0) {
|
||||
D_801610DA = temp2;
|
||||
D_80160FD0[0x10B] = c;
|
||||
D_80160FD0[0x10C] = d;
|
||||
@@ -35,22 +32,19 @@ void func_800A9F6C(f32 a, u8 b, u8 c, u8 d)
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_800A9F30/func_800AA000.s")
|
||||
// this function is very similar to the one above but has a loop in it I can't figure out
|
||||
|
||||
void func_800AA0B4(void)
|
||||
{
|
||||
void func_800AA0B4(void) {
|
||||
func_800D3140(&D_80160FD0);
|
||||
|
||||
gPadMgr.unk_460 = func_800A9F30;
|
||||
gPadMgr.unk_464 = 0;
|
||||
|
||||
if (0) ; // Necessary to match
|
||||
if (0) {} // Necessary to match
|
||||
}
|
||||
|
||||
void func_800AA0F0(void)
|
||||
{
|
||||
void func_800AA0F0(void) {
|
||||
PadMgr* padmgr = &gPadMgr;
|
||||
|
||||
if ((padmgr->unk_460 == func_800A9F30) && (padmgr->unk_464 == 0))
|
||||
{
|
||||
if ((padmgr->unk_460 == func_800A9F30) && (padmgr->unk_464 == 0)) {
|
||||
padmgr->unk_460 = NULL;
|
||||
padmgr->unk_464 = 0;
|
||||
}
|
||||
@@ -58,22 +52,18 @@ void func_800AA0F0(void)
|
||||
func_800D3178(&D_80160FD0);
|
||||
}
|
||||
|
||||
u32 func_800AA148(void)
|
||||
{
|
||||
u32 func_800AA148(void) {
|
||||
return ((gPadMgr.unk_2AE[0] ^ 1) == 0);
|
||||
}
|
||||
|
||||
void func_800AA15C(void)
|
||||
{
|
||||
void func_800AA15C(void) {
|
||||
D_801610D4 = 2;
|
||||
}
|
||||
|
||||
void func_800AA16C(void)
|
||||
{
|
||||
void func_800AA16C(void) {
|
||||
D_801610D4 = 0;
|
||||
}
|
||||
|
||||
void func_800AA178(u32 a)
|
||||
{
|
||||
void func_800AA178(u32 a) {
|
||||
D_801610D5 = !!a;
|
||||
}
|
||||
|
||||
+42
-67
@@ -1,75 +1,63 @@
|
||||
#include <global.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u32 type;
|
||||
/* 0x04 */ u32 setScissor;
|
||||
/* 0x08 */ union
|
||||
{
|
||||
/* 0x08 */ union {
|
||||
Color_RGBA8 c;
|
||||
u32 rgba;
|
||||
} color;
|
||||
/* 0x0C */ u32 unk_0C;
|
||||
} struct_801664F0;
|
||||
|
||||
Gfx D_8012AC00[] =
|
||||
{
|
||||
gsDPSetOtherMode(
|
||||
G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE | G_TD_CLAMP |
|
||||
G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
|
||||
G_AC_NONE | G_ZS_PRIM | G_RM_VISCVG | G_RM_VISCVG2),
|
||||
gsDPFillRectangle(0, 0, SCREEN_WIDTH-1, SCREEN_HEIGHT-1),
|
||||
Gfx D_8012AC00[] = {
|
||||
gsDPSetOtherMode(G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE |
|
||||
G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
|
||||
G_AC_NONE | G_ZS_PRIM | G_RM_VISCVG | G_RM_VISCVG2),
|
||||
gsDPFillRectangle(0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1),
|
||||
gsDPPipeSync(),
|
||||
gsDPSetBlendColor(0, 0, 0, 8),
|
||||
gsSPEndDisplayList(),
|
||||
};
|
||||
|
||||
Gfx D_8012AC28[] =
|
||||
{
|
||||
gsDPSetOtherMode(
|
||||
G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE | G_TD_CLAMP |
|
||||
G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
|
||||
G_AC_NONE | G_ZS_PRIM | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL |
|
||||
GBL_c1(G_BL_CLR_FOG, G_BL_A_FOG,G_BL_CLR_MEM, G_BL_A_MEM) |
|
||||
GBL_c2(G_BL_CLR_FOG, G_BL_A_FOG, G_BL_CLR_MEM, G_BL_A_MEM)),
|
||||
gsDPFillRectangle(0, 0, SCREEN_WIDTH-1, SCREEN_HEIGHT-1),
|
||||
Gfx D_8012AC28[] = {
|
||||
gsDPSetOtherMode(G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE |
|
||||
G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
|
||||
G_AC_NONE | G_ZS_PRIM | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL |
|
||||
GBL_c1(G_BL_CLR_FOG, G_BL_A_FOG, G_BL_CLR_MEM, G_BL_A_MEM) |
|
||||
GBL_c2(G_BL_CLR_FOG, G_BL_A_FOG, G_BL_CLR_MEM, G_BL_A_MEM)),
|
||||
gsDPFillRectangle(0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1),
|
||||
gsSPEndDisplayList(),
|
||||
};
|
||||
|
||||
Gfx D_8012AC40[] =
|
||||
{
|
||||
gsDPSetOtherMode(
|
||||
G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE | G_TD_CLAMP |
|
||||
G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
|
||||
G_AC_NONE | G_ZS_PRIM | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL |
|
||||
GBL_c1(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_A_MEM) |
|
||||
GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_A_MEM)),
|
||||
Gfx D_8012AC40[] = {
|
||||
gsDPSetOtherMode(G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE |
|
||||
G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
|
||||
G_AC_NONE | G_ZS_PRIM | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL |
|
||||
GBL_c1(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_A_MEM) |
|
||||
GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_A_MEM)),
|
||||
|
||||
gsDPFillRectangle(0, 0, SCREEN_WIDTH-1, SCREEN_HEIGHT-1),
|
||||
gsDPFillRectangle(0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1),
|
||||
gsSPEndDisplayList(),
|
||||
};
|
||||
|
||||
Gfx D_8012AC58[] =
|
||||
{
|
||||
Gfx D_8012AC58[] = {
|
||||
gsDPSetCombineLERP(K5, K5, 0, PRIMITIVE, 0, 0, 0, PRIMITIVE, K5, K5, 0, PRIMITIVE, 0, 0, 0, PRIMITIVE),
|
||||
gsDPSetOtherMode(
|
||||
G_AD_NOTPATTERN | G_CD_DISABLE | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE | G_TD_CLAMP |
|
||||
G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
|
||||
G_AC_NONE | G_ZS_PRIM | G_RM_CLD_SURF | G_RM_CLD_SURF2),
|
||||
gsDPFillRectangle(0, 0, SCREEN_WIDTH-1, SCREEN_HEIGHT-1),
|
||||
gsDPSetOtherMode(
|
||||
G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE | G_TD_CLAMP |
|
||||
G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
|
||||
G_AC_NONE | G_ZS_PRIM | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL |
|
||||
GBL_c1(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_A_MEM) |
|
||||
GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_A_MEM)),
|
||||
gsDPFillRectangle(0, 0, SCREEN_WIDTH-1, SCREEN_HEIGHT-1),
|
||||
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_DISABLE | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE |
|
||||
G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
|
||||
G_AC_NONE | G_ZS_PRIM | G_RM_CLD_SURF | G_RM_CLD_SURF2),
|
||||
gsDPFillRectangle(0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1),
|
||||
gsDPSetOtherMode(G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE |
|
||||
G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
|
||||
G_AC_NONE | G_ZS_PRIM | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL |
|
||||
GBL_c1(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_A_MEM) |
|
||||
GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_A_MEM)),
|
||||
gsDPFillRectangle(0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1),
|
||||
gsSPEndDisplayList(),
|
||||
};
|
||||
|
||||
//Init func
|
||||
void func_800ACE70(struct_801664F0* this)
|
||||
{
|
||||
// Init func
|
||||
void func_800ACE70(struct_801664F0* this) {
|
||||
this->type = 0;
|
||||
this->setScissor = false;
|
||||
this->color.c.r = 0xFF;
|
||||
@@ -78,15 +66,12 @@ void func_800ACE70(struct_801664F0* this)
|
||||
this->color.c.a = 0xFF;
|
||||
}
|
||||
|
||||
//Destroy func
|
||||
void func_800ACE90(struct_801664F0* this)
|
||||
{
|
||||
|
||||
// Destroy func
|
||||
void func_800ACE90(struct_801664F0* this) {
|
||||
}
|
||||
|
||||
//Update func
|
||||
void func_800ACE98(struct_801664F0* this, Gfx** gfxp)
|
||||
{
|
||||
// Update func
|
||||
void func_800ACE98(struct_801664F0* this, Gfx** gfxp) {
|
||||
Gfx* gfx;
|
||||
|
||||
gfx = *gfxp;
|
||||
@@ -94,37 +79,27 @@ void func_800ACE98(struct_801664F0* this, Gfx** gfxp)
|
||||
gDPPipeSync(gfx++);
|
||||
gDPSetPrimDepth(gfx++, -1, -1);
|
||||
|
||||
if (this->setScissor == true)
|
||||
{
|
||||
if (this->setScissor == true) {
|
||||
gDPSetScissor(gfx++, G_SC_NON_INTERLACE, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
}
|
||||
|
||||
switch(this->type)
|
||||
{
|
||||
|
||||
switch (this->type) {
|
||||
case 1:
|
||||
{
|
||||
gSPDisplayList(gfx++, D_8012AC40);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
gDPSetColor(gfx++, G_SETPRIMCOLOR, this->color.rgba);
|
||||
gSPDisplayList(gfx++, D_8012AC58);
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
gDPSetColor(gfx++, G_SETBLENDCOLOR, this->color.rgba);
|
||||
gSPDisplayList(gfx++, D_8012AC00);
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
gDPSetColor(gfx++, G_SETFOGCOLOR, this->color.rgba);
|
||||
gSPDisplayList(gfx++, D_8012AC28);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
gDPPipeSync(gfx++);
|
||||
*gfxp = gfx;
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
#include <z64.h>
|
||||
|
||||
#define printSpStatus(x, name) if (x & SP_STATUS_##name) osSyncPrintf(#name " ")
|
||||
#define printDpStatus(x, name) if (x & DPC_STATUS_##name) osSyncPrintf(#name " ")
|
||||
#define printSpStatus(x, name) \
|
||||
if (x & SP_STATUS_##name) \
|
||||
osSyncPrintf(#name " ")
|
||||
#define printDpStatus(x, name) \
|
||||
if (x & DPC_STATUS_##name) \
|
||||
osSyncPrintf(#name " ")
|
||||
|
||||
void func_800FBCE0()
|
||||
{
|
||||
void func_800FBCE0() {
|
||||
u32 spStatus = __osSpGetStatus();
|
||||
u32 dpStatus = osDpGetStatus();
|
||||
|
||||
@@ -41,10 +44,9 @@ void func_800FBCE0()
|
||||
osSyncPrintf("\n");
|
||||
}
|
||||
|
||||
void func_800FBFD8()
|
||||
{
|
||||
void func_800FBFD8() {
|
||||
func_800FBCE0();
|
||||
osDpSetStatus(DPC_SET_FREEZE | DPC_SET_FLUSH);
|
||||
__osSpSetStatus(SP_SET_HALT | SP_SET_SIG2 | SP_CLR_INTR_BREAK);
|
||||
func_800FBCE0();
|
||||
}
|
||||
}
|
||||
|
||||
+53
-88
@@ -1,52 +1,44 @@
|
||||
#include <global.h>
|
||||
|
||||
typedef void (*arg3_800FC868)(void*);
|
||||
typedef void (*arg3_800FC8D8)(void*,u32);
|
||||
typedef void (*arg3_800FC948)(void*,u32,u32,u32,u32,u32,u32,u32,u32);
|
||||
typedef void (*arg3_800FCA18)(void*,u32);
|
||||
typedef void (*arg3_800FC8D8)(void*, u32);
|
||||
typedef void (*arg3_800FC948)(void*, u32, u32, u32, u32, u32, u32, u32, u32);
|
||||
typedef void (*arg3_800FCA18)(void*, u32);
|
||||
|
||||
typedef struct InitFunc
|
||||
{
|
||||
typedef struct InitFunc {
|
||||
s32 nextOffset;
|
||||
void (*func)(void);
|
||||
} InitFunc;
|
||||
|
||||
//.data
|
||||
void *sInitFuncs = NULL;
|
||||
// .data
|
||||
void* sInitFuncs = NULL;
|
||||
|
||||
char sNew[4] =
|
||||
{
|
||||
'n', 'e', 'w',
|
||||
char sNew[4] = { 'n', 'e', 'w' };
|
||||
|
||||
char D_80134488[0x18] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x80, 0x00, 0x00,
|
||||
0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
|
||||
};
|
||||
|
||||
char D_80134488[0x18] =
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x7F, 0x80, 0x00, 0x00, 0xFF, 0x80, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
|
||||
};
|
||||
|
||||
s32 Overlay_Load(u32 vRomStart, u32 vRomEnd, void *vRamStart, void *vRamEnd, void *allocatedVRamAddr)
|
||||
{
|
||||
s32 Overlay_Load(u32 vRomStart, u32 vRomEnd, void* vRamStart, void* vRamEnd, void* allocatedVRamAddr) {
|
||||
u32 pad;
|
||||
u32 end;
|
||||
u32 bssSize;
|
||||
OverlayRelocationSection *ovl;
|
||||
OverlayRelocationSection* ovl;
|
||||
u32 relocCnt;
|
||||
u32 ovlOffset;
|
||||
u32 size;
|
||||
|
||||
if(gOverlayLogSeverity >= 3)
|
||||
{
|
||||
if (gOverlayLogSeverity >= 3) {
|
||||
// Start loading dynamic link function
|
||||
osSyncPrintf("\nダイナミックリンクファンクションのロードを開始します\n");
|
||||
}
|
||||
|
||||
if(gOverlayLogSeverity >= 3)
|
||||
{
|
||||
if (gOverlayLogSeverity >= 3) {
|
||||
size = vRomEnd - vRomStart;
|
||||
//DMA transfer of TEXT, DATA, RODATA + rel (%08x-%08x)
|
||||
osSyncPrintf("TEXT,DATA,RODATA+relをDMA転送します(%08x-%08x)\n", allocatedVRamAddr, (u32)allocatedVRamAddr + size);
|
||||
// DMA transfer of TEXT, DATA, RODATA + rel (%08x-%08x)
|
||||
osSyncPrintf("TEXT,DATA,RODATA+relをDMA転送します(%08x-%08x)\n", allocatedVRamAddr,
|
||||
(u32)allocatedVRamAddr + size);
|
||||
}
|
||||
|
||||
size = vRomEnd - vRomStart;
|
||||
@@ -56,13 +48,12 @@ s32 Overlay_Load(u32 vRomStart, u32 vRomEnd, void *vRamStart, void *vRamEnd, voi
|
||||
ovlOffset = ((s32*)end)[-1];
|
||||
|
||||
ovl = (OverlayRelocationSection*)((u32)end - ovlOffset);
|
||||
if(gOverlayLogSeverity >= 3)
|
||||
{
|
||||
osSyncPrintf("TEXT(%08x), DATA(%08x), RODATA(%08x), BSS(%08x)\n", ovl->textSize, ovl->dataSize, ovl->rodataSize, ovl->bssSize);
|
||||
if (gOverlayLogSeverity >= 3) {
|
||||
osSyncPrintf("TEXT(%08x), DATA(%08x), RODATA(%08x), BSS(%08x)\n", ovl->textSize, ovl->dataSize, ovl->rodataSize,
|
||||
ovl->bssSize);
|
||||
}
|
||||
|
||||
if(gOverlayLogSeverity >= 3)
|
||||
{
|
||||
if (gOverlayLogSeverity >= 3) {
|
||||
// Relocate
|
||||
osSyncPrintf("リロケーションします\n");
|
||||
}
|
||||
@@ -70,10 +61,8 @@ s32 Overlay_Load(u32 vRomStart, u32 vRomEnd, void *vRamStart, void *vRamEnd, voi
|
||||
Overlay_DoRelocation(allocatedVRamAddr, ovl, vRamStart);
|
||||
|
||||
bssSize = ovl->bssSize;
|
||||
if(bssSize != 0)
|
||||
{
|
||||
if(gOverlayLogSeverity >= 3)
|
||||
{
|
||||
if (bssSize != 0) {
|
||||
if (gOverlayLogSeverity >= 3) {
|
||||
// Clear BSS area (% 08x-% 08x)
|
||||
osSyncPrintf("BSS領域をクリアします(%08x-%08x)\n", end, end + ovl->bssSize);
|
||||
}
|
||||
@@ -85,8 +74,7 @@ s32 Overlay_Load(u32 vRomStart, u32 vRomEnd, void *vRamStart, void *vRamEnd, voi
|
||||
}
|
||||
|
||||
size = (u32)&ovl->relocations[ovl->nRelocations] - (u32)ovl;
|
||||
if(gOverlayLogSeverity >= 3)
|
||||
{
|
||||
if (gOverlayLogSeverity >= 3) {
|
||||
// Clear REL area (%08x-%08x)
|
||||
osSyncPrintf("REL領域をクリアします(%08x-%08x)\n", ovl, (u32)ovl + size);
|
||||
}
|
||||
@@ -97,8 +85,7 @@ s32 Overlay_Load(u32 vRomStart, u32 vRomEnd, void *vRamStart, void *vRamEnd, voi
|
||||
osWritebackDCache(allocatedVRamAddr, size);
|
||||
osInvalICache(allocatedVRamAddr, size);
|
||||
|
||||
if(gOverlayLogSeverity >= 3)
|
||||
{
|
||||
if (gOverlayLogSeverity >= 3) {
|
||||
// Finish loading dynamic link function
|
||||
osSyncPrintf("ダイナミックリンクファンクションのロードを終了します\n\n");
|
||||
}
|
||||
@@ -106,10 +93,8 @@ s32 Overlay_Load(u32 vRomStart, u32 vRomEnd, void *vRamStart, void *vRamEnd, voi
|
||||
}
|
||||
|
||||
// possibly some kind of new() function
|
||||
void *func_800FC800(u32 size)
|
||||
{
|
||||
if (size == 0)
|
||||
{
|
||||
void* func_800FC800(u32 size) {
|
||||
if (size == 0) {
|
||||
size = 1;
|
||||
}
|
||||
|
||||
@@ -117,106 +102,87 @@ void *func_800FC800(u32 size)
|
||||
}
|
||||
|
||||
// possible some kind of delete() function
|
||||
void func_800FC83C(void *ptr)
|
||||
{
|
||||
if (ptr != NULL)
|
||||
{
|
||||
void func_800FC83C(void* ptr) {
|
||||
if (ptr != NULL) {
|
||||
__osFree(&gSystemArena, ptr);
|
||||
}
|
||||
}
|
||||
|
||||
void func_800FC868(void *blk, u32 nBlk, u32 blkSize, arg3_800FC868 arg3)
|
||||
{
|
||||
void func_800FC868(void* blk, u32 nBlk, u32 blkSize, arg3_800FC868 arg3) {
|
||||
u32 pos;
|
||||
|
||||
for (pos = (u32)blk; pos < (u32)blk + (nBlk * blkSize); pos = (u32)pos + (blkSize & ~0))
|
||||
{
|
||||
for (pos = (u32)blk; pos < (u32)blk + (nBlk * blkSize); pos = (u32)pos + (blkSize & ~0)) {
|
||||
arg3((void*)pos);
|
||||
}
|
||||
}
|
||||
|
||||
void func_800FC8D8(void *blk, u32 nBlk, s32 blkSize, arg3_800FC8D8 arg3)
|
||||
{
|
||||
void func_800FC8D8(void* blk, u32 nBlk, s32 blkSize, arg3_800FC8D8 arg3) {
|
||||
u32 pos;
|
||||
|
||||
for (pos = (u32)blk; pos < (u32)blk + (nBlk * blkSize); pos = (u32)pos + (blkSize & ~0))
|
||||
{
|
||||
for (pos = (u32)blk; pos < (u32)blk + (nBlk * blkSize); pos = (u32)pos + (blkSize & ~0)) {
|
||||
arg3((void*)pos, 2);
|
||||
}
|
||||
}
|
||||
|
||||
void *func_800FC948(void *blk, u32 nBlk, u32 blkSize, arg3_800FC948 arg3)
|
||||
{
|
||||
void* func_800FC948(void* blk, u32 nBlk, u32 blkSize, arg3_800FC948 arg3) {
|
||||
u32 pos;
|
||||
if (blk == NULL)
|
||||
{
|
||||
if (blk == NULL) {
|
||||
blk = func_800FC800(nBlk * blkSize);
|
||||
}
|
||||
|
||||
if (blk != NULL && arg3 != NULL)
|
||||
{
|
||||
if (blk != NULL && arg3 != NULL) {
|
||||
pos = (u32)blk;
|
||||
while(pos < (u32)blk + (nBlk * blkSize))
|
||||
{
|
||||
while (pos < (u32)blk + (nBlk * blkSize)) {
|
||||
arg3((void*)pos, 0, 0, 0, 0, 0, 0, 0, 0);
|
||||
pos = (u32)pos + (blkSize & ~0);
|
||||
}
|
||||
|
||||
}
|
||||
return blk;
|
||||
}
|
||||
|
||||
void func_800FCA18(void *blk, u32 nBlk, u32 blkSize, arg3_800FCA18 arg3, s32 arg4)
|
||||
{
|
||||
void func_800FCA18(void* blk, u32 nBlk, u32 blkSize, arg3_800FCA18 arg3, s32 arg4) {
|
||||
u32 pos;
|
||||
u32 end ;
|
||||
u32 end;
|
||||
s32 masked_arg2;
|
||||
|
||||
if (blk == 0)
|
||||
{
|
||||
if (blk == 0) {
|
||||
return;
|
||||
}
|
||||
if (arg3 != 0)
|
||||
{
|
||||
if (arg3 != 0) {
|
||||
end = (u32)blk;
|
||||
masked_arg2 = (s32)(blkSize & ~0);
|
||||
pos = (u32)end + (nBlk * blkSize);
|
||||
|
||||
if (masked_arg2) { }
|
||||
if (masked_arg2) {}
|
||||
|
||||
while (pos > end)
|
||||
{
|
||||
while (pos > end) {
|
||||
do {
|
||||
pos -= masked_arg2;
|
||||
arg3((void*)pos, 2);
|
||||
} while (0);
|
||||
}
|
||||
|
||||
if (!masked_arg2){ }
|
||||
if (!masked_arg2) {}
|
||||
}
|
||||
|
||||
if (arg4 != 0)
|
||||
{
|
||||
if (arg4 != 0) {
|
||||
func_800FC83C(blk);
|
||||
}
|
||||
}
|
||||
|
||||
void func_800FCB34(void)
|
||||
{
|
||||
InitFunc *initFunc;
|
||||
void func_800FCB34(void) {
|
||||
InitFunc* initFunc;
|
||||
u32 nextOffset;
|
||||
InitFunc *prev;
|
||||
InitFunc* prev;
|
||||
|
||||
initFunc = (InitFunc*)&sInitFuncs;
|
||||
nextOffset = initFunc->nextOffset;
|
||||
prev = NULL;
|
||||
|
||||
while(nextOffset != 0)
|
||||
{
|
||||
while (nextOffset != 0) {
|
||||
initFunc = (InitFunc*)((s32)initFunc + nextOffset);
|
||||
|
||||
if(initFunc->func != NULL)
|
||||
{
|
||||
if (initFunc->func != NULL) {
|
||||
(*initFunc->func)();
|
||||
}
|
||||
|
||||
@@ -228,8 +194,7 @@ void func_800FCB34(void)
|
||||
sInitFuncs = prev;
|
||||
}
|
||||
|
||||
void SystemHeap_Init(void *start, u32 size)
|
||||
{
|
||||
void SystemHeap_Init(void* start, u32 size) {
|
||||
SystemArena_Init(start, size);
|
||||
func_800FCB34();
|
||||
}
|
||||
}
|
||||
|
||||
+45
-113
@@ -4,65 +4,47 @@
|
||||
|
||||
s32 use_cfrac;
|
||||
|
||||
f32 Math_tanf(f32 x)
|
||||
{
|
||||
f32 Math_tanf(f32 x) {
|
||||
f32 sin = sinf(x);
|
||||
f32 cos = cosf(x);
|
||||
return sin / cos;
|
||||
}
|
||||
|
||||
f32 Math_floorf(f32 x)
|
||||
{
|
||||
f32 Math_floorf(f32 x) {
|
||||
return floorf(x);
|
||||
}
|
||||
|
||||
f32 Math_ceilf(f32 x)
|
||||
{
|
||||
f32 Math_ceilf(f32 x) {
|
||||
return ceilf(x);
|
||||
}
|
||||
|
||||
f32 Math_roundf(f32 x)
|
||||
{
|
||||
f32 Math_roundf(f32 x) {
|
||||
return roundf(x);
|
||||
}
|
||||
|
||||
f32 Math_truncf(f32 x)
|
||||
{
|
||||
f32 Math_truncf(f32 x) {
|
||||
return truncf(x);
|
||||
}
|
||||
|
||||
f32 Math_nearbyintf(f32 x)
|
||||
{
|
||||
f32 Math_nearbyintf(f32 x) {
|
||||
return nearbyintf(x);
|
||||
}
|
||||
|
||||
/* Arctangent approximation using a Taylor series (one quadrant) */
|
||||
f32 Math_atanf_taylor_q(f32 x)
|
||||
{
|
||||
static const f32 coeffs[] =
|
||||
{
|
||||
-1.f / 3,
|
||||
+1.f / 5,
|
||||
-1.f / 7,
|
||||
+1.f / 9,
|
||||
-1.f / 11,
|
||||
+1.f / 13,
|
||||
-1.f / 15,
|
||||
+1.f / 17,
|
||||
0.f,
|
||||
f32 Math_atanf_taylor_q(f32 x) {
|
||||
static const f32 coeffs[] = {
|
||||
-1.f / 3, +1.f / 5, -1.f / 7, +1.f / 9, -1.f / 11, +1.f / 13, -1.f / 15, +1.f / 17, 0.f,
|
||||
};
|
||||
|
||||
f32 poly = x;
|
||||
f32 sq = SQ(x);
|
||||
f32 exp = x * sq;
|
||||
const f32 *c = coeffs;
|
||||
const f32* c = coeffs;
|
||||
f32 term;
|
||||
|
||||
while (1)
|
||||
{
|
||||
while (1) {
|
||||
term = *c++ * exp;
|
||||
if (poly + term == poly)
|
||||
{
|
||||
if (poly + term == poly) {
|
||||
break;
|
||||
}
|
||||
poly = poly + term;
|
||||
@@ -73,157 +55,107 @@ f32 Math_atanf_taylor_q(f32 x)
|
||||
}
|
||||
|
||||
/* Ditto for two quadrants */
|
||||
f32 Math_atanf_taylor(f32 x)
|
||||
{
|
||||
f32 Math_atanf_taylor(f32 x) {
|
||||
f32 t;
|
||||
f32 q;
|
||||
|
||||
if (x > 0.f)
|
||||
{
|
||||
if (x > 0.f) {
|
||||
t = x;
|
||||
}
|
||||
else if (x < 0.f)
|
||||
{
|
||||
} else if (x < 0.f) {
|
||||
t = -x;
|
||||
}
|
||||
else if (x == 0.f)
|
||||
{
|
||||
} else if (x == 0.f) {
|
||||
return 0.f;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
return qNaN0x10000;
|
||||
}
|
||||
|
||||
if (t <= M_SQRT2 - 1.f)
|
||||
{
|
||||
if (t <= M_SQRT2 - 1.f) {
|
||||
return Math_atanf_taylor_q(x);
|
||||
}
|
||||
|
||||
if (t >= M_SQRT2 + 1.f)
|
||||
{
|
||||
if (t >= M_SQRT2 + 1.f) {
|
||||
q = M_PI / 2 - Math_atanf_taylor_q(1.f / t);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
q = M_PI / 4 - Math_atanf_taylor_q((1.f - t) / (1.f + t));
|
||||
}
|
||||
|
||||
if (x > 0.f)
|
||||
{
|
||||
if (x > 0.f) {
|
||||
return q;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
return -q;
|
||||
}
|
||||
}
|
||||
|
||||
/* Arctangent approximation using a continued fraction */
|
||||
f32 Math_atanf_cfrac(f32 x)
|
||||
{
|
||||
f32 Math_atanf_cfrac(f32 x) {
|
||||
s32 sector;
|
||||
f32 z;
|
||||
f32 conv;
|
||||
f32 sq;
|
||||
s32 i;
|
||||
|
||||
if (x >= -1.f && x <= 1.f)
|
||||
{
|
||||
if (x >= -1.f && x <= 1.f) {
|
||||
sector = 0;
|
||||
}
|
||||
else if (x > 1.f)
|
||||
{
|
||||
} else if (x > 1.f) {
|
||||
sector = 1;
|
||||
x = 1.f / x;
|
||||
}
|
||||
else if (x < -1.f)
|
||||
{
|
||||
} else if (x < -1.f) {
|
||||
sector = -1;
|
||||
x = 1.f / x;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
return qNaN0x10000;
|
||||
}
|
||||
|
||||
sq = SQ(x);
|
||||
conv = 0.f;
|
||||
z = 8.f;
|
||||
for (i = 8; i != 0; i--)
|
||||
{
|
||||
for (i = 8; i != 0; i--) {
|
||||
conv = SQ(z) * sq / (2.f * z + 1.f + conv);
|
||||
z -= 1.f;
|
||||
}
|
||||
conv = x / (1.f + conv);
|
||||
|
||||
if (sector == 0)
|
||||
{
|
||||
if (sector == 0) {
|
||||
return conv;
|
||||
}
|
||||
else if (sector > 0)
|
||||
{
|
||||
} else if (sector > 0) {
|
||||
return M_PI / 2 - conv;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
return -M_PI / 2 - conv;
|
||||
}
|
||||
}
|
||||
|
||||
f32 Math_atanf(f32 x)
|
||||
{
|
||||
if (use_cfrac == 0)
|
||||
{
|
||||
f32 Math_atanf(f32 x) {
|
||||
if (use_cfrac == 0) {
|
||||
return Math_atanf_taylor(x);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
return Math_atanf_cfrac(x);
|
||||
}
|
||||
}
|
||||
|
||||
f32 Math_atan2f(f32 y, f32 x)
|
||||
{
|
||||
if (x == 0.f)
|
||||
{
|
||||
if (y == 0.f)
|
||||
{
|
||||
f32 Math_atan2f(f32 y, f32 x) {
|
||||
if (x == 0.f) {
|
||||
if (y == 0.f) {
|
||||
return 0.f;
|
||||
}
|
||||
else if (y > 0.f)
|
||||
{
|
||||
} else if (y > 0.f) {
|
||||
return M_PI / 2;
|
||||
}
|
||||
else if (y < 0.f)
|
||||
{
|
||||
} else if (y < 0.f) {
|
||||
return -M_PI / 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
return qNaN0x10000;
|
||||
}
|
||||
}
|
||||
else if (x >= 0.f)
|
||||
{
|
||||
} else if (x >= 0.f) {
|
||||
return Math_atanf(y / x);
|
||||
}
|
||||
else if (y < 0.f)
|
||||
{
|
||||
} else if (y < 0.f) {
|
||||
return Math_atanf(y / x) - M_PI;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
return M_PI - Math_atanf(-(y / x));
|
||||
}
|
||||
}
|
||||
|
||||
f32 Math_asinf(f32 x)
|
||||
{
|
||||
f32 Math_asinf(f32 x) {
|
||||
return Math_atan2f(x, sqrtf(1.f - SQ(x)));
|
||||
}
|
||||
|
||||
f32 Math_acosf(f32 x)
|
||||
{
|
||||
f32 Math_acosf(f32 x) {
|
||||
return M_PI / 2 - Math_asinf(x);
|
||||
}
|
||||
|
||||
@@ -80,4 +80,3 @@
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_800B958C.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_800B9638.s")
|
||||
|
||||
|
||||
+32
-51
@@ -1,131 +1,112 @@
|
||||
#include <global.h>
|
||||
|
||||
#define LOG_SEVERITY_NOLOG 0
|
||||
#define LOG_SEVERITY_ERROR 2
|
||||
#define LOG_SEVERITY_VERBOSE 3
|
||||
#define LOG_SEVERITY_NOLOG 0
|
||||
#define LOG_SEVERITY_ERROR 2
|
||||
#define LOG_SEVERITY_VERBOSE 3
|
||||
|
||||
s32 gDebugArenaLogSeverity = LOG_SEVERITY_ERROR;
|
||||
Arena sDebugArena;
|
||||
|
||||
void DebugArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action)
|
||||
{
|
||||
if (!ptr)
|
||||
{
|
||||
if (gDebugArenaLogSeverity >= LOG_SEVERITY_ERROR)
|
||||
{
|
||||
void DebugArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action) {
|
||||
if (!ptr) {
|
||||
if (gDebugArenaLogSeverity >= LOG_SEVERITY_ERROR) {
|
||||
//"%s: %u bytes %s failed\n"
|
||||
osSyncPrintf("%s: %u バイトの%sに失敗しました\n", name, size, action);
|
||||
__osDisplayArena(&sDebugArena);
|
||||
__osDisplayArena(&sDebugArena);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (gDebugArenaLogSeverity >= LOG_SEVERITY_VERBOSE)
|
||||
{
|
||||
} else if (gDebugArenaLogSeverity >= LOG_SEVERITY_VERBOSE) {
|
||||
//"%s: %u bytes %s succeeded\n"
|
||||
osSyncPrintf("%s: %u バイトの%sに成功しました\n", name, size, action);
|
||||
}
|
||||
}
|
||||
|
||||
void* DebugArena_Malloc(u32 size)
|
||||
{
|
||||
void* DebugArena_Malloc(u32 size) {
|
||||
void* ptr;
|
||||
ptr = __osMalloc(&sDebugArena, size);
|
||||
DebugArena_CheckPointer(ptr, size, "debug_malloc", "確保"); //Secure
|
||||
DebugArena_CheckPointer(ptr, size, "debug_malloc", "確保"); // Secure
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void* DebugArena_MallocDebug(u32 size, const char* file, s32 line)
|
||||
{
|
||||
void* DebugArena_MallocDebug(u32 size, const char* file, s32 line) {
|
||||
void* ptr;
|
||||
ptr = __osMallocDebug(&sDebugArena, size, file, line);
|
||||
DebugArena_CheckPointer(ptr, size, "debug_malloc_DEBUG", "確保"); //Secure
|
||||
DebugArena_CheckPointer(ptr, size, "debug_malloc_DEBUG", "確保"); // Secure
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void* DebugArena_MallocR(u32 size)
|
||||
{
|
||||
void* DebugArena_MallocR(u32 size) {
|
||||
void* ptr;
|
||||
ptr = __osMallocR(&sDebugArena, size);
|
||||
DebugArena_CheckPointer(ptr, size, "debug_malloc_r", "確保"); //Secure
|
||||
DebugArena_CheckPointer(ptr, size, "debug_malloc_r", "確保"); // Secure
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void* DebugArena_MallocRDebug(u32 size, const char* file, s32 line)
|
||||
{
|
||||
void* DebugArena_MallocRDebug(u32 size, const char* file, s32 line) {
|
||||
void* ptr;
|
||||
ptr = __osMallocRDebug(&sDebugArena, size, file, line);
|
||||
DebugArena_CheckPointer(ptr, size, "debug_malloc_r_DEBUG", "確保"); //Secure
|
||||
DebugArena_CheckPointer(ptr, size, "debug_malloc_r_DEBUG", "確保"); // Secure
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void* DebugArena_Realloc(void* ptr, u32 newSize)
|
||||
{
|
||||
void* DebugArena_Realloc(void* ptr, u32 newSize) {
|
||||
ptr = __osRealloc(&sDebugArena, ptr, newSize);
|
||||
DebugArena_CheckPointer(ptr, newSize, "debug_realloc", "再確保"); // Re-securing
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void* DebugArena_ReallocDebug(void* ptr, u32 newSize, const char* file, s32 line)
|
||||
{
|
||||
void* DebugArena_ReallocDebug(void* ptr, u32 newSize, const char* file, s32 line) {
|
||||
ptr = __osReallocDebug(&sDebugArena, ptr, newSize, file, line);
|
||||
DebugArena_CheckPointer(ptr, newSize, "debug_realloc_DEBUG", "再確保"); // Re-securing
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void DebugArena_Free(void* ptr)
|
||||
{
|
||||
void DebugArena_Free(void* ptr) {
|
||||
__osFree(&sDebugArena, ptr);
|
||||
}
|
||||
|
||||
void DebugArena_FreeDebug(void* ptr, const char* file, s32 line)
|
||||
{
|
||||
void DebugArena_FreeDebug(void* ptr, const char* file, s32 line) {
|
||||
__osFreeDebug(&sDebugArena, ptr, file, line);
|
||||
}
|
||||
|
||||
void* DebugArena_Calloc(u32 num, u32 size)
|
||||
{
|
||||
void* DebugArena_Calloc(u32 num, u32 size) {
|
||||
void* ret;
|
||||
u32 n;
|
||||
|
||||
n = num*size;
|
||||
|
||||
n = num * size;
|
||||
ret = __osMalloc(&sDebugArena, n);
|
||||
if (ret)
|
||||
if (ret) {
|
||||
bzero(ret, n);
|
||||
}
|
||||
|
||||
DebugArena_CheckPointer(ret, n, "debug_calloc", "確保");
|
||||
return ret;
|
||||
}
|
||||
|
||||
void DebugArena_Display()
|
||||
{
|
||||
//Zelda heap display (devs forgot to change "Zelda" to "Debug" apparently)
|
||||
void DebugArena_Display() {
|
||||
// Zelda heap display (devs forgot to change "Zelda" to "Debug" apparently)
|
||||
osSyncPrintf("ゼルダヒープ表示\n");
|
||||
__osDisplayArena(&sDebugArena);
|
||||
}
|
||||
|
||||
void DebugArena_GetSizes(u32* outMaxFree, u32* outFree, u32* outAlloc)
|
||||
{
|
||||
void DebugArena_GetSizes(u32* outMaxFree, u32* outFree, u32* outAlloc) {
|
||||
ArenaImpl_GetSizes(&sDebugArena, outMaxFree, outFree, outAlloc);
|
||||
}
|
||||
|
||||
void DebugArena_Check()
|
||||
{
|
||||
void DebugArena_Check() {
|
||||
__osCheckArena(&sDebugArena);
|
||||
}
|
||||
|
||||
void DebugArena_Init(void* start, u32 size)
|
||||
{
|
||||
void DebugArena_Init(void* start, u32 size) {
|
||||
gDebugArenaLogSeverity = LOG_SEVERITY_NOLOG;
|
||||
__osMallocInit(&sDebugArena, start, size);
|
||||
}
|
||||
|
||||
void DebugArena_Cleanup()
|
||||
{
|
||||
void DebugArena_Cleanup() {
|
||||
gDebugArenaLogSeverity = LOG_SEVERITY_NOLOG;
|
||||
__osMallocCleanup(&sDebugArena);
|
||||
}
|
||||
|
||||
u8 DebugArena_IsInitalized()
|
||||
{
|
||||
u8 DebugArena_IsInitalized() {
|
||||
return __osMallocIsInitalized(&sDebugArena);
|
||||
}
|
||||
|
||||
+120
-176
@@ -3,9 +3,8 @@
|
||||
#include <alloca.h>
|
||||
#include <vt.h>
|
||||
|
||||
//data
|
||||
const char* sExceptionNames[] =
|
||||
{
|
||||
// data
|
||||
const char* sExceptionNames[] = {
|
||||
"Interrupt",
|
||||
"TLB modification",
|
||||
"TLB exception on load",
|
||||
@@ -32,7 +31,7 @@ const char* sExceptionNames[] =
|
||||
"Inexact operation",
|
||||
};
|
||||
|
||||
//bss
|
||||
// bss
|
||||
FaultThreadStruct* sFaultStructPtr;
|
||||
u8 sFaultIsWaitingForInput;
|
||||
char sFaultStack[0x600];
|
||||
@@ -41,23 +40,22 @@ FaultThreadStruct gFaultStruct;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/fault/pad_800D3F10.s")
|
||||
|
||||
void Fault_SleepImpl(u32 duration)
|
||||
{
|
||||
void Fault_SleepImpl(u32 duration) {
|
||||
u64 value = (duration * OS_CPU_COUNTER) / 1000ull;
|
||||
func_800FF3A0(value);
|
||||
}
|
||||
|
||||
void Fault_ClientProcessThread(FaultClientContext* ctx)
|
||||
{
|
||||
if (ctx->callback)
|
||||
void Fault_ClientProcessThread(FaultClientContext* ctx) {
|
||||
if (ctx->callback) {
|
||||
ctx->ret = ctx->callback(ctx->param0, ctx->param1);
|
||||
}
|
||||
|
||||
if (ctx->queue)
|
||||
if (ctx->queue) {
|
||||
osSendMesg(ctx->queue, ctx->msg, 1);
|
||||
}
|
||||
}
|
||||
|
||||
void Fault_ProcessClientContext(FaultClientContext* ctx)
|
||||
{
|
||||
void Fault_ProcessClientContext(FaultClientContext* ctx) {
|
||||
OSMesgQueue queue;
|
||||
OSMesg msg;
|
||||
OSMesg recMsg;
|
||||
@@ -72,27 +70,23 @@ void Fault_ProcessClientContext(FaultClientContext* ctx)
|
||||
ctx->queue = &queue;
|
||||
ctx->msg = NULL;
|
||||
|
||||
if (sFaultStructPtr->currClientThreadSp != 0)
|
||||
{
|
||||
if (sFaultStructPtr->currClientThreadSp != 0) {
|
||||
thread = alloca(sizeof(OSThread));
|
||||
osCreateThread(thread, 2, Fault_ClientProcessThread, ctx, sFaultStructPtr->currClientThreadSp, 0x7E);
|
||||
osStartThread(thread);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
Fault_ClientProcessThread(ctx);
|
||||
}
|
||||
|
||||
while (true)
|
||||
{
|
||||
while (true) {
|
||||
osSetTimer(&timer, OS_USEC_TO_CYCLES(1000000), 0, &queue, (OSMesg)timerMsgVal);
|
||||
osRecvMesg(&queue, &recMsg, 1);
|
||||
|
||||
if (recMsg != (OSMesg)666)
|
||||
if (recMsg != (OSMesg)666) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (!sFaultIsWaitingForInput)
|
||||
{
|
||||
if (!sFaultIsWaitingForInput) {
|
||||
ctx->ret = -1;
|
||||
break;
|
||||
}
|
||||
@@ -100,15 +94,13 @@ void Fault_ProcessClientContext(FaultClientContext* ctx)
|
||||
|
||||
osStopTimer(&timer);
|
||||
|
||||
if (thread != NULL)
|
||||
{
|
||||
if (thread != NULL) {
|
||||
osStopThread(thread);
|
||||
osDestroyThread(thread);
|
||||
}
|
||||
}
|
||||
|
||||
u32 Fault_ProcessClient(u32 callback, u32 param0, u32 param1)
|
||||
{
|
||||
u32 Fault_ProcessClient(u32 callback, u32 param0, u32 param1) {
|
||||
FaultClientContext a;
|
||||
a.callback = callback;
|
||||
a.param0 = param0;
|
||||
@@ -120,8 +112,7 @@ u32 Fault_ProcessClient(u32 callback, u32 param0, u32 param1)
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// minor ordering differences
|
||||
void Fault_AddClient(FaultClient* client, void* callback, void* param0, void* param1)
|
||||
{
|
||||
void Fault_AddClient(FaultClient* client, void* callback, void* param0, void* param1) {
|
||||
OSIntMask mask;
|
||||
u32 alreadyExists;
|
||||
FaultClient* iter;
|
||||
@@ -130,10 +121,8 @@ void Fault_AddClient(FaultClient* client, void* callback, void* param0, void* pa
|
||||
mask = osSetIntMask(1);
|
||||
|
||||
iter = sFaultStructPtr->clients;
|
||||
while (iter)
|
||||
{
|
||||
if (iter == client)
|
||||
{
|
||||
while (iter) {
|
||||
if (iter == client) {
|
||||
alreadyExists = true;
|
||||
goto end;
|
||||
}
|
||||
@@ -188,8 +177,9 @@ void Fault_RemoveClient(FaultClient* client) {
|
||||
|
||||
osSetIntMask(mask);
|
||||
|
||||
if (listIsEmpty)
|
||||
if (listIsEmpty) {
|
||||
osSyncPrintf(VT_COL(RED, WHITE) "fault_RemoveClient: %08x リスト不整合です\n" VT_RST, client);
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/fault/Fault_AddAddrConvClient.s")
|
||||
@@ -228,24 +218,23 @@ void Fault_RemoveAddrConvClient(FaultAddrConvClient* client) {
|
||||
osSetIntMask(mask);
|
||||
|
||||
if (listIsEmpty) {
|
||||
osSyncPrintf(VT_COL(RED, WHITE) "fault_AddressConverterRemoveClient: %08x は既にリスト中にある\n" VT_RST, client);
|
||||
osSyncPrintf(VT_COL(RED, WHITE) "fault_AddressConverterRemoveClient: %08x は既にリスト中にある\n" VT_RST,
|
||||
client);
|
||||
}
|
||||
}
|
||||
|
||||
u32 Fault_ConvertAddress(FaultAddrConvClient* client)
|
||||
{
|
||||
u32 Fault_ConvertAddress(FaultAddrConvClient* client) {
|
||||
u32 ret;
|
||||
FaultAddrConvClient* iter = sFaultStructPtr->addrConvClients;
|
||||
|
||||
while(iter)
|
||||
{
|
||||
if (iter->callback)
|
||||
{
|
||||
while (iter) {
|
||||
if (iter->callback) {
|
||||
ret = Fault_ProcessClient(iter->callback, client, iter->param);
|
||||
if (ret == -1)
|
||||
if (ret == -1) {
|
||||
Fault_RemoveAddrConvClient(iter);
|
||||
else if (ret)
|
||||
} else if (ret) {
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
iter = iter->next;
|
||||
}
|
||||
@@ -253,35 +242,29 @@ u32 Fault_ConvertAddress(FaultAddrConvClient* client)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Fault_Sleep(u32 duration)
|
||||
{
|
||||
void Fault_Sleep(u32 duration) {
|
||||
Fault_SleepImpl(duration);
|
||||
}
|
||||
|
||||
void Fault_PadCallback(Input* input)
|
||||
{
|
||||
//BUG: this function is not called correctly and thus will crash from reading a bad pointer at 0x800C7E4C
|
||||
void Fault_PadCallback(Input* input) {
|
||||
// BUG: this function is not called correctly and thus will crash from reading a bad pointer at 0x800C7E4C
|
||||
func_800C7E08(input, 0);
|
||||
}
|
||||
|
||||
void Fault_UpdatePadImpl()
|
||||
{
|
||||
void Fault_UpdatePadImpl() {
|
||||
sFaultStructPtr->padCallback(&sFaultStructPtr->padInput);
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// ordering differences and possibly regalloc
|
||||
u32 Fault_WaitForInputImpl()
|
||||
{
|
||||
u32 Fault_WaitForInputImpl() {
|
||||
u16 kDown;
|
||||
u32 exitDebugger;
|
||||
s32 count = 600;
|
||||
Input* curInput = &sFaultStructPtr->padInput;
|
||||
|
||||
while (true)
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
while (true) {
|
||||
while (true) {
|
||||
Fault_Sleep(0x10);
|
||||
Fault_UpdatePadImpl();
|
||||
|
||||
@@ -316,71 +299,63 @@ u32 Fault_WaitForInputImpl()
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/fault/Fault_WaitForInputImpl.s")
|
||||
#endif
|
||||
|
||||
void Fault_WaitForInput()
|
||||
{
|
||||
void Fault_WaitForInput() {
|
||||
sFaultIsWaitingForInput = 1;
|
||||
Fault_WaitForInputImpl();
|
||||
sFaultIsWaitingForInput = 0;
|
||||
}
|
||||
|
||||
void Fault_DrawRec(s32 x, s32 y, s32 w, s32 h, u16 color)
|
||||
{
|
||||
void Fault_DrawRec(s32 x, s32 y, s32 w, s32 h, u16 color) {
|
||||
FaultDrawer_DrawRecImpl(x, y, x + w - 1, y + h - 1, color);
|
||||
}
|
||||
|
||||
void Fault_FillScreenBlack()
|
||||
{
|
||||
void Fault_FillScreenBlack() {
|
||||
FaultDrawer_SetForeColor(0xFFFF);
|
||||
FaultDrawer_SetBackColor(1);
|
||||
FaultDrawer_FillScreen();
|
||||
FaultDrawer_SetBackColor(0);
|
||||
}
|
||||
|
||||
void Fault_FillScreenRed()
|
||||
{
|
||||
void Fault_FillScreenRed() {
|
||||
FaultDrawer_SetForeColor(0xFFFF);
|
||||
FaultDrawer_SetBackColor(0xF001);
|
||||
FaultDrawer_FillScreen();
|
||||
FaultDrawer_SetBackColor(0);
|
||||
}
|
||||
|
||||
void Fault_DrawCornerRec(u16 color)
|
||||
{
|
||||
void Fault_DrawCornerRec(u16 color) {
|
||||
Fault_DrawRec(0x16, 0x10, 8, 1, color);
|
||||
}
|
||||
|
||||
void Fault_PrintFReg(s32 idx, f32* value)
|
||||
{
|
||||
void Fault_PrintFReg(s32 idx, f32* value) {
|
||||
u32 raw = *(u32*)value;
|
||||
s32 v0 = ((raw & 0x7f800000) >> 0x17) - 0x7f;
|
||||
|
||||
if ((v0 >= -0x7e && v0 < 0x80) || raw == 0)
|
||||
if ((v0 >= -0x7e && v0 < 0x80) || raw == 0) {
|
||||
FaultDrawer_Printf("F%02d:%14.7e ", idx, *value);
|
||||
else
|
||||
} else {
|
||||
FaultDrawer_Printf("F%02d: %08x(16) ", idx, raw);
|
||||
}
|
||||
}
|
||||
|
||||
void Fault_LogFReg(s32 idx, f32* value)
|
||||
{
|
||||
void Fault_LogFReg(s32 idx, f32* value) {
|
||||
u32 raw = *(u32*)value;
|
||||
s32 v0 = ((raw & 0x7f800000) >> 0x17) - 0x7f;
|
||||
|
||||
if ((v0 >= -0x7e && v0 < 0x80) || raw == 0)
|
||||
if ((v0 >= -0x7e && v0 < 0x80) || raw == 0) {
|
||||
osSyncPrintf("F%02d:%14.7e ", idx, *value);
|
||||
else
|
||||
} else {
|
||||
osSyncPrintf("F%02d: %08x(16) ", idx, *(u32*)value);
|
||||
}
|
||||
}
|
||||
|
||||
void Fault_PrintFPCR(u32 value)
|
||||
{
|
||||
void Fault_PrintFPCR(u32 value) {
|
||||
s32 i;
|
||||
u32 flag = 0x20000;
|
||||
FaultDrawer_Printf("FPCSR:%08xH ", value);
|
||||
for (i = 0; i < 6; i++)
|
||||
{
|
||||
if (value & flag)
|
||||
{
|
||||
FaultDrawer_Printf("(%s)", sExceptionNames[i+18]);
|
||||
for (i = 0; i < 6; i++) {
|
||||
if (value & flag) {
|
||||
FaultDrawer_Printf("(%s)", sExceptionNames[i + 18]);
|
||||
break;
|
||||
}
|
||||
flag >>= 1;
|
||||
@@ -388,30 +363,28 @@ void Fault_PrintFPCR(u32 value)
|
||||
FaultDrawer_Printf("\n");
|
||||
}
|
||||
|
||||
void Fault_LogFPCR(u32 value)
|
||||
{
|
||||
void Fault_LogFPCR(u32 value) {
|
||||
s32 i;
|
||||
u32 flag = 0x20000;
|
||||
osSyncPrintf("FPCSR:%08xH ", value);
|
||||
for (i = 0; i < 6; i++)
|
||||
{
|
||||
if (value & flag)
|
||||
{
|
||||
osSyncPrintf("(%s)\n", sExceptionNames[i+18]);
|
||||
for (i = 0; i < 6; i++) {
|
||||
if (value & flag) {
|
||||
osSyncPrintf("(%s)\n", sExceptionNames[i + 18]);
|
||||
break;
|
||||
}
|
||||
flag >>= 1;
|
||||
}
|
||||
}
|
||||
|
||||
void Fault_PrintThreadContext(OSThread* t)
|
||||
{
|
||||
__OSThreadContext *ctx;
|
||||
s32 causeStrIdx = (s32) ((((u32) t->context.cause >> 2) & 0x1f) << 0x10) >> 0x10;
|
||||
if (causeStrIdx == 0x17)
|
||||
void Fault_PrintThreadContext(OSThread* t) {
|
||||
__OSThreadContext* ctx;
|
||||
s32 causeStrIdx = (s32)((((u32)t->context.cause >> 2) & 0x1f) << 0x10) >> 0x10;
|
||||
if (causeStrIdx == 0x17) {
|
||||
causeStrIdx = 0x10;
|
||||
if (causeStrIdx == 0x1f)
|
||||
}
|
||||
if (causeStrIdx == 0x1f) {
|
||||
causeStrIdx = 0x11;
|
||||
}
|
||||
|
||||
FaultDrawer_FillScreen();
|
||||
FaultDrawer_SetCharPad(-2, 4);
|
||||
@@ -462,14 +435,15 @@ void Fault_PrintThreadContext(OSThread* t)
|
||||
FaultDrawer_SetCharPad(0, 0);
|
||||
}
|
||||
|
||||
void Fault_LogThreadContext(OSThread* t)
|
||||
{
|
||||
__OSThreadContext *ctx;
|
||||
s32 causeStrIdx = (s32) ((((u32) t->context.cause >> 2) & 0x1f) << 0x10) >> 0x10;
|
||||
if (causeStrIdx == 0x17)
|
||||
void Fault_LogThreadContext(OSThread* t) {
|
||||
__OSThreadContext* ctx;
|
||||
s32 causeStrIdx = (s32)((((u32)t->context.cause >> 2) & 0x1f) << 0x10) >> 0x10;
|
||||
if (causeStrIdx == 0x17) {
|
||||
causeStrIdx = 0x10;
|
||||
if (causeStrIdx == 0x1f)
|
||||
}
|
||||
if (causeStrIdx == 0x1f) {
|
||||
causeStrIdx = 0x11;
|
||||
}
|
||||
|
||||
ctx = &t->context;
|
||||
osSyncPrintf("\n");
|
||||
@@ -515,26 +489,23 @@ void Fault_LogThreadContext(OSThread* t)
|
||||
osSyncPrintf("\n");
|
||||
}
|
||||
|
||||
OSThread* Fault_FindFaultedThread()
|
||||
{
|
||||
OSThread* Fault_FindFaultedThread() {
|
||||
OSThread* iter = func_80104140();
|
||||
while (iter->priority != -1)
|
||||
{
|
||||
if (iter->priority > 0 && iter->priority < 0x7f && (iter->flags & 3))
|
||||
while (iter->priority != -1) {
|
||||
if (iter->priority > 0 && iter->priority < 0x7f && (iter->flags & 3)) {
|
||||
return iter;
|
||||
}
|
||||
iter = iter->tlnext;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void Fault_Wait5Seconds(void)
|
||||
{
|
||||
OSTime start[2]; //to make the function allocate 0x28 bytes of stack instead of 0x20
|
||||
void Fault_Wait5Seconds(void) {
|
||||
OSTime start[2]; // to make the function allocate 0x28 bytes of stack instead of 0x20
|
||||
start[0] = osGetTime();
|
||||
do
|
||||
{
|
||||
do {
|
||||
Fault_Sleep(0x10);
|
||||
} while ((osGetTime() - start[0]) < OS_USEC_TO_CYCLES(5000000)+1); //0xdf84759
|
||||
} while ((osGetTime() - start[0]) < OS_USEC_TO_CYCLES(5000000) + 1); // 0xdf84759
|
||||
|
||||
sFaultStructPtr->faultActive = true;
|
||||
}
|
||||
@@ -561,7 +532,7 @@ void Fault_DrawMemDumpPage(const char* title, u32* addr, u32 param_3) {
|
||||
Fault_FillScreenBlack();
|
||||
FaultDrawer_SetCharPad(-2, 0);
|
||||
|
||||
FaultDrawer_DrawText(0x24, 0x12, "%s %08x", title? title : "PrintDump", alignedAddr);
|
||||
FaultDrawer_DrawText(0x24, 0x12, "%s %08x", title ? title : "PrintDump", alignedAddr);
|
||||
if (alignedAddr >= (u32*)0x80000000 && alignedAddr < (u32*)0xC0000000) {
|
||||
for (y = 0x1C; y != 0xE2; y += 9) {
|
||||
FaultDrawer_DrawText(0x18, y, "%06x", writeAddr);
|
||||
@@ -577,15 +548,13 @@ void Fault_DrawMemDumpPage(const char* title, u32* addr, u32 param_3) {
|
||||
#ifdef NON_MATCHING
|
||||
// saved register and stack usage differences
|
||||
// possibly some minor ordering and regalloc differences
|
||||
void Fault_DrawMemDump(u32 pc, u32 sp, u32 unk0, u32 unk1)
|
||||
{
|
||||
void Fault_DrawMemDump(u32 pc, u32 sp, u32 unk0, u32 unk1) {
|
||||
Input* curInput = &sFaultStructPtr->padInput;
|
||||
u32 addr = pc;
|
||||
s32 count;
|
||||
s32 off;
|
||||
|
||||
while (true)
|
||||
{
|
||||
while (true) {
|
||||
if (addr < 0x80000000)
|
||||
addr = 0x80000000;
|
||||
if (addr > 0x807fff00)
|
||||
@@ -595,8 +564,7 @@ void Fault_DrawMemDump(u32 pc, u32 sp, u32 unk0, u32 unk1)
|
||||
Fault_DrawMemDumpPage("Dump", (u32*)addr, 0);
|
||||
count = 600;
|
||||
|
||||
while (sFaultStructPtr->faultActive)
|
||||
{
|
||||
while (sFaultStructPtr->faultActive) {
|
||||
if (count == 0)
|
||||
return;
|
||||
|
||||
@@ -607,8 +575,7 @@ void Fault_DrawMemDump(u32 pc, u32 sp, u32 unk0, u32 unk1)
|
||||
sFaultStructPtr->faultActive = false;
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
do {
|
||||
Fault_Sleep(0x10);
|
||||
Fault_UpdatePadImpl();
|
||||
} while (curInput->padPressed == 0);
|
||||
@@ -652,8 +619,7 @@ void Fault_DrawMemDump(u32 pc, u32 sp, u32 unk0, u32 unk1)
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/fault/Fault_LogStackTrace.s")
|
||||
|
||||
void Fault_ResumeThread(OSThread* t)
|
||||
{
|
||||
void Fault_ResumeThread(OSThread* t) {
|
||||
t->context.cause = 0;
|
||||
t->context.fpcsr = 0;
|
||||
t->context.pc += 4;
|
||||
@@ -663,39 +629,39 @@ void Fault_ResumeThread(OSThread* t)
|
||||
osStartThread(t);
|
||||
}
|
||||
|
||||
void Fault_CommitFB()
|
||||
{
|
||||
void Fault_CommitFB() {
|
||||
u16* fb;
|
||||
osViSetYScale(1.0f);
|
||||
osViSetMode(&osViModeNtscLan1);
|
||||
osViSetSpecialFeatures(0x42); //gama_disable|dither_fliter_enable_aa_mode3_disable
|
||||
osViSetSpecialFeatures(0x42); // gama_disable|dither_fliter_enable_aa_mode3_disable
|
||||
osViBlack(false);
|
||||
|
||||
if (sFaultStructPtr->fb)
|
||||
if (sFaultStructPtr->fb) {
|
||||
fb = sFaultStructPtr->fb;
|
||||
else
|
||||
{
|
||||
} else {
|
||||
fb = (u16*)osViGetNextFramebuffer();
|
||||
if ((u32)fb == 0x80000000)
|
||||
if ((u32)fb == 0x80000000) {
|
||||
fb = (u16*)((osMemSize | 0x80000000) - 0x25800);
|
||||
}
|
||||
}
|
||||
|
||||
osViSwapBuffer(fb);
|
||||
FaultDrawer_SetDrawerFB(fb, 0x140, 0xf0);
|
||||
}
|
||||
|
||||
void Fault_ProcessClients(void)
|
||||
{
|
||||
void Fault_ProcessClients(void) {
|
||||
FaultClient* iter = sFaultStructPtr->clients;
|
||||
s32 idx = 0;
|
||||
|
||||
while(iter)
|
||||
{
|
||||
if (iter->callback)
|
||||
{
|
||||
while (iter) {
|
||||
if (iter->callback) {
|
||||
Fault_FillScreenBlack();
|
||||
FaultDrawer_SetCharPad(-2, 0);
|
||||
FaultDrawer_Printf("\x1a""8CallBack (%d) %08x %08x %08x\n""\x1a""7", idx++, iter, iter->param1, iter->param2);
|
||||
FaultDrawer_Printf("\x1a"
|
||||
"8CallBack (%d) %08x %08x %08x\n"
|
||||
"\x1a"
|
||||
"7",
|
||||
idx++, iter, iter->param1, iter->param2);
|
||||
FaultDrawer_SetCharPad(0, 0);
|
||||
Fault_ProcessClient(iter->callback, iter->param1, iter->param2);
|
||||
Fault_WaitForInput();
|
||||
@@ -705,45 +671,34 @@ void Fault_ProcessClients(void)
|
||||
}
|
||||
}
|
||||
|
||||
void Fault_UpdatePad()
|
||||
{
|
||||
void Fault_UpdatePad() {
|
||||
Fault_UpdatePadImpl();
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// saved register and stack usage differences
|
||||
void Fault_ThreadEntry(void* arg)
|
||||
{
|
||||
void Fault_ThreadEntry(void* arg) {
|
||||
OSThread* faultedThread;
|
||||
OSMesg msg;
|
||||
|
||||
osSetEventMesg(OS_EVENT_CPU_BREAK, &sFaultStructPtr->queue, 1);
|
||||
osSetEventMesg(OS_EVENT_FAULT, &sFaultStructPtr->queue, 2);
|
||||
|
||||
while (true)
|
||||
{
|
||||
do
|
||||
{
|
||||
while (true) {
|
||||
do {
|
||||
osRecvMesg(&sFaultStructPtr->queue, &msg, 1);
|
||||
|
||||
if (msg == (OSMesg)1)
|
||||
{
|
||||
if (msg == (OSMesg)1) {
|
||||
sFaultStructPtr->msgId = 1;
|
||||
osSyncPrintf("フォルトマネージャ:OS_EVENT_CPU_BREAKを受信しました\n");
|
||||
}
|
||||
else if (1 && msg == (OSMesg)2)
|
||||
{
|
||||
} else if (1 && msg == (OSMesg)2) {
|
||||
sFaultStructPtr->msgId = 2;
|
||||
osSyncPrintf("フォルトマネージャ:OS_EVENT_FAULTを受信しました\n");
|
||||
}
|
||||
else if (msg == (OSMesg)3)
|
||||
{
|
||||
} else if (msg == (OSMesg)3) {
|
||||
Fault_UpdatePad();
|
||||
faultedThread = NULL;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
sFaultStructPtr->msgId = 3;
|
||||
osSyncPrintf("フォルトマネージャ:不明なメッセージを受信しました\n");
|
||||
}
|
||||
@@ -751,8 +706,7 @@ void Fault_ThreadEntry(void* arg)
|
||||
faultedThread = __osGetCurrFaultedThread();
|
||||
osSyncPrintf("__osGetCurrFaultedThread()=%08x\n", faultedThread);
|
||||
|
||||
if (faultedThread == NULL)
|
||||
{
|
||||
if (faultedThread == NULL) {
|
||||
faultedThread = Fault_FindFaultedThread();
|
||||
osSyncPrintf("FindFaultedThread()=%08x\n", faultedThread);
|
||||
}
|
||||
@@ -769,8 +723,7 @@ void Fault_ThreadEntry(void* arg)
|
||||
|
||||
if (sFaultStructPtr->faultActive)
|
||||
Fault_Wait5Seconds();
|
||||
else
|
||||
{
|
||||
else {
|
||||
Fault_DrawCornerRec(0xF801);
|
||||
Fault_WaitForButtonCombo();
|
||||
}
|
||||
@@ -779,8 +732,7 @@ void Fault_ThreadEntry(void* arg)
|
||||
FaultDrawer_SetForeColor(0xFFFF);
|
||||
FaultDrawer_SetBackColor(0);
|
||||
|
||||
do
|
||||
{
|
||||
do {
|
||||
Fault_PrintThreadContext(faultedThread);
|
||||
Fault_LogThreadContext(faultedThread);
|
||||
Fault_WaitForInput();
|
||||
@@ -799,10 +751,7 @@ void Fault_ThreadEntry(void* arg)
|
||||
Fault_WaitForInput();
|
||||
} while (!sFaultStructPtr->exitDebugger);
|
||||
|
||||
while (!sFaultStructPtr->exitDebugger)
|
||||
{
|
||||
|
||||
}
|
||||
while (!sFaultStructPtr->exitDebugger) {}
|
||||
|
||||
Fault_ResumeThread(faultedThread);
|
||||
}
|
||||
@@ -811,14 +760,12 @@ void Fault_ThreadEntry(void* arg)
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/fault/Fault_ThreadEntry.s")
|
||||
#endif
|
||||
|
||||
void Fault_SetFB(void* fb, u16 w, u16 h)
|
||||
{
|
||||
void Fault_SetFB(void* fb, u16 w, u16 h) {
|
||||
sFaultStructPtr->fb = fb;
|
||||
FaultDrawer_SetDrawerFB(fb, w, h);
|
||||
}
|
||||
|
||||
void Fault_Start(void)
|
||||
{
|
||||
void Fault_Start(void) {
|
||||
sFaultStructPtr = &gFaultStruct;
|
||||
bzero(sFaultStructPtr, sizeof(FaultThreadStruct));
|
||||
FaultDrawer_SetDefault();
|
||||
@@ -832,13 +779,12 @@ void Fault_Start(void)
|
||||
sFaultStructPtr->faultActive = false;
|
||||
gFaultStruct.faultHandlerEnabled = true;
|
||||
osCreateMesgQueue(&sFaultStructPtr->queue, &sFaultStructPtr->msg, 1);
|
||||
StackCheck_Init(sFaultThreadInfo, &sFaultStack, sFaultStack+sizeof(sFaultStack), 0, 0x100, "fault");
|
||||
StackCheck_Init(sFaultThreadInfo, &sFaultStack, sFaultStack + sizeof(sFaultStack), 0, 0x100, "fault");
|
||||
osCreateThread(&sFaultStructPtr->thread, 2, &Fault_ThreadEntry, 0, sFaultThreadInfo, 0x7f);
|
||||
osStartThread(&sFaultStructPtr->thread);
|
||||
}
|
||||
|
||||
void Fault_HangupFaultClient(const char* arg0, const char* arg1)
|
||||
{
|
||||
void Fault_HangupFaultClient(const char* arg0, const char* arg1) {
|
||||
osSyncPrintf("HungUp on Thread %d\n", osGetThreadId(0));
|
||||
osSyncPrintf("%s\n", arg0 ? arg0 : "(NULL)");
|
||||
osSyncPrintf("%s\n", arg1 ? arg1 : "(NULL)");
|
||||
@@ -847,16 +793,14 @@ void Fault_HangupFaultClient(const char* arg0, const char* arg1)
|
||||
FaultDrawer_Printf("%s\n", arg1 ? arg1 : "(NULL)");
|
||||
}
|
||||
|
||||
void Fault_AddHungupAndCrashImpl(const char* arg0, const char* arg1)
|
||||
{
|
||||
void Fault_AddHungupAndCrashImpl(const char* arg0, const char* arg1) {
|
||||
FaultClient client;
|
||||
char padd[4];
|
||||
Fault_AddClient(&client, &Fault_HangupFaultClient, arg0, arg1);
|
||||
*(u32*)0x11111111 = 0; //trigger an exception
|
||||
*(u32*)0x11111111 = 0; // trigger an exception
|
||||
}
|
||||
|
||||
void Fault_AddHungupAndCrash(const char* filename, u32 line)
|
||||
{
|
||||
void Fault_AddHungupAndCrash(const char* filename, u32 line) {
|
||||
char msg[256];
|
||||
sprintf(msg, "HungUp %s:%d", filename, line);
|
||||
Fault_AddHungupAndCrashImpl(msg, NULL);
|
||||
|
||||
+102
-124
@@ -2,77 +2,72 @@
|
||||
#include <global.h>
|
||||
#include <vt.h>
|
||||
|
||||
//rodata
|
||||
// rodata
|
||||
const u32 sFaultDrawerFont[] = {
|
||||
0x00DFFD00, 0x0AEEFFA0, 0x0DF22DD0, 0x06611DC0, 0x01122DD0, 0x06719900, 0x011EED10, 0x077EF700,
|
||||
0x01562990, 0x05589760, 0x0DD22990, 0x05599770, 0x04DFFD40, 0x026EF700, 0x00000000, 0x00000000,
|
||||
0x08BFFB00, 0x0EFFFFC0, 0x0BF00FB0, 0x0FF00330, 0x0FF00FF0, 0x0FF00220, 0x0CFBBF60, 0x0FFCCE20,
|
||||
0x0DD44FF0, 0x0FF00220, 0x0FF00FF0, 0x0FF00330, 0x0CFBBF40, 0x0EF77740, 0x00000000, 0x00000000,
|
||||
0x00DFFD00, 0x0AEEFFA0, 0x0DF22DD0, 0x06611DC0, 0x01122DD0, 0x06719900, 0x011EED10, 0x077EF700,
|
||||
0x01562990, 0x05589760, 0x0DD22990, 0x05599770, 0x04DFFD40, 0x026EF700, 0x00000000, 0x00000000,
|
||||
0x08BFFB00, 0x000DE000, 0x0BF00FB0, 0x005DE600, 0x0FF00FF0, 0x055CC660, 0x0CFBBF60, 0x773FF377,
|
||||
0x0DD44FF0, 0xBB3FF3BB, 0x0FF00FF0, 0x099CCAA0, 0x0CFBBF40, 0x009DEA00, 0x00000000, 0x000DE000,
|
||||
0x04C22C40, 0x028D5020, 0x0CCAACC0, 0x21F91710, 0x04C22C40, 0x12493400, 0x00820800, 0x01975110,
|
||||
0x088A8880, 0x04615241, 0x00800800, 0x43117530, 0x00A20800, 0x60055600, 0x00000000, 0x04400040,
|
||||
0x00221100, 0x00000080, 0x000FB000, 0x00000880, 0x040DA400, 0x00008800, 0x08CDE880, 0x022AA220,
|
||||
0x08CDE880, 0x02AA2220, 0x040DA400, 0x0CD10000, 0x000FB000, 0x8C510000, 0x00221100, 0x81100000,
|
||||
0x00DFFD00, 0x0AEEFFA0, 0x0DF22DD0, 0x06611DC0, 0x01122DD0, 0x06719900, 0x011EED10, 0x077EF700,
|
||||
0x01562990, 0x05589760, 0x0DD22990, 0x05599770, 0x04DFFD40, 0x026EF700, 0x00000000, 0x00000000,
|
||||
0x00333300, 0x04489980, 0x033CC330, 0x00CD1088, 0x033CC330, 0x02BF62A8, 0x00333320, 0x01104C80,
|
||||
0x01100330, 0x0015C800, 0x033CC330, 0x02673220, 0x003FF300, 0x04409900, 0x00880000, 0x00000000,
|
||||
0x05DFFD10, 0x07FFFF60, 0x1CE00EC1, 0x0FF00990, 0x1EE11661, 0x0FF00110, 0x1EF45621, 0x0FF66710,
|
||||
0x1EF23661, 0x0FF08990, 0x1EF10FE1, 0x0FF00990, 0x16ECCE21, 0x07FBBB20, 0x01111110, 0x00000000,
|
||||
0x09B66FD0, 0x27D88E60, 0x0992ED10, 0x2FF02EE0, 0x099AE510, 0x2FF62EE0, 0x099B7510, 0x2FD64EE0,
|
||||
0x0DDAE510, 0x2FD04EE0, 0x0DD2ED10, 0x2FD00EE0, 0x09F66F90, 0x27D99F70, 0x00000000, 0x00000000,
|
||||
0x07FFFF00, 0x8F711FF0, 0x2FD00FF0, 0x8F711FF0, 0x2FD00770, 0x8E611EE0, 0x27DDDF60, 0x8E691EE0,
|
||||
0x27764AA0, 0x8EE99EE0, 0x2FD06E80, 0x8AE7FEA0, 0x07FA8E60, 0x88277A80, 0x00000000, 0x00000000,
|
||||
0x077CCFF0, 0x13266011, 0x077CCFF0, 0x03766510, 0x0239D720, 0x04533540, 0x002FF200, 0x01133110,
|
||||
0x005FB100, 0x00033000, 0x055EE550, 0x01133110, 0x055EEDD0, 0x02233000, 0x00088880, 0x8AABB888,
|
||||
0x00001100, 0x00044510, 0x04623320, 0x00440110, 0x04C89AA0, 0x00EEAB10, 0x0CE66720, 0x0EF55FB0,
|
||||
0x0EE00660, 0x0BF62B90, 0x0EE00660, 0x03FC8990, 0x04EEEEA0, 0x00773BB0, 0x00000000, 0x08888800,
|
||||
0x09900000, 0x00111000, 0x09922440, 0x00011000, 0x09908800, 0x26EFDE20, 0x099BB540, 0x2EC33CE2,
|
||||
0x0D9A2550, 0x2EC33CE2, 0x0DDAA550, 0x2EC33CE2, 0x09D6ED10, 0x26CBBC62, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00011000, 0x05FBFFE0, 0x8E6116E8, 0x0FF40330, 0x8F7117F8,
|
||||
0x07FC8B30, 0x8E6996E8, 0x05733BA0, 0x8A6DD6A8, 0x0DD88A20, 0x08A779B2, 0x01100220, 0x00000000,
|
||||
0x00000080, 0x8A011000, 0x00000800, 0x80A11000, 0x07744F70, 0x80A99000, 0x0231DF20, 0x84E60004,
|
||||
0x0027DA20, 0xC8AA4C40, 0x00573B20, 0x00A11800, 0x05546F50, 0x00A99800, 0x02222080, 0x02001888,
|
||||
0x00DFFD00, 0x0AEEFFA0, 0x0DF22DD0, 0x06611DC0, 0x01122DD0, 0x06719900, 0x011EED10, 0x077EF700, 0x01562990,
|
||||
0x05589760, 0x0DD22990, 0x05599770, 0x04DFFD40, 0x026EF700, 0x00000000, 0x00000000, 0x08BFFB00, 0x0EFFFFC0,
|
||||
0x0BF00FB0, 0x0FF00330, 0x0FF00FF0, 0x0FF00220, 0x0CFBBF60, 0x0FFCCE20, 0x0DD44FF0, 0x0FF00220, 0x0FF00FF0,
|
||||
0x0FF00330, 0x0CFBBF40, 0x0EF77740, 0x00000000, 0x00000000, 0x00DFFD00, 0x0AEEFFA0, 0x0DF22DD0, 0x06611DC0,
|
||||
0x01122DD0, 0x06719900, 0x011EED10, 0x077EF700, 0x01562990, 0x05589760, 0x0DD22990, 0x05599770, 0x04DFFD40,
|
||||
0x026EF700, 0x00000000, 0x00000000, 0x08BFFB00, 0x000DE000, 0x0BF00FB0, 0x005DE600, 0x0FF00FF0, 0x055CC660,
|
||||
0x0CFBBF60, 0x773FF377, 0x0DD44FF0, 0xBB3FF3BB, 0x0FF00FF0, 0x099CCAA0, 0x0CFBBF40, 0x009DEA00, 0x00000000,
|
||||
0x000DE000, 0x04C22C40, 0x028D5020, 0x0CCAACC0, 0x21F91710, 0x04C22C40, 0x12493400, 0x00820800, 0x01975110,
|
||||
0x088A8880, 0x04615241, 0x00800800, 0x43117530, 0x00A20800, 0x60055600, 0x00000000, 0x04400040, 0x00221100,
|
||||
0x00000080, 0x000FB000, 0x00000880, 0x040DA400, 0x00008800, 0x08CDE880, 0x022AA220, 0x08CDE880, 0x02AA2220,
|
||||
0x040DA400, 0x0CD10000, 0x000FB000, 0x8C510000, 0x00221100, 0x81100000, 0x00DFFD00, 0x0AEEFFA0, 0x0DF22DD0,
|
||||
0x06611DC0, 0x01122DD0, 0x06719900, 0x011EED10, 0x077EF700, 0x01562990, 0x05589760, 0x0DD22990, 0x05599770,
|
||||
0x04DFFD40, 0x026EF700, 0x00000000, 0x00000000, 0x00333300, 0x04489980, 0x033CC330, 0x00CD1088, 0x033CC330,
|
||||
0x02BF62A8, 0x00333320, 0x01104C80, 0x01100330, 0x0015C800, 0x033CC330, 0x02673220, 0x003FF300, 0x04409900,
|
||||
0x00880000, 0x00000000, 0x05DFFD10, 0x07FFFF60, 0x1CE00EC1, 0x0FF00990, 0x1EE11661, 0x0FF00110, 0x1EF45621,
|
||||
0x0FF66710, 0x1EF23661, 0x0FF08990, 0x1EF10FE1, 0x0FF00990, 0x16ECCE21, 0x07FBBB20, 0x01111110, 0x00000000,
|
||||
0x09B66FD0, 0x27D88E60, 0x0992ED10, 0x2FF02EE0, 0x099AE510, 0x2FF62EE0, 0x099B7510, 0x2FD64EE0, 0x0DDAE510,
|
||||
0x2FD04EE0, 0x0DD2ED10, 0x2FD00EE0, 0x09F66F90, 0x27D99F70, 0x00000000, 0x00000000, 0x07FFFF00, 0x8F711FF0,
|
||||
0x2FD00FF0, 0x8F711FF0, 0x2FD00770, 0x8E611EE0, 0x27DDDF60, 0x8E691EE0, 0x27764AA0, 0x8EE99EE0, 0x2FD06E80,
|
||||
0x8AE7FEA0, 0x07FA8E60, 0x88277A80, 0x00000000, 0x00000000, 0x077CCFF0, 0x13266011, 0x077CCFF0, 0x03766510,
|
||||
0x0239D720, 0x04533540, 0x002FF200, 0x01133110, 0x005FB100, 0x00033000, 0x055EE550, 0x01133110, 0x055EEDD0,
|
||||
0x02233000, 0x00088880, 0x8AABB888, 0x00001100, 0x00044510, 0x04623320, 0x00440110, 0x04C89AA0, 0x00EEAB10,
|
||||
0x0CE66720, 0x0EF55FB0, 0x0EE00660, 0x0BF62B90, 0x0EE00660, 0x03FC8990, 0x04EEEEA0, 0x00773BB0, 0x00000000,
|
||||
0x08888800, 0x09900000, 0x00111000, 0x09922440, 0x00011000, 0x09908800, 0x26EFDE20, 0x099BB540, 0x2EC33CE2,
|
||||
0x0D9A2550, 0x2EC33CE2, 0x0DDAA550, 0x2EC33CE2, 0x09D6ED10, 0x26CBBC62, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00011000, 0x05FBFFE0, 0x8E6116E8, 0x0FF40330, 0x8F7117F8, 0x07FC8B30, 0x8E6996E8,
|
||||
0x05733BA0, 0x8A6DD6A8, 0x0DD88A20, 0x08A779B2, 0x01100220, 0x00000000, 0x00000080, 0x8A011000, 0x00000800,
|
||||
0x80A11000, 0x07744F70, 0x80A99000, 0x0231DF20, 0x84E60004, 0x0027DA20, 0xC8AA4C40, 0x00573B20, 0x00A11800,
|
||||
0x05546F50, 0x00A99800, 0x02222080, 0x02001888,
|
||||
};
|
||||
|
||||
//data
|
||||
FaultDrawer sFaultDrawerDefault =
|
||||
{
|
||||
(u16*)0x803DA800, //fb
|
||||
320, 240, //w, h
|
||||
16, 223, //yStart, yEnd
|
||||
22, 297,//xStart, xEnd
|
||||
0xFFFF, 0x0000, //foreColor, backColor
|
||||
22, 16, //cursorX, cursorY
|
||||
sFaultDrawerFont, //font
|
||||
// data
|
||||
// clang-format off
|
||||
FaultDrawer sFaultDrawerDefault = {
|
||||
(u16*)0x803DA800, // fb
|
||||
320, 240, // w, h
|
||||
16, 223, // yStart, yEnd
|
||||
22, 297, // xStart, xEnd
|
||||
0xFFFF, 0x0000, // foreColor, backColor
|
||||
22, 16, // cursorX, cursorY
|
||||
sFaultDrawerFont, // font
|
||||
8, 8, 0, 0,
|
||||
{ //printColors
|
||||
{ // printColors
|
||||
0x0001, 0xF801, 0x07C1, 0xFFC1,
|
||||
0x003F, 0xF83F, 0x07FF, 0xFFFF,
|
||||
0x7BDF, 0xB5AD
|
||||
},
|
||||
0, //escCode
|
||||
0, //osSyncPrintfEnabled
|
||||
NULL, //inputCallback
|
||||
0, // escCode
|
||||
0, // osSyncPrintfEnabled
|
||||
NULL, // inputCallback
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
//bss
|
||||
// bss
|
||||
FaultDrawer sFaultDrawerStruct;
|
||||
char D_8016B6C0[0x20]; //? unused
|
||||
|
||||
void FaultDrawer_SetOsSyncPrintfEnabled(u32 enabled)
|
||||
{
|
||||
void FaultDrawer_SetOsSyncPrintfEnabled(u32 enabled) {
|
||||
sFaultDrawerStruct.osSyncPrintfEnabled = enabled;
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
void FaultDrawer_DrawRecImpl(s32 xstart, s32 ystart, s32 xend, s32 yend, u16 color)
|
||||
{
|
||||
if (sFaultDrawerStruct.w - xstart > 0 && sFaultDrawerStruct.h - ystart > 0)
|
||||
{
|
||||
void FaultDrawer_DrawRecImpl(s32 xstart, s32 ystart, s32 xend, s32 yend, u16 color) {
|
||||
if (sFaultDrawerStruct.w - xstart > 0 && sFaultDrawerStruct.h - ystart > 0) {
|
||||
s32 x, y;
|
||||
|
||||
for (y = 0; y <= yend - ystart; y++)
|
||||
@@ -88,8 +83,7 @@ void FaultDrawer_DrawRecImpl(s32 xstart, s32 ystart, s32 xend, s32 yend, u16 col
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// regalloc and minor ordering differences
|
||||
void FaultDrawer_DrawChar(char c)
|
||||
{
|
||||
void FaultDrawer_DrawChar(char c) {
|
||||
s32 x, y;
|
||||
u32* dataPtr;
|
||||
u16* fb;
|
||||
@@ -102,14 +96,11 @@ void FaultDrawer_DrawChar(char c)
|
||||
if ((sFaultDrawerStruct.xStart <= sFaultDrawerStruct.cursorX) &&
|
||||
((sFaultDrawerStruct.charW + sFaultDrawerStruct.cursorX - 1) <= sFaultDrawerStruct.xEnd) &&
|
||||
(sFaultDrawerStruct.yStart <= sFaultDrawerStruct.cursorY) &&
|
||||
((sFaultDrawerStruct.charH + sFaultDrawerStruct.cursorY - 1) <= sFaultDrawerStruct.yEnd))
|
||||
{
|
||||
for (y = 0; y < sFaultDrawerStruct.charH; y++)
|
||||
{
|
||||
((sFaultDrawerStruct.charH + sFaultDrawerStruct.cursorY - 1) <= sFaultDrawerStruct.yEnd)) {
|
||||
for (y = 0; y < sFaultDrawerStruct.charH; y++) {
|
||||
u32 mask = 0x10000000 << (c % 4);
|
||||
u32 data = *dataPtr;
|
||||
for (x = 0; x < sFaultDrawerStruct.charW; x++)
|
||||
{
|
||||
for (x = 0; x < sFaultDrawerStruct.charW; x++) {
|
||||
if (mask & data)
|
||||
fb[x] = sFaultDrawerStruct.foreColor;
|
||||
else if (sFaultDrawerStruct.backColor & 1)
|
||||
@@ -125,93 +116,89 @@ void FaultDrawer_DrawChar(char c)
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/fault_drawer/FaultDrawer_DrawChar.s")
|
||||
#endif
|
||||
|
||||
s32 FaultDrawer_ColorToPrintColor(u16 color)
|
||||
{
|
||||
s32 FaultDrawer_ColorToPrintColor(u16 color) {
|
||||
s32 i;
|
||||
for (i = 0; i < 10; i++)
|
||||
if (color == sFaultDrawerStruct.printColors[i])
|
||||
for (i = 0; i < 10; i++) {
|
||||
if (color == sFaultDrawerStruct.printColors[i]) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
void FaultDrawer_UpdatePrintColor()
|
||||
{
|
||||
void FaultDrawer_UpdatePrintColor() {
|
||||
s32 idx;
|
||||
if (sFaultDrawerStruct.osSyncPrintfEnabled)
|
||||
{
|
||||
if (sFaultDrawerStruct.osSyncPrintfEnabled) {
|
||||
osSyncPrintf(VT_RST);
|
||||
idx = FaultDrawer_ColorToPrintColor(sFaultDrawerStruct.foreColor);
|
||||
if (idx >= 0 && idx < 8)
|
||||
if (idx >= 0 && idx < 8) {
|
||||
osSyncPrintf(VT_SGR("3%d"), idx);
|
||||
}
|
||||
idx = FaultDrawer_ColorToPrintColor(sFaultDrawerStruct.backColor);
|
||||
if (idx >= 0 && idx < 8)
|
||||
if (idx >= 0 && idx < 8) {
|
||||
osSyncPrintf(VT_SGR("4%d"), idx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void FaultDrawer_SetForeColor(u16 color)
|
||||
{
|
||||
void FaultDrawer_SetForeColor(u16 color) {
|
||||
sFaultDrawerStruct.foreColor = color;
|
||||
FaultDrawer_UpdatePrintColor();
|
||||
}
|
||||
|
||||
void FaultDrawer_SetBackColor(u16 color)
|
||||
{
|
||||
void FaultDrawer_SetBackColor(u16 color) {
|
||||
sFaultDrawerStruct.backColor = color;
|
||||
FaultDrawer_UpdatePrintColor();
|
||||
}
|
||||
|
||||
void FaultDrawer_SetFontColor(u16 color)
|
||||
{
|
||||
FaultDrawer_SetForeColor((u16)(color | 1)); //force alpha to be set
|
||||
void FaultDrawer_SetFontColor(u16 color) {
|
||||
FaultDrawer_SetForeColor((u16)(color | 1)); // force alpha to be set
|
||||
}
|
||||
|
||||
void FaultDrawer_SetCharPad(s8 padW, s8 padH)
|
||||
{
|
||||
void FaultDrawer_SetCharPad(s8 padW, s8 padH) {
|
||||
sFaultDrawerStruct.charWPad = padW;
|
||||
sFaultDrawerStruct.charHPad = padH;
|
||||
}
|
||||
|
||||
void FaultDrawer_SetCursor(s32 x, s32 y)
|
||||
{
|
||||
if (sFaultDrawerStruct.osSyncPrintfEnabled)
|
||||
osSyncPrintf(VT_CUP(%d, %d), (y - sFaultDrawerStruct.yStart) / (sFaultDrawerStruct.charH + sFaultDrawerStruct.charHPad), (x - sFaultDrawerStruct.xStart) / (sFaultDrawerStruct.charW + sFaultDrawerStruct.charWPad));
|
||||
void FaultDrawer_SetCursor(s32 x, s32 y) {
|
||||
if (sFaultDrawerStruct.osSyncPrintfEnabled) {
|
||||
osSyncPrintf(VT_CUP("%d", "%d"),
|
||||
(y - sFaultDrawerStruct.yStart) / (sFaultDrawerStruct.charH + sFaultDrawerStruct.charHPad),
|
||||
(x - sFaultDrawerStruct.xStart) / (sFaultDrawerStruct.charW + sFaultDrawerStruct.charWPad));
|
||||
}
|
||||
sFaultDrawerStruct.cursorX = x;
|
||||
sFaultDrawerStruct.cursorY = y;
|
||||
}
|
||||
|
||||
void FaultDrawer_FillScreen()
|
||||
{
|
||||
if (sFaultDrawerStruct.osSyncPrintfEnabled)
|
||||
void FaultDrawer_FillScreen() {
|
||||
if (sFaultDrawerStruct.osSyncPrintfEnabled) {
|
||||
osSyncPrintf(VT_CLS);
|
||||
}
|
||||
|
||||
FaultDrawer_DrawRecImpl(sFaultDrawerStruct.xStart, sFaultDrawerStruct.yStart, sFaultDrawerStruct.xEnd, sFaultDrawerStruct.yEnd, sFaultDrawerStruct.backColor | 1);
|
||||
FaultDrawer_DrawRecImpl(sFaultDrawerStruct.xStart, sFaultDrawerStruct.yStart, sFaultDrawerStruct.xEnd,
|
||||
sFaultDrawerStruct.yEnd, sFaultDrawerStruct.backColor | 1);
|
||||
FaultDrawer_SetCursor(sFaultDrawerStruct.xStart, sFaultDrawerStruct.yStart);
|
||||
}
|
||||
|
||||
u32 FaultDrawer_FormatStringFunc(u32 arg0, const char* str, s32 count)
|
||||
{
|
||||
for (count; count != 0; count--, str++)
|
||||
{
|
||||
u32 FaultDrawer_FormatStringFunc(u32 arg0, const char* str, s32 count) {
|
||||
for (count; count != 0; count--, str++) {
|
||||
s32 curXStart;
|
||||
s32 curXEnd;
|
||||
|
||||
if (sFaultDrawerStruct.escCode)
|
||||
{
|
||||
if (sFaultDrawerStruct.escCode) {
|
||||
sFaultDrawerStruct.escCode = false;
|
||||
if (*str > 0x30 && *str < 0x3A)
|
||||
if (*str > 0x30 && *str < 0x3A) {
|
||||
FaultDrawer_SetForeColor(sFaultDrawerStruct.printColors[*str - 0x30]);
|
||||
}
|
||||
|
||||
curXStart = sFaultDrawerStruct.cursorX;
|
||||
curXEnd = sFaultDrawerStruct.xEnd - sFaultDrawerStruct.charW;
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (*str)
|
||||
{
|
||||
} else {
|
||||
switch (*str) {
|
||||
case '\n':
|
||||
if (sFaultDrawerStruct.osSyncPrintfEnabled)
|
||||
if (sFaultDrawerStruct.osSyncPrintfEnabled) {
|
||||
osSyncPrintf("\n");
|
||||
}
|
||||
|
||||
sFaultDrawerStruct.cursorX = sFaultDrawerStruct.w;
|
||||
curXStart = sFaultDrawerStruct.cursorX;
|
||||
@@ -223,8 +210,9 @@ u32 FaultDrawer_FormatStringFunc(u32 arg0, const char* str, s32 count)
|
||||
curXEnd = sFaultDrawerStruct.xEnd - sFaultDrawerStruct.charW;
|
||||
break;
|
||||
default:
|
||||
if (sFaultDrawerStruct.osSyncPrintfEnabled)
|
||||
if (sFaultDrawerStruct.osSyncPrintfEnabled) {
|
||||
osSyncPrintf("%c", *str);
|
||||
}
|
||||
|
||||
FaultDrawer_DrawChar(*str);
|
||||
sFaultDrawerStruct.cursorX += sFaultDrawerStruct.charW + sFaultDrawerStruct.charWPad;
|
||||
@@ -234,14 +222,11 @@ u32 FaultDrawer_FormatStringFunc(u32 arg0, const char* str, s32 count)
|
||||
}
|
||||
}
|
||||
|
||||
if (curXEnd <= curXStart)
|
||||
{
|
||||
if (curXEnd <= curXStart) {
|
||||
sFaultDrawerStruct.cursorX = sFaultDrawerStruct.xStart;
|
||||
sFaultDrawerStruct.cursorY += sFaultDrawerStruct.charH + sFaultDrawerStruct.charHPad;
|
||||
if (sFaultDrawerStruct.yEnd - sFaultDrawerStruct.charH <= sFaultDrawerStruct.cursorY)
|
||||
{
|
||||
if (sFaultDrawerStruct.inputCallback)
|
||||
{
|
||||
if (sFaultDrawerStruct.yEnd - sFaultDrawerStruct.charH <= sFaultDrawerStruct.cursorY) {
|
||||
if (sFaultDrawerStruct.inputCallback) {
|
||||
sFaultDrawerStruct.inputCallback();
|
||||
FaultDrawer_FillScreen();
|
||||
}
|
||||
@@ -255,21 +240,18 @@ u32 FaultDrawer_FormatStringFunc(u32 arg0, const char* str, s32 count)
|
||||
return arg0;
|
||||
}
|
||||
|
||||
void FaultDrawer_VPrintf(const char* str, char* args) //va_list
|
||||
{
|
||||
void FaultDrawer_VPrintf(const char* str, char* args) { // va_list
|
||||
_Printf(&FaultDrawer_FormatStringFunc, &sFaultDrawerStruct, str, args);
|
||||
}
|
||||
|
||||
void FaultDrawer_Printf(const char* fmt, ...)
|
||||
{
|
||||
void FaultDrawer_Printf(const char* fmt, ...) {
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
|
||||
FaultDrawer_VPrintf(fmt, args);
|
||||
}
|
||||
|
||||
void FaultDrawer_DrawText(s32 x, s32 y, const char* fmt, ...)
|
||||
{
|
||||
void FaultDrawer_DrawText(s32 x, s32 y, const char* fmt, ...) {
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
|
||||
@@ -277,25 +259,21 @@ void FaultDrawer_DrawText(s32 x, s32 y, const char* fmt, ...)
|
||||
FaultDrawer_VPrintf(fmt, args);
|
||||
}
|
||||
|
||||
void FaultDrawer_SetDrawerFB(void* fb, u16 w, u16 h)
|
||||
{
|
||||
void FaultDrawer_SetDrawerFB(void* fb, u16 w, u16 h) {
|
||||
sFaultDrawerStruct.fb = (u16*)fb;
|
||||
sFaultDrawerStruct.w = w;
|
||||
sFaultDrawerStruct.h = h;
|
||||
}
|
||||
|
||||
void FaultDrawer_SetInputCallback(void(*callback)())
|
||||
{
|
||||
void FaultDrawer_SetInputCallback(void (*callback)()) {
|
||||
sFaultDrawerStruct.inputCallback = callback;
|
||||
}
|
||||
|
||||
void FaultDrawer_WritebackFBDCache()
|
||||
{
|
||||
osWritebackDCache(sFaultDrawerStruct.fb, sFaultDrawerStruct.w*sFaultDrawerStruct.h*2);
|
||||
void FaultDrawer_WritebackFBDCache() {
|
||||
osWritebackDCache(sFaultDrawerStruct.fb, sFaultDrawerStruct.w * sFaultDrawerStruct.h * 2);
|
||||
}
|
||||
|
||||
void FaultDrawer_SetDefault()
|
||||
{
|
||||
void FaultDrawer_SetDefault() {
|
||||
bcopy(&sFaultDrawerDefault, &sFaultDrawerStruct, sizeof(FaultDrawer));
|
||||
sFaultDrawerStruct.fb = (u16*)((osMemSize | 0x80000000) - 0x25800);
|
||||
}
|
||||
|
||||
+17
-29
@@ -1,26 +1,22 @@
|
||||
#include <global.h>
|
||||
|
||||
void GameAlloc_Log(GameAlloc* this)
|
||||
{
|
||||
void GameAlloc_Log(GameAlloc* this) {
|
||||
GameAllocEntry* iter;
|
||||
|
||||
osSyncPrintf("this = %08x\n", this);
|
||||
|
||||
iter = this->base.next;
|
||||
while (iter != &this->base)
|
||||
{
|
||||
while (iter != &this->base) {
|
||||
osSyncPrintf("ptr = %08x size = %d\n", iter, iter->size);
|
||||
iter = iter->next;
|
||||
}
|
||||
}
|
||||
|
||||
void* GameAlloc_MallocDebug(GameAlloc* this, u32 size, const char* file, s32 line)
|
||||
{
|
||||
void* GameAlloc_MallocDebug(GameAlloc* this, u32 size, const char* file, s32 line) {
|
||||
GameAllocEntry* ptr;
|
||||
|
||||
ptr = SystemArena_MallocDebug(size+sizeof(GameAllocEntry), file, line);
|
||||
if (ptr)
|
||||
{
|
||||
ptr = SystemArena_MallocDebug(size + sizeof(GameAllocEntry), file, line);
|
||||
if (ptr) {
|
||||
ptr->size = size;
|
||||
ptr->prev = this->head;
|
||||
this->head->next = ptr;
|
||||
@@ -28,18 +24,16 @@ void* GameAlloc_MallocDebug(GameAlloc* this, u32 size, const char* file, s32 lin
|
||||
ptr->next = &this->base;
|
||||
this->base.prev = this->head;
|
||||
return ptr + 1;
|
||||
}
|
||||
else
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void* GameAlloc_Malloc(GameAlloc* this, u32 size)
|
||||
{
|
||||
void* GameAlloc_Malloc(GameAlloc* this, u32 size) {
|
||||
GameAllocEntry* ptr;
|
||||
|
||||
ptr = SystemArena_MallocDebug(size+sizeof(GameAllocEntry), "../gamealloc.c", 93);
|
||||
if (ptr)
|
||||
{
|
||||
ptr = SystemArena_MallocDebug(size + sizeof(GameAllocEntry), "../gamealloc.c", 93);
|
||||
if (ptr) {
|
||||
ptr->size = size;
|
||||
ptr->prev = this->head;
|
||||
this->head->next = ptr;
|
||||
@@ -47,17 +41,15 @@ void* GameAlloc_Malloc(GameAlloc* this, u32 size)
|
||||
ptr->next = &this->base;
|
||||
this->base.prev = this->head;
|
||||
return ptr + 1;
|
||||
}
|
||||
else
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void GameAlloc_Free(GameAlloc* this, void* data)
|
||||
{
|
||||
void GameAlloc_Free(GameAlloc* this, void* data) {
|
||||
GameAllocEntry* ptr;
|
||||
|
||||
if (data)
|
||||
{
|
||||
if (data) {
|
||||
ptr = &((GameAllocEntry*)data)[-1];
|
||||
LogUtils_CheckNullPointer("ptr->prev", ptr->prev, "../gamealloc.c", 120);
|
||||
LogUtils_CheckNullPointer("ptr->next", ptr->next, "../gamealloc.c", 121);
|
||||
@@ -68,14 +60,12 @@ void GameAlloc_Free(GameAlloc* this, void* data)
|
||||
}
|
||||
}
|
||||
|
||||
void GameAlloc_Cleanup(GameAlloc* this)
|
||||
{
|
||||
void GameAlloc_Cleanup(GameAlloc* this) {
|
||||
GameAllocEntry* next;
|
||||
GameAllocEntry* cur;
|
||||
|
||||
next = this->base.next;
|
||||
while (&this->base != next)
|
||||
{
|
||||
while (&this->base != next) {
|
||||
cur = next;
|
||||
next = next->next;
|
||||
SystemArena_FreeDebug(cur, "../gamealloc.c", 145);
|
||||
@@ -84,11 +74,9 @@ void GameAlloc_Cleanup(GameAlloc* this)
|
||||
this->head = &this->base;
|
||||
this->base.next = &this->base;
|
||||
this->base.prev = &this->base;
|
||||
|
||||
}
|
||||
|
||||
void GameAlloc_Init(GameAlloc* this)
|
||||
{
|
||||
void GameAlloc_Init(GameAlloc* this) {
|
||||
this->head = &this->base;
|
||||
this->base.next = &this->base;
|
||||
this->base.prev = &this->base;
|
||||
|
||||
+197
-238
@@ -1,188 +1,196 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
//.bss
|
||||
// .bss
|
||||
u8 D_801755F0;
|
||||
|
||||
//.data
|
||||
u16 sGfxPrintFontTLUT[64] =
|
||||
{
|
||||
0x0000, 0xFFFF, 0x0000, 0xFFFF,
|
||||
0x0000, 0xFFFF, 0x0000, 0xFFFF,
|
||||
0x0000, 0xFFFF, 0x0000, 0xFFFF,
|
||||
0x0000, 0xFFFF, 0x0000, 0xFFFF,
|
||||
0x0000, 0x0000, 0xFFFF, 0xFFFF,
|
||||
0x0000, 0x0000, 0xFFFF, 0xFFFF,
|
||||
0x0000, 0x0000, 0xFFFF, 0xFFFF,
|
||||
0x0000, 0x0000, 0xFFFF, 0xFFFF,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
|
||||
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
|
||||
// .data
|
||||
u16 sGfxPrintFontTLUT[64] = {
|
||||
0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000,
|
||||
0xFFFF, 0x0000, 0xFFFF, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0x0000, 0x0000,
|
||||
0xFFFF, 0xFFFF, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0x0000, 0x0000, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0xFFFF,
|
||||
0xFFFF, 0x0000, 0x0000, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
|
||||
};
|
||||
|
||||
u16 sGfxPrintUnkTLUT[16] =
|
||||
{
|
||||
0xF801, 0xFBC1, 0xFFC1, 0x07C1,
|
||||
0x0421, 0x003F, 0x803F, 0xF83F,
|
||||
0xF801, 0xFBC1, 0xFFC1, 0x07C1,
|
||||
0x0421, 0x003F, 0x803F, 0xF83F,
|
||||
u16 sGfxPrintUnkTLUT[16] = {
|
||||
0xF801, 0xFBC1, 0xFFC1, 0x07C1, 0x0421, 0x003F, 0x803F, 0xF83F,
|
||||
0xF801, 0xFBC1, 0xFFC1, 0x07C1, 0x0421, 0x003F, 0x803F, 0xF83F,
|
||||
};
|
||||
|
||||
u8 sGfxPrintUnkData[8] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77 };
|
||||
|
||||
u8 sGfxPrintFontData[(16*256)/2] =
|
||||
{
|
||||
0x00, 0xDF, 0xFD, 0x00, 0x0A, 0xEE, 0xFF, 0xA0, 0x0D, 0xF2, 0x2D, 0xD0, 0x06, 0x61, 0x1D, 0xC0, 0x01, 0x12, 0x2D, 0xD0, 0x06, 0x71, 0x99, 0x00, 0x01, 0x1E, 0xED, 0x10, 0x07, 0x7E, 0xF7, 0x00,
|
||||
0x01, 0x56, 0x29, 0x90, 0x05, 0x58, 0x97, 0x60, 0x0D, 0xD2, 0x29, 0x90, 0x05, 0x59, 0x97, 0x70, 0x04, 0xDF, 0xFD, 0x40, 0x02, 0x6E, 0xF7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x08, 0xBF, 0xFB, 0x00, 0x0E, 0xFF, 0xFF, 0xC0, 0x0B, 0xF0, 0x0F, 0xB0, 0x0F, 0xF0, 0x03, 0x30, 0x0F, 0xF0, 0x0F, 0xF0, 0x0F, 0xF0, 0x02, 0x20, 0x0C, 0xFB, 0xBF, 0x60, 0x0F, 0xFC, 0xCE, 0x20,
|
||||
0x0D, 0xD4, 0x4F, 0xF0, 0x0F, 0xF0, 0x02, 0x20, 0x0F, 0xF0, 0x0F, 0xF0, 0x0F, 0xF0, 0x03, 0x30, 0x0C, 0xFB, 0xBF, 0x40, 0x0E, 0xF7, 0x77, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0xDF, 0xFD, 0x00, 0x0A, 0xEE, 0xFF, 0xA0, 0x0D, 0xF2, 0x2D, 0xD0, 0x06, 0x61, 0x1D, 0xC0, 0x01, 0x12, 0x2D, 0xD0, 0x06, 0x71, 0x99, 0x00, 0x01, 0x1E, 0xED, 0x10, 0x07, 0x7E, 0xF7, 0x00,
|
||||
0x01, 0x56, 0x29, 0x90, 0x05, 0x58, 0x97, 0x60, 0x0D, 0xD2, 0x29, 0x90, 0x05, 0x59, 0x97, 0x70, 0x04, 0xDF, 0xFD, 0x40, 0x02, 0x6E, 0xF7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x08, 0xBF, 0xFB, 0x00, 0x00, 0x0D, 0xE0, 0x00, 0x0B, 0xF0, 0x0F, 0xB0, 0x00, 0x5D, 0xE6, 0x00, 0x0F, 0xF0, 0x0F, 0xF0, 0x05, 0x5C, 0xC6, 0x60, 0x0C, 0xFB, 0xBF, 0x60, 0x77, 0x3F, 0xF3, 0x77,
|
||||
0x0D, 0xD4, 0x4F, 0xF0, 0xBB, 0x3F, 0xF3, 0xBB, 0x0F, 0xF0, 0x0F, 0xF0, 0x09, 0x9C, 0xCA, 0xA0, 0x0C, 0xFB, 0xBF, 0x40, 0x00, 0x9D, 0xEA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, 0xE0, 0x00,
|
||||
0x04, 0xC2, 0x2C, 0x40, 0x02, 0x8D, 0x50, 0x20, 0x0C, 0xCA, 0xAC, 0xC0, 0x21, 0xF9, 0x17, 0x10, 0x04, 0xC2, 0x2C, 0x40, 0x12, 0x49, 0x34, 0x00, 0x00, 0x82, 0x08, 0x00, 0x01, 0x97, 0x51, 0x10,
|
||||
0x08, 0x8A, 0x88, 0x80, 0x04, 0x61, 0x52, 0x41, 0x00, 0x80, 0x08, 0x00, 0x43, 0x11, 0x75, 0x30, 0x00, 0xA2, 0x08, 0x00, 0x60, 0x05, 0x56, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x40, 0x00, 0x40,
|
||||
0x00, 0x22, 0x11, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x0F, 0xB0, 0x00, 0x00, 0x00, 0x08, 0x80, 0x04, 0x0D, 0xA4, 0x00, 0x00, 0x00, 0x88, 0x00, 0x08, 0xCD, 0xE8, 0x80, 0x02, 0x2A, 0xA2, 0x20,
|
||||
0x08, 0xCD, 0xE8, 0x80, 0x02, 0xAA, 0x22, 0x20, 0x04, 0x0D, 0xA4, 0x00, 0x0C, 0xD1, 0x00, 0x00, 0x00, 0x0F, 0xB0, 0x00, 0x8C, 0x51, 0x00, 0x00, 0x00, 0x22, 0x11, 0x00, 0x81, 0x10, 0x00, 0x00,
|
||||
0x00, 0xDF, 0xFD, 0x00, 0x0A, 0xEE, 0xFF, 0xA0, 0x0D, 0xF2, 0x2D, 0xD0, 0x06, 0x61, 0x1D, 0xC0, 0x01, 0x12, 0x2D, 0xD0, 0x06, 0x71, 0x99, 0x00, 0x01, 0x1E, 0xED, 0x10, 0x07, 0x7E, 0xF7, 0x00,
|
||||
0x01, 0x56, 0x29, 0x90, 0x05, 0x58, 0x97, 0x60, 0x0D, 0xD2, 0x29, 0x90, 0x05, 0x59, 0x97, 0x70, 0x04, 0xDF, 0xFD, 0x40, 0x02, 0x6E, 0xF7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x33, 0x33, 0x00, 0x04, 0x48, 0x99, 0x80, 0x03, 0x3C, 0xC3, 0x30, 0x00, 0xCD, 0x10, 0x88, 0x03, 0x3C, 0xC3, 0x30, 0x02, 0xBF, 0x62, 0xA8, 0x00, 0x33, 0x33, 0x20, 0x01, 0x10, 0x4C, 0x80,
|
||||
0x01, 0x10, 0x03, 0x30, 0x00, 0x15, 0xC8, 0x00, 0x03, 0x3C, 0xC3, 0x30, 0x02, 0x67, 0x32, 0x20, 0x00, 0x3F, 0xF3, 0x00, 0x04, 0x40, 0x99, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x05, 0xDF, 0xFD, 0x10, 0x07, 0xFF, 0xFF, 0x60, 0x1C, 0xE0, 0x0E, 0xC1, 0x0F, 0xF0, 0x09, 0x90, 0x1E, 0xE1, 0x16, 0x61, 0x0F, 0xF0, 0x01, 0x10, 0x1E, 0xF4, 0x56, 0x21, 0x0F, 0xF6, 0x67, 0x10,
|
||||
0x1E, 0xF2, 0x36, 0x61, 0x0F, 0xF0, 0x89, 0x90, 0x1E, 0xF1, 0x0F, 0xE1, 0x0F, 0xF0, 0x09, 0x90, 0x16, 0xEC, 0xCE, 0x21, 0x07, 0xFB, 0xBB, 0x20, 0x01, 0x11, 0x11, 0x10, 0x00, 0x00, 0x00, 0x00,
|
||||
0x09, 0xB6, 0x6F, 0xD0, 0x27, 0xD8, 0x8E, 0x60, 0x09, 0x92, 0xED, 0x10, 0x2F, 0xF0, 0x2E, 0xE0, 0x09, 0x9A, 0xE5, 0x10, 0x2F, 0xF6, 0x2E, 0xE0, 0x09, 0x9B, 0x75, 0x10, 0x2F, 0xD6, 0x4E, 0xE0,
|
||||
0x0D, 0xDA, 0xE5, 0x10, 0x2F, 0xD0, 0x4E, 0xE0, 0x0D, 0xD2, 0xED, 0x10, 0x2F, 0xD0, 0x0E, 0xE0, 0x09, 0xF6, 0x6F, 0x90, 0x27, 0xD9, 0x9F, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x07, 0xFF, 0xFF, 0x00, 0x8F, 0x71, 0x1F, 0xF0, 0x2F, 0xD0, 0x0F, 0xF0, 0x8F, 0x71, 0x1F, 0xF0, 0x2F, 0xD0, 0x07, 0x70, 0x8E, 0x61, 0x1E, 0xE0, 0x27, 0xDD, 0xDF, 0x60, 0x8E, 0x69, 0x1E, 0xE0,
|
||||
0x27, 0x76, 0x4A, 0xA0, 0x8E, 0xE9, 0x9E, 0xE0, 0x2F, 0xD0, 0x6E, 0x80, 0x8A, 0xE7, 0xFE, 0xA0, 0x07, 0xFA, 0x8E, 0x60, 0x88, 0x27, 0x7A, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x07, 0x7C, 0xCF, 0xF0, 0x13, 0x26, 0x60, 0x11, 0x07, 0x7C, 0xCF, 0xF0, 0x03, 0x76, 0x65, 0x10, 0x02, 0x39, 0xD7, 0x20, 0x04, 0x53, 0x35, 0x40, 0x00, 0x2F, 0xF2, 0x00, 0x01, 0x13, 0x31, 0x10,
|
||||
0x00, 0x5F, 0xB1, 0x00, 0x00, 0x03, 0x30, 0x00, 0x05, 0x5E, 0xE5, 0x50, 0x01, 0x13, 0x31, 0x10, 0x05, 0x5E, 0xED, 0xD0, 0x02, 0x23, 0x30, 0x00, 0x00, 0x08, 0x88, 0x80, 0x8A, 0xAB, 0xB8, 0x88,
|
||||
0x00, 0x00, 0x11, 0x00, 0x00, 0x04, 0x45, 0x10, 0x04, 0x62, 0x33, 0x20, 0x00, 0x44, 0x01, 0x10, 0x04, 0xC8, 0x9A, 0xA0, 0x00, 0xEE, 0xAB, 0x10, 0x0C, 0xE6, 0x67, 0x20, 0x0E, 0xF5, 0x5F, 0xB0,
|
||||
0x0E, 0xE0, 0x06, 0x60, 0x0B, 0xF6, 0x2B, 0x90, 0x0E, 0xE0, 0x06, 0x60, 0x03, 0xFC, 0x89, 0x90, 0x04, 0xEE, 0xEE, 0xA0, 0x00, 0x77, 0x3B, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x08, 0x88, 0x88, 0x00,
|
||||
0x09, 0x90, 0x00, 0x00, 0x00, 0x11, 0x10, 0x00, 0x09, 0x92, 0x24, 0x40, 0x00, 0x01, 0x10, 0x00, 0x09, 0x90, 0x88, 0x00, 0x26, 0xEF, 0xDE, 0x20, 0x09, 0x9B, 0xB5, 0x40, 0x2E, 0xC3, 0x3C, 0xE2,
|
||||
0x0D, 0x9A, 0x25, 0x50, 0x2E, 0xC3, 0x3C, 0xE2, 0x0D, 0xDA, 0xA5, 0x50, 0x2E, 0xC3, 0x3C, 0xE2, 0x09, 0xD6, 0xED, 0x10, 0x26, 0xCB, 0xBC, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x10, 0x00, 0x05, 0xFB, 0xFF, 0xE0, 0x8E, 0x61, 0x16, 0xE8, 0x0F, 0xF4, 0x03, 0x30, 0x8F, 0x71, 0x17, 0xF8,
|
||||
0x07, 0xFC, 0x8B, 0x30, 0x8E, 0x69, 0x96, 0xE8, 0x05, 0x73, 0x3B, 0xA0, 0x8A, 0x6D, 0xD6, 0xA8, 0x0D, 0xD8, 0x8A, 0x20, 0x08, 0xA7, 0x79, 0xB2, 0x01, 0x10, 0x02, 0x20, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x80, 0x8A, 0x01, 0x10, 0x00, 0x00, 0x00, 0x08, 0x00, 0x80, 0xA1, 0x10, 0x00, 0x07, 0x74, 0x4F, 0x70, 0x80, 0xA9, 0x90, 0x00, 0x02, 0x31, 0xDF, 0x20, 0x84, 0xE6, 0x00, 0x04,
|
||||
0x00, 0x27, 0xDA, 0x20, 0xC8, 0xAA, 0x4C, 0x40, 0x00, 0x57, 0x3B, 0x20, 0x00, 0xA1, 0x18, 0x00, 0x05, 0x54, 0x6F, 0x50, 0x00, 0xA9, 0x98, 0x00, 0x02, 0x22, 0x20, 0x80, 0x02, 0x00, 0x18, 0x88,
|
||||
0x00, 0x04, 0x44, 0x40, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x44, 0x40, 0x0C, 0x44, 0x44, 0x00, 0x00, 0x04, 0x40, 0x00, 0x88, 0xC0, 0x00, 0x00, 0x00, 0x0C, 0xC0, 0x00, 0x0C, 0x46, 0xA4, 0x40,
|
||||
0x00, 0x0C, 0xC0, 0x00, 0x08, 0x8E, 0xE0, 0x00, 0x02, 0x08, 0x80, 0x00, 0x80, 0xD0, 0x88, 0x00, 0x28, 0xA8, 0x80, 0x00, 0x88, 0xCD, 0x4C, 0x40, 0x0A, 0x88, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0xE0, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x88, 0x00, 0x80, 0x01, 0x06, 0x10, 0x00, 0x56, 0xE7, 0x50, 0x80, 0x02, 0x1F, 0xF1, 0x00,
|
||||
0x38, 0x8C, 0xB8, 0x00, 0x0B, 0xF6, 0x0B, 0x00, 0x94, 0xC0, 0x28, 0x00, 0x06, 0x07, 0x6A, 0x00, 0xCB, 0xA6, 0xC8, 0x00, 0x00, 0x47, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x0A, 0x80, 0x00, 0x00, 0x39, 0x14, 0x20, 0x02, 0x22, 0x24, 0x00, 0x08, 0xAE, 0xA8, 0x60, 0x04, 0x28, 0x99, 0x70, 0x07, 0x75, 0xD1, 0x04, 0x0F, 0xB3, 0x33, 0xD0, 0x00, 0xAE, 0xBE, 0xA4,
|
||||
0x25, 0x15, 0x20, 0xA0, 0x02, 0x61, 0x0C, 0x02, 0x20, 0x42, 0x08, 0x20, 0x2C, 0x30, 0x14, 0x02, 0x02, 0x28, 0x82, 0x00, 0x03, 0xAC, 0xC1, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x08, 0x12, 0x00, 0x08, 0x00, 0x28, 0x00, 0x0A, 0xCF, 0xEE, 0x20, 0x0B, 0x62, 0x2E, 0x20, 0x02, 0x10, 0x82, 0x40, 0x01, 0x44, 0xE4, 0x40, 0x03, 0x00, 0x0E, 0x00, 0x8D, 0xEA, 0xAC, 0x00,
|
||||
0x02, 0x10, 0x0A, 0x00, 0x01, 0xE0, 0x24, 0x00, 0x0C, 0x21, 0x02, 0x00, 0x09, 0x42, 0x21, 0x00, 0x00, 0xCC, 0xF4, 0x40, 0x02, 0xBF, 0xD4, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x04, 0x44, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x44, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x40, 0x00, 0x0C, 0xCC, 0xC4, 0x40, 0x00, 0x0C, 0xC0, 0x00, 0x00, 0x02, 0xA0, 0x40,
|
||||
0x00, 0x0C, 0xC0, 0x00, 0x04, 0xCE, 0x64, 0x40, 0x02, 0x08, 0x80, 0x00, 0x00, 0x90, 0x00, 0x40, 0x28, 0xA8, 0x80, 0x00, 0x08, 0x01, 0x04, 0x00, 0x0A, 0x88, 0x80, 0x00, 0x04, 0x44, 0x40, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x54, 0x44, 0x00, 0xEE, 0xFE, 0xE0, 0x00, 0x09, 0x3B, 0x3F, 0x00,
|
||||
0x21, 0xD8, 0x20, 0x00, 0x00, 0x54, 0x4F, 0x00, 0x18, 0x58, 0x20, 0x00, 0x00, 0x01, 0x86, 0x00, 0xC6, 0x7E, 0x40, 0x00, 0x00, 0xEF, 0x66, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x80, 0x04, 0x00, 0x00, 0xC0, 0x20, 0x00, 0xAA, 0xAA, 0xEA, 0x20, 0xEF, 0xFF, 0xFF, 0x00, 0x80, 0x44, 0x19, 0x30, 0x00, 0x49, 0x24, 0x00, 0xC5, 0x35, 0x1B, 0x10, 0x00, 0x4B, 0x24, 0x00,
|
||||
0x01, 0x35, 0xA0, 0x00, 0x8C, 0xA9, 0xAC, 0x80, 0x00, 0x2C, 0x00, 0x00, 0x04, 0x21, 0xA4, 0x00, 0x2A, 0x84, 0x00, 0x00, 0x73, 0x11, 0xF1, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x0B, 0x11, 0x19, 0x00, 0x00, 0x40, 0x00, 0x00, 0x8F, 0xEE, 0xEF, 0xE0, 0x0B, 0x76, 0x66, 0xD0, 0x1A, 0x00, 0x0B, 0x40, 0x4C, 0x40, 0x02, 0xD0, 0x28, 0x00, 0x1A, 0x40, 0x01, 0xD0, 0x2C, 0x10,
|
||||
0x00, 0x00, 0x38, 0x40, 0x00, 0x40, 0x28, 0x10, 0x00, 0x01, 0xA0, 0x40, 0x00, 0x42, 0x83, 0x00, 0x05, 0xFE, 0x44, 0x40, 0x03, 0xFD, 0x54, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x09, 0x99, 0x9B, 0x00, 0x00, 0x10, 0x20, 0x00, 0x07, 0x26, 0x21, 0x40, 0x2A, 0xFE, 0xEE, 0xA0, 0x8D, 0x8C, 0xA9, 0xC0, 0x00, 0x10, 0x20, 0x80, 0x32, 0x33, 0xB3, 0x60, 0x00, 0x19, 0x28, 0x00,
|
||||
0x00, 0x00, 0xA1, 0x40, 0x00, 0x10, 0xB1, 0x00, 0x00, 0x08, 0x34, 0x00, 0x00, 0x1A, 0x08, 0x00, 0x05, 0xF7, 0x40, 0x00, 0x8E, 0xF4, 0x44, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x08, 0x14, 0x02, 0x80, 0x00, 0x04, 0x00, 0x00, 0x1D, 0x11, 0xDB, 0x00, 0xDD, 0xFD, 0xDD, 0xD0, 0x0C, 0x88, 0x07, 0x00, 0x02, 0x06, 0x00, 0x90, 0x48, 0x00, 0x34, 0x00, 0x2C, 0x04, 0x2C, 0x10,
|
||||
0x48, 0x11, 0x21, 0x40, 0x04, 0x84, 0x83, 0x40, 0x59, 0x03, 0x00, 0x50, 0x40, 0x0C, 0x10, 0x60, 0x42, 0xA9, 0x88, 0xC0, 0x40, 0x15, 0x80, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x11, 0x02, 0x00, 0x40, 0x08, 0x98, 0x88, 0x80, 0x08, 0xF9, 0x98, 0xC0, 0x06, 0x77, 0x75, 0x50, 0x02, 0x0C, 0x05, 0x00, 0x19, 0x98, 0xA8, 0xD0, 0x0B, 0x99, 0xCA, 0x80, 0x04, 0x54, 0x65, 0xC0,
|
||||
0x20, 0x08, 0x50, 0x20, 0x00, 0x10, 0x20, 0xC0, 0x31, 0x1C, 0x04, 0x20, 0x00, 0x01, 0x28, 0x40, 0x26, 0x63, 0xBB, 0xE0, 0x26, 0xEF, 0xE6, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x01, 0x02, 0x01, 0x00, 0xC8, 0xC0, 0x00, 0x00, 0x0F, 0x8A, 0x89, 0x80, 0xC3, 0xF3, 0x11, 0x30, 0x0F, 0x02, 0x01, 0x80, 0xC9, 0xC0, 0x00, 0x30, 0x0F, 0x02, 0x05, 0xA0, 0x00, 0x00, 0x00, 0x30,
|
||||
0x0E, 0x02, 0x05, 0xA0, 0x00, 0x00, 0x00, 0x30, 0x0E, 0x02, 0x52, 0x80, 0x00, 0x00, 0x03, 0x00, 0x2C, 0xDF, 0xA8, 0x80, 0x02, 0x33, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x03, 0x88, 0x00, 0x01, 0x02, 0x80, 0x00, 0x03, 0xFF, 0xF7, 0x00, 0x0F, 0x26, 0xE4, 0x72, 0xCC, 0x38, 0x00, 0x40, 0x0C, 0x38, 0x99, 0x00, 0x03, 0x0A, 0x31, 0x50, 0x0C, 0xB1, 0x82, 0x80,
|
||||
0x03, 0x28, 0x06, 0x00, 0x87, 0x88, 0x2A, 0xA0, 0x01, 0x05, 0xC2, 0x00, 0x85, 0x82, 0xC2, 0x80, 0x10, 0x00, 0x39, 0x10, 0x08, 0x51, 0xBF, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x80, 0x04, 0x00, 0x48, 0x9D, 0xCC, 0x40, 0xC9, 0xE6, 0x7F, 0x40, 0x40, 0x00, 0x94, 0x00, 0x5B, 0x21, 0x0C, 0xB0, 0x48, 0xAE, 0xCC, 0x40, 0xE1, 0x30, 0x0C, 0x30, 0x43, 0x01, 0xA4, 0x00,
|
||||
0xE1, 0x24, 0x5D, 0x30, 0x78, 0x8C, 0xD6, 0x10, 0xF1, 0x60, 0x94, 0x70, 0xD0, 0x40, 0x9C, 0x70, 0x0B, 0x8C, 0x53, 0x00, 0x0C, 0x9D, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x01, 0x39, 0x50, 0x00, 0x00, 0x88, 0xF0, 0x00, 0x2E, 0xAF, 0xC6, 0x00, 0x03, 0x01, 0x77, 0x60, 0x04, 0xF0, 0x41, 0x60, 0x03, 0x92, 0xF8, 0x12, 0x0F, 0xBD, 0x91, 0x40, 0x1B, 0x28, 0x60, 0x92,
|
||||
0x70, 0xF4, 0x01, 0xF0, 0x0A, 0xD4, 0x65, 0x82, 0x53, 0xE0, 0x01, 0xE0, 0x04, 0x10, 0x68, 0x60, 0x04, 0x2A, 0xBE, 0x00, 0x00, 0x4F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x02, 0x3A, 0xEE, 0x00, 0xC8, 0xC0, 0x00, 0x00, 0x0D, 0x84, 0xA5, 0x00, 0xC1, 0xC2, 0x11, 0x00, 0x45, 0x0E, 0x27, 0x00, 0xD9, 0xC3, 0x00, 0x10, 0x07, 0xF8, 0x8D, 0x20, 0x01, 0x30, 0x00, 0x10,
|
||||
0xAC, 0x02, 0x25, 0xA0, 0x01, 0x22, 0x00, 0x10, 0x44, 0x20, 0x16, 0xA0, 0x13, 0x02, 0x00, 0x30, 0x04, 0x1B, 0xAA, 0x40, 0x21, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
u8 sGfxPrintFontData[(16 * 256) / 2] = {
|
||||
0x00, 0xDF, 0xFD, 0x00, 0x0A, 0xEE, 0xFF, 0xA0, 0x0D, 0xF2, 0x2D, 0xD0, 0x06, 0x61, 0x1D, 0xC0, 0x01, 0x12, 0x2D,
|
||||
0xD0, 0x06, 0x71, 0x99, 0x00, 0x01, 0x1E, 0xED, 0x10, 0x07, 0x7E, 0xF7, 0x00, 0x01, 0x56, 0x29, 0x90, 0x05, 0x58,
|
||||
0x97, 0x60, 0x0D, 0xD2, 0x29, 0x90, 0x05, 0x59, 0x97, 0x70, 0x04, 0xDF, 0xFD, 0x40, 0x02, 0x6E, 0xF7, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xBF, 0xFB, 0x00, 0x0E, 0xFF, 0xFF, 0xC0, 0x0B, 0xF0, 0x0F, 0xB0,
|
||||
0x0F, 0xF0, 0x03, 0x30, 0x0F, 0xF0, 0x0F, 0xF0, 0x0F, 0xF0, 0x02, 0x20, 0x0C, 0xFB, 0xBF, 0x60, 0x0F, 0xFC, 0xCE,
|
||||
0x20, 0x0D, 0xD4, 0x4F, 0xF0, 0x0F, 0xF0, 0x02, 0x20, 0x0F, 0xF0, 0x0F, 0xF0, 0x0F, 0xF0, 0x03, 0x30, 0x0C, 0xFB,
|
||||
0xBF, 0x40, 0x0E, 0xF7, 0x77, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDF, 0xFD, 0x00, 0x0A,
|
||||
0xEE, 0xFF, 0xA0, 0x0D, 0xF2, 0x2D, 0xD0, 0x06, 0x61, 0x1D, 0xC0, 0x01, 0x12, 0x2D, 0xD0, 0x06, 0x71, 0x99, 0x00,
|
||||
0x01, 0x1E, 0xED, 0x10, 0x07, 0x7E, 0xF7, 0x00, 0x01, 0x56, 0x29, 0x90, 0x05, 0x58, 0x97, 0x60, 0x0D, 0xD2, 0x29,
|
||||
0x90, 0x05, 0x59, 0x97, 0x70, 0x04, 0xDF, 0xFD, 0x40, 0x02, 0x6E, 0xF7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x08, 0xBF, 0xFB, 0x00, 0x00, 0x0D, 0xE0, 0x00, 0x0B, 0xF0, 0x0F, 0xB0, 0x00, 0x5D, 0xE6, 0x00, 0x0F,
|
||||
0xF0, 0x0F, 0xF0, 0x05, 0x5C, 0xC6, 0x60, 0x0C, 0xFB, 0xBF, 0x60, 0x77, 0x3F, 0xF3, 0x77, 0x0D, 0xD4, 0x4F, 0xF0,
|
||||
0xBB, 0x3F, 0xF3, 0xBB, 0x0F, 0xF0, 0x0F, 0xF0, 0x09, 0x9C, 0xCA, 0xA0, 0x0C, 0xFB, 0xBF, 0x40, 0x00, 0x9D, 0xEA,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, 0xE0, 0x00, 0x04, 0xC2, 0x2C, 0x40, 0x02, 0x8D, 0x50, 0x20, 0x0C, 0xCA,
|
||||
0xAC, 0xC0, 0x21, 0xF9, 0x17, 0x10, 0x04, 0xC2, 0x2C, 0x40, 0x12, 0x49, 0x34, 0x00, 0x00, 0x82, 0x08, 0x00, 0x01,
|
||||
0x97, 0x51, 0x10, 0x08, 0x8A, 0x88, 0x80, 0x04, 0x61, 0x52, 0x41, 0x00, 0x80, 0x08, 0x00, 0x43, 0x11, 0x75, 0x30,
|
||||
0x00, 0xA2, 0x08, 0x00, 0x60, 0x05, 0x56, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x40, 0x00, 0x40, 0x00, 0x22, 0x11,
|
||||
0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x0F, 0xB0, 0x00, 0x00, 0x00, 0x08, 0x80, 0x04, 0x0D, 0xA4, 0x00, 0x00, 0x00,
|
||||
0x88, 0x00, 0x08, 0xCD, 0xE8, 0x80, 0x02, 0x2A, 0xA2, 0x20, 0x08, 0xCD, 0xE8, 0x80, 0x02, 0xAA, 0x22, 0x20, 0x04,
|
||||
0x0D, 0xA4, 0x00, 0x0C, 0xD1, 0x00, 0x00, 0x00, 0x0F, 0xB0, 0x00, 0x8C, 0x51, 0x00, 0x00, 0x00, 0x22, 0x11, 0x00,
|
||||
0x81, 0x10, 0x00, 0x00, 0x00, 0xDF, 0xFD, 0x00, 0x0A, 0xEE, 0xFF, 0xA0, 0x0D, 0xF2, 0x2D, 0xD0, 0x06, 0x61, 0x1D,
|
||||
0xC0, 0x01, 0x12, 0x2D, 0xD0, 0x06, 0x71, 0x99, 0x00, 0x01, 0x1E, 0xED, 0x10, 0x07, 0x7E, 0xF7, 0x00, 0x01, 0x56,
|
||||
0x29, 0x90, 0x05, 0x58, 0x97, 0x60, 0x0D, 0xD2, 0x29, 0x90, 0x05, 0x59, 0x97, 0x70, 0x04, 0xDF, 0xFD, 0x40, 0x02,
|
||||
0x6E, 0xF7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x33, 0x00, 0x04, 0x48, 0x99, 0x80,
|
||||
0x03, 0x3C, 0xC3, 0x30, 0x00, 0xCD, 0x10, 0x88, 0x03, 0x3C, 0xC3, 0x30, 0x02, 0xBF, 0x62, 0xA8, 0x00, 0x33, 0x33,
|
||||
0x20, 0x01, 0x10, 0x4C, 0x80, 0x01, 0x10, 0x03, 0x30, 0x00, 0x15, 0xC8, 0x00, 0x03, 0x3C, 0xC3, 0x30, 0x02, 0x67,
|
||||
0x32, 0x20, 0x00, 0x3F, 0xF3, 0x00, 0x04, 0x40, 0x99, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05,
|
||||
0xDF, 0xFD, 0x10, 0x07, 0xFF, 0xFF, 0x60, 0x1C, 0xE0, 0x0E, 0xC1, 0x0F, 0xF0, 0x09, 0x90, 0x1E, 0xE1, 0x16, 0x61,
|
||||
0x0F, 0xF0, 0x01, 0x10, 0x1E, 0xF4, 0x56, 0x21, 0x0F, 0xF6, 0x67, 0x10, 0x1E, 0xF2, 0x36, 0x61, 0x0F, 0xF0, 0x89,
|
||||
0x90, 0x1E, 0xF1, 0x0F, 0xE1, 0x0F, 0xF0, 0x09, 0x90, 0x16, 0xEC, 0xCE, 0x21, 0x07, 0xFB, 0xBB, 0x20, 0x01, 0x11,
|
||||
0x11, 0x10, 0x00, 0x00, 0x00, 0x00, 0x09, 0xB6, 0x6F, 0xD0, 0x27, 0xD8, 0x8E, 0x60, 0x09, 0x92, 0xED, 0x10, 0x2F,
|
||||
0xF0, 0x2E, 0xE0, 0x09, 0x9A, 0xE5, 0x10, 0x2F, 0xF6, 0x2E, 0xE0, 0x09, 0x9B, 0x75, 0x10, 0x2F, 0xD6, 0x4E, 0xE0,
|
||||
0x0D, 0xDA, 0xE5, 0x10, 0x2F, 0xD0, 0x4E, 0xE0, 0x0D, 0xD2, 0xED, 0x10, 0x2F, 0xD0, 0x0E, 0xE0, 0x09, 0xF6, 0x6F,
|
||||
0x90, 0x27, 0xD9, 0x9F, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0x00, 0x8F, 0x71,
|
||||
0x1F, 0xF0, 0x2F, 0xD0, 0x0F, 0xF0, 0x8F, 0x71, 0x1F, 0xF0, 0x2F, 0xD0, 0x07, 0x70, 0x8E, 0x61, 0x1E, 0xE0, 0x27,
|
||||
0xDD, 0xDF, 0x60, 0x8E, 0x69, 0x1E, 0xE0, 0x27, 0x76, 0x4A, 0xA0, 0x8E, 0xE9, 0x9E, 0xE0, 0x2F, 0xD0, 0x6E, 0x80,
|
||||
0x8A, 0xE7, 0xFE, 0xA0, 0x07, 0xFA, 0x8E, 0x60, 0x88, 0x27, 0x7A, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x07, 0x7C, 0xCF, 0xF0, 0x13, 0x26, 0x60, 0x11, 0x07, 0x7C, 0xCF, 0xF0, 0x03, 0x76, 0x65, 0x10, 0x02, 0x39,
|
||||
0xD7, 0x20, 0x04, 0x53, 0x35, 0x40, 0x00, 0x2F, 0xF2, 0x00, 0x01, 0x13, 0x31, 0x10, 0x00, 0x5F, 0xB1, 0x00, 0x00,
|
||||
0x03, 0x30, 0x00, 0x05, 0x5E, 0xE5, 0x50, 0x01, 0x13, 0x31, 0x10, 0x05, 0x5E, 0xED, 0xD0, 0x02, 0x23, 0x30, 0x00,
|
||||
0x00, 0x08, 0x88, 0x80, 0x8A, 0xAB, 0xB8, 0x88, 0x00, 0x00, 0x11, 0x00, 0x00, 0x04, 0x45, 0x10, 0x04, 0x62, 0x33,
|
||||
0x20, 0x00, 0x44, 0x01, 0x10, 0x04, 0xC8, 0x9A, 0xA0, 0x00, 0xEE, 0xAB, 0x10, 0x0C, 0xE6, 0x67, 0x20, 0x0E, 0xF5,
|
||||
0x5F, 0xB0, 0x0E, 0xE0, 0x06, 0x60, 0x0B, 0xF6, 0x2B, 0x90, 0x0E, 0xE0, 0x06, 0x60, 0x03, 0xFC, 0x89, 0x90, 0x04,
|
||||
0xEE, 0xEE, 0xA0, 0x00, 0x77, 0x3B, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x08, 0x88, 0x88, 0x00, 0x09, 0x90, 0x00, 0x00,
|
||||
0x00, 0x11, 0x10, 0x00, 0x09, 0x92, 0x24, 0x40, 0x00, 0x01, 0x10, 0x00, 0x09, 0x90, 0x88, 0x00, 0x26, 0xEF, 0xDE,
|
||||
0x20, 0x09, 0x9B, 0xB5, 0x40, 0x2E, 0xC3, 0x3C, 0xE2, 0x0D, 0x9A, 0x25, 0x50, 0x2E, 0xC3, 0x3C, 0xE2, 0x0D, 0xDA,
|
||||
0xA5, 0x50, 0x2E, 0xC3, 0x3C, 0xE2, 0x09, 0xD6, 0xED, 0x10, 0x26, 0xCB, 0xBC, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x10, 0x00,
|
||||
0x05, 0xFB, 0xFF, 0xE0, 0x8E, 0x61, 0x16, 0xE8, 0x0F, 0xF4, 0x03, 0x30, 0x8F, 0x71, 0x17, 0xF8, 0x07, 0xFC, 0x8B,
|
||||
0x30, 0x8E, 0x69, 0x96, 0xE8, 0x05, 0x73, 0x3B, 0xA0, 0x8A, 0x6D, 0xD6, 0xA8, 0x0D, 0xD8, 0x8A, 0x20, 0x08, 0xA7,
|
||||
0x79, 0xB2, 0x01, 0x10, 0x02, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x8A, 0x01, 0x10, 0x00, 0x00,
|
||||
0x00, 0x08, 0x00, 0x80, 0xA1, 0x10, 0x00, 0x07, 0x74, 0x4F, 0x70, 0x80, 0xA9, 0x90, 0x00, 0x02, 0x31, 0xDF, 0x20,
|
||||
0x84, 0xE6, 0x00, 0x04, 0x00, 0x27, 0xDA, 0x20, 0xC8, 0xAA, 0x4C, 0x40, 0x00, 0x57, 0x3B, 0x20, 0x00, 0xA1, 0x18,
|
||||
0x00, 0x05, 0x54, 0x6F, 0x50, 0x00, 0xA9, 0x98, 0x00, 0x02, 0x22, 0x20, 0x80, 0x02, 0x00, 0x18, 0x88, 0x00, 0x04,
|
||||
0x44, 0x40, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x44, 0x40, 0x0C, 0x44, 0x44, 0x00, 0x00, 0x04, 0x40, 0x00, 0x88,
|
||||
0xC0, 0x00, 0x00, 0x00, 0x0C, 0xC0, 0x00, 0x0C, 0x46, 0xA4, 0x40, 0x00, 0x0C, 0xC0, 0x00, 0x08, 0x8E, 0xE0, 0x00,
|
||||
0x02, 0x08, 0x80, 0x00, 0x80, 0xD0, 0x88, 0x00, 0x28, 0xA8, 0x80, 0x00, 0x88, 0xCD, 0x4C, 0x40, 0x0A, 0x88, 0x80,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0xE0, 0x08, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x08, 0x88, 0x00, 0x80, 0x01, 0x06, 0x10, 0x00, 0x56, 0xE7, 0x50, 0x80, 0x02, 0x1F, 0xF1, 0x00, 0x38,
|
||||
0x8C, 0xB8, 0x00, 0x0B, 0xF6, 0x0B, 0x00, 0x94, 0xC0, 0x28, 0x00, 0x06, 0x07, 0x6A, 0x00, 0xCB, 0xA6, 0xC8, 0x00,
|
||||
0x00, 0x47, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x80, 0x00, 0x00, 0x39, 0x14,
|
||||
0x20, 0x02, 0x22, 0x24, 0x00, 0x08, 0xAE, 0xA8, 0x60, 0x04, 0x28, 0x99, 0x70, 0x07, 0x75, 0xD1, 0x04, 0x0F, 0xB3,
|
||||
0x33, 0xD0, 0x00, 0xAE, 0xBE, 0xA4, 0x25, 0x15, 0x20, 0xA0, 0x02, 0x61, 0x0C, 0x02, 0x20, 0x42, 0x08, 0x20, 0x2C,
|
||||
0x30, 0x14, 0x02, 0x02, 0x28, 0x82, 0x00, 0x03, 0xAC, 0xC1, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x08, 0x12, 0x00, 0x08, 0x00, 0x28, 0x00, 0x0A, 0xCF, 0xEE, 0x20, 0x0B, 0x62, 0x2E, 0x20, 0x02, 0x10, 0x82,
|
||||
0x40, 0x01, 0x44, 0xE4, 0x40, 0x03, 0x00, 0x0E, 0x00, 0x8D, 0xEA, 0xAC, 0x00, 0x02, 0x10, 0x0A, 0x00, 0x01, 0xE0,
|
||||
0x24, 0x00, 0x0C, 0x21, 0x02, 0x00, 0x09, 0x42, 0x21, 0x00, 0x00, 0xCC, 0xF4, 0x40, 0x02, 0xBF, 0xD4, 0x40, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x44, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x44, 0x40,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x40, 0x00, 0x0C, 0xCC, 0xC4, 0x40, 0x00, 0x0C, 0xC0, 0x00, 0x00, 0x02, 0xA0,
|
||||
0x40, 0x00, 0x0C, 0xC0, 0x00, 0x04, 0xCE, 0x64, 0x40, 0x02, 0x08, 0x80, 0x00, 0x00, 0x90, 0x00, 0x40, 0x28, 0xA8,
|
||||
0x80, 0x00, 0x08, 0x01, 0x04, 0x00, 0x0A, 0x88, 0x80, 0x00, 0x04, 0x44, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x54, 0x44, 0x00,
|
||||
0xEE, 0xFE, 0xE0, 0x00, 0x09, 0x3B, 0x3F, 0x00, 0x21, 0xD8, 0x20, 0x00, 0x00, 0x54, 0x4F, 0x00, 0x18, 0x58, 0x20,
|
||||
0x00, 0x00, 0x01, 0x86, 0x00, 0xC6, 0x7E, 0x40, 0x00, 0x00, 0xEF, 0x66, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x80, 0x04, 0x00, 0x00, 0xC0, 0x20, 0x00, 0xAA, 0xAA, 0xEA, 0x20, 0xEF, 0xFF, 0xFF, 0x00, 0x80,
|
||||
0x44, 0x19, 0x30, 0x00, 0x49, 0x24, 0x00, 0xC5, 0x35, 0x1B, 0x10, 0x00, 0x4B, 0x24, 0x00, 0x01, 0x35, 0xA0, 0x00,
|
||||
0x8C, 0xA9, 0xAC, 0x80, 0x00, 0x2C, 0x00, 0x00, 0x04, 0x21, 0xA4, 0x00, 0x2A, 0x84, 0x00, 0x00, 0x73, 0x11, 0xF1,
|
||||
0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x11, 0x19, 0x00, 0x00, 0x40, 0x00, 0x00, 0x8F, 0xEE,
|
||||
0xEF, 0xE0, 0x0B, 0x76, 0x66, 0xD0, 0x1A, 0x00, 0x0B, 0x40, 0x4C, 0x40, 0x02, 0xD0, 0x28, 0x00, 0x1A, 0x40, 0x01,
|
||||
0xD0, 0x2C, 0x10, 0x00, 0x00, 0x38, 0x40, 0x00, 0x40, 0x28, 0x10, 0x00, 0x01, 0xA0, 0x40, 0x00, 0x42, 0x83, 0x00,
|
||||
0x05, 0xFE, 0x44, 0x40, 0x03, 0xFD, 0x54, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x99, 0x9B,
|
||||
0x00, 0x00, 0x10, 0x20, 0x00, 0x07, 0x26, 0x21, 0x40, 0x2A, 0xFE, 0xEE, 0xA0, 0x8D, 0x8C, 0xA9, 0xC0, 0x00, 0x10,
|
||||
0x20, 0x80, 0x32, 0x33, 0xB3, 0x60, 0x00, 0x19, 0x28, 0x00, 0x00, 0x00, 0xA1, 0x40, 0x00, 0x10, 0xB1, 0x00, 0x00,
|
||||
0x08, 0x34, 0x00, 0x00, 0x1A, 0x08, 0x00, 0x05, 0xF7, 0x40, 0x00, 0x8E, 0xF4, 0x44, 0xC0, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x08, 0x14, 0x02, 0x80, 0x00, 0x04, 0x00, 0x00, 0x1D, 0x11, 0xDB, 0x00, 0xDD, 0xFD, 0xDD,
|
||||
0xD0, 0x0C, 0x88, 0x07, 0x00, 0x02, 0x06, 0x00, 0x90, 0x48, 0x00, 0x34, 0x00, 0x2C, 0x04, 0x2C, 0x10, 0x48, 0x11,
|
||||
0x21, 0x40, 0x04, 0x84, 0x83, 0x40, 0x59, 0x03, 0x00, 0x50, 0x40, 0x0C, 0x10, 0x60, 0x42, 0xA9, 0x88, 0xC0, 0x40,
|
||||
0x15, 0x80, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x02, 0x00, 0x40, 0x08, 0x98, 0x88, 0x80,
|
||||
0x08, 0xF9, 0x98, 0xC0, 0x06, 0x77, 0x75, 0x50, 0x02, 0x0C, 0x05, 0x00, 0x19, 0x98, 0xA8, 0xD0, 0x0B, 0x99, 0xCA,
|
||||
0x80, 0x04, 0x54, 0x65, 0xC0, 0x20, 0x08, 0x50, 0x20, 0x00, 0x10, 0x20, 0xC0, 0x31, 0x1C, 0x04, 0x20, 0x00, 0x01,
|
||||
0x28, 0x40, 0x26, 0x63, 0xBB, 0xE0, 0x26, 0xEF, 0xE6, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
|
||||
0x02, 0x01, 0x00, 0xC8, 0xC0, 0x00, 0x00, 0x0F, 0x8A, 0x89, 0x80, 0xC3, 0xF3, 0x11, 0x30, 0x0F, 0x02, 0x01, 0x80,
|
||||
0xC9, 0xC0, 0x00, 0x30, 0x0F, 0x02, 0x05, 0xA0, 0x00, 0x00, 0x00, 0x30, 0x0E, 0x02, 0x05, 0xA0, 0x00, 0x00, 0x00,
|
||||
0x30, 0x0E, 0x02, 0x52, 0x80, 0x00, 0x00, 0x03, 0x00, 0x2C, 0xDF, 0xA8, 0x80, 0x02, 0x33, 0x30, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x88, 0x00, 0x01, 0x02, 0x80, 0x00, 0x03, 0xFF, 0xF7, 0x00, 0x0F,
|
||||
0x26, 0xE4, 0x72, 0xCC, 0x38, 0x00, 0x40, 0x0C, 0x38, 0x99, 0x00, 0x03, 0x0A, 0x31, 0x50, 0x0C, 0xB1, 0x82, 0x80,
|
||||
0x03, 0x28, 0x06, 0x00, 0x87, 0x88, 0x2A, 0xA0, 0x01, 0x05, 0xC2, 0x00, 0x85, 0x82, 0xC2, 0x80, 0x10, 0x00, 0x39,
|
||||
0x10, 0x08, 0x51, 0xBF, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x04, 0x00, 0x48, 0x9D,
|
||||
0xCC, 0x40, 0xC9, 0xE6, 0x7F, 0x40, 0x40, 0x00, 0x94, 0x00, 0x5B, 0x21, 0x0C, 0xB0, 0x48, 0xAE, 0xCC, 0x40, 0xE1,
|
||||
0x30, 0x0C, 0x30, 0x43, 0x01, 0xA4, 0x00, 0xE1, 0x24, 0x5D, 0x30, 0x78, 0x8C, 0xD6, 0x10, 0xF1, 0x60, 0x94, 0x70,
|
||||
0xD0, 0x40, 0x9C, 0x70, 0x0B, 0x8C, 0x53, 0x00, 0x0C, 0x9D, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x01, 0x39, 0x50, 0x00, 0x00, 0x88, 0xF0, 0x00, 0x2E, 0xAF, 0xC6, 0x00, 0x03, 0x01, 0x77, 0x60, 0x04, 0xF0,
|
||||
0x41, 0x60, 0x03, 0x92, 0xF8, 0x12, 0x0F, 0xBD, 0x91, 0x40, 0x1B, 0x28, 0x60, 0x92, 0x70, 0xF4, 0x01, 0xF0, 0x0A,
|
||||
0xD4, 0x65, 0x82, 0x53, 0xE0, 0x01, 0xE0, 0x04, 0x10, 0x68, 0x60, 0x04, 0x2A, 0xBE, 0x00, 0x00, 0x4F, 0x80, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x3A, 0xEE, 0x00, 0xC8, 0xC0, 0x00, 0x00, 0x0D, 0x84, 0xA5,
|
||||
0x00, 0xC1, 0xC2, 0x11, 0x00, 0x45, 0x0E, 0x27, 0x00, 0xD9, 0xC3, 0x00, 0x10, 0x07, 0xF8, 0x8D, 0x20, 0x01, 0x30,
|
||||
0x00, 0x10, 0xAC, 0x02, 0x25, 0xA0, 0x01, 0x22, 0x00, 0x10, 0x44, 0x20, 0x16, 0xA0, 0x13, 0x02, 0x00, 0x30, 0x04,
|
||||
0x1B, 0xAA, 0x40, 0x21, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
|
||||
};
|
||||
|
||||
#define gDPSetPrimColorMod(pkt, m, l, rgba) \
|
||||
_DW({ \
|
||||
Gfx *_g = (Gfx *)(pkt); \
|
||||
\
|
||||
_g->words.w0 = (_SHIFTL(G_SETPRIMCOLOR, 24, 8) | \
|
||||
_SHIFTL(m, 8, 8) | _SHIFTL(l, 0, 8)); \
|
||||
_g->words.w1 = (rgba); \
|
||||
})
|
||||
#define gDPSetPrimColorMod(pkt, m, l, rgba) \
|
||||
_DW({ \
|
||||
Gfx* _g = (Gfx*)(pkt); \
|
||||
\
|
||||
_g->words.w0 = (_SHIFTL(G_SETPRIMCOLOR, 24, 8) | _SHIFTL(m, 8, 8) | _SHIFTL(l, 0, 8)); \
|
||||
_g->words.w1 = (rgba); \
|
||||
})
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// regalloc and minor ordering differences
|
||||
void GfxPrint_InitDlist(GfxPrint* this)
|
||||
{
|
||||
void GfxPrint_InitDlist(GfxPrint* this) {
|
||||
s32 width = 16;
|
||||
s32 height = 256;
|
||||
s32 i;
|
||||
|
||||
gDPPipeSync(this->dlist++);
|
||||
gDPSetOtherMode(this->dlist++,
|
||||
G_AD_DISABLE | G_CD_DISABLE | G_CK_NONE | G_TC_FILT | G_TF_BILERP |
|
||||
G_TT_IA16 | G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
|
||||
G_AD_DISABLE | G_CD_DISABLE | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_IA16 | G_TL_TILE |
|
||||
G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
|
||||
G_AC_NONE | G_ZS_PRIM | G_RM_XLU_SURF | G_RM_XLU_SURF2);
|
||||
gDPSetCombineLERP(this->dlist++,
|
||||
0, 0, 0, TEXEL0, 0, 0, 0, TEXEL0,
|
||||
0, 0, 0, TEXEL0, 0, 0, 0, TEXEL0);
|
||||
gDPSetCombineLERP(this->dlist++, 0, 0, 0, TEXEL0, 0, 0, 0, TEXEL0, 0, 0, 0, TEXEL0, 0, 0, 0, TEXEL0);
|
||||
|
||||
gDPSetTextureImage(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_4b_LOAD_BLOCK, 1, sGfxPrintFontData);
|
||||
gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_4b_LOAD_BLOCK,
|
||||
0, 0, G_TX_LOADTILE, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
|
||||
gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_4b_LOAD_BLOCK, 0, 0, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP,
|
||||
G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
|
||||
gDPLoadSync(this->dlist++);
|
||||
gDPLoadBlock(this->dlist++, G_TX_LOADTILE, 0, 0,
|
||||
(((width)*(height) + G_IM_SIZ_4b_INCR) >> G_IM_SIZ_4b_SHIFT) - 1,
|
||||
CALC_DXT(width, G_IM_SIZ_4b_BYTES));
|
||||
gDPLoadBlock(this->dlist++, G_TX_LOADTILE, 0, 0, (((width) * (height) + G_IM_SIZ_4b_INCR) >> G_IM_SIZ_4b_SHIFT) - 1,
|
||||
CALC_DXT(width, G_IM_SIZ_4b_BYTES));
|
||||
gDPPipeSync(this->dlist++);
|
||||
gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_4b,
|
||||
1, 0, G_TX_RENDERTILE, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
|
||||
gDPSetTileSize(this->dlist++, G_TX_RENDERTILE, 0, 0,
|
||||
((width)-1) << G_TEXTURE_IMAGE_FRAC,
|
||||
gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_4b, 1, 0, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_WRAP,
|
||||
G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
|
||||
gDPSetTileSize(this->dlist++, G_TX_RENDERTILE, 0, 0, ((width)-1) << G_TEXTURE_IMAGE_FRAC,
|
||||
((height)-1) << G_TEXTURE_IMAGE_FRAC);
|
||||
|
||||
gDPLoadTLUT(this->dlist++, 64, 256, sGfxPrintFontTLUT);
|
||||
|
||||
for (i = 1; i < 4; i++)
|
||||
{
|
||||
gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_4b,
|
||||
1, 0, i * 2, i,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
|
||||
for (i = 1; i < 4; i++) {
|
||||
gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_4b, 1, 0, i * 2, i, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
|
||||
G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
|
||||
gDPSetTileSize(this->dlist++, i * 2, 0, 0, 60, 1020);
|
||||
}
|
||||
|
||||
gDPSetPrimColorMod(this->dlist++, 0, 0, *(u32*)&this->color);
|
||||
|
||||
gDPSetTextureImage(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_8b, 1, sGfxPrintUnkData);
|
||||
gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_8b,
|
||||
1, 0, G_TX_LOADTILE, 0 ,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, 3, G_TX_NOLOD,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, 1, G_TX_NOLOD);
|
||||
gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_8b, 1, 0, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, 3,
|
||||
G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 1, G_TX_NOLOD);
|
||||
gDPLoadSync(this->dlist++);
|
||||
gDPLoadTile(this->dlist++, G_TX_LOADTILE, 0, 0, 2, 28);
|
||||
gDPPipeSync(this->dlist++);
|
||||
gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_8b,
|
||||
1, 0, 1, 4,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, 3, G_TX_NOLOD,
|
||||
gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_8b, 1, 0, 1, 4, G_TX_NOMIRROR | G_TX_WRAP, 3, G_TX_NOLOD,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, 1, G_TX_NOLOD);
|
||||
gDPSetTileSize(this->dlist++, 1, 0, 0, 4, 28);
|
||||
|
||||
gDPLoadTLUT(this->dlist++, 16, 320, sGfxPrintUnkTLUT);
|
||||
|
||||
for (i = 1; i < 4; i++)
|
||||
{
|
||||
gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_4b,
|
||||
1, 0, i * 2 + 1, 4,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, 3, G_TX_NOLOD,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, 1, G_TX_NOLOD);
|
||||
for (i = 1; i < 4; i++) {
|
||||
gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_4b, 1, 0, i * 2 + 1, 4, G_TX_NOMIRROR | G_TX_WRAP, 3,
|
||||
G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 1, G_TX_NOLOD);
|
||||
gDPSetTileSize(this->dlist++, i * 2 + 1, 0, 0, 4, 28);
|
||||
}
|
||||
}
|
||||
@@ -190,8 +198,7 @@ void GfxPrint_InitDlist(GfxPrint* this)
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/gfxprint/GfxPrint_InitDlist.s")
|
||||
#endif
|
||||
|
||||
void GfxPrint_SetColor(GfxPrint* this, u32 r, u32 g, u32 b, u32 a)
|
||||
{
|
||||
void GfxPrint_SetColor(GfxPrint* this, u32 r, u32 g, u32 b, u32 a) {
|
||||
this->color.r = r;
|
||||
this->color.g = g;
|
||||
this->color.b = b;
|
||||
@@ -200,89 +207,61 @@ void GfxPrint_SetColor(GfxPrint* this, u32 r, u32 g, u32 b, u32 a)
|
||||
gDPSetPrimColorMod(this->dlist++, 0, 0, *(u32*)&this->color);
|
||||
}
|
||||
|
||||
|
||||
void GfxPrint_SetPosPx(GfxPrint* this, s32 x, s32 y)
|
||||
{
|
||||
void GfxPrint_SetPosPx(GfxPrint* this, s32 x, s32 y) {
|
||||
this->posX = this->baseX + (x << 2);
|
||||
this->posY = this->baseY + (y << 2);
|
||||
}
|
||||
|
||||
void GfxPrint_SetPos(GfxPrint* this, s32 x, s32 y)
|
||||
{
|
||||
void GfxPrint_SetPos(GfxPrint* this, s32 x, s32 y) {
|
||||
GfxPrint_SetPosPx(this, x << 3, y << 3);
|
||||
}
|
||||
|
||||
void GfxPrint_SetBasePosPx(GfxPrint* this, s32 x, s32 y)
|
||||
{
|
||||
void GfxPrint_SetBasePosPx(GfxPrint* this, s32 x, s32 y) {
|
||||
this->baseX = x << 2;
|
||||
this->baseY = y << 2;
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// regalloc and ordering differences
|
||||
void GfxPrint_PrintCharImpl(GfxPrint* this, char c)
|
||||
{
|
||||
if (this->flag & GFXPRINT_UPDATE_MODE)
|
||||
{
|
||||
void GfxPrint_PrintCharImpl(GfxPrint* this, char c) {
|
||||
if (this->flag & GFXPRINT_UPDATE_MODE) {
|
||||
this->flag &= ~GFXPRINT_UPDATE_MODE;
|
||||
|
||||
gDPPipeSync(this->dlist++);
|
||||
if (this->flag & GFXPRINT_USE_RGBA16)
|
||||
{
|
||||
if (this->flag & GFXPRINT_USE_RGBA16) {
|
||||
gDPSetTextureLUT(this->dlist++, G_TT_RGBA16);
|
||||
gDPSetCycleType(this->dlist++, G_CYC_2CYCLE);
|
||||
gDPSetRenderMode(this->dlist++, G_RM_OPA_CI, G_RM_XLU_SURF2);
|
||||
gDPSetCombineLERP(this->dlist++,
|
||||
TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, TEXEL1, 0,
|
||||
0, 0, 0, COMBINED, 0, 0, 0, COMBINED);
|
||||
}
|
||||
else
|
||||
{
|
||||
gDPSetCombineLERP(this->dlist++, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, 0, 0, 0, COMBINED, 0, 0, 0,
|
||||
COMBINED);
|
||||
} else {
|
||||
gDPSetTextureLUT(this->dlist++, G_TT_IA16);
|
||||
gDPSetCycleType(this->dlist++, G_CYC_1CYCLE);
|
||||
gDPSetRenderMode(this->dlist++, G_RM_XLU_SURF, G_RM_XLU_SURF2);
|
||||
gDPSetCombineLERP(this->dlist++,
|
||||
TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, TEXEL0,
|
||||
TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, TEXEL0);
|
||||
gDPSetCombineLERP(this->dlist++, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, TEXEL0, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0,
|
||||
TEXEL0);
|
||||
}
|
||||
}
|
||||
|
||||
if (this->flag & GFXPRINT_FLAG4)
|
||||
{
|
||||
if (this->flag & GFXPRINT_FLAG4) {
|
||||
gDPSetPrimColorMod(this->dlist++, 0, 0, 0);
|
||||
|
||||
if (this->flag & GFXPRINT_FLAG64)
|
||||
gSPTextureRectangle(this->dlist++,
|
||||
(this->posX + 4) << 1, (this->posY + 4) << 1,
|
||||
(this->posX + 4 + 32) << 1, (this->posY + 4 + 32) << 1,
|
||||
c * 2,
|
||||
(u16)(c & 4) * 64, (u16)(c >> 3) * 256,
|
||||
512, 512);
|
||||
gSPTextureRectangle(this->dlist++, (this->posX + 4) << 1, (this->posY + 4) << 1, (this->posX + 4 + 32) << 1,
|
||||
(this->posY + 4 + 32) << 1, c * 2, (u16)(c & 4) * 64, (u16)(c >> 3) * 256, 512, 512);
|
||||
else
|
||||
gSPTextureRectangle(this->dlist++,
|
||||
this->posX + 4, this->posY + 4,
|
||||
this->posX + 4 + 32, this->posY + 4 + 32,
|
||||
c * 2,
|
||||
(u16)(c & 4) * 64, (u16)(c >> 3) * 256,
|
||||
1024, 1024);
|
||||
gSPTextureRectangle(this->dlist++, this->posX + 4, this->posY + 4, this->posX + 4 + 32, this->posY + 4 + 32,
|
||||
c * 2, (u16)(c & 4) * 64, (u16)(c >> 3) * 256, 1024, 1024);
|
||||
|
||||
gDPSetPrimColorMod(this->dlist++, 0, 0, *(u32*)&this->color);
|
||||
}
|
||||
|
||||
if (this->flag & GFXPRINT_FLAG64)
|
||||
gSPTextureRectangle(this->dlist++,
|
||||
(this->posX) << 1, (this->posY) << 1,
|
||||
(this->posX + 32) << 1, (this->posY + 32) << 1,
|
||||
c * 2,
|
||||
(u16)(c & 4) * 64, (u16)(c >> 3) * 256,
|
||||
512, 512);
|
||||
gSPTextureRectangle(this->dlist++, (this->posX) << 1, (this->posY) << 1, (this->posX + 32) << 1,
|
||||
(this->posY + 32) << 1, c * 2, (u16)(c & 4) * 64, (u16)(c >> 3) * 256, 512, 512);
|
||||
else
|
||||
gSPTextureRectangle(this->dlist++,
|
||||
this->posX, this->posY,
|
||||
this->posX + 32, this->posY + 32,
|
||||
c * 2,
|
||||
(u16)(c & 4) * 64, (u16)(c >> 3) * 256,
|
||||
1024, 1024);
|
||||
gSPTextureRectangle(this->dlist++, this->posX, this->posY, this->posX + 32, this->posY + 32, c * 2,
|
||||
(u16)(c & 4) * 64, (u16)(c >> 3) * 256, 1024, 1024);
|
||||
|
||||
this->posX += 32;
|
||||
}
|
||||
@@ -290,33 +269,24 @@ void GfxPrint_PrintCharImpl(GfxPrint* this, char c)
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/gfxprint/GfxPrint_PrintCharImpl.s")
|
||||
#endif
|
||||
|
||||
void GfxPrint_PrintChar(GfxPrint* this, u8 c)
|
||||
{
|
||||
void GfxPrint_PrintChar(GfxPrint* this, u8 c) {
|
||||
u8 charParam = c;
|
||||
|
||||
if (c == ' ')
|
||||
{
|
||||
if (c == ' ') {
|
||||
this->posX += 0x20;
|
||||
}
|
||||
else if (c > 0x20 && c < 0x7F)
|
||||
{
|
||||
} else if (c > 0x20 && c < 0x7F) {
|
||||
GfxPrint_PrintCharImpl(this, charParam);
|
||||
}
|
||||
else if (c >= 0xA0 && c < 0xE0)
|
||||
{
|
||||
if (this->flag & GFXPRINT_FLAG1)
|
||||
{
|
||||
if (c < 0xC0)
|
||||
} else if (c >= 0xA0 && c < 0xE0) {
|
||||
if (this->flag & GFXPRINT_FLAG1) {
|
||||
if (c < 0xC0) {
|
||||
charParam = c - 0x20;
|
||||
else
|
||||
} else {
|
||||
charParam = c + 0x20;
|
||||
}
|
||||
}
|
||||
GfxPrint_PrintCharImpl(this, charParam);
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (c)
|
||||
{
|
||||
} else {
|
||||
switch (c) {
|
||||
case 0:
|
||||
break;
|
||||
case '\n':
|
||||
@@ -325,8 +295,7 @@ void GfxPrint_PrintChar(GfxPrint* this, u8 c)
|
||||
this->posX = this->baseX;
|
||||
break;
|
||||
case '\t':
|
||||
do
|
||||
{
|
||||
do {
|
||||
GfxPrint_PrintCharImpl(this, 0x20);
|
||||
} while ((this->posX - this->baseX) % 256);
|
||||
break;
|
||||
@@ -351,32 +320,28 @@ void GfxPrint_PrintChar(GfxPrint* this, u8 c)
|
||||
}
|
||||
}
|
||||
|
||||
void GfxPrint_PrintStringWithSize(GfxPrint* this, const void* buffer, size_t charSize, size_t charCount)
|
||||
{
|
||||
void GfxPrint_PrintStringWithSize(GfxPrint* this, const void* buffer, size_t charSize, size_t charCount) {
|
||||
const char* str = (const char*)buffer;
|
||||
size_t count = charSize * charCount;
|
||||
|
||||
while (count)
|
||||
{
|
||||
while (count) {
|
||||
GfxPrint_PrintChar(this, *str++);
|
||||
count--;
|
||||
}
|
||||
}
|
||||
|
||||
void GfxPrint_PrintString(GfxPrint* this, const char* str)
|
||||
{
|
||||
while (*str)
|
||||
void GfxPrint_PrintString(GfxPrint* this, const char* str) {
|
||||
while (*str) {
|
||||
GfxPrint_PrintChar(this, *(str++));
|
||||
}
|
||||
}
|
||||
|
||||
GfxPrint* GfxPrint_Callback(GfxPrint* this, const char* str, size_t size)
|
||||
{
|
||||
GfxPrint* GfxPrint_Callback(GfxPrint* this, const char* str, size_t size) {
|
||||
GfxPrint_PrintStringWithSize(this, str, sizeof(char), size);
|
||||
return this;
|
||||
}
|
||||
|
||||
void GfxPrint_Ctor(GfxPrint* this)
|
||||
{
|
||||
void GfxPrint_Ctor(GfxPrint* this) {
|
||||
this->flag &= ~GFXPRINT_OPEN;
|
||||
|
||||
this->callback = &GfxPrint_Callback;
|
||||
@@ -392,31 +357,27 @@ void GfxPrint_Ctor(GfxPrint* this)
|
||||
this->flag |= GFXPRINT_FLAG4;
|
||||
this->flag |= GFXPRINT_UPDATE_MODE;
|
||||
|
||||
if ((D_801755F0 & GFXPRINT_FLAG64))
|
||||
if ((D_801755F0 & GFXPRINT_FLAG64)) {
|
||||
this->flag |= GFXPRINT_FLAG64; //? dsdx/dtdy
|
||||
else
|
||||
} else {
|
||||
this->flag &= ~GFXPRINT_FLAG64;
|
||||
}
|
||||
}
|
||||
|
||||
void GfxPrint_Dtor(GfxPrint* this)
|
||||
{
|
||||
|
||||
void GfxPrint_Dtor(GfxPrint* this) {
|
||||
}
|
||||
|
||||
void GfxPrint_Open(GfxPrint* this, Gfx* dlist)
|
||||
{
|
||||
if (!(this->flag & GFXPRINT_OPEN))
|
||||
{
|
||||
void GfxPrint_Open(GfxPrint* this, Gfx* dlist) {
|
||||
if (!(this->flag & GFXPRINT_OPEN)) {
|
||||
this->flag |= GFXPRINT_OPEN;
|
||||
this->dlist = dlist;
|
||||
GfxPrint_InitDlist(this);
|
||||
}
|
||||
else
|
||||
} else {
|
||||
osSyncPrintf("gfxprint_open:2重オープンです\n");
|
||||
}
|
||||
}
|
||||
|
||||
Gfx* GfxPrint_Close(GfxPrint* this)
|
||||
{
|
||||
Gfx* GfxPrint_Close(GfxPrint* this) {
|
||||
Gfx* ret;
|
||||
|
||||
this->flag &= ~GFXPRINT_OPEN;
|
||||
@@ -426,13 +387,11 @@ Gfx* GfxPrint_Close(GfxPrint* this)
|
||||
return ret;
|
||||
}
|
||||
|
||||
void GfxPrint_VPrintf(GfxPrint *this, const char *fmt, va_list args)
|
||||
{
|
||||
void GfxPrint_VPrintf(GfxPrint* this, const char* fmt, va_list args) {
|
||||
func_800FF340(&this->callback, fmt, args);
|
||||
}
|
||||
|
||||
void GfxPrint_Printf(GfxPrint* this, const char* fmt, ...)
|
||||
{
|
||||
void GfxPrint_Printf(GfxPrint* this, const char* fmt, ...) {
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
|
||||
|
||||
+81
-92
@@ -6,18 +6,17 @@ volatile OSTime sIrqMgrResetTime = 0;
|
||||
volatile OSTime sIrqMgrRetraceTime = 0;
|
||||
u32 sIrqMgrRetraceCount = 0;
|
||||
|
||||
#define RETRACE_MSG 666
|
||||
#define PRE_NMI_MSG 669
|
||||
#define PRENMI450_MSG 671
|
||||
#define PRENMI480_MSG 672
|
||||
#define PRENMI500_MSG 673
|
||||
#define RETRACE_MSG 666
|
||||
#define PRE_NMI_MSG 669
|
||||
#define PRENMI450_MSG 671
|
||||
#define PRENMI480_MSG 672
|
||||
#define PRENMI500_MSG 673
|
||||
|
||||
#define STATUS_IDLE 0
|
||||
#define STATUS_PRENMI 1
|
||||
#define STATUS_NMI 2
|
||||
#define STATUS_IDLE 0
|
||||
#define STATUS_PRENMI 1
|
||||
#define STATUS_NMI 2
|
||||
|
||||
void IrqMgr_AddClient(IrqMgr* this, IrqMgrClient* c, OSMesgQueue* msgQ)
|
||||
{
|
||||
void IrqMgr_AddClient(IrqMgr* this, IrqMgrClient* c, OSMesgQueue* msgQ) {
|
||||
u32 prevMask;
|
||||
|
||||
LogUtils_CheckNullPointer("this", this, "../irqmgr.c", 96);
|
||||
@@ -32,15 +31,16 @@ void IrqMgr_AddClient(IrqMgr* this, IrqMgrClient* c, OSMesgQueue* msgQ)
|
||||
|
||||
osSetIntMask(prevMask);
|
||||
|
||||
if (this->resetStatus > STATUS_IDLE)
|
||||
osSendMesg(c->queue, (OSMesg)&this->prenmiMsg, OS_MESG_NOBLOCK);
|
||||
if (this->resetStatus > STATUS_IDLE) {
|
||||
osSendMesg(c->queue, (OSMesg) & this->prenmiMsg, OS_MESG_NOBLOCK);
|
||||
}
|
||||
|
||||
if (this->resetStatus >= STATUS_NMI)
|
||||
osSendMesg(c->queue, (OSMesg)&this->nmiMsg, OS_MESG_NOBLOCK);
|
||||
if (this->resetStatus >= STATUS_NMI) {
|
||||
osSendMesg(c->queue, (OSMesg) & this->nmiMsg, OS_MESG_NOBLOCK);
|
||||
}
|
||||
}
|
||||
|
||||
void IrqMgr_RemoveClient(IrqMgr* this, IrqMgrClient* c)
|
||||
{
|
||||
void IrqMgr_RemoveClient(IrqMgr* this, IrqMgrClient* c) {
|
||||
IrqMgrClient* iter;
|
||||
IrqMgrClient* lastIter;
|
||||
u32 prevMask;
|
||||
@@ -50,17 +50,16 @@ void IrqMgr_RemoveClient(IrqMgr* this, IrqMgrClient* c)
|
||||
|
||||
LogUtils_CheckNullPointer("this", this, "../irqmgr.c", 129);
|
||||
LogUtils_CheckNullPointer("c", c, "../irqmgr.c", 130);
|
||||
|
||||
|
||||
prevMask = osSetIntMask(1);
|
||||
|
||||
while (iter)
|
||||
{
|
||||
if (iter == c)
|
||||
{
|
||||
if (lastIter)
|
||||
while (iter) {
|
||||
if (iter == c) {
|
||||
if (lastIter) {
|
||||
lastIter->prev = c->prev;
|
||||
else
|
||||
} else {
|
||||
this->clients = c->prev;
|
||||
}
|
||||
break;
|
||||
}
|
||||
lastIter = iter;
|
||||
@@ -70,160 +69,150 @@ void IrqMgr_RemoveClient(IrqMgr* this, IrqMgrClient* c)
|
||||
osSetIntMask(prevMask);
|
||||
}
|
||||
|
||||
void IrqMgr_SendMesgForClient(IrqMgr* this, OSMesg msg)
|
||||
{
|
||||
void IrqMgr_SendMesgForClient(IrqMgr* this, OSMesg msg) {
|
||||
IrqMgrClient* iter;
|
||||
|
||||
iter = this->clients;
|
||||
while(iter)
|
||||
{
|
||||
if (iter->queue->validCount >= iter->queue->msgCount)
|
||||
//irqmgr_SendMesgForClient: Message queue is overflowing mq=%08x cnt=%d
|
||||
osSyncPrintf(VT_COL(RED, WHITE) "irqmgr_SendMesgForClient:メッセージキューがあふれています mq=%08x cnt=%d\n" VT_RST, iter->queue, iter->queue->validCount);
|
||||
else
|
||||
while (iter) {
|
||||
if (iter->queue->validCount >= iter->queue->msgCount) {
|
||||
// irqmgr_SendMesgForClient: Message queue is overflowing mq=%08x cnt=%d
|
||||
osSyncPrintf(
|
||||
VT_COL(RED, WHITE) "irqmgr_SendMesgForClient:メッセージキューがあふれています mq=%08x cnt=%d\n" VT_RST,
|
||||
iter->queue, iter->queue->validCount);
|
||||
} else {
|
||||
osSendMesg(iter->queue, msg, OS_MESG_NOBLOCK);
|
||||
|
||||
}
|
||||
|
||||
iter = iter->prev;
|
||||
}
|
||||
}
|
||||
|
||||
void IrqMgr_JamMesgForClient(IrqMgr* this, OSMesg msg)
|
||||
{
|
||||
void IrqMgr_JamMesgForClient(IrqMgr* this, OSMesg msg) {
|
||||
IrqMgrClient* iter;
|
||||
|
||||
iter = this->clients;
|
||||
while(iter)
|
||||
{
|
||||
if (iter->queue->validCount >= iter->queue->msgCount)
|
||||
//irqmgr_JamMesgForClient: Message queue is overflowing mq=%08x cnt=%d
|
||||
osSyncPrintf(VT_COL(RED, WHITE) "irqmgr_JamMesgForClient:メッセージキューがあふれています mq=%08x cnt=%d\n" VT_RST, iter->queue, iter->queue->validCount);
|
||||
else
|
||||
//mistake? the function's name suggests it would use osJamMesg
|
||||
while (iter) {
|
||||
if (iter->queue->validCount >= iter->queue->msgCount) {
|
||||
// irqmgr_JamMesgForClient: Message queue is overflowing mq=%08x cnt=%d
|
||||
osSyncPrintf(
|
||||
VT_COL(RED, WHITE) "irqmgr_JamMesgForClient:メッセージキューがあふれています mq=%08x cnt=%d\n" VT_RST,
|
||||
iter->queue, iter->queue->validCount);
|
||||
} else {
|
||||
// mistake? the function's name suggests it would use osJamMesg
|
||||
osSendMesg(iter->queue, msg, OS_MESG_NOBLOCK);
|
||||
|
||||
}
|
||||
|
||||
iter = iter->prev;
|
||||
}
|
||||
}
|
||||
|
||||
void IrqMgr_HandlePreNMI(IrqMgr *this)
|
||||
{
|
||||
u64 temp = STATUS_PRENMI; //required to match
|
||||
void IrqMgr_HandlePreNMI(IrqMgr* this) {
|
||||
u64 temp = STATUS_PRENMI; // required to match
|
||||
gIrqMgrResetStatus = temp;
|
||||
this->resetStatus = STATUS_PRENMI;
|
||||
|
||||
sIrqMgrResetTime = this->resetTime = osGetTime();
|
||||
osSetTimer(&this->timer, OS_USEC_TO_CYCLES(450000), 0ull, &this->queue, (OSMesg)PRENMI450_MSG);
|
||||
IrqMgr_JamMesgForClient(this, (OSMesg)&this->prenmiMsg);
|
||||
IrqMgr_JamMesgForClient(this, (OSMesg) & this->prenmiMsg);
|
||||
}
|
||||
|
||||
void IrqMgr_CheckStack()
|
||||
{
|
||||
osSyncPrintf("irqmgr.c: PRENMIから0.5秒経過\n"); //0.5 seconds after PRENMI
|
||||
if (StackCheck_Check(NULL) == 0)
|
||||
{
|
||||
osSyncPrintf("スタックは大丈夫みたいです\n"); //The stack looks ok
|
||||
}
|
||||
else
|
||||
{
|
||||
void IrqMgr_CheckStack() {
|
||||
osSyncPrintf("irqmgr.c: PRENMIから0.5秒経過\n"); // 0.5 seconds after PRENMI
|
||||
if (StackCheck_Check(NULL) == 0) {
|
||||
osSyncPrintf("スタックは大丈夫みたいです\n"); // The stack looks ok
|
||||
} else {
|
||||
osSyncPrintf("%c", 7);
|
||||
osSyncPrintf(VT_FGCOL(RED));
|
||||
osSyncPrintf("スタックがオーバーフローしたか危険な状態です\n"); //Stack overflow or dangerous
|
||||
osSyncPrintf("早々にスタックサイズを増やすか、スタックを消費しないようにしてください\n"); //Increase stack size early or don't consume stack
|
||||
osSyncPrintf("スタックがオーバーフローしたか危険な状態です\n"); // Stack overflow or dangerous
|
||||
osSyncPrintf(
|
||||
"早々にスタックサイズを増やすか、スタックを消費しないようにしてください\n"); // Increase stack size early or
|
||||
// don't consume stack
|
||||
osSyncPrintf(VT_RST);
|
||||
}
|
||||
}
|
||||
|
||||
void IrqMgr_HandlePRENMI450(IrqMgr* this)
|
||||
{
|
||||
u64 temp = STATUS_NMI; //required to match
|
||||
void IrqMgr_HandlePRENMI450(IrqMgr* this) {
|
||||
u64 temp = STATUS_NMI; // required to match
|
||||
gIrqMgrResetStatus = temp;
|
||||
this->resetStatus = STATUS_NMI;
|
||||
osSetTimer(&this->timer, OS_USEC_TO_CYCLES(30000), 0ull, &this->queue, (OSMesg)PRENMI480_MSG);
|
||||
IrqMgr_SendMesgForClient(this, (OSMesg)&this->nmiMsg);
|
||||
IrqMgr_SendMesgForClient(this, (OSMesg) & this->nmiMsg);
|
||||
}
|
||||
|
||||
void IrqMgr_HandlePRENMI480(IrqMgr* this)
|
||||
{
|
||||
void IrqMgr_HandlePRENMI480(IrqMgr* this) {
|
||||
u32 ret;
|
||||
osSetTimer(&this->timer, OS_USEC_TO_CYCLES(20000), 0ull, &this->queue, (OSMesg)PRENMI500_MSG);
|
||||
ret = func_801031F0(); //osAfterPreNMI
|
||||
if (ret)
|
||||
{
|
||||
osSyncPrintf("osAfterPreNMIが %d を返しました!?\n", ret); //osAfterPreNMI returned %d !?
|
||||
ret = func_801031F0(); // osAfterPreNMI
|
||||
if (ret) {
|
||||
osSyncPrintf("osAfterPreNMIが %d を返しました!?\n", ret); // osAfterPreNMI returned %d !?
|
||||
osSetTimer(&this->timer, OS_USEC_TO_CYCLES(1000), 0ull, &this->queue, (OSMesg)PRENMI480_MSG);
|
||||
}
|
||||
}
|
||||
|
||||
void IrqMgr_HandlePRENMI500(IrqMgr* this)
|
||||
{
|
||||
void IrqMgr_HandlePRENMI500(IrqMgr* this) {
|
||||
IrqMgr_CheckStack();
|
||||
}
|
||||
|
||||
void IrqMgr_HandleRetrace(IrqMgr* this)
|
||||
{
|
||||
if (sIrqMgrRetraceTime == 0ull)
|
||||
{
|
||||
if (this->retraceTime == 0)
|
||||
void IrqMgr_HandleRetrace(IrqMgr* this) {
|
||||
if (sIrqMgrRetraceTime == 0ull) {
|
||||
if (this->retraceTime == 0) {
|
||||
this->retraceTime = osGetTime();
|
||||
else
|
||||
} else {
|
||||
sIrqMgrRetraceTime = osGetTime() - this->retraceTime;
|
||||
}
|
||||
}
|
||||
sIrqMgrRetraceCount++;
|
||||
IrqMgr_SendMesgForClient(this, (OSMesg)&this->retraceMsg);
|
||||
IrqMgr_SendMesgForClient(this, (OSMesg) & this->retraceMsg);
|
||||
}
|
||||
|
||||
void IrqMgr_ThreadEntry(void* arg0)
|
||||
{
|
||||
void IrqMgr_ThreadEntry(void* arg0) {
|
||||
OSMesg msg;
|
||||
IrqMgr* this;
|
||||
u8 exit;
|
||||
|
||||
this = (IrqMgr*)arg0;
|
||||
msg = 0;
|
||||
osSyncPrintf("IRQマネージャスレッド実行開始\n"); //Start IRQ manager thread execution
|
||||
osSyncPrintf("IRQマネージャスレッド実行開始\n"); // Start IRQ manager thread execution
|
||||
exit = false;
|
||||
|
||||
while (!exit)
|
||||
{
|
||||
while (!exit) {
|
||||
osRecvMesg(&this->queue, &msg, OS_MESG_BLOCK);
|
||||
switch ((u32)msg)
|
||||
{
|
||||
switch ((u32)msg) {
|
||||
case RETRACE_MSG:
|
||||
IrqMgr_HandleRetrace(this);
|
||||
break;
|
||||
case PRE_NMI_MSG:
|
||||
osSyncPrintf("PRE_NMI_MSG\n");
|
||||
osSyncPrintf("スケジューラ:PRE_NMIメッセージを受信\n"); //Scheduler: Receives PRE_NMI message
|
||||
osSyncPrintf("スケジューラ:PRE_NMIメッセージを受信\n"); // Scheduler: Receives PRE_NMI message
|
||||
IrqMgr_HandlePreNMI(this);
|
||||
break;
|
||||
case PRENMI450_MSG:
|
||||
osSyncPrintf("PRENMI450_MSG\n");
|
||||
osSyncPrintf("スケジューラ:PRENMI450メッセージを受信\n"); //Scheduler: Receives PRENMI450 message
|
||||
osSyncPrintf("スケジューラ:PRENMI450メッセージを受信\n"); // Scheduler: Receives PRENMI450 message
|
||||
IrqMgr_HandlePRENMI450(this);
|
||||
break;
|
||||
case PRENMI480_MSG:
|
||||
osSyncPrintf("PRENMI480_MSG\n");
|
||||
osSyncPrintf("スケジューラ:PRENMI480メッセージを受信\n"); //Scheduler: Receives PRENMI480 message
|
||||
osSyncPrintf("スケジューラ:PRENMI480メッセージを受信\n"); // Scheduler: Receives PRENMI480 message
|
||||
IrqMgr_HandlePRENMI480(this);
|
||||
break;
|
||||
case PRENMI500_MSG:
|
||||
osSyncPrintf("PRENMI500_MSG\n");
|
||||
osSyncPrintf("スケジューラ:PRENMI500メッセージを受信\n"); //Scheduler: Receives PRENMI500 message
|
||||
osSyncPrintf("スケジューラ:PRENMI500メッセージを受信\n"); // Scheduler: Receives PRENMI500 message
|
||||
exit = true;
|
||||
IrqMgr_HandlePRENMI500(this);
|
||||
break;
|
||||
default:
|
||||
osSyncPrintf("irqmgr.c:予期しないメッセージを受け取りました(%08x)\n", msg); //Unexpected message received
|
||||
osSyncPrintf("irqmgr.c:予期しないメッセージを受け取りました(%08x)\n",
|
||||
msg); // Unexpected message received
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
osSyncPrintf("IRQマネージャスレッド実行終了\n"); //End of IRQ manager thread execution
|
||||
osSyncPrintf("IRQマネージャスレッド実行終了\n"); // End of IRQ manager thread execution
|
||||
}
|
||||
|
||||
void IrqMgr_Create(IrqMgr* this, void* stack, OSPri pri, u8 retraceCount)
|
||||
{
|
||||
void IrqMgr_Create(IrqMgr* this, void* stack, OSPri pri, u8 retraceCount) {
|
||||
LogUtils_CheckNullPointer("this", this, "../irqmgr.c", 346);
|
||||
LogUtils_CheckNullPointer("stack", stack, "../irqmgr.c", 347);
|
||||
this->clients = NULL;
|
||||
|
||||
+21
-19
@@ -1,64 +1,66 @@
|
||||
#include <global.h>
|
||||
|
||||
ListAlloc* ListAlloc_Init(ListAlloc* this)
|
||||
{
|
||||
ListAlloc* ListAlloc_Init(ListAlloc* this) {
|
||||
this->prev = NULL;
|
||||
this->next = NULL;
|
||||
return this;
|
||||
}
|
||||
|
||||
void* ListAlloc_Alloc(ListAlloc* this, u32 size)
|
||||
{
|
||||
void* ListAlloc_Alloc(ListAlloc* this, u32 size) {
|
||||
ListAlloc* ptr;
|
||||
ListAlloc* next;
|
||||
|
||||
|
||||
ptr = SystemArena_MallocDebug(size + sizeof(ListAlloc), "../listalloc.c", 40);
|
||||
if (!ptr)
|
||||
if (!ptr) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
next = this->next;
|
||||
|
||||
if (next)
|
||||
if (next) {
|
||||
next->next = ptr;
|
||||
|
||||
}
|
||||
|
||||
ptr->prev = next;
|
||||
ptr->next = NULL;
|
||||
this->next = ptr;
|
||||
|
||||
if (!this->prev)
|
||||
if (!this->prev) {
|
||||
this->prev = ptr;
|
||||
}
|
||||
|
||||
return (u8*)ptr + sizeof(ListAlloc);
|
||||
}
|
||||
|
||||
void ListAlloc_Free(ListAlloc* this, void* data)
|
||||
{
|
||||
void ListAlloc_Free(ListAlloc* this, void* data) {
|
||||
ListAlloc* ptr;
|
||||
|
||||
ptr = &((ListAlloc*)data)[-1];
|
||||
|
||||
if (ptr->prev)
|
||||
if (ptr->prev) {
|
||||
ptr->prev->next = ptr->next;
|
||||
}
|
||||
|
||||
if (ptr->next)
|
||||
if (ptr->next) {
|
||||
ptr->next->prev = ptr->prev;
|
||||
}
|
||||
|
||||
if (this->prev == ptr)
|
||||
if (this->prev == ptr) {
|
||||
this->prev = ptr->next;
|
||||
}
|
||||
|
||||
if (this->next == ptr)
|
||||
if (this->next == ptr) {
|
||||
this->next = ptr->prev;
|
||||
}
|
||||
|
||||
SystemArena_FreeDebug(ptr, "../listalloc.c", 72);
|
||||
}
|
||||
|
||||
void ListAlloc_FreeAll(ListAlloc* this)
|
||||
{
|
||||
void ListAlloc_FreeAll(ListAlloc* this) {
|
||||
ListAlloc* iter;
|
||||
|
||||
iter = this->prev;
|
||||
while (iter)
|
||||
{
|
||||
while (iter) {
|
||||
ListAlloc_Free(this, (u8*)iter + sizeof(ListAlloc));
|
||||
iter = this->prev;
|
||||
}
|
||||
|
||||
@@ -1,20 +1,18 @@
|
||||
#include <global.h>
|
||||
|
||||
void *Overlay_AllocateAndLoad(u32 vRomStart, u32 vRomEnd, void *vRamStart, void *vRamEnd)
|
||||
{
|
||||
void *allocatedVRamAddr;
|
||||
void* Overlay_AllocateAndLoad(u32 vRomStart, u32 vRomEnd, void* vRamStart, void* vRamEnd) {
|
||||
void* allocatedVRamAddr;
|
||||
|
||||
allocatedVRamAddr = SystemArena_MallocRDebug((s32)vRamEnd - (s32)vRamStart, "../loadfragment2.c", 31);
|
||||
|
||||
if(gOverlayLogSeverity >= 3)
|
||||
{
|
||||
osSyncPrintf("OVL:SPEC(%08x-%08x) REAL(%08x-%08x) OFFSET(%08x)\n", vRamStart, vRamEnd, allocatedVRamAddr, ((u32)vRamEnd - (u32)vRamStart) + (u32)allocatedVRamAddr, (u32)vRamStart - (u32)allocatedVRamAddr);
|
||||
if (gOverlayLogSeverity >= 3) {
|
||||
osSyncPrintf("OVL:SPEC(%08x-%08x) REAL(%08x-%08x) OFFSET(%08x)\n", vRamStart, vRamEnd, allocatedVRamAddr,
|
||||
((u32)vRamEnd - (u32)vRamStart) + (u32)allocatedVRamAddr, (u32)vRamStart - (u32)allocatedVRamAddr);
|
||||
}
|
||||
|
||||
if(allocatedVRamAddr != NULL)
|
||||
{
|
||||
if (allocatedVRamAddr != NULL) {
|
||||
Overlay_Load(vRomStart, vRomEnd, vRamStart, vRamEnd, allocatedVRamAddr);
|
||||
}
|
||||
|
||||
return allocatedVRamAddr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
#include <global.h>
|
||||
|
||||
s32 gOverlayLogSeverity = 2;
|
||||
s32 gOverlayLogSeverity = 2;
|
||||
|
||||
+28
-34
@@ -23,21 +23,19 @@ StackEntry sSchedStackInfo;
|
||||
StackEntry sAudioStackInfo;
|
||||
StackEntry sPadMgrStackInfo;
|
||||
StackEntry sIrqMgrStackInfo;
|
||||
u8 gAudioMgr[0x298]; //type should be AudioMgr
|
||||
u8 gAudioMgr[0x298]; // type should be AudioMgr
|
||||
OSMesgQueue sSiIntMsgQ;
|
||||
OSMesg sSiIntMsgBuf[1];
|
||||
|
||||
|
||||
void Main_LogSystemHeap()
|
||||
{
|
||||
void Main_LogSystemHeap() {
|
||||
osSyncPrintf(VT_FGCOL(GREEN));
|
||||
//System heap size% 08x (% dKB) Start address% 08x
|
||||
osSyncPrintf("システムヒープサイズ %08x(%dKB) 開始アドレス %08x\n", gSystemHeapSize, gSystemHeapSize / 1024, gSystemHeap);
|
||||
// System heap size% 08x (% dKB) Start address% 08x
|
||||
osSyncPrintf("システムヒープサイズ %08x(%dKB) 開始アドレス %08x\n", gSystemHeapSize, gSystemHeapSize / 1024,
|
||||
gSystemHeap);
|
||||
osSyncPrintf(VT_RST);
|
||||
}
|
||||
|
||||
void Main(void* arg0)
|
||||
{
|
||||
void Main(void* arg0) {
|
||||
IrqMgrClient irqClient;
|
||||
OSMesgQueue irqMgrMsgQ;
|
||||
OSMesg irqMgrMsgBuf[60];
|
||||
@@ -45,9 +43,9 @@ void Main(void* arg0)
|
||||
u32 fb;
|
||||
s32 debugHeap;
|
||||
s32 debugHeapSize;
|
||||
s16 *msg;
|
||||
s16* msg;
|
||||
|
||||
osSyncPrintf("mainproc 実行開始\n"); //Start running
|
||||
osSyncPrintf("mainproc 実行開始\n"); // Start running
|
||||
gScreenWidth = SCREEN_WIDTH;
|
||||
gScreenHeight = SCREEN_HEIGHT;
|
||||
gAppNmiBufferPtr = (PreNmiBuff*)osAppNmiBuffer;
|
||||
@@ -57,15 +55,12 @@ void Main(void* arg0)
|
||||
sysHeap = (u32)gSystemHeap;
|
||||
fb = SysCfb_GetFbPtr(0);
|
||||
gSystemHeapSize = (fb - sysHeap);
|
||||
osSyncPrintf("システムヒープ初期化 %08x-%08x %08x\n", sysHeap, fb, gSystemHeapSize); //System heap initalization
|
||||
SystemHeap_Init(sysHeap, gSystemHeapSize); //initializes the system heap
|
||||
if (osMemSize >= 0x800000U)
|
||||
{
|
||||
osSyncPrintf("システムヒープ初期化 %08x-%08x %08x\n", sysHeap, fb, gSystemHeapSize); // System heap initalization
|
||||
SystemHeap_Init(sysHeap, gSystemHeapSize); // initializes the system heap
|
||||
if (osMemSize >= 0x800000U) {
|
||||
debugHeap = SysCfb_GetFbEnd();
|
||||
debugHeapSize = (s32) (0x80600000 - debugHeap);
|
||||
}
|
||||
else
|
||||
{
|
||||
debugHeapSize = (s32)(0x80600000 - debugHeap);
|
||||
} else {
|
||||
debugHeapSize = 0x400;
|
||||
debugHeap = SystemArena_MallocDebug(debugHeapSize, "../main.c", 0x235);
|
||||
}
|
||||
@@ -81,43 +76,42 @@ void Main(void* arg0)
|
||||
Main_LogSystemHeap();
|
||||
|
||||
osCreateMesgQueue(&irqMgrMsgQ, irqMgrMsgBuf, 0x3c);
|
||||
StackCheck_Init(&sIrqMgrStackInfo, sIrqMgrStack, sIrqMgrStack+sizeof(sIrqMgrStack), 0, 0x100, "irqmgr");
|
||||
StackCheck_Init(&sIrqMgrStackInfo, sIrqMgrStack, sIrqMgrStack + sizeof(sIrqMgrStack), 0, 0x100, "irqmgr");
|
||||
IrqMgr_Create(&gIrqMgr, &sGraphStackInfo, 0x11, 1);
|
||||
|
||||
osSyncPrintf("タスクスケジューラの初期化\n"); //Initialize the task scheduler
|
||||
StackCheck_Init(&sSchedStackInfo, sSchedStack, sSchedStack+sizeof(sSchedStack), 0, 0x100, "sched");
|
||||
osSyncPrintf("タスクスケジューラの初期化\n"); // Initialize the task scheduler
|
||||
StackCheck_Init(&sSchedStackInfo, sSchedStack, sSchedStack + sizeof(sSchedStack), 0, 0x100, "sched");
|
||||
func_800C9874(&gSchedContext, &sAudioStack, 0xf, D_80013960, 1, &gIrqMgr);
|
||||
|
||||
IrqMgr_AddClient(&gIrqMgr, &irqClient, &irqMgrMsgQ);
|
||||
|
||||
StackCheck_Init(&sAudioStackInfo, sAudioStack, sAudioStack+sizeof(sAudioStack), 0, 0x100, "audio");
|
||||
func_800C3FEC(&gAudioMgr, sAudioStack+sizeof(sAudioStack), 0xc, 0xa, &gSchedContext, &gIrqMgr);
|
||||
StackCheck_Init(&sAudioStackInfo, sAudioStack, sAudioStack + sizeof(sAudioStack), 0, 0x100, "audio");
|
||||
func_800C3FEC(&gAudioMgr, sAudioStack + sizeof(sAudioStack), 0xc, 0xa, &gSchedContext, &gIrqMgr);
|
||||
|
||||
StackCheck_Init(&sPadMgrStackInfo, sPadMgrStack, sPadMgrStack+sizeof(sPadMgrStack), 0, 0x100, "padmgr");
|
||||
StackCheck_Init(&sPadMgrStackInfo, sPadMgrStack, sPadMgrStack + sizeof(sPadMgrStack), 0, 0x100, "padmgr");
|
||||
PadMgr_Init(&gPadMgr, &sSiIntMsgQ, &gIrqMgr, 7, 0xe, &sIrqMgrStack);
|
||||
|
||||
func_800C3FC4(&gAudioMgr);
|
||||
|
||||
StackCheck_Init(&sGraphStackInfo, sGraphStack, sGraphStack+sizeof(sGraphStack), 0, 0x100, "graph");
|
||||
osCreateThread(&sGraphThread, 4, Graph_ThreadEntry, arg0, sGraphStack+sizeof(sGraphStack), 0xb);
|
||||
StackCheck_Init(&sGraphStackInfo, sGraphStack, sGraphStack + sizeof(sGraphStack), 0, 0x100, "graph");
|
||||
osCreateThread(&sGraphThread, 4, Graph_ThreadEntry, arg0, sGraphStack + sizeof(sGraphStack), 0xb);
|
||||
osStartThread(&sGraphThread);
|
||||
osSetThreadPri(0, 0xf);
|
||||
|
||||
while (true)
|
||||
{
|
||||
while (true) {
|
||||
msg = NULL;
|
||||
osRecvMesg(&irqMgrMsgQ, &msg, OS_MESG_BLOCK);
|
||||
if (msg == NULL)
|
||||
if (msg == NULL) {
|
||||
break;
|
||||
if (*msg == OS_SC_PRE_NMI_MSG)
|
||||
{
|
||||
osSyncPrintf("main.c: リセットされたみたいだよ\n"); //Looks like it's been reset
|
||||
}
|
||||
if (*msg == OS_SC_PRE_NMI_MSG) {
|
||||
osSyncPrintf("main.c: リセットされたみたいだよ\n"); // Looks like it's been reset
|
||||
PreNmiBuff_SetReset(gAppNmiBufferPtr);
|
||||
}
|
||||
}
|
||||
|
||||
osSyncPrintf("mainproc 後始末\n"); //Cleanup
|
||||
osSyncPrintf("mainproc 後始末\n"); // Cleanup
|
||||
osDestroyThread(&sGraphThread);
|
||||
func_800FBFD8();
|
||||
osSyncPrintf("mainproc 実行終了\n"); //End of execution
|
||||
osSyncPrintf("mainproc 実行終了\n"); // End of execution
|
||||
}
|
||||
|
||||
+76
-109
@@ -8,50 +8,53 @@
|
||||
|
||||
s32 D_8012D280 = 1;
|
||||
|
||||
OSMesgQueue* PadMgr_LockGetControllerQueue(PadMgr* padmgr)
|
||||
{
|
||||
OSMesgQueue* PadMgr_LockGetControllerQueue(PadMgr* padmgr) {
|
||||
OSMesgQueue* ctrlrqueue = NULL;
|
||||
|
||||
if (D_8012D280 > 2)
|
||||
//EUC-JP: ロック待ち | Waiting for lock
|
||||
osSyncPrintf("%2d %d serialMsgQロック待ち %08x %08x %08x\n", osGetThreadId(NULL), padmgr->queue1.validCount, padmgr, &padmgr->queue1, &ctrlrqueue);
|
||||
if (D_8012D280 > 2) {
|
||||
// EUC-JP: ロック待ち | Waiting for lock
|
||||
osSyncPrintf("%2d %d serialMsgQロック待ち %08x %08x %08x\n", osGetThreadId(NULL),
|
||||
padmgr->queue1.validCount, padmgr, &padmgr->queue1, &ctrlrqueue);
|
||||
}
|
||||
|
||||
osRecvMesg(&padmgr->queue1, &ctrlrqueue, OS_MESG_BLOCK);
|
||||
|
||||
if (D_8012D280 > 2)
|
||||
//EUC-JP: をロックしました | Locked
|
||||
osSyncPrintf("%2d %d serialMsgQをロックしました %08x\n", osGetThreadId(NULL), padmgr->queue1.validCount, ctrlrqueue);
|
||||
if (D_8012D280 > 2) {
|
||||
// EUC-JP: をロックしました | Locked
|
||||
osSyncPrintf("%2d %d serialMsgQをロックしました %08x\n", osGetThreadId(NULL),
|
||||
padmgr->queue1.validCount, ctrlrqueue);
|
||||
}
|
||||
|
||||
return ctrlrqueue;
|
||||
}
|
||||
|
||||
void PadMgr_UnlockReleaseControllerQueue(PadMgr* padmgr, OSMesgQueue* ctrlrqueue)
|
||||
{
|
||||
if (D_8012D280 > 2)
|
||||
//EUC-JP: ロック解除します | Unlock
|
||||
osSyncPrintf("%2d %d serialMsgQロック解除します %08x %08x %08x\n", osGetThreadId(NULL), padmgr->queue1.validCount, padmgr, &padmgr->queue1, ctrlrqueue);
|
||||
void PadMgr_UnlockReleaseControllerQueue(PadMgr* padmgr, OSMesgQueue* ctrlrqueue) {
|
||||
if (D_8012D280 > 2) {
|
||||
// EUC-JP: ロック解除します | Unlock
|
||||
osSyncPrintf("%2d %d serialMsgQロック解除します %08x %08x %08x\n", osGetThreadId(NULL),
|
||||
padmgr->queue1.validCount, padmgr, &padmgr->queue1, ctrlrqueue);
|
||||
}
|
||||
|
||||
osSendMesg(&padmgr->queue1, ctrlrqueue, OS_MESG_BLOCK);
|
||||
|
||||
if (D_8012D280 > 2)
|
||||
//EUC-JP: ロック解除しました | Unlocked
|
||||
osSyncPrintf("%2d %d serialMsgQロック解除しました %08x %08x %08x\n", osGetThreadId(NULL), padmgr->queue1.validCount, padmgr, &padmgr->queue1, ctrlrqueue);
|
||||
if (D_8012D280 > 2) {
|
||||
// EUC-JP: ロック解除しました | Unlocked
|
||||
osSyncPrintf("%2d %d serialMsgQロック解除しました %08x %08x %08x\n", osGetThreadId(NULL),
|
||||
padmgr->queue1.validCount, padmgr, &padmgr->queue1, ctrlrqueue);
|
||||
}
|
||||
}
|
||||
|
||||
void PadMgr_Lock2(PadMgr* padmgr)
|
||||
{
|
||||
void PadMgr_Lock2(PadMgr* padmgr) {
|
||||
osRecvMesg(&padmgr->queue2, NULL, OS_MESG_BLOCK);
|
||||
}
|
||||
|
||||
void PadMgr_Unlock2(PadMgr* padmgr)
|
||||
{
|
||||
void PadMgr_Unlock2(PadMgr* padmgr) {
|
||||
osSendMesg(&padmgr->queue2, NULL, OS_MESG_BLOCK);
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// regalloc and minor ordering differences
|
||||
void func_800C740C(PadMgr* padmgr)
|
||||
{
|
||||
void func_800C740C(PadMgr* padmgr) {
|
||||
static u32 D_8012D284 = 0;
|
||||
static u32 D_8016A4F0;
|
||||
s32 temp;
|
||||
@@ -65,54 +68,39 @@ void func_800C740C(PadMgr* padmgr)
|
||||
ctrlrqueue = PadMgr_LockGetControllerQueue(padmgr);
|
||||
var1 = 0;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
if (padmgr->unk_2AA[i] != 0)
|
||||
{
|
||||
if (padmgr->pad_status[i].status & 1)
|
||||
{
|
||||
if (padmgr->unk_2AE[i] == temp)
|
||||
{
|
||||
if (padmgr->unk_2B2[i] != 0)
|
||||
{
|
||||
if (padmgr->unk_2B6[i] < 3)
|
||||
{
|
||||
for (i = 0; i < 4; i++) {
|
||||
if (padmgr->unk_2AA[i] != 0) {
|
||||
if (padmgr->pad_status[i].status & 1) {
|
||||
if (padmgr->unk_2AE[i] == temp) {
|
||||
if (padmgr->unk_2B2[i] != 0) {
|
||||
if (padmgr->unk_2B6[i] < 3) {
|
||||
osSyncPrintf(VT_FGCOL(YELLOW));
|
||||
osSyncPrintf("padmgr: %dコン: %s\n", i + 1, "振動パック ぶるぶるぶるぶる");
|
||||
osSyncPrintf(VT_RST);
|
||||
|
||||
if (osSetVibration(&padmgr->unk_controller[i], temp) != 0)
|
||||
{
|
||||
if (osSetVibration(&padmgr->unk_controller[i], temp) != 0) {
|
||||
padmgr->unk_2AE[i] = 0;
|
||||
osSyncPrintf(VT_FGCOL(YELLOW));
|
||||
osSyncPrintf("padmgr: %dコン: %s\n", i + 1, "振動パックで通信エラーが発生しました");
|
||||
osSyncPrintf(VT_RST);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
padmgr->unk_2B6[i] = 3;
|
||||
}
|
||||
|
||||
var1 = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (padmgr->unk_2B6[i] != 0)
|
||||
{
|
||||
} else {
|
||||
if (padmgr->unk_2B6[i] != 0) {
|
||||
osSyncPrintf(VT_FGCOL(YELLOW));
|
||||
osSyncPrintf("padmgr: %dコン: %s\n", i + 1, "振動パック 停止");
|
||||
osSyncPrintf(VT_RST);
|
||||
|
||||
if (osSetVibration(&padmgr->unk_controller[i], 0) != 0)
|
||||
{
|
||||
if (osSetVibration(&padmgr->unk_controller[i], 0) != 0) {
|
||||
padmgr->unk_2AE[i] = 0;
|
||||
osSyncPrintf(VT_FGCOL(YELLOW));
|
||||
osSyncPrintf("padmgr: %dコン: %s\n", i + 1, "振動パックで通信エラーが発生しました");
|
||||
osSyncPrintf(VT_RST);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
padmgr->unk_2B6[i]--;
|
||||
}
|
||||
|
||||
@@ -120,22 +108,17 @@ void func_800C740C(PadMgr* padmgr)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (padmgr->unk_2AE[i] != 0)
|
||||
{
|
||||
if (padmgr->unk_2AE[i] == 1)
|
||||
{
|
||||
} else {
|
||||
if (padmgr->unk_2AE[i] != 0) {
|
||||
if (padmgr->unk_2AE[i] == 1) {
|
||||
osSyncPrintf(VT_FGCOL(YELLOW));
|
||||
osSyncPrintf("padmgr: %dコン: %s\n", i + 1, "振動パックが抜かれたようです");
|
||||
osSyncPrintf(VT_RST);
|
||||
padmgr->unk_2AE[i] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
osSyncPrintf(VT_FGCOL(YELLOW));
|
||||
osSyncPrintf("padmgr: %dコン: %s\n", i + 1, "振動パックではないコントローラパックが抜かれたようです");
|
||||
osSyncPrintf("padmgr: %dコン: %s\n", i + 1,
|
||||
"振動パックではないコントローラパックが抜かれたようです");
|
||||
osSyncPrintf(VT_RST);
|
||||
padmgr->unk_2AE[i] = 0;
|
||||
}
|
||||
@@ -144,29 +127,22 @@ void func_800C740C(PadMgr* padmgr)
|
||||
}
|
||||
}
|
||||
|
||||
if (!var1)
|
||||
{
|
||||
if (!var1) {
|
||||
var3 = D_8016A4F0 % 4;
|
||||
|
||||
if ((padmgr->unk_2AA[var3] != 0) && (padmgr->pad_status[var3].status & 1) && (padmgr->unk_2AE[var3] != 1))
|
||||
{
|
||||
if ((padmgr->unk_2AA[var3] != 0) && (padmgr->pad_status[var3].status & 1) && (padmgr->unk_2AE[var3] != 1)) {
|
||||
var4 = osProbeVibrationPack(ctrlrqueue, &padmgr->unk_controller[var3], var3);
|
||||
|
||||
if (var4 == 0)
|
||||
{
|
||||
if (var4 == 0) {
|
||||
padmgr->unk_2AE[var3] = 1;
|
||||
osSetVibration(&padmgr->unk_controller[var3], 1);
|
||||
osSetVibration(&padmgr->unk_controller[var3], 0);
|
||||
osSyncPrintf(VT_FGCOL(YELLOW));
|
||||
osSyncPrintf("padmgr: %dコン: %s\n", var3 + 1, "振動パックを認識しました");
|
||||
osSyncPrintf(VT_RST);
|
||||
}
|
||||
else if (var4 == 11)
|
||||
{
|
||||
} else if (var4 == 11) {
|
||||
padmgr->unk_2AE[var3] = 2;
|
||||
}
|
||||
else if (var4 == 4)
|
||||
{
|
||||
} else if (var4 == 4) {
|
||||
LogUtils_LogThreadId("../padmgr.c", 282);
|
||||
osSyncPrintf("++errcnt = %d\n", ++D_8012D284);
|
||||
osSyncPrintf(VT_FGCOL(YELLOW));
|
||||
@@ -185,22 +161,18 @@ u32 D_8016A4F0;
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/padmgr/func_800C740C.s")
|
||||
#endif
|
||||
|
||||
//func_800A2300 in 1.0
|
||||
void func_800C7818(PadMgr* padmgr)
|
||||
{
|
||||
// func_800A2300 in 1.0
|
||||
void func_800C7818(PadMgr* padmgr) {
|
||||
s32 i;
|
||||
OSMesgQueue* ctrlrqueue;
|
||||
|
||||
ctrlrqueue = PadMgr_LockGetControllerQueue(padmgr);
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
if (osProbeVibrationPack(ctrlrqueue, &padmgr->unk_controller[i], i) == 0)
|
||||
{
|
||||
if ((gFaultStruct.msgId == 0) && (padmgr->unk_45D != 0))
|
||||
{
|
||||
for (i = 0; i < 4; i++) {
|
||||
if (osProbeVibrationPack(ctrlrqueue, &padmgr->unk_controller[i], i) == 0) {
|
||||
if ((gFaultStruct.msgId == 0) && (padmgr->unk_45D != 0)) {
|
||||
osSyncPrintf(VT_FGCOL(YELLOW));
|
||||
//EUC-JP: コン | 'Con'? , EUC-JP: 振動パック 停止 | Stop vibration pack
|
||||
// EUC-JP: コン | 'Con'? , EUC-JP: 振動パック 停止 | Stop vibration pack
|
||||
osSyncPrintf("padmgr: %dコン: %s\n", i + 1, "振動パック 停止");
|
||||
osSyncPrintf(VT_RST);
|
||||
}
|
||||
@@ -212,13 +184,11 @@ void func_800C7818(PadMgr* padmgr)
|
||||
PadMgr_UnlockReleaseControllerQueue(padmgr, ctrlrqueue);
|
||||
}
|
||||
|
||||
void func_800C7928(PadMgr* padmgr)
|
||||
{
|
||||
void func_800C7928(PadMgr* padmgr) {
|
||||
padmgr->unk_45C = 3;
|
||||
}
|
||||
|
||||
void func_800C7934(PadMgr* padmgr, u32 a1, u32 a2)
|
||||
{
|
||||
void func_800C7934(PadMgr* padmgr, u32 a1, u32 a2) {
|
||||
padmgr->unk_2B2[a1] = a2;
|
||||
padmgr->unk_45D = 0xF0;
|
||||
}
|
||||
@@ -226,8 +196,7 @@ void func_800C7934(PadMgr* padmgr, u32 a1, u32 a2)
|
||||
#ifdef NON_MATCHING
|
||||
// minor ordering difference
|
||||
// 800A23CC in 1.0
|
||||
void func_800C7948(PadMgr* padmgr, u8* a1)
|
||||
{
|
||||
void func_800C7948(PadMgr* padmgr, u8* a1) {
|
||||
padmgr->unk_2B2[0] = a1[0];
|
||||
padmgr->unk_2B2[1] = a1[1];
|
||||
padmgr->unk_2B2[2] = a1[2];
|
||||
@@ -243,46 +212,45 @@ void func_800C7948(PadMgr* padmgr, u8* a1)
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/padmgr/func_800C7C14.s")
|
||||
|
||||
void func_800C7DD0(PadMgr* padmgr)
|
||||
{
|
||||
void func_800C7DD0(PadMgr* padmgr) {
|
||||
osSyncPrintf("padmgr_HandlePreNMI()\n");
|
||||
padmgr->unk_45E = 1;
|
||||
func_800C7928(padmgr);
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/padmgr/func_800C7E08.s")
|
||||
//void func_800C7E08(Input*, u32);
|
||||
// void func_800C7E08(Input*, u32);
|
||||
|
||||
//800A2918 in 1.0
|
||||
void PadMgr_Run(PadMgr* padmgr)
|
||||
{
|
||||
// 800A2918 in 1.0
|
||||
void PadMgr_Run(PadMgr* padmgr) {
|
||||
s16* mesg;
|
||||
s32 bVar2;
|
||||
|
||||
mesg = NULL;
|
||||
//EUC-JP: コントローラスレッド実行開始 | Start of controller thread execution
|
||||
// EUC-JP: コントローラスレッド実行開始 | Start of controller thread execution
|
||||
osSyncPrintf("コントローラスレッド実行開始\n");
|
||||
bVar2 = 0;
|
||||
|
||||
while (bVar2 == 0)
|
||||
{
|
||||
if ((D_8012D280 > 2) && (padmgr->queue3.validCount == 0))
|
||||
//EUC-JP: コントローラスレッドイベント待ち | Waiting for controller thread event
|
||||
osSyncPrintf("コントローラスレッドイベント待ち %lld\n" , (osGetTime() * 64) / 3000);
|
||||
while (bVar2 == 0) {
|
||||
if ((D_8012D280 > 2) && (padmgr->queue3.validCount == 0)) {
|
||||
// EUC-JP: コントローラスレッドイベント待ち | Waiting for controller thread event
|
||||
osSyncPrintf("コントローラスレッドイベント待ち %lld\n", (osGetTime() * 64) / 3000);
|
||||
}
|
||||
|
||||
osRecvMesg(&padmgr->queue3, &mesg, OS_MESG_BLOCK);
|
||||
LogUtils_CheckNullPointer("msg", mesg, "../padmgr.c", 563);
|
||||
|
||||
switch (*mesg)
|
||||
{
|
||||
switch (*mesg) {
|
||||
case OS_SC_RETRACE_MSG:
|
||||
if (D_8012D280 > 2)
|
||||
if (D_8012D280 > 2) {
|
||||
osSyncPrintf("padmgr_HandleRetraceMsg START %lld\n", (osGetTime() * 64) / 3000);
|
||||
}
|
||||
|
||||
func_800C7C14(padmgr);
|
||||
|
||||
if (D_8012D280 > 2)
|
||||
if (D_8012D280 > 2) {
|
||||
osSyncPrintf("padmgr_HandleRetraceMsg END %lld\n", (osGetTime() * 64) / 3000);
|
||||
}
|
||||
|
||||
break;
|
||||
case OS_SC_PRE_NMI_MSG:
|
||||
@@ -295,14 +263,13 @@ void PadMgr_Run(PadMgr* padmgr)
|
||||
}
|
||||
|
||||
IrqMgr_RemoveClient(padmgr->unk_78, &padmgr->unk_70);
|
||||
//EUC-JP: コントローラスレッド実行終了 | Controller thread execution end
|
||||
// EUC-JP: コントローラスレッド実行終了 | Controller thread execution end
|
||||
osSyncPrintf("コントローラスレッド実行終了\n");
|
||||
}
|
||||
|
||||
//func_800A2A14 in 1.0
|
||||
void PadMgr_Init(PadMgr* padmgr, OSMesgQueue* ctrlrqueue, UNK_TYPE arg2, OSId id, OSPri priority, void* stack)
|
||||
{
|
||||
//EUC-JP: パッドマネージャ作成 | Create pad manager
|
||||
// func_800A2A14 in 1.0
|
||||
void PadMgr_Init(PadMgr* padmgr, OSMesgQueue* ctrlrqueue, UNK_TYPE arg2, OSId id, OSPri priority, void* stack) {
|
||||
// EUC-JP: パッドマネージャ作成 | Create pad manager
|
||||
osSyncPrintf("パッドマネージャ作成 padmgr_Create()\n");
|
||||
bzero(padmgr, sizeof(PadMgr));
|
||||
padmgr->unk_78 = arg2;
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
#include <global.h>
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/relocation/Overlay_DoRelocation.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/relocation/Overlay_DoRelocation.s")
|
||||
|
||||
+31
-36
@@ -4,14 +4,13 @@
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sched/func_800C82A0.s")
|
||||
|
||||
void func_800C84E4(SchedContext* sc, UNK_TYPE arg1)
|
||||
{
|
||||
if (sc->unk_24C != 0)
|
||||
{
|
||||
void func_800C84E4(SchedContext* sc, UNK_TYPE arg1) {
|
||||
if (sc->unk_24C != 0) {
|
||||
sc->unk_24C = 0;
|
||||
|
||||
if (gIrqMgrResetStatus == 0)
|
||||
if (gIrqMgrResetStatus == 0) {
|
||||
ViConfig_UpdateVi(0);
|
||||
}
|
||||
}
|
||||
|
||||
func_800C82A0(arg1);
|
||||
@@ -19,26 +18,25 @@ void func_800C84E4(SchedContext* sc, UNK_TYPE arg1)
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sched/func_800C8534.s")
|
||||
|
||||
void func_800C87CC(SchedContext* sc)
|
||||
{
|
||||
void func_800C87CC(SchedContext* sc) {
|
||||
ViConfig_UpdateVi(1);
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sched/func_800C87F0.s")
|
||||
|
||||
void func_800C8910(SchedContext* sc)
|
||||
{
|
||||
if (!(sc->curRSPTask->state & 0x10))
|
||||
{
|
||||
if (sc->curRSPTask->list.t.type == M_AUDTASK)
|
||||
void func_800C8910(SchedContext* sc) {
|
||||
if (!(sc->curRSPTask->state & 0x10)) {
|
||||
if (sc->curRSPTask->list.t.type == M_AUDTASK) {
|
||||
__assert("sc->curRSPTask->list.t.type != M_AUDTASK", "../sched.c", 496);
|
||||
}
|
||||
|
||||
sc->curRSPTask->state |= 0x10;
|
||||
|
||||
osSpTaskYield();
|
||||
|
||||
if (D_8012D290 != 0)
|
||||
if (D_8012D290 != 0) {
|
||||
osSyncPrintf("%08d:osSpTaskYield\n", (u32)((osGetTime() * 64) / 3000));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,39 +44,37 @@ void func_800C8910(SchedContext* sc)
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sched/func_800C8A94.s")
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/* 0x00 */ char unk_00[0x04];
|
||||
/* 0x00 */ u32 unk_04;
|
||||
/* 0x00 */ u32 unk_08;
|
||||
typedef struct {
|
||||
/* 0x00 */ char unk_00[0x04];
|
||||
/* 0x00 */ u32 unk_04;
|
||||
/* 0x00 */ u32 unk_08;
|
||||
/* 0x0C */ UNK_TYPE unk_0C;
|
||||
/* 0x10 */ char unk_10[0x40];
|
||||
/* 0x10 */ char unk_10[0x40];
|
||||
/* 0x50 */ OSMesgQueue* msgQ;
|
||||
/* 0x54 */ OSMesg msg;
|
||||
/* 0x54 */ OSMesg msg;
|
||||
} struct_800C8C40;
|
||||
|
||||
void func_800C8BC4(SchedContext* sc, struct_800C8C40* arg1)
|
||||
{
|
||||
if (sc->pendingSwapBuf1 == 0)
|
||||
{
|
||||
void func_800C8BC4(SchedContext* sc, struct_800C8C40* arg1) {
|
||||
if (sc->pendingSwapBuf1 == 0) {
|
||||
sc->pendingSwapBuf1 = arg1->unk_0C;
|
||||
|
||||
LogUtils_CheckValidPointer("sc->pending_swapbuffer1", sc->pendingSwapBuf1, "../sched.c", 618);
|
||||
|
||||
if ((sc->unk_240 == NULL) || (sc->unk_240->unk_12 < 1))
|
||||
if ((sc->unk_240 == NULL) || (sc->unk_240->unk_12 < 1)) {
|
||||
func_800C84E4(sc, arg1->unk_0C);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
u32 func_800C8C40(SchedContext* sc, struct_800C8C40* arg1)
|
||||
{
|
||||
if (!(arg1->unk_04 & 3))
|
||||
{
|
||||
if (arg1->msgQ != NULL)
|
||||
u32 func_800C8C40(SchedContext* sc, struct_800C8C40* arg1) {
|
||||
if (!(arg1->unk_04 & 3)) {
|
||||
if (arg1->msgQ != NULL) {
|
||||
osSendMesg(arg1->msgQ, arg1->msg, OS_MESG_BLOCK);
|
||||
}
|
||||
|
||||
if (arg1->unk_08 & 0x40)
|
||||
if (arg1->unk_08 & 0x40) {
|
||||
func_800C8BC4(sc, arg1);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -96,18 +92,17 @@ u32 func_800C8C40(SchedContext* sc, struct_800C8C40* arg1)
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sched/func_800C94B4.s")
|
||||
|
||||
void func_800C95F8(OSMesgQueue* mq)
|
||||
{
|
||||
if (D_8012D290 != 0)
|
||||
void func_800C95F8(OSMesgQueue* mq) {
|
||||
if (D_8012D290 != 0) {
|
||||
osSyncPrintf("osScKickEntryMsg\n");
|
||||
}
|
||||
|
||||
osSendMesg(mq, 670, OS_MESG_BLOCK);
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sched/func_800C9644.s")
|
||||
|
||||
void func_800C9874(SchedContext* sc, void* stack, OSPri priority, UNK_TYPE arg3, UNK_TYPE arg4, UNK_TYPE arg5)
|
||||
{
|
||||
void func_800C9874(SchedContext* sc, void* stack, OSPri priority, UNK_TYPE arg3, UNK_TYPE arg4, UNK_TYPE arg5) {
|
||||
bzero(sc, sizeof(SchedContext));
|
||||
sc->unk_24C = 1;
|
||||
osCreateMesgQueue(&sc->interruptQ, sc->intBuf, 8);
|
||||
|
||||
+9
-15
@@ -1,36 +1,30 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ char unk_00[0x18];
|
||||
/* 0x18 */ s32 unk_18;
|
||||
/* 0x1C */ s32 unk_1C;
|
||||
/* 0x18 */ s32 unk_18;
|
||||
/* 0x1C */ s32 unk_1C;
|
||||
} struct_801664D0; // size = 0x20
|
||||
|
||||
extern struct_801664D0 D_801664D0;
|
||||
|
||||
void func_800C9940(struct_801664D0* arg0, u32 arg1, u32 arg2)
|
||||
{
|
||||
void func_800C9940(struct_801664D0* arg0, u32 arg1, u32 arg2) {
|
||||
LogUtils_CheckNullPointer("this", arg0, "../speed_meter.c", 181);
|
||||
arg0->unk_18 = arg1;
|
||||
arg0->unk_1C = arg2;
|
||||
}
|
||||
|
||||
void func_800C9998(struct_801664D0* arg0)
|
||||
{
|
||||
void func_800C9998(struct_801664D0* arg0) {
|
||||
func_800C9940(arg0, 0x20, 0x16);
|
||||
}
|
||||
|
||||
void func_800C99BC(struct_801664D0* arg0)
|
||||
{
|
||||
|
||||
void func_800C99BC(struct_801664D0* arg0) {
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/speed_meter/func_800C99C4.s")
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ u32 unk_00;
|
||||
/* 0x04 */ u32 unk_04;
|
||||
/* 0x08 */ u16 unk_08;
|
||||
@@ -41,8 +35,8 @@ typedef struct
|
||||
/* 0x18 */ u32 unk_18;
|
||||
} struct_800C9E08;
|
||||
|
||||
void func_800C9E08(struct_800C9E08* arg0, u32 arg1, u32 arg2, u16 arg3, u16 arg4, u32 arg5, u32 arg6, u32 arg7, u32 arg8)
|
||||
{
|
||||
void func_800C9E08(struct_800C9E08* arg0, u32 arg1, u32 arg2, u16 arg3, u16 arg4, u32 arg5, u32 arg6, u32 arg7,
|
||||
u32 arg8) {
|
||||
arg0->unk_00 = arg1;
|
||||
arg0->unk_04 = arg2;
|
||||
arg0->unk_08 = arg3;
|
||||
|
||||
+21
-32
@@ -1,66 +1,55 @@
|
||||
#include <global.h>
|
||||
|
||||
volatile u32 sSysCfbFbPtr[2]; //may not be volatile but it currently gets SysCfb_Init closer from matching
|
||||
volatile u32 sSysCfbFbPtr[2]; // may not be volatile but it currently gets SysCfb_Init closer from matching
|
||||
u32 sSysCfbEnd;
|
||||
|
||||
//small reaordering
|
||||
// small reaordering
|
||||
#ifdef NON_MATCHING
|
||||
void SysCfb_Init(s32 n64dd)
|
||||
{
|
||||
if (osMemSize >= 0x800000U)
|
||||
{
|
||||
//8MB or more memory is installed
|
||||
void SysCfb_Init(s32 n64dd) {
|
||||
if (osMemSize >= 0x800000U) {
|
||||
// 8MB or more memory is installed
|
||||
osSyncPrintf("8Mバイト以上のメモリが搭載されています\n");
|
||||
if (n64dd == 1)
|
||||
{
|
||||
//RAM 8M mode (N64DD compatible)
|
||||
if (n64dd == 1) {
|
||||
// RAM 8M mode (N64DD compatible)
|
||||
osSyncPrintf("RAM 8M mode (N64DD対応)\n");
|
||||
sSysCfbEnd = 0x805FB000;
|
||||
}
|
||||
else
|
||||
{
|
||||
//The margin for this version is% dK bytes
|
||||
} else {
|
||||
// The margin for this version is% dK bytes
|
||||
osSyncPrintf("このバージョンのマージンは %dK バイトです\n", (0x4BC00 / 1024));
|
||||
sSysCfbEnd = 0x8044BE80;
|
||||
}
|
||||
}
|
||||
else if (osMemSize >= 0x400000U)
|
||||
{
|
||||
} else if (osMemSize >= 0x400000U) {
|
||||
sSysCfbEnd = 0x80400000;
|
||||
osSyncPrintf("RAM4M mode\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
LogUtils_HungupThread("../sys_cfb.c", 0x162);
|
||||
}
|
||||
|
||||
sSysCfbEnd &= ~0x3f;
|
||||
//The final address used by the system is% 08x
|
||||
// The final address used by the system is% 08x
|
||||
osSyncPrintf("システムが使用する最終アドレスは %08x です\n", sSysCfbEnd);
|
||||
sSysCfbFbPtr[0] = sSysCfbEnd - (SCREEN_WIDTH*SCREEN_HEIGHT*4);
|
||||
sSysCfbFbPtr[1] = sSysCfbEnd - (SCREEN_WIDTH*SCREEN_HEIGHT*2);
|
||||
//Frame buffer addresses are% 08x and% 08x
|
||||
sSysCfbFbPtr[0] = sSysCfbEnd - (SCREEN_WIDTH * SCREEN_HEIGHT * 4);
|
||||
sSysCfbFbPtr[1] = sSysCfbEnd - (SCREEN_WIDTH * SCREEN_HEIGHT * 2);
|
||||
// Frame buffer addresses are% 08x and% 08x
|
||||
osSyncPrintf("フレームバッファのアドレスは %08x と %08x です\n", sSysCfbFbPtr[0], sSysCfbFbPtr[1]);
|
||||
}
|
||||
#else
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_cfb/SysCfb_Init.s")
|
||||
#endif
|
||||
|
||||
void SysCfb_Reset()
|
||||
{
|
||||
void SysCfb_Reset() {
|
||||
sSysCfbFbPtr[0] = 0;
|
||||
sSysCfbFbPtr[1] = 0;
|
||||
sSysCfbEnd = 0;
|
||||
}
|
||||
|
||||
u32 SysCfb_GetFbPtr(s32 idx)
|
||||
{
|
||||
if (idx < 2)
|
||||
u32 SysCfb_GetFbPtr(s32 idx) {
|
||||
if (idx < 2) {
|
||||
return sSysCfbFbPtr[idx];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
u32 SysCfb_GetFbEnd()
|
||||
{
|
||||
u32 SysCfb_GetFbEnd() {
|
||||
return sSysCfbEnd;
|
||||
}
|
||||
}
|
||||
|
||||
+109
-188
@@ -1,83 +1,74 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
Mtx gMtxClear =
|
||||
{
|
||||
// clang-format off
|
||||
Mtx gMtxClear = {
|
||||
65536, 0, 1, 0,
|
||||
0, 65536, 0, 1,
|
||||
0, 0, 0, 0,
|
||||
0, 0, 0, 0,
|
||||
};
|
||||
MtxF gMtxFClear =
|
||||
{
|
||||
MtxF gMtxFClear = {
|
||||
1.0f, 0.0f, 0.0f, 0.0f,
|
||||
0.0f, 1.0f, 0.0f, 0.0f,
|
||||
0.0f, 0.0f, 1.0f, 0.0f,
|
||||
0.0f, 0.0f, 0.0f, 1.0f,
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
MtxF* sMatrixStack; // "Matrix_stack"
|
||||
MtxF* sMatrixStack; // "Matrix_stack"
|
||||
MtxF* sCurrentMatrix; // "Matrix_now"
|
||||
|
||||
void Matrix_Init(GameState* gameState)
|
||||
{
|
||||
void Matrix_Init(GameState* gameState) {
|
||||
sCurrentMatrix = Game_Alloc(gameState, 20 * sizeof(MtxF), "../sys_matrix.c", 153);
|
||||
sMatrixStack = sCurrentMatrix;
|
||||
}
|
||||
|
||||
void Matrix_Push(void)
|
||||
{
|
||||
void Matrix_Push(void) {
|
||||
Matrix_MtxFCopy(sCurrentMatrix + 1, sCurrentMatrix);
|
||||
sCurrentMatrix++;
|
||||
}
|
||||
|
||||
void Matrix_Pull(void)
|
||||
{
|
||||
void Matrix_Pull(void) {
|
||||
sCurrentMatrix--;
|
||||
if (sCurrentMatrix < sMatrixStack)
|
||||
if (sCurrentMatrix < sMatrixStack) {
|
||||
__assert("Matrix_now >= Matrix_stack", "../sys_matrix.c", 176);
|
||||
}
|
||||
}
|
||||
|
||||
void Matrix_Get(MtxF* dest)
|
||||
{
|
||||
void Matrix_Get(MtxF* dest) {
|
||||
Matrix_MtxFCopy(dest, sCurrentMatrix);
|
||||
}
|
||||
|
||||
void Matrix_Put(MtxF* src)
|
||||
{
|
||||
void Matrix_Put(MtxF* src) {
|
||||
Matrix_MtxFCopy(sCurrentMatrix, src);
|
||||
}
|
||||
|
||||
MtxF* Matrix_GetCurrent(void)
|
||||
{
|
||||
MtxF* Matrix_GetCurrent(void) {
|
||||
return sCurrentMatrix;
|
||||
}
|
||||
|
||||
void Matrix_Mult(MtxF* mf, u8 mode)
|
||||
{
|
||||
void Matrix_Mult(MtxF* mf, u8 mode) {
|
||||
MtxF* cmf = Matrix_GetCurrent();
|
||||
|
||||
if (mode == MTXMODE_APPLY)
|
||||
if (mode == MTXMODE_APPLY) {
|
||||
func_800A6FA0(cmf, mf, cmf);
|
||||
else
|
||||
} else {
|
||||
Matrix_MtxFCopy(sCurrentMatrix, mf);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// minor ordering and regalloc differences
|
||||
void Matrix_Translate(f32 x, f32 y, f32 z, u8 mode)
|
||||
{
|
||||
void Matrix_Translate(f32 x, f32 y, f32 z, u8 mode) {
|
||||
MtxF* cmf = sCurrentMatrix;
|
||||
|
||||
if (mode == MTXMODE_APPLY)
|
||||
{
|
||||
if (mode == MTXMODE_APPLY) {
|
||||
cmf->wx += cmf->xx * x + cmf->yx * y + cmf->zx * z;
|
||||
cmf->wy += cmf->xy * x + cmf->yy * y + cmf->zy * z;
|
||||
cmf->wz += cmf->xz * x + cmf->yz * y + cmf->zz * z;
|
||||
cmf->ww += cmf->xw * x + cmf->yw * y + cmf->zw * z;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
func_800A7A24(cmf, x, y, z);
|
||||
}
|
||||
}
|
||||
@@ -85,12 +76,10 @@ void Matrix_Translate(f32 x, f32 y, f32 z, u8 mode)
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/Matrix_Translate.s")
|
||||
#endif
|
||||
|
||||
void Matrix_Scale(f32 x, f32 y, f32 z, u8 mode)
|
||||
{
|
||||
void Matrix_Scale(f32 x, f32 y, f32 z, u8 mode) {
|
||||
MtxF* cmf = sCurrentMatrix;
|
||||
|
||||
if (mode == MTXMODE_APPLY)
|
||||
{
|
||||
if (mode == MTXMODE_APPLY) {
|
||||
cmf->xx *= x;
|
||||
cmf->xy *= x;
|
||||
cmf->xz *= x;
|
||||
@@ -103,25 +92,20 @@ void Matrix_Scale(f32 x, f32 y, f32 z, u8 mode)
|
||||
cmf->xw *= x;
|
||||
cmf->yw *= y;
|
||||
cmf->zw *= z;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
func_800A76A4(cmf, x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
void Matrix_RotateX(f32 x, u8 mode)
|
||||
{
|
||||
void Matrix_RotateX(f32 x, u8 mode) {
|
||||
MtxF* cmf;
|
||||
f32 sin;
|
||||
f32 cos;
|
||||
f32 temp1;
|
||||
f32 temp2;
|
||||
|
||||
if (mode == MTXMODE_APPLY)
|
||||
{
|
||||
if (x != 0)
|
||||
{
|
||||
if (mode == MTXMODE_APPLY) {
|
||||
if (x != 0) {
|
||||
cmf = sCurrentMatrix;
|
||||
|
||||
sin = sinf(x);
|
||||
@@ -147,18 +131,13 @@ void Matrix_RotateX(f32 x, u8 mode)
|
||||
cmf->yw = temp1 * cos + temp2 * sin;
|
||||
cmf->zw = temp2 * cos - temp1 * sin;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
cmf = sCurrentMatrix;
|
||||
|
||||
if (x != 0)
|
||||
{
|
||||
if (x != 0) {
|
||||
sin = sinf(x);
|
||||
cos = cosf(x);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
sin = 0.0f;
|
||||
cos = 1.0f;
|
||||
}
|
||||
@@ -182,18 +161,15 @@ void Matrix_RotateX(f32 x, u8 mode)
|
||||
}
|
||||
}
|
||||
|
||||
void Matrix_RotateY(f32 y, u8 mode)
|
||||
{
|
||||
void Matrix_RotateY(f32 y, u8 mode) {
|
||||
MtxF* cmf;
|
||||
f32 sin;
|
||||
f32 cos;
|
||||
f32 temp1;
|
||||
f32 temp2;
|
||||
|
||||
if (mode == MTXMODE_APPLY)
|
||||
{
|
||||
if (y != 0)
|
||||
{
|
||||
if (mode == MTXMODE_APPLY) {
|
||||
if (y != 0) {
|
||||
cmf = sCurrentMatrix;
|
||||
|
||||
sin = sinf(y);
|
||||
@@ -219,18 +195,13 @@ void Matrix_RotateY(f32 y, u8 mode)
|
||||
cmf->xw = temp1 * cos - temp2 * sin;
|
||||
cmf->zw = temp1 * sin + temp2 * cos;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
cmf = sCurrentMatrix;
|
||||
|
||||
if (y != 0)
|
||||
{
|
||||
if (y != 0) {
|
||||
sin = sinf(y);
|
||||
cos = cosf(y);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
sin = 0.0f;
|
||||
cos = 1.0f;
|
||||
}
|
||||
@@ -254,18 +225,15 @@ void Matrix_RotateY(f32 y, u8 mode)
|
||||
}
|
||||
}
|
||||
|
||||
void Matrix_RotateZ(f32 z, u8 mode)
|
||||
{
|
||||
void Matrix_RotateZ(f32 z, u8 mode) {
|
||||
MtxF* cmf;
|
||||
f32 sin;
|
||||
f32 cos;
|
||||
f32 temp1;
|
||||
f32 temp2;
|
||||
|
||||
if (mode == MTXMODE_APPLY)
|
||||
{
|
||||
if (z != 0)
|
||||
{
|
||||
if (mode == MTXMODE_APPLY) {
|
||||
if (z != 0) {
|
||||
cmf = sCurrentMatrix;
|
||||
|
||||
sin = sinf(z);
|
||||
@@ -291,18 +259,13 @@ void Matrix_RotateZ(f32 z, u8 mode)
|
||||
cmf->xw = temp1 * cos + temp2 * sin;
|
||||
cmf->yw = temp2 * cos - temp1 * sin;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
cmf = sCurrentMatrix;
|
||||
|
||||
if (z != 0)
|
||||
{
|
||||
if (z != 0) {
|
||||
sin = sinf(z);
|
||||
cos = cosf(z);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
sin = 0.0f;
|
||||
cos = 1.0f;
|
||||
}
|
||||
@@ -326,16 +289,14 @@ void Matrix_RotateZ(f32 z, u8 mode)
|
||||
}
|
||||
}
|
||||
|
||||
void Matrix_RotateXYZ(s16 x, s16 y, s16 z, u8 mode)
|
||||
{
|
||||
void Matrix_RotateXYZ(s16 x, s16 y, s16 z, u8 mode) {
|
||||
MtxF* cmf = sCurrentMatrix;
|
||||
f32 temp1;
|
||||
f32 temp2;
|
||||
f32 sin;
|
||||
f32 cos;
|
||||
|
||||
if (mode == MTXMODE_APPLY)
|
||||
{
|
||||
if (mode == MTXMODE_APPLY) {
|
||||
sin = Math_Sins(z);
|
||||
cos = Math_Coss(z);
|
||||
|
||||
@@ -359,8 +320,7 @@ void Matrix_RotateXYZ(s16 x, s16 y, s16 z, u8 mode)
|
||||
cmf->xw = temp1 * cos + temp2 * sin;
|
||||
cmf->yw = temp2 * cos - temp1 * sin;
|
||||
|
||||
if (y != 0)
|
||||
{
|
||||
if (y != 0) {
|
||||
sin = Math_Sins(y);
|
||||
cos = Math_Coss(y);
|
||||
|
||||
@@ -385,8 +345,7 @@ void Matrix_RotateXYZ(s16 x, s16 y, s16 z, u8 mode)
|
||||
cmf->zw = temp1 * sin + temp2 * cos;
|
||||
}
|
||||
|
||||
if (x != 0)
|
||||
{
|
||||
if (x != 0) {
|
||||
sin = Math_Sins(x);
|
||||
cos = Math_Coss(x);
|
||||
|
||||
@@ -410,15 +369,12 @@ void Matrix_RotateXYZ(s16 x, s16 y, s16 z, u8 mode)
|
||||
cmf->yw = temp1 * cos + temp2 * sin;
|
||||
cmf->zw = temp2 * cos - temp1 * sin;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
func_800A7704(cmf, x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
void func_800D1340(Vec3f* arg0, Vec3s* arg1)
|
||||
{
|
||||
void func_800D1340(Vec3f* arg0, Vec3s* arg1) {
|
||||
MtxF* cmf = sCurrentMatrix;
|
||||
f32 sin;
|
||||
f32 cos;
|
||||
@@ -452,8 +408,7 @@ void func_800D1340(Vec3f* arg0, Vec3s* arg1)
|
||||
cmf->xw = temp1 * cos + temp2 * sin;
|
||||
cmf->yw = temp2 * cos - temp1 * sin;
|
||||
|
||||
if (arg1->y != 0)
|
||||
{
|
||||
if (arg1->y != 0) {
|
||||
sin = Math_Sins(arg1->y);
|
||||
cos = Math_Coss(arg1->y);
|
||||
|
||||
@@ -478,8 +433,7 @@ void func_800D1340(Vec3f* arg0, Vec3s* arg1)
|
||||
cmf->zw = temp1 * sin + temp2 * cos;
|
||||
}
|
||||
|
||||
if (arg1->x != 0)
|
||||
{
|
||||
if (arg1->x != 0) {
|
||||
sin = Math_Sins(arg1->x);
|
||||
cos = Math_Coss(arg1->x);
|
||||
|
||||
@@ -507,8 +461,7 @@ void func_800D1340(Vec3f* arg0, Vec3s* arg1)
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// regalloc differences
|
||||
void func_800D1694(f32 x, f32 y, f32 z, Vec3s* vec)
|
||||
{
|
||||
void func_800D1694(f32 x, f32 y, f32 z, Vec3s* vec) {
|
||||
MtxF* cmf = sCurrentMatrix;
|
||||
f32 sp30;
|
||||
f32 sp2C;
|
||||
@@ -528,8 +481,7 @@ void func_800D1694(f32 x, f32 y, f32 z, Vec3s* vec)
|
||||
cmf->zw = 0.0f;
|
||||
cmf->ww = 1.0f;
|
||||
|
||||
if (vec->x != 0)
|
||||
{
|
||||
if (vec->x != 0) {
|
||||
sp24 = Math_Sins(vec->x);
|
||||
sp28 = Math_Coss(vec->x);
|
||||
|
||||
@@ -539,9 +491,7 @@ void func_800D1694(f32 x, f32 y, f32 z, Vec3s* vec)
|
||||
cmf->yz = sp2C * sp24;
|
||||
cmf->zx = sp30 * sp28;
|
||||
cmf->yx = sp30 * sp24;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
cmf->zz = sp2C;
|
||||
cmf->zx = sp30;
|
||||
cmf->zy = 0.0f;
|
||||
@@ -550,8 +500,7 @@ void func_800D1694(f32 x, f32 y, f32 z, Vec3s* vec)
|
||||
cmf->yy = 1.0f;
|
||||
}
|
||||
|
||||
if (vec->z != 0)
|
||||
{
|
||||
if (vec->z != 0) {
|
||||
sp24 = Math_Sins(vec->z);
|
||||
sp28 = Math_Coss(vec->z);
|
||||
|
||||
@@ -568,9 +517,7 @@ void func_800D1694(f32 x, f32 y, f32 z, Vec3s* vec)
|
||||
sp2C = cmf->yy;
|
||||
cmf->xy = sp2C * sp24;
|
||||
cmf->yy = sp2C * sp28;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
cmf->xy = 0.0f;
|
||||
}
|
||||
}
|
||||
@@ -580,74 +527,73 @@ void func_800D1694(f32 x, f32 y, f32 z, Vec3s* vec)
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// mostly regalloc differences
|
||||
Mtx* Matrix_MtxFToMtx(MtxF* src, Mtx* dest)
|
||||
{
|
||||
Mtx* Matrix_MtxFToMtx(MtxF* src, Mtx* dest) {
|
||||
u16* m1 = (u16*)&dest->m[0][0];
|
||||
u16* m2 = (u16*)&dest->m[2][0];
|
||||
s32 temp;
|
||||
|
||||
temp = src->xx * 65536.0f;
|
||||
m1[0] = (temp >> 0x10) & 0xFFFF;;
|
||||
m1[0] = (temp >> 0x10) & 0xFFFF;
|
||||
m2[0] = temp & 0xFFFF;
|
||||
|
||||
temp = src->xy * 65536.0f;
|
||||
m1[1] = (temp >> 0x10) & 0xFFFF;;
|
||||
m1[1] = (temp >> 0x10) & 0xFFFF;
|
||||
m2[1] = temp & 0xFFFF;
|
||||
|
||||
temp = src->xz * 65536.0f;
|
||||
m1[2] = (temp >> 0x10) & 0xFFFF;;
|
||||
m1[2] = (temp >> 0x10) & 0xFFFF;
|
||||
m2[2] = temp & 0xFFFF;
|
||||
|
||||
temp = src->xw * 65536.0f;
|
||||
m1[3] = (temp >> 0x10) & 0xFFFF;;
|
||||
m1[3] = (temp >> 0x10) & 0xFFFF;
|
||||
m2[3] = temp & 0xFFFF;
|
||||
|
||||
temp = src->yx * 65536.0f;
|
||||
m1[4] = (temp >> 0x10) & 0xFFFF;;
|
||||
m1[4] = (temp >> 0x10) & 0xFFFF;
|
||||
m2[4] = temp & 0xFFFF;
|
||||
|
||||
temp = src->yy * 65536.0f;
|
||||
m1[5] = (temp >> 0x10) & 0xFFFF;;
|
||||
m1[5] = (temp >> 0x10) & 0xFFFF;
|
||||
m2[5] = temp & 0xFFFF;
|
||||
|
||||
temp = src->yz * 65536.0f;
|
||||
m1[6] = (temp >> 0x10) & 0xFFFF;;
|
||||
m1[6] = (temp >> 0x10) & 0xFFFF;
|
||||
m2[6] = temp & 0xFFFF;
|
||||
|
||||
temp = src->yw * 65536.0f;
|
||||
m1[7] = (temp >> 0x10) & 0xFFFF;;
|
||||
m1[7] = (temp >> 0x10) & 0xFFFF;
|
||||
m2[7] = temp & 0xFFFF;
|
||||
|
||||
temp = src->zx * 65536.0f;
|
||||
m1[8] = (temp >> 0x10) & 0xFFFF;;
|
||||
m1[8] = (temp >> 0x10) & 0xFFFF;
|
||||
m2[8] = temp & 0xFFFF;
|
||||
|
||||
temp = src->zy * 65536.0f;
|
||||
m1[9] = (temp >> 0x10) & 0xFFFF;;
|
||||
m1[9] = (temp >> 0x10) & 0xFFFF;
|
||||
m2[9] = temp & 0xFFFF;
|
||||
|
||||
temp = src->zz * 65536.0f;
|
||||
m1[10] = (temp >> 0x10) & 0xFFFF;;
|
||||
m1[10] = (temp >> 0x10) & 0xFFFF;
|
||||
m2[10] = temp & 0xFFFF;
|
||||
|
||||
temp = src->zw * 65536.0f;
|
||||
m1[11] = (temp >> 0x10) & 0xFFFF;;
|
||||
m1[11] = (temp >> 0x10) & 0xFFFF;
|
||||
m2[11] = temp & 0xFFFF;
|
||||
|
||||
temp = src->wx * 65536.0f;
|
||||
m1[12] = (temp >> 0x10) & 0xFFFF;;
|
||||
m1[12] = (temp >> 0x10) & 0xFFFF;
|
||||
m2[12] = temp & 0xFFFF;
|
||||
|
||||
temp = src->wy * 65536.0f;
|
||||
m1[13] = (temp >> 0x10) & 0xFFFF;;
|
||||
m1[13] = (temp >> 0x10) & 0xFFFF;
|
||||
m2[13] = temp & 0xFFFF;
|
||||
|
||||
temp = src->wz * 65536.0f;
|
||||
m1[14] = (temp >> 0x10) & 0xFFFF;;
|
||||
m1[14] = (temp >> 0x10) & 0xFFFF;
|
||||
m2[14] = temp & 0xFFFF;
|
||||
|
||||
temp = src->ww * 65536.0f;
|
||||
m1[15] = (temp >> 0x10) & 0xFFFF;;
|
||||
m1[15] = (temp >> 0x10) & 0xFFFF;
|
||||
m2[15] = temp & 0xFFFF;
|
||||
|
||||
return dest;
|
||||
@@ -656,23 +602,19 @@ Mtx* Matrix_MtxFToMtx(MtxF* src, Mtx* dest)
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/Matrix_MtxFToMtx.s")
|
||||
#endif
|
||||
|
||||
Mtx* Matrix_ToMtx(Mtx* dest, char* file, s32 line)
|
||||
{
|
||||
Mtx* Matrix_ToMtx(Mtx* dest, char* file, s32 line) {
|
||||
return Matrix_MtxFToMtx(Matrix_CheckFloats(sCurrentMatrix, file, line), dest);
|
||||
}
|
||||
|
||||
Mtx* Matrix_NewMtx(GraphicsContext* gfxCtx, char* file, s32 line)
|
||||
{
|
||||
Mtx* Matrix_NewMtx(GraphicsContext* gfxCtx, char* file, s32 line) {
|
||||
return Matrix_ToMtx(Graph_Alloc(gfxCtx, sizeof(Mtx)), file, line);
|
||||
}
|
||||
|
||||
Mtx* Matrix_MtxFToNewMtx(MtxF* src, GraphicsContext* gfxCtx)
|
||||
{
|
||||
Mtx* Matrix_MtxFToNewMtx(MtxF* src, GraphicsContext* gfxCtx) {
|
||||
return Matrix_MtxFToMtx(src, Graph_Alloc(gfxCtx, sizeof(Mtx)));
|
||||
}
|
||||
|
||||
void Matrix_MultVec3f(Vec3f* src, Vec3f* dest)
|
||||
{
|
||||
void Matrix_MultVec3f(Vec3f* src, Vec3f* dest) {
|
||||
MtxF* cmf = sCurrentMatrix;
|
||||
|
||||
dest->x = cmf->wx + (cmf->xx * src->x + cmf->yx * src->y + cmf->zx * src->z);
|
||||
@@ -680,8 +622,7 @@ void Matrix_MultVec3f(Vec3f* src, Vec3f* dest)
|
||||
dest->z = cmf->wz + (cmf->xz * src->x + cmf->yz * src->y + cmf->zz * src->z);
|
||||
}
|
||||
|
||||
void Matrix_MtxFCopy(MtxF* dest, MtxF* src)
|
||||
{
|
||||
void Matrix_MtxFCopy(MtxF* dest, MtxF* src) {
|
||||
dest->xx = src->xx;
|
||||
dest->xy = src->xy;
|
||||
dest->xz = src->xz;
|
||||
@@ -716,8 +657,7 @@ void Matrix_MtxFCopy(MtxF* dest, MtxF* src)
|
||||
dest->ww = src->ww;
|
||||
}
|
||||
|
||||
void Matrix_MtxToMtxF(Mtx* src, MtxF* dest)
|
||||
{
|
||||
void Matrix_MtxToMtxF(Mtx* src, MtxF* dest) {
|
||||
u16* m1 = (u16*)&src->m[0][0];
|
||||
u16* m2 = (u16*)&src->m[2][0];
|
||||
|
||||
@@ -739,15 +679,13 @@ void Matrix_MtxToMtxF(Mtx* src, MtxF* dest)
|
||||
dest->ww = ((m1[15] << 0x10) | m2[15]) * (1 / 65536.0f);
|
||||
}
|
||||
|
||||
void Matrix_MultVec3fExt(Vec3f* src, Vec3f* dest, MtxF* mf)
|
||||
{
|
||||
void Matrix_MultVec3fExt(Vec3f* src, Vec3f* dest, MtxF* mf) {
|
||||
dest->x = mf->wx + (mf->xx * src->x + mf->yx * src->y + mf->zx * src->z);
|
||||
dest->y = mf->wy + (mf->xy * src->x + mf->yy * src->y + mf->zy * src->z);
|
||||
dest->z = mf->wz + (mf->xz * src->x + mf->yz * src->y + mf->zz * src->z);
|
||||
}
|
||||
|
||||
void Matrix_Reverse(MtxF* mf)
|
||||
{
|
||||
void Matrix_Reverse(MtxF* mf) {
|
||||
f32 temp;
|
||||
|
||||
temp = mf->xy;
|
||||
@@ -764,8 +702,7 @@ void Matrix_Reverse(MtxF* mf)
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
void func_800D1FD4(MtxF* mf)
|
||||
{
|
||||
void func_800D1FD4(MtxF* mf) {
|
||||
MtxF* cmf = sCurrentMatrix;
|
||||
f32 temp;
|
||||
|
||||
@@ -790,12 +727,10 @@ void func_800D1FD4(MtxF* mf)
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// same differences as func_800D2264
|
||||
void func_800D20CC(MtxF* mf, Vec3s* vec, s32 flag)
|
||||
{
|
||||
void func_800D20CC(MtxF* mf, Vec3s* vec, s32 flag) {
|
||||
vec->x = Math_atan2f(-mf->zy, sqrtf(SQ(mf->zx) + SQ(mf->zz))) * (32768 / M_PI);
|
||||
|
||||
if ((vec->x == 0x4000) || (vec->x == -0x4000))
|
||||
{
|
||||
if ((vec->x == 0x4000) || (vec->x == -0x4000)) {
|
||||
vec->z = 0;
|
||||
vec->y = Math_atan2f(-mf->xz, mf->xx) * (32768 / M_PI);
|
||||
return;
|
||||
@@ -806,8 +741,9 @@ void func_800D20CC(MtxF* mf, Vec3s* vec, s32 flag)
|
||||
if (!flag)
|
||||
vec->z = Math_atan2f(mf->xy, mf->yy) * (32768 / M_PI);
|
||||
else
|
||||
vec->z = Math_atan2f(mf->xy / sqrtf(SQ(mf->xx) + SQ(mf->xz) + SQ(mf->xy)),
|
||||
mf->yy / sqrtf(SQ(mf->yx) + SQ(mf->yz) + SQ(mf->yy))) * (32768 / M_PI);
|
||||
vec->z = Math_atan2f(mf->xy / sqrtf(SQ(mf->xx) + SQ(mf->xz) + SQ(mf->xy)),
|
||||
mf->yy / sqrtf(SQ(mf->yx) + SQ(mf->yz) + SQ(mf->yy))) *
|
||||
(32768 / M_PI);
|
||||
}
|
||||
#else
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/func_800D20CC.s")
|
||||
@@ -815,12 +751,10 @@ void func_800D20CC(MtxF* mf, Vec3s* vec, s32 flag)
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// same differences as func_800D20CC
|
||||
void func_800D2264(MtxF* mf, Vec3s* vec, s32 flag)
|
||||
{
|
||||
void func_800D2264(MtxF* mf, Vec3s* vec, s32 flag) {
|
||||
vec->y = Math_atan2f(-mf->xz, sqrtf(SQ(mf->xx) + SQ(mf->xy))) * (32768 / M_PI);
|
||||
|
||||
if ((vec->y == 0x4000) || (vec->y == -0x4000))
|
||||
{
|
||||
if ((vec->y == 0x4000) || (vec->y == -0x4000)) {
|
||||
vec->x = 0;
|
||||
vec->z = Math_atan2f(-mf->yx, mf->yy) * (32768 / M_PI);
|
||||
return;
|
||||
@@ -831,8 +765,9 @@ void func_800D2264(MtxF* mf, Vec3s* vec, s32 flag)
|
||||
if (!flag)
|
||||
vec->x = Math_atan2f(mf->yz, mf->zz) * (32768 / M_PI);
|
||||
else
|
||||
vec->x = Math_atan2f(mf->yz / sqrtf(SQ(mf->yx) + SQ(mf->yy) + SQ(mf->yz)),
|
||||
mf->zz / sqrtf(SQ(mf->zx) + SQ(mf->zy) + SQ(mf->zz))) * (32768 / M_PI);
|
||||
vec->x = Math_atan2f(mf->yz / sqrtf(SQ(mf->yx) + SQ(mf->yy) + SQ(mf->yz)),
|
||||
mf->zz / sqrtf(SQ(mf->zx) + SQ(mf->zy) + SQ(mf->zz))) *
|
||||
(32768 / M_PI);
|
||||
}
|
||||
#else
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/func_800D2264.s")
|
||||
@@ -840,8 +775,7 @@ void func_800D2264(MtxF* mf, Vec3s* vec, s32 flag)
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// regalloc differences
|
||||
void func_800D23FC(f32 f, Vec3f* vec, u8 mode)
|
||||
{
|
||||
void func_800D23FC(f32 f, Vec3f* vec, u8 mode) {
|
||||
MtxF* cmf;
|
||||
f32 sin;
|
||||
f32 cos;
|
||||
@@ -851,10 +785,8 @@ void func_800D23FC(f32 f, Vec3f* vec, u8 mode)
|
||||
f32 temp3;
|
||||
f32 temp4;
|
||||
|
||||
if (mode == MTXMODE_APPLY)
|
||||
{
|
||||
if (f != 0)
|
||||
{
|
||||
if (mode == MTXMODE_APPLY) {
|
||||
if (f != 0) {
|
||||
cmf = sCurrentMatrix;
|
||||
|
||||
sin = sinf(f);
|
||||
@@ -884,13 +816,10 @@ void func_800D23FC(f32 f, Vec3f* vec, u8 mode)
|
||||
cmf->yz = temp2 * cos + vec->y * temp4 + sin * (temp3 * vec->x - temp1 * vec->z);
|
||||
cmf->zz = temp3 * cos + vec->z * temp4 + sin * (temp1 * vec->y - temp2 * vec->x);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
cmf = sCurrentMatrix;
|
||||
|
||||
if (f != 0)
|
||||
{
|
||||
if (f != 0) {
|
||||
sin = sinf(f);
|
||||
cos = cosf(f);
|
||||
rCos = 1.0f - cos;
|
||||
@@ -921,9 +850,7 @@ void func_800D23FC(f32 f, Vec3f* vec, u8 mode)
|
||||
cmf->wy = 0.0f;
|
||||
cmf->wz = 0.0f;
|
||||
cmf->ww = 1.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
cmf->xy = 0.0f;
|
||||
cmf->xz = 0.0f;
|
||||
cmf->xw = 0.0f;
|
||||
@@ -947,17 +874,16 @@ void func_800D23FC(f32 f, Vec3f* vec, u8 mode)
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/func_800D23FC.s")
|
||||
#endif
|
||||
|
||||
MtxF* Matrix_CheckFloats(MtxF* mf, char* file, s32 line)
|
||||
{
|
||||
MtxF* Matrix_CheckFloats(MtxF* mf, char* file, s32 line) {
|
||||
s32 i, j;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
for (j = 0; j < 4; j++)
|
||||
{
|
||||
if (!(-32768.0f <= mf->mf[i][j]) || !(mf->mf[i][j] < 32768.0f))
|
||||
{
|
||||
osSyncPrintf("%s %d: [%s] =\n/ %12.6f %12.6f %12.6f %12.6f \\\n| %12.6f %12.6f %12.6f %12.6f |\n| %12.6f %12.6f %12.6f %12.6f |\n\\ %12.6f %12.6f %12.6f %12.6f /\n", file, line, "mf", mf->xx, mf->yx, mf->zx, mf->wx, mf->xy, mf->yy, mf->zy, mf->wy, mf->xz, mf->yz, mf->zz, mf->wz, mf->xw, mf->yw, mf->zw, mf->ww);
|
||||
for (i = 0; i < 4; i++) {
|
||||
for (j = 0; j < 4; j++) {
|
||||
if (!(-32768.0f <= mf->mf[i][j]) || !(mf->mf[i][j] < 32768.0f)) {
|
||||
osSyncPrintf("%s %d: [%s] =\n/ %12.6f %12.6f %12.6f %12.6f \\\n| %12.6f %12.6f %12.6f %12.6f |\n| "
|
||||
"%12.6f %12.6f %12.6f %12.6f |\n\\ %12.6f %12.6f %12.6f %12.6f /\n",
|
||||
file, line, "mf", mf->xx, mf->yx, mf->zx, mf->wx, mf->xy, mf->yy, mf->zy, mf->wy, mf->xz,
|
||||
mf->yz, mf->zz, mf->wz, mf->xw, mf->yw, mf->zw, mf->ww);
|
||||
Fault_AddHungupAndCrash(file, line);
|
||||
}
|
||||
}
|
||||
@@ -966,8 +892,7 @@ MtxF* Matrix_CheckFloats(MtxF* mf, char* file, s32 line)
|
||||
return mf;
|
||||
}
|
||||
|
||||
void func_800D2A34(MtxF* mf, f32 arg1, f32 arg2, f32 arg3, f32 arg4)
|
||||
{
|
||||
void func_800D2A34(MtxF* mf, f32 arg1, f32 arg2, f32 arg3, f32 arg4) {
|
||||
mf->xy = 0.0f;
|
||||
mf->xz = 0.0f;
|
||||
mf->xw = 0.0f;
|
||||
@@ -986,16 +911,14 @@ void func_800D2A34(MtxF* mf, f32 arg1, f32 arg2, f32 arg3, f32 arg4)
|
||||
mf->ww = 1.0f;
|
||||
}
|
||||
|
||||
void func_800D2A98(Mtx* mtx, f32 arg1, f32 arg2, f32 arg3, f32 arg4)
|
||||
{
|
||||
void func_800D2A98(Mtx* mtx, f32 arg1, f32 arg2, f32 arg3, f32 arg4) {
|
||||
MtxF mf;
|
||||
|
||||
func_800D2A34(&mf, arg1, arg2, arg3, arg4);
|
||||
func_801064E0(&mf, mtx);
|
||||
}
|
||||
|
||||
void func_800D2AE4(Mtx* mtx, f32 arg1, f32 arg2, f32 arg3, f32 arg4)
|
||||
{
|
||||
void func_800D2AE4(Mtx* mtx, f32 arg1, f32 arg2, f32 arg3, f32 arg4) {
|
||||
u16* m1 = (u16*)&mtx->m[0][0];
|
||||
u16* m2 = (u16*)&mtx->m[2][0];
|
||||
u32 temp;
|
||||
@@ -1047,8 +970,7 @@ void func_800D2AE4(Mtx* mtx, f32 arg1, f32 arg2, f32 arg3, f32 arg4)
|
||||
m2[15] = 0;
|
||||
}
|
||||
|
||||
void func_800D2BD0(Mtx* mtx, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6)
|
||||
{
|
||||
void func_800D2BD0(Mtx* mtx, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6) {
|
||||
u16* m1 = (u16*)&mtx->m[0][0];
|
||||
u16* m2 = (u16*)&mtx->m[2][0];
|
||||
u32 temp;
|
||||
@@ -1102,8 +1024,7 @@ void func_800D2BD0(Mtx* mtx, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// minor ordering and regalloc differences
|
||||
void func_800D2CEC(Mtx* mtx, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6)
|
||||
{
|
||||
void func_800D2CEC(Mtx* mtx, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6) {
|
||||
u16* m1 = (u16*)&mtx->m[0][0];
|
||||
u16* m2 = (u16*)&mtx->m[2][0];
|
||||
u32 temp;
|
||||
|
||||
@@ -1,21 +1,17 @@
|
||||
#include <global.h>
|
||||
|
||||
u32 SysUcode_GetUCodeBoot()
|
||||
{
|
||||
u32 SysUcode_GetUCodeBoot() {
|
||||
return &D_80009320;
|
||||
}
|
||||
|
||||
u32 SysUcode_GetUcodeBootSize()
|
||||
{
|
||||
u32 SysUcode_GetUcodeBootSize() {
|
||||
return (u32)&D_800093F0 - (u32)&D_80009320;
|
||||
}
|
||||
|
||||
u32 SysUcode_GetUcode()
|
||||
{
|
||||
u32 SysUcode_GetUcode() {
|
||||
return D_8012DBA0;
|
||||
}
|
||||
|
||||
u32 SysUcode_GetUcodeData()
|
||||
{
|
||||
u32 SysUcode_GetUcodeData() {
|
||||
return D_8012DBA4;
|
||||
}
|
||||
|
||||
+30
-49
@@ -1,131 +1,112 @@
|
||||
#include <global.h>
|
||||
|
||||
#define LOG_SEVERITY_NOLOG 0
|
||||
#define LOG_SEVERITY_ERROR 2
|
||||
#define LOG_SEVERITY_VERBOSE 3
|
||||
#define LOG_SEVERITY_NOLOG 0
|
||||
#define LOG_SEVERITY_ERROR 2
|
||||
#define LOG_SEVERITY_VERBOSE 3
|
||||
|
||||
s32 gSystemArenaLogSeverity = LOG_SEVERITY_NOLOG;
|
||||
Arena gSystemArena;
|
||||
|
||||
void SystemArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action)
|
||||
{
|
||||
if (!ptr)
|
||||
{
|
||||
if (gSystemArenaLogSeverity >= LOG_SEVERITY_ERROR)
|
||||
{
|
||||
void SystemArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action) {
|
||||
if (!ptr) {
|
||||
if (gSystemArenaLogSeverity >= LOG_SEVERITY_ERROR) {
|
||||
//"%s: %u bytes %s failed\n"
|
||||
osSyncPrintf("%s: %u バイトの%sに失敗しました\n", name, size, action);
|
||||
__osDisplayArena(&gSystemArena);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (gSystemArenaLogSeverity >= LOG_SEVERITY_VERBOSE)
|
||||
{
|
||||
} else if (gSystemArenaLogSeverity >= LOG_SEVERITY_VERBOSE) {
|
||||
//"%s: %u bytes %s succeeded\n"
|
||||
osSyncPrintf("%s: %u バイトの%sに成功しました\n", name, size, action);
|
||||
}
|
||||
}
|
||||
|
||||
void* SystemArena_Malloc(u32 size)
|
||||
{
|
||||
void* SystemArena_Malloc(u32 size) {
|
||||
void* ptr;
|
||||
ptr = __osMalloc(&gSystemArena, size);
|
||||
SystemArena_CheckPointer(ptr, size, "malloc", "確保"); //Secure
|
||||
SystemArena_CheckPointer(ptr, size, "malloc", "確保"); // Secure
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void* SystemArena_MallocDebug(u32 size, const char* file, s32 line)
|
||||
{
|
||||
void* SystemArena_MallocDebug(u32 size, const char* file, s32 line) {
|
||||
void* ptr;
|
||||
ptr = __osMallocDebug(&gSystemArena, size, file, line);
|
||||
SystemArena_CheckPointer(ptr, size, "malloc_DEBUG", "確保"); //Secure
|
||||
SystemArena_CheckPointer(ptr, size, "malloc_DEBUG", "確保"); // Secure
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void* SystemArena_MallocR(u32 size)
|
||||
{
|
||||
void* SystemArena_MallocR(u32 size) {
|
||||
void* ptr;
|
||||
ptr = __osMallocR(&gSystemArena, size);
|
||||
SystemArena_CheckPointer(ptr, size, "malloc_r", "確保"); //Secure
|
||||
SystemArena_CheckPointer(ptr, size, "malloc_r", "確保"); // Secure
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void* SystemArena_MallocRDebug(u32 size, const char* file, s32 line)
|
||||
{
|
||||
void* SystemArena_MallocRDebug(u32 size, const char* file, s32 line) {
|
||||
void* ptr;
|
||||
ptr = __osMallocRDebug(&gSystemArena, size, file, line);
|
||||
SystemArena_CheckPointer(ptr, size, "malloc_r_DEBUG", "確保"); //Secure
|
||||
SystemArena_CheckPointer(ptr, size, "malloc_r_DEBUG", "確保"); // Secure
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void* SystemArena_Realloc(void* ptr, u32 newSize)
|
||||
{
|
||||
void* SystemArena_Realloc(void* ptr, u32 newSize) {
|
||||
ptr = __osRealloc(&gSystemArena, ptr, newSize);
|
||||
SystemArena_CheckPointer(ptr, newSize, "realloc", "再確保"); // Re-securing
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void* SystemArena_ReallocDebug(void* ptr, u32 newSize, const char* file, s32 line)
|
||||
{
|
||||
void* SystemArena_ReallocDebug(void* ptr, u32 newSize, const char* file, s32 line) {
|
||||
ptr = __osReallocDebug(&gSystemArena, ptr, newSize, file, line);
|
||||
SystemArena_CheckPointer(ptr, newSize, "realloc_DEBUG", "再確保"); // Re-securing
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void SystemArena_Free(void* ptr)
|
||||
{
|
||||
void SystemArena_Free(void* ptr) {
|
||||
__osFree(&gSystemArena, ptr);
|
||||
}
|
||||
|
||||
void SystemArena_FreeDebug(void* ptr, const char* file, s32 line)
|
||||
{
|
||||
void SystemArena_FreeDebug(void* ptr, const char* file, s32 line) {
|
||||
__osFreeDebug(&gSystemArena, ptr, file, line);
|
||||
}
|
||||
|
||||
void* SystemArena_Calloc(u32 num, u32 size)
|
||||
{
|
||||
void* SystemArena_Calloc(u32 num, u32 size) {
|
||||
void* ret;
|
||||
u32 n;
|
||||
|
||||
n = num*size;
|
||||
n = num * size;
|
||||
ret = __osMalloc(&gSystemArena, n);
|
||||
if (ret)
|
||||
if (ret) {
|
||||
bzero(ret, n);
|
||||
}
|
||||
|
||||
SystemArena_CheckPointer(ret, n, "calloc", "確保");
|
||||
return ret;
|
||||
}
|
||||
|
||||
void SystemArena_Display()
|
||||
{
|
||||
//System heap display
|
||||
void SystemArena_Display() {
|
||||
// System heap display
|
||||
osSyncPrintf("システムヒープ表示\n");
|
||||
__osDisplayArena(&gSystemArena);
|
||||
}
|
||||
|
||||
void SystemArena_GetSizes(u32* outMaxFree, u32* outFree, u32* outAlloc)
|
||||
{
|
||||
void SystemArena_GetSizes(u32* outMaxFree, u32* outFree, u32* outAlloc) {
|
||||
ArenaImpl_GetSizes(&gSystemArena, outMaxFree, outFree, outAlloc);
|
||||
}
|
||||
|
||||
void SystemArena_Check()
|
||||
{
|
||||
void SystemArena_Check() {
|
||||
__osCheckArena(&gSystemArena);
|
||||
}
|
||||
|
||||
void SystemArena_Init(void* start, u32 size)
|
||||
{
|
||||
void SystemArena_Init(void* start, u32 size) {
|
||||
gSystemArenaLogSeverity = LOG_SEVERITY_NOLOG;
|
||||
__osMallocInit(&gSystemArena, start, size);
|
||||
}
|
||||
|
||||
void SystemArena_Cleanup()
|
||||
{
|
||||
void SystemArena_Cleanup() {
|
||||
gSystemArenaLogSeverity = LOG_SEVERITY_NOLOG;
|
||||
__osMallocCleanup(&gSystemArena);
|
||||
}
|
||||
|
||||
u8 SystemArena_IsInitalized()
|
||||
{
|
||||
u8 SystemArena_IsInitalized() {
|
||||
return __osMallocIsInitalized(&gSystemArena);
|
||||
}
|
||||
|
||||
+6
-10
@@ -1,21 +1,17 @@
|
||||
#include <global.h>
|
||||
|
||||
void TitleSetup_InitImpl(GameState* gameState)
|
||||
{
|
||||
//Zelda common data initalization
|
||||
void TitleSetup_InitImpl(GameState* gameState) {
|
||||
// Zelda common data initalization
|
||||
osSyncPrintf("ゼルダ共通データ初期化\n");
|
||||
SaveContext_Init();
|
||||
gameState->running = false;
|
||||
gameState->init = Title_Init; gameState->size = sizeof(TitleContext);
|
||||
SET_NEXT_GAMESTATE(gameState, Title_Init, TitleContext);
|
||||
}
|
||||
|
||||
void TitleSetup_Destroy(GameState* gameState)
|
||||
{
|
||||
|
||||
void TitleSetup_Destroy(GameState* gameState) {
|
||||
}
|
||||
|
||||
void TitleSetup_Init(GameState* gameState)
|
||||
{
|
||||
void TitleSetup_Init(GameState* gameState) {
|
||||
gameState->destroy = TitleSetup_Destroy;
|
||||
TitleSetup_InitImpl(gameState);
|
||||
}
|
||||
}
|
||||
|
||||
+40
-39
@@ -2,109 +2,110 @@
|
||||
#include <global.h>
|
||||
#include <vt.h>
|
||||
|
||||
void Overlay_LoadGameState(GameStateOverlay* overlayEntry)
|
||||
{
|
||||
if (overlayEntry->loadedRamAddr != NULL)
|
||||
{
|
||||
void Overlay_LoadGameState(GameStateOverlay* overlayEntry) {
|
||||
if (overlayEntry->loadedRamAddr != NULL) {
|
||||
// Translates to: "ALREADY LINKED"
|
||||
osSyncPrintf("既にリンクされています\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (overlayEntry->vramStart == 0)
|
||||
if (overlayEntry->vramStart == 0) {
|
||||
overlayEntry->unk_28 = 0;
|
||||
else
|
||||
{
|
||||
} else {
|
||||
overlayEntry->loadedRamAddr = Overlay_AllocateAndLoad(overlayEntry->vromStart, overlayEntry->vromEnd,
|
||||
overlayEntry->vramStart, overlayEntry->vramEnd);
|
||||
|
||||
if (overlayEntry->loadedRamAddr == NULL)
|
||||
{
|
||||
if (overlayEntry->loadedRamAddr == NULL) {
|
||||
// Translates to: "LOADING FAILED"
|
||||
osSyncPrintf("ロードに失敗しました\n");
|
||||
return;
|
||||
}
|
||||
|
||||
osSyncPrintf(VT_FGCOL(GREEN));
|
||||
osSyncPrintf("OVL(d):Seg:%08x-%08x Ram:%08x-%08x Off:%08x %s\n",
|
||||
overlayEntry->vramStart, overlayEntry->vramEnd,
|
||||
osSyncPrintf("OVL(d):Seg:%08x-%08x Ram:%08x-%08x Off:%08x %s\n", overlayEntry->vramStart, overlayEntry->vramEnd,
|
||||
overlayEntry->loadedRamAddr,
|
||||
(u32)overlayEntry->loadedRamAddr + (u32)overlayEntry->vramEnd - (u32)overlayEntry->vramStart,
|
||||
(u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr,
|
||||
"");
|
||||
(u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr, "");
|
||||
osSyncPrintf(VT_RST);
|
||||
|
||||
if (overlayEntry->unk_14 != NULL)
|
||||
if (overlayEntry->unk_14 != NULL) {
|
||||
overlayEntry->unk_14 = (void*)((u32)overlayEntry->unk_14 -
|
||||
(s32)((u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr));
|
||||
else
|
||||
} else {
|
||||
overlayEntry->unk_14 = NULL;
|
||||
}
|
||||
|
||||
if (overlayEntry->init != NULL)
|
||||
if (overlayEntry->init != NULL) {
|
||||
overlayEntry->init = (void*)((u32)overlayEntry->init -
|
||||
(s32)((u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr));
|
||||
else
|
||||
} else {
|
||||
overlayEntry->init = NULL;
|
||||
}
|
||||
|
||||
if (overlayEntry->destroy != NULL)
|
||||
if (overlayEntry->destroy != NULL) {
|
||||
overlayEntry->destroy = (void*)((u32)overlayEntry->destroy -
|
||||
(s32)((u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr));
|
||||
else
|
||||
} else {
|
||||
overlayEntry->destroy = NULL;
|
||||
}
|
||||
|
||||
if (overlayEntry->unk_20 != NULL)
|
||||
if (overlayEntry->unk_20 != NULL) {
|
||||
overlayEntry->unk_20 = (void*)((u32)overlayEntry->unk_20 -
|
||||
(s32)((u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr));
|
||||
else
|
||||
} else {
|
||||
overlayEntry->unk_20 = NULL;
|
||||
}
|
||||
|
||||
if (overlayEntry->unk_24 != NULL)
|
||||
if (overlayEntry->unk_24 != NULL) {
|
||||
overlayEntry->unk_24 = (void*)((u32)overlayEntry->unk_24 -
|
||||
(s32)((u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr));
|
||||
else
|
||||
} else {
|
||||
overlayEntry->unk_24 = NULL;
|
||||
}
|
||||
|
||||
overlayEntry->unk_28 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void Overlay_FreeGameState(GameStateOverlay* overlayEntry)
|
||||
{
|
||||
if (overlayEntry->loadedRamAddr != NULL)
|
||||
{
|
||||
void Overlay_FreeGameState(GameStateOverlay* overlayEntry) {
|
||||
if (overlayEntry->loadedRamAddr != NULL) {
|
||||
s32 temp = overlayEntry->unk_28 != 0 ? -1 : 0;
|
||||
|
||||
if (temp == 0)
|
||||
{
|
||||
if (overlayEntry->unk_14 != NULL)
|
||||
if (temp == 0) {
|
||||
if (overlayEntry->unk_14 != NULL) {
|
||||
overlayEntry->unk_14 = (void*)((u32)overlayEntry->unk_14 +
|
||||
(s32)((u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr));
|
||||
else
|
||||
} else {
|
||||
overlayEntry->unk_14 = NULL;
|
||||
}
|
||||
|
||||
if (overlayEntry->init != NULL)
|
||||
if (overlayEntry->init != NULL) {
|
||||
overlayEntry->init = (void*)((u32)overlayEntry->init +
|
||||
(s32)((u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr));
|
||||
else
|
||||
} else {
|
||||
overlayEntry->init = NULL;
|
||||
}
|
||||
|
||||
if (overlayEntry->destroy != NULL)
|
||||
if (overlayEntry->destroy != NULL) {
|
||||
overlayEntry->destroy = (void*)((u32)overlayEntry->destroy +
|
||||
(s32)((u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr));
|
||||
else
|
||||
} else {
|
||||
overlayEntry->destroy = NULL;
|
||||
}
|
||||
|
||||
if (overlayEntry->unk_20 != NULL)
|
||||
if (overlayEntry->unk_20 != NULL) {
|
||||
overlayEntry->unk_20 = (void*)((u32)overlayEntry->unk_20 +
|
||||
(s32)((u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr));
|
||||
else
|
||||
} else {
|
||||
overlayEntry->unk_20 = NULL;
|
||||
}
|
||||
|
||||
if (overlayEntry->unk_24 != NULL)
|
||||
if (overlayEntry->unk_24 != NULL) {
|
||||
overlayEntry->unk_24 = (void*)((u32)overlayEntry->unk_24 +
|
||||
(s32)((u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr));
|
||||
else
|
||||
} else {
|
||||
overlayEntry->unk_24 = NULL;
|
||||
}
|
||||
|
||||
SystemArena_FreeDebug(overlayEntry->loadedRamAddr, "../z_DLF.c", 149);
|
||||
overlayEntry->loadedRamAddr = NULL;
|
||||
|
||||
+1597
-2085
File diff suppressed because it is too large
Load Diff
+22
-36
@@ -2,24 +2,19 @@
|
||||
#include <global.h>
|
||||
#include <initvars.h>
|
||||
|
||||
#define ACTOR_OVERLAY(name, allocType) \
|
||||
{ \
|
||||
(u32)_ovl_##name##SegmentRomStart, (u32)_ovl_##name##SegmentRomEnd, \
|
||||
_ovl_##name##SegmentStart, _ovl_##name##SegmentEnd, \
|
||||
NULL, &name##_InitVars, #name, allocType, 0 \
|
||||
#define ACTOR_OVERLAY(name, allocType) \
|
||||
{ \
|
||||
(u32) _ovl_##name##SegmentRomStart, (u32)_ovl_##name##SegmentRomEnd, _ovl_##name##SegmentStart, \
|
||||
_ovl_##name##SegmentEnd, NULL, &name##_InitVars, #name, allocType, 0 \
|
||||
}
|
||||
|
||||
#define ACTOR_OVERLAY_INTERNAL(name, allocType) \
|
||||
{ \
|
||||
0, 0, \
|
||||
NULL, NULL, \
|
||||
NULL, &name##_InitVars, #name, allocType, 0 \
|
||||
}
|
||||
#define ACTOR_OVERLAY_INTERNAL(name, allocType) \
|
||||
{ 0, 0, NULL, NULL, NULL, &name##_InitVars, #name, allocType, 0 }
|
||||
|
||||
#define ACTOR_OVERLAY_UNSET { 0 }
|
||||
#define ACTOR_OVERLAY_UNSET \
|
||||
{ 0 }
|
||||
|
||||
ActorOverlay gActorOverlayTable[] =
|
||||
{
|
||||
ActorOverlay gActorOverlayTable[] = {
|
||||
ACTOR_OVERLAY_INTERNAL(Player, ALLOCTYPE_NORMAL),
|
||||
ACTOR_OVERLAY_UNSET,
|
||||
ACTOR_OVERLAY(En_Test, ALLOCTYPE_NORMAL),
|
||||
@@ -497,26 +492,21 @@ s32 gMaxProfile = 0;
|
||||
|
||||
static FaultClient sFaultClient;
|
||||
|
||||
void ActorOverlayTable_LogPrint(void)
|
||||
{
|
||||
void ActorOverlayTable_LogPrint(void) {
|
||||
ActorOverlay* overlayEntry;
|
||||
u32 i;
|
||||
|
||||
osSyncPrintf("actor_dlftbls %u\n", gMaxProfile);
|
||||
osSyncPrintf("RomStart RomEnd SegStart SegEnd allocp profile segname\n");
|
||||
|
||||
for (i = 0, overlayEntry = &gActorOverlayTable[0]; i < gMaxProfile; i++, overlayEntry++)
|
||||
{
|
||||
osSyncPrintf("%08x %08x %08x %08x %08x %08x %s\n",
|
||||
overlayEntry->vromStart, overlayEntry->vromEnd,
|
||||
overlayEntry->vramStart, overlayEntry->vramEnd,
|
||||
overlayEntry->loadedRamAddr, &overlayEntry->initInfo->id,
|
||||
overlayEntry->name != NULL ? overlayEntry->name : "?");
|
||||
for (i = 0, overlayEntry = &gActorOverlayTable[0]; i < gMaxProfile; i++, overlayEntry++) {
|
||||
osSyncPrintf("%08x %08x %08x %08x %08x %08x %s\n", overlayEntry->vromStart, overlayEntry->vromEnd,
|
||||
overlayEntry->vramStart, overlayEntry->vramEnd, overlayEntry->loadedRamAddr,
|
||||
&overlayEntry->initInfo->id, overlayEntry->name != NULL ? overlayEntry->name : "?");
|
||||
}
|
||||
}
|
||||
|
||||
void ActorOverlayTable_FaultPrint(void* arg0, void* arg1)
|
||||
{
|
||||
void ActorOverlayTable_FaultPrint(void* arg0, void* arg1) {
|
||||
ActorOverlay* overlayEntry;
|
||||
u32 overlaySize;
|
||||
s32 i;
|
||||
@@ -526,26 +516,22 @@ void ActorOverlayTable_FaultPrint(void* arg0, void* arg1)
|
||||
FaultDrawer_Printf("actor_dlftbls %u\n", gMaxProfile);
|
||||
FaultDrawer_Printf("No. RamStart- RamEnd cn Name\n");
|
||||
|
||||
for (i = 0, overlayEntry = &gActorOverlayTable[0]; i < gMaxProfile; i++, overlayEntry++)
|
||||
{
|
||||
for (i = 0, overlayEntry = &gActorOverlayTable[0]; i < gMaxProfile; i++, overlayEntry++) {
|
||||
overlaySize = (u32)overlayEntry->vramEnd - (u32)overlayEntry->vramStart;
|
||||
if (overlayEntry->loadedRamAddr != NULL)
|
||||
{
|
||||
FaultDrawer_Printf("%3d %08x-%08x %3d %s\n",
|
||||
i, overlayEntry->loadedRamAddr, (u32)overlayEntry->loadedRamAddr + overlaySize,
|
||||
overlayEntry->nbLoaded, overlayEntry->name != NULL ? overlayEntry->name : "");
|
||||
if (overlayEntry->loadedRamAddr != NULL) {
|
||||
FaultDrawer_Printf("%3d %08x-%08x %3d %s\n", i, overlayEntry->loadedRamAddr,
|
||||
(u32)overlayEntry->loadedRamAddr + overlaySize, overlayEntry->nbLoaded,
|
||||
overlayEntry->name != NULL ? overlayEntry->name : "");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ActorOverlayTable_Init(void)
|
||||
{
|
||||
void ActorOverlayTable_Init(void) {
|
||||
gMaxProfile = ACTOR_DLF_MAX;
|
||||
Fault_AddClient(&sFaultClient, ActorOverlayTable_FaultPrint, NULL, NULL);
|
||||
}
|
||||
|
||||
void ActorOverlayTable_Cleanup(void)
|
||||
{
|
||||
void ActorOverlayTable_Cleanup(void) {
|
||||
Fault_RemoveClient(&sFaultClient);
|
||||
gMaxProfile = 0;
|
||||
}
|
||||
|
||||
+81
-107
@@ -3,47 +3,41 @@
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80038600.s")
|
||||
|
||||
void func_80038708(s16* puParm1, s16* puParm2, u16 uParm3)
|
||||
{
|
||||
*puParm1 = *puParm2;
|
||||
puParm1[1] = uParm3;
|
||||
void func_80038708(s16* puParm1, s16* puParm2, u16 uParm3) {
|
||||
*puParm1 = *puParm2;
|
||||
puParm1[1] = uParm3;
|
||||
}
|
||||
|
||||
void func_8003871C(u16* puParm1)
|
||||
{
|
||||
*puParm1 = 0xFFFF;
|
||||
void func_8003871C(u16* puParm1) {
|
||||
*puParm1 = 0xFFFF;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80038728.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80038780.s")
|
||||
|
||||
void func_800387FC(u32 uParm1, u32* puParm2)
|
||||
{
|
||||
*puParm2 = 0;
|
||||
puParm2[1] = 0;
|
||||
void func_800387FC(u32 uParm1, u32* puParm2) {
|
||||
*puParm2 = 0;
|
||||
puParm2[1] = 0;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_8003880C.s")
|
||||
|
||||
void func_80038870(int iParm1)
|
||||
{
|
||||
*(u32*)(iParm1 + 4) = 0;
|
||||
void func_80038870(int iParm1) {
|
||||
*(u32*)(iParm1 + 4) = 0;
|
||||
}
|
||||
|
||||
u32 func_80038878(s32 iParm1)
|
||||
{
|
||||
u32 uVar1;
|
||||
|
||||
uVar1 = *(u32*)(iParm1 + 4) & 0xffff;
|
||||
*(int *)(iParm1 + 4) = *(u32*)(iParm1 + 4) + 1;
|
||||
|
||||
if (*(int *)(iParm1 + 8) <= (int)uVar1)
|
||||
{
|
||||
return 0xffff;
|
||||
}
|
||||
u32 func_80038878(s32 iParm1) {
|
||||
u32 uVar1;
|
||||
|
||||
return uVar1;
|
||||
uVar1 = *(u32*)(iParm1 + 4) & 0xffff;
|
||||
*(int*)(iParm1 + 4) = *(u32*)(iParm1 + 4) + 1;
|
||||
|
||||
if (*(int*)(iParm1 + 8) <= (int)uVar1) {
|
||||
return 0xffff;
|
||||
}
|
||||
|
||||
return uVar1;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_800388A8.s")
|
||||
@@ -56,7 +50,6 @@ u32 func_80038878(s32 iParm1)
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80038A28.s")
|
||||
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80038B7C.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80038BE0.s")
|
||||
@@ -175,12 +168,11 @@ u32 func_80038878(s32 iParm1)
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_8003E214.s")
|
||||
|
||||
void func_8003E398(u16* puParm1)
|
||||
{
|
||||
*puParm1 = 0;
|
||||
puParm1[1] = 0;
|
||||
*(u32*)(puParm1 + 2) = 0;
|
||||
*(u32*)(puParm1 + 4) = 0;
|
||||
void func_8003E398(u16* puParm1) {
|
||||
*puParm1 = 0;
|
||||
puParm1[1] = 0;
|
||||
*(u32*)(puParm1 + 2) = 0;
|
||||
*(u32*)(puParm1 + 4) = 0;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_8003E3AC.s")
|
||||
@@ -195,15 +187,12 @@ void func_8003E398(u16* puParm1)
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_8003E688.s")
|
||||
|
||||
void func_8003E6C4(u16* puParm1)
|
||||
{
|
||||
*puParm1 = 0;
|
||||
func_8003E688();
|
||||
void func_8003E6C4(u16* puParm1) {
|
||||
*puParm1 = 0;
|
||||
func_8003E688();
|
||||
}
|
||||
|
||||
|
||||
void func_8003E6E4(u16* a0)
|
||||
{
|
||||
void func_8003E6E4(u16* a0) {
|
||||
*a0 = 0;
|
||||
}
|
||||
|
||||
@@ -211,21 +200,17 @@ void func_8003E6E4(u16* a0)
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_8003E750.s")
|
||||
|
||||
void func_8003E804(int iParm1)
|
||||
{
|
||||
func_8003E5B4(iParm1 + 0x14, iParm1 + 0x34);
|
||||
void func_8003E804(int iParm1) {
|
||||
func_8003E5B4(iParm1 + 0x14, iParm1 + 0x34);
|
||||
}
|
||||
|
||||
|
||||
void func_8003E82C(u32* a0)
|
||||
{
|
||||
void func_8003E82C(u32* a0) {
|
||||
*a0 = 0;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_8003E834.s")
|
||||
|
||||
void func_8003E888(u32* a0)
|
||||
{
|
||||
void func_8003E888(u32* a0) {
|
||||
*a0 = 0;
|
||||
}
|
||||
|
||||
@@ -235,8 +220,7 @@ void func_8003E888(u32* a0)
|
||||
|
||||
/*
|
||||
NON-MATCHING
|
||||
void func_8003E8EC(u32 uParm1, u32* iParm2)
|
||||
{
|
||||
void func_8003E8EC(u32 uParm1, u32* iParm2) {
|
||||
iParm2[0x06] = iParm2[0x0E];
|
||||
iParm2[0x05] = iParm2[0x0D];
|
||||
iParm2[0x07] = iParm2[0x0F];
|
||||
@@ -246,30 +230,28 @@ void func_8003E8EC(u32 uParm1, u32* iParm2)
|
||||
iParm2[0x0B] = iParm2[0x13];
|
||||
iParm2[0x0C] = iParm2[0x14];
|
||||
|
||||
|
||||
|
||||
//int i;
|
||||
//for (i = 0; i < 4; i++)
|
||||
//{
|
||||
//for (i = 0; i < 4; i++) {
|
||||
//iParm2[0x06 + (i * 2)] = iParm2[0x0E + (i * 2)];
|
||||
//iParm2[0x07 + (i * 2)] = iParm2[0x0D + (i * 2)];
|
||||
//}
|
||||
}
|
||||
*/
|
||||
|
||||
u32 func_8003E934(int iParm1)
|
||||
{
|
||||
if (!((-1 < iParm1) && (iParm1 < 0x32)))
|
||||
return 0;
|
||||
u32 func_8003E934(int iParm1) {
|
||||
if (!((-1 < iParm1) && (iParm1 < 0x32))) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
void func_8003E954(u32 uParm1, u8* puParm2)
|
||||
{
|
||||
*puParm2 = 1;
|
||||
func_8003E82C(puParm2 + 0x13f0);
|
||||
func_8003E888(puParm2 + 0x13f4);
|
||||
func_800387FC(uParm1, puParm2 + 0x13f8);
|
||||
void func_8003E954(u32 uParm1, u8* puParm2) {
|
||||
*puParm2 = 1;
|
||||
func_8003E82C(puParm2 + 0x13f0);
|
||||
func_8003E888(puParm2 + 0x13f4);
|
||||
func_800387FC(uParm1, puParm2 + 0x13f8);
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_8003E9A0.s")
|
||||
@@ -323,19 +305,16 @@ void func_8003E954(u32 uParm1, u8* puParm2)
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_800418D0.s")
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
void func_80041978(int iParm1, int iParm2)
|
||||
{
|
||||
u8* puVar1;
|
||||
void func_80041978(int iParm1, int iParm2) {
|
||||
u8* puVar1;
|
||||
|
||||
puVar1 = *(u8 **)(iParm1 + 8);
|
||||
if (puVar1 < puVar1 + iParm2)
|
||||
{
|
||||
*puVar1 = 0;
|
||||
while (puVar1++ < (u8*)(*(int *)(iParm1 + 8) + iParm2))
|
||||
{
|
||||
*puVar1 = 0;
|
||||
puVar1 = *(u8**)(iParm1 + 8);
|
||||
if (puVar1 < puVar1 + iParm2) {
|
||||
*puVar1 = 0;
|
||||
while (puVar1++ < (u8*)(*(int*)(iParm1 + 8) + iParm2)) {
|
||||
*puVar1 = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80041978.s")
|
||||
@@ -343,12 +322,11 @@ void func_80041978(int iParm1, int iParm2)
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_800419B0.s")
|
||||
|
||||
u32 func_80041A28(CollisionContext *a0, u32 a1, u32 a2)
|
||||
{
|
||||
u32 uVar1;
|
||||
|
||||
uVar1 = func_800419B0(a0, a1, a2, 0);
|
||||
return uVar1 & 0xff;
|
||||
u32 func_80041A28(CollisionContext* a0, u32 a1, u32 a2) {
|
||||
u32 uVar1;
|
||||
|
||||
uVar1 = func_800419B0(a0, a1, a2, 0);
|
||||
return uVar1 & 0xff;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80041A4C.s")
|
||||
@@ -365,12 +343,11 @@ u32 func_80041A28(CollisionContext *a0, u32 a1, u32 a2)
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80041D4C.s")
|
||||
|
||||
u32 func_80041D94(u32 a0, u32 a1, u32 a2)
|
||||
{
|
||||
u32 uVar1;
|
||||
|
||||
uVar1 = func_800419B0(a0, a1, a2, 0);
|
||||
return uVar1 >> 0x15 & 0x1f;
|
||||
u32 func_80041D94(u32 a0, u32 a1, u32 a2) {
|
||||
u32 uVar1;
|
||||
|
||||
uVar1 = func_800419B0(a0, a1, a2, 0);
|
||||
return uVar1 >> 0x15 & 0x1f;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80041DB8.s")
|
||||
@@ -385,12 +362,11 @@ u32 func_80041D94(u32 a0, u32 a1, u32 a2)
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80041EEC.s")
|
||||
|
||||
u32 func_80041F10(u32 a0, u32 a1, u32 a2)
|
||||
{
|
||||
u32 uVar1;
|
||||
|
||||
uVar1 = func_800419B0(a0, a1, a2, 1);
|
||||
return uVar1 & 0xf;
|
||||
u32 func_80041F10(u32 a0, u32 a1, u32 a2) {
|
||||
u32 uVar1;
|
||||
|
||||
uVar1 = func_800419B0(a0, a1, a2, 1);
|
||||
return uVar1 & 0xf;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80041F34.s")
|
||||
@@ -409,29 +385,28 @@ u32 func_80041F10(u32 a0, u32 a1, u32 a2)
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_800420E4.s")
|
||||
|
||||
u32 func_80042108(u32 a0, u32 a1, u32 a2)
|
||||
{
|
||||
u32 result;
|
||||
s32 var1;
|
||||
u32 func_80042108(u32 a0, u32 a1, u32 a2) {
|
||||
u32 result;
|
||||
s32 var1;
|
||||
|
||||
var1 = func_800419B0(a0, a1, a2, 1);
|
||||
var1 = func_800419B0(a0, a1, a2, 1);
|
||||
|
||||
if (var1 << 4 < 0)
|
||||
result = 1;
|
||||
else
|
||||
result = 0;
|
||||
if (var1 << 4 < 0) {
|
||||
result = 1;
|
||||
} else {
|
||||
result = 0;
|
||||
}
|
||||
|
||||
return result;
|
||||
return result;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_8004213C.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80042244.s")
|
||||
|
||||
u8 func_80042538(CollisionContext *colCtx, s32 iParm2)
|
||||
{
|
||||
u8 func_80042538(CollisionContext* colCtx, s32 iParm2) {
|
||||
u32 var1 = *(u32*)(iParm2 + 0xc);
|
||||
return var1;
|
||||
return var1;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80042548.s")
|
||||
@@ -451,4 +426,3 @@ u8 func_80042538(CollisionContext *colCtx, s32 iParm2)
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80042EF8.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80042FC4.s")
|
||||
|
||||
|
||||
+315
-421
File diff suppressed because it is too large
Load Diff
@@ -1,29 +1,29 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
void Draw_DListOpa(GlobalContext* globalCtx, u32 dlist)
|
||||
{
|
||||
void Draw_DListOpa(GlobalContext* globalCtx, u32 dlist) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[4];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_cheap_proc.c", 214);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_cheap_proc.c", 216), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_cheap_proc.c", 216),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, dlist);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_cheap_proc.c", 219);
|
||||
}
|
||||
|
||||
void Draw_DListXlu(GlobalContext* globalCtx, u32 dlist)
|
||||
{
|
||||
void Draw_DListXlu(GlobalContext* globalCtx, u32 dlist) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[4];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_cheap_proc.c", 228);
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_cheap_proc.c", 230), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_cheap_proc.c", 230),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, dlist);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_cheap_proc.c", 233);
|
||||
|
||||
@@ -7,15 +7,13 @@
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005B65C.s")
|
||||
|
||||
s32 func_8005B6A0(GlobalContext* globalCtx, Collider* collision)
|
||||
{
|
||||
s32 func_8005B6A0(GlobalContext* globalCtx, Collider* collision) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005B6B0.s")
|
||||
|
||||
s32 func_8005B6EC(GlobalContext* globalCtx, Collider* collision, Actor* actor, ColliderBodyInfo* src)
|
||||
{
|
||||
s32 func_8005B6EC(GlobalContext* globalCtx, Collider* collision, Actor* actor, ColliderBodyInfo* src) {
|
||||
collision->actor = actor;
|
||||
collision->unk_14 = src->unk_00;
|
||||
collision->colliderFlags = src->colliderFlags;
|
||||
@@ -26,8 +24,7 @@ s32 func_8005B6EC(GlobalContext* globalCtx, Collider* collision, Actor* actor, C
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 func_8005B72C(GlobalContext* globalCtx, Collider* collision, Actor* actor, ColliderBodyInfo* src)
|
||||
{
|
||||
s32 func_8005B72C(GlobalContext* globalCtx, Collider* collision, Actor* actor, ColliderBodyInfo* src) {
|
||||
collision->actor = actor;
|
||||
collision->unk_14 = src->unk_00;
|
||||
collision->colliderFlags = src->colliderFlags;
|
||||
@@ -38,20 +35,17 @@ s32 func_8005B72C(GlobalContext* globalCtx, Collider* collision, Actor* actor, C
|
||||
return 1;
|
||||
}
|
||||
|
||||
void func_8005B76C(GlobalContext* globalCtx, Collider* collision)
|
||||
{
|
||||
void func_8005B76C(GlobalContext* globalCtx, Collider* collision) {
|
||||
collision->at = NULL;
|
||||
collision->colliderFlags &= ~0x6;
|
||||
}
|
||||
|
||||
void func_8005B784(GlobalContext* globalCtx, Collider* collision)
|
||||
{
|
||||
void func_8005B784(GlobalContext* globalCtx, Collider* collision) {
|
||||
collision->ac = NULL;
|
||||
collision->collideFlags &= ~0x82;
|
||||
}
|
||||
|
||||
void func_8005B79C(GlobalContext* globalCtx, Collider* collision)
|
||||
{
|
||||
void func_8005B79C(GlobalContext* globalCtx, Collider* collision) {
|
||||
collision->ot = NULL;
|
||||
collision->maskA &= ~0x2;
|
||||
collision->maskB &= ~0x1;
|
||||
@@ -59,22 +53,18 @@ void func_8005B79C(GlobalContext* globalCtx, Collider* collision)
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005B7C0.s")
|
||||
|
||||
s32 func_8005B7E4(GlobalContext* globalCtx, ColliderTouch* touch)
|
||||
{
|
||||
s32 func_8005B7E4(GlobalContext* globalCtx, ColliderTouch* touch) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005B7F4.s")
|
||||
|
||||
void func_8005B818(GlobalContext* globalCtx, ColliderBody* body)
|
||||
{
|
||||
|
||||
void func_8005B818(GlobalContext* globalCtx, ColliderBody* body) {
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005B824.s")
|
||||
|
||||
s32 func_8005B850(GlobalContext* globalCtx, ColliderBump* bump)
|
||||
{
|
||||
s32 func_8005B850(GlobalContext* globalCtx, ColliderBump* bump) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -82,15 +72,13 @@ s32 func_8005B850(GlobalContext* globalCtx, ColliderBump* bump)
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005B884.s")
|
||||
|
||||
s32 func_8005B904(GlobalContext* globalCtx, ColliderBody* body)
|
||||
{
|
||||
s32 func_8005B904(GlobalContext* globalCtx, ColliderBody* body) {
|
||||
func_8005B7E4(globalCtx, &body->toucher);
|
||||
func_8005B850(globalCtx, &body->bumper);
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 func_8005B93C(GlobalContext* globalCtx, ColliderBody* body, ColliderBodyInfoInner* bodyInfoInner)
|
||||
{
|
||||
s32 func_8005B93C(GlobalContext* globalCtx, ColliderBody* body, ColliderBodyInfoInner* bodyInfoInner) {
|
||||
body->flags = bodyInfoInner->bodyFlags;
|
||||
func_8005B7F4(globalCtx, &body->toucher, &bodyInfoInner->toucherMask);
|
||||
func_8005B860(globalCtx, &body->bumper, &bodyInfoInner->bumperMask);
|
||||
@@ -100,8 +88,7 @@ s32 func_8005B93C(GlobalContext* globalCtx, ColliderBody* body, ColliderBodyInfo
|
||||
return 1;
|
||||
}
|
||||
|
||||
void func_8005B9B0(GlobalContext* globalCtx, ColliderBody* body)
|
||||
{
|
||||
void func_8005B9B0(GlobalContext* globalCtx, ColliderBody* body) {
|
||||
body->unk_18 = 0;
|
||||
body->unk_20 = 0;
|
||||
body->toucherFlags &= ~0x2;
|
||||
@@ -109,8 +96,7 @@ void func_8005B9B0(GlobalContext* globalCtx, ColliderBody* body)
|
||||
func_8005B818(globalCtx, body);
|
||||
}
|
||||
|
||||
void func_8005B9E8(GlobalContext* globalCtx, ColliderBody* body)
|
||||
{
|
||||
void func_8005B9E8(GlobalContext* globalCtx, ColliderBody* body) {
|
||||
body->bumper.unk_0A = 0;
|
||||
body->bumperFlags &= ~0x2;
|
||||
body->bumperFlags &= ~0x80;
|
||||
@@ -120,15 +106,13 @@ void func_8005B9E8(GlobalContext* globalCtx, ColliderBody* body)
|
||||
body->bumper.unk_06 = body->bumper.unk_0A;
|
||||
}
|
||||
|
||||
void func_8005BA1C(GlobalContext* globalCtx, ColliderBody* body)
|
||||
{
|
||||
void func_8005BA1C(GlobalContext* globalCtx, ColliderBody* body) {
|
||||
body->flags2 &= ~0x2;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005BA30.s")
|
||||
|
||||
s32 func_8005BA74(UNK_TYPE arg0, UNK_TYPE arg1)
|
||||
{
|
||||
s32 func_8005BA74(UNK_TYPE arg0, UNK_TYPE arg1) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -158,73 +142,64 @@ s32 func_8005BA74(UNK_TYPE arg0, UNK_TYPE arg1)
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005C2BC.s")
|
||||
|
||||
s32 func_8005C318(GlobalContext* globalCtx, ColliderDimensions* dim)
|
||||
{
|
||||
s32 func_8005C318(GlobalContext* globalCtx, ColliderDimensions* dim) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 func_8005C328(GlobalContext* globalCtx, ColliderDimensions* dest, ColliderDimensions* src)
|
||||
{
|
||||
s32 func_8005C328(GlobalContext* globalCtx, ColliderDimensions* dest, ColliderDimensions* src) {
|
||||
*dest = *src;
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 ActorCollider_AllocCylinder(GlobalContext* globalCtx, ColliderCylinderMain* collision)
|
||||
{
|
||||
s32 ActorCollider_AllocCylinder(GlobalContext* globalCtx, ColliderCylinderMain* collision) {
|
||||
func_8005B65C(globalCtx, &collision->base);
|
||||
func_8005B884(globalCtx, &collision->body);
|
||||
func_8005C2BC(globalCtx, &collision->dim);
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 ActorCollider_FreeCylinder(GlobalContext* globalCtx, ColliderCylinderMain* collision)
|
||||
{
|
||||
s32 ActorCollider_FreeCylinder(GlobalContext* globalCtx, ColliderCylinderMain* collision) {
|
||||
func_8005B6A0(globalCtx, &collision->base);
|
||||
func_8005B904(globalCtx, &collision->body);
|
||||
func_8005C318(globalCtx, &collision->dim);
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 func_8005C3F4(GlobalContext* globalCtx, ColliderCylinderMain* collision, ColliderCylinderInit* src)
|
||||
{
|
||||
s32 func_8005C3F4(GlobalContext* globalCtx, ColliderCylinderMain* collision, ColliderCylinderInit* src) {
|
||||
func_8005B6B0(globalCtx, &collision->base, &src->body);
|
||||
func_8005B93C(globalCtx, &collision->body, &src->inner);
|
||||
func_8005C328(globalCtx, &collision->dim, &src->dim);
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 func_8005C450(GlobalContext* globalCtx, ColliderCylinderMain* collision, Actor* actor, ColliderCylinderInit* src)
|
||||
{
|
||||
s32 func_8005C450(GlobalContext* globalCtx, ColliderCylinderMain* collision, Actor* actor, ColliderCylinderInit* src) {
|
||||
func_8005B6EC(globalCtx, &collision->base, actor, &src->body);
|
||||
func_8005B93C(globalCtx, &collision->body, &src->inner);
|
||||
func_8005C328(globalCtx, &collision->dim, &src->dim);
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 ActorCollider_InitCylinder(GlobalContext* globalCtx, ColliderCylinderMain* collision, Actor* actor, ColliderCylinderInit* src)
|
||||
{
|
||||
s32 ActorCollider_InitCylinder(GlobalContext* globalCtx, ColliderCylinderMain* collision, Actor* actor,
|
||||
ColliderCylinderInit* src) {
|
||||
func_8005B72C(globalCtx, &collision->base, actor, &src->body);
|
||||
func_8005B93C(globalCtx, &collision->body, &src->inner);
|
||||
func_8005C328(globalCtx, &collision->dim, &src->dim);
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 func_8005C508(GlobalContext* globalCtx, ColliderCylinderMain* collision)
|
||||
{
|
||||
s32 func_8005C508(GlobalContext* globalCtx, ColliderCylinderMain* collision) {
|
||||
func_8005B76C(globalCtx, &collision->base);
|
||||
func_8005B9B0(globalCtx, &collision->body);
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 func_8005C540(GlobalContext* globalCtx, ColliderCylinderMain* collision)
|
||||
{
|
||||
s32 func_8005C540(GlobalContext* globalCtx, ColliderCylinderMain* collision) {
|
||||
func_8005B784(globalCtx, &collision->base);
|
||||
func_8005B9E8(globalCtx, &collision->body);
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 func_8005C578(GlobalContext* globalCtx, ColliderCylinderMain* collision)
|
||||
{
|
||||
s32 func_8005C578(GlobalContext* globalCtx, ColliderCylinderMain* collision) {
|
||||
func_8005B79C(globalCtx, &collision->base);
|
||||
func_8005BA1C(globalCtx, &collision->body);
|
||||
return 1;
|
||||
@@ -232,8 +207,7 @@ s32 func_8005C578(GlobalContext* globalCtx, ColliderCylinderMain* collision)
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005C5B0.s")
|
||||
|
||||
s32 func_8005C5F8(UNK_TYPE arg0, UNK_TYPE arg1)
|
||||
{
|
||||
s32 func_8005C5F8(UNK_TYPE arg0, UNK_TYPE arg1) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -269,55 +243,48 @@ s32 func_8005CEB4(GlobalContext* globalCtx, ColliderDimensions* dim) {
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005CF90.s")
|
||||
|
||||
s32 func_8005D018(GlobalContext* globalCtx, ColliderCylinderMain* collision)
|
||||
{
|
||||
s32 func_8005D018(GlobalContext* globalCtx, ColliderCylinderMain* collision) {
|
||||
func_8005B65C(globalCtx, &collision->base);
|
||||
func_8005B884(globalCtx, &collision->body);
|
||||
func_8005CE6C(globalCtx, &collision->dim);
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 func_8005D060(GlobalContext* globalCtx, ColliderCylinderMain* collision)
|
||||
{
|
||||
s32 func_8005D060(GlobalContext* globalCtx, ColliderCylinderMain* collision) {
|
||||
func_8005B6A0(globalCtx, &collision->base);
|
||||
func_8005B904(globalCtx, &collision->body);
|
||||
func_8005CEB4(globalCtx, &collision->dim);
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 func_8005D0A8(GlobalContext* globalCtx, ColliderCylinderMain* collision, Actor* actor, ColliderCylinderInit* src)
|
||||
{
|
||||
s32 func_8005D0A8(GlobalContext* globalCtx, ColliderCylinderMain* collision, Actor* actor, ColliderCylinderInit* src) {
|
||||
func_8005B6EC(globalCtx, &collision->base, actor, &src->body);
|
||||
func_8005B93C(globalCtx, &collision->body, &src->inner);
|
||||
func_8005CF90(globalCtx, &collision->dim, &src->dim);
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 func_8005D104(GlobalContext* globalCtx, ColliderCylinderMain* collision, Actor* actor, ColliderCylinderInit* src)
|
||||
{
|
||||
s32 func_8005D104(GlobalContext* globalCtx, ColliderCylinderMain* collision, Actor* actor, ColliderCylinderInit* src) {
|
||||
func_8005B72C(globalCtx, &collision->base, actor, &src->body);
|
||||
func_8005B93C(globalCtx, &collision->body, &src->inner);
|
||||
func_8005CF90(globalCtx, &collision->dim, &src->dim);
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 func_8005D160(GlobalContext* globalCtx, ColliderCylinderMain* collision)
|
||||
{
|
||||
s32 func_8005D160(GlobalContext* globalCtx, ColliderCylinderMain* collision) {
|
||||
func_8005B76C(globalCtx, &collision->base);
|
||||
func_8005B9B0(globalCtx, &collision->body);
|
||||
func_8005CEC4(globalCtx, &collision->dim);
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 func_8005D1A8(GlobalContext* globalCtx, ColliderCylinderMain* collision)
|
||||
{
|
||||
s32 func_8005D1A8(GlobalContext* globalCtx, ColliderCylinderMain* collision) {
|
||||
func_8005B784(globalCtx, &collision->base);
|
||||
func_8005B9E8(globalCtx, &collision->body);
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 func_8005D1E0(GlobalContext* globalCtx, ColliderCylinderMain* collision)
|
||||
{
|
||||
s32 func_8005D1E0(GlobalContext* globalCtx, ColliderCylinderMain* collision) {
|
||||
func_8005B79C(globalCtx, &collision->base);
|
||||
func_8005BA1C(globalCtx, &collision->body);
|
||||
return 1;
|
||||
@@ -331,9 +298,7 @@ s32 func_8005D1E0(GlobalContext* globalCtx, ColliderCylinderMain* collision)
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005D3BC.s")
|
||||
|
||||
void func_8005D400(UNK_TYPE arg0, UNK_TYPE arg1)
|
||||
{
|
||||
|
||||
void func_8005D400(UNK_TYPE arg0, UNK_TYPE arg1) {
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005D40C.s")
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
void SaveContext_Init(void)
|
||||
{
|
||||
void SaveContext_Init(void) {
|
||||
bzero(&gSaveContext, sizeof(gSaveContext));
|
||||
D_8015FA88 = 0;
|
||||
D_8015FA8C = 0;
|
||||
@@ -18,4 +17,3 @@ void SaveContext_Init(void)
|
||||
gSaveContext.transition_type = 0xFF;
|
||||
gSaveContext.unk_13EE = 50;
|
||||
}
|
||||
|
||||
|
||||
+35
-42
@@ -1,15 +1,13 @@
|
||||
#include <ultra64.h>
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
void func_80110990(GlobalContext* globalCtx)
|
||||
{
|
||||
void func_80110990(GlobalContext* globalCtx) {
|
||||
func_80080F44(globalCtx);
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// regalloc, stack usage and minor ordering differences
|
||||
void func_801109B0(GlobalContext* globalCtx)
|
||||
{
|
||||
void func_801109B0(GlobalContext* globalCtx) {
|
||||
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
|
||||
s32 parameterStart;
|
||||
s32 parameterSize;
|
||||
@@ -32,9 +30,9 @@ void func_801109B0(GlobalContext* globalCtx)
|
||||
interfaceCtx->unk_228 = XREG(95);
|
||||
interfaceCtx->minimapAlpha = 0;
|
||||
interfaceCtx->unk_260 = 0;
|
||||
interfaceCtx->unk_244 = interfaceCtx->aAlpha = interfaceCtx->bAlpha =
|
||||
interfaceCtx->cLeftAlpha = interfaceCtx->cDownAlpha = interfaceCtx->cRightAlpha =
|
||||
interfaceCtx->healthAlpha = interfaceCtx->startAlpha = interfaceCtx->magicAlpha = 0;
|
||||
interfaceCtx->unk_244 = interfaceCtx->aAlpha = interfaceCtx->bAlpha = interfaceCtx->cLeftAlpha =
|
||||
interfaceCtx->cDownAlpha = interfaceCtx->cRightAlpha = interfaceCtx->healthAlpha = interfaceCtx->startAlpha =
|
||||
interfaceCtx->magicAlpha = 0;
|
||||
|
||||
parameterStart = _parameter_staticSegmentRomStart;
|
||||
parameterSize = _parameter_staticSegmentRomEnd - parameterStart;
|
||||
@@ -48,7 +46,7 @@ void func_801109B0(GlobalContext* globalCtx)
|
||||
|
||||
if (interfaceCtx->parameterSegment == NULL)
|
||||
__assert("parameter->parameterSegment != NULL", "../z_construct.c", 161);
|
||||
|
||||
|
||||
DmaMgr_SendRequest1(interfaceCtx->parameterSegment, parameterStart, parameterSize, "../z_construct.c", 162);
|
||||
|
||||
interfaceCtx->do_actionSegment = Game_Alloc(&globalCtx->state, 0x480, "../z_construct.c", 166);
|
||||
@@ -69,7 +67,8 @@ void func_801109B0(GlobalContext* globalCtx)
|
||||
else
|
||||
do_actionOffset = 0x5700;
|
||||
|
||||
DmaMgr_SendRequest1(interfaceCtx->do_actionSegment, do_actionStart + do_actionOffset, 0x300, "../z_construct.c", 174);
|
||||
DmaMgr_SendRequest1(interfaceCtx->do_actionSegment, do_actionStart + do_actionOffset, 0x300, "../z_construct.c",
|
||||
174);
|
||||
|
||||
if (gSaveContext.language == 0)
|
||||
do_actionOffset = 0x480;
|
||||
@@ -78,7 +77,8 @@ void func_801109B0(GlobalContext* globalCtx)
|
||||
else
|
||||
do_actionOffset = 0x5B80;
|
||||
|
||||
DmaMgr_SendRequest1((void*)((u32)interfaceCtx->do_actionSegment + 0x300), do_actionStart + do_actionOffset, 0x180, "../z_construct.c", 178);
|
||||
DmaMgr_SendRequest1((void*)((u32)interfaceCtx->do_actionSegment + 0x300), do_actionStart + do_actionOffset, 0x180,
|
||||
"../z_construct.c", 178);
|
||||
|
||||
interfaceCtx->icon_itemSegment = Game_Alloc(&globalCtx->state, 0x4000, "../z_construct.c", 190);
|
||||
|
||||
@@ -89,45 +89,42 @@ void func_801109B0(GlobalContext* globalCtx)
|
||||
if (interfaceCtx->icon_itemSegment == NULL)
|
||||
__assert("parameter->icon_itemSegment != NULL", "../z_construct.c", 193);
|
||||
|
||||
osSyncPrintf("Register_Item[%x, %x, %x, %x]\n",
|
||||
gSaveContext.equips.button_items[0], gSaveContext.equips.button_items[1],
|
||||
gSaveContext.equips.button_items[2], gSaveContext.equips.button_items[3]);
|
||||
osSyncPrintf("Register_Item[%x, %x, %x, %x]\n", gSaveContext.equips.button_items[0],
|
||||
gSaveContext.equips.button_items[1], gSaveContext.equips.button_items[2],
|
||||
gSaveContext.equips.button_items[3]);
|
||||
|
||||
if (gSaveContext.equips.button_items[0] < 0xF0)
|
||||
DmaMgr_SendRequest1(interfaceCtx->icon_itemSegment,
|
||||
_icon_item_staticSegmentRomStart + gSaveContext.equips.button_items[0] * 0x80,
|
||||
0x1000, "../z_construct.c", 198);
|
||||
_icon_item_staticSegmentRomStart + gSaveContext.equips.button_items[0] * 0x80, 0x1000,
|
||||
"../z_construct.c", 198);
|
||||
else if (gSaveContext.equips.button_items[0] != 0xFF)
|
||||
DmaMgr_SendRequest1(interfaceCtx->icon_itemSegment,
|
||||
_icon_item_staticSegmentRomStart + gSaveContext.equips.button_items[0] * 0x80,
|
||||
0x1000, "../z_construct.c", 203);
|
||||
_icon_item_staticSegmentRomStart + gSaveContext.equips.button_items[0] * 0x80, 0x1000,
|
||||
"../z_construct.c", 203);
|
||||
|
||||
if (gSaveContext.equips.button_items[1] < 0xF0)
|
||||
DmaMgr_SendRequest1((void*)((u32)interfaceCtx->icon_itemSegment + 0x1000),
|
||||
_icon_item_staticSegmentRomStart + gSaveContext.equips.button_items[1] * 0x80,
|
||||
0x1000, "../z_construct.c", 209);
|
||||
_icon_item_staticSegmentRomStart + gSaveContext.equips.button_items[1] * 0x80, 0x1000,
|
||||
"../z_construct.c", 209);
|
||||
|
||||
if (gSaveContext.equips.button_items[2] < 0xF0)
|
||||
DmaMgr_SendRequest1((void*)((u32)interfaceCtx->icon_itemSegment + 0x2000),
|
||||
_icon_item_staticSegmentRomStart + gSaveContext.equips.button_items[2] * 0x80,
|
||||
0x1000, "../z_construct.c", 214);
|
||||
_icon_item_staticSegmentRomStart + gSaveContext.equips.button_items[2] * 0x80, 0x1000,
|
||||
"../z_construct.c", 214);
|
||||
|
||||
if (gSaveContext.equips.button_items[3] < 0xF0)
|
||||
DmaMgr_SendRequest1((void*)((u32)interfaceCtx->icon_itemSegment + 0x3000),
|
||||
_icon_item_staticSegmentRomStart + gSaveContext.equips.button_items[3] * 0x80,
|
||||
0x1000, "../z_construct.c", 219);
|
||||
_icon_item_staticSegmentRomStart + gSaveContext.equips.button_items[3] * 0x80, 0x1000,
|
||||
"../z_construct.c", 219);
|
||||
|
||||
osSyncPrintf("EVENT=%d\n", gSaveContext.timer_1_state);
|
||||
|
||||
if ((gSaveContext.timer_1_state == 4) || (gSaveContext.timer_1_state == 8) ||
|
||||
(gSaveContext.timer_2_state == 4) || (gSaveContext.timer_2_state == 10))
|
||||
{
|
||||
if ((gSaveContext.timer_1_state == 4) || (gSaveContext.timer_1_state == 8) || (gSaveContext.timer_2_state == 4) ||
|
||||
(gSaveContext.timer_2_state == 10)) {
|
||||
osSyncPrintf("restart_flag=%d\n", gSaveContext.respawn_flag);
|
||||
|
||||
if ((gSaveContext.respawn_flag == -1) || (gSaveContext.respawn_flag == 1))
|
||||
{
|
||||
if (gSaveContext.timer_1_state == 4)
|
||||
{
|
||||
if ((gSaveContext.respawn_flag == -1) || (gSaveContext.respawn_flag == 1)) {
|
||||
if (gSaveContext.timer_1_state == 4) {
|
||||
gSaveContext.timer_1_state = 1;
|
||||
gSaveContext.timer_x[0] = 140;
|
||||
gSaveContext.timer_y[0] = 80;
|
||||
@@ -147,8 +144,7 @@ void func_801109B0(GlobalContext* globalCtx)
|
||||
gSaveContext.timer_y[temp] = 46;
|
||||
}
|
||||
|
||||
if ((gSaveContext.timer_1_state >= 11) && (gSaveContext.timer_1_state < 16))
|
||||
{
|
||||
if ((gSaveContext.timer_1_state >= 11) && (gSaveContext.timer_1_state < 16)) {
|
||||
gSaveContext.timer_1_state = 0;
|
||||
// Translates to: "Timer Stop!!!!!!!!!!!!!!!!!!!!!!"
|
||||
osSyncPrintf("タイマー停止!!!!!!!!!!!!!!!!!!!!! = %d\n", gSaveContext.timer_1_state);
|
||||
@@ -179,8 +175,7 @@ void func_801109B0(GlobalContext* globalCtx)
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_construct/func_801109B0.s")
|
||||
#endif
|
||||
|
||||
void func_80110F68(GlobalContext* globalCtx)
|
||||
{
|
||||
void func_80110F68(GlobalContext* globalCtx) {
|
||||
MessageContext* msgCtx = &globalCtx->msgCtx;
|
||||
s32 pad;
|
||||
|
||||
@@ -202,16 +197,16 @@ void func_80110F68(GlobalContext* globalCtx)
|
||||
// Translates to: "Textbox game_alloc=%x"
|
||||
osSyncPrintf("吹き出しgame_alloc=%x\n", 0x2200);
|
||||
|
||||
if (msgCtx->textboxSegment == NULL)
|
||||
if (msgCtx->textboxSegment == NULL) {
|
||||
__assert("message->fukidashiSegment != NULL", "../z_construct.c", 352);
|
||||
}
|
||||
|
||||
func_8006EF10(&globalCtx->msgCtx.unk_128);
|
||||
|
||||
YREG(31) = 0;
|
||||
}
|
||||
|
||||
void func_80111070(void)
|
||||
{
|
||||
void func_80111070(void) {
|
||||
YREG(8) = 0xA;
|
||||
YREG(14) = 0;
|
||||
YREG(15) = 0;
|
||||
@@ -526,8 +521,7 @@ void func_80111070(void)
|
||||
WREG(94) = 3;
|
||||
WREG(95) = 6;
|
||||
|
||||
if (gSaveContext.game_mode == 0)
|
||||
{
|
||||
if (gSaveContext.game_mode == 0) {
|
||||
VREG(0) = 0x34;
|
||||
VREG(1) = 0x24;
|
||||
VREG(2) = 0xD6;
|
||||
@@ -618,7 +612,6 @@ void func_80111070(void)
|
||||
VREG(92) = -0x3F;
|
||||
}
|
||||
|
||||
void func_80112098(GlobalContext* globalCtx)
|
||||
{
|
||||
void func_80112098(GlobalContext* globalCtx) {
|
||||
func_80111070();
|
||||
}
|
||||
|
||||
+87
-135
@@ -5,73 +5,43 @@
|
||||
#include <regs.h>
|
||||
#include <PR/os_cont.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
u8 x;
|
||||
u8 y;
|
||||
u8 colorId;
|
||||
char text[0x15];
|
||||
} PrintTextBuffer;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
u16 push;
|
||||
u16 held;
|
||||
} InputCombo;
|
||||
|
||||
GameInfo* gGameInfo;
|
||||
int D_8015FA94; //no known symbols
|
||||
GameInfo* gGameInfo;
|
||||
int D_8015FA94; // no known symbols
|
||||
PrintTextBuffer D_8015FA98[0x16];
|
||||
|
||||
s16 D_8011E0B0 = 0; //PrintTextBuffer index
|
||||
s16 D_8011E0B0 = 0; // PrintTextBuffer index
|
||||
Color_RGBA8 printTextColors[] = {
|
||||
{ 0xFF, 0xFF, 0x20, 0xC0 },
|
||||
{ 0xFF, 0x96, 0x80, 0xC0 },
|
||||
{ 0x80, 0x60, 0x00, 0x40 },
|
||||
{ 0xC0, 0x80, 0x10, 0x80 },
|
||||
{ 0xFF, 0xC0, 0x20, 0x80 },
|
||||
{ 0xE6, 0xE6, 0xDC, 0x40 },
|
||||
{ 0x80, 0x96, 0xFF, 0x80 },
|
||||
{ 0x80, 0xFF, 0x20, 0x80 },
|
||||
{ 0xFF, 0xFF, 0x20, 0xC0 }, { 0xFF, 0x96, 0x80, 0xC0 }, { 0x80, 0x60, 0x00, 0x40 }, { 0xC0, 0x80, 0x10, 0x80 },
|
||||
{ 0xFF, 0xC0, 0x20, 0x80 }, { 0xE6, 0xE6, 0xDC, 0x40 }, { 0x80, 0x96, 0xFF, 0x80 }, { 0x80, 0xFF, 0x20, 0x80 },
|
||||
};
|
||||
|
||||
InputCombo inputCombos[REG_GROUPS] = {
|
||||
{ L_TRIG, U_CBUTTONS },
|
||||
{ L_TRIG, L_CBUTTONS },
|
||||
{ L_TRIG, D_CBUTTONS },
|
||||
{ L_TRIG, A_BUTTON },
|
||||
{ R_TRIG, D_CBUTTONS },
|
||||
{ L_TRIG, R_CBUTTONS },
|
||||
{ L_TRIG, R_TRIG },
|
||||
{ L_TRIG, L_JPAD },
|
||||
{ L_TRIG, R_JPAD },
|
||||
{ L_TRIG, U_JPAD },
|
||||
{ L_TRIG, B_BUTTON },
|
||||
{ L_TRIG, Z_TRIG },
|
||||
{ L_TRIG, D_JPAD },
|
||||
{ R_TRIG, A_BUTTON },
|
||||
{ R_TRIG, B_BUTTON },
|
||||
{ R_TRIG, Z_TRIG },
|
||||
{ R_TRIG, L_TRIG },
|
||||
{ R_TRIG, U_CBUTTONS },
|
||||
{ R_TRIG, R_CBUTTONS },
|
||||
{ R_TRIG, L_JPAD },
|
||||
{ R_TRIG, L_CBUTTONS },
|
||||
{ R_TRIG, START_BUTTON },
|
||||
{ L_TRIG, START_BUTTON },
|
||||
{ R_TRIG, R_JPAD },
|
||||
{ R_TRIG, U_JPAD },
|
||||
{ START_BUTTON, R_TRIG },
|
||||
{ START_BUTTON, A_BUTTON },
|
||||
{ START_BUTTON, B_BUTTON },
|
||||
{ L_TRIG, U_CBUTTONS }, { L_TRIG, L_CBUTTONS }, { L_TRIG, D_CBUTTONS }, { L_TRIG, A_BUTTON },
|
||||
{ R_TRIG, D_CBUTTONS }, { L_TRIG, R_CBUTTONS }, { L_TRIG, R_TRIG }, { L_TRIG, L_JPAD },
|
||||
{ L_TRIG, R_JPAD }, { L_TRIG, U_JPAD }, { L_TRIG, B_BUTTON }, { L_TRIG, Z_TRIG },
|
||||
{ L_TRIG, D_JPAD }, { R_TRIG, A_BUTTON }, { R_TRIG, B_BUTTON }, { R_TRIG, Z_TRIG },
|
||||
{ R_TRIG, L_TRIG }, { R_TRIG, U_CBUTTONS }, { R_TRIG, R_CBUTTONS }, { R_TRIG, L_JPAD },
|
||||
{ R_TRIG, L_CBUTTONS }, { R_TRIG, START_BUTTON }, { L_TRIG, START_BUTTON }, { R_TRIG, R_JPAD },
|
||||
{ R_TRIG, U_JPAD }, { START_BUTTON, R_TRIG }, { START_BUTTON, A_BUTTON }, { START_BUTTON, B_BUTTON },
|
||||
{ START_BUTTON, R_CBUTTONS },
|
||||
};
|
||||
|
||||
char regChar[] = " SOPQMYDUIZCNKXcsiWAVHGmnBdkb";
|
||||
|
||||
//initialize GameInfo
|
||||
void func_800636C0()
|
||||
{
|
||||
// initialize GameInfo
|
||||
void func_800636C0() {
|
||||
s32 i;
|
||||
|
||||
gGameInfo = (GameInfo*)SystemArena_MallocDebug(sizeof(GameInfo), "../z_debug.c", 260);
|
||||
@@ -80,26 +50,22 @@ void func_800636C0()
|
||||
gGameInfo->regCur = 0;
|
||||
gGameInfo->dpadLast = 0;
|
||||
gGameInfo->repeat = 0;
|
||||
for (i = 0; i < ARRAY_COUNT(gGameInfo->data); i++)
|
||||
{
|
||||
for (i = 0; i < ARRAY_COUNT(gGameInfo->data); i++) {
|
||||
gGameInfo->data[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
//Called when free movement is active.
|
||||
//8011D394 to enable camera debugger
|
||||
void func_8006375C(s32 arg0, s32 arg1, float* d_80855320)
|
||||
{
|
||||
|
||||
// Called when free movement is active.
|
||||
// 8011D394 to enable camera debugger
|
||||
void func_8006375C(s32 arg0, s32 arg1, float* d_80855320) {
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING //regalloc
|
||||
//Copy Camera Debugger Text
|
||||
void func_8006376C(u8 x, u8 y, u8 colorId, const char* text)
|
||||
{
|
||||
#ifdef NON_MATCHING // regalloc
|
||||
// Copy Camera Debugger Text
|
||||
void func_8006376C(u8 x, u8 y, u8 colorId, const char* text) {
|
||||
PrintTextBuffer* buf;
|
||||
char* bufText;
|
||||
s16 i; //v1
|
||||
s16 i; // v1
|
||||
|
||||
buf = &D_8015FA98[D_8011E0B0];
|
||||
if (D_8011E0B0 < 0x16) {
|
||||
@@ -112,9 +78,11 @@ void func_8006376C(u8 x, u8 y, u8 colorId, const char* text)
|
||||
bufText = buf->text + 1;
|
||||
|
||||
if (*buf->text = *text++) {
|
||||
do if (i++ > 0x14) {
|
||||
break;
|
||||
} while (*bufText++ = *text++);
|
||||
do
|
||||
if (i++ > 0x14) {
|
||||
break;
|
||||
}
|
||||
while (*bufText++ = *text++);
|
||||
}
|
||||
|
||||
*bufText = '\0';
|
||||
@@ -124,34 +92,31 @@ void func_8006376C(u8 x, u8 y, u8 colorId, const char* text)
|
||||
|
||||
#else
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_debug/func_8006376C.s")
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//Draw Text
|
||||
void func_80063828(GfxPrint* gfxPrint)
|
||||
{
|
||||
// Draw Text
|
||||
void func_80063828(GfxPrint* gfxPrint) {
|
||||
s32 i;
|
||||
Color_RGBA8* color;
|
||||
PrintTextBuffer* buffer;
|
||||
char* text;
|
||||
|
||||
i = 0;
|
||||
if (D_8011E0B0 > 0)
|
||||
{
|
||||
do
|
||||
{
|
||||
if (D_8011E0B0 > 0) {
|
||||
do {
|
||||
buffer = &D_8015FA98[i];
|
||||
text = buffer->text;
|
||||
|
||||
color = &printTextColors[buffer->colorId];
|
||||
GfxPrint_SetColor(gfxPrint, color->r, color->g, color->b, color->a);
|
||||
GfxPrint_SetPos(gfxPrint, buffer->x, buffer->y);
|
||||
GfxPrint_Printf(gfxPrint, "%s", text);
|
||||
GfxPrint_Printf(gfxPrint, "%s", text);
|
||||
i += 1;
|
||||
} while (i < D_8011E0B0);
|
||||
}
|
||||
}
|
||||
|
||||
//Edit REG
|
||||
// Edit REG
|
||||
void func_8006390C(Input* input) {
|
||||
|
||||
s32 dpad;
|
||||
@@ -162,18 +127,14 @@ void func_8006390C(Input* input) {
|
||||
|
||||
regGroup = (gGameInfo->regGroup * REG_PAGES + gGameInfo->regPage) * REG_PER_PAGE - REG_PER_PAGE;
|
||||
dpad = input->raw.pad & 0xF00;
|
||||
if (!~(input->raw.pad | ~L_TRIG) ||
|
||||
!~(input->raw.pad | ~R_TRIG) ||
|
||||
!~(input->raw.pad | ~START_BUTTON)) {
|
||||
if (!~(input->raw.pad | ~L_TRIG) || !~(input->raw.pad | ~R_TRIG) || !~(input->raw.pad | ~START_BUTTON)) {
|
||||
input_combo = inputCombos;
|
||||
for (i = 0; i < REG_GROUPS; i++)
|
||||
{
|
||||
if (~(~input_combo->push | input->raw.pad) ||
|
||||
~(~input_combo->held | input->padPressed)) {
|
||||
for (i = 0; i < REG_GROUPS; i++) {
|
||||
if (~(~input_combo->push | input->raw.pad) || ~(~input_combo->held | input->padPressed)) {
|
||||
input_combo++;
|
||||
}
|
||||
else
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i < REG_GROUPS) {
|
||||
@@ -184,10 +145,8 @@ void func_8006390C(Input* input) {
|
||||
gGameInfo->regGroup = i;
|
||||
gGameInfo->regPage = 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
switch (gGameInfo->regPage - 1)
|
||||
{
|
||||
} else {
|
||||
switch (gGameInfo->regPage - 1) {
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
@@ -195,80 +154,73 @@ void func_8006390C(Input* input) {
|
||||
case 4:
|
||||
case 5:
|
||||
|
||||
if (dpad == gGameInfo->dpadLast) {
|
||||
gGameInfo->repeat--;
|
||||
if (gGameInfo->repeat < 0) {
|
||||
gGameInfo->repeat = 1;
|
||||
if (dpad == gGameInfo->dpadLast) {
|
||||
gGameInfo->repeat--;
|
||||
if (gGameInfo->repeat < 0) {
|
||||
gGameInfo->repeat = 1;
|
||||
} else {
|
||||
dpad ^= gGameInfo->dpadLast;
|
||||
}
|
||||
} else {
|
||||
gGameInfo->repeat = 0x10;
|
||||
gGameInfo->dpadLast = dpad;
|
||||
}
|
||||
else {
|
||||
dpad ^= gGameInfo->dpadLast;
|
||||
}
|
||||
}
|
||||
else {
|
||||
gGameInfo->repeat = 0x10;
|
||||
gGameInfo->dpadLast = dpad;
|
||||
}
|
||||
|
||||
increment =
|
||||
(dpad & R_JPAD) ? (
|
||||
!~(input->raw.pad | ~(A_BUTTON | B_BUTTON)) ? 1000 :
|
||||
!~(input->raw.pad | ~A_BUTTON) ? 100 :
|
||||
!~(input->raw.pad | ~B_BUTTON) ? 10 : 1) :
|
||||
(dpad & L_JPAD) ? (
|
||||
!~(input->raw.pad | ~(A_BUTTON | B_BUTTON)) ? -1000 :
|
||||
!~(input->raw.pad | ~A_BUTTON) ? -100 :
|
||||
!~(input->raw.pad | ~B_BUTTON) ? -10 : -1) :
|
||||
0;
|
||||
increment = (dpad & R_JPAD)
|
||||
? (!~(input->raw.pad | ~(A_BUTTON | B_BUTTON))
|
||||
? 1000
|
||||
: !~(input->raw.pad | ~A_BUTTON) ? 100 : !~(input->raw.pad | ~B_BUTTON) ? 10 : 1)
|
||||
: (dpad & L_JPAD) ? (!~(input->raw.pad | ~(A_BUTTON | B_BUTTON))
|
||||
? -1000
|
||||
: !~(input->raw.pad | ~A_BUTTON)
|
||||
? -100
|
||||
: !~(input->raw.pad | ~B_BUTTON) ? -10 : -1)
|
||||
: 0;
|
||||
|
||||
gGameInfo->data[gGameInfo->regCur + regGroup] += increment;
|
||||
if (dpad & U_JPAD) {
|
||||
gGameInfo->regCur--;
|
||||
if (gGameInfo->regCur < 0) {
|
||||
gGameInfo->regCur = REG_PER_PAGE - 1;
|
||||
gGameInfo->data[gGameInfo->regCur + regGroup] += increment;
|
||||
if (dpad & U_JPAD) {
|
||||
gGameInfo->regCur--;
|
||||
if (gGameInfo->regCur < 0) {
|
||||
gGameInfo->regCur = REG_PER_PAGE - 1;
|
||||
}
|
||||
} else if (dpad & D_JPAD) {
|
||||
gGameInfo->regCur++;
|
||||
if (gGameInfo->regCur >= REG_PER_PAGE) {
|
||||
gGameInfo->regCur = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (dpad & D_JPAD) {
|
||||
gGameInfo->regCur++;
|
||||
if (gGameInfo->regCur >= REG_PER_PAGE) {
|
||||
gGameInfo->regCur = 0;
|
||||
if (iREG(0)) {
|
||||
iREG(0) = 0;
|
||||
func_800AA000(0, iREG(1), iREG(2), iREG(3));
|
||||
}
|
||||
}
|
||||
if (iREG(0)) {
|
||||
iREG(0) = 0;
|
||||
func_800AA000(0, iREG(1), iREG(2), iREG(3));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Draw Memory Viewer
|
||||
void func_80063C04(GfxPrint* gfxPrint)
|
||||
{
|
||||
// Draw Memory Viewer
|
||||
void func_80063C04(GfxPrint* gfxPrint) {
|
||||
s32 i;
|
||||
s32 page;
|
||||
s32 regGroup;
|
||||
s32 test; //removing affects stack
|
||||
s32 test; // removing affects stack
|
||||
char name[3];
|
||||
|
||||
page = (gGameInfo->regPage * REG_PER_PAGE) - REG_PER_PAGE;
|
||||
regGroup = (gGameInfo->regGroup * REG_PAGES + gGameInfo->regPage) * REG_PER_PAGE - REG_PER_PAGE;
|
||||
|
||||
//set up register name string
|
||||
// set up register name string
|
||||
name[0] = 'R';
|
||||
name[1] = regChar[gGameInfo->regGroup]; //r_group type char
|
||||
name[1] = regChar[gGameInfo->regGroup]; // r_group type char
|
||||
name[2] = '\0';
|
||||
GfxPrint_SetColor(gfxPrint, 0, 0x80, 0x80, 0x80);
|
||||
|
||||
for (i = 0; i != REG_PER_PAGE; i++)
|
||||
{
|
||||
if (i == gGameInfo->regCur)
|
||||
{
|
||||
for (i = 0; i != REG_PER_PAGE; i++) {
|
||||
if (i == gGameInfo->regCur) {
|
||||
GfxPrint_SetColor(gfxPrint, 0, 0xff, 0xff, 0xff);
|
||||
}
|
||||
GfxPrint_SetPos(gfxPrint, 3, i + 5);
|
||||
GfxPrint_Printf(gfxPrint, "%s%02d%6d", &name, page + i, gGameInfo->data[i + regGroup]);
|
||||
if (i == gGameInfo->regCur)
|
||||
{
|
||||
if (i == gGameInfo->regCur) {
|
||||
GfxPrint_SetColor(gfxPrint, 0, 0x80, 0x80, 0x80);
|
||||
}
|
||||
}
|
||||
@@ -281,7 +233,7 @@ void func_80063D7C(GraphicsContext* gfxCtx) {
|
||||
void* unk2[6];
|
||||
GfxPrint gfxPrint;
|
||||
void* unk[2];
|
||||
Gfx* dlFrame[4]; //stores state of GfxCtx next ptrs
|
||||
Gfx* dlFrame[4]; // stores state of GfxCtx next ptrs
|
||||
|
||||
func_800C6AC4(&dlFrame, gfxCtx, "../z_debug.c", 628);
|
||||
GfxPrint_Ctor(&gfxPrint);
|
||||
@@ -303,7 +255,7 @@ void func_80063D7C(GraphicsContext* gfxCtx) {
|
||||
gSPEndDisplayList(sp7C++);
|
||||
func_800C6C28(sp78, sp7C);
|
||||
gfxCtx->polyOpa.p = sp7C;
|
||||
if (0);
|
||||
if (0) {}
|
||||
func_800C6B54(&dlFrame, gfxCtx, "../z_debug.c", 664);
|
||||
GfxPrint_Dtor(&gfxPrint);
|
||||
}
|
||||
|
||||
+19
-33
@@ -1,25 +1,22 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x00 */ s16 drawType; // indicates which draw function to use when displaying the object
|
||||
/* 0x04 */ u32 drawArg; // segment address (display list or texture) passed to the draw funciton when called
|
||||
} DebugDispObjectInfo; // size = 0x8
|
||||
/* 0x04 */ u32 drawArg; // segment address (display list or texture) passed to the draw funciton when called
|
||||
} DebugDispObjectInfo; // size = 0x8
|
||||
|
||||
typedef void (*DebugDispObject_DrawFunc)(DebugDispObject*, u32, GlobalContext*);
|
||||
|
||||
static void DebugDisplay_DrawSpriteI8(DebugDispObject* dispObj, u32 texture, GlobalContext* globalCtx);
|
||||
static void DebugDisplay_DrawPolygon(DebugDispObject* dispObj, u32 dlist, GlobalContext* globalCtx);
|
||||
|
||||
static DebugDispObject_DrawFunc sDebugObjectDrawFuncTable[] =
|
||||
{
|
||||
static DebugDispObject_DrawFunc sDebugObjectDrawFuncTable[] = {
|
||||
DebugDisplay_DrawSpriteI8,
|
||||
DebugDisplay_DrawPolygon,
|
||||
};
|
||||
|
||||
static DebugDispObjectInfo sDebugObjectInfoTable[] =
|
||||
{
|
||||
static DebugDispObjectInfo sDebugObjectInfoTable[] = {
|
||||
{ 0, 0x040035F0 }, // Circle
|
||||
{ 0, 0x040038F0 }, // Cross
|
||||
{ 0, 0x040036F0 }, // Ball
|
||||
@@ -32,15 +29,13 @@ static Lights1 sDebugObjectLights = gdSPDefLights1(0x80, 0x80, 0x80, 0xFF, 0xFF,
|
||||
|
||||
static DebugDispObject* sDebugObjectListHead;
|
||||
|
||||
void DebugDisplay_Init(void)
|
||||
{
|
||||
void DebugDisplay_Init(void) {
|
||||
sDebugObjectListHead = NULL;
|
||||
}
|
||||
|
||||
DebugDispObject* DebugDisplay_AddObject(f32 posX, f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ,
|
||||
f32 scaleX, f32 scaleY, f32 scaleZ, u8 red, u8 green, u8 blue, u8 alpha,
|
||||
s16 type, GraphicsContext* gfxCtx)
|
||||
{
|
||||
DebugDispObject* DebugDisplay_AddObject(f32 posX, f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ, f32 scaleX,
|
||||
f32 scaleY, f32 scaleZ, u8 red, u8 green, u8 blue, u8 alpha, s16 type,
|
||||
GraphicsContext* gfxCtx) {
|
||||
DebugDispObject* prevHead = sDebugObjectListHead;
|
||||
|
||||
sDebugObjectListHead = Graph_Alloc(gfxCtx, sizeof(DebugDispObject));
|
||||
@@ -64,21 +59,18 @@ DebugDispObject* DebugDisplay_AddObject(f32 posX, f32 posY, f32 posZ, s16 rotX,
|
||||
return sDebugObjectListHead;
|
||||
}
|
||||
|
||||
void DebugDisplay_DrawObjects(GlobalContext* globalCtx)
|
||||
{
|
||||
void DebugDisplay_DrawObjects(GlobalContext* globalCtx) {
|
||||
DebugDispObject* dispObj = sDebugObjectListHead;
|
||||
DebugDispObjectInfo* objInfo;
|
||||
|
||||
while (dispObj != NULL)
|
||||
{
|
||||
while (dispObj != NULL) {
|
||||
objInfo = &sDebugObjectInfoTable[dispObj->type];
|
||||
sDebugObjectDrawFuncTable[objInfo->drawType](dispObj, objInfo->drawArg, globalCtx);
|
||||
dispObj = dispObj->next;
|
||||
}
|
||||
}
|
||||
|
||||
static void DebugDisplay_DrawSpriteI8(DebugDispObject* dispObj, u32 texture, GlobalContext* globalCtx)
|
||||
{
|
||||
static void DebugDisplay_DrawSpriteI8(DebugDispObject* dispObj, u32 texture, GlobalContext* globalCtx) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[4];
|
||||
|
||||
@@ -93,24 +85,17 @@ static void DebugDisplay_DrawSpriteI8(DebugDispObject* dispObj, u32 texture, Glo
|
||||
Matrix_Mult(&globalCtx->mf_11DA0, MTXMODE_APPLY);
|
||||
Matrix_RotateXYZ(dispObj->rot.x, dispObj->rot.y, dispObj->rot.z, MTXMODE_APPLY);
|
||||
|
||||
gDPLoadTextureBlock(gfxCtx->polyXlu.p++,
|
||||
texture,
|
||||
G_IM_FMT_I,
|
||||
G_IM_SIZ_8b,
|
||||
16, 16,
|
||||
0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP,
|
||||
G_TX_NOMASK, G_TX_NOMASK,
|
||||
G_TX_NOLOD, G_TX_NOLOD);
|
||||
gDPLoadTextureBlock(gfxCtx->polyXlu.p++, texture, G_IM_FMT_I, G_IM_SIZ_8b, 16, 16, 0, G_TX_NOMIRROR | G_TX_WRAP,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
|
||||
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_debug_display.c", 189), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_debug_display.c", 189),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, &D_04004298);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_debug_display.c", 192);
|
||||
}
|
||||
|
||||
static void DebugDisplay_DrawPolygon(DebugDispObject* dispObj, u32 dlist, GlobalContext* globalCtx)
|
||||
{
|
||||
static void DebugDisplay_DrawPolygon(DebugDispObject* dispObj, u32 dlist, GlobalContext* globalCtx) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[4];
|
||||
|
||||
@@ -124,7 +109,8 @@ static void DebugDisplay_DrawPolygon(DebugDispObject* dispObj, u32 dlist, Global
|
||||
func_800D1694(dispObj->pos.x, dispObj->pos.y, dispObj->pos.z, &dispObj->rot);
|
||||
Matrix_Scale(dispObj->scale.x, dispObj->scale.y, dispObj->scale.z, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_debug_display.c", 228), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_debug_display.c", 228),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, dlist);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_debug_display.c", 231);
|
||||
|
||||
+290
-442
File diff suppressed because it is too large
Load Diff
+154
-140
@@ -29,15 +29,13 @@ static void func_8006B54C(GlobalContext* globalCtx, s16 drawId);
|
||||
static void func_8006B6E4(GlobalContext* globalCtx, s16 drawId);
|
||||
static void func_8006B870(GlobalContext* globalCtx, s16 drawId);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/* 0x00 */ void (*drawFunc)(GlobalContext*, s16);
|
||||
/* 0x04 */ u32 dlists[8];
|
||||
typedef struct {
|
||||
/* 0x00 */ void (*drawFunc)(GlobalContext*, s16);
|
||||
/* 0x04 */ u32 dlists[8];
|
||||
} DrawItemTableEntry; // size = 0x24
|
||||
|
||||
// TODO: use symbols for these dlists once objects are in C
|
||||
static DrawItemTableEntry sDrawItemTable[] =
|
||||
{
|
||||
static DrawItemTableEntry sDrawItemTable[] = {
|
||||
{ func_8006AAA8, { 0x06000670, 0x06000750 } },
|
||||
{ func_8006A9CC, { 0x06000800 } },
|
||||
{ func_8006ABEC, { 0x06000A80, 0x06000AE0 } },
|
||||
@@ -71,8 +69,10 @@ static DrawItemTableEntry sDrawItemTable[] =
|
||||
{ func_8006A9CC, { 0x06000EE0 } },
|
||||
{ func_8006A9CC, { 0x060009A0 } },
|
||||
{ func_8006A9CC, { 0x06000B70 } },
|
||||
{ func_8006B870, { 0x06001850, 0x06001750, 0x06001790, 0x060019A0, 0x060017B0, 0x06001A28, 0x060017D0, 0x06001AD8 } },
|
||||
{ func_8006B870, { 0x06001850, 0x06001770, 0x060017F0, 0x060019A0, 0x06001810, 0x06001A28, 0x06001830, 0x06001AD8 } },
|
||||
{ func_8006B870,
|
||||
{ 0x06001850, 0x06001750, 0x06001790, 0x060019A0, 0x060017B0, 0x06001A28, 0x060017D0, 0x06001AD8 } },
|
||||
{ func_8006B870,
|
||||
{ 0x06001850, 0x06001770, 0x060017F0, 0x060019A0, 0x06001810, 0x06001A28, 0x06001830, 0x06001AD8 } },
|
||||
{ func_8006A9CC, { 0x06000F60 } },
|
||||
{ func_8006A9CC, { 0x06000340 } },
|
||||
{ func_8006A9CC, { 0x06000B90 } },
|
||||
@@ -161,88 +161,90 @@ static DrawItemTableEntry sDrawItemTable[] =
|
||||
* Draw "Get Item" Model
|
||||
* Calls the corresponding draw function for the given draw ID
|
||||
*/
|
||||
void func_800694A0(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
void func_800694A0(GlobalContext* globalCtx, s16 drawId) {
|
||||
sDrawItemTable[drawId].drawFunc(globalCtx, drawId);
|
||||
}
|
||||
|
||||
// All remaining functions in this file are draw functions referenced in the table and called by the function above
|
||||
|
||||
static void func_800694E4(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_800694E4(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 556);
|
||||
|
||||
func_80093BA8(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 560), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 560),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 565);
|
||||
}
|
||||
|
||||
static void func_800695C0(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_800695C0(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 572);
|
||||
|
||||
gfxCtx->polyXlu.p = func_80093774(gfxCtx->polyXlu.p, 5);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 576), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 576),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 581);
|
||||
}
|
||||
|
||||
static void func_8006969C(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_8006969C(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 588);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 592), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 592),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPSegment(gfxCtx->polyXlu.p++, 0x08,
|
||||
Draw_TwoTexScroll(globalCtx->state.gfxCtx,
|
||||
0, 0 * (globalCtx->state.frames * 0), 0 * (globalCtx->state.frames * 0), 16, 32,
|
||||
1, 1 * (globalCtx->state.frames * 1), 1 * -(globalCtx->state.frames * 8), 16, 32));
|
||||
Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0 * (globalCtx->state.frames * 0),
|
||||
0 * (globalCtx->state.frames * 0), 16, 32, 1, 1 * (globalCtx->state.frames * 1),
|
||||
1 * -(globalCtx->state.frames * 8), 16, 32));
|
||||
Matrix_Push();
|
||||
Matrix_Translate(-8.0f, -2.0f, 0.0f, MTXMODE_APPLY);
|
||||
func_800D1FD4(&globalCtx->mf_11DA0);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 615), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 615),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[1]);
|
||||
Matrix_Pull();
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 621);
|
||||
}
|
||||
|
||||
static void func_80069880(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_80069880(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 628);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 632), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 632),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 641), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 641),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[1]);
|
||||
gSPSegment(gfxCtx->polyXlu.p++, 0x08,
|
||||
Draw_TwoTexScroll(globalCtx->state.gfxCtx,
|
||||
0, 0 * (globalCtx->state.frames * 0), 0 * (globalCtx->state.frames * 0), 16, 32,
|
||||
1, 1 * (globalCtx->state.frames * 1), 1 * -(globalCtx->state.frames * 6), 16, 32));
|
||||
Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0 * (globalCtx->state.frames * 0),
|
||||
0 * (globalCtx->state.frames * 0), 16, 32, 1, 1 * (globalCtx->state.frames * 1),
|
||||
1 * -(globalCtx->state.frames * 6), 16, 32));
|
||||
Matrix_Push();
|
||||
func_800D1FD4(&globalCtx->mf_11DA0);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 656), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 656),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[3]);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[2]);
|
||||
Matrix_Pull();
|
||||
@@ -250,35 +252,36 @@ static void func_80069880(GlobalContext* globalCtx, s16 drawId)
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 663);
|
||||
}
|
||||
|
||||
static void func_80069AC8(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_80069AC8(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 670);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 674), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 674),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 683), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 683),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[1]);
|
||||
gSPSegment(gfxCtx->polyXlu.p++, 0x08,
|
||||
Draw_TwoTexScroll(globalCtx->state.gfxCtx,
|
||||
0, 0 * (globalCtx->state.frames * 0), 0 * (globalCtx->state.frames * 0), 32, 32,
|
||||
1, 1 * (globalCtx->state.frames * 1), 1 * -(globalCtx->state.frames * 6), 32, 32));
|
||||
Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0 * (globalCtx->state.frames * 0),
|
||||
0 * (globalCtx->state.frames * 0), 32, 32, 1, 1 * (globalCtx->state.frames * 1),
|
||||
1 * -(globalCtx->state.frames * 6), 32, 32));
|
||||
Matrix_Push();
|
||||
func_800D1FD4(&globalCtx->mf_11DA0);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 698), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 698),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[2]);
|
||||
Matrix_Pull();
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 704);
|
||||
}
|
||||
|
||||
static void func_80069CF0(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_80069CF0(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
@@ -286,77 +289,80 @@ static void func_80069CF0(GlobalContext* globalCtx, s16 drawId)
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPSegment(gfxCtx->polyOpa.p++, 0x08,
|
||||
Draw_TwoTexScroll(globalCtx->state.gfxCtx,
|
||||
0, 0 * (globalCtx->state.frames * 0) % 256, 1 * (globalCtx->state.frames * 2) % 256, 64, 64,
|
||||
1, 0 * (globalCtx->state.frames * 0) % 128, 1 * (globalCtx->state.frames * 1) % 128, 32, 32));
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 723), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0 * (globalCtx->state.frames * 0) % 256,
|
||||
1 * (globalCtx->state.frames * 2) % 256, 64, 64, 1,
|
||||
0 * (globalCtx->state.frames * 0) % 128, 1 * (globalCtx->state.frames * 1) % 128, 32,
|
||||
32));
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 723),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 730), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 730),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[1]);
|
||||
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 735);
|
||||
}
|
||||
|
||||
static void func_80069EB0(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_80069EB0(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 742);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 746), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 746),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPSegment(gfxCtx->polyXlu.p++, 0x08,
|
||||
Draw_TwoTexScroll(globalCtx->state.gfxCtx,
|
||||
0, 0 * (globalCtx->state.frames * 0), 1 * -(globalCtx->state.frames * 5), 32, 32,
|
||||
1, 0 * (globalCtx->state.frames * 0), 0 * (globalCtx->state.frames * 0), 32, 64));
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 760), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0 * (globalCtx->state.frames * 0),
|
||||
1 * -(globalCtx->state.frames * 5), 32, 32, 1, 0 * (globalCtx->state.frames * 0),
|
||||
0 * (globalCtx->state.frames * 0), 32, 64));
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 760),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[1]);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 765);
|
||||
}
|
||||
|
||||
static void func_8006A060(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_8006A060(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 772);
|
||||
|
||||
func_80093BA8(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 776), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 776),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[1]);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 783);
|
||||
}
|
||||
|
||||
static void func_8006A158(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_8006A158(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 811);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 815), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 815),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
gfxCtx->polyXlu.p = func_80093774(gfxCtx->polyXlu.p, 5);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 822), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 822),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[1]);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 827);
|
||||
}
|
||||
|
||||
static void func_8006A2A0(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_8006A2A0(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
@@ -364,25 +370,26 @@ static void func_8006A2A0(GlobalContext* globalCtx, s16 drawId)
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPSegment(gfxCtx->polyOpa.p++, 0x08,
|
||||
Draw_TwoTexScroll(globalCtx->state.gfxCtx,
|
||||
0, -1 * (globalCtx->state.frames * 1), 1 * (globalCtx->state.frames * 1), 32, 32,
|
||||
1, -1 * (globalCtx->state.frames * 1), 1 * (globalCtx->state.frames * 1), 32, 32));
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 845), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, -1 * (globalCtx->state.frames * 1),
|
||||
1 * (globalCtx->state.frames * 1), 32, 32, 1, -1 * (globalCtx->state.frames * 1),
|
||||
1 * (globalCtx->state.frames * 1), 32, 32));
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 845),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[1]);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[2]);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[3]);
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 855), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 855),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[4]);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[5]);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 861);
|
||||
}
|
||||
|
||||
static void func_8006A4B0(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_8006A4B0(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
@@ -390,17 +397,17 @@ static void func_8006A4B0(GlobalContext* globalCtx, s16 drawId)
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPSegment(gfxCtx->polyOpa.p++, 0x08,
|
||||
Draw_TwoTexScroll(globalCtx->state.gfxCtx,
|
||||
0, 1 * (globalCtx->state.frames * 1), 0 * (globalCtx->state.frames * 1), 32, 32,
|
||||
1, 0 * (globalCtx->state.frames * 1), 0 * (globalCtx->state.frames * 1), 32, 32));
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 878), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 1 * (globalCtx->state.frames * 1),
|
||||
0 * (globalCtx->state.frames * 1), 32, 32, 1, 0 * (globalCtx->state.frames * 1),
|
||||
0 * (globalCtx->state.frames * 1), 32, 32));
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 878),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 883);
|
||||
}
|
||||
|
||||
static void func_8006A5F0(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_8006A5F0(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
@@ -408,17 +415,17 @@ static void func_8006A5F0(GlobalContext* globalCtx, s16 drawId)
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPSegment(gfxCtx->polyOpa.p++, 0x08,
|
||||
Draw_TwoTexScroll(globalCtx->state.gfxCtx,
|
||||
0, 1 * (globalCtx->state.frames * 6), 1 * (globalCtx->state.frames * 6), 32, 32,
|
||||
1, 1 * (globalCtx->state.frames * 6), 1 * (globalCtx->state.frames * 6), 32, 32));
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 901), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 1 * (globalCtx->state.frames * 6),
|
||||
1 * (globalCtx->state.frames * 6), 32, 32, 1, 1 * (globalCtx->state.frames * 6),
|
||||
1 * (globalCtx->state.frames * 6), 32, 32));
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 901),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 906);
|
||||
}
|
||||
|
||||
static void func_8006A73C(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_8006A73C(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
@@ -426,17 +433,17 @@ static void func_8006A73C(GlobalContext* globalCtx, s16 drawId)
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPSegment(gfxCtx->polyXlu.p++, 0x08,
|
||||
Draw_TwoTexScroll(globalCtx->state.gfxCtx,
|
||||
0, 0 * (globalCtx->state.frames * 1), 1 * -(globalCtx->state.frames * 3), 32, 32,
|
||||
1, 0 * (globalCtx->state.frames * 1), 1 * -(globalCtx->state.frames * 2), 32, 32));
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 924), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0 * (globalCtx->state.frames * 1),
|
||||
1 * -(globalCtx->state.frames * 3), 32, 32, 1, 0 * (globalCtx->state.frames * 1),
|
||||
1 * -(globalCtx->state.frames * 2), 32, 32));
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 924),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 929);
|
||||
}
|
||||
|
||||
static void func_8006A88C(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_8006A88C(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
@@ -444,100 +451,103 @@ static void func_8006A88C(GlobalContext* globalCtx, s16 drawId)
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPSegment(gfxCtx->polyXlu.p++, 0x08,
|
||||
Draw_TwoTexScroll(globalCtx->state.gfxCtx,
|
||||
0, 0 * (globalCtx->state.frames * 0), 1 * (globalCtx->state.frames * 1), 32, 32,
|
||||
1, 0 * (globalCtx->state.frames * 0), 1 * (globalCtx->state.frames * 1), 32, 32));
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 947), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0 * (globalCtx->state.frames * 0),
|
||||
1 * (globalCtx->state.frames * 1), 32, 32, 1, 0 * (globalCtx->state.frames * 0),
|
||||
1 * (globalCtx->state.frames * 1), 32, 32));
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 947),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 952);
|
||||
}
|
||||
|
||||
static void func_8006A9CC(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_8006A9CC(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 959);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 963), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 963),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 968);
|
||||
}
|
||||
|
||||
static void func_8006AAA8(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_8006AAA8(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 975);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 979), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 979),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 986), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 986),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[1]);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 991);
|
||||
}
|
||||
|
||||
static void func_8006ABEC(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_8006ABEC(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 998);
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1002), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1002),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[1]);
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1008);
|
||||
}
|
||||
|
||||
static void func_8006ACE4(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_8006ACE4(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1015);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1019), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1019),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[1]);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1027), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1027),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[2]);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1032);
|
||||
}
|
||||
|
||||
static void func_8006AE40(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_8006AE40(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1039);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1043), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1043),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1050), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1050),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[1]);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[2]);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1056);
|
||||
}
|
||||
|
||||
static void func_8006AF9C(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_8006AF9C(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
@@ -545,10 +555,11 @@ static void func_8006AF9C(GlobalContext* globalCtx, s16 drawId)
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPSegment(gfxCtx->polyXlu.p++, 0x08,
|
||||
Draw_TwoTexScroll(globalCtx->state.gfxCtx,
|
||||
0, 1 * (globalCtx->state.frames * 2), 1 * -(globalCtx->state.frames * 6), 32, 32,
|
||||
1, 1 * (globalCtx->state.frames * 1), -1 * (globalCtx->state.frames * 2), 32, 32));
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1074), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 1 * (globalCtx->state.frames * 2),
|
||||
1 * -(globalCtx->state.frames * 6), 32, 32, 1, 1 * (globalCtx->state.frames * 1),
|
||||
-1 * (globalCtx->state.frames * 2), 32, 32));
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1074),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[1]);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[2]);
|
||||
@@ -556,15 +567,15 @@ static void func_8006AF9C(GlobalContext* globalCtx, s16 drawId)
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1081);
|
||||
}
|
||||
|
||||
static void func_8006B124(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_8006B124(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1088);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1092), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1092),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[1]);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[2]);
|
||||
@@ -573,28 +584,28 @@ static void func_8006B124(GlobalContext* globalCtx, s16 drawId)
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1100);
|
||||
}
|
||||
|
||||
static void func_8006B24C(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_8006B24C(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1108);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1112), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1112),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[1]);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1120), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1120),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[3]);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[2]);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1126);
|
||||
}
|
||||
|
||||
static void func_8006B3C0(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_8006B3C0(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
@@ -603,20 +614,21 @@ static void func_8006B3C0(GlobalContext* globalCtx, s16 drawId)
|
||||
Matrix_Scale(0.7f, 0.7f, 0.7f, MTXMODE_APPLY);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1140), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1140),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[1]);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1148), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1148),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[3]);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[2]);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1154);
|
||||
}
|
||||
|
||||
static void func_8006B54C(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_8006B54C(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
@@ -624,10 +636,11 @@ static void func_8006B54C(GlobalContext* globalCtx, s16 drawId)
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPSegment(gfxCtx->polyXlu.p++, 0x08,
|
||||
Draw_TwoTexScroll(globalCtx->state.gfxCtx,
|
||||
0, 1 * (globalCtx->state.frames * 2), -1 * (globalCtx->state.frames * 2), 64, 64,
|
||||
1, 1 * (globalCtx->state.frames * 4), 1 * -(globalCtx->state.frames * 4), 32, 32));
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1173), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 1 * (globalCtx->state.frames * 2),
|
||||
-1 * (globalCtx->state.frames * 2), 64, 64, 1, 1 * (globalCtx->state.frames * 4),
|
||||
1 * -(globalCtx->state.frames * 4), 32, 32));
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1173),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[2]);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[3]);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[1]);
|
||||
@@ -636,20 +649,21 @@ static void func_8006B54C(GlobalContext* globalCtx, s16 drawId)
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1181);
|
||||
}
|
||||
|
||||
static void func_8006B6E4(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_8006B6E4(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1188);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1192), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1192),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[1]);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1200), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1200),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[2]);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[3]);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[4]);
|
||||
@@ -657,8 +671,7 @@ static void func_8006B6E4(GlobalContext* globalCtx, s16 drawId)
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1207);
|
||||
}
|
||||
|
||||
static void func_8006B870(GlobalContext* globalCtx, s16 drawId)
|
||||
{
|
||||
static void func_8006B870(GlobalContext* globalCtx, s16 drawId) {
|
||||
u32 pad;
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[4];
|
||||
@@ -666,7 +679,8 @@ static void func_8006B870(GlobalContext* globalCtx, s16 drawId)
|
||||
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1214);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1218), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1218),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[1]);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[2]);
|
||||
|
||||
@@ -9,8 +9,7 @@
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eff_blure/func_80020A50.s")
|
||||
|
||||
void func_80020F60(u32 unused, GraphicsContext* gfxCtx)
|
||||
{
|
||||
void func_80020F60(u32 unused, GraphicsContext* gfxCtx) {
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
func_800C6AC4(gfxArr, gfxCtx, D_80135180, 809);
|
||||
@@ -29,4 +28,3 @@ void func_80020F60(u32 unused, GraphicsContext* gfxCtx)
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eff_blure/func_800224F4.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eff_blure/func_80022A10.s")
|
||||
|
||||
|
||||
@@ -8,4 +8,3 @@
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eff_shield_particle/func_8002389C.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eff_shield_particle/func_800245BC.s")
|
||||
|
||||
|
||||
@@ -3,12 +3,9 @@
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eff_spark/func_80024B00.s")
|
||||
|
||||
void func_80024F0C(UNK_TYPE arg0)
|
||||
{
|
||||
|
||||
void func_80024F0C(UNK_TYPE arg0) {
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eff_spark/func_80024F14.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eff_spark/func_80025000.s")
|
||||
|
||||
|
||||
@@ -12,4 +12,3 @@
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eff_ss_dead/func_80026860.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eff_ss_dead/func_80026A6C.s")
|
||||
|
||||
|
||||
@@ -7,8 +7,7 @@ void Effect_SS_Delete(LoadedParticleEntry* particle);
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite/func_800272B0.s")
|
||||
|
||||
void Effect_SS_Clear(GlobalContext* globalCtx)
|
||||
{
|
||||
void Effect_SS_Clear(GlobalContext* globalCtx) {
|
||||
u32 i;
|
||||
LoadedParticleEntry* iter;
|
||||
ParticleOverlay* iter2;
|
||||
@@ -18,35 +17,36 @@ void Effect_SS_Clear(GlobalContext* globalCtx)
|
||||
EffectSS2Info.searchIndex = 0;
|
||||
EffectSS2Info.size = 0;
|
||||
|
||||
for (iter = EffectSS2Info.data_table; iter < EffectSS2Info.data_table + EffectSS2Info.size; iter++)
|
||||
for (iter = EffectSS2Info.data_table; iter < EffectSS2Info.data_table + EffectSS2Info.size; iter++) {
|
||||
Effect_SS_Delete(iter);
|
||||
}
|
||||
|
||||
// Free memory from loaded particle overlays
|
||||
iter2 = &sParticleOverlayTable[0];
|
||||
for (i = 0; i < ARRAY_COUNT(sParticleOverlayTable); i++)
|
||||
{
|
||||
for (i = 0; i < ARRAY_COUNT(sParticleOverlayTable); i++) {
|
||||
addr = iter2->loadedRamAddr;
|
||||
|
||||
if (addr != NULL)
|
||||
if (addr != NULL) {
|
||||
ZeldaArena_FreeDebug(addr, D_801357DC, 337);
|
||||
}
|
||||
|
||||
(iter2++)->loadedRamAddr = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void Effect_SS_Delete(LoadedParticleEntry* particle)
|
||||
{
|
||||
if (particle->flags & 2)
|
||||
void Effect_SS_Delete(LoadedParticleEntry* particle) {
|
||||
if (particle->flags & 2) {
|
||||
func_800F89E8(particle);
|
||||
}
|
||||
|
||||
if (particle->flags & 4)
|
||||
if (particle->flags & 4) {
|
||||
func_800F89E8(&particle->unk_2C);
|
||||
}
|
||||
|
||||
Effect_SS_ResetEntry(particle);
|
||||
}
|
||||
|
||||
void Effect_SS_ResetEntry(LoadedParticleEntry* particle)
|
||||
{
|
||||
void Effect_SS_ResetEntry(LoadedParticleEntry* particle) {
|
||||
u32 i;
|
||||
|
||||
particle->type = 0x25;
|
||||
@@ -70,8 +70,9 @@ void Effect_SS_ResetEntry(LoadedParticleEntry* particle)
|
||||
particle->unk_38 = 0;
|
||||
particle->unk_3C = 0;
|
||||
|
||||
for (i = 0; i != 13; i++)
|
||||
for (i = 0; i != 13; i++) {
|
||||
particle->unk_40[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite/func_800275D0.s")
|
||||
@@ -80,12 +81,10 @@ void Effect_SS_ResetEntry(LoadedParticleEntry* particle)
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite/func_80027798.s")
|
||||
|
||||
void Effect_SS_UpdateParticle(GlobalContext* globalCtx, s32 index)
|
||||
{
|
||||
void Effect_SS_UpdateParticle(GlobalContext* globalCtx, s32 index) {
|
||||
LoadedParticleEntry* particle = &EffectSS2Info.data_table[index];
|
||||
|
||||
if (particle->update != NULL)
|
||||
{
|
||||
if (particle->update != NULL) {
|
||||
particle->velocity.x += particle->acceleration.x;
|
||||
particle->velocity.y += particle->acceleration.y;
|
||||
particle->velocity.z += particle->acceleration.z;
|
||||
@@ -98,47 +97,43 @@ void Effect_SS_UpdateParticle(GlobalContext* globalCtx, s32 index)
|
||||
}
|
||||
}
|
||||
|
||||
void Effect_SS_UpdateAllParticles(GlobalContext* globalCtx)
|
||||
{
|
||||
void Effect_SS_UpdateAllParticles(GlobalContext* globalCtx) {
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < EffectSS2Info.size; i++)
|
||||
{
|
||||
if (EffectSS2Info.data_table[i].life > -1)
|
||||
{
|
||||
for (i = 0; i < EffectSS2Info.size; i++) {
|
||||
if (EffectSS2Info.data_table[i].life > -1) {
|
||||
EffectSS2Info.data_table[i].life--;
|
||||
|
||||
if (EffectSS2Info.data_table[i].life < 0)
|
||||
if (EffectSS2Info.data_table[i].life < 0) {
|
||||
Effect_SS_Delete(&EffectSS2Info.data_table[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (EffectSS2Info.data_table[i].life > -1)
|
||||
if (EffectSS2Info.data_table[i].life > -1) {
|
||||
Effect_SS_UpdateParticle(globalCtx, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Effect_SS_DrawParticle(GlobalContext* globalCtx, s32 index)
|
||||
{
|
||||
void Effect_SS_DrawParticle(GlobalContext* globalCtx, s32 index) {
|
||||
LoadedParticleEntry* particle = &EffectSS2Info.data_table[index];
|
||||
|
||||
if (particle->draw != NULL)
|
||||
if (particle->draw != NULL) {
|
||||
particle->draw(globalCtx, index, particle);
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite/func_80027BDC.s")
|
||||
|
||||
s16 func_80027DD4(s16 arg0, s16 arg1, s32 arg2)
|
||||
{
|
||||
s16 ret = !arg2 ? arg1 : (arg0 + (s32) ((f32) (arg1 - arg0) / arg2));
|
||||
s16 func_80027DD4(s16 arg0, s16 arg1, s32 arg2) {
|
||||
s16 ret = !arg2 ? arg1 : (arg0 + (s32)((f32)(arg1 - arg0) / arg2));
|
||||
return ret;
|
||||
}
|
||||
|
||||
s16 func_80027E34(s16 a0, s16 a1, f32 a2)
|
||||
{
|
||||
s16 func_80027E34(s16 a0, s16 a1, f32 a2) {
|
||||
return (a1 - a0) * a2 + a0;
|
||||
}
|
||||
|
||||
u8 func_80027E84(u8 a0, u8 a1, f32 a2)
|
||||
{
|
||||
u8 func_80027E84(u8 a0, u8 a1, f32 a2) {
|
||||
return a2 * ((f32)a1 - (f32)a0) + a0;
|
||||
}
|
||||
|
||||
@@ -164,4 +164,3 @@
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite_old_init/func_8002A9F4.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite_old_init/func_8002AA44.s")
|
||||
|
||||
|
||||
+75
-102
@@ -1,8 +1,7 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
/* 0x00 */ A_OBJ_BLOCK_SMALL,
|
||||
/* 0x01 */ A_OBJ_BLOCK_LARGE,
|
||||
/* 0x02 */ A_OBJ_BLOCK_HUGE,
|
||||
@@ -17,23 +16,22 @@ typedef enum
|
||||
/* 0x0B */ A_OBJ_KNOB
|
||||
} AObjType;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x14C */ u32 dynaPolyId;
|
||||
/* 0x150 */ f32 unk_150;
|
||||
/* 0x154 */ f32 unk_154;
|
||||
/* 0x158 */ s16 unk_158;
|
||||
/* 0x15C */ u32 unk_15C;
|
||||
/* 0x160 */ u8 unk_160;
|
||||
/* 0x14C */ u32 dynaPolyId;
|
||||
/* 0x150 */ f32 unk_150;
|
||||
/* 0x154 */ f32 unk_154;
|
||||
/* 0x158 */ s16 unk_158;
|
||||
/* 0x15C */ u32 unk_15C;
|
||||
/* 0x160 */ u8 unk_160;
|
||||
/* 0x164 */ ActorFunc updateFunc;
|
||||
/* 0x168 */ s32 unk_168;
|
||||
/* 0x16C */ s16 textId;
|
||||
/* 0x16E */ s16 unk_16E;
|
||||
/* 0x170 */ s16 unk_170;
|
||||
/* 0x172 */ s16 unk_172;
|
||||
/* 0x174 */ s16 unk_174;
|
||||
/* 0x178 */ f32 unk_178;
|
||||
/* 0x168 */ s32 unk_168;
|
||||
/* 0x16C */ s16 textId;
|
||||
/* 0x16E */ s16 unk_16E;
|
||||
/* 0x170 */ s16 unk_170;
|
||||
/* 0x172 */ s16 unk_172;
|
||||
/* 0x174 */ s16 unk_174;
|
||||
/* 0x178 */ f32 unk_178;
|
||||
/* 0x17C */ ColliderCylinderMain cylinderCollider;
|
||||
} ActorEnAObj; // size = 0x1C8
|
||||
|
||||
@@ -54,15 +52,13 @@ extern ColliderCylinderInit D_80115440;
|
||||
extern u32 D_8011546C[];
|
||||
extern u32 D_80115484[];
|
||||
|
||||
void En_A_Obj_SetNewUpdate(ActorEnAObj* this, ActorFunc newUpdateFunc)
|
||||
{
|
||||
void En_A_Obj_SetNewUpdate(ActorEnAObj* this, ActorFunc newUpdateFunc) {
|
||||
this->updateFunc = newUpdateFunc;
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// minor ordering and regalloc differences
|
||||
void En_A_Obj_Init(ActorEnAObj* this, GlobalContext* globalCtx)
|
||||
{
|
||||
void En_A_Obj_Init(ActorEnAObj* this, GlobalContext* globalCtx) {
|
||||
u32 sp34;
|
||||
s16 type;
|
||||
s16 initialParams;
|
||||
@@ -77,8 +73,7 @@ void En_A_Obj_Init(ActorEnAObj* this, GlobalContext* globalCtx)
|
||||
this->textId = (initialParams >> 8) & 0xFF;
|
||||
this->actor.params = type;
|
||||
|
||||
switch (type & 0xFFFF)
|
||||
{
|
||||
switch (type & 0xFFFF) {
|
||||
case A_OBJ_BLOCK_SMALL:
|
||||
Actor_SetScale(&this->actor, 0.025f);
|
||||
break;
|
||||
@@ -112,8 +107,7 @@ void En_A_Obj_Init(ActorEnAObj* this, GlobalContext* globalCtx)
|
||||
params = this->actor.params;
|
||||
this->actor.posRot2.pos = this->actor.posRot.pos;
|
||||
|
||||
switch (params)
|
||||
{
|
||||
switch (params) {
|
||||
case A_OBJ_BLOCK_LARGE:
|
||||
case A_OBJ_BLOCK_HUGE:
|
||||
this->dynaPolyId = 1;
|
||||
@@ -159,12 +153,11 @@ void En_A_Obj_Init(ActorEnAObj* this, GlobalContext* globalCtx)
|
||||
func_8001D234(this, params);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (this->actor.params < 5)
|
||||
this->actor.sub_98.mass = 0xFF;
|
||||
|
||||
if (this->dynaPolyId != -1)
|
||||
{
|
||||
if (this->dynaPolyId != -1) {
|
||||
DynaPolyInfo_Alloc(D_8011546C[this->dynaPolyId], &sp34);
|
||||
this->dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->actor, sp34);
|
||||
}
|
||||
@@ -173,51 +166,44 @@ void En_A_Obj_Init(ActorEnAObj* this, GlobalContext* globalCtx)
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_en_a_keep/En_A_Obj_Init.s")
|
||||
#endif
|
||||
|
||||
void En_A_Obj_Destroy(ActorEnAObj* this, GlobalContext* globalCtx)
|
||||
{
|
||||
void En_A_Obj_Destroy(ActorEnAObj* this, GlobalContext* globalCtx) {
|
||||
ColliderCylinderMain* cylinderCollider = &this->cylinderCollider;
|
||||
|
||||
DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dynaPolyId);
|
||||
|
||||
switch (this->actor.params)
|
||||
{
|
||||
switch (this->actor.params) {
|
||||
case A_OBJ_SIGNPOST_OBLONG:
|
||||
case A_OBJ_SIGNPOST_ARROW:
|
||||
ActorCollider_FreeCylinder(globalCtx, cylinderCollider);
|
||||
}
|
||||
}
|
||||
|
||||
void func_8001D204(ActorEnAObj* this, GlobalContext* globalCtx)
|
||||
{
|
||||
if (func_8002F334(&this->actor, globalCtx))
|
||||
void func_8001D204(ActorEnAObj* this, GlobalContext* globalCtx) {
|
||||
if (func_8002F334(&this->actor, globalCtx)) {
|
||||
func_8001D234(this, this->actor.params);
|
||||
}
|
||||
}
|
||||
|
||||
void func_8001D234(ActorEnAObj* this, s16 params)
|
||||
{
|
||||
void func_8001D234(ActorEnAObj* this, s16 params) {
|
||||
En_A_Obj_SetNewUpdate(this, (ActorFunc)func_8001D25C);
|
||||
}
|
||||
|
||||
void func_8001D25C(ActorEnAObj* this, GlobalContext* globalCtx)
|
||||
{
|
||||
void func_8001D25C(ActorEnAObj* this, GlobalContext* globalCtx) {
|
||||
s16 var;
|
||||
|
||||
if (this->actor.textId != 0)
|
||||
{
|
||||
if (this->actor.textId != 0) {
|
||||
var = this->actor.rotTowardsLinkY - this->actor.shape.rot.y;
|
||||
if ((ABS(var) < 0x2800) ||
|
||||
((this->actor.params == 0xA) && (ABS(var) > 0x5800)))
|
||||
{
|
||||
if (func_8002F194(&this->actor, globalCtx))
|
||||
if ((ABS(var) < 0x2800) || ((this->actor.params == 0xA) && (ABS(var) > 0x5800))) {
|
||||
if (func_8002F194(&this->actor, globalCtx)) {
|
||||
En_A_Obj_SetNewUpdate(this, (ActorFunc)func_8001D204);
|
||||
else
|
||||
} else {
|
||||
func_8002F2F4(&this->actor, globalCtx);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_8001D310(ActorEnAObj* this, s16 params)
|
||||
{
|
||||
void func_8001D310(ActorEnAObj* this, s16 params) {
|
||||
this->unk_16E = 0;
|
||||
this->unk_168 = 10;
|
||||
this->actor.posRot.rot.y = 0;
|
||||
@@ -225,41 +211,34 @@ void func_8001D310(ActorEnAObj* this, s16 params)
|
||||
En_A_Obj_SetNewUpdate(this, (ActorFunc)func_8001D360);
|
||||
}
|
||||
|
||||
void func_8001D360(ActorEnAObj* this, GlobalContext* globalCtx)
|
||||
{
|
||||
if (this->unk_16E == 0)
|
||||
{
|
||||
if (this->unk_160 != 0)
|
||||
{
|
||||
void func_8001D360(ActorEnAObj* this, GlobalContext* globalCtx) {
|
||||
if (this->unk_16E == 0) {
|
||||
if (this->unk_160 != 0) {
|
||||
this->unk_16E++;
|
||||
this->unk_170 = 20;
|
||||
|
||||
if ((s16)(this->actor.rotTowardsLinkY + 0x4000) < 0)
|
||||
if ((s16)(this->actor.rotTowardsLinkY + 0x4000) < 0) {
|
||||
this->unk_174 = -1000;
|
||||
else
|
||||
} else {
|
||||
this->unk_174 = 1000;
|
||||
}
|
||||
|
||||
if (this->actor.rotTowardsLinkY < 0)
|
||||
if (this->actor.rotTowardsLinkY < 0) {
|
||||
this->unk_172 = -this->unk_174;
|
||||
else
|
||||
} else {
|
||||
this->unk_172 = this->unk_174;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this->unk_168 != 0)
|
||||
{
|
||||
} else {
|
||||
if (this->unk_168 != 0) {
|
||||
this->unk_168--;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
this->actor.shape.rot.y += this->unk_172;
|
||||
this->actor.shape.rot.x += this->unk_174;
|
||||
this->unk_170--;
|
||||
this->actor.gravity = -1.0f;
|
||||
|
||||
if (this->unk_170 == 0)
|
||||
{
|
||||
if (this->unk_170 == 0) {
|
||||
this->actor.posRot.pos = this->actor.initPosRot.pos;
|
||||
this->unk_16E = 0;
|
||||
this->unk_168 = 10;
|
||||
@@ -271,82 +250,74 @@ void func_8001D360(ActorEnAObj* this, GlobalContext* globalCtx)
|
||||
}
|
||||
}
|
||||
|
||||
void func_8001D480(ActorEnAObj* this, s16 params)
|
||||
{
|
||||
void func_8001D480(ActorEnAObj* this, s16 params) {
|
||||
En_A_Obj_SetNewUpdate(this, (ActorFunc)func_8001D4A8);
|
||||
}
|
||||
|
||||
void func_8001D4A8(ActorEnAObj* this, GlobalContext* globalCtx)
|
||||
{
|
||||
void func_8001D4A8(ActorEnAObj* this, GlobalContext* globalCtx) {
|
||||
Math_SmoothScaleMaxMinF(&this->actor.speedXZ, 1.0f, 1.0f, 0.5f, 0.0f);
|
||||
this->actor.shape.rot.x = this->actor.shape.rot.x + (this->actor.posRot.rot.x >> 1);
|
||||
this->actor.shape.rot.z = this->actor.shape.rot.z + (this->actor.posRot.rot.z >> 1);
|
||||
|
||||
if ((this->actor.speedXZ != 0.0f) && (this->actor.bgCheckFlags & 0x8))
|
||||
{
|
||||
if (1) // Necessary to match
|
||||
if ((this->actor.speedXZ != 0.0f) && (this->actor.bgCheckFlags & 0x8)) {
|
||||
if (1) { // Necessary to match
|
||||
this->actor.posRot.rot.y = ((this->actor.unk_7E - this->actor.posRot.rot.y) + this->actor.unk_7E) - 0x8000;
|
||||
}
|
||||
this->actor.bgCheckFlags &= ~0x8;
|
||||
}
|
||||
|
||||
if (this->actor.bgCheckFlags & 0x2)
|
||||
{
|
||||
if (this->actor.velocity.y < -8.0f)
|
||||
{
|
||||
if (this->actor.bgCheckFlags & 0x2) {
|
||||
if (this->actor.velocity.y < -8.0f) {
|
||||
this->actor.velocity.y *= -0.6f;
|
||||
this->actor.speedXZ *= 0.6f;
|
||||
this->actor.bgCheckFlags &= ~0x3;
|
||||
}
|
||||
else
|
||||
} else {
|
||||
Actor_Kill(&this->actor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_8001D5C8(ActorEnAObj* this, s16 params)
|
||||
{
|
||||
void func_8001D5C8(ActorEnAObj* this, s16 params) {
|
||||
this->actor.unk_FC = 1200.0f;
|
||||
this->actor.unk_F8 = 720.0f;
|
||||
En_A_Obj_SetNewUpdate(this, (ActorFunc)func_8001D608);
|
||||
}
|
||||
|
||||
void func_8001D608(ActorEnAObj* this, GlobalContext* globalCtx)
|
||||
{
|
||||
void func_8001D608(ActorEnAObj* this, GlobalContext* globalCtx) {
|
||||
this->actor.speedXZ += this->unk_150;
|
||||
this->actor.posRot.rot.y = this->unk_158;
|
||||
|
||||
this->actor.speedXZ = (this->actor.speedXZ < -2.5f) ? -2.5f :
|
||||
((this->actor.speedXZ > 2.5f) ? 2.5f :
|
||||
this->actor.speedXZ);
|
||||
this->actor.speedXZ =
|
||||
(this->actor.speedXZ < -2.5f) ? -2.5f : ((this->actor.speedXZ > 2.5f) ? 2.5f : this->actor.speedXZ);
|
||||
|
||||
Math_SmoothScaleMaxMinF(&this->actor.speedXZ, 0.0f, 1.0f, 1.0f, 0.0f);
|
||||
|
||||
if (this->actor.speedXZ != 0.0f)
|
||||
if (this->actor.speedXZ != 0.0f) {
|
||||
Audio_PlayActorSound2(&this->actor, 0x200A);
|
||||
}
|
||||
|
||||
this->unk_154 = 0.0f;
|
||||
this->unk_150 = 0.0f;
|
||||
}
|
||||
|
||||
void En_A_Obj_Update(ActorEnAObj* this, GlobalContext* globalCtx)
|
||||
{
|
||||
void En_A_Obj_Update(ActorEnAObj* this, GlobalContext* globalCtx) {
|
||||
ColliderCylinderMain* cylinderCollider;
|
||||
|
||||
this->updateFunc(this, globalCtx);
|
||||
Actor_MoveForward(&this->actor);
|
||||
|
||||
if (this->actor.gravity != 0.0f)
|
||||
{
|
||||
if (this->actor.params != A_OBJ_KNOB)
|
||||
if (this->actor.gravity != 0.0f) {
|
||||
if (this->actor.params != A_OBJ_KNOB) {
|
||||
func_8002E4B4(globalCtx, &this->actor, 5.0f, 40.0f, 0.0f, 0x1D);
|
||||
else
|
||||
} else {
|
||||
func_8002E4B4(globalCtx, &this->actor, 5.0f, 20.0f, 0.0f, 0x1D);
|
||||
}
|
||||
}
|
||||
|
||||
this->actor.posRot2.pos = this->actor.posRot.pos;
|
||||
this->actor.posRot2.pos.y += this->unk_178;
|
||||
|
||||
switch (this->actor.params)
|
||||
{
|
||||
switch (this->actor.params) {
|
||||
case A_OBJ_SIGNPOST_OBLONG:
|
||||
case A_OBJ_SIGNPOST_ARROW:
|
||||
cylinderCollider = &this->cylinderCollider;
|
||||
@@ -355,8 +326,7 @@ void En_A_Obj_Update(ActorEnAObj* this, GlobalContext* globalCtx)
|
||||
}
|
||||
}
|
||||
|
||||
void En_A_Obj_Draw(ActorEnAObj* this, GlobalContext* globalCtx)
|
||||
{
|
||||
void En_A_Obj_Draw(ActorEnAObj* this, GlobalContext* globalCtx) {
|
||||
s32 type = this->actor.params;
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[4];
|
||||
@@ -365,13 +335,16 @@ void En_A_Obj_Draw(ActorEnAObj* this, GlobalContext* globalCtx)
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
|
||||
if (type > A_OBJ_KNOB)
|
||||
if (type > A_OBJ_KNOB) {
|
||||
type = A_OBJ_KNOB;
|
||||
}
|
||||
|
||||
if (this->actor.params == A_OBJ_KNOB)
|
||||
if (this->actor.params == A_OBJ_KNOB) {
|
||||
gDPSetPrimColor(gfxCtx->polyOpa.p++, 0, 1, 0x3C, 0x3C, 0x3C, 0x32);
|
||||
}
|
||||
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_a_keep.c", 712), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_a_keep.c", 712),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, D_80115484[type]);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_en_a_keep.c", 715);
|
||||
|
||||
+194
-306
@@ -1,8 +1,7 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
/* 0x00 */ DROP_RUPEE_GREEN,
|
||||
/* 0x01 */ DROP_RUPEE_BLUE,
|
||||
/* 0x02 */ DROP_RUPEE_RED,
|
||||
@@ -31,8 +30,7 @@ typedef enum
|
||||
/* 0x19 */ DROP_BOMBS_SPECIAL
|
||||
} DropType;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x14C */ ActorFunc updateFunc;
|
||||
/* 0x150 */ s16 collectibleFlag;
|
||||
@@ -65,15 +63,13 @@ extern u8 D_80115664[];
|
||||
|
||||
// Internal Actor Functions
|
||||
|
||||
void En_Item00_SetNewUpdate(ActorEnItem00* this, ActorFunc newUpdateFunc)
|
||||
{
|
||||
void En_Item00_SetNewUpdate(ActorEnItem00* this, ActorFunc newUpdateFunc) {
|
||||
this->updateFunc = newUpdateFunc;
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// Very close to matching, just a single ordering issue
|
||||
void En_Item00_Init(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
{
|
||||
void En_Item00_Init(ActorEnItem00* this, GlobalContext* globalCtx) {
|
||||
s32 pad1;
|
||||
s32 pad2;
|
||||
f32 sp34;
|
||||
@@ -91,8 +87,7 @@ void En_Item00_Init(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
|
||||
this->actor.params = this->actor.params & 0x00FF;
|
||||
|
||||
if (Flags_GetCollectible(globalCtx, this->collectibleFlag))
|
||||
{
|
||||
if (Flags_GetCollectible(globalCtx, this->collectibleFlag)) {
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
@@ -103,8 +98,7 @@ void En_Item00_Init(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
|
||||
this->unk_158 = 1;
|
||||
|
||||
switch (this->actor.params)
|
||||
{
|
||||
switch (this->actor.params) {
|
||||
case DROP_RUPEE_GREEN:
|
||||
case DROP_RUPEE_BLUE:
|
||||
case DROP_RUPEE_RED:
|
||||
@@ -216,8 +210,7 @@ void En_Item00_Init(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
this->unk_152 = 0;
|
||||
|
||||
// MISMATCH: minor ordering issues here
|
||||
if (!spawnParam8000)
|
||||
{
|
||||
if (!spawnParam8000) {
|
||||
En_Item00_SetNewUpdate(this, (ActorFunc)func_8001DFC8);
|
||||
this->unk_15A = -1;
|
||||
return;
|
||||
@@ -230,8 +223,7 @@ void En_Item00_Init(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
this->actor.velocity.y = 0.0f;
|
||||
this->actor.gravity = 0.0f;
|
||||
|
||||
switch (this->actor.params)
|
||||
{
|
||||
switch (this->actor.params) {
|
||||
case DROP_RUPEE_GREEN:
|
||||
Item_Give(globalCtx, ITEM_RUPEE_GREEN);
|
||||
break;
|
||||
@@ -307,147 +299,131 @@ void En_Item00_Init(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_en_item00/En_Item00_Init.s")
|
||||
#endif
|
||||
|
||||
void En_Item00_Destroy(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
{
|
||||
void En_Item00_Destroy(ActorEnItem00* this, GlobalContext* globalCtx) {
|
||||
ColliderCylinderMain* cylinderCollider = &this->cylinderCollider;
|
||||
ActorCollider_FreeCylinder(globalCtx, cylinderCollider);
|
||||
}
|
||||
|
||||
void func_8001DFC8(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
{
|
||||
if ((this->actor.params <= DROP_RUPEE_RED) ||
|
||||
((this->actor.params == DROP_HEART) && (this->unk_15A < 0)) ||
|
||||
(this->actor.params == DROP_HEART_PIECE))
|
||||
{
|
||||
void func_8001DFC8(ActorEnItem00* this, GlobalContext* globalCtx) {
|
||||
if ((this->actor.params <= DROP_RUPEE_RED) || ((this->actor.params == DROP_HEART) && (this->unk_15A < 0)) ||
|
||||
(this->actor.params == DROP_HEART_PIECE)) {
|
||||
this->actor.shape.rot.y += 960;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((this->actor.params >= DROP_SHIELD_DEKU) && (this->actor.params != DROP_BOMBS_SPECIAL))
|
||||
{
|
||||
if (this->unk_15A == -1)
|
||||
{
|
||||
if (!Math_SmoothScaleMaxMinS(&this->actor.shape.rot.x, this->actor.posRot.rot.x - 0x4000, 2, 3000, 1500))
|
||||
} else {
|
||||
if ((this->actor.params >= DROP_SHIELD_DEKU) && (this->actor.params != DROP_BOMBS_SPECIAL)) {
|
||||
if (this->unk_15A == -1) {
|
||||
if (!Math_SmoothScaleMaxMinS(&this->actor.shape.rot.x, this->actor.posRot.rot.x - 0x4000, 2, 3000,
|
||||
1500)) {
|
||||
this->unk_15A = -2;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!Math_SmoothScaleMaxMinS(&this->actor.shape.rot.x, -this->actor.posRot.rot.x - 0x4000, 2, 3000, 1500))
|
||||
}
|
||||
} else {
|
||||
if (!Math_SmoothScaleMaxMinS(&this->actor.shape.rot.x, -this->actor.posRot.rot.x - 0x4000, 2, 3000,
|
||||
1500)) {
|
||||
this->unk_15A = -1;
|
||||
}
|
||||
}
|
||||
Math_SmoothScaleMaxMinS(&this->actor.posRot.rot.x, 0, 2, 2500, 500);
|
||||
}
|
||||
}
|
||||
|
||||
if (this->actor.params == DROP_HEART_PIECE)
|
||||
if (this->actor.params == DROP_HEART_PIECE) {
|
||||
this->actor.shape.unk_08 = Math_Sins(this->actor.shape.rot.y) * 150.0f + 850.0f;
|
||||
}
|
||||
|
||||
Math_SmoothScaleMaxMinF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f);
|
||||
|
||||
if (this->unk_154 == 0)
|
||||
if ((this->actor.params != DROP_SMALL_KEY) &&
|
||||
(this->actor.params != DROP_HEART_PIECE) &&
|
||||
(this->actor.params != DROP_HEART_CONTAINER))
|
||||
{
|
||||
if (this->unk_154 == 0) {
|
||||
if ((this->actor.params != DROP_SMALL_KEY) && (this->actor.params != DROP_HEART_PIECE) &&
|
||||
(this->actor.params != DROP_HEART_CONTAINER)) {
|
||||
this->unk_154 = -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (this->unk_15A == 0)
|
||||
if ((this->actor.params != DROP_SMALL_KEY) &&
|
||||
(this->actor.params != DROP_HEART_PIECE) &&
|
||||
(this->actor.params != DROP_HEART_CONTAINER))
|
||||
{
|
||||
if (this->unk_15A == 0) {
|
||||
if ((this->actor.params != DROP_SMALL_KEY) && (this->actor.params != DROP_HEART_PIECE) &&
|
||||
(this->actor.params != DROP_HEART_CONTAINER)) {
|
||||
Actor_Kill(&this->actor);
|
||||
}
|
||||
}
|
||||
|
||||
if ((this->actor.gravity != 0.0f) && !(this->actor.bgCheckFlags & 0x0001))
|
||||
if ((this->actor.gravity != 0.0f) && !(this->actor.bgCheckFlags & 0x0001)) {
|
||||
En_Item00_SetNewUpdate(this, (ActorFunc)func_8001E1C8);
|
||||
}
|
||||
}
|
||||
|
||||
void func_8001E1C8(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
{
|
||||
void func_8001E1C8(ActorEnItem00* this, GlobalContext* globalCtx) {
|
||||
f32 originalVelocity;
|
||||
Vec3f pos;
|
||||
|
||||
if (this->actor.params <= DROP_RUPEE_RED)
|
||||
if (this->actor.params <= DROP_RUPEE_RED) {
|
||||
this->actor.shape.rot.y += 960;
|
||||
}
|
||||
|
||||
if (globalCtx->gameplayFrames & 1)
|
||||
{
|
||||
if (globalCtx->gameplayFrames & 1) {
|
||||
pos.x = this->actor.posRot.pos.x + Math_Rand_CenteredFloat(10.0f);
|
||||
pos.y = this->actor.posRot.pos.y + Math_Rand_CenteredFloat(10.0f);
|
||||
pos.z = this->actor.posRot.pos.z + Math_Rand_CenteredFloat(10.0f);
|
||||
func_80028B74(globalCtx, &pos, &D_80115518, &D_80115524, &D_80115510, &D_80115514);
|
||||
}
|
||||
|
||||
if (this->actor.bgCheckFlags & 0x0003)
|
||||
{
|
||||
if (this->actor.bgCheckFlags & 0x0003) {
|
||||
originalVelocity = this->actor.velocity.y;
|
||||
if (originalVelocity > -2.0f)
|
||||
{
|
||||
if (originalVelocity > -2.0f) {
|
||||
En_Item00_SetNewUpdate(this, (ActorFunc)func_8001DFC8);
|
||||
this->actor.velocity.y = 0.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
this->actor.velocity.y = originalVelocity * -0.8f;
|
||||
this->actor.bgCheckFlags = this->actor.bgCheckFlags & 0xFFFE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_8001E304(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
{
|
||||
void func_8001E304(ActorEnItem00* this, GlobalContext* globalCtx) {
|
||||
s32 pad;
|
||||
Vec3f pos;
|
||||
s32 var1;
|
||||
|
||||
this->unk_15A++;
|
||||
|
||||
if (this->actor.params == DROP_HEART)
|
||||
{
|
||||
if (this->actor.velocity.y < 0.0f)
|
||||
{
|
||||
if (this->actor.params == DROP_HEART) {
|
||||
if (this->actor.velocity.y < 0.0f) {
|
||||
this->actor.speedXZ = 0.0f;
|
||||
this->actor.gravity = -0.4f;
|
||||
if (this->actor.velocity.y < -1.5f)
|
||||
if (this->actor.velocity.y < -1.5f) {
|
||||
this->actor.velocity.y = -1.5f;
|
||||
this->actor.initPosRot.rot.z += (s16) ((this->actor.velocity.y + 3.0f) * 1000.0f);
|
||||
this->actor.posRot.pos.x += Math_Coss(this->actor.rotTowardsLinkY) * (-3.0f * Math_Coss(this->actor.initPosRot.rot.z));
|
||||
this->actor.posRot.pos.z += Math_Sins(this->actor.rotTowardsLinkY) * (-3.0f * Math_Coss(this->actor.initPosRot.rot.z));
|
||||
}
|
||||
this->actor.initPosRot.rot.z += (s16)((this->actor.velocity.y + 3.0f) * 1000.0f);
|
||||
this->actor.posRot.pos.x +=
|
||||
Math_Coss(this->actor.rotTowardsLinkY) * (-3.0f * Math_Coss(this->actor.initPosRot.rot.z));
|
||||
this->actor.posRot.pos.z +=
|
||||
Math_Sins(this->actor.rotTowardsLinkY) * (-3.0f * Math_Coss(this->actor.initPosRot.rot.z));
|
||||
}
|
||||
}
|
||||
|
||||
if (this->actor.params <= DROP_RUPEE_RED)
|
||||
{
|
||||
if (this->actor.params <= DROP_RUPEE_RED) {
|
||||
this->actor.shape.rot.y += 960;
|
||||
}
|
||||
else if ((this->actor.params >= DROP_SHIELD_DEKU) && (this->actor.params != DROP_BOMBS_SPECIAL))
|
||||
{
|
||||
} else if ((this->actor.params >= DROP_SHIELD_DEKU) && (this->actor.params != DROP_BOMBS_SPECIAL)) {
|
||||
this->actor.posRot.rot.x -= 700;
|
||||
this->actor.shape.rot.y += 400;
|
||||
this->actor.shape.rot.x = this->actor.posRot.rot.x - 0x4000;
|
||||
}
|
||||
|
||||
if (this->actor.velocity.y <= 2.0f)
|
||||
{
|
||||
if (this->actor.velocity.y <= 2.0f) {
|
||||
var1 = (u16)this->actor.shape.rot.z + 10000;
|
||||
if (var1 < 65535)
|
||||
if (var1 < 65535) {
|
||||
this->actor.shape.rot.z += 10000;
|
||||
else
|
||||
} else {
|
||||
this->actor.shape.rot.z = -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (!(globalCtx->gameplayFrames & 1))
|
||||
{
|
||||
if (!(globalCtx->gameplayFrames & 1)) {
|
||||
pos.x = this->actor.posRot.pos.x + (Math_Rand_ZeroOne() - 0.5f) * 10.0f;
|
||||
pos.y = this->actor.posRot.pos.y + (Math_Rand_ZeroOne() - 0.5f) * 10.0f;
|
||||
pos.z = this->actor.posRot.pos.z + (Math_Rand_ZeroOne() - 0.5f) * 10.0f;
|
||||
func_80028B74(globalCtx, &pos, &D_80115518, &D_80115524, &D_80115510, &D_80115514);
|
||||
}
|
||||
|
||||
if (this->actor.bgCheckFlags & 0x0003)
|
||||
{
|
||||
if (this->actor.bgCheckFlags & 0x0003) {
|
||||
En_Item00_SetNewUpdate(this, (ActorFunc)func_8001DFC8);
|
||||
this->actor.shape.rot.z = 0;
|
||||
this->actor.velocity.y = 0.0f;
|
||||
@@ -455,40 +431,36 @@ void func_8001E304(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
}
|
||||
}
|
||||
|
||||
void func_8001E5C8(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
{
|
||||
void func_8001E5C8(ActorEnItem00* this, GlobalContext* globalCtx) {
|
||||
Player* player = PLAYER;
|
||||
|
||||
if (this->unk_152 != 0)
|
||||
{
|
||||
if (!func_8002F410(&this->actor, globalCtx))
|
||||
{
|
||||
if (this->unk_152 != 0) {
|
||||
if (!func_8002F410(&this->actor, globalCtx)) {
|
||||
func_8002F434(&this->actor, globalCtx, this->unk_152, 50.0f, 80.0f);
|
||||
this->unk_15A++;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
this->unk_152 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (this->unk_15A == 0)
|
||||
{
|
||||
if (this->unk_15A == 0) {
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
|
||||
this->actor.posRot.pos = player->actor.posRot.pos;
|
||||
|
||||
if (this->actor.params <= DROP_RUPEE_RED)
|
||||
if (this->actor.params <= DROP_RUPEE_RED) {
|
||||
this->actor.shape.rot.y += 960;
|
||||
else if (this->actor.params == DROP_HEART)
|
||||
} else if (this->actor.params == DROP_HEART) {
|
||||
this->actor.shape.rot.y = 0;
|
||||
}
|
||||
|
||||
this->actor.posRot.pos.y += 40.0f + Math_Sins(this->unk_15A * 15000) * (this->unk_15A * 0.3f);
|
||||
|
||||
if LINK_IS_ADULT
|
||||
this->actor.posRot.pos.y += 20.0f;
|
||||
if
|
||||
LINK_IS_ADULT
|
||||
this->actor.posRot.pos.y += 20.0f;
|
||||
}
|
||||
|
||||
extern s32 D_80157D90;
|
||||
@@ -497,8 +469,7 @@ extern s16 D_80157D94;
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// Almost matching, just a few minor ordering issues
|
||||
void En_Item00_Update(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
{
|
||||
void En_Item00_Update(ActorEnItem00* this, GlobalContext* globalCtx) {
|
||||
s32 pad1;
|
||||
s32 pad2;
|
||||
s32 sp3C;
|
||||
@@ -521,44 +492,34 @@ void En_Item00_Update(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
this->actor.scale.z = this->actor.scale.x;
|
||||
this->actor.scale.y = this->actor.scale.x;
|
||||
|
||||
if (this->actor.gravity)
|
||||
{
|
||||
if (this->actor.bgCheckFlags & 0x0003)
|
||||
{
|
||||
if (this->actor.gravity) {
|
||||
if (this->actor.bgCheckFlags & 0x0003) {
|
||||
// Separate symbols seem to be used here for 0x80157D90 since the loads and stores are completely separate
|
||||
if (D_80157D90 != globalCtx->gameplayFrames)
|
||||
{
|
||||
if (D_80157D90 != globalCtx->gameplayFrames) {
|
||||
D_80157D90_ = globalCtx->gameplayFrames;
|
||||
D_80157D94 = 0;
|
||||
for (i = 0; i < 50; i++)
|
||||
{
|
||||
if (globalCtx->colCtx.dyna.flags[i] & 1)
|
||||
{
|
||||
for (i = 0; i < 50; i++) {
|
||||
if (globalCtx->colCtx.dyna.flags[i] & 1) {
|
||||
dynaActor = globalCtx->colCtx.dyna.actorMeshArr[i].actor;
|
||||
if ((dynaActor != NULL) && (dynaActor->update != NULL) &&
|
||||
((dynaActor->posRot.pos.x != dynaActor->pos4.x) ||
|
||||
(dynaActor->posRot.pos.y != dynaActor->pos4.y) ||
|
||||
(dynaActor->posRot.pos.z != dynaActor->pos4.z)))
|
||||
{
|
||||
(dynaActor->posRot.pos.z != dynaActor->pos4.z))) {
|
||||
D_80157D94++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
sp3A = 1;
|
||||
Actor_MoveForward(&this->actor);
|
||||
}
|
||||
|
||||
if (sp3A || D_80157D94)
|
||||
{
|
||||
if (sp3A || D_80157D94) {
|
||||
func_8002E4B4(globalCtx, &this->actor, 10.0f, 15.0f, 15.0f, 0x1D);
|
||||
|
||||
if (this->actor.unk_80 <= -10000.0f)
|
||||
{
|
||||
if (this->actor.unk_80 <= -10000.0f) {
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
@@ -569,8 +530,7 @@ void En_Item00_Update(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
Actor_CollisionCheck_SetAC(globalCtx, &globalCtx->sub_11E60, &this->cylinderCollider);
|
||||
|
||||
if ((this->actor.params == DROP_SHIELD_DEKU) || (this->actor.params == DROP_SHIELD_HYLIAN) ||
|
||||
(this->actor.params == DROP_TUNIC_ZORA) || (this->actor.params == DROP_TUNIC_GORON))
|
||||
{
|
||||
(this->actor.params == DROP_TUNIC_ZORA) || (this->actor.params == DROP_TUNIC_GORON)) {
|
||||
f32 newUnkBC = Math_Coss(this->actor.shape.rot.x) * 37.0f;
|
||||
this->actor.shape.unk_08 = newUnkBC;
|
||||
if (newUnkBC >= 0.0f)
|
||||
@@ -583,8 +543,7 @@ void En_Item00_Update(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
return;
|
||||
|
||||
// MISMATCH: The first function argument is loaded too early here
|
||||
if (!((this->actor.xzDistanceFromLink <= 30.0f) &&
|
||||
(this->actor.yDistanceFromLink >= -50.0f) &&
|
||||
if (!((this->actor.xzDistanceFromLink <= 30.0f) && (this->actor.yDistanceFromLink >= -50.0f) &&
|
||||
(this->actor.yDistanceFromLink <= 50.0f)))
|
||||
if (!func_8002F410(&this->actor, globalCtx))
|
||||
return;
|
||||
@@ -592,8 +551,7 @@ void En_Item00_Update(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
if (globalCtx->unk_10A20 != 0)
|
||||
return;
|
||||
|
||||
switch (this->actor.params)
|
||||
{
|
||||
switch (this->actor.params) {
|
||||
case DROP_RUPEE_GREEN:
|
||||
Item_Give(globalCtx, ITEM_RUPEE_GREEN);
|
||||
break;
|
||||
@@ -675,8 +633,7 @@ void En_Item00_Update(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
if ((sp3C != 0) && !func_8002F410(&this->actor, globalCtx))
|
||||
func_8002F554(&this->actor, globalCtx, sp3C);
|
||||
|
||||
switch (this->actor.params)
|
||||
{
|
||||
switch (this->actor.params) {
|
||||
case DROP_HEART_PIECE:
|
||||
case DROP_HEART_CONTAINER:
|
||||
case DROP_SMALL_KEY:
|
||||
@@ -684,29 +641,22 @@ void En_Item00_Update(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
case DROP_SHIELD_HYLIAN:
|
||||
case DROP_TUNIC_ZORA:
|
||||
case DROP_TUNIC_GORON:
|
||||
if (func_8002F410(&this->actor, globalCtx))
|
||||
{
|
||||
if (func_8002F410(&this->actor, globalCtx)) {
|
||||
Flags_SetCollectible(globalCtx, this->collectibleFlag);
|
||||
Actor_Kill(&this->actor);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if ((this->actor.params <= DROP_RUPEE_RED) || (this->actor.params == DROP_RUPEE_ORANGE))
|
||||
{
|
||||
if ((this->actor.params <= DROP_RUPEE_RED) || (this->actor.params == DROP_RUPEE_ORANGE)) {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_GET_RUPY, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
|
||||
}
|
||||
else if (sp3C != 0)
|
||||
{
|
||||
if (func_8002F410(&this->actor, globalCtx))
|
||||
{
|
||||
} else if (sp3C != 0) {
|
||||
if (func_8002F410(&this->actor, globalCtx)) {
|
||||
Flags_SetCollectible(globalCtx, this->collectibleFlag);
|
||||
Actor_Kill(&this->actor);
|
||||
}
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_GET_ITEM, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
|
||||
}
|
||||
|
||||
@@ -734,15 +684,12 @@ void func_8001F080(ActorEnItem00* this, GlobalContext* globalCtx);
|
||||
void func_8001F1F4(ActorEnItem00* this, GlobalContext* globalCtx);
|
||||
void func_8001F334(ActorEnItem00* this, GlobalContext* globalCtx);
|
||||
|
||||
void En_Item00_Draw(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
{
|
||||
void En_Item00_Draw(ActorEnItem00* this, GlobalContext* globalCtx) {
|
||||
s32 pad;
|
||||
f32 unkFloat;
|
||||
|
||||
if (!(this->unk_156 & this->unk_158))
|
||||
{
|
||||
switch (this->actor.params)
|
||||
{
|
||||
if (!(this->unk_156 & this->unk_158)) {
|
||||
switch (this->actor.params) {
|
||||
case DROP_RUPEE_GREEN:
|
||||
case DROP_RUPEE_BLUE:
|
||||
case DROP_RUPEE_RED:
|
||||
@@ -757,20 +704,15 @@ void En_Item00_Draw(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
func_8001F1F4(this, globalCtx);
|
||||
break;
|
||||
case DROP_HEART:
|
||||
if (this->unk_15A < 0)
|
||||
{
|
||||
if (this->unk_15A == -1)
|
||||
{
|
||||
if (this->unk_15A < 0) {
|
||||
if (this->unk_15A == -1) {
|
||||
s8 bankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_GI_HEART);
|
||||
if (Object_IsLoaded(&globalCtx->objectCtx, bankIndex))
|
||||
{
|
||||
if (Object_IsLoaded(&globalCtx->objectCtx, bankIndex)) {
|
||||
this->actor.objBankIndex = bankIndex;
|
||||
Actor_SetObjectDependency(globalCtx, &this->actor);
|
||||
this->unk_15A = -2;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
unkFloat = 16.0f;
|
||||
Matrix_Scale(unkFloat, unkFloat, unkFloat, MTXMODE_APPLY);
|
||||
func_800694A0(globalCtx, 0x08);
|
||||
@@ -813,8 +755,7 @@ void En_Item00_Draw(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
/**
|
||||
* Draw Function used for Rupee types of En_Item00.
|
||||
*/
|
||||
void func_8001EF30(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
{
|
||||
void func_8001EF30(ActorEnItem00* this, GlobalContext* globalCtx) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
s32 iconNb;
|
||||
Gfx* gfxArr[5];
|
||||
@@ -824,15 +765,16 @@ void func_8001EF30(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
func_8002EBCC(&this->actor, globalCtx, 0);
|
||||
|
||||
if (1) // Necessary to match
|
||||
{
|
||||
if (this->actor.params <= DROP_RUPEE_RED)
|
||||
if (1) { // Necessary to match
|
||||
if (this->actor.params <= DROP_RUPEE_RED) {
|
||||
iconNb = this->actor.params;
|
||||
else
|
||||
} else {
|
||||
iconNb = this->actor.params - 0x10;
|
||||
}
|
||||
}
|
||||
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_item00.c", 1562), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_item00.c", 1562),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
|
||||
gSPSegment(gfxCtx->polyOpa.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_80115530[iconNb]));
|
||||
|
||||
@@ -844,8 +786,7 @@ void func_8001EF30(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
/**
|
||||
* Draw Function used for most collectible types of En_Item00 (ammo, bombs, sticks, nuts, magic...).
|
||||
*/
|
||||
void func_8001F080(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
{
|
||||
void func_8001F080(ActorEnItem00* this, GlobalContext* globalCtx) {
|
||||
s32 iconNb;
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[4];
|
||||
@@ -856,16 +797,18 @@ void func_8001F080(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
|
||||
gfxCtx->polyOpa.p = func_800BC8A0(globalCtx, gfxCtx->polyOpa.p);
|
||||
|
||||
if (this->actor.params == DROP_BOMBS_SPECIAL)
|
||||
if (this->actor.params == DROP_BOMBS_SPECIAL) {
|
||||
iconNb = 1;
|
||||
else if (this->actor.params >= DROP_ARROWS_SMALL)
|
||||
} else if (this->actor.params >= DROP_ARROWS_SMALL) {
|
||||
iconNb -= 3;
|
||||
}
|
||||
|
||||
gfxCtx->polyOpa.p = func_800946E4(gfxCtx->polyOpa.p);
|
||||
|
||||
gSPSegment(gfxCtx->polyOpa.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_80115544[iconNb]));
|
||||
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_item00.c", 1607), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_item00.c", 1607),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, &D_0403F070);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_en_item00.c", 1611);
|
||||
@@ -874,8 +817,7 @@ void func_8001F080(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
/**
|
||||
* Draw Function used for the Heart Container type of En_Item00.
|
||||
*/
|
||||
void func_8001F1F4(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
{
|
||||
void func_8001F1F4(ActorEnItem00* this, GlobalContext* globalCtx) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
@@ -883,12 +825,14 @@ void func_8001F1F4(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
func_8002EBCC(&this->actor, globalCtx, 0);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_item00.c", 1634), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_item00.c", 1634),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, &D_0403BBA0);
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
func_8002ED80(&this->actor, globalCtx, 0);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_item00.c", 1644), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_item00.c", 1644),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, &D_0403BCD8);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_en_item00.c", 1647);
|
||||
@@ -897,8 +841,7 @@ void func_8001F1F4(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
/**
|
||||
* Draw Function used for the Piece of Heart type of En_Item00.
|
||||
*/
|
||||
void func_8001F334(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
{
|
||||
void func_8001F334(ActorEnItem00* this, GlobalContext* globalCtx) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* gfxArr[5];
|
||||
|
||||
@@ -906,7 +849,8 @@ void func_8001F334(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
func_8002ED80(&this->actor, globalCtx, 0);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_item00.c", 1670), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_item00.c", 1670),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, &D_0403B030);
|
||||
|
||||
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_en_item00.c", 1673);
|
||||
@@ -916,38 +860,39 @@ void func_8001F334(ActorEnItem00* this, GlobalContext* globalCtx)
|
||||
* Converts a given drop type ID based on link's current age, health and owned items.
|
||||
* Returns a new drop type ID or -1 to cancel the drop.
|
||||
*/
|
||||
s16 func_8001F404(s16 dropId)
|
||||
{
|
||||
if (LINK_IS_ADULT)
|
||||
{
|
||||
if (dropId == DROP_SEEDS)
|
||||
s16 func_8001F404(s16 dropId) {
|
||||
if (LINK_IS_ADULT) {
|
||||
if (dropId == DROP_SEEDS) {
|
||||
dropId = DROP_ARROWS_SMALL;
|
||||
else if (dropId == DROP_STICK)
|
||||
} else if (dropId == DROP_STICK) {
|
||||
dropId = DROP_RUPEE_GREEN;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dropId == DROP_ARROWS_SMALL || dropId == DROP_ARROWS_MEDIUM || dropId == DROP_ARROWS_LARGE)
|
||||
}
|
||||
} else {
|
||||
if (dropId == DROP_ARROWS_SMALL || dropId == DROP_ARROWS_MEDIUM || dropId == DROP_ARROWS_LARGE) {
|
||||
dropId = DROP_SEEDS;
|
||||
}
|
||||
}
|
||||
|
||||
// This is convoluted but it seems like it must be a single condition to match
|
||||
// clang-format off
|
||||
if (((dropId == DROP_BOMBS_A || dropId == DROP_BOMBS_SPECIAL || dropId == DROP_BOMBS_B) && INV_CONTENT(ITEM_BOMB) == ITEM_NONE) ||
|
||||
((dropId == DROP_ARROWS_SMALL || dropId == DROP_ARROWS_MEDIUM || dropId == DROP_ARROWS_LARGE) && INV_CONTENT(ITEM_BOW) == ITEM_NONE) ||
|
||||
((dropId == DROP_MAGIC_LARGE || dropId == DROP_MAGIC_SMALL) && gSaveContext.magic_level == 0) ||
|
||||
((dropId == DROP_SEEDS) && INV_CONTENT(ITEM_SLINGSHOT) == ITEM_NONE))
|
||||
((dropId == DROP_SEEDS) && INV_CONTENT(ITEM_SLINGSHOT) == ITEM_NONE)) {
|
||||
return -1;
|
||||
}
|
||||
// clang-format on
|
||||
|
||||
if (dropId == DROP_HEART && gSaveContext.health_capacity == gSaveContext.health)
|
||||
if (dropId == DROP_HEART && gSaveContext.health_capacity == gSaveContext.health) {
|
||||
return DROP_RUPEE_GREEN;
|
||||
}
|
||||
|
||||
return dropId;
|
||||
}
|
||||
|
||||
// External functions used by other actors to drop collectibles, which usually results in spawning an En_Item00 actor.
|
||||
|
||||
Actor* Item_DropCollectible(GlobalContext* globalCtx, Vec3f* spawnPos, s16 params)
|
||||
{
|
||||
Actor* Item_DropCollectible(GlobalContext* globalCtx, Vec3f* spawnPos, s16 params) {
|
||||
s32 pad[2];
|
||||
ActorEnItem00* spawnedActor = NULL;
|
||||
s16 param4000 = params & 0x4000;
|
||||
@@ -956,26 +901,21 @@ Actor* Item_DropCollectible(GlobalContext* globalCtx, Vec3f* spawnPos, s16 param
|
||||
|
||||
params = params & 0x3FFF;
|
||||
|
||||
if (((params & 0x00FF) == DROP_FLEXIBLE) && !param4000)
|
||||
{
|
||||
if (((params & 0x00FF) == DROP_FLEXIBLE) && !param4000) {
|
||||
// TODO: Prevent the cast to ActorEnItem00 here since this is a different actor (En_Elf)
|
||||
spawnedActor = (ActorEnItem00*) Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF,
|
||||
spawnPos->x, spawnPos->y + 40.0f, spawnPos->z,
|
||||
0, 0, 0, 0x0002);
|
||||
spawnedActor = (ActorEnItem00*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, spawnPos->x,
|
||||
spawnPos->y + 40.0f, spawnPos->z, 0, 0, 0, 0x0002);
|
||||
func_8002A9F4(globalCtx, spawnPos, 0x28E7, 1, 1, 0x28);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!param8000)
|
||||
} else {
|
||||
if (!param8000) {
|
||||
params = func_8001F404(params & 0x00FF);
|
||||
}
|
||||
|
||||
if (params != -1)
|
||||
{
|
||||
spawnedActor = (ActorEnItem00*) Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ITEM00,
|
||||
spawnPos->x, spawnPos->y, spawnPos->z,
|
||||
0, 0, 0, params | param8000 | param3F00);
|
||||
if ((spawnedActor != NULL) && !param8000)
|
||||
{
|
||||
if (params != -1) {
|
||||
spawnedActor =
|
||||
(ActorEnItem00*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ITEM00, spawnPos->x, spawnPos->y,
|
||||
spawnPos->z, 0, 0, 0, params | param8000 | param3F00);
|
||||
if ((spawnedActor != NULL) && !param8000) {
|
||||
spawnedActor->actor.velocity.y = !param4000 ? 8.0f : -2.0f;
|
||||
spawnedActor->actor.speedXZ = 2.0f;
|
||||
spawnedActor->actor.gravity = -0.9f;
|
||||
@@ -985,8 +925,7 @@ Actor* Item_DropCollectible(GlobalContext* globalCtx, Vec3f* spawnPos, s16 param
|
||||
spawnedActor->unk_15A = 220;
|
||||
if ((spawnedActor->actor.params != DROP_SMALL_KEY) &&
|
||||
(spawnedActor->actor.params != DROP_HEART_PIECE) &&
|
||||
(spawnedActor->actor.params != DROP_HEART_CONTAINER))
|
||||
{
|
||||
(spawnedActor->actor.params != DROP_HEART_CONTAINER)) {
|
||||
spawnedActor->actor.room = -1;
|
||||
}
|
||||
spawnedActor->actor.flags |= 0x0010;
|
||||
@@ -994,11 +933,10 @@ Actor* Item_DropCollectible(GlobalContext* globalCtx, Vec3f* spawnPos, s16 param
|
||||
}
|
||||
}
|
||||
|
||||
return (Actor*) spawnedActor;
|
||||
return (Actor*)spawnedActor;
|
||||
}
|
||||
|
||||
Actor* Item_DropCollectible2(GlobalContext* globalCtx, Vec3f* spawnPos, s16 params)
|
||||
{
|
||||
Actor* Item_DropCollectible2(GlobalContext* globalCtx, Vec3f* spawnPos, s16 params) {
|
||||
ActorEnItem00* spawnedActor = NULL;
|
||||
s32 pad;
|
||||
s16 param4000 = params & 0x4000;
|
||||
@@ -1007,24 +945,18 @@ Actor* Item_DropCollectible2(GlobalContext* globalCtx, Vec3f* spawnPos, s16 para
|
||||
|
||||
params = params & 0x3FFF;
|
||||
|
||||
if (((params & 0x00FF) == DROP_FLEXIBLE) && !param4000)
|
||||
{
|
||||
if (((params & 0x00FF) == DROP_FLEXIBLE) && !param4000) {
|
||||
// TODO: Prevent the cast to ActorEnItem00 here since this is a different actor (En_Elf)
|
||||
spawnedActor = (ActorEnItem00*) Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF,
|
||||
spawnPos->x, spawnPos->y + 40.0f, spawnPos->z,
|
||||
0, 0, 0, 0x0002);
|
||||
spawnedActor = (ActorEnItem00*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, spawnPos->x,
|
||||
spawnPos->y + 40.0f, spawnPos->z, 0, 0, 0, 0x0002);
|
||||
func_8002A9F4(globalCtx, spawnPos, 0x28E7, 1, 1, 0x28);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
params = func_8001F404(params & 0x00FF);
|
||||
if (params != -1)
|
||||
{
|
||||
spawnedActor = (ActorEnItem00*) Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ITEM00,
|
||||
spawnPos->x, spawnPos->y, spawnPos->z,
|
||||
0, 0, 0, params | param8000 | param3F00);
|
||||
if ((spawnedActor != NULL) && !param8000)
|
||||
{
|
||||
if (params != -1) {
|
||||
spawnedActor =
|
||||
(ActorEnItem00*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ITEM00, spawnPos->x, spawnPos->y,
|
||||
spawnPos->z, 0, 0, 0, params | param8000 | param3F00);
|
||||
if ((spawnedActor != NULL) && !param8000) {
|
||||
spawnedActor->actor.velocity.y = 0.0f;
|
||||
spawnedActor->actor.speedXZ = 0.0f;
|
||||
spawnedActor->actor.gravity = param4000 ? 0.0f : -0.9f;
|
||||
@@ -1034,11 +966,10 @@ Actor* Item_DropCollectible2(GlobalContext* globalCtx, Vec3f* spawnPos, s16 para
|
||||
}
|
||||
}
|
||||
|
||||
return (Actor*) spawnedActor;
|
||||
return (Actor*)spawnedActor;
|
||||
}
|
||||
|
||||
void Item_DropCollectibleRandom(GlobalContext* globalCtx, Actor* fromActor, Vec3f* spawnPos, s16 params)
|
||||
{
|
||||
void Item_DropCollectibleRandom(GlobalContext* globalCtx, Actor* fromActor, Vec3f* spawnPos, s16 params) {
|
||||
s32 pad;
|
||||
ActorEnItem00* spawnedActor;
|
||||
s16 dropQuantity;
|
||||
@@ -1050,133 +981,93 @@ void Item_DropCollectibleRandom(GlobalContext* globalCtx, Actor* fromActor, Vec3
|
||||
param8000 = params & 0x8000;
|
||||
params = params & 0x7FFF;
|
||||
|
||||
if (fromActor != NULL)
|
||||
{
|
||||
if (fromActor->unk_116)
|
||||
{
|
||||
if (fromActor->unk_116 & 0x01)
|
||||
{
|
||||
if (fromActor != NULL) {
|
||||
if (fromActor->unk_116) {
|
||||
if (fromActor->unk_116 & 0x01) {
|
||||
params = 1 * 0x10;
|
||||
dropTableIndex = 0xB;
|
||||
}
|
||||
else if (fromActor->unk_116 & 0x02)
|
||||
{
|
||||
} else if (fromActor->unk_116 & 0x02) {
|
||||
params = 1 * 0x10;
|
||||
dropTableIndex = 0x6;
|
||||
}
|
||||
else if (fromActor->unk_116 & 0x04)
|
||||
{
|
||||
} else if (fromActor->unk_116 & 0x04) {
|
||||
params = 6 * 0x10;
|
||||
dropTableIndex = 0x9;
|
||||
}
|
||||
else if (fromActor->unk_116 & 0x08)
|
||||
{
|
||||
} else if (fromActor->unk_116 & 0x08) {
|
||||
params = 3 * 0x10;
|
||||
dropTableIndex = 0xB;
|
||||
}
|
||||
else if (fromActor->unk_116 & 0x10)
|
||||
{
|
||||
} else if (fromActor->unk_116 & 0x10) {
|
||||
params = 6 * 0x10;
|
||||
dropTableIndex = 0xC;
|
||||
}
|
||||
else if (fromActor->unk_116 & 0x20)
|
||||
{
|
||||
} else if (fromActor->unk_116 & 0x20) {
|
||||
params = 0 * 0x10;
|
||||
dropTableIndex = 0x0;
|
||||
}
|
||||
else if (fromActor->unk_116 & 0x40)
|
||||
{
|
||||
} else if (fromActor->unk_116 & 0x40) {
|
||||
params = 0 * 0x10;
|
||||
dropTableIndex = 0x1;
|
||||
}
|
||||
}
|
||||
if (fromActor->unk_116 & 0x20)
|
||||
if (fromActor->unk_116 & 0x20) {
|
||||
dropId = DROP_RUPEE_PURPLE;
|
||||
else
|
||||
} else {
|
||||
dropId = D_80115574[params + dropTableIndex];
|
||||
}
|
||||
else
|
||||
}
|
||||
} else {
|
||||
dropId = D_80115574[params + dropTableIndex];
|
||||
}
|
||||
|
||||
if (dropId == DROP_FLEXIBLE)
|
||||
{
|
||||
if (gSaveContext.health <= 0x10) // 1 heart or less
|
||||
{
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF,
|
||||
spawnPos->x, spawnPos->y + 40.0f, spawnPos->z,
|
||||
0, 0, 0, 0x0002);
|
||||
if (dropId == DROP_FLEXIBLE) {
|
||||
if (gSaveContext.health <= 0x10) { // 1 heart or less
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, spawnPos->x, spawnPos->y + 40.0f, spawnPos->z, 0,
|
||||
0, 0, 0x0002);
|
||||
func_8002A9F4(globalCtx, spawnPos, 0x28E7, 1, 1, 0x28);
|
||||
return;
|
||||
}
|
||||
else if (gSaveContext.health <= 0x30) // 3 hearts or less
|
||||
{
|
||||
} else if (gSaveContext.health <= 0x30) { // 3 hearts or less
|
||||
params = 0xB * 0x10;
|
||||
dropTableIndex = 0x0;
|
||||
dropId = DROP_HEART;
|
||||
}
|
||||
else if (gSaveContext.health <= 0x50) // 5 hearts or less
|
||||
{
|
||||
} else if (gSaveContext.health <= 0x50) { // 5 hearts or less
|
||||
params = 0xA * 0x10;
|
||||
dropTableIndex = 0x0;
|
||||
dropId = DROP_HEART;
|
||||
}
|
||||
else if ((gSaveContext.magic_level != 0) && (gSaveContext.magic == 0)) // Empty magic meter
|
||||
{
|
||||
} else if ((gSaveContext.magic_level != 0) && (gSaveContext.magic == 0)) { // Empty magic meter
|
||||
params = 0xA * 0x10;
|
||||
dropTableIndex = 0x0;
|
||||
dropId = DROP_MAGIC_LARGE;
|
||||
}
|
||||
else if ((gSaveContext.magic_level != 0) && (gSaveContext.magic <= (gSaveContext.magic_level >> 1))) // Half magic or less
|
||||
{
|
||||
} else if ((gSaveContext.magic_level != 0) &&
|
||||
(gSaveContext.magic <= (gSaveContext.magic_level >> 1))) { // Half magic or less
|
||||
params = 0xA * 0x10;
|
||||
dropTableIndex = 0x0;
|
||||
dropId = DROP_MAGIC_SMALL;
|
||||
}
|
||||
else if (LINK_IS_CHILD && (AMMO(ITEM_SLINGSHOT) < 6)) // Child and less then 6 deku seeds
|
||||
{
|
||||
} else if (LINK_IS_CHILD && (AMMO(ITEM_SLINGSHOT) < 6)) { // Child and less then 6 deku seeds
|
||||
params = 0xA * 0x10;
|
||||
dropTableIndex = 0x0;
|
||||
dropId = DROP_SEEDS;
|
||||
}
|
||||
else if (LINK_IS_ADULT && (AMMO(ITEM_BOW) < 6)) // Adult and less than 6 arrows
|
||||
{
|
||||
} else if (LINK_IS_ADULT && (AMMO(ITEM_BOW) < 6)) { // Adult and less than 6 arrows
|
||||
params = 0xA * 0x10;
|
||||
dropTableIndex = 0x0;
|
||||
dropId = DROP_ARROWS_MEDIUM;
|
||||
}
|
||||
else if (AMMO(ITEM_BOMB) < 6) // Less than 6 bombs
|
||||
{
|
||||
} else if (AMMO(ITEM_BOMB) < 6) { // Less than 6 bombs
|
||||
params = 0xD * 0x10;
|
||||
dropTableIndex = 0x0;
|
||||
dropId = DROP_BOMBS_A;
|
||||
}
|
||||
else if (gSaveContext.rupees < 11) // Less than 11 Rupees
|
||||
{
|
||||
} else if (gSaveContext.rupees < 11) { // Less than 11 Rupees
|
||||
params = 0xA * 0x10;
|
||||
dropTableIndex = 0x0;
|
||||
dropId = DROP_RUPEE_RED;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (dropId != 0xFF)
|
||||
{
|
||||
if (dropId != 0xFF) {
|
||||
dropQuantity = D_80115664[params + dropTableIndex];
|
||||
while (dropQuantity > 0)
|
||||
{
|
||||
if (!param8000)
|
||||
{
|
||||
while (dropQuantity > 0) {
|
||||
if (!param8000) {
|
||||
dropId = func_8001F404(dropId);
|
||||
if (dropId != 0xFF)
|
||||
{
|
||||
spawnedActor = (ActorEnItem00*) Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ITEM00,
|
||||
spawnPos->x, spawnPos->y, spawnPos->z,
|
||||
0, 0, 0, dropId);
|
||||
if ((spawnedActor != NULL) && (dropId != 0xFF))
|
||||
{
|
||||
if (dropId != 0xFF) {
|
||||
spawnedActor = (ActorEnItem00*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ITEM00,
|
||||
spawnPos->x, spawnPos->y, spawnPos->z, 0, 0, 0, dropId);
|
||||
if ((spawnedActor != NULL) && (dropId != 0xFF)) {
|
||||
spawnedActor->actor.velocity.y = 8.0f;
|
||||
spawnedActor->actor.speedXZ = 2.0f;
|
||||
spawnedActor->actor.gravity = -0.9f;
|
||||
@@ -1186,16 +1077,13 @@ void Item_DropCollectibleRandom(GlobalContext* globalCtx, Actor* fromActor, Vec3
|
||||
spawnedActor->actor.flags |= 0x0010;
|
||||
if ((spawnedActor->actor.params != DROP_SMALL_KEY) &&
|
||||
(spawnedActor->actor.params != DROP_HEART_PIECE) &&
|
||||
(spawnedActor->actor.params != DROP_HEART_CONTAINER))
|
||||
{
|
||||
(spawnedActor->actor.params != DROP_HEART_CONTAINER)) {
|
||||
spawnedActor->actor.room = -1;
|
||||
}
|
||||
spawnedActor->unk_15A = 220;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
Item_DropCollectible(globalCtx, spawnPos, params | 0x8000);
|
||||
}
|
||||
dropQuantity--;
|
||||
|
||||
@@ -18,4 +18,3 @@
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_fbdemo/func_800B23E8.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_fbdemo/func_800B23F0.s")
|
||||
|
||||
|
||||
@@ -14,4 +14,3 @@
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_fcurve_data_skelanime/func_8006CBAC.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_fcurve_data_skelanime/func_8006CF6C.s")
|
||||
|
||||
|
||||
+119
-175
@@ -2,22 +2,20 @@
|
||||
#include <global.h>
|
||||
#include <vt.h>
|
||||
|
||||
s32 func_8006CFC0(s32 scene)
|
||||
{
|
||||
s32 func_8006CFC0(s32 scene) {
|
||||
s32 validScenes[] = { SCENE_SPOT00, SCENE_SPOT06, SCENE_SPOT09, SCENE_SPOT12, SCENE_SPOT20 };
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(validScenes); i++)
|
||||
{
|
||||
if (scene == validScenes[i])
|
||||
for (i = 0; i < ARRAY_COUNT(validScenes); i++) {
|
||||
if (scene == validScenes[i]) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void func_8006D074(GlobalContext* globalCtx)
|
||||
{
|
||||
void func_8006D074(GlobalContext* globalCtx) {
|
||||
gSaveContext.horse_data.scene = SCENE_SPOT00;
|
||||
gSaveContext.horse_data.pos.x = -1840;
|
||||
gSaveContext.horse_data.pos.y = 72;
|
||||
@@ -25,10 +23,8 @@ void func_8006D074(GlobalContext* globalCtx)
|
||||
gSaveContext.horse_data.angle = -27353;
|
||||
}
|
||||
|
||||
void func_8006D0AC(GlobalContext* globalCtx)
|
||||
{
|
||||
if (gSaveContext.horse_data.scene == SCENE_SPOT06)
|
||||
{
|
||||
void func_8006D0AC(GlobalContext* globalCtx) {
|
||||
if (gSaveContext.horse_data.scene == SCENE_SPOT06) {
|
||||
gSaveContext.horse_data.scene = SCENE_SPOT06;
|
||||
gSaveContext.horse_data.pos.x = -2065;
|
||||
gSaveContext.horse_data.pos.y = -863;
|
||||
@@ -37,147 +33,126 @@ void func_8006D0AC(GlobalContext* globalCtx)
|
||||
}
|
||||
}
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/* 0x00 */ s16 scene;
|
||||
typedef struct {
|
||||
/* 0x00 */ s16 scene;
|
||||
/* 0x02 */ Vec3s pos;
|
||||
/* 0x08 */ s16 angle;
|
||||
/* 0x0A */ s16 type;
|
||||
/* 0x08 */ s16 angle;
|
||||
/* 0x0A */ s16 type;
|
||||
} HorseSpawn;
|
||||
|
||||
void func_8006D0EC(GlobalContext* globalCtx, Player* player)
|
||||
{
|
||||
void func_8006D0EC(GlobalContext* globalCtx, Player* player) {
|
||||
s32 i;
|
||||
HorseSpawn horseSpawns[] =
|
||||
{
|
||||
{ 81, 0xFE34, 0x0064, 0x19F0, 0, 2 },
|
||||
{ 87, 0xF877, 0xFBFF, 0x0300, 0, 2 },
|
||||
{ 90, 0x0A06, 0xFEFD, 0x02FF, 0, 2 },
|
||||
{ 93, 0xFEB8, 0x000A, 0x03B9, 0, 2 },
|
||||
HorseSpawn horseSpawns[] = {
|
||||
{ 81, 0xFE34, 0x0064, 0x19F0, 0, 2 }, { 87, 0xF877, 0xFBFF, 0x0300, 0, 2 },
|
||||
{ 90, 0x0A06, 0xFEFD, 0x02FF, 0, 2 }, { 93, 0xFEB8, 0x000A, 0x03B9, 0, 2 },
|
||||
{ 99, 0x03A0, 0x0000, 0xF718, 0, 2 },
|
||||
};
|
||||
|
||||
if ((AREG(6) != 0) && (Flags_GetEventChkInf(0x18) || (DREG(1) != 0)))
|
||||
{
|
||||
player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE,
|
||||
player->actor.posRot.pos.x, player->actor.posRot.pos.y, player->actor.posRot.pos.z,
|
||||
player->actor.shape.rot.x, player->actor.shape.rot.y, player->actor.shape.rot.z, 9);
|
||||
if (player->rideActor == NULL)
|
||||
if ((AREG(6) != 0) && (Flags_GetEventChkInf(0x18) || (DREG(1) != 0))) {
|
||||
player->rideActor =
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, player->actor.posRot.pos.x,
|
||||
player->actor.posRot.pos.y, player->actor.posRot.pos.z, player->actor.shape.rot.x,
|
||||
player->actor.shape.rot.y, player->actor.shape.rot.z, 9);
|
||||
if (player->rideActor == NULL) {
|
||||
__assert("player->ride.actor != NULL", "../z_horse.c", 343);
|
||||
}
|
||||
|
||||
func_8002DECC(globalCtx, player, player->rideActor);
|
||||
func_8002DE74(globalCtx, player);
|
||||
gSaveContext.horse_data.scene = globalCtx->sceneNum;
|
||||
|
||||
if (globalCtx->sceneNum == SCENE_SPOT12)
|
||||
if (globalCtx->sceneNum == SCENE_SPOT12) {
|
||||
player->rideActor->room = -1;
|
||||
}
|
||||
else if ((globalCtx->sceneNum == SCENE_SPOT12) && (gSaveContext.minigame_state == 3))
|
||||
{
|
||||
}
|
||||
} else if ((globalCtx->sceneNum == SCENE_SPOT12) && (gSaveContext.minigame_state == 3)) {
|
||||
Actor* horseActor;
|
||||
gSaveContext.minigame_state = 0;
|
||||
horseActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE,
|
||||
3586.0f, 1413.0f, -402.0f,
|
||||
0, 0x4000, 0, 1);
|
||||
horseActor =
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, 3586.0f, 1413.0f, -402.0f, 0, 0x4000, 0, 1);
|
||||
horseActor->room = -1;
|
||||
}
|
||||
else if ((gSaveContext.entrance_index == 1230) && (gSaveContext.event_chk_inf[1] & 0x100))
|
||||
{
|
||||
} else if ((gSaveContext.entrance_index == 1230) && (gSaveContext.event_chk_inf[1] & 0x100)) {
|
||||
Actor* horseActor;
|
||||
horseActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE,
|
||||
-25.0f, 0.0f, -1600.0f,
|
||||
0, -0x4000, 0, 1);
|
||||
if (horseActor == NULL)
|
||||
horseActor =
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, -25.0f, 0.0f, -1600.0f, 0, -0x4000, 0, 1);
|
||||
if (horseActor == NULL) {
|
||||
__assert("horse_actor != NULL", "../z_horse.c", 389);
|
||||
}
|
||||
else if ((globalCtx->sceneNum == gSaveContext.horse_data.scene) && (Flags_GetEventChkInf(0x18) != 0 || DREG(1) != 0))
|
||||
{
|
||||
// Translates to: "SET BY EXISTENCE OF HORSE %d %d %d"
|
||||
osSyncPrintf("馬存在によるセット %d %d %d\n", gSaveContext.horse_data.scene, Flags_GetEventChkInf(0x18), DREG(1));
|
||||
|
||||
if (func_8006CFC0(gSaveContext.horse_data.scene))
|
||||
{
|
||||
Actor* horseActor;
|
||||
horseActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE,
|
||||
gSaveContext.horse_data.pos.x, gSaveContext.horse_data.pos.y, gSaveContext.horse_data.pos.z,
|
||||
0, gSaveContext.horse_data.angle, 0, 1);
|
||||
if (horseActor == NULL)
|
||||
__assert("horse_actor != NULL", "../z_horse.c", 414);
|
||||
|
||||
if (globalCtx->sceneNum == SCENE_SPOT12)
|
||||
horseActor->room = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else if ((globalCtx->sceneNum == gSaveContext.horse_data.scene) &&
|
||||
(Flags_GetEventChkInf(0x18) != 0 || DREG(1) != 0)) {
|
||||
// Translates to: "SET BY EXISTENCE OF HORSE %d %d %d"
|
||||
osSyncPrintf("馬存在によるセット %d %d %d\n", gSaveContext.horse_data.scene, Flags_GetEventChkInf(0x18),
|
||||
DREG(1));
|
||||
|
||||
if (func_8006CFC0(gSaveContext.horse_data.scene)) {
|
||||
Actor* horseActor;
|
||||
horseActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, gSaveContext.horse_data.pos.x,
|
||||
gSaveContext.horse_data.pos.y, gSaveContext.horse_data.pos.z, 0,
|
||||
gSaveContext.horse_data.angle, 0, 1);
|
||||
if (horseActor == NULL) {
|
||||
__assert("horse_actor != NULL", "../z_horse.c", 414);
|
||||
}
|
||||
|
||||
if (globalCtx->sceneNum == SCENE_SPOT12) {
|
||||
horseActor->room = -1;
|
||||
}
|
||||
} else {
|
||||
osSyncPrintf(VT_COL(RED, WHITE));
|
||||
// Translates to: "Horse_SetNormal():%d SET SPOT IS NO GOOD."
|
||||
osSyncPrintf("Horse_SetNormal():%d セットスポットまずいです。\n", gSaveContext.horse_data.scene);
|
||||
osSyncPrintf(VT_RST);
|
||||
func_8006D074(globalCtx);
|
||||
}
|
||||
}
|
||||
else if ((globalCtx->sceneNum == SCENE_SPOT20) && !Flags_GetEventChkInf(0x18) && (DREG(1) == 0))
|
||||
{
|
||||
} else if ((globalCtx->sceneNum == SCENE_SPOT20) && !Flags_GetEventChkInf(0x18) && (DREG(1) == 0)) {
|
||||
Actor* horseActor;
|
||||
horseActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE,
|
||||
0.0f, 0.0f, -500.0f,
|
||||
0, 0, 0, 1);
|
||||
if (horseActor == 0)
|
||||
horseActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, 0.0f, 0.0f, -500.0f, 0, 0, 0, 1);
|
||||
if (horseActor == 0) {
|
||||
__assert("horse_actor != NULL", "../z_horse.c", 443);
|
||||
}
|
||||
else if (Flags_GetEventChkInf(0x18) || (DREG(1) != 0))
|
||||
{
|
||||
for (i = 0; i < ARRAY_COUNT(horseSpawns); i++)
|
||||
{
|
||||
}
|
||||
} else if (Flags_GetEventChkInf(0x18) || (DREG(1) != 0)) {
|
||||
for (i = 0; i < ARRAY_COUNT(horseSpawns); i++) {
|
||||
HorseSpawn* horseSpawn = &horseSpawns[i];
|
||||
if (horseSpawn->scene == globalCtx->sceneNum)
|
||||
{
|
||||
if (horseSpawn->scene == globalCtx->sceneNum) {
|
||||
Actor* horseActor;
|
||||
horseActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE,
|
||||
horseSpawn->pos.x, horseSpawn->pos.y, horseSpawn->pos.z,
|
||||
0, horseSpawn->angle, 0, horseSpawn->type);
|
||||
if (horseActor == NULL)
|
||||
horseActor =
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, horseSpawn->pos.x, horseSpawn->pos.y,
|
||||
horseSpawn->pos.z, 0, horseSpawn->angle, 0, horseSpawn->type);
|
||||
if (horseActor == NULL) {
|
||||
__assert("horse_actor != NULL", "../z_horse.c", 466);
|
||||
}
|
||||
|
||||
if (globalCtx->sceneNum == SCENE_SPOT12)
|
||||
if (globalCtx->sceneNum == SCENE_SPOT12) {
|
||||
horseActor->room = -1;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!Flags_GetEventChkInf(0x18))
|
||||
{
|
||||
if ((DREG(1) == 0) && (globalCtx->sceneNum == SCENE_SOUKO) &&(gSaveContext.night_flag != 0))
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE,
|
||||
0.0f, 0.0f, -60.0f,
|
||||
0, 0x7360, 0, 1);
|
||||
} else if (!Flags_GetEventChkInf(0x18)) {
|
||||
if ((DREG(1) == 0) && (globalCtx->sceneNum == SCENE_SOUKO) && (gSaveContext.night_flag != 0)) {
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, 0.0f, 0.0f, -60.0f, 0, 0x7360, 0, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/* 0x00 */ s16 scene;
|
||||
/* 0x04 */ s32 cutsceneIndex;
|
||||
typedef struct {
|
||||
/* 0x00 */ s16 scene;
|
||||
/* 0x04 */ s32 cutsceneIndex;
|
||||
/* 0x08 */ Vec3s pos;
|
||||
/* 0x0E */ s16 angle;
|
||||
/* 0x10 */ s16 type;
|
||||
/* 0x0E */ s16 angle;
|
||||
/* 0x10 */ s16 type;
|
||||
} struct_8011F9B8;
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// regalloc differences
|
||||
void func_8006D684(GlobalContext* globalCtx, Player* player)
|
||||
{
|
||||
void func_8006D684(GlobalContext* globalCtx, Player* player) {
|
||||
s32 pad;
|
||||
s32 i;
|
||||
Vec3s spawnPos;
|
||||
|
||||
if ((gSaveContext.entrance_index == 0x028A || gSaveContext.entrance_index == 0x028E ||
|
||||
gSaveContext.entrance_index == 0x0292 || gSaveContext.entrance_index == 0x0476) &&
|
||||
(gSaveContext.respawn_flag == 0))
|
||||
{
|
||||
Vec3s spawnPositions[] =
|
||||
{
|
||||
(gSaveContext.respawn_flag == 0)) {
|
||||
Vec3s spawnPositions[] = {
|
||||
{ 0xF46F, 0x0139, 0x1E14 },
|
||||
{ 0xF894, 0x0139, 0x1B67 },
|
||||
{ 0xF035, 0x0139, 0x1B15 },
|
||||
@@ -193,22 +168,18 @@ void func_8006D684(GlobalContext* globalCtx, Player* player)
|
||||
else
|
||||
spawnPos = spawnPositions[3];
|
||||
|
||||
player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE,
|
||||
spawnPos.x, spawnPos.y, spawnPos.z,
|
||||
0, player->actor.posRot.rot.y, 0, 7);
|
||||
player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, spawnPos.x, spawnPos.y,
|
||||
spawnPos.z, 0, player->actor.posRot.rot.y, 0, 7);
|
||||
if (player->rideActor == NULL)
|
||||
__assert("player->ride.actor != NULL", "../z_horse.c", 561);
|
||||
|
||||
func_8002DECC(globalCtx, player, player->rideActor);
|
||||
func_8002DE74(globalCtx, player);
|
||||
gSaveContext.horse_data.scene = globalCtx->sceneNum;
|
||||
}
|
||||
else if ((globalCtx->sceneNum == SCENE_SPOT20) && ((gSaveContext.event_inf[0] & 0xF) == 6) &&
|
||||
(Flags_GetEventChkInf(0x18) == 0) && (DREG(1) == 0))
|
||||
{
|
||||
player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE,
|
||||
894.0f, 0.0f, -2084.0f,
|
||||
0, -0x7FFF, 0, 5);
|
||||
} else if ((globalCtx->sceneNum == SCENE_SPOT20) && ((gSaveContext.event_inf[0] & 0xF) == 6) &&
|
||||
(Flags_GetEventChkInf(0x18) == 0) && (DREG(1) == 0)) {
|
||||
player->rideActor =
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, 894.0f, 0.0f, -2084.0f, 0, -0x7FFF, 0, 5);
|
||||
if (player->rideActor == NULL)
|
||||
__assert("player->ride.actor != NULL", "../z_horse.c", 582);
|
||||
|
||||
@@ -218,45 +189,33 @@ void func_8006D684(GlobalContext* globalCtx, Player* player)
|
||||
|
||||
if (globalCtx->sceneNum == SCENE_SPOT12)
|
||||
player->rideActor->room = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
static struct_8011F9B8 D_8011F9B8[] =
|
||||
{
|
||||
{ 93, 0xFFF0, 0x0E10, 0x0585, 0x0168, 0x8001, 8 },
|
||||
{ 99, 0xFFF0, 0xFF06, 0x0001, 0xF9D4, 0x4000, 6 },
|
||||
{ 99, 0xFFF1, 0x0000, 0x0000, 0x0000, 0x0000, 5 },
|
||||
{ 99, 0xFFF5, 0x0000, 0x0000, 0x0000, 0x0000, 7 },
|
||||
{ 81, 0xFFF3, 0xF46F, 0x0139, 0x1E14, 0x0000, 7 },
|
||||
{ 81, 0xFFF4, 0xF894, 0x0139, 0x1B67, 0x0000, 7 },
|
||||
{ 81, 0xFFF5, 0xF035, 0x0139, 0x1B15, 0x0000, 7 },
|
||||
{ 81, 0xFFF6, 0xF035, 0x0139, 0x1B15, 0x0000, 7 },
|
||||
} else {
|
||||
static struct_8011F9B8 D_8011F9B8[] = {
|
||||
{ 93, 0xFFF0, 0x0E10, 0x0585, 0x0168, 0x8001, 8 }, { 99, 0xFFF0, 0xFF06, 0x0001, 0xF9D4, 0x4000, 6 },
|
||||
{ 99, 0xFFF1, 0x0000, 0x0000, 0x0000, 0x0000, 5 }, { 99, 0xFFF5, 0x0000, 0x0000, 0x0000, 0x0000, 7 },
|
||||
{ 81, 0xFFF3, 0xF46F, 0x0139, 0x1E14, 0x0000, 7 }, { 81, 0xFFF4, 0xF894, 0x0139, 0x1B67, 0x0000, 7 },
|
||||
{ 81, 0xFFF5, 0xF035, 0x0139, 0x1B15, 0x0000, 7 }, { 81, 0xFFF6, 0xF035, 0x0139, 0x1B15, 0x0000, 7 },
|
||||
};
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(D_8011F9B8); i++)
|
||||
{
|
||||
if ((globalCtx->sceneNum == D_8011F9B8[i].scene) && (gSaveContext.cutscene_index == D_8011F9B8[i].cutsceneIndex))
|
||||
{
|
||||
if (D_8011F9B8[i].type == 7)
|
||||
{
|
||||
if ((globalCtx->sceneNum == 99) && (gSaveContext.cutscene_index == 0xFFF1))
|
||||
{
|
||||
for (i = 0; i < ARRAY_COUNT(D_8011F9B8); i++) {
|
||||
if ((globalCtx->sceneNum == D_8011F9B8[i].scene) &&
|
||||
(gSaveContext.cutscene_index == D_8011F9B8[i].cutsceneIndex)) {
|
||||
if (D_8011F9B8[i].type == 7) {
|
||||
if ((globalCtx->sceneNum == 99) && (gSaveContext.cutscene_index == 0xFFF1)) {
|
||||
D_8011F9B8[i].pos.x = player->actor.posRot.pos.x;
|
||||
D_8011F9B8[i].pos.y = player->actor.posRot.pos.y;
|
||||
D_8011F9B8[i].pos.z = player->actor.posRot.pos.z;
|
||||
}
|
||||
|
||||
player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE,
|
||||
D_8011F9B8[i].pos.x, D_8011F9B8[i].pos.y, D_8011F9B8[i].pos.z,
|
||||
0, player->actor.posRot.rot.y, 0, D_8011F9B8[i].type);
|
||||
D_8011F9B8[i].pos.x, D_8011F9B8[i].pos.y, D_8011F9B8[i].pos.z, 0,
|
||||
player->actor.posRot.rot.y, 0, D_8011F9B8[i].type);
|
||||
if (player->rideActor == NULL)
|
||||
__assert("player->ride.actor != NULL", "../z_horse.c", 628);
|
||||
|
||||
func_8002DECC(globalCtx, player, player->rideActor);
|
||||
func_8002DE74(globalCtx, player);
|
||||
}
|
||||
else if ((D_8011F9B8[i].type == 5) || (D_8011F9B8[i].type == 6) || (D_8011F9B8[i].type == 8))
|
||||
{
|
||||
} else if ((D_8011F9B8[i].type == 5) || (D_8011F9B8[i].type == 6) || (D_8011F9B8[i].type == 8)) {
|
||||
Vec3f sp54;
|
||||
s32 temp;
|
||||
s32 pad2;
|
||||
@@ -266,8 +225,8 @@ void func_8006D684(GlobalContext* globalCtx, Player* player)
|
||||
temp = 0x8000;
|
||||
|
||||
player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE,
|
||||
D_8011F9B8[i].pos.x, D_8011F9B8[i].pos.y, D_8011F9B8[i].pos.z,
|
||||
0, D_8011F9B8[i].angle, 0, D_8011F9B8[i].type | temp);
|
||||
D_8011F9B8[i].pos.x, D_8011F9B8[i].pos.y, D_8011F9B8[i].pos.z, 0,
|
||||
D_8011F9B8[i].angle, 0, D_8011F9B8[i].type | temp);
|
||||
if (player->rideActor == NULL)
|
||||
__assert("player->ride.actor != NULL", "../z_horse.c", 667);
|
||||
|
||||
@@ -285,12 +244,10 @@ void func_8006D684(GlobalContext* globalCtx, Player* player)
|
||||
sp54.z = player->actor.posRot.pos.z;
|
||||
|
||||
func_800C04D8(globalCtx, globalCtx->cameraCtx.unk_5C0, &player->actor.posRot, &sp54);
|
||||
}
|
||||
else
|
||||
{
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE,
|
||||
D_8011F9B8[i].pos.x, D_8011F9B8[i].pos.y, D_8011F9B8[i].pos.z,
|
||||
0, D_8011F9B8[i].angle, 0, D_8011F9B8[i].type);
|
||||
} else {
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, D_8011F9B8[i].pos.x,
|
||||
D_8011F9B8[i].pos.y, D_8011F9B8[i].pos.z, 0, D_8011F9B8[i].angle, 0,
|
||||
D_8011F9B8[i].type);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -298,33 +255,24 @@ void func_8006D684(GlobalContext* globalCtx, Player* player)
|
||||
}
|
||||
}
|
||||
#else
|
||||
Vec3s D_8011F9A0[] =
|
||||
{
|
||||
Vec3s D_8011F9A0[] = {
|
||||
{ 0xF46F, 0x0139, 0x1E14 },
|
||||
{ 0xF894, 0x0139, 0x1B67 },
|
||||
{ 0xF035, 0x0139, 0x1B15 },
|
||||
{ 0xF6F7, 0x0139, 0x1766 },
|
||||
};
|
||||
struct_8011F9B8 D_8011F9B8[] =
|
||||
{
|
||||
{ 93, 0xFFF0, 0x0E10, 0x0585, 0x0168, 0x8001, 8 },
|
||||
{ 99, 0xFFF0, 0xFF06, 0x0001, 0xF9D4, 0x4000, 6 },
|
||||
{ 99, 0xFFF1, 0x0000, 0x0000, 0x0000, 0x0000, 5 },
|
||||
{ 99, 0xFFF5, 0x0000, 0x0000, 0x0000, 0x0000, 7 },
|
||||
{ 81, 0xFFF3, 0xF46F, 0x0139, 0x1E14, 0x0000, 7 },
|
||||
{ 81, 0xFFF4, 0xF894, 0x0139, 0x1B67, 0x0000, 7 },
|
||||
{ 81, 0xFFF5, 0xF035, 0x0139, 0x1B15, 0x0000, 7 },
|
||||
{ 81, 0xFFF6, 0xF035, 0x0139, 0x1B15, 0x0000, 7 },
|
||||
struct_8011F9B8 D_8011F9B8[] = {
|
||||
{ 93, 0xFFF0, 0x0E10, 0x0585, 0x0168, 0x8001, 8 }, { 99, 0xFFF0, 0xFF06, 0x0001, 0xF9D4, 0x4000, 6 },
|
||||
{ 99, 0xFFF1, 0x0000, 0x0000, 0x0000, 0x0000, 5 }, { 99, 0xFFF5, 0x0000, 0x0000, 0x0000, 0x0000, 7 },
|
||||
{ 81, 0xFFF3, 0xF46F, 0x0139, 0x1E14, 0x0000, 7 }, { 81, 0xFFF4, 0xF894, 0x0139, 0x1B67, 0x0000, 7 },
|
||||
{ 81, 0xFFF5, 0xF035, 0x0139, 0x1B15, 0x0000, 7 }, { 81, 0xFFF6, 0xF035, 0x0139, 0x1B15, 0x0000, 7 },
|
||||
};
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_horse/func_8006D684.s")
|
||||
#endif
|
||||
|
||||
void func_8006DC68(GlobalContext* globalCtx, Player* player)
|
||||
{
|
||||
if (LINK_IS_ADULT)
|
||||
{
|
||||
if (!func_8006CFC0(gSaveContext.horse_data.scene))
|
||||
{
|
||||
void func_8006DC68(GlobalContext* globalCtx, Player* player) {
|
||||
if (LINK_IS_ADULT) {
|
||||
if (!func_8006CFC0(gSaveContext.horse_data.scene)) {
|
||||
osSyncPrintf(VT_COL(RED, WHITE));
|
||||
// Translates to: "Horse_Set_Check():%d SET SPOT IS NO GOOD."
|
||||
osSyncPrintf("Horse_Set_Check():%d セットスポットまずいです。\n", gSaveContext.horse_data.scene);
|
||||
@@ -332,35 +280,31 @@ void func_8006DC68(GlobalContext* globalCtx, Player* player)
|
||||
func_8006D074(globalCtx);
|
||||
}
|
||||
|
||||
if (func_8006CFC0(globalCtx->sceneNum))
|
||||
{
|
||||
if (func_8006CFC0(globalCtx->sceneNum)) {
|
||||
if ((gSaveContext.scene_setup_index > 3) ||
|
||||
((gSaveContext.entrance_index == 0x028A || gSaveContext.entrance_index == 0x028E ||
|
||||
gSaveContext.entrance_index == 0x0292 || gSaveContext.entrance_index == 0x0476) &&
|
||||
(gSaveContext.respawn_flag == 0)) ||
|
||||
((globalCtx->sceneNum == SCENE_SPOT20) && ((gSaveContext.event_inf[0] & 0xF) == 6) &&
|
||||
!Flags_GetEventChkInf(0x18) && (DREG(1) == 0)))
|
||||
{
|
||||
!Flags_GetEventChkInf(0x18) && (DREG(1) == 0))) {
|
||||
func_8006D684(globalCtx, player);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
func_8006D0EC(globalCtx, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_8006DD9C(Actor* actor, Vec3f* arg1, s16 arg2)
|
||||
{
|
||||
void func_8006DD9C(Actor* actor, Vec3f* arg1, s16 arg2) {
|
||||
s16 x = Math_Vec3f_Yaw(&actor->posRot.pos, arg1) - actor->posRot.rot.y;
|
||||
|
||||
if (x > arg2)
|
||||
if (x > arg2) {
|
||||
actor->posRot.rot.y += arg2;
|
||||
else if (x < -arg2)
|
||||
} else if (x < -arg2) {
|
||||
actor->posRot.rot.y -= arg2;
|
||||
else
|
||||
} else {
|
||||
actor->posRot.rot.y += x;
|
||||
}
|
||||
|
||||
actor->shape.rot.y = actor->posRot.rot.y;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user