Merge branch 'cc65:master' into master
This commit is contained in:
188
include/_vic3.h
Normal file
188
include/_vic3.h
Normal file
@@ -0,0 +1,188 @@
|
||||
/*****************************************************************************/
|
||||
/* */
|
||||
/* _vic3.h */
|
||||
/* */
|
||||
/* Internal include file, do not use directly */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 1998-2012, 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 __VIC3_H
|
||||
#define __VIC3_H
|
||||
|
||||
/* FIXME: only VIC2 registers right now */
|
||||
|
||||
/* Define a structure with the vic register offsets. In cc65 mode, there
|
||||
** are aliases for the field accessible as arrays.
|
||||
*/
|
||||
#if __CC65_STD__ == __CC65_STD_CC65__
|
||||
struct __vic3 {
|
||||
union {
|
||||
struct {
|
||||
unsigned char spr0_x; /* Sprite 0, X coordinate */
|
||||
unsigned char spr0_y; /* Sprite 0, Y coordinate */
|
||||
unsigned char spr1_x; /* Sprite 1, X coordinate */
|
||||
unsigned char spr1_y; /* Sprite 1, Y coordinate */
|
||||
unsigned char spr2_x; /* Sprite 2, X coordinate */
|
||||
unsigned char spr2_y; /* Sprite 2, Y coordinate */
|
||||
unsigned char spr3_x; /* Sprite 3, X coordinate */
|
||||
unsigned char spr3_y; /* Sprite 3, Y coordinate */
|
||||
unsigned char spr4_x; /* Sprite 4, X coordinate */
|
||||
unsigned char spr4_y; /* Sprite 4, Y coordinate */
|
||||
unsigned char spr5_x; /* Sprite 5, X coordinate */
|
||||
unsigned char spr5_y; /* Sprite 5, Y coordinate */
|
||||
unsigned char spr6_x; /* Sprite 6, X coordinate */
|
||||
unsigned char spr6_y; /* Sprite 6, Y coordinate */
|
||||
unsigned char spr7_x; /* Sprite 7, X coordinate */
|
||||
unsigned char spr7_y; /* Sprite 7, Y coordinate */
|
||||
};
|
||||
struct {
|
||||
unsigned char x; /* X coordinate */
|
||||
unsigned char y; /* Y coordinate */
|
||||
} spr_pos[8];
|
||||
};
|
||||
unsigned char spr_hi_x; /* High bits of X coordinate */
|
||||
unsigned char ctrl1; /* Control register 1 */
|
||||
unsigned char rasterline; /* Current raster line */
|
||||
union {
|
||||
struct {
|
||||
unsigned char strobe_x; /* Light pen, X position */
|
||||
unsigned char strobe_y; /* Light pen, Y position */
|
||||
};
|
||||
struct {
|
||||
unsigned char x; /* Light pen, X position */
|
||||
unsigned char y; /* Light pen, Y position */
|
||||
} strobe;
|
||||
};
|
||||
unsigned char spr_ena; /* Enable sprites */
|
||||
unsigned char ctrl2; /* Control register 2 */
|
||||
unsigned char spr_exp_y; /* Expand sprites in Y dir */
|
||||
unsigned char addr; /* Address of chargen and video ram */
|
||||
unsigned char irr; /* Interrupt request register */
|
||||
unsigned char imr; /* Interrupt mask register */
|
||||
unsigned char spr_bg_prio; /* Priority to background */
|
||||
unsigned char spr_mcolor; /* Sprite multicolor bits */
|
||||
unsigned char spr_exp_x; /* Expand sprites in X dir */
|
||||
unsigned char spr_coll; /* Sprite/sprite collision reg */
|
||||
unsigned char spr_bg_coll; /* Sprite/background collision reg */
|
||||
unsigned char bordercolor; /* Border color */
|
||||
union {
|
||||
struct {
|
||||
unsigned char bgcolor0; /* Background color 0 */
|
||||
unsigned char bgcolor1; /* Background color 1 */
|
||||
unsigned char bgcolor2; /* Background color 2 */
|
||||
unsigned char bgcolor3; /* Background color 3 */
|
||||
};
|
||||
unsigned char bgcolor[4]; /* Background colors */
|
||||
};
|
||||
union {
|
||||
struct {
|
||||
unsigned char spr_mcolor0; /* Color 0 for multicolor sprites */
|
||||
unsigned char spr_mcolor1; /* Color 1 for multicolor sprites */
|
||||
};
|
||||
/* spr_color is already used ... */
|
||||
unsigned char spr_mcolors[2]; /* Color for multicolor sprites */
|
||||
};
|
||||
union {
|
||||
struct {
|
||||
unsigned char spr0_color; /* Color sprite 0 */
|
||||
unsigned char spr1_color; /* Color sprite 1 */
|
||||
unsigned char spr2_color; /* Color sprite 2 */
|
||||
unsigned char spr3_color; /* Color sprite 3 */
|
||||
unsigned char spr4_color; /* Color sprite 4 */
|
||||
unsigned char spr5_color; /* Color sprite 5 */
|
||||
unsigned char spr6_color; /* Color sprite 6 */
|
||||
unsigned char spr7_color; /* Color sprite 7 */
|
||||
};
|
||||
unsigned char spr_color[8]; /* Colors for the sprites */
|
||||
};
|
||||
|
||||
/* The following ones are only valid in the C128: */
|
||||
unsigned char x_kbd; /* Additional keyboard lines */
|
||||
unsigned char clock; /* Clock switch bit */
|
||||
};
|
||||
#else
|
||||
struct __vic3 {
|
||||
unsigned char spr0_x; /* Sprite 0, X coordinate */
|
||||
unsigned char spr0_y; /* Sprite 0, Y coordinate */
|
||||
unsigned char spr1_x; /* Sprite 1, X coordinate */
|
||||
unsigned char spr1_y; /* Sprite 1, Y coordinate */
|
||||
unsigned char spr2_x; /* Sprite 2, X coordinate */
|
||||
unsigned char spr2_y; /* Sprite 2, Y coordinate */
|
||||
unsigned char spr3_x; /* Sprite 3, X coordinate */
|
||||
unsigned char spr3_y; /* Sprite 3, Y coordinate */
|
||||
unsigned char spr4_x; /* Sprite 4, X coordinate */
|
||||
unsigned char spr4_y; /* Sprite 4, Y coordinate */
|
||||
unsigned char spr5_x; /* Sprite 5, X coordinate */
|
||||
unsigned char spr5_y; /* Sprite 5, Y coordinate */
|
||||
unsigned char spr6_x; /* Sprite 6, X coordinate */
|
||||
unsigned char spr6_y; /* Sprite 6, Y coordinate */
|
||||
unsigned char spr7_x; /* Sprite 7, X coordinate */
|
||||
unsigned char spr7_y; /* Sprite 7, Y coordinate */
|
||||
unsigned char spr_hi_x; /* High bits of X coordinate */
|
||||
unsigned char ctrl1; /* Control register 1 */
|
||||
unsigned char rasterline; /* Current raster line */
|
||||
unsigned char strobe_x; /* Light pen, X position */
|
||||
unsigned char strobe_y; /* Light pen, Y position */
|
||||
unsigned char spr_ena; /* Enable sprites */
|
||||
unsigned char ctrl2; /* Control register 2 */
|
||||
unsigned char spr_exp_y; /* Expand sprites in Y dir */
|
||||
unsigned char addr; /* Address of chargen and video ram */
|
||||
unsigned char irr; /* Interrupt request register */
|
||||
unsigned char imr; /* Interrupt mask register */
|
||||
unsigned char spr_bg_prio; /* Priority to background */
|
||||
unsigned char spr_mcolor; /* Sprite multicolor bits */
|
||||
unsigned char spr_exp_x; /* Expand sprites in X dir */
|
||||
unsigned char spr_coll; /* Sprite/sprite collision reg */
|
||||
unsigned char spr_bg_coll; /* Sprite/background collision reg */
|
||||
unsigned char bordercolor; /* Border color */
|
||||
unsigned char bgcolor0; /* Background color 0 */
|
||||
unsigned char bgcolor1; /* Background color 1 */
|
||||
unsigned char bgcolor2; /* Background color 2 */
|
||||
unsigned char bgcolor3; /* Background color 3 */
|
||||
unsigned char spr_mcolor0; /* Color 0 for multicolor sprites */
|
||||
unsigned char spr_mcolor1; /* Color 1 for multicolor sprites */
|
||||
unsigned char spr0_color; /* Color sprite 0 */
|
||||
unsigned char spr1_color; /* Color sprite 1 */
|
||||
unsigned char spr2_color; /* Color sprite 2 */
|
||||
unsigned char spr3_color; /* Color sprite 3 */
|
||||
unsigned char spr4_color; /* Color sprite 4 */
|
||||
unsigned char spr5_color; /* Color sprite 5 */
|
||||
unsigned char spr6_color; /* Color sprite 6 */
|
||||
unsigned char spr7_color; /* Color sprite 7 */
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/* End of _vic3.h */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
76
include/agat.h
Normal file
76
include/agat.h
Normal file
@@ -0,0 +1,76 @@
|
||||
#ifndef _AGAT_H
|
||||
#define _AGAT_H
|
||||
|
||||
/* Check for errors */
|
||||
#if !defined(__AGAT__)
|
||||
# error This module may only be used when compiling for the Agat!
|
||||
#endif
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Data */
|
||||
/*****************************************************************************/
|
||||
|
||||
|
||||
|
||||
/* Color defines */
|
||||
#define COLOR_BLACK 0x00
|
||||
#define COLOR_RED 0x01
|
||||
#define COLOR_GREEN 0x02
|
||||
#define COLOR_YELLOW 0x03
|
||||
#define COLOR_BLUE 0x04
|
||||
#define COLOR_MAGENTA 0x05
|
||||
#define COLOR_CYAN 0x06
|
||||
#define COLOR_WHITE 0x07
|
||||
|
||||
/* Characters codes */
|
||||
#define CH_CTRL_C 0x03
|
||||
#define CH_ENTER 0x0D
|
||||
#define CH_ESC 0x1B
|
||||
#define CH_CURS_LEFT 0x08
|
||||
#define CH_CURS_RIGHT 0x15
|
||||
#define CH_CURS_UP 0x19
|
||||
#define CH_CURS_DOWN 0x1A
|
||||
#define CH_ESC 0x1B
|
||||
#define CH_HLINE 0x1B
|
||||
#define CH_VLINE 0x5C
|
||||
#define CH_ULCORNER 0x10
|
||||
#define CH_URCORNER 0x12
|
||||
#define CH_LLCORNER 0x1D
|
||||
#define CH_LRCORNER 0x1F
|
||||
|
||||
/* Masks for joy_read */
|
||||
#define JOY_UP_MASK 0x10
|
||||
#define JOY_DOWN_MASK 0x20
|
||||
#define JOY_LEFT_MASK 0x04
|
||||
#define JOY_RIGHT_MASK 0x08
|
||||
#define JOY_BTN_1_MASK 0x40
|
||||
#define JOY_BTN_2_MASK 0x80
|
||||
|
||||
/* Return codes for get_ostype */
|
||||
#define AGAT_UNKNOWN 0x00
|
||||
#define AGAT_7 0x10 /* Agat 7 */
|
||||
#define AGAT_9 0x20 /* Agat 9 */
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Code */
|
||||
/*****************************************************************************/
|
||||
|
||||
unsigned char get_ostype (void);
|
||||
/* Get the machine type. Returns one of the AGAT_xxx codes. */
|
||||
|
||||
void rebootafterexit (void);
|
||||
/* Reboot machine after program termination has completed. */
|
||||
|
||||
/* The following #defines will cause the matching functions calls in conio.h
|
||||
** to be overlaid by macros with the same names, saving the function call
|
||||
** overhead.
|
||||
*/
|
||||
#define _bgcolor(color) COLOR_BLACK
|
||||
#define _bordercolor(color) COLOR_BLACK
|
||||
|
||||
/* End of agat.h */
|
||||
|
||||
|
||||
#endif
|
||||
@@ -83,7 +83,77 @@
|
||||
#define CH_CURS_LEFT 0x08
|
||||
#define CH_CURS_RIGHT 0x15
|
||||
|
||||
#if !defined(__APPLE2ENH__)
|
||||
/* These characters are not available on the ][+, but
|
||||
* are on the //e. */
|
||||
#if defined(__APPLE2ENH__) || defined(APPLE2_INCLUDE_IIE_CHARS)
|
||||
#define CH_DEL 0x7F
|
||||
#define CH_CURS_UP 0x0B
|
||||
#define CH_CURS_DOWN 0x0A
|
||||
|
||||
/* These are defined to be OpenApple + NumberKey */
|
||||
#define CH_F1 0xB1
|
||||
#define CH_F2 0xB2
|
||||
#define CH_F3 0xB3
|
||||
#define CH_F4 0xB4
|
||||
#define CH_F5 0xB5
|
||||
#define CH_F6 0xB6
|
||||
#define CH_F7 0xB7
|
||||
#define CH_F8 0xB8
|
||||
#define CH_F9 0xB9
|
||||
#define CH_F10 0xB0
|
||||
#endif
|
||||
|
||||
#if defined(__APPLE2ENH__)
|
||||
|
||||
/* MouseText-based functions for boxes and lines drawing */
|
||||
void mt_chline (unsigned char length);
|
||||
void mt_cvline (unsigned char length);
|
||||
void mt_chlinexy (unsigned char x, unsigned char y, unsigned char length);
|
||||
void mt_cvlinexy (unsigned char x, unsigned char y, unsigned char length);
|
||||
|
||||
#define CH_HLINE 0x5F
|
||||
#define CH_VLINE 0xDF
|
||||
#define CH_ULCORNER 0x5F
|
||||
#define CH_URCORNER 0x20
|
||||
#define CH_LLCORNER 0xD4
|
||||
#define CH_LRCORNER 0xDF
|
||||
#define CH_TTEE 0x5F
|
||||
#define CH_BTEE 0xD4
|
||||
#define CH_LTEE 0xD4
|
||||
#define CH_RTEE 0xDF
|
||||
#define CH_CROSS 0xD4
|
||||
|
||||
#define _chline(length) mt_chline(length)
|
||||
#define _chlinexy(x,y,length) mt_chlinexy(x,y,length)
|
||||
#define _cvline(length) mt_cvline(length)
|
||||
#define _cvlinexy(x,y,length) mt_cvlinexy(x,y,length)
|
||||
|
||||
#else
|
||||
|
||||
/* Functions that don't depend on MouseText to draw boxes and lines */
|
||||
void dyn_chline (unsigned char h, unsigned char length);
|
||||
void dyn_cvline (unsigned char v, unsigned char length);
|
||||
void dyn_chlinexy (unsigned char h, unsigned char x, unsigned char y, unsigned char length);
|
||||
void dyn_cvlinexy (unsigned char v, unsigned char x, unsigned char y, unsigned char length);
|
||||
|
||||
#if defined(DYN_BOX_DRAW)
|
||||
/* When the user defines DYN_BOX_DRAW, we'll adapt to the machine
|
||||
** we run on.
|
||||
*/
|
||||
extern char CH_HLINE;
|
||||
extern char CH_VLINE;
|
||||
extern char CH_ULCORNER;
|
||||
extern char CH_URCORNER;
|
||||
extern char CH_LLCORNER;
|
||||
extern char CH_LRCORNER;
|
||||
extern char CH_TTEE;
|
||||
extern char CH_BTEE;
|
||||
extern char CH_LTEE;
|
||||
extern char CH_RTEE;
|
||||
extern char CH_CROSS;
|
||||
|
||||
#else
|
||||
/* Otherwise, fallback to safety and don't use MouseText at all. */
|
||||
#define CH_HLINE '-'
|
||||
#define CH_VLINE '!'
|
||||
#define CH_ULCORNER '+'
|
||||
@@ -95,7 +165,14 @@
|
||||
#define CH_LTEE '+'
|
||||
#define CH_RTEE '+'
|
||||
#define CH_CROSS '+'
|
||||
#endif
|
||||
#endif /* DYN_BOX_DRAW */
|
||||
|
||||
#define _chline(length) dyn_chline(CH_HLINE, length)
|
||||
#define _chlinexy(x, y, length) dyn_chlinexy(CH_HLINE, x ,y, length)
|
||||
#define _cvline(length) dyn_cvline(CH_VLINE, length)
|
||||
#define _cvlinexy(x, y, length) dyn_cvlinexy(CH_VLINE, x, y, length)
|
||||
|
||||
#endif /* __APPLE2ENH__ */
|
||||
|
||||
/* Masks for joy_read */
|
||||
#define JOY_UP_MASK 0x10
|
||||
@@ -127,6 +204,12 @@
|
||||
#define TV_PAL 1
|
||||
#define TV_OTHER 2
|
||||
|
||||
/* Video modes */
|
||||
#define VIDEOMODE_40x24 0x15
|
||||
#define VIDEOMODE_80x24 0x00
|
||||
#define VIDEOMODE_40COL VIDEOMODE_40x24
|
||||
#define VIDEOMODE_80COL VIDEOMODE_80x24
|
||||
|
||||
extern unsigned char _dos_type;
|
||||
/* Valid _dos_type values:
|
||||
**
|
||||
@@ -255,6 +338,14 @@ unsigned char __fastcall__ allow_lowercase (unsigned char onoff);
|
||||
*/
|
||||
#endif
|
||||
|
||||
signed char __fastcall__ videomode (unsigned mode);
|
||||
/* Set the video mode, return the old mode, or -1 if 80-column hardware is not
|
||||
** installed. Call with one of the VIDEOMODE_xx constants.
|
||||
*/
|
||||
|
||||
void waitvsync (void);
|
||||
/* Wait for start of next frame */
|
||||
|
||||
|
||||
|
||||
/* End of apple2.h */
|
||||
|
||||
@@ -46,49 +46,6 @@
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Data */
|
||||
/*****************************************************************************/
|
||||
|
||||
|
||||
|
||||
/* Characters codes */
|
||||
#define CH_DEL 0x7F
|
||||
#define CH_CURS_UP 0x0B
|
||||
#define CH_CURS_DOWN 0x0A
|
||||
|
||||
#define CH_HLINE 0x5F
|
||||
#define CH_VLINE 0xDF
|
||||
#define CH_ULCORNER 0x5F
|
||||
#define CH_URCORNER 0x20
|
||||
#define CH_LLCORNER 0xD4
|
||||
#define CH_LRCORNER 0xDF
|
||||
#define CH_TTEE 0x5F
|
||||
#define CH_BTEE 0xD4
|
||||
#define CH_LTEE 0xD4
|
||||
#define CH_RTEE 0xDF
|
||||
#define CH_CROSS 0xD4
|
||||
|
||||
/* These are defined to be OpenApple + NumberKey */
|
||||
#define CH_F1 0xB1
|
||||
#define CH_F2 0xB2
|
||||
#define CH_F3 0xB3
|
||||
#define CH_F4 0xB4
|
||||
#define CH_F5 0xB5
|
||||
#define CH_F6 0xB6
|
||||
#define CH_F7 0xB7
|
||||
#define CH_F8 0xB8
|
||||
#define CH_F9 0xB9
|
||||
#define CH_F10 0xB0
|
||||
|
||||
/* Video modes */
|
||||
#define VIDEOMODE_40x24 0x15
|
||||
#define VIDEOMODE_80x24 0x00
|
||||
#define VIDEOMODE_40COL VIDEOMODE_40x24
|
||||
#define VIDEOMODE_80COL VIDEOMODE_80x24
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Variables */
|
||||
/*****************************************************************************/
|
||||
@@ -106,21 +63,5 @@ extern void a2e_lo_tgi[];
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Code */
|
||||
/*****************************************************************************/
|
||||
|
||||
|
||||
|
||||
unsigned __fastcall__ videomode (unsigned mode);
|
||||
/* Set the video mode, return the old mode. Call with one of the VIDEOMODE_xx
|
||||
** constants.
|
||||
*/
|
||||
|
||||
void waitvsync (void);
|
||||
/* Wait for start of next frame */
|
||||
|
||||
|
||||
|
||||
/* End of apple2enh.h */
|
||||
#endif
|
||||
|
||||
@@ -40,6 +40,20 @@
|
||||
/*****************************************************************************/
|
||||
|
||||
|
||||
#if (__CPU__ & __CPU_ISET_65SC02__)
|
||||
/* Always inline, three bytes is not more than a jsr */
|
||||
|
||||
#define ntohs(x) \
|
||||
( \
|
||||
__AX__=(x), \
|
||||
asm("phx"), \
|
||||
asm("tax"), \
|
||||
asm("pla"), \
|
||||
__AX__ \
|
||||
)
|
||||
#define htons(x) ntohs(x)
|
||||
|
||||
#else
|
||||
|
||||
#if (__OPT_i__ < 200)
|
||||
int __fastcall__ ntohs (int val);
|
||||
@@ -56,12 +70,12 @@ int __fastcall__ htons (int val);
|
||||
)
|
||||
#define htons(x) ntohs(x)
|
||||
|
||||
#endif
|
||||
#endif /* __OPT_i__ < 200 */
|
||||
|
||||
#endif /* __CPU__ & __CPU_ISET_65SC02__ */
|
||||
|
||||
long __fastcall__ ntohl (long val);
|
||||
long __fastcall__ htonl (long val);
|
||||
|
||||
|
||||
|
||||
/* End of arpa/inet.h */
|
||||
#endif
|
||||
|
||||
120
include/c65.h
Normal file
120
include/c65.h
Normal file
@@ -0,0 +1,120 @@
|
||||
/*****************************************************************************/
|
||||
/* */
|
||||
/* c65.h */
|
||||
/* */
|
||||
/* C65 system specific definitions */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 1998-2013, 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 _C65_H
|
||||
#define _C65_H
|
||||
|
||||
|
||||
|
||||
/* Check for errors */
|
||||
#if !defined(__C65__)
|
||||
# error This module may only be used when compiling for the MEGA65!
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/* Additional key defines */
|
||||
#define CH_F1 133
|
||||
#define CH_F2 137
|
||||
#define CH_F3 134
|
||||
#define CH_F4 138
|
||||
#define CH_F5 135
|
||||
#define CH_F6 139
|
||||
#define CH_F7 136
|
||||
#define CH_F8 140
|
||||
|
||||
/* Color defines */
|
||||
#define COLOR_BLACK 0x00
|
||||
#define COLOR_WHITE 0x01
|
||||
#define COLOR_RED 0x02
|
||||
#define COLOR_CYAN 0x03
|
||||
#define COLOR_PURPLE 0x04
|
||||
#define COLOR_GREEN 0x05
|
||||
#define COLOR_BLUE 0x06
|
||||
#define COLOR_YELLOW 0x07
|
||||
#define COLOR_ORANGE 0x08
|
||||
#define COLOR_BROWN 0x09
|
||||
#define COLOR_LIGHTRED 0x0A
|
||||
#define COLOR_GRAY1 0x0B
|
||||
#define COLOR_GRAY2 0x0C
|
||||
#define COLOR_LIGHTGREEN 0x0D
|
||||
#define COLOR_LIGHTBLUE 0x0E
|
||||
#define COLOR_GRAY3 0x0F
|
||||
|
||||
/* TGI color defines */
|
||||
#define TGI_COLOR_BLACK COLOR_BLACK
|
||||
#define TGI_COLOR_WHITE COLOR_WHITE
|
||||
#define TGI_COLOR_RED COLOR_RED
|
||||
#define TGI_COLOR_CYAN COLOR_CYAN
|
||||
#define TGI_COLOR_PURPLE COLOR_PURPLE
|
||||
#define TGI_COLOR_GREEN COLOR_GREEN
|
||||
#define TGI_COLOR_BLUE COLOR_BLUE
|
||||
#define TGI_COLOR_YELLOW COLOR_YELLOW
|
||||
#define TGI_COLOR_ORANGE COLOR_ORANGE
|
||||
#define TGI_COLOR_BROWN COLOR_BROWN
|
||||
#define TGI_COLOR_LIGHTRED COLOR_LIGHTRED
|
||||
#define TGI_COLOR_GRAY1 COLOR_GRAY1
|
||||
#define TGI_COLOR_GRAY2 COLOR_GRAY2
|
||||
#define TGI_COLOR_LIGHTGREEN COLOR_LIGHTGREEN
|
||||
#define TGI_COLOR_LIGHTBLUE COLOR_LIGHTBLUE
|
||||
#define TGI_COLOR_GRAY3 COLOR_GRAY3
|
||||
|
||||
/* Masks for joy_read */
|
||||
#define JOY_UP_MASK 0x01
|
||||
#define JOY_DOWN_MASK 0x02
|
||||
#define JOY_LEFT_MASK 0x04
|
||||
#define JOY_RIGHT_MASK 0x08
|
||||
#define JOY_BTN_1_MASK 0x10
|
||||
|
||||
|
||||
/* Define hardware */
|
||||
#include <_vic3.h>
|
||||
#define VIC (*(struct __vic2*)0xD000)
|
||||
|
||||
#include <_sid.h>
|
||||
#define SID1 (*(struct __sid*)0xD400)
|
||||
#define SID2 (*(struct __sid*)0xD420)
|
||||
|
||||
#include <_6526.h>
|
||||
#define CIA1 (*(struct __6526*)0xDC00)
|
||||
#define CIA2 (*(struct __6526*)0xDD00)
|
||||
|
||||
|
||||
/* Define special memory areas */
|
||||
#define COLOR_RAM ((unsigned char*)0xD800)
|
||||
|
||||
|
||||
/* End of c65.h */
|
||||
#endif
|
||||
@@ -67,6 +67,10 @@
|
||||
# include <pet.h>
|
||||
#elif defined(__CX16__) && !defined(_CX16_H)
|
||||
# include <cx16.h>
|
||||
#elif defined(__C65__) && !defined(_C65_H)
|
||||
# include <c65.h>
|
||||
#elif defined(__MEGA65__) && !defined(_MEGA65_H)
|
||||
# include <mega65.h>
|
||||
#endif
|
||||
|
||||
/* Include definitions for CBM file types */
|
||||
|
||||
@@ -110,7 +110,23 @@
|
||||
#define COLOR_LIGHTBLUE (BCOLOR_LIGHTBLUE | CATTR_LUMA7)
|
||||
#define COLOR_GRAY3 (BCOLOR_WHITE | CATTR_LUMA5)
|
||||
|
||||
|
||||
/* TGI color defines */
|
||||
#define TGI_COLOR_BLACK (BCOLOR_BLACK)
|
||||
#define TGI_COLOR_WHITE (BCOLOR_WHITE | CATTR_LUMA7)
|
||||
#define TGI_COLOR_RED (BCOLOR_RED | CATTR_LUMA4)
|
||||
#define TGI_COLOR_CYAN (BCOLOR_CYAN | CATTR_LUMA7)
|
||||
#define TGI_COLOR_PURPLE (BCOLOR_LIGHTVIOLET | CATTR_LUMA7)
|
||||
#define TGI_COLOR_GREEN (BCOLOR_GREEN | CATTR_LUMA7)
|
||||
#define TGI_COLOR_BLUE (BCOLOR_BLUE | CATTR_LUMA7)
|
||||
#define TGI_COLOR_YELLOW (BCOLOR_YELLOW | CATTR_LUMA7)
|
||||
#define TGI_COLOR_ORANGE (BCOLOR_ORANGE | CATTR_LUMA7)
|
||||
#define TGI_COLOR_BROWN (BCOLOR_BROWN | CATTR_LUMA7)
|
||||
#define TGI_COLOR_LIGHTRED (BCOLOR_RED | CATTR_LUMA7)
|
||||
#define TGI_COLOR_GRAY1 (BCOLOR_WHITE | CATTR_LUMA1)
|
||||
#define TGI_COLOR_GRAY2 (BCOLOR_WHITE | CATTR_LUMA3)
|
||||
#define TGI_COLOR_LIGHTGREEN (BCOLOR_LIGHTGREEN | CATTR_LUMA7)
|
||||
#define TGI_COLOR_LIGHTBLUE (BCOLOR_LIGHTBLUE | CATTR_LUMA7)
|
||||
#define TGI_COLOR_GRAY3 (BCOLOR_WHITE | CATTR_LUMA5)
|
||||
|
||||
/* Masks for joy_read */
|
||||
#define JOY_UP_MASK 0x01
|
||||
|
||||
@@ -110,6 +110,21 @@ char cgetc (void);
|
||||
** 1 (see below), a blinking cursor is displayed while waiting.
|
||||
*/
|
||||
|
||||
char* __fastcall__ cgets (char* buffer, int size);
|
||||
/* Get a string of characters directly from the console. The function returns
|
||||
** when size - 1 characters or either CR/LF are read. Note the parameters are
|
||||
** more aligned with stdio fgets() as opposed to the quirky "standard" conio
|
||||
** cgets(). Besides providing saner parameters, the function also echoes CRLF
|
||||
** when either CR/LF are read but does NOT append either in the buffer. This is
|
||||
** to correspond to stdio fgets() which echoes CRLF, but prevents a "gotcha"
|
||||
** where the buffer might not be able to accommodate both CR and LF at the end.
|
||||
**
|
||||
** param: buffer - where to save the input, must be non-NULL
|
||||
** param: size - size of the buffer, must be > 1
|
||||
** return: buffer if successful, NULL on error
|
||||
** author: Russell-S-Harper
|
||||
*/
|
||||
|
||||
int cscanf (const char* format, ...);
|
||||
/* Like scanf(), but uses direct keyboard input */
|
||||
|
||||
@@ -216,7 +231,18 @@ void __fastcall__ cputhex16 (unsigned val);
|
||||
# define cpeekrevers() _cpeekrevers()
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef _chline
|
||||
# define chline(len) _chline(len)
|
||||
#endif
|
||||
#ifdef _cvline
|
||||
# define cvline(len) _cvline(len)
|
||||
#endif
|
||||
#ifdef _chlinexy
|
||||
# define chlinexy(x, y, len) _chlinexy(x, y, len)
|
||||
#endif
|
||||
#ifdef _cvlinexy
|
||||
# define cvlinexy(x, y, len) _cvlinexy(x, y, len)
|
||||
#endif
|
||||
|
||||
/* End of conio.h */
|
||||
#endif
|
||||
|
||||
120
include/mega65.h
Normal file
120
include/mega65.h
Normal file
@@ -0,0 +1,120 @@
|
||||
/*****************************************************************************/
|
||||
/* */
|
||||
/* mega65.h */
|
||||
/* */
|
||||
/* MEGA65 system specific definitions */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 1998-2013, 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 _MEGA65_H
|
||||
#define _MEGA65_H
|
||||
|
||||
|
||||
|
||||
/* Check for errors */
|
||||
#if !defined(__MEGA65__)
|
||||
# error This module may only be used when compiling for the MEGA65!
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/* Additional key defines */
|
||||
#define CH_F1 133
|
||||
#define CH_F2 137
|
||||
#define CH_F3 134
|
||||
#define CH_F4 138
|
||||
#define CH_F5 135
|
||||
#define CH_F6 139
|
||||
#define CH_F7 136
|
||||
#define CH_F8 140
|
||||
|
||||
/* Color defines */
|
||||
#define COLOR_BLACK 0x00
|
||||
#define COLOR_WHITE 0x01
|
||||
#define COLOR_RED 0x02
|
||||
#define COLOR_CYAN 0x03
|
||||
#define COLOR_PURPLE 0x04
|
||||
#define COLOR_GREEN 0x05
|
||||
#define COLOR_BLUE 0x06
|
||||
#define COLOR_YELLOW 0x07
|
||||
#define COLOR_ORANGE 0x08
|
||||
#define COLOR_BROWN 0x09
|
||||
#define COLOR_LIGHTRED 0x0A
|
||||
#define COLOR_GRAY1 0x0B
|
||||
#define COLOR_GRAY2 0x0C
|
||||
#define COLOR_LIGHTGREEN 0x0D
|
||||
#define COLOR_LIGHTBLUE 0x0E
|
||||
#define COLOR_GRAY3 0x0F
|
||||
|
||||
/* TGI color defines */
|
||||
#define TGI_COLOR_BLACK COLOR_BLACK
|
||||
#define TGI_COLOR_WHITE COLOR_WHITE
|
||||
#define TGI_COLOR_RED COLOR_RED
|
||||
#define TGI_COLOR_CYAN COLOR_CYAN
|
||||
#define TGI_COLOR_PURPLE COLOR_PURPLE
|
||||
#define TGI_COLOR_GREEN COLOR_GREEN
|
||||
#define TGI_COLOR_BLUE COLOR_BLUE
|
||||
#define TGI_COLOR_YELLOW COLOR_YELLOW
|
||||
#define TGI_COLOR_ORANGE COLOR_ORANGE
|
||||
#define TGI_COLOR_BROWN COLOR_BROWN
|
||||
#define TGI_COLOR_LIGHTRED COLOR_LIGHTRED
|
||||
#define TGI_COLOR_GRAY1 COLOR_GRAY1
|
||||
#define TGI_COLOR_GRAY2 COLOR_GRAY2
|
||||
#define TGI_COLOR_LIGHTGREEN COLOR_LIGHTGREEN
|
||||
#define TGI_COLOR_LIGHTBLUE COLOR_LIGHTBLUE
|
||||
#define TGI_COLOR_GRAY3 COLOR_GRAY3
|
||||
|
||||
/* Masks for joy_read */
|
||||
#define JOY_UP_MASK 0x01
|
||||
#define JOY_DOWN_MASK 0x02
|
||||
#define JOY_LEFT_MASK 0x04
|
||||
#define JOY_RIGHT_MASK 0x08
|
||||
#define JOY_BTN_1_MASK 0x10
|
||||
|
||||
|
||||
/* Define hardware */
|
||||
#include <_vic3.h>
|
||||
#define VIC (*(struct __vic2*)0xD000)
|
||||
|
||||
#include <_sid.h>
|
||||
#define SID1 (*(struct __sid*)0xD400)
|
||||
#define SID2 (*(struct __sid*)0xD420)
|
||||
|
||||
#include <_6526.h>
|
||||
#define CIA1 (*(struct __6526*)0xDC00)
|
||||
#define CIA2 (*(struct __6526*)0xDD00)
|
||||
|
||||
|
||||
/* Define special memory areas */
|
||||
#define COLOR_RAM ((unsigned char*)0xD800)
|
||||
|
||||
|
||||
/* End of mega65.h */
|
||||
#endif
|
||||
@@ -57,8 +57,7 @@
|
||||
/* The addresses of the static drivers */
|
||||
extern void plus4_stdjoy_joy[]; /* Referred to by joy_static_stddrv[] */
|
||||
extern void plus4_stdser_ser[]; /* Referred to by ser_static_stddrv[] */
|
||||
|
||||
|
||||
extern void ted_hi_tgi[];
|
||||
|
||||
/* End of plus4.h */
|
||||
#endif
|
||||
|
||||
@@ -37,6 +37,8 @@
|
||||
# include <apple2enh.h>
|
||||
#elif defined(__APPLE2__)
|
||||
# include <apple2.h>
|
||||
#elif defined(__AGAT__)
|
||||
# include <agat.h>
|
||||
#elif defined(__ATARI__)
|
||||
# include <atari.h>
|
||||
#elif defined(__ATARI2600__)
|
||||
|
||||
@@ -141,15 +141,16 @@ unsigned char tgi_getmaxcolor (void);
|
||||
** then be getmaxcolor()+1).
|
||||
*/
|
||||
|
||||
void __fastcall__ tgi_setcolor (unsigned char color);
|
||||
/* Set the current drawing color. */
|
||||
void __fastcall__ tgi_setcolor (unsigned char color_index);
|
||||
/* Set the current drawing color (palette index). */
|
||||
|
||||
unsigned char tgi_getcolor (void);
|
||||
/* Return the current drawing color. */
|
||||
/* Return the current drawing color (palette index). */
|
||||
|
||||
void __fastcall__ tgi_setpalette (const unsigned char* palette);
|
||||
/* Set the palette (not available with all drivers/hardware). palette is
|
||||
** a pointer to as many entries as there are colors.
|
||||
** a pointer to as many entries as there are colors required for the drivers
|
||||
** palette. This palette is the (only) place where to use the TGI_COLOR values.
|
||||
*/
|
||||
|
||||
const unsigned char* tgi_getpalette (void);
|
||||
|
||||
Reference in New Issue
Block a user