poketch sound effect function

This commit is contained in:
Trainer Riley
2024-05-31 18:45:13 -07:00
parent e56149fddc
commit c9b927ac57
25 changed files with 64 additions and 67 deletions

View File

@@ -115,7 +115,7 @@ void PoketchSystem_NotifyAppLoaded(PoketchSystem *poketchSys);
void PoketchSystem_NotifyAppUnloaded(PoketchSystem *poketchSys);
void PoketchSystem_SetSaveFunction(PoketchAppSaveFunction saveFunction, void *saveData);
UnkStruct_ov25_02254560 * ov25_02254418(void);
void ov25_02254424(u32 param0);
void PoketchSystem_PlaySoundEffect(u32 param0);
void ov25_02254444(u32 param0, u32 param1);
BOOL PoketchSystem_IsTouchingDisplay(u32 *x, u32 *y);
BOOL PoketchSystem_TappedDisplay(u32 *x, u32 *y);

View File

@@ -661,17 +661,14 @@ static void PoketchSystem_OnButtonEvent(u32 buttonID, u32 buttonEvent, u32 touch
static BOOL ov25_022543EC (UnkStruct_ov25_02254560 * param0, u32 param1)
{
u32 v0;
for (v0 = 0; v0 < 6; v0++) {
if (ov25_022547F4(param0, param1) == 0) {
return 0;
for (u32 i = 0; i < 6; i++) {
if (ov25_022547F4(param0, param1) == FALSE) {
return FALSE;
}
}
ov25_022547D0(param0, param1);
return 1;
return TRUE;
}
UnkStruct_ov25_02254560 * ov25_02254418 (void)
@@ -680,12 +677,12 @@ UnkStruct_ov25_02254560 * ov25_02254418 (void)
return poketchSys->unk_1C;
}
void ov25_02254424 (u32 param0)
void PoketchSystem_PlaySoundEffect(u32 soundID)
{
PoketchSystem *poketchSys = PoketchSystem_GetFromFieldSystem();
if ((poketchSys->unk_05 == 0) && (ov25_0225450C(poketchSys) == 0)) {
Sound_PlayEffect(param0);
if ((poketchSys->unk_05 == FALSE) && (ov25_0225450C(poketchSys) == FALSE)) {
Sound_PlayEffect(soundID);
}
}

View File

@@ -358,7 +358,7 @@ static void ov27_02256BE8 (SysTask * param0, void * param1)
sub_02019448(v0->unk_04, 6);
ov25_02254424(1641);
PoketchSystem_PlaySoundEffect(1641);
ov27_02256A04(param1);
}
@@ -409,7 +409,7 @@ static void ov27_02256C80 (SysTask * param0, void * param1)
ov25_0225524C(param1);
case 1:
if (ov27_02256E90(v2, 6)) {
ov25_02254424(1641);
PoketchSystem_PlaySoundEffect(1641);
ov27_02256EC4(v1->unk_04, v2->unk_03);
sub_02019448(v1->unk_04, 6);
}
@@ -442,7 +442,7 @@ static void ov27_02256D00 (SysTask * param0, void * param1)
ov25_0225524C(param1);
case 1:
if (ov27_02256E90(v2, 3)) {
ov25_02254424(1641);
PoketchSystem_PlaySoundEffect(1641);
ov27_02256EC4(v1->unk_04, v2->unk_03);
sub_02019448(v1->unk_04, 6);
}
@@ -472,7 +472,7 @@ static void ov27_02256D80 (SysTask * param0, void * param1)
ov25_022558C4(v1->unk_60[8], 15);
ov27_02256EC4(v1->unk_04, 5);
sub_02019448(v1->unk_04, 6);
ov25_02254424(1638);
PoketchSystem_PlaySoundEffect(1638);
ov25_0225524C(param1);
case 1:
if (++(v2->unk_00) > 2) {

View File

@@ -586,7 +586,7 @@ static void ov28_02256B24 (SysTask * param0, void * param1)
v1 = ov25_0225523C(param1);
v2 = v0->unk_00;
ov25_02254424(1635);
PoketchSystem_PlaySoundEffect(1635);
sub_020198C0(v1->unk_04, 6, Unk_ov28_0225797C[v2], Unk_ov28_02257938[v2].unk_00, Unk_ov28_02257938[v2].unk_01, Unk_ov28_02257938[v2].unk_02, Unk_ov28_02257938[v2].unk_03);
sub_02019448(v1->unk_04, 6);

View File

@@ -217,7 +217,7 @@ static void ov29_02256908 (SysTask * param0, void * param1)
ov25_022558C4(v0->unk_68[1], 2);
}
ov25_02254424(1635);
PoketchSystem_PlaySoundEffect(1635);
ov29_022567F0(param1);
}

View File

@@ -478,6 +478,6 @@ static void ov32_02256C54 (SysTask * param0, void * param1)
sub_02019448(v0->unk_04, 6);
ov25_02254424(1641);
PoketchSystem_PlaySoundEffect(1641);
ov32_02256574(param1);
}

