2001-10-02 18:48:54 +00:00
|
|
|
/*****************************************************************************/
|
2005-03-26 17:20:27 +00:00
|
|
|
/* */
|
2013-05-09 11:56:54 +00:00
|
|
|
/* apple2.h */
|
2005-03-26 17:20:27 +00:00
|
|
|
/* */
|
2013-05-09 11:56:54 +00:00
|
|
|
/* Apple ][ system specific definitions */
|
2005-03-26 17:20:27 +00:00
|
|
|
/* */
|
|
|
|
/* */
|
|
|
|
/* */
|
|
|
|
/* (C) 2000 Kevin Ruland, <kevin@rodin.wustl.edu> */
|
|
|
|
/* (C) 2003 Ullrich von Bassewitz, <uz@cc65.org> */
|
|
|
|
/* */
|
|
|
|
/* */
|
|
|
|
/* This software is provided 'as-is', without any expressed or implied */
|
2001-10-02 18:48:54 +00:00
|
|
|
/* warranty. In no event will the authors be held liable for any damages */
|
2005-03-26 17:20:27 +00:00
|
|
|
/* arising from the use of this software. */
|
|
|
|
/* */
|
2001-10-02 18:48:54 +00:00
|
|
|
/* Permission is granted to anyone to use this software for any purpose, */
|
|
|
|
/* including commercial applications, and to alter it and redistribute it */
|
2005-03-26 17:20:27 +00:00
|
|
|
/* freely, subject to the following restrictions: */
|
|
|
|
/* */
|
2001-10-02 18:48:54 +00:00
|
|
|
/* 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 */
|
2005-03-26 17:20:27 +00:00
|
|
|
/* appreciated but is not required. */
|
2001-10-02 18:48:54 +00:00
|
|
|
/* 2. Altered source versions must be plainly marked as such, and must not */
|
2005-03-26 17:20:27 +00:00
|
|
|
/* be misrepresented as being the original software. */
|
|
|
|
/* 3. This notice may not be removed or altered from any source */
|
|
|
|
/* distribution. */
|
|
|
|
/* */
|
2001-10-02 18:48:54 +00:00
|
|
|
/*****************************************************************************/
|
2000-05-28 13:40:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef _APPLE2_H
|
|
|
|
#define _APPLE2_H
|
|
|
|
|
|
|
|
|
|
|
|
|
2001-09-19 08:46:07 +00:00
|
|
|
/* Check for errors */
|
2013-06-17 19:34:08 +00:00
|
|
|
#if !defined(__APPLE2__)
|
2001-09-19 08:46:07 +00:00
|
|
|
# error This module may only be used when compiling for the Apple ][!
|
|
|
|
#endif
|
|
|
|
|
2017-07-26 15:15:49 +00:00
|
|
|
#include <apple2_filetype.h>
|
2001-09-19 08:46:07 +00:00
|
|
|
|
2018-02-02 11:28:22 +00:00
|
|
|
|
|
|
|
|
2003-08-26 20:36:44 +00:00
|
|
|
/*****************************************************************************/
|
2013-05-09 11:56:54 +00:00
|
|
|
/* Data */
|
2003-08-26 20:36:44 +00:00
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-04-25 11:16:56 +00:00
|
|
|
/* Color defines */
|
2018-08-19 21:40:50 +00:00
|
|
|
#define COLOR_BLACK 0x00
|
|
|
|
#define COLOR_WHITE 0x01
|
2011-04-25 11:16:56 +00:00
|
|
|
|
|
|
|
/* TGI color defines */
|
2018-08-19 21:40:50 +00:00
|
|
|
#define TGI_COLOR_BLACK 0x00
|
|
|
|
#define TGI_COLOR_GREEN 0x01
|
2022-02-01 23:58:50 +00:00
|
|
|
#define TGI_COLOR_PURPLE 0x02
|
2018-08-19 21:40:50 +00:00
|
|
|
#define TGI_COLOR_WHITE 0x03
|
|
|
|
#define TGI_COLOR_BLACK2 0x04
|
|
|
|
#define TGI_COLOR_ORANGE 0x05
|
|
|
|
#define TGI_COLOR_BLUE 0x06
|
|
|
|
#define TGI_COLOR_WHITE2 0x07
|
|
|
|
|
|
|
|
#define TGI_COLOR_MAGENTA TGI_COLOR_BLACK2
|
|
|
|
#define TGI_COLOR_DARKBLUE TGI_COLOR_WHITE2
|
|
|
|
#define TGI_COLOR_DARKGREEN 0x08
|
|
|
|
#define TGI_COLOR_GRAY 0x09
|
|
|
|
#define TGI_COLOR_CYAN 0x0A
|
|
|
|
#define TGI_COLOR_BROWN 0x0B
|
|
|
|
#define TGI_COLOR_GRAY2 0x0C
|
|
|
|
#define TGI_COLOR_PINK 0x0D
|
|
|
|
#define TGI_COLOR_YELLOW 0x0E
|
|
|
|
#define TGI_COLOR_AQUA 0x0F
|
2000-05-28 13:40:48 +00:00
|
|
|
|
|
|
|
/* Characters codes */
|
2018-08-19 21:40:50 +00:00
|
|
|
#define CH_ENTER 0x0D
|
|
|
|
#define CH_ESC 0x1B
|
|
|
|
#define CH_CURS_LEFT 0x08
|
|
|
|
#define CH_CURS_RIGHT 0x15
|
|
|
|
|
|
|
|
#if !defined(__APPLE2ENH__)
|
|
|
|
#define CH_HLINE '-'
|
|
|
|
#define CH_VLINE '!'
|
|
|
|
#define CH_ULCORNER '+'
|
|
|
|
#define CH_URCORNER '+'
|
|
|
|
#define CH_LLCORNER '+'
|
|
|
|
#define CH_LRCORNER '+'
|
|
|
|
#define CH_TTEE '+'
|
|
|
|
#define CH_BTEE '+'
|
|
|
|
#define CH_LTEE '+'
|
|
|
|
#define CH_RTEE '+'
|
|
|
|
#define CH_CROSS '+'
|
|
|
|
#endif
|
2000-05-28 13:40:48 +00:00
|
|
|
|
2017-08-19 17:11:28 +00:00
|
|
|
/* 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
|
|
|
|
|
2003-08-26 20:36:44 +00:00
|
|
|
/* Return codes for get_ostype */
|
2018-08-19 21:40:50 +00:00
|
|
|
#define APPLE_UNKNOWN 0x00
|
|
|
|
#define APPLE_II 0x10 /* Apple ][ */
|
|
|
|
#define APPLE_IIPLUS 0x11 /* Apple ][+ */
|
|
|
|
#define APPLE_IIIEM 0x20 /* Apple /// (emulation) */
|
|
|
|
#define APPLE_IIE 0x30 /* Apple //e */
|
|
|
|
#define APPLE_IIEENH 0x31 /* Apple //e (enhanced) */
|
2020-06-14 19:54:33 +00:00
|
|
|
#define APPLE_IIECARD 0x32 /* Apple //e Option Card */
|
|
|
|
#define APPLE_IIC 0x40 /* Apple //c */
|
|
|
|
#define APPLE_IIC35 0x41 /* Apple //c (3.5 ROM) */
|
|
|
|
#define APPLE_IICEXP 0x43 /* Apple //c (Mem. Exp.) */
|
|
|
|
#define APPLE_IICREV 0x44 /* Apple //c (Rev. Mem. Exp.) */
|
|
|
|
#define APPLE_IICPLUS 0x45 /* Apple //c Plus */
|
2018-08-19 21:40:50 +00:00
|
|
|
#define APPLE_IIGS 0x80 /* Apple IIgs */
|
|
|
|
#define APPLE_IIGS1 0x81 /* Apple IIgs (ROM 1) */
|
|
|
|
#define APPLE_IIGS3 0x83 /* Apple IIgs (ROM 3) */
|
2005-03-26 17:20:27 +00:00
|
|
|
|
|
|
|
extern unsigned char _dos_type;
|
|
|
|
/* Valid _dos_type values:
|
2014-06-30 09:10:35 +00:00
|
|
|
**
|
|
|
|
** AppleDOS 3.3 - 0x00
|
|
|
|
** ProDOS 8 1.0.1 - 0x10
|
|
|
|
** ProDOS 8 1.0.2 - 0x10
|
|
|
|
** ProDOS 8 1.1.1 - 0x11
|
|
|
|
** ProDOS 8 1.2 - 0x12
|
|
|
|
** ProDOS 8 1.3 - 0x13
|
|
|
|
** ProDOS 8 1.4 - 0x14
|
|
|
|
** ProDOS 8 1.5 - 0x15
|
|
|
|
** ProDOS 8 1.6 - 0x16
|
|
|
|
** ProDOS 8 1.7 - 0x17
|
|
|
|
** ProDOS 8 1.8 - 0x18
|
|
|
|
** ProDOS 8 1.9 - 0x18 (!)
|
|
|
|
** ProDOS 8 2.0.1 - 0x21
|
|
|
|
** ProDOS 8 2.0.2 - 0x22
|
|
|
|
** ProDOS 8 2.0.3 - 0x23
|
2018-01-18 11:37:21 +00:00
|
|
|
** ProDOS 8 2.4.x - 0x24
|
2014-06-30 09:10:35 +00:00
|
|
|
*/
|
2005-03-26 17:20:27 +00:00
|
|
|
|
2003-08-26 20:36:44 +00:00
|
|
|
|
|
|
|
|
2011-01-05 16:09:08 +00:00
|
|
|
/*****************************************************************************/
|
|
|
|
/* Variables */
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* The file stream implementation and the POSIX I/O functions will use the
|
2017-07-28 16:09:58 +00:00
|
|
|
** following struct to set the date and time stamp on files. This specificially
|
|
|
|
** applies to the open and fopen functions.
|
2014-06-30 09:10:35 +00:00
|
|
|
*/
|
2013-08-03 13:42:16 +00:00
|
|
|
extern struct {
|
2013-08-03 17:08:36 +00:00
|
|
|
struct {
|
|
|
|
unsigned day :5;
|
|
|
|
unsigned mon :4;
|
|
|
|
unsigned year :7;
|
2022-04-17 14:05:19 +00:00
|
|
|
} createdate; /* Current date: 0 */
|
2013-08-03 17:08:36 +00:00
|
|
|
struct {
|
|
|
|
unsigned char min;
|
|
|
|
unsigned char hour;
|
2022-04-17 14:05:19 +00:00
|
|
|
} createtime; /* Current time: 0 */
|
2013-08-03 17:08:36 +00:00
|
|
|
} _datetime;
|
2011-01-05 16:09:08 +00:00
|
|
|
|
2012-11-07 23:20:58 +00:00
|
|
|
/* The addresses of the static drivers */
|
2013-06-17 19:34:08 +00:00
|
|
|
#if !defined(__APPLE2ENH__)
|
2013-05-09 08:20:03 +00:00
|
|
|
extern void a2_auxmem_emd[];
|
|
|
|
extern void a2_stdjoy_joy[]; /* Referred to by joy_static_stddrv[] */
|
|
|
|
extern void a2_stdmou_mou[]; /* Referred to by mouse_static_stddrv[] */
|
2022-12-22 17:06:16 +00:00
|
|
|
extern void a2_ssc_ser[]; /* Referred to by ser_static_stddrv[] */
|
2013-05-09 08:20:03 +00:00
|
|
|
extern void a2_hi_tgi[]; /* Referred to by tgi_static_stddrv[] */
|
|
|
|
extern void a2_lo_tgi[];
|
|
|
|
#endif
|
2012-11-07 23:20:58 +00:00
|
|
|
|
2011-01-05 16:09:08 +00:00
|
|
|
|
|
|
|
|
2003-08-26 20:36:44 +00:00
|
|
|
/*****************************************************************************/
|
2013-05-09 11:56:54 +00:00
|
|
|
/* Code */
|
2003-08-26 20:36:44 +00:00
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
unsigned char get_ostype (void);
|
2004-03-11 21:54:22 +00:00
|
|
|
/* Get the machine type. Returns one of the APPLE_xxx codes. */
|
2003-08-26 20:36:44 +00:00
|
|
|
|
2009-09-14 19:58:06 +00:00
|
|
|
void rebootafterexit (void);
|
|
|
|
/* Reboot machine after program termination has completed. */
|
|
|
|
|
2011-04-25 11:16:56 +00:00
|
|
|
#define ser_apple2_slot(num) ser_ioctl (0, (void*) (num))
|
2009-12-13 11:21:59 +00:00
|
|
|
/* Select a slot number from 1 to 7 prior to ser_open.
|
2014-06-30 09:10:35 +00:00
|
|
|
** The default slot number is 2.
|
|
|
|
*/
|
2009-12-13 11:21:59 +00:00
|
|
|
|
2011-04-25 11:16:56 +00:00
|
|
|
#define tgi_apple2_mix(onoff) tgi_ioctl (0, (void*) (onoff))
|
2009-12-12 23:07:21 +00:00
|
|
|
/* If onoff is 1, graphics/text mixed mode is enabled.
|
2014-06-30 09:10:35 +00:00
|
|
|
** If onoff is 0, graphics/text mixed mode is disabled.
|
|
|
|
*/
|
2009-12-12 23:07:21 +00:00
|
|
|
|
2005-03-26 17:20:27 +00:00
|
|
|
/* The following #defines will cause the matching functions calls in conio.h
|
2014-06-30 09:10:35 +00:00
|
|
|
** to be overlaid by macros with the same names, saving the function call
|
|
|
|
** overhead.
|
|
|
|
*/
|
2018-08-19 21:40:50 +00:00
|
|
|
#define _textcolor(color) COLOR_WHITE
|
|
|
|
#define _bgcolor(color) COLOR_BLACK
|
|
|
|
#define _bordercolor(color) COLOR_BLACK
|
2020-07-12 20:19:38 +00:00
|
|
|
#define _cpeekcolor() COLOR_WHITE
|
|
|
|
#define _cpeekrevers() 0
|
2005-03-26 17:20:27 +00:00
|
|
|
|
2000-05-28 13:40:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* End of apple2.h */
|
|
|
|
#endif
|