From f802a0e482186a3fc149c5c74a3977126fa94bd6 Mon Sep 17 00:00:00 2001 From: Inapusan <157585454+NekoNeko6330@users.noreply.github.com> Date: Mon, 10 Nov 2025 09:05:31 -0800 Subject: [PATCH] Bugfixes and New MM options (#187) * bug fixing and MM options added the Majora's Mask bottles as an option along with the option to uncap the jumping velocity. added an option for the audio delay workaround and fixed errors for the camera debugger * removed zone.identifier * cleaned up and changed bottle textures to my own * deleted the zone identifier again why * cleanup and new bottle fill texture * finalized * whoopsie * my last commit frfr * fix --------- Co-authored-by: Yanis002 <35189056+Yanis002@users.noreply.github.com> --- .gitignore | 3 + assets/objects/gameplay_keep/bottle.c | 95 ++++++++++++++++++ .../gameplay_keep/bottle_contents.i8.png | Bin 0 -> 1286 bytes .../objects/gameplay_keep/bottle_glass.i8.png | Bin 0 -> 598 bytes .../gameplay_keep/gLinkMMBottleDL.inc.c | 3 + .../gameplay_keep/gameplay_hacker_keep.c | 5 + .../gameplay_keep/gameplay_hacker_keep.h | 9 ++ .../objects/object_link_boy/object_link_boy.c | 7 ++ .../object_link_child/object_link_child.c | 7 ++ format.py | 5 + include/config/config_debug_features.h | 2 +- include/config/config_game.h | 9 +- include/config/config_graphics.h | 5 +- spec/spec | 1 + src/code/audio_thread_manager.c | 2 + src/code/z_debug.c | 60 +++++------ src/code/z_demo.c | 1 + .../actors/ovl_player_actor/z_player.c | 2 + 18 files changed, 183 insertions(+), 33 deletions(-) create mode 100644 assets/objects/gameplay_keep/bottle.c create mode 100644 assets/objects/gameplay_keep/bottle_contents.i8.png create mode 100644 assets/objects/gameplay_keep/bottle_glass.i8.png create mode 100644 assets/objects/gameplay_keep/gLinkMMBottleDL.inc.c create mode 100644 assets/objects/gameplay_keep/gameplay_hacker_keep.c create mode 100644 assets/objects/gameplay_keep/gameplay_hacker_keep.h diff --git a/.gitignore b/.gitignore index 4f1843c4d..4e9e089b2 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,9 @@ docs/doxygen/ *.iso *.bin *.blend1 +*.png~ +*.dol +*.Identifier *.dol F3DEX3/*/*.code F3DEX3/*/*.data diff --git a/assets/objects/gameplay_keep/bottle.c b/assets/objects/gameplay_keep/bottle.c new file mode 100644 index 000000000..dba048c60 --- /dev/null +++ b/assets/objects/gameplay_keep/bottle.c @@ -0,0 +1,95 @@ +#include "ultra64.h" +#include "gfx.h" + +u64 gBottleContentsTex[] = { +#include "assets/objects/gameplay_keep/bottle_contents.i8.inc.c" +}; + +u64 gBottleGlassNewTex[] = { +#include "assets/objects/gameplay_keep/bottle_glass.i8.inc.c" +}; + +Vtx gameplay_keepVtx_000080[] = { + VTX(-465, 313, -5, 354, 973, 90, 90, 90, 90), VTX(63, 561, 209, 296, 277, 255, 255, 255, 255), + VTX(-466, 562, 205, 297, 976, 50, 50, 50, 50), VTX(64, 312, -1, 353, 274, 255, 255, 255, 255), + VTX(-462, 436, -307, 411, 970, 50, 50, 50, 50), VTX(67, 435, -303, 411, 271, 182, 182, 182, 182), + VTX(-461, 761, -283, 481, 971, 50, 50, 50, 50), VTX(67, 760, -279, 481, 272, 54, 54, 54, 54), + VTX(67, 435, -303, 411, 271, 182, 182, 182, 182), VTX(-464, 839, 33, 225, 975, 50, 50, 50, 50), + VTX(65, 838, 37, 225, 276, 118, 118, 118, 118), VTX(63, 561, 209, 296, 277, 255, 255, 255, 255), + VTX(64, 312, -1, 353, 274, 255, 255, 255, 255), + + VTX(443, 756, -271, -17, 180, 1, 77, 165, 50), VTX(264, 756, -272, 155, 179, 33, 82, 176, 50), + VTX(440, 833, 43, -12, 124, 0, 118, 18, 50), VTX(262, 834, 42, 159, 123, 29, 99, 60, 50), + VTX(438, 558, 214, -16, 321, 255, 20, 118, 50), VTX(259, 559, 212, 155, 320, 36, 246, 114, 58), + VTX(442, 433, -294, -23, 411, 1, 219, 143, 162), VTX(263, 434, -296, 148, 410, 38, 194, 161, 242), + VTX(260, 312, 4, 149, 498, 48, 150, 27, 248), VTX(430, 311, 6, -14, 499, 255, 140, 29, 180), + VTX(260, 312, 4, 34, 76, 48, 150, 27, 248), VTX(161, 397, -358, 43, 287, 38, 198, 159, 240), + VTX(263, 434, -296, 49, 240, 38, 194, 161, 242), VTX(158, 243, 19, 25, 81, 24, 142, 28, 218), + VTX(259, 559, 212, 46, -107, 36, 246, 114, 58), VTX(157, 555, 282, 38, -150, 36, 250, 114, 54), + VTX(158, 243, 19, 25, 81, 24, 142, 28, 218), VTX(262, 834, 42, 76, -56, 29, 99, 60, 50), + VTX(159, 901, 67, 85, -86, 42, 108, 31, 50), VTX(264, 756, -272, 78, 158, 33, 82, 176, 50), + VTX(162, 803, -329, 88, 184, 45, 59, 163, 100), VTX(158, 243, 19, 281, 81, 24, 142, 28, 218), + VTX(-550, 400, -366, 208, 293, 182, 190, 190, 50), VTX(161, 397, -358, 299, 287, 38, 198, 159, 240), + VTX(-554, 246, 11, 225, 87, 193, 158, 24, 58), VTX(157, 555, 282, 294, -150, 36, 250, 114, 54), + VTX(-555, 558, 274, 212, -144, 163, 233, 72, 50), VTX(-552, 904, 59, 175, -80, 211, 90, 64, 50), + VTX(-549, 806, -337, 172, 190, 194, 66, 178, 50), +}; + +Gfx gBottleContentsDL[] = { + gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON), + gsDPPipeSync(), + gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, TEXEL0, ENVIRONMENT, 0, COMBINED, 0, 0, 0, 0, COMBINED), + gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2), + gsDPPipeSync(), + gsDPSetTextureLUT(G_TT_NONE), + gsDPLoadTextureBlock(gBottleContentsTex, G_IM_FMT_I, G_IM_SIZ_8b, 16, 32, 0, G_TX_MIRROR | G_TX_CLAMP, + G_TX_MIRROR | G_TX_CLAMP, 4, 5, G_TX_NOLOD, G_TX_NOLOD), + gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_FOG | G_SHADING_SMOOTH), + gsSPVertex(gameplay_keepVtx_000080, 13, 0), + gsSP2Triangles(0, 1, 2, 0, 0, 3, 1, 0), + gsSP2Triangles(4, 5, 0, 0, 5, 3, 0, 0), + gsSP2Triangles(4, 0, 2, 0, 6, 7, 4, 0), + gsSP2Triangles(7, 8, 4, 0, 4, 2, 6, 0), + gsSP2Triangles(9, 7, 6, 0, 9, 10, 7, 0), + gsSP2Triangles(2, 10, 9, 0, 2, 11, 10, 0), + gsSP2Triangles(2, 9, 6, 0, 11, 7, 10, 0), + gsSP2Triangles(11, 8, 7, 0, 11, 12, 8, 0), + gsSPEndDisplayList(), +}; + +Gfx gBottleGlassDL[] = { + gsSPTexture(0x0BB8, 0x0BB8, 0, G_TX_RENDERTILE, G_ON), + gsDPPipeSync(), + gsDPSetCombineLERP(PRIMITIVE, ENVIRONMENT, SHADE, TEXEL0, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, PRIMITIVE, SHADE, + COMBINED, 0, 0, 0, COMBINED), + gsDPSetPrimColor(0, 0xFF, 170, 240, 255, 255), + gsDPSetEnvColor(128, 128, 128, 255), + gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_XLU_SURF2), + gsDPSetTextureLUT(G_TT_NONE), + gsDPLoadTextureBlock(gBottleGlassNewTex, G_IM_FMT_I, G_IM_SIZ_8b, 8, 8, 0, G_TX_MIRROR | G_TX_WRAP, + G_TX_MIRROR | G_TX_WRAP, 3, 3, 2, 3), + gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | + G_SHADING_SMOOTH), + gsSPVertex(&gameplay_keepVtx_000080[13], 10, 0), + gsSP2Triangles(0, 1, 2, 0, 1, 3, 2, 0), + gsSP2Triangles(2, 3, 4, 0, 3, 5, 4, 0), + gsSP2Triangles(6, 1, 0, 0, 6, 7, 1, 0), + gsSP2Triangles(8, 9, 5, 0, 9, 4, 5, 0), + gsSP2Triangles(8, 7, 9, 0, 7, 6, 9, 0), + gsSPTexture(0x0640, 0x08FC, 0, G_TX_RENDERTILE, G_ON), + gsDPPipeSync(), + gsSPVertex(&gameplay_keepVtx_000080[23], 19, 0), + gsSP2Triangles(0, 1, 2, 0, 0, 3, 1, 0), + gsSP2Triangles(4, 5, 0, 0, 5, 6, 0, 0), + gsSP2Triangles(7, 8, 4, 0, 8, 5, 4, 0), + gsSP2Triangles(9, 8, 7, 0, 9, 10, 8, 0), + gsSP2Triangles(2, 10, 9, 0, 2, 1, 10, 0), + gsSP2Triangles(11, 12, 13, 0, 11, 14, 12, 0), + gsSP2Triangles(15, 16, 11, 0, 16, 14, 11, 0), + gsSP2Triangles(8, 17, 15, 0, 17, 16, 15, 0), + gsSP2Triangles(10, 18, 8, 0, 18, 17, 8, 0), + gsSP2Triangles(13, 18, 10, 0, 13, 12, 18, 0), + gsSP2Triangles(12, 16, 18, 0, 12, 14, 16, 0), + gsSP1Triangle(16, 17, 18, 0), + gsSPEndDisplayList(), +}; diff --git a/assets/objects/gameplay_keep/bottle_contents.i8.png b/assets/objects/gameplay_keep/bottle_contents.i8.png new file mode 100644 index 0000000000000000000000000000000000000000..9770bc77490f729feae0d812dda2ec0d63120424 GIT binary patch literal 1286 zcmeAS@N?(olHy`uVBq!ia0y~yU=UznU{K&-V_;yA?)-6vfq^kM)7d#7GdY=oL1SX+ z#J%2!9VCv`ukDJT%4gMKQ4&xXAi!EUg{v&EJ?h{pZ>iZ~9$6kiOLlPS@ijHScy#?i z{esmGRw;0FDLi`h>bjEZzVw!^E#i9b`=7t7+*!?cD0o@k&aci1qBiO?JB~lQ%)RlL zcvPku7f<%CZ2$9q%T`$0z2{h2Wxb;6>b>yNEqdv(vQEB-7Vmmnap>`(;Ou#8E4+6& zpU*yhsQnOgpG?3Hua`3$=8HaOstbR!WRkEzm~HY-`#C=kSKZs#^1HQKXY-2x^W5*M zOwv7b*6Z!0o4wwXSPGL;G&VJL9$#>!DJAT#`IpDD6GLrw{mJ#RcywZ-`1^(xt}kaz z&FYvp_56}0MgQk7&+g%2zpGrBQSs^T_PC5Yji0u?ub2H<_fz7P+`~lyAJ=>NCCe|$ z58pD6xg+nu%~aRZZw~!bE3vyVYw=%?QlrCdjO&+QnAY}9IwO*2)34a)PvnALe{#9L zVLN~ACi`7qc%RQn|1bQ*;Rgc)180FpWHAE+w-5+3UbOnsv zM}Zb;NfB2O)2IMYTmp< z$BrGVF`Ip~#*SZZ-=3pMhRZIm+?So59hLm&^XJL8H|f{b)*iidDQL-*N56ktbG0`0 z{M6IecV8OR`S$Hwjj3J-*%;I&d+yo4|Fv&)baY`!iHg2X$?n+7CRT;5QM!Em{K=`Q zuE`R2@83WE`t@p=C1ty1moHx)6%!xdpSD@Dyu7@yx>|d}+_`fzOr$=s9X@;3*YKp% z|MLst)^qQT(aRPR+i>&t?e32iGP`&0PU0wyb87s0`gHe;Jw1Y%uujL>t4>>4L_cDAK)xm-Otz4`T6ZzUpI!Z)uDz8 zWjPYUn=W;z_f-5iE-gLR?AisE_g$91t)!LI2IVWM=#oK;Lj=}EK zg5X4n4;E=M53cT9-ZS^sk*3`ftc_3P7#YaU@ZF~^Fu`)^#BF~+ew_Gxs&B{fKVQFY zwVG1Q$Gmmperp$X;rxKu6i2mr^XHeg+!c;hZkS*>$D{rDarZz+izo}Z6FdvfIL@8t zSRo>??aySztyX(JGAr>jDZM#+w%6wE`}gkq@ArTHTzoem&Eew9lr-@Z_CYME?;2LG z)~2|md+~dR&%avtJm3KX0|SGntDnm{r-UW| D`x{`d literal 0 HcmV?d00001 diff --git a/assets/objects/gameplay_keep/bottle_glass.i8.png b/assets/objects/gameplay_keep/bottle_glass.i8.png new file mode 100644 index 0000000000000000000000000000000000000000..4f359c445c37513c92f189d0f4b46dc03c407b5c GIT binary patch literal 598 zcmeAS@N?(olHy`uVBq!ia0y~yVBi2@4mJh`h9ms@x)~T43o@OZ12U7785lGsmQLL3 zeb_9ncZalZYYLtIWY!j^Np0R;BH;&*E_|S{>xbzN z`4?I{v^biSI(F>(wbi5Zy=kjhrhd#l`SW)_7k!s`;Q#u}hGxzK2D0-!RhM4m#3!ywp7|w8!1% zj8{?Pj~0t#FB^_*cM7+u6OQ@v!`t9|su;um7n-8CBQlf29rz(sU6g6>r7_XmEvt3csu0sl zp}$H(T;Kiwyk+am%=Oh4oL~0rdiR{=!fyU6+3S8+zuNWHSm6Ux%xvBInMJdHtL?pZ zY0+_q6!sl^GBZyx7HsA2v5PjEE*;dcEdFvsKX-xwKhIre=GSpyXG`bUGw#f-T4ep; z1ILUde<$|Z-d;2L=WP&H|6fVg?31We{epSZZI!z`)Ss>Eak75#HKw$i<>4 z;%wZl&}1gIO-$~fcjc0ucSM?dBW`3Ui|uxaxRGVn`{BNSoz0Y>d`;CJ!wXT(QppRx z_gSj5EZiz~uiE1IH>b6t-)k3dWph+d>=9IK*;^2Mz3zIHK+n?221~abtekhka`BX= z>+@_pHVEV!O*{9V^V|uR+nWTA-nc(0<@o;mItKSs0h;1Q5}FJQ3=E#GelF{r5}E+a CBnPSh literal 0 HcmV?d00001 diff --git a/assets/objects/gameplay_keep/gLinkMMBottleDL.inc.c b/assets/objects/gameplay_keep/gLinkMMBottleDL.inc.c new file mode 100644 index 000000000..7699de25b --- /dev/null +++ b/assets/objects/gameplay_keep/gLinkMMBottleDL.inc.c @@ -0,0 +1,3 @@ + gsSPDisplayList(gBottleContentsDL), + gsSPDisplayList(gBottleGlassDL), + gsSPEndDisplayList(), \ No newline at end of file diff --git a/assets/objects/gameplay_keep/gameplay_hacker_keep.c b/assets/objects/gameplay_keep/gameplay_hacker_keep.c new file mode 100644 index 000000000..b1b1bb9c9 --- /dev/null +++ b/assets/objects/gameplay_keep/gameplay_hacker_keep.c @@ -0,0 +1,5 @@ +#include "config.h" + +#if MM_BOTTLE_MODEL +#include "assets/objects/gameplay_keep/bottle.c" +#endif diff --git a/assets/objects/gameplay_keep/gameplay_hacker_keep.h b/assets/objects/gameplay_keep/gameplay_hacker_keep.h new file mode 100644 index 000000000..f0031a82d --- /dev/null +++ b/assets/objects/gameplay_keep/gameplay_hacker_keep.h @@ -0,0 +1,9 @@ +#ifndef GAMEPLAY_HACKER_KEEP_H +#define GAMEPLAY_HACKER_KEEP_H + +#include "ultra64.h" + +extern Gfx gBottleContentsDL[]; +extern Gfx gBottleGlassDL[]; + +#endif diff --git a/assets/objects/object_link_boy/object_link_boy.c b/assets/objects/object_link_boy/object_link_boy.c index ea6fe8c9f..2900968a4 100644 --- a/assets/objects/object_link_boy/object_link_boy.c +++ b/assets/objects/object_link_boy/object_link_boy.c @@ -1,5 +1,6 @@ #include "object_link_boy.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" +#include "assets/objects/gameplay_keep/gameplay_hacker_keep.h" #include "array_count.h" #include "gfx.h" @@ -895,9 +896,15 @@ Gfx gLinkAdultRightHandHoldingHookshotFarDL[196] = { #include "assets/objects/object_link_boy/gLinkAdultRightHandHoldingHookshotFarDL.inc.c" }; +#if MM_BOTTLE_MODEL +Gfx gLinkAdultBottleDL[] = { +#include "assets/objects/gameplay_keep/gLinkMMBottleDL.inc.c" +}; +#else Gfx gLinkAdultBottleDL[35] = { #include "assets/objects/object_link_boy/gLinkAdultBottleDL.inc.c" }; +#endif // Hookshot, bow, broken giant's knife diff --git a/assets/objects/object_link_child/object_link_child.c b/assets/objects/object_link_child/object_link_child.c index 30411ab0b..457d79017 100644 --- a/assets/objects/object_link_child/object_link_child.c +++ b/assets/objects/object_link_child/object_link_child.c @@ -1,5 +1,6 @@ #include "object_link_child.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" +#include "assets/objects/gameplay_keep/gameplay_hacker_keep.h" #include "array_count.h" #include "gfx.h" @@ -566,9 +567,15 @@ Gfx gLinkChildRightArmStretchedSlingshotDL[134] = { #include "assets/objects/object_link_child/gLinkChildRightArmStretchedSlingshotDL.inc.c" }; +#if MM_BOTTLE_MODEL +Gfx gLinkChildBottleDL[] = { +#include "assets/objects/gameplay_keep/gLinkMMBottleDL.inc.c" +}; +#else Gfx gLinkChildBottleDL[33] = { #include "assets/objects/object_link_child/gLinkChildBottleDL.inc.c" }; +#endif Gfx gLinkChildDL_18580[25] = { #include "assets/objects/object_link_child/gLinkChildDL_18580.inc.c" diff --git a/format.py b/format.py index 0c6841c93..05f34da80 100755 --- a/format.py +++ b/format.py @@ -183,6 +183,11 @@ def list_files_to_format(): if file in files and "gbi.f3dex3.h" in file: files.remove(file) break + + # Do not format assets/**/*.inc.c files + for file in glob.glob("assets/**/*.inc.c", recursive=True): + if file in files: + files.remove(file) return files, extra_files diff --git a/include/config/config_debug_features.h b/include/config/config_debug_features.h index fe2399e87..5b2becca9 100644 --- a/include/config/config_debug_features.h +++ b/include/config/config_debug_features.h @@ -37,7 +37,7 @@ // ``CAN_SHOW_CS_INFOS`` #define SHOW_CS_INFOS false // ``IS_CS_CONTROL_ENABLED`` -#define ENABLE_CS_CONTROL false +#define ENABLE_CS_CONTROL true // Allow skip on the title screen (if using ``ENABLE_CS_CONTROL``) // ``CS_CAN_SKIP_TITLE_SCREEN`` diff --git a/include/config/config_game.h b/include/config/config_game.h index e00ac38b9..54e16cc28 100644 --- a/include/config/config_game.h +++ b/include/config/config_game.h @@ -12,6 +12,9 @@ // Add a fix for the Stale Reference Manipulation glitch (OoT's Pandora's Box) #define FIX_SRM true +// Delay the audio update by 3ms (causes the audio to go out intermittently) +#define AUDIO_DELAY false + /** * Enable mempak-related code */ @@ -26,6 +29,9 @@ // Enables the beep sound at low health (vanilla behavior) #define ENABLE_LOW_HEALTH_BEEP true +// Clamps the jumping velocity (setting to false uncaps the jump speed like in MM) +#define CLAMPED_JUMP_VELOCITY true + // Make the Bunny Hood Mask behave like in Majora's Mask where it increases Link's speed when equipped. #define MM_BUNNY_HOOD false #define MM_BUNNY_HOOD_SPEED 1.5f @@ -83,8 +89,9 @@ * Enable Cutscene Improvements (from Majora's Mask) * * This includes actor cutscenes + * (will cause softlocks!) */ -#define ENABLE_CUTSCENE_IMPROVEMENTS true +#define ENABLE_CUTSCENE_IMPROVEMENTS false /** * Enable MM Title Cards diff --git a/include/config/config_graphics.h b/include/config/config_graphics.h index a4d5bffb7..c4909c0ae 100644 --- a/include/config/config_graphics.h +++ b/include/config/config_graphics.h @@ -31,6 +31,9 @@ // Enable or disable Link's LOD model (the low poly model) #define ENABLE_LINK_LOD false +// Use the Majora's Mask Model for Bottles +#define MM_BOTTLE_MODEL true + // Disables AA (Improves console performance but causes visible seams between unconnected geometry). // #define DISABLE_AA false @@ -56,7 +59,7 @@ * Use the button combo Z + R + D-Pad Up to toggle * Note: pre-rendered scenes with the fixed camera mode won't re-scale properly */ -#define ENABLE_WIDESCREEN false +#define ENABLE_WIDESCREEN true // Force widescreen mode regardless of SaveContext #define FORCE_WIDESCREEN false diff --git a/spec/spec b/spec/spec index f0c1f97c6..72132150e 100644 --- a/spec/spec +++ b/spec/spec @@ -1145,6 +1145,7 @@ beginseg compress romalign 0x1000 include "$(BUILD_DIR)/assets/objects/gameplay_keep/gameplay_keep.o" + include "$(BUILD_DIR)/assets/objects/gameplay_keep/gameplay_hacker_keep.o" number 4 endseg diff --git a/src/code/audio_thread_manager.c b/src/code/audio_thread_manager.c index 01030a380..2d1bc6973 100644 --- a/src/code/audio_thread_manager.c +++ b/src/code/audio_thread_manager.c @@ -28,6 +28,7 @@ void AudioMgr_NotifyTaskDone(AudioMgr* audioMgr) { void AudioMgr_HandleRetrace(AudioMgr* audioMgr) { AudioTask* rspTask; +#if AUDIO_DELAY // Delay the audio update by 3ms so that gfx has time to get going before it has to yield OSTimer timer; OSMesgQueue mq; @@ -36,6 +37,7 @@ void AudioMgr_HandleRetrace(AudioMgr* audioMgr) { osSetTimer(&timer, OS_USEC_TO_CYCLES(3000), 0, &mq, NULL); osRecvMesg(&mq, NULL, OS_MESG_BLOCK); osStopTimer(&timer); +#endif if (R_AUDIOMGR_DEBUG_LEVEL > AUDIOMGR_DEBUG_LEVEL_NONE) { // Inhibit audio rsp task processing diff --git a/src/code/z_debug.c b/src/code/z_debug.c index d3cc8572d..dee7c48b3 100644 --- a/src/code/z_debug.c +++ b/src/code/z_debug.c @@ -142,48 +142,48 @@ void DebugCamera_ScreenText(u8 x, u8 y, const char* text) { } void DebugCamera_ScreenTextColored(u8 x, u8 y, u8 colorIndex, const char* text) { -#if IS_CAMERA_DEBUG_ENABLED - DebugCamTextBufferEntry* entry = &sDebugCamTextBuffer[sDebugCamTextEntryCount]; - char* textDest; - s16 charCount; + if (IS_CAMERA_DEBUG_ENABLED) { + DebugCamTextBufferEntry* entry = &sDebugCamTextBuffer[sDebugCamTextEntryCount]; + char* textDest; + s16 charCount; - if (sDebugCamTextEntryCount < ARRAY_COUNT(sDebugCamTextBuffer)) { - entry->x = x; - entry->y = y; - entry->colorIndex = colorIndex; + if (sDebugCamTextEntryCount < ARRAY_COUNT(sDebugCamTextBuffer)) { + entry->x = x; + entry->y = y; + entry->colorIndex = colorIndex; - // Copy text into the entry, truncating if needed - charCount = 0; - textDest = entry->text; + // Copy text into the entry, truncating if needed + charCount = 0; + textDest = entry->text; - while ((*textDest++ = *text++) != '\0') { - if (charCount++ > (ARRAY_COUNT(entry->text) - 1)) { - break; + while ((*textDest++ = *text++) != '\0') { + if (charCount++ > (ARRAY_COUNT(entry->text) - 1)) { + break; + } } + + *textDest = '\0'; + + sDebugCamTextEntryCount++; } - - *textDest = '\0'; - - sDebugCamTextEntryCount++; } -#endif } void DebugCamera_DrawScreenText(GfxPrint* printer) { -#if IS_CAMERA_DEBUG_ENABLED - s32 i; - Color_RGBA8* color; - DebugCamTextBufferEntry* entry; + if (IS_CAMERA_DEBUG_ENABLED) { + s32 i; + Color_RGBA8* color; + DebugCamTextBufferEntry* entry; - for (i = 0; i < sDebugCamTextEntryCount; i++) { - entry = &sDebugCamTextBuffer[i]; - color = &sDebugCamTextColors[entry->colorIndex]; + for (i = 0; i < sDebugCamTextEntryCount; i++) { + entry = &sDebugCamTextBuffer[i]; + color = &sDebugCamTextColors[entry->colorIndex]; - GfxPrint_SetColor(printer, color->r, color->g, color->b, color->a); - GfxPrint_SetPos(printer, entry->x, entry->y); - GfxPrint_Printf(printer, "%s", entry->text); + GfxPrint_SetColor(printer, color->r, color->g, color->b, color->a); + GfxPrint_SetPos(printer, entry->x, entry->y); + GfxPrint_Printf(printer, "%s", entry->text); + } } -#endif } #if DEBUG_FEATURES diff --git a/src/code/z_demo.c b/src/code/z_demo.c index 4fa62ef06..af2f5b135 100644 --- a/src/code/z_demo.c +++ b/src/code/z_demo.c @@ -1,5 +1,6 @@ #pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \ "ique-cn:128 ntsc-1.0:0 ntsc-1.1:0 ntsc-1.2:0 pal-1.0:0 pal-1.1:0" +#include "padmgr.h" #include "config.h" #include "libu64/gfxprint.h" #include "array_count.h" diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index a06a119f4..0185a4716 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -7178,9 +7178,11 @@ void func_8083DF68(Player* this, f32 arg1, s16 arg2) { void func_8083DFE0(Player* this, f32* arg1, s16* arg2) { s16 yawDiff = this->yaw - *arg2; +#if CLAMPED_JUMP_VELOCITY if (this->meleeWeaponState == 0) { this->speedXZ = CLAMP(this->speedXZ, -(R_RUN_SPEED_LIMIT / 100.0f), (R_RUN_SPEED_LIMIT / 100.0f)); } +#endif if (ABS(yawDiff) > 0x6000) { if (Math_StepToF(&this->speedXZ, 0.0f, 1.0f)) {