1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-09 06:29:38 +00:00

Added library reference joy_libref to JOY interface.

This commit is contained in:
Oliver Schmidt 2013-06-01 00:36:08 +02:00
parent 619b215260
commit 23650cb946
34 changed files with 155 additions and 14 deletions

View File

@ -42,20 +42,21 @@
.struct JOY_HDR
ID .byte 3 ; $6A, $6F, $79 ("joy")
VERSION .byte 1 ; Interface version
LIBREF .addr ; Library reference
MASKS .byte 8 ; Joystick state mask array
JUMPTAB .struct
INSTALL .word ; INSTALL routine
UNINSTALL .word ; UNINSTALL routine
COUNT .word ; COUNT routine
READ .word ; READ routine
IRQ .word ; IRQ routine
INSTALL .addr ; INSTALL routine
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 = $01
JOY_API_VERSION = $02
;------------------------------------------------------------------------------
; Variables
@ -82,4 +83,3 @@ JOY_API_VERSION = $01
.global _joy_read
.global _joy_clear_ptr

View File

@ -36,6 +36,10 @@ PREAD := $FB1E ; Read paddle in X, return AD conv. value in Y
.byte $6A, $6F, $79 ; "joy"
.byte JOY_API_VERSION ; Driver API version number
; Library reference
.addr $0000
; Button state masks (8 values)
.byte $10

View File

@ -2,7 +2,8 @@
; Oliver Schmidt, 2013-05-31
;
.export em_libref
.export em_libref, joy_libref
.import _exit
em_libref := _exit
joy_libref := _exit

View File

@ -26,6 +26,10 @@
.byte $6A, $6F, $79 ; "joy"
.byte JOY_API_VERSION ; Driver API version number
; Library reference
.addr $0000
; Button state masks (8 values)
.byte $02 ; JOY_UP

View File

@ -25,6 +25,10 @@
.byte $6A, $6F, $79 ; "joy"
.byte JOY_API_VERSION ; Driver API version number
; Library reference
.addr $0000
; Button state masks (8 values)
.byte $01 ; JOY_UP

View File

@ -2,7 +2,8 @@
; Oliver Schmidt, 2013-05-31
;
.export em_libref
.export em_libref, joy_libref
.import _exit
em_libref := _exit
joy_libref := _exit

View File

@ -21,6 +21,10 @@
.byte $6A, $6F, $79 ; "joy"
.byte JOY_API_VERSION ; Driver API version number
; Library reference
.addr $0000
; Button state masks (8 values)
.byte $10 ; JOY_UP

8
libsrc/atmos/libref.s Normal file
View File

@ -0,0 +1,8 @@
;
; Oliver Schmidt, 2013-05-31
;
.export joy_libref
.import _exit
joy_libref := _exit

View File

@ -24,6 +24,10 @@
.byte $6A, $6F, $79 ; "joy"
.byte JOY_API_VERSION ; Driver API version number
; Library reference
.addr $0000
; Button state masks (8 values)
.byte $01 ; JOY_UP

View File

@ -25,6 +25,10 @@
.byte $6A, $6F, $79 ; "joy"
.byte JOY_API_VERSION ; Driver API version number
; Library reference
.addr $0000
; Button state masks (8 values)
.byte $01 ; JOY_UP

View File

@ -2,7 +2,8 @@
; Oliver Schmidt, 2013-05-31
;
.export em_libref
.export em_libref, joy_libref
.import _exit
em_libref := _exit
joy_libref := _exit

View File

@ -2,7 +2,8 @@
; Oliver Schmidt, 2013-05-31
;
.export em_libref
.export em_libref, joy_libref
.import _exit
em_libref := _exit
joy_libref := _exit

View File

@ -23,6 +23,10 @@
.byte $6A, $6F, $79 ; "joy"
.byte JOY_API_VERSION ; Driver API version number
; Library reference
.addr $0000
; Button state masks (8 values)
.byte $01 ; JOY_UP

View File

@ -25,6 +25,10 @@
.byte $6A, $6F, $79 ; "joy"
.byte JOY_API_VERSION ; Driver API version number
; Library reference
.addr $0000
; Button state masks (8 values)
.byte $02 ; JOY_UP "8"

View File

@ -23,6 +23,10 @@
.byte $6A, $6F, $79 ; "joy"
.byte JOY_API_VERSION ; Driver API version number
; Library reference
.addr $0000
; Button state masks (8 values)
.byte $01 ; JOY_UP

View File

@ -24,6 +24,10 @@
.byte $6A, $6F, $79 ; "joy"
.byte JOY_API_VERSION ; Driver API version number
; Library reference
.addr $0000
; Button state masks (8 values)
.byte $01 ; JOY_UP

