PS2SDK
PS2 Homebrew Libraries
packet.h
Go to the documentation of this file.
1 
6 #ifndef __PACKET_H__
7 #define __PACKET_H__
8 
9 #include <tamtypes.h>
10 
12 #define QWC_MAX 65535
13 
14 #define PACKET_NORMAL 0x00
15 #define PACKET_UCAB 0x01
16 #define PACKET_SPR 0x02
17 
23 typedef struct {
24  u32 qwords;
25  u16 qwc;
26  u16 type;
27  qword_t *data __attribute__((aligned(64)));
28 } packet_t;
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
35 extern packet_t *packet_init(int qwords, int type);
36 
38 extern void packet_reset(packet_t *packet);
39 
41 extern void packet_free(packet_t *packet);
42 
44 extern qword_t *packet_increment_qwc(packet_t *packet, int num);
45 
47 static inline qword_t *packet_get_qword(packet_t *packet)
48 {
49  return packet->data;
50 }
51 
52 #ifdef __cplusplus
53 }
54 #endif
55 
56 #endif /* __PACKET_H__ */
packet_increment_qwc
qword_t * packet_increment_qwc(packet_t *packet, int num)
__attribute__
typedef __attribute__
Definition: tlbfunc.c:60
packet_reset
void packet_reset(packet_t *packet)
Definition: packet.c:89
tamtypes.h
packet_free
void packet_free(packet_t *packet)
Definition: packet.c:63
__attribute__
Definition: gif_registers.h:38
packet_get_qword
static qword_t * packet_get_qword(packet_t *packet)
Definition: packet.h:47
packet_t
Definition: packet.h:23
packet_init
packet_t * packet_init(int qwords, int type)
Definition: packet.c:8