From 27903c62868653b58e751cffac0a2d1c50985caa Mon Sep 17 00:00:00 2001 From: engineer124 <47598039+engineer124@users.noreply.github.com> Date: Mon, 27 Dec 2021 14:51:37 +1100 Subject: [PATCH] code_80194710 OK (Audio libultra_code_O2) (#474) * code_80194710.c OK * Add new line after variable declaration * format * Function declarations * Name changes to match OoT * Rename file * s32 -> size_t --- include/functions.h | 4 ++-- spec | 2 +- src/code/audio/audio_dcache.c | 15 +++++++++++++++ src/code/audio/code_80194710.c | 5 ----- tools/disasm/files.txt | 2 +- tools/disasm/functions.txt | 4 ++-- tools/sizes/code_functions.csv | 4 ++-- 7 files changed, 23 insertions(+), 13 deletions(-) create mode 100644 src/code/audio/audio_dcache.c delete mode 100644 src/code/audio/code_80194710.c diff --git a/include/functions.h b/include/functions.h index 6502f1f92e..312dfbe577 100644 --- a/include/functions.h +++ b/include/functions.h @@ -3642,8 +3642,8 @@ AudioTask* func_80192BE0(void); // void func_80194568(void); // void func_80194668(void); // void func_801946E4(void); -// void func_80194710(void); -// void func_80194750(void); +void Audio_InvalDCache(void* buf, size_t size); +void Audio_WritebackDCache(void* buf, size_t size); // void func_80194790(void); // void func_80194840(void); // void func_801948B0(void); diff --git a/spec b/spec index 305663172a..f826ad300f 100644 --- a/spec +++ b/spec @@ -639,7 +639,7 @@ beginseg include "build/data/code/audio_load.bss.o" include "build/src/code/audio/code_80192BE0.o" include "build/data/code/code_80192BE0.data.o" - include "build/src/code/audio/code_80194710.o" + include "build/src/code/audio/audio_dcache.o" include "build/src/code/audio/code_80194790.o" include "build/data/code/code_80194790.data.o" include "build/src/code/audio/audio_playback.o" diff --git a/src/code/audio/audio_dcache.c b/src/code/audio/audio_dcache.c new file mode 100644 index 0000000000..27f019fef9 --- /dev/null +++ b/src/code/audio/audio_dcache.c @@ -0,0 +1,15 @@ +#include "global.h" + +void Audio_InvalDCache(void* buf, size_t size) { + OSIntMask prevMask = osSetIntMask(1); + + osInvalDCache(buf, size); + osSetIntMask(prevMask); +} + +void Audio_WritebackDCache(void* buf, size_t size) { + OSIntMask prevMask = osSetIntMask(1); + + osWritebackDCache(buf, size); + osSetIntMask(prevMask); +} diff --git a/src/code/audio/code_80194710.c b/src/code/audio/code_80194710.c deleted file mode 100644 index 090c5735b1..0000000000 --- a/src/code/audio/code_80194710.c +++ /dev/null @@ -1,5 +0,0 @@ -#include "global.h" - -#pragma GLOBAL_ASM("asm/non_matchings/code/code_80194710/func_80194710.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/code_80194710/func_80194750.s") diff --git a/tools/disasm/files.txt b/tools/disasm/files.txt index 199e5ac148..9a5d366773 100644 --- a/tools/disasm/files.txt +++ b/tools/disasm/files.txt @@ -483,7 +483,7 @@ 0x8018B0F0 : "audio_heap", 0x8018EB60 : "audio_load", 0x80192BE0 : "code_80192BE0", - 0x80194710 : "code_80194710", + 0x80194710 : "audio_dcache", 0x80194790 : "code_80194790", 0x80194930 : "audio_playback", 0x80196A00 : "audio_effects", diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index bf36e9da57..6033d4d290 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -3720,8 +3720,8 @@ 0x80194568:("func_80194568",), 0x80194668:("func_80194668",), 0x801946E4:("func_801946E4",), - 0x80194710:("func_80194710",), - 0x80194750:("func_80194750",), + 0x80194710:("Audio_InvalDCache",), + 0x80194750:("Audio_WritebackDCache",), 0x80194790:("func_80194790",), 0x80194804:("func_80194804",), 0x80194840:("func_80194840",), diff --git a/tools/sizes/code_functions.csv b/tools/sizes/code_functions.csv index b14278276d..02830ae3be 100644 --- a/tools/sizes/code_functions.csv +++ b/tools/sizes/code_functions.csv @@ -3238,8 +3238,8 @@ asm/non_matchings/code/code_80192BE0/func_80194548.s,func_80194548,0x80194548,0x asm/non_matchings/code/code_80192BE0/func_80194568.s,func_80194568,0x80194568,0x40 asm/non_matchings/code/code_80192BE0/func_80194668.s,func_80194668,0x80194668,0x1F asm/non_matchings/code/code_80192BE0/func_801946E4.s,func_801946E4,0x801946E4,0xB -asm/non_matchings/code/code_80194710/func_80194710.s,func_80194710,0x80194710,0x10 -asm/non_matchings/code/code_80194710/func_80194750.s,func_80194750,0x80194750,0x10 +asm/non_matchings/code/code_80194710/Audio_InvalDCache.s,Audio_InvalDCache,0x80194710,0x10 +asm/non_matchings/code/code_80194710/Audio_WritebackDCache.s,Audio_WritebackDCache,0x80194750,0x10 asm/non_matchings/code/code_80194710/func_80194790.s,func_80194790,0x80194790,0x1D asm/non_matchings/code/code_80194710/func_80194804.s,func_80194804,0x80194804,0xF asm/non_matchings/code/code_80194710/func_80194840.s,func_80194840,0x80194840,0x1C