1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-02-23 07:45:55 +00:00

Merge branch 'main' into doc_pause_menu

This commit is contained in:
Dragorn421 2024-09-05 00:19:20 +02:00
commit 42f1446da1
No known key found for this signature in database
GPG key ID: 381AEBAF3D429335
8 changed files with 79 additions and 28 deletions

View file

@ -5,8 +5,10 @@
#include "z64pause.h" #include "z64pause.h"
#include "z64scene.h" #include "z64scene.h"
struct Font;
struct GameState; struct GameState;
union Gfx; union Gfx;
struct MessageTableEntry;
struct PlayState; struct PlayState;
struct RegEditor; struct RegEditor;
struct RoomContext; struct RoomContext;
@ -39,7 +41,11 @@ typedef struct n64ddStruct_80121220 {
struct SceneTableEntry* (*unk_48)(s32 sceneId, struct SceneTableEntry* sceneTable); struct SceneTableEntry* (*unk_48)(s32 sceneId, struct SceneTableEntry* sceneTable);
char unk_4C[0x08]; char unk_4C[0x08];
s32 (*unk_54)(struct PlayState*); s32 (*unk_54)(struct PlayState*);
char unk_58[0x14]; void (*unk_58)(struct MessageTableEntry**, struct MessageTableEntry**, struct MessageTableEntry**);
char unk_5C[0x4];
s32 (*unk_60)(struct Font*);
s32 (*unk_64)(struct Font*);
s32 (*unk_68)(struct Font*);
void (*unk_6C)(struct PlayState*, SceneDrawConfigFunc*); void (*unk_6C)(struct PlayState*, SceneDrawConfigFunc*);
s32 (*unk_70)(struct DmaRequest* req, void* ram, uintptr_t vrom, size_t size, u32 unk, OSMesgQueue* queue, OSMesg msg); s32 (*unk_70)(struct DmaRequest* req, void* ram, uintptr_t vrom, size_t size, u32 unk, OSMesgQueue* queue, OSMesg msg);
void (*unk_74)(struct GameState*); void (*unk_74)(struct GameState*);

View file

@ -176,8 +176,8 @@ typedef enum TimerId {
#define ENV_HAZARD_TEXT_TRIGGER_HOTROOM (1 << 0) #define ENV_HAZARD_TEXT_TRIGGER_HOTROOM (1 << 0)
#define ENV_HAZARD_TEXT_TRIGGER_UNDERWATER (1 << 1) #define ENV_HAZARD_TEXT_TRIGGER_UNDERWATER (1 << 1)
typedef enum { typedef enum WorldMapArea {
/* 0 */ WORLD_MAP_AREA_HYRULE_FIELD, // hyrule field / default / unset ? /* 0 */ WORLD_MAP_AREA_HYRULE_FIELD,
/* 1 */ WORLD_MAP_AREA_KAKARIKO_VILLAGE, /* 1 */ WORLD_MAP_AREA_KAKARIKO_VILLAGE,
/* 2 */ WORLD_MAP_AREA_GRAVEYARD, /* 2 */ WORLD_MAP_AREA_GRAVEYARD,
/* 3 */ WORLD_MAP_AREA_ZORAS_RIVER, /* 3 */ WORLD_MAP_AREA_ZORAS_RIVER,
@ -197,9 +197,9 @@ typedef enum {
/* 17 */ WORLD_MAP_AREA_DEATH_MOUNTAIN_CRATER, /* 17 */ WORLD_MAP_AREA_DEATH_MOUNTAIN_CRATER,
/* 18 */ WORLD_MAP_AREA_GORON_CITY, /* 18 */ WORLD_MAP_AREA_GORON_CITY,
/* 19 */ WORLD_MAP_AREA_LON_LON_RANCH, /* 19 */ WORLD_MAP_AREA_LON_LON_RANCH,
/* 20 */ WORLD_MAP_AREA_20, // hakasitarelay and a lon lon ranch cutscene, gQuestionMarkPositionNameENGTex /* 20 */ WORLD_MAP_AREA_QUESTION_MARK, // Windmill/Dampé's Grave (and a Lon Lon Ranch cutscene). Labeled as "?"
/* 21 */ WORLD_MAP_AREA_GANONS_CASTLE, /* 21 */ WORLD_MAP_AREA_GANONS_CASTLE,
/* 22 */ WORLD_MAP_AREA_MAX // grottos and fairy's/great fairy's fountains (scenes with varying locations) /* 22 */ WORLD_MAP_AREA_MAX // also grottos and fairy's/great fairy's fountains (scenes with varying locations)
} WorldMapArea; } WorldMapArea;
// offsets in SavePlayerData and SaveContext/Save // offsets in SavePlayerData and SaveContext/Save

View file

@ -1,6 +1,6 @@
#include "global.h" #include "global.h"
#pragma increment_block_number "gc-eu:128 gc-eu-mq:128" #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"
uintptr_t sSysCfbFbPtr[2]; uintptr_t sSysCfbFbPtr[2];
uintptr_t sSysCfbEnd; uintptr_t sSysCfbEnd;

View file

@ -19,7 +19,7 @@ MtxF gMtxFClear = {
}; };
// clang-format on // clang-format on
#pragma increment_block_number "gc-eu:128 gc-eu-mq:128" #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"
MtxF* sMatrixStack; // "Matrix_stack" MtxF* sMatrixStack; // "Matrix_stack"
MtxF* sCurrentMatrix; // "Matrix_now" MtxF* sCurrentMatrix; // "Matrix_now"

View file

@ -4,9 +4,22 @@
#include "versions.h" #include "versions.h"
#include "assets/textures/parameter_static/parameter_static.h" #include "assets/textures/parameter_static/parameter_static.h"
#include "versions.h" #include "versions.h"
#if PLATFORM_N64
#include "n64dd.h"
#endif
#pragma increment_block_number "gc-eu:128 gc-eu-mq:0 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" #pragma increment_block_number "gc-eu:128 gc-eu-mq:0 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128"
#if PLATFORM_N64
#define OCARINA_BUTTON_A_PRIM_R 80
#define OCARINA_BUTTON_A_PRIM_G 150
#define OCARINA_BUTTON_A_PRIM_B 255
#else
#define OCARINA_BUTTON_A_PRIM_R 80
#define OCARINA_BUTTON_A_PRIM_G 255
#define OCARINA_BUTTON_A_PRIM_B 150
#endif
s16 sTextFade = false; // original name: key_off_flag ? s16 sTextFade = false; // original name: key_off_flag ?
u8 D_8014B2F4 = 0; u8 D_8014B2F4 = 0;
@ -194,9 +207,9 @@ void Message_ResetOcarinaNoteState(void) {
sOcarinaButtonAlphaValues[0] = sOcarinaButtonAlphaValues[1] = sOcarinaButtonAlphaValues[2] = sOcarinaButtonAlphaValues[0] = sOcarinaButtonAlphaValues[1] = sOcarinaButtonAlphaValues[2] =
sOcarinaButtonAlphaValues[3] = sOcarinaButtonAlphaValues[4] = sOcarinaButtonAlphaValues[5] = sOcarinaButtonAlphaValues[3] = sOcarinaButtonAlphaValues[4] = sOcarinaButtonAlphaValues[5] =
sOcarinaButtonAlphaValues[6] = sOcarinaButtonAlphaValues[7] = sOcarinaButtonAlphaValues[8] = 0; sOcarinaButtonAlphaValues[6] = sOcarinaButtonAlphaValues[7] = sOcarinaButtonAlphaValues[8] = 0;
sOcarinaButtonAPrimR = 80; sOcarinaButtonAPrimR = OCARINA_BUTTON_A_PRIM_R;
sOcarinaButtonAPrimG = 255; sOcarinaButtonAPrimG = OCARINA_BUTTON_A_PRIM_G;
sOcarinaButtonAPrimB = 150; sOcarinaButtonAPrimB = OCARINA_BUTTON_A_PRIM_B;
sOcarinaButtonAEnvR = 10; sOcarinaButtonAEnvR = 10;
sOcarinaButtonAEnvG = 10; sOcarinaButtonAEnvG = 10;
sOcarinaButtonAEnvB = 10; sOcarinaButtonAEnvB = 10;
@ -300,6 +313,7 @@ void Message_DrawTextChar(PlayState* play, void* textureImage, Gfx** p) {
Gfx* gfx = *p; Gfx* gfx = *p;
s16 x = msgCtx->textPosX; s16 x = msgCtx->textPosX;
s16 y = msgCtx->textPosY; s16 y = msgCtx->textPosY;
s32 pad;
gDPPipeSync(gfx++); gDPPipeSync(gfx++);
@ -2448,20 +2462,47 @@ void Message_OpenText(PlayState* play, u16 textId) {
if (sTextIsCredits) { if (sTextIsCredits) {
Message_FindCreditsMessage(play, textId); Message_FindCreditsMessage(play, textId);
msgCtx->msgLength = font->msgLength; msgCtx->msgLength = font->msgLength;
#if PLATFORM_N64
if ((B_80121220 != NULL) && (B_80121220->unk_60 != NULL) && B_80121220->unk_60(&play->msgCtx.font)) {
} else {
DmaMgr_RequestSync(font->msgBuf, (uintptr_t)_staff_message_data_staticSegmentRomStart + font->msgOffset,
font->msgLength);
}
#else
DMA_REQUEST_SYNC(font->msgBuf, (uintptr_t)_staff_message_data_staticSegmentRomStart + font->msgOffset, DMA_REQUEST_SYNC(font->msgBuf, (uintptr_t)_staff_message_data_staticSegmentRomStart + font->msgOffset,
font->msgLength, "../z_message_PAL.c", 1954); font->msgLength, "../z_message_PAL.c", 1954);
#endif
} else { } else {
#if OOT_NTSC #if OOT_NTSC
if (gSaveContext.language == LANGUAGE_JPN) { if (gSaveContext.language == LANGUAGE_JPN) {
Message_FindMessageJPN(play, textId); Message_FindMessageJPN(play, textId);
msgCtx->msgLength = font->msgLength; msgCtx->msgLength = font->msgLength;
#if PLATFORM_N64
if ((B_80121220 != NULL) && (B_80121220->unk_64 != NULL) && B_80121220->unk_64(&play->msgCtx.font)) {
} else {
DmaMgr_RequestSync(font->msgBuf, (uintptr_t)_jpn_message_data_staticSegmentRomStart + font->msgOffset,
font->msgLength);
}
#else
DmaMgr_RequestSync(font->msgBuf, (uintptr_t)_jpn_message_data_staticSegmentRomStart + font->msgOffset, DmaMgr_RequestSync(font->msgBuf, (uintptr_t)_jpn_message_data_staticSegmentRomStart + font->msgOffset,
font->msgLength); font->msgLength);
#endif
} else { } else {
Message_FindMessageNES(play, textId); Message_FindMessageNES(play, textId);
msgCtx->msgLength = font->msgLength; msgCtx->msgLength = font->msgLength;
#if PLATFORM_N64
if ((B_80121220 != NULL) && (B_80121220->unk_68 != NULL) && B_80121220->unk_68(&play->msgCtx.font)) {
} else {
DmaMgr_RequestSync(font->msgBuf, (uintptr_t)_nes_message_data_staticSegmentRomStart + font->msgOffset,
font->msgLength);
}
#else
DmaMgr_RequestSync(font->msgBuf, (uintptr_t)_nes_message_data_staticSegmentRomStart + font->msgOffset, DmaMgr_RequestSync(font->msgBuf, (uintptr_t)_nes_message_data_staticSegmentRomStart + font->msgOffset,
font->msgLength); font->msgLength);
#endif
} }
#else #else
if (gSaveContext.language == LANGUAGE_ENG) { if (gSaveContext.language == LANGUAGE_ENG) {
@ -2543,6 +2584,9 @@ void Message_StartTextbox(PlayState* play, u16 textId, Actor* actor) {
void Message_ContinueTextbox(PlayState* play, u16 textId) { void Message_ContinueTextbox(PlayState* play, u16 textId) {
s32 pad; s32 pad;
MessageContext* msgCtx = &play->msgCtx; MessageContext* msgCtx = &play->msgCtx;
#if PLATFORM_N64
s32 pad2[3];
#endif
PRINTF(VT_FGCOL(GREEN)); PRINTF(VT_FGCOL(GREEN));
// "Message" // "Message"
@ -2794,13 +2838,9 @@ void Message_SetView(View* view) {
} }
#if OOT_NTSC #if OOT_NTSC
#define DRAW_TEXT(play, gfx, isCredits) \ #define DRAW_TEXT(play, gfx, isCredits) \
if (gSaveContext.language == LANGUAGE_JPN && !(isCredits)) { \ ((gSaveContext.language == LANGUAGE_JPN) && !(isCredits)) ? Message_DrawTextWide(play, gfx) \
Message_DrawTextWide(play, gfx); \ : Message_DrawText(play, gfx)
} else { \
Message_DrawText(play, gfx); \
} \
(void)0
#else #else
#define DRAW_TEXT(play, gfx, isCredits) Message_DrawText(play, gfx) #define DRAW_TEXT(play, gfx, isCredits) Message_DrawText(play, gfx)
#endif #endif
@ -3018,7 +3058,6 @@ void Message_DrawMain(PlayState* play, Gfx** p) {
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb); &gSfxDefaultReverb);
} }
if (msgCtx->ocarinaStaff == NULL) {} // fake
Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_NOTHING); Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_NOTHING);
} else { } else {
AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF); AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF);
@ -4239,4 +4278,10 @@ void Message_SetTables(void) {
#endif #endif
sStaffMessageEntryTablePtr = sStaffMessageEntryTable; sStaffMessageEntryTablePtr = sStaffMessageEntryTable;
#if PLATFORM_N64
if ((B_80121220 != NULL) && (B_80121220->unk_58 != NULL)) {
B_80121220->unk_58(&sJpnMessageEntryTablePtr, &sNesMessageEntryTablePtr, &sStaffMessageEntryTablePtr);
}
#endif
} }

View file

@ -1,6 +1,6 @@
#include "global.h" #include "global.h"
#pragma increment_block_number "gc-eu:128 gc-eu-mq:128" #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"
MtxF gSkinLimbMatrices[60]; // holds matrices for each limb of the skeleton currently being drawn MtxF gSkinLimbMatrices[60]; // holds matrices for each limb of the skeleton currently being drawn

View file

@ -438,7 +438,7 @@ void KaleidoScope_DrawWorldMap(PlayState* play, GraphicsContext* gfxCtx) {
24, // WORLD_MAP_AREA_DEATH_MOUNTAIN_CRATER 24, // WORLD_MAP_AREA_DEATH_MOUNTAIN_CRATER
11, // WORLD_MAP_AREA_GORON_CITY 11, // WORLD_MAP_AREA_GORON_CITY
-17, // WORLD_MAP_AREA_LON_LON_RANCH -17, // WORLD_MAP_AREA_LON_LON_RANCH
37, // WORLD_MAP_AREA_20 37, // WORLD_MAP_AREA_QUESTION_MARK
-6, // WORLD_MAP_AREA_GANONS_CASTLE -6, // WORLD_MAP_AREA_GANONS_CASTLE
}; };
static s16 areaBoxWidths[] = { static s16 areaBoxWidths[] = {
@ -462,7 +462,7 @@ void KaleidoScope_DrawWorldMap(PlayState* play, GraphicsContext* gfxCtx) {
32, // WORLD_MAP_AREA_DEATH_MOUNTAIN_CRATER 32, // WORLD_MAP_AREA_DEATH_MOUNTAIN_CRATER
32, // WORLD_MAP_AREA_GORON_CITY 32, // WORLD_MAP_AREA_GORON_CITY
32, // WORLD_MAP_AREA_LON_LON_RANCH 32, // WORLD_MAP_AREA_LON_LON_RANCH
16, // WORLD_MAP_AREA_20 16, // WORLD_MAP_AREA_QUESTION_MARK
32, // WORLD_MAP_AREA_GANONS_CASTLE 32, // WORLD_MAP_AREA_GANONS_CASTLE
}; };
static s16 areaBoxPosY[] = { static s16 areaBoxPosY[] = {
@ -486,7 +486,7 @@ void KaleidoScope_DrawWorldMap(PlayState* play, GraphicsContext* gfxCtx) {
58, // WORLD_MAP_AREA_DEATH_MOUNTAIN_CRATER 58, // WORLD_MAP_AREA_DEATH_MOUNTAIN_CRATER
56, // WORLD_MAP_AREA_GORON_CITY 56, // WORLD_MAP_AREA_GORON_CITY
12, // WORLD_MAP_AREA_LON_LON_RANCH 12, // WORLD_MAP_AREA_LON_LON_RANCH
36, // WORLD_MAP_AREA_20 36, // WORLD_MAP_AREA_QUESTION_MARK
50, // WORLD_MAP_AREA_GANONS_CASTLE 50, // WORLD_MAP_AREA_GANONS_CASTLE
}; };
static s16 areaBoxHeights[] = { static s16 areaBoxHeights[] = {
@ -510,7 +510,7 @@ void KaleidoScope_DrawWorldMap(PlayState* play, GraphicsContext* gfxCtx) {
13, // WORLD_MAP_AREA_DEATH_MOUNTAIN_CRATER 13, // WORLD_MAP_AREA_DEATH_MOUNTAIN_CRATER
17, // WORLD_MAP_AREA_GORON_CITY 17, // WORLD_MAP_AREA_GORON_CITY
17, // WORLD_MAP_AREA_LON_LON_RANCH 17, // WORLD_MAP_AREA_LON_LON_RANCH
16, // WORLD_MAP_AREA_20 16, // WORLD_MAP_AREA_QUESTION_MARK
17, // WORLD_MAP_AREA_GANONS_CASTLE 17, // WORLD_MAP_AREA_GANONS_CASTLE
}; };
static void* areaBoxTexs[] = { static void* areaBoxTexs[] = {
@ -534,7 +534,7 @@ void KaleidoScope_DrawWorldMap(PlayState* play, GraphicsContext* gfxCtx) {
gWorldMapAreaBox4Tex, // WORLD_MAP_AREA_DEATH_MOUNTAIN_CRATER gWorldMapAreaBox4Tex, // WORLD_MAP_AREA_DEATH_MOUNTAIN_CRATER
gWorldMapAreaBox3Tex, // WORLD_MAP_AREA_GORON_CITY gWorldMapAreaBox3Tex, // WORLD_MAP_AREA_GORON_CITY
gWorldMapAreaBox3Tex, // WORLD_MAP_AREA_LON_LON_RANCH gWorldMapAreaBox3Tex, // WORLD_MAP_AREA_LON_LON_RANCH
gWorldMapAreaBox8Tex, // WORLD_MAP_AREA_20 gWorldMapAreaBox8Tex, // WORLD_MAP_AREA_QUESTION_MARK
gWorldMapAreaBox3Tex, // WORLD_MAP_AREA_GANONS_CASTLE gWorldMapAreaBox3Tex, // WORLD_MAP_AREA_GANONS_CASTLE
}; };
static void* currentPosTitleTexs[] = LANGUAGE_ARRAY(gPauseCurrentPositionJPNTex, gPauseCurrentPositionENGTex, static void* currentPosTitleTexs[] = LANGUAGE_ARRAY(gPauseCurrentPositionJPNTex, gPauseCurrentPositionENGTex,

View file

@ -2458,7 +2458,7 @@ static s16 sVtxMapWorldAreaX[] = {
13, // WORLD_MAP_AREA_DEATH_MOUNTAIN_CRATER 13, // WORLD_MAP_AREA_DEATH_MOUNTAIN_CRATER
20, // WORLD_MAP_AREA_GORON_CITY 20, // WORLD_MAP_AREA_GORON_CITY
-34, // WORLD_MAP_AREA_LON_LON_RANCH -34, // WORLD_MAP_AREA_LON_LON_RANCH
-300, // WORLD_MAP_AREA_20 -300, // WORLD_MAP_AREA_QUESTION_MARK
0, // WORLD_MAP_AREA_GANONS_CASTLE 0, // WORLD_MAP_AREA_GANONS_CASTLE
}; };
@ -2483,7 +2483,7 @@ static s16 sVtxMapWorldAreaWidth[] = {
21, // WORLD_MAP_AREA_DEATH_MOUNTAIN_CRATER 21, // WORLD_MAP_AREA_DEATH_MOUNTAIN_CRATER
16, // WORLD_MAP_AREA_GORON_CITY 16, // WORLD_MAP_AREA_GORON_CITY
20, // WORLD_MAP_AREA_LON_LON_RANCH 20, // WORLD_MAP_AREA_LON_LON_RANCH
-1, // WORLD_MAP_AREA_20 -1, // WORLD_MAP_AREA_QUESTION_MARK
0, // WORLD_MAP_AREA_GANONS_CASTLE 0, // WORLD_MAP_AREA_GANONS_CASTLE
}; };
@ -2508,7 +2508,7 @@ static s16 sVtxMapWorldAreaY[] = {
53, // WORLD_MAP_AREA_DEATH_MOUNTAIN_CRATER 53, // WORLD_MAP_AREA_DEATH_MOUNTAIN_CRATER
37, // WORLD_MAP_AREA_GORON_CITY 37, // WORLD_MAP_AREA_GORON_CITY
-13, // WORLD_MAP_AREA_LON_LON_RANCH -13, // WORLD_MAP_AREA_LON_LON_RANCH
-300, // WORLD_MAP_AREA_20 -300, // WORLD_MAP_AREA_QUESTION_MARK
0, // WORLD_MAP_AREA_GANONS_CASTLE 0, // WORLD_MAP_AREA_GANONS_CASTLE
}; };
@ -2533,7 +2533,7 @@ static s16 sVtxMapWorldAreaHeight[] = {
15, // WORLD_MAP_AREA_DEATH_MOUNTAIN_CRATER 15, // WORLD_MAP_AREA_DEATH_MOUNTAIN_CRATER
13, // WORLD_MAP_AREA_GORON_CITY 13, // WORLD_MAP_AREA_GORON_CITY
12, // WORLD_MAP_AREA_LON_LON_RANCH 12, // WORLD_MAP_AREA_LON_LON_RANCH
1, // WORLD_MAP_AREA_20 1, // WORLD_MAP_AREA_QUESTION_MARK
0, // WORLD_MAP_AREA_GANONS_CASTLE 0, // WORLD_MAP_AREA_GANONS_CASTLE
}; };