summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2012-09-25 23:03:30 +0200
committerTreeki <treeki@gmail.com>2012-09-25 23:03:30 +0200
commit46b65dfd76411bec6f8356c581f337f8a1944013 (patch)
tree016b4487a80bd6373589006e69b8c6bbbcf9188e /src
parentf4be7c3e4a44a6ec870eb61863a3d294da6f10ae (diff)
downloadkamek-46b65dfd76411bec6f8356c581f337f8a1944013.tar.gz
kamek-46b65dfd76411bec6f8356c581f337f8a1944013.zip
added Remocon and GameMgr definitions, and made map HUD buttons work
Diffstat (limited to 'src')
-rw-r--r--src/koopatlas/hud.cpp18
-rw-r--r--src/koopatlas/hud.h4
-rw-r--r--src/palaceDude.cpp2
-rw-r--r--src/replay.S6
-rw-r--r--src/switchblock.S6
5 files changed, 28 insertions, 8 deletions
diff --git a/src/koopatlas/hud.cpp b/src/koopatlas/hud.cpp
index b7effce..c9124d2 100644
--- a/src/koopatlas/hud.cpp
+++ b/src/koopatlas/hud.cpp
@@ -14,6 +14,7 @@ dWMHud_c *dWMHud_c::build() {
dWMHud_c::dWMHud_c() {
layoutLoaded = false;
+ displayedControllerType = -1;
}
enum WMHudAnimation {
@@ -112,6 +113,8 @@ int dWMHud_c::onExecute() {
playShowHeaderAnim();
}
+ updatePressableButtonThingies();
+
layout.execAnimations();
layout.update();
@@ -278,4 +281,19 @@ void dWMHud_c::setupLives() {
N_IconPosXP_00[playerCount - 1]->SetVisible(true);
}
+void dWMHud_c::updatePressableButtonThingies() {
+ int cntType = RemoconMng->controllers[0]->controllerType;
+
+ if (cntType != displayedControllerType) {
+ displayedControllerType = cntType;
+
+ int beef = (cntType == 0) ? 0 : 1;
+ GameMgrP->currentControllerType = beef;
+
+ WriteBMGToTextBox(
+ layout.findTextBoxByName("ItemsButtonInfo"),
+ GetBMG(), 4, 15, 0);
+ }
+}
+
diff --git a/src/koopatlas/hud.h b/src/koopatlas/hud.h
index 07dde77..e507aea 100644
--- a/src/koopatlas/hud.h
+++ b/src/koopatlas/hud.h
@@ -18,7 +18,6 @@ class dWMHud_c : public dBase_c {
static dWMHud_c *build();
static dWMHud_c *instance;
-
void enteredNode(dKPNode_s *node = 0);
void leftNode();
@@ -32,6 +31,9 @@ class dWMHud_c : public dBase_c {
bool willShowHeader;
dKPNode_s *nodeForHeader;
+ int displayedControllerType;
+ void updatePressableButtonThingies();
+
nw4r::lyt::Pane
*N_IconPosXP_00[4];
diff --git a/src/palaceDude.cpp b/src/palaceDude.cpp
index 6a8d7ff..8eb4a99 100644
--- a/src/palaceDude.cpp
+++ b/src/palaceDude.cpp
@@ -29,7 +29,7 @@ int dPalaceDude_c::onExecute() {
dMsgBoxManager_c::instance->showMessage(settings & 0xFFFFFFF);
SaveBlock *save = GetSaveFile()->GetBlock(-1);
- *((u8*)(((u32)GameMgr)+0x380)) |= (1 << (settings >> 28));
+ GameMgrP->switchPalaceFlag|= (1 << (settings >> 28));
}
}
diff --git a/src/replay.S b/src/replay.S
index 8c3f6c7..89868cf 100644
--- a/src/replay.S
+++ b/src/replay.S
@@ -27,7 +27,7 @@
.extern EGG__Heap__free__FPvPv
.extern GameHeap2
.extern EggControllerClassPtrMaybe
-.extern GameMgr
+.extern GameMgrP
.extern StrangeReplayValue1
.extern StrangeReplayValue2
.extern StrangeReplayValue3
@@ -192,8 +192,8 @@ replayStartLoop:
lwzx r3, r3, r6
stw r3, 0x18(r4)
- lis r3, GameMgr@h
- ori r3, r3, GameMgr@l
+ lis r3, GameMgrP@h
+ ori r3, r3, GameMgrP@l
lwz r3, 0(r3)
lbz r3, 0x380(r3)
stb r3, 0x21(r4)
diff --git a/src/switchblock.S b/src/switchblock.S
index b86d5e2..4df2433 100644
--- a/src/switchblock.S
+++ b/src/switchblock.S
@@ -11,14 +11,14 @@
#endif
.align 4
-.extern GameMgr
+.extern GameMgrP
.extern BG_GM_ptr
.extern _restgpr_27
.global BG_GM_InitRedSwitchFlag_Patch
BG_GM_InitRedSwitchFlag_Patch:
- lis r5, GameMgr@h
- ori r5, r5, GameMgr@l
+ lis r5, GameMgrP@h
+ ori r5, r5, GameMgrP@l
lwz r5, 0(r5)
addis r4, r3, 9