Compare commits

...

5 Commits

7 changed files with 151 additions and 3 deletions

View File

@ -5,7 +5,7 @@ on:
SDL2_VERSION:
type: string
required: false
default: '2.28.5'
default: '2.30.3'
N64RECOMP_COMMIT:
type: string
required: false

1
.gitignore vendored
View File

@ -57,6 +57,7 @@ node_modules/
# Recompiler Linux binary
N64Recomp
RSPRecomp
.DS_Store
# Controller mappings file

@ -1 +1 @@
Subproject commit 0c1811ca6f8291c6608f1d6626a73e863902ece9
Subproject commit ce68e96c171f7f036e29f539e22a604da04af824

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

@ -195,9 +195,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

@ -341,6 +341,89 @@ std::vector<recomp::GameEntry> supported_games = {
},
};
// TODO: move somewhere else
namespace zelda64 {
std::string get_game_thread_name(const OSThread* t) {
std::string name = "[Game] ";
switch (t->id) {
case 0:
switch (t->priority) {
case 150:
name += "PIMGR";
break;
case 254:
name += "VIMGR";
break;
default:
name += std::to_string(t->id);
break;
}
break;
case 1:
name += "IDLE";
break;
case 2:
switch (t->priority) {
case 5:
name += "SLOWLY";
break;
case 127:
name += "FAULT";
break;
default:
name += std::to_string(t->id);
break;
}
break;
case 3:
name += "MAIN";
break;
case 4:
name += "GRAPH";
break;
case 5:
name += "SCHED";
break;
case 7:
name += "PADMGR";
break;
case 10:
name += "AUDIOMGR";
break;
case 13:
name += "FLASHROM";
break;
case 18:
name += "DMAMGR";
break;
case 19:
name += "IRQMGR";
break;
default:
name += std::to_string(t->id);
break;
}
return name;
}
}
int main(int argc, char** argv) {
@ -425,7 +508,21 @@ int main(int argc, char** argv) {
.message_box = recompui::message_box,
};
recomp::start({}, rsp_callbacks, renderer_callbacks, audio_callbacks, input_callbacks, gfx_callbacks, thread_callbacks, error_handling_callbacks);
ultramodern::threads::callbacks_t threads_callbacks{
.get_game_thread_name = zelda64::get_game_thread_name,
};
recomp::start(
{},
rsp_callbacks,
renderer_callbacks,
audio_callbacks,
input_callbacks,
gfx_callbacks,
thread_callbacks,
error_handling_callbacks,
threads_callbacks
);
NFD_Quit();

View File

@ -1363,6 +1363,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) {