mirror of
https://github.com/dborth/vbagx.git
synced 2024-12-26 18:51:49 +01:00
Fix for issue 100. Hold Nunchuk C or Wiimote B button to make calibration easy in WarioWare Twisted.
This commit is contained in:
parent
05b8deb22a
commit
00fc224f94
@ -30,6 +30,8 @@
|
||||
#include "gba/bios.h"
|
||||
#include "gba/GBAinline.h"
|
||||
|
||||
extern bool CalibrateWario;
|
||||
|
||||
char DebugStr[50] = "";
|
||||
|
||||
void DebugPrintf(const char *format, ...) {
|
||||
@ -1131,6 +1133,7 @@ u32 HarryPotter5Input(unsigned short pad) {
|
||||
return J;
|
||||
}
|
||||
|
||||
// WarioWare Twisted
|
||||
u32 TwistedInput(unsigned short pad) {
|
||||
// Change this to true if you want to see the screen tilt.
|
||||
TiltScreen = false;
|
||||
@ -1161,9 +1164,10 @@ u32 TwistedInput(unsigned short pad) {
|
||||
// Grab an icon and prevent menu from spinning
|
||||
if (wp->btns_h & WPAD_NUNCHUK_BUTTON_Z)
|
||||
J |= VBA_BUTTON_R;
|
||||
// Speed
|
||||
if (wp->btns_h & WPAD_NUNCHUK_BUTTON_C)
|
||||
J |= VBA_SPEED;
|
||||
// Calibrate
|
||||
if (wp->btns_h & WPAD_NUNCHUK_BUTTON_C) {
|
||||
CalibrateWario = true;
|
||||
} else CalibrateWario = false;
|
||||
} else if (wp->exp.type == WPAD_EXP_CLASSIC) {
|
||||
TiltSideways = false;
|
||||
J |= StandardDPad(pad) | StandardClassic(pad);
|
||||
@ -1171,8 +1175,9 @@ u32 TwistedInput(unsigned short pad) {
|
||||
} else {
|
||||
TiltSideways = true;
|
||||
J |= StandardSideways(pad);
|
||||
if (wp->btns_h & WPAD_BUTTON_B)
|
||||
J |= VBA_SPEED;
|
||||
if (wp->btns_h & WPAD_BUTTON_B) {
|
||||
CalibrateWario = true;
|
||||
} else CalibrateWario = false;
|
||||
}
|
||||
#endif
|
||||
return J;
|
||||
|
@ -553,6 +553,7 @@ static int sensorX = 2047;
|
||||
static int sensorY = 2047;
|
||||
static int sensorWario = 0x6C0;
|
||||
static u8 sensorDarkness = 0xE8; // total darkness (including daylight on rainy days)
|
||||
bool CalibrateWario = false;
|
||||
|
||||
int systemGetSensorX()
|
||||
{
|
||||
@ -566,7 +567,8 @@ int systemGetSensorY()
|
||||
|
||||
int systemGetSensorZ()
|
||||
{
|
||||
return sensorWario;
|
||||
if (CalibrateWario) return 0x6C0;
|
||||
else return sensorWario;
|
||||
}
|
||||
|
||||
u8 systemGetSensorDarkness()
|
||||
|
Loading…
Reference in New Issue
Block a user