View File

@@ -776,7 +776,7 @@ static void ov33_0225718C (UnkStruct_ov33_02256474 * param0, const UnkStruct_ov3
case 0:
VEC_Set(&v0->unk_08, 0, 0, 0);
ov33_02256C98(param0, param2);
ov25_02254424(1641);
PoketchSystem_PlaySoundEffect(1641);
v0->unk_34_val3[0]++;
case 1:
v0->unk_34_val3[1] += 8;

View File

@@ -157,7 +157,7 @@ static BOOL ov34_022562F0 (UnkStruct_ov34_0225621C * param0)
case 0:
if (ov34_022563E4(param0, &v0, &v1)) {
ov34_02256428(param0, v0, v1);
ov25_02254424(1640);
PoketchSystem_PlaySoundEffect(1640);
ov34_02256640(param0->unk_48, 2);
param0->unk_01 = 1;
}
@@ -188,7 +188,7 @@ static BOOL ov34_022562F0 (UnkStruct_ov34_0225621C * param0)
break;
case 3:
if (ov34_02256664(param0->unk_48, 2)) {
ov25_02254424(1640);
PoketchSystem_PlaySoundEffect(1640);
ov34_02256640(param0->unk_48, 2);
param0->unk_01 = 1;
}

View File

@@ -194,7 +194,7 @@ static void ov35_02256644 (SysTask * param0, void * param1)
switch (v0->unk_00->unk_04) {
case 0:
ov25_02254424(1641);
PoketchSystem_PlaySoundEffect(1641);
ov25_022558C4(v0->unk_24, 1);
break;
case 1:

View File

@@ -198,7 +198,7 @@ static void ov36_02256638 (SysTask * param0, void * param1)
switch (v0->unk_00->unk_04) {
case 0:
ov25_02254424(1641);
PoketchSystem_PlaySoundEffect(1641);
ov25_022558C4(v0->unk_24, 1);
break;
case 1:

View File

@@ -172,7 +172,7 @@ static void ov37_02256588 (SysTask * param0, void * param1)
UnkStruct_ov37_022563D4 * v0 = ov25_0225523C(param1);
const UnkStruct_ov37_022563D4_1 * v1 = ov25_02255240(param1);
ov25_02254424(1635);
PoketchSystem_PlaySoundEffect(1635);
if (v1->unk_00) {
ov25_022558C4(v0->unk_24, 0);

View File

@@ -180,10 +180,10 @@ static BOOL ov39_02256324 (UnkStruct_ov39_0225621C * param0)
if (param0->unk_04.unk_04[param0->unk_34]) {
param0->unk_04.unk_1C = param0->unk_34;
ov39_02256418(param0->unk_24, 2);
ov25_02254424(1635);
PoketchSystem_PlaySoundEffect(1635);
param0->unk_01++;
} else {
ov25_02254424(1646);
PoketchSystem_PlaySoundEffect(1646);
}
}
break;

View File

@@ -190,16 +190,16 @@ static BOOL ov41_02256378 (UnkStruct_ov41_02256220 * param0)
param0->unk_04.unk_5B76 = 1;
ov41_0225688C(param0->unk_5B7C, 5);
ov41_0225688C(param0->unk_5B7C, 7);
ov25_02254424(1635);
PoketchSystem_PlaySoundEffect(1635);
param0->unk_01 = 1;
break;
case 1:
ov25_02254424(1646);
PoketchSystem_PlaySoundEffect(1646);
break;
case 2:
param0->unk_04.unk_5B76 = 1;
ov41_0225688C(param0->unk_5B7C, 5);
ov25_02254424(1635);
PoketchSystem_PlaySoundEffect(1635);
param0->unk_01 = 3;
break;
}
@@ -231,7 +231,7 @@ static BOOL ov41_02256378 (UnkStruct_ov41_02256220 * param0)
switch (param0->unk_5B8C) {
case 2:
case 0:
ov25_02254424(1646);
PoketchSystem_PlaySoundEffect(1646);
break;
case 1:
param0->unk_04.unk_5B74 = 1;
@@ -239,7 +239,7 @@ static BOOL ov41_02256378 (UnkStruct_ov41_02256220 * param0)
param0->unk_04.unk_5B76 = 1;
ov41_0225688C(param0->unk_5B7C, 5);
ov41_0225688C(param0->unk_5B7C, 8);
ov25_02254424(1635);
PoketchSystem_PlaySoundEffect(1635);
param0->unk_01 = 2;
break;
}

View File

@@ -418,7 +418,7 @@ static void ov41_02256D1C (SysTask * param0, void * param1)
break;
case 1:
if (ov41_022568B0(v0, 7)) {
ov25_02254424(1642);
PoketchSystem_PlaySoundEffect(1642);
ov41_022568C8(param1);
}
break;

View File

@@ -190,7 +190,7 @@ static void ov42_022565C4 (SysTask * param0, void * param1)
switch (ov25_02255248(param1)) {
case 0:
ov25_02254424(1653);
PoketchSystem_PlaySoundEffect(1653);
ov25_022558C4(v0->unk_24, 0);
v0->unk_3C = 144 << FX32_SHIFT;
v0->unk_40 = Unk_ov42_02256720;
@@ -209,10 +209,10 @@ static void ov42_022565C4 (SysTask * param0, void * param1)
v0->unk_40 = -((v0->unk_40 * 56) / 100);
if (v0->unk_40 < (-2 * FX32_ONE)) {
ov25_02254424(1654);
PoketchSystem_PlaySoundEffect(1654);
v0->unk_3C = 144 << FX32_SHIFT;
} else {
ov25_02254424(1654);
PoketchSystem_PlaySoundEffect(1654);
ov25_022558C4(v0->unk_24, (v1->unk_00) ? 1 : 2);
v0->unk_3C = 144 << FX32_SHIFT;
ov25_0225524C(param1);

View File

@@ -308,7 +308,7 @@ static void ov43_022568B4 (SysTask * param0, void * param1)
v2 = (v1->unk_00 & 1) ? 3 : 1;
ov25_022558C4(v0->unk_34[v1->unk_00], v2);
ov25_02254424(1635);
PoketchSystem_PlaySoundEffect(1635);
ov43_022566EC(param1);
}

View File

@@ -217,7 +217,7 @@ static BOOL ov44_022563D0 (UnkStruct_ov44_0225621C * param0)
ov44_02256744(param0->unk_38, 2);
param0->unk_01 = 2;
} else {
ov25_02254424(1646);
PoketchSystem_PlaySoundEffect(1646);
}
break;
}

View File

@@ -279,7 +279,7 @@ static void ov44_0225686C (SysTask * param0, void * param1)
v0 = ov25_0225523C(param1);
v1 = ov25_02255240(param1);
ov25_02254424(1641);
PoketchSystem_PlaySoundEffect(1641);
ov25_022558C4(v0->unk_24[0], 10);
ov44_02256780(param1);
}
@@ -508,7 +508,7 @@ static BOOL ov44_02256AC8 (UnkStruct_ov44_022565BC * param0, const UnkStruct_ov4
param0->unk_70 = 2;
break;
case -5:
ov25_02254424(param0->unk_6C[(param0->unk_74)++]);
PoketchSystem_PlaySoundEffect(param0->unk_6C[(param0->unk_74)++]);
break;
case -6:
ov25_022558C4(param0->unk_24[2], 6);

View File

@@ -238,7 +238,7 @@ static BOOL ov45_022563C0 (UnkStruct_ov45_022561D4 * param0)
if ((param0->unk_1C == 1) && (param0->unk_18 == 1)) {
param0->unk_1C = 0;
ov25_02254424(1646);
PoketchSystem_PlaySoundEffect(1646);
break;
}
@@ -304,7 +304,7 @@ static BOOL ov45_022564D0 (UnkStruct_ov45_022561D4 * param0)
}
if ((param0->unk_1C == 1) && (param0->unk_18 == 0)) {
ov25_02254424(1646);
PoketchSystem_PlaySoundEffect(1646);
break;
}

