-
;
; Standard joystick driver for the PCEngine
;
; Driver signature
- .byte $6A, $6F, $79 ; "joy"
- .byte JOY_API_VERSION ; Driver API version number
+ .byte $6A, $6F, $79 ; "joy"
+ .byte JOY_API_VERSION ; Driver API version number
; Library reference
; INSTALL routine. Is called after the driver is loaded into memory. If
; possible, check if the hardware is present and determine the amount of
; memory available.
-; Must return an JOY_ERR_xx code in a/x.
+; Must return a JOY_ERR_xx code in a/x.
;
INSTALL:
rts
read_joy:
- ; reset multitap counter
+ ; Reset Multitap counter.
lda #$01
sta JOY_CTRL
pha
cly
nextpad:
lda #$01
- sta JOY_CTRL ; sel = 1
+ sta JOY_CTRL ; sel = 1
pha
pla
nop ; some delay is required
asl a
asl a
asl a
- sta padbuffer, y ; store new value
+ sta padbuffer,y ; store new value
stz JOY_CTRL
pha
pla
-
nop ; some delay is required
nop
lda JOY_CTRL
and #$0F
- ora padbuffer, y ; second half of new value
+ ora padbuffer,y ; second half of new value
eor #$FF
- sta padbuffer, y ; store new value
+ sta padbuffer,y ; store new value
iny
cpy #$05
padbuffer:
.res 4
-