From 00fc224f941d47ad2b1b6a65b659c246e0130c6c Mon Sep 17 00:00:00 2001 From: "Carl.Kenner" Date: Wed, 27 May 2009 20:22:22 +0000 Subject: [PATCH] Fix for issue 100. Hold Nunchuk C or Wiimote B button to make calibration easy in WarioWare Twisted. --- source/ngc/gameinput.cpp | 15 ++++++++++----- source/ngc/vbasupport.cpp | 4 +++- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/source/ngc/gameinput.cpp b/source/ngc/gameinput.cpp index 82001cf..925facc 100644 --- a/source/ngc/gameinput.cpp +++ b/source/ngc/gameinput.cpp @@ -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; diff --git a/source/ngc/vbasupport.cpp b/source/ngc/vbasupport.cpp index 7c8ed39..cf6119f 100644 --- a/source/ngc/vbasupport.cpp +++ b/source/ngc/vbasupport.cpp @@ -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()