Remove unreachable g_Jpn code

This commit is contained in:
Ryan Dwyer 2022-11-11 17:18:12 +10:00
parent 0d169c5214
commit 73bfbded3d
12 changed files with 43 additions and 250 deletions

View File

@ -1,5 +1,4 @@
#define GAMEFILES(section) \
build/ROMID/game/langinit.o (section); \
build/ROMID/game/titleinit.o (section); \
build/ROMID/game/raceinit.o (section); \
build/ROMID/game/bodyinit.o (section); \
@ -77,7 +76,6 @@
build/ROMID/game/menustop.o (section); \
build/ROMID/game/menutick.o (section); \
build/ROMID/game/weathertick.o (section); \
build/ROMID/game/langtick.o (section); \
build/ROMID/game/roomtick.o (section); \
build/ROMID/game/skytick.o (section); \
build/ROMID/game/casingtick.o (section); \

View File

@ -1264,21 +1264,6 @@ void textMapCodeUnitToChar(char **text, struct fontchar **arg1, struct fontchar
u8 c;
u8 index;
if (g_Jpn) {
if (**text < 0x80) {
*arg1 = &chars[**text - 0x21];
*arg2 = &chars[*prevchar - 0x21];
*prevchar = **text;
*text += 1;
return;
}
*arg1 = &chars[*prevchar - 0x21];
*arg2 = &chars[*prevchar - 0x21];
return;
}
index = 0;
c = **text;
@ -1796,10 +1781,6 @@ Gfx *text0f1552d4(Gfx *gdl, f32 x, f32 y, f32 widthscale, f32 heightscale,
lineheight = 13;
#else
lineheight = chars['['].height + chars['['].baseline;
if (g_Jpn && lineheight < 14) {
lineheight = 14;
}
#endif
textMeasure(&textheight, &textwidth, text, chars, font, 0);
@ -2241,10 +2222,6 @@ Gfx *textRenderProjected(Gfx *gdl, s32 *x, s32 *y, char *text, struct fontchar *
if (lineheight == 0) {
lineheight = chars['['].height + chars['['].baseline;
}
if (g_Jpn && lineheight < 14) {
lineheight = 14;
}
#endif
gDPPipeSync(gdl++);
@ -2500,10 +2477,6 @@ Gfx *textRender(Gfx *gdl, s32 *x, s32 *y, char *text,
if (lineheight == 0) {
lineheight = chars['['].height + chars['['].baseline;
}
if (g_Jpn && lineheight < 14) {
lineheight = 14;
}
#endif
gDPPipeSync(gdl++);
@ -2802,10 +2775,6 @@ void textMeasure(s32 *textheight, s32 *textwidth, char *text, struct fontchar *f
if (lineheight == 0) {
lineheight = font1['['].baseline + font1['['].height;
}
if (g_Jpn && lineheight < 14) {
lineheight = 14;
}
#endif
if (text) {
@ -3473,16 +3442,11 @@ void textWrap(s32 wrapwidth, char *src, char *dst, struct fontchar *chars, struc
src++;
wordlen++;
#if VERSION >= VERSION_PAL_FINAL
if (g_Jpn)
#endif
{
if (curword[wordlen - 1] >= 0x80) {
curword[wordlen] = *src;
v1 += chars[*src - 0x21].width;
src++;
wordlen++;
}
if (curword[wordlen - 1] >= 0x80) {
curword[wordlen] = *src;
v1 += chars[*src - 0x21].width;
src++;
wordlen++;
}
}

View File

@ -47,21 +47,9 @@
* relevant offsets within that buffer.
*/
#if VERSION >= VERSION_PAL_BETA
bool g_Jpn = VERSION == VERSION_JPN_FINAL ? true : false;
u8 *g_LangBuffer = NULL;
u8 *g_LangBufferPos = NULL;
s32 g_LangBufferSize = 0;
u32 *g_LangBanks[69];
struct var800aabb4 *var800aabb4;
struct var800aabb8 *var800aabb8;
s32 g_LanguageId = LANGUAGE_NTSC_EN;
#else
u32 *g_LangBanks[69];
struct var800aabb4 *var800aabb4;
struct var800aabb8 *var800aabb8;
bool g_Jpn = false;
#endif
u16 g_LangFiles[] = {
/* 0*/ 0,
@ -539,10 +527,6 @@ s32 langGetFileNumOffset(void)
#else
s32 offset = 0;
if (g_Jpn) {
offset = 1;
}
return offset;
#endif
}
@ -665,12 +649,3 @@ void langSetEuropean(u32 arg0)
}
}
#endif
#if VERSION == VERSION_JPN_FINAL
void langSetJpnEnabled(bool enable)
{
g_Jpn = enable ? true : false;
langReload();
}
#endif

View File

@ -1,37 +0,0 @@
#include <ultra64.h>
#include "constants.h"
#include "bss.h"
#include "lib/memp.h"
#include "data.h"
#include "types.h"
u16 *g_FrameBuffers[2];
extern s32 var8009d140jf;
void langInit(void)
{
s32 i;
#if VERSION >= VERSION_JPN_FINAL
var8009d140jf = IS4MB() ? 124 : 174;
var800aabb4 = mempAlloc(var8009d140jf * sizeof(struct var800aabb4), MEMPOOL_PERMANENT);
var800aabb8 = mempAlloc(ALIGN16(var8009d140jf * sizeof(struct var800aabb8)), MEMPOOL_PERMANENT);
for (i = 0; i < var8009d140jf; i++) {
var800aabb8[i].unk00_00 = 0;
var800aabb8[i].unk00_02 = 0x3fff;
}
#else
if (g_Jpn) {
var800aabb4 = mempAlloc(124 * sizeof(struct var800aabb4), MEMPOOL_PERMANENT);
var800aabb8 = mempAlloc(ALIGN16(124 * sizeof(struct var800aabb8)), MEMPOOL_PERMANENT);
for (i = 0; i < 124; i++) {
var800aabb8[i].unk00_00 = 0;
var800aabb8[i].unk00_02 = 0x3fff;
}
}
#endif
}

View File

@ -1,19 +0,0 @@
#include <ultra64.h>
#include "constants.h"
#include "game/room.h"
#include "bss.h"
#include "data.h"
#include "types.h"
void langTick(void)
{
s32 i;
if (g_Jpn) {
for (i = 0; i != 124; i++) {
if (var800aabb8[i].unk00_00) {
var800aabb8[i].unk00_00--;
}
}
}
}

View File

@ -1761,11 +1761,7 @@ void lvUpdateSoloHandicaps(void)
g_PlayerDamageRxScale = 1;
g_PlayerDamageTxScale = 1;
g_ExplosionDamageTxScale = 1;
#if VERSION >= VERSION_JPN_FINAL
g_AutoAimScale = 0.75f;
#else
g_AutoAimScale = g_Jpn ? 1.1f : 0.75f;
#endif
g_AmmoQuantityScale = 1.5f;
g_AttackWalkDurationScale = 0.5f;
} else {
@ -1776,11 +1772,7 @@ void lvUpdateSoloHandicaps(void)
g_PlayerDamageRxScale = 1.5f;
g_PlayerDamageTxScale = 1;
g_ExplosionDamageTxScale = 1.5f;
#if VERSION >= VERSION_JPN_FINAL
g_AutoAimScale = 0.2f;
#else
g_AutoAimScale = g_Jpn ? 0.75f : 0.2f;
#endif
g_AmmoQuantityScale = 1;
g_AttackWalkDurationScale = 1;
}
@ -1817,11 +1809,7 @@ void lvUpdateSoloHandicaps(void)
g_PlayerDamageRxScale = 0.6f;
g_PlayerDamageTxScale = 1;
g_ExplosionDamageTxScale = 0.75f;
#if VERSION >= VERSION_JPN_FINAL
g_AutoAimScale = 0.75f;
#else
g_AutoAimScale = g_Jpn ? 1.1f : 0.75f;
#endif
g_AmmoQuantityScale = 1.5f;
g_AttackWalkDurationScale = 0.5f;
} else if (g_Difficulty == DIFF_PA) {
@ -1832,11 +1820,7 @@ void lvUpdateSoloHandicaps(void)
g_PlayerDamageRxScale = 1;
g_PlayerDamageTxScale = 1;
g_ExplosionDamageTxScale = 1;
#if VERSION >= VERSION_JPN_FINAL
g_AutoAimScale = 0.2f;
#else
g_AutoAimScale = g_Jpn ? 0.75f : 0.2f;
#endif
g_AmmoQuantityScale = 1;
g_AttackWalkDurationScale = 1;
} else if (g_Difficulty == DIFF_PD) {
@ -2167,7 +2151,6 @@ void lvTick(void)
if (g_Vars.stagenum == STAGE_TITLE) {
titleTick();
langTick();
musicTick();
} else if (g_Vars.stagenum == STAGE_BOOTPAKMENU) {
setCurrentPlayerNum(0);
@ -2176,16 +2159,13 @@ void lvTick(void)
#endif
menuTick();
musicTick();
langTick();
pakExecuteDebugOperations();
} else if (g_Vars.stagenum == STAGE_4MBMENU) {
menuTick();
musicTick();
langTick();
pakExecuteDebugOperations();
} else if (g_Vars.stagenum == STAGE_CREDITS) {
musicTick();
langTick();
} else {
lvUpdateCutsceneTime();
PROFILE(PROFILEMARKER_LVT_VTXSTORE, vtxstoreTick());
@ -2227,7 +2207,6 @@ void lvTick(void)
profileEnd(PROFILEMARKER_LVT_PROPS);
PROFILE(PROFILEMARKER_LVT_MUSIC, musicTick());
langTick();
PROFILE(PROFILEMARKER_LVT_PADEFFECTS, propsTickPadEffects());
if (mainGetStageNum() == STAGE_CITRAINING) {

View File

@ -16679,12 +16679,6 @@ void func0f0878c8pf(char *dst, s32 id, bool plural, bool full, bool dual, struct
languageid = LANGUAGE_PAL_EN;
}
#if VERSION == VERSION_JPN_FINAL
if (g_Jpn) {
languageid = LANGUAGE_NTSC_EN;
}
#endif
*dst = '\0';
info = func0f087888pf(id, table);
@ -17090,41 +17084,13 @@ void ammotypeGetPickupMessage(char *dst, s32 ammotype, s32 qty)
*dst = '\0';
#if VERSION >= VERSION_JPN_FINAL
if (ammotype == AMMOTYPE_PISTOL || ammotype == AMMOTYPE_SMG || ammotype == AMMOTYPE_RIFLE) {
ammotype = 999;
if (full) {
ammotypeGetPickedUpText(dst); // "Picked up"
}
func0f0878c8pf(dst, ammotype, qty > 1, !full, 0, var8006a944pf);
#elif VERSION >= VERSION_PAL_BETA
if (g_Jpn) {
strcat(dst, "\n");
} else {
if (ammotype == AMMOTYPE_PISTOL || ammotype == AMMOTYPE_SMG || ammotype == AMMOTYPE_RIFLE) {
ammotype = 999;
}
func0f0878c8pf(dst, ammotype, qty > 1, !full, 0, var8006a944pf);
}
#else
if (g_Jpn) {
ammotypeGetPickupName(dst, ammotype, qty);
if (full) {
ammotypeGetPickedUpText(dst);
}
strcat(dst, "\n");
} else {
if (full) {
ammotypeGetPickedUpText(dst); // "Picked up"
}
ammotypeGetDeterminer(dst, ammotype, qty); // "a", "an", "some" or "the"
ammotypeGetPickupName(dst, ammotype, qty); // name of ammo type
strcat(dst, ".\n");
}
#endif
ammotypeGetDeterminer(dst, ammotype, qty); // "a", "an", "some" or "the"
ammotypeGetPickupName(dst, ammotype, qty); // name of ammo type
strcat(dst, ".\n");
}
void currentPlayerQueuePickupAmmoHudmsg(s32 ammotype, s32 pickupqty)
@ -17296,38 +17262,36 @@ void weaponGetPickupText(char *buffer, s32 weaponnum, bool dual)
if (dual) {
strcat(buffer, langGet(L_PROPOBJ_001)); // "Double"
} else {
if (!g_Jpn) {
if (full) {
strcat(buffer, langGet(L_PROPOBJ_000)); // "Picked up"
if (full) {
strcat(buffer, langGet(L_PROPOBJ_000)); // "Picked up"
if (weaponnum == WEAPON_EYESPY && g_Vars.currentplayer->eyespy) {
textid = L_PROPOBJ_050; // "your"
} else if (weaponHasFlag(weaponnum, WEAPONFLAG_DETERMINER_F_SOME)) {
textid = L_PROPOBJ_002; // "some"
} else if (weaponHasFlag(weaponnum, WEAPONFLAG_DETERMINER_F_AN)) {
textid = L_PROPOBJ_006; // "an"
} else if (weaponHasFlag(weaponnum, WEAPONFLAG_DETERMINER_F_THE)) {
textid = L_PROPOBJ_008; // "the"
} else {
textid = L_PROPOBJ_004; // "a"
}
strcat(buffer, langGet(textid));
if (weaponnum == WEAPON_EYESPY && g_Vars.currentplayer->eyespy) {
textid = L_PROPOBJ_050; // "your"
} else if (weaponHasFlag(weaponnum, WEAPONFLAG_DETERMINER_F_SOME)) {
textid = L_PROPOBJ_002; // "some"
} else if (weaponHasFlag(weaponnum, WEAPONFLAG_DETERMINER_F_AN)) {
textid = L_PROPOBJ_006; // "an"
} else if (weaponHasFlag(weaponnum, WEAPONFLAG_DETERMINER_F_THE)) {
textid = L_PROPOBJ_008; // "the"
} else {
if (weaponnum == WEAPON_EYESPY && g_Vars.currentplayer->eyespy) {
textid = L_PROPOBJ_051; // "Your"
} else if (weaponHasFlag(weaponnum, WEAPONFLAG_DETERMINER_S_SOME)) {
textid = L_PROPOBJ_003; // "Some"
} else if (weaponHasFlag(weaponnum, WEAPONFLAG_DETERMINER_S_AN)) {
textid = L_PROPOBJ_007; // "An"
} else if (weaponHasFlag(weaponnum, WEAPONFLAG_DETERMINER_S_THE)) {
textid = L_PROPOBJ_009; // "The"
} else {
textid = L_PROPOBJ_005; // "A"
}
strcat(buffer, langGet(textid));
textid = L_PROPOBJ_004; // "a"
}
strcat(buffer, langGet(textid));
} else {
if (weaponnum == WEAPON_EYESPY && g_Vars.currentplayer->eyespy) {
textid = L_PROPOBJ_051; // "Your"
} else if (weaponHasFlag(weaponnum, WEAPONFLAG_DETERMINER_S_SOME)) {
textid = L_PROPOBJ_003; // "Some"
} else if (weaponHasFlag(weaponnum, WEAPONFLAG_DETERMINER_S_AN)) {
textid = L_PROPOBJ_007; // "An"
} else if (weaponHasFlag(weaponnum, WEAPONFLAG_DETERMINER_S_THE)) {
textid = L_PROPOBJ_009; // "The"
} else {
textid = L_PROPOBJ_005; // "A"
}
strcat(buffer, langGet(textid));
}
}
@ -17351,16 +17315,6 @@ void weaponGetPickupText(char *buffer, s32 weaponnum, bool dual)
strcat(buffer, "s");
}
// For JPN, their translation of "picked up" comes after the weapon name
if (g_Jpn && full) {
if (buffer[strlen(buffer) - 1] == '\n') {
buffer[strlen(buffer) - 1] = '\0';
}
strcat(buffer, langGet(L_PROPOBJ_000)); // "Picked up"
strcat(buffer, "\n"); // This just gets removed immediately below
}
if (buffer[strlen(buffer) - 1] == '\n') {
buffer[strlen(buffer) - 1] = '\0';
}

View File

@ -1471,12 +1471,7 @@ void setupCreateProps(s32 stagenum)
break;
case OBJTYPE_SHIELD:
if (withobjs) {
#if VERSION >= VERSION_JPN_FINAL
if ((obj->flags2 & diffflag) == 0)
#else
if ((obj->flags2 & diffflag) == 0 || g_Jpn)
#endif
{
if ((obj->flags2 & diffflag) == 0) {
struct shieldobj *shield = (struct shieldobj *)obj;
shield->initialamount = *(s32 *)&shield->initialamount / 65536.0f;
shield->amount = shield->initialamount;

View File

@ -8098,13 +8098,8 @@ Gfx *titleRenderNoController(Gfx *gdl)
x = 288 - (textwidth >> 1);
y = (g_TitleViewHeight / 2) - (textheight >> 1) - 12;
if (g_Jpn) {
width = viGetWidth();
gdl = textRender(gdl, &x, &y, text, g_CharsHandelGothicLg, g_FontHandelGothicLg, 0xffffffff, 0x008000ff, width, viGetHeight(), 0, 0);
} else {
width = viGetWidth();
gdl = textRenderProjected(gdl, &x, &y, text, g_CharsHandelGothicLg, g_FontHandelGothicLg, 0xffffffff, width, viGetHeight(), 0, 0);
}
width = viGetWidth();
gdl = textRenderProjected(gdl, &x, &y, text, g_CharsHandelGothicLg, g_FontHandelGothicLg, 0xffffffff, width, viGetHeight(), 0, 0);
// Line 2
text = langGet(L_OPTIONS_072); // "please power off and attach a controller"
@ -8113,13 +8108,8 @@ Gfx *titleRenderNoController(Gfx *gdl)
x = 288 - (textwidth >> 1);
y = (g_TitleViewHeight / 2) - (textheight >> 1) + 12;
if (g_Jpn) {
width = viGetWidth();
gdl = textRender(gdl, &x, &y, text, g_CharsHandelGothicLg, g_FontHandelGothicLg, 0xffffffff, 0x008000ff, width, viGetHeight(), 0, 0);
} else {
width = viGetWidth();
gdl = textRenderProjected(gdl, &x, &y, text, g_CharsHandelGothicLg, g_FontHandelGothicLg, 0xffffffff, width, viGetHeight(), 0, 0);
}
width = viGetWidth();
gdl = textRenderProjected(gdl, &x, &y, text, g_CharsHandelGothicLg, g_FontHandelGothicLg, 0xffffffff, width, viGetHeight(), 0, 0);
#endif
gdl = text0f153780(gdl);

View File

@ -92,12 +92,6 @@ bool argsParseDebugArgs(void)
g_SndDisabled = true;
}
#if VERSION < VERSION_JPN_FINAL
if (argFindByPrefix(1, "-j")) {
g_Jpn = true;
}
#endif
return ret;
}

View File

@ -406,7 +406,6 @@ void mainInit(void)
utilsInit();
func000034d0();
texInit();
langInit();
lvInit();
cheatsInit();
func0000e9c0();

View File

@ -26,6 +26,7 @@ Mtx *var80092870;
u16 g_ViPerspScale;
u8 g_ViFrontIndex;
u8 g_ViBackIndex;
u16 *g_FrameBuffers[2];
struct rend_vidat g_ViDataArray[] = {
{