Skip to content

Commit f146bbb

Browse files
committed
fMSX add button callbacks
Signed-off-by: Joseph Mattiello <[email protected]>
1 parent 004f626 commit f146bbb

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

Cores/fmsx/PVfMSXCore/PVfMSXCoreBridge.mm

+37
Original file line numberDiff line numberDiff line change
@@ -273,4 +273,41 @@ - (void *)getVariable:(const char *)variable {
273273
#undef V
274274
return NULL;
275275
}
276+
277+
278+
-(void)didReleaseMSXButton:(enum PVMSXButton)button forPlayer:(NSInteger)player {
279+
// if (button == PVDSButtonL) {
280+
// lt[player] |= 0xff * false;
281+
// } else if (button == PVDSButtonR) {
282+
// rt[player] |= 0xff * false;
283+
// } else {
284+
// int mapped = DSMap[button];
285+
// kcode[player] |= (mapped);
286+
// }
287+
}
288+
289+
- (void)didMoveMSXJoystickDirection:(enum PVMSXButton)button withValue:(CGFloat)value forPlayer:(NSInteger)player {
290+
/*
291+
float xvalue = gamepad.leftThumbstick.xAxis.value;
292+
s8 x=(s8)(xvalue*127);
293+
joyx[0] = x;
294+
295+
float yvalue = gamepad.leftThumbstick.yAxis.value;
296+
s8 y=(s8)(yvalue*127 * - 1); //-127 ... + 127 range
297+
joyy[0] = y;
298+
*/
299+
}
300+
301+
-(void)didMoveJoystick:(NSInteger)button withValue:(CGFloat)value forPlayer:(NSInteger)player {
302+
[self didMoveMSXJoystickDirection:(enum PVMSXButton)button withValue:value forPlayer:player];
303+
}
304+
305+
- (void)didPush:(NSInteger)button forPlayer:(NSInteger)player {
306+
[self didPushMSXButton:(PVMSXButton)button forPlayer:player];
307+
}
308+
309+
- (void)didRelease:(NSInteger)button forPlayer:(NSInteger)player {
310+
[self didReleaseMSXButton:(PVMSXButton)button forPlayer:player];
311+
}
312+
276313
@end

0 commit comments

Comments
 (0)