removed sdcc and added maccer, fixed some compilation issues

This commit is contained in:
Zal0
2020-04-05 10:42:08 +02:00
parent e2f418bb31
commit 9bb880035f
5 changed files with 23 additions and 14 deletions

View File

@@ -27,10 +27,13 @@ TARGETCXXFLAGS =
# Directory containing the source to sdcc
SDCCDIR = $(TOPDIR)/sdcc
#SDCCDIR = $(ZGB_PATH)/../env/SDCC
# Directory containing the source to gbdk-lib
GBDKLIBDIR = $(TOPDIR)/gbdk-lib
# Directory containing the source to gbdk-support
GBDKSUPPORTDIR = $(TOPDIR)/gbdk-support
# Directory containing the source to maccer
MACCERDIR = $(TOPDIR)/maccer
# Base setup
# Extension to add to executables
@@ -50,7 +53,7 @@ NOISELOG = $(TOPDIR)/noise.log
all: native-build
clean: sdcc-clean gbdk-support-clean gbdk-lib-clean
clean: maccer-clean gbdk-support-clean gbdk-lib-clean
distclean: clean build-dir-clean
@@ -92,9 +95,9 @@ src: clean
tar czf gbdk-$(VER).tar.gz gbdk
# Base rules
gbdk-build: sdcc-build gbdk-support-build gbdk-lib-build
gbdk-build: maccer-build gbdk-support-build gbdk-lib-build
gbdk-install: sdcc-install gbdk-support-install gbdk-lib-install
gbdk-install: gbdk-support-install gbdk-lib-install
# Directories
build-bin-dir:
@@ -179,6 +182,13 @@ gbdk-lib-examples-makefile:
$(MAKE) -C $(BUILDDIR)/examples/gb make.bat
unix2dos $(BUILDDIR)/examples/gb/make.bat
# Rules for maccer
maccer-build:
$(MAKE) -C $(MACCERDIR)
maccer-clean:
$(MAKE) -C $(MACCERDIR) clean
# Final binary
binary: binary-tidyup
ifeq ($(ARCHIVETYPE),zip)

View File

@@ -8,29 +8,29 @@ MODEL = small
endif
ifndef PORTS
PORTS = gbz80 z80
PORTS = gbz80
endif
ifndef PLATFORMS
PLATFORMS = gb consolez80 rrgb
PLATFORMS = gb
endif
ifndef SDCCLIB
SDCCLIB = /home/michaelh/projects/sdcc
SDCCLIB = $(ZGB_PATH)/../env/SDCC
endif
SCC = $(SDCCLIB)/bin/sdcc
GBCC = $(SDCCLIB)/bin/lcc
AS_Z80 = $(SDCCLIB)/bin/as-z80
AS_Z80 = $(SDCCLIB)/bin/sdasz80
ifeq ($(RGBDS),1)
AS_GBZ80 = rgbasm
else
AS_GBZ80 = $(SDCCLIB)/bin/as-gbz80
AS_GBZ80 = $(SDCCLIB)/bin/sdasgb
endif
CLEANSPEC = *.o *.cdb *.sym *.lst *~ *.asm
CFLAGS = -I$(TOPDIR)/include --model-$(MODEL)
CFLAGS = -I$(TOPDIR)/include -DSDCC_z80 -D__gbz80
CFLAGS += -m$(PORT) -DGBDK=1
CC = $(SCC)
BUILD = $(TOPDIR)/build/$(MODEL)/$(ASM)/$(THIS)

View File

@@ -8,8 +8,8 @@
#error gbz80 only.
#endif
#define NONBANKED nonbanked
#define BANKED banked
#define NONBANKED
#define BANKED
/** Signed eight bit.
*/

View File

@@ -508,7 +508,7 @@ _mululong (unsigned long a, unsigned long b) // in future: _mullong
t.i.hi = bcast(a)->b.b0 * bcast(b)->b.b2; // A
t.i.lo = bcast(a)->b.b0 * bcast(b)->b.b0; // A
_asm ;johan _endasm;
__asm ;johan __endasm;
t.b.b3 += bcast(a)->b.b3 *
bcast(b)->b.b0; // G
t.b.b3 += bcast(a)->b.b2 *

View File

@@ -4,8 +4,7 @@ $(LIB): pre $(OBJ)
pre: set-model build-dir
$(BUILD)/%.o: %.c
$(CC) $(CFLAGS) -c $<
mv `basename $< .c`.o $@
$(CC) $(CFLAGS) -c -o $@ $<
$(BUILD)/%.o: %.s
$(AS) -plosgff $@ $<