summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAECX <maurice.henke@protonmail.com>2020-12-12 05:45:39 +0100
committerAECX <maurice.henke@protonmail.com>2020-12-12 05:45:39 +0100
commitc2d3ace35d2c4dad51f9d5d5bf24f2289ba339f2 (patch)
tree6f6cc9f622227610ddc9871797205679de544bd1
parent7df8b418dc067033329fe2c4ef667b68ac510cac (diff)
Added button combo for console toggleresearch
-rw-r--r--GameCube/include/main.h3
-rw-r--r--GameCube/source/main.cpp12
2 files changed, 15 insertions, 0 deletions
diff --git a/GameCube/include/main.h b/GameCube/include/main.h
index 0531e4b..d447864 100644
--- a/GameCube/include/main.h
+++ b/GameCube/include/main.h
@@ -13,6 +13,9 @@ union typeTransform
namespace mod
{
+ // Console state
+ uint32_t lastInput;
+ bool state = true;
uint8_t delayCounter;
uint8_t hashCounter;
diff --git a/GameCube/source/main.cpp b/GameCube/source/main.cpp
index 0009094..9c8942d 100644
--- a/GameCube/source/main.cpp
+++ b/GameCube/source/main.cpp
@@ -5,6 +5,7 @@
#include <tp/JFWSystem.h>
#include <tp/d_stage.h>
#include <tp/f_ap_game.h>
+#include <tp/m_do_controller_pad.h>
#include <cstdint>
#include <cstdio>
@@ -79,6 +80,15 @@ namespace mod
void run()
{
// Do stuff
+ uint32_t buttonCombo = libtp::tp::m_do_controller_pad::Button_Z | libtp::tp::m_do_controller_pad::Button_R;
+
+ if ( lastInput != libtp::tp::m_do_controller_pad::cpadInfo.buttonInput &&
+ buttonCombo == ( libtp::tp::m_do_controller_pad::cpadInfo.buttonInput & buttonCombo ) )
+ {
+ state = !state;
+ libtp::display::setConsole( state, 0 );
+ }
+
if ( hashCounter > 0 && delayCounter == 0xFF )
{
// Assume the load has ended and reset
@@ -86,6 +96,8 @@ namespace mod
}
delayCounter++;
+
+ lastInput = libtp::tp::m_do_controller_pad::cpadInfo.buttonInput;
// Call original game function
return fapGm_Execute_return();
}