Skip to content

Commit

Permalink
fMSX add button callbacks
Browse files Browse the repository at this point in the history
Signed-off-by: Joseph Mattiello <[email protected]>
  • Loading branch information
JoeMatt committed Dec 31, 2024
1 parent 004f626 commit f146bbb
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions Cores/fmsx/PVfMSXCore/PVfMSXCoreBridge.mm
Original file line number Diff line number Diff line change
Expand Up @@ -273,4 +273,41 @@ - (void *)getVariable:(const char *)variable {
#undef V
return NULL;
}


-(void)didReleaseMSXButton:(enum PVMSXButton)button forPlayer:(NSInteger)player {
// if (button == PVDSButtonL) {
// lt[player] |= 0xff * false;
// } else if (button == PVDSButtonR) {
// rt[player] |= 0xff * false;
// } else {
// int mapped = DSMap[button];
// kcode[player] |= (mapped);
// }
}

- (void)didMoveMSXJoystickDirection:(enum PVMSXButton)button withValue:(CGFloat)value forPlayer:(NSInteger)player {
/*
float xvalue = gamepad.leftThumbstick.xAxis.value;
s8 x=(s8)(xvalue*127);
joyx[0] = x;
float yvalue = gamepad.leftThumbstick.yAxis.value;
s8 y=(s8)(yvalue*127 * - 1); //-127 ... + 127 range
joyy[0] = y;
*/
}

-(void)didMoveJoystick:(NSInteger)button withValue:(CGFloat)value forPlayer:(NSInteger)player {
[self didMoveMSXJoystickDirection:(enum PVMSXButton)button withValue:value forPlayer:player];
}

- (void)didPush:(NSInteger)button forPlayer:(NSInteger)player {
[self didPushMSXButton:(PVMSXButton)button forPlayer:player];
}

- (void)didRelease:(NSInteger)button forPlayer:(NSInteger)player {
[self didReleaseMSXButton:(PVMSXButton)button forPlayer:player];
}

@end

0 comments on commit f146bbb

Please sign in to comment.