Merge branch 'develop' into aManchipelago

This commit is contained in:
aMannus
2025-10-15 09:37:51 +02:00
273 changed files with 6101 additions and 3191 deletions
+2 -15
View File
@@ -8,6 +8,7 @@
#include "soh/Enhancements/audio/AudioCollection.h"
#include "soh/Enhancements/audio/AudioEditor.h"
#include "soh/ResourceManagerHelpers.h"
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
#include <stdio.h>
#ifdef _MSC_VER
#define strdup _strdup
@@ -630,21 +631,7 @@ s32 AudioLoad_SyncInitSeqPlayerInternal(s32 playerIdx, s32 seqId, s32 arg2) {
AudioSeq_SkipForwardSequence(seqPlayer);
//! @bug missing return (but the return value is not used so it's not UB)
// Keep track of the previous sequence/scene so we don't repeat notifications
static uint16_t previousSeqId = UINT16_MAX;
static int16_t previousSceneNum = INT16_MAX;
if (CVarGetInteger(CVAR_AUDIO("SeqNameOverlay"), 0) && playerIdx == SEQ_PLAYER_BGM_MAIN &&
(seqId != previousSeqId || (gPlayState != NULL && gPlayState->sceneNum != previousSceneNum))) {
previousSeqId = seqId;
if (gPlayState != NULL) {
previousSceneNum = gPlayState->sceneNum;
}
const char* sequenceName = AudioCollection_GetSequenceName(seqId);
if (sequenceName != NULL) {
Overlay_DisplayText_Seconds(CVarGetInteger(CVAR_AUDIO("SeqNameOverlayDuration"), 5), sequenceName);
}
}
GameInteractor_ExecuteOnSeqPlayerInit(playerIdx, seqId);
}
u8* AudioLoad_SyncLoadSeq(s32 seqId) {
+6 -4
View File
@@ -1,5 +1,6 @@
#ifdef _WIN32
#include <Windows.h>
#include <locale.h>
#endif
#include "global.h"
@@ -44,7 +45,7 @@ void Main_LogSystemHeap(void) {
}
#ifdef _WIN32
int SDL_main(int argc, char** argv) {
int SDL_main(int argc, char* argv[]) {
AllocConsole();
(void)freopen("CONIN$", "r", stdin);
(void)freopen("CONOUT$", "w", stdout);
@@ -52,13 +53,14 @@ int SDL_main(int argc, char** argv) {
#ifndef _DEBUG
ShowWindow(GetConsoleWindow(), SW_HIDE);
#endif
// Allow non-ascii characters for Windows
setlocale(LC_ALL, ".UTF8");
#else //_WIN32
int main(int argc, char** argv) {
int main(int argc, char* argv[]) {
#endif
GameConsole_Init();
InitOTR();
InitOTR(argc, argv);
// TODO: Was moved to below InitOTR because it requires window to be setup. But will be late to catch crashes.
CrashHandlerRegisterCallback(CrashHandler_PrintSohData);
BootCommands_Init();
+1 -1
View File
@@ -1,6 +1,6 @@
#include "global.h"
#include "public/bridge/gfxbridge.h"
#include <libultraship/bridge/gfxbridge.h>
UcodeHandlers sDefaultGSPUCodeText = ucode_f3dex2;
// u64* sDefaultGSPUCodeData = gspF3DZEX2_NoN_PosLight_fifoDataStart;
-1
View File
@@ -2782,7 +2782,6 @@ void Message_OpenText(PlayState* play, u16 textId) {
gSaveContext.eventInf[0] = gSaveContext.eventInf[1] = gSaveContext.eventInf[2] = gSaveContext.eventInf[3] = 0;
}
// RANDOTODO: Use this for ice trap messages
if (CustomMessage_RetrieveIfExists(play)) {
osSyncPrintf("Found custom message");
if (gSaveContext.language == LANGUAGE_JPN) {
+4 -6
View File
@@ -8,7 +8,6 @@
#include "libultraship/bridge.h"
#include "soh/Enhancements/gameplaystats.h"
#include "soh/Enhancements/boss-rush/BossRushTypes.h"
#include "soh/Enhancements/custom-message/CustomMessageInterfaceAddon.h"
#include "soh/Enhancements/cosmetics/cosmeticsTypes.h"
#include "soh/Enhancements/enhancementTypes.h"
@@ -6425,11 +6424,10 @@ void Interface_Draw(PlayState* play) {
void Interface_DrawTotalGameplayTimer(PlayState* play) {
// Draw timer based on the Gameplay Stats total time.
if ((IS_BOSS_RUSH && gSaveContext.ship.quest.data.bossRush.options[BR_OPTIONS_TIMER] == BR_CHOICE_TIMER_YES) ||
(CVarGetInteger(CVAR_GAMEPLAY_STATS("ShowIngameTimer"), 0) && gSaveContext.fileNum >= 0 &&
gSaveContext.fileNum <= 2)) {
if (GameInteractor_Should(VB_SHOW_GAMEPLAY_TIMER,
CVarGetInteger(CVAR_GAMEPLAY_STATS("ShowIngameTimer"), 0) && gSaveContext.fileNum >= 0 &&
gSaveContext.fileNum <= 2,
play)) {
s32 X_Margins_Timer = 0;
if (CVarGetInteger(CVAR_COSMETIC("HUD.IGT.UseMargins"), 0) != 0) {
if (CVarGetInteger(CVAR_COSMETIC("HUD.IGT.PosType"), 0) == ORIGINAL_LOCATION) {
+2
View File
@@ -1390,6 +1390,8 @@ void Play_Draw(PlayState* play) {
Gfx_SetupFrame(gfxCtx, 0, 0, 0);
if ((HREG(80) != 10) || (HREG(82) != 0)) {
GameInteractor_ExecuteOnPlayDrawBegin();
POLY_OPA_DISP = Play_SetFog(play, POLY_OPA_DISP);
POLY_XLU_DISP = Play_SetFog(play, POLY_XLU_DISP);
+5 -1
View File
@@ -5,10 +5,11 @@
#include "global.h"
#include "vt.h"
#include "soh/Enhancements/game-interactor/GameInteractor.h"
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
#include <string.h>
#include <assert.h>
#include "public/bridge/gfxbridge.h"
#include <libultraship/bridge/gfxbridge.h>
#include "soh/OTRGlobals.h"
#include "soh/ResourceManagerHelpers.h"
@@ -256,6 +257,9 @@ s32 swapAndConvertJPEG(void* data) {
void Room_DrawBackground2D(Gfx** gfxP, void* tex, void* tlut, u16 width, u16 height, u8 fmt, u8 siz, u16 tlutMode,
u16 tlutCount, f32 offsetX, f32 offsetY) {
if (!GameInteractor_Should(VB_DRAW_2D_BACKGROUND, true)) {
return;
}
Gfx* gfx = *gfxP;
uObjBg* bg;
+13 -4
View File
@@ -71,6 +71,9 @@
#include "assets/textures/skyboxes/vr_holy1_static.h"
#include "assets/textures/skyboxes/vr_holy1_pal_static.h"
#include "soh/Enhancements/game-interactor/GameInteractor.h"
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
u32 D_8012AC90[4] = {
0x00000000,
0x00010000,
@@ -449,17 +452,23 @@ void func_800AF178(SkyboxContext* skyboxCtx, s32 arg1) {
void LoadSkyboxTex(SkyboxContext* skyboxCtx, int segmentIndex, int imageIndex, char* tex, int width, int height,
int offsetW, int offsetH) {
skyboxCtx->textures[segmentIndex][imageIndex] = tex;
if (GameInteractor_Should(VB_LOAD_SKYBOX, true)) {
skyboxCtx->textures[segmentIndex][imageIndex] = tex;
}
}
void LoadSkyboxTexAtOffset(SkyboxContext* skyboxCtx, int segmentIndex, int imageIndex, char* tex, int width, int height,
int offset) {
skyboxCtx->textures[segmentIndex][imageIndex] = tex;
if (GameInteractor_Should(VB_LOAD_SKYBOX, true)) {
skyboxCtx->textures[segmentIndex][imageIndex] = tex;
}
}
void LoadSkyboxPalette(SkyboxContext* skyboxCtx, int paletteIndex, char* palTex, int width, int height) {
skyboxCtx->palettes[paletteIndex] = palTex;
skyboxCtx->palette_size = width * height;
if (GameInteractor_Should(VB_LOAD_SKYBOX, true)) {
skyboxCtx->palettes[paletteIndex] = palTex;
skyboxCtx->palette_size = width * height;
}
}
static const char* sSBVRFine0Tex[] = { gSunriseSkybox1Tex, gSunriseSkybox2Tex, gSunriseSkybox3Tex, gSunriseSkybox4Tex,