mirror of
https://github.com/zeldaret/mm.git
synced 2024-11-26 22:30:58 +00:00
Misc Clean (#1680)
* vramu32 in Overlay_Relocate * Actor_SetColorFilter args * Effect Hitmark enum * Actor_WorldToActorCoords * Some fault clean up * contoller.h * macros.h no longer needs stdint.h
This commit is contained in:
parent
2e2b2e2c7a
commit
6eaf196927
@ -56,24 +56,6 @@ typedef struct {
|
||||
#define B_BUTTON 0x4000
|
||||
#define A_BUTTON 0x8000
|
||||
|
||||
/* Not original to libultra: button macros */
|
||||
/* Buttons */
|
||||
#define BTN_CRIGHT R_CBUTTONS
|
||||
#define BTN_CLEFT L_CBUTTONS
|
||||
#define BTN_CDOWN D_CBUTTONS
|
||||
#define BTN_CUP U_CBUTTONS
|
||||
#define BTN_R R_TRIG
|
||||
#define BTN_L L_TRIG
|
||||
#define BTN_RESET 0x0080 /* "neutral reset": Corresponds to holding L+R and pressing S */
|
||||
#define BTN_DRIGHT R_JPAD
|
||||
#define BTN_DLEFT L_JPAD
|
||||
#define BTN_DDOWN D_JPAD
|
||||
#define BTN_DUP U_JPAD
|
||||
#define BTN_START START_BUTTON
|
||||
#define BTN_Z Z_TRIG
|
||||
#define BTN_B B_BUTTON
|
||||
#define BTN_A A_BUTTON
|
||||
|
||||
#define CONT_ERR_NO_CONTROLLER PFS_ERR_NOPACK /* 1 */
|
||||
#define CONT_ERR_CONTRFAIL CONT_OVERRUN_ERROR /* 4 */
|
||||
#define CONT_ERR_INVALID PFS_ERR_INVALID /* 5 */
|
||||
|
25
include/controller.h
Normal file
25
include/controller.h
Normal file
@ -0,0 +1,25 @@
|
||||
#ifndef CONTROLLER_H
|
||||
#define CONTROLLER_H
|
||||
|
||||
#include "PR/os_cont.h"
|
||||
|
||||
#define BTN_A A_BUTTON
|
||||
#define BTN_B B_BUTTON
|
||||
#define BTN_Z Z_TRIG
|
||||
#define BTN_START START_BUTTON
|
||||
#define BTN_DUP U_JPAD
|
||||
#define BTN_DDOWN D_JPAD
|
||||
#define BTN_DLEFT L_JPAD
|
||||
#define BTN_DRIGHT R_JPAD
|
||||
#define BTN_RESET 0x0080 /* "neutral reset": Corresponds to holding L+R and pressing S */
|
||||
#define BTN_L L_TRIG
|
||||
#define BTN_R R_TRIG
|
||||
#define BTN_CUP U_CBUTTONS
|
||||
#define BTN_CDOWN D_CBUTTONS
|
||||
#define BTN_CLEFT L_CBUTTONS
|
||||
#define BTN_CRIGHT R_CBUTTONS
|
||||
|
||||
#define CHECK_BTN_ALL(state, combo) (~((state) | ~(combo)) == 0)
|
||||
#define CHECK_BTN_ANY(state, combo) (((state) & (combo)) != 0)
|
||||
|
||||
#endif
|
@ -73,7 +73,7 @@ f32 Actor_WorldDistXYZToActor(Actor* actorA, Actor* actorB);
|
||||
f32 Actor_WorldDistXYZToPoint(Actor* actor, Vec3f* refPoint);
|
||||
f32 Actor_WorldDistXZToActor(Actor* actorA, Actor* actorB);
|
||||
f32 Actor_WorldDistXZToPoint(Actor* actor, Vec3f* refPoint);
|
||||
void Actor_OffsetOfPointInActorCoords(Actor* actor, Vec3f* offset, Vec3f* point);
|
||||
void Actor_WorldToActorCoords(Actor* actor, Vec3f* offset, Vec3f* point);
|
||||
f32 Actor_HeightDiff(Actor* actor1, Actor* actor2);
|
||||
void Actor_SetControlStickData(PlayState* play, Input* input, f32 controlStickMagnitude, s16 controlStickAngle);
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef MACROS_H
|
||||
#define MACROS_H
|
||||
|
||||
#include "stdint.h"
|
||||
#include "PR/ultratypes.h"
|
||||
|
||||
#define SCREEN_WIDTH 320
|
||||
#define SCREEN_HEIGHT 240
|
||||
@ -41,9 +41,6 @@
|
||||
// To be used with `Magic_Add`, but ensures enough magic is added to fill the magic bar to capacity
|
||||
#define MAGIC_FILL_TO_CAPACITY (((void)0, gSaveContext.magicFillTarget) + (gSaveContext.save.saveInfo.playerData.isDoubleMagicAcquired + 1) * MAGIC_NORMAL_METER)
|
||||
|
||||
#define CHECK_BTN_ALL(state, combo) (~((state) | ~(combo)) == 0)
|
||||
#define CHECK_BTN_ANY(state, combo) (((state) & (combo)) != 0)
|
||||
|
||||
#define CHECK_FLAG_ALL(flags, mask) (((flags) & (mask)) == (mask))
|
||||
|
||||
#define BIT_FLAG_TO_SHIFT(flag) \
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "libc64/qrand.h"
|
||||
|
||||
#include "color.h"
|
||||
#include "controller.h"
|
||||
#include "gfx.h"
|
||||
#include "gfxprint.h"
|
||||
#include "ichain.h"
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include "libc64/malloc.h"
|
||||
#include "loadfragment.h"
|
||||
|
||||
s32 gLoadLogSeverity = 2;
|
||||
s32 gFragmentLogSeverity = 2;
|
||||
|
||||
// Extract MIPS register rs from an instruction word
|
||||
#define MIPS_REG_RS(insn) (((insn) >> 0x15) & 0x1F)
|
||||
@ -52,7 +52,7 @@ void Fragment_Relocate(void* allocatedRamAddr, OverlayRelocationSection* ovlRelo
|
||||
uintptr_t relocatedAddress;
|
||||
u32 i;
|
||||
u32* luiInstRef;
|
||||
uintptr_t allocu32 = (uintptr_t)allocatedRamAddr;
|
||||
u32 isLoNeg;
|
||||
u32* regValP;
|
||||
//! MIPS ELF relocation does not generally require tracking register values, so at first glance it appears this
|
||||
//! register tracking was an unnecessary complication. However there is a bug in the IDO compiler that can cause
|
||||
@ -62,9 +62,10 @@ void Fragment_Relocate(void* allocatedRamAddr, OverlayRelocationSection* ovlRelo
|
||||
//! due to the incorrect ordering.
|
||||
u32* luiRefs[32];
|
||||
u32 luiVals[32];
|
||||
u32 isLoNeg;
|
||||
uintptr_t allocu32 = (uintptr_t)allocatedRamAddr;
|
||||
uintptr_t vramu32 = (uintptr_t)vramStart;
|
||||
|
||||
if (gLoadLogSeverity >= 3) {
|
||||
if (gFragmentLogSeverity >= 3) {
|
||||
// "DoRelocation(%08x, %08x, %08x)\n"
|
||||
}
|
||||
|
||||
@ -88,8 +89,8 @@ void Fragment_Relocate(void* allocatedRamAddr, OverlayRelocationSection* ovlRelo
|
||||
|
||||
// Check address is valid for relocation
|
||||
if ((*relocDataP & 0x0F000000) == 0) {
|
||||
*relocDataP = *relocDataP - (uintptr_t)vramStart + allocu32;
|
||||
} else if (gLoadLogSeverity >= 3) {
|
||||
*relocDataP = *relocDataP - vramu32 + allocu32;
|
||||
} else if (gFragmentLogSeverity >= 3) {
|
||||
// Segment pointer 32 %08x
|
||||
// "セグメントポインタ32です %08x\n"
|
||||
}
|
||||
@ -103,9 +104,8 @@ void Fragment_Relocate(void* allocatedRamAddr, OverlayRelocationSection* ovlRelo
|
||||
if (1) {
|
||||
*relocDataP =
|
||||
(*relocDataP & 0xFC000000) |
|
||||
(((PHYS_TO_K0(MIPS_JUMP_TARGET(*relocDataP)) - (uintptr_t)vramStart + allocu32) & 0x0FFFFFFF) >>
|
||||
2);
|
||||
} else if (gLoadLogSeverity >= 3) {
|
||||
(((PHYS_TO_K0(MIPS_JUMP_TARGET(*relocDataP)) - vramu32 + allocu32) & 0x0FFFFFFF) >> 2);
|
||||
} else if (gFragmentLogSeverity >= 3) {
|
||||
// Segment pointer 26 %08x
|
||||
// "セグメントポインタ26です %08x\n"
|
||||
}
|
||||
@ -132,11 +132,11 @@ void Fragment_Relocate(void* allocatedRamAddr, OverlayRelocationSection* ovlRelo
|
||||
|
||||
// Check address is valid for relocation
|
||||
if ((((*luiInstRef << 0x10) + (s16)*relocDataP) & 0x0F000000) == 0) {
|
||||
relocatedAddress = ((*regValP << 0x10) + (s16)*relocDataP) - (uintptr_t)vramStart + allocu32;
|
||||
relocatedAddress = ((*regValP << 0x10) + (s16)*relocDataP) - vramu32 + allocu32;
|
||||
isLoNeg = (relocatedAddress & 0x8000) ? 1 : 0;
|
||||
*luiInstRef = (*luiInstRef & 0xFFFF0000) | (((relocatedAddress >> 0x10) & 0xFFFF) + isLoNeg);
|
||||
*relocDataP = (*relocDataP & 0xFFFF0000) | (relocatedAddress & 0xFFFF);
|
||||
} else if (gLoadLogSeverity >= 3) {
|
||||
} else if (gFragmentLogSeverity >= 3) {
|
||||
// Segment pointer 16 %08x %08x %08x
|
||||
// "セグメントポインタ16です %08x %08x %08x"
|
||||
}
|
||||
@ -152,11 +152,11 @@ size_t Fragment_Load(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, vo
|
||||
s32 pad;
|
||||
OverlayRelocationSection* ovlRelocs;
|
||||
|
||||
if (gLoadLogSeverity >= 3) {
|
||||
if (gFragmentLogSeverity >= 3) {
|
||||
// Starting loading dynamic link function
|
||||
// "\nダイナミックリンクファンクションのロードを開始します\n"
|
||||
}
|
||||
if (gLoadLogSeverity >= 3) {
|
||||
if (gFragmentLogSeverity >= 3) {
|
||||
// DMA transfer TEXT, DATA, RODATA+rel (%08x-%08x)
|
||||
// "TEXT,DATA,RODATA+relをDMA転送します(%08x-%08x)\n"
|
||||
}
|
||||
@ -166,12 +166,12 @@ size_t Fragment_Load(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, vo
|
||||
|
||||
ovlRelocs = (OverlayRelocationSection*)(end - ((s32*)end)[-1]);
|
||||
|
||||
if (gLoadLogSeverity >= 3) {
|
||||
if (gFragmentLogSeverity >= 3) {
|
||||
// "TEXT(%08x), DATA(%08x), RODATA(%08x), BSS(%08x)\n"
|
||||
}
|
||||
|
||||
if (allocatedBytes < ovlRelocs->bssSize + size) {
|
||||
if (gLoadLogSeverity >= 3) {
|
||||
if (gFragmentLogSeverity >= 3) {
|
||||
// ramSize is too small (ramSize=%08x, NeedRamSize=%08x)
|
||||
// "ramSizeが小さすぎます(ramSize=%08x, NeedRamSize=%08x)\n"
|
||||
}
|
||||
@ -180,7 +180,7 @@ size_t Fragment_Load(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, vo
|
||||
|
||||
allocatedBytes = ovlRelocs->bssSize + size;
|
||||
|
||||
if (gLoadLogSeverity >= 3) {
|
||||
if (gFragmentLogSeverity >= 3) {
|
||||
// I will relocate
|
||||
// "リロケーションします\n"
|
||||
}
|
||||
@ -188,7 +188,7 @@ size_t Fragment_Load(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, vo
|
||||
Fragment_Relocate(allocatedRamAddr, ovlRelocs, vramStart);
|
||||
|
||||
if (ovlRelocs->bssSize != 0) {
|
||||
if (gLoadLogSeverity >= 3) {
|
||||
if (gFragmentLogSeverity >= 3) {
|
||||
// Clear BSS area (%08x-%08x)
|
||||
// "BSS領域をクリアします(%08x-%08x)\n"
|
||||
}
|
||||
@ -198,7 +198,7 @@ size_t Fragment_Load(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, vo
|
||||
osWritebackDCache(allocatedRamAddr, allocatedBytes);
|
||||
osInvalICache(allocatedRamAddr, allocatedBytes);
|
||||
|
||||
if (gLoadLogSeverity >= 3) {
|
||||
if (gFragmentLogSeverity >= 3) {
|
||||
// Finish loading the dynamic link function
|
||||
// "ダイナミックリンクファンクションのロードを終了します\n\n"
|
||||
}
|
||||
@ -214,7 +214,7 @@ void* Fragment_AllocateAndLoad(uintptr_t vromStart, uintptr_t vromEnd, void* vra
|
||||
OverlayRelocationSection* ovlRelocs;
|
||||
size_t allocatedBytes;
|
||||
|
||||
if (gLoadLogSeverity >= 3) {
|
||||
if (gFragmentLogSeverity >= 3) {
|
||||
// Start loading dynamic link function
|
||||
// "\nダイナミックリンクファンクションのロードを開始します\n"
|
||||
|
||||
@ -224,14 +224,14 @@ void* Fragment_AllocateAndLoad(uintptr_t vromStart, uintptr_t vromEnd, void* vra
|
||||
allocatedRamAddr = malloc_r(size);
|
||||
end = (uintptr_t)allocatedRamAddr + size;
|
||||
|
||||
if (gLoadLogSeverity >= 3) {
|
||||
if (gFragmentLogSeverity >= 3) {
|
||||
// DMA transfer TEXT, DATA, RODATA+rel (%08x-%08x)
|
||||
// "TEXT,DATA,RODATA+relをDMA転送します(%08x-%08x)\n"
|
||||
}
|
||||
|
||||
DmaMgr_RequestSync(allocatedRamAddr, vromStart, size);
|
||||
|
||||
if (gLoadLogSeverity >= 3) {
|
||||
if (gFragmentLogSeverity >= 3) {
|
||||
// "TEXT(%08x), DATA(%08x), RODATA(%08x), BSS(%08x)\n"
|
||||
}
|
||||
|
||||
@ -245,13 +245,13 @@ void* Fragment_AllocateAndLoad(uintptr_t vromStart, uintptr_t vromEnd, void* vra
|
||||
|
||||
allocatedRamAddr = realloc(allocatedRamAddr, allocatedBytes);
|
||||
|
||||
if (gLoadLogSeverity >= 3) {
|
||||
if (gFragmentLogSeverity >= 3) {
|
||||
// No reallocation.
|
||||
// "リアロケーションしません。\n"
|
||||
}
|
||||
|
||||
if (allocatedRamAddr == NULL) {
|
||||
if (gLoadLogSeverity >= 3) {
|
||||
if (gFragmentLogSeverity >= 3) {
|
||||
// Reallocation failed. .
|
||||
// "リアロケーションに失敗しました。"
|
||||
}
|
||||
@ -261,7 +261,7 @@ void* Fragment_AllocateAndLoad(uintptr_t vromStart, uintptr_t vromEnd, void* vra
|
||||
end = (uintptr_t)allocatedRamAddr + size;
|
||||
ovlRelocs = (OverlayRelocationSection*)(end - *(uintptr_t*)ovlOffset);
|
||||
|
||||
if (gLoadLogSeverity >= 3) {
|
||||
if (gFragmentLogSeverity >= 3) {
|
||||
// I will relocate
|
||||
// "リロケーションします\n"
|
||||
}
|
||||
@ -269,7 +269,7 @@ void* Fragment_AllocateAndLoad(uintptr_t vromStart, uintptr_t vromEnd, void* vra
|
||||
Fragment_Relocate(allocatedRamAddr, ovlRelocs, vramStart);
|
||||
|
||||
if (ovlRelocs->bssSize != 0) {
|
||||
if (gLoadLogSeverity >= 3) {
|
||||
if (gFragmentLogSeverity >= 3) {
|
||||
// Clear BSS area (%08x-%08x)
|
||||
// "BSS領域をクリアします(%08x-%08x)\n"
|
||||
}
|
||||
@ -278,7 +278,7 @@ void* Fragment_AllocateAndLoad(uintptr_t vromStart, uintptr_t vromEnd, void* vra
|
||||
|
||||
osInvalICache(allocatedRamAddr, allocatedBytes);
|
||||
|
||||
if (gLoadLogSeverity >= 3) {
|
||||
if (gFragmentLogSeverity >= 3) {
|
||||
// Finish loading the dynamic link function
|
||||
// "ダイナミックリンクファンクションのロードを終了します\n\n"
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ void Overlay_Relocate(void* allocatedRamAddr, OverlayRelocationSection* ovlReloc
|
||||
uintptr_t relocatedAddress;
|
||||
u32 i;
|
||||
u32* luiInstRef;
|
||||
uintptr_t allocu32 = (uintptr_t)allocatedRamAddr;
|
||||
u32 isLoNeg;
|
||||
u32* regValP;
|
||||
//! MIPS ELF relocation does not generally require tracking register values, so at first glance it appears this
|
||||
//! register tracking was an unnecessary complication. However there is a bug in the IDO compiler that can cause
|
||||
@ -58,7 +58,8 @@ void Overlay_Relocate(void* allocatedRamAddr, OverlayRelocationSection* ovlReloc
|
||||
//! due to the incorrect ordering.
|
||||
u32* luiRefs[32];
|
||||
u32 luiVals[32];
|
||||
u32 isLoNeg;
|
||||
uintptr_t allocu32 = (uintptr_t)allocatedRamAddr;
|
||||
uintptr_t vramu32 = (uintptr_t)vramStart;
|
||||
|
||||
if (gOverlayLogSeverity >= 3) {
|
||||
// "DoRelocation(%08x, %08x, %08x)\n"
|
||||
@ -84,7 +85,7 @@ void Overlay_Relocate(void* allocatedRamAddr, OverlayRelocationSection* ovlReloc
|
||||
|
||||
// Check address is valid for relocation
|
||||
if ((*relocDataP & 0x0F000000) == 0) {
|
||||
*relocDataP = *relocDataP - (uintptr_t)vramStart + allocu32;
|
||||
*relocDataP = *relocDataP - vramu32 + allocu32;
|
||||
} else if (gOverlayLogSeverity >= 3) {
|
||||
// Segment pointer 32 %08x
|
||||
// "セグメントポインタ32です %08x\n"
|
||||
@ -99,8 +100,7 @@ void Overlay_Relocate(void* allocatedRamAddr, OverlayRelocationSection* ovlReloc
|
||||
if (1) {
|
||||
*relocDataP =
|
||||
(*relocDataP & 0xFC000000) |
|
||||
(((PHYS_TO_K0(MIPS_JUMP_TARGET(*relocDataP)) - (uintptr_t)vramStart + allocu32) & 0x0FFFFFFF) >>
|
||||
2);
|
||||
(((PHYS_TO_K0(MIPS_JUMP_TARGET(*relocDataP)) - vramu32 + allocu32) & 0x0FFFFFFF) >> 2);
|
||||
} else if (gOverlayLogSeverity >= 3) {
|
||||
// Segment pointer 26 %08x
|
||||
// "セグメントポインタ26です %08x\n"
|
||||
@ -128,7 +128,7 @@ void Overlay_Relocate(void* allocatedRamAddr, OverlayRelocationSection* ovlReloc
|
||||
|
||||
// Check address is valid for relocation
|
||||
if ((((*luiInstRef << 0x10) + (s16)*relocDataP) & 0x0F000000) == 0) {
|
||||
relocatedAddress = ((*regValP << 0x10) + (s16)*relocDataP) - (uintptr_t)vramStart + allocu32;
|
||||
relocatedAddress = ((*regValP << 0x10) + (s16)*relocDataP) - vramu32 + allocu32;
|
||||
isLoNeg = (relocatedAddress & 0x8000) ? 1 : 0;
|
||||
*luiInstRef = (*luiInstRef & 0xFFFF0000) | (((relocatedAddress >> 0x10) & 0xFFFF) + isLoNeg);
|
||||
*relocDataP = (*relocDataP & 0xFFFF0000) | (relocatedAddress & 0xFFFF);
|
||||
|
@ -46,6 +46,7 @@
|
||||
#include "libc64/sprintf.h"
|
||||
#include "PR/osint.h"
|
||||
|
||||
#include "controller.h"
|
||||
#include "macros.h"
|
||||
#include "main.h"
|
||||
#include "vt.h"
|
||||
@ -55,7 +56,6 @@
|
||||
FaultMgr* sFaultInstance;
|
||||
f32 sFaultTimeTotal; // read but not set anywhere
|
||||
|
||||
// data
|
||||
const char* sCpuExceptions[] = {
|
||||
"Interrupt",
|
||||
"TLB modification",
|
||||
@ -348,9 +348,9 @@ void Fault_DrawCornerRec(u16 color) {
|
||||
|
||||
void Fault_PrintFReg(s32 index, f32* value) {
|
||||
u32 raw = *(u32*)value;
|
||||
s32 exp = ((raw & 0x7F800000) >> 0x17) - 0x7F;
|
||||
s32 exp = ((raw & 0x7F800000) >> 23) - 127;
|
||||
|
||||
if (((exp > -0x7F) && (exp <= 0x7F)) || (raw == 0)) {
|
||||
if (((exp > -127) && (exp <= 127)) || (raw == 0)) {
|
||||
FaultDrawer_Printf("F%02d:%14.7e ", index, *value);
|
||||
} else {
|
||||
// Print subnormal floats as their IEEE-754 hex representation
|
||||
@ -360,9 +360,9 @@ void Fault_PrintFReg(s32 index, f32* value) {
|
||||
|
||||
void Fault_LogFReg(s32 index, f32* value) {
|
||||
u32 raw = *(u32*)value;
|
||||
s32 exp = ((raw & 0x7F800000) >> 0x17) - 0x7F;
|
||||
s32 exp = ((raw & 0x7F800000) >> 23) - 127;
|
||||
|
||||
if (((exp > -0x7F) && (exp <= 0x7F)) || (raw == 0)) {
|
||||
if (((exp > -127) && (exp <= 127)) || (raw == 0)) {
|
||||
osSyncPrintf("F%02d:%14.7e ", index, *value);
|
||||
} else {
|
||||
osSyncPrintf("F%02d: %08x(16) ", index, *(u32*)value);
|
||||
@ -444,22 +444,22 @@ void Fault_PrintThreadContext(OSThread* thread) {
|
||||
Fault_PrintFReg(6, &threadCtx->fp6.f.f_even);
|
||||
FaultDrawer_Printf("\n");
|
||||
Fault_PrintFReg(8, &threadCtx->fp8.f.f_even);
|
||||
Fault_PrintFReg(0xA, &threadCtx->fp10.f.f_even);
|
||||
Fault_PrintFReg(10, &threadCtx->fp10.f.f_even);
|
||||
FaultDrawer_Printf("\n");
|
||||
Fault_PrintFReg(0xC, &threadCtx->fp12.f.f_even);
|
||||
Fault_PrintFReg(0xE, &threadCtx->fp14.f.f_even);
|
||||
Fault_PrintFReg(12, &threadCtx->fp12.f.f_even);
|
||||
Fault_PrintFReg(14, &threadCtx->fp14.f.f_even);
|
||||
FaultDrawer_Printf("\n");
|
||||
Fault_PrintFReg(0x10, &threadCtx->fp16.f.f_even);
|
||||
Fault_PrintFReg(0x12, &threadCtx->fp18.f.f_even);
|
||||
Fault_PrintFReg(16, &threadCtx->fp16.f.f_even);
|
||||
Fault_PrintFReg(18, &threadCtx->fp18.f.f_even);
|
||||
FaultDrawer_Printf("\n");
|
||||
Fault_PrintFReg(0x14, &threadCtx->fp20.f.f_even);
|
||||
Fault_PrintFReg(0x16, &threadCtx->fp22.f.f_even);
|
||||
Fault_PrintFReg(20, &threadCtx->fp20.f.f_even);
|
||||
Fault_PrintFReg(22, &threadCtx->fp22.f.f_even);
|
||||
FaultDrawer_Printf("\n");
|
||||
Fault_PrintFReg(0x18, &threadCtx->fp24.f.f_even);
|
||||
Fault_PrintFReg(0x1A, &threadCtx->fp26.f.f_even);
|
||||
Fault_PrintFReg(24, &threadCtx->fp24.f.f_even);
|
||||
Fault_PrintFReg(26, &threadCtx->fp26.f.f_even);
|
||||
FaultDrawer_Printf("\n");
|
||||
Fault_PrintFReg(0x1C, &threadCtx->fp28.f.f_even);
|
||||
Fault_PrintFReg(0x1E, &threadCtx->fp30.f.f_even);
|
||||
Fault_PrintFReg(28, &threadCtx->fp28.f.f_even);
|
||||
Fault_PrintFReg(30, &threadCtx->fp30.f.f_even);
|
||||
FaultDrawer_Printf("\n");
|
||||
FaultDrawer_SetCharPad(0, 0);
|
||||
|
||||
@ -1047,7 +1047,7 @@ void Fault_ThreadEntry(void* arg) {
|
||||
Fault_ProcessClients();
|
||||
|
||||
// Memory dump page
|
||||
Fault_DrawMemDump((u32)(faultedThread->context.pc - 0x100), (u32)faultedThread->context.sp, 0, 0);
|
||||
Fault_DrawMemDump(faultedThread->context.pc - 0x100, faultedThread->context.sp, 0, 0);
|
||||
Fault_DrawStackTrace(faultedThread, 1);
|
||||
Fault_LogStackTrace(faultedThread, 1);
|
||||
Fault_WaitForInput();
|
||||
|
@ -36,6 +36,7 @@
|
||||
#include "libc64/sprintf.h"
|
||||
#include "PR/os_motor.h"
|
||||
|
||||
#include "controller.h"
|
||||
#include "fault.h"
|
||||
#include "macros.h"
|
||||
#include "scheduler.h"
|
||||
|
@ -1295,7 +1295,7 @@ f32 Actor_WorldDistXZToPoint(Actor* actor, Vec3f* refPoint) {
|
||||
* @param[out] offset The transformed coordinates.
|
||||
* @param[in] point The point to transform to actor coordinates.
|
||||
*/
|
||||
void Actor_OffsetOfPointInActorCoords(Actor* actor, Vec3f* offset, Vec3f* point) {
|
||||
void Actor_WorldToActorCoords(Actor* actor, Vec3f* offset, Vec3f* point) {
|
||||
f32 cos = Math_CosS(actor->shape.rot.y);
|
||||
f32 sin = Math_SinS(actor->shape.rot.y);
|
||||
f32 diffX;
|
||||
|
@ -183,7 +183,7 @@ void func_800F0BB4(EnHy* enHy, PlayState* play, EnDoor* door, s16 arg3, s16 arg4
|
||||
Vec3f offset;
|
||||
f32 phi_f0;
|
||||
|
||||
Actor_OffsetOfPointInActorCoords(&door->knobDoor.dyna.actor, &offset, &enHy->actor.world.pos);
|
||||
Actor_WorldToActorCoords(&door->knobDoor.dyna.actor, &offset, &enHy->actor.world.pos);
|
||||
phi_f0 = (offset.z >= 0.0f) ? 1.0f : -1.0f;
|
||||
animIndex = ((s8)phi_f0 < 0) ? 0 : 2;
|
||||
EnHy_ChangeObjectAndAnim(enHy, play, (animIndex == 0) ? arg3 : arg4);
|
||||
|
@ -20,9 +20,10 @@
|
||||
*/
|
||||
|
||||
#include "z64frameadvance.h"
|
||||
#include "stdbool.h"
|
||||
|
||||
#include "controller.h"
|
||||
#include "padutils.h"
|
||||
#include "macros.h"
|
||||
#include "stdbool.h"
|
||||
|
||||
void FrameAdvance_Init(FrameAdvanceContext* frameAdvCtx) {
|
||||
frameAdvCtx->timer = 0;
|
||||
|
@ -1148,12 +1148,12 @@ s32 SubS_MoveActorToPoint(Actor* actor, Vec3f* point, s16 rotStep) {
|
||||
f32 distSqBefore;
|
||||
f32 distSqAfter;
|
||||
|
||||
Actor_OffsetOfPointInActorCoords(actor, &offsetBefore, point);
|
||||
Actor_WorldToActorCoords(actor, &offsetBefore, point);
|
||||
Math_SmoothStepToS(&actor->world.rot.y, SubS_GetDistSqAndOrientPoints(point, &actor->world.pos, &distSqBefore), 4,
|
||||
rotStep, 1);
|
||||
actor->shape.rot.y = actor->world.rot.y;
|
||||
Actor_MoveWithGravity(actor);
|
||||
Actor_OffsetOfPointInActorCoords(actor, &offsetAfter, point);
|
||||
Actor_WorldToActorCoords(actor, &offsetAfter, point);
|
||||
SubS_GetDistSqAndOrientPoints(point, &actor->world.pos, &distSqAfter);
|
||||
return ((offsetBefore.z > 0.0f) && (offsetAfter.z <= 0.0f)) ? true : false;
|
||||
}
|
||||
|
@ -3,6 +3,7 @@
|
||||
#include "stdbool.h"
|
||||
#include "PR/viint.h"
|
||||
|
||||
#include "controller.h"
|
||||
#include "debug.h"
|
||||
#include "macros.h"
|
||||
#include "main.h"
|
||||
|
@ -61,7 +61,7 @@ void BgCtowerRot_Init(Actor* thisx, PlayState* play) {
|
||||
DynaPolyActor_LoadMesh(play, &this->dyna, &gClockTowerStoneDoorCol);
|
||||
this->dyna.actor.world.rot.y = this->dyna.actor.shape.rot.y - 0x4000;
|
||||
}
|
||||
Actor_OffsetOfPointInActorCoords(&this->dyna.actor, &offset, &player->actor.world.pos);
|
||||
Actor_WorldToActorCoords(&this->dyna.actor, &offset, &player->actor.world.pos);
|
||||
if (offset.z < 0.0f) {
|
||||
this->dyna.actor.world.pos.x = this->dyna.actor.home.pos.x + (Math_SinS(this->dyna.actor.world.rot.y) * 80.0f);
|
||||
this->dyna.actor.world.pos.z = this->dyna.actor.home.pos.z + (Math_CosS(this->dyna.actor.world.rot.y) * 80.0f);
|
||||
@ -83,7 +83,7 @@ void BgCtowerRot_CorridorRotate(BgCtowerRot* this, PlayState* play) {
|
||||
Vec3f offset;
|
||||
f32 rotZ;
|
||||
|
||||
Actor_OffsetOfPointInActorCoords(&this->dyna.actor, &offset, &player->actor.world.pos);
|
||||
Actor_WorldToActorCoords(&this->dyna.actor, &offset, &player->actor.world.pos);
|
||||
rotZ = CLAMP(1100.0f - offset.z, 0.0f, 1000.0f);
|
||||
Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_DUNGEON0);
|
||||
this->dyna.actor.shape.rot.z = rotZ * 16.384f;
|
||||
@ -116,7 +116,7 @@ void BgCtowerRot_DoorIdle(BgCtowerRot* this, PlayState* play) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
Vec3f offset;
|
||||
|
||||
Actor_OffsetOfPointInActorCoords(&this->dyna.actor, &offset, &player->actor.world.pos);
|
||||
Actor_WorldToActorCoords(&this->dyna.actor, &offset, &player->actor.world.pos);
|
||||
if (offset.z > 30.0f) {
|
||||
this->unk160 = 0.0f;
|
||||
CutsceneManager_Queue(this->dyna.actor.csId);
|
||||
|
@ -90,7 +90,7 @@ s32 func_809AC5C0(BgFireWall* thisx, PlayState* play) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
Vec3f sp1C;
|
||||
|
||||
Actor_OffsetOfPointInActorCoords(&this->actor, &sp1C, &player->actor.world.pos);
|
||||
Actor_WorldToActorCoords(&this->actor, &sp1C, &player->actor.world.pos);
|
||||
if ((fabsf(sp1C.x) < this->unk_160) && (fabsf(sp1C.z) < (this->unk_160 + 20.0f))) {
|
||||
return true;
|
||||
}
|
||||
@ -143,7 +143,7 @@ void func_809AC7F8(BgFireWall* this, PlayState* play) {
|
||||
f32 sin;
|
||||
f32 cos;
|
||||
|
||||
Actor_OffsetOfPointInActorCoords(&this->actor, &sp38, &player->actor.world.pos);
|
||||
Actor_WorldToActorCoords(&this->actor, &sp38, &player->actor.world.pos);
|
||||
sp38.x = CLAMP(sp38.x, -80.0f, 80.0f);
|
||||
|
||||
if (this->step == 0) {
|
||||
|
@ -56,7 +56,7 @@ bool func_80C0A740(BgIkninSusceil* this, PlayState* play) {
|
||||
Vec3f offset;
|
||||
Player* player = GET_PLAYER(play);
|
||||
|
||||
Actor_OffsetOfPointInActorCoords(&this->dyna.actor, &offset, &player->actor.world.pos);
|
||||
Actor_WorldToActorCoords(&this->dyna.actor, &offset, &player->actor.world.pos);
|
||||
|
||||
return (D_80C0B0E8.x < offset.z) && (offset.z < D_80C0B0E8.z) && (offset.x > -240.0f) && (offset.x < D_80C0B0E4);
|
||||
}
|
||||
@ -98,7 +98,7 @@ s32 func_80C0A95C(BgIkninSusceil* this, PlayState* play) {
|
||||
f32 temp3;
|
||||
f32 temp4;
|
||||
|
||||
Actor_OffsetOfPointInActorCoords(&this->dyna.actor, &offset, &player->actor.world.pos);
|
||||
Actor_WorldToActorCoords(&this->dyna.actor, &offset, &player->actor.world.pos);
|
||||
for (i = 0; i < 7; i++) {
|
||||
temp3 = (D_80C0B0F0[i] * 80.0f) + 0.5f;
|
||||
temp4 = (D_80C0B0F0[i] * 80.0f) + 79.5f;
|
||||
|
@ -55,7 +55,7 @@ f32 func_80ACAB10(PlayState* play, Actor* actor, f32 arg2, f32 arg3, f32 arg4) {
|
||||
point.y = player->actor.world.pos.y + arg2;
|
||||
point.z = player->actor.world.pos.z;
|
||||
|
||||
Actor_OffsetOfPointInActorCoords(actor, &offset, &point);
|
||||
Actor_WorldToActorCoords(actor, &offset, &point);
|
||||
if ((arg3 < fabsf(offset.x)) || (arg4 < fabsf(offset.y))) {
|
||||
return FLT_MAX;
|
||||
} else {
|
||||
|
@ -94,7 +94,7 @@ s32 func_80A60C24(BgSpoutFire* this, PlayState* play) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
Vec3f sp18;
|
||||
|
||||
Actor_OffsetOfPointInActorCoords(&this->actor, &sp18, &player->actor.world.pos);
|
||||
Actor_WorldToActorCoords(&this->actor, &sp18, &player->actor.world.pos);
|
||||
if ((fabsf(sp18.x) < 100.0f) && (fabsf(sp18.z) < 120.0f)) {
|
||||
return true;
|
||||
} else {
|
||||
@ -147,7 +147,7 @@ void func_80A60E08(BgSpoutFire* this, PlayState* play) {
|
||||
f32 cos;
|
||||
f32 sin;
|
||||
|
||||
Actor_OffsetOfPointInActorCoords(&this->actor, &sp30, &player->actor.world.pos);
|
||||
Actor_WorldToActorCoords(&this->actor, &sp30, &player->actor.world.pos);
|
||||
sp30.x = CLAMP(sp30.x, -74.25f, 74.25f);
|
||||
if (this->timer == 0) {
|
||||
if (sp30.z > 0.0f) {
|
||||
|
@ -1007,12 +1007,12 @@ void BossHakugin_AddLightningSegments(BossHakugin* this, Vec3f* startPos, PlaySt
|
||||
targetPos.x = player->actor.world.pos.x - (Math_SinS(this->actor.shape.rot.y) * 50.0f);
|
||||
targetPos.y = player->actor.world.pos.y + 40.0f;
|
||||
targetPos.z = player->actor.world.pos.z - (Math_CosS(this->actor.shape.rot.y) * 50.0f);
|
||||
Actor_OffsetOfPointInActorCoords(&this->actor, &transformedTargetPos, &targetPos);
|
||||
Actor_WorldToActorCoords(&this->actor, &transformedTargetPos, &targetPos);
|
||||
Audio_PlaySfx_AtPos(&this->sfxPos, NA_SE_EN_COMMON_THUNDER_THR);
|
||||
|
||||
for (i = 0; i < GOHT_LIGHTNING_SEGMENT_COUNT; i++) {
|
||||
lightningSegment = &this->lightningSegments[i];
|
||||
Actor_OffsetOfPointInActorCoords(&this->actor, &transformedRootPos, &rootPos);
|
||||
Actor_WorldToActorCoords(&this->actor, &transformedRootPos, &rootPos);
|
||||
|
||||
if (transformedTargetPos.z < transformedRootPos.z) {
|
||||
lightningSegment->rot.y = this->actor.shape.rot.y + ((s32)Rand_Next() >> 0x13);
|
||||
@ -3012,7 +3012,7 @@ void BossHakugin_Update(Actor* thisx, PlayState* play) {
|
||||
}
|
||||
|
||||
BossHakugin_UpdateBaseRot(this, play);
|
||||
Actor_OffsetOfPointInActorCoords(&this->actor, &this->transformedPlayerPos, &player->actor.world.pos);
|
||||
Actor_WorldToActorCoords(&this->actor, &this->transformedPlayerPos, &player->actor.world.pos);
|
||||
this->actionFunc(this, play);
|
||||
Actor_MoveWithGravity(&this->actor);
|
||||
Actor_UpdateBgCheckInfo(play, &this->actor, 450.0f, (89100.0f * 0.001f), 0.0f,
|
||||
|
@ -279,7 +279,7 @@ f32 func_808A0D90(PlayState* play, DoorShutter* this, f32 arg2, f32 arg3, f32 ar
|
||||
sp28.y = player->actor.world.pos.y + arg2;
|
||||
sp28.z = player->actor.world.pos.z;
|
||||
|
||||
Actor_OffsetOfPointInActorCoords(&this->slidingDoor.dyna.actor, &sp1C, &sp28);
|
||||
Actor_WorldToActorCoords(&this->slidingDoor.dyna.actor, &sp1C, &sp28);
|
||||
|
||||
if ((arg3 < fabsf(sp1C.x)) || (arg4 < fabsf(sp1C.y))) {
|
||||
return FLT_MAX;
|
||||
@ -556,7 +556,7 @@ void func_808A1884(DoorShutter* this, PlayState* play) {
|
||||
Vec3f sp44;
|
||||
|
||||
if (this->slidingDoor.dyna.actor.room >= 0) {
|
||||
Actor_OffsetOfPointInActorCoords(&this->slidingDoor.dyna.actor, &sp44, &player->actor.world.pos);
|
||||
Actor_WorldToActorCoords(&this->slidingDoor.dyna.actor, &sp44, &player->actor.world.pos);
|
||||
|
||||
this->slidingDoor.dyna.actor.room =
|
||||
play->transitionActors.list[DOOR_GET_TRANSITION_ID(&this->slidingDoor.dyna.actor)]
|
||||
|
@ -173,7 +173,7 @@ f32 func_809A2E08(PlayState* play, DoorSpiral* this, f32 arg2, f32 arg3, f32 arg
|
||||
point.y = player->actor.world.pos.y + arg2;
|
||||
point.z = player->actor.world.pos.z;
|
||||
|
||||
Actor_OffsetOfPointInActorCoords(&this->actor, &offset, &point);
|
||||
Actor_WorldToActorCoords(&this->actor, &offset, &point);
|
||||
|
||||
if ((arg3 < fabsf(offset.x)) || (arg4 < fabsf(offset.y))) {
|
||||
return FLT_MAX;
|
||||
|
@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
#include "z_en_arrow.h"
|
||||
#include "overlays/effects/ovl_Effect_Ss_Hitmark/z_eff_ss_hitmark.h"
|
||||
#include "overlays/effects/ovl_Effect_Ss_Sbn/z_eff_ss_sbn.h"
|
||||
#include "objects/gameplay_keep/gameplay_keep.h"
|
||||
|
||||
@ -431,7 +432,7 @@ void func_8088ACE0(EnArrow* this, PlayState* play) {
|
||||
SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, sp82);
|
||||
Actor_Kill(&this->actor);
|
||||
} else {
|
||||
EffectSsHitmark_SpawnCustomScale(play, 0, 150, &this->actor.world.pos);
|
||||
EffectSsHitmark_SpawnCustomScale(play, EFFECT_HITMARK_WHITE, 150, &this->actor.world.pos);
|
||||
|
||||
if (sp50 && (this->collider.info.atHitInfo->elemType != ELEMTYPE_UNK4)) {
|
||||
sp7C = this->collider.base.at;
|
||||
|
@ -4,9 +4,10 @@
|
||||
* Description: Bombers - Jim
|
||||
*/
|
||||
|
||||
#include "overlays/actors/ovl_En_Bombal/z_en_bombal.h"
|
||||
#include "z_en_bomjima.h"
|
||||
|
||||
#include "overlays/effects/ovl_Effect_Ss_Hitmark/z_eff_ss_hitmark.h"
|
||||
|
||||
#define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_10)
|
||||
|
||||
#define THIS ((EnBomjima*)thisx)
|
||||
@ -485,7 +486,7 @@ void func_80BFEB64(EnBomjima* this, PlayState* play) {
|
||||
sp40.z = (Math_CosS(sp3E) * (Rand_ZeroFloat(20.0f) + 40.0f)) + this->bombal->actor.world.pos.z;
|
||||
|
||||
SoundSource_PlaySfxAtFixedWorldPos(play, &sp40, 50, NA_SE_EV_BOMBERS_SHOT_EXPLOSUIN);
|
||||
EffectSsHitmark_SpawnFixedScale(play, 0, &sp40);
|
||||
EffectSsHitmark_SpawnFixedScale(play, EFFECT_HITMARK_WHITE, &sp40);
|
||||
this->unk_2BC++;
|
||||
|
||||
if ((TRUNCF_BINANG(Rand_ZeroFloat(2.0f)) + 3) < this->unk_2BC) {
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
#include "global.h"
|
||||
#include "objects/object_cs/object_cs.h"
|
||||
#include "overlays/actors/ovl_En_Bombal/z_en_bombal.h"
|
||||
|
||||
struct EnBomjima;
|
||||
|
||||
|
@ -496,7 +496,7 @@ void EnBox_WaitOpen(EnBox* this, PlayState* play) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
Vec3f offset;
|
||||
|
||||
Actor_OffsetOfPointInActorCoords(&this->dyna.actor, &offset, &player->actor.world.pos);
|
||||
Actor_WorldToActorCoords(&this->dyna.actor, &offset, &player->actor.world.pos);
|
||||
if ((offset.z > -50.0f) && (offset.z < 0.0f) && (fabsf(offset.y) < 10.0f) && (fabsf(offset.x) < 20.0f) &&
|
||||
Player_IsFacingActor(&this->dyna.actor, 0x3000, play)) {
|
||||
if (((this->getItemId == GI_HEART_PIECE) || (this->getItemId == GI_BOTTLE)) &&
|
||||
|
@ -814,7 +814,7 @@ void EnDeath_SetupDeathCutscenePart1(EnDeath* this, PlayState* play) {
|
||||
|
||||
this->coreGuarded = false;
|
||||
this->coreCollider.base.acFlags &= ~AC_ON;
|
||||
Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 30);
|
||||
Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 30);
|
||||
this->actionTimer = 35;
|
||||
this->actor.world.pos.y = this->actor.home.pos.y;
|
||||
this->actor.speed = 0.0f;
|
||||
|
@ -293,7 +293,7 @@ void EnDekubaba_SetFrozenEffects(EnDekubaba* this) {
|
||||
this->collider.base.colType = COLTYPE_HIT3;
|
||||
this->timer = 80;
|
||||
this->actor.flags &= ~ACTOR_FLAG_400;
|
||||
Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 80);
|
||||
Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 80);
|
||||
}
|
||||
|
||||
void EnDekubaba_SpawnIceEffects(EnDekubaba* this, PlayState* play) {
|
||||
@ -788,14 +788,14 @@ void EnDekubaba_SetupHit(EnDekubaba* this, s32 hitType) {
|
||||
Actor_SetScale(&this->actor, this->size * 0.01f);
|
||||
|
||||
if (hitType == DEKUBABA_HIT_STUN_NUT) {
|
||||
Actor_SetColorFilter(&this->actor, 0, 155, 0, 42);
|
||||
Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 155, COLORFILTER_BUFFLAG_OPA, 42);
|
||||
} else if (hitType == DEKUBABA_HIT_STUN_ELECTRIC) {
|
||||
Actor_SetColorFilter(&this->actor, 0, 155, 0, 42);
|
||||
Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 155, COLORFILTER_BUFFLAG_OPA, 42);
|
||||
this->drawDmgEffType = ACTOR_DRAW_DMGEFF_ELECTRIC_SPARKS_LARGE;
|
||||
this->drawDmgEffScale = 0.75f;
|
||||
this->drawDmgEffAlpha = 2.0f;
|
||||
} else {
|
||||
Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 42);
|
||||
Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 42);
|
||||
}
|
||||
this->actionFunc = EnDekubaba_Hit;
|
||||
}
|
||||
@ -982,7 +982,7 @@ void EnDekubaba_SetupSway(EnDekubaba* this) {
|
||||
this->stemSectionAngle[2] = -0x5000;
|
||||
this->stemSectionAngle[1] = -0x4800;
|
||||
EnDekubaba_DisableHitboxes(this);
|
||||
Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 35);
|
||||
Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 35);
|
||||
this->collider.base.acFlags &= ~AC_ON;
|
||||
this->actionFunc = EnDekubaba_Sway;
|
||||
}
|
||||
@ -997,7 +997,7 @@ void EnDekubaba_Sway(EnDekubaba* this, PlayState* play) {
|
||||
Math_ScaledStepToS(&this->actor.shape.rot.x, this->stemSectionAngle[0], 0x71C);
|
||||
Math_ScaledStepToS(this->stemSectionAngle, this->stemSectionAngle[1], 0x71C);
|
||||
Math_ScaledStepToS(&this->stemSectionAngle[1], this->stemSectionAngle[2], 0x71C);
|
||||
if (Math_ScaledStepToS(&this->stemSectionAngle[2], this->targetSwayAngle, 0x71C) != 0) {
|
||||
if (Math_ScaledStepToS(&this->stemSectionAngle[2], this->targetSwayAngle, 0x71C)) {
|
||||
this->targetSwayAngle = -0x4000 - (s32)((this->targetSwayAngle + 0x4000) * 0.8f);
|
||||
}
|
||||
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include "overlays/actors/ovl_En_Bom/z_en_bom.h"
|
||||
#include "overlays/actors/ovl_En_Bombf/z_en_bombf.h"
|
||||
#include "overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h"
|
||||
#include "overlays/effects/ovl_Effect_Ss_Hitmark/z_eff_ss_hitmark.h"
|
||||
|
||||
#define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_UNFRIENDLY | ACTOR_FLAG_400)
|
||||
|
||||
@ -974,9 +975,9 @@ void EnDodongo_UpdateDamage(EnDodongo* this, PlayState* play) {
|
||||
Math_Vec3s_ToVec3f(&sp3C, &this->collider2.elements[i].info.bumper.hitPos);
|
||||
if (this->actor.colChkInfo.damageEffect == 0xF) {
|
||||
CollisionCheck_BlueBlood(play, NULL, &sp3C);
|
||||
EffectSsHitmark_SpawnFixedScale(play, 0, &sp3C);
|
||||
} else if (this->actor.colChkInfo.damageEffect != 14) {
|
||||
EffectSsHitmark_SpawnFixedScale(play, 3, &sp3C);
|
||||
EffectSsHitmark_SpawnFixedScale(play, EFFECT_HITMARK_WHITE, &sp3C);
|
||||
} else if (this->actor.colChkInfo.damageEffect != 0xE) {
|
||||
EffectSsHitmark_SpawnFixedScale(play, EFFECT_HITMARK_METAL, &sp3C);
|
||||
CollisionCheck_SpawnShieldParticlesMetalSound(play, &sp3C, &this->actor.projectedPos);
|
||||
}
|
||||
}
|
||||
|
@ -484,7 +484,7 @@ void EnDoor_Idle(EnDoor* this, PlayState* play) {
|
||||
Vec3f playerPosRelToDoor;
|
||||
|
||||
// Check if player is near this door and looking at it
|
||||
Actor_OffsetOfPointInActorCoords(&this->knobDoor.dyna.actor, &playerPosRelToDoor, &player->actor.world.pos);
|
||||
Actor_WorldToActorCoords(&this->knobDoor.dyna.actor, &playerPosRelToDoor, &player->actor.world.pos);
|
||||
if (sDoorIsMilkBarMember || ((fabsf(playerPosRelToDoor.y) < 20.0f) && (fabsf(playerPosRelToDoor.x) < 20.0f) &&
|
||||
(fabsf(playerPosRelToDoor.z) < 50.0f))) {
|
||||
s16 yawDiff = player->actor.shape.rot.y - this->knobDoor.dyna.actor.shape.rot.y;
|
||||
|
@ -175,7 +175,7 @@ void func_80AC21A0(EnDoorEtc* this, PlayState* play) {
|
||||
s16 yawDiff;
|
||||
s32 yawDiffAbs;
|
||||
|
||||
Actor_OffsetOfPointInActorCoords(&this->knobDoor.dyna.actor, &playerOffsetFromDoor, &player->actor.world.pos);
|
||||
Actor_WorldToActorCoords(&this->knobDoor.dyna.actor, &playerOffsetFromDoor, &player->actor.world.pos);
|
||||
if (!this->knobDoor.requestOpen) {
|
||||
if ((!Player_InCsMode(play)) &&
|
||||
((fabsf(playerOffsetFromDoor.y) < 20.0f) && fabsf(playerOffsetFromDoor.x) < 20.0f) &&
|
||||
|
@ -504,7 +504,7 @@ void EnGe2_PatrolDuties(EnGe2* this, PlayState* play) {
|
||||
} else if (this->collider.base.acFlags & AC_HIT) {
|
||||
if ((this->collider.info.acHitInfo != NULL) &&
|
||||
(this->collider.info.acHitInfo->toucher.dmgFlags & DMG_DEKU_NUT)) {
|
||||
Actor_SetColorFilter(&this->picto.actor, 0, 120, 0, 400);
|
||||
Actor_SetColorFilter(&this->picto.actor, COLORFILTER_COLORFLAG_BLUE, 120, COLORFILTER_BUFFLAG_OPA, 400);
|
||||
this->picto.actor.speed = 0.0f;
|
||||
this->actionFunc = EnGe2_Stunned;
|
||||
this->stateFlags |= GERUDO_PURPLE_STATE_STUNNED;
|
||||
|
@ -108,7 +108,7 @@ void EnHoll_SetupAction(EnHoll* this) {
|
||||
void EnHoll_SetPlayerSide(PlayState* play, EnHoll* this, Vec3f* transformedPlayerPos) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
|
||||
Actor_OffsetOfPointInActorCoords(&this->actor, transformedPlayerPos, &player->actor.world.pos);
|
||||
Actor_WorldToActorCoords(&this->actor, transformedPlayerPos, &player->actor.world.pos);
|
||||
this->playerSide = (transformedPlayerPos->z < 0.0f) ? EN_HOLL_BEHIND : EN_HOLL_BEFORE;
|
||||
}
|
||||
|
||||
@ -225,8 +225,8 @@ void EnHoll_TransparentIdle(EnHoll* this, PlayState* play) {
|
||||
f32 enHollTop;
|
||||
f32 playerDistFromCentralPlane;
|
||||
|
||||
Actor_OffsetOfPointInActorCoords(&this->actor, &transformedPlayerPos,
|
||||
useViewEye ? &play->view.eye : &player->actor.world.pos);
|
||||
Actor_WorldToActorCoords(&this->actor, &transformedPlayerPos,
|
||||
useViewEye ? &play->view.eye : &player->actor.world.pos);
|
||||
enHollTop = (play->sceneId == SCENE_PIRATE) ? EN_HOLL_TOP_PIRATE : EN_HOLL_TOP_DEFAULT;
|
||||
|
||||
if ((transformedPlayerPos.y > EN_HOLL_BOTTOM_DEFAULT) && (transformedPlayerPos.y < enHollTop) &&
|
||||
|
@ -658,7 +658,7 @@ void EnHonotrap_FlameGroup(EnHonotrap* this, PlayState* play) {
|
||||
}
|
||||
temp_fs0 = flameGroup->unk0 * 120.0f;
|
||||
temp_fs1 = flameGroup->unk4 * 120.0f;
|
||||
Actor_OffsetOfPointInActorCoords(&this->actor, &sp68, &GET_PLAYER(play)->actor.world.pos);
|
||||
Actor_WorldToActorCoords(&this->actor, &sp68, &GET_PLAYER(play)->actor.world.pos);
|
||||
|
||||
if (sp68.z < temp_fs1) {
|
||||
sp68.z = temp_fs1;
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include "z_en_kaizoku.h"
|
||||
#include "overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h"
|
||||
#include "overlays/effects/ovl_Effect_Ss_Hitmark/z_eff_ss_hitmark.h"
|
||||
|
||||
#define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_UNFRIENDLY | ACTOR_FLAG_10 | ACTOR_FLAG_100000)
|
||||
|
||||
@ -1949,7 +1950,7 @@ void func_80B89A08(EnKaizoku* this, PlayState* play) {
|
||||
|
||||
this->bodyCollider.base.acFlags &= ~AC_HIT;
|
||||
Actor_PlaySfx(&this->picto.actor, NA_SE_IT_SHIELD_BOUND);
|
||||
EffectSsHitmark_SpawnFixedScale(play, 3, &pos);
|
||||
EffectSsHitmark_SpawnFixedScale(play, EFFECT_HITMARK_METAL, &pos);
|
||||
CollisionCheck_SpawnShieldParticlesMetal(play, &pos);
|
||||
}
|
||||
}
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include "z_en_knight.h"
|
||||
#include "z64shrink_window.h"
|
||||
#include "overlays/actors/ovl_Mir_Ray3/z_mir_ray3.h"
|
||||
#include "overlays/effects/ovl_Effect_Ss_Hitmark/z_eff_ss_hitmark.h"
|
||||
#include "objects/gameplay_keep/gameplay_keep.h"
|
||||
#include "objects/object_knight/object_knight.h"
|
||||
|
||||
@ -2116,7 +2117,7 @@ void EnKnight_IgosSitting(EnKnight* this, PlayState* play) {
|
||||
|
||||
Math_Vec3f_Copy(&hitmarkPos, &player->actor.world.pos);
|
||||
hitmarkPos.y += 25.0f;
|
||||
EffectSsHitmark_SpawnFixedScale(play, 0, &hitmarkPos);
|
||||
EffectSsHitmark_SpawnFixedScale(play, EFFECT_HITMARK_WHITE, &hitmarkPos);
|
||||
|
||||
func_800B8D50(play, NULL, KREG(53) + 12.0f, this->actor.shape.rot.y + yaw, KREG(54) + 7.0f, 0x10);
|
||||
EnKnight_SpawnDust(play, 12);
|
||||
|
@ -566,7 +566,7 @@ s32 func_80A3F384(EnTest3* this, PlayState* play) {
|
||||
if ((door != NULL) && !door->knobDoor.requestOpen &&
|
||||
((player->doorType == PLAYER_DOORTYPE_NONE) || (&door->knobDoor.dyna.actor != player->doorActor)) &&
|
||||
Actor_ActorAIsFacingActorB(&this->player.actor, &door->knobDoor.dyna.actor, 0x3000)) {
|
||||
Actor_OffsetOfPointInActorCoords(&door->knobDoor.dyna.actor, &offset, &this->player.actor.world.pos);
|
||||
Actor_WorldToActorCoords(&door->knobDoor.dyna.actor, &offset, &this->player.actor.world.pos);
|
||||
this->player.doorType = PLAYER_DOORTYPE_HANDLE;
|
||||
this->player.doorDirection = (offset.z >= 0.0f) ? 1.0f : -1.0f;
|
||||
this->player.doorActor = &door->knobDoor.dyna.actor;
|
||||
|
@ -484,7 +484,7 @@ s32 func_80AECE60(EnTk* this, PlayState* play) {
|
||||
if ((door != NULL) && (this->unk_2CA & 0x400)) {
|
||||
Vec3f sp5C;
|
||||
|
||||
Actor_OffsetOfPointInActorCoords(&this->actor, &sp5C, &door->knobDoor.dyna.actor.world.pos);
|
||||
Actor_WorldToActorCoords(&this->actor, &sp5C, &door->knobDoor.dyna.actor.world.pos);
|
||||
door->openTimer = 2;
|
||||
if (sp5C.z < -20.0f) {
|
||||
this->unk_2CA &= ~0x400;
|
||||
|
@ -131,7 +131,7 @@ void func_8089F2C4(EnViewer* this, PlayState* play) {
|
||||
Vec3f sp20;
|
||||
f32 temp;
|
||||
|
||||
Actor_OffsetOfPointInActorCoords(&this->actor, &sp20, &player->actor.world.pos);
|
||||
Actor_WorldToActorCoords(&this->actor, &sp20, &player->actor.world.pos);
|
||||
if (this->unk_14C == 0.0f) {
|
||||
this->unk_14C = 0.1f;
|
||||
}
|
||||
|
@ -147,7 +147,7 @@ s32 func_80BA2708(ObjNozoki* this, PlayState* play) {
|
||||
Vec3f sp30;
|
||||
|
||||
while (enemy != NULL) {
|
||||
Actor_OffsetOfPointInActorCoords(&this->dyna.actor, &sp30, &enemy->world.pos);
|
||||
Actor_WorldToActorCoords(&this->dyna.actor, &sp30, &enemy->world.pos);
|
||||
if (sp30.z >= 0.0f) {
|
||||
return false;
|
||||
}
|
||||
@ -219,7 +219,7 @@ void func_80BA28DC(ObjNozoki* this, PlayState* play) {
|
||||
if (OBJNOZOKI_GET_400(&this->dyna.actor)) {
|
||||
Vec3f sp28;
|
||||
|
||||
Actor_OffsetOfPointInActorCoords(&this->dyna.actor, &sp28, &GET_PLAYER(play)->actor.world.pos);
|
||||
Actor_WorldToActorCoords(&this->dyna.actor, &sp28, &GET_PLAYER(play)->actor.world.pos);
|
||||
if (sp28.z < -20.0f) {
|
||||
this->csId = CutsceneManager_GetAdditionalCsId(this->csId);
|
||||
}
|
||||
|
@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
#include "z_obj_spinyroll.h"
|
||||
#include "overlays/effects/ovl_Effect_Ss_Hitmark/z_eff_ss_hitmark.h"
|
||||
#include "objects/object_spinyroll/object_spinyroll.h"
|
||||
|
||||
#define FLAGS (ACTOR_FLAG_10)
|
||||
@ -148,7 +149,7 @@ void func_80A1DA50(PlayState* play, ObjSpinyroll* this, Vec3f* arg2, Vec3f* arg3
|
||||
|
||||
Math_Vec3f_Sum(arg2, arg3, &sp1C);
|
||||
Math_Vec3f_Scale(&sp1C, 0.5f);
|
||||
EffectSsHitmark_SpawnFixedScale(play, 3, &sp1C);
|
||||
EffectSsHitmark_SpawnFixedScale(play, EFFECT_HITMARK_METAL, &sp1C);
|
||||
Actor_PlaySfx(&this->dyna.actor, NA_SE_IT_SHIELD_REFLECT_SW);
|
||||
}
|
||||
|
||||
|
@ -115,7 +115,7 @@ void ObjTokeiTobira_Update(Actor* thisx, PlayState* play) {
|
||||
f32 sp40;
|
||||
Vec3f sp34;
|
||||
|
||||
Actor_OffsetOfPointInActorCoords(&this->dyna.actor, &sp34, &player->actor.world.pos);
|
||||
Actor_WorldToActorCoords(&this->dyna.actor, &sp34, &player->actor.world.pos);
|
||||
sp40 = sp34.x * sp48;
|
||||
|
||||
if (sp40 > 20.0f) {
|
||||
@ -146,7 +146,7 @@ void ObjTokeiTobira_Update(Actor* thisx, PlayState* play) {
|
||||
} else if (this->unk168 == 1) {
|
||||
Vec3f sp24;
|
||||
|
||||
Actor_OffsetOfPointInActorCoords(&this->dyna.actor, &sp24, &player->actor.world.pos);
|
||||
Actor_WorldToActorCoords(&this->dyna.actor, &sp24, &player->actor.world.pos);
|
||||
|
||||
if ((sp24.z > 0.0f) && (sp24.z < 30.0f)) {
|
||||
this->unk168 = 1;
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include "z_obj_um.h"
|
||||
#include "z64horse.h"
|
||||
#include "overlays/actors/ovl_En_In/z_en_in.h"
|
||||
#include "overlays/effects/ovl_Effect_Ss_Hitmark/z_eff_ss_hitmark.h"
|
||||
#include "objects/gameplay_keep/gameplay_keep.h"
|
||||
|
||||
#define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_10 | ACTOR_FLAG_20)
|
||||
@ -1864,7 +1865,7 @@ void ObjUm_SpawnFragments(PlayState* play, Vec3f* potPos) {
|
||||
s32 i;
|
||||
Vec3f sp70;
|
||||
|
||||
EffectSsHitmark_SpawnFixedScale(play, 0, potPos);
|
||||
EffectSsHitmark_SpawnFixedScale(play, EFFECT_HITMARK_WHITE, potPos);
|
||||
|
||||
for (i = 0; i < 20; i++) {
|
||||
sp70.x = (Rand_ZeroOne() * 20.0f) - 10.0f;
|
||||
@ -1942,7 +1943,7 @@ void ObjUm_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot,
|
||||
if (this->potsLife[i] == 1) {
|
||||
ObjUm_SpawnFragments(play, &calcPotPos);
|
||||
} else {
|
||||
EffectSsHitmark_SpawnFixedScale(play, 0, &calcPotPos);
|
||||
EffectSsHitmark_SpawnFixedScale(play, EFFECT_HITMARK_WHITE, &calcPotPos);
|
||||
}
|
||||
}
|
||||
Matrix_Pop();
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include "z_obj_vspinyroll.h"
|
||||
#include "objects/object_spinyroll/object_spinyroll.h"
|
||||
#include "overlays/effects/ovl_Effect_Ss_Hitmark/z_eff_ss_hitmark.h"
|
||||
|
||||
#define FLAGS (ACTOR_FLAG_10)
|
||||
|
||||
@ -207,7 +208,7 @@ s32 func_80A3C8D8(ObjVspinyroll* this, PlayState* play, Vec3f* arg2, s32 arg3) {
|
||||
spB4.y += this->dyna.actor.world.pos.y;
|
||||
spB4.z += this->dyna.actor.world.pos.z;
|
||||
|
||||
EffectSsHitmark_SpawnFixedScale(play, 3, &spB4);
|
||||
EffectSsHitmark_SpawnFixedScale(play, EFFECT_HITMARK_METAL, &spB4);
|
||||
Actor_PlaySfx(&this->dyna.actor, NA_SE_IT_SHIELD_REFLECT_SW);
|
||||
}
|
||||
|
||||
|
@ -6361,7 +6361,7 @@ void Player_Door_Sliding(PlayState* play, Player* this, Actor* door) {
|
||||
this->av1.actionVar1 = 0;
|
||||
this->unk_397 = this->doorType;
|
||||
this->stateFlags1 |= PLAYER_STATE1_20000000;
|
||||
Actor_OffsetOfPointInActorCoords(&doorSliding->dyna.actor, &sp38, &this->actor.world.pos);
|
||||
Actor_WorldToActorCoords(&doorSliding->dyna.actor, &sp38, &this->actor.world.pos);
|
||||
|
||||
func_80835BF8(&this->actor.world.pos, doorSliding->dyna.actor.shape.rot.y,
|
||||
(42.0f - fabsf(sp38.z)) * this->doorDirection, &this->actor.world.pos);
|
||||
|
@ -732,7 +732,7 @@
|
||||
0x800B6DF8:("Actor_WorldDistXYZToPoint",),
|
||||
0x800B6E1C:("Actor_WorldDistXZToActor",),
|
||||
0x800B6E48:("Actor_WorldDistXZToPoint",),
|
||||
0x800B6E6C:("Actor_OffsetOfPointInActorCoords",),
|
||||
0x800B6E6C:("Actor_WorldToActorCoords",),
|
||||
0x800B6F0C:("Actor_HeightDiff",),
|
||||
0x800B6F20:("Actor_SetControlStickData",),
|
||||
0x800B6FC8:("Player_GetHeight",),
|
||||
|
@ -26,7 +26,7 @@
|
||||
0x80096BC8:("sFpuExceptions","char*","[6]",0x18),
|
||||
0x80096BE0:("sFaultDrawerInstance","FaultDrawer*","",0x4),
|
||||
0x80096BE4:("sFaultDrawerDefault","FaultDrawer","",0x3c),
|
||||
0x80096C20:("gLoadLogSeverity","UNK_TYPE4","",0x4),
|
||||
0x80096C20:("gFragmentLogSeverity","UNK_TYPE4","",0x4),
|
||||
0x80096C30:("gOverlayLogSeverity","UNK_TYPE4","",0x4),
|
||||
0x80096C40:("sStackInfoListStart","StackEntry*","",0x4),
|
||||
0x80096C44:("sStackInfoListEnd","StackEntry*","",0x4),
|
||||
|
@ -175,7 +175,8 @@ wordReplace = {
|
||||
"Actor_SetHeight": "Actor_SetFocus",
|
||||
"Actor_SetRotationFromDrawRotation": "Actor_SetWorldRotToShape",
|
||||
"Actor_InitDrawRotation": "Actor_SetShapeRotToWorld",
|
||||
"Actor_CalcOffsetOrientedToDrawRotation": "Actor_OffsetOfPointInActorCoords",
|
||||
"Actor_CalcOffsetOrientedToDrawRotation": "Actor_WorldToActorCoords",
|
||||
"Actor_OffsetOfPointInActorCoords": "Actor_WorldToActorCoords",
|
||||
"Actor_ApplyMovement": "Actor_UpdatePos",
|
||||
"Actor_SetVelocityYRotationAndGravity": "Actor_UpdateVelocityWithGravity",
|
||||
"Actor_SetVelocityAndMoveYRotationAndGravity": "Actor_MoveWithGravity",
|
||||
|
@ -246,7 +246,7 @@ asm/non_matchings/code/z_actor/Actor_WorldDistXYZToActor.s,Actor_WorldDistXYZToA
|
||||
asm/non_matchings/code/z_actor/Actor_WorldDistXYZToPoint.s,Actor_WorldDistXYZToPoint,0x800B6DF8,0x9
|
||||
asm/non_matchings/code/z_actor/Actor_WorldDistXZToActor.s,Actor_WorldDistXZToActor,0x800B6E1C,0xB
|
||||
asm/non_matchings/code/z_actor/Actor_WorldDistXZToPoint.s,Actor_WorldDistXZToPoint,0x800B6E48,0x9
|
||||
asm/non_matchings/code/z_actor/Actor_OffsetOfPointInActorCoords.s,Actor_OffsetOfPointInActorCoords,0x800B6E6C,0x28
|
||||
asm/non_matchings/code/z_actor/Actor_WorldToActorCoords.s,Actor_WorldToActorCoords,0x800B6E6C,0x28
|
||||
asm/non_matchings/code/z_actor/Actor_HeightDiff.s,Actor_HeightDiff,0x800B6F0C,0x5
|
||||
asm/non_matchings/code/z_actor/Actor_SetControlStickData.s,Actor_SetControlStickData,0x800B6F20,0x2A
|
||||
asm/non_matchings/code/z_actor/Player_GetHeight.s,Player_GetHeight,0x800B6FC8,0x32
|
||||
|
|
Loading…
Reference in New Issue
Block a user