Compare commits
No commits in common. "beeef1c7ef48a919ac01d6e24133afc6bb659a85" and "806d9bc8484caf5353887f835aa652c406e5a017" have entirely different histories.
beeef1c7ef
...
806d9bc848
|
@ -9,7 +9,7 @@ on:
|
||||||
N64RECOMP_COMMIT:
|
N64RECOMP_COMMIT:
|
||||||
type: string
|
type: string
|
||||||
required: false
|
required: false
|
||||||
default: 'd33d38161798167929b114c2b0fd445f9670e10a'
|
default: '4f61ef4be9ad4e3dddf861e7b3a7906bd255d3d5'
|
||||||
DXC_CHECKSUM:
|
DXC_CHECKSUM:
|
||||||
type: string
|
type: string
|
||||||
required: false
|
required: false
|
||||||
|
|
|
@ -1,12 +1,8 @@
|
||||||
#ifndef __ZELDA_RENDER_H__
|
#ifndef __ZELDA_RENDER_H__
|
||||||
#define __ZELDA_RENDER_H__
|
#define __ZELDA_RENDER_H__
|
||||||
|
|
||||||
#include <unordered_set>
|
|
||||||
#include <filesystem>
|
|
||||||
|
|
||||||
#include "common/rt64_user_configuration.h"
|
#include "common/rt64_user_configuration.h"
|
||||||
#include "ultramodern/renderer_context.hpp"
|
#include "ultramodern/renderer_context.hpp"
|
||||||
#include "librecomp/mods.hpp"
|
|
||||||
|
|
||||||
namespace RT64 {
|
namespace RT64 {
|
||||||
struct Application;
|
struct Application;
|
||||||
|
@ -33,7 +29,6 @@ namespace zelda64 {
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::unique_ptr<RT64::Application> app;
|
std::unique_ptr<RT64::Application> app;
|
||||||
std::unordered_set<std::filesystem::path> enabled_texture_packs;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
std::unique_ptr<ultramodern::renderer::RendererContext> create_render_context(uint8_t *rdram, ultramodern::renderer::WindowHandle window_handle, bool developer_mode);
|
std::unique_ptr<ultramodern::renderer::RendererContext> create_render_context(uint8_t *rdram, ultramodern::renderer::WindowHandle window_handle, bool developer_mode);
|
||||||
|
@ -41,9 +36,6 @@ namespace zelda64 {
|
||||||
RT64::UserConfiguration::Antialiasing RT64MaxMSAA();
|
RT64::UserConfiguration::Antialiasing RT64MaxMSAA();
|
||||||
bool RT64SamplePositionsSupported();
|
bool RT64SamplePositionsSupported();
|
||||||
bool RT64HighPrecisionFBEnabled();
|
bool RT64HighPrecisionFBEnabled();
|
||||||
|
|
||||||
void enable_texture_pack(const recomp::mods::ModHandle& mod);
|
|
||||||
void disable_texture_pack(const recomp::mods::ModHandle& mod);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit a4f5ee10c8303474d9028468e84845b192e9297d
|
Subproject commit 46797d6cadca6ff78377e7065d073a176d988025
|
|
@ -19,6 +19,7 @@ constexpr std::u8string_view general_filename = u8"general.json";
|
||||||
constexpr std::u8string_view graphics_filename = u8"graphics.json";
|
constexpr std::u8string_view graphics_filename = u8"graphics.json";
|
||||||
constexpr std::u8string_view controls_filename = u8"controls.json";
|
constexpr std::u8string_view controls_filename = u8"controls.json";
|
||||||
constexpr std::u8string_view sound_filename = u8"sound.json";
|
constexpr std::u8string_view sound_filename = u8"sound.json";
|
||||||
|
constexpr std::u8string_view program_id = u8"Zelda64Recompiled";
|
||||||
|
|
||||||
constexpr auto res_default = ultramodern::renderer::Resolution::Auto;
|
constexpr auto res_default = ultramodern::renderer::Resolution::Auto;
|
||||||
constexpr auto hr_default = ultramodern::renderer::HUDRatioMode::Clamp16x9;
|
constexpr auto hr_default = ultramodern::renderer::HUDRatioMode::Clamp16x9;
|
||||||
|
|
|
@ -528,16 +528,6 @@ void release_preload(PreloadContext& context) {
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void enable_texture_pack(recomp::mods::ModContext& context, const recomp::mods::ModHandle& mod) {
|
|
||||||
(void)context;
|
|
||||||
zelda64::renderer::enable_texture_pack(mod);
|
|
||||||
}
|
|
||||||
|
|
||||||
void disable_texture_pack(recomp::mods::ModContext& context, const recomp::mods::ModHandle& mod) {
|
|
||||||
(void)context;
|
|
||||||
zelda64::renderer::disable_texture_pack(mod);
|
|
||||||
}
|
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
recomp::Version project_version{};
|
recomp::Version project_version{};
|
||||||
if (!recomp::Version::from_string(version_string, project_version)) {
|
if (!recomp::Version::from_string(version_string, project_version)) {
|
||||||
|
@ -639,18 +629,6 @@ int main(int argc, char** argv) {
|
||||||
.get_game_thread_name = zelda64::get_game_thread_name,
|
.get_game_thread_name = zelda64::get_game_thread_name,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Register the texture pack content type with rt64.json as its content file.
|
|
||||||
recomp::mods::ModContentType texture_pack_content_type{
|
|
||||||
.content_filename = "rt64.json",
|
|
||||||
.allow_runtime_toggle = true,
|
|
||||||
.on_enabled = enable_texture_pack,
|
|
||||||
.on_disabled = disable_texture_pack,
|
|
||||||
};
|
|
||||||
auto texture_pack_content_type_id = recomp::mods::register_mod_content_type(texture_pack_content_type);
|
|
||||||
|
|
||||||
// Register the .rtz texture pack file format with the previous content type as its only allowed content type.
|
|
||||||
recomp::mods::register_mod_container_type("rtz", std::vector{ texture_pack_content_type_id }, false);
|
|
||||||
|
|
||||||
recomp::mods::scan_mods();
|
recomp::mods::scan_mods();
|
||||||
|
|
||||||
printf("Found mods:\n");
|
printf("Found mods:\n");
|
||||||
|
@ -663,7 +641,6 @@ int main(int argc, char** argv) {
|
||||||
printf(", %s", author.c_str());
|
printf(", %s", author.c_str());
|
||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
printf(" Runtime toggleable: %d\n", mod.runtime_toggleable);
|
|
||||||
}
|
}
|
||||||
if (!mod.dependencies.empty()) {
|
if (!mod.dependencies.empty()) {
|
||||||
printf(" Dependencies: %s:%s", mod.dependencies[0].mod_id.c_str(), mod.dependencies[0].version.to_string().c_str());
|
printf(" Dependencies: %s:%s", mod.dependencies[0].mod_id.c_str(), mod.dependencies[0].version.to_string().c_str());
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <variant>
|
|
||||||
|
|
||||||
#define HLSL_CPU
|
#define HLSL_CPU
|
||||||
#include "hle/rt64_application.h"
|
#include "hle/rt64_application.h"
|
||||||
|
@ -11,13 +10,6 @@
|
||||||
|
|
||||||
#include "zelda_render.h"
|
#include "zelda_render.h"
|
||||||
#include "recomp_ui.h"
|
#include "recomp_ui.h"
|
||||||
#include "concurrentqueue.h"
|
|
||||||
|
|
||||||
// Helper class for variant visiting.
|
|
||||||
template<class... Ts>
|
|
||||||
struct overloaded : Ts... { using Ts::operator()...; };
|
|
||||||
template<class... Ts>
|
|
||||||
overloaded(Ts...) -> overloaded<Ts...>;
|
|
||||||
|
|
||||||
static RT64::UserConfiguration::Antialiasing device_max_msaa = RT64::UserConfiguration::Antialiasing::None;
|
static RT64::UserConfiguration::Antialiasing device_max_msaa = RT64::UserConfiguration::Antialiasing::None;
|
||||||
static bool sample_positions_supported = false;
|
static bool sample_positions_supported = false;
|
||||||
|
@ -26,18 +18,6 @@ static bool high_precision_fb_enabled = false;
|
||||||
static uint8_t DMEM[0x1000];
|
static uint8_t DMEM[0x1000];
|
||||||
static uint8_t IMEM[0x1000];
|
static uint8_t IMEM[0x1000];
|
||||||
|
|
||||||
struct TexturePackEnableAction {
|
|
||||||
std::filesystem::path path;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct TexturePackDisableAction {
|
|
||||||
std::filesystem::path path;
|
|
||||||
};
|
|
||||||
|
|
||||||
using TexturePackAction = std::variant<TexturePackEnableAction, TexturePackDisableAction>;
|
|
||||||
|
|
||||||
static moodycamel::ConcurrentQueue<TexturePackAction> texture_pack_action_queue;
|
|
||||||
|
|
||||||
unsigned int MI_INTR_REG = 0;
|
unsigned int MI_INTR_REG = 0;
|
||||||
|
|
||||||
unsigned int DPC_START_REG = 0;
|
unsigned int DPC_START_REG = 0;
|
||||||
|
@ -306,32 +286,6 @@ zelda64::renderer::RT64Context::RT64Context(uint8_t* rdram, ultramodern::rendere
|
||||||
zelda64::renderer::RT64Context::~RT64Context() = default;
|
zelda64::renderer::RT64Context::~RT64Context() = default;
|
||||||
|
|
||||||
void zelda64::renderer::RT64Context::send_dl(const OSTask* task) {
|
void zelda64::renderer::RT64Context::send_dl(const OSTask* task) {
|
||||||
bool packs_disabled = false;
|
|
||||||
TexturePackAction cur_action;
|
|
||||||
while (texture_pack_action_queue.try_dequeue(cur_action)) {
|
|
||||||
std::visit(overloaded{
|
|
||||||
[&](TexturePackDisableAction& to_disable) {
|
|
||||||
enabled_texture_packs.erase(to_disable.path);
|
|
||||||
packs_disabled = true;
|
|
||||||
},
|
|
||||||
[&](TexturePackEnableAction& to_enable) {
|
|
||||||
enabled_texture_packs.insert(to_enable.path);
|
|
||||||
// Load the pack now if no packs have been disabled.
|
|
||||||
if (!packs_disabled) {
|
|
||||||
app->textureCache->loadReplacementDirectory(to_enable.path);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, cur_action);
|
|
||||||
}
|
|
||||||
|
|
||||||
// If any packs were disabled, unload all packs and load all the active ones.
|
|
||||||
if (packs_disabled) {
|
|
||||||
app->textureCache->clearReplacementDirectories();
|
|
||||||
for (const std::filesystem::path& cur_pack_path : enabled_texture_packs) {
|
|
||||||
app->textureCache->loadReplacementDirectory(cur_pack_path);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
app->state->rsp->reset();
|
app->state->rsp->reset();
|
||||||
app->interpreter->loadUCodeGBI(task->t.ucode & 0x3FFFFFF, task->t.ucode_data & 0x3FFFFFF, true);
|
app->interpreter->loadUCodeGBI(task->t.ucode & 0x3FFFFFF, task->t.ucode_data & 0x3FFFFFF, true);
|
||||||
app->processDisplayLists(app->core.RDRAM, task->t.data_ptr & 0x3FFFFFF, 0, true);
|
app->processDisplayLists(app->core.RDRAM, task->t.data_ptr & 0x3FFFFFF, 0, true);
|
||||||
|
@ -422,11 +376,3 @@ bool zelda64::renderer::RT64SamplePositionsSupported() {
|
||||||
bool zelda64::renderer::RT64HighPrecisionFBEnabled() {
|
bool zelda64::renderer::RT64HighPrecisionFBEnabled() {
|
||||||
return high_precision_fb_enabled;
|
return high_precision_fb_enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
void zelda64::renderer::enable_texture_pack(const recomp::mods::ModHandle& mod) {
|
|
||||||
texture_pack_action_queue.enqueue(TexturePackEnableAction{mod.manifest.mod_root_path});
|
|
||||||
}
|
|
||||||
|
|
||||||
void zelda64::renderer::disable_texture_pack(const recomp::mods::ModHandle& mod) {
|
|
||||||
texture_pack_action_queue.enqueue(TexturePackDisableAction{mod.manifest.mod_root_path});
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue