Skip to content

Commit

Permalink
Supports local multiplayer
Browse files Browse the repository at this point in the history
Heavily based on Ian Clawson’s PR: #1
  • Loading branch information
rileytestut committed Mar 1, 2023
1 parent e3a957f commit 18c5958
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions Sources/GPGXBridge/GPGXEmulatorBridge.m
Original file line number Diff line number Diff line change
Expand Up @@ -131,22 +131,23 @@ - (void)runFrameAndProcessVideo:(BOOL)processVideo

#pragma mark - Inputs -

- (void)activateInput:(NSInteger)inputValue value:(double)value
- (void)activateInput:(NSInteger)inputValue value:(double)value playerIndex:(NSInteger)playerIndex
{
int player = 0;
input.pad[player * 4] |= inputValue;
//TODO: Is this correct?
input.pad[playerIndex * 4] |= inputValue;
}

- (void)deactivateInput:(NSInteger)inputValue
- (void)deactivateInput:(NSInteger)inputValue playerIndex:(NSInteger)playerIndex
{
int player = 0;
input.pad[player * 4] &= ~inputValue;
input.pad[playerIndex * 4] &= ~inputValue;
}

- (void)resetInputs
{
int player = 0;
input.pad[player * 4] = 0;
for (int playerIndex = 0; playerIndex < 2; playerIndex++)
{
input.pad[playerIndex * 4] = 0;
}
}

#pragma mark - Game Saves -
Expand Down

0 comments on commit 18c5958

Please sign in to comment.