From 40279dc92768197cca2aec9c7be543ae88dcf0cb Mon Sep 17 00:00:00 2001 From: Mike Grimes Date: Fri, 21 Oct 2022 17:10:16 -0600 Subject: [PATCH] match printf/func_800B452C https://decomp.me/scratch/KVfrT Update src/printf.c Co-authored-by: Fazana <52551480+FazanaJ@users.noreply.github.com> --- asm/non_matchings/printf/func_800B452C.s | 23 ----------------------- src/audio.h | 2 ++ src/particles.h | 3 +++ src/printf.c | 8 +++++++- src/printf.h | 3 +++ 5 files changed, 15 insertions(+), 24 deletions(-) delete mode 100644 asm/non_matchings/printf/func_800B452C.s diff --git a/asm/non_matchings/printf/func_800B452C.s b/asm/non_matchings/printf/func_800B452C.s deleted file mode 100644 index 6996fbef..00000000 --- a/asm/non_matchings/printf/func_800B452C.s +++ /dev/null @@ -1,23 +0,0 @@ -glabel func_800B452C -/* 0B512C 800B452C 8C8E0000 */ lw $t6, ($a0) -/* 0B5130 800B4530 3C08800E */ lui $t0, %hi(gParticlesAssetTable) # $t0, 0x800e -/* 0B5134 800B4534 25C3FFFF */ addiu $v1, $t6, -1 -/* 0B5138 800B4538 04610009 */ bgez $v1, .L800B4560 -/* 0B513C 800B453C AC830000 */ sw $v1, ($a0) -/* 0B5140 800B4540 3C02800E */ lui $v0, %hi(gParticlesAssetTableCount) # $v0, 0x800e -/* 0B5144 800B4544 24422CE8 */ addiu $v0, %lo(gParticlesAssetTableCount) # addiu $v0, $v0, 0x2ce8 -.L800B4548: -/* 0B5148 800B4548 8C580000 */ lw $t8, ($v0) -/* 0B514C 800B454C 00000000 */ nop -/* 0B5150 800B4550 0078C821 */ addu $t9, $v1, $t8 -/* 0B5154 800B4554 AC990000 */ sw $t9, ($a0) -/* 0B5158 800B4558 0720FFFB */ bltz $t9, .L800B4548 -/* 0B515C 800B455C 03201825 */ move $v1, $t9 -.L800B4560: -/* 0B5160 800B4560 8D082CF0 */ lw $t0, %lo(gParticlesAssetTable)($t0) -/* 0B5164 800B4564 00034880 */ sll $t1, $v1, 2 -/* 0B5168 800B4568 01095021 */ addu $t2, $t0, $t1 -/* 0B516C 800B456C 8D420000 */ lw $v0, ($t2) -/* 0B5170 800B4570 03E00008 */ jr $ra -/* 0B5174 800B4574 00000000 */ nop - diff --git a/src/audio.h b/src/audio.h index c6140746..672ff9a8 100644 --- a/src/audio.h +++ b/src/audio.h @@ -130,6 +130,8 @@ void func_800022BC(u8 arg0, ALSeqPlayer *arg1); void func_80002570(ALSeqPlayer *seqp); void func_80002608(u8 arg0); u8 func_80002630(void); +void alSeqFileNew(ALSeqFile *file, u8 *base); +void func_80063A90(ALSeqPlayer *seqp, u8 chan); void play_sound_global(u16 soundID, s32* soundMask); //Non matching. void func_8000232C(ALSeqPlayer *seqp, void *ptr, u8 *arg2, ALCSeq *seq); //Non Matching diff --git a/src/particles.h b/src/particles.h index bcbd36e1..caa8be28 100644 --- a/src/particles.h +++ b/src/particles.h @@ -113,6 +113,9 @@ typedef struct XYStruct { s16 x, y; } XYStruct; +extern unk800E2CF0 **gParticlesAssetTable; +extern s32 gParticlesAssetTableCount; + void func_800AE270(void); void func_800AE2A0(void); void func_800AE2D8(void); diff --git a/src/printf.c b/src/printf.c index c39818df..1b209872 100644 --- a/src/printf.c +++ b/src/printf.c @@ -10,6 +10,7 @@ #include "textures_sprites.h" #include "stdio.h" #include "objects.h" +#include "particles.h" /************ .data ************/ @@ -97,7 +98,12 @@ GLOBAL_ASM("asm/non_matchings/printf/func_800B3740.s") GLOBAL_ASM("asm/non_matchings/printf/func_800B3E64.s") GLOBAL_ASM("asm/non_matchings/printf/func_800B4488.s") GLOBAL_ASM("asm/non_matchings/printf/func_800B44D4.s") -GLOBAL_ASM("asm/non_matchings/printf/func_800B452C.s") + +UNUSED unk800E2CF0 *func_800B452C(s32 *arg0) { + for (*arg0 = *arg0 - 1; *arg0 < 0; *arg0 += gParticlesAssetTableCount); + return gParticlesAssetTable[*arg0]; +} + GLOBAL_ASM("asm/non_matchings/printf/func_800B4578.s") GLOBAL_ASM("asm/non_matchings/printf/func_800B45C4.s") GLOBAL_ASM("asm/non_matchings/printf/func_800B461C.s") diff --git a/src/printf.h b/src/printf.h index 2d1f31b6..3f7a272b 100644 --- a/src/printf.h +++ b/src/printf.h @@ -3,6 +3,8 @@ #include "types.h" #include "structs.h" +#include "particles.h" +#include "macros.h" #include @@ -35,6 +37,7 @@ void func_800B4A08(s32 arg0); +UNUSED unk800E2CF0 *func_800B452C(s32 *arg0); void func_800B5E88(void); void set_render_printf_colour(u8 red, u8 green, u8 blue, u8 alpha); void set_render_printf_background_colour(u8 red, u8 green, u8 blue, u8 alpha);