mirror of
https://github.com/cc65/cc65.git
synced 2024-10-15 20:25:22 +00:00
Merge pull request #529 from polluks/master
Added standard joystick driver for the Supervision.
This commit is contained in:
commit
3f8de9f026
@ -4,7 +4,7 @@
|
|||||||
<title>cc65 function reference
|
<title>cc65 function reference
|
||||||
<author><url url="mailto:uz@cc65.org" name="Ullrich von Bassewitz">,<newline>
|
<author><url url="mailto:uz@cc65.org" name="Ullrich von Bassewitz">,<newline>
|
||||||
<url url="mailto:greg.king5@verizon.net" name="Greg King">
|
<url url="mailto:greg.king5@verizon.net" name="Greg King">
|
||||||
<date>2017-09-02
|
<date>2017-11-21
|
||||||
|
|
||||||
<abstract>
|
<abstract>
|
||||||
cc65 is a C compiler for 6502 based systems. This function reference describes
|
cc65 is a C compiler for 6502 based systems. This function reference describes
|
||||||
@ -352,10 +352,10 @@ function.
|
|||||||
|
|
||||||
<sect1><tt/gamate.h/<label id="gamate.h"><p>
|
<sect1><tt/gamate.h/<label id="gamate.h"><p>
|
||||||
|
|
||||||
<!-- <itemize> -->
|
<itemize>
|
||||||
<!-- <item><ref id="get_tv" name="get_tv"> -->
|
<!-- <item><ref id="get_tv" name="get_tv"> -->
|
||||||
<!-- <item><ref id="waitvblank" name="waitvblank"> -->
|
<item><ref id="waitvsync" name="waitvsync">
|
||||||
<!-- </itemize> -->
|
</itemize>
|
||||||
|
|
||||||
(incomplete)
|
(incomplete)
|
||||||
|
|
||||||
@ -437,10 +437,10 @@ function.
|
|||||||
|
|
||||||
<sect1><tt/nes.h/<label id="nes.h"><p>
|
<sect1><tt/nes.h/<label id="nes.h"><p>
|
||||||
|
|
||||||
<!-- <itemize> -->
|
<itemize>
|
||||||
<!-- <item><ref id="get_tv" name="get_tv"> -->
|
<!-- <item><ref id="get_tv" name="get_tv"> -->
|
||||||
<!-- <item><ref id="waitvsync" name="waitvsync"> -->
|
<item><ref id="waitvsync" name="waitvsync">
|
||||||
<!-- </itemize> -->
|
</itemize>
|
||||||
|
|
||||||
(incomplete)
|
(incomplete)
|
||||||
|
|
||||||
@ -455,10 +455,10 @@ It does not declare any functions.
|
|||||||
|
|
||||||
<sect1><tt/pce.h/<label id="pce.h"><p>
|
<sect1><tt/pce.h/<label id="pce.h"><p>
|
||||||
|
|
||||||
<!-- <itemize> -->
|
<itemize>
|
||||||
<!-- <item><ref id="get_tv" name="get_tv"> -->
|
<!-- <item><ref id="get_tv" name="get_tv"> -->
|
||||||
<!-- <item><ref id="waitvblank" name="waitvblank"> -->
|
<item><ref id="waitvsync" name="waitvsync">
|
||||||
<!-- </itemize> -->
|
</itemize>
|
||||||
|
|
||||||
(incomplete)
|
(incomplete)
|
||||||
|
|
||||||
@ -7612,6 +7612,23 @@ used in presence of a prototype.
|
|||||||
</quote>
|
</quote>
|
||||||
|
|
||||||
|
|
||||||
|
<sect1>waitvsync<label id="waitvsync"><p>
|
||||||
|
|
||||||
|
<quote>
|
||||||
|
<descrip>
|
||||||
|
<tag/Function/Wait until the start of the next frame.
|
||||||
|
<tag/Header/
|
||||||
|
<tt/<ref id="gamate.h" name="gamate.h">/,
|
||||||
|
<tt/<ref id="nes.h" name="nes.h">/,
|
||||||
|
<tt/<ref id="pce.h" name="pce.h">/
|
||||||
|
<tag/Declaration/<tt/void waitvsync (void);/
|
||||||
|
<tag/Description/Wait for vertical sync to reduce flickering.
|
||||||
|
<tag/Availability/Platforms above
|
||||||
|
<tag/Example/None.
|
||||||
|
</descrip>
|
||||||
|
</quote>
|
||||||
|
|
||||||
|
|
||||||
<sect1>wherex<label id="wherex"><p>
|
<sect1>wherex<label id="wherex"><p>
|
||||||
|
|
||||||
<quote>
|
<quote>
|
||||||
|
@ -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 <tt/gamate.h/ header file.
|
Programs containing Gamate specific code may use the <tt/gamate.h/ header file.
|
||||||
|
|
||||||
|
|
||||||
|
<sect1>Gamate specific functions<p>
|
||||||
|
|
||||||
|
<itemize>
|
||||||
|
<item>waitvsync</item>
|
||||||
|
</itemize>
|
||||||
|
|
||||||
|
|
||||||
<sect1>Hardware access<p>
|
<sect1>Hardware access<p>
|
||||||
|
|
||||||
The following pseudo variables declared in the <tt/gamate.inc/ include file do
|
The following pseudo variables declared in the <tt/gamate.inc/ include file do
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
<title>Watara Supervision specific information for cc65
|
<title>Watara Supervision specific information for cc65
|
||||||
<author><url url="mailto:polluks@sdf.lonestar.org" name="Stefan A. Haubenthal">
|
<author><url url="mailto:polluks@sdf.lonestar.org" name="Stefan A. Haubenthal">
|
||||||
<date>2014-04-12
|
<date>2017-11-21
|
||||||
|
|
||||||
<abstract>
|
<abstract>
|
||||||
An overview over the Supervision runtime system as it is implemented for the
|
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 <tt/supervision.h/ header file.
|
Programs containing Supervision specific code may use the <tt/supervision.h/ header file.
|
||||||
|
|
||||||
|
|
||||||
<sect1>Supervision specific functions<p>
|
|
||||||
|
|
||||||
<itemize>
|
|
||||||
<item>waitvsync</item>
|
|
||||||
</itemize>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<sect1>Hardware access<p>
|
<sect1>Hardware access<p>
|
||||||
|
|
||||||
The following pseudo variables declared in the <tt/supervision.inc/ include file do
|
The following pseudo variables declared in the <tt/supervision.inc/ include file do
|
||||||
@ -102,11 +94,12 @@ No extended memory drivers are currently available for the Supervision.
|
|||||||
|
|
||||||
<sect1>Joystick drivers<p>
|
<sect1>Joystick drivers<p>
|
||||||
|
|
||||||
No joystick drivers are currently available for the Supervision.
|
<descrip>
|
||||||
<!--A joystick driver for the standard buttons is available, but must be
|
|
||||||
statically linked, because no file I/O is available. See the documentation for
|
<tag><tt/supervision-stdjoy.joy (supervision_stdjoy_joy)/</tag>
|
||||||
the <url url="co65.html" name="co65 utility"> for information on how to do
|
A joystick driver for the standard two buttons joypad is available.
|
||||||
that.-->
|
|
||||||
|
</descrip><p>
|
||||||
|
|
||||||
<sect1>Mouse drivers<p>
|
<sect1>Mouse drivers<p>
|
||||||
|
|
||||||
|
@ -105,9 +105,33 @@ extern unsigned char sv_nmi_counter;
|
|||||||
extern unsigned char sv_timer_irq_counter;
|
extern unsigned char sv_timer_irq_counter;
|
||||||
extern unsigned char sv_timer_dma_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 */
|
/* End of supervision.h */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -9,6 +9,4 @@
|
|||||||
.export _joy_static_stddrv
|
.export _joy_static_stddrv
|
||||||
.import _gamate_stdjoy_joy
|
.import _gamate_stdjoy_joy
|
||||||
|
|
||||||
.rodata
|
|
||||||
|
|
||||||
_joy_static_stddrv := _gamate_stdjoy_joy
|
_joy_static_stddrv := _gamate_stdjoy_joy
|
||||||
|
82
libsrc/supervision/joy/supervision-stdjoy.s
Normal file
82
libsrc/supervision/joy/supervision-stdjoy.s
Normal file
@ -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
|
||||||
|
ldx #>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
|
||||||
|
ldx #>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
|
12
libsrc/supervision/joy_stat_stddrv.s
Normal file
12
libsrc/supervision/joy_stat_stddrv.s
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user