src/core1: document code_7090.c and code_CE60.c

This commit is contained in:
mariob92
2024-10-16 21:50:24 +02:00
parent 05fe65d6e8
commit 8a55096c9c
36 changed files with 589 additions and 587 deletions

View File

@@ -24,7 +24,6 @@ u8 func_8025F4A0(ALCSPlayer *, u8);
void func_8025F3F0(ALCSPlayer *, f32, f32);
u16 func_80250474(s32 arg0);
void func_8024AF48(void);
void func_8024FB8C(void);
/* .data */
@@ -603,7 +602,7 @@ u16 func_80250474(s32 arg0){
D_80282110[i].unk10 = -1.0f;
}
osSetIntMask(sp1C);
func_8024AF48();
core1_ce60_func_8024AF48();
if(D_802762C0 == -1){
D_802762C0 = 0xFFFF;
}

View File

@@ -3,69 +3,60 @@
#include "functions.h"
#include "variables.h"
extern void sfxsource_setSampleRate(u8, s32);
extern void func_8030E2C4(u8);
s16 *D_802758E0 = NULL;
typedef struct struct_27_s{
s16 unk0;
u8 pad2[0x12];
}struct27s;
s16 * D_802758E0 = NULL;
void func_80244C78(int arg0);
/* .code */
void func_80244AB0(void){
void core1_7090_alloc(void) {
int i;
if(D_802758E0)
if (D_802758E0)
return;
D_802758E0 = (struct16s *) malloc(10*sizeof(s16));
for(i = 0; i < 10; i++){
D_802758E0 = (s16 *) malloc(10 * sizeof(s16));
for (i = 0; i < 10; i++) {
D_802758E0[i] = 0;
}
}
void func_80244B3C(void){
void core1_7090_release(void) {
int i;
if(!D_802758E0)
if (!D_802758E0)
return;
for(i = 0; i < 10; i++){
if(D_802758E0[i])
func_8030E394((u8)D_802758E0[i]);
for (i = 0; i < 10; i++) {
if (D_802758E0[i])
func_8030E394(D_802758E0[i]);
}
free(D_802758E0);
D_802758E0 = NULL;
}
void func_80244BB0(s32 arg0, s32 arg1, s32 arg2, f32 arg3){
s32 i;
u8 indx;
if(func_8030ED70(lookup_getSfxId(arg1))){
i = sfxsource_createSfxsourceAndReturnIndex();
indx = i;
if(i){
sfxsource_setSfxId(indx, lookup_getSfxId(arg1));
sfxsource_playSfxAtVolume(indx, arg3);
sfxsource_setSampleRate(indx, arg2);
func_8030E2C4(indx);
func_80244C78(arg0);
D_802758E0[arg0] = indx;
void core1_7090_initSfxSource(s32 idx, s32 lookup_idx, s32 sample_rate, f32 volume) {
u8 sfx_source_index;
if (func_8030ED70(lookup_getSfxId(lookup_idx))) {
sfx_source_index = sfxsource_createSfxsourceAndReturnIndex();
if (sfx_source_index) {
sfxsource_setSfxId(sfx_source_index, lookup_getSfxId(lookup_idx));
sfxsource_playSfxAtVolume(sfx_source_index, volume);
sfxsource_setSampleRate(sfx_source_index, sample_rate);
func_8030E2C4(sfx_source_index);
core1_7090_freeSfxSource(idx);
D_802758E0[idx] = sfx_source_index;
}
}
else{
func_8030E6A4(lookup_getSfxId(arg1), arg3, arg2);
else {
func_8030E6A4(lookup_getSfxId(lookup_idx), volume, sample_rate);
}
}
void func_80244C78(int arg0){
if(D_802758E0[arg0]){
func_8030DA44(D_802758E0[arg0]);
void core1_7090_freeSfxSource(int idx) {
if (D_802758E0[idx]) {
func_8030DA44(D_802758E0[idx]);
}
D_802758E0[arg0] = 0;
D_802758E0[idx] = 0;
}

File diff suppressed because it is too large Load Diff