diff --git a/bm64.us.toml b/bm64.us.toml index dd56309..db40866 100644 --- a/bm64.us.toml +++ b/bm64.us.toml @@ -33,6 +33,24 @@ if (ctx->r2 == 0) { } """ +[[patches.hook]] +func = "func_ovl8_1_80044154" +before_vram = 0x800442D8 +text = """ +if (ctx->r25 == 0) { + ctx->r25 = 0xFFFFFFFF80042000; +} +""" + +[[patches.hook]] +func = "func_ovl8_1_80044154" +before_vram = 0x800442EC +text = """ +if (ctx->r9 == 0) { + ctx->r9 = 0xFFFFFFFF80042000; +} +""" + [[patches.hook]] func = "func_ovl8_3_80043E34" before_vram = 0x80043FB0 @@ -42,6 +60,24 @@ if (ctx->r2 == 0) { } """ +[[patches.hook]] +func = "func_ovl8_3_80043E34" +before_vram = 0x80043FB8 +text = """ +if (ctx->r25 == 0) { + ctx->r25 = 0xFFFFFFFF80042000; +} +""" + +[[patches.hook]] +func = "func_ovl8_3_80043E34" +before_vram = 0x80043FCC +text = """ +if (ctx->r9 == 0) { + ctx->r9 = 0xFFFFFFFF80042000; +} +""" + [[patches.hook]] func = "func_ovl8_5_80043E00" before_vram = 0x80043F7C @@ -51,6 +87,51 @@ if (ctx->r2 == 0) { } """ +[[patches.hook]] +func = "func_ovl8_5_80043E00" +before_vram = 0x80043F84 +text = """ +if (ctx->r25 == 0) { + ctx->r25 = 0xFFFFFFFF80042000; +} +""" + +[[patches.hook]] +func = "func_ovl8_5_80043E00" +before_vram = 0x80043F98 +text = """ +if (ctx->r9 == 0) { + ctx->r9 = 0xFFFFFFFF80042000; +} +""" + +[[patches.hook]] +func = "func_ovl8_6_80047E10" +before_vram = 0x80047EAC +text = """ +if (ctx->r2 == 0) { + ctx->r2 = 0xFFFFFFFF80042000; +} +""" + +[[patches.hook]] +func = "func_ovl8_6_80047E10" +before_vram = 0x80047EB4 +text = """ +if (ctx->r14 == 0) { + ctx->r14 = 0xFFFFFFFF80042000; +} +""" + +[[patches.hook]] +func = "func_ovl8_6_80047E10" +before_vram = 0x80047EC8 +text = """ +if (ctx->r15 == 0) { + ctx->r15 = 0xFFFFFFFF80042000; +} +""" + [[patches.hook]] func = "func_ovl6_9_80043018" before_vram = 0x80043030 @@ -96,6 +177,24 @@ if (ctx->r2 == 0) { } """ +[[patches.hook]] +func = "func_802553D4" +before_vram = 0x80258844 +text = """ +if (ctx->r2 == 0) { + ctx->r2 = 0xFFFFFFFF80042000; +} +""" + +[[patches.hook]] +func = "func_802289C0" +before_vram = 0x80228D38 +text = """ +if (ctx->r24 == 0) { + ctx->r24 = 0xFFFFFFFF80042000; +} +""" + # When osAiGetLength returns a number that exceeds the target amount of samples per frame, the calculation (target samples per frame - osAiGetLength()) will result in a negative number. # When the clamping takes place to prevent a number of bytes that is too small, it doesn't take into account the negative number that resulted from the calculation. # Not doing this results in a negative number being given to osAiSetNextBuffer causing a massive memory leak and crash (because a signed negative number is being read as unsigned).