From: Oliver Schmidt
Date: Thu, 1 Feb 2018 21:38:36 +0000 (+0100)
Subject: Removed IRQ support from joystick drivers.
X-Git-Tag: V2.17~32
X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=1976d6cd32f909babc5f6f26c9c068f47abb95bc;p=cc65
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.
---
diff --git a/asminc/joy-kernel.inc b/asminc/joy-kernel.inc
index c8cc29820..ef729fe3c 100644
--- a/asminc/joy-kernel.inc
+++ b/asminc/joy-kernel.inc
@@ -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
diff --git a/libsrc/apple2/joy/a2.stdjoy.s b/libsrc/apple2/joy/a2.stdjoy.s
index ed2083255..7e90f7b98 100644
--- a/libsrc/apple2/joy/a2.stdjoy.s
+++ b/libsrc/apple2/joy/a2.stdjoy.s
@@ -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
; ------------------------------------------------------------------------
diff --git a/libsrc/atari/joy/atrmj8.s b/libsrc/atari/joy/atrmj8.s
index 0e8cd2a0a..9b02485d6 100644
--- a/libsrc/atari/joy/atrmj8.s
+++ b/libsrc/atari/joy/atrmj8.s
@@ -41,7 +41,6 @@
.addr UNINSTALL
.addr COUNT
.addr READJOY
- .addr 0 ; IRQ entry not used
; ------------------------------------------------------------------------
; Constants
diff --git a/libsrc/atari/joy/atrstd.s b/libsrc/atari/joy/atrstd.s
index 0c8799e21..0c49499f8 100644
--- a/libsrc/atari/joy/atrstd.s
+++ b/libsrc/atari/joy/atrstd.s
@@ -40,7 +40,6 @@
.addr UNINSTALL
.addr COUNT
.addr READJOY
- .addr 0 ; IRQ entry not used
; ------------------------------------------------------------------------
; Constants
diff --git a/libsrc/atari5200/joy/atr5200std.s b/libsrc/atari5200/joy/atr5200std.s
index 0b8b93b63..041dc6830 100644
--- a/libsrc/atari5200/joy/atr5200std.s
+++ b/libsrc/atari5200/joy/atr5200std.s
@@ -33,7 +33,6 @@
.addr UNINSTALL
.addr COUNT
.addr READJOY
- .addr 0 ; IRQ entry not used
.code
diff --git a/libsrc/atmos/joy/atmos-ijk.s b/libsrc/atmos/joy/atmos-ijk.s
index f59f6b96a..6e75a3e0b 100644
--- a/libsrc/atmos/joy/atmos-ijk.s
+++ b/libsrc/atmos/joy/atmos-ijk.s
@@ -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
diff --git a/libsrc/atmos/joy/atmos-pase.s b/libsrc/atmos/joy/atmos-pase.s
index 637571c04..fd64901c9 100644
--- a/libsrc/atmos/joy/atmos-pase.s
+++ b/libsrc/atmos/joy/atmos-pase.s
@@ -34,7 +34,6 @@
.addr UNINSTALL
.addr COUNT
.addr READ
- .addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants
diff --git a/libsrc/c128/joy/c128-ptvjoy.s b/libsrc/c128/joy/c128-ptvjoy.s
index c9ae39a47..180f7667d 100644
--- a/libsrc/c128/joy/c128-ptvjoy.s
+++ b/libsrc/c128/joy/c128-ptvjoy.s
@@ -36,7 +36,6 @@
.addr UNINSTALL
.addr COUNT
.addr READ
- .addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants
diff --git a/libsrc/c128/joy/c128-stdjoy.s b/libsrc/c128/joy/c128-stdjoy.s
index 943361da5..bf2e2fea7 100644
--- a/libsrc/c128/joy/c128-stdjoy.s
+++ b/libsrc/c128/joy/c128-stdjoy.s
@@ -36,7 +36,6 @@
.addr UNINSTALL
.addr COUNT
.addr READ
- .addr 0 ; IRQ entry not used
; ------------------------------------------------------------------------
; Constants
diff --git a/libsrc/c64/joy/c64-hitjoy.s b/libsrc/c64/joy/c64-hitjoy.s
index 10c936399..9f6c0b4dd 100644
--- a/libsrc/c64/joy/c64-hitjoy.s
+++ b/libsrc/c64/joy/c64-hitjoy.s
@@ -35,7 +35,6 @@
.addr UNINSTALL
.addr COUNT
.addr READ
- .addr IRQ
; ------------------------------------------------------------------------
; Constants
diff --git a/libsrc/c64/joy/c64-numpad.s b/libsrc/c64/joy/c64-numpad.s
index 5ed7af187..0ccdc4fcd 100644
--- a/libsrc/c64/joy/c64-numpad.s
+++ b/libsrc/c64/joy/c64-numpad.s
@@ -36,7 +36,6 @@
.addr UNINSTALL
.addr COUNT
.addr READ
- .addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants
diff --git a/libsrc/c64/joy/c64-ptvjoy.s b/libsrc/c64/joy/c64-ptvjoy.s
index af5c27e13..a772fb5f6 100644
--- a/libsrc/c64/joy/c64-ptvjoy.s
+++ b/libsrc/c64/joy/c64-ptvjoy.s
@@ -35,7 +35,6 @@
.addr UNINSTALL
.addr COUNT
.addr READ
- .addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants
diff --git a/libsrc/c64/joy/c64-stdjoy.s b/libsrc/c64/joy/c64-stdjoy.s
index 930ad6227..c983d81bb 100644
--- a/libsrc/c64/joy/c64-stdjoy.s
+++ b/libsrc/c64/joy/c64-stdjoy.s
@@ -35,7 +35,6 @@
.addr UNINSTALL
.addr COUNT
.addr READ
- .addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants
diff --git a/libsrc/cbm510/joy/cbm510-std.s b/libsrc/cbm510/joy/cbm510-std.s
index 0c2efc12d..4e47fc1a0 100644
--- a/libsrc/cbm510/joy/cbm510-std.s
+++ b/libsrc/cbm510/joy/cbm510-std.s
@@ -36,7 +36,6 @@
.addr UNINSTALL
.addr COUNT
.addr READ
- .addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants
diff --git a/libsrc/creativision/joy/creativision-stdjoy.s b/libsrc/creativision/joy/creativision-stdjoy.s
index 9a5afc42b..5cf46c39f 100644
--- a/libsrc/creativision/joy/creativision-stdjoy.s
+++ b/libsrc/creativision/joy/creativision-stdjoy.s
@@ -33,7 +33,6 @@
.addr UNINSTALL
.addr COUNT
.addr READJOY
- .addr 0 ; IRQ entry not used
; ------------------------------------------------------------------------
; Constants
diff --git a/libsrc/gamate/joy/gamate-stdjoy.s b/libsrc/gamate/joy/gamate-stdjoy.s
index 801b40acd..8f927cdf5 100644
--- a/libsrc/gamate/joy/gamate-stdjoy.s
+++ b/libsrc/gamate/joy/gamate-stdjoy.s
@@ -30,7 +30,6 @@
.addr UNINSTALL
.addr COUNT
.addr READJOY
- .addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants
diff --git a/libsrc/joystick/joy-kernel.s b/libsrc/joystick/joy-kernel.s
index 0746709e9..c2d50c8d8 100644
--- a/libsrc/joystick/joy-kernel.s
+++ b/libsrc/joystick/joy-kernel.s
@@ -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
diff --git a/libsrc/joystick/joy_read.s b/libsrc/joystick/joy_read.s
index f76d9dfb7..151600aee 100644
--- a/libsrc/joystick/joy_read.s
+++ b/libsrc/joystick/joy_read.s
@@ -8,5 +8,3 @@
.include "joy-kernel.inc"
_joy_read = joy_read ; Use driver entry
-
-
diff --git a/libsrc/lynx/joy/lynx-stdjoy.s b/libsrc/lynx/joy/lynx-stdjoy.s
index 2e91cc43b..c81a97dbf 100644
--- a/libsrc/lynx/joy/lynx-stdjoy.s
+++ b/libsrc/lynx/joy/lynx-stdjoy.s
@@ -37,7 +37,6 @@
.addr UNINSTALL
.addr COUNT
.addr READ
- .addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants
diff --git a/libsrc/nes/joy/nes-stdjoy.s b/libsrc/nes/joy/nes-stdjoy.s
index 3032e9330..63caf364b 100644
--- a/libsrc/nes/joy/nes-stdjoy.s
+++ b/libsrc/nes/joy/nes-stdjoy.s
@@ -35,7 +35,6 @@
.addr UNINSTALL
.addr COUNT
.addr READJOY
- .addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants
diff --git a/libsrc/pce/joy/pce-stdjoy.s b/libsrc/pce/joy/pce-stdjoy.s
index ab25134dd..c0f338f90 100644
--- a/libsrc/pce/joy/pce-stdjoy.s
+++ b/libsrc/pce/joy/pce-stdjoy.s
@@ -30,7 +30,6 @@
.addr UNINSTALL
.addr COUNT
.addr READJOY
- .addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants
diff --git a/libsrc/pet/joy/pet-ptvjoy.s b/libsrc/pet/joy/pet-ptvjoy.s
index 3bb368355..7620013be 100644
--- a/libsrc/pet/joy/pet-ptvjoy.s
+++ b/libsrc/pet/joy/pet-ptvjoy.s
@@ -34,7 +34,6 @@
.addr UNINSTALL
.addr COUNT
.addr READ
- .addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants
diff --git a/libsrc/pet/joy/pet-stdjoy.s b/libsrc/pet/joy/pet-stdjoy.s
index 29c6de627..85b742302 100644
--- a/libsrc/pet/joy/pet-stdjoy.s
+++ b/libsrc/pet/joy/pet-stdjoy.s
@@ -33,7 +33,6 @@
.addr UNINSTALL
.addr COUNT
.addr READ
- .addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants
diff --git a/libsrc/plus4/joy/plus4-stdjoy.s b/libsrc/plus4/joy/plus4-stdjoy.s
index d998b2699..e8e85fedc 100644
--- a/libsrc/plus4/joy/plus4-stdjoy.s
+++ b/libsrc/plus4/joy/plus4-stdjoy.s
@@ -37,7 +37,6 @@
.addr UNINSTALL
.addr COUNT
.addr READ
- .addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants
diff --git a/libsrc/supervision/joy/supervision-stdjoy.s b/libsrc/supervision/joy/supervision-stdjoy.s
index f6a325740..d233a8600 100644
--- a/libsrc/supervision/joy/supervision-stdjoy.s
+++ b/libsrc/supervision/joy/supervision-stdjoy.s
@@ -29,7 +29,6 @@
.addr UNINSTALL
.addr COUNT
.addr READJOY
- .addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants
diff --git a/libsrc/vic20/joy/vic20-ptvjoy.s b/libsrc/vic20/joy/vic20-ptvjoy.s
index 3b1db402a..bf0ff128e 100644
--- a/libsrc/vic20/joy/vic20-ptvjoy.s
+++ b/libsrc/vic20/joy/vic20-ptvjoy.s
@@ -36,7 +36,6 @@
.addr UNINSTALL
.addr COUNT
.addr READ
- .addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants
diff --git a/libsrc/vic20/joy/vic20-stdjoy.s b/libsrc/vic20/joy/vic20-stdjoy.s
index 67299cc1a..e5539c653 100644
--- a/libsrc/vic20/joy/vic20-stdjoy.s
+++ b/libsrc/vic20/joy/vic20-stdjoy.s
@@ -36,7 +36,6 @@
.addr UNINSTALL
.addr COUNT
.addr READ
- .addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants