ETH=enp0s25 #ETH=eth0 RM = rm -f DIRNAME = $(shell basename $(PWD)) X64 = $(shell which x64sc) X64CAPS = $(shell /sbin/getcap $(X64) 2>/dev/null|grep cap_net_raw || /bin/true) X64OPTS = -default +sound # if emulator has not raw net capability, run using sudo ifeq ($(X64CAPS),) X64 := sudo $(X64) endif all: disk zip disk: rrnetmk3.d64 rrnetmk3.d64: firmware tool mk3flasher -c1541 -format "rrnetmk3,00" d64 $@ \ -write rrnet-tool.prg "rrnet-tool" \ -write rrnetmk3flasher.prg "rrnetmk3flasher" \ -write originalflasher.prg "originalflasher" \ -list .PHONY: firmware tool mk3flasher firmware: svnversion.inc $(MAKE) -C firmware tool: svnversion.inc $(MAKE) -C tool mk3flasher: svnversion.inc $(MAKE) -C mk3flasher CHECKFILES=\ firmware/Makefile firmware/rrnetmk3.s \ tool/Makefile tool/tool.s \ mk3flasher/Makefile mk3flasher/mk3flasher.s \ Makefile readme.txt svnversion.inc: $(CHECKFILES) echo "; autogenerated, do not edit" > $@ LANGUAGE="en" svn info $(CHECKFILES) | grep -i "revision" | sort -r | grep -i "revision" -m 1 | sed 's/.*: \(.*\)/.define SVNREVISION "\1"/g' >> $@ [ ! -d .git ] || echo ".define SVNREVISION \"$$(git rev-list --count HEAD)\"" >> $@ clean: $(MAKE) -C firmware $@ $(MAKE) -C tool $@ $(MAKE) -C mk3flasher $@ distclean: clean $(RM) rrnet-tool.prg $(RM) rrnetmk3flasher.prg $(RM) originalflasher.prg $(RM) rrnetmk3.d64 zip: firmware tool mk3flasher rm -f rrnetmk3-firmware.zip rm -f rrnetmk3-firmware-source.zip rm -f ../rrnetmk3-firmware-source -zip -q rrnetmk3-firmware.zip \ license.txt \ readme.txt \ rrnetmk3.d64 cd .. ; ln -s $(DIRNAME) rrnetmk3-firmware-source -cd .. ; zip -q rrnetmk3-firmware-source/rrnetmk3-firmware-source.zip \ rrnetmk3-firmware-source/Makefile \ rrnetmk3-firmware-source/svnversion.inc \ rrnetmk3-firmware-source/todo.txt \ rrnetmk3-firmware-source/license.txt \ rrnetmk3-firmware-source/readme.txt \ rrnetmk3-firmware-source/tool/Makefile \ rrnetmk3-firmware-source/tool/*.s \ rrnetmk3-firmware-source/mk3flasher/Makefile \ rrnetmk3-firmware-source/mk3flasher/*.s \ rrnetmk3-firmware-source/mk3flasher/*.i \ rrnetmk3-firmware-source/firmware/Makefile \ rrnetmk3-firmware-source/firmware/*.s \ rrnetmk3-firmware-source/firmware/*.inc \ rrnetmk3-firmware-source/firmware/c64-cbm80.ld rm ../rrnetmk3-firmware-source testmk3flasher: mk3flasher firmware disk dd if=/dev/zero ibs=8k count=1 > rrnetmk3.bin # VICE bug! cs8900ioif must be set before activating ethernet device $(X64) $(X64OPTS) -ethernetioif $(ETH) -cartrrnet rrnetmk3.bin -rrnetmk3flash rrnetmk3.d64 rm -f rrnetmk3.bin rrnetmk3.crt # 8k ROM, CS8900a at De00 # examples: 64nic/fb-net in rrnet compatible mode test64nic: firmware cp firmware/firmware.bin rrnetmk3.bin # VICE bug! cs8900ioif must be set before activating ethernet device # VICE bug! "carrier cartridge" must be activated first, then ethernet $(X64) $(X64OPTS) -ethernetioif $(ETH) -cart8 rrnetmk3.bin -rrnet rm -f rrnetmk3.bin rrnetmk3.crt # FIXME: this doesnt work yet, the firmware does not support TFE style mapping yet # 8k ROM, CS8900a at De00 # examples: TFE or 64nic/fb-net in TFE compatible mode testtfe: firmware cp firmware/firmware.bin rrnetmk3.bin # VICE bug! cs8900ioif must be set before activating ethernet device # VICE bug! "carrier cartridge" must be activated first, then ethernet $(X64) $(X64OPTS) -ethernetioif $(ETH) -cart8 rrnetmk3.bin -tfe rm -f rrnetmk3.bin rrnetmk3.crt # 8k ROM, CS8900a at De00 # examples: RRNET MK3 testrrnetmk3: firmware cp firmware/firmware.bin rrnetmk3.bin cartconv -t rrnet -i rrnetmk3.bin -o rrnetmk3.crt # VICE bug! cs8900ioif must be set before activating ethernet device $(X64) $(X64OPTS) -ethernetioif $(ETH) -cartcrt rrnetmk3.crt rm -f rrnetmk3.bin rrnetmk3.crt # 8k ROM, CS8900a at De00 # examples: RRNET MK3 testoriginal: mk3flasher/original.bin cp $< rrnetmk3.bin cartconv -t rrnet -i rrnetmk3.bin -o rrnetmk3.crt # VICE bug! cs8900ioif must be set before activating ethernet device $(X64) $(X64OPTS) -ethernetioif $(ETH) -cartcrt rrnetmk3.crt rm -f rrnetmk3.bin rrnetmk3.crt # 8k ROM, CS8900a at De02 # examples: retro replay, nordic replay testrr: firmware cp firmware/firmware.bin rrnetmk3.bin dd if=/dev/zero ibs=8k count=3 >> rrnetmk3.bin cartconv -t rr -i rrnetmk3.bin -o rrnetmk3.crt # VICE bug! cs8900ioif must be set before activating ethernet device # VICE bug! clockport device must be set first, then "carrier cartridge" $(X64) $(X64OPTS) -ethernetioif $(ETH) -rrclockportdevice 2 -cartcrt rrnetmk3.crt rm -f rrnetmk3.bin rrnetmk3.crt # 8k ROM, CS8900a at De02 # examples: mmc64 testmmc64: firmware cp firmware/firmware.bin rrnetmk3.bin cartconv -t mmc64 -i rrnetmk3.bin -o rrnetmk3.crt # VICE bug! cs8900ioif must be set before activating ethernet device # VICE bug! clockport device must be set first, then "carrier cartridge" $(X64) $(X64OPTS) -ethernetioif $(ETH) -mmc64clockportdevice 2 -cartcrt rrnetmk3.crt rm -f rrnetmk3.bin rrnetmk3.crt # FIXME: this doesnt work yet, the emulation is broken too # 8k ROM, CS8900a at De02 # examples: mmc replay testmmcr: firmware cp firmware/firmware.bin rrnetmk3.bin dd if=/dev/zero ibs=8k count=3 >> rrnetmk3.bin dd if=/dev/zero ibs=8k count=3 >> rrnetmk3.bin cat firmware/firmware.bin >> rrnetmk3.bin cartconv -t mmcr -i rrnetmk3.bin -o rrnetmk3.crt # VICE bug! cs8900ioif must be set before activating ethernet device # VICE bug! clockport device must be set first, then "carrier cartridge" $(X64) $(X64OPTS) -ethernetioif $(ETH) -mmcrclockportdevice 2 -cartcrt rrnetmk3.crt rm -f rrnetmk3.bin rrnetmk3.crt