ps2sdk  1.1
A collection of Open Source libraries used for developing applications on Sony's PlayStation 2® (PS2).

Macros

#define MAKE_VIF_CODE(_immediate, _num, _cmd, _irq)   ((u32)(_immediate) | ((u32)(_num) << 16) | ((u32)(_cmd) << 24) | ((u32)(_irq) << 31))
 

Functions

static void packet2_vif_open_unpack (packet2_t *packet2, enum UnpackMode mode, u32 vuAddr, u8 dblBuffered, u8 masked, u8 usigned, u8 irq)
 
static void packet2_vif_close_unpack_manual (packet2_t *packet2, u32 unpack_num)
 
u32 packet2_vif_close_unpack_auto (packet2_t *packet2, u32 wl, u32 cl)
 
static void packet2_vif_open_direct (packet2_t *packet2, u8 irq)
 
static void packet2_vif_close_direct_manual (packet2_t *packet2, u32 qwords)
 
static void packet2_vif_close_direct_auto (packet2_t *packet2)
 
static void packet2_vif_nop (packet2_t *packet2, u8 irq)
 
static void packet2_vif_pad96 (packet2_t *packet2)
 
static void packet2_vif_pad128 (packet2_t *packet2)
 
static void packet2_vif_mpg (packet2_t *packet2, u32 num, u32 addr, u8 irq)
 
static void packet2_vif_stcycl (packet2_t *packet2, u32 wl, u32 cl, u8 irq)
 
static void packet2_vif_offset (packet2_t *packet2, u32 offset, u8 irq)
 
static void packet2_vif_base (packet2_t *packet2, u32 base, u8 irq)
 
static void packet2_vif_flush (packet2_t *packet2, u8 irq)
 
static void packet2_vif_mscal (packet2_t *packet2, u32 addr, u8 irq)
 
static void packet2_vif_mscnt (packet2_t *packet2, u8 irq)
 
static void packet2_vif_itop (packet2_t *packet2, u32 itops, u8 irq)
 
static void packet2_vif_stmod (packet2_t *packet2, u32 mode, u8 irq)
 
static void packet2_vif_mskpath3 (packet2_t *packet2, u32 mask, u8 irq)
 
static void packet2_vif_mark (packet2_t *packet2, u32 value, u8 irq)
 
static void packet2_vif_flushe (packet2_t *packet2, u8 irq)
 
static void packet2_vif_flusha (packet2_t *packet2, u8 irq)
 
static void packet2_vif_mscalf (packet2_t *packet2, u32 addr, u8 irq)
 
static void packet2_vif_stmask (packet2_t *packet2, Mask mask, u8 irq)
 
static void packet2_vif_strow (packet2_t *packet2, const u32 *row_arr, u8 irq)
 
static void packet2_vif_stcol (packet2_t *packet2, const u32 *col_arr, u8 irq)
 
void packet2_vif_add_micro_program (packet2_t *packet2, u32 dest, u32 *start, u32 *end)
 

Detailed Description

VIF related functions of libpacket2.

Macro Definition Documentation

◆ MAKE_VIF_CODE

#define MAKE_VIF_CODE (   _immediate,
  _num,
  _cmd,
  _irq 
)    ((u32)(_immediate) | ((u32)(_num) << 16) | ((u32)(_cmd) << 24) | ((u32)(_irq) << 31))

Definition at line 26 of file packet2_vif.h.

Function Documentation

◆ packet2_vif_add_micro_program()

void packet2_vif_add_micro_program ( packet2_t packet2,
u32  dest,
u32 start,
u32 end 
)

Add VU micro program into packet2. Packet2 MODE for micro program upload: Chain

Parameters
destVU destination address (divided by 16).
startStart address.
endEnd address.

Definition at line 14 of file packet2_vif.c.

