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
31
enum
Packet2Mode
32
{
33
P2_MODE_NORMAL
= 0,
34
P2_MODE_CHAIN
= 1,
35
};
36
38
enum
Packet2Type
39
{
41
P2_TYPE_NORMAL
= 0x00000000,
43
P2_TYPE_UNCACHED
= 0x20000000,
45
P2_TYPE_UNCACHED_ACCL
= 0x30000000,
47
P2_TYPE_SPRAM
= 0x70000000
48
};
49
51
enum
DmaTagType
52
{
54
P2_DMA_TAG_REFE
= 0,
56
P2_DMA_TAG_CNT
= 1,
58
P2_DMA_TAG_NEXT
= 2,
60
P2_DMA_TAG_REF
= 3,
66
P2_DMA_TAG_REFS
= 4,
73
P2_DMA_TAG_CALL
= 5,
83
P2_DMA_TAG_RET
= 6,
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;
122
u32
OPT1
;
123
u32
OPT2
;
124
}
dma_tag_t
__attribute__((aligned(16)));
125
131
enum
UnpackMode
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
149
enum
VIFOpcode
150
{
156
P2_VIF_NOP
= 0,
161
P2_VIF_STCYCL
= 1,
168
P2_VIF_OFFSET
= 2,
174
P2_VIF_BASE
= 3,
180
P2_VIF_ITOP
= 4,
186
P2_VIF_STMOD
= 5,
192
P2_VIF_MSKPATH3
= 6,
199
P2_VIF_MARK
= 7,
204
P2_VIF_FLUSHE
= 16,
211
P2_VIF_FLUSH
= 17,
217
P2_VIF_FLUSHA
= 18,
223
P2_VIF_MSCAL
= 20,
229
P2_VIF_MSCNT
= 23,
235
P2_VIF_MSCALF
= 21,
241
P2_VIF_STMASK
= 32,
247
P2_VIF_STROW
= 48,
253
P2_VIF_STCOL
= 49,
259
P2_VIF_MPG
= 74,
265
P2_VIF_DIRECT
= 80,
274
P2_VIF_DIRECTHL
= 81
275
};
276
278
typedef
struct
279
{
281
u32
immediate
: 16;
288
u32
num
: 8;
293
u32
cmd
: 8;
294
}
vif_code_t
;
295
300
typedef
struct
301
{
303
u16
max_qwords_count
;
305
enum
Packet2Type
type;
307
enum
Packet2Mode
mode
;
315
u8
tte
;
317
qword_t
*base __attribute__((aligned(64)));
319
qword_t
*
next
;
324
dma_tag_t
*
tag_opened_at
;
329
vif_code_t
*
vif_code_opened_at
;
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
UnpackMode
Definition:
packet2_types.h:132
DmaTagType
DmaTagType
Definition:
packet2_types.h:52
Packet2Mode
Packet2Mode
Definition:
packet2_types.h:32
VIFOpcode
VIFOpcode
Definition:
packet2_types.h:150
Packet2Type
Packet2Type
Definition:
packet2_types.h:39
P2_UNPACK_V4_8
@ P2_UNPACK_V4_8
Definition:
packet2_types.h:144
P2_UNPACK_S_8
@ P2_UNPACK_S_8
Definition:
packet2_types.h:135
P2_UNPACK_V3_32
@ P2_UNPACK_V3_32
Definition:
packet2_types.h:139
P2_UNPACK_V4_16
@ P2_UNPACK_V4_16
Definition:
packet2_types.h:143
P2_UNPACK_V2_16
@ P2_UNPACK_V2_16
Definition:
packet2_types.h:137
P2_UNPACK_V4_32
@ P2_UNPACK_V4_32
Definition:
packet2_types.h:142
P2_UNPACK_V2_32
@ P2_UNPACK_V2_32
Definition:
packet2_types.h:136
P2_UNPACK_V3_16
@ P2_UNPACK_V3_16
Definition:
packet2_types.h:140
P2_UNPACK_V3_8
@ P2_UNPACK_V3_8
Definition:
packet2_types.h:141
P2_UNPACK_V4_5
@ P2_UNPACK_V4_5
Definition:
packet2_types.h:145
P2_UNPACK_S_16
@ P2_UNPACK_S_16
Definition:
packet2_types.h:134
P2_UNPACK_V2_8
@ P2_UNPACK_V2_8
Definition:
packet2_types.h:138
P2_UNPACK_S_32
@ P2_UNPACK_S_32
Definition:
packet2_types.h:133
P2_DMA_TAG_NEXT
@ P2_DMA_TAG_NEXT
Definition:
packet2_types.h:58
P2_DMA_TAG_CNT
@ P2_DMA_TAG_CNT
Definition:
packet2_types.h:56
P2_DMA_TAG_RET
@ P2_DMA_TAG_RET
Definition:
packet2_types.h:83
P2_DMA_TAG_CALL
@ P2_DMA_TAG_CALL
Definition:
packet2_types.h:73
P2_DMA_TAG_REF
@ P2_DMA_TAG_REF
Definition:
packet2_types.h:60
P2_DMA_TAG_REFS
@ P2_DMA_TAG_REFS
Definition:
packet2_types.h:66
P2_DMA_TAG_END
@ P2_DMA_TAG_END
Definition:
packet2_types.h:85
P2_DMA_TAG_REFE
@ P2_DMA_TAG_REFE
Definition:
packet2_types.h:54
P2_MODE_NORMAL
@ P2_MODE_NORMAL
Definition:
packet2_types.h:33
P2_MODE_CHAIN
@ P2_MODE_CHAIN
Definition:
packet2_types.h:34
P2_VIF_MSKPATH3
@ P2_VIF_MSKPATH3
Definition:
packet2_types.h:192
P2_VIF_STROW
@ P2_VIF_STROW
Definition:
packet2_types.h:247
P2_VIF_MPG
@ P2_VIF_MPG
Definition:
packet2_types.h:259
P2_VIF_STMASK
@ P2_VIF_STMASK
Definition:
packet2_types.h:241
P2_VIF_MSCAL
@ P2_VIF_MSCAL
Definition:
packet2_types.h:223
P2_VIF_STCOL
@ P2_VIF_STCOL
Definition:
packet2_types.h:253
P2_VIF_OFFSET
@ P2_VIF_OFFSET
Definition:
packet2_types.h:168
P2_VIF_MSCALF
@ P2_VIF_MSCALF
Definition:
packet2_types.h:235
P2_VIF_FLUSHE
@ P2_VIF_FLUSHE
Definition:
packet2_types.h:204
P2_VIF_FLUSH
@ P2_VIF_FLUSH
Definition:
packet2_types.h:211
P2_VIF_NOP
@ P2_VIF_NOP
Definition:
packet2_types.h:156
P2_VIF_STCYCL
@ P2_VIF_STCYCL
Definition:
packet2_types.h:161
P2_VIF_STMOD
@ P2_VIF_STMOD
Definition:
packet2_types.h:186
P2_VIF_DIRECTHL
@ P2_VIF_DIRECTHL
Definition:
packet2_types.h:274
P2_VIF_ITOP
@ P2_VIF_ITOP
Definition:
packet2_types.h:180
P2_VIF_MSCNT
@ P2_VIF_MSCNT
Definition:
packet2_types.h:229
P2_VIF_DIRECT
@ P2_VIF_DIRECT
Definition:
packet2_types.h:265
P2_VIF_BASE
@ P2_VIF_BASE
Definition:
packet2_types.h:174
P2_VIF_FLUSHA
@ P2_VIF_FLUSHA
Definition:
packet2_types.h:217
P2_VIF_MARK
@ P2_VIF_MARK
Definition:
packet2_types.h:199
P2_TYPE_UNCACHED_ACCL
@ P2_TYPE_UNCACHED_ACCL
Definition:
packet2_types.h:45
P2_TYPE_UNCACHED
@ P2_TYPE_UNCACHED
Definition:
packet2_types.h:43
P2_TYPE_SPRAM
@ P2_TYPE_SPRAM
Definition:
packet2_types.h:47
P2_TYPE_NORMAL
@ P2_TYPE_NORMAL
Definition:
packet2_types.h:41
mode
s32 mode
Definition:
rpc_client.c:15
dma_tag_t
Definition:
packet2_types.h:90
dma_tag_t::IRQ
u64 IRQ
Definition:
packet2_types.h:109
dma_tag_t::SPR
u64 SPR
Definition:
packet2_types.h:121
dma_tag_t::OPT2
u32 OPT2
Definition:
packet2_types.h:123
dma_tag_t::PCE
u64 PCE
Definition:
packet2_types.h:101
dma_tag_t::QWC
u64 QWC
Definition:
packet2_types.h:92
dma_tag_t::PAD
u64 PAD
Definition:
packet2_types.h:93
dma_tag_t::ID
u64 ID
Definition:
packet2_types.h:103
dma_tag_t::ADDR
u64 ADDR
Definition:
packet2_types.h:115
dma_tag_t::OPT1
u32 OPT1
Definition:
packet2_types.h:122
packet2_t
Definition:
packet2_types.h:301
packet2_t::tte
u8 tte
Definition:
packet2_types.h:315
packet2_t::vif_code_opened_at
vif_code_t * vif_code_opened_at
Definition:
packet2_types.h:329
packet2_t::tag_opened_at
dma_tag_t * tag_opened_at
Definition:
packet2_types.h:324
packet2_t::max_qwords_count
u16 max_qwords_count
Definition:
packet2_types.h:303
packet2_t::next
qword_t * next
Definition:
packet2_types.h:319
vif_code_t
Definition:
packet2_types.h:279
vif_code_t::cmd
u32 cmd
Definition:
packet2_types.h:293
vif_code_t::immediate
u32 immediate
Definition:
packet2_types.h:281
vif_code_t::num
u32 num
Definition:
packet2_types.h:288
tamtypes.h
u32
unsigned int u32
Definition:
tamtypes.h:30
u16
unsigned short u16
Definition:
tamtypes.h:24
u8
unsigned char u8
Definition:
tamtypes.h:23
u64
unsigned long u64
Definition:
tamtypes.h:34
Mask
Definition:
packet2_types.h:334
Mask::m5
unsigned int m5
Definition:
packet2_types.h:342
Mask::m12
unsigned int m12
Definition:
packet2_types.h:349
Mask::m11
unsigned int m11
Definition:
packet2_types.h:348
Mask::m0
unsigned int m0
Definition:
packet2_types.h:337
Mask::m4
unsigned int m4
Definition:
packet2_types.h:341
Mask::m6
unsigned int m6
Definition:
packet2_types.h:343
Mask::m
unsigned int m
Definition:
packet2_types.h:354
Mask::m2
unsigned int m2
Definition:
packet2_types.h:339
Mask::m7
unsigned int m7
Definition:
packet2_types.h:344
Mask::m8
unsigned int m8
Definition:
packet2_types.h:345
Mask::m1
unsigned int m1
Definition:
packet2_types.h:338
Mask::m3
unsigned int m3
Definition:
packet2_types.h:340
Mask::m9
unsigned int m9
Definition:
packet2_types.h:346
Mask::m14
unsigned int m14
Definition:
packet2_types.h:351
Mask::m10
unsigned int m10
Definition:
packet2_types.h:347
Mask::m15
unsigned int m15
Definition:
packet2_types.h:352
Mask::m13
unsigned int m13
Definition:
packet2_types.h:350
qword_t
Definition:
tamtypes.h:80
ee
packet2
include
packet2_types.h
Generated on Thu Feb 11 2021 11:42:22 for ps2sdk by
1.9.2