;/* */
;/* */
;/* */
-;/* (C) 2002 Ullrich von Bassewitz */
-;/* Wacholderweg 14 */
-;/* D-70597 Stuttgart */
-;/* EMail: uz@musoftware.de */
+;/* (C) 2002-2006, Ullrich von Bassewitz */
+;/* Römerstraße 52 */
+;/* D-70794 Filderstadt */
+;/* EMail: uz@cc65.org */
;/* */
;/* */
;/* This software is provided 'as-is', without any expressed or implied */
;------------------------------------------------------------------------------
; Driver header stuff
-JOY_HDR_ID = 0 ; $6A, $6F, $79 ("joy")
-JOY_HDR_VERSION = 3 ; Interface version
+.struct JOY_HDR
+ ID .byte 3 ; $6A, $6F, $79 ("joy")
+ VERSION .byte 1 ; Interface version
+ LIBREF .addr ; Library reference
+ JUMPTAB .struct
+ INSTALL .addr ; INSTALL routine
+ UNINSTALL .addr ; UNINSTALL routine
+ COUNT .addr ; COUNT routine
+ READ .addr ; READ routine
+ .endstruct
+.endstruct
-JOY_MASKS = 4 ; Joystick state mask array
-JOY_MASK_COUNT = 8 ; Size of the array
-
-JOY_HDR_JUMPTAB = 12
-JOY_HDR_INSTALL = JOY_HDR_JUMPTAB+0 ; INSTALL routine
-JOY_HDR_DEINSTALL = JOY_HDR_JUMPTAB+2 ; DEINSTALL routine
-JOY_HDR_COUNT = JOY_HDR_JUMPTAB+4 ; COUNT routine
-JOY_HDR_READ = JOY_HDR_JUMPTAB+6 ; READ routine
+;------------------------------------------------------------------------------
+; The JOY API version, stored in JOY_HDR::VERSION
-JOY_HDR_JUMPCOUNT = 4 ; Number of jump vectors
+JOY_API_VERSION = $05
;------------------------------------------------------------------------------
; Variables
- .global _joy_drv ; Pointer to driver
+ .global _joy_drv ; Pointer to driver
+ .global _joy_masks
;------------------------------------------------------------------------------
; Driver entry points
.global joy_install
- .global joy_deinstall
+ .global joy_uninstall
.global joy_count
.global joy_read
;------------------------------------------------------------------------------
-; ASM functions
+; C callable functions
- .global _joy_install
- .global _joy_deinstall
- .global _joy_count
- .global _joy_read
+ .global _joy_load_driver
+ .global _joy_unload
+ .global _joy_install
+ .global _joy_uninstall
+ .global _joy_count
+ .global _joy_read
+ .global _joy_clear_ptr