Skip to content

Commit 3766cbc

Browse files
committed
Atari Version added
Added the Atari platform (tested on 48K Atari 800 - NTSC artifacting used for color)
1 parent 5233ed0 commit 3766cbc

File tree

9 files changed

+1478
-18
lines changed

9 files changed

+1478
-18
lines changed

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
# Space or comma separated list of cc65 supported target platforms to build for.
1111
# Default: c64 (lowercase!)
12-
TARGETS := apple2 atmos c64 c64.chr cx16
12+
TARGETS := apple2 atari atmos c64 c64.chr cx16
1313

1414
# Name of the final, single-file executable.
1515
# Default: name of the current dir with target name appended
@@ -67,6 +67,7 @@ VICE_HOME :=
6767
CX16_HOME :=
6868
AWIN_HOME :=
6969
ORIC_HOME :=
70+
ATARI_HOME :=
7071

7172
# Options state file name. You should not need to change this, but for those
7273
# rare cases when you feel you really need to name it differently - here you are
@@ -157,7 +158,7 @@ plus4_EMUCMD := $(VICE_HOME)xplus4 -TEDdsize -autoload
157158
c16_EMUCMD := $(VICE_HOME)xplus4 -ramsize 16 -TEDdsize -autoload
158159
cbm510_EMUCMD := $(VICE_HOME)xcbm2 -model 510 -VICIIdsize -autoload
159160
cbm610_EMUCMD := $(VICE_HOME)xcbm2 -model 610 -Crtcdsize -autoload
160-
atari_EMUCMD := atari800 -windowed -xl -pal -nopatchall -run
161+
atari_EMUCMD := $(ATARI_HOME)Altirra64 /defprofile:800 /disk cc65-Chess.atr
161162
cx16_EMUCMD := $(CX16_HOME)x16emu -run -prg
162163
apple2_EMUCMD := $(AWIN_HOME)AppleWin.exe -d1
163164
atmos_EMUCMD := $(ORIC_HOME)Oricutron.exe -t

