summaryrefslogtreecommitdiff
path: root/libs/Z2AudioLib/Z2SoundObjMgr.cpp
blob: 17d781338e7a6b7145e42f58f4b24e1f571f2b27 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
//
// Generated By: dol2asm
// Translation Unit: Z2SoundObjMgr
//

#include "Z2AudioLib/Z2SoundObjMgr.h"
#include "Z2AudioLib/Z2SeqMgr.h"
#include "dol2asm.h"
#include "dolphin/types.h"

//
// Types:
//

struct Z2Calc {
    struct CurveSign {};

    /* 802A96F4 */ void getParamByExp(f32, f32, f32, f32, f32, f32, Z2Calc::CurveSign);
};

//
// Forward References:
//

extern "C" void __ct__13Z2SoundObjMgrFv();
extern "C" void setForceBattleArea__13Z2SoundObjMgrFbUsUsUs();
extern "C" void searchEnemy__13Z2SoundObjMgrFv();
extern "C" void setGhostEnemyState__13Z2SoundObjMgrFUc();
extern "C" void func_802C0074();
extern "C" void setBattleInit__13Z2SoundObjMgrFv();
extern "C" void checkBattleFinish__13Z2SoundObjMgrFv();
extern "C" void deleteEnemyAll__13Z2SoundObjMgrFv();
extern "C" void func_802C0190();
extern "C" void isTwilightBattle__13Z2SoundObjMgrFv();
extern "C" void __sinit_Z2SoundObjMgr_cpp();

//
// External References:
//

extern "C" void getParamByExp__6Z2CalcFffffffQ26Z2Calc9CurveSign();
extern "C" void changeBgmStatus__8Z2SeqMgrFl();
extern "C" void changeSubBgmStatus__8Z2SeqMgrFl();
extern "C" void setBattleSearched__8Z2SeqMgrFb();
extern "C" void setBattleGhostMute__8Z2SeqMgrFb();
extern "C" void setBattleDistState__8Z2SeqMgrFUc();
extern "C" void stopBattleBgm__8Z2SeqMgrFUcUc();
extern "C" void initiate__10JSUPtrListFv();
extern "C" void append__10JSUPtrListFP10JSUPtrLink();
extern "C" void remove__10JSUPtrListFP10JSUPtrLink();
extern "C" void _savegpr_23();
extern "C" void _savegpr_27();
extern "C" void _restgpr_23();
extern "C" void _restgpr_27();
extern "C" void strcmp();
extern "C" extern Z2SoundObjMgr* data_80450B48;
extern "C" extern u8 data_80450B80[4];
extern "C" extern Z2SeqMgr* data_80450B84;
extern "C" u8 mLinkPtr__14Z2CreatureLink[4 + 4 /* padding */];

//
// Declarations:
//

