llvm-mos-sdk
vic20.h
Go to the documentation of this file.
1 // Copyright 2023 LLVM-MOS Project
2 // Licensed under the Apache License, Version 2.0 with LLVM Exceptions.
3 // See https://github.com/llvm-mos/llvm-mos-sdk/blob/main/LICENSE for license
4 // information.
5 
6 // Originally from cc65. Modified from original version.
7 
8 // clang-format off
9 
10 /*****************************************************************************/
11 /* */
12 /* vic20.h */
13 /* */
14 /* VIC-20 system-specific definitions */
15 /* */
16 /* */
17 /* */
18 /* (C) 1998-2004 Ullrich von Bassewitz */
19 /* Roemerstrasse 52 */
20 /* D-70794 Filderstadt */
21 /* EMail: uz@cc65.org */
22 /* */
23 /* */
24 /* This software is provided 'as-is', without any expressed or implied */
25 /* warranty. In no event will the authors be held liable for any damages */
26 /* arising from the use of this software. */
27 /* */
28 /* Permission is granted to anyone to use this software for any purpose, */
29 /* including commercial applications, and to alter it and redistribute it */
30 /* freely, subject to the following restrictions: */
31 /* */
32 /* 1. The origin of this software must not be misrepresented; you must not */
33 /* claim that you wrote the original software. If you use this software */
34 /* in a product, an acknowledgment in the product documentation would be */
35 /* appreciated but is not required. */
36 /* 2. Altered source versions must be plainly marked as such, and must not */
37 /* be misrepresented as being the original software. */
38 /* 3. This notice may not be removed or altered from any source */
39 /* distribution. */
40 /* */
41 /*****************************************************************************/
42 
43 
44 
45 #ifndef _VIC20_H
46 #define _VIC20_H
47 
48 
49 
50 /* Check for errors */
51 #if !defined(__VIC20__)
52 # error This module may only be used when compiling for the Vic20!
53 #endif
54 
55 
56 
57 /* Additional key defines */
58 #define CH_F1 133
59 #define CH_F2 137
60 #define CH_F3 134
61 #define CH_F4 138
62 #define CH_F5 135
63 #define CH_F6 139
64 #define CH_F7 136
65 #define CH_F8 140
66 
67 
68 
69 /* Color defines */
70 #define COLOR_BLACK 0x00
71 #define COLOR_WHITE 0x01
72 #define COLOR_RED 0x02
73 #define COLOR_CYAN 0x03
74 #define COLOR_PURPLE 0x04
75 #define COLOR_GREEN 0x05
76 #define COLOR_BLUE 0x06
77 #define COLOR_YELLOW 0x07
78 /* Only the background and multi-color characters can have these colors. */
79 #define COLOR_ORANGE 0x08
80 #define COLOR_LIGHTORANGE 0x09
81 #define COLOR_PINK 0x0A
82 #define COLOR_LIGHTCYAN 0x0B
83 #define COLOR_LIGHTVIOLET 0x0C
84 #define COLOR_LIGHTGREEN 0x0D
85 #define COLOR_LIGHTBLUE 0x0E
86 #define COLOR_LIGHTYELLOW 0x0F
87 
88 
89 
90 /* Masks for joy_read */
91 #define JOY_UP_MASK 0x01
92 #define JOY_DOWN_MASK 0x02
93 #define JOY_LEFT_MASK 0x04
94 #define JOY_RIGHT_MASK 0x08
95 #define JOY_BTN_1_MASK 0x10
96 
97 
98 
99 /* Define hardware */
100 #include <_vic.h>
101 #define VIC (*(volatile struct __vic*)0x9000)
102 
103 #include <_6522.h>
104 #define VIA1 (*(volatile struct __6522*)0x9110)
105 #define VIA2 (*(volatile struct __6522*)0x9120)
106 
107 
108 
109 /* Define special memory areas */
110 #define COLOR_RAM ((volatile unsigned char*)0x9600)
111 
112 
113 
114 /* End of vic20.h */
115 #endif
_vic.h
_6522.h