Compare commits

..

21 Commits

Author SHA1 Message Date
Kenix3 674bc4cc3e Fixes crash handler. (#1446)
We need to include the PDB with the distributable.
2022-09-08 22:51:56 -04:00
Kenix3 3223331e76 Increment version 2022-09-08 19:08:22 -04:00
louist103 b85ac715eb Backport crash handler (#1401)
* backport crash handler

* backport crash handler

* Fix windows.
2022-09-08 19:05:09 -04:00
Baoulettes 100ab4cbf6 Rando: Fix Fast File Select seed loading (#1252)
* FixRandoLoading

* better methode
2022-08-21 22:19:02 -04:00
Kenix3 b0c10d710a Merge pull request #1239 from GreatArgorath/ToTFogFix2
FIX: Fog bug outside of Temple of Time
2022-08-17 17:54:43 -04:00
Ada 32c10ac885 Update libultraship/libultraship/Lib/Fast3D/gfx_pc.cpp
Co-authored-by: David Chavez <david@dcvz.io>
2022-08-17 14:47:43 +01:00
Ada 4a2d9d8a4c Fixes ToT Fog 2022-08-17 13:20:15 +01:00
briaguya 6206cd7db0 add ActorResetFunc for courtyard guards (#1213)
Co-authored-by: briaguya <briaguya@alice>
2022-08-16 21:50:52 -04:00
briaguya 01b7fedc35 clean up a few epochs that were missed (#1204)
Co-authored-by: briaguya <briaguya@alice>
2022-08-16 21:50:37 -04:00
briaguya 71b1db1fb6 volvagia interpolation fix (#1203)
Co-authored-by: briaguya <briaguya@alice>
2022-08-16 21:50:12 -04:00
aMannus cd37a56161 Rando: Fix being able to get Sun's Song check multiple times (#1185) 2022-08-16 22:16:44 +02:00
Christopher Leggett 0f2e7db8e0 Fix Ice Traps on Windows and Mac (#1216) 2022-08-16 21:49:52 +02:00
briaguya ee9ea3f2bd add 3drando license (#1206)
Co-authored-by: briaguya <briaguya@alice>
2022-08-15 21:17:58 -04:00
briaguya 42bce9d33e don't abuse epochs (#1179)
* don't abuse epochs

* update bongo hand trails

Co-authored-by: briaguya <briaguya@alice>
2022-08-14 23:18:12 -04:00
aMannus fabe051d3d Fix lost woods leading music in rando (#1155) 2022-08-14 23:04:40 -04:00
Julien Lemay 8945b2ed48 Fix Save Editor Event Check Inf "A" Row flags (#1138)
Fix Save Editor Event Check Inf Flags "A" Row flags not working. It was set to "eci1" instead of "eci10".
2022-08-14 23:02:14 -04:00
aMannus d575a3dda6 Fixed rotation of freestanding key checks in rando (#1135) 2022-08-14 23:01:30 -04:00
aMannus 37dd045bd2 Rando: Fix bomb/bombchu shops (#1134)
* Fix bomb shops in rando

* Addressed review comments
2022-08-14 23:01:00 -04:00
aMannus 4ea7f8371f Rando: Zelda sequence fixes (#1095)
* Fixed zelda sequence oddities

* Fixed code inconsistency

* Adressed review comments

* Adressed review comments, removed unneccesary entrance skip

* Addressed some more review comments

* tiny cleanup
2022-08-08 19:59:06 -04:00
InfoManiac742 0e10b59307 Update z_kaleido_item.c (#1046) 2022-08-08 19:58:01 -04:00
InfoManiac742 4bf4ad3359 Update z_en_ru1.c (#1042) 2022-08-08 19:56:56 -04:00
39 changed files with 575 additions and 152 deletions
Vendored
+4 -1
View File
@@ -57,14 +57,17 @@ pipeline {
"${env.CMAKE}" --build . --config Release
cd "..\\..\\"
mkdir debug
move "soh\\x64\\Release\\soh.exe" ".\\"
move "soh\\x64\\Release\\soh.pdb" ".\\debug\\"
move "OTRGui\\build\\assets" ".\\"
move ".\\OTRExporter\\x64\\Release\\ZAPD.exe" ".\\assets\\extractor\\"
move ".\\OTRGui\\build\\Release\\OTRGui.exe" ".\\"
rename README.md readme.txt
"${env.ZIP}" a soh.7z soh.exe OTRGui.exe assets readme.txt
"${env.ZIP}" a soh.7z soh.exe OTRGui.exe assets debug readme.txt
"""
archiveArtifacts artifacts: 'soh.7z', followSymlinks: false, onlyIfSuccessful: true
+353
View File
@@ -0,0 +1,353 @@
#include "spdlog/spdlog.h"
#include "Utils/StringHelper.h"
#include "CrashHandler.h"
#include "Window.h"
#if defined(__linux__)
#include <csignal>
#include <cstdio>
#include <cxxabi.h> // for __cxa_demangle
#include <dlfcn.h> // for dladdr
#include <execinfo.h>
#include <unistd.h>
static void PrintRegisters(ucontext_t* ctx) {
char regbuffer[1024];
SPDLOG_CRITICAL("Registers:");
#if defined(__x86_64__)
snprintf(regbuffer, std::size(regbuffer), "0x%016llX", ctx->uc_mcontext.gregs[REG_RAX]);
SPDLOG_CRITICAL("RAX: {} ", regbuffer);
snprintf(regbuffer, std::size(regbuffer), "0x%016llX", ctx->uc_mcontext.gregs[REG_RDI]);
SPDLOG_CRITICAL("RDI: {} ", regbuffer);
snprintf(regbuffer, std::size(regbuffer), "0x%016llX", ctx->uc_mcontext.gregs[REG_RSI]);
SPDLOG_CRITICAL("RSI: {} ", regbuffer);
snprintf(regbuffer, std::size(regbuffer), "0x%016llX", ctx->uc_mcontext.gregs[REG_RDX]);
SPDLOG_CRITICAL("RDX: {} ", regbuffer);
snprintf(regbuffer, std::size(regbuffer), "0x%016llX", ctx->uc_mcontext.gregs[REG_RCX]);
SPDLOG_CRITICAL("RCX: {} ", regbuffer);
snprintf(regbuffer, std::size(regbuffer), "0x%016llX", ctx->uc_mcontext.gregs[REG_R8]);
SPDLOG_CRITICAL("R8 : {} ", regbuffer);
snprintf(regbuffer, std::size(regbuffer), "0x%016llX", ctx->uc_mcontext.gregs[REG_R9]);
SPDLOG_CRITICAL("R9 : {} ", regbuffer);
snprintf(regbuffer, std::size(regbuffer), "0x%016llX", ctx->uc_mcontext.gregs[REG_R10]);
SPDLOG_CRITICAL("R10: {} ", regbuffer);
snprintf(regbuffer, std::size(regbuffer), "0x%016llX", ctx->uc_mcontext.gregs[REG_R11]);
SPDLOG_CRITICAL("R11: {} ", regbuffer);
snprintf(regbuffer, std::size(regbuffer), "0x%016llX", ctx->uc_mcontext.gregs[REG_RSP]);
SPDLOG_CRITICAL("RSP: {} ", regbuffer);
snprintf(regbuffer, std::size(regbuffer), "0x%016llX", ctx->uc_mcontext.gregs[REG_RBX]);
SPDLOG_CRITICAL("RBX: {} ", regbuffer);
snprintf(regbuffer, std::size(regbuffer), "0x%016llX", ctx->uc_mcontext.gregs[REG_RBP]);
SPDLOG_CRITICAL("RBP: {} ", regbuffer);
snprintf(regbuffer, std::size(regbuffer), "0x%016llX", ctx->uc_mcontext.gregs[REG_R12]);
SPDLOG_CRITICAL("R12: {} ", regbuffer);
snprintf(regbuffer, std::size(regbuffer), "0x%016llX", ctx->uc_mcontext.gregs[REG_R13]);
SPDLOG_CRITICAL("R13: {} ", regbuffer);
snprintf(regbuffer, std::size(regbuffer), "0x%016llX", ctx->uc_mcontext.gregs[REG_R14]);
SPDLOG_CRITICAL("R14: {} ", regbuffer);
snprintf(regbuffer, std::size(regbuffer), "0x%016llX", ctx->uc_mcontext.gregs[REG_R15]);
SPDLOG_CRITICAL("R15: {} ", regbuffer);
snprintf(regbuffer, std::size(regbuffer), "0x%016llX", ctx->uc_mcontext.gregs[REG_RIP]);
SPDLOG_CRITICAL("RIP: {} ", regbuffer);
snprintf(regbuffer, std::size(regbuffer), "0x%016llX", ctx->uc_mcontext.gregs[REG_EFL]);
SPDLOG_CRITICAL("EFLAGS: {} ", regbuffer);
#else
snprintf(regbuffer, std::size(regbuffer),"0x%08lX", ctx->uc_mcontext.gregs[REG_EDI]);
SPDLOG_CRITICAL("EDI : {} ", regbuffer);
snprintf(regbuffer, std::size(regbuffer),"0x%08lX", ctx->uc_mcontext.gregs[REG_ESI]);
SPDLOG_CRITICAL("ESI : {} ", regbuffer);
snprintf(regbuffer, std::size(regbuffer),"0x%08lX", ctx->uc_mcontext.gregs[REG_EBP]);
SPDLOG_CRITICAL("EBP : {} ", regbuffer);
snprintf(regbuffer, std::size(regbuffer),"0x%08lX", ctx->uc_mcontext.gregs[REG_ESP]);
SPDLOG_CRITICAL("ESP : {} ", regbuffer);
snprintf(regbuffer, std::size(regbuffer),"0x%08lX", ctx->uc_mcontext.gregs[REG_EBX]);
SPDLOG_CRITICAL("EBX : {} ", regbuffer);
snprintf(regbuffer, std::size(regbuffer),"0x%08lX", ctx->uc_mcontext.gregs[REG_EDX]);
SPDLOG_CRITICAL("EDX : {} ", regbuffer);
snprintf(regbuffer, std::size(regbuffer),"0x%08lX", ctx->uc_mcontext.gregs[REG_ECX]);
SPDLOG_CRITICAL("ECX : {} ", regbuffer);
snprintf(regbuffer, std::size(regbuffer),"0x%08lX", ctx->uc_mcontext.gregs[REG_EAX]);
SPDLOG_CRITICAL("EAX : {} ", regbuffer);
snprintf(regbuffer, std::size(regbuffer),"0x%08lX", ctx->uc_mcontext.gregs[REG_EIP]);
SPDLOG_CRITICAL("EIP : {} ", regbuffer);
snprintf(regbuffer, std::size(regbuffer),"0x%08lX", ctx->uc_mcontext.gregs[REG_EFL]);
SPDLOG_CRITICAL("EFL : {} ", regbuffer);
#endif
}
static void ErrorHandler(int sig, siginfo_t* sigInfo, void* data) {
std::array<void*, 4096> arr;
ucontext_t* ctx = static_cast<ucontext_t*>(data);
constexpr size_t nMaxFrames = arr.size();
size_t size = backtrace(arr.data(), nMaxFrames);
char** symbols = backtrace_symbols(arr.data(), nMaxFrames);
SPDLOG_CRITICAL("(Signal: {})", sig);
switch (sig) {
case SIGILL:
SPDLOG_CRITICAL("ILLEGAL INSTRUCTION");
break;
case SIGABRT:
SPDLOG_CRITICAL("ABORT");
break;
case SIGFPE:
SPDLOG_CRITICAL("ERRONEUS ARITHEMETIC OPERATION");
break;
case SIGSEGV:
SPDLOG_CRITICAL("INVALID ACCESS TO STORAGE");
break;
}
PrintRegisters(ctx);
SPDLOG_CRITICAL("Traceback:");
for (size_t i = 1; i < size; i++) {
Dl_info info;
int gotAddress = dladdr(arr[i], &info);
std::string functionName(symbols[i]);
if (gotAddress != 0 && info.dli_sname != nullptr) {
FILE* pipe;
int32_t status;
char* demangled = abi::__cxa_demangle(info.dli_sname, nullptr, nullptr, &status);
const char* nameFound = info.dli_sname;
if (status == 0) {
nameFound = demangled;
}
#if 0
char command[256];
char addrLine[128];
snprintf(command, sizeof(command), "addr2line -e soh.elf %s + 0x%lX", nameFound, (uintptr_t)arr[i] - (uintptr_t)info.dli_saddr);
pipe = popen(command, "r");
fgets(addrLine, 128, pipe);
#endif
functionName = StringHelper::Sprintf("%s (+0x%X)", nameFound,
(char*)arr[i] - (char*)info.dli_saddr);
free(demangled);
}
SPDLOG_CRITICAL("{} {}", i, functionName.c_str());
}
free(symbols);
//DeinitOTR();
exit(1);
}
static void ShutdownHandler(int sig, siginfo_t* sigInfo, void* data) {
//DeinitOTR();
exit(1);
}
extern "C" void SetupHandlerLinux() {
struct sigaction action;
struct sigaction shutdownAction;
action.sa_flags = SA_SIGINFO;
action.sa_sigaction = ErrorHandler;
sigaction(SIGILL, &action, nullptr);
sigaction(SIGABRT, &action, nullptr);
sigaction(SIGFPE, &action, nullptr);
sigaction(SIGSEGV, &action, nullptr);
shutdownAction.sa_flags = SA_SIGINFO;
shutdownAction.sa_sigaction = ShutdownHandler;
sigaction(SIGINT, &shutdownAction, nullptr);
sigaction(SIGTERM, &shutdownAction, nullptr);
sigaction(SIGQUIT, &shutdownAction, nullptr);
sigaction(SIGKILL, &shutdownAction, nullptr);
}
#elif _WIN32
#if defined(_WIN32) && !defined(_WIN64)
#define WINDOWS_32_BIT
#endif
static void PrintRegisters(CONTEXT* ctx) {
SPDLOG_CRITICAL("Register dump");
char regBuff[50];
#if defined(_M_AMD64)
snprintf(regBuff, std::size(regBuff), "0x%016llX", ctx->Rax);
SPDLOG_CRITICAL("RAX: {}", regBuff);
snprintf(regBuff, std::size(regBuff), "0x%016llX", ctx->Rcx);
SPDLOG_CRITICAL("RCX: {}", regBuff);
snprintf(regBuff, std::size(regBuff), "0x%016llX", ctx->Rdx);
SPDLOG_CRITICAL("RDX: {}", regBuff);
snprintf(regBuff, std::size(regBuff), "0x%016llX", ctx->Rbx);
SPDLOG_CRITICAL("RBX: {}", regBuff);
snprintf(regBuff, std::size(regBuff), "0x%016llX", ctx->Rsp);
SPDLOG_CRITICAL("RSP: {}", regBuff);
snprintf(regBuff, std::size(regBuff), "0x%016llX", ctx->Rbp);
SPDLOG_CRITICAL("RBP: {}", regBuff);
snprintf(regBuff, std::size(regBuff), "0x%016llX", ctx->Rsi);
SPDLOG_CRITICAL("RSI: {}", regBuff);
snprintf(regBuff, std::size(regBuff), "0x%016llX", ctx->Rdi);
SPDLOG_CRITICAL("RDI: {}", regBuff);
snprintf(regBuff, std::size(regBuff), "0x%016llX", ctx->R9);
SPDLOG_CRITICAL("R9: {}", regBuff);
snprintf(regBuff, std::size(regBuff), "0x%016llX", ctx->R10);
SPDLOG_CRITICAL("R10: {}", regBuff);
snprintf(regBuff, std::size(regBuff), "0x%016llX", ctx->R11);
SPDLOG_CRITICAL("R11: {}", regBuff);
snprintf(regBuff, std::size(regBuff), "0x%016llX", ctx->R12);
SPDLOG_CRITICAL("R12: {}", regBuff);
snprintf(regBuff, std::size(regBuff), "0x%016llX", ctx->R13);
SPDLOG_CRITICAL("R13: {}", regBuff);
snprintf(regBuff, std::size(regBuff), "0x%016llX", ctx->R14);
SPDLOG_CRITICAL("R14: {}", regBuff);
snprintf(regBuff, std::size(regBuff), "0x%016llX", ctx->R15);
SPDLOG_CRITICAL("R15: {}", regBuff);
snprintf(regBuff, std::size(regBuff), "0x%016llX", ctx->Rip);
SPDLOG_CRITICAL("RIP: {}", regBuff);
snprintf(regBuff, std::size(regBuff), "0x%08lX", ctx->EFlags);
SPDLOG_CRITICAL("EFLAGS: {}", regBuff);
#elif WINDOWS_32_BIT
snprintf(regBuff, std::size(regBuff), "0x%08lX", ctx->Edi);
SPDLOG_CRITICAL("EDI: 0x{}", regBuff);
snprintf(regBuff, std::size(regBuff), "0x%08lX", ctx->Esi);
SPDLOG_CRITICAL("ESI: 0x{}", regBuff);
snprintf(regBuff, std::size(regBuff), "0x%08lX", ctx->Ebx);
SPDLOG_CRITICAL("EBX: 0x{}", regBuff);
snprintf(regBuff, std::size(regBuff), "0x%08lX", ctx->Ecx);
SPDLOG_CRITICAL("ECX: 0x{}", ctx->Ecx);
snprintf(regBuff, std::size(regBuff), "0x%08lX", ctx->Eax);
SPDLOG_CRITICAL("EAX: 0x{}", regBuff);
snprintf(regBuff, std::size(regBuff), "0x%08lX", ctx->Ebp);
SPDLOG_CRITICAL("EBP: 0x{}", regBuff);
snprintf(regBuff, std::size(regBuff), "0x%08lX", ctx->Esp);
SPDLOG_CRITICAL("ESP: 0x{}", regBuff);
snprintf(regBuff, std::size(regBuff), "0x%08lX", ctx->EFlags);
SPDLOG_CRITICAL("EFLAGS: 0x{}", regBuff);
snprintf(regBuff, std::size(regBuff), "0x%08lX", ctx->Eip);
SPDLOG_CRITICAL("EIP: 0x{}", regBuff);
#endif
}
static void printStack(CONTEXT* ctx) {
BOOL result;
HANDLE process;
HANDLE thread;
HMODULE hModule;
ULONG frame;
DWORD64 displacement;
DWORD disp;
#if defined(_M_AMD64)
STACKFRAME64 stack;
memset(&stack, 0, sizeof(STACKFRAME64));
#elif WINDOWS_32_BIT
STACKFRAME stack;
memset(&stack, 0, sizeof(STACKFRAME));
stack.AddrPC.Offset = (*ctx).Eip;
stack.AddrPC.Mode = AddrModeFlat;
stack.AddrStack.Offset = (*ctx).Esp;
stack.AddrStack.Mode = AddrModeFlat;
stack.AddrFrame.Offset = (*ctx).Ebp;
stack.AddrFrame.Mode = AddrModeFlat;
#endif
char buffer[sizeof(SYMBOL_INFO) + MAX_SYM_NAME + sizeof(TCHAR)];
char module[512];
PSYMBOL_INFO symbol = (PSYMBOL_INFO)buffer;
CONTEXT ctx2;
memcpy(&ctx2, ctx, sizeof(CONTEXT));
PrintRegisters(&ctx2);
process = GetCurrentProcess();
thread = GetCurrentThread();
SymSetOptions(SYMOPT_NO_IMAGE_SEARCH | SYMOPT_IGNORE_IMAGEDIR);
SymInitialize(process, "debug", true);
constexpr DWORD machineType =
#if defined(_M_AMD64)
IMAGE_FILE_MACHINE_AMD64;
#elif WINDOWS_32_BIT
IMAGE_FILE_MACHINE_I386;
#endif
displacement = 0;
for (frame = 0;; frame++) {
result = StackWalk(machineType, process, thread, &stack, &ctx2, nullptr, SymFunctionTableAccess,
SymGetModuleBase, nullptr);
if (!result) {
break;
}
symbol->SizeOfStruct = sizeof(SYMBOL_INFO);
symbol->MaxNameLen = MAX_SYM_NAME;
SymFromAddr(process, (ULONG64)stack.AddrPC.Offset, &displacement, symbol);
#if defined(_M_AMD64)
IMAGEHLP_LINE64 line;
line.SizeOfStruct = sizeof(IMAGEHLP_LINE64);
#elif WINDOWS_32_BIT
IMAGEHLP_LINE line;
line.SizeOfStruct = sizeof(IMAGEHLP_LINE);
#endif
if (SymGetLineFromAddr(process, stack.AddrPC.Offset, &disp, &line)) {
SPDLOG_CRITICAL("{} in {}: line: {}: ", symbol->Name, line.FileName, line.LineNumber);
}
else {
char addrString[25];
snprintf(addrString, std::size(addrString), "0x%016llX", symbol->Address);
SPDLOG_CRITICAL("at {}, addr 0x{}", symbol->Name, addrString);
hModule = nullptr;
GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
(LPCTSTR)(stack.AddrPC.Offset), &hModule);
if (hModule != nullptr) {
GetModuleFileNameA(hModule, module, sizeof(module));
}
SPDLOG_CRITICAL("In {}", module);
}
}
Ship::GlobalCtx2::GetInstance()->GetLogger()->flush();
spdlog::shutdown();
}
extern "C" LONG seh_filter(struct _EXCEPTION_POINTERS* ex) {
char exceptionString[20];
snprintf(exceptionString, std::size(exceptionString), "0x%x", ex->ExceptionRecord->ExceptionCode);
SPDLOG_CRITICAL("EXCEPTION {} occurred", exceptionString);
printStack(ex->ContextRecord);
MessageBox(nullptr, L"SoH Has crashed. Please upload the logs to the support channel in discord.", L"Crash", MB_OK | MB_ICONERROR);
return EXCEPTION_EXECUTE_HANDLER;
}
#endif
+44
View File
@@ -0,0 +1,44 @@
#ifndef CRASH_HANDLER_H
#define CRASH_HANDLER_H
#ifdef __linux__
#ifdef __cplusplus
extern "C" {
#endif
void SetupHandlerLinux(void);
#ifdef __cplusplus
}
#endif
#elif _WIN32 // __linux__ ^^^^ _WIN32 vvvvv
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#ifndef NOGDI
#define NOGDI
#endif
#include <windows.h>
#include <DbgHelp.h>
#include <inttypes.h>
#include <excpt.h>
#ifdef __cplusplus
extern "C" {
#endif
LONG seh_filter(struct _EXCEPTION_POINTERS* ex);
#ifdef __cplusplus
}
#endif
#pragma comment(lib, "Dbghelp.lib")
#endif
#endif // CRASH_HANDLER_H
@@ -2112,6 +2112,10 @@ static void gfx_run_dl(Gfx* cmd) {
switch (opcode) {
// RSP commands:
case G_LOAD_UCODE:
rsp.fog_mul = 0;
rsp.fog_offset = 0;
break;
case G_MARKER:
{
cmd++;
@@ -257,6 +257,7 @@
<ClCompile Include="Audio.cpp" />
<ClCompile Include="Blob.cpp" />
<ClCompile Include="ControlDeck.cpp" />
<ClCompile Include="CrashHandler.cpp" />
<ClCompile Include="Cvar.cpp" />
<ClCompile Include="Environment.cpp" />
<ClCompile Include="Factories\AudioFactory.cpp" />
@@ -344,6 +345,7 @@
<ClCompile Include="SDLController.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="CrashHandler.h" />
<ClInclude Include="Lib\Mercury\Mercury.h" />
<ClInclude Include="Lib\nlohmann\json.hpp" />
<ClInclude Include="abi.h" />
@@ -100,6 +100,9 @@
<Filter Include="Source Files\Controller\InputEditor">
<UniqueIdentifier>{010dc29b-d1f6-4793-a4e7-4156aa4fcdd6}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\CrashHandler">
<UniqueIdentifier>{2bfc7e1d-8d0f-44c8-bb1e-af3e9de30da1}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Factories\MaterialFactory.cpp">
@@ -366,6 +369,9 @@
<ClCompile Include="Lib\Mercury\Mercury.cpp">
<Filter>Source Files\Lib\Mercury</Filter>
</ClCompile>
<ClCompile Include="CrashHandler.cpp">
<Filter>Source Files\CrashHandler</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="Lib\tinyxml2\tinyxml2.h">
@@ -683,5 +689,8 @@
<ClInclude Include="Lib\Mercury\Mercury.h">
<Filter>Source Files\Lib\Mercury</Filter>
</ClInclude>
<ClInclude Include="CrashHandler.h">
<Filter>Source Files\CrashHandler</Filter>
</ClInclude>
</ItemGroup>
</Project>
@@ -944,7 +944,7 @@ void DrawFlagsTab() {
DrawGroupWithBorder([&]() {
ImGui::Text("A");
InsertHelpHoverText("First-time overworld entrance cs related");
DrawFlagArray16("eci1", gSaveContext.eventChkInf[10]);
DrawFlagArray16("eci10", gSaveContext.eventChkInf[10]);
});
DrawGroupWithBorder([&]() {
@@ -0,0 +1,27 @@
This software contains derivative code from [OoT-Randomizer](https://github.com/TestRunnerSRL/OoT-Randomizer), which is licensed under the MIT license with the following language.
MIT License
Copyright (c) 2017 Amazing Ampharos
Credit for contributions to Junglechief87 on this and to LLCoolDave and
KevinCathcart for their work on the Zelda Lttp Entrance Randomizer which
was the code base for this project.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -3251,7 +3251,10 @@ void GenerateRandomizerImgui() {
cvarSettings[RSK_CUCCO_COUNT] = CVar_GetS32("gRandomizeCuccosToReturn", 7);
cvarSettings[RSK_BIG_POE_COUNT] = CVar_GetS32("gRandomizeBigPoeTargetCount", 10);
cvarSettings[RSK_SKIP_CHILD_STEALTH] = CVar_GetS32("gRandomizeSkipChildStealth", 0);
// If we skip child zelda, skip child stealth is pointless, so this needs to be reflected in the spoiler log
cvarSettings[RSK_SKIP_CHILD_STEALTH] =
!CVar_GetS32("gRandomizeSkipChildZelda", 0) && CVar_GetS32("gRandomizeSkipChildStealth", 0);
cvarSettings[RSK_SKIP_EPONA_RACE] = CVar_GetS32("gRandomizeSkipEponaRace", 0);
cvarSettings[RSK_SKIP_TOWER_ESCAPE] = CVar_GetS32("gRandomizeSkipTowerEscape", 0);
+1 -1
View File
@@ -1,4 +1,4 @@
const char gBuildVersion[] = "RACHAEL BRAVO (3.0.1)";
const char gBuildVersion[] = "RACHAEL CHARLIE (3.0.2)";
const char gBuildTeam[] = "github.com/harbourmasters";
const char gBuildDate[] = __DATE__ " " __TIME__;
const char gBuildMakeOption[] = "";
+8
View File
@@ -3,6 +3,8 @@
#include <soh/Enhancements/bootcommands.h>
#include "soh/OTRGlobals.h"
#include "../libultraship/CrashHandler.h"
s32 gScreenWidth = SCREEN_WIDTH;
s32 gScreenHeight = SCREEN_HEIGHT;
@@ -38,6 +40,12 @@ void Main_LogSystemHeap(void) {
void main(int argc, char** argv)
{
#ifdef __linux__
SetupHandlerLinux();
#elif _WIN32
SetUnhandledExceptionFilter(seh_filter);
#endif
GameConsole_Init();
InitOTR();
BootCommands_Init();
+1 -3
View File
@@ -3973,8 +3973,6 @@ void Actor_DrawDoorLock(GlobalContext* globalCtx, s32 frame, s32 type) {
f32 chainsTranslateX;
f32 chainsTranslateY;
f32 rotZStep;
static u32 epoch = 0;
epoch++;
entry = &sDoorLocksInfo[type];
chainRotZ = entry->chainsRotZInit;
@@ -3988,7 +3986,7 @@ void Actor_DrawDoorLock(GlobalContext* globalCtx, s32 frame, s32 type) {
chainsTranslateY = cosf(entry->chainAngle - chainRotZ) * (10 - frame) * 0.1f * entry->chainLength;
for (i = 0; i < 4; i++) {
FrameInterpolation_RecordOpenChild(entry, epoch + i * 25);
FrameInterpolation_RecordOpenChild(entry, i);
Matrix_Put(&baseMtxF);
Matrix_RotateZ(chainRotZ, MTXMODE_APPLY);
Matrix_Translate(chainsTranslateX, chainsTranslateY, 0.0f, MTXMODE_APPLY);
+13 -7
View File
@@ -557,6 +557,7 @@ void func_8001DFC8(EnItem00* this, GlobalContext* globalCtx) {
if (gSaveContext.n64ddFlag && this->actor.params == ITEM00_SMALL_KEY) {
this->actor.shape.yOffset = 600.0f;
this->actor.shape.rot.y += 960;
}
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f);
@@ -709,15 +710,17 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) {
s32 pad;
if (CVar_GetS32("gNewDrops", 0)) { //set the rotation system on selected model only :)
if ((this->actor.params == ITEM00_RUPEE_GREEN) || (this->actor.params == ITEM00_RUPEE_BLUE) ||
(this->actor.params == ITEM00_RUPEE_RED) || (this->actor.params == ITEM00_ARROWS_SINGLE) ||
(this->actor.params == ITEM00_ARROWS_SMALL) || (this->actor.params == ITEM00_ARROWS_MEDIUM) ||
(this->actor.params == ITEM00_ARROWS_LARGE) || (this->actor.params == ITEM00_BOMBS_A) ||
(this->actor.params == ITEM00_BOMBS_B) || (this->actor.params == ITEM00_NUTS) ||
(this->actor.params == ITEM00_MAGIC_SMALL) || (this->actor.params == ITEM00_SEEDS) ||
(this->actor.params == ITEM00_SMALL_KEY) || (this->actor.params == ITEM00_MAGIC_LARGE) ||
(this->actor.params == ITEM00_HEART) || (this->actor.params == ITEM00_BOMBS_SPECIAL) || this->actor.params == ITEM00_HEART_PIECE) {
(this->actor.params == ITEM00_MAGIC_SMALL) || (this->actor.params == ITEM00_SEEDS) ||
(this->actor.params == ITEM00_MAGIC_LARGE) || (this->actor.params == ITEM00_HEART) ||
(this->actor.params == ITEM00_BOMBS_SPECIAL) || this->actor.params == ITEM00_HEART_PIECE) {
this->actor.shape.rot.y += 960;
}
if (this->actor.params == ITEM00_SMALL_KEY && !gSaveContext.n64ddFlag) {
this->actor.shape.rot.y += 960;
}
}
@@ -1177,16 +1180,19 @@ void EnItem00_Draw(Actor* thisx, GlobalContext* globalCtx) {
this->actor.world.rot.x = 0x4000;
this->actor.shape.shadowScale = 0.5f;
GetItem_Draw(globalCtx, GID_KEY_SMALL);
break;
} else {
Actor_SetScale(&this->actor, 0.03f);
this->scale = 0.03f;
this->actor.shape.yOffset = 320.0f;
this->actor.shape.shadowScale = 6.0f;
this->actor.world.rot.x = 0;
this->actor.shape.rot.y = 0;
if (!gSaveContext.n64ddFlag) {
this->actor.world.rot.x = 0;
this->actor.shape.rot.y = 0;
}
EnItem00_DrawCollectible(this, globalCtx);
break;
}
break;
case ITEM00_SHIELD_DEKU:
GetItem_Draw(globalCtx, GID_SHIELD_DEKU);
break;
+4 -10
View File
@@ -1459,8 +1459,6 @@ void Environment_DrawLensFlare(GlobalContext* globalCtx, EnvironmentContext* env
LENS_FLARE_RING, LENS_FLARE_CIRCLE1, LENS_FLARE_CIRCLE1, LENS_FLARE_CIRCLE1, LENS_FLARE_CIRCLE1,
LENS_FLARE_CIRCLE1, LENS_FLARE_CIRCLE1, LENS_FLARE_CIRCLE1, LENS_FLARE_CIRCLE1, LENS_FLARE_CIRCLE1,
};
static u32 epoch = 0;
epoch++;
OPEN_DISPS(gfxCtx);
@@ -1517,7 +1515,7 @@ void Environment_DrawLensFlare(GlobalContext* globalCtx, EnvironmentContext* env
}
for (i = 0; i < ARRAY_COUNT(lensFlareTypes); i++) {
FrameInterpolation_RecordOpenChild("Lens Flare", epoch + i * 25);
FrameInterpolation_RecordOpenChild("Lens Flare", i);
Matrix_Translate(pos.x, pos.y, pos.z, MTXMODE_NEW);
@@ -1642,8 +1640,6 @@ void Environment_DrawRain(GlobalContext* globalCtx, View* view, GraphicsContext*
Vec3f unused = { 0.0f, 0.0f, 0.0f };
Vec3f windDirection = { 0.0f, 0.0f, 0.0f };
Player* player = GET_PLAYER(globalCtx);
static u32 epoch = 0;
epoch++;
if (!(globalCtx->cameraPtrs[0]->unk_14C & 0x100) && (globalCtx->envCtx.unk_EE[2] == 0)) {
OPEN_DISPS(gfxCtx);
@@ -1673,7 +1669,7 @@ void Environment_DrawRain(GlobalContext* globalCtx, View* view, GraphicsContext*
// draw rain drops
for (i = 0; i < globalCtx->envCtx.unk_EE[1]; i++) {
FrameInterpolation_RecordOpenChild("Rain Drop", epoch + i * 25);
FrameInterpolation_RecordOpenChild("Rain Drop", i);
temp2 = Rand_ZeroOne();
temp1 = Rand_ZeroOne();
@@ -1709,7 +1705,7 @@ void Environment_DrawRain(GlobalContext* globalCtx, View* view, GraphicsContext*
u8 firstDone = false;
for (i = 0; i < globalCtx->envCtx.unk_EE[1]; i++) {
FrameInterpolation_RecordOpenChild("Droplet Ring", epoch + i * 25);
FrameInterpolation_RecordOpenChild("Droplet Ring", i);
if (!firstDone) {
func_80093D84(gfxCtx);
@@ -1925,13 +1921,11 @@ void Environment_DrawLightning(GlobalContext* globalCtx, s32 unused) {
s32 pad[2];
Vec3f unused1 = { 0.0f, 0.0f, 0.0f };
Vec3f unused2 = { 0.0f, 0.0f, 0.0f };
static u32 epoch = 0;
epoch++;
OPEN_DISPS(globalCtx->state.gfxCtx);
for (i = 0; i < ARRAY_COUNT(sLightningBolts); i++) {
FrameInterpolation_RecordOpenChild("Lightning Bolt", epoch + i * 25);
FrameInterpolation_RecordOpenChild("Lightning Bolt", i);
switch (sLightningBolts[i].state) {
case LIGHTNING_BOLT_START:
+1 -3
View File
@@ -413,8 +413,6 @@ void HealthMeter_Draw(GlobalContext* globalCtx) {
s32 curCombineModeSet = 0;
u8* curBgImgLoaded = NULL;
s32 ddHeartCountMinusOne = gSaveContext.inventory.defenseHearts - 1;
static u32 epoch = 0;
epoch++;
OPEN_DISPS(gfxCtx);
@@ -452,7 +450,7 @@ void HealthMeter_Draw(GlobalContext* globalCtx) {
}
for (i = 0; i < totalHeartCount; i++) {
FrameInterpolation_RecordOpenChild("HealthMeter Heart", epoch + i * 25);
FrameInterpolation_RecordOpenChild("HealthMeter Heart", i);
if ((ddHeartCountMinusOne < 0) || (i > ddHeartCountMinusOne)) {
if (i < fullHeartCount) {
+7 -3
View File
@@ -273,11 +273,15 @@ void Gameplay_Init(GameState* thisx) {
u8 tempSetupIndex;
s32 pad[2];
if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SKIP_CHILD_STEALTH)) {
// Skip Child Stealth when option is enabled, Zelda's Letter isn't obtained and Impa's reward hasn't been received
// eventChkInf[4] & 1 = Got Zelda's Letter
// eventChkInf[5] & 0x200 = Got Impa's reward
// entranceIndex 0x7A, Castle Courtyard - Day from crawlspace
// entranceIndex 0x400, Zelda's Courtyard
if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SKIP_CHILD_STEALTH) &&
!(gSaveContext.eventChkInf[4] & 1) && !(gSaveContext.eventChkInf[5] & 0x200)) {
if (gSaveContext.entranceIndex == 0x7A) {
gSaveContext.entranceIndex = 0x400;
} else if (gSaveContext.entranceIndex == 0x296) {
gSaveContext.entranceIndex = 0x23D;
}
}
+3 -3
View File
@@ -790,12 +790,12 @@ void Sram_InitSave(FileChooseContext* fileChooseCtx) {
gSaveContext.eventChkInf[1] |= (1 << 3);
gSaveContext.eventChkInf[1] |= (1 << 4);
// Set "Got Zelda's Letter" flag. Also ensures Saria is back at SFM. TODO: Is this flag used for anything else?
gSaveContext.eventChkInf[4] |= 1;
// Got item from impa
gSaveContext.eventChkInf[5] |= 0x200;
// make sure saria is at SFM
gSaveContext.eventChkInf[4] |= (1 << 0);
// set this at the end to ensure we always start with the letter
// this is for the off chance we got the weird egg from impa (which should never happen)
INV_CONTENT(ITEM_LETTER_ZELDA) = ITEM_LETTER_ZELDA;
@@ -261,8 +261,6 @@ void BgSpot00Hanebasi_DrawTorches(Actor* thisx, GlobalContext* globalCtx2) {
GlobalContext* globalCtx = globalCtx2;
f32 angle;
s32 i;
static u32 epoch = 0;
epoch++;
OPEN_DISPS(globalCtx->state.gfxCtx);
@@ -279,7 +277,7 @@ void BgSpot00Hanebasi_DrawTorches(Actor* thisx, GlobalContext* globalCtx2) {
gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 0);
for (i = 0; i < 2; i++) {
FrameInterpolation_RecordOpenChild("Hanebasi Torch", epoch + i * 25);
FrameInterpolation_RecordOpenChild("Hanebasi Torch", i);
gSPSegment(POLY_XLU_DISP++, 0x08,
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, 0, 32, 64, 1, 0,
@@ -1835,8 +1835,6 @@ void BossFd_DrawBody(GlobalContext* globalCtx, BossFd* this) {
s16 i;
f32 temp_float;
Mtx* tempMat = Graph_Alloc(globalCtx->state.gfxCtx, 18 * sizeof(Mtx));
static u32 epoch = 0;
epoch++;
OPEN_DISPS(globalCtx->state.gfxCtx);
if (this->skinSegments != 0) {
@@ -1878,8 +1876,6 @@ void BossFd_DrawBody(GlobalContext* globalCtx, BossFd* this) {
Matrix_Push();
for (i = 0; i < 18; i++, tempMat++) {
FrameInterpolation_RecordOpenChild(tempMat, epoch + i * 25);
segIndex = (this->work[BFD_LEAD_BODY_SEG] + sBodyIndex[i + 1]) % 100;
Matrix_Translate(this->bodySegsPos[segIndex].x, this->bodySegsPos[segIndex].y, this->bodySegsPos[segIndex].z,
MTXMODE_NEW);
@@ -1905,6 +1901,8 @@ void BossFd_DrawBody(GlobalContext* globalCtx, BossFd* this) {
f32 padD8;
if (this->bodyFallApart[i] < 2) {
FrameInterpolation_RecordOpenChild(tempMat, i);
f32 spD4 = 0.1f;
temp_float = 0.1f;
@@ -1937,13 +1935,13 @@ void BossFd_DrawBody(GlobalContext* globalCtx, BossFd* this) {
bones->actor.scale.y = this->actor.scale.y * spD4;
bones->actor.scale.z = this->actor.scale.z * 0.1f;
}
FrameInterpolation_RecordCloseChild();
}
}
if (i > 0) {
Collider_UpdateSpheres(i + 1, &this->collider);
}
FrameInterpolation_RecordCloseChild();
}
Matrix_Pop();
osSyncPrintf("BH\n");
@@ -3356,8 +3356,6 @@ void BossGanon_DrawShock(BossGanon* this, GlobalContext* globalCtx) {
s32 pad;
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
s16 i;
static u32 epoch = 0;
epoch++;
OPEN_DISPS(gfxCtx);
@@ -3371,7 +3369,7 @@ void BossGanon_DrawShock(BossGanon* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
for (i = 0; i < ARRAY_COUNT(player->bodyPartsPos); i++) {
FrameInterpolation_RecordOpenChild("Ganondorf Shock 0", epoch + i * 25);
FrameInterpolation_RecordOpenChild("Ganondorf Shock 0", i);
Matrix_Translate(player->bodyPartsPos[i].x, player->bodyPartsPos[i].y, player->bodyPartsPos[i].z,
MTXMODE_NEW);
@@ -3386,7 +3384,7 @@ void BossGanon_DrawShock(BossGanon* this, GlobalContext* globalCtx) {
}
} else {
for (i = 1; i < 15; i++) {
FrameInterpolation_RecordOpenChild("Ganondorf Shock 1", epoch + i * 25);
FrameInterpolation_RecordOpenChild("Ganondorf Shock 1", i);
Matrix_Translate(this->unk_2EC[i].x, this->unk_2EC[i].y, this->unk_2EC[i].z, MTXMODE_NEW);
Matrix_ReplaceRotation(&globalCtx->billboardMtxF);
@@ -3463,8 +3461,6 @@ void BossGanon_DrawBigMagicCharge(BossGanon* this, GlobalContext* globalCtx) {
f32 yRot;
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
s16 i;
static u32 epoch = 0;
epoch++;
OPEN_DISPS(gfxCtx);
@@ -3525,7 +3521,7 @@ void BossGanon_DrawBigMagicCharge(BossGanon* this, GlobalContext* globalCtx) {
yRot = BINANG_TO_RAD(this->actor.yawTowardsPlayer);
for (i = 0; i < this->unk_1AC; i++) {
FrameInterpolation_RecordOpenChild("Ganondorf Big Magic", epoch + i * 25);
FrameInterpolation_RecordOpenChild("Ganondorf Big Magic", i);
f32 xzRot = (BossGanon_RandZeroOne() - 0.5f) * M_PI * 1.5f;
@@ -4158,8 +4154,6 @@ void BossGanon_LightBall_Draw(Actor* thisx, GlobalContext* globalCtx) {
s16 i;
f32 alpha;
s32 pad;
static u32 epoch = 0;
epoch++;
OPEN_DISPS(globalCtx->state.gfxCtx);
@@ -4184,7 +4178,7 @@ void BossGanon_LightBall_Draw(Actor* thisx, GlobalContext* globalCtx) {
if (this->unk_1A8 == 1) {
for (i = 0; i < 8; i++) {
FrameInterpolation_RecordOpenChild("Ganondorf Light Ball 0", epoch + i * 25);
FrameInterpolation_RecordOpenChild("Ganondorf Light Ball 0", i);
Matrix_Push();
Matrix_RotateY(i * (M_PI / 8), MTXMODE_APPLY);
@@ -2464,8 +2464,6 @@ void func_80904340(BossGanon2* this, GlobalContext* globalCtx) {
f32 angle;
f32 sin;
f32 cos;
static u32 epoch = 0;
epoch++;
OPEN_DISPS(globalCtx->state.gfxCtx);
Matrix_Push();
@@ -2488,7 +2486,7 @@ void func_80904340(BossGanon2* this, GlobalContext* globalCtx) {
rand = BossGanon2_RandZeroOne();
for (i = 0; i < 5; i++) {
FrameInterpolation_RecordOpenChild("Ganon 80904340", epoch + i * 25);
FrameInterpolation_RecordOpenChild("Ganon 80904340", i);
angle = (i * (2 * M_PI / 5)) + (rand * M_PI);
sin = 5000.0f * sinf(angle);
cos = 5000.0f * cosf(angle);
@@ -2637,8 +2635,6 @@ void BossGanon2_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dLis
void func_80904D88(BossGanon2* this, GlobalContext* globalCtx) {
s32 pad;
s16 i;
static u32 epoch = 0;
epoch++;
OPEN_DISPS(globalCtx->state.gfxCtx);
@@ -2654,7 +2650,7 @@ void func_80904D88(BossGanon2* this, GlobalContext* globalCtx) {
gSPDisplayList(POLY_XLU_DISP++, ovl_Boss_Ganon2_DL_00B308);
for (i = 0; i < 15; i++) {
FrameInterpolation_RecordOpenChild("Ganon 80904D88", epoch + i * 25);
FrameInterpolation_RecordOpenChild("Ganon 80904D88", i);
Matrix_Translate(this->unk_234[i].x, this->unk_234[i].y, this->unk_234[i].z, MTXMODE_NEW);
Matrix_ReplaceRotation(&globalCtx->billboardMtxF);
@@ -2701,8 +2697,6 @@ void func_80904FC8(BossGanon2* this, GlobalContext* globalCtx) {
void func_8090523C(BossGanon2* this, GlobalContext* globalCtx) {
Player* player;
f32 phi_f20;
static u32 epoch = 0;
epoch++;
OPEN_DISPS(globalCtx->state.gfxCtx);
@@ -2716,7 +2710,7 @@ void func_8090523C(BossGanon2* this, GlobalContext* globalCtx) {
gSPDisplayList(POLY_XLU_DISP++, ovl_Boss_Ganon2_DL_00B308);
for (i = 0; i < 11; i++) {
FrameInterpolation_RecordOpenChild("Ganon 8090523C", epoch + i * 25);
FrameInterpolation_RecordOpenChild("Ganon 8090523C", i);
Matrix_Mult(&player->mf_9E0, MTXMODE_NEW);
Matrix_Translate((i * 250.0f) + 900.0f, 350.0f, 0.0f, MTXMODE_APPLY);
@@ -2933,8 +2927,6 @@ void func_809060E8(GlobalContext* globalCtx) {
BossGanon2Effect* effect;
s16 i;
BossGanon2Effect* effects;
static u32 epoch = 0;
epoch++;
effects = effect = globalCtx->specialEffects;
@@ -2944,7 +2936,7 @@ void func_809060E8(GlobalContext* globalCtx) {
for (i = 0; i < 1; i++) {
if (effect->type == 1) {
FrameInterpolation_RecordOpenChild("Ganon 809060E8 0", epoch + i * 25);
FrameInterpolation_RecordOpenChild("Ganon 809060E8 0", i);
Vec3f spA0;
f32 temp_f0;
@@ -2988,7 +2980,7 @@ void func_809060E8(GlobalContext* globalCtx) {
for (i = 0; i < ARRAY_COUNT(sBossGanon2Particles); i++, effect++) {
if (effect->type == 2) {
FrameInterpolation_RecordOpenChild("Ganon 809060E8 1", epoch + i * 25);
FrameInterpolation_RecordOpenChild("Ganon 809060E8 1", i);
if (!usingObjectGEff) {
BossGanon2_SetObjectSegment(NULL, globalCtx, OBJECT_GEFF, true);
@@ -2443,8 +2443,6 @@ void BossMo_DrawTentacle(BossMo* this, GlobalContext* globalCtx) {
f32 phi_f20;
f32 phi_f22;
Vec3f sp110;
static u32 epoch = 0;
epoch++;
OPEN_DISPS(globalCtx->state.gfxCtx);
@@ -2465,7 +2463,7 @@ void BossMo_DrawTentacle(BossMo* this, GlobalContext* globalCtx) {
BossMo_InitRand(1, 29100, 9786);
for (i = 0; i < 41; i++, matrix++) {
FrameInterpolation_RecordOpenChild("Morpha Tentacle", epoch + i * 25);
FrameInterpolation_RecordOpenChild("Morpha Tentacle", i);
s32 pad;
s32 pad2;
@@ -2706,8 +2706,6 @@ s32 BossSst_OverrideHandTrailDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx**
void BossSst_DrawHand(Actor* thisx, GlobalContext* globalCtx) {
BossSst* this = (BossSst*)thisx;
static u32 epoch = 0;
epoch++;
OPEN_DISPS(globalCtx->state.gfxCtx);
@@ -2741,7 +2739,7 @@ void BossSst_DrawHand(Actor* thisx, GlobalContext* globalCtx) {
for (i = 0; i < end; i++) {
if (Math3D_Vec3fDistSq(&trail2->world.pos, &trail->world.pos) > 900.0f) {
FrameInterpolation_RecordOpenChild(trail, 0);
FrameInterpolation_RecordOpenChild(trail, i);
Matrix_SetTranslateRotateYXZ(trail->world.pos.x, trail->world.pos.y, trail->world.pos.z,
&trail->world.rot);
@@ -3329,8 +3329,6 @@ void func_80942180(BossTw* this, GlobalContext* globalCtx) {
void func_809426F0(BossTw* this, GlobalContext* globalCtx) {
s32 pad;
s16 i;
static u32 epoch = 0;
epoch++;
OPEN_DISPS(globalCtx->state.gfxCtx);
@@ -3364,7 +3362,7 @@ void func_809426F0(BossTw* this, GlobalContext* globalCtx) {
}
for (i = 0; i < 8; i++) {
FrameInterpolation_RecordOpenChild("Twinrova 809426F0", epoch + i * 25);
FrameInterpolation_RecordOpenChild("Twinrova 809426F0", i);
Matrix_Push();
Matrix_Translate(0.0f, 0.0f, 5000.0f, MTXMODE_APPLY);
@@ -4418,8 +4416,6 @@ void BossTw_BlastDraw(Actor* thisx, GlobalContext* globalCtx2) {
f32 scaleFactor;
s16 tailIdx;
s16 i;
static u32 epoch = 0;
epoch++;
OPEN_DISPS(globalCtx->state.gfxCtx);
@@ -4430,7 +4426,7 @@ void BossTw_BlastDraw(Actor* thisx, GlobalContext* globalCtx2) {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 200, 20, 0, (s8)this->workf[TAIL_ALPHA]);
gDPSetEnvColor(POLY_XLU_DISP++, 255, 215, 255, 128);
for (i = 9; i >= 0; i--) {
FrameInterpolation_RecordOpenChild("Twinrova Fire Blast", epoch + i * 25);
FrameInterpolation_RecordOpenChild("Twinrova Fire Blast", i);
gSPSegment(POLY_XLU_DISP++, 8,
Gfx_TwoTexScroll(
@@ -4458,7 +4454,7 @@ void BossTw_BlastDraw(Actor* thisx, GlobalContext* globalCtx2) {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 195, 225, 235, (s8)this->workf[TAIL_ALPHA]);
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_tw_DL_01A998));
for (i = 9; i >= 0; i--) {
FrameInterpolation_RecordOpenChild("Twinrova Ice Blast", epoch + i * 25);
FrameInterpolation_RecordOpenChild("Twinrova Ice Blast", i);
gSPSegment(POLY_XLU_DISP++, 8,
Gfx_TwoTexScroll(
@@ -4492,8 +4488,6 @@ void BossTw_DrawDeathBall(Actor* thisx, GlobalContext* globalCtx2) {
f32 scaleFactor;
s16 tailIdx;
s16 i;
static u32 epoch = 0;
epoch++;
OPEN_DISPS(globalCtx->state.gfxCtx);
@@ -4504,7 +4498,7 @@ void BossTw_DrawDeathBall(Actor* thisx, GlobalContext* globalCtx2) {
gDPSetEnvColor(POLY_XLU_DISP++, 255, 215, 255, 128);
for (i = 9; i >= 0; i--) {
FrameInterpolation_RecordOpenChild("Twinrova Death Ball 0", epoch + i * 25);
FrameInterpolation_RecordOpenChild("Twinrova Death Ball 0", i);
gSPSegment(POLY_XLU_DISP++, 8,
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, (((this->work[CS_TIMER_1] * 3) + (i * 0xA))) & 0x7F,
@@ -4528,7 +4522,7 @@ void BossTw_DrawDeathBall(Actor* thisx, GlobalContext* globalCtx2) {
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_tw_DL_01A998));
for (i = 9; i >= 0; i--) {
FrameInterpolation_RecordOpenChild("Twinrova Death Ball 1", epoch + i * 25);
FrameInterpolation_RecordOpenChild("Twinrova Death Ball 1", i);
gSPSegment(POLY_XLU_DISP++, 8,
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, (((this->work[CS_TIMER_1] * 3) + (i * 0xA))) & 0x7F,
@@ -4006,8 +4006,6 @@ void BossVa_DrawDoor(GlobalContext* globalCtx, s16 scale) {
f32 yScale;
f32 segAngle = 0.0f;
s32 i;
static u32 epoch = 0;
epoch++;
OPEN_DISPS(globalCtx->state.gfxCtx);
@@ -4025,7 +4023,7 @@ void BossVa_DrawDoor(GlobalContext* globalCtx, s16 scale) {
Matrix_Get(&doorMtx);
for (i = 0; i < 8; i++, segAngle -= M_PI / 4) {
FrameInterpolation_RecordOpenChild("Barinade Door", epoch + i * 25);
FrameInterpolation_RecordOpenChild("Barinade Door", i);
Matrix_Put(&doorMtx);
Matrix_RotateZ(segAngle, MTXMODE_APPLY);
@@ -564,8 +564,6 @@ void func_80967FFC(Actor* thisx, GlobalContext* globalCtx) {
Demo6K* this = (Demo6K*)thisx;
s32 pad;
u16 timer1 = this->timer1;
static u32 epoch = 0;
epoch++;
OPEN_DISPS(globalCtx->state.gfxCtx);
func_80093D84(globalCtx->state.gfxCtx);
@@ -586,7 +584,7 @@ void func_80967FFC(Actor* thisx, GlobalContext* globalCtx) {
Matrix_RotateZ(-M_PI / 2, MTXMODE_APPLY);
for (i = 0; i < 6; i++) {
FrameInterpolation_RecordOpenChild("Demo6K 80967FFC", epoch + i * 25);
FrameInterpolation_RecordOpenChild("Demo6K 80967FFC", i);
Matrix_RotateZ(M_PI / 3, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEWMTX(globalCtx->state.gfxCtx),
@@ -695,8 +693,6 @@ void func_809688C4(Actor* thisx, GlobalContext* globalCtx2) {
GlobalContext* globalCtx = globalCtx2;
u32 frames = globalCtx->state.frames;
s32 i;
static u32 epoch = 0;
epoch++;
if ((i = (globalCtx->csCtx.state != CS_STATE_IDLE) && (globalCtx->csCtx.npcActions[1] != NULL)) &&
(globalCtx->csCtx.npcActions[1]->action != 1)) {
@@ -707,7 +703,7 @@ void func_809688C4(Actor* thisx, GlobalContext* globalCtx2) {
Matrix_RotateY((s16)(Camera_GetCamDirYaw(GET_ACTIVE_CAM(globalCtx)) + 0x8000) * (M_PI / 0x8000), MTXMODE_APPLY);
for (i = 0; i < 16; i++) {
FrameInterpolation_RecordOpenChild("Demo6K 809688C4", epoch + i * 25);
FrameInterpolation_RecordOpenChild("Demo6K 809688C4", i);
gDPPipeSync(POLY_XLU_DISP++);
gDPSetEnvColor(POLY_XLU_DISP++, sEnvColors[this->unk_274[i]].r, sEnvColors[this->unk_274[i]].g,
@@ -522,8 +522,6 @@ void DemoKankyo_DrawRain(Actor* thisx, GlobalContext* globalCtx) {
f32 translateY;
f32 translateZ;
s16 j;
static u32 epoch = 0;
epoch++;
OPEN_DISPS(globalCtx->state.gfxCtx);
@@ -597,7 +595,7 @@ void DemoKankyo_DrawRain(Actor* thisx, GlobalContext* globalCtx) {
Matrix_Scale(sRainScale * 0.001f, sRainScale * 0.001f, sRainScale * 0.001f, MTXMODE_APPLY);
for (j = 0; j < 5; j++) {
FrameInterpolation_RecordOpenChild("Kankyo Rain", epoch + i * j * 25);
FrameInterpolation_RecordOpenChild("Kankyo Rain", i * j);
s32 pad1;
@@ -663,13 +661,11 @@ void DemoKankyo_DrawClouds(Actor* thisx, GlobalContext* globalCtx) {
f32 dx;
f32 dy;
f32 dz;
static u32 epoch = 0;
epoch++;
OPEN_DISPS(globalCtx->state.gfxCtx);
for (i = 0; i < 30; i++) {
FrameInterpolation_RecordOpenChild("Kankyo Clouds", epoch + i * 25);
FrameInterpolation_RecordOpenChild("Kankyo Clouds", i);
dx = -(Math_SinS(this->unk_150[i].unk_20 - 0x8000) * 120.0f) * (30.0f + (i / 30.0f) * 10.0f);
dy = Math_CosS(this->unk_150[i].unk_20 - 0x8000) * 5.0f + 1200.0f;
@@ -784,8 +780,6 @@ void DemoKankyo_DrawWarpSparkles(Actor* thisx, GlobalContext* globalCtx) {
f32 translateZ;
PosRot posRot;
u8 linkAge = gSaveContext.linkAge;
static u32 epoch = 0;
epoch++;
OPEN_DISPS(globalCtx->state.gfxCtx);
@@ -793,7 +787,7 @@ void DemoKankyo_DrawWarpSparkles(Actor* thisx, GlobalContext* globalCtx) {
this->sparkleCounter += 2;
}
for (i = this->sparkleCounter - 1; i >= 0; i--) {
FrameInterpolation_RecordOpenChild("Kankyo Warp Sparkles", epoch + i * 25);
FrameInterpolation_RecordOpenChild("Kankyo Warp Sparkles", i);
temp_f22 = 1.0f - (i / (f32)this->sparkleCounter);
@@ -933,8 +927,6 @@ void DemoKankyo_DrawSparkles(Actor* thisx, GlobalContext* globalCtx) {
f32 scale;
s16 i;
PosRot posRot;
static u32 epoch = 0;
epoch++;
OPEN_DISPS(globalCtx->state.gfxCtx);
@@ -943,7 +935,7 @@ void DemoKankyo_DrawSparkles(Actor* thisx, GlobalContext* globalCtx) {
}
for (i = this->sparkleCounter - 1; i >= 0; i--) {
FrameInterpolation_RecordOpenChild("Kankyo Sparkles", epoch + i * 25);
FrameInterpolation_RecordOpenChild("Kankyo Sparkles", i);
temp_f20 = 1.0f - (i / (f32)this->sparkleCounter);
@@ -269,8 +269,6 @@ void EffDust_DrawFunc_8099E4F4(Actor* thisx, GlobalContext* globalCtx2) {
f32* distanceTraveled;
s32 i;
f32 aux;
static u32 epoch = 0;
epoch++;
OPEN_DISPS(gfxCtx);
@@ -286,7 +284,7 @@ void EffDust_DrawFunc_8099E4F4(Actor* thisx, GlobalContext* globalCtx2) {
gSPSegment(POLY_XLU_DISP++, 0x08, sEmptyDL);
for (i = 0; i < 64; i++) {
FrameInterpolation_RecordOpenChild("Dust 8099E4F4", epoch + i * 25);
FrameInterpolation_RecordOpenChild("Dust 8099E4F4", i);
if (*distanceTraveled < 1.0f) {
aux = 1.0f - (*distanceTraveled * *distanceTraveled);
@@ -321,8 +319,6 @@ void EffDust_DrawFunc_8099E784(Actor* thisx, GlobalContext* globalCtx2) {
s32 i;
f32 aux;
Player* player = GET_PLAYER(globalCtx);
static u32 epoch = 0;
epoch++;
OPEN_DISPS(gfxCtx);
@@ -342,7 +338,7 @@ void EffDust_DrawFunc_8099E784(Actor* thisx, GlobalContext* globalCtx2) {
gSPSegment(POLY_XLU_DISP++, 0x08, sEmptyDL);
for (i = 0; i < 64; i++) {
FrameInterpolation_RecordOpenChild("Dust 8099E784", epoch + i * 25);
FrameInterpolation_RecordOpenChild("Dust 8099E784", i);
if (*distanceTraveled < 1.0f) {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, *distanceTraveled * 255);
@@ -633,7 +633,8 @@ s32 EnGirlA_CanBuy_Unk20(GlobalContext* globalCtx, EnGirlA* this) {
}
s32 EnGirlA_CanBuy_Bombchus(GlobalContext* globalCtx, EnGirlA* this) {
if (AMMO(ITEM_BOMBCHU) >= 50) {
// When in rando, don't allow buying bombchus when the player doesn't have a bomb bag
if (AMMO(ITEM_BOMBCHU) >= 50 || (gSaveContext.n64ddFlag && CUR_CAPACITY(UPG_BOMB_BAG) == 0)) {
return CANBUY_RESULT_CANT_GET_NOW;
}
if (gSaveContext.rupees < this->basePrice) {
@@ -14,6 +14,7 @@ void EnHeishi1_Init(Actor* thisx, GlobalContext* globalCtx);
void EnHeishi1_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnHeishi1_Update(Actor* thisx, GlobalContext* globalCtx);
void EnHeishi1_Draw(Actor* thisx, GlobalContext* globalCtx);
void EnHeishi1_Reset(void);
void EnHeishi1_SetupWait(EnHeishi1* this, GlobalContext* globalCtx);
void EnHeishi1_SetupWalk(EnHeishi1* this, GlobalContext* globalCtx);
@@ -41,7 +42,7 @@ const ActorInit En_Heishi1_InitVars = {
(ActorFunc)EnHeishi1_Destroy,
(ActorFunc)EnHeishi1_Update,
(ActorFunc)EnHeishi1_Draw,
NULL,
(ActorResetFunc)EnHeishi1_Reset,
};
static f32 sAnimParamsInit[][8] = {
@@ -64,6 +65,10 @@ static s32 sCamDataIdxs[] = {
static s16 sWaypoints[] = { 0, 4, 1, 5, 2, 6, 3, 7 };
void EnHeishi1_Reset(void) {
sHeishi1PlayerIsCaught = false;
}
void EnHeishi1_Init(Actor* thisx, GlobalContext* globalCtx) {
s32 pad;
EnHeishi1* this = (EnHeishi1*)thisx;
@@ -112,14 +117,23 @@ void EnHeishi1_Init(Actor* thisx, GlobalContext* globalCtx) {
}
}
// eventChkInf[4] & 1 = Got Zelda's Letter
// eventChkInf[5] & 0x200 = Got item from impa
// eventChkInf[8] & 1 = Ocarina thrown in moat
bool metZelda = (gSaveContext.eventChkInf[4] & 1) && (gSaveContext.eventChkInf[5] & 0x200);
if (this->type != 5) {
if (((gSaveContext.dayTime < 0xB888) || IS_DAY) && (gSaveContext.n64ddFlag || !(gSaveContext.eventChkInf[8] & 1))) {
if ((gSaveContext.dayTime < 0xB888 || IS_DAY) &&
((!gSaveContext.n64ddFlag && !(gSaveContext.eventChkInf[8] & 1)) ||
(gSaveContext.n64ddFlag && !metZelda))) {
this->actionFunc = EnHeishi1_SetupWalk;
} else {
Actor_Kill(&this->actor);
}
} else {
if ((gSaveContext.dayTime >= 0xB889) || !IS_DAY || (!gSaveContext.n64ddFlag && (gSaveContext.eventChkInf[8] & 1))) {
if ((gSaveContext.dayTime >= 0xB889) || !IS_DAY ||
(!gSaveContext.n64ddFlag && gSaveContext.eventChkInf[8] & 1) ||
(gSaveContext.n64ddFlag && metZelda)) {
this->actionFunc = EnHeishi1_SetupWaitNight;
} else {
Actor_Kill(&this->actor);
@@ -323,13 +323,9 @@ void func_80ABF708(EnOkarinaTag* this, GlobalContext* globalCtx) {
}
void GivePlayerRandoRewardSunSong(EnOkarinaTag* song, GlobalContext* globalCtx, RandomizerCheck check) {
if (song->actor.parent != NULL && song->actor.parent->id == GET_PLAYER(globalCtx)->actor.id &&
!Flags_GetTreasure(globalCtx, 0x1F)) {
Flags_SetTreasure(globalCtx, 0x1F);
} else if (!Flags_GetTreasure(globalCtx, 0x1F)) {
GetItemID getItemId = Randomizer_GetItemIdFromKnownCheck(check, GI_LETTER_ZELDA);
func_8002F434(&song->actor, globalCtx, getItemId, 10000.0f, 100.0f);
}
Flags_SetTreasure(globalCtx, 0x1F);
GetItemID getItemId = Randomizer_GetItemIdFromKnownCheck(check, GI_LETTER_ZELDA);
func_8002F434(&song->actor, globalCtx, getItemId, 10000.0f, 100.0f);
}
void func_80ABF7CC(EnOkarinaTag* this, GlobalContext* globalCtx) {
@@ -338,15 +334,11 @@ void func_80ABF7CC(EnOkarinaTag* this, GlobalContext* globalCtx) {
if ((Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(globalCtx)) {
Message_CloseTextbox(globalCtx);
if (!gSaveContext.n64ddFlag) {
if (!CHECK_QUEST_ITEM(QUEST_SONG_SUN)) {
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(&gSunSongGraveSunSongTeachCs);
gSaveContext.cutsceneTrigger = 1;
}
} else {
if (!Flags_GetTreasure(globalCtx, 0x1F)) {
GivePlayerRandoRewardSunSong(this, globalCtx, RC_SONG_FROM_ROYAL_FAMILYS_TOMB);
}
if (!gSaveContext.n64ddFlag && !CHECK_QUEST_ITEM(QUEST_SONG_SUN)) {
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(&gSunSongGraveSunSongTeachCs);
gSaveContext.cutsceneTrigger = 1;
} else if (!Flags_GetTreasure(globalCtx, 0x1F)) {
GivePlayerRandoRewardSunSong(this, globalCtx, RC_SONG_FROM_ROYAL_FAMILYS_TOMB);
}
this->actionFunc = func_80ABF708;
}
@@ -601,8 +601,9 @@ void EnOssan_Init(Actor* thisx, GlobalContext* globalCtx) {
return;
}
// Completed Dodongo's Cavern
if (this->actor.params == OSSAN_TYPE_BOMBCHUS && !(gSaveContext.eventChkInf[2] & 0x20)) {
// Don't kill bombchu shop actor in rando, making it so the shop is immediately open
// gSaveContext.eventChkInf[2] & 0x20 - Completed Dodongo's Cavern
if (this->actor.params == OSSAN_TYPE_BOMBCHUS && !(gSaveContext.eventChkInf[2] & 0x20) && !gSaveContext.n64ddFlag) {
Actor_Kill(&this->actor);
return;
}
@@ -1469,7 +1470,10 @@ void EnOssan_HandleCanBuyBombs(GlobalContext* globalCtx, EnOssan* this) {
void EnOssan_BuyGoronCityBombs(GlobalContext* globalCtx, EnOssan* this) {
if (LINK_AGE_IN_YEARS == YEARS_CHILD) {
if (!(gSaveContext.eventChkInf[2] & 0x20)) {
// Let players buy the right side of the goron shop in rando regardless of DC completion
// Players will still need a bomb bag to buy bombs (handled by vanilla behaviour)
// gSaveContext.eventChkInf[2] & 0x20 - Completed Dodongo's Cavern
if (!gSaveContext.n64ddFlag && !(gSaveContext.eventChkInf[2] & 0x20)) {
if (gSaveContext.infTable[15] & 0x1000) {
EnOssan_SetStateCantGetItem(globalCtx, this, 0x302E);
} else {
@@ -40,9 +40,8 @@ void EnRiverSound_Init(Actor* thisx, GlobalContext* globalCtx) {
Audio_PlayNatureAmbienceSequence(NATURE_ID_KOKIRI_REGION);
Actor_Kill(&this->actor);
} else if (this->actor.params == RS_SARIAS_SONG) {
if (!CHECK_QUEST_ITEM(QUEST_SONG_LULLABY) ||
CHECK_QUEST_ITEM(QUEST_SONG_SARIA) ||
gSaveContext.n64ddFlag) {
// Always have leading music in rando
if ((!CHECK_QUEST_ITEM(QUEST_SONG_LULLABY) || CHECK_QUEST_ITEM(QUEST_SONG_SARIA)) && !gSaveContext.n64ddFlag) {
Actor_Kill(&this->actor);
}
}
+11 -4
View File
@@ -760,6 +760,14 @@ void func_80AEC2C0(EnRu1* this, GlobalContext* globalCtx) {
func_80AEC070(this, globalCtx, something);
}
// Convenience function used so that Ruto always spawns in Jabu in rando, even after she's been kidnapped
// Equivalent to !(gSaveContext.infTable[20] & 0x20) in vanilla
bool shouldSpawnRuto() {
// gSaveContext.infTable[20] & 0x40 check is to prevent Ruto from spawning during the short period of time when
// she's on the Zora's Sapphire pedestal but hasn't been kidnapped yet (would result in multiple Rutos otherwise)
return !(gSaveContext.infTable[20] & 0x20) || (gSaveContext.n64ddFlag && (gSaveContext.infTable[20] & 0x40));
}
void func_80AEC320(EnRu1* this, GlobalContext* globalCtx) {
s8 actorRoom;
@@ -767,8 +775,7 @@ void func_80AEC320(EnRu1* this, GlobalContext* globalCtx) {
func_80AEB264(this, &gRutoChildWait2Anim, 0, 0, 0);
this->action = 7;
EnRu1_SetMouthIndex(this, 1);
} else if ((gSaveContext.infTable[20] & 0x80) && !(gSaveContext.infTable[20] & 1) &&
!(gSaveContext.infTable[20] & 0x20)) {
} else if ((gSaveContext.infTable[20] & 0x80) && !(gSaveContext.infTable[20] & 1) && shouldSpawnRuto()) {
if (!func_80AEB020(this, globalCtx)) {
func_80AEB264(this, &gRutoChildWait2Anim, 0, 0, 0);
actorRoom = this->actor.room;
@@ -1172,7 +1179,7 @@ void func_80AED414(EnRu1* this, GlobalContext* globalCtx) {
void func_80AED44C(EnRu1* this, GlobalContext* globalCtx) {
s8 actorRoom;
if ((gSaveContext.infTable[20] & 2) && !(gSaveContext.infTable[20] & 0x20) && !(gSaveContext.infTable[20] & 1) &&
if ((gSaveContext.infTable[20] & 2) && shouldSpawnRuto() && !(gSaveContext.infTable[20] & 1) &&
!(gSaveContext.infTable[20] & 0x80)) {
if (!func_80AEB020(this, globalCtx)) {
func_80AEB264(this, &gRutoChildWait2Anim, 0, 0, 0);
@@ -2179,7 +2186,7 @@ void func_80AEFF40(EnRu1* this, GlobalContext* globalCtx) {
void func_80AEFF94(EnRu1* this, GlobalContext* globalCtx) {
s8 actorRoom;
if ((gSaveContext.infTable[20] & 2) && (gSaveContext.infTable[20] & 1) && !(gSaveContext.infTable[20] & 0x20) &&
if ((gSaveContext.infTable[20] & 2) && (gSaveContext.infTable[20] & 1) && shouldSpawnRuto() &&
(!(func_80AEB020(this, globalCtx)))) {
func_80AEB264(this, &gRutoChildWait2Anim, 0, 0, 0);
actorRoom = this->actor.room;
@@ -1766,8 +1766,6 @@ static f32 sSinkingLureSizes[] = {
void Fishing_DrawSinkingLure(GlobalContext* globalCtx) {
s16 i;
f32 scale;
static u32 epoch = 0;
epoch++;
OPEN_DISPS(globalCtx->state.gfxCtx);
@@ -1780,7 +1778,7 @@ void Fishing_DrawSinkingLure(GlobalContext* globalCtx) {
for (i = SINKING_LURE_SEG_COUNT - 1; i >= 0; i--) {
if ((i + D_80B7FEA0) < SINKING_LURE_SEG_COUNT) {
FrameInterpolation_RecordOpenChild("Fishing Lures 1", epoch + i * 25);
FrameInterpolation_RecordOpenChild("Fishing Lures 1", i);
Matrix_Translate(sSinkingLurePos[i].x, sSinkingLurePos[i].y, sSinkingLurePos[i].z, MTXMODE_NEW);
scale = sSinkingLureSizes[i + D_80B7FEA0] * 0.04f;
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
@@ -1799,7 +1797,7 @@ void Fishing_DrawSinkingLure(GlobalContext* globalCtx) {
for (i = SINKING_LURE_SEG_COUNT - 1; i >= 0; i--) {
if ((i + D_80B7FEA0) < SINKING_LURE_SEG_COUNT) {
FrameInterpolation_RecordOpenChild("Fishing Lures 2", epoch + i * 25);
FrameInterpolation_RecordOpenChild("Fishing Lures 2", i);
Matrix_Translate(sSinkingLurePos[i].x, sSinkingLurePos[i].y, sSinkingLurePos[i].z, MTXMODE_NEW);
scale = sSinkingLureSizes[i + D_80B7FEA0] * 0.04f;
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
@@ -482,8 +482,6 @@ void MirRay_Draw(Actor* thisx, GlobalContext* globalCtx) {
s32 i;
MirRayShieldReflection reflection[6];
s32 temp;
static u32 epoch = 0;
epoch++;
this->reflectIntensity = 0.0f;
if ((D_80B8E670 == 0) && !this->unLit && Player_HasMirrorShieldSetToDraw(globalCtx)) {
@@ -514,7 +512,7 @@ void MirRay_Draw(Actor* thisx, GlobalContext* globalCtx) {
}
for (i = 0; i < 6; i++) {
if (reflection[i].reflectionPoly != NULL) {
FrameInterpolation_RecordOpenChild(&reflection[i], epoch + i * 25);
FrameInterpolation_RecordOpenChild(&reflection[i], i);
Matrix_Translate(reflection[i].pos.x, reflection[i].pos.y, reflection[i].pos.z, MTXMODE_NEW);
Matrix_Scale(0.01f, 0.01f, 0.01f, MTXMODE_APPLY);
Matrix_Mult(&reflection[i].mtx, MTXMODE_APPLY);
@@ -6280,7 +6280,7 @@ s32 func_8083E5A8(Player* this, GlobalContext* globalCtx) {
this->actor.colChkInfo.damage = 0;
func_80837C0C(globalCtx, this, 3, 0.0f, 0.0f, 0, 20);
Player_SetPendingFlag(this, globalCtx);
return;
return 1;
}
s32 drop = giEntry->objectId;
@@ -301,6 +301,9 @@ void Title_Init(GameState* thisx) {
saveloading = true;
gSaveContext.fileNum = selectedfile;
Sram_OpenSave();
Randomizer_LoadSettings("");
Randomizer_LoadHintLocations("");
Randomizer_LoadItemLocations("", true);
gSaveContext.gameMode = 0;
gSaveContext.magic = gSaveContext.magic;
SET_NEXT_GAMESTATE(&this->state, Gameplay_Init, GlobalContext);
@@ -11,12 +11,12 @@ static s16 sEquipAnimTimer = 0;
static s16 sEquipMoveTimer = 10;
static s16 sAmmoVtxOffset[] = {
0, 2, 4, 6, 99, 99, 8, 99, 99, 10, 99, 99, 99, 99, 99, 99, 12,
0, 2, 4, 6, 99, 99, 8, 99, 10, 99, 99, 99, 99, 99, 12,
};
extern const char* _gAmmoDigit0Tex[];
void KaleidoScope_DrawAmmoCount(PauseContext* pauseCtx, GraphicsContext* gfxCtx, s16 item) {
void KaleidoScope_DrawAmmoCount(PauseContext* pauseCtx, GraphicsContext* gfxCtx, s16 item, int slot) {
s16 ammo;
s16 i;
@@ -50,7 +50,7 @@ void KaleidoScope_DrawAmmoCount(PauseContext* pauseCtx, GraphicsContext* gfxCtx,
gDPPipeSync(POLY_KAL_DISP++);
if (i != 0) {
gSPVertex(POLY_KAL_DISP++, &pauseCtx->itemVtx[(sAmmoVtxOffset[item] + 31) * 4], 4, 0);
gSPVertex(POLY_KAL_DISP++, &pauseCtx->itemVtx[(sAmmoVtxOffset[slot] + 31) * 4], 4, 0);
gDPLoadTextureBlock(POLY_KAL_DISP++, ((u8*)_gAmmoDigit0Tex[i]), G_IM_FMT_IA, G_IM_SIZ_8b, 8, 8, 0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD,
@@ -59,7 +59,7 @@ void KaleidoScope_DrawAmmoCount(PauseContext* pauseCtx, GraphicsContext* gfxCtx,
gSP1Quadrangle(POLY_KAL_DISP++, 0, 2, 3, 1, 0);
}
gSPVertex(POLY_KAL_DISP++, &pauseCtx->itemVtx[(sAmmoVtxOffset[item] + 32) * 4], 4, 0);
gSPVertex(POLY_KAL_DISP++, &pauseCtx->itemVtx[(sAmmoVtxOffset[slot] + 32) * 4], 4, 0);
gDPLoadTextureBlock(POLY_KAL_DISP++, ((u8*)_gAmmoDigit0Tex[ammo]), G_IM_FMT_IA, G_IM_SIZ_8b, 8, 8, 0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD,
@@ -464,7 +464,7 @@ void KaleidoScope_DrawItemSelect(GlobalContext* globalCtx) {
for (i = 0; i < 15; i++) {
if ((gAmmoItems[i] != ITEM_NONE) && (gSaveContext.inventory.items[i] != ITEM_NONE)) {
KaleidoScope_DrawAmmoCount(pauseCtx, globalCtx->state.gfxCtx, gSaveContext.inventory.items[i]);
KaleidoScope_DrawAmmoCount(pauseCtx, globalCtx->state.gfxCtx, gSaveContext.inventory.items[i], i);
}
}