15 {
16  // get the size of the code as we can only send 256 instructions in each MPGtag
17  u32 count = (end - start) / 2;
18  if (count & 1)
19  count++;
20 
21  u32 *l_start = start;
22  while (count > 0)
23  {
24  u16 curr_count = count > 256 ? 256 : count;
25  packet2_chain_ref(packet2, l_start, curr_count / 2, 0, 0, 0);
26  packet2_vif_nop(packet2, 0);
27  packet2_vif_mpg(packet2, curr_count & 0xFF, dest, 0);
28  l_start += curr_count * 2;
29  count -= curr_count;
30  dest += curr_count;
31  }
32 }
static void packet2_chain_ref(packet2_t *packet2, const void *ref_data, u32 qw_length, u8 irq, u8 spr, u32 pce)
static void packet2_vif_nop(packet2_t *packet2, u8 irq)
Definition: packet2_vif.h:135
static void packet2_vif_mpg(packet2_t *packet2, u32 num, u32 addr, u8 irq)
Definition: packet2_vif.h:167
unsigned int u32
Definition: tamtypes.h:30
unsigned short u16
Definition: tamtypes.h:24

References packet2_chain_ref(), packet2_vif_mpg(), and packet2_vif_nop().

Referenced by vu1_upload_micro_program().

◆ packet2_vif_base()

static void packet2_vif_base ( packet2_t packet2,
u32  base,
u8  irq 
)
inlinestatic

Add BASE VIF opcode.

Note
Alignment alert. Size of word (1/4). For more details, check description of VIFOpcode.
Parameters
packet2Pointer to packet.
baseBase address of double buffer.
irqInterrupt Request. False by default.

Definition at line 207 of file packet2_vif.h.

208  {
209  packet2_add_u32(packet2, MAKE_VIF_CODE(base, 0, P2_VIF_BASE, irq));
210  }
@ P2_VIF_BASE
#define MAKE_VIF_CODE(_immediate, _num, _cmd, _irq)
Definition: packet2_vif.h:26
static void packet2_add_u32(packet2_t *packet2, const u32 val)
Definition: packet2.h:134

References MAKE_VIF_CODE, P2_VIF_BASE, and packet2_add_u32().

Referenced by packet2_utils_vu_add_double_buffer().

◆ packet2_vif_close_direct_auto()

static void packet2_vif_close_direct_auto ( packet2_t packet2)
inlinestatic

Close DIRECT automatically. In reality, get back to pointer "vif_code_opened_at" and fix immediate value with qwords counted from last packet2_vif_open_direct().

Parameters
packet2Pointer to packet.

Definition at line 123 of file packet2_vif.h.

124  {
125  return packet2_vif_close_direct_manual(packet2, ((u32)packet2->next - ((u32)packet2->vif_code_opened_at + 4)) >> 4);
126  }
static void packet2_vif_close_direct_manual(packet2_t *packet2, u32 qwords)
Definition: packet2_vif.h:109
vif_code_t * vif_code_opened_at
qword_t * next

References packet2_t::next, packet2_vif_close_direct_manual(), and packet2_t::vif_code_opened_at.

◆ packet2_vif_close_direct_manual()

static void packet2_vif_close_direct_manual ( packet2_t packet2,
u32  qwords 
)
inlinestatic

Close DIRECT manually. In reality, get back to pointer "vif_code_opened_at" and fix immediate value with given value.

Parameters
packet2Pointer to packet.
qwordsQwords count.

Definition at line 109 of file packet2_vif.h.

110  {
111  assert(packet2->vif_code_opened_at != NULL); // There is open UNPACK/DIRECT.
112  assert((((u32)packet2->next - ((u32)packet2->vif_code_opened_at + 4)) & 0xF) == 0);
113  packet2->vif_code_opened_at->immediate = qwords;
114  packet2->vif_code_opened_at = (vif_code_t *)NULL;
115  }
#define NULL
Definition: tamtypes.h:91

References vif_code_t::immediate, packet2_t::next, NULL, and packet2_t::vif_code_opened_at.

Referenced by packet2_vif_close_direct_auto().

◆ packet2_vif_close_unpack_auto()

u32 packet2_vif_close_unpack_auto ( packet2_t packet2,
u32  wl,
u32  cl 
)

Close UNPACK automatically. In reality, get back to pointer "vif_code_opened_at" and fix num value with qwords counted from last packet2_vif_open_unpack().

Parameters
packet2Pointer to packet.
wlWL Value (look at STCYCL)
clCL Value (look at STCYCL)
Returns
Unpacked qwords count

Definition at line 34 of file packet2_vif.c.

35 {
36  assert(packet2->vif_code_opened_at != NULL); // There is open UNPACK/DIRECT.
37  assert(((u32)packet2->next & 0x3) == 0); // Make sure we're u32 aligned
38  assert((packet2->vif_code_opened_at->cmd & 0x60) == 0x60); // It was UNPACK
39 
40  u32 vn = (packet2->vif_code_opened_at->cmd & 0xC) >> 2;
41  u32 vl = packet2->vif_code_opened_at->cmd & 0x3;
42 
43  // "the goal here is to find the num field of the open unpack, which is the number of
44  // qwords ACTUALLY WRITTEN to vu memory (it does not count quads that are skipped in
45  // "skipping write" mode.) But first forget about skipping/filling writes and compute the number
46  // of qwords that the data in this packet will expand to."
47  u32 bytes_count = (u32)packet2->next - (u32)packet2->vif_code_opened_at - 4;
48  u32 block_bytes_count = 4 >> vl;
49  u32 quad_blocks_count = vn + 1;
50 
51  // "make sure that the data length is a multiple of 8, 16, or 32 bits, whichever is appropriate"
52  assert((bytes_count & (block_bytes_count - 1)) == 0);
53  u32 quads_count = (bytes_count / block_bytes_count) / quad_blocks_count;
54 
55  // "We have the number of quads our data will directly expand to, so now we need to account for
56  // skipping/filling write modes.""
57 
58  // "skipping write is easy -- we are already done"
59 
60  // "filling write: now we get ambiguous -- what to do when quads_count == CL in the last
61  // block? I will say that in this case the vif should still do the full wl length block, filling
62  // with internal registers. If you want different behavior call packet2_vif_close_unpack_manual
63  // with a num field you've computed yourself"
64  if (cl < wl)
65  {
66  u32 wl_blocks_count = (quads_count / cl);
67  u32 last_block_quads = quads_count - wl_blocks_count * cl;
68  if (last_block_quads == cl)
69  last_block_quads = wl;
70  quads_count = wl_blocks_count * wl + last_block_quads;
71  }
72 
73  packet2_vif_close_unpack_manual(packet2, quads_count);
74  return quads_count;
75 }
static void packet2_vif_close_unpack_manual(packet2_t *packet2, u32 unpack_num)
Definition: packet2_vif.h:68

References vif_code_t::cmd, packet2_t::next, NULL, packet2_vif_close_unpack_manual(), and packet2_t::vif_code_opened_at.

Referenced by packet2_utils_vu_close_unpack().

◆ packet2_vif_close_unpack_manual()

static void packet2_vif_close_unpack_manual ( packet2_t packet2,
u32  unpack_num 
)
inlinestatic

Close UNPACK manually. In reality, get back to pointer "vif_code_opened_at" and fix num value with qwords counted from last packet2_vif_open_unpack().

Parameters
packet2Pointer to packet.
unpack_numAmount of data written to the VU Mem (qwords) or MicroMem (dwords). 256 is max value!

Definition at line 68 of file packet2_vif.h.

69  {
70  assert(packet2->vif_code_opened_at != NULL); // There is open UNPACK/DIRECT.
71  assert(((u32)packet2->next & 0x3) == 0); // Make sure we're u32 aligned
72  assert((packet2->vif_code_opened_at->cmd & 0x60) == 0x60); // It was UNPACK
73  assert(unpack_num <= 256);
74  packet2->vif_code_opened_at->num = (unpack_num == 256) ? 0 : unpack_num;
75  packet2->vif_code_opened_at = (vif_code_t *)NULL;
76  }

References vif_code_t::cmd, packet2_t::next, NULL, vif_code_t::num, and packet2_t::vif_code_opened_at.

Referenced by packet2_utils_vu_add_unpack_data(), and packet2_vif_close_unpack_auto().

◆ packet2_vif_flush()

static void packet2_vif_flush ( packet2_t packet2,
u8  irq 
)
inlinestatic

Add FLUSH VIF opcode.

Note
Alignment alert. Size of word (1/4). For more details, check description of VIFOpcode.
Parameters
packet2Pointer to packet.
irqInterrupt Request. False by default.

