Fix for issue 100. Hold Nunchuk C or Wiimote B button to make calibration easy in WarioWare Twisted.

This commit is contained in:
Carl.Kenner 2009-05-27 20:22:22 +00:00
parent 05b8deb22a
commit 00fc224f94
2 changed files with 13 additions and 6 deletions

View File

@ -30,6 +30,8 @@
#include "gba/bios.h" #include "gba/bios.h"
#include "gba/GBAinline.h" #include "gba/GBAinline.h"
extern bool CalibrateWario;
char DebugStr[50] = ""; char DebugStr[50] = "";
void DebugPrintf(const char *format, ...) { void DebugPrintf(const char *format, ...) {
@ -1131,6 +1133,7 @@ u32 HarryPotter5Input(unsigned short pad) {
return J; return J;
} }
// WarioWare Twisted
u32 TwistedInput(unsigned short pad) { u32 TwistedInput(unsigned short pad) {
// Change this to true if you want to see the screen tilt. // Change this to true if you want to see the screen tilt.
TiltScreen = false; TiltScreen = false;
@ -1161,9 +1164,10 @@ u32 TwistedInput(unsigned short pad) {
// Grab an icon and prevent menu from spinning // Grab an icon and prevent menu from spinning
if (wp->btns_h & WPAD_NUNCHUK_BUTTON_Z) if (wp->btns_h & WPAD_NUNCHUK_BUTTON_Z)
J |= VBA_BUTTON_R; J |= VBA_BUTTON_R;
// Speed // Calibrate
if (wp->btns_h & WPAD_NUNCHUK_BUTTON_C) if (wp->btns_h & WPAD_NUNCHUK_BUTTON_C) {
J |= VBA_SPEED; CalibrateWario = true;
} else CalibrateWario = false;
} else if (wp->exp.type == WPAD_EXP_CLASSIC) { } else if (wp->exp.type == WPAD_EXP_CLASSIC) {
TiltSideways = false; TiltSideways = false;
J |= StandardDPad(pad) | StandardClassic(pad); J |= StandardDPad(pad) | StandardClassic(pad);
@ -1171,8 +1175,9 @@ u32 TwistedInput(unsigned short pad) {
} else { } else {
TiltSideways = true; TiltSideways = true;
J |= StandardSideways(pad); J |= StandardSideways(pad);
if (wp->btns_h & WPAD_BUTTON_B) if (wp->btns_h & WPAD_BUTTON_B) {
J |= VBA_SPEED; CalibrateWario = true;
} else CalibrateWario = false;
} }
#endif #endif
return J; return J;

View File

@ -553,6 +553,7 @@ static int sensorX = 2047;
static int sensorY = 2047; static int sensorY = 2047;
static int sensorWario = 0x6C0; static int sensorWario = 0x6C0;
static u8 sensorDarkness = 0xE8; // total darkness (including daylight on rainy days) static u8 sensorDarkness = 0xE8; // total darkness (including daylight on rainy days)
bool CalibrateWario = false;
int systemGetSensorX() int systemGetSensorX()
{ {
@ -566,7 +567,8 @@ int systemGetSensorY()
int systemGetSensorZ() int systemGetSensorZ()
{ {
return sensorWario; if (CalibrateWario) return 0x6C0;
else return sensorWario;
} }
u8 systemGetSensorDarkness() u8 systemGetSensorDarkness()