summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2012-10-07 03:23:10 +0200
committerTreeki <treeki@gmail.com>2012-10-07 03:23:10 +0200
commit3de0e0bdf41fc05c15d21dfa67f267b0024ab4f0 (patch)
tree40d08a048fcdb4e82d2f4b490794546c5cceac0b
parent6f20c424220d32dcbbcd66cbf58ac93e9de7054c (diff)
downloadkamek-3de0e0bdf41fc05c15d21dfa67f267b0024ab4f0.tar.gz
kamek-3de0e0bdf41fc05c15d21dfa67f267b0024ab4f0.zip
fixed the multiplayer pauses
Diffstat (limited to '')
-rw-r--r--bugfixes.yaml14
-rwxr-xr-xinclude/game.h2
-rw-r--r--kamek_pal.x5
-rw-r--r--src/randomcrap.S41
4 files changed, 61 insertions, 1 deletions
diff --git a/bugfixes.yaml b/bugfixes.yaml
index ce2efc1..a979a19 100644
--- a/bugfixes.yaml
+++ b/bugfixes.yaml
@@ -3,6 +3,20 @@
# yaml, hasn't it...
source_files: [../src/randomcrap.S, ../src/music.cpp, ../src/fix38.S, ../src/nullsub.S, ../src/newer.cpp]
hooks:
+ - name: MPPauseFix1
+ type: branch_insn
+ branch_type: bl
+ target_func: 'mpPauseFix1'
+ src_addr_pal: 0x801410C4
+ - name: MPPauseFix2
+ type: branch_insn
+ branch_type: bl
+ target_func: 'mpPauseFix2'
+ src_addr_pal: 0x801410DC
+ - name: MPDeathPauseFix
+ type: nop_insn
+ area_pal: 0x8013DA70
+
- name: FixMemoryLeaks
type: patch
addr_pal: 0x800E53E0
diff --git a/include/game.h b/include/game.h
index 1e0c484..95eb4d1 100755
--- a/include/game.h
+++ b/include/game.h
@@ -1986,7 +1986,7 @@ public:
u32 _37C, _380, _384, _388;
u8 stageActorType;
u8 which_player; // _38D
- u8 enableFlag, currentLayerID;
+ u8 disableFlagMask, currentLayerID;
u8 deleteForever;
u8 _391, _392, _padding;
diff --git a/kamek_pal.x b/kamek_pal.x
index fa1273b..9d721ee 100644
--- a/kamek_pal.x
+++ b/kamek_pal.x
@@ -1,6 +1,10 @@
SECTIONS {
/* Scrolling is annoying, clown car goes here! */
+ continueFromMpPauseFix1 = 0x8004E050;
+ continueFromMpPauseFix2 = 0x801415A0;
+ CheckIfSinglePlayer = 0x800FCAD0;
+
TextWriterCrapContinue = 0x800E598C;
StockWMInit_LoadEffects__FPv = 0x80926B10;
@@ -1431,6 +1435,7 @@ SECTIONS {
returnFromFlagObjCheck = 0x807EBC7C;
Global5758 = 0x8042A228;
+ GlobalEnableFlag = 0x80429FDA;
EggControllerClassPtrMaybe = 0x8042A230;
diff --git a/src/randomcrap.S b/src/randomcrap.S
index 0b76ad8..64e98c1 100644
--- a/src/randomcrap.S
+++ b/src/randomcrap.S
@@ -1,4 +1,45 @@
.text
+.global mpPauseFix1
+.global mpPauseFix2
+.extern continueFromMpPauseFix1
+.extern continueFromMpPauseFix2
+
+mpPauseFix1:
+ lis r5, continueFromMpPauseFix1@h
+ ori r5, r5, continueFromMpPauseFix1@l
+ b mpPauseFix
+mpPauseFix2:
+ lis r5, continueFromMpPauseFix2@h
+ ori r5, r5, continueFromMpPauseFix2@l
+ b mpPauseFix
+
+.extern CheckIfSinglePlayer
+
+mpPauseFix:
+ stwu r1, -0x20(r1)
+ mflr r0
+ stw r0, 0x24(r1)
+ stw r31, 0x1C(r1)
+ stw r30, 0x18(r1)
+ mr r31, r3
+ mr r30, r4
+
+ bl CheckIfSinglePlayer
+ cmpwi r3, 1
+ bne DontDoThis
+ mr r3, r31
+ mr r4, r30
+ mtctr r5
+ bctrl
+DontDoThis:
+
+ lwz r30, 0x18(r1)
+ lwz r31, 0x1C(r1)
+ lwz r0, 0x24(r1)
+ mtlr r0
+ addi r1, r1, 0x20
+ blr
+
.global newClimbSounds
.extern StagePtr
newClimbSounds: