mirror of
https://github.com/Zelda64Recomp/Zelda64Recomp
synced 2026-05-26 23:48:04 -04:00
Added WIP dual analog camera and widescreen UI patches
This commit is contained in:
@@ -152,6 +152,30 @@ extern "C" void recomp_get_item_inputs(uint8_t* rdram, recomp_context* ctx) {
|
||||
*buttons_out = cur_buttons;
|
||||
}
|
||||
|
||||
extern "C" void recomp_get_camera_inputs(uint8_t* rdram, recomp_context* ctx) {
|
||||
float* x_out = _arg<0, float*>(rdram, ctx);
|
||||
float* y_out = _arg<1, float*>(rdram, ctx);
|
||||
|
||||
float x_val = 0.0f;
|
||||
float y_val = 0.0f;
|
||||
|
||||
// Process controller inputs
|
||||
std::vector<recomp::InputState> input_states = recomp::get_input_states();
|
||||
|
||||
for (const recomp::InputState& state : input_states) {
|
||||
if (const auto* controller_state = std::get_if<recomp::ControllerState>(&state)) {
|
||||
x_val += controller_state->axes[recomp::ControllerState::AXIS_RIGHT_X];
|
||||
y_val += controller_state->axes[recomp::ControllerState::AXIS_RIGHT_Y];
|
||||
}
|
||||
else if (const auto* mouse_state = std::get_if<recomp::MouseState>(&state)) {
|
||||
// Mouse currently unused
|
||||
}
|
||||
}
|
||||
|
||||
*x_out = x_val;
|
||||
*y_out = y_val;
|
||||
}
|
||||
|
||||
// TODO move this
|
||||
extern "C" void recomp_puts(uint8_t* rdram, recomp_context* ctx) {
|
||||
PTR(char) cur_str = _arg<0, PTR(char)>(rdram, ctx);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
#include "recomp.h"
|
||||
#include "../RecompiledPatches/recomp_overlays.inl"
|
||||
#include "../../RecompiledPatches/recomp_overlays.inl"
|
||||
|
||||
void load_special_overlay(const SectionTableEntry& section, int32_t ram);
|
||||
|
||||
|
||||
@@ -171,6 +171,7 @@ public:
|
||||
RT64::RenderDescriptorSetBuilder sampler_set_builder{};
|
||||
sampler_set_builder.begin();
|
||||
sampler_set_builder.addImmutableSampler(1, linearSampler_.get());
|
||||
sampler_set_builder.addConstantBuffer(3, 1); // Workaround D3D12 crash due to an empty RT64 descriptor set
|
||||
sampler_set_builder.end();
|
||||
sampler_set_ = sampler_set_builder.create(render_context->device);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user