]> git.sesse.net Git - pistorm/blob - platforms/amiga/rtg/rtg.h
Dysfunctional SDL2 RTG output
[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   RTGCMD_FILLRECT,
35 };
36
37 enum rtg_formats {
38   RTGFMT_8BIT,
39   RTGFMT_RBG565,
40   RTGFMT_RGB32,
41   RTGFMT_RGB555,
42   RTGFMT_NUM,
43 };
44
45 void rtg_write(uint32_t address, uint32_t value, uint8_t mode);
46 unsigned int rtg_read(uint32_t address, uint8_t mode);
47 void rtg_set_clut_entry(uint8_t index, uint8_t r, uint8_t g, uint8_t b);
48 void rtg_init_display();
49 void rtg_shutdown_display();
50
51 void rtg_fillrect(uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint32_t color, uint16_t pitch, uint16_t format, uint8_t mask);