some rumble diffs

This commit is contained in:
AloXado320 2021-05-12 13:17:35 -05:00
parent 37c0eb51f7
commit 1d2cdcec20
8 changed files with 22 additions and 12 deletions

View file

@ -30,9 +30,13 @@ struct Controller
/*0x12*/ u16 buttonPressed;
/*0x14*/ OSContStatus *statusData;
/*0x18*/ OSContPad *controllerData;
/*0x1C*/ int port;
#ifdef RUMBLE_FEEDBACK
/*0x1C*/ s32 port;
#endif
#ifndef TARGET_N64
/*ext */ s16 extStickX; // additional (right) stick values
/*ext */ s16 extStickY;
#endif
};
typedef f32 Vec2f[2];

View file

@ -11,7 +11,7 @@ ALIGNED8 u8 gThread3Stack[0x2000];
ALIGNED8 u8 gThread4Stack[0x2000];
ALIGNED8 u8 gThread5Stack[0x2000];
#ifdef VERSION_SH
#ifdef RUMBLE_FEEDBACK
ALIGNED8 u8 gThread6Stack[0x2000];
#endif
// 0x400 bytes

View file

@ -16,7 +16,7 @@ extern u8 gIdleThreadStack[];
extern u8 gThread3Stack[];
extern u8 gThread4Stack[];
extern u8 gThread5Stack[];
#ifdef VERSION_SH
#ifdef RUMBLE_FEEDBACK
extern u8 gThread6Stack[];
#endif

View file

@ -537,6 +537,9 @@ void read_controller_inputs(void) {
if (gControllerBits) {
osRecvMesg(&gSIEventMesgQueue, &D_80339BEC, OS_MESG_BLOCK);
osContGetReadData(&gControllerPads[0]);
#if RUMBLE_FEEDBACK
release_rumble_pak_control();
#endif
}
run_demo_inputs();
@ -622,7 +625,9 @@ void init_controllers(void) {
// into any port in order to play the game. this was probably
// so if any of the ports didn't work, you can have controllers
// plugged into any of them and it will work.
#ifdef RUMBLE_FEEDBACK
gControllers[cont].port = port;
#endif
gControllers[cont].statusData = &gControllerStatuses[port];
gControllers[cont++].controllerData = &gControllerPads[port];
}
@ -657,11 +662,11 @@ static struct LevelCommand *levelCommandAddr;
void thread5_game_loop(UNUSED void *arg) {
setup_game_memory();
#ifdef VERSION_SH
#ifdef RUMBLE_FEEDBACK
init_rumble_pak_scheduler_queue();
#endif
init_controllers();
#ifdef VERSION_SH
#ifdef RUMBLE_FEEDBACK
create_thread_6();
#endif
save_file_load_all();
@ -701,7 +706,7 @@ void game_loop_one_iteration(void) {
// if any controllers are plugged in, start read the data for when
// read_controller_inputs is called later.
if (gControllerBits) {
#ifdef VERSION_SH
#ifdef RUMBLE_FEEDBACK
block_until_rumble_pak_free();
#endif
osContStartReadData(&gSIEventMesgQueue);

View file

@ -265,7 +265,7 @@ void handle_vblank(void) {
start_sptask(M_GFXTASK);
}
}
#ifdef VERSION_SH
#ifdef RUMBLE_FEEDBACK
rumble_thread_update_vi();
#endif
// Notify the game loop about the vblank.

View file

@ -39,7 +39,7 @@ extern OSMesg D_80339BEC;
extern OSMesgQueue gDmaMesgQueue;
extern OSMesgQueue gSIEventMesgQueue;
#ifdef VERSION_SH
#ifdef RUMBLE_FEEDBACK
extern OSThread gRumblePakThread;
extern OSMesg gRumblePakSchedulerMesgBuf[1];
extern OSMesg gRumbleThreadVIMesgBuf[1];

View file

@ -1515,13 +1515,14 @@ s32 act_hold_butt_slide_air(struct MarioState *m) {
}
s32 act_lava_boost(struct MarioState *m) {
#ifdef RUMBLE_FEEDBACK
if (!(m->flags & MARIO_MARIO_SOUND_PLAYED)) {
#endif
play_sound_if_no_flag(m, SOUND_MARIO_ON_FIRE, MARIO_MARIO_SOUND_PLAYED);
#ifdef RUMBLE_FEEDBACK
queue_rumble_data(5, 80);
#endif
}
play_sound_if_no_flag(m, SOUND_MARIO_ON_FIRE, MARIO_MARIO_SOUND_PLAYED);
#endif
if (!(m->input & INPUT_NONZERO_ANALOG)) {
m->forwardVel = approach_f32(m->forwardVel, 0.0f, 0.35f, 0.35f);

View file

@ -1,7 +1,7 @@
#ifndef RUMBLE_INIT_H
#define RUMBLE_INIT_H
#if defined(VERSION_SH) || defined(RUMBLE_FEEDBACK)
#ifdef RUMBLE_FEEDBACK
extern s32 gRumblePakTimer;
@ -19,6 +19,6 @@ void create_thread_6(void);
void rumble_thread_update_vi(void);
void thread6_rumble_loop(void *a0);
#endif // VERSION_SH
#endif // RUMBLE_FEEDBACK
#endif // RUMBLE_INIT_H