Compare commits

...

5 Commits

Author SHA1 Message Date
David Chavez
9a6dc4e620
Merge c3668d02d4 into 208e3044fc 2024-06-24 21:13:53 +02:00
briaguya
208e3044fc
fix: use sdl userevent to set await_stick_return when scanning for input (#413) 2024-06-22 22:06:25 -04:00
danielryb
cbb5e8e7a4
Allow skipping Song of Soaring cutscene (#409) 2024-06-22 22:02:33 -04:00
David Chavez
c3668d02d4
Merge branch 'dev' into chore/ci-windows-test 2024-06-16 21:56:55 +02:00
dcvz
22520873c5 Attempt what VS does now 2024-06-08 23:49:44 +02:00
4 changed files with 53 additions and 1 deletions

View File

@ -246,9 +246,11 @@ jobs:
# remove LLVM from PATH so it doesn't overshadow the one provided by VS
$env:PATH = ($env:PATH -split ';' | Where-Object { $_ -ne 'C:\Program Files\LLVM\bin' }) -join ';'
cmake -DCMAKE_BUILD_TYPE=${{ matrix.type }} -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_C_COMPILER=clang-cl -DCMAKE_MAKE_PROGRAM=ninja -G Ninja -S . -B cmake-build -DCMAKE_CXX_FLAGS="-Xclang -fexceptions -Xclang -fcxx-exceptions"
cmake -DCMAKE_BUILD_TYPE=${{ matrix.type }} -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_C_COMPILER=clang-cl -DCMAKE_MAKE_PROGRAM=ninja -G Ninja -S . -B cmake-build
cmake --build cmake-build --config ${{ matrix.type }} --target Zelda64Recompiled -j $cpuCores
env:
CXXFLAGS: --target=amd64-pc-windows-msvc -fdiagnostics-absolute-paths
CFLAGS: --target=amd64-pc-windows-msvc -fdiagnostics-absolute-paths
SDL2_VERSION: ${{ inputs.SDL2_VERSION }}
- name: Prepare Archive
run: |

29
patches/skip_sos.c Normal file
View File

@ -0,0 +1,29 @@
#include "patches.h"
#include "overlays/actors/ovl_En_Test7/z_en_test7.h"
#define THIS ((EnTest7*)thisx)
void func_80AF118C(PlayState* play, OwlWarpFeather* feathers, EnTest7* this, s32 arg3, s32 arg4); // EnTest7_UpdateFeathers
void func_80AF2350(EnTest7* this, PlayState* play); // EnTest7_WarpCsWarp
void EnTest7_Update(Actor* thisx, PlayState* play) {
EnTest7* this = THIS;
this->actionFunc(this, play);
if (this->playerCamFunc != NULL) {
this->playerCamFunc(this, play);
}
this->timer++;
func_80AF118C(play, this->feathers, this, (this->flags & OWL_WARP_FLAGS_8) != 0,
(this->flags & OWL_WARP_FLAGS_10) != 0);
// @recomp Allow skipping the Song of Soaring cutscene.
Input* input = CONTROLLER1(&play->state);
if (CHECK_BTN_ANY(input->press.button, BTN_A | BTN_B) && (OWL_WARP_CS_GET_OCARINA_MODE(&this->actor) != ENTEST7_ARRIVE)) {
func_80AF2350(thisx, play);
}
}

View File

@ -192,9 +192,23 @@ bool sdl_event_filter(void* userdata, SDL_Event* event) {
SDL_ControllerAxisEvent* axis_event = &event->caxis;
float axis_value = axis_event->value * (1/32768.0f);
if (axis_value > axis_threshold) {
SDL_Event set_stick_return_event;
set_stick_return_event.type = SDL_USEREVENT;
set_stick_return_event.user.code = axis_event->axis;
set_stick_return_event.user.data1 = nullptr;
set_stick_return_event.user.data2 = nullptr;
recompui::queue_event(set_stick_return_event);
set_scanned_input({(uint32_t)InputType::ControllerAnalog, axis_event->axis + 1});
}
else if (axis_value < -axis_threshold) {
SDL_Event set_stick_return_event;
set_stick_return_event.type = SDL_USEREVENT;
set_stick_return_event.user.code = axis_event->axis;
set_stick_return_event.user.data1 = nullptr;
set_stick_return_event.user.data2 = nullptr;
recompui::queue_event(set_stick_return_event);
set_scanned_input({(uint32_t)InputType::ControllerAnalog, -axis_event->axis - 1});
}
} else {

View File

@ -1350,6 +1350,13 @@ void draw_hook(RT64::RenderCommandList* command_list, RT64::RenderFramebuffer* s
non_mouse_interacted = true;
kb_interacted = true;
break;
case SDL_EventType::SDL_USEREVENT:
if (cur_event.user.code == SDL_GameControllerAxis::SDL_CONTROLLER_AXIS_LEFTY) {
ui_context->rml.await_stick_return_y = true;
} else if (cur_event.user.code == SDL_GameControllerAxis::SDL_CONTROLLER_AXIS_LEFTX) {
ui_context->rml.await_stick_return_x = true;
}
break;
case SDL_EventType::SDL_CONTROLLERAXISMOTION:
SDL_ControllerAxisEvent* axis_event = &cur_event.caxis;
if (axis_event->axis != SDL_GameControllerAxis::SDL_CONTROLLER_AXIS_LEFTY && axis_event->axis != SDL_GameControllerAxis::SDL_CONTROLLER_AXIS_LEFTX) {