diff --git a/README.md b/README.md index 5c85425..3c9976f 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ in the original. | Input | Action | |-------|--------| -| Joystick port 2 left/right | change lane (auto-repeats while held) | +| Joystick port 2 left/right, or `A` / `D` | change lane (auto-repeats while held) | | Fire (or `SPACE`) | start / retry | ## How it works diff --git a/common.asm b/common.asm index 7d81dfc..1a781f7 100644 --- a/common.asm +++ b/common.asm @@ -89,7 +89,8 @@ dr_loop: ; ---- input ---- -; read joystick port 2, return active-high bits in A and joyb +; read joystick port 2 merged with the a/d keys, +; return active-high bits in A and joyb read_joy: lda #$ff ; deselect every keyboard column first sta CIA1_PA @@ -97,6 +98,25 @@ read_joy: eor #$ff and #$1f sta joyb + lda #$fd ; 'a' = left: keyboard column 1, row bit 2 + sta CIA1_PA + lda CIA1_PB + and #$04 + bne rj_noleft + lda joyb + ora #JOY_LEFT + sta joyb +rj_noleft: + lda #$fb ; 'd' = right: keyboard column 2, row bit 2 + sta CIA1_PA + lda CIA1_PB + and #$04 + bne rj_noright + lda joyb + ora #JOY_RIGHT + sta joyb +rj_noright: + lda joyb rts ; fire or space held? returns A != 0 when pressed @@ -439,7 +459,7 @@ txt_miss: !scr "miss" txt_rabbit: !scr "rabbit" txt_scooter: !scr "scooter" txt_press: !scr "press fire to start" -txt_info: !scr "joystick 2 moves fire starts" +txt_info: !scr "joystick 2 or a/d fire starts" txt_over: !scr "game over" txt_retry: !scr "fire = retry" txt_blank: !fill 19, $20 diff --git a/title.asm b/title.asm index d84dc1b..a2f3c81 100644 --- a/title.asm +++ b/title.asm @@ -10,7 +10,7 @@ title_init: +prbig 1, 8, BLACK, txt_rabbit, 6 +prtext 6, 16, BLACK, txt_scooter, 7 - +prtext 17, 5, BLACK, txt_info, 30 + +prtext 17, 4, BLACK, txt_info, 31 ; one parked scooter per lane on sprites 0-4 ldx #4