diff --git a/Common/AllocSceneBuffer.asm b/Common/AllocSceneBuffer.asm index e62745e..2704eee 100644 --- a/Common/AllocSceneBuffer.asm +++ b/Common/AllocSceneBuffer.asm @@ -26,6 +26,13 @@ CODE_START: # On Dolphin a buffer has been allocated from the heap created in Bootloader/main.asm. # We want to free that buffer the first time we execute this logic so that the # buffer always exists prior and after. + +# NOTE: There's some really weird stuff going on here that I don't understand. +# The buffer we're freeing here was actually allocated on a different heap than +# the main heap. By running Free like this we are freeing the memory on the main heap +# despite the fact that it was allocated on a different heap. That said, if I try to free +# it using its original heap ID, it does not fix the GFX issue when eating food. I have +# no idea why free'ing it on a different heap fixes the GFX issues. bl DATA_BLRL mflr r4 lbz r3, 0x0(r4) diff --git a/Common/FreeSceneBuffer.asm b/Common/FreeSceneBuffer.asm deleted file mode 100644 index 41dde42..0000000 --- a/Common/FreeSceneBuffer.asm +++ /dev/null @@ -1,14 +0,0 @@ -################################################################################ -# Address: 0x801a41d8 -################################################################################ - -.include "Common/Common.s" -.include "Online/Online.s" - -# Look at AllocSceneBuffer.asm for context - -lwz r3, OFST_R13_SB_ADDR(r13) -branchl r12, HSD_Free - -# Original -li r3, 11 diff --git a/Output/Console/GALE01r2.ini b/Output/Console/GALE01r2.ini index 3a6fcc7..efb336a 100644 --- a/Output/Console/GALE01r2.ini +++ b/Output/Console/GALE01r2.ini @@ -591,7 +591,12 @@ C21D4FD8 00000012 #Recording/Stages/SendStadiumInfo.asm 818DB650 398C0009 918DB650 BB610084 60000000 00000000 -C21A4CB4 00000008 #Common/AllocBuffer.asm +C21A4CB4 0000000D #Common/AllocSceneBuffer.asm +4800000C 4E800021 +00000000 4BFFFFF9 +7C8802A6 88640000 +2C030000 40820028 +38600001 98640000 806DAFC4 2C030000 41820014 3D808037 618CF1B0 7D8903A6 diff --git a/Output/Console/g_core.bin b/Output/Console/g_core.bin index 307d55d..0a6e1e9 100644 Binary files a/Output/Console/g_core.bin and b/Output/Console/g_core.bin differ diff --git a/Output/Console/g_core_porta.bin b/Output/Console/g_core_porta.bin index f41730b..62d8640 100644 Binary files a/Output/Console/g_core_porta.bin and b/Output/Console/g_core_porta.bin differ diff --git a/Output/InjectionLists/list_console_core.json b/Output/InjectionLists/list_console_core.json index f5a9229..a42c227 100644 --- a/Output/InjectionLists/list_console_core.json +++ b/Output/InjectionLists/list_console_core.json @@ -291,7 +291,7 @@ "InjectionAddress": "801A4CB4", "Name": "Slippi Recording", "Codetype": "Auto", - "Annotation": "Common/AllocBuffer.asm", + "Annotation": "Common/AllocSceneBuffer.asm", "Tags": "" }, { diff --git a/Output/InjectionLists/list_netplay.json b/Output/InjectionLists/list_netplay.json index f39fbf9..2a96214 100644 --- a/Output/InjectionLists/list_netplay.json +++ b/Output/InjectionLists/list_netplay.json @@ -515,7 +515,7 @@ "InjectionAddress": "801A4CB4", "Name": "Required: Slippi Recording", "Codetype": "Auto", - "Annotation": "Common/AllocBuffer.asm", + "Annotation": "Common/AllocSceneBuffer.asm", "Tags": "" }, { diff --git a/Output/Netplay/GALE01r2.ini b/Output/Netplay/GALE01r2.ini index f1120c2..413f327 100644 --- a/Output/Netplay/GALE01r2.ini +++ b/Output/Netplay/GALE01r2.ini @@ -1244,11 +1244,6 @@ C21A4CB4 0000000D #Common/AllocSceneBuffer.asm 7D8903A6 4E800421 906DAFC4 38000000 60000000 00000000 -C21A41D8 00000004 #Common/FreeSceneBuffer.asm -806DAFC4 3D808037 -618CF1B0 7D8903A6 -4E800421 3860000B -60000000 00000000 C20055F8 0000000F #Common/GetIsFollower.asm 7C0802A6 90010004 9421FF20 BE8100B0 diff --git a/Output/Netplay/GALJ01r2.ini b/Output/Netplay/GALJ01r2.ini index 1cc2399..9043bb7 100644 --- a/Output/Netplay/GALJ01r2.ini +++ b/Output/Netplay/GALJ01r2.ini @@ -1243,11 +1243,6 @@ C21A4CB4 0000000D #Common/AllocSceneBuffer.asm 7D8903A6 4E800421 906DAFC4 38000000 60000000 00000000 -C21A41D8 00000004 #Common/FreeSceneBuffer.asm -806DAFC4 3D808037 -618CF1B0 7D8903A6 -4E800421 3860000B -60000000 00000000 C20055F8 0000000F #Common/GetIsFollower.asm 7C0802A6 90010004 9421FF20 BE8100B0 diff --git a/Output/Playback/GALE01r2.ini b/Output/Playback/GALE01r2.ini index a83239a..199747d 100644 --- a/Output/Playback/GALE01r2.ini +++ b/Output/Playback/GALE01r2.ini @@ -862,7 +862,12 @@ C216E8C8 00000005 #Playback/Core/Stadium/Enable Home Run Contest Distance.asm 4182000C 819F0044 4800000C 3D808018 618C1998 00000000 -C21A4CB4 00000008 #Common/AllocBuffer.asm +C21A4CB4 0000000D #Common/AllocSceneBuffer.asm +4800000C 4E800021 +00000000 4BFFFFF9 +7C8802A6 88640000 +2C030000 40820028 +38600001 98640000 806DAFC4 2C030000 41820014 3D808037 618CF1B0 7D8903A6 diff --git a/Output/Playback/GALJ01r2.ini b/Output/Playback/GALJ01r2.ini index 6e3b995..ded76db 100644 --- a/Output/Playback/GALJ01r2.ini +++ b/Output/Playback/GALJ01r2.ini @@ -861,7 +861,12 @@ C216E8C8 00000005 #Playback/Core/Stadium/Enable Home Run Contest Distance.asm 4182000C 819F0044 4800000C 3D808018 618C1998 00000000 -C21A4CB4 00000008 #Common/AllocBuffer.asm +C21A4CB4 0000000D #Common/AllocSceneBuffer.asm +4800000C 4E800021 +00000000 4BFFFFF9 +7C8802A6 88640000 +2C030000 40820028 +38600001 98640000 806DAFC4 2C030000 41820014 3D808037 618CF1B0 7D8903A6