Introduced target 'atarixl'.

The target 'atarixl' is to be used for Atari XL (and better) machines.
It will disable the OS ROM and enable the Shadow RAM available on
those machine.

Note: This commit is only the inital step towards for this goal that just
replicates the target 'atari' as a starting point!
This commit is contained in:
Oliver Schmidt
2013-05-28 21:56:37 +02:00
parent 2e8a65bda4
commit 98c47d1877
19 changed files with 138 additions and 35 deletions

View File

@@ -43,7 +43,7 @@ BUFSIZ = 256
EOF = -1 EOF = -1
.if .defined(__APPLE2__) .or .defined(__APPLE2ENH__) .if .defined(__APPLE2__) .or .defined(__APPLE2ENH__)
FILENAME_MAX = 64+1 FILENAME_MAX = 64+1
.elseif .defined(__ATARI__) .elseif .defined(__ATARI__) .or .defined(__ATARIXL__)
FILENAME_MAX = 12+1 FILENAME_MAX = 12+1
.elseif .defined(__LUNIX__) .elseif .defined(__LUNIX__)
FILENAME_MAX = 80+1 FILENAME_MAX = 80+1

61
cfg/atarixl-overlay.cfg Normal file
View File

@@ -0,0 +1,61 @@
FEATURES {
STARTADDRESS: default = $2E00;
}
SYMBOLS {
__STACKSIZE__: type = weak, value = $0800; # 2k stack
__OVERLAYSIZE__: type = weak, value = $1000; # 4k overlay
__RESERVED_MEMORY__: type = weak, value = $0000;
}
MEMORY {
ZP: file = "", define = yes, start = $0082, size = $007E;
HEADER: file = %O, start = $0000, size = $0006;
RAM: file = %O, start = %S + __OVERLAYSIZE__, size = $BC20 - __STACKSIZE__ - __OVERLAYSIZE__ - %S;
TRAILER: file = %O, start = $0000, size = $0006;
OVL1: file = "%O.1", start = %S, size = __OVERLAYSIZE__;
OVL2: file = "%O.2", start = %S, size = __OVERLAYSIZE__;
OVL3: file = "%O.3", start = %S, size = __OVERLAYSIZE__;
OVL4: file = "%O.4", start = %S, size = __OVERLAYSIZE__;
OVL5: file = "%O.5", start = %S, size = __OVERLAYSIZE__;
OVL6: file = "%O.6", start = %S, size = __OVERLAYSIZE__;
OVL7: file = "%O.7", start = %S, size = __OVERLAYSIZE__;
OVL8: file = "%O.8", start = %S, size = __OVERLAYSIZE__;
OVL9: file = "%O.9", start = %S, size = __OVERLAYSIZE__;
}
SEGMENTS {
EXEHDR: load = HEADER, type = ro;
STARTUP: load = RAM, type = ro, define = yes;
LOWCODE: load = RAM, type = ro, define = yes, optional = yes;
INIT: load = RAM, type = ro, optional = yes;
CODE: load = RAM, type = ro, define = yes;
RODATA: load = RAM, type = ro;
DATA: load = RAM, type = rw;
ZPSAVE: load = RAM, type = bss, define = yes;
BSS: load = RAM, type = bss, define = yes;
ZEROPAGE: load = ZP, type = zp;
EXTZP: load = ZP, type = zp, optional = yes;
AUTOSTRT: load = TRAILER, type = ro;
OVERLAY1: load = OVL1, type = ro, define = yes, optional = yes;
OVERLAY2: load = OVL2, type = ro, define = yes, optional = yes;
OVERLAY3: load = OVL3, type = ro, define = yes, optional = yes;
OVERLAY4: load = OVL4, type = ro, define = yes, optional = yes;
OVERLAY5: load = OVL5, type = ro, define = yes, optional = yes;
OVERLAY6: load = OVL6, type = ro, define = yes, optional = yes;
OVERLAY7: load = OVL7, type = ro, define = yes, optional = yes;
OVERLAY8: load = OVL8, type = ro, define = yes, optional = yes;
OVERLAY9: load = OVL9, type = ro, define = yes, optional = yes;
}
FEATURES {
CONDES: type = constructor,
label = __CONSTRUCTOR_TABLE__,
count = __CONSTRUCTOR_COUNT__,
segment = INIT;
CONDES: type = destructor,
label = __DESTRUCTOR_TABLE__,
count = __DESTRUCTOR_COUNT__,
segment = RODATA;
CONDES: type = interruptor,
label = __INTERRUPTOR_TABLE__,
count = __INTERRUPTOR_COUNT__,
segment = RODATA,
import = __CALLIRQ__;
}

