-
Notifications
You must be signed in to change notification settings - Fork 1
/
target.h
574 lines (462 loc) · 11.7 KB
/
target.h
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
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
#ifndef TARGET_H_
#define TARGET_H_
///////////////////////////////////////////////////////////////////////////
// define screensize and some other capabilities of the target
// include target specific headers
///////////////////////////////////////////////////////////////////////////
/*
** library options
conio features
#define SCREENX 80
#define SCREENY 25
- size of the conio screen in characters (not pixels)
#define NOCOLORS
- conio has no color support
#define NOBGCOLORS
- bgcolor() is not available
#define NOREVERS
- revers() is not available
#define CONIOINIT
- conio must be initialized before it can be used
(calls conio_init())
#define CONIOUPDATE
- conio must be updated to make changes visible
(calls conio_update())
input
#define NOJOYSTICKS
- target has no joystick support
#define NOKEYBOARD
- target has no keyboard support
#define NOLOWERCASE
- keys will always produce uppercase letters
misc
#define NOWAITVBLANK
- waitvblank() is not available
#define NOCLOCK
- clock() is not available
#define NOTVMODE
- get_tv() is not available
** portris options
#define NOMELTDOWNFX
- omit the "melt" effect (needs cpeekc(),cpeekcolor())
title screen
#define NOTITLESCREEN
- omit the title screen alltogether
#define NOQUIT
- omit the "quit program" option from main menu
hiscore screen
#define NOHISCORES
- omit the hiscores alltogether
#define NOSTARSFX
- omit the "stars" effect (needs cpeekc())
*/
/* CBM targets (cc65) */
#if defined(__PET__)
# define SCREENX 80
# define SCREENY 25
# define NOCOLORS
# define NOBGCOLORS
# define NOWAITVBLANK // FIXME: missing in cc65 lib
#elif defined(__CBM510__)
# define SCREENX 40
# define SCREENY 25
# define NOTVMODE // FIXME: missing in cc65 lib
# define NOKBREPEAT // FIXME: missing in cc65 lib
#elif defined(__CBM610__)
# define SCREENX 80
# define SCREENY 25
# define NOCOLORS
# define NOBGCOLORS
# define NOJOYSTICKS // FIXME: missing in cc65 lib
# define NOKBREPEAT // FIXME: missing in cc65 lib
# define NOWAITVBLANK // FIXME: missing in cc65 lib
#elif defined(__C64__) && !defined(__GEOS__)
#if defined(__SOFT80__)
# define SCREENX 80
# define SCREENY 25
#else
# define SCREENX 40
# define SCREENY 25
#endif
#elif defined(__PLUS4__)
# define SCREENX 40
# define SCREENY 25
#elif defined(__C16__) && defined(__C16EXP__)
# define SCREENX 40
# define SCREENY 25
# define NOKBREPEAT // FIXME: missing in cc65 lib
# define NOWAITVBLANK // FIXME: missing in cc65 lib
/* FIXME: file too large */
#elif defined(__C16__)
# define SCREENX 40
# define SCREENY 25
# define NOKBREPEAT // FIXME: missing in cc65 lib
# define NOWAITVBLANK // FIXME: missing in cc65 lib
#define NOTITLESCREEN
#define NOHISCORES
#define NOSTARSFX
#define NOMELTDOWNFX
//#define NOQUIT
//#define NOCOLORS
//#define NOBGCOLORS
//#define NOREVERS
#elif defined(__C128__)
#if defined (__VDC__)
# define SCREENX 80
# define SCREENY 25
#else
# define SCREENX 40
# define SCREENY 25
#endif
#elif defined(__VIC20__)
#if defined(__VIC20HACKED__)
// with hardware 26x25
# define SCREENX 26
# define SCREENY 25
#elif defined(__SOFT40__)
// with software 40x24
# define SCREENX 40
# define SCREENY 24
# define NOCOLORS
#else
// with standard screensize
# define SCREENX 22
# define SCREENY 23
#endif
#undef COLOR_ORANGE
#undef COLOR_BROWN
#undef COLOR_LIGHTRED
#undef COLOR_GRAY1
#undef COLOR_GRAY2
#undef COLOR_LIGHTGREEN
#undef COLOR_LIGHTBLUE
#undef COLOR_GRAY3
#define COLOR_ORANGE COLOR_WHITE
#define COLOR_BROWN COLOR_WHITE
#define COLOR_LIGHTRED COLOR_RED
#define COLOR_GRAY1 COLOR_WHITE
#define COLOR_GRAY2 COLOR_WHITE
#define COLOR_LIGHTGREEN COLOR_GREEN
#define COLOR_LIGHTBLUE COLOR_BLUE
#define COLOR_GRAY3 COLOR_WHITE
#elif defined(__GEOS__)
# define SCREENX 40
# define SCREENY 25
# define NOCOLORS
# define NOBGCOLORS
# define NOKBREPEAT // FIXME: missing in cc65 lib
# define NOCLOCK // FIXME: missing in cc65 lib
# define NOREVERS // FIXME: missing in cc65 lib
# define NOWAITVBLANK // FIXME: missing in cc65 lib
# define NOSTARSFX
# define NOMELTDOWNFX
# define NOJOYSELECT
# define NOJOYSTICKS // FIXME: why is that so?
#define NOHISCORES
#define NOTITLESCREEN
/* other cc65 targets */
#elif defined(__APPLE2ENH__)
# define SCREENX 40
# define SCREENY 24
# define NOCOLORS
# define NOBGCOLORS
# define NOKBREPEAT
# define NOCLOCK
# define NOTVMODE
#elif defined(__APPLE2__)
# define SCREENX 40
# define SCREENY 24
# define NOLOWERCASE
# define NOCOLORS
# define NOBGCOLORS
# define NOKBREPEAT
# define NOCLOCK
# define NOWAITVBLANK
# define NOTVMODE
#elif defined(__ATARI__)
# define SCREENX 40
# define SCREENY 24 // its really 24 not 25!
# define NOCOLORS
# define NOKBREPEAT
# define NOWAITVBLANK // FIXME: missing in cc65 lib
# define NOTVMODE // FIXME: missing in cc65 lib
// FIXME: cpeekc() etc missing in lib
# define NOSTARSFX
# define NOMELTDOWNFX
#elif defined(__BBC__)
// that ok ?
# define SCREENX 40
# define SCREENY 25
# define NOCOLORS
# define NOBGCOLORS
# define NOJOYSTICKS
# define NOKBREPEAT
# error "BBC is missing some library support - FIXME!"
#elif defined(__ATMOS__)
# define SCREENX 38
# define SCREENY 28
# define NOCOLORS
# define NOBGCOLORS
# define NOJOYSTICKS
# define NOKBREPEAT
# define NOWAITVBLANK // FIXME: missing in cc65 lib
# define NOTVMODE // FIXME: missing in cc65 lib
# define NOMELTDOWNFX
# define NOSTARSFX
#elif defined(__LUNIX__)
// that ok ?
# define SCREENX 40
# define SCREENY 25
# define NOCOLORS
# define NOBGCOLORS
# define NOJOYSTICKS
# define NOKBREPEAT
# error "LUNIX is missing some library support - FIXME!"
#elif defined(__OSA65__)
// that ok ?
# define SCREENX 40
# define SCREENY 25
# define NOCOLORS
# define NOBGCOLORS
# define NOJOYSTICKS
# define NOKBREPEAT
# error "OSA65 is missing some library support - FIXME!"
#elif defined(__NES__)
# define SCREENX (32)
# define SCREENY (28)
# define NOCOLORS
# define NOBORDER
# define NOKBREPEAT
# define NOKEYBOARD
# define NOQUIT
# define NOCLOCK // FIXME
# define STATICJOYDRV
# define NOJOYSELECT
# define NOSTARSFX // FIXME
# define NOMELTDOWNFX
#define MELTDOWNNOBUFFER
//# define NO2DIMARRAYS
//# define NOGLOBALPTRINIT
#elif defined(__PCE__)
# define SCREENX 61
# define SCREENY 28
# define NOBORDER
# define NOKBREPEAT
# define NOKEYBOARD
//# define NOMELTDOWNFX // FIXME: gives out of memory
#define MELTDOWNNOBUFFER
# define NOQUIT
# define STATICJOYDRV
# define NOJOYSELECT
# define register // zeropage is kindof special on PCE
/* program too large */
#elif defined(__GAMATE__)
# define SCREENX (32) // FIXME
# define SCREENY (28) // FIXME
# define NOCOLORS
# define NOBGCOLORS
# define NOBORDER
# define NOKBREPEAT
# define NOJOYSELECT
# define NOKEYBOARD
# define NOQUIT
# define STATICJOYDRV
# define NOJOYSTICKS // FIXME
# define NOSTARSFX // FIXME
# define NOMELTDOWNFX
//#define NO2DIMARRAYS
//#define NOGLOBALPTRINIT
#define NOHISCORES
#define NOTITLESCREEN
///////////////////////////////////////////////////////////////////////////////
// misc other targets
#elif defined(__GAMEBOY__)
# define SCREENX (160/8)
# define SCREENY (144/8)
# define NOCOLORS
# define NOBGCOLORS
# define NOBORDER
# define NOKBREPEAT
# define NOJOYSELECT
# define NOMELTDOWNFX
# define NOKEYBOARD
# define NOWAITVBLANK
# define NOQUIT
# define NOSTRUCTASSIGN
# define NOCLOCK
# define CONIOINIT
#define NO2DIMARRAYS
#define NOGLOBALPTRINIT
#undef __SDCC__
#undef __GAMEBOY__
#elif defined(__GBA__)
# define SCREENX (240/8)
# define SCREENY (160/8)
# define NOBORDER
# define NOKBREPEAT
# define NOJOYSELECT
# define NOMELTDOWNFX // "out of memory"
# define NOCLOCK
# define NOKEYBOARD
# define NOQUIT
# define CONIOUPDATE
# define CONIOINIT
#elif defined(__GP32__)
# define SCREENX ((320/8))
# define SCREENY ((240/8))
# define NOBGCOLORS
# define NOBORDER
# define NOKBREPEAT
# define NOJOYSELECT
# define NOMELTDOWNFX
# define NOSTARSFX
# define NOKEYBOARD
# define NOWAITVBLANK
# define NOCLOCK
# define CONIOUPDATE
# define CONIOINIT
#elif defined(__SPECTRUM__)
// sinclair spectrum
//#define const
//#define register
#define SCREENX 32
#define SCREENY 24
// #define NO2DIMARRAYS
// #define NOGLOBALPTRINIT
//# define NOCOLORS
//# define NOBGCOLORS
# define NOBORDER
//# define NOREVERS
# define NOKBREPEAT
# define NOJOYSELECT
# define NOMELTDOWNFX
# define NOSTARSFX
//# define NOKEYBOARD
# define NOJOYSTICKS
# define NOWAITVBLANK
# define NOCLOCK
#define NO2DIMARRAYS
#define NOGLOBALPTRINIT
#define NOSTRUCTASSIGN
#elif defined(__MINGW32__)
//# define SCREENX ScreenCols()
//# define SCREENY ScreenRows()
# define SCREENX 80
# define SCREENY 25
//# define NOCOLORS
# define NOBGCOLORS
# define NOJOYSTICKS
# define NOKBREPEAT
//# define NOCLOCK
# define NOREVERS
//# define NOSTARSFX
//# define NOMELTDOWNFX
#define CONIOINIT
#define CONIOSCROLLS
#define CONIORESTORES
//#define CONIODYNSIZE
#elif defined(__LINUX__)
//# define SCREENX ScreenCols()
//# define SCREENY ScreenRows()
# define SCREENX 80
# define SCREENY 25
//# define NOCOLORS
# define NOBGCOLORS
# define NOJOYSTICKS
# define NOKBREPEAT
//# define NOCLOCK
//# define NOREVERS
# define NOSTARSFX
# define NOMELTDOWNFX
#define CONIOINIT
#define CONIOSCROLLS
#define CONIORESTORES
//#define CONIODYNSIZE
#elif defined(__MACOS__)
#ifdef __SDL__
//# define SCREENX ScreenCols()
//# define SCREENY ScreenRows()
# define SCREENX 40
# define SCREENY 25
//# define NOCOLORS
//# define NOBGCOLORS
#define NOBORDER
# define NOJOYSTICKS
# define NOKBREPEAT
# define NOCLOCK
//# define NOREVERS
//#define NOWAITVBLANK
# define NOSTARSFX
# define NOMELTDOWNFX
#define CONIOINIT
#define CONIOSCROLLS
#define CONIORESTORES
//#define CONIODYNSIZE
# define CONIOUPDATE
#else
//# define SCREENX ScreenCols()
//# define SCREENY ScreenRows()
# define SCREENX 80
# define SCREENY 25
//# define NOCOLORS
# define NOBGCOLORS
# define NOJOYSTICKS
# define NOKBREPEAT
//# define NOCLOCK
//# define NOREVERS
//#define NOWAITVBLANK
# define NOSTARSFX
# define NOMELTDOWNFX
#define CONIOINIT
#define CONIOSCROLLS
#define CONIORESTORES
//#define CONIODYNSIZE
#endif
#elif defined(__PSP__)
# define SCREENX 60
# define SCREENY 34
# define NOBORDER
# define NOJOYSELECT
# define CONIOUPDATE
# define CONIOINIT
# define CONIOSCROLLS
# define NOKEYBOARD
# define NOKBREPEAT
//# define NOCOLORS
//# define NOREVERS
//# define NOBGCOLORS
#define STATICJOYDRV
//# define NOJOYSTICKS
#define NOJOYSELECT
// mmmh...why doesnt that work?
# define NOMELTDOWNFX
# define NOSTARSFX
//# define NOWAITVBLANK
//# define NOCLOCK
#elif defined(__GAMECUBE__)
# define SCREENX 80
# define SCREENY 30
# define NOBORDER
# define NOJOYSELECT
# define CONIOUPDATE
# define CONIOINIT
#define CONIOSCROLLS
# define NOKEYBOARD
# define NOKBREPEAT
//# define NOCOLORS
//# define NOREVERS
//# define NOBGCOLORS
//# define NOJOYSTICKS
// mmmh...why doesnt that work?
//# define NOMELTDOWNFX
//# define NOSTARSFX
//# define NOWAITVBLANK
# define NOCLOCK
#else
#error "Unknown target system - FIXME!"
#endif
/* do some sanity checks on the above options */
#if defined (NOJOYSTICKS) && defined (NOKEYBOARD)
#warning "neither joystick nor keyboard input is enabled"
#endif
#endif // TARGET_H_