summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2011-07-11 00:43:12 +0200
committerTreeki <treeki@gmail.com>2011-07-11 00:43:12 +0200
commit17d678731d5c549c4dfdecc1991ae0d3df4389b5 (patch)
tree8f8e17269cdc2b6820970351898b692f31b80828 /src
parent64867e6578cca37971fd0cf08344a3e39e654bc2 (diff)
downloadkamek-17d678731d5c549c4dfdecc1991ae0d3df4389b5.tar.gz
kamek-17d678731d5c549c4dfdecc1991ae0d3df4389b5.zip
fixed a bug with the C++ init code
Diffstat (limited to '')
-rw-r--r--src/prolog.S26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/prolog.S b/src/prolog.S
index 1a988ec..d942327 100644
--- a/src/prolog.S
+++ b/src/prolog.S
@@ -3,25 +3,30 @@
.set sp, 1
.extern __ctor_loc
+.extern __ctor_end
.extern OSReport
.global Prolog
Prolog:
- stwu sp, -0x10(sp)
+ stwu sp, -0x20(sp)
mflr r0
- stw r0, 0x14(sp)
- stw r31, 0xC(sp)
- stw r30, 0x8(sp)
+ stw r0, 0x24(sp)
+ stw r31, 0x1C(sp)
+ stw r30, 0x18(sp)
+ stw r29, 0x14(sp)
# -- Go!
li r30, 0
lis r31, __ctor_loc@h
ori r31, r31, __ctor_loc@l
+ lis r29, __ctor_end@h
+ ori r29, r29, __ctor_end@l
lis r3, PMsg@h
ori r3, r3, PMsg@l
mr r4, r31
+ mr r5, r29
crclr 4*cr1+eq
bl OSReport
@@ -34,7 +39,7 @@ loop:
addi r30, r30, 1
startLoop:
lwz r12, 0(r31)
- cmpwi r12, 0
+ cmpw r31, r29
bne loop
lis r3, PMsg2@h
@@ -45,17 +50,18 @@ startLoop:
# -- Done
li r3, 1
- lwz r31, 0xC(sp)
- lwz r30, 0x8(sp)
- lwz r0, 0x14(sp)
+ lwz r31, 0x1C(sp)
+ lwz r30, 0x18(sp)
+ lwz r29, 0x14(sp)
+ lwz r0, 0x24(sp)
mtlr r0
- addi sp, sp, 0x10
+ addi sp, sp, 0x20
blr
.data
PMsg:
- .string "Newer Super Mario Bros. Wii - Hacks by Treeki 2009-2011\n.ctors: %p\n"
+ .string "Newer Super Mario Bros. Wii - Hacks by Treeki 2009-2011\n.ctors: %p - %p\n"
PMsg2:
.string "%d inits called\n"