Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
battle_sound.c
Go to the documentation of this file.
1/* FIGHTSTG's battle sounds. */
2
4
5/* The battle sound's task: keys its sound off once its time is up */
7 switch (task->state) {
8 case TASK_INIT:
9 case TASK_RUN:
10 default:
12 if (task->time <= 0) {
13 SOUND.keyOff(task->sound, task->voice);
14 task->setState(task, TASK_KILL);
15 }
16 break;
17 case TASK_DONE:
18 case TASK_KILL:
19 break;
20 }
21}
22
23/* the sound ids of FIGHTSTG_playBattleSound, by index */
25 SOUND_WIN_JINGLE, SOUND_MENU_CONFIRM, 0x40004, 0x4000A,
26 0x4000B, 0x4000C, SOUND_INN_JINGLE, SOUND_RECOVERY,
27 SOUND_MENU_CLOSE, SOUND_MENU_OPEN, 0x40017, 0x40011,
28 0x4000F, 0x4001F, 0x40016, 0x40010,
29 0x4000E, 0x40012, SOUND_SWITCH01, SOUND_SWITCH02,
30 0x8004213E, 0x800421BF, 0xA0042240, 0x80042342,
31 0x80042444, 0x8004293E, SOUND_COMCD103, 0x80042A40,
32 0x40001, 0x80042B42, 0x80042C44, 0x80042CC5,
33 0x80042D46, 0x80042DC7, 0x80042E48, 0xA0042F4A,
34 SOUND_COMCD115, 0xA004303C, 0x800430BD, 0x8004313E,
35 0xA00431BF, 0xA0043240, 0x800432C1, 0x80043342,
36 0x800433C3, 0x800434C5, 0x80043546, 0xA00435C7,
37 0x80043648, 0x8004374A, 0x800437CB, 0x8004383C,
38 0x80043A40, 0xA0043BC3, 0xA0043C44, 0x800440BD,
39 0x8004413E, 0x800441BF, 0x80044240, 0x800442C1,
40 0x80044444, 0x800445C7, 0x80044648, SOUND_COMEX113,
41 0x8004474A, 0x8004483C, 0x41180000, SOUND_SELECT,
43 SOUND_MENU_MOVE, 0x800454C4, 0x8004583C, 0x800458BD,
44 0x8004593E, 0x800459BF, 0x80045A40, 0x80045AC1,
45 0x80045B42, 0x80045BC3, 0x80045C44, 0x80045CC5,
46 0x80045D46, 0x80045DC7, 0x8004603C, SOUND_CARD_001,
47 0x8004613E, 0x20040006, 0, 0,
48};
49/* how the fight stage and WFIGHTMN read the battle table */
50BattleTableEntry *(*FIGHTSTG_battleTableFunc)(s32 id) = FIGHTSTG_getBattleTableEntry;
51
52/* Plays battle sound index (FIGHTSTG_battleSounds; 0x5A the battle's music,
53 0x5B stops sound 0x20040006), for time frames when time is not 0 */
55 s32 id;
56 BattleSound *task;
57
58 switch (index) {
59 default:
60 id = FIGHTSTG_battleSounds[index];
61 break;
62 case 0x5A:
64 break;
65 case 0x5B:
66 SOUND.stopSound(0x20040006);
67 return NULL;
68 }
69 if (time == 0) {
70 SOUND.playSound(id);
71 return NULL;
72 }
74 task->sound = id;
75 task->voice = SOUND.playSound(id);
76 task->time = time;
77 return task;
78}
Battle FIGHTSTG_battle
the battle: its fighters, speed and drawing functions
Definition battle.c:16
FIGHTSTG.PRO: the battle.
BattleSound * FIGHTSTG_playBattleSound(s32 index, s32 time)
Plays battle sound index (FIGHTSTG_battleSounds; 0x5A the battle's music, 0x5B stops sound 0x20040006...
void FIGHTSTG_updateBattleSound(BattleSound *task)
The battle sound's task: keys its sound off once its time is up.
Definition battle_sound.c:6
s32 FIGHTSTG_battleSounds[]
the sound ids of FIGHTSTG_playBattleSound, by index
BattleTableEntry * FIGHTSTG_getBattleTableEntry(s32 id)
Enemy Digimon id's entry in the battle table, or NULL.
#define NULL
Definition common.h:17
signed int s32
Definition common.h:11
#define TASK_RUN
Definition task.h:35
#define TASK_KILL
Definition task.h:37
#define TASK_INIT
Tasks: every game object is a task, a heap block that starts with this header and is updated once per...
Definition task.h:34
#define TASK_DONE
Definition task.h:36
BattleSetup BATTLE_SETUP
Definition items.c:886
SoundState SOUND
rsin and rcos (libgte) read rsin_tbl[a - 0x800] and the like: their addresses before the table fall i...
Definition sound.c:180
#define SOUND_RECOVERY
RECOVERY.
Definition sound.h:46
#define SOUND_COUNT
SYSTEM10: a number counts up or down.
Definition sound.h:45
#define SOUND_SWITCH01
Definition sound.h:50
#define SOUND_WIN_JINGLE
W_JINGLE: a battle won.
Definition sound.h:48
#define SOUND_COMCD115
held until SOUND.keyOff
Definition sound.h:54
#define SOUND_SYSTEM05
Definition sound.h:57
#define SOUND_COMCD103
Definition sound.h:53
#define SOUND_MENU_CLOSE
SYSTEM04.
Definition sound.h:42
#define SOUND_COMEX113
Definition sound.h:55
#define SOUND_MENU_CONFIRM
SYSTEM07.
Definition sound.h:44
#define SOUND_INN_JINGLE
JINGLE04: a night at the inn.
Definition sound.h:49
#define SOUND_SELECT
Sounds the overlays share, with SOUNDTST's names.
Definition sound.h:38
#define SOUND_MENU_OPEN
SYSTEM03.
Definition sound.h:41
#define SOUND_MENU_CANCEL
SYSTEM01.
Definition sound.h:39
#define SOUND_SWITCH02
Definition sound.h:51
#define SOUND_MENU_MOVE
SYSTEM06.
Definition sound.h:43
#define SOUND_CURSOR
SYSTEM02: a cursor moves.
Definition sound.h:40
#define SOUND_CARD_001
Definition sound.h:61
s32 music
the battle's music
Definition game_state.h:385
A battle sound (FIGHTSTG_playBattleSound) that is keyed off after time.
Definition effect.h:26
s32 voice
Definition effect.h:29
void(* setState)(struct BattleSound *task, s32 state)
Definition effect.h:27
s32 state
Definition effect.h:27
s32 sound
Definition effect.h:28
s32 time
Definition effect.h:30
s32 frames
since the last update
Definition battle.h:239
void(* stopSound)(s32 id)
Definition sound.h:195
short(* playSound)(s32 id)
returns the voice of a key-on
Definition sound.h:187
void(* keyOff)(s32 id, s16 voice)
Definition sound.h:189
void * createTask(void(*update)(), s32 size, s32 childrenSize)
createTaskWithId for a task nothing needs to find
Definition task.c:105