/html/
/joy/
/lib/
+/libwrk/
/mou/
/ser/
/targetutil/
language:
- c
install:
- - sudo apt-get install linuxdoc-tools linuxdoc-tools-info
+ - sudo apt-get install linuxdoc-tools linuxdoc-tools-info binutils-mingw-w64-i686 gcc-mingw-w64-i686
script:
- - make all doc
+ - make bin USER_CFLAGS=-Werror
+ - make lib QUIET=1
+ - make -C src clean
+ - make bin USER_CFLAGS=-Werror CROSS_COMPILE=i686-w64-mingw32-
+ - make doc zip
after_success:
- - make -C doc gh-pages
+ - make -f Makefile.gh-pages
env:
global:
- secure: "h+hoQdEHGPLNwaqGKmSaM8NBRDLc2X+W05VsnNG2Feq/wPv/AiBjONNlzN7jRf6D6f3aoPXaQ2Lc3bYWdxGvFRCmwiofdxkJI9n5L8HPHLZ2lf37MQsXmGJzoTFOvjPLj73H6HlbI9Ux0El3zO6hvalxiXj6TfoZ41dbhNyvpYk="
-.PHONY: all mostlyclean clean install avail unavail bin lib doc
+.PHONY: all mostlyclean clean install zip avail unavail bin lib doc
.SUFFIXES:
-all mostlyclean clean install:
+all mostlyclean clean install zip:
@$(MAKE) -C src --no-print-directory $@
@$(MAKE) -C libsrc --no-print-directory $@
@$(MAKE) -C doc --no-print-directory $@
--- /dev/null
+.PHONY: all
+
+.SUFFIXES:
+
+GH_PAGES = ../gh-pages
+
+all:
+ echo $(TRAVIS_COMMIT) | zip -z cc65
+ifdef GH_TOKEN
+ git clone --branch=gh-pages https://$(GH_TOKEN)@github.com/cc65/cc65.git $(GH_PAGES)
+ cd $(GH_PAGES) && git config user.name "Oliver Schmidt"
+ cd $(GH_PAGES) && git config user.email "ol.sc@web.de"
+ cd $(GH_PAGES) && git config push.default simple
+ cd $(GH_PAGES) && $(RM) -r doc download
+ cd $(GH_PAGES) && mkdir doc download
+ cp html/*.* $(GH_PAGES)/doc
+ cp cc65.zip $(GH_PAGES)/download/cc65-snapshot-win32.zip
+ cd $(GH_PAGES) && git add -A doc download
+ cd $(GH_PAGES) && git commit -m "Updated from commit $(TRAVIS_COMMIT)."
+ cd $(GH_PAGES) && git push
+endif
-[documentation](http://oliverschmidt.github.io/cc65/doc)
+[documentation](http://cc65.github.io/cc65/doc)
-[![build status](https://travis-ci.org/oliverschmidt/cc65.png)](https://travis-ci.org/oliverschmidt/cc65/builds)
+[![build status](https://travis-ci.org/cc65/cc65.png)](https://travis-ci.org/cc65/cc65/builds)
cc65 is a complete cross development package for 65(C)02 systems, including
a powerful macro assembler, a C compiler, linker, librarian and several
--- /dev/null
+FEATURES {
+ STARTADDRESS: default = $0900;
+}
+SYMBOLS {
+ __STACKSIZE__: type = weak, value = $0800; # 2k stack
+ __RESERVED_MEMORY__: type = weak, value = $0000;
+ __STARTADDRESS__: type = export, value = %S;
+ _cas_hdr: type = import;
+}
+MEMORY {
+ ZP: file = "", define = yes, start = $0082, size = $007E;
+ RAM: file = %O, define = yes, start = %S, size = $BC20 - __STACKSIZE__ - __RESERVED_MEMORY__ - %S;
+}
+SEGMENTS {
+ CASHDR: load = RAM, type = ro;
+ STARTUP: load = RAM, type = ro, define = yes, optional = 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, optional = yes;
+ DATA: load = RAM, type = rw, optional = yes;
+ BSS: load = RAM, type = bss, define = yes, optional = yes;
+ ZEROPAGE: load = ZP, type = zp, optional = yes;
+ EXTZP: load = ZP, type = zp, 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__;
+}
SEGMENTS {
BLLHDR: load = HEADER, type = ro;
STARTUP: load = RAM, type = ro, define = yes;
- LOWCODE: load = RAM, type = ro, optional = yes;
+ LOWCODE: load = RAM, type = ro, define = yes, optional = yes;
INIT: load = RAM, type = ro, define = yes, optional = yes;
CODE: load = RAM, type = ro, define = yes;
RODATA: load = RAM, type = ro, define = yes;
BOOTLDR: load = BOOT, type = ro;
DIRECTORY: load = DIR, type = ro;
STARTUP: load = RAM, type = ro, define = yes;
- LOWCODE: load = RAM, type = ro, optional = yes;
+ LOWCODE: load = RAM, type = ro, define = yes, optional = yes;
INIT: load = RAM, type = ro, define = yes, optional = yes;
CODE: load = RAM, type = ro, define = yes;
RODATA: load = RAM, type = ro, define = yes;
BOOTLDR: load = BOOT, type = ro;
DIRECTORY:load = DIR, type = ro;
STARTUP: load = RAM, type = ro, define = yes;
- LOWCODE: load = RAM, type = ro, optional = yes;
+ LOWCODE: load = RAM, type = ro, define = yes, optional = yes;
INIT: load = RAM, type = ro, define = yes, optional = yes;
CODE: load = RAM, type = ro, define = yes;
RODATA: load = RAM, type = ro, define = yes;
BOOTLDR: load = BOOT, type = ro;
DIRECTORY: load = DIR, type = ro;
STARTUP: load = RAM, type = ro, define = yes;
- LOWCODE: load = RAM, type = ro, optional = yes;
+ LOWCODE: load = RAM, type = ro, define = yes, optional = yes;
INIT: load = RAM, type = ro, define = yes, optional = yes;
CODE: load = RAM, type = ro, define = yes;
RODATA: load = RAM, type = ro, define = yes;
-.PHONY: all doc html info gh-pages mostlyclean clean install
+ifneq ($(shell echo),)
+ CMD_EXE = 1
+endif
+
+.PHONY: all mostlyclean clean install zip doc html info gh-pages
.SUFFIXES:
-ifeq ($(shell echo),)
+all mostlyclean install:
+
+ifdef CMD_EXE
+
+clean zip doc:
+
+else # CMD_EXE
SGMLS := $(wildcard *.sgml)
TOC_LEVEL = 2
-GH_PAGES = ../../gh-pages
+clean:
+ $(RM) -r ../html ../info
-all:
+zip:
+ @cd .. && zip cc65 html/*.*
doc: html info
info: $(addprefix ../info/,$(SGMLS:.sgml=.info))
-mostlyclean:
-
-clean:
- $(RM) -r ../html ../info
-
../html ../info:
@mkdir $@
../info/%.info: %.sgml | ../info
@cd ../info && linuxdoc -B info ../doc/$<
-gh-pages: html
-ifdef GH_TOKEN
- git clone --branch=gh-pages https://$(GH_TOKEN)@github.com/oliverschmidt/cc65.git $(GH_PAGES)
- git --work-tree=$(GH_PAGES) --git-dir=$(GH_PAGES)/.git config user.name "Oliver Schmidt"
- git --work-tree=$(GH_PAGES) --git-dir=$(GH_PAGES)/.git config user.email "ol.sc@web.de"
- git --work-tree=$(GH_PAGES) --git-dir=$(GH_PAGES)/.git config push.default simple
- $(RM) -r $(GH_PAGES)/doc
- mkdir $(GH_PAGES)/doc
- cp ../html/* $(GH_PAGES)/doc
- git --work-tree=$(GH_PAGES) --git-dir=$(GH_PAGES)/.git add -A doc
- -git --work-tree=$(GH_PAGES) --git-dir=$(GH_PAGES)/.git commit -m "Updated doc from commit $(TRAVIS_COMMIT)."
- git --work-tree=$(GH_PAGES) --git-dir=$(GH_PAGES)/.git push
-endif
-
-else # cmd.exe
-
-all doc mostlyclean clean install:
-
-endif # cmd.exe
+endif # CMD_EXE
For ProDOS 8 system programs the load address is fixed to $2000 so there
is no need for a header. Thus the linker configuration
-<htmlurl url="apple2-4.html#ss4.3" name="apple2-system.cfg"> for those programs
+<htmlurl url="apple2.html#ss4.3" name="apple2-system.cfg"> for those programs
omits the DOS 3.3 header. The right AppleCommander option to put system files
without a header on a ProDOS 8 disk image is <tt/-p/.
Card.
The amount of memory available in the Language Card for generated code depends
-on the chosen <htmlurl url="apple2-4.html" name="linker configuration">.
+on the chosen <htmlurl url="apple2.html#s4" name="linker configuration">.
The easiest (and for really large programs in fact the only) way to have a cc65
program use the memory from $800 to $2000 is to link it as binary
(as opposed to system) program using the linker configuration
-<htmlurl url="apple2-4.html#ss4.4" name="apple2-loader.cfg"> with start address
-$800 and load it with <bf/LOADER.SYSTEM - an Apple ][
-ProDOS 8 loader for cc65 programs/. The program then works like a system program
-(i.e. quits to the ProDOS dispatcher).
+<htmlurl url="apple2.html#ss4.4" name="apple2-loader.cfg"> with start address
+$803 and load it with the targetutil LOADER.SYSTEM. The program then works
+like a system program (i.e. quits to the ProDOS dispatcher).
Using LOADER.SYSTEM is as simple as copying it to the ProDOS 8 directory of the
program to load under name <program>.SYSTEM as a system program. For
<sect1>Heap<p>
If the cc65 program can be successfully linked as system program using the linker
-configuration <htmlurl url="apple2-4.html#ss4.3" name="apple2-system.cfg"> but
+configuration <htmlurl url="apple2.html#ss4.3" name="apple2-system.cfg"> but
uses the heap either explicitly or implicitly (i.e. by loading a driver) then
the memory from $800 to $2000 can be added to the heap by calling
<tt/_heapadd ((void *) 0x0800, 0x1800);/ at the beginning of <tt/main()/.
<descrip>
<tag/Drive ID/
- The function <htmlurl url="dio-1.html" name="dio_open()"> has the single
+ The function <htmlurl url="dio.html#s1" name="dio_open()"> has the single
parameter <tt/device/ to identify the device to be opened. Therefore an
Apple II slot and drive pair is mapped to that <tt/device/ according
to the formula
so that for example slot 6 drive 2 is mapped to <tt/device/ 14.
<tag/Sector count/
- The function <htmlurl url="dio-3.html" name="dio_query_sectcount()"> returns
+ The function <htmlurl url="dio.html#s3" name="dio_query_sectcount()"> returns
the correct sector count for all ProDOS 8 disks. However for any non-ProDOS 8
disk it simply always returns 280 (which is only correct for a 140 KB disk).
This condition is indicated by the <tt/_oserror/ value 82.
For ProDOS 8 system programs the load address is fixed to $2000 so there
is no need for a header. Thus the linker configuration
-<htmlurl url="apple2enh-4.html#ss4.3" name="apple2enh-system.cfg"> for those programs
+<htmlurl url="apple2enh.html#ss4.3" name="apple2enh-system.cfg"> for those programs
omits the DOS 3.3 header. The right AppleCommander option to put system files
without a header on a ProDOS 8 disk image is <tt/-p/.
Card.
The amount of memory available in the Language Card for generated code depends
-on the chosen <htmlurl url="apple2enh-4.html" name="linker configuration">.
+on the chosen <htmlurl url="apple2enh.html#s4" name="linker configuration">.
The easiest (and for really large programs in fact the only) way to have a cc65
program use the memory from $800 to $2000 is to link it as binary
(as opposed to system) program using the linker configuration
-<htmlurl url="apple2enh-4.html#ss4.4" name="apple2enh-loader.cfg"> with start address
-$800 and load it with <bf/LOADER.SYSTEM - an Apple ][
-ProDOS 8 loader for cc65 programs/. The program then works like a system program
-(i.e. quits to the ProDOS dispatcher).
+<htmlurl url="apple2enh.html#ss4.4" name="apple2enh-loader.cfg"> with start address
+$803 and load it with the targetutil LOADER.SYSTEM. The program then works
+like a system program (i.e. quits to the ProDOS dispatcher).
Using LOADER.SYSTEM is as simple as copying it to the ProDOS 8 directory of the
program to load under name <program>.SYSTEM as a system program. For
<sect1>Heap<p>
If the cc65 program can be successfully linked as system program using the linker
-configuration <htmlurl url="apple2enh-4.html#ss4.3" name="apple2enh-system.cfg"> but
+configuration <htmlurl url="apple2enh.html#ss4.3" name="apple2enh-system.cfg"> but
uses the heap either explicitly or implicitly (i.e. by loading a driver) then
the memory from $800 to $2000 can be added to the heap by calling
<tt/_heapadd ((void *) 0x0800, 0x1800);/ at the beginning of <tt/main()/.
<descrip>
<tag/Drive ID/
- The function <htmlurl url="dio-1.html" name="dio_open()"> has the single
+ The function <htmlurl url="dio.html#s1" name="dio_open()"> has the single
parameter <tt/device/ to identify the device to be opened. Therefore an
Apple II slot and drive pair is mapped to that <tt/drive_id/ according
to the formula
so that for example slot 6 drive 2 is mapped to <tt/device/ 14.
<tag/Sector count/
- The function <htmlurl url="dio-3.html" name="dio_query_sectcount()"> returns
+ The function <htmlurl url="dio.html#s3" name="dio_query_sectcount()"> returns
the correct sector count for all ProDOS 8 disks. However for any non-ProDOS 8
disk it simply always returns 280 (which is only correct for a 140 KB disk).
This condition is indicated by the <tt/_oserror/ value 82.
The option byte will be located at address $BFFD. For more information
about its use, see e.g. "Mapping the Atari".
+<sect2><tt/atari-cassette.cfg/<p>
+
+This config file can be used to create cassette boot files. It's suited both
+for C and assembly language programs.
+
+The size of a cassette boot file is restricted to 32K. Larger programs
+would need to be split in more parts and the parts to be loaded manually.
+
+To write the generated file to a cassette, a utility to run
+on an Atari is provided in the <tt/targetutil/ directory (<tt/w2cas.com/).
<sect1><tt/atarixl/ config files<p>
Reading this pseudo variable will give the assembler version according to
the following formula:
- VER_MAJOR*$100 + VER_MINOR*$10 + VER_PATCH
+ VER_MAJOR*$100 + VER_MINOR*$10
It may be used to encode the assembler version or check the assembler for
special features not available with older versions.
Example:
- Version 2.11.1 of the assembler will return $2B1 as numerical constant when
+ Version 2.14 of the assembler will return $2E0 as numerical constant when
reading the pseudo variable <tt/.VERSION/.
<tag><tt>__CC65__</tt></tag>
This macro is always defined. Its value is the version number of the
- compiler in hex. For example, version 2.10.1 of the compiler has this macro
- defined as <tt/0x02A1/.
+ compiler in hex. For example, version 2.14 of the compiler has this macro
+ defined as <tt/0x02E0/.
<tag><tt>__CC65_STD__</tt></tag>
the GEOS world. It means that each file built with the cc65 package has to be
deconverted in GEOS, before it can be run. You can read a step-by-step
description of that in the <url name="GEOS section of the cc65 Compiler Intro"
-url="intro-6.html#ss6.5">.
+url="intro.html#ss6.5">.
Each project consists of four parts, two are provided by cc65. Those parts
are:<enum>
extern void c128_vdc_emd[];
extern void c128_ptvjoy_joy[];
extern void c128_stdjoy_joy[]; /* Referred to by joy_static_stddrv[] */
-extern void c128_1351_mous[]; /* Referred to by mouse_static_stddrv[] */
+extern void c128_1351_mou[]; /* Referred to by mouse_static_stddrv[] */
extern void c128_joy_mou[];
extern void c128_inkwell_mou[];
extern void c128_pot_mou[];
+ifneq ($(shell echo),)
+ CMD_EXE = 1
+endif
+
CBMS = c128 \
c16 \
c64 \
ser \
tgi
-# Every target requires its individual vpath setting but the vpath directive
-# acts globally. Therefore each target is built in a separate make instance.
+OUTPUTDIRS := lib \
+ $(DRVTYPES) \
+ targetutil \
+ asminc \
+ cfg \
+ include \
+ $(subst ../,,$(filter-out $(wildcard ../include/*.*),$(wildcard ../include/*)))
-ifeq ($(words $(MAKECMDGOALS)),1)
- ifeq ($(MAKECMDGOALS),$(filter $(MAKECMDGOALS),$(TARGETS)))
- TARGET = $(MAKECMDGOALS)
- endif
-endif
+.PHONY: all mostlyclean clean install zip lib $(TARGETS)
-DIRLIST = $(strip $(foreach dir,$1,$(wildcard $(dir))))
+.SUFFIXES:
-ifeq ($(shell echo),)
- MKDIR = mkdir -p $1
- RMDIR = $(RM) -r $1
-else
+ifdef CMD_EXE
+ DIRLIST = $(strip $(foreach dir,$1,$(wildcard $(dir))))
MKDIR = mkdir $(subst /,\,$1)
RMDIR = $(if $(DIRLIST),rmdir /s /q $(subst /,\,$(DIRLIST)))
+else
+ MKDIR = mkdir -p $1
+ RMDIR = $(RM) -r $1
endif
-.SUFFIXES:
+# Every target requires its individual vpath setting but the vpath directive
+# acts globally. Therefore each target is built in a separate make instance.
-.PHONY: all lib $(TARGETS) mostlyclean clean install
+ifeq ($(words $(MAKECMDGOALS)),1)
+ ifeq ($(MAKECMDGOALS),$(filter $(MAKECMDGOALS),$(TARGETS)))
+ TARGET = $(MAKECMDGOALS)
+ endif
+endif
ifndef TARGET
datadir = $(prefix)/share/cc65
-INSTALLDIRS = ../asminc ../cfg ../include \
- $(filter-out $(wildcard ../include/*.*),$(wildcard ../include/*)) \
- ../lib ../targetutil $(addprefix ../,$(DRVTYPES))
-
-INSTALL = install
-
all lib: $(TARGETS)
-$(TARGETS):
- @$(MAKE) --no-print-directory $@
-
mostlyclean:
- $(call RMDIR,../wrk)
+ $(call RMDIR,../libwrk)
clean:
- $(call RMDIR,../wrk ../lib ../targetutil $(addprefix ../,$(DRVTYPES)))
+ $(call RMDIR,../libwrk ../lib ../targetutil $(addprefix ../,$(DRVTYPES)))
+
+ifdef CMD_EXE
install:
- $(foreach dir,$(INSTALLDIRS),$(INSTALL_recipe))
-##########
+else # CMD_EXE
+
+INSTALL = install
define INSTALL_recipe
$(if $(prefix),,$(error variable `prefix' must be set))
-$(INSTALL) -d $(subst ..,$(DESTDIR)$(datadir),$(dir))
-$(INSTALL) -m644 $(dir)/*.* $(subst ..,$(DESTDIR)$(datadir),$(dir))
+$(INSTALL) -d $(DESTDIR)$(datadir)/$(dir)
+$(INSTALL) -m644 ../$(dir)/*.* $(DESTDIR)$(datadir)/$(dir)
+
+endef # INSTALL_recipe
+
+install:
+ $(foreach dir,$(OUTPUTDIRS),$(INSTALL_recipe))
-endef
+endif # CMD_EXE
-##########
+define ZIP_recipe
+
+@cd .. && zip cc65 $(dir)/*.*
+
+endef # ZIP_recipe
+
+zip:
+ $(foreach dir,$(OUTPUTDIRS),$(ZIP_recipe))
+
+$(TARGETS):
+ @$(MAKE) --no-print-directory $@
else # TARGET
CA65FLAGS =
-CC65FLAGS = -Osir -W error
+CC65FLAGS = -Or -W error
EXTZP = cbm510 \
cbm610 \
MKINC = $(GEOS) \
atari \
+ atarixl \
nes
-TARGETUTIL = apple2 \
+TARGETUTIL = apple2 \
+ apple2enh \
+ atari \
geos-apple
GEOSDIRS = common \
OBJS := $(patsubst %.s,%.o,$(foreach dir,$(SRCDIRS),$(wildcard $(dir)/*.s)))
OBJS += $(patsubst %.c,%.o,$(foreach dir,$(SRCDIRS),$(wildcard $(dir)/*.c)))
-OBJS := $(addprefix ../wrk/$(TARGET)/,$(sort $(notdir $(OBJS))))
+OBJS := $(addprefix ../libwrk/$(TARGET)/,$(sort $(notdir $(OBJS))))
DEPS = $(OBJS:.o=.d)
EXTRA_OBJPAT = ../lib/$(TARGET)-%.o
EXTRA_OBJS := $(patsubst $(EXTRA_SRCPAT),$(EXTRA_OBJPAT),$(wildcard $(SRCDIR)/extra/*.s))
-ZPOBJ = ../wrk/$(TARGET)/zeropage.o
+ZPOBJ = ../libwrk/$(TARGET)/zeropage.o
ifeq ($(TARGET),$(filter $(TARGET),$(EXTZP)))
- ZPOBJ += ../wrk/$(TARGET)/extzp.o
+ ZPOBJ += ../libwrk/$(TARGET)/extzp.o
endif
-ifeq ($(SRCDIR),$(filter $(SRCDIR),$(MKINC)))
+ifeq ($(TARGET),$(filter $(TARGET),$(MKINC)))
include $(SRCDIR)/Makefile.inc
endif
-ifeq ($(SRCDIR),$(filter $(SRCDIR),$(TARGETUTIL)))
+ifeq ($(TARGET),$(filter $(TARGET),$(TARGETUTIL)))
include $(SRCDIR)/targetutil/Makefile.inc
endif
-##########
-
define DRVTYPE_template
$1_SRCDIR = $$(SRCDIR)/$1
-$1_OBJDIR = ../wrk/$$(TARGET)/$1
+$1_OBJDIR = ../libwrk/$$(TARGET)/$1
$1_DRVDIR = ../$1
$1_OBJPAT = $$($1_OBJDIR)/$$(OBJPFX)%.o
$1_DRVPAT = $$($1_DRVDIR)/$$(DRVPFX)%.$1
-$1_STCPAT = ../wrk/$$(TARGET)/$$(DRVPFX)%-$1.o
+$1_STCPAT = ../libwrk/$$(TARGET)/$$(DRVPFX)%-$1.o
$1_OBJS := $$(patsubst $$($1_SRCDIR)/%.s,$$($1_OBJDIR)/%.o,$$(wildcard $$($1_SRCDIR)/*.s))
DEPS += $$($1_OBJS:.o=.d)
-endef
-
-##########
+endef # DRVTYPE_template
$(foreach drvtype,$(DRVTYPES),$(eval $(call DRVTYPE_template,$(drvtype))))
export CC65_HOME := $(abspath ..)
-##########
-
define ASSEMBLE_recipe
-$(if $(TRAVIS),,@echo $(TARGET) - $<)
+$(if $(QUIET),,@echo $(TARGET) - $<)
@$(CA65) -t $(TARGET) $(CA65FLAGS) --create-dep $(@:.o=.d) -o $@ $<
-endef
-
-##########
+endef # ASSEMBLE_recipe
define COMPILE_recipe
-$(if $(TRAVIS),,@echo $(TARGET) - $<)
+$(if $(QUIET),,@echo $(TARGET) - $<)
@$(CC65) -t $(TARGET) $(CC65FLAGS) --create-dep $(@:.o=.d) --dep-target $@ -o $(@:.o=.s) $<
@$(CA65) -t $(TARGET) -o $@ $(@:.o=.s)
-endef
-
-##########
+endef # COMPILE_recipe
-../wrk/$(TARGET)/%.o: %.s | ../wrk/$(TARGET)
+../libwrk/$(TARGET)/%.o: %.s | ../libwrk/$(TARGET)
$(ASSEMBLE_recipe)
-../wrk/$(TARGET)/%.o: %.c | ../wrk/$(TARGET)
+../libwrk/$(TARGET)/%.o: %.c | ../libwrk/$(TARGET)
$(COMPILE_recipe)
$(EXTRA_OBJPAT): $(EXTRA_SRCPAT) | ../lib
../lib/$(TARGET).lib: $(OBJS) | ../lib
$(AR65) a $@ $?
-../wrk/$(TARGET) ../lib ../targetutil:
+../libwrk/$(TARGET) ../lib ../targetutil:
@$(call MKDIR,$@)
$(TARGET): $(EXTRA_OBJS) ../lib/$(TARGET).lib
-DEPS += ../wrk/$(TARGET)/loader.d
+DEPS += ../libwrk/$(TARGET)/loader.d
-../wrk/$(TARGET)/loader.o: $(SRCDIR)/targetutil/loader.s | ../wrk/$(TARGET)
+../libwrk/$(TARGET)/loader.o: $(SRCDIR)/targetutil/loader.s | ../libwrk/$(TARGET)
$(ASSEMBLE_recipe)
-../targetutil/loader.system: ../wrk/$(TARGET)/loader.o $(SRCDIR)/targetutil/loader.cfg | ../targetutil
+../targetutil/loader.system: ../libwrk/$(TARGET)/loader.o $(SRCDIR)/targetutil/loader.cfg | ../targetutil
$(LD65) -o $@ -C $(filter %.cfg,$^) $(filter-out %.cfg,$^)
$(TARGET): ../targetutil/loader.system
+++ /dev/null
-LOADER.SYSTEM - an Apple][ ProDOS 8 loader for cc65 programs (Oliver Schmidt)
-=============================================================================
-
-
-Background
-----------
-
-Apple][ ProDOS 8 system programs (filetype SYS) are always loaded into memory
-starting at location $2000. This poses the problem of how to make efficient
-use of the memory in the range $0800-$2000. The usual approach of relocation
-has two downsides:
-- Relocating e.g. 30 kB from $2000-$9800 to $0800-$8000 takes a considerable
- amount of time.
-- Really large programs just don't fit into memory when loaded starting at
- location $2000.
-
-The relocation can be eliminated by loading the major part(s) of the program
-from disk right to the final location by a rather small system program.
-
-LOADER.SYSTEM is such a small program. In fact it's so small that it fits into
-a single block in the ProDOS 8 file system making it a so-called seedling file,
-which are loaded really fast. LOADER.SYSTEM can load cc65 programs into memory
-anywhere in the range $0800-$BB00 (44,75 kB).
-
-
-Usage
------
-
-Link the cc65 program to the start address $0803 (or any other address) and
-store it as binary program (filetype BIN). This is in fact no different from
-a binary program to be run by BASIC.SYSTEM's BRUN command in the usual way.
-
-If however the cc65 program isn't run by BASIC.SYSTEM but is rather run by
-LOADER.SYSTEM then it behaves like a system program which means:
-- It uses memory up to the ProDOS 8 system global page located at $BF00.
-- It supports the ProDOS 8 startup file mechanism (mapped to argv[1]).
-- It quits to the ProDOS 8 dispatcher.
-
-Obviously LOADER.SYSTEM has to be told which cc65 program to run. Unfortunately
-the ProDOS 8 dispatcher has no notion of system program parameters so the usual
-approach would have been to make LOADER.SYSTEM bring up yet another menu to
-select the cc65 program to run.
-
-But to allow to select the cc65 program directly from the ProDOS 8 dispatcher
-anyway LOADER.SYSTEM detects the path to the cc65 program from its own path by
-just removing the '.SYSTEM' from its name. So if you want to run the cc65
-program MYPROGRAM you'll need a copy of LOADER.SYSTEM in the same directory
-being renamed to MYPROGRAM.SYSTEM.
-
-This means you will end up with a copy of LOADER.SYSTEM for every cc65 program
-to be run by it. But as LOADER.SYSTEM is a ProDOS 8 seedling file using up only
-a single block in the ProDOS 8 file system this should be no issue.
-
-
-Build
------
-
-In case you want to build 'loader.system' from the source code yourself you can
-do so using the following commands:
-
-ca65 loader.s
-ld65 -C loader.cfg -o loader.system loader.o
-
-
-Installation
-------------
-
-The file 'loader.system' as generated by the cc65 linker with the command above
-does NOT include the 4-byte address/length header that is generated for Apple][
-programs by default. This is because ProDOS 8 system programs are always loaded
-into memory starting at location $2000.
-
-The recommended way to transfer 'loader.system' from your native file system to
-a ProDOS 8 file system disk image is to use AppleCommander which is available at
-http://applecommander.sourceforge.net/
-
-If you want to put the file 'loader.system' onto a disk image 'mydisk.dsk' as
-system program MYPROGRAM.SYSTEM you can do so using the following command:
-
-java -jar ac.jar -p mydisk.dsk MYPROGRAM.SYSTEM sys < loader.system
--- /dev/null
+;
+; Cassette boot file header
+;
+; Christian Groessler, chris@groessler.org, 2014
+;
+
+;DEBUG = 1
+
+.ifndef __ATARIXL__
+
+ .include "atari.inc"
+
+ .import __BSS_RUN__, __STARTADDRESS__, _cas_init
+ .export _cas_hdr
+
+.assert ((__BSS_RUN__ - __STARTADDRESS__ + 127) / 128) < $101, error, "File to big to load from cassette"
+
+
+; for a description of the cassette header, see De Re Atari, appendix C
+
+.segment "CASHDR"
+
+_cas_hdr:
+ .byte 0 ; ignored
+ .byte <((__BSS_RUN__ - __STARTADDRESS__ + 127) / 128) ; # of 128-byte records to read
+ .word __STARTADDRESS__ ; load address
+ .word _cas_init ; init address
+
+.ifdef DEBUG
+ lda #33
+ ldy #80
+ sta (SAVMSC),y
+.endif
+ clc
+ rts
+
+.endif ; .ifdef __ATARIXL__
--- /dev/null
+;
+; Cassette boot file init routine
+;
+; Christian Groessler, chris@groessler.org, 2014
+;
+
+;DEBUG = 1
+
+.ifndef __ATARIXL__
+
+ .include "atari.inc"
+
+ .import start
+ .export _cas_init
+
+.segment "INIT"
+
+_cas_init:
+.ifdef DEBUG
+ lda #34
+ ldy #81
+ sta (SAVMSC),y
+.endif
+
+ lda #<start
+ sta DOSVEC
+ lda #>start
+ sta DOSVEC+1
+ rts
+
+.endif ; .ifdef __ATARIXL__
; Initialize conio stuff
- dey ; Set X to $FF
- sty CH
+ dey ; Set Y to $FF
+ sty CH ; remove keypress which might be in the input buffer
; Push arguments and call main
--- /dev/null
+;
+; Christian Groessler, July 2004
+;
+; unsigned char get_tv(void)
+;
+; returns the TV system the machine is using
+; 0 - NTSC
+; 1 - PAL
+;
+
+
+ .include "atari.inc"
+ .include "get_tv.inc"
+
+.proc _get_tv
+
+ ldx #TV::NTSC ; Assume NTSC
+ lda PAL ; use hw register, PALNTS is only supported on XL/XE ROM
+ and #$0e
+ bne @NTSC
+ inx ; = TV::PAL
+@NTSC: txa
+ ldx #0 ; Expand to int
+ rts
+
+.endproc
--- /dev/null
+DEPS += ../libwrk/$(TARGET)/w2cas.d
+
+../libwrk/$(TARGET)/w2cas.o: $(SRCDIR)/targetutil/w2cas.c | ../libwrk/$(TARGET)
+ $(COMPILE_recipe)
+
+../targetutil/w2cas.com: ../libwrk/$(TARGET)/w2cas.o ../lib/$(TARGET).lib | ../targetutil
+ $(LD65) -o $@ -t $(TARGET) $^
+
+$(TARGET): ../targetutil/w2cas.com
--- /dev/null
+/* w2cas.c -- write file to cassette
+ *
+ * This program writes a boot file (typically linked with
+ * 'atari-cassette.cfg') to the cassette.
+ * Only files < 32K are supported, since the loading of
+ * larger files requires a special loader inside the program.
+ *
+ * Christian Groessler, chris@groessler.org, 2014
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <6502.h>
+#include <atari.h>
+#include <conio.h>
+
+static int verbose = 1;
+static char C_dev[] = "C:";
+
+static struct __iocb *findfreeiocb(void)
+{
+ struct __iocb *iocb = &IOCB; /* first IOCB (#0) */
+ int i;
+
+ for (i = 0; i < 8; i++) {
+ if (iocb->handler == 0xff)
+ return iocb;
+ iocb++;
+ }
+ return NULL;
+}
+
+int main(int argc, char **argv)
+{
+ char *filename, *x;
+ char buf[20];
+ FILE *file;
+ unsigned char *buffer;
+ size_t filen, buflen = 32768l + 1;
+ struct regs regs;
+ struct __iocb *iocb = findfreeiocb();
+ int iocb_num;
+
+ if (! iocb) {
+ fprintf(stderr, "couldn't find a free iocb\n");
+ if (_dos_type != 1)
+ cgetc();
+ return 1;
+ }
+ iocb_num = (iocb - &IOCB) * 16;
+ if (verbose)
+ printf("using iocb index $%02X ($%04X)\n", iocb_num, iocb);
+
+ if (argc < 2) {
+ printf("\nfilename: ");
+ x = fgets(buf, 19, stdin);
+ printf("\n");
+ if (! x)
+ return 1;
+ if (*x && *(x + strlen(x) - 1) == '\n')
+ *(x + strlen(x) - 1) = 0;
+ filename = x;
+ }
+ else {
+ filename = *(argv+1);
+ }
+
+ /* allocate buffer */
+ buffer = malloc(buflen);
+ if (! buffer) {
+ buflen = _heapmaxavail(); /* get as much as we can */
+ buffer = malloc(buflen);
+ if (! buffer) {
+ fprintf(stderr, "cannot alloc %ld bytes -- aborting...\n", (long)buflen);
+ if (_dos_type != 1)
+ cgetc();
+ return 1;
+ }
+ }
+ if (verbose)
+ printf("buffer size: %ld bytes\n", (long)buflen);
+
+ /* open file */
+ file = fopen(filename, "rb");
+ if (! file) {
+ free(buffer);
+ fprintf(stderr, "cannot open '%s': %s\n", filename, strerror(errno));
+ if (_dos_type != 1)
+ cgetc();
+ return 1;
+ }
+
+ /* read file -- file length must be < 32K */
+ if (verbose)
+ printf("reading input file...\n");
+ filen = fread(buffer, 1, buflen, file);
+ if (! filen) {
+ fprintf(stderr, "read error\n");
+ file_err:
+ fclose(file);
+ free(buffer);
+ if (_dos_type != 1)
+ cgetc();
+ return 1;
+ }
+ if (filen > 32767l) {
+ fprintf(stderr, "file is too large (must be < 32768)\n");
+ goto file_err;
+ }
+ if (filen == buflen) { /* we have a buffer < 32768 and the file fits into it (and is most probably larger) */
+ fprintf(stderr, "not enough memory\n");
+ goto file_err;
+ }
+ if (verbose)
+ printf("file size: %ld bytes\n", (long)filen);
+
+ /* close input file */
+ fclose(file);
+
+ /* open cassette */
+ if (verbose)
+ printf("opening cassette...\n");
+ iocb->buffer = C_dev;
+ iocb->aux1 = 8; /* open for output */
+ iocb->aux2 = 128; /* short breaks and no stop between data blocks */
+ iocb->command = IOCB_OPEN;
+ regs.x = iocb_num;
+ regs.pc = 0xe456; /* CIOV */
+
+ _sys(®s);
+ if (regs.y != 1) {
+ fprintf(stderr, "CIO call to open cassette returned %d\n", regs.y);
+ free(buffer);
+ if (_dos_type != 1)
+ cgetc();
+ return 1;
+ }
+
+ /* write file */
+ if (verbose)
+ printf("writing to cassette...\n");
+ iocb->buffer = buffer;
+ iocb->buflen = filen;
+ iocb->command = IOCB_PUTCHR;
+ regs.x = iocb_num;
+ regs.pc = 0xe456; /* CIOV */
+
+ _sys(®s);
+ if (regs.y != 1) {
+ fprintf(stderr, "CIO call to write file returned %d\n", regs.y);
+ free(buffer);
+
+ iocb->command = IOCB_CLOSE;
+ regs.x = iocb_num;
+ regs.pc = 0xe456; /* CIOV */
+ _sys(®s);
+
+ if (_dos_type != 1)
+ cgetc();
+ return 1;
+ }
+
+ /* free buffer */
+ free(buffer);
+
+ /* close cassette */
+ iocb->command = IOCB_CLOSE;
+ regs.x = iocb_num;
+ regs.pc = 0xe456; /* CIOV */
+ _sys(®s);
+
+ if (regs.y != 1) {
+ fprintf(stderr, "CIO call to close cassette returned %d\n", regs.y);
+ if (_dos_type != 1)
+ cgetc();
+ return 1;
+ }
+
+ /* all is fine */
+ printf("success\n");
+ if (_dos_type != 1)
+ cgetc();
+ return 0;
+}
+++ /dev/null
-;
-; Christian Groessler, July 2004
-;
-; unsigned char get_tv(void)
-;
-; returns the TV system the machine is using
-; 0 - NTSC
-; 1 - PAL
-;
-
-
- .include "atari.inc"
- .include "get_tv.inc"
-
-.proc _get_tv
-
- ldx #TV::NTSC ; Assume NTSC
- lda PAL ; use hw register, PALNTS is only supported on XL/XE ROM
- and #$0e
- bne @NTSC
- inx ; = TV::PAL
-@NTSC: txa
- ldx #0 ; Expand to int
- rts
-
-.endproc
; Driver for the 1351 proportional mouse. Parts of the code are from
; the Commodore 1351 mouse users guide.
;
-; Ullrich von Bassewitz, 2003-12-29, 2009-09-26
+; 2009-09-26, Ullrich von Bassewitz
+; 2014-03-17, Greg King
;
.include "zeropage.inc"
OldValue: .res 1 ; Temp for MoveCheck routine
NewValue: .res 1 ; Temp for MoveCheck routine
+INIT_save: .res 1
+
.rodata
; Default values for above variables
.word SCREEN_WIDTH/2 ; XPos
.word 0 ; XMin
.word 0 ; YMin
- .word SCREEN_WIDTH ; XMax
- .word SCREEN_HEIGHT ; YMax
+ .word SCREEN_WIDTH - 1 ; XMax
+ .word SCREEN_HEIGHT - 1 ; YMax
.endproc
.code
INSTALL:
+; Disable the BASIC interpreter's interrupt-driven sprite-motion code.
+; That allows direct access to the VIC-IIe's sprite registers.
+
+ lda INIT_STATUS
+ sta INIT_save
+ lda #%11000000
+ sta INIT_STATUS
+
; Initialize variables. Just copy the default stuff over
ldx #.sizeof(DefVars)-1
ldx #$00
txa
- rts ; Run into UNINSTALL instead
+ rts
;----------------------------------------------------------------------------
; UNINSTALL routine. Is called before the driver is removed from memory.
; No return code required (the driver is removed from memory on return).
-UNINSTALL = HIDE ; Hide cursor on exit
+UNINSTALL:
+ jsr HIDE ; Hide cursor on exit
+ lda INIT_save
+ sta INIT_STATUS
+ rts
;----------------------------------------------------------------------------
; HIDE routine. Is called to hide the mouse pointer. The mouse kernel manages
;
; Driver for a "joystick mouse".
;
-; Ullrich von Bassewitz, 2004-04-05, 2009-09-26
+; 2009-09-26, Ullrich von Bassewitz
+; 2014-03-17, Greg King
;
.include "zeropage.inc"
YMax: .res 2 ; Y2 value of bounding box
Buttons: .res 1 ; Button mask
+INIT_save: .res 1
+
; Temporary value used in the int handler
Temp: .res 1
.word SCREEN_WIDTH/2 ; XPos
.word 0 ; XMin
.word 0 ; YMin
- .word SCREEN_WIDTH ; XMax
- .word SCREEN_HEIGHT ; YMax
+ .word SCREEN_WIDTH - 1 ; XMax
+ .word SCREEN_HEIGHT - 1 ; YMax
.byte 0 ; Buttons
.endproc
INSTALL:
+; Disable the BASIC interpreter's interrupt-driven sprite-motion code.
+; That allows direct access to the VIC-IIe's sprite registers.
+
+ lda INIT_STATUS
+ sta INIT_save
+ lda #%11000000
+ sta INIT_STATUS
+
; Initialize variables. Just copy the default stuff over
ldx #.sizeof(DefVars)-1
; UNINSTALL routine. Is called before the driver is removed from memory.
; No return code required (the driver is removed from memory on return).
-UNINSTALL = HIDE ; Hide cursor on exit
+UNINSTALL:
+ jsr HIDE ; Hide cursor on exit
+ lda INIT_save
+ sta INIT_STATUS
+ rts
;----------------------------------------------------------------------------
; HIDE routine. Is called to hide the mouse pointer. The mouse kernel manages
;
-; Driver for a potentiometer "mouse" e.g. Koala Pad
+; Driver for a potentiometer "mouse", e.g. Koala Pad
;
-; Ullrich von Bassewitz, 2004-03-29, 2009-09-26
-; Stefan Haubenthal, 2006-08-20
+; 2006-08-20, Stefan Haubenthal
+; 2009-09-26, Ullrich von Bassewitz
+; 2014-03-17, Greg King
;
.include "zeropage.inc"
YMax: .res 2 ; Y2 value of bounding box
Buttons: .res 1 ; Button mask
+INIT_save: .res 1
+
; Temporary value used in the int handler
Temp: .res 1
.word SCREEN_WIDTH/2 ; XPos
.word 0 ; XMin
.word 0 ; YMin
- .word SCREEN_WIDTH ; XMax
- .word SCREEN_HEIGHT ; YMax
+ .word SCREEN_WIDTH - 1 ; XMax
+ .word SCREEN_HEIGHT - 1 ; YMax
.byte 0 ; Buttons
.endproc
INSTALL:
+; Disable the BASIC interpreter's interrupt-driven sprite-motion code.
+; That allows direct access to the VIC-IIe's sprite registers.
+
+ lda INIT_STATUS
+ sta INIT_save
+ lda #%11000000
+ sta INIT_STATUS
+
; Initialize variables. Just copy the default stuff over
ldx #.sizeof(DefVars)-1
; UNINSTALL routine. Is called before the driver is removed from memory.
; No return code required (the driver is removed from memory on return).
-UNINSTALL = HIDE ; Hide cursor on exit
+UNINSTALL:
+ jsr HIDE ; Hide cursor on exit
+ lda INIT_save
+ sta INIT_STATUS
+ rts
;----------------------------------------------------------------------------
; HIDE routine. Is called to hide the mouse pointer. The mouse kernel manages
; Driver for a "joystick mouse".
;
; Ullrich von Bassewitz, 2004-03-29, 2009-09-26
-; 2010-02-08, Greg King
+; 2014-03-17, Greg King
;
; The driver prevents the keyboard from interfering by changing the
; keyboard's output port into an input port while the driver reads its
.word SCREEN_WIDTH/2 ; XPos
.word 0 ; XMin
.word 0 ; YMin
- .word SCREEN_WIDTH ; XMax
- .word SCREEN_HEIGHT ; YMax
+ .word SCREEN_WIDTH - 1 ; XMax
+ .word SCREEN_HEIGHT - 1 ; YMax
.byte 0 ; Buttons
.endproc
;
-; Driver for a potentiometer "mouse" e.g. Koala Pad
+; Driver for a potentiometer "mouse", e.g. Koala Pad
;
-; Ullrich von Bassewitz, 2004-03-29, 2009-09-26
-; Stefan Haubenthal, 2006-08-20
+; 2006-08-20, Stefan Haubenthal
+; 2009-09-26, Ullrich von Bassewitz
+; 2014-03-17, Greg King
;
.include "zeropage.inc"
.word SCREEN_WIDTH/2 ; XPos
.word 0 ; XMin
.word 0 ; YMin
- .word SCREEN_WIDTH ; XMax
- .word SCREEN_HEIGHT ; YMax
+ .word SCREEN_WIDTH - 1 ; XMax
+ .word SCREEN_HEIGHT - 1 ; YMax
.byte 0 ; Buttons
.endproc
-DEPS += ../wrk/$(TARGET)/convert.d
+DEPS += ../libwrk/$(TARGET)/convert.d
-../wrk/$(TARGET)/convert.o: TARGET = apple2enh
+../libwrk/$(TARGET)/convert.o: TARGET = apple2enh
-../wrk/$(TARGET)/convert.o: $(SRCDIR)/targetutil/convert.c | ../wrk/$(TARGET)
+../libwrk/$(TARGET)/convert.o: $(SRCDIR)/targetutil/convert.c | ../libwrk/$(TARGET)
$(COMPILE_recipe)
../lib/apple2enh.lib:
@$(MAKE) --no-print-directory apple2enh
-../targetutil/convert.system: ../wrk/$(TARGET)/convert.o ../lib/apple2enh.lib | ../targetutil
+../targetutil/convert.system: ../libwrk/$(TARGET)/convert.o ../lib/apple2enh.lib | ../targetutil
$(LD65) -o $@ -C apple2enh-system.cfg $^
$(TARGET): ../targetutil/convert.system
.import __STARTOFDIRECTORY__
.import __RAM_START__
.import __CODE_SIZE__,__DATA_SIZE__,__RODATA_SIZE__
- .import __STARTUP_SIZE__,__INIT_SIZE__
+ .import __STARTUP_SIZE__,__INIT_SIZE__,__LOWCODE_SIZE__
.import __BLOCKSIZE__
.export __DEFDIR__: absolute = 1
blocka=off0/__BLOCKSIZE__
; Entry 0 - first executable
block0=off0/__BLOCKSIZE__
-len0=__STARTUP_SIZE__+__INIT_SIZE__+__CODE_SIZE__+__DATA_SIZE__+__RODATA_SIZE__
+len0=__STARTUP_SIZE__+__INIT_SIZE__+__CODE_SIZE__+__DATA_SIZE__+__RODATA_SIZE__+__LOWCODE_SIZE__
.byte <block0
.word off0 & (__BLOCKSIZE__ - 1)
.byte $88
-../tgi/nes-64-56-2.tgi: ../wrk/nes/clrscr.o \
- ../wrk/nes/cputc.o \
- ../wrk/nes/get_tv.o \
- ../wrk/nes/gotoxy.o \
- ../wrk/nes/popa.o \
- ../wrk/nes/ppu.o \
- ../wrk/nes/ppubuf.o \
- ../wrk/nes/setcursor.o
+../tgi/nes-64-56-2.tgi: ../libwrk/nes/clrscr.o \
+ ../libwrk/nes/cputc.o \
+ ../libwrk/nes/get_tv.o \
+ ../libwrk/nes/gotoxy.o \
+ ../libwrk/nes/popa.o \
+ ../libwrk/nes/ppu.o \
+ ../libwrk/nes/ppubuf.o \
+ ../libwrk/nes/setcursor.o
-.SUFFIXES:
-
-.PHONY: all bin $(PROGS) mostlyclean clean install avail unavail
-
-ifeq ($(shell echo),)
+ifneq ($(shell echo),)
+ CMD_EXE = 1
+endif
PROGS = ar65 \
ca65 \
sim65 \
sp65
+.PHONY: all mostlyclean clean install zip avail unavail bin $(PROGS)
+
+.SUFFIXES:
+
bindir := $(prefix)/bin
datadir := $(if $(prefix),$(prefix)/share/cc65,$(abspath ..))
LD65_OBJ = $(datadir)/lib
LD65_CFG = $(datadir)/cfg
-CFLAGS += -MMD -MP -O -std=c89 -I common \
+CC = $(CROSS_COMPILE)gcc
+AR = $(CROSS_COMPILE)ar
+
+ifdef CROSS_COMPILE
+ $(info CC: $(CC))
+ $(info AR: $(AR))
+endif
+
+ifdef USER_CFLAGS
+ $(info USER_CFLAGS: $(USER_CFLAGS))
+endif
+
+ifndef GIT_SHA
+ GIT_SHA := $(if $(wildcard ../.git),$(shell git rev-parse --short HEAD))
+ ifneq ($(words $(GIT_SHA)),1)
+ GIT_SHA := N/A
+ endif
+endif
+$(info GIT_SHA: $(GIT_SHA))
+
+CFLAGS += -MMD -MP -O -I common \
-Wall -Wextra -Wno-char-subscripts $(USER_CFLAGS) \
- -DCA65_INC=$(CA65_INC) -DCC65_INC=$(CC65_INC) \
+ -DGIT_SHA=$(GIT_SHA) -DCA65_INC=$(CA65_INC) -DCC65_INC=$(CC65_INC) \
-DLD65_LIB=$(LD65_LIB) -DLD65_OBJ=$(LD65_OBJ) -DLD65_CFG=$(LD65_CFG)
-CFLAGS += $(if $(TRAVIS),-Werror)
-
LDLIBS += -lm
-INSTALL = install
+ifdef CMD_EXE
+ EXE_SUFFIX=.exe
+endif
+
+ifdef CROSS_COMPILE
+ EXE_SUFFIX=.exe
+endif
+
+ifdef CMD_EXE
+ DIRLIST = $(strip $(foreach dir,$1,$(wildcard $(dir))))
+ MKDIR = mkdir $(subst /,\,$1)
+ RMDIR = $(if $(DIRLIST),rmdir /s /q $(subst /,\,$(DIRLIST)))
+else
+ MKDIR = mkdir -p $1
+ RMDIR = $(RM) -r $1
+endif
all bin: $(PROGS)
mostlyclean:
- $(RM) -r ../wrk
+ $(call RMDIR,../wrk)
clean:
- $(RM) -r ../wrk ../bin
+ $(call RMDIR,../wrk ../bin)
-install:
- $(if $(prefix),,$(error variable `prefix' must be set))
- $(INSTALL) -d $(DESTDIR)$(bindir)
- $(INSTALL) ../bin/* $(DESTDIR)$(bindir)
+ifdef CMD_EXE
-avail:
- $(foreach prog,$(PROGS),$(AVAIL_recipe))
+install avail unavail:
-unavail:
- $(foreach prog,$(PROGS),$(UNAVAIL_recipe))
+else # CMD_EXE
-##########
+INSTALL = install
define AVAIL_recipe
ln -s $(abspath ../bin/$(prog)) /usr/local/bin/$(prog)
-endef
-
-##########
+endef # AVAIL_recipe
define UNAVAIL_recipe
$(RM) /usr/local/bin/$(prog)
-endef
+endef # UNAVAIL_recipe
-##########
+install:
+ $(if $(prefix),,$(error variable `prefix' must be set))
+ $(INSTALL) -d $(DESTDIR)$(bindir)
+ $(INSTALL) ../bin/* $(DESTDIR)$(bindir)
+
+avail:
+ $(foreach prog,$(PROGS),$(AVAIL_recipe))
+
+unavail:
+ $(foreach prog,$(PROGS),$(UNAVAIL_recipe))
+
+endif # CMD_EXE
+
+zip:
+ @cd .. && zip cc65 bin/*
define OBJS_template
$$($1_OBJS): | ../wrk/$1
../wrk/$1:
- @mkdir -p $$@
+ @$$(call MKDIR,$$@)
DEPS += $$($1_OBJS:.o=.d)
-endef
-
-##########
+endef # OBJS_template
define PROG_template
$$(eval $$(call OBJS_template,$1))
-../bin/$1$(PROGEXT): $$($1_OBJS) ../wrk/common/common.a | ../bin
+../bin/$1$(EXE_SUFFIX): $$($1_OBJS) ../wrk/common/common.a | ../bin
$$(CC) $$(LDFLAGS) -o $$@ $$^ $$(LDLIBS)
-$1: ../bin/$1$(PROGEXT)
-
-endef
+$1: ../bin/$1$(EXE_SUFFIX)
-##########
+endef # PROG_template
../wrk/%.o: %.c
@echo $<
@$(CC) -c $(CFLAGS) -o $@ $<
../bin:
- @mkdir $@
+ @$(call MKDIR,$@)
$(eval $(call OBJS_template,common))
+
../wrk/common/common.a: $(common_OBJS)
$(AR) r $@ $?
$(foreach prog,$(PROGS),$(eval $(call PROG_template,$(prog))))
-include $(DEPS)
-
-else # cmd.exe
-
-all bin:
- msbuild cc65.sln /p:configuration=release /consoleloggerparameters:disableconsolecolor
-
-mostlyclean:
- $(if $(wildcard ../wrk),rmdir /s /q ..\wrk)
-
-clean:
- msbuild cc65.sln /p:configuration=release /consoleloggerparameters:disableconsolecolor /target:$@
-
-install avail unavail:
-
-endif # cmd.exe
/* Successful end */
exit (EXIT_SUCCESS);
}
-
-
-
-
/* End of add.h */
#endif
-
-
-
-
/* Successful end */
exit (EXIT_SUCCESS);
}
-
-
-
-
/* End of del.h */
#endif
-
-
-
-
va_end (ap);
exit (EXIT_FAILURE);
}
-
-
-
/* End of error.h */
#endif
-
-
-
/* Not found */
return 0;
}
-
-
-
/* End of exports.h */
#endif
-
-
-
/* Successful end */
exit (EXIT_SUCCESS);
}
-
-
-
/* End of extract.h */
#endif
-
-
-
-
}
return Data;
}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
/* End of fileio.h */
#endif
-
-
-
/*****************************************************************************/
/* Data */
/*****************************************************************************/
-
-
-
/* End of global.h */
#endif
-
-
-
Error ("Problem deleting temporary library file: %s", strerror (errno));
}
}
-
-
-
/* End of library.h */
#endif
-
-
-
/* Successful end */
exit (EXIT_SUCCESS);
}
-
-
-
/* End of list.h */
#endif
-
-
-
-
/* Return an apropriate exit code */
return EXIT_SUCCESS;
}
-
-
-
/* Not found! */
Warning ("Module `%s' not found in library `%s'", Module, LibName);
}
-
-
-
/* End of objdata.h */
#endif
-
-
-
Error ("Cannot set mod time on `%s': %s", Name, strerror (errno));
}
}
-
-
-
/* End of objfile.h */
#endif
-
-
-
}
return (strncmp (SB_GetConstBuf (Name), AnonTag, sizeof (AnonTag) - 1) == 0);
}
-
-
-
/* End of anonname.h */
-#endif
-
-
+#endif
/* Done writing the assertions */
ObjEndAssertions ();
}
-
-
-
-
-
/* End of asserts.h */
#endif
-
-
-
/* Calculate the new overall .IF condition */
CalcOverallIfCond ();
}
-
-
-
-
/* End of condasm.h */
#endif
-
-
-
/* End of dbginfo.h */
#endif
-
-
-
-
-
/* End of ea.h */
#endif
-
-
-
/* Apply addressing mode overrides */
A->AddrModeSet &= Restrictions;
}
-
-
-
-
/* End of ea65.h */
#endif
-
-
-
/* Free the base expression */
FreeExpr (BaseExpr);
}
-
-
-
-
/* End of enum.h */
#endif
-
-
-
exit (EXIT_FAILURE);
}
-
-
-
+#if defined( __MINGW32__)
+# pragma GCC diagnostic ignored "-Wformat"
+#endif
+
+
+
/* common */
#include "attrib.h"
#include "coll.h"
/* End of error.h */
#endif
-
-
-
-
{
return MakeBoundedExpr (ExprFunc (), Size);
}
-
-
-
/* End of expr.h */
#endif
-
-
-
/* Return the value found */
return Feature;
}
-
-
-
/* End of feature.h */
#endif
-
-
-
FT_MAIN | FT_INCLUDE | FT_BINARY | FT_DBGINFO);
}
}
-
-
/* End of filetab.h */
#endif
-
-
-
-
-
/* And return it */
return F;
}
-
-
-
/* End of fragment.h */
-#endif
-
-
-
+#endif
/* End of global.h */
#endif
-
-
-
-SearchPath* IncSearchPath; /* Standard include path */
-SearchPath* BinSearchPath; /* Binary include path */
+SearchPaths* IncSearchPath; /* Standard include path */
+SearchPaths* BinSearchPath; /* Binary include path */
AddSubSearchPathFromEnv (IncSearchPath, "CC65_HOME", "asminc");
/* Add some compiled-in search paths if defined at compile time. */
-#ifdef CA65_INC
+#if defined(CA65_INC) && !defined(_WIN32)
AddSearchPath (IncSearchPath, STRINGIZE (CA65_INC));
#endif
/* Add paths relative to the parent directory of the Windows binary. */
AddSubSearchPathFromWinBin (IncSearchPath, "asminc");
}
-
-
-
-extern SearchPath* IncSearchPath; /* Standard include path */
-extern SearchPath* BinSearchPath; /* Binary include path */
+extern SearchPaths* IncSearchPath; /* Standard include path */
+extern SearchPaths* BinSearchPath; /* Binary include path */
/* End of incpath.h */
#endif
-
-
-
/* Call the handler */
InsTab->Ins[Index].Emit (&InsTab->Ins[Index]);
}
-
-
-
/* End of instr.h */
#endif
-
-
-
-
-
Error ("Open %s", IStack->Desc);
}
}
-
-
-
/* End of istack.h */
#endif
-
-
-
-
/* End of line infos */
ObjEndLineInfos ();
}
-
-
-
/* End of lineinfo.h */
-#endif
-
-
-
+#endif
/* Close the listing file */
(void) fclose (F);
}
-
-
-
/* End of listing.h */
#endif
-
-
-
PRECONDITION (DisableDefines > 0);
--DisableDefines;
}
-
-
-
/* End of macro.h */
#endif
-
-
-
/* Return an apropriate exit code */
return (ErrorCount == 0)? EXIT_SUCCESS : EXIT_FAILURE;
}
-
-
-
PRECONDITION (RawMode > 0);
--RawMode;
}
-
-
-
/* End of nexttok.h */
#endif
-
-
-
-
GenFragment (FRAG_FILL, Chunk);
}
}
-
-
-
/* End of objcode.h */
#endif
-
-
-
{
Header.SpanSize = ftell (F) - Header.SpanOffs;
}
-
-
-
/* End of objfile.h */
#endif
-
-
-
/* End of options.h */
#endif
-
-
-
Warning (1, "CPU stack is not empty");
}
}
-
-
-
/* End of pseudo.h */
#endif
-
-
-
/* Switch out of raw token mode */
LeaveRawTokenMode ();
}
-
-
-
/* End of repeat.h */
#endif
-
-
-
-
{
DoneCharSource ();
}
-
-
-
-
/* End of scanner.h */
#endif
-
-
-
-
{
return NewSegDef (Def->Name, Def->AddrSize);
}
-
-
-
-
/* End of segdef.h */
#endif
-
-
-
/* Done writing segments */
ObjEndSegments ();
}
-
-
-
-
/* End of segment.h */
#endif
-
-
-
SymDef (SizeSym, GenLiteralExpr (Size), ADDR_SIZE_DEFAULT, SF_NONE);
return SizeSym;
}
-
-
-
/* End of sizeof.h */
-#endif
-
-
+#endif
/* Done writing the spans */
ObjEndSpans ();
}
-
-
-
-
/* End of span.h */
#endif
-
-
-
/* Insert an empty string. It will have string id 0 */
SP_AddStr (StrPool, "");
}
-
-
-
/* End of spool.h */
#endif
-
-
-
-
{
DoStructInternal (0, UNION);
}
-
-
-
/* End of struct.h */
#endif
-
-
-
printf ("%u sections:\n", D->SecCount);
#endif
}
-
-
-
/* End of studyexpr.h */
-#endif
-
-
+#endif
/* Return the symbol found */
return Sym;
}
-
-
-
/* End of symbol.h */
#endif
-
-
-
/* Return the result */
return Flags;
}
-
-
-
/* End of symentry.h */
#endif
-
-
-
-
/* Done writing the scopes */
ObjEndScopes ();
}
-
-
-
/* End of symtab.h */
#endif
-
-
-
SB_Copy (&Dst->SVal, &Src->SVal);
Dst->Pos = Src->Pos;
}
-
-
-
/* End of token.h */
#endif
-
-
-
++PushCounter;
PushInput (ReplayTokList, List, Desc);
}
-
-
-
/* End of toklist.h */
#endif
-
-
-
-
ReleaseFullLineInfo (&L->LineInfos);
}
}
-
-
-
-
/* End of ulabel.h */
#endif
-
-
-
{
return (strncmp (Name, AnonTag, sizeof (AnonTag) - 1) == 0);
}
-
-
-
/* End of anonname.h */
-#endif
-
-
+#endif
Entry = Entry->NextSym;
}
}
-
-
-
/* End of asmcode.h */
-#endif
-
-
-
+#endif
/* Local label name */
return 1;
}
-
-
-
-
/* End of asmlabel.h */
-#endif
-
-
+#endif
/* Closing paren needed */
ConsumeRParen ();
}
-
-
-
/* End of asmstmt.h */
#endif
-
-
-
/* Value is still in primary and not an lvalue */
ED_MakeRValExpr (Expr);
}
-
-
-
/* End of assignment.h */
-#endif
-
-
+#endif
/* Return the label of the node we found/created */
return CaseLabel;
}
-
-
-
/* End of casenode.h */
-#endif
-
-
+#endif
/* Terminate the line */
WriteOutput ("\n");
}
-
-
-
-
-
-
/* End of codeent.h */
-#endif
-
-
-
+#endif
{
AddCodeLine ("%.*s", (int) SB_GetLen (B), SB_GetConstBuf (B));
}
-
-
-
/* End of codegen.h */
-#endif
-
+#endif
return CMP_INV;
}
}
-
-
-
/* End of codeinfo.h */
-#endif
-
-
-
+#endif
WriteOutput ("\n");
}
}
-
-
-
-
/* End of codelab.h */
-#endif
-
-
+#endif
WriteOptStats (StatFileName);
}
}
-
-
-
/* End of codeopt.h */
-#endif
-
-
+#endif
/* End of codeseg.h */
-#endif
-
-
+#endif
/* Leave the main lexical level */
LeaveGlobalLevel ();
}
-
-
-
/* End of compile.h */
#endif
-
-
-
/* Return the number of changes made */
return Changes;
}
-
-
-
/* End of coptadd.h */
#endif
-
-
-
/* Return the number of changes made */
return Changes;
}
-
-
-
/* End of coptc02.h */
-#endif
-
-
+#endif
/* Return the number of changes made */
return Changes;
}
-
-
-
/* End of coptcmp.h */
#endif
-
-
-
/* Return the number of changes made */
return Changes;
}
-
-
-
/* End of coptind.h */
-#endif
-
-
+#endif
/* Return the number of changes made */
return Changes;
}
-
-
-
/* End of coptneg.h */
#endif
-
-
-
/* Return the number of changes made */
return Changes;
}
-
-
-
/* End of coptptrload.h */
-#endif
-
-
+#endif
/* Return the number of changes made */
return Changes;
}
-
-
-
/* End of coptptrstore.h */
-#endif
-
-
-
+#endif
/* Return the number of changes made */
return Changes;
}
-
-
-
/* End of coptpush.h */
#endif
-
-
-
/* Return the number of changes made */
return Changes;
}
-
-
-
/* End of coptshift.h */
-#endif
-
-
+#endif
/* Return the number of changes made */
return Changes;
}
-
-
-
/* End of coptsize.h */
-#endif
-
-
+#endif
/* Return the number of changes made */
return Changes;
}
-
-
-
/* End of coptstop.h */
-#endif
-
-
+#endif
/* Return the number of changes made */
return Changes;
}
-
-
-
/* End of coptstore.h */
#endif
-
-
-
/* Return the number of changes made */
return Changes;
}
-
-
-
/* End of coptsub.h */
#endif
-
-
-
/* Return the number of changes made */
return Changes;
}
-
-
-
/* End of copttest.h */
#endif
-
-
-
/* Add an additional newline after the segment output */
WriteOutput ("\n");
}
-
-
-
-
/* End of dataseg.h */
-#endif
-
-
+#endif
/* End of datatype.h */
#endif
-
-
-
/* Return the size needed for the initialization */
return Size;
}
-
-
-
/* End of declare.h */
#endif
-
-
-
ConsumeRParen ();
ConsumeRParen ();
}
-
-
-
/* End of declattr.h */
#endif
-
-
-
{
Print (stdout, 1, "%u errors, %u warnings\n", ErrorCount, WarningCount);
}
-
-
-
/* End of error.h */
-#endif
-
-
-
-
+#endif
ED_MakeConstAbsInt (Expr, 1);
}
}
-
-
-
/* End of expr.h */
#endif
-
-
-
-
Expr->Type = TypeDup (NewType);
return OldType;
}
-
-
-
/* End of exprdesc.h */
-#endif
-
-
+#endif
/* Free the structure */
xfree (F);
}
-
-
-
/* End of funcdesc.h */
-#endif
-
-
+#endif
FreeFunction (CurrentFunc);
CurrentFunc = 0;
}
-
-
-
/* End of function.h */
-#endif
-
-
+#endif
StrBuf DepName = STATIC_STRBUF_INITIALIZER; /* Name of dependencies file */
StrBuf FullDepName = STATIC_STRBUF_INITIALIZER; /* Name of full dependencies file */
StrBuf DepTarget = STATIC_STRBUF_INITIALIZER; /* Name of dependency target */
-
-
-
/* End of global.h */
#endif
-
-
-
-
NextToken ();
NextToken ();
}
-
-
-
/* End of goto.h */
-#endif
-
-
+#endif
return toupper (C) - 'A' + 10;
}
}
-
-
-
/* End of hexval.h */
-#endif
-
-
-
-
+#endif
{
return (IsAlpha (c) || c == '_');
}
-
-
-
/* End of ident.h */
-#endif
-
-
+#endif
-SearchPath* SysIncSearchPath; /* System include path */
-SearchPath* UsrIncSearchPath; /* User include path */
+SearchPaths* SysIncSearchPath; /* System include path */
+SearchPaths* UsrIncSearchPath; /* User include path */
AddSubSearchPathFromEnv (SysIncSearchPath, "CC65_HOME", "include");
/* Add some compiled-in search paths if defined at compile time. */
-#ifdef CC65_INC
+#if defined(CC65_INC) && !defined(_WIN32)
AddSearchPath (SysIncSearchPath, STRINGIZE (CC65_INC));
#endif
/* Add paths relative to the parent directory of the Windows binary. */
AddSubSearchPathFromWinBin (SysIncSearchPath, "include");
}
-
-
-
-extern SearchPath* SysIncSearchPath; /* System include path */
-extern SearchPath* UsrIncSearchPath; /* User include path */
+extern SearchPaths* SysIncSearchPath; /* System include path */
+extern SearchPaths* UsrIncSearchPath; /* User include path */
/* End of incpath.h */
-#endif
-
-
+#endif
IT_MAIN | IT_SYSINC | IT_USRINC);
}
}
-
-
* choosen so that it is possible to combine them to bitsets
*/
typedef enum {
- IT_MAIN = 0x01, /* Main input file */
- IT_SYSINC = 0x02, /* System include file (using <>) */
- IT_USRINC = 0x04, /* User include file (using "") */
+ IT_MAIN = 0x01, /* Main input file */
+ IT_SYSINC = 0x02, /* System include file (using <>) */
+ IT_USRINC = 0x04, /* User include file (using "") */
} InputType;
/* Forward for an IFile structure */
/* End of input.h */
-#endif
-
-
+#endif
PRECONDITION (LI != 0);
return LI->LineNum;
}
-
-
-
/* End of lineinfo.h */
-#endif
-
-
-
+#endif
{
return AddLiteralBuf (SB_GetConstBuf (S), SB_GetLen (S));
}
-
-
-
/* End of litpool.h */
-#endif
-
-
-
+#endif
/* End of loadexpr.h */
-#endif
-
-
+#endif
g_cstackcheck ();
}
}
-
-
-
/* End of locals.h */
-#endif
-
-
+#endif
LoopStack = LoopStack->Next;
xfree (L);
}
-
-
-
/* End of loop.h */
#endif
-
-
-
/* End of macrotab.h */
-#endif
-
-
+#endif
/* Return an apropriate exit code */
return (ErrorCount > 0)? EXIT_FAILURE : EXIT_SUCCESS;
}
-
-
-
/* End of opcodes.h */
-#endif
-
-
+#endif
/* Return the number of chars written */
return CharCount;
}
-
-
-
/* End of output.h */
-#endif
-
-
+#endif
/* Closing paren needed */
ConsumeRParen ();
}
-
-
-
/* End of pragma.h */
-#endif
-
-
-
-
+#endif
(int) SB_GetLen (Line), SB_GetConstBuf (Line));
}
}
-
/* End of preproc.h */
-#endif
-
-
+#endif
fprintf (stdout, "Out: ");
RC_Dump (stdout, &RI->Out);
}
-
-
-
/* End of reginfo.h */
-#endif
-
-
-
+#endif
{
return Consume (TOK_RCURLY, "`}' expected");
}
-
-
-
/* End of scanner.h */
-#endif
-
-
-
-
-
+#endif
*Val *= Sign;
return 1;
}
-
-
-
/* End of scanstrbuf.h */
-#endif
-
-
-
-
+#endif
/* Output the code segment epiloque */
CS_OutputEpilogue (S->Code);
}
-
-
-
/* End of segments.h */
-#endif
-
-
+#endif
Expr->Type = ResultType;
}
}
-
-
-
/* End of shiftexpr.h */
#endif
-
-
-
-
{
StackPtr += SizeOf (T);
}
-
-
-
-
/* End of stackptr.h */
#endif
-
-
-
/* Not found */
return STD_UNKNOWN;
}
-
-
-
/* End of standard.h */
#endif
-
-
-
-
/* Call the handler function */
D->Handler (F, lval);
}
-
-
-
/* End of stdfunc.h */
#endif
-
-
-
const char Func_strcmp[] = "strcmp"; /* Asm name of "strcmp" */
const char Func_strcpy[] = "strcpy"; /* Asm name of "strcpy" */
const char Func_strlen[] = "strlen"; /* Asm name of "strlen" */
-
-
-
/* End of stdnames.h */
#endif
-
-
-
/* End of stmt.h */
#endif
-
-
-
/* Skip the colon */
ConsumeColon ();
}
-
-
-
/* End of swstmt.h */
-#endif
-
-
+#endif
{
return IsAnonName (Entry->Name);
}
-
-
-
/* End of symentry.h */
-#endif
-
-
+#endif
/* End of symtab.h */
#endif
-
-
-
/* Return the result of the expression */
return Result;
}
-
-
-
-
/* End of testexpr.h */
-#endif
-
-
-
+#endif
/* Add an additional newline after the segment output */
WriteOutput ("\n");
}
-
-
-
/* End of textseg.h */
-#endif
-
-
+#endif
/* Return the result */
return Result;
}
-
-
-
-
/* End of typecmp.h */
#endif
-
-
-
-
/* Convert the value. */
DoConversion (Expr, NewType);
}
-
-
-
-
-
/* End of typeconv.h */
-#endif
-
-
+#endif
/* End of util.h */
#endif
-
-
-
<ItemGroup>
<ClInclude Include="cl65\error.h" />
<ClInclude Include="cl65\global.h" />
- <ClInclude Include="cl65\spawn.h" />
</ItemGroup>
<ItemGroup>
<None Include="cl65\spawn-amiga.inc" />
exit (EXIT_FAILURE);
}
-
-
/* End of error.h */
#endif
-
-
-
unsigned char Debug = 0; /* Debug mode enabled? */
-
-
-
/* End of global.h */
#endif
-
-
-
/* Check out if we have a spawn() function on the system, or if we must use
* our own.
*/
-#if defined(__WATCOMC__) || defined(_MSC_VER) || defined(__MINGW32__) || defined(__DJGPP__)
-# define HAVE_SPAWN 1
+#if defined(_WIN32)
+# define HAVE_SPAWN 1
#else
-# define NEED_SPAWN 1
+# define NEED_SPAWN 1
#endif
-#if defined(_MSC_VER)
-# pragma warning(disable : 4996)
+
+/* GCC strictly follows http://c-faq.com/ansi/constmismatch.html and issues an
+ * 'incompatible pointer type' warning - that can't be suppressed via #pragma.
+ * The spawnvp() prototype of MinGW (http://www.mingw.org/) differs from the
+ * one of MinGW-w64 (http://mingw-w64.sourceforge.net/) regarding constness.
+ * So there's no alternative to actually distinguish these environments :-(
+ */
+#define SPAWN_ARGV_CONST_CAST
+#if defined(__MINGW32__)
+# include <_mingw.h>
+# if !defined(__MINGW64_VERSION_MAJOR)
+# undef SPAWN_ARGV_CONST_CAST
+# define SPAWN_ARGV_CONST_CAST (const char* const *)
+# endif
#endif
#include <string.h>
#include <ctype.h>
#include <errno.h>
-#ifdef HAVE_SPAWN
+#if defined(HAVE_SPAWN)
# include <process.h>
#endif
}
/* Call the program */
- Status = spawnvp (P_WAIT, Cmd->Name, Cmd->Args);
+ Status = spawnvp (P_WAIT, Cmd->Name, SPAWN_ARGV_CONST_CAST Cmd->Args);
/* Check the result code */
if (Status < 0) {
/* Return an apropriate exit code */
return EXIT_SUCCESS;
}
-
-
-
/* Return the result */
return Status;
}
-
-
-
*/
return WEXITSTATUS (Status);
}
-
-
-
+++ /dev/null
-/*****************************************************************************/
-/* */
-/* spawn.h */
-/* */
-/* Execute other external programs */
-/* */
-/* */
-/* */
-/* (C) 1999 Ullrich von Bassewitz */
-/* Wacholderweg 14 */
-/* D-70597 Stuttgart */
-/* EMail: uz@musoftware.de */
-/* */
-/* */
-/* This software is provided 'as-is', without any expressed or implied */
-/* warranty. In no event will the authors be held liable for any damages */
-/* arising from the use of this software. */
-/* */
-/* Permission is granted to anyone to use this software for any purpose, */
-/* including commercial applications, and to alter it and redistribute it */
-/* freely, subject to the following restrictions: */
-/* */
-/* 1. The origin of this software must not be misrepresented; you must not */
-/* claim that you wrote the original software. If you use this software */
-/* in a product, an acknowledgment in the product documentation would be */
-/* appreciated but is not required. */
-/* 2. Altered source versions must be plainly marked as such, and must not */
-/* be misrepresented as being the original software. */
-/* 3. This notice may not be removed or altered from any source */
-/* distribution. */
-/* */
-/*****************************************************************************/
-
-
-
-#ifndef SPAWN_H
-#define SPAWN_H
-
-
-
-/*****************************************************************************/
-/* Data */
-/*****************************************************************************/
-
-
-
-/* Mode argument for spawn. This value is ignored by the function and only
- * provided for DOS/Windows compatibility.
- */
-#ifndef P_WAIT
-#define P_WAIT 0
-#endif
-
-
-
-/*****************************************************************************/
-/* Code */
-/*****************************************************************************/
-
-
-
-int spawnvp (int Mode, const char* File, char* const argv []);
-/* Execute the given program searching and wait til it terminates. The Mode
- * argument is ignored (compatibility only). The result of the function is
- * the return code of the program. The function will terminate the program
- * on errors.
- */
-
-
-
-/* End of spawn.h */
-#endif
-
-
-
fprintf (F, ".end\n");
fclose (F);
}
-
-
-
/* End of convert.h */
#endif
-
-
-
va_end (ap);
exit (EXIT_FAILURE);
}
-
-
-
/* End of error.h */
#endif
-
-
-
/* End of fileio.h */
#endif
-
-
-
/* Flags */
unsigned char DebugInfo = 0; /* Enable debug info */
unsigned char NoOutput = 0; /* Suppress the actual conversion */
-
-
-
/* End of global.h */
#endif
-
-
-
/* Return an apropriate exit code */
return EXIT_SUCCESS;
}
-
-
-
}
return O65_MODEL_INVALID;
}
-
-
-
/* End of model.h */
#endif
-
-
-
Buf[I] = '\0';
return Buf;
}
-
-
-
/* End of o65.h */
-#endif
-
-
-
+#endif
/* Terminate the program */
exit (EXIT_FAILURE);
}
-
-
-
/* End of abend.h */
#endif
-
-
-
/* Not found */
return ADDR_SIZE_INVALID;
}
-
-
-
/* End of addrsize.h */
#endif
-
-
-
{
return AlignAddr (Addr, Alignment) - Addr;
}
-
-
-
/* End of alignment.h */
#endif
-
-
-
{
return (A & 0x02U) == 0;
}
-
-
-
/* End of assertion.h */
#endif
-
-
-
/* End of attrib.h */
#endif
-
-
-
/* End of bitops.h */
#endif
-
-
-
/* End of cddefs.h */
#endif
-
-
-
{
return (C == '"' || C == '\'');
}
-
-
-
/* End of chartype.h */
#endif
-
-
-
/* Output a diagnostic and abort */
AbEnd ("%s%s, file `%s', line %u", Msg, Cond, File, Line);
}
-
-
-
/* End of check.h */
-#endif
-
-
+#endif
/* Invalid option */
UnknownOption (Opt);
}
-
-
-
-
/* End of cmdline.h */
#endif
-
-
-
QuickSort (C, 0, C->Count-1, Compare, Data);
}
}
-
-
-
/* End of coll.h */
#endif
-
-
-
-
/* Not found */
return CPU_UNKNOWN;
}
-
-
-
/* End of cpu.h */
#endif
-
-
-
unsigned char Debug = 0; /* Debug mode */
-
-
-
/* End of debugflag.h */
-#endif
-
-
+#endif
InternalDumpExpr (Expr, ResolveSym);
printf ("\n");
}
-
-
-
/* End of exprdefs.h */
#endif
-
-
-
/* Search for a table entry and return it */
return bsearch (Ext+1, Table, Count, sizeof (FileId), CompareFileId);
}
-
-
-
/* End of fileid.h */
-#endif
-
-
+#endif
/* End of filepos.h */
#endif
-
-
-
/* */
/* filestat.c */
/* */
-/* Replacement for buggy Microsoft code */
+/* Replacement for Windows code */
/* */
/* */
/* */
#include <sys/types.h>
#include <sys/stat.h>
-#if defined(__WATCOMC__) && defined(__NT__)
-#define BUGGY_OS 1
-#include <errno.h>
-#include <windows.h>
+#if defined(_WIN32)
+# include <errno.h>
+# include <windows.h>
#endif
/* common */
-#if defined(BUGGY_OS)
+#if defined(_WIN32)
* way to express a number > 32 bit (known to me) but is able to do
* calculations with 64 bit integers, so we need to do it this way.
*/
- static const ULARGE_INTEGER Offs = { 0xB6109100UL, 0x00000020UL };
+ static const ULARGE_INTEGER Offs = { { 0xB6109100UL, 0x00000020UL } };
ULARGE_INTEGER V;
V.LowPart = T->dwLowDateTime;
V.HighPart = T->dwHighDateTime;
/* */
/* filestat.h */
/* */
-/* Replacement for buggy Microsoft code */
+/* Replacement for Windows code */
/* */
/* */
/* */
/* End of filestat.h */
#endif
-
-
-
/* */
/* filetime.c */
/* */
-/* Replacement for buggy Microsoft code */
+/* Replacement for Windows code */
/* */
/* */
/* */
-#if defined(__WATCOMC__) && defined(__NT__)
-#define BUGGY_OS 1
-#include <errno.h>
-#include <windows.h>
+#if defined(_WIN32)
+# include <errno.h>
+# include <windows.h>
#else
-#if defined(__WATCOMC__) || defined(_MSC_VER) || defined(__MINGW32__)
-/* The Windows compilers have the file in the wrong directory */
-# include <sys/utime.h>
-#else
-# include <sys/types.h> /* FreeBSD needs this */
+# include <sys/types.h> /* FreeBSD needs this */
# include <utime.h>
#endif
-#endif
/* common */
-#if defined(BUGGY_OS)
+#if defined(_WIN32)
* way to express a number > 32 bit (known to me) but is able to do
* calculations with 64 bit integers, so we need to do it this way.
*/
- static const ULARGE_INTEGER Offs = { 0xB6109100UL, 0x00000020UL };
+ static const ULARGE_INTEGER Offs = { { 0xB6109100UL, 0x00000020UL } };
ULARGE_INTEGER V;
V.QuadPart = ((unsigned __int64) T + Offs.QuadPart) * 10000000U;
FT->dwLowDateTime = V.LowPart;
#endif
-
-
-
/* */
/* filetime.h */
/* */
-/* Replacement for buggy Microsoft code */
+/* Replacement for Windows code */
/* */
/* */
/* */
/* End of filestat.h */
#endif
-
-
-
/* Return the result */
return F? F->Id : FILETYPE_UNKNOWN;
}
-
-
-
/* End of filetype.h */
-#endif
-
-
+#endif
/* End of fname.h */
#endif
-
-
-
D.V = Left.V / Right.V;
return D;
}
-
-
-
/* End of fp.h */
#endif
-
-
-
-
-
/* End of fragdefs.h */
#endif
-
-
-
/* Return the contents of String */
return SB_GetConstBuf (String);
}
-
-
-
/* End of gentype.h */
#endif
-
-
-
-
/* End of hashfunc.h */
#endif
-
-
-
/* End of hashtab.h */
#endif
-
-
-
/* End of hlldbgsyms.h */
#endif
-
-
-
/* End of inline.h */
#endif
-
-
-
PRECONDITION (S->Count > 0);
return S->Stack[--S->Count];
}
-
-
-
/* End of intstack.h */
-#endif
-
-
+#endif
/* End of inttypes.h */
-#endif
-
-
+#endif
/* End of libdefs.h */
#endif
-
-
-
/* End of lidefs.h */
#endif
-
-
-
/* Do the real thing */
return RecursiveMatch ((const unsigned char*) Source, (const unsigned char*) Pattern);
}
-
-
-
/* End of matchpat.h */
#endif
-
-
-
/* Zeropage is always zeropage */
ZpAddrSize = ADDR_SIZE_ZP;
}
-
-
/* End of mmodel.h */
#endif
-
-
-
/* End of objdefs.h */
#endif
-
-
-
/* End of optdefs.h */
#endif
-
-
-
vfprintf (F, Format, ap);
va_end (ap);
}
-
-
-
/* End of print.h */
#endif
-
-
-
-
/* End of scopedefs.h */
#endif
-
-
-
#include <stdlib.h>
#include <string.h>
+#if defined(_WIN32)
+# include <windows.h>
+#endif
#if defined(_MSC_VER)
/* Microsoft compiler */
# include <io.h>
-# pragma warning(disable : 4996)
#else
/* Anyone else */
# include <unistd.h>
-static void Add (SearchPath* P, const char* New)
+static void Add (SearchPaths* P, const char* New)
/* Cleanup a new search path and add it to the list */
{
/* Add a clean copy of the path to the collection */
-SearchPath* NewSearchPath (void)
+SearchPaths* NewSearchPath (void)
/* Create a new, empty search path list */
{
return NewCollection ();
-void AddSearchPath (SearchPath* P, const char* NewPath)
+void AddSearchPath (SearchPaths* P, const char* NewPath)
/* Add a new search path to the end of an existing list */
{
/* Allow a NULL path */
-void AddSearchPathFromEnv (SearchPath* P, const char* EnvVar)
+void AddSearchPathFromEnv (SearchPaths* P, const char* EnvVar)
/* Add a search path from an environment variable to the end of an existing
* list.
*/
-void AddSubSearchPathFromEnv (SearchPath* P, const char* EnvVar, const char* SubDir)
+void AddSubSearchPathFromEnv (SearchPaths* P, const char* EnvVar, const char* SubDir)
/* Add a search path from an environment variable, adding a subdirectory to
* the environment variable value.
*/
-void AddSubSearchPathFromWinBin (SearchPath* P, const char* SubDir)
+void AddSubSearchPathFromWinBin (SearchPaths* P, const char* SubDir)
{
/* Windows only:
* Add a search path from the running binary, adding a subdirectory to
* the parent directory of the directory containing the binary.
*/
-#if defined(_MSC_VER)
+#if defined(_WIN32)
char Dir[_MAX_PATH];
char* Ptr;
- if (_get_pgmptr (&Ptr) != 0) {
+ if (GetModuleFileName (NULL, Dir, _MAX_PATH) == 0) {
return;
}
- strcpy (Dir, Ptr);
/* Remove binary name */
Ptr = strrchr (Dir, '\\');
}
-int PushSearchPath (SearchPath* P, const char* NewPath)
+int PushSearchPath (SearchPaths* P, const char* NewPath)
/* Add a new search path to the head of an existing search path list, provided
* that it's not already there. If the path is already at the first position,
* return zero, otherwise return a non zero value.
-void PopSearchPath (SearchPath* P)
+void PopSearchPath (SearchPaths* P)
/* Remove a search path from the head of an existing search path list */
{
/* Remove the path at position 0 */
-char* SearchFile (const SearchPath* P, const char* File)
+char* SearchFile (const SearchPaths* P, const char* File)
/* Search for a file in a list of directories. Return a pointer to a malloced
* area that contains the complete path, if found, return 0 otherwise.
*/
SB_Done (&PathName);
return Name;
}
-
-
-
#define STRINGIZE(arg) _STRINGIZE(arg)
/* A search path is a pointer to the list */
-typedef struct Collection SearchPath;
+typedef struct Collection SearchPaths;
-SearchPath* NewSearchPath (void);
+SearchPaths* NewSearchPath (void);
/* Create a new, empty search path list */
-void AddSearchPath (SearchPath* P, const char* NewPath);
+void AddSearchPath (SearchPaths* P, const char* NewPath);
/* Add a new search path to the end of an existing list */
-void AddSearchPathFromEnv (SearchPath* P, const char* EnvVar);
+void AddSearchPathFromEnv (SearchPaths* P, const char* EnvVar);
/* Add a search path from an environment variable to the end of an existing
* list.
*/
-void AddSubSearchPathFromEnv (SearchPath* P, const char* EnvVar, const char* SubDir);
+void AddSubSearchPathFromEnv (SearchPaths* P, const char* EnvVar, const char* SubDir);
/* Add a search path from an environment variable, adding a subdirectory to
* the environment variable value.
*/
-void AddSubSearchPathFromWinBin (SearchPath* P, const char* SubDir);
+void AddSubSearchPathFromWinBin (SearchPaths* P, const char* SubDir);
/* Windows only:
* Add a search path from the running binary, adding a subdirectory to
* the parent directory of the directory containing the binary.
*/
-int PushSearchPath (SearchPath* P, const char* NewPath);
+int PushSearchPath (SearchPaths* P, const char* NewPath);
/* Add a new search path to the head of an existing search path list, provided
* that it's not already there. If the path is already at the first position,
* return zero, otherwise return a non zero value.
*/
-void PopSearchPath (SearchPath* P);
+void PopSearchPath (SearchPaths* P);
/* Remove a search path from the head of an existing search path list */
-char* SearchFile (const SearchPath* P, const char* File);
+char* SearchFile (const SearchPaths* P, const char* File);
/* Search for a file in a list of directories. Return a pointer to a malloced
* area that contains the complete path, if found, return 0 otherwise.
*/
/* End of searchpath.h */
-#endif
-
-
+#endif
/* End of segdefs.h */
#endif
-
-
-
/* Name is ok */
return 1;
}
-
-
-
/* End of segnames.h */
#endif
-
-
-
/* End of shift.h */
#endif
-
-
-
SB_VPrintf (S, Format, ap);
va_end (ap);
}
-
-
-
/* End of strbuf.h */
#endif
-
-
-
{
return CollCount (&P->Entries);
}
-
-
-
/* End of strpool.h */
#endif
-
-
-
CHECK (S->Count < sizeof (S->Stack) / sizeof (S->Stack[0]));
S->Stack[S->Count++] = xstrdup (Val);
}
-
-
-
/* End of strstack.h */
-#endif
-
-
+#endif
/* End of strutil.h */
#endif
-
-
-
/* End of symdefs.h */
#endif
-
-
-
/* Return the array entry */
return GetTargetProperties (Target)->Name;
}
-
/* End of target.h */
-#endif
-
-
+#endif
CHECK (Index > 0 && Index < sizeof (Tab));
Tab[Index] = C;
}
-
-
-
-
-
/* End of tgttrans.h */
#endif
-
-
-
/* End of va_copy.h */
-#endif
-
-
+#endif
-#include "version.h"
+/* common */
#include "xsprintf.h"
+#include "searchpath.h"
+#include "version.h"
#define VER_MAJOR 2U
#define VER_MINOR 14U
-#define VER_PATCH 0U
-#define VER_RC 0U
-
const char* GetVersionAsString (void)
/* Returns the version number as a string in a static buffer */
{
- static char Buf[20];
-#if defined(VER_RC) && (VER_RC > 0U)
- xsnprintf (Buf, sizeof (Buf), "%u.%u.%u-rc%u", VER_MAJOR, VER_MINOR, VER_PATCH, VER_RC);
+ static char Buf[60];
+#if defined(GIT_SHA)
+ xsnprintf (Buf, sizeof (Buf), "%u.%u - Git %s", VER_MAJOR, VER_MINOR, STRINGIZE (GIT_SHA));
#else
- xsnprintf (Buf, sizeof (Buf), "%u.%u.%u", VER_MAJOR, VER_MINOR, VER_PATCH);
+ xsnprintf (Buf, sizeof (Buf), "%u.%u", VER_MAJOR, VER_MINOR);
#endif
return Buf;
}
unsigned GetVersionAsNumber (void)
/* Returns the version number as a combined unsigned for use in a #define */
{
- return ((VER_MAJOR * 0x100) + (VER_MINOR * 0x10) + VER_PATCH);
+ return ((VER_MAJOR * 0x100) + (VER_MINOR * 0x10));
}
-
-
-
/* End of version.h */
#endif
-
-
-
-
{
return memcpy (xmalloc (Size), Buf, Size);
}
-
-
-
/* End of xmalloc.h */
#endif
-
-
-
CHECK (Res >= 0 && (unsigned) (Res+1) < BufSize);
return Res;
}
-
-
-
/* End of xsprintf.h */
#endif
-
-
-
-
/* Close the include file ignoring errors (we were just reading). */
(void) fclose (F);
}
-
-
-
/* End of asminc.h */
-#endif
-
-
+#endif
/* Return the attribute */
return (AttrTab[Addr] & atLabelMask);
}
-
-
-
/* End of attrtab.h */
-#endif
-
-
+#endif
{
PC = CodeStart;
}
-
-
-
/* End of code.h */
-#endif
-
-
+#endif
/* Return the label if any */
return CommentTab[Addr];
}
-
-
-
/* End of comments.h */
-#endif
-
-
+#endif
/* Return the number of bytes output */
return ByteCount;
}
-
-
-
/* End of data.h */
-#endif
-
-
+#endif
va_end (ap);
exit (EXIT_FAILURE);
}
-
-
-
/* End of error.h */
#endif
-
-
-
unsigned CCol = 49; /* Comment column */
unsigned TCol = 81; /* Text bytes column */
unsigned BytesPerLine = 8; /* Max. number of data bytes per line */
-
-
-
/* End of global.h */
#endif
-
-
-
}
SeparatorLine ();
}
-
-
-
/* End of handler.h */
-#endif
-
-
+#endif
InfoCloseInput ();
}
}
-
-
-
-
-
-
/* End of infofile.h */
-#endif
-
-
+#endif
SeparatorLine ();
}
-
-
-
/* End of labels.h */
-#endif
-
-
+#endif
/* Done */
return EXIT_SUCCESS;
}
-
-
-
{ "inc", 3, flUseLabel|flAbsOverride, OH_AbsoluteX }, /* $fe */
{ "", 1, flIllegal, OH_Illegal, }, /* $ff */
};
-
-
-
/* End of opc6502.h */
-#endif
-
-
+#endif
{ "inc", 3, flUseLabel|flAbsOverride, OH_AbsoluteX }, /* $fe */
{ "isc", 3, flUseLabel|flAbsOverride, OH_AbsoluteX }, /* $ff */
};
-
-
-
-
{ "inc", 3, flUseLabel|flAbsOverride, OH_AbsoluteX }, /* $fe */
{ "sbc", 4, flUseLabel, OH_AbsoluteLongX }, /* $ff */
};
-
-
-
/* End of opc65816.h */
-#endif
-
-
+#endif
{ "inc", 3, flUseLabel|flAbsOverride, OH_AbsoluteX }, /* $fe */
{ "bbs7", 3, flUseLabel, OH_BitBranch }, /* $ff */
};
-
-
-
/* End of opc65c02.h */
-#endif
-
-
+#endif
{ "inc", 3, flUseLabel|flAbsOverride, OH_AbsoluteX }, /* $fe */
{ "", 1, flIllegal, OH_Illegal, }, /* $ff */
};
-
-
-
/* End of opc65sc02.h */
-#endif
-
-
+#endif
/* End of opcdesc.h */
-#endif
-
-
+#endif
/* End of opchuc6280.h */
-#endif
-
-
+#endif
{ "inc", 3, flUseLabel|flAbsOverride, OH_AbsoluteX }, /* $fe */
{ "clb", 2, flUseLabel, OH_ZeroPageBit }, /* $ff */
};
-
-
-
/* End of opcm740.h */
-#endif
-
-
+#endif
default: Error ("Unsupported CPU");
}
}
-
-
-
-
/* End of opctable.h */
-#endif
-
-
+#endif
LineFeed ();
LineFeed ();
}
-
-
-
/* End of output.h */
-#endif
-
-
-
+#endif
InputFile = 0;
}
}
-
-
-
-
/* End of scanner.h */
-#endif
-
-
+#endif
/* Mark the addresses within the segment */
MarkRange (Start, End, atSegment);
}
-
-
-
/* End of segment.h */
#endif
-
-
-
/* End of asserts.h */
#endif
-
-
-
D->F = 0;
D->Filename = 0;
}
-
-
-
-
-
/* End of bin.h */
#endif
-
-
-
/* Return the flag */
return Reloc;
}
-
-
-
/* End of binfmt.h */
#endif
-
-
-
/* Return the value */
return Val;
}
-
-
-
/* End of cfgexpr.h */
-#endif
-
-
+#endif
printf ("CONDES(%u): %u symbols\n", Type, CollCount (ExpList));
}
}
-
-
-
/* End of condes.h */
#endif
-
-
-
/* End of config.h */
#endif
-
-
-
-
-
Error ("Error closing debug file `%s': %s", DbgFileName, strerror (errno));
}
}
-
-
-
/* End of dbgfile.h */
#endif
-
-
-
/* End of dbgsyms.h */
#endif
-
-
-
exit (EXIT_FAILURE);
}
-
-
-
/* End of error.h */
#endif
-
-
-
GetSourceName (LI),
GetSourceLine (LI));
}
-
-
-
-
/* End of exports.h */
#endif
-
-
-
-
/* End of expr.h */
#endif
-
-
-
{
return E->List;
}
-
-
-
-
/* End of extsyms.h */
#endif
-
-
-
-
fputc ('\n', F);
}
}
-
-
-
/* End of fileinfo.h */
-#endif
-
-
+#endif
/* End of fileio.h */
#endif
-
-
-
-SearchPath* LibSearchPath; /* Library path */
-SearchPath* ObjSearchPath; /* Object file path */
-SearchPath* CfgSearchPath; /* Config file path */
+SearchPaths* LibSearchPath; /* Library path */
+SearchPaths* ObjSearchPath; /* Object file path */
+SearchPaths* CfgSearchPath; /* Config file path */
-SearchPath* LibDefaultPath; /* Default Library path */
-SearchPath* ObjDefaultPath; /* Default Object file path */
-SearchPath* CfgDefaultPath; /* Default Config file path */
+SearchPaths* LibDefaultPath; /* Default Library path */
+SearchPaths* ObjDefaultPath; /* Default Object file path */
+SearchPaths* CfgDefaultPath; /* Default Config file path */
AddSubSearchPathFromEnv (CfgDefaultPath, "CC65_HOME", "cfg");
/* Add some compiled-in search paths if defined at compile time. */
-#if defined(LD65_LIB)
+#if defined(LD65_LIB) && !defined(_WIN32)
AddSearchPath (LibDefaultPath, STRINGIZE (LD65_LIB));
#endif
-#if defined(LD65_OBJ)
+#if defined(LD65_OBJ) && !defined(_WIN32)
AddSearchPath (ObjDefaultPath, STRINGIZE (LD65_OBJ));
#endif
-#if defined(LD65_CFG)
+#if defined(LD65_CFG) && !defined(_WIN32)
AddSearchPath (CfgDefaultPath, STRINGIZE (LD65_CFG));
#endif
AddSubSearchPathFromWinBin (ObjDefaultPath, "lib");
AddSubSearchPathFromWinBin (CfgDefaultPath, "cfg");
}
-
-
-
-extern SearchPath* LibSearchPath; /* Library path */
-extern SearchPath* ObjSearchPath; /* Object file path */
-extern SearchPath* CfgSearchPath; /* Config file path */
+extern SearchPaths* LibSearchPath; /* Library path */
+extern SearchPaths* ObjSearchPath; /* Object file path */
+extern SearchPaths* CfgSearchPath; /* Config file path */
-extern SearchPath* LibDefaultPath; /* Default Library path */
-extern SearchPath* ObjDefaultPath; /* Default Object file path */
-extern SearchPath* CfgDefaultPath; /* Default Config file path */
+extern SearchPaths* LibDefaultPath; /* Default Library path */
+extern SearchPaths* ObjDefaultPath; /* Default Object file path */
+extern SearchPaths* CfgDefaultPath; /* Default Config file path */
/* End of filepath.h */
-#endif
-
-
+#endif
/* Return the new fragment */
return F;
}
-
-
-
/* End of fragment.h */
#endif
-
-
-
-
const char* MapFileName = 0; /* Name of the map file */
const char* LabelFileName = 0; /* Name of the label file */
const char* DbgFileName = 0; /* Name of the debug file */
-
-
-
/* End of global.h */
#endif
-
-
-
fprintf (F, "lib\tid=%u,name=\"%s\"\n", L->Id, GetString (L->Name));
}
}
-
-
-
-
/* End of library.h */
#endif
-
-
-
/* End of lineinfo.h */
-#endif
-
-
+#endif
/* Return an apropriate exit code */
return EXIT_SUCCESS;
}
-
-
-
Error ("Error closing label file `%s': %s", LabelFileName, strerror (errno));
}
}
-
-
-
/* End of mapfile.h */
#endif
-
-
-
/* ...and return it */
return M;
}
-
-
-
-
/* End of memarea.h */
#endif
-
-
-
-
-
D->F = 0;
D->Filename = 0;
}
-
-
-
-
/* End of o65.h */
#endif
-
-
-
/* End of objdata.h */
#endif
-
-
-
-
-
*/
FreeObjStrings (O);
}
-
-
-
-
/* End of objfile.h */
#endif
-
-
-
/* End of scanner.h */
-#endif
-
-
+#endif
/* End of scopes.h */
#endif
-
-
-
/* End of segments.h */
#endif
-
-
-
-
/* Free the string buffer */
SB_Done (&SpanType);
}
-
-
-
/* End of span.h */
-#endif
-
-
+#endif
*/
SP_AddStr (StrPool, "<invalid message #0>");
}
-
-
-
-
/* End of spool.h */
#endif
-
-
-
-
/* Allocate a type pool */
TypePool = NewStringPool (137);
}
-
-
-
/* End of tpool.h */
#endif
-
-
-
-
/* Destroy the string pool */
DestroyStrPool (&StrPool);
}
-
-
-
-
/* End of dump.h */
#endif
-
-
-
-
va_end (ap);
exit (EXIT_FAILURE);
}
-
-
-
/* End of error.h */
#endif
-
-
-
CollAppend (C, ReadStr (F));
}
}
-
-
-
/* End of fileio.h */
#endif
-
-
-
unsigned What = 0; /* What should get dumped? */
-
-
-
/* End of global.h */
#endif
-
-
-
/* Success */
return EXIT_SUCCESS;
}
-
-
-
va_end (ap);
exit (EXIT_FAILURE);
}
-
-
-
/* End of error.h */
#endif
-
-
-
/* End of memory.h */
#endif
-
-
-
-
#include <string.h>
#include <stdlib.h>
#include <fcntl.h>
+#if defined(_WIN32)
+# define O_INITIAL O_BINARY
+#else
+# define O_INITIAL 0
+#endif
#if defined(_MSC_VER)
/* Microsoft compiler */
# include <io.h>
-# pragma warning(disable : 4996)
-# define O_INITIAL O_BINARY
#else
/* Anyone else */
# include <unistd.h>
-# define O_INITIAL 0
#endif
/* common */
Error ("Error closing output file `%s': %s", Name, strerror (errno));
}
}
-
-
-
/* End of asm.h */
#endif
-
-
-
/* Free the collection itself */
FreeCollection (C);
}
-
-
-
/* End of attr.h */
#endif
-
-
-
Error ("Error closing output file `%s': %s", Name, strerror (errno));
}
}
-
-
-
/* End of bin.h */
#endif
-
-
-
/* Return the pixel */
return B->Data[Y * B->Width + X];
}
-
-
-
/* End of bitmap.h */
#endif
-
-
-
Error ("Error closing output file `%s': %s", Name, strerror (errno));
}
}
-
-
-
/* End of c.h */
#endif
-
-
-
/* End of color.h */
#endif
-
-
-
fprintf (F, " %s\n", ConverterMap[I].Format);
}
}
-
/* End of convert.h */
#endif
-
-
-
va_end (ap);
exit (EXIT_FAILURE);
}
-
-
-
/* End of error.h */
#endif
-
-
-
/* End of fileio.h */
#endif
-
-
-
/* Return the converted bitmap */
return D;
}
-
-
-
/* Return the converted bitmap */
return D;
}
-
-
-
/* End of geosicon.h */
#endif
-
-
-
/* Call the format specific read */
return InputFormatTable[F->Id].Read (A);
}
-
-
-
/* End of input.h */
#endif
-
-
-
/* Return the converted bitmap */
return D;
}
-
-
-
/* End of koala.h */
#endif
-
-
-
/* Return the converted bitmap */
return D;
}
-
-
-
/* End of lynxsprite.h */
#endif
-
-
-
/* Success */
return EXIT_SUCCESS;
}
-
-
-
/* Call the format specific write */
OutputFormatTable[F->Id].Write (Data, A, B);
}
-
-
-
/* End of output.h */
#endif
-
-
-
(((unsigned long) C->R) << 0));
}
}
-
-
-
/* End of palette.h */
#endif
-
-
-
/* Return the bitmap */
return B;
}
-
-
-
/* End of pcx.h */
#endif
-
-
-
/* End of pixel.h */
#endif
-
-
-
/* Return the converted bitmap */
return D;
}
-
-
-
/* End of raw.h */
-#endif
-
-
+#endif
/* Return the converted bitmap */
return D;
}
-
-
-
/* End of vic2sprite.h */
#endif
-
-
-