Updated to use the new VIA register names
This commit is contained in:
@@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
.include "joy-kernel.inc"
|
.include "joy-kernel.inc"
|
||||||
.include "joy-error.inc"
|
.include "joy-error.inc"
|
||||||
|
.include "pet.inc"
|
||||||
|
|
||||||
.macpack module
|
.macpack module
|
||||||
|
|
||||||
@@ -40,10 +41,6 @@
|
|||||||
|
|
||||||
JOY_COUNT = 2 ; Number of joysticks we support
|
JOY_COUNT = 2 ; Number of joysticks we support
|
||||||
|
|
||||||
VIA_PRA := $E841 ; Port register A
|
|
||||||
VIA_DDRA := $E843 ; Data direction register A
|
|
||||||
|
|
||||||
|
|
||||||
.code
|
.code
|
||||||
|
|
||||||
; ------------------------------------------------------------------------
|
; ------------------------------------------------------------------------
|
||||||
@@ -89,9 +86,9 @@ READ: lda #%10000000 ; via port A Data-Direction
|
|||||||
; Read joystick 1
|
; Read joystick 1
|
||||||
|
|
||||||
joy1: lda #$80 ; via port A read/write
|
joy1: lda #$80 ; via port A read/write
|
||||||
sta VIA_PRA ; (output one at PA7)
|
sta VIA_PA1 ; (output one at PA7)
|
||||||
|
|
||||||
lda VIA_PRA ; via port A read/write
|
lda VIA_PA1 ; via port A read/write
|
||||||
and #$1f ; get bit 4-0 (PA4-PA0)
|
and #$1f ; get bit 4-0 (PA4-PA0)
|
||||||
eor #$1f
|
eor #$1f
|
||||||
rts
|
rts
|
||||||
@@ -99,13 +96,13 @@ joy1: lda #$80 ; via port A read/write
|
|||||||
; Read joystick 2
|
; Read joystick 2
|
||||||
|
|
||||||
joy2: lda #$00 ; via port A read/write
|
joy2: lda #$00 ; via port A read/write
|
||||||
sta VIA_PRA ; (output zero at PA7)
|
sta VIA_PA1 ; (output zero at PA7)
|
||||||
|
|
||||||
lda VIA_PRA ; via port A read/write
|
lda VIA_PA1 ; via port A read/write
|
||||||
and #$0f ; get bit 3-0 (PA3-PA0)
|
and #$0f ; get bit 3-0 (PA3-PA0)
|
||||||
sta tmp1 ; joy 4 directions
|
sta tmp1 ; joy 4 directions
|
||||||
|
|
||||||
lda VIA_PRA ; via port A read/write
|
lda VIA_PA1 ; via port A read/write
|
||||||
and #%00100000 ; get bit 5 (PA5)
|
and #%00100000 ; get bit 5 (PA5)
|
||||||
lsr
|
lsr
|
||||||
ora tmp1
|
ora tmp1
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ READ:
|
|||||||
joy1:
|
joy1:
|
||||||
lda #0
|
lda #0
|
||||||
sta VIA_DDRA
|
sta VIA_DDRA
|
||||||
lda VIA_PRA
|
lda VIA_PA1
|
||||||
and #$0f
|
and #$0f
|
||||||
cmp #$0c
|
cmp #$0c
|
||||||
bne @notc1
|
bne @notc1
|
||||||
@@ -102,7 +102,7 @@ joy1:
|
|||||||
joy2:
|
joy2:
|
||||||
lda #0
|
lda #0
|
||||||
sta VIA_DDRA
|
sta VIA_DDRA
|
||||||
lda VIA_PRA
|
lda VIA_PA1
|
||||||
lsr
|
lsr
|
||||||
lsr
|
lsr
|
||||||
lsr
|
lsr
|
||||||
|
|||||||
Reference in New Issue
Block a user