View File

@@ -333,7 +333,7 @@ static void ov45_02256A40 (SysTask * param0, void * param1)
UnkStruct_ov45_022566EC * v0 = ov25_0225523C(param1);
const UnkStruct_ov45_022566EC_1 * v1 = ov25_02255240(param1);
ov25_02254424(1635);
PoketchSystem_PlaySoundEffect(1635);
ov25_022558C4(v0->unk_34[0], 3);
ov25_022558C4(v0->unk_34[3], 5);
@@ -354,7 +354,7 @@ static void ov45_02256ABC (SysTask * param0, void * param1)
UnkStruct_ov45_022566EC * v0 = ov25_0225523C(param1);
const UnkStruct_ov45_022566EC_1 * v1 = ov25_02255240(param1);
ov25_02254424(1635);
PoketchSystem_PlaySoundEffect(1635);
ov25_022558C4(v0->unk_34[0], 2);
ov25_022558C4(v0->unk_34[3], 5);
@@ -396,7 +396,7 @@ static void ov45_02256B78 (SysTask * param0, void * param1)
ov25_022558C4(v0->unk_34[4], 4);
ov25_022558C4(v0->unk_34[1], 1);
ov25_022558C4(v0->unk_34[2], 1);
ov25_02254424(1635);
PoketchSystem_PlaySoundEffect(1635);
ov25_02254444(294, 0);
v0->unk_94 = 0;
v0->unk_98 = 0;

