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>
This commit is contained in:
Inapusan
2025-11-10 09:05:31 -08:00
committed by GitHub
parent 10dbce74aa
commit f802a0e482
18 changed files with 183 additions and 33 deletions

3
.gitignore vendored
View File

@@ -25,6 +25,9 @@ docs/doxygen/
*.iso
*.bin
*.blend1
*.png~
*.dol
*.Identifier
*.dol
F3DEX3/*/*.code
F3DEX3/*/*.data

View File

@@ -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(),
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 598 B

View File

@@ -0,0 +1,3 @@
gsSPDisplayList(gBottleContentsDL),
gsSPDisplayList(gBottleGlassDL),
gsSPEndDisplayList(),

View File

@@ -0,0 +1,5 @@
#include "config.h"
#if MM_BOTTLE_MODEL
#include "assets/objects/gameplay_keep/bottle.c"
#endif

View File

@@ -0,0 +1,9 @@
#ifndef GAMEPLAY_HACKER_KEEP_H
#define GAMEPLAY_HACKER_KEEP_H
#include "ultra64.h"
extern Gfx gBottleContentsDL[];
extern Gfx gBottleGlassDL[];
#endif

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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``

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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"

View File

@@ -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)) {