1 # Port specification for the z80 port running ontop of the Java based
2 # 'ConsoleZ80' emulator.
4 # PENDING: Path to gbdk-lib for stdarg
5 GBDK_LIB = ../../../gbdk-lib
6 RRZ80 = $(SDCC_EXTRA_DIR)/emu/rrz80/rrz80
8 SDCCFLAGS += -I$(GBDK_LIB)/include --lesspedantic
12 # Needs parts of gbdk-lib, namely the internal mul/div/mod functions.
13 EXTRAS = fwk/lib/testfwk$(OBJEXT) ports/$(PORT)/support$(OBJEXT) \
14 $(GBDK_LIB)/libc/asm/z80/mul$(OBJEXT) \
15 $(GBDK_LIB)/libc/asm/z80/div$(OBJEXT)
17 # Rule to generate a Emulator .bin file from the .ihx linker output.
19 ../makebin/makebin -s 32768 < $< > $@ # Must be 32768 due to a bug in ConsoleZ80
21 # Rule to link into .ihx
22 %.ihx: %$(OBJEXT) $(EXTRAS)
23 ../../bin/link-z80 -n -- -b_CODE=0x200 -b_DATA=0x8000 -j -i $@ $< $(EXTRAS)
25 %$(OBJEXT): %.c fwk/include/*.h
26 $(SDCC) $(SDCCFLAGS) -c $<
29 ../../bin/as-z80 -plosgff $@ $<
32 ../../bin/as-z80 -plosgff $@ $<
34 # PENDING: Path to sdcc-extra
37 $(RRZ80) --maxruntime=3 --mapfile=$(<:.bin=.sym) $< > $@
38 -grep -n FAIL $@ /dev/null || true