Decompile chrGoposChooseAnimation

This commit is contained in:
Ryan Dwyer 2020-06-19 20:35:16 +10:00
parent 382e5e68c0
commit 0535ef2a94
20 changed files with 453 additions and 829 deletions

View File

@ -1132,7 +1132,7 @@ u8 func0403_init_elvis[] = {
set_reaction_speed(100)
add_health_or_armor(1000)
set_chr_maxdamage(CHR_SELF, 1000)
set_self_chrflag(CHRCFLAG_00080000)
set_self_chrflag(CHRCFLAG_RUNFASTER)
assign_path(12)
start_path
set_ailist(CHR_SELF, AILIST_ELVIS)
@ -1415,7 +1415,7 @@ u8 func0422_hide[] = {
u8 func041a_pres_clone[] = {
set_self_chrflag(CHRCFLAG_00020000)
set_self_chrflag(CHRCFLAG_00080000)
set_self_chrflag(CHRCFLAG_RUNFASTER)
beginloop(0x06)
chr_toggle_p1p2(CHR_SELF)
@ -1452,7 +1452,7 @@ u8 func041a_pres_clone[] = {
};
u8 func041b_init_president[] = {
set_self_chrflag(CHRCFLAG_00080000)
set_self_chrflag(CHRCFLAG_RUNFASTER)
set_chr_maxdamage(CHR_SELF, 300)
set_shield(0)
set_ailist(CHR_SELF, AILIST_PRESIDENT_WAITING)
@ -1784,7 +1784,7 @@ u8 func041f_trent_shooting[] = {
};
u8 func0420_trent_running[] = {
set_self_chrflag(CHRCFLAG_00080000)
set_self_chrflag(CHRCFLAG_RUNFASTER)
set_self_chrflag(CHRCFLAG_INVINCIBLE_TO_GUNFIRE)
set_stage_flag(STAGEFLAG_TRENT_RUNNING)
restart_timer

View File

@ -667,7 +667,7 @@ u8 func040d_elvis_wait_for_hangar_entry[] = {
set_alertness(100)
set_self_chrflag(CHRCFLAG_HIDDEN)
set_self_chrflag(CHRCFLAG_INVINCIBLE_TO_GUNFIRE)
set_self_chrflag(CHRCFLAG_00080000)
set_self_chrflag(CHRCFLAG_RUNFASTER)
set_self_chrflag(CHRCFLAG_NOAUTOAIM)
beginloop(0x04)

View File

@ -2770,7 +2770,7 @@ u8 func040f_spawned_guard[] = {
set_self_flag_bankx(CHRFLAG0_00002000, BANK_0)
set_self_flag_bankx(CHRFLAG0_04000000, BANK_0)
set_squadron(SQUADRON_0E)
set_self_chrflag(CHRCFLAG_00080000)
set_self_chrflag(CHRCFLAG_RUNFASTER)
try_inherit_properties(0x35, /*goto*/ 0x06)
label(0x06)
restart_timer

View File

@ -745,7 +745,7 @@ u8 func1400_setup_counterop[] = {
};
u8 func040b_init_elvis[] = {
set_self_chrflag(CHRCFLAG_00080000)
set_self_chrflag(CHRCFLAG_RUNFASTER)
set_self_chrflag(CHRCFLAG_00040000)
set_self_chrflag(CHRCFLAG_01000000)
set_accuracy(100)
@ -943,7 +943,7 @@ u8 func0433_unused[] = {
* function because he can't enter the agent megaweapon room on PA.
*/
u8 func0404_elvis_follow_and_do_agent_megaweapon[] = {
set_self_chrflag(CHRCFLAG_00080000)
set_self_chrflag(CHRCFLAG_RUNFASTER)
unset_self_flag_bankx(CHRFLAG1_00200000, BANK_1)
set_shotlist(AILIST_ELVIS_FOLLOW_AND_DO_AGENT_MEGAWEAPON)
set_target_chr(CHR_PRESET)
@ -1084,7 +1084,7 @@ u8 func0404_elvis_follow_and_do_agent_megaweapon[] = {
* @unused
*/
u8 func0405_elvis_follow_nocombat[] = {
set_self_chrflag(CHRCFLAG_00080000)
set_self_chrflag(CHRCFLAG_RUNFASTER)
unset_self_flag_bankx(CHRFLAG1_00200000, BANK_1)
set_shotlist(0x0405)
set_target_chr(CHR_PRESET)
@ -3394,7 +3394,7 @@ u8 func040f_miniskedar_send_clones[] = {
};
u8 func040e_init_miniskedar[] = {
set_self_chrflag(CHRCFLAG_00080000)
set_self_chrflag(CHRCFLAG_RUNFASTER)
set_self_chrflag(CHRCFLAG_00020000)
set_accuracy(0)
set_reaction_speed(65)
@ -3402,7 +3402,7 @@ u8 func040e_init_miniskedar[] = {
add_health_or_armor(0)
set_recovery_speed(0)
set_shield(0)
set_self_chrflag(CHRCFLAG_00080000)
set_self_chrflag(CHRCFLAG_RUNFASTER)
set_chr_team(CHR_SELF, TEAM_ENEMY)
rebuild_teams
rebuild_squadrons
@ -4305,7 +4305,7 @@ u8 func1026_setup_autoguns[] = {
};
u8 func042e_elvis_run_to_exit[] = {
set_self_chrflag(CHRCFLAG_00080000)
set_self_chrflag(CHRCFLAG_RUNFASTER)
set_shotlist(AILIST_ELVIS_RUN_TO_EXIT)
set_returnlist(CHR_SELF, AILIST_ELVIS_RUN_TO_EXIT)
set_target_chr(CHR_PRESET)
@ -4509,7 +4509,7 @@ u8 func102c_lock_doors[] = {
u8 func040f_miniskedar_unalerted[] = {
set_shotlist(AILIST_MINISKEDAR)
set_self_chrflag(CHRCFLAG_00080000)
set_self_chrflag(CHRCFLAG_RUNFASTER)
set_self_chrflag(CHRCFLAG_00020000)
set_accuracy(0)
set_reaction_speed(65)
@ -4517,7 +4517,7 @@ u8 func040f_miniskedar_unalerted[] = {
add_health_or_armor(0)
set_recovery_speed(0)
set_shield(0)
set_self_chrflag(CHRCFLAG_00080000)
set_self_chrflag(CHRCFLAG_RUNFASTER)
set_chr_team(CHR_SELF, TEAM_ENEMY)
rebuild_teams
rebuild_squadrons

View File

@ -724,7 +724,7 @@ u8 func0403_init_miniskedar[] = {
add_health_or_armor(0)
set_recovery_speed(0)
set_shield(0)
set_self_chrflag(CHRCFLAG_00080000)
set_self_chrflag(CHRCFLAG_RUNFASTER)
set_ailist(CHR_SELF, AILIST_MINISKEDAR)
endlist
};
@ -1873,7 +1873,7 @@ u8 func100b_check_sanctum_accessed[] = {
};
u8 func040b_mauler_skedar[] = {
set_self_chrflag(CHRCFLAG_00080000)
set_self_chrflag(CHRCFLAG_RUNFASTER)
set_accuracy(20)
set_reaction_speed(50)
set_chr_maxdamage(CHR_SELF, 40)
@ -1929,7 +1929,7 @@ u8 func100e_wake_skedar_army[] = {
u8 func040c_king_waiting[] = {
set_shield(500)
set_accuracy(100)
set_chr_chrflag(CHR_SELF, CHRCFLAG_00080000)
set_chr_chrflag(CHR_SELF, CHRCFLAG_RUNFASTER)
set_chr_hiddenflag(CHR_SELF, CHRHFLAG_00100000)
if_difficulty_gt(DIFF_A, /*goto*/ 0x2d)
set_self_chrflag(CHRCFLAG_00000020)
@ -2545,7 +2545,7 @@ u8 func0c00_intro[] = {
set_chr_chrflag(CHR_ANTI, CHRCFLAG_HIDDEN)
set_music_track(MUSIC_SKEDARRUINS_INTRO)
set_stage_flag(STAGEFLAG_IN_INTRO)
set_chr_chrflag(CHR_BOND, CHRCFLAG_00080000)
set_chr_chrflag(CHR_BOND, CHRCFLAG_RUNFASTER)
set_chr_chrflag(CHR_KING2, CHRCFLAG_HIDDEN)
camera_movement(0x02e9)
@ -2776,7 +2776,7 @@ u8 func0c00_intro[] = {
label(0x86)
unset_stage_flag(STAGEFLAG_IN_INTRO)
unset_chr_chrflag(CHR_BOND, CHRCFLAG_00080000)
unset_chr_chrflag(CHR_BOND, CHRCFLAG_RUNFASTER)
mute_channel(CHANNEL_7)
label(0x06)
unset_chr_chrflag(CHR_BOND, CHRCFLAG_UNPLAYABLE)
@ -3198,12 +3198,12 @@ u8 func101d_remove_pillar_shadow[] = {
u8 func0c00_intro_sounds[] = {
label(0xda)
if_chr_has_chrflag(CHR_BOND, CHRCFLAG_00080000, /*goto*/ 0xdb)
if_chr_has_chrflag(CHR_BOND, CHRCFLAG_RUNFASTER, /*goto*/ 0xdb)
yield
goto_first(0xda)
label(0xdb)
unset_chr_chrflag(CHR_BOND, CHRCFLAG_00080000)
unset_chr_chrflag(CHR_BOND, CHRCFLAG_RUNFASTER)
#define wait_until_with_stageflag(time, loopid) \
beginloop(loopid) \

View File

@ -489,7 +489,7 @@ u8 func1003_spawn_maians[] = {
u8 func0405_init_maian[] = {
set_self_chrflag(CHRCFLAG_00040000)
set_self_chrflag(CHRCFLAG_00080000)
set_self_chrflag(CHRCFLAG_RUNFASTER)
set_chr_team(CHR_SELF, TEAM_ALLY)
set_squadron(GROUP_MAIANS)
rebuild_teams

View File

@ -813,7 +813,7 @@ u8 func0402_jonathan_waiting_for_meetup[] = {
label(0x67)
set_self_flag_bankx(CHRFLAG0_10000000, BANK_0)
set_self_chrflag(CHRCFLAG_00080000)
set_self_chrflag(CHRCFLAG_RUNFASTER)
beginloop(0x04)
chr_toggle_p1p2(CHR_SELF)

View File

@ -4997,7 +4997,7 @@ glabel var7f1a87d8
/* f0233a4: 8fa40208 */ lw $a0,0x208($sp)
/* f0233a8: 00003025 */ or $a2,$zero,$zero
/* f0233ac: e7a00014 */ swc1 $f0,0x14($sp)
/* f0233b0: 0c007733 */ jal func0001dccc
/* f0233b0: 0c007733 */ jal modelSetAnimation
/* f0233b4: e7a80010 */ swc1 $f8,0x10($sp)
/* f0233b8: 10000008 */ beqz $zero,.L0f0233dc
/* f0233bc: 00000000 */ sll $zero,$zero,0x0

File diff suppressed because it is too large Load Diff

View File

@ -5360,7 +5360,7 @@ bool aiObjectDoAnimation(void)
}
func000230a0(obj->model->anim);
func0001dccc(obj->model, anim_id, 0, fstartframe, thing, 0);
modelSetAnimation(obj->model, anim_id, 0, fstartframe, thing, 0);
func0001af64(obj->model, func0f15c888() * obj->model->unk14 * 100.0f);
}
}

View File

@ -4655,7 +4655,7 @@ u8 func0013_init_coop_200[] = {
yield
yield
yield
set_self_chrflag(CHRCFLAG_00080000)
set_self_chrflag(CHRCFLAG_RUNFASTER)
// Wait for intro to finish
beginloop(0x03)

View File

@ -275,7 +275,7 @@ glabel func0f012684
/* f01295c: e7b40014 */ swc1 $f20,0x14($sp)
/* f012960: e7b60010 */ swc1 $f22,0x10($sp)
/* f012964: 00003025 */ or $a2,$zero,$zero
/* f012968: 0c007733 */ jal func0001dccc
/* f012968: 0c007733 */ jal modelSetAnimation
/* f01296c: 2484045c */ addiu $a0,$a0,0x45c
/* f012970: 8e240284 */ lw $a0,0x284($s1)
/* f012974: 0c006cef */ jal func0001b3bc
@ -318,7 +318,7 @@ glabel func0f012684
/* f012a08: 00006012 */ mflo $t4
/* f012a0c: 024c1021 */ addu $v0,$s2,$t4
/* f012a10: 84450000 */ lh $a1,0x0($v0)
/* f012a14: 0c007733 */ jal func0001dccc
/* f012a14: 0c007733 */ jal modelSetAnimation
/* f012a18: 8c470004 */ lw $a3,0x4($v0)
/* f012a1c: 8e300284 */ lw $s0,0x284($s1)
/* f012a20: 4406a000 */ mfc1 $a2,$f20

View File

@ -894,7 +894,7 @@ glabel var7f1ac1b0
/* f09837c: 01602825 */ or $a1,$t3,$zero
/* f098380: 00003025 */ or $a2,$zero,$zero
/* f098384: e7ac0014 */ swc1 $f12,0x14($sp)
/* f098388: 0c007733 */ jal func0001dccc
/* f098388: 0c007733 */ jal modelSetAnimation
/* f09838c: e7a80010 */ swc1 $f8,0x10($sp)
/* f098390: 0c007486 */ jal func0001d218
/* f098394: 8fa40058 */ lw $a0,0x58($sp)
@ -914,7 +914,7 @@ glabel var7f1ac1b0
/* f0983c8: 01802825 */ or $a1,$t4,$zero
/* f0983cc: 00003025 */ or $a2,$zero,$zero
/* f0983d0: e7ac0014 */ swc1 $f12,0x14($sp)
/* f0983d4: 0c007733 */ jal func0001dccc
/* f0983d4: 0c007733 */ jal modelSetAnimation
/* f0983d8: e7b20010 */ swc1 $f18,0x10($sp)
/* f0983dc: 240dffff */ addiu $t5,$zero,-1
.L0f0983e0:

View File

@ -15018,7 +15018,7 @@ glabel var7f1ad744
/* f0c31d0: e7b20010 */ swc1 $f18,0x10($sp)
/* f0c31d4: e7a80014 */ swc1 $f8,0x14($sp)
/* f0c31d8: afa80048 */ sw $t0,0x48($sp)
/* f0c31dc: 0c007733 */ jal func0001dccc
/* f0c31dc: 0c007733 */ jal modelSetAnimation
/* f0c31e0: e7a20030 */ swc1 $f2,0x30($sp)
/* f0c31e4: c7a20030 */ lwc1 $f2,0x30($sp)
/* f0c31e8: 44805000 */ mtc1 $zero,$f10

View File

@ -4848,7 +4848,7 @@ glabel var7f1b2948
/* f0f49a0: 00003025 */ or $a2,$zero,$zero
/* f0f49a4: 24070000 */ addiu $a3,$zero,0x0
/* f0f49a8: e7a40010 */ swc1 $f4,0x10($sp)
/* f0f49ac: 0c007733 */ jal func0001dccc
/* f0f49ac: 0c007733 */ jal modelSetAnimation
/* f0f49b0: e7a60014 */ swc1 $f6,0x14($sp)
/* f0f49b4: 0c007486 */ jal func0001d218
/* f0f49b8: 8fa4003c */ lw $a0,0x3c($sp)
@ -4865,7 +4865,7 @@ glabel var7f1b2948
/* f0f49e0: 44802000 */ mtc1 $zero,$f4
/* f0f49e4: 24070000 */ addiu $a3,$zero,0x0
/* f0f49e8: e7a80010 */ swc1 $f8,0x10($sp)
/* f0f49ec: 0c007733 */ jal func0001dccc
/* f0f49ec: 0c007733 */ jal modelSetAnimation
/* f0f49f0: e7a40014 */ swc1 $f4,0x14($sp)
/* f0f49f4: 860f005c */ lh $t7,0x5c($s0)
.L0f0f49f8:

View File

@ -661,7 +661,7 @@ glabel func0f113f10
/* f113fe4: 2504045c */ addiu $a0,$t0,0x45c
/* f113fe8: 86050000 */ lh $a1,0x0($s0)
/* f113fec: e7b20010 */ swc1 $f18,0x10($sp)
/* f113ff0: 0c007733 */ jal func0001dccc
/* f113ff0: 0c007733 */ jal modelSetAnimation
/* f113ff4: e7b00014 */ swc1 $f16,0x14($sp)
/* f113ff8: 3c04800a */ lui $a0,%hi(g_Vars+0x284)
/* f113ffc: 8c84a244 */ lw $a0,%lo(g_Vars+0x284)($a0)
@ -737,7 +737,7 @@ glabel func0f1140bc
/* f1140f8: 87a50022 */ lh $a1,0x22($sp)
/* f1140fc: e7a60010 */ swc1 $f6,0x10($sp)
/* f114100: 2484045c */ addiu $a0,$a0,1116
/* f114104: 0c007733 */ jal func0001dccc
/* f114104: 0c007733 */ jal modelSetAnimation
/* f114108: e7a80014 */ swc1 $f8,0x14($sp)
/* f11410c: 3c0f800a */ lui $t7,%hi(g_Vars+0x284)
/* f114110: 8defa244 */ lw $t7,%lo(g_Vars+0x284)($t7)

View File

@ -376,7 +376,7 @@
#define CHRHFLAG_00040000 0x00040000 // Not used in scripts
#define CHRHFLAG_DISGUISED 0x00080000
#define CHRHFLAG_00100000 0x00100000 // Set before warping to pad, never unset or read
#define CHRHFLAG_00200000 0x00200000 // Not used in scripts
#define CHRHFLAG_NEEDANIM 0x00200000
#define CHRHFLAG_00400000 0x00400000 // Set in Chicago, G5, AF1, Defense, Attack Ship, Skedar Ruins, Maian SOS, WAR
#define CHRHFLAG_00800000 0x00800000 // Not used in scripts
#define CHRHFLAG_01000000 0x01000000 // Globals - asked about gun (eg. "where did you get that?")
@ -413,7 +413,7 @@
#define CHRCFLAG_00010000 0x00010000 // Related to dead people in intro cutscenes
#define CHRCFLAG_00020000 0x00020000 // Chicago, Crash Site, Deep Sea, Defense, Ruins
#define CHRCFLAG_00040000 0x00040000 // Used a lot
#define CHRCFLAG_00080000 0x00080000
#define CHRCFLAG_RUNFASTER 0x00080000
#define CHRCFLAG_KILLCOUNTABLE 0x00100000
#define CHRCFLAG_00200000 0x00200000 // Unset by cmd 00fd
#define CHRCFLAG_00400000 0x00400000 // Not used in scripts
@ -642,6 +642,7 @@
#define GOPOSFLAG_04 0x04
#define GOPOSFLAG_ONPRESETPATH 0x08
#define GOPOSFLAG_20 0x20
#define GOPOSFLAG_DUCK 0x40
#define GOPOSFLAG_80 0x80
@ -685,6 +686,23 @@
#define HUDMSGTYPE_4 4
#define HUDMSGTYPE_SUBTITLE 6
// chr->ivebeenhit values
#define IBH_LFOOT 1
#define IBH_LSHIN 2
#define IBH_LTHIGH 3
#define IBH_RFOOT 4
#define IBH_RSHIN 5
#define IBH_RTHIGH 6
#define IBH_PELVIS 7
#define IBH_HEAD 8
#define IBH_LHAND 9
#define IBH_LFOREARM 10
#define IBH_LBICEP 11
#define IBH_RHAND 12
#define IBH_RFOREARM 13
#define IBH_RBICEP 14
#define IBH_TORSO 15
#define IDLEACTION_STANDING 0x01
#define IDLEACTION_SITTING_TYPING 0x02
#define IDLEACTION_SITTING_DORMANT 0x03

View File

@ -79,7 +79,7 @@ u32 func0f037580(void);
u32 func0f0375b0(void);
void func0f0375e8(struct chrdata *chr, struct waydata *waydata, f32 arg2, struct coord *arg3, s16 *rooms);
void func0f0379b0(struct chrdata *chr, struct coord *pos);
void func0f037b70(struct chrdata *chr);
void chrGoposChooseAnimation(struct chrdata *chr);
u32 chrGoToPos(struct chrdata *chr, struct coord *pos, s16 *room, u32 flags);
u32 func0f038868(void);
void func0f038b9c(struct chrdata *chr, struct path *path);

View File

@ -62,7 +62,7 @@ u32 func0001d4fc(void);
u32 func0001d62c(void);
u32 func0001db94(struct model *model);
void func0001dbfc(struct model *model, s32 arg1, u32 arg2, f32 arg3, f32 arg4, f32 arg5);
void func0001dccc(struct model *model, s32 animnum, s32 flip, f32 fstartframe, f32 arg4, f32 arg5);
void modelSetAnimation(struct model *model, s16 animnum, s32 flip, f32 fstartframe, f32 arg4, f32 arg5);
u32 func0001dd90(void);
void func0001ddec(struct model *model, f32 arg1, f32 arg2);
void func0001de1c(struct model *model, f32 arg1);

View File

@ -4372,7 +4372,7 @@ glabel func0001dbfc
);
GLOBAL_ASM(
glabel func0001dccc
glabel modelSetAnimation
/* 1dccc: 27bdffe0 */ addiu $sp,$sp,-32
/* 1dcd0: afbf001c */ sw $ra,0x1c($sp)
/* 1dcd4: afa50024 */ sw $a1,0x24($sp)
@ -5887,7 +5887,7 @@ glabel func0001ee18
/* 1f1e8: 4407e000 */ mfc1 $a3,$f28
/* 1f1ec: e7b0008c */ swc1 $f16,0x8c($sp)
/* 1f1f0: 02402025 */ or $a0,$s2,$zero
/* 1f1f4: 0c007733 */ jal func0001dccc
/* 1f1f4: 0c007733 */ jal modelSetAnimation
/* 1f1f8: e7a60014 */ swc1 $f6,0x14($sp)
/* 1f1fc: c7b0008c */ lwc1 $f16,0x8c($sp)
/* 1f200: 24090001 */ addiu $t1,$zero,0x1
@ -6227,7 +6227,7 @@ glabel func0001f314
/* 1f6b4: 4407e000 */ mfc1 $a3,$f28
/* 1f6b8: e7b0008c */ swc1 $f16,0x8c($sp)
/* 1f6bc: 02402025 */ or $a0,$s2,$zero
/* 1f6c0: 0c007733 */ jal func0001dccc
/* 1f6c0: 0c007733 */ jal modelSetAnimation
/* 1f6c4: e7a80014 */ swc1 $f8,0x14($sp)
/* 1f6c8: c7b0008c */ lwc1 $f16,0x8c($sp)
/* 1f6cc: 24090001 */ addiu $t1,$zero,0x1