Merge branch 'master' into missing-purple
This commit is contained in:
@@ -137,7 +137,7 @@ struct __antic {
|
||||
** Called during every vertical blank; see SYSVBV, VVBLKI, CRITIC, and VVBLKD,
|
||||
** as well as the SETVBV routine.
|
||||
*/
|
||||
#define NMIEN_VBI 0x40
|
||||
#define NMIEN_VBI 0x40
|
||||
|
||||
/* [Reset] key pressed */
|
||||
#define NMIEN_RESET 0x20
|
||||
|
||||
@@ -31,19 +31,19 @@
|
||||
struct __os {
|
||||
|
||||
/*Page zero*/
|
||||
unsigned char pokmsk; // = $00 System mask for POKEY IRQ enable
|
||||
unsigned char pokmsk; // = $00 System mask for POKEY IRQ enable
|
||||
unsigned char rtclok[2]; // = $01,$02 Real time clock
|
||||
unsigned char critic; // = $03 Critical section flag
|
||||
unsigned char critic; // = $03 Critical section flag
|
||||
unsigned char atract; // = $04 Attract mode counter
|
||||
|
||||
|
||||
union {
|
||||
struct {
|
||||
unsigned char sdlstl; // = $05 Save display list LO
|
||||
unsigned char sdlsth; // = $06 Save display list HI
|
||||
};
|
||||
void* sdlst; // = $05,$06 Display list shadow
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
unsigned char sdmctl; // = $07 DMACTL shadow
|
||||
unsigned char pcolr0; // = $08 PM color 0
|
||||
unsigned char pcolr1; // = $09 PM color 1
|
||||
@@ -55,10 +55,10 @@ struct __os {
|
||||
unsigned char color3; // = $0F PF color 3
|
||||
unsigned char color4; // = $10 PF color 4
|
||||
unsigned char _free_1[0xEF]; // = $11-$FF User space
|
||||
|
||||
|
||||
/*Stack*/
|
||||
unsigned char stack[0x100]; // = $100-$1FF Stack
|
||||
|
||||
|
||||
/*Page 2 OS variables*/
|
||||
void (*vinter)(void); // = $200 Immediate IRQ vector
|
||||
void (*vvblki)(void); // = $202 Immediate VBI vector
|
||||
@@ -74,7 +74,7 @@ struct __os {
|
||||
void (*vtimr1)(void); // = $216 POKEY timer 1 IRQ vector
|
||||
void (*vtimr2)(void); // = $218 POKEY timer 2 IRQ vector
|
||||
void (*vtimr4)(void); // = $21A POKEY timer 4 IRQ vector
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -66,7 +66,7 @@ struct __dcb {
|
||||
unsigned char dtimlo; /* device timeout in seconds */
|
||||
unsigned char dunuse; /* - unused - */
|
||||
unsigned int dbyt; /* # of bytes to transfer */
|
||||
union {
|
||||
union {
|
||||
struct {
|
||||
unsigned char daux1; /* 1st command auxiliary byte */
|
||||
unsigned char daux2; /* 2nd command auxiliary byte */
|
||||
@@ -105,7 +105,7 @@ struct __dos2x {
|
||||
unsigned char* zbufp; /* points to user filename */
|
||||
unsigned char* zdrva; /* points to serveral buffers (mostly VTOC) */
|
||||
unsigned char* zsba; /* points to sector buffer */
|
||||
unsigned char errno; /* number of occured error */
|
||||
unsigned char errno; /* number of occurred error */
|
||||
};
|
||||
|
||||
typedef struct __dos2x dos2x_t;
|
||||
@@ -167,28 +167,28 @@ struct __os {
|
||||
|
||||
#ifdef OSA
|
||||
unsigned char* linzbs; // = $00/$01 LINBUG RAM (WILL BE REPLACED BY MONITOR RAM)
|
||||
#else
|
||||
#else
|
||||
unsigned char linflg; // = $00 LNBUG FLAG (0 = NOT LNBUG)
|
||||
unsigned char ngflag; // = $01 MEMORY STATUS (0 = FAILURE)
|
||||
#endif
|
||||
#endif
|
||||
unsigned char* casini; // = $02/$03 CASSETTE INIT LOCATION
|
||||
unsigned char* ramlo; // = $04/$05 RAM POINTER FOR MEMORY TEST
|
||||
|
||||
#ifdef OSA
|
||||
|
||||
#ifdef OSA
|
||||
unsigned char tramsz; // = $06 FLAG FOR LEFT CARTRIDGE
|
||||
unsigned char tstdat; // = $07 FLAG FOR RIGHT CARTRIDGE
|
||||
#else
|
||||
#else
|
||||
unsigned char trnsmz; // = $06 TEMPORARY REGISTER FOR RAM SIZE
|
||||
unsigned char tstdat; // = $07 UNUSED (NOT TOUCHED DURING RESET/COLD START)
|
||||
#endif
|
||||
|
||||
// Cleared upon Coldstart only
|
||||
|
||||
|
||||
// Cleared upon Coldstart only
|
||||
|
||||
unsigned char warmst; // = $08 WARM START FLAG
|
||||
unsigned char bootq; // = $09 SUCCESSFUL BOOT FLAG
|
||||
unsigned char bootq; // = $09 SUCCESSFUL BOOT FLAG
|
||||
void (*dosvec)(void); // = $0A/$0B DISK SOFTWARE START VECTOR
|
||||
void (*dosini)(void); // = $0C/$0D DISK SOFTWARE INIT ADDRESS
|
||||
unsigned char* appmhi; // = $0E/$0F APPLICATIONS MEMORY HI LIMIT
|
||||
unsigned char* appmhi; // = $0E/$0F APPLICATIONS MEMORY HI LIMIT
|
||||
|
||||
// Cleared upon Coldstart or Warmstart
|
||||
|
||||
@@ -199,26 +199,26 @@ struct __os {
|
||||
unsigned char iccomt; // = $17 COMMAND FOR VECTOR
|
||||
unsigned char* dskfms; // = $18/$19 DISK FILE MANAGER POINTER
|
||||
unsigned char* dskutl; // = $1A/$1B DISK UTILITIES POINTER
|
||||
#ifdef OSA
|
||||
#ifdef OSA
|
||||
unsigned char ptimot; // = $1C PRINTER TIME OUT REGISTER
|
||||
unsigned char pbpnt; // = $1D PRINT BUFFER POINTER
|
||||
unsigned char pbufsz; // = $1E PRINT BUFFER SIZE
|
||||
unsigned char ptemp; // = $1F TEMPORARY REGISTER
|
||||
#else
|
||||
#else
|
||||
unsigned char abufpt[4]; // = $1C-$1F ACMI BUFFER POINTER AREA
|
||||
#endif
|
||||
#endif
|
||||
iocb_t ziocb; // = $20-$2F ZERO PAGE I/O CONTROL BLOCK
|
||||
|
||||
|
||||
unsigned char status; // = $30 INTERNAL STATUS STORAGE
|
||||
unsigned char chksum; // = $31 CHECKSUM (SINGLE BYTE SUM WITH CARRY)
|
||||
unsigned char* bufr; // = $32/$33 POINTER TO DATA BUFFER
|
||||
unsigned char* bfen; // = $34/$35 NEXT BYTE PAST END OF THE DATA BUFFER LO
|
||||
#ifdef OSA
|
||||
#ifdef OSA
|
||||
unsigned char cretry; // = $36 NUMBER OF COMMAND FRAME RETRIES
|
||||
unsigned char dretry; // = $37 NUMBER OF DEVICE RETRIES
|
||||
#else
|
||||
#else
|
||||
unsigned int ltemp; // = $36/$37 LOADER TEMPORARY
|
||||
#endif
|
||||
#endif
|
||||
unsigned char bufrfl; // = $38 DATA BUFFER FULL FLAG
|
||||
unsigned char recvdn; // = $39 RECEIVE DONE FLAG
|
||||
unsigned char xmtdon; // = $3A TRANSMISSION DONE FLAG
|
||||
@@ -227,22 +227,22 @@ struct __os {
|
||||
unsigned char bptr; // = $3D CASSETTE BUFFER POINTER
|
||||
unsigned char ftype; // = $3E CASSETTE IRG TYPE
|
||||
unsigned char feof; // = $3F CASSETTE EOF FLAG (0 // = QUIET)
|
||||
|
||||
|
||||
unsigned char freq; // = $40 CASSETTE BEEP COUNTER
|
||||
unsigned char soundr; // = $41 NOISY I/0 FLAG. (ZERO IS QUIET)
|
||||
unsigned char critic; // = $42 DEFINES CRITICAL SECTION (CRITICAL IF NON-Z)
|
||||
dos2x_t fmszpg; // = $43-$49 DISK FILE MANAGER SYSTEM ZERO PAGE
|
||||
#ifdef OSA
|
||||
#ifdef OSA
|
||||
unsigned char ckey; // = $4A FLAG SET WHEN GAME START PRESSED
|
||||
unsigned char cassbt; // = $4B CASSETTE BOOT FLAG
|
||||
#else
|
||||
#else
|
||||
void* zchain; // = $4A/$4B HANDLER LINKAGE CHAIN POINTER
|
||||
#endif
|
||||
#endif
|
||||
unsigned char dstat; // = $4C DISPLAY STATUS
|
||||
unsigned char atract; // = $4D ATRACT FLAG
|
||||
unsigned char drkmsk; // = $4E DARK ATRACT MASK
|
||||
unsigned char colrsh; // = $4F ATRACT COLOR SHIFTER (EOR'ED WITH PLAYFIELD
|
||||
|
||||
|
||||
unsigned char tmpchr; // = $50 TEMPORARY CHARACTER
|
||||
unsigned char hold1; // = $51 TEMPORARY
|
||||
unsigned char lmargn; // = $52 LEFT MARGIN (NORMALLY 2, CC65 C STARTUP CODE SETS IT TO 0)
|
||||
@@ -255,68 +255,68 @@ struct __os {
|
||||
unsigned int oldcol; // = $5B/$5C PRIOR COLUMN
|
||||
unsigned char oldchr; // = $5D DATA UNDER CURSOR
|
||||
unsigned char* oldadr; // = $5E/$5F SAVED CURSOR MEMORY ADDRESS
|
||||
|
||||
#ifdef OSA
|
||||
|
||||
#ifdef OSA
|
||||
unsigned char newrow; // = $60 POINT DRAW GOES TO
|
||||
unsigned int newcol; // = $61/$62 COLUMN DRAW GOES TO
|
||||
#else
|
||||
#else
|
||||
unsigned char* fkdef; // = $60/$61 FUNCTION KEY DEFINITION TABLE
|
||||
unsigned char palnts; // = $62 PAL/NTSC INDICATOR (0 // = NTSC)
|
||||
#endif
|
||||
#endif
|
||||
unsigned char logcol; // = $63 POINTS AT COLUMN IN LOGICAL LINE
|
||||
unsigned char* adress; // = $64/$65 TEMPORARY ADDRESS
|
||||
unsigned int mlttmp; // = $66/$67 TEMPORARY / FIRST BYTE IS USED IN OPEN AS TEMP
|
||||
unsigned int savadr; // = $68/$69 SAVED ADDRESS
|
||||
unsigned int mlttmp; // = $66/$67 TEMPORARY / FIRST BYTE IS USED IN OPEN AS TEMP
|
||||
unsigned int savadr; // = $68/$69 SAVED ADDRESS
|
||||
unsigned char ramtop; // = $6A RAM SIZE DEFINED BY POWER ON LOGIC
|
||||
unsigned char bufcnt; // = $6B BUFFER COUNT
|
||||
unsigned char* bufstr; // = $6C/$6D EDITOR GETCH POINTER
|
||||
unsigned char bitmsk; // = $6E BIT MASK
|
||||
unsigned char shfamt; // = $6F SHIFT AMOUNT FOR PIXEL JUSTIFUCATION
|
||||
|
||||
|
||||
unsigned int rowac; // = $70/$71 DRAW WORKING ROW
|
||||
unsigned int colac; // = $72/$73 DRAW WORKING COLUMN
|
||||
unsigned char* endpt; // = $74/$75 END POINT
|
||||
unsigned char deltar; // = $76 ROW DIFFERENCE
|
||||
unsigned int deltac; // = $77/$78 COLUMN DIFFERENCE
|
||||
#ifdef OSA
|
||||
unsigned char rowinc; // = $79 ROWINC
|
||||
#ifdef OSA
|
||||
unsigned char rowinc; // = $79 ROWINC
|
||||
unsigned char colinc; // = $7A COLINC
|
||||
#else
|
||||
#else
|
||||
unsigned char* keydef; // = $79/$7A 2-BYTE KEY DEFINITION TABLE ADDRESS
|
||||
#endif
|
||||
#endif
|
||||
unsigned char swpflg; // = $7B NON-0 1F TXT AND REGULAR RAM IS SWAPPED
|
||||
unsigned char holdch; // = $7C CH IS MOVED HERE IN KGETCH BEFORE CNTL & SH
|
||||
unsigned char insdat; // = $7D 1-BYTE TEMPORARY
|
||||
unsigned int countr; // = $7E/$7F 2-BYTE DRAW ITERATION COUNT
|
||||
|
||||
|
||||
unsigned char _free_1[0xD4-0x7F-1]; // USER SPACE
|
||||
|
||||
|
||||
// Floating Point Package Page Zero Address Equates
|
||||
fpreg_t fpreg[4]; // = $D4-$EB 4 REGSITERS, ACCCESS LIKE "fpreg[FPIDX_R0].fr"
|
||||
unsigned char frx; // = $EC 1-BYTE TEMPORARY
|
||||
fpreg_t fpreg[4]; // = $D4-$EB 4 REGSITERS, ACCCESS LIKE "fpreg[FPIDX_R0].fr"
|
||||
unsigned char frx; // = $EC 1-BYTE TEMPORARY
|
||||
unsigned char eexp; // = $ED VALUE OF EXP
|
||||
#ifdef OS_REV2
|
||||
#ifdef OS_REV2
|
||||
unsigned char frsign; // = $EE ##REV2## 1-BYTE FLOATING POINT SIGN
|
||||
unsigned char plycnt; // = $EF ##REV2## 1-BYTE POLYNOMIAL DEGREE
|
||||
unsigned char sgnflg; // = $F0 ##REV2## 1-BYTE SIGN FLAG
|
||||
unsigned char xfmflg; // = $F1 ##REV2## 1-BYTE TRANSFORM FLAG
|
||||
#else
|
||||
#else
|
||||
unsigned char nsign; // = $EE SIGN OF #
|
||||
unsigned char esign; // = $EF SIGN OF EXPONENT
|
||||
unsigned char fchrflg; // = $F0 1ST CHAR FLAG
|
||||
unsigned char digrt; // = $F1 # OF DIGITS RIGHT OF DECIMAL
|
||||
#endif
|
||||
#endif
|
||||
unsigned char cix; // = $F2 CURRENT INPUT INDEX
|
||||
unsigned char* inbuff; // = $F3/$F4 POINTS TO USER'S LINE INPUT BUFFER
|
||||
unsigned char* inbuff; // = $F3/$F4 POINTS TO USER'S LINE INPUT BUFFER
|
||||
unsigned int ztemp1; // = $F5/$F6 2-BYTE TEMPORARY
|
||||
unsigned int ztemp4; // = $F7/$F8 2-BYTE TEMPORARY
|
||||
unsigned int ztemp3; // = $F9/$FA 2-BYTE TEMPORARY
|
||||
|
||||
union {
|
||||
|
||||
union {
|
||||
unsigned char degflg; // = $FB ##OLD## SAME AS RADFLG
|
||||
unsigned char radflg; // = $FB ##OLD## 0=RADIANS, 6=DEGREES
|
||||
};
|
||||
|
||||
|
||||
fpreg_t* flptr; // = $FC/$FD 2-BYTE FLOATING POINT NUMBER POINTER
|
||||
fpreg_t* fptr2; // = $FE/$FF 2-BYTE FLOATING POINT NUMBER POINTER
|
||||
|
||||
@@ -356,28 +356,28 @@ struct __os {
|
||||
union {
|
||||
struct {
|
||||
unsigned char sdlstl; // = $0230 SAVE DISPLAY LIST LOW BYTE
|
||||
unsigned char sdlsth; // = $0231 SAVE DISPLAY LIST HI BYTE
|
||||
unsigned char sdlsth; // = $0231 SAVE DISPLAY LIST HI BYTE
|
||||
};
|
||||
void* sdlst; // = $0230/$0231 (same as above as pointer)
|
||||
};
|
||||
unsigned char sskctl; // = $0232 SKCTL REGISTER RAM
|
||||
#ifdef OSA
|
||||
#ifdef OSA
|
||||
unsigned char _spare_1; // = $0233 No OS use.
|
||||
#else
|
||||
unsigned char lcount; // = $0233 ##1200xl## 1-byte relocating loader record
|
||||
#endif
|
||||
#endif
|
||||
unsigned char lpenh; // = $0234 LIGHT PEN HORIZONTAL VALUE
|
||||
unsigned char lpenv; // = $0235 LIGHT PEN VERTICAL VALUE
|
||||
void (*brkky)(void); // = $0236/$0237 BREAK KEY VECTOR
|
||||
#ifdef OSA
|
||||
#ifdef OSA
|
||||
unsigned char spare2[2]; // = $0238/$0239 No OS use.
|
||||
#else
|
||||
#else
|
||||
void (*vpirq)(void); // = $0238/$0239 ##rev2## 2-byte parallel device IRQ vector
|
||||
#endif
|
||||
#endif
|
||||
unsigned char cdevic; // = $023A COMMAND FRAME BUFFER - DEVICE
|
||||
unsigned char ccomnd; // = $023B COMMAND
|
||||
union {
|
||||
struct {
|
||||
struct {
|
||||
unsigned char caux1; // = $023C COMMAND AUX BYTE 1
|
||||
unsigned char caux2; // = $023D COMMAND AUX BYTE 2
|
||||
};
|
||||
@@ -389,15 +389,15 @@ struct __os {
|
||||
unsigned char dbsect; // = $0241 NUMBER OF DISK BOOT SECTORS
|
||||
unsigned char* bootad; // = $0242/$0243 ADDRESS WHERE DISK BOOT LOADER WILL BE PUT
|
||||
unsigned char coldst; // = $0244 COLDSTART FLAG (1=IN MIDDLE OF COLDSTART>
|
||||
#ifdef OSA
|
||||
#ifdef OSA
|
||||
unsigned char spare3; // = $0245 No OS use.
|
||||
#else
|
||||
#else
|
||||
unsigned char reclen; // = $0245 ##1200xl## 1-byte relocating loader record length
|
||||
#endif
|
||||
#endif
|
||||
unsigned char dsktim; // = $0246 DISK TIME OUT REGISTER
|
||||
#ifdef OSA
|
||||
#ifdef OSA
|
||||
unsigned char linbuf[40]; // = $0247-$026E ##old## CHAR LINE BUFFER
|
||||
#else
|
||||
#else
|
||||
unsigned char pdvmsk; // = $0247 ##rev2## 1-byte parallel device selection mask
|
||||
unsigned char shpdvs; // = $0248 ##rev2## 1-byte PDVS (parallel device select)
|
||||
unsigned char pdimsk; // = $0249 ##rev2## 1-byte parallel device IRQ selection
|
||||
@@ -409,7 +409,7 @@ struct __os {
|
||||
unsigned char vsflag; // = $026C ##1200xl## 1-byte fine vertical scroll count
|
||||
unsigned char keydis; // = $026D ##1200xl## 1-byte keyboard disable
|
||||
unsigned char fine; // = $026E ##1200xl## 1-byte fine scrolling mode
|
||||
#endif
|
||||
#endif
|
||||
unsigned char gprior; // = $026F GLOBAL PRIORITY CELL
|
||||
unsigned char paddl0; // = $0270 1-BYTE POTENTIOMETER 0
|
||||
unsigned char paddl1; // = $0271 1-BYTE POTENTIOMETER 1
|
||||
@@ -435,30 +435,30 @@ struct __os {
|
||||
unsigned char strig1; // = $0285 1-BYTE JOYSTICK TRIGGER 1
|
||||
unsigned char strig2; // = $0286 1-BYTE JOYSTICK TRIGGER 2
|
||||
unsigned char strig3; // = $0287 1-BYTE JOYSTICK TRIGGER 3
|
||||
#ifdef OSA
|
||||
#ifdef OSA
|
||||
unsigned char cstat; // = $0288 ##old## cassette status register
|
||||
#else
|
||||
#else
|
||||
unsigned char hibyte; // = $0288 ##1200xl## 1-byte relocating loader high byte
|
||||
#endif
|
||||
#endif
|
||||
unsigned char wmode; // = $0289 1-byte cassette WRITE mode
|
||||
unsigned char blim; // = $028A 1-byte cassette buffer limit
|
||||
#ifdef OSA
|
||||
unsigned char _reserved_2[5]; // = $028B-$028F RESERVED
|
||||
#else
|
||||
#else
|
||||
unsigned char imask; // = $028B ##rev2## (not used)
|
||||
void (*jveck)(void); // = $028C/$028D 2-byte jump vector
|
||||
unsigned newadr; // = $028E/028F ##1200xl## 2-byte relocating address
|
||||
#endif
|
||||
#endif
|
||||
unsigned char txtrow; // = $0290 TEXT ROWCRS
|
||||
unsigned txtcol; // = $0291/$0292 TEXT COLCRS
|
||||
unsigned char tindex; // = $0293 TEXT INDEX
|
||||
unsigned char* txtmsc; // = $0294/$0295 FOOLS CONVRT INTO NEW MSC
|
||||
unsigned char txtold[6]; // = $0296-$029B OLDROW & OLDCOL FOR TEXT (AND THEN SOME)
|
||||
#ifdef OSA
|
||||
#ifdef OSA
|
||||
unsigned char tmpx1; // = $029C ##old## 1--byte temporary register
|
||||
#else
|
||||
#else
|
||||
unsigned char cretry; // = $029C ##1200xl## 1-byte number of command frame retries
|
||||
#endif
|
||||
#endif
|
||||
unsigned char hold3; // = $029D 1-byte temporary
|
||||
unsigned char subtmp; // = $029E 1-byte temporary
|
||||
unsigned char hold2; // = $029F 1-byte (not used)
|
||||
@@ -473,41 +473,41 @@ struct __os {
|
||||
unsigned tmpcol; // = $02B9/$02BA 2-byte temporary column
|
||||
unsigned char scrflg; // = $02BB SET IF SCROLL OCCURS
|
||||
unsigned char hold4; // = $02BC TEMP CELL USED IN DRAW ONLY
|
||||
#ifdef OSA
|
||||
#ifdef OSA
|
||||
unsigned char hold5; // = $02BD ##old## DITTO
|
||||
#else
|
||||
#else
|
||||
unsigned char dretry; // = $02BD ##1200xl## 1-byte number of device retries
|
||||
#endif
|
||||
#endif
|
||||
unsigned char shflok; // = $02BE 1-byte shift/control lock flags
|
||||
unsigned char botscr; // = $02BF BOTTOM OF SCREEN 24 NORM 4 SPLIT
|
||||
unsigned char pcolr0; // = $02C0 1-byte player-missile 0 color/luminance
|
||||
unsigned char pcolr1; // = $02C1 1-byte player-missile 1 color/luminance
|
||||
unsigned char pcolr2; // = $02C2 1-byte player-missile 2 color/luminance
|
||||
unsigned char pcolr3; // = $02C3 1-byte player-missile 3 color/luminance
|
||||
unsigned char pcolr3; // = $02C3 1-byte player-missile 3 color/luminance
|
||||
unsigned char color0; // = $02C4 1-byte playfield 0 color/luminance
|
||||
unsigned char color1; // = $02C5 1-byte playfield 1 color/luminance
|
||||
unsigned char color2; // = $02C6 1-byte playfield 2 color/luminance
|
||||
unsigned char color3; // = $02C7 1-byte playfield 3 color/luminance
|
||||
unsigned char color4; // = $02C8 1-byte background color/luminance
|
||||
#ifdef OSA
|
||||
#ifdef OSA
|
||||
unsigned char _spare_2[23]; // = $02C9-$02DF No OS use.
|
||||
#else
|
||||
union {
|
||||
unsigned char parmbl[6]; // = $02C9 ##rev2## 6-byte relocating loader parameter
|
||||
struct {
|
||||
struct {
|
||||
void (*runadr)(void); // = $02C9 ##1200xl## 2-byte run address
|
||||
unsigned int hiused; // = $02CB ##1200xl## 2-byte highest non-zero page address
|
||||
unsigned int zhiuse; // = $02CD ##1200xl## 2-byte highest zero page address
|
||||
};
|
||||
};
|
||||
union {
|
||||
};
|
||||
};
|
||||
union {
|
||||
unsigned char oldpar[6]; // = $02CF ##rev2## 6-byte relocating loader parameter
|
||||
struct {
|
||||
struct {
|
||||
void (*gbytea)(void); // = $02CF ##1200xl## 2-byte GET-BYTE routine address
|
||||
unsigned int loadad; // = $02D1 ##1200xl## 2-byte non-zero page load address
|
||||
unsigned int zloada; // = $02D3 ##1200xl## 2-byte zero page load address
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
unsigned int dsctln; // = $02D5 ##1200xl## 2-byte disk sector length
|
||||
unsigned int acmisr; // = $02D7 ##1200xl## 2-byte ACMI interrupt service routine
|
||||
unsigned char krpdel; // = $02D9 ##1200xl## 1-byte auto-repeat delay
|
||||
@@ -517,78 +517,78 @@ struct __os {
|
||||
unsigned char dmasav; // = $02DD ##1200xl## 1-byte SDMCTL save/restore
|
||||
unsigned char pbpnt; // = $02DE ##1200xl## 1-byte printer buffer pointer
|
||||
unsigned char pbufsz; // = $02DF ##1200xl## 1-byte printer buffer size
|
||||
#endif
|
||||
union {
|
||||
#endif
|
||||
union {
|
||||
unsigned char glbabs[4]; // = $02E0-$02E3 byte global variables for non-DOS users
|
||||
struct {
|
||||
struct {
|
||||
void (*runad)(void); // = $02E0 ##map## 2-byte binary file run address
|
||||
void (*initad)(void); // = $02E2 ##map## 2-byte binary file initialization address
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
unsigned char ramsiz; // = $02E4 RAM SIZE (HI BYTE ONLY)
|
||||
void* memtop; // = $02E5 TOP OF AVAILABLE USER MEMORY
|
||||
void* memlo; // = $02E7 BOTTOM OF AVAILABLE USER MEMORY
|
||||
#ifdef OSA
|
||||
#ifdef OSA
|
||||
unsigned char _spare_3; // = $02E9 No OS use.
|
||||
#else
|
||||
#else
|
||||
unsigned char hndlod; // = $02E9 ##1200xl## 1-byte user load flag
|
||||
#endif
|
||||
#endif
|
||||
unsigned char dvstat[4]; // = $02EA-$02ED STATUS BUFFER
|
||||
union {
|
||||
union {
|
||||
unsigned int cbaud; // = $02EE/$02EF 2-byte cassette baud rate
|
||||
struct {
|
||||
struct {
|
||||
unsigned char cbaudl; // = $02EE 1-byte low cassette baud rate
|
||||
unsigned char cbaudh; // = $02EF 1-byte high cassette baud rate
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
unsigned char crsinh; // = $02F0 CURSOR INHIBIT (00 = CURSOR ON)
|
||||
unsigned char keydel; // = $02F1 KEY DELAY
|
||||
unsigned char ch1; // = $02F2 1-byte prior keyboard character
|
||||
unsigned char chact; // = $02F3 CHACTL REGISTER RAM
|
||||
unsigned char chbas; // = $02F4 CHBAS REGISTER RAM
|
||||
#ifdef OSA
|
||||
#ifdef OSA
|
||||
unsigned char _spare_4[5]; // = $02F5-$02F9 No OS use.
|
||||
#else
|
||||
#else
|
||||
unsigned char newrow; // = $02F5 ##1200xl## 1-byte draw destination row
|
||||
unsigned int newcol; // = $02F6/$02F7 ##1200xl## 2-byte draw destination column
|
||||
unsigned char rowinc; // = $02F8 ##1200xl## 1-byte draw row increment
|
||||
unsigned char colinc; // = $02F9 ##1200xl## 1-byte draw column increment
|
||||
#endif
|
||||
#endif
|
||||
unsigned char char_; // = $02FA 1-byte internal character (naming changed due to do keyword conflict)
|
||||
unsigned char atachr; // = $02FB ATASCII CHARACTER
|
||||
unsigned char ch; // = $02FC GLOBAL VARIABLE FOR KEYBOARD
|
||||
unsigned char fildat; // = $02FD RIGHT FILL DATA <DRAW>
|
||||
unsigned char dspflg; // = $02FE DISPLAY FLAG DISPLAY CNTLS IF NON-ZERO
|
||||
unsigned char ssflag; // = $02FF START/STOP FLAG FOR PAGING (CNTL 1). CLEARE
|
||||
|
||||
|
||||
// --- Page 3 ---
|
||||
|
||||
dcb_t dcb; // = $0300-$030B DEVICE CONTROL BLOCK
|
||||
unsigned int timer1; // = $030C/$030D INITIAL TIMER VALUE
|
||||
#ifdef OSA
|
||||
#ifdef OSA
|
||||
unsigned char addcor; // = $030E ##old## ADDITION CORRECTION
|
||||
#else
|
||||
#else
|
||||
unsigned char jmpers; // = $030E ##1200xl## 1-byte jumper options
|
||||
#endif
|
||||
#endif
|
||||
unsigned char casflg; // = $030F CASSETTE MODE WHEN SET
|
||||
unsigned int timer2; // = $0310/$0311 2-byte final baud rate timer value
|
||||
unsigned char temp1; // = $0312 TEMPORARY STORAGE REGISTER
|
||||
#ifdef OSA
|
||||
#ifdef OSA
|
||||
unsigned char _spare_5; // = $0313 unused
|
||||
unsigned char temp2; // = $0314 ##old## TEMPORARY STORAGE REGISTER
|
||||
#else
|
||||
#else
|
||||
unsigned char temp2; // = $0313 ##1200xl## 1-byte temporary
|
||||
unsigned char ptimot; // = $0314 ##1200xl## 1-byte printer timeout
|
||||
#endif
|
||||
#endif
|
||||
unsigned char temp3; // = $0315 TEMPORARY STORAGE REGISTER
|
||||
unsigned char savio; // = $0316 SAVE SERIAL IN DATA PORT
|
||||
unsigned char timflg; // = $0317 TIME OUT FLAG FOR BAUD RATE CORRECTION
|
||||
unsigned char stackp; // = $0318 SIO STACK POINTER SAVE CELL
|
||||
unsigned char tstat; // = $0319 TEMPORARY STATUS HOLDER
|
||||
#ifdef OSA
|
||||
#ifdef OSA
|
||||
hatabs_t hatabs[12]; // = $031A-$033D handler address table
|
||||
unsigned int zeropad; // = $033E/$033F zero padding
|
||||
#else
|
||||
#else
|
||||
hatabs_t hatabs[11]; // = $031A-$033A handler address table
|
||||
unsigned int zeropad; // = $033B/$033C zero padding
|
||||
unsigned char pupbt1; // = $033D ##1200xl## 1-byte power-up validation byte 1
|
||||
@@ -598,9 +598,9 @@ struct __os {
|
||||
|
||||
iocb_t iocb[8]; // = $0340-$03BF 8 I/O Control Blocks
|
||||
unsigned char prnbuf[40]; // = $03C0-$3E7 PRINTER BUFFER
|
||||
#ifdef OSA
|
||||
#ifdef OSA
|
||||
unsigned char _spare_6[151]; // = $03E8-$047F unused
|
||||
#else
|
||||
#else
|
||||
unsigned char superf; // = $03E8 ##1200xl## 1-byte editor super function flag
|
||||
unsigned char ckey; // = $03E9 ##1200xl## 1-byte cassette boot request flag
|
||||
unsigned char cassbt; // = $03EA ##1200xl## 1-byte cassette boot flag
|
||||
@@ -639,7 +639,7 @@ struct __basic {
|
||||
void* starp; // = $8C/$8D ADDRESS FOR THE STRING AND ARRAY TABLE
|
||||
void* runstk; // = $8E/$8F ADDRESS OF THE RUNTIME STACK
|
||||
void* memtop; // = $90/$91 POINTER TO THE TOP OF BASIC MEMORY
|
||||
|
||||
|
||||
unsigned char _internal_1[0xBA-0x91-1]; // INTERNAL DATA
|
||||
|
||||
unsigned int stopln; // = $BA/$BB LINE WHERE A PROGRAM WAS STOPPED
|
||||
|
||||
63
include/_maria.h
Normal file
63
include/_maria.h
Normal file
@@ -0,0 +1,63 @@
|
||||
/*****************************************************************************/
|
||||
/* */
|
||||
/* _maria.h */
|
||||
/* */
|
||||
/* Atari 7800, Maria chip register hardware structures */
|
||||
/* */
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
/*****************************************************************************/
|
||||
|
||||
/*
|
||||
* MARIA registers
|
||||
*/
|
||||
struct __maria {
|
||||
unsigned char bkgrnd;
|
||||
unsigned char p0c1;
|
||||
unsigned char p0c2;
|
||||
unsigned char p0c3;
|
||||
unsigned char wsync;
|
||||
unsigned char p1c1;
|
||||
unsigned char p1c2;
|
||||
unsigned char p1c3;
|
||||
unsigned char mstat;
|
||||
unsigned char p2c1;
|
||||
unsigned char p2c2;
|
||||
unsigned char p2c3;
|
||||
unsigned char dpph;
|
||||
unsigned char p3c1;
|
||||
unsigned char p3c2;
|
||||
unsigned char p3c3;
|
||||
unsigned char dppl;
|
||||
unsigned char p4c1;
|
||||
unsigned char p4c2;
|
||||
unsigned char p4c3;
|
||||
unsigned char chbase;
|
||||
unsigned char p5c1;
|
||||
unsigned char p5c2;
|
||||
unsigned char p5c3;
|
||||
unsigned char offset;
|
||||
unsigned char p6c1;
|
||||
unsigned char p6c2;
|
||||
unsigned char p6c3;
|
||||
unsigned char ctrl;
|
||||
unsigned char p7c1;
|
||||
unsigned char p7c2;
|
||||
unsigned char p7c3;
|
||||
};
|
||||
@@ -131,7 +131,7 @@ struct __pokey_write {
|
||||
#define SKCTL_KEYBOARD_SCANNING 0x02 /* Enable keyboard scanning circuit */
|
||||
|
||||
/* Fast pot scan
|
||||
** The pot scan counter completes its sequence in two TV line times instead of
|
||||
** The pot scan counter completes its sequence in two TV line times instead of
|
||||
** one frame time (228 scan lines). Not as accurate as the normal pot scan
|
||||
*/
|
||||
#define SKCTL_FAST_POT_SCAN 0x04
|
||||
@@ -204,7 +204,7 @@ struct __pokey_read {
|
||||
#define SKSTAT_DATA_READ_INGORING_SHIFTREG 0x10 /* Data can be read directly from the serial input port, ignoring the shift register. */
|
||||
#define SKSTAT_KEYBOARD_OVERRUN 0x20 /* Keyboard over-run; Reset BITs 7, 6 and 5 (latches) to 1, using SKREST */
|
||||
#define SKSTAT_INPUT_OVERRUN 0x40 /* Serial data input over-run. Reset latches as above. */
|
||||
#define SKSTAT_INPUT_FRAMEERROR 0x80 /* Serial data input frame error caused by missing or extra bits. Reset latches as above. */
|
||||
#define SKSTAT_INPUT_FRAMEERROR 0x80 /* Serial data input frame error caused by missing or extra bits. Reset latches as above. */
|
||||
|
||||
|
||||
/* KBCODE, internal keyboard codes for Atari 8-bit computers,
|
||||
|
||||
@@ -180,7 +180,7 @@ unsigned char detect_c128 (void);
|
||||
unsigned char __fastcall__ set_chameleon_speed (unsigned char speed);
|
||||
|
||||
/* Set the speed of the C64 Chameleon cartridge, the following inputs
|
||||
* are accepted:
|
||||
* are accepted:
|
||||
* SPEED_SLOW : 1 Mhz mode
|
||||
* SPEED_1X : 1 Mhz mode
|
||||
* SPEED_2X : 2 Mhz mode
|
||||
|
||||
@@ -159,11 +159,11 @@ extern struct {
|
||||
unsigned day :5;
|
||||
unsigned mon :4;
|
||||
unsigned year :7;
|
||||
} createdate; /* Current date: 0 */
|
||||
} createdate; /* Current date: 0 */
|
||||
struct {
|
||||
unsigned char min;
|
||||
unsigned char hour;
|
||||
} createtime; /* Current time: 0 */
|
||||
} createtime; /* Current time: 0 */
|
||||
} _datetime;
|
||||
|
||||
/* The addresses of the static drivers */
|
||||
|
||||
67
include/atari7800.h
Normal file
67
include/atari7800.h
Normal file
@@ -0,0 +1,67 @@
|
||||
/*****************************************************************************/
|
||||
/* */
|
||||
/* Atari VCS 7800 TIA & RIOT registers addresses */
|
||||
/* */
|
||||
/* Karri Kaksonen (karri@sipo.fi), 2022 */
|
||||
/* */
|
||||
/* */
|
||||
/*****************************************************************************/
|
||||
|
||||
|
||||
|
||||
#ifndef _ATARI7800_H
|
||||
#define _ATARI7800_H
|
||||
|
||||
/* Check for errors */
|
||||
#if !defined(__ATARI7800__)
|
||||
# error This module may only be used when compiling for the Atari 7800!
|
||||
#endif
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Data */
|
||||
/*****************************************************************************/
|
||||
|
||||
|
||||
|
||||
/* Color defines */
|
||||
#define COLOR_BLACK 0x00
|
||||
#define COLOR_GREY 0x01
|
||||
#define COLOR_LIGHTGREY 0x02
|
||||
#define COLOR_WHITE 0x03
|
||||
|
||||
/* TGI color defines (default palette) */
|
||||
#define TGI_COLOR_BLACK COLOR_BLACK
|
||||
#define TGI_COLOR_GREY COLOR_GREY
|
||||
#define TGI_COLOR_LIGHTGREY COLOR_LIGHTGREY
|
||||
#define TGI_COLOR_WHITE COLOR_WHITE
|
||||
|
||||
/* Masks for joy_read */
|
||||
#define JOY_RIGHT_MASK 0x80
|
||||
#define JOY_LEFT_MASK 0x40
|
||||
#define JOY_DOWN_MASK 0x20
|
||||
#define JOY_UP_MASK 0x10
|
||||
#define JOY_BTN_1_MASK 0x01
|
||||
#define JOY_BTN_2_MASK 0x02
|
||||
|
||||
#define JOY_BTN_A_MASK JOY_BTN_1_MASK
|
||||
#define JOY_BTN_B_MASK JOY_BTN_2_MASK
|
||||
|
||||
#define JOY_BTN_A(v) ((v) & JOY_BTN_A_MASK)
|
||||
#define JOY_BTN_B(v) ((v) & JOY_BTN_B_MASK)
|
||||
|
||||
/* No support for dynamically loadable drivers */
|
||||
#define DYN_DRV 0
|
||||
|
||||
extern unsigned char get_tv(void); /* get TV system */
|
||||
|
||||
#include <_tia.h>
|
||||
#define TIA (*(struct __tia*)0x0000)
|
||||
|
||||
#include <_riot.h>
|
||||
#define RIOT (*(struct __riot*)0x0280)
|
||||
|
||||
#include <_maria.h>
|
||||
#define MARIA (*(struct __maria*)0x0020)
|
||||
|
||||
/* End of atari7800.h */
|
||||
#endif
|
||||
@@ -59,21 +59,21 @@ unsigned long __fastcall__ udiv32by16r16 (unsigned long rhs, unsigned lhs);
|
||||
*/
|
||||
|
||||
int __fastcall__ imul8x8r16 (signed char lhs, signed char rhs);
|
||||
/* Multiplicate two signed 8 bit to yield an signed 16 bit result */
|
||||
/* Multiply two signed 8 bit to yield an signed 16 bit result */
|
||||
|
||||
long __fastcall__ imul16x16r32 (int lhs, int rhs);
|
||||
/* Multiplicate two signed 16 bit to yield a signed 32 bit result */
|
||||
/* Multiply two signed 16 bit to yield a signed 32 bit result */
|
||||
|
||||
unsigned __fastcall__ umul8x8r16 (unsigned char lhs, unsigned char rhs);
|
||||
/* Multiplicate two unsigned 8 bit to yield an unsigned 16 bit result */
|
||||
/* Multiply two unsigned 8 bit to yield an unsigned 16 bit result */
|
||||
|
||||
unsigned long __fastcall__ umul16x8r32 (unsigned lhs, unsigned char rhs);
|
||||
/* Multiplicate an unsigned 16 bit by an unsigned 8 bit number yielding a 24
|
||||
/* Multiply an unsigned 16 bit by an unsigned 8 bit number yielding a 24
|
||||
** bit unsigned result that is extended to 32 bits for easier handling from C.
|
||||
*/
|
||||
|
||||
unsigned long __fastcall__ umul16x16r32 (unsigned lhs, unsigned rhs);
|
||||
/* Multiplicate two unsigned 16 bit to yield an unsigned 32 bit result */
|
||||
/* Multiply two unsigned 16 bit to yield an unsigned 32 bit result */
|
||||
|
||||
unsigned int __fastcall__ mul20 (unsigned char value);
|
||||
/* Multiply an 8 bit unsigned value by 20 and return the 16 bit unsigned
|
||||
|
||||
@@ -57,7 +57,9 @@
|
||||
/* Character classification functions */
|
||||
int __fastcall__ isalnum (int c);
|
||||
int __fastcall__ isalpha (int c);
|
||||
int __fastcall__ isascii (int c);
|
||||
#if __CC65_STD__ >= __CC65_STD_CC65__
|
||||
int __fastcall__ isascii (int c); /* non standard */
|
||||
#endif
|
||||
int __fastcall__ iscntrl (int c);
|
||||
int __fastcall__ isdigit (int c);
|
||||
int __fastcall__ isgraph (int c);
|
||||
@@ -75,7 +77,7 @@ int __fastcall__ toupper (int c); /* Always external */
|
||||
int __fastcall__ tolower (int c); /* Always external */
|
||||
|
||||
#if __CC65_STD__ >= __CC65_STD_CC65__
|
||||
unsigned char __fastcall__ toascii (unsigned char c);
|
||||
unsigned char __fastcall__ toascii (unsigned char c); /* non standard */
|
||||
/* Convert a target-specific character to ASCII. */
|
||||
#endif
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
/* cx16.h */
|
||||
/* */
|
||||
/* CX16 system-specific definitions */
|
||||
/* For prerelease 38 */
|
||||
/* For prerelease 39 */
|
||||
/* */
|
||||
/* */
|
||||
/* This software is provided "as-is", without any expressed or implied */
|
||||
@@ -169,11 +169,16 @@ enum {
|
||||
};
|
||||
|
||||
/* Video modes for videomode() */
|
||||
#define VIDEOMODE_40x30 0x00
|
||||
#define VIDEOMODE_80x60 0x02
|
||||
#define VIDEOMODE_40COL VIDEOMODE_40x30
|
||||
#define VIDEOMODE_80x60 0x00
|
||||
#define VIDEOMODE_80x30 0x01
|
||||
#define VIDEOMODE_40x60 0x02
|
||||
#define VIDEOMODE_40x30 0x03
|
||||
#define VIDEOMODE_40x15 0x04
|
||||
#define VIDEOMODE_20x30 0x05
|
||||
#define VIDEOMODE_20x15 0x06
|
||||
#define VIDEOMODE_80COL VIDEOMODE_80x60
|
||||
#define VIDEOMODE_320x200 0x80
|
||||
#define VIDEOMODE_40COL VIDEOMODE_40x30
|
||||
#define VIDEOMODE_320x240 0x80
|
||||
#define VIDEOMODE_SWAP (-1)
|
||||
|
||||
/* VERA's address increment/decrement numbers */
|
||||
@@ -221,6 +226,13 @@ enum {
|
||||
|
||||
/* Define hardware. */
|
||||
|
||||
#define RAM_BANK (*(unsigned char *)0x00)
|
||||
#define ROM_BANK (*(unsigned char *)0x01)
|
||||
|
||||
#include <_6522.h>
|
||||
#define VIA1 (*(volatile struct __6522 *)0x9F00)
|
||||
#define VIA2 (*(volatile struct __6522 *)0x9F10)
|
||||
|
||||
/* A structure with the Video Enhanced Retro Adapter's external registers */
|
||||
struct __vera {
|
||||
unsigned short address; /* Address for data ports */
|
||||
@@ -271,12 +283,15 @@ struct __vera {
|
||||
};
|
||||
#define VERA (*(volatile struct __vera *)0x9F20)
|
||||
|
||||
#include <_6522.h>
|
||||
#define VIA1 (*(volatile struct __6522 *)0x9F60)
|
||||
#define VIA2 (*(volatile struct __6522 *)0x9F70)
|
||||
|
||||
#define RAM_BANK (VIA1.pra)
|
||||
#define ROM_BANK (VIA1.prb)
|
||||
/* Audio chip */
|
||||
struct __ym2151 {
|
||||
union {
|
||||
unsigned char reg; /* Register number for data */
|
||||
unsigned char status; /* Busy flag */
|
||||
};
|
||||
unsigned char data;
|
||||
};
|
||||
#define YM2151 (*(volatile struct __ym2151 *)0x9F40)
|
||||
|
||||
/* A structure with the x16emu's settings registers */
|
||||
struct __emul {
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
** are declared here.
|
||||
**
|
||||
** To use the debugger, just call DbgInit in your application. Once it has
|
||||
** been called, the debugger will catch any BRK opcode. Use the BREAK macro
|
||||
** been called, the debugger will catch any BRK opcode. Use the BREAK macro
|
||||
** defined below to insert breakpoints into your code.
|
||||
**
|
||||
** There are currently a lot of things that cannot be debugged, graphical
|
||||
@@ -121,4 +121,4 @@ void __fastcall__ DbgInit (unsigned unused);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ extern int _errno;
|
||||
|
||||
|
||||
int __fastcall__ _osmaperrno (unsigned char oserror);
|
||||
/* Map an operating system specific error code (for example from _oserror)
|
||||
/* Map an operating system specific error code (for example from _oserror)
|
||||
** into one of the E... codes above. It is user callable.
|
||||
*/
|
||||
|
||||
|
||||
@@ -145,6 +145,8 @@
|
||||
|
||||
/* constants for the conio implementation */
|
||||
#define COLOR_BLACK 0x03
|
||||
#define COLOR_GRAY2 0x02
|
||||
#define COLOR_GRAY1 0x01
|
||||
#define COLOR_WHITE 0x00
|
||||
|
||||
#define CH_HLINE 1
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
void __fastcall__ CopyString(char *dest, const char *source);
|
||||
char __fastcall__ CmpString(const char *dest, const char *source);
|
||||
void __fastcall__ CopyFString(char len, char *dest, const char *source);
|
||||
char __fastcall__ CmpFString(char len, char *dest, const char *source);
|
||||
char __fastcall__ CmpFString(char len, char *dest, const char *source);
|
||||
|
||||
unsigned __fastcall__ CRC(const char *buffer, unsigned len);
|
||||
void* __fastcall__ ClearRam(char *dest, unsigned len);
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
#define _LIMITS_H
|
||||
|
||||
|
||||
|
||||
#define CHAR_BIT 8
|
||||
|
||||
#define SCHAR_MIN ((signed char) 0x80)
|
||||
@@ -63,7 +62,9 @@
|
||||
|
||||
#define ULONG_MAX 4294967295UL
|
||||
|
||||
#if __CC65_STD__ >= __CC65_STD_CC65__
|
||||
/* These defines that are platform dependent */
|
||||
/* FILENAME_MAX in stdlib.h is defined as the same value as PATH_MAX */
|
||||
#if defined(__APPLE2__)
|
||||
# define PATH_MAX (64+1)
|
||||
#elif defined(__ATARI__)
|
||||
@@ -77,7 +78,7 @@
|
||||
#else
|
||||
# define PATH_MAX (16+1)
|
||||
#endif
|
||||
|
||||
#endif /* __CC65_STD__ >= __CC65_STD_CC65__ */
|
||||
|
||||
/* End of limits.h */
|
||||
#endif
|
||||
|
||||
@@ -52,24 +52,25 @@
|
||||
|
||||
|
||||
/* Color defines */
|
||||
#define COLOR_BLACK 0x00
|
||||
#define COLOR_RED 0x01
|
||||
#define COLOR_PINK 0x02
|
||||
#define COLOR_LIGHTGREY 0x03
|
||||
#define COLOR_GREY 0x04
|
||||
#define COLOR_DARKGREY 0x05
|
||||
#define COLOR_BROWN 0x06
|
||||
#define COLOR_PEACH 0x07
|
||||
#define COLOR_YELLOW 0x08
|
||||
#define COLOR_LIGHTGREEN 0x09
|
||||
#define COLOR_GREEN 0x0A
|
||||
#define COLOR_DARKBROWN 0x0B
|
||||
#define COLOR_TRANSPARENT 0x00
|
||||
#define COLOR_BLACK 0x01
|
||||
#define COLOR_RED 0x02
|
||||
#define COLOR_PINK 0x03
|
||||
#define COLOR_LIGHTGREY 0x04
|
||||
#define COLOR_GREY 0x05
|
||||
#define COLOR_DARKGREY 0x06
|
||||
#define COLOR_BROWN 0x07
|
||||
#define COLOR_PEACH 0x08
|
||||
#define COLOR_YELLOW 0x09
|
||||
#define COLOR_LIGHTGREEN 0x0A
|
||||
#define COLOR_GREEN 0x0B
|
||||
#define COLOR_PURPLE 0x0C
|
||||
#define COLOR_BLUE 0x0D
|
||||
#define COLOR_LIGHTBLUE 0x0E
|
||||
#define COLOR_WHITE 0x0F
|
||||
|
||||
/* TGI color defines (default palette) */
|
||||
#define TGI_COLOR_TRANSPARENT COLOR_TRANSPARENT
|
||||
#define TGI_COLOR_BLACK COLOR_BLACK
|
||||
#define TGI_COLOR_RED COLOR_RED
|
||||
#define TGI_COLOR_PINK COLOR_PINK
|
||||
|
||||
@@ -37,12 +37,21 @@
|
||||
#define _STDIO_H
|
||||
|
||||
|
||||
/* NULL pointer */
|
||||
#ifndef _HAVE_NULL
|
||||
#define NULL 0
|
||||
#define _HAVE_NULL
|
||||
#endif
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdarg.h>
|
||||
#include <limits.h>
|
||||
|
||||
/* size_t is needed */
|
||||
#ifndef _HAVE_size_t
|
||||
#define _HAVE_size_t
|
||||
typedef unsigned size_t;
|
||||
#endif
|
||||
|
||||
/* stdio.h should not define va_list, so we use an equivalent type in the
|
||||
compiler namespace instead */
|
||||
typedef unsigned char* __va_list;
|
||||
|
||||
/* Types */
|
||||
typedef struct _FILE FILE;
|
||||
@@ -65,9 +74,24 @@ extern FILE* stderr;
|
||||
#define SEEK_SET 2
|
||||
#define TMP_MAX 256
|
||||
|
||||
#define FILENAME_MAX PATH_MAX
|
||||
#define L_tmpnam FILENAME_MAX
|
||||
/* These defines that are platform dependent */
|
||||
/* FILENAME_MAX is defined as the same value as PATH_MAX in limits.h, but we
|
||||
are not allowed to include limits.h here */
|
||||
#if defined(__APPLE2__)
|
||||
# define FILENAME_MAX (64+1)
|
||||
#elif defined(__ATARI__)
|
||||
# define FILENAME_MAX (63+1)
|
||||
#elif defined(__CBM__)
|
||||
# define FILENAME_MAX (255) /* should be 256+1, see libsrc/common/_cmd.s why it's not */
|
||||
#elif defined(__LUNIX__)
|
||||
# define FILENAME_MAX (80+1)
|
||||
#elif defined(__TELESTRAT__)
|
||||
# define FILENAME_MAX (50+1)
|
||||
#else
|
||||
# define FILENAME_MAX (16+1)
|
||||
#endif
|
||||
|
||||
#define L_tmpnam FILENAME_MAX
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
@@ -107,17 +131,17 @@ int __fastcall__ rename (const char* oldname, const char* newname);
|
||||
int snprintf (char* buf, size_t size, const char* format, ...);
|
||||
int sprintf (char* buf, const char* format, ...);
|
||||
int __fastcall__ ungetc (int c, FILE* f);
|
||||
int __fastcall__ vfprintf (FILE* f, const char* format, va_list ap);
|
||||
int __fastcall__ vprintf (const char* format, va_list ap);
|
||||
int __fastcall__ vsnprintf (char* buf, size_t size, const char* format, va_list ap);
|
||||
int __fastcall__ vsprintf (char* buf, const char* format, va_list ap);
|
||||
int __fastcall__ vfprintf (FILE* f, const char* format, __va_list ap);
|
||||
int __fastcall__ vprintf (const char* format, __va_list ap);
|
||||
int __fastcall__ vsnprintf (char* buf, size_t size, const char* format, __va_list ap);
|
||||
int __fastcall__ vsprintf (char* buf, const char* format, __va_list ap);
|
||||
|
||||
int scanf (const char* format, ...);
|
||||
int fscanf (FILE* f, const char* format, ...);
|
||||
int sscanf (const char* s, const char* format, ...);
|
||||
int __fastcall__ vscanf (const char* format, va_list ap);
|
||||
int __fastcall__ vsscanf (const char* s, const char* format, va_list ap);
|
||||
int __fastcall__ vfscanf (FILE* f, const char* format, va_list ap);
|
||||
int __fastcall__ vscanf (const char* format, __va_list ap);
|
||||
int __fastcall__ vsscanf (const char* s, const char* format, __va_list ap);
|
||||
int __fastcall__ vfscanf (FILE* f, const char* format, __va_list ap);
|
||||
|
||||
#if __CC65_STD__ == __CC65_STD_CC65__
|
||||
FILE* __fastcall__ fdopen (int fd, const char* mode); /* Unix */
|
||||
|
||||
@@ -52,8 +52,8 @@ typedef unsigned size_t;
|
||||
|
||||
/* Those non-standard cc65 exit constants definitions are in addition
|
||||
** to the EXIT_SUCCESS and EXIT_FAILURE constants, which should not be
|
||||
** redefined
|
||||
*/
|
||||
** redefined
|
||||
*/
|
||||
#define EXIT_ASSERT 2
|
||||
#define EXIT_ABORT 3
|
||||
|
||||
|
||||
@@ -36,11 +36,17 @@
|
||||
#ifndef _STRING_H
|
||||
#define _STRING_H
|
||||
|
||||
/* NULL pointer */
|
||||
#ifndef _HAVE_NULL
|
||||
#define NULL 0
|
||||
#define _HAVE_NULL
|
||||
#endif
|
||||
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
/* size_t is needed */
|
||||
#ifndef _HAVE_size_t
|
||||
#define _HAVE_size_t
|
||||
typedef unsigned size_t;
|
||||
#endif
|
||||
|
||||
char* __fastcall__ strcat (char* dest, const char* src);
|
||||
char* __fastcall__ strchr (const char* s, int c);
|
||||
@@ -90,6 +96,5 @@ const char* __fastcall__ _stroserror (unsigned char errcode);
|
||||
/* Map an operating system error number to an error message. */
|
||||
|
||||
|
||||
|
||||
/* End of string.h */
|
||||
#endif
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
/*****************************************************************************/
|
||||
/* Data */
|
||||
/*****************************************************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -43,6 +43,8 @@
|
||||
# include <atari2600.h>
|
||||
#elif defined(__ATARI5200__)
|
||||
# include <atari5200.h>
|
||||
#elif defined(__ATARI7800__)
|
||||
# include <atari7800.h>
|
||||
#elif defined(__ATMOS__)
|
||||
# include <atmos.h>
|
||||
#elif defined(__CBM__)
|
||||
|
||||
@@ -52,7 +52,6 @@ typedef unsigned size_t;
|
||||
|
||||
typedef unsigned long time_t;
|
||||
typedef unsigned long clock_t;
|
||||
typedef unsigned char clockid_t;
|
||||
|
||||
/* Structure for broken down time */
|
||||
struct tm {
|
||||
@@ -67,22 +66,6 @@ struct tm {
|
||||
int tm_isdst;
|
||||
};
|
||||
|
||||
/* Structure for seconds and nanoseconds */
|
||||
struct timespec {
|
||||
time_t tv_sec;
|
||||
long tv_nsec;
|
||||
};
|
||||
|
||||
/* Timezone representation, default is UTC */
|
||||
extern struct _timezone {
|
||||
char daylight; /* True if daylight savings time active */
|
||||
long timezone; /* Number of seconds behind UTC */
|
||||
char tzname[5]; /* Name of timezone, e.g. CET */
|
||||
char dstname[5]; /* Name when daylight true, e.g. CEST */
|
||||
} _tz;
|
||||
|
||||
|
||||
|
||||
#if defined(__ATARI5200__)
|
||||
# define CLOCKS_PER_SEC 60
|
||||
#elif defined(__ATMOS__)
|
||||
@@ -102,12 +85,13 @@ extern struct _timezone {
|
||||
# define CLOCKS_PER_SEC 135 /* FIXME */
|
||||
#elif defined(__GEOS__)
|
||||
# define CLOCKS_PER_SEC 1
|
||||
#elif defined(__TELESTRAT__)
|
||||
# define CLOCKS_PER_SEC 10
|
||||
#elif defined(__ATARI__) || defined (__LYNX__)
|
||||
/* Read the clock rate at runtime */
|
||||
clock_t _clocks_per_sec (void);
|
||||
# define CLOCKS_PER_SEC _clocks_per_sec()
|
||||
#endif
|
||||
#define CLK_TCK CLOCKS_PER_SEC
|
||||
#define CLOCK_REALTIME 0
|
||||
|
||||
|
||||
@@ -123,12 +107,32 @@ size_t __fastcall__ strftime (char* buf, size_t bufsize, const char* format, con
|
||||
time_t __fastcall__ time (time_t* t);
|
||||
|
||||
|
||||
#if __CC65_STD__ >= __CC65_STD_CC65__
|
||||
|
||||
typedef unsigned char clockid_t;
|
||||
|
||||
/* Structure for seconds and nanoseconds */
|
||||
struct timespec {
|
||||
time_t tv_sec;
|
||||
long tv_nsec;
|
||||
};
|
||||
|
||||
/* Timezone representation, default is UTC */
|
||||
extern struct _timezone {
|
||||
char daylight; /* True if daylight savings time active */
|
||||
long timezone; /* Number of seconds behind UTC */
|
||||
char tzname[5]; /* Name of timezone, e.g. CET */
|
||||
char dstname[5]; /* Name when daylight true, e.g. CEST */
|
||||
} _tz;
|
||||
|
||||
#define CLK_TCK CLOCKS_PER_SEC
|
||||
|
||||
/* POSIX function prototypes */
|
||||
int __fastcall__ clock_getres (clockid_t clock_id, struct timespec *res);
|
||||
int __fastcall__ clock_gettime (clockid_t clock_id, struct timespec *tp);
|
||||
int __fastcall__ clock_settime (clockid_t clock_id, const struct timespec *tp);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* End of time.h */
|
||||
|
||||
Reference in New Issue
Block a user