PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
packet2_types.h
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{
33 P2_MODE_NORMAL = 0,
34 P2_MODE_CHAIN = 1,
35};
36
39{
41 P2_TYPE_NORMAL = 0x00000000,
43 P2_TYPE_UNCACHED = 0x20000000,
47 P2_TYPE_SPRAM = 0x70000000
48};
49
87
89typedef 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;
122 u32 OPT1;
123 u32 OPT2;
125
132{
133 P2_UNPACK_S_32 = 0x00,
134 P2_UNPACK_S_16 = 0x01,
135 P2_UNPACK_S_8 = 0x02,
136 P2_UNPACK_V2_32 = 0x04,
137 P2_UNPACK_V2_16 = 0x05,
138 P2_UNPACK_V2_8 = 0x06,
139 P2_UNPACK_V3_32 = 0x08,
140 P2_UNPACK_V3_16 = 0x09,
141 P2_UNPACK_V3_8 = 0x0A,
142 P2_UNPACK_V4_32 = 0x0C,
143 P2_UNPACK_V4_16 = 0x0D,
144 P2_UNPACK_V4_8 = 0x0E,
145 P2_UNPACK_V4_5 = 0x0F,
146};
147
276
278typedef struct
279{
281 u32 immediate : 16;
288 u32 num : 8;
293 u32 cmd : 8;
294} vif_code_t;
295
331
333typedef 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
vif_code_t * vif_code_opened_at
enum Packet2Mode mode
enum Packet2Type type
qword_t *base __attribute__((aligned(64)))
dma_tag_t * tag_opened_at
u16 max_qwords_count
qword_t * next
UnpackMode
DmaTagType
Packet2Mode
VIFOpcode
Packet2Type
@ P2_DMA_TAG_NEXT
@ P2_DMA_TAG_CNT
@ P2_DMA_TAG_RET
@ P2_DMA_TAG_CALL
@ P2_DMA_TAG_REF
@ P2_DMA_TAG_REFS
@ P2_DMA_TAG_END
@ P2_DMA_TAG_REFE
@ 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
@ P2_TYPE_UNCACHED
@ P2_TYPE_SPRAM
@ P2_TYPE_NORMAL