6 #define D 0 /* direct */
7 #define C 1 /* direct cgb-only */
8 #define R 2 /* io register */
9 #define S 3 /* sound register */
10 #define W 4 /* wave pattern */
12 #define F 0xFF /* fail */
14 const byte himask
[256];
16 const byte hi_rmap
[256] =
18 0, 0, R
, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
19 S
, S
, S
, S
, S
, S
, S
, S
, S
, S
, S
, S
, S
, S
, S
, S
,
20 S
, S
, S
, S
, S
, S
, S
, S
, S
, S
, S
, S
, S
, S
, S
, S
,
21 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
22 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, C
, 0, C
,
23 0, C
, C
, C
, C
, C
, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
24 0, 0, 0, 0, 0, 0, 0, 0, C
, C
, C
, C
, 0, 0, 0, 0,
25 C
, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
28 const byte hi_wmap
[256] =
30 R
, R
, R
, R
, R
, R
, R
, R
, R
, R
, R
, R
, R
, R
, R
, R
,
31 S
, S
, S
, S
, S
, S
, S
, S
, S
, S
, S
, S
, S
, S
, S
, S
,
32 S
, S
, S
, S
, S
, S
, S
, S
, S
, S
, S
, S
, S
, S
, S
, S
,
33 S
, S
, S
, S
, S
, S
, S
, S
, S
, S
, S
, S
, S
, S
, S
, S
,
34 R
, R
, R
, R
, R
, R
, R
, R
, R
, R
, R
, R
, 0, R
, 0, R
,
35 0, C
, C
, C
, C
, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
36 0, 0, 0, 0, 0, 0, 0, 0, R
, R
, R
, R
, 0, 0, 0, 0,
37 R
, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
39 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
40 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
41 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
42 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
43 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
44 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
45 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
46 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, R
51 static void no_write()