Skip to content

Commit 834dd14

Browse files
committed
Initial github checkin of CCGMS Term 5.5, 6502 assembly source code
for Commodore Color Graphics Manipulaton System Terminal, modified to build with the cc65/ca65 cross assembler.
1 parent face057 commit 834dd14

12 files changed

+7134
-1
lines changed

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
original/* binary

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
*~
2+
*.o
3+
*.lst
4+
./*.d64
5+
obj
6+
ccgmsterm
7+
ccgmsterm5.5

Makefile

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
#
2+
# Makefile for CCGMS Term, resurrected from antiquity, September 2016
3+
# (C) Craig Smith, 2016
4+
# Permission is granted to modify and redistribute this software under
5+
# the terms of the GPL v3, see LICENSE for details.
6+
#
7+
# Building requires cc65 6502 cross-compiler package;
8+
# see http://cc65.github.io/cc65 or 'git clone https://github.com/cc65/cc65.git'
9+
# to build yourself.
10+
# Optionally creating a .d64 image of the resulting C64 prg requires the c1541
11+
# utility from VICE in your path.
12+
13+
OUTPUT_PRG = ccgmsterm
14+
D64IMAGE = ccgmsterm.d64
15+
SRC = ccgmsterm.s
16+
17+
LSTF = $(SRC:.s=.lst)
18+
OBJF = $(SRC:.s=.o)
19+
20+
OBJDIR = obj
21+
OBJ = $(OBJF:%=$(OBJDIR)/%)
22+
LST = $(LSTF:%=$(OBJDIR)/%)
23+
24+
# Define HISTORICAL=1 below to re-enable script-kiddie protection
25+
# (and a baud rate bug), so the assembled output is exactly like
26+
# the historical CCGMS Term 5.5
27+
# Or just use the 'make history' rule [sorry :-)]
28+
#
29+
HISTORICAL?=0
30+
31+
ifneq (0,$(HISTORICAL))
32+
HISTARG = -Dhistorical=$(HISTORICAL)
33+
HISTENCODE = encode
34+
endif
35+
36+
all: term image
37+
echo $(OBJ)
38+
39+
term: $(OUTPUT_PRG) $(HISTENCODE)
40+
41+
$(OBJ): $(SRC) $(OBJDIR)
42+
ca65 $(HISTARG) -t c64 -l $(LST) $(SRC) -o $(OBJ)
43+
44+
$(OUTPUT_PRG): precheck $(OBJDIR) $(OBJ)
45+
cl65 $(HISTARG) -t c64 -C c64-asm.cfg $(OBJ) -o $(OUTPUT_PRG)
46+
@echo $(OUTPUT_PRG) created.
47+
48+
$(OBJDIR):
49+
@mkdir -p $(OBJDIR)
50+
51+
encode: $(OUTPUT_PRG)
52+
mv $(OUTPUT_PRG) $(OUTPUT_PRG).pre && \
53+
perl encode.pl $(OUTPUT_PRG).pre > $(OUTPUT_PRG) && \
54+
rm -f $(OUTPUT_PRG).pre
55+
56+
image: $(OUTPUT_PRG)
57+
@c1541 -h >/dev/null 2>&1 || (echo "c1541 not found in path; skipping creation of .d64 image." ; exit 0)
58+
@dd if=/dev/zero of=$(D64IMAGE) bs=256 count=683 >/dev/null 2>&1
59+
c1541 -attach $(D64IMAGE) -format "ccgmsterm 5.5,cg" -write $(OUTPUT_PRG) -list
60+
61+
history: # couldn't resist
62+
@make HISTORICAL=1 OUTPUT_PRG=ccgmsterm5.5 term image
63+
hclean:
64+
@make HISTORICAL=1 OUTPUT_PRG=ccgmsterm5.5 clean
65+
66+
clean:
67+
rm -f $(OBJ) $(LST) $(OUTPUT_PRG) $(D64IMAGE) ./*~
68+
@test -d $(OBJDIR) && rmdir $(OBJDIR) || exit 0
69+
70+
precheck:
71+
@cl65 >/dev/null 2>/dev/null || (echo "cl65 6502 assembler is not in path." && exit 1)
72+
@(cl65 -V 2>&1 | egrep 'V2\.1[56789]|V2\.[23456789]|V[3456789]\.') > /dev/null || (echo Requirement ca65 version 2.15 or later not found && cl65 -V && exit 1)
73+
74+
.PHONY: precheck encode history image
75+

README.md

+31-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,31 @@
1-
# ccgmsterm
1+
2+
**CCGMS Term _(6502 assembly source for Commodore 64)_**
3+
**Copyright (C) Craig Smith, 1986-1988, 2016**
4+
5+
*Resurrected and released to world September 5, 2016.
6+
Permission is granted to modify and distribute this work under
7+
the terms of the GNU General Public License, version 3.
8+
See LICENSE file for details.*
9+
10+
Version 5.5 (ported to build with ca65)
11+
12+
The file ccgmsterm.s contains combined source from the original SEQ files
13+
(named 5a.gs,5b.gs,5c.gs and 5d.gs) in CBM Assembler 64 format and chained
14+
together using .FIL directives because the entire source could not
15+
fit into a C64's memory using the CBM editor. The encoding of this
16+
file has been converted to ASCII (with lowercase labels), and strings
17+
containing the PETSCII left arrow character ($5F) have been changed
18+
to its numeric code so modern or cross-platform assemblers do not
19+
treat it as an underscore.
20+
21+
This source can be compiled using the ca65 portable 6502 compiler.
22+
Except for the conversion to ASCII and the addition of feature
23+
and conditional directives (.feature/.if/.endif), the format of
24+
this file remains compatible with CBM Assembler 64.
25+
(The .feature directives below enable this compatibility.)
26+
27+
*DEPENDENCIES*
28+
29+
You need ca65 (https://github.com/cc65/cc65.git) to build this,
30+
and the c1541 tool from the VICE emulator (http://vice-emu.sourceforge.net)
31+
to create a .d64 disk image out of it.

c64-asm.cfg

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FEATURES {
2+
STARTADDRESS: default = $0801;
3+
}
4+
SYMBOLS {
5+
__LOADADDR__: type = import;
6+
}
7+
MEMORY {
8+
ZP: file = "", start = $0002, size = $00FE, define = yes;
9+
LOADADDR: file = %O, start = %S - 2, size = $0002;
10+
MAIN: file = %O, start = %S, size = $D000 - %S;
11+
}
12+
SEGMENTS {
13+
ZEROPAGE: load = ZP, type = zp, optional = yes;
14+
LOADADDR: load = LOADADDR, type = ro;
15+
EXEHDR: load = MAIN, type = ro, optional = yes;
16+
CODE: load = MAIN, type = rw;
17+
RODATA: load = MAIN, type = ro, optional = yes;
18+
DATA: load = MAIN, type = rw, optional = yes;
19+
BSS: load = MAIN, type = bss, optional = yes, define = yes;
20+
}

0 commit comments

Comments
 (0)