Add and use LOG_STRING_T()

This commit is contained in:
Dragorn421 2025-06-02 07:54:35 +02:00
parent 83d225ce2c
commit a695afd730
No known key found for this signature in database
GPG Key ID: 381AEBAF3D429335
11 changed files with 26 additions and 22 deletions

View File

@ -13,4 +13,7 @@
*/
#define T(jp, en) jp
// Note: need to also include debug.h if using this macro
#define LOG_STRING_T(stringJP, stringEN, file, line) LOG(#stringJP, stringJP, "%s", file, line)
#endif

View File

@ -1,5 +1,6 @@
#include "libu64/debug.h"
#include "rand.h"
#include "translation.h"
#include "z64play.h"
#include "z64player.h"
#include "z64quest_hint.h"
@ -73,7 +74,7 @@ u32 QuestHint_CheckCondition(QuestHintCmd* hintCmd) {
}
}
LOG_STRING("企画外 条件", "../z_elf_message.c", 156); // "Unplanned conditions"
LOG_STRING_T("企画外 条件", "Unplanned conditions", "../z_elf_message.c", 156);
ASSERT(0, "0", "../z_elf_message.c", 157);
return false;
@ -170,7 +171,7 @@ u16 QuestHint_GetTextIdFromScript(QuestHintCmd* hintCmd) {
return hintCmd->byte2 | 0x100;
default:
LOG_STRING("企画外 条件", "../z_elf_message.c", 281); // "Unplanned conditions"
LOG_STRING_T("企画外 条件", "Unplanned conditions", "../z_elf_message.c", 281);
ASSERT(0, "0", "../z_elf_message.c", 282);
}

View File

