1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-27 00:29:31 +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:
Oliver Schmidt 2018-02-01 22:38:36 +01:00
parent 27dacca4d3
commit 1976d6cd32
27 changed files with 2 additions and 56 deletions

View File

@ -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

View File

@ -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
; ------------------------------------------------------------------------

View File

@ -41,7 +41,6 @@
.addr UNINSTALL
.addr COUNT
.addr READJOY
.addr 0 ; IRQ entry not used
; ------------------------------------------------------------------------
; Constants

View File

@ -40,7 +40,6 @@
.addr UNINSTALL
.addr COUNT
.addr READJOY
.addr 0 ; IRQ entry not used
; ------------------------------------------------------------------------
; Constants

View File

@ -33,7 +33,6 @@
.addr UNINSTALL
.addr COUNT
.addr READJOY
.addr 0 ; IRQ entry not used
.code

View File

@ -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

View File

@ -34,7 +34,6 @@
.addr UNINSTALL
.addr COUNT
.addr READ
.addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants

View File

@ -36,7 +36,6 @@
.addr UNINSTALL
.addr COUNT
.addr READ
.addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants

View File

@ -36,7 +36,6 @@
.addr UNINSTALL
.addr COUNT
.addr READ
.addr 0 ; IRQ entry not used
; ------------------------------------------------------------------------
; Constants

View File

@ -35,7 +35,6 @@
.addr UNINSTALL
.addr COUNT
.addr READ
.addr IRQ
; ------------------------------------------------------------------------
; Constants

View File

@ -36,7 +36,6 @@
.addr UNINSTALL
.addr COUNT
.addr READ
.addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants

View File

@ -35,7 +35,6 @@
.addr UNINSTALL
.addr COUNT
.addr READ
.addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants

View File

@ -35,7 +35,6 @@
.addr UNINSTALL
.addr COUNT
.addr READ
.addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants

View File

@ -36,7 +36,6 @@
.addr UNINSTALL
.addr COUNT
.addr READ
.addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants

View File

@ -33,7 +33,6 @@
.addr UNINSTALL
.addr COUNT
.addr READJOY
.addr 0 ; IRQ entry not used
; ------------------------------------------------------------------------
; Constants

View File

@ -30,7 +30,6 @@
.addr UNINSTALL
.addr COUNT
.addr READJOY
.addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants

View File

@ -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

View File

@ -8,5 +8,3 @@
.include "joy-kernel.inc"
_joy_read = joy_read ; Use driver entry

View File

@ -37,7 +37,6 @@
.addr UNINSTALL
.addr COUNT
.addr READ
.addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants

View File

@ -35,7 +35,6 @@
.addr UNINSTALL
.addr COUNT
.addr READJOY
.addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants

View File

@ -30,7 +30,6 @@
.addr UNINSTALL
.addr COUNT
.addr READJOY
.addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants

View File

@ -34,7 +34,6 @@
.addr UNINSTALL
.addr COUNT
.addr READ
.addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants

View File

@ -33,7 +33,6 @@
.addr UNINSTALL
.addr COUNT
.addr READ
.addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants

View File

@ -37,7 +37,6 @@
.addr UNINSTALL
.addr COUNT
.addr READ
.addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants

View File

@ -29,7 +29,6 @@
.addr UNINSTALL
.addr COUNT
.addr READJOY
.addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants

View File

@ -36,7 +36,6 @@
.addr UNINSTALL
.addr COUNT
.addr READ
.addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants

View File

@ -36,7 +36,6 @@
.addr UNINSTALL
.addr COUNT
.addr READ
.addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants