mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-20 13:23:45 -07:00
Merge 9506da3c7d
into 7b4df9bdb2
This commit is contained in:
commit
f808caae93
57 changed files with 767 additions and 267 deletions
|
@ -1818,9 +1818,6 @@ uintptr_t SysUcode_GetUCodeBoot(void);
|
||||||
size_t SysUcode_GetUCodeBootSize(void);
|
size_t SysUcode_GetUCodeBootSize(void);
|
||||||
uint32_t SysUcode_GetUCode(void);
|
uint32_t SysUcode_GetUCode(void);
|
||||||
uintptr_t SysUcode_GetUCodeData(void);
|
uintptr_t SysUcode_GetUCodeData(void);
|
||||||
void func_800D2E30(UnkRumbleStruct* arg0);
|
|
||||||
void func_800D3140(UnkRumbleStruct* arg0);
|
|
||||||
void func_800D3178(UnkRumbleStruct* arg0);
|
|
||||||
void func_800D31A0(void);
|
void func_800D31A0(void);
|
||||||
void func_800D31F0(void);
|
void func_800D31F0(void);
|
||||||
void func_800D3210(void);
|
void func_800D3210(void);
|
||||||
|
|
99
soh/include/padmgr.h
Normal file
99
soh/include/padmgr.h
Normal file
|
@ -0,0 +1,99 @@
|
||||||
|
#ifndef PADMGR_H
|
||||||
|
#define PADMGR_H
|
||||||
|
|
||||||
|
#include "ultra64.h"
|
||||||
|
#include "libu64/pad.h"
|
||||||
|
#include "irqmgr.h"
|
||||||
|
|
||||||
|
typedef enum ControllerPakType {
|
||||||
|
CONT_PAK_NONE,
|
||||||
|
CONT_PAK_RUMBLE,
|
||||||
|
CONT_PAK_OTHER
|
||||||
|
} ControllerPakType;
|
||||||
|
|
||||||
|
typedef struct PadMgr {
|
||||||
|
/* 0x0000 */ OSContStatus padStatus[MAXCONTROLLERS];
|
||||||
|
/* 0x0010 */ OSMesg serialMsg;
|
||||||
|
/* 0x0014 */ OSMesg lockMsg;
|
||||||
|
/* 0x0018 */ OSMesg interruptMsgBuf[4];
|
||||||
|
/* 0x0028 */ OSMesgQueue serialLockQueue;
|
||||||
|
/* 0x0040 */ OSMesgQueue lockQueue;
|
||||||
|
/* 0x0058 */ OSMesgQueue interruptQueue;
|
||||||
|
/* 0x0070 */ IrqMgrClient irqClient;
|
||||||
|
/* 0x0078 */ IrqMgr* irqMgr;
|
||||||
|
/* 0x0080 */ OSThread thread;
|
||||||
|
/* 0x0230 */ Input inputs[MAXCONTROLLERS];
|
||||||
|
/* 0x0290 */ OSContPad pads[MAXCONTROLLERS];
|
||||||
|
/* 0x02A8 */ vu8 validCtrlrsMask;
|
||||||
|
/* 0x02A9 */ u8 nControllers;
|
||||||
|
/* 0x02AA */ u8 ctrlrIsConnected[MAXCONTROLLERS];
|
||||||
|
/* 0x02AE */ u8 pakType[MAXCONTROLLERS];
|
||||||
|
/* 0x02B2 */ vu8 rumbleEnable[MAXCONTROLLERS];
|
||||||
|
/* 0x02B6 */ u8 rumbleTimer[MAXCONTROLLERS];
|
||||||
|
/* 0x02BC */ OSPfs rumblePfs[MAXCONTROLLERS];
|
||||||
|
/* 0x045C */ vu8 rumbleOffTimer; // amount of VI retraces to not rumble for, takes priority over rumbleOnTimer
|
||||||
|
/* 0x045D */ vu8 rumbleOnTimer; // amount of VI retraces to rumble for
|
||||||
|
/* 0x045E */ u8 isResetting;
|
||||||
|
/* 0x0460 */ void (*retraceCallback)(struct PadMgr* padMgr, void* arg);
|
||||||
|
/* 0x0464 */ void* retraceCallbackArg;
|
||||||
|
} PadMgr; // size = 0x468
|
||||||
|
|
||||||
|
// Initialization
|
||||||
|
|
||||||
|
void PadMgr_Init(PadMgr* padMgr, OSMesgQueue* serialEventQueue, IrqMgr* irqMgr, OSId id, OSPri priority, void* stack);
|
||||||
|
|
||||||
|
// Fetching inputs
|
||||||
|
|
||||||
|
// This function cannot be prototyped here in all configurations because it is called incorrectly in fault_gc.c
|
||||||
|
// (see bug in `Fault_PadCallback`)
|
||||||
|
#if PLATFORM_N64 || defined(AVOID_UB)
|
||||||
|
void PadMgr_RequestPadData(PadMgr* padmgr, Input* inputs, s32 gameRequest);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// For internal use by Controller Pak systems
|
||||||
|
|
||||||
|
OSMesgQueue* PadMgr_AcquireSerialEventQueue(PadMgr* padMgr);
|
||||||
|
void PadMgr_ReleaseSerialEventQueue(PadMgr* padMgr, OSMesgQueue* serialEventQueue);
|
||||||
|
|
||||||
|
// Rumble
|
||||||
|
|
||||||
|
void PadMgr_RumbleStop(PadMgr* padMgr);
|
||||||
|
void PadMgr_RumbleReset(PadMgr* padMgr);
|
||||||
|
void PadMgr_RumbleSetSingle(PadMgr* padMgr, u32 port, u32 rumble);
|
||||||
|
void PadMgr_RumbleSet(PadMgr* padMgr, u8* enable);
|
||||||
|
|
||||||
|
// Retrace callback
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the padmgr retrace callback that runs while waiting for controller input. The callback may be passed a single
|
||||||
|
* user-provided argument. The callback function should be `void (*)(PadMgr*, void*)`.
|
||||||
|
*
|
||||||
|
* @param callback callback to run before rumble state is updated for the current VI
|
||||||
|
* @param arg the argument to pass to the callback
|
||||||
|
*
|
||||||
|
* @see PADMGR_UNSET_RETRACE_CALLACK
|
||||||
|
*/
|
||||||
|
#define PADMGR_SET_RETRACE_CALLACK(padmgr, callback, arg) \
|
||||||
|
do { \
|
||||||
|
(padmgr)->retraceCallback = (callback); \
|
||||||
|
(padmgr)->retraceCallbackArg = (arg); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Unsets the current padmgr retrace callback if it and the argument are the same as the ones already registered.
|
||||||
|
*
|
||||||
|
* @param callback the callback to unset, if it is set
|
||||||
|
* @param arg the argument to unset, if it is set
|
||||||
|
*
|
||||||
|
* @see PADMGR_SET_RETRACE_CALLACK
|
||||||
|
*/
|
||||||
|
#define PADMGR_UNSET_RETRACE_CALLACK(padmgr, callback, arg) \
|
||||||
|
if ((padmgr)->retraceCallback == (callback) && (padmgr)->retraceCallbackArg == (arg)) { \
|
||||||
|
(padmgr)->retraceCallback = NULL; \
|
||||||
|
(padmgr)->retraceCallbackArg = NULL; \
|
||||||
|
} \
|
||||||
|
(void)0
|
||||||
|
|
||||||
|
extern PadMgr gPadMgr;
|
||||||
|
|
||||||
|
#endif
|
|
@ -1,6 +1,11 @@
|
||||||
#ifndef REGS_H
|
#ifndef REGS_H
|
||||||
#define REGS_H
|
#define REGS_H
|
||||||
|
|
||||||
|
#include "ultra64.h"
|
||||||
|
#include "versions.h"
|
||||||
|
|
||||||
|
struct PlayState;
|
||||||
|
|
||||||
#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_PAGES 6
|
||||||
#define REG_PER_PAGE 16
|
#define REG_PER_PAGE 16
|
||||||
|
@ -121,6 +126,10 @@
|
||||||
#define R_ITEM_AMMO_Y(i) VREG(68 + i)
|
#define R_ITEM_AMMO_Y(i) VREG(68 + i)
|
||||||
#define R_ITEM_ICON_WIDTH(i) VREG(76 + i)
|
#define R_ITEM_ICON_WIDTH(i) VREG(76 + i)
|
||||||
#define R_ITEM_BTN_WIDTH(i) VREG(80 + i)
|
#define R_ITEM_BTN_WIDTH(i) VREG(80 + i)
|
||||||
|
#define R_GAME_OVER_RUMBLE_STRENGTH VREG(90)
|
||||||
|
#define R_GAME_OVER_RUMBLE_DURATION VREG(91)
|
||||||
|
#define R_GAME_OVER_RUMBLE_DECREASE_RATE VREG(92)
|
||||||
|
#define R_ENABLE_ACTOR_DEBUG_PRINTF HREG(20)
|
||||||
#define R_DISABLE_INPUT_DISPLAY HREG(47)
|
#define R_DISABLE_INPUT_DISPLAY HREG(47)
|
||||||
#define R_EN_GOROIWA_SPEED mREG(12)
|
#define R_EN_GOROIWA_SPEED mREG(12)
|
||||||
#define R_NAVI_MSG_REGION_ALPHA nREG(87)
|
#define R_NAVI_MSG_REGION_ALPHA nREG(87)
|
||||||
|
|
51
soh/include/rumble.h
Normal file
51
soh/include/rumble.h
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
#ifndef RUMBLE_H
|
||||||
|
#define RUMBLE_H
|
||||||
|
|
||||||
|
#include "ultra64.h"
|
||||||
|
|
||||||
|
#define RUMBLE_MAX_REQUESTS 64
|
||||||
|
|
||||||
|
typedef enum RumbleState {
|
||||||
|
RUMBLE_STATE_CLEAR,
|
||||||
|
RUMBLE_STATE_RUNNING,
|
||||||
|
RUMBLE_STATE_RESET
|
||||||
|
} RumbleState;
|
||||||
|
|
||||||
|
typedef struct RumbleMgr {
|
||||||
|
/* 0x000 */ u8 rumbleEnable[MAXCONTROLLERS];
|
||||||
|
/* 0x004 */ u8 reqStrengths[RUMBLE_MAX_REQUESTS]; // Source strength modulated by distance to the source
|
||||||
|
/* 0x044 */ u8 reqDurations[RUMBLE_MAX_REQUESTS]; // Duration until decreaseRate kicks in
|
||||||
|
/* 0x084 */ u8 reqDecreaseRates[RUMBLE_MAX_REQUESTS]; // Decreases the strength by this much every Vertical Retrace, once the strength hits 0 the request slot is freed
|
||||||
|
/* 0x0C4 */ u8 reqAccumulators[RUMBLE_MAX_REQUESTS]; // Starts at 0, incremented by the strength every Vertical Retrace
|
||||||
|
/* 0x104 */ u8 state;
|
||||||
|
/* 0x105 */ u8 updateEnabled;
|
||||||
|
/* 0x106 */ u16 onTimer; // Duration for which there has been an active rumble request running
|
||||||
|
/* 0x108 */ u16 offTimer; // Duration for which there has not been an active rumble request running, capped at 5
|
||||||
|
/* 0x10A */ u8 overrideStrength; // overrides requests with these parameters
|
||||||
|
/* 0x10B */ u8 overrideDuration;
|
||||||
|
/* 0x10C */ u8 overrideDecreaseRate;
|
||||||
|
/* 0x10D */ u8 overrideAccumulator;
|
||||||
|
} RumbleMgr; // size = 0x10E
|
||||||
|
|
||||||
|
// internal
|
||||||
|
|
||||||
|
void RumbleMgr_Init(RumbleMgr* rumbleMgr);
|
||||||
|
void RumbleMgr_Destroy(RumbleMgr* rumbleMgr);
|
||||||
|
void RumbleMgr_Update(RumbleMgr* rumbleMgr);
|
||||||
|
|
||||||
|
// external
|
||||||
|
|
||||||
|
void Rumble_Override(f32 distSq, u8 sourceStrength, u8 duration, u8 decreaseRate);
|
||||||
|
void Rumble_Request(f32 distSq, u8 sourceStrength, u8 duration, u8 decreaseRate);
|
||||||
|
|
||||||
|
void Rumble_Init(void);
|
||||||
|
void Rumble_Destroy(void);
|
||||||
|
|
||||||
|
s32 Rumble_Controller1HasRumblePak(void);
|
||||||
|
|
||||||
|
void Rumble_Reset(void);
|
||||||
|
void Rumble_ClearRequests(void);
|
||||||
|
|
||||||
|
void Rumble_SetUpdateEnabled(u32 enable);
|
||||||
|
|
||||||
|
#endif
|
|
@ -33,6 +33,7 @@
|
||||||
#include "ichain.h"
|
#include "ichain.h"
|
||||||
#include "regs.h"
|
#include "regs.h"
|
||||||
#include "gfx.h"
|
#include "gfx.h"
|
||||||
|
#include "rumble.h"
|
||||||
|
|
||||||
#if defined(__LP64__)
|
#if defined(__LP64__)
|
||||||
#define _SOH64
|
#define _SOH64
|
||||||
|
@ -2239,22 +2240,6 @@ typedef struct {
|
||||||
/* 0x0084 */ u32 unk_84;
|
/* 0x0084 */ u32 unk_84;
|
||||||
} ViMode;
|
} ViMode;
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
/* 0x000 */ u8 rumbleEnable[4];
|
|
||||||
/* 0x004 */ u8 unk_04[0x40];
|
|
||||||
/* 0x044 */ u8 unk_44[0x40];
|
|
||||||
/* 0x084 */ u8 unk_84[0x40];
|
|
||||||
/* 0x0C4 */ u8 unk_C4[0x40];
|
|
||||||
/* 0x104 */ u8 unk_104;
|
|
||||||
/* 0x105 */ u8 unk_105;
|
|
||||||
/* 0x106 */ u16 unk_106;
|
|
||||||
/* 0x108 */ u16 unk_108;
|
|
||||||
/* 0x10A */ u8 unk_10A;
|
|
||||||
/* 0x10B */ u8 unk_10B;
|
|
||||||
/* 0x10C */ u8 unk_10C;
|
|
||||||
/* 0x10D */ u8 unk_10D;
|
|
||||||
} UnkRumbleStruct; // size = 0x10E
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/* 0x00 */ char unk_00[0x18];
|
/* 0x00 */ char unk_00[0x18];
|
||||||
/* 0x18 */ s32 unk_18;
|
/* 0x18 */ s32 unk_18;
|
||||||
|
|
|
@ -1,120 +0,0 @@
|
||||||
#include "global.h"
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
void func_800D2E30(UnkRumbleStruct* arg0) {
|
|
||||||
static u8 D_8012DBB0 = 1;
|
|
||||||
s32 i;
|
|
||||||
s32 unk_a3;
|
|
||||||
s32 index = -1;
|
|
||||||
|
|
||||||
for (i = 0; i < 4; i++) {
|
|
||||||
arg0->rumbleEnable[i] = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (arg0->unk_105 == 0) {
|
|
||||||
if (D_8012DBB0 != 0) {
|
|
||||||
for (i = 0; i < 4; i++) {
|
|
||||||
gPadMgr.pakType[i] = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
D_8012DBB0 = arg0->unk_105;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
D_8012DBB0 = arg0->unk_105;
|
|
||||||
|
|
||||||
if (arg0->unk_104 == 2) {
|
|
||||||
for (i = 0; i < 4; ++i) {
|
|
||||||
gPadMgr.pakType[i] = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < 0x40; i++) {
|
|
||||||
arg0->unk_C4[i] = 0;
|
|
||||||
arg0->unk_84[i] = 0;
|
|
||||||
arg0->unk_44[i] = 0;
|
|
||||||
arg0->unk_04[i] = 0;
|
|
||||||
}
|
|
||||||
arg0->unk_106 = arg0->unk_108 = arg0->unk_10A = arg0->unk_10B = arg0->unk_10C = arg0->unk_10D = 0;
|
|
||||||
arg0->unk_104 = 1;
|
|
||||||
}
|
|
||||||
if (arg0->unk_104 != 0) {
|
|
||||||
for (i = 0; i < 0x40; i++) {
|
|
||||||
if (arg0->unk_04[i] != 0) {
|
|
||||||
if (arg0->unk_44[i] > 0) {
|
|
||||||
arg0->unk_44[i]--;
|
|
||||||
} else {
|
|
||||||
unk_a3 = arg0->unk_04[i] - arg0->unk_84[i];
|
|
||||||
if (unk_a3 > 0) {
|
|
||||||
arg0->unk_04[i] = unk_a3;
|
|
||||||
} else {
|
|
||||||
arg0->unk_04[i] = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
unk_a3 = arg0->unk_C4[i] + arg0->unk_04[i];
|
|
||||||
arg0->unk_C4[i] = unk_a3;
|
|
||||||
if (index == -1) {
|
|
||||||
index = i;
|
|
||||||
arg0->rumbleEnable[0] = (unk_a3 >= 0x100);
|
|
||||||
} else if (arg0->unk_04[index] < arg0->unk_04[i]) {
|
|
||||||
index = i;
|
|
||||||
arg0->rumbleEnable[0] = (unk_a3 >= 0x100);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (arg0->unk_10A != 0) {
|
|
||||||
if (arg0->unk_10B > 0) {
|
|
||||||
arg0->unk_10B--;
|
|
||||||
} else {
|
|
||||||
unk_a3 = arg0->unk_10A - arg0->unk_10C;
|
|
||||||
if (unk_a3 > 0) {
|
|
||||||
arg0->unk_10A = unk_a3;
|
|
||||||
} else {
|
|
||||||
arg0->unk_10A = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
unk_a3 = arg0->unk_10D + arg0->unk_10A;
|
|
||||||
arg0->unk_10D = unk_a3;
|
|
||||||
arg0->rumbleEnable[0] = (unk_a3 >= 0x100);
|
|
||||||
}
|
|
||||||
if (arg0->unk_10A != 0) {
|
|
||||||
unk_a3 = arg0->unk_10A;
|
|
||||||
} else {
|
|
||||||
if (index == -1) {
|
|
||||||
unk_a3 = 0;
|
|
||||||
} else {
|
|
||||||
unk_a3 = arg0->unk_04[index];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (unk_a3 == 0) {
|
|
||||||
if ((++arg0->unk_108) >= 6) {
|
|
||||||
arg0->unk_106 = 0;
|
|
||||||
arg0->unk_108 = 5;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
arg0->unk_108 = 0;
|
|
||||||
if ((++arg0->unk_106) >= 0x1C21) {
|
|
||||||
arg0->unk_104 = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
for (i = 0; i < 0x40; i++) {
|
|
||||||
arg0->unk_C4[i] = 0;
|
|
||||||
arg0->unk_84[i] = 0;
|
|
||||||
arg0->unk_44[i] = 0;
|
|
||||||
arg0->unk_04[i] = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
arg0->unk_106 = arg0->unk_108 = arg0->unk_10A = arg0->unk_10B = arg0->unk_10C = arg0->unk_10D = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void func_800D3140(UnkRumbleStruct* arg0) {
|
|
||||||
memset(arg0, 0, sizeof(UnkRumbleStruct));
|
|
||||||
arg0->unk_104 = 2;
|
|
||||||
arg0->unk_105 = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
void func_800D3178(UnkRumbleStruct* arg0) {
|
|
||||||
memset(arg0, 0, sizeof(UnkRumbleStruct));
|
|
||||||
}
|
|
|
@ -1,6 +1,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "vt.h"
|
#include "vt.h"
|
||||||
|
#include "rumble.h"
|
||||||
#include "libultraship/bridge.h"
|
#include "libultraship/bridge.h"
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
||||||
|
@ -450,7 +451,7 @@ void GameState_Init(GameState* gameState, GameStateFunc init, GraphicsContext* g
|
||||||
ViMode_Init(&sViMode);
|
ViMode_Init(&sViMode);
|
||||||
}
|
}
|
||||||
SpeedMeter_Init(&D_801664D0);
|
SpeedMeter_Init(&D_801664D0);
|
||||||
func_800AA0B4();
|
Rumble_Init();
|
||||||
osSendMesgPtr(&gameState->gfxCtx->queue, NULL, OS_MESG_BLOCK);
|
osSendMesgPtr(&gameState->gfxCtx->queue, NULL, OS_MESG_BLOCK);
|
||||||
|
|
||||||
endTime = osGetTime();
|
endTime = osGetTime();
|
||||||
|
@ -471,7 +472,7 @@ void GameState_Destroy(GameState* gameState) {
|
||||||
if (gameState->destroy != NULL) {
|
if (gameState->destroy != NULL) {
|
||||||
gameState->destroy(gameState);
|
gameState->destroy(gameState);
|
||||||
}
|
}
|
||||||
func_800AA0F0();
|
Rumble_Destroy();
|
||||||
SpeedMeter_Destroy(&D_801664D0);
|
SpeedMeter_Destroy(&D_801664D0);
|
||||||
VisCvg_Destroy(&sVisCvg);
|
VisCvg_Destroy(&sVisCvg);
|
||||||
VisZBuf_Destroy(&sVisZBuf);
|
VisZBuf_Destroy(&sVisZBuf);
|
||||||
|
|
|
@ -1,38 +1,106 @@
|
||||||
#include "global.h"
|
/**
|
||||||
#include "vt.h"
|
* @file padmgr.c
|
||||||
#include <string.h>
|
*
|
||||||
|
* This file implements communicating with joybus devices at a high level and serving the results to other threads.
|
||||||
|
*
|
||||||
|
* Any device that can be plugged into one of the four controller ports such as a standard N64 controller is a joybus
|
||||||
|
* device. Some joybus devices are also located inside the cartridge such as EEPROM for save data or the Real-Time
|
||||||
|
* Clock, however neither of these are used in Zelda64 and so this type of communication is unimplemented. Of the
|
||||||
|
* possible devices that can be plugged into the controller ports, the only device that padmgr will recognize and
|
||||||
|
* attempt to communicate with is the standard N64 controller.
|
||||||
|
*
|
||||||
|
* Communicating with these devices is broken down into various layers:
|
||||||
|
*
|
||||||
|
* Other threads : The rest of the program that will use the polled data
|
||||||
|
* |
|
||||||
|
* PadMgr : Manages devices, submits polling commands at vertical retrace
|
||||||
|
* |
|
||||||
|
* Libultra osCont* routines : Interface for building commands and safely using the Serial Interface
|
||||||
|
* |
|
||||||
|
* Serial Interface : Hardware unit for sending joybus commands and receiving data via DMA
|
||||||
|
* |
|
||||||
|
* PIF : Forwards joybus commands and receives response data from the devices
|
||||||
|
* |---¬---¬---¬-------¬
|
||||||
|
* 1 2 3 4 5 : The joybus devices plugged into the four controller ports or on the cartridge
|
||||||
|
*
|
||||||
|
* Joybus communication is handled on another thread as polling and receiving controller data is a slow process; the
|
||||||
|
* N64 programming manual section 26.2.4.1 quotes 2 milliseconds as the expected delay from calling
|
||||||
|
* `osContStartReadData` to receiving the data. By running this on a separate thread to the game state, work can be
|
||||||
|
* done while waiting for this operation to complete.
|
||||||
|
*/
|
||||||
|
#include "libu64/debug.h"
|
||||||
|
#include "libu64/padsetup.h"
|
||||||
|
#include "array_count.h"
|
||||||
|
#include "padmgr.h"
|
||||||
|
#include "printf.h"
|
||||||
|
#include "fault.h"
|
||||||
|
#include "terminal.h"
|
||||||
|
#include "translation.h"
|
||||||
|
#include "line_numbers.h"
|
||||||
|
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
||||||
#include "soh/Enhancements/controls/Mouse.h"
|
#include "soh/Enhancements/controls/Mouse.h"
|
||||||
#include "soh/OTRGlobals.h"
|
#include "soh/OTRGlobals.h"
|
||||||
#include "soh/ResourceManagerHelpers.h"
|
#include "soh/ResourceManagerHelpers.h"
|
||||||
|
|
||||||
s32 D_8012D280 = 1;
|
#define PADMGR_LOG(controllerNum, msg) (void)0
|
||||||
|
|
||||||
|
|
||||||
|
#define LOG_SEVERITY_NOLOG 0
|
||||||
|
#define LOG_SEVERITY_CRITICAL 1
|
||||||
|
#define LOG_SEVERITY_ERROR 2
|
||||||
|
#define LOG_SEVERITY_VERBOSE 3
|
||||||
|
|
||||||
|
s32 gPadMgrLogSeverity = LOG_SEVERITY_CRITICAL;
|
||||||
void OTRControllerCallback(uint8_t rumble);
|
void OTRControllerCallback(uint8_t rumble);
|
||||||
|
|
||||||
OSMesgQueue* PadMgr_LockSerialMesgQueue(PadMgr* padMgr) {
|
/**
|
||||||
OSMesgQueue* ctrlrQ = NULL;
|
* Acquires exclusive access to the serial event queue.
|
||||||
|
*
|
||||||
|
* When a DMA to/from PIF RAM completes, an SI interrupt is generated to notify the process that the DMA has completed
|
||||||
|
* and a message is posted to the serial event queue. If multiple processes are trying to use the SI at the same time
|
||||||
|
* it becomes ambiguous as to which DMA has completed, so a locking system is required to arbitrate access to the SI.
|
||||||
|
*
|
||||||
|
* Once the task requiring the serial event queue is complete, it should be released with a call to
|
||||||
|
* `PadMgr_ReleaseSerialEventQueue()`.
|
||||||
|
*
|
||||||
|
* If another process tries to acquire the event queue, the current thread will be blocked until the event queue is
|
||||||
|
* released. Note the possibility for a deadlock, if the thread that already holds the serial event queue attempts to
|
||||||
|
* acquire it again it will block forever.
|
||||||
|
*
|
||||||
|
* @return The message queue to which SI interrupt events are posted.
|
||||||
|
*
|
||||||
|
* @see PadMgr_ReleaseSerialEventQueue
|
||||||
|
*/
|
||||||
|
OSMesgQueue* PadMgr_AcquireSerialEventQueue(PadMgr* padMgr) {
|
||||||
|
OSMesgQueue* serialEventQueue = NULL;
|
||||||
|
|
||||||
if (D_8012D280 > 2) {
|
if (gPadMgrLogSeverity >= LOG_SEVERITY_VERBOSE) {
|
||||||
// "serialMsgQ Waiting for lock"
|
// "serialMsgQ Waiting for lock"
|
||||||
osSyncPrintf("%2d %d serialMsgQロック待ち %08x %08x %08x\n", osGetThreadId(NULL),
|
osSyncPrintf("%2d %d serialMsgQロック待ち %08x %08x %08x\n", osGetThreadId(NULL),
|
||||||
padMgr->serialMsgQ.validCount, padMgr, &padMgr->serialMsgQ, &ctrlrQ);
|
padMgr->serialMsgQ.validCount, padMgr, &padMgr->serialMsgQ, &ctrlrQ);
|
||||||
}
|
}
|
||||||
|
|
||||||
osRecvMesg(&padMgr->serialMsgQ, (OSMesg*)&ctrlrQ, OS_MESG_BLOCK);
|
osRecvMesg(&padMgr->serialLockQueue, (OSMesg*)&serialEventQueue, OS_MESG_BLOCK);
|
||||||
|
|
||||||
if (D_8012D280 > 2) {
|
if (gPadMgrLogSeverity >= LOG_SEVERITY_VERBOSE) {
|
||||||
// "serialMsgQ Locked"
|
// "serialMsgQ Locked"
|
||||||
osSyncPrintf("%2d %d serialMsgQをロックしました %08x\n", osGetThreadId(NULL),
|
osSyncPrintf("%2d %d serialMsgQをロックしました %08x\n", osGetThreadId(NULL),
|
||||||
padMgr->serialMsgQ.validCount, ctrlrQ);
|
padMgr->serialMsgQ.validCount, ctrlrQ);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ctrlrQ;
|
return serialEventQueue;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PadMgr_UnlockSerialMesgQueue(PadMgr* padMgr, OSMesgQueue* ctrlrQ) {
|
/**
|
||||||
if (D_8012D280 > 2) {
|
* Relinquishes access to the serial message queue, allowing another process to acquire and use it.
|
||||||
|
*
|
||||||
|
* @param serialEventQueue The serial message queue acquired by `PadMgr_AcquireSerialEventQueue`
|
||||||
|
*
|
||||||
|
* @see PadMgr_AcquireSerialEventQueue
|
||||||
|
*/
|
||||||
|
void PadMgr_ReleaseSerialEventQueue(PadMgr* padMgr, OSMesgQueue* serialEventQueue) {
|
||||||
|
if (gPadMgrLogSeverity >= LOG_SEVERITY_VERBOSE) {
|
||||||
// "serialMsgQ Unlock"
|
// "serialMsgQ Unlock"
|
||||||
osSyncPrintf("%2d %d serialMsgQロック解除します %08x %08x %08x\n", osGetThreadId(NULL),
|
osSyncPrintf("%2d %d serialMsgQロック解除します %08x %08x %08x\n", osGetThreadId(NULL),
|
||||||
padMgr->serialMsgQ.validCount, padMgr, &padMgr->serialMsgQ, ctrlrQ);
|
padMgr->serialMsgQ.validCount, padMgr, &padMgr->serialMsgQ, ctrlrQ);
|
||||||
|
@ -40,7 +108,7 @@ void PadMgr_UnlockSerialMesgQueue(PadMgr* padMgr, OSMesgQueue* ctrlrQ) {
|
||||||
|
|
||||||
osSendMesgPtr(&padMgr->serialMsgQ, ctrlrQ, OS_MESG_BLOCK);
|
osSendMesgPtr(&padMgr->serialMsgQ, ctrlrQ, OS_MESG_BLOCK);
|
||||||
|
|
||||||
if (D_8012D280 > 2) {
|
if (gPadMgrLogSeverity >= LOG_SEVERITY_VERBOSE) {
|
||||||
// "serialMsgQ Unlocked"
|
// "serialMsgQ Unlocked"
|
||||||
osSyncPrintf("%2d %d serialMsgQロック解除しました %08x %08x %08x\n", osGetThreadId(NULL),
|
osSyncPrintf("%2d %d serialMsgQロック解除しました %08x %08x %08x\n", osGetThreadId(NULL),
|
||||||
padMgr->serialMsgQ.validCount, padMgr, &padMgr->serialMsgQ, ctrlrQ);
|
padMgr->serialMsgQ.validCount, padMgr, &padMgr->serialMsgQ, ctrlrQ);
|
||||||
|
|
154
soh/src/code/sys_rumble.c
Normal file
154
soh/src/code/sys_rumble.c
Normal file
|
@ -0,0 +1,154 @@
|
||||||
|
/**
|
||||||
|
* @file sys_rumble.c
|
||||||
|
*
|
||||||
|
* This file implements a manager for storing and processing rumble pak requests made by the game state. Despite some
|
||||||
|
* parts of the system appearing to accommodate all four controller ports, only controller 1 will rumble according to
|
||||||
|
* the processed requests.
|
||||||
|
* This file is half of the system that runs on the padmgr thread alongside controller communications. The rest of the
|
||||||
|
* system that receives the requests from the game state runs on the graph thread and is implemented in `z_rumble.c`.
|
||||||
|
*
|
||||||
|
* @see RumbleMgr
|
||||||
|
* @see z_rumble.c
|
||||||
|
*
|
||||||
|
* @note Original filename is likely sys_vibrate.c or similar as it is ordered after sys_ucode.c
|
||||||
|
*/
|
||||||
|
#include "rumble.h"
|
||||||
|
#include "padmgr.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rumble manager update, runs on Vertical Retrace on the padmgr thread.
|
||||||
|
*/
|
||||||
|
void RumbleMgr_Update(RumbleMgr* rumbleMgr) {
|
||||||
|
static u8 sWasEnabled = true;
|
||||||
|
s32 i;
|
||||||
|
s32 strength;
|
||||||
|
s32 strongestIndex = -1;
|
||||||
|
|
||||||
|
// Clear enable status for all controllers
|
||||||
|
for (i = 0; i < MAXCONTROLLERS; i++) {
|
||||||
|
rumbleMgr->rumbleEnable[i] = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!rumbleMgr->updateEnabled) {
|
||||||
|
if (sWasEnabled) {
|
||||||
|
// If it was previously enabled, reset pak type
|
||||||
|
for (i = 0; i < MAXCONTROLLERS; i++) {
|
||||||
|
gPadMgr.pakType[i] = CONT_PAK_NONE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sWasEnabled = rumbleMgr->updateEnabled;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
sWasEnabled = rumbleMgr->updateEnabled;
|
||||||
|
|
||||||
|
if (rumbleMgr->state == RUMBLE_STATE_RESET) {
|
||||||
|
// Reset
|
||||||
|
for (i = 0; i < MAXCONTROLLERS; i++) {
|
||||||
|
gPadMgr.pakType[i] = CONT_PAK_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < RUMBLE_MAX_REQUESTS; i++) {
|
||||||
|
rumbleMgr->reqAccumulators[i] = 0;
|
||||||
|
rumbleMgr->reqDecreaseRates[i] = 0;
|
||||||
|
rumbleMgr->reqDurations[i] = 0;
|
||||||
|
rumbleMgr->reqStrengths[i] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
rumbleMgr->onTimer = rumbleMgr->offTimer = rumbleMgr->overrideStrength = rumbleMgr->overrideDuration =
|
||||||
|
rumbleMgr->overrideDecreaseRate = rumbleMgr->overrideAccumulator = 0;
|
||||||
|
|
||||||
|
rumbleMgr->state = RUMBLE_STATE_RUNNING;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rumbleMgr->state != RUMBLE_STATE_CLEAR) {
|
||||||
|
// Search for index with largest strength
|
||||||
|
for (i = 0; i < RUMBLE_MAX_REQUESTS; i++) {
|
||||||
|
if (rumbleMgr->reqStrengths[i] != 0) {
|
||||||
|
// Non-empty request slot
|
||||||
|
if (rumbleMgr->reqDurations[i] > 0) {
|
||||||
|
rumbleMgr->reqDurations[i]--;
|
||||||
|
} else {
|
||||||
|
// After duration, decrease the strength by the decrease rate
|
||||||
|
strength = rumbleMgr->reqStrengths[i] - rumbleMgr->reqDecreaseRates[i];
|
||||||
|
rumbleMgr->reqStrengths[i] = MAX(strength, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Increment accumulator by the strength
|
||||||
|
strength = rumbleMgr->reqAccumulators[i] + rumbleMgr->reqStrengths[i];
|
||||||
|
rumbleMgr->reqAccumulators[i] = strength;
|
||||||
|
|
||||||
|
if (strongestIndex == -1) {
|
||||||
|
strongestIndex = i;
|
||||||
|
// Rumble is enabled on the controller only when there is overflow of the accumulator, overflow
|
||||||
|
// will happen more often for larger request strengths making it feel stronger to the player
|
||||||
|
rumbleMgr->rumbleEnable[0] = strength > 255;
|
||||||
|
} else if (rumbleMgr->reqStrengths[i] > rumbleMgr->reqStrengths[strongestIndex]) {
|
||||||
|
strongestIndex = i;
|
||||||
|
rumbleMgr->rumbleEnable[0] = strength > 255;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rumbleMgr->overrideStrength != 0) {
|
||||||
|
// Set override
|
||||||
|
if (rumbleMgr->overrideDuration > 0) {
|
||||||
|
rumbleMgr->overrideDuration--;
|
||||||
|
} else {
|
||||||
|
// Once the duration is over, start decrementing the strength
|
||||||
|
strength = rumbleMgr->overrideStrength - rumbleMgr->overrideDecreaseRate;
|
||||||
|
rumbleMgr->overrideStrength = MAX(strength, 0);
|
||||||
|
}
|
||||||
|
// Increment accumulator, set rumble enabled on overflow
|
||||||
|
strength = rumbleMgr->overrideAccumulator + rumbleMgr->overrideStrength;
|
||||||
|
rumbleMgr->overrideAccumulator = strength;
|
||||||
|
rumbleMgr->rumbleEnable[0] = strength > 255;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rumbleMgr->overrideStrength != 0) {
|
||||||
|
strength = rumbleMgr->overrideStrength;
|
||||||
|
} else {
|
||||||
|
strength = (strongestIndex == -1) ? 0 : rumbleMgr->reqStrengths[strongestIndex];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strength == 0) {
|
||||||
|
// No rumble
|
||||||
|
if ((++rumbleMgr->offTimer) > 5) {
|
||||||
|
// After 5 VIs with no rumble, reset the rumble on timer
|
||||||
|
rumbleMgr->onTimer = 0;
|
||||||
|
rumbleMgr->offTimer = 5;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Rumble
|
||||||
|
rumbleMgr->offTimer = 0;
|
||||||
|
if ((++rumbleMgr->onTimer) > 7200) { // 2 minutes at 60 VI/s, 2 minutes 24 seconds at 50 VI/s
|
||||||
|
// Clear all requests if rumble has been on for too long
|
||||||
|
rumbleMgr->state = RUMBLE_STATE_CLEAR;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Clear all requests
|
||||||
|
for (i = 0; i < RUMBLE_MAX_REQUESTS; i++) {
|
||||||
|
rumbleMgr->reqAccumulators[i] = 0;
|
||||||
|
rumbleMgr->reqDecreaseRates[i] = 0;
|
||||||
|
rumbleMgr->reqDurations[i] = 0;
|
||||||
|
rumbleMgr->reqStrengths[i] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Clear override request
|
||||||
|
rumbleMgr->onTimer = rumbleMgr->offTimer = rumbleMgr->overrideStrength = rumbleMgr->overrideDuration =
|
||||||
|
rumbleMgr->overrideDecreaseRate = rumbleMgr->overrideAccumulator = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void RumbleMgr_Init(RumbleMgr* rumbleMgr) {
|
||||||
|
bzero(rumbleMgr, sizeof(RumbleMgr));
|
||||||
|
rumbleMgr->state = RUMBLE_STATE_RESET;
|
||||||
|
rumbleMgr->updateEnabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void RumbleMgr_Destroy(RumbleMgr* rumbleMgr) {
|
||||||
|
#if DEBUG_FEATURES
|
||||||
|
bzero(rumbleMgr, sizeof(RumbleMgr));
|
||||||
|
#endif
|
||||||
|
}
|
|
@ -1,5 +1,6 @@
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "vt.h"
|
#include "vt.h"
|
||||||
|
#include "rumble.h"
|
||||||
|
|
||||||
#include "overlays/actors/ovl_Arms_Hook/z_arms_hook.h"
|
#include "overlays/actors/ovl_Arms_Hook/z_arms_hook.h"
|
||||||
#include "overlays/actors/ovl_En_Arrow/z_en_arrow.h"
|
#include "overlays/actors/ovl_En_Arrow/z_en_arrow.h"
|
||||||
|
@ -4137,11 +4138,11 @@ void func_80033E1C(PlayState* play, s16 arg1, s16 arg2, s16 arg3) {
|
||||||
Quake_SetCountdown(var, arg2);
|
Quake_SetCountdown(var, arg2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_80033E88(Actor* actor, PlayState* play, s16 arg2, s16 arg3) {
|
void Actor_RequestQuakeAndRumble(Actor* actor, PlayState* play, s16 quakeY, s16 quakeDuration) {
|
||||||
if (arg2 >= 5) {
|
if (quakeY >= 5) {
|
||||||
func_800AA000(actor->xyzDistToPlayerSq, 0xFF, 0x14, 0x96);
|
Rumble_Request(actor->xyzDistToPlayerSq, 255, 20, 150);
|
||||||
} else {
|
} else {
|
||||||
func_800AA000(actor->xyzDistToPlayerSq, 0xB4, 0x14, 0x64);
|
Rumble_Request(actor->xyzDistToPlayerSq, 180, 20, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
func_80033DB8(play, arg2, arg3);
|
func_80033DB8(play, arg2, arg3);
|
||||||
|
|
|
@ -573,9 +573,11 @@ void Regs_InitDataImpl(void) {
|
||||||
VREG(87) = 64;
|
VREG(87) = 64;
|
||||||
VREG(88) = 66;
|
VREG(88) = 66;
|
||||||
VREG(89) = 0;
|
VREG(89) = 0;
|
||||||
VREG(90) = 126;
|
R_GAME_OVER_RUMBLE_STRENGTH = 126;
|
||||||
VREG(91) = 124;
|
R_GAME_OVER_RUMBLE_DURATION = 124;
|
||||||
VREG(92) = -63;
|
//! @bug This is eventually cast to a u8 after some scaling in `GameOver_Update`, negative numbers typically
|
||||||
|
//! become large (fast) decrease rates
|
||||||
|
R_GAME_OVER_RUMBLE_DECREASE_RATE = -63;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Regs_InitData(PlayState* play) {
|
void Regs_InitData(PlayState* play) {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
|
#include "rumble.h"
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -202,7 +203,7 @@ void func_8006390C(Input* input) {
|
||||||
}
|
}
|
||||||
if (iREG(0)) {
|
if (iREG(0)) {
|
||||||
iREG(0) = 0;
|
iREG(0) = 0;
|
||||||
func_800AA000(0, iREG(1), iREG(2), iREG(3));
|
Rumble_Request(0.0f, iREG(1), iREG(2), iREG(3));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "z64camera.h"
|
#include "z64camera.h"
|
||||||
|
#include "rumble.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
@ -473,7 +474,7 @@ void Cutscene_Command_FadeBGM(PlayState* play, CutsceneContext* csCtx, CsCmdMusi
|
||||||
// Command 9: ?
|
// Command 9: ?
|
||||||
void Cutscene_Command_09(PlayState* play, CutsceneContext* csCtx, CsCmdUnknown9* cmd) {
|
void Cutscene_Command_09(PlayState* play, CutsceneContext* csCtx, CsCmdUnknown9* cmd) {
|
||||||
if (csCtx->frames == cmd->startFrame) {
|
if (csCtx->frames == cmd->startFrame) {
|
||||||
func_800AA000(0.0f, cmd->unk_06, cmd->unk_07, cmd->unk_08);
|
Rumble_Request(0.0f, cmd->unk_06, cmd->unk_07, cmd->unk_08);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
|
#include "rumble.h"
|
||||||
#include "soh/OTRGlobals.h"
|
#include "soh/OTRGlobals.h"
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
||||||
|
@ -23,9 +24,9 @@ void GameOver_Update(PlayState* play) {
|
||||||
GameOverContext* gameOverCtx = &play->gameOverCtx;
|
GameOverContext* gameOverCtx = &play->gameOverCtx;
|
||||||
s16 i;
|
s16 i;
|
||||||
s16 j;
|
s16 j;
|
||||||
s32 v90;
|
s32 rumbleStrength;
|
||||||
s32 v91;
|
s32 rumbleDuration;
|
||||||
s32 v92;
|
s32 rumbleDecreaseRate;
|
||||||
|
|
||||||
switch (gameOverCtx->state) {
|
switch (gameOverCtx->state) {
|
||||||
case GAMEOVER_DEATH_START:
|
case GAMEOVER_DEATH_START:
|
||||||
|
@ -82,12 +83,15 @@ void GameOver_Update(PlayState* play) {
|
||||||
|
|
||||||
Environment_InitGameOverLights(play);
|
Environment_InitGameOverLights(play);
|
||||||
gGameOverTimer = 20;
|
gGameOverTimer = 20;
|
||||||
v90 = VREG(90);
|
|
||||||
v91 = VREG(91);
|
|
||||||
v92 = VREG(92);
|
|
||||||
|
|
||||||
func_800AA000(0.0f, ((v90 > 0x64) ? 0xFF : (v90 * 0xFF) / 0x64), (CLAMP_MAX(v91 * 3, 0xFF)),
|
if (1) {}
|
||||||
((v92 > 0x64) ? 0xFF : (v92 * 0xFF) / 0x64));
|
rumbleStrength = R_GAME_OVER_RUMBLE_STRENGTH;
|
||||||
|
rumbleDuration = R_GAME_OVER_RUMBLE_DURATION;
|
||||||
|
rumbleDecreaseRate = R_GAME_OVER_RUMBLE_DECREASE_RATE;
|
||||||
|
|
||||||
|
Rumble_Request(0.0f, ((rumbleStrength > 100) ? 255 : (rumbleStrength * 255) / 100),
|
||||||
|
(CLAMP_MAX(rumbleDuration * 3, 255)),
|
||||||
|
((rumbleDecreaseRate > 100) ? 255 : (rumbleDecreaseRate * 255) / 100));
|
||||||
|
|
||||||
gameOverCtx->state = GAMEOVER_DEATH_WAIT_GROUND;
|
gameOverCtx->state = GAMEOVER_DEATH_WAIT_GROUND;
|
||||||
break;
|
break;
|
||||||
|
@ -101,7 +105,7 @@ void GameOver_Update(PlayState* play) {
|
||||||
if (gGameOverTimer == 0) {
|
if (gGameOverTimer == 0) {
|
||||||
play->pauseCtx.state = 8;
|
play->pauseCtx.state = 8;
|
||||||
gameOverCtx->state++;
|
gameOverCtx->state++;
|
||||||
func_800AA15C();
|
Rumble_Reset();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -116,12 +120,14 @@ void GameOver_Update(PlayState* play) {
|
||||||
gGameOverTimer = 50;
|
gGameOverTimer = 50;
|
||||||
gameOverCtx->state++;
|
gameOverCtx->state++;
|
||||||
|
|
||||||
v90 = VREG(90);
|
if (1) {}
|
||||||
v91 = VREG(91);
|
rumbleStrength = R_GAME_OVER_RUMBLE_STRENGTH;
|
||||||
v92 = VREG(92);
|
rumbleDuration = R_GAME_OVER_RUMBLE_DURATION;
|
||||||
|
rumbleDecreaseRate = R_GAME_OVER_RUMBLE_DECREASE_RATE;
|
||||||
|
|
||||||
func_800AA000(0.0f, ((v90 > 0x64) ? 0xFF : (v90 * 0xFF) / 0x64), (CLAMP_MAX(v91 * 3, 0xFF)),
|
Rumble_Request(0.0f, ((rumbleStrength > 100) ? 255 : (rumbleStrength * 255) / 100),
|
||||||
((v92 > 0x64) ? 0xFF : (v92 * 0xFF) / 0x64));
|
(CLAMP_MAX(rumbleDuration * 3, 255)),
|
||||||
|
((rumbleDecreaseRate > 100) ? 255 : (rumbleDecreaseRate * 255) / 100));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GAMEOVER_REVIVE_WAIT_GROUND:
|
case GAMEOVER_REVIVE_WAIT_GROUND:
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
|
#include "rumble.h"
|
||||||
#include <libultraship/libultra.h>
|
#include <libultraship/libultra.h>
|
||||||
#include "vt.h"
|
#include "vt.h"
|
||||||
#include "objects/gameplay_keep/gameplay_keep.h"
|
#include "objects/gameplay_keep/gameplay_keep.h"
|
||||||
|
@ -420,7 +421,7 @@ void Environment_Init(PlayState* play2, EnvironmentContext* envCtx, s32 unused)
|
||||||
}
|
}
|
||||||
|
|
||||||
gCustomLensFlareOn = false;
|
gCustomLensFlareOn = false;
|
||||||
func_800AA15C();
|
Rumble_Reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 Environment_SmoothStepToU8(u8* pvalue, u8 target, u8 scale, u8 step, u8 minStep) {
|
u8 Environment_SmoothStepToU8(u8* pvalue, u8 target, u8 scale, u8 step, u8 minStep) {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "vt.h"
|
#include "vt.h"
|
||||||
|
#include "rumble.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
@ -1164,7 +1165,7 @@ void Play_Update(PlayState* play) {
|
||||||
PLAY_LOG(3580);
|
PLAY_LOG(3580);
|
||||||
|
|
||||||
play->gameplayFrames++;
|
play->gameplayFrames++;
|
||||||
func_800AA178(true);
|
Rumble_SetUpdateEnabled(true);
|
||||||
|
|
||||||
// Gameplay stat tracking
|
// Gameplay stat tracking
|
||||||
if (!gSaveContext.ship.stats.gameComplete &&
|
if (!gSaveContext.ship.stats.gameComplete &&
|
||||||
|
@ -1227,7 +1228,7 @@ void Play_Update(PlayState* play) {
|
||||||
PLAY_LOG(3662);
|
PLAY_LOG(3662);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
func_800AA178(false);
|
Rumble_SetUpdateEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
PLAY_LOG(3672);
|
PLAY_LOG(3672);
|
||||||
|
|
138
soh/src/code/z_rumble.c
Normal file
138
soh/src/code/z_rumble.c
Normal file
|
@ -0,0 +1,138 @@
|
||||||
|
/**
|
||||||
|
* @file z_rumble.c
|
||||||
|
*
|
||||||
|
* This file implements an interface for the game state to set up, manage and request use of the rumble pak. Despite
|
||||||
|
* some parts of the system appearing to accommodate all four controller ports, only controller 1 can be instructed
|
||||||
|
* to rumble.
|
||||||
|
* This file is half of the system that runs on the graph thread alongside the game state. The rest of the system that
|
||||||
|
* processes the requests runs on the padmgr thread and is implemented in `sys_rumble.c`.
|
||||||
|
*
|
||||||
|
* @see sys_rumble.c
|
||||||
|
*
|
||||||
|
* @note Original filename is likely z_vibrate.c or similar as it is ordered after z_ss_sram.c and before z_view.c
|
||||||
|
*/
|
||||||
|
#include "rumble.h"
|
||||||
|
#include "padmgr.h"
|
||||||
|
#include "z_math.h"
|
||||||
|
|
||||||
|
static s32 sUnused[4];
|
||||||
|
RumbleMgr sRumbleMgr;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Padmgr callback to update the state of rumble on Vertical Retrace.
|
||||||
|
*
|
||||||
|
* Unlike every other function in this file, this runs on the padmgr thread.
|
||||||
|
*/
|
||||||
|
void Rumble_Update(PadMgr* padMgr, void* arg) {
|
||||||
|
RumbleMgr_Update(&sRumbleMgr);
|
||||||
|
PadMgr_RumbleSet(padMgr, sRumbleMgr.rumbleEnable);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Forces the rumble state to use the supplied parameters.
|
||||||
|
* The parameters are the same as in `Rumble_Request`.
|
||||||
|
*
|
||||||
|
* @see Rumble_Request
|
||||||
|
*/
|
||||||
|
void Rumble_Override(f32 distSq, u8 sourceStrength, u8 duration, u8 decreaseRate) {
|
||||||
|
s32 dist;
|
||||||
|
s32 strength;
|
||||||
|
|
||||||
|
if (distSq > SQ(1000)) {
|
||||||
|
dist = 1000;
|
||||||
|
} else {
|
||||||
|
dist = sqrtf(distSq);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dist < 1000 && sourceStrength != 0 && decreaseRate != 0) {
|
||||||
|
// Decrease the strength linearly with distance
|
||||||
|
strength = sourceStrength - (dist * 255) / 1000;
|
||||||
|
|
||||||
|
if (strength > 0) {
|
||||||
|
// Note: sRumbleMgr is a shared resource between the graph and padmgr threads, no locking is done
|
||||||
|
// to ensure that the entire request is written before it is possibly used.
|
||||||
|
sRumbleMgr.overrideStrength = strength;
|
||||||
|
sRumbleMgr.overrideDuration = duration;
|
||||||
|
sRumbleMgr.overrideDecreaseRate = decreaseRate;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Submits a request to the rumble manager with the properties given in the arguments. If there is no free request slot
|
||||||
|
* the request is silently dropped.
|
||||||
|
*
|
||||||
|
* @param distSq
|
||||||
|
* Squared distance, usually taken to be from an apparent source to the player in world coordinates.
|
||||||
|
* @param sourceStrength
|
||||||
|
* The strength of the rumble at 0 distance from the source.
|
||||||
|
* The rumble source strength decreases linearly with distance, a distance of 0 results in the full source strength
|
||||||
|
* while a distance of 1000 or greater is discarded. A source strength of 0 is discarded. A minimum source strength
|
||||||
|
* of 1 drops to 0 at 3 units of distance from the source. A maximum source strength of 255 drops to 0 at 1000
|
||||||
|
* units of distance from the source.
|
||||||
|
* Note that, once the request has been submitted, if the distance to the source changes in subsequent frames while
|
||||||
|
* the rumble request is still running, the request will not be updated with the new distance.
|
||||||
|
* @param duration
|
||||||
|
* The duration for which the rumble will sustain full strength. It is measured in Vertical Retraces rather than
|
||||||
|
* game frames. There are ~60 Retraces/s on NTSC and 50 Retraces/s on PAL.
|
||||||
|
* @param decreaseRate
|
||||||
|
* The amount by which to lower the strength every Vertical Retrace once duration has hit 0.
|
||||||
|
*/
|
||||||
|
void Rumble_Request(f32 distSq, u8 sourceStrength, u8 duration, u8 decreaseRate) {
|
||||||
|
s32 dist;
|
||||||
|
s32 strength;
|
||||||
|
s32 i;
|
||||||
|
|
||||||
|
if (distSq > SQ(1000)) {
|
||||||
|
dist = 1000;
|
||||||
|
} else {
|
||||||
|
dist = sqrtf(distSq);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dist < 1000 && sourceStrength != 0 && decreaseRate != 0) {
|
||||||
|
// Decrease the strength linearly with distance
|
||||||
|
strength = sourceStrength - (dist * 255) / 1000;
|
||||||
|
|
||||||
|
for (i = 0; i < RUMBLE_MAX_REQUESTS; i++) {
|
||||||
|
// Search for an empty slot
|
||||||
|
if (sRumbleMgr.reqStrengths[i] == 0) {
|
||||||
|
if (strength > 0) {
|
||||||
|
// Note: sRumbleMgr is a shared resource between the graph and padmgr threads, no locking is done
|
||||||
|
// to ensure that the entire request is written before it is possibly used.
|
||||||
|
sRumbleMgr.reqStrengths[i] = strength;
|
||||||
|
sRumbleMgr.reqDurations[i] = duration;
|
||||||
|
sRumbleMgr.reqDecreaseRates[i] = decreaseRate;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Rumble_Init(void) {
|
||||||
|
RumbleMgr_Init(&sRumbleMgr);
|
||||||
|
PADMGR_SET_RETRACE_CALLACK(&gPadMgr, Rumble_Update, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Rumble_Destroy(void) {
|
||||||
|
PadMgr* padmgr = &gPadMgr;
|
||||||
|
|
||||||
|
PADMGR_UNSET_RETRACE_CALLACK(padmgr, Rumble_Update, NULL);
|
||||||
|
RumbleMgr_Destroy(&sRumbleMgr);
|
||||||
|
}
|
||||||
|
|
||||||
|
s32 Rumble_Controller1HasRumblePak(void) {
|
||||||
|
return gPadMgr.pakType[0] == CONT_PAK_RUMBLE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Rumble_Reset(void) {
|
||||||
|
sRumbleMgr.state = RUMBLE_STATE_RESET;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Rumble_ClearRequests(void) {
|
||||||
|
sRumbleMgr.state = RUMBLE_STATE_CLEAR;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Rumble_SetUpdateEnabled(u32 enable) {
|
||||||
|
sRumbleMgr.updateEnabled = !!enable;
|
||||||
|
}
|
|
@ -5,6 +5,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "z_bg_bdan_objects.h"
|
#include "z_bg_bdan_objects.h"
|
||||||
|
|
||||||
|
#include "rumble.h"
|
||||||
|
|
||||||
#include "objects/object_bdan_objects/object_bdan_objects.h"
|
#include "objects/object_bdan_objects/object_bdan_objects.h"
|
||||||
|
|
||||||
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
|
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
|
||||||
|
@ -183,7 +186,7 @@ void func_8086C054(BgBdanObjects* this, PlayState* play) {
|
||||||
player->actor.world.pos.x = -1130.0f;
|
player->actor.world.pos.x = -1130.0f;
|
||||||
player->actor.world.pos.y = -1025.0f;
|
player->actor.world.pos.y = -1025.0f;
|
||||||
player->actor.world.pos.z = -3300.0f;
|
player->actor.world.pos.z = -3300.0f;
|
||||||
func_800AA000(0.0f, 0xFF, 0x14, 0x96);
|
Rumble_Request(0.0f, 255, 20, 150);
|
||||||
}
|
}
|
||||||
} else if (this->timer != 0) {
|
} else if (this->timer != 0) {
|
||||||
if (this->timer != 0) {
|
if (this->timer != 0) {
|
||||||
|
@ -208,13 +211,13 @@ void func_8086C1A0(BgBdanObjects* this, PlayState* play) {
|
||||||
this->actionFunc = func_8086C29C;
|
this->actionFunc = func_8086C29C;
|
||||||
this->timer = 30;
|
this->timer = 30;
|
||||||
BgBdanObjects_SetContactRu1(this, 2);
|
BgBdanObjects_SetContactRu1(this, 2);
|
||||||
func_800AA000(0.0f, 0xFF, 0x14, 0x96);
|
Rumble_Request(0.0f, 255, 20, 150);
|
||||||
} else {
|
} else {
|
||||||
if (this->timer != 0) {
|
if (this->timer != 0) {
|
||||||
this->timer--;
|
this->timer--;
|
||||||
}
|
}
|
||||||
if (this->timer == 0) {
|
if (this->timer == 0) {
|
||||||
func_800AA000(0.0f, 0x78, 0x14, 0xA);
|
Rumble_Request(0.0f, 120, 20, 10);
|
||||||
this->timer = 11;
|
this->timer = 11;
|
||||||
}
|
}
|
||||||
func_8002F974(&this->dyna.actor, NA_SE_EV_BUYOSTAND_RISING - SFX_FLAG);
|
func_8002F974(&this->dyna.actor, NA_SE_EV_BUYOSTAND_RISING - SFX_FLAG);
|
||||||
|
@ -262,14 +265,14 @@ void func_8086C3D8(BgBdanObjects* this, PlayState* play) {
|
||||||
player->actor.world.pos.z = -3500.0f;
|
player->actor.world.pos.z = -3500.0f;
|
||||||
player->actor.shape.rot.y = 0x7530;
|
player->actor.shape.rot.y = 0x7530;
|
||||||
player->actor.world.rot.y = player->actor.shape.rot.y;
|
player->actor.world.rot.y = player->actor.shape.rot.y;
|
||||||
func_800AA000(0.0f, 0xFF, 0x1E, 0x96);
|
Rumble_Request(0.0f, 255, 30, 150);
|
||||||
} else {
|
} else {
|
||||||
func_8002F974(&this->dyna.actor, NA_SE_EV_BUYOSTAND_FALL - SFX_FLAG);
|
func_8002F974(&this->dyna.actor, NA_SE_EV_BUYOSTAND_FALL - SFX_FLAG);
|
||||||
if (this->timer != 0) {
|
if (this->timer != 0) {
|
||||||
this->timer--;
|
this->timer--;
|
||||||
}
|
}
|
||||||
if (this->timer == 0) {
|
if (this->timer == 0) {
|
||||||
func_800AA000(0.0f, 0x78, 0x14, 0xA);
|
Rumble_Request(0.0f, 120, 20, 10);
|
||||||
this->timer = 11;
|
this->timer = 11;
|
||||||
}
|
}
|
||||||
if (this->dyna.actor.child != NULL) {
|
if (this->dyna.actor.child != NULL) {
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "z_bg_bdan_switch.h"
|
#include "z_bg_bdan_switch.h"
|
||||||
|
|
||||||
|
#include "rumble.h"
|
||||||
|
|
||||||
#include "objects/object_bdan_objects/object_bdan_objects.h"
|
#include "objects/object_bdan_objects/object_bdan_objects.h"
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
||||||
|
|
||||||
|
@ -278,7 +281,7 @@ void func_8086D694(BgBdanSwitch* this, PlayState* play) {
|
||||||
if (this->unk_1C8 <= 0.1f) {
|
if (this->unk_1C8 <= 0.1f) {
|
||||||
func_8086D730(this);
|
func_8086D730(this);
|
||||||
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_FOOT_SWITCH);
|
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_FOOT_SWITCH);
|
||||||
func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 0x78, 0x14, 0xA);
|
Rumble_Request(this->dyna.actor.xyzDistToPlayerSq, 120, 20, 10);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -341,7 +344,7 @@ void func_8086D8CC(BgBdanSwitch* this, PlayState* play) {
|
||||||
if (this->unk_1C8 <= 0.6f) {
|
if (this->unk_1C8 <= 0.6f) {
|
||||||
func_8086D9F8(this);
|
func_8086D9F8(this);
|
||||||
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_FOOT_SWITCH);
|
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_FOOT_SWITCH);
|
||||||
func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 0x78, 0x14, 0xA);
|
Rumble_Request(this->dyna.actor.xyzDistToPlayerSq, 120, 20, 10);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -356,7 +359,7 @@ void func_8086D95C(BgBdanSwitch* this, PlayState* play) {
|
||||||
if (this->unk_1C8 <= 0.1f) {
|
if (this->unk_1C8 <= 0.1f) {
|
||||||
func_8086DB24(this);
|
func_8086DB24(this);
|
||||||
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_FOOT_SWITCH);
|
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_FOOT_SWITCH);
|
||||||
func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 0x78, 0x14, 0xA);
|
Rumble_Request(this->dyna.actor.xyzDistToPlayerSq, 120, 20, 10);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "z_bg_ddan_kd.h"
|
#include "z_bg_ddan_kd.h"
|
||||||
|
|
||||||
|
#include "rumble.h"
|
||||||
|
|
||||||
#include "objects/object_ddan_objects/object_ddan_objects.h"
|
#include "objects/object_ddan_objects/object_ddan_objects.h"
|
||||||
|
|
||||||
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
|
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
|
||||||
|
@ -130,7 +133,7 @@ void BgDdanKd_LowerStairs(BgDdanKd* this, PlayState* play) {
|
||||||
f32 effectStrength;
|
f32 effectStrength;
|
||||||
|
|
||||||
Math_SmoothStepToF(&this->dyna.actor.speedXZ, 4.0f, 0.5f, 0.025f, 0.0f);
|
Math_SmoothStepToF(&this->dyna.actor.speedXZ, 4.0f, 0.5f, 0.025f, 0.0f);
|
||||||
func_800AA000(500.0f, 0x78, 0x14, 0xA);
|
Rumble_Request(500.0f, 120, 20, 10);
|
||||||
|
|
||||||
if (Math_SmoothStepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y - 200.0f - 20.0f, 0.075f,
|
if (Math_SmoothStepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y - 200.0f - 20.0f, 0.075f,
|
||||||
this->dyna.actor.speedXZ, 0.0075f) == 0.0f) {
|
this->dyna.actor.speedXZ, 0.0075f) == 0.0f) {
|
||||||
|
|
|
@ -6,6 +6,9 @@
|
||||||
|
|
||||||
#include "z_bg_dodoago.h"
|
#include "z_bg_dodoago.h"
|
||||||
#include "overlays/actors/ovl_En_Bom/z_en_bom.h"
|
#include "overlays/actors/ovl_En_Bom/z_en_bom.h"
|
||||||
|
|
||||||
|
#include "rumble.h"
|
||||||
|
|
||||||
#include "objects/object_ddan_objects/object_ddan_objects.h"
|
#include "objects/object_ddan_objects/object_ddan_objects.h"
|
||||||
|
|
||||||
#define FLAGS 0
|
#define FLAGS 0
|
||||||
|
@ -246,7 +249,7 @@ void BgDodoago_OpenJaw(BgDodoago* this, PlayState* play) {
|
||||||
BgDodoago_SpawnSparkles(&pos, play);
|
BgDodoago_SpawnSparkles(&pos, play);
|
||||||
|
|
||||||
Math_StepToS(&this->state, 100, 3);
|
Math_StepToS(&this->state, 100, 3);
|
||||||
func_800AA000(500.0f, 0x78, 0x14, 0xA);
|
Rumble_Request(500.0f, 120, 20, 10);
|
||||||
|
|
||||||
if (Math_SmoothStepToS(&this->dyna.actor.shape.rot.x, 0x1333, 110 - this->state, 0x3E8, 0x32) == 0) {
|
if (Math_SmoothStepToS(&this->dyna.actor.shape.rot.x, 0x1333, 110 - this->state, 0x3E8, 0x32) == 0) {
|
||||||
BgDodoago_SetupAction(this, BgDodoago_DoNothing);
|
BgDodoago_SetupAction(this, BgDodoago_DoNothing);
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "z_bg_heavy_block.h"
|
#include "z_bg_heavy_block.h"
|
||||||
|
|
||||||
|
#include "rumble.h"
|
||||||
|
|
||||||
#include "objects/object_heavy_object/object_heavy_object.h"
|
#include "objects/object_heavy_object/object_heavy_object.h"
|
||||||
#include "vt.h"
|
#include "vt.h"
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
||||||
|
@ -192,7 +195,7 @@ void BgHeavyBlock_MovePiece(BgHeavyBlock* this, PlayState* play) {
|
||||||
thisx->velocity.z = Rand_CenteredFloat(8.0f);
|
thisx->velocity.z = Rand_CenteredFloat(8.0f);
|
||||||
BgHeavyBlock_SetPieceRandRot(this, 1.0f);
|
BgHeavyBlock_SetPieceRandRot(this, 1.0f);
|
||||||
Audio_PlayActorSound2(thisx, NA_SE_EV_ROCK_BROKEN);
|
Audio_PlayActorSound2(thisx, NA_SE_EV_ROCK_BROKEN);
|
||||||
func_800AA000(thisx->xzDistToPlayer, 0x96, 0xA, 8);
|
Rumble_Request(thisx->xzDistToPlayer, 150, 10, 8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -351,7 +354,7 @@ void BgHeavyBlock_LiftedUp(BgHeavyBlock* this, PlayState* play) {
|
||||||
f32 xOffset;
|
f32 xOffset;
|
||||||
|
|
||||||
if (this->timer == 11) {
|
if (this->timer == 11) {
|
||||||
func_800AA000(0.0f, 0xFF, 0x14, 0x14);
|
Rumble_Request(0.0f, 255, 20, 20);
|
||||||
Player_PlaySfx(&player->actor, NA_SE_PL_PULL_UP_BIGROCK);
|
Player_PlaySfx(&player->actor, NA_SE_PL_PULL_UP_BIGROCK);
|
||||||
LOG_STRING("NA_SE_PL_PULL_UP_BIGROCK");
|
LOG_STRING("NA_SE_PL_PULL_UP_BIGROCK");
|
||||||
}
|
}
|
||||||
|
@ -395,7 +398,7 @@ void BgHeavyBlock_Fly(BgHeavyBlock* this, PlayState* play) {
|
||||||
this->dyna.actor.floorHeight = raycastResult;
|
this->dyna.actor.floorHeight = raycastResult;
|
||||||
|
|
||||||
if (this->dyna.actor.home.pos.y <= raycastResult) {
|
if (this->dyna.actor.home.pos.y <= raycastResult) {
|
||||||
func_800AA000(0.0f, 0xFF, 0x3C, 4);
|
Rumble_Request(0.0f, 255, 60, 4);
|
||||||
|
|
||||||
switch (this->dyna.actor.params & 0xFF) {
|
switch (this->dyna.actor.params & 0xFF) {
|
||||||
case HEAVYBLOCK_BREAKABLE:
|
case HEAVYBLOCK_BREAKABLE:
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "z_bg_hidan_hamstep.h"
|
#include "z_bg_hidan_hamstep.h"
|
||||||
|
|
||||||
|
#include "rumble.h"
|
||||||
|
|
||||||
#include "objects/object_hidan_objects/object_hidan_objects.h"
|
#include "objects/object_hidan_objects/object_hidan_objects.h"
|
||||||
|
|
||||||
#define FLAGS 0
|
#define FLAGS 0
|
||||||
|
@ -312,7 +315,7 @@ void func_80888860(BgHidanHamstep* this, PlayState* play) {
|
||||||
Quake_SetQuakeValues(quakeIndex, 0, 0, 500, 0);
|
Quake_SetQuakeValues(quakeIndex, 0, 0, 500, 0);
|
||||||
Quake_SetCountdown(quakeIndex, 20);
|
Quake_SetCountdown(quakeIndex, 20);
|
||||||
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND);
|
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND);
|
||||||
func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 255, 20, 150);
|
Rumble_Request(this->dyna.actor.xyzDistToPlayerSq, 255, 20, 150);
|
||||||
func_80888638(this, play);
|
func_80888638(this, play);
|
||||||
osSyncPrintf("A(%d)\n", this->dyna.actor.params);
|
osSyncPrintf("A(%d)\n", this->dyna.actor.params);
|
||||||
}
|
}
|
||||||
|
@ -370,7 +373,7 @@ void func_80888A58(BgHidanHamstep* this, PlayState* play) {
|
||||||
Quake_SetCountdown(quakeIndex, 7);
|
Quake_SetCountdown(quakeIndex, 7);
|
||||||
|
|
||||||
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND);
|
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND);
|
||||||
func_800AA000(10000.0f, 255, 20, 150);
|
Rumble_Request(SQ(100.0f), 255, 20, 150);
|
||||||
func_808884C8(this, play);
|
func_808884C8(this, play);
|
||||||
|
|
||||||
if ((this->dyna.actor.params & 0xFF) == 5) {
|
if ((this->dyna.actor.params & 0xFF) == 5) {
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "z_bg_hidan_hrock.h"
|
#include "z_bg_hidan_hrock.h"
|
||||||
|
|
||||||
|
#include "rumble.h"
|
||||||
|
|
||||||
#include "objects/object_hidan_objects/object_hidan_objects.h"
|
#include "objects/object_hidan_objects/object_hidan_objects.h"
|
||||||
|
|
||||||
#define FLAGS 0
|
#define FLAGS 0
|
||||||
|
@ -162,7 +165,7 @@ void func_808894B0(BgHidanHrock* this, PlayState* play) {
|
||||||
(Math_CosS(this->dyna.actor.world.rot.y + (this->unk_168 << 0xE)) * 5.0f) + this->dyna.actor.home.pos.z;
|
(Math_CosS(this->dyna.actor.world.rot.y + (this->unk_168 << 0xE)) * 5.0f) + this->dyna.actor.home.pos.z;
|
||||||
|
|
||||||
if (!(this->unk_168 % 4)) {
|
if (!(this->unk_168 % 4)) {
|
||||||
func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 180, 10, 100);
|
Rumble_Request(this->dyna.actor.xyzDistToPlayerSq, 180, 10, 100);
|
||||||
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_SHAKE);
|
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_SHAKE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "z_bg_hidan_rock.h"
|
#include "z_bg_hidan_rock.h"
|
||||||
|
|
||||||
|
#include "rumble.h"
|
||||||
|
|
||||||
#include "objects/object_hidan_objects/object_hidan_objects.h"
|
#include "objects/object_hidan_objects/object_hidan_objects.h"
|
||||||
|
|
||||||
#define FLAGS 0
|
#define FLAGS 0
|
||||||
|
@ -237,7 +240,7 @@ void func_8088B69C(BgHidanRock* this, PlayState* play) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(this->timer % 4)) {
|
if (!(this->timer % 4)) {
|
||||||
func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 0xB4, 0x0A, 0x64);
|
Rumble_Request(this->dyna.actor.xyzDistToPlayerSq, 180, 10, 100);
|
||||||
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_SHAKE);
|
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_SHAKE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "z_bg_hidan_sima.h"
|
#include "z_bg_hidan_sima.h"
|
||||||
|
|
||||||
|
#include "rumble.h"
|
||||||
|
|
||||||
#include "objects/object_hidan_objects/object_hidan_objects.h"
|
#include "objects/object_hidan_objects/object_hidan_objects.h"
|
||||||
|
|
||||||
#define FLAGS 0
|
#define FLAGS 0
|
||||||
|
@ -145,7 +148,7 @@ void func_8088E5D0(BgHidanSima* this, PlayState* play) {
|
||||||
this->dyna.actor.world.pos.z = this->dyna.actor.home.pos.z;
|
this->dyna.actor.world.pos.z = this->dyna.actor.home.pos.z;
|
||||||
}
|
}
|
||||||
if (!(this->timer % 4)) {
|
if (!(this->timer % 4)) {
|
||||||
func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 180, 10, 100);
|
Rumble_Request(this->dyna.actor.xyzDistToPlayerSq, 180, 10, 100);
|
||||||
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_SHAKE);
|
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_SHAKE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
#include "z_bg_mizu_shutter.h"
|
#include "z_bg_mizu_shutter.h"
|
||||||
|
|
||||||
|
#include "rumble.h"
|
||||||
|
|
||||||
#include "objects/object_mizu_objects/object_mizu_objects.h"
|
#include "objects/object_mizu_objects/object_mizu_objects.h"
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
||||||
|
|
||||||
|
@ -129,7 +132,7 @@ void BgMizuShutter_Move(BgMizuShutter* this, PlayState* play) {
|
||||||
if ((this->dyna.actor.world.pos.x == this->closedPos.x) &&
|
if ((this->dyna.actor.world.pos.x == this->closedPos.x) &&
|
||||||
(this->dyna.actor.world.pos.y == this->closedPos.y) &&
|
(this->dyna.actor.world.pos.y == this->closedPos.y) &&
|
||||||
(this->dyna.actor.world.pos.z == this->closedPos.z)) {
|
(this->dyna.actor.world.pos.z == this->closedPos.z)) {
|
||||||
func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 0x78, 0x14, 0xA);
|
Rumble_Request(this->dyna.actor.xyzDistToPlayerSq, 120, 20, 10);
|
||||||
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_STONE_BOUND);
|
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_STONE_BOUND);
|
||||||
this->actionFunc = BgMizuShutter_WaitForSwitch;
|
this->actionFunc = BgMizuShutter_WaitForSwitch;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "z_bg_mizu_water.h"
|
#include "z_bg_mizu_water.h"
|
||||||
|
|
||||||
|
#include "rumble.h"
|
||||||
|
|
||||||
#include "objects/object_mizu_objects/object_mizu_objects.h"
|
#include "objects/object_mizu_objects/object_mizu_objects.h"
|
||||||
|
|
||||||
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
|
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
|
||||||
|
@ -281,10 +284,10 @@ void BgMizuWater_ChangeWaterLevel(BgMizuWater* this, PlayState* play) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->targetY < this->actor.world.pos.y) {
|
if (this->targetY < this->actor.world.pos.y) {
|
||||||
func_800AA000(0.0f, 0x78, 0x14, 0xA);
|
Rumble_Request(0.0f, 120, 20, 10);
|
||||||
func_8002F948(&this->actor, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG);
|
func_8002F948(&this->actor, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG);
|
||||||
} else if (this->targetY > this->actor.world.pos.y) {
|
} else if (this->targetY > this->actor.world.pos.y) {
|
||||||
func_800AA000(0.0f, 0x78, 0x14, 0xA);
|
Rumble_Request(0.0f, 120, 20, 10);
|
||||||
func_8002F948(&this->actor, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG);
|
func_8002F948(&this->actor, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "z_bg_mori_rakkatenjo.h"
|
#include "z_bg_mori_rakkatenjo.h"
|
||||||
|
|
||||||
|
#include "rumble.h"
|
||||||
|
|
||||||
#include "objects/object_mori_objects/object_mori_objects.h"
|
#include "objects/object_mori_objects/object_mori_objects.h"
|
||||||
|
|
||||||
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
|
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
|
||||||
|
@ -157,7 +160,7 @@ void BgMoriRakkatenjo_Fall(BgMoriRakkatenjo* this, PlayState* play) {
|
||||||
if (this->bounceCount == 0) {
|
if (this->bounceCount == 0) {
|
||||||
this->fallCount++;
|
this->fallCount++;
|
||||||
Sfx_PlaySfxCentered2(NA_SE_EV_STONE_BOUND);
|
Sfx_PlaySfxCentered2(NA_SE_EV_STONE_BOUND);
|
||||||
func_800AA000(SQ(thisx->yDistToPlayer), 0xFF, 0x14, 0x96);
|
Rumble_Request(SQ(thisx->yDistToPlayer), 255, 20, 150);
|
||||||
}
|
}
|
||||||
thisx->world.pos.y =
|
thisx->world.pos.y =
|
||||||
403.0f - (thisx->world.pos.y - 403.0f) * bounceVel[this->bounceCount] / fabsf(thisx->velocity.y);
|
403.0f - (thisx->world.pos.y - 403.0f) * bounceVel[this->bounceCount] / fabsf(thisx->velocity.y);
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "z_bg_relay_objects.h"
|
#include "z_bg_relay_objects.h"
|
||||||
|
|
||||||
|
#include "rumble.h"
|
||||||
|
|
||||||
#include "objects/object_relay_objects/object_relay_objects.h"
|
#include "objects/object_relay_objects/object_relay_objects.h"
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
||||||
|
|
||||||
|
@ -148,7 +151,7 @@ void func_808A91AC(BgRelayObjects* this, PlayState* play) {
|
||||||
void func_808A9234(BgRelayObjects* this, PlayState* play) {
|
void func_808A9234(BgRelayObjects* this, PlayState* play) {
|
||||||
this->dyna.actor.velocity.y += this->dyna.actor.gravity;
|
this->dyna.actor.velocity.y += this->dyna.actor.gravity;
|
||||||
if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, this->dyna.actor.velocity.y)) {
|
if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, this->dyna.actor.velocity.y)) {
|
||||||
func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 180, 20, 100);
|
Rumble_Request(this->dyna.actor.xyzDistToPlayerSq, 180, 20, 100);
|
||||||
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_STONE_BOUND);
|
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_STONE_BOUND);
|
||||||
if (this->unk_169 != play->roomCtx.curRoom.num) {
|
if (this->unk_169 != play->roomCtx.curRoom.num) {
|
||||||
Sfx_PlaySfxCentered2(NA_SE_EN_PO_LAUGH);
|
Sfx_PlaySfxCentered2(NA_SE_EN_PO_LAUGH);
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
#include "z_boss_dodongo.h"
|
#include "z_boss_dodongo.h"
|
||||||
|
|
||||||
|
#include "rumble.h"
|
||||||
|
|
||||||
#include "textures/boss_title_cards/object_kingdodongo.h"
|
#include "textures/boss_title_cards/object_kingdodongo.h"
|
||||||
#include "objects/object_kingdodongo/object_kingdodongo.h"
|
#include "objects/object_kingdodongo/object_kingdodongo.h"
|
||||||
#include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h"
|
#include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h"
|
||||||
|
@ -860,7 +863,7 @@ void BossDodongo_Walk(BossDodongo* this, PlayState* play) {
|
||||||
func_80033E88(&this->actor, play, 4, 10);
|
func_80033E88(&this->actor, play, 4, 10);
|
||||||
} else {
|
} else {
|
||||||
this->unk_1B6 = 10;
|
this->unk_1B6 = 10;
|
||||||
func_800A9F6C(0.0f, 180, 20, 100);
|
Rumble_Override(0.0f, 180, 20, 100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#include "z_boss_ganon.h"
|
#include "z_boss_ganon.h"
|
||||||
|
#include "rumble.h"
|
||||||
#include "overlays/ovl_Boss_Ganon/ovl_Boss_Ganon.h"
|
#include "overlays/ovl_Boss_Ganon/ovl_Boss_Ganon.h"
|
||||||
#include "overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.h"
|
#include "overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.h"
|
||||||
#include "overlays/actors/ovl_En_Zl3/z_en_zl3.h"
|
#include "overlays/actors/ovl_En_Zl3/z_en_zl3.h"
|
||||||
|
@ -4016,7 +4017,7 @@ void BossGanon_LightBall_Update(Actor* thisx, PlayState* play2) {
|
||||||
Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_REFLECT_MG, &player->actor.projectedPos, 4,
|
Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_REFLECT_MG, &player->actor.projectedPos, 4,
|
||||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
|
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
|
||||||
&gSfxDefaultReverb);
|
&gSfxDefaultReverb);
|
||||||
func_800AA000(this->actor.xyzDistToPlayerSq, 0xFF, 0x14, 0x96);
|
Rumble_Request(this->actor.xyzDistToPlayerSq, 255, 20, 150);
|
||||||
} else {
|
} else {
|
||||||
spBA = 1;
|
spBA = 1;
|
||||||
this->actor.world.rot.y = Math_Atan2S(zDistFromGanondorf, xDistFromGanondorf);
|
this->actor.world.rot.y = Math_Atan2S(zDistFromGanondorf, xDistFromGanondorf);
|
||||||
|
@ -4027,7 +4028,7 @@ void BossGanon_LightBall_Update(Actor* thisx, PlayState* play2) {
|
||||||
Audio_PlaySoundGeneral(NA_SE_IT_SWORD_REFLECT_MG, &player->actor.projectedPos, 4,
|
Audio_PlaySoundGeneral(NA_SE_IT_SWORD_REFLECT_MG, &player->actor.projectedPos, 4,
|
||||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
|
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
|
||||||
&gSfxDefaultReverb);
|
&gSfxDefaultReverb);
|
||||||
func_800AA000(this->actor.xyzDistToPlayerSq, 0xB4, 0x14, 0x64);
|
Rumble_Request(this->actor.xyzDistToPlayerSq, 180, 20, 100);
|
||||||
|
|
||||||
if (hitWithBottle == false) {
|
if (hitWithBottle == false) {
|
||||||
// if ganondorf is 250 units away from link, at least 3 volleys are required
|
// if ganondorf is 250 units away from link, at least 3 volleys are required
|
||||||
|
@ -4496,7 +4497,7 @@ void func_808E2544(Actor* thisx, PlayState* play) {
|
||||||
this->collider.base.acFlags &= ~2;
|
this->collider.base.acFlags &= ~2;
|
||||||
|
|
||||||
if (!(acHitInfo->toucher.dmgFlags & 0x100000) || Player_HasMirrorShieldEquipped(play)) {
|
if (!(acHitInfo->toucher.dmgFlags & 0x100000) || Player_HasMirrorShieldEquipped(play)) {
|
||||||
func_800AA000(this->actor.xyzDistToPlayerSq, 0xB4, 0x14, 0x64);
|
Rumble_Request(this->actor.xyzDistToPlayerSq, 180, 20, 100);
|
||||||
this->unk_1C2 = 0xC;
|
this->unk_1C2 = 0xC;
|
||||||
this->actor.speedXZ = -30.0f;
|
this->actor.speedXZ = -30.0f;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
#include "z_boss_ganon2.h"
|
#include "z_boss_ganon2.h"
|
||||||
#include "overlays/actors/ovl_Demo_Gj/z_demo_gj.h"
|
#include "overlays/actors/ovl_Demo_Gj/z_demo_gj.h"
|
||||||
#include "overlays/actors/ovl_En_Zl3/z_en_zl3.h"
|
#include "overlays/actors/ovl_En_Zl3/z_en_zl3.h"
|
||||||
|
|
||||||
|
#include "rumble.h"
|
||||||
|
|
||||||
#include "objects/object_ganon/object_ganon.h"
|
#include "objects/object_ganon/object_ganon.h"
|
||||||
#include "textures/boss_title_cards/object_ganon2.h"
|
#include "textures/boss_title_cards/object_ganon2.h"
|
||||||
#include "objects/object_ganon2/object_ganon2.h"
|
#include "objects/object_ganon2/object_ganon2.h"
|
||||||
|
@ -472,7 +475,7 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) {
|
||||||
if (this->csTimer == 30) {
|
if (this->csTimer == 30) {
|
||||||
D_80906D78 = 1;
|
D_80906D78 = 1;
|
||||||
this->unk_314 = 1;
|
this->unk_314 = 1;
|
||||||
func_800A9F6C(0.0f, 0xC8, 0x14, 0x14);
|
Rumble_Override(0.0f, 200, 20, 20);
|
||||||
}
|
}
|
||||||
if (this->csTimer == 30) {
|
if (this->csTimer == 30) {
|
||||||
Sfx_PlaySfxCentered(NA_SE_EV_GRAVE_EXPLOSION);
|
Sfx_PlaySfxCentered(NA_SE_EV_GRAVE_EXPLOSION);
|
||||||
|
@ -690,7 +693,7 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) {
|
||||||
this->actor.velocity.y = 0.0f;
|
this->actor.velocity.y = 0.0f;
|
||||||
Animation_MorphToPlayOnce(&this->skelAnime, &gGanonUncurlAndFlailAnim, 0.0f);
|
Animation_MorphToPlayOnce(&this->skelAnime, &gGanonUncurlAndFlailAnim, 0.0f);
|
||||||
func_808FD4D4(this, play, 0, 3);
|
func_808FD4D4(this, play, 0, 3);
|
||||||
func_800A9F6C(0.0f, 0xC8, 0x14, 0x14);
|
Rumble_Override(0.0f, 200, 20, 20);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 21:
|
case 21:
|
||||||
|
@ -767,7 +770,7 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) {
|
||||||
if (this->csTimer == 228) {
|
if (this->csTimer == 228) {
|
||||||
Sfx_PlaySfxCentered(NA_SE_IT_SHIELD_REFLECT_SW);
|
Sfx_PlaySfxCentered(NA_SE_IT_SHIELD_REFLECT_SW);
|
||||||
Player_SetCsActionWithHaltedActors(play, &this->actor, 0x56);
|
Player_SetCsActionWithHaltedActors(play, &this->actor, 0x56);
|
||||||
func_800A9F6C(0.0f, 0xFF, 0xA, 0x32);
|
Rumble_Override(0.0f, 255, 10, 50);
|
||||||
}
|
}
|
||||||
if (this->csTimer >= 229) {
|
if (this->csTimer >= 229) {
|
||||||
play->envCtx.fillScreen = true;
|
play->envCtx.fillScreen = true;
|
||||||
|
@ -969,7 +972,7 @@ void func_808FF898(BossGanon2* this, PlayState* play) {
|
||||||
sp28.z = 1.0f;
|
sp28.z = 1.0f;
|
||||||
Matrix_MultVec3f(&sp28, &gj->unk_26C);
|
Matrix_MultVec3f(&sp28, &gj->unk_26C);
|
||||||
gj->killFlag = true;
|
gj->killFlag = true;
|
||||||
func_800A9F6C(0.0f, 0x96, 0x14, 0x32);
|
Rumble_Override(0.0f, 150, 20, 50);
|
||||||
this->unk_392 = 6;
|
this->unk_392 = 6;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,9 @@
|
||||||
#include "overlays/actors/ovl_En_Goma/z_en_goma.h"
|
#include "overlays/actors/ovl_En_Goma/z_en_goma.h"
|
||||||
#include "overlays/actors/ovl_Door_Shutter/z_door_shutter.h"
|
#include "overlays/actors/ovl_Door_Shutter/z_door_shutter.h"
|
||||||
#include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h"
|
#include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h"
|
||||||
|
|
||||||
|
#include "rumble.h"
|
||||||
|
|
||||||
#include "soh/OTRGlobals.h"
|
#include "soh/OTRGlobals.h"
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
||||||
|
@ -897,7 +900,7 @@ void BossGoma_Encounter(BossGoma* this, PlayState* play) {
|
||||||
this->currentAnimFrameCount = Animation_GetLastFrame(&gGohmaInitialLandingAnim);
|
this->currentAnimFrameCount = Animation_GetLastFrame(&gGohmaInitialLandingAnim);
|
||||||
BossGoma_PlayEffectsAndSfx(this, play, 0, 5);
|
BossGoma_PlayEffectsAndSfx(this, play, 0, 5);
|
||||||
this->framesUntilNextAction = 15;
|
this->framesUntilNextAction = 15;
|
||||||
func_800A9F6C(0.0f, 0xC8, 0x14, 0x14);
|
Rumble_Override(0.0f, 200, 20, 20);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1007,7 +1010,7 @@ void BossGoma_Defeated(BossGoma* this, PlayState* play) {
|
||||||
|
|
||||||
if (Animation_OnFrame(&this->skelanime, 107.0f)) {
|
if (Animation_OnFrame(&this->skelanime, 107.0f)) {
|
||||||
BossGoma_PlayEffectsAndSfx(this, play, 0, 8);
|
BossGoma_PlayEffectsAndSfx(this, play, 0, 8);
|
||||||
func_800A9F6C(0.0f, 0x96, 0x14, 0x14);
|
Rumble_Override(0.0f, 150, 20, 20);
|
||||||
}
|
}
|
||||||
|
|
||||||
this->visualState = VISUALSTATE_DEFEATED;
|
this->visualState = VISUALSTATE_DEFEATED;
|
||||||
|
|
|
@ -11,6 +11,8 @@
|
||||||
#include "objects/gameplay_keep/gameplay_keep.h"
|
#include "objects/gameplay_keep/gameplay_keep.h"
|
||||||
#include "vt.h"
|
#include "vt.h"
|
||||||
|
|
||||||
|
#include "rumble.h"
|
||||||
|
|
||||||
#include "soh/frame_interpolation.h"
|
#include "soh/frame_interpolation.h"
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
||||||
|
@ -530,7 +532,7 @@ void BossMo_Tentacle(BossMo* this, PlayState* play) {
|
||||||
if ((this->sfxTimer % 32) == 0) {
|
if ((this->sfxTimer % 32) == 0) {
|
||||||
Audio_PlaySoundIncreasinglyTransposed(&this->tentTipPos, NA_SE_EN_MOFER_WAVE,
|
Audio_PlaySoundIncreasinglyTransposed(&this->tentTipPos, NA_SE_EN_MOFER_WAVE,
|
||||||
gMorphaTransposeTable);
|
gMorphaTransposeTable);
|
||||||
func_800AA000(0, 100, 5, 2);
|
Rumble_Request(0, 100, 5, 2);
|
||||||
Player_PlaySfx(&player->actor, NA_SE_VO_LI_FREEZE + player->ageProperties->unk_92);
|
Player_PlaySfx(&player->actor, NA_SE_VO_LI_FREEZE + player->ageProperties->unk_92);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -545,7 +547,7 @@ void BossMo_Tentacle(BossMo* this, PlayState* play) {
|
||||||
if ((this->sfxTimer % 16) == 0) {
|
if ((this->sfxTimer % 16) == 0) {
|
||||||
Audio_PlaySoundIncreasinglyTransposed(&this->tentTipPos, NA_SE_EN_MOFER_WAVE,
|
Audio_PlaySoundIncreasinglyTransposed(&this->tentTipPos, NA_SE_EN_MOFER_WAVE,
|
||||||
gMorphaTransposeTable);
|
gMorphaTransposeTable);
|
||||||
func_800AA000(0, 160, 5, 4);
|
Rumble_Request(0, 160, 5, 4);
|
||||||
Player_PlaySfx(&player->actor, NA_SE_VO_LI_FREEZE + player->ageProperties->unk_92);
|
Player_PlaySfx(&player->actor, NA_SE_VO_LI_FREEZE + player->ageProperties->unk_92);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,9 @@
|
||||||
#include "objects/gameplay_keep/gameplay_keep.h"
|
#include "objects/gameplay_keep/gameplay_keep.h"
|
||||||
#include "overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.h"
|
#include "overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.h"
|
||||||
#include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h"
|
#include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h"
|
||||||
|
|
||||||
|
#include "rumble.h"
|
||||||
|
|
||||||
#include "soh/frame_interpolation.h"
|
#include "soh/frame_interpolation.h"
|
||||||
#include "soh/ResourceManagerHelpers.h"
|
#include "soh/ResourceManagerHelpers.h"
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
||||||
|
@ -457,7 +460,7 @@ void BossSst_HeadIntro(BossSst* this, PlayState* play) {
|
||||||
if (!this->ready) {
|
if (!this->ready) {
|
||||||
sFloor->dyna.actor.params = BONGOFLOOR_HIT;
|
sFloor->dyna.actor.params = BONGOFLOOR_HIT;
|
||||||
this->ready = true;
|
this->ready = true;
|
||||||
func_800AA000(this->actor.xyzDistToPlayerSq, 0xFF, 0x14, 0x96);
|
Rumble_Request(this->actor.xyzDistToPlayerSq, 255, 20, 150);
|
||||||
Audio_PlayActorSound2(&sFloor->dyna.actor, NA_SE_EN_SHADEST_TAIKO_HIGH);
|
Audio_PlayActorSound2(&sFloor->dyna.actor, NA_SE_EN_SHADEST_TAIKO_HIGH);
|
||||||
} else if (Flags_GetEventChkInf(EVENTCHKINF_BEGAN_BONGO_BONGO_BATTLE)) {
|
} else if (Flags_GetEventChkInf(EVENTCHKINF_BEGAN_BONGO_BONGO_BATTLE)) {
|
||||||
sHands[RIGHT]->actor.draw = BossSst_DrawHand;
|
sHands[RIGHT]->actor.draw = BossSst_DrawHand;
|
||||||
|
@ -1311,7 +1314,7 @@ void BossSst_HandDownbeat(BossSst* this, PlayState* play) {
|
||||||
} else {
|
} else {
|
||||||
BossSst_HandSetupDownbeatEnd(this);
|
BossSst_HandSetupDownbeatEnd(this);
|
||||||
}
|
}
|
||||||
func_800AA000(this->actor.xyzDistToPlayerSq, 0xFF, 0x14, 0x96);
|
Rumble_Request(this->actor.xyzDistToPlayerSq, 255, 20, 150);
|
||||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_SHADEST_TAIKO_HIGH);
|
Audio_PlayActorSound2(&this->actor, NA_SE_EN_SHADEST_TAIKO_HIGH);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,9 @@
|
||||||
#include "textures/boss_title_cards/object_tw.h"
|
#include "textures/boss_title_cards/object_tw.h"
|
||||||
#include "objects/object_tw/object_tw.h"
|
#include "objects/object_tw/object_tw.h"
|
||||||
#include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h"
|
#include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h"
|
||||||
|
|
||||||
|
#include "rumble.h"
|
||||||
|
|
||||||
#include "soh/frame_interpolation.h"
|
#include "soh/frame_interpolation.h"
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
||||||
|
@ -1091,7 +1094,7 @@ void BossTw_ShootBeam(BossTw* this, PlayState* play) {
|
||||||
this->groundBlastPos.y = 0.0f;
|
this->groundBlastPos.y = 0.0f;
|
||||||
this->groundBlastPos.z = 0.0f;
|
this->groundBlastPos.z = 0.0f;
|
||||||
play->envCtx.unk_D8 = 1.0f;
|
play->envCtx.unk_D8 = 1.0f;
|
||||||
func_800AA000(0.0f, 0x64, 5, 4);
|
Rumble_Request(0.0f, 100, 5, 4);
|
||||||
} else if (beamReflection == 0) {
|
} else if (beamReflection == 0) {
|
||||||
BossTw_BeamHitPlayerCheck(this, play);
|
BossTw_BeamHitPlayerCheck(this, play);
|
||||||
|
|
||||||
|
@ -4299,7 +4302,7 @@ s32 BossTw_BlastShieldCheck(BossTw* this, PlayState* play) {
|
||||||
if (info->toucher.dmgFlags & DMG_SHIELD) {
|
if (info->toucher.dmgFlags & DMG_SHIELD) {
|
||||||
this->work[INVINC_TIMER] = 7;
|
this->work[INVINC_TIMER] = 7;
|
||||||
play->envCtx.unk_D8 = 1.0f;
|
play->envCtx.unk_D8 = 1.0f;
|
||||||
func_800AA000(0.0f, 100, 5, 4);
|
Rumble_Request(0.0f, 100, 5, 4);
|
||||||
|
|
||||||
if (Player_HasMirrorShieldEquipped(play)) {
|
if (Player_HasMirrorShieldEquipped(play)) {
|
||||||
if (this->blastType == 1) {
|
if (this->blastType == 1) {
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
#include "vt.h"
|
#include "vt.h"
|
||||||
#include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h"
|
#include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h"
|
||||||
|
|
||||||
|
#include "rumble.h"
|
||||||
|
|
||||||
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
|
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
|
||||||
|
|
||||||
void DemoGt_Init(Actor* thisx, PlayState* play);
|
void DemoGt_Init(Actor* thisx, PlayState* play);
|
||||||
|
@ -32,7 +34,7 @@ void DemoGt_PlayExplosion2Sfx(PlayState* play, Vec3f* pos) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DemoGt_Rumble(PlayState* play) {
|
void DemoGt_Rumble(PlayState* play) {
|
||||||
func_800AA000(0.0f, 0x32, 0xA, 5);
|
Rumble_Request(0.0f, 50, 10, 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DemoGt_SpawnDust(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, f32 scale, s16 scaleStep, s16 life) {
|
void DemoGt_SpawnDust(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, f32 scale, s16 scaleStep, s16 life) {
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
#include "z_door_shutter.h"
|
#include "z_door_shutter.h"
|
||||||
#include "overlays/actors/ovl_Boss_Goma/z_boss_goma.h"
|
#include "overlays/actors/ovl_Boss_Goma/z_boss_goma.h"
|
||||||
|
|
||||||
|
#include "rumble.h"
|
||||||
|
|
||||||
#include "objects/object_gnd/object_gnd.h"
|
#include "objects/object_gnd/object_gnd.h"
|
||||||
#include "objects/object_goma/object_goma.h"
|
#include "objects/object_goma/object_goma.h"
|
||||||
#include "objects/object_ydan_objects/object_ydan_objects.h"
|
#include "objects/object_ydan_objects/object_ydan_objects.h"
|
||||||
|
@ -594,7 +596,7 @@ void func_809973E8(DoorShutter* this, PlayState* play) {
|
||||||
Quake_SetSpeed(quakeId, -32536);
|
Quake_SetSpeed(quakeId, -32536);
|
||||||
Quake_SetQuakeValues(quakeId, 2, 0, 0, 0);
|
Quake_SetQuakeValues(quakeId, 2, 0, 0, 0);
|
||||||
Quake_SetCountdown(quakeId, 10);
|
Quake_SetCountdown(quakeId, 10);
|
||||||
func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 0xB4, 0x14, 0x64);
|
Rumble_Request(this->dyna.actor.xyzDistToPlayerSq, 180, 20, 100);
|
||||||
func_80997220(this, play);
|
func_80997220(this, play);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -785,7 +787,7 @@ void DoorShutter_Draw(Actor* thisx, PlayState* play) {
|
||||||
void func_8099803C(PlayState* play, s16 y, s16 countdown, s16 camId) {
|
void func_8099803C(PlayState* play, s16 y, s16 countdown, s16 camId) {
|
||||||
s16 quakeId = Quake_Add(Play_GetCamera(play, camId), 3);
|
s16 quakeId = Quake_Add(Play_GetCamera(play, camId), 3);
|
||||||
|
|
||||||
func_800A9F6C(0.0f, 180, 20, 100);
|
Rumble_Override(0.0f, 180, 20, 100);
|
||||||
Quake_SetSpeed(quakeId, 20000);
|
Quake_SetSpeed(quakeId, 20000);
|
||||||
Quake_SetQuakeValues(quakeId, y, 0, 0, 0);
|
Quake_SetQuakeValues(quakeId, y, 0, 0, 0);
|
||||||
Quake_SetCountdown(quakeId, countdown);
|
Quake_SetCountdown(quakeId, countdown);
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
#include "z_en_bigokuta.h"
|
#include "z_en_bigokuta.h"
|
||||||
|
|
||||||
|
#include "rumble.h"
|
||||||
|
|
||||||
#include "objects/object_bigokuta/object_bigokuta.h"
|
#include "objects/object_bigokuta/object_bigokuta.h"
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
||||||
#include "soh/ResourceManagerHelpers.h"
|
#include "soh/ResourceManagerHelpers.h"
|
||||||
|
@ -442,7 +445,7 @@ void func_809BD8DC(EnBigokuta* this, PlayState* play) {
|
||||||
EffectSsGSplash_Spawn(play, &effectPos, NULL, NULL, 1, 2000);
|
EffectSsGSplash_Spawn(play, &effectPos, NULL, NULL, 1, 2000);
|
||||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DAIOCTA_LAND_WATER);
|
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DAIOCTA_LAND_WATER);
|
||||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOLON_LAND_BIG);
|
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOLON_LAND_BIG);
|
||||||
func_800AA000(0.0f, 0xFF, 0x14, 0x96);
|
Rumble_Request(0.0f, 255, 20, 150);
|
||||||
}
|
}
|
||||||
} else if (this->unk_196 < -1) {
|
} else if (this->unk_196 < -1) {
|
||||||
this->actor.world.pos.y = this->actor.home.pos.y - (sinf((this->unk_196 + 1) * (M_PI / 10)) * 20.0f);
|
this->actor.world.pos.y = this->actor.home.pos.y - (sinf((this->unk_196 + 1) * (M_PI / 10)) * 20.0f);
|
||||||
|
|
|
@ -6,6 +6,9 @@
|
||||||
|
|
||||||
#include "z_en_bom.h"
|
#include "z_en_bom.h"
|
||||||
#include "overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.h"
|
#include "overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.h"
|
||||||
|
|
||||||
|
#include "rumble.h"
|
||||||
|
|
||||||
#include "objects/gameplay_keep/gameplay_keep.h"
|
#include "objects/gameplay_keep/gameplay_keep.h"
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -196,7 +199,7 @@ void EnBom_Explode(EnBom* this, PlayState* play) {
|
||||||
|
|
||||||
if (this->explosionCollider.elements[0].dim.modelSphere.radius == 0) {
|
if (this->explosionCollider.elements[0].dim.modelSphere.radius == 0) {
|
||||||
this->actor.flags |= ACTOR_FLAG_DRAW_CULLING_DISABLED;
|
this->actor.flags |= ACTOR_FLAG_DRAW_CULLING_DISABLED;
|
||||||
func_800AA000(this->actor.xzDistToPlayer, 0xFF, 0x14, 0x96);
|
Rumble_Request(this->actor.xzDistToPlayer, 255, 20, 150);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CVarGetInteger(CVAR_ENHANCEMENT("StaticExplosionRadius"), 0)) {
|
if (CVarGetInteger(CVAR_ENHANCEMENT("StaticExplosionRadius"), 0)) {
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
#include "objects/object_bombf/object_bombf.h"
|
#include "objects/object_bombf/object_bombf.h"
|
||||||
#include "overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.h"
|
#include "overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.h"
|
||||||
|
|
||||||
|
#include "rumble.h"
|
||||||
|
|
||||||
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_UPDATE_CULLING_DISABLED)
|
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_UPDATE_CULLING_DISABLED)
|
||||||
|
|
||||||
void EnBombf_Init(Actor* thisx, PlayState* play);
|
void EnBombf_Init(Actor* thisx, PlayState* play);
|
||||||
|
@ -262,7 +264,7 @@ void EnBombf_Explode(EnBombf* this, PlayState* play) {
|
||||||
|
|
||||||
if (this->explosionCollider.elements[0].dim.modelSphere.radius == 0) {
|
if (this->explosionCollider.elements[0].dim.modelSphere.radius == 0) {
|
||||||
this->actor.flags |= ACTOR_FLAG_DRAW_CULLING_DISABLED;
|
this->actor.flags |= ACTOR_FLAG_DRAW_CULLING_DISABLED;
|
||||||
func_800AA000(this->actor.xzDistToPlayer, 0xFF, 0x14, 0x96);
|
Rumble_Request(this->actor.xzDistToPlayer, 255, 20, 150);
|
||||||
}
|
}
|
||||||
|
|
||||||
this->explosionCollider.elements[0].dim.modelSphere.radius += 8;
|
this->explosionCollider.elements[0].dim.modelSphere.radius += 8;
|
||||||
|
|
|
@ -11,6 +11,8 @@
|
||||||
#include "overlays/actors/ovl_En_fHG/z_en_fhg.h"
|
#include "overlays/actors/ovl_En_fHG/z_en_fhg.h"
|
||||||
#include "overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.h"
|
#include "overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.h"
|
||||||
|
|
||||||
|
#include "rumble.h"
|
||||||
|
|
||||||
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
|
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
@ -496,7 +498,7 @@ void EnFhgFire_EnergyBall(EnFhgFire* this, PlayState* play) {
|
||||||
Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_REFLECT_MG, &player->actor.projectedPos, 4,
|
Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_REFLECT_MG, &player->actor.projectedPos, 4,
|
||||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
|
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
|
||||||
&gSfxDefaultReverb);
|
&gSfxDefaultReverb);
|
||||||
func_800AA000(this->actor.xyzDistToPlayerSq, 0xFF, 0x14, 0x96);
|
Rumble_Request(this->actor.xyzDistToPlayerSq, 255, 20, 150);
|
||||||
} else {
|
} else {
|
||||||
if (bossGnd->flyMode == GND_FLY_NEUTRAL) {
|
if (bossGnd->flyMode == GND_FLY_NEUTRAL) {
|
||||||
angleModX = Rand_CenteredFloat(0x2000);
|
angleModX = Rand_CenteredFloat(0x2000);
|
||||||
|
@ -526,7 +528,7 @@ void EnFhgFire_EnergyBall(EnFhgFire* this, PlayState* play) {
|
||||||
Audio_PlaySoundGeneral(NA_SE_IT_SWORD_REFLECT_MG, &player->actor.projectedPos, 4,
|
Audio_PlaySoundGeneral(NA_SE_IT_SWORD_REFLECT_MG, &player->actor.projectedPos, 4,
|
||||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
|
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
|
||||||
&gSfxDefaultReverb);
|
&gSfxDefaultReverb);
|
||||||
func_800AA000(this->actor.xyzDistToPlayerSq, 0xB4, 0x14, 0x64);
|
Rumble_Request(this->actor.xyzDistToPlayerSq, 180, 20, 100);
|
||||||
}
|
}
|
||||||
} else if (sqrtf(SQ(dxL) + SQ(dyL) + SQ(dzL)) <= 25.0f) {
|
} else if (sqrtf(SQ(dxL) + SQ(dyL) + SQ(dzL)) <= 25.0f) {
|
||||||
killMode = BALL_BURST;
|
killMode = BALL_BURST;
|
||||||
|
|
|
@ -6,6 +6,9 @@
|
||||||
|
|
||||||
#include "z_en_horse.h"
|
#include "z_en_horse.h"
|
||||||
#include "overlays/actors/ovl_En_In/z_en_in.h"
|
#include "overlays/actors/ovl_En_In/z_en_in.h"
|
||||||
|
|
||||||
|
#include "rumble.h"
|
||||||
|
|
||||||
#include "objects/object_horse/object_horse.h"
|
#include "objects/object_horse/object_horse.h"
|
||||||
#include "objects/object_hni/object_hni.h"
|
#include "objects/object_hni/object_hni.h"
|
||||||
#include "scenes/overworld/spot09/spot09_scene.h"
|
#include "scenes/overworld/spot09/spot09_scene.h"
|
||||||
|
@ -1315,7 +1318,7 @@ void EnHorse_MountedTrot(EnHorse* this, PlayState* play) {
|
||||||
this->skin.skelAnime.playSpeed = this->actor.speedXZ * 0.375f;
|
this->skin.skelAnime.playSpeed = this->actor.speedXZ * 0.375f;
|
||||||
if (SkelAnime_Update(&this->skin.skelAnime)) {
|
if (SkelAnime_Update(&this->skin.skelAnime)) {
|
||||||
EnHorse_PlayTrottingSound(this);
|
EnHorse_PlayTrottingSound(this);
|
||||||
func_800AA000(0.0f, 60, 8, 255);
|
Rumble_Request(0.0f, 60, 8, 255);
|
||||||
if (this->actor.speedXZ >= 6.0f) {
|
if (this->actor.speedXZ >= 6.0f) {
|
||||||
EnHorse_StartGallopingInterruptable(this);
|
EnHorse_StartGallopingInterruptable(this);
|
||||||
} else if (this->actor.speedXZ < 3.0f) {
|
} else if (this->actor.speedXZ < 3.0f) {
|
||||||
|
@ -1383,7 +1386,7 @@ void EnHorse_MountedGallop(EnHorse* this, PlayState* play) {
|
||||||
this->skin.skelAnime.playSpeed = this->actor.speedXZ * 0.3f;
|
this->skin.skelAnime.playSpeed = this->actor.speedXZ * 0.3f;
|
||||||
if (SkelAnime_Update(&this->skin.skelAnime)) {
|
if (SkelAnime_Update(&this->skin.skelAnime)) {
|
||||||
EnHorse_PlayGallopingSound(this);
|
EnHorse_PlayGallopingSound(this);
|
||||||
func_800AA000(0, 120, 8, 255);
|
Rumble_Request(0, 120, 8, 255);
|
||||||
if (EnHorse_PlayerCanMove(this, play) == true) {
|
if (EnHorse_PlayerCanMove(this, play) == true) {
|
||||||
if (stickMag >= 10.0f && Math_CosS(stickAngle) <= -0.5f) {
|
if (stickMag >= 10.0f && Math_CosS(stickAngle) <= -0.5f) {
|
||||||
EnHorse_StartBraking(this, play);
|
EnHorse_StartBraking(this, play);
|
||||||
|
@ -1407,7 +1410,7 @@ void EnHorse_StartRearing(EnHorse* this) {
|
||||||
Audio_PlaySoundGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_21C, 4, &gSfxDefaultFreqAndVolScale,
|
Audio_PlaySoundGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_21C, 4, &gSfxDefaultFreqAndVolScale,
|
||||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||||
}
|
}
|
||||||
func_800AA000(0.0f, 180, 20, 100);
|
Rumble_Request(0.0f, 180, 20, 100);
|
||||||
Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], 1.0f, 0.0f,
|
Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], 1.0f, 0.0f,
|
||||||
Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), ANIMMODE_ONCE, -3.0f);
|
Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), ANIMMODE_ONCE, -3.0f);
|
||||||
}
|
}
|
||||||
|
@ -1422,7 +1425,7 @@ void EnHorse_MountedRearing(EnHorse* this, PlayState* play) {
|
||||||
this->stateFlags |= ENHORSE_LAND2_SOUND;
|
this->stateFlags |= ENHORSE_LAND2_SOUND;
|
||||||
Audio_PlaySoundGeneral(NA_SE_EV_HORSE_LAND2, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale,
|
Audio_PlaySoundGeneral(NA_SE_EV_HORSE_LAND2, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||||
func_800AA000(0, 180, 20, 100);
|
Rumble_Request(0.0f, 180, 20, 100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "z_en_ik.h"
|
#include "z_en_ik.h"
|
||||||
|
|
||||||
|
#include "rumble.h"
|
||||||
|
|
||||||
#include "scenes/dungeons/jyasinboss/jyasinboss_scene.h"
|
#include "scenes/dungeons/jyasinboss/jyasinboss_scene.h"
|
||||||
#include "objects/object_ik/object_ik.h"
|
#include "objects/object_ik/object_ik.h"
|
||||||
#include "vt.h"
|
#include "vt.h"
|
||||||
|
@ -444,7 +447,7 @@ void func_80A74EBC(EnIk* this, PlayState* play) {
|
||||||
sp2C.y = this->actor.world.pos.y;
|
sp2C.y = this->actor.world.pos.y;
|
||||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_IRONNACK_HIT_GND);
|
Audio_PlayActorSound2(&this->actor, NA_SE_EN_IRONNACK_HIT_GND);
|
||||||
Camera_AddQuake(&play->mainCamera, 2, 0x19, 5);
|
Camera_AddQuake(&play->mainCamera, 2, 0x19, 5);
|
||||||
func_800AA000(this->actor.xzDistToPlayer, 0xFF, 0x14, 0x96);
|
Rumble_Request(this->actor.xzDistToPlayer, 255, 20, 150);
|
||||||
CollisionCheck_SpawnShieldParticles(play, &sp2C);
|
CollisionCheck_SpawnShieldParticles(play, &sp2C);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,8 @@
|
||||||
#include "objects/gameplay_field_keep/gameplay_field_keep.h"
|
#include "objects/gameplay_field_keep/gameplay_field_keep.h"
|
||||||
#include "soh/OTRGlobals.h"
|
#include "soh/OTRGlobals.h"
|
||||||
|
|
||||||
|
#include "rumble.h"
|
||||||
|
|
||||||
#include "vt.h"
|
#include "vt.h"
|
||||||
|
|
||||||
#define FLAGS ACTOR_FLAG_THROW_ONLY
|
#define FLAGS ACTOR_FLAG_THROW_ONLY
|
||||||
|
@ -444,7 +446,7 @@ void EnIshi_Fly(EnIshi* this, PlayState* play) {
|
||||||
Quake_SetSpeed(quakeIdx, -0x3CB0);
|
Quake_SetSpeed(quakeIdx, -0x3CB0);
|
||||||
Quake_SetQuakeValues(quakeIdx, 3, 0, 0, 0);
|
Quake_SetQuakeValues(quakeIdx, 3, 0, 0, 0);
|
||||||
Quake_SetCountdown(quakeIdx, 7);
|
Quake_SetCountdown(quakeIdx, 7);
|
||||||
func_800AA000(this->actor.xyzDistToPlayerSq, 0xFF, 0x14, 0x96);
|
Rumble_Request(this->actor.xyzDistToPlayerSq, 255, 20, 150);
|
||||||
}
|
}
|
||||||
Actor_Kill(&this->actor);
|
Actor_Kill(&this->actor);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
#include "z_en_m_thunder.h"
|
#include "z_en_m_thunder.h"
|
||||||
|
|
||||||
|
#include "rumble.h"
|
||||||
|
|
||||||
#include "objects/gameplay_keep/gameplay_keep.h"
|
#include "objects/gameplay_keep/gameplay_keep.h"
|
||||||
|
|
||||||
#define FLAGS 0
|
#define FLAGS 0
|
||||||
|
@ -174,7 +177,7 @@ void func_80A9F408(EnMThunder* this, PlayState* play) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player->unk_858 >= 0.1f) {
|
if (player->unk_858 >= 0.1f) {
|
||||||
func_800AA000(0.0f, (s32)(player->unk_858 * 150.0f) & 0xFF, 2, (s32)(player->unk_858 * 150.0f) & 0xFF);
|
Rumble_Request(0.0f, (s32)(player->unk_858 * 150.0f) & 0xFF, 2, (s32)(player->unk_858 * 150.0f) & 0xFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player->stateFlags2 & PLAYER_STATE2_SPIN_ATTACKING) {
|
if (player->stateFlags2 & PLAYER_STATE2_SPIN_ATTACKING) {
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "z_en_mb.h"
|
#include "z_en_mb.h"
|
||||||
|
|
||||||
|
#include "rumble.h"
|
||||||
|
|
||||||
#include "objects/object_mb/object_mb.h"
|
#include "objects/object_mb/object_mb.h"
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
||||||
#include "soh/ResourceManagerHelpers.h"
|
#include "soh/ResourceManagerHelpers.h"
|
||||||
|
@ -886,7 +889,7 @@ void EnMb_ClubAttack(EnMb* this, PlayState* play) {
|
||||||
effSpawnPos = this->effSpawnPos;
|
effSpawnPos = this->effSpawnPos;
|
||||||
effSpawnPos.y = this->actor.floorHeight;
|
effSpawnPos.y = this->actor.floorHeight;
|
||||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_MONBLIN_HAM_LAND);
|
Audio_PlayActorSound2(&this->actor, NA_SE_EN_MONBLIN_HAM_LAND);
|
||||||
func_800AA000(this->actor.xzDistToPlayer, 0xFF, 0x14, 0x96);
|
Rumble_Request(this->actor.xzDistToPlayer, 255, 20, 150);
|
||||||
EffectSsBlast_SpawnWhiteShockwave(play, &effSpawnPos, &effWhiteShockwaveDynamics,
|
EffectSsBlast_SpawnWhiteShockwave(play, &effSpawnPos, &effWhiteShockwaveDynamics,
|
||||||
&effWhiteShockwaveDynamics);
|
&effWhiteShockwaveDynamics);
|
||||||
func_80033480(play, &effSpawnPos, 2.0f, 3, 0x12C, 0xB4, 1);
|
func_80033480(play, &effSpawnPos, 2.0f, 3, 0x12C, 0xB4, 1);
|
||||||
|
@ -1076,7 +1079,7 @@ void EnMb_ClubDamaged(EnMb* this, PlayState* play) {
|
||||||
if (this->timer3 != 0) {
|
if (this->timer3 != 0) {
|
||||||
Animation_PlayOnce(&this->skelAnime, &gEnMbClubStandUpAnim);
|
Animation_PlayOnce(&this->skelAnime, &gEnMbClubStandUpAnim);
|
||||||
this->timer3 = 0;
|
this->timer3 = 0;
|
||||||
func_800AA000(this->actor.xzDistToPlayer, 0xFF, 0x14, 0x96);
|
Rumble_Request(this->actor.xzDistToPlayer, 255, 20, 150);
|
||||||
Camera_AddQuake(&play->mainCamera, 2, 25, 5);
|
Camera_AddQuake(&play->mainCamera, 2, 25, 5);
|
||||||
} else {
|
} else {
|
||||||
EnMb_SetupClubWaitPlayerNear(this);
|
EnMb_SetupClubWaitPlayerNear(this);
|
||||||
|
@ -1135,7 +1138,7 @@ void EnMb_ClubDead(EnMb* this, PlayState* play) {
|
||||||
Actor_Kill(&this->actor);
|
Actor_Kill(&this->actor);
|
||||||
}
|
}
|
||||||
} else if ((s32)this->skelAnime.curFrame == 15 || (s32)this->skelAnime.curFrame == 22) {
|
} else if ((s32)this->skelAnime.curFrame == 15 || (s32)this->skelAnime.curFrame == 22) {
|
||||||
func_800AA000(this->actor.xzDistToPlayer, 0xFF, 0x14, 0x96);
|
Rumble_Request(this->actor.xzDistToPlayer, 255, 20, 150);
|
||||||
Actor_SpawnFloorDustRing(play, &this->actor, &effPos, 50.0f, 10, 3.0f, 400, 60, false);
|
Actor_SpawnFloorDustRing(play, &this->actor, &effPos, 50.0f, 10, 3.0f, 400, 60, false);
|
||||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_DOWN);
|
Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_DOWN);
|
||||||
Camera_AddQuake(&play->mainCamera, 2, 25, 5);
|
Camera_AddQuake(&play->mainCamera, 2, 25, 5);
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
#include "z_en_rd.h"
|
#include "z_en_rd.h"
|
||||||
|
|
||||||
|
#include "rumble.h"
|
||||||
|
|
||||||
#include "objects/object_rd/object_rd.h"
|
#include "objects/object_rd/object_rd.h"
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
||||||
#include "soh/ResourceManagerHelpers.h"
|
#include "soh/ResourceManagerHelpers.h"
|
||||||
|
@ -348,7 +351,8 @@ void func_80AE2C1C(EnRd* this, PlayState* play) {
|
||||||
player->actor.freezeTimer = 40;
|
player->actor.freezeTimer = 40;
|
||||||
Player_SetAutoLockOnActor(play, &this->actor);
|
Player_SetAutoLockOnActor(play, &this->actor);
|
||||||
GET_PLAYER(play)->autoLockOnActor = &this->actor;
|
GET_PLAYER(play)->autoLockOnActor = &this->actor;
|
||||||
func_800AA000(this->actor.xzDistToPlayer, 0xFF, 0x14, 0x96);
|
|
||||||
|
Rumble_Request(this->actor.xzDistToPlayer, 255, 20, 150);
|
||||||
}
|
}
|
||||||
this->unk_306 = 0x3C;
|
this->unk_306 = 0x3C;
|
||||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_AIM);
|
Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_AIM);
|
||||||
|
@ -503,7 +507,7 @@ void func_80AE3454(EnRd* this, PlayState* play) {
|
||||||
Animation_PlayLoop(&this->skelAnime, &gGibdoRedeadGrabAttackAnim);
|
Animation_PlayLoop(&this->skelAnime, &gGibdoRedeadGrabAttackAnim);
|
||||||
this->unk_304++;
|
this->unk_304++;
|
||||||
play->damagePlayer(play, -8);
|
play->damagePlayer(play, -8);
|
||||||
func_800AA000(this->actor.xzDistToPlayer, 0xFF, 1, 0xC);
|
Rumble_Request(this->actor.xzDistToPlayer, 255, 1, 12);
|
||||||
this->unk_319 = 20;
|
this->unk_319 = 20;
|
||||||
case 0:
|
case 0:
|
||||||
Math_SmoothStepToS(&this->unk_30E, 0, 1, 0x5DC, 0);
|
Math_SmoothStepToS(&this->unk_30E, 0, 1, 0x5DC, 0);
|
||||||
|
@ -537,7 +541,7 @@ void func_80AE3454(EnRd* this, PlayState* play) {
|
||||||
|
|
||||||
if (this->unk_319 == 0) {
|
if (this->unk_319 == 0) {
|
||||||
play->damagePlayer(play, -8);
|
play->damagePlayer(play, -8);
|
||||||
func_800AA000(this->actor.xzDistToPlayer, 0xF0, 1, 0xC);
|
Rumble_Request(this->actor.xzDistToPlayer, 240, 1, 12);
|
||||||
this->unk_319 = 20;
|
this->unk_319 = 20;
|
||||||
Player_PlaySfx(&player->actor, NA_SE_VO_LI_DAMAGE_S + player->ageProperties->unk_92);
|
Player_PlaySfx(&player->actor, NA_SE_VO_LI_DAMAGE_S + player->ageProperties->unk_92);
|
||||||
}
|
}
|
||||||
|
@ -577,7 +581,7 @@ void func_80AE3834(EnRd* this, PlayState* play) {
|
||||||
if (ABS(temp_v0) < 0x2008) {
|
if (ABS(temp_v0) < 0x2008) {
|
||||||
if (!(this->unk_312 & 0x80) && GameInteractor_Should(VB_REDEAD_GIBDO_FREEZE_LINK, true, this)) {
|
if (!(this->unk_312 & 0x80) && GameInteractor_Should(VB_REDEAD_GIBDO_FREEZE_LINK, true, this)) {
|
||||||
player->actor.freezeTimer = 60;
|
player->actor.freezeTimer = 60;
|
||||||
func_800AA000(this->actor.xzDistToPlayer, 0xFF, 0x14, 0x96);
|
Rumble_Request(this->actor.xzDistToPlayer, 255, 20, 150);
|
||||||
Player_SetAutoLockOnActor(play, &this->actor);
|
Player_SetAutoLockOnActor(play, &this->actor);
|
||||||
}
|
}
|
||||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_AIM);
|
Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_AIM);
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "z_en_rr.h"
|
#include "z_en_rr.h"
|
||||||
|
|
||||||
|
#include "rumble.h"
|
||||||
|
|
||||||
#include "objects/object_rr/object_rr.h"
|
#include "objects/object_rr/object_rr.h"
|
||||||
#include "vt.h"
|
#include "vt.h"
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
||||||
|
@ -624,7 +627,7 @@ void EnRr_Reach(EnRr* this, PlayState* play) {
|
||||||
void EnRr_GrabPlayer(EnRr* this, PlayState* play) {
|
void EnRr_GrabPlayer(EnRr* this, PlayState* play) {
|
||||||
Player* player = GET_PLAYER(play);
|
Player* player = GET_PLAYER(play);
|
||||||
|
|
||||||
func_800AA000(this->actor.xyzDistToPlayerSq, 120, 2, 120);
|
Rumble_Request(this->actor.xyzDistToPlayerSq, 120, 2, 120);
|
||||||
if ((this->frameCount % 8) == 0) {
|
if ((this->frameCount % 8) == 0) {
|
||||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_LIKE_EAT);
|
Audio_PlayActorSound2(&this->actor, NA_SE_EN_LIKE_EAT);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "z_en_zl4.h"
|
#include "z_en_zl4.h"
|
||||||
|
|
||||||
|
#include "rumble.h"
|
||||||
|
|
||||||
#include "objects/object_zl4/object_zl4.h"
|
#include "objects/object_zl4/object_zl4.h"
|
||||||
#include "scenes/indoors/nakaniwa/nakaniwa_scene.h"
|
#include "scenes/indoors/nakaniwa/nakaniwa_scene.h"
|
||||||
#include "soh/OTRGlobals.h"
|
#include "soh/OTRGlobals.h"
|
||||||
|
@ -922,7 +925,7 @@ s32 EnZl4_CsLookWindow(EnZl4* this, PlayState* play) {
|
||||||
play->csCtx.state = CS_STATE_UNSKIPPABLE_INIT;
|
play->csCtx.state = CS_STATE_UNSKIPPABLE_INIT;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
func_800AA000(0.0f, 0xA0, 0xA, 0x28);
|
Rumble_Request(0.0f, 160, 10, 40);
|
||||||
Player_SetCsActionWithHaltedActors(play, &this->actor, 1);
|
Player_SetCsActionWithHaltedActors(play, &this->actor, 1);
|
||||||
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ZL4_ANIM_30);
|
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ZL4_ANIM_30);
|
||||||
EnZl4_SetCsCameraAngle(play, 11);
|
EnZl4_SetCsCameraAngle(play, 11);
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#include "overlays/actors/ovl_En_Kanban/z_en_kanban.h"
|
#include "overlays/actors/ovl_En_Kanban/z_en_kanban.h"
|
||||||
#include "objects/object_fish/object_fish.h"
|
#include "objects/object_fish/object_fish.h"
|
||||||
#include "vt.h"
|
#include "vt.h"
|
||||||
|
#include "rumble.h"
|
||||||
|
|
||||||
#include "soh/frame_interpolation.h"
|
#include "soh/frame_interpolation.h"
|
||||||
#include "soh/OTRGlobals.h"
|
#include "soh/OTRGlobals.h"
|
||||||
|
@ -3568,7 +3569,7 @@ void Fishing_UpdateFish(Actor* thisx, PlayState* play2) {
|
||||||
}
|
}
|
||||||
sLureBitTimer = timer;
|
sLureBitTimer = timer;
|
||||||
sRumbleDelay = timer;
|
sRumbleDelay = timer;
|
||||||
func_800A9F6C(0.0f, 60, timer * 3, 10);
|
Rumble_Override(0.0f, 60, timer * 3, 10);
|
||||||
} else {
|
} else {
|
||||||
if (this->fishLength > 70.0f) {
|
if (this->fishLength > 70.0f) {
|
||||||
timer = (s16)Rand_ZeroFloat(5.0f) + 10;
|
timer = (s16)Rand_ZeroFloat(5.0f) + 10;
|
||||||
|
@ -3581,7 +3582,7 @@ void Fishing_UpdateFish(Actor* thisx, PlayState* play2) {
|
||||||
}
|
}
|
||||||
sLureBitTimer = timer;
|
sLureBitTimer = timer;
|
||||||
sRumbleDelay = timer;
|
sRumbleDelay = timer;
|
||||||
func_800A9F6C(0.0f, 180, timer * 3, 10);
|
Rumble_Override(0.0f, 180, timer * 3, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
sLineHooked = 0;
|
sLineHooked = 0;
|
||||||
|
@ -3623,11 +3624,11 @@ void Fishing_UpdateFish(Actor* thisx, PlayState* play2) {
|
||||||
if (sLureEquipped == FS_LURE_SINKING) {
|
if (sLureEquipped == FS_LURE_SINKING) {
|
||||||
sLureBitTimer = 30;
|
sLureBitTimer = 30;
|
||||||
sRumbleDelay = 100;
|
sRumbleDelay = 100;
|
||||||
func_800A9F6C(0.0f, 60, 90, 10);
|
Rumble_Override(0.0f, 60, 90, 10);
|
||||||
} else {
|
} else {
|
||||||
sLureBitTimer = 30;
|
sLureBitTimer = 30;
|
||||||
sRumbleDelay = 40;
|
sRumbleDelay = 40;
|
||||||
func_800A9F6C(0.0f, 180, 90, 10);
|
Rumble_Override(0.0f, 180, 90, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
sLineHooked = false;
|
sLineHooked = false;
|
||||||
|
@ -3680,7 +3681,7 @@ void Fishing_UpdateFish(Actor* thisx, PlayState* play2) {
|
||||||
rumbleStrength = 255.0f;
|
rumbleStrength = 255.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
func_800A9F6C(0.0f, rumbleStrength, 120, 5);
|
Rumble_Override(0.0f, rumbleStrength, 120, 5);
|
||||||
sRumbleDelay = 40;
|
sRumbleDelay = 40;
|
||||||
sRodHitTimer = 10;
|
sRodHitTimer = 10;
|
||||||
Sfx_PlaySfxCentered(NA_SE_IT_FISHING_HIT);
|
Sfx_PlaySfxCentered(NA_SE_IT_FISHING_HIT);
|
||||||
|
@ -3711,7 +3712,7 @@ void Fishing_UpdateFish(Actor* thisx, PlayState* play2) {
|
||||||
rumbleStrength *= 3.0f / 4.0f;
|
rumbleStrength *= 3.0f / 4.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
func_800A9F6C(0.0f, rumbleStrength, (s16)Rand_ZeroFloat(5.0f) + 10, 5);
|
Rumble_Override(0.0f, rumbleStrength, (s16)Rand_ZeroFloat(5.0f) + 10, 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->timerArray[1] > 30) {
|
if (this->timerArray[1] > 30) {
|
||||||
|
@ -3742,7 +3743,7 @@ void Fishing_UpdateFish(Actor* thisx, PlayState* play2) {
|
||||||
} else {
|
} else {
|
||||||
rumbleStrength8 = 180;
|
rumbleStrength8 = 180;
|
||||||
}
|
}
|
||||||
func_800A9F6C(0.0f, rumbleStrength8, 90, 2);
|
Rumble_Override(0.0f, rumbleStrength8, 90, 2);
|
||||||
this->timerArray[0] = 20;
|
this->timerArray[0] = 20;
|
||||||
this->timerArray[1] = 100;
|
this->timerArray[1] = 100;
|
||||||
this->timerArray[2] = 20;
|
this->timerArray[2] = 20;
|
||||||
|
@ -3873,7 +3874,7 @@ void Fishing_UpdateFish(Actor* thisx, PlayState* play2) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
sFishingCaughtTextId = 0x4082;
|
sFishingCaughtTextId = 0x4082;
|
||||||
func_800A9F6C(0.0f, 1, 3, 1);
|
Rumble_Override(0.0f, 1, 3, 1);
|
||||||
Audio_QueueSeqCmd(0x1 << 28 | SEQ_PLAYER_BGM_MAIN << 24 | 0x0A00FF);
|
Audio_QueueSeqCmd(0x1 << 28 | SEQ_PLAYER_BGM_MAIN << 24 | 0x0A00FF);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3896,7 +3897,7 @@ void Fishing_UpdateFish(Actor* thisx, PlayState* play2) {
|
||||||
this->fishState = 6;
|
this->fishState = 6;
|
||||||
this->timerArray[0] = 100;
|
this->timerArray[0] = 100;
|
||||||
player->unk_860 = 3;
|
player->unk_860 = 3;
|
||||||
func_800A9F6C(0.0f, 1, 3, 1);
|
Rumble_Override(0.0f, 1, 3, 1);
|
||||||
sFishesCaught++;
|
sFishesCaught++;
|
||||||
func_80064520(play, &play->csCtx);
|
func_80064520(play, &play->csCtx);
|
||||||
sFishingPlayerCinematicState = 100;
|
sFishingPlayerCinematicState = 100;
|
||||||
|
@ -4852,7 +4853,7 @@ void Fishing_HandleOwnerDialog(Fishing* this, PlayState* play) {
|
||||||
case 0:
|
case 0:
|
||||||
if (gSaveContext.rupees >= 20) {
|
if (gSaveContext.rupees >= 20) {
|
||||||
Rupees_ChangeBy(-20);
|
Rupees_ChangeBy(-20);
|
||||||
if (func_800AA148() == 0) {
|
if (!Rumble_Controller1HasRumblePak()) {
|
||||||
this->actor.textId = 0x407C;
|
this->actor.textId = 0x407C;
|
||||||
} else {
|
} else {
|
||||||
this->actor.textId = 0x407D;
|
this->actor.textId = 0x407D;
|
||||||
|
@ -5365,7 +5366,7 @@ void Fishing_UpdateOwner(Actor* thisx, PlayState* play2) {
|
||||||
(fabsf(player->actor.world.pos.z - sSinkingLureLocationPos[sSinkingLureLocation - 1].z) < 25.0f)) {
|
(fabsf(player->actor.world.pos.z - sSinkingLureLocationPos[sSinkingLureLocation - 1].z) < 25.0f)) {
|
||||||
sSinkingLureLocation = 0;
|
sSinkingLureLocation = 0;
|
||||||
sFishingPlayerCinematicState = 20;
|
sFishingPlayerCinematicState = 20;
|
||||||
func_800A9F6C(0.0f, 150, 10, 10);
|
Rumble_Override(0.0f, 150, 10, 10);
|
||||||
Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR);
|
Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR);
|
||||||
Audio_QueueSeqCmd(0x1 << 28 | SEQ_PLAYER_BGM_MAIN << 24 | 0x1400FF);
|
Audio_QueueSeqCmd(0x1 << 28 | SEQ_PLAYER_BGM_MAIN << 24 | 0x1400FF);
|
||||||
}
|
}
|
||||||
|
@ -5374,7 +5375,7 @@ void Fishing_UpdateOwner(Actor* thisx, PlayState* play2) {
|
||||||
KREG(0) = 0;
|
KREG(0) = 0;
|
||||||
sLureEquipped = FS_LURE_STOCK;
|
sLureEquipped = FS_LURE_STOCK;
|
||||||
sFishingPlayerCinematicState = 20;
|
sFishingPlayerCinematicState = 20;
|
||||||
func_800A9F6C(0.0f, 150, 10, 10);
|
Rumble_Override(0.0f, 150, 10, 10);
|
||||||
Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR);
|
Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR);
|
||||||
Audio_QueueSeqCmd(0x1 << 28 | SEQ_PLAYER_BGM_MAIN << 24 | 0x1400FF);
|
Audio_QueueSeqCmd(0x1 << 28 | SEQ_PLAYER_BGM_MAIN << 24 | 0x1400FF);
|
||||||
}
|
}
|
||||||
|
@ -5534,7 +5535,7 @@ void Fishing_UpdateOwner(Actor* thisx, PlayState* play2) {
|
||||||
sCameraAt.z = mainCam->at.z;
|
sCameraAt.z = mainCam->at.z;
|
||||||
Message_StartTextbox(play, 0x409E, NULL);
|
Message_StartTextbox(play, 0x409E, NULL);
|
||||||
sFishingPlayerCinematicState = 11;
|
sFishingPlayerCinematicState = 11;
|
||||||
func_800A9F6C(0.0f, 150, 10, 10);
|
Rumble_Override(0.0f, 150, 10, 10);
|
||||||
// fallthrough
|
// fallthrough
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "z_obj_switch.h"
|
#include "z_obj_switch.h"
|
||||||
|
|
||||||
|
#include "rumble.h"
|
||||||
|
|
||||||
#include "objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h"
|
#include "objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h"
|
||||||
#include "vt.h"
|
#include "vt.h"
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
||||||
|
@ -430,7 +433,7 @@ void ObjSwitch_FloorPress(ObjSwitch* this, PlayState* play) {
|
||||||
if (this->dyna.actor.scale.y <= 33.0f / 2000.0f) {
|
if (this->dyna.actor.scale.y <= 33.0f / 2000.0f) {
|
||||||
ObjSwitch_FloorDownInit(this);
|
ObjSwitch_FloorDownInit(this);
|
||||||
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_FOOT_SWITCH);
|
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_FOOT_SWITCH);
|
||||||
func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 120, 20, 10);
|
Rumble_Request(this->dyna.actor.xyzDistToPlayerSq, 120, 20, 10);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -488,7 +491,7 @@ void ObjSwitch_FloorRelease(ObjSwitch* this, PlayState* play) {
|
||||||
ObjSwitch_FloorUpInit(this);
|
ObjSwitch_FloorUpInit(this);
|
||||||
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_FOOT_SWITCH);
|
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_FOOT_SWITCH);
|
||||||
if (subType == OBJSWITCH_SUBTYPE_FLOOR_1) {
|
if (subType == OBJSWITCH_SUBTYPE_FLOOR_1) {
|
||||||
func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 120, 20, 10);
|
Rumble_Request(this->dyna.actor.xyzDistToPlayerSq, 120, 20, 10);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,6 +34,8 @@
|
||||||
#include "soh/OTRGlobals.h"
|
#include "soh/OTRGlobals.h"
|
||||||
#include "soh/ResourceManagerHelpers.h"
|
#include "soh/ResourceManagerHelpers.h"
|
||||||
|
|
||||||
|
#include "rumble.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
@ -1740,7 +1742,7 @@ void func_80832630(PlayState* play) {
|
||||||
|
|
||||||
void Player_RequestRumble(Player* this, s32 sourceStrength, s32 duration, s32 decreaseRate, s32 distSq) {
|
void Player_RequestRumble(Player* this, s32 sourceStrength, s32 duration, s32 decreaseRate, s32 distSq) {
|
||||||
if (this->actor.category == ACTORCAT_PLAYER) {
|
if (this->actor.category == ACTORCAT_PLAYER) {
|
||||||
func_800AA000(distSq, sourceStrength, duration, decreaseRate);
|
Rumble_Request(distSq, sourceStrength, duration, decreaseRate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include "rumble.h"
|
||||||
|
|
||||||
#include "textures/title_static/title_static.h"
|
#include "textures/title_static/title_static.h"
|
||||||
#include "textures/parameter_static/parameter_static.h"
|
#include "textures/parameter_static/parameter_static.h"
|
||||||
|
@ -3064,7 +3065,7 @@ void FileChoose_ConfirmFile(GameState* thisx) {
|
||||||
|
|
||||||
if (CHECK_BTN_ALL(input->press.button, BTN_START) || (CHECK_BTN_ALL(input->press.button, BTN_A))) {
|
if (CHECK_BTN_ALL(input->press.button, BTN_START) || (CHECK_BTN_ALL(input->press.button, BTN_A))) {
|
||||||
if (this->confirmButtonIndex == FS_BTN_CONFIRM_YES) {
|
if (this->confirmButtonIndex == FS_BTN_CONFIRM_YES) {
|
||||||
func_800AA000(300.0f, 180, 20, 100);
|
Rumble_Request(300.0f, 180, 20, 100);
|
||||||
Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||||
this->selectMode = SM_FADE_OUT;
|
this->selectMode = SM_FADE_OUT;
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
#include "file_choose.h"
|
#include "file_choose.h"
|
||||||
|
|
||||||
|
#include "rumble.h"
|
||||||
|
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
||||||
#include "soh/SaveManager.h"
|
#include "soh/SaveManager.h"
|
||||||
|
|
||||||
|
@ -396,7 +399,7 @@ void FileChoose_CopyConfirm(GameState* thisx) {
|
||||||
this->nextTitleLabel = FS_TITLE_COPY_COMPLETE;
|
this->nextTitleLabel = FS_TITLE_COPY_COMPLETE;
|
||||||
this->actionTimer = 8;
|
this->actionTimer = 8;
|
||||||
this->configMode = CM_COPY_ANIM_1;
|
this->configMode = CM_COPY_ANIM_1;
|
||||||
func_800AA000(300.0f, 0xB4, 0x14, 0x64);
|
Rumble_Request(300.0f, 180, 20, 100);
|
||||||
Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||||
} else if ((ABS(this->stickRelY) >= 30) || (dpad && CHECK_BTN_ANY(input->press.button, BTN_DDOWN | BTN_DUP))) {
|
} else if ((ABS(this->stickRelY) >= 30) || (dpad && CHECK_BTN_ANY(input->press.button, BTN_DDOWN | BTN_DUP))) {
|
||||||
|
@ -872,7 +875,7 @@ void FileChoose_EraseConfirm(GameState* thisx) {
|
||||||
this->actionTimer = 8;
|
this->actionTimer = 8;
|
||||||
this->configMode = CM_ERASE_ANIM_1;
|
this->configMode = CM_ERASE_ANIM_1;
|
||||||
this->nextTitleLabel = FS_TITLE_ERASE_COMPLETE;
|
this->nextTitleLabel = FS_TITLE_ERASE_COMPLETE;
|
||||||
func_800AA000(200.0f, 0xFF, 0x14, 0x96);
|
Rumble_Request(200.0f, 255, 20, 150);
|
||||||
sEraseDelayTimer = 15;
|
sEraseDelayTimer = 15;
|
||||||
} else if ((ABS(this->stickRelY) >= 30) || (dpad && CHECK_BTN_ANY(input->press.button, BTN_DDOWN | BTN_DUP))) {
|
} else if ((ABS(this->stickRelY) >= 30) || (dpad && CHECK_BTN_ANY(input->press.button, BTN_DDOWN | BTN_DUP))) {
|
||||||
Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||||
|
|
|
@ -465,7 +465,7 @@ void FileChoose_DrawNameEntry(GameState* thisx) {
|
||||||
CVarSetInteger(CVAR_GENERAL("OnFileSelectNameEntry"), 0);
|
CVarSetInteger(CVAR_GENERAL("OnFileSelectNameEntry"), 0);
|
||||||
this->nameBoxAlpha[this->buttonIndex] = this->nameAlpha[this->buttonIndex] = 200;
|
this->nameBoxAlpha[this->buttonIndex] = this->nameAlpha[this->buttonIndex] = 200;
|
||||||
this->connectorAlpha[this->buttonIndex] = 255;
|
this->connectorAlpha[this->buttonIndex] = 255;
|
||||||
func_800AA000(300.0f, 0xB4, 0x14, 0x64);
|
Rumble_Request(300.0f, 180, 20, 100);
|
||||||
} else {
|
} else {
|
||||||
Audio_PlaySoundGeneral(NA_SE_SY_FSEL_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
Audio_PlaySoundGeneral(NA_SE_SY_FSEL_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue