hitachi_hm53462_rop.h Source File

Back to the index.

hitachi_hm53462_rop.h
Go to the documentation of this file.
1 #ifndef HITACHI_HM53462_ROP_H
2 #define HITACHI_HM53462_ROP_H
3 
4 /* Imported into GXemul 2018-02-14, from OpenBSD 6.2. */
5 
6 /*
7  * Copyright (c) 2013 Kenji Aoyama
8  *
9  * Permission to use, copy, modify, and distribute this software for any
10  * purpose with or without fee is hereby granted, provided that the above
11  * copyright notice and this permission notice appear in all copies.
12  *
13  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
14  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
15  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
16  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
17  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
18  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
19  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20  */
21 
22 /*
23  * Helper macros
24  */
25 #define W(addr) ((u_int32_t *)(addr))
26 #define R(addr) ((u_int32_t *)((u_int8_t *)(addr) + 0x40000))
27 #define P0(addr) ((u_int32_t *)((u_int8_t *)(addr) + 0x40000))
28 #define P1(addr) ((u_int32_t *)((u_int8_t *)(addr) + 0x80000))
29 #define P2(addr) ((u_int32_t *)((u_int8_t *)(addr) + 0xC0000))
30 #define P3(addr) ((u_int32_t *)((u_int8_t *)(addr) + 0x100000))
31 
32 /*
33  * Replacement Rules (rops) (derived from hp300)
34  */
35 #define RR_CLEAR 0x0
36 #define RR_COPY 0x3
37 
38 /*
39  * ROP function
40  *
41  * LUNA's frame buffer uses Hitach HM53462 video RAM, which has raster
42  * (logic) operation, or ROP, function. To use ROP function on LUNA, write
43  * a 32bit `mask' value to the specified address corresponding to each ROP
44  * logic.
45  *
46  * D: the data writing to the video RAM
47  * M: the data already stored on the video RAM
48  */
49 
50 /* operation index the video RAM contents will be */
51 #define ROP_ZERO 0 /* all 0 */
52 #define ROP_AND1 1 /* D & M */
53 #define ROP_AND2 2 /* ~D & M */
54 /* Not used on LUNA 3 */
55 #define ROP_AND3 4 /* D & ~M */
56 #define ROP_THROUGH 5 /* D */
57 #define ROP_EOR 6 /* (~D & M) | (D & ~M) */
58 #define ROP_OR1 7 /* D | M */
59 #define ROP_NOR 8 /* ~D | ~M */
60 #define ROP_ENOR 9 /* (D & M) | (~D & ~M) */
61 #define ROP_INV1 10 /* ~D */
62 #define ROP_OR2 11 /* ~D | M */
63 #define ROP_INV2 12 /* ~M */
64 #define ROP_OR3 13 /* D | ~M */
65 #define ROP_NAND 14 /* ~D | ~M */
66 #define ROP_ONE 15 /* all 1 */
67 
68 #endif /* HITACHI_HM53462_ROP_H */
69 

Generated on Tue Aug 25 2020 19:25:06 for GXemul by doxygen 1.8.18