Compare commits

...

37 Commits

Author SHA1 Message Date
briaguya 36b42635d6 chore: bump version 2022-10-20 09:45:12 -04:00
Christopher Leggett 4a029cc6cf Cuts down on excess rando lookups in z_en_item00 (#1805)
* Cuts down on excess GetCheckFromActor lookups in z_en_item00

* Fixes non-windows build errors.
2022-10-19 23:29:28 -04:00
mergify[bot] 57ba36b063 Fixes crash (#1798) (#1806)
(cherry picked from commit 30c66439a4)

Co-authored-by: RaelCappra <rael.cappra@gmail.com>
2022-10-19 23:12:50 -04:00
Sarge-117 4173eadae2 Fix tunics/boots on C-buttons not always being enabled (#1782)
* Always enable C-buttons with equipment

* Fix for it still sometimes being disables
2022-10-19 21:51:42 -04:00
Christopher Leggett 1b6dd8a0fe Adds extra entry to obj_lift FallTimerDurations. (#1777)
Prevents an OOB access that, as far as I know, was only causing issues
on the Switch, but this addition is harmless everywhere else.
2022-10-15 00:00:48 +02:00
mergify[bot] dd6a8b5084 Tweak: Default to N64 colors (#1767) (#1768)
(cherry picked from commit 4ef7151721)

Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com>
2022-10-13 13:35:41 -04:00
lilDavid f4c871e35c Fix Anju as Adult and Trade Pocket Cucco order (#1766) 2022-10-13 12:40:48 -04:00
briaguya 8e808c4305 chore: bump version 2022-10-13 12:13:51 -04:00
Rozelette 03c3eef193 Implement Color Clamping (#1753)
* q

* Adjust wrap spot, add directx

* Update comments
2022-10-13 11:15:18 -04:00
Amaro Martínez 42a5f46e5e Fix Gerudo Warrior Clothing (#1752)
* Fix Gerudo Warrior Clothing

* Update soh/soh/GameMenuBar.cpp

Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com>

Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com>
2022-10-13 09:46:58 -04:00
Rozelette 7878b8f3e4 Fix animation in Ganon that is causing an OOB access during animation (#1764)
* Fix animation in Ganon that is causing an OOB access during animation

* Fix function args
2022-10-13 09:18:31 -04:00
aMannus 7906d70485 Fix: Pickup item cutscene logic fix (#1733)
* Fix: Fix for the pickup CS logic fix (fixed)

* Tiny cleanup

* More fixes + clarified comments

* Extract more logic into bool, clarified comments
2022-10-12 22:30:15 -04:00
Rozelette dd62d0882e Add hack for Ruto's earrings (#1759)
* Add hack for Ruto's earrings

* Add tag for the underlining issue for easy grepping

* typo
2022-10-12 22:18:35 -04:00
aMannus 6e88a3706c Fix: "Developer Tools" button sizes (#1757)
* Small debug buttons fix

* Better fix for buttons
2022-10-12 17:35:40 -04:00
aMannus d102506fba Catch-all fix for mask select (#1728) 2022-10-12 17:21:04 -04:00
mergify[bot] 7c7f032e0e Implement G_CCMUX_NOISE (#1731) (#1754)
(cherry picked from commit 825af33b6a)

Co-authored-by: Rozelette <Rozelette@users.noreply.github.com>
2022-10-12 13:16:06 +02:00
Rozelette da8f80bb28 Fix endianness, of a sort, of CS lighting command (#1735) 2022-10-11 20:44:55 +02:00
Rozelette 63f763a556 When testing if an animation is new, make sure we are using the loaded file pointers (#1748) 2022-10-11 18:58:28 +02:00
mergify[bot] 83541f4605 [#80] Fix for goron spin on wake up animation (#1714) (#1746) 2022-10-11 18:01:06 +02:00
mergify[bot] 43b7ca96d7 Fix Ruto softlock with fast text (fixes #96) (#1732) (#1745)
(cherry picked from commit e7ea2a3ae1)

Co-authored-by: Rozelette <Rozelette@users.noreply.github.com>
2022-10-11 17:17:41 +02:00
Garrett Cox c00edb928b [#1716] Prevent infinite ammo cheat from filling bombchus unless the item is obtained (#1723) 2022-10-10 10:19:44 +02:00
Garrett Cox b0510d78f8 [#1712] Reset fileNum when returning to title screen and prevent saving when file = 0xFF (#1721) 2022-10-10 10:16:40 +02:00
Garrett Cox fd3872ae30 [#1715] Fix crash when retrieving a merchant message while using fast file select (#1722) 2022-10-10 09:40:52 +02:00
Garrett Cox aa00cba76e [#1718] Fix interpolation issue with bunny hood ears (#1724) 2022-10-10 08:27:22 +02:00
Amaro Martínez 18208cc993 Fix A cursor color in the Continue prompt (#1717) 2022-10-10 08:26:40 +02:00
Andrew Van Caem b310d675f1 Corrected inf entry label for Fado (#1711) 2022-10-09 08:46:11 +02:00
Garrett Cox eb081dc719 Add fix for ice traps while wearing bunny hood (#1713) 2022-10-09 08:38:25 +02:00
Adam Bird e883f27436 reference generated build.c on windows (#1706) 2022-10-07 22:03:16 -04:00
aMannus f563ac733f Fix skipping "get item" cutscene logic 2022-10-07 19:24:58 -04:00
briaguya a133be625e chore: bump version 2022-10-06 20:06:27 -04:00
aMannus 06e8a5af41 Fix navi colors in cosmetics editor (#1684)
* Fix navi colors in cosmetics editor

* Fix navi description for props
2022-10-03 20:50:05 -04:00
th-2021 f1070a2e74 set version in build.c from CmakeLists.txt version info (#1678) 2022-10-04 01:13:29 +02:00
Garrett Cox 02c0caff4f [#1567] Fix merchant message table being generated before items were loaded from save (#1674) 2022-10-03 08:50:19 +02:00
Garrett Cox 2ad0b37fa5 [#1675] Fix for business scrubs crashing on expensive scrub shuffle (#1676) 2022-10-03 08:49:53 +02:00
aMannus 6b6a352205 Rando: Fix "Scrubsanity Off" using mysterious text (#1679) 2022-10-02 20:32:05 +02:00
Ada 37ffc8b9c8 Fixes Y-Axis inversion in C Up view 2022-10-01 19:19:23 -04:00
louis d75b38d457 fix MQ forest 2022-10-01 17:55:03 -04:00
46 changed files with 321 additions and 196 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ endif()
if (CPACK_GENERATOR MATCHES "Bundle")
set(CPACK_BUNDLE_NAME "soh")
set(CPACK_BUNDLE_PLIST "../soh/macosx/Info.plist")
set(CPACK_BUNDLE_PLIST "macosx/Info.plist")
set(CPACK_BUNDLE_ICON "macosx/soh.icns")
set(CPACK_BUNDLE_STARTUP_COMMAND "../soh/macosx/soh-macos.sh")
set(CPACK_BUNDLE_APPLE_CERT_APP "-")
+4 -5
View File
@@ -6,11 +6,10 @@ set(CMAKE_CXX_STANDARD 20 CACHE STRING "The C++ standard to use")
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version" FORCE)
project(Ship C CXX)
set(PROJECT_VERSION_MAJOR "4")
set(PROJECT_VERSION_MINOR "0")
set(PROJECT_VERSION_PATCH "1")
project(Ship LANGUAGES C CXX
VERSION 4.0.4)
set(PROJECT_BUILD_NAME "ZHORA ECHO" CACHE STRING "")
set(PROJECT_TEAM "github.com/harbourmasters" CACHE STRING "")
set_property(DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT soh)
add_compile_options($<$<CXX_COMPILER_ID:MSVC>:/MP>)
@@ -29,7 +29,8 @@ enum {
SHADER_TEXEL1,
SHADER_TEXEL1A,
SHADER_1,
SHADER_COMBINED
SHADER_COMBINED,
SHADER_NOISE
};
#define SHADER_OPT_ALPHA (1 << 0)
@@ -15,6 +15,8 @@ static void append_line(char *buf, size_t *len, const char *str) {
buf[(*len)++] = '\n';
}
#define RAND_NOISE "((random(float3(floor(screenSpace.xy * noise_scale), noise_frame)) + 1.0) / 2.0)"
static const char *shader_item_to_str(uint32_t item, bool with_alpha, bool only_alpha, bool inputs_have_alpha, bool hint_single_element) {
if (!only_alpha) {
switch (item) {
@@ -41,6 +43,8 @@ static const char *shader_item_to_str(uint32_t item, bool with_alpha, bool only_
return with_alpha ? "texVal1" : "texVal1.rgb";
case SHADER_COMBINED:
return with_alpha ? "texel" : "texel.rgb";
case SHADER_NOISE:
return with_alpha ? "float4(" RAND_NOISE ", " RAND_NOISE ", " RAND_NOISE ", " RAND_NOISE ")" : "float3(" RAND_NOISE ", " RAND_NOISE ", " RAND_NOISE ")";
}
} else {
switch (item) {
@@ -67,10 +71,14 @@ static const char *shader_item_to_str(uint32_t item, bool with_alpha, bool only_
return "texVal1.a";
case SHADER_COMBINED:
return "texel.a";
case SHADER_NOISE:
return RAND_NOISE;
}
}
}
#undef RAND_NOISE
static void append_formula(char *buf, size_t *len, const uint8_t c[2][4], bool do_single, bool do_multiply, bool do_mix, bool with_alpha, bool only_alpha, bool opt_alpha) {
if (do_single) {
append_str(buf, len, shader_item_to_str(c[only_alpha][3], with_alpha, only_alpha, opt_alpha, false));
@@ -106,9 +114,7 @@ void gfx_direct3d_common_build_shader(char buf[4096], size_t& len, size_t& num_f
if (include_root_signature) {
append_str(buf, &len, "#define RS \"RootFlags(ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT | DENY_VERTEX_SHADER_ROOT_ACCESS)");
if (cc_features.opt_alpha && cc_features.opt_noise) {
append_str(buf, &len, ",CBV(b0, visibility = SHADER_VISIBILITY_PIXEL)");
}
append_str(buf, &len, ",CBV(b0, visibility = SHADER_VISIBILITY_PIXEL)");
if (cc_features.used_textures[0]) {
append_str(buf, &len, ",DescriptorTable(SRV(t0), visibility = SHADER_VISIBILITY_PIXEL)");
append_str(buf, &len, ",DescriptorTable(Sampler(s0), visibility = SHADER_VISIBILITY_PIXEL)");
@@ -161,17 +167,15 @@ void gfx_direct3d_common_build_shader(char buf[4096], size_t& len, size_t& num_f
// Constant buffer and random function
if (cc_features.opt_alpha && cc_features.opt_noise) {
append_line(buf, &len, "cbuffer PerFrameCB : register(b0) {");
append_line(buf, &len, " uint noise_frame;");
append_line(buf, &len, " float noise_scale;");
append_line(buf, &len, "}");
append_line(buf, &len, "cbuffer PerFrameCB : register(b0) {");
append_line(buf, &len, " uint noise_frame;");
append_line(buf, &len, " float noise_scale;");
append_line(buf, &len, "}");
append_line(buf, &len, "float random(in float3 value) {");
append_line(buf, &len, " float random = dot(value, float3(12.9898, 78.233, 37.719));");
append_line(buf, &len, " return frac(sin(random) * 143758.5453);");
append_line(buf, &len, "}");
}
append_line(buf, &len, "float random(in float3 value) {");
append_line(buf, &len, " float random = dot(value, float3(12.9898, 78.233, 37.719));");
append_line(buf, &len, " return frac(sin(random) * 143758.5453);");
append_line(buf, &len, "}");
// 3 point texture filtering
// Original author: ArthurCarvalho
@@ -248,11 +252,14 @@ void gfx_direct3d_common_build_shader(char buf[4096], size_t& len, size_t& num_f
if (include_root_signature) {
append_line(buf, &len, "[RootSignature(RS)]");
}
if (cc_features.opt_alpha && cc_features.opt_noise) {
append_line(buf, &len, "float4 PSMain(PSInput input, float4 screenSpace : SV_Position) : SV_TARGET {");
} else {
append_line(buf, &len, "float4 PSMain(PSInput input) : SV_TARGET {");
}
append_line(buf, &len, "float4 PSMain(PSInput input, float4 screenSpace : SV_Position) : SV_TARGET {");
// Reference approach to color wrapping as per GLideN64
// Return wrapped value of x in interval [low, high)
// Mod implementation of GLSL sourced from https://registry.khronos.org/OpenGL-Refpages/gl4/html/mod.xhtml
append_line(buf, &len, "#define MOD(x, y) ((x) - (y) * floor((x)/(y)))");
append_line(buf, &len, "#define WRAP(x, low, high) MOD((x)-(low), (high)-(low)) + (low)");
for (int i = 0; i < 2; i++) {
if (cc_features.used_textures[i]) {
len += sprintf(buf + len, " float2 tc%d = input.uv%d;\r\n", i, i);
@@ -294,11 +301,18 @@ void gfx_direct3d_common_build_shader(char buf[4096], size_t& len, size_t& num_f
append_formula(buf, &len, cc_features.c[c], cc_features.do_single[c][0], cc_features.do_multiply[c][0], cc_features.do_mix[c][0], cc_features.opt_alpha, false, cc_features.opt_alpha);
}
append_line(buf, &len, ";");
if (c == 0) {
append_str(buf, &len, "texel = WRAP(texel, -1.01, 1.01);");
}
}
if (cc_features.opt_texture_edge && cc_features.opt_alpha) {
append_line(buf, &len, " if (texel.a > 0.19) texel.a = 1.0; else discard;");
}
append_str(buf, &len, "texel = WRAP(texel, -0.51, 1.51);");
append_str(buf, &len, "texel = clamp(texel, 0.0, 1.0);");
// TODO discard if alpha is 0?
if (cc_features.opt_fog) {
if (cc_features.opt_alpha) {
@@ -57,7 +57,6 @@ struct ShaderProgram {
GLint attrib_locations[16];
uint8_t attrib_sizes[16];
uint8_t num_attribs;
bool used_noise;
GLint frame_count_location;
GLint noise_scale_location;
};
@@ -104,10 +103,8 @@ static void gfx_opengl_vertex_array_set_attribs(struct ShaderProgram *prg) {
}
static void gfx_opengl_set_uniforms(struct ShaderProgram *prg) {
if (prg->used_noise) {
glUniform1i(prg->frame_count_location, frame_count);
glUniform1f(prg->noise_scale_location, current_noise_scale);
}
glUniform1i(prg->frame_count_location, frame_count);
glUniform1f(prg->noise_scale_location, current_noise_scale);
}
static void gfx_opengl_unload_shader(struct ShaderProgram *old_prg) {
@@ -134,6 +131,8 @@ static void append_line(char *buf, size_t *len, const char *str) {
buf[(*len)++] = '\n';
}
#define RAND_NOISE "((random(vec3(floor(gl_FragCoord.xy * noise_scale), float(frame_count))) + 1.0) / 2.0)"
static const char *shader_item_to_str(uint32_t item, bool with_alpha, bool only_alpha, bool inputs_have_alpha, bool hint_single_element) {
if (!only_alpha) {
switch (item) {
@@ -161,6 +160,8 @@ static const char *shader_item_to_str(uint32_t item, bool with_alpha, bool only_
return with_alpha ? "texVal1" : "texVal1.rgb";
case SHADER_COMBINED:
return with_alpha ? "texel" : "texel.rgb";
case SHADER_NOISE:
return with_alpha ? "vec4(" RAND_NOISE ", " RAND_NOISE ", " RAND_NOISE ", " RAND_NOISE ")" : "vec3(" RAND_NOISE ", " RAND_NOISE ", " RAND_NOISE ")";
}
} else {
switch (item) {
@@ -186,11 +187,15 @@ static const char *shader_item_to_str(uint32_t item, bool with_alpha, bool only_
return "texVal1.a";
case SHADER_COMBINED:
return "texel.a";
case SHADER_NOISE:
return RAND_NOISE;
}
}
return "";
}
#undef RAND_NOISE
static void append_formula(char *buf, size_t *len, uint8_t c[2][4], bool do_single, bool do_multiply, bool do_mix, bool with_alpha, bool only_alpha, bool opt_alpha) {
if (do_single) {
append_str(buf, len, shader_item_to_str(c[only_alpha][3], with_alpha, only_alpha, opt_alpha, false));
@@ -368,15 +373,13 @@ static struct ShaderProgram* gfx_opengl_create_and_load_new_shader(uint64_t shad
append_line(fs_buf, &fs_len, "uniform sampler2D uTex1;");
}
if (cc_features.opt_alpha && cc_features.opt_noise) {
append_line(fs_buf, &fs_len, "uniform int frame_count;");
append_line(fs_buf, &fs_len, "uniform float noise_scale;");
append_line(fs_buf, &fs_len, "uniform int frame_count;");
append_line(fs_buf, &fs_len, "uniform float noise_scale;");
append_line(fs_buf, &fs_len, "float random(in vec3 value) {");
append_line(fs_buf, &fs_len, " float random = dot(sin(value), vec3(12.9898, 78.233, 37.719));");
append_line(fs_buf, &fs_len, " return fract(sin(random) * 143758.5453);");
append_line(fs_buf, &fs_len, "}");
}
append_line(fs_buf, &fs_len, "float random(in vec3 value) {");
append_line(fs_buf, &fs_len, " float random = dot(sin(value), vec3(12.9898, 78.233, 37.719));");
append_line(fs_buf, &fs_len, " return fract(sin(random) * 143758.5453);");
append_line(fs_buf, &fs_len, "}");
if (current_filter_mode == FILTER_THREE_POINT) {
#if __APPLE__
@@ -411,6 +414,10 @@ static struct ShaderProgram* gfx_opengl_create_and_load_new_shader(uint64_t shad
append_line(fs_buf, &fs_len, "void main() {");
// Reference approach to color wrapping as per GLideN64
// Return wrapped value of x in interval [low, high)
append_line(fs_buf, &fs_len, "#define WRAP(x, low, high) mod((x)-(low), (high)-(low)) + (low)");
for (int i = 0; i < 2; i++) {
if (cc_features.used_textures[i]) {
bool s = cc_features.clamp[i][0], t = cc_features.clamp[i][1];
@@ -445,7 +452,14 @@ static struct ShaderProgram* gfx_opengl_create_and_load_new_shader(uint64_t shad
append_formula(fs_buf, &fs_len, cc_features.c[c], cc_features.do_single[c][0], cc_features.do_multiply[c][0], cc_features.do_mix[c][0], cc_features.opt_alpha, false, cc_features.opt_alpha);
}
append_line(fs_buf, &fs_len, ";");
if (c == 0) {
append_str(fs_buf, &fs_len, "texel = WRAP(texel, -1.01, 1.01);");
}
}
append_str(fs_buf, &fs_len, "texel = WRAP(texel, -0.51, 1.51);");
append_str(fs_buf, &fs_len, "texel = clamp(texel, 0.0, 1.0);");
// TODO discard if alpha is 0?
if (cc_features.opt_fog)
{
@@ -604,13 +618,8 @@ static struct ShaderProgram* gfx_opengl_create_and_load_new_shader(uint64_t shad
glUniform1i(sampler_location, 1);
}
if (cc_features.opt_alpha && cc_features.opt_noise) {
prg->frame_count_location = glGetUniformLocation(shader_program, "frame_count");
prg->noise_scale_location = glGetUniformLocation(shader_program, "noise_scale");
prg->used_noise = true;
} else {
prg->used_noise = false;
}
prg->frame_count_location = glGetUniformLocation(shader_program, "frame_count");
prg->noise_scale_location = glGetUniformLocation(shader_program, "noise_scale");
return prg;
}
@@ -413,6 +413,9 @@ static void gfx_generate_cc(struct ColorCombiner *comb, uint64_t cc_id) {
val = SHADER_TEXEL1A;
used_textures[1] = true;
break;
case G_CCMUX_NOISE:
val = SHADER_NOISE;
break;
case G_CCMUX_PRIMITIVE:
case G_CCMUX_PRIMITIVE_ALPHA:
case G_CCMUX_PRIM_LOD_FRAC:
+1 -1
View File
@@ -480,7 +480,7 @@ namespace Ship {
WmApi = &gfx_dxgi_api;
#endif
#ifdef ENABLE_DX11
RenderingApi = &gfx_direct3d11_api;
RenderingApi = &gfx_direct3d11_api;
WmApi = &gfx_dxgi_api;
#endif
#ifdef __WIIU__
+8 -5
View File
@@ -95,6 +95,8 @@ set(PROJECT_NAME soh)
################################################################################
# Source groups
################################################################################
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/src/boot/build.c.in ${CMAKE_BINARY_DIR}/build.c @ONLY)
set(Header_Files
"resource.h"
)
@@ -395,7 +397,7 @@ endif()
set(Source_Files__src__boot
"src/boot/assert.c"
"src/boot/boot_main.c"
"src/boot/build.c"
"${CMAKE_BINARY_DIR}/build.c"
"src/boot/idle.c"
"src/boot/is_debug.c"
"src/boot/logutils.c"
@@ -1951,7 +1953,7 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
TARGET ${PROJECT_NAME}
PRE_BUILD
COMMANDS
COMMAND $<CONFIG:Debug> copy /b $<SHELL_PATH:${CMAKE_CURRENT_SOURCE_DIR}/>src\\boot\\build.c +,,
COMMAND $<CONFIG:Debug> copy /b $<SHELL_PATH:${CMAKE_BINARY_DIR}/>build.c +,,
)
endif()
################################################################################
@@ -2039,6 +2041,7 @@ find_program(CURL NAMES curl DOC "Path to the curl program. Used to download fi
execute_process(COMMAND ${CURL} -sSfL https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt -o ${CMAKE_BINARY_DIR}/gamecontrollerdb.txt OUTPUT_VARIABLE RESULT)
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/macosx/Info.plist.in ${CMAKE_BINARY_DIR}/macosx/Info.plist @ONLY)
INSTALL(FILES ${CMAKE_BINARY_DIR}/gamecontrollerdb.txt DESTINATION ../MacOS COMPONENT ship)
elseif(NOT "${CMAKE_SYSTEM_NAME}" MATCHES "NintendoSwitch|CafeOS")
INSTALL(FILES ${CMAKE_BINARY_DIR}/gamecontrollerdb.txt DESTINATION . COMPONENT ship)
@@ -2057,8 +2060,8 @@ if(CMAKE_SYSTEM_NAME MATCHES "NintendoSwitch")
nx_generate_nacp(Ship.nacp
NAME "Ship of Harkinian"
AUTHOR "Harbour Masters"
VERSION "4.0.0"
AUTHOR "${PROJECT_TEAM}"
VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}"
)
nx_create_nro(soh
@@ -2075,7 +2078,7 @@ wut_create_rpx(${PROJECT_NAME})
wut_create_wuhb(${PROJECT_NAME}
NAME "Ship of Harkinian"
SHORTNAME "SoH"
AUTHOR "Harbour Masters"
AUTHOR "${PROJECT_TEAM}"
ICON ${CMAKE_CURRENT_SOURCE_DIR}/icon.jpg
)
@@ -1,4 +1,5 @@
<Root>
<ExternalFile XmlPath="objects/object_mori_tex.xml" OutPath="objects/object_mori_tex/"/>
<File Name="object_mori_hineri1" Segment="6">
<DList Name="object_mori_hineri1_DL_0024E0" Offset="0x24E0"/>
<Collision Name="object_mori_hineri1_Col_0054B8" Offset="0x54B8"/>
@@ -1,4 +1,5 @@
<Root>
<ExternalFile XmlPath="objects/object_mori_tex.xml" OutPath="objects/object_mori_tex/"/>
<File Name="object_mori_hineri1a" Segment="6">
<DList Name="object_mori_hineri1a_DL_001980" Offset="0x1980"/>
<Collision Name="object_mori_hineri1a_Col_003490" Offset="0x3490"/>
@@ -1,4 +1,5 @@
<Root>
<ExternalFile XmlPath="objects/object_mori_tex.xml" OutPath="objects/object_mori_tex/"/>
<File Name="object_mori_hineri2" Segment="6">
<DList Name="object_mori_hineri2_DL_0020F0" Offset="0x20F0"/>
<Collision Name="object_mori_hineri2_Col_0043D0" Offset="0x43D0"/>
@@ -1,4 +1,5 @@
<Root>
<ExternalFile XmlPath="objects/object_mori_tex.xml" OutPath="objects/object_mori_tex/"/>
<File Name="object_mori_hineri2a" Segment="6">
<DList Name="object_mori_hineri2a_DL_002B70" Offset="0x2B70"/>
<Collision Name="object_mori_hineri2a_Col_006078" Offset="0x6078"/>
@@ -1,4 +1,5 @@
<Root>
<ExternalFile XmlPath="objects/object_mori_tex.xml" OutPath="objects/object_mori_tex/"/>
<File Name="object_mori_objects" Segment="6">
<Texture Name="gMoriHashiraTLUT" OutName="hashira_tlut" Format="rgba16" Width="112" Height="1" Offset="0x0000"/>
<Texture Name="gMoriHashiraTex" OutName="hashira" Format="ci8" Width="32" Height="32" Offset="0x00E0" TlutOffset="0x0000"/>
@@ -1,5 +1,30 @@
<Root>
<File Name="object_mori_tex" Segment="6">
<Blob Name="object_moriTex_Blob_000000" Size="0x9E00" Offset="0x0"/>
<File Name="object_mori_tex" Segment="8">
<Texture Name="gMoriElevatorBarTex" OutName="elevator_bar" Format="rgba16" Height="16" Width="64" Offset="0x0"/>
<Texture Name="gMoriElevatorTopTex" OutName="elevator_top" Format="rgba16" Height="32" Width="32" Offset="0x800"/>
<Texture Name="gMoriElevatorSideTex" OutName="elevator_side" Format="rgba16" Height="16" Width="16" Offset="0x1000"/>
<Texture Name="gMorieStoneWallTex" OutName="stone_wall" Format="rgba16" Height="32" Width="32" Offset="0x1200"/>
<Texture Name="gMoriKaitenkabeMetalWallTex" OutName="metal_wall" Format="rgba16" Height="32" Width="32" Offset="0x1A00"/>
<Texture Name="gMoriRakkatenjoCheckerboardTex" OutName="checkerboard" Format="rgba16" Height="32" Width="64" Offset="0x2200"/>
<Texture Name="gMoriStalfosPlatformSideTex" OutName="stalfos_platform_side" Format="rgba16" Height="32" Width="64" Offset="0x3200"/>
<Texture Name="gMoriStalfosPlatformTopTex" OutName="stalfos_platform_top" Format="rgba16" Height="32" Width="32" Offset="0x4200"/>
<Texture Name="gMoriHashiraPlatformsTex" OutName="hashira_platform" Format="rgba16" Height="32" Width="32" Offset="0x4A00"/>
<!-- This is just a guess since its unused -->
<Texture Name="gMoriWaterTex" OutName="water_tex" Format="rgba16" Height="8" Width="32" Offset="0x5200"/>
<Texture Name="gMoriHashigoLadderTex" OutName="ladder" Format="rgba16" Height="32" Width="32" Offset="0x5400"/>
<Texture Name="gForestTwistedHallwayPillarTex" OutName="twisted_hall_pillar" Format="rgba16" Height="64" Width="16" Offset="0x5C00"/>
<Texture Name="gForestTwistedHallwayWallAndFloorTex" OutName="twisted_hall_wall_and_floor" Format="rgba16" Width="32" Height="32" Offset="0x6400"/>
<Texture Name="gForestTwistedHallwayWallDesignTex" OutName="twisted_hall_design" Format="rgba16" Width="64" Height="32" Offset="0x6C00"/>
<Texture Name="gForestTwistedHallCarpetTex" OutName="twisted_hall_carpet" Format="rgba16" Width="16" Height="16" Offset="0x7C00"/>
<Texture Name="gForestTwistedHallLadderTex" OutName="twisted_hall_ladder" Format="rgba16" Height="32" Width="32" Offset="0x7E00"/>
<Texture Name="gForestTwistedHallBrickTex" OutName="twisted_hall_brick" Format="rgba16" Width="32" Height="32" Offset="0x8600"/>
<Texture Name="gMoriHashiraGateTex" OutName="hashira_gate" Format="rgba16" Width="32" Height="64" Offset="0x8E00"/>
</File>
</Root>
+2
View File
@@ -5,6 +5,7 @@
#include "z64animation.h"
#include "z64math.h"
#include "z64collision_check.h"
#include "soh/Enhancements/item-tables/ItemTableTypes.h"
#define ACTOR_NUMBER_MAX 2000
#define INVISIBLE_ACTOR_MAX 20
@@ -291,6 +292,7 @@ typedef struct EnItem00 {
/* 0x15C */ f32 scale;
/* 0x160 */ ColliderCylinder collider;
s16 ogParams;
GetItemEntry randoGiEntry;
} EnItem00; // size = 0x1AC
// Only A_OBJ_SIGNPOST_OBLONG and A_OBJ_SIGNPOST_ARROW are used in room files.
+1 -2
View File
@@ -38,8 +38,7 @@ typedef struct {
} CsCmdBase; // size = 0x6
typedef struct {
/* 0x00 */ u8 unk_00;
/* 0x01 */ u8 setting;
/* 0x00 */ u16 setting;
/* 0x02 */ u16 startFrame;
/* 0x04 */ u16 endFrame;
} CsCmdEnvLighting; // size = 0x6
@@ -9,7 +9,7 @@
<key>CFBundleExecutable</key>
<string>soh</string>
<key>CFBundleGetInfoString</key>
<string>4.0.1</string>
<string>@CMAKE_PROJECT_VERSION@</string>
<key>CFBundleIconFile</key>
<string>soh.icns</string>
<key>CFBundleIdentifier</key>
@@ -22,11 +22,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>4.0.1</string>
<string>@CMAKE_PROJECT_VERSION@</string>
<key>CFBundleSignature</key>
<string>ZOoT</string>
<key>CFBundleVersion</key>
<string>4.0.1</string>
<string>@CMAKE_PROJECT_VERSION@</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright 2022 HarbourMasters.</string>
<key>LSMinimumSystemVersion</key>
+1 -1
View File
@@ -24,7 +24,7 @@ void BootCommands_Init()
{
CVar_RegisterS32("gDebugEnabled", 0);
CVar_RegisterS32("gLanguages", 0); //0 = English / 1 = German / 2 = French
CVar_RegisterS32("gHudColors", 1); //0 = N64 / 1 = NGC / 2 = Custom
CVar_RegisterS32("gHudColors", 0); //0 = N64 / 1 = NGC / 2 = Custom
CVar_RegisterS32("gInvertYAxis", 1);
CVar_RegisterS32("gTrailDuration", 4); // 4 = Default trail duration
if (ResourceMgr_IsGameMasterQuest()) {
@@ -472,7 +472,7 @@ void Draw_ItemsSkills(){
ResetTrailLength("gTrailDuration", 4);
UIWidgets::EnhancementCheckbox("Swords use separate colors", "gSeperateSwords");
if (CVar_GetS32("gSeperateSwords", 0) && ImGui::CollapsingHeader("Individual Sword Colors")) {
if (ImGui::BeginTable("tabletrailswords", 2, FlagsTable)) {
if (ImGui::BeginTable("tabletrailswords", 5, FlagsTable)) {
ImGui::TableSetupColumn("Kokiri Sword", FlagsCell, TablesCellsWidth / 2);
ImGui::TableSetupColumn("Master Sword", FlagsCell, TablesCellsWidth / 2);
ImGui::TableSetupColumn("Biggoron Sword", FlagsCell, TablesCellsWidth / 2);
@@ -73,8 +73,8 @@ static CosmeticsColorIndividual Navi_Npc_Inner = { "Navi NPC (Primary)", "Inner
static CosmeticsColorIndividual Navi_Npc_Outer = { "Navi NPC (Secondary)", "Outer color for Navi (when Navi fly around NPCs)", "gNavi_NPC_Outer", navi_npc_o_col, ImVec4(150, 150, 255, 255), false, false, false };
static CosmeticsColorIndividual Navi_Enemy_Inner = { "Navi Enemy (Primary)", "Inner color for Navi (when Navi fly around Enemies or Bosses)", "gNavi_Enemy_Inner", navi_enemy_i_col, ImVec4(255, 255, 0, 255), false, false, false };
static CosmeticsColorIndividual Navi_Enemy_Outer = { "Navi Enemy (Secondary)", "Outer color for Navi (when Navi fly around Enemies or Bosses)", "gNavi_Enemy_Outer", navi_enemy_o_col, ImVec4(220, 155, 0, 255), false, false, false };
static CosmeticsColorIndividual Navi_Prop_Inner = { "Navi Enemy (Primary)", "Inner color for Navi (when Navi fly around props (signs etc))", "gNavi_Prop_Inner", navi_prop_i_col, ImVec4(0, 255, 0, 255), false, false, false };
static CosmeticsColorIndividual Navi_Prop_Outer = { "Navi Enemy (Secondary)", "Outer color for Navi (when Navi fly around props (signs etc))", "gNavi_Prop_Outer", navi_prop_o_col, ImVec4(0, 255, 0, 255), false, false, false };
static CosmeticsColorIndividual Navi_Prop_Inner = { "Navi Props (Primary)", "Inner color for Navi (when Navi fly around props (signs etc))", "gNavi_Prop_Inner", navi_prop_i_col, ImVec4(0, 255, 0, 255), false, false, false };
static CosmeticsColorIndividual Navi_Prop_Outer = { "Navi Props (Secondary)", "Outer color for Navi (when Navi fly around props (signs etc))", "gNavi_Prop_Outer", navi_prop_o_col, ImVec4(0, 255, 0, 255), false, false, false };
//Keese
static CosmeticsColorIndividual Keese1_prim = { "Fire Primary color", "Affects the primary color of the Fire itself of the Keese", "gKeese1_Ef_Prim", Keese1_primcol, ImVec4(255, 255, 100, 255), true, false, false };
@@ -241,7 +241,7 @@ const std::vector<FlagTable> flagTables = {
{ 0xB7, "Spoke to Fado in Kokiri Forest as Child" },
{ 0xB8, "Spoke to Malon After Saving Ranch" },
{ 0xB9, "Spoke to Malon on Horseback" },
{ 0xBC, "Spoke to Carpenter Boss by Tent" },
{ 0xBC, "Fado requested Odd Potion" },
{ 0xC0, "Spoke to Fat Woman by Market Potion Shop" },
{ 0xC1, "Spoke to Fat Woman After Zelda's Escape" },
{ 0xC2, "Spoke to Burly Man About Talon Search" },
@@ -1040,7 +1040,7 @@ typedef struct ScrubIdentity {
RandomizerCheck randomizerCheck;
GetItemID getItemId;
int32_t itemPrice;
bool isShuffled;
uint8_t isShuffled;
} ScrubIdentity;
typedef struct ShopItemIdentity {
+11 -17
View File
@@ -298,6 +298,8 @@ namespace GameMenuBar {
CVar_SetS32("gCrouchStabHammerFix", 0);
// Fix all crouch stab
CVar_SetS32("gCrouchStabFix", 0);
// Fix Gerudo Warrior's clothing colors
CVar_SetS32("gGerudoWarriorClothingFix", 0);
// Red Ganon blood
CVar_SetS32("gRedGanonBlood", 0);
@@ -1078,6 +1080,8 @@ namespace GameMenuBar {
UIWidgets::PaddedEnhancementCheckbox("Remove power crouch stab", "gCrouchStabFix", true, false);
UIWidgets::Tooltip("Make crouch stabbing always do the same damage as a regular slash");
}
UIWidgets::PaddedEnhancementCheckbox("Fix Gerudo Warrior's clothing colors", "gGerudoWarriorClothingFix", true, false);
UIWidgets::Tooltip("Prevent the Gerudo Warrior's clothes changing color when changing Link's tunic or using bombs in front of her");
ImGui::EndMenu();
}
@@ -1112,12 +1116,7 @@ namespace GameMenuBar {
ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(0, 0));
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 1.0f);
ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0.22f, 0.38f, 0.56f, 1.0f));
#ifdef __WIIU__
static ImVec2 buttonSize(200.0f * 2.0f, 0.0f);
#else
static ImVec2 buttonSize(200.0f, 0.0f);
#endif
if (ImGui::Button(GetWindowButtonText("Cosmetics Editor", CVar_GetS32("gCosmeticsEditorEnabled", 0)).c_str(), buttonSize))
if (ImGui::Button(GetWindowButtonText("Cosmetics Editor", CVar_GetS32("gCosmeticsEditorEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f)))
{
bool currentValue = CVar_GetS32("gCosmeticsEditorEnabled", 0);
CVar_SetS32("gCosmeticsEditorEnabled", !currentValue);
@@ -1246,7 +1245,7 @@ namespace GameMenuBar {
UIWidgets::Tooltip("The Kokiri are mystical beings that fade into view when approached\nEnabling this will remove their draw distance");
}
UIWidgets::PaddedEnhancementCheckbox("Skip Text", "gSkipText", true, false);
UIWidgets::Tooltip("Holding down B skips text\nKnown to cause a cutscene softlock in Water Temple\nSoftlock can be fixed by pressing D-Right in Debug mode");
UIWidgets::Tooltip("Holding down B skips text");
UIWidgets::PaddedEnhancementCheckbox("Free Camera", "gFreeCamera", true, false);
UIWidgets::Tooltip("Enables camera control\nNote: You must remap C buttons off of the right stick in the controller config menu, and map the camera stick to the right stick.");
@@ -1408,12 +1407,7 @@ namespace GameMenuBar {
ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(0,0));
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 1.0f);
ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0.22f, 0.38f, 0.56f, 1.0f));
#ifdef __WIIU__
static ImVec2 buttonSize(160.0f * 2.0f, 0.0f);
#else
static ImVec2 buttonSize(160.0f, 0.0f);
#endif
if (ImGui::Button(GetWindowButtonText("Stats", CVar_GetS32("gStatsEnabled", 0)).c_str(), buttonSize))
if (ImGui::Button(GetWindowButtonText("Stats", CVar_GetS32("gStatsEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f)))
{
bool currentValue = CVar_GetS32("gStatsEnabled", 0);
CVar_SetS32("gStatsEnabled", !currentValue);
@@ -1422,7 +1416,7 @@ namespace GameMenuBar {
}
UIWidgets::Tooltip("Shows the stats window, with your FPS and frametimes, and the OS you're playing on");
UIWidgets::Spacer(0);
if (ImGui::Button(GetWindowButtonText("Console", CVar_GetS32("gConsoleEnabled", 0)).c_str(), buttonSize))
if (ImGui::Button(GetWindowButtonText("Console", CVar_GetS32("gConsoleEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f)))
{
bool currentValue = CVar_GetS32("gConsoleEnabled", 0);
CVar_SetS32("gConsoleEnabled", !currentValue);
@@ -1431,7 +1425,7 @@ namespace GameMenuBar {
}
UIWidgets::Tooltip("Enables the console window, allowing you to input commands, type help for some examples");
UIWidgets::Spacer(0);
if (ImGui::Button(GetWindowButtonText("Save Editor", CVar_GetS32("gSaveEditorEnabled", 0)).c_str(), buttonSize))
if (ImGui::Button(GetWindowButtonText("Save Editor", CVar_GetS32("gSaveEditorEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f)))
{
bool currentValue = CVar_GetS32("gSaveEditorEnabled", 0);
CVar_SetS32("gSaveEditorEnabled", !currentValue);
@@ -1439,7 +1433,7 @@ namespace GameMenuBar {
SohImGui::EnableWindow("Save Editor", CVar_GetS32("gSaveEditorEnabled", 0));
}
UIWidgets::Spacer(0);
if (ImGui::Button(GetWindowButtonText("Collision Viewer", CVar_GetS32("gCollisionViewerEnabled", 0)).c_str(), buttonSize))
if (ImGui::Button(GetWindowButtonText("Collision Viewer", CVar_GetS32("gCollisionViewerEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f)))
{
bool currentValue = CVar_GetS32("gCollisionViewerEnabled", 0);
CVar_SetS32("gCollisionViewerEnabled", !currentValue);
@@ -1447,7 +1441,7 @@ namespace GameMenuBar {
SohImGui::EnableWindow("Collision Viewer", CVar_GetS32("gCollisionViewerEnabled", 0));
}
UIWidgets::Spacer(0);
if (ImGui::Button(GetWindowButtonText("Actor Viewer", CVar_GetS32("gActorViewerEnabled", 0)).c_str(), buttonSize))
if (ImGui::Button(GetWindowButtonText("Actor Viewer", CVar_GetS32("gActorViewerEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f)))
{
bool currentValue = CVar_GetS32("gActorViewerEnabled", 0);
CVar_SetS32("gActorViewerEnabled", !currentValue);
+1
View File
@@ -99,6 +99,7 @@ void SaveManager::LoadRandomizerVersion1() {
std::shared_ptr<Randomizer> randomizer = OTRGlobals::Instance->gRandomizer;
randomizer->LoadRandomizerSettings("");
size_t merchantPricesSize = 0;
if (randomizer->GetRandoSettingValue(RSK_SHUFFLE_SCRUBS) > 0) {
merchantPricesSize += NUM_SCRUBS;
-4
View File
@@ -1,4 +0,0 @@
const char gBuildVersion[] = "ZHORA BRAVO (4.0.1)";
const char gBuildTeam[] = "github.com/harbourmasters";
const char gBuildDate[] = __DATE__ " " __TIME__;
const char gBuildMakeOption[] = "";
+5
View File
@@ -0,0 +1,5 @@
const char gBuildVersion[] = "@PROJECT_BUILD_NAME@ (@CMAKE_PROJECT_VERSION_MAJOR@.@CMAKE_PROJECT_VERSION_MINOR@.@CMAKE_PROJECT_VERSION_PATCH@)";
const char gBuildTeam[] = "@PROJECT_TEAM@";
const char gBuildDate[] = __DATE__ " " __TIME__;
const char gBuildMakeOption[] = "";
+1 -1
View File
@@ -370,7 +370,7 @@ void GameState_Update(GameState* gameState) {
}
// Bombchus (max: 50, no upgrades)
if (AMMO(ITEM_BOMBCHU) < 50) {
if (INV_CONTENT(ITEM_BOMBCHU) == ITEM_BOMBCHU && AMMO(ITEM_BOMBCHU) < 50) {
AMMO(ITEM_BOMBCHU) = 50;
}
}
+17 -9
View File
@@ -335,8 +335,10 @@ void func_8002BE98(TargetContext* targetCtx, s32 actorCategory, GlobalContext* g
void func_8002BF60(TargetContext* targetCtx, Actor* actor, s32 actorCategory, GlobalContext* globalCtx) {
NaviColor* naviColor = &sNaviColorList[actorCategory];
Color_RGB8 customInnerNaviColor;
Color_RGB8 customOuterNaviColor;
if (CVar_GetS32("gUseNaviCol",0) != 1 ) {
if (!CVar_GetS32("gUseNaviCol",0)) {
if (actorCategory == ACTORCAT_PLAYER) {
naviColor->inner.r = 255; naviColor->inner.g = 255; naviColor->inner.b = 255;
naviColor->outer.r = 0; naviColor->outer.g = 0; naviColor->outer.b = 255;
@@ -355,21 +357,27 @@ void func_8002BF60(TargetContext* targetCtx, Actor* actor, s32 actorCategory, Gl
}
} else {
if (actorCategory == ACTORCAT_PLAYER) {
naviColor->inner = CVar_GetRGBA("gNavi_Idle_Inner", naviColor->inner);
naviColor->outer = CVar_GetRGBA("gNavi_Idle_Outer", naviColor->outer);
customInnerNaviColor = CVar_GetRGB("gNavi_Idle_Inner", (Color_RGB8){ 0, 0, 0 });
customOuterNaviColor = CVar_GetRGB("gNavi_Idle_Outer", (Color_RGB8){ 0, 0, 0 });
}
if (actorCategory == ACTORCAT_NPC) {
naviColor->inner = CVar_GetRGBA("gNavi_NPC_Inner", naviColor->inner);
naviColor->outer = CVar_GetRGBA("gNavi_NPC_Outer", naviColor->outer);
customInnerNaviColor = CVar_GetRGB("gNavi_NPC_Inner", (Color_RGB8){ 0, 0, 0 });
customOuterNaviColor = CVar_GetRGB("gNavi_NPC_Outer", (Color_RGB8){ 0, 0, 0 });
}
if (actorCategory == ACTORCAT_BOSS || actorCategory == ACTORCAT_ENEMY) {
naviColor->inner = CVar_GetRGBA("gNavi_Enemy_Inner", naviColor->inner);
naviColor->outer = CVar_GetRGBA("gNavi_Enemy_Outer", naviColor->outer);
customInnerNaviColor = CVar_GetRGB("gNavi_Enemy_Inner", (Color_RGB8){ 0, 0, 0 });
customOuterNaviColor = CVar_GetRGB("gNavi_Enemy_Outer", (Color_RGB8){ 0, 0, 0 });
}
if (actorCategory == ACTORCAT_PROP) {
naviColor->inner = CVar_GetRGBA("gNavi_Prop_Inner", naviColor->inner);
naviColor->outer = CVar_GetRGBA("gNavi_Prop_Outer", naviColor->outer);
customInnerNaviColor = CVar_GetRGB("gNavi_Prop_Inner", (Color_RGB8){ 0, 0, 0 });
customOuterNaviColor = CVar_GetRGB("gNavi_Prop_Outer", (Color_RGB8){ 0, 0, 0 });
}
naviColor->inner.r = customInnerNaviColor.r;
naviColor->inner.g = customInnerNaviColor.g;
naviColor->inner.b = customInnerNaviColor.b;
naviColor->outer.r = customOuterNaviColor.r;
naviColor->outer.g = customOuterNaviColor.g;
naviColor->outer.b = customOuterNaviColor.b;
}
targetCtx->naviRefPos.x = actor->focus.pos.x;
+19 -23
View File
@@ -336,7 +336,7 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
f32 yOffset = 980.0f;
f32 shadowScale = 6.0f;
s32 getItemId = GI_NONE;
GetItemEntry getItem = (GetItemEntry)GET_ITEM_NONE;
this->randoGiEntry = (GetItemEntry)GET_ITEM_NONE;
s16 spawnParam8000 = this->actor.params & 0x8000;
s32 pad1;
@@ -431,6 +431,14 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.shape.shadowAlpha = 180;
this->actor.focus.pos = this->actor.world.pos;
this->getItemId = GI_NONE;
RandomizerCheck randoCheck =
Randomizer_GetCheckFromActor(this->actor.id, globalCtx->sceneNum, this->ogParams);
if (gSaveContext.n64ddFlag && randoCheck != RC_UNKNOWN_CHECK) {
this->randoGiEntry =
Randomizer_GetItemFromKnownCheck(randoCheck, getItemId);
this->randoGiEntry.getItemFrom = ITEM_FROM_FREESTANDING;
}
if (!spawnParam8000) {
EnItem00_SetupAction(this, func_8001DFC8);
@@ -516,12 +524,10 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
if (!Actor_HasParent(&this->actor, globalCtx)) {
if (getItemId != GI_NONE) {
if (!gSaveContext.n64ddFlag) {
if (!gSaveContext.n64ddFlag || this->randoGiEntry.getItemId == GI_NONE) {
func_8002F554(&this->actor, globalCtx, getItemId);
} else {
getItem = Randomizer_GetItemFromActor(this->actor.id, globalCtx->sceneNum, this->ogParams, getItemId);
getItem.getItemFrom = ITEM_FROM_FREESTANDING;
GiveItemEntryFromActorWithFixedRange(&this->actor, globalCtx, getItem);
GiveItemEntryFromActorWithFixedRange(&this->actor, globalCtx, this->randoGiEntry);
}
}
}
@@ -686,10 +692,7 @@ void func_8001E5C8(EnItem00* this, GlobalContext* globalCtx) {
if (!gSaveContext.n64ddFlag) {
func_8002F434(&this->actor, globalCtx, this->getItemId, 50.0f, 80.0f);
} else {
GetItemEntry getItemEntry =
Randomizer_GetItemFromActor(this->actor.id, globalCtx->sceneNum, this->ogParams, this->getItemId);
getItemEntry.getItemFrom = ITEM_FROM_FREESTANDING;
GiveItemEntryFromActor(&this->actor, globalCtx, getItemEntry, 50.0f, 80.0f);
GiveItemEntryFromActor(&this->actor, globalCtx, this->randoGiEntry, 50.0f, 80.0f);
}
this->unk_15A++;
} else {
@@ -724,7 +727,6 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) {
s16* params;
Actor* dynaActor;
s32 getItemId = GI_NONE;
GetItemEntry getItem = (GetItemEntry)GET_ITEM_NONE;
s16 sp3A = 0;
s16 i;
u32* temp;
@@ -910,13 +912,11 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) {
params = &this->actor.params;
if ((getItemId != GI_NONE) && !Actor_HasParent(&this->actor, globalCtx)) {
if (!gSaveContext.n64ddFlag) {
if (!gSaveContext.n64ddFlag || this->randoGiEntry.getItemId == GI_NONE) {
func_8002F554(&this->actor, globalCtx, getItemId);
} else {
getItem = Randomizer_GetItemFromActor(this->actor.id, globalCtx->sceneNum, this->ogParams, getItemId);
getItemId = getItem.getItemId;
getItem.getItemFrom = ITEM_FROM_FREESTANDING;
GiveItemEntryFromActorWithFixedRange(&this->actor, globalCtx, getItem);
getItemId = this->randoGiEntry.getItemId;
GiveItemEntryFromActorWithFixedRange(&this->actor, globalCtx, this->randoGiEntry);
}
}
@@ -1389,10 +1389,8 @@ void EnItem00_DrawCollectible(EnItem00* this, GlobalContext* globalCtx) {
if (gSaveContext.n64ddFlag && (this->getItemId != GI_NONE || this->actor.params == ITEM00_SMALL_KEY)) {
f32 mtxScale = 16.0f;
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY);
GetItemEntry randoGetItemEntry =
Randomizer_GetItemFromActor(this->actor.id, globalCtx->sceneNum, this->ogParams, this->getItemId);
EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemEntry);
GetItemEntry_Draw(globalCtx, randoGetItemEntry);
EnItem00_CustomItemsParticles(&this->actor, globalCtx, this->randoGiEntry);
GetItemEntry_Draw(globalCtx, this->randoGiEntry);
} else {
s32 texIndex = this->actor.params - 3;
@@ -1451,10 +1449,8 @@ void EnItem00_DrawHeartPiece(EnItem00* this, GlobalContext* globalCtx) {
if (gSaveContext.n64ddFlag) {
f32 mtxScale = 16.0f;
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY);
GetItemEntry randoGetItemEntry =
Randomizer_GetItemFromActor(this->actor.id, globalCtx->sceneNum, this->ogParams, GI_HEART_PIECE);
EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemEntry);
GetItemEntry_Draw(globalCtx, randoGetItemEntry);
EnItem00_CustomItemsParticles(&this->actor, globalCtx, this->randoGiEntry);
GetItemEntry_Draw(globalCtx, this->randoGiEntry);
} else {
s32 pad;
+15 -16
View File
@@ -949,15 +949,7 @@ void func_80083108(GlobalContext* globalCtx) {
gSaveContext.buttonStatus[0] = BTN_DISABLED;
for (i = 1; i < ARRAY_COUNT(gSaveContext.equips.buttonItems); i++) {
if ((gSaveContext.equips.buttonItems[i] >= ITEM_SHIELD_DEKU) &&
(gSaveContext.equips.buttonItems[i] <= ITEM_BOOTS_HOVER)) {
// Equipment on c-buttons is always enabled
if (gSaveContext.buttonStatus[BUTTON_STATUS_INDEX(i)] == BTN_DISABLED) {
sp28 = 1;
}
gSaveContext.buttonStatus[BUTTON_STATUS_INDEX(i)] = BTN_ENABLED;
} else if (func_8008F2F8(globalCtx) == 2) {
if (func_8008F2F8(globalCtx) == 2) {
if ((gSaveContext.equips.buttonItems[i] != ITEM_HOOKSHOT) &&
(gSaveContext.equips.buttonItems[i] != ITEM_LONGSHOT)) {
if (gSaveContext.buttonStatus[BUTTON_STATUS_INDEX(i)] == BTN_ENABLED) {
@@ -1100,6 +1092,18 @@ void func_80083108(GlobalContext* globalCtx) {
}
}
for (i = 1; i < ARRAY_COUNT(gSaveContext.equips.buttonItems); i++) {
if ((gSaveContext.equips.buttonItems[i] >= ITEM_SHIELD_DEKU) &&
(gSaveContext.equips.buttonItems[i] <= ITEM_BOOTS_HOVER)) {
// Equipment on c-buttons is always enabled
if (gSaveContext.buttonStatus[BUTTON_STATUS_INDEX(i)] == BTN_DISABLED) {
sp28 = 1;
}
gSaveContext.buttonStatus[BUTTON_STATUS_INDEX(i)] = BTN_ENABLED;
}
}
if (interfaceCtx->restrictions.bottles != 0) {
for (i = 1; i < ARRAY_COUNT(gSaveContext.equips.buttonItems); i++) {
if ((gSaveContext.equips.buttonItems[i] >= ITEM_BOTTLE) &&
@@ -1253,6 +1257,8 @@ void func_80083108(GlobalContext* globalCtx) {
(gSaveContext.equips.buttonItems[i] != ITEM_OCARINA_TIME) &&
!((gSaveContext.equips.buttonItems[i] >= ITEM_BOTTLE) &&
(gSaveContext.equips.buttonItems[i] <= ITEM_POE)) &&
!((gSaveContext.equips.buttonItems[i] >= ITEM_SHIELD_DEKU) && // Never disable equipment
(gSaveContext.equips.buttonItems[i] <= ITEM_BOOTS_HOVER)) && // (tunics/boots) on C-buttons
!((gSaveContext.equips.buttonItems[i] >= ITEM_WEIRD_EGG) &&
(gSaveContext.equips.buttonItems[i] <= ITEM_CLAIM_CHECK))) {
if ((globalCtx->sceneNum != SCENE_TAKARAYA) ||
@@ -2484,13 +2490,6 @@ u8 Item_CheckObtainability(u8 item) {
} else {
return ITEM_NONE;
}
} else if ( gSaveContext.n64ddFlag &&
((item >= RG_GERUDO_FORTRESS_SMALL_KEY) && (item <= RG_GANONS_CASTLE_SMALL_KEY) ||
(item >= RG_FOREST_TEMPLE_BOSS_KEY) && (item <= RG_GANONS_CASTLE_BOSS_KEY) ||
(item >= RG_DEKU_TREE_MAP) && (item <= RG_ICE_CAVERN_MAP) ||
(item >= RG_DEKU_TREE_COMPASS) && (item <= RG_ICE_CAVERN_COMPASS))
) {
return ITEM_NONE;
} else if ((item == ITEM_KEY_BOSS) || (item == ITEM_COMPASS) || (item == ITEM_DUNGEON_MAP)) {
return ITEM_NONE;
} else if (item == ITEM_KEY_SMALL) {
+1 -1
View File
@@ -2006,7 +2006,7 @@ s32 func_800C0DB4(GlobalContext* globalCtx, Vec3f* pos) {
}
void Gameplay_PerformSave(GlobalContext* globalCtx) {
if (globalCtx != NULL) {
if (globalCtx != NULL && gSaveContext.fileNum != 0xFF) {
Gameplay_SaveSceneFlags(globalCtx);
gSaveContext.savedSceneNum = globalCtx->sceneNum;
if (gSaveContext.temporaryWeapon) {
+16 -3
View File
@@ -1242,8 +1242,12 @@ void LinkAnimation_Change(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAn
if (ResourceMgr_OTRSigCheck(animation) != 0)
animation = ResourceMgr_LoadAnimByName(animation);
AnimationHeader* currentAnimation = (AnimationHeader*)skelAnime->animation;
if (ResourceMgr_OTRSigCheck(currentAnimation) != 0)
currentAnimation = ResourceMgr_LoadAnimByName(currentAnimation);
skelAnime->mode = mode;
if ((morphFrames != 0.0f) && ((animation != skelAnime->animation) || (startFrame != skelAnime->curFrame))) {
if ((morphFrames != 0.0f) && ((animation != currentAnimation) || (startFrame != skelAnime->curFrame))) {
if (morphFrames < 0) {
LinkAnimation_SetUpdateFunction(skelAnime);
SkelAnime_CopyFrameTable(skelAnime, skelAnime->morphTable, skelAnime->jointTable);
@@ -1687,8 +1691,17 @@ s32 SkelAnime_Once(SkelAnime* skelAnime) {
*/
void Animation_ChangeImpl(SkelAnime* skelAnime, AnimationHeader* animation, f32 playSpeed, f32 startFrame, f32 endFrame,
u8 mode, f32 morphFrames, s8 taper) {
LinkAnimationHeader* ogAnim = animation;
if (ResourceMgr_OTRSigCheck(animation) != 0)
animation = ResourceMgr_LoadAnimByName(animation);
AnimationHeader* currentAnimation = (AnimationHeader*)skelAnime->animation;
if (ResourceMgr_OTRSigCheck(currentAnimation) != 0)
currentAnimation = ResourceMgr_LoadAnimByName(currentAnimation);
skelAnime->mode = mode;
if ((morphFrames != 0.0f) && ((animation != skelAnime->animation) || (startFrame != skelAnime->curFrame))) {
if ((morphFrames != 0.0f) && ((animation != currentAnimation) || (startFrame != skelAnime->curFrame))) {
if (morphFrames < 0) {
SkelAnime_SetUpdate(skelAnime);
SkelAnime_CopyFrameTable(skelAnime, skelAnime->morphTable, skelAnime->jointTable);
@@ -1710,7 +1723,7 @@ void Animation_ChangeImpl(SkelAnime* skelAnime, AnimationHeader* animation, f32
skelAnime->morphWeight = 0.0f;
}
skelAnime->animation = animation;
skelAnime->animation = ogAnim;
skelAnime->startFrame = startFrame;
skelAnime->endFrame = endFrame;
skelAnime->animLength = Animation_GetLength(animation);
@@ -577,6 +577,14 @@ void func_808FD5F4(BossGanon2* this, GlobalContext* globalCtx) {
BossGanon2_SetObjectSegment(this, globalCtx, OBJECT_GANON_ANIME3, false);
func_8002DF54(globalCtx, &this->actor, 0x54);
this->unk_314 = 3;
// At this point, the actor has Ganon's skeleton but is still playing an animation for Ganondorf. This
// causes issues when trying to access the limb posotions as Ganon has more limbs than Ganondorf. When
// animating, data from past the end of the animation data is accessed. This is a hack solution so
// that we are at least playing an animation meant for Ganon. There is no visible change since Ganon is
// off-screen. There is actually 1 frame where he is visible, and in the vanilla game he is an
// explosion of limbs since half of them are in random positions from the junk data accessed.
Animation_PlayOnce(&this->skelAnime, &gGanonUncurlAndFlailAnim);
}
// fake, tricks the compiler into using stack the way we need it to
if (zero) {
@@ -172,7 +172,7 @@ void EnDns_Init(Actor* thisx, GlobalContext* globalCtx) {
s16 respawnData = gSaveContext.respawn[RESPAWN_MODE_RETURN].data & ((1 << 8) - 1);
this->scrubIdentity = Randomizer_IdentifyScrub(globalCtx->sceneNum, this->actor.params, respawnData);
if (Randomizer_GetSettingValue(RSK_SHUFFLE_SCRUBS) == 1 || Randomizer_GetSettingValue(RSK_SHUFFLE_SCRUBS) == 3 && this->scrubIdentity.itemPrice != -1) {
if ((Randomizer_GetSettingValue(RSK_SHUFFLE_SCRUBS) == 1 || Randomizer_GetSettingValue(RSK_SHUFFLE_SCRUBS) == 3) && this->scrubIdentity.itemPrice != -1) {
this->dnsItemEntry->itemPrice = this->scrubIdentity.itemPrice;
}
+22 -20
View File
@@ -249,28 +249,30 @@ s32 EnGe3_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList,
case GELDB_LIMB_HEAD:
rot->x += this->headRot.y;
// This is a hack to fix the color-changing clothes this Gerudo has on N64 versions
default:
OPEN_DISPS(globalCtx->state.gfxCtx);
switch (limbIndex) {
case GELDB_LIMB_NECK:
break;
case GELDB_LIMB_HEAD:
gDPPipeSync(POLY_OPA_DISP++);
gDPSetEnvColor(POLY_OPA_DISP++, 80, 60, 10, 255);
break;
case GELDB_LIMB_R_SWORD:
case GELDB_LIMB_L_SWORD:
gDPPipeSync(POLY_OPA_DISP++);
gDPSetEnvColor(POLY_OPA_DISP++, 140, 170, 230, 255);
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, 255);
break;
default:
gDPPipeSync(POLY_OPA_DISP++);
gDPSetEnvColor(POLY_OPA_DISP++, 140, 0, 0, 255);
break;
if (CVar_GetS32("gGerudoWarriorClothingFix", 0)) {
// This is a hack to fix the color-changing clothes this Gerudo has on N64 versions
OPEN_DISPS(globalCtx->state.gfxCtx);
switch (limbIndex) {
case GELDB_LIMB_NECK:
break;
case GELDB_LIMB_HEAD:
gDPPipeSync(POLY_OPA_DISP++);
gDPSetEnvColor(POLY_OPA_DISP++, 80, 60, 10, 255);
break;
case GELDB_LIMB_R_SWORD:
case GELDB_LIMB_L_SWORD:
gDPPipeSync(POLY_OPA_DISP++);
gDPSetEnvColor(POLY_OPA_DISP++, 140, 170, 230, 255);
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, 255);
break;
default:
gDPPipeSync(POLY_OPA_DISP++);
gDPSetEnvColor(POLY_OPA_DISP++, 140, 0, 0, 255);
break;
}
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
CLOSE_DISPS(globalCtx->state.gfxCtx);
break;
}
return false;
@@ -1348,6 +1348,11 @@ void EnGo2_RollingAnimation(EnGo2* this, GlobalContext* globalCtx) {
}
void EnGo2_WakeUp(EnGo2* this, GlobalContext* globalCtx) {
if (CVar_GetS32("gUnfixGoronSpin", 0)) {
// Trick SkelAnime into thinking the current animation is changing so that it morphs between the same position,
// making the goron do a spin
this->skelAnime.animation = NULL;
}
if (this->skelAnime.playSpeed == 0.0f) {
if ((this->actor.params & 0x1F) != GORON_DMT_BIGGORON) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOLON_WAKE_UP);
@@ -401,7 +401,7 @@ void func_80ABA9B8(EnNiwLady* this, GlobalContext* globalCtx) {
} else {
// TODO: get-item-rework Adult trade sequence
this->getItemEntry = Randomizer_GetItemFromKnownCheck(RC_KAK_ANJU_AS_ADULT, GI_POCKET_EGG);
GiveItemEntryFromActor(&this->actor, globalCtx, this->getItemEntry, 200.0f, 100.0f);
gSaveContext.itemGetInf[2] |= 0x1000;
}
this->actionFunc = func_80ABAC00;
@@ -431,7 +431,14 @@ void func_80ABAB08(EnNiwLady* this, GlobalContext* globalCtx) {
case 0:
Message_CloseTextbox(globalCtx);
this->actor.parent = NULL;
func_8002F434(&this->actor, globalCtx, GI_COJIRO, 200.0f, 100.0f);
if (!gSaveContext.n64ddFlag) {
func_8002F434(&this->actor, globalCtx, GI_COJIRO, 200.0f, 100.0f);
} else {
// TODO: get-item-rework Adult trade sequence
this->getItemEntry = Randomizer_GetItemFromKnownCheck(RC_KAK_TRADE_POCKET_CUCCO, GI_COJIRO);
Randomizer_ConsumeAdultTradeItem(globalCtx, ITEM_POCKET_CUCCO);
gSaveContext.itemGetInf[2] |= 0x4000;
}
this->actionFunc = func_80ABAC00;
break;
case 1:
@@ -455,18 +462,14 @@ void func_80ABAC00(EnNiwLady* this, GlobalContext* globalCtx) {
} else {
getItemId = this->getItemId;
if (LINK_IS_ADULT) {
getItemId = !(gSaveContext.itemGetInf[2] & 0x1000) ? GI_POCKET_EGG : GI_COJIRO;
if (gSaveContext.n64ddFlag) {
if (getItemId == GI_POCKET_EGG) {
// TODO: get-item-rework Adult trade sequence
this->getItemEntry = Randomizer_GetItemFromKnownCheck(RC_KAK_ANJU_AS_ADULT, GI_POCKET_EGG);
GiveItemEntryFromActor(&this->actor, globalCtx, this->getItemEntry, 200.0f, 100.0f);
} else {
this->getItemEntry = Randomizer_GetItemFromKnownCheck(RC_KAK_TRADE_POCKET_CUCCO, GI_COJIRO);
Randomizer_ConsumeAdultTradeItem(globalCtx, ITEM_POCKET_CUCCO);
GiveItemEntryFromActor(&this->actor, globalCtx, this->getItemEntry, 200.0f, 100.0f);
}
if (!gSaveContext.n64ddFlag) {
getItemId = !(gSaveContext.itemGetInf[2] & 0x1000) ? GI_POCKET_EGG : GI_COJIRO;
} else {
// TODO: get-item-rework Adult trade sequence
getItemId = this->getItemEntry.getItemId;
GiveItemEntryFromActor(&this->actor, globalCtx, this->getItemEntry, 200.0f, 100.0f);
// Skip setting item flags because that was done earlier
this->actionFunc = func_80ABA778;
}
}
if (this->getItemEntry.getItemId == GI_NONE) {
+17 -2
View File
@@ -634,13 +634,13 @@ s32 func_80AF383C(EnRu2* this, GlobalContext* globalCtx) {
void func_80AF3878(EnRu2* this, GlobalContext* globalCtx) {
if (func_80AF383C(this, globalCtx) && !Gameplay_InCsMode(globalCtx)) {
this->action = 16;
OnePointCutscene_Init(globalCtx, 3130, -99, &this->actor, MAIN_CAM);
this->subCamId = OnePointCutscene_Init(globalCtx, 3130, -99, &this->actor, MAIN_CAM);
}
}
void func_80AF38D0(EnRu2* this, GlobalContext* globalCtx) {
this->action = 16;
OnePointCutscene_Init(globalCtx, 3130, -99, &this->actor, MAIN_CAM);
this->subCamId = OnePointCutscene_Init(globalCtx, 3130, -99, &this->actor, MAIN_CAM);
}
void func_80AF390C(EnRu2* this, GlobalContext* globalCtx) {
@@ -703,6 +703,7 @@ void func_80AF3ADC(EnRu2* this, GlobalContext* globalCtx) {
void func_80AF3B74(EnRu2* this, GlobalContext* globalCtx) {
if (this->unk_2C0 > ((((u16)(kREG(3) + 0x28)) + ((u16)(kREG(2) + 0x96))) & 0xFFFF)) {
Actor_Kill(&this->actor);
OnePointCutscene_EndCutscene(globalCtx, this->subCamId);
}
}
@@ -789,6 +790,7 @@ void EnRu2_Init(Actor* thisx, GlobalContext* globalCtx) {
this->unk_2C2 = 0;
this->unk_2C3 = TEXT_STATE_DONE_FADING;
this->subCamId = 0;
}
void func_80AF3F14(EnRu2* this, GlobalContext* globalCtx) {
@@ -818,6 +820,19 @@ void func_80AF3F20(EnRu2* this, GlobalContext* globalCtx) {
void EnRu2_Draw(Actor* thisx, GlobalContext* globalCtx) {
EnRu2* this = (EnRu2*)thisx;
// FAST3D: This is a hack for the issue of both TEXEL0 and TEXEL1 using the same texture with different settings.
// Ruto's earring uses both TEXEL0 and TEXEL1 to render. The issue is that it never loads anything into TEXEL1, so
// it reuses whatever happens to be there, which is the water temple brick texture. It just so happens that the
// earring texture loads into the same place in tmem as the brick texture, so when it comes to rendering, TEXEL1
// uses the earring texture with diffrent clamp settings, and it displays without noticeable error. However, both
// texel samplers are not intended to be used for the same texture with different settings, so this misuse confuses
// our texture cache, and we load the wrong settings for the earrings texture. This patch is a hack that replaces
// TEXEL1 with TEXEL0, which is most likely the original intention, and all is well.
Gfx* gfx = ResourceMgr_LoadGfxByName(gAdultRutoHeadDL);
Gfx patch = gsDPSetCombineLERP(TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, ENVIRONMENT, 0, 0, 0, 0, COMBINED, TEXEL0, 0,
PRIM_LOD_FRAC, COMBINED);
gfx[0xA2] = patch;
if ((this->drawConfig < 0) || (this->drawConfig >= ARRAY_COUNT(sDrawFuncs)) ||
(sDrawFuncs[this->drawConfig] == 0)) {
// "Draw Mode is improper!"
@@ -27,6 +27,7 @@ typedef struct EnRu2 {
/* 0x02C3 */ u8 unk_2C3;
/* 0x02C4 */ f32 unk_2C4;
/* 0x02C8 */ ColliderCylinder collider;
/* 0x02C8 */ s16 subCamId;
} EnRu2; // size = 0x0314
#endif
@@ -36,7 +36,7 @@ const ActorInit Obj_Lift_InitVars = {
NULL,
};
static s16 sFallTimerDurations[] = { 0, 10, 20, 30, 40, 50, 60 };
static s16 sFallTimerDurations[] = { 0, 10, 20, 30, 40, 50, 60, 0 };
typedef struct {
/* 0x00 */ s16 x;
@@ -6246,23 +6246,27 @@ s32 func_8083E5A8(Player* this, GlobalContext* globalCtx) {
}
}
s32 drop = giEntry.objectId;
// Show the cutscene for picking up an item. In vanilla, this happens in bombchu bowling alley (because getting bombchus need to show the cutscene)
// and whenever the player doesn't have the item yet. In rando, we're overruling this because we need to keep showing the cutscene
// because those items can be randomized and thus it's important to keep showing the cutscene.
uint8_t showItemCutscene = globalCtx->sceneNum == SCENE_BOWLING || Item_CheckObtainability(giEntry.itemId) == ITEM_NONE || gSaveContext.n64ddFlag;
if (gSaveContext.n64ddFlag || (globalCtx->sceneNum == SCENE_BOWLING) ||
!(CVar_GetS32("gFastDrops", 0) &&
((drop == OBJECT_GI_BOMB_1) || (drop == OBJECT_GI_NUTS) || (drop == OBJECT_GI_STICK) ||
(drop == OBJECT_GI_SEED) || (drop == OBJECT_GI_MAGICPOT) || (drop == OBJECT_GI_ARROW))) &&
(Item_CheckObtainability(giEntry.itemId) == ITEM_NONE)) {
// Only skip cutscenes for drops when they're items/consumables from bushes/rocks/enemies.
uint8_t isDropToSkip = (interactedActor->id == ACTOR_EN_ITEM00 && interactedActor->params != 6 && interactedActor->params != 17) ||
interactedActor->id == ACTOR_EN_KAREBABA ||
interactedActor->id == ACTOR_EN_DEKUBABA;
if (gSaveContext.n64ddFlag &&
((interactedActor->id == ACTOR_EN_ITEM00 &&
(interactedActor->params != 6 && interactedActor->params != 17)) ||
(interactedActor->id == ACTOR_EN_KAREBABA || interactedActor->id == ACTOR_EN_DEKUBABA))) {
func_8083E4C4(globalCtx, this, &giEntry);
this->getItemId = GI_NONE;
this->getItemEntry = (GetItemEntry)GET_ITEM_NONE;
return 0;
}
// Skip cutscenes from picking up consumables with "Fast Pickup Text" enabled, even when the player never picked it up before.
// But only for bushes/rocks/enemies because otherwise it can lead to softlocks in deku mask theatre and potentially other places.
uint8_t skipItemCutscene = CVar_GetS32("gFastDrops", 0) && isDropToSkip;
// Same as above but for rando. Rando is different because we want to enable cutscenes for items that the player already has because
// those items could be a randomized item coming from scrubs, freestanding PoH's and keys. So we need to once again overrule
// this specifically for items coming from bushes/rocks/enemies when the player has already picked that item up.
uint8_t skipItemCutsceneRando = gSaveContext.n64ddFlag && Item_CheckObtainability(giEntry.itemId) != ITEM_NONE && isDropToSkip;
// Show cutscene when picking up a item.
if (showItemCutscene && !skipItemCutscene && !skipItemCutsceneRando) {
func_808323B4(globalCtx, this);
func_8083AE40(this, giEntry.objectId);
@@ -6278,6 +6282,7 @@ s32 func_8083E5A8(Player* this, GlobalContext* globalCtx) {
return 1;
}
// Don't show cutscene when picking up an item.
func_8083E4C4(globalCtx, this, &giEntry);
this->getItemId = GI_NONE;
this->getItemEntry = (GetItemEntry)GET_ITEM_NONE;
@@ -10967,11 +10972,14 @@ void Player_DrawGameplay(GlobalContext* globalCtx, Player* this, s32 lod, Gfx* c
this);
if ((overrideLimbDraw == func_80090014) && (this->currentMask != PLAYER_MASK_NONE)) {
// Fixes a bug in vanilla where ice traps are rendered extremely large while wearing a bunny hood
if (CVar_GetS32("gFixIceTrapWithBunnyHood", 1)) Matrix_Push();
Mtx* sp70 = Graph_Alloc(globalCtx->state.gfxCtx, 2 * sizeof(Mtx));
if (this->currentMask == PLAYER_MASK_BUNNY) {
Vec3s sp68;
FrameInterpolation_RecordActorPosRotMatrix();
gSPSegment(POLY_OPA_DISP++, 0x0B, sp70);
sp68.x = D_80858AC8.unk_02 + 0x3E2;
@@ -10988,6 +10996,7 @@ void Player_DrawGameplay(GlobalContext* globalCtx, Player* this, s32 lod, Gfx* c
}
gSPDisplayList(POLY_OPA_DISP++, sMaskDlists[this->currentMask - 1]);
if (CVar_GetS32("gFixIceTrapWithBunnyHood", 1)) Matrix_Pop();
}
if ((this->currentBoots == PLAYER_BOOTS_HOVER) && !(this->actor.bgCheckFlags & 1) &&
@@ -11176,7 +11185,7 @@ s16 func_8084ABD8(GlobalContext* globalCtx, Player* this, s32 arg2, s16 arg3) {
if (!func_8002DD78(this) && !func_808334B4(this) && (arg2 == 0)) {
if (!CVar_GetS32("gDisableAutoCenterView", 0)) {
temp2 = sControlInput->rel.stick_y * 240.0f * (CVar_GetS32("gInvertYAxis", 1) ? -1 : 1);
temp2 = sControlInput->rel.stick_y * 240.0f * (CVar_GetS32("gInvertYAxis", 1) ? 1 : -1);
Math_SmoothStepToS(&this->actor.focus.rot.x, temp2, 14, 4000, 30);
temp2 = sControlInput->rel.stick_x * -16.0f * (CVar_GetS32("gInvertXAxis", 0) ? -1 : 1);
@@ -1921,8 +1921,8 @@ void FileChoose_LoadGame(GameState* thisx) {
Randomizer_LoadSettings("");
Randomizer_LoadHintLocations("");
Randomizer_LoadMerchantMessages("");
Randomizer_LoadItemLocations("", true);
Randomizer_LoadMerchantMessages("");
gSaveContext.respawn[0].entranceIndex = -1;
gSaveContext.respawnFlag = 0;
@@ -10,6 +10,7 @@ void Opening_SetupTitleScreen(OpeningContext* this) {
gSaveContext.gameMode = 1;
this->state.running = false;
gSaveContext.linkAge = 0;
gSaveContext.fileNum = 0xFF;
Sram_InitDebugSave();
gSaveContext.cutsceneIndex = 0xFFF3;
gSaveContext.sceneSetupIndex = 7;
@@ -307,6 +307,7 @@ void Title_Init(GameState* thisx) {
Randomizer_LoadSettings("");
Randomizer_LoadHintLocations("");
Randomizer_LoadItemLocations("", true);
Randomizer_LoadMerchantMessages("");
gSaveContext.gameMode = 0;
gSaveContext.magic = gSaveContext.magic;
SET_NEXT_GAMESTATE(&this->state, Gameplay_Init, GlobalContext);
@@ -381,7 +381,8 @@ void KaleidoScope_DrawItemSelect(GlobalContext* globalCtx) {
--INV_CONTENT(ITEM_TRADE_CHILD);
} else if ((pauseCtx->stickRelX < -30 || pauseCtx->stickRelX > 30 || pauseCtx->stickRelY < -30 || pauseCtx->stickRelY > 30) ||
dpad && CHECK_BTN_ANY(input->press.button, BTN_DUP | BTN_DDOWN | BTN_DLEFT | BTN_DRIGHT)) {
if (INV_CONTENT(ITEM_TRADE_CHILD) == ITEM_LETTER_ZELDA) {
// Change to keaton mask if no mask is in child trade slot. Catches Zelda's letter and bottle duping over this slot.
if (INV_CONTENT(ITEM_TRADE_CHILD) < ITEM_MASK_KEATON || INV_CONTENT(ITEM_TRADE_CHILD) > ITEM_MASK_TRUTH) {
INV_CONTENT(ITEM_TRADE_CHILD) = ITEM_MASK_KEATON;
} else {
INV_CONTENT(ITEM_TRADE_CHILD) ^= ITEM_MASK_KEATON ^ ITEM_MASK_TRUTH;
@@ -1134,6 +1134,7 @@ void KaleidoScope_DrawPages(GlobalContext* globalCtx, GraphicsContext* gfxCtx) {
static s16 D_8082AD48 = 0;
static s16 D_8082AD4C = 0;
static s16 D_8082AD50 = 0;
const Color_RGB8 A_cursor = CVar_GetRGB("gCCABtnPrim", A_BTN_ori);
PauseContext* pauseCtx = &globalCtx->pauseCtx;
Input* input = &globalCtx->state.input[0];
s16 stepR;
@@ -1508,7 +1509,7 @@ void KaleidoScope_DrawPages(GlobalContext* globalCtx, GraphicsContext* gfxCtx) {
} else if (CVar_GetS32("gHudColors", 1) == 1) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 100, 255, 100, VREG(61));
} else if (CVar_GetS32("gHudColors", 1) == 2) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetRGB("gCCABtnPrim", A_BTN_ori).r, CVar_GetRGB("gCCABtnPrim", A_BTN_ori).g, CVar_GetRGB("gCCABtnPrim", A_BTN_ori).b, VREG(61)); //Save prompt cursor colour
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, A_cursor.r, A_cursor.g, A_cursor.b, VREG(61)); //Save prompt cursor colour
}
if (pauseCtx->promptChoice == 0) {
@@ -1533,7 +1534,13 @@ void KaleidoScope_DrawPages(GlobalContext* globalCtx, GraphicsContext* gfxCtx) {
gDPSetCombineLERP(POLY_KAL_DISP++, 1, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, 1, 0, PRIMITIVE, 0,
TEXEL0, 0, PRIMITIVE, 0);
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 100, 255, 100, VREG(61));
if (CVar_GetS32("gHudColors", 1) == 0) { //Continue prompt cursor colour
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 100, 100, 255, VREG(61));
} else if (CVar_GetS32("gHudColors", 1) == 1) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 100, 255, 100, VREG(61));
} else if (CVar_GetS32("gHudColors", 1) == 2) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, A_cursor.r, A_cursor.g, A_cursor.b, VREG(61)); //Continue prompt cursor colour
}
if (pauseCtx->promptChoice == 0) {
gSPDisplayList(POLY_KAL_DISP++, gPromptCursorLeftDL);