]> git.sur5r.net Git - cc65/blob - testcode/lib/atari/displaylist.c
04c5998786eb1cddb1b1c5f4c56af9ab5b82afd3
[cc65] / testcode / lib / atari / displaylist.c
1 /*
2 ** testprogram for ANTIC instructions as defined in "_antic.h"
3 **
4 ** 23-Feb-2017, Christian Krueger
5 */
6
7 #include <conio.h>
8 #include <atari.h>
9 #include <peekpoke.h>
10 #include <string.h>
11
12 // code is only for testing purposes, as screen and display list are not aligned
13 // and jumps not set!
14
15 unsigned char DummyScreen[400];
16
17 void DisplayList = {
18         DL_BLK1,
19         DL_BLK2,
20         DL_BLK3,
21         DL_BLK4,
22         DL_BLK5,
23         DL_BLK6,
24         DL_BLK7,
25         DL_DLI(DL_BLK8),
26         DL_LMS(DL_CHR40x8x1),
27         DummyScreen,
28         DL_HSCROL(DL_CHR40x10x1),
29         DL_VSCROL(DL_CHR40x8x4),
30         DL_CHR40x16x4,
31         DL_LMS(DL_HSCROL(DL_VSCROL(DL_DLI(DL_CHR20x8x2)))),
32         DummyScreen+120,
33         DL_CHR20x16x2,
34         DL_MAP40x8x4,
35         DL_MAP80x4x2,
36         DL_MAP80x4x4,
37         DL_MAP160x2x2,
38         DL_MAP160x1x2,
39         DL_MAP160x2x4,
40         DL_MAP160x1x4,
41         DL_MAP320x1x1, 
42         DL_JVB,
43         DL_JMP
44 };
45
46 unsigned char dlend = 0;
47
48
49 int
50 main(void)
51 {
52     // unfortunately "sizeof()" doesn't work with void data
53     // (Error: Size of data type is unknown)
54     // so we trick with the addresses at front and end...
55
56     int returnValue = (((unsigned int)&dlend-(unsigned int)&DisplayList) != 28);  // assure only one byte per instruction!
57
58     clrscr();
59     if (returnValue)
60         cputs("Test FAILED!");
61     else
62         cputs("Test passed.");
63
64     cputs("\n\rHit any key to exit...");
65     cgetc();
66
67     return returnValue;
68 }
69