Merge branch 'master' into kbrepeat
This commit is contained in:
@@ -50,6 +50,7 @@ typedef unsigned size_t;
|
||||
#define CPU_6502 0
|
||||
#define CPU_65C02 1
|
||||
#define CPU_65816 2
|
||||
#define CPU_4510 3
|
||||
|
||||
unsigned char getcpu (void);
|
||||
/* Detect the CPU the program is running on */
|
||||
|
||||
@@ -57,42 +57,42 @@ struct __antic {
|
||||
/* antic instruction set */
|
||||
|
||||
/* absolute instructions (non mode lines) */
|
||||
#define DL_JMP 1
|
||||
#define DL_JVB 65
|
||||
#define DL_JMP (unsigned char) 1
|
||||
#define DL_JVB (unsigned char) 65
|
||||
|
||||
#define DL_BLK1 0
|
||||
#define DL_BLK2 16
|
||||
#define DL_BLK3 32
|
||||
#define DL_BLK4 48
|
||||
#define DL_BLK5 64
|
||||
#define DL_BLK6 80
|
||||
#define DL_BLK7 96
|
||||
#define DL_BLK8 112
|
||||
#define DL_BLK1 (unsigned char) 0
|
||||
#define DL_BLK2 (unsigned char) 16
|
||||
#define DL_BLK3 (unsigned char) 32
|
||||
#define DL_BLK4 (unsigned char) 48
|
||||
#define DL_BLK5 (unsigned char) 64
|
||||
#define DL_BLK6 (unsigned char) 80
|
||||
#define DL_BLK7 (unsigned char) 96
|
||||
#define DL_BLK8 (unsigned char) 112
|
||||
|
||||
/* absolute instructions (mode lines) */
|
||||
#define DL_CHR40x8x1 2 /* monochrome, 40 character & 8 scanlines per mode line (GR. 0) */
|
||||
#define DL_CHR40x10x1 3 /* monochrome, 40 character & 10 scanlines per mode line */
|
||||
#define DL_CHR40x8x4 4 /* colour, 40 character & 8 scanlines per mode line (GR. 12) */
|
||||
#define DL_CHR40x16x4 5 /* colour, 40 character & 16 scanlines per mode line (GR. 13) */
|
||||
#define DL_CHR20x8x2 6 /* colour (duochrome per character), 20 character & 8 scanlines per mode line (GR. 1) */
|
||||
#define DL_CHR20x16x2 7 /* colour (duochrome per character), 20 character & 16 scanlines per mode line (GR. 2) */
|
||||
#define DL_CHR40x8x1 (unsigned char) 2 /* monochrome, 40 character & 8 scanlines per mode line (GR. 0) */
|
||||
#define DL_CHR40x10x1 (unsigned char) 3 /* monochrome, 40 character & 10 scanlines per mode line */
|
||||
#define DL_CHR40x8x4 (unsigned char) 4 /* colour, 40 character & 8 scanlines per mode line (GR. 12) */
|
||||
#define DL_CHR40x16x4 (unsigned char) 5 /* colour, 40 character & 16 scanlines per mode line (GR. 13) */
|
||||
#define DL_CHR20x8x2 (unsigned char) 6 /* colour (duochrome per character), 20 character & 8 scanlines per mode line (GR. 1) */
|
||||
#define DL_CHR20x16x2 (unsigned char) 7 /* colour (duochrome per character), 20 character & 16 scanlines per mode line (GR. 2) */
|
||||
|
||||
#define DL_MAP40x8x4 8 /* colour, 40 pixel & 8 scanlines per mode line (GR. 3) */
|
||||
#define DL_MAP80x4x2 9 /* 'duochrome', 80 pixel & 4 scanlines per mode line (GR.4) */
|
||||
#define DL_MAP80x4x4 10 /* colour, 80 pixel & 4 scanlines per mode line (GR.5) */
|
||||
#define DL_MAP160x2x2 11 /* 'duochrome', 160 pixel & 2 scanlines per mode line (GR.6) */
|
||||
#define DL_MAP160x1x2 12 /* 'duochrome', 160 pixel & 1 scanline per mode line (GR.14) */
|
||||
#define DL_MAP160x2x4 13 /* 4 colours, 160 pixel & 2 scanlines per mode line (GR.7) */
|
||||
#define DL_MAP160x1x4 14 /* 4 colours, 160 pixel & 1 scanline per mode line (GR.15) */
|
||||
#define DL_MAP320x1x1 15 /* monochrome, 320 pixel & 1 scanline per mode line (GR.8) */
|
||||
#define DL_MAP40x8x4 (unsigned char) 8 /* colour, 40 pixel & 8 scanlines per mode line (GR. 3) */
|
||||
#define DL_MAP80x4x2 (unsigned char) 9 /* 'duochrome', 80 pixel & 4 scanlines per mode line (GR.4) */
|
||||
#define DL_MAP80x4x4 (unsigned char) 10 /* colour, 80 pixel & 4 scanlines per mode line (GR.5) */
|
||||
#define DL_MAP160x2x2 (unsigned char) 11 /* 'duochrome', 160 pixel & 2 scanlines per mode line (GR.6) */
|
||||
#define DL_MAP160x1x2 (unsigned char) 12 /* 'duochrome', 160 pixel & 1 scanline per mode line (GR.14) */
|
||||
#define DL_MAP160x2x4 (unsigned char) 13 /* 4 colours, 160 pixel & 2 scanlines per mode line (GR.7) */
|
||||
#define DL_MAP160x1x4 (unsigned char) 14 /* 4 colours, 160 pixel & 1 scanline per mode line (GR.15) */
|
||||
#define DL_MAP320x1x1 (unsigned char) 15 /* monochrome, 320 pixel & 1 scanline per mode line (GR.8) */
|
||||
|
||||
/* modifiers on mode lines */
|
||||
#define DL_HSCROL 16
|
||||
#define DL_VSCROL 32
|
||||
#define DL_LMS 64
|
||||
#define DL_HSCROL(x) (unsigned char)((x) | 16)
|
||||
#define DL_VSCROL(x) (unsigned char)((x) | 32)
|
||||
#define DL_LMS(x) (unsigned char)((x) | 64)
|
||||
|
||||
/* general modifier */
|
||||
#define DL_DLI 128
|
||||
#define DL_DLI(x) (unsigned char)((x) | 128)
|
||||
|
||||
/* End of _antic.h */
|
||||
#endif /* #ifndef __ANTIC_H */
|
||||
|
||||
26
include/_riot.h
Normal file
26
include/_riot.h
Normal file
@@ -0,0 +1,26 @@
|
||||
/*****************************************************************************/
|
||||
/* */
|
||||
/* Atari VCS 2600 RIOT registers addresses */
|
||||
/* */
|
||||
/* Source: DASM - vcs.h */
|
||||
/* */
|
||||
/* Florent Flament (contact@florentflament.com), 2017 */
|
||||
/* */
|
||||
/*****************************************************************************/
|
||||
|
||||
/* RIOT registers */
|
||||
struct __riot {
|
||||
unsigned char swcha;
|
||||
unsigned char swacnt;
|
||||
unsigned char swchb;
|
||||
unsigned char swbcnt;
|
||||
unsigned char intim;
|
||||
unsigned char timint;
|
||||
|
||||
unsigned char unused[14];
|
||||
|
||||
unsigned char tim1t;
|
||||
unsigned char tim8t;
|
||||
unsigned char tim64t;
|
||||
unsigned char t1024t;
|
||||
};
|
||||
100
include/_tia.h
Normal file
100
include/_tia.h
Normal file
@@ -0,0 +1,100 @@
|
||||
/*****************************************************************************/
|
||||
/* */
|
||||
/* Atari VCS 2600 TIA registers addresses */
|
||||
/* */
|
||||
/* Source: DASM - vcs.h */
|
||||
/* */
|
||||
/* Florent Flament (contact@florentflament.com), 2017 */
|
||||
/* */
|
||||
/*****************************************************************************/
|
||||
|
||||
/* TIA write / read registers */
|
||||
struct __tia {
|
||||
union {
|
||||
unsigned char vsync;
|
||||
unsigned char cxm0p;
|
||||
};
|
||||
union {
|
||||
unsigned char vblank;
|
||||
unsigned char cxm1p;
|
||||
};
|
||||
union {
|
||||
unsigned char wsync;
|
||||
unsigned char cxp0fb;
|
||||
};
|
||||
union {
|
||||
unsigned char rsync;
|
||||
unsigned char cxp1fb;
|
||||
};
|
||||
union {
|
||||
unsigned char nusiz0;
|
||||
unsigned char cxm0fb;
|
||||
};
|
||||
union {
|
||||
unsigned char nusiz1;
|
||||
unsigned char cxm1fb;
|
||||
};
|
||||
union {
|
||||
unsigned char colup0;
|
||||
unsigned char cxblpf;
|
||||
};
|
||||
union {
|
||||
unsigned char colup1;
|
||||
unsigned char cxppmm;
|
||||
};
|
||||
union {
|
||||
unsigned char colupf;
|
||||
unsigned char inpt0;
|
||||
};
|
||||
union {
|
||||
unsigned char colubk;
|
||||
unsigned char inpt1;
|
||||
};
|
||||
union {
|
||||
unsigned char ctrlpf;
|
||||
unsigned char inpt2;
|
||||
};
|
||||
union {
|
||||
unsigned char refp0;
|
||||
unsigned char inpt3;
|
||||
};
|
||||
union {
|
||||
unsigned char refp1;
|
||||
unsigned char inpt4;
|
||||
};
|
||||
union {
|
||||
unsigned char pf0;
|
||||
unsigned char inpt5;
|
||||
};
|
||||
unsigned char pf1;
|
||||
unsigned char pf2;
|
||||
unsigned char resp0;
|
||||
unsigned char resp1;
|
||||
unsigned char resm0;
|
||||
unsigned char resm1;
|
||||
unsigned char resbl;
|
||||
unsigned char audc0;
|
||||
unsigned char audc1;
|
||||
unsigned char audf0;
|
||||
unsigned char audf1;
|
||||
unsigned char audv0;
|
||||
unsigned char audv1;
|
||||
unsigned char grp0;
|
||||
unsigned char grp1;
|
||||
unsigned char enam0;
|
||||
unsigned char enam1;
|
||||
unsigned char enabl;
|
||||
unsigned char hmp0;
|
||||
unsigned char hmp1;
|
||||
unsigned char hmm0;
|
||||
unsigned char hmm1;
|
||||
unsigned char hmbl;
|
||||
unsigned char vdelp0;
|
||||
unsigned char vdelp1;
|
||||
unsigned char vdelbl;
|
||||
unsigned char resmp0;
|
||||
unsigned char resmp1;
|
||||
unsigned char hmove;
|
||||
unsigned char hmclr;
|
||||
unsigned char cxclr;
|
||||
};
|
||||
@@ -42,6 +42,7 @@
|
||||
#endif
|
||||
|
||||
|
||||
#include <apple2_filetype.h>
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Data */
|
||||
@@ -136,11 +137,9 @@ extern unsigned char _dos_type;
|
||||
|
||||
|
||||
/* The file stream implementation and the POSIX I/O functions will use the
|
||||
** following variables to determine the file type, aux type and creation time
|
||||
** stamp to use.
|
||||
** following struct to set the date and time stamp on files. This specificially
|
||||
** applies to the open and fopen functions.
|
||||
*/
|
||||
extern unsigned char _filetype; /* Default: 6 */
|
||||
extern unsigned int _auxtype; /* Default: 0 */
|
||||
extern struct {
|
||||
struct {
|
||||
unsigned day :5;
|
||||
|
||||
322
include/apple2_filetype.h
Normal file
322
include/apple2_filetype.h
Normal file
@@ -0,0 +1,322 @@
|
||||
/*****************************************************************************/
|
||||
/* */
|
||||
/* apple2_filetype.h */
|
||||
/* */
|
||||
/* Apple ][ file type definitions */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 2017 Bill Chatfield, <bill_chatfield@yahoo.com> */
|
||||
/* */
|
||||
/* */
|
||||
/* 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 _APPLE2_FILETYPE_H
|
||||
#define _APPLE2_FILETYPE_H
|
||||
|
||||
|
||||
|
||||
/* Check for errors */
|
||||
#if !defined(__APPLE2__)
|
||||
# error This module may only be used when compiling for the Apple ][!
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Data */
|
||||
/*****************************************************************************/
|
||||
|
||||
|
||||
|
||||
/* ProDOS general file types */
|
||||
#define PRODOS_T_UNK 0x00 /* Unknown */
|
||||
#define PRODOS_T_BAD 0x01 /* Bad blocks */
|
||||
#define PRODOS_T_PCD 0x02 /* Pascal code */
|
||||
#define PRODOS_T_PTX 0x03 /* Pascal text */
|
||||
#define PRODOS_T_TXT 0x04 /* ASCII text */
|
||||
#define PRODOS_T_PDA 0x05 /* Pascal data */
|
||||
#define PRODOS_T_BIN 0x06 /* Binary */
|
||||
#define PRODOS_T_FNT 0x07 /* Apple III font */
|
||||
#define PRODOS_T_FOT 0x08 /* Hi-res, dbl hi-res graphics */
|
||||
#define PRODOS_T_BA3 0x09 /* Apple III BASIC program */
|
||||
#define PRODOS_T_DA3 0x09 /* Apple III BASIC data */
|
||||
#define PRODOS_T_WPF 0x0A /* Generic word processing */
|
||||
#define PRODOS_T_SOS 0x0B /* SOS system */
|
||||
#define PRODOS_T_DIR 0x0F /* ProDOS directory */
|
||||
|
||||
/* ProDOS productivity file types */
|
||||
#define PRODOS_T_RPD 0x10 /* RPS data */
|
||||
#define PRODOS_T_RPI 0x11 /* RPS index */
|
||||
#define PRODOS_T_AFD 0x12 /* AppleFile discard */
|
||||
#define PRODOS_T_AFM 0x13 /* AppleFile model */
|
||||
#define PRODOS_T_AFR 0x14 /* AppleFile report */
|
||||
#define PRODOS_T_SCL 0x15 /* Screen library */
|
||||
#define PRODOS_T_PFS 0x16 /* PFS document */
|
||||
#define PRODOS_T_ADB 0x19 /* AppleWorks database */
|
||||
#define PRODOS_T_AWP 0x1A /* AppleWorks word processing */
|
||||
#define PRODOS_T_ASP 0x1B /* AppleWorks spreadsheet */
|
||||
|
||||
/* ProDOS code file types */
|
||||
#define PRODOS_T_TDM 0x20 /* Desktop Manager */
|
||||
#define PRODOS_T_IPS 0x21 /* Instant Pascal source */
|
||||
#define PRODOS_T_UPV 0x22 /* USCD Pascal volume */
|
||||
#define PRODOS_T_3SD 0x29 /* SOS directory */
|
||||
#define PRODOS_T_8SC 0x2A /* Source code */
|
||||
#define PRODOS_T_8OB 0x2B /* Object code */
|
||||
#define PRODOS_T_8IC 0x2C /* Interpreted code */
|
||||
#define PRODOS_T_8LD 0x2D /* Language data */
|
||||
#define PRODOS_T_P8C 0x2E /* ProDOS 8 code module */
|
||||
|
||||
/* ProDOS miscellaneous file types */
|
||||
#define PRODOS_T_OCR 0x41 /* Optical char recognition */
|
||||
#define PRODOS_T_FTD 0x42 /* File type definitions */
|
||||
|
||||
/* ProDOS Apple IIgs general file types */
|
||||
#define PRODOS_T_GWP 0x50 /* Apple IIgs word processing */
|
||||
#define PRODOS_T_GSS 0x51 /* Apple IIgs spreadsheet */
|
||||
#define PRODOS_T_GDB 0x52 /* Apple IIgs database */
|
||||
#define PRODOS_T_DRW 0x53 /* Object oriented graphics */
|
||||
#define PRODOS_T_GDP 0x54 /* Apple IIgs desktop publish */
|
||||
#define PRODOS_T_HMD 0x55 /* HyperMedia */
|
||||
#define PRODOS_T_EDU 0x56 /* Educational program data */
|
||||
#define PRODOS_T_STN 0x57 /* Stationary */
|
||||
#define PRODOS_T_HLP 0x58 /* Help */
|
||||
#define PRODOS_T_COM 0x59 /* Communications */
|
||||
#define PRODOS_T_CFG 0x5A /* Configuration */
|
||||
#define PRODOS_T_ANM 0x5B /* Animation */
|
||||
#define PRODOS_T_MUM 0x5C /* Multimedia */
|
||||
#define PRODOS_T_ENT 0x5D /* Entertainment */
|
||||
#define PRODOS_T_DVU 0x5E /* Development utility */
|
||||
|
||||
/* ProDOS PC Transporter file types */
|
||||
#define PRODOS_T_PRE 0x60 /* PC pre-boot */
|
||||
#define PRODOS_T_BIO 0x6B /* PC BIOS */
|
||||
#define PRODOS_T_NCF 0x66 /* ProDOS File Nav command file */
|
||||
#define PRODOS_T_DVR 0x6D /* PC driver */
|
||||
#define PRODOS_T_PRE2 0x6E /* PC pre-boot */
|
||||
#define PRODOS_T_HDV 0x6F /* PC hard disk image */
|
||||
|
||||
/* ProDOS Kreative Software file types */
|
||||
#define PRODOS_T_SN2 0x70 /* Sabine's Notebook 2.0 */
|
||||
#define PRODOS_T_KMT 0x71
|
||||
#define PRODOS_T_DSR 0x72
|
||||
#define PRODOS_T_BAN 0x73
|
||||
#define PRODOS_T_CG7 0x74
|
||||
#define PRODOS_T_TNJ 0x75
|
||||
#define PRODOS_T_SA7 0x76
|
||||
#define PRODOS_T_KES 0x77
|
||||
#define PRODOS_T_JAP 0x78
|
||||
#define PRODOS_T_CSL 0x79
|
||||
#define PRODOS_T_TME 0x7A
|
||||
#define PRODOS_T_TLB 0x7B
|
||||
#define PRODOS_T_MR7 0x7C
|
||||
#define PRODOS_T_MLR 0x7D /* Mika City */
|
||||
#define PRODOS_T_MMM 0x7E
|
||||
#define PRODOS_T_JCP 0x7F
|
||||
|
||||
/* ProDOS GEOS file types */
|
||||
#define PRODOS_T_GES 0x80 /* GEOS system file */
|
||||
#define PRODOS_T_GEA 0x81 /* GEOS desk accessory */
|
||||
#define PRODOS_T_GEO 0x82 /* GEOS application */
|
||||
#define PRODOS_T_GED 0x83 /* GEOS document */
|
||||
#define PRODOS_T_GEF 0x84 /* GEOS font */
|
||||
#define PRODOS_T_GEP 0x85 /* GEOS printer driver */
|
||||
#define PRODOS_T_GEI 0x86 /* GEOS input driver */
|
||||
#define PRODOS_T_GEX 0x87 /* GEOS auxiliary driver */
|
||||
#define PRODOS_T_GEV 0x89 /* GEOS swap file */
|
||||
#define PRODOS_T_GEC 0x8B /* GEOS clock driver */
|
||||
#define PRODOS_T_GEK 0x8C /* GEOS interface card driver */
|
||||
#define PRODOS_T_GEW 0x8D /* GEOS formatting data */
|
||||
|
||||
/* ProDOS Apple IIgs BASIC file types */
|
||||
#define PRODOS_T_WP 0xA0 /* WordPerfect */
|
||||
#define PRODOS_T_GSB 0xAB /* Apple IIgs BASIC program */
|
||||
#define PRODOS_T_TDF 0xAB /* Apple IIgs BASIC TDF */
|
||||
#define PRODOS_T_BDF 0xAB /* Apple IIgs BASIC data */
|
||||
|
||||
/* ProDOS Apple IIgs system file types */
|
||||
#define PRODOS_T_SRC 0xB0 /* Apple IIgs source code */
|
||||
#define PRODOS_T_OBJ 0xB1 /* Apple IIgs object code */
|
||||
#define PRODOS_T_LIB 0xB2 /* Apple IIgs library */
|
||||
#define PRODOS_T_S16 0xB3 /* Apple IIgs application pgm */
|
||||
#define PRODOS_T_RTL 0xB4 /* Apple IIgs runtime library */
|
||||
#define PRODOS_T_EXE 0xB5 /* Apple IIgs shell script */
|
||||
#define PRODOS_T_PIF 0xB6 /* Apple IIgs permanent init */
|
||||
#define PRODOS_T_TIF 0xB7 /* Apple IIgs temporary init */
|
||||
#define PRODOS_T_NDA 0xB8 /* Apple IIgs new desk accesry */
|
||||
#define PRODOS_T_CDA 0xB9 /* Apple IIgs classic desk aces */
|
||||
#define PRODOS_T_TOL 0xBA /* Apple IIgs tool */
|
||||
#define PRODOS_T_DRV 0xBB /* Apple IIgs device driver */
|
||||
#define PRODOS_T_LDF 0xBC /* Apple IIgs generic load file */
|
||||
#define PRODOS_T_FST 0xBD /* Apple IIgs file sys translat */
|
||||
#define PRODOS_T_DOC 0xBF /* Apple IIgs document */
|
||||
|
||||
/* ProDOS graphics file types */
|
||||
#define PRODOS_T_PNT 0xC0 /* Apple IIgs packed sup hi-res */
|
||||
#define PRODOS_T_PIC 0xC1 /* Apple IIgs super hi-res */
|
||||
#define PRODOS_T_ANI 0xC2 /* PaintWorks animation */
|
||||
#define PRODOS_T_PAL 0xC3 /* PaintWorks palette */
|
||||
#define PRODOS_T_OOG 0xC5 /* Object-oriented graphics */
|
||||
#define PRODOS_T_SCR 0xC6 /* Script */
|
||||
#define PRODOS_T_CDV 0xC7 /* Apple IIgs control panel */
|
||||
#define PRODOS_T_FON 0xC8 /* Apple IIgs font */
|
||||
#define PRODOS_T_FND 0xC9 /* Apple IIgs Finder data */
|
||||
#define PRODOS_T_ICN 0xCA /* Apple IIgs icon */
|
||||
|
||||
/* ProDOS audio file types */
|
||||
#define PRODOS_T_MUS 0xD5 /* Music */
|
||||
#define PRODOS_T_INS 0xD6 /* Instrument */
|
||||
#define PRODOS_T_MID 0xD7 /* MIDI */
|
||||
#define PRODOS_T_SND 0xD8 /* Apple IIgs audio */
|
||||
#define PRODOS_T_DBM 0xDB /* DB master document */
|
||||
|
||||
/* ProDOS miscellaneous file types */
|
||||
#define PRODOS_T_LBR 0xE0 /* Archive */
|
||||
#define PRODOS_T_ATK 0xE2 /* AppleTalk data */
|
||||
#define PRODOS_T_R16 0xEE /* EDASM 816 relocatable code */
|
||||
#define PRODOS_T_PAR 0xEF /* Pascal area */
|
||||
|
||||
/* ProDOS system file types */
|
||||
#define PRODOS_T_CMD 0xF0 /* ProDOS command file */
|
||||
#define PRODOS_T_OVL 0xF1 /* User defined 1 */
|
||||
#define PRODOS_T_UD2 0xF2 /* User defined 2 */
|
||||
#define PRODOS_T_UD3 0xF3 /* User defined 3 */
|
||||
#define PRODOS_T_UD4 0xF4 /* User defined 4 */
|
||||
#define PRODOS_T_BAT 0xF5 /* User defined 5 */
|
||||
#define PRODOS_T_UD6 0xF6 /* User defined 6 */
|
||||
#define PRODOS_T_UD7 0xF7 /* User defined 7 */
|
||||
#define PRODOS_T_PRG 0xF8 /* User defined 8 */
|
||||
#define PRODOS_T_P16 0xF9 /* ProDOS-16 system file */
|
||||
#define PRODOS_T_INT 0xFA /* Integer BASIC program */
|
||||
#define PRODOS_T_IVR 0xFB /* Integer BASIC variables */
|
||||
#define PRODOS_T_BAS 0xFC /* Applesoft BASIC program */
|
||||
#define PRODOS_T_VAR 0xFD /* Applesoft BASIC variables */
|
||||
#define PRODOS_T_REL 0xFE /* EDASM relocatable code */
|
||||
#define PRODOS_T_SYS 0xFF /* ProDOS-8 system file */
|
||||
|
||||
/* The auxiliary type of a text file specifies its record length.
|
||||
** A record length of 0 indicates a sequential text file, which is
|
||||
** equivalent to text files of other operating systems like MacOS
|
||||
** or Windows, except that lines are delimited by carriage returns
|
||||
** only. An auxiliary type value greater than 0 for a text file,
|
||||
** which is the record length, indicates a random access text file
|
||||
** with fixed-length lines.
|
||||
*/
|
||||
#define PRODOS_AUX_T_TXT_SEQ 0x0000 /* Sequential text */
|
||||
|
||||
/* 8IC auxiliary types */
|
||||
#define PRODOS_AUX_T_8IC_APEX_PGM 0x8003 /* Apex program */
|
||||
|
||||
/* GWP auxiliary types */
|
||||
#define PRODOS_AUX_T_GWP_TEACH 0x5445 /* Teach */
|
||||
#define PRODOS_AUX_T_GWP_DELUXEWRITE 0x8001 /* DeluxeWrite */
|
||||
#define PRODOS_AUX_T_GWP_APPLEWORKS_GS 0x8010 /* AppleWorks GS */
|
||||
|
||||
/* GSS auxiliary types */
|
||||
#define PRODOS_AUX_T_GSS_APPLEWORKS_GS 0x8010 /* AppleWorks GS */
|
||||
|
||||
/* GDB auxiliary types */
|
||||
#define PRODOS_AUX_T_GDB_APPLEWORKS_GS 0x8010 /* AppleWorks GS DB */
|
||||
#define PRODOS_AUX_T_GDB_AWGS_TMPL 0x8011 /* AWGS template */
|
||||
#define PRODOS_AUX_T_GDB_GSAS 0x8013
|
||||
|
||||
/* DRW auxiliary types */
|
||||
#define PRODOS_AUX_T_DRW_OO_GRAPHICS 0x8013 /* AWGS O-O graphics */
|
||||
|
||||
/* GDP auxiliary types */
|
||||
#define PRODOS_AUX_T_GDP_GRAPHICWRITER 0x8002 /* A2gs GraphicWriter */
|
||||
#define PRODOS_AUX_T_GDP_APPLEWORKS_GS 0x8010 /* A2gs AWGS */
|
||||
|
||||
/* HMD auxiliary types */
|
||||
#define PRODOS_AUX_T_HMD_HYPERCARD_GS 0x0001 /* HyperCard GS */
|
||||
#define PRODOS_AUX_T_HMD_TUTOR_TECH 0x8001 /* Tutor-Tech */
|
||||
#define PRODOS_AUX_T_HMD_HYPERSTUDIO 0x8002 /* HyperStudio */
|
||||
#define PRODOS_AUX_T_HMD_NEXUS 0x8003 /* Nexus */
|
||||
|
||||
/* COM auxiliary types */
|
||||
#define PRODOS_AUX_T_COM_APPLEWORKS_GS 0x8003 /* AppleWorks GS */
|
||||
|
||||
/* MLR auxiliary types */
|
||||
#define PRODOS_AUX_T_MLR_SCRIPT 0x005C /* Mika City script */
|
||||
#define PRODOS_AUX_T_MLR_COLOR_TABLE 0xC7AB /* Mika City color table */
|
||||
#define PRODOS_AUX_T_MLR_CHARACTER_DEF 0xCDEF /* Mika City character def */
|
||||
|
||||
/* LDF auxiliary types */
|
||||
#define PRODOS_AUX_T_LDF_NIFTY_LIST_MOD 0x4001 /* Nifty list module */
|
||||
#define PRODOS_AUX_T_LDF_SUPER_INFO_MOD 0x4002 /* Super info module */
|
||||
#define PRODOS_AUX_T_LDF_TWILIGHT_MOD 0x4004 /* Twilight module */
|
||||
#define PRODOS_AUX_T_LDF_MARINETTI_LLM 0x4004 /* Marinetti link layer mod */
|
||||
|
||||
/* PNT auxiliary types */
|
||||
#define PRODOS_AUX_T_PNT_PK_SUPER_HIRES 0x0001 /* Packed super hi-res */
|
||||
#define PRODOS_AUX_T_PNT_APPLE_PREF 0x0002 /* Apple preferred format */
|
||||
#define PRODOS_AUX_T_PNT_PK_QUICKDRAWII 0x0003 /* Packed QuickDraw II */
|
||||
|
||||
/* PIC auxiliary types */
|
||||
#define PRODOS_AUX_T_PIC_QUICKDRAW 0x0001 /* QuickDraw image */
|
||||
#define PRODOS_AUX_T_PIC_SHIRES_3200 0x0002 /* Super hi-res 3200 */
|
||||
|
||||
/* FON auxiliary types */
|
||||
#define PRODOS_AUX_T_FON_QUICKDRAW_BIT 0x0000 /* QuickDraw bitmap font */
|
||||
#define PRODOS_AUX_T_FON_POINTLESS_TT 0x0001 /* Pointless TrueType font */
|
||||
|
||||
/* SND auxiliary types */
|
||||
#define PRODOS_AUX_T_SND_AIFF 0x0000 /* AIFF */
|
||||
#define PRODOS_AUX_T_SND_AIFF_C 0x0001 /* AIFF-C */
|
||||
#define PRODOS_AUX_T_SND_ASIF_INSTR 0x0002 /* ASIF instrument */
|
||||
#define PRODOS_AUX_T_SND_SOUND_RSRC 0x0003 /* Sound resource */
|
||||
#define PRODOS_AUX_T_SND_MIDI_SYNTH_WAV 0x0004 /* MIDI synth wave */
|
||||
#define PRODOS_AUX_T_SND_HYPERSTUDIO 0x8001 /* HyperStudio sound */
|
||||
|
||||
/* LBR auxiliary types */
|
||||
#define PRODOS_AUX_T_LBR_ALU 0x0000 /* ALU */
|
||||
#define PRODOS_AUX_T_LBR_APPLE_SINGLE 0x0001 /* AppleSingle */
|
||||
#define PRODOS_AUX_T_LBR_APPLEDBL_HDR 0x0002 /* AppleDouble header */
|
||||
#define PRODOS_AUX_T_LBR_APPLEDBL_DATA 0x0003 /* AppleDouble data */
|
||||
#define PRODOS_AUX_T_LBR_BINARY_II 0x8000 /* Binary II */
|
||||
#define PRODOS_AUX_T_LBR_APPLELINK_ACU 0x8001 /* AppleLink ACU */
|
||||
#define PRODOS_AUX_T_LBR_SHRINKIT 0x8002 /* ShrinkIt */
|
||||
|
||||
/* LBR auxiliary types */
|
||||
#define PRODOS_AUX_T_ATK_EASYMNT_ALIAS 0x0000 /* EasyMount alias */
|
||||
|
||||
/* BAS auxiliary types */
|
||||
#define PRODOS_AUX_T_BAS_PGM_LOAD_ADDR 0x0801 /* Applesoft pgm load addr */
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Variables */
|
||||
/*****************************************************************************/
|
||||
|
||||
|
||||
|
||||
/* The file stream implementation and the POSIX I/O functions will use the
|
||||
** following variables to determine the file type and auxiliary type to use.
|
||||
** This applies specifically to the fopen and open functions.
|
||||
*/
|
||||
extern unsigned char _filetype; /* Default: PRODOS_T_BIN */
|
||||
extern unsigned int _auxtype; /* Default: 0 */
|
||||
|
||||
/* End of apple2_filetype.h */
|
||||
#endif
|
||||
@@ -161,11 +161,12 @@ extern void __fastcall__ _scroll (signed char numlines);
|
||||
/* numlines < 0 scrolls down */
|
||||
|
||||
/* misc. functions */
|
||||
extern unsigned char get_ostype(void); /* get ROM version */
|
||||
extern unsigned char get_tv(void); /* get TV system */
|
||||
extern void _save_vecs(void); /* save system vectors */
|
||||
extern void _rest_vecs(void); /* restore system vectors */
|
||||
extern char *_getdefdev(void); /* get default floppy device */
|
||||
extern unsigned char get_ostype(void); /* get ROM version */
|
||||
extern unsigned char get_tv(void); /* get TV system */
|
||||
extern void _save_vecs(void); /* save system vectors */
|
||||
extern void _rest_vecs(void); /* restore system vectors */
|
||||
extern char *_getdefdev(void); /* get default floppy device */
|
||||
extern unsigned char _is_cmdline_dos(void); /* does DOS support command lines */
|
||||
|
||||
/* global variables */
|
||||
extern unsigned char _dos_type; /* the DOS flavour */
|
||||
@@ -261,11 +262,11 @@ extern void atrx15p2_tgi[];
|
||||
#define AT_PAL 1
|
||||
|
||||
/* valid _dos_type values */
|
||||
#define ATARIDOS 0
|
||||
#define SPARTADOS 1
|
||||
#define OSADOS 2
|
||||
#define MYDOS 3
|
||||
#define XDOS 4
|
||||
#define SPARTADOS 0
|
||||
#define OSADOS 1
|
||||
#define XDOS 2
|
||||
#define ATARIDOS 3
|
||||
#define MYDOS 4
|
||||
#define NODOS 255
|
||||
|
||||
/* Define hardware */
|
||||
|
||||
26
include/atari2600.h
Normal file
26
include/atari2600.h
Normal file
@@ -0,0 +1,26 @@
|
||||
/*****************************************************************************/
|
||||
/* */
|
||||
/* Atari VCS 2600 TIA & RIOT registers addresses */
|
||||
/* */
|
||||
/* Source: DASM Version 1.05 - vcs.h */
|
||||
/* */
|
||||
/* Florent Flament (contact@florentflament.com), 2017 */
|
||||
/* */
|
||||
/*****************************************************************************/
|
||||
|
||||
#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!
|
||||
#endif
|
||||
|
||||
#include <_tia.h>
|
||||
#define TIA (*(struct __tia*)0x0000)
|
||||
|
||||
#include <_riot.h>
|
||||
#define RIOT (*(struct __riot*)0x0280)
|
||||
|
||||
/* End of atari2600.h */
|
||||
#endif /* #ifndef _ATARI2600_H */
|
||||
304
include/atari_atascii_charmap.h
Normal file
304
include/atari_atascii_charmap.h
Normal file
@@ -0,0 +1,304 @@
|
||||
/*****************************************************************************/
|
||||
/* */
|
||||
/* atari_atascii_charmap.h */
|
||||
/* */
|
||||
/* Atari system standard string mapping (ISO-8859-1 -> AtASCII) */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 2016 Christian Krueger */
|
||||
/* */
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
/*****************************************************************************/
|
||||
|
||||
/* No include guard here! Multiple use in one file may be intentional. */
|
||||
|
||||
#pragma charmap (0x00, 0x00)
|
||||
#pragma charmap (0x01, 0x01)
|
||||
#pragma charmap (0x02, 0x02)
|
||||
#pragma charmap (0x03, 0x03)
|
||||
#pragma charmap (0x04, 0x04)
|
||||
#pragma charmap (0x05, 0x05)
|
||||
#pragma charmap (0x06, 0x06)
|
||||
#pragma charmap (0x07, 0xFD)
|
||||
#pragma charmap (0x08, 0x08)
|
||||
#pragma charmap (0x09, 0x7F)
|
||||
#pragma charmap (0x0A, 0x9B)
|
||||
#pragma charmap (0x0B, 0x0B)
|
||||
#pragma charmap (0x0C, 0x7D)
|
||||
#pragma charmap (0x0D, 0x0D)
|
||||
#pragma charmap (0x0E, 0x0E)
|
||||
#pragma charmap (0x0F, 0x0F)
|
||||
|
||||
#pragma charmap (0x10, 0x10)
|
||||
#pragma charmap (0x11, 0x11)
|
||||
#pragma charmap (0x12, 0x12)
|
||||
#pragma charmap (0x13, 0x13)
|
||||
#pragma charmap (0x14, 0x14)
|
||||
#pragma charmap (0x15, 0x15)
|
||||
#pragma charmap (0x16, 0x16)
|
||||
#pragma charmap (0x17, 0x17)
|
||||
#pragma charmap (0x18, 0x18)
|
||||
#pragma charmap (0x19, 0x19)
|
||||
#pragma charmap (0x1A, 0x1A)
|
||||
#pragma charmap (0x1B, 0x1B)
|
||||
#pragma charmap (0x1C, 0x1C)
|
||||
#pragma charmap (0x1D, 0x1D)
|
||||
#pragma charmap (0x1E, 0x1E)
|
||||
#pragma charmap (0x1F, 0x1F)
|
||||
|
||||
#pragma charmap (0x20, 0x20)
|
||||
#pragma charmap (0x21, 0x21)
|
||||
#pragma charmap (0x22, 0x22)
|
||||
#pragma charmap (0x23, 0x23)
|
||||
#pragma charmap (0x24, 0x24)
|
||||
#pragma charmap (0x25, 0x25)
|
||||
#pragma charmap (0x26, 0x26)
|
||||
#pragma charmap (0x27, 0x27)
|
||||
#pragma charmap (0x28, 0x28)
|
||||
#pragma charmap (0x29, 0x29)
|
||||
#pragma charmap (0x2A, 0x2A)
|
||||
#pragma charmap (0x2B, 0x2B)
|
||||
#pragma charmap (0x2C, 0x2C)
|
||||
#pragma charmap (0x2D, 0x2D)
|
||||
#pragma charmap (0x2E, 0x2E)
|
||||
#pragma charmap (0x2F, 0x2F)
|
||||
|
||||
#pragma charmap (0x30, 0x30)
|
||||
#pragma charmap (0x31, 0x31)
|
||||
#pragma charmap (0x32, 0x32)
|
||||
#pragma charmap (0x33, 0x33)
|
||||
#pragma charmap (0x34, 0x34)
|
||||
#pragma charmap (0x35, 0x35)
|
||||
#pragma charmap (0x36, 0x36)
|
||||
#pragma charmap (0x37, 0x37)
|
||||
#pragma charmap (0x38, 0x38)
|
||||
#pragma charmap (0x39, 0x39)
|
||||
#pragma charmap (0x3A, 0x3A)
|
||||
#pragma charmap (0x3B, 0x3B)
|
||||
#pragma charmap (0x3C, 0x3C)
|
||||
#pragma charmap (0x3D, 0x3D)
|
||||
#pragma charmap (0x3E, 0x3E)
|
||||
#pragma charmap (0x3F, 0x3F)
|
||||
|
||||
#pragma charmap (0x40, 0x40)
|
||||
#pragma charmap (0x41, 0x41)
|
||||
#pragma charmap (0x42, 0x42)
|
||||
#pragma charmap (0x43, 0x43)
|
||||
#pragma charmap (0x44, 0x44)
|
||||
#pragma charmap (0x45, 0x45)
|
||||
#pragma charmap (0x46, 0x46)
|
||||
#pragma charmap (0x47, 0x47)
|
||||
#pragma charmap (0x48, 0x48)
|
||||
#pragma charmap (0x49, 0x49)
|
||||
#pragma charmap (0x4A, 0x4A)
|
||||
#pragma charmap (0x4B, 0x4B)
|
||||
#pragma charmap (0x4C, 0x4C)
|
||||
#pragma charmap (0x4D, 0x4D)
|
||||
#pragma charmap (0x4E, 0x4E)
|
||||
#pragma charmap (0x4F, 0x4F)
|
||||
|
||||
#pragma charmap (0x50, 0x50)
|
||||
#pragma charmap (0x51, 0x51)
|
||||
#pragma charmap (0x52, 0x52)
|
||||
#pragma charmap (0x53, 0x53)
|
||||
#pragma charmap (0x54, 0x54)
|
||||
#pragma charmap (0x55, 0x55)
|
||||
#pragma charmap (0x56, 0x56)
|
||||
#pragma charmap (0x57, 0x57)
|
||||
#pragma charmap (0x58, 0x58)
|
||||
#pragma charmap (0x59, 0x59)
|
||||
#pragma charmap (0x5A, 0x5A)
|
||||
#pragma charmap (0x5B, 0x5B)
|
||||
#pragma charmap (0x5C, 0x5C)
|
||||
#pragma charmap (0x5D, 0x5D)
|
||||
#pragma charmap (0x5E, 0x5E)
|
||||
#pragma charmap (0x5F, 0x5F)
|
||||
|
||||
#pragma charmap (0x60, 0x60)
|
||||
#pragma charmap (0x61, 0x61)
|
||||
#pragma charmap (0x62, 0x62)
|
||||
#pragma charmap (0x63, 0x63)
|
||||
#pragma charmap (0x64, 0x64)
|
||||
#pragma charmap (0x65, 0x65)
|
||||
#pragma charmap (0x66, 0x66)
|
||||
#pragma charmap (0x67, 0x67)
|
||||
#pragma charmap (0x68, 0x68)
|
||||
#pragma charmap (0x69, 0x69)
|
||||
#pragma charmap (0x6A, 0x6A)
|
||||
#pragma charmap (0x6B, 0x6B)
|
||||
#pragma charmap (0x6C, 0x6C)
|
||||
#pragma charmap (0x6D, 0x6D)
|
||||
#pragma charmap (0x6E, 0x6E)
|
||||
#pragma charmap (0x6F, 0x6F)
|
||||
|
||||
#pragma charmap (0x70, 0x70)
|
||||
#pragma charmap (0x71, 0x71)
|
||||
#pragma charmap (0x72, 0x72)
|
||||
#pragma charmap (0x73, 0x73)
|
||||
#pragma charmap (0x74, 0x74)
|
||||
#pragma charmap (0x75, 0x75)
|
||||
#pragma charmap (0x76, 0x76)
|
||||
#pragma charmap (0x77, 0x77)
|
||||
#pragma charmap (0x78, 0x78)
|
||||
#pragma charmap (0x79, 0x79)
|
||||
#pragma charmap (0x7A, 0x7A)
|
||||
#pragma charmap (0x7B, 0x7B)
|
||||
#pragma charmap (0x7C, 0x7C)
|
||||
#pragma charmap (0x7D, 0x7D)
|
||||
#pragma charmap (0x7E, 0x7E)
|
||||
#pragma charmap (0x7F, 0x7F)
|
||||
|
||||
#pragma charmap (0x80, 0x80)
|
||||
#pragma charmap (0x81, 0x81)
|
||||
#pragma charmap (0x82, 0x82)
|
||||
#pragma charmap (0x83, 0x83)
|
||||
#pragma charmap (0x84, 0x84)
|
||||
#pragma charmap (0x85, 0x85)
|
||||
#pragma charmap (0x86, 0x86)
|
||||
#pragma charmap (0x87, 0x87)
|
||||
#pragma charmap (0x88, 0x88)
|
||||
#pragma charmap (0x89, 0x89)
|
||||
#pragma charmap (0x8A, 0x8A)
|
||||
#pragma charmap (0x8B, 0x8B)
|
||||
#pragma charmap (0x8C, 0x8C)
|
||||
#pragma charmap (0x8D, 0x8D)
|
||||
#pragma charmap (0x8E, 0x8E)
|
||||
#pragma charmap (0x8F, 0x8F)
|
||||
|
||||
#pragma charmap (0x90, 0x90)
|
||||
#pragma charmap (0x91, 0x91)
|
||||
#pragma charmap (0x92, 0x92)
|
||||
#pragma charmap (0x93, 0x93)
|
||||
#pragma charmap (0x94, 0x94)
|
||||
#pragma charmap (0x95, 0x95)
|
||||
#pragma charmap (0x96, 0x96)
|
||||
#pragma charmap (0x97, 0x97)
|
||||
#pragma charmap (0x98, 0x98)
|
||||
#pragma charmap (0x99, 0x99)
|
||||
#pragma charmap (0x9A, 0x9A)
|
||||
#pragma charmap (0x9B, 0x9B)
|
||||
#pragma charmap (0x9C, 0x9C)
|
||||
#pragma charmap (0x9D, 0x9D)
|
||||
#pragma charmap (0x9E, 0x9E)
|
||||
#pragma charmap (0x9F, 0x9F)
|
||||
|
||||
#pragma charmap (0xA0, 0xA0)
|
||||
#pragma charmap (0xA1, 0xA1)
|
||||
#pragma charmap (0xA2, 0xA2)
|
||||
#pragma charmap (0xA3, 0xA3)
|
||||
#pragma charmap (0xA4, 0xA4)
|
||||
#pragma charmap (0xA5, 0xA5)
|
||||
#pragma charmap (0xA6, 0xA6)
|
||||
#pragma charmap (0xA7, 0xA7)
|
||||
#pragma charmap (0xA8, 0xA8)
|
||||
#pragma charmap (0xA9, 0xA9)
|
||||
#pragma charmap (0xAA, 0xAA)
|
||||
#pragma charmap (0xAB, 0xAB)
|
||||
#pragma charmap (0xAC, 0xAC)
|
||||
#pragma charmap (0xAD, 0xAD)
|
||||
#pragma charmap (0xAE, 0xAE)
|
||||
#pragma charmap (0xAF, 0xAF)
|
||||
|
||||
#pragma charmap (0xB0, 0xB0)
|
||||
#pragma charmap (0xB1, 0xB1)
|
||||
#pragma charmap (0xB2, 0xB2)
|
||||
#pragma charmap (0xB3, 0xB3)
|
||||
#pragma charmap (0xB4, 0xB4)
|
||||
#pragma charmap (0xB5, 0xB5)
|
||||
#pragma charmap (0xB6, 0xB6)
|
||||
#pragma charmap (0xB7, 0xB7)
|
||||
#pragma charmap (0xB8, 0xB8)
|
||||
#pragma charmap (0xB9, 0xB9)
|
||||
#pragma charmap (0xBA, 0xBA)
|
||||
#pragma charmap (0xBB, 0xBB)
|
||||
#pragma charmap (0xBC, 0xBC)
|
||||
#pragma charmap (0xBD, 0xBD)
|
||||
#pragma charmap (0xBE, 0xBE)
|
||||
#pragma charmap (0xBF, 0xBF)
|
||||
|
||||
#pragma charmap (0xC0, 0xC0)
|
||||
#pragma charmap (0xC1, 0xC1)
|
||||
#pragma charmap (0xC2, 0xC2)
|
||||
#pragma charmap (0xC3, 0xC3)
|
||||
#pragma charmap (0xC4, 0xC4)
|
||||
#pragma charmap (0xC5, 0xC5)
|
||||
#pragma charmap (0xC6, 0xC6)
|
||||
#pragma charmap (0xC7, 0xC7)
|
||||
#pragma charmap (0xC8, 0xC8)
|
||||
#pragma charmap (0xC9, 0xC9)
|
||||
#pragma charmap (0xCA, 0xCA)
|
||||
#pragma charmap (0xCB, 0xCB)
|
||||
#pragma charmap (0xCC, 0xCC)
|
||||
#pragma charmap (0xCD, 0xCD)
|
||||
#pragma charmap (0xCE, 0xCE)
|
||||
#pragma charmap (0xCF, 0xCF)
|
||||
|
||||
#pragma charmap (0xD0, 0xD0)
|
||||
#pragma charmap (0xD1, 0xD1)
|
||||
#pragma charmap (0xD2, 0xD2)
|
||||
#pragma charmap (0xD3, 0xD3)
|
||||
#pragma charmap (0xD4, 0xD4)
|
||||
#pragma charmap (0xD5, 0xD5)
|
||||
#pragma charmap (0xD6, 0xD6)
|
||||
#pragma charmap (0xD7, 0xD7)
|
||||
#pragma charmap (0xD8, 0xD8)
|
||||
#pragma charmap (0xD9, 0xD9)
|
||||
#pragma charmap (0xDA, 0xDA)
|
||||
#pragma charmap (0xDB, 0xDB)
|
||||
#pragma charmap (0xDC, 0xDC)
|
||||
#pragma charmap (0xDD, 0xDD)
|
||||
#pragma charmap (0xDE, 0xDE)
|
||||
#pragma charmap (0xDF, 0xDF)
|
||||
|
||||
#pragma charmap (0xE0, 0xE0)
|
||||
#pragma charmap (0xE1, 0xE1)
|
||||
#pragma charmap (0xE2, 0xE2)
|
||||
#pragma charmap (0xE3, 0xE3)
|
||||
#pragma charmap (0xE4, 0xE4)
|
||||
#pragma charmap (0xE5, 0xE5)
|
||||
#pragma charmap (0xE6, 0xE6)
|
||||
#pragma charmap (0xE7, 0xE7)
|
||||
#pragma charmap (0xE8, 0xE8)
|
||||
#pragma charmap (0xE9, 0xE9)
|
||||
#pragma charmap (0xEA, 0xEA)
|
||||
#pragma charmap (0xEB, 0xEB)
|
||||
#pragma charmap (0xEC, 0xEC)
|
||||
#pragma charmap (0xED, 0xED)
|
||||
#pragma charmap (0xEE, 0xEE)
|
||||
#pragma charmap (0xEF, 0xEF)
|
||||
|
||||
#pragma charmap (0xF0, 0xF0)
|
||||
#pragma charmap (0xF1, 0xF1)
|
||||
#pragma charmap (0xF2, 0xF2)
|
||||
#pragma charmap (0xF3, 0xF3)
|
||||
#pragma charmap (0xF4, 0xF4)
|
||||
#pragma charmap (0xF5, 0xF5)
|
||||
#pragma charmap (0xF6, 0xF6)
|
||||
#pragma charmap (0xF7, 0xF7)
|
||||
#pragma charmap (0xF8, 0xF8)
|
||||
#pragma charmap (0xF9, 0xF9)
|
||||
#pragma charmap (0xFA, 0xFA)
|
||||
#pragma charmap (0xFB, 0xFB)
|
||||
#pragma charmap (0xFC, 0xFC)
|
||||
#pragma charmap (0xFD, 0xFD)
|
||||
#pragma charmap (0xFE, 0xFE)
|
||||
#pragma charmap (0xFF, 0xFF)
|
||||
|
||||
310
include/atari_screen_charmap.h
Normal file
310
include/atari_screen_charmap.h
Normal file
@@ -0,0 +1,310 @@
|
||||
/*****************************************************************************/
|
||||
/* */
|
||||
/* atari_screen_charmap.h */
|
||||
/* */
|
||||
/* Atari system internal string mapping (ISO-8859-1 -> Internal/Screen-Code) */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 2016 Christian Krueger */
|
||||
/* */
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
/*****************************************************************************/
|
||||
|
||||
/* No include guard here! Multiple use in one file may be intentional. */
|
||||
|
||||
#pragma warn (remap-zero, push, off)
|
||||
#pragma charmap (0x00, 0x40)
|
||||
#pragma warn (remap-zero, pop)
|
||||
|
||||
#pragma charmap (0x01, 0x41)
|
||||
#pragma charmap (0x02, 0x42)
|
||||
#pragma charmap (0x03, 0x43)
|
||||
#pragma charmap (0x04, 0x44)
|
||||
#pragma charmap (0x05, 0x45)
|
||||
#pragma charmap (0x06, 0x46)
|
||||
#pragma charmap (0x07, 0xFD)
|
||||
#pragma charmap (0x08, 0x48)
|
||||
#pragma charmap (0x09, 0x7F)
|
||||
#pragma charmap (0x0A, 0xDB)
|
||||
#pragma charmap (0x0B, 0x4B)
|
||||
#pragma charmap (0x0C, 0x7D)
|
||||
#pragma charmap (0x0D, 0x4D)
|
||||
#pragma charmap (0x0E, 0x4E)
|
||||
#pragma charmap (0x0F, 0x4F)
|
||||
|
||||
#pragma charmap (0x10, 0x50)
|
||||
#pragma charmap (0x11, 0x51)
|
||||
#pragma charmap (0x12, 0x52)
|
||||
#pragma charmap (0x13, 0x53)
|
||||
#pragma charmap (0x14, 0x54)
|
||||
#pragma charmap (0x15, 0x55)
|
||||
#pragma charmap (0x16, 0x56)
|
||||
#pragma charmap (0x17, 0x57)
|
||||
#pragma charmap (0x18, 0x58)
|
||||
#pragma charmap (0x19, 0x59)
|
||||
#pragma charmap (0x1A, 0x5A)
|
||||
#pragma charmap (0x1B, 0x5B)
|
||||
#pragma charmap (0x1C, 0x5C)
|
||||
#pragma charmap (0x1D, 0x5D)
|
||||
#pragma charmap (0x1E, 0x5E)
|
||||
#pragma charmap (0x1F, 0x5F)
|
||||
|
||||
#pragma warn (remap-zero, push, off)
|
||||
#pragma charmap (0x20, 0x00)
|
||||
#pragma warn (remap-zero, pop)
|
||||
|
||||
#pragma charmap (0x21, 0x01)
|
||||
#pragma charmap (0x22, 0x02)
|
||||
#pragma charmap (0x23, 0x03)
|
||||
#pragma charmap (0x24, 0x04)
|
||||
#pragma charmap (0x25, 0x05)
|
||||
#pragma charmap (0x26, 0x06)
|
||||
#pragma charmap (0x27, 0x07)
|
||||
#pragma charmap (0x28, 0x08)
|
||||
#pragma charmap (0x29, 0x09)
|
||||
#pragma charmap (0x2A, 0x0A)
|
||||
#pragma charmap (0x2B, 0x0B)
|
||||
#pragma charmap (0x2C, 0x0C)
|
||||
#pragma charmap (0x2D, 0x0D)
|
||||
#pragma charmap (0x2E, 0x0E)
|
||||
#pragma charmap (0x2F, 0x0F)
|
||||
|
||||
#pragma charmap (0x30, 0x10)
|
||||
#pragma charmap (0x31, 0x11)
|
||||
#pragma charmap (0x32, 0x12)
|
||||
#pragma charmap (0x33, 0x13)
|
||||
#pragma charmap (0x34, 0x14)
|
||||
#pragma charmap (0x35, 0x15)
|
||||
#pragma charmap (0x36, 0x16)
|
||||
#pragma charmap (0x37, 0x17)
|
||||
#pragma charmap (0x38, 0x18)
|
||||
#pragma charmap (0x39, 0x19)
|
||||
#pragma charmap (0x3A, 0x1A)
|
||||
#pragma charmap (0x3B, 0x1B)
|
||||
#pragma charmap (0x3C, 0x1C)
|
||||
#pragma charmap (0x3D, 0x1D)
|
||||
#pragma charmap (0x3E, 0x1E)
|
||||
#pragma charmap (0x3F, 0x1F)
|
||||
|
||||
#pragma charmap (0x40, 0x20)
|
||||
#pragma charmap (0x41, 0x21)
|
||||
#pragma charmap (0x42, 0x22)
|
||||
#pragma charmap (0x43, 0x23)
|
||||
#pragma charmap (0x44, 0x24)
|
||||
#pragma charmap (0x45, 0x25)
|
||||
#pragma charmap (0x46, 0x26)
|
||||
#pragma charmap (0x47, 0x27)
|
||||
#pragma charmap (0x48, 0x28)
|
||||
#pragma charmap (0x49, 0x29)
|
||||
#pragma charmap (0x4A, 0x2A)
|
||||
#pragma charmap (0x4B, 0x2B)
|
||||
#pragma charmap (0x4C, 0x2C)
|
||||
#pragma charmap (0x4D, 0x2D)
|
||||
#pragma charmap (0x4E, 0x2E)
|
||||
#pragma charmap (0x4F, 0x2F)
|
||||
|
||||
#pragma charmap (0x50, 0x30)
|
||||
#pragma charmap (0x51, 0x31)
|
||||
#pragma charmap (0x52, 0x32)
|
||||
#pragma charmap (0x53, 0x33)
|
||||
#pragma charmap (0x54, 0x34)
|
||||
#pragma charmap (0x55, 0x35)
|
||||
#pragma charmap (0x56, 0x36)
|
||||
#pragma charmap (0x57, 0x37)
|
||||
#pragma charmap (0x58, 0x38)
|
||||
#pragma charmap (0x59, 0x39)
|
||||
#pragma charmap (0x5A, 0x3A)
|
||||
#pragma charmap (0x5B, 0x3B)
|
||||
#pragma charmap (0x5C, 0x3C)
|
||||
#pragma charmap (0x5D, 0x3D)
|
||||
#pragma charmap (0x5E, 0x3E)
|
||||
#pragma charmap (0x5F, 0x3F)
|
||||
|
||||
#pragma charmap (0x60, 0x60)
|
||||
#pragma charmap (0x61, 0x61)
|
||||
#pragma charmap (0x62, 0x62)
|
||||
#pragma charmap (0x63, 0x63)
|
||||
#pragma charmap (0x64, 0x64)
|
||||
#pragma charmap (0x65, 0x65)
|
||||
#pragma charmap (0x66, 0x66)
|
||||
#pragma charmap (0x67, 0x67)
|
||||
#pragma charmap (0x68, 0x68)
|
||||
#pragma charmap (0x69, 0x69)
|
||||
#pragma charmap (0x6A, 0x6A)
|
||||
#pragma charmap (0x6B, 0x6B)
|
||||
#pragma charmap (0x6C, 0x6C)
|
||||
#pragma charmap (0x6D, 0x6D)
|
||||
#pragma charmap (0x6E, 0x6E)
|
||||
#pragma charmap (0x6F, 0x6F)
|
||||
|
||||
#pragma charmap (0x70, 0x70)
|
||||
#pragma charmap (0x71, 0x71)
|
||||
#pragma charmap (0x72, 0x72)
|
||||
#pragma charmap (0x73, 0x73)
|
||||
#pragma charmap (0x74, 0x74)
|
||||
#pragma charmap (0x75, 0x75)
|
||||
#pragma charmap (0x76, 0x76)
|
||||
#pragma charmap (0x77, 0x77)
|
||||
#pragma charmap (0x78, 0x78)
|
||||
#pragma charmap (0x79, 0x79)
|
||||
#pragma charmap (0x7A, 0x7A)
|
||||
#pragma charmap (0x7B, 0x7B)
|
||||
#pragma charmap (0x7C, 0x7C)
|
||||
#pragma charmap (0x7D, 0x7D)
|
||||
#pragma charmap (0x7E, 0x7E)
|
||||
#pragma charmap (0x7F, 0x7F)
|
||||
|
||||
#pragma charmap (0x80, 0xC0)
|
||||
#pragma charmap (0x81, 0xC1)
|
||||
#pragma charmap (0x82, 0xC2)
|
||||
#pragma charmap (0x83, 0xC3)
|
||||
#pragma charmap (0x84, 0xC4)
|
||||
#pragma charmap (0x85, 0xC5)
|
||||
#pragma charmap (0x86, 0xC6)
|
||||
#pragma charmap (0x87, 0xC7)
|
||||
#pragma charmap (0x88, 0xC8)
|
||||
#pragma charmap (0x89, 0xC9)
|
||||
#pragma charmap (0x8A, 0xCA)
|
||||
#pragma charmap (0x8B, 0xCB)
|
||||
#pragma charmap (0x8C, 0xCC)
|
||||
#pragma charmap (0x8D, 0xCD)
|
||||
#pragma charmap (0x8E, 0xCE)
|
||||
#pragma charmap (0x8F, 0xCF)
|
||||
|
||||
#pragma charmap (0x90, 0xD0)
|
||||
#pragma charmap (0x91, 0xD1)
|
||||
#pragma charmap (0x92, 0xD2)
|
||||
#pragma charmap (0x93, 0xD3)
|
||||
#pragma charmap (0x94, 0xD4)
|
||||
#pragma charmap (0x95, 0xD5)
|
||||
#pragma charmap (0x96, 0xD6)
|
||||
#pragma charmap (0x97, 0xD7)
|
||||
#pragma charmap (0x98, 0xD8)
|
||||
#pragma charmap (0x99, 0xD9)
|
||||
#pragma charmap (0x9A, 0xDA)
|
||||
#pragma charmap (0x9B, 0xDB)
|
||||
#pragma charmap (0x9C, 0xDC)
|
||||
#pragma charmap (0x9D, 0xDD)
|
||||
#pragma charmap (0x9E, 0xDE)
|
||||
#pragma charmap (0x9F, 0xDF)
|
||||
|
||||
#pragma charmap (0xA0, 0x80)
|
||||
#pragma charmap (0xA1, 0x81)
|
||||
#pragma charmap (0xA2, 0x82)
|
||||
#pragma charmap (0xA3, 0x83)
|
||||
#pragma charmap (0xA4, 0x84)
|
||||
#pragma charmap (0xA5, 0x85)
|
||||
#pragma charmap (0xA6, 0x86)
|
||||
#pragma charmap (0xA7, 0x87)
|
||||
#pragma charmap (0xA8, 0x88)
|
||||
#pragma charmap (0xA9, 0x89)
|
||||
#pragma charmap (0xAA, 0x8A)
|
||||
#pragma charmap (0xAB, 0x8B)
|
||||
#pragma charmap (0xAC, 0x8C)
|
||||
#pragma charmap (0xAD, 0x8D)
|
||||
#pragma charmap (0xAE, 0x8E)
|
||||
#pragma charmap (0xAF, 0x8F)
|
||||
|
||||
#pragma charmap (0xB0, 0x90)
|
||||
#pragma charmap (0xB1, 0x91)
|
||||
#pragma charmap (0xB2, 0x92)
|
||||
#pragma charmap (0xB3, 0x93)
|
||||
#pragma charmap (0xB4, 0x94)
|
||||
#pragma charmap (0xB5, 0x95)
|
||||
#pragma charmap (0xB6, 0x96)
|
||||
#pragma charmap (0xB7, 0x97)
|
||||
#pragma charmap (0xB8, 0x98)
|
||||
#pragma charmap (0xB9, 0x99)
|
||||
#pragma charmap (0xBA, 0x9A)
|
||||
#pragma charmap (0xBB, 0x9B)
|
||||
#pragma charmap (0xBC, 0x9C)
|
||||
#pragma charmap (0xBD, 0x9D)
|
||||
#pragma charmap (0xBE, 0x9E)
|
||||
#pragma charmap (0xBF, 0x9F)
|
||||
|
||||
#pragma charmap (0xC0, 0xA0)
|
||||
#pragma charmap (0xC1, 0xA1)
|
||||
#pragma charmap (0xC2, 0xA2)
|
||||
#pragma charmap (0xC3, 0xA3)
|
||||
#pragma charmap (0xC4, 0xA4)
|
||||
#pragma charmap (0xC5, 0xA5)
|
||||
#pragma charmap (0xC6, 0xA6)
|
||||
#pragma charmap (0xC7, 0xA7)
|
||||
#pragma charmap (0xC8, 0xA8)
|
||||
#pragma charmap (0xC9, 0xA9)
|
||||
#pragma charmap (0xCA, 0xAA)
|
||||
#pragma charmap (0xCB, 0xAB)
|
||||
#pragma charmap (0xCC, 0xAC)
|
||||
#pragma charmap (0xCD, 0xAD)
|
||||
#pragma charmap (0xCE, 0xAE)
|
||||
#pragma charmap (0xCF, 0xAF)
|
||||
|
||||
#pragma charmap (0xD0, 0xB0)
|
||||
#pragma charmap (0xD1, 0xB1)
|
||||
#pragma charmap (0xD2, 0xB2)
|
||||
#pragma charmap (0xD3, 0xB3)
|
||||
#pragma charmap (0xD4, 0xB4)
|
||||
#pragma charmap (0xD5, 0xB5)
|
||||
#pragma charmap (0xD6, 0xB6)
|
||||
#pragma charmap (0xD7, 0xB7)
|
||||
#pragma charmap (0xD8, 0xB8)
|
||||
#pragma charmap (0xD9, 0xB9)
|
||||
#pragma charmap (0xDA, 0xBA)
|
||||
#pragma charmap (0xDB, 0xBB)
|
||||
#pragma charmap (0xDC, 0xBC)
|
||||
#pragma charmap (0xDD, 0xBD)
|
||||
#pragma charmap (0xDE, 0xBE)
|
||||
#pragma charmap (0xDF, 0xBF)
|
||||
|
||||
#pragma charmap (0xE0, 0xE0)
|
||||
#pragma charmap (0xE1, 0xE1)
|
||||
#pragma charmap (0xE2, 0xE2)
|
||||
#pragma charmap (0xE3, 0xE3)
|
||||
#pragma charmap (0xE4, 0xE4)
|
||||
#pragma charmap (0xE5, 0xE5)
|
||||
#pragma charmap (0xE6, 0xE6)
|
||||
#pragma charmap (0xE7, 0xE7)
|
||||
#pragma charmap (0xE8, 0xE8)
|
||||
#pragma charmap (0xE9, 0xE9)
|
||||
#pragma charmap (0xEA, 0xEA)
|
||||
#pragma charmap (0xEB, 0xEB)
|
||||
#pragma charmap (0xEC, 0xEC)
|
||||
#pragma charmap (0xED, 0xED)
|
||||
#pragma charmap (0xEE, 0xEE)
|
||||
#pragma charmap (0xEF, 0xEF)
|
||||
|
||||
#pragma charmap (0xF0, 0xF0)
|
||||
#pragma charmap (0xF1, 0xF1)
|
||||
#pragma charmap (0xF2, 0xF2)
|
||||
#pragma charmap (0xF3, 0xF3)
|
||||
#pragma charmap (0xF4, 0xF4)
|
||||
#pragma charmap (0xF5, 0xF5)
|
||||
#pragma charmap (0xF6, 0xF6)
|
||||
#pragma charmap (0xF7, 0xF7)
|
||||
#pragma charmap (0xF8, 0xF8)
|
||||
#pragma charmap (0xF9, 0xF9)
|
||||
#pragma charmap (0xFA, 0xFA)
|
||||
#pragma charmap (0xFB, 0xFB)
|
||||
#pragma charmap (0xFC, 0xFC)
|
||||
#pragma charmap (0xFD, 0xFD)
|
||||
#pragma charmap (0xFE, 0xFE)
|
||||
#pragma charmap (0xFF, 0xFF)
|
||||
|
||||
@@ -75,6 +75,13 @@
|
||||
|
||||
|
||||
|
||||
/* Expanding upon joystick.h */
|
||||
#define JOY_FIRE_IDX 4
|
||||
|
||||
#define JOY_FIRE(v) ((v) & joy_masks[JOY_FIRE_IDX])
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Variables */
|
||||
/*****************************************************************************/
|
||||
@@ -198,10 +205,12 @@ unsigned int __fastcall__ cbm_k_load(unsigned char flag, unsigned addr);
|
||||
unsigned char cbm_k_open (void);
|
||||
unsigned char cbm_k_readst (void);
|
||||
unsigned char __fastcall__ cbm_k_save(unsigned int start, unsigned int end);
|
||||
void cbm_k_scnkey (void);
|
||||
void __fastcall__ cbm_k_setlfs (unsigned char LFN, unsigned char DEV,
|
||||
unsigned char SA);
|
||||
void __fastcall__ cbm_k_setnam (const char* Name);
|
||||
void __fastcall__ cbm_k_talk (unsigned char dev);
|
||||
void cbm_k_udtim (void);
|
||||
void cbm_k_unlsn (void);
|
||||
|
||||
|
||||
|
||||
@@ -85,6 +85,11 @@ int __fastcall__ cc65_cos (unsigned x);
|
||||
** is in 8.8 fixed point format, which means that 1.0 = $100 and -1.0 = $FF00.
|
||||
*/
|
||||
|
||||
unsigned char doesclrscrafterexit (void);
|
||||
/* Indicates whether the screen automatically be cleared after program
|
||||
** termination.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/* End of cc65.h */
|
||||
|
||||
70
include/creativision.h
Normal file
70
include/creativision.h
Normal file
@@ -0,0 +1,70 @@
|
||||
/*****************************************************************************/
|
||||
/* */
|
||||
/* creativision.h */
|
||||
/* */
|
||||
/* Creativision system specific definitions */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 2013 cvemu */
|
||||
/* (C) 2017 Christian Groessler <chris@groessler.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 _CVISION_H
|
||||
#define _CVISION_H
|
||||
|
||||
/* Character codes */
|
||||
#define CH_VLINE 33
|
||||
#define CH_HLINE 34
|
||||
#define CH_ULCORNER 35
|
||||
#define CH_URCORNER 36
|
||||
#define CH_LLCORNER 37
|
||||
#define CH_LRCORNER 38
|
||||
|
||||
/* no support for dynamically loadable drivers */
|
||||
#define DYN_DRV 0
|
||||
|
||||
/* Colours - from TMS9918 */
|
||||
#define C_TRANSPARENT 0
|
||||
#define C_BLACK 1
|
||||
#define C_MED_GREEN 2
|
||||
#define C_LIGHT_GREEN 3
|
||||
#define C_DARK_BLUE 4
|
||||
#define C_LIGHT_BLUE 5
|
||||
#define C_DARK_RED 6
|
||||
#define C_CYAN 7
|
||||
#define C_MED_RED 8
|
||||
#define C_LIGHT_RED 9
|
||||
#define C_DARK_YELLOW 10
|
||||
#define C_LIGHT_YELLOW 11
|
||||
#define C_DARK_GREEN 12
|
||||
#define C_MAGENTA 13
|
||||
#define C_GREY 14
|
||||
#define C_WHITE 15
|
||||
|
||||
/* Protos */
|
||||
void __fastcall__ psg_outb(unsigned char b);
|
||||
void __fastcall__ psg_delay(unsigned char b);
|
||||
void psg_silence(void);
|
||||
void __fastcall__ bios_playsound(void *a, unsigned char b);
|
||||
|
||||
#endif /* #ifndef _CVISION_H */
|
||||
@@ -89,9 +89,9 @@ unsigned char __fastcall__ toascii (unsigned char c);
|
||||
** #undef'ing the macroes.
|
||||
** Please note that the following macroes do NOT handle EOF correctly, as
|
||||
** stated in the manual. If you need correct behaviour for EOF, don't
|
||||
** use -Os, or #undefine the following macroes.
|
||||
** use --eagerly-inline-funcs, or #undefine the following macroes.
|
||||
*/
|
||||
#ifdef __OPT_s__
|
||||
#ifdef __EAGERLY_INLINE_FUNCS__
|
||||
|
||||
#define isalnum(c) (__AX__ = (c), \
|
||||
__asm__ ("tay"), \
|
||||
|
||||
@@ -72,7 +72,8 @@ extern int _errno;
|
||||
#define ESPIPE 14 /* Illegal seek */
|
||||
#define ERANGE 15 /* Range error */
|
||||
#define EBADF 16 /* Bad file number */
|
||||
#define EUNKNOWN 17 /* Unknown OS specific error */
|
||||
#define ENOEXEC 17 /* Exec format error */
|
||||
#define EUNKNOWN 18 /* Unknown OS specific error */
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -80,17 +80,6 @@
|
||||
bit 3:
|
||||
*/
|
||||
|
||||
#define JOY_DATA 0x4400
|
||||
|
||||
#define JOY_DATA_UP 0x01
|
||||
#define JOY_DATA_DOWN 0x02
|
||||
#define JOY_DATA_LEFT 0x04
|
||||
#define JOY_DATA_RIGHT 0x08
|
||||
#define JOY_DATA_FIRE_A 0x10
|
||||
#define JOY_DATA_FIRE_B 0x20
|
||||
#define JOY_DATA_START 0x40
|
||||
#define JOY_DATA_SELECT 0x80
|
||||
|
||||
/* LCD
|
||||
|
||||
resolution 160x152 in 4 greys/greens
|
||||
@@ -181,15 +170,22 @@
|
||||
/* No support for dynamically loadable drivers */
|
||||
#define DYN_DRV 0
|
||||
|
||||
/* Expanding upon joystick.h */
|
||||
#define JOY_BTN_A_IDX 4
|
||||
#define JOY_BTN_B_IDX 5
|
||||
#define JOY_START_IDX 6
|
||||
#define JOY_SELECT_IDX 7
|
||||
|
||||
#define JOY_BTN_A(v) ((v) & joy_masks[JOY_BTN_A_IDX])
|
||||
#define JOY_BTN_B(v) ((v) & joy_masks[JOY_BTN_B_IDX])
|
||||
#define JOY_START(v) ((v) & joy_masks[JOY_START_IDX])
|
||||
#define JOY_SELECT(v) ((v) & joy_masks[JOY_SELECT_IDX])
|
||||
|
||||
/* The addresses of the static drivers */
|
||||
extern void gamate_stdjoy_joy[]; /* Referred to by joy_static_stddrv[] */
|
||||
|
||||
#define JOY_FIRE_B 5
|
||||
#define JOY_START 6
|
||||
#define JOY_SELECT 7
|
||||
|
||||
void waitvblank (void);
|
||||
/* Wait for the vertical blanking */
|
||||
void waitvsync (void);
|
||||
/* Wait for start of next frame */
|
||||
|
||||
/* NOTE: all Gamate are "NTSC" */
|
||||
#define get_tv() TV_NTSC
|
||||
|
||||
@@ -52,27 +52,31 @@
|
||||
#define JOY_ERR_NO_DEVICE 4 /* Device (hardware) not found */
|
||||
|
||||
/* Argument for the joy_read function */
|
||||
#define JOY_1 0
|
||||
#define JOY_2 1
|
||||
#define JOY_1 0
|
||||
#define JOY_2 1
|
||||
|
||||
/* The following codes are *indices* into the joy_masks array */
|
||||
#define JOY_UP 0
|
||||
#define JOY_DOWN 1
|
||||
#define JOY_LEFT 2
|
||||
#define JOY_RIGHT 3
|
||||
#define JOY_FIRE 4
|
||||
#define JOY_FIRE2 5 /* Second fire button if available */
|
||||
#define JOY_UP_IDX 0
|
||||
#define JOY_DOWN_IDX 1
|
||||
#define JOY_LEFT_IDX 2
|
||||
#define JOY_RIGHT_IDX 3
|
||||
#define JOY_BTN_1_IDX 4 /* Universally available */
|
||||
#define JOY_BTN_2_IDX 5 /* Second button if available */
|
||||
#define JOY_BTN_3_IDX 6 /* Third button if available */
|
||||
#define JOY_BTN_4_IDX 7 /* Fourth button if available */
|
||||
|
||||
/* Array of masks used to check the return value of joy_read for a state */
|
||||
extern const unsigned char joy_masks[8];
|
||||
|
||||
/* Macros that evaluate the return code of joy_read */
|
||||
#define JOY_BTN_UP(v) ((v) & joy_masks[JOY_UP])
|
||||
#define JOY_BTN_DOWN(v) ((v) & joy_masks[JOY_DOWN])
|
||||
#define JOY_BTN_LEFT(v) ((v) & joy_masks[JOY_LEFT])
|
||||
#define JOY_BTN_RIGHT(v) ((v) & joy_masks[JOY_RIGHT])
|
||||
#define JOY_BTN_FIRE(v) ((v) & joy_masks[JOY_FIRE])
|
||||
#define JOY_BTN_FIRE2(v) ((v) & joy_masks[JOY_FIRE2])
|
||||
#define JOY_UP(v) ((v) & joy_masks[JOY_UP_IDX])
|
||||
#define JOY_DOWN(v) ((v) & joy_masks[JOY_DOWN_IDX])
|
||||
#define JOY_LEFT(v) ((v) & joy_masks[JOY_LEFT_IDX])
|
||||
#define JOY_RIGHT(v) ((v) & joy_masks[JOY_RIGHT_IDX])
|
||||
#define JOY_BTN_1(v) ((v) & joy_masks[JOY_BTN_1_IDX])
|
||||
#define JOY_BTN_2(v) ((v) & joy_masks[JOY_BTN_2_IDX])
|
||||
#define JOY_BTN_3(v) ((v) & joy_masks[JOY_BTN_3_IDX])
|
||||
#define JOY_BTN_4(v) ((v) & joy_masks[JOY_BTN_4_IDX])
|
||||
|
||||
/* The name of the standard joystick driver for a platform */
|
||||
extern const char joy_stddrv[];
|
||||
|
||||
@@ -92,6 +92,15 @@
|
||||
|
||||
|
||||
|
||||
/* Expanding upon joystick.h */
|
||||
#define JOY_BTN_A_IDX 4
|
||||
#define JOY_BTN_B_IDX 5
|
||||
|
||||
#define JOY_BTN_A(v) ((v) & joy_masks[JOY_BTN_A_IDX])
|
||||
#define JOY_BTN_B(v) ((v) & joy_masks[JOY_BTN_B_IDX])
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Variables */
|
||||
/*****************************************************************************/
|
||||
|
||||
43
include/lz4.h
Normal file
43
include/lz4.h
Normal file
@@ -0,0 +1,43 @@
|
||||
/*****************************************************************************/
|
||||
/* */
|
||||
/* lz4.h */
|
||||
/* */
|
||||
/* Decompression routine for the 'lz4' format */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 2017 Mega Cat Studios */
|
||||
/* */
|
||||
/* 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 _LZ4_H
|
||||
#define _LZ4_H
|
||||
|
||||
void __fastcall__ decompress_lz4 (const unsigned char* src, unsigned char* const dst,
|
||||
const unsigned short uncompressed_size);
|
||||
/* Decompresses the source buffer into the destination buffer.
|
||||
** The size of the decompressed data must be known in advance, LZ4
|
||||
** does not include any terminator in-stream.
|
||||
*/
|
||||
|
||||
/* end of lz4.h */
|
||||
#endif
|
||||
@@ -90,15 +90,16 @@
|
||||
/* No support for dynamically loadable drivers */
|
||||
#define DYN_DRV 0
|
||||
|
||||
/* The joystick keys - all keys are supported */
|
||||
#define KEY_A 0x01
|
||||
#define KEY_B 0x02
|
||||
#define KEY_SELECT 0x04
|
||||
#define KEY_START 0x08
|
||||
#define KEY_UP 0x10
|
||||
#define KEY_DOWN 0x20
|
||||
#define KEY_LEFT 0x40
|
||||
#define KEY_RIGHT 0x80
|
||||
/* Expanding upon joystick.h */
|
||||
#define JOY_BTN_A_IDX 4
|
||||
#define JOY_BTN_B_IDX 5
|
||||
#define JOY_SELECT_IDX 6
|
||||
#define JOY_START_IDX 7
|
||||
|
||||
#define JOY_BTN_A(v) ((v) & joy_masks[JOY_BTN_A_IDX])
|
||||
#define JOY_BTN_B(v) ((v) & joy_masks[JOY_BTN_B_IDX])
|
||||
#define JOY_SELECT(v) ((v) & joy_masks[JOY_SELECT_IDX])
|
||||
#define JOY_START(v) ((v) & joy_masks[JOY_START_IDX])
|
||||
|
||||
/* Define hardware */
|
||||
|
||||
@@ -163,8 +164,8 @@ extern void nes_64_56_2_tgi[]; /* Referred to by tgi_static_stddrv[] */
|
||||
|
||||
|
||||
|
||||
void waitvblank (void);
|
||||
/* Wait for the vertical blanking */
|
||||
void waitvsync (void);
|
||||
/* Wait for start of the next frame */
|
||||
|
||||
unsigned char get_tv (void);
|
||||
/* Return the video mode the machine is using. */
|
||||
|
||||
@@ -1,47 +1,47 @@
|
||||
/*****************************************************************************/
|
||||
/* */
|
||||
/* osic1p.h */
|
||||
/* */
|
||||
/* Challenger 1P system specific definitions */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 2015 Stephan Muehlstrasser */
|
||||
/* */
|
||||
/* */
|
||||
/* 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 _OSIC1P_H
|
||||
#define _OSIC1P_H
|
||||
|
||||
/* Check for errors */
|
||||
#if !defined(__OSIC1P__)
|
||||
# error "This module may only be used when compiling for the Challenger 1P!"
|
||||
#endif
|
||||
|
||||
/* 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 _textcolor(color) COLOR_WHITE
|
||||
#define _bgcolor(color) COLOR_BLACK
|
||||
#define _bordercolor(color) COLOR_BLACK
|
||||
|
||||
#endif
|
||||
/*****************************************************************************/
|
||||
/* */
|
||||
/* osic1p.h */
|
||||
/* */
|
||||
/* Challenger 1P system specific definitions */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 2015 Stephan Muehlstrasser */
|
||||
/* */
|
||||
/* */
|
||||
/* 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 _OSIC1P_H
|
||||
#define _OSIC1P_H
|
||||
|
||||
/* Check for errors */
|
||||
#if !defined(__OSIC1P__)
|
||||
# error "This module may only be used when compiling for the Challenger 1P!"
|
||||
#endif
|
||||
|
||||
/* 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 _textcolor(color) COLOR_WHITE
|
||||
#define _bgcolor(color) COLOR_BLACK
|
||||
#define _bordercolor(color) COLOR_BLACK
|
||||
|
||||
#endif
|
||||
|
||||
@@ -76,15 +76,22 @@
|
||||
/* No support for dynamically loadable drivers */
|
||||
#define DYN_DRV 0
|
||||
|
||||
/* Expanding upon joystick.h */
|
||||
#define JOY_BTN_I_IDX 4
|
||||
#define JOY_BTN_II_IDX 5
|
||||
#define JOY_SELECT_IDX 6
|
||||
#define JOY_RUN_IDX 7
|
||||
|
||||
#define JOY_BTN_I(v) ((v) & joy_masks[JOY_BTN_I_IDX])
|
||||
#define JOY_BTN_II(v) ((v) & joy_masks[JOY_BTN_II_IDX])
|
||||
#define JOY_SELECT(v) ((v) & joy_masks[JOY_SELECT_IDX])
|
||||
#define JOY_RUN(v) ((v) & joy_masks[JOY_RUN_IDX])
|
||||
|
||||
/* The addresses of the static drivers */
|
||||
extern void pce_stdjoy_joy[]; /* Referred to by joy_static_stddrv[] */
|
||||
|
||||
#define JOY_FIRE_B 5
|
||||
#define JOY_SELECT 6
|
||||
#define JOY_RUN 7
|
||||
|
||||
void waitvblank (void);
|
||||
/* Wait for the vertical blanking */
|
||||
void waitvsync (void);
|
||||
/* Wait for start of the next frame */
|
||||
|
||||
/* NOTE: all PCE are NTSC */
|
||||
#define get_tv() TV_NTSC
|
||||
|
||||
43
include/telestrat.h
Normal file
43
include/telestrat.h
Normal file
@@ -0,0 +1,43 @@
|
||||
/*****************************************************************************/
|
||||
/* */
|
||||
/* telestrat.h */
|
||||
/* */
|
||||
/* Oric Telestrat system-specific definitions */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 2017 Debrune Jérome, <jede@oric.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. */
|
||||
/* */
|
||||
/*****************************************************************************/
|
||||
|
||||
|
||||
|
||||
void oups();
|
||||
void ping();
|
||||
void zap();
|
||||
void shoot();
|
||||
void explode();
|
||||
|
||||
void kbdclick1();
|
||||
|
||||
|
||||
|
||||
|
||||
344
include/zlib.h
344
include/zlib.h
@@ -1,172 +1,172 @@
|
||||
/*****************************************************************************/
|
||||
/* */
|
||||
/* zlib.h */
|
||||
/* */
|
||||
/* Decompression routines for the 'deflate' format */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 2000-2015 Piotr Fusik <fox@scene.pl> */
|
||||
/* */
|
||||
/* This file is based on the zlib.h from 'zlib' general purpose compression */
|
||||
/* library, version 1.1.3, (C) 1995-1998 Jean-loup Gailly and Mark Adler. */
|
||||
/* */
|
||||
/* Jean-loup Gailly Mark Adler */
|
||||
/* jloup@gzip.org madler@alumni.caltech.edu */
|
||||
/* */
|
||||
/* 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 _ZLIB_H
|
||||
#define _ZLIB_H
|
||||
|
||||
#define Z_OK 0
|
||||
#define Z_DATA_ERROR (-3)
|
||||
/* Return codes for uncompress() */
|
||||
|
||||
#define Z_DEFLATED 8
|
||||
/* The deflate compression method (the only one supported) */
|
||||
|
||||
#define Z_NULL 0
|
||||
|
||||
|
||||
unsigned __fastcall__ inflatemem (char* dest, const char* source);
|
||||
/*
|
||||
Decompresses the source buffer into the destination buffer.
|
||||
Returns the size of the uncompressed data (number of bytes written starting
|
||||
from dest).
|
||||
|
||||
This function expects data in the DEFLATE format, described in RFC
|
||||
(Request for Comments) 1951 in the file
|
||||
ftp://ds.internic.net/rfc/rfc1951.txt.
|
||||
|
||||
This function does not exist in the original zlib. Its implementation
|
||||
using original zlib might be following:
|
||||
|
||||
unsigned inflatemem (char* dest, const char* source)
|
||||
{
|
||||
z_stream stream;
|
||||
|
||||
stream.next_in = (Bytef*) source;
|
||||
stream.avail_in = 65535;
|
||||
|
||||
stream.next_out = dest;
|
||||
stream.avail_out = 65535;
|
||||
|
||||
stream.zalloc = (alloc_func) 0;
|
||||
stream.zfree = (free_func) 0;
|
||||
|
||||
inflateInit2(&stream, -MAX_WBITS);
|
||||
inflate(&stream, Z_FINISH);
|
||||
inflateEnd(&stream);
|
||||
|
||||
return stream.total_out;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
int __fastcall__ uncompress (char* dest, unsigned* destLen,
|
||||
const char* source, unsigned sourceLen);
|
||||
/*
|
||||
Original zlib description:
|
||||
|
||||
Decompresses the source buffer into the destination buffer. sourceLen is
|
||||
the byte length of the source buffer. Upon entry, destLen is the total
|
||||
size of the destination buffer, which must be large enough to hold the
|
||||
entire uncompressed data. (The size of the uncompressed data must have
|
||||
been saved previously by the compressor and transmitted to the decompressor
|
||||
by some mechanism outside the scope of this compression library.)
|
||||
Upon exit, destLen is the actual size of the compressed buffer.
|
||||
This function can be used to decompress a whole file at once if the
|
||||
input file is mmap'ed.
|
||||
|
||||
uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
|
||||
enough memory, Z_BUF_ERROR if there was not enough room in the output
|
||||
buffer, or Z_DATA_ERROR if the input data was corrupted.
|
||||
|
||||
Implementation notes:
|
||||
|
||||
This function expects data in the ZLIB format, described in RFC 1950
|
||||
in the file ftp://ds.internic.net/rfc/rfc1950.txt. The ZLIB format is
|
||||
essentially the DEFLATE format plus a very small header and Adler-32
|
||||
checksum.
|
||||
|
||||
Z_MEM_ERROR and Z_BUF_ERROR are never returned in this implementation.
|
||||
*/
|
||||
|
||||
|
||||
unsigned long __fastcall__ adler32 (unsigned long adler, const char* buf,
|
||||
unsigned len);
|
||||
|
||||
/*
|
||||
Original zlib description:
|
||||
|
||||
Update a running Adler-32 checksum with the bytes buf[0..len-1] and
|
||||
return the updated checksum. If buf is NULL, this function returns
|
||||
the required initial value for the checksum.
|
||||
An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
|
||||
much faster. Usage example:
|
||||
|
||||
unsigned long adler = adler32(0L, Z_NULL, 0);
|
||||
|
||||
while (read_buffer(buffer, length) != EOF) {
|
||||
adler = adler32(adler, buffer, length);
|
||||
}
|
||||
if (adler != original_adler) error();
|
||||
|
||||
Implementation notes:
|
||||
|
||||
This function isn't actually much faster than crc32(), but it is smaller
|
||||
and does not use any lookup tables.
|
||||
*/
|
||||
|
||||
|
||||
unsigned long __fastcall__ crc32 (unsigned long crc, const char* buf,
|
||||
unsigned len);
|
||||
/*
|
||||
Original zlib description:
|
||||
|
||||
Update a running crc with the bytes buf[0..len-1] and return the updated
|
||||
crc. If buf is NULL, this function returns the required initial value
|
||||
for the crc. Pre- and post-conditioning (one's complement) is performed
|
||||
within this function so it shouldn't be done by the application.
|
||||
Usage example:
|
||||
|
||||
unsigned long crc = crc32(0L, Z_NULL, 0);
|
||||
|
||||
while (read_buffer(buffer, length) != EOF) {
|
||||
crc = crc32(crc, buffer, length);
|
||||
}
|
||||
if (crc != original_crc) error();
|
||||
|
||||
Implementation notes:
|
||||
|
||||
This function uses statically allocated 1 KB lookup table. The table is
|
||||
initialised before it is used for the first time (that is, if buffer is
|
||||
NULL or length is zero, then the lookup table isn't initialised).
|
||||
*/
|
||||
|
||||
|
||||
/* end of zlib.h */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/* */
|
||||
/* zlib.h */
|
||||
/* */
|
||||
/* Decompression routines for the 'deflate' format */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 2000-2015 Piotr Fusik <fox@scene.pl> */
|
||||
/* */
|
||||
/* This file is based on the zlib.h from 'zlib' general purpose compression */
|
||||
/* library, version 1.1.3, (C) 1995-1998 Jean-loup Gailly and Mark Adler. */
|
||||
/* */
|
||||
/* Jean-loup Gailly Mark Adler */
|
||||
/* jloup@gzip.org madler@alumni.caltech.edu */
|
||||
/* */
|
||||
/* 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 _ZLIB_H
|
||||
#define _ZLIB_H
|
||||
|
||||
#define Z_OK 0
|
||||
#define Z_DATA_ERROR (-3)
|
||||
/* Return codes for uncompress() */
|
||||
|
||||
#define Z_DEFLATED 8
|
||||
/* The deflate compression method (the only one supported) */
|
||||
|
||||
#define Z_NULL 0
|
||||
|
||||
|
||||
unsigned __fastcall__ inflatemem (char* dest, const char* source);
|
||||
/*
|
||||
Decompresses the source buffer into the destination buffer.
|
||||
Returns the size of the uncompressed data (number of bytes written starting
|
||||
from dest).
|
||||
|
||||
This function expects data in the DEFLATE format, described in RFC
|
||||
(Request for Comments) 1951 in the file
|
||||
ftp://ds.internic.net/rfc/rfc1951.txt.
|
||||
|
||||
This function does not exist in the original zlib. Its implementation
|
||||
using original zlib might be following:
|
||||
|
||||
unsigned inflatemem (char* dest, const char* source)
|
||||
{
|
||||
z_stream stream;
|
||||
|
||||
stream.next_in = (Bytef*) source;
|
||||
stream.avail_in = 65535;
|
||||
|
||||
stream.next_out = dest;
|
||||
stream.avail_out = 65535;
|
||||
|
||||
stream.zalloc = (alloc_func) 0;
|
||||
stream.zfree = (free_func) 0;
|
||||
|
||||
inflateInit2(&stream, -MAX_WBITS);
|
||||
inflate(&stream, Z_FINISH);
|
||||
inflateEnd(&stream);
|
||||
|
||||
return stream.total_out;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
int __fastcall__ uncompress (char* dest, unsigned* destLen,
|
||||
const char* source, unsigned sourceLen);
|
||||
/*
|
||||
Original zlib description:
|
||||
|
||||
Decompresses the source buffer into the destination buffer. sourceLen is
|
||||
the byte length of the source buffer. Upon entry, destLen is the total
|
||||
size of the destination buffer, which must be large enough to hold the
|
||||
entire uncompressed data. (The size of the uncompressed data must have
|
||||
been saved previously by the compressor and transmitted to the decompressor
|
||||
by some mechanism outside the scope of this compression library.)
|
||||
Upon exit, destLen is the actual size of the compressed buffer.
|
||||
This function can be used to decompress a whole file at once if the
|
||||
input file is mmap'ed.
|
||||
|
||||
uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
|
||||
enough memory, Z_BUF_ERROR if there was not enough room in the output
|
||||
buffer, or Z_DATA_ERROR if the input data was corrupted.
|
||||
|
||||
Implementation notes:
|
||||
|
||||
This function expects data in the ZLIB format, described in RFC 1950
|
||||
in the file ftp://ds.internic.net/rfc/rfc1950.txt. The ZLIB format is
|
||||
essentially the DEFLATE format plus a very small header and Adler-32
|
||||
checksum.
|
||||
|
||||
Z_MEM_ERROR and Z_BUF_ERROR are never returned in this implementation.
|
||||
*/
|
||||
|
||||
|
||||
unsigned long __fastcall__ adler32 (unsigned long adler, const char* buf,
|
||||
unsigned len);
|
||||
|
||||
/*
|
||||
Original zlib description:
|
||||
|
||||
Update a running Adler-32 checksum with the bytes buf[0..len-1] and
|
||||
return the updated checksum. If buf is NULL, this function returns
|
||||
the required initial value for the checksum.
|
||||
An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
|
||||
much faster. Usage example:
|
||||
|
||||
unsigned long adler = adler32(0L, Z_NULL, 0);
|
||||
|
||||
while (read_buffer(buffer, length) != EOF) {
|
||||
adler = adler32(adler, buffer, length);
|
||||
}
|
||||
if (adler != original_adler) error();
|
||||
|
||||
Implementation notes:
|
||||
|
||||
This function isn't actually much faster than crc32(), but it is smaller
|
||||
and does not use any lookup tables.
|
||||
*/
|
||||
|
||||
|
||||
unsigned long __fastcall__ crc32 (unsigned long crc, const char* buf,
|
||||
unsigned len);
|
||||
/*
|
||||
Original zlib description:
|
||||
|
||||
Update a running crc with the bytes buf[0..len-1] and return the updated
|
||||
crc. If buf is NULL, this function returns the required initial value
|
||||
for the crc. Pre- and post-conditioning (one's complement) is performed
|
||||
within this function so it shouldn't be done by the application.
|
||||
Usage example:
|
||||
|
||||
unsigned long crc = crc32(0L, Z_NULL, 0);
|
||||
|
||||
while (read_buffer(buffer, length) != EOF) {
|
||||
crc = crc32(crc, buffer, length);
|
||||
}
|
||||
if (crc != original_crc) error();
|
||||
|
||||
Implementation notes:
|
||||
|
||||
This function uses statically allocated 1 KB lookup table. The table is
|
||||
initialised before it is used for the first time (that is, if buffer is
|
||||
NULL or length is zero, then the lookup table isn't initialised).
|
||||
*/
|
||||
|
||||
|
||||
/* end of zlib.h */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user