/* 802BF920-802BF980 2BA260 0060+00 0/0 1/1 0/0 .text            __ct__13Z2SoundObjMgrFv */
#ifdef NONMATCHING
// order wrong because this needs to inherit from JASGlobalInstance<T>
Z2SoundObjMgr::Z2SoundObjMgr() {
    data_80450B48 = this;
    mGhostEnemyState = 0;
    mTwilightBattle = false;
    setBattleInit();
    setForceBattleArea(false, 700, 1100, 1500);
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm Z2SoundObjMgr::Z2SoundObjMgr() {
    nofralloc
#include "asm/Z2AudioLib/Z2SoundObjMgr/__ct__13Z2SoundObjMgrFv.s"
}
#pragma pop
#endif

/* 802BF980-802BF994 2BA2C0 0014+00 1/1 3/3 3/3 .text setForceBattleArea__13Z2SoundObjMgrFbUsUsUs
 */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void Z2SoundObjMgr::setForceBattleArea(bool param_0, u16 param_1, u16 param_2, u16 param_3) {
    nofralloc
#include "asm/Z2AudioLib/Z2SoundObjMgr/setForceBattleArea__13Z2SoundObjMgrFbUsUsUs.s"
}
#pragma pop

/* ############################################################################################## */
/* 8039C240-8039C250 0288A0 000C+04 1/1 0/0 0/0 .rodata          @3380 */
SECTION_RODATA static u8 const lit_3380[12 + 4 /* padding */] = {
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    /* padding */
    0x00,
    0x00,
    0x00,
    0x00,
};
COMPILER_STRIP_GATE(0x8039C240, &lit_3380);

/* 803CAD70-803CB170 027E90 0400+00 3/3 0/0 0/0 .data            mEnemyInfo */
SECTION_DATA static u8 mEnemyInfo[1024] = {
    0x44, 0x75, 0x6D, 0x6D, 0x79, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x45, 0x5F, 0x73, 0x31, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0xBC, 0x04, 0xB0, 0x07, 0xD0,
    0x45, 0x5F, 0x79, 0x6B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x45, 0x5F, 0x79, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x45, 0x5F, 0x79, 0x67, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x2C, 0x01, 0xF4, 0x02, 0xBC,
    0x45, 0x5F, 0x79, 0x63, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x45, 0x5F, 0x79, 0x64, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0xF4, 0x03, 0x84, 0x05, 0xDC,
    0x45, 0x5F, 0x72, 0x64, 0x79, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x45, 0x5F, 0x79, 0x6D, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x14, 0x00, 0x1E,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x45, 0x5F, 0x77, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x45, 0x5F, 0x72, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x45, 0x5F, 0x64, 0x6E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x45, 0x5F, 0x6B, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x45, 0x5F, 0x73, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x45, 0x5F, 0x74, 0x6B, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0xBC, 0x05, 0xDC, 0x09, 0xC4,
    0x45, 0x5F, 0x74, 0x6B, 0x32, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0xBC, 0x05, 0xDC, 0x09, 0xC4,
    0x45, 0x5F, 0x63, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x45, 0x5F, 0x64, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x45, 0x5F, 0x66, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x45, 0x5F, 0x53, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x45, 0x5F, 0x50, 0x4D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x45, 0x5F, 0x64, 0x62, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0xF4, 0x03, 0x84, 0x07, 0x08,
    0x45, 0x5F, 0x6B, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x45, 0x5F, 0x73, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x45, 0x5F, 0x73, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x45, 0x5F, 0x62, 0x73, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0xC8, 0x01, 0x90, 0x02, 0x58,
    0x45, 0x5F, 0x53, 0x4D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x45, 0x5F, 0x62, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x45, 0x5F, 0x62, 0x75, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x45, 0x5F, 0x48, 0x4D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x45, 0x5F, 0x67, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x45, 0x5F, 0x68, 0x7A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xF4, 0x03, 0x20, 0x05, 0x14,
    0x45, 0x5F, 0x77, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x45, 0x5F, 0x6F, 0x63, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x45, 0x5F, 0x66, 0x7A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x45, 0x5F, 0x66, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x45, 0x5F, 0x62, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x45, 0x5F, 0x6D, 0x6D, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0xF4, 0x03, 0x20, 0x05, 0xDC,
    0x45, 0x5F, 0x6E, 0x7A, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0xF4, 0x02, 0xBC, 0x04, 0x4C,
    0x45, 0x5F, 0x70, 0x6F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x45, 0x5F, 0x72, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x45, 0x5F, 0x73, 0x67, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0xF4, 0x02, 0xBC, 0x03, 0x84,
    0x45, 0x5F, 0x68, 0x62, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0xF4, 0x03, 0x84, 0x05, 0xDC,
    0x45, 0x5F, 0x67, 0x62, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x06, 0x40, 0x0B, 0xB8, 0x0F, 0xA0,
    0x45, 0x5F, 0x6D, 0x73, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0xF4, 0x02, 0xBC, 0x04, 0x4C,
    0x45, 0x5F, 0x64, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x45, 0x5F, 0x62, 0x69, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0xF4, 0x02, 0xBC, 0x03, 0x84,
    0x45, 0x5F, 0x74, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x45, 0x5F, 0x61, 0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x45, 0x5F, 0x64, 0x6B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x45, 0x5F, 0x77, 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x45, 0x5F, 0x67, 0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x45, 0x5F, 0x73, 0x6D, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x45, 0x5F, 0x73, 0x77, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x90, 0x02, 0x58, 0x05, 0xDC,
    0x45, 0x5F, 0x72, 0x64, 0x62, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0xF4, 0x03, 0xE8, 0x05, 0xDC,
    0x45, 0x5F, 0x6B, 0x6B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x45, 0x5F, 0x68, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x45, 0x5F, 0x7A, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x45, 0x5F, 0x67, 0x6D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x42, 0x5F, 0x47, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xE8, 0x07, 0xD0, 0x0F, 0xA0,
    0x45, 0x5F, 0x6D, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x45, 0x5F, 0x7A, 0x6D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x42, 0x5F, 0x74, 0x6E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};

/* 803CB170-803CB230 -00001 00C0+00 1/1 0/0 0/0 .data            @3704 */
SECTION_DATA static void* lit_3704[48] = {
    (void*)(((char*)searchEnemy__13Z2SoundObjMgrFv) + 0x1E4),
    (void*)(((char*)searchEnemy__13Z2SoundObjMgrFv) + 0x1E4),
    (void*)(((char*)searchEnemy__13Z2SoundObjMgrFv) + 0x1EC),
    (void*)(((char*)searchEnemy__13Z2SoundObjMgrFv) + 0x208),
    (void*)(((char*)searchEnemy__13Z2SoundObjMgrFv) + 0x208),
    (void*)(((char*)searchEnemy__13Z2SoundObjMgrFv) + 0x208),
    (void*)(((char*)searchEnemy__13Z2SoundObjMgrFv) + 0x208),
    (void*)(((char*)searchEnemy__13Z2SoundObjMgrFv) + 0x1BC),
    (void*)(((char*)searchEnemy__13Z2SoundObjMgrFv) + 0x208),
    (void*)(((char*)searchEnemy__13Z2SoundObjMgrFv) + 0x208),
    (void*)(((char*)searchEnemy__13Z2SoundObjMgrFv) + 0x208),
    (void*)(((char*)searchEnemy__13Z2SoundObjMgrFv) + 0x208),
    (void*)(((char*)searchEnemy__13Z2SoundObjMgrFv) + 0x1EC),
    (void*)(((char*)searchEnemy__13Z2SoundObjMgrFv) + 0x208),
    (void*)(((char*)searchEnemy__13Z2SoundObjMgrFv) + 0x208),
    (void*)(((char*)searchEnemy__13Z2SoundObjMgrFv) + 0x208),
    (void*)(((char*)searchEnemy__13Z2SoundObjMgrFv) + 0x208),
    (void*)(((char*)searchEnemy__13Z2SoundObjMgrFv) + 0x208),
    (void*)(((char*)searchEnemy__13Z2SoundObjMgrFv) + 0x208),
    (void*)(((char*)searchEnemy__13Z2SoundObjMgrFv) + 0x208),
    (void*)(((char*)searchEnemy__13Z2SoundObjMgrFv) + 0x208),
    (void*)(((char*)searchEnemy__13Z2SoundObjMgrFv) + 0x1EC),
    (void*)(((char*)searchEnemy__13Z2SoundObjMgrFv) + 0x208),
    (void*)(((char*)searchEnemy__13Z2SoundObjMgrFv) + 0x208),
    (void*)(((char*)searchEnemy__13Z2SoundObjMgrFv) + 0x1EC),
    (void*)(((char*)searchEnemy__13Z2SoundObjMgrFv) + 0x208),
    (void*)(((char*)searchEnemy__13Z2SoundObjMgrFv) + 0x208),
    (void*)(((char*)searchEnemy__13Z2SoundObjMgrFv) + 0x208),
    (void*)(((char*)searchEnemy__13Z2SoundObjMgrFv) + 0x1EC),
    (void*)(((char*)searchEnemy__13Z2SoundObjMgrFv) + 0x1D0),
    (void*)(((char*)searchEnemy__13Z2SoundObjMgrFv) + 0x1D0),
    (void*)(((char*)searchEnemy__13Z2SoundObjMgrFv) + 0x1EC),
    (void*)(((char*)searchEnemy__13Z2SoundObjMgrFv) + 0x208),
    (void*)(((char*)searchEnemy__13Z2SoundObjMgrFv) + 0x1EC),
    (void*)(((char*)searchEnemy__13Z2SoundObjMgrFv) + 0x208),
    (void*)(((char*)searchEnemy__13Z2SoundObjMgrFv) + 0x208),
    (void*)(((char*)searchEnemy__13Z2SoundObjMgrFv) + 0x208),
    (void*)(((char*)searchEnemy__13Z2SoundObjMgrFv) + 0x208),
    (void*)(((char*)searchEnemy__13Z2SoundObjMgrFv) + 0x1EC),
    (void*)(((char*)searchEnemy__13Z2SoundObjMgrFv) + 0x208),
    (void*)(((char*)searchEnemy__13Z2SoundObjMgrFv) + 0x208),
    (void*)(((char*)searchEnemy__13Z2SoundObjMgrFv) + 0x208),
    (void*)(((char*)searchEnemy__13Z2SoundObjMgrFv) + 0x208),
    (void*)(((char*)searchEnemy__13Z2SoundObjMgrFv) + 0x1EC),
    (void*)(((char*)searchEnemy__13Z2SoundObjMgrFv) + 0x1A8),
    (void*)(((char*)searchEnemy__13Z2SoundObjMgrFv) + 0x1D8),
    (void*)(((char*)searchEnemy__13Z2SoundObjMgrFv) + 0x208),
    (void*)(((char*)searchEnemy__13Z2SoundObjMgrFv) + 0x1D0),
};

/* 80455B80-80455B84 004180 0004+00 1/1 0/0 0/0 .sdata2          sAreaDefault */
SECTION_SDATA2 static u32 sAreaDefault = 0x010002BC;

/* 80455B84-80455B88 004184 0004+00 1/1 0/0 0/0 .sdata2          None */
SECTION_SDATA2 static u32 data_80455B84 = 0x044C05DC;

/* 80455B88-80455B8C 004188 0004+00 1/1 0/0 0/0 .sdata2          sAreaFloating */
SECTION_SDATA2 static u32 sAreaFloating = 0x000002BC;

/* 80455B8C-80455B90 00418C 0004+00 1/1 0/0 0/0 .sdata2          None */
SECTION_SDATA2 static u32 data_80455B8C = 0x044C05DC;

/* 80455B90-80455B94 004190 0004+00 1/1 0/0 0/0 .sdata2          sAreaWide */
SECTION_SDATA2 static u32 sAreaWide = 0x010002BC;

/* 80455B94-80455B98 004194 0004+00 1/1 0/0 0/0 .sdata2          None */
SECTION_SDATA2 static u32 data_80455B94 = 0x05DC0CE4;

/* 80455B98-80455B9C 004198 0004+00 1/1 0/0 0/0 .sdata2          sAreaWideFloating */
SECTION_SDATA2 static u32 sAreaWideFloating = 0x000002BC;

/* 80455B9C-80455BA0 00419C 0004+00 1/1 0/0 0/0 .sdata2          None */
SECTION_SDATA2 static u32 data_80455B9C = 0x05DC0CE4;

/* 80455BA0-80455BA4 0041A0 0004+00 1/1 0/0 0/0 .sdata2          sAreaSmall */
SECTION_SDATA2 static u32 sAreaSmall = 0x0100012C;

/* 80455BA4-80455BA8 0041A4 0004+00 1/1 0/0 0/0 .sdata2          None */
SECTION_SDATA2 static u32 data_80455BA4 = 0x02BC03E8;

/* 80455BA8-80455BAC 0041A8 0004+00 1/1 0/0 0/0 .sdata2          sAreaSmallFloating */
SECTION_SDATA2 static u32 sAreaSmallFloating = 0x000001F4;

/* 80455BAC-80455BB0 0041AC 0004+00 1/1 0/0 0/0 .sdata2          None */
SECTION_SDATA2 static u32 data_80455BAC = 0x032004B0;

/* 80455BB0-80455BB4 0041B0 0004+00 1/1 0/0 0/0 .sdata2          @3694 */
SECTION_SDATA2 static u8 lit_3694[4] = {
    0x00,
    0x00,
    0x00,
    0x00,
};

/* 80455BB4-80455BB8 0041B4 0004+00 1/1 0/0 0/0 .sdata2          @3695 */
SECTION_SDATA2 static f32 lit_3695 = 100.0f;

/* 80455BB8-80455BBC 0041B8 0004+00 1/1 0/0 0/0 .sdata2          @3696 */
SECTION_SDATA2 static f32 lit_3696 = 3.0f / 10.0f;

/* 80455BBC-80455BC0 0041BC 0004+00 1/1 0/0 0/0 .sdata2          @3697 */
SECTION_SDATA2 static f32 lit_3697 = 1.0f;

/* 80455BC0-80455BC4 0041C0 0004+00 1/1 0/0 0/0 .sdata2          @3698 */
SECTION_SDATA2 static f32 lit_3698 = 2.5f;

/* 80455BC4-80455BC8 0041C4 0004+00 1/1 0/0 0/0 .sdata2          @3699 */
SECTION_SDATA2 static f32 lit_3699 = 5000.0f;

/* 80455BC8-80455BCC 0041C8 0004+00 1/1 0/0 0/0 .sdata2          @3700 */
SECTION_SDATA2 static f32 lit_3700 = 2.0f;

/* 80455BCC-80455BD0 0041CC 0004+00 1/1 0/0 0/0 .sdata2          @3701 */
SECTION_SDATA2 static f32 lit_3701 = 4.0f;

/* 80455BD0-80455BD8 0041D0 0008+00 1/1 0/0 0/0 .sdata2          @3703 */
SECTION_SDATA2 static f64 lit_3703 = 4503599627370496.0 /* cast u32 to float */;

/* 802BF994-802BFFEC 2BA2D4 0658+00 1/0 1/1 0/0 .text            searchEnemy__13Z2SoundObjMgrFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void Z2SoundObjMgr::searchEnemy() {
    nofralloc
#include "asm/Z2AudioLib/Z2SoundObjMgr/searchEnemy__13Z2SoundObjMgrFv.s"
}
#pragma pop

void Z2SoundObjMgr::setGhostEnemyState(u8 p1) {
    if (p1 == 0x20) {
        if (field_0x1a >= field_0x16) {
            data_80450B84->setBattleGhostMute(true);
        }
    } else {
        if (field_0x1a == false) {
            mGhostEnemyState = 0;
            return;
        }
    }

    mGhostEnemyState = p1 + (mGhostEnemyState & 1);
}

/* 802C0074-802C0100 2BA9B4 008C+00 0/0 1/1 0/0 .text
 * getEnemyID__13Z2SoundObjMgrFPCcP26JSULink<15Z2CreatureEnemy> */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void Z2SoundObjMgr::getEnemyID(char const* param_0, JSULink<Z2CreatureEnemy>* param_1) {
    nofralloc
#include "asm/Z2AudioLib/Z2SoundObjMgr/func_802C0074.s"
}
#pragma pop

/* 802C0100-802C0120 2BAA40 0020+00 1/1 1/1 0/0 .text            setBattleInit__13Z2SoundObjMgrFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void Z2SoundObjMgr::setBattleInit() {
    nofralloc
#include "asm/Z2AudioLib/Z2SoundObjMgr/setBattleInit__13Z2SoundObjMgrFv.s"
}
#pragma pop

/* 802C0120-802C013C 2BAA60 001C+00 0/0 1/1 0/0 .text checkBattleFinish__13Z2SoundObjMgrFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void Z2SoundObjMgr::checkBattleFinish() {
    nofralloc
#include "asm/Z2AudioLib/Z2SoundObjMgr/checkBattleFinish__13Z2SoundObjMgrFv.s"
}
#pragma pop

/* 802C013C-802C0190 2BAA7C 0054+00 0/0 1/1 0/0 .text            deleteEnemyAll__13Z2SoundObjMgrFv
 */
void Z2SoundObjMgr::deleteEnemyAll() {
    JSULink<Z2CreatureEnemy>* link;

    // not moving the link pointer forward looks like a bug, but deleteObject() actually unlinks the
    // enemy from its owning list
    while (link = this->getFirst(), link != NULL) {
        Z2CreatureEnemy* enemy = link->getObject();
        if (enemy == NULL) {
            // setWarningMessage_f((JUTAssertion *)0x1,(ulong)"Z2SoundObjMgr.cpp",(char
            // *)0x16f,(int)&*fill*,
            //                     "[Z2SoundObjMgr::searchEnemy] remain remove enemy\n",in_r8);
        } else {
            enemy->deleteObject();
        }
    }
}

/* 802C0190-802C01E4 2BAAD0 0054+00 0/0 2/2 0/0 .text
 * removeEnemy__13Z2SoundObjMgrFP26JSULink<15Z2CreatureEnemy>   */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void Z2SoundObjMgr::removeEnemy(JSULink<Z2CreatureEnemy>* param_0) {
    nofralloc
#include "asm/Z2AudioLib/Z2SoundObjMgr/func_802C0190.s"
}
#pragma pop

/* 802C01E4-802C01EC 2BAB24 0008+00 0/0 4/4 0/0 .text            isTwilightBattle__13Z2SoundObjMgrFv
 */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm bool Z2SoundObjMgr::isTwilightBattle() {
    nofralloc
#include "asm/Z2AudioLib/Z2SoundObjMgr/isTwilightBattle__13Z2SoundObjMgrFv.s"
}
#pragma pop

/* 802C01EC-802C03C8 2BAB2C 01DC+00 0/0 1/0 0/0 .text            __sinit_Z2SoundObjMgr_cpp */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void __sinit_Z2SoundObjMgr_cpp() {
    nofralloc
#include "asm/Z2AudioLib/Z2SoundObjMgr/__sinit_Z2SoundObjMgr_cpp.s"
}
#pragma pop

#pragma push
#pragma force_active on
REGISTER_CTORS(0x802C01EC, __sinit_Z2SoundObjMgr_cpp);
#pragma pop