Definition at line 219 of file packet2_vif.h.

220  {
221  packet2_add_u32(packet2, MAKE_VIF_CODE(0, 0, P2_VIF_FLUSH, irq));
222  }
@ P2_VIF_FLUSH

References MAKE_VIF_CODE, P2_VIF_FLUSH, and packet2_add_u32().

Referenced by packet2_utils_vu_add_continue_program(), and packet2_utils_vu_add_start_program().

◆ packet2_vif_flusha()

static void packet2_vif_flusha ( packet2_t packet2,
u8  irq 
)
inlinestatic

Add FLUSHA VIF opcode.

Note
Alignment alert. Size of word (1/4). For more details, check description of VIFOpcode.
Parameters
packet2Pointer to packet.
irqInterrupt Request. False by default.

Definition at line 320 of file packet2_vif.h.

321  {
322  packet2_add_u32(packet2, MAKE_VIF_CODE(0, 0, P2_VIF_FLUSHA, irq));
323  }
@ P2_VIF_FLUSHA

References MAKE_VIF_CODE, P2_VIF_FLUSHA, and packet2_add_u32().

◆ packet2_vif_flushe()

static void packet2_vif_flushe ( packet2_t packet2,
u8  irq 
)
inlinestatic

Add FLUSHE VIF opcode.

Note
Alignment alert. Size of word (1/4). For more details, check description of VIFOpcode.
Parameters
packet2Pointer to packet.
irqInterrupt Request. False by default.

Definition at line 308 of file packet2_vif.h.

309  {
310  packet2_add_u32(packet2, MAKE_VIF_CODE(0, 0, P2_VIF_FLUSHE, irq));
311  }
@ P2_VIF_FLUSHE

References MAKE_VIF_CODE, P2_VIF_FLUSHE, and packet2_add_u32().

◆ packet2_vif_itop()

static void packet2_vif_itop ( packet2_t packet2,
u32  itops,
u8  irq 
)
inlinestatic

Add ITOP VIF opcode.

Note
Alignment alert. Size of word (1/4). For more details, check description of VIFOpcode.
Parameters
packet2Pointer to packet.
itopsValue for VU XITOP instruction.
irqInterrupt Request. False by default.

Definition at line 257 of file packet2_vif.h.

258  {
259  packet2_add_u32(packet2, MAKE_VIF_CODE(itops, 0, P2_VIF_ITOP, irq));
260  }
@ P2_VIF_ITOP

References MAKE_VIF_CODE, P2_VIF_ITOP, and packet2_add_u32().

◆ packet2_vif_mark()

static void packet2_vif_mark ( packet2_t packet2,
u32  value,
u8  irq 
)
inlinestatic

Add MARK VIF opcode.

Note
Alignment alert. Size of word (1/4). For more details, check description of VIFOpcode.
Parameters
packet2Pointer to packet.
valueValue.
irqInterrupt Request. False by default.

Definition at line 296 of file packet2_vif.h.

297  {
298  packet2_add_u32(packet2, MAKE_VIF_CODE(value, 0, P2_VIF_MARK, irq));
299  }
@ P2_VIF_MARK

References MAKE_VIF_CODE, P2_VIF_MARK, and packet2_add_u32().

◆ packet2_vif_mpg()

static void packet2_vif_mpg ( packet2_t packet2,
u32  num,
u32  addr,
u8  irq 
)
inlinestatic

Add MPG VIF opcode.

Note
Alignment alert. Size of word (1/4). For more details, check description of VIFOpcode.
Parameters
packet2Pointer to packet.
numNumber of 64-bit data.
addrAddress.
irqInterrupt Request. False by default.

Definition at line 167 of file packet2_vif.h.

168  {
169  packet2_add_u32(packet2, MAKE_VIF_CODE(addr, num, P2_VIF_MPG, irq));
170  }
@ P2_VIF_MPG

References MAKE_VIF_CODE, P2_VIF_MPG, and packet2_add_u32().

Referenced by packet2_vif_add_micro_program().

◆ packet2_vif_mscal()

static void packet2_vif_mscal ( packet2_t packet2,
u32  addr,
u8  irq 
)
inlinestatic

