1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-13 02:10:57 +00:00

Match NTSC loose ends (#2004)

* Match NTSC loose ends

* Add comment about giObjectSegment size
This commit is contained in:
cadmic 2024-07-27 21:09:05 -07:00 committed by GitHub
parent 7fcbf3f4b2
commit 067d06bb56
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 32 additions and 3 deletions

View file

@ -5759,8 +5759,18 @@ void Fishing_UpdateOwner(Actor* thisx, PlayState* play2) {
SkinMatrix_Vec3fMtxFMultXYZW(&play->viewProjectionMtxF, &sStreamSfxPos, &sStreamSfxProjectedPos, &sProjectedW);
Sfx_PlaySfxAtPos(&sStreamSfxProjectedPos, NA_SE_EV_WATER_WALL - SFX_FLAG);
// convert length to weight. Theoretical max of 59 lbs (127^2*.0036+.5)
#if OOT_NTSC
if (gSaveContext.language == LANGUAGE_JPN) {
gSaveContext.minigameScore = sFishLengthToWeigh;
} else {
// Convert length to weight. Theoretical max of 59 lbs (127^2*.0036+.5)
gSaveContext.minigameScore = (SQ((f32)sFishLengthToWeigh) * 0.0036f) + 0.5f;
}
#else
// Same as above, but for PAL
gSaveContext.minigameScore = (SQ((f32)sFishLengthToWeigh) * 0.0036f) + 0.5f;
#endif
#if OOT_DEBUG
if (BREG(26) != 0) {

View file

@ -10113,7 +10113,11 @@ void Player_Init(Actor* thisx, PlayState* play2) {
Player_SetEquipmentData(play, this);
this->prevBoots = this->currentBoots;
Player_InitCommon(this, play, gPlayerSkelHeaders[((void)0, gSaveContext.save.linkAge)]);
this->giObjectSegment = (void*)(((uintptr_t)ZELDA_ARENA_MALLOC(0x3008, "../z_player.c", 17175) + 8) & ~0xF);
// `giObjectSegment` is used for both "get item" objects and title cards. The maximum size for
// get item objects is 0x2000 (see the assert in func_8083AE40), and the maximum size for
// title cards is 0x1000 * LANGUAGE_MAX since each title card image includes all languages.
this->giObjectSegment =
(void*)(((uintptr_t)ZELDA_ARENA_MALLOC(0x1000 * LANGUAGE_MAX + 8, "../z_player.c", 17175) + 8) & ~0xF);
respawnFlag = gSaveContext.respawnFlag;