You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the Verilog simulation, it appears the keys for player 1 (arrow keys, space/shift) and the keys for player 2 (a, d, w, s, z, x) both actually control player 1, at least experimentally. Ie, both seem to only affect the horizontal vars output (ie, based on vertical position). (I think this is an accidental regression; see comments at the end.)
This also appears to be true when using the sprite rotation example, but fortunately that one only relies on the player 1 controls (but can be controlled with both "player 1" and "player 2" controls equivalently).
It seems like the second parameter in each row should be the player number or similar, but in platform/verilog.ts both the player 1 keys and the player 2 keys are set to 0 (ie, player 1).
Compare with, eg, platforms/nes.ts which matches the player 1 keys with a 1 and the player 2 keys with a 2:
From the definition of makeKeycodeMap(), I think it confirms the second item in each row is the index (eg, into the switches array), so that'd confirm that player 1 should be 0 and player 2 should be 1:
And that appears to be the way that it was before the most recent change (to "standardize keys"), so my guess is that this is a cut'n'paste regression that was just overlooked in testing that change.
Ewen
PS: Also for anyone finding this, you have to click on the output video screen to ensure the input focus goes there for the keys to work; that was non-obvious initially. (Otherwise the input focus is, eg, the source editor, and pressing keys in that doesn't control the running program :-) )
The text was updated successfully, but these errors were encountered:
ewenmcneill
added a commit
to ewenmcneill/8bitworkshop
that referenced
this issue
Feb 29, 2020
In the Verilog simulation, it appears the keys for player 1 (arrow keys, space/shift) and the keys for player 2 (a, d, w, s, z, x) both actually control player 1, at least experimentally. Ie, both seem to only affect the horizontal vars output (ie, based on vertical position). (I think this is an accidental regression; see comments at the end.)
8bitworkshop/presets/verilog/switches.v
Lines 7 to 8 in 03af8c2
8bitworkshop/presets/verilog/switches.v
Lines 33 to 40 in 03af8c2
This also appears to be true when using the sprite rotation example, but fortunately that one only relies on the player 1 controls (but can be controlled with both "player 1" and "player 2" controls equivalently).
8bitworkshop/presets/verilog/sprite_rotation.v
Lines 400 to 402 in 03af8c2
As best I can tell the problem is in
platform/verilog.ts
in the table passed tomakeKeycodeMap()
:8bitworkshop/src/platform/verilog.ts
Lines 43 to 61 in 03af8c2
It seems like the second parameter in each row should be the player number or similar, but in
platform/verilog.ts
both the player 1 keys and the player 2 keys are set to0
(ie, player 1).Compare with, eg,
platforms/nes.ts
which matches the player 1 keys with a1
and the player 2 keys with a2
:8bitworkshop/src/platform/nes.ts
Lines 49 to 67 in 03af8c2
as does Galaxian:
8bitworkshop/src/platform/galaxian.ts
Lines 12 to 22 in 03af8c2
From the definition of
makeKeycodeMap()
, I think it confirms the second item in each row is theindex
(eg, into theswitches
array), so that'd confirm that player 1 should be0
and player 2 should be1
:8bitworkshop/src/common/emu.ts
Lines 510 to 523 in 03af8c2
AFAICT the fix would just be to change the
P2_*
keys rows fromindex
0 toindex
1, ie in these lines:8bitworkshop/src/platform/verilog.ts
Lines 50 to 55 in 03af8c2
And that appears to be the way that it was before the most recent change (to "standardize keys"), so my guess is that this is a cut'n'paste regression that was just overlooked in testing that change.
Ewen
PS: Also for anyone finding this, you have to click on the output video screen to ensure the input focus goes there for the keys to work; that was non-obvious initially. (Otherwise the input focus is, eg, the source editor, and pressing keys in that doesn't control the running program :-) )
The text was updated successfully, but these errors were encountered: