mirror of
https://github.com/izzy2lost/Ghostship.git
synced 2026-06-19 01:17:03 -07:00
Bump LUS errors
This commit is contained in:
+1
-1
@@ -84,6 +84,6 @@ code/
|
||||
!/sound/**/*custom*/**/*.aiff
|
||||
!/assets/**/*custom*.bin
|
||||
!/assets/**/*custom*/**/*.bin
|
||||
|
||||
# Torch hash
|
||||
torch.hash.yml
|
||||
merge/
|
||||
@@ -56,6 +56,7 @@ add_compile_definitions(
|
||||
VERSION_US=1
|
||||
ENABLE_RUMBLE=1
|
||||
F3D_OLD=1
|
||||
F3D_GBI=1
|
||||
GBI_FLOATS=1
|
||||
_LANGUAGE_C
|
||||
_USE_MATH_DEFINES
|
||||
@@ -379,6 +380,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang")
|
||||
-Wno-parentheses
|
||||
-Wno-narrowing
|
||||
-Wno-missing-braces
|
||||
-Wno-int-conversion
|
||||
$<$<COMPILE_LANGUAGE:C>:
|
||||
-Werror-implicit-function-declaration
|
||||
-Wno-incompatible-pointer-types
|
||||
|
||||
+1
-1
Submodule Torch updated: 76e90b4ddc...7e4c4bca08
@@ -52,4 +52,77 @@
|
||||
#define PHYSICAL_TO_VIRTUAL(addr) ((uintptr_t)(addr))
|
||||
#define VIRTUAL_TO_PHYSICAL2(addr) ((void *)(addr))
|
||||
|
||||
#define G_CC_PRIMITIVE 0, 0, 0, PRIMITIVE, 0, 0, 0, PRIMITIVE
|
||||
#define G_CC_SHADE 0, 0, 0, SHADE, 0, 0, 0, SHADE
|
||||
|
||||
#define G_CC_MODULATEI TEXEL0, 0, SHADE, 0, 0, 0, 0, SHADE
|
||||
#define G_CC_MODULATEIDECALA TEXEL0, 0, SHADE, 0, 0, 0, 0, TEXEL0
|
||||
#define G_CC_MODULATEIFADE TEXEL0, 0, SHADE, 0, 0, 0, 0, ENVIRONMENT
|
||||
|
||||
#define G_CC_MODULATERGB G_CC_MODULATEI
|
||||
#define G_CC_MODULATERGBDECALA G_CC_MODULATEIDECALA
|
||||
#define G_CC_MODULATERGBFADE G_CC_MODULATEIFADE
|
||||
|
||||
#define G_CC_MODULATEIA TEXEL0, 0, SHADE, 0, TEXEL0, 0, SHADE, 0
|
||||
#define G_CC_MODULATEIFADEA TEXEL0, 0, SHADE, 0, TEXEL0, 0, ENVIRONMENT, 0
|
||||
|
||||
#define G_CC_MODULATEFADE TEXEL0, 0, SHADE, 0, ENVIRONMENT, 0, TEXEL0, 0
|
||||
|
||||
#define G_CC_MODULATERGBA G_CC_MODULATEIA
|
||||
#define G_CC_MODULATERGBFADEA G_CC_MODULATEIFADEA
|
||||
|
||||
#define G_CC_MODULATEI_PRIM TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE
|
||||
#define G_CC_MODULATEIA_PRIM TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0
|
||||
#define G_CC_MODULATEIDECALA_PRIM TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, TEXEL0
|
||||
|
||||
#define G_CC_MODULATERGB_PRIM G_CC_MODULATEI_PRIM
|
||||
#define G_CC_MODULATERGBA_PRIM G_CC_MODULATEIA_PRIM
|
||||
#define G_CC_MODULATERGBDECALA_PRIM G_CC_MODULATEIDECALA_PRIM
|
||||
|
||||
#define G_CC_FADE SHADE, 0, ENVIRONMENT, 0, SHADE, 0, ENVIRONMENT, 0
|
||||
#define G_CC_FADEA TEXEL0, 0, ENVIRONMENT, 0, TEXEL0, 0, ENVIRONMENT, 0
|
||||
|
||||
#define G_CC_DECALRGB 0, 0, 0, TEXEL0, 0, 0, 0, SHADE
|
||||
#define G_CC_DECALRGBA 0, 0, 0, TEXEL0, 0, 0, 0, TEXEL0
|
||||
#define G_CC_DECALFADE 0, 0, 0, TEXEL0, 0, 0, 0, ENVIRONMENT
|
||||
|
||||
#define G_CC_DECALFADEA 0, 0, 0, TEXEL0, TEXEL0, 0, ENVIRONMENT, 0
|
||||
|
||||
#define G_CC_BLENDI ENVIRONMENT, SHADE, TEXEL0, SHADE, 0, 0, 0, SHADE
|
||||
#define G_CC_BLENDIA ENVIRONMENT, SHADE, TEXEL0, SHADE, TEXEL0, 0, SHADE, 0
|
||||
#define G_CC_BLENDIDECALA ENVIRONMENT, SHADE, TEXEL0, SHADE, 0, 0, 0, TEXEL0
|
||||
|
||||
#define G_CC_BLENDRGBA TEXEL0, SHADE, TEXEL0_ALPHA, SHADE, 0, 0, 0, SHADE
|
||||
#define G_CC_BLENDRGBDECALA TEXEL0, SHADE, TEXEL0_ALPHA, SHADE, 0, 0, 0, TEXEL0
|
||||
#define G_CC_BLENDRGBFADEA TEXEL0, SHADE, TEXEL0_ALPHA, SHADE, 0, 0, 0, ENVIRONMENT
|
||||
|
||||
#define G_CC_ADDRGB TEXEL0, 0, TEXEL0, SHADE, 0, 0, 0, SHADE
|
||||
#define G_CC_ADDRGBDECALA TEXEL0, 0, TEXEL0, SHADE, 0, 0, 0, TEXEL0
|
||||
#define G_CC_ADDRGBFADE TEXEL0, 0, TEXEL0, SHADE, 0, 0, 0, ENVIRONMENT
|
||||
|
||||
#define G_CC_REFLECTRGB ENVIRONMENT, 0, TEXEL0, SHADE, 0, 0, 0, SHADE
|
||||
#define G_CC_REFLECTRGBDECALA ENVIRONMENT, 0, TEXEL0, SHADE, 0, 0, 0, TEXEL0
|
||||
|
||||
#define G_CC_HILITERGB PRIMITIVE, SHADE, TEXEL0, SHADE, 0, 0, 0, SHADE
|
||||
#define G_CC_HILITERGBA PRIMITIVE, SHADE, TEXEL0, SHADE, PRIMITIVE, SHADE, TEXEL0, SHADE
|
||||
#define G_CC_HILITERGBDECALA PRIMITIVE, SHADE, TEXEL0, SHADE, 0, 0, 0, TEXEL0
|
||||
|
||||
#define G_CC_SHADEDECALA 0, 0, 0, SHADE, 0, 0, 0, TEXEL0
|
||||
#define G_CC_SHADEFADEA 0, 0, 0, SHADE, 0, 0, 0, ENVIRONMENT
|
||||
|
||||
#define G_CC_BLENDPE PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, SHADE, 0
|
||||
#define G_CC_BLENDPEDECALA PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, 0, 0, 0, TEXEL0
|
||||
|
||||
#define RM_AA_ZB_XLU_SURF(clk) \
|
||||
AA_EN | Z_CMP | IM_RD | CVG_DST_WRAP | CLR_ON_CVG | \
|
||||
FORCE_BL | ZMODE_XLU | \
|
||||
GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)
|
||||
|
||||
/* Custom version of RM_AA_ZB_XLU_SURF with Z_UPD */
|
||||
#define RM_CUSTOM_AA_ZB_XLU_SURF(clk) \
|
||||
RM_AA_ZB_XLU_SURF(clk) | Z_UPD
|
||||
|
||||
#define G_RM_CUSTOM_AA_ZB_XLU_SURF RM_CUSTOM_AA_ZB_XLU_SURF(1)
|
||||
#define G_RM_CUSTOM_AA_ZB_XLU_SURF2 RM_CUSTOM_AA_ZB_XLU_SURF(2)
|
||||
|
||||
#endif // MACROS_H
|
||||
|
||||
+1
-1
@@ -5,10 +5,10 @@
|
||||
// have an appropriate header.
|
||||
|
||||
#include <libultraship.h>
|
||||
#include <libultra/gbi.h>
|
||||
#include "macros.h"
|
||||
#include "config.h"
|
||||
|
||||
|
||||
// Certain functions are marked as having return values, but do not
|
||||
// actually return a value. This causes undefined behavior, which we'd rather
|
||||
// avoid on modern GCC. This only impacts -O2 and can matter for both the function
|
||||
|
||||
+1
-1
@@ -65,6 +65,6 @@ void guMtxIdent(Mtx *m) {
|
||||
guMtxIdentF(mf);
|
||||
guMtxF2L(mf, m);
|
||||
#else
|
||||
guMtxIdentF(m->m);
|
||||
guMtxIdentF(m->mf);
|
||||
#endif
|
||||
}
|
||||
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
#ifndef _OSAI_H_
|
||||
#define _OSAI_H_
|
||||
|
||||
s32 osAiSetFrequency(u32);
|
||||
s32 osAiSetNextBuffer(void *, u32);
|
||||
u32 osAiGetLength(void);
|
||||
// s32 osAiSetFrequency(u32);
|
||||
// s32 osAiSetNextBuffer(void *, u32);
|
||||
// u32 osAiGetLength(void);
|
||||
#endif
|
||||
|
||||
+1
-1
Submodule libultraship updated: 39b5d3f1ac...4b1df828f5
@@ -342,7 +342,7 @@ static void geo_process_perspective(struct GraphNodePerspective *node) {
|
||||
static void geo_process_level_of_detail(struct GraphNodeLevelOfDetail *node) {
|
||||
#ifdef GBI_FLOATS
|
||||
Mtx *mtx = gMatStackFixed[gMatStackIndex];
|
||||
s16 distanceFromCam = (s32) -mtx->m[3][2]; // z-component of the translation column
|
||||
s16 distanceFromCam = (s32) -mtx->mf[3][2]; // z-component of the translation column
|
||||
#else
|
||||
// The fixed point Mtx type is defined as 16 longs, but it's actually 16
|
||||
// shorts for the integer parts followed by 16 shorts for the fraction parts
|
||||
|
||||
+42
-25
@@ -8,7 +8,6 @@
|
||||
#include "port/importer/DictionaryFactory.h"
|
||||
#include "port/importer/ResourceType.h"
|
||||
#include "audio/GameAudio.h"
|
||||
#include "ZAPDUtils/Utils/StringHelper.h"
|
||||
#include "texts_table.h"
|
||||
#include "port/Enhancements/game-interactor/GameInteractor.h"
|
||||
#include "port/Enhancements/mods.h"
|
||||
@@ -18,6 +17,15 @@
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "ArrayFactory.h"
|
||||
#include "BlobFactory.h"
|
||||
#include "DisplayListFactory.h"
|
||||
#include "MatrixFactory.h"
|
||||
#include "StringHelper.h"
|
||||
#include "TextureFactory.h"
|
||||
#include "VertexFactory.h"
|
||||
#include "Fast3D/Fast3dWindow.h"
|
||||
|
||||
extern "C" {
|
||||
#include "sm64.h"
|
||||
#include "audio/external.h"
|
||||
@@ -31,13 +39,13 @@ GameInteractor* GameInteractor::Instance;
|
||||
|
||||
GameEngine::GameEngine(): dictionary(nullptr) {
|
||||
std::vector<std::string> OTRFiles;
|
||||
if (const std::string cube_path = LUS::Context::GetPathRelativeToAppDirectory("smcube.otr"); std::filesystem::exists(cube_path)) {
|
||||
if (const std::string cube_path = Ship::Context::GetPathRelativeToAppDirectory("smcube.otr"); std::filesystem::exists(cube_path)) {
|
||||
OTRFiles.push_back(cube_path);
|
||||
}
|
||||
if (const std::string sm64_otr_path = LUS::Context::GetPathRelativeToAppBundle("sm64.otr"); std::filesystem::exists(sm64_otr_path)) {
|
||||
if (const std::string sm64_otr_path = Ship::Context::GetPathRelativeToAppBundle("sm64.otr"); std::filesystem::exists(sm64_otr_path)) {
|
||||
OTRFiles.push_back(sm64_otr_path);
|
||||
}
|
||||
if (const std::string patches_path = LUS::Context::GetPathRelativeToAppDirectory("mods"); !patches_path.empty() && std::filesystem::exists(patches_path)) {
|
||||
if (const std::string patches_path = Ship::Context::GetPathRelativeToAppDirectory("mods"); !patches_path.empty() && std::filesystem::exists(patches_path)) {
|
||||
if (std::filesystem::is_directory(patches_path)) {
|
||||
for (const auto&p: std::filesystem::recursive_directory_iterator(patches_path)) {
|
||||
if (StringHelper::IEquals(p.path().extension().string(), ".otr")) {
|
||||
@@ -46,10 +54,14 @@ GameEngine::GameEngine(): dictionary(nullptr) {
|
||||
}
|
||||
}
|
||||
}
|
||||
this->context = LUS::Context::CreateInstance("Ghostship", "sm64", "ghostship.cfg.json", OTRFiles,
|
||||
this->context = Ship::Context::CreateInstance("Ghostship", "sm64", "ghostship.cfg.json", OTRFiles,
|
||||
{0xFF2B5A63, 0xE3DAA4E}, 3);
|
||||
this->context->GetWindow()->SetTargetFps(60);
|
||||
this->context->GetWindow()->SetMaximumFrameLatency(1);
|
||||
|
||||
auto wnd = std::dynamic_pointer_cast<Fast::Fast3dWindow>(Ship::Context::GetInstance()->GetWindow());
|
||||
wnd->SetTargetFps(60);
|
||||
wnd->SetMaximumFrameLatency(1);
|
||||
wnd->SetRendererUCode(ucode_f3d);
|
||||
|
||||
auto loader = context->GetResourceManager()->GetResourceLoader();
|
||||
loader->RegisterResourceFactory(std::make_shared<SM64::AnimationFactoryV0>(), RESOURCE_FORMAT_BINARY, "Animation", static_cast<uint32_t>(SM64::ResourceType::Anim), 0);
|
||||
loader->RegisterResourceFactory(std::make_shared<SM64::AudioBankFactoryV0>(), RESOURCE_FORMAT_BINARY, "AudioBank", static_cast<uint32_t>(SM64::ResourceType::Bank), 0);
|
||||
@@ -57,6 +69,13 @@ GameEngine::GameEngine(): dictionary(nullptr) {
|
||||
loader->RegisterResourceFactory(std::make_shared<SM64::AudioSequenceFactoryV0>(), RESOURCE_FORMAT_BINARY, "AudioSequence", static_cast<uint32_t>(SM64::ResourceType::Sequence), 0);
|
||||
loader->RegisterResourceFactory(std::make_shared<SM64::DialogFactoryV0>(), RESOURCE_FORMAT_BINARY, "Dialog", static_cast<uint32_t>(SM64::ResourceType::SDialog), 0);
|
||||
loader->RegisterResourceFactory(std::make_shared<SM64::DictionaryFactoryV0>(), RESOURCE_FORMAT_BINARY, "Dictionary", static_cast<uint32_t>(SM64::ResourceType::Dictionary), 0);
|
||||
loader->RegisterResourceFactory(std::make_shared<LUS::ResourceFactoryBinaryTextureV0>(), RESOURCE_FORMAT_BINARY, "Texture", static_cast<uint32_t>(LUS::ResourceType::Texture), 0);
|
||||
loader->RegisterResourceFactory(std::make_shared<LUS::ResourceFactoryBinaryTextureV1>(), RESOURCE_FORMAT_BINARY, "Texture", static_cast<uint32_t>(LUS::ResourceType::Texture), 1);
|
||||
loader->RegisterResourceFactory(std::make_shared<LUS::ResourceFactoryBinaryVertexV0>(), RESOURCE_FORMAT_BINARY, "Vertex", static_cast<uint32_t>(LUS::ResourceType::Vertex), 0);
|
||||
loader->RegisterResourceFactory(std::make_shared<LUS::ResourceFactoryBinaryDisplayListV0>(), RESOURCE_FORMAT_BINARY, "DisplayList", static_cast<uint32_t>(LUS::ResourceType::DisplayList), 0);
|
||||
loader->RegisterResourceFactory(std::make_shared<LUS::ResourceFactoryBinaryMatrixV0>(), RESOURCE_FORMAT_BINARY, "Matrix", static_cast<uint32_t>(LUS::ResourceType::Matrix), 0);
|
||||
loader->RegisterResourceFactory(std::make_shared<LUS::ResourceFactoryBinaryArrayV0>(), RESOURCE_FORMAT_BINARY, "Array", static_cast<uint32_t>(LUS::ResourceType::Array), 0);
|
||||
loader->RegisterResourceFactory(std::make_shared<LUS::ResourceFactoryBinaryBlobV0>(), RESOURCE_FORMAT_BINARY, "Blob", static_cast<uint32_t>(LUS::ResourceType::Blob), 0);
|
||||
}
|
||||
|
||||
void GameEngine::Create(){
|
||||
@@ -75,7 +94,7 @@ void GameEngine::Destroy(){
|
||||
bool ShouldClearTextureCacheAtEndOfFrame = false;
|
||||
|
||||
void GameEngine::StartFrame() const{
|
||||
using LUS::KbScancode;
|
||||
using Ship::KbScancode;
|
||||
const int32_t dwScancode = this->context->GetWindow()->GetLastScancode();
|
||||
this->context->GetWindow()->SetLastScancode(-1);
|
||||
|
||||
@@ -91,20 +110,16 @@ void GameEngine::StartFrame() const{
|
||||
this->context->GetWindow()->StartFrame();
|
||||
}
|
||||
|
||||
void GameEngine::ProcessFrame(void (*run_one_game_iter)()) const {
|
||||
this->context->GetWindow()->MainLoop(run_one_game_iter);
|
||||
}
|
||||
|
||||
uint32_t GameEngine::GetInterpolationFPS() {
|
||||
if (LUS::Context::GetInstance()->GetWindow()->GetWindowBackend() == LUS::WindowBackend::DX11) {
|
||||
if (Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() == Ship::WindowBackend::DX11) {
|
||||
return CVarGetInteger("gInterpolationFPS", 30);
|
||||
}
|
||||
|
||||
if (CVarGetInteger("gMatchRefreshRate", 0)) {
|
||||
return LUS::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate();
|
||||
return Ship::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate();
|
||||
}
|
||||
|
||||
return std::min<uint32_t>(LUS::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate(), CVarGetInteger("gInterpolationFPS", 30));
|
||||
return std::min<uint32_t>(Ship::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate(), CVarGetInteger("gInterpolationFPS", 30));
|
||||
}
|
||||
|
||||
// Audio
|
||||
@@ -157,7 +172,7 @@ void GameEngine::EndAudioFrame(){
|
||||
}
|
||||
|
||||
void GameEngine::AudioInit() {
|
||||
const auto resourceMgr = LUS::Context::GetInstance()->GetResourceManager();
|
||||
const auto resourceMgr = Ship::Context::GetInstance()->GetResourceManager();
|
||||
resourceMgr->LoadDirectory("sound");
|
||||
const auto banksFiles = resourceMgr->GetArchiveManager()->ListFiles("sound/banks/*");
|
||||
const auto sequences_files = resourceMgr->GetArchiveManager()->ListFiles("sound/sequences/*");
|
||||
@@ -204,11 +219,11 @@ uint8_t GameEngine::GetBankIdByName(const std::string& name) {
|
||||
}
|
||||
|
||||
uint32_t GameEngine::GetGameVersion() {
|
||||
return LUS::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->GetGameVersions()[0];
|
||||
return Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->GetGameVersions()[0];
|
||||
}
|
||||
|
||||
void GameEngine::RunCommands(Gfx* Commands) {
|
||||
gfx_run(Commands, {});
|
||||
void GameEngine::RunCommands(F3DGfx* Commands) {
|
||||
gfx_run(reinterpret_cast<Gfx*>(Commands), {});
|
||||
gfx_end_frame();
|
||||
|
||||
if (ShouldClearTextureCacheAtEndOfFrame) {
|
||||
@@ -228,7 +243,9 @@ void GameEngine::PatchInterpolations() {
|
||||
patch_interpolated_snow_particles();
|
||||
}
|
||||
|
||||
void GameEngine::ProcessGfxCommands(Gfx* commands) {
|
||||
void GameEngine::ProcessGfxCommands(F3DGfx* commands) {
|
||||
auto wnd = std::dynamic_pointer_cast<Fast::Fast3dWindow>(Ship::Context::GetInstance()->GetWindow());
|
||||
|
||||
int target_fps = GetInterpolationFPS();
|
||||
static int last_fps;
|
||||
static int time;
|
||||
@@ -255,10 +272,10 @@ void GameEngine::ProcessGfxCommands(Gfx* commands) {
|
||||
|
||||
time -= fps;
|
||||
|
||||
Instance->context->GetWindow()->SetTargetFps(fps);
|
||||
wnd->SetTargetFps(fps);
|
||||
|
||||
int threshold = CVarGetInteger("gExtraLatencyThreshold", 80);
|
||||
Instance->context->GetWindow()->SetMaximumFrameLatency(threshold > 0 && target_fps >= threshold ? 2 : 1);
|
||||
wnd->SetMaximumFrameLatency(threshold > 0 && target_fps >= threshold ? 2 : 1);
|
||||
|
||||
last_fps = fps;
|
||||
}
|
||||
@@ -268,7 +285,7 @@ extern "C" uint32_t GameEngine_GetInterpolatedFPS() {
|
||||
}
|
||||
|
||||
extern "C" uint32_t GameEngine_GetSampleRate() {
|
||||
auto player = LUS::Context::GetInstance()->GetAudio()->GetAudioPlayer();
|
||||
auto player = Ship::Context::GetInstance()->GetAudio()->GetAudioPlayer();
|
||||
if (player == nullptr) {
|
||||
return 0;
|
||||
}
|
||||
@@ -355,7 +372,7 @@ extern "C" void GameEngine_UnloadSequence(uint8_t seqId) {
|
||||
}
|
||||
|
||||
extern "C" uint32_t GameEngine_GetGameVersion() {
|
||||
return LUS::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->GetGameVersions()[0];
|
||||
return Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->GetGameVersions()[0];
|
||||
}
|
||||
|
||||
extern "C" uint8_t* GameEngine_LoadActName(uint32_t actId){
|
||||
@@ -382,5 +399,5 @@ extern "C" uint8_t* GameEngine_LoadTranslation(const char* key) {
|
||||
}
|
||||
|
||||
extern "C" int GameEngine_OTRSigCheck(const char* data) {
|
||||
return LUS::Context::GetInstance()->GetResourceManager()->OtrSignatureCheck(data);
|
||||
return Ship::Context::GetInstance()->GetResourceManager()->OtrSignatureCheck(data);
|
||||
}
|
||||
+3
-4
@@ -19,7 +19,7 @@ class GameEngine {
|
||||
public:
|
||||
static GameEngine* Instance;
|
||||
|
||||
std::shared_ptr<LUS::Context> context;
|
||||
std::shared_ptr<Ship::Context> context;
|
||||
std::unordered_map<uint8_t, CtlEntry*> banks;
|
||||
std::unordered_map<uint8_t, AudioSequenceData*> sequences;
|
||||
std::unordered_map<std::string, uint8_t> bankMapTable;
|
||||
@@ -30,15 +30,14 @@ class GameEngine {
|
||||
static void Create();
|
||||
void AudioInit();
|
||||
void StartFrame() const;
|
||||
static void RunCommands(Gfx* Commands);
|
||||
void ProcessFrame(void (*run_one_game_iter)()) const;
|
||||
static void RunCommands(F3DGfx* Commands);
|
||||
static uint32_t GetInterpolationFPS();
|
||||
static void HandleAudioThread();
|
||||
static void StartAudioFrame();
|
||||
static void EndAudioFrame();
|
||||
static void AudioExit();
|
||||
static void PatchInterpolations();
|
||||
static void ProcessGfxCommands(Gfx* commands);
|
||||
static void ProcessGfxCommands(F3DGfx* commands);
|
||||
static uint8_t GetBankIdByName(const std::string& name);
|
||||
void LoadDictionary();
|
||||
uint32_t GetGameVersion();
|
||||
|
||||
@@ -10,7 +10,7 @@ extern "C" void gSPDisplayList(Gfx* pkt, Gfx* dl) {
|
||||
char* imgData = (char*)dl;
|
||||
|
||||
if (GameEngine_OTRSigCheck(imgData) == 1) {
|
||||
auto resource = LUS::Context::GetInstance()->GetResourceManager()->LoadResource(imgData);
|
||||
auto resource = Ship::Context::GetInstance()->GetResourceManager()->LoadResource(imgData);
|
||||
auto res = std::static_pointer_cast<LUS::DisplayList>(resource);
|
||||
dl = &res->Instructions[0];
|
||||
}
|
||||
@@ -31,7 +31,7 @@ extern "C" void gSPInvalidateTexCache(Gfx* pkt, uintptr_t texAddr) {
|
||||
char* imgData = (char*)texAddr;
|
||||
|
||||
if (texAddr != 0 && GameEngine_OTRSigCheck(imgData)) {
|
||||
auto res = LUS::Context::GetInstance()->GetResourceManager()->LoadResource(imgData);
|
||||
auto res = Ship::Context::GetInstance()->GetResourceManager()->LoadResource(imgData);
|
||||
|
||||
if (res->GetInitData()->Type == (uint32_t) LUS::ResourceType::DisplayList)
|
||||
texAddr = (uintptr_t)&((std::static_pointer_cast<LUS::DisplayList>(res))->Instructions[0]);
|
||||
|
||||
+4
-2
@@ -28,7 +28,7 @@ void patch_interpolations() {
|
||||
|
||||
extern "C"
|
||||
void exec_display_list(SPTask *spTask) {
|
||||
GameEngine::ProcessGfxCommands((Gfx *) spTask->task.t.data_ptr);
|
||||
GameEngine::ProcessGfxCommands((F3DGfx *) spTask->task.t.data_ptr);
|
||||
}
|
||||
|
||||
void push_frame() {
|
||||
@@ -48,7 +48,9 @@ int main(){
|
||||
audio_init();
|
||||
sound_init();
|
||||
thread5_game_loop();
|
||||
GameEngine::Instance->ProcessFrame(push_frame);
|
||||
while (WindowIsRunning()) {
|
||||
push_frame();
|
||||
}
|
||||
GameEngine::Instance->Destroy();
|
||||
return 0;
|
||||
}
|
||||
@@ -12,8 +12,8 @@ extern "C" {
|
||||
// Function Table
|
||||
#include "menu/intro_geo.h"
|
||||
}
|
||||
LUS::BinaryReader* GeoLayoutParser::mReader;
|
||||
LUS::BinaryReader* GeoLayoutParser::mLoadedReader;
|
||||
Ship::BinaryReader* GeoLayoutParser::mReader;
|
||||
Ship::BinaryReader* GeoLayoutParser::mLoadedReader;
|
||||
|
||||
typedef void (*GeoCommandFunction)();
|
||||
#undef cur_geo_cmd_ptr
|
||||
@@ -73,7 +73,7 @@ void process_cmd_branch_and_link() {
|
||||
|
||||
const auto data = static_cast<char*>(ResourceGetDataByCrc(crc));
|
||||
const auto size = ResourceGetSizeByCrc(crc);
|
||||
GeoLayoutParser::mReader = new LUS::BinaryReader(data, size);
|
||||
GeoLayoutParser::mReader = new Ship::BinaryReader(data, size);
|
||||
|
||||
gGeoLayoutStack[gGeoLayoutStackIndex++] = reinterpret_cast<uintptr_t>(GeoLayoutParser::mLoadedReader);
|
||||
gGeoLayoutStack[gGeoLayoutStackIndex++] = (gCurGraphNodeIndex << 16) + gGeoLayoutReturnIndex;
|
||||
@@ -84,7 +84,7 @@ void process_cmd_end() {
|
||||
gGeoLayoutStackIndex = gGeoLayoutReturnIndex;
|
||||
gGeoLayoutReturnIndex = gGeoLayoutStack[--gGeoLayoutStackIndex] & 0xFFFF;
|
||||
gCurGraphNodeIndex = gGeoLayoutStack[gGeoLayoutStackIndex] >> 16;
|
||||
GeoLayoutParser::mReader = reinterpret_cast<LUS::BinaryReader*>(gGeoLayoutStack[--gGeoLayoutStackIndex]);
|
||||
GeoLayoutParser::mReader = reinterpret_cast<Ship::BinaryReader*>(gGeoLayoutStack[--gGeoLayoutStackIndex]);
|
||||
}
|
||||
|
||||
void process_cmd_branch() {
|
||||
@@ -96,15 +96,15 @@ void process_cmd_branch() {
|
||||
|
||||
if (param == 1) {
|
||||
gGeoLayoutStack[gGeoLayoutStackIndex++] = reinterpret_cast<uintptr_t>(GeoLayoutParser::mLoadedReader);
|
||||
GeoLayoutParser::mReader = new LUS::BinaryReader(data, size);
|
||||
GeoLayoutParser::mReader = new Ship::BinaryReader(data, size);
|
||||
} else {
|
||||
GeoLayoutParser::mLoadedReader = new LUS::BinaryReader(data, size);
|
||||
GeoLayoutParser::mLoadedReader = new Ship::BinaryReader(data, size);
|
||||
GeoLayoutParser::mReader = GeoLayoutParser::mLoadedReader;
|
||||
}
|
||||
}
|
||||
|
||||
void process_cmd_return() {
|
||||
GeoLayoutParser::mReader = reinterpret_cast<LUS::BinaryReader*>(gGeoLayoutStack[--gGeoLayoutStackIndex]);
|
||||
GeoLayoutParser::mReader = reinterpret_cast<Ship::BinaryReader*>(gGeoLayoutStack[--gGeoLayoutStackIndex]);
|
||||
}
|
||||
|
||||
void process_cmd_open_node() {
|
||||
@@ -233,7 +233,7 @@ void process_cmd_node_camera() {
|
||||
Vec3f pos, focus;
|
||||
|
||||
const auto type = GeoLayoutParser::mReader->ReadUInt16();
|
||||
|
||||
|
||||
ReadVec3f(pos);
|
||||
ReadVec3f(focus);
|
||||
|
||||
@@ -515,7 +515,7 @@ void GeoLayoutParser::execute(const char* path) {
|
||||
const auto data = static_cast<char*>(ResourceGetDataByName(path));
|
||||
const auto size = ResourceGetSizeByName(path);
|
||||
|
||||
mLoadedReader = new LUS::BinaryReader(data, size);
|
||||
mLoadedReader = new Ship::BinaryReader(data, size);
|
||||
mReader = mLoadedReader;
|
||||
|
||||
while (mReader != nullptr) {
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
|
||||
class GeoLayoutParser {
|
||||
public:
|
||||
static LUS::BinaryReader* mLoadedReader;
|
||||
static LUS::BinaryReader* mReader;
|
||||
static Ship::BinaryReader* mLoadedReader;
|
||||
static Ship::BinaryReader* mReader;
|
||||
static void execute(const char* path);
|
||||
};
|
||||
#else
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
#include "port/importer/types/Animation.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
|
||||
std::shared_ptr<LUS::IResource> SM64::AnimationFactoryV0::ReadResource(std::shared_ptr<LUS::File> file) {
|
||||
std::shared_ptr<Ship::IResource> SM64::AnimationFactoryV0::ReadResource(std::shared_ptr<Ship::File> file) {
|
||||
if (!FileHasValidFormatAndReader(file)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::shared_ptr<Animation> animation = std::make_shared<Animation>(file->InitData);
|
||||
auto reader = std::get<std::shared_ptr<LUS::BinaryReader>>(file->Reader);
|
||||
auto reader = std::get<std::shared_ptr<Ship::BinaryReader>>(file->Reader);
|
||||
|
||||
animation->mData.flags = reader->ReadInt16();
|
||||
animation->mData.animYTransDivisor = reader->ReadInt16();
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
#include "ResourceFactoryBinary.h"
|
||||
|
||||
namespace SM64 {
|
||||
class AnimationFactoryV0 : public LUS::ResourceFactoryBinary {
|
||||
class AnimationFactoryV0 : public Ship::ResourceFactoryBinary {
|
||||
public:
|
||||
std::shared_ptr<LUS::IResource> ReadResource(std::shared_ptr<LUS::File> file) override;
|
||||
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file) override;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
#include "resourcebridge.h"
|
||||
#include "ResourceUtil.h"
|
||||
|
||||
std::shared_ptr<LUS::IResource> SM64::AudioBankFactoryV0::ReadResource(std::shared_ptr<LUS::File> file) {
|
||||
std::shared_ptr<Ship::IResource> SM64::AudioBankFactoryV0::ReadResource(std::shared_ptr<Ship::File> file) {
|
||||
if (!FileHasValidFormatAndReader(file)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::shared_ptr<AudioBank> bank = std::make_shared<AudioBank>(file->InitData);
|
||||
auto reader = std::get<std::shared_ptr<LUS::BinaryReader>>(file->Reader);
|
||||
auto reader = std::get<std::shared_ptr<Ship::BinaryReader>>(file->Reader);
|
||||
|
||||
uint8_t bankId = reader->ReadUInt32();
|
||||
uint32_t instrumentCount = reader->ReadUInt32();
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
#include "ResourceFactoryBinary.h"
|
||||
|
||||
namespace SM64 {
|
||||
class AudioBankFactoryV0 : public LUS::ResourceFactoryBinary {
|
||||
class AudioBankFactoryV0 : public Ship::ResourceFactoryBinary {
|
||||
public:
|
||||
std::shared_ptr<LUS::IResource> ReadResource(std::shared_ptr<LUS::File> file) override;
|
||||
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file) override;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
#include "port/importer/types/AudioSample.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
|
||||
std::shared_ptr<LUS::IResource> SM64::AudioSampleFactoryV0::ReadResource(std::shared_ptr<LUS::File> file) {
|
||||
std::shared_ptr<Ship::IResource> SM64::AudioSampleFactoryV0::ReadResource(std::shared_ptr<Ship::File> file) {
|
||||
if (!FileHasValidFormatAndReader(file)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::shared_ptr<AudioSample> bank = std::make_shared<AudioSample>(file->InitData);
|
||||
auto reader = std::get<std::shared_ptr<LUS::BinaryReader>>(file->Reader);
|
||||
auto reader = std::get<std::shared_ptr<Ship::BinaryReader>>(file->Reader);
|
||||
|
||||
bank->loop.start = reader->ReadUInt32();
|
||||
bank->loop.end = reader->ReadUInt32();
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user