Hooked up Magical Truck Adventure controls

This commit is contained in:
Bart Trzynadlowski 2016-04-13 03:28:04 +00:00
parent d2563c035f
commit 9a2bb78add
6 changed files with 264 additions and 233 deletions

View file

@ -1059,7 +1059,7 @@ const struct GameInfo g_Model3GameList[] =
true, // 16 MB of banked CROM (Mirror) true, // 16 MB of banked CROM (Mirror)
0x4000000, // 64 MB of VROM 0x4000000, // 64 MB of VROM
0x1000000, // 16 MB of sample ROMs 0x1000000, // 16 MB of sample ROMs
GAME_INPUT_COMMON|GAME_INPUT_VEHICLE, GAME_INPUT_COMMON|GAME_INPUT_MAGTRUCK,
0, // no MPEG board 0, // no MPEG board
false, // no drive board false, // no drive board
0x29266e45, // securiry board encryption key 0x29266e45, // securiry board encryption key

View file

@ -37,27 +37,28 @@
******************************************************************************/ ******************************************************************************/
// Input flags // Input flags
#define GAME_INPUT_COMMON 0x00001 // game has common controls #define GAME_INPUT_COMMON 0x000000001 // game has common controls
#define GAME_INPUT_VEHICLE 0x00002 // game has vehicle controls #define GAME_INPUT_VEHICLE 0x000000002 // game has vehicle controls
#define GAME_INPUT_JOYSTICK1 0x00004 // game has joystick 1 #define GAME_INPUT_JOYSTICK1 0x000000004 // game has joystick 1
#define GAME_INPUT_JOYSTICK2 0x00008 // game has joystick 2 #define GAME_INPUT_JOYSTICK2 0x000000008 // game has joystick 2
#define GAME_INPUT_FIGHTING 0x00010 // game has fighting game controls #define GAME_INPUT_FIGHTING 0x000000010 // game has fighting game controls
#define GAME_INPUT_VR4 0x00020 // game has four VR view buttons #define GAME_INPUT_VR4 0x000000020 // game has four VR view buttons
#define GAME_INPUT_VIEWCHANGE 0x00040 // game has single view change button #define GAME_INPUT_VIEWCHANGE 0x000000040 // game has single view change button
#define GAME_INPUT_SHIFT4 0x00080 // game has 4-speed shifter #define GAME_INPUT_SHIFT4 0x000000080 // game has 4-speed shifter
#define GAME_INPUT_SHIFTUPDOWN 0x00100 // game has up/down shifter #define GAME_INPUT_SHIFTUPDOWN 0x000000100 // game has up/down shifter
#define GAME_INPUT_HANDBRAKE 0x00200 // game has handbrake #define GAME_INPUT_HANDBRAKE 0x000000200 // game has handbrake
#define GAME_INPUT_HARLEY 0x00400 // game has Harley Davidson controls #define GAME_INPUT_HARLEY 0x000000400 // game has Harley Davidson controls
#define GAME_INPUT_GUN1 0x00800 // game has light gun 1 #define GAME_INPUT_GUN1 0x000000800 // game has light gun 1
#define GAME_INPUT_GUN2 0x01000 // game has light gun 2 #define GAME_INPUT_GUN2 0x000001000 // game has light gun 2
#define GAME_INPUT_ANALOG_JOYSTICK 0x02000 // game has analog joystick #define GAME_INPUT_ANALOG_JOYSTICK 0x000002000 // game has analog joystick
#define GAME_INPUT_TWIN_JOYSTICKS 0x04000 // game has twin joysticks #define GAME_INPUT_TWIN_JOYSTICKS 0x000004000 // game has twin joysticks
#define GAME_INPUT_SOCCER 0x08000 // game has soccer controls #define GAME_INPUT_SOCCER 0x000008000 // game has soccer controls
#define GAME_INPUT_SPIKEOUT 0x10000 // game has Spikeout buttons #define GAME_INPUT_SPIKEOUT 0x000010000 // game has Spikeout buttons
#define GAME_INPUT_ANALOG_GUN1 0x20000 // game has analog gun 1 #define GAME_INPUT_ANALOG_GUN1 0x000020000 // game has analog gun 1
#define GAME_INPUT_ANALOG_GUN2 0x40000 // game has analog gun 2 #define GAME_INPUT_ANALOG_GUN2 0x000040000 // game has analog gun 2
#define GAME_INPUT_SKI 0x80000 // game has ski controls #define GAME_INPUT_SKI 0x000080000 // game has ski controls
#define GAME_INPUT_ALL 0xFFFFF #define GAME_INPUT_MAGTRUCK 0x000100000 // game has magical truck controls
#define GAME_INPUT_ALL 0x0001FFFFF
/****************************************************************************** /******************************************************************************
@ -78,11 +79,11 @@ struct GameInfo
const char *mfgName; // name of manufacturer const char *mfgName; // name of manufacturer
unsigned year; // year released (in decimal) unsigned year; // year released (in decimal)
int step; // Model 3 hardware stepping: 0x10 = 1.0, 0x15 = 1.5, 0x20 = 2.0, 0x21 = 2.1 int step; // Model 3 hardware stepping: 0x10 = 1.0, 0x15 = 1.5, 0x20 = 2.0, 0x21 = 2.1
unsigned cromSize; // size of fixed CROM (up to 8 MB) uint32_t cromSize; // size of fixed CROM (up to 8 MB)
bool mirrorLow64MB; // mirror low 64 MB of banked CROM space to upper 64 MB bool mirrorLow64MB; // mirror low 64 MB of banked CROM space to upper 64 MB
unsigned vromSize; // size of video ROMs (32 or 64 MB; if 32 MB, will have to be mirrored) uint32_t vromSize; // size of video ROMs (32 or 64 MB; if 32 MB, will have to be mirrored)
unsigned sampleSize; // size of sample ROMS (8 or 16 MB; if 8 MB, will have to be mirrored) uint32_t sampleSize; // size of sample ROMS (8 or 16 MB; if 8 MB, will have to be mirrored)
unsigned inputFlags; // game input types uint32_t inputFlags; // game input types
int mpegBoard; // MPEG music board type: 0 = none, 1 = DSB1 (Z80), 2 = DSB2 (68K). int mpegBoard; // MPEG music board type: 0 = none, 1 = DSB1 (Z80), 2 = DSB2 (68K).
bool driveBoard; // drive board (supported if true) bool driveBoard; // drive board (supported if true)
uint32_t encryptionKey; // security board encryption device key (or 0 if not applicable) uint32_t encryptionKey; // security board encryption device key (or 0 if not applicable)

View file

@ -104,6 +104,7 @@ const char* CInput::GetInputGroup()
case GAME_INPUT_ANALOG_GUN1: // Fall through to below case GAME_INPUT_ANALOG_GUN1: // Fall through to below
case GAME_INPUT_ANALOG_GUN2: return "Analog Guns"; case GAME_INPUT_ANALOG_GUN2: return "Analog Guns";
case GAME_INPUT_SKI: return "Ski Controls"; case GAME_INPUT_SKI: return "Ski Controls";
case GAME_INPUT_MAGTRUCK: return "Magical Truck Controls";
default: return "Misc"; default: return "Misc";
} }
} }

View file

@ -237,6 +237,17 @@ CInputs::CInputs(CInputSystem *system) : m_system(system)
skiSelect1 = AddSwitchInput("SkiSelect1", "Ski Champ Select 1", GAME_INPUT_SKI, "NONE"); skiSelect1 = AddSwitchInput("SkiSelect1", "Ski Champ Select 1", GAME_INPUT_SKI, "NONE");
skiSelect2 = AddSwitchInput("SkiSelect2", "Ski Champ Select 2", GAME_INPUT_SKI, "NONE"); skiSelect2 = AddSwitchInput("SkiSelect2", "Ski Champ Select 2", GAME_INPUT_SKI, "NONE");
skiSelect3 = AddSwitchInput("SkiSelect3", "Ski Champ Select 3", GAME_INPUT_SKI, "NONE"); skiSelect3 = AddSwitchInput("SkiSelect3", "Ski Champ Select 3", GAME_INPUT_SKI, "NONE");
// Magical truck controls
CAnalogInput *magicalLeverUp1 = AddAnalogInput("MagicalLeverUp1", "P1 Magical Lever Up", GAME_INPUT_MAGTRUCK, "NONE");
CAnalogInput *magicalLeverDown1 = AddAnalogInput("MagicalLeverDown1", "P1 Magical Lever Down", GAME_INPUT_MAGTRUCK, "NONE");
CAnalogInput *magicalLeverUp2 = AddAnalogInput("MagicalLeverUp2", "P2 Magical Lever Up", GAME_INPUT_MAGTRUCK, "NONE");
CAnalogInput *magicalLeverDown2 = AddAnalogInput("MagicalLeverDown2", "P2 Magical Lever Down", GAME_INPUT_MAGTRUCK, "NONE");
magicalLever1 = AddAxisInput( "MagicalLever1", "P1 Magical Lever Full Analog", GAME_INPUT_MAGTRUCK, "NONE", magicalLeverUp1, magicalLeverDown1, 0xFF, 0x80, 0);
magicalLever2 = AddAxisInput( "MagicalLever2", "P2 Magical Lever Full Analog", GAME_INPUT_MAGTRUCK, "NONE", magicalLeverUp2, magicalLeverDown2, 0xFF, 0x80, 0);
magicalPedal1 = AddSwitchInput( "MagicalPedal1", "P1 Magical Pedal", GAME_INPUT_MAGTRUCK, "NONE");
magicalPedal2 = AddSwitchInput( "MagicalPedal2", "P2 Magical Pedal", GAME_INPUT_MAGTRUCK, "NONE");
} }
CInputs::~CInputs() CInputs::~CInputs()

View file

@ -49,249 +49,255 @@ struct GameInfo;
class CInputs class CInputs
{ {
private: private:
// Assigned input system // Assigned input system
CInputSystem *m_system; CInputSystem *m_system;
// Vector of all created inputs // Vector of all created inputs
vector<CInput*> m_inputs; vector<CInput*> m_inputs;
/* /*
* Adds a switch input (eg button) to this collection. * Adds a switch input (eg button) to this collection.
*/ */
CSwitchInput *AddSwitchInput(const char *id, const char *label, unsigned gameFlags, const char *defaultMapping, CSwitchInput *AddSwitchInput(const char *id, const char *label, unsigned gameFlags, const char *defaultMapping,
UINT16 offVal = 0x00, UINT16 onVal = 0x01); UINT16 offVal = 0x00, UINT16 onVal = 0x01);
/* /*
* Adds an analog input (eg pedal) to this collection. * Adds an analog input (eg pedal) to this collection.
*/ */
CAnalogInput *AddAnalogInput(const char *id, const char *label, unsigned gameFlags, const char *defaultMapping, CAnalogInput *AddAnalogInput(const char *id, const char *label, unsigned gameFlags, const char *defaultMapping,
UINT16 minVal = 0x00, UINT16 maxVal = 0xFF); UINT16 minVal = 0x00, UINT16 maxVal = 0xFF);
/* /*
* Adds an axis input (eg jostick axis, light gun axis or steering wheel) to this collection. * Adds an axis input (eg jostick axis, light gun axis or steering wheel) to this collection.
*/ */
CAxisInput *AddAxisInput(const char *id, const char *label, unsigned gameFlags, const char *defaultMapping, CAxisInput *AddAxisInput(const char *id, const char *label, unsigned gameFlags, const char *defaultMapping,
CAnalogInput *axisNeg, CAnalogInput *axisPos, UINT16 minVal = 0x00, UINT16 offVal = 0x80, UINT16 maxVal = 0xFF); CAnalogInput *axisNeg, CAnalogInput *axisPos, UINT16 minVal = 0x00, UINT16 offVal = 0x80, UINT16 maxVal = 0xFF);
/* /*
* Adds a 4-gear shifter input to this collection. * Adds a 4-gear shifter input to this collection.
*/ */
CGearShift4Input *AddGearShift4Input(const char *id, const char *label, unsigned gameFlags, CGearShift4Input *AddGearShift4Input(const char *id, const char *label, unsigned gameFlags,
CSwitchInput *shift1, CSwitchInput *shift2, CSwitchInput *shift3, CSwitchInput *shift4, CSwitchInput *shiftN, CSwitchInput *shiftUp, CSwitchInput *shiftDown); CSwitchInput *shift1, CSwitchInput *shift2, CSwitchInput *shift3, CSwitchInput *shift4, CSwitchInput *shiftN, CSwitchInput *shiftUp, CSwitchInput *shiftDown);
/* /*
* Adds a lightgun trigger input to this collection. * Adds a lightgun trigger input to this collection.
*/ */
CTriggerInput *AddTriggerInput(const char *id, const char *label, unsigned gameFlags, CTriggerInput *AddTriggerInput(const char *id, const char *label, unsigned gameFlags,
CSwitchInput *trigger, CSwitchInput *offscreen, UINT16 offVal = 0x00, UINT16 onVal = 0x01); CSwitchInput *trigger, CSwitchInput *offscreen, UINT16 offVal = 0x00, UINT16 onVal = 0x01);
void PrintHeader(const char *fmt, ...); void PrintHeader(const char *fmt, ...);
void PrintConfigureInputsHelp(); void PrintConfigureInputsHelp();
public: public:
// UI controls // UI controls
CSwitchInput *uiExit; CSwitchInput *uiExit;
CSwitchInput *uiReset; CSwitchInput *uiReset;
CSwitchInput *uiPause; CSwitchInput *uiPause;
CSwitchInput *uiFullScreen; CSwitchInput *uiFullScreen;
CSwitchInput *uiSaveState; CSwitchInput *uiSaveState;
CSwitchInput *uiChangeSlot; CSwitchInput *uiChangeSlot;
CSwitchInput *uiLoadState; CSwitchInput *uiLoadState;
CSwitchInput *uiMusicVolUp; CSwitchInput *uiMusicVolUp;
CSwitchInput *uiMusicVolDown; CSwitchInput *uiMusicVolDown;
CSwitchInput *uiSoundVolUp; CSwitchInput *uiSoundVolUp;
CSwitchInput *uiSoundVolDown; CSwitchInput *uiSoundVolDown;
CSwitchInput *uiClearNVRAM; CSwitchInput *uiClearNVRAM;
CSwitchInput *uiSelectCrosshairs; CSwitchInput *uiSelectCrosshairs;
CSwitchInput *uiToggleFrLimit; CSwitchInput *uiToggleFrLimit;
CSwitchInput *uiDumpInpState; CSwitchInput *uiDumpInpState;
CSwitchInput *uiDumpTimings; CSwitchInput *uiDumpTimings;
#ifdef SUPERMODEL_DEBUGGER #ifdef SUPERMODEL_DEBUGGER
CSwitchInput *uiEnterDebugger; CSwitchInput *uiEnterDebugger;
#endif #endif
// Common controls between all games // Common controls between all games
CSwitchInput *coin[2]; CSwitchInput *coin[2];
CSwitchInput *start[2]; CSwitchInput *start[2];
CSwitchInput *test[2]; CSwitchInput *test[2];
CSwitchInput *service[2]; CSwitchInput *service[2];
// Joysticks (players 1 and 2) // Joysticks (players 1 and 2)
CSwitchInput *up[2]; CSwitchInput *up[2];
CSwitchInput *down[2]; CSwitchInput *down[2];
CSwitchInput *left[2]; CSwitchInput *left[2];
CSwitchInput *right[2]; CSwitchInput *right[2];
// Fighting game controls (players 1 and 2) // Fighting game controls (players 1 and 2)
CSwitchInput *punch[2]; CSwitchInput *punch[2];
CSwitchInput *kick[2]; CSwitchInput *kick[2];
CSwitchInput *guard[2]; CSwitchInput *guard[2];
CSwitchInput *escape[2]; CSwitchInput *escape[2];
// Spikeout controls // Spikeout controls
CSwitchInput *shift; CSwitchInput *shift;
CSwitchInput *beat; CSwitchInput *beat;
CSwitchInput *charge; CSwitchInput *charge;
CSwitchInput *jump; CSwitchInput *jump;
// Soccer game controls (players 1 and 2) // Soccer game controls (players 1 and 2)
CSwitchInput *shortPass[2]; CSwitchInput *shortPass[2];
CSwitchInput *longPass[2]; CSwitchInput *longPass[2];
CSwitchInput *shoot[2]; CSwitchInput *shoot[2];
// Vehicle controls // Vehicle controls
CAxisInput *steering; CAxisInput *steering;
CAnalogInput *accelerator; CAnalogInput *accelerator;
CAnalogInput *brake; CAnalogInput *brake;
// VR view buttons: VR1 Red, VR2 Blue, VR3 Yellow, VR4 Green // VR view buttons: VR1 Red, VR2 Blue, VR3 Yellow, VR4 Green
CSwitchInput *vr[4]; CSwitchInput *vr[4];
// Up/down gear shift // Up/down gear shift
CSwitchInput *gearShiftUp; CSwitchInput *gearShiftUp;
CSwitchInput *gearShiftDown; CSwitchInput *gearShiftDown;
// 4-speed gear shift // 4-speed gear shift
CGearShift4Input *gearShift4; CGearShift4Input *gearShift4;
// Rally controls // Rally controls
CSwitchInput *viewChange; CSwitchInput *viewChange;
CSwitchInput *handBrake; CSwitchInput *handBrake;
// Harley Davidson controls // Harley Davidson controls
CAnalogInput *rearBrake; CAnalogInput *rearBrake;
CSwitchInput *musicSelect; CSwitchInput *musicSelect;
// Twin joysticks (individually mapped version; 1 = left stick, 2 = right stick) // Twin joysticks (individually mapped version; 1 = left stick, 2 = right stick)
CSwitchInput *twinJoyLeft1; CSwitchInput *twinJoyLeft1;
CSwitchInput *twinJoyLeft2; CSwitchInput *twinJoyLeft2;
CSwitchInput *twinJoyRight1; CSwitchInput *twinJoyRight1;
CSwitchInput *twinJoyRight2; CSwitchInput *twinJoyRight2;
CSwitchInput *twinJoyUp1; CSwitchInput *twinJoyUp1;
CSwitchInput *twinJoyUp2; CSwitchInput *twinJoyUp2;
CSwitchInput *twinJoyDown1; CSwitchInput *twinJoyDown1;
CSwitchInput *twinJoyDown2; CSwitchInput *twinJoyDown2;
CSwitchInput *twinJoyShot1; CSwitchInput *twinJoyShot1;
CSwitchInput *twinJoyShot2; CSwitchInput *twinJoyShot2;
CSwitchInput *twinJoyTurbo1; CSwitchInput *twinJoyTurbo1;
CSwitchInput *twinJoyTurbo2; CSwitchInput *twinJoyTurbo2;
// Twin joysticks (macro mapping, for users w/out dual joysticks) // Twin joysticks (macro mapping, for users w/out dual joysticks)
CSwitchInput *twinJoyTurnLeft; CSwitchInput *twinJoyTurnLeft;
CSwitchInput *twinJoyTurnRight; CSwitchInput *twinJoyTurnRight;
CSwitchInput *twinJoyStrafeLeft; CSwitchInput *twinJoyStrafeLeft;
CSwitchInput *twinJoyStrafeRight; CSwitchInput *twinJoyStrafeRight;
CSwitchInput *twinJoyForward; CSwitchInput *twinJoyForward;
CSwitchInput *twinJoyReverse; CSwitchInput *twinJoyReverse;
CSwitchInput *twinJoyJump; CSwitchInput *twinJoyJump;
CSwitchInput *twinJoyCrouch; CSwitchInput *twinJoyCrouch;
// Analog joystick // Analog joystick
CAxisInput *analogJoyX; CAxisInput *analogJoyX;
CAxisInput *analogJoyY; CAxisInput *analogJoyY;
CSwitchInput *analogJoyTrigger1; CSwitchInput *analogJoyTrigger1;
CSwitchInput *analogJoyTrigger2; CSwitchInput *analogJoyTrigger2;
CSwitchInput *analogJoyEvent1; CSwitchInput *analogJoyEvent1;
CSwitchInput *analogJoyEvent2; CSwitchInput *analogJoyEvent2;
// Light gun controls (players 1 and 2) // Light gun controls (players 1 and 2)
CAxisInput *gunX[2]; CAxisInput *gunX[2];
CAxisInput *gunY[2]; CAxisInput *gunY[2];
CTriggerInput *trigger[2]; CTriggerInput *trigger[2];
// Analog gun controls (players 1 and 2) // Analog gun controls (players 1 and 2)
CAxisInput *analogGunX[2]; CAxisInput *analogGunX[2];
CAxisInput *analogGunY[2]; CAxisInput *analogGunY[2];
CSwitchInput *analogTriggerLeft[2]; CSwitchInput *analogTriggerLeft[2];
CSwitchInput *analogTriggerRight[2]; CSwitchInput *analogTriggerRight[2];
// Ski Champ controls // Ski Champ controls
CAxisInput *skiX; CAxisInput *skiX;
CAxisInput *skiY; CAxisInput *skiY;
CSwitchInput *skiPollLeft; CSwitchInput *skiPollLeft;
CSwitchInput *skiPollRight; CSwitchInput *skiPollRight;
CSwitchInput *skiSelect1; CSwitchInput *skiSelect1;
CSwitchInput *skiSelect2; CSwitchInput *skiSelect2;
CSwitchInput *skiSelect3; CSwitchInput *skiSelect3;
/*
* Creates a set of inputs with the given input system.
*/
CInputs(CInputSystem *system);
/*
* CInputs destructor.
*/
~CInputs();
/* // Magical Truck Adventure controls
* Returns the number of available inputs. CAxisInput *magicalLever1;
*/ CAxisInput *magicalLever2;
unsigned Count(); CSwitchInput *magicalPedal1;
CSwitchInput *magicalPedal2;
/*
* Creates a set of inputs with the given input system.
*/
CInputs(CInputSystem *system);
/*
* CInputs destructor.
*/
~CInputs();
/* /*
* Returns the input with the given index. * Returns the number of available inputs.
*/ */
CInput *operator[](const unsigned index); unsigned Count();
/* /*
* Returns the input with the given id or label. * Returns the input with the given index.
*/ */
CInput *operator[](const char *idOrLabel); CInput *operator[](const unsigned index);
/* /*
* Returns the assigned input system. * Returns the input with the given id or label.
*/ */
CInputSystem *GetInputSystem(); CInput *operator[](const char *idOrLabel);
/* /*
* Initializes the inputs. Must be called before any other methods are used. * Returns the assigned input system.
*/ */
bool Initialize(); CInputSystem *GetInputSystem();
/* /*
* Reads the input mapping assignments from the given INI file. * Initializes the inputs. Must be called before any other methods are used.
*/ */
void ReadFromINIFile(CINIFile *ini, const char *section); bool Initialize();
/* /*
* Writes the current input mapping assignments to the given INI file. * Reads the input mapping assignments from the given INI file.
*/ */
void WriteToINIFile(CINIFile *ini, const char *section); void ReadFromINIFile(CINIFile *ini, const char *section);
/* /*
* Configures the current input mapping assignments for the given game, or all inputs if game is NULL, by asking the user for input. * Writes the current input mapping assignments to the given INI file.
* Returns true if the inputs were configured okay or false if the user exited without requesting to save changes. */
*/ void WriteToINIFile(CINIFile *ini, const char *section);
bool ConfigureInputs(const GameInfo *game);
/*
* Configures the current input mapping assignments for the given game, or all inputs if game is NULL, by asking the user for input.
* Takes display geometry if this has not been set previously by a call to Poll().
* Returns true if the inputs were configured okay or false if the user exited without requesting to save changes.
*/
bool ConfigureInputs(const GameInfo *game, unsigned dispX, unsigned dispY, unsigned dispW, unsigned dispH);
void CalibrateJoysticks(); /*
* Configures the current input mapping assignments for the given game, or all inputs if game is NULL, by asking the user for input.
* Returns true if the inputs were configured okay or false if the user exited without requesting to save changes.
*/
bool ConfigureInputs(const GameInfo *game);
/*
* Configures the current input mapping assignments for the given game, or all inputs if game is NULL, by asking the user for input.
* Takes display geometry if this has not been set previously by a call to Poll().
* Returns true if the inputs were configured okay or false if the user exited without requesting to save changes.
*/
bool ConfigureInputs(const GameInfo *game, unsigned dispX, unsigned dispY, unsigned dispW, unsigned dispH);
void CalibrateJoystick(int joyNum); void CalibrateJoysticks();
/* void CalibrateJoystick(int joyNum);
* Prints to stdout the current input mapping assignments for the given game, or all inputs if game is NULL.
*/
void PrintInputs(const GameInfo *game);
/* /*
* Polls (updates) the inputs for the given game, or all inputs if game is NULL, updating their values from their respective input sources. * Prints to stdout the current input mapping assignments for the given game, or all inputs if game is NULL.
* First the input system is polled (CInputSystem.Poll()) and then each input is polled (CInput.Poll()). */
*/ void PrintInputs(const GameInfo *game);
bool Poll(const GameInfo *game, unsigned dispX, unsigned dispY, unsigned dispW, unsigned dispH);
/* /*
* Prints the current values of the inputs for the given game, or all inputs if game is NULL, to stdout for debugging purposes. * Polls (updates) the inputs for the given game, or all inputs if game is NULL, updating their values from their respective input sources.
*/ * First the input system is polled (CInputSystem.Poll()) and then each input is polled (CInput.Poll()).
void DumpState(const GameInfo *game); */
bool Poll(const GameInfo *game, unsigned dispX, unsigned dispY, unsigned dispW, unsigned dispH);
/*
* Prints the current values of the inputs for the given game, or all inputs if game is NULL, to stdout for debugging purposes.
*/
void DumpState(const GameInfo *game);
}; };
#endif // INCLUDED_INPUTS_H #endif // INCLUDED_INPUTS_H

