tyrav2 init

This commit is contained in:
h4570
2022-07-17 10:21:35 +02:00
parent 44c1ee4fe8
commit c8b22ff331
249 changed files with 18187 additions and 0 deletions
@@ -0,0 +1,28 @@
/*
# ______ ____ ___
# | \/ ____| |___|
# | | | \ | |
#-----------------------------------------------------------------------
# Copyright 2022, tyra - https://github.com/h4570/tyra
# Licenced under Apache License 2.0
# Sandro Sobczyński <sandro.sobczynski@gmail.com>
*/
#pragma once
#include <packet2_utils.h>
#include <string>
#include "debug/debug.hpp"
#include "renderer/3d/pipeline/minecraft/programs/mcpip_program.hpp"
namespace Tyra {
class McpipAsIsVU1Program : public McpipProgram {
public:
McpipAsIsVU1Program();
~McpipAsIsVU1Program();
std::string getStringName() const;
};
} // namespace Tyra
@@ -0,0 +1,70 @@
/*
# ______ ____ ___
# | \/ ____| |___|
# | | | \ | |
#-----------------------------------------------------------------------
# Copyright 2022, tyra - https://github.com/h4570/tyra
# Licenced under Apache License 2.0
# Sandro Sobczyński <sandro.sobczynski@gmail.com>
*/
#pragma once
#include <packet2_utils.h>
#include "debug/debug.hpp"
#include "renderer/renderer.hpp"
#include "packet2/packet2_tyra_utils.hpp"
#include "../mcpip_programs_repository.hpp"
#include "../../mcpip_block.hpp"
#include "../../data/mcpip_block_data.hpp"
#include "./mcpip_vu1_as_is_shared_defines.h"
#include "renderer/core/paths/path1/clipper/path1_ee_clip_algorithm.hpp"
namespace Tyra {
class McpipClip {
public:
McpipClip();
~McpipClip();
Path1EEClipAlgorithm algorithm;
Path1EEClipAlgorithmSettings algoSettings;
void init(RendererCore* core, McpipBlockData* t_singleBlockData,
McpipBlockData* t_multiBlockData);
u32 uploadVU1Program(McpipProgramsRepository* repo, const u32& addr);
void configureVU1AndSendStaticData();
void addData(McpipBlock* block, const bool& isMulti,
RendererCoreTextureBuffers* texBuffers, packet2_t* packet,
const u8& context);
private:
RendererCore* rendererCore;
McpipBlockData* singleBlockData;
McpipBlockData* multiBlockData;
packet2_t* staticPacket;
u16 vu1DBufferSize;
std::vector<Path1ClipVertex> clippedTriangle;
std::vector<Path1ClipVertex> inputTriangle;
Vec4 vertexBuffers[2][108];
Vec4 texCoordBuffers[2][108];
void addCorrections(std::vector<Path1ClipVertex>* vertices,
McpipBlock* block);
void moveDataToBuffer(std::vector<Path1ClipVertex>* vertices,
const u8& context);
void addDataToPacket(packet2_t* packet, const u8& context, McpipBlock* block,
const int& count,
RendererCoreTextureBuffers* texBuffers);
void initStaticPacket();
void sendVU1StaticData();
void setDBufferSize();
};
} // namespace Tyra
@@ -0,0 +1,22 @@
//
// ______ ____ ___
// | \/ ____| |___|
// | | | \ | |
//-----------------------------------------------------------------------
// Copyright 2022, tyra - https://github.com/h4570/tyra
// Licenced under Apache License 2.0
// Sandro Sobczyński <sandro.sobczynski@gmail.com>
//
// Static data for blockizer program
#define VU1_MCPIP_AS_IS_STATIC_LOD 0
#define VU1_MCPIP_AS_IS_STATIC_SET_TAG 1
#define VU1_MCPIP_AS_IS_STATIC_LAST_DATA_ADDR 1
// Dynamic data (unpack per VU1 call)
#define VU1_MCPIP_AS_IS_DYNAMIC_SCALE 0
#define VU1_MCPIP_AS_IS_DYNAMIC_PRIM 1
#define VU1_MCPIP_AS_IS_DYNAMIC_CLUT 2
#define VU1_MCPIP_AS_IS_DYNAMIC_COLOR 3
#define VU1_MCPIP_AS_IS_DYNAMIC_VERTEX_DATA_ADDR 4