Makefile-atr.mk

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# If ATARIDOS is commented out, the disk will be MyPicodos 4.05
2+
# if ATARIDOS is not commented out, set ATARIDOSTYPE to the
3+
# desired type (say Dos25 for Dos 2.5) and put the
4+
# sys files for the correct version in the ataridos folder
5+
# (i.e. dos.sys and dup.sys). Only tested with Dos25 and MyPicodos
6+
7+
ATR = cc65-Chess.atr
8+
# ATARIDOS = ataridos
9+
ATARIDOSTYPE = Dos25
10+
ATARIDSK = atari.atr
11+
DIR2ATR ?= dir2atr.exe
12+
13+
# Unix or Windows
14+
ifeq ($(shell echo),)
15+
CP = cp $1
16+
else
17+
CP = copy $(subst /,\,$1)
18+
endif
19+
20+
# Just the files, not the atari.atr folder. Don't know how to extend the zap: in the Makefile
21+
REMOVES += $(ATR) $(ATARIDSK)/cc65-Chess $(ATRDOSOBJS)
22+
23+
.PHONY: ATR
24+
atr: $(ATR)
25+
26+
$(ATARIDSK):
27+
$(call MKDIR,$@)
28+
29+
$(ATARIDSK)/%.sys:
30+
$(call CP,$(ATARIDOS)/$(notdir $(@)) $@)
31+
32+
# Different based on ATARIDOS or MyPicoDos
33+
ifeq ($(ATARIDOS),)
34+
ATARIDOSTYPE = MyPicoDOS405
35+
ATRDOSOBJS :=
36+
else
37+
# I don't know of a better way to "copy if needed" the .sys files from one folder to another
38+
ATRDOSSRCS += $(wildcard $(ATARIDOS)/*.sys)
39+
ATRDOSOBJS := $(addsuffix .sys,$(basename $(addprefix $(ATARIDSK)/,$(notdir $(ATRDOSSRCS)))))
40+
endif
41+
42+
$(ATR): cc65-Chess.atari $(ATARIDSK) $(ATRDOSOBJS)
43+
$(call CP,$< $(ATARIDSK)/cc65-Chess)
44+
$(DIR2ATR) -b $(ATARIDOSTYPE) cc65-Chess.atr $(ATARIDSK)

readme.txt

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
0. Updates
22

3+
* Jul 2020 - Added a version for the Atari.
34
* May 2020 - Advanced Build instructions at XI.
45
* May 2020 - I created a version for the Commander X16 (R37).
56
* May 2020 - I created a graphics version for the C64.
@@ -257,9 +258,11 @@ XI. Build Instructions
257258

258259
All of the 8-Bit versions of cc65 Chess can be built using make.
259260

260-
I recommend the game be built for speed, which also results in smaller file and
261-
is essential for all targets. This is done by using the OPTIONS=optspeed
262-
command line to make. See examples below.
261+
I recommend the game be built for speed on almost all targets, which also
262+
results in smaller file and is essential for all targets. This is done by
263+
using the OPTIONS=optspeed command line to make. For the Atari, it is
264+
essential to use OPTIONS=optsize as the 48K Atari really needs the extra
265+
1K of memory.
263266

264267
When you type make (using GNU Make) the default behaviour is to make all of the
265268
versions. Currently, that means the following (cc65 target name in brackets):
@@ -269,50 +272,54 @@ versions. Currently, that means the following (cc65 target name in brackets):
269272
* Apple 2 (apple2)
270273
* Oric-1/Atmos/Telestrat (atmos)
271274
* Commander X16 (cx16)
275+
* Atari (atari - Needs at least 48K, tested on Atari 800 48K)
272276

273277
Most platforms have an additional step that can be performed, which is to make a
274-
program (prg), disk (dsk) or tape (tap) file. Do make again, but with dsk
275-
(Apple 2 dsk), tap (Oric tape), prg (C64 prg), cprg (c64.chr prg) or cxprg (cX16
276-
prg) on the command line.
278+
program (prg), disk (dsk, atr) or tape (tap) file. Do make again, but with dsk
279+
(Apple 2 dsk), atr (Atari disk), tap (Oric tape), prg (C64 prg), cprg (c64.chr
280+
prg) or cxprg (cX16 prg) on the command line.
277281

278282
The two steps can be combined into a single make command, by using "all" as the
279283
first target, i.e:
280-
make OPTIONS=optspeed all dsk tap prg cprg cxprg
284+
make OPTIONS=optsize all dsk atr tap prg cprg cxprg
281285

282-
Makeing a terminal version (using curses) - See IV (b) above.
286+
Making a terminal version (using curses) - See IV (b) above.
283287

284288
Examples:
285-
1) Make everything, and then make the dsk and tap files for the Apple and Oric.
289+
1) Make everything, and then make the images for all platforms.
286290

287-
make OPTIONS=optspeed
291+
make OPTIONS=optsize
288292

289293
This will make the following files:
290294
cc65-Chess.apple2
295+
cc65-Chess.atari
291296
cc65-Chess.atmos
292297
cc65-Chess.c64
293298
cc65-Chess.c64.chr
294299
cc65-Chess.cx16
295300

296-
make dsk tap prg cprg cxprg
301+
make dsk atr tap prg cprg cxprg
297302

298303
This will make the following files:
299304
cc65-Chess.tap
305+
cc65-Chess.atr
300306
cc65-Chess.dsk
301307
cc65-Chess-c64.prg
302308
cc65-Chess-chr.prg
303309
cc65-Chess-cx16.prg
304310

305-
Once you have used the OPTIONS=optspeed on the command-line, you do not have to
306-
use it again since the options are saved in a file called Makefile.options.
311+
Once you have used the OPTIONS=optsize (or OPTIONS=optspeed) on the
312+
command-line, you do not have to use it again since the options are
313+
saved in a file called Makefile.options.
307314

308315
2) Build just one version (let's say the Oric)
309316

310-
make OPTIONS=optspeed TARGETS=atmos tap
317+
make OPTIONS=optsize TARGETS=atmos tap
311318
This will create a ready to run TAP file named cc65-Chess.tap
312319

313320
3) You can also start an emulator directly from make with the test command-line.
314321

315-
make OPTIONS=optspeed atmos test
322+
make OPTIONS=optsize atmos test
316323

317324
This last command example is a good way of callimg make to build and test any of
318325
the targets by itself, provided you have configured an emulator in the Makefile.
@@ -325,6 +332,6 @@ example, to run AppleWin I removed the $< from $(EMUCMD) $< in the test:
325332
section, because AppleWin did not like the extra (cc64-Chess.apple2) file being
326333
passed, and I had to give it the full path to cc64-Chess.dsk as part of apple2_EMUCMD.
327334

328-
Lastly - the CX16 and C64 versions use the same piece defenitions that Oliver
335+
Lastly - the Atari, CX16 and C64 versions use the same piece defenitions that Oliver
329336
Schmidt added for the Apple II, and kindly agreed to let me use for these
330337
versions as well. See genPieces.cpp in the specific src folder for more details.

src/atari/chessAtari.cfg

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
FEATURES {
2+
STARTADDRESS: default = $2000;
3+
}
4+
SYMBOLS {
5+
__EXEHDR__: type = import;
6+
__SYSTEM_CHECK__: type = import; # force inclusion of "system check" load chunk
7+
__AUTOSTART__: type = import; # force inclusion of autostart "trailer"
8+
__STACKSIZE__: type = weak, value = $0800; # 2k stack
9+
__STARTADDRESS__: type = export, value = %S;
10+
__RESERVED_MEMORY__: type = weak, value = $0000;
11+
}
12+
MEMORY {
13+
ZP: file = "", define = yes, start = $0082, size = $007E;
14+
15+
# file header, just $FFFF
16+
HEADER: file = %O, start = $0000, size = $0002;
17+
18+
# "system check" load chunk
19+
SYSCHKHDR: file = %O, start = $0000, size = $0004;
20+
SYSCHKCHNK: file = %O, start = $2E00, size = $0300;
21+
SYSCHKTRL: file = %O, start = $0000, size = $0006;
22+
23+
# "main program" load chunk
24+
MAINHDR: file = %O, start = $0000, size = $0004;
25+
MAIN: file = %O, define = yes, start = %S, size = $BC20 - __STACKSIZE__ - __RESERVED_MEMORY__ - %S;
26+
TRAILER: file = %O, start = $0000, size = $0006;
27+
}
28+
SEGMENTS {
29+
ZEROPAGE: load = ZP, type = zp;
30+
EXTZP: load = ZP, type = zp, optional = yes;
31+
EXEHDR: load = HEADER, type = ro;
32+
SYSCHKHDR: load = SYSCHKHDR, type = ro, optional = yes;
33+
SYSCHK: load = SYSCHKCHNK, type = rw, define = yes, optional = yes;
34+
SYSCHKTRL: load = SYSCHKTRL, type = ro, optional = yes;
35+
MAINHDR: load = MAINHDR, type = ro;
36+
STARTUP: load = MAIN, type = ro, define = yes;
37+
LOWBSS: load = MAIN, type = rw, optional = yes; # not zero initialized
38+
LOWCODE: load = MAIN, type = ro, define = yes, optional = yes;
39+
ONCE: load = MAIN, type = ro, optional = yes;
40+
CODE: load = MAIN, type = ro, define = yes;
41+
RODATA: load = MAIN, type = ro;
42+
DATA: load = MAIN, type = rw;
43+
DLIST: load = MAIN, type = rw, define = yes, optional = yes, align = $0100;
44+
INIT: load = MAIN, type = rw, optional = yes;
45+
BSS: load = MAIN, type = bss, define = yes;
46+
AUTOSTRT: load = TRAILER, type = ro;
47+
}
48+
FEATURES {
49+
CONDES: type = constructor,
50+
label = __CONSTRUCTOR_TABLE__,
51+
count = __CONSTRUCTOR_COUNT__,
52+
segment = ONCE;
53+
CONDES: type = destructor,
54+
label = __DESTRUCTOR_TABLE__,
55+
count = __DESTRUCTOR_COUNT__,
56+
segment = RODATA;
57+
CONDES: type = interruptor,
58+
label = __INTERRUPTOR_TABLE__,
59+
count = __INTERRUPTOR_COUNT__,
60+
segment = RODATA,
61+
import = __CALLIRQ__;
62+
}

0 commit comments

Comments
 (0)