Example program for the Cidco MailStation Z80 computer

mailstation.h: Setup RUN_/SLOT_ defs like in addrs-*.inc

+23 -2
+4 -2
Makefile
··· 37 37 38 38 .if ${LOC:L} == "flash" 39 39 BASE_ADDR= 0x4000 40 + DEFS+= -DLOC_FLASH 40 41 .elif ${LOC:L} == "ram" 41 42 BASE_ADDR= 0x8000 43 + DEFS+= -DLOC_RAM 42 44 .else 43 45 .BEGIN: 44 46 @echo 'LOC must be "flash" or "ram"' ··· 88 90 .for S in $(SRCS) 89 91 REL_FILES+= ${S:R}.rel 90 92 ${S:R}.rel: $(S) 91 - $(SDCC) -c ${.TARGET} $(SRCDIR)/$(S) 93 + $(SDCC) $(DEFS) -c ${.TARGET} $(SRCDIR)/$(S) 92 94 .endfor 93 95 94 96 .for S in $(ASM_SRCS) 95 97 REL_FILES+= ${S:R}.rel 96 98 ${S:R}.rel: $(S) 97 - $(ASZ80) -o ${.TARGET} ${ADDRS_INC} $> 99 + $(ASZ80) $(DEFS) -o ${.TARGET} ${ADDRS_INC} $> 98 100 .endfor 99 101 100 102 # link
+19
lib/mailstation.h
··· 44 44 __sfr __at(0x1c) rtc10years; 45 45 __sfr __at(0x28) port28; 46 46 47 + /* defined according to whether we're running from RAM or flash */ 48 + #ifdef LOC_RAM 49 + #define RUN_ADDR 0x8000 50 + #define RUN_DEVICE 0x8 51 + #define RUN_PAGE 0x7 52 + #define SLOT_ADDR 0x4000 53 + #define SLOT_DEVICE 0x6 54 + #define SLOT_PAGE 0x5 55 + #elif defined(LOC_FLASH) 56 + #define RUN_ADDR 0x4000 57 + #define RUN_DEVICE 0x6 58 + #define RUN_PAGE 0x5 59 + #define SLOT_ADDR 0x8000 60 + #define SLOT_DEVICE 0x8 61 + #define SLOT_PAGE 0x7 62 + #else 63 + #error "no LOC_RAM or LOC_FLASH defined" 64 + #endif 65 + 47 66 /* LCD parameters (2 screens) */ 48 67 #define LCD_WIDTH (160 * 2) // 320 49 68 #define LCD_HEIGHT 128