Add MSCAL VIF opcode.

Note
Alignment alert. Size of word (1/4). For more details, check description of VIFOpcode.
Parameters
packet2Pointer to packet.
addrStarting address.
irqInterrupt Request. False by default.

Definition at line 232 of file packet2_vif.h.

233  {
234  packet2_add_u32(packet2, MAKE_VIF_CODE(addr, 0, P2_VIF_MSCAL, irq));
235  }
@ P2_VIF_MSCAL

References MAKE_VIF_CODE, P2_VIF_MSCAL, and packet2_add_u32().

Referenced by packet2_utils_vu_add_start_program().

◆ packet2_vif_mscalf()

static void packet2_vif_mscalf ( packet2_t packet2,
u32  addr,
u8  irq 
)
inlinestatic

Add MSCALF VIF opcode.

Note
Alignment alert. Size of word (1/4). For more details, check description of VIFOpcode.
Parameters
packet2Pointer to packet.
addrAddress.
irqInterrupt Request. False by default.

Definition at line 333 of file packet2_vif.h.

334  {
335  packet2_add_u32(packet2, MAKE_VIF_CODE(addr, 0, P2_VIF_MSCALF, irq));
336  }
@ P2_VIF_MSCALF

References MAKE_VIF_CODE, P2_VIF_MSCALF, and packet2_add_u32().

◆ packet2_vif_mscnt()

static void packet2_vif_mscnt ( packet2_t packet2,
u8  irq 
)
inlinestatic

Add MSCNT VIF opcode.

Note
Alignment alert. Size of word (1/4). For more details, check description of VIFOpcode.
Parameters
packet2Pointer to packet.
irqInterrupt Request. False by default.

Definition at line 244 of file packet2_vif.h.

245  {
246  packet2_add_u32(packet2, MAKE_VIF_CODE(0, 0, P2_VIF_MSCNT, irq));
247  }
@ P2_VIF_MSCNT

References MAKE_VIF_CODE, P2_VIF_MSCNT, and packet2_add_u32().

Referenced by packet2_utils_vu_add_continue_program().

◆ packet2_vif_mskpath3()

static void packet2_vif_mskpath3 ( packet2_t packet2,
u32  mask,
u8  irq 
)
inlinestatic

Add MSKPATH3 VIF opcode.

Note
Alignment alert. Size of word (1/4). For more details, check description of VIFOpcode.
Parameters
packet2Pointer to packet.
maskMask.
irqInterrupt Request. False by default.

Definition at line 283 of file packet2_vif.h.

284  {
285  packet2_add_u32(packet2, MAKE_VIF_CODE(mask, 0, P2_VIF_MSKPATH3, irq));
286  }
@ P2_VIF_MSKPATH3

References MAKE_VIF_CODE, P2_VIF_MSKPATH3, and packet2_add_u32().

◆ packet2_vif_nop()

static void packet2_vif_nop ( packet2_t packet2,
u8  irq 
)
inlinestatic

Add NOP VIF opcode.

Note
Alignment alert. Size of word (1/4). For more details, check description of VIFOpcode.
Parameters
packet2Pointer to packet.
irqInterrupt Request. False by default.

Definition at line 135 of file packet2_vif.h.

136  {
137  packet2_add_u32(packet2, MAKE_VIF_CODE(0, 0, P2_VIF_NOP, irq));
138  }
@ P2_VIF_NOP

References MAKE_VIF_CODE, P2_VIF_NOP, and packet2_add_u32().

Referenced by packet2_utils_vu_add_end_tag(), and packet2_vif_add_micro_program().

◆ packet2_vif_offset()

static void packet2_vif_offset ( packet2_t packet2,
u32  offset,
u8  irq 
)
inlinestatic

Add OFFSET VIF opcode.

Note
Alignment alert. Size of word (1/4). For more details, check description of VIFOpcode.
Parameters
packet2Pointer to packet.
offsetOffset. BASE+OFFSET will be the address of second buffer.
irqInterrupt Request. False by default.

Definition at line 194 of file packet2_vif.h.

