1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-12 10:54:44 +00:00

Merge commit '7fcbf3f4b2' into doc_pause_menu

This commit is contained in:
Dragorn421 2024-08-01 21:47:44 +02:00
commit 9169d886bc
No known key found for this signature in database
GPG key ID: 381AEBAF3D429335
12 changed files with 1381 additions and 459 deletions

View file

@ -1,7 +1,15 @@
#include "global.h"
#include "message_data_static.h"
void func_8006EE50(Font* font, u16 arg1, u16 arg2) {
/**
* Loads a texture from kanji for the requested `character` into the character texture buffer
* at `codePointIndex`. The value of `character` is the SHIFT-JIS encoding of the character.
*/
void Font_LoadCharWide(Font* font, u16 character, u16 codePointIndex) {
#if OOT_NTSC
DmaMgr_RequestSync(&font->charTexBuf[codePointIndex],
(uintptr_t)_kanjiSegmentRomStart + Kanji_OffsetFromShiftJIS(character), FONT_CHAR_TEX_SIZE);
#endif
}
/**
@ -33,14 +41,34 @@ void Font_LoadMessageBoxIcon(Font* font, u16 icon) {
* the font buffer.
*/
void Font_LoadOrderedFont(Font* font) {
s32 size;
s32 len;
s32 codePointIndex;
s32 fontBufIndex;
u32 offset;
font->msgOffset = FONT_MESSAGE_OFFSET;
len = font->msgLength = FONT_MESSAGE_LENGTH;
size = font->msgLength = FONT_MESSAGE_LENGTH;
#if OOT_NTSC
len = (u32)size / 2;
DmaMgr_RequestSync(font->msgBufWide, (uintptr_t)_jpn_message_data_staticSegmentRomStart + font->msgOffset, size);
fontBufIndex = 0;
for (codePointIndex = 0; font->msgBufWide[codePointIndex] != MESSAGE_WIDE_END; codePointIndex++) {
if (len < codePointIndex) {
return;
}
if (font->msgBufWide[codePointIndex] != MESSAGE_WIDE_NEWLINE) {
offset = Kanji_OffsetFromShiftJIS(font->msgBufWide[codePointIndex]);
DmaMgr_RequestSync(&font->fontBuf[fontBufIndex * 8], (uintptr_t)_kanjiSegmentRomStart + offset,
FONT_CHAR_TEX_SIZE);
fontBufIndex += FONT_CHAR_TEX_SIZE / 8;
}
}
#else
len = size;
DMA_REQUEST_SYNC(font->msgBuf, (uintptr_t)_nes_message_data_staticSegmentRomStart + font->msgOffset, len,
"../z_kanfont.c", 122);
@ -62,4 +90,5 @@ void Font_LoadOrderedFont(Font* font) {
fontBufIndex += FONT_CHAR_TEX_SIZE / 8;
}
}
#endif
}

File diff suppressed because it is too large Load diff

View file

@ -1125,13 +1125,14 @@ s32 Player_OverrideLimbDrawGameplayCommon(PlayState* play, s32 limbIndex, Gfx**
sCurBodyPartPos = &this->bodyPartsPos[0] - 1;
if (!LINK_IS_ADULT) {
if (!(this->skelAnime.moveFlags & ANIM_FLAG_PLAYER_2) ||
if (!(this->skelAnime.moveFlags & ANIM_FLAG_DISABLE_CHILD_ROOT_ADJUSTMENT) ||
(this->skelAnime.moveFlags & ANIM_FLAG_UPDATE_XZ)) {
pos->x *= 0.64f;
pos->z *= 0.64f;
}
if (!(this->skelAnime.moveFlags & ANIM_FLAG_PLAYER_2) || (this->skelAnime.moveFlags & ANIM_FLAG_UPDATE_Y)) {
if (!(this->skelAnime.moveFlags & ANIM_FLAG_DISABLE_CHILD_ROOT_ADJUSTMENT) ||
(this->skelAnime.moveFlags & ANIM_FLAG_UPDATE_Y)) {
pos->y *= 0.64f;
}
}
@ -1522,6 +1523,11 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList, Ve
func_80090A28(this, spE4);
func_800906D4(play, this, spE4);
} else if ((*dList != NULL) && (this->leftHandType == PLAYER_MODELTYPE_LH_BOTTLE)) {
//! @bug When Player is actively using shield, the `itemAction` value will be set to -1.
//! If shield is used at the same time a bottle is in hand, `Player_ActionToBottle` will
//! return -1, which results in an out of bounds access behind the `sBottleColors` array.
//! A value of -1 happens to access `gLinkChildBottleDL` (0x06018478). The last 3 bytes of
//! this pointer are read as a color, which results in a dark teal color used for the bottle.
Color_RGB8* bottleColor = &sBottleColors[Player_ActionToBottle(this, this->itemAction)];
OPEN_DISPS(play->state.gfxCtx, "../z_player_lib.c", 2710);