Rename active menu files and symbols

This commit is contained in:
Ryan Dwyer
2021-01-02 08:29:36 +10:00
parent f575e378f1
commit 1884a34a13
31 changed files with 876 additions and 838 deletions
+2 -1
View File
@@ -55,6 +55,7 @@
build/ROMID/game/title.o (section); \
build/ROMID/game/game_01afc0.o (section); \
build/ROMID/game/game_01b0a0.o (section); \
build/ROMID/game/activemenu/tick.o (section); \
build/ROMID/game/game_01bea0.o (section); \
build/ROMID/game/weathertick.o (section); \
build/ROMID/game/game_01d860.o (section); \
@@ -108,7 +109,7 @@
build/ROMID/game/game_0e0770.o (section); \
build/ROMID/game/menu/items.o (section); \
build/ROMID/game/game_0f09f0.o (section); \
build/ROMID/game/game_0fd660.o (section); \
build/ROMID/game/activemenu/activemenu.o (section); \
build/ROMID/game/game_102230.o (section); \
build/ROMID/game/game_102240.o (section); \
build/ROMID/game/cheats.o (section); \
+15 -15
View File
@@ -849,7 +849,7 @@ u8 func1002_devicetraining_camspy[] = {
beginloop(0x8e)
if_stage_flag_eq(STAGEFLAG_DEVICE_ABORTING, TRUE, /*goto*/ 0x90)
if_chr_has_weapon_equipped(CHR_BOND, WEAPON_CAMSPY, /*goto*/ 0x2f)
if_player_using_device(CHR_BOND, WEAPON_CAMSPY, /*goto*/ 0x2f)
if_timer_gt(1200, /*goto*/ 0x06)
endloop(0x8e)
@@ -962,7 +962,7 @@ u8 func1003_devicetraining_nightvision[] = {
beginloop(0x8e)
if_stage_flag_eq(STAGEFLAG_DEVICE_ABORTING, TRUE, /*goto*/ 0x90)
if_chr_has_weapon_equipped(CHR_BOND, WEAPON_NIGHTVISION, /*goto*/ 0x2f)
if_player_using_device(CHR_BOND, WEAPON_NIGHTVISION, /*goto*/ 0x2f)
if_timer_gt(1200, /*goto*/ 0x06)
endloop(0x8e)
@@ -1243,7 +1243,7 @@ u8 func1005_devicetraining_xray[] = {
restart_timer
beginloop(0x86)
if_chr_has_weapon_equipped(CHR_BOND, WEAPON_XRAYSCANNER, /*goto*/ 0x2f)
if_player_using_device(CHR_BOND, WEAPON_XRAYSCANNER, /*goto*/ 0x2f)
set_object_flag(0x38, OBJFLAG_CANNOT_ACTIVATE)
set_object_flag(0x39, OBJFLAG_CANNOT_ACTIVATE)
goto_next(0x30)
@@ -1276,7 +1276,7 @@ u8 func1005_devicetraining_xray[] = {
beginloop(0x8e)
if_stage_flag_eq(STAGEFLAG_DEVICE_ABORTING, TRUE, /*goto*/ 0x90)
if_chr_has_weapon_equipped(CHR_BOND, WEAPON_XRAYSCANNER, /*goto*/ 0x2f)
if_player_using_device(CHR_BOND, WEAPON_XRAYSCANNER, /*goto*/ 0x2f)
if_timer_gt(1200, /*goto*/ 0x06)
endloop(0x8e)
@@ -1297,7 +1297,7 @@ u8 func1005_devicetraining_xray[] = {
label(0x57)
set_stage_flag(STAGEFLAG_TRIGGER_CANNOTEXIT_MSG)
label(0x59)
if_chr_has_weapon_equipped(CHR_BOND, WEAPON_XRAYSCANNER, /*goto*/ 0x2f)
if_player_using_device(CHR_BOND, WEAPON_XRAYSCANNER, /*goto*/ 0x2f)
set_object_flag(0x38, OBJFLAG_CANNOT_ACTIVATE)
set_object_flag(0x39, OBJFLAG_CANNOT_ACTIVATE)
goto_next(0x30)
@@ -1596,7 +1596,7 @@ u8 func1007_devicetrainign_ir[] = {
restart_timer
beginloop(0x86)
if_chr_has_weapon_equipped(CHR_BOND, WEAPON_IRSCANNER, /*goto*/ 0x2f)
if_player_using_device(CHR_BOND, WEAPON_IRSCANNER, /*goto*/ 0x2f)
set_object_flag(0x37, OBJFLAG_CANNOT_ACTIVATE)
goto_next(0x30)
label(0x2f)
@@ -1620,12 +1620,12 @@ u8 func1007_devicetrainign_ir[] = {
label(0x2f)
label(0x8d)
remove_hudmsgs
if_chr_has_weapon_equipped(CHR_BOND, WEAPON_IRSCANNER, /*goto*/ 0x2f)
if_player_using_device(CHR_BOND, WEAPON_IRSCANNER, /*goto*/ 0x2f)
show_hudmsg_middle(0x01, COLOR_04_ORANGE, L_DISH(62)) // "Select the IR Scanner. - Hold A Button. - Use Control Stick to change selection. - Highlight IR Scanner and release A Button."
restart_timer
beginloop(0x8e)
if_chr_has_weapon_equipped(CHR_BOND, WEAPON_IRSCANNER, /*goto*/ 0x2f)
if_player_using_device(CHR_BOND, WEAPON_IRSCANNER, /*goto*/ 0x2f)
set_object_flag(0x37, OBJFLAG_CANNOT_ACTIVATE)
goto_next(0x30)
@@ -1633,7 +1633,7 @@ u8 func1007_devicetrainign_ir[] = {
unset_object_flag(0x37, OBJFLAG_CANNOT_ACTIVATE)
label(0x30)
if_stage_flag_eq(STAGEFLAG_DEVICE_ABORTING, TRUE, /*goto*/ 0x90)
if_chr_has_weapon_equipped(CHR_BOND, WEAPON_IRSCANNER, /*goto*/ 0x2f)
if_player_using_device(CHR_BOND, WEAPON_IRSCANNER, /*goto*/ 0x2f)
if_timer_gt(1200, /*goto*/ 0x06)
endloop(0x8e)
@@ -1645,7 +1645,7 @@ u8 func1007_devicetrainign_ir[] = {
show_hudmsg_middle(0x01, COLOR_04_ORANGE, L_DISH(33)) // "Locate secret door using IR Scanner."
beginloop(0x82)
if_chr_has_weapon_equipped(CHR_BOND, WEAPON_IRSCANNER, /*goto*/ 0x2f)
if_player_using_device(CHR_BOND, WEAPON_IRSCANNER, /*goto*/ 0x2f)
set_object_flag(0x37, OBJFLAG_CANNOT_ACTIVATE)
goto_next(0x30)
label(0x2f)
@@ -1753,13 +1753,13 @@ u8 func1008_devicetraining_rtracker[] = {
label(0x2f)
label(0x8d)
remove_hudmsgs
if_chr_has_weapon_equipped(CHR_BOND, WEAPON_RTRACKER, /*goto*/ 0x2f)
if_player_using_device(CHR_BOND, WEAPON_RTRACKER, /*goto*/ 0x2f)
show_hudmsg_middle(0x01, COLOR_04_ORANGE, L_DISH(63)) // "Select the Tracker. - Hold A Button. - Use Control Stick to change selection. - Highlight Tracker and release A Button."
restart_timer
beginloop(0x8e)
if_stage_flag_eq(STAGEFLAG_DEVICE_ABORTING, TRUE, /*goto*/ 0x90)
if_chr_has_weapon_equipped(CHR_BOND, WEAPON_RTRACKER, /*goto*/ 0x2f)
if_player_using_device(CHR_BOND, WEAPON_RTRACKER, /*goto*/ 0x2f)
if_timer_gt(1200, /*goto*/ 0x06)
endloop(0x8e)
@@ -1887,7 +1887,7 @@ u8 func1009_devicetraining_cloak[] = {
set_ailist(CHR_CARRINGTON, AILIST_CARRINGTON_CLOAK)
label(0x8d)
remove_hudmsgs
if_chr_has_weapon_equipped(CHR_BOND, WEAPON_CLOAKINGDEVICE, /*goto*/ 0x2f)
if_player_using_device(CHR_BOND, WEAPON_CLOAKINGDEVICE, /*goto*/ 0x2f)
show_hudmsg_middle(0x01, COLOR_04_ORANGE, L_DISH(64)) // "Select the Cloaking Device. - Hold A Button. - Use Control Stick to change selection. - Highlight Device and release A Button."
restart_timer
@@ -1895,7 +1895,7 @@ u8 func1009_devicetraining_cloak[] = {
if_stage_flag_eq(STAGEFLAG_CLOAK_COMPLETE, TRUE, /*goto*/ 0x09)
if_stage_flag_eq(STAGEFLAG_CLOAK_FAILED, TRUE, /*goto*/ 0x0a)
if_stage_flag_eq(STAGEFLAG_DEVICE_ABORTING, TRUE, /*goto*/ 0x90)
if_chr_has_weapon_equipped(CHR_BOND, WEAPON_CLOAKINGDEVICE, /*goto*/ 0x2f)
if_player_using_device(CHR_BOND, WEAPON_CLOAKINGDEVICE, /*goto*/ 0x2f)
if_timer_gt(1200, /*goto*/ 0x06)
endloop(0x8e)
@@ -3466,7 +3466,7 @@ u8 func1017_msg_terminals[] = {
u8 func1018_lightswitch[] = {
beginloop(0x04)
if_stage_flag_eq(STAGEFLAG_TRIGGER_NIGHTVISION, FALSE, /*goto*/ 0x2f)
if_chr_has_weapon_equipped(CHR_BOND, WEAPON_NIGHTVISION, /*goto*/ 0x2f)
if_player_using_device(CHR_BOND, WEAPON_NIGHTVISION, /*goto*/ 0x2f)
set_object_flag2(OBJ_LIGHTSWITCH, OBJFLAG2_INVISIBLE)
reloop(0x04)
+1 -1
View File
@@ -3499,7 +3499,7 @@ u8 func1021_xray_scanning[] = {
// @bug? In co-op, the player wearing the xray may be the player who is
// not looking at the alien.
chr_toggle_p1p2(CHR_SELF)
if_chr_has_weapon_equipped(CHR_P1P2, WEAPON_XRAYSCANNER, /*goto*/ 0x06)
if_player_using_device(CHR_P1P2, WEAPON_XRAYSCANNER, /*goto*/ 0x06)
reloop(0x04)
label(0x06)
File diff suppressed because it is too large Load Diff
+411
View File
@@ -0,0 +1,411 @@
#include <ultra64.h>
#include "constants.h"
#include "game/activemenu/activemenu.h"
#include "game/data/data_000000.h"
#include "game/data/data_0083d0.h"
#include "game/data/data_00e460.h"
#include "game/data/data_0160b0.h"
#include "game/data/data_01a3a0.h"
#include "game/data/data_020df0.h"
#include "game/data/data_02da90.h"
#include "game/game_01b0a0.h"
#include "game/game_097ba0.h"
#include "game/game_0b0420.h"
#include "game/game_111600.h"
#include "game/game_127910.h"
#include "game/pdoptions.h"
#include "gvars/gvars.h"
#include "lib/lib_13130.h"
#include "lib/lib_13900.h"
#include "types.h"
void amTick(void)
{
s32 prevplayernum = g_Vars.currentplayernum;
s32 i;
for (i = 0; i < PLAYERCOUNT(); i++) {
setCurrentPlayerNum(i);
g_AmIndex = g_Vars.currentplayernum;
if (g_AmMenus[g_AmIndex].togglefunc) {
if (currentPlayerConsiderToggleGunFunction(60, false, 1) > 0) {
g_AmMenus[g_AmIndex].togglefunc = false;
}
} else {
// empty
}
if (g_Vars.normmplayerisrunning == false
&& currentPlayerGetNumInvItems() != g_AmMenus[g_AmIndex].numitems) {
amAssignWeaponSlots();
}
if (g_Vars.currentplayer->activemenumode != AMMODE_CLOSED) {
s32 controlmode = optionsGetControlMode(g_Vars.currentplayerstats->mpindex);
s8 contpadnum = optionsGetContpadNum1(g_Vars.currentplayerstats->mpindex);
s32 numsamples = contGetNumSamples();
s32 j;
for (j = 0; j < numsamples; j++) {
s8 gotonextscreen = false;
s8 cstickx = contGetStickXOnSample(j, contpadnum);
s8 csticky = contGetStickYOnSample(j, contpadnum);
s8 absstickx;
s8 abssticky;
u16 buttonsstate = contGetButtonsOnSample(j, contpadnum, 0xffff);
u16 buttonspressed = contGetButtonsPressedOnSample(j, contpadnum, 0xffff);
bool stickpushed = false;
s32 slotnum;
bool stayopen;
bool toggle;
s32 row;
s32 column;
column = 1;
row = 1;
stayopen = false;
toggle = false;
g_AmMenus[g_AmIndex].allbots = false;
if (g_Vars.currentplayer->activemenumode == AMMODE_EDIT) {
buttonsstate = buttonsstate & A_BUTTON;
cstickx = 0;
csticky = 0;
buttonspressed = 0;
}
if (controlmode == CONTROLMODE_13 || controlmode == CONTROLMODE_14) {
if ((buttonsstate & R_TRIG) || (buttonsstate & L_TRIG)) {
stayopen = true;
}
if (buttonsstate & A_BUTTON) {
g_AmMenus[g_AmIndex].allbots = true;
}
} else {
if (buttonsstate & A_BUTTON) {
stayopen = true;
}
if ((buttonsstate & R_TRIG) || (buttonsstate & L_TRIG)) {
g_AmMenus[g_AmIndex].allbots = true;
}
}
// If entering allbots mode, save current screen
if (g_AmMenus[g_AmIndex].allbots
&& g_AmMenus[g_AmIndex].screenindex >= 2
&& g_AmMenus[g_AmIndex].origscreennum == 0) {
g_AmMenus[g_AmIndex].origscreennum = g_AmMenus[g_AmIndex].screenindex;
g_AmMenus[g_AmIndex].screenindex = 2;
amChangeScreen(0);
}
// If exiting allbots mode, return to original screen
if (!g_AmMenus[g_AmIndex].allbots
&& g_AmMenus[g_AmIndex].origscreennum) {
g_AmMenus[g_AmIndex].screenindex = g_AmMenus[g_AmIndex].origscreennum;
g_AmMenus[g_AmIndex].origscreennum = 0;
amChangeScreen(0);
}
if (buttonsstate & U_CBUTTONS) {
row = 0;
}
if (buttonsstate & D_CBUTTONS) {
row = 2;
}
if (buttonsstate & L_CBUTTONS) {
column = 0;
}
if (buttonsstate & R_CBUTTONS) {
column = 2;
}
if (buttonsstate & U_JPAD) {
row = 0;
}
if (buttonsstate & D_JPAD) {
row = 2;
}
if (buttonsstate & L_JPAD) {
column = 0;
}
if (buttonsstate & R_JPAD) {
column = 2;
}
if (controlmode == CONTROLMODE_23
|| controlmode == CONTROLMODE_24
|| controlmode == CONTROLMODE_22
|| controlmode == CONTROLMODE_21) {
s8 contpadnum2 = optionsGetContpadNum2(g_Vars.currentplayerstats->mpindex);
s8 cstickx2 = contGetStickXOnSample(j, contpadnum2);
s8 csticky2 = contGetStickYOnSample(j, contpadnum2);
u16 buttonsstate2 = contGetButtonsOnSample(j, contpadnum2, 0xffff);
u16 buttonspressed2 = contGetButtonsPressedOnSample(j, contpadnum2, 0xffff);
if (g_Vars.currentplayer->activemenumode == AMMODE_EDIT) {
buttonsstate2 = buttonsstate2 & A_BUTTON;
cstickx2 = 0;
csticky2 = 0;
buttonspressed2 = 0;
}
if (buttonsstate2 & A_BUTTON) {
stayopen = true;
}
if (buttonspressed2 & Z_TRIG) {
toggle = true;
}
if (buttonsstate2 & U_CBUTTONS) {
row = 0;
}
if (buttonsstate2 & D_CBUTTONS) {
row = 2;
}
if (buttonsstate2 & L_CBUTTONS) {
column = 0;
}
if (buttonsstate2 & R_CBUTTONS) {
column = 2;
}
if (buttonsstate2 & U_JPAD) {
row = 0;
}
if (buttonsstate2 & D_JPAD) {
row = 2;
}
if (buttonsstate2 & L_JPAD) {
column = 0;
}
if (buttonsstate2 & R_JPAD) {
column = 2;
}
absstickx = cstickx2 < 0 ? -cstickx2 : cstickx2;
abssticky = csticky2 < 0 ? -csticky2 : csticky2;
if (absstickx > 20 || abssticky > 20) {
if ((f32)abssticky / (f32)absstickx < 0.268f) {
row = 1;
column = cstickx2 < 0 ? 0 : 2;
} else if ((f32)absstickx / (f32)abssticky < 0.268f) {
column = 1;
row = csticky2 < 0 ? 2 : 0;
} else {
column = cstickx2 < 0 ? 0 : 2;
row = csticky2 < 0 ? 2 : 0;
}
stickpushed = true;
}
}
absstickx = cstickx < 0 ? -cstickx : cstickx;
abssticky = csticky < 0 ? -csticky : csticky;
if (absstickx > 20 || abssticky > 20) {
stickpushed = true;
if ((f32)abssticky / (f32)absstickx < 0.268f) {
column = cstickx < 0 ? 0 : 2;
row = 1;
} else if ((f32)absstickx / (f32)abssticky < 0.268f) {
column = 1;
row = csticky < 0 ? 2 : 0;
} else {
column = cstickx < 0 ? 0 : 2;
row = csticky < 0 ? 2 : 0;
}
}
if (g_Vars.currentplayer->isdead) {
stayopen = false;
}
if (g_Vars.lvupdate240 == 0) {
stayopen = false;
}
if (!stayopen &&
(g_Vars.currentplayer->activemenumode != AMMODE_EDIT || g_Menus[g_MpPlayerNum].curframe == NULL)) {
amClose();
break;
}
if (buttonspressed & Z_TRIG) {
toggle = true;
}
if (toggle) {
if (g_AmMenus[g_AmIndex].screenindex >= 2) {
if (g_Vars.numaibuddies && g_MissionConfig.iscoop) {
// Bot command screen, in coop with AI buddies
if (g_AmMenus[g_AmIndex].slotnum == 4) {
gotonextscreen = true;
} else {
amApply(g_AmMenus[g_AmIndex].slotnum);
}
} else {
// Bot command screen, in multiplayer
if (g_AmBotCommands[g_AmMenus[g_AmIndex].slotnum] == MPBOTCOMMAND_ATTACK) {
amOpenPickTarget();
} else if (g_AmMenus[g_AmIndex].allbots == false) {
gotonextscreen = true;
}
if (g_AmMenus[g_AmIndex].slotnum != 4) {
amApply(g_AmMenus[g_AmIndex].slotnum);
}
}
} else {
// Weapon or function screen
if (g_AmMenus[g_AmIndex].slotnum == 4) {
gotonextscreen = true;
} else {
amApply(g_AmMenus[g_AmIndex].slotnum);
}
}
}
if (gotonextscreen) {
amChangeScreen(gotonextscreen);
// If weapon has no functions, skip past function screen
if (g_AmMenus[g_AmIndex].screenindex == 1) {
struct weaponfunc *pri = weaponGetFunction(&g_Vars.currentplayer->hands[0].weaponnum, FUNC_PRIMARY);
struct weaponfunc *sec = weaponGetFunction(&g_Vars.currentplayer->hands[0].weaponnum, FUNC_SECONDARY);
if (!pri && !sec) {
amChangeScreen(gotonextscreen);
}
}
}
slotnum = column * 1 + row * 3;
if (g_Vars.currentplayer->activemenumode != AMMODE_EDIT) {
if (slotnum == 4) {
if (g_AmMenus[g_AmIndex].returntimer <= 0) {
g_AmMenus[g_AmIndex].returntimer = 0;
g_AmMenus[g_AmIndex].slotnum = slotnum;
} else {
g_AmMenus[g_AmIndex].returntimer--;
}
} else {
bool gotoslot = true;
char text[28];
u32 flags;
amGetSlotDetails(slotnum, &flags, text);
if (strcmp(text, "") == 0) {
gotoslot = false;
}
// If focusing a corner slot with C buttons or J pad,
// set a special timer for the release. The player is
// unlikely to release both C buttons on the same frame,
// so this gives a bit of grace and prevents accidental
// movement to a neighbouring slot.
if (g_AmMenus[g_AmIndex].slotnum != 4
&& !stickpushed
&&
(g_AmMenus[g_AmIndex].slotnum == 0
|| g_AmMenus[g_AmIndex].slotnum == 2
|| g_AmMenus[g_AmIndex].slotnum == 6
|| g_AmMenus[g_AmIndex].slotnum == 8)) {
if (slotnum != g_AmMenus[g_AmIndex].fromslotnum) {
g_AmMenus[g_AmIndex].cornertimer = 2;
g_AmMenus[g_AmIndex].fromslotnum = slotnum;
gotoslot = false;
}
if (g_AmMenus[g_AmIndex].cornertimer > 0 && gotoslot) {
gotoslot = false;
g_AmMenus[g_AmIndex].cornertimer--;
}
}
if (gotoslot) {
g_AmMenus[g_AmIndex].returntimer = 15;
g_AmMenus[g_AmIndex].slotnum = slotnum;
}
}
}
}
}
if (g_Vars.currentplayer->activemenumode != AMMODE_EDIT) {
s16 dist;
s16 dstradius;
if (g_AmMenus[g_AmIndex].dstx != -123) {
s16 dist;
// Update selection x/y values
g_AmMenus[g_AmIndex].selx = (g_AmMenus[g_AmIndex].selx + g_AmMenus[g_AmIndex].dstx) / 2;
g_AmMenus[g_AmIndex].sely = (g_AmMenus[g_AmIndex].sely + g_AmMenus[g_AmIndex].dsty) / 2;
dist = g_AmMenus[g_AmIndex].selx - g_AmMenus[g_AmIndex].dstx;
if (dist <= 1 && dist >= -1) {
g_AmMenus[g_AmIndex].selx = g_AmMenus[g_AmIndex].dstx;
}
dist = g_AmMenus[g_AmIndex].sely - g_AmMenus[g_AmIndex].dsty;
if (dist <= 1 && dist >= -1) {
g_AmMenus[g_AmIndex].sely = g_AmMenus[g_AmIndex].dsty;
}
}
// Update x radius (the expanding effect when a new screen is loaded)
dstradius = g_AmMenus[g_AmIndex].slotwidth + 5;
g_AmMenus[g_AmIndex].xradius = (g_AmMenus[g_AmIndex].xradius * 3 + dstradius) / 4;
dist = g_AmMenus[g_AmIndex].xradius - dstradius;
if (dist <= 1 && dist >= -1) {
g_AmMenus[g_AmIndex].xradius = dstradius;
}
// Update alpha of slots so they fade in
if (g_AmMenus[g_AmIndex].alphafrac < 1) {
g_AmMenus[g_AmIndex].alphafrac += g_Vars.lvupdate240f / 30.0f;
}
if (g_AmMenus[g_AmIndex].alphafrac > 1) {
g_AmMenus[g_AmIndex].alphafrac = 1;
}
// Make selection border pulsate
g_AmMenus[g_AmIndex].selpulse += g_Vars.lvupdate240f / 5.0f;
if (g_AmMenus[g_AmIndex].selpulse > 18.849555969238f) {
g_AmMenus[g_AmIndex].selpulse -= 18.849555969238f;
}
}
}
setCurrentPlayerNum(prevplayernum);
}
+4 -5
View File
@@ -23,7 +23,6 @@
#include "game/game_0b3350.h"
#include "game/game_0b63b0.h"
#include "game/bondcutscene.h"
#include "game/game_0fd660.h"
#include "game/bondhead.h"
#include "game/game_127910.h"
#include "game/game_157db0.h"
@@ -1511,7 +1510,7 @@ glabel var7f1ad8e4
/* f0c9590: 28410010 */ slti $at,$v0,0x10
/* f0c9594: 14200006 */ bnez $at,.L0f0c95b0
/* f0c9598: 24480001 */ addiu $t0,$v0,0x1
/* f0c959c: 0fc3fbda */ jal activemenuOpen
/* f0c959c: 0fc3fbda */ jal amOpen
/* f0c95a0: 00000000 */ nop
/* f0c95a4: 8e590284 */ lw $t9,0x284($s2)
/* f0c95a8: 10000014 */ b .L0f0c95fc
@@ -2444,7 +2443,7 @@ glabel var7f1ad8e4
/* f0ca2bc: 28410010 */ slti $at,$v0,0x10
/* f0ca2c0: 14200006 */ bnez $at,.L0f0ca2dc
/* f0ca2c4: 244e0001 */ addiu $t6,$v0,0x1
/* f0ca2c8: 0fc3fbda */ jal activemenuOpen
/* f0ca2c8: 0fc3fbda */ jal amOpen
/* f0ca2cc: 00000000 */ nop
/* f0ca2d0: 8e4d0284 */ lw $t5,0x284($s2)
/* f0ca2d4: 10000017 */ b .L0f0ca334
@@ -4278,7 +4277,7 @@ glabel var7f1ad8e4
// if (g_Vars.currentplayer->invdowntime > -1
// && contGetButtonsOnSample(i, shootpad, shootallowedbuttons & Z_TRIG) == 0) {
// if (g_Vars.currentplayer->invdowntime > 15) {
// activemenuOpen();
// amOpen();
// g_Vars.currentplayer->invdowntime = -1;
// } else {
// g_Vars.currentplayer->invdowntime++;
@@ -4656,7 +4655,7 @@ glabel var7f1ad8e4
// if (g_Vars.currentplayer->invdowntime >= 0 && contGetButtonsOnSample(i, contpad1, shootbuttons & c1allowedbuttons) == 0) {
// // Holding A and haven't pressed Z
// if (g_Vars.currentplayer->invdowntime > 15) {
// activemenuOpen();
// amOpen();
// g_Vars.currentplayer->invdowntime = -1;
// } else {
// g_Vars.currentplayer->invdowntime++;
+1 -1
View File
@@ -464,7 +464,7 @@ bool (*g_CommandPointers[])(void) = {
/*0x01bb*/ aiNoOp01bb,
/*0x01bc*/ ai01bc,
/*0x01bd*/ aiIfTrainingPcHolographed,
/*0x01be*/ aiIfChrWeaponEquipped,
/*0x01be*/ aiIfPlayerUsingDevice,
/*0x01bf*/ aiChrBeginOrEndTeleport,
/*0x01c0*/ aiIfChrTeleportFullWhite,
/*0x01c1*/ aiSetPunchDodgeList,
+5 -5
View File
@@ -10466,26 +10466,26 @@ bool aiIfTrainingPcHolographed(void)
/**
* @cmd 01be
*/
bool aiIfChrWeaponEquipped(void)
bool aiIfPlayerUsingDevice(void)
{
u8 *cmd = g_Vars.ailist + g_Vars.aioffset;
struct chrdata *chr = chrFindById(g_Vars.chrdata, cmd[2]);
struct prop *prop = chr ? chr->prop : NULL;
u8 is_using_weapon = false;
u8 active = false;
if (prop && prop->type == PROPTYPE_PLAYER) {
u32 playernum = propGetPlayerNum(prop);
u32 prevplayernum = g_Vars.currentplayernum;
setCurrentPlayerNum(playernum);
if (currentPlayerHasWeaponEquipped(cmd[3]) == 1) {
is_using_weapon = true;
if (currentPlayerGetDeviceState(cmd[3]) == DEVICESTATE_ACTIVE) {
active = true;
}
setCurrentPlayerNum(prevplayernum);
}
if (is_using_weapon) {
if (active) {
g_Vars.aioffset = chraiGoToLabel(g_Vars.ailist, g_Vars.aioffset, cmd[4]);
} else {
g_Vars.aioffset += 5;
-1
View File
@@ -1,7 +1,6 @@
#include <ultra64.h>
#include "game/chr/chraicommands.h"
#include "game/game_0f09f0.h"
#include "game/game_0fd660.h"
#include "game/game_102240.h"
#include "game/cheats.h"
#include "game/game_107fb0.h"
+24 -24
View File
@@ -4889,15 +4889,15 @@ struct weapon invitem_targetamplifier = {
0x08000018, // flags
};
struct weaponfunc_visual invfunc_nightvision_primary = {
INVENTORYFUNCTYPE_VISUAL,
struct weaponfunc_device invfunc_nightvision_primary = {
INVENTORYFUNCTYPE_DEVICE,
L_GUN(135), // name
0x00, // unk06
0, // unk07
&invmenupos_00010fd0, // menupos
NULL, // fire animation
0x00002000, // flags
0x00000001,
DEVICE_NIGHTVISION,
};
struct weapon invitem_nightvision = {
@@ -4971,15 +4971,15 @@ struct weapon invitem_horizonscanner = {
0x08600058, // flags
};
struct weaponfunc_visual invfunc_cloak_primary = {
INVENTORYFUNCTYPE_VISUAL,
struct weaponfunc_device invfunc_cloak_primary = {
INVENTORYFUNCTYPE_DEVICE,
L_GUN(116), // name
0x00, // unk06
0, // unk07
&invmenupos_00010fd0, // menupos
NULL, // fire animation
0x00002000, // flags
0x00000040,
DEVICE_CLOAKDEVICE,
};
struct inventory_ammo invammo_cloakingdevice = {
@@ -5074,15 +5074,15 @@ struct weapon invitem_combatboost = {
0x34000018, // flags
};
struct weaponfunc_visual invfunc_suicidepill_primary = {
INVENTORYFUNCTYPE_VISUAL,
struct weaponfunc_device invfunc_suicidepill_primary = {
INVENTORYFUNCTYPE_DEVICE,
L_GUN(0), // name
0x00, // unk06
0, // unk07
&invmenupos_00010fd0, // menupos
NULL, // fire animation
0x00002000, // flags
0x00000020,
DEVICE_SUICIDEPILL,
};
struct weapon invitem_suicidepill = {
@@ -5110,15 +5110,15 @@ struct weapon invitem_suicidepill = {
0x08000010, // flags
};
struct weaponfunc_visual invfunc_irscanner_primary = {
INVENTORYFUNCTYPE_VISUAL,
struct weaponfunc_device invfunc_irscanner_primary = {
INVENTORYFUNCTYPE_DEVICE,
L_GUN(138), // name
0x00, // unk06
0, // unk07
&invmenupos_00010fd0, // menupos
NULL, // fire animation
0x00002000, // flags
0x00000008,
DEVICE_IRSCANNER,
};
struct weapon invitem_irscanner = {
@@ -5206,15 +5206,15 @@ struct weapon invitem_disguise41 = {
0x88000018, // flags
};
struct weaponfunc_visual invfunc_camspy_deploy = {
INVENTORYFUNCTYPE_VISUAL,
struct weaponfunc_device invfunc_camspy_deploy = {
INVENTORYFUNCTYPE_DEVICE,
L_GUN(136), // name
0x00, // unk06
0, // unk07
&invmenupos_00010fd0, // menupos
NULL, // fire animation
0x00002000, // flags
0x00000004,
DEVICE_EYESPY,
};
struct weapon invitem_camspy = {
@@ -5242,15 +5242,15 @@ struct weapon invitem_camspy = {
0x08001018, // flags
};
struct weaponfunc_visual invfunc_rtracker_primary = {
INVENTORYFUNCTYPE_VISUAL,
struct weaponfunc_device invfunc_rtracker_primary = {
INVENTORYFUNCTYPE_DEVICE,
L_GUN(142), // name
0x00, // unk06
0, // unk07
&invmenupos_00010fd0, // menupos
NULL, // fire animation
0x00002000, // flags
0x00000010,
DEVICE_RTRACKER,
};
struct weapon invitem_rtracker = {
@@ -5278,15 +5278,15 @@ struct weapon invitem_rtracker = {
0x08001018, // flags
};
struct weaponfunc_visual invfunc_xray_primary = {
INVENTORYFUNCTYPE_VISUAL,
struct weaponfunc_device invfunc_xray_primary = {
INVENTORYFUNCTYPE_DEVICE,
L_GUN(137), // name
0x00, // unk06
0, // unk07
&invmenupos_00010fd0, // menupos
NULL, // fire animation
0x00002000, // flags
0x00000002,
DEVICE_XRAYSCANNER,
};
struct weapon invitem_xrayscanner = {
@@ -5560,15 +5560,15 @@ struct weapon invitem_explosives = {
0x80000000, // flags
};
struct weaponfunc_visual invfunc_presidentscanner_primary = {
INVENTORYFUNCTYPE_VISUAL,
struct weaponfunc_device invfunc_presidentscanner_primary = {
INVENTORYFUNCTYPE_DEVICE,
L_GUN(142), // name
0x00, // unk06
0, // unk07
&invmenupos_00010fd0, // menupos
NULL, // fire animation
0x00002000, // flags
0x00000010,
DEVICE_RTRACKER,
};
struct weapon invitem_presidentscanner = {
-392
View File
@@ -10,7 +10,6 @@
#include "game/game_01b0a0.h"
#include "game/game_097ba0.h"
#include "game/game_0b0420.h"
#include "game/game_0fd660.h"
#include "game/game_111600.h"
#include "game/game_127910.h"
#include "game/pdoptions.h"
@@ -60,394 +59,3 @@ void titleSetNextStage(s32 stagenum)
{
g_TitleNextStage = stagenum;
}
void activemenuTick(void)
{
s32 prevplayernum = g_Vars.currentplayernum;
s32 i;
for (i = 0; i < PLAYERCOUNT(); i++) {
setCurrentPlayerNum(i);
g_ActiveMenuIndex = g_Vars.currentplayernum;
if (g_ActiveMenus[g_ActiveMenuIndex].togglefunc) {
if (currentPlayerConsiderToggleGunFunction(60, false, 1) > 0) {
g_ActiveMenus[g_ActiveMenuIndex].togglefunc = false;
}
} else {
// empty
}
if (g_Vars.normmplayerisrunning == false
&& currentPlayerGetNumInvItems() != g_ActiveMenus[g_ActiveMenuIndex].numitems) {
activemenuAssignWeaponSlots();
}
if (g_Vars.currentplayer->activemenumode != AMMODE_CLOSED) {
s32 controlmode = optionsGetControlMode(g_Vars.currentplayerstats->mpindex);
s8 contpadnum = optionsGetContpadNum1(g_Vars.currentplayerstats->mpindex);
s32 numsamples = contGetNumSamples();
s32 j;
for (j = 0; j < numsamples; j++) {
s8 gotonextscreen = false;
s8 cstickx = contGetStickXOnSample(j, contpadnum);
s8 csticky = contGetStickYOnSample(j, contpadnum);
s8 absstickx;
s8 abssticky;
u16 buttonsstate = contGetButtonsOnSample(j, contpadnum, 0xffff);
u16 buttonspressed = contGetButtonsPressedOnSample(j, contpadnum, 0xffff);
bool stickpushed = false;
s32 slotnum;
bool stayopen;
bool toggle;
s32 row;
s32 column;
column = 1;
row = 1;
stayopen = false;
toggle = false;
g_ActiveMenus[g_ActiveMenuIndex].allbots = false;
if (g_Vars.currentplayer->activemenumode == AMMODE_EDIT) {
buttonsstate = buttonsstate & A_BUTTON;
cstickx = 0;
csticky = 0;
buttonspressed = 0;
}
if (controlmode == CONTROLMODE_13 || controlmode == CONTROLMODE_14) {
if ((buttonsstate & R_TRIG) || (buttonsstate & L_TRIG)) {
stayopen = true;
}
if (buttonsstate & A_BUTTON) {
g_ActiveMenus[g_ActiveMenuIndex].allbots = true;
}
} else {
if (buttonsstate & A_BUTTON) {
stayopen = true;
}
if ((buttonsstate & R_TRIG) || (buttonsstate & L_TRIG)) {
g_ActiveMenus[g_ActiveMenuIndex].allbots = true;
}
}
// If entering allbots mode, save current screen
if (g_ActiveMenus[g_ActiveMenuIndex].allbots
&& g_ActiveMenus[g_ActiveMenuIndex].screenindex >= 2
&& g_ActiveMenus[g_ActiveMenuIndex].origscreennum == 0) {
g_ActiveMenus[g_ActiveMenuIndex].origscreennum = g_ActiveMenus[g_ActiveMenuIndex].screenindex;
g_ActiveMenus[g_ActiveMenuIndex].screenindex = 2;
activemenuChangeScreen(0);
}
// If exiting allbots mode, return to original screen
if (!g_ActiveMenus[g_ActiveMenuIndex].allbots
&& g_ActiveMenus[g_ActiveMenuIndex].origscreennum) {
g_ActiveMenus[g_ActiveMenuIndex].screenindex = g_ActiveMenus[g_ActiveMenuIndex].origscreennum;
g_ActiveMenus[g_ActiveMenuIndex].origscreennum = 0;
activemenuChangeScreen(0);
}
if (buttonsstate & U_CBUTTONS) {
row = 0;
}
if (buttonsstate & D_CBUTTONS) {
row = 2;
}
if (buttonsstate & L_CBUTTONS) {
column = 0;
}
if (buttonsstate & R_CBUTTONS) {
column = 2;
}
if (buttonsstate & U_JPAD) {
row = 0;
}
if (buttonsstate & D_JPAD) {
row = 2;
}
if (buttonsstate & L_JPAD) {
column = 0;
}
if (buttonsstate & R_JPAD) {
column = 2;
}
if (controlmode == CONTROLMODE_23
|| controlmode == CONTROLMODE_24
|| controlmode == CONTROLMODE_22
|| controlmode == CONTROLMODE_21) {
s8 contpadnum2 = optionsGetContpadNum2(g_Vars.currentplayerstats->mpindex);
s8 cstickx2 = contGetStickXOnSample(j, contpadnum2);
s8 csticky2 = contGetStickYOnSample(j, contpadnum2);
u16 buttonsstate2 = contGetButtonsOnSample(j, contpadnum2, 0xffff);
u16 buttonspressed2 = contGetButtonsPressedOnSample(j, contpadnum2, 0xffff);
if (g_Vars.currentplayer->activemenumode == AMMODE_EDIT) {
buttonsstate2 = buttonsstate2 & A_BUTTON;
cstickx2 = 0;
csticky2 = 0;
buttonspressed2 = 0;
}
if (buttonsstate2 & A_BUTTON) {
stayopen = true;
}
if (buttonspressed2 & Z_TRIG) {
toggle = true;
}
if (buttonsstate2 & U_CBUTTONS) {
row = 0;
}
if (buttonsstate2 & D_CBUTTONS) {
row = 2;
}
if (buttonsstate2 & L_CBUTTONS) {
column = 0;
}
if (buttonsstate2 & R_CBUTTONS) {
column = 2;
}
if (buttonsstate2 & U_JPAD) {
row = 0;
}
if (buttonsstate2 & D_JPAD) {
row = 2;
}
if (buttonsstate2 & L_JPAD) {
column = 0;
}
if (buttonsstate2 & R_JPAD) {
column = 2;
}
absstickx = cstickx2 < 0 ? -cstickx2 : cstickx2;
abssticky = csticky2 < 0 ? -csticky2 : csticky2;
if (absstickx > 20 || abssticky > 20) {
if ((f32)abssticky / (f32)absstickx < 0.268f) {
row = 1;
column = cstickx2 < 0 ? 0 : 2;
} else if ((f32)absstickx / (f32)abssticky < 0.268f) {
column = 1;
row = csticky2 < 0 ? 2 : 0;
} else {
column = cstickx2 < 0 ? 0 : 2;
row = csticky2 < 0 ? 2 : 0;
}
stickpushed = true;
}
}
absstickx = cstickx < 0 ? -cstickx : cstickx;
abssticky = csticky < 0 ? -csticky : csticky;
if (absstickx > 20 || abssticky > 20) {
stickpushed = true;
if ((f32)abssticky / (f32)absstickx < 0.268f) {
column = cstickx < 0 ? 0 : 2;
row = 1;
} else if ((f32)absstickx / (f32)abssticky < 0.268f) {
column = 1;
row = csticky < 0 ? 2 : 0;
} else {
column = cstickx < 0 ? 0 : 2;
row = csticky < 0 ? 2 : 0;
}
}
if (g_Vars.currentplayer->isdead) {
stayopen = false;
}
if (g_Vars.lvupdate240 == 0) {
stayopen = false;
}
if (!stayopen &&
(g_Vars.currentplayer->activemenumode != AMMODE_EDIT || g_Menus[g_MpPlayerNum].curframe == NULL)) {
activemenuClose();
break;
}
if (buttonspressed & Z_TRIG) {
toggle = true;
}
if (toggle) {
if (g_ActiveMenus[g_ActiveMenuIndex].screenindex >= 2) {
if (g_Vars.numaibuddies && g_MissionConfig.iscoop) {
// Bot command screen, in coop with AI buddies
if (g_ActiveMenus[g_ActiveMenuIndex].slotnum == 4) {
gotonextscreen = true;
} else {
activemenuApply(g_ActiveMenus[g_ActiveMenuIndex].slotnum);
}
} else {
// Bot command screen, in multiplayer
if (g_ActiveMenuMpBotCommands[g_ActiveMenus[g_ActiveMenuIndex].slotnum] == MPBOTCOMMAND_ATTACK) {
mpOpenPickTarget();
} else if (g_ActiveMenus[g_ActiveMenuIndex].allbots == false) {
gotonextscreen = true;
}
if (g_ActiveMenus[g_ActiveMenuIndex].slotnum != 4) {
activemenuApply(g_ActiveMenus[g_ActiveMenuIndex].slotnum);
}
}
} else {
// Weapon or function screen
if (g_ActiveMenus[g_ActiveMenuIndex].slotnum == 4) {
gotonextscreen = true;
} else {
activemenuApply(g_ActiveMenus[g_ActiveMenuIndex].slotnum);
}
}
}
if (gotonextscreen) {
activemenuChangeScreen(gotonextscreen);
// If weapon has no functions, skip past function screen
if (g_ActiveMenus[g_ActiveMenuIndex].screenindex == 1) {
struct weaponfunc *pri = weaponGetFunction(&g_Vars.currentplayer->hands[0].weaponnum, FUNC_PRIMARY);
struct weaponfunc *sec = weaponGetFunction(&g_Vars.currentplayer->hands[0].weaponnum, FUNC_SECONDARY);
if (!pri && !sec) {
activemenuChangeScreen(gotonextscreen);
}
}
}
slotnum = column * 1 + row * 3;
if (g_Vars.currentplayer->activemenumode != AMMODE_EDIT) {
if (slotnum == 4) {
if (g_ActiveMenus[g_ActiveMenuIndex].returntimer <= 0) {
g_ActiveMenus[g_ActiveMenuIndex].returntimer = 0;
g_ActiveMenus[g_ActiveMenuIndex].slotnum = slotnum;
} else {
g_ActiveMenus[g_ActiveMenuIndex].returntimer--;
}
} else {
bool gotoslot = true;
char text[28];
u32 flags;
activemenuGetSlotDetails(slotnum, &flags, text);
if (strcmp(text, "") == 0) {
gotoslot = false;
}
// If focusing a corner slot with C buttons or J pad,
// set a special timer for the release. The player is
// unlikely to release both C buttons on the same frame,
// so this gives a bit of grace and prevents accidental
// movement to a neighbouring slot.
if (g_ActiveMenus[g_ActiveMenuIndex].slotnum != 4
&& !stickpushed
&&
(g_ActiveMenus[g_ActiveMenuIndex].slotnum == 0
|| g_ActiveMenus[g_ActiveMenuIndex].slotnum == 2
|| g_ActiveMenus[g_ActiveMenuIndex].slotnum == 6
|| g_ActiveMenus[g_ActiveMenuIndex].slotnum == 8)) {
if (slotnum != g_ActiveMenus[g_ActiveMenuIndex].fromslotnum) {
g_ActiveMenus[g_ActiveMenuIndex].cornertimer = 2;
g_ActiveMenus[g_ActiveMenuIndex].fromslotnum = slotnum;
gotoslot = false;
}
if (g_ActiveMenus[g_ActiveMenuIndex].cornertimer > 0 && gotoslot) {
gotoslot = false;
g_ActiveMenus[g_ActiveMenuIndex].cornertimer--;
}
}
if (gotoslot) {
g_ActiveMenus[g_ActiveMenuIndex].returntimer = 15;
g_ActiveMenus[g_ActiveMenuIndex].slotnum = slotnum;
}
}
}
}
}
if (g_Vars.currentplayer->activemenumode != AMMODE_EDIT) {
s16 dist;
s16 dstradius;
if (g_ActiveMenus[g_ActiveMenuIndex].dstx != -123) {
s16 dist;
// Update selection x/y values
g_ActiveMenus[g_ActiveMenuIndex].selx = (g_ActiveMenus[g_ActiveMenuIndex].selx + g_ActiveMenus[g_ActiveMenuIndex].dstx) / 2;
g_ActiveMenus[g_ActiveMenuIndex].sely = (g_ActiveMenus[g_ActiveMenuIndex].sely + g_ActiveMenus[g_ActiveMenuIndex].dsty) / 2;
dist = g_ActiveMenus[g_ActiveMenuIndex].selx - g_ActiveMenus[g_ActiveMenuIndex].dstx;
if (dist <= 1 && dist >= -1) {
g_ActiveMenus[g_ActiveMenuIndex].selx = g_ActiveMenus[g_ActiveMenuIndex].dstx;
}
dist = g_ActiveMenus[g_ActiveMenuIndex].sely - g_ActiveMenus[g_ActiveMenuIndex].dsty;
if (dist <= 1 && dist >= -1) {
g_ActiveMenus[g_ActiveMenuIndex].sely = g_ActiveMenus[g_ActiveMenuIndex].dsty;
}
}
// Update x radius (the expanding effect when a new screen is loaded)
dstradius = g_ActiveMenus[g_ActiveMenuIndex].slotwidth + 5;
g_ActiveMenus[g_ActiveMenuIndex].xradius = (g_ActiveMenus[g_ActiveMenuIndex].xradius * 3 + dstradius) / 4;
dist = g_ActiveMenus[g_ActiveMenuIndex].xradius - dstradius;
if (dist <= 1 && dist >= -1) {
g_ActiveMenus[g_ActiveMenuIndex].xradius = dstradius;
}
// Update alpha of slots so they fade in
if (g_ActiveMenus[g_ActiveMenuIndex].alphafrac < 1) {
g_ActiveMenus[g_ActiveMenuIndex].alphafrac += g_Vars.lvupdate240f / 30.0f;
}
if (g_ActiveMenus[g_ActiveMenuIndex].alphafrac > 1) {
g_ActiveMenus[g_ActiveMenuIndex].alphafrac = 1;
}
// Make selection border pulsate
g_ActiveMenus[g_ActiveMenuIndex].selpulse += g_Vars.lvupdate240f / 5.0f;
if (g_ActiveMenus[g_ActiveMenuIndex].selpulse > 18.849555969238f) {
g_ActiveMenus[g_ActiveMenuIndex].selpulse -= 18.849555969238f;
}
}
}
setCurrentPlayerNum(prevplayernum);
}
+1 -1
View File
@@ -11832,7 +11832,7 @@ glabel func0f0a1528
/* f0a1580: 8fbf0044 */ lw $ra,0x44($sp)
/* f0a1584: 82b01580 */ lb $s0,0x1580($s5)
/* f0a1588: 82b10de4 */ lb $s1,0xde4($s5)
/* f0a158c: 0fc2c62f */ jal currentPlayerHasWeaponEquipped
/* f0a158c: 0fc2c62f */ jal currentPlayerGetDeviceState
/* f0a1590: 82840002 */ lb $a0,0x2($s4)
/* f0a1594: 2401ffff */ addiu $at,$zero,-1
/* f0a1598: 10410002 */ beq $v0,$at,.L0f0a15a4
+2 -2
View File
@@ -1143,7 +1143,7 @@ glabel func0f0b184c
);
GLOBAL_ASM(
glabel currentPlayerHasWeaponEquipped
glabel currentPlayerGetDeviceState
/* f0b18bc: 27bdffe8 */ addiu $sp,$sp,-24
/* f0b18c0: afbf0014 */ sw $ra,0x14($sp)
/* f0b18c4: 0fc2c3f4 */ jal weaponFindById
@@ -1187,7 +1187,7 @@ glabel currentPlayerHasWeaponEquipped
);
GLOBAL_ASM(
glabel func0f0b1948
glabel currentPlayerSetDeviceActive
/* f0b1948: 27bdffe8 */ addiu $sp,$sp,-24
/* f0b194c: afbf0014 */ sw $ra,0x14($sp)
/* f0b1950: 0fc2c3f4 */ jal weaponFindById
+2 -3
View File
@@ -20,7 +20,6 @@
#include "game/game_0e0770.h"
#include "game/menu/items.h"
#include "game/game_0f09f0.h"
#include "game/game_0fd660.h"
#include "game/game_107fb0.h"
#include "game/game_1371b0.h"
#include "game/game_1531a0.h"
@@ -10883,8 +10882,8 @@ glabel var7f1b2ac8
/* f0fa780: afb80100 */ sw $t8,0x100($sp)
/* f0fa784: 3c0e800a */ lui $t6,%hi(g_Vars+0x28c)
/* f0fa788: 8dcea24c */ lw $t6,%lo(g_Vars+0x28c)($t6)
/* f0fa78c: 3c01800a */ lui $at,%hi(g_ActiveMenuIndex)
/* f0fa790: ac2e21b8 */ sw $t6,%lo(g_ActiveMenuIndex)($at)
/* f0fa78c: 3c01800a */ lui $at,%hi(g_AmIndex)
/* f0fa790: ac2e21b8 */ sw $t6,%lo(g_AmIndex)($at)
.L0f0fa794:
/* f0fa794: afa80124 */ sw $t0,0x124($sp)
/* f0fa798: afa90128 */ sw $t1,0x128($sp)
+4 -4
View File
@@ -3677,7 +3677,7 @@ glabel var7f1b2e84
/* f1061e4: afa2001c */ sw $v0,0x1c($sp)
/* f1061e8: 10400014 */ beqz $v0,.L0f10623c
/* f1061ec: afa80018 */ sw $t0,0x18($sp)
/* f1061f0: 0fc2c62f */ jal currentPlayerHasWeaponEquipped
/* f1061f0: 0fc2c62f */ jal currentPlayerGetDeviceState
/* f1061f4: 00402025 */ or $a0,$v0,$zero
/* f1061f8: 2401ffff */ addiu $at,$zero,-1
/* f1061fc: 50410010 */ beql $v0,$at,.L0f106240
@@ -3690,12 +3690,12 @@ glabel var7f1b2e84
/* f106218: 14400006 */ bnez $v0,.L0f106234
/* f10621c: 8fa4001c */ lw $a0,0x1c($sp)
/* f106220: 8fa4001c */ lw $a0,0x1c($sp)
/* f106224: 0fc2c652 */ jal func0f0b1948
/* f106224: 0fc2c652 */ jal currentPlayerSetDeviceActive
/* f106228: 24050001 */ addiu $a1,$zero,0x1
/* f10622c: 10000004 */ b .L0f106240
/* f106230: 8fab0018 */ lw $t3,0x18($sp)
.L0f106234:
/* f106234: 0fc2c652 */ jal func0f0b1948
/* f106234: 0fc2c652 */ jal currentPlayerSetDeviceActive
/* f106238: 00002825 */ or $a1,$zero,$zero
.L0f10623c:
/* f10623c: 8fab0018 */ lw $t3,0x18($sp)
@@ -3740,7 +3740,7 @@ glabel var7f1b2e84
/* f1062cc: 8f040000 */ lw $a0,0x0($t8)
/* f1062d0: 1040002b */ beqz $v0,.L0f106380
/* f1062d4: 00402025 */ or $a0,$v0,$zero
/* f1062d8: 0fc2c62f */ jal currentPlayerHasWeaponEquipped
/* f1062d8: 0fc2c62f */ jal currentPlayerGetDeviceState
/* f1062dc: 00000000 */ nop
/* f1062e0: 2401ffff */ addiu $at,$zero,-1
/* f1062e4: 10410026 */ beq $v0,$at,.L0f106380
+5 -4
View File
@@ -1,5 +1,7 @@
#include <ultra64.h>
#include "constants.h"
#include "game/activemenu/activemenu.h"
#include "game/activemenu/tick.h"
#include "game/bondmove.h"
#include "game/camdraw.h"
#include "game/cheats.h"
@@ -66,7 +68,6 @@
#include "game/game_0d4690.h"
#include "game/game_0dcdb0.h"
#include "game/game_0f09f0.h"
#include "game/game_0fd660.h"
#include "game/game_107fb0.h"
#include "game/game_10c9c0.h"
#include "game/game_11f000.h"
@@ -411,7 +412,7 @@ void func0f167e7c(s32 stagenum)
g_Vars.currentplayer->invdowntime = g_Vars.currentplayer->usedowntime;
func0f0f8c98();
activemenusInit();
amInit();
currentPlayerInitGunsHeld();
func0f010bb0();
func0f0b77cc();
@@ -1996,7 +1997,7 @@ Gfx *renderFrame(Gfx *gdl)
}
gdl = func0f1274d8(gdl);
gdl = activemenuRender(gdl);
gdl = amRender(gdl);
func00016748(1);
if (g_Vars.currentplayer->unk1c50_01) {
@@ -2697,7 +2698,7 @@ void func0f16b96c(void)
func0f0033b0();
func0f0b2904();
func0f0aefb8();
activemenuTick();
amTick();
menuTickAll();
scenarioCallback10();
+1 -2
View File
@@ -12,7 +12,6 @@
#include "game/chr/chr.h"
#include "game/ceil.h"
#include "game/game_0b0420.h"
#include "game/game_0fd660.h"
#include "game/game_127910.h"
#include "game/game_179060.h"
#include "game/game_190260.h"
@@ -387,7 +386,7 @@ void mpAibotApplyCommand(struct chrdata *chr, u32 command)
switch (command) {
case AIBOTCMD_ATTACK:
mpOpenPickTarget();
amOpenPickTarget();
break;
case AIBOTCMD_FOLLOW:
mpAibotApplyFollow(chr, g_Vars.currentplayer->prop);
+6 -6
View File
@@ -427,17 +427,17 @@ glabel var7f1b8d94
/* f187d74: 3c01800b */ lui $at,%hi(g_MpLockInfo+0x4)
/* f187d78: ac28cc24 */ sw $t0,%lo(g_MpLockInfo+0x4)($at)
.L0f187d7c:
/* f187d7c: 3c02800b */ lui $v0,%hi(g_ActiveMenuMpBotCommands)
/* f187d80: 3c03800b */ lui $v1,%hi(g_ActiveMenuMpBotCommands+0x9)
/* f187d84: 2463cb81 */ addiu $v1,$v1,%lo(g_ActiveMenuMpBotCommands+0x9)
/* f187d88: 2442cb78 */ addiu $v0,$v0,%lo(g_ActiveMenuMpBotCommands)
/* f187d7c: 3c02800b */ lui $v0,%hi(g_AmBotCommands)
/* f187d80: 3c03800b */ lui $v1,%hi(g_AmBotCommands+0x9)
/* f187d84: 2463cb81 */ addiu $v1,$v1,%lo(g_AmBotCommands+0x9)
/* f187d88: 2442cb78 */ addiu $v0,$v0,%lo(g_AmBotCommands)
/* f187d8c: 24040004 */ addiu $a0,$zero,0x4
.L0f187d90:
/* f187d90: 24420001 */ addiu $v0,$v0,0x1
/* f187d94: 1443fffe */ bne $v0,$v1,.L0f187d90
/* f187d98: a044ffff */ sb $a0,-0x1($v0)
/* f187d9c: 3c02800b */ lui $v0,%hi(g_ActiveMenuMpBotCommands)
/* f187da0: 2442cb78 */ addiu $v0,$v0,%lo(g_ActiveMenuMpBotCommands)
/* f187d9c: 3c02800b */ lui $v0,%hi(g_AmBotCommands)
/* f187da0: 2442cb78 */ addiu $v0,$v0,%lo(g_AmBotCommands)
/* f187da4: 24090001 */ addiu $t1,$zero,0x1
/* f187da8: 240a000d */ addiu $t2,$zero,0xd
/* f187dac: 240b0002 */ addiu $t3,$zero,0x2
+5 -5
View File
@@ -14884,10 +14884,10 @@ u32 var800a20c0 = 0;
u32 var800a20c4 = 0;
u32 var800a20c8 = 0;
u32 var800a20cc = 0;
struct activemenu g_ActiveMenus[4] = {0};
u32 g_ActiveMenuFont1 = 0;
u32 g_ActiveMenuFont2 = 0;
s32 g_ActiveMenuIndex = 0;
struct activemenu g_AmMenus[4] = {0};
u32 g_AmFont1 = 0;
u32 g_AmFont2 = 0;
s32 g_AmIndex = 0;
u32 var800a21bc = 0;
u8 g_InventoryWeapon = 0;
u32 var800a21c4 = 0;
@@ -17126,7 +17126,7 @@ u32 var800ac534 = 0;
struct mpsim g_MpSimulants[MAX_SIMULANTS] = {0};
u8 g_MpSimulantDifficultiesPerNumPlayers[32] = {0};
struct mpplayer g_MpPlayers[6] = {0};
u8 g_ActiveMenuMpBotCommands[16] = {0};
u8 g_AmBotCommands[16] = {0};
struct mpsetup g_MpSetup = {0};
struct savefile_setup g_MpSetupSaveFile = {0};
u32 var800acc1c = 0;
+15 -3
View File
@@ -3774,11 +3774,23 @@
label,
/**
* Checks if the given chr is using the given weapon.
* Checks if the given player is using the given device.
*
* The weapon argument should be a WEAPON constant which has a primary or
* secondary function of type INVENTORYFUNCTYPE_DEVICE. For example:
*
* WEAPON_CLOAKINGDEVICE
* WEAPON_EYESPY
* WEAPON_IRSCANNER
* WEAPON_NIGHTVISION
* WEAPON_PRESIDENTSCANNER
* WEAPON_RTRACKER
* WEAPON_SUICIDEPILL
* WEAPON_XRAYSCANNER
*/
#define if_chr_has_weapon_equipped(chr, weapon, label) \
#define if_player_using_device(player, weapon, label) \
mkshort(0x01be), \
chr, \
player, \
weapon, \
label,
+6 -1
View File
@@ -574,6 +574,10 @@
#define DEVICE_CLOAKDEVICE 0x40
#define DEVICE_CLOAKRCP120 0x80
#define DEVICESTATE_UNEQUIPPED -1
#define DEVICESTATE_INACTIVE 0
#define DEVICESTATE_ACTIVE 1
#define DIFF_A 0x00
#define DIFF_SA 0x01
#define DIFF_PA 0x02
@@ -901,7 +905,7 @@
#define INVENTORYFUNCTYPE_THROW 0x0002
#define INVENTORYFUNCTYPE_CLOSE 0x0003
#define INVENTORYFUNCTYPE_SPECIAL 0x0004
#define INVENTORYFUNCTYPE_VISUAL 0x0005
#define INVENTORYFUNCTYPE_DEVICE 0x0005
#define INVITEMTYPE_WEAP 1
#define INVITEMTYPE_PROP 2
@@ -1194,6 +1198,7 @@
#define MENUROOT_MPENDSCREEN 5
#define MENUROOT_FILEMGR 6
#define MENUROOT_BOOTPAKMGR 7
#define MENUROOT_PICKTARGET 8
#define MENUROOT_9 9
#define MENUROOT_10 10
#define MENUROOT_4MBMAINMENU 11
+27
View File
@@ -0,0 +1,27 @@
#ifndef IN_GAME_ACTIVEMENU_ACTIVEMENU_H
#define IN_GAME_ACTIVEMENU_ACTIVEMENU_H
#include <ultra64.h>
#include "types.h"
void amOpenPickTarget(void);
s32 menudialog000fcd48(u32 operation, struct menudialog *dialog, union handlerdata *data);
s32 amPickTargetMenuDialog(u32 operation, struct menudialog *dialog, union handlerdata *data);
void amSetAiBuddyTemperament(bool aggressive);
void amSetAiBuddyStealth(void);
s32 amGetFirstBuddyIndex(void);
void amApply(s32 slot);
void amGetSlotDetails(s32 slot, u32 *flags, char *label);
void amInit(void);
s16 amCalculateSlotWidth(void);
void amChangeScreen(s32 step);
void amAssignWeaponSlots(void);
void amOpen(void);
void amClose(void);
bool amIsCramped(void);
void amCalculateSlotPosition(s16 column, s16 row, s16 *x, s16 *y);
Gfx *amRenderText(Gfx *gdl, char *text, u32 colour, s16 left, s16 top);
Gfx *amRenderAibotInfo(Gfx *gdl, s32 buddynum);
Gfx *amRenderSlot(Gfx *gdl, char *text, s16 x, s16 y, s32 mode, s32 flags);
Gfx *amRender(Gfx *gdl);
#endif
+8
View File
@@ -0,0 +1,8 @@
#ifndef _IN_GAME_ACTIVEMENU_TICK_H
#define _IN_GAME_ACTIVEMENU_TICK_H
#include <ultra64.h>
#include "types.h"
void amTick(void);
#endif
+1 -1
View File
@@ -409,7 +409,7 @@
/*0x01bb*/ bool aiNoOp01bb(void);
/*0x01bc*/ bool ai01bc(void);
/*0x01bd*/ bool aiIfTrainingPcHolographed(void);
/*0x01be*/ bool aiIfChrWeaponEquipped(void);
/*0x01be*/ bool aiIfPlayerUsingDevice(void);
/*0x01bf*/ bool aiChrBeginOrEndTeleport(void);
/*0x01c0*/ bool aiIfChrTeleportFullWhite(void);
/*0x01c1*/ bool aiSetPunchDodgeList(void);
+1 -1
View File
@@ -173,7 +173,7 @@ extern struct menudialog menudialog_damagedcontrollerpak;
extern struct menudialog menudialog_fullcontrollerpak;
extern struct menudialog menudialog_cannotreadgameboy;
extern struct menudialog menudialog_datalost;
extern struct menudialog menudialog_picktarget;
extern struct menudialog g_AmPickTargetMenuDialog;
extern u8 var800719a0[3][3];
extern u16 options_controlmode[];
extern u16 g_AimControlOptions[];
-1
View File
@@ -9,6 +9,5 @@ f32 pdmodeGetDamage(void);
f32 pdmodeGetAccuracy(void);
void func0f01b148(u32 arg0);
void titleSetNextStage(s32 stagenum);
void activemenuTick(void);
#endif
+2 -2
View File
@@ -33,8 +33,8 @@ void currentPlayerZoomIn(f32 fovpersec);
bool weaponHasFlag(s32 itemid, u32 flag);
bool weaponHasInvEFlag(s32 weaponnum, u32 flag);
u32 func0f0b184c(void);
s32 currentPlayerHasWeaponEquipped(u32 arg0);
void func0f0b1948(s32 weaponum, s32 arg1);
s32 currentPlayerGetDeviceState(u32 arg0);
void currentPlayerSetDeviceActive(s32 weaponum, bool active);
u32 func0f0b1a18(s32 weaponnum);
u32 func0f0b1ad0(void);
u32 func0f0b1af0(void);
+6
View File
@@ -84,6 +84,12 @@ void func0f0fd548(s32 arg0);
bool menuIsDialogOpen(struct menudialog *dialog);
struct chrdata *currentPlayerGetCommandingAibot(void);
s32 menuhandler000fcc34(u32 operation, struct menuitem *item, union handlerdata *data);
s32 amPickTargetMenuList(u32 operation, struct menuitem *item, union handlerdata *data);
s32 menuhandlerRepairPak(u32 operation, struct menuitem *item, union handlerdata *data);
s32 menuhandlerRetrySavePak(u32 operation, struct menuitem *item, union handlerdata *data);
s32 menuhandlerWarnRepairPak(u32 operation, struct menuitem *item, union handlerdata *data);
extern const char var7f1b2658[];
extern const char var7f1b265c[];
extern const char var7f1b2660[];
-32
View File
@@ -1,32 +0,0 @@
#ifndef IN_GAME_GAME_0FD660_H
#define IN_GAME_GAME_0FD660_H
#include <ultra64.h>
#include "types.h"
void mpOpenPickTarget(void);
void activemenuSetAiBuddyTemperament(bool aggressive);
void activemenuSetAiBuddyStealth(void);
s32 activemenuGetFirstBuddyIndex(void);
void activemenuApply(s32 slot);
void activemenuGetSlotDetails(s32 slot, u32 *flags, char *label);
void activemenusInit(void);
s16 activemenuCalculateSlotWidth(void);
void activemenuChangeScreen(s32 step);
void activemenuAssignWeaponSlots(void);
void activemenuOpen(void);
void activemenuClose(void);
bool activemenuIsCramped(void);
void activemenuCalculateSlotPosition(s16 column, s16 row, s16 *x, s16 *y);
Gfx *activemenuRenderText(Gfx *gdl, char *text, u32 colour, s16 left, s16 top);
Gfx *activemenuRenderAibotInfo(Gfx *gdl, s32 buddynum);
Gfx *activemenuRenderSlot(Gfx *gdl, char *text, s16 x, s16 y, s32 mode, s32 flags);
Gfx *activemenuRender(Gfx *gdl);
s32 menudialog000fcd48(u32 operation, struct menudialog *dialog, union handlerdata *data);
s32 menudialogMpPickTarget(u32 operation, struct menudialog *dialog, union handlerdata *data);
s32 menuhandler000fcc34(u32 operation, struct menuitem *item, union handlerdata *data);
s32 menuhandler000fd6f0(u32 operation, struct menuitem *item, union handlerdata *data);
s32 menuhandlerRepairPak(u32 operation, struct menuitem *item, union handlerdata *data);
s32 menuhandlerRetrySavePak(u32 operation, struct menuitem *item, union handlerdata *data);
s32 menuhandlerWarnRepairPak(u32 operation, struct menuitem *item, union handlerdata *data);
#endif
+5 -5
View File
@@ -650,10 +650,10 @@ extern u32 var800a203c;
extern u32 var800a2040;
extern u32 var800a2044;
extern u32 var800a2048;
extern struct activemenu g_ActiveMenus[4];
extern u32 g_ActiveMenuFont1;
extern u32 g_ActiveMenuFont2;
extern s32 g_ActiveMenuIndex;
extern struct activemenu g_AmMenus[4];
extern u32 g_AmFont1;
extern u32 g_AmFont2;
extern s32 g_AmIndex;
extern u8 g_InventoryWeapon;
extern u32 g_CheatsActiveBank0;
extern u32 g_CheatsActiveBank1;
@@ -838,7 +838,7 @@ extern struct mpsim g_MpSimulants[MAX_SIMULANTS];
extern u8 g_MpSimulantDifficultiesPerNumPlayers[32];
extern struct mpplayer g_MpPlayers[6];
extern u8 g_ActiveMenuMpBotCommands[16];
extern u8 g_AmBotCommands[16];
extern struct mpsetup g_MpSetup;
extern struct savefile_setup g_MpSetupSaveFile;
extern struct mplockinfo g_MpLockInfo;
+5 -5
View File
@@ -2985,9 +2985,9 @@ struct weaponfunc_special {
/*0x1c*/ u32 unk1c;
};
struct weaponfunc_visual {
struct weaponfunc_device {
struct weaponfunc base;
/*0x14*/ u32 unk14;
/*0x14*/ u32 device;
};
struct inventory_ammo {
@@ -4750,10 +4750,10 @@ struct activemenu {
/**
* Weapon numbers to slot mapping. In multiplayer this is determined at the
* start of the match. Unsure how it works in solo. A value of 0xff means
* the slot cannot be shown in this match.
* start of the match. A value of 0xff means the slot cannot be shown in
* this match.
*/
/*0x28*/ u8 weaponnums[8];
/*0x28*/ u8 favourites[8];
/*0x30*/ u8 togglefunc;
/*0x31*/ u8 numitems; // number of items in player's inventory; can be higher than the number of AM slots