195  {
196  packet2_add_u32(packet2, MAKE_VIF_CODE(offset, 0, P2_VIF_OFFSET, irq));
197  }
@ P2_VIF_OFFSET

References MAKE_VIF_CODE, P2_VIF_OFFSET, and packet2_add_u32().

Referenced by packet2_utils_vu_add_double_buffer().

◆ packet2_vif_open_direct()

static void packet2_vif_open_direct ( packet2_t packet2,
u8  irq 
)
inlinestatic

Add DIRECT VIF opcode.

Note
Direct must be closed via packet2_vif_close_direct_manual() or packet2_vif_close : "memory"

Definition at line 95 of file packet2_vif.h.

96  {
97  assert(packet2->vif_code_opened_at == NULL); // All previous UNPACK/DIRECT are closed.
98  packet2->vif_code_opened_at = (vif_code_t *)packet2->next;
99  packet2_add_u32(packet2, MAKE_VIF_CODE(0, 0, P2_VIF_DIRECT, irq));
100  }
@ P2_VIF_DIRECT

References MAKE_VIF_CODE, packet2_t::next, NULL, P2_VIF_DIRECT, packet2_add_u32(), and packet2_t::vif_code_opened_at.

◆ packet2_vif_open_unpack()

static void packet2_vif_open_unpack ( packet2_t packet2,
enum UnpackMode  mode,
u32  vuAddr,
u8  dblBuffered,
u8  masked,
u8  usigned,
u8  irq 
)
inlinestatic

Add UNPACK VIF opcode.

Note
packet2_vif_close_unpack() required. Qwords are counted automatically. For more details, check description of vif_code_t.
Parameters
packet2Pointer to packet.
modeUnpack mode
vuAddrMemory address (divided by 16).
dblBuffered(VIF1 only) 1 - Adds VIF1_TOPS register to ADDR 0 - Does not use VIF1_TOPS register.
maskedIs masked
usigned1 - Unsigned - Decompress by padding 0 to the upper field 0 - Signed - Decompress by sign extension
irqInterrupt Request. False by default.

Definition at line 50 of file packet2_vif.h.

51  {
52  assert(packet2->vif_code_opened_at == NULL); // All previous UNPACK/DIRECT are closed.
53  packet2->vif_code_opened_at = (vif_code_t *)packet2->next;
54  packet2_add_u32(packet2,
55  MAKE_VIF_CODE(vuAddr | ((u32)usigned << 14) | ((u32)dblBuffered << 15),
56  0,
57  mode | ((u32)masked << 4) | 0x60, irq));
58  }
s32 mode
Definition: rpc_client.c:15

References MAKE_VIF_CODE, mode, packet2_t::next, NULL, packet2_add_u32(), and packet2_t::vif_code_opened_at.

Referenced by packet2_utils_vu_add_unpack_data(), and packet2_utils_vu_open_unpack().

◆ packet2_vif_pad128()

static void packet2_vif_pad128 ( packet2_t packet2)
inlinestatic

Fill with NOP VIF opcode to align to 128bits

Parameters
packet2Pointer to packet.

Definition at line 153 of file packet2_vif.h.

154  {
155  packet2_pad128(packet2, MAKE_VIF_CODE(0, 0, P2_VIF_NOP, 0));
156  }
static void packet2_pad128(packet2_t *packet2, const u32 val)
Definition: packet2.h:173

References MAKE_VIF_CODE, P2_VIF_NOP, and packet2_pad128().

Referenced by packet2_utils_vu_close_unpack().

◆ packet2_vif_pad96()

static void packet2_vif_pad96 ( packet2_t packet2)
inlinestatic

Fill with NOP VIF opcode to align to 96bits

Parameters
packet2Pointer to packet.

Definition at line 144 of file packet2_vif.h.

145  {
146  packet2_pad96(packet2, MAKE_VIF_CODE(0, 0, P2_VIF_NOP, 0));
147  }
static void packet2_pad96(packet2_t *packet2, const u32 val)
Definition: packet2.h:164

References MAKE_VIF_CODE, P2_VIF_NOP, and packet2_pad96().

◆ packet2_vif_stcol()

static void packet2_vif_stcol ( packet2_t packet2,
const u32 col_arr,
u8  irq 
)
inlinestatic

