From ce41f3518077c1049e1fadedd4637eddf72315d3 Mon Sep 17 00:00:00 2001 From: ".Coockie" Date: Fri, 30 Jan 2026 12:39:54 +0100 Subject: [PATCH 1/3] fix BF1 fully --- bm64.us.toml | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) diff --git a/bm64.us.toml b/bm64.us.toml index dd56309..d33285c 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 From 8e0a1180076531d4a0033305b7065f95216a34f6 Mon Sep 17 00:00:00 2001 From: ".Coockie" Date: Fri, 30 Jan 2026 14:02:01 +0100 Subject: [PATCH 2/3] fix altair crash --- bm64.us.toml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bm64.us.toml b/bm64.us.toml index d33285c..3cc4e57 100644 --- a/bm64.us.toml +++ b/bm64.us.toml @@ -177,6 +177,15 @@ if (ctx->r2 == 0) { } """ +[[patches.hook]] +func = "func_802553D4" +before_vram = 0x80258844 +text = """ +if (ctx->r2 == 0) { + ctx->r2 = 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). From e417c1355768964296049cf5e6662204ddfa4faf Mon Sep 17 00:00:00 2001 From: ".Coockie" Date: Fri, 30 Jan 2026 14:28:41 +0100 Subject: [PATCH 3/3] fix spellmaker --- bm64.us.toml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bm64.us.toml b/bm64.us.toml index 3cc4e57..db40866 100644 --- a/bm64.us.toml +++ b/bm64.us.toml @@ -186,6 +186,15 @@ if (ctx->r2 == 0) { } """ +[[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).