PS2SDK
PS2 Homebrew Libraries
|
Macros | |
#define | VU_GS_PRIM(PRIM, IIP, TME, FGE, ABE, AA1, FST, CTXT, FIX) (u128)(((FIX << 10) | (CTXT << 9) | (FST << 8) | (AA1 << 7) | (ABE << 6) | (FGE << 5) | (TME << 4) | (IIP << 3) | (PRIM))) |
#define | VU_GS_GIFTAG(NLOOP, EOP, PRE, PRIM, FLG, NREG) (((u64)(NREG) << 60) | ((u64)(FLG) << 58) | ((u64)(PRIM) << 47) | ((u64)(PRE) << 46) | (EOP << 15) | (NLOOP << 0)) |
Functions | |
static void | packet2_utils_vu_add_double_buffer (packet2_t *packet2, u16 base, u16 offset) |
static void | packet2_utils_vu_add_unpack_data (packet2_t *packet2, u32 t_dest_address, void *t_data, u32 t_size, u8 t_use_top) |
static void | packet2_utils_vu_open_unpack (packet2_t *packet2, u32 t_dest_address, u8 t_use_top) |
static u32 | packet2_utils_vu_close_unpack (packet2_t *packet2) |
static void | packet2_utils_vu_add_continue_program (packet2_t *packet2) |
static void | packet2_utils_vu_add_start_program (packet2_t *packet2, u32 addr) |
static void | packet2_utils_vu_add_end_tag (packet2_t *packet2) |
static u32 | packet2_utils_get_packet_size_for_program (u32 *start, u32 *end) |
static void | packet2_utils_gif_add_set (packet2_t *packet2, u32 loops_count) |
static void | packet2_utils_gs_add_lod (packet2_t *packet2, lod_t *lod) |
static void | packet2_utils_gs_add_texbuff_clut (packet2_t *packet2, texbuffer_t *texbuff, clutbuffer_t *clut) |
static void | packet2_utils_gs_add_draw_finish_giftag (packet2_t *packet2) |
static void | packet2_utils_gs_add_prim_giftag (packet2_t *packet2, prim_t *prim, u32 loops_count, u32 nreg, u8 nreg_count, u8 context) |
Useful functions and examples for libpacket2.
#define VU_GS_PRIM | ( | PRIM, | |
IIP, | |||
TME, | |||
FGE, | |||
ABE, | |||
AA1, | |||
FST, | |||
CTXT, | |||
FIX | |||
) | (u128)(((FIX << 10) | (CTXT << 9) | (FST << 8) | (AA1 << 7) | (ABE << 6) | (FGE << 5) | (TME << 4) | (IIP << 3) | (PRIM))) |
#include <ee/packet2/include/packet2_utils.h>
Definition at line 32 of file packet2_utils.h.
#define VU_GS_GIFTAG | ( | NLOOP, | |
EOP, | |||
PRE, | |||
PRIM, | |||
FLG, | |||
NREG | |||
) | (((u64)(NREG) << 60) | ((u64)(FLG) << 58) | ((u64)(PRIM) << 47) | ((u64)(PRE) << 46) | (EOP << 15) | (NLOOP << 0)) |
#include <ee/packet2/include/packet2_utils.h>
Definition at line 33 of file packet2_utils.h.
|
inlinestatic |
#include <ee/packet2/include/packet2_utils.h>
Add VU buffers size settings.
t_base | Base address (qw) |
t_offset | Offset address (qw) |
Definition at line 49 of file packet2_utils.h.
References packet2_chain_close_tag(), packet2_chain_open_cnt(), packet2_vif_base(), and packet2_vif_offset().
|
inlinestatic |
#include <ee/packet2/include/packet2_utils.h>
Add data via REF tag and UNPACK. Please be sure that data is aligned, and there is no any open UNPACK/DIRECT.
packet2 | Pointer to packet2. |
t_dest_address | Destination address. |
t_data | Data pointer. |
t_size | Size in quadwords. |
t_use_top | Unpack to current double buffer? |
Definition at line 67 of file packet2_utils.h.
References packet2_chain_ref(), packet2_vif_close_unpack_manual(), packet2_vif_open_unpack(), and packet2_vif_stcycl().
|
inlinestatic |
#include <ee/packet2/include/packet2_utils.h>
Open CNT tag + VU unpack.
packet2 | Pointer to packet2. |
t_dest_address | Destination address. |
t_use_top | Unpack to current double buffer? |
Definition at line 81 of file packet2_utils.h.
References packet2_chain_open_cnt(), packet2_vif_open_unpack(), and packet2_vif_stcycl().
|
inlinestatic |
#include <ee/packet2/include/packet2_utils.h>
Close CNT tag + VU unpack.
Definition at line 92 of file packet2_utils.h.
References packet2_chain_close_tag(), packet2_vif_close_unpack_auto(), and packet2_vif_pad128().
|
inlinestatic |
#include <ee/packet2/include/packet2_utils.h>
Continue VU micro program (from –cont line). Adds FLUSH and MSCNT VIF opcodes.
Definition at line 103 of file packet2_utils.h.
References packet2_chain_close_tag(), packet2_chain_open_cnt(), packet2_vif_flush(), and packet2_vif_mscnt().
|
inlinestatic |
#include <ee/packet2/include/packet2_utils.h>
Start VU micro program. Adds FLUSH and MSCAL VIF opcodes.
Definition at line 115 of file packet2_utils.h.
References packet2_chain_close_tag(), packet2_chain_open_cnt(), packet2_vif_flush(), and packet2_vif_mscal().
|
inlinestatic |
#include <ee/packet2/include/packet2_utils.h>
Add aligned END tag (with nops).
Definition at line 124 of file packet2_utils.h.
References packet2_chain_close_tag(), packet2_chain_open_end(), and packet2_vif_nop().
|
inlinestatic |
#include <ee/packet2/include/packet2_utils.h>
Get program size in qws
start | Start address. |
end | End address. |
Definition at line 138 of file packet2_utils.h.
References count.
|
inlinestatic |
#include <ee/packet2/include/packet2_utils.h>
Add set GIFTag which will be sent from VU1 via XGKICK instruction.
packet2 | Pointer to packet2. |
loops_count | How many GIF tags there will be? |
Definition at line 157 of file packet2_utils.h.
References GIF_FLG_PACKED, and GIF_REG_AD.
#include <ee/packet2/include/packet2_utils.h>
Add lod GIFTag which will be sent from VU1 via XGKICK instruction.
packet2 | Pointer to packet2. |
lod | Pointer to lod settings. |
Definition at line 172 of file packet2_utils.h.
References GS_REG_TEX1.
|
inlinestatic |
#include <ee/packet2/include/packet2_utils.h>
Add texture buffer / clut GIFTag which will be sent from VU1 via XGKICK instruction.
packet2 | Pointer to packet2. |
texbuff | Pointer to texture buffer. |
clut | Pointer to clut buffer. |
Definition at line 194 of file packet2_utils.h.
References GS_REG_TEX0.
|
inlinestatic |
#include <ee/packet2/include/packet2_utils.h>
Add draw finish event GIFTag which will be sent from VU1 via XGKICK instruction. Used for synchronization via draw_wait_finish()
packet2 | Pointer to packet2. |
Definition at line 220 of file packet2_utils.h.
References GS_REG_FINISH.
|
inlinestatic |
#include <ee/packet2/include/packet2_utils.h>
Add drawing (prim) GIFTag which will be sent from VU1 via XGKICK instruction.
packet2 | Pointer to packet2. |
prim | Pointer to prim settings. |
loops_count | GIF tag loops count. |
nreg | What types of data we will use? |
nreg_count | How many types there are in nreg? |
context | Drawing context |
Definition at line 235 of file packet2_utils.h.