mirror of
https://github.com/cc65/cc65.git
synced 2025-01-12 02:30:44 +00:00
Added library reference joy_libref to JOY interface.
This commit is contained in:
parent
619b215260
commit
23650cb946
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
8
libsrc/atmos/libref.s
Normal file
@ -0,0 +1,8 @@
|
||||
;
|
||||
; Oliver Schmidt, 2013-05-31
|
||||
;
|
||||
|
||||
.export joy_libref
|
||||
.import _exit
|
||||
|
||||
joy_libref := _exit
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
8
libsrc/lynx/libref.s
Normal file
@ -0,0 +1,8 @@
|
||||
;
|
||||
; Oliver Schmidt, 2013-05-31
|
||||
;
|
||||
|
||||
.export joy_libref
|
||||
.import _exit
|
||||
|
||||
joy_libref := _exit
|
@ -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
8
libsrc/nes/libref.s
Normal file
@ -0,0 +1,8 @@
|
||||
;
|
||||
; Oliver Schmidt, 2013-05-31
|
||||
;
|
||||
|
||||
.export joy_libref
|
||||
.import _exit
|
||||
|
||||
joy_libref := _exit
|
@ -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
|
||||
|
@ -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
8
libsrc/pet/libref.s
Normal file
@ -0,0 +1,8 @@
|
||||
;
|
||||
; Oliver Schmidt, 2013-05-31
|
||||
;
|
||||
|
||||
.export joy_libref
|
||||
.import _exit
|
||||
|
||||
joy_libref := _exit
|
@ -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
8
libsrc/plus4/libref.s
Normal file
@ -0,0 +1,8 @@
|
||||
;
|
||||
; Oliver Schmidt, 2013-05-31
|
||||
;
|
||||
|
||||
.export joy_libref
|
||||
.import _exit
|
||||
|
||||
joy_libref := _exit
|
@ -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
|
||||
|
@ -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
8
libsrc/vic20/libref.s
Normal file
@ -0,0 +1,8 @@
|
||||
;
|
||||
; Oliver Schmidt, 2013-05-31
|
||||
;
|
||||
|
||||
.export joy_libref
|
||||
.import _exit
|
||||
|
||||
joy_libref := _exit
|
Loading…
x
Reference in New Issue
Block a user