Remove references to IS4MB and IS8MB

This commit is contained in:
Ryan Dwyer
2022-11-11 23:09:09 +10:00
parent 0714f1cb21
commit 64155bcb15
50 changed files with 171 additions and 505 deletions
+1 -1
View File
@@ -79,7 +79,7 @@ ANTIALIAS = 0
# If enabled (1), press L to show frate stats followed by D-right to toggle
# profiling information.
PROFILING = 0
PROFILING = 1
################################################################################
+3 -5
View File
@@ -756,7 +756,6 @@ void amClose(void)
bool amIsCramped(void)
{
return (g_AmMenus[g_AmIndex].screenindex == 0 && PLAYERCOUNT() >= 3)
|| (IS4MB() && PLAYERCOUNT() == 2)
|| (PLAYERCOUNT() == 2 && optionsGetScreenSplit() == SCREENSPLIT_VERTICAL);
}
@@ -805,8 +804,7 @@ void amCalculateSlotPosition(s16 column, s16 row, s16 *x, s16 *y)
*x += viGetViewLeft() / g_ScaleX + viGetViewWidth() / (g_ScaleX * 2);
*y += viGetViewTop() + viGetViewHeight() / 2;
if ((playercount == 2 && (optionsGetScreenSplit() == SCREENSPLIT_VERTICAL || IS4MB()))
|| playercount >= 3) {
if ((playercount == 2 && optionsGetScreenSplit() == SCREENSPLIT_VERTICAL) || playercount >= 3) {
if ((g_Vars.currentplayernum % 2) == 0) {
*x += 8;
} else {
@@ -847,7 +845,7 @@ Gfx *amRenderAibotInfo(Gfx *gdl, s32 buddynum)
wide = true;
}
if ((PLAYERCOUNT() == 2 && (optionsGetScreenSplit() == SCREENSPLIT_VERTICAL || IS4MB())) || PLAYERCOUNT() >= 3) {
if ((PLAYERCOUNT() == 2 && optionsGetScreenSplit() == SCREENSPLIT_VERTICAL) || PLAYERCOUNT() >= 3) {
if ((g_Vars.currentplayernum % 2) == 0) {
offset = 8;
} else {
@@ -1373,7 +1371,7 @@ Gfx *amRender(Gfx *gdl)
barheight = PLAYERCOUNT() >= 2 ? 7 : 11;
xoffset = 0;
if ((PLAYERCOUNT() == 2 && (optionsGetScreenSplit() == SCREENSPLIT_VERTICAL || IS4MB())) || PLAYERCOUNT() >= 3) {
if ((PLAYERCOUNT() == 2 && optionsGetScreenSplit() == SCREENSPLIT_VERTICAL) || PLAYERCOUNT() >= 3) {
xoffset = (g_Vars.currentplayernum & 1) == 0 ? 8 : -8;
}
+4 -9
View File
@@ -1358,13 +1358,8 @@ void bgReset(s32 stagenum)
var8007fc0c = 8;
if (IS4MB()) {
g_BgUnloadDelay240 = 6;
g_BgUnloadDelay240_2 = 6;
} else {
g_BgUnloadDelay240 = 120;
g_BgUnloadDelay240_2 = 120;
}
g_BgUnloadDelay240 = 120;
g_BgUnloadDelay240_2 = 120;
switch (g_Vars.stagenum) {
case STAGE_INFILTRATION:
@@ -1918,7 +1913,7 @@ void bgTick(void)
if (tickmode == TICKMODE_NORMAL) {
var8007fc10 = 4;
if (IS8MB() && var8007fc0c) {
if (var8007fc0c) {
var8007fc0c--;
var8007fc10 = 200;
}
@@ -5670,7 +5665,7 @@ Gfx *func0f164150(Gfx *gdl)
}
// Consider loading one room by finding the load candidate that is closest to the player
if (var8007fc28 == 0 && var8007fc10 == 4 && g_Vars.tickmode == TICKMODE_NORMAL && IS8MB()) {
if (var8007fc28 == 0 && var8007fc10 == 4 && g_Vars.tickmode == TICKMODE_NORMAL) {
struct player *player = g_Vars.currentplayer;
s32 i;
f32 value;
+1 -1
View File
@@ -196,7 +196,7 @@ struct model *body0f02ce8c(s32 bodynum, s32 headnum, struct modelfiledata *bodyf
bodyfiledata->rwdatalen += headfiledata->rwdatalen;
} else if (headnum > 0) {
if (headfiledata == NULL) {
if (g_Vars.normmplayerisrunning && !IS4MB()) {
if (g_Vars.normmplayerisrunning) {
headfiledata = modeldefLoadToNew(g_HeadsAndBodies[headnum].filenum);
g_HeadsAndBodies[headnum].filedata = headfiledata;
g_FileInfo[g_HeadsAndBodies[headnum].filenum].loadedsize = 0;
+12 -16
View File
@@ -1207,7 +1207,7 @@ s32 bgunTickIncAutoSwitch(struct handweaponinfo *info, s32 handnum, struct hand
hand->shotremainder = 0;
if (bgunIsReadyToSwitch(handnum) && bgunSetState(handnum, HANDSTATE_CHANGEGUN)) {
if (g_Vars.mplayerisrunning && (IS8MB() || PLAYERCOUNT() != 1)) {
if (g_Vars.mplayerisrunning) {
playermgrDeleteWeapon(handnum);
}
@@ -2614,7 +2614,7 @@ s32 bgunTickIncChangeGun(struct handweaponinfo *info, s32 handnum, struct hand *
if (hand->stateframes >= delay) {
if (!somebool) {
if (g_Vars.mplayerisrunning && (IS8MB() || PLAYERCOUNT() != 1)) {
if (g_Vars.mplayerisrunning) {
playermgrDeleteWeapon(handnum);
}
@@ -2683,7 +2683,7 @@ s32 bgunTickIncChangeGun(struct handweaponinfo *info, s32 handnum, struct hand *
}
if (hand->count == 0) {
if (g_Vars.mplayerisrunning && (IS8MB() || PLAYERCOUNT() != 1)) {
if (g_Vars.mplayerisrunning) {
playermgrCreateWeapon(handnum);
}
@@ -3305,10 +3305,6 @@ u8 *bgunGetGunMem(void)
u32 bgunCalculateGunMemCapacity(void)
{
if (IS4MB() && PLAYERCOUNT() == 2) {
return var800700ac;
}
if (PLAYERCOUNT() == 1) {
switch (g_Vars.stagenum) {
case STAGE_CHICAGO:
@@ -4906,7 +4902,7 @@ void bgunFreeWeapon(s32 handnum)
}
}
if (g_Vars.mplayerisrunning && (IS8MB() || PLAYERCOUNT() != 1)) {
if (g_Vars.mplayerisrunning) {
playermgrDeleteWeapon(handnum);
}
@@ -7086,7 +7082,7 @@ void bgun0f0a5550(s32 handnum)
mtx4LoadIdentity(&sp234);
if (PLAYERCOUNT() == 1 && IS8MB() && weaponHasFlag(weaponnum, WEAPONFLAG_GANGSTA)) {
if (PLAYERCOUNT() == 1 && weaponHasFlag(weaponnum, WEAPONFLAG_GANGSTA)) {
bgunUpdateGangsta(hand, handnum, &sp274, funcdef, &sp284, &sp234);
}
@@ -7409,7 +7405,7 @@ void bgun0f0a5550(s32 handnum)
bgunCreateFx(hand, handnum, funcdef, weaponnum, modeldef, mtxallocation);
}
if (PLAYERCOUNT() == 1 && IS8MB() && g_Vars.lvupdate240 != 0) {
if (PLAYERCOUNT() == 1 && g_Vars.lvupdate240 != 0) {
bgunUpdateSmoke(hand, handnum, weaponnum, funcdef);
}
@@ -7417,7 +7413,7 @@ void bgun0f0a5550(s32 handnum)
bgunTickEject(hand, modeldef, isdetonator);
}
if (PLAYERCOUNT() == 1 && IS8MB() && hand->visible
if (PLAYERCOUNT() == 1 && hand->visible
&& weaponnum >= WEAPON_FALCON2 && weaponnum <= WEAPON_FALCON2_SCOPE) {
bgunUpdateLasersight(hand, modeldef, handnum, mtxallocation);
} else {
@@ -7753,7 +7749,7 @@ void bgunRender(Gfx **gdlptr)
gdl = vi0000b0e8(gdl, 60, f2);
}
if (PLAYERCOUNT() == 1 && IS8MB()) {
if (PLAYERCOUNT() == 1) {
gdl = lasersightRenderBeam(gdl);
}
@@ -9277,7 +9273,7 @@ Gfx *bgunDrawHud(Gfx *gdl)
clipheight = 47;
if (playercount == 2) {
if (IS4MB() || (optionsGetScreenSplit() != SCREENSPLIT_VERTICAL && playernum == 0)) {
if (optionsGetScreenSplit() != SCREENSPLIT_VERTICAL && playernum == 0) {
bottom += 10;
} else {
bottom += 2;
@@ -9306,7 +9302,7 @@ Gfx *bgunDrawHud(Gfx *gdl)
xpos = (viGetViewLeft() + viGetViewWidth()) / g_ScaleX - barwidth - 24;
if (playercount == 2 && (optionsGetScreenSplit() == SCREENSPLIT_VERTICAL || IS4MB()) && playernum == 0) {
if (playercount == 2 && optionsGetScreenSplit() == SCREENSPLIT_VERTICAL && playernum == 0) {
xpos += 15;
} else if (playercount >= 3 && (playernum % 2) == 0) {
xpos += 15;
@@ -9486,7 +9482,7 @@ Gfx *bgunDrawHud(Gfx *gdl)
&& lefthand->gset.weaponnum != WEAPON_REMOTEMINE) {
xpos = viGetViewLeft() / g_ScaleX + 24;
if (playercount == 2 && (optionsGetScreenSplit() == SCREENSPLIT_VERTICAL || IS4MB()) && playernum == 1) {
if (playercount == 2 && optionsGetScreenSplit() == SCREENSPLIT_VERTICAL && playernum == 1) {
xpos -= 14;
} else if (playercount >= 3 && (playernum & 1) == 1) {
xpos -= 14;
@@ -9512,7 +9508,7 @@ Gfx *bgunDrawHud(Gfx *gdl)
xpos = (viGetViewLeft() + viGetViewWidth()) / g_ScaleX - barwidth - 24;
if (playercount == 2 && (optionsGetScreenSplit() == SCREENSPLIT_VERTICAL || IS4MB()) && playernum == 0) {
if (playercount == 2 && optionsGetScreenSplit() == SCREENSPLIT_VERTICAL && playernum == 0) {
xpos += 15;
} else if (playercount >= 3 && (playernum % 2) == 0) {
xpos += 15;
+1 -5
View File
@@ -141,11 +141,7 @@ void bgunReset(void)
{-1}, // beam
};
if (IS4MB() && PLAYERCOUNT() == 2) {
i = ALIGN16(var800700ac);
} else {
i = ALIGN16(bgunCalculateGunMemCapacity());
}
i = ALIGN16(bgunCalculateGunMemCapacity());
g_Vars.currentplayer->gunctrl.gunmem = mempAlloc(i, MEMPOOL_STAGE);
g_Vars.currentplayer->gunctrl.handfilenum = 0;
-5
View File
@@ -42,11 +42,6 @@ void botmgrAllocateBot(s32 chrnum, s32 aibotnum)
headnum = mpGetHeadId(g_BotConfigsArray[aibotnum].base.mpheadnum);
bodynum = mpGetBodyId(g_BotConfigsArray[aibotnum].base.mpbodynum);
if (IS4MB()) {
headnum = HEAD_DDSHOCK;
bodynum = BODY_DDSHOCK;
}
model = bodyAllocateModel(bodynum, headnum, 0);
if (model != NULL) {
-4
View File
@@ -862,10 +862,6 @@ void func0f002a98(void)
}
var80061420 = 0;
if (IS4MB()) {
var80061444 = 0;
}
}
void roomSetLightsOn(s32 roomnum, s32 enable)
+1 -5
View File
@@ -443,11 +443,7 @@ void filemgrHandleSuccess(void)
g_Vars.bossdeviceserial = g_Menus[g_MpPlayerNum].fm.deviceserial;
bossfileSave();
if (IS4MB()) {
func0f0f820c(&g_MainMenu4MbMenuDialog, MENUROOT_4MBMAINMENU);
} else {
func0f0f820c(&g_CiMenuViaPcMenuDialog, MENUROOT_MAINMENU);
}
func0f0f820c(&g_CiMenuViaPcMenuDialog, MENUROOT_MAINMENU);
break;
case FILEOP_READ_GAME:
case FILEOP_READ_MPSETUP:
+5 -15
View File
@@ -37,22 +37,12 @@ void mblurReset(s32 stagenum)
void mblurAllocate(void)
{
if (IS4MB()) {
var800ab7c0 = 320;
var800ab7c0 = 640;
if (g_Vars.normmplayerisrunning && PLAYERCOUNT() >= 2) {
var800ab7c4 = 110;
} else {
var800ab7c4 = 220;
}
if (g_Vars.normmplayerisrunning && PLAYERCOUNT() >= 2) {
var800ab7c4 = 220;
} else {
var800ab7c0 = 640;
if (g_Vars.normmplayerisrunning && PLAYERCOUNT() >= 2) {
var800ab7c4 = 220;
} else {
var800ab7c4 = 220;
}
var800ab7c4 = 220;
}
var800844f0 = mempAlloc(var800ab7c0 * var800ab7c4 * 2 + 0x40, MEMPOOL_STAGE);
@@ -74,7 +64,7 @@ Gfx *mblur0f1762ac(Gfx *gdl)
&& (g_Vars.currentplayernum >= 2 || (PLAYERCOUNT() == 2 && g_Vars.currentplayernum == 1))) {
subamount = playerGetFbWidth() * playerGetFbHeight();
if (IS4MB() || optionsGetScreenSplit() == SCREENSPLIT_VERTICAL) {
if (optionsGetScreenSplit() == SCREENSPLIT_VERTICAL) {
subamount = 0;
}
} else {
+3 -12
View File
@@ -90,22 +90,13 @@ void gamefileApplyOptions(struct gamefile *file)
g_Vars.langfilteron = pakHasBitflag(GAMEFILEFLAG_LANGFILTERON, file->flags);
if (pakHasBitflag(GAMEFILEFLAG_HIRES, file->flags)) {
if (IS4MB()) {
playerSetHiResEnabled(false);
} else {
playerSetHiResEnabled(true);
}
playerSetHiResEnabled(true);
} else {
playerSetHiResEnabled(false);
}
if (IS4MB()) {
optionsSetScreenSplit(SCREENSPLIT_HORIZONTAL);
optionsSetScreenRatio(SCREENRATIO_NORMAL);
} else {
optionsSetScreenSplit(pakHasBitflag(GAMEFILEFLAG_SCREENSPLIT, file->flags));
optionsSetScreenRatio(pakHasBitflag(GAMEFILEFLAG_SCREENRATIO, file->flags));
}
optionsSetScreenSplit(pakHasBitflag(GAMEFILEFLAG_SCREENSPLIT, file->flags));
optionsSetScreenRatio(pakHasBitflag(GAMEFILEFLAG_SCREENRATIO, file->flags));
if (pakHasBitflag(GAMEFILEFLAG_SCREENSIZE_CINEMA, file->flags)) {
optionsSetScreenSize(SCREENSIZE_CINEMA);
+12 -23
View File
@@ -114,22 +114,20 @@ Gfx *hudmsgRenderMissionTimer(Gfx *gdl, u32 alpha)
timery -= g_HudPaddingY;
timery -= 8;
is4mb = IS4MB();
// @bug: There is no check for playercount >= 2 in the next two statements.
// Because of this, in 1 player the timer is drawn out of place when the
// screen split option is vertical and either the countdown timer is visible
// or a zoomable weapon is in use.
if ((is4mb || optionsGetScreenSplit() == SCREENSPLIT_VERTICAL) && countdownTimerIsVisible()) {
if (optionsGetScreenSplit() == SCREENSPLIT_VERTICAL && countdownTimerIsVisible()) {
timery -= 8;
}
if ((IS4MB() || optionsGetScreenSplit() == SCREENSPLIT_VERTICAL || playercount >= 3) && hudmsgIsZoomRangeVisible()) {
if ((optionsGetScreenSplit() == SCREENSPLIT_VERTICAL || playercount >= 3) && hudmsgIsZoomRangeVisible()) {
timery -= 8;
}
if (playercount == 2) {
if (IS4MB() || (optionsGetScreenSplit() != SCREENSPLIT_VERTICAL && playernum == 0)) {
if (optionsGetScreenSplit() != SCREENSPLIT_VERTICAL && playernum == 0) {
timery += 10;
} else {
timery += 2;
@@ -149,14 +147,13 @@ Gfx *hudmsgRenderMissionTimer(Gfx *gdl, u32 alpha)
// If this is a second player with their viewport on the right side of the
// screen, move the timer left a bit as the safe zone doesn't need to be
// considered.
if (playercount == 2 && (optionsGetScreenSplit() == SCREENSPLIT_VERTICAL || IS4MB()) && playernum == 1) {
if (playercount == 2 && optionsGetScreenSplit() == SCREENSPLIT_VERTICAL && playernum == 1) {
viewleft -= 14;
} else if (playercount >= 3 && (playernum & 1) == 1) {
viewleft -= 14;
}
textcolour = textcolour * 160 / 255;
if (g_Is4Mb);
textcolour |= 0x00ff0000;
formatTime(buffer, playerGetMissionTime(), TIMEPRECISION_HUNDREDTHS);
@@ -208,7 +205,7 @@ Gfx *hudmsgRenderZoomRange(Gfx *gdl, u32 alpha)
}
if (playercount == 2) {
if (IS4MB() || (optionsGetScreenSplit() != SCREENSPLIT_VERTICAL && g_Vars.currentplayernum == 0)) {
if (optionsGetScreenSplit() != SCREENSPLIT_VERTICAL && g_Vars.currentplayernum == 0) {
texty += 10;
} else {
texty += 2;
@@ -749,7 +746,7 @@ void hudmsgCalculatePosition(struct hudmessage *msg)
}
}
if (PLAYERCOUNT() == 2 && (optionsGetScreenSplit() == SCREENSPLIT_VERTICAL || IS4MB())) {
if (PLAYERCOUNT() == 2 && optionsGetScreenSplit() == SCREENSPLIT_VERTICAL) {
{
viewwidth -= offset;
@@ -769,20 +766,12 @@ void hudmsgCalculatePosition(struct hudmessage *msg)
x = viewleft + v0 + msg->xmargin + 3;
if (PLAYERCOUNT() == 2
&& (optionsGetScreenSplit() == SCREENSPLIT_VERTICAL || IS4MB())
&& optionsGetScreenSplit() == SCREENSPLIT_VERTICAL
&& (!g_InCutscene || g_MainIsEndscreen)) {
if (IS4MB()) {
if (msg->playernum == 0) {
x--;
} else if (msg->playernum == 1) {
x -= 16;
}
} else {
if (msg->playernum == 0) {
x += 15;
} else if (msg->playernum == 1) {
x += 4;
}
if (msg->playernum == 0) {
x += 15;
} else if (msg->playernum == 1) {
x += 4;
}
} else if (PLAYERCOUNT() >= 3) {
if ((msg->playernum % 2) == 0) {
@@ -814,7 +803,7 @@ void hudmsgCalculatePosition(struct hudmessage *msg)
y = viewtop + viewheight - msg->height - msg->ymargin - 14;
if (PLAYERCOUNT() == 2 && (g_InCutscene == 0 || g_MainIsEndscreen)) {
if (IS4MB() || (optionsGetScreenSplit() != SCREENSPLIT_VERTICAL && msg->playernum == 0)) {
if (optionsGetScreenSplit() != SCREENSPLIT_VERTICAL && msg->playernum == 0) {
y += 8;
} else {
y += 3;
-4
View File
@@ -1809,10 +1809,6 @@ void lvTick(void)
g_Vars.joydisableframestogo = -1;
}
if (IS4MB()) {
vmPrintStatsIfEnabled();
}
for (j = 0; j < PLAYERCOUNT(); j++) {
g_Vars.players[j]->hands[HAND_LEFT].hasdotinfo = false;
g_Vars.players[j]->hands[HAND_RIGHT].hasdotinfo = false;
-3
View File
@@ -410,9 +410,6 @@ s32 menuhandlerHiRes(s32 operation, struct menuitem *item, union handlerdata *da
{
switch (operation) {
case MENUOP_CHECKHIDDEN:
if (IS4MB()) {
return true;
}
if (g_Vars.coopplayernum >= 0 || g_Vars.antiplayernum >= 0) {
if (PLAYERCOUNT() >= 2) {
return true;
+44 -56
View File
@@ -1775,59 +1775,57 @@ Gfx *menuRenderModels(Gfx *gdl, struct menu840 *thing, s32 arg2)
mtx4LoadIdentity(&sp350);
if (arg2 == 1) {
if (IS8MB()) {
s32 i;
s32 i;
if (thing->unk510 != thing->unk538) {
for (i = 0; i < g_Vars.diffframe60; i++) {
thing->unk510 = (thing->unk538 * PALUPF(0.002f)) + ((1.0f - PALUPF(0.002f)) * thing->unk510);
}
if (thing->unk510 != thing->unk538) {
for (i = 0; i < g_Vars.diffframe60; i++) {
thing->unk510 = (thing->unk538 * PALUPF(0.002f)) + ((1.0f - PALUPF(0.002f)) * thing->unk510);
}
}
if (thing->unk514 != thing->unk53c) {
for (i = 0; i < g_Vars.diffframe60; i++) {
thing->unk514 = (thing->unk53c * PALUPF(0.002f)) + ((1.0f - PALUPF(0.002f)) * thing->unk514);
}
if (thing->unk514 != thing->unk53c) {
for (i = 0; i < g_Vars.diffframe60; i++) {
thing->unk514 = (thing->unk53c * PALUPF(0.002f)) + ((1.0f - PALUPF(0.002f)) * thing->unk514);
}
}
if (thing->unk518 != thing->unk540) {
for (i = 0; i < g_Vars.diffframe60; i++) {
thing->unk518 = (thing->unk540 * PALUPF(0.002f)) + ((1.0f - PALUPF(0.002f)) * thing->unk518);
}
if (thing->unk518 != thing->unk540) {
for (i = 0; i < g_Vars.diffframe60; i++) {
thing->unk518 = (thing->unk540 * PALUPF(0.002f)) + ((1.0f - PALUPF(0.002f)) * thing->unk518);
}
}
if (thing->unk51c != thing->unk544) {
for (i = 0; i < g_Vars.diffframe60; i++) {
thing->unk51c = (thing->unk544 * PALUPF(0.002f)) + ((1.0f - PALUPF(0.002f)) * thing->unk51c);
}
if (thing->unk51c != thing->unk544) {
for (i = 0; i < g_Vars.diffframe60; i++) {
thing->unk51c = (thing->unk544 * PALUPF(0.002f)) + ((1.0f - PALUPF(0.002f)) * thing->unk51c);
}
}
sp430 = thing->unk510;
sp430 = thing->unk510;
#if !PAL
if (g_ViRes == VIRES_HI) {
sp430 *= 2.0f;
}
if (g_ViRes == VIRES_HI) {
sp430 *= 2.0f;
}
#endif
sp42c = thing->unk514;
sp428 = thing->unk518;
sp424 = thing->unk51c;
sp42c = thing->unk514;
sp428 = thing->unk518;
sp424 = thing->unk51c;
a = thing->unk548;
b = thing->unk54c;
c = thing->unk550;
a = thing->unk548;
b = thing->unk54c;
c = thing->unk550;
thing->unk520 = a;
thing->unk524 = b;
thing->unk528 = c;
thing->unk520 = a;
thing->unk524 = b;
thing->unk528 = c;
sp398.x = a;
sp398.y = b;
sp398.z = c;
sp398.x = a;
sp398.y = b;
sp398.z = c;
mtx4LoadRotation(&sp398, &sp350);
}
mtx4LoadRotation(&sp398, &sp350);
} else {
if (thing->unk5b1_05) {
thing->unk564 += g_Vars.diffframe60f / 40.0f;
@@ -1921,10 +1919,8 @@ Gfx *menuRenderModels(Gfx *gdl, struct menu840 *thing, s32 arg2)
sp30c[0] = -100.0f + sp428;
if (arg2 == 1) {
if (IS8MB()) {
sp390[0] = thing->unk510 * g_ScaleX;
sp390[1] = thing->unk514;
}
sp390[0] = thing->unk510 * g_ScaleX;
sp390[1] = thing->unk514;
} else {
sp390[0] = sp430 * g_ScaleX + viGetViewLeft() + viGetViewWidth() * 0.5f;
sp390[1] = sp42c + viGetViewTop() + viGetViewHeight() * 0.5f;
@@ -3054,7 +3050,7 @@ void menuFindAvailableSize(s32 *leftptr, s32 *topptr, s32 *rightptr, s32 *bottom
}
}
if (PLAYERCOUNT() == 2 && (optionsGetScreenSplit() == SCREENSPLIT_VERTICAL || IS4MB())) {
if (PLAYERCOUNT() == 2 && optionsGetScreenSplit() == SCREENSPLIT_VERTICAL) {
if (g_Menus[g_MpPlayerNum].playernum == 0) {
*leftptr += 22;
} else {
@@ -3256,7 +3252,7 @@ void menuPushRootDialog(struct menudialogdef *dialogdef, s32 root)
|| root == MENUROOT_MPSETUP
|| root == MENUROOT_TRAINING
|| root == MENUROOT_FILEMGR) {
if (IS8MB() && (g_MenuData.unk5d4 == 0 || g_MenuData.unk01c.unk5b1_04)) {
if (g_MenuData.unk5d4 == 0 || g_MenuData.unk01c.unk5b1_04) {
if (!g_MenuData.unk5d5_04) {
g_MenuData.unk5d5_05 = true;
}
@@ -3450,9 +3446,7 @@ void menuReset(void)
var8009dfc0 = 0;
if (IS8MB()) {
g_BlurBuffer = mempAlloc(0x4b00, MEMPOOL_STAGE);
}
g_BlurBuffer = mempAlloc(0x4b00, MEMPOOL_STAGE);
g_MenuData.unk5d5_01 = false;
@@ -3502,12 +3496,10 @@ void menuReset(void)
}
for (i = 0; i < max; i++) {
func0f0f8bb4(&g_Menus[i].unk840, IS4MB() ? 0xb400 : 0x25800, 1);
func0f0f8bb4(&g_Menus[i].unk840, 0x25800, 1);
}
if (IS8MB()) {
func0f0f8bb4(&g_MenuData.unk01c, 0xc800, 1);
}
func0f0f8bb4(&g_MenuData.unk01c, 0xc800, 1);
g_MenuData.unk01c.unk00c = 0x259;
g_MenuData.unk01c.unk524 = g_MenuData.unk01c.unk54c = -M_PI;
@@ -4030,11 +4022,7 @@ void dialogTick(struct menudialog *dialog, struct menuinputs *inputs, u32 tickfl
if (inputs->back) {
if ((dialog->definition->flags & MENUDIALOGFLAG_DROPOUTONCLOSE) && g_Vars.unk000498) {
if (IS4MB()) {
menuPushDialog(&g_MpDropOut4MbMenuDialog);
} else {
menuPushDialog(&g_MpDropOutMenuDialog);
}
menuPushDialog(&g_MpDropOutMenuDialog);
} else if ((dialog->definition->flags & MENUDIALOGFLAG_IGNOREBACK) == 0) {
menuPopDialog();
}
@@ -4831,7 +4819,7 @@ Gfx *menuRender(Gfx *gdl)
g_MenuData.unk5d5_05 = false;
}
if (IS8MB() && g_MenuData.unk5d4) {
if (g_MenuData.unk5d4) {
bool removepiece = false;
gSPSetGeometryMode(gdl++, G_ZBUFFER);
@@ -5081,7 +5069,7 @@ Gfx *menuRender(Gfx *gdl)
}
}
if (PLAYERCOUNT() == 2 && (optionsGetScreenSplit() == SCREENSPLIT_VERTICAL || IS4MB())) {
if (PLAYERCOUNT() == 2 && optionsGetScreenSplit() == SCREENSPLIT_VERTICAL) {
if (g_Vars.currentplayernum == 1) {
right = 15;
} else {
-4
View File
@@ -114,10 +114,6 @@ Gfx *menugfxRenderBgBlur(Gfx *gdl, u32 colour, s16 arg2, s16 arg3)
u32 *colours;
struct gfxvtx *vertices;
if (IS4MB()) {
return menugfxRenderGradient(gdl, 0, 0, viGetWidth(), viGetHeight(), 0xff, 0xff, 0xff);
}
colours = gfxAllocateColours(1);
vertices = gfxAllocateVertices(4);
+10 -32
View File
@@ -232,11 +232,7 @@ void menuTick(void)
} else if (g_MpNumJoined == 0) {
g_MpNumJoined++;
if (IS4MB()) {
menuPushRootDialog(&g_MainMenu4MbMenuDialog, MENUROOT_4MBMAINMENU);
} else {
menuPushRootDialog(&g_CombatSimulatorMenuDialog, MENUROOT_MPSETUP);
}
menuPushRootDialog(&g_CombatSimulatorMenuDialog, MENUROOT_MPSETUP);
} else {
g_Vars.waitingtojoin[i] = true;
}
@@ -248,7 +244,7 @@ void menuTick(void)
if (g_MpSetup.chrslots & 0xf) {
sndStart(var80095200, SFX_EXPLOSION_8098, 0, -1, -1, -1, -1, -1);
playerPause(IS4MB() ? MENUROOT_4MBMAINMENU : MENUROOT_MPSETUP);
playerPause(MENUROOT_MPSETUP);
}
}
@@ -371,11 +367,7 @@ void menuTick(void)
// Joining from quick go - open Quick Go dialog
g_MpNumJoined++;
if (IS4MB()) {
menuPushRootDialog(&g_MpQuickGo4MbMenuDialog, MENUROOT_4MBMAINMENU);
} else {
menuPushRootDialog(&g_MpQuickGoMenuDialog, MENUROOT_MPSETUP);
}
menuPushRootDialog(&g_MpQuickGoMenuDialog, MENUROOT_MPSETUP);
} else {
// Joining from advanced setup
g_MpNumJoined++;
@@ -397,11 +389,7 @@ void menuTick(void)
g_Vars.waitingtojoin[i] = false;
g_MpNumJoined++;
if (IS4MB()) {
menuPushRootDialog(&g_MpQuickGo4MbMenuDialog, MENUROOT_4MBMAINMENU);
} else {
menuPushRootDialog(&g_MpQuickGoMenuDialog, MENUROOT_MPSETUP);
}
menuPushRootDialog(&g_MpQuickGoMenuDialog, MENUROOT_MPSETUP);
} else if (g_Vars.mpsetupmenu == MPSETUPMENU_ADVSETUP) {
// Player was waiting to join and we have just
// reached the adv setup layer - open the dialog
@@ -490,10 +478,7 @@ void menuTick(void)
&& g_MenuData.unk008 == -1) {
if (g_Vars.mpsetupmenu == MPSETUPMENU_GENERAL) {
g_MenuData.unk008 = MENUROOT_MAINMENU;
g_MenuData.unk00c = IS4MB() ? &g_CiMenuViaPauseMenuDialog : &g_CiMenuViaPcMenuDialog;
} else if (IS4MB()) {
g_MenuData.unk008 = MENUROOT_4MBMAINMENU;
g_MenuData.unk00c = &g_MainMenu4MbMenuDialog;
g_MenuData.unk00c = &g_CiMenuViaPcMenuDialog;
} else {
g_MenuData.unk008 = MENUROOT_MPSETUP;
g_MenuData.unk00c = &g_CombatSimulatorMenuDialog;
@@ -558,7 +543,7 @@ void menuTick(void)
g_FileState = FILESTATE_CHANGINGAGENT;
gamefileLoadDefaults(&g_GameFile);
gamefileApplyOptions(&g_GameFile);
mainChangeToStage(IS4MB() ? STAGE_4MBMENU : STAGE_CITRAINING);
mainChangeToStage(STAGE_CITRAINING);
musicQueueStopAllEvent();
} else {
bool startmusic = false;
@@ -633,17 +618,10 @@ void menuTick(void)
g_BossFile.locktype = MPLOCKTYPE_NONE;
}
if (IS8MB()) {
titleSetNextStage(STAGE_CITRAINING);
setNumPlayers(1);
titleSetNextMode(TITLEMODE_SKIP);
mainChangeToStage(STAGE_CITRAINING);
} else {
titleSetNextStage(STAGE_4MBMENU);
setNumPlayers(1);
titleSetNextMode(TITLEMODE_SKIP);
mainChangeToStage(STAGE_4MBMENU);
}
titleSetNextStage(STAGE_CITRAINING);
setNumPlayers(1);
titleSetNextMode(TITLEMODE_SKIP);
mainChangeToStage(STAGE_CITRAINING);
}
break;
case MENUROOT_COOPCONTINUE:
+4 -12
View File
@@ -22,9 +22,9 @@ s32 g_ModelMostType3 = 0;
s32 g_ModelMostModels = 0;
s32 g_ModelMostAnims = 0;
#define NUMTYPE1() (IS4MB() ? 0 : 35)
#define NUMTYPE2() (IS4MB() ? 24 : 25)
#define NUMTYPE3() (IS4MB() ? 0 : 20)
#define NUMTYPE1() 35
#define NUMTYPE2() 25
#define NUMTYPE3() 20
bool modelmgrCanSlotFitRwdata(struct model *modelslot, struct modelfiledata *modeldef)
{
@@ -98,8 +98,6 @@ void modelmgrPrintCounts(void)
osSyncPrintf("MOT : Type OA = %d/%d/%d/%d");
osSyncPrintf("MOT : g_ObjCount = %d");
osSyncPrintf("MOT : g_AnimCount = %d");
if (IS4MB());
}
struct model *modelmgrInstantiateModel(struct modelfiledata *modeldef, bool withanim)
@@ -168,7 +166,6 @@ struct model *modelmgrInstantiateModel(struct modelfiledata *modeldef, bool with
for (i = 0; i < NUMTYPE2(); i++) {
if (g_ModelRwdataBindings[1][i].model == NULL) {
osSyncPrintf("MotInst: Using cache entry type 2 %d (0x%08x) - Bytes=%d\n");
if (IS4MB());
rwdatas = g_ModelRwdataBindings[1][i].rwdata;
g_ModelRwdataBindings[1][i].model = model;
done = true;
@@ -183,7 +180,6 @@ struct model *modelmgrInstantiateModel(struct modelfiledata *modeldef, bool with
for (i = 0; i < NUMTYPE3(); i++) {
if (g_ModelRwdataBindings[2][i].model == NULL && g_ModelRwdataBindings[2][i].rwdata != NULL) {
osSyncPrintf("MotInst: Using cache entry type 3 %d (0x%08x) - Bytes=%d\n");
if (IS4MB());
rwdatas = g_ModelRwdataBindings[2][i].rwdata;
g_ModelRwdataBindings[2][i].model = model;
done = true;
@@ -207,11 +203,7 @@ struct model *modelmgrInstantiateModel(struct modelfiledata *modeldef, bool with
// empty
}
if (withanim) {
datalen = 256;
} else {
datalen = IS4MB() ? 52 : 256;
}
datalen = 256;
if (datalen < modeldef->rwdatalen) {
datalen = modeldef->rwdatalen;
+4 -4
View File
@@ -24,10 +24,10 @@
#include "data.h"
#include "types.h"
#define NUMTYPE1() (IS4MB() ? 0 : 35)
#define NUMTYPE2() (IS4MB() ? 24 : 25)
#define NUMTYPE3() (IS4MB() ? 0 : 20)
#define NUMSPARE() (IS4MB() ? 40 : 60)
#define NUMTYPE1() 35
#define NUMTYPE2() 25
#define NUMTYPE3() 20
#define NUMSPARE() 60
void modelmgrReset(void)
{
+1 -6
View File
@@ -3481,12 +3481,7 @@ void mpApplyConfig(struct mpconfigfull *config)
g_BotConfigsArray[i].difficulty = g_MpSimulantDifficultiesPerNumPlayers[i][0];
if (IS4MB()) {
// "ShockSim:%d"
sprintf(g_BotConfigsArray[i].base.name, langGet(L_MPWEAPONS_241), i + 1);
} else {
strcpy(g_BotConfigsArray[i].base.name, config->strings.aibotnames[i]);
}
strcpy(g_BotConfigsArray[i].base.name, config->strings.aibotnames[i]);
g_BotConfigsArray[i].base.mpheadnum = config->config.simulants[i].mpheadnum;
g_BotConfigsArray[i].base.mpbodynum = config->config.simulants[i].mpbodynum;
+8 -37
View File
@@ -675,10 +675,6 @@ s32 mpChallengesListHandler(s32 operation, struct menuitem *item, union handlerd
renderdata = data->type19.renderdata2;
challengeindex = data->list.unk04;
if (IS4MB()) {
maxplayers = 2;
}
x = renderdata->x + 10;
y = renderdata->y + 1;
@@ -1962,11 +1958,7 @@ s32 mpLoadSettingsMenuHandler(s32 operation, struct menuitem *item, union handle
}
if (item->param == 1) {
if (IS4MB()) {
func0f0f820c(&g_MpQuickGo4MbMenuDialog, MENUROOT_4MBMAINMENU);
} else {
func0f0f820c(&g_MpQuickGoMenuDialog, MENUROOT_MPSETUP);
}
func0f0f820c(&g_MpQuickGoMenuDialog, MENUROOT_MPSETUP);
}
break;
case MENUOP_GETSELECTEDINDEX:
@@ -2842,8 +2834,6 @@ s32 menuhandlerMpSimulantSlot(s32 operation, struct menuitem *item, union handle
if ((g_MpSetup.chrslots & (1 << (item->param + 4))) == 0) {
menuPushDialog(&g_MpAddSimulantMenuDialog);
} else if (IS4MB()) {
menuPushDialog(&g_MpEditSimulant4MbMenuDialog);
} else {
menuPushDialog(&g_MpEditSimulantMenuDialog);
}
@@ -4247,8 +4237,6 @@ s32 mpChallengesListMenuHandler(s32 operation, struct menuitem *item, union hand
if (item->param == 0) {
menuPushDialog(&g_MpConfirmChallengeViaListOrDetailsMenuDialog);
} else if (IS4MB()) {
menuPushDialog(&g_MpConfirmChallenge4MbMenuDialog);
} else {
menuPushDialog(&g_MpConfirmChallengeMenuDialog);
}
@@ -4270,10 +4258,6 @@ s32 mpChallengesListMenuHandler(s32 operation, struct menuitem *item, union hand
marginleft = 10;
maxchrs = 4;
if (IS4MB()) {
maxchrs = 2;
}
x = renderdata->x + 10;
y = renderdata->y + 1;
@@ -4494,11 +4478,7 @@ s32 menuhandler0017ef30(s32 operation, struct menuitem *item, union handlerdata
{
if (operation == MENUOP_SET) {
if (g_Vars.stagenum == STAGE_CITRAINING) {
if (IS4MB()) {
func0f0f820c(&g_CiMenuViaPauseMenuDialog, 2);
} else {
func0f0f820c(&g_CiMenuViaPcMenuDialog, 2);
}
func0f0f820c(&g_CiMenuViaPcMenuDialog, 2);
} else {
func0f0f820c(&g_SoloMissionPauseMenuDialog, 2);
}
@@ -4667,11 +4647,7 @@ void func0f17f428(void)
{
mpConfigureQuickTeamPlayers();
if (IS4MB()) {
func0f0f820c(&g_MpQuickGo4MbMenuDialog, MENUROOT_4MBMAINMENU);
} else {
func0f0f820c(&g_MpQuickGoMenuDialog, MENUROOT_MPSETUP);
}
func0f0f820c(&g_MpQuickGoMenuDialog, MENUROOT_MPSETUP);
}
s32 menuhandlerMpFinishedSetup(s32 operation, struct menuitem *item, union handlerdata *data)
@@ -5575,19 +5551,14 @@ void func0f17fcb0(s32 silent)
{
g_Menus[g_MpPlayerNum].playernum = g_MpPlayerNum;
if (IS4MB()) {
menuPushRootDialog(&g_AdvancedSetup4MbMenuDialog, MENUROOT_4MBMAINMENU);
func0f0f8300();
if (g_BossFile.locktype == MPLOCKTYPE_CHALLENGE) {
menuPushRootDialog(&g_MpChallengeListOrDetailsViaAdvChallengeMenuDialog, MENUROOT_MPSETUP);
} else {
if (g_BossFile.locktype == MPLOCKTYPE_CHALLENGE) {
menuPushRootDialog(&g_MpChallengeListOrDetailsViaAdvChallengeMenuDialog, MENUROOT_MPSETUP);
} else {
menuPushRootDialog(&g_MpAdvancedSetupMenuDialog, MENUROOT_MPSETUP);
}
func0f0f8300();
menuPushRootDialog(&g_MpAdvancedSetupMenuDialog, MENUROOT_MPSETUP);
}
func0f0f8300();
if (!silent) {
// Explosion sound
sndStart(var80095200, SFX_EXPLOSION_809A, NULL, -1, -1, -1, -1, -1);
-4
View File
@@ -230,10 +230,6 @@ void optionsSetHeadRoll(s32 mpchrnum, bool enable)
s32 optionsGetEffectiveScreenSize(void)
{
if (IS4MB()) {
return SCREENSIZE_FULL;
}
if (g_MenuData.root == MENUROOT_TRAINING) {
g_MpPlayerNum = 0;
+4 -9
View File
@@ -2423,15 +2423,10 @@ bool pakProbe(s8 device)
ret = osGbpakInit(&g_PiMesgQueue, PFS(device), device);
if (pakHandleResult(ret, device, false, LINE_3889)) {
if (IS4MB()) {
g_Paks[device].type = PAKTYPE_NONE;
g_Paks[device].unk010 = PAK010_22;
} else {
g_Paks[device].type = PAKTYPE_GAMEBOY;
g_Paks[device].unk010 = PAK010_08;
g_Paks[device].unk2b8_01 = false;
g_Paks[device].unk264++;
}
g_Paks[device].type = PAKTYPE_GAMEBOY;
g_Paks[device].unk010 = PAK010_08;
g_Paks[device].unk2b8_01 = false;
g_Paks[device].unk264++;
plugged = true;
} else if (ret == PAK_ERR1_NOPAK) {
+6 -29
View File
@@ -1030,8 +1030,7 @@ void playerSpawn(void)
bgunEquipWeapon2(HAND_LEFT, g_DefaultWeapons[HAND_LEFT]);
bgunEquipWeapon2(HAND_RIGHT, g_DefaultWeapons[HAND_RIGHT]);
if (g_Vars.currentplayer->model00d4 == NULL
&& (IS8MB() || g_Vars.fourmeg2player || g_MpAllChrPtrs[g_Vars.currentplayernum] == NULL)) {
if (g_Vars.currentplayer->model00d4 == NULL) {
playerTickChrBody();
}
}
@@ -1270,12 +1269,7 @@ void playerTickChrBody(void)
weaponmodelnum = playermgrGetModelOfWeapon(weaponnum);
if (IS4MB()) {
bodynum = BODY_DARK_COMBAT;
headnum = HEAD_DARK_COMBAT;
}
if (!g_Vars.mplayerisrunning || (IS4MB() && PLAYERCOUNT() == 1)) {
if (!g_Vars.mplayerisrunning) {
// 1 player
if (g_Vars.currentplayer->gunmem2 == NULL) {
if (!var8009dfc0 && bgun0f09e004(2)) {
@@ -1370,7 +1364,7 @@ void playerTickChrBody(void)
headnum = -1;
} else if (sp60) {
headfiledata = func0f18e57c(headnum, &headnum);
} else if (g_Vars.normmplayerisrunning && IS8MB()) {
} else if (g_Vars.normmplayerisrunning) {
g_HeadsAndBodies[headnum].filedata = modeldefLoadToNew(g_HeadsAndBodies[headnum].filenum);
headfiledata = g_HeadsAndBodies[headnum].filedata;
g_FileInfo[g_HeadsAndBodies[headnum].filenum].loadedsize = 0;
@@ -1460,7 +1454,7 @@ void playerTickChrBody(void)
void playerRemoveChrBody(void)
{
if (g_Vars.currentplayer->haschrbody) {
if (!g_Vars.mplayerisrunning || (IS4MB() && PLAYERCOUNT() == 1)) {
if (!g_Vars.mplayerisrunning) {
g_Vars.currentplayer->haschrbody = false;
chrRemove(g_Vars.currentplayer->prop, false);
g_Vars.currentplayer->model00d4 = NULL;
@@ -2626,19 +2620,6 @@ void playerTickExplode(void)
}
}
void playerResetLoResIf4Mb(void)
{
if (IS4MB()) {
g_ViModes[VIRES_LO].fbheight = 220;
g_ViModes[VIRES_LO].fulltop = 0;
g_ViModes[VIRES_LO].fullheight = 220;
g_ViModes[VIRES_LO].wideheight = 180;
g_ViModes[VIRES_LO].widetop = 20;
g_ViModes[VIRES_LO].cinemaheight = 136;
g_ViModes[VIRES_LO].cinematop = 42;
}
}
void playerSetHiResEnabled(bool enable)
{
g_HiResEnabled = enable;
@@ -2749,16 +2730,12 @@ s16 playerGetViewportHeight(void)
if (PLAYERCOUNT() >= 2 && !playerHasSharedViewport()) {
s16 tmp = g_ViModes[g_ViRes].fullheight;
if (IS4MB() && !g_Vars.fourmeg2player) {
height = tmp;
} else {
height = tmp / 2;
}
height = tmp / 2;
if (PLAYERCOUNT() == 2) {
if (optionsGetScreenSplit() == SCREENSPLIT_VERTICAL) {
height = tmp;
} else if (g_Vars.currentplayernum == 0 && IS8MB()) {
} else if (g_Vars.currentplayernum == 0) {
height--;
}
} else if (g_Vars.currentplayernum == 0 || g_Vars.currentplayernum == 1) {
-1
View File
@@ -124,7 +124,6 @@ void playerReset(void)
s32 bodynum;
s32 headnum;
playerResetLoResIf4Mb();
func0f18e558();
g_InCutscene = false;
+5 -5
View File
@@ -14294,7 +14294,7 @@ void ammotypeGetDeterminer(char *dst, s32 ammotype, s32 qty)
s32 playercount = PLAYERCOUNT();
s32 full = playercount <= 2
&& !(playercount == 2 && (optionsGetScreenSplit() == SCREENSPLIT_VERTICAL || IS4MB()));
&& !(playercount == 2 && optionsGetScreenSplit() == SCREENSPLIT_VERTICAL);
switch (ammotype) {
case AMMOTYPE_CLOAK:
@@ -14536,7 +14536,7 @@ void ammotypeGetPickupMessage(char *dst, s32 ammotype, s32 qty)
{
s32 playercount = PLAYERCOUNT();
s32 full = playercount <= 2
&& !(playercount == 2 && (optionsGetScreenSplit() == SCREENSPLIT_VERTICAL || IS4MB()));
&& !(playercount == 2 && optionsGetScreenSplit() == SCREENSPLIT_VERTICAL);
*dst = '\0';
@@ -14693,7 +14693,7 @@ void weaponGetPickupText(char *buffer, s32 weaponnum, bool dual)
{
s32 playercount = PLAYERCOUNT();
s32 full = playercount <= 2
&& !(playercount == 2 && (optionsGetScreenSplit() == SCREENSPLIT_VERTICAL || IS4MB()));
&& !(playercount == 2 && optionsGetScreenSplit() == SCREENSPLIT_VERTICAL);
s32 textid;
bool plural = false;
@@ -14975,7 +14975,7 @@ s32 propPickupByPlayer(struct prop *prop, bool showhudmsg)
if (text == NULL) {
s32 playercount = PLAYERCOUNT();
if (playercount <= 2 && !(playercount == 2 && (optionsGetScreenSplit() == SCREENSPLIT_VERTICAL || IS4MB()))) {
if (playercount <= 2 && !(playercount == 2 && optionsGetScreenSplit() == SCREENSPLIT_VERTICAL)) {
text = langGet(L_PROPOBJ_041); // "Picked up a shield."
} else {
text = langGet(L_PROPOBJ_042); // "A shield."
@@ -18102,7 +18102,7 @@ Gfx *countdownTimerRender(Gfx *gdl)
char *fmt = ":\n";
if (playercount == 2) {
if (IS4MB() || (optionsGetScreenSplit() != SCREENSPLIT_VERTICAL && g_Vars.currentplayernum == 0)) {
if (optionsGetScreenSplit() != SCREENSPLIT_VERTICAL && g_Vars.currentplayernum == 0) {
y += 10;
} else {
y += 2;
+11 -11
View File
@@ -43,7 +43,7 @@ bool func0f092610(struct prop *prop, s32 arg1)
{
s32 i;
for (i = 0; i < (IS4MB() ? 30 : 40); i++) {
for (i = 0; i < 40; i++) {
if ((g_AudioChannels[i].flags & AUDIOCHANNELFLAG_IDLE) == 0
&& prop == g_AudioChannels[i].prop
&& (arg1 == g_AudioChannels[i].unk28 || arg1 == 1)) {
@@ -58,7 +58,7 @@ void func0f0926bc(struct prop *prop, s32 arg1, u16 arg2)
{
s32 i;
for (i = 0; i < (IS4MB() ? 30 : 40); i++) {
for (i = 0; i < 40; i++) {
struct audiochannel *channel = &g_AudioChannels[i];
if ((channel->flags & AUDIOCHANNELFLAG_IDLE) == 0 && channel->prop == prop) {
@@ -121,7 +121,7 @@ void propsnd0f09294c(struct prop *prop, s16 soundnum, s32 arg2)
if (propsnd0f0946b0(&prop->pos, 400, 2500, 3000, prop->rooms, soundnum, 0x7fff, 0)) {
// Return if this prop is already playing a sound
for (i = 8; i < (IS4MB() ? 30 : 40); i++) {
for (i = 8; i < 40; i++) {
if ((g_AudioChannels[i].flags & AUDIOCHANNELFLAG_IDLE) == 0
&& g_AudioChannels[i].prop == prop
&& g_AudioChannels[i].unk28 == arg2) {
@@ -422,7 +422,7 @@ void propsndTick(void)
s32 count = 0;
s32 i;
for (i = 0; i < (IS4MB() ? 30 : 40); i++) {
for (i = 0; i < 40; i++) {
struct audiochannel *channel = &g_AudioChannels[i];
if ((channel->flags & AUDIOCHANNELFLAG_IDLE) == 0) {
@@ -441,7 +441,7 @@ void func0f093630(struct prop *prop, f32 arg1, s32 arg2)
OSPri prevpri;
s32 i;
for (i = 0; i < (IS4MB() ? 30 : 40); i++) {
for (i = 0; i < 40; i++) {
if ((g_AudioChannels[i].flags & AUDIOCHANNELFLAG_IDLE) == 0 && g_AudioChannels[i].prop == prop) {
g_AudioChannels[i].unk44 = arg1;
@@ -464,7 +464,7 @@ void func0f093790(struct prop *prop, s32 arg1)
OSPri prevpri;
s32 i;
for (i = 0; i < (IS4MB() ? 30 : 40); i++) {
for (i = 0; i < 40; i++) {
if ((g_AudioChannels[i].flags & AUDIOCHANNELFLAG_IDLE) == 0 && prop == g_AudioChannels[i].prop) {
if (arg1 > 100) {
arg1 = 100;
@@ -488,7 +488,7 @@ void func0f0938ec(struct prop *prop)
s32 bestindex = -1;
s32 i;
for (i = 0; i < (IS4MB() ? 30 : 40); i++) {
for (i = 0; i < 40; i++) {
struct audiochannel *channel = &g_AudioChannels[i];
if ((channel->flags & AUDIOCHANNELFLAG_IDLE) == 0
@@ -548,7 +548,7 @@ s16 propsnd0f0939f8(
return -1;
}
for (i = 8; i < (IS4MB() ? 30 : 40); i++) {
for (i = 8; i < 40; i++) {
if (g_AudioChannels[i].flags & AUDIOCHANNELFLAG_IDLE) {
channel = &g_AudioChannels[i];
channel->channelnum = i;
@@ -776,7 +776,7 @@ void audioMuteChannel(s32 channelnum)
if (channelnum == 10) {
s32 i;
for (i = 8; i < (IS4MB() ? 30 : 40); i++) {
for (i = 8; i < 40; i++) {
if ((g_AudioChannels[i].flags & AUDIOCHANNELFLAG_IDLE) == 0
&& (g_AudioChannels[i].flags & AUDIOCHANNELFLAG_0080)) {
func0f092a98(i);
@@ -796,7 +796,7 @@ bool audioIsChannelIdle(s32 channelnum)
if (channelnum == 10) {
s32 i;
for (i = 8; i < (IS4MB() ? 30 : 40); i++) {
for (i = 8; i < 40; i++) {
if (g_AudioChannels[i].flags & AUDIOCHANNELFLAG_0080) {
return false;
}
@@ -1225,7 +1225,7 @@ s32 propsndGetDuration60(s32 channelnum)
{
struct audiochannel *channel = &g_AudioChannels[channelnum];
if (channelnum >= 0 && channelnum < (IS4MB() ? 30 : 40)
if (channelnum >= 0 && channelnum < 40
&& (channel->flags & AUDIOCHANNELFLAG_IDLE) == 0
&& (channel->flags & AUDIOCHANNELFLAG_ISMP3)) {
union soundnumhack soundnum;
+2 -2
View File
@@ -9,9 +9,9 @@ void propsndReset(void)
{
s32 i;
g_AudioChannels = mempAlloc(ALIGN16((IS4MB() ? 30 : 40) * sizeof(struct audiochannel)), MEMPOOL_STAGE);
g_AudioChannels = mempAlloc(ALIGN16(40 * sizeof(struct audiochannel)), MEMPOOL_STAGE);
for (i = 0; i < (IS4MB() ? 30 : 40); i++) {
for (i = 0; i < 40; i++) {
g_AudioChannels[i].flags = AUDIOCHANNELFLAG_IDLE;
g_AudioChannels[i].audiohandle = NULL;
g_AudioChannels[i].unk4c = -1;
+1 -1
View File
@@ -10,7 +10,7 @@ void propsndStop(void)
{
s32 i;
for (i = 0; i < (IS4MB() ? 30 : 40); i++) {
for (i = 0; i < 40; i++) {
if (g_AudioChannels[i].flags & AUDIOCHANNELFLAG_ISMP3) {
snd0000fbc4(g_AudioChannels[i].soundnum26);
g_AudioChannels[i].flags &= ~AUDIOCHANNELFLAG_ISMP3;
+2 -8
View File
@@ -285,14 +285,10 @@ Gfx *radarRender(Gfx *gdl)
g_RadarX = (viGetViewLeft() + viGetViewWidth()) / g_ScaleX - 41;
if (playercount == 2) {
if (IS4MB() || optionsGetScreenSplit() == SCREENSPLIT_VERTICAL) {
if (optionsGetScreenSplit() == SCREENSPLIT_VERTICAL) {
if (playernum == 0) {
g_RadarX += 16;
}
if (IS4MB()) {
g_RadarX -= 4;
}
} else {
g_RadarX -= 7;
}
@@ -307,9 +303,7 @@ Gfx *radarRender(Gfx *gdl)
g_RadarY = viGetViewTop() + (PAL ? 29 : 26);
if (playercount == 2) {
if (IS4MB()) {
g_RadarY -= 6;
} else if (optionsGetScreenSplit() != SCREENSPLIT_VERTICAL && playernum == 1) {
if (optionsGetScreenSplit() != SCREENSPLIT_VERTICAL && playernum == 1) {
g_RadarY -= 8;
}
} else if (playercount >= 3) {
+3 -9
View File
@@ -186,8 +186,8 @@ void propsReset(void)
g_MaxWeaponSlots = 50;
g_MaxAmmoCrates = 20;
g_MaxDebrisSlots = 15;
g_MaxProjectiles = IS4MB() ? 20 : 100;
g_MaxEmbedments = IS4MB() ? 40 : 80;
g_MaxProjectiles = 100;
g_MaxEmbedments = 80;
if (g_Vars.stagenum >= STAGE_TITLE) {
g_MaxWeaponSlots = 0;
@@ -1324,13 +1324,7 @@ void setupLoadFiles(s32 stagenum)
modelmgrAllocateSlots(0, 0);
}
if (IS4MB()) {
extra = 40;
} else {
extra = 60;
}
if (IS4MB());
extra = 60;
g_Vars.maxprops = numobjs + numchrs + extra + 40;
}
-4
View File
@@ -11,10 +11,6 @@ void shardsReset(void)
g_MaxShards = 200 / PLAYERCOUNT();
if (IS4MB()) {
g_MaxShards = g_MaxShards / 2;
}
if (g_Vars.stagenum >= STAGE_TITLE) {
g_MaxShards = 0;
}
+1 -1
View File
@@ -10,7 +10,7 @@ void smokeReset(void)
s32 i;
s32 j;
g_MaxSmokes = IS4MB() ? 10 : 20;
g_MaxSmokes = 20;
if (g_Vars.stagenum >= STAGE_TITLE) {
g_MaxSmokes = 0;
-10
View File
@@ -214,11 +214,6 @@ s32 texInflateZlib(u8 *src, u8 *dst, s32 arg2, s32 forcenumimages, struct texpoo
texSetBitstring(rzipGetSomething());
if (arg2 == 1) {
if (IS4MB() && j == 2 && !foundthething) {
pool->rightpos->maxlod = j;
foundthething = true;
}
if (totalbytesout + imagebytesout > 0x800 || foundthething) {
if (!foundthething) {
pool->rightpos->maxlod = j;
@@ -254,11 +249,6 @@ s32 texInflateZlib(u8 *src, u8 *dst, s32 arg2, s32 forcenumimages, struct texpoo
for (j = 1; j < forcenumimages; j++) {
imagebytesout = texShrinkPaletted(start, end, tmpwidth, tmpheight, format, palette, numcolours);
if (IS4MB() && j == 2) {
pool->rightpos->maxlod = j;
break;
}
if (totalbytesout + imagebytesout > 0x800) {
pool->rightpos->maxlod = j;
break;
-30
View File
@@ -88,34 +88,4 @@ void texReset(void)
texLoadFromDisplayList(g_TexGdl3, 0, 0);
stage = mainGetStageNum();
if (IS4MB() && stage != STAGE_TITLE && stage != STAGE_CITRAINING && stage != STAGE_4MBMENU) {
for (i = 0; i < ARRAYCOUNT(g_TcWallhitConfigs); i++) {
texLoadFromConfig(&g_TexWallhitConfigs[i]);
}
for (i = 0; i < ARRAYCOUNT(g_TcBeamConfigs); i++) {
texLoadFromConfig(&g_TexBeamConfigs[i]);
}
for (i = 0; i < ARRAYCOUNT(g_TcWaterConfigs); i++) {
texLoadFromConfig(&g_TexWaterConfigs[i]);
}
for (i = 0; i < ARRAYCOUNT(g_TcGroup06Configs); i++) {
texLoadFromConfig(&g_TexShadowConfigs[i]);
}
for (i = 0; i < ARRAYCOUNT(g_TcShieldConfigs); i++) {
texLoadFromConfig(&g_TexShieldConfigs[i]);
}
for (i = 0; i < ARRAYCOUNT(g_TcRadarConfigs); i++) {
texLoadFromConfig(&g_TexRadarConfigs[i]);
}
for (i = 0; i < ARRAYCOUNT(g_TcSparkConfigs); i++) {
texLoadFromConfig(&g_TexSparkConfigs[i]);
}
}
}
+3 -16
View File
@@ -307,11 +307,7 @@ Gfx *titleRenderLegal(Gfx *gdl)
colour = 0xffffffff;
if (elem->textid == L_OPTIONS_074 || elem->textid == L_OPTIONS_073) {
if (IS4MB()) {
elem->textid = L_OPTIONS_074;
} else {
elem->textid = L_OPTIONS_073;
}
elem->textid = L_OPTIONS_073;
}
break;
case LEGALELEMENTTYPE_WHITETEXTSM:
@@ -509,7 +505,7 @@ void titleTickPdLogo(void)
if (g_PdLogoTriggerExit) {
// Exiting due to player not pressing anything
if (g_AltTitleEnabled && IS8MB()) {
if (g_AltTitleEnabled) {
g_TitleMode = TITLEMODE_SKIP;
creditsRequestAltTitle();
g_TitleNextStage = STAGE_CREDITS; // for alt title screen
@@ -1524,7 +1520,7 @@ void titleInitRareLogo(void)
musicQueueStopAllEvent();
joy00014810(false);
if (!g_IsTitleDemo && IS8MB()) {
if (!g_IsTitleDemo) {
g_IsTitleDemo = true;
}
}
@@ -1788,15 +1784,6 @@ void titleInitSkip(void)
g_IsTitleDemo++;
}
if (IS4MB()) {
g_TitleNextStage = STAGE_4MBMENU;
viSetAspect(PAL ? 1.7316017150879f : 1.4545454978943f);
viSetSize(320, 220);
viSetBufSize(320, 220);
playermgrSetViewSize(320, 220);
viSetViewSize(320, 220);
}
mainChangeToStage(g_TitleNextStage);
g_Vars.bondplayernum = 0;
-7
View File
@@ -8,11 +8,4 @@
void vmPrintStatsIfEnabled(void)
{
char buffer[80];
if (g_Is4Mb) {
g_VmNumTlbMisses = 0;
g_VmNumPageMisses = 0;
g_VmNumPageReplaces = 0;
}
}
+1 -3
View File
@@ -33,9 +33,7 @@ void wallhitReset(void)
s32 type = 2;
s32 i;
if (IS4MB()) {
type = 0;
} else if ((g_Vars.coopplayernum >= 0 || g_Vars.antiplayernum >= 0) && PLAYERCOUNT() == 2) {
if ((g_Vars.coopplayernum >= 0 || g_Vars.antiplayernum >= 0) && PLAYERCOUNT() == 2) {
type = 1;
} else if (PLAYERCOUNT() >= 2) {
type = 0;
-1
View File
@@ -19,7 +19,6 @@ extern OSPiHandle LeoDiskHandle;
extern OSTimer var80090ab0;
extern OSMesgQueue g_GbpakMesgQueue;
extern OSMesg var80090ae8;
extern u8 g_Is4Mb;
extern u32 g_VmNumTlbMisses;
extern u32 g_VmNumPageMisses;
extern u32 g_VmNumPageReplaces;
-2
View File
@@ -31,8 +31,6 @@
#define CHRRACE(chr) (chr ? chr->race : RACE_HUMAN)
#define CRASH() *(u8 *)0 = 69
#define CYCLES_PER_FRAME ((s32) OS_CPU_COUNTER / (PAL ? 50 : 60))
#define IS4MB() 0
#define IS8MB() 1
#define LINEHEIGHT (VERSION == VERSION_JPN_FINAL ? 14 : 11)
#define MIXCOLOUR(dialog, property) dialog->transitionfrac < 0.0f ? g_MenuColourPalettes[dialog->type].property : colourBlend(g_MenuColourPalettes[dialog->type2].property, g_MenuColourPalettes[dialog->type].property, dialog->colourweight)
#define MPCHR(index) ((index) < 4 ? &g_PlayerConfigsArray[index].base : &g_BotConfigsArray[(index) - 4].base)
-4
View File
@@ -129,11 +129,7 @@ s32 admaExec(s32 offset, s32 len, void *state)
*/
void *admaNew(struct admastate **state)
{
#if PAL
s32 max = ADMA_MAX_ITEMS;
#else
s32 max = IS4MB() ? ADMA_MAX_ITEMS - 20 : ADMA_MAX_ITEMS;
#endif
s32 i;
if (!g_AdmaState.initialised) {
+2 -14
View File
@@ -61,10 +61,6 @@ void amgrCreate(ALSynConfig *config)
freqpertick = config->outputRate / 30.0f;
if (IS4MB()) {
freqpertick *= 0.5f;
}
g_AmgrFreqPerTick = (s32)freqpertick;
if ((f32)g_AmgrFreqPerTick < freqpertick) {
@@ -83,10 +79,6 @@ void amgrCreate(ALSynConfig *config)
var800918ec = 2000;
if (IS4MB()) {
var800918ec >>= 1;
}
for (i = 0; i < ARRAYCOUNT(g_AudioManager.ACMDList); i++) {
g_AudioManager.ACMDList[i] = alHeapAlloc(&g_SndHeap, 1, var800918ec * sizeof(Acmd));
}
@@ -115,11 +107,11 @@ void amgrCreate(ALSynConfig *config)
s32 sp068[] = { 0x00000001, 0x00000a50, 0x00000000, 0x00000898, 0x00003334, 0x00000000, 0x00007335, 0x00000000, 0x00000000, 0x00000000 };
s32 sp040[] = { 0x00000001, 0x00000148, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 };
config->params[0] = (s32 *) (IS4MB() ? sp1c0 : sp090);
config->params[0] = (s32 *) sp090;
if (g_SndMaxFxBusses >= 2) {
for (i = 1; i < g_SndMaxFxBusses; i++) {
config->params[i] = (s32 *) (IS4MB() ? sp198 : sp068);
config->params[i] = (s32 *) sp068;
}
}
}
@@ -165,11 +157,7 @@ void amgrMain(void *arg)
static u32 var8005d514 = 1;
#if PAL
osScAddClient(&g_Sched, &var800918d0, &g_AudioManager.audioFrameMsgQ, true);
#else
osScAddClient(&g_Sched, &var800918d0, &g_AudioManager.audioFrameMsgQ, !IS4MB());
#endif
while (!done) {
osRecvMesg(&g_AudioManager.audioFrameMsgQ, (OSMesg *) &msg, OS_MESG_BLOCK);
-4
View File
@@ -457,10 +457,6 @@ void mainLoop(void)
}
}
if (g_StageNum == STAGE_CITRAINING && IS4MB()) {
g_StageNum = STAGE_4MBMENU;
}
rngSetSeed(osGetCount());
// Outer loop - this is infinite because ending is never changed
+1 -1
View File
@@ -300,7 +300,7 @@ void *memaAlloc(u32 size)
best = curr;
// Stop looking if the space is small enough
if (diff < 64 || (IS8MB() && diff < size / 4)) {
if (diff < 64 || diff < size / 4) {
break;
}
}
+2 -10
View File
@@ -112,11 +112,7 @@ u32 mempGetStageFree(void)
{
u32 free;
if (IS4MB()) {
free = g_MempOnboardPools[MEMPOOL_STAGE].rightpos - g_MempOnboardPools[MEMPOOL_STAGE].leftpos;
} else {
free = g_MempExpansionPools[MEMPOOL_STAGE].rightpos - g_MempExpansionPools[MEMPOOL_STAGE].leftpos;
}
free = g_MempExpansionPools[MEMPOOL_STAGE].rightpos - g_MempExpansionPools[MEMPOOL_STAGE].leftpos;
return free;
}
@@ -125,11 +121,7 @@ void *mempGetNextStageAllocation(void)
{
void *next;
if (IS4MB()) {
next = g_MempOnboardPools[MEMPOOL_STAGE].leftpos;
} else {
next = g_MempExpansionPools[MEMPOOL_STAGE].leftpos;
}
next = g_MempExpansionPools[MEMPOOL_STAGE].leftpos;
return next;
}
-4
View File
@@ -67,10 +67,6 @@ void rdpInit(void)
{
s32 size = 0x10000;
if (IS4MB()) {
size = 0x8000;
}
g_RdpOutBufferStart = mempAlloc(size, MEMPOOL_PERMANENT);
g_RdpOutBufferEnd = (u16 *)((u32)g_RdpOutBufferStart + size);
}
+2 -4
View File
@@ -282,7 +282,7 @@ void __scHandleRetrace(OSSched *sc)
osSetTimer(&g_SchedRspTimer, 280000, 0, amgrGetFrameMesgQueue(), &g_SchedRspMsg);
}
#else
if (!g_Resetting && ((sc->frameCount & 1) || IS4MB())) {
if (!g_Resetting && (sc->frameCount & 1)) {
osStopTimer(&g_SchedRspTimer);
osSetTimer(&g_SchedRspTimer, 280000, 0, amgrGetFrameMesgQueue(), &g_SchedRspMsg);
}
@@ -778,9 +778,7 @@ s32 __scSchedule(OSSched *sc, OSScTask **sp, OSScTask **dp, s32 availRCP)
void schedConsiderScreenshot(void)
{
if (g_MenuData.screenshottimer == 1) {
if (IS8MB()) {
menugfxCreateBlur();
}
menugfxCreateBlur();
g_MenuData.screenshottimer = 0;
}
+5 -20
View File
@@ -1251,11 +1251,7 @@ void seqInit(struct seqinstance *seq)
func00030c98(&config);
if (IS4MB()) {
g_SeqBufferSize = 0x3800;
} else {
g_SeqBufferSize = 0x4800;
}
g_SeqBufferSize = 0x4800;
seq->data = alHeapAlloc(&g_SndHeap, 1, g_SeqBufferSize);
seq->seqp = alHeapAlloc(&g_SndHeap, 1, sizeof(N_ALCSPlayer));
@@ -1290,22 +1286,11 @@ void sndInit(void)
g_Vars.langfilteron = false;
if (IS4MB()) {
g_SndMaxFxBusses = 1;
heaplen -= 1024 * (PAL ? 6 : 38);
heaplen -= 1024 * 137;
heaplen -= 1024 * 12;
heaplen -= 1024 * 23;
g_SndMp3Enabled = true;
g_SndMaxFxBusses = 2;
if (argFindByPrefix(1, "-nomp3")) {
g_SndMp3Enabled = false;
} else {
g_SndMp3Enabled = true;
g_SndMaxFxBusses = 2;
if (argFindByPrefix(1, "-nomp3")) {
g_SndMp3Enabled = false;
}
}
if (!g_SndDisabled) {
@@ -1911,7 +1896,7 @@ struct sndstate *sndStart(s32 arg0, s16 sound, struct sndstate **handle, s32 arg
}
if (sp40.id < (u32)g_NumSounds) {
return func00033820(arg0, sp40.id, sp3a, sp3d & 0x7f, sp34, sp3f, IS4MB() ? 0 : sp3e, handle);
return func00033820(arg0, sp40.id, sp3a, sp3d & 0x7f, sp34, sp3f, sp3e, handle);
}
return NULL;
+6 -29
View File
@@ -74,16 +74,6 @@ void viConfigureForLogos(void)
var8005d588 = 0;
var8005d58c = 0;
if (IS4MB()) {
g_ViDataArray[0].y = 220;
g_ViDataArray[0].bufy = 220;
g_ViDataArray[0].viewy = 220;
g_ViDataArray[1].y = 220;
g_ViDataArray[1].bufy = 220;
g_ViDataArray[1].viewy = 220;
}
}
/**
@@ -172,24 +162,16 @@ void viReset(s32 stagenum)
g_Vars.fourmeg2player = false;
if (stagenum == STAGE_TITLE) {
if (IS4MB()) {
viSetMode(VIMODE_HI);
fbsize = 640 * 440 * 2;
} else {
viSetMode(VIMODE_HI);
fbsize = g_ViModeWidths[2] * g_ViModeHeights[2] * 2;
}
viSetMode(VIMODE_HI);
fbsize = g_ViModeWidths[2] * g_ViModeHeights[2] * 2;
} else {
viSetMode(VIMODE_LO);
if (1);
fbsize = IS4MB() ? 320 * 220 * 2 : 320 * 220 * 4;
fbsize = 640 * 220 * 2;
if (IS4MB() && PLAYERCOUNT() == 2) {
fbsize = 320 * 220;
g_Vars.fourmeg2player = true;
} else if ((g_Vars.coopplayernum >= 0 || g_Vars.antiplayernum >= 0) && PLAYERCOUNT() == 2) {
if ((g_Vars.coopplayernum >= 0 || g_Vars.antiplayernum >= 0) && PLAYERCOUNT() == 2) {
fbsize = 320 * 220 * 2;
}
}
@@ -314,13 +296,8 @@ void viUpdateMode(void)
var8008dcc0[g_ViSlot].fldRegs[1].origin = g_ViBackData->bufx * 2;
// 324
if (IS4MB()) {
var8008dcc0[g_ViSlot].fldRegs[0].yScale = 1024;
var8008dcc0[g_ViSlot].fldRegs[1].yScale = 1024;
} else {
var8008dcc0[g_ViSlot].fldRegs[0].yScale = g_ViBackData->bufy * 2048 / 440;
var8008dcc0[g_ViSlot].fldRegs[1].yScale = g_ViBackData->bufy * 2048 / 440;
}
var8008dcc0[g_ViSlot].fldRegs[0].yScale = g_ViBackData->bufy * 2048 / 440;
var8008dcc0[g_ViSlot].fldRegs[1].yScale = g_ViBackData->bufy * 2048 / 440;
// 3ac
reg = var8008dcc0[g_ViSlot].comRegs.hStart;
-3
View File
@@ -67,7 +67,6 @@
* mappings in the TLB are static.
*/
u8 g_Is4Mb;
u32 g_VmNumTlbMisses;
u32 g_VmNumPageMisses;
u32 g_VmNumPageReplaces;
@@ -179,8 +178,6 @@ void vmInit(void)
while (1);
} else {
// Expansion pak is being used
g_Is4Mb = false;
t8 = (u32)((&_gameSegmentEnd - &_gameSegmentStart) + (PAGE_SIZE - 1)) / PAGE_SIZE;
s7 = (u8 *)(STACK_START - 8);