Start on sfx IDs (#227)

* sfx stuff

* sfxIds
This commit is contained in:
petrie911 2024-05-03 14:56:26 -05:00 committed by GitHub
parent c9df6fda72
commit 77060ba506
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
31 changed files with 845 additions and 341 deletions

View File

@ -9,7 +9,7 @@
// fox_360
void AllRange_FortunaIntro(Player*);
void AllRange_GetStarWolfHits(Actor*);
void AllRange_UpdateCountdown(void);
void AllRange_DrawCountdown(void);
void Boss309_Update(Boss*);
void Boss309_Draw(Boss*);
void Boss310_Update(Boss*);
@ -395,7 +395,7 @@ void func_hud_8008B5B0(f32 x, f32 y);
s32 func_hud_8008B774(void);
void func_hud_8008BD00(u8*, s32, s32, u8);
void func_hud_8008C104(u16*, u16*);
void func_hud_8008C390(f32, f32, f32, s32);
void HUD_DisplaySmallNumber(f32, f32, f32, s32);
void func_hud_8008C5C8(f32, f32, f32, s32);
void func_hud_8008C6F4(s32, s32);
s32 func_hud_8008BCBC(s32);
@ -403,7 +403,7 @@ void HUD_DrawEdgeArrows(void);
s32 HUD_dummy_8008CB8C(void);
void func_hud_8008D0DC(f32, f32, f32, f32, f32);
void HUD_DrawBossHealth(void);
void func_hud_8008E51C(s32* , f32);
void HUD_DrawCountdown(s32* , f32);
void func_hud_8008E9EC(f32, f32);
void func_hud_8008EA14(f32, f32);
void HUD_Draw(void);

View File

@ -44,6 +44,8 @@
#define CYCLES_TO_USEC(c) (((u64)(c)*(1000000LL/15625LL))/(osClockRate/15625LL))
#define CYCLES_TO_MSEC(c) ((s32)CYCLES_TO_USEC(c)/1000)
#define UNPACK_BYTE(data, bytenum) (((data) & (0xFF << ((bytenum) * 8))) >> ((bytenum) * 8))
/*
* Macros for libultra
*/

View File

@ -17,6 +17,12 @@
*/
#define MODS_SFX_JUKEBOX 0
/**
* Auto debugger:
* Crash debugger appears without needing to enter code.
*/
#define MODS_AUTO_DEBUGGER 0
/**
* FPS Counter:
* Press L to toggle FPS Display

View File

@ -3,6 +3,7 @@
#include "sys.h"
#include "audioseq_cmd.h"
#include "sfx.h"
#define AUDIO_PLAY_SFX(sfxId, srcPos, token) (Audio_PlaySfx((sfxId),(srcPos),(token),&gDefaultMod,&gDefaultMod,&gDefaultReverb))
#define AUDIO_PLAY_BGM(seqId) Audio_PlaySequence(SEQ_PLAYER_BGM, (seqId), 0, -1)

View File

@ -123,9 +123,9 @@ typedef enum {
} AudioLoadStatus;
typedef enum AudioResetStatus {
AUDIORESET_READY,
AUDIORESET_WAIT,
AUDIORESET_BLOCK,
/* 0 */ AUDIORESET_READY,
/* 1 */ AUDIORESET_WAIT,
/* 2 */ AUDIORESET_BLOCK,
} AudioResetStatus;
typedef s32 (*DmaHandler)(OSPiHandle* handle, OSIoMesg* mb, s32 direction);
@ -990,36 +990,6 @@ typedef struct {
#define SEQ_BYTE3(seqId) (((seqId) & (0xFF << 8)) >>8 & 0xFF)
#define SEQ_BYTE2(seqId) (((seqId) & (0xFF << 16)) >>13 & 0xFFFF)
#define SFX_BANK_MASK(sfxId) ((sfxId) & (0xF << 28))
#define SFX_STATE_MASK(sfxId) ((sfxId) & (1 << 24))
#define SFX_RANGE_MASK(sfxId) ((sfxId) & (3 << 16))
#define SFX_IMPORTANCE_MASK(sfxId) ((sfxId) & (0xFF << 8))
#define SFX_BANK_SHIFT(sfxId) (((sfxId) >> 28) & 0xFF)
#define SFX_STATE_SHIFT(sfxId) (((sfxId) >> 24))
#define SFX_RANGE_SHIFT(sfxId) (((sfxId) >> 16) & 0xFF)
#define SFX_IMPORTANCE_SHIFT(sfxId) (((sfxId) >> 8) & 0xFF)
#define SFX_BANK(sfxId) SFX_BANK_SHIFT(SFX_BANK_MASK(sfxId))
#define SFX_STATE(sfxId) SFX_STATE_SHIFT(SFX_STATE_MASK(sfxId))
#define SFX_BIT04(sfxId) ((sfxId) & (1 << 27))
#define SFX_BIT05(sfxId) ((sfxId) & (1 << 26))
#define SFX_BIT06(sfxId) ((sfxId) & (1 << 25))
#define SFX_BIT08(sfxId) ((sfxId) & (1 << 23)) // adds random variance to freqMod
#define SFX_BIT09(sfxId) ((sfxId) & (1 << 22)) // turns off distance-dependent frequency increase
#define SFX_BIT10(sfxId) ((sfxId) & (1 << 21)) // makes reverb increase with distance
#define SFX_BIT11(sfxId) ((sfxId) & (1 << 20)) // makes priority independent of distance
#define SFX_BIT12(sfxId) ((sfxId) & (1 << 19))
#define SFX_BIT13(sfxId) ((sfxId) & (1 << 18)) // makes distance ignore z position? probably more
#define SFX_RANGE(sfxId) SFX_RANGE_SHIFT(SFX_RANGE_MASK(sfxId))
#define SFX_IMPORTANCE(sfxId) SFX_IMPORTANCE_SHIFT(SFX_IMPORTANCE_MASK(sfxId))
#define SFX_INDEX(sfxId) ((sfxId) & 0xFF)
#define SFX_PACK(bank, range, importance, index, state, bit4, bit5, bit6, bit8, bit9, bit10, bit11, bit12, bit13) \
(((bank)<<28)|((range)<<16)|((importance)<<8)|(index)|((state)<<24)|\
((bit4)<<27)|((bit5)<<23)|((bit6)<<23)|((bit8)<<23)|((bit9)<<22)|\
((bit10)<<21)|((bit11)<<20)|((bit12)<<19)|((bit13)<<18))
// audio_synthesis
void func_80008780(f32 *, s32, f32 *);
Acmd* func_80009B64(Acmd* aList, s32* cmdCount, s16* aiBufStart, s32 aiBufLen);

165
include/sfx.h Normal file
View File

@ -0,0 +1,165 @@
#ifndef SFX_H
#define SFX_H
#define SFX_FLAG_18 (1 << 18) // makes distance ignore z position? probably more
#define SFX_FLAG_19 (1 << 19)
#define SFX_FLAG_20 (1 << 20) // make priority ignore distance
#define SFX_FLAG_21 (1 << 21) // make reverb ignore distance
#define SFX_FLAG_22 (1 << 22) // make volume ignore distance
#define SFX_FLAG_23 (1 << 23) // make noisy
#define SFX_FLAG_27 (1 << 27) // allow duplicate requests
#define SFX_BANK_SHIFT 28
#define SFX_STATE_SHIFT 24
#define SFX_RANGE_SHIFT 16
#define SFX_IMPORT_SHIFT 8
#define SFX_BANK_MASK (0xF << SFX_BANK_SHIFT)
#define SFX_STATE_FLAG (1 << SFX_STATE_SHIFT)
#define SFX_RANGE_MASK (3 << SFX_RANGE_SHIFT)
#define SFX_IMPORT_MASK (0xFF << SFX_IMPORT_SHIFT)
#define SFX_BANK(sfxId) ((((sfxId) & SFX_BANK_MASK) >> SFX_BANK_SHIFT) & 0xFF)
#define SFX_BANK_ALT(sfxId) (((sfxId) >> SFX_BANK_SHIFT) & 0xFF)
#define SFX_STATE(sfxId) (((sfxId) & SFX_STATE_FLAG) >> SFX_STATE_SHIFT)
#define SFX_RANGE(sfxId) ((((sfxId) & SFX_RANGE_MASK) >> SFX_RANGE_SHIFT) & 0xFF)
#define SFX_IMPORT(sfxId) ((((sfxId) & SFX_IMPORT_MASK) >> SFX_IMPORT_SHIFT) & 0xFF)
#define SFX_INDEX(sfxId) ((sfxId) & 0xFF)
#define SFX_PACK(bank, index, range, importance, flags) \
((((bank)<<SFX_BANK_SHIFT)&SFX_BANK_MASK)|(((range)<<SFX_RANGE_SHIFT)&SFX_RANGE_MASK)|\
(((importance)<<SFX_IMPORT_SHIFT)&SFX_IMPORT_MASK)|((index)&0xFF)|SFX_STATE_FLAG|(flags))
typedef enum SfxBankId {
SFX_BANK_PLAYER,
SFX_BANK_1,
SFX_BANK_2,
SFX_BANK_3,
SFX_BANK_SYSTEM,
} SfxBankId;
#define NA_SE_NONE 0x00000000
#define NA_SE_TURRET_SHOT 0x09000000 // Invented name. Appears in unused turret mode.
#define NA_SE_ARWING_SHOT 0x09400000
#define NA_SE_SMART_BOMB_SHOT 0x09001001
#define NA_SE_ARWING_BOOST 0x09000002
#define NA_SE_ARWING_DASH 0x09004002 // Boost variant used by Venom 1 intro and boss Titania
#define NA_SE_ARWING_BRAKE 0x09000003
#define NA_SE_ARWING_EXPLOSION 0x0903F004
#define NA_SE_SLIPPY_HIT 0x09000004 // From Sector X boss
#define NA_SE_ARWING_ENGIN_GRD 0x0100F005
#define NA_SE_TANK_ENGIN 0x0100F006
#define NA_SE_WING_OPEN 0x09000007
#define NA_SE_BOMB_CHARGE 0x01008008 // iniial bomb flight. only plays for 1 frame. Bombs were chargeable?
#define NA_SE_BOMB_EXPLODE0 0x0901A009 // unused bomb explosion
#define NA_SE_BOMB_EXPLODE1 0x0903A00A // used bomb explosion
#define NA_SE_BOMB_EXPLODE2 0x0901A00B // unused bomb explosion
#define NA_SE_BACKUP_CLEAR 0x0940A00B // Also used for explosion on Corneria at game start
#define NA_SE_ARWING_TWIN_LASER 0x0940800C
#define NA_SE_ZERO_SHIELD 0x0900000D // Unreferenced. Sounds like an explosion
#define NA_SE_DAMAGE_S 0x0903900E
#define NA_SE_DAMAGE_L 0x0903A00F
#define NA_SE_ARWING_DOWN 0x0900C010
#define NA_SE_ROLLING_REFLECT 0x09007011
#define NA_SE_ROLLING_AIR 0x09000012
#define NA_SE_WING_OPEN_END 0x09000013
#define NA_SE_LIFT_UP_END 0x09002013
#define NA_SE_TANK_SHOT 0x09000014 // Also used for on-foot shot
#define NA_SE_TANK_BOUND 0x09008015 // Same as NA_SE_TANK_WALL_HIT
#define NA_SE_TANK_WALL_HIT 0x09008015 // Same as NA_SE_TANK_BOUND
#define NA_SE_TANK_GO_UP 0x01008016
#define NA_SE_MAR_ROLLING_AIR 0x09000017
#define NA_SE_STEP_FOX 0x09000018 // Unreferenced
#define NA_SE_STEP_FALCO 0x09000019 // Unreferenced
#define NA_SE_STEP_PEPPY 0x0900001A // Unreferenced
#define NA_SE_STEP_SLIPPY 0x0900001B // Unreferenced
#define NA_SE_DENO_RUNNING 0x0140001C
#define NA_SE_LIFT_UP 0x0100001D
#define NA_SE_ENGINE_START 0x0100001E
#define NA_SE_VOLUME_TEST 0x0100001F
#define NA_SE_ARWING_ENGIN_SPC 0x0100F020
#define NA_SE_MAR_SHOT 0x09400021
#define NA_SE_MARINE_ENGINE00 0x0100F022
#define NA_SE_WING_REPAIR 0x09008023
#define NA_SE_TANK_BURNER_HALF 0x01004024
#define NA_SE_MAR_BOMB_SHOT 0x01000025
#define NA_SE_MAR_LAUNCH 0x01038026
#define NA_SE_MAR_TWIN_LASER 0x09400027 // Also used for hyper lasers
#define NA_SE_MAR_BOUND 0x09404028
#define NA_SE_LOCK_ON_LASER 0x09007029 // Charge shot fire
#define NA_SE_ARWING_WARP_DASH 0x0940802A // During warp zone entrance cutscene
#define NA_SE_MAP_ARWING_WARP_DASH 0x0900802A
#define NA_SE_ARWING_TWIN_LASER2 0x0940802B
#define NA_SE_ARWING_WING_BROKEN 0x0900A02C
#define NA_SE_LOCK_SEARCH 0x0900302D // Charge shot charge
#define NA_SE_SPREAD_EXPLSION 0x0903502E // Charge shot/torpedo explode
#define NA_SE_TANK_DASH 0x0900402F
#define NA_SE_MARINE_BOOST 0x09004030
#define NA_SE_MARINE_BRAKE 0x09004031
#define NA_SE_MAP_ARWING_DASH 0x09000032
#define NA_SE_PAUSE_ON 0x4900F000
#define NA_SE_PAUSE_OFF 0x4900F001 // Unreferenced. Seems to be identical to NA_SE_PAUSE_ON
#define NA_SE_CURSOR 0x49000002
#define NA_SE_DECIDE 0x49000003
#define NA_SE_TWIN_LASER_GET 0x49002004
#define NA_SE_BOMB_GET 0x49002005 // Collect bomb. Seems to be identical to NA_SE_BOMB_GUAGE_UP
#define NA_SE_BOMB_GAUGE_UP 0x49002006 // Collect bomb. Seems to be identical to NA_SE_BOMB_GET
#define NA_SE_COUNT_UP 0x49004007
#define NA_SE_READY 0x49000008
#define NA_SE_GO 0x49000009
#define NA_SE_ERROR 0x4900100A
#define NA_SE_DIR_WARNING 0x4100000B // Unreferenced.
#define NA_SE_ITEM_APPEAR 0x4900000C
#define NA_SE_SHIELD_RING_M 0x4900200D
#define NA_SE_SHIELD_RING 0x4900200E
#define NA_SE_CHECKPOINT 0x4900400F
#define NA_SE_SHIELD_WARNING0 0x49008010 // Low health hit alarm
#define NA_SE_SHIELD_WARNING1 0x49008011 // Critical health hit alarm
#define NA_SE_TEAM_SHIELD_UP 0x41007012
#define NA_SE_GOLD_RING 0x49003013
#define NA_SE_DEMO_SIREN 0x49000014
#define NA_SE_SHIELD_UPGRADE 0x49008015
#define NA_SE_GOOD_LUCK 0x49002016
#define NA_SE_MESSAGE_MOVE 0x49000017 // Used for text in training mode
#define NA_SE_COMMU_REQUEST 0x49002018 // C> call alert
#define NA_SE_MAP_WINDOW_OPEN 0x49000019 // Also crosshairs on
#define NA_SE_MAP_WINDOW_CLOSE 0x4900101A // Also crosshairs off
#define NA_SE_MAR_LOCKON 0x4900001B
#define NA_SE_MISSILE_ALARM 0x4900001C
#define NA_SE_CANCEL 0x4900101D
#define NA_SE_COMPUTER_NOISE 0x4100001E // Used in mission briefing
#define NA_SE_MAP_MOVE_STOP 0x4900001F
#define NA_SE_ARWING_DECIDE 0x49000020 // Used in main menu
#define NA_SE_ARWING_CANCEL 0x49000021 // Used in main menu
#define NA_SE_ARWING_CURSOR 0x49000022 // Used in main menu
#define NA_SE_OVERHEAT_ALARM 0x4100C023
#define NA_SE_ONE_UP 0x4900C024
#define NA_SE_RING_PASS 0x49008025 // Also used for Corneria mech boss secret 1UP
#define NA_SE_SHIELD_BUZZER 0x49001026
#define NA_SE_LOCK_ON 0x49008027
#define NA_SE_BOSS_GAUGE_OPEN 0x4900C028
#define NA_SE_UNK_1 0x40000029 // Unreferenced. Sounds like an item collect jingle
#define NA_SE_COUNTDOWN 0x4900C02A
#define NA_SE_VIEW_SITCHW_ON 0x4000002B // Unreferenced. Related to D_ctx_80177C70?
#define NA_SE_VIEW_MOVE_IN 0x4900002C
#define NA_SE_VIEW_MOVE_OUT 0x4900002D
#define NA_SE_SEARCHLIGHT_MISS 0x4900402E
#define NA_SE_RING_MISS 0x4900402F
#define NA_SE_GET_EMBLEM 0x49008030
#define NA_SE_MISSION_ACCOMPLISHED 0x49008031
#define NA_SE_VO_PEPPER_CONSENT 0x49000032 // This is ONE steep bill, but it's worth it.
#define NA_SE_VO_PEPPER_SURPRISE 0x49000033 // WHAT?!
#define NA_SE_MISSION_COMPLETE 0x49008034
#define NA_SE_UNK_2 0x40000035 // Unreferenced. Hard to make out what it is
#define NA_SE_TIME_OVER 0x4900D036
#endif

View File

@ -6,7 +6,7 @@
0x09000003 brake
0x09000004 sector X boss hitting slippy
0x0903F004 player death
0x0100F005 arwing engine noise
0x0100F005 arwing planet engine noise
0x0100F006 landmaster engine noise
0x09000007 wings changing position
0x01008008 iniial bomb flight. only plays for 1 frame
@ -27,43 +27,49 @@
0x09008015 landmaster falls on ground
0x01008016 landmaster hover
0x09000017 blue marine barrel roll
0x0140001C
0x0100001D
0x0100001E
0x0100001F
0x0100F020
0x09400021
0x0?????18 footstep. comparisons are relative to this
0x0?????19 heavier footstep
0x0?????1A lighter footstep
0x0?????1B lightest footstep
0x0140001C running footsteps in title
0x0100001D something mechanical starting to move, used in title
0x0100001E engines powering up
0x0100001F Beam sounds from sound test
0x0100F020 arwing space engine noise
0x09400021 blue marine single laser
0x0100F022 blue marine engine noise
0x09008023
0x01004024
0x01000025
0x01038026
0x09400027
0x09404028
0x09007029
0x0900802A
0x0940802A
0x0940802B hyper laser
0x0900A02C
0x0900302D
0x0903502E
0x0900402F
0x09004030
0x09004031
0x09000032
0x09008023 wings repaired
0x01004024 landmaster single jet
0x01000025 torpedo shot
0x01038026 blue marine launch
0x09400027 blue marine twin laser (and hyper?)
0x09404028 blue marine hit ground
0x09007029 charge shot fire
0x0900802A warp zone map path
0x0940802A warp zone enter
0x0940802B arwing hyper laser
0x0900A02C wing break
0x0900302D charge shot charge
0x0903502E charge shot explode
0x0900402F landmaster boost
0x09004030 blue marine boost
0x09004031 blue marine brake
0x09000032 normal map path
0x11000000
0x19000001
0x19030003
0x19031003
0x19130003
0x19030004
0x19122005
0x19020006
0x19030006
0x19400007
0x19020008
0x19033008
0x11000000 CO waterfall noise
0x19000001 whoosh
0x1?????02 clang sound, ligher than 3
0x19030003 various falling pillars hitting ground
0x19031003 various falling pillars hitting ground
0x19130003 various falling pillars hitting ground
0x19030004 corneria mech boss hitting ground
0x19122005 EVSFX_5. venom event actors. spawning pillars/fingers?
0x19020006 titania rocks
0x19030006 macbeth rocks
0x19400007 aquas rocks
0x19020008 titania hopping bombs
0x19033008 macbeth switches
0x1?????09
0x1100000A
0x1100000B
0x1100000C
@ -81,6 +87,7 @@
0x11030016
0x11404016
0x19800017
0x1?????18
0x19832019
0x1983201A
0x1900001B
@ -132,9 +139,11 @@
0x19401048
0x11032049
0x1913204A
0x1?????4B
0x1100004C
0x1100204C
0x1900404D
0x1?????4E
0x1900404F
0x11002050
0x19004051
@ -193,18 +202,32 @@
0x11020084
0x29000000
0x5?????01
0x29002002
0x29024003
0x29034003
0x5?????04
0x31004005
0x31004006
0x29121007
0x2903A008
0x2903B009
0x2940C00A
0x2903700B
0x3100000C
0x2900000D
0x2903300E
0x2900300F
0x2943500F
0x5?????10
0x31000011
0x31000012
0x31000013
0x31000014
0x31000015
0x31000016
0x31000017
0x31038018
0x29022019
0x2940201A
0x2903101B
@ -212,6 +235,7 @@
0x2902401C
0x2903401C
0x2900201D
0x3100001E
0x2902201F
0x29023020
0x29034021
@ -220,6 +244,8 @@
0x29400023
0x29034024
0x29402024
0x31000025
0x31034025
0x2902F026
0x2940F026
0x2940C027
@ -229,172 +255,174 @@
0x2940702B
0x2940802C
0x2940902D
0x3140402E
0x3143402E
0x3143102F
0x39435830
0x29003031
0x29403031
0x29503032
0x29038033
0x5?????34
0x5?????35
0x29018036
0x29033037
0x5?????38
0x31012039
0x3100203A
0x2903203B
0x2940983C
0x2900403D
0x3100503E
0x2900803F
0x31000040
0x29034041
0x5?????42
0x31030043
0x5?????44
0x29034045
0x2902A046
0x31000047
0x29022048
0x29018049
0x5?????4A
0x2903404B
0x2903604C
0x2940604C
0x3140904D
0x2940804E
0x2940A04F
0x29036050
0x29409051
0x29400052
0x5?????53
0x29408054
0x29408055
0x31016056
0x31037057
0x29038058
0x31024059
0x3102505A
0x3103605B
0x3102705C
0x3102405D
0x2902405E
0x2903305F
0x2903A060
0x31032061
0x3103A061
0x29001062
0x31009063
0x29033064
0x31034064
0x29034065
0x31404066
0x31404067
0x39404068
0x31008069
0x2900306A
0x2900306B
0x2902306C
0x2902306D
0x2901306E
0x2903A06F
0x5?????70
0x29000071
0x29000072
0x29432073
0x29433074
0x29434075
0x39439076
0x29432077
0x31033078
0x39033079
0x5?????7A
0x5?????7B
0x5?????7C
0x2902107D
0x3140807E
0x5?????7F
0x29032080
0x29033081
0x29034082
0x31030083
0x29405084
0x31078085
0x29022086
0x31022087
0x29022088
0x29022089
0x2900308C
0x2900208D
0x2903408F
0x29038090
0x2940B096
0x29030098
0x29036099
0x2940D09A
0x31004005
0x31004006
0x3100000C
0x31000011
0x31000012
0x31000013
0x31000014
0x31000015
0x31000016
0x31000017
0x31038018
0x3100001E
0x31000025
0x31034025
0x3140402E
0x3143402E
0x3143102F
0x39435830
0x31012039
0x3100203A
0x3100503E
0x31000040
0x31030043
0x31000047
0x3140904D
0x31016056
0x31037057
0x31024059
0x3102505A
0x3103605B
0x3102705C
0x3102405D
0x31032061
0x3103A061
0x31009063
0x31034064
0x31404066
0x31404067
0x39404068
0x31008069
0x39439076
0x31033078
0x39033079
0x3140807E
0x31030083
0x31078085
0x31022087
0x3140208A
0x3103108B
0x2900308C
0x2900208D
0x3100208E
0x2903408F
0x29038090
0x39408091
0x39408092
0x39033093
0x31405094
0x31408095
0x2940B096
0x31408097
0x29030098
0x29036099
0x2940D09A
0x3103109B
0x4900F000
0x49000002
0x49000003
0x49002004
0x49002005
0x49002006
0x49004007
0x49000008
0x49000009
0x4900100A
0x4900000C
0x4900200D
0x4900200E
0x4900400F
0x49008010
0x49008011
0x41007012
0x49003013
0x49000014
0x49008015
0x49002016
0x49000017
0x49002018
0x49000019
0x4900101A
0x4900001B
0x4900001C
0x4900101D
0x4100001E
0x4900001F
0x49000020
0x49000021
0x49000022
0x4100C023
0x4900C024
0x49008025
0x49001026
0x49008027
0x4900C028
0x4900C02A
0x4900002C
0x4900002D
0x4900402E
0x4900402F
0x49008030
0x49008031
0x49000032
0x49000033
0x49008034
0x4900D036
0x4900F000 pause menu
0x4?????01 identical to above?
0x49000002 change menu selection
0x49000003 select menu item
0x49002004 collect lasers
0x49002005 collect bomb
0x49002006 collect bomb. identical to above, played at same time
0x49004007 scroll number
0x49000008 vs countodwn
0x49000009 vs go
0x4900100A bad selection
0x4?????0B warning sound?
0x4900000C item appears
0x4900200D big heal
0x4900200E small heal
0x4900400F collect checkpoint
0x49008010 low health hit alarm
0x49008011 critical health hit alarm
0x41007012 teammate health increase
0x49003013 collect gold ring
0x49000014 great fox warning siren
0x49008015 health bar increase
0x49002016 good luck
0x49000017 trainer text display
0x49002018 call alert
0x49000019 map pause menu up, also crosshairs on
0x4900101A map pause menu down, also crosshairs off
0x4900001B torpedo lock on
0x4900001C missile great fox proximity alert
0x4900101D exit menu
0x4100001E briefing sounds
0x4900001F world map appears ?
0x49000020 main menu select
0x49000021 main menu back
0x49000022 main menu change selection
0x4100C023 solar heat alarm
0x4900C024 1UP
0x49008025 ring passed
0x49001026 low health nag
0x49008027 charge lock on
0x4900C028 boss health appears
0x4?????29 sound like an item collect jingle
0x4900C02A timer countdown alert
0x4?????2B some sort of option change?
0x4900002C cockpit view on
0x4900002D cockpit view off
0x4900402E EVSFX_16, missed zoness searchlight
0x4900402F ring failed
0x49008030 medal award
0x49008031 mission accomplished text
0x49000032 one steep bill
0x49000033 whaaat
0x49008034 mission complete text
0x4?????35 quiet noise, hard to place
0x4900D036 vs mode time up. doesn't play?

351
sfxStrings.txt Normal file
View File

@ -0,0 +1,351 @@
NA_SE_FALL
NA_SE_PASS
NA_SE_ARWIN_GO_OUT
NA_SE_OB_METAL_BOUND_S
NA_SE_OB_METAL_BOUND_M
NA_SE_EN_METAL_BOUND_M
NA_SE_EN_MS_LAND
NA_SE_OB_METAL_BOUND_L
NA_SE_OB_BOUND_S
NA_SE_OB_BLOCK_APPEAR
NA_SE_OB_BOUND_M
NA_SE_OB_ROCK_BOUND
NA_SE_OB_BOUND_L
NA_SE_OB_AC_ROCK_BOUND
NA_SE_OB_AC_PILLAR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FLECT
NA_SE_EN_ANDORF_BREATH
NA_SE_EN_ANDORF_BITE0
NA_SE_EN_ANDORF_BITE1
NA_SE_EN_ANDORF_VOMIT
NA_SE_EN_ANDORF_SPARK
NA_SE_EN_WT_THROW
NA_SE_EN_WT_SPARK_CHARGE
NA_SE_EN_WT_SPARK_BEAM
NA_SE_EN_AC_ZAKO_DAMAGE
NA_SE_EN_AC_ZAKO_DOWN
NA_SE_EN_WARP_IN
NA_SE_EN_WARP_OUT
NA_SE_EN_CLBOSS_CHARGE
NA_SE_EN_CLBOSS_BEAM
NA_SE_EN_TRAIN_BREAK
NA_SE_EN_ANDORF_WARP
NA_SE_EN_ANDORF_CATCH
NA_SE_EN_KANI_STOP
NA_SE_EN_MCBOSS_RAGE
NA_SE_EN_DOWN_IMPACT
NA_SE_EN_MARBLE_BEAM

View File

@ -527,25 +527,25 @@ f32 Audio_GetSfxFalloff(u8 bankId, u8 entryIndex) {
f32 midrange;
f32 range;
if (SFX_BIT09(sSfxBanks[bankId][entryIndex].sfxId)) {
if (sSfxBanks[bankId][entryIndex].sfxId & SFX_FLAG_22) {
return 1.0f;
}
distance = sSfxBanks[bankId][entryIndex].distance;
if (distance > 33000.0f) {
falloff = 0.0f;
} else {
switch (SFX_RANGE_MASK(sSfxBanks[bankId][entryIndex].sfxId)) {
switch ((sSfxBanks[bankId][entryIndex].sfxId & SFX_RANGE_MASK)) {
default:
range = 1650.0f;
range = 33000.0f / 20.0f;
break;
case 1 << 16:
range = 2200.0f;
case 1 << SFX_RANGE_SHIFT:
range = 33000.0f / 15.0f;
break;
case 2 << 16:
range = 3142.8572f;
case 2 << SFX_RANGE_SHIFT:
range = 33000.0f / 10.5f;
break;
case 3 << 16:
range = 6346.1543f;
case 3 << SFX_RANGE_SHIFT:
range = 33000.0f / 5.2f;
break;
}
cutoff = range / 5.0f;
@ -568,9 +568,9 @@ s8 Audio_GetSfxReverb(u8 bankId, u8 entryIndex, u8 channelId) {
s8 distReverb = 0;
s8 scriptReverb = 0;
if (!SFX_BIT10(sSfxBanks[bankId][entryIndex].sfxId)) {
if (sSfxBanks[bankId][entryIndex].distance < 8250.0f) {
distReverb = (sSfxBanks[bankId][entryIndex].distance / 8250.0f) * 40.0f;
if (!(sSfxBanks[bankId][entryIndex].sfxId & SFX_FLAG_21)) {
if (sSfxBanks[bankId][entryIndex].distance < (33000.0f / 4.0f)) {
distReverb = (sSfxBanks[bankId][entryIndex].distance / (33000.0f / 4.0f)) * 40.0f;
} else {
distReverb = 40;
}
@ -618,11 +618,11 @@ f32 Audio_GetSfxFreqMod(u8 bankId, u8 entryIndex) {
f32 distance;
f32 freqMod = 1.0f;
if (SFX_BIT08(sSfxBanks[bankId][entryIndex].sfxId)) {
if (sSfxBanks[bankId][entryIndex].sfxId & SFX_FLAG_23) {
freqMod -= ((gAudioRandom % 16) / 192.0f);
}
distance = sSfxBanks[bankId][entryIndex].distance;
if (!SFX_BIT09(sSfxBanks[bankId][entryIndex].sfxId)) {
if (!(sSfxBanks[bankId][entryIndex].sfxId & SFX_FLAG_22)) {
if (distance >= 33000.0f) {
freqMod += 0.2f;
} else {
@ -643,27 +643,28 @@ void Audio_SetSfxProperties(u8 bankId, u8 entryIndex, u8 channelId) {
SfxBankEntry* entry = &sSfxBanks[bankId][entryIndex];
switch (bankId) {
case 0:
case 1:
case 2:
case 3:
case SFX_BANK_PLAYER:
case SFX_BANK_1:
case SFX_BANK_2:
case SFX_BANK_3:
if (entry->state == 2) {
AUDIOCMD_CHANNEL_SET_IO(SEQ_PLAYER_SFX, channelId, 1, gLevelType);
}
if (SFX_BIT13(entry->sfxId) && (*entry->zPos > 0.0f)) {
if ((entry->sfxId & SFX_FLAG_18) && (*entry->zPos > 0.0f)) {
f32 yScaled = *entry->yPos / 2.5f;
entry->distance = SQ(*entry->xPos) + SQ(yScaled);
}
entry->distance = sqrtf(entry->distance);
volumeMod = (Audio_GetSfxFalloff(bankId, entryIndex) * *entry->volMod) * sSfxVolumeMods[bankId].value;
volumeMod = Audio_GetSfxFalloff(bankId, entryIndex) * *entry->volMod * sSfxVolumeMods[bankId].value;
reverb = Audio_GetSfxReverb(bankId, entryIndex, channelId);
freqMod = Audio_GetSfxFreqMod(bankId, entryIndex) * *entry->freqMod;
if ((bankId != 0) || !(*entry->zPos > -200.0f) || !(*entry->zPos < 200.0f) || (sSfxChannelLayout == 3)) {
if (!((bankId == SFX_BANK_PLAYER) && ((-200.0f < *entry->zPos) && (*entry->zPos < 200.0f)) &&
(sSfxChannelLayout != 3))) {
pan = Audio_GetSfxPan(*entry->xPos, *entry->zPos, entry->token);
}
break;
case 4:
case SFX_BANK_SYSTEM:
if (sSfxChannelLayout == 3) {
if (entry->token != 4) {
pan = (entry->token & 1) * 127;
@ -1393,7 +1394,7 @@ void Audio_ClearBGMMute(u8 channelIndex) {
}
void Audio_PlaySfx(u32 sfxId, f32* sfxSource, u8 token, f32* freqMod, f32* volMod, s8* reverbAdd) {
if (sSfxBankMuted[SFX_BANK_SHIFT(sfxId)] == 0) {
if (sSfxBankMuted[SFX_BANK_ALT(sfxId)] == 0) {
SfxRequest* request = &sSfxRequests[sSfxRequestWriteIndex];
request->sfxId = sfxId;
@ -1415,12 +1416,13 @@ void Audio_RemoveMatchingSfxRequests(u8 aspect, SfxBankEntry* data) {
switch (aspect) {
case 0:
if (SFX_BANK_MASK(request->sfxId) == SFX_BANK_MASK(data->sfxId)) {
if ((request->sfxId & SFX_BANK_MASK) == (data->sfxId & SFX_BANK_MASK)) {
found = true;
}
break;
case 1:
if ((SFX_BANK_MASK(request->sfxId) == SFX_BANK_MASK(data->sfxId)) && (&request->pos[0] == data->xPos)) {
if (((request->sfxId & SFX_BANK_MASK) == (data->sfxId & SFX_BANK_MASK)) &&
(&request->pos[0] == data->xPos)) {
found = true;
}
break;
@ -1446,7 +1448,7 @@ void Audio_RemoveMatchingSfxRequests(u8 aspect, SfxBankEntry* data) {
break;
}
if (found) {
request->sfxId = 0;
request->sfxId = NA_SE_NONE;
}
}
}
@ -1460,7 +1462,7 @@ void Audio_ProcessSfxRequest(void) {
u8 count;
SfxBankEntry* entry;
if (request->sfxId == 0) {
if (request->sfxId == NA_SE_NONE) {
return;
}
bankId = SFX_BANK(request->sfxId);
@ -1474,13 +1476,13 @@ void Audio_ProcessSfxRequest(void) {
if (count == 0) {
evict = next;
sfxId = sSfxBanks[bankId][next].sfxId;
} else if (SFX_IMPORTANCE_MASK(sSfxBanks[bankId][next].sfxId) < SFX_IMPORTANCE_MASK(sfxId)) {
} else if ((sSfxBanks[bankId][next].sfxId & SFX_IMPORT_MASK) < (sfxId & SFX_IMPORT_MASK)) {
evict = next;
sfxId = sSfxBanks[bankId][next].sfxId;
}
count++;
if (count == sUsedChannelsPerBank[sSfxChannelLayout][bankId]) {
if (SFX_IMPORTANCE_MASK(request->sfxId) >= SFX_IMPORTANCE_MASK(sfxId)) {
if ((request->sfxId & SFX_IMPORT_MASK) >= (sfxId & SFX_IMPORT_MASK)) {
next = evict;
} else {
next = 0;
@ -1488,8 +1490,8 @@ void Audio_ProcessSfxRequest(void) {
}
}
if (count == sUsedChannelsPerBank[sSfxChannelLayout][bankId]) {
if (SFX_BIT04(request->sfxId) || SFX_BIT13(request->sfxId) || (next == evict)) {
if (SFX_BIT12(sSfxBanks[bankId][next].sfxId) && (sSfxBanks[bankId][next].state != 1)) {
if ((request->sfxId & SFX_FLAG_27) || (request->sfxId & SFX_FLAG_18) || (next == evict)) {
if ((sSfxBanks[bankId][next].sfxId & SFX_FLAG_19) && (sSfxBanks[bankId][next].state != 1)) {
Audio_ClearBGMMute(sSfxBanks[bankId][next].channelIndex);
}
sSfxBanks[bankId][next].token = request->token;
@ -1536,7 +1538,7 @@ void Audio_RemoveSfxBankEntry(u8 bankId, u8 entryIndex) {
SfxBankEntry* sfxBank = sSfxBanks[bankId];
s32 pad;
if (SFX_BIT12(sfxBank[entryIndex].sfxId)) {
if (sfxBank[entryIndex].sfxId & SFX_FLAG_19) {
Audio_ClearBGMMute(sfxBank[entryIndex].channelIndex);
}
if (entryIndex == sSfxBankListEnd[bankId]) {
@ -1573,11 +1575,11 @@ void Audio_ChooseActiveSfx(u8 bankId) {
chosenSfx[i].priority = INT32_MAX;
chosenSfx[i].entryIndex = 0xFF;
}
entryIndex = sSfxBanks[bankId]->next;
entryIndex = sSfxBanks[bankId][0].next;
k = 0;
while (entryIndex != 0xFF) {
if ((sSfxBanks[bankId][entryIndex].state == 1) &&
(SFX_BIT04(sSfxBanks[bankId][entryIndex].sfxId) == SFX_BIT04(-1))) {
((sSfxBanks[bankId][entryIndex].sfxId & SFX_FLAG_27) == SFX_FLAG_27)) {
sSfxBanks[bankId][entryIndex].freshness--;
}
if (sSfxBanks[bankId][entryIndex].freshness == 0) {
@ -1591,8 +1593,8 @@ void Audio_ChooseActiveSfx(u8 bankId) {
yScaled = *entry->yPos / 2.5f;
entry->distance = SQ(*entry->xPos) + SQ(yScaled) + SQ(*entry->zPos);
}
importance = SFX_IMPORTANCE(entry->sfxId);
if (SFX_BIT11(entry->sfxId)) {
importance = SFX_IMPORT(entry->sfxId);
if (entry->sfxId & SFX_FLAG_20) {
entry->priority = SQ(0xFF - importance) * SQ(76);
} else {
entry->priority = (u32) entry->distance + SQ(0xFF - importance) * SQ(76);
@ -1608,7 +1610,7 @@ void Audio_ChooseActiveSfx(u8 bankId) {
if (entry->distance > maxRangeSq) {
if (entry->state == 4) {
AUDIOCMD_CHANNEL_SET_IO(2, entry->channelIndex, 0, 0);
if (SFX_BIT04(entry->sfxId)) {
if (entry->sfxId & SFX_FLAG_27) {
Audio_RemoveSfxBankEntry(bankId, entryIndex);
entryIndex = k;
}
@ -1649,7 +1651,7 @@ void Audio_ChooseActiveSfx(u8 bankId) {
if (activeSfx->entryIndex == 0xFF) {
needNewSfx = 1;
} else if (sSfxBanks[bankId][activeSfx->entryIndex].state == 4) {
if (SFX_BIT04(sSfxBanks[bankId][activeSfx->entryIndex].sfxId)) {
if (sSfxBanks[bankId][activeSfx->entryIndex].sfxId & SFX_FLAG_27) {
Audio_RemoveSfxBankEntry(bankId, activeSfx->entryIndex);
} else {
sSfxBanks[bankId][activeSfx->entryIndex].state = 1;
@ -1706,7 +1708,7 @@ void Audio_PlayActiveSfx(u8 bankId) {
if (entry->state == 2) {
entry->channelIndex = sCurSfxPlayerChannelIndex;
if (SFX_BIT12(entry->sfxId)) {
if (entry->sfxId & SFX_FLAG_19) {
sChannelMuteFlags |= 1 << sCurSfxPlayerChannelIndex;
Audio_SetSequenceFade(SEQ_PLAYER_BGM, 2, 64, 15);
}
@ -1742,7 +1744,7 @@ void Audio_KillSfxByBank(u8 bankId) {
}
next = sSfxBanks[bankId][0].next;
}
cmp.sfxId = bankId << 28;
cmp.sfxId = bankId << SFX_BANK_SHIFT;
Audio_RemoveMatchingSfxRequests(0, &cmp);
}
@ -1768,23 +1770,23 @@ void Audio_StopSfxByBankAndSource(u8 bankId, f32* sfxSource) {
}
void Audio_KillSfxByBankAndSource(u8 bankId, f32* sfxSource) {
SfxBankEntry sp18;
SfxBankEntry cmp;
Audio_StopSfxByBankAndSource(bankId, sfxSource);
sp18.sfxId = bankId << 0x1C;
sp18.xPos = sfxSource;
Audio_RemoveMatchingSfxRequests(1, &sp18);
cmp.sfxId = bankId << SFX_BANK_SHIFT;
cmp.xPos = sfxSource;
Audio_RemoveMatchingSfxRequests(1, &cmp);
}
void Audio_KillSfxBySource(f32* sfxSource) {
u8 i;
SfxBankEntry sp24;
SfxBankEntry cmp;
for (i = 0; i < 5; i++) {
Audio_StopSfxByBankAndSource(i, sfxSource);
}
sp24.xPos = sfxSource;
Audio_RemoveMatchingSfxRequests(2, &sp24);
cmp.xPos = sfxSource;
Audio_RemoveMatchingSfxRequests(2, &cmp);
}
void Audio_KillSfxBySourceAndId(f32* sfxSource, u32 sfxId) {
@ -1900,7 +1902,7 @@ void Audio_PlayAllSfx(void) {
if (IS_SEQUENCE_CHANNEL_VALID(gSeqPlayers[SEQ_PLAYER_SFX].channels[0])) {
sCurSfxPlayerChannelIndex = 0;
for (bankId = 0; bankId < 5; bankId++) {
for (bankId = 0; bankId < ARRAY_COUNT(sSfxBanks); bankId++) {
Audio_ChooseActiveSfx(bankId);
Audio_PlayActiveSfx(bankId);
Audio_UpdateSfxVolumeMod(bankId);
@ -2346,8 +2348,8 @@ void Audio_AnalyzeFrequencies(f32* buffer0, f32* buffer1, s32 length, f32* buffe
var_fs0 = 0.0f;
temp_ft0 = D_PI / (2 * size);
for (i = 0; i < half; i++) {
*buf2half2++ = (__cosf(var_fs0) - __sinf(var_fs0)) * 0.707107f;
*buf2half3++ = (__cosf(var_fs0) + __sinf(var_fs0)) * 0.707107f;
*buf2half2++ = (__cosf(var_fs0) - __sinf(var_fs0)) * 0.707107f; // approx 1/sqrt(2)
*buf2half3++ = (__cosf(var_fs0) + __sinf(var_fs0)) * 0.707107f; // approx 1/sqrt(2)
var_fs0 += temp_ft0;
}
}
@ -2454,7 +2456,7 @@ u8* Audio_UpdateFrequencyAnalysis(void) {
}
void Audio_StartPlayerNoise(u8 playerId) {
u32 sfxId = 0x00000000;
u32 sfxId = NA_SE_NONE;
sPlayerNoise[playerId].form = gPlayer[playerId].sfx.form;
Audio_ResetPlayerFreqMods();
@ -2475,14 +2477,14 @@ void Audio_StartPlayerNoise(u8 playerId) {
&sPlayerNoise[playerId].reverbAdd);
break;
}
if (sfxId != 0) {
if (sfxId != NA_SE_NONE) {
Audio_PlaySfx(sfxId, gPlayer[playerId].sfx.srcPos, playerId, &sPlayerNoise[playerId].totalMod, &gDefaultMod,
&sPlayerNoise[playerId].reverbAdd);
}
}
void Audio_StopPlayerNoise(u8 playerId) {
u32 sfxId = 0x00000000;
u32 sfxId = NA_SE_NONE;
switch (sPlayerNoise[playerId].form) {
case FORM_ARWING:
@ -2502,7 +2504,7 @@ void Audio_StopPlayerNoise(u8 playerId) {
break;
}
sPlayerNoise[playerId].form = FORM_NONE;
if (sfxId != 0) {
if (sfxId != NA_SE_NONE) {
Audio_KillSfxBySourceAndId(gPlayer[playerId].sfx.srcPos, sfxId);
}
}
@ -2652,7 +2654,7 @@ void Audio_SetHeatAlarmParams(u8 shields, u8 heightParam) {
}
void Audio_PlayEventSfx(f32* sfxSource, u16 eventSfxId) {
if ((sEventSfx[eventSfxId] & 0xF0000000) != 0x40000000) {
if ((sEventSfx[eventSfxId] & SFX_BANK_MASK) != (SFX_BANK_SYSTEM << SFX_BANK_SHIFT)) {
AUDIO_PLAY_SFX(sEventSfx[eventSfxId], sfxSource, 0);
} else {
AUDIO_PLAY_SFX(sEventSfx[eventSfxId], gDefaultSfxSource, 0);
@ -2660,7 +2662,7 @@ void Audio_PlayEventSfx(f32* sfxSource, u16 eventSfxId) {
}
void Audio_StopEventSfx(f32* sfxSource, u16 eventSfxId) {
if ((sEventSfx[eventSfxId] & 0xF0000000) != 0x40000000) {
if ((sEventSfx[eventSfxId] & SFX_BANK_MASK) != (SFX_BANK_SYSTEM << SFX_BANK_SHIFT)) {
Audio_KillSfxBySourceAndId(sfxSource, sEventSfx[eventSfxId]);
} else {
Audio_KillSfxBySourceAndId(gDefaultSfxSource, sEventSfx[eventSfxId]);
@ -2778,7 +2780,7 @@ void Audio_PlaySoundTest(u8 enable) {
void Audio_PlaySequenceDistorted(u8 seqPlayId, u16 seqId, u16 distortion, u8 fadeinTime, u8 unused) {
u8 tempoDistortion = (distortion / 10);
Audio_PlaySequence(seqPlayId, seqId & ~0x8000, 0, -1);
Audio_PlaySequence(seqPlayId, seqId & ~SEQ_FLAG, 0, -1);
SEQCMD_SET_SEQPLAYER_FREQ(seqPlayId, fadeinTime, distortion);
SEQCMD_SCALE_TEMPO(seqPlayId, fadeinTime, tempoDistortion);
}

View File

@ -660,7 +660,7 @@ void AudioHeap_Init(void) {
gAudioBufferParams.samplesPerTickMax = gAudioBufferParams.samplesPerTick + 8;
gAudioBufferParams.samplesPerTickMin = gAudioBufferParams.samplesPerTick - 8;
gAudioBufferParams.resampleRate = 32000.0f / (s32) gAudioBufferParams.samplingFrequency;
gAudioBufferParams.ticksPerUpdateInvScaled = 0.001171875f / gAudioBufferParams.ticksPerUpdate;
gAudioBufferParams.ticksPerUpdateInvScaled = (3.0f / 2560.0f) / gAudioBufferParams.ticksPerUpdate;
gAudioBufferParams.ticksPerUpdateInv = 1.0f / gAudioBufferParams.ticksPerUpdate;
gNumNotes = spec->numNotes;
D_8014C1B0 = spec->unk_14;

View File

@ -411,7 +411,7 @@ void func_80012438(SequenceLayer* layer, s32 arg1) {
layer->adsr.decayIndex * gAudioBufferParams.ticksPerUpdateInvScaled;
}
temp_v0->playbackState.adsr.sustain =
(s32) layer->channel->adsr.sustain * temp_v0->playbackState.adsr.current * 0.00390625f;
(s32) layer->channel->adsr.sustain * temp_v0->playbackState.adsr.current / 256.0f;
}
}
if (arg1 == 6) {

View File

@ -845,7 +845,7 @@ void func_800153E8(SequenceChannel* channel) {
channel->changes.s.volume = 1;
break;
case 0xE0:
channel->volumeMod = (s32) func_800146C0(state) * 0.0078125f;
channel->volumeMod = (s32) func_800146C0(state) / 128.0f;
channel->changes.s.volume = 1;
break;
case 0xDE:

View File

@ -120,11 +120,11 @@ bool AllRange_PlayMessage(u16* msg, RadioCharacterId rcid) {
}
}
void AllRange_UpdateCountdown(void) {
void AllRange_DrawCountdown(void) {
if (gShowAllRangeCountdown != 0) {
s32 seconds = gAllRangeCountdown[1];
func_hud_8008E51C(gAllRangeCountdown, gAllRangeCountdownScale);
HUD_DrawCountdown(gAllRangeCountdown, gAllRangeCountdownScale);
if ((gAllRangeCountdown[0] == 0) && (seconds != gAllRangeCountdown[1]) && (gAllRangeCountdown[1] < 15)) {
AUDIO_PLAY_SFX(0x4900C02A, gDefaultSfxSource, 4);
}

View File

@ -850,7 +850,7 @@ void func_beam_80038140(PlayerShot* shot) {
Matrix_RotateY(gCalcMatrix, shot->obj.rot.y * M_DTOR, MTXF_NEW);
Matrix_RotateX(gCalcMatrix, shot->obj.rot.x * M_DTOR, MTXF_APPLY);
sp88.x = sp88.y = 0.0f;
sp88.z = -133.33333f;
sp88.z = -400.0f / 3.0f;
Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp88, &sp7C);
shot->vel.x = sp7C.x;
shot->vel.y = sp7C.y;

View File

@ -39,7 +39,7 @@ bool gExpertMode;
s32 D_ctx_80177A10[10];
f32 D_ctx_80177A48[10];
s32 gCsFrameCount;
u8 D_ctx_80177A98;
u8 D_ctx_80177A98; // some sort of flag. Used in background
u8 D_ctx_80177AB0;
u8 gAqDrawMode;
s32 gTitleState;

View File

@ -722,7 +722,7 @@ void func_display_80054300(Player* player) {
switch (player->form) {
case FORM_ARWING:
fake_label:
Matrix_Scale(gGfxMatrix, 2.5049999f, 1.5f, 2.5049999f, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, 1.5f * 1.67f, 1.5f, 1.5f * 1.67f, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 30.0f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, D_1032780);
@ -795,7 +795,7 @@ void func_display_8005478C(Player* player) {
if ((gGameFrameCount % 2) != 0) {
Matrix_Scale(gGfxMatrix, 0.9f, 0.63f, 1.0f, MTXF_APPLY);
} else {
Matrix_Scale(gGfxMatrix, 0.80999994f, 0.567f, 1.0f, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, 0.9f * 0.9f, 0.9f * 0.63f, 1.0f, MTXF_APPLY);
}
Matrix_SetGfxMtx(&gMasterDisp);
Play_DrawEngineGlow(gLevelType);

View File

@ -3745,7 +3745,7 @@ bool ActorEvent_OverrideLimbDraw2(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f*
s32 var_s1;
if (limbIndex == 5) {
var_s1 = (s32) (this->health * 0.6375f);
var_s1 = (s32) (this->health * (255.0f / 400.0f));
if (var_s1 > 255) {
var_s1 = 255;
}

View File

@ -543,7 +543,7 @@ void Game_Update(void) {
}
Background_dummy_80040CDC();
HUD_DrawStatusScreens();
AllRange_UpdateCountdown();
AllRange_DrawCountdown();
if ((gGameState == GSTATE_PLAY) && gVersusMode) {
Versus_Draw();
}

View File

@ -2695,8 +2695,8 @@ void func_hud_8008C104(u16* srcTexture, u16* dstTexture) {
Texture_Mottle(dst, buffer, 2);
}
void func_hud_8008C390(f32 xPos, f32 yPos, f32 scale, s32 number) {
void* D_800D1EC0[] = {
void HUD_DisplaySmallNumber(f32 xPos, f32 yPos, f32 scale, s32 number) {
void* sSmallNumberTex[] = {
aSmallText_0, aSmallText_1, aSmallText_2, aSmallText_3, aSmallText_4,
aSmallText_5, aSmallText_6, aSmallText_7, aSmallText_8, aSmallText_9,
};
@ -2704,14 +2704,14 @@ void func_hud_8008C390(f32 xPos, f32 yPos, f32 scale, s32 number) {
for (i = 10; i != 1; i /= 10) {
if ((xPos > 0.0f) && (yPos > 0.0f)) {
TextureRect_8bIA(&gMasterDisp, D_800D1EC0[number / i], 16, 8, xPos, yPos, scale, scale);
TextureRect_8bIA(&gMasterDisp, sSmallNumberTex[number / i], 16, 8, xPos, yPos, scale, scale);
}
xPos += 9.0f * scale;
number %= i;
}
if ((xPos > 0.0f) && (yPos > 0.0f)) {
TextureRect_8bIA(&gMasterDisp, D_800D1EC0[number / i], 16, 8, xPos, yPos, scale, scale);
TextureRect_8bIA(&gMasterDisp, sSmallNumberTex[number / i], 16, 8, xPos, yPos, scale, scale);
}
}
@ -3122,7 +3122,7 @@ void HUD_DrawBossHealth(void) {
if (D_801616C4 >= 0.88f) {
temp6 = sp3C + 8.0f;
temp7 = 101.0f - (31.884058f * D_801616C8) + temp1;
temp7 = 101.0f - ((2200.0f / 69.0f) * D_801616C8) + temp1;
if (D_801616C8 > 0.0f) {
TextureRect_16bRGBA(&gMasterDisp, D_Tex_800D99F8, 32, 32, temp6, temp7, 0.2f, D_801616C8);
}
@ -3135,7 +3135,7 @@ void HUD_DrawBossHealth(void) {
}
}
void func_hud_8008E2C8(f32 xPos, f32 yPos, s32* countdown, f32 scale) {
void HUD_DisplayCountdown(f32 xPos, f32 yPos, s32* countdown, f32 scale) {
f32 var_fs0 = 0.0f;
s32 var_s2 = 0;
s32 i;
@ -3159,14 +3159,14 @@ void func_hud_8008E2C8(f32 xPos, f32 yPos, s32* countdown, f32 scale) {
} else {
RCP_SetupDL_76();
gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 0, 255);
func_hud_8008C390((var_fs0 * scale) + xPos, yPos, scale, var_s2);
HUD_DisplaySmallNumber((var_fs0 * scale) + xPos, yPos, scale, var_s2);
var_fs0 += 9.0f;
}
var_fs0 += 9.0f;
}
}
void func_hud_8008E51C(s32* countdown, f32 scale) {
void HUD_DrawCountdown(s32* countdown, f32 scale) {
//! FAKE:
if (1) {}
@ -3191,7 +3191,7 @@ void func_hud_8008E51C(s32* countdown, f32 scale) {
}
if (gPlayState != PLAY_PAUSE) {
func_hud_8008E2C8(176.0f, 22.0f, countdown, scale);
HUD_DisplayCountdown(176.0f, 22.0f, countdown, scale);
}
}

View File

@ -3606,7 +3606,7 @@ void func_play_800AF07C(Player* player) {
}
if (player->barrelRoll != 0) {
sp84 = 0.2f;
gPlayerTurnRate = 6.8999996f;
gPlayerTurnRate = 6.8999996f; // 690.0f * 0.01f
}
Math_SmoothStepToF(&player->rot.y, stickX * gPlayerTurnStickMod, sp84, gPlayerTurnRate, 0.03f);
@ -4114,7 +4114,7 @@ void func_play_800B0F50(Player* playerx) {
gRadioState = gRadioMsgRadioId = gCurrentRadioPortrait = 0;
D_ctx_8017853C = gRadioTextBoxScaleY = 0.0f;
player->cam.eye.z = 400.0f;
player->unk_148 = 0.77699995f;
player->unk_148 = 0.77699995f; // 77.7f *0.01f
player->unk_14C = 0.77699995f;
player->unk_01C = 1.0f;
player->groundPos.y = -1000.0f;

View File

@ -322,7 +322,7 @@ void func_tank_800444BC(Player* player) {
}
if ((player->pos.y - sp30) < sp38) {
if (player->vel.y < -10.0f) {
AUDIO_PLAY_SFX(0x09008015, player->sfxSource, 0);
AUDIO_PLAY_SFX(NA_SE_TANK_BOUND, player->sfxSource, 0);
}
player->grounded = true;
if (player->vel.y < -20.0f) {
@ -941,7 +941,7 @@ void func_tank_80046704(Player* player) {
player->baseSpeed = -(D_800C9F00 * 1.5f);
player->vel.z = D_800C9F00 * 1.5f;
D_800C9F00 = 12;
AUDIO_PLAY_SFX(0x09008015, player->sfxSource, 0);
AUDIO_PLAY_SFX(NA_SE_TANK_WALL_HIT, player->sfxSource, 0);
break;
}
if (scenery->obj.id == OBJ_SCENERY_59) {
@ -1253,7 +1253,7 @@ void func_tank_80047D38(Player* player, f32 arg1) {
}
if ((player->pos.y - 5.0f) < arg1) {
if (player->vel.y < -10.0f) {
AUDIO_PLAY_SFX(0x09008015, player->sfxSource, 0);
AUDIO_PLAY_SFX(NA_SE_TANK_BOUND, player->sfxSource, 0);
player->hitTimer = 10;
}
D_800C9F04 = 1;

View File

@ -349,41 +349,38 @@ void func_versus_800BDE44(void) {
}
}
s32 func_versus_800BE078(void) {
s32 temp;
s32 Versus_UpdateTimer(void) {
s32 temp = (s32) CYCLES_TO_USEC((D_80178860 - D_80178868)) / 10000;
while (true) {
temp = (s32) CYCLES_TO_USEC((D_80178860 - D_80178868)) / 10000;
if ((D_versus_80178768[2] -= temp) >= 0) {
break;
}
D_versus_80178768[2] -= temp;
if (D_versus_80178768[2] < 0) {
D_versus_80178768[2] *= -1;
temp = (D_versus_80178768[2] / 100) + 1;
D_versus_80178768[2] %= 100;
D_versus_80178768[2] = (100 - D_versus_80178768[2]) % 100;
D_versus_80178768[1] -= temp;
if ((D_versus_80178768[1] -= temp) >= 0) {
if (D_versus_80178768[1] >= 0) {
if ((D_versus_80178768[0] == 0) && (D_versus_80178768[1] < 15) && (D_versus_80178768[1] >= 0)) {
AUDIO_PLAY_SFX(0x4900C02A, gDefaultSfxSource, 4);
}
break;
}
} else {
// clang-format off
if (D_versus_80178768[0] == 0) { AUDIO_PLAY_SFX(0x4900D036, gDefaultSfxSource, 4); }
if (D_versus_80178768[0] == 0) {\
AUDIO_PLAY_SFX(0x4900D036, gDefaultSfxSource, 4);\
}
// clang-format on
D_versus_80178768[1] *= -1;
temp = (D_versus_80178768[1] / 60) + 1;
D_versus_80178768[1] %= 60;
D_versus_80178768[1] = (60 - D_versus_80178768[1]) % 60;
if ((D_versus_80178768[0] -= temp) >= 0) {
break;
}
D_versus_80178768[0] -= temp;
if (D_versus_80178768[0] < 0) {
D_versus_80178768[0] = 0;
D_versus_80178768[1] = 0;
D_versus_80178768[2] = 0;
break;
}
}
}
return 0;
@ -1538,7 +1535,7 @@ bool Versus_Update(void) {
if (gVsMatchType == 2) {
D_80178778 = 10;
func_versus_800BE078();
Versus_UpdateTimer();
func_versus_800BDE3C();
} else {
D_80178778 = 8;

View File

@ -10,17 +10,17 @@ extern OptionId D_menu_801B9124;
extern s32 D_menu_801B912C;
static s32 showJukebox = 0;
static u32 prevSfx = 0;
static u32 sfx = 0;
static u32 prevSfx = NA_SE_NONE;
static u32 sfx = NA_SE_NONE;
static s32 sfxId = 0;
static u32 sfxBank = 0;
static u32 sfxBank = SFX_BANK_PLAYER;
static u32 sfxRange = 0;
static s32 sfxImport = 0;
static int holdTimer = 0;
static u8 sfxFlag = 0;
static u8 sfxFlags[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
static char* flagNames[] = { "F18", "F19", "F20", "F21", "F22", "F23", "STT", "F25", "F26", "SFX" };
static u8 bankSizes[] = { 0x33, 0x85, 0x9B, 0x9C, 0x37 };
static u8 bankSizes[] = { 0x33, 0x85, 0x9C, 0x9C, 0x37 };
static u32 sfxEditMode = 9;
static u32 srcEditMode = 0;
static u32 editMode = 0;
@ -97,6 +97,9 @@ void Jukebox_UpdateSource(void) {
}
void Jukebox_UpdateSfx(void) {
s32 i;
u16 flags = 0;
if (gControllerPress[gMainController].button & L_JPAD) {
sfxEditMode--;
} else if (gControllerPress[gMainController].button & R_JPAD) {
@ -125,8 +128,10 @@ void Jukebox_UpdateSfx(void) {
}
break;
}
sfx = SFX_PACK(sfxBank, sfxRange, sfxImport, sfxId, 1, sfxFlag, sfxFlags[7], sfxFlags[6], sfxFlags[5], sfxFlags[4],
sfxFlags[3], sfxFlags[2], sfxFlags[1], sfxFlags[0]);
for (i = 0; i < 8; i++) {
flags |= sfxFlags[i] << (i + (i > 5));
}
sfx = SFX_PACK(sfxBank, sfxId, sfxRange, sfxImport, (sfxFlag << 27) | (flags << 18));
}
s32 sfxModeX[] = { 95, 104, 113, 122, 131, 140, 149, 158, 180, 0, 22, 43, 60 };

View File

@ -1488,18 +1488,18 @@ void Meteo_8018978C(Boss* boss) {
if (gBossFrameCount > 406) {
gBossHealthBar = (boss->swork[2] + boss->swork[3] + boss->swork[4] + boss->swork[5] + boss->swork[7] +
boss->swork[8] + boss->swork[6]) /
2.6274f;
2.6274f; // approx 670 / 255
if ((gBossFrameCount > 506) && (gBossFrameCount < 1000)) {
Math_SmoothStepToF(&boss->fwork[17], 3.3f, 1.0f, 0.1f, 0.0f);
Math_SmoothStepToF(&boss->fwork[0x12], 3.3f, 1.0f, 0.1f, 0.0f);
Math_SmoothStepToF(&boss->fwork[0x13], 3.3f, 1.0f, 0.1f, 0.0f);
Math_SmoothStepToF(&boss->fwork[18], 3.3f, 1.0f, 0.1f, 0.0f);
Math_SmoothStepToF(&boss->fwork[19], 3.3f, 1.0f, 0.1f, 0.0f);
Math_SmoothStepToF(&boss->fwork[20], 3.3f, 1.0f, 0.1f, 0.0f);
}
}
}
void Meteo_8018B7C4(s32 arg0) {
f32 effect = arg0 * 0.83333f;
f32 effect = arg0 * 0.83333f; // approx 5 / 6
if ((gGameFrameCount % 2) != 0) {
effect *= 1.1f;

View File

@ -6351,8 +6351,8 @@ void Aquas_801BE274(Actor* actor, f32 yRot, f32 xRot) {
Vec3f sp4C = { 0.0f, 0.0f, 0.0f };
Vec3f sp40;
Matrix_RotateY(gCalcMatrix, 0.017453292f * yRot, MTXF_NEW);
Matrix_RotateX(gCalcMatrix, 0.017453292f * xRot, MTXF_APPLY);
Matrix_RotateY(gCalcMatrix, M_DTOR * yRot, MTXF_NEW);
Matrix_RotateX(gCalcMatrix, M_DTOR * xRot, MTXF_APPLY);
sp40.x = sp40.y = 0.0f;
sp40.z = 50.0f;

View File

@ -8,31 +8,6 @@
#include "assets/ast_enmy_planet.h"
#include "assets/ast_zoness.h"
// f32 temp[] = {
// 13.0f,
// { { -163.79999f, 187.2f }, { 1495.0f, 119.6f }, { 0.0f, 153.4f } },
// { { -397.8f, 130.0f }, { 1284.3999f, 262.59998f }, { 0.0f, 80.6f } },
// { { -223.59999f, 197.59999f }, { 904.8f, 145.59999f }, { 0.0f, 140.4f } },
// {
// HITBOX_ROTATED,
// { 40.0f, 0.0f, 0.0f },
// { { -561.6f, 119.6f }, { 600.6f, 319.8f }, { 338.0f, 104.0f } },
// },
// {
// HITBOX_ROTATED,
// { 40.0f, 0.0f, 0.0f },
// { { -561.6f, 119.6f }, { 600.6f, 319.8f }, { -338.0f, 104.0f } },
// },
// { { -78.0f, 231.4f }, { 577.19995f, 184.59999f }, { 0.0f, 189.79999f } },
// { { 26.0f, 754.0f }, { 140.4f, 267.8f }, { 0.0f, 215.79999f } },
// { { -556.39996f, 260.0f }, { 491.4f, 226.2f }, { 0.0f, 179.4f } },
// { { -213.2f, 200.2f }, { 473.19998f, 231.4f }, { 613.6f, 187.2f } },
// { { -213.2f, 200.2f }, { 473.19998f, 231.4f }, { -613.6f, 187.2f } },
// { { -351.0f, 694.19995f }, { 33.8f, 208.0f }, { 572.0f, 306.8f } },
// { { -351.0f, 694.19995f }, { 33.8f, 208.0f }, { -572.0f, 306.8f } },
// { { -896.99994f, 244.4f }, { 863.19995f, 171.59999f }, { 0.0f, 93.6f } },
// };
typedef struct {
f32 id;
Vec3f tilt;
@ -2217,12 +2192,12 @@ void Zoness_80194A84(Boss* bossZO) {
break;
case 3:
if (ZO_HIT_12(bossZO)->z.offset != -883.99994f) {
ZO_HIT_12(bossZO)->z.offset = -883.99994f;
ZO_HIT_12(bossZO)->z.size = 244.4f;
ZO_HIT_12(bossZO)->y.offset = 863.19995f;
ZO_HIT_12(bossZO)->y.size = 171.59999f;
ZO_HIT_12(bossZO)->z.offset = -883.99994f; // 13 * 68.0
ZO_HIT_12(bossZO)->z.size = 244.4f; // 13 * 18.8
ZO_HIT_12(bossZO)->y.offset = 863.19995f; // 13 * 66.4
ZO_HIT_12(bossZO)->y.size = 171.59999f; // 13 * 13.2
ZO_HIT_12(bossZO)->x.offset = 0.0f;
ZO_HIT_12(bossZO)->x.size = 93.6f;
ZO_HIT_12(bossZO)->x.size = 93.6f; // 13 * 7.2
}
Math_SmoothStepToF(&bossZO->fwork[ZO_FWK_4], 100.0f, 0.1f, 1.0f, 0.0f);
if (bossZO->timer_058 != 0) {
@ -3267,7 +3242,7 @@ void Zoness_801991D0(Boss* bossZO, s32 arg1) {
}
}
if (arg1 == 0) {
if (arg1 == 0) { // all divisible by 13
ZO_HIT_12(bossZO)->z.offset = -556.39996f;
ZO_HIT_12(bossZO)->z.size = 130.0f;
ZO_HIT_12(bossZO)->y.offset = 663.0f;
@ -3575,7 +3550,7 @@ void Zoness_8019A1FC(Actor* actor) {
}
for (var_s0 = 0; var_s0 < var_s1; var_s0++) {
Matrix_Translate(gGfxMatrix, 0.0f, 30.0f, 0.0f, MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, 1.5707964f, MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, M_PI / 2, MTXF_APPLY);
Matrix_Push(&gGfxMatrix);
Matrix_Scale(gGfxMatrix, 0.75f, 0.75f, 0.75f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
@ -3769,7 +3744,7 @@ void Zoness_8019ACCC(Actor* actor) {
Matrix_RotateX(gGfxMatrix, M_DTOR * temp_fs0_4, MTXF_APPLY);
Matrix_Push(&gGfxMatrix);
Matrix_RotateZ(gGfxMatrix, M_DTOR * var_fs5, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, 1.5707964f, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, M_PI / 2, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, 1.5f, 1.5f, 1.5f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, D_ZO_6018660);
@ -4260,7 +4235,7 @@ void Zoness_8019C83C(Actor* actor) {
gSPDisplayList(gMasterDisp++, D_ZO_6013330);
Matrix_Pop(&gGfxMatrix);
Matrix_Push(&gGfxMatrix);
Matrix_RotateZ(gGfxMatrix, 1.5707964f, MTXF_APPLY);
Matrix_RotateZ(gGfxMatrix, M_PI / 2, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, -110.0f, 0.0f, 0.0f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, D_ZO_601D680);
@ -4286,7 +4261,7 @@ void Zoness_8019C83C(Actor* actor) {
}
for (i = 0; i < var_s1; i++) {
Matrix_Translate(gGfxMatrix, 0.0f, 9.3f, 0.0f, MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, 1.5707964f, MTXF_APPLY);
Matrix_RotateY(gGfxMatrix, M_PI / 2, MTXF_APPLY);
Matrix_Push(&gGfxMatrix);
Matrix_Scale(gGfxMatrix, 0.5f, 0.5f, 0.5f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);

View File

@ -885,7 +885,7 @@ void Fortuna_LevelComplete(Player* player) {
case 11:
D_ctx_80177A48[1] += D_ctx_80177A48[3];
Matrix_RotateX(gCalcMatrix, -0.17453292f, MTXF_NEW);
Matrix_RotateX(gCalcMatrix, -M_DTOR * 10.0f, MTXF_NEW);
Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[1] * M_DTOR, MTXF_APPLY);
src.x = 0;
src.y = 0.0f;

View File

@ -5000,7 +5000,7 @@ void Titania_801982A8(Boss* boss) {
RCP_SetupDL(&gMasterDisp, 0x45);
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 0, 0, 0, 255);
gDPSetEnvColor(gMasterDisp++, 0, 0, 0, 0);
Matrix_RotateX(gGfxMatrix, -1.5707964f, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, -M_PI / 2, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, boss->fwork[47] * 10.0f, boss->fwork[47] * 10.0f, 1.0f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, D_1024AC0);
@ -5017,7 +5017,7 @@ void Titania_801982A8(Boss* boss) {
RCP_SetupDL(&gMasterDisp, 0x45);
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 0, 0, 0, 255);
gDPSetEnvColor(gMasterDisp++, 0, 0, 0, 0);
Matrix_RotateX(gGfxMatrix, -1.5707964f, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, -M_PI / 2, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, 10.0f, 10.0f, 1.0f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, D_1024AC0);
@ -5053,7 +5053,7 @@ void Titania_801982A8(Boss* boss) {
Matrix_Push(&gGfxMatrix);
sp120 = D_i5_801BBEF0[7] * 16.0f;
RCP_SetupDL(&gMasterDisp, 0x40);
Matrix_RotateX(gGfxMatrix, 1.5707964f, MTXF_APPLY);
Matrix_RotateX(gGfxMatrix, M_PI / 2, MTXF_APPLY);
Matrix_Push(&gGfxMatrix);
Matrix_Scale(gGfxMatrix, sp120, 1.0f, sp120, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);

View File

@ -2118,7 +2118,8 @@ void Andross_8018DBF0(Boss* boss) {
Math_SmoothStepToF(&boss->fwork[13], 80.0f, 1.0f, 15.0f, 0);
}
if (boss->unk_04C == 25) {
AUDIO_PLAY_SFX(0x09008015, D_i6_801A67B8, 4);
// Why tank?
AUDIO_PLAY_SFX(NA_SE_TANK_BOUND, D_i6_801A67B8, 4);
}
}
Math_SmoothStepToF(&boss->fwork[9], 1.0f, 1.0f, 0.01f, 0);

View File

@ -1322,7 +1322,7 @@ void Map_8019E99C(void) {
D_menu_801CDA08 = 0.0f;
D_menu_801CDA0C = -42.750008f;
D_menu_801CDA10 = -9.849999f;
D_menu_801CDA14 = 3375.000000f;
D_menu_801CDA14 = 3375.0f; // 15^3
D_menu_801CDA18 = 0.0f;
D_menu_801CDA1C = 0.0f;
@ -2770,7 +2770,7 @@ void Map_801A281C(void) {
D_menu_801CDA0C = -42.750008f;
D_menu_801CDA10 = -9.849999f;
D_menu_801CDA14 = 3375.000000f;
D_menu_801CDA14 = 3375.0f; // 15^3
Map_801AD718(D_menu_801CEF58[6].x, D_menu_801CEF58[6].y, D_menu_801CEF58[6].z, &D_menu_801CEEE8[6].x,
&D_menu_801CEEE8[6].y, &D_menu_801CEEE8[6].z, D_menu_801CDA14, D_menu_801CDA0C, D_menu_801CDA10);

View File

@ -1,5 +1,6 @@
#include "sys.h"
#include "PR/os_internal.h"
#include "mods.h"
FaultMgr gFaultMgr;
@ -242,7 +243,7 @@ void Fault_ThreadEntry(void* arg0) {
func_8000762C(300, 10, "-");
gControllerPlugged[0] = 1;
#if 1 // Turn this off for instant crash debugger (no button combination needed)
#if MODS_AUTO_DEBUGGER == 0 // Turn this off for instant crash debugger (no button combination needed)
while (var_s5 == 0) {
osSendMesg(&gSerialThreadMesgQueue, (OSMesg) SI_READ_CONTROLLER, OS_MESG_NOBLOCK);
MQ_WAIT_FOR_MESG(&gControllerMesgQueue, NULL);