Add STCOL VIF opcode.

Note
Alignment alert. Size of 5 x word (1+1/4). For more details, check description of VIFOpcode.
Parameters
packet2Pointer to packet.
col_arrColumn array.
irqInterrupt Request. False by default.

Definition at line 377 of file packet2_vif.h.

378  {
379  packet2_add_u32(packet2, MAKE_VIF_CODE(0, 0, P2_VIF_STCOL, irq));
380  packet2_add_u32(packet2, col_arr[0]);
381  packet2_add_u32(packet2, col_arr[1]);
382  packet2_add_u32(packet2, col_arr[2]);
383  packet2_add_u32(packet2, col_arr[3]);
384  }
@ P2_VIF_STCOL

References MAKE_VIF_CODE, P2_VIF_STCOL, and packet2_add_u32().

◆ packet2_vif_stcycl()

static void packet2_vif_stcycl ( packet2_t packet2,
u32  wl,
u32  cl,
u8  irq 
)
inlinestatic

Add STCYCL VIF opcode.

Note
Alignment alert. Size of word (1/4). For more details, check description of VIFOpcode.
Parameters
packet2Pointer to packet.
wlWL field.
clCL field.
irqInterrupt Request. False by default.

Definition at line 181 of file packet2_vif.h.

182  {
183  packet2_add_u32(packet2, MAKE_VIF_CODE(cl | (wl << 8), 0, P2_VIF_STCYCL, irq));
184  }
@ P2_VIF_STCYCL

References MAKE_VIF_CODE, P2_VIF_STCYCL, and packet2_add_u32().

Referenced by packet2_utils_vu_add_unpack_data(), and packet2_utils_vu_open_unpack().

◆ packet2_vif_stmask()

static void packet2_vif_stmask ( packet2_t packet2,
Mask  mask,
u8  irq 
)
inlinestatic

Add STMASK VIF opcode.

Note
Alignment alert. Size of dword (1/2). For more details, check description of VIFOpcode.
Parameters
packet2Pointer to packet.
maskMask.
irqInterrupt Request. False by default.

Definition at line 346 of file packet2_vif.h.

347  {
348  packet2_add_u32(packet2, MAKE_VIF_CODE(0, 0, P2_VIF_STMASK, irq));
349  packet2_add_u32(packet2, mask.m);
350  }
@ P2_VIF_STMASK
unsigned int m

References Mask::m, MAKE_VIF_CODE, P2_VIF_STMASK, and packet2_add_u32().

◆ packet2_vif_stmod()

static void packet2_vif_stmod ( packet2_t packet2,
u32  mode,
u8  irq 
)
inlinestatic

Add MSKPATH3 VIF opcode.

Note
Alignment alert. Size of word (1/4). For more details, check description of VIFOpcode.
Parameters
packet2Pointer to packet.
modeDecompression mode.
irqInterrupt Request. False by default.

Definition at line 270 of file packet2_vif.h.

271  {
272  packet2_add_u32(packet2, MAKE_VIF_CODE(mode, 0, P2_VIF_STMOD, irq));
273  }
@ P2_VIF_STMOD

References MAKE_VIF_CODE, mode, P2_VIF_STMOD, and packet2_add_u32().

◆ packet2_vif_strow()

static void packet2_vif_strow ( packet2_t packet2,
const u32 row_arr,
u8  irq 
)
inlinestatic

Add STROW VIF opcode.

Note
Alignment alert. Size of 5 x word (1+1/4). For more details, check description of VIFOpcode.
Parameters
packet2Pointer to packet.
row_arrRow array.
irqInterrupt Request. False by default.

Definition at line 360 of file packet2_vif.h.

361  {
362  packet2_add_u32(packet2, MAKE_VIF_CODE(0, 0, P2_VIF_STROW, irq));
363  packet2_add_u32(packet2, row_arr[0]);
364  packet2_add_u32(packet2, row_arr[1]);
365  packet2_add_u32(packet2, row_arr[2]);
366  packet2_add_u32(packet2, row_arr[3]);
367  }
@ P2_VIF_STROW

References MAKE_VIF_CODE, P2_VIF_STROW, and packet2_add_u32().