tangled
alpha
login
or
join now
jcs.org
/
MailStation-Example
0
fork
atom
Example program for the Cidco MailStation Z80 computer
0
fork
atom
overview
issues
pulls
pipelines
mailstation.h: Setup RUN_/SLOT_ defs like in addrs-*.inc
jcs.org
4 years ago
be48ddd7
44dd58bc
+23
-2
2 changed files
expand all
collapse all
unified
split
Makefile
lib
mailstation.h
+4
-2
Makefile
···
37
37
38
38
.if ${LOC:L} == "flash"
39
39
BASE_ADDR= 0x4000
40
40
+
DEFS+= -DLOC_FLASH
40
41
.elif ${LOC:L} == "ram"
41
42
BASE_ADDR= 0x8000
43
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
91
-
$(SDCC) -c ${.TARGET} $(SRCDIR)/$(S)
93
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
97
-
$(ASZ80) -o ${.TARGET} ${ADDRS_INC} $>
99
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
47
+
/* defined according to whether we're running from RAM or flash */
48
48
+
#ifdef LOC_RAM
49
49
+
#define RUN_ADDR 0x8000
50
50
+
#define RUN_DEVICE 0x8
51
51
+
#define RUN_PAGE 0x7
52
52
+
#define SLOT_ADDR 0x4000
53
53
+
#define SLOT_DEVICE 0x6
54
54
+
#define SLOT_PAGE 0x5
55
55
+
#elif defined(LOC_FLASH)
56
56
+
#define RUN_ADDR 0x4000
57
57
+
#define RUN_DEVICE 0x6
58
58
+
#define RUN_PAGE 0x5
59
59
+
#define SLOT_ADDR 0x8000
60
60
+
#define SLOT_DEVICE 0x8
61
61
+
#define SLOT_PAGE 0x7
62
62
+
#else
63
63
+
#error "no LOC_RAM or LOC_FLASH defined"
64
64
+
#endif
65
65
+
47
66
/* LCD parameters (2 screens) */
48
67
#define LCD_WIDTH (160 * 2) // 320
49
68
#define LCD_HEIGHT 128