PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
+ Collaboration diagram for VIF:

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))

#include <ee/packet2/include/packet2_vif.h>

Definition at line 26 of file packet2_vif.h.

Function Documentation

◆ 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

#include <ee/packet2/include/packet2_vif.h>

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.

References packet2_t::next, 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_close_unpack_manual()

static void packet2_vif_close_unpack_manual ( packet2_t packet2,
u32  unpack_num 
)
inlinestatic

#include <ee/packet2/include/packet2_vif.h>

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.

References vif_code_t::cmd, packet2_t::next, 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_close_unpack_auto()

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

#include <ee/packet2/include/packet2_vif.h>

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.

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

Referenced by packet2_utils_vu_close_unpack().

◆ packet2_vif_open_direct()

static void packet2_vif_open_direct ( packet2_t packet2,
u8  irq 
)
inlinestatic

#include <ee/packet2/include/packet2_vif.h>

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.

References packet2_t::next, P2_VIF_DIRECT, packet2_add_u32(), 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

#include <ee/packet2/include/packet2_vif.h>

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.

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

Referenced by packet2_vif_close_direct_auto().

◆ packet2_vif_close_direct_auto()

static void packet2_vif_close_direct_auto ( packet2_t packet2)
inlinestatic

#include <ee/packet2/include/packet2_vif.h>

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.

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

◆ packet2_vif_nop()

static void packet2_vif_nop ( packet2_t packet2,
u8  irq 
)
inlinestatic

#include <ee/packet2/include/packet2_vif.h>

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.

References P2_VIF_NOP, and packet2_add_u32().

Referenced by packet2_utils_vu_add_end_tag(), and packet2_vif_add_micro_program().

◆ packet2_vif_pad96()

static void packet2_vif_pad96 ( packet2_t packet2)
inlinestatic

#include <ee/packet2/include/packet2_vif.h>

Fill with NOP VIF opcode to align to 96bits

Parameters
packet2Pointer to packet.

Definition at line 144 of file packet2_vif.h.

References P2_VIF_NOP, and packet2_pad96().

◆ packet2_vif_pad128()

static void packet2_vif_pad128 ( packet2_t packet2)
inlinestatic

#include <ee/packet2/include/packet2_vif.h>

Fill with NOP VIF opcode to align to 128bits

Parameters
packet2Pointer to packet.

Definition at line 153 of file packet2_vif.h.

References P2_VIF_NOP, and packet2_pad128().

Referenced by packet2_utils_vu_close_unpack().

◆ packet2_vif_mpg()

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

#include <ee/packet2/include/packet2_vif.h>

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.

References P2_VIF_MPG, and packet2_add_u32().

Referenced by packet2_vif_add_micro_program().

◆ packet2_vif_stcycl()

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

#include <ee/packet2/include/packet2_vif.h>

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.

References P2_VIF_STCYCL, and packet2_add_u32().

Referenced by packet2_utils_vu_add_unpack_data(), and packet2_utils_vu_open_unpack().

◆ packet2_vif_offset()

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

#include <ee/packet2/include/packet2_vif.h>

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.

References P2_VIF_OFFSET, and packet2_add_u32().

Referenced by packet2_utils_vu_add_double_buffer().

◆ packet2_vif_base()

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

#include <ee/packet2/include/packet2_vif.h>

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.

References P2_VIF_BASE, and packet2_add_u32().

Referenced by packet2_utils_vu_add_double_buffer().

◆ packet2_vif_flush()

static void packet2_vif_flush ( packet2_t packet2,
u8  irq 
)
inlinestatic

#include <ee/packet2/include/packet2_vif.h>

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.

References P2_VIF_FLUSH, and packet2_add_u32().

Referenced by packet2_utils_vu_add_continue_program(), and packet2_utils_vu_add_start_program().

◆ packet2_vif_mscal()

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

#include <ee/packet2/include/packet2_vif.h>

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.

References P2_VIF_MSCAL, and packet2_add_u32().

Referenced by packet2_utils_vu_add_start_program().

◆ packet2_vif_mscnt()

static void packet2_vif_mscnt ( packet2_t packet2,
u8  irq 
)
inlinestatic

#include <ee/packet2/include/packet2_vif.h>

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.

References P2_VIF_MSCNT, and packet2_add_u32().

Referenced by packet2_utils_vu_add_continue_program().

◆ packet2_vif_itop()

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

#include <ee/packet2/include/packet2_vif.h>

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.

References P2_VIF_ITOP, and packet2_add_u32().

◆ packet2_vif_stmod()

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

#include <ee/packet2/include/packet2_vif.h>

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.

References P2_VIF_STMOD, and packet2_add_u32().

◆ packet2_vif_mskpath3()

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

#include <ee/packet2/include/packet2_vif.h>

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.

References P2_VIF_MSKPATH3, and packet2_add_u32().

◆ packet2_vif_mark()

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

#include <ee/packet2/include/packet2_vif.h>

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.

References P2_VIF_MARK, and packet2_add_u32().

◆ packet2_vif_flushe()

static void packet2_vif_flushe ( packet2_t packet2,
u8  irq 
)
inlinestatic

#include <ee/packet2/include/packet2_vif.h>

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.

References P2_VIF_FLUSHE, and packet2_add_u32().

◆ packet2_vif_flusha()

static void packet2_vif_flusha ( packet2_t packet2,
u8  irq 
)
inlinestatic

#include <ee/packet2/include/packet2_vif.h>

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.

References P2_VIF_FLUSHA, and packet2_add_u32().

◆ packet2_vif_mscalf()

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

#include <ee/packet2/include/packet2_vif.h>

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.

References P2_VIF_MSCALF, and packet2_add_u32().

◆ packet2_vif_stmask()

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

#include <ee/packet2/include/packet2_vif.h>

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.

References P2_VIF_STMASK, and packet2_add_u32().

◆ packet2_vif_strow()

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

#include <ee/packet2/include/packet2_vif.h>

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.

References P2_VIF_STROW, and packet2_add_u32().

◆ packet2_vif_stcol()

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

#include <ee/packet2/include/packet2_vif.h>

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.

References P2_VIF_STCOL, and packet2_add_u32().

◆ packet2_vif_add_micro_program()

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

#include <ee/packet2/include/packet2_vif.h>

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.

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