sotn-decomp/include/sfx.h
Luciano Ciccariello be1b53f268
DRA HandlePlay matching (#367)
Very happy of this one. I tried decompiling it two months ago without
success but I decided to give it another try less than 24 hours ago. It
is the function called on every frame while the normal gameplay is
running. This also manages how to transition from a stage to another,
which files to load, set specific random seeds when playing a Tactics
recording.

Note that I refactored `func_800EAF28` as it is used by `HandlePlay`. I
also moved `GameSteps` out of `gameover.c` as it is started to be used
in another handler too. I do not know what `SET_UNK_0B` or `SET_UNK_12`
do, but I added in case at some point we want to explore their meaning.

`func_800F298C` is the function that handles the whole gameplay. That is
the biggest DRA function and the second biggest function of the game. I
hope one day we will manage to decompile that too.

In `case Play_LoadStageChr` there seems to be a hidden loading screen
populated by that `for` loop right after `D_8013640C =
AllocPrimitives(PRIM_GT4, 16);`. It is hidden because `blendMode` is set
to `0`. Setting it to either `8` or `0x88` shows a black screen rather
than showing Alucard frozen in the CD room for those two seconds. I do
not believe it was supposed to be black as X2, Y2, X3 and Y3 have some
kind of rotation and the U/V coords hints the fact some textures were
supposed to be loaded.
2023-07-17 20:51:26 +01:00

238 lines
8.9 KiB
C

/**
* File: sfx.h
* Description: SOTN Sound Effects
*
* Glossary:
* NA = North America
* JP = Japan
* SE = Sound Effect
* SY = System
* PL = Player
* WP = Weapon
* EV = Environment
* CS = Cutscene
* IT = Item
* EN = Enemy
* VO = Voice
* BO = Boss
* DR = Dracula
* DE = Death
* SH = Shaft
* ML = Master Librarian
* FE = Ferryman
* AL = Alucard
* MA = Maria
* RI = Richter
* WO = Form of Wolf
* BT = Form of Bat
* MU = Music
*/
// playSfx flags
typedef enum { MONO_SOUND, STEREO_SOUND } soundMode;
#define SET_SOUNDMODE_MONO 5
#define SET_SOUNDMODE_STEREO 6
#define SET_STOP_MUSIC 0xA
#define SET_UNK_0B 0xB
#define SET_UNK_12 0x12
// XA music tracks
// LOOP_POINT means it starts playing from part way into the song
#define MU_LOST_PAINTING 0x301
#define MU_LOST_PAINTING_LOOP_POINT 0x302
#define MU_CURSE_ZONE 0x303
#define MU_CURSE_ZONE_LOOP_POINT 0x304
#define MU_REQUIEM_FOR_THE_GODS 0x305
#define MU_REQUIEM_FOR_THE_GODS_LOOP_POINT 0x306
#define MU_RAINBOW_CEMETERY 0x307
#define MU_RAINBOW_CEMETERY_LOOP_POINT 0x308
#define MU_WOOD_CARVING_PARTITA 0x309
// 0x30A seems to be blank
#define MU_CRYSTAL_TEARDROPS 0x30B
#define MU_CRYSTAL_TEARDROPS_LOOP_POINT 0x30C
#define MU_MARBLE_GALLERY 0x30D
#define MU_MARBLE_GALLERY_LOOP_POINT 0x30E
#define MU_DRACULAS_CASTLE 0x30F
#define MU_DRACULAS_CASTLE_LOOP_POINT 0x310
#define MU_THE_TRAGIC_PRINCE 0x311
#define MU_THE_TRAGIC_PRINCE_LOOP_POINT 0x312
#define MU_TOWER_OF_MIST 0x313
#define MU_TOWER_OF_MIST_LOOP_POINT 0x314
#define MU_DOOR_OF_HOLY_SPIRITS 0x315
#define MU_DOOR_OF_HOLY_SPIRITS_LOOP_POINT 0x316
#define MU_DANCE_OF_PALES 0x317
#define MU_DANCE_OF_PALES_LOOP_POINT 0x318
#define MU_ABANDONED_PIT 0x319
#define MU_ABANDONED_PIT_LOOP_POINT 0x31A
#define MU_HEAVENLY_DOORWAY 0x31B
// 0x31C empty
#define MU_FESTIVAL_OF_SERVANTS 0x31D
#define MU_FESTIVAL_OF_SERVANTS_LOOP_POINT 0x31E
#define MU_DANCE_OF_ILLUSIONS 0x31F
#define MU_DANCE_OF_ILLUSIONS_LOOP_POINT 0x320
#define MU_PROLOGUE 0x321
#define MU_PROLOGUE_LOOP_POINT 0x322
#define MU_WANDERING_GHOSTS 0x323
#define MU_WANDERING_GHOSTS_LOOP_POINT 0x324
#define MU_THE_DOOR_TO_THE_ABYSS 0x325
#define MU_THE_DOOR_TO_THE_ABYSS_LOOP_POINT 0x326
#define MU_METAMORPHOSIS 0x327
#define MU_METAMORPHOSIS_II 0x328
// 0x329 blank
#define SE_INTRO_WIND 0x32A // wind sound from intro
#define SE_INTRO_WIND_LOOP_POINT 0x32B
#define SE_INTRO_WIND_QUIET 0x32C // quieter wind
#define SE_INTRO_WIND_QUIET_LOOP_POINT 0x32D
#define MU_DANCE_OF_GOLD 0x32E
#define MU_DANCE_OF_GOLD_LOOP_POINT 0x32F
#define MU_ENCHANTED_BANQUET 0x330
#define MU_ENCHANTED_BANQUET_LOOP_POINT 0x331
#define MU_PRAYER 0x332
#define MU_PRAYER_LOOP_POINT 0x333
#define MU_DEATH_BALLAD 0x334
#define MU_DEATH_BALLAD_LOOP_POINT 0x335
#define MU_BLOOD_RELATIONS 0x336
#define MU_BLOOD_RELATIONS_LOOP_POINT 0x337
#define MU_FINAL_TOCATTA 0x338
#define MU_FINAL_TOCATTA_LOOP_POINT 0x339
#define MU_BLACK_BANQUET 0x33A
#define MU_BLACK_BANQUET_LOOP_POINT 0x33B
#define MU_I_AM_THE_WIND 0x33C
#define MU_SILENCE 0x33D
#define MU_LAND_OF_BENEDICTION 0x33E
#define MU_JP_FAIRY_SONG 0x33F // japanese version of fairy song
#define MU_MOONLIGHT_NOCTURNE 0x340 // music during intro scrolling text
// japanese intro narration
#define JP_VO_KATSUTE 0x341 // Narrator says "Katsute ..."
#define JP_VO_SOSHITE \
0x342 // Narrator says "Soshite 5 nen no tsukihi ga nagareta"
#define JP_VO_AKUMAJO \
0x343 // Narrator says "Akumajo Dracula X Gekka no Yasoukyoku"
// japanese voice actor messages
#define JP_VO_FUKAMI_RIKA_MESSAGE 0x344 // Message from Fukami Rika
#define JP_VO_SHIINA_HEKIRU_MESSAGE 0x345 // Message from Shiina Hekiru
#define JP_VO_YANADA_KIYOYUKI_MESSAGE 0x346 // Message from Yanada Kiyoyuki
#define JP_VO_OKIAYU_RYOUTAROU_MESSAGE 0x347 // Message from Okiayu Ryoutarou
#define JP_VO_SATOU_MASAHARU_MESSAGE 0x348 // Message from Satou Masaharu
#define JP_VO_WAKAMOTO_NORIO_MESSAGE 0x349 // Message from Wakamoto Norio
#define JP_VO_YOKOYAMA_CHISA_MESSAGE 0x34A // Message from Yokoyama Chisa
#define JP_VO_YANAMI_JYOUJI_MESSAGE 0x34B // Message from Yanami Jyouji
// various voice actors saying konami
#define JP_VO_KONAMI_1 0x34C // woman says konami
#define JP_VO_KONAMI_2 0x34D // woman says konami
#define JP_VO_KONAMI_3 0x34E // woman says konami
#define JP_VO_KONAMI_4 0x34F // man says kona (mi cut off?)
#define JP_VO_KONAMI_5 0x350 // man says kona (mi cut off?)
#define JP_VO_KONAMI_6 0x351 // man says konami
#define JP_VO_KONAMI_7 0x352 // man says konami
#define JP_VO_KONAMI_8 0x353 // man says konami
#define JP_VO_KONAMI_9 0x354 // woman says konami
#define JP_VO_KONAMI_10 0x355 // woman says konami
#define JP_VO_KONAMI_11 0x356 // man says konami
#define JP_VO_KONAMI_12 0x357 // man says konami
// Prologue cutscene
#define NA_VO_RI_DIE_MONSTER 0x358 // Richter says "Die monster ..."
#define NA_VO_DR_IT_WAS_NOT 0x359 // Dracula says "It was not by my hand ..."
#define NA_VO_RI_TRIBUTE 0x35A // Richter says "Tribute? ..."
#if defined(VERSION_US)
#define NA_VO_MA_IF_YOU_WEAR \
0x3CE // Maria: If you wear these, you can see beyond evil illusions.
#define NA_VO_RI_IMPRESSIVE_WHIP \
0x3DA // Richter: Impressive, you were able to avoid my whip. Let's see how
// you like this!
#define NA_VO_RI_IMPRESSIVE_ESCAPE \
0x3DB // Richter: Impressive, but you can't escape this.
#define NA_VO_RI_ONLY_THE_COUNT \
0x3DC // Richter: Hah, I knew it. Only the count is a true match for me.
#define NA_VO_AL_DEATH_DREAM_WORLD \
0x391 // Alucard: Death in the dream world will set your soul wandering for
// eternity, demon.
#define JP_VO_SH_GROAN 0x52E // Shaft groans
#define JP_VO_SH_SCREAM 0x52F // Shaft screams
#define JP_VO_SH_SONO_TEIDO 0x530 // Shaft: Sono teido no chikara de tatakai...
#endif
// This sound plays when MAX UP spawns and during Dracula transformation
#define NA_SE_UNK_62F 0x62F
#define NA_SE_EV_HEAVY_BLOCK_DRAG 0x609
#define NA_SE_EN_BLOOD_ZOMBIE_SWORD_SLASH 0x60B
#define NA_SE_AL_BACKSLIDE 0x617
#define NA_SE_EV_VASE_BREAK 0x61D
#define NA_SE_PL_BT_ECHO 0x61F
#define NA_SE_EN_SKELETON_DESTROY 0x62B
#define NA_SE_EV_GLASS_BREAK 0x632
#define NA_SE_BREAK_CANDLE 0x634
#define NA_SE_PL_WARP 0x636
#define NA_SE_EN_OPEN_DOOR 0x642
#define NA_SE_EN_COG_CLICK 0x642
#define NA_SE_EN_ROCK_BREAK 0x644
#define NA_SE_EN_SLOGRA_FLOOR_STOMP 0x64F
#define NA_SE_EN_GAIBON_SMALL_FIREBALL 0x652
#define NA_SE_EN_GAIBON_BIG_FIREBALL 0x655
#define NA_SE_SECRET_STAIRS NA_SE_EN_ROCK_BREAK
#define NA_SE_EN_ZOMBIE_EXPLODE 0x65E
#define NA_SE_EN_GAIBON_FLAME_OUT 0x65E
#define NA_SE_EN_DR_FIREBALL 0x660
#define NA_SE_EN_AXE_KNIGHT_BREAK_AXE 0x66B
#define NA_SE_EN_BONE_SCIMITAR_SWORD_SLASH 0x66D
#define NA_SE_EN_GAIBON_COLLAPSE 0x672
#define NA_SE_EV_SWITCH_CLICK 0x676
#define NA_SE_PL_COLLECT_HEART 0x67A
#define NA_SE_SY_MOVE_MENU_CURSOR 0x67B
#define NA_SE_PL_IT_PICKUP 0x67C
#define NA_SE_PL_MP_GAUGE 0x67D
#define NA_SE_PL_BT_FIREBALL 0x680
#define NA_SE_PL_MAX_HP_MP_INCREASED 0x687
#define NA_SE_BREAK_GLASS 0x68B
#define NA_SE_EN_GAIBON_FLAP_WINGS 0x68D
#define NA_SE_EN_SLOGRA_SPEAR_PROJECTILE 0x690
#define NA_SE_EN_GAIBON_FLAME 0x691
#define NA_SE_EN_EXPLOSIVE_DEATH 0x693
#define NA_SE_EN_SLOGRA_DEATH_EXPLOSION 0x697
#define NA_SE_EV_CLOCK_TICK 0x6A1
#define NA_SE_PL_COLLECT_GOLD 0x6A9
#define NA_SE_EN_SLOGRA_SPEAR_SLASH 0x6C6
#define NA_SE_EN_SLOGRA_BEAK_ATTACK 0x6C8
#define NA_SE_EN_SKELETON_THROW_BONE 0x6C8
#define NA_SE_EN_BLOOD_SKELETON_DISASSEMBLES 0x6CB
#define NA_SE_EN_BLOOD_SKELETON_REASSEMBLES 0x6CC
#define NA_SE_PL_RIC_UNK_6E2 0x6E2
#define NA_SE_VO_AL_PUNCH 0x6F1
#define NA_SE_VO_AL_WHAT 0x6F2
#define NA_SE_VO_AL_DARK_METAMORPHOSIS 0x6F3
#define NA_SE_VO_AL_SOUL_STEAL 0x6F4
#define NA_SE_VO_AL_DYING 0x6F6
#define NA_SE_VO_WO_BARK 0x706
#define NA_SE_EN_SLOGRA_HISSING 0x709
#define NA_SE_EN_GAIBON_SCREAM 0x70B
#define NA_SE_EN_SLOGRA_HURT_2 0x70A
#define NA_SE_EN_SLOGRA_HURT 0x70C
#define NA_SE_EN_SPITTLEBONE_ACID_SPLAT 0x73C
#define NA_SE_EN_BLOODY_ZOMBIE_INJURED_SCREAM 0x746
#define NA_SE_EN_BLOODY_ZOMBIE_DEATH_SCREAM 0x747
#define NA_SE_EN_BLOODY_ZOMBIE_INJURED 0x748
#define NA_SE_EN_BLOODY_ZOMBIE_HEMORRHAGE 0x749
#define NA_SE_VO_AXE_KNIGHT_THROW 0x766
#define NA_SE_VO_AXE_KNIGHT_SCREAM 0x767
#define NA_SE_EV_WATER_SPLASH 0x7C2
#define NA_SE_BO_DEFEATED 0x7D2
#define NA_SE_VO_DR_TAUNT_1 0x84F
#define NA_SE_VO_DR_TAUNT_2 0x850
#define NA_SE_VO_DR_HURT_1 0x853
#define NA_SE_VO_DR_HERE_IS_TRUE_POWER 0x855
#define NA_SE_VO_DR_GRANT_ME_POWER 0x857
#define NA_SE_VO_DR_PLAYTIME_IS_OVER 0x858
#define NA_SE_VO_DR_HURT_2 0x85B
#define NA_SE_VO_DR_HURT_3 0x85C
#define NA_SE_VO_DR_HURT_4 0x85D
#define NA_SE_PL_TELEPORT 0x8BA
#define NA_SE_CS_BURNING_PHOTOGRAPH 0x8BE