-
Notifications
You must be signed in to change notification settings - Fork 0
/
charmif.c
322 lines (310 loc) · 15.3 KB
/
charmif.c
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
#include<conio.h>
#include<stdlib.h>
#include<stdio.h>
#include<stdint.h>
#include<string.h>
uint16_t colours[] = {0x000,
0x007,
0x070,
0x077,
0x700,
0x707,
0x770,
0x777,
0x444,
0x00F,
0x0F0,
0x0FF,
0xF00,
0xF0F,
0xFF0,
0xFFF};
uint8_t char_rom[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 0
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 1
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 2
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 3
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 4
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 5
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 6
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 7
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 8
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 9
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 10
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 11
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 12
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 13
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 14
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 15
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 16
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 17
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 18
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 19
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 20
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 21
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 22
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 23
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 24
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 25
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 26
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 27
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 28
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 29
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 30
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 31
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ' '
0x18,0x18,0x18,0x18,0x00,0x00,0x18,0x00, // '!'
0x66,0x66,0x66,0x00,0x00,0x00,0x00,0x00, // '"'
0x66,0x66,0xff,0x66,0xff,0x66,0x66,0x00, // '#'
0x18,0x3e,0x60,0x3c,0x06,0x7c,0x18,0x00, // '$'
0x62,0x66,0x0c,0x18,0x30,0x66,0x46,0x00, // '%'
0x3c,0x66,0x3c,0x38,0x67,0x66,0x3f,0x00, // '&'
0x06,0x0c,0x18,0x00,0x00,0x00,0x00,0x00, // '''
0x0c,0x18,0x30,0x30,0x30,0x18,0x0c,0x00, // '('
0x30,0x18,0x0c,0x0c,0x0c,0x18,0x30,0x00, // ')'
0x00,0x66,0x3c,0xff,0x3c,0x66,0x00,0x00, // '*'
0x00,0x18,0x18,0x7e,0x18,0x18,0x00,0x00, // '+'
0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x30, // ','
0x00,0x00,0x00,0x7e,0x00,0x00,0x00,0x00, // '-'
0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00, // '.'
0x00,0x03,0x06,0x0c,0x18,0x30,0x60,0x00, // '/'
0x3c,0x66,0x6e,0x76,0x66,0x66,0x3c,0x00, // '0'
0x18,0x18,0x38,0x18,0x18,0x18,0x7e,0x00, // '1'
0x3c,0x66,0x06,0x0c,0x30,0x60,0x7e,0x00, // '2'
0x3c,0x66,0x06,0x1c,0x06,0x66,0x3c,0x00, // '3'
0x06,0x0e,0x1e,0x66,0x7f,0x06,0x06,0x00, // '4'
0x7e,0x60,0x7c,0x06,0x06,0x66,0x3c,0x00, // '5'
0x3c,0x66,0x60,0x7c,0x66,0x66,0x3c,0x00, // '6'
0x7e,0x66,0x0c,0x18,0x18,0x18,0x18,0x00, // '7'
0x3c,0x66,0x66,0x3c,0x66,0x66,0x3c,0x00, // '8'
0x3c,0x66,0x66,0x3e,0x06,0x66,0x3c,0x00, // '9'
0x00,0x00,0x18,0x00,0x00,0x18,0x00,0x00, // ':'
0x00,0x00,0x18,0x00,0x00,0x18,0x18,0x30, // ';'
0x0e,0x18,0x30,0x60,0x30,0x18,0x0e,0x00, // '<'
0x00,0x00,0x7e,0x00,0x7e,0x00,0x00,0x00, // '='
0x70,0x18,0x0c,0x06,0x0c,0x18,0x70,0x00, // '>'
0x3c,0x66,0x06,0x0c,0x18,0x00,0x18,0x00, // '?'
0x3c,0x66,0x6e,0x6e,0x60,0x62,0x3c,0x00, // '@'
0x18,0x3c,0x66,0x7e,0x66,0x66,0x66,0x00, // 'A'
0x7c,0x66,0x66,0x7c,0x66,0x66,0x7c,0x00, // 'B'
0x3c,0x66,0x60,0x60,0x60,0x66,0x3c,0x00, // 'C'
0x78,0x6c,0x66,0x66,0x66,0x6c,0x78,0x00, // 'D'
0x7e,0x60,0x60,0x78,0x60,0x60,0x7e,0x00, // 'E'
0x7e,0x60,0x60,0x78,0x60,0x60,0x60,0x00, // 'F'
0x3c,0x66,0x60,0x6e,0x66,0x66,0x3c,0x00, // 'G'
0x66,0x66,0x66,0x7e,0x66,0x66,0x66,0x00, // 'H'
0x3c,0x18,0x18,0x18,0x18,0x18,0x3c,0x00, // 'I'
0x1e,0x0c,0x0c,0x0c,0x0c,0x6c,0x38,0x00, // 'J'
0x66,0x6c,0x78,0x70,0x78,0x6c,0x66,0x00, // 'K'
0x60,0x60,0x60,0x60,0x60,0x60,0x7e,0x00, // 'L'
0x63,0x77,0x7f,0x6b,0x63,0x63,0x63,0x00, // 'M'
0x66,0x76,0x7e,0x7e,0x6e,0x66,0x66,0x00, // 'N'
0x3c,0x66,0x66,0x66,0x66,0x66,0x3c,0x00, // 'O'
0x7c,0x66,0x66,0x7c,0x60,0x60,0x60,0x00, // 'P'
0x3c,0x66,0x66,0x66,0x66,0x3c,0x0e,0x00, // 'Q'
0x7c,0x66,0x66,0x7c,0x78,0x6c,0x66,0x00, // 'R'
0x3c,0x66,0x60,0x3c,0x06,0x66,0x3c,0x00, // 'S'
0x7e,0x18,0x18,0x18,0x18,0x18,0x18,0x00, // 'T'
0x66,0x66,0x66,0x66,0x66,0x66,0x3c,0x00, // 'U'
0x66,0x66,0x66,0x66,0x66,0x3c,0x18,0x00, // 'V'
0x63,0x63,0x63,0x6b,0x7f,0x77,0x63,0x00, // 'W'
0x66,0x66,0x3c,0x18,0x3c,0x66,0x66,0x00, // 'X'
0x66,0x66,0x66,0x3c,0x18,0x18,0x18,0x00, // 'Y'
0x7e,0x06,0x0c,0x18,0x30,0x60,0x7e,0x00, // 'Z'
0x3c,0x30,0x30,0x30,0x30,0x30,0x3c,0x00, // '['
0x00,0x60,0x30,0x18,0x0c,0x06,0x03,0x00, // '\'
0x3c,0x0c,0x0c,0x0c,0x0c,0x0c,0x3c,0x00, // ']'
0x10,0x38,0x6c,0xc6,0x00,0x00,0x00,0x00, // '^'
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff, // '_'
0x30,0x30,0x18,0x00,0x00,0x00,0x00,0x00, // '`'
0x00,0x00,0x3c,0x06,0x3e,0x66,0x3e,0x00, // 'a'
0x00,0x60,0x60,0x7c,0x66,0x66,0x7c,0x00, // 'b'
0x00,0x00,0x3c,0x60,0x60,0x60,0x3c,0x00, // 'c'
0x00,0x06,0x06,0x3e,0x66,0x66,0x3e,0x00, // 'd'
0x00,0x00,0x3c,0x66,0x7e,0x60,0x3c,0x00, // 'e'
0x00,0x0e,0x18,0x3e,0x18,0x18,0x18,0x00, // 'f'
0x00,0x00,0x3e,0x66,0x66,0x3e,0x06,0x7c, // 'g'
0x00,0x60,0x60,0x7c,0x66,0x66,0x66,0x00, // 'h'
0x00,0x18,0x00,0x38,0x18,0x18,0x3c,0x00, // 'i'
0x00,0x06,0x00,0x06,0x06,0x06,0x06,0x3c, // 'j'
0x00,0x60,0x60,0x6c,0x78,0x6c,0x66,0x00, // 'k'
0x00,0x38,0x18,0x18,0x18,0x18,0x3c,0x00, // 'l'
0x00,0x00,0x66,0x7f,0x7f,0x6b,0x63,0x00, // 'm'
0x00,0x00,0x7c,0x66,0x66,0x66,0x66,0x00, // 'n'
0x00,0x00,0x3c,0x66,0x66,0x66,0x3c,0x00, // 'o'
0x00,0x00,0x7c,0x66,0x66,0x7c,0x60,0x60, // 'p'
0x00,0x00,0x3e,0x66,0x66,0x3e,0x06,0x06, // 'q'
0x00,0x00,0x7c,0x66,0x60,0x60,0x60,0x00, // 'r'
0x00,0x00,0x3e,0x60,0x3c,0x06,0x7c,0x00, // 's'
0x00,0x18,0x7e,0x18,0x18,0x18,0x0e,0x00, // 't'
0x00,0x00,0x66,0x66,0x66,0x66,0x3e,0x00, // 'u'
0x00,0x00,0x66,0x66,0x66,0x3c,0x18,0x00, // 'v'
0x00,0x00,0x63,0x6b,0x7f,0x3e,0x36,0x00, // 'w'
0x00,0x00,0x66,0x3c,0x18,0x3c,0x66,0x00, // 'x'
0x00,0x00,0x66,0x66,0x66,0x3e,0x0c,0x78, // 'y'
0x00,0x00,0x7e,0x0c,0x18,0x30,0x7e,0x00, // 'z'
0x1c,0x30,0x30,0xe0,0x30,0x30,0x1c,0x00, // '{'
0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, // '|'
0xe0,0x30,0x30,0x1c,0x30,0x30,0xe0,0x00, // '}'
0x76,0xdc,0x00,0x00,0x00,0x00,0x00,0x00, // '~'
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // DEL
0x00,0x00,0x00,0xff,0xff,0x00,0x00,0x00, // 128 (SET 1 PETSCII 64 ...)
0x08,0x1c,0x3e,0x7f,0x7f,0x1c,0x3e,0x00, // 129
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // 130
0x00,0x00,0x00,0xff,0xff,0x00,0x00,0x00, // 131
0x00,0x00,0xff,0xff,0x00,0x00,0x00,0x00, // 132
0x00,0xff,0xff,0x00,0x00,0x00,0x00,0x00, // 133
0x00,0x00,0x00,0x00,0xff,0xff,0x00,0x00, // 134
0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, // 135
0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c, // 136
0x00,0x00,0x00,0xe0,0xf0,0x38,0x18,0x18, // 137
0x18,0x18,0x1c,0x0f,0x07,0x00,0x00,0x00, // 138
0x18,0x18,0x38,0xf0,0xe0,0x00,0x00,0x00, // 139
0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xff,0xff, // 140
0xc0,0xe0,0x70,0x38,0x1c,0x0e,0x07,0x03, // 141
0x03,0x07,0x0e,0x1c,0x38,0x70,0xe0,0xc0, // 142
0xff,0xff,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, // 143
0xff,0xff,0x03,0x03,0x03,0x03,0x03,0x03, // 144
0x00,0x3c,0x7e,0x7e,0x7e,0x7e,0x3c,0x00, // 145
0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x00, // 146
0x36,0x7f,0x7f,0x7f,0x3e,0x1c,0x08,0x00, // 147
0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60, // 148
0x00,0x00,0x00,0x07,0x0f,0x1c,0x18,0x18, // 149
0xc3,0xe7,0x7e,0x3c,0x3c,0x7e,0xe7,0xc3, // 150
0x00,0x3c,0x7e,0x66,0x66,0x7e,0x3c,0x00, // 151
0x18,0x18,0x66,0x66,0x18,0x18,0x3c,0x00, // 152
0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06, // 153
0x08,0x1c,0x3e,0x7f,0x3e,0x1c,0x08,0x00, // 154
0x18,0x18,0x18,0xff,0xff,0x18,0x18,0x18, // 155
0xc0,0xc0,0x30,0x30,0xc0,0xc0,0x30,0x30, // 156
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // 157
0x00,0x00,0x03,0x3e,0x76,0x36,0x36,0x00, // 158
0xff,0x7f,0x3f,0x1f,0x0f,0x07,0x03,0x01, // 159
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 160
0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, // 161
0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff, // 162
0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 163
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff, // 164
0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, // 165
0xcc,0xcc,0x33,0x33,0xcc,0xcc,0x33,0x33, // 166
0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, // 167
0x00,0x00,0x00,0x00,0xcc,0xcc,0x33,0x33, // 168
0xff,0xfe,0xfc,0xf8,0xf0,0xe0,0xc0,0x80, // 169
0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, // 170
0x18,0x18,0x18,0x1f,0x1f,0x18,0x18,0x18, // 171
0x00,0x00,0x00,0x00,0x0f,0x0f,0x0f,0x0f, // 172
0x18,0x18,0x18,0x1f,0x1f,0x00,0x00,0x00, // 173
0x00,0x00,0x00,0xf8,0xf8,0x18,0x18,0x18, // 174
0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff, // 175
0x00,0x00,0x00,0x1f,0x1f,0x18,0x18,0x18, // 176
0x18,0x18,0x18,0xff,0xff,0x00,0x00,0x00, // 177
0x00,0x00,0x00,0xff,0xff,0x18,0x18,0x18, // 178
0x18,0x18,0x18,0xf8,0xf8,0x18,0x18,0x18, // 179
0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, // 180
0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0, // 181
0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07, // 182
0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00, // 183
0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00, // 184
0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff, // 185
0x03,0x03,0x03,0x03,0x03,0x03,0xff,0xff, // 186
0x00,0x00,0x00,0x00,0xf0,0xf0,0xf0,0xf0, // 187
0x0f,0x0f,0x0f,0x0f,0x00,0x00,0x00,0x00, // 188
0x18,0x18,0x18,0xf8,0xf8,0x00,0x00,0x00, // 189
0xf0,0xf0,0xf0,0xf0,0x00,0x00,0x00,0x00, // 190
0xf0,0xf0,0xf0,0xf0,0x0f,0x0f,0x0f,0x0f, // 191 (... PETSCII 127)
0x00,0x18,0x3c,0x7e,0x18,0x18,0x18,0x18, // Up Arrow
0x00,0x08,0x0C,0xfe,0xfe,0x0c,0x08,0x00, // Right Arrow
0x18,0x18,0x18,0x18,0x7e,0x3c,0x18,0x00, // Down Arrow
0x00,0x10,0x30,0x7f,0x7f,0x30,0x10,0x00, // Left Arrow
0x0c,0x12,0x30,0x7c,0x30,0x62,0xfc,0x00, // '£'
0x01,0x03,0x06,0x6c,0x78,0x70,0x60,0x00, // Tick
0xcc,0x99,0x33,0x66,0xcc,0x99,0x33,0x66, // 198
0x33,0x99,0xcc,0x66,0x33,0x99,0xcc,0x66, // 199
0x33,0x33,0xcc,0xcc,0x33,0x33,0xcc,0xcc, // 200
0x0c,0x0c,0x03,0x03,0x0c,0x0c,0x03,0x03, // 201
0xcc,0xcc,0x33,0x33,0x00,0x00,0x00,0x00, // 202
0x00,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x00, // 203
0x00,0x00,0x3c,0x3c,0x3c,0x3c,0x00,0x00, // 204
0x0f,0x0f,0x0f,0x0f,0xf0,0xf0,0xf0,0xf0, // 205
0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, // 206
0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00, // 207
0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa, // 208
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 209
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 210
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 211
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 212
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 213
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 214
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 215
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 216
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 217
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 218
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 219
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 220
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 221
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 222
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 223
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 224
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 225
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 226
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 227
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 228
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 239
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 230
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 231
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 232
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 233
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 234
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 235
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 236
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 237
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 238
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 239
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 240
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 241
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 242
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 243
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 244
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 245
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 246
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 247
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 248
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 249
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 250
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 251
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 252
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 253
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 254
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; // 255
void main(void)
{
FILE *fp;
int i;
uint16_t ram[4096];
for(i=0;i<4096;i++)
{
ram[i] = 0;
}
for(i=0;i<16;i++)
{
ram[2032+i] = colours[i];
}
for(i=0;i<1024;i++)
{
ram[2048+i] = char_rom[i<<1] << 8 | char_rom[(i<<1)+1];
}
fp = fopen("vram.mif","w");
fprintf(fp, "DEPTH = 4096;\n");
fprintf(fp, "WIDTH = 16;\n");
fprintf(fp, "ADDRESS_RADIX = HEX;\n");
fprintf(fp, "DATA_RADIX = HEX;\n");
fprintf(fp, "CONTENT\nBEGIN\n");
for(i=0;i<4096;i++)
{
fprintf(fp, "%03X : %04X ;\n",i,ram[i]);
}
fprintf(fp, "END;\n");
fclose(fp);
printf("MIF file created\n");
fclose(fp);
}