$(MAKE) SYS=apple2 -C $$i || exit 1; \
$(AR) a apple2.lib $$i/*.o;\
done
- mv apple2/crt0.o apple2.o
cp apple2/apple2-auxmem.emd a2.auxmem.emd
cp apple2/apple2-stdjoy.joy a2.stdjoy.joy
cp apple2/apple2-stdmou.mou a2.stdmou.mou
$(MAKE) SYS=apple2enh -C $$i || exit 1; \
$(AR) a apple2enh.lib $$i/*.o;\
done
- mv apple2enh/crt0.o apple2enh.o
cp apple2enh/apple2-auxmem.emd a2e.auxmem.emd
cp apple2enh/apple2-stdjoy.joy a2e.stdjoy.joy
cp apple2enh/apple2-stdmou.mou a2e.stdmou.mou
$(MAKE) SYS=atari -C $$i || exit 1; \
$(AR) a atari.lib $$i/*.o;\
done
- mv atari/crt0.o atari.o
cp atari/atari-stdjoy.joy ataristd.joy
cp atari/atari-multijoy.joy atarimj8.joy
$(MAKE) SYS=atmos -C $$i || exit 1; \
$(AR) a atmos.lib $$i/*.o;\
done
- mv atmos/crt0.o atmos.o
cp atmos/*.tgi .
#-----------------------------------------------------------------------------
$(MAKE) SYS=c16 -C $$i || exit 1; \
$(AR) a c16.lib $$i/*.o;\
done
- mv c16/crt0.o c16.o
cp c16/*.joy .
cp c16/*.emd .
$(MAKE) SYS=c64 -C $$i || exit 1; \
$(AR) a c64.lib $$i/*.o;\
done
- mv c64/crt0.o c64.o
cp c64/*.emd .
cp c64/*.joy .
cp c64/c64-1351.mou .
$(MAKE) SYS=c128 -C $$i || exit 1; \
$(AR) a c128.lib $$i/*.o;\
done
- mv c128/crt0.o c128.o
cp c128/*.emd .
cp c128/*.joy .
cp c128/c128-1351.mou .
$(MAKE) SYS=cbm510 -C $$i || exit 1; \
$(AR) a cbm510.lib $$i/*.o;\
done
- mv cbm510/crt0.o cbm510.o
cp cbm510/*.emd .
cp cbm510/cbm510-stdjoy.joy cbm510-std.joy
cp cbm510/cbm510-stdser.ser cbm510-std.ser
$(MAKE) SYS=cbm610 -C $$i || exit 1; \
$(AR) a cbm610.lib $$i/*.o;\
done
- mv cbm610/crt0.o cbm610.o
cp cbm610/*.emd .
cp cbm610/cbm610-stdser.ser cbm610-std.ser
$(MAKE) SYS=lynx -C $$i || exit 1; \
$(AR) a lynx.lib $$i/*.o;\
done
- mv lynx/crt0.o lynx.o
cp lynx/*.joy .
cp lynx/*.tgi .
$(MAKE) SYS=nes -C $$i || exit 1; \
$(AR) a nes.lib $$i/*.o;\
done
- mv nes/crt0.o nes.o
cp nes/*.joy .
#-----------------------------------------------------------------------------
$(MAKE) SYS=pet -C $$i || exit 1; \
$(AR) a pet.lib $$i/*.o;\
done
- mv pet/crt0.o pet.o
cp pet/*.joy .
#-----------------------------------------------------------------------------
$(MAKE) SYS=plus4 -C $$i || exit 1; \
$(AR) a plus4.lib $$i/*.o;\
done
- mv plus4/crt0.o plus4.o
cp plus4/*.joy .
cp plus4/*.ser .
$(MAKE) SYS=supervision -C $$i || exit 1; \
$(AR) a supervision.lib $$i/*.o;\
done
- mv supervision/crt0.o supervision.o
#-----------------------------------------------------------------------------
# Vic20
$(MAKE) SYS=vic20 -C $$i || exit 1; \
$(AR) a vic20.lib $$i/*.o;\
done
- mv vic20/crt0.o vic20.o
cp vic20/*.joy .
#-----------------------------------------------------------------------------
;
; Startup code for cc65 (Apple2 version)
-;
-; This must be the *first* file on the linker command line
;
.export _exit
+ .export __STARTUP__ : absolute = 1 ; Mark as startup
.import zerobss
.import initlib, donelib
.import callmain, callirq
; Switch in LC bank 2 for W/O
bit $C081
bit $C081
-
+
; Set source start address
lda #<(__ZPSAVE_RUN__ + __INIT_SIZE__)
ldy #>(__ZPSAVE_RUN__ + __INIT_SIZE__)
sta $9B
sty $9C
-
+
; Set source last address
lda #<(__ZPSAVE_RUN__ + __INIT_SIZE__ + __LC_LAST__ - __LC_START__)
ldy #>(__ZPSAVE_RUN__ + __INIT_SIZE__ + __LC_LAST__ - __LC_START__)
ldy #>__ZPSAVE_RUN__
sta $9B
sty $9C
-
+
; Set source last address
lda #<(__ZPSAVE_RUN__ + __INIT_SIZE__)
ldy #>(__ZPSAVE_RUN__ + __INIT_SIZE__)
_exit: ldx #<exit
lda #>exit
jsr reset ; Setup RESET vector
-
+
; Switch in ROM in case it wasn't already switched in by a RESET
bit $C082
ldx #<_exit
lda #>_exit
jsr reset ; Setup RESET vector
-
+
; Setup the stack
lda HIMEM
sta sp
; Mark Keates
; Freddy Offenga
; Christian Groessler
-;
-; This must be the *first* file on the linker command line
;
.export _exit
+ .export __STARTUP__ : absolute = 1 ; Mark as startup
.constructor initsp, 26
.import initlib, donelib, callmain
; Startup code for cc65 (Oric version)
;
; By Debrune Jérôme <jede@oric.org> and Ullrich von Bassewitz <uz@cc65.org>
-;
-; This must be the *first* file on the linker command line
;
.export _exit
+ .export __STARTUP__ : absolute = 1 ; Mark as startup
.import initlib, donelib
.import callmain, zerobss
.import __RAM_START__, __RAM_SIZE__, __BSS_LOAD__
;
; Startup code for cc65 (C128 version)
-;
-; This must be the *first* file on the linker command line
;
.export _exit
+ .export __STARTUP__ : absolute = 1 ; Mark as startup
.import callirq, initlib, donelib
.import zerobss
.import push0, callmain
;
; Startup code for cc65 (C16 version)
;
-; This must be the *first* file on the linker command line
-;
; Note: The C16 is actually the Plus/4 with just 16KB of memory. So many
; things are similar here, and we even use the plus4.inc include file.
;
.export _exit
+ .export __STARTUP__ : absolute = 1 ; Mark as startup
.import initlib, donelib, callirq
.import callmain, zerobss
.import MEMTOP, RESTOR, BSOUT, CLRCH
;
; Startup code for cc65 (C64 version)
-;
-; This must be the *first* file on the linker command line
;
.export _exit
+ .export __STARTUP__ : absolute = 1 ; Mark as startup
.import initlib, donelib, callirq
.import zerobss
.import callmain
;
; Startup code for cc65 (CBM 500 version)
-;
-; This must be the *first* file on the linker command line
;
.export _exit
+ .export __STARTUP__ : absolute = 1 ; Mark as startup
.import _clrscr, initlib, donelib, callirq_y
.import push0, callmain
;
; Startup code for cc65 (CBM 600/700 version)
-;
-; This must be the *first* file on the linker command line
;
.export _exit, BRKVec
+ .export __STARTUP__ : absolute = 1 ; Mark as startup
.import callirq_y, initlib, donelib
.import push0, callmain
; code structure. The C stack is located at the end of the RAM memory
; segment and grows downward. Bastian Schick's executable header is put
; on the front of the fully linked binary (see EXEHDR segment.)
-;
-; This must be the *first* file on the linker command line
;
.include "lynx.inc"
.export _exit
+ .export __STARTUP__ : absolute = 1 ; Mark as startup
.import initlib, donelib
.import zerobss
;
; by Groepaz/Hitmen <groepaz@gmx.net>
; based on code by Ullrich von Bassewitz <uz@cc65.org>
-;
-; This must be the *first* file on the linker command line
;
.export _exit
+ .export __STARTUP__ : absolute = 1 ; Mark as startup
.import initlib, donelib, callmain
.import push0, _main, zerobss, copydata
.import ppubuf_flush
;
; Startup code for cc65 (PET version)
-;
-; This must be the *first* file on the linker command line
;
.export _exit
+ .export __STARTUP__ : absolute = 1 ; Mark as startup
.import initlib, donelib, callirq
.import zerobss, push0
.import callmain
;
; Startup code for cc65 (Plus/4 version)
-;
-; This must be the *first* file on the linker command line
;
.export _exit
.export brk_jmp
+ .export __STARTUP__ : absolute = 1 ; Mark as startup
.import callirq_y, initlib, donelib
.import callmain, zerobss
;
; Startup code for cc65 (supervision version)
-;
-; This must be the *first* file on the linker command line
;
.export _exit
+ .export __STARTUP__ : absolute = 1 ; Mark as startup
.import _main
.import initlib, donelib, copydata
;
; Startup code for cc65 (Vic20 version)
-;
-; This must be the *first* file on the linker command line
;
.export _exit
+ .export __STARTUP__ : absolute = 1 ; Mark as startup
.import initlib, donelib, callirq
.import zerobss, push0
.import callmain
%files apple2
%attr(644,root,root) /usr/lib/cc65/lib/apple2.lib
-%attr(644,root,root) /usr/lib/cc65/lib/apple2.o
%attr(644,root,root) /usr/lib/cc65/emd/a2.*.emd
%attr(644,root,root) /usr/lib/cc65/joy/a2.*.joy
%attr(644,root,root) /usr/lib/cc65/mou/a2.*.mou
%files apple2enh
%attr(644,root,root) /usr/lib/cc65/lib/apple2enh.lib
-%attr(644,root,root) /usr/lib/cc65/lib/apple2enh.o
%attr(644,root,root) /usr/lib/cc65/emd/a2e.*.emd
%attr(644,root,root) /usr/lib/cc65/joy/a2e.*.joy
%attr(644,root,root) /usr/lib/cc65/mou/a2e.*.mou
%files atari
%attr(644,root,root) /usr/lib/cc65/lib/atari.lib
-%attr(644,root,root) /usr/lib/cc65/lib/atari.o
%attr(644,root,root) /usr/lib/cc65/joy/atari*.joy
%files atmos
%attr(644,root,root) /usr/lib/cc65/lib/atmos.lib
-%attr(644,root,root) /usr/lib/cc65/lib/atmos.o
%attr(644,root,root) /usr/lib/cc65/tgi/atmos-*.tgi
%files c128
%attr(644,root,root) /usr/lib/cc65/lib/c128.lib
-%attr(644,root,root) /usr/lib/cc65/lib/c128.o
%attr(644,root,root) /usr/lib/cc65/emd/c128-*.emd
%attr(644,root,root) /usr/lib/cc65/joy/c128-*.joy
%attr(644,root,root) /usr/lib/cc65/mou/c128-*.mou
%files c16
%attr(644,root,root) /usr/lib/cc65/lib/c16.lib
-%attr(644,root,root) /usr/lib/cc65/lib/c16.o
%attr(644,root,root) /usr/lib/cc65/emd/c16-*.emd
%attr(644,root,root) /usr/lib/cc65/joy/c16-*.joy
%files c64
%attr(644,root,root) /usr/lib/cc65/lib/c64.lib
-%attr(644,root,root) /usr/lib/cc65/lib/c64.o
%attr(644,root,root) /usr/lib/cc65/emd/dtv-*.emd
%attr(644,root,root) /usr/lib/cc65/emd/c64-*.emd
%attr(644,root,root) /usr/lib/cc65/joy/c64-*.joy
%files cbm510
%attr(644,root,root) /usr/lib/cc65/lib/cbm510.lib
-%attr(644,root,root) /usr/lib/cc65/lib/cbm510.o
%attr(644,root,root) /usr/lib/cc65/emd/cbm510-*.emd
%attr(644,root,root) /usr/lib/cc65/joy/cbm510-*.joy
%attr(644,root,root) /usr/lib/cc65/ser/cbm510-*.ser
%files cbm610
%attr(644,root,root) /usr/lib/cc65/lib/cbm610.lib
-%attr(644,root,root) /usr/lib/cc65/lib/cbm610.o
%attr(644,root,root) /usr/lib/cc65/emd/cbm610-*.emd
%attr(644,root,root) /usr/lib/cc65/ser/cbm610-*.ser
%files geos
%attr(755,root,root) /usr/bin/grc
%attr(644,root,root) /usr/lib/cc65/lib/geos.lib
-%attr(644,root,root) /usr/lib/cc65/lib/geos.o
%attr(755,root,root) %dir /usr/lib/cc65/include/geos
%attr(644,root,root) /usr/lib/cc65/include/geos/*.h
%attr(644,root,root) /usr/lib/cc65/emd/geos-*.emd
%files lynx
%attr(644,root,root) /usr/lib/cc65/lib/lynx.lib
-%attr(644,root,root) /usr/lib/cc65/lib/lynx.o
%attr(644,root,root) /usr/lib/cc65/joy/lynx-*.joy
%attr(644,root,root) /usr/lib/cc65/tgi/lynx-*.tgi
%files nes
%attr(644,root,root) /usr/lib/cc65/lib/nes.lib
-%attr(644,root,root) /usr/lib/cc65/lib/nes.o
%attr(644,root,root) /usr/lib/cc65/joy/nes-*.joy
%files pet
%attr(644,root,root) /usr/lib/cc65/lib/pet.lib
-%attr(644,root,root) /usr/lib/cc65/lib/pet.o
%attr(644,root,root) /usr/lib/cc65/joy/pet-*.joy
%files plus4
%attr(644,root,root) /usr/lib/cc65/lib/plus4.lib
-%attr(644,root,root) /usr/lib/cc65/lib/plus4.o
%attr(644,root,root) /usr/lib/cc65/joy/plus4-*.joy
%attr(644,root,root) /usr/lib/cc65/ser/plus4-*.ser
%files supervision
%attr(644,root,root) /usr/lib/cc65/lib/supervision.lib
-%attr(644,root,root) /usr/lib/cc65/lib/supervision.o
%files vic20
%attr(644,root,root) /usr/lib/cc65/lib/vic20.lib
-%attr(644,root,root) /usr/lib/cc65/lib/vic20.o
%attr(644,root,root) /usr/lib/cc65/joy/vic20-*.joy
# source tree, otherwise use the "official" directories.
ifeq "$(wildcard ../src)" ""
# No source tree
-CRT0 = $(SYS).o
CLIB = $(SYS).lib
CL = cl65
CC = cc65
else
# Samples is part of a complete source tree
-CRT0 = ../libsrc/$(SYS).o
CLIB = ../libsrc/$(SYS).lib
CL = ../src/cl65/cl65
CC = ../src/cc65/cc65
.PHONY: all
all: $(EXELIST)
-ascii: $(CRT0) ascii.o $(CLIB)
+ascii: ascii.o $(CLIB)
@$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^
-diodemo: $(CRT0) diodemo.o $(CLIB)
+diodemo: diodemo.o $(CLIB)
@$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^
-fire: $(CRT0) fire.o $(CLIB)
+fire: fire.o $(CLIB)
@$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^
-gunzip65: $(CRT0) gunzip65.o $(CLIB)
+gunzip65: gunzip65.o $(CLIB)
@$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^
-hello: $(CRT0) hello.o $(CLIB)
+hello: hello.o $(CLIB)
@$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^
# The Apple machines need the start address adjusted for the mandelbrot demo
ifeq "$(SYS)" "apple2"
-mandelbrot: $(CRT0) mandelbrot.o $(CLIB)
+mandelbrot: mandelbrot.o $(CLIB)
@$(LD) -t $(SYS) -m $(basename $@).map --start-addr 0x4000 -o $@ $^
else
ifeq "$(SYS)" "apple2enh"
-mandelbrot: $(CRT0) mandelbrot.o $(CLIB)
+mandelbrot: mandelbrot.o $(CLIB)
@$(LD) -t $(SYS) -m $(basename $@).map --start-addr 0x4000 -o $@ $^
else
-mandelbrot: $(CRT0) mandelbrot.o $(CLIB)
+mandelbrot: mandelbrot.o $(CLIB)
@$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^
endif
endif
# The Apple ][ needs the start address adjusted for the mousedemo
ifeq "$(SYS)" "apple2"
-mousedemo: $(CRT0) mousedemo.o $(CLIB)
+mousedemo: mousedemo.o $(CLIB)
@$(LD) -t $(SYS) -m $(basename $@).map --start-addr 0x4000 -o $@ $^
else
-mousedemo: $(CRT0) mousedemo.o $(CLIB)
+mousedemo: mousedemo.o $(CLIB)
@$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^
endif
-nachtm: $(CRT0) nachtm.o $(CLIB)
+nachtm: nachtm.o $(CLIB)
@$(LD) -t $(SYS) -m $(basename $@).map -Ln $(basename $@).lbl -o $@ $^
-plasma: $(CRT0) plasma.o $(CLIB)
+plasma: plasma.o $(CLIB)
@$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^
-sieve: $(CRT0) sieve.o $(CLIB)
+sieve: sieve.o $(CLIB)
@$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^
# The Apple machines need the start address adjusted for the tgidemo
ifeq "$(SYS)" "apple2"
-tgidemo: $(CRT0) tgidemo.o $(CLIB)
+tgidemo: tgidemo.o $(CLIB)
@$(LD) -t $(SYS) -m $(basename $@).map --start-addr 0x4000 -o $@ $^
else
ifeq "$(SYS)" "apple2enh"
-tgidemo: $(CRT0) tgidemo.o $(CLIB)
+tgidemo: tgidemo.o $(CLIB)
@$(LD) -t $(SYS) -m $(basename $@).map --start-addr 0x4000 -o $@ $^
else
-tgidemo: $(CRT0) tgidemo.o $(CLIB)
+tgidemo: tgidemo.o $(CLIB)
@$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^
endif
endif
void g_importstartup (void)
-/* Forced import of the startup segment */
+/* Forced import of the startup module */
{
-#if 0
- AddTextLine ("\t.forceimport\t__STARTUP_RUN__");
-#endif
+ AddTextLine ("\t.forceimport\t__STARTUP__");
}