ps2sdk  1.1
A collection of Open Source libraries used for developing applications on Sony's PlayStation 2® (PS2).
packet2_types.h
Go to the documentation of this file.
1 /*
2 # _____ ___ ____ ___ ____
3 # ____| | ____| | | |____|
4 # | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5 #-----------------------------------------------------------------------
6 # (c) 2020 h4570 Sandro Sobczyński <sandro.sobczynski@gmail.com>
7 # Licenced under Academic Free License version 2.0
8 # Review ps2sdk README & LICENSE files for further details.
9 */
10 
19 #ifndef __PACKET2_DATA_TYPES_H__
20 #define __PACKET2_DATA_TYPES_H__
21 
22 #include <tamtypes.h>
23 
32 {
35 };
36 
39 {
41  P2_TYPE_NORMAL = 0x00000000,
43  P2_TYPE_UNCACHED = 0x20000000,
45  P2_TYPE_UNCACHED_ACCL = 0x30000000,
47  P2_TYPE_SPRAM = 0x70000000
48 };
49 
52 {
85  P2_DMA_TAG_END = 7
86 };
87 
89 typedef struct
90 {
92  u64 QWC : 16;
93  u64 PAD : 10;
101  u64 PCE : 2;
103  u64 ID : 3;
109  u64 IRQ : 1;
115  u64 ADDR : 31;
121  u64 SPR : 1;
124 } dma_tag_t __attribute__((aligned(16)));
125 
132 {
146 };
147 
150 {
274  P2_VIF_DIRECTHL = 81
275 };
276 
278 typedef struct
279 {
288  u32 num : 8;
293  u32 cmd : 8;
294 } vif_code_t;
295 
300 typedef struct
301 {
305  enum Packet2Type type;
307  enum Packet2Mode mode;
317  qword_t *base __attribute__((aligned(64)));
330 } packet2_t;
331 
333 typedef union
334 {
335  struct
336  {
337  unsigned int m0 : 2;
338  unsigned int m1 : 2;
339  unsigned int m2 : 2;
340  unsigned int m3 : 2;
341  unsigned int m4 : 2;
342  unsigned int m5 : 2;
343  unsigned int m6 : 2;
344  unsigned int m7 : 2;
345  unsigned int m8 : 2;
346  unsigned int m9 : 2;
347  unsigned int m10 : 2;
348  unsigned int m11 : 2;
349  unsigned int m12 : 2;
350  unsigned int m13 : 2;
351  unsigned int m14 : 2;
352  unsigned int m15 : 2;
353  };
354  unsigned int m;
355 } Mask;
356 
357 #endif /* __PACKET2_DATA_TYPES_H__ */
358  // end of packet2_types subgroup
UnpackMode
DmaTagType
Definition: packet2_types.h:52
Packet2Mode
Definition: packet2_types.h:32
VIFOpcode
Packet2Type
Definition: packet2_types.h:39
@ P2_UNPACK_V4_8
@ P2_UNPACK_S_8
@ P2_UNPACK_V3_32
@ P2_UNPACK_V4_16
@ P2_UNPACK_V2_16
@ P2_UNPACK_V4_32
@ P2_UNPACK_V2_32
@ P2_UNPACK_V3_16
@ P2_UNPACK_V3_8
@ P2_UNPACK_V4_5
@ P2_UNPACK_S_16
@ P2_UNPACK_V2_8
@ P2_UNPACK_S_32
@ P2_DMA_TAG_NEXT
Definition: packet2_types.h:58
@ P2_DMA_TAG_CNT
Definition: packet2_types.h:56
@ P2_DMA_TAG_RET
Definition: packet2_types.h:83
@ P2_DMA_TAG_CALL
Definition: packet2_types.h:73
@ P2_DMA_TAG_REF
Definition: packet2_types.h:60
@ P2_DMA_TAG_REFS
Definition: packet2_types.h:66
@ P2_DMA_TAG_END
Definition: packet2_types.h:85
@ P2_DMA_TAG_REFE
Definition: packet2_types.h:54
@ P2_MODE_NORMAL
Definition: packet2_types.h:33
@ P2_MODE_CHAIN
Definition: packet2_types.h:34
@ P2_VIF_MSKPATH3
@ P2_VIF_STROW
@ P2_VIF_MPG
@ P2_VIF_STMASK
@ P2_VIF_MSCAL
@ P2_VIF_STCOL
@ P2_VIF_OFFSET
@ P2_VIF_MSCALF
@ P2_VIF_FLUSHE
@ P2_VIF_FLUSH
@ P2_VIF_NOP
@ P2_VIF_STCYCL
@ P2_VIF_STMOD
@ P2_VIF_DIRECTHL
@ P2_VIF_ITOP
@ P2_VIF_MSCNT
@ P2_VIF_DIRECT
@ P2_VIF_BASE
@ P2_VIF_FLUSHA
@ P2_VIF_MARK
@ P2_TYPE_UNCACHED_ACCL
Definition: packet2_types.h:45
@ P2_TYPE_UNCACHED
Definition: packet2_types.h:43
@ P2_TYPE_SPRAM
Definition: packet2_types.h:47
@ P2_TYPE_NORMAL
Definition: packet2_types.h:41
s32 mode
Definition: rpc_client.c:15
vif_code_t * vif_code_opened_at
dma_tag_t * tag_opened_at
u16 max_qwords_count
qword_t * next
unsigned int u32
Definition: tamtypes.h:30
unsigned short u16
Definition: tamtypes.h:24
unsigned char u8
Definition: tamtypes.h:23
unsigned long u64
Definition: tamtypes.h:34
unsigned int m5
unsigned int m12
unsigned int m11
unsigned int m0
unsigned int m4
unsigned int m6
unsigned int m
unsigned int m2
unsigned int m7
unsigned int m8
unsigned int m1
unsigned int m3
unsigned int m9
unsigned int m14
unsigned int m10
unsigned int m15
unsigned int m13