Skip to content

Commit

Permalink
Fix for the PC-Engine, TurboGrafx 16, SuperGrafx emulator.
Browse files Browse the repository at this point in the history
Games now load and work correctly.
  • Loading branch information
SoftechSoftware authored and rsn8887 committed Jan 11, 2018
1 parent f830361 commit 72860d7
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions pfba/input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ unsigned char inputP1P2Switch;

#define MAX_INPUT_inp (17)

/// www.SoftechSoftware.it
#define MAX_GAME_INPUT (6)

struct GameInput {
//unsigned char *pVal; // Destination for the Input Value
union {
Expand All @@ -24,7 +27,8 @@ struct DIPInfo {
struct GameInput *DIPData;
} DIPInfo;
// Mapping of PC inputs to game inputs
struct GameInput GameInput[4][MAX_INPUT_inp];
/// www.SoftechSoftware.it
struct GameInput GameInput[MAX_GAME_INPUT/*4*/][MAX_INPUT_inp];
unsigned int nGameInpCount = 0;
static bool bInputOk = false;
unsigned char *ServiceDip = 0;
Expand Down Expand Up @@ -63,7 +67,11 @@ int DoInputBlank(int /*bDipSwitch*/) {
}

if ((bii.szInfo[0] == 'p') || (bii.szInfo[0] == 'm'))
{
if (bii.szInfo[0] == 'm') iJoyNum = 0; else iJoyNum = bii.szInfo[1] - '1';
/// www.SoftechSoftware.it
///if (iJoyNum > 3) iJoyNum = 3; // Sperimental fix
}
else {
if (strcmp(bii.szInfo, "diag") == 0 || strcmp(bii.szInfo, "test") == 0) {
ServiceDip = bii.pVal;
Expand Down Expand Up @@ -253,7 +261,8 @@ int InpInit() {
}
}

memset(GameInput, 0, MAX_INPUT_inp * 4 * sizeof(struct GameInput));
/// www.SoftechSoftware.it
memset(GameInput, 0, MAX_INPUT_inp * MAX_GAME_INPUT/*4*/ * sizeof(struct GameInput));
DoInputBlank(1);

bInputOk = true;
Expand Down

0 comments on commit 72860d7

Please sign in to comment.