summaryrefslogtreecommitdiff
path: root/src/randomcrap.S
diff options
context:
space:
mode:
Diffstat (limited to 'src/randomcrap.S')
-rw-r--r--src/randomcrap.S51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/randomcrap.S b/src/randomcrap.S
index 1653ce7..b4e8f02 100644
--- a/src/randomcrap.S
+++ b/src/randomcrap.S
@@ -1,4 +1,55 @@
.text
+
+.global TitleScreenFucker
+.extern RESTART_CRSIN_LevelStartStruct
+.extern SaveFileInstance
+TitleScreenFucker:
+ lis r3, RESTART_CRSIN_LevelStartStruct@h
+ ori r3, r3, RESTART_CRSIN_LevelStartStruct@l
+ li r4, 0
+ stb r4, 7(r3)
+
+ # now get the FUCKING WORLD and FUCKING LEVEL
+ lis r4, SaveFileInstance@h
+ ori r4, r4, SaveFileInstance@l
+ lwz r4, 0(r4)
+ lbz r5, 0x26(r4)
+ extsb r5, r5
+ mulli r5, r5, 0x980
+ addi r4, r4, 0x6C0
+ add r4, r4, r5
+
+ # do we need to use Quick Save? get the QS block
+ addi r4, r4, 0x1C80
+ lbz r6, 2(r4)
+ clrlwi. r6, r6, 31
+ beq quickSaveExists
+ subi r4, r4, 0x1C80
+quickSaveExists:
+
+ # now we have the save block in r4
+ lbz r6, 2(r4)
+ clrlwi. r6, r6, 31
+ bne saveIsNotNew
+ li r5, 0
+ li r6, 9
+ b chosenTitle
+saveIsNotNew:
+ lbz r5, 0x73A(r4)
+ lbz r6, 0x73B(r4)
+chosenTitle:
+ cmpwi r5, 0
+ bne isntWorld1_1
+ cmpwi r6, 0
+ bne isntWorld1_1
+ li r5, 0
+ li r6, 9
+isntWorld1_1:
+ stb r5, 0xC(r3)
+ stb r6, 0xD(r3)
+ blr
+
+
.global mpPauseFix1
.global mpPauseFix2
.extern continueFromMpPauseFix1