mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-05 23:44:53 +00:00
[ntsc-1.2] Match z_message.c (#2098)
* match Message_ResetOcarinaNoteState, Message_DrawTextChar * match Message_OpenText * Match Message_SetTables * Match Message_StartTextbox * forgor #if * format * match Message_DrawMain (ty inspect) * review
This commit is contained in:
parent
8153c952f6
commit
376f9852d0
2 changed files with 63 additions and 12 deletions
|
@ -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*);
|
||||||
|
|
|
@ -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:128 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:128 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;
|
||||||
|
@ -192,9 +205,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;
|
||||||
|
@ -298,6 +311,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++);
|
||||||
|
|
||||||
|
@ -2446,20 +2460,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_80121AF0 != NULL) && (B_80121AF0->unk_60 != NULL) && B_80121AF0->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_80121AF0 != NULL) && (B_80121AF0->unk_64 != NULL) && B_80121AF0->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_80121AF0 != NULL) && (B_80121AF0->unk_68 != NULL) && B_80121AF0->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) {
|
||||||
|
@ -2541,6 +2582,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"
|
||||||
|
@ -2792,13 +2836,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
|
||||||
|
@ -3016,7 +3056,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);
|
||||||
|
@ -4237,4 +4276,10 @@ void Message_SetTables(void) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
sStaffMessageEntryTablePtr = sStaffMessageEntryTable;
|
sStaffMessageEntryTablePtr = sStaffMessageEntryTable;
|
||||||
|
|
||||||
|
#if PLATFORM_N64
|
||||||
|
if ((B_80121AF0 != NULL) && (B_80121AF0->unk_58 != NULL)) {
|
||||||
|
B_80121AF0->unk_58(&sJpnMessageEntryTablePtr, &sNesMessageEntryTablePtr, &sStaffMessageEntryTablePtr);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue