1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-26 05:29:30 +00:00

Changes to existing cc65 source to support Synertek Systems Sym-1

This commit is contained in:
Wayne Parham 2021-05-09 16:51:17 -05:00
parent 6e79379405
commit 044a0838a3
6 changed files with 64 additions and 22 deletions

View File

@ -36,6 +36,7 @@ including
- the Lynx console. - the Lynx console.
- the Ohio Scientific Challenger 1P. - the Ohio Scientific Challenger 1P.
- the Commander X16. - the Commander X16.
- the Synertek Syetms Sym-1.
The libraries are fairly portable, so creating a version for other 6502s The libraries are fairly portable, so creating a version for other 6502s
shouldn't be too much work. shouldn't be too much work.

View File

@ -34,6 +34,7 @@ TARGETS = apple2 \
sim6502 \ sim6502 \
sim65c02 \ sim65c02 \
supervision \ supervision \
sym1 \
telestrat telestrat
DRVTYPES = emd \ DRVTYPES = emd \
@ -148,18 +149,26 @@ GEOSDIRS = common \
runtime \ runtime \
system system
# MACHINE set independently of TARGET lets us easily define new targets
# without changing target.h and target.c in cc65/src/common. Useful
# for initial testing of ports to new systems.
ifeq ($(TARGET),apple2enh) ifeq ($(TARGET),apple2enh)
SRCDIR = apple2 SRCDIR = apple2
OBJPFX = a2 OBJPFX = a2
DRVPFX = a2e DRVPFX = a2e
MACHINE = $(TARGET)
else ifeq ($(TARGET),atarixl) else ifeq ($(TARGET),atarixl)
SRCDIR = atari SRCDIR = atari
OBJPFX = atr OBJPFX = atr
DRVPFX = atrx DRVPFX = atrx
MACHINE = $(TARGET)
else ifeq ($(TARGET),sim65c02) else ifeq ($(TARGET),sim65c02)
SRCDIR = sim6502 SRCDIR = sim6502
MACHINE = $(TARGET)
else else
SRCDIR = $(TARGET) SRCDIR = $(TARGET)
MACHINE = $(TARGET)
endif endif
SRCDIRS = $(SRCDIR) SRCDIRS = $(SRCDIR)
@ -173,16 +182,26 @@ ifeq ($(TARGET),$(filter $(TARGET),$(GEOS)))
SRCDIRS += $(addprefix geos-common/,$(GEOSDIRS)) SRCDIRS += $(addprefix geos-common/,$(GEOSDIRS))
endif endif
SRCDIRS += common \ ifeq ($(TARGET),sym1)
conio \ SRCDIRS += common \
dbg \ conio \
em \ dbg \
joystick \ em \
mouse \ runtime \
runtime \ serial \
serial \ sym1
tgi \ else
zlib SRCDIRS += common \
conio \
dbg \
em \
joystick \
mouse \
runtime \
serial \
tgi \
zlib
endif
vpath %.s $(SRCDIRS) vpath %.s $(SRCDIRS)
vpath %.c $(SRCDIRS) vpath %.c $(SRCDIRS)
@ -231,7 +250,7 @@ $1_DRVS = $$(patsubst $$($1_DYNPAT),$$($1_DRVPAT),$$($1_DYNS))
$$($1_STCPAT): $$($1_SRCPAT) $$($1_STCPAT): $$($1_SRCPAT)
@echo $$(TARGET) - $$< - static @echo $$(TARGET) - $$< - static
@$$(CA65) -t $$(TARGET) -D DYN_DRV=0 $$(CA65FLAGS) --create-dep $$(@:.o=.d) -o $$@ $$< @$$(CA65) -t $$(MACHINE) -D DYN_DRV=0 $$(CA65FLAGS) --create-dep $$(@:.o=.d) -o $$@ $$<
OBJS += $$($1_STCS) OBJS += $$($1_STCS)
DEPS += $$($1_STCS:.o=.d) DEPS += $$($1_STCS:.o=.d)
@ -263,15 +282,15 @@ export CC65_HOME := $(abspath ..)
define ASSEMBLE_recipe define ASSEMBLE_recipe
$(if $(QUIET),,@echo $(TARGET) - $<) $(if $(QUIET),,@echo $(TARGET) - $<)
@$(CA65) -t $(TARGET) $(CA65FLAGS) --create-dep $(@:.o=.d) -o $@ $< @$(CA65) -t $(MACHINE) $(CA65FLAGS) --create-dep $(@:.o=.d) -o $@ $<
endef # ASSEMBLE_recipe endef # ASSEMBLE_recipe
define COMPILE_recipe define COMPILE_recipe
$(if $(QUIET),,@echo $(TARGET) - $<) $(if $(QUIET),,@echo $(TARGET) - $<)
@$(CC65) -t $(TARGET) $(CC65FLAGS) --create-dep $(@:.o=.d) --dep-target $@ -o $(@:.o=.s) $< @$(CC65) -t $(MACHINE) $(CC65FLAGS) --create-dep $(@:.o=.d) --dep-target $@ -o $(@:.o=.s) $<
@$(CA65) -t $(TARGET) -o $@ $(@:.o=.s) @$(CA65) -t $(MACHINE) -o $@ $(@:.o=.s)
endef # COMPILE_recipe endef # COMPILE_recipe
@ -283,7 +302,7 @@ endef # COMPILE_recipe
$(EXTRA_OBJPAT): $(EXTRA_SRCPAT) | ../libwrk/$(TARGET) ../lib $(EXTRA_OBJPAT): $(EXTRA_SRCPAT) | ../libwrk/$(TARGET) ../lib
@echo $(TARGET) - $(<F) @echo $(TARGET) - $(<F)
@$(CA65) -t $(TARGET) $(CA65FLAGS) --create-dep $(@:../lib/%.o=../libwrk/$(TARGET)/%.d) -o $@ $< @$(CA65) -t $(MACHINE) $(CA65FLAGS) --create-dep $(@:../lib/%.o=../libwrk/$(TARGET)/%.d) -o $@ $<
../lib/$(TARGET).lib: $(OBJS) | ../lib ../lib/$(TARGET).lib: $(OBJS) | ../lib
$(AR65) a $@ $? $(AR65) a $@ $?