View File

@@ -355,10 +355,10 @@ static BOOL ov46_02256518 (UnkStruct_ov46_0225621C * param0)
case 2:
ov46_02256AF0(param0);
ov46_02256D24(param0->unk_08, 5);
ov25_02254424(1635);
PoketchSystem_PlaySoundEffect(1635);
break;
case 0:
ov25_02254424(1635);
PoketchSystem_PlaySoundEffect(1635);
if (ov46_022569CC(param0)) {
ov46_0225623C(param0, 0, 0);
@@ -368,7 +368,7 @@ static BOOL ov46_02256518 (UnkStruct_ov46_0225621C * param0)
}
break;
case 1:
ov25_02254424(1646);
PoketchSystem_PlaySoundEffect(1646);
break;
}
@@ -451,10 +451,10 @@ static BOOL ov46_022566A0 (UnkStruct_ov46_0225621C * param0)
switch (param0->unk_14) {
case 0:
ov25_02254424(1646);
PoketchSystem_PlaySoundEffect(1646);
break;
case 1:
ov25_02254424(1635);
PoketchSystem_PlaySoundEffect(1635);
ov46_0225623C(param0, 1, 0);
ov46_0225623C(param0, 0, 1);
ov46_02256A3C(param0);
@@ -462,7 +462,7 @@ static BOOL ov46_022566A0 (UnkStruct_ov46_0225621C * param0)
ov46_02256460(param0, 3);
break;
case 2:
ov25_02254424(1635);
PoketchSystem_PlaySoundEffect(1635);
ov46_0225623C(param0, 0, 1);
ov46_0225623C(param0, 1, 0);
ov46_02256AF0(param0);
@@ -489,17 +489,17 @@ static BOOL ov46_0225678C (UnkStruct_ov46_0225621C * param0)
switch (param0->unk_14) {
case 0:
ov25_02254424(1635);
PoketchSystem_PlaySoundEffect(1635);
ov46_0225623C(param0, 1, 1);
ov46_0225623C(param0, 0, 0);
ov46_02256A50(param0);
ov46_02256460(param0, 2);
break;
case 1:
ov25_02254424(1646);
PoketchSystem_PlaySoundEffect(1646);
break;
case 2:
ov25_02254424(1635);
PoketchSystem_PlaySoundEffect(1635);
ov46_0225623C(param0, 0, 1);
ov46_0225623C(param0, 1, 0);
ov46_02256AF0(param0);
@@ -526,10 +526,10 @@ static BOOL ov46_02256838 (UnkStruct_ov46_0225621C * param0)
switch (param0->unk_14) {
case 0:
ov25_02254424(1646);
PoketchSystem_PlaySoundEffect(1646);
break;
case 1:
ov25_02254424(1635);
PoketchSystem_PlaySoundEffect(1635);
ov46_0225623C(param0, 0, 1);
ov46_0225623C(param0, 1, 0);
ov46_02256D24(param0->unk_08, 7);
@@ -537,7 +537,7 @@ static BOOL ov46_02256838 (UnkStruct_ov46_0225621C * param0)
param0->unk_01++;
break;
case 2:
ov25_02254424(1635);
PoketchSystem_PlaySoundEffect(1635);
ov46_0225623C(param0, 0, 1);
ov46_0225623C(param0, 1, 0);
ov46_02256D24(param0->unk_08, 7);
@@ -562,17 +562,17 @@ static BOOL ov46_022568E0 (UnkStruct_ov46_0225621C * param0)
switch (param0->unk_14) {
case 0:
ov25_02254424(1635);
PoketchSystem_PlaySoundEffect(1635);
ov46_0225623C(param0, 0, 0);
ov46_0225623C(param0, 1, 1);
ov46_02256D24(param0->unk_08, 6);
ov46_02256460(param0, 4);
break;
case 1:
ov25_02254424(1646);
PoketchSystem_PlaySoundEffect(1646);
break;
case 2:
ov25_02254424(1635);
PoketchSystem_PlaySoundEffect(1635);
ov46_0225623C(param0, 0, 1);
ov46_0225623C(param0, 1, 0);
ov46_02256AF0(param0);

View File

@@ -435,7 +435,7 @@ static void ov46_02256F54 (SysTask * param0, void * param1)
ov25_022558C4(v0->unk_34[1], 0);
}
ov25_02254424(1655);
PoketchSystem_PlaySoundEffect(1655);
v0->unk_A4 = 0;
}
break;

View File

@@ -206,7 +206,7 @@ static void ov48_0225672C (SysTask * param0, void * param1)
G2S_SetBGMosaicSize(v0->unk_154, v0->unk_154);
G2S_SetOBJMosaicSize(v0->unk_154, v0->unk_154);
ov25_02254424(1656);
PoketchSystem_PlaySoundEffect(1656);
ov25_0225524C(param1);
break;
case 1:

View File

@@ -174,7 +174,7 @@ static void ov49_02256594 (SysTask * param0, void * param1)
UnkStruct_ov49_022563D4 * v0 = ov25_0225523C(param1);
const UnkStruct_ov49_022563D4_1 * v1 = ov25_02255240(param1);
ov25_02254424(1635);
PoketchSystem_PlaySoundEffect(1635);
ov25_022546B8(0, 0);
ov25_02255900(v0->unk_24, (56 + (16 * v1->unk_00)) << FX32_SHIFT, (148 << FX32_SHIFT));
ov49_022564D0(param1);

View File

@@ -250,7 +250,7 @@ static void ov52_022568D8 (SysTask * param0, void * param1)
ov25_02255914(v0->unk_34[3], 1);
ov52_02256A7C(v0);
ov25_02254424(1635);
PoketchSystem_PlaySoundEffect(1635);
ov52_022567E0(param1);
}
@@ -265,7 +265,7 @@ static void ov52_0225691C (SysTask * param0, void * param1)
ov25_022558C4(v0->unk_34[1], 1);
ov52_02256B10(v0);
ov25_02254424(1635);
PoketchSystem_PlaySoundEffect(1635);
ov52_022567E0(param1);
}
@@ -279,7 +279,7 @@ static void ov52_02256968 (SysTask * param0, void * param1)
ov25_02255914(v0->unk_34[3], 1);
ov25_022558C4(v0->unk_34[2], 2);
ov52_02256B64(v0);
ov25_02254424(1646);
PoketchSystem_PlaySoundEffect(1646);
ov52_022567E0(param1);
}
@@ -293,7 +293,7 @@ static void ov52_022569B4 (SysTask * param0, void * param1)
ov25_02255914(v0->unk_34[3], 1);
ov25_022558C4(v0->unk_34[2], 2);
ov52_02256BDC(v0);
ov25_02254424(1646);
PoketchSystem_PlaySoundEffect(1646);
ov52_022567E0(param1);
}
@@ -309,7 +309,7 @@ static void ov52_02256A00 (SysTask * param0, void * param1)
ov25_022558C4(v0->unk_34[3], 0);
ov52_02256C64(v0, v1);
ov25_02254424(1635);
PoketchSystem_PlaySoundEffect(1635);
ov52_022567E0(param1);
}