]> git.sesse.net Git - pistorm/blob - platforms/amiga/rtg/rtg.h
Add dumb framebuffer RTG
[pistorm] / platforms / amiga / rtg / rtg.h
1 #define PIGFX_RTG_BASE 0x70000000
2 #define PIGFX_RTG_SIZE 0x04000000
3
4 #define PIGFX_REG_SIZE 0x00010000
5
6 #define CARD_OFFSET 0
7
8 enum pi_regs {
9   RTG_COMMAND = CARD_OFFSET + 0x00,
10   RTG_X1      = CARD_OFFSET + 0x02,
11   RTG_X2      = CARD_OFFSET + 0x04,
12   RTG_X3      = CARD_OFFSET + 0x06,
13   RTG_Y1      = CARD_OFFSET + 0x08,
14   RTG_Y2      = CARD_OFFSET + 0x0A,
15   RTG_Y3      = CARD_OFFSET + 0x0C,
16   RTG_FORMAT  = CARD_OFFSET + 0x0E,
17   RTG_RGB1    = CARD_OFFSET + 0x10,
18   RTG_RGB2    = CARD_OFFSET + 0x14,
19   RTG_ADDR1   = CARD_OFFSET + 0x18,
20   RTG_ADDR2   = CARD_OFFSET + 0x1C,
21   RTG_U81     = CARD_OFFSET + 0x20,
22   RTG_U82     = CARD_OFFSET + 0x21,
23   RTG_U83     = CARD_OFFSET + 0x22,
24   RTG_U84     = CARD_OFFSET + 0x23,
25 };
26
27 enum rtg_cmds {
28   RTGCMD_SETGC,
29   RTGCMD_SETPAN,
30   RTGCMD_SETCLUT,
31   RTGCMD_ENABLE,
32   RTGCMD_SETDISPLAY,
33   RTGCMD_SETSWITCH,
34 };
35
36 enum rtg_formats {
37   RTGFMT_8BIT,
38   RTGFMT_RBG565,
39   RTGFMT_RGB32,
40   RTGFMT_RGB555,
41   RTGFMT_NUM,
42 };
43
44 void rtg_write(uint32_t address, uint32_t value, uint8_t mode);
45 unsigned int rtg_read(uint32_t address, uint8_t mode);