View File

@ -135,31 +135,37 @@ LDFLAGS_tgidemo_atarixl = --start-addr 0x4000
%: %.s %: %.s
.c.o: .c.o:
$(CC) $(CFLAGS) -Ors --codesize 500 -T -g -t $(SYS) $< $(CC) $(CFLAGS) -Ors --codesize 500 -T -g -t $(MACHINE) $<
$(AS) $(<:.c=.s) $(AS) $(<:.c=.s)
.s.o: .s.o:
$(AS) $(ASFLAGS) -t $(SYS) $< $(AS) $(ASFLAGS) -t $(MACHINE) $<
.PRECIOUS: %.o .PRECIOUS: %.o
.o: .o:
ifeq ($(SYS),vic20) ifeq ($(SYS),vic20)
$(LD) $(LDFLAGS_$(@F)_$(SYS)) $(LDFLAGS) -o $@ -C vic20-32k.cfg -m $@.map $^ $(SYS).lib $(LD) $(LDFLAGS_$(@F)_$(SYS)) $(LDFLAGS) -o $@ -C vic20-32k.cfg -m $@.map $^ $(SYS).lib
else ifeq ($(SYS),sym1)
$(LD) $(LDFLAGS_$(@F)_$(SYS)) $(LDFLAGS) -o $@.bin -C sym1.cfg -m $@.map $^ $(SYS).lib
else else
$(LD) $(LDFLAGS_$(@F)_$(SYS)) $(LDFLAGS) -o $@ -t $(SYS) -m $@.map $^ $(SYS).lib $(LD) $(LDFLAGS_$(@F)_$(SYS)) $(LDFLAGS) -o $@ -t $(MACHINE) -m $@.map $^ $(SYS).lib
endif endif
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
# Lists of subdirectories # Lists of subdirectories
# disasm depends on cpp # disasm depends on cpp
DIRLIST = tutorial geos
ifneq ($(SYS),sym1)
DIRLIST = tutorial geos
endif
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
# Lists of executables # Lists of executables
EXELIST_c64 = \ EXELIST_c64 = \
helloworld \
ascii \ ascii \
enumdevdir \ enumdevdir \
fire \ fire \
@ -175,6 +181,7 @@ EXELIST_c64 = \
tgidemo tgidemo
EXELIST_apple2 = \ EXELIST_apple2 = \
helloworld \
ascii \ ascii \
diodemo \ diodemo \
enumdevdir \ enumdevdir \
@ -190,6 +197,7 @@ EXELIST_apple2 = \
EXELIST_apple2enh = $(EXELIST_apple2) EXELIST_apple2enh = $(EXELIST_apple2)
EXELIST_atari = \ EXELIST_atari = \
helloworld \
ascii \ ascii \
gunzip65 \ gunzip65 \
hello \ hello \
@ -208,6 +216,12 @@ EXELIST_atari2600 = \
EXELIST_supervision = \ EXELIST_supervision = \
supervisionhello supervisionhello
EXELIST_sym1 = \
helloworld \
symHello \
symTiny \
symDisplay
# Unlisted targets will try to build everything. # Unlisted targets will try to build everything.
# That lets us learn what they cannot build, and what settings # That lets us learn what they cannot build, and what settings
# we need to use for programs that can be built and run. # we need to use for programs that can be built and run.
@ -215,12 +229,13 @@ ifndef EXELIST_$(SYS)
EXELIST_$(SYS) := ${patsubst %.c,%,$(wildcard *.c)} EXELIST_$(SYS) := ${patsubst %.c,%,$(wildcard *.c)}
endif endif
define SUBDIR_recipe define SUBDIR_recipe
@$(MAKE) -C $(dir) --no-print-directory $@ @$(MAKE) -C $(dir) --no-print-directory $@
endef # SUBDIR_recipe endef # SUBDIR_recipe
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
# Rules to make the binaries and the disk # Rules to make the binaries and the disk
@ -352,9 +367,10 @@ zip:
# Clean-up rules # Clean-up rules
mostlyclean: mostlyclean:
@$(DEL) *.lbl *.map *.o *.s 2>$(NULLDEV) @$(DEL) *.lbl *.map *.bin *.hex *.o *.s 2>$(NULLDEV)
clean: mostlyclean clean: mostlyclean
@$(DEL) $(EXELIST_$(SYS)) $(DISK_$(SYS)) 2>$(NULLDEV) @$(DEL) $(EXELIST_$(SYS)) $(DISK_$(SYS)) 2>$(NULLDEV)
@$(DEL) multdemo.? ovrldemo.? 2>$(NULLDEV) @$(DEL) multdemo.? ovrldemo.? 2>$(NULLDEV)
$(foreach dir,$(DIRLIST),$(SUBDIR_recipe)) @$(foreach dir,$(DIRLIST),$(SUBDIR_recipe))

