-
+
-
-
+[
+]
(incomplete)
@@ -437,10 +437,10 @@ function.
-
+
-
-
+[
+]
(incomplete)
@@ -455,10 +455,10 @@ It does not declare any functions.
-
+
-
-
+[
+]
(incomplete)
@@ -7612,6 +7612,23 @@ used in presence of a prototype.
+waitvsync
+
+
+
+/,
+/,
+/
+
+
+
+
wherex
diff --git a/doc/gamate.sgml b/doc/gamate.sgml
index 14b1a27e9..0948c20c4 100644
--- a/doc/gamate.sgml
+++ b/doc/gamate.sgml
@@ -44,6 +44,13 @@ by an external program. Such an utility is provided in util/gamate/gamate-fixcar
Programs containing Gamate specific code may use the Gamate specific functions
+
+
+- waitvsync
+
+
+
Hardware access
The following pseudo variables declared in the Watara Supervision specific information for cc65
-2014-04-12
+2017-11-21
An overview over the Supervision runtime system as it is implemented for the
@@ -63,14 +63,6 @@ Special locations:
Programs containing Supervision specific code may use the Supervision specific functions
-
-
-- waitvsync
-
-
-
-
Hardware access
The following pseudo variables declared in the Joystick drivers
-No joystick drivers are currently available for the Supervision.
-
+
+
+
+ A joystick driver for the standard two buttons joypad is available.
+
+
Mouse drivers
diff --git a/include/supervision.h b/include/supervision.h
index ffece4ecb..f3ae1c25e 100644
--- a/include/supervision.h
+++ b/include/supervision.h
@@ -105,9 +105,33 @@ extern unsigned char sv_nmi_counter;
extern unsigned char sv_timer_irq_counter;
extern unsigned char sv_timer_dma_counter;
+/* Masks for joy_read */
+#define JOY_UP_MASK 0x08
+#define JOY_DOWN_MASK 0x04
+#define JOY_LEFT_MASK 0x02
+#define JOY_RIGHT_MASK 0x01
+#define JOY_BTN_1_MASK 0x20
+#define JOY_BTN_2_MASK 0x10
+#define JOY_BTN_3_MASK 0x80
+#define JOY_BTN_4_MASK 0x40
+
+#define JOY_BTN_A_MASK JOY_BTN_1_MASK
+#define JOY_BTN_B_MASk JOY_BTN_2_MASK
+#define JOY_START_MASK JOY_BTN_3_MASK
+#define JOY_SELECT_MASK JOY_BTN_4_MASK
+
+#define JOY_BTN_A(v) ((v) & JOY_BTN_A_MASK)
+#define JOY_BTN_B(v) ((v) & JOY_BTN_B_MASK)
+#define JOY_START(v) ((v) & JOY_START_MASK)
+#define JOY_SELECT(v) ((v) & JOY_SELECT_MASK)
+
+/* No support for dynamically loadable drivers */
+#define DYN_DRV 0
+
+/* The addresses of the static drivers */
+extern void supervision_stdjoy_joy[]; /* Referred to by joy_static_stddrv[] */
+
/* End of supervision.h */
#endif
-
-
diff --git a/libsrc/gamate/joy_stat_stddrv.s b/libsrc/gamate/joy_stat_stddrv.s
index 75016450a..94537b210 100644
--- a/libsrc/gamate/joy_stat_stddrv.s
+++ b/libsrc/gamate/joy_stat_stddrv.s
@@ -9,6 +9,4 @@
.export _joy_static_stddrv
.import _gamate_stdjoy_joy
-.rodata
-
_joy_static_stddrv := _gamate_stdjoy_joy
diff --git a/libsrc/supervision/joy/supervision-stdjoy.s b/libsrc/supervision/joy/supervision-stdjoy.s
new file mode 100644
index 000000000..f6a325740
--- /dev/null
+++ b/libsrc/supervision/joy/supervision-stdjoy.s
@@ -0,0 +1,82 @@
+;
+; Standard joystick driver for the Supervision
+;
+
+ .include "joy-kernel.inc"
+ .include "joy-error.inc"
+ .include "supervision.inc"
+
+ .macpack module
+
+
+; ------------------------------------------------------------------------
+; Header. Includes jump table
+
+ module_header _supervision_stdjoy_joy
+
+; Driver signature
+
+ .byte $6A, $6F, $79 ; "joy"
+ .byte JOY_API_VERSION ; Driver API version number
+
+; Library reference
+
+ .addr $0000
+
+; Jump table.
+
+ .addr INSTALL
+ .addr UNINSTALL
+ .addr COUNT
+ .addr READJOY
+ .addr 0 ; IRQ entry unused
+
+; ------------------------------------------------------------------------
+; Constants
+
+JOY_COUNT = 1 ; Number of joysticks we support
+
+
+.code
+
+; ------------------------------------------------------------------------
+; INSTALL routine. Is called after the driver is loaded into memory. If
+; possible, check if the hardware is present and determine the amount of
+; memory available.
+; Must return an JOY_ERR_xx code in a/x.
+;
+
+INSTALL:
+ lda #JOY_ERR_OK
+
+; rts ; Run into UNINSTALL instead
+
+; ------------------------------------------------------------------------
+; DEINSTALL routine. Is called before the driver is removed from memory.
+; Can do cleanup or whatever. Must not return anything.
+;
+
+UNINSTALL:
+ rts
+
+
+; ------------------------------------------------------------------------
+; COUNT: Return the total number of available joysticks in a/x.
+;
+;unsigned char __fastcall__ joy_count (void);
+
+COUNT:
+ lda #JOY_COUNT
+ rts
+
+; ------------------------------------------------------------------------
+; READ: Read a particular joystick passed in A.
+;
+;unsigned char __fastcall__ joy_read (unsigned char joystick);
+
+READJOY:
+ lda sv_control
+ ldx #0
+ rts
diff --git a/libsrc/supervision/joy_stat_stddrv.s b/libsrc/supervision/joy_stat_stddrv.s
new file mode 100644
index 000000000..4daa13e34
--- /dev/null
+++ b/libsrc/supervision/joy_stat_stddrv.s
@@ -0,0 +1,12 @@
+;
+; Address of the static standard joystick driver
+;
+; Oliver Schmidt, 2012-11-01
+;
+; const void joy_static_stddrv[];
+;
+
+ .export _joy_static_stddrv
+ .import _supervision_stdjoy_joy
+
+_joy_static_stddrv := _supervision_stdjoy_joy