tweak driver to no more use IRQ
This commit is contained in:
@@ -73,13 +73,22 @@ UNINSTALL:
|
|||||||
rts
|
rts
|
||||||
|
|
||||||
; ------------------------------------------------------------------------
|
; ------------------------------------------------------------------------
|
||||||
; IRQ entry point. Is called from the C layer as a subroutine in the
|
; COUNT: Return the total number of available joysticks in a/x.
|
||||||
; interrupt. The routine MUST return carry set if the interrupt has been
|
;
|
||||||
; 'handled' - which means that the interrupt source is gone. Otherwise it
|
|
||||||
; MUST return carry clear.
|
|
||||||
|
|
||||||
IRQ: ; cia 2 setup
|
COUNT: lda #<JOY_COUNT
|
||||||
|
ldx #>JOY_COUNT
|
||||||
|
rts
|
||||||
|
|
||||||
|
; ------------------------------------------------------------------------
|
||||||
|
; READ: Read a particular joystick passed in A.
|
||||||
|
;
|
||||||
|
|
||||||
|
readadapter:
|
||||||
|
|
||||||
|
sei
|
||||||
|
|
||||||
|
; cia 2 setup
|
||||||
ldy #$00 ; port b direction
|
ldy #$00 ; port b direction
|
||||||
sty $dd03 ; => input
|
sty $dd03 ; => input
|
||||||
|
|
||||||
@@ -143,32 +152,24 @@ IRQ: ; cia 2 setup
|
|||||||
sta temp4
|
sta temp4
|
||||||
|
|
||||||
fire:
|
fire:
|
||||||
; Default Value: $40/64 on PAL
|
; FIXME: to be really 100% correct this should restore the correct timer
|
||||||
; $42/66 on NTSC
|
; values for the respective machine (PAL: $4025, NTSC: $4295)
|
||||||
|
; however, this should hardly be a problem in a real world program
|
||||||
|
|
||||||
lda #$41
|
lda #$41
|
||||||
sta $dc05
|
sta $dc05
|
||||||
; Default Value: $25/37 on PAL
|
|
||||||
; $95/149 on NTSC
|
|
||||||
lda #0
|
lda #0
|
||||||
sta $dc04
|
sta $dc04
|
||||||
|
|
||||||
; We do never "handle" the interrupt, we use it just as a timer.
|
cli
|
||||||
clc
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
; ------------------------------------------------------------------------
|
READ:
|
||||||
; COUNT: Return the total number of available joysticks in a/x.
|
pha
|
||||||
;
|
jsr readadapter
|
||||||
|
pla
|
||||||
|
|
||||||
COUNT: lda #<JOY_COUNT
|
tax ; Joystick number into X
|
||||||
ldx #>JOY_COUNT
|
|
||||||
rts
|
|
||||||
|
|
||||||
; ------------------------------------------------------------------------
|
|
||||||
; READ: Read a particular joystick passed in A.
|
|
||||||
;
|
|
||||||
|
|
||||||
READ: tax ; Joystick number into X
|
|
||||||
bne joy2
|
bne joy2
|
||||||
|
|
||||||
; Read joystick 1
|
; Read joystick 1
|
||||||
@@ -214,4 +215,3 @@ joy4: lda temp4
|
|||||||
eor #$1F
|
eor #$1F
|
||||||
ldx #0
|
ldx #0
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user