fixes to match latest libpacket2 commit
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
#include <draw_types.h>
|
||||
#include <draw_primitives.h>
|
||||
#include <math3d.h>
|
||||
#include <spacket.h>
|
||||
#include <packet2.h>
|
||||
#include "../models/mesh.hpp"
|
||||
#include "../models/math/matrix.hpp"
|
||||
#include "../models/screen_settings.hpp"
|
||||
@@ -45,8 +45,8 @@ private:
|
||||
texel_t *st;
|
||||
u8 isAnyObjectAdded;
|
||||
ScreenSettings *screen;
|
||||
spacket_t *packets[2];
|
||||
spacket_t *currentPacket;
|
||||
packet2_t *packets[2];
|
||||
packet2_t *currentPacket;
|
||||
u8 packetsCount;
|
||||
int packetSize;
|
||||
float halfScreenW, halfScreenH;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
#include <draw_buffers.h>
|
||||
#include <draw_primitives.h>
|
||||
#include <spacket.h>
|
||||
#include <packet2.h>
|
||||
#include "gif_sender.hpp"
|
||||
#include "vif_sender.hpp"
|
||||
#include "../models/math/plane.hpp"
|
||||
@@ -118,7 +118,7 @@ private:
|
||||
TextureRepository textureRepo;
|
||||
GifSender *gifSender;
|
||||
VifSender *vifSender;
|
||||
spacket_t *flipPacket;
|
||||
packet2_t *flipPacket;
|
||||
void allocateBuffers(float t_screenW, float t_screenH);
|
||||
void initDrawingEnv(float t_screenW, float t_screenH);
|
||||
void setPrim();
|
||||
|
||||
@@ -12,12 +12,12 @@
|
||||
#define _TYRA_VIF_SENDER_
|
||||
|
||||
#include <tamtypes.h>
|
||||
#include <vu.h>
|
||||
#include "../models/render_data.hpp"
|
||||
#include "../models/light_bulb.hpp"
|
||||
#include "../models/mesh.hpp"
|
||||
#include "../models/math/matrix.hpp"
|
||||
#include "../models/math/vector3.hpp"
|
||||
#include "vu1.hpp"
|
||||
|
||||
/** Class responsible for sending 3D objects via VIF (PATH 1) */
|
||||
class VifSender
|
||||
@@ -28,12 +28,16 @@ public:
|
||||
~VifSender();
|
||||
|
||||
// TODO refactor
|
||||
void drawMesh(RenderData *t_renderData, Matrix t_perspective, u32 vertCount2, VECTOR *vertices, VECTOR *normals, VECTOR *coordinates, const Mesh &t_mesh, LightBulb *t_bulbs, u16 t_bulbsCount, texbuffer_t *textureBuffer);
|
||||
void drawMesh(RenderData *t_renderData, Matrix t_perspective, u32 vertCount2, VECTOR *vertices, VECTOR *normals, VECTOR *coordinates, Mesh &t_mesh, LightBulb *t_bulbs, u16 t_bulbsCount, texbuffer_t *textureBuffer);
|
||||
void sendMatrices(const RenderData &t_renderData, const Vector3 &t_position, const Vector3 &t_rotation);
|
||||
|
||||
private:
|
||||
void drawVertices(const Mesh &t_mesh, u32 t_start, u32 t_end, VECTOR *t_vertices, VECTOR *t_coordinates, prim_t *t_prim, texbuffer_t *textureBuffer);
|
||||
VU1 vu1; // TODO
|
||||
void setDoubleBuffer();
|
||||
void drawVertices(Mesh &t_mesh, u32 t_start, u32 t_end, VECTOR *t_vertices, VECTOR *t_coordinates, prim_t *t_prim, texbuffer_t *textureBuffer);
|
||||
packet2_t *packets[2] __attribute__((aligned(64)));
|
||||
packet2_t *currPacket;
|
||||
u8 context;
|
||||
packet2_t *matricesPacket __attribute__((aligned(64)));
|
||||
MATRIX localWorld, localScreen;
|
||||
VECTOR position, rotation;
|
||||
u32 vertCount;
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
/*
|
||||
# ______ ____ ___
|
||||
# | \/ ____| |___|
|
||||
# | | | \ | |
|
||||
#-----------------------------------------------------------------------
|
||||
# Copyright 2020, tyra - https://github.com/h4570/tyra
|
||||
# Licenced under Apache License 2.0
|
||||
# Sandro Sobczyński <sandro.sobczynski@gmail.com>
|
||||
*/
|
||||
|
||||
#ifndef _TYRA_VU1_
|
||||
#define _TYRA_VU1_
|
||||
|
||||
#include "../models/math/matrix.hpp"
|
||||
#include <draw_buffers.h>
|
||||
#include <tamtypes.h>
|
||||
#include <draw_primitives.h>
|
||||
#include <spacket.h>
|
||||
#include <packet.h>
|
||||
#include <math3d.h>
|
||||
|
||||
#define V4_32 0xC
|
||||
#define 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 GS_GIFTAG(NLOOP, EOP, PRE, PRIM, FLG, NREG) (((u64)(NREG) << 60) | ((u64)(FLG) << 58) | ((u64)(PRIM) << 47) | ((u64)(PRE) << 46) | (EOP << 15) | (NLOOP << 0))
|
||||
|
||||
/** Class responsible for managing VU1 micro programs */
|
||||
class VU1
|
||||
{
|
||||
|
||||
public:
|
||||
VU1();
|
||||
~VU1();
|
||||
|
||||
static void uploadProgram(int t_dest, u32 *t_start, u32 *t_end);
|
||||
void createList();
|
||||
void sendSingleRefList(int t_destAddress, void *t_data, int t_quadSize);
|
||||
void addListBeginning();
|
||||
void continueList();
|
||||
void addReferenceList(void *t_data, u32 t_size, u8 t_useTops);
|
||||
void addFloat(float v);
|
||||
void add32(u32 v);
|
||||
void add64(u64 v);
|
||||
void add128(u64 v1, u64 v2);
|
||||
void addListEnding();
|
||||
void addStartProgram();
|
||||
void addContinueProgram();
|
||||
void sendList();
|
||||
void addDoubleBufferSetting();
|
||||
void addFlush();
|
||||
|
||||
spacket_t *currPacket;
|
||||
|
||||
private:
|
||||
u32 qwordsInsertedToVU1;
|
||||
u8 isDoubleBufferSet, isBuilding;
|
||||
spacket_t *spackets[2] __attribute__((aligned(16)));
|
||||
u8 switchPacket;
|
||||
static u32 countProgramSize(u32 *t_start, u32 *t_end);
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user