-
Notifications
You must be signed in to change notification settings - Fork 2
/
cpal.c
258 lines (208 loc) · 14.9 KB
/
cpal.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
#include "cpal.h"
/* table of character selection palette */
int cspal[CPAL_NUM * 4] = {
/* 14 */
/* rectangle (horizontal) */
0, 0x3c, 0x3e, 0x7e, 0x3a, 0x7a, 0x36, 0x70,
/* rectangle (vertical) */
0x43, 0x3d, 0x3f, 0x7f, 0x3b, 0x7b, 0x37, 0x71,
/* line (horizontal) */
0x3c, 0x7c, 0x38, 0x78, 0x34, 0x74, 0x30, 0x70,
/* line (vertical) */
0x71, 0x31, 0x75, 0x35, 0x79, 0x39, 0x7d, 0x3d,
/* 16 */
/* circle boxline */
0x4b, 0x4c, 0x5c, 0x5d, 0x5f, 0x5e, 0x1b, 0xe0,
/* triangle slash double-slash */
0x72, 0x73, 0x4e, 0x4d, 0x76, 0x77, 0x176, 0x177,
/* circle boxline */
0x6f, 0x6e, 0x1c, 0x1d, 0x1e, 0x1f, 0xe1, 0xe2,
/* triangle cross */
0x32, 0x33, 0x42, 0x56, 0x6d, 0, 0x6c, 0x5b,
/* 18 */
/* semi-graphics segments */
0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
/* semi-graphics segments */
0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
/* 20 */
/* mesh hole circuit signals */
0x5a, 0x58, 0xef, 0x4a, 0xe3, 0xee, 0xe4, 0xe5,
/* */
0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed,
/* spade club heart diamond circle face */
0x41, 0x46, 0x53, 0x44, 0x47, 0x48, 0xce, 0xcf,
/* man car car snake UFO */
0xca, 0xcb, 0xcc, 0xcd, 0xc8, 0xc9, 0xdf, 0xc7,
/* 0 */
/* ! " # $ % & ' ( */
0x00, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
/* ( ) < > [ ] / \ */
0x68, 0x69, 0x51, 0x57, 0x52, 0x54, 0x2d, 0x59,
/* 0 1 2 3 4 5 6 7 */
0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
/* 8 9 : ; * = + - */
0x28, 0x29, 0x4f, 0x2c, 0x6b, 0x2b, 0x6a, 0x2a,
/* 2 */
/* @ A B C D E F G */
0x55, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
/* H I J K L M N O */
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
/* P Q R S T U V W */
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
/* X Y Z , . ? yen pound */
0x18, 0x19, 0x1a, 0x2f, 0x2e, 0x49, 0xdd, 0xde,
/* 4 */
/* pi a b c d e f g */
0x60, 0x101, 0x102, 0x103, 0x104, 0x105, 0x106, 0x107,
/* h i j k l m n o */
0x108, 0x109, 0x10a, 0x10b, 0x10c, 0x10d, 0x10e, 0x10f,
/* p q r s t u v w */
0x110, 0x111, 0x112, 0x113, 0x114, 0x115, 0x116, 0x117,
/* x y z arrows */
0x118, 0x119, 0x11a, 0xc0, 0x80, 0x50, 0x40, 0x45,
/* 6 */
/* 。 。 「 」 」 、 、 ァ */
0xbd, 0x1bd, 0x9d, 0xb1, 0x1b1, 0xb5, 0x1b5, 0x9e,
/* ィ ゥ ェ ォ ャ ュ ョ ッ */
0xb2, 0xb6, 0xba, 0xbe, 0x9f, 0xb3, 0xb7, 0xbb,
/* ア イ ウ エ オ カ キ ク */
0xa3, 0x85, 0xa4, 0xa5, 0xa6, 0x94, 0x87, 0x88,
/* ケ コ サ シ ス セ ソ ゛ */
0x9c, 0x82, 0x98, 0x84, 0x92, 0x90, 0x83, 0xbc,
/* 8 */
/* タ チ ツ テ ト ナ ニ ヌ */
0x91, 0x81, 0x9a, 0x97, 0x93, 0x95, 0x89, 0xa1,
/* ネ ノ ハ ヒ フ ヘ ホ ゜ */
0xaf, 0x8b, 0x86, 0x96, 0xa2, 0xab, 0xaa, 0xb8,
/* マ ミ ム メ モ ヤ ユ ヨ */
0x8a, 0x8e, 0xb0, 0xad, 0x8d, 0xa7, 0xa8, 0xa9,
/* ラ リ ル レ ロ ワ ヲ ン */
0x8f, 0x8c, 0xae, 0xac, 0x9b, 0xa0, 0xb4, 0x99,
/* 10 */
/* cursor control ・ ぁ */
0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xb9, 0x19e,
/* ぃ ぅ ぇ ぉ ゃ ゅ ょ っ */
0x1b2, 0x1b6, 0x1ba, 0x1be, 0x19f, 0x1b3, 0x1b7, 0x1bb,
/* あ い う え お か き く */
0x1a3, 0x185, 0x1a4, 0x1a5, 0x1a6, 0x194, 0x187, 0x188,
/* け こ さ し す せ そ ゛ */
0x19c, 0x182, 0x198, 0x184, 0x192, 0x190, 0x183, 0x1bc,
/* 12 */
/* た ち つ て と な に ぬ */
0x191, 0x181, 0x19a, 0x197, 0x193, 0x195, 0x189, 0x1a1,
/* ね の は ひ ふ へ ほ ー */
0x1af, 0x18b, 0x186, 0x196, 0x1a2, 0x1ab, 0x1aa, 0xbf,
/* ま み む め も や ゆ よ */
0x18a, 0x18e, 0x1b0, 0x1ad, 0x18d, 0x1a7, 0x1a8, 0x1a9,
/* ら り る れ ろ わ を ん */
0x18f, 0x18c, 0x1ae, 0x1ac, 0x19b, 0x1a0, 0x1b4, 0x199,
/* Sun Mon Tue Wed Thu Fri Sat birth */
0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
/* year hour min sec yen */
0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0, 0, 0,
/* alternate palette */
0x00005a|CPAL_PRCOLOR, 0x10005a|CPAL_PRCOLOR, 0x20005a|CPAL_PRCOLOR, 0x30005a|CPAL_PRCOLOR, 0x40005a|CPAL_PRCOLOR, 0x50005a|CPAL_PRCOLOR, 0x60005a|CPAL_PRCOLOR, 0x70005a|CPAL_PRCOLOR, 0x000058|CPAL_PRCOLOR, 0x100058|CPAL_PRCOLOR, 0x200058|CPAL_PRCOLOR, 0x300058|CPAL_PRCOLOR, 0x400058|CPAL_PRCOLOR, 0x500058|CPAL_PRCOLOR, 0x600058|CPAL_PRCOLOR, 0x700058|CPAL_PRCOLOR,
0x01005a|CPAL_PRCOLOR, 0x11005a|CPAL_PRCOLOR, 0x21005a|CPAL_PRCOLOR, 0x31005a|CPAL_PRCOLOR, 0x41005a|CPAL_PRCOLOR, 0x51005a|CPAL_PRCOLOR, 0x61005a|CPAL_PRCOLOR, 0x71005a|CPAL_PRCOLOR, 0x010058|CPAL_PRCOLOR, 0x110058|CPAL_PRCOLOR, 0x210058|CPAL_PRCOLOR, 0x310058|CPAL_PRCOLOR, 0x410058|CPAL_PRCOLOR, 0x510058|CPAL_PRCOLOR, 0x610058|CPAL_PRCOLOR, 0x710058|CPAL_PRCOLOR,
0x02005a|CPAL_PRCOLOR, 0x12005a|CPAL_PRCOLOR, 0x22005a|CPAL_PRCOLOR, 0x32005a|CPAL_PRCOLOR, 0x42005a|CPAL_PRCOLOR, 0x52005a|CPAL_PRCOLOR, 0x62005a|CPAL_PRCOLOR, 0x72005a|CPAL_PRCOLOR, 0x020058|CPAL_PRCOLOR, 0x120058|CPAL_PRCOLOR, 0x220058|CPAL_PRCOLOR, 0x320058|CPAL_PRCOLOR, 0x420058|CPAL_PRCOLOR, 0x520058|CPAL_PRCOLOR, 0x620058|CPAL_PRCOLOR, 0x720058|CPAL_PRCOLOR,
0x03005a|CPAL_PRCOLOR, 0x13005a|CPAL_PRCOLOR, 0x23005a|CPAL_PRCOLOR, 0x33005a|CPAL_PRCOLOR, 0x43005a|CPAL_PRCOLOR, 0x53005a|CPAL_PRCOLOR, 0x63005a|CPAL_PRCOLOR, 0x73005a|CPAL_PRCOLOR, 0x030058|CPAL_PRCOLOR, 0x130058|CPAL_PRCOLOR, 0x230058|CPAL_PRCOLOR, 0x330058|CPAL_PRCOLOR, 0x430058|CPAL_PRCOLOR, 0x530058|CPAL_PRCOLOR, 0x630058|CPAL_PRCOLOR, 0x730058|CPAL_PRCOLOR,
0x04005a|CPAL_PRCOLOR, 0x14005a|CPAL_PRCOLOR, 0x24005a|CPAL_PRCOLOR, 0x34005a|CPAL_PRCOLOR, 0x44005a|CPAL_PRCOLOR, 0x54005a|CPAL_PRCOLOR, 0x64005a|CPAL_PRCOLOR, 0x74005a|CPAL_PRCOLOR, 0x040058|CPAL_PRCOLOR, 0x140058|CPAL_PRCOLOR, 0x240058|CPAL_PRCOLOR, 0x340058|CPAL_PRCOLOR, 0x440058|CPAL_PRCOLOR, 0x540058|CPAL_PRCOLOR, 0x640058|CPAL_PRCOLOR, 0x740058|CPAL_PRCOLOR,
0x05005a|CPAL_PRCOLOR, 0x15005a|CPAL_PRCOLOR, 0x25005a|CPAL_PRCOLOR, 0x35005a|CPAL_PRCOLOR, 0x45005a|CPAL_PRCOLOR, 0x55005a|CPAL_PRCOLOR, 0x65005a|CPAL_PRCOLOR, 0x75005a|CPAL_PRCOLOR, 0x050058|CPAL_PRCOLOR, 0x150058|CPAL_PRCOLOR, 0x250058|CPAL_PRCOLOR, 0x350058|CPAL_PRCOLOR, 0x450058|CPAL_PRCOLOR, 0x550058|CPAL_PRCOLOR, 0x650058|CPAL_PRCOLOR, 0x750058|CPAL_PRCOLOR,
0x06005a|CPAL_PRCOLOR, 0x16005a|CPAL_PRCOLOR, 0x26005a|CPAL_PRCOLOR, 0x36005a|CPAL_PRCOLOR, 0x46005a|CPAL_PRCOLOR, 0x56005a|CPAL_PRCOLOR, 0x66005a|CPAL_PRCOLOR, 0x76005a|CPAL_PRCOLOR, 0x060058|CPAL_PRCOLOR, 0x160058|CPAL_PRCOLOR, 0x260058|CPAL_PRCOLOR, 0x360058|CPAL_PRCOLOR, 0x460058|CPAL_PRCOLOR, 0x560058|CPAL_PRCOLOR, 0x660058|CPAL_PRCOLOR, 0x760058|CPAL_PRCOLOR,
0x07005a|CPAL_PRCOLOR, 0x17005a|CPAL_PRCOLOR, 0x27005a|CPAL_PRCOLOR, 0x37005a|CPAL_PRCOLOR, 0x47005a|CPAL_PRCOLOR, 0x57005a|CPAL_PRCOLOR, 0x67005a|CPAL_PRCOLOR, 0x77005a|CPAL_PRCOLOR, 0x070058|CPAL_PRCOLOR, 0x170058|CPAL_PRCOLOR, 0x270058|CPAL_PRCOLOR, 0x370058|CPAL_PRCOLOR, 0x470058|CPAL_PRCOLOR, 0x570058|CPAL_PRCOLOR, 0x670058|CPAL_PRCOLOR, 0x770058|CPAL_PRCOLOR,
0x000, 0x03c, 0x03e, 0x07e, 0x03a, 0x036|CPAL_REVERSE, 0x070|CPAL_REVERSE, 0x043, 0x03c, 0x07c, 0x038, 0x078, 0x034, 0x074, 0x030, 0x070,
0x043, 0x03c|CPAL_REVERSE, 0x03e|CPAL_REVERSE, 0x07e|CPAL_REVERSE, 0x07a, 0x036, 0x070, 0x000, 0x071, 0x076, 0x077, 0x176, 0x177, 0x0e4, 0x0e5, 0x0e6,
0x071|CPAL_REVERSE, 0x071, 0x04e, 0x04d, 0x056|CPAL_REVERSE, 0x042|CPAL_REVERSE, 0x072|CPAL_REVERSE, 0x073|CPAL_REVERSE, 0x031, 0x06d, 0x01b, 0x02d, 0x059, 0x0e3, 0x0e7, 0x0e8,
0x037|CPAL_REVERSE, 0x037, 0x042, 0x056, 0x04d|CPAL_REVERSE, 0x04e|CPAL_REVERSE, 0x032|CPAL_REVERSE, 0x033|CPAL_REVERSE, 0x075, 0x05f, 0x05e, 0x05c, 0x05d, 0x0ee, 0x0e0, 0x0e9,
0x03b, 0x07b, 0x05a, 0x058, 0x0ef, 0x04a, 0x047, 0x048, 0x035, 0x01e, 0x01f, 0x01c, 0x01d, 0x0e1, 0x0e2, 0x0ea,
0x07f, 0x07f|CPAL_REVERSE, 0x041, 0x046, 0x053, 0x044, 0x0ce, 0x0cf, 0x079, 0x04b, 0x04c, 0x072, 0x073, 0x0eb, 0x0ec, 0x0ed,
0x03f, 0x03f|CPAL_REVERSE, 0x06c, 0x05b, 0x068, 0x069, 0x051, 0x057, 0x039, 0x06f, 0x06e, 0x032, 0x033, 0x0c8, 0x0c9, 0x0df,
0x03d, 0x03d|CPAL_REVERSE, 0x0bf, 0x02a, 0x052, 0x054, 0x09d, 0x0b1, 0x07d, 0x062, 0x0bc, 0x1bc, 0x080, 0x050, 0x040, 0x045,
0x000, 0x043, 0x0b9, 0x02e, 0x1bd, 0x0bd, 0x0b8, 0x1b1, 0x03d, 0x1b5, 0x0b5, 0x067, 0x0ca, 0x0cb, 0x0cc, 0x0cd,
0x0f8, 0x0fc, 0x0f4, 0x0fe, 0x0fd, 0x0f7|CPAL_REVERSE, 0x0f3|CPAL_REVERSE, 0x0fb|CPAL_REVERSE, 0x0f1|CPAL_REVERSE, 0x0f2|CPAL_REVERSE, 0x115, 0x015, 0x0c1, 0x0c2, 0x0c3, 0x0c4,
0x0fa, 0x0ff, 0x0f5, 0x0fb, 0x0f7, 0x0f5|CPAL_REVERSE, 0x0f0|CPAL_REVERSE, 0x0fa|CPAL_REVERSE, 0x0f4|CPAL_REVERSE, 0x0f8|CPAL_REVERSE, 0x116, 0x016, 0x118, 0x018, 0x00a, 0x00c,
0x0f2, 0x0f3, 0x0f1, 0x0f9, 0x0f6, 0x0fd|CPAL_REVERSE, 0x0fc|CPAL_REVERSE, 0x0fe|CPAL_REVERSE, 0x0f6|CPAL_REVERSE, 0x0f9|CPAL_REVERSE, 0x117, 0x017, 0x00d, 0x014, 0x019, 0x0dd,
0x061, 0x063, 0x06b, 0x06a, 0x02b, 0x04f, 0x02c, 0x02f, 0x0ba, 0x0a5, 0x009, 0x008, 0x082, 0x089, 0x08b, 0x0ab,
0x0d0, 0x0d1, 0x0d2, 0x0d3, 0x0d4, 0x0d5, 0x0d6, 0x0d7, 0x0d8, 0x0d9, 0x0da, 0x0db, 0x0dc, 0x09b, 0x0ac, 0x08e,
0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,
0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f,
0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,
0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,
0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5a,0x5b,0x5c,0x5d,0x5e,0x5f,
0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f,
0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7a,0x7b,0x7c,0x7d,0x7e,0x7f,
0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,
0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9a,0x9b,0x9c,0x9d,0x9e,0x9f,
0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,
0xb0,0xb1,0xb2,0xb3,0xb4,0xb5,0xb6,0xb7,0xb8,0xb9,0xba,0xbb,0xbc,0xbd,0xbe,0xbf,
0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,
0xd0,0xd1,0xd2,0xd3,0xd4,0xd5,0xd6,0xd7,0xd8,0xd9,0xda,0xdb,0xdc,0xdd,0xde,0xdf,
0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,0xe9,0xea,0xeb,0xec,0xed,0xee,0xef,
0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,0xf8,0xf9,0xfa,0xfb,0xfc,0xfd,0xfe,0xff,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0x100,0x101,0x102,0x103,0x104,0x105,0x106,0x107,0x108,0x109,0x10a,0x10b,0x10c,0x10d,0x10e,0x10f,
0x110,0x111,0x112,0x113,0x114,0x115,0x116,0x117,0x118,0x119,0x11a,0x11b,0x11c,0x11d,0x11e,0x11f,
0x120,0x121,0x122,0x123,0x124,0x125,0x126,0x127,0x128,0x129,0x12a,0x12b,0x12c,0x12d,0x12e,0x12f,
0x130,0x131,0x132,0x133,0x134,0x135,0x136,0x137,0x138,0x139,0x13a,0x13b,0x13c,0x13d,0x13e,0x13f,
0x140,0x141,0x142,0x143,0x144,0x145,0x146,0x147,0x148,0x149,0x14a,0x14b,0x14c,0x14d,0x14e,0x14f,
0x150,0x151,0x152,0x153,0x154,0x155,0x156,0x157,0x158,0x159,0x15a,0x15b,0x15c,0x15d,0x15e,0x15f,
0x160,0x161,0x162,0x163,0x164,0x165,0x166,0x167,0x168,0x169,0x16a,0x16b,0x16c,0x16d,0x16e,0x16f,
0x170,0x171,0x172,0x173,0x174,0x175,0x176,0x177,0x178,0x179,0x17a,0x17b,0x17c,0x17d,0x17e,0x17f,
0x180,0x181,0x182,0x183,0x184,0x185,0x186,0x187,0x188,0x189,0x18a,0x18b,0x18c,0x18d,0x18e,0x18f,
0x190,0x191,0x192,0x193,0x194,0x195,0x196,0x197,0x198,0x199,0x19a,0x19b,0x19c,0x19d,0x19e,0x19f,
0x1a0,0x1a1,0x1a2,0x1a3,0x1a4,0x1a5,0x1a6,0x1a7,0x1a8,0x1a9,0x1aa,0x1ab,0x1ac,0x1ad,0x1ae,0x1af,
0x1b0,0x1b1,0x1b2,0x1b3,0x1b4,0x1b5,0x1b6,0x1b7,0x1b8,0x1b9,0x1ba,0x1bb,0x1bc,0x1bd,0x1be,0x1bf,
0x1c0,0x1c1,0x1c2,0x1c3,0x1c4,0x1c5,0x1c6,0x1c7,0x1c8,0x1c9,0x1ca,0x1cb,0x1cc,0x1cd,0x1ce,0x1cf,
0x1d0,0x1d1,0x1d2,0x1d3,0x1d4,0x1d5,0x1d6,0x1d7,0x1d8,0x1d9,0x1da,0x1db,0x1dc,0x1dd,0x1de,0x1df,
0x1e0,0x1e1,0x1e2,0x1e3,0x1e4,0x1e5,0x1e6,0x1e7,0x1e8,0x1e9,0x1ea,0x1eb,0x1ec,0x1ed,0x1ee,0x1ef,
0x1f0,0x1f1,0x1f2,0x1f3,0x1f4,0x1f5,0x1f6,0x1f7,0x1f8,0x1f9,0x1fa,0x1fb,0x1fc,0x1fd,0x1fe,0x1ff,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
};
/* horizontal reverse */
int hrev[256] = {
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1D, 0x1C, 0x5E, 0x1F,
0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x59, 0x2E, 0x2F,
0x30, 0x7D, 0x33, 0x32, 0x34, 0x79, 0x36, 0x3F, 0x38, 0x75, 0x3A, 0x7B, 0x3C, 0x71, 0x3E, 0x37,
0x45, 0x41, 0x56, 0x43, 0x44, 0x40, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4C, 0x4B, 0x4E, 0x4D, 0x4F,
0x50, 0x57, 0x54, 0x53, 0x52, 0x55, 0x42, 0x51, 0x58, 0x2D, 0xEF, 0x6C, 0x5D, 0x5C, 0x1E, 0x5F,
0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x69, 0x68, 0x6A, 0x6B, 0x5B, 0x6D, 0x6F, 0x6E,
0x70, 0x3D, 0x73, 0x72, 0x74, 0x39, 0x77, 0x76, 0x78, 0x35, 0x7A, 0x3B, 0x7C, 0x31, 0x7E, 0x37,
0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F,
0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