-
Notifications
You must be signed in to change notification settings - Fork 21
Keyboard score entry #142
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
Open
zohassadar
wants to merge
32
commits into
kirjavascript:master
Choose a base branch
from
zohassadar:keyboard_score_entry
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Keyboard score entry #142
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
49cb98d
More efficient keyboard reading (when more keys are read)
zohassadar 035950b
Use family basic keyboard for score name entry
zohassadar 45909bf
replace space
zohassadar ae72c50
Delay before first row
zohassadar 95c9e40
wait before column 1
zohassadar f1c76b8
save 5 cycles in wait loop and still be >50
zohassadar 9382e3e
Merge remote-tracking branch 'origin/master' into keyboard_score_entry
zohassadar d940c77
better mapping
zohassadar eb8a77f
Merge remote-tracking branch 'origin/master' into keyboard_score_entry
zohassadar f33260e
preferred keybindings
zohassadar 02da1ca
read keyboard after nmi wait
zohassadar aed681e
map only start during high score entry
zohassadar 0830448
no longer applicable
zohassadar d312cc2
add note & build flag for var
zohassadar c3b4e9c
fix b-type crash when using keyboard code
zohassadar da59823
add mapping for every key & macro to use them
zohassadar 7875127
untested revamp of everything
zohassadar 55e4e44
fix bugs after testing
zohassadar 8d0cd56
seed input with keyboard
zohassadar 4480354
update kb doc from nesdev site
zohassadar d999b6d
move things around
zohassadar 71edb34
Rename map.asm to constants.asm
zohassadar 42610a6
keyboard detection
zohassadar 350e56c
read 10th row instead of first
zohassadar 6a4bc04
update addresses in ram comments
zohassadar ff3914c
proper ram reservation when no-keyboard
zohassadar 012532d
Merge remote-tracking branch 'upstream/master' into keyboard_score_entry
zohassadar 491b5ad
specify low byte for negative numbers
zohassadar 8fe6f18
Update src/nametables/nametables.js
zohassadar fe9df0a
fix offset var
zohassadar 831a04a
save bytes
zohassadar 6f72aa2
disable controller while keyboard is active
zohassadar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,51 @@ | ||
highScorePpuAddrTable: | ||
.dbyt $2284,$22C4,$2304 | ||
highScoreCharToTile: | ||
.byte $FF,$0A,$0B,$0C,$0D,$0E,$0F,$10 | ||
.byte $11,$12,$13,$14,$15,$16,$17,$18 | ||
.byte $19,$1A,$1B,$1C,$1D,$1E,$1F,$20 | ||
.byte $21,$22,$23,$00,$01,$02,$03,$04 | ||
.byte $05,$06,$07,$08,$09,$25,$4F,$5E | ||
.byte $5F,$6E,$6F,$52,$55,$24 | ||
.byte $FF ; Space | ||
.byte $0A ; A | ||
.byte $0B ; B | ||
.byte $0C ; C | ||
.byte $0D ; D | ||
.byte $0E ; E | ||
.byte $0F ; F | ||
.byte $10 ; G | ||
.byte $11 ; H | ||
.byte $12 ; I | ||
.byte $13 ; J | ||
.byte $14 ; K | ||
.byte $15 ; L | ||
.byte $16 ; M | ||
.byte $17 ; N | ||
.byte $18 ; O | ||
.byte $19 ; P | ||
.byte $1A ; Q | ||
.byte $1B ; R | ||
.byte $1C ; S | ||
.byte $1D ; T | ||
.byte $1E ; U | ||
.byte $1F ; V | ||
.byte $20 ; W | ||
.byte $21 ; X | ||
.byte $22 ; Y | ||
.byte $23 ; Z | ||
.byte $00 ; 0 | ||
.byte $01 ; 1 | ||
.byte $02 ; 2 | ||
.byte $03 ; 3 | ||
.byte $04 ; 4 | ||
.byte $05 ; 5 | ||
.byte $06 ; 6 | ||
.byte $07 ; 7 | ||
.byte $08 ; 8 | ||
.byte $09 ; 9 | ||
.byte $25 ; , | ||
.byte $4F ; / | ||
.byte $5E ; ( | ||
.byte $5F ; ) | ||
.byte $6E ; <3 | ||
.byte $6F ; . | ||
.byte $52 ; ! | ||
.byte $55 ; ? | ||
.byte $24 ; - | ||
|
||
highScoreCharSize := $2E |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
kbMappedUp = keyK | ||
kbMappedDown = keyJ | ||
kbMappedLeft = keyH | ||
kbMappedRight = keyL | ||
kbMappedB = keyD | ||
kbMappedA = keyF | ||
kbMappedSelect = keyShiftLeft | ||
kbMappedStart = keyReturn |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
; each key is represented by a byte 0RRRRCCC | ||
; row is 0-8 | ||
; col is byte position from left to right | ||
|
||
keyF1 = $0B | ||
keyF2 = $13 | ||
keyF3 = $1B | ||
keyF4 = $23 | ||
keyF5 = $2B | ||
keyF6 = $33 | ||
keyF7 = $3B | ||
keyF8 = $43 | ||
|
||
keyStop = $44 | ||
keyReturn = $42 | ||
|
||
keyShiftRight = $46 | ||
keyShiftLeft = $0F | ||
|
||
keyESC = $0A | ||
keyCTR = $08 | ||
keyGRPH = $0E | ||
|
||
keyCLR_HOME = $03 | ||
keyINS = $04 | ||
keyDEL = $05 | ||
|
||
keyUp = $02 | ||
keyLeft = $00 | ||
keyRight = $01 | ||
keyDown = $07 | ||
|
||
keyCloseBracket = $40 ; ] | ||
keyOpenBracket = $41 ; [ | ||
keyYen = $45 ; ¥ | ||
keySemicolon = $38 ; ; | ||
keyColon = $39 ; : | ||
keyatSign = $3A ; @ | ||
keyCaret = $3C ; ^ | ||
keySlash = $3E ; / | ||
keyUnderscore = $3F ; _ | ||
keyComma = $36 ; , | ||
keyPeriod = $37 ; . | ||
keyDash = $3D ; - | ||
keyKana = $47 | ||
|
||
keySpace = $06 | ||
|
||
key0 = $34 | ||
key1 = $0D | ||
key2 = $0C | ||
key3 = $14 | ||
key4 = $1C | ||
key5 = $1D | ||
key6 = $24 | ||
key7 = $25 | ||
key8 = $2C | ||
key9 = $2D | ||
|
||
keyA = $10 | ||
keyB = $27 | ||
keyC = $1E | ||
keyD = $18 | ||
keyE = $15 | ||
keyF = $1F | ||
keyG = $21 | ||
keyH = $20 | ||
keyI = $2A | ||
keyJ = $28 | ||
keyK = $30 | ||
keyL = $31 | ||
keyM = $2F | ||
keyN = $2E | ||
keyO = $32 | ||
keyP = $35 | ||
keyQ = $09 | ||
keyR = $19 | ||
keyS = $11 | ||
keyT = $1A | ||
keyU = $29 | ||
keyV = $26 | ||
keyW = $12 | ||
keyX = $17 | ||
keyY = $22 | ||
keyZ = $16 | ||
|
||
|
||
KB_DISABLE = $00 | ||
KB_INIT = $05 | ||
KB_COL_0 = $04 | ||
KB_COL_1 = $06 | ||
KB_MASK = $1E | ||
|
||
UPDOWN = BUTTON_UP | BUTTON_DOWN | ||
LEFTRIGHT = BUTTON_LEFT | BUTTON_RIGHT | ||
|
||
.macro readKeyDirect keyMap | ||
; not zero - key is pressed | ||
lda kbRawInput + (keyMap >> 3) | ||
and #$80 >> (keyMap & 7) | ||
.endmacro | ||
|
||
.macro expandKeyRow keyMap | ||
.byte keyMap >> 3 | ||
.endmacro | ||
|
||
.macro expandKeyMask keyMap | ||
.byte $80 >> (keyMap & 7) | ||
.endmacro |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
keymap = """ | ||
CloseBracket OpenBracket RETURN F8 STOP Yen SHIFTRight KANA | ||
Semicolon Colon atSign F7 Caret Dash Slash Underscore | ||
K L O F6 0 P Comma Period | ||
J U I F5 8 9 N M | ||
H G Y F4 6 7 V B | ||
D R T F3 4 5 C F | ||
A S W F2 3 E Z X | ||
CTR Q ESC F1 2 1 GRPH SHIFTLeft | ||
Left Right UP CLR_HOME INS DEL Space Down | ||
""" | ||
|
||
for row, keys in enumerate(keymap.strip().splitlines()): | ||
for mask, key in enumerate(keys.split()): | ||
print(f"key{key:<12} = ${((8 - row) << 3) | mask:02X}") |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice