mirror of https://github.com/zeldaret/mm.git
Another General Cleanup (#1651)
* add z64player.h include to z_player.c * NULL check in func_80AEE374 * Couple formating things * parameter R_PICTO_PHOTO_STATE * Remove COLPOLY_NORMAL_FRAC * DynaPolyActor_Init transformFlags * Float in ObjDriftice_Init * aspMainStack * Add gbi defines to m2ctx * Add GBI_DEFINES to COMMON_DEFINES in makefile instead of duplicating it * Add version to build include for m2ctx * Invadepoh includes * Sort calc_bss includes like makefile
This commit is contained in:
parent
1a003f9460
commit
803ff1fb15
6
Makefile
6
Makefile
|
@ -167,10 +167,10 @@ CFLAGS += -G 0 -non_shared -Xcpluscomm -nostdinc -Wab,-r4300_mul
|
|||
|
||||
WARNINGS := -fullwarn -verbose -woff 624,649,838,712,516,513,596,564,594
|
||||
ASFLAGS := -march=vr4300 -32 -G0
|
||||
COMMON_DEFINES := -D_MIPS_SZLONG=32
|
||||
GBI_DEFINES := -DF3DEX_GBI_2 -DF3DEX_GBI_PL -DGBI_DOWHILE
|
||||
AS_DEFINES := $(COMMON_DEFINES) $(GBI_DEFINES) -DMIPSEB -D_LANGUAGE_ASSEMBLY -D_ULTRA64
|
||||
C_DEFINES := $(COMMON_DEFINES) $(GBI_DEFINES) -DLANGUAGE_C -D_LANGUAGE_C
|
||||
COMMON_DEFINES := -D_MIPS_SZLONG=32 $(GBI_DEFINES)
|
||||
AS_DEFINES := $(COMMON_DEFINES) -DMIPSEB -D_LANGUAGE_ASSEMBLY -D_ULTRA64
|
||||
C_DEFINES := $(COMMON_DEFINES) -DLANGUAGE_C -D_LANGUAGE_C
|
||||
ENDIAN := -EB
|
||||
|
||||
OPTFLAGS := -O2 -g3
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include "z64.h"
|
||||
#include "segment_symbols.h"
|
||||
#include "stack.h"
|
||||
#include "macros.h"
|
||||
|
||||
// data
|
||||
|
@ -43,7 +44,7 @@ extern f32 gHeadsetPanVolume[];
|
|||
extern f32 gStereoPanVolume[];
|
||||
extern f32 gDefaultPanVolume[];
|
||||
extern s32 gAudioCtxInitalized;
|
||||
extern u8 D_801D6200[0x400];
|
||||
extern STACK(aspMainStack, 0x400);
|
||||
|
||||
extern u8 gAudioSpecId;
|
||||
extern u8 gAudioHeapResetState;
|
||||
|
|
|
@ -11,9 +11,8 @@ struct DynaPolyActor;
|
|||
|
||||
#define SS_NULL 0xFFFF
|
||||
|
||||
#define COLPOLY_NORMAL_FRAC (1.0f / SHRT_MAX)
|
||||
#define COLPOLY_SNORMAL(x) ((s16)((x) * SHRT_MAX))
|
||||
#define COLPOLY_GET_NORMAL(n) ((n)*COLPOLY_NORMAL_FRAC)
|
||||
#define COLPOLY_GET_NORMAL(n) ((n) * (1.0f / SHRT_MAX))
|
||||
#define COLPOLY_VIA_FLAG_TEST(vIA, flags) ((vIA) & (((flags)&7) << 13))
|
||||
#define COLPOLY_VTX_INDEX(vI) ((vI)&0x1FFF)
|
||||
|
||||
|
|
|
@ -174,7 +174,7 @@ AudioTask* AudioThread_UpdateImpl(void) {
|
|||
task->ucode = aspMainTextStart;
|
||||
task->ucode_data = aspMainDataStart;
|
||||
task->ucode_size = SP_UCODE_SIZE;
|
||||
task->dram_stack = (u64*)D_801D6200;
|
||||
task->dram_stack = aspMainStack;
|
||||
task->dram_stack_size = 0;
|
||||
task->output_buff = NULL;
|
||||
task->output_buff_size = NULL;
|
||||
|
|
|
@ -413,8 +413,8 @@ s32 CollisionPoly_LineVsPoly(BgLineVsPolyTest* a0) {
|
|||
dpA += a0->poly->normal.z * a0->posA->z;
|
||||
dpB += a0->poly->normal.z * a0->posB->z;
|
||||
|
||||
dpA *= COLPOLY_NORMAL_FRAC;
|
||||
dpB *= COLPOLY_NORMAL_FRAC;
|
||||
dpA = COLPOLY_GET_NORMAL(dpA);
|
||||
dpB = COLPOLY_GET_NORMAL(dpB);
|
||||
|
||||
planeDistA += dpA;
|
||||
planeDistB += dpB;
|
||||
|
|
|
@ -2368,7 +2368,7 @@ void Interface_UpdateButtonsPart1(PlayState* play) {
|
|||
if (!CHECK_EVENTINF(EVENTINF_41) ||
|
||||
(CHECK_EVENTINF(EVENTINF_41) && (CutsceneManager_GetCurrentCsId() == CS_ID_NONE))) {
|
||||
Audio_PlaySfx(NA_SE_SY_CAMERA_SHUTTER);
|
||||
SREG(89) = 1;
|
||||
R_PICTO_PHOTO_STATE = PICTO_PHOTO_STATE_SETUP;
|
||||
play->haltAllActors = true;
|
||||
sPictoState = PICTO_BOX_STATE_SETUP_PHOTO;
|
||||
sPictoPhotoBeingTaken = true;
|
||||
|
|
|
@ -29,9 +29,9 @@
|
|||
* system is mainly used to manage their blinking.
|
||||
*/
|
||||
|
||||
#include "prevent_bss_reordering.h"
|
||||
#include "sys_cfb.h"
|
||||
#include "z_en_invadepoh.h"
|
||||
|
||||
#include "sys_cfb.h"
|
||||
#include "z64horse.h"
|
||||
#include "assets/objects/gameplay_keep/gameplay_keep.h"
|
||||
#include "overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h"
|
||||
|
|
|
@ -14,8 +14,9 @@
|
|||
* 4. The UFO (which appears as a spinning ball of light)
|
||||
* 5. A cow tail
|
||||
*/
|
||||
#include "prevent_bss_reordering.h"
|
||||
|
||||
#include "z_en_invadepoh_demo.h"
|
||||
|
||||
#include "sys_cfb.h"
|
||||
|
||||
#define FLAGS (ACTOR_FLAG_10)
|
||||
|
|
|
@ -16,7 +16,7 @@ typedef struct EnTest5 {
|
|||
/* 0x144 */ Vec3f minPos;
|
||||
/* 0x150 */ f32 xLength;
|
||||
/* 0x154 */ f32 zLength;
|
||||
/* 0x158 */ EnTest5ActionFunc actionFunc;
|
||||
/* 0x158 */ EnTest5ActionFunc actionFunc;
|
||||
} EnTest5; // size = 0x15C
|
||||
|
||||
#endif // Z_EN_TEST5_H
|
||||
|
|
|
@ -964,7 +964,7 @@ void func_80AEE374(EnTk* this, PlayState* play) {
|
|||
sp30.unk_04 = FLT_MAX;
|
||||
|
||||
SubS_FindActorCustom(play, &this->actor, NULL, ACTORCAT_NPC, ACTOR_EN_TK, &sp30, func_80AEE300);
|
||||
if (sp30.unk_00 == 0) {
|
||||
if (sp30.unk_00 == NULL) {
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -86,7 +86,7 @@ void EnWarptag_Destroy(Actor* thisx, PlayState* play) {
|
|||
void EnWarpTag_CheckDungeonKeepObject(EnWarptag* this, PlayState* play) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->dangeonKeepObjectSlot)) {
|
||||
this->actionFunc = EnWarpTag_WaitForPlayer;
|
||||
DynaPolyActor_Init(&this->dyna, 0x1);
|
||||
DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS);
|
||||
DynaPolyActor_LoadMesh(play, &this->dyna, &gWarpTagGoronTrialBaseCol);
|
||||
this->dyna.actor.objectSlot = this->dangeonKeepObjectSlot;
|
||||
this->dyna.actor.draw = EnWarpTag_Draw;
|
||||
|
|
|
@ -268,7 +268,7 @@ void ObjDriftice_Init(Actor* thisx, PlayState* play) {
|
|||
ObjDriftice* this = THIS;
|
||||
f32* sp2C = D_80A67620[OBJDRIFTICE_GET_3(&this->dyna.actor)];
|
||||
Path* path;
|
||||
s32 phi_a1;
|
||||
s32 transformFlags;
|
||||
s32 sp20;
|
||||
|
||||
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
|
||||
|
@ -289,18 +289,18 @@ void ObjDriftice_Init(Actor* thisx, PlayState* play) {
|
|||
sp20 = 1;
|
||||
}
|
||||
|
||||
this->unk_244 = thisx->home.rot.z * 45.511112f;
|
||||
this->unk_244 = thisx->home.rot.z * (0x8000 / 720.0f);
|
||||
|
||||
phi_a1 = 0;
|
||||
transformFlags = 0;
|
||||
if (sp20 == 0) {
|
||||
phi_a1 = 1;
|
||||
transformFlags = DYNA_TRANSFORM_POS;
|
||||
}
|
||||
|
||||
if (thisx->home.rot.z != 0) {
|
||||
phi_a1 |= 3;
|
||||
transformFlags |= DYNA_TRANSFORM_ROT_Y | DYNA_TRANSFORM_POS;
|
||||
}
|
||||
|
||||
DynaPolyActor_Init(&this->dyna, phi_a1);
|
||||
DynaPolyActor_Init(&this->dyna, transformFlags);
|
||||
DynaPolyActor_LoadMesh(play, &this->dyna, &object_driftice_Colheader_001AA8);
|
||||
|
||||
if (sp20 != 0) {
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
* Description: Player
|
||||
*/
|
||||
|
||||
#include "z64player.h"
|
||||
|
||||
#include "global.h"
|
||||
#include "z64horse.h"
|
||||
#include "z64lifemeter.h"
|
||||
|
|
|
@ -35,7 +35,7 @@ echo "char measurement;" >> $TEMPC
|
|||
$(pwd)/tools/ido_recomp/linux/7.1/cc -G 0 -non_shared \
|
||||
-Xfullwarn -Xcpluscomm -O2 -g3 -Xcpluscomm -mips2 \
|
||||
-D_LANGUAGE_C -DF3DEX_GBI_2 -DF3DEX_GBI_PL -DGBI_DOWHILE \
|
||||
-I $(pwd)/ -I $(pwd)/include/ -I $(pwd)/include/libc/ -I $(pwd)/src/ -I $(pwd)/assets/ -I $(pwd)/build/n64-us/ \
|
||||
-I $(pwd)/include/ -I $(pwd)/include/libc/ -I $(pwd)/src/ -I $(pwd)/assets/ -I $(pwd)/build/n64-us/ -I $(pwd)/\
|
||||
-Wab,-r4300_mul -woff 624,649,838,712 -c $TEMPC -o $TEMPO
|
||||
|
||||
LINE=$(${CROSS}objdump -t $TEMPO | grep measurement | cut -d' ' -f1)
|
||||
|
|
|
@ -2164,7 +2164,7 @@
|
|||
0x801D6190:("D_801D6190","f32","",0x4),
|
||||
0x801D6194:("D_801D6194","UNK_TYPE4","",0x4),
|
||||
0x801D61A0:("sSeqInstructionArgsTable","u8","[96]",0x60),
|
||||
0x801D6200:("D_801D6200","UNK_TYPE1","",0x1),
|
||||
0x801D6200:("aspMainStack","UNK_TYPE1","",0x1),
|
||||
0x801D6600:("gIsLargeSfxBank","UNK_TYPE1","",0x1),
|
||||
0x801D6608:("D_801D6608","UNK_TYPE1","",0x1),
|
||||
0x801D6610:("gChannelsPerBank","UNK_TYPE1","",0x1),
|
||||
|
|
|
@ -17,9 +17,12 @@ CPP_FLAGS = [
|
|||
"-Iinclude/libc",
|
||||
"-Isrc",
|
||||
"-Iassets",
|
||||
"-Ibuild",
|
||||
"-Ibuild/n64-us",
|
||||
"-I.",
|
||||
|
||||
"-DF3DEX_GBI_2",
|
||||
"-DF3DEX_GBI_PL",
|
||||
"-DGBI_DOWHILE",
|
||||
"-D__sgi",
|
||||
"-D_LANGUAGE_C",
|
||||
"-DNON_MATCHING",
|
||||
|
|
Loading…
Reference in New Issue