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 = $04
+JOY_API_VERSION = $05
;------------------------------------------------------------------------------
; Variables
BAR .addr ; BAR routine
TEXTSTYLE .addr ; TEXTSTYLE routine
OUTTEXT .addr ; OUTTEXT routine
- IRQ .addr ; IRQ routine
.endstruct
.endstruct
;------------------------------------------------------------------------------
; The TGI API version, stored at TGI_HDR_VERSION
-TGI_API_VERSION = $05
+TGI_API_VERSION = $06
;------------------------------------------------------------------------------
; Bitmapped tgi driver flags, stored in TGI_HDR::VARS::FLAGS.
}
SEGMENTS {
ZEROPAGE: load = ZP, type = zp;
- EXEHDR: load = HEADER, type = ro;
+ EXEHDR: load = HEADER, type = ro, optional = yes;
STARTUP: load = MAIN, type = ro;
LOWCODE: load = MAIN, type = ro, optional = yes;
HGR: load = MAIN, type = rw, optional = yes, start = $2000;
}
SEGMENTS {
ZEROPAGE: load = ZP, type = zp;
- EXEHDR: load = HEADER, type = ro;
+ EXEHDR: load = HEADER, type = ro, optional = yes;
STARTUP: load = MAIN, type = ro, define = yes;
LOWCODE: load = MAIN, type = ro, optional = yes;
CODE: load = MAIN, type = ro;
}
SEGMENTS {
ZEROPAGE: load = ZP, type = zp;
- EXEHDR: load = HEADER, type = ro;
+ EXEHDR: load = HEADER, type = ro, optional = yes;
STARTUP: load = MAIN, type = ro;
LOWCODE: load = MAIN, type = ro, optional = yes;
CODE: load = MAIN, type = ro;
}
SEGMENTS {
ZEROPAGE: load = ZP, type = zp;
- EXEHDR: load = HEADER, type = ro;
+ EXEHDR: load = HEADER, type = ro, optional = yes;
STARTUP: load = MAIN, type = ro;
LOWCODE: load = MAIN, type = ro, optional = yes;
HGR: load = MAIN, type = rw, optional = yes, start = $2000;
}
SEGMENTS {
ZEROPAGE: load = ZP, type = zp;
- EXEHDR: load = HEADER, type = ro;
+ EXEHDR: load = HEADER, type = ro, optional = yes;
STARTUP: load = MAIN, type = ro, define = yes;
LOWCODE: load = MAIN, type = ro, optional = yes;
CODE: load = MAIN, type = ro;
}
SEGMENTS {
ZEROPAGE: load = ZP, type = zp;
- EXEHDR: load = HEADER, type = ro;
+ EXEHDR: load = HEADER, type = ro, optional = yes;
STARTUP: load = MAIN, type = ro;
LOWCODE: load = MAIN, type = ro, optional = yes;
CODE: load = MAIN, type = ro;
$803.
<bf/AppleCommander 1.3.5/ or later (available at <url
-url="http://applecommander.sourceforge.net/">) includes the option <tt/-cc65/
+url="https://applecommander.github.io/">) includes the option <tt/-cc65/
that allows to put binary files with a DOS 3.3 header onto disk images
containing DOS 3.3 as well as ProDOS 8.
</descrip><p>
+<sect1><tt/apple2-hgr.cfg/<p>
+
+Configuration for a program including a hires page. See <tt>testcode/lib/apple/hgrtest.c</tt>
+for an example of such a program.
+
+Parameters:
+
+<descrip>
+
+ <tag><tt/STARTADDRESS:/ Program start address</tag>
+ Default: $803. Use <tt/-S <addr>/ to set a different start address.
+
+ <tag><tt/__EXEHDR__:/ Executable file header</tag>
+ Default: DOS 3.3 header (address and length). Use <tt/-D __EXEHDR__=0/ to omit
+ the header.
+
+ <tag><tt/__STACKSIZE__:/ C runtime stack size</tag>
+ Default: $800. Use <tt/-D __STACKSIZE__=<size>/ to set a different
+ stack size.
+
+ <tag><tt/__HIMEM__:/ Highest usable memory address presumed at link time</tag>
+ Default: $9600. Use <tt/-D __HIMEM__=<addr>/ to set a different
+ highest usable address.
+
+ <tag><tt/__LCADDR__:/ Address of code in the Language Card</tag>
+ Default: $D400. Use <tt/-D __LCADDR__=<addr>/ to set a different
+ code address.
+
+ <tag><tt/__LCSIZE__:/ Size of code in the Language Card</tag>
+ Default: $C00. Use <tt/-D __LCSIZE__=<size>/ to set a different
+ code size.
+
+</descrip><p>
+
+
<sect1><tt/apple2-overlay.cfg/<p>
-Configuration for overlay programs with the up to nine overlays. The overlay files
+Configuration for an overlay program with up to nine overlays. The overlay files
don't include the DOS 3.3 header. See <tt>samples/overlaydemo.c</tt> for more
information on overlays.
<sect1><tt/apple2-asm.cfg/<p>
-Configuration for a assembler programs which don't need a special setup.
+Configuration for an assembler program that doesn't need a special setup.
Parameters:
$803.
<bf/AppleCommander 1.3.5/ or later (available at <url
-url="http://applecommander.sourceforge.net/">) includes the option <tt/-cc65/
+url="https://applecommander.github.io/">) includes the option <tt/-cc65/
that allows to put binary files with a DOS 3.3 header onto disk images
containing DOS 3.3 as well as ProDOS 8.
</descrip><p>
+<sect1><tt/apple2enh-hgr.cfg/<p>
+
+Configuration for a program including a hires page. See <tt>testcode/lib/apple/hgrtest.c</tt>
+for an example of such a program.
+
+Parameters:
+
+<descrip>
+
+ <tag><tt/STARTADDRESS:/ Program start address</tag>
+ Default: $803. Use <tt/-S <addr>/ to set a different start address.
+
+ <tag><tt/__EXEHDR__:/ Executable file header</tag>
+ Default: DOS 3.3 header (address and length). Use <tt/-D __EXEHDR__=0/ to omit
+ the header.
+
+ <tag><tt/__STACKSIZE__:/ C runtime stack size</tag>
+ Default: $800. Use <tt/-D __STACKSIZE__=<size>/ to set a different
+ stack size.
+
+ <tag><tt/__HIMEM__:/ Highest usable memory address presumed at link time</tag>
+ Default: $9600. Use <tt/-D __HIMEM__=<addr>/ to set a different
+ highest usable address.
+
+ <tag><tt/__LCADDR__:/ Address of code in the Language Card</tag>
+ Default: $D400. Use <tt/-D __LCADDR__=<addr>/ to set a different
+ code address.
+
+ <tag><tt/__LCSIZE__:/ Size of code in the Language Card</tag>
+ Default: $C00. Use <tt/-D __LCSIZE__=<size>/ to set a different
+ code size.
+
+</descrip><p>
+
+
<sect1><tt/apple2enh-overlay.cfg/<p>
-Configuration for overlay programs with the up to nine overlays. The overlay files
+Configuration for an overlay program with up to nine overlays. The overlay files
don't include the DOS 3.3 header. See <tt>samples/overlaydemo.c</tt> for more
information on overlays.
<sect1><tt/apple2enh-asm.cfg/<p>
-Configuration for a assembler programs which don't need a special setup.
+Configuration for an assembler program that doesn't need a special setup.
Parameters:
/* Define a structure with the gtia register offsets */
struct __gtia_write {
- unsigned char hposp0; /* horizontal position player 0 */
- unsigned char hposp1; /* horizontal position player 1 */
- unsigned char hposp2; /* horizontal position player 2 */
- unsigned char hposp3; /* horizontal position player 3 */
- unsigned char hposm0; /* horizontal position missile 0 */
- unsigned char hposm1; /* horizontal position missile 1 */
- unsigned char hposm2; /* horizontal position missile 2 */
- unsigned char hposm3; /* horizontal position missile 3 */
- unsigned char sizep0; /* size of player 0 */
- unsigned char sizep1; /* size of player 1 */
- unsigned char sizep2; /* size of player 2 */
- unsigned char sizep3; /* size of player 3 */
- unsigned char sizem; /* size of missiles */
- unsigned char grafp0; /* graphics shape player 0 */
- unsigned char grafp1; /* graphics shape player 1 */
- unsigned char grafp2; /* graphics shape player 2 */
- unsigned char grafp3; /* graphics shape player 3 */
- unsigned char grafm; /* graphics shape missiles */
- unsigned char colpm0; /* color player and missile 0 */
- unsigned char colpm1; /* color player and missile 1 */
- unsigned char colpm2; /* color player and missile 2 */
- unsigned char colpm3; /* color player and missile 3 */
- unsigned char colpf0; /* color playfield 0 */
- unsigned char colpf1; /* color playfield 1 */
- unsigned char colpf2; /* color playfield 2 */
- unsigned char colpf3; /* color playfield 3 */
- unsigned char colbk; /* color background */
- unsigned char prior; /* priority selection */
- unsigned char vdelay; /* vertical delay */
- unsigned char gractl; /* stick/paddle latch, p/m control */
- unsigned char hitclr; /* clear p/m collision */
- unsigned char consol; /* console buttons */
+ unsigned char hposp0; /* 0x00: horizontal position player 0 */
+ unsigned char hposp1; /* 0x01: horizontal position player 1 */
+ unsigned char hposp2; /* 0x02: horizontal position player 2 */
+ unsigned char hposp3; /* 0x03: horizontal position player 3 */
+ unsigned char hposm0; /* 0x04: horizontal position missile 0 */
+ unsigned char hposm1; /* 0x05: horizontal position missile 1 */
+ unsigned char hposm2; /* 0x06: horizontal position missile 2 */
+ unsigned char hposm3; /* 0x07: horizontal position missile 3 */
+ unsigned char sizep0; /* 0x08: size of player 0 */
+ unsigned char sizep1; /* 0x09: size of player 1 */
+ unsigned char sizep2; /* 0x0A: size of player 2 */
+ unsigned char sizep3; /* 0x0B: size of player 3 */
+ unsigned char sizem; /* 0x0C: size of missiles */
+ unsigned char grafp0; /* 0x0D: graphics shape player 0 */
+ unsigned char grafp1; /* 0x0E: graphics shape player 1 */
+ unsigned char grafp2; /* 0x0F: graphics shape player 2 */
+ unsigned char grafp3; /* 0x10: graphics shape player 3 */
+ unsigned char grafm; /* 0x11: graphics shape missiles */
+ unsigned char colpm0; /* 0x12: color player and missile 0 */
+ unsigned char colpm1; /* 0x13: color player and missile 1 */
+ unsigned char colpm2; /* 0x14: color player and missile 2 */
+ unsigned char colpm3; /* 0x15: color player and missile 3 */
+ unsigned char colpf0; /* 0x16: color playfield 0 */
+ unsigned char colpf1; /* 0x17: color playfield 1 */
+ unsigned char colpf2; /* 0x18: color playfield 2 */
+ unsigned char colpf3; /* 0x19: color playfield 3 */
+ unsigned char colbk; /* 0x1A: color background */
+ unsigned char prior; /* 0x1B: priority selection */
+ unsigned char vdelay; /* 0x1C: vertical delay */
+ unsigned char gractl; /* 0x1D: stick/paddle latch, p/m control */
+ unsigned char hitclr; /* 0x1E: clear p/m collision */
+ unsigned char consol; /* 0x1F: builtin speaker */
};
/* Define a structure with the gtia register offsets */
struct __gtia_read {
- unsigned char m0pf; /* missile 0 to playfield collision */
- unsigned char m1pf; /* missile 1 to playfield collision */
- unsigned char m2pf; /* missile 2 to playfield collision */
- unsigned char m3pf; /* missile 3 to playfield collision */
- unsigned char p0pf; /* player 0 to playfield collision */
- unsigned char p1pf; /* player 1 to playfield collision */
- unsigned char p2pf; /* player 2 to playfield collision */
- unsigned char p3pf; /* player 3 to playfield collision */
- unsigned char m0pl; /* missile 0 to player collision */
- unsigned char m1pl; /* missile 1 to player collision */
- unsigned char m2pl; /* missile 2 to player collision */
- unsigned char m3pl; /* missile 3 to player collision */
- unsigned char p0pl; /* player 0 to player collision */
- unsigned char p1pl; /* player 1 to player collision */
- unsigned char p2pl; /* player 2 to player collision */
- unsigned char p3pl; /* player 3 to player collision */
- unsigned char trig0; /* joystick trigger 0 */
- unsigned char trig1; /* joystick trigger 1 */
- unsigned char trig2; /* joystick trigger 2 */
- unsigned char trig3; /* joystick trigger 3 */
- unsigned char pal; /* pal/ntsc flag */
+ unsigned char m0pf; /* 0x00: missile 0 to playfield collision */
+ unsigned char m1pf; /* 0x01: missile 1 to playfield collision */
+ unsigned char m2pf; /* 0x02: missile 2 to playfield collision */
+ unsigned char m3pf; /* 0x03: missile 3 to playfield collision */
+ unsigned char p0pf; /* 0x04: player 0 to playfield collision */
+ unsigned char p1pf; /* 0x05: player 1 to playfield collision */
+ unsigned char p2pf; /* 0x06: player 2 to playfield collision */
+ unsigned char p3pf; /* 0x07: player 3 to playfield collision */
+ unsigned char m0pl; /* 0x08: missile 0 to player collision */
+ unsigned char m1pl; /* 0x09: missile 1 to player collision */
+ unsigned char m2pl; /* 0x0A: missile 2 to player collision */
+ unsigned char m3pl; /* 0x0B: missile 3 to player collision */
+ unsigned char p0pl; /* 0x0C: player 0 to player collision */
+ unsigned char p1pl; /* 0x0D: player 1 to player collision */
+ unsigned char p2pl; /* 0x0E: player 2 to player collision */
+ unsigned char p3pl; /* 0x0F: player 3 to player collision */
+ unsigned char trig0; /* 0x10: joystick trigger 0 */
+ unsigned char trig1; /* 0x11: joystick trigger 1 */
+ unsigned char trig2; /* 0x12: joystick trigger 2 */
+ unsigned char trig3; /* 0x13: joystick trigger 3 */
+ unsigned char pal; /* 0x14: pal/ntsc flag */
+ unsigned char unused[10];
+ unsigned char consol; /* 0x1F: console buttons */
};
/* End of _gtia.h */
+++ /dev/null
-/*****************************************************************************/
-/* */
-/* ace.h */
-/* */
-/* ACE system-specific definitions */
-/* */
-/* */
-/* */
-/* (C) 1998-2015, Ullrich von Bassewitz */
-/* Roemerstrasse 52 */
-/* D-70794 Filderstadt */
-/* EMail: uz@cc65.org */
-/* */
-/* */
-/* This software is provided 'as-is', without any expressed or implied */
-/* warranty. In no event will the authors be held liable for any damages */
-/* arising from the use of this software. */
-/* */
-/* Permission is granted to anyone to use this software for any purpose, */
-/* including commercial applications, and to alter it and redistribute it */
-/* freely, subject to the following restrictions: */
-/* */
-/* 1. The origin of this software must not be misrepresented; you must not */
-/* claim that you wrote the original software. If you use this software */
-/* in a product, an acknowledgment in the product documentation would be */
-/* appreciated but is not required. */
-/* 2. Altered source versions must be plainly marked as such, and must not */
-/* be misrepresented as being the original software. */
-/* 3. This notice may not be removed or altered from any source */
-/* distribution. */
-/* */
-/*****************************************************************************/
-
-
-
-#ifndef _ACE_H
-#define _ACE_H
-
-
-
-/* Check for errors */
-#if !defined(__ACE__)
-# error This module may only be used when compiling for the ACE os!
-#endif
-
-
-
-#ifndef _STDDEF_H
-#include <stddef.h>
-#endif
-
-
-
-struct aceDirentBuf {
- unsigned long ad_size; /* Size in bytes */
- unsigned char ad_date [8]; /* YY:YY:MM:DD:HH:MM:SS:TW */
- char ad_type [4]; /* File type as ASCIIZ string */
- unsigned char ad_flags; /* File flags */
- unsigned char ad_usage; /* More flags */
- unsigned char ad_namelen; /* Length of name */
- char ad_name [17]; /* Name itself, ASCIIZ */
-};
-
-int __cdecl__ aceDirOpen (char* dir);
-int __cdecl__ aceDirClose (int handle);
-int __cdecl__ aceDirRead (int handle, struct aceDirentBuf* buf);
-
-/* Type of an ACE key. Key in low byte, shift mask in high byte */
-typedef unsigned int aceKey;
-
-/* #defines for the shift mask returned by aceConGetKey */
-#define aceSH_KEY 0x00FF /* Mask key itself */
-#define aceSH_MASK 0xFF00 /* Mask shift mask */
-#define aceSH_EXT 0x2000 /* Extended key */
-#define aceSH_CAPS 0x1000 /* Caps lock key */
-#define aceSH_ALT 0x0800 /* Alternate key */
-#define aceSH_CTRL 0x0400 /* Ctrl key */
-#define aceSH_CBM 0x0200 /* Commodore key */
-#define aceSH_SHIFT 0x0100 /* Shift key */
-
-/* #defines for the options in aceConSetOpt/aceConGetOpt */
-#define aceOP_PUTMASK 1 /* Console put mask */
-#define aceOP_CHARCOLOR 2 /* Character color */
-#define aceOP_CHARATTR 3 /* Character attribute */
-#define aceOP_FILLCOLOR 4 /* Fill color */
-#define aceOP_FILLATTR 5 /* Fill attribute */
-#define aceOP_CRSCOLOR 6 /* Cursor color */
-#define aceOP_CRSWRAP 7 /* Force cursor wrap */
-#define aceOP_SHSCROLL 8 /* Shift keys for scrolling */
-#define aceOP_MOUSCALE 9 /* Mouse scaling */
-#define aceOP_RPTDELAY 10 /* Key repeat delay */
-#define aceOP_RPTRATE 11 /* Key repeat rate */
-
-/* Console functions */
-void __cdecl__ aceConWrite (char* buf, size_t count);
-void __cdecl__ aceConPutLit (int c);
-void __cdecl__ aceConPos (unsigned x, unsigned y);
-void __cdecl__ aceConGetPos (unsigned* x, unsigned* y);
-unsigned aceConGetX (void);
-unsigned aceConGetY (void);
-char __cdecl__* aceConInput (char* buf, unsigned initial);
-int aceConStopKey (void);
-aceKey aceConGetKey (void);
-int __cdecl__ aceConKeyAvail (aceKey* key);
-void __cdecl__ aceConKeyMat (char* matrix);
-void __cdecl__ aceConSetOpt (unsigned char opt, unsigned char val);
-int __cdecl__ aceConGetOpt (unsigned char opt);
-
-/* Misc stuff */
-int __cdecl__ aceMiscIoPeek (unsigned addr);
-void __cdecl__ aceMiscIoPoke (unsigned addr, unsigned char val);
-
-
-
-/* End of ace.h */
-#endif
-
-
-
# error This module may only be used when compiling for the Apple ][!
#endif
-
#include <apple2_filetype.h>
+
+
/*****************************************************************************/
/* Data */
/*****************************************************************************/
-/* If not already done, include the apple2.h header file */
-#if !defined(_APPLE2_H)
-# include <apple2.h>
-#endif
+#include <apple2.h>
#define IOCB_GETCWD 0x30 /* get current directory (MyDOS/SpartaDOS) */
#define IOCB_FORMAT 0xFE /* format */
+
+
/* End of atari.h */
#endif
/* */
/*****************************************************************************/
+
+
#ifndef _ATARI2600_H
#define _ATARI2600_H
+
+
/* Check for errors */
#if !defined(__ATARI2600__)
# error This module may only be used when compiling for the Atari 2600!
#include <_riot.h>
#define RIOT (*(struct __riot*)0x0280)
+
+
/* End of atari2600.h */
-#endif /* #ifndef _ATARI2600_H */
+#endif
/* Include the base header file for the 264 series. include file.
*/
-#ifndef _CBM264_H
#include <cbm264.h>
-#endif
/* We need NULL. */
-
-#if !defined(_STDDEF_H)
-# include <stddef.h>
-#endif
+#include <stddef.h>
/* Load the system-specific files here, if needed. */
#if defined(__C64__) && !defined(_C64_H)
-#if !defined(_STDARG_H)
-# include <stdarg.h>
-#endif
-
-/* Include the correct machine-specific file */
-#if defined(__APPLE2ENH__)
-# include <apple2enh.h>
-#elif defined(__APPLE2__)
-# include <apple2.h>
-#elif defined(__ATARI5200__)
-# include <atari5200.h>
-#elif defined(__ATARI__)
-# include <atari.h>
-#elif defined(__ATMOS__)
-# include <atmos.h>
-#elif defined(__CBM__)
-# include <cbm.h>
-#elif defined(__CREATIVISION__)
-# include <creativision.h>
-#elif defined(__GAMATE__)
-# include <gamate.h>
-#elif defined(__GEOS__)
-# include <geos.h>
-#elif defined(__LUNIX__)
-# include <lunix.h>
-#elif defined(__LYNX__)
-# include <lynx.h>
-#elif defined(__NES__)
-# include <nes.h>
-#elif defined(__OSIC1P__)
-# include <osic1p.h>
-#elif defined(__PCE__)
-# include <pce.h>
-#endif
+#include <stdarg.h>
+#include <target.h>
** the macro will give access to the actual function.
*/
-#if defined(_textcolor)
+#ifdef _textcolor
# define textcolor(x) _textcolor(x)
#endif
-#if defined(_bgcolor)
+#ifdef _bgcolor
# define bgcolor(x) _bgcolor(x)
#endif
-#if defined(_bordercolor)
+#ifdef _bordercolor
# define bordercolor(x) _bordercolor(x)
#endif
-#if defined(_cpeekcolor)
+#ifdef _cpeekcolor
# define cpeekcolor(x) _cpeekcolor(x)
#endif
-#ifndef _GCONST_H
#include <geos/gconst.h>
-#endif
-
-#ifndef _GSTRUCT_H
#include <geos/gstruct.h>
-#endif
-
-#ifndef _GSYM_H
#include <geos/gsym.h>
-#endif
-
-#ifndef _GDISK_H
#include <geos/gdisk.h>
-#endif
-
-#ifndef _GFILE_H
#include <geos/gfile.h>
-#endif
-
-#ifndef _GPROCESS_H
#include <geos/gprocess.h>
-#endif
-
-#ifndef _GGRAPH_H
#include <geos/ggraph.h>
-#endif
-
-#ifndef _GMENU_H
#include <geos/gmenu.h>
-#endif
-
-#ifndef _GSPRITE_H
#include <geos/gsprite.h>
-#endif
-
-#ifndef _GMEMORY_H
#include <geos/gmemory.h>
-#endif
-
-#ifndef _GSYS_H
#include <geos/gsys.h>
-#endif
-
-#ifndef _GDLGBOX_H
#include <geos/gdlgbox.h>
-#endif
+
#define CH_ULCORNER '+'
#define JOY_BTN_1_MASK 0x10
+
/* End of geos.h */
#endif
#ifndef _GDISK_H
#define _GDISK_H
-#ifndef _GSTRUCT_H
#include <geos/gstruct.h>
-#endif
char __fastcall__ ReadBuff(struct tr_se *myTrSe);
char __fastcall__ WriteBuff(struct tr_se *myTrSe);
#ifndef _GFILE_H
#define _GFILE_H
-#ifndef _GSTRUCT_H
#include <geos/gstruct.h>
-#endif
struct filehandle *Get1stDirEntry(void);
struct filehandle *GetNxtDirEntry(void);
#ifndef _GGRAPH_H
#define _GGRAPH_H
-#ifndef _GSTRUCT_H
#include <geos/gstruct.h>
-#endif
void __fastcall__ SetPattern(char newpattern);
#ifndef _GMEMORY_H
#define _GMEMORY_H
-#ifndef _GSTRUCT_H
#include <geos/gstruct.h>
-#endif
void __fastcall__ CopyString(char *dest, const char *source);
char __fastcall__ CmpString(const char *dest, const char *source);
#ifndef _GMENU_H
#define _GMENU_H
-#ifndef _GSTRUCT_H
#include <geos/gstruct.h>
-#endif
void __fastcall__ DoMenu(struct menu *myMenu);
void ReDoMenu(void);
#ifndef _GPROCESS_H
#define _GPROCESS_H
-#ifndef _GSTRUCT_H
#include <geos/gstruct.h>
-#endif
void __fastcall__ InitProcesses(char number, struct process *proctab);
void __fastcall__ RestartProcess(char number);
#ifndef _GSYM_H
#define _GSYM_H
-#ifndef _GSTRUCT_H
#include <geos/gstruct.h>
-#endif
#define r0 (*(unsigned*)(R_BASE + 0x00))
#define r0L (*(char*)(R_BASE + 0x00))
+#include <target.h>
+
+
+
/*****************************************************************************/
/* Definitions */
/*****************************************************************************/
/* End of joystick.h */
#endif
-
-
-
void* uninstall; /* UNINSTALL routine */
void* count; /* COUNT routine */
void* read; /* READ routine */
- void* irq; /* IRQ routine */
} joy_drv_header;
/* Sound support */
/*****************************************************************************/
+
+
void lynx_snd_init (void);
/* Initialize the sound driver */
unsigned char lynx_snd_active(void);
/* Show which channels are active */
+
+
/*****************************************************************************/
/* Accessing the cart */
/*****************************************************************************/
#define SUZY (*(struct __suzy*)0xFC00)
+
/* End of lynx.h */
#endif
/* Include the base header file for the 264 series. include file.
*/
-#ifndef _CBM264_H
#include <cbm264.h>
-#endif
/* Define hardware */
#include <_6551.h>
-#ifndef _STDDEF_H
-# include <stddef.h>
-#endif
-#ifndef _STDARG_H
-# include <stdarg.h>
-#endif
+#include <stddef.h>
+#include <stdarg.h>
/* End of stdio.h */
#endif
-
-
-
unsigned char xpos;
unsigned char ypos;
};
-#define SV_LCD ((struct __sv_lcd*)0x2000)
+#define SV_LCD (*(struct __sv_lcd*)0x2000)
struct __sv_tone {
unsigned delay;
unsigned char control;
unsigned char timer;
};
-#define SV_RIGHT ((struct __sv_tone*)0x2010)
-#define SV_LEFT ((struct __sv_tone*)0x2014)
+#define SV_RIGHT (*(struct __sv_tone*)0x2010)
+#define SV_LEFT (*(struct __sv_tone*)0x2014)
struct __sv_noise {
unsigned char volume; /* and frequency */
unsigned char timer;
unsigned char control;
};
-#define SV_NOISE ((struct __sv_noise*)0x2028)
+#define SV_NOISE (*(struct __sv_noise*)0x2028)
struct __io_port {
unsigned char in;
unsigned char out;
};
-#define IO_PORT ((struct __io_port*)(0x2021)
+#define IO_PORT (*(struct __io_port*)0x2021)
struct __sv_dma {
unsigned start;
unsigned char control;
unsigned char on;
};
-#define SV_DMA ((struct __sv_dma*)0x2018)
+#define SV_DMA (*(struct __sv_dma*)0x2018)
#define SV_CONTROL (*(unsigned char*)0x2020)
--- /dev/null
+/*****************************************************************************/
+/* */
+/* target.h */
+/* */
+/* Target specific definitions */
+/* */
+/* */
+/* */
+/* This software is provided 'as-is', without any expressed or implied */
+/* warranty. In no event will the authors be held liable for any damages */
+/* arising from the use of this software. */
+/* */
+/* Permission is granted to anyone to use this software for any purpose, */
+/* including commercial applications, and to alter it and redistribute it */
+/* freely, subject to the following restrictions: */
+/* */
+/* 1. The origin of this software must not be misrepresented; you must not */
+/* claim that you wrote the original software. If you use this software */
+/* in a product, an acknowledgment in the product documentation would be */
+/* appreciated but is not required. */
+/* 2. Altered source versions must be plainly marked as such, and must not */
+/* be misrepresented as being the original software. */
+/* 3. This notice may not be removed or altered from any source */
+/* distribution. */
+/* */
+/*****************************************************************************/
+
+
+
+#ifndef _TARGET_H
+#define _TARGET_H
+
+
+
+/* Include the correct target specific file */
+#if defined(__APPLE2ENH__)
+# include <apple2enh.h>
+#elif defined(__APPLE2__)
+# include <apple2.h>
+#elif defined(__ATARI__)
+# include <atari.h>
+#elif defined(__ATARI2600__)
+# include <atari2600.h>
+#elif defined(__ATARI5200__)
+# include <atari5200.h>
+#elif defined(__ATMOS__)
+# include <atmos.h>
+#elif defined(__CBM__)
+# include <cbm.h>
+#elif defined(__CREATIVISION__)
+# include <creativision.h>
+#elif defined(__GAMATE__)
+# include <gamate.h>
+#elif defined(__GEOS__)
+# include <geos.h>
+#elif defined(__LYNX__)
+# include <lynx.h>
+#elif defined(__NES__)
+# include <nes.h>
+#elif defined(__OSIC1P__)
+# include <osic1p.h>
+#elif defined(__PCE__)
+# include <pce.h>
+#elif defined(__SUPERVISION__)
+# include <supervision.h>
+#elif defined(__TELESTRAT__)
+# include <telestrat.h>
+#endif
+
+
+
+/* End of target.h */
+#endif
-#ifndef _TGI_ERROR_H
#include <tgi/tgi-error.h>
-#endif
+#include <target.h>
/* End of tgi.h */
#endif
-
-
-
.addr UNINSTALL
.addr COUNT
.addr READJOY
- .addr 0 ; IRQ not used
; ------------------------------------------------------------------------
.addr BAR
.addr TEXTSTYLE
.addr OUTTEXT
- .addr 0 ; IRQ entry is unused
; ------------------------------------------------------------------------
.addr BAR
.addr TEXTSTYLE
.addr OUTTEXT
- .addr 0 ; IRQ entry is unused
; ------------------------------------------------------------------------
.addr UNINSTALL
.addr COUNT
.addr READJOY
- .addr 0 ; IRQ entry not used
; ------------------------------------------------------------------------
; Constants
.addr UNINSTALL
.addr COUNT
.addr READJOY
- .addr 0 ; IRQ entry not used
; ------------------------------------------------------------------------
; Constants
.addr BAR
.addr TEXTSTYLE
.addr OUTTEXT
- .addr 0 ; IRQ entry is unused
; ******************************************************************************
.addr UNINSTALL
.addr COUNT
.addr READJOY
- .addr 0 ; IRQ entry not used
.code
.addr $0000
-; Button state masks (8 values)
-
- .byte $10 ; JOY_UP
- .byte $08 ; JOY_DOWN
- .byte $01 ; JOY_LEFT
- .byte $02 ; JOY_RIGHT
- .byte $20 ; JOY_FIRE
- .byte $00 ; Future expansion
- .byte $00 ; Future expansion
- .byte $00 ; Future expansion
-
; Jump table.
.addr INSTALL
.addr UNINSTALL
.addr COUNT
.addr READ
- .addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants
.addr UNINSTALL
.addr COUNT
.addr READ
- .addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants
.addr BAR
.addr TEXTSTYLE
.addr OUTTEXT
- .addr 0 ; IRQ entry is unused
; ------------------------------------------------------------------------
; Data.
.addr BAR
.addr TEXTSTYLE
.addr OUTTEXT
- .addr 0 ; IRQ entry is unused
; ------------------------------------------------------------------------
; Data.
.addr UNINSTALL
.addr COUNT
.addr READ
- .addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants
.addr UNINSTALL
.addr COUNT
.addr READ
- .addr 0 ; IRQ entry not used
; ------------------------------------------------------------------------
; Constants
.addr BAR
.addr TEXTSTYLE
.addr OUTTEXT
- .addr 0 ; IRQ entry is unused
; ------------------------------------------------------------------------
; Data.
.addr BAR
.addr TEXTSTYLE
.addr OUTTEXT
- .addr 0 ; IRQ entry is unused
; ------------------------------------------------------------------------
; Data.
.addr UNINSTALL
.addr COUNT
.addr READ
- .addr IRQ
; ------------------------------------------------------------------------
; Constants
.addr UNINSTALL
.addr COUNT
.addr READ
- .addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants
.addr UNINSTALL
.addr COUNT
.addr READ
- .addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants
.addr UNINSTALL
.addr COUNT
.addr READ
- .addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants
.addr BAR
.addr TEXTSTYLE
.addr OUTTEXT
- .addr 0 ; IRQ entry is unused
; ------------------------------------------------------------------------
; Data.
.addr UNINSTALL
.addr COUNT
.addr READ
- .addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants
.addr UNINSTALL
.addr COUNT
.addr READJOY
- .addr 0 ; IRQ entry not used
; ------------------------------------------------------------------------
; Constants
.addr UNINSTALL
.addr COUNT
.addr READJOY
- .addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants
.addr BAR
.addr TEXTSTYLE
.addr OUTTEXT
- .addr 0 ; IRQ entry is unused
; ------------------------------------------------------------------------
; Data.
.import joy_libref
.importzp ptr1
- .interruptor joy_irq ; Export as IRQ handler
.include "joy-kernel.inc"
.include "joy-error.inc"
joy_uninstall: jmp $0000
joy_count: jmp $0000
joy_read: jmp $0000
-joy_irq: .byte $60, $00, $00 ; RTS plus two dummy bytes
; Driver header signature
.rodata
cpy #(JOY_HDR::JUMPTAB + .sizeof(JOY_HDR::JUMPTAB))
bne @L1
- jsr joy_install ; Call driver install routine
- tay ; Test error code
- bne @L2 ; Bail out if install had errors
-
-; Install the IRQ vector if the driver needs it. A/X contains the error code
-; from joy_install, so don't use it.
-
- ldy joy_irq+2 ; Check high byte of IRQ vector
- beq @L2 ; Jump if vector invalid
- ldy #$4C ; JMP opcode
- sty joy_irq ; Activate IRQ routine
-@L2: rts
+ jmp joy_install ; Call driver install routine
; Driver signature invalid
; */
_joy_uninstall:
- lda #$60 ; RTS opcode
- sta joy_irq ; Disable IRQ entry point
-
jsr joy_uninstall ; Call the driver routine
_joy_clear_ptr: ; External entry point
.include "joy-kernel.inc"
_joy_read = joy_read ; Use driver entry
-
-
.addr UNINSTALL
.addr COUNT
.addr READ
- .addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants
; Oliver Schmidt, 2013-05-31
;
- .export joy_libref, ser_libref, tgi_libref
+ .export joy_libref, ser_libref
.import _exit
joy_libref := _exit
ser_libref := _exit
-tgi_libref := _exit
.byte $74, $67, $69 ; "tgi"
.byte TGI_API_VERSION ; TGI API version number
- .addr $0000 ; Library reference
+libref: .addr $0000 ; Library reference
.word 160 ; X resolution
.word 102 ; Y resolution
.byte 16 ; Number of drawing colors
.addr BAR
.addr TEXTSTYLE
.addr OUTTEXT
- .addr IRQ
; ------------------------------------------------------------------------
stz BGINDEX
stz DRAWPAGE
stz SWAPREQUEST
+ lda libref
+ ldx libref+1
+ sta ptr1
+ stx ptr1+1
+ ldy #1
+ lda #<irq
+ sta (ptr1),y
+ iny
+ lda #>irq
+ sta (ptr1),y
+ lda #$4C ; Jump opcode
+ sta (ptr1) ; Activate IRQ routine
rts
;
UNINSTALL:
+ lda libref
+ ldx libref+1
+ sta ptr1
+ stx ptr1+1
+ lda #$60 ; RTS opcode
+ sta (ptr1) ; Disable IRQ routine
rts
stx DRAWPAGEH
rts
-; ------------------------------------------------------------------------
-; IRQ: VBL interrupt handler
-;
-
-IRQ:
+irq:
lda INTSET ; Poll all pending interrupts
and #VBL_INTERRUPT
- beq IRQEND ; Exit if not a VBL interrupt
+ beq @L0 ; Exit if not a VBL interrupt
lda SWAPREQUEST
beq @L0
jsr SETDRAWPAGE
stz SWAPREQUEST
@L0:
-IRQEND:
clc
rts
--- /dev/null
+;
+; Oliver Schmidt, 2018-02-02
+;
+
+ .export tgi_libref
+ .interruptor tgi_irq ; Export as IRQ handler
+
+ .data
+
+tgi_libref:
+tgi_irq: .byte $60, $00, $00 ; RTS plus two dummy bytes
.addr UNINSTALL
.addr COUNT
.addr READJOY
- .addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants
.addr BAR
.addr TEXTSTYLE
.addr OUTTEXT
- .addr 0 ; IRQ entry is unused
; ------------------------------------------------------------------------
; Data.
.addr UNINSTALL
.addr COUNT
.addr READJOY
- .addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants
.addr UNINSTALL
.addr COUNT
.addr READ
- .addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants
.addr UNINSTALL
.addr COUNT
.addr READ
- .addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants
.addr UNINSTALL
.addr COUNT
.addr READ
- .addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants
.addr UNINSTALL
.addr COUNT
.addr READJOY
- .addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants
--- /dev/null
+;
+; Oliver Schmidt, 2013-05-31
+;
+
+ .export joy_libref
+ .import _exit
+
+joy_libref := _exit
.addr CIRCLE
.addr TEXTSTYLE
.addr OUTTEXT
- .addr 0 ; IRQ entry is unused
; ------------------------------------------------------------------------
; Data.
.addr BAR
.addr TEXTSTYLE
.addr OUTTEXT
- .addr 0 ; IRQ entry is unused
; ------------------------------------------------------------------------
; Data.
.import tgi_libref
.importzp ptr1
- .interruptor tgi_irq ; Export as IRQ handler
.include "tgi-kernel.inc"
.include "tgi-error.inc"
tgi_bar: jmp $0000
tgi_textstyle: jmp $0000
tgi_outtext: jmp $0000
-tgi_irq: .byte $60, $00, $00 ; RTS plus two dummy bytes
; Driver header signature
.rodata
dex
bpl @L3
-; Install the IRQ vector if the driver needs it.
-
- lda tgi_irq+2 ; Check high byte of IRQ vector
- beq @L4 ; Jump if vector invalid
- lda #$4C ; Jump opcode
- sta tgi_irq ; Activate IRQ routine
-
; Initialize some other variables
lda #$00
-@L4: ldx #csize-1
-@L5: sta cstart,x ; Clear error/mode/curx/cury/...
+ ldx #csize-1
+@L4: sta cstart,x ; Clear error/mode/curx/cury/...
dex
- bpl @L5
+ bpl @L4
rts
jsr tgi_uninstall ; Allow the driver to clean up
- lda #$60 ; RTS opcode
- sta tgi_irq ; Disable IRQ entry point
-
; Clear driver pointer and error code
tgi_clear_ptr:
.addr UNINSTALL
.addr COUNT
.addr READ
- .addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants
.addr UNINSTALL
.addr COUNT
.addr READ
- .addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants
# This one comes with VICE
C1541 ?= c1541
- # For this one see http://applecommander.sourceforge.net/
+ # For this one see https://applecommander.github.io/
AC ?= ac.jar
# For this one see http://www.horus.com/~hias/atari/
--- /dev/null
+# For this one see https://applecommander.github.io/
+AC ?= ac.jar
+
+CL = cl65
+CLFLAGS = -t apple2 -C apple2-hgr.cfg -Oirs
+
+hgrtest.dsk: hgrtest
+ cp prodos.dsk $@
+ java -jar $(AC) -cc65 $@ hgrtest bin <hgrtest
+
+hgrtest: hgrtest.c werner.s
+ $(CL) $(CLFLAGS) -m hgrtest.map $^