View File

@ -290,6 +290,9 @@ static void SetSys (const char* Sys)
cbmsys ("__CX16__"); cbmsys ("__CX16__");
break; break;
case TGT_NONE:
break;
default: default:
AbEnd ("Unknown target system type %d", Target); AbEnd ("Unknown target system type %d", Target);
} }

View File

@ -174,6 +174,7 @@ static const TargetEntry TargetMap[] = {
{ "sim6502", TGT_SIM6502 }, { "sim6502", TGT_SIM6502 },
{ "sim65c02", TGT_SIM65C02 }, { "sim65c02", TGT_SIM65C02 },
{ "supervision", TGT_SUPERVISION }, { "supervision", TGT_SUPERVISION },
{ "sym1", TGT_SYM1 },
{ "telestrat", TGT_TELESTRAT }, { "telestrat", TGT_TELESTRAT },
{ "vic20", TGT_VIC20 }, { "vic20", TGT_VIC20 },
}; };
@ -215,6 +216,7 @@ static const TargetProperties PropertyTable[TGT_COUNT] = {
{ "gamate", CPU_6502, BINFMT_BINARY, CTNone }, { "gamate", CPU_6502, BINFMT_BINARY, CTNone },
{ "c65", CPU_4510, BINFMT_BINARY, CTPET }, { "c65", CPU_4510, BINFMT_BINARY, CTPET },
{ "cx16", CPU_65C02, BINFMT_BINARY, CTPET }, { "cx16", CPU_65C02, BINFMT_BINARY, CTPET },
{ "sym1", CPU_6502, BINFMT_BINARY, CTNone },
}; };
/* Target system */ /* Target system */

View File

@ -85,6 +85,7 @@ typedef enum {
TGT_GAMATE, TGT_GAMATE,
TGT_C65, TGT_C65,
TGT_CX16, TGT_CX16,
TGT_SYM1,
TGT_COUNT /* Number of target systems */ TGT_COUNT /* Number of target systems */
} target_t; } target_t;