42
cfg/atarixl.cfg Normal file
View File

@@ -0,0 +1,42 @@
FEATURES {
STARTADDRESS: default = $2E00;
}
SYMBOLS {
__STACKSIZE__: type = weak, value = $0800; # 2k stack
__RESERVED_MEMORY__: type = weak, value = $0000;
}
MEMORY {
ZP: file = "", define = yes, start = $0082, size = $007E;
HEADER: file = %O, start = $0000, size = $0006;
RAM: file = %O, start = %S, size = $BC20 - __STACKSIZE__ - %S;
TRAILER: file = %O, start = $0000, size = $0006;
}
SEGMENTS {
EXEHDR: load = HEADER, type = ro;
STARTUP: load = RAM, type = ro, define = yes;
LOWCODE: load = RAM, type = ro, define = yes, optional = yes;
INIT: load = RAM, type = ro, optional = yes;
CODE: load = RAM, type = ro, define = yes;
RODATA: load = RAM, type = ro;
DATA: load = RAM, type = rw;
ZPSAVE: load = RAM, type = bss, define = yes;
BSS: load = RAM, type = bss, define = yes;
ZEROPAGE: load = ZP, type = zp;
EXTZP: load = ZP, type = zp, optional = yes;
AUTOSTRT: load = TRAILER, type = ro;
}
FEATURES {
CONDES: type = constructor,
label = __CONSTRUCTOR_TABLE__,
count = __CONSTRUCTOR_COUNT__,
segment = INIT;
CONDES: type = destructor,
label = __DESTRUCTOR_TABLE__,
count = __DESTRUCTOR_COUNT__,
segment = RODATA;
CONDES: type = interruptor,
label = __INTERRUPTOR_TABLE__,
count = __INTERRUPTOR_COUNT__,
segment = RODATA,
import = __CALLIRQ__;
}

View File

@@ -38,7 +38,7 @@
/* Check for errors */ /* Check for errors */
#if !defined(__ATARI__) #if !defined(__ATARI__) && !defined(__ATARIXL__)
# error This module may only be used when compiling for the Atari! # error This module may only be used when compiling for the Atari!
#endif #endif

View File

@@ -63,7 +63,7 @@
# include <apple2.h> # include <apple2.h>
#elif defined(__APPLE2ENH__) #elif defined(__APPLE2ENH__)
# include <apple2enh.h> # include <apple2enh.h>
#elif defined(__ATARI__) #elif defined(__ATARI__) || defined(__ATARIXL__)
# include <atari.h> # include <atari.h>
#elif defined(__ATMOS__) #elif defined(__ATMOS__)
# include <atmos.h> # include <atmos.h>

View File

