mirror of
https://github.com/cc65/cc65.git
synced 2024-12-22 12:30:41 +00:00
Removed IRQ support from joystick drivers.
All but one joystick drivers didn't use IRQs. Espsecially when the joystick driver kernel was the only .interruptor this meant quite some unnecessary overhead because it pulled in the whole IRQ infrastructure. I was told that the one driver using IRQs (the DXS/HIT-4 Player joystick driver for the C64) can be reworked to not do it. Until this is done that driver is defunct.
This commit is contained in:
parent
27dacca4d3
commit
1976d6cd32
@ -48,14 +48,13 @@
|
||||
UNINSTALL .addr ; UNINSTALL routine
|
||||
COUNT .addr ; COUNT routine
|
||||
READ .addr ; READ routine
|
||||
IRQ .addr ; IRQ routine
|
||||
.endstruct
|
||||
.endstruct
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; The JOY API version, stored in JOY_HDR::VERSION
|
||||
|
||||
JOY_API_VERSION = $04
|
||||
JOY_API_VERSION = $05
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Variables
|
||||
|
@ -52,7 +52,6 @@ PREAD := $FB1E ; Read paddle in X, return AD conv. value in Y
|
||||
.addr UNINSTALL
|
||||
.addr COUNT
|
||||
.addr READJOY
|
||||
.addr 0 ; IRQ not used
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
|
||||
|
@ -41,7 +41,6 @@
|
||||
.addr UNINSTALL
|
||||
.addr COUNT
|
||||
.addr READJOY
|
||||
.addr 0 ; IRQ entry not used
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Constants
|
||||
|
@ -40,7 +40,6 @@
|
||||
.addr UNINSTALL
|
||||
.addr COUNT
|
||||
.addr READJOY
|
||||
.addr 0 ; IRQ entry not used
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Constants
|
||||
|
@ -33,7 +33,6 @@
|
||||
.addr UNINSTALL
|
||||
.addr COUNT
|
||||
.addr READJOY
|
||||
.addr 0 ; IRQ entry not used
|
||||
|
||||
.code
|
||||
|
||||
|
@ -27,24 +27,12 @@
|
||||
|
||||
.addr $0000
|
||||
|
||||
; Button state masks (8 values)
|
||||
|
||||
.byte $10 ; JOY_UP
|
||||
.byte $08 ; JOY_DOWN
|
||||
.byte $01 ; JOY_LEFT
|
||||
.byte $02 ; JOY_RIGHT
|
||||
.byte $20 ; JOY_FIRE
|
||||
.byte $00 ; Future expansion
|
||||
.byte $00 ; Future expansion
|
||||
.byte $00 ; Future expansion
|
||||
|
||||
; Jump table.
|
||||
|
||||
.addr INSTALL
|
||||
.addr UNINSTALL
|
||||
.addr COUNT
|
||||
.addr READ
|
||||
.addr 0 ; IRQ entry unused
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Constants
|
||||
|
@ -34,7 +34,6 @@
|
||||
.addr UNINSTALL
|
||||
.addr COUNT
|
||||
.addr READ
|
||||
.addr 0 ; IRQ entry unused
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Constants
|
||||
|
@ -36,7 +36,6 @@
|
||||
.addr UNINSTALL
|
||||
.addr COUNT
|
||||
.addr READ
|
||||
.addr 0 ; IRQ entry unused
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Constants
|
||||
|
@ -36,7 +36,6 @@
|
||||
.addr UNINSTALL
|
||||
.addr COUNT
|
||||
.addr READ
|
||||
.addr 0 ; IRQ entry not used
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Constants
|
||||
|
@ -35,7 +35,6 @@
|
||||
.addr UNINSTALL
|
||||
.addr COUNT
|
||||
.addr READ
|
||||
.addr IRQ
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Constants
|
||||
|
@ -36,7 +36,6 @@
|
||||
.addr UNINSTALL
|
||||
.addr COUNT
|
||||
.addr READ
|
||||
.addr 0 ; IRQ entry unused
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Constants
|
||||
|
@ -35,7 +35,6 @@
|
||||
.addr UNINSTALL
|
||||
.addr COUNT
|
||||
.addr READ
|
||||
.addr 0 ; IRQ entry unused
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Constants
|
||||
|
@ -35,7 +35,6 @@
|
||||
.addr UNINSTALL
|
||||
.addr COUNT
|
||||
.addr READ
|
||||
.addr 0 ; IRQ entry unused
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Constants
|
||||
|
@ -36,7 +36,6 @@
|
||||
.addr UNINSTALL
|
||||
.addr COUNT
|
||||
.addr READ
|
||||
.addr 0 ; IRQ entry unused
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Constants
|
||||
|
@ -33,7 +33,6 @@
|
||||
.addr UNINSTALL
|
||||
.addr COUNT
|
||||
.addr READJOY
|
||||
.addr 0 ; IRQ entry not used
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Constants
|
||||
|
@ -30,7 +30,6 @@
|
||||
.addr UNINSTALL
|
||||
.addr COUNT
|
||||
.addr READJOY
|
||||
.addr 0 ; IRQ entry unused
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Constants
|
||||
|
@ -6,7 +6,6 @@
|
||||
|
||||
.import joy_libref
|
||||
.importzp ptr1
|
||||
.interruptor joy_irq ; Export as IRQ handler
|
||||
|
||||
.include "joy-kernel.inc"
|
||||
.include "joy-error.inc"
|
||||
@ -26,7 +25,6 @@ joy_install: jmp $0000
|
||||
joy_uninstall: jmp $0000
|
||||
joy_count: jmp $0000
|
||||
joy_read: jmp $0000
|
||||
joy_irq: .byte $60, $00, $00 ; RTS plus two dummy bytes
|
||||
|
||||
; Driver header signature
|
||||
.rodata
|
||||
@ -73,18 +71,7 @@ _joy_install:
|
||||
cpy #(JOY_HDR::JUMPTAB + .sizeof(JOY_HDR::JUMPTAB))
|
||||
bne @L1
|
||||
|
||||
jsr joy_install ; Call driver install routine
|
||||
tay ; Test error code
|
||||
bne @L2 ; Bail out if install had errors
|
||||
|
||||
; Install the IRQ vector if the driver needs it. A/X contains the error code
|
||||
; from joy_install, so don't use it.
|
||||
|
||||
ldy joy_irq+2 ; Check high byte of IRQ vector
|
||||
beq @L2 ; Jump if vector invalid
|
||||
ldy #$4C ; JMP opcode
|
||||
sty joy_irq ; Activate IRQ routine
|
||||
@L2: rts
|
||||
jmp joy_install ; Call driver install routine
|
||||
|
||||
; Driver signature invalid
|
||||
|
||||
@ -108,9 +95,6 @@ copy: lda (ptr1),y
|
||||
; */
|
||||
|
||||
_joy_uninstall:
|
||||
lda #$60 ; RTS opcode
|
||||
sta joy_irq ; Disable IRQ entry point
|
||||
|
||||
jsr joy_uninstall ; Call the driver routine
|
||||
|
||||
_joy_clear_ptr: ; External entry point
|
||||
|
@ -8,5 +8,3 @@
|
||||
.include "joy-kernel.inc"
|
||||
|
||||
_joy_read = joy_read ; Use driver entry
|
||||
|
||||
|
||||
|
@ -37,7 +37,6 @@
|
||||
.addr UNINSTALL
|
||||
.addr COUNT
|
||||
.addr READ
|
||||
.addr 0 ; IRQ entry unused
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Constants
|
||||
|
@ -35,7 +35,6 @@
|
||||
.addr UNINSTALL
|
||||
.addr COUNT
|
||||
.addr READJOY
|
||||
.addr 0 ; IRQ entry unused
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Constants
|
||||
|
@ -30,7 +30,6 @@
|
||||
.addr UNINSTALL
|
||||
.addr COUNT
|
||||
.addr READJOY
|
||||
.addr 0 ; IRQ entry unused
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Constants
|
||||
|
@ -34,7 +34,6 @@
|
||||
.addr UNINSTALL
|
||||
.addr COUNT
|
||||
.addr READ
|
||||
.addr 0 ; IRQ entry unused
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Constants
|
||||
|
@ -33,7 +33,6 @@
|
||||
.addr UNINSTALL
|
||||
.addr COUNT
|
||||
.addr READ
|
||||
.addr 0 ; IRQ entry unused
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Constants
|
||||
|
@ -37,7 +37,6 @@
|
||||
.addr UNINSTALL
|
||||
.addr COUNT
|
||||
.addr READ
|
||||
.addr 0 ; IRQ entry unused
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Constants
|
||||
|
@ -29,7 +29,6 @@
|
||||
.addr UNINSTALL
|
||||
.addr COUNT
|
||||
.addr READJOY
|
||||
.addr 0 ; IRQ entry unused
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Constants
|
||||
|
@ -36,7 +36,6 @@
|
||||
.addr UNINSTALL
|
||||
.addr COUNT
|
||||
.addr READ
|
||||
.addr 0 ; IRQ entry unused
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Constants
|
||||
|
@ -36,7 +36,6 @@
|
||||
.addr UNINSTALL
|
||||
.addr COUNT
|
||||
.addr READ
|
||||
.addr 0 ; IRQ entry unused
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Constants
|
||||
|
Loading…
Reference in New Issue
Block a user