diff --git a/Makefile b/Makefile index f46cd0ce..73811a4a 100644 --- a/Makefile +++ b/Makefile @@ -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) diff --git a/gbdk-lib/Makefile.common b/gbdk-lib/Makefile.common index ecc34680..a69b1e68 100644 --- a/gbdk-lib/Makefile.common +++ b/gbdk-lib/Makefile.common @@ -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) diff --git a/gbdk-lib/include/asm/gbz80/types.h b/gbdk-lib/include/asm/gbz80/types.h index e0c1f082..15722dec 100644 --- a/gbdk-lib/include/asm/gbz80/types.h +++ b/gbdk-lib/include/asm/gbz80/types.h @@ -8,8 +8,8 @@ #error gbz80 only. #endif -#define NONBANKED nonbanked -#define BANKED banked +#define NONBANKED +#define BANKED /** Signed eight bit. */ diff --git a/gbdk-lib/libc/_mullong.c b/gbdk-lib/libc/_mullong.c index bf8a355f..53a9fd5a 100644 --- a/gbdk-lib/libc/_mullong.c +++ b/gbdk-lib/libc/_mullong.c @@ -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 * diff --git a/gbdk-lib/libc/rules-asxxxx.mk b/gbdk-lib/libc/rules-asxxxx.mk index c42a7a62..67df1e29 100644 --- a/gbdk-lib/libc/rules-asxxxx.mk +++ b/gbdk-lib/libc/rules-asxxxx.mk @@ -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 $@ $<