View file

@ -424,6 +424,9 @@ UINT8 CModel3::ReadInputs(unsigned reg)
data &= ~(Inputs->analogTriggerRight[0]->value<<1); data &= ~(Inputs->analogTriggerRight[0]->value<<1);
} }
if ((Game->inputFlags & GAME_INPUT_MAGTRUCK))
data &= ~(Inputs->magicalPedal1->value << 0);
return data; return data;
case 0x0C: // game-specific inputs case 0x0C: // game-specific inputs
@ -494,6 +497,9 @@ UINT8 CModel3::ReadInputs(unsigned reg)
data &= ~(Inputs->analogTriggerLeft[1]->value<<0); data &= ~(Inputs->analogTriggerLeft[1]->value<<0);
data &= ~(Inputs->analogTriggerRight[1]->value<<1); data &= ~(Inputs->analogTriggerRight[1]->value<<1);
} }
if ((Game->inputFlags & GAME_INPUT_MAGTRUCK))
data &= ~(Inputs->magicalPedal2->value << 0);
return data; return data;
@ -538,6 +544,12 @@ UINT8 CModel3::ReadInputs(unsigned reg)
adc[0] = (UINT8)Inputs->skiY->value; adc[0] = (UINT8)Inputs->skiY->value;
adc[1] = (UINT8)Inputs->skiX->value; adc[1] = (UINT8)Inputs->skiX->value;
} }
if ((Game->inputFlags & GAME_INPUT_MAGTRUCK))
{
adc[0] = uint8_t(Inputs->magicalLever1->value);
adc[1] = uint8_t(Inputs->magicalLever2->value);
}
// Read out appropriate channel // Read out appropriate channel
data = adc[adcChannel&7]; data = adc[adcChannel&7];