View File

@ -2,7 +2,8 @@
; Oliver Schmidt, 2013-05-31
;
.export em_libref
.export em_libref, joy_libref
.import _exit
em_libref := _exit
joy_libref := _exit

View File

@ -25,6 +25,10 @@
.byte $6A, $6F, $79 ; "joy"
.byte JOY_API_VERSION ; Driver API version number
; Library reference
.addr $0000
; Button state masks (8 values)
.byte $01 ; JOY_UP

View File

@ -2,7 +2,8 @@
; Oliver Schmidt, 2013-05-31
;
.export em_libref
.export em_libref, joy_libref
.import _exit
em_libref := _exit
joy_libref := _exit

View File

@ -22,6 +22,10 @@
.byte $6A, $6F, $79 ; "joy"
.byte JOY_API_VERSION ; Driver API version number
; Library reference
.addr $0000
; Button state masks (8 values)
.byte $01 ; JOY_UP

View File

@ -2,7 +2,8 @@
; Oliver Schmidt, 2013-05-31
;
.export em_libref
.export em_libref, joy_libref
.import _exit
em_libref := _exit
joy_libref := _exit

View File

@ -4,6 +4,7 @@
; Common functions of the joystick API.
;
.import joy_libref
.importzp ptr1
.interruptor joy_irq ; Export as IRQ handler
@ -55,6 +56,15 @@ _joy_install:
dey
bpl @L0
; Set the library reference
ldy #JOY_HDR::LIBREF
lda #<joy_libref
sta (ptr1),y
iny
lda #>joy_libref
sta (ptr1),y
; Copy the mask array
ldy #JOY_HDR::MASKS + .sizeof(JOY_HDR::MASKS) - 1

View File

@ -26,6 +26,10 @@
.byte $6A, $6F, $79 ; "joy"
.byte JOY_API_VERSION ; Driver API version number
; Library reference
.addr $0000
; Button state masks (8 values)
joy_mask:

8
libsrc/lynx/libref.s Normal file
View File

@ -0,0 +1,8 @@
;
; Oliver Schmidt, 2013-05-31
;
.export joy_libref
.import _exit
joy_libref := _exit

View File

@ -23,6 +23,10 @@
.byte $6A, $6F, $79 ; "joy"
.byte JOY_API_VERSION ; Driver API version number
; Library reference
.addr $0000
; Button state masks (8 values)
.byte $10 ; JOY_UP

8
libsrc/nes/libref.s Normal file
View File

@ -0,0 +1,8 @@
;
; Oliver Schmidt, 2013-05-31
;
.export joy_libref
.import _exit
joy_libref := _exit

View File

@ -24,6 +24,10 @@ VIA_DDRA := $E843 ; Data direction register A
.byte $6A, $6F, $79 ; "joy"
.byte JOY_API_VERSION ; Driver API version number
; Library reference
.addr $0000
; Button state masks (8 values)
.byte $01 ; JOY_UP

View File

@ -21,6 +21,10 @@
.byte $6A, $6F, $79 ; "joy"
.byte JOY_API_VERSION ; Driver API version number
; Library reference
.addr $0000
; Button state masks (8 values)
.byte $01 ; JOY_UP

8
libsrc/pet/libref.s Normal file
View File

@ -0,0 +1,8 @@
;
; Oliver Schmidt, 2013-05-31
;
.export joy_libref
.import _exit
joy_libref := _exit

View File

@ -24,6 +24,10 @@
.byte $6A, $6F, $79 ; "joy"
.byte JOY_API_VERSION ; Driver API version number
; Library reference
.addr $0000
; Button state masks (8 values)
.byte $01 ; JOY_UP

8
libsrc/plus4/libref.s Normal file
View File

@ -0,0 +1,8 @@
;
; Oliver Schmidt, 2013-05-31
;
.export joy_libref
.import _exit
joy_libref := _exit

View File

@ -23,6 +23,10 @@
.byte $6A, $6F, $79 ; "joy"
.byte JOY_API_VERSION ; Driver API version number
; Library reference
.addr $0000
; Button state masks (8 values)
.byte $01 ; JOY_UP

View File

@ -25,6 +25,10 @@
.byte $6A, $6F, $79 ; "joy"
.byte JOY_API_VERSION ; Driver API version number
; Library reference
.addr $0000
; Button state masks (8 values)
.byte $02 ; JOY_UP

8
libsrc/vic20/libref.s Normal file
View File

@ -0,0 +1,8 @@
;
; Oliver Schmidt, 2013-05-31
;
.export joy_libref
.import _exit
joy_libref := _exit