Compare commits

...

7 Commits

6 changed files with 58 additions and 9 deletions

@ -1 +1 @@
Subproject commit e106c18965a89b26197bde972d9a83dd2dea1691 Subproject commit 55ffc5e786b47e9139cf175c3cc3af62d56d5d31

View File

@ -58,13 +58,13 @@ s16 KaleidoScope_SetPageVertices(PlayState* play, Vtx* vtx, s16 vtxPage, s16 num
#define PIXEL_OFFSET ((1 << 4)) #define PIXEL_OFFSET ((1 << 4))
vtx[4 * row + 0].v.tc[0] = PIXEL_OFFSET; vtx[4 * row + 0].v.tc[0] = PIXEL_OFFSET;
vtx[4 * row + 0].v.tc[1] = (1 << 5) + PIXEL_OFFSET; vtx[4 * row + 0].v.tc[1] = PIXEL_OFFSET;
vtx[4 * row + 1].v.tc[0] = PAGE_BG_WIDTH * (1 << 5) + PIXEL_OFFSET; vtx[4 * row + 1].v.tc[0] = PAGE_BG_WIDTH * (1 << 5) + PIXEL_OFFSET;
vtx[4 * row + 1].v.tc[1] = (1 << 5) + PIXEL_OFFSET; vtx[4 * row + 1].v.tc[1] = PIXEL_OFFSET;
vtx[4 * row + 2].v.tc[0] = PIXEL_OFFSET; vtx[4 * row + 2].v.tc[0] = PIXEL_OFFSET;
vtx[4 * row + 2].v.tc[1] = (cur_y - next_y + 1) * (1 << 5) + PIXEL_OFFSET; vtx[4 * row + 2].v.tc[1] = (cur_y - next_y) * (1 << 5) + PIXEL_OFFSET;
vtx[4 * row + 3].v.tc[0] = PAGE_BG_WIDTH * (1 << 5) + PIXEL_OFFSET; vtx[4 * row + 3].v.tc[0] = PAGE_BG_WIDTH * (1 << 5) + PIXEL_OFFSET;
vtx[4 * row + 3].v.tc[1] = (cur_y - next_y + 1) * (1 << 5) + PIXEL_OFFSET; vtx[4 * row + 3].v.tc[1] = (cur_y - next_y) * (1 << 5) + PIXEL_OFFSET;
vtx[4 * row + 0].v.cn[0] = vtx[4 * row + 1].v.cn[0] = vtx[4 * row + 2].v.cn[0] = vtx[4 * row + 3].v.cn[0] = 0; vtx[4 * row + 0].v.cn[0] = vtx[4 * row + 1].v.cn[0] = vtx[4 * row + 2].v.cn[0] = vtx[4 * row + 3].v.cn[0] = 0;
vtx[4 * row + 0].v.cn[1] = vtx[4 * row + 1].v.cn[1] = vtx[4 * row + 2].v.cn[1] = vtx[4 * row + 3].v.cn[1] = 0; vtx[4 * row + 0].v.cn[1] = vtx[4 * row + 1].v.cn[1] = vtx[4 * row + 2].v.cn[1] = vtx[4 * row + 3].v.cn[1] = 0;
@ -245,7 +245,7 @@ Gfx* KaleidoScope_DrawPageSections(Gfx* gfx, Vtx* vertices, TexturePtr* textures
G_IM_FMT_IA, G_IM_SIZ_8b, // fmt, siz G_IM_FMT_IA, G_IM_SIZ_8b, // fmt, siz
PAGE_BG_WIDTH + 2, PAGE_BG_HEIGHT + 2, // width, height PAGE_BG_WIDTH + 2, PAGE_BG_HEIGHT + 2, // width, height
0, (bg_row + 0) * RECOMP_PAGE_ROW_HEIGHT, // uls, ult 0, (bg_row + 0) * RECOMP_PAGE_ROW_HEIGHT, // uls, ult
PAGE_BG_WIDTH + 2, (bg_row + 1) * RECOMP_PAGE_ROW_HEIGHT + 2, // lrs, lrt PAGE_BG_WIDTH + 2 - 1, (bg_row + 1) * RECOMP_PAGE_ROW_HEIGHT + 2 - 1, // lrs, lrt
0, // pal 0, // pal
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMASK, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOMASK,
@ -253,8 +253,8 @@ Gfx* KaleidoScope_DrawPageSections(Gfx* gfx, Vtx* vertices, TexturePtr* textures
gDPSetTileSize(gfx++, G_TX_RENDERTILE, gDPSetTileSize(gfx++, G_TX_RENDERTILE,
0 << G_TEXTURE_IMAGE_FRAC, 0 << G_TEXTURE_IMAGE_FRAC,
0 << G_TEXTURE_IMAGE_FRAC, 0 << G_TEXTURE_IMAGE_FRAC,
(PAGE_BG_WIDTH + 2) <<G_TEXTURE_IMAGE_FRAC, (PAGE_BG_WIDTH + 2 - 1) <<G_TEXTURE_IMAGE_FRAC,
(RECOMP_PAGE_ROW_HEIGHT + 2) << G_TEXTURE_IMAGE_FRAC); (RECOMP_PAGE_ROW_HEIGHT + 2 - 1) << G_TEXTURE_IMAGE_FRAC);
gSPVertex(gfx++, vertices + 4 * bg_row, 4, 0); gSPVertex(gfx++, vertices + 4 * bg_row, 4, 0);
gSP2Triangles(gfx++, 0, 3, 1, 0x0, 3, 0, 2, 0x0); gSP2Triangles(gfx++, 0, 3, 1, 0x0, 3, 0, 2, 0x0);
} }

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; SDL_ControllerAxisEvent* axis_event = &event->caxis;
float axis_value = axis_event->value * (1/32768.0f); float axis_value = axis_event->value * (1/32768.0f);
if (axis_value > axis_threshold) { 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}); set_scanned_input({(uint32_t)InputType::ControllerAnalog, axis_event->axis + 1});
} }
else if (axis_value < -axis_threshold) { 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}); set_scanned_input({(uint32_t)InputType::ControllerAnalog, -axis_event->axis - 1});
} }
} else { } else {

View File

@ -38,7 +38,6 @@
#include "SDL_syswm.h" #include "SDL_syswm.h"
#endif #endif
#define STB_IMAGE_IMPLEMENTATION
#include "../../lib/rt64/src/contrib/stb/stb_image.h" #include "../../lib/rt64/src/contrib/stb/stb_image.h"
template<typename... Ts> template<typename... Ts>

View File

@ -1350,6 +1350,13 @@ void draw_hook(RT64::RenderCommandList* command_list, RT64::RenderFramebuffer* s
non_mouse_interacted = true; non_mouse_interacted = true;
kb_interacted = true; kb_interacted = true;
break; 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: case SDL_EventType::SDL_CONTROLLERAXISMOTION:
SDL_ControllerAxisEvent* axis_event = &cur_event.caxis; 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) { if (axis_event->axis != SDL_GameControllerAxis::SDL_CONTROLLER_AXIS_LEFTY && axis_event->axis != SDL_GameControllerAxis::SDL_CONTROLLER_AXIS_LEFTX) {