summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2012-10-14 06:10:34 +0200
committerTreeki <treeki@gmail.com>2012-10-14 06:10:34 +0200
commit0011da4bf4091e7acbd05019b3ab1cc500037f71 (patch)
tree29142e9156bc1da89af64d3741facecf8791e603 /src
parentf5ccbd61fcfd61c1f9c9305800defdf5ae3d6cd1 (diff)
downloadkamek-0011da4bf4091e7acbd05019b3ab1cc500037f71.tar.gz
kamek-0011da4bf4091e7acbd05019b3ab1cc500037f71.zip
failed MP pause fix
Diffstat (limited to 'src')
-rw-r--r--src/randomcrap.S148
1 files changed, 148 insertions, 0 deletions
diff --git a/src/randomcrap.S b/src/randomcrap.S
index e0530c8..0983763 100644
--- a/src/randomcrap.S
+++ b/src/randomcrap.S
@@ -52,8 +52,21 @@ isntWorld1_1:
.global mpPauseFix1
.global mpPauseFix2
+.global mpPauseFix3
.extern continueFromMpPauseFix1
.extern continueFromMpPauseFix2
+.extern continueFromMpPauseFix3
+
+mpPauseFix3:
+ bl CheckIfSinglePlayer
+ cmpwi r3, 1
+ li r0, 30
+ beq isSingle
+ li r0, 1
+isSingle:
+ stb r0, 0x153E(r29)
+ mr r3, r29
+ b continueFromMpPauseFix3
mpPauseFix1:
lis r5, continueFromMpPauseFix1@h
@@ -210,6 +223,141 @@ UniversalFunctionLog:
addi r1, r1, 0x10
blr
+
+#AllocLog:
+# stwu r1, -0x20(r1)
+# mflr r0
+# stw r0, 0x24(r1)
+# stw r31, 0x1C(r1)
+# stw r30, 0x18(r1)
+# stw r29, 0x14(r1)
+# stw r28, 0x10(r1)
+# mr r31, r5
+# mr r30, r4
+# mr r29, r3
+#
+#.extern ArchiveHeap
+# lis r3, ArchiveHeap@h
+# ori r3, r3, ArchiveHeap@l
+# lwz r3, 0(r3)
+# lwz r3, 0x10(r3)
+# cmpw r3, r29
+# bne dontLogMe
+#
+# lis r3, WillAlloc@h
+# ori r3, r3, WillAlloc@l
+# crclr 4*cr1+eq
+# bl OSReport
+#
+# mr r3, r29
+# mr r4, r30
+# mr r5, r31
+# bl RealAlloc
+# mr r28, r3
+#
+# lis r3, Alloced@h
+# ori r3, r3, Alloced@l
+# mr r4, r28
+# crclr 4*cr1+eq
+# bl OSReport
+#
+# mr r3, r28
+#
+# b doneHere
+#dontLogMe:
+# mr r3, r29
+# mr r4, r30
+# mr r5, r31
+# bl RealAlloc
+#doneHere:
+# lwz r28, 0x10(r1)
+# lwz r29, 0x14(r1)
+# lwz r30, 0x18(r1)
+# lwz r31, 0x1C(r1)
+# lwz r0, 0x24(r1)
+# mtlr r0
+# addi r1, r1, 0x20
+# blr
+#
+#FreeLog:
+# stwu r1, -0x20(r1)
+# mflr r0
+# stw r0, 0x24(r1)
+# stw r30, 0x18(r1)
+# stw r29, 0x14(r1)
+# mr r30, r4
+# mr r29, r3
+#
+# lis r3, ArchiveHeap@h
+# ori r3, r3, ArchiveHeap@l
+# lwz r3, 0(r3)
+# lwz r3, 0x10(r3)
+# lwz r5, -0xC(r4)
+# cmpw r3, r29
+# bne dontLogMe2
+# lis r3, WillFree@h
+# ori r3, r3, WillFree@l
+# crclr 4*cr1+eq
+# bl OSReport
+#dontLogMe2:
+#
+# mr r3, r29
+# mr r4, r30
+# bl RealFree
+#
+# lwz r29, 0x14(r1)
+# lwz r30, 0x18(r1)
+# lwz r0, 0x24(r1)
+# mtlr r0
+# addi r1, r1, 0x20
+# blr
+#
+#RealAlloc:
+# stwu r1, -0x20(r1)
+# lis r12, 0x801D
+# ori r12, r12, 0x45A4
+# mtctr r12
+# bctr
+#
+#RealFree:
+# stwu r1, -0x20(r1)
+# lis r12, 0x801D
+# ori r12, r12, 0x4854
+# mtctr r12
+# bctr
+#
+#CRAPPYALLOC:
+# lis r3, 0x801D
+# ori r3, r3, 0x45A0
+# lis r4, AllocLog@h
+# ori r4, r4, AllocLog@l
+# lis r5, 0x4800
+# sub r6, r4, r3
+# clrlwi r6, r6, 6
+# or r5, r5, r6
+# stw r5, 0(r3)
+# dcbst r0, r3
+# sync
+# icbi r0, r3
+# lis r3, 0x801D
+# ori r3, r3, 0x4850
+# lis r4, FreeLog@h
+# ori r4, r4, FreeLog@l
+# lis r5, 0x4800
+# sub r6, r4, r3
+# clrlwi r6, r6, 6
+# or r5, r5, r6
+# stw r5, 0(r3)
+# dcbst r0, r3
+# sync
+# icbi r0, r3
+# blr
+
+#.section .ctors,4
+#.long CRAPPYALLOC
.data
UniLogStr: .string "[ULog] returning %8x to: %x > %x > %x > %x > %x > %x\n"
+#WillAlloc: .string "[AH] Will allocate %x bytes aligned by %x\n"
+#Alloced: .string "[AH] Allocated %p\n"
+#WillFree: .string "[AH] Freeing %p which is %x bytes\n"