-
Notifications
You must be signed in to change notification settings - Fork 60
/
Copy pathCMakeLists.txt
256 lines (230 loc) · 6.64 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
set(picomputer_vgazx_defines
${picomputer_common_defines}
)
set(ZxSpectrumPicomputerVgaZx_640x480x60Hz_defines
# Set the resolution of the menu screen
PCS_COLS=80
PCS_ROWS=30
# Set the VGA timing
VGA_MODE=vga_mode_640x240_60
# The display resolution
DISPLAY_WIDTH_PIXELS=640
DISPLAY_HEIGHT_PIXELS=480
# The default interrupt source
ZX_SPECTRUM_INT_SRC=SyncToCpu
# TODO work what this is
PICO_SCANVIDEO_MAX_SCANLINE_BUFFER_WORDS=700
# Speaker pin audio (@250MHz 250000000 / (1000 * 3 * 2))
PICO_PWM_AUDIO_FREQ=41666
)
set(ZxSpectrumPicomputerVgaZx_720x576x50Hz_defines
# Set the resolution of the menu screen
PCS_COLS=90
PCS_ROWS=30
SZ_FRAME_X=5
# Set the VGA timing
VGA_MODE=vga_mode_720x288_50
# The display resolution
DISPLAY_WIDTH_PIXELS=720
DISPLAY_HEIGHT_PIXELS=576
# The default interrupt source
ZX_SPECTRUM_INT_SRC=SyncToDisplay
# TODO work what this is
PICO_SCANVIDEO_MAX_SCANLINE_BUFFER_WORDS=800
# Speaker pin audio (@270MHz 270000000 / (1000 * 3 * 2))
PICO_PWM_AUDIO_FREQ=45000
)
foreach(target
ZxSpectrumPicomputerVga1111Zx_640x480x60Hz
ZxSpectrumPicomputerVga222Zx_640x480x60Hz
ZxSpectrumPicomputerVgaAuk_640x480x60Hz
ZxSpectrumPicomputerVgaAukBob_640x480x60Hz
ZxSpectrumPicomputerVga1111Zx_720x576x50Hz
ZxSpectrumPicomputerVga222Zx_720x576x50Hz
ZxSpectrumPicomputerVgaAuk_720x576x50Hz
ZxSpectrumPicomputerVgaAukBob_720x576x50Hz
ZxSpectrumPicomputerVga1111AukBob_720x576x50Hz
)
add_executable(${target}
${zxspectrum_common_src}
${zxspectrum_rgb_src}
${picomputer_common_src}
${zxspectrum_scanvideo_src}
main.cpp
)
target_link_libraries(${target}
${zxspectrum_common_libs}
pico_emu_utils
pico_scanvideo_dpi
pico_scanvideo_menu
tinyusb_host
tinyusb_board
hardware_pio
hardware_pwm
)
pico_enable_stdio_usb(${target} 0)
pico_enable_stdio_uart(${target} 0)
# create map/bin/hex file etc.
pico_add_extra_outputs(${target})
pico_generate_pio_header(${target}
${zxspectrum_pwm_pio}
)
endforeach()
set(ZxSpectrumPicomputerVga1111Zx_defines
${picomputer_vgazx_defines}
VGA_ENC_RGBY_1111
PICO_SCANVIDEO_COLOR_PIN_COUNT=4u
PICO_SCANVIDEO_DPI_PIXEL_RCOUNT=2u
PICO_SCANVIDEO_DPI_PIXEL_GCOUNT=1u
PICO_SCANVIDEO_DPI_PIXEL_BCOUNT=1u
PICO_SCANVIDEO_DPI_PIXEL_RSHIFT=2u
PICO_SCANVIDEO_DPI_PIXEL_GSHIFT=1u
PICO_SCANVIDEO_DPI_PIXEL_BSHIFT=0u
PICO_SCANVIDEO_COLOR_PIN_BASE=0u
PICO_AUDIO_PWM_PIO=pio1
PICO_PIO_PWM_AUDIO
SPK_PIN=9
PICOMPUTER_VGA
)
target_compile_definitions(ZxSpectrumPicomputerVga1111Zx_640x480x60Hz PRIVATE
${ZxSpectrumPicomputerVga1111Zx_defines}
${ZxSpectrumPicomputerVgaZx_640x480x60Hz_defines}
)
target_compile_definitions(ZxSpectrumPicomputerVga1111Zx_720x576x50Hz PRIVATE
${ZxSpectrumPicomputerVga1111Zx_defines}
${ZxSpectrumPicomputerVgaZx_720x576x50Hz_defines}
)
set(ZxSpectrumPicomputerVga222Zx_defines
${picomputer_vgazx_defines}
VGA_ENC_RGB_222
PICO_SCANVIDEO_COLOR_PIN_COUNT=6u
PICO_SCANVIDEO_DPI_PIXEL_RCOUNT=2u
PICO_SCANVIDEO_DPI_PIXEL_GCOUNT=2u
PICO_SCANVIDEO_DPI_PIXEL_BCOUNT=3u
PICO_SCANVIDEO_DPI_PIXEL_RSHIFT=4u
PICO_SCANVIDEO_DPI_PIXEL_GSHIFT=2u
PICO_SCANVIDEO_DPI_PIXEL_BSHIFT=0u
PICO_SCANVIDEO_COLOR_PIN_BASE=0u
PICO_AUDIO_PWM_PIO=pio1
PICO_PIO_PWM_AUDIO
SPK_PIN=7
PICOMPUTER_PICOZX
)
target_compile_definitions(ZxSpectrumPicomputerVga222Zx_640x480x60Hz PRIVATE
${ZxSpectrumPicomputerVga222Zx_defines}
${ZxSpectrumPicomputerVgaZx_640x480x60Hz_defines}
)
target_compile_definitions(ZxSpectrumPicomputerVga222Zx_720x576x50Hz PRIVATE
${ZxSpectrumPicomputerVga222Zx_defines}
${ZxSpectrumPicomputerVgaZx_720x576x50Hz_defines}
)
#
# AUK Hardware + Compatible board from bobricius
# ----------------------------------------------
#
# AUK extra keyboard key assignments:
#
# F = Fire
# U = Up
# D = Down
# L = Left
# R = Right
# N = Next snap
# P = Previous snap
# A = 48K
# B = 128k
# Q = Quick save 1
# C = Joystick cursor mode
# K = Joystick kempton mode
#
# Normal Shifted
# Column: 12345678 12345678
# AUK original: FLURDMAB FLURDMAB
# AUK digitalmexer: MFLURDAB MFLURDAB
# AUK bobrisius: FLURDMPN FLURDQCK
#
set(ZxSpectrumPicomputerVgaAuk_defines
${picomputer_vgazx_defines}
VGA_ENC_RGB_222
PICO_SCANVIDEO_COLOR_PIN_COUNT=6u
PICO_SCANVIDEO_DPI_PIXEL_RCOUNT=2u
PICO_SCANVIDEO_DPI_PIXEL_GCOUNT=2u
PICO_SCANVIDEO_DPI_PIXEL_BCOUNT=3u
PICO_SCANVIDEO_DPI_PIXEL_RSHIFT=4u
PICO_SCANVIDEO_DPI_PIXEL_GSHIFT=2u
PICO_SCANVIDEO_DPI_PIXEL_BSHIFT=0u
PICO_SCANVIDEO_COLOR_PIN_BASE=0u
PICO_AUDIO_PWM_PIO=pio1
PICO_PIO_PWM_AUDIO
SPK_PIN=7
PICOMPUTER_PICOZX
REAL_ZXKEYBOARD
)
target_compile_definitions(ZxSpectrumPicomputerVgaAuk_640x480x60Hz PRIVATE
${ZxSpectrumPicomputerVgaAuk_defines}
${ZxSpectrumPicomputerVgaZx_640x480x60Hz_defines}
)
target_compile_definitions(ZxSpectrumPicomputerVgaAuk_720x576x50Hz PRIVATE
${ZxSpectrumPicomputerVgaAuk_defines}
${ZxSpectrumPicomputerVgaZx_720x576x50Hz_defines}
)
#
# Target for bobricius
#
set(ZxSpectrumPicomputerVgaAukBob_defines
${picomputer_vgazx_defines}
VGA_ENC_RGB_222
PICO_SCANVIDEO_COLOR_PIN_COUNT=6u
PICO_SCANVIDEO_DPI_PIXEL_RCOUNT=2u
PICO_SCANVIDEO_DPI_PIXEL_GCOUNT=2u
PICO_SCANVIDEO_DPI_PIXEL_BCOUNT=3u
PICO_SCANVIDEO_DPI_PIXEL_RSHIFT=4u
PICO_SCANVIDEO_DPI_PIXEL_GSHIFT=2u
PICO_SCANVIDEO_DPI_PIXEL_BSHIFT=0u
PICO_SCANVIDEO_COLOR_PIN_BASE=0u
PICO_AUDIO_PWM_PIO=pio1
PICO_PIO_PWM_AUDIO
SPK_PIN=7
PICOMPUTER_PICOZX
REAL_ZXKEYBOARD
REAL_ZXKEYBOARD_BOB
HID_KEY_MOD_SAVE=2
)
target_compile_definitions(ZxSpectrumPicomputerVgaAukBob_640x480x60Hz PRIVATE
${ZxSpectrumPicomputerVgaAukBob_defines}
${ZxSpectrumPicomputerVgaZx_640x480x60Hz_defines}
)
target_compile_definitions(ZxSpectrumPicomputerVgaAukBob_720x576x50Hz PRIVATE
${ZxSpectrumPicomputerVgaAukBob_defines}
${ZxSpectrumPicomputerVgaZx_720x576x50Hz_defines}
)
#
# Target for emilen72
#
set(ZxSpectrumPicomputerVga1111AukBob_defines
${picomputer_vgazx_defines}
VGA_ENC_RGBY_1111
PICO_SCANVIDEO_COLOR_PIN_COUNT=4u
PICO_SCANVIDEO_DPI_PIXEL_RCOUNT=2u
PICO_SCANVIDEO_DPI_PIXEL_GCOUNT=1u
PICO_SCANVIDEO_DPI_PIXEL_BCOUNT=1u
PICO_SCANVIDEO_DPI_PIXEL_RSHIFT=2u
PICO_SCANVIDEO_DPI_PIXEL_GSHIFT=1u
PICO_SCANVIDEO_DPI_PIXEL_BSHIFT=0u
PICO_SCANVIDEO_COLOR_PIN_BASE=0u
PICO_AUDIO_PWM_PIO=pio1
PICO_PIO_PWM_AUDIO
SPK_PIN=7
EAR_PIN=6
PICOMPUTER_PICOZX
REAL_ZXKEYBOARD
REAL_ZXKEYBOARD_BOB
HID_KEY_MOD_SAVE=2
)
pico_generate_pio_header(ZxSpectrumPicomputerVga1111AukBob_720x576x50Hz
${zxspectrum_ear_in_pio}
)
target_compile_definitions(ZxSpectrumPicomputerVga1111AukBob_720x576x50Hz PRIVATE
${ZxSpectrumPicomputerVga1111AukBob_defines}
${ZxSpectrumPicomputerVgaZx_720x576x50Hz_defines}
)