kirjavascript / TetrisGYM

nes tetris training rom
Other
189 stars 17 forks source link

Famicom keyboard #32

Closed zohassadar closed 1 year ago

zohassadar commented 1 year ago

Added code to read Family BASIC Keyboard and map to button input.

The 72 keys are mapped to 9 consecutive bytes at $0677

Arrow keys are mapped to D-PAD buttons.
Return is mapped to Start. Right shift is mapped to Select.
Grph is mapped to B.
Space is mapped to A.

The mapped keys are stored in newlyPressedKeys and heldKeys and are then copied to newlyPressedButtons_player1 and heldButtons_player1 respectively.

All keyboard code is compiled based on KEYBOARD flag. Modified build.sh script to use args, with the arg -m option used to set mapper. -k sets KEYBOARD flag, and -v sets the -x flag so full command output is shown.

resolves #31