@ -895,8 +895,8 @@ void Play_Update(PlayState* this) {
this->envCtx.sandstormState = SANDSTORM_DISSIPATE;
this->envCtx.sandstormPrimA = 255;
this->envCtx.sandstormEnvA = 255;
// "It's here!!!!!!!!!"
LOG_STRING("来た!!!!!!!!!!!!!!!!!!!!!", "../z_play.c", 3471);
LOG_STRING_T("来た!!!!!!!!!!!!!!!!!!!!!", "It's here!!!!!!!!!!!!!!!!!!!!!", "../z_play.c",
3471);
this->transitionMode = TRANS_MODE_SANDSTORM_END;
} else {
this->transitionMode = TRANS_MODE_SANDSTORM_INIT;

View File

@ -13,6 +13,7 @@
#include "ichain.h"
#include "sfx.h"
#include "sys_matrix.h"
#include "translation.h"
#include "z_lib.h"
#include "z64play.h"
@ -64,7 +65,7 @@ void ArrowFire_Init(Actor* thisx, PlayState* play) {
void ArrowFire_Destroy(Actor* thisx, PlayState* play) {
Magic_Reset(play);
LOG_STRING("消滅", "../z_arrow_fire.c", 421); // "Disappearance"
LOG_STRING_T("消滅", "Disappearance", "../z_arrow_fire.c", 421);
}
void ArrowFire_Charge(ArrowFire* this, PlayState* play) {

View File

@ -13,6 +13,7 @@
#include "ichain.h"
#include "sfx.h"
#include "sys_matrix.h"
#include "translation.h"
#include "z_lib.h"
#include "z64play.h"
@ -64,7 +65,7 @@ void ArrowIce_Init(Actor* thisx, PlayState* play) {
void ArrowIce_Destroy(Actor* thisx, PlayState* play) {
Magic_Reset(play);
LOG_STRING("消滅", "../z_arrow_ice.c", 415); // "Disappearance"
LOG_STRING_T("消滅", "Disappearance", "../z_arrow_ice.c", 415);
}
void ArrowIce_Charge(ArrowIce* this, PlayState* play) {

View File

@ -13,6 +13,7 @@
#include "ichain.h"
#include "sfx.h"
#include "sys_matrix.h"
#include "translation.h"
#include "z_lib.h"
#include "z64play.h"
@ -64,7 +65,7 @@ void ArrowLight_Init(Actor* thisx, PlayState* play) {
void ArrowLight_Destroy(Actor* thisx, PlayState* play) {
Magic_Reset(play);
LOG_STRING("消滅", "../z_arrow_light.c", 403); // "Disappearance"
LOG_STRING_T("消滅", "Disappearance", "../z_arrow_light.c", 403);
}
void ArrowLight_Charge(ArrowLight* this, PlayState* play) {

View File

@ -14,6 +14,7 @@
#include "sequence.h"
#include "sfx.h"
#include "sys_matrix.h"
#include "translation.h"
#include "z_lib.h"
#include "z64audio.h"
#include "z64effect.h"
@ -267,8 +268,7 @@ void DemoKekkai_TrialBarrierIdle(Actor* thisx, PlayState* play) {
CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider1.base);
if (this->collider2.base.acFlags & AC_HIT) {
Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME);
// "I got it"
LOG_STRING("当ったよ", "../z_demo_kekkai.c", 572);
LOG_STRING_T("当ったよ", "I got it", "../z_demo_kekkai.c", 572);
this->actor.update = DemoKekkai_TrialBarrierDispel;
this->timer = 0;
play->csCtx.script = SEGMENTED_TO_VIRTUAL(sSageCutscenes[this->actor.params]);

View File

@ -64,14 +64,14 @@ void ElfMsg_SetupAction(ElfMsg* this, ElfMsgActionFunc actionFunc) {
s32 ElfMsg_KillCheck(ElfMsg* this, PlayState* play) {
if ((this->actor.world.rot.y > 0) && (this->actor.world.rot.y < 0x41) &&
Flags_GetSwitch(play, this->actor.world.rot.y - 1)) {
LOG_STRING("共倒れ", "../z_elf_msg.c", 161); // "Mutual destruction"
LOG_STRING_T("共倒れ", "Mutual destruction", "../z_elf_msg.c", 161);
if (PARAMS_GET_U(this->actor.params, 8, 6) != 0x3F) {
Flags_SetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6));
}
Actor_Kill(&this->actor);
return 1;
} else if ((this->actor.world.rot.y == -1) && Flags_GetClear(play, this->actor.room)) {
LOG_STRING("共倒れ", "../z_elf_msg.c", 172); // "Mutual destruction"
LOG_STRING_T("共倒れ", "Mutual destruction", "../z_elf_msg.c", 172);
if (PARAMS_GET_U(this->actor.params, 8, 6) != 0x3F) {
Flags_SetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6));
}

View File

@ -14,6 +14,7 @@
#include "regs.h"
#include "sys_matrix.h"
#include "terminal.h"
#include "translation.h"
#include "z64play.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
@ -61,14 +62,14 @@ void ElfMsg2_SetupAction(ElfMsg2* this, ElfMsg2ActionFunc actionFunc) {
s32 ElfMsg2_KillCheck(ElfMsg2* this, PlayState* play) {
if ((this->actor.world.rot.y > 0) && (this->actor.world.rot.y < 0x41) &&
Flags_GetSwitch(play, this->actor.world.rot.y - 1)) {
LOG_STRING("共倒れ", "../z_elf_msg2.c", 171); // "Mutual destruction"
LOG_STRING_T("共倒れ", "Mutual destruction", "../z_elf_msg2.c", 171);
if (PARAMS_GET_U(this->actor.params, 8, 6) != 0x3F) {
Flags_SetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6));
}
Actor_Kill(&this->actor);
return 1;
} else if ((this->actor.world.rot.y == -1) && Flags_GetClear(play, this->actor.room)) {
LOG_STRING("共倒れ2", "../z_elf_msg2.c", 182); // "Mutual destruction 2"
LOG_STRING_T("共倒れ2", "Mutual destruction 2", "../z_elf_msg2.c", 182);
if (PARAMS_GET_U(this->actor.params, 8, 6) != 0x3F) {
Flags_SetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6));
}
@ -77,7 +78,7 @@ s32 ElfMsg2_KillCheck(ElfMsg2* this, PlayState* play) {
} else if (PARAMS_GET_U(this->actor.params, 8, 6) == 0x3F) {
return 0;
} else if (Flags_GetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6))) {
LOG_STRING("共倒れ", "../z_elf_msg2.c", 192); // "Mutual destruction"
LOG_STRING_T("共倒れ", "Mutual destruction", "../z_elf_msg2.c", 192);
Actor_Kill(&this->actor);
return 1;
}

View File

@ -69,8 +69,7 @@ void MagicWind_Init(Actor* thisx, PlayState* play) {
case 1:
SkelCurve_SetAnim(&this->skelCurve, &sAnim, 60.0f, 0.0f, 60.0f, -1.0f);
MagicWind_SetupAction(this, MagicWind_Shrink);
// "Means start"
LOG_STRING("表示開始", "../z_magic_wind.c", 486);
LOG_STRING_T("表示開始", "Start displaying", "../z_magic_wind.c", 486);
Player_PlaySfx(player, NA_SE_PL_MAGIC_WIND_WARP);
break;
}
@ -80,8 +79,7 @@ void MagicWind_Destroy(Actor* thisx, PlayState* play) {
MagicWind* this = (MagicWind*)thisx;
SkelCurve_Destroy(play, &this->skelCurve);
Magic_Reset(play);
// "wipe out"
LOG_STRING("消滅", "../z_magic_wind.c", 505);
LOG_STRING_T("消滅", "Disappearance", "../z_magic_wind.c", 505);
}
void MagicWind_UpdateAlpha(f32 alpha) {
@ -100,8 +98,7 @@ void MagicWind_WaitForTimer(MagicWind* this, PlayState* play) {
return;
}
// "Means start"
LOG_STRING("表示開始", "../z_magic_wind.c", 539);
LOG_STRING_T("表示開始", "Start displaying", "../z_magic_wind.c", 539);
Player_PlaySfx(player, NA_SE_PL_MAGIC_WIND_NORMAL);
MagicWind_UpdateAlpha(1.0f);
MagicWind_SetupAction(this, MagicWind_Grow);

View File

@ -186,8 +186,7 @@ void MirRay_Init(Actor* thisx, PlayState* play) {
LOG_NUM("this->actor.arg_data", this->actor.params, "../z_mir_ray.c", 518);
if (this->actor.params >= 0xA) {
// "Reflected light generation failure"
LOG_STRING("反射光 発生失敗", "../z_mir_ray.c", 521);
LOG_STRING_T("反射光 発生失敗", "Reflected light generation failure", "../z_mir_ray.c", 521);
Actor_Kill(&this->actor);
}