Page 1 of 1

remapping the keyboard joystick

Posted: Sun Jan 29, 2023 8:50 am
by Ed Minchau
The joystick_get routine allows us to use the keyboard as joystick 0 by passing 0 in the accumulator. The current mapping of SNES button to keyboard key is

Code: Select all

SNES Button	Keyboard Key	Alt. Keyboard Key
A		X		Left Ctrl
B		Z		Left Alt
X		S	
Y		A	
L		D	
R		C	
START		Enter	
SELECT		Left Shift	
D-Pad		Cursor Keys
Is there any way to re-map this in software, or can it be changed in the ROM? Say, using XDAW for ABXY and / and right shift to L and R, or using WASD for the D Pad and Q and R for L and R, and MLJI for ABXY. Or any other mapping the user might want. Then we could treat any arbitrary mapping of the keyboard as JOY0, even allowing the end user to map it themselves.

Re: remapping the keyboard joystick

Posted: Sun Jan 29, 2023 9:03 am
by grml
As a side node: if you have positional keyboard inputs like this and you don't want to piss off large parts of your international audience: please do not hardcode 'Z' and 'X' as 'A' and 'B' buttons. A lot of people would need to break their own fingers just to play your game. Having this hardcoded in ROM and enforced for everything and everyone would be a huge error in design.

Edit: on a second thought, breaking fingers only happens with localized input, not with scancodes, which is hopefully how it's implemented. In that case t's just the UIs that will be wrong all the time :mrgreen: