#MCU = atmega8
MCU = atmega328P
-#F_CPU = 24576000
F_CPU = 20000000
-BAUD = 115200
-DRAM_DQ_ORDER = 1
+#BAUD = 19200
+BAUD = 57600
+#BAUD = 115200
-TARGET = z80
-ASRC = z80.asm
+DRAM_8BIT = 1
+
+TARGET = avrcpm
+ASRC = avrcpm.asm
+
+ASRC += config.inc macros.inc init.asm dram-refresh.asm timer.asm utils.asm
+ASRC += mmc.asm mmc-old.asm virt_ports.asm
+ASRC += dsk_cpm.asm dsk_fat16.asm dsk_fsys.asm dsk_mgr.asm dsk_ram.asm
+ASRC += 8080int.asm 8080int-jmp.asm 8080int-t3.asm 8080int-t3-jmp.asm
+
+ifneq ($(DRAM_8BIT),0)
+ ASRC += dram-8bit.inc dram-8bit.asm sw-uart.asm
+else
+ ASRC += dram-4bit.inc dram-4bit.asm hw-uart.asm
+endif
# Place -D or -U options here
-CDEFS = -DF_CPU=$(F_CPU) -DBAUD=$(BAUD) -D$(MCU) -DDRAM_DQ_ORDER=$(DRAM_DQ_ORDER)
+CDEFS = -DF_CPU=$(F_CPU) -DBAUD=$(BAUD) -D$(MCU) -DDRAM_8BIT=$(DRAM_8BIT)
WINEPATH = C:/Programme/Atmel/AVR\ Tools/AvrAssembler2
DEFS = $(WINEPATH)/Appnotes
# Define all listing files.
-LST = $(ASRC:.asm=.lst)
+#LST = $(ASRC:.asm=.lst)
# Combine all necessary flags and optional flags.
# Add target processor to flags.
ALL_ASFLAGS = $(ASFLAGS)
+.PHONY: all hex eep lst map program flash eeprom tags clean
+
# Default target.
all: hex lst
-hex: $(TARGET).hex
-eep: $(TARGET).eep
-lst: $(TARGET).lst
-map: $(TARGET).map
+hex: $(TARGET).hex $(ASRC)
+eep: $(TARGET).eep $(ASRC)
+lst: $(TARGET).lst $(ASRC)
+map: $(TARGET).map $(ASRC)
# Program the device.
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_EEPROM)
+$(TARGET).hex: $(ASRC)
+$(TARGET).eep: $(ASRC)
+$(TARGET).lst: $(ASRC)
+$(TARGET).map: $(ASRC)
-.SUFFIXES: .hex .eep .lst
+#.SUFFIXES: .hex .eep .lst
+.SUFFIXES:
%.hex: %.asm
$(AS) $(ALL_ASFLAGS) -fI -o $@ $<
clean:
$(REMOVE) $(TARGET).hex $(TARGET).eep $(TARGET).obj $(TARGET).map $(TARGET).lst
-
-.PHONY: all hex eep lst map program flash eeprom tags clean
-