@@ -78,7 +78,7 @@ struct dirent {
#define _DE_ISLBL(t) (0) #define _DE_ISLBL(t) (0)
#define _DE_ISLNK(t) (0) #define _DE_ISLNK(t) (0)
#elif defined(__ATARI__) #elif defined(__ATARI__) || defined(__ATARIXL__)
struct dirent { struct dirent {
char d_name[13]; /* 8.3 + trailing 0 */ char d_name[13]; /* 8.3 + trailing 0 */

View File

@@ -71,7 +71,7 @@ extern FILE* stderr;
/* Standard defines that are platform dependent */ /* Standard defines that are platform dependent */
#if defined(__APPLE2__) || defined(__APPLE2ENH__) #if defined(__APPLE2__) || defined(__APPLE2ENH__)
# define FILENAME_MAX (64+1) # define FILENAME_MAX (64+1)
#elif defined(__ATARI__) #elif defined(__ATARI__) || defined(__ATARIXL__)
# define FILENAME_MAX (12+1) # define FILENAME_MAX (12+1)
#elif defined(__LUNIX__) #elif defined(__LUNIX__)
# define FILENAME_MAX (80+1) # define FILENAME_MAX (80+1)

View File

@@ -76,7 +76,7 @@ extern struct _timezone {
#if defined(__ATARI__) #if defined(__ATARI__) || defined(__ATARIXL__)
/* The clock depends on the video standard, so read it at runtime */ /* The clock depends on the video standard, so read it at runtime */
unsigned _clocks_per_sec (void); unsigned _clocks_per_sec (void);
# define CLK_TCK _clocks_per_sec() # define CLK_TCK _clocks_per_sec()

View File

@@ -13,6 +13,7 @@ GEOS = geos-apple \
TARGETS = apple2 \ TARGETS = apple2 \
apple2enh \ apple2enh \
atari \ atari \
atarixl \
atmos \ atmos \
$(CBMS) \ $(CBMS) \
$(GEOS) \ $(GEOS) \
@@ -93,9 +94,13 @@ GEOSDIRS = common \
system system
ifeq ($(TARGET),apple2enh) ifeq ($(TARGET),apple2enh)
SRCDIR = apple2
OBJPFX = a2 OBJPFX = a2
DRVPFX = a2e DRVPFX = a2e
SRCDIR = apple2 else ifeq ($(TARGET),atarixl)
SRCDIR = atari
OBJPFX = atr
DRVPFX = atrx
else ifeq ($(TARGET),sim65c02) else ifeq ($(TARGET),sim65c02)
SRCDIR = sim6502 SRCDIR = sim6502
else else

View File

@@ -93,7 +93,7 @@ static char GetKeyUpdate (void);
# define MAX_X 80 # define MAX_X 80
# define MAX_Y 25 # define MAX_Y 25
# define DUMP_BYTES 16 # define DUMP_BYTES 16
#elif defined(__APPLE2__) || defined(__APPLE2ENH__) || defined(__ATARI__) #elif defined(__APPLE2__) || defined(__APPLE2ENH__) || defined(__ATARI__) || defined(__ATARIXL__)
# define MAX_X 40 # define MAX_X 40
# define MAX_Y 24 # define MAX_Y 24
# define DUMP_BYTES 8 # define DUMP_BYTES 8

View File

@@ -208,6 +208,10 @@ static void SetSys (const char* Sys)
NewSymbol ("__ATARI__", 1); NewSymbol ("__ATARI__", 1);
break; break;
case TGT_ATARIXL:
NewSymbol ("__ATARIXL__", 1);
break;
case TGT_C16: case TGT_C16:
CBMSystem ("__C16__"); CBMSystem ("__C16__");
break; break;

View File

@@ -164,6 +164,10 @@ static void SetSys (const char* Sys)
DefineNumericMacro ("__ATARI__", 1); DefineNumericMacro ("__ATARI__", 1);
break; break;
case TGT_ATARIXL:
DefineNumericMacro ("__ATARIXL__", 1);
break;
case TGT_C16: case TGT_C16:
cbmsys ("__C16__"); cbmsys ("__C16__");
break; break;

View File

@@ -125,6 +125,7 @@ static const TargetEntry TargetMap[] = {
{ "apple2", TGT_APPLE2 }, { "apple2", TGT_APPLE2 },
{ "apple2enh", TGT_APPLE2ENH }, { "apple2enh", TGT_APPLE2ENH },
{ "atari", TGT_ATARI }, { "atari", TGT_ATARI },
{ "atarixl", TGT_ATARIXL },
{ "atmos", TGT_ATMOS }, { "atmos", TGT_ATMOS },
{ "bbc", TGT_BBC }, { "bbc", TGT_BBC },
{ "c128", TGT_C128 }, { "c128", TGT_C128 },
@@ -156,6 +157,7 @@ static const TargetProperties PropertyTable[TGT_COUNT] = {
{ "none", CPU_6502, BINFMT_BINARY, CTNone }, { "none", CPU_6502, BINFMT_BINARY, CTNone },
{ "module", CPU_6502, BINFMT_O65, CTNone }, { "module", CPU_6502, BINFMT_O65, CTNone },
{ "atari", CPU_6502, BINFMT_BINARY, CTAtari }, { "atari", CPU_6502, BINFMT_BINARY, CTAtari },
{ "atarixl", CPU_6502, BINFMT_BINARY, CTAtari },
{ "vic20", CPU_6502, BINFMT_BINARY, CTPET }, { "vic20", CPU_6502, BINFMT_BINARY, CTPET },
{ "c16", CPU_6502, BINFMT_BINARY, CTPET }, { "c16", CPU_6502, BINFMT_BINARY, CTPET },
{ "c64", CPU_6502, BINFMT_BINARY, CTPET }, { "c64", CPU_6502, BINFMT_BINARY, CTPET },

View File

@@ -55,6 +55,7 @@ typedef enum {
TGT_NONE, TGT_NONE,
TGT_MODULE, TGT_MODULE,
TGT_ATARI, TGT_ATARI,
TGT_ATARIXL,
TGT_VIC20, TGT_VIC20,
TGT_C16, TGT_C16,
TGT_C64, TGT_C64,

View File

@@ -16,11 +16,8 @@ int main(void)
printf("clocks per second: %d\n", CLOCKS_PER_SEC); printf("clocks per second: %d\n", CLOCKS_PER_SEC);
printf("current clock: %ld\n", clock()); printf("current clock: %ld\n", clock());
#ifdef __ATARI__
/* Atari DOS 2.x clears the screen after program termination, so wait... */
printf("hit <return> to exit..."); printf("hit <return> to exit...");
cgetc(); cgetc();
#endif
printf("\n"); printf("\n");
return(0); return(0);
} }

View File

@@ -31,10 +31,8 @@ int main(void) {
test(-40, -3); test(-40, -3);
if (t) if (t)
printf("\nThe div() function made a wrong result!\n"); printf("\nThe div() function made a wrong result!\n");
#ifdef __ATARI__
/* Atari DOS 2 clears the screen after program-termination, so wait. */
printf("\nTap a key, to exit. "); printf("\nTap a key, to exit. ");
getchar(); getchar();
#endif
return (int)t; return (int)t;
} }

View File

@@ -24,7 +24,8 @@
extern int getsp(void); /* is provided in getsp.s */ extern int getsp(void); /* is provided in getsp.s */
#ifdef __ATARI__ /* Atari's fd indirection table */ /* Atari's fd indirection table */
#if defined(__ATARI__) || defined(__ATARIXL__)
extern char __fd_index[]; extern char __fd_index[];
struct fd_t { struct fd_t {
char usage; char usage;
@@ -33,7 +34,7 @@ struct fd_t {
char flag; char flag;
}; };
extern struct fd_t __fd_table[]; extern struct fd_t __fd_table[];
#endif /* #ifdef __ATARI__ */ #endif
int main(int argc,char **argv) int main(int argc,char **argv)
{ {
@@ -73,7 +74,7 @@ int main(int argc,char **argv)
return(0); return(0);
} }
printf("open success -- handle = $%x, sp = %d\n",fd,csp); printf("open success -- handle = $%x, sp = %d\n",fd,csp);
#ifdef __ATARI__ #if defined(__ATARI__) || defined(__ATARIXL__)
printf("fd_index:\n "); printf("fd_index:\n ");
for (i=0; i<12; i++) printf("%02X ",__fd_index[i]); for (i=0; i<12; i++) printf("%02X ",__fd_index[i]);
printf("\nfd_table:\n"); printf("\nfd_table:\n");
@@ -83,7 +84,7 @@ int main(int argc,char **argv)
__fd_table[i].iocb, __fd_table[i].iocb,
__fd_table[i].dev); __fd_table[i].dev);
} }
#endif /* #ifdef __ATARI__ */ #endif
lr = read(fd,buf,16); /* read first 16 bytes */ lr = read(fd,buf,16); /* read first 16 bytes */
csp = getsp(); csp = getsp();
if (lr == -1) { if (lr == -1) {

View File

@@ -18,7 +18,7 @@ static const unsigned char small_bar[8] = {
' ', 0xa5, 0xb4, 0xb5, 0xa1, 0xb6, 0xaa, 0xa7 ' ', 0xa5, 0xb4, 0xb5, 0xa1, 0xb6, 0xaa, 0xa7
}; };
#elif defined(__ATARI__) #elif defined(__ATARI__) || defined(__ATARIXL__)
#endif #endif
/* Screen co-ordinates for the progress meter */ /* Screen co-ordinates for the progress meter */
@@ -39,7 +39,7 @@ static void ProgressMeter (unsigned Val)
revers (revers_bar[Val]); revers (revers_bar[Val]);
cputc (small_bar[Val]); cputc (small_bar[Val]);
#elif defined(__ATARI__) #elif defined(__ATARI__) || defined(__ATARIXL__)
#endif #endif
revers (0); revers (0);
@@ -162,12 +162,8 @@ Done:
" %u.%03u seconds.\n", Days, Hours, Minu, Sec, Milli); " %u.%03u seconds.\n", Days, Hours, Minu, Sec, Milli);
#endif #endif
#ifdef __ATARI__ cprintf ("\rTap a key, to exit. ");
if (_dos_type != SPARTADOS && _dos_type != OSADOS) { cgetc();
cprintf ("\rTap a key, to exit. ");
cgetc();
}
#endif
return 0; return 0;
} }

View File

@@ -1,10 +1,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#ifdef __ATARI__
#include <atari.h>
#include <conio.h> #include <conio.h>
#endif
static int do_test(const char *s1, const char *s2, size_t n) static int do_test(const char *s1, const char *s2, size_t n)
{ {
@@ -70,11 +67,6 @@ int main(void)
else else
printf("OK (%d)\n", ret); printf("OK (%d)\n", ret);
#ifdef __ATARI__ cgetc();
if (_dos_type != 1) {
cgetc();
}
#endif
return 0; return 0;
} }