diff --git a/include/translation.h b/include/translation.h index 6583326701..d736c0ef94 100644 --- a/include/translation.h +++ b/include/translation.h @@ -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 diff --git a/src/code/z_elf_message.c b/src/code/z_elf_message.c index bb93099363..0bbb625065 100644 --- a/src/code/z_elf_message.c +++ b/src/code/z_elf_message.c @@ -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); } diff --git a/src/code/z_play.c b/src/code/z_play.c index d4d28422c3..87d344b13f 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -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; diff --git a/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c b/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c index a92c226117..335a1db7b3 100644 --- a/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c +++ b/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c @@ -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) { diff --git a/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c b/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c index 953e0a333c..2bdad53fd7 100644 --- a/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c +++ b/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c @@ -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) { diff --git a/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c b/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c index 100b8c20c1..fe300882ca 100644 --- a/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c +++ b/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c @@ -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) { diff --git a/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c b/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c index 2a79aef458..e6f118891c 100644 --- a/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c +++ b/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c @@ -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]); diff --git a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c index 1c74a38432..7934860fe6 100644 --- a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c +++ b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c @@ -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)); } diff --git a/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c b/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c index f6beb6cc82..3a1570c1a8 100644 --- a/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c +++ b/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c @@ -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; } diff --git a/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.c b/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.c index 2dca261b93..2c36f41a37 100644 --- a/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.c +++ b/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.c @@ -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); diff --git a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c index b89838083f..3f9d04843c 100644 --- a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c +++ b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c @@ -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); }