Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer

This commit is contained in:
gymnast86
2026-07-21 00:57:59 -07:00
75 changed files with 3708 additions and 646 deletions
+13
View File
@@ -6,6 +6,8 @@
#include "Z2AudioLib/Z2LinkMgr.h"
#include <cstring>
#include "dusk/version.hpp"
Z2SoundObjMgr::Z2SoundObjMgr() : JASGlobalInstance<Z2SoundObjMgr>(true) {
ghostEnemyState_ = 0;
twilightBattle_ = 0;
@@ -180,6 +182,13 @@ void Z2SoundObjMgr::searchEnemy() {
case Z2_ENEMY_PO:
case Z2_ENEMY_HP:
isGhostEnemy = true;
#if TARGET_PC
if (enemyId == Z2_ENEMY_HP && dusk::version::isRegionJpn() &&
Z2GetLink()->isRiding() && Z2GetLink()->getMoveSpeed() > 38)
{
continue;
}
#endif
break;
case Z2_ENEMY_RDB:
if (subBgmType == 0)
@@ -207,6 +216,10 @@ void Z2SoundObjMgr::searchEnemy() {
case Z2_ENEMY_RD:
case Z2_ENEMY_SH:
case Z2_ENEMY_HP:
#elif TARGET_PC
case Z2_ENEMY_SH:
if (enemyId == Z2_ENEMY_SH && !dusk::version::isRegionJpn())
break;
#endif
if (!Z2GetLink()->isRiding())
break;
+10 -3
View File
@@ -28,6 +28,7 @@
#include "dusk/settings.h"
#include "dusk/speedrun.h"
#include "dusk/randomizer/game/randomizer_context.hpp"
#include "dusk/version.hpp"
#endif
BOOL daAlink_c::checkEventRun() const {
@@ -4696,8 +4697,10 @@ void daAlink_c::checkWarpStart() {
if (dMeter2Info_getWarpStatus() == WARP_STATUS_DECIDED_e ||
dComIfGp_event_compulsory(this, 0, 0xFFFF))
{
#if VERSION != VERSION_GCN_JPN && VERSION != VERSION_SHIELD_DEBUG
#if TARGET_PC || (VERSION != VERSION_GCN_JPN && VERSION != VERSION_SHIELD_DEBUG)
IF_DUSK_BLOCK(!dusk::version::isRegionJpn())
onNoResetFlg0(FLG0_UNK_4000);
IF_DUSK_BLOCK_END
#endif
if (dMeter2Info_getWarpStatus() == WARP_STATUS_DECIDED_e) {
@@ -4725,8 +4728,10 @@ void daAlink_c::checkWarpStart() {
fopAcM_orderOtherEvent(this, portal, 0xFFFF, 1, 1);
} else {
mDemo.setSpecialDemoType();
#if VERSION == VERSION_GCN_JPN || VERSION == VERSION_SHIELD_DEBUG
#if TARGET_PC || (VERSION == VERSION_GCN_JPN || VERSION == VERSION_SHIELD_DEBUG)
IF_DUSK_BLOCK(dusk::version::isRegionJpn())
onNoResetFlg0(FLG0_UNK_4000);
IF_DUSK_BLOCK_END
#endif
if (dMeter2Info_getWarpStatus() == 1) {
@@ -4810,10 +4815,12 @@ int daAlink_c::procCoWarpInit(int param_0, int param_1) {
soundId = Z2SE_WOLF_WARP_IN_TATE;
}
#if VERSION == VERSION_GCN_JPN || VERSION == VERSION_SHIELD_DEBUG
#if TARGET_PC || (VERSION == VERSION_GCN_JPN || VERSION == VERSION_SHIELD_DEBUG)
IF_DUSK_BLOCK(dusk::version::isRegionJpn())
if (param_1) {
onNoResetFlg0(FLG0_UNK_4000);
}
IF_DUSK_BLOCK_END
#endif
if (param_1) {
+4 -1
View File
@@ -24,6 +24,7 @@
#if TARGET_PC
#include "dusk/randomizer/game/randomizer_context.hpp"
#include "dusk/randomizer/game/tools.h"
#include "dusk/version.hpp"
#endif
class daE_MK_HIO_c : public JORReflexible {
@@ -617,8 +618,10 @@ static void e_mk_shoot(e_mk_class* i_this) {
i_this->sound.startCreatureVoice(Z2SE_EN_MK_V_CATCH_BOOM, -1);
i_this->sound.startCreatureSound(Z2SE_EN_MK_CATCH_BOOM, 0, -1);
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC || VERSION == VERSION_GCN_JPN
IF_DUSK_BLOCK(dusk::version::isRegionJpn())
return;
IF_DUSK_BLOCK_END
#endif
}
}
+7 -4
View File
@@ -5,12 +5,13 @@
#include "d/dolzel_rel.h" // IWYU pragma: keep
#include "d/actor/d_a_e_mk_bo.h"
#include "Z2AudioLib/Z2Instances.h"
#include "c/c_damagereaction.h"
#include "d/actor/d_a_e_mk.h"
#include "d/actor/d_a_e_mk_bo.h"
#include "d/actor/d_a_player.h"
#include "d/d_s_play.h"
#include "c/c_damagereaction.h"
#include "Z2AudioLib/Z2Instances.h"
#include "dusk/version.hpp"
static int daE_MK_BO_Draw(e_mk_bo_class* i_this) {
if (i_this->field_0x9b4 != 0) {
@@ -569,8 +570,10 @@ static int daE_MK_BO_Execute(e_mk_bo_class* i_this) {
if (i_this->field_0x600 != 0) {
fopAcM_delete(actor);
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC || VERSION == VERSION_GCN_JPN
IF_DUSK_BLOCK(dusk::version::isRegionJpn())
return 1;
IF_DUSK_BLOCK_END
#endif
}
+5 -2
View File
@@ -3,9 +3,10 @@
*
*/
#include "d/dolzel_rel.h" // IWYU pragma: keep
#include "d/actor/d_a_e_mm_mt.h"
#include "d/d_cc_d.h"
#include "d/dolzel_rel.h" // IWYU pragma: keep
#include "dusk/version.hpp"
#include "f_op/f_op_actor_enemy.h"
static int daE_MM_MT_Draw(e_mm_mt_class* i_this) {
@@ -802,7 +803,9 @@ static int daE_MM_MT_Create(fopAc_ac_c* i_this) {
if (i_this->argument == 1) {
fopAcM_OffStatus(i_this, 0x80000);
helmasaurShell->m_sphere.SetAtType(
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
dusk::version::isRegionJpn() ? AT_TYPE_CSTATUE_SWING : 0xD8FBBDFF
#elif VERSION == VERSION_GCN_JPN
AT_TYPE_CSTATUE_SWING
#else
0xD8FBBDFF
+4 -1
View File
@@ -19,6 +19,7 @@
#include "d/actor/d_a_obj_smw_stone.h"
#include "f_op/f_op_actor_enemy.h"
#include "f_op/f_op_camera_mng.h"
#include "dusk/version.hpp"
class daE_PM_HIO_c {
public:
@@ -816,10 +817,12 @@ void daE_PM_c::DemoBeforeEscape() {
for (int i = 0; i < 4; i++) {
e_fs_class* puppet;
if (fopAcM_SearchByID(mPuppetID[i], (fopAc_ac_c**)&puppet)) {
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC || VERSION == VERSION_GCN_JPN
IF_DUSK_BLOCK(dusk::version::isRegionJpn())
if (puppet == NULL) {
continue;
}
IF_DUSK_BLOCK_END
#endif
puppet->mAction = e_fs_class::ACT_END;
puppet->mMode = 0;
+6 -6
View File
@@ -18,9 +18,9 @@
using GameVersion = dusk::version::GameVersion;
// keep the original version of the cape texture const so we don't need to reload the file
static u8 const * l_Egnd_mantTEX_get() { alignas(32) static u8 buf[0x4000]; static bool _ = (dusk::LoadRelAsset(buf, "/rel/Final/Release/d_a_mant.rel", {{GameVersion::GcnUsa, 0x1C00}, {GameVersion::GcnPal, 0x1C00}}, 0x4000), true); return buf; }
static u8* l_Egnd_mantTEX_U_get() { alignas(32) static u8 buf[0x4000]; static bool _ = (dusk::LoadRelAsset(buf, "/rel/Final/Release/d_a_mant.rel", {{GameVersion::GcnUsa, 0x5C00}, {GameVersion::GcnPal, 0x5C00}}, 0x4000), true); return buf; }
static u8* l_Egnd_mantPAL_get() { alignas(32) static u8 buf[0x60]; static bool _ = (dusk::LoadRelAsset(buf, "/rel/Final/Release/d_a_mant.rel", {{GameVersion::GcnUsa, 0x9C00}, {GameVersion::GcnPal, 0x9C00}}, 0x60), true); return buf; }
static u8 const * l_Egnd_mantTEX_get() { alignas(32) static u8 buf[0x4000]; static bool _ = (dusk::LoadRelAsset(buf, "/rel/Final/Release/d_a_mant.rel", {{GameVersion::GcnUsa, 0x1C00}, {GameVersion::GcnPal, 0x1C00}, {GameVersion::GcnJpn, 0x1C00}}, 0x4000), true); return buf; }
static u8* l_Egnd_mantTEX_U_get() { alignas(32) static u8 buf[0x4000]; static bool _ = (dusk::LoadRelAsset(buf, "/rel/Final/Release/d_a_mant.rel", {{GameVersion::GcnUsa, 0x5C00}, {GameVersion::GcnPal, 0x5C00}, {GameVersion::GcnJpn, 0x5C00}}, 0x4000), true); return buf; }
static u8* l_Egnd_mantPAL_get() { alignas(32) static u8 buf[0x60]; static bool _ = (dusk::LoadRelAsset(buf, "/rel/Final/Release/d_a_mant.rel", {{GameVersion::GcnUsa, 0x9C00}, {GameVersion::GcnPal, 0x9C00}, {GameVersion::GcnJpn, 0x9C00}}, 0x60), true); return buf; }
#define l_Egnd_mantTEX (l_Egnd_mantTEX_get())
#define l_Egnd_mantTEX_U (l_Egnd_mantTEX_U_get())
#define l_Egnd_mantPAL (l_Egnd_mantPAL_get())
@@ -36,8 +36,8 @@ static TGXTexObj undersideTexObj;
// l_pos is unused
//static f32* l_pos_get() { alignas(32) static f32 buf[507]; static bool _ = (dusk::LoadRelAsset(buf, "/rel/Final/Release/d_a_mant.rel", {{GameVersion::GcnUsa, 0xA44C}, {GameVersion::GcnPal, 0xA44C}}, sizeof(buf)), true); return buf; }
static f32* l_normal_get() { alignas(32) static f32 buf[3]; static bool _ = (dusk::LoadRelAsset(buf, "/rel/Final/Release/d_a_mant.rel", {{GameVersion::GcnUsa, 0x9C60}, {GameVersion::GcnPal, 0x9C60}}, sizeof(buf)), true); return buf; }
static f32* l_texCoord_get() { alignas(32) static f32 buf[338]; static bool _ = (dusk::LoadRelAsset(buf, "/rel/Final/Release/d_a_mant.rel", {{GameVersion::GcnUsa, 0xA458}, {GameVersion::GcnPal, 0xA458}}, sizeof(buf)), true); return buf; }
static f32* l_normal_get() { alignas(32) static f32 buf[3]; static bool _ = (dusk::LoadRelAsset(buf, "/rel/Final/Release/d_a_mant.rel", {{GameVersion::GcnUsa, 0x9C60}, {GameVersion::GcnPal, 0x9C60}, {GameVersion::GcnJpn, 0x9C60}}, sizeof(buf)), true); return buf; }
static f32* l_texCoord_get() { alignas(32) static f32 buf[338]; static bool _ = (dusk::LoadRelAsset(buf, "/rel/Final/Release/d_a_mant.rel", {{GameVersion::GcnUsa, 0xA458}, {GameVersion::GcnPal, 0xA458}, {GameVersion::GcnJpn, 0xA458}}, sizeof(buf)), true); return buf; }
//#define l_pos (l_pos_get())
#define l_normal (l_normal_get())
#define l_texCoord (l_texCoord_get())
@@ -55,7 +55,7 @@ static bool l_Egnd_mantTEX_hasReplacement = false;
#if TARGET_PC
using GameVersion = dusk::version::GameVersion;
static u8* l_Egnd_mantDL_get() { alignas(32) static u8 buf[0x3EC]; static bool _ = (dusk::LoadRelAsset(buf, "/rel/Final/Release/d_a_mant.rel", {{GameVersion::GcnUsa, 0xA9A0}, {GameVersion::GcnPal, 0xA9A0}}, 0x3EC), true); return buf; }
static u8* l_Egnd_mantDL_get() { alignas(32) static u8 buf[0x3EC]; static bool _ = (dusk::LoadRelAsset(buf, "/rel/Final/Release/d_a_mant.rel", {{GameVersion::GcnUsa, 0xA9A0}, {GameVersion::GcnPal, 0xA9A0}, {GameVersion::GcnJpn, 0xA9A0}}, 0x3EC), true); return buf; }
#define l_Egnd_mantDL (l_Egnd_mantDL_get())
#else
#include "assets/l_Egnd_mantDL.h"
+7 -1
View File
@@ -1783,7 +1783,13 @@ static int daFshop_Create(fopAc_ac_c* actor) {
};
if (sp10 == 1) {
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
sp24 = dComIfGs_getEventReg(check_kind[i]);
} else {
sp24 = 2.54f * dComIfGs_getEventReg(check_kind[i]);
}
#elif VERSION == VERSION_GCN_JPN
sp24 = dComIfGs_getEventReg(check_kind[i]);
#else
sp24 = 2.54f * dComIfGs_getEventReg(check_kind[i]);
+11 -11
View File
@@ -13,7 +13,7 @@ const u16 l_J_Ohana00_64TEX__height = 63;
#if TARGET_PC
#include "dusk/dvd_asset.hpp"
using GameVersion = dusk::version::GameVersion;
static u8* l_J_Ohana00_64TEX_get() { static u8 buf[0x800]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0x9060}, {GameVersion::GcnPal, 0x9060}}, 0x800), true); return buf; }
static u8* l_J_Ohana00_64TEX_get() { static u8 buf[0x800]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0x9060}, {GameVersion::GcnPal, 0x9060}, {GameVersion::GcnJpn, 0x9060}}, 0x800), true); return buf; }
#define l_J_Ohana00_64TEX (l_J_Ohana00_64TEX_get())
// from d_grass.inc
@@ -117,10 +117,10 @@ static u8 l_flowerTexCoord[] = {
#if TARGET_PC
using GameVersion = dusk::version::GameVersion;
static u8* l_J_hana00DL_get() { static u8 buf[0x150]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0x9D20}, {GameVersion::GcnPal, 0x9D20}}, 0x150), true); return buf; }
static u8* l_J_hana00_cDL_get() { static u8 buf[0xDE]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0x9E80}, {GameVersion::GcnPal, 0x9E80}}, 0xDE), true); return buf; }
static u8* l_matDL_get() { static u8 buf[0x99]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0x9F60}, {GameVersion::GcnPal, 0x9F60}}, 0x99), true); return buf; }
static u8* l_matLight4DL_get() { static u8 buf[0x99]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0xA000}, {GameVersion::GcnPal, 0xA000}}, 0x99), true); return buf; }
static u8* l_J_hana00DL_get() { static u8 buf[0x150]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0x9D20}, {GameVersion::GcnPal, 0x9D20}, {GameVersion::GcnJpn, 0x9D20}}, 0x150), true); return buf; }
static u8* l_J_hana00_cDL_get() { static u8 buf[0xDE]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0x9E80}, {GameVersion::GcnPal, 0x9E80}, {GameVersion::GcnJpn, 0x9E80}}, 0xDE), true); return buf; }
static u8* l_matDL_get() { static u8 buf[0x99]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0x9F60}, {GameVersion::GcnPal, 0x9F60}, {GameVersion::GcnJpn, 0x9F60}}, 0x99), true); return buf; }
static u8* l_matLight4DL_get() { static u8 buf[0x99]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0xA000}, {GameVersion::GcnPal, 0xA000}, {GameVersion::GcnJpn, 0xA000}}, 0x99), true); return buf; }
#define l_J_hana00DL (l_J_hana00DL_get())
#define l_J_hana00_cDL (l_J_hana00_cDL_get())
#define l_matDL (l_matDL_get())
@@ -142,7 +142,7 @@ const u16 l_J_Ohana01_64128_0419TEX__height = 127;
#if TARGET_PC
using GameVersion = dusk::version::GameVersion;
static u8* l_J_Ohana01_64128_0419TEX_get() { static u8 buf[0x1000]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0xA0A0}, {GameVersion::GcnPal, 0xA0A0}}, 0x1000), true); return buf; }
static u8* l_J_Ohana01_64128_0419TEX_get() { static u8 buf[0x1000]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0xA0A0}, {GameVersion::GcnPal, 0xA0A0}, {GameVersion::GcnJpn, 0xA0A0}}, 0x1000), true); return buf; }
#define l_J_Ohana01_64128_0419TEX (l_J_Ohana01_64128_0419TEX_get())
#else
#include "assets/l_J_Ohana01_64128_0419TEX.h"
@@ -276,11 +276,11 @@ static u8 l_flowerTexCoord2[] = {
#if TARGET_PC
using GameVersion = dusk::version::GameVersion;
static u8* l_J_hana01DL_get() { static u8 buf[0x138]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0xB7C0}, {GameVersion::GcnPal, 0xB7C0}}, 0x138), true); return buf; }
static u8* l_J_hana01_c_00DL_get() { static u8 buf[0xDE]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0xB900}, {GameVersion::GcnPal, 0xB900}}, 0xDE), true); return buf; }
static u8* l_J_hana01_c_01DL_get() { static u8 buf[0x128]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0xB9E0}, {GameVersion::GcnPal, 0xB9E0}}, 0x128), true); return buf; }
static u8* l_mat2DL_get() { static u8 buf[0x99]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0xBB20}, {GameVersion::GcnPal, 0xBB20}}, 0x99), true); return buf; }
static u8* l_mat2Light4DL_get() { static u8 buf[0x99]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0xBBC0}, {GameVersion::GcnPal, 0xBBC0}}, 0x99), true); return buf; }
static u8* l_J_hana01DL_get() { static u8 buf[0x138]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0xB7C0}, {GameVersion::GcnPal, 0xB7C0}, {GameVersion::GcnJpn, 0xB7C0}}, 0x138), true); return buf; }
static u8* l_J_hana01_c_00DL_get() { static u8 buf[0xDE]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0xB900}, {GameVersion::GcnPal, 0xB900}, {GameVersion::GcnJpn, 0xB900}}, 0xDE), true); return buf; }
static u8* l_J_hana01_c_01DL_get() { static u8 buf[0x128]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0xB9E0}, {GameVersion::GcnPal, 0xB9E0}, {GameVersion::GcnJpn, 0xB9E0}}, 0x128), true); return buf; }
static u8* l_mat2DL_get() { static u8 buf[0x99]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0xBB20}, {GameVersion::GcnPal, 0xBB20}, {GameVersion::GcnJpn, 0xBB20}}, 0x99), true); return buf; }
static u8* l_mat2Light4DL_get() { static u8 buf[0x99]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0xBBC0}, {GameVersion::GcnPal, 0xBBC0}, {GameVersion::GcnJpn, 0xBBC0}}, 0x99), true); return buf; }
#define l_J_hana01DL (l_J_hana01DL_get())
#define l_J_hana01_c_00DL (l_J_hana01_c_00DL_get())
#define l_J_hana01_c_01DL (l_J_hana01_c_01DL_get())
+8 -8
View File
@@ -21,8 +21,8 @@ const u16 l_M_kusa05_RGBATEX__height = 31;
#if TARGET_PC
#include "dusk/dvd_asset.hpp"
using GameVersion = dusk::version::GameVersion;
static u8* l_M_kusa05_RGBATEX_get() { static u8 buf[0x800]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0x7680}, {GameVersion::GcnPal, 0x7680}}, 0x800), true); return buf; }
static u8* l_M_Hijiki00TEX_get() { static u8 buf[0x800]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0x7E80}, {GameVersion::GcnPal, 0x7E80}}, 0x800), true); return buf; }
static u8* l_M_kusa05_RGBATEX_get() { static u8 buf[0x800]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0x7680}, {GameVersion::GcnPal, 0x7680}, {GameVersion::GcnJpn, 0x7680}}, 0x800), true); return buf; }
static u8* l_M_Hijiki00TEX_get() { static u8 buf[0x800]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0x7E80}, {GameVersion::GcnPal, 0x7E80}, {GameVersion::GcnJpn, 0x7E80}}, 0x800), true); return buf; }
#define l_M_kusa05_RGBATEX (l_M_kusa05_RGBATEX_get())
#define l_M_Hijiki00TEX (l_M_Hijiki00TEX_get())
#else
@@ -116,12 +116,12 @@ static u8 l_texCoord[160] = {
#if TARGET_PC
using GameVersion = dusk::version::GameVersion;
static u8* l_M_Kusa_9qDL_get() { static u8 buf[0xCB]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0x8B00}, {GameVersion::GcnPal, 0x8B00}}, 0xCB), true); return buf; }
static u8* l_M_Kusa_9q_cDL_get() { static u8 buf[0xCB]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0x8BE0}, {GameVersion::GcnPal, 0x8BE0}}, 0xCB), true); return buf; }
static u8* l_M_TenGusaDL_get() { static u8 buf[0xD4]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0x8CC0}, {GameVersion::GcnPal, 0x8CC0}}, 0xD4), true); return buf; }
static u8* l_Tengusa_matDL_get() { static u8 buf[0xA8]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0x8DA0}, {GameVersion::GcnPal, 0x8DA0}}, 0xA8), true); return buf; }
static u8* l_kusa9q_matDL_get() { static u8 buf[0xA8]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0x8E60}, {GameVersion::GcnPal, 0x8E60}}, 0xA8), true); return buf; }
static u8* l_kusa9q_l4_matDL_get() { static u8 buf[0xA8]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0x8F20}, {GameVersion::GcnPal, 0x8F20}}, 0xA8), true); return buf; }
static u8* l_M_Kusa_9qDL_get() { static u8 buf[0xCB]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0x8B00}, {GameVersion::GcnPal, 0x8B00}, {GameVersion::GcnJpn, 0x8B00}}, 0xCB), true); return buf; }
static u8* l_M_Kusa_9q_cDL_get() { static u8 buf[0xCB]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0x8BE0}, {GameVersion::GcnPal, 0x8BE0}, {GameVersion::GcnJpn, 0x8BE0}}, 0xCB), true); return buf; }
static u8* l_M_TenGusaDL_get() { static u8 buf[0xD4]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0x8CC0}, {GameVersion::GcnPal, 0x8CC0}, {GameVersion::GcnJpn, 0x8CC0}}, 0xD4), true); return buf; }
static u8* l_Tengusa_matDL_get() { static u8 buf[0xA8]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0x8DA0}, {GameVersion::GcnPal, 0x8DA0}, {GameVersion::GcnJpn, 0x8DA0}}, 0xA8), true); return buf; }
static u8* l_kusa9q_matDL_get() { static u8 buf[0xA8]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0x8E60}, {GameVersion::GcnPal, 0x8E60}, {GameVersion::GcnJpn, 0x8E60}}, 0xA8), true); return buf; }
static u8* l_kusa9q_l4_matDL_get() { static u8 buf[0xA8]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0x8F20}, {GameVersion::GcnPal, 0x8F20}, {GameVersion::GcnJpn, 0x8F20}}, 0xA8), true); return buf; }
#define l_M_Kusa_9qDL (l_M_Kusa_9qDL_get())
#define l_M_Kusa_9q_cDL (l_M_Kusa_9q_cDL_get())
#define l_M_TenGusaDL (l_M_TenGusaDL_get())
+46 -7
View File
@@ -15,6 +15,8 @@
#include "m_Do/m_Do_controller_pad.h"
#include <dusk/autosave.h>
#include "dusk/version.hpp"
dBrightCheck_c::dBrightCheck_c(JKRArchive* i_archive) {
mArchive = i_archive;
mBrightCheck.mMsgString = JKR_NEW dMsgString_c();
@@ -39,7 +41,16 @@ void dBrightCheck_c::screenSet() {
MULTI_CHAR('font_a1'), MULTI_CHAR('font_at2'), MULTI_CHAR('font_at3'), MULTI_CHAR('font_at4'), MULTI_CHAR('font_at'),
};
#if (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
#if TARGET_PC
static u64 const txTV_jpn[] = {
MULTI_CHAR('menu_t6s'), MULTI_CHAR('menu_t6'), MULTI_CHAR('menu_t9s'), MULTI_CHAR('menu_t9'), MULTI_CHAR('menut10s'),
MULTI_CHAR('menu_t10'), MULTI_CHAR('menu_t7s'), MULTI_CHAR('menu_t7'), MULTI_CHAR('menu_t8s'), MULTI_CHAR('menu_t8'),
};
static u64 const txTV[] = {
MULTI_CHAR('menu_t61'), MULTI_CHAR('menu_t2'), MULTI_CHAR('menu_t91'), MULTI_CHAR('menu_t1'), MULTI_CHAR('menut101'),
MULTI_CHAR('menu_t01'), MULTI_CHAR('menu_t71'), MULTI_CHAR('menu_t3'), MULTI_CHAR('menu_t81'), MULTI_CHAR('menu_t4'),
};
#elif (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
static u64 const txTV[] = {
MULTI_CHAR('menu_t6s'), MULTI_CHAR('menu_t6'), MULTI_CHAR('menu_t9s'), MULTI_CHAR('menu_t9'), MULTI_CHAR('menut10s'),
MULTI_CHAR('menu_t10'), MULTI_CHAR('menu_t7s'), MULTI_CHAR('menu_t7'), MULTI_CHAR('menu_t8s'), MULTI_CHAR('menu_t8'),
@@ -51,7 +62,14 @@ void dBrightCheck_c::screenSet() {
};
#endif
#if (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
#if TARGET_PC
static u64 const txTVhide_jpn[] = {
MULTI_CHAR('fmenu_6n'), MULTI_CHAR('fmenu_9n'), MULTI_CHAR('fmenu_10'), MULTI_CHAR('fmenu_7n'), MULTI_CHAR('fmenu_8n'),
};
static u64 const txTVhide[] = {
MULTI_CHAR('menu_6n'), MULTI_CHAR('menu_9n'), MULTI_CHAR('menu_10n'), MULTI_CHAR('menu_7n'), MULTI_CHAR('menu_8n'),
};
#elif (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
static u64 const txTVhide[] = {
MULTI_CHAR('fmenu_6n'), MULTI_CHAR('fmenu_9n'), MULTI_CHAR('fmenu_10'), MULTI_CHAR('fmenu_7n'), MULTI_CHAR('fmenu_8n'),
};
@@ -67,7 +85,18 @@ void dBrightCheck_c::screenSet() {
mBrightCheck.Scr->search(MULTI_CHAR('g_abtn_n'))->hide();
#if (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
#if TARGET_PC
J2DTextBox* settings_text;
if (dusk::version::isRegionJpn()) {
settings_text = (J2DTextBox*)mBrightCheck.Scr->search(MULTI_CHAR('t_t00'));
mBrightCheck.Scr->search(MULTI_CHAR('t_t00'))->show();
mBrightCheck.Scr->search(MULTI_CHAR('f_t00'))->hide();
} else {
settings_text = (J2DTextBox*)mBrightCheck.Scr->search(MULTI_CHAR('f_t00'));
mBrightCheck.Scr->search(MULTI_CHAR('f_t00'))->show();
mBrightCheck.Scr->search(MULTI_CHAR('t_t00'))->hide();
}
#elif (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
J2DTextBox* settings_text = (J2DTextBox*)mBrightCheck.Scr->search(MULTI_CHAR('t_t00'));
mBrightCheck.Scr->search(MULTI_CHAR('t_t00'))->show();
mBrightCheck.Scr->search(MULTI_CHAR('f_t00'))->hide();
@@ -83,7 +112,15 @@ void dBrightCheck_c::screenSet() {
J2DTextBox* btna_text[5];
for (int i = 0; i < 5; i++) {
#if (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
btna_text[i] = (J2DTextBox*)mBrightCheck.Scr->search(tv_btnA[i]);
mBrightCheck.Scr->search(ftv_btnA[i])->hide();
} else {
btna_text[i] = (J2DTextBox*)mBrightCheck.Scr->search(ftv_btnA[i]);
mBrightCheck.Scr->search(tv_btnA[i])->hide();
}
#elif (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
btna_text[i] = (J2DTextBox*)mBrightCheck.Scr->search(tv_btnA[i]);
mBrightCheck.Scr->search(ftv_btnA[i])->hide();
#else
@@ -97,15 +134,17 @@ void dBrightCheck_c::screenSet() {
}
for (int i = 0; i < 5; i++) {
mBrightCheck.Scr->search(txTVhide[i])->hide();
mBrightCheck.Scr->search(DUSK_IF_ELSE(dusk::version::isRegionJpn() ? txTVhide_jpn[i] : txTVhide[i], txTVhide[i]))->hide();
}
for (int i = 0; i < 10; i++) {
J2DTextBox* check_text = (J2DTextBox*)mBrightCheck.Scr->search(txTV[i]);
J2DTextBox* check_text = (J2DTextBox*)mBrightCheck.Scr->search(DUSK_IF_ELSE(dusk::version::isRegionJpn() ? txTV_jpn[i] : txTV[i], txTV[i]));
check_text->setFont(mDoExt_getMesgFont());
#if (VERSION != VERSION_GCN_JPN) && (VERSION != VERSION_WII_JPN)
#if TARGET_PC || ((VERSION != VERSION_GCN_JPN) && (VERSION != VERSION_WII_JPN))
IF_DUSK_BLOCK(!dusk::version::isRegionJpn())
check_text->setCharSpace(0.0f);
IF_DUSK_BLOCK_END
#endif
if (i < 2) {
+26 -3
View File
@@ -46,8 +46,19 @@ void dFile_info_c::screenSet() {
J2DTextBox* info_text[4];
#if (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
info_text[0] = (J2DTextBox*)mFileInfo.Scr->search(MULTI_CHAR('w_s_t_01'));
info_text[1] = (J2DTextBox*)mFileInfo.Scr->search(MULTI_CHAR('w_p_t_01'));
mFileInfo.Scr->search(MULTI_CHAR('f_s_t_02'))->hide();
mFileInfo.Scr->search(MULTI_CHAR('f_p_t_02'))->hide();
} else {
info_text[0] = (J2DTextBox*)mFileInfo.Scr->search(MULTI_CHAR('f_s_t_02'));
info_text[1] = (J2DTextBox*)mFileInfo.Scr->search(MULTI_CHAR('f_p_t_02'));
mFileInfo.Scr->search(MULTI_CHAR('w_s_t_01'))->hide();
mFileInfo.Scr->search(MULTI_CHAR('w_p_t_01'))->hide();
}
#elif (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
info_text[0] = (J2DTextBox*)mFileInfo.Scr->search(MULTI_CHAR('w_s_t_01'));
info_text[1] = (J2DTextBox*)mFileInfo.Scr->search(MULTI_CHAR('w_p_t_01'));
mFileInfo.Scr->search(MULTI_CHAR('f_s_t_02'))->hide();
@@ -66,7 +77,19 @@ void dFile_info_c::screenSet() {
dMeter2Info_getString(0x3D0, info_text[0]->getStringPtr(), NULL); // Save time
dMeter2Info_getString(0x3D1, info_text[1]->getStringPtr(), NULL); // Total play time
#if (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
info_text[0] = (J2DTextBox*)mFileInfo.Scr->search(MULTI_CHAR('w_name01'));
info_text[1] = (J2DTextBox*)mFileInfo.Scr->search(MULTI_CHAR('w_new_1'));
mFileInfo.Scr->search(MULTI_CHAR('f_name01'))->hide();
mFileInfo.Scr->search(MULTI_CHAR('f_new_1'))->hide();
} else {
info_text[0] = (J2DTextBox*)mFileInfo.Scr->search(MULTI_CHAR('f_name01'));
info_text[1] = (J2DTextBox*)mFileInfo.Scr->search(MULTI_CHAR('f_new_1'));
mFileInfo.Scr->search(MULTI_CHAR('w_name01'))->hide();
mFileInfo.Scr->search(MULTI_CHAR('w_new_1'))->hide();
}
#elif (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
info_text[0] = (J2DTextBox*)mFileInfo.Scr->search(MULTI_CHAR('w_name01'));
info_text[1] = (J2DTextBox*)mFileInfo.Scr->search(MULTI_CHAR('w_new_1'));
mFileInfo.Scr->search(MULTI_CHAR('f_name01'))->hide();
+18 -5
View File
@@ -4,13 +4,14 @@
#include "d/dolzel.h" // IWYU pragma: keep
#include "JSystem/J2DGraph/J2DAnmLoader.h"
#include "JSystem/J2DGraph/J2DScreen.h"
#include "JSystem/J2DGraph/J2DTextBox.h"
#include "d/d_com_inf_game.h"
#include "d/d_file_sel_warning.h"
#include "d/d_msg_string.h"
#include "d/d_pane_class.h"
#include "JSystem/J2DGraph/J2DScreen.h"
#include "JSystem/J2DGraph/J2DAnmLoader.h"
#include "JSystem/J2DGraph/J2DTextBox.h"
#include "d/d_com_inf_game.h"
#include "dusk/version.hpp"
typedef void (dFile_warning_c::*procFunc)();
static procFunc fileWarningProc[] = {&dFile_warning_c::modeWait, &dFile_warning_c::modeMove};
@@ -63,7 +64,19 @@ void dFile_warning_c::screenSet() {
JUT_ASSERT(0, mpRootPane != NULL);
field_0x34 = mpRootPane->getTranslateY();
#if REGION_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
mFileWarn.Scr->search(MULTI_CHAR('ms_for_2'))->hide();
mFileWarn.Scr->search(MULTI_CHAR('ms_for_3'))->hide();
field_0x20 = static_cast<J2DTextBox*>(mFileWarn.Scr->search(MULTI_CHAR('w_msg_jp')));
} else {
mFileWarn.Scr->search(MULTI_CHAR('w_msg_jp'))->hide();
mFileWarn.Scr->search(MULTI_CHAR('ms_for_2'))->hide();
field_0x20 = static_cast<J2DTextBox*>(mFileWarn.Scr->search(MULTI_CHAR('ms_for_3')));
}
#elif REGION_JPN
mFileWarn.Scr->search(MULTI_CHAR('ms_for_2'))->hide();
mFileWarn.Scr->search(MULTI_CHAR('ms_for_3'))->hide();
+94 -17
View File
@@ -23,6 +23,8 @@
#include "m_Do/m_Do_graphic.h"
#include <cstring>
#include "dusk/version.hpp"
#if TARGET_PC
#include "dusk/config.hpp"
#include "dusk/menu_pointer.h"
@@ -3325,8 +3327,10 @@ void dFile_select_c::screenSet() {
static u64 l_nouseTag[15] = {MULTI_CHAR('w_mcheck'), MULTI_CHAR('w_tabi1'), MULTI_CHAR('w_tabi2'), MULTI_CHAR('w_tabi3'), MULTI_CHAR('w_doko_c'),
MULTI_CHAR('w_uwa_c'), MULTI_CHAR('w_cp_chu'), MULTI_CHAR('w_cpsita'), MULTI_CHAR('w_cp_x'), 'w_de',
MULTI_CHAR('w_de_chu'), MULTI_CHAR('w_desita'), MULTI_CHAR('w_de_x'), MULTI_CHAR('w_name'), MULTI_CHAR('w_h_name')};
#if (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
#if TARGET_PC
static u64 l_tagName21_jpn[2] = {MULTI_CHAR('w_tabi_s'), MULTI_CHAR('w_tabi_x')};
static u64 l_tagName21[2] = {MULTI_CHAR('t_for'), MULTI_CHAR('t_for1')};
#elif (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
static u64 l_tagName21[2] = {MULTI_CHAR('w_tabi_s'), MULTI_CHAR('w_tabi_x')};
#else
static u64 l_tagName21[2] = {MULTI_CHAR('t_for'), MULTI_CHAR('t_for1')};
@@ -3335,7 +3339,10 @@ void dFile_select_c::screenSet() {
static u64 l_tagName18[3] = {MULTI_CHAR('w_de_ef0'), MULTI_CHAR('w_de_ef1'), MULTI_CHAR('w_de_ef2')};
static u64 l_tagName19[3] = {MULTI_CHAR('w_cp_ef0'), MULTI_CHAR('w_cp_ef1'), MULTI_CHAR('w_cp_ef2')};
#if (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
#if TARGET_PC
static u64 l_tagName20_jpn[2] = {MULTI_CHAR('w_er_msg'), MULTI_CHAR('w_er_msR')};
static u64 l_tagName20[2] = {MULTI_CHAR('er_for0'), MULTI_CHAR('er_for1')};
#elif (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
static u64 l_tagName20[2] = {MULTI_CHAR('w_er_msg'), MULTI_CHAR('w_er_msR')};
#else
static u64 l_tagName20[2] = {MULTI_CHAR('er_for0'), MULTI_CHAR('er_for1')};
@@ -3371,7 +3378,19 @@ void dFile_select_c::screenSet() {
mBbtnPane = JKR_NEW CPaneMgrAlpha(fileSel.Scr, MULTI_CHAR('w_n_bbtn'), 2, NULL);
mAbtnPane = JKR_NEW CPaneMgrAlpha(fileSel.Scr, MULTI_CHAR('w_n_abtn'), 2, NULL);
#if (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
mModoruTxtPane = JKR_NEW CPaneMgrAlpha(fileSel.Scr, MULTI_CHAR('w_modo'), 2, NULL);
mKetteiTxtPane = JKR_NEW CPaneMgrAlpha(fileSel.Scr, MULTI_CHAR('w_kete'), 2, NULL);
fileSel.Scr->search(MULTI_CHAR('f_modo'))->hide();
fileSel.Scr->search(MULTI_CHAR('f_kete'))->hide();
} else {
mModoruTxtPane = JKR_NEW CPaneMgrAlpha(fileSel.Scr, MULTI_CHAR('f_modo'), 2, NULL);
mKetteiTxtPane = JKR_NEW CPaneMgrAlpha(fileSel.Scr, MULTI_CHAR('f_kete'), 2, NULL);
fileSel.Scr->search(MULTI_CHAR('w_modo'))->hide();
fileSel.Scr->search(MULTI_CHAR('w_kete'))->hide();
}
#elif (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
mModoruTxtPane = JKR_NEW CPaneMgrAlpha(fileSel.Scr, MULTI_CHAR('w_modo'), 2, NULL);
mKetteiTxtPane = JKR_NEW CPaneMgrAlpha(fileSel.Scr, MULTI_CHAR('w_kete'), 2, NULL);
fileSel.Scr->search(MULTI_CHAR('f_modo'))->hide();
@@ -3447,7 +3466,17 @@ void dFile_select_c::screenSet() {
fileSel.Scr->search(l_nouseTag[i])->hide();
}
#if (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
fileSel.Scr->search(MULTI_CHAR('t_for'))->hide();
fileSel.Scr->search(MULTI_CHAR('t_for1'))->hide();
} else {
fileSel.Scr->search(MULTI_CHAR('w_tabi_s'))->hide();
fileSel.Scr->search(MULTI_CHAR('w_tabi_x'))->hide();
fileSel.Scr->search(MULTI_CHAR('w_mgn1'))->hide();
fileSel.Scr->search(MULTI_CHAR('w_mgn2'))->hide();
}
#elif (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
fileSel.Scr->search(MULTI_CHAR('t_for'))->hide();
fileSel.Scr->search(MULTI_CHAR('t_for1'))->hide();
#else
@@ -3458,10 +3487,20 @@ void dFile_select_c::screenSet() {
#endif
for (int i = 0; i < 2; i++) {
mHeaderTxtPane[i] = JKR_NEW CPaneMgrAlpha(fileSel.Scr, l_tagName21[i], 0, NULL);
mHeaderTxtPane[i] = JKR_NEW CPaneMgrAlpha(fileSel.Scr, DUSK_IF_ELSE(dusk::version::isRegionJpn() ? l_tagName21_jpn[i] : l_tagName21[i], l_tagName21[i]), 0, NULL);
((J2DTextBox*)mHeaderTxtPane[i]->getPanePtr())->setFont(fileSel.font[0]);
((J2DTextBox*)mHeaderTxtPane[i]->getPanePtr())->setString(512, "");
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
((J2DTextBox*)mHeaderTxtPane[i]->getPanePtr())->setFontSize(21.0f, 21.0f);
((J2DTextBox*)mHeaderTxtPane[i]->getPanePtr())->setLineSpace(22.0f);
((J2DTextBox*)mHeaderTxtPane[i]->getPanePtr())->setCharSpace(2.0f);
} else {
((J2DTextBox*)mHeaderTxtPane[i]->getPanePtr())->setFontSize(24.0f, 24.0f);
((J2DTextBox*)mHeaderTxtPane[i]->getPanePtr())->setLineSpace(20.0f);
((J2DTextBox*)mHeaderTxtPane[i]->getPanePtr())->setCharSpace(0.0f);
}
#elif VERSION == VERSION_GCN_JPN
((J2DTextBox*)mHeaderTxtPane[i]->getPanePtr())->setFontSize(21.0f, 21.0f);
((J2DTextBox*)mHeaderTxtPane[i]->getPanePtr())->setLineSpace(22.0f);
((J2DTextBox*)mHeaderTxtPane[i]->getPanePtr())->setCharSpace(2.0f);
@@ -3502,8 +3541,15 @@ void dFile_select_c::screenSet() {
field_0x0208 = 0;
field_0x0209 = 0;
mErrorMsgPane = fileSel.Scr->search(MULTI_CHAR('w_er_n'));
#if (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
fileSel.Scr->search(MULTI_CHAR('er_for0'))->hide();
fileSel.Scr->search(MULTI_CHAR('er_for1'))->hide();
} else {
fileSel.Scr->search(MULTI_CHAR('w_er_msg'))->hide();
fileSel.Scr->search(MULTI_CHAR('w_er_msR'))->hide();
}
#elif (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
fileSel.Scr->search(MULTI_CHAR('er_for0'))->hide();
fileSel.Scr->search(MULTI_CHAR('er_for1'))->hide();
#else
@@ -3514,17 +3560,27 @@ void dFile_select_c::screenSet() {
fileSel.Scr->search(MULTI_CHAR('w_er_msE'))->hide();
for (int i = 0; i < 2; i++) {
mErrorMsgTxtPane[i] = JKR_NEW CPaneMgrAlpha(fileSel.Scr, l_tagName20[i], 0, NULL);
mErrorMsgTxtPane[i] = JKR_NEW CPaneMgrAlpha(fileSel.Scr, DUSK_IF_ELSE(dusk::version::isRegionJpn() ? l_tagName20_jpn[i] : l_tagName20[i], l_tagName20[i]), 0, NULL);
((J2DTextBox*)mErrorMsgTxtPane[i]->getPanePtr())->setFont(fileSel.font[0]);
((J2DTextBox*)mErrorMsgTxtPane[i]->getPanePtr())->setString(512, "");
#if (VERSION != VERSION_GCN_JPN) && (VERSION != VERSION_WII_JPN)
#if TARGET_PC || ((VERSION != VERSION_GCN_JPN) && (VERSION != VERSION_WII_JPN))
IF_DUSK_BLOCK(!dusk::version::isRegionJpn())
mErrorMsgTxtPane[i]->getPanePtr()->resize(440.0f, 198.0f);
IF_DUSK_BLOCK_END
#endif
((J2DTextBox*)mErrorMsgTxtPane[i]->getPanePtr())->setFontSize(21.0f, 21.0f);
#if (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
((J2DTextBox*)mErrorMsgTxtPane[i]->getPanePtr())->setLineSpace(22.0f);
((J2DTextBox*)mErrorMsgTxtPane[i]->getPanePtr())->setCharSpace(2.0f);
} else {
((J2DTextBox*)mErrorMsgTxtPane[i]->getPanePtr())->setLineSpace(21.0f);
((J2DTextBox*)mErrorMsgTxtPane[i]->getPanePtr())->setCharSpace(1.0f);
}
#elif (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
((J2DTextBox*)mErrorMsgTxtPane[i]->getPanePtr())->setLineSpace(22.0f);
((J2DTextBox*)mErrorMsgTxtPane[i]->getPanePtr())->setCharSpace(2.0f);
#else
@@ -3720,7 +3776,15 @@ void dFile_select_c::screenSetYesNo() {
for (int i = 0; i < 2; i++) {
mYnSelPane[i] = JKR_NEW CPaneMgr(mYnSel.ScrYn, l_tagName012[i], 0, NULL);
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
mYnSelTxtPane[i] = JKR_NEW CPaneMgr(mYnSel.ScrYn, l_tagName013[i], 0, NULL);
mYnSel.ScrYn->search(l_tagName013U[i])->hide();
} else {
mYnSelTxtPane[i] = JKR_NEW CPaneMgr(mYnSel.ScrYn, l_tagName013U[i], 0, NULL);
mYnSel.ScrYn->search(l_tagName013[i])->hide();
}
#elif VERSION == VERSION_GCN_JPN
mYnSelTxtPane[i] = JKR_NEW CPaneMgr(mYnSel.ScrYn, l_tagName013[i], 0, NULL);
mYnSel.ScrYn->search(l_tagName013U[i])->hide();
#else
@@ -3798,7 +3862,15 @@ void dFile_select_c::screenSet3Menu() {
for (int i = 0; i < 3; i++) {
m3mSelPane[i] = JKR_NEW CPaneMgr(m3mSel.Scr3m, l_tagName1[i], 0, NULL);
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
m3mSelTextPane[i] = JKR_NEW CPaneMgr(m3mSel.Scr3m, l_tagName011[i], 0, NULL);
m3mSel.Scr3m->search(l_tagName011U[i])->hide();
} else {
m3mSelTextPane[i] = JKR_NEW CPaneMgr(m3mSel.Scr3m, l_tagName011U[i], 0, NULL);
m3mSel.Scr3m->search(l_tagName011[i])->hide();
}
#elif VERSION == VERSION_GCN_JPN
m3mSelTextPane[i] = JKR_NEW CPaneMgr(m3mSel.Scr3m, l_tagName011[i], 0, NULL);
m3mSel.Scr3m->search(l_tagName011U[i])->hide();
#else
@@ -3918,7 +3990,12 @@ void dFile_select_c::headerTxtSet(u16 i_msgId, u8 i_type, u8 param_3) {
SAFE_STRCPY(mHeaderStringPtr[dispIdx], "");
} else {
static f32 fontsize[2] = {21.0f, 27.0f};
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
static f32 linespace_jpn[2] = {22.0f, 20.0f};
static f32 charspace_jpn[2] = {2.0f, 3.0f};
static f32 linespace[2] = {21.0f, 20.0f};
static f32 charspace[2] = {0.0f, 0.0f};
#elif VERSION == VERSION_GCN_JPN
static f32 linespace[2] = {22.0f, 20.0f};
static f32 charspace[2] = {2.0f, 3.0f};
#else
@@ -3928,8 +4005,8 @@ void dFile_select_c::headerTxtSet(u16 i_msgId, u8 i_type, u8 param_3) {
((J2DTextBox*)mHeaderTxtPane[dispIdx]->getPanePtr())->setFont(fileSel.font[i_type]);
((J2DTextBox*)mHeaderTxtPane[dispIdx]->getPanePtr())->setFontSize(fontsize[i_type], fontsize[i_type]);
((J2DTextBox*)mHeaderTxtPane[dispIdx]->getPanePtr())->setLineSpace(linespace[i_type]);
((J2DTextBox*)mHeaderTxtPane[dispIdx]->getPanePtr())->setCharSpace(charspace[i_type]);
((J2DTextBox*)mHeaderTxtPane[dispIdx]->getPanePtr())->setLineSpace(DUSK_IF_ELSE(dusk::version::isRegionJpn() ? linespace_jpn[i_type] : linespace[i_type], linespace[i_type]));
((J2DTextBox*)mHeaderTxtPane[dispIdx]->getPanePtr())->setCharSpace(DUSK_IF_ELSE(dusk::version::isRegionJpn() ? charspace_jpn[i_type] : charspace[i_type], charspace[i_type]));
fileSel.mMessageString->getString(i_msgId,
((J2DTextBox*)mHeaderTxtPane[dispIdx]->getPanePtr()), NULL,
fileSel.font[i_type], NULL, 0);
+14 -4
View File
@@ -12,6 +12,8 @@
#include "m_Do/m_Do_graphic.h"
#include "m_Do/m_Do_lib.h"
#include <cstring>
#include "dusk/version.hpp"
#if TARGET_PC
#include "dusk/frame_interpolation.h"
#endif
@@ -2386,10 +2388,12 @@ void dKyr_drawSun(Mtx drawMtx, cXyz* ppos, GXColor& unused, u8** tex) {
u8 draw_sun = false;
u16 date = dComIfGs_getDate();
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC || VERSION == VERSION_GCN_JPN
IF_DUSK_BLOCK(dusk::version::isRegionJpn())
if (g_env_light.hide_vrbox) {
return;
}
IF_DUSK_BLOCK_END
#endif
if (strcmp(dComIfGp_getStartStageName(), "F_SP200") == 0) {
@@ -2754,10 +2758,12 @@ void dKyr_drawLenzflare(Mtx drawMtx, cXyz* ppos, GXColor& param_2, u8** tex) {
static s16 S_rot_work1 = 0;
static s16 S_rot_work2 = 0;
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC || VERSION == VERSION_GCN_JPN
IF_DUSK_BLOCK(dusk::version::isRegionJpn())
if (g_env_light.hide_vrbox) {
return;
}
IF_DUSK_BLOCK_END
#endif
Mtx camMtx;
@@ -4223,10 +4229,12 @@ void dKyr_drawStar(Mtx drawMtx, u8** tex) {
csXyz(0, 30000, 19000),
};
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC || VERSION == VERSION_GCN_JPN
IF_DUSK_BLOCK(dusk::version::isRegionJpn())
if (g_env_light.hide_vrbox) {
return;
}
IF_DUSK_BLOCK_END
#endif
if (star_packet->mEffectNum != 0) {
@@ -4770,10 +4778,12 @@ void drawVrkumo(Mtx drawMtx, GXColor& color, u8** tex) {
int pass = 1;
f32 spC4 = 0.0f;
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC || VERSION == VERSION_GCN_JPN
IF_DUSK_BLOCK(dusk::version::isRegionJpn())
if (g_env_light.hide_vrbox) {
return;
}
IF_DUSK_BLOCK_END
#endif
cXyz sp15C;
+179 -23
View File
@@ -5,36 +5,37 @@
#include "d/dolzel.h" // IWYU pragma: keep
#include "d/d_menu_collect.h"
#include "JSystem/J3DGraphLoader/J3DModelLoader.h"
#include "JSystem/J3DGraphLoader/J3DAnmLoader.h"
#include <cstring>
#include <os.h>
#include "JSystem/J2DGraph/J2DAnmLoader.h"
#include "JSystem/J2DGraph/J2DGrafContext.h"
#include "JSystem/J2DGraph/J2DTextBox.h"
#include "JSystem/J3DGraphBase/J3DMaterial.h"
#include "JSystem/J3DGraphLoader/J3DAnmLoader.h"
#include "JSystem/J3DGraphLoader/J3DModelLoader.h"
#include "JSystem/JKernel/JKRExpHeap.h"
#include "JSystem/JKernel/JKRSolidHeap.h"
#include "d/actor/d_a_alink.h"
#include "d/d_select_cursor.h"
#include "d/d_item.h"
#include "d/d_lib.h"
#include "d/d_menu_collect.h"
#include "d/d_menu_fishing.h"
#include "d/d_menu_insect.h"
#include "d/d_menu_letter.h"
#include "d/d_menu_option.h"
#include "d/d_menu_save.h"
#include "d/d_menu_skill.h"
#include "d/d_menu_window.h"
#include "d/d_meter2_info.h"
#include "d/d_meter_HIO.h"
#include "d/d_msg_class.h"
#include "d/d_msg_object.h"
#include "d/d_msg_string.h"
#include "d/d_pane_class.h"
#include "d/d_item.h"
#include "d/d_lib.h"
#include "d/d_meter2_info.h"
#include <os.h>
#include <cstring>
#include "d/d_select_cursor.h"
#include "dusk/version.hpp"
#include "m_Do/m_Do_graphic.h"
#include "m_Do/m_Do_mtx.h"
#include "JSystem/J2DGraph/J2DAnmLoader.h"
#include "JSystem/J2DGraph/J2DGrafContext.h"
#include "d/d_menu_window.h"
#include "JSystem/J3DGraphBase/J3DMaterial.h"
#if TARGET_PC
#include "dusk/menu_pointer.h"
@@ -438,7 +439,21 @@ void dMenu_Collect2D_c::screenSet() {
static const u64 text_a_tag[5] = {MULTI_CHAR('atext1_1'), MULTI_CHAR('atext1_2'), MULTI_CHAR('atext1_3'), MULTI_CHAR('atext1_4'), MULTI_CHAR('atext1_5')};
static const u64 text_b_tag[5] = {MULTI_CHAR('btext1_1'), MULTI_CHAR('btext1_2'), MULTI_CHAR('btext1_3'), MULTI_CHAR('btext1_4'), MULTI_CHAR('btext1_5')};
#if REGION_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('t_t00')))->setFont(mDoExt_getRubyFont());
static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('t_t00')))->setString(0x20, "");
dMeter2Info_getStringKanji(
0x3E1, static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('t_t00')))->getStringPtr(), NULL);
mpScreen->search(MULTI_CHAR('f_t00'))->hide();
} else {
static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('f_t00')))->setFont(mDoExt_getRubyFont());
static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('f_t00')))->setString(0x20, "");
dMeter2Info_getStringKanji(
0x3E1, static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('f_t00')))->getStringPtr(), NULL);
mpScreen->search(MULTI_CHAR('t_t00'))->hide();
}
#elif REGION_JPN
static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('t_t00')))->setFont(mDoExt_getRubyFont());
static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('t_t00')))->setString(0x20, "");
dMeter2Info_getStringKanji(
@@ -453,7 +468,31 @@ void dMenu_Collect2D_c::screenSet() {
#endif
for (int i = 0; i < 3; i++) {
#if REGION_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
static_cast<J2DTextBox*>(mpScreen->search(text_sv[i]))->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpScreen->search(text_op[i]))->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpScreen->search(text_sv[i]))->setString(0x20, "");
static_cast<J2DTextBox*>(mpScreen->search(text_op[i]))->setString(0x20, "");
dMeter2Info_getStringKanji(
0x60, static_cast<J2DTextBox*>(mpScreen->search(text_sv[i]))->getStringPtr(), NULL);
dMeter2Info_getStringKanji(
0x5F, static_cast<J2DTextBox*>(mpScreen->search(text_op[i]))->getStringPtr(), NULL);
mpScreen->search(ftext_sv[i])->hide();
mpScreen->search(ftext_op[i])->hide();
} else {
static_cast<J2DTextBox*>(mpScreen->search(ftext_sv[i]))->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpScreen->search(ftext_op[i]))->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpScreen->search(ftext_sv[i]))->setString(0x20, "");
static_cast<J2DTextBox*>(mpScreen->search(ftext_op[i]))->setString(0x20, "");
dMeter2Info_getStringKanji(
0x60, static_cast<J2DTextBox*>(mpScreen->search(ftext_sv[i]))->getStringPtr(), NULL);
dMeter2Info_getStringKanji(
0x5F, static_cast<J2DTextBox*>(mpScreen->search(ftext_op[i]))->getStringPtr(), NULL);
mpScreen->search(text_sv[i])->hide();
mpScreen->search(text_op[i])->hide();
}
#elif REGION_JPN
static_cast<J2DTextBox*>(mpScreen->search(text_sv[i]))->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpScreen->search(text_op[i]))->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpScreen->search(text_sv[i]))->setString(0x20, "");
@@ -487,7 +526,49 @@ void dMenu_Collect2D_c::screenSet() {
static_cast<J2DTextBox*>(mpScreenIcon->search(text_b_tag[i]))->setString(0x20, "");
}
#if REGION_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('item_n00')))->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('item_n01')))->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('item_n02')))->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('item_n03')))->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('item_n00')))->setString(0x20, "");
static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('item_n01')))->setString(0x20, "");
static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('item_n02')))->setString(0x20, "");
static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('item_n03')))->setString(0x20, "");
static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('i_text1')))->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('i_text0')))->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('i_text1')))->setString(0x100, "");
static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('i_text0')))->setString(0x100, "");
mpScreen->search(MULTI_CHAR('item_n04'))->hide();
mpScreen->search(MULTI_CHAR('item_n05'))->hide();
mpScreen->search(MULTI_CHAR('item_n06'))->hide();
mpScreen->search(MULTI_CHAR('item_n07'))->hide();
mpScreen->search(MULTI_CHAR('f_text1'))->hide();
mpScreen->search(MULTI_CHAR('f_text0'))->hide();
} else {
static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('item_n04')))->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('item_n05')))->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('item_n06')))->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('item_n07')))->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('item_n04')))->setString(0x20, "");
static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('item_n05')))->setString(0x20, "");
static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('item_n06')))->setString(0x20, "");
static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('item_n07')))->setString(0x20, "");
static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('f_text1')))->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('f_text0')))->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('f_text1')))->setString(0x100, "");
static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('f_text0')))->setString(0x100, "");
mpScreen->search(MULTI_CHAR('item_n00'))->hide();
mpScreen->search(MULTI_CHAR('item_n01'))->hide();
mpScreen->search(MULTI_CHAR('item_n02'))->hide();
mpScreen->search(MULTI_CHAR('item_n03'))->hide();
mpScreen->search(MULTI_CHAR('i_text1'))->hide();
mpScreen->search(MULTI_CHAR('i_text0'))->hide();
}
#elif REGION_JPN
static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('item_n00')))->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('item_n01')))->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('item_n02')))->setFont(mDoExt_getMesgFont());
@@ -2337,35 +2418,69 @@ void dMenu_Collect2D_c::_draw() {
mpScreen->draw(0.0f, 0.0f, grafPort);
if (mItemNameString == 0) {
#if REGION_JPN
#if TARGET_PC
TEXT_SPAN stringPtr1;
if (dusk::version::isRegionJpn()) {
stringPtr1 = static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('i_text1')))->getStringPtr();
} else {
stringPtr1 = static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('f_text1')))->getStringPtr();
}
#elif REGION_JPN
TEXT_SPAN stringPtr1 = static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('i_text1')))->getStringPtr();
#else
TEXT_SPAN stringPtr1 = static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('f_text1')))->getStringPtr();
#endif
SAFE_STRCPY(stringPtr1, "");
#if REGION_JPN
#if TARGET_PC
TEXT_SPAN stringPtr0;
if (dusk::version::isRegionJpn()) {
stringPtr0 = static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('i_text0')))->getStringPtr();
} else {
stringPtr0 = static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('f_text0')))->getStringPtr();
}
#elif REGION_JPN
TEXT_SPAN stringPtr0 = static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('i_text0')))->getStringPtr();
#else
TEXT_SPAN stringPtr0 = static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('f_text0')))->getStringPtr();
#endif
SAFE_STRCPY(stringPtr0, "");
} else {
#if REGION_JPN
#if TARGET_PC
J2DTextBox* textBox1;
if (dusk::version::isRegionJpn()) {
textBox1 = static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('i_text1')));
} else {
textBox1 = static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('f_text1')));
}
#elif REGION_JPN
J2DTextBox* textBox1 = static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('i_text1')));
#else
J2DTextBox* textBox1 = static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('f_text1')));
#endif
mpString->getString(mItemNameString, textBox1, NULL, NULL, NULL, 0);
#if REGION_JPN
#if TARGET_PC
J2DTextBox* textBox0;
if (dusk::version::isRegionJpn()) {
textBox0 = static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('i_text0')));
} else {
textBox0 = static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('f_text0')));
}
#elif REGION_JPN
J2DTextBox* textBox0 = static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('i_text0')));
#else
J2DTextBox* textBox0 = static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('f_text0')));
#endif
mpString->getString(mItemNameString, textBox0, NULL, NULL, NULL, 0);
#if REGION_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
textBox0 = static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('i_text0')));
} else {
textBox0 = static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('f_text0')));
}
#elif REGION_JPN
textBox0 = static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('i_text0')));
#else
textBox0 = static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('f_text0')));
@@ -2448,7 +2563,29 @@ void dMenu_Collect2D_c::setItemNameString(u8 param_0, u8 param_1) {
if (uVar6 == 0) {
setItemNameStringNull();
} else {
#if REGION_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
TEXT_SPAN stringPtr =
static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('item_n00')))->getStringPtr();
dMeter2Info_getStringKanji(uVar6, stringPtr, NULL);
stringPtr = static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('item_n01')))->getStringPtr();
dMeter2Info_getStringKanji(uVar6, stringPtr, NULL);
stringPtr = static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('item_n02')))->getStringPtr();
dMeter2Info_getStringKanji(uVar6, stringPtr, NULL);
stringPtr = static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('item_n03')))->getStringPtr();
dMeter2Info_getStringKanji(uVar6, stringPtr, NULL);
} else {
TEXT_SPAN stringPtr =
static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('item_n04')))->getStringPtr();
dMeter2Info_getStringKanji(uVar6, stringPtr, NULL);
stringPtr = static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('item_n05')))->getStringPtr();
dMeter2Info_getStringKanji(uVar6, stringPtr, NULL);
stringPtr = static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('item_n06')))->getStringPtr();
dMeter2Info_getStringKanji(uVar6, stringPtr, NULL);
stringPtr = static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('item_n07')))->getStringPtr();
dMeter2Info_getStringKanji(uVar6, stringPtr, NULL);
}
#elif REGION_JPN
TEXT_SPAN stringPtr =
static_cast<J2DTextBox*>(mpScreen->search(MULTI_CHAR('item_n00')))->getStringPtr();
dMeter2Info_getStringKanji(uVar6, stringPtr, NULL);
@@ -2475,7 +2612,26 @@ void dMenu_Collect2D_c::setItemNameString(u8 param_0, u8 param_1) {
void dMenu_Collect2D_c::setItemNameStringNull() {
mItemNameString = 0;
#if REGION_JPN
#if TARGET_PC
J2DTextBox* textBox;
if (dusk::version::isRegionJpn()) {
textBox = (J2DTextBox*)mpScreen->search(MULTI_CHAR('item_n00'));
SAFE_STRCPY(textBox->getStringPtr(), "");
textBox = (J2DTextBox*)mpScreen->search(MULTI_CHAR('item_n01'));
SAFE_STRCPY(textBox->getStringPtr(), "");
textBox = (J2DTextBox*)mpScreen->search(MULTI_CHAR('item_n02'));
SAFE_STRCPY(textBox->getStringPtr(), "");
textBox = (J2DTextBox*)mpScreen->search(MULTI_CHAR('item_n03'));
} else {
textBox = (J2DTextBox*)mpScreen->search(MULTI_CHAR('item_n04'));
SAFE_STRCPY(textBox->getStringPtr(), "");
textBox = (J2DTextBox*)mpScreen->search(MULTI_CHAR('item_n05'));
SAFE_STRCPY(textBox->getStringPtr(), "");
textBox = (J2DTextBox*)mpScreen->search(MULTI_CHAR('item_n06'));
SAFE_STRCPY(textBox->getStringPtr(), "");
textBox = (J2DTextBox*)mpScreen->search(MULTI_CHAR('item_n07'));
}
#elif REGION_JPN
J2DTextBox* textBox = (J2DTextBox*)mpScreen->search(MULTI_CHAR('item_n00'));
SAFE_STRCPY(textBox->getStringPtr(), "");
textBox = (J2DTextBox*)mpScreen->search(MULTI_CHAR('item_n01'));
+81 -10
View File
@@ -26,6 +26,7 @@
#include "m_Do/m_Do_graphic.h"
#include <cstring>
#include "dusk/version.hpp"
#include "helpers/string.hpp"
#if TARGET_PC
@@ -304,6 +305,16 @@ void dMenu_DmapBg_c::buttonIconScreenInit() {
static u64 const cont_bt[5] = {MULTI_CHAR('cont_bt'), MULTI_CHAR('cont_bt1'), MULTI_CHAR('cont_bt2'), MULTI_CHAR('cont_bt3'), MULTI_CHAR('cont_bt4')};
static u64 const font_at[5] = {MULTI_CHAR('font_at'), MULTI_CHAR('font_at1'), MULTI_CHAR('font_at2'), MULTI_CHAR('font_at3'), MULTI_CHAR('font_at4')};
static u64 const font_bt[5] = {MULTI_CHAR('font_bt'), MULTI_CHAR('font_bt1'), MULTI_CHAR('font_bt2'), MULTI_CHAR('font_bt3'), MULTI_CHAR('font_bt4')};
#if TARGET_PC
static u64 const c_tag_jpn[2] = {
MULTI_CHAR('c_text_s'), MULTI_CHAR('c_text')
};
static u64 const c_tag[2] = {
MULTI_CHAR('f_text_s'), MULTI_CHAR('f_text')
};
#else
static u64 const c_tag[2] = {
#if VERSION == VERSION_GCN_JPN
MULTI_CHAR('c_text_s'), MULTI_CHAR('c_text')
@@ -311,6 +322,7 @@ void dMenu_DmapBg_c::buttonIconScreenInit() {
MULTI_CHAR('f_text_s'), MULTI_CHAR('f_text')
#endif
};
#endif
mButtonScreen = JKR_NEW J2DScreen();
JUT_ASSERT(916, mButtonScreen != NULL);
@@ -350,7 +362,23 @@ void dMenu_DmapBg_c::buttonIconScreenInit() {
mpJButton = NULL;
for (int i = 0; i < 5; i++) {
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
((J2DTextBox*)mButtonScreen->search(cont_at[i]))->setFont(mDoExt_getMesgFont());
((J2DTextBox*)mButtonScreen->search(cont_bt[i]))->setFont(mDoExt_getMesgFont());
((J2DTextBox*)mButtonScreen->search(cont_at[i]))->setString(32, "");
((J2DTextBox*)mButtonScreen->search(cont_bt[i]))->setString(32, "");
((J2DTextBox*)mButtonScreen->search(font_at[i]))->hide();
((J2DTextBox*)mButtonScreen->search(font_bt[i]))->hide();
} else {
((J2DTextBox*)mButtonScreen->search(font_at[i]))->setFont(mDoExt_getMesgFont());
((J2DTextBox*)mButtonScreen->search(font_bt[i]))->setFont(mDoExt_getMesgFont());
((J2DTextBox*)mButtonScreen->search(font_at[i]))->setString(32, "");
((J2DTextBox*)mButtonScreen->search(font_bt[i]))->setString(32, "");
((J2DTextBox*)mButtonScreen->search(cont_at[i]))->hide();
((J2DTextBox*)mButtonScreen->search(cont_bt[i]))->hide();
}
#elif VERSION == VERSION_GCN_JPN
((J2DTextBox*)mButtonScreen->search(cont_at[i]))->setFont(mDoExt_getMesgFont());
((J2DTextBox*)mButtonScreen->search(cont_bt[i]))->setFont(mDoExt_getMesgFont());
((J2DTextBox*)mButtonScreen->search(cont_at[i]))->setString(32, "");
@@ -372,7 +400,7 @@ void dMenu_DmapBg_c::buttonIconScreenInit() {
J2DTextBox* textBox;
for (int i = 0; i < 2; i++) {
textBox = ((J2DTextBox*)mButtonScreen->search(c_tag[i]));
textBox = ((J2DTextBox*)mButtonScreen->search(DUSK_IF_ELSE(dusk::version::isRegionJpn() ? c_tag_jpn[i] : c_tag[i], c_tag[i])));
textBox->setFont(mDoExt_getMesgFont());
textBox->setString(32, "");
}
@@ -389,6 +417,14 @@ void dMenu_DmapBg_c::buttonIconScreenInit() {
}
void dMenu_DmapBg_c::setAButtonString(u32 i_msgNo) {
#if TARGET_PC
static u64 const cont_at_jpn[5] = {
MULTI_CHAR('cont_at'), MULTI_CHAR('cont_at1'), MULTI_CHAR('cont_at2'), MULTI_CHAR('cont_at3'), MULTI_CHAR('cont_at4')
};
static u64 const cont_at[5] = {
MULTI_CHAR('font_at'), MULTI_CHAR('font_at1'), MULTI_CHAR('font_at2'), MULTI_CHAR('font_at3'), MULTI_CHAR('font_at4')
};
#else
static u64 const cont_at[5] = {
#if VERSION == VERSION_GCN_JPN
MULTI_CHAR('cont_at'), MULTI_CHAR('cont_at1'), MULTI_CHAR('cont_at2'), MULTI_CHAR('cont_at3'), MULTI_CHAR('cont_at4')
@@ -396,16 +432,26 @@ void dMenu_DmapBg_c::setAButtonString(u32 i_msgNo) {
MULTI_CHAR('font_at'), MULTI_CHAR('font_at1'), MULTI_CHAR('font_at2'), MULTI_CHAR('font_at3'), MULTI_CHAR('font_at4')
#endif
};
#endif
for (int i = 0; i < 5; i++) {
if (i_msgNo == 0) {
SAFE_STRCPY(((J2DTextBox*)mButtonScreen->search(cont_at[i]))->getStringPtr(), "");
SAFE_STRCPY(((J2DTextBox*)mButtonScreen->search(DUSK_IF_ELSE(dusk::version::isRegionJpn() ? cont_at_jpn[i] : cont_at[i], cont_at[i])))->getStringPtr(), "");
} else {
dMeter2Info_getStringKanji(i_msgNo, ((J2DTextBox*)mButtonScreen->search(cont_at[i]))->getStringPtr(), NULL);
dMeter2Info_getStringKanji(i_msgNo, ((J2DTextBox*)mButtonScreen->search(DUSK_IF_ELSE(dusk::version::isRegionJpn() ? cont_at_jpn[i] : cont_at[i], cont_at[i])))->getStringPtr(), NULL);
}
}
}
void dMenu_DmapBg_c::setBButtonString(u32 i_msgNo) {
#if TARGET_PC
static u64 const cont_bt_jpn[5] = {
MULTI_CHAR('cont_bt'), MULTI_CHAR('cont_bt1'), MULTI_CHAR('cont_bt2'), MULTI_CHAR('cont_bt3'), MULTI_CHAR('cont_bt4')
};
static u64 const cont_bt[5] = {
MULTI_CHAR('font_bt'), MULTI_CHAR('font_bt1'), MULTI_CHAR('font_bt2'), MULTI_CHAR('font_bt3'), MULTI_CHAR('font_bt4')
};
#else
static u64 const cont_bt[5] = {
#if VERSION == VERSION_GCN_JPN
MULTI_CHAR('cont_bt'), MULTI_CHAR('cont_bt1'), MULTI_CHAR('cont_bt2'), MULTI_CHAR('cont_bt3'), MULTI_CHAR('cont_bt4')
@@ -413,11 +459,13 @@ void dMenu_DmapBg_c::setBButtonString(u32 i_msgNo) {
MULTI_CHAR('font_bt'), MULTI_CHAR('font_bt1'), MULTI_CHAR('font_bt2'), MULTI_CHAR('font_bt3'), MULTI_CHAR('font_bt4')
#endif
};
#endif
for (int i = 0; i < 5; i++) {
if (i_msgNo == 0) {
SAFE_STRCPY(((J2DTextBox*)mButtonScreen->search(cont_bt[i]))->getStringPtr(), "");
SAFE_STRCPY(((J2DTextBox*)mButtonScreen->search(DUSK_IF_ELSE(dusk::version::isRegionJpn() ? cont_bt_jpn[i] : cont_bt[i], cont_bt[i])))->getStringPtr(), "");
} else {
dMeter2Info_getStringKanji(i_msgNo, ((J2DTextBox*)mButtonScreen->search(cont_bt[i]))->getStringPtr(), NULL);
dMeter2Info_getStringKanji(i_msgNo, ((J2DTextBox*)mButtonScreen->search(DUSK_IF_ELSE(dusk::version::isRegionJpn() ? cont_bt_jpn[i] : cont_bt[i], cont_bt[i])))->getStringPtr(), NULL);
}
}
}
@@ -429,6 +477,14 @@ static f32 player_py;
DUSK_GAME_DATA dMenu_Dmap_c* dMenu_Dmap_c::myclass;
void dMenu_DmapBg_c::setCButtonString(u32 i_msgNo) {
#if TARGET_PC
static u64 const c_tag_jpn[2] = {
MULTI_CHAR('c_text_s'), MULTI_CHAR('c_text')
};
static u64 const c_tag[2] = {
MULTI_CHAR('f_text_s'), MULTI_CHAR('f_text')
};
#else
static u64 const c_tag[2] = {
#if VERSION == VERSION_GCN_JPN
MULTI_CHAR('c_text_s'), MULTI_CHAR('c_text')
@@ -436,6 +492,7 @@ void dMenu_DmapBg_c::setCButtonString(u32 i_msgNo) {
MULTI_CHAR('f_text_s'), MULTI_CHAR('f_text')
#endif
};
#endif
int i;
u32 msgNo;
@@ -447,12 +504,12 @@ void dMenu_DmapBg_c::setCButtonString(u32 i_msgNo) {
if (msgNo == 0) {
for (i = 0; i < 2; i++) {
SAFE_STRCPY(((J2DTextBox*)mButtonScreen->search(c_tag[i]))->getStringPtr(), "");
SAFE_STRCPY(((J2DTextBox*)mButtonScreen->search(DUSK_IF_ELSE(dusk::version::isRegionJpn() ? c_tag_jpn[i] : c_tag[i], c_tag[i])))->getStringPtr(), "");
}
mpCButton->setAlphaRate(0.5f);
} else {
for (i = 0; i < 2; i++) {
dMeter2Info_getStringKanji(msgNo, ((J2DTextBox*)mButtonScreen->search(c_tag[i]))->getStringPtr(), NULL);
dMeter2Info_getStringKanji(msgNo, ((J2DTextBox*)mButtonScreen->search(DUSK_IF_ELSE(dusk::version::isRegionJpn() ? c_tag_jpn[i] : c_tag[i], c_tag[i])))->getStringPtr(), NULL);
}
mpCButton->setAlphaRate(1.0f);
}
@@ -511,7 +568,16 @@ void dMenu_DmapBg_c::baseScreenInit() {
mpDrawCursor->setAlphaRate(1.0f);
mpDrawCursor->setParam(0.95f, 0.9f, 0.1f, 0.6f, 0.5f);
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
J2DTextBox* uVar9;
if (dusk::version::isRegionJpn()) {
uVar9 = (J2DTextBox*)mBaseScreen->search(MULTI_CHAR('t_t00'));
mBaseScreen->search(MULTI_CHAR('f_t_00'))->hide();
} else {
uVar9 = (J2DTextBox*)mBaseScreen->search(MULTI_CHAR('f_t_00'));
mBaseScreen->search(MULTI_CHAR('t_t00'))->hide();
}
#elif VERSION == VERSION_GCN_JPN
J2DTextBox* uVar9 = (J2DTextBox*)mBaseScreen->search(MULTI_CHAR('t_t00'));
mBaseScreen->search(MULTI_CHAR('f_t_00'))->hide();
#else
@@ -541,7 +607,12 @@ void dMenu_DmapBg_c::setFloorMessage() {
0x036E, 0x036F, 0x03DC, 0x03DD, 0x03D9, 0x03D8,
};
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
u64 tag0 = dusk::version::isRegionJpn() ? MULTI_CHAR('ffoor0_0') : MULTI_CHAR('floor0_0');
#define FLOOR_TAG(A, B) (tag0 | (A<<16) | (B))
u64 tag1 = dusk::version::isRegionJpn() ? MULTI_CHAR('floor0_0') : MULTI_CHAR('ffoor0_0');
#define FFOOR_TAG(A, B) (tag1 | (A<<16) | (B))
#elif VERSION == VERSION_GCN_JPN
#define FLOOR_TAG(A, B) (MULTI_CHAR('ffoor0_0') | (A<<16) | (B))
#define FFOOR_TAG(A, B) (MULTI_CHAR('floor0_0') | (A<<16) | (B))
#else
+10 -1
View File
@@ -305,7 +305,16 @@ void dMenu_Fishing_c::screenSetBase() {
mpFishInfoParent[0] = JKR_NEW CPaneMgr(mpScreen, MULTI_CHAR('info_blu'), 0, NULL);
mpFishInfoParent[1] = JKR_NEW CPaneMgr(mpScreen, MULTI_CHAR('info_red'), 0, NULL);
#if (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
#if TARGET_PC
J2DTextBox* textBox;
if (dusk::version::isRegionJpn()) {
textBox = (J2DTextBox*)mpScreen->search(MULTI_CHAR('t_t00'));
mpScreen->search(MULTI_CHAR('f_t00'))->hide();
} else {
textBox = (J2DTextBox*)mpScreen->search(MULTI_CHAR('f_t00'));
mpScreen->search(MULTI_CHAR('t_t00'))->hide();
}
#elif (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
J2DTextBox* textBox = (J2DTextBox*)mpScreen->search(MULTI_CHAR('t_t00'));
mpScreen->search(MULTI_CHAR('f_t00'))->hide();
#else
+5 -3
View File
@@ -21,8 +21,9 @@
#include "d/d_msg_object.h"
#include "d/d_msg_scrn_explain.h"
#include "d/d_stage.h"
#include "helpers/string.hpp"
#include "dusk/version.hpp"
#include "f_op/f_op_msg_mng.h"
#include "helpers/string.hpp"
#if TARGET_PC
#include "dusk/frame_interpolation.h"
@@ -1217,7 +1218,8 @@ void dMenu_Fmap_c::spot_map_proc() {
{
mpDraw2DBack->stageMapMove(mpStick, 1, true);
} else if (dMw_Z_TRIGGER() && mpDraw2DTop->isWarpAccept()) {
#if VERSION >= VERSION_GCN_JPN
#if TARGET_PC || VERSION >= VERSION_GCN_JPN
IF_DUSK_BLOCK(dusk::version::isRegionJpn())
//! JPN version added a check to make sure if Arbiter's Grounds is cleared that
//! the Mirror Chamber Statue has been spun before allowing portal warping from the map screen.
if (dComIfGs_isEventBit(dSv_event_flag_c::saveBitLabels[265]) && !dComIfGs_isEventBit(dSv_event_flag_c::saveBitLabels[361])) {
@@ -1227,7 +1229,7 @@ void dMenu_Fmap_c::spot_map_proc() {
mPrevProcessAlt = mProcess;
setProcess(PROC_PORTAL_WARP_FORBID);
Z2GetAudioMgr()->seStart(Z2SE_SYS_ERROR, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0);
} else
} IF_DUSK_BLOCK_END else
#endif
if (mpDraw2DTop->checkPlayerWarpAccept()) {
mIsWarpMap = true;
+121 -18
View File
@@ -23,6 +23,8 @@
#endif
#include <cstring>
#include "dusk/version.hpp"
#if TARGET_PC
void dMenu_Fmap2DBack_c::fMapBackWide() {
mpBaseScreen->scale(mDoGph_gInf_c::hudAspectScaleUp, 1.0f);
@@ -2417,7 +2419,17 @@ dMenu_Fmap2DTop_c::dMenu_Fmap2DTop_c(JKRExpHeap* i_heap, STControl* i_stick) {
static const u64 area_name[3] = {MULTI_CHAR('i_name_s'), MULTI_CHAR('i_name') ,MULTI_CHAR('i_name1')};
static const u64 farea_name[3] = {MULTI_CHAR('f_name_1'), MULTI_CHAR('f_name3'), MULTI_CHAR('f_name2')};
for (int i = 0; i < 3; i++) {
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
static_cast<J2DTextBox*>(mpTitleScreen->search(area_name[i]))->setFont(mDoExt_getRubyFont());
static_cast<J2DTextBox*>(mpTitleScreen->search(area_name[i]))->setString(0x40, "");
mpTitleScreen->search(farea_name[i])->hide();
} else {
static_cast<J2DTextBox*>(mpTitleScreen->search(farea_name[i]))->setFont(mDoExt_getRubyFont());
static_cast<J2DTextBox*>(mpTitleScreen->search(farea_name[i]))->setString(0x40, "");
mpTitleScreen->search(area_name[i])->hide();
}
#elif VERSION == VERSION_GCN_JPN
static_cast<J2DTextBox*>(mpTitleScreen->search(area_name[i]))
->setFont(mDoExt_getRubyFont());
static_cast<J2DTextBox*>(mpTitleScreen->search(area_name[i]))->setString(0x40, "");
@@ -2445,7 +2457,17 @@ dMenu_Fmap2DTop_c::dMenu_Fmap2DTop_c(JKRExpHeap* i_heap, STControl* i_stick) {
};
#endif
for (int i = 0; i < 7; i++) {
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
static_cast<J2DTextBox*>(mpTitleScreen->search(sfont_name[i]))->setFont(mDoExt_getRubyFont());
static_cast<J2DTextBox*>(mpTitleScreen->search(sfont_name[i]))->setString(0x40, "");
mpTitleScreen->search(ffont_name[i])->hide();
} else {
static_cast<J2DTextBox*>(mpTitleScreen->search(ffont_name[i]))->setFont(mDoExt_getRubyFont());
static_cast<J2DTextBox*>(mpTitleScreen->search(ffont_name[i]))->setString(0x40, "");
mpTitleScreen->search(sfont_name[i])->hide();
}
#elif VERSION == VERSION_GCN_JPN
static_cast<J2DTextBox*>(mpTitleScreen->search(sfont_name[i]))
->setFont(mDoExt_getRubyFont());
static_cast<J2DTextBox*>(mpTitleScreen->search(sfont_name[i]))->setString(0x40, "");
@@ -2462,7 +2484,17 @@ dMenu_Fmap2DTop_c::dMenu_Fmap2DTop_c(JKRExpHeap* i_heap, STControl* i_stick) {
static const u64 cont_zt[5] = {MULTI_CHAR('cont_zt'), MULTI_CHAR('cont_zt1'), MULTI_CHAR('cont_zt2'), MULTI_CHAR('cont_zt3'), MULTI_CHAR('cont_zt4')};
static const u64 font_zt[5] = {MULTI_CHAR('font_zt1'), MULTI_CHAR('font_zt2'), MULTI_CHAR('font_zt3'), MULTI_CHAR('font_zt4'), MULTI_CHAR('font_zt5')};
for (int i = 0; i < 5; i++) {
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
static_cast<J2DTextBox*>(mpTitleScreen->search(cont_zt[i]))->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpTitleScreen->search(cont_zt[i]))->setString(0x20, "");
mpTitleScreen->search(font_zt[i])->hide();
} else {
static_cast<J2DTextBox*>(mpTitleScreen->search(font_zt[i]))->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpTitleScreen->search(font_zt[i]))->setString(0x20, "");
mpTitleScreen->search(cont_zt[i])->hide();
}
#elif VERSION == VERSION_GCN_JPN
static_cast<J2DTextBox*>(mpTitleScreen->search(cont_zt[i]))
->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpTitleScreen->search(cont_zt[i]))->setString(0x20, "");
@@ -2483,7 +2515,17 @@ dMenu_Fmap2DTop_c::dMenu_Fmap2DTop_c(JKRExpHeap* i_heap, STControl* i_stick) {
static const u64 font_bt[5] = {MULTI_CHAR('font_bt1'), MULTI_CHAR('font_bt2'), MULTI_CHAR('font_bt3'), MULTI_CHAR('font_bt4'), MULTI_CHAR('font_bt5')};
#endif
for (int i = 0; i < 5; i++) {
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
static_cast<J2DTextBox*>(mpTitleScreen->search(cont_bt[i]))->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpTitleScreen->search(cont_bt[i]))->setString(0x20, "");
mpTitleScreen->search(font_bt[i])->hide();
} else {
static_cast<J2DTextBox*>(mpTitleScreen->search(font_bt[i]))->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpTitleScreen->search(font_bt[i]))->setString(0x20, "");
mpTitleScreen->search(cont_bt[i])->hide();
}
#elif VERSION == VERSION_GCN_JPN
static_cast<J2DTextBox*>(mpTitleScreen->search(cont_bt[i]))
->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpTitleScreen->search(cont_bt[i]))->setString(0x20, "");
@@ -2500,7 +2542,17 @@ dMenu_Fmap2DTop_c::dMenu_Fmap2DTop_c(JKRExpHeap* i_heap, STControl* i_stick) {
static const u64 cont_at[5] = {MULTI_CHAR('cont_at'), MULTI_CHAR('cont_at1'), MULTI_CHAR('cont_at2'), MULTI_CHAR('cont_at3'), MULTI_CHAR('cont_at4')};
static const u64 font_at[5] = {MULTI_CHAR('font_at1'), MULTI_CHAR('font_at2'), MULTI_CHAR('font_at3'), MULTI_CHAR('font_at4'), MULTI_CHAR('font_at5')};
for (int i = 0; i < 5; i++) {
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
static_cast<J2DTextBox*>(mpTitleScreen->search(cont_at[i]))->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpTitleScreen->search(cont_at[i]))->setString(0x20, "");
mpTitleScreen->search(font_at[i])->hide();
} else {
static_cast<J2DTextBox*>(mpTitleScreen->search(font_at[i]))->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpTitleScreen->search(font_at[i]))->setString(0x20, "");
mpTitleScreen->search(cont_at[i])->hide();
}
#elif VERSION == VERSION_GCN_JPN
static_cast<J2DTextBox*>(mpTitleScreen->search(cont_at[i]))
->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpTitleScreen->search(cont_at[i]))->setString(0x20, "");
@@ -2518,7 +2570,17 @@ dMenu_Fmap2DTop_c::dMenu_Fmap2DTop_c(JKRExpHeap* i_heap, STControl* i_stick) {
static const u64 juji_c[5] = {MULTI_CHAR('juji_c00'), MULTI_CHAR('juji_c01'), MULTI_CHAR('juji_c02'), MULTI_CHAR('juji_c03'), MULTI_CHAR('juji_c04')};
static const u64 fuji_c[5] = {MULTI_CHAR('fuji_c00'), MULTI_CHAR('fuji_c01'), MULTI_CHAR('fuji_c02'), MULTI_CHAR('fuji_c03'), MULTI_CHAR('fuji_c04')};
for (int i = 0; i < 5; i++) {
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
static_cast<J2DTextBox*>(mpTitleScreen->search(juji_c[i]))->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpTitleScreen->search(juji_c[i]))->setString(0x20, "");
mpTitleScreen->search(fuji_c[i])->hide();
} else {
static_cast<J2DTextBox*>(mpTitleScreen->search(fuji_c[i]))->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpTitleScreen->search(fuji_c[i]))->setString(0x20, "");
mpTitleScreen->search(juji_c[i])->hide();
}
#elif VERSION == VERSION_GCN_JPN
static_cast<J2DTextBox*>(mpTitleScreen->search(juji_c[i]))
->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpTitleScreen->search(juji_c[i]))->setString(0x20, "");
@@ -2535,7 +2597,17 @@ dMenu_Fmap2DTop_c::dMenu_Fmap2DTop_c(JKRExpHeap* i_heap, STControl* i_stick) {
static const u64 ast_c[5] = {MULTI_CHAR('ast_00'), MULTI_CHAR('ast_01'), MULTI_CHAR('ast_02'), MULTI_CHAR('ast_03'), MULTI_CHAR('ast_04')};
static const u64 fst_c[5] = {MULTI_CHAR('fst_00'), MULTI_CHAR('fst_01'), MULTI_CHAR('fst_02'), MULTI_CHAR('fst_03'), MULTI_CHAR('fst_04')};
for (int i = 0; i < 5; i++) {
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
static_cast<J2DTextBox*>(mpTitleScreen->search(ast_c[i]))->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpTitleScreen->search(ast_c[i]))->setString(0x20, "");
mpTitleScreen->search(fst_c[i])->hide();
} else {
static_cast<J2DTextBox*>(mpTitleScreen->search(fst_c[i]))->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpTitleScreen->search(fst_c[i]))->setString(0x20, "");
mpTitleScreen->search(ast_c[i])->hide();
}
#elif VERSION == VERSION_GCN_JPN
static_cast<J2DTextBox*>(mpTitleScreen->search(ast_c[i]))
->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpTitleScreen->search(ast_c[i]))->setString(0x20, "");
@@ -2784,7 +2856,16 @@ void dMenu_Fmap2DTop_c::setMoyaAlpha(u8 i_alpha) {
}
void dMenu_Fmap2DTop_c::setTitleNameString(u32 param_0) {
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
static const u64 sfont_name[7] = {
MULTI_CHAR('sfont00'), MULTI_CHAR('sfontl0'), MULTI_CHAR('sfontl1'), MULTI_CHAR('sfontl2'), MULTI_CHAR('sfontb0'), MULTI_CHAR('sfontb1'), MULTI_CHAR('sfontb2')
};
static const u64 ffont_name[7] = {
MULTI_CHAR('ffont00'), MULTI_CHAR('ffontl0'), MULTI_CHAR('ffontl1'), MULTI_CHAR('ffontl2'), MULTI_CHAR('ffontb0'), MULTI_CHAR('ffontb3'), MULTI_CHAR('ffontb4')
};
auto setTitleNameString_font_name = dusk::version::isRegionJpn() ? sfont_name : ffont_name;
#elif VERSION == VERSION_GCN_JPN
static const u64 sfont_name[7] = {
MULTI_CHAR('sfont00'), MULTI_CHAR('sfontl0'), MULTI_CHAR('sfontl1'), MULTI_CHAR('sfontl2'), MULTI_CHAR('sfontb0'), MULTI_CHAR('sfontb1'), MULTI_CHAR('sfontb2')
};
@@ -2816,7 +2897,11 @@ void dMenu_Fmap2DTop_c::setTitleNameString(u32 param_0) {
}
void dMenu_Fmap2DTop_c::setAreaNameString(u32 param_0) {
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
static const u64 iarea_name[3] = {MULTI_CHAR('i_name_s'), MULTI_CHAR('i_name'), MULTI_CHAR('i_name1')};
static const u64 farea_name[3] = {MULTI_CHAR('f_name_1'), MULTI_CHAR('f_name3'), MULTI_CHAR('f_name2')};
auto setAreaNameString_area_name = dusk::version::isRegionJpn() ? iarea_name : farea_name;
#elif VERSION == VERSION_GCN_JPN
static const u64 iarea_name[3] = {MULTI_CHAR('i_name_s'), MULTI_CHAR('i_name'), MULTI_CHAR('i_name1')};
#define setAreaNameString_area_name iarea_name
#else
@@ -2849,7 +2934,11 @@ void dMenu_Fmap2DTop_c::setZButtonString(u32 param_0, u8 i_alpha) {
dusk::ui::ControlOverride::Default);
#endif
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
static const u64 cont_zt[5] = {MULTI_CHAR('cont_zt'), MULTI_CHAR('cont_zt1'), MULTI_CHAR('cont_zt2'), MULTI_CHAR('cont_zt3'), MULTI_CHAR('cont_zt4')};
static const u64 font_zt[5] = {MULTI_CHAR('font_zt1'), MULTI_CHAR('font_zt2'), MULTI_CHAR('font_zt3'), MULTI_CHAR('font_zt4'), MULTI_CHAR('font_zt5')};
auto setZButtonString_font_zt = dusk::version::isRegionJpn() ? cont_zt : font_zt;
#elif VERSION == VERSION_GCN_JPN
static const u64 cont_zt[5] = {MULTI_CHAR('cont_zt'), MULTI_CHAR('cont_zt1'), MULTI_CHAR('cont_zt2'), MULTI_CHAR('cont_zt3'), MULTI_CHAR('cont_zt4')};
#define setZButtonString_font_zt cont_zt
#else
@@ -2883,7 +2972,11 @@ void dMenu_Fmap2DTop_c::setZButtonString(u32 param_0, u8 i_alpha) {
}
void dMenu_Fmap2DTop_c::setBButtonString(u32 param_0, u8 i_alpha) {
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
static const u64 cont_bt[5] = {MULTI_CHAR('cont_bt1'), MULTI_CHAR('cont_bt2'), MULTI_CHAR('cont_bt3'), MULTI_CHAR('cont_bt4'), MULTI_CHAR('cont_bt')};
static const u64 font_bt[5] = {MULTI_CHAR('font_bt1'), MULTI_CHAR('font_bt2'), MULTI_CHAR('font_bt3'), MULTI_CHAR('font_bt4'), MULTI_CHAR('font_bt5')};
auto setBButtonString_font_bt = dusk::version::isRegionJpn() ? cont_bt : font_bt;
#elif VERSION == VERSION_GCN_JPN
static const u64 cont_bt[5] = {MULTI_CHAR('cont_bt1'), MULTI_CHAR('cont_bt2'), MULTI_CHAR('cont_bt3'), MULTI_CHAR('cont_bt4'), MULTI_CHAR('cont_bt')};
#define setBButtonString_font_bt cont_bt
#else
@@ -2909,7 +3002,11 @@ void dMenu_Fmap2DTop_c::setBButtonString(u32 param_0, u8 i_alpha) {
}
void dMenu_Fmap2DTop_c::setAButtonString(u32 param_0, u8 i_alpha) {
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
static const u64 cont_at[5] = {MULTI_CHAR('cont_at'), MULTI_CHAR('cont_at1'), MULTI_CHAR('cont_at2'), MULTI_CHAR('cont_at3'), MULTI_CHAR('cont_at4')};
static const u64 font_at[5] = {MULTI_CHAR('font_at1'), MULTI_CHAR('font_at2'), MULTI_CHAR('font_at3'), MULTI_CHAR('font_at4'), MULTI_CHAR('font_at5')};
auto setAButtonString_font_at = dusk::version::isRegionJpn() ? cont_at : font_at;
#elif VERSION == VERSION_GCN_JPN
static const u64 cont_at[5] = {MULTI_CHAR('cont_at'), MULTI_CHAR('cont_at1'), MULTI_CHAR('cont_at2'), MULTI_CHAR('cont_at3'), MULTI_CHAR('cont_at4')};
#define setAButtonString_font_at cont_at
#else
@@ -2936,21 +3033,24 @@ void dMenu_Fmap2DTop_c::setAButtonString(u32 param_0, u8 i_alpha) {
void dMenu_Fmap2DTop_c::setCrossLRString(u32 param_0) {
#if PLATFORM_GCN || (VERSION == VERSION_SHIELD)
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
static const u64 juji_c_jpn[5] = {MULTI_CHAR('juji_c00'), MULTI_CHAR('juji_c01'), MULTI_CHAR('juji_c02'), MULTI_CHAR('juji_c03'), MULTI_CHAR('juji_c04')};
static const u64 juji_c[5] = {MULTI_CHAR('fuji_c00'), MULTI_CHAR('fuji_c01'), MULTI_CHAR('fuji_c02'), MULTI_CHAR('fuji_c03'), MULTI_CHAR('fuji_c04')};
#elif VERSION == VERSION_GCN_JPN
static const u64 juji_c[5] = {MULTI_CHAR('juji_c00'), MULTI_CHAR('juji_c01'), MULTI_CHAR('juji_c02'), MULTI_CHAR('juji_c03'), MULTI_CHAR('juji_c04')};
#else
static const u64 juji_c[5] = {MULTI_CHAR('fuji_c00'), MULTI_CHAR('fuji_c01'), MULTI_CHAR('fuji_c02'), MULTI_CHAR('fuji_c03'), MULTI_CHAR('fuji_c04')};
#endif
if (param_0 == 0) {
for (int i = 0; i < 5; i++) {
J2DTextBox* text_box = static_cast<J2DTextBox*>(mpTitleScreen->search(juji_c[i]));
J2DTextBox* text_box = static_cast<J2DTextBox*>(mpTitleScreen->search(DUSK_IF_ELSE(dusk::version::isRegionJpn() ? juji_c_jpn[i] : juji_c[i], juji_c[i])));
SAFE_STRCPY(text_box->getStringPtr(), "");
}
mpTitleScreen->search(MULTI_CHAR('juy_sha0'))->show();
mAlphaDpad = 1;
} else {
for (int i = 0; i < 5; i++) {
J2DTextBox* text_box = static_cast<J2DTextBox*>(mpTitleScreen->search(juji_c[i]));
J2DTextBox* text_box = static_cast<J2DTextBox*>(mpTitleScreen->search(DUSK_IF_ELSE(dusk::version::isRegionJpn() ? juji_c_jpn[i] : juji_c[i], juji_c[i])));
dMeter2Info_getStringKanji(param_0, text_box->getStringPtr(), NULL);
}
mpTitleScreen->search(MULTI_CHAR('juy_sha0'))->show();
@@ -2961,21 +3061,24 @@ void dMenu_Fmap2DTop_c::setCrossLRString(u32 param_0) {
void dMenu_Fmap2DTop_c::set3DStickString(u32 param_0) {
#if PLATFORM_GCN || (VERSION == VERSION_SHIELD)
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
static const u64 ast_c_jpn[5] = {MULTI_CHAR('ast_00'), MULTI_CHAR('ast_01'), MULTI_CHAR('ast_02'), MULTI_CHAR('ast_03'), MULTI_CHAR('ast_04')};
static const u64 ast_c[5] = {MULTI_CHAR('fst_00'), MULTI_CHAR('fst_01'), MULTI_CHAR('fst_02'), MULTI_CHAR('fst_03'), MULTI_CHAR('fst_04')};
#elif VERSION == VERSION_GCN_JPN
static const u64 ast_c[5] = {MULTI_CHAR('ast_00'), MULTI_CHAR('ast_01'), MULTI_CHAR('ast_02'), MULTI_CHAR('ast_03'), MULTI_CHAR('ast_04')};
#else
static const u64 ast_c[5] = {MULTI_CHAR('fst_00'), MULTI_CHAR('fst_01'), MULTI_CHAR('fst_02'), MULTI_CHAR('fst_03'), MULTI_CHAR('fst_04')};
#endif
if (param_0 == 0) {
for (int i = 0; i < 5; i++) {
J2DTextBox* text_box = static_cast<J2DTextBox*>(mpTitleScreen->search(ast_c[i]));
J2DTextBox* text_box = static_cast<J2DTextBox*>(mpTitleScreen->search(DUSK_IF_ELSE(dusk::version::isRegionJpn() ? ast_c_jpn[i] : ast_c[i], ast_c[i])));
SAFE_STRCPY(text_box->getStringPtr(), "");
}
mpTitleScreen->search(MULTI_CHAR('as_sha0'))->show();
mAlphaAnalogStick = 1;
} else {
for (int i = 0; i < 5; i++) {
J2DTextBox* text_box = static_cast<J2DTextBox*>(mpTitleScreen->search(ast_c[i]));
J2DTextBox* text_box = static_cast<J2DTextBox*>(mpTitleScreen->search(DUSK_IF_ELSE(dusk::version::isRegionJpn() ? ast_c_jpn[i] : ast_c[i], ast_c[i])));
dMeter2Info_getStringKanji(param_0, text_box->getStringPtr(), NULL);
}
mpTitleScreen->search(MULTI_CHAR('as_sha0'))->show();
+25 -2
View File
@@ -22,6 +22,8 @@
#include <cstdio>
#include <cstring>
#include "dusk/version.hpp"
#if TARGET_PC
#include "dusk/menu_pointer.h"
#endif
@@ -535,7 +537,16 @@ void dMenu_Insect_c::screenSetBase() {
}
}
}
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
J2DTextBox* textBox;
if (dusk::version::isRegionJpn()) {
textBox = (J2DTextBox*)mpScreen->search(MULTI_CHAR('t_t00'));
mpScreen->search(MULTI_CHAR('f_t00'))->hide();
} else {
textBox = (J2DTextBox*)mpScreen->search(MULTI_CHAR('f_t00'));
mpScreen->search(MULTI_CHAR('t_t00'))->hide();
}
#elif VERSION == VERSION_GCN_JPN
J2DTextBox* textBox = (J2DTextBox*)mpScreen->search(MULTI_CHAR('t_t00'));
mpScreen->search(MULTI_CHAR('f_t00'))->hide();
#else
@@ -558,7 +569,19 @@ void dMenu_Insect_c::screenSetExplain() {
if (field_0xf6 == 0) {
mpExpSubWin[1]->hide();
}
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
mpInfoText = JKR_NEW CPaneMgr(mpExpScreen, MULTI_CHAR('mg_3line'), 0, NULL);
mpExpScreen->search(MULTI_CHAR('n_e4line'))->hide();
field_0x5c = (J2DTextBox*)mpExpScreen->search(MULTI_CHAR('w_msg_jp'));
mpExpScreen->search(MULTI_CHAR('ms_for_2'))->hide();
} else {
mpInfoText = JKR_NEW CPaneMgr(mpExpScreen, MULTI_CHAR('mg_e4lin'), 0, NULL);
mpExpScreen->search(MULTI_CHAR('n_3line'))->hide();
field_0x5c = (J2DTextBox*)mpExpScreen->search(MULTI_CHAR('ms_for_2'));
mpExpScreen->search(MULTI_CHAR('w_msg_jp'))->hide();
}
#elif VERSION == VERSION_GCN_JPN
mpInfoText = JKR_NEW CPaneMgr(mpExpScreen, MULTI_CHAR('mg_3line'), 0, NULL);
mpExpScreen->search(MULTI_CHAR('n_e4line'))->hide();
field_0x5c = (J2DTextBox*)mpExpScreen->search(MULTI_CHAR('w_msg_jp'));
+27 -9
View File
@@ -5,25 +5,26 @@
#include "d/dolzel.h" // IWYU pragma: keep
#include "d/d_menu_item_explain.h"
#include <cstdio>
#include <cstring>
#include "JSystem/J2DGraph/J2DTextBox.h"
#include "JSystem/JKernel/JKRExpHeap.h"
#include "JSystem/JUtility/JUTTexture.h"
#include <cstdio>
#include <cstring>
#include "d/actor/d_a_player.h"
#include "d/d_com_inf_game.h"
#include "d/d_item.h"
#include "d/d_kantera_icon_meter.h"
#include "d/d_lib.h"
#include "d/d_select_cursor.h"
#include "d/d_menu_item_explain.h"
#include "d/d_meter2_info.h"
#include "d/d_meter_HIO.h"
#include "d/d_msg_string.h"
#include "m_Do/m_Do_controller_pad.h"
#include "m_Do/m_Do_graphic.h"
#include "d/d_msg_scrn_3select.h"
#include "d/d_msg_scrn_arrow.h"
#include "d/d_msg_string.h"
#include "d/d_select_cursor.h"
#include "dusk/version.hpp"
#include "m_Do/m_Do_controller_pad.h"
#include "m_Do/m_Do_graphic.h"
typedef void (dMenu_ItemExplain_c::*initFunc)();
static initFunc init_process[] = {
@@ -103,7 +104,16 @@ dMenu_ItemExplain_c::dMenu_ItemExplain_c(JKRExpHeap* i_heap, JKRArchive* i_archi
mDescAlpha = 0.0f;
field_0x78 = 0;
mAlphaRatio = 201.0f;
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
mpInfoText = JKR_NEW CPaneMgr(mpInfoScreen, MULTI_CHAR('i_text4'), 0, NULL);
mpInfoScreen->search(MULTI_CHAR('i_text1'))->hide();
} else {
mpInfoText = JKR_NEW CPaneMgr(mpInfoScreen, MULTI_CHAR('i_text1'), 0, NULL);
mpInfoScreen->search(MULTI_CHAR('i_text4'))->hide();
}
#elif VERSION == VERSION_GCN_JPN
mpInfoText = JKR_NEW CPaneMgr(mpInfoScreen, MULTI_CHAR('i_text4'), 0, NULL);
mpInfoScreen->search(MULTI_CHAR('i_text1'))->hide();
#else
@@ -114,7 +124,15 @@ dMenu_ItemExplain_c::dMenu_ItemExplain_c(JKRExpHeap* i_heap, JKRArchive* i_archi
((J2DTextBox*)(mpInfoText->getPanePtr()))->setString(0x200, "");
mpInfoText->show();
for (int i = 0; i < 4; i++) {
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
mpNameText[i] = JKR_NEW CPaneMgr(mpInfoScreen, name_tag[i], 0, NULL);
mpInfoScreen->search(fame_tag[i])->hide();
} else {
mpNameText[i] = JKR_NEW CPaneMgr(mpInfoScreen, fame_tag[i], 0, NULL);
mpInfoScreen->search(name_tag[i])->hide();
}
#elif VERSION == VERSION_GCN_JPN
mpNameText[i] = JKR_NEW CPaneMgr(mpInfoScreen, name_tag[i], 0, NULL);
mpInfoScreen->search(fame_tag[i])->hide();
#else
+214 -19
View File
@@ -21,6 +21,7 @@
#include "dusk/achievements.h"
#include "dusk/menu_pointer.h"
#include "dusk/ui/touch_controls.hpp"
#include "dusk/version.hpp"
static void enable_turn_page_controls(bool enabled) {
const auto controlOverride =
@@ -30,7 +31,9 @@ static void enable_turn_page_controls(bool enabled) {
}
#endif
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
#define D_MENU_LETTER_LINE_MAX (dusk::version::isRegionJpn() ? 9 : 12)
#elif VERSION == VERSION_GCN_JPN
#define D_MENU_LETTER_LINE_MAX 9
#else
#define D_MENU_LETTER_LINE_MAX 12
@@ -459,7 +462,16 @@ void dMenu_Letter_c::wait_move() {
}
if (mProcess == 1 || mProcess == 2) {
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
J2DTextBox* textBox;
if (dusk::version::isRegionJpn()) {
textBox = (J2DTextBox*)mpBaseScreen->search(MULTI_CHAR('t_t00'));
mpBaseScreen->search(MULTI_CHAR('f_t_00'))->hide();
} else {
textBox = (J2DTextBox*)mpBaseScreen->search(MULTI_CHAR('f_t_00'));
mpBaseScreen->search(MULTI_CHAR('t_t00'))->hide();
}
#elif VERSION == VERSION_GCN_JPN
J2DTextBox* textBox = (J2DTextBox*)mpBaseScreen->search(MULTI_CHAR('t_t00'));
mpBaseScreen->search(MULTI_CHAR('f_t_00'))->hide();
#else
@@ -811,6 +823,15 @@ void dMenu_Letter_c::screenSetMenu() {
static const u64 tag_frame[6] = {
MULTI_CHAR('flame_00'), MULTI_CHAR('flame_01'), MULTI_CHAR('flame_02'), MULTI_CHAR('flame_03'), MULTI_CHAR('flame_04'), MULTI_CHAR('flame_05'),
};
#if TARGET_PC
static const u64 tag_menu0_jpn[6] = {
MULTI_CHAR('menu_t0'), MULTI_CHAR('menu_t1'), MULTI_CHAR('menu_t2'), MULTI_CHAR('menu_t3'), MULTI_CHAR('menu_t4'), MULTI_CHAR('menu_t5'),
};
static const u64 tag_menu0[6] = {
MULTI_CHAR('fenu_t0'), MULTI_CHAR('fenu_t1'), MULTI_CHAR('fenu_t2'), MULTI_CHAR('fenu_t3'), MULTI_CHAR('fenu_t4'), MULTI_CHAR('fenu_t5'),
};
#else
static const u64 tag_menu0[6] = {
#if VERSION == VERSION_GCN_JPN
MULTI_CHAR('menu_t0'), MULTI_CHAR('menu_t1'), MULTI_CHAR('menu_t2'), MULTI_CHAR('menu_t3'), MULTI_CHAR('menu_t4'), MULTI_CHAR('menu_t5'),
@@ -818,6 +839,16 @@ void dMenu_Letter_c::screenSetMenu() {
MULTI_CHAR('fenu_t0'), MULTI_CHAR('fenu_t1'), MULTI_CHAR('fenu_t2'), MULTI_CHAR('fenu_t3'), MULTI_CHAR('fenu_t4'), MULTI_CHAR('fenu_t5'),
#endif
};
#endif
#if TARGET_PC
static const u64 tag_menu1_jpn[6] = {
MULTI_CHAR('menu_f6'), MULTI_CHAR('menu_f7'), MULTI_CHAR('menu_t8'), MULTI_CHAR('menu_t9'), MULTI_CHAR('menu_t10'), MULTI_CHAR('menu_t11'),
};
static const u64 tag_menu1[6] = {
MULTI_CHAR('fenu_t6'), MULTI_CHAR('fenu_t7'), MULTI_CHAR('fenu_t8'), MULTI_CHAR('fenu_t9'), MULTI_CHAR('fenu_t10'), MULTI_CHAR('fenu_t11'),
};
#else
static const u64 tag_menu1[6] = {
#if VERSION == VERSION_GCN_JPN
MULTI_CHAR('menu_f6'), MULTI_CHAR('menu_f7'), MULTI_CHAR('menu_t8'), MULTI_CHAR('menu_t9'), MULTI_CHAR('menu_t10'), MULTI_CHAR('menu_t11'),
@@ -825,6 +856,8 @@ void dMenu_Letter_c::screenSetMenu() {
MULTI_CHAR('fenu_t6'), MULTI_CHAR('fenu_t7'), MULTI_CHAR('fenu_t8'), MULTI_CHAR('fenu_t9'), MULTI_CHAR('fenu_t10'), MULTI_CHAR('fenu_t11'),
#endif
};
#endif
static const u64 tag_midoku[6] = {
MULTI_CHAR('midoku_0'), MULTI_CHAR('midoku_1'), MULTI_CHAR('midoku_2'), MULTI_CHAR('midoku_3'), MULTI_CHAR('midoku_4'), MULTI_CHAR('midoku_5'),
};
@@ -838,7 +871,27 @@ void dMenu_Letter_c::screenSetMenu() {
JUT_ASSERT(1161, mpParent[0] != NULL);
mpParent[0]->setAlphaRate(0.0f);
for (int i = 0; i < 6; i++) {
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
field_0x124[i][0] = (J2DTextBox*)mpMenuScreen->search(tag_sub0[i]);
field_0x124[i][1] = (J2DTextBox*)mpMenuScreen->search(tag_sub1[i]);
field_0x124[i][2] = (J2DTextBox*)mpMenuScreen->search(tag_name0[i]);
field_0x124[i][3] = (J2DTextBox*)mpMenuScreen->search(tag_name1[i]);
mpMenuScreen->search(ftag_sub0[i])->hide();
mpMenuScreen->search(ftag_sub1[i])->hide();
mpMenuScreen->search(ftag_name0[i])->hide();
mpMenuScreen->search(ftag_name1[i])->hide();
} else {
field_0x124[i][0] = (J2DTextBox*)mpMenuScreen->search(ftag_sub0[i]);
field_0x124[i][1] = (J2DTextBox*)mpMenuScreen->search(ftag_sub1[i]);
field_0x124[i][2] = (J2DTextBox*)mpMenuScreen->search(ftag_name0[i]);
field_0x124[i][3] = (J2DTextBox*)mpMenuScreen->search(ftag_name1[i]);
mpMenuScreen->search(tag_sub0[i])->hide();
mpMenuScreen->search(tag_sub1[i])->hide();
mpMenuScreen->search(tag_name0[i])->hide();
mpMenuScreen->search(tag_name1[i])->hide();
}
#elif VERSION == VERSION_GCN_JPN
field_0x124[i][0] = (J2DTextBox*)mpMenuScreen->search(tag_sub0[i]);
field_0x124[i][1] = (J2DTextBox*)mpMenuScreen->search(tag_sub1[i]);
field_0x124[i][2] = (J2DTextBox*)mpMenuScreen->search(tag_name0[i]);
@@ -868,8 +921,8 @@ void dMenu_Letter_c::screenSetMenu() {
}
for (int i = 0; i < 6; i++) {
field_0x34[i][0] = mpMenuScreen->search(tag_frame[i]);
field_0x34[i][1] = mpMenuScreen->search(tag_menu0[i]);
field_0x34[i][2] = mpMenuScreen->search(tag_menu1[i]);
field_0x34[i][1] = mpMenuScreen->search(DUSK_IF_ELSE(dusk::version::isRegionJpn() ? tag_menu0_jpn[i] : tag_menu0[i], tag_menu0[i]));
field_0x34[i][2] = mpMenuScreen->search(DUSK_IF_ELSE(dusk::version::isRegionJpn() ? tag_menu1_jpn[i] : tag_menu1[i], tag_menu1[i]));
field_0x34[i][3] = mpMenuScreen->search(tag_letter[i]);
field_0x34[i][4] = mpMenuScreen->search(tag_midoku[i]);
if (i < field_0x373) {
@@ -909,7 +962,27 @@ void dMenu_Letter_c::screenSetMenu() {
mpDMYParent = JKR_NEW CPaneMgr(mpMenuDMYScreen, MULTI_CHAR('n_all'), 2, NULL);
JUT_ASSERT(1285, mpDMYParent != NULL);
for (int i = 0; i < 6; i++) {
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
field_0x184[i][0] = (J2DTextBox*)mpMenuDMYScreen->search(tag_sub0[i]);
field_0x184[i][1] = (J2DTextBox*)mpMenuDMYScreen->search(tag_sub1[i]);
field_0x184[i][2] = (J2DTextBox*)mpMenuDMYScreen->search(tag_name0[i]);
field_0x184[i][3] = (J2DTextBox*)mpMenuDMYScreen->search(tag_name1[i]);
mpMenuDMYScreen->search(ftag_sub0[i])->hide();
mpMenuDMYScreen->search(ftag_sub1[i])->hide();
mpMenuDMYScreen->search(ftag_name0[i])->hide();
mpMenuDMYScreen->search(ftag_name1[i])->hide();
} else {
field_0x184[i][0] = (J2DTextBox*)mpMenuDMYScreen->search(ftag_sub0[i]);
field_0x184[i][1] = (J2DTextBox*)mpMenuDMYScreen->search(ftag_sub1[i]);
field_0x184[i][2] = (J2DTextBox*)mpMenuDMYScreen->search(ftag_name0[i]);
field_0x184[i][3] = (J2DTextBox*)mpMenuDMYScreen->search(ftag_name1[i]);
mpMenuDMYScreen->search(tag_sub0[i])->hide();
mpMenuDMYScreen->search(tag_sub1[i])->hide();
mpMenuDMYScreen->search(tag_name0[i])->hide();
mpMenuDMYScreen->search(tag_name1[i])->hide();
}
#elif VERSION == VERSION_GCN_JPN
field_0x184[i][0] = (J2DTextBox*)mpMenuDMYScreen->search(tag_sub0[i]);
field_0x184[i][1] = (J2DTextBox*)mpMenuDMYScreen->search(tag_sub1[i]);
field_0x184[i][2] = (J2DTextBox*)mpMenuDMYScreen->search(tag_name0[i]);
@@ -964,7 +1037,16 @@ void dMenu_Letter_c::screenSetBase() {
mpParent[1] = JKR_NEW CPaneMgr(mpBaseScreen, MULTI_CHAR('n_all'), 2, NULL);
JUT_ASSERT(1372, mpParent[1] != NULL);
mpParent[1]->setAlphaRate(0.0f);
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
J2DTextBox* piVar9;
if (dusk::version::isRegionJpn()) {
piVar9 = (J2DTextBox*)mpBaseScreen->search(MULTI_CHAR('t_t00'));
mpBaseScreen->search(MULTI_CHAR('f_t_00'))->hide();
} else {
piVar9 = (J2DTextBox*)mpBaseScreen->search(MULTI_CHAR('f_t_00'));
mpBaseScreen->search(MULTI_CHAR('t_t00'))->hide();
}
#elif VERSION == VERSION_GCN_JPN
J2DTextBox* piVar9 = (J2DTextBox*)mpBaseScreen->search(MULTI_CHAR('t_t00'));
mpBaseScreen->search(MULTI_CHAR('f_t_00'))->hide();
#else
@@ -975,7 +1057,31 @@ void dMenu_Letter_c::screenSetBase() {
piVar9->setFont(mDoExt_getSubFont());
dComIfGp_setMessageCountNumber(field_0x374 + (field_0x36f + 1) * 100);
mpString->getString(0x4d6, piVar9, NULL, NULL, NULL, 0);
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
J2DTextBox* text1;
J2DTextBox* text2;
J2DTextBox* text3;
J2DTextBox* text4;
if (dusk::version::isRegionJpn()) {
text1 = (J2DTextBox*)mpBaseScreen->search(MULTI_CHAR('wps_text'));
text2 = (J2DTextBox*)mpBaseScreen->search(MULTI_CHAR('w_p_text'));
text3 = (J2DTextBox*)mpBaseScreen->search(MULTI_CHAR('g_ps_txt'));
text4 = (J2DTextBox*)mpBaseScreen->search(MULTI_CHAR('g_p_text'));
mpBaseScreen->search(MULTI_CHAR('fwpstex1'))->hide();
mpBaseScreen->search(MULTI_CHAR('fwp_tex1'))->hide();
mpBaseScreen->search(MULTI_CHAR('fgps_tx1'))->hide();
mpBaseScreen->search(MULTI_CHAR('fgp_tex1'))->hide();
} else {
text1 = (J2DTextBox*)mpBaseScreen->search(MULTI_CHAR('fwpstex1'));
text2 = (J2DTextBox*)mpBaseScreen->search(MULTI_CHAR('fwp_tex1'));
text3 = (J2DTextBox*)mpBaseScreen->search(MULTI_CHAR('fgps_tx1'));
text4 = (J2DTextBox*)mpBaseScreen->search(MULTI_CHAR('fgp_tex1'));
mpBaseScreen->search(MULTI_CHAR('wps_text'))->hide();
mpBaseScreen->search(MULTI_CHAR('w_p_text'))->hide();
mpBaseScreen->search(MULTI_CHAR('g_ps_txt'))->hide();
mpBaseScreen->search(MULTI_CHAR('g_p_text'))->hide();
}
#elif VERSION == VERSION_GCN_JPN
J2DTextBox* text1 = (J2DTextBox*)mpBaseScreen->search(MULTI_CHAR('wps_text'));
J2DTextBox* text2 = (J2DTextBox*)mpBaseScreen->search(MULTI_CHAR('w_p_text'));
J2DTextBox* text3 = (J2DTextBox*)mpBaseScreen->search(MULTI_CHAR('g_ps_txt'));
@@ -1059,7 +1165,96 @@ void dMenu_Letter_c::screenSetLetter() {
JUT_ASSERT(1511, fg != false);
dPaneClass_showNullPane(mpLetterScreen[0]);
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
if (dComIfGs_getOptRuby() == 0) {
field_0x2ec[0] = JKR_NEW CPaneMgr(mpLetterScreen[0], MULTI_CHAR('t3f_s'), 0, NULL);
field_0x2ec[1] = JKR_NEW CPaneMgr(mpLetterScreen[0], MULTI_CHAR('mg_3flin'), 0, NULL);
field_0x2f4[0] = JKR_NEW CPaneMgr(mpLetterScreen[0], MULTI_CHAR('mg_3f_s'), 0, NULL);
field_0x2f4[1] = JKR_NEW CPaneMgr(mpLetterScreen[0], MULTI_CHAR('mg_3f'), 0, NULL);
mpLetterScreen[0]->search('t4_s')->hide();
mpLetterScreen[0]->search(MULTI_CHAR('mg_e4lin'))->hide();
mpLetterScreen[0]->search('t3_s')->hide();
mpLetterScreen[0]->search(MULTI_CHAR('mg_3line'))->hide();
mpLineParent = JKR_NEW CPaneMgr(mpLetterScreen[0], MULTI_CHAR('jp_fri_n'), 0, NULL);
JUT_ASSERT(1530, mpLineParent != NULL);
for (int i = 0; i < 12; i++) {
static u64 const line_tag[12] = {
MULTI_CHAR('line00'), MULTI_CHAR('line01'), MULTI_CHAR('line02'), MULTI_CHAR('line03'), MULTI_CHAR('line04'), MULTI_CHAR('line05'),
MULTI_CHAR('line06'), MULTI_CHAR('line07'), MULTI_CHAR('line08'),
};
if (line_tag[i] != 0) {
field_0x25c[i] = (J2DTextBox*)mpLetterScreen[0]->search(line_tag[i]);
} else {
field_0x25c[i] = NULL;
}
}
mpLetterScreen[0]->search('jp_n')->hide();
mpLetterScreen[0]->search('us_n')->hide();
((J2DTextBox*)field_0x2f4[0]->getPanePtr())->setLineSpace(((J2DTextBox*)field_0x2ec[0]->getPanePtr())->getLineSpace());
((J2DTextBox*)field_0x2f4[1]->getPanePtr())->setLineSpace(((J2DTextBox*)field_0x2ec[1]->getPanePtr())->getLineSpace());
} else {
field_0x2ec[0] = JKR_NEW CPaneMgr(mpLetterScreen[0], 't3_s', 0, NULL);
field_0x2ec[1] = JKR_NEW CPaneMgr(mpLetterScreen[0], MULTI_CHAR('mg_3line'), 0, NULL);
for (int i = 0; i < 2; i++) {
field_0x2f4[i] = NULL;
}
mpLetterScreen[0]->search('t4_s')->hide();
mpLetterScreen[0]->search(MULTI_CHAR('mg_e4lin'))->hide();
mpLetterScreen[0]->search(MULTI_CHAR('t3f_s'))->hide();
mpLetterScreen[0]->search(MULTI_CHAR('mg_3flin'))->hide();
mpLetterScreen[0]->search(MULTI_CHAR('mg_3f_s'))->hide();
mpLetterScreen[0]->search(MULTI_CHAR('mg_3f'))->hide();
mpLineParent = JKR_NEW CPaneMgr(mpLetterScreen[0], 'jp_n', 0, NULL);
JUT_ASSERT(1530, mpLineParent != NULL);
for (int i = 0; i < 12; i++) {
static u64 const line_tag[12] = {
MULTI_CHAR('line21'), MULTI_CHAR('line22'), MULTI_CHAR('line23'), MULTI_CHAR('line24'), MULTI_CHAR('line25'), MULTI_CHAR('line26'),
MULTI_CHAR('line27'), MULTI_CHAR('line28'), MULTI_CHAR('line29'),
};
if (line_tag[i] != 0) {
field_0x25c[i] = (J2DTextBox*)mpLetterScreen[0]->search(line_tag[i]);
} else {
field_0x25c[i] = NULL;
}
}
mpLetterScreen[0]->search(MULTI_CHAR('jp_fri_n'))->hide();
mpLetterScreen[0]->search('us_n')->hide();
}
} else {
static u64 const line_tag[12] = {
MULTI_CHAR('line09'), MULTI_CHAR('line10'), MULTI_CHAR('line11'), MULTI_CHAR('line12'), MULTI_CHAR('line13'), MULTI_CHAR('line14'),
MULTI_CHAR('line15'), MULTI_CHAR('line16'), MULTI_CHAR('line17'), MULTI_CHAR('line18'), MULTI_CHAR('line19'), MULTI_CHAR('line20'),
};
field_0x2ec[0] = JKR_NEW CPaneMgr(mpLetterScreen[0], 't4_s', 0, NULL);
field_0x2ec[1] = JKR_NEW CPaneMgr(mpLetterScreen[0], MULTI_CHAR('mg_e4lin'), 0, NULL);
for (int i = 0; i < 2; i++) {
field_0x2f4[i] = NULL;
}
mpLetterScreen[0]->search(MULTI_CHAR('t3f_s'))->hide();
mpLetterScreen[0]->search(MULTI_CHAR('mg_3flin'))->hide();
mpLetterScreen[0]->search(MULTI_CHAR('mg_3f_s'))->hide();
mpLetterScreen[0]->search(MULTI_CHAR('mg_3f'))->hide();
mpLetterScreen[0]->search('t3_s')->hide();
mpLetterScreen[0]->search(MULTI_CHAR('mg_3line'))->hide();
mpLineParent = JKR_NEW CPaneMgr(mpLetterScreen[0], 'us_n', 0, NULL);
JUT_ASSERT(1530, mpLineParent != NULL);
for (int i = 0; i < 12; i++) {
if (line_tag[i] != 0) {
field_0x25c[i] = (J2DTextBox*)mpLetterScreen[0]->search(line_tag[i]);
} else {
field_0x25c[i] = NULL;
}
}
mpLetterScreen[0]->search(MULTI_CHAR('jp_fri_n'))->hide();
mpLetterScreen[0]->search('jp_n')->hide();
}
#elif VERSION == VERSION_GCN_JPN
if (dComIfGs_getOptRuby() == 0) {
field_0x2ec[0] = JKR_NEW CPaneMgr(mpLetterScreen[0], MULTI_CHAR('t3f_s'), 0, NULL);
field_0x2ec[1] = JKR_NEW CPaneMgr(mpLetterScreen[0], MULTI_CHAR('mg_3flin'), 0, NULL);
@@ -1148,20 +1343,20 @@ void dMenu_Letter_c::screenSetLetter() {
mpLetterScreen[0]->search('jp_n')->hide();
#endif
#if TARGET_PC
#define STR_BUF_LEN 528
#elif VERSION == VERSION_GCN_JPN
#define STR_BUF_LEN 528
#else
#define STR_BUF_LEN 512
#endif
for (int i = 0; i < 2; i++) {
((J2DTextBox*)field_0x2ec[i]->getPanePtr())->setFont(mDoExt_getMesgFont());
#if VERSION == VERSION_GCN_JPN
((J2DTextBox*)field_0x2ec[i]->getPanePtr())->setString(0x210, "");
#else
((J2DTextBox*)field_0x2ec[i]->getPanePtr())->setString(0x200, "");
#endif
((J2DTextBox*)field_0x2ec[i]->getPanePtr())->setString(STR_BUF_LEN, "");
if (field_0x2f4[i] != NULL) {
((J2DTextBox*)field_0x2f4[i]->getPanePtr())->setFont(mDoExt_getMesgFont());
#if VERSION == VERSION_GCN_JPN
((J2DTextBox*)field_0x2f4[i]->getPanePtr())->setString(0x210, "");
#else
((J2DTextBox*)field_0x2f4[i]->getPanePtr())->setString(0x200, "");
#endif
((J2DTextBox*)field_0x2f4[i]->getPanePtr())->setString(STR_BUF_LEN, "");
}
}
field_0x1e4[0] = (J2DTextBox*)mpLetterScreen[0]->search(MULTI_CHAR('p_texts'));
+440 -133
View File
File diff suppressed because it is too large Load Diff
+102 -45
View File
@@ -28,6 +28,7 @@
#include <cstring>
#include <cstdio>
#if TARGET_PC
#include "dusk/frame_interpolation.h"
#include "dusk/game_clock.h"
@@ -37,6 +38,7 @@
#include "dusk/randomizer/game/randomizer_context.hpp"
#include "dusk/randomizer/game/verify_item_functions.h"
#include "dusk/randomizer/game/tools.h"
#include "dusk/version.hpp"
#endif
typedef void (dMenu_Ring_c::*initFunc)();
@@ -344,7 +346,16 @@ dMenu_Ring_c::dMenu_Ring_c(JKRExpHeap* i_heap, STControl* i_stick, CSTControl* i
}
mpString = JKR_NEW dMsgString_c();
for (i = 0; i < 5; i++) {
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
J2DTextBox* fxy_TextBox;
if (dusk::version::isRegionJpn()) {
fxy_TextBox = (J2DTextBox*)mpScreen->search(xy_text[i]);
mpScreen->search(fxy_text[i])->hide();
} else {
fxy_TextBox = (J2DTextBox*)mpScreen->search(fxy_text[i]);
mpScreen->search(xy_text[i])->hide();
}
#elif VERSION == VERSION_GCN_JPN
J2DTextBox* fxy_TextBox = (J2DTextBox*)mpScreen->search(xy_text[i]);
mpScreen->search(fxy_text[i])->hide();
#else
@@ -356,75 +367,77 @@ dMenu_Ring_c::dMenu_Ring_c(JKRExpHeap* i_heap, STControl* i_stick, CSTControl* i
field_0x580[0] = mpString->getString(0x380, fxy_TextBox, NULL, NULL, NULL, 0);
}
for (i = 0; i < 5; i++) {
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
#if TARGET_PC
J2DTextBox* fc_TextBox;
if (dusk::getSettings().game.swapDirectSelect) {
fc_TextBox = (J2DTextBox*)mpScreen->search(c_text1[i]);
mpScreen->search(fc_text1[i])->hide();
if (dusk::version::isRegionJpn()) {
if (dusk::getSettings().game.swapDirectSelect) {
fc_TextBox = (J2DTextBox*)mpScreen->search(c_text1[i]);
mpScreen->search(fc_text1[i])->hide();
} else {
fc_TextBox = (J2DTextBox*)mpScreen->search(c_text[i]);
mpScreen->search(fc_text[i])->hide();
}
} else {
fc_TextBox = (J2DTextBox*)mpScreen->search(c_text[i]);
mpScreen->search(fc_text[i])->hide();
if (dusk::getSettings().game.swapDirectSelect) {
fc_TextBox = (J2DTextBox*)mpScreen->search(fc_text1[i]);
mpScreen->search(c_text1[i])->hide();
} else {
fc_TextBox = (J2DTextBox*)mpScreen->search(fc_text[i]);
mpScreen->search(c_text[i])->hide();
}
}
#else
#elif VERSION == VERSION_GCN_JPN
J2DTextBox* fc_TextBox = (J2DTextBox*)mpScreen->search(c_text[i]);
mpScreen->search(fc_text[i])->hide();
#endif
#else
#if TARGET_PC
J2DTextBox* fc_TextBox;
if (dusk::getSettings().game.swapDirectSelect) {
fc_TextBox = (J2DTextBox*)mpScreen->search(fc_text1[i]);
mpScreen->search(c_text1[i])->hide();
} else {
fc_TextBox = (J2DTextBox*)mpScreen->search(fc_text[i]);
mpScreen->search(c_text[i])->hide();
}
#else
J2DTextBox* fc_TextBox = (J2DTextBox*)mpScreen->search(fc_text[i]);
mpScreen->search(c_text[i])->hide();
#endif
#endif
fc_TextBox->setFont(mDoExt_getMesgFont());
fc_TextBox->setString(0x40, "");
field_0x580[1] = mpString->getString(0x37F, fc_TextBox, NULL, NULL, NULL, 0);
}
for (i = 0; i < 5; i++) {
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
#if TARGET_PC
J2DTextBox* fc1_TextBox;
if (dusk::getSettings().game.swapDirectSelect) {
fc1_TextBox = (J2DTextBox*)mpScreen->search(c_text[i]);
mpScreen->search(fc_text[i])->hide();
if (dusk::version::isRegionJpn()) {
if (dusk::getSettings().game.swapDirectSelect) {
fc1_TextBox = (J2DTextBox*)mpScreen->search(c_text[i]);
mpScreen->search(fc_text[i])->hide();
} else {
fc1_TextBox = (J2DTextBox*)mpScreen->search(c_text1[i]);
mpScreen->search(fc_text1[i])->hide();
}
} else {
fc1_TextBox = (J2DTextBox*)mpScreen->search(c_text1[i]);
mpScreen->search(fc_text1[i])->hide();
if (dusk::getSettings().game.swapDirectSelect) {
fc1_TextBox = (J2DTextBox*)mpScreen->search(fc_text[i]);
mpScreen->search(c_text[i])->hide();
} else {
fc1_TextBox = (J2DTextBox*)mpScreen->search(fc_text1[i]);
mpScreen->search(c_text1[i])->hide();
}
}
#else
#elif VERSION == VERSION_GCN_JPN
J2DTextBox* fc1_TextBox = (J2DTextBox*)mpScreen->search(c_text1[i]);
mpScreen->search(fc_text1[i])->hide();
#endif
#else
#if TARGET_PC
J2DTextBox* fc1_TextBox;
if (dusk::getSettings().game.swapDirectSelect) {
fc1_TextBox = (J2DTextBox*)mpScreen->search(fc_text[i]);
mpScreen->search(c_text[i])->hide();
} else {
fc1_TextBox = (J2DTextBox*)mpScreen->search(fc_text1[i]);
mpScreen->search(c_text1[i])->hide();
}
#else
J2DTextBox* fc1_TextBox = (J2DTextBox*)mpScreen->search(fc_text1[i]);
mpScreen->search(c_text1[i])->hide();
#endif
#endif
fc1_TextBox->setFont(mDoExt_getMesgFont());
fc1_TextBox->setString(0x40, "");
field_0x580[2] = mpString->getString(0x4CD, fc1_TextBox, NULL, NULL, NULL, 0);
}
for (int i = 0; i < 5; i++) {
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
mpComboOffString[i] = (J2DTextBox*)mpScreen->search(t_on[i]);
mpScreen->search(ft_on[i])->hide();
} else {
mpComboOffString[i] = (J2DTextBox*)mpScreen->search(ft_on[i]);
mpScreen->search(t_on[i])->hide();
}
#elif VERSION == VERSION_GCN_JPN
mpComboOffString[i] = (J2DTextBox*)mpScreen->search(t_on[i]);
mpScreen->search(ft_on[i])->hide();
#else
@@ -436,7 +449,15 @@ dMenu_Ring_c::dMenu_Ring_c(JKRExpHeap* i_heap, STControl* i_stick, CSTControl* i
mpString->getString(0x4D2, mpComboOffString[i], NULL, NULL, NULL, 0);
}
for (int i = 0; i < 5; i++) {
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
mpBowArrowComboString[i] = (J2DTextBox*)mpScreen->search(t_off[i]);
mpScreen->search(ft_off[i])->hide();
} else {
mpBowArrowComboString[i] = (J2DTextBox*)mpScreen->search(ft_off[i]);
mpScreen->search(t_off[i])->hide();
}
#elif VERSION == VERSION_GCN_JPN
mpBowArrowComboString[i] = (J2DTextBox*)mpScreen->search(t_off[i]);
mpScreen->search(ft_off[i])->hide();
#else
@@ -467,7 +488,31 @@ dMenu_Ring_c::dMenu_Ring_c(JKRExpHeap* i_heap, STControl* i_stick, CSTControl* i
mpNameParent = JKR_NEW CPaneMgr(mpCenterScreen, MULTI_CHAR('label_n'), 1, NULL);
mpCircle = JKR_NEW CPaneMgr(mpCenterScreen, MULTI_CHAR('circle_n'), 2, NULL);
J2DTextBox* textBox[4];
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
textBox[0] = (J2DTextBox*)mpCenterScreen->search(MULTI_CHAR('item_n04'));
textBox[1] = (J2DTextBox*)mpCenterScreen->search(MULTI_CHAR('item_n05'));
textBox[2] = (J2DTextBox*)mpCenterScreen->search(MULTI_CHAR('item_n06'));
textBox[3] = (J2DTextBox*)mpCenterScreen->search(MULTI_CHAR('item_n07'));
J2DPane* pane = mpCenterScreen->search(MULTI_CHAR('fitem_n1'));
pane->mVisible = false;
pane = mpCenterScreen->search(MULTI_CHAR('fitem_n2'));
pane->mVisible = false;
pane = mpCenterScreen->search(MULTI_CHAR('fitem_n3'));
pane->mVisible = false;
pane = mpCenterScreen->search(MULTI_CHAR('fitem_n4'));
pane->mVisible = false;
} else {
textBox[0] = (J2DTextBox*)mpCenterScreen->search(MULTI_CHAR('fitem_n1'));
textBox[1] = (J2DTextBox*)mpCenterScreen->search(MULTI_CHAR('fitem_n2'));
textBox[2] = (J2DTextBox*)mpCenterScreen->search(MULTI_CHAR('fitem_n3'));
textBox[3] = (J2DTextBox*)mpCenterScreen->search(MULTI_CHAR('fitem_n4'));
mpCenterScreen->search(MULTI_CHAR('item_n04'));
mpCenterScreen->search(MULTI_CHAR('item_n05'));
mpCenterScreen->search(MULTI_CHAR('item_n06'));
mpCenterScreen->search(MULTI_CHAR('item_n07'));
}
#elif VERSION == VERSION_GCN_JPN
textBox[0] = (J2DTextBox*)mpCenterScreen->search(MULTI_CHAR('item_n04'));
textBox[1] = (J2DTextBox*)mpCenterScreen->search(MULTI_CHAR('item_n05'));
textBox[2] = (J2DTextBox*)mpCenterScreen->search(MULTI_CHAR('item_n06'));
@@ -1263,7 +1308,19 @@ void dMenu_Ring_c::setScale() {
void dMenu_Ring_c::setNameString(u32 i_stringID) {
J2DTextBox* textBox[4];
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
textBox[0] = (J2DTextBox*)mpCenterScreen->search(MULTI_CHAR('item_n04'));
textBox[1] = (J2DTextBox*)mpCenterScreen->search(MULTI_CHAR('item_n05'));
textBox[2] = (J2DTextBox*)mpCenterScreen->search(MULTI_CHAR('item_n06'));
textBox[3] = (J2DTextBox*)mpCenterScreen->search(MULTI_CHAR('item_n07'));
} else {
textBox[0] = (J2DTextBox*)mpCenterScreen->search(MULTI_CHAR('fitem_n1'));
textBox[1] = (J2DTextBox*)mpCenterScreen->search(MULTI_CHAR('fitem_n2'));
textBox[2] = (J2DTextBox*)mpCenterScreen->search(MULTI_CHAR('fitem_n3'));
textBox[3] = (J2DTextBox*)mpCenterScreen->search(MULTI_CHAR('fitem_n4'));
}
#elif VERSION == VERSION_GCN_JPN
textBox[0] = (J2DTextBox*)mpCenterScreen->search(MULTI_CHAR('item_n04'));
textBox[1] = (J2DTextBox*)mpCenterScreen->search(MULTI_CHAR('item_n05'));
textBox[2] = (J2DTextBox*)mpCenterScreen->search(MULTI_CHAR('item_n06'));
+112 -19
View File
@@ -1,25 +1,26 @@
#include "d/dolzel.h" // IWYU pragma: keep
#include "d/d_menu_save.h"
#include "JSystem/JKernel/JKRExpHeap.h"
#include "JSystem/JKernel/JKRMemArchive.h"
#include <cstdio>
#include <cstring>
#include "JSystem/J2DGraph/J2DAnmLoader.h"
#include "JSystem/JKernel/JKRExpHeap.h"
#include "JSystem/JKernel/JKRMemArchive.h"
#include "d/d_com_inf_game.h"
#include "d/d_lib.h"
#include "d/d_select_cursor.h"
#include "d/d_file_sel_info.h"
#include "d/d_file_sel_warning.h"
#include "d/d_lib.h"
#include "d/d_menu_save.h"
#include "d/d_meter2_info.h"
#include "d/d_msg_scrn_explain.h"
#include "d/d_msg_string.h"
#include "d/d_select_cursor.h"
#include "dusk/version.hpp"
#include "f_op/f_op_msg_mng.h"
#include "m_Do/m_Do_MemCard.h"
#include "m_Do/m_Do_MemCardRWmng.h"
#include "m_Do/m_Do_Reset.h"
#include "m_Do/m_Do_controller_pad.h"
#include "m_Do/m_Do_graphic.h"
#include "d/d_msg_scrn_explain.h"
#include "JSystem/J2DGraph/J2DAnmLoader.h"
#include "f_op/f_op_msg_mng.h"
#if TARGET_PC
#include "dusk/config.hpp"
@@ -181,7 +182,15 @@ void dMenu_save_c::screenSet() {
static u64 l_tagName10[2] = {MULTI_CHAR('w_no_g'), MULTI_CHAR('w_yes_g')};
static u64 l_tagName11[2] = {MULTI_CHAR('w_no_gr'), MULTI_CHAR('w_yes_gr')};
static u64 l_tagName12[3] = {MULTI_CHAR('w_bk_l00'), MULTI_CHAR('w_bk_l01'), MULTI_CHAR('w_bk_l02')};
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
static u64 l_tagName21_jpn[2] = {MULTI_CHAR('w_tabi_s'), MULTI_CHAR('w_tabi_x')};
static u64 l_tagName20_jpn[2] = {MULTI_CHAR('w_er_msg'), MULTI_CHAR('w_er_msR')};
static u64 l_tagName21[2] = {MULTI_CHAR('t_for'), MULTI_CHAR('t_for1')};
static u64 l_tagName211[10] = {MULTI_CHAR('tmoyou00'), MULTI_CHAR('tmoyou01'), MULTI_CHAR('tmoyou02'), MULTI_CHAR('tmoyou03'), MULTI_CHAR('tmoyou04'),
MULTI_CHAR('tmoyou05'), MULTI_CHAR('tmoyou06'), MULTI_CHAR('tmoyou07'), MULTI_CHAR('tmoyou08'), MULTI_CHAR('tmoyou09')};
static u64 l_tagName20[2] = {MULTI_CHAR('er_for0'), MULTI_CHAR('er_for1')};
#elif VERSION == VERSION_GCN_JPN
static u64 l_tagName21[2] = {MULTI_CHAR('w_tabi_s'), MULTI_CHAR('w_tabi_x')};
static u64 l_tagName20[2] = {MULTI_CHAR('w_er_msg'), MULTI_CHAR('w_er_msR')};
#else
@@ -190,6 +199,7 @@ void dMenu_save_c::screenSet() {
MULTI_CHAR('tmoyou05'), MULTI_CHAR('tmoyou06'), MULTI_CHAR('tmoyou07'), MULTI_CHAR('tmoyou08'), MULTI_CHAR('tmoyou09')};
static u64 l_tagName20[2] = {MULTI_CHAR('er_for0'), MULTI_CHAR('er_for1')};
#endif
static u64 l_tagName13[3] = {MULTI_CHAR('w_dat_i0'), MULTI_CHAR('w_dat_i1'), MULTI_CHAR('w_dat_i2')};
static u8 l_msgNum0[2] = {0x08, 0x07};
static u8 l_msgNum[2] = {0x54, 0x55};
@@ -223,7 +233,15 @@ void dMenu_save_c::screenSet() {
mpNoYes[1] = JKR_NEW CPaneMgr(mSaveSel.Scr, MULTI_CHAR('w_yes_n'), 0, NULL);
for (int i = 0; i < 2; i++) {
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
mpNoYesTxt[i] = JKR_NEW CPaneMgr(mSaveSel.Scr, l_tagName000[i], 0, NULL);
mSaveSel.Scr->search(l_tagName000U[i])->hide();
} else {
mpNoYesTxt[i] = JKR_NEW CPaneMgr(mSaveSel.Scr, l_tagName000U[i], 0, NULL);
mSaveSel.Scr->search(l_tagName000[i])->hide();
}
#elif VERSION == VERSION_GCN_JPN
mpNoYesTxt[i] = JKR_NEW CPaneMgr(mSaveSel.Scr, l_tagName000[i], 0, NULL);
mSaveSel.Scr->search(l_tagName000U[i])->hide();
#else
@@ -242,7 +260,15 @@ void dMenu_save_c::screenSet() {
mpBBtnIcon = JKR_NEW CPaneMgrAlpha(mSaveSel.Scr, MULTI_CHAR('w_nbbtn'), 2, NULL);
mpABtnIcon = JKR_NEW CPaneMgrAlpha(mSaveSel.Scr, MULTI_CHAR('w_nabtn'), 2, NULL);
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
mpBackTxt = JKR_NEW CPaneMgrAlpha(mSaveSel.Scr, MULTI_CHAR('w_modo'), 2, NULL);
mpConfirmTxt = JKR_NEW CPaneMgrAlpha(mSaveSel.Scr, MULTI_CHAR('w_kete'), 2, NULL);
} else {
mpBackTxt = JKR_NEW CPaneMgrAlpha(mSaveSel.Scr, MULTI_CHAR('f_modo'), 2, NULL);
mpConfirmTxt = JKR_NEW CPaneMgrAlpha(mSaveSel.Scr, MULTI_CHAR('f_kete'), 2, NULL);
}
#elif VERSION == VERSION_GCN_JPN
mpBackTxt = JKR_NEW CPaneMgrAlpha(mSaveSel.Scr, MULTI_CHAR('w_modo'), 2, NULL);
mpConfirmTxt = JKR_NEW CPaneMgrAlpha(mSaveSel.Scr, MULTI_CHAR('w_kete'), 2, NULL);
#else
@@ -257,7 +283,15 @@ void dMenu_save_c::screenSet() {
for (int i = 0; i < 2; i++) {
J2DTextBox* tbox[2];
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
tbox[i] = (J2DTextBox*)mSaveSel.Scr->search(l_tagName00[i]);
mSaveSel.Scr->search(l_tagName00U[i])->hide();
} else {
tbox[i] = (J2DTextBox*)mSaveSel.Scr->search(l_tagName00U[i]);
mSaveSel.Scr->search(l_tagName00[i])->hide();
}
#elif VERSION == VERSION_GCN_JPN
tbox[i] = (J2DTextBox*)mSaveSel.Scr->search(l_tagName00[i]);
mSaveSel.Scr->search(l_tagName00U[i])->hide();
#else
@@ -332,7 +366,19 @@ void dMenu_save_c::screenSet() {
mpBookWaku[i]->setAlpha(0);
}
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
mSaveSel.Scr->search(MULTI_CHAR('t_for'))->hide();
mSaveSel.Scr->search(MULTI_CHAR('t_for1'))->hide();
} else {
mSaveSel.Scr->search(MULTI_CHAR('w_tabi_s'))->hide();
mSaveSel.Scr->search(MULTI_CHAR('w_tabi_x'))->hide();
for (int i = 0; i < 10; i++) {
mSaveSel.Scr->search(l_tagName211[i])->hide();
}
}
#elif VERSION == VERSION_GCN_JPN
mSaveSel.Scr->search(MULTI_CHAR('t_for'))->hide();
mSaveSel.Scr->search(MULTI_CHAR('t_for1'))->hide();
#else
@@ -345,11 +391,21 @@ void dMenu_save_c::screenSet() {
#endif
for (int i = 0; i < 2; i++) {
mpHeaderTxtPane[i] = JKR_NEW CPaneMgrAlpha(mSaveSel.Scr, l_tagName21[i], 0, NULL);
mpHeaderTxtPane[i] = JKR_NEW CPaneMgrAlpha(mSaveSel.Scr, DUSK_IF_ELSE(dusk::version::isRegionJpn() ? l_tagName21_jpn[i] : l_tagName21[i], l_tagName21[i]), 0, NULL);
((J2DTextBox*)mpHeaderTxtPane[i]->getPanePtr())->setFont(mSaveSel.font[0]);
((J2DTextBox*)mpHeaderTxtPane[i]->getPanePtr())->setString(0x100, "");
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
((J2DTextBox*)mpHeaderTxtPane[i]->getPanePtr())->setFontSize(21.0f, 21.0f);
((J2DTextBox*)mpHeaderTxtPane[i]->getPanePtr())->setLineSpace(22.0f);
((J2DTextBox*)mpHeaderTxtPane[i]->getPanePtr())->setCharSpace(2.0f);
} else {
((J2DTextBox*)mpHeaderTxtPane[i]->getPanePtr())->setFontSize(19.0f, 19.0f);
((J2DTextBox*)mpHeaderTxtPane[i]->getPanePtr())->setLineSpace(20.0f);
((J2DTextBox*)mpHeaderTxtPane[i]->getPanePtr())->setCharSpace(0.0f);
}
#elif VERSION == VERSION_GCN_JPN
((J2DTextBox*)mpHeaderTxtPane[i]->getPanePtr())->setFontSize(21.0f, 21.0f);
((J2DTextBox*)mpHeaderTxtPane[i]->getPanePtr())->setLineSpace(22.0f);
((J2DTextBox*)mpHeaderTxtPane[i]->getPanePtr())->setCharSpace(2.0f);
@@ -366,7 +422,15 @@ void dMenu_save_c::screenSet() {
mHeaderTxtType = 0;
field_0xb4 = mSaveSel.Scr->search(MULTI_CHAR('w_er_n'));
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
mSaveSel.Scr->search(MULTI_CHAR('er_for0'))->hide();
mSaveSel.Scr->search(MULTI_CHAR('er_for1'))->hide();
} else {
mSaveSel.Scr->search(MULTI_CHAR('w_er_msg'))->hide();
mSaveSel.Scr->search(MULTI_CHAR('w_er_msR'))->hide();
}
#elif VERSION == VERSION_GCN_JPN
mSaveSel.Scr->search(MULTI_CHAR('er_for0'))->hide();
mSaveSel.Scr->search(MULTI_CHAR('er_for1'))->hide();
#else
@@ -375,7 +439,9 @@ void dMenu_save_c::screenSet() {
#endif
for (int i = 0; i < 2; i++) {
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
mpErrTxtPane[i] = JKR_NEW CPaneMgrAlpha(mSaveSel.Scr, DUSK_IF_ELSE(dusk::version::isRegionJpn() ? l_tagName20_jpn[i] : l_tagName20[i], l_tagName20[i]), 0, NULL);
#elif VERSION == VERSION_GCN_JPN
mpErrTxtPane[i] = JKR_NEW CPaneMgrAlpha(mSaveSel.Scr, l_tagName20[i], 0, NULL);
#else
mpErrTxtPane[i] = JKR_NEW CPaneMgrAlpha(mSaveSel.Scr, l_tagName20[i], 0, NULL);
@@ -383,7 +449,18 @@ void dMenu_save_c::screenSet() {
((J2DTextBox*)mpErrTxtPane[i]->getPanePtr())->setFont(mSaveSel.font[0]);
((J2DTextBox*)mpErrTxtPane[i]->getPanePtr())->setString(0x200, "");
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
((J2DTextBox*)mpErrTxtPane[i]->getPanePtr())->setFontSize(21.0f, 21.0f);
((J2DTextBox*)mpErrTxtPane[i]->getPanePtr())->setLineSpace(22.0f);
((J2DTextBox*)mpErrTxtPane[i]->getPanePtr())->setCharSpace(2.0f);
} else {
((J2DTextBox*)mpErrTxtPane[i]->getPanePtr())->resize(440.0f, 198.0f);
((J2DTextBox*)mpErrTxtPane[i]->getPanePtr())->setFontSize(21.0f, 21.0f);
((J2DTextBox*)mpErrTxtPane[i]->getPanePtr())->setLineSpace(21.0f);
((J2DTextBox*)mpErrTxtPane[i]->getPanePtr())->setCharSpace(1.0f);
}
#elif VERSION == VERSION_GCN_JPN
((J2DTextBox*)mpErrTxtPane[i]->getPanePtr())->setFontSize(21.0f, 21.0f);
((J2DTextBox*)mpErrTxtPane[i]->getPanePtr())->setLineSpace(22.0f);
((J2DTextBox*)mpErrTxtPane[i]->getPanePtr())->setCharSpace(2.0f);
@@ -2479,7 +2556,23 @@ bool dMenu_save_c::selectDataBaseMoveAnm() {
mpSelectMoveBase->getPanePtr()->animationTransform();
return false;
} else {
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
if (mDataBaseMoveAnmFrame == 33) {
field_0x64 = 1;
} else {
field_0x64 = 0;
}
field_0x65 = 0;
} else {
if (mDataBaseMoveAnmFrame == 33) {
field_0x64 = 1;
field_0x65 = 0;
} else {
field_0x64 = 0;
}
}
#elif VERSION == VERSION_GCN_JPN
if (mDataBaseMoveAnmFrame == 33) {
field_0x64 = 1;
} else {
+51 -4
View File
@@ -18,6 +18,8 @@
#include "m_Do/m_Do_graphic.h"
#include <cstring>
#include "dusk/version.hpp"
#if TARGET_PC
#include "dusk/menu_pointer.h"
#endif
@@ -467,7 +469,27 @@ void dMenu_Skill_c::screenSetMenu() {
mpParent = JKR_NEW CPaneMgr(mpMenuScreen, MULTI_CHAR('n_all'), 2, NULL);
mpParent->setAlphaRate(0.0f);
for (int i = 0; i < 7; i++) {
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
mpFTagPicture[i][0] = (J2DTextBox*)mpMenuScreen->search(tag_sub0[i]);
mpFTagPicture[i][1] = (J2DTextBox*)mpMenuScreen->search(tag_sub1[i]);
mpFTagPicture[i][2] = (J2DTextBox*)mpMenuScreen->search(tag_name0[i]);
mpFTagPicture[i][3] = (J2DTextBox*)mpMenuScreen->search(tag_name1[i]);
mpMenuScreen->search(ftag_sub0[i])->hide();
mpMenuScreen->search(ftag_sub1[i])->hide();
mpMenuScreen->search(ftag_name0[i])->hide();
mpMenuScreen->search(ftag_name1[i])->hide();
} else {
mpFTagPicture[i][0] = (J2DTextBox*)mpMenuScreen->search(ftag_sub0[i]);
mpFTagPicture[i][1] = (J2DTextBox*)mpMenuScreen->search(ftag_sub1[i]);
mpFTagPicture[i][2] = (J2DTextBox*)mpMenuScreen->search(ftag_name0[i]);
mpFTagPicture[i][3] = (J2DTextBox*)mpMenuScreen->search(ftag_name1[i]);
mpMenuScreen->search(tag_sub0[i])->hide();
mpMenuScreen->search(tag_sub1[i])->hide();
mpMenuScreen->search(tag_name0[i])->hide();
mpMenuScreen->search(tag_name1[i])->hide();
}
#elif VERSION == VERSION_GCN_JPN
mpFTagPicture[i][0] = (J2DTextBox*)mpMenuScreen->search(tag_sub0[i]);
mpFTagPicture[i][1] = (J2DTextBox*)mpMenuScreen->search(tag_sub1[i]);
mpFTagPicture[i][2] = (J2DTextBox*)mpMenuScreen->search(tag_name0[i]);
@@ -522,7 +544,16 @@ void dMenu_Skill_c::screenSetMenu() {
mSelectWhite[i] = mpFTagPicture[1][i]->getWhite();
}
}
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
J2DTextBox* textBox;
if (dusk::version::isRegionJpn()) {
textBox = (J2DTextBox*)mpMenuScreen->search(MULTI_CHAR('t_t00'));
mpMenuScreen->search(MULTI_CHAR('f_t00'))->hide();
} else {
textBox = (J2DTextBox*)mpMenuScreen->search(MULTI_CHAR('f_t00'));
mpMenuScreen->search(MULTI_CHAR('t_t00'))->hide();
}
#elif VERSION == VERSION_GCN_JPN
J2DTextBox* textBox = (J2DTextBox*)mpMenuScreen->search(MULTI_CHAR('t_t00'));
mpMenuScreen->search(MULTI_CHAR('f_t00'))->hide();
#else
@@ -551,7 +582,15 @@ void dMenu_Skill_c::screenSetLetter() {
mpLetterScreen = JKR_NEW J2DScreen();
mpLetterScreen->setPriority("zelda_ougi_info.blo", 0x20000, mpArchive);
dPaneClass_showNullPane(mpLetterScreen);
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
mpTextPane = JKR_NEW CPaneMgr(mpLetterScreen, MULTI_CHAR('mg_3line'), 0, NULL);
mpLetterScreen->search(MULTI_CHAR('n_e4line'))->hide();
} else {
mpTextPane = JKR_NEW CPaneMgr(mpLetterScreen, MULTI_CHAR('mg_e4lin'), 0, NULL);
mpLetterScreen->search(MULTI_CHAR('n_3line'))->hide();
}
#elif VERSION == VERSION_GCN_JPN
mpTextPane = JKR_NEW CPaneMgr(mpLetterScreen, MULTI_CHAR('mg_3line'), 0, NULL);
mpLetterScreen->search(MULTI_CHAR('n_e4line'))->hide();
#else
@@ -564,7 +603,15 @@ void dMenu_Skill_c::screenSetLetter() {
J2DTextBox* paneString = (J2DTextBox*)mpTextPane->getPanePtr();
paneString->setString(0x200, "");
for (int i = 0; i < 4; i++) {
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
mpNameString[i] = (J2DTextBox*)mpLetterScreen->search(name_tag[i]);
mpLetterScreen->search(fame_tag[i])->hide();
} else {
mpNameString[i] = (J2DTextBox*)mpLetterScreen->search(fame_tag[i]);
mpLetterScreen->search(name_tag[i])->hide();
}
#elif VERSION == VERSION_GCN_JPN
mpNameString[i] = (J2DTextBox*)mpLetterScreen->search(name_tag[i]);
mpLetterScreen->search(fame_tag[i])->hide();
#else
+26 -1
View File
@@ -22,6 +22,8 @@
#include "d/d_pane_class.h"
#include <cstring>
#include "dusk/version.hpp"
#if TARGET_PC
#include "dusk/cosmetics/color_utils.hpp"
#include "dusk/frame_interpolation.h"
@@ -60,6 +62,27 @@ void dAnchorHudScale(CPaneMgr* i_pane, HudCorner i_corner, f32* io_x, f32* io_y,
#endif
dMeter2Draw_c::dMeter2Draw_c(JKRExpHeap* mp_heap) {
#if TARGET_PC
// correct hio data here because we can't do runtime disc checks in sinit data constructors
if (dusk::version::isRegionJpn()) {
g_drawHIO.mButtonATextSpacing = -2.0f;
for (int i = 0; i < 6; i++) {
static f32 const finfoPosX_jpn[6] = {-27.0f, 0.0f, -12.0f, 0.0f, -12.0f, -32.8f};
static f32 const fishnPosX_jpn[6] = {-27.0f, 0.0f, -12.0f, 0.0f, -12.0f, -32.8f};
g_drawHIO.mFishListScreen.mFishCountSizePosX[i] = finfoPosX_jpn[i];
g_drawHIO.mFishListScreen.mFishInfoPosX[i] = fishnPosX_jpn[i];
}
} else {
g_drawHIO.mButtonATextSpacing = 1.0f;
for (int i = 0; i < 6; i++) {
static f32 const finfoPosX[6] = {-17.0f, 0.0f, -14.0f, 0.0f, -12.0f, -32.8f};
static f32 const fishnPosX[6] = {-17.0f, 0.0f, -14.0f, 0.0f, -12.0f, -32.8f};
g_drawHIO.mFishListScreen.mFishCountSizePosX[i] = finfoPosX[i];
g_drawHIO.mFishListScreen.mFishInfoPosX[i] = fishnPosX[i];
}
}
#endif
OS_REPORT("enter dMeter2Draw_c::dMeter2Draw_c(JKRExpHeap *mp_heap)\n");
heap = mp_heap;
@@ -162,7 +185,8 @@ dMeter2Draw_c::dMeter2Draw_c(JKRExpHeap* mp_heap) {
}
J2DTextBox::TFontSize font_size;
#if VERSION != VERSION_GCN_JPN
#if TARGET_PC || VERSION != VERSION_GCN_JPN
IF_DUSK_BLOCK(!dusk::version::isRegionJpn())
font_size.mSizeX = 17.0f;
font_size.mSizeY = 20.0f;
for (int i = 0; i < 5; i++) {
@@ -172,6 +196,7 @@ dMeter2Draw_c::dMeter2Draw_c(JKRExpHeap* mp_heap) {
static_cast<J2DTextBox*>(mpXYText[i][1]->getPanePtr())->setFontSize(font_size);
static_cast<J2DTextBox*>(mpXYText[i][2]->getPanePtr())->setFontSize(font_size);
}
IF_DUSK_BLOCK_END
#endif
init();
+25 -14
View File
@@ -17,6 +17,7 @@
#if TARGET_PC
#include "dusk/randomizer/game/randomizer_context.hpp"
#include "dusk/version.hpp"
#include "battery/embed.hpp"
#endif
#include "helpers/string.hpp"
@@ -538,13 +539,18 @@ f32 dMeter2Info_c::getStringLength(J2DTextBox* i_textbox, char* i_string) {
str_width = 0.0f;
} else {
int c = (u8)*string;
#if VERSION == VERSION_GCN_JPN
bool unkFlag1 = false;
if ((c >= 0x81 && c <= 0x9f) || (c >= 0xe0 && c <= 0xfc)) {
unkFlag1 = true;
}
if (unkFlag1) {
c = (c << 8) | (u8)*++string;
#if TARGET_PC || VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn())
#endif
{
bool unkFlag1 = false;
if ((c >= 0x81 && c <= 0x9f) || (c >= 0xe0 && c <= 0xfc)) {
unkFlag1 = true;
}
if (unkFlag1) {
c = (c << 8) | (u8)*++string;
}
}
#endif
str_width += charSpace + (fontSize.mSizeX * ((f32)font->getWidth(c) / (f32)font->getCellWidth()));
@@ -570,13 +576,18 @@ f32 dMeter2Info_c::getStringLength(JUTFont* i_font, f32 param_2, f32 param_3, ch
str_width = 0.0f;
} else {
int c = (u8)*string;
#if VERSION == VERSION_GCN_JPN
bool unkFlag1 = false;
if ((c >= 0x81 && c <= 0x9f) || (c >= 0xe0 && c <= 0xfc)) {
unkFlag1 = true;
}
if (unkFlag1) {
c = (c << 8) | (u8)*++string;
#if TARGET_PC || VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn())
#endif
{
bool unkFlag1 = false;
if ((c >= 0x81 && c <= 0x9f) || (c >= 0xe0 && c <= 0xfc)) {
unkFlag1 = true;
}
if (unkFlag1) {
c = (c << 8) | (u8)*++string;
}
}
#endif
str_width += param_3 + param_2 * ((f32)i_font->getWidth(c) / (f32)i_font->getCellWidth());
+69 -14
View File
@@ -19,11 +19,15 @@
#include "dusk/frame_interpolation.h"
#include <cstring>
#include "dusk/version.hpp"
#if TARGET_PC
#include "helpers/string.hpp"
#endif
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
#define STR_BUF_LEN 528
#elif VERSION == VERSION_GCN_JPN
#define STR_BUF_LEN 528
#else
#define STR_BUF_LEN 512
@@ -261,7 +265,15 @@ void dMeterButton_c::draw() {
SAFE_STRCPY(tmp_buf, static_cast<J2DTextBox*>(mpTm_c[0]->getPanePtr())->getStringPtr());
mpTextScreen->draw(0.0f, 0.0f, graf_ctx);
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
mpString_c->getString(mMsgID, static_cast<J2DTextBox*>(mpTm_c[0]->getPanePtr()), NULL, NULL,
NULL, 12);
} else {
mpString_c->getString(mMsgID, static_cast<J2DTextBox*>(mpTm_c[0]->getPanePtr()), NULL, NULL,
NULL, 8);
}
#elif VERSION == VERSION_GCN_JPN
mpString_c->getString(mMsgID, static_cast<J2DTextBox*>(mpTm_c[0]->getPanePtr()), NULL, NULL,
NULL, 12);
#else
@@ -1195,7 +1207,15 @@ void dMeterButton_c::screenInitButton() {
field_0x4d9 = 0xFF;
for (int i = 0; i < 10; i++) {
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
mpTextBox[i] = (J2DTextBox*)mpButtonScreen->search(text_tag[i]);
mpButtonScreen->search(ftext_tag[i])->hide();
} else {
mpTextBox[i] = (J2DTextBox*)mpButtonScreen->search(ftext_tag[i]);
mpButtonScreen->search(text_tag[i])->hide();
}
#elif VERSION == VERSION_GCN_JPN
mpTextBox[i] = (J2DTextBox*)mpButtonScreen->search(text_tag[i]);
mpButtonScreen->search(ftext_tag[i])->hide();
#else
@@ -1468,7 +1488,50 @@ void dMeterButton_c::screenInitText() {
mpTmRoot_c = JKR_NEW CPaneMgr(mpTextScreen, MULTI_CHAR('mg_null'), 0, NULL);
JUT_ASSERT(2499, mpTmRoot_c != NULL);
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
if (dComIfGs_getOptRuby() == 0) {
mpTm_c[0] = JKR_NEW CPaneMgr(mpTextScreen, MULTI_CHAR('mg_3flin'), 0, NULL);
mpTm_c[1] = JKR_NEW CPaneMgr(mpTextScreen, MULTI_CHAR('t3f_s'), 0, NULL);
field_0x0ec[0] = JKR_NEW CPaneMgr(mpTextScreen, MULTI_CHAR('mg_3f'), 0, NULL);
field_0x0ec[1] = JKR_NEW CPaneMgr(mpTextScreen, MULTI_CHAR('mg_3f_s'), 0, NULL);
mpTextScreen->search(MULTI_CHAR('n_3line'))->hide();
mpTextScreen->search(MULTI_CHAR('n_3fline'))->show();
mpTextScreen->search(MULTI_CHAR('n_e4line'))->hide();
} else {
mpTm_c[0] = JKR_NEW CPaneMgr(mpTextScreen, MULTI_CHAR('mg_3line'), 0, NULL);
mpTm_c[1] = JKR_NEW CPaneMgr(mpTextScreen, 't3_s', 0, NULL);
field_0x0ec[0] = NULL;
field_0x0ec[1] = NULL;
OS_REPORT("[%s] %d\n", __FILE__, __LINE__);
mpTextScreen->search(MULTI_CHAR('n_3line'))->show();
mpTextScreen->search(MULTI_CHAR('n_3fline'))->hide();
mpTextScreen->search(MULTI_CHAR('n_e4line'))->hide();
}
} else {
mpTm_c[0] = JKR_NEW CPaneMgr(mpTextScreen, MULTI_CHAR('mg_e4lin'), 0, NULL);
JUT_ASSERT(2504, mpTm_c[0] != NULL);
mpTm_c[1] = JKR_NEW CPaneMgr(mpTextScreen, 't4_s', 0, NULL);
JUT_ASSERT(2507, mpTm_c[1] != NULL);
field_0x0ec[0] = NULL;
field_0x0ec[1] = NULL;
OS_REPORT("[%s] %d\n", __FILE__, 2512);
mpTextScreen->search(MULTI_CHAR('n_3line'))->hide();
mpTextScreen->search(MULTI_CHAR('n_3fline'))->hide();
mpTextScreen->search(MULTI_CHAR('n_e4line'))->show();
}
#elif VERSION == VERSION_GCN_JPN
if (dComIfGs_getOptRuby() == 0) {
mpTm_c[0] = JKR_NEW CPaneMgr(mpTextScreen, MULTI_CHAR('mg_3flin'), 0, NULL);
@@ -1516,19 +1579,11 @@ void dMeterButton_c::screenInitText() {
f32 line_space = static_cast<J2DTextBox*>(mpTm_c[0]->getPanePtr())->getLineSpace();
for (int i = 0; i < 2; i++) {
static_cast<J2DTextBox*>(mpTm_c[i]->getPanePtr())->setFont(mDoExt_getMesgFont());
#if VERSION == VERSION_GCN_JPN
static_cast<J2DTextBox*>(mpTm_c[i]->getPanePtr())->setString(0x210, "");
#else
static_cast<J2DTextBox*>(mpTm_c[i]->getPanePtr())->setString(0x200, "");
#endif
static_cast<J2DTextBox*>(mpTm_c[i]->getPanePtr())->setString(STR_BUF_LEN, "");
if (field_0x0ec[i] != NULL) {
static_cast<J2DTextBox*>(field_0x0ec[i]->getPanePtr())->setFont(mDoExt_getMesgFont());
#if VERSION == VERSION_GCN_JPN
static_cast<J2DTextBox*>(field_0x0ec[i]->getPanePtr())->setString(0x210, "");
#else
static_cast<J2DTextBox*>(field_0x0ec[i]->getPanePtr())->setString(0x200, "");
#endif
static_cast<J2DTextBox*>(field_0x0ec[i]->getPanePtr())->setString(STR_BUF_LEN, "");
static_cast<J2DTextBox*>(field_0x0ec[i]->getPanePtr())->setLineSpace(line_space);
}
}
+134 -26
View File
@@ -1,16 +1,17 @@
#include "d/dolzel.h" // IWYU pragma: keep
#include "d/d_msg_class.h"
#include <cstdio>
#include <cstring>
#include "d/d_meter2_info.h"
#include "d/d_msg_object.h"
#include "d/d_msg_unit.h"
#include "JSystem/J2DGraph/J2DTextBox.h"
#include "d/d_msg_out_font.h"
#include "m_Do/m_Do_graphic.h"
#include "d/d_lib.h"
#include "JSystem/JUtility/JUTFont.h"
#include "d/d_lib.h"
#include "d/d_meter2_info.h"
#include "d/d_msg_class.h"
#include "d/d_msg_object.h"
#include "d/d_msg_out_font.h"
#include "d/d_msg_unit.h"
#include "dusk/version.hpp"
#include "m_Do/m_Do_graphic.h"
#if TARGET_PC
#include "dusk/menu_pointer.h"
@@ -19,7 +20,16 @@
#include "dusk/randomizer/game/custom_flow_ids.hpp"
#endif
#if REGION_JPN
#if TARGET_PC
#define CHAR_CODE_MALE_ICON (dusk::version::isRegionJpn() ? 0x8189 : 0xB2)
#define CHAR_CODE_FEMALE_ICON (dusk::version::isRegionJpn() ? 0x818A : 0xB3)
#define CHAR_CODE_STAR_ICON (dusk::version::isRegionJpn() ? 0x819A : 0xB1)
#define CHAR_CODE_REFMARK (dusk::version::isRegionJpn() ? 0x81A6 : 0x89)
#define CHAR_CODE_THIN_LEFT_ARROW (dusk::version::isRegionJpn() ? 0x81A9 : 0xB9)
#define CHAR_CODE_THIN_RIGHT_ARROW (dusk::version::isRegionJpn() ? 0x81A8 : 0xBC)
#define CHAR_CODE_THIN_UP_ARROW (dusk::version::isRegionJpn() ? 0x81AA : 0xBD)
#define CHAR_CODE_THIN_DOWN_ARROW (dusk::version::isRegionJpn() ? 0x81AB : 0xBE)
#elif REGION_JPN
#define CHAR_CODE_MALE_ICON 0x8189
#define CHAR_CODE_FEMALE_ICON 0x818A
#define CHAR_CODE_STAR_ICON 0x819A
@@ -473,8 +483,33 @@ void jmessage_tReference::calcDistance() {
u8 jmessage_tReference::getLineMax() {
int line_max;
#if REGION_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
if (isKanban()) {
line_max = 6;
} else if (isBook()) {
line_max = 7;
} else if (isStaffRoll()) {
line_max = 10;
} else if (isSaveSeq()) {
line_max = 5;
} else {
line_max = 3;
}
} else {
if (isKanban()) {
line_max = 7;
} else if (isBook()) {
line_max = 9;
} else if (isStaffRoll()) {
line_max = 10;
} else if (isSaveSeq()) {
line_max = 6;
} else {
line_max = 4;
}
}
#elif REGION_JPN
if (isKanban()) {
line_max = 6;
} else if (isBook()) {
@@ -937,7 +972,7 @@ void jmessage_tMeasureProcessor::do_begin(void const* pEntry, char const* pszTex
mSeSpeaker = ((JMSMesgEntry_c*)pEntry)->se_speaker;
mSeMood = ((JMSMesgEntry_c*)pEntry)->se_mood;
for (int i = 0; i < D_MSG_CLASS_PAGE_CNT_MAX; i++) {
for (int i = 0; i < DUSK_IF_ELSE((dusk::version::isRegionJpn() ? 30 : D_MSG_CLASS_PAGE_CNT_MAX), D_MSG_CLASS_PAGE_CNT_MAX); i++) {
pReference->setLineLength(i, 0.0f, 0.0f);
pReference->setPageLine(i, 0);
pReference->setPageLineMax(i, 0);
@@ -954,7 +989,11 @@ void jmessage_tMeasureProcessor::do_begin(void const* pEntry, char const* pszTex
pReference->setLineArrange(i, 1);
}
#if !REGION_JPN
#if TARGET_PC
if (!dusk::version::isRegionJpn() && ((JMSMesgEntry_c*)pEntry)->unk_0xd == 0) {
pReference->setLineArrange(i, 1);
}
#elif !REGION_JPN
if (((JMSMesgEntry_c*)pEntry)->unk_0xd == 0) {
pReference->setLineArrange(i, 1);
}
@@ -1633,6 +1672,33 @@ void jmessage_tMeasureProcessor::do_scale(f32 i_scale) {
mPageLineMax--;
JUT_ASSERT(0x930, mPageLineMax > 0);
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
if (field_0x3e == 0) {
pReference->setPageType(field_0x40, 2);
} else {
pReference->setPageType(field_0x40, 3);
if (field_0x3e == 1 && pReference->getPageType(field_0x40) == 2) {
pReference->setPageType(field_0x40, 4);
}
}
} else {
if (field_0x3e == 0) {
pReference->setPageType(field_0x40, 2);
} else if (field_0x3e == 2 && mPageLineMax == 3) {
if (pReference->getPageType(field_0x40) == 4) {
pReference->setPageType(field_0x40, 5);
} else {
pReference->setPageType(field_0x40, 8);
}
} else {
pReference->setPageType(field_0x40, 3);
if (field_0x3e == 1 && pReference->getPageType(field_0x40) == 2) {
pReference->setPageType(field_0x40, 4);
}
}
}
#else
#if REGION_JPN
if (field_0x3e == 0) {
pReference->setPageType(field_0x40, 2);
@@ -1654,6 +1720,7 @@ void jmessage_tMeasureProcessor::do_scale(f32 i_scale) {
pReference->setPageType(field_0x40, 4);
}
}
#endif
}
}
@@ -1804,7 +1871,10 @@ void jmessage_tMeasureProcessor::do_pageType(int param_0) {
void jmessage_tMeasureProcessor::do_name1() {
const char* name = dComIfGs_getPlayerName();
#if REGION_JPN
#if TARGET_PC || REGION_JPN
if (!dusk::version::isRegionJpn())
return;
int c = (((char)name[0] & 0xFF) << 8) | ((char)name[1] & 0xFF);
// if first character is hiragana or katakana
if ((c >= 0x829F && c <= 0x82F1) || (c >= 0x8340 && c <= 0x8396)) {
@@ -2083,7 +2153,7 @@ bool jmessage_tSequenceProcessor::do_isReady() {
field_0xae = 1;
field_0xa4 = 0;
pReference->onBatchFlag();
pReference->setCharCnt(D_MSG_CLASS_CHAR_CNT_MAX);
pReference->setCharCnt(DUSK_IF_ELSE(dusk::version::isRegionJpn() ? D_MSG_CLASS_CHAR_CNT_MAX : 0x200, D_MSG_CLASS_CHAR_CNT_MAX));
field_0xa4 = field_0xa8;
return true;
}
@@ -2103,7 +2173,7 @@ bool jmessage_tSequenceProcessor::do_isReady() {
field_0xae = 1;
field_0xa4 = 0;
pReference->onBatchFlag();
pReference->setCharCnt(D_MSG_CLASS_CHAR_CNT_MAX);
pReference->setCharCnt(DUSK_IF_ELSE(dusk::version::isRegionJpn() ? D_MSG_CLASS_CHAR_CNT_MAX : 0x200, D_MSG_CLASS_CHAR_CNT_MAX));
return true;
}
@@ -2126,7 +2196,7 @@ bool jmessage_tSequenceProcessor::do_isReady() {
if (mDoCPd_c::getTrigA(PAD_1) || field_0xb2 != 0 IF_DUSK(|| (dusk::getSettings().game.instantText && mDoCPd_c::getHoldB(0)))) {
field_0xa4 = 0;
pReference->onBatchFlag();
pReference->setCharCnt(D_MSG_CLASS_CHAR_CNT_MAX);
pReference->setCharCnt(DUSK_IF_ELSE(dusk::version::isRegionJpn() ? D_MSG_CLASS_CHAR_CNT_MAX : 0x200, D_MSG_CLASS_CHAR_CNT_MAX));
}
break;
case 1:
@@ -2135,7 +2205,7 @@ bool jmessage_tSequenceProcessor::do_isReady() {
case 9:
field_0xa4 = 0;
pReference->onBatchFlag();
pReference->setCharCnt(D_MSG_CLASS_CHAR_CNT_MAX);
pReference->setCharCnt(DUSK_IF_ELSE(dusk::version::isRegionJpn() ? D_MSG_CLASS_CHAR_CNT_MAX : 0x200, D_MSG_CLASS_CHAR_CNT_MAX));
break;
case 2:
if (field_0xb2 != 0) {
@@ -2150,7 +2220,9 @@ bool jmessage_tSequenceProcessor::do_isReady() {
}
field_0xa6++;
#if REGION_JPN
#if TARGET_PC
if ((dusk::version::isRegionJpn() && field_0xa6 >= 1) || (!dusk::version::isRegionJpn() && field_0xa6 >= 2)) {
#elif REGION_JPN
if (field_0xa6 >= 1) {
#else
if (field_0xa6 >= 2) {
@@ -2575,7 +2647,10 @@ bool jmessage_tSequenceProcessor::do_jump_isReady() {
void jmessage_tSequenceProcessor::do_name1() {
const char* name = dComIfGs_getPlayerName();
#if REGION_JPN
#if TARGET_PC || REGION_JPN
if (!dusk::version::isRegionJpn())
return;
int c = (((char)name[0] & 0xFF) << 8) | ((char)name[1] & 0xFF);
// if first character is hiragana or katakana
if ((c >= 0x829F && c <= 0x82F1) || (c >= 0x8340 && c <= 0x8396)) {
@@ -3399,9 +3474,9 @@ void jmessage_tRenderingProcessor::do_heightcenter() {
}
break;
}
#if REGION_JPN
#if TARGET_PC || REGION_JPN
case 2:
if ((s8)pReference->getLineMax() == 3) {
if (IF_DUSK(dusk::version::isRegionJpn() &&) (s8)pReference->getLineMax() == 3) {
int nowPageLine = pReference->getNowPageLine();
field_0x138 = pReference->getLineSpace() * (0.5f * (pReference->getLineMax() - (s16)nowPageLine));
var_f31 += field_0x138;
@@ -3410,12 +3485,25 @@ void jmessage_tRenderingProcessor::do_heightcenter() {
if (field_0x142 == 0) {
field_0x138 = pReference->getLineSpace();
var_f31 += field_0x138;
} else if (field_0x142 == 1) {
}
#if TARGET_PC
else if (!dusk::version::isRegionJpn() || (dusk::version::isRegionJpn() && field_0x142 == 1))
#else
else if (field_0x142 == 1)
#endif
{
field_0x138 = 0.5f * pReference->getLineSpace();
var_f31 += field_0x138;
}
break;
case 3: {
#if TARGET_PC
if (!dusk::version::isRegionJpn()) {
field_0x138 = 0.5f * pReference->getLineSpace();
var_f31 += field_0x138;
break;
}
#endif
if (field_0x142 == 1) {
int nowPageLine = pReference->getNowPageLine();
field_0x138 = pReference->getLineSpace() * (0.5f * (pReference->getLineMax() - (s16)nowPageLine));
@@ -3425,8 +3513,25 @@ void jmessage_tRenderingProcessor::do_heightcenter() {
break;
}
case 4: {
#if TARGET_PC
if (!dusk::version::isRegionJpn() && field_0x142 == 0) {
int nowPageLine = pReference->getNowPageLine();
field_0x138 = pReference->getLineSpace() * (0.5f * (pReference->getLineMax() - (s16)nowPageLine));
var_f31 += field_0x138;
}
#endif
if (field_0x142 == 1) {
#if TARGET_PC
if (!dusk::version::isRegionJpn()) {
field_0x138 = 0.5f * pReference->getLineSpace();
var_f31 += field_0x138;
} else {
var_f31 += 0.5f * pReference->getLineSpace();
}
#else
var_f31 += 0.5f * pReference->getLineSpace();
#endif
}
f32 sp8 = pReference->getLineScale(field_0x142) / 100.0f;
@@ -3704,7 +3809,7 @@ void jmessage_tRenderingProcessor::do_strcat(char* i_str, bool param_2, bool par
} else {
JUT_WARN(5316, "%s", "TextBox Alloc Byte Over!!");
}
} else if (field_0x11c < D_MSG_CLASS_CHAR_CNT_MAX) {
} else if (field_0x11c < DUSK_IF_ELSE((dusk::version::isRegionJpn() ? D_MSG_CLASS_CHAR_CNT_MAX : 0x200), D_MSG_CLASS_CHAR_CNT_MAX)) {
if (param_2) {
field_0x146++;
if (pReference->getBatchColorFlag() != 0) {
@@ -3739,7 +3844,7 @@ void jmessage_tRenderingProcessor::do_strcat(char* i_str, bool param_2, bool par
int length = 0;
length = strlen(buffer);
if (field_0x11c + length < D_MSG_CLASS_CHAR_CNT_MAX) {
if (field_0x11c + length < DUSK_IF_ELSE((dusk::version::isRegionJpn() ? D_MSG_CLASS_CHAR_CNT_MAX : 0x200), D_MSG_CLASS_CHAR_CNT_MAX)) {
field_0x148 = strlen(pReference->getTextPtr());
field_0x14a = strlen(pReference->getTextSPtr());
@@ -3834,7 +3939,10 @@ void jmessage_tRenderingProcessor::do_rubystrcat(char* i_src, TEXT_SPAN i_dst, f
void jmessage_tRenderingProcessor::do_name1() {
const char* name = dComIfGs_getPlayerName();
#if REGION_JPN
#if TARGET_PC || REGION_JPN
if (!dusk::version::isRegionJpn())
return;
int c = (((char)name[0] & 0xFF) << 8) | ((char)name[1] & 0xFF);
// if first character is hiragana or katakana
if ((c >= 0x829F && c <= 0x82F1) || (c >= 0x8340 && c <= 0x8396)) {
@@ -3931,7 +4039,7 @@ void jmessage_string_tReference::init(J2DTextBox* panePtr, J2DTextBox* runyPaneP
mRubyPanePtr = runyPanePtr;
mOutFontPtr = outFontPtr;
mLineCount = 0;
mLineMax = D_MSG_CLASS_LINE_MAX;
mLineMax = DUSK_IF_ELSE(dusk::version::isRegionJpn() ? 9 : D_MSG_CLASS_LINE_MAX, D_MSG_CLASS_LINE_MAX);
mNowPage = 0;
mFlags = flags;
if (font != NULL) {
+7
View File
@@ -329,6 +329,13 @@ dMsgObject_HIO_c::dMsgObject_HIO_c() {
}
int dMsgObject_c::_create(msg_class* param_1) {
#if TARGET_PC
if (dusk::version::isRegionJpn())
g_MsgObject_HIO_c.mBoxTalkScaleX = 1.1f;
else
g_MsgObject_HIO_c.mBoxTalkScaleX = 1.2f;
#endif
field_0x124 = NULL;
field_0x100 = param_1;
field_0x16c = -1;
+14 -3
View File
@@ -1,11 +1,12 @@
#include "d/dolzel.h" // IWYU pragma: keep
#include "d/d_msg_out_font.h"
#include "JSystem/J2DGraph/J2DTextBox.h"
#include "JSystem/JUtility/JUTTexture.h"
#include "d/d_meter2_info.h"
#include "d/d_msg_object.h"
#include "d/d_msg_out_font.h"
#include "dusk/frame_interpolation.h"
#include "dusk/version.hpp"
#include "f_op/f_op_msg_mng.h"
COutFontSet_c::COutFontSet_c() {
@@ -289,8 +290,10 @@ void COutFont_c::initialize() {
void COutFont_c::drawFont(J2DTextBox* i_textbox, u8 i_type, f32 i_posX, f32 i_posY, f32 i_sizeX,
f32 i_sizeY, u32 i_color, u8 i_alpha) {
#if VERSION != VERSION_GCN_JPN
#if TARGET_PC || VERSION != VERSION_GCN_JPN
IF_DUSK_BLOCK(!dusk::version::isRegionJpn())
i_posY += 1.0f;
IF_DUSK_BLOCK_END;
#endif
for (int i = 0; i < 35; i++) {
if (mpOfs[i]->getType() == 0x47) {
@@ -380,7 +383,15 @@ void COutFont_c::draw(J2DTextBox* i_textbox, f32 param_1, f32 param_2, f32 param
break;
case 5:
case 6: {
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
posY -= 2.0f;
sizeY -= 2.0f;
} else {
posY += 1.0f;
sizeY -= 3.0f;
}
#elif VERSION == VERSION_GCN_JPN
posY -= 2.0f;
sizeY -= 2.0f;
#else
+107 -5
View File
@@ -5,16 +5,17 @@
#include "d/dolzel.h" // IWYU pragma: keep
#include "d/d_msg_scrn_3select.h"
#include <cstring>
#include "JSystem/J2DGraph/J2DAnmLoader.h"
#include "JSystem/J2DGraph/J2DGrafContext.h"
#include "JSystem/J2DGraph/J2DScreen.h"
#include "JSystem/J2DGraph/J2DTextBox.h"
#include <cstring>
#include "d/d_com_inf_game.h"
#include "d/d_select_cursor.h"
#include "d/d_msg_object.h"
#include "d/d_msg_scrn_3select.h"
#include "d/d_pane_class.h"
#include "d/d_select_cursor.h"
#include "dusk/version.hpp"
#if TARGET_PC
#include "dusk/menu_pointer.h"
@@ -118,7 +119,97 @@ dMsgScrn3Select_c::dMsgScrn3Select_c() {
mCursorPos[i] = mpCursor_c[i]->getGlobalVtxCenter(true, 0);
}
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
if (dComIfGs_getOptRuby() == 0) {
mpTmSel_c[0] = JKR_NEW CPaneMgr(mpScreen, 'a_tf', 0, NULL);
mpTmSel_c[1] = JKR_NEW CPaneMgr(mpScreen, 'b_tf', 0, NULL);
mpTmSel_c[2] = JKR_NEW CPaneMgr(mpScreen, 'c_tf', 0, NULL);
mpTmrSel_c[0] = JKR_NEW CPaneMgr(mpScreen, MULTI_CHAR('a_tf_f'), 0, NULL);
mpTmrSel_c[1] = JKR_NEW CPaneMgr(mpScreen, MULTI_CHAR('b_tf_f'), 0, NULL);
mpTmrSel_c[2] = JKR_NEW CPaneMgr(mpScreen, MULTI_CHAR('c_tf_f'), 0, NULL);
for (int i = 0; i < 3; i++) {
((J2DTextBox*)(mpTmSel_c[i]->getPanePtr()))->setString(64, "");
((J2DTextBox*)(mpTmSel_c[i]->getPanePtr()))->setFont(mDoExt_getMesgFont());
((J2DTextBox*)(mpTmrSel_c[i]->getPanePtr()))->setString(64, "");
((J2DTextBox*)(mpTmrSel_c[i]->getPanePtr()))->setFont(mDoExt_getMesgFont());
}
mpScreen->search(MULTI_CHAR('a_t_e'))->hide();
mpScreen->search(MULTI_CHAR('b_t_e'))->hide();
mpScreen->search(MULTI_CHAR('c_t_e'))->hide();
mpScreen->search('a_tf')->show();
mpScreen->search('b_tf')->show();
mpScreen->search('c_tf')->show();
mpScreen->search(MULTI_CHAR('a_tf_f'))->show();
mpScreen->search(MULTI_CHAR('b_tf_f'))->show();
mpScreen->search(MULTI_CHAR('c_tf_f'))->show();
mpScreen->search('a_t')->hide();
mpScreen->search('b_t')->hide();
mpScreen->search('c_t')->hide();
} else {
mpTmSel_c[0] = JKR_NEW CPaneMgr(mpScreen, 'a_t', 0, NULL);
mpTmSel_c[1] = JKR_NEW CPaneMgr(mpScreen, 'b_t', 0, NULL);
mpTmSel_c[2] = JKR_NEW CPaneMgr(mpScreen, 'c_t', 0, NULL);
for (int i = 0; i < 3; i++) {
((J2DTextBox*)(mpTmSel_c[i]->getPanePtr()))->setString(64, "");
((J2DTextBox*)(mpTmSel_c[i]->getPanePtr()))->setFont(mDoExt_getMesgFont());
mpTmrSel_c[i] = NULL;
}
mpScreen->search(MULTI_CHAR('a_t_e'))->hide();
mpScreen->search(MULTI_CHAR('b_t_e'))->hide();
mpScreen->search(MULTI_CHAR('c_t_e'))->hide();
mpScreen->search('a_tf')->hide();
mpScreen->search('b_tf')->hide();
mpScreen->search('c_tf')->hide();
mpScreen->search(MULTI_CHAR('a_tf_f'))->hide();
mpScreen->search(MULTI_CHAR('b_tf_f'))->hide();
mpScreen->search(MULTI_CHAR('c_tf_f'))->hide();
mpScreen->search('a_t')->show();
mpScreen->search('b_t')->show();
mpScreen->search('c_t')->show();
}
} else {
mpTmSel_c[0] = JKR_NEW CPaneMgr(mpScreen, MULTI_CHAR('a_t_e'), 0, NULL);
JUT_ASSERT(0, mpTmSel_c[0] != NULL);
mpTmSel_c[1] = JKR_NEW CPaneMgr(mpScreen, MULTI_CHAR('b_t_e'), 0, NULL);
JUT_ASSERT(0, mpTmSel_c[1] != NULL);
mpTmSel_c[2] = JKR_NEW CPaneMgr(mpScreen, MULTI_CHAR('c_t_e'), 0, NULL);
JUT_ASSERT(0, mpTmSel_c[2] != NULL);
for (int i = 0; i < 3; i++) {
((J2DTextBox*)(mpTmSel_c[i]->getPanePtr()))->setString(64, "");
((J2DTextBox*)(mpTmSel_c[i]->getPanePtr()))->setFont(mDoExt_getMesgFont());
mpTmrSel_c[i] = NULL;
}
mpScreen->search(MULTI_CHAR('a_t_e'))->show();
mpScreen->search(MULTI_CHAR('b_t_e'))->show();
mpScreen->search(MULTI_CHAR('c_t_e'))->show();
mpScreen->search('a_tf')->hide();
mpScreen->search('b_tf')->hide();
mpScreen->search('c_tf')->hide();
mpScreen->search(MULTI_CHAR('a_tf_f'))->hide();
mpScreen->search(MULTI_CHAR('b_tf_f'))->hide();
mpScreen->search(MULTI_CHAR('c_tf_f'))->hide();
mpScreen->search('a_t')->hide();
mpScreen->search('b_t')->hide();
mpScreen->search('c_t')->hide();
}
#elif VERSION == VERSION_GCN_JPN
if (dComIfGs_getOptRuby() == 0) {
mpTmSel_c[0] = JKR_NEW CPaneMgr(mpScreen, 'a_tf', 0, NULL);
@@ -966,7 +1057,18 @@ void dMsgScrn3Select_c::selectTrans() {
f32 sp68[3];
for (int i = 0; i < 3; i++) {
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
if (dComIfGs_getOptRuby() == 0 && (field_0x112 & (u8)(1 << i)) != 0) {
sp68[i] = 0.0f;
} else {
f32 temp = mpTmSel_c[i]->getInitPosY();
sp68[i] = mpScreen->search(tag_n[i])->getBounds().i.y - temp;
}
} else {
sp68[i] = 0.0f;
}
#elif VERSION == VERSION_GCN_JPN
if (dComIfGs_getOptRuby() == 0 && (field_0x112 & (u8)(1 << i)) != 0) {
sp68[i] = 0.0f;
} else {
+5 -2
View File
@@ -1,10 +1,11 @@
#include "d/dolzel.h" // IWYU pragma: keep
#include "d/d_msg_scrn_boss.h"
#include "JSystem/J2DGraph/J2DGrafContext.h"
#include "JSystem/J2DGraph/J2DScreen.h"
#include "d/d_msg_object.h"
#include "d/d_msg_scrn_boss.h"
#include "d/d_pane_class.h"
#include "dusk/version.hpp"
#if TARGET_PC
#include "dusk/settings.h"
@@ -37,8 +38,10 @@ dMsgScrnBoss_c::dMsgScrnBoss_c() {
for (int i = 0; i < 7; i++) {
mpTm_c[i] = JKR_NEW CPaneMgr(mpScreen, t_tag[i], 0, NULL);
((J2DTextBox*)mpTm_c[i]->getPanePtr())->setFont(mDoExt_getRubyFont());
#if VERSION != VERSION_GCN_JPN
#if TARGET_PC || VERSION != VERSION_GCN_JPN
IF_DUSK_BLOCK(!dusk::version::isRegionJpn())
((J2DTextBox*)mpTm_c[i]->getPanePtr())->setCharSpace(1.0f);
IF_DUSK_BLOCK_END
#endif
((J2DTextBox*)mpTm_c[i]->getPanePtr())->setString(0x100, "");
}
+61 -14
View File
@@ -14,7 +14,9 @@
#include <cstdio>
#include <cstring>
#if VERSION == VERSION_GCN_JPN
#include "dusk/version.hpp"
#if TARGET_PC || VERSION == VERSION_GCN_JPN
#define STR_BUF_LEN 528
#else
#define STR_BUF_LEN 512
@@ -95,7 +97,13 @@ dMsgScrnExplain_c::dMsgScrnExplain_c(STControl* i_stick, u8 param_1, bool i_isUs
mpTxScreen->search(MULTI_CHAR('n_3fline'))->hide();
mpTxScreen->search(MULTI_CHAR('n_e4line'))->hide();
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
field_0x50 = 0.0f;
} else {
field_0x50 = -10.0f;
}
#elif VERSION == VERSION_GCN_JPN
field_0x50 = 0.0f;
#else
field_0x50 = -10.0f;
@@ -109,7 +117,48 @@ dMsgScrnExplain_c::dMsgScrnExplain_c(STControl* i_stick, u8 param_1, bool i_isUs
mpScreen->search(MULTI_CHAR('n_all'))->scale(g_MsgObject_HIO_c.mBoxTalkScaleX,
g_MsgObject_HIO_c.mBoxTalkScaleY);
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
field_0x50 = 0.0f;
if (dComIfGs_getOptRuby() == 0) {
mpTm_c[0] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('mg_3flin'), 0, NULL);
mpTm_c[1] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('t3f_s'), 0, NULL);
mpTmr_c[0] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('mg_3f'), 0, NULL);
mpTmr_c[1] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('mg_3f_s'), 0, NULL);
mpTxScreen->search(MULTI_CHAR('n_3line'))->hide();
mpTxScreen->search(MULTI_CHAR('n_3fline'))->show();
mpTxScreen->search(MULTI_CHAR('n_e4line'))->hide();
} else {
mpTm_c[0] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('mg_3line'), 0, NULL);
mpTm_c[1] = JKR_NEW CPaneMgr(mpTxScreen, 't3_s', 0, NULL);
mpTmr_c[0] = NULL;
mpTmr_c[1] = NULL;
mpTxScreen->search(MULTI_CHAR('n_3line'))->show();
mpTxScreen->search(MULTI_CHAR('n_3fline'))->hide();
mpTxScreen->search(MULTI_CHAR('n_e4line'))->hide();
}
} else {
field_0x50 = -10.0f;
mpTm_c[0] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('mg_e4lin'), 0, NULL);
JUT_ASSERT(162, mpTm_c[0] != NULL);
mpTm_c[1] = JKR_NEW CPaneMgr(mpTxScreen, 't4_s', 0, NULL);
JUT_ASSERT(165, mpTm_c[1] != NULL);
mpTmr_c[0] = NULL;
mpTmr_c[1] = NULL;
mpTxScreen->search(MULTI_CHAR('n_3line'))->hide();
mpTxScreen->search(MULTI_CHAR('n_3fline'))->hide();
mpTxScreen->search(MULTI_CHAR('n_e4line'))->show();
}
#elif VERSION == VERSION_GCN_JPN
field_0x50 = 0.0f;
if (dComIfGs_getOptRuby() == 0) {
@@ -160,20 +209,12 @@ dMsgScrnExplain_c::dMsgScrnExplain_c(STControl* i_stick, u8 param_1, bool i_isUs
f32 lineSpace = ((J2DTextBox*)mpTm_c[0]->getPanePtr())->getLineSpace();
for (int i = 0; i < 2; i++) {
((J2DTextBox*)mpTm_c[i]->getPanePtr())->setFont(mDoExt_getMesgFont());
#if VERSION == VERSION_GCN_JPN
((J2DTextBox*)mpTm_c[i]->getPanePtr())->setString(0x210, "");
#else
((J2DTextBox*)mpTm_c[i]->getPanePtr())->setString(0x200, "");
#endif
((J2DTextBox*)mpTm_c[i]->getPanePtr())->setString(STR_BUF_LEN, "");
((J2DTextBox*)mpTm_c[i]->getPanePtr())->setLineSpace(lineSpace);
if (mpTmr_c[i] != NULL) {
((J2DTextBox*)mpTmr_c[i]->getPanePtr())->setFont(mDoExt_getMesgFont());
#if VERSION == VERSION_GCN_JPN
((J2DTextBox*)mpTmr_c[i]->getPanePtr())->setString(0x210, "");
#else
((J2DTextBox*)mpTmr_c[i]->getPanePtr())->setString(0x200, "");
#endif
((J2DTextBox*)mpTmr_c[i]->getPanePtr())->setString(STR_BUF_LEN, "");
((J2DTextBox*)mpTmr_c[i]->getPanePtr())->setLineSpace(lineSpace);
}
}
@@ -320,7 +361,13 @@ void dMsgScrnExplain_c::draw(J2DOrthoGraph* i_graf) {
SAFE_STRCPY(string_buf, ((J2DTextBox*)mpTm_c[0]->getPanePtr())->getStringPtr());
mpTxScreen->draw(0.0f, 0.0f, (J2DGrafContext*)i_graf);
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
mpString_c->getString(mOpenMsgId, (J2DTextBox*)mpTm_c[0]->getPanePtr(), NULL, NULL, NULL, 12);
} else {
mpString_c->getString(mOpenMsgId, (J2DTextBox*)mpTm_c[0]->getPanePtr(), NULL, NULL, NULL, 8);
}
#elif VERSION == VERSION_GCN_JPN
mpString_c->getString(mOpenMsgId, (J2DTextBox*)mpTm_c[0]->getPanePtr(), NULL, NULL, NULL, 12);
#else
mpString_c->getString(mOpenMsgId, (J2DTextBox*)mpTm_c[0]->getPanePtr(), NULL, NULL, NULL, 8);
+26 -11
View File
@@ -4,20 +4,21 @@
#include "d/dolzel.h" // IWYU pragma: keep
#include "d/d_msg_scrn_howl.h"
#include "m_Do/m_Do_controller_pad.h"
#include "m_Do/m_Do_graphic.h"
#include "d/d_msg_object.h"
#include "d/d_pane_class.h"
#include "JSystem/J2DGraph/J2DGrafContext.h"
#include "JSystem/J2DGraph/J2DScreen.h"
#include "JSystem/JUtility/JUTAssert.h"
#include "JSystem/JUtility/JUTTexture.h"
#include "Z2AudioLib/Z2WolfHowlMgr.h"
#include "d/actor/d_a_alink.h"
#include "d/d_meter2.h"
#include "d/d_meter2_draw.h"
#include "d/d_meter2_info.h"
#include "JSystem/JUtility/JUTTexture.h"
#include "JSystem/JUtility/JUTAssert.h"
#include "JSystem/J2DGraph/J2DGrafContext.h"
#include "JSystem/J2DGraph/J2DScreen.h"
#include "Z2AudioLib/Z2WolfHowlMgr.h"
#include "d/d_msg_object.h"
#include "d/d_msg_scrn_howl.h"
#include "d/d_pane_class.h"
#include "dusk/version.hpp"
#include "m_Do/m_Do_controller_pad.h"
#include "m_Do/m_Do_graphic.h"
#if TARGET_PC
#include "dusk/frame_interpolation.h"
@@ -89,7 +90,21 @@ dMsgScrnHowl_c::dMsgScrnHowl_c() {
JUT_ASSERT(96, mpButtonIcon[1] != NULL);
mpButtonText[1] = JKR_NEW CPaneMgr(mpScreen, MULTI_CHAR('gr_txt_n'), 2, NULL);
JUT_ASSERT(98, mpButtonText[1] != NULL);
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
J2DTextBox* piStack_19c;
J2DTextBox* piStack_1a0;
if (dusk::version::isRegionJpn()) {
piStack_19c = (J2DTextBox*)mpScreen->search(MULTI_CHAR('g_l_info'));
piStack_1a0 = (J2DTextBox*)mpScreen->search(MULTI_CHAR('g_r_info'));
mpScreen->search(MULTI_CHAR('fgr_info'))->hide();
mpScreen->search(MULTI_CHAR('fgl_info'))->hide();
} else {
piStack_19c = (J2DTextBox*)mpScreen->search(MULTI_CHAR('fgl_info'));
piStack_1a0 = (J2DTextBox*)mpScreen->search(MULTI_CHAR('fgr_info'));
mpScreen->search(MULTI_CHAR('g_l_info'))->hide();
mpScreen->search(MULTI_CHAR('g_r_info'))->hide();
}
#elif VERSION == VERSION_GCN_JPN
J2DTextBox* piStack_19c = (J2DTextBox*)mpScreen->search(MULTI_CHAR('g_l_info'));
J2DTextBox* piStack_1a0 = (J2DTextBox*)mpScreen->search(MULTI_CHAR('g_r_info'));
mpScreen->search(MULTI_CHAR('fgr_info'))->hide();
+49 -1
View File
@@ -24,6 +24,8 @@
#include "JSystem/JUtility/JUTTexture.h"
#include <cstring>
#include "dusk/version.hpp"
dMsgScrnItem_c::dMsgScrnItem_c(u8 param_1, u8 param_2, JKRExpHeap* param_3) {
if (param_3 != NULL) {
field_0x138 = param_3;
@@ -198,7 +200,53 @@ dMsgScrnItem_c::dMsgScrnItem_c(u8 param_1, u8 param_2, JKRExpHeap* param_3) {
mpPmP_c->scale(g_MsgObject_HIO_c.mBoxItemScaleX, g_MsgObject_HIO_c.mBoxItemScaleY);
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
if (dComIfGs_getOptRuby() == 0) {
mpTm_c[0] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('mg_3flin'), 0, NULL);
JUT_ASSERT(407, mpTm_c[0] != NULL);
mpTm_c[1] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('t3f_s'), 0, NULL);
JUT_ASSERT(410, mpTm_c[1] != NULL);
mpTm_c[2] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('t3f_w'), 0, NULL);
JUT_ASSERT(413, mpTm_c[2] != NULL);
mpTmr_c[0] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('mg_3f'), 0, NULL);
JUT_ASSERT(416, mpTmr_c[0] != NULL);
mpTmr_c[1] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('mg_3f_s'), 0, NULL);
JUT_ASSERT(419, mpTmr_c[1] != NULL);
mpTmr_c[2] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('mg_3f_w'), 0, NULL);
JUT_ASSERT(422, mpTmr_c[2] != NULL);
mpTxScreen->search(MULTI_CHAR('n_3line'))->hide();
mpTxScreen->search(MULTI_CHAR('n_3fline'))->show();
mpTxScreen->search(MULTI_CHAR('n_e4line'))->hide();
} else {
mpTm_c[0] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('mg_3line'), 0, NULL);
JUT_ASSERT(407, mpTm_c[0] != NULL);
mpTm_c[1] = JKR_NEW CPaneMgr(mpTxScreen, 't3_s', 0, NULL);
JUT_ASSERT(410, mpTm_c[1] != NULL);
mpTm_c[2] = JKR_NEW CPaneMgr(mpTxScreen, 't3_w', 0, NULL);
JUT_ASSERT(413, mpTm_c[2] != NULL);
mpTxScreen->search(MULTI_CHAR('n_3line'))->show();
mpTxScreen->search(MULTI_CHAR('n_3fline'))->hide();
mpTxScreen->search(MULTI_CHAR('n_e4line'))->hide();
}
} else {
mpTm_c[0] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('mg_e4lin'), 0, NULL);
JUT_ASSERT(407, mpTm_c[0] != NULL);
mpTm_c[1] = JKR_NEW CPaneMgr(mpTxScreen, 't4_s', 0, NULL);
JUT_ASSERT(410, mpTm_c[1] != NULL);
mpTm_c[2] = JKR_NEW CPaneMgr(mpTxScreen, 't4_w', 0, NULL);
JUT_ASSERT(413, mpTm_c[2] != NULL);
mpTxScreen->search(MULTI_CHAR('n_3line'))->hide();
mpTxScreen->search(MULTI_CHAR('n_3fline'))->hide();
mpTxScreen->search(MULTI_CHAR('n_e4line'))->show();
}
#elif VERSION == VERSION_GCN_JPN
if (dComIfGs_getOptRuby() == 0) {
mpTm_c[0] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('mg_3flin'), 0, NULL);
JUT_ASSERT(407, mpTm_c[0] != NULL);
+42 -11
View File
@@ -15,6 +15,14 @@
#include "d/d_pane_class.h"
#include <cstring>
#include "dusk/version.hpp"
#if TARGET_PC || VERSION == VERSION_GCN_JPN
#define STR_BUF_LEN 528
#else
#define STR_BUF_LEN 512
#endif
dMsgScrnJimaku_c::dMsgScrnJimaku_c(u8 param_0, JKRExpHeap* i_heap) {
if (i_heap != NULL) {
heap = i_heap;
@@ -46,7 +54,38 @@ dMsgScrnJimaku_c::dMsgScrnJimaku_c(u8 param_0, JKRExpHeap* i_heap) {
field_0xcc = g_MsgObject_HIO_c.mBoxPos[0][5];
mpPmP_c->paneTrans(0.0f, field_0xcc);
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
if (dComIfGs_getOptRuby() == 0) {
mpTm_c[0] = JKR_NEW CPaneMgr(mpScreen, MULTI_CHAR('mg_3flin'), 0, NULL);
mpTm_c[1] = JKR_NEW CPaneMgr(mpScreen, MULTI_CHAR('t3f_s'), 0, NULL);
mpTmr_c[0] = JKR_NEW CPaneMgr(mpScreen, MULTI_CHAR('mg_3f'), 0, NULL);
mpTmr_c[1] = JKR_NEW CPaneMgr(mpScreen, MULTI_CHAR('mg_3f_s'), 0, NULL);
mpScreen->search(MULTI_CHAR('n_3line'))->hide();
mpScreen->search(MULTI_CHAR('n_3fline'))->show();
mpScreen->search(MULTI_CHAR('n_e4line'))->hide();
} else {
mpTm_c[0] = JKR_NEW CPaneMgr(mpScreen, MULTI_CHAR('mg_3line'), 0, NULL);
mpTm_c[1] = JKR_NEW CPaneMgr(mpScreen, 't3_s', 0, NULL);
mpScreen->search(MULTI_CHAR('n_3line'))->show();
mpScreen->search(MULTI_CHAR('n_3fline'))->hide();
mpScreen->search(MULTI_CHAR('n_e4line'))->hide();
}
} else {
mpTm_c[0] = JKR_NEW CPaneMgr(mpScreen, MULTI_CHAR('mg_e4lin'), 0, NULL);
JUT_ASSERT(0, mpTm_c[0] != NULL);
mpTm_c[1] = JKR_NEW CPaneMgr(mpScreen, 't4_s', 0, NULL);
JUT_ASSERT(0, mpTm_c[1] != NULL);
mpScreen->search(MULTI_CHAR('n_3line'))->hide();
mpScreen->search(MULTI_CHAR('n_3fline'))->hide();
mpScreen->search(MULTI_CHAR('n_e4line'))->show();
}
#elif VERSION == VERSION_GCN_JPN
if (dComIfGs_getOptRuby() == 0) {
mpTm_c[0] = JKR_NEW CPaneMgr(mpScreen, MULTI_CHAR('mg_3flin'), 0, NULL);
mpTm_c[1] = JKR_NEW CPaneMgr(mpScreen, MULTI_CHAR('t3f_s'), 0, NULL);
@@ -79,21 +118,13 @@ dMsgScrnJimaku_c::dMsgScrnJimaku_c(u8 param_0, JKRExpHeap* i_heap) {
for (int i = 0; i < 2; i++) {
((J2DTextBox*)mpTm_c[i]->getPanePtr())->setFont(mDoExt_getMesgFont());
#if VERSION == VERSION_GCN_JPN
((J2DTextBox*)mpTm_c[i]->getPanePtr())->setString(0x210, "");
#else
((J2DTextBox*)mpTm_c[i]->getPanePtr())->setString(0x200, "");
#endif
((J2DTextBox*)mpTm_c[i]->getPanePtr())->setString(STR_BUF_LEN, "");
mpTm_c[i]->setBlackWhite(g_MsgObject_HIO_c.mBoxStartBlack[i][4],
g_MsgObject_HIO_c.mBoxStartWhite[i][4]);
if (mpTmr_c[i] != NULL) {
((J2DTextBox*)mpTmr_c[i]->getPanePtr())->setFont(mDoExt_getMesgFont());
#if VERSION == VERSION_GCN_JPN
((J2DTextBox*)mpTmr_c[i]->getPanePtr())->setString(0x210, "");
#else
((J2DTextBox*)mpTmr_c[i]->getPanePtr())->setString(0x200, "");
#endif
((J2DTextBox*)mpTmr_c[i]->getPanePtr())->setString(STR_BUF_LEN, "");
mpTmr_c[i]->setBlackWhite(g_MsgObject_HIO_c.mBoxStartBlack[i][4],
g_MsgObject_HIO_c.mBoxStartWhite[i][4]);
}
+43 -2
View File
@@ -4,14 +4,15 @@
#include "d/dolzel.h" // IWYU pragma: keep
#include "d/d_msg_scrn_kanban.h"
#include "JSystem/J2DGraph/J2DAnmLoader.h"
#include "JSystem/J2DGraph/J2DGrafContext.h"
#include "JSystem/J2DGraph/J2DScreen.h"
#include "JSystem/JKernel/JKRExpHeap.h"
#include "d/d_msg_object.h"
#include "d/d_msg_out_font.h"
#include "d/d_msg_scrn_kanban.h"
#include "d/d_pane_class.h"
#include "dusk/version.hpp"
#if TARGET_PC
#include "dusk/settings.h"
@@ -60,8 +61,48 @@ dMsgScrnKanban_c::dMsgScrnKanban_c(JKRExpHeap* param_0) {
mpSpot_c->getPanePtr()->setAnimation(field_0xd0);
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
if (dComIfGs_getOptRuby() != 0) {
static u64 const t_tag[3] = {MULTI_CHAR('mg_3line'), 't3_w', 't3_s'};
for (int i = 0; i < 3; i++) {
mpTm_c[i] = JKR_NEW CPaneMgr(mpScreen, t_tag[i], 0, NULL);
((J2DTextBox*)mpTm_c[i]->getPanePtr())->setFont(mDoExt_getMesgFont());
}
#if VERSION == VERSION_GCN_JPN
mpScreen->search(MULTI_CHAR('n_3line'))->show();
mpScreen->search(MULTI_CHAR('n_3fline'))->hide();
mpScreen->search(MULTI_CHAR('n_e4line'))->hide();
} else {
static u64 const t_tag_2[3] = {MULTI_CHAR('t3fline'), MULTI_CHAR('t3f_w'), MULTI_CHAR('t3f_s')};
static u64 const tr_tag[3] = {MULTI_CHAR('mg_3f'), MULTI_CHAR('mg_3f_w'), MULTI_CHAR('mg_3f_s')};
for (int i = 0; i < 3; i++) {
mpTm_c[i] = JKR_NEW CPaneMgr(mpScreen, t_tag_2[i], 0, NULL);
((J2DTextBox*)mpTm_c[i]->getPanePtr())->setFont(mDoExt_getMesgFont());
mpTmr_c[i] = JKR_NEW CPaneMgr(mpScreen, tr_tag[i], 0, NULL);
((J2DTextBox*)mpTmr_c[i]->getPanePtr())->setFont(mDoExt_getMesgFont());
}
mpScreen->search(MULTI_CHAR('n_3line'))->hide();
mpScreen->search(MULTI_CHAR('n_3fline'))->show();
mpScreen->search(MULTI_CHAR('n_e4line'))->hide();
}
} else {
static u64 const t_tag[3] = {MULTI_CHAR('mg_e4lin'), 'f4_w', 't4_s'};
for (int i = 0; i < 3; i++) {
mpTm_c[i] = JKR_NEW CPaneMgr(mpScreen, t_tag[i], 0, NULL);
JUT_ASSERT(81, mpTm_c[i] != NULL);
((J2DTextBox*)mpTm_c[i]->getPanePtr())->setFont(mDoExt_getMesgFont());
}
mpScreen->search(MULTI_CHAR('n_3line'))->hide();
mpScreen->search(MULTI_CHAR('n_3fline'))->hide();
mpScreen->search(MULTI_CHAR('n_e4line'))->show();
}
#elif VERSION == VERSION_GCN_JPN
if (dComIfGs_getOptRuby() != 0) {
static u64 const t_tag[3] = {MULTI_CHAR('mg_3line'), 't3_w', 't3_s'};
for (int i = 0; i < 3; i++) {
+11 -2
View File
@@ -5,12 +5,13 @@
#include "d/dolzel.h" // IWYU pragma: keep
#include "d/d_msg_scrn_place.h"
#include "JSystem/J2DGraph/J2DGrafContext.h"
#include "JSystem/J2DGraph/J2DScreen.h"
#include "d/d_camera.h"
#include "d/d_msg_object.h"
#include "d/d_msg_scrn_place.h"
#include "d/d_pane_class.h"
#include "dusk/version.hpp"
#if TARGET_PC
#include "dusk/settings.h"
@@ -32,7 +33,13 @@ dMsgScrnPlace_c::dMsgScrnPlace_c() {
}
mpScreen = JKR_NEW J2DScreen();
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
mpScreen->setPriority("zelda_stage_title.blo", 0x20000, dComIfGp_getMsgArchive(4));
} else {
mpScreen->setPriority("zelda_stage_title_foreign.blo", 0x20000, dComIfGp_getMsgArchive(4));
}
#elif VERSION == VERSION_GCN_JPN
mpScreen->setPriority("zelda_stage_title.blo", 0x20000, dComIfGp_getMsgArchive(4));
#else
mpScreen->setPriority("zelda_stage_title_foreign.blo", 0x20000, dComIfGp_getMsgArchive(4));
@@ -59,7 +66,9 @@ dMsgScrnPlace_c::dMsgScrnPlace_c() {
((J2DTextBox*)mpTm_c[i]->getPanePtr())->setFont(mDoExt_getRubyFont());
((J2DTextBox*)mpTm_c[i]->getPanePtr())->setString(0x80, "");
#if VERSION != VERSION_GCN_JPN
IF_DUSK_BLOCK(!dusk::version::isRegionJpn())
((J2DTextBox*)mpTm_c[i]->getPanePtr())->setCharSpace(1.0f);
IF_DUSK_BLOCK_END
#endif
}
+80 -12
View File
@@ -20,10 +20,20 @@
#include "JSystem/J2DGraph/J2DScreen.h"
#include <cstring>
#include "dusk/version.hpp"
#if TARGET_PC
#include "dusk/settings.h"
#endif
#if TARGET_PC
#define STR_BUF_LEN 528
#elif VERSION == VERSION_GCN_JPN
#define STR_BUF_LEN 528
#else
#define STR_BUF_LEN 512
#endif
dMsgScrnTalk_c::dMsgScrnTalk_c(u8 param_1, u8 param_2, JKRExpHeap* param_3) {
if (param_3 != NULL) {
field_0xe4 = param_3;
@@ -100,7 +110,12 @@ dMsgScrnTalk_c::dMsgScrnTalk_c(u8 param_1, u8 param_2, JKRExpHeap* param_3) {
JUT_ASSERT(153, mpMg_c[1] != NULL);
OSInitFastCast();
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn())
field_0xf4 = 0.0f;
else
field_0xf4 = -10.0f;
#elif VERSION == VERSION_GCN_JPN
field_0xf4 = 0.0f;
#else
field_0xf4 = -10.0f;
@@ -110,7 +125,68 @@ dMsgScrnTalk_c::dMsgScrnTalk_c(u8 param_1, u8 param_2, JKRExpHeap* param_3) {
JUT_ASSERT(176, mpPmP_c != NULL);
mpPmP_c->scale(g_MsgObject_HIO_c.mBoxTalkScaleX, g_MsgObject_HIO_c.mBoxTalkScaleY);
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
if (dComIfGs_getOptRuby() == 0) {
mpTm_c[0] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('mg_3flin'), 0, NULL);
mpTm_c[1] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('t3f_s'), 0, NULL);
mpTmr_c[0] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('mg_3f'), 0, NULL);
if (dMsgObject_getMsgObjectClass()->getFukiKind() == 8) {
mpTm_c[2] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('t3f_s1'), 0, NULL);
mpTm_c[3] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('t3f_s2'), 0, NULL);
mpTm_c[4] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('t3f_s3'), 0, NULL);
mpTm_c[5] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('t3f_s4'), 0, NULL);
mpTmr_c[1] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('mg_3f_s1'), 0, NULL);
mpTmr_c[2] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('mg_3f_s2'), 0, NULL);
} else {
mpTmr_c[1] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('mg_3f_s'), 0, NULL);
}
mpTxScreen->search(MULTI_CHAR('n_3line'))->hide();
mpTxScreen->search(MULTI_CHAR('n_3fline'))->show();
mpTxScreen->search(MULTI_CHAR('n_e4line'))->hide();
} else {
mpTm_c[0] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('mg_3line'), 0, NULL);
mpTm_c[1] = JKR_NEW CPaneMgr(mpTxScreen, 't3_s', 0, NULL);
if (dMsgObject_getMsgObjectClass()->getFukiKind() == 8) {
mpTm_c[2] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('t3_s1'), 0, NULL);
JUT_ASSERT(189, mpTm_c[2] != NULL);
mpTm_c[3] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('t3_s2'), 0, NULL);
JUT_ASSERT(191, mpTm_c[3] != NULL);
mpTm_c[4] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('t3_s3'), 0, NULL);
JUT_ASSERT(193, mpTm_c[4] != NULL);
mpTm_c[5] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('t3_s4'), 0, NULL);
JUT_ASSERT(193, mpTm_c[5] != NULL);
}
mpTxScreen->search(MULTI_CHAR('n_3line'))->show();
mpTxScreen->search(MULTI_CHAR('n_3fline'))->hide();
mpTxScreen->search(MULTI_CHAR('n_e4line'))->hide();
}
} else {
mpTm_c[0] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('mg_e4lin'), 0, NULL);
JUT_ASSERT(182, mpTm_c[0] != NULL);
mpTm_c[1] = JKR_NEW CPaneMgr(mpTxScreen, 't4_s', 0, NULL);
JUT_ASSERT(185, mpTm_c[1] != NULL);
if (dMsgObject_getMsgObjectClass()->getFukiKind() == 8) {
mpTm_c[2] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('t4_s1'), 0, NULL);
JUT_ASSERT(189, mpTm_c[2] != NULL);
mpTm_c[3] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('t4_s2'), 0, NULL);
JUT_ASSERT(191, mpTm_c[3] != NULL);
mpTm_c[4] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('t4_s3'), 0, NULL);
JUT_ASSERT(193, mpTm_c[4] != NULL);
mpTm_c[5] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('t4_s4'), 0, NULL);
JUT_ASSERT(193, mpTm_c[5] != NULL);
}
mpTxScreen->search(MULTI_CHAR('n_3line'))->hide();
mpTxScreen->search(MULTI_CHAR('n_3fline'))->hide();
mpTxScreen->search(MULTI_CHAR('n_e4line'))->show();
}
#elif VERSION == VERSION_GCN_JPN
if (dComIfGs_getOptRuby() == 0) {
mpTm_c[0] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('mg_3flin'), 0, NULL);
mpTm_c[1] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('t3f_s'), 0, NULL);
@@ -173,19 +249,11 @@ dMsgScrnTalk_c::dMsgScrnTalk_c(u8 param_1, u8 param_2, JKRExpHeap* param_3) {
for (int i = 0; i < 6; i++) {
if (mpTm_c[i] != NULL) {
((J2DTextBox*)mpTm_c[i]->getPanePtr())->setFont(mDoExt_getMesgFont());
#if VERSION == VERSION_GCN_JPN
((J2DTextBox*)mpTm_c[i]->getPanePtr())->setString(0x210, "");
#else
((J2DTextBox*)mpTm_c[i]->getPanePtr())->setString(0x200, "");
#endif
((J2DTextBox*)mpTm_c[i]->getPanePtr())->setString(STR_BUF_LEN, "");
}
if (mpTmr_c[i] != NULL) {
((J2DTextBox*)mpTmr_c[i]->getPanePtr())->setFont(mDoExt_getMesgFont());
#if VERSION == VERSION_GCN_JPN
((J2DTextBox*)mpTmr_c[i]->getPanePtr())->setString(0x210, "");
#else
((J2DTextBox*)mpTmr_c[i]->getPanePtr())->setString(0x200, "");
#endif
((J2DTextBox*)mpTmr_c[i]->getPanePtr())->setString(STR_BUF_LEN, "");
}
}
if (dMsgObject_getMsgObjectClass()->getFukiKind() != 8) {
+48 -2
View File
@@ -1,13 +1,14 @@
#include "d/dolzel.h" // IWYU pragma: keep
#include "d/d_msg_scrn_tree.h"
#include "JSystem/J2DGraph/J2DAnmLoader.h"
#include "JSystem/J2DGraph/J2DGrafContext.h"
#include "JSystem/J2DGraph/J2DScreen.h"
#include "JSystem/JKernel/JKRExpHeap.h"
#include "d/d_msg_object.h"
#include "d/d_msg_out_font.h"
#include "d/d_msg_scrn_tree.h"
#include "d/d_pane_class.h"
#include "dusk/version.hpp"
#if TARGET_PC
#include "dusk/settings.h"
@@ -61,7 +62,52 @@ dMsgScrnTree_c::dMsgScrnTree_c(JUTFont* param_0, JKRExpHeap* param_1) {
mpScreen->search(MULTI_CHAR('white_m'))->setAnimation(field_0xd4);
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
if (dComIfGs_getOptRuby() != 0) {
for (int i = 0; i < 3; i++) {
static u64 const t_tag[3] = {MULTI_CHAR('mg_3line'), 't3_w', 't3_s'};
mpTm_c[i] = JKR_NEW CPaneMgr(mpScreen, t_tag[i], 0, NULL);
((J2DTextBox*)mpTm_c[i]->getPanePtr())->setFont(field_0x54);
((J2DTextBox*)mpTm_c[i]->getPanePtr())->setString(0x210, "");
}
mpScreen->search(MULTI_CHAR('n_3line'))->show();
mpScreen->search(MULTI_CHAR('n_3fline'))->hide();
mpScreen->search(MULTI_CHAR('n_e4line'))->hide();
} else {
for (int i = 0; i < 3; i++) {
static u64 const t_tag[3] = {MULTI_CHAR('t3fline'), MULTI_CHAR('t3f_w'), MULTI_CHAR('t3f_s')};
static u64 const tr_tag[3] = {MULTI_CHAR('mg_3f'), MULTI_CHAR('mg_3f_w'), MULTI_CHAR('mg_3f_s')};
mpTm_c[i] = JKR_NEW CPaneMgr(mpScreen, t_tag[i], 0, NULL);
((J2DTextBox*)mpTm_c[i]->getPanePtr())->setFont(field_0x54);
((J2DTextBox*)mpTm_c[i]->getPanePtr())->setString(0x210, "");
mpTmr_c[i] = JKR_NEW CPaneMgr(mpScreen, tr_tag[i], 0, NULL);
((J2DTextBox*)mpTmr_c[i]->getPanePtr())->setFont(field_0x54);
((J2DTextBox*)mpTmr_c[i]->getPanePtr())->setString(0x210, "");
}
mpScreen->search(MULTI_CHAR('n_3line'))->hide();
mpScreen->search(MULTI_CHAR('n_3fline'))->show();
mpScreen->search(MULTI_CHAR('n_e4line'))->hide();
}
} else {
for (int i = 0; i < 3; i++) {
static u64 const t_tag[3] = {MULTI_CHAR('mg_e4lin'), 'f4_w', 't4_s'};
mpTm_c[i] = JKR_NEW CPaneMgr(mpScreen, t_tag[i], 0, NULL);
((J2DTextBox*)mpTm_c[i]->getPanePtr())->setFont(field_0x54);
((J2DTextBox*)mpTm_c[i]->getPanePtr())->setString(0x200, "");
}
mpScreen->search(MULTI_CHAR('n_3line'))->hide();
mpScreen->search(MULTI_CHAR('n_3fline'))->hide();
mpScreen->search(MULTI_CHAR('n_e4line'))->show();
}
#elif VERSION == VERSION_GCN_JPN
if (dComIfGs_getOptRuby() != 0) {
for (int i = 0; i < 3; i++) {
static u64 const t_tag[3] = {MULTI_CHAR('mg_3line'), 't3_w', 't3_s'};
+201 -2
View File
@@ -1,11 +1,12 @@
#include "d/dolzel.h" // IWYU pragma: keep
#include "d/d_msg_unit.h"
#include "d/d_com_inf_game.h"
#include <cstdio>
#include <cstring>
#include "d/d_com_inf_game.h"
#include "d/d_kankyo.h"
#include "d/d_meter2_info.h"
#include "d/d_msg_unit.h"
#include "dusk/version.hpp"
// temporary until a better solution is found
typedef struct dMsgUnit_inf1_entry {
@@ -41,6 +42,197 @@ dMsgUnit_c::dMsgUnit_c() {}
dMsgUnit_c::~dMsgUnit_c() {}
#if TARGET_PC
typedef struct dMsgUnit_inf1_entry_JPN {
BE(u32) dat1EntryOffset;
BE(u16) field_0x04;
BE(u16) field_0x06;
BE(u16) field_0x08;
BE(u16) field_0x0a;
BE(u16) field_0x0c;
BE(u16) field_0x0e;
BE(u16) field_0x10;
BE(u16) field_0x12;
BE(u16) field_0x14;
BE(u16) field_0x16;
BE(u16) field_0x18;
BE(u16) field_0x1A;
} dMsgUnit_inf1_entry_JPN;
typedef struct dMsgUnit_inf1_section_JPN {
/* 0x00 */ BE(u32) msgType; // sectionType
/* 0x04 */ BE(u32) size; // total size of the section
/* 0x08 */ BE(u16) entryCount;
/* 0x0A */ BE(u16) entryLength;
/* 0x0C */ BE(u16) msgArchiveId;
/* 0x10 */ dMsgUnit_inf1_entry_JPN entries[0];
} dMsgUnit_inf1_section_JPN;
void dMsgUnit_c::setTag_jpn(int i_type, int i_value, TEXT_SPAN o_buffer, bool param_4) {
*o_buffer = 0;
bool stack9 = false;
bool stack8 = false;
int value = i_value;
if (i_type == 0x10000) {
SAFE_SPRINTF(o_buffer, "%d", i_value);
return;
}
if (i_type == 0x10001) {
int tens_digit = i_value / 10;
int ones_digit = i_value % 10;
SAFE_SPRINTF(o_buffer, "%d-%d", tens_digit, ones_digit);
return;
}
if ((i_type == 4 && param_4 == true) || (i_type == 5 && param_4 == false)) {
int seconds = i_value / 1000;
int minutes = seconds / 60;
seconds -= minutes * 60;
if (minutes > 99) {
minutes = 99;
seconds = 59;
}
if (minutes == 0 && seconds == 0) {
if (strcmp(dComIfGp_getStartStageName(), "F_SP00") == 0) {
return;
}
}
if (i_type == 4) {
i_value = minutes;
if (minutes == 0) {
stack9 = true;
}
}
if (i_type == 5) {
if (seconds == 0 && minutes != 0) {
return;
}
i_value = seconds;
}
}
if ((i_type == 3 && param_4 == true) || (i_type == 4 && param_4 == false)) {
f32 dayTime = g_env_light.getDaytime();
f32 hour = dayTime / 15.0f;
f32 iVar8b = ((s32)(1000000.0f * dayTime) % 15000000) / 1000000.0f;
f32 minute = 60.0f * (iVar8b / 15.0f);
// not sure why this affects codegen, in theory it should be optimized out
f32 minute2 = 60.0f * (iVar8b / 15.0f);
if (i_type == 3) {
i_value = (s32)hour;
}
if (i_type == 4) {
i_value = (s32)minute;
}
}
if (i_type == 9 && param_4 == true) {
SAFE_SPRINTF(o_buffer, "%d", i_value);
stack8 = true;
}
if (!stack9) {
bmg_header_t* pHeader = (bmg_header_t*)dMeter2Info_getMsgUnitResource();
bmg_section_t* pInfoBlock = NULL;
const void* pMsgDataBlock = NULL;
str1_section_t* pStrAttributeBlock = NULL;
int filepos = sizeof(bmg_header_t);
u32 filesize = pHeader->size;
u8* pSection = ((u8*)pHeader) + filepos;
while (filepos < filesize) {
switch(((bmg_section_t*)pSection)->magic) {
case 'FLW1':
break;
case 'FLI1':
break;
case 'INF1':
pInfoBlock = (bmg_section_t*)pSection;
break;
case 'DAT1':
pMsgDataBlock = pSection;
break;
case 'STR1':
pStrAttributeBlock = (str1_section_t*)pSection;
break;
}
filepos += ((bmg_section_t*)pSection)->size;
pSection += ((bmg_section_t*)pSection)->size;
}
u16 vals[12];
vals[0] = ((dMsgUnit_inf1_section_JPN*)pInfoBlock)->entries[i_type].field_0x04;
vals[1] = ((dMsgUnit_inf1_section_JPN*)pInfoBlock)->entries[i_type].field_0x06;
vals[2] = ((dMsgUnit_inf1_section_JPN*)pInfoBlock)->entries[i_type].field_0x08;
vals[3] = ((dMsgUnit_inf1_section_JPN*)pInfoBlock)->entries[i_type].field_0x0a;
vals[4] = ((dMsgUnit_inf1_section_JPN*)pInfoBlock)->entries[i_type].field_0x0c;
vals[5] = ((dMsgUnit_inf1_section_JPN*)pInfoBlock)->entries[i_type].field_0x0e;
vals[6] = ((dMsgUnit_inf1_section_JPN*)pInfoBlock)->entries[i_type].field_0x10;
vals[7] = ((dMsgUnit_inf1_section_JPN*)pInfoBlock)->entries[i_type].field_0x12;
vals[8] = ((dMsgUnit_inf1_section_JPN*)pInfoBlock)->entries[i_type].field_0x14;
vals[9] = ((dMsgUnit_inf1_section_JPN*)pInfoBlock)->entries[i_type].field_0x16;
vals[10] = ((dMsgUnit_inf1_section_JPN*)pInfoBlock)->entries[i_type].field_0x18;
u32 dat1EntryOffset = ((dMsgUnit_inf1_section_JPN*)pInfoBlock)->entries[i_type].dat1EntryOffset;
char* dat1Entry = (char*)((u8*)pMsgDataBlock + dat1EntryOffset + 8);
const char* uVar5;
if (i_value == 0) {
uVar5 = pStrAttributeBlock->entries->str + vals[0];
} else if ((i_value % 10) == 0) {
uVar5 = pStrAttributeBlock->entries->str + (vals[10]);
} else {
uVar5 = pStrAttributeBlock->entries->str + vals[i_value % 10];
}
int uVar5Len = strlen(uVar5);
if (uVar5Len == 0) {
if (stack8) {
SAFE_STRCAT(o_buffer, dat1Entry);
} else {
SAFE_SPRINTF(o_buffer, "%d%s", i_value, dat1Entry);
}
} else {
char unkCharArr[7];
unkCharArr[0] = 26;
unkCharArr[1] = uVar5Len + 6;
unkCharArr[2] = -1;
unkCharArr[3] = -1;
unkCharArr[4] = 2;
unkCharArr[5] = strlen(dat1Entry) / 2;
unkCharArr[6] = 0;
if (stack8) {
SAFE_STRCAT(o_buffer, unkCharArr);
SAFE_STRCAT(o_buffer, uVar5);
SAFE_STRCAT(o_buffer, dat1Entry);
} else {
SAFE_SPRINTF(o_buffer, "%d%s%s%s", i_value, unkCharArr, uVar5, dat1Entry);
}
}
}
if (i_type == 3 && param_4 == true) {
char buffer[20];
setTag(4, 0, buffer, false);
SAFE_STRCAT(o_buffer, buffer);
}
if (i_type == 4 && param_4 == true) {
char buffer[20];
setTag(5, value, buffer, false);
SAFE_STRCAT(o_buffer, buffer);
}
}
#endif
#if REGION_JPN
void dMsgUnit_c::setTag(int i_type, int i_value, TEXT_SPAN o_buffer, bool param_4) {
*o_buffer = 0;
@@ -208,6 +400,13 @@ void dMsgUnit_c::setTag(int i_type, int i_value, TEXT_SPAN o_buffer, bool param_
}
#else
void dMsgUnit_c::setTag(int i_type, int i_value, TEXT_SPAN o_buffer, bool param_4) {
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
setTag_jpn(i_type, i_value, o_buffer, param_4);
return;
}
#endif
*o_buffer = 0;
bool stack9 = false;
bool stack8 = false;
+207 -58
View File
@@ -17,6 +17,68 @@ static bool isPalOrJpn() {
return dusk::version::isRegionPal() || dusk::version::isRegionJpn();
}
#if TARGET_PC
#define SJIS_MOJI(wmoji) ((static_cast<u16>(static_cast<u8>((wmoji)[0])) << 8) | static_cast<u8>((wmoji)[1]))
#else
#define SJIS_MOJI(wmoji) *(u16*)wmoji
#endif
#if TARGET_PC
static const char* l_mojiHira[65] = {
"\x82\xA0", "\x82\xA2", "\x82\xA4", "\x82\xA6", "\x82\xA8", "\x82\xA9", "\x82\xAB", "\x82\xAD", "\x82\xAF", "\x82\xB1", "\x82\xB3", "\x82\xB5", "\x82\xB7",
"\x82\xB9", "\x82\xBB", "\x82\xBD", "\x82\xBF", "\x82\xC2", "\x82\xC4", "\x82\xC6", "\x82\xC8", "\x82\xC9", "\x82\xCA", "\x82\xCB", "\x82\xCC", "\x82\xCD",
"\x82\xD0", "\x82\xD3", "\x82\xD6", "\x82\xD9", "\x82\xDC", "\x82\xDD", "\x82\xDE", "\x82\xDF", "\x82\xE0", "\x82\xE2", "\x81\x40", "\x82\xE4", "\x81\x40",
"\x82\xE6", "\x82\xE7", "\x82\xE8", "\x82\xE9", "\x82\xEA", "\x82\xEB", "\x82\xED", "\x81\x40", "\x82\xF0", "\x81\x40", "\x82\xF1", "\x82\x9F", "\x82\xA1",
"\x82\xA3", "\x82\xA5", "\x82\xA7", "\x82\xE1", "\x81\x40", "\x82\xE3", "\x81\x40", "\x82\xE5", "\x82\xC1", "\x81\x40", "\x81\x5B", "\x81\x4A", "\x81\x4B",
};
static const char* l_mojiHira2[65] = {
"\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x82\xAA", "\x82\xAC", "\x82\xAE", "\x82\xB0", "\x82\xB2", "\x82\xB4", "\x82\xB6", "\x82\xB8",
"\x82\xBA", "\x82\xBC", "\x82\xBE", "\x82\xC0", "\x82\xC3", "\x82\xC5", "\x82\xC7", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x82\xCE",
"\x82\xD1", "\x82\xD4", "\x82\xD7", "\x82\xDA", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F",
"\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F",
"\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F",
};
static const char* l_mojiHira3[65] = {
"\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F",
"\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x82\xCF",
"\x82\xD2", "\x82\xD5", "\x82\xD8", "\x82\xDB", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F",
"\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F",
"\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F",
};
static const char* l_mojikata[65] = {
"\x83\x41", "\x83\x43", "\x83\x45", "\x83\x47", "\x83\x49", "\x83\x4A", "\x83\x4C", "\x83\x4E", "\x83\x50", "\x83\x52", "\x83\x54", "\x83\x56", "\x83\x58",
"\x83\x5A", "\x83\x5C", "\x83\x5E", "\x83\x60", "\x83\x63", "\x83\x65", "\x83\x67", "\x83\x69", "\x83\x6A", "\x83\x6B", "\x83\x6C", "\x83\x6D", "\x83\x6E",
"\x83\x71", "\x83\x74", "\x83\x77", "\x83\x7A", "\x83\x7D", "\x83\x7E", "\x83\x80", "\x83\x81", "\x83\x82", "\x83\x84", "\x81\x40", "\x83\x86", "\x81\x40",
"\x83\x88", "\x83\x89", "\x83\x8A", "\x83\x8B", "\x83\x8C", "\x83\x8D", "\x83\x8F", "\x81\x40", "\x83\x93", "\x81\x40", "\x83\x93", "\x83\x40", "\x83\x42",
"\x83\x44", "\x83\x46", "\x83\x48", "\x83\x83", "\x81\x40", "\x83\x85", "\x81\x40", "\x83\x87", "\x83\x62", "\x81\x40", "\x81\x5B", "\x81\x4A", "\x81\x4B",
};
static const char* l_mojikata2[65] = {
"\x81\x8F", "\x81\x8F", "\x83\x94", "\x81\x8F", "\x81\x8F", "\x83\x4B", "\x83\x4D", "\x83\x4F", "\x83\x51", "\x83\x53", "\x83\x55", "\x83\x57", "\x83\x59",
"\x83\x5B", "\x83\x5D", "\x83\x5F", "\x83\x61", "\x83\x64", "\x83\x66", "\x83\x68", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x83\x6F",
"\x83\x72", "\x83\x75", "\x83\x78", "\x83\x7B", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F",
"\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F",
"\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F",
};
static const char* l_mojikata3[65] = {
"\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F",
"\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x83\x70",
"\x83\x73", "\x83\x76", "\x83\x79", "\x83\x7C", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F",
"\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F",
"\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F", "\x81\x8F",
};
static const char* l_mojiEisu[65] = {
"A", "N", "a", "n", "1", "B", "O", "b", "o", "2", "C", "P", "c", "p", "3", "D", "Q",
"d", "q", "4", "E", "R", "e", "r", "5", "F", "S", "f", "s", "6", "G", "T", "g", "t",
"7", "H", "U", "h", "u", "8", "I", "V", "i", "v", "9", "J", "W", "j", "w", "0", "K",
"X", "k", "x", ",", "L", "Y", "l", "y", ".", "M", "Z", "m", "z", " ",
};
#else
static const char* l_mojiHira[65] = {
"", "", "", "", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "", "", "", "",
@@ -71,6 +133,7 @@ static const char* l_mojiEisu[65] = {
"7", "H", "U", "h", "u", "8", "I", "V", "i", "v", "9", "J", "W", "j", "w", "0", "K",
"X", "k", "x", ",", "L", "Y", "l", "y", ".", "M", "Z", "m", "z", " ",
};
#endif
#if TARGET_PC
// The game normally mutates this string list to fill in the real character codes.
@@ -106,7 +169,7 @@ static const char* l_mojiEisuPal_2[65] = {
#if TARGET_PC
// ' ' (full-width space)
#define SPACE_MAYBE_FULL (dusk::version::isRegionJpn() ? '\x81\x40' : ' ')
#define SPACE_MAYBE_FULL (dusk::version::isRegionJpn() ? 0x8140U : ' ')
#elif REGION_JPN
// ' ' (full-width space)
#define SPACE_MAYBE_FULL '\x81\x40'
@@ -274,11 +337,15 @@ void dName_c::_move() {
mDoAud_seStart(Z2SE_SY_DUMMY, 0, 0, 0);
mPrevMojiSet = mMojiSet;
mMojiSet++;
#if REGION_JPN
if (mMojiSet > MOJI_EIGO) {
#if TARGET_PC
if ((dusk::version::isRegionJpn() && mMojiSet > MOJI_EIGO) || (!dusk::version::isRegionJpn() && mMojiSet > MOJI_KATA))
#elif REGION_JPN
if (mMojiSet > MOJI_EIGO)
#else
if (mMojiSet > MOJI_KATA) {
if (mMojiSet > MOJI_KATA)
#endif
{
mMojiSet = MOJI_HIRA;
}
mojiListChange();
@@ -373,7 +440,7 @@ int dName_c::nameCheck() {
#if REGION_JPN
if (mChrInfo[len].mCharacter != ' ' && mChrInfo[len].mCharacter != '\x81\x40') {
#else
if (mChrInfo[len].mCharacter != ' ' IF_DUSK(&& (!dusk::version::isRegionJpn() || mChrInfo[len].mCharacter != '\x81\x40'))) {
if (mChrInfo[len].mCharacter != ' ' IF_DUSK(&& (!dusk::version::isRegionJpn() || mChrInfo[len].mCharacter != 0x8140U))) {
#endif
return len + 1;
}
@@ -392,7 +459,12 @@ void dName_c::playNameSet(int nameLength) {
*str = mChrInfo[i].mCharacter;
str += 1;
} else {
#if TARGET_PC
str[0] = mChrInfo[i].mCharacter >> 8;
str[1] = mChrInfo[i].mCharacter & 0xFF;
#else
*(u16*)str = mChrInfo[i].mCharacter;
#endif
str += 2;
}
#else
@@ -625,30 +697,41 @@ int dName_c::mojiChange(u8 idx) {
}
void dName_c::selectMojiSet() {
#if REGION_JPN
int moji = getMoji();
if (moji != -1) {
if (moji == '' || moji == '') {
if (mCurPos != 0) {
if (checkDakuon(moji, mCurPos - 1) == 1) {
mDoAud_seStart(Z2SE_SY_NAME_INPUT, NULL, 0, 0);
setDakuon(moji, mCurPos - 1);
} else {
mDoAud_seStart(Z2SE_SYS_ERROR, NULL, 0, 0);
#if TARGET_PC || REGION_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn())
#endif
{
int moji = getMoji();
if (moji != -1) {
if (moji == SJIS('', 0x814AU) || moji == SJIS('', 0x814BU)) {
if (mCurPos != 0) {
if (checkDakuon(moji, mCurPos - 1) == 1) {
mDoAud_seStart(Z2SE_SY_NAME_INPUT, NULL, 0, 0);
setDakuon(moji, mCurPos - 1);
} else {
mDoAud_seStart(Z2SE_SYS_ERROR, NULL, 0, 0);
}
}
} else {
setMoji(moji);
}
} else {
setMoji(moji);
}
}
#if TARGET_PC
else {
setMoji(getMoji());
}
#endif
setNameText();
#else
#else
setMoji(getMoji());
setNameText();
#endif
#endif
}
#if REGION_JPN
#if TARGET_PC || REGION_JPN
int dName_c::checkDakuon(int param_0, u8 param_1) {
if (mChrInfo[param_1].mMojiSet == MOJI_EIGO) {
return 0;
@@ -658,17 +741,17 @@ int dName_c::checkDakuon(int param_0, u8 param_1) {
return 0;
}
if (param_0 == '' && mChrInfo[param_1].mColumn != 5) {
if (param_0 == SJIS('', 0x814BU) && mChrInfo[param_1].mColumn != 5) {
return 0;
}
if (param_0 == '' &&
(mChrInfo[param_1].mCharacter == '' || mChrInfo[param_1].mCharacter == ''))
if (param_0 == SJIS('', 0x814AU) &&
(mChrInfo[param_1].mCharacter == SJIS('', 0x8345U) || mChrInfo[param_1].mCharacter == SJIS('', 0x8394U)))
{
return 1;
}
if (param_0 == '' && mChrInfo[param_1].mColumn != 1 && mChrInfo[param_1].mColumn != 2 &&
if (param_0 == SJIS('', 0x814AU) && mChrInfo[param_1].mColumn != 1 && mChrInfo[param_1].mColumn != 2 &&
mChrInfo[param_1].mColumn != 3 && mChrInfo[param_1].mColumn != 5)
{
return 0;
@@ -680,46 +763,46 @@ int dName_c::checkDakuon(int param_0, u8 param_1) {
int dName_c::setDakuon(int param_1, u8 param_2) {
int c;
if (param_1 == '') {
if (param_1 == SJIS('', 0x814AU)) {
switch (mChrInfo[param_2].mColumn) {
case 0: {
c = -1;
if (mChrInfo[param_2].mCharacter == '' || mChrInfo[param_2].mCharacter == '') {
if (mChrInfo[param_2].mCharacter == SJIS('', 0x8345U) || mChrInfo[param_2].mCharacter == SJIS('', 0x8394U)) {
c = 4;
mChrInfo[param_2].mCharacter = '';
mChrInfo[param_2].mCharacter = SJIS('', 0x8394U);
}
break;
}
case 1: {
int c2 = mChrInfo[param_2].mMojiSet != MOJI_HIRA ? '' : '';
int c2 = mChrInfo[param_2].mMojiSet != MOJI_HIRA ? SJIS('', 0x834AU) : SJIS('', 0x82A9U);
c = (mChrInfo[param_2].mCharacter - c2) % 2;
break;
}
case 2: {
int c2 = mChrInfo[param_2].mMojiSet != MOJI_HIRA ? '' : '';
int c2 = mChrInfo[param_2].mMojiSet != MOJI_HIRA ? SJIS('', 0x8354U) : SJIS('', 0x82B3U);
c = (mChrInfo[param_2].mCharacter - c2) % 2;
break;
}
case 3: {
int c2;
if (mChrInfo[param_2].mCharacter <=
((mChrInfo[param_2].mMojiSet != MOJI_HIRA ? '' : '')))
((mChrInfo[param_2].mMojiSet != MOJI_HIRA ? SJIS('', 0x8361U) : SJIS('', 0x82C0U))))
{
c2 = mChrInfo[param_2].mMojiSet != MOJI_HIRA ? '' : '';
c2 = mChrInfo[param_2].mMojiSet != MOJI_HIRA ? SJIS('', 0x835EU) : SJIS('', 0x82BDU);
c = (mChrInfo[param_2].mCharacter - c2) % 2;
} else {
if (mChrInfo[param_2].mCharacter <= (mChrInfo[param_2].mMojiSet != 0 ? '' : ''))
if (mChrInfo[param_2].mCharacter <= (mChrInfo[param_2].mMojiSet != 0 ? SJIS('', 0x8368U) : SJIS('', 0x82C7U)))
{
if (mChrInfo[param_2].mCharacter >=
(mChrInfo[param_2].mMojiSet != 0 ? '' : ''))
(mChrInfo[param_2].mMojiSet != 0 ? SJIS('', 0x8365U) : SJIS('', 0x82C4U)))
{
c2 = mChrInfo[param_2].mMojiSet != MOJI_HIRA ? '' : '';
c2 = mChrInfo[param_2].mMojiSet != MOJI_HIRA ? SJIS('', 0x8365U) : SJIS('', 0x82C4U);
c = (mChrInfo[param_2].mCharacter - c2) % 2;
break;
}
}
c2 = mChrInfo[param_2].mMojiSet != MOJI_HIRA ? '' : '';
c2 = mChrInfo[param_2].mMojiSet != MOJI_HIRA ? SJIS('', 0x8362U) : SJIS('', 0x82C1U);
c = (mChrInfo[param_2].mCharacter - c2) % 3;
if (c == 2) {
c = 1;
@@ -732,7 +815,7 @@ int dName_c::setDakuon(int param_1, u8 param_2) {
break;
}
case 5: {
int c2 = mChrInfo[param_2].mMojiSet != MOJI_HIRA ? '' : '';
int c2 = mChrInfo[param_2].mMojiSet != MOJI_HIRA ? SJIS('', 0x836EU) : SJIS('', 0x82CDU);
c = (mChrInfo[param_2].mCharacter - c2) % 3;
break;
}
@@ -751,8 +834,8 @@ int dName_c::setDakuon(int param_1, u8 param_2) {
return 1;
}
} else if (param_1 == '') {
int c2 = mChrInfo[param_2].mMojiSet != MOJI_HIRA ? '' : '';
} else if (param_1 == SJIS('', 0x814BU)) {
int c2 = mChrInfo[param_2].mMojiSet != MOJI_HIRA ? SJIS('', 0x836EU) : SJIS('', 0x82CDU);
c = (mChrInfo[param_2].mCharacter - c2) % 3;
if (c != 2) {
mChrInfo[param_2].mCharacter = mChrInfo[param_2].mCharacter + (2 - c);
@@ -823,7 +906,7 @@ int dName_c::getMoji() {
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
if (*(u8*)moji >> 4 == 0x8 || *(u8*)moji >> 4 == 0x9) {
result = *(u16*)moji;
result = SJIS_MOJI(moji);
} else {
result = *moji;
}
@@ -905,8 +988,8 @@ void dName_c::setNameText() {
//"\x1bCD\x1bCR\x1bCC[000000]\x1bGM[0]%c\x1bHM\x1bCC[ffffff]\x1bGM[0]%c"
//"\x1bCD\x1bCR\x1bCC[000000]\x1bGM[0]%c%c\x1bHM\x1bCC[ffffff]\x1bGM[0]%c%c"
if (mChrInfo[i].field_0x3 != 0) {
#if REGION_JPN
if (mChrInfo[i].mMojiSet == 2) {
#if TARGET_PC || REGION_JPN
if (IF_DUSK(!dusk::version::isRegionJpn() ||) mChrInfo[i].mMojiSet == 2) {
#endif
SAFE_SPRINTF(mNameText[i],
"\x1b"
@@ -917,7 +1000,7 @@ void dName_c::setNameText() {
CHAR_TRUNC((u8)mChrInfo[i].mCharacter),
CHAR_TRUNC((u8)mChrInfo[i].mCharacter)
);
#if REGION_JPN
#if TARGET_PC || REGION_JPN
} else {
SAFE_SPRINTF(mNameText[i],
"\x1b"
@@ -1005,7 +1088,7 @@ void dName_c::selectCursorMove() {
g_nmHIO.mSelCharScale);
((J2DTextBox*)mMojiIcon[mCharRow + mCharColumn * 5]->getPanePtr())
->setWhite(JUtility::TColor(0xC8, 0xC8, 0xC8, 0xFF));
#if TARGET_PC
nameWide();
#endif
@@ -1436,7 +1519,7 @@ void dName_c::nameWide() {
for (PaneCache& entry : l_tagName) {
J2DPane* pane = nameIn.NameInScr->search(entry.tag);
if (!entry.cached) {
entry.origTransX = pane->getTranslateX();
entry.origTransX = pane->getTranslateX();
entry.origTransY = pane->getTranslateY();
entry.cached = true;
}
@@ -1444,7 +1527,7 @@ void dName_c::nameWide() {
for (PaneCache& entry : l_nameTagName) {
J2DPane* pane = nameIn.NameInScr->search(entry.tag);
if (!entry.cached) {
entry.origTransX = pane->getTranslateX();
entry.origTransX = pane->getTranslateX();
entry.origTransY = pane->getTranslateY();
entry.cached = true;
}
@@ -1452,7 +1535,7 @@ void dName_c::nameWide() {
for (PaneCache& entry : l_nameCurTagName) {
J2DPane* pane = nameIn.NameInScr->search(entry.tag);
if (!entry.cached) {
entry.origTransX = pane->getTranslateX();
entry.origTransX = pane->getTranslateX();
entry.origTransY = pane->getTranslateY();
entry.cached = true;
}
@@ -1530,7 +1613,42 @@ void dName_c::screenSet() {
static u64 l_cur1TagName[8] = {
's_0r', MULTI_CHAR('s_01r'), MULTI_CHAR('s_02r'), MULTI_CHAR('s_03r'), MULTI_CHAR('s_04r'), MULTI_CHAR('s_05r'), MULTI_CHAR('s_06r'), MULTI_CHAR('s_07r'),
};
#if REGION_JPN
#if TARGET_PC
static u64 l_menu_icon_tag_jpn[4] = {
MULTI_CHAR('j_hira_n'),
MULTI_CHAR('j_kata_n'),
MULTI_CHAR('j_eigo_n'),
MULTI_CHAR('j_end_n'),
};
static u64 l_menu_tag_jpn[5][3] = {
MULTI_CHAR('m_hira_0'), MULTI_CHAR('m_hira_1'), MULTI_CHAR('m_hira_s'), MULTI_CHAR('m_kata_0'), MULTI_CHAR('m_kata_1'), MULTI_CHAR('m_kata_s'),
MULTI_CHAR('m_eigo_0'), MULTI_CHAR('m_eigo_1'), MULTI_CHAR('m_eigo_s'), MULTI_CHAR('j_end_0'), MULTI_CHAR('j_end_1'), MULTI_CHAR('j_end_s'),
};
static u32 l_menu_msg_jpn[4] = {
0x386,
0x387,
0x388,
0x38A,
};
static u64 l_menu_icon_tag[4] = {
MULTI_CHAR('p_ABC_n'),
MULTI_CHAR('p_abc_n'),
MULTI_CHAR('j_eigo_n'),
MULTI_CHAR('p_end_n'),
};
static u64 l_menu_tag[5][3] = {
MULTI_CHAR('p_ABC_0'), MULTI_CHAR('p_ABC_1'), MULTI_CHAR('p_ABC_2'), MULTI_CHAR('p_abc_0'), MULTI_CHAR('p_abc_1'), MULTI_CHAR('p_abc_2'),
MULTI_CHAR('m_eigo_0'), MULTI_CHAR('m_eigo_1'), MULTI_CHAR('m_eigo_2'), MULTI_CHAR('p_end_0'), MULTI_CHAR('p_end_1'), MULTI_CHAR('p_end_2'),
};
static u32 l_menu_msg[4] = {
0x38B,
0x38C,
0x388,
0x38E,
};
#elif REGION_JPN
static u64 l_menu_icon_tag[4] = {
MULTI_CHAR('j_hira_n'),
MULTI_CHAR('j_kata_n'),
@@ -1612,7 +1730,26 @@ void dName_c::screenSet() {
panes1[i]->setAnimation(mCursorColorKey);
}
#if REGION_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
nameIn.NameInScr->search(MULTI_CHAR('pal_n'))->hide();
mMenuPane = nameIn.NameInScr->search(MULTI_CHAR('jpn_n'));
mMenuPane->show();
nameIn.NameInScr->search(MULTI_CHAR('p_ABC_n'))->scale(0.0f, 0.0f);
nameIn.NameInScr->search(MULTI_CHAR('p_abc_n'))->scale(0.0f, 0.0f);
nameIn.NameInScr->search(MULTI_CHAR('p_end_n'))->scale(0.0f, 0.0f);
} else {
nameIn.NameInScr->search(MULTI_CHAR('jpn_n'))->hide();
mMenuPane = nameIn.NameInScr->search(MULTI_CHAR('pal_n'));
mMenuPane->show();
nameIn.NameInScr->search(MULTI_CHAR('j_hira_n'))->scale(0.0f, 0.0f);
nameIn.NameInScr->search(MULTI_CHAR('j_kata_n'))->scale(0.0f, 0.0f);
nameIn.NameInScr->search(MULTI_CHAR('j_eigo_n'))->scale(0.0f, 0.0f);
nameIn.NameInScr->search(MULTI_CHAR('j_end_n'))->scale(0.0f, 0.0f);
}
#elif REGION_JPN
nameIn.NameInScr->search(MULTI_CHAR('pal_n'))->hide();
mMenuPane = nameIn.NameInScr->search(MULTI_CHAR('jpn_n'));
mMenuPane->show();
@@ -1633,19 +1770,31 @@ void dName_c::screenSet() {
J2DTextBox* menuPane[3];
for (int i = 0; i < 4; i++) {
#if !REGION_JPN
if (i == 2) {
#if TARGET_PC || !REGION_JPN
if (IF_DUSK(!dusk::version::isRegionJpn() &&) i == 2) {
mMenuIcon[i] = NULL;
mMenuText[i] = NULL;
} else {
#endif
#if TARGET_PC
mMenuIcon[i] = JKR_NEW CPaneMgr(nameIn.NameInScr, dusk::version::isRegionJpn() ? l_menu_icon_tag_jpn[i] : l_menu_icon_tag[i], 1, NULL);
#else
mMenuIcon[i] = JKR_NEW CPaneMgr(nameIn.NameInScr, l_menu_icon_tag[i], 1, NULL);
#endif
char buf[16];
#if TARGET_PC
fopMsgM_messageGet(buf, dusk::version::isRegionJpn() ? l_menu_msg_jpn[i] : l_menu_msg[i]);
#else
fopMsgM_messageGet(buf, l_menu_msg[i]);
#endif
for (int j = 0; j < 3; j++) {
#if TARGET_PC
menuPane[j] = (J2DTextBox*)nameIn.NameInScr->search(dusk::version::isRegionJpn() ? l_menu_tag_jpn[i][j] : l_menu_tag[i][j]);
#else
menuPane[j] = (J2DTextBox*)nameIn.NameInScr->search(l_menu_tag[i][j]);
#endif
if (j == 0) {
mMenuText[i] = menuPane[j];
@@ -1654,7 +1803,7 @@ void dName_c::screenSet() {
menuPane[j]->setFont(nameIn.font);
menuPane[j]->setString(buf);
}
#if !REGION_JPN
#if TARGET_PC || !REGION_JPN
}
#endif
}
@@ -1795,20 +1944,20 @@ void dName_c::NameStrSet() {
i++;
} else {
if (*(u8*)moji >> 4 == 8 || *(u8*)moji >> 4 == 9) {
mChrInfo[i].mCharacter = *(u16*)moji;
mChrInfo[i].mCharacter = SJIS_MOJI(moji);
for (int j = 0; j < 65; j++) {
if (mChrInfo[i].mCharacter == *(u16*)l_mojiHira[j] ||
mChrInfo[i].mCharacter == *(u16*)l_mojiHira2[j] ||
mChrInfo[i].mCharacter == *(u16*)l_mojiHira3[j])
if (mChrInfo[i].mCharacter == SJIS_MOJI(l_mojiHira[j]) ||
mChrInfo[i].mCharacter == SJIS_MOJI(l_mojiHira2[j]) ||
mChrInfo[i].mCharacter == SJIS_MOJI(l_mojiHira3[j]))
{
mChrInfo[i].mColumn = j / 5;
mChrInfo[i].mRow = j % 5;
mChrInfo[i].mMojiSet = MOJI_HIRA;
break;
} else if (mChrInfo[i].mCharacter == *(u16*)l_mojikata[j] ||
mChrInfo[i].mCharacter == *(u16*)l_mojikata2[j] ||
mChrInfo[i].mCharacter == *(u16*)l_mojikata3[j])
} else if (mChrInfo[i].mCharacter == SJIS_MOJI(l_mojikata[j]) ||
mChrInfo[i].mCharacter == SJIS_MOJI(l_mojikata2[j]) ||
mChrInfo[i].mCharacter == SJIS_MOJI(l_mojikata3[j]))
{
mChrInfo[i].mColumn = j / 5;
mChrInfo[i].mRow = j % 5;
+8 -1
View File
@@ -967,7 +967,14 @@ dScnLogo_c::~dScnLogo_c() {
mDoExt_getRubyFont();
mDoExt_setAraCacheSize(free_size - aram_heap->getTotalFreeSize());
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (getGameVersion() == GameVersion::GcnJpn) {
if (dComIfGp_getFontArchive() != NULL) {
dComIfGp_getFontArchive()->unmount();
dComIfGp_setFontArchive(NULL);
}
}
#elif VERSION == VERSION_GCN_JPN
if (dComIfGp_getFontArchive() != NULL) {
dComIfGp_getFontArchive()->unmount();
dComIfGp_setFontArchive(NULL);
+6 -1
View File
@@ -1049,7 +1049,12 @@ void dSv_player_info_c::init() {
}
void dSv_player_config_c::init() {
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn())
mRuby = 0;
else
mRuby = 1;
#elif VERSION == VERSION_GCN_JPN
mRuby = 0;
#else
mRuby = 1;
+26 -3
View File
@@ -24,6 +24,7 @@
#include <cstring>
#include "dusk/frame_interpolation.h"
#include "dusk/version.hpp"
static int dTimer_createStart2D(s32 param_0, u16 param_1);
@@ -1430,7 +1431,7 @@ void dDlst_TimerScrnDraw_c::playBckAnimation(f32 i_frame) {
mpGetInParent->getPanePtr()->setAnimation((J2DAnmTransform*)NULL);
}
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC || VERSION == VERSION_GCN_JPN
bool dDlst_TimerScrnDraw_c::isLeadByte(int i_char) {
return (i_char >= 0x81 && i_char <= 0x9f) || (i_char >= 0xe0 && i_char <= 0xfc);
}
@@ -1466,7 +1467,18 @@ void dDlst_TimerScrnDraw_c::drawPikari(int i_no) {
var_f25 * static_cast<J2DTextBox*>(mpGetInText->getPanePtr())->getCharSpace();
}
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
if (isLeadByte(c)) {
c = ((string[str_idx] & 0xFF) << 8) | (string[str_idx + 1] & 0xFF);
str_idx++;
} else {
c = string[str_idx] & 0xFF;
}
} else {
c = string[str_idx] & 0xFF;
}
#elif VERSION == VERSION_GCN_JPN
if (isLeadByte(c)) {
c = ((string[str_idx] & 0xFF) << 8) | (string[str_idx + 1] & 0xFF);
str_idx++;
@@ -1492,7 +1504,18 @@ void dDlst_TimerScrnDraw_c::drawPikari(int i_no) {
var_f25 * static_cast<J2DTextBox*>(mpGetInText->getPanePtr())->getCharSpace();
}
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
if (isLeadByte(c)) {
c = ((string[str_idx] & 0xFF) << 8) | (string[str_idx + 1] & 0xFF);
str_idx++;
} else {
c = string[str_idx] & 0xFF;
}
} else {
c = string[str_idx] & 0xFF;
}
#elif VERSION == VERSION_GCN_JPN
if (isLeadByte(c)) {
c = ((string[str_idx] & 0xFF) << 8) | (string[str_idx + 1] & 0xFF);
str_idx++;
+8 -16
View File
@@ -60,18 +60,6 @@ const char* verification_state_name(dusk::DiscVerificationState state) noexcept
namespace dusk::iso {
enum class Platform : u8 {
GameCube,
Wii,
};
enum class Region : u8 {
NorthAmerica,
Europe,
Japan,
Korea,
};
struct KnownDisc {
std::string_view id;
Platform platform;
@@ -88,7 +76,7 @@ struct KnownDisc {
constexpr auto KNOWN_DISCS = std::to_array<KnownDisc>({
{"GZ2E01", Platform::GameCube, Region::NorthAmerica, "14e886f08e548a000afde98a3195e788"},
{"GZ2J01", Platform::GameCube, Region::Japan},
{"GZ2J01", Platform::GameCube, Region::Japan, "5967dc7a6a553652f4d2050aeef6f368"},
{"GZ2P01", Platform::GameCube, Region::Europe, "9ef597588b0035ca9e91b333fa9a8a7e"},
{"RZDE01", Platform::Wii, Region::NorthAmerica},
{"RZDJ01", Platform::Wii, Region::Japan},
@@ -216,7 +204,9 @@ ValidationError validate(const char* path, VerificationStatus& status, DiscInfo&
return ValidationError::WrongGame;
}
status.knownDisc = knownDisc;
info.isPal = knownDisc->region == Region::Europe;
info.platform = knownDisc->platform;
info.region = knownDisc->region;
if (!knownDisc->supported) {
return ValidationError::WrongVersion;
}
@@ -251,7 +241,9 @@ ValidationError inspect(const char* path, DiscInfo& info) {
if (!knownDisc) {
return ValidationError::WrongGame;
}
info.isPal = knownDisc->region == Region::Europe;
info.platform = knownDisc->platform;
info.region = knownDisc->region;
if (!knownDisc->supported) {
return ValidationError::WrongVersion;
}
@@ -260,7 +252,7 @@ ValidationError inspect(const char* path, DiscInfo& info) {
bool isPal(const char* path) {
DiscInfo info{};
return inspect(path, info) == ValidationError::Success && info.isPal;
return inspect(path, info) == ValidationError::Success && info.region == Region::Europe;
}
void log_verification_state(std::string_view path, DiscVerificationState state) {
+14 -1
View File
@@ -17,6 +17,18 @@ enum class ValidationError : u8 {
Success
};
enum class Platform : u8 {
GameCube,
Wii,
};
enum class Region : u8 {
NorthAmerica,
Europe,
Japan,
Korea,
};
struct VerificationStatus {
std::atomic_size_t bytesRead = 0;
std::atomic_size_t bytesTotal = 0;
@@ -25,7 +37,8 @@ struct VerificationStatus {
};
struct DiscInfo {
bool isPal = false;
Platform platform = Platform::GameCube;
Region region = Region::NorthAmerica;
};
ValidationError inspect(const char* path, DiscInfo& info);
+10
View File
@@ -73,6 +73,7 @@ struct ModMetaParsed {
std::vector<ModMetaExport*> exports;
std::vector<ModMetaHookFn*> hookFns;
std::vector<ModMetaHookMem*> hookMems;
std::vector<ModMetaHookMemExt*> hookMemExts;
std::vector<ModMetaHookName*> hookNames;
};
@@ -85,6 +86,15 @@ inline const char* hook_mem_display_name(const ModMetaHookMem& rec) {
return vtable + std::char_traits<char>::length(vtable) + 1;
}
inline const char* hook_mem_vtable_symbol(const ModMetaHookMemExt& rec) {
return reinterpret_cast<const char*>(&rec) + sizeof(ModMetaHookMemExt);
}
inline const char* hook_mem_display_name(const ModMetaHookMemExt& rec) {
const char* vtable = hook_mem_vtable_symbol(rec);
return vtable + std::char_traits<char>::length(vtable) + 1;
}
inline const char* hook_name_symbol(const ModMetaHookName& rec) {
return reinterpret_cast<const char*>(&rec) + sizeof(ModMetaHookName);
}
+28
View File
@@ -26,6 +26,9 @@
#include "miniz.h"
#include "native_module.hpp"
#include "nlohmann/json.hpp"
#if DUSK_HAS_PREPATCH
#include "prepatch.hpp"
#endif
using namespace std::string_literals;
using namespace std::string_view_literals;
@@ -411,6 +414,28 @@ static bool parse_meta(NativeMod& native, LoadedMod& mod) {
parsed.hookMems.push_back(record);
break;
}
case MOD_META_HOOK_MEM_EXT: {
if (size <= sizeof(ModMetaHookMemExt)) {
return invalid("truncated extended hook record");
}
auto* record = reinterpret_cast<ModMetaHookMemExt*>(const_cast<uint8_t*>(cursor));
if (record->pmf_size <= MOD_META_HOOK_MEM_CAPACITY ||
record->pmf_size > MOD_META_HOOK_MEM_EXT_CAPACITY || record->materialize == nullptr)
{
return invalid("bad extended hook member-pointer size");
}
const char* strings = reinterpret_cast<const char*>(cursor) + sizeof(ModMetaHookMemExt);
const size_t capacity = size - sizeof(ModMetaHookMemExt);
if (!terminated_within(strings, capacity)) {
return invalid("unterminated extended hook vtable symbol");
}
const size_t vtableLen = std::char_traits<char>::length(strings);
if (!terminated_within(strings + vtableLen + 1, capacity - vtableLen - 1)) {
return invalid("unterminated extended hook display name");
}
parsed.hookMemExts.push_back(record);
break;
}
case MOD_META_HOOK_NAME: {
if (size <= sizeof(ModMetaHookName)) {
return invalid("truncated hook record");
@@ -906,6 +931,9 @@ void ModLoader::init() {
m_initialized = true;
manifest::initialize();
#if DUSK_HAS_PREPATCH
prepatch::initialize();
#endif
if (m_searchDirs.empty()) {
Log.warn("no mod search directories configured; mod loading skipped");
+260
View File
@@ -0,0 +1,260 @@
#include "prepatch.hpp"
#include <atomic>
#include <cstdint>
#include <cstring>
#include <limits>
#include <string>
#include <string_view>
#include <utility>
#include <vector>
#include "aurora/lib/logging.hpp"
#if DUSK_HAS_PREPATCH
#include <mach-o/dyld.h>
#include <mach-o/loader.h>
#endif
namespace dusk::mods::prepatch {
namespace {
aurora::Module Log("dusk::mods::prepatch");
constexpr std::string_view kSiteMagic = "PS01";
constexpr size_t kSiteHeaderSize = 12;
constexpr size_t kGatewaySize = 28;
constexpr size_t kOriginalStubOffset = 20;
constexpr uint32_t kBranchMask = 0xfc000000u;
constexpr uint32_t kBranch = 0x14000000u;
constexpr uint32_t kLdarX16X16 = 0xc8dffe10u;
constexpr uint32_t kCbzX16Stub = 0xb4000050u;
constexpr uint32_t kBrX16 = 0xd61f0200u;
constexpr uint32_t kBtiC = 0xd503245fu;
struct SiteHeader {
char magic[4];
int32_t targetDelta;
int32_t slotDelta;
};
static_assert(sizeof(SiteHeader) == kSiteHeaderSize);
struct Range {
uintptr_t begin = 0;
uintptr_t end = 0;
bool contains(uintptr_t address, size_t size) const {
return address >= begin && address <= end && size <= end - address;
}
};
struct State {
std::vector<Range> executableRanges;
std::vector<Range> writableRanges;
std::string failureReason = "not initialized";
bool loaded = false;
bool initialized = false;
};
State s_state;
void fail(std::string reason) {
s_state.failureReason = std::move(reason);
Log.error("prepatch backend unavailable: {}", s_state.failureReason);
}
void unavailable(std::string reason) {
s_state.failureReason = std::move(reason);
Log.info("prepatch backend unavailable: {}", s_state.failureReason);
}
bool add_delta(uintptr_t address, int64_t delta, uintptr_t& out) {
if (delta >= 0) {
const auto offset = static_cast<uintptr_t>(delta);
if (address > std::numeric_limits<uintptr_t>::max() - offset) {
return false;
}
out = address + offset;
} else {
const auto offset = static_cast<uintptr_t>(-(delta + 1)) + 1;
if (address < offset) {
return false;
}
out = address - offset;
}
return true;
}
bool branch_target(uintptr_t address, uint32_t instruction, uintptr_t& out) {
if ((instruction & kBranchMask) != kBranch) {
return false;
}
int64_t words = instruction & 0x03ffffffu;
if ((words & 0x02000000) != 0) {
words -= int64_t{1} << 26;
}
return add_delta(address, words * 4, out);
}
const Range* containing(const std::vector<Range>& ranges, uintptr_t address, size_t size) {
for (const auto& range : ranges) {
if (range.contains(address, size)) {
return &range;
}
}
return nullptr;
}
#if DUSK_HAS_PREPATCH
bool slide_address(intptr_t slide, uint64_t vmaddr, uintptr_t& out) {
if (vmaddr > std::numeric_limits<uintptr_t>::max()) {
return false;
}
return add_delta(static_cast<uintptr_t>(vmaddr), slide, out);
}
#endif
} // namespace
void initialize() {
if (s_state.initialized) {
return;
}
s_state.initialized = true;
#if DUSK_HAS_PREPATCH
const auto* imageHeader = reinterpret_cast<const mach_header_64*>(_dyld_get_image_header(0));
if (imageHeader == nullptr || imageHeader->magic != MH_MAGIC_64 ||
imageHeader->cputype != CPU_TYPE_ARM64 ||
(imageHeader->cpusubtype & ~CPU_SUBTYPE_MASK) == CPU_SUBTYPE_ARM64E ||
(imageHeader->cpusubtype & CPU_SUBTYPE_ARM64_PTR_AUTH_MASK) != 0)
{
fail("main image is not a supported 64-bit arm64 Mach-O image");
return;
}
const intptr_t slide = _dyld_get_image_vmaddr_slide(0);
const auto* commands = reinterpret_cast<const uint8_t*>(imageHeader + 1);
size_t commandOffset = 0;
for (uint32_t i = 0; i < imageHeader->ncmds; ++i) {
if (commandOffset > imageHeader->sizeofcmds ||
imageHeader->sizeofcmds - commandOffset < sizeof(load_command))
{
fail("main image has malformed load commands");
return;
}
const auto* command = reinterpret_cast<const load_command*>(commands + commandOffset);
if (command->cmdsize < sizeof(load_command) ||
command->cmdsize > imageHeader->sizeofcmds - commandOffset)
{
fail("main image has malformed load commands");
return;
}
if (command->cmd == LC_SEGMENT_64) {
if (command->cmdsize < sizeof(segment_command_64)) {
fail("main image has a truncated segment command");
return;
}
const auto* segment = reinterpret_cast<const segment_command_64*>(command);
const uint64_t vmEnd = segment->vmaddr + segment->vmsize;
if (vmEnd < segment->vmaddr) {
fail("main image segment range overflows");
return;
}
uintptr_t begin = 0;
uintptr_t end = 0;
if (!slide_address(slide, segment->vmaddr, begin) ||
!slide_address(slide, vmEnd, end) || end < begin)
{
fail("main image runtime segment range overflows");
return;
}
constexpr vm_prot_t kRx = VM_PROT_READ | VM_PROT_EXECUTE;
constexpr vm_prot_t kRw = VM_PROT_READ | VM_PROT_WRITE;
if (segment->initprot == kRx && segment->maxprot == kRx) {
s_state.executableRanges.push_back({begin, end});
} else if (segment->initprot == kRw && segment->maxprot == kRw) {
s_state.writableRanges.push_back({begin, end});
}
}
commandOffset += command->cmdsize;
}
if (commandOffset != imageHeader->sizeofcmds || s_state.executableRanges.empty() ||
s_state.writableRanges.empty())
{
fail("main image has no usable executable or writable segments");
return;
}
s_state.failureReason.clear();
s_state.loaded = true;
#else
unavailable("prepatch support is not available in this build");
#endif
}
bool available() {
return s_state.loaded;
}
const char* unavailable_reason() {
return s_state.failureReason.c_str();
}
std::optional<Site> lookup(void* runtimeTarget) {
if (!s_state.loaded || runtimeTarget == nullptr) {
return std::nullopt;
}
const auto target = reinterpret_cast<uintptr_t>(runtimeTarget);
if (containing(s_state.executableRanges, target, sizeof(uint32_t)) == nullptr) {
return std::nullopt;
}
uint32_t entry = 0;
std::memcpy(&entry, reinterpret_cast<const void*>(target), sizeof(entry));
uintptr_t gateway = 0;
if (!branch_target(target, entry, gateway) || gateway < kSiteHeaderSize) {
return std::nullopt;
}
const uintptr_t headerAddress = gateway - kSiteHeaderSize;
if (containing(s_state.executableRanges, headerAddress, kSiteHeaderSize + kGatewaySize) ==
nullptr)
{
return std::nullopt;
}
SiteHeader header{};
std::memcpy(&header, reinterpret_cast<const void*>(headerAddress), sizeof(header));
if (std::memcmp(header.magic, kSiteMagic.data(), kSiteMagic.size()) != 0) {
return std::nullopt;
}
uintptr_t recordedTarget = 0;
uintptr_t slot = 0;
if (!add_delta(gateway, header.targetDelta, recordedTarget) || recordedTarget != target ||
!add_delta(gateway, header.slotDelta, slot) || (slot & (alignof(void*) - 1)) != 0 ||
containing(s_state.writableRanges, slot, sizeof(void*)) == nullptr)
{
return std::nullopt;
}
uint32_t instructions[7]{};
std::memcpy(instructions, reinterpret_cast<const void*>(gateway), sizeof(instructions));
uintptr_t original = 0;
if (instructions[2] != kLdarX16X16 || instructions[3] != kCbzX16Stub ||
instructions[4] != kBrX16 || instructions[5] != kBtiC ||
target > std::numeric_limits<uintptr_t>::max() - 4 ||
!branch_target(gateway + 24, instructions[6], original) || original != target + 4)
{
return std::nullopt;
}
return Site{
reinterpret_cast<void**>(slot), reinterpret_cast<void*>(gateway + kOriginalStubOffset)};
}
void publish(const Site& site, void* trampoline) {
std::atomic_ref slot{*site.slot};
slot.store(trampoline, std::memory_order_release);
}
} // namespace dusk::mods::prepatch
+20
View File
@@ -0,0 +1,20 @@
#pragma once
#include <optional>
namespace dusk::mods::prepatch {
struct Site {
void** slot = nullptr;
void* original = nullptr;
};
void initialize();
bool available();
const char* unavailable_reason();
// Returns the target function's prepatched hook site, or nullopt if it is not prepatched.
std::optional<Site> lookup(void* runtimeTarget);
// Publishes a trampoline (or nullptr to deactivate).
void publish(const Site& site, void* trampoline);
} // namespace dusk::mods::prepatch
+213 -43
View File
@@ -1,6 +1,9 @@
#include "registry.hpp"
#include "dusk/mods/loader/loader.hpp"
#if DUSK_HAS_PREPATCH
#include "dusk/mods/loader/prepatch.hpp"
#endif
#include "dusk/mods/manifest.hpp"
#include "mods/svc/hook.h"
@@ -9,11 +12,14 @@
#include "dusk/mods/log_buffer.hpp"
#include <algorithm>
#include <cstddef>
#include <cstdint>
#include <cstring>
#include <exception>
#include <fmt/format.h>
#if DUSK_HAS_FUNCHOOK
#include <funchook.h>
#endif
#include <string>
#include <unordered_map>
#include <vector>
@@ -48,8 +54,7 @@ struct HookSlot {
// One per mod that requested a hook on a target: its template-generated trampoline and the
// address of its Hook::g_orig, both living in the mod's dylib. Any candidate's trampoline
// is interchangeable (dispatch walks the shared HookSlot), so when the active installer's mod
// unloads, the funchook detour is handed off to a surviving candidate and every candidate's
// *orig_store is rewritten to the new original pointer.
// unloads, the backend is handed off to a surviving candidate.
struct HookCandidate {
ModContext* context = nullptr;
void* trampoline = nullptr;
@@ -57,8 +62,28 @@ struct HookCandidate {
uint64_t order = 0;
};
struct InstalledHook {
enum class BackendKind {
None,
#if DUSK_HAS_FUNCHOOK
Funchook,
#endif
#if DUSK_HAS_PREPATCH
Prepatch,
#endif
};
struct InstalledBackend {
BackendKind kind = BackendKind::None;
#if DUSK_HAS_FUNCHOOK
funchook_t* handle = nullptr;
#endif
#if DUSK_HAS_PREPATCH
prepatch::Site prepatchSite{};
#endif
};
struct InstalledHook {
InstalledBackend backend{};
void* original = nullptr;
ModContext* active = nullptr;
std::vector<HookCandidate> candidates;
@@ -205,7 +230,8 @@ void* resolve_target(void* addr) {
return addr;
}
funchook_t* install_trampoline(void* fnAddr, void* trampoline, void** outOriginal) {
#if DUSK_HAS_FUNCHOOK
funchook_t* install_funchook(void* fnAddr, void* trampoline, void** outOriginal) {
funchook_t* fh = funchook_create();
if (fh == nullptr) {
DuskLog.warn("HookSystem: funchook_create failed for {:p}", fnAddr);
@@ -214,18 +240,101 @@ funchook_t* install_trampoline(void* fnAddr, void* trampoline, void** outOrigina
void* fn = fnAddr;
const int prep = funchook_prepare(fh, &fn, trampoline);
if (prep == 0) {
*outOriginal = fn;
}
const int inst = prep == 0 ? funchook_install(fh, 0) : -1;
if (prep != 0 || inst != 0) {
const char* message = funchook_error_message(fh);
DuskLog.warn("HookSystem: funchook failed for {:p} (prepare={} install={}): {}", fnAddr,
prep, inst, message != nullptr && message[0] != '\0' ? message : "no details");
funchook_destroy(fh);
*outOriginal = nullptr;
return nullptr;
}
*outOriginal = fn;
return fh;
}
#endif
bool install_backend(
void* fnAddr, void* trampoline, InstalledBackend& outBackend, void** originalStore) {
#if DUSK_HAS_PREPATCH
if (const auto site = prepatch::lookup(fnAddr)) {
*originalStore = site->original;
prepatch::publish(*site, trampoline);
outBackend.kind = BackendKind::Prepatch;
outBackend.prepatchSite = *site;
return true;
}
#endif
#if DUSK_HAS_FUNCHOOK
funchook_t* handle = install_funchook(fnAddr, trampoline, originalStore);
if (handle == nullptr) {
return false;
}
outBackend.kind = BackendKind::Funchook;
outBackend.handle = handle;
return true;
#else
#if DUSK_HAS_PREPATCH
DuskLog.warn("HookSystem: prepatch backend cannot install target {:p}: {}", fnAddr,
prepatch::available() ? "target has no valid gateway" : prepatch::unavailable_reason());
#else
DuskLog.warn("HookSystem: no hook backend can install target {:p}", fnAddr);
#endif
return false;
#endif
}
void deactivate_backend(void* target, InstalledBackend& backend) {
#if DUSK_HAS_PREPATCH
if (backend.kind == BackendKind::Prepatch) {
prepatch::publish(backend.prepatchSite, nullptr);
backend = {};
return;
}
#endif
#if DUSK_HAS_FUNCHOOK
if (backend.kind == BackendKind::Funchook) {
const int uninst = funchook_uninstall(backend.handle, 0);
const int destr = funchook_destroy(backend.handle);
if (uninst != 0 || destr != 0) {
DuskLog.warn("HookSystem: funchook uninstall/destroy for {:p} returned {}/{}", target,
uninst, destr);
}
}
#else
(void)target;
#endif
backend = {};
}
bool handoff_backend(
void* target, InstalledHook& entry, const HookCandidate& candidate, void** outOriginal) {
#if DUSK_HAS_PREPATCH
if (entry.backend.kind == BackendKind::Prepatch) {
*candidate.origStore = entry.original;
prepatch::publish(entry.backend.prepatchSite, candidate.trampoline);
*outOriginal = entry.original;
return true;
}
#endif
#if DUSK_HAS_FUNCHOOK
InstalledBackend backend;
if (!install_backend(target, candidate.trampoline, backend, candidate.origStore)) {
return false;
}
entry.backend = backend;
*outOriginal = *candidate.origStore;
return true;
#else
(void)target;
(void)candidate;
(void)outOriginal;
return false;
#endif
}
ModResult hook_install(ModContext* context, void* fnAddr, void* trampolineFn, void** outOriginal) {
if (fnAddr == nullptr || trampolineFn == nullptr || outOriginal == nullptr) {
@@ -272,18 +381,16 @@ ModResult hook_install(ModContext* context, void* fnAddr, void* trampolineFn, vo
name != nullptr ? name : "?", fnAddr, mod_id_from_context(context));
}
void* original = nullptr;
funchook_t* fh = install_trampoline(fnAddr, trampolineFn, &original);
if (fh == nullptr) {
InstalledBackend backend;
if (!install_backend(fnAddr, trampolineFn, backend, outOriginal)) {
return MOD_ERROR;
}
auto& entry = s_installed[key];
entry.handle = fh;
entry.original = original;
entry.backend = backend;
entry.original = *outOriginal;
entry.active = context;
entry.candidates.push_back({context, trampolineFn, outOriginal, s_nextOrder++});
*outOriginal = original;
return MOD_OK;
}
@@ -543,20 +650,67 @@ bool resolve_symbol_checked(const char* symbol, bool requireCode, void** out, st
return false;
}
/* Decode a HOOK_MEM record's pointer-to-member representation into the target code address,
* mirroring what calling through the mfp would invoke. Virtual members hook the class's own
* overrider, read from its vtable (resolved from the symbol manifest). */
void* resolve_member_record(
const ModMetaHookMem& record, const char* vtableSymbol, std::string& why) {
uintptr_t words[2];
std::memcpy(words, record.pmf, sizeof(words));
/*
* Decodes a member hook record's pointer-to-member representation into the target code address.
* Virtual members prefer their named overrider, then fall back to reading the primary vtable slot.
*/
void* resolve_member_record(const unsigned char* pmf, size_t pmfSize, const char* vtableSymbol,
const char* displayName, std::string& why) {
if (pmfSize < sizeof(uintptr_t)) {
why = "truncated pointer-to-member representation";
return nullptr;
}
uintptr_t words[2]{};
std::memcpy(words, pmf, std::min(sizeof(words), pmfSize));
#if defined(_WIN32)
const void* fn = reinterpret_cast<const void*>(words[0]);
if (fn == nullptr) {
why = "null pointer-to-member target";
return nullptr;
}
const size_t slot = vcall_slot_offset(fn);
if (slot == static_cast<size_t>(-1)) { // not a vcall thunk: direct address
return const_cast<void*>(fn);
}
// A display name resolves the actual overrider rather than an ABI vcall thunk. Besides being
// more direct, this covers secondary vtables: the MSVC representation has `this` adjustment
// but does not have the base-path suffix used by the decorated vtable symbol.
std::string displayWhy;
void* displayTarget = nullptr;
if (displayName[0] != '\0' &&
resolve_symbol_checked(displayName, true, &displayTarget, displayWhy))
{
return displayTarget;
}
int32_t thisAdjustment = 0;
if (pmfSize >= sizeof(uintptr_t) + sizeof(thisAdjustment)) {
std::memcpy(&thisAdjustment, pmf + sizeof(uintptr_t), sizeof(thisAdjustment));
}
if (thisAdjustment != 0) {
why = fmt::format(
"virtual member requires a {}-byte this adjustment and its overrider did not "
"resolve by name ({})",
thisAdjustment, displayWhy);
return nullptr;
}
int32_t firstVirtualField = 0;
if (pmfSize > MOD_META_HOOK_MEM_CAPACITY && pmfSize >= sizeof(uintptr_t) + 2 * sizeof(int32_t))
{
std::memcpy(&firstVirtualField, pmf + sizeof(uintptr_t) + sizeof(int32_t), sizeof(int32_t));
}
int32_t secondVirtualField = 0;
if (pmfSize > MOD_META_HOOK_MEM_CAPACITY && pmfSize >= sizeof(uintptr_t) + 3 * sizeof(int32_t))
{
std::memcpy(
&secondVirtualField, pmf + sizeof(uintptr_t) + 2 * sizeof(int32_t), sizeof(int32_t));
}
if (firstVirtualField != 0 || secondVirtualField != 0) {
why = fmt::format("virtual-base member did not resolve by name ({})", displayWhy);
return nullptr;
}
if (vtableSymbol[0] == '\0') {
why = "class name is not representable as a vtable symbol";
return nullptr;
@@ -583,10 +737,18 @@ void* resolve_member_record(
if (!isVirtual) { // non-virtual: the address itself
return reinterpret_cast<void*>(words[0]);
}
std::string displayWhy;
void* displayTarget = nullptr;
if (displayName[0] != '\0' &&
resolve_symbol_checked(displayName, true, &displayTarget, displayWhy))
{
return displayTarget;
}
if (thisAdjust != 0) {
// this-adjusting mfp (member of a secondary base): the slot offset is relative to a
// vtable we can't locate. Hook the overrider by name instead.
why = "virtual member of a secondary base; hook the overrider by name";
// The slot is relative to a secondary vtable whose base path is not encoded in the mfp.
why = fmt::format(
"virtual member of a secondary base did not resolve by name ({})", displayWhy);
return nullptr;
}
if (vtableSymbol[0] == '\0') {
@@ -638,35 +800,32 @@ void hook_remove_mod(LoadedMod& mod) {
}
auto* target = reinterpret_cast<void*>(it->first);
const int uninst = funchook_uninstall(entry.handle, 0);
const int destr = funchook_destroy(entry.handle);
if (uninst != 0 || destr != 0) {
DuskLog.warn("HookSystem: funchook uninstall/destroy for {:p} returned {}/{}", target,
uninst, destr);
}
entry.handle = nullptr;
entry.active = nullptr;
if (entry.candidates.empty()) {
deactivate_backend(target, entry.backend);
it = s_installed.erase(it);
continue;
}
// Hand the detour off to a surviving candidate (lowest registration order first; the
// vector is append-ordered). A candidate whose install fails stays in the list: its
// g_orig must still track the current original pointer.
// A prepatch may be atomically updated directly.
// Funchook must first restore the original instructions before reinstalling.
#if DUSK_HAS_PREPATCH
const bool prepatched = entry.backend.kind == BackendKind::Prepatch;
#else
constexpr bool prepatched = false;
#endif
if (!prepatched) {
deactivate_backend(target, entry.backend);
}
entry.active = nullptr;
for (auto& cand : entry.candidates) {
void* original = nullptr;
funchook_t* fh = install_trampoline(target, cand.trampoline, &original);
if (fh == nullptr) {
if (!handoff_backend(target, entry, cand, &original)) {
continue;
}
entry.handle = fh;
entry.original = original;
entry.active = cand.context;
DuskLog.info("HookSystem: reinstalled trampoline for {:p}: {} -> {} (tramp={:p})",
target, mod_id_from_context(context), mod_id_from_context(cand.context),
cand.trampoline);
DuskLog.info("HookSystem: replaced trampoline for {:p}: {} -> {} (tramp={:p})", target,
mod_id_from_context(context), mod_id_from_context(cand.context), cand.trampoline);
break;
}
@@ -677,6 +836,7 @@ void hook_remove_mod(LoadedMod& mod) {
for (auto& cand : entry.candidates) {
*cand.origStore = target;
}
deactivate_backend(target, entry.backend);
it = s_installed.erase(it);
continue;
}
@@ -772,14 +932,24 @@ void hook_resolve_mod_records(LoadedMod& mod) {
unresolved("<fn>", "null link-time target", &record->resolved);
}
}
for (auto* record : mod.native->parsed.hookMems) {
const auto resolveMember = [&](auto* record, const unsigned char* pmf, size_t pmfSize) {
const char* displayName = hook_mem_display_name(*record);
std::string why;
void* target = resolve_member_record(*record, hook_mem_vtable_symbol(*record), why);
void* target =
resolve_member_record(pmf, pmfSize, hook_mem_vtable_symbol(*record), displayName, why);
if (target != nullptr) {
resolved(target, &record->resolved);
} else {
unresolved(hook_mem_display_name(*record), why, &record->resolved);
unresolved(displayName, why, &record->resolved);
}
};
for (auto* record : mod.native->parsed.hookMems) {
resolveMember(record, record->pmf, sizeof(record->pmf));
}
for (auto* record : mod.native->parsed.hookMemExts) {
alignas(std::max_align_t) unsigned char pmf[MOD_META_HOOK_MEM_EXT_CAPACITY]{};
record->materialize(pmf);
resolveMember(record, pmf, record->pmf_size);
}
for (auto* record : mod.native->parsed.hookNames) {
const char* name = hook_name_symbol(*record);
+30 -2
View File
@@ -885,8 +885,36 @@ void Prelaunch::update() {
if (mDiscDetail != nullptr) {
if (activeDiscLoaded) {
mDiscDetail->SetProperty(Rml::PropertyId::Display, Rml::Style::Display::Block);
Rml::String innerRML = "GameCube • ";
innerRML += state.activeDiscInfo.isPal ? "EUR" : "USA";
Rml::String innerRML = "";
switch (state.activeDiscInfo.platform) {
case iso::Platform::GameCube:
innerRML += "GameCube";
break;
case iso::Platform::Wii:
innerRML += "Wii";
break;
}
innerRML += "";
switch (state.activeDiscInfo.region) {
case iso::Region::Japan:
innerRML += "JPN";
break;
case iso::Region::Europe:
innerRML += "EUR";
break;
case iso::Region::NorthAmerica:
innerRML += "USA";
break;
case iso::Region::Korea:
innerRML += "KOR";
break;
default:
innerRML += "Unknown";
break;
}
mDiscDetail->SetInnerRML(innerRML);
} else {
mDiscDetail->SetProperty(Rml::PropertyId::Display, Rml::Style::Display::None);
+2 -2
View File
@@ -555,7 +555,7 @@ SettingsWindow::SettingsWindow(bool prelaunch) : mPrelaunch(prelaunch) {
.getValue =
[] {
const auto& state = prelaunch_state();
if (!state.configuredDiscCanLaunch || !state.configuredDiscInfo.isPal) {
if (!state.configuredDiscCanLaunch || state.configuredDiscInfo.region != iso::Region::Europe) {
return kLanguageNames[0];
}
const u8 idx = static_cast<u8>(getSettings().game.language.getValue());
@@ -565,7 +565,7 @@ SettingsWindow::SettingsWindow(bool prelaunch) : mPrelaunch(prelaunch) {
[] {
const auto& state = prelaunch_state();
return !state.configuredDiscCanLaunch ||
!state.configuredDiscInfo.isPal;
state.configuredDiscInfo.region != iso::Region::Europe;
},
.isModified =
[] {
+2
View File
@@ -28,6 +28,8 @@ void init() {
gameVersion = GameVersion::GcnUsa;
} else if (game == "GZ2P") {
gameVersion = GameVersion::GcnPal;
} else if (game == "GZ2J") {
gameVersion = GameVersion::GcnJpn;
} else {
// TODO: Handle remaining valid versions.
DuskLog.fatal("Unknown/unsupported game version in disc: {}", game);
+4 -3
View File
@@ -348,9 +348,10 @@ static void mDoMemCdRWm_BuildHeader(mDoMemCdRWm_HeaderData* header) {
snprintf(header->mComment, sizeof(header->mComment), HEADER_COMMENT, time.mon + 1, time.mday);
} else {
// TODO JPN SHIFT-JIS
// snprintf(header->mTitle, sizeof(header->mTitle), "ゼルダの伝説 トワイライトプリンセス");
// snprintf(header->mComment, sizeof(header->mComment), "%d月%d日のセーブデータです", time.mon + 1, time.mday);
// shift-jis "ゼルダの伝説 トワイライトプリンセス"
snprintf(header->mTitle, sizeof(header->mTitle), "\x83\x5b\x83\x8b\x83\x5f\x82\xcc\x93\x60\x90\xe0\x20\xc4\xdc\xb2\xd7\xb2\xc4\xcc\xdf\xd8\xdd\xbe\xbd");
// shift-jis "%d月%d日のセーブデータです"
snprintf(header->mComment, sizeof(header->mComment), "\x25\x64\x8c\x8e\x25\x64\x93\xfa\x82\xcc\x83\x5a\x81\x5b\x83\x75\x83\x66\x81\x5b\x83\x5e\x82\xc5\x82\xb7", time.mon + 1, time.mday);
}
#elif VERSION == VERSION_GCN_PAL
switch (dComIfGs_getPalLanguage()) {
+17 -2
View File
@@ -26,6 +26,7 @@
#include <cstring>
#include "dusk/logging.h"
#include "dusk/frame_interpolation.h"
#include "dusk/version.hpp"
DUSK_GAME_DATA u8 mDoExt::CurrentHeapAdjustVerbose;
DUSK_GAME_DATA u8 mDoExt::HeapAdjustVerbose;
@@ -3711,7 +3712,15 @@ static ResFONT* mDoExt_resfont0;
static void mDoExt_initFont0() {
static char const fontdata[] = "rodan_b_24_22.bfn";
#if REGION_JPN
#if TARGET_PC
if (dusk::version::getGameVersion() == dusk::version::GameVersion::GcnJpn) {
mDoExt_initFontCommon(&mDoExt_font0, &mDoExt_resfont0, mDoExt_getZeldaHeap(),
fontdata, dComIfGp_getFontArchive(), 0, 200, 512);
} else {
mDoExt_initFontCommon(&mDoExt_font0, &mDoExt_resfont0, mDoExt_getZeldaHeap(),
fontdata, dComIfGp_getFontArchive(), 1, 0, 0);
}
#elif REGION_JPN
mDoExt_initFontCommon(&mDoExt_font0, &mDoExt_resfont0, mDoExt_getZeldaHeap(),
fontdata, dComIfGp_getFontArchive(), 0, 200, 512);
#else
@@ -3738,7 +3747,13 @@ void mDoExt_removeMesgFont() {
JKR_DELETE(mDoExt_font0);
mDoExt_font0 = NULL;
if (mDoExt_resfont0 != NULL) {
#if REGION_JPN
#if TARGET_PC
if (dusk::version::getGameVersion() == dusk::version::GameVersion::GcnJpn) {
JKRFileLoader::removeResource(mDoExt_resfont0, NULL);
} else {
JKRFree(mDoExt_resfont0);
}
#elif REGION_JPN
JKRFileLoader::removeResource(mDoExt_resfont0, NULL);
#else
JKRFree(mDoExt_resfont0);