Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix verilog key handling for player 2 #32

Merged
merged 2 commits into from
May 13, 2020

Conversation

ewenmcneill
Copy link
Contributor

Fix regression in handling of player 2 keys in the Verilog simulator, accidentally introduced by 271c2ea (they were inadvertently redirected to also control player 1).

Also update presets/verilog/switches.v documentation comment of what the keys are to match the keys actually used now across all platforms. (In particular Z and X seems to have been repurposed for player 1 gamepad use, rather than player 2 A/B buttons; player 2 A/B are now T and R.)

export const Keys = {
ANYKEY: {c: 0, n: "?"},
// gamepad and keyboard (player 0)
UP: {c: 38, n: "Up", plyr:0, yaxis:-1},
DOWN: {c: 40, n: "Down", plyr:0, yaxis:1},
LEFT: {c: 37, n: "Left", plyr:0, xaxis:-1},
RIGHT: {c: 39, n: "Right", plyr:0, xaxis:1},
A: {c: 32, n: "Space", plyr:0, button:0},
B: {c: 16, n: "Shift", plyr:0, button:1},
GP_A: {c: 88, n: "X", plyr:0, button:0},
GP_B: {c: 90, n: "Z", plyr:0, button:1},
SELECT: {c: 220, n: "\\", plyr:0, button:8},
START: {c: 13, n: "Enter", plyr:0, button:9},
// gamepad and keyboard (player 1)
P2_UP: {c: 87, n: "W", plyr:1, yaxis:-1},
P2_DOWN: {c: 83, n: "S", plyr:1, yaxis:1},
P2_LEFT: {c: 65, n: "A", plyr:1, xaxis:-1},
P2_RIGHT: {c: 68, n: "D", plyr:1, xaxis:1},
P2_A: {c: 84, n: "T", plyr:1, button:0},
P2_B: {c: 82, n: "R", plyr:1, button:1},
P2_SELECT: {c: 70, n: "F", plyr:1, button:8},
P2_START: {c: 71, n: "G", plyr:1, button:9},

Fixes #31

Reconnect the Player 2 keys to Player 2; they were accidentally connected
to Player 1 in sehugg@271c2ea

Fixes sehugg#31
sehugg@271c2ea
changed the Player 2 keys to standard ones in all platforms, and as part
of supporting a gamepad emulation, Z and X were repurposed as the player 1
gamepad.  T and R were allocated instead as the player 2 A/B buttons; see
https://github.com/sehugg/8bitworkshop/blob/03af8c27144380d528f524828e73c966d12ecd35/src/common/emu.ts#L341-L362
@sehugg sehugg merged commit 6696c4f into sehugg:master May 13, 2020
@sehugg
Copy link
Owner

sehugg commented May 13, 2020

Thanks for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Verilog: Regression: player 2 keys control player 1 instead of player 2
2 participants