PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
gif_registers.h
Go to the documentation of this file.
1
6#ifndef __GIF_REGISTERS_H__
7#define __GIF_REGISTERS_H__
8
9#include <tamtypes.h>
10
12#define GIF_REG_CTRL *(volatile u32 *)0x10003000
14#define GIF_REG_MODE *(volatile u32 *)0x10003010
16#define GIF_REG_STAT *(volatile u32 *)0x10003020
18#define GIF_REG_TAG0 *(volatile u32 *)0x10003040
20#define GIF_REG_TAG1 *(volatile u32 *)0x10003050
22#define GIF_REG_TAG2 *(volatile u32 *)0x10003060
24#define GIF_REG_TAG3 *(volatile u32 *)0x10003070
26#define GIF_REG_CNT *(volatile u32 *)0x10003080
28#define GIF_REG_P3CNT *(volatile u32 *)0x10003090
30#define GIF_REG_P3TAG *(volatile u32 *)0x100030A0
31
32#define GIF_SET_CTRL(RST, PSE) \
33 (u32)((RST)&0x00000001) << 0 | (u32)((PSE)&0x00000001) << 3
34
35#define GIF_SET_MODE(M3R, IMT) \
36 (u32)((M3R)&0x00000001) << 0 | (u32)((IMT)&0x00000001) << 2
37
38typedef struct
39{
40 u32 m3r : 1;
41 u32 m3p : 1;
42 u32 imt : 1;
43 u32 pse : 1;
44 u32 ip3 : 1;
45 u32 p3q : 1;
46 u32 p2q : 1;
47 u32 p1q : 1;
48 u32 oph : 1;
49 u32 apath : 2;
50 u32 dir : 1;
51 u32 pad0 : 11;
52 u32 fqc : 5;
53 u32 pad1 : 3;
54} __attribute__((packed)) GIFSTAT;
55
56typedef struct
57{
58 u32 nloop : 15;
59 u32 eop : 1;
60 u32 tag : 16;
61} __attribute__((packed)) GIFTAG0;
62
63typedef struct
64{
65 u32 tag : 14;
66 u32 pre : 1;
67 u32 prim : 11;
68 u32 flg : 2;
69 u32 nreg : 4;
70} __attribute__((packed)) GIFTAG1;
71
72typedef struct
73{
74 u32 loregs;
75} GIFTAG2;
76
77typedef struct
78{
79 u32 hiregs;
80} GIFTAG3;
81
82typedef struct
83{
84 u32 loopcnt : 15;
85 u32 pad0 : 1;
86 u32 regcnt : 4;
87 u32 vuaddr : 10;
88 u32 pad1 : 2;
89} __attribute__((packed)) GIFCNT;
90
91typedef struct
92{
93 u32 p3cnt : 15;
94 u32 pad0 : 17;
95} __attribute__((packed)) GIFP3CNT;
96
97typedef struct
98{
99 u32 loopcnt : 15;
100 u32 eop : 1;
101 u32 pad0 : 16;
102} __attribute__((packed)) GIFP3TAG;
103
104#endif /*__GIF_REGISTERS_H__*/