Everybody loves a good yearly or so update

This commit is contained in:
KholdFuzion
2025-04-25 10:11:31 -04:00
parent 02bad2cca4
commit 414a8feb8e
373 changed files with 46731 additions and 50709 deletions
+462 -448
View File
File diff suppressed because it is too large Load Diff
+4338 -4338
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -10,11 +10,11 @@
.section .text, "ax"
glabel aspMainTextStart
.incbin "/bin/aspboot.text.bin"
.incbin "bin/aspboot.text.bin"
glabel aspMainTextEnd
.section .data
glabel aspMainDataStart
.incbin "/bin/aspboot.data.bin"
.incbin "bin/aspboot.data.bin"
glabel aspMainDataEnd
+3 -10
View File
@@ -4,6 +4,7 @@
#include "audi.h"
#include "thread_config.h"
#include "bondgame.h"
#include "speed_graph.h"
/**
* EU .data, offset from start of data_seg : 0x23A0
@@ -431,18 +432,10 @@ void amMain(void* arg)
switch (*msg) {
case OS_SC_RETRACE_MSG:
g_StartTime = osGetTime();
#if defined(LEFTOVERDEBUG)
profileSetMarker(0x30000);
#else
speedGraphDisplay(0x30000);
#endif
speedgraphMarkerHandler(0x30000);
amHandleFrameMessage(g_AudioManager.audioInfo[g_AudioFrameCount % 3], info);
count++;
#if defined(LEFTOVERDEBUG)
profileSetMarker(0x60000);
#else
speedGraphDisplay(0x60000);
#endif
speedgraphMarkerHandler(0x60000);
g_EndTime = osGetTime();
g_DeltaTime = g_EndTime - g_StartTime;
+74 -117
View File
@@ -85,8 +85,8 @@
//### AI commands with CHR_NUM argument
==============================================================================
Most commands with "chr" in the name use a CHR_NUM argument. For the most
part, this can be used with any loaded chr number and it will work fine.
Most commands with "chr" in the name use a CHR_NUM argument. For the most
part, this can be used with any loaded chr number and it will work fine.
There is however one exception to this and that is the special CHR_XXX ID :
CHR_BOND_CINEMA.
This ID only works when bond has a third person model assigned (intro/exit
@@ -187,21 +187,21 @@
Ortho View
90 Y+. Azimuth
/|\
.``|``
.''|''
' |
- |
. |
| S 180
E 270 | /
'-.|/`
- /` ```--..
. /` ``--.. .
0 . /` ``--:.`.
- /' '''--..
. /' ''--.. .
0 . /' ''--:.`.
./` :----' X+ W 90
|'-.`
| `-
Z+ ```````` N 0
Z+ '''''''' N 0
10x10 Grid showing angles at distance from origin (Chr)
@@ -246,6 +246,7 @@
#define AI_LIST_CHR_START 0x0401
#define AI_LIST_OBJ_START 0x1000
// Print Helpful Compile-time error messages
#if defined(__INTELLISENSE__)
# define AI_ERR_SUB (GAILIST_DEAD_AI)
# define AI_ERR_NOTSUB (GAILIST_DEAD_AI)
@@ -266,7 +267,7 @@
/**
* Is the called AI List a subroutine (will it return)
* Per Setup Subroutines should be added to SETUPSUBROUTINES at the top of the
* Per Setup Subroutines should be added to SETUPSUBROUTINES at the top of the
* setup.
* eg
* #define SETUPSUBROUTINES(ID) (ID == ACTIVATE_OBJECT) |\
@@ -292,16 +293,16 @@ typedef enum GAILISTID
GAILIST_AIM_AT_BOND,
/**
Dead or Removed AI.
Dead or Removed AI.
Use when AI has no more to do (or use YIELD_FOREVER)
@return No Return - AI List can only be changed by a 3rd party via SetChrAiList
*/
GAILIST_DEAD_AI,
/**
Stand Guard and Kill Time or patrol (Not typicaly used for patrolling).
While killing time, play Idle animations
On detecting Bond, Send a clone OR Run to Bond and Attack.
Stand Guard and Kill Time or patrol (Not typicaly used for patrolling).
While killing time, play Idle animations
On detecting Bond, Send a clone OR Run to Bond and Attack.
This AI List is used by nearly all guards either as default or as a result
of detecting Bond or finnishing their assigned behaivior.
@return No Return - AI List can only be changed by a 3rd party via SetChrAiList
@@ -310,7 +311,7 @@ typedef enum GAILISTID
/**
Play one random idle animation
@return to caller if called with CALL
@return to caller if called with CALL
-or-
return to List set by SetReturnAiList - If not set will crash
*/
@@ -318,7 +319,7 @@ typedef enum GAILISTID
/**
Bash that Keyboard once with a random animation
@return to caller if called with CALL
@return to caller if called with CALL
-or-
return to List set by SetReturnAiList - If not set will crash
*/
@@ -326,7 +327,7 @@ typedef enum GAILISTID
/**
Stand Guard Statically (No Clones, No animations) or patrol.
On detecting Bond (sight/near-miss only), Act like a Standard Guard.
On detecting Bond (sight/near-miss only), Act like a Standard Guard.
@return to Standard Guard
*/
GAILIST_SIMPLE_GUARD_DEAF,
@@ -340,7 +341,7 @@ typedef enum GAILISTID
GAILIST_ATTACK_BOND,
/**
Stand Guard Statically (No Clones, No animations) or patrol (Typical use of this type).
Stand Guard Statically (No Clones, No animations) or patrol (Typical use of this type).
On detecting Bond, Act like a Standard Guard.
@return to Standard Guard
*/
@@ -355,8 +356,8 @@ typedef enum GAILISTID
GAILIST_RUN_TO_BOND,
/**
Stand Guard Statically (No Clones, No animations) or patrol.
On detecting Bond, Run to padpreset1 and activate alarm.
Stand Guard Statically (No Clones, No animations) or patrol.
On detecting Bond, Run to padpreset1 and activate alarm.
Act like a Standard Guard thereafter
@return to Standard Guard
*/
@@ -469,10 +470,10 @@ typedef enum HITTARGET
} HITTARGET;
// command 68 - door states
#define DOOR_STATE_CLOSED 0x01 /* Closed*/
#define DOOR_STATE_OPEN 0x02 /* Opened*/
#define DOOR_STATE_CLOSING 0x04 /* Closing*/
#define DOOR_STATE_OPENING 0x08 /* Opening*/
#define AI_DOOR_STATE_CLOSED 0x01 /* Closed*/
#define AI_DOOR_STATE_OPEN 0x02 /* Opened*/
#define AI_DOOR_STATE_CLOSING 0x04 /* Closing*/
#define AI_DOOR_STATE_OPENING 0x08 /* Opening*/
// command BD/BE - spawn flags
#define SPAWN_SUNGLASSES 0x00000001 /* Sunglasses*/
@@ -563,104 +564,60 @@ IF_VA(NOT(IS_EMPTY(CASE_CONTENT2)))(IF_VA(NOT(IS_EMPTY(CASE_CONTENT3)))(Label(lb
IF_VA(NOT(IS_EMPTY(CASE_CONTENT1)))(IF_VA(NOT(IS_EMPTY(CASE_CONTENT2)))(Label(lblNext)) CASE0 (CASE_VAL0,lblNext) EXPAND_ARGS_STACK(CASE_CONTENT1)(lblDone))\
IF_VA(NOT(IS_EMPTY(CASE_CONTENT0)))(IF_VA(NOT(IS_EMPTY(CASE_CONTENT1)))(Label(lblNext)) EXPAND_ARGS_STACK(CASE_CONTENT0)(lblDone) \
Label(lblDone))
/**
Simple AND Statement.
Test should separate Command from value.
Empty Test is equivelant to a switch default:.
Limited to 16 compares.
Format: AND(Fail_Label,
TEST_COMMAND, TEST_VALUE,
TEST_COMMAND, TEST_VALUE,...)
do stuff
Label(FAIL)
do stuff
*/
#define AND(FAIL_LBL,\
CASE0, CASE_VAL0, \
CASE1, CASE_VAL1, \
CASE2, CASE_VAL2, \
CASE3, CASE_VAL3, \
CASE4, CASE_VAL4, \
CASE5, CASE_VAL5, \
CASE6, CASE_VAL6, \
CASE7, CASE_VAL7, \
CASE8, CASE_VAL8, \
CASE9, CASE_VAL9, \
CASEA, CASE_VALA, \
CASEB, CASE_VALB, \
CASEC, CASE_VALC, \
CASED, CASE_VALD, \
CASEE, CASE_VALE, \
CASEF, CASE_VALF)\
IF_VA(NOT(IS_EMPTY(CASEF)))(0}; Error: And Limited to 15 elements \
\
/*This is here to stop the spread of errors*/ u8 CASEF[] = {)\
IF_VA(NOT(IS_EMPTY(CASE_VALF)))( CASEE (CASE_VALE,lblNext) )\
IF_VA(NOT(IS_EMPTY(CASE_VALE)))(IF_VA(NOT(IS_EMPTY(CASE_VALF)))(BREAK(FAIL_LBL) Label(lblNext)) CASED (CASE_VALD,lblNext) )\
IF_VA(NOT(IS_EMPTY(CASE_VALD)))(IF_VA(NOT(IS_EMPTY(CASE_VALE)))(BREAK(FAIL_LBL) Label(lblNext)) CASEC (CASE_VALC,lblNext) )\
IF_VA(NOT(IS_EMPTY(CASE_VALC)))(IF_VA(NOT(IS_EMPTY(CASE_VALD)))(BREAK(FAIL_LBL) Label(lblNext)) CASEB (CASE_VALB,lblNext) )\
IF_VA(NOT(IS_EMPTY(CASE_VALB)))(IF_VA(NOT(IS_EMPTY(CASE_VALC)))(BREAK(FAIL_LBL) Label(lblNext)) CASEA (CASE_VALA,lblNext) )\
IF_VA(NOT(IS_EMPTY(CASE_VALA)))(IF_VA(NOT(IS_EMPTY(CASE_VALB)))(BREAK(FAIL_LBL) Label(lblNext)) CASE9 (CASE_VAL9,lblNext) )\
IF_VA(NOT(IS_EMPTY(CASE_VAL9)))(IF_VA(NOT(IS_EMPTY(CASE_VALA)))(BREAK(FAIL_LBL) Label(lblNext)) CASE8 (CASE_VAL8,lblNext) )\
IF_VA(NOT(IS_EMPTY(CASE_VAL8)))(IF_VA(NOT(IS_EMPTY(CASE_VAL9)))(BREAK(FAIL_LBL) Label(lblNext)) CASE7 (CASE_VAL7,lblNext) )\
IF_VA(NOT(IS_EMPTY(CASE_VAL7)))(IF_VA(NOT(IS_EMPTY(CASE_VAL8)))(BREAK(FAIL_LBL) Label(lblNext)) CASE6 (CASE_VAL6,lblNext) )\
IF_VA(NOT(IS_EMPTY(CASE_VAL6)))(IF_VA(NOT(IS_EMPTY(CASE_VAL7)))(BREAK(FAIL_LBL) Label(lblNext)) CASE5 (CASE_VAL5,lblNext) )\
IF_VA(NOT(IS_EMPTY(CASE_VAL5)))(IF_VA(NOT(IS_EMPTY(CASE_VAL6)))(BREAK(FAIL_LBL) Label(lblNext)) CASE4 (CASE_VAL4,lblNext) )\
IF_VA(NOT(IS_EMPTY(CASE_VAL4)))(IF_VA(NOT(IS_EMPTY(CASE_VAL5)))(BREAK(FAIL_LBL) Label(lblNext)) CASE3 (CASE_VAL3,lblNext) )\
IF_VA(NOT(IS_EMPTY(CASE_VAL3)))(IF_VA(NOT(IS_EMPTY(CASE_VAL4)))(BREAK(FAIL_LBL) Label(lblNext)) CASE2 (CASE_VAL2,lblNext) )\
IF_VA(NOT(IS_EMPTY(CASE_VAL2)))(IF_VA(NOT(IS_EMPTY(CASE_VAL3)))(BREAK(FAIL_LBL) Label(lblNext)) CASE1 (CASE_VAL1,lblNext) )\
IF_VA(NOT(IS_EMPTY(CASE_VAL1)))(IF_VA(NOT(IS_EMPTY(CASE_VAL2)))(BREAK(FAIL_LBL) Label(lblNext)) CASE0 (CASE_VAL0,lblNext) )\
IF_VA(NOT(IS_EMPTY(CASE_VAL0)))(IF_VA(NOT(IS_EMPTY(CASE_VAL1)))(BREAK(FAIL_LBL) Label(lblNext)) )
#include "aicommands2.h"
#if 1
// //temporary thunking for ai names
// #define DO(label_id) \
// label(label_id) \
// ai_sleep
// #define LOOP(label) \
// goto_first(label)
// #define CONTINUE(label) \
// goto_first(label)
// #define YIELD_FOREVER(label_id) \
// label(label_id) \
// ai_sleep \
// goto_first(label_id)
// #define RETURN(label_id)\
// label(label_id) \
// jump_to_return_ai_list \
// ai_list_end
// /*=============================================================================
// // ai command shortcuts
// //===========================================================================*/
// #define goto_loop_start(label_id) \
// label(label_id) \
// ai_sleep
// #define goto_loop_repeat(label) \
// goto_first(label)
// #define goto_loop_infinite(label_id) \
// label(label_id) \
// ai_sleep \
// goto_first(label_id)
// #define random_generate_greater_than(byte, label) \
// random_generate_seed \
// if_random_seed_greater_than(byte, label)
// #define random_generate_less_than(byte, label) \
// random_generate_seed \
// if_random_seed_less_than(byte, label)
// #define if_guard_meters_to_bond_less_than(distance, label) \
// if_guard_distance_to_bond_less_than((distance * 10U), label)
// #define if_guard_meters_to_bond_greater_than(distance, label) \
// if_guard_distance_to_bond_greater_than((distance * 10U), label)
// #define if_chr_meters_to_pad_less_than(chr_num, distance, pad, label) \
// if_chr_distance_to_pad_less_than(chr_num, (distance * 10U), pad, label)
// #define if_chr_meters_to_pad_greater_than(chr_num, distance, pad, label) \
// if_chr_distance_to_pad_greater_than(chr_num, (distance * 10U), pad, label)
// #define if_guard_meters_to_chr_less_than(distance, chr_num, label) \
// if_guard_distance_to_chr_less_than((distance * 10U), chr_num, label)
// #define if_guard_meters_to_chr_greater_than(distance, chr_num, label) \
// if_guard_distance_to_chr_greater_than((distance * 10U), chr_num, label)
// #define guard_try_setting_chr_preset_to_guard_within_meters(distance, label) \
// guard_try_setting_chr_preset_to_guard_within_distance((distance * 10U), label)
// #define if_bond_meters_to_pad_less_than(distance, pad, label) \
// if_bond_distance_to_pad_less_than((distance * 10U), pad, label)
// #define if_bond_meters_to_pad_greater_than(distance, pad, label) \
// if_bond_distance_to_pad_greater_than((distance * 10U), pad, label)
// #define debug_log_end \
// '\0',
// #define if_local_timer_seconds_less_than(seconds, label) \
// if_local_timer_less_than((SECS_TO_TIMER60(seconds)), label)
// #define if_local_timer_seconds_greater_than(seconds, label) \
// if_local_timer_greater_than((SECS_TO_TIMER60(seconds)), label)
// #define camera_transition_from_bond \
// bond_hide_weapons \
// ai_sleep \
// ai_sleep \
// ai_sleep
// #define camera_transition_to_bond \
// ai_sleep \
// ai_sleep \
// ai_sleep
/*===========================================================================*/
/*=============================================================================
// ai commands macros and information
+379 -144
View File
@@ -31,7 +31,7 @@
* A single list can be made into an enum and string array for debug.
* Also Known as X-Macros
*
* Usage: CREATE_TYPES(ENUM, ACT, ACT_TYPES)
* Usage: `CREATE_TYPES(ENUM, ACT, ACT_TYPES)`
*
* @param type: ENUM or STRINGS
* @param prefix: Prefix to be applied to Enum, eg ACT for ACT_INIT
@@ -55,7 +55,7 @@
* A single list can be made into an enum and string array for debug.
* Also Known as X-Macros
*
* Usage: CREATE_TYPES1(ACT, ACT_TYPES)
* Usage: `CREATE_TYPES1(ACT, ACT_TYPES)`
*
* @param prefix: Prefix to be applied to Enum, eg ACT for ACT_INIT
* @param name: Name of list to use for Enum or String Array
@@ -77,11 +77,12 @@ typedef enum prefix
#define CREATE_STRINGS1(prefix, name) IF_VA(DEFINED(DEBUG))(IF_ELSE(prefix) \
(#prefix "_" #name)(#name)COMMA())
#ifdef __sgi
/**
* Auto Generate Bitflag enums. (up to 32bit) - Unfortunatly we loose intellisense comments
* @param NAME: Name of bitflag
* @param a-af: bitfield names (will be appended to bitflag name for every field)
* @return Enum of bitflags
*/
#define BITFLAG(NAME,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,ab,ac,ad,ae,af)\
typedef enum NAME \
@@ -120,13 +121,15 @@ typedef enum NAME \
*/IF(NOT(IS_EMPTY(ae)))(NAME ## _ ## ae = 1 << 30) EVAL1(COMMA_IF_I(NOT(IS_EMPTY(af))))/*\
*/IF(NOT(IS_EMPTY(af)))(NAME ## _ ## af = 1 << 31) /*\
*/} NAME;
#else
# define BITFLAG(...)
#endif
#pragma endregion
#pragma region Bitflags
/**
/**
* Reverted to manual Enums for intellisense descriptions (comments)
* Advantage of BITFLAG macro is auto-numbering but with loss of comments
* if the Auto numbering sounds better or I find a way to keep comments then I can revert.
@@ -135,14 +138,14 @@ typedef enum NAME \
typedef enum ATTACKTYPE
{
ATTACKTYPE_NONE,
ATTACKTYPE_BOND = 1 << 0, // aim/shoot at Bond
ATTACKTYPE_FORWARD = 1 << 1, // aim/shoot in front of self
ATTACKTYPE_CHR = 1 << 2, // aim/shoot at chr (ID should be given in entity_id)
ATTACKTYPE_PAD = 1 << 3, // aim/shoot at pad (ID should be given in entity_id)
ATTACKTYPE_DIRECTION = 1 << 4, // aim/shoot in compass direction (0000, 4000, 8000, c000)
ATTACKTYPE_AIMONLY = 1 << 5, // aim only - do not shoot
ATTACKTYPE_BOND = 1 << 0, // aim/shoot at Bond
ATTACKTYPE_FORWARD = 1 << 1, // aim/shoot in front of self
ATTACKTYPE_CHR = 1 << 2, // aim/shoot at chr (ID should be given in entity_id)
ATTACKTYPE_PAD = 1 << 3, // aim/shoot at pad (ID should be given in entity_id)
ATTACKTYPE_DIRECTION = 1 << 4, // aim/shoot in compass direction (0000, 4000, 8000, c000)
ATTACKTYPE_AIMONLY = 1 << 5, // aim only - do not shoot
ATTACKTYPE_DONTTURN = 1 << 6, // dont do a shooting animation that would change the chrs direction
ATTACKTYPE_TARGET = 1 << 7 // aim/shoot at whatever is in the chrs `target` field
ATTACKTYPE_TARGET = 1 << 7 // aim/shoot at whatever is in the chrs `target` field
}ATTACKTYPE;
#if 0
BITFLAG(ATTACKTYPE,
@@ -173,20 +176,22 @@ typedef enum CHRHIDDEN
calculate collision. It'll keep the 0x10 flag until the guard
appears on screen.
*/
CHRHIDDEN_OFFSCREEN_PATROL = 0x0010,
CHRHIDDEN_OFFSCREEN_PATROL = 0x0010,
CHRHIDDEN_REMOVE = 0x0020, // remove character
CHRHIDDEN_TIMER_ACTIVE = 0x0040, // chr timer is active
CHRHIDDEN_FIRE_TRACER = 0x0080, // spawn a tracer
CHRHIDDEN_MOVING = 0x0100, // moving
CHRHIDDEN_0200 = 0x0200, // unknown
CHRHIDDEN_BACKGROUND_AI = 0x0200, // chr has an AI script currently running
CHRHIDDEN_0400 = 0x0400, // unknown
CHRHIDDEN_FREEZE = 0x0800, // freeze current animation state
CHRHIDDEN_1000 = 0x1000, // unknown
CHRHIDDEN_2000 = 0x2000, // unknown
CHRHIDDEN_4000 = 0x4000, // unknown
CHRHIDDEN_8000 = 0x8000 // unknown
CHRHIDDEN_RAND_FLINCH_1 = 0x1000, // unknown
CHRHIDDEN_RAND_FLINCH_2 = 0x2000, // unknown
CHRHIDDEN_RAND_FLINCH_4 = 0x4000, // unknown
CHRHIDDEN_RAND_FLINCH_8 = 0x8000 // unknown
}CHRHIDDEN;
#define CHRHIDDEN_RAND_FLINCH_MASK (CHRHIDDEN_RAND_FLINCH_1 | CHRHIDDEN_RAND_FLINCH_2 | CHRHIDDEN_RAND_FLINCH_4 | CHRHIDDEN_RAND_FLINCH_8)
typedef enum CHRFLAG
{
CHRFLAG_NONE,
@@ -199,16 +204,16 @@ typedef enum CHRFLAG
CHRFLAG_CAN_SHOOT_CHRS = 0x00000040 , // can shoot other guards
CHRFLAG_00000080 = 0x00000080 , // unknown
CHRFLAG_WAS_DAMAGED = 0x00000100 , // chr has taken damage (not invincible)
CHRFLAG_00000200 = 0x00000200 , // unknown
CHRFLAG_00000200 = 0x00000200 , // Possibly isBGAI
CHRFLAG_HIDDEN = 0x00000400 , // hidden
CHRFLAG_NO_AUTOAIM = 0x00000800 , // no autoaim
CHRFLAG_LOCK_Y_POS = 0x00001000 , // lock y position (no gravity, used for dam/cradle jump)
CHRFLAG_NO_SHADOW = 0x00002000 , // no shadow
CHRFLAG_IGNORE_ANIM_TRANSLATION = 0x00004000 , // ignore animation translation
CHRFLAG_IMPACT_ALWAYS = 0x00008000 , // Trev on cradle sets this flag so he can be shot off the platform
CHRFLAG_IMPACT_ALWAYS = 0x00008000 , // Trev on cradle sets this flag so he can be shot off the platform
CHRFLAG_00010000 = 0x00010000 , // unknown
CHRFLAG_00020000 = 0x00020000 , // unknown
CHRFLAG_00040000 = 0x00040000 , // unknown
CHRFLAG_00040000 = 0x00040000 , // maybe: update guard ACTION ?
CHRFLAG_INCREASE_RUNNING_SPEED = 0x00080000 , // increase sprinting speed (used by trevelyan)
CHRFLAG_COUNT_DEATH_AS_CIVILIAN = 0x00100000 , // count death as civilian killed
CHRFLAG_WAS_HIT = 0x00200000 , // chr has been hit (even if invincible)
@@ -216,7 +221,7 @@ typedef enum CHRFLAG
CHRFLAG_CULL_USING_HITBOX = 0x00800000 , // cull chr using hitbox instead of tile/clipping (useful with lock y pos flag)
CHRFLAG_01000000 = 0x01000000 , // unknown
CHRFLAG_02000000 = 0x02000000 , // unknown
CHRFLAG_04000000 = 0x04000000 , // unknown
CHRFLAG_04000000 = 0x04000000 , // unknown NoFade
CHRFLAG_08000000 = 0x08000000 , // unknown
CHRFLAG_10000000 = 0x10000000 , // unknown
CHRFLAG_20000000 = 0x20000000 , // unknown
@@ -309,21 +314,22 @@ typedef enum PROPFLAG
PROPFLAG_CANNOT_ACTIVATE = 0x02000000, // Cannot Activate Door/Object
PROPFLAG_04000000 = 0x04000000, // AI Sees Through Door/Object
PROPFLAG_DOOR_TWOWAY = 0x08000000, // Open Away From Player
PROPFLAG_WEAPON_LEFTHANDED = 0x10000000, /* Area Behind Door Invisible/Monitor Fixed/Left-Handed weapon/Disable security camera/drone gun*/
PROPFLAG_CULL_BEHIND_DOOR = 0x10000000,
PROPFLAG_FIXED_MONITOR = 0x10000000,
PROPFLAG_CCTV_DISABLED = 0x10000000,
PROPFLAG_IS_DRONE_GUN = 0x10000000,
PROPFLAG_DOOR_OPENTOFRONT = 0x20000000, /* Open Backwards/Special Function/Conceal Weapon*/
PROPFLAG_SPECIAL_FUNC = 0x20000000,
PROPFLAG_CONCEAL_GUN = 0x20000000,
PROPFLAG_MONITOR_RENDERPOSTBG = 0x40000000, /* No Ammo on pickup / Area Behind Door Visible*/
PROPFLAG_NO_PORTAL_CLOSE = 0x40000000,
PROPFLAG_NO_AMMO = 0x40000000,
PROPFLAG_WEAPON_LEFTHANDED = 0x10000000, /* Left-Handed weapon*/
PROPFLAG_GLASS_HASPORTAL = 0x10000000, /* Glass Has Portal*/
PROPFLAG_CULL_BEHIND_DOOR = 0x10000000, // Area Behind Door Invisible
PROPFLAG_FIXED_MONITOR = 0x10000000, // Monitor Fixed
PROPFLAG_CCTV_DISABLED = 0x10000000, // Disable security camera
PROPFLAG_IS_DRONE_GUN = 0x10000000, // drone gun
PROPFLAG_DOOR_OPENTOFRONT = 0x20000000, /* Open Backwards*/
PROPFLAG_SPECIAL_FUNC = 0x20000000, //Special Function
PROPFLAG_CONCEAL_GUN = 0x20000000, //Conceal Weapon
PROPFLAG_MONITOR_RENDERPOSTBG = 0x40000000,
PROPFLAG_NO_PORTAL_CLOSE = 0x40000000, // Area Behind Door Visible
PROPFLAG_NO_AMMO = 0x40000000,/* No Ammo on pickup */
PROPFLAG_80000000 = 0x80000000, // Open By Default/Weapon Paired for Player
PROPFLAG_IS_DOUBLE = 0x80000000
}PROPFLAG;
// prop definition flags
// prop definition flags
typedef enum PROPFLAG2
{
PROPFLAG2_00000001 = 0x00000001, // Activate Drone Gun
@@ -346,7 +352,7 @@ typedef enum PROPFLAG2
PROPFLAG2_00020000 = 0x00020000, // unknown
PROPFLAG2_00040000 = 0x00040000, // Hide inventory item (for tagged armor/ammo/magazine)
PROPFLAG2_00080000 = 0x00080000, // Invincible Except to Explosions
PROPFLAG2_00100000 = 0x00100000, // Bulletproof Glass
PROPFLAG2_00100000 = 0x00100000, // Bulletproof Glass
PROPFLAG2_00200000 = 0x00200000, // Immune to Explosions
PROPFLAG2_00400000 = 0x00400000, // Don't load on 2P
PROPFLAG2_00800000 = 0x00800000, // Don't load on 3P
@@ -362,13 +368,83 @@ typedef enum PROPFLAG2
typedef enum DOORFLAG
{
DOORFLAG_0001 = 0x00000001,
DOORFLAG_WINDOWED = 0x00000002,
DOORFLAG_0004 = 0x00000004,
DOORFLAG_FLIP = 0x00000008,
DOORFLAG_AUTOMATIC = 0x00000010,
DOORFLAG_0020 = 0x00000020,
DOORFLAG_ROTATEDPAD = 0x00000040,
DOORFLAG_080 = 0x00000080,
DOORFLAG_100 = 0x00000100,
DOORFLAG_LONGRANGE = 0x00000200,
DOORFLAG_DAMAGEONCONTACT = 0x00000400, // Lasers
DOORFLAG_UNBLOCKABLEOPEN = 0x00000800, // Skip collision checks when opening
DOORFLAG_4000 = 0x00004000, // Two Investigation vertical doors after lasers
DOORFLAG_CANNOT_ACTIVATE = 0x02000000,
DOORFLAG_KEEPOPEN = 0x80000000
} DOORFLAG;
typedef enum DOORMODE
{
DOORMODE_IDLE,
DOORMODE_OPENING,
DOORMODE_CLOSING,
// Waiting for sibling door to close. Eg. Dam gates in GE
DOORMODE_WAITING
} DOORMODE;
typedef enum DOORSTATE
{
DOORSTATE_STATIONARY,
DOORSTATE_OPENING,// also OPEN but NOT AIlist compatible (02)
DOORSTATE_CLOSING, // also CLOSE but NOT AIlist compatible (01)
DOORSTATE_WAITING
} DOORSTATE;
#define DOORTYPE_SLIDING 0
// GE only - Bunker flexi door
#define DOORTYPE_FLEXI1 1
#define DOORTYPE_FLEXI2 2
#define DOORTYPE_FLEXI3 3
#define DOORTYPE_VERTICAL 4
#define DOORTYPE_SWINGING 5
// GE only - Caverns
#define DOORTYPE_EYE 6
// GE only - Caverns
#define DOORTYPE_IRIS 7
// GE only - Surface grate and Train floor panel
#define DOORTYPE_FALLAWAY 8
// GE only
#define DOORTYPE_AZTECCHAIR 9
// Attack Ship windows
#define DOORTYPE_HULL 10
#define DOORTYPE_LASER 11
typedef enum DOOR_OPEN_SOUND
{
DOOR_OPEN_SOUND_NONE = 0,
DOOR_OPEN_SOUND_01,
DOOR_OPEN_SOUND_02,
DOOR_OPEN_SOUND_METAL,
DOOR_OPEN_SOUND_04,
DOOR_OPEN_SOUND_WOOD,
DOOR_OPEN_SOUND_06,
DOOR_OPEN_SOUND_WOOD_2,
DOOR_OPEN_SOUND_WOOD_3,
DOOR_OPEN_SOUND_09,
DOOR_OPEN_SOUND_METAL_2,
DOOR_OPEN_SOUND_11,
DOOR_OPEN_SOUND_METAL_3,
DOOR_OPEN_SOUND_13,
DOOR_OPEN_SOUND_HYDROLIC,
DOOR_OPEN_SOUND_STONE,
DOOR_OPEN_SOUND_16,
DOOR_OPEN_SOUND_METAL_4,
DOOR_OPEN_SOUND_18
} DOOR_OPEN_SOUND;
typedef enum DROPTYPE
{
DROPTYPE_DEFAULT = 1,
@@ -412,16 +488,19 @@ BITFLAG(DOOR_LOCK,
7
)
BITFLAG(PROPSTATE,
DAMAGED,
02,
RESPAWN,
EXT_COLISION_BLOCK,
10,
20,
ACTIVATED,
DESTROYED
)
/** PropDefHeaderRecord->state only u8 */
typedef enum PROPSTATE {
PROPSTATE_NONE = 0x00,
PROPSTATE_DAMAGED = 0x01,
PROPSTATE_2 = 0x02, // maybe "double damaged"
PROPSTATE_RESPAWN = 0x04,
PROPSTATE_EXT_COLISION_BLOCK = 0x08,
PROPSTATE_10 = 0x10,
PROPSTATE_20 = 0x20,
PROPSTATE_ACTIVATED = 0x40,
PROPSTATE_DESTROYED = 0x80
} PROPSTATE;
#define PROPSTATE_NORMAL PROPSTATE_NONE
BITFLAG(PLAYERFLAG,
@@ -429,13 +508,13 @@ BITFLAG(PLAYERFLAG,
NOCONTROL,
NOTIMER
)
//PropDef bitflag canonically PROPHID_
BITFLAG(RUNTIMEBITFLAG,
00000001,
00000002,
REMOVE, /* removes object when set */
ISRETICK,
00000010,
TAGGED,
THROWING_KNIFE_RELATED,
EMBEDDED,
DEPOSIT, /* depositted (thrown/launching) */
@@ -467,6 +546,7 @@ BITFLAG(RUNTIMEBITFLAG,
#define RUNTIMEBITFLAG_OWNER 0x60000
#define RUNTIMEBITSHIFT_OWNER 0x11
#define RUNTIMEBITFLAG_00000001 0x1
BITFLAG(WEAPONSTATBITFLAG,
00000001,
@@ -549,6 +629,7 @@ BITFLAG(WEAPONSTATBITFLAG,
#define QUADRANT_2NDWPTOTARGET 0x10 // second waypoint on route to target
#define QUADRANT_20 0x20 // second waypoint on route to target
#define CULLMODE_BOTH 0
#define CULLMODE_NONE 1
#define CULLMODE_FRONT 2
#define CULLMODE_BACK 3
@@ -594,13 +675,18 @@ typedef enum AI_CMD
#ifndef _SYNHILITE
// makes enum list
# define _AI_CMD(C) CAT(AI_, CMDNAME),
# ifdef __sgi
# define _AI_CMD(C) CAT(AI_, CMDNAME),
# define _AI_DEBUG(C) CAT(AI_, CMDNAME),
# define _AI_CMD_POLYMORPH(CMD, A, P, Q, D)
# define DEFINE(x)
# else
# define _AI_CMD(...) CAT(AI_, CMDNAME),
# define _AI_DEBUG(...) CAT(AI_, CMDNAME),
# define _AI_CMD_POLYMORPH(...)
# define DEFINE(...)
# endif
# define _AI_DEBUG(C) CAT(AI_, CMDNAME),
# define _AI_CMD_POLYMORPH(CMD, A, P, Q, D)
# define DEFINE(x)
# include "aicommands.def"
#endif /* !_SYNHILITE */
@@ -608,6 +694,10 @@ typedef enum AI_CMD
AI_CMD_COUNT
} AI_CMD;
// Number of bytes for AI cmds, GE 1, PD 2
#define AICMDSIZE ((u8)(AI_CMD_COUNT / 255) + 1)
/* Motion capture actor: Duncan Botwood
* Motion capture assistance: B Jones
* Recorded using 'flock of birds' system by Ascension Technology Corporation,
@@ -823,7 +913,7 @@ typedef enum CHEAT_IDS
CHEAT_INVINCIBILITY,
CHEAT_ALLGUNS,
CHEAT_MAXAMMO,
CHEAT_DEBUG_RETURN_SAVED_RA, /* unverified */
CHEAT_DEBUG_UNK5, /* unverified */
CHEAT_DEACTIVATE_INVINCIBILITY,
CHEAT_LINEMODE,
CHEAT_2X_HEALTH,
@@ -840,7 +930,7 @@ typedef enum CHEAT_IDS
CHEAT_GOLDEN_GUN,
CHEAT_SILVER_PP7,
CHEAT_GOLD_PP7,
CHEAT_INVISIBILITY_MP, /* unverified */
CHEAT_BONDPHASE,
CHEAT_NO_RADAR_MP,
CHEAT_TURBO_MODE,
CHEAT_DEBUG_POS,
@@ -928,7 +1018,7 @@ typedef enum CONTROLLER_CONFIG
/* 2.4 */
CONTROLLER_CONFIG_GOODHEAD,
CONTROLLER_CONFIG_CINEMA
} CONTROLLER_CONFIG;
@@ -1145,7 +1235,7 @@ typedef enum E_EXPLOSIONTYPE
E_EXPLOSIONTYPE_COUNT
} E_EXPLOSIONTYPE;
/* index into array_explosion_types.
/* index into g_ExplosionTypes.
* Is this the same as E_EXPLOSIONTYPE ?
* Some names are based on logic in chrobjWeaponTick method.
*/
@@ -1187,7 +1277,8 @@ typedef enum GAMEMODE
typedef enum GUNHAND //Canonical name
{
GUNRIGHT,
GUNLEFT
GUNLEFT,
GUNHANDS
} GUNHAND;
@@ -1208,9 +1299,24 @@ typedef enum HIT_TYPE
HIT_CHR,
HIT_GLASS_XLU,
HIT_TYPE_COUNT
} HIT_TYPE;
}HIT_TYPE;
#ifdef DEBUG
char *HIT_TYPE_ToString[] = {
"HIT_DEFAULT",
"HIT_STONE",
"HIT_WOOD",
"HIT_METAL",
"HIT_GLASS",
"HIT_WATER",
"HIT_SNOW",
"HIT_DIRT",
"HIT_MUD",
"HIT_TILE",
"HIT_METALOBJ",
"HIT_CHR",
"HIT_GLASS_XLU"};
#endif
#define IMAGE(NAME, SZ, HS, HT, F3, F4, F5, F6) IMAGE_ ## NAME,
typedef enum IMAGEIDS
{
@@ -1446,6 +1552,14 @@ typedef enum MODELNODE_CHILD
MODELNODE_CHILD_MAX
} MODELNODE_CHILD;
typedef enum BOND
{
BOND_BROSNAN,
BOND_CONNERY,
BOND_DALTON,
BOND_MOORE
} BOND;
typedef enum MP_STAGE_SELECTED
{
MP_STAGE_RANDOM,
@@ -1636,8 +1750,31 @@ typedef enum PLAYER_ID
PLAYER_4
} PLAYER_ID;
#define SAVESLOT1 0x0
#define SAVESLOT2 0x1
#define SAVESLOT3 0x2
#define SAVESLOT4 0x3
#define SAVESLOTRAMROM 0x5
#define SAVESLOTMAX 0x6
#define SAVEFLAG_FOLDER 0x7
#define SAVEFLAG_SLOT 0x18
#define SAVEFLAG_BOND 0x60
#define SAVEFLAG_DORESET 0x80
#define SAVEFLAGS_SET(folder, slot, bond, reset) (((folder << 5) & 0xE0) | ((slot * 8) & 0x18) | ((bond << 1) & 0x6) | (reset & 1 ? SAVEFLAG_DORESET : 0))
#define BLANKSAVEDATA {0, 0, SAVEFLAGS_SET(0,0,BOND_BROSNAN,1), 0x00, 0xFF, 0xFF, DEFAULT_OPTIONS, 0x00, 0x00, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
#define MAX_PLAYER_COUNT 4
#define FOLDER_INVALID -1
#define FOLDER1 0x0
#define FOLDER2 0x1
#define FOLDER3 0x2
#define FOLDER4 0x3
#define MAX_FOLDER_COUNT 4
#define RAMROM_FOLDERNUM 0x64
typedef enum RGBA_ENUM
{
@@ -1652,11 +1789,11 @@ typedef enum SFX_ID
{
NOTHING_SFX,
ROCKET_LAUNCH_SFX,
GLASS_SHATTERING_SFX,
GLASS_SHATTERING_SFX,
KNIFE_HIT_WALL_SFX,
GRENADE_THROW_SFX, //Grenade/Mine or in fact Any object thrown.
GRENADE_THROW_QUIET_SFX,
GRENADE_THROW_FAINT_SFX,
GRENADE_THROW_QUIET_SFX,
GRENADE_THROW_FAINT_SFX,
TRAIN_SLIDE_DOOR_SLIDE_SFX, //Ding used on elevator
TRAIN_RAILS_SFX,
TRAIN_RAILS2_SFX,
@@ -1666,8 +1803,8 @@ typedef enum SFX_ID
GET_HIT_GIRL1_SFX,
GET_HIT_GIRL2_SFX,
GET_HIT_GIRL3_SFX,
BEEP_SFX,
BEEP_QUIET_SFX,
BEEP_SFX,
BEEP_QUIET_SFX,
OPTION_CLICK2_SFX,
RICO_12_GBU_A_SFX,
RICO_12_GBU_B_SFX,
@@ -1694,7 +1831,7 @@ typedef enum SFX_ID
RICO_6_HBBA_C_SFX,
RICO_6_HBBA_D_SFX,
OPTION_CHOOSE_SFX,
UNKNOWN1_SFX,
UNKNOWN1_SFX,
DROP_GUN_SFX,
GUN_SILPPK_A_SFX,
PUNCH1_SFX,
@@ -1702,12 +1839,12 @@ typedef enum SFX_ID
PUNCH3_SFX,
GUN_RIFLECOCK_SFX,
TRAIN_CLUTTER3_SFX,
TRAIN_CLUTTER3B_SFX,
TRAIN_CLUTTER3C_SFX,
TRAIN_CLUTTER3B_SFX,
TRAIN_CLUTTER3C_SFX,
EVIL_LAUGH_SFX,
EVIL_LAUGH_QUIET_SFX,
EVIL_LAUGH_FAINT_SFX,
EVIL_LAUGH_HUSH_SFX,
EVIL_LAUGH_QUIET_SFX,
EVIL_LAUGH_FAINT_SFX,
EVIL_LAUGH_HUSH_SFX,
HELI_RUN_SFX,
HELI_FLY_SFX,
ENGINE_ROOM_SFX,
@@ -1717,7 +1854,7 @@ typedef enum SFX_ID
TRAIN_GO_SFX,
TRUCK_RUN_SFX,
TRUCK_START_SFX,
TRUCK_ENGINE_SFX,
TRUCK_ENGINE_SFX,
BOND_GET_HIT1_SFX,
HIT_BULLET_FLESH_SFX,
HIT_BULLET_GLASS_SFX,
@@ -1728,7 +1865,7 @@ typedef enum SFX_ID
HIT_BULLET_WOOD_SFX,
HIT_BULLET_WATER_SFX,
PAPER_TURN_SFX,
PAPER_TURN_2_SFX,
PAPER_TURN_2_SFX,
COPY_FILE_SFX,
RADIO_MESSAGE_SFX,
ARMOUR_COLLECT_SFX,
@@ -1736,25 +1873,25 @@ typedef enum SFX_ID
DOOR_DECODER_SFX,
GIRL_GET_HIT1_SFX,
CONSOLE_OFF_SFX,
CONSOLE_OFF2_SFX,
CONSOLE_ON2_SFX,
CONSOLE_ON3_SFX,
CONSOLE_OFF2_SFX,
CONSOLE_ON2_SFX,
CONSOLE_ON3_SFX,
EMPTY_GUN_FIRE_SFX,
SHELL_CASE_SFX,
SHELL_CASE_SFX,
RICO_LASER1_SFX,
RICO_LASER2_SFX,
RICO_LASER3_SFX,
RADIO_SFX,
RADIO_SFX,
KNIFE_THROW1_SFX,
KNIFE_THROW2_SFX,
KNIFE_THROW3_SFX,
COUGH_SFX,
COUGH2_SFX,
COUGH2_SFX,
GUN_TASER_SFX,
GUN_TASER_LOOP_SFX,
GUN_TASER_LOOP_SFX,
GAS_HISS_SFX,
UNKNOWN2_SFX,
UNKNOWN3_SFX,
UNKNOWN2_SFX,
UNKNOWN3_SFX,
PUNCHING_AIR_SFX,
GUN_B1_MGUN3_3_SFX, //Used for Skorpion (Klobb)
GUN_B2_HEAVY_SFX, //Used for PPK
@@ -1764,12 +1901,12 @@ typedef enum SFX_ID
GUN_RIFLE7BIG_1_SFX, //used for Rugar
GUN_B8_ANOTHER_SFX, //used for TT33
GUN_B9_CANNON_SFX, //used for M16
GUN_GRENADE_LAUNCHER_SFX,
GUN_UNKNOWN2_SFX,
GUN_GRENADE_LAUNCHER_SFX,
GUN_UNKNOWN2_SFX,
GUN_B12_FULLAMRIFLE_SFX, //used for Auto Shotgun
GUN_B13_M60AMMGUN_SFX, //used for Golden Gun
GUN_M60AMMGUN_3_SFX,
GUN_UNKNOWN3_SFX,
GUN_UNKNOWN3_SFX,
HIT_METAL_OBJECT1_SFX,
GUN_B17_RIFLE_SFX, //used for Shotgun
CART_SPENT_SFX,
@@ -1810,7 +1947,7 @@ typedef enum SFX_ID
GET_HIT_MALE23_SFX,
GET_HIT_MALE24_SFX,
CAMERA_BEEP1_SFX, //Used for Watch Beeping
BING_SFX,
BING_SFX,
ALARM1_SFX,
ALARM2_SFX,
ALARM3_SFX,
@@ -1819,18 +1956,18 @@ typedef enum SFX_ID
RICO_EAR_WHISTLE3_SFX,
RICO_EAR_WHISTLE4_SFX,
RICO_EAR_WHISTLE5_SFX,
EXPLOSION_2A_SFX,
EXPLOSION_2A_SFX,
EXPLOSION_2B_SFX,
EXPLOSION_3_SFX,
EXPLOSION_3_SFX,
EXPLOSION_4A_SFX,
EXPLOSION_4B_SFX,
EXPLOSION_5A_SFX,
EXPLOSION_5B_SFX,
EXPLOSION_5C_SFX,
EXPLOSION_6_SFX,
EXPLOSION_7_SFX,
EXPLOSION_8_SFX,
EXPLOSION_9_SFX,
EXPLOSION_5B_SFX,
EXPLOSION_5C_SFX,
EXPLOSION_6_SFX,
EXPLOSION_7_SFX,
EXPLOSION_8_SFX,
EXPLOSION_9_SFX,
EXPLOSION_1B_SFX,
EXPLOSION_1C_SFX,
CRUSHED_YELL_SFX,
@@ -1840,10 +1977,10 @@ typedef enum SFX_ID
DOOR_WOOD_CLOSE_SFX,
DOOR_WOOD_OPEN_SFX,
ATOMIC_BOMB_SFX,
KEY_ANALYSER2_SFX,
KEY_ANALYSER2_SFX,
DOOR_WOOD_SLIDE_SFX,
TRAIN_SLIDE_DOOR_CATCH_SFX,
GAS_LEAK_SFX,
GAS_LEAK_SFX,
DOOR_SHUTTER_OPEN_SFX,
DOOR_SHUTTER_CLOSE_SFX,
DOOR_METAL_OPEN_SFX,
@@ -1855,9 +1992,9 @@ typedef enum SFX_ID
METAL_SLIDE_OPEN_SFX,
METAL_SLIDE_CLOSE_SFX,
METAL_SLIDE_LOOP_SFX,
UNKNOWN4_SFX,
UNKNOWN5_SFX,
UNKNOWN6_SFX,
UNKNOWN4_SFX,
UNKNOWN5_SFX,
UNKNOWN6_SFX,
HIT_BULLET_STONE1_SFX,
HIT_BULLET_STONE2_SFX,
DOOR_SMART_CATCH1_SFX,
@@ -1890,7 +2027,7 @@ typedef enum SFX_ID
WATCH_ON_SFX,
WATCH_OFF_SFX,
HIT_BULLET_METAL_A3_SFX,
HIT_BULLET_METAL_A4_SFX,
HIT_BULLET_METAL_A4_SFX,
ATTACH_MINE_SFX,
PICKUP_LASER_SFX,
WATCH_DETONATE_MINE_SFX, //Watch Trigger
@@ -1900,17 +2037,17 @@ typedef enum SFX_ID
BOMB_DEFUSE_SFX,
BI_PLANE_SFX,
TRAIN_CLUTTER_SFX,
TRAIN_CLUTTERB_SFX,
TRAIN_CLUTTERC_SFX,
TRAIN_CLUTTERD_SFX,
TRAIN_CLUTTERB_SFX,
TRAIN_CLUTTERC_SFX,
TRAIN_CLUTTERD_SFX,
GUN_B9_CANNON_SHORT_SFX,
UNKNOWN_QUIET_SFX,
CAMERA_ZOOM_LOOP_SFX,
CAMERA_ZOOM_STOP_SFX,
UNKNOWN_QUIET_SFX,
CAMERA_ZOOM_LOOP_SFX,
CAMERA_ZOOM_STOP_SFX,
SNEEZE_SFX,
RARELOGO_SFX,
RARELOGO_QUIET_SFX,
RARELOGO_FAINT_SFX,
RARELOGO_QUIET_SFX,
RARELOGO_FAINT_SFX,
BIG_CLANK_SFX
} SFX_ID;
@@ -2297,7 +2434,7 @@ typedef enum AWARD {
AWARD_MOSTSUICIDAL = 0x00001,
AWARD_WHONEEDSAMMO = 0x00002,
AWARD_WHERESTHEARMOR = 0x00004,
AWARD_WHERESTHEARMOUR = 0x00004,
AWARD_ACNEGATIVE10 = 0x00008,
AWARD_MARKSMANSHIP = 0x00010,
AWARD_MOSTPROFESSIONAL = 0x00020,
@@ -2360,6 +2497,20 @@ typedef enum TVCMD
TVCMD_ROTATEREL = 0x0f
} TVCMD;
enum CCRMLUT
{
CCRMLUT_UNKNOWN,
CCRMLUT_PRIMARY_ADDFOG,
CCRMLUT_BILLBOARD,
CCRMLUT_WATER,
CCRMLUT_CLOUD,
CCRMLUT_SECONDARY_ADDFOG,
CCRMLUT_PRIMARY,
CCRMLUT_SECONDARY,
CCRMLUT_WALLETBOND,
CCRMLUT_FIXFOGALPHA3
};
#pragma region Object Instance Stuff
typedef enum BODIES
{
@@ -2369,11 +2520,11 @@ typedef enum TVCMD
BODY_Russian_Infantry,
BODY_Janus_Special_Forces,
BODY_Brosnan_Tuxedo,
/*
#ifdef ALL_BONDS
BODY_Connery_Tuxedo,
BODY_Dalton_Tuxedo,
BODY_Moore_Tuxedo,
*/
#endif
BODY_Boris,
BODY_Ourumov,
BODY_Trevelyan_Janus,
@@ -2498,11 +2649,11 @@ typedef enum TVCMD
HEAD_Male_Brosnan_Jungle,
HEAD_Male_Brosnan_Parka,
HEAD_Male_Brosnan_Tuxedo,
/*
#ifdef ALL_BONDS
HEAD_Male_Connery_Tuxedo,
HEAD_Male_Dalton_Tuxedo,
HEAD_Male_Moore_Tuxedo,
*/
#endif
HEAD_Natalya_Jungle_Fatigues,
HEAD_END,
/*The following are some maybe helpfull counts (maybe GE doesnt need them, but thought Id ad while here)*/
@@ -2857,7 +3008,12 @@ typedef enum TVCMD
PROP_MAX
} PROP;
typedef enum PROJECTILES
#define MAX_MULTI_PROP_IDS 600
#define MAX_DROPPED_PROP_IDS 1000
#define DROPPED_PROP_ID_NUMBIT 0x1fff
#define GUNTYPE_NUMBITS 127
typedef enum PROJECTILES
{
PROJECTILES_MAX = 0x2E,
PROJECTILES_TYPE_KNIFE = PROP_CHRKNIFE,
@@ -2890,11 +3046,24 @@ typedef enum TVCMD
PROP_TYPE_MAX
} PROP_TYPE;
#ifdef DEBUG
char *PROP_TYPE_ToString[] = {
"PROP_TYPE_NUL",
"PROP_TYPE_OBJ",
"PROP_TYPE_DOOR",
"PROP_TYPE_CHR",
"PROP_TYPE_WEAPON",
"PROP_TYPE_PLAYER",
"PROP_TYPE_VIEWER",
"PROP_TYPE_EXPLOSION",
"PROP_TYPE_SMOKE" };
#endif
#pragma endregion
#pragma region PropDef stuff
// used by characters
/*Action Type to be performed by chr (canonical names)*/
typedef enum ACT_STATUS
{
@@ -2934,7 +3103,43 @@ typedef enum TVCMD
ACT_STATUS_UNARMEDATTACK,
ACT_STATUS_MAX
} ACT_STATUS;
#ifdef DEBUG
char *ACT_STATUS_ToString[] = {
"NONE",
"NORMAL",
"COVERWAIT",
"GRENADEWAIT",
"WAITING",
"COVERGOTO",
"COVERBREAK",
"COVERSEEN",
"FLANKLEFT",
"FLANKRIGHT",
"DODGE",
"GRENADE",
"WAITSEEN",
"WITHDRAW",
"SHOOTING",
"SYNCSHOOT",
"WAITTIMEOUT",
"COVERTIMEOUT",
"TRACKING",
"RETREAT",
"SURRENDER",
"TALKING",
"LISTENING",
"GOTOALARM",
"BOTFRIENDFOLLOW",
"BOTHIDE",
"BOTPATH",
"BOTINJURED",
"BOTNORMAL",
"BOTSHOOTING",
"DRUGGED",
"PANIC",
"RUNFROMGRENADE",
"UNARMEDATTACK"};
#endif
/*Action Type to be performed by chr (canonical names)*/
typedef enum ACT_TYPE
{
@@ -2948,7 +3153,7 @@ typedef enum TVCMD
ACT_PREARGH,
ACT_ATTACK,
ACT_ATTACKWALK,
ACT_ATTACKROLL,
ACT_ATTACKROLL, // 10
ACT_SIDESTEP,
ACT_JUMPOUT,
ACT_RUNPOS,
@@ -2958,7 +3163,7 @@ typedef enum TVCMD
ACT_LOOKATTARGET,
ACT_SURPRISED,
ACT_STARTALARM,
ACT_THROWGRENADE,
ACT_THROWGRENADE, // 20
ACT_TURNDIR,
ACT_TEST,
ACT_BONDINTRO,
@@ -2973,12 +3178,43 @@ typedef enum TVCMD
ACT_DRUGGEDCOMINGUP
ACT_ATTACKAMOUNT
ACT_ROBOTATTACK
ACT_SKJUMP*
ACT_SKJUMP*
*/
ACT_NULL,
ACT_TYPE_MAX
} ACT_TYPE;
#ifdef DEBUG
char *ACT_TYPE_ToString[] = {
"ACT_INIT",
"ACT_STAND",
"ACT_KNEEL",
"ACT_ANIM",
"ACT_DIE",
"ACT_DEAD",
"ACT_ARGH",
"ACT_PREARGH",
"ACT_ATTACK",
"ACT_ATTACKWALK",
"ACT_ATTACKROLL", // 10
"ACT_SIDESTEP",
"ACT_JUMPOUT",
"ACT_RUNPOS",
"ACT_PATROL",
"ACT_GOPOS",
"ACT_SURRENDER",
"ACT_LOOKATTARGET",
"ACT_SURPRISED",
"ACT_STARTALARM",
"ACT_THROWGRENADE", // 20
"ACT_TURNDIR",
"ACT_TEST",
"ACT_BONDINTRO",
"ACT_BONDDIE",
"ACT_BONDMULTI",
"ACT_NULL"};
#endif
typedef enum AMMOTYPE
{
@@ -3017,13 +3253,6 @@ typedef enum TVCMD
AMMOTYPE_MAX
} AMMOTYPE;
typedef enum DOORSTATE
{
DOORSTATE_STATIONARY,
DOORSTATE_OPENING,// also OPEN but NOT AIlist compatible (02)
DOORSTATE_CLOSING, // also CLOSE but NOT AIlist compatible (01)
DOORSTATE_WAITING
} DOORSTATE;
typedef enum HATTYPE
{
HATTYPE_OTHER = -1,
@@ -3154,7 +3383,7 @@ typedef enum TVCMD
PROPDEF_RACK,
PROPDEF_AUTOGUN,
PROPDEF_LINK,
PROPDEF_UNK15,
PROPDEF_DEBRIS,
PROPDEF_UNK16,
PROPDEF_HAT,
PROPDEF_GUARD_ATTRIBUTE,
@@ -3194,12 +3423,12 @@ typedef enum TVCMD
#pragma endregion
#pragma region Setup
#pragma region Setup
/**
* enums were listed in a particular order, it appears the first few are associated with the start/intro
* of a level:
* if (g_CurrentPlayer->redbloodfinished && g_CurrentPlayer->deathanimfinished && (D_80036510 >= CAMERAMODE_SWIRL))
* if (g_CurrentPlayer->redbloodfinished && g_CurrentPlayer->deathanimfinished && (camera_mode >= CAMERAMODE_SWIRL))
*/
typedef enum CAMERAMODE
{
@@ -3208,12 +3437,12 @@ typedef enum TVCMD
CAMERAMODE_FADESWIRL,
CAMERAMODE_SWIRL,
CAMERAMODE_FP,
CAMERAMODE_DEATH_CAM_FIRST,
CAMERAMODE_DEATH_CAM_SECOND,
CAMERAMODE_DEATH_CAM_SP,
CAMERAMODE_DEATH_CAM_MP,
CAMERAMODE_POSEND,
CAMERAMODE_FP_NOINPUT,
CAMERAMODE_MP,
CAMERAMODE_UNK10,
CAMERAMODE_FADE_TO_TITLE,
CAMERAMODE_COUNT
} CAMERAMODE;
@@ -3284,11 +3513,17 @@ typedef enum TVCMD
SCREEN_RATIO_16_9
} SCREEN_RATIO_OPTION;
//canonically MD
typedef enum VIDEOMODE
{
VIDEOMODE_DISABLE_320x240,
VIDEOMODE_320x240,
VIDEOMODE_640x480
MD_BLACK,
MD_NORMAL,
MD_MAXIMUM,
//just in case someone commits with old name
VIDEOMODE_DISABLE_320x240 = MD_BLACK,
VIDEOMODE_320x240 = MD_NORMAL,
VIDEOMODE_640x480 = MD_MAXIMUM
} VIDEOMODE;
#pragma endregion
@@ -3296,7 +3531,7 @@ typedef enum TVCMD
#define MAXROOMCOUNT 150
#else
#define MAXROOMCOUNT 139
#endif
#endif
/* special chr num IDs */
@@ -3379,23 +3614,23 @@ typedef enum TVCMD
#define getBoundPadNum(pad) pad - 10000
#define setBoundPadNum(pad) pad + 10000
/* AI Catagory */
#define isGlobalAIListID(ID) ((ID) < 1025)
#define isBGAIListID(ID) ((ID) > 4097)
#define isGlobalAIListID(ID) ((ID) <= 1024)
#define isBGAIListID(ID) ((ID) >= 4096)
#define isChrAIListID(ID) (!isGlobalAIListID(ID) && !isBGAIListID(ID))
#define setGlobalAIListID(ID) ((ID) + 0)
#define setChrAIListID(ID) ((ID) + 1025)
#define setBGAIListID(ID) ((ID) + 4096)
#define getGlobalAIListID(ID) ((ID)-0)
#define getChrAIListID(ID) ((ID)-1025)
#define getBGAIListID(ID) ((ID)-4096)
#define getGlobalAIListID(ID) ((ID) - 0)
#define getChrAIListID(ID) ((ID) - 1025)
#define getBGAIListID(ID) ((ID) - 4096)
/* language file to slot allocation */
#define TEXT(TEXTBANK, TEXTSLOT) ((TEXTBANK * 0x0400U) + TEXTSLOT)
#define getStringID(TEXTBANK, TEXTSLOT) ((TEXTBANK * 0x0400U) + TEXTSLOT)
/* Image ID to RAM allocation */
#define IMAGESEG(id) 0xABCD0000 | id
/*Doesnt work! might be handy for something else
/*Doesnt work! might be handy for something else
#define setMask(t)\
(t) <= 2 ? 1\
: (t) <= 4 ? 2\
@@ -3408,7 +3643,7 @@ typedef enum TVCMD
: (t) <= 512 ? 9\
: (t) <=1024 ? 10\
: "TEXTURE TOO BIG (>1024)"*/
//macros for FILERECORDS
#define SKELETON(NAME) skeleton_ ## NAME
#define JOINTLIST(NAME) jointlist_ ## NAME
+6
View File
@@ -5,6 +5,8 @@
#include <bondconstants.h> // game constants
#include <bondtypes.h> // game structs and types
extern u32 *_bssSegmentEnd;
extern u32 *_codeSegmentStart;
extern u32 *_codeSegmentEnd;
extern u32 *_codeSegmentRomStart;
@@ -25,6 +27,10 @@ extern u32 *_gameSegmentVaddrEnd;
extern u32 *_gameSegmentRomStart;
extern u32 *_gameSegmentRomEnd;
extern u32* _animation_dataSegmentRomStart;
extern u32* _animation_dataSegmentStart;
extern u32* _animation_dataSegmentEnd;
extern u32* _alt_startSegmentRomStart;
extern u32* _alt_startSegmentStart;
+278 -154
View File
@@ -10,7 +10,7 @@
* Sometimes its nice to be verbose and see the structures instead of
* random arrays or conglomerate integers.
*
*
*
* While typedefs are used to avoid typing "struct" and to help intellisence
* they are not foolproof.
* Using structs before they are declaired need to have the struct keyword or
@@ -19,7 +19,7 @@
* Structs that "inherit" other structs can use the syntax
* struct A {int adef};
* struct B {inherits A; int extra};
*
*
* using adef from B is as simple as calling B->adef, no need for sub-structs anymore
*/
#ifndef _BONDTYPES_H_
@@ -31,9 +31,9 @@
/**
* Syntax Sugar for clarification of intent
* Inheritance allows child structs to directly use parent elements
* without sub-struct style calls
* obj->type and wep->base.type becomes simply
* Inheritance allows child structs to directly use parent elements
* without sub-struct style calls
* obj->type and wep->base.type becomes simply
* obj->type and wep->type (wep inherits obj)
* Usage:
* Define the first entry to the inheriting struct as "inherits xxx"
@@ -58,7 +58,7 @@ struct WeaponObjRecordExtended;
union ModelRoData;
/**
* The following region deals with various AI structures that can be applied to
* The following region deals with various AI structures that can be applied to
* the AI bytestream
*/
#pragma region AI
@@ -124,7 +124,7 @@ typedef union
u8 a;
};
u8 rgba[4];
s32 word;
u32 word; //added to match
};
} rgba_u8;
@@ -185,7 +185,7 @@ typedef union
};
} rgba_s32;
#pragma endregion
#pragma endregion
#pragma region coordinates
/**
@@ -379,9 +379,11 @@ typedef union
typedef struct StandTilePoint
{
inherits coord16; //points for tile
u16 link; //link to nother tile
u16 link; //link to another tile
} StandTilePoint;
/*
unused struct for clarity of intent
*/
typedef struct StandTileHeaderMid
{
u16 special : 4;// 0=normal 1=kneeling 3=ladder
@@ -405,7 +407,7 @@ typedef union
u16 GroupID : 4; // a1,a2,a3...z5,z6,z7
u16 RoomID : 4; // compared to 0xFF, not -1 in a function. Seen LBUs.
*/
u32 name1 : 24;
u32 id : 24;
u8 room; // compared to 0xFF, not -1 in a function. Seen LBUs.
@@ -438,7 +440,7 @@ typedef union
typedef struct StandFileTile
{
u32 name1 : 24;
u32 id : 24;
//u8 name2;
u8 room; // compared to 0xFF, not -1 in a function. Seen LBUs.
union
@@ -520,15 +522,13 @@ typedef union
typedef struct BetaStandTile
{
const char *debugName;
const char *id;
StandTileHeaderMid headerMid;
u16 betaUnknown;
BetaStandTileHeaderTail hdrTail;
struct BetaStandFilePoint points[];
} BetaStandTile;
StandTilePoint *stanMatchTileName(char *);
#pragma endregion
//Animation controller located in initobjects.h
@@ -542,17 +542,30 @@ typedef union
// unknown struct, unknown size.
typedef struct ModelAnimation
{
s32 unk00;
u16 unk04;
s32 address;
u16 unk04; //nextframe
u16 unk06;
u16 unk08;
u16 unk0A;
u16 unk0C;
u16 unk0E;
int unk10;
int unk14;
int unk18;
int unk1c;
int unk20;
int unk24;
int unk28;
int unk2c;
int unk30;
int unk34;
int unk38;
int unk3c; //endframe
// ...
} ModelAnimation;
struct object_animation_controller
{
void *ptranimation; // 0x00
@@ -668,27 +681,31 @@ typedef union
/**
* Taken from PD, unsure that all of the fields line up
*/
typedef struct ModelRenderData {
/*0x00*/ Mtxf *unk00;
/*0x04*/ bool zbufferenabled;
/*0x08*/ u32 flags;
/*0x0c*/ Gfx *gdl;
/*0x10*/ Mtxf *unk10;
/*0x14*/ u32 unk14;
/*0x18*/ u32 unk18;
/*0x1c*/ u32 unk1c;
/*0x20*/ u32 unk20;
/*0x24*/ u32 unk24;
/*0x28*/ u32 unk28;
/*0x2c*/ u32 unk2c;
/*0x30*/ s32 unk30;
/*0x34*/ u32 envcolour;
/*0x38*/ u32 fogcolour;
/*0x3c*/ u32 cullmode;
typedef struct ModelRenderData
{
Mtxf *unk_matrix; /*0x00 */
bool zbufferenabled; /*0x04*/
u32 flags; /*0x08*/
Gfx *gdl; /*0x0c*/
Mtxf *mtxlist; /*0x10 */
u32 unk14; /*0x14*/
u32 unk18; /*0x18*/
u32 unk1c; /*0x1c*/
u32 unk20; /*0x20*/
u32 unk24; /*0x24*/
u32 unk28; /*0x28*/
u32 unk2c; /*0x2c*/
s32 PropType; /*0x30*/
rgba_u8 envcolour; /*0x34*/
rgba_u8 fogcolour; /*0x38*/
u32 cullmode; /*0x3c*/
} ModelRenderData;
/**
* Binary compatible with gbi Vtx but more verbose and with "collision"
* Binary compatible with gbi Vtx but more verbose and with "collision"
* information in place of "flags" for use in Openflight Records below
*/
typedef struct Vertex
@@ -1245,6 +1262,12 @@ typedef union
Gfx *gdl;
} ModelRwData_DisplayList_CollisionRecord;
// placeholder struct when need to access offset but don't know type.
struct ModelRwData_Raw
{
s32 unk00;
};
#pragma endregion Model Node OpCode Definitions
/*
@@ -1289,6 +1312,7 @@ typedef union
struct ModelRwData_SwitchRecord Switch;
struct ModelRwData_HeadPlaceholderRecord HeadPlaceholder;
struct ModelRwData_DisplayList_CollisionRecord DisplayListCollisions;
struct ModelRwData_Raw Raw;
};
@@ -1416,12 +1440,12 @@ typedef union
};
/**
* I beleve that "datas" is actually " struct modeldata_root" and that
* I beleve that "datas" is actually " struct modeldata_root" and that
* unk1c is the model node data array
*/
typedef struct Model
{
u8 unk00; /*0x00*/ // objInit() indicates that unk00 is a s16...
s16 unk00; /*0x00*/ // objInit() indicates that unk00 is a s16...
s16 Type; /*0x01*/ // but modelInit() indicates that Type is a s16...
// not sure which is correct.
@@ -1591,13 +1615,13 @@ typedef union
/**
//##Paths
Paths are formed by connecting several pads together in 3 tables.
The first table is the waypoint node table which lists the pad used, and
The first table is the waypoint node table which lists the pad used, and
the subset group the waypoint belongs to.
Next is the waygroup table which lists the IDs of the waypoints that
Next is the waygroup table which lists the IDs of the waypoints that
belong to each group. waypoints are grouped into subsets to reduce
calculations on large numbers of nodes.
Finally is the Path table which again lists all the waypoints used in
the path and gives the path an ID. Paths do not contribute to pathfinding.
@@ -1606,7 +1630,7 @@ typedef union
/**
* The waypoint table lists the pad used, and the group the waypoint
* The waypoint table lists the pad used, and the group the waypoint
* belongs to as well as any connected waypoints.
*/
typedef struct waypoint
@@ -1619,7 +1643,7 @@ typedef union
/**
* The Subset waygroup table which lists the IDs of the waypoints that
* The Subset waygroup table which lists the IDs of the waypoints that
* belong to each group as well as any connected groups
*/
typedef struct waygroup
@@ -1721,10 +1745,10 @@ typedef union
struct act_anim
{
u32 unk02c; /*0x2c*/
u32 unk30; /*0x30*/
u32 unk034; /*0x34*/
u32 unk038; /*0x38*/
u32 unk03c; /*0x3c*/
u32 holdLastFrame; /*0x30*/
u32 playSfx; /*0x34*/
u32 idleOnEnd; /*0x38*/
u32 noTranslate; /*0x3c*/
u8 unk040; /*0x40*/
u8 unk041; /*0x41*/
u16 unk042; /*0x42*/
@@ -2145,7 +2169,7 @@ typedef union
#pragma region Prop, Chr and Definition Records
/**
* Prop Record holds the relationship between various "props" on a stage.
@@ -2161,8 +2185,9 @@ typedef union
struct ObjectRecord *obj;
struct DoorRecord *door;
struct WeaponObjRecord *weapon;
void *explosion;
void *smoke;
struct Explosion *explosion;
struct Smoke *smoke;
struct Scorch *scorch;
void *voidp;
}; /*0x04*/
coord3d pos; /*0x08*/
@@ -2171,7 +2196,7 @@ typedef union
/**
* Maybe float. Something related to draw (render) distance.
*/
f32 Unk18;
f32 zDepth; /*0x18*/
struct PropRecord *parent; /*0x1c*/
struct PropRecord *child; /*0x20*/
struct PropRecord *prev; /*0x24*/
@@ -2197,7 +2222,7 @@ typedef union
} PropRecord;
#pragma region GlobalPropDef
/**
* sizeof = 0x2c = 44 bytes.
*/
@@ -2237,7 +2262,7 @@ typedef union
x2
x1 damaged
*/
u8 state;
u8 state;
u8 type; /*0x3*/
} PropDefHeaderRecord;
#define New_PropDefHeaderRecord(scale, Type) \
@@ -2378,7 +2403,10 @@ typedef union
// there should be some ALSoundState * pointers in here.
//
PropRecord *weapons_held[3]; /* handle_positiondata 0x0160 0x0164 0x0168 Right, Left, Hat*/
s8 fireslot[2]; /* 0x016C 0x0170*/
union {
s32 fireslot_word;
s8 fireslot[2]; /* 0x016C 0x0170*/
};
int *ptr_SEbuffer3;
int *ptr_SEbuffer4;
int field_178[2];
@@ -2433,7 +2461,7 @@ typedef union
f32 unk78[4];
struct PropRecord* ownerprop; // 0x88
f32 unk8C;
f32 unk8C;
u32 unk90;
f32 unk94;
@@ -2448,7 +2476,7 @@ typedef union
f32 unkB0; // runtime y position?
f32 unkB4; // previous pos.y?
DROPTYPE droptype; // 0xB8
u32 refreshrate; // 0xBC;
s32 refreshrate; // 0xBC;
f32 unkC0;
f32 unkC4;
@@ -2588,7 +2616,7 @@ typedef union
PropRecord *prop; /*0x10*/
Model *model; /*0x14*/
// mtx realrot;
#if 0
#if 0
void *runtime_MATRIX0; /*0x18*/
void *runtime_MATRIX1; /*0x1c*/
void *runtime_MATRIX2; /*0x20*/
@@ -2610,41 +2638,43 @@ typedef union
coord3d runtime_pos; /*0x58 - 0x60*/
union
{
/*This union is a test but is less efficant than doing binary compare by hand eg runtimebitflags && REMOVED*/
#if 0
/*This union is a test but is less efficient than doing binary compare by hand eg runtimebitflags && REMOVED*/
struct
{
bool a00000001 : 1;
bool a00000002 : 1;
bool remove : 1; /* removes object when set */
bool a00000008 : 1;
bool a00000010 : 1;
bool a00000020 : 1;
bool a00000040 : 1;
bool isDeposited : 1; /* depositted (thrown) */
bool hasBeenOpened : 1;
bool isDestroyed : 1; /* only set with disabled or destroyed doors */
bool a00000400 : 1;
bool a00000800 : 1;
bool a00001000 : 1;
bool a00002000 : 1;
bool isActivated : 1; /* activated*/
bool a00008000 : 1;
bool a00010000 : 1;
bool _80000000 : 1;
bool _40000000 : 1;
bool _20000000 : 1;
bool _10000000 : 1;
bool _08000000 : 1;
bool _04000000 : 1;
bool _02000000 : 1;
bool _01000000 : 1;
bool _00800000 : 1;
bool _00400000 : 1;
bool _00200000 : 1;
bool _00100000 : 1;
bool _00080000 : 1;
s32 owner : 2; /*Owner 2bit (0-3)*/
bool a00080000 : 1;
bool a00100000 : 1;
bool a00200000 : 1;
bool a00400000 : 1;
bool a00800000 : 1;
bool a01000000 : 1;
bool a02000000 : 1;
bool a04000000 : 1;
bool a08000000 : 1;
bool a10000000 : 1;
bool a20000000 : 1;
bool a40000000 : 1;
bool a80000000 : 1;
};
bool _00010000 : 1;
bool _00008000 : 1;
bool isActivated : 1; /* activated*/
bool _00002000 : 1;
bool _00001000 : 1;
bool _00000800 : 1;
bool _00000400 : 1;
bool isDestroyed : 1; /* only set with disabled or destroyed doors */
bool hasBeenOpened : 1;
bool isDeposited : 1; /* depositted (thrown) */
bool _00000040 : 1;
bool _00000020 : 1;
bool _00000010 : 1;
bool _00000008 : 1;
bool remove : 1; /* removes object when set */
bool _00000002 : 1;
bool _00000001 : 1;
} runtime_bitflag;
#endif
/*0x64*
10000000
00060000 owner (0-3); used to attribute kills to players
@@ -2835,15 +2865,7 @@ typedef union
Vertex* unkcc; /*0xcc*/
// maybe struct ModelRoData_BoundingBoxRecord *
u32 unkd0;
u32 unkd4;
u32 unkd8;
u32 unkdc;
u32 unke0;
u32 unke4;
u32 unke8;
struct ModelRoData_BoundingBoxRecord bbox;
/**
* When the door completely opens, the current global timer value is
@@ -2872,9 +2894,17 @@ typedef union
/**
* Copy of global timer value.
*
* For each sibling, the original frac is backed up into the sibling's
* lastcalc60 field. The desired frac is then calculated and set in the
* sibling's frac property. Then collision checks are done, and the original
* frac is restored if any sibling is blocked.
* Offset 0xfc.
*/
u32 timer;
union {
s32 lastcalc60i;
f32 lastcalc60f;
};
} DoorRecord;
#define New_DoorRecord(pad) \
@@ -2882,13 +2912,13 @@ typedef union
New_PropDefHeaderRecord(1), New_ObjectRecord(pad) \
}
/** PROPDEF_GLOBAL_DOOR_SCALE (2)
* The value is used for door calculations. Changing it will shrink/enlarge doors.
* Why they ever made it is beyond me.
* @param Scale: Fixed-Point converted to float and divided by 65536 (0x10000)
*/
typedef struct GlobalDoorScaleRecord
typedef struct GlobalDoorScaleRecord
{
inherits PropDefHeaderRecord;
s32 Scale;
@@ -2998,22 +3028,22 @@ typedef union
typedef struct CCTVRecord
{
struct ObjectRecord;
s32 unk80;
s32 pad;
Mtxf unk84;
f32 unkC4;
f32 unkC8;
f32 unkCC;
f32 unkD0;
s32 unkD4;
f32 unkD8;
f32 unkDC;
s32 timer; // 0xe0
s32 unkE4;
s32 convert_to_f32;
f32 unkE8;
s32 unkEC;
s32 unkF0;
s32 unkF4;
s32 unkF8;
@@ -3175,9 +3205,18 @@ typedef union
// PROPDEF_LINK (14)
typedef struct LinkRecord
{
inherits PropDefHeaderRecord;
s32 Index1;
s32 Index2;
struct PropDefHeaderRecord;
union
{
struct PropRecord *first;
s32 Index1;
};
union
{
struct PropRecord *second;
s32 Index2;
};
struct LinkRecord *next;
} LinkRecord;
#define New_LinkRecord(ID1, ID2) \
{ \
@@ -3198,15 +3237,16 @@ typedef union
inherits PropDefHeaderRecord;
s32 chrnum; //0x4
s16 unk8; //0x8
s8 unkA; // 0xa
s8 unkA; // 0xa
s8 GrenadeProb; //0xb
} GuardAttributeRecord;
#define New_SwitchRecord(ID1, ID2) \
#define New_GuardAttributeRecord(ID1, ID2) \
{ \
New_PropDefHeaderRecord(19), ID1 + 0, ID2 + 0 \
}
// PROPDEF_SWITCH (19) - see LinkRecord
typedef LinkRecord SwitchRecord;
#define New_SwitchRecord(ID1, ID2) \
{ \
New_PropDefHeaderRecord(19), ID1 + 0, ID2 + 0 \
@@ -3216,7 +3256,7 @@ typedef union
typedef struct MultiAmmoCrateRecord
{
inherits ObjectRecord;
s16 unk80;
u16 unk80;
u16 quantities[AMMOTYPE_GLOBAL_MAX]; // indexed by ammotype /*0x80*/
} MultiAmmoCrateRecord;
#define New_MultiAmmoCrateRecord(pad) \
@@ -3228,7 +3268,8 @@ typedef union
typedef struct BodyArmourRecord
{
inherits ObjectRecord;
u32 Strength;
f32 initialamount;
f32 amount;
} BodyArmourRecord;
#define New_BodyArmourRecord(pad) \
{ \
@@ -3322,7 +3363,7 @@ typedef union
New_PropDefHeaderRecord(28), TagID + 0 \
}
// PROPDEF_OBJECTIVE_DEPOSIT_OBJECT (29)
// PROPDEF_OBJECTIVE_DEPOSIT_OBJECT (29)
typedef struct DepositObjectRecord
{
inherits PropDefHeaderRecord;
@@ -3338,6 +3379,9 @@ typedef union
{
inherits PropDefHeaderRecord;
u16 unk4;
u16 unk6;
u32 unk8;
PropRecord *lastprop;
} PhotographObjectRecord;
#define New_CollectObjectRecord(TagID) \
{ \
@@ -3359,6 +3403,8 @@ typedef union
{
inherits PropDefHeaderRecord;
u16 unk4;
u32 unk8;
s32 lastroomentered;
} EnterRoomRecord;
#define New_CollectObjectRecord(TagID) \
{ \
@@ -3402,7 +3448,15 @@ typedef union
typedef struct RenameObjectRecord
{
inherits PropDefHeaderRecord;
//u16 TagID;
s32 TagID;
s32 unk08;
s32 unk0c;
s32 unk10;
s32 unk14;
s32 unk18;
s32 unk1c;
s32 unk20;
ObjectRecord *renobj;
} RenameObjectRecord;
#define New_RenameObjectRecord(TagID) \
{ \
@@ -3413,10 +3467,17 @@ typedef union
typedef struct LockDoorRecord
{
inherits PropDefHeaderRecord;
struct DoorRecord* door;
struct ObjectRecord* lock;
union
{
struct DoorRecord* door;
s32 Index1;
};
union
{
struct ObjectRecord* lock;
s32 Index2;
};
struct LockDoorRecord* next;
//u16 TagID;
} LockDoorRecord;
#define New_RenameObjectRecord(TagID) \
{ \
@@ -3467,7 +3528,7 @@ typedef union
f32 speedaim; /*0x9c*/
f32 speedtime60; /*0xa0*/
f32 yrot; /*0xa4*/
f32 nextstep; /*0xa8*/
s32 nextstep; /*0xa8*/
PathRecord *path; /*0xac*/
struct ALSoundState *Sound; /*0xb0*/
} AircraftRecord;
@@ -3495,10 +3556,19 @@ typedef union
//PROPDEF_SAFE_ITEM (42)
typedef struct SafeObjectRecord
{
u32 unk00;
struct ObjectRecord *item;
struct SafeRecord *safe;
struct DoorRecord *door;
inherits PropDefHeaderRecord;
union {
struct ObjectRecord *item;
s32 Index1;
};
union {
struct SafeRecord *safe;
s32 Index2;
};
union {
struct DoorRecord *door;
s32 Index3;
};
struct SafeObjectRecord *next;
} SafeObjectRecord;
@@ -3520,10 +3590,10 @@ typedef union
s32 unkA8;
s32 unkAC;
s32 unkB0;
s32 unkB4;
s32 unkB8;
s32 unkBC;
s32 unkC0;
s32 unkB4; // Tank! Acceleration
s32 unkB8; // Tank! Top Speed, Low Angle, Gun Type, Gun Check
s32 unkBC; // Tank! Ignition sfx, Idle sfx
s32 unkC0; // Tank! Motion sfx, crush sfx
s32 is_firing_tank;
f32 turret_vertical_angle;
f32 turret_orientation_angle;
@@ -3558,7 +3628,7 @@ typedef union
s32 TintDist;
s32 CullDist;
s32 calculatedopacity;
s32 unk8c;
s32 portalnum;
f32 unk90;
} TintedGlassRecord;
#define New_TintedGlassRecord(pad) \
@@ -3746,7 +3816,7 @@ struct SetupIntroCredits
u16 reserved;//8
u16 text; //a
u16 unkC; //c
s8 unkD; //d
u8 unkD; //d
s8 difficulty; //f
};
#pragma endregion Objectives
@@ -3803,32 +3873,39 @@ struct SetupIntroCredits
#pragma endregion Player
#pragma region stagesetup.h
typedef struct stagesetup
{
waypoint *pathwaypoints;
waygroup *waypointgroups;
struct SetupIntroEmpty *intro;
PropDefHeaderRecord *propDefs;
PathRecord *patrolpaths;
AIListRecord *ailists;
PadRecord *pads;
BoundPadRecord *boundpads;
char *padnames;
char *boundpadnames;
} stagesetup;
struct pname {
union {
char *p;
s32 offset;
};
};
typedef struct stagesetup
{
waypoint *pathwaypoints;
waygroup *waypointgroups;
struct SetupIntroEmpty *intro;
PropDefHeaderRecord *propDefs;
PathRecord *patrolpaths;
AIListRecord *ailists;
PadRecord *pads;
BoundPadRecord *boundpads;
struct pname *padnames;
struct pname *boundpadnames;
} stagesetup;
#pragma endregion stagesetup.h
typedef struct sfxRecord //Need 24 size
{
ALSoundState *state; //0
s32 Volume2; //4
s32 sfxID; //8
s32 Volume; //12
coord3d *pos; //16
ObjectRecord *Obj; //20
} sfxRecord;
typedef struct sfxRecord //Need 24 size
{
ALSoundState *state; //0
s32 Volume2; //4
s32 sfxID; //8
s32 Volume; //12
coord3d *pos; //16
ObjectRecord *Obj; //20
} sfxRecord;
@@ -3911,7 +3988,7 @@ struct MoveData {
f32 zoomOutFovPersec;
s32 zooming;
s32 aiming;
// 0x50
s32 weaponForwardOffset;
s32 weaponBackOffset;
@@ -3953,11 +4030,18 @@ struct unkown_gun_struct
struct
{
s32 unk00;
s32 unk04;
s32 unk04;
};
};
};
struct setup_objective_text {
s32 unk00;
s32 unk04;
s32 unk08;
struct setup_objective_text *next;
};
/* matches Perfect Dark */
struct criteria_roomentered {
u32 unk00;
@@ -3966,6 +4050,7 @@ struct criteria_roomentered {
struct criteria_roomentered *next;
};
/* completely made up */
struct criteria_deposit {
s32 unk00;
@@ -3975,6 +4060,13 @@ struct criteria_deposit {
struct criteria_deposit *next;
};
struct criteria_picture {
s32 unk00;
s32 tag_id;
s32 flag;
struct criteria_picture *next;
};
struct PortalMetric {
struct coord3d normal;
f32 min;
@@ -3987,4 +4079,36 @@ struct FolderSelect {
s32 unk08;
};
struct damage_display_val {
s16 unk00;
s16 unk02;
s16 unk04;
s16 unk06;
s16 unk08;
s16 unk0A;
s8 unk0C;
s8 unk0D;
s8 unk0E;
s8 unk0F;
};
struct damage_display_parent {
struct damage_display_val items[2];
};
// is this the same as damage_display_val ?
struct s_display_list_something
{
s16 unk0;
s16 unk2;
s16 unk4;
s16 unk6;
s16 unk8;
s16 unkA;
u8 unkC;
u8 unkD;
u8 unkE;
u8 unkF;
};
#endif
+27 -41
View File
@@ -33,23 +33,23 @@
#include "game/debugmenu_handler.h"
#include "game/lvl.h"
#include "game/ramromreplay.h"
#include "game/room_model_buffer.h"
#include "game/rsp.h"
#include "game/stan.h"
#include "game/textrelated.h"
#include "game/player.h"
#include "game/unk_0C0A70.h"
/**
* EU .data, offset from start of data_seg : 0x33e0
*/
#include "PR/R4300.h"
/**
* @file boss.c
* This file contains the main game loop code.
* @brief Main game loop and initialization functions.
*
* This file contains the core functions that drive the game loop, manage stages, and handle debug operations.
*/
#ifdef REFRESH_PAL
#define MAIN_LOOP_TICK_INTERVAL D_800484B4 * 0xe34ea - 0x71a75U
#define MAIN_LOOP_TICK_INTERVAL frameDelay * 0xe34ea - 0x71a75U
#else
#define MAIN_LOOP_TICK_INTERVAL 0x5eb61U
#endif
@@ -76,12 +76,12 @@ void bossMainloop(void);
/* data */
u32 g_BossDebugNoticeEntry = 0;
s32 g_DebugAndUpdateStageFlag = 0;
s32 g_DebugAndUpdateStageFlag = FALSE;
s32 g_StageNum = LEVELID_TITLE;
u32 g_CurentMMallocValue = 0x234800;
u32 g_CurentMaMallocValue = 0x4B000;
s32 g_ShowMemUseFlag = 0;
s32 g_ShowMemBarsFlag = 0;
s32 g_ShowMemUseFlag = FALSE;
s32 g_ShowMemBarsFlag = FALSE;
struct memallocstring memallocstringtable[] = {
{ LEVELID_DAM, "-ml0 -me0 -mgfx70 -mvtx50 -mt625 -ma275"},
@@ -120,14 +120,14 @@ struct memallocstring memallocstringtable[] = {
{ LEVELID_CAVERNS_MP , "-ml0 -me0 -mgfx130 -mvtx100 -mt440 -ma220"},
{ LEVELID_FACILITY_MP , "-ml0 -me0 -mgfx90 -mvtx100 -mt550 -ma230"},
{ LEVELID_EGYPT_MP , "-ml0 -me0 -mgfx110 -mvtx100 -mt350 -ma400"},
{ 0x0, "-ml0 -me0 -mgfx100 -mvtx50 -mt700 -ma400"},
{ LEVELID_DEFAULT, "-ml0 -me0 -mgfx100 -mvtx50 -mt700 -ma400"},
{ 0x0, },
{ 0x0, },
{ 0x0, }
};
s32 g_MainStageNum = LEVELID_NONE;
s32 g_BossIsDebugMenuOpen = 0;
s32 g_BossIsDebugMenuOpen = FALSE;
OSScMsg g_bossGfxDoneMsg = { OS_SC_DONE_MSG };
@@ -146,7 +146,7 @@ void bossInitMainthreadData(void)
OSMesg bossmsg;
OSTimer bosstimer;
OSMesgQueue bossmq;
u32 temp_s0;
u32 start;
u32 unused;
s32 i;
@@ -199,8 +199,8 @@ void bossInitMainthreadData(void)
g_CurentMMallocValue = (s32) (strtol(tokenFind(1, "-m"), 0, 0) << 0xa);
}
temp_s0 = (osVirtualToPhysical(&room_model_buffer) | 0x80000000);
mempCheckMemflagTokens(temp_s0, ((u32)tlbmanageGetTlbAllocatedBlock() - (u32)temp_s0));
start = (PHYS_TO_K0(osVirtualToPhysical(&_bssSegmentEnd)));
mempCheckMemflagTokens(start, ((u32)tlbmanageGetTlbAllocatedBlock() - (u32)start));
mempResetBank(MEMPOOL_PERMANENT);
langInit();
lvInit();
@@ -210,7 +210,7 @@ void bossInitMainthreadData(void)
default_player_perspective_and_height();
store_osgetcount();
null_init_main_1();
speedGraphDisplayListRelated();
speedgraphInit();
set_gu_scale();
null_init_main_2();
sub_GAME_7F000980();
@@ -327,7 +327,7 @@ void bossMainloop(void)
if (g_StageNum != LEVELID_TITLE)
{
fileValidateSaves();
set_selected_folder_num(0);
fileSetCurrentFolder(FOLDER1);
set_selected_difficulty(DIFFICULTY_AGENT);
set_solo_and_ptr_briefing(g_StageNum);
@@ -424,8 +424,8 @@ void bossMainloop(void)
lvlStageLoad(g_StageNum);
viInitBuffers();
debmenuInit();
sub_GAME_7F0C0B4C();
speedGraphVideoRelated_2();
waitForNextFrame();
speedgraphMarkerCommit();
if(1); // regalloc
if(1);
@@ -468,18 +468,12 @@ void bossMainloop(void)
}
else
{
sub_GAME_7F0C0B4C();
waitForNextFrame();
}
#if defined(VERSION_EU)
profileSetMarker();
speedGraphVideoRelated_2();
speedGraphDisplay(0x20000);
#else
video_DL_related_4();
speedGraphVideoRelated_2();
profileSetMarker(0x20000);
#endif
speedgraphRenderGraph();
speedgraphMarkerCommit();
speedgraphMarkerHandler(0x20000);
joyConsumeSamplesWrapper();
permit_stderr(0);
@@ -495,7 +489,7 @@ void bossMainloop(void)
g_BossIsDebugMenuOpen = debug_menu_processor(joyStickXPos, joyStickYPos, joyButtons, joyGetButtonsPressedThisFrame(0, ANY_BUTTON));
} else if (joyGetButtons(0, START_BUTTON) == 0) {
g_DebugMode = g_DebugHighlightedOption;
} else
} else
#endif
#ifndef DEBUGMENU
if (g_BossIsDebugMenuOpen)
@@ -545,11 +539,7 @@ void bossMainloop(void)
if (get_memusage_display_flag())
{
#if defined(VERSION_EU)
gdl = video_DL_related_4(gdl);
#else
gdl = speedGraphDisplay(gdl);
#endif
gdl = speedgraphDisplayMetrics(gdl);
}
if (g_BossIsDebugMenuOpen)
@@ -613,12 +603,8 @@ void bossMainloop(void)
#endif
toggleFlag ^= 1;
#if defined(VERSION_EU)
speedGraphDisplay(0x10000);
speedgraphMarkerHandler(0x10000);
if(1);
#else
profileSetMarker(0x10000);
#endif
}
}
}
@@ -633,7 +619,7 @@ void bossMainloop(void)
break;
}
}
lvlUnloadStageTextData();
stop_demo_playback();
mempNullNextEntryInBank(MEMPOOL_STAGE);
+1 -1
View File
@@ -9,7 +9,7 @@ struct memallocstring
void *string;
};
LEVELID bossGetStageNum();
LEVELID bossGetStageNum(void);
void bossSetLoadedStage(LEVELID stage);
void bossInit(void);
void bossEnableShowMemUseFlag(void);
+4 -4
View File
@@ -518,7 +518,7 @@ const u32 *crashGetParentStackFrame(const u32 *origptr, const u32 *minaddr, cons
* V0=TRUE if opcode that set RA A0 was a JAL or JALR type within bounds (70000450,70020D90)
* accepts: A0=p->70-mapped TLB function, presumably from RA
*/
s32 crashIsReturnAddress(u32 *instruction)
bool crashIsReturnAddress(u32 *instruction)
{
u32 prevop;
@@ -527,14 +527,14 @@ s32 crashIsReturnAddress(u32 *instruction)
prevop = instruction[-2];
if ((prevop & 0xFC00003C) == 9)
{
return 1;
return TRUE;
}
if ((prevop & 0xFC000000) == 0xC000000)
{
return 1;
return TRUE;
}
}
return 0;
return FALSE;
}
/**
+1 -1
View File
@@ -23,7 +23,7 @@ void crashMain(void* arg0);
void crashAppendChar(unsigned char c);
void crashScroll(s32 numlines);
void crashInitBuffers();
void crashInitBuffers(void);
void crashRenderFrame(u16 *buffer);
+1 -1
View File
@@ -55,7 +55,7 @@ u8 *debAllocate(s32 size) {
{
curr -= size;
*pos = curr;
return mempAllocBytesInBank(size, 6);
return mempAllocBytesInBank(size, MEMPOOL_PERMANENT);
}
else
{
+20 -15
View File
@@ -193,7 +193,7 @@ void debmenuResetPosition(void) {
void debmenuReset(void) {
#ifdef LEFTOVERDEBUG
s32 x;
s32 y;
s32 y;
for (y = 0; y < 35; y++) {
for (x = 0; x < 80; x++) {
debmenuWriteCharAtPos(x, y, '\0');
@@ -236,13 +236,16 @@ void debmenu7000AF98(s32 height)
for (x = 0; x != 80; x++)
{
debmenuWriteCharAtPos(x, y, 0);
}
}
}
}
#endif
}
/*
* Address: 0x7000b040
*/
void debmenuSetPos(s32 x, s32 y) {
#ifdef LEFTOVERDEBUG
x += g_DebugMenuTextStartX;
@@ -273,7 +276,7 @@ void debmenuWriteChar(unsigned char c) {
}
g_DebugMenuTextCurrentX++;
if ((c == '\r') || (c == '\n') || (g_DebugMenuTextCurrentX >= width)) {
g_DebugMenuTextCurrentX = g_DebugMenuTextStartX;
g_DebugMenuTextCurrentX = g_DebugMenuTextStartX;
g_DebugMenuTextCurrentY++;
if (g_DebugMenuTextCurrentY >= height) {
g_DebugMenuTextCurrentY = g_DebugMenuTextStartY;
@@ -298,7 +301,7 @@ void debmenuPrintString(const unsigned char *str) {
#endif
}
void debmenuSetPositionAndWriteString(s32 x, s32 y, const unsigned char *str) {
void debmenuSetPositionAndWriteString(s32 x, s32 y, const unsigned char *str) {
#ifdef LEFTOVERDEBUG
debmenuSetPos(x, y);
while (*str != '\0') {
@@ -308,7 +311,9 @@ void debmenuSetPositionAndWriteString(s32 x, s32 y, const unsigned char *str) {
}
/*
* Address: 0x7000b27c
*/
Gfx *debmenuDraw(Gfx *gdl)
{
#if defined(LEFTOVERDEBUG)
@@ -340,15 +345,15 @@ Gfx *debmenuDraw(Gfx *gdl)
gdl2 += 2;
appliedpaletteindex = paletteindex;
}
if (1)
{
gdl2 += 3;
}
}
}
}
}
// Make sure there'll be a least 256 GBI commands free (2KB)
available = dynGetFreeGfx(gdl) - 256 * sizeof(Gfx);
needed = (u32)gdl2 - (u32)gdl;
@@ -360,10 +365,10 @@ Gfx *debmenuDraw(Gfx *gdl)
if(1)
{
s32 appliedpaletteindex = -1;
// Write a "g_DebugMenuPercentage" (out of 255) into a global variable
// which shows how much of the displaylist will be committed,
// provided 2KB is kept free.
// provided 2KB is kept free.
if (available <= 0)
{
// There's already less than 2KB free in the display list
@@ -381,7 +386,7 @@ Gfx *debmenuDraw(Gfx *gdl)
// so the displaylist can be committed in full
g_DebugMenuPercentage = 256;
}
gSPDisplayList(gdl++, g_DebugMenuTextureDisplayList);
// Build the display list for real this time.
@@ -398,7 +403,7 @@ Gfx *debmenuDraw(Gfx *gdl)
s32 paletteindex = g_DebugMenuTextBuffer[x][y].color;
if(x == 80);
if (c != '\0')
{
if (paletteindex != appliedpaletteindex)
@@ -440,8 +445,8 @@ Gfx *debmenuDraw(Gfx *gdl)
}
}
}
#endif // defined(LEFTOVERDEBUG)
return gdl;
}
}
-7
View File
@@ -1,7 +0,0 @@
#include <ultra64.h>
#if defined(LEFTOVERDEBUG)
u8 _decompressBuffer[0xAB400];
#else
u8 _decompressBuffer[0xA1AB0];
#endif
+127 -126
View File
@@ -21,7 +21,7 @@
/**
* @file video.c
* This file contains video handling code.
* This file contains video handling code.
*/
// same codegen as (x & 0xffff)
@@ -35,7 +35,7 @@
/**
* Splits a 32 bit value into upper and lower 16, adds a 16 bit value to each, and combines back to 32 bits.
*
*
* Note: both unsigned 16 bit casts result in the same codegen, but I'm using different
* macros to give a more "natural" explanation of the asm codegen.
*/
@@ -49,17 +49,16 @@
u32 g_unused80023240 = 0;
#if defined(VERSION_EU)
struct VideoSettings_s g_ViDataArray[NUM_VIDEO_SETTINGS] =
struct VideoSettings_s g_ViDataArray[NUM_VIDEO_SETTINGS] =
{
{0, 0, 0, 0, 320, 272, 60.0f, 1.17647063732f, 30.0f, 10000.0f, SCREEN_WIDTH, SCREEN_HEIGHT, 320, 272, 0, 0, 1, NULL},
{0, 0, 0, 0, 320, 272, 60.0f, 1.17647063732f, 30.0f, 10000.0f, SCREEN_WIDTH, SCREEN_HEIGHT, 320, 272, 0, 0, 1, NULL}
{0, 0, 0, 0, 320, 272, 60.0f, 1.17647063732f, 30.0f, 10000.0f, SCREEN_WIDTH, SCREEN_HEIGHT, 320, 272, 0, 0, TRUE, NULL},
{0, 0, 0, 0, 320, 272, 60.0f, 1.17647063732f, 30.0f, 10000.0f, SCREEN_WIDTH, SCREEN_HEIGHT, 320, 272, 0, 0, TRUE, NULL}
};
#else
struct VideoSettings_s g_ViDataArray[NUM_VIDEO_SETTINGS] =
struct VideoSettings_s g_ViDataArray[NUM_VIDEO_SETTINGS] =
{
{0, 0, 0, 0, 320, 240, 60.0f, ASPECT_RATIO_SD, 30.0f, 10000.0f, SCREEN_WIDTH, SCREEN_HEIGHT, 320, 240, 0, 0, 1, NULL},
{0, 0, 0, 0, 320, 240, 60.0f, ASPECT_RATIO_SD, 30.0f, 10000.0f, SCREEN_WIDTH, SCREEN_HEIGHT, 320, 240, 0, 0, 1, NULL}
};
{MD_BLACK, 0, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, FOV_Y_F, ASPECT_RATIO, 30.0f, 10000.0f, SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0, TRUE, NULL},
{MD_BLACK, 0, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, FOV_Y_F, ASPECT_RATIO, 30.0f, 10000.0f, SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0, TRUE, NULL}};
#endif
/**
@@ -193,12 +192,12 @@ void viInitVideoSettings(void)
g_ViFrontIndex = 0;
g_ViBackIndex = 1;
g_ViFrontData = (VideoSettings*)((u8*)&g_ViDataArray + (g_ViFrontIndex * sizeof(VideoSettings)));
g_ViFrontData->framebuf = cfb_16[g_ViFrontIndex];
g_ViFrontData = (VideoSettings*)((u8*)&g_ViDataArray + (g_ViFrontIndex * sizeof(VideoSettings))); //AKA front = viDataArray[0]
g_ViFrontData->framebuf = cfb_16[g_ViFrontIndex];
g_ViBackData = (VideoSettings*)((u8*)&g_ViDataArray + (g_ViBackIndex * sizeof(VideoSettings)));
g_ViBackData = (VideoSettings*)((u8*)&g_ViDataArray + (g_ViBackIndex * sizeof(VideoSettings))); //AKA back = viDataArray[1] - was Rare mental?
g_ViBackData->framebuf = cfb_16[g_ViBackIndex];
g_viHorizontalOffset = 0;
#ifndef VERSION_EU
D_800232A0 = 0;
@@ -233,7 +232,7 @@ void frBlack(u32 black)
* Calls osViSetMode with current viMode.
* Also calls osViBlack.
* Applies verticalOffset to vstart.
*
*
* Looks related to n64devkit\ultra\usr\src\pr\demos\blockmonkey\block.c
* in particular, ModifyVStart
*/
@@ -245,7 +244,7 @@ void viVsyncRelated(void)
if (g_ViShakeTimer > 0)
{
g_ViShakeTimer--;
if (g_ViShakeTimer == 0)
{
g_ViShakeIntensity = 0;
@@ -275,6 +274,8 @@ void viVsyncRelated(void)
g_ViUnblackTimer--;
}
//smooth dither pattern and disable weird gamma
//(N64 was supposed to compensate for CRT's 2.2 gamma, but by this time most games were made with sRGB in mind)
osViSetSpecialFeatures(OS_VI_DITHER_FILTER_ON | OS_VI_GAMMA_OFF);
g_viVstartSign = -g_viVstartSign;
@@ -283,15 +284,15 @@ void viVsyncRelated(void)
/**
* 3E98 70003298
* Some code (and defines) based on n64devkit\ultra\usr\src\pr\demos\blockmonkey\block.c
*
*
* https://decomp.me/scratch/0yXle 98.52%
*
*
* decomp status:
* - compiles: yes
* - stack resize: ok
* - identical instructions: fail
* - identical registers: fail
*
*
* There's a problem loading D_800232C0 the first time (+1 instruction), and again when
* it's being stored (-1 instruction), but the opcodes match other than that.
* Then just some regalloc.
@@ -310,7 +311,7 @@ void video_related_8(void)
{
switch (g_ViBackData->mode)
{
case VIDEOMODE_DISABLE_320x240:
case MD_BLACK:
{
osViSetYScale(1.0f);
osViBlack(TRUE);
@@ -318,7 +319,7 @@ void video_related_8(void)
break;
}
case VIDEOMODE_320x240:
case MD_NORMAL:
{
if (g_viColorOutputMode != COLORMODE_32BIT)
{
@@ -354,7 +355,7 @@ void video_related_8(void)
break;
}
case VIDEOMODE_640x480:
case MD_MAXIMUM:
{
if (osTvType == TV_TYPE_MPAL)
{
@@ -364,7 +365,7 @@ void video_related_8(void)
{
viMode = &osViModeTable[OS_VI_NTSC_HAF1];
}
g_viOriginalHstart = viMode->comRegs.hStart;
g_viOriginalVstart0 = viMode->fldRegs[0].vStart;
g_viOriginalVstart1 = viMode->fldRegs[1].vStart;
@@ -381,18 +382,18 @@ void video_related_8(void)
calculatedXScale = (f32)g_ViBackData->x / (f32)g_ViBackData->bufx;
calculatedYScale = (f32)g_ViBackData->y / (f32)g_ViBackData->bufy;
// osViBlack requires YScale to be 1.0, otherwise,
// osViBlack requires YScale to be 1.0, otherwise,
// "Using it for YScale factors that are not 1.0 creates the potential
// for the video interface to malfunction and enter a state that cannot
// be exited without resetting the system."
if (g_ViBackData->mode == VIDEOMODE_DISABLE_320x240)
if (g_ViBackData->mode == MD_BLACK)
{
calculatedYScale = 1.0f;
}
// macro for testing theories ...
#define GET_D_800232C0 D_800232C0
// current:
// lui t4, 0x0 4ec: R_MIPS_HI16 D_800232C0
// ...
@@ -407,7 +408,7 @@ void video_related_8(void)
g_ViXScales[GET_D_800232C0] = calculatedXScale;
g_ViYScales[GET_D_800232C0] = calculatedYScale;
if (g_ViBackData->mode == VIDEOMODE_320x240)
{
g_ViModePtrs[GET_D_800232C0] = &g_viOriginalVideoMode;
@@ -488,7 +489,7 @@ void video_related_8(void)
{
((struct GfxInfo_s *)g_gfxTaskSettingsList)->cfb = cfb_16[0];
}
settings = g_ViBackData;
g_ViFrontIndex = (g_ViFrontIndex + 1) % NUM_VIDEO_SETTINGS;
@@ -496,7 +497,7 @@ void video_related_8(void)
g_ViFrontData = g_ViDataArray + g_ViFrontIndex;
g_ViBackData = g_ViDataArray + g_ViBackIndex;
bcopy(settings, g_ViBackData, sizeof(VideoSettings));
g_ViBackData->framebuf = cfb_16[g_ViBackIndex];
}
@@ -505,9 +506,9 @@ void video_related_8(void)
GLOBAL_ASM(
.text
glabel video_related_8
/* 003E98 70003298 3C0D8002 */ lui $t5, %hi(g_ViBackData)
/* 003E98 70003298 3C0D8002 */ lui $t5, %hi(g_ViBackData)
/* 003E9C 7000329C 25AD32A8 */ addiu $t5, %lo(g_ViBackData) # addiu $t5, $t5, 0x32a8
/* 003EA0 700032A0 3C0E8002 */ lui $t6, %hi(g_ViFrontData)
/* 003EA0 700032A0 3C0E8002 */ lui $t6, %hi(g_ViFrontData)
/* 003EA4 700032A4 8DCE32A4 */ lw $t6, %lo(g_ViFrontData)($t6)
/* 003EA8 700032A8 8DA80000 */ lw $t0, ($t5)
/* 003EAC 700032AC 27BDFFE8 */ addiu $sp, $sp, -0x18
@@ -520,35 +521,35 @@ glabel video_related_8
/* 003EC8 700032C8 3C013F80 */ li $at, 0x3F800000 # 1.000000
/* 003ECC 700032CC 24010001 */ li $at, 1
/* 003ED0 700032D0 1041000D */ beq $v0, $at, .L70003308
/* 003ED4 700032D4 3C188002 */ lui $t8, %hi(g_viColorOutputMode)
/* 003ED4 700032D4 3C188002 */ lui $t8, %hi(g_viColorOutputMode)
/* 003ED8 700032D8 24010002 */ li $at, 2
/* 003EDC 700032DC 10410071 */ beq $v0, $at, .L700034A4
/* 003EE0 700032E0 3C198000 */ lui $t9, 0x8000
/* 003EE4 700032E4 10000089 */ b .L7000350C
/* 003EE8 700032E8 00000000 */ nop
/* 003EE8 700032E8 00000000 */ nop
.L700032EC:
/* 003EEC 700032EC 44816000 */ mtc1 $at, $f12
/* 003EF0 700032F0 0C003880 */ jal osViSetYScale
/* 003EF4 700032F4 00000000 */ nop
/* 003EF4 700032F4 00000000 */ nop
/* 003EF8 700032F8 0C0038B4 */ jal osViBlack
/* 003EFC 700032FC 24040001 */ li $a0, 1
/* 003F00 70003300 10000082 */ b .L7000350C
/* 003F04 70003304 00000000 */ nop
/* 003F04 70003304 00000000 */ nop
.L70003308:
/* 003F08 70003308 8F1832AC */ lw $t8, %lo(g_viColorOutputMode)($t8)
/* 003F0C 7000330C 3C038006 */ lui $v1, %hi(viMode)
/* 003F10 70003310 3C0F8000 */ lui $t7, 0x8000
/* 003F14 70003314 1300002B */ beqz $t8, .L700033C4
/* 003F18 70003318 2463087C */ addiu $v1, %lo(viMode) # addiu $v1, $v1, 0x87c
/* 003F1C 7000331C 3C198000 */ lui $t9, %hi(osTvType)
/* 003F1C 7000331C 3C198000 */ lui $t9, %hi(osTvType)
/* 003F20 70003320 8F390300 */ lw $t9, %lo(osTvType)($t9)
/* 003F24 70003324 24010002 */ li $at, 2
/* 003F28 70003328 3C188006 */ lui $t8, %hi(g_viOriginalVideoMode)
/* 003F28 70003328 3C188006 */ lui $t8, %hi(g_viOriginalVideoMode)
/* 003F2C 7000332C 17210014 */ bne $t9, $at, .L70003380
/* 003F30 70003330 27180828 */ addiu $t8, %lo(g_viOriginalVideoMode) # addiu $t8, $t8, 0x828
/* 003F34 70003334 3C0F8002 */ lui $t7, %hi(osViModeTable + 2400)
/* 003F34 70003334 3C0F8002 */ lui $t7, %hi(osViModeTable + 2400)
/* 003F38 70003338 25EF7320 */ addiu $t7, %lo(osViModeTable + 2400) # addiu $t7, $t7, 0x7320
/* 003F3C 7000333C 3C0E8006 */ lui $t6, %hi(g_viOriginalVideoMode)
/* 003F3C 7000333C 3C0E8006 */ lui $t6, %hi(g_viOriginalVideoMode)
/* 003F40 70003340 25CE0828 */ addiu $t6, %lo(g_viOriginalVideoMode) # addiu $t6, $t6, 0x828
/* 003F44 70003344 25F90048 */ addiu $t9, $t7, 0x48
.L70003348:
@@ -567,7 +568,7 @@ glabel video_related_8
/* 003F78 70003378 1000003A */ b .L70003464
/* 003F7C 7000337C ADD90004 */ sw $t9, 4($t6)
.L70003380:
/* 003F80 70003380 3C198002 */ lui $t9, %hi(osViModeTable + 160)
/* 003F80 70003380 3C198002 */ lui $t9, %hi(osViModeTable + 160)
/* 003F84 70003384 27396A60 */ addiu $t9, %lo(osViModeTable + 160) # addiu $t9, $t9, 0x6a60
/* 003F88 70003388 272E0048 */ addiu $t6, $t9, 0x48
.L7000338C:
@@ -588,12 +589,12 @@ glabel video_related_8
.L700033C4:
/* 003FC4 700033C4 8DEF0300 */ lw $t7, 0x300($t7)
/* 003FC8 700033C8 24010002 */ li $at, 2
/* 003FCC 700033CC 3C188006 */ lui $t8, %hi(g_viOriginalVideoMode)
/* 003FCC 700033CC 3C188006 */ lui $t8, %hi(g_viOriginalVideoMode)
/* 003FD0 700033D0 15E10014 */ bne $t7, $at, .L70003424
/* 003FD4 700033D4 27180828 */ addiu $t8, %lo(g_viOriginalVideoMode) # addiu $t8, $t8, 0x828
/* 003FD8 700033D8 3C198002 */ lui $t9, %hi(osViModeTable + 2720)
/* 003FD8 700033D8 3C198002 */ lui $t9, %hi(osViModeTable + 2720)
/* 003FDC 700033DC 27397460 */ addiu $t9, %lo(osViModeTable + 2720) # addiu $t9, $t9, 0x7460
/* 003FE0 700033E0 3C0E8006 */ lui $t6, %hi(g_viOriginalVideoMode)
/* 003FE0 700033E0 3C0E8006 */ lui $t6, %hi(g_viOriginalVideoMode)
/* 003FE4 700033E4 25CE0828 */ addiu $t6, %lo(g_viOriginalVideoMode) # addiu $t6, $t6, 0x828
/* 003FE8 700033E8 272F0048 */ addiu $t7, $t9, 0x48
.L700033EC:
@@ -612,7 +613,7 @@ glabel video_related_8
/* 00401C 7000341C 10000011 */ b .L70003464
/* 004020 70003420 ADCF0004 */ sw $t7, 4($t6)
.L70003424:
/* 004024 70003424 3C0F8002 */ lui $t7, %hi(osViModeTable + 480)
/* 004024 70003424 3C0F8002 */ lui $t7, %hi(osViModeTable + 480)
/* 004028 70003428 25EF6BA0 */ addiu $t7, %lo(osViModeTable + 480) # addiu $t7, $t7, 0x6ba0
/* 00402C 7000342C 25EE0048 */ addiu $t6, $t7, 0x48
.L70003430:
@@ -630,7 +631,7 @@ glabel video_related_8
/* 00405C 7000345C AF010000 */ sw $at, ($t8)
/* 004060 70003460 AF0E0004 */ sw $t6, 4($t8)
.L70003464:
/* 004064 70003464 3C198006 */ lui $t9, %hi(g_viOriginalVideoMode)
/* 004064 70003464 3C198006 */ lui $t9, %hi(g_viOriginalVideoMode)
/* 004068 70003468 27390828 */ addiu $t9, %lo(g_viOriginalVideoMode) # addiu $t9, $t9, 0x828
/* 00406C 7000346C AC790000 */ sw $t9, ($v1)
/* 004070 70003470 8F2E001C */ lw $t6, 0x1c($t9)
@@ -645,7 +646,7 @@ glabel video_related_8
/* 004094 70003494 0C000C64 */ jal frBlack
/* 004098 70003498 AC380888 */ sw $t8, %lo(viMode+0xC)($at)
/* 00409C 7000349C 1000001B */ b .L7000350C
/* 0040A0 700034A0 00000000 */ nop
/* 0040A0 700034A0 00000000 */ nop
.L700034A4:
/* 0040A4 700034A4 8F390300 */ lw $t9, 0x300($t9)
/* 0040A8 700034A8 24010002 */ li $at, 2
@@ -653,13 +654,13 @@ glabel video_related_8
/* 0040B0 700034B0 17210007 */ bne $t9, $at, .L700034D0
/* 0040B4 700034B4 2463087C */ addiu $v1, %lo(viMode) # addiu $v1, $v1, 0x87c
/* 0040B8 700034B8 3C038006 */ lui $v1, %hi(viMode)
/* 0040BC 700034BC 3C0E8002 */ lui $t6, %hi(osViModeTable + 3120)
/* 0040BC 700034BC 3C0E8002 */ lui $t6, %hi(osViModeTable + 3120)
/* 0040C0 700034C0 2463087C */ addiu $v1, %lo(viMode) # addiu $v1, $v1, 0x87c
/* 0040C4 700034C4 25CE75F0 */ addiu $t6, %lo(osViModeTable + 3120) # addiu $t6, $t6, 0x75f0
/* 0040C8 700034C8 10000004 */ b .L700034DC
/* 0040CC 700034CC AC6E0000 */ sw $t6, ($v1)
.L700034D0:
/* 0040D0 700034D0 3C0F8002 */ lui $t7, %hi(osViModeTable + 880)
/* 0040D0 700034D0 3C0F8002 */ lui $t7, %hi(osViModeTable + 880)
/* 0040D4 700034D4 25EF6D30 */ addiu $t7, %lo(osViModeTable + 880) # addiu $t7, $t7, 0x6d30
/* 0040D8 700034D8 AC6F0000 */ sw $t7, ($v1)
.L700034DC:
@@ -678,9 +679,9 @@ glabel video_related_8
.L7000350C:
/* 00410C 7000350C 0C003DEC */ jal osViSetSpecialFeatures
/* 004110 70003510 24040042 */ li $a0, 66
/* 004114 70003514 3C088002 */ lui $t0, %hi(g_ViBackData)
/* 004114 70003514 3C088002 */ lui $t0, %hi(g_ViBackData)
/* 004118 70003518 8D0832A8 */ lw $t0, %lo(g_ViBackData)($t0)
/* 00411C 7000351C 3C0D8002 */ lui $t5, %hi(g_ViBackData)
/* 00411C 7000351C 3C0D8002 */ lui $t5, %hi(g_ViBackData)
/* 004120 70003520 25AD32A8 */ addiu $t5, %lo(g_ViBackData) # addiu $t5, $t5, 0x32a8
/* 004124 70003524 91020000 */ lbu $v0, ($t0)
/* 004128 70003528 850F0004 */ lh $t7, 4($t0)
@@ -693,19 +694,19 @@ glabel video_related_8
/* 004140 70003540 468021A0 */ cvt.s.w $f6, $f4
/* 004144 70003544 44998000 */ mtc1 $t9, $f16
/* 004148 70003548 448E2000 */ mtc1 $t6, $f4
/* 00414C 7000354C 3C188006 */ lui $t8, %hi(g_viOriginalVideoMode)
/* 004150 70003550 3C0A8002 */ lui $t2, %hi(D_800232C0)
/* 00414C 7000354C 3C188006 */ lui $t8, %hi(g_viOriginalVideoMode)
/* 004150 70003550 3C0A8002 */ lui $t2, %hi(D_800232C0)
/* 004154 70003554 468042A0 */ cvt.s.w $f10, $f8
/* 004158 70003558 3C013F80 */ li $at, 0x3F800000 # 1.000000
/* 00415C 7000355C 27180828 */ addiu $t8, %lo(g_viOriginalVideoMode) # addiu $t8, $t8, 0x828
/* 004160 70003560 3C0B8002 */ lui $t3, %hi(g_viColorOutputMode)
/* 004160 70003560 3C0B8002 */ lui $t3, %hi(g_viColorOutputMode)
/* 004164 70003564 468084A0 */ cvt.s.w $f18, $f16
/* 004168 70003568 46802220 */ cvt.s.w $f8, $f4
/* 00416C 7000356C 460A3083 */ div.s $f2, $f6, $f10
/* 004170 70003570 14400003 */ bnez $v0, .L70003580
/* 004174 70003574 46089003 */ div.s $f0, $f18, $f8
/* 004178 70003578 44810000 */ mtc1 $at, $f0
/* 00417C 7000357C 00000000 */ nop
/* 00417C 7000357C 00000000 */ nop
.L70003580:
/* 004180 70003580 8D4A32C0 */ lw $t2, %lo(D_800232C0)($t2)
/* 004184 70003584 3C018002 */ lui $at, %hi(g_ViXScales)
@@ -718,25 +719,25 @@ glabel video_related_8
/* 0041A0 700035A0 910F0000 */ lbu $t7, ($t0)
/* 0041A4 700035A4 24010001 */ li $at, 1
/* 0041A8 700035A8 15E10105 */ bne $t7, $at, .L700039C0
/* 0041AC 700035AC 00000000 */ nop
/* 0041AC 700035AC 00000000 */ nop
/* 0041B0 700035B0 8D6B32AC */ lw $t3, %lo(g_viColorOutputMode)($t3)
/* 0041B4 700035B4 3C018006 */ lui $at, %hi(g_ViModePtrs)
/* 0041B8 700035B8 00290821 */ addu $at, $at, $t1
/* 0041BC 700035BC 11600035 */ beqz $t3, .L70003694
/* 0041C0 700035C0 AC38DBE0 */ sw $t8, %lo(g_ViModePtrs)($at)
/* 0041C4 700035C4 3C198000 */ lui $t9, %hi(osTvType)
/* 0041C4 700035C4 3C198000 */ lui $t9, %hi(osTvType)
/* 0041C8 700035C8 8F390300 */ lw $t9, %lo(osTvType)($t9)
/* 0041CC 700035CC 24010002 */ li $at, 2
/* 0041D0 700035D0 3C0E8006 */ lui $t6, %hi(g_ViModes)
/* 0041D0 700035D0 3C0E8006 */ lui $t6, %hi(g_ViModes)
/* 0041D4 700035D4 17210019 */ bne $t9, $at, .L7000363C
/* 0041D8 700035D8 25CEDB40 */ addiu $t6, %lo(g_ViModes) # addiu $t6, $t6, -0x24c0
/* 0041DC 700035DC 000A7080 */ sll $t6, $t2, 2
/* 0041E0 700035E0 01CA7021 */ addu $t6, $t6, $t2
/* 0041E4 700035E4 3C0F8006 */ lui $t7, %hi(g_ViModes)
/* 0041E4 700035E4 3C0F8006 */ lui $t7, %hi(g_ViModes)
/* 0041E8 700035E8 25EFDB40 */ addiu $t7, %lo(g_ViModes) # addiu $t7, $t7, -0x24c0
/* 0041EC 700035EC 000E7100 */ sll $t6, $t6, 4
/* 0041F0 700035F0 01CF1821 */ addu $v1, $t6, $t7
/* 0041F4 700035F4 3C188002 */ lui $t8, %hi(osViModeTable + 2400)
/* 0041F4 700035F4 3C188002 */ lui $t8, %hi(osViModeTable + 2400)
/* 0041F8 700035F8 27187320 */ addiu $t8, %lo(osViModeTable + 2400) # addiu $t8, $t8, 0x7320
/* 0041FC 700035FC 270E0048 */ addiu $t6, $t8, 0x48
/* 004200 70003600 00607825 */ move $t7, $v1
@@ -760,7 +761,7 @@ glabel video_related_8
/* 004240 70003640 032AC821 */ addu $t9, $t9, $t2
/* 004244 70003644 0019C900 */ sll $t9, $t9, 4
/* 004248 70003648 032E1821 */ addu $v1, $t9, $t6
/* 00424C 7000364C 3C188002 */ lui $t8, %hi(osViModeTable + 160)
/* 00424C 7000364C 3C188002 */ lui $t8, %hi(osViModeTable + 160)
/* 004250 70003650 27186A60 */ addiu $t8, %lo(osViModeTable + 160) # addiu $t8, $t8, 0x6a60
/* 004254 70003654 27190048 */ addiu $t9, $t8, 0x48
/* 004258 70003658 00607025 */ move $t6, $v1
@@ -780,17 +781,17 @@ glabel video_related_8
/* 00428C 7000368C 10000034 */ b .L70003760
/* 004290 70003690 ADD90004 */ sw $t9, 4($t6)
.L70003694:
/* 004294 70003694 3C0F8000 */ lui $t7, %hi(osTvType)
/* 004294 70003694 3C0F8000 */ lui $t7, %hi(osTvType)
/* 004298 70003698 8DEF0300 */ lw $t7, %lo(osTvType)($t7)
/* 00429C 7000369C 24010002 */ li $at, 2
/* 0042A0 700036A0 15E10018 */ bne $t7, $at, .L70003704
/* 0042A4 700036A4 000AC880 */ sll $t9, $t2, 2
/* 0042A8 700036A8 032AC821 */ addu $t9, $t9, $t2
/* 0042AC 700036AC 3C188006 */ lui $t8, %hi(g_ViModes)
/* 0042AC 700036AC 3C188006 */ lui $t8, %hi(g_ViModes)
/* 0042B0 700036B0 2718DB40 */ addiu $t8, %lo(g_ViModes) # addiu $t8, $t8, -0x24c0
/* 0042B4 700036B4 0019C900 */ sll $t9, $t9, 4
/* 0042B8 700036B8 03381821 */ addu $v1, $t9, $t8
/* 0042BC 700036BC 3C0E8002 */ lui $t6, %hi(osViModeTable + 2720)
/* 0042BC 700036BC 3C0E8002 */ lui $t6, %hi(osViModeTable + 2720)
/* 0042C0 700036C0 25CE7460 */ addiu $t6, %lo(osViModeTable + 2720) # addiu $t6, $t6, 0x7460
/* 0042C4 700036C4 25D90048 */ addiu $t9, $t6, 0x48
/* 0042C8 700036C8 0060C025 */ move $t8, $v1
@@ -812,11 +813,11 @@ glabel video_related_8
.L70003704:
/* 004304 70003704 000A7880 */ sll $t7, $t2, 2
/* 004308 70003708 01EA7821 */ addu $t7, $t7, $t2
/* 00430C 7000370C 3C198006 */ lui $t9, %hi(g_ViModes)
/* 00430C 7000370C 3C198006 */ lui $t9, %hi(g_ViModes)
/* 004310 70003710 2739DB40 */ addiu $t9, %lo(g_ViModes) # addiu $t9, $t9, -0x24c0
/* 004314 70003714 000F7900 */ sll $t7, $t7, 4
/* 004318 70003718 01F91821 */ addu $v1, $t7, $t9
/* 00431C 7000371C 3C0E8002 */ lui $t6, %hi(osViModeTable + 480)
/* 00431C 7000371C 3C0E8002 */ lui $t6, %hi(osViModeTable + 480)
/* 004320 70003720 25CE6BA0 */ addiu $t6, %lo(osViModeTable + 480) # addiu $t6, $t6, 0x6ba0
/* 004324 70003724 25CF0048 */ addiu $t7, $t6, 0x48
/* 004328 70003728 0060C825 */ move $t9, $v1
@@ -855,14 +856,14 @@ glabel video_related_8
/* 0043A4 700037A4 AC6E002C */ sw $t6, 0x2c($v1)
/* 0043A8 700037A8 8519001A */ lh $t9, 0x1a($t0)
/* 0043AC 700037AC 15800002 */ bnez $t4, .L700037B8
/* 0043B0 700037B0 00000000 */ nop
/* 0043B0 700037B0 00000000 */ nop
/* 0043B4 700037B4 0007000D */ break 7
.L700037B8:
/* 0043B8 700037B8 2401FFFF */ li $at, -1
/* 0043BC 700037BC 15810004 */ bne $t4, $at, .L700037D0
/* 0043C0 700037C0 3C018000 */ lui $at, 0x8000
/* 0043C4 700037C4 15E10002 */ bne $t7, $at, .L700037D0
/* 0043C8 700037C8 00000000 */ nop
/* 0043C8 700037C8 00000000 */ nop
/* 0043CC 700037CC 0006000D */ break 6
.L700037D0:
/* 0043D0 700037D0 0019C2C0 */ sll $t8, $t9, 0xb
@@ -871,14 +872,14 @@ glabel video_related_8
/* 0043DC 700037DC AC6F0040 */ sw $t7, 0x40($v1)
/* 0043E0 700037E0 850E0018 */ lh $t6, 0x18($t0)
/* 0043E4 700037E4 15800002 */ bnez $t4, .L700037F0
/* 0043E8 700037E8 00000000 */ nop
/* 0043E8 700037E8 00000000 */ nop
/* 0043EC 700037EC 0007000D */ break 7
.L700037F0:
/* 0043F0 700037F0 2401FFFF */ li $at, -1
/* 0043F4 700037F4 15810004 */ bne $t4, $at, .L70003808
/* 0043F8 700037F8 3C018000 */ lui $at, 0x8000
/* 0043FC 700037FC 17010002 */ bne $t8, $at, .L70003808
/* 004400 70003800 00000000 */ nop
/* 004400 70003800 00000000 */ nop
/* 004404 70003804 0006000D */ break 6
.L70003808:
/* 004408 70003808 000EC840 */ sll $t9, $t6, 1
@@ -892,14 +893,14 @@ glabel video_related_8
/* 004428 70003828 0327C021 */ addu $t8, $t9, $a3
/* 00442C 7000382C 0306001A */ div $zero, $t8, $a2
/* 004430 70003830 14C00002 */ bnez $a2, .L7000383C
/* 004434 70003834 00000000 */ nop
/* 004434 70003834 00000000 */ nop
/* 004438 70003838 0007000D */ break 7
.L7000383C:
/* 00443C 7000383C 2401FFFF */ li $at, -1
/* 004440 70003840 14C10004 */ bne $a2, $at, .L70003854
/* 004444 70003844 3C018000 */ lui $at, 0x8000
/* 004448 70003848 17010002 */ bne $t8, $at, .L70003854
/* 00444C 7000384C 00000000 */ nop
/* 00444C 7000384C 00000000 */ nop
/* 004450 70003850 0006000D */ break 6
.L70003854:
/* 004454 70003854 3059FFFF */ andi $t9, $v0, 0xffff
@@ -908,14 +909,14 @@ glabel video_related_8
/* 004460 70003860 000F7400 */ sll $t6, $t7, 0x10
/* 004464 70003864 0306001A */ div $zero, $t8, $a2
/* 004468 70003868 14C00002 */ bnez $a2, .L70003874
/* 00446C 7000386C 00000000 */ nop
/* 00446C 7000386C 00000000 */ nop
/* 004470 70003870 0007000D */ break 7
.L70003874:
/* 004474 70003874 2401FFFF */ li $at, -1
/* 004478 70003878 14C10004 */ bne $a2, $at, .L7000388C
/* 00447C 7000387C 3C018000 */ lui $at, 0x8000
/* 004480 70003880 17010002 */ bne $t8, $at, .L7000388C
/* 004484 70003884 00000000 */ nop
/* 004484 70003884 00000000 */ nop
/* 004488 70003888 0006000D */ break 6
.L7000388C:
/* 00448C 7000388C 00007810 */ mfhi $t7
@@ -930,14 +931,14 @@ glabel video_related_8
/* 0044B0 700038B0 03057021 */ addu $t6, $t8, $a1
/* 0044B4 700038B4 01C6001A */ div $zero, $t6, $a2
/* 0044B8 700038B8 14C00002 */ bnez $a2, .L700038C4
/* 0044BC 700038BC 00000000 */ nop
/* 0044BC 700038BC 00000000 */ nop
/* 0044C0 700038C0 0007000D */ break 7
.L700038C4:
/* 0044C4 700038C4 2401FFFF */ li $at, -1
/* 0044C8 700038C8 14C10004 */ bne $a2, $at, .L700038DC
/* 0044CC 700038CC 3C018000 */ lui $at, 0x8000
/* 0044D0 700038D0 15C10002 */ bne $t6, $at, .L700038DC
/* 0044D4 700038D4 00000000 */ nop
/* 0044D4 700038D4 00000000 */ nop
/* 0044D8 700038D8 0006000D */ break 6
.L700038DC:
/* 0044DC 700038DC 3058FFFF */ andi $t8, $v0, 0xffff
@@ -946,14 +947,14 @@ glabel video_related_8
/* 0044E8 700038E8 000FCC00 */ sll $t9, $t7, 0x10
/* 0044EC 700038EC 01C6001A */ div $zero, $t6, $a2
/* 0044F0 700038F0 14C00002 */ bnez $a2, .L700038FC
/* 0044F4 700038F4 00000000 */ nop
/* 0044F4 700038F4 00000000 */ nop
/* 0044F8 700038F8 0007000D */ break 7
.L700038FC:
/* 0044FC 700038FC 2401FFFF */ li $at, -1
/* 004500 70003900 14C10004 */ bne $a2, $at, .L70003914
/* 004504 70003904 3C018000 */ lui $at, 0x8000
/* 004508 70003908 15C10002 */ bne $t6, $at, .L70003914
/* 00450C 7000390C 00000000 */ nop
/* 00450C 7000390C 00000000 */ nop
/* 004510 70003910 0006000D */ break 6
.L70003914:
/* 004514 70003914 00007810 */ mfhi $t7
@@ -967,14 +968,14 @@ glabel video_related_8
/* 004534 70003934 01C5C821 */ addu $t9, $t6, $a1
/* 004538 70003938 0326001A */ div $zero, $t9, $a2
/* 00453C 7000393C 14C00002 */ bnez $a2, .L70003948
/* 004540 70003940 00000000 */ nop
/* 004540 70003940 00000000 */ nop
/* 004544 70003944 0007000D */ break 7
.L70003948:
/* 004548 70003948 2401FFFF */ li $at, -1
/* 00454C 7000394C 14C10004 */ bne $a2, $at, .L70003960
/* 004550 70003950 3C018000 */ lui $at, 0x8000
/* 004554 70003954 17210002 */ bne $t9, $at, .L70003960
/* 004558 70003958 00000000 */ nop
/* 004558 70003958 00000000 */ nop
/* 00455C 7000395C 0006000D */ break 6
.L70003960:
/* 004560 70003960 304EFFFF */ andi $t6, $v0, 0xffff
@@ -984,14 +985,14 @@ glabel video_related_8
/* 004570 70003970 240E0001 */ li $t6, 1
/* 004574 70003974 0326001A */ div $zero, $t9, $a2
/* 004578 70003978 14C00002 */ bnez $a2, .L70003984
/* 00457C 7000397C 00000000 */ nop
/* 00457C 7000397C 00000000 */ nop
/* 004580 70003980 0007000D */ break 7
.L70003984:
/* 004584 70003984 2401FFFF */ li $at, -1
/* 004588 70003988 14C10004 */ bne $a2, $at, .L7000399C
/* 00458C 7000398C 3C018000 */ lui $at, 0x8000
/* 004590 70003990 17210002 */ bne $t9, $at, .L7000399C
/* 004594 70003994 00000000 */ nop
/* 004594 70003994 00000000 */ nop
/* 004598 70003998 0006000D */ break 6
.L7000399C:
/* 00459C 7000399C 00007810 */ mfhi $t7
@@ -1006,7 +1007,7 @@ glabel video_related_8
.L700039C0:
/* 0045C0 700039C0 3C018002 */ lui $at, %hi(g_ViChangeVideoModes)
/* 0045C4 700039C4 00290821 */ addu $at, $at, $t1
/* 0045C8 700039C8 3C0B8002 */ lui $t3, %hi(g_viColorOutputMode)
/* 0045C8 700039C8 3C0B8002 */ lui $t3, %hi(g_viColorOutputMode)
/* 0045CC 700039CC 8D6B32AC */ lw $t3, %lo(g_viColorOutputMode)($t3)
/* 0045D0 700039D0 AC2030C4 */ sw $zero, %lo(g_ViChangeVideoModes)($at)
.L700039D4:
@@ -1014,19 +1015,19 @@ glabel video_related_8
/* 0045D8 700039D8 05410004 */ bgez $t2, .L700039EC
/* 0045DC 700039DC 31590001 */ andi $t9, $t2, 1
/* 0045E0 700039E0 13200002 */ beqz $t9, .L700039EC
/* 0045E4 700039E4 00000000 */ nop
/* 0045E4 700039E4 00000000 */ nop
/* 0045E8 700039E8 2739FFFE */ addiu $t9, $t9, -2
.L700039EC:
/* 0045EC 700039EC 3C018002 */ lui $at, %hi(D_800232C0)
/* 0045F0 700039F0 11600006 */ beqz $t3, .L70003A0C
/* 0045F4 700039F4 AC3932C0 */ sw $t9, %lo(D_800232C0)($at)
/* 0045F8 700039F8 3C0F8005 */ lui $t7, %hi(g_gfxTaskSettingsList)
/* 0045F8 700039F8 3C0F8005 */ lui $t7, %hi(g_gfxTaskSettingsList)
/* 0045FC 700039FC 8DEFEAB0 */ lw $t7, %lo(g_gfxTaskSettingsList)($t7)
/* 004600 70003A00 8D180028 */ lw $t8, 0x28($t0)
/* 004604 70003A04 10000006 */ b .L70003A20
/* 004608 70003A08 ADF80058 */ sw $t8, 0x58($t7)
.L70003A0C:
/* 00460C 70003A0C 3C198005 */ lui $t9, %hi(g_gfxTaskSettingsList)
/* 00460C 70003A0C 3C198005 */ lui $t9, %hi(g_gfxTaskSettingsList)
/* 004610 70003A10 8F39EAB0 */ lw $t9, %lo(g_gfxTaskSettingsList)($t9)
/* 004614 70003A14 3C0E803B */ lui $t6, %hi(cfb_16) # $t6, 0x803b
/* 004618 70003A18 25CE5000 */ addiu $t6, %lo(cfb_16) # addiu $t6, $t6, 0x5000
@@ -1047,7 +1048,7 @@ glabel video_related_8
/* 004650 70003A50 05E10004 */ bgez $t7, .L70003A64
/* 004654 70003A54 31EE0001 */ andi $t6, $t7, 1
/* 004658 70003A58 11C00002 */ beqz $t6, .L70003A64
/* 00465C 70003A5C 00000000 */ nop
/* 00465C 70003A5C 00000000 */ nop
/* 004660 70003A60 25CEFFFE */ addiu $t6, $t6, -2
.L70003A64:
/* 004664 70003A64 A04E0000 */ sb $t6, ($v0)
@@ -1055,7 +1056,7 @@ glabel video_related_8
/* 00466C 70003A6C 07010004 */ bgez $t8, .L70003A80
/* 004670 70003A70 330F0001 */ andi $t7, $t8, 1
/* 004674 70003A74 11E00002 */ beqz $t7, .L70003A80
/* 004678 70003A78 00000000 */ nop
/* 004678 70003A78 00000000 */ nop
/* 00467C 70003A7C 25EFFFFE */ addiu $t7, $t7, -2
.L70003A80:
/* 004680 70003A80 01C80019 */ multu $t6, $t0
@@ -1082,7 +1083,7 @@ glabel video_related_8
/* 0046D4 70003AD4 01F87823 */ subu $t7, $t7, $t8
/* 0046D8 70003AD8 000F7880 */ sll $t7, $t7, 2
/* 0046DC 70003ADC 01F87823 */ subu $t7, $t7, $t8
/* 0046E0 70003AE0 3C188002 */ lui $t8, %hi(g_ViBackData)
/* 0046E0 70003AE0 3C188002 */ lui $t8, %hi(g_ViBackData)
/* 0046E4 70003AE4 8F1832A8 */ lw $t8, %lo(g_ViBackData)($t8)
/* 0046E8 70003AE8 000F7AC0 */ sll $t7, $t7, 0xb
/* 0046EC 70003AEC 01EEC821 */ addu $t9, $t7, $t6
@@ -1090,7 +1091,7 @@ glabel video_related_8
/* 0046F4 70003AF4 8FBF0014 */ lw $ra, 0x14($sp)
/* 0046F8 70003AF8 27BD0018 */ addiu $sp, $sp, 0x18
/* 0046FC 70003AFC 03E00008 */ jr $ra
/* 004700 70003B00 00000000 */ nop
/* 004700 70003B00 00000000 */ nop
)
#endif
#ifdef VERSION_EU
@@ -1116,15 +1117,15 @@ glabel video_related_8
/* 003A4C 70002E4C 10610043 */ beq $v1, $at, .L70002F5C
/* 003A50 70002E50 3C0E8002 */ lui $t6, 0x8002 # fixme?
/* 003A54 70002E54 10000050 */ b .L70002F98
/* 003A58 70002E58 00000000 */ nop
/* 003A58 70002E58 00000000 */ nop
.L70002E5C:
/* 003A5C 70002E5C 44816000 */ mtc1 $at, $f12
/* 003A60 70002E60 0C003300 */ jal osViSetYScale
/* 003A64 70002E64 00000000 */ nop
/* 003A64 70002E64 00000000 */ nop
/* 003A68 70002E68 0C003334 */ jal osViBlack
/* 003A6C 70002E6C 24040001 */ li $a0, 1
/* 003A70 70002E70 10000049 */ b .L70002F98
/* 003A74 70002E74 00000000 */ nop
/* 003A74 70002E74 00000000 */ nop
.L70002E78:
/* 003A78 70002E78 8F18114C */ lw $t8, %lo(g_viColorOutputMode)($t8)
/* 003A7C 70002E7C 3C038005 */ lui $v1, %hi(viMode) # $v1, 0x8005
@@ -1186,7 +1187,7 @@ glabel video_related_8
/* 003B4C 70002F4C 0C000B41 */ jal frBlack
/* 003B50 70002F50 AC2F3E58 */ sw $t7, %lo(viMode+0xC)($at)
/* 003B54 70002F54 10000010 */ b .L70002F98
/* 003B58 70002F58 00000000 */ nop
/* 003B58 70002F58 00000000 */ nop
.L70002F5C:
/* 003B5C 70002F5C 3C038005 */ lui $v1, %hi(viMode) # $v1, 0x8005
/* 003B60 70002F60 24633E4C */ addiu $v1, %lo(viMode) # addiu $v1, $v1, 0x3e4c
@@ -1233,7 +1234,7 @@ glabel video_related_8
/* 003BFC 70002FFC 14600003 */ bnez $v1, .L7000300C
/* 003C00 70003000 46089003 */ div.s $f0, $f18, $f8
/* 003C04 70003004 44810000 */ mtc1 $at, $f0
/* 003C08 70003008 00000000 */ nop
/* 003C08 70003008 00000000 */ nop
.L7000300C:
/* 003C0C 7000300C 8FFF1160 */ lw $ra, %lo(D_800232C0)($ra)
/* 003C10 70003010 3C018002 */ lui $at, %hi(g_ViXScales)
@@ -1246,7 +1247,7 @@ glabel video_related_8
/* 003C2C 7000302C 90EE0000 */ lbu $t6, ($a3)
/* 003C30 70003030 24010001 */ li $at, 1
/* 003C34 70003034 15C100F2 */ bne $t6, $at, .L70003400
/* 003C38 70003038 00000000 */ nop
/* 003C38 70003038 00000000 */ nop
/* 003C3C 7000303C 8DAD114C */ lw $t5, %lo(g_viColorOutputMode)($t5)
/* 003C40 70003040 3C018005 */ lui $at, %hi(g_ViModePtrs)
/* 003C44 70003044 002C0821 */ addu $at, $at, $t4
@@ -1326,14 +1327,14 @@ glabel video_related_8
/* 003D58 70003158 AC8E002C */ sw $t6, 0x2c($a0)
/* 003D5C 7000315C 84E5001A */ lh $a1, 0x1a($a3)
/* 003D60 70003160 17200002 */ bnez $t9, .L7000316C
/* 003D64 70003164 00000000 */ nop
/* 003D64 70003164 00000000 */ nop
/* 003D68 70003168 0007000D */ break 7
.L7000316C:
/* 003D6C 7000316C 2401FFFF */ li $at, -1
/* 003D70 70003170 17210004 */ bne $t9, $at, .L70003184
/* 003D74 70003174 3C018000 */ lui $at, 0x8000
/* 003D78 70003178 15E10002 */ bne $t7, $at, .L70003184
/* 003D7C 7000317C 00000000 */ nop
/* 003D7C 7000317C 00000000 */ nop
/* 003D80 70003180 0006000D */ break 6
.L70003184:
/* 003D84 70003184 00001025 */ move $v0, $zero
@@ -1348,14 +1349,14 @@ glabel video_related_8
/* 003DA4 700031A4 AC990040 */ sw $t9, 0x40($a0)
/* 003DA8 700031A8 84EE0018 */ lh $t6, 0x18($a3)
/* 003DAC 700031AC 15E00002 */ bnez $t7, .L700031B8
/* 003DB0 700031B0 00000000 */ nop
/* 003DB0 700031B0 00000000 */ nop
/* 003DB4 700031B4 0007000D */ break 7
.L700031B8:
/* 003DB8 700031B8 2401FFFF */ li $at, -1
/* 003DBC 700031BC 15E10004 */ bne $t7, $at, .L700031D0
/* 003DC0 700031C0 3C018000 */ lui $at, 0x8000
/* 003DC4 700031C4 17010002 */ bne $t8, $at, .L700031D0
/* 003DC8 700031C8 00000000 */ nop
/* 003DC8 700031C8 00000000 */ nop
/* 003DCC 700031CC 0006000D */ break 6
.L700031D0:
/* 003DD0 700031D0 000EC040 */ sll $t8, $t6, 1
@@ -1371,14 +1372,14 @@ glabel video_related_8
/* 003DF8 700031F8 03037821 */ addu $t7, $t8, $v1
/* 003DFC 700031FC 01EA001A */ div $zero, $t7, $t2
/* 003E00 70003200 15400002 */ bnez $t2, .L7000320C
/* 003E04 70003204 00000000 */ nop
/* 003E04 70003204 00000000 */ nop
/* 003E08 70003208 0007000D */ break 7
.L7000320C:
/* 003E0C 7000320C 2401FFFF */ li $at, -1
/* 003E10 70003210 15410004 */ bne $t2, $at, .L70003224
/* 003E14 70003214 3C018000 */ lui $at, 0x8000
/* 003E18 70003218 15E10002 */ bne $t7, $at, .L70003224
/* 003E1C 7000321C 00000000 */ nop
/* 003E1C 7000321C 00000000 */ nop
/* 003E20 70003220 0006000D */ break 6
.L70003224:
/* 003E24 70003224 30D8FFFF */ andi $t8, $a2, 0xffff
@@ -1387,14 +1388,14 @@ glabel video_related_8
/* 003E30 70003230 00197400 */ sll $t6, $t9, 0x10
/* 003E34 70003234 01EA001A */ div $zero, $t7, $t2
/* 003E38 70003238 15400002 */ bnez $t2, .L70003244
/* 003E3C 7000323C 00000000 */ nop
/* 003E3C 7000323C 00000000 */ nop
/* 003E40 70003240 0007000D */ break 7
.L70003244:
/* 003E44 70003244 2401FFFF */ li $at, -1
/* 003E48 70003248 15410004 */ bne $t2, $at, .L7000325C
/* 003E4C 7000324C 3C018000 */ lui $at, 0x8000
/* 003E50 70003250 15E10002 */ bne $t7, $at, .L7000325C
/* 003E54 70003254 00000000 */ nop
/* 003E54 70003254 00000000 */ nop
/* 003E58 70003258 0006000D */ break 6
.L7000325C:
/* 003E5C 7000325C 0000C810 */ mfhi $t9
@@ -1406,12 +1407,12 @@ glabel video_related_8
/* 003E74 70003274 8C860030 */ lw $a2, 0x30($a0)
/* 003E78 70003278 00001825 */ move $v1, $zero
/* 003E7C 7000327C 15650003 */ bne $t3, $a1, .L7000328C
/* 003E80 70003280 00000000 */ nop
/* 003E80 70003280 00000000 */ nop
/* 003E84 70003284 10000001 */ b .L7000328C
/* 003E88 70003288 2409FFF2 */ li $t1, -14
.L7000328C:
/* 003E8C 7000328C 15650003 */ bne $t3, $a1, .L7000329C
/* 003E90 70003290 00000000 */ nop
/* 003E90 70003290 00000000 */ nop
/* 003E94 70003294 10000001 */ b .L7000329C
/* 003E98 70003298 2403000E */ li $v1, 14
.L7000329C:
@@ -1423,14 +1424,14 @@ glabel video_related_8
/* 003EB0 700032B0 032A001A */ div $zero, $t9, $t2
/* 003EB4 700032B4 00067C03 */ sra $t7, $a2, 0x10
/* 003EB8 700032B8 15400002 */ bnez $t2, .L700032C4
/* 003EBC 700032BC 00000000 */ nop
/* 003EBC 700032BC 00000000 */ nop
/* 003EC0 700032C0 0007000D */ break 7
.L700032C4:
/* 003EC4 700032C4 2401FFFF */ li $at, -1
/* 003EC8 700032C8 15410004 */ bne $t2, $at, .L700032DC
/* 003ECC 700032CC 3C018000 */ lui $at, 0x8000
/* 003ED0 700032D0 17210002 */ bne $t9, $at, .L700032DC
/* 003ED4 700032D4 00000000 */ nop
/* 003ED4 700032D4 00000000 */ nop
/* 003ED8 700032D8 0006000D */ break 6
.L700032DC:
/* 003EDC 700032DC 31EEFFFF */ andi $t6, $t7, 0xffff
@@ -1441,14 +1442,14 @@ glabel video_related_8
/* 003EF0 700032F0 00001825 */ move $v1, $zero
/* 003EF4 700032F4 01EA001A */ div $zero, $t7, $t2
/* 003EF8 700032F8 15400002 */ bnez $t2, .L70003304
/* 003EFC 700032FC 00000000 */ nop
/* 003EFC 700032FC 00000000 */ nop
/* 003F00 70003300 0007000D */ break 7
.L70003304:
/* 003F04 70003304 2401FFFF */ li $at, -1
/* 003F08 70003308 15410004 */ bne $t2, $at, .L7000331C
/* 003F0C 7000330C 3C018000 */ lui $at, 0x8000
/* 003F10 70003310 15E10002 */ bne $t7, $at, .L7000331C
/* 003F14 70003314 00000000 */ nop
/* 003F14 70003314 00000000 */ nop
/* 003F18 70003318 0006000D */ break 6
.L7000331C:
/* 003F1C 7000331C 00007010 */ mfhi $t6
@@ -1465,7 +1466,7 @@ glabel video_related_8
/* 003F48 70003348 2409FFF2 */ li $t1, -14
.L7000334C:
/* 003F4C 7000334C 15650003 */ bne $t3, $a1, .L7000335C
/* 003F50 70003350 00000000 */ nop
/* 003F50 70003350 00000000 */ nop
/* 003F54 70003354 10000001 */ b .L7000335C
/* 003F58 70003358 2403000E */ li $v1, 14
.L7000335C:
@@ -1475,32 +1476,32 @@ glabel video_related_8
/* 003F68 70003368 032A001A */ div $zero, $t9, $t2
/* 003F6C 7000336C 00067403 */ sra $t6, $a2, 0x10
/* 003F70 70003370 15400002 */ bnez $t2, .L7000337C
/* 003F74 70003374 00000000 */ nop
/* 003F74 70003374 00000000 */ nop
/* 003F78 70003378 0007000D */ break 7
.L7000337C:
/* 003F7C 7000337C 2401FFFF */ li $at, -1
/* 003F80 70003380 15410004 */ bne $t2, $at, .L70003394
/* 003F84 70003384 3C018000 */ lui $at, 0x8000
/* 003F88 70003388 17210002 */ bne $t9, $at, .L70003394
/* 003F8C 7000338C 00000000 */ nop
/* 003F8C 7000338C 00000000 */ nop
/* 003F90 70003390 0006000D */ break 6
.L70003394:
/* 003F94 70003394 31D8FFFF */ andi $t8, $t6, 0xffff
/* 003F98 70003398 0308C821 */ addu $t9, $t8, $t0
/* 003F9C 7000339C 03297021 */ addu $t6, $t9, $t1
/* 003FA0 700033A0 00007810 */ mfhi $t7
/* 003FA4 700033A4 00000000 */ nop
/* 003FA8 700033A8 00000000 */ nop
/* 003FA4 700033A4 00000000 */ nop
/* 003FA8 700033A8 00000000 */ nop
/* 003FAC 700033AC 01CA001A */ div $zero, $t6, $t2
/* 003FB0 700033B0 15400002 */ bnez $t2, .L700033BC
/* 003FB4 700033B4 00000000 */ nop
/* 003FB4 700033B4 00000000 */ nop
/* 003FB8 700033B8 0007000D */ break 7
.L700033BC:
/* 003FBC 700033BC 2401FFFF */ li $at, -1
/* 003FC0 700033C0 15410004 */ bne $t2, $at, .L700033D4
/* 003FC4 700033C4 3C018000 */ lui $at, 0x8000
/* 003FC8 700033C8 15C10002 */ bne $t6, $at, .L700033D4
/* 003FCC 700033CC 00000000 */ nop
/* 003FCC 700033CC 00000000 */ nop
/* 003FD0 700033D0 0006000D */ break 6
.L700033D4:
/* 003FD4 700033D4 0000C010 */ mfhi $t8
@@ -1525,7 +1526,7 @@ glabel video_related_8
/* 004018 70003418 07E10004 */ bgez $ra, .L7000342C
/* 00401C 7000341C 33F80001 */ andi $t8, $ra, 1
/* 004020 70003420 13000002 */ beqz $t8, .L7000342C
/* 004024 70003424 00000000 */ nop
/* 004024 70003424 00000000 */ nop
/* 004028 70003428 2718FFFE */ addiu $t8, $t8, -2
.L7000342C:
/* 00402C 7000342C 3C018002 */ lui $at, %hi(D_800232C0) # $at, 0x8002
@@ -1558,7 +1559,7 @@ glabel video_related_8
/* 004090 70003490 07210004 */ bgez $t9, .L700034A4
/* 004094 70003494 332E0001 */ andi $t6, $t9, 1
/* 004098 70003498 11C00002 */ beqz $t6, .L700034A4
/* 00409C 7000349C 00000000 */ nop
/* 00409C 7000349C 00000000 */ nop
/* 0040A0 700034A0 25CEFFFE */ addiu $t6, $t6, -2
.L700034A4:
/* 0040A4 700034A4 A04E0000 */ sb $t6, ($v0)
@@ -1567,7 +1568,7 @@ glabel video_related_8
/* 0040B0 700034B0 05E10004 */ bgez $t7, .L700034C4
/* 0040B4 700034B4 31F90001 */ andi $t9, $t7, 1
/* 0040B8 700034B8 13200002 */ beqz $t9, .L700034C4
/* 0040BC 700034BC 00000000 */ nop
/* 0040BC 700034BC 00000000 */ nop
/* 0040C0 700034C0 2739FFFE */ addiu $t9, $t9, -2
.L700034C4:
/* 0040C4 700034C4 01C80019 */ multu $t6, $t0
@@ -1605,7 +1606,7 @@ glabel video_related_8
/* 004144 70003544 8FBF0014 */ lw $ra, 0x14($sp)
/* 004148 70003548 27BD0018 */ addiu $sp, $sp, 0x18
/* 00414C 7000354C 03E00008 */ jr $ra
/* 004150 70003550 00000000 */ nop
/* 004150 70003550 00000000 */ nop
)
#endif
#endif
@@ -1691,7 +1692,7 @@ Gfx *video_related_F(Gfx *gdl)
}
gSPViewport(gdl++, OS_K0_TO_PHYSICAL(&g_CurrentPlayer->viewports[g_ViBackIndex]));
g_viProjectionMatrix = dynAllocateMatrix();
g_viProjectionMatrix = dynAllocateMatrix();
guPerspectiveF(g_viProjectionMatrixF, &g_viPerspNorm, g_ViBackData->fovy, g_ViBackData->aspect, g_ViBackData->znear, g_ViBackData->zfar, 1.0f);
guMtxF2L(g_viProjectionMatrixF, g_viProjectionMatrix);
gSPMatrix(gdl++, OS_K0_TO_PHYSICAL(g_viProjectionMatrix), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
@@ -1926,7 +1927,7 @@ Gfx *viSetFillColor(Gfx *gdl, s32 r, s32 g, s32 b)
{
gDPSetFillColor(gdl++, ((r << 24) | (g << 16) | (b << 8) | 0xFF));
}
return gdl;
}
@@ -1951,7 +1952,7 @@ void indyGrabJpg16bit(void)
*pgrabnum = *pgrabnum + 1;
}
sprintf(buffer, "grab.%d.temp.uix", *pgrabnum);
indycommHostSendDump((u8*)&buffer, (u8*)g_ViBackData->framebuf, (viGetX() * viGetY() * 2));
@@ -1978,7 +1979,7 @@ void indyGrabJpg16bit(void)
*/
void indyGrabJpg32bit(void)
{
#if defined(LEFTOVERDEBUG)
#if defined(LEFTOVERDEBUG)
s32 *pgrabnum = &g_indyJpg32BitGrabnum;
char buffer[250];
s32 filesize;
@@ -1993,7 +1994,7 @@ void indyGrabJpg32bit(void)
*pgrabnum = *pgrabnum + 1;
}
sprintf(buffer, "grab.%d.temp.Uix", *pgrabnum);
indycommHostSendDump((u8*)&buffer, (u8*)&cfb_16, (viGetX() * viGetY() * 4));
@@ -2035,7 +2036,7 @@ void indyGrabRgb16bit(void)
*pgrabnum = *pgrabnum + 1;
}
sprintf(buffer, "grab.%d.temp.uix", *pgrabnum);
indycommHostSendDump((u8*)&buffer, (u8*)g_ViBackData->framebuf, (viGetX() * viGetY() * 2));
@@ -2074,7 +2075,7 @@ void indyGrabRgb32bit(void)
*pgrabnum = *pgrabnum + 1;
}
sprintf(buffer, "grab.%d.temp.Uix", *pgrabnum);
indycommHostSendDump((u8*)&buffer, (u8*)&cfb_16, (viGetX() * viGetY() * 4));
+4 -4
View File
@@ -10,18 +10,18 @@ void alloc_shattered_window_pieces(void)
{
s32 i;
s32 level = lvlGetCurrentStageToLoad();
SHATTERED_WINDOW_PIECES_BUFFER_LEN = (200 / getPlayerCount());
if ((level == LEVELID_STREETS) || (level == LEVELID_DEPOT))
{
SHATTERED_WINDOW_PIECES_BUFFER_LEN = (SHATTERED_WINDOW_PIECES_BUFFER_LEN >> 1);
}
ptr_shattered_window_pieces = mempAllocBytesInBank(((SHATTERED_WINDOW_PIECES_BUFFER_LEN * 0x68) + 0xF) & ~0xF, 4U);
ptr_shattered_window_pieces = mempAllocBytesInBank(((SHATTERED_WINDOW_PIECES_BUFFER_LEN * 0x68) + 0xF) & ~0xF, MEMPOOL_STAGE);
for(i=0; i<SHATTERED_WINDOW_PIECES_BUFFER_LEN; i++)
{
ptr_shattered_window_pieces[i].piece = 0;
}
D_80040940 = 0;
g_NextShardNum = 0;
}
+1036 -761
View File
File diff suppressed because it is too large Load Diff
+18 -8
View File
@@ -16,10 +16,18 @@ struct levelentry
};
typedef struct s_room_info {
u8 bitflags0;
u8 bitflags1;
// is room being rendered? boolean
u8 room_rendered;
// is the room a neighbor to a room being rendered? boolean
u8 room_neighbor_to_rendered;
u8 model_bin_loaded;
u8 bitflags2;
// number of portals in between the player's room and this room.
// is 0 if the room is not visible or if the player is standing in this room.
u8 portals_to_room_count;
Vtx * ptr_point_index;
void * ptr_expanded_mapping_info;
void * ptr_secondary_expanded_mapping_info;
@@ -102,11 +110,13 @@ typedef struct unk_portalstruct
} unk_portalstruct;
extern struct unk_portalstruct table_for_portals[200];
extern s32 MaxNumRooms;
extern s32 g_MaxNumRooms;
extern f32 room_data_float2;
extern bg_room_data * ptr_bgdata_room_fileposition_list;
extern s_room_info array_room_info[];
extern s_room_info g_BgRoomInfo[];
extern Gfx *ptrDynamic_CC_RM_LUT[];
extern Gfx DL_LUT_PRIMARY_ADDFOG[];
void bgInit(void);
@@ -129,19 +139,19 @@ void bgClearDataPortalsControlBytes1Low2Bits(s32 index);
void bgSetDataPortalsControlBytes1Bit2(s32 index);
s32 sub_GAME_7F0B9A7C(s32 arg0);
s32 sub_GAME_7F0B9A2C(s32 arg0);
void sub_GAME_7F0B4884(void);
void bgRoomVisibilityRelated(void);
Gfx* bgLevelRender(Gfx *arg0);
Gfx *bgScissorCurrentPlayerView(Gfx *arg0, s32 left, s32 top, s32 width, s32 height);
Gfx* bgScissorCurrentPlayerViewDefault(Gfx* arg0);
Gfx* bgScissorCurrentPlayerViewF(Gfx* arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4);
f32 get_room_data_float1(void);
u8 getROOMID_Bitflags(int roomID);
u8 getROOMID_isRendered(int roomID);
s32 bgGet2dBboxByRoomId(s32 room_id, struct bbox2d *result);
f32 bgGetLevelVisibilityScale(void);
void sub_GAME_7F0B5CC0(struct bbox2d *a, struct bbox2d *b);
f32 get_room_data_float2(void);
s32 sub_GAME_7F0B9CC8(s32 arg0, s32 arg1, struct coord3d *arg2, struct coord3d *arg3);
void sub_GAME_7F0B96CC(s32 arg0, struct PortalMetric *arg1);
void bgLoadFromDynamicCCRMLUT(s32 arg0, s32 arg1, s32 arg2);
void bgLoadFromDynamicCCRMLUT(Gfx *arg0, Gfx *arg1, enum CCRMLUT arg2);
#endif
+38 -221
View File
@@ -18,236 +18,53 @@
// new file, per EU
#ifdef NONMATCHING
u32 sub_GAME_7F0BA5C0(u32 arg0, u32 arg1) {
s32 temp_a0;
u32 temp_v0;
void *phi_v0;
s32 phi_a0;
void *phi_v1;
// Node 0
if (arg0 < arg1)
{
// Node 1
phi_v0 = arg0;
loop_2:
// Node 2
if (DL_LUT_PRIMARY_ADDFOG != 0)
{
// Node 3
phi_a0 = DL_LUT_PRIMARY_ADDFOG;
phi_v1 = &DL_LUT_PRIMARY_ADDFOG;
loop_4:
// Node 4
if (*phi_v0 == phi_a0)
{
// Node 5
if (phi_v0->unk4 == phi_v1->unk4)
{
// Node 6
*phi_v0 = (s32) phi_v1->unk8;
phi_v0->unk4 = (s32) phi_v1->unkC;
}
}
// Node 7
temp_a0 = phi_v1->unk10;
phi_a0 = temp_a0;
phi_v1 = (phi_v1 + 0x10);
if (temp_a0 != 0)
{
goto loop_4;
}
}
// Node 8
temp_v0 = (phi_v0 + 8);
phi_v0 = temp_v0;
if (temp_v0 < arg1)
{
goto loop_2;
}
}
// Node 9
return arg0;
}
#else
GLOBAL_ASM(
.text
glabel sub_GAME_7F0BA5C0
/* 0EF0F0 7F0BA5C0 0085082B */ sltu $at, $a0, $a1
/* 0EF0F4 7F0BA5C4 1020001C */ beqz $at, .L7F0BA638
/* 0EF0F8 7F0BA5C8 00801025 */ move $v0, $a0
/* 0EF0FC 7F0BA5CC 3C068004 */ lui $a2, %hi(DL_LUT_PRIMARY_ADDFOG)
/* 0EF100 7F0BA5D0 24C64940 */ addiu $a2, %lo(DL_LUT_PRIMARY_ADDFOG) # addiu $a2, $a2, 0x4940
/* 0EF104 7F0BA5D4 8CCE0000 */ lw $t6, ($a2)
.L7F0BA5D8:
/* 0EF108 7F0BA5D8 3C0F8004 */ lui $t7, %hi(DL_LUT_PRIMARY_ADDFOG)
/* 0EF10C 7F0BA5DC 25EF4940 */ addiu $t7, %lo(DL_LUT_PRIMARY_ADDFOG) # addiu $t7, $t7, 0x4940
/* 0EF110 7F0BA5E0 11C00011 */ beqz $t6, .L7F0BA628
/* 0EF114 7F0BA5E4 00C01825 */ move $v1, $a2
/* 0EF118 7F0BA5E8 8DE40000 */ lw $a0, ($t7)
/* 0EF11C 7F0BA5EC 8C580000 */ lw $t8, ($v0)
.L7F0BA5F0:
/* 0EF120 7F0BA5F0 5704000A */ bnel $t8, $a0, .L7F0BA61C
/* 0EF124 7F0BA5F4 8C640010 */ lw $a0, 0x10($v1)
/* 0EF128 7F0BA5F8 8C590004 */ lw $t9, 4($v0)
/* 0EF12C 7F0BA5FC 8C680004 */ lw $t0, 4($v1)
/* 0EF130 7F0BA600 57280006 */ bnel $t9, $t0, .L7F0BA61C
/* 0EF134 7F0BA604 8C640010 */ lw $a0, 0x10($v1)
/* 0EF138 7F0BA608 8C610008 */ lw $at, 8($v1)
/* 0EF13C 7F0BA60C AC410000 */ sw $at, ($v0)
/* 0EF140 7F0BA610 8C6A000C */ lw $t2, 0xc($v1)
/* 0EF144 7F0BA614 AC4A0004 */ sw $t2, 4($v0)
/* 0EF148 7F0BA618 8C640010 */ lw $a0, 0x10($v1)
.L7F0BA61C:
/* 0EF14C 7F0BA61C 24630010 */ addiu $v1, $v1, 0x10
/* 0EF150 7F0BA620 5480FFF3 */ bnezl $a0, .L7F0BA5F0
/* 0EF154 7F0BA624 8C580000 */ lw $t8, ($v0)
.L7F0BA628:
/* 0EF158 7F0BA628 24420008 */ addiu $v0, $v0, 8
/* 0EF15C 7F0BA62C 0045082B */ sltu $at, $v0, $a1
/* 0EF160 7F0BA630 5420FFE9 */ bnezl $at, .L7F0BA5D8
/* 0EF164 7F0BA634 8CCE0000 */ lw $t6, ($a2)
.L7F0BA638:
/* 0EF168 7F0BA638 03E00008 */ jr $ra
/* 0EF16C 7F0BA63C 00000000 */ nop
)
#endif
#ifdef NONMATCHING
void LoadFromDynamicCCRMLUT(Gfx *glistp, int DLSize, int LUTToUse)
/**
* Unreferenced.
*/
void sub_GAME_7F0BA5C0(Gfx *arg0, Gfx *arg1)
{
char cVar1;
int *piVar2;
int iVar3;
int iVar4;
Gfx *var_v0;
Gfx *var_v1;
if ((param_2 != NULL) && (param_1 < param_2))
goto code_r0x7f0ba66c;
if (param_2 == NULL)
var_v0 = arg0;
while (var_v0 < arg1)
{
cVar1 = *(char *)param_1;
while (cVar1 != -0x48)
for (var_v1 = DL_LUT_PRIMARY_ADDFOG; var_v1->words.w0 != 0; var_v1 += 2)
{
code_r0x7f0ba66c:
do
if ((var_v1->words.w0 == var_v0->words.w0) && (var_v1->words.w1 == var_v0->words.w1))
{
piVar2 = (int *)(&gDynamic_CC_RM_LUTp)[param_3];
iVar3 = *piVar2;
if (iVar3 != 0)
{
iVar4 = *param_1;
while (true)
{
if (iVar4 == iVar3)
{
if (param_1[1] == piVar2[1])
{
dword_80044DB0 += 1;
*param_1 = piVar2[2];
param_1[1] = piVar2[3];
iVar3 = piVar2[4];
}
else
{
iVar3 = piVar2[4];
}
}
else
{
iVar3 = piVar2[4];
}
piVar2 = piVar2 + 4;
if (iVar3 == 0)
break;
iVar4 = *param_1;
}
}
param_1 = param_1 + 2;
} while ((param_2 != NULL) && (param_1 < param_2));
if (param_2 != NULL)
{
return;
*var_v0 = *(var_v1+1);
}
cVar1 = *(char *)param_1;
}
var_v0++;
}
return;
}
#else
GLOBAL_ASM(
.text
glabel bgLoadFromDynamicCCRMLUT /*DynamicCCRMLUT(Int DLSize (a0), Gfx GBICommand(a1), Gfx ReplacementGBICommand (a2))*/
/* 0EF170 7F0BA640 10A00004 */ beqz $a1, .L7F0BA654 /*if a1 = 0 goto L7F0BA654*/
/* 0EF174 7F0BA644 00801025 */ move $v0, $a0 /*v0 = a0*/
/* 0EF178 7F0BA648 0045082B */ sltu $at, $v0, $a1 /*if a1 < v0 then goto L7F0BA668*/
/* 0EF17C 7F0BA64C 14200006 */ bnez $at, .L7F0BA668
/* 0EF180 7F0BA650 00000000 */ nop
.L7F0BA654:
/* 0EF184 7F0BA654 14A0002E */ bnez $a1, .L7F0BA710 /*if a1 != 0 goto return*/
/* 0EF188 7F0BA658 00000000 */ nop
/* 0EF18C 7F0BA65C 808E0000 */ lb $t6, ($a0) /*t6 = byte(a0)*/
/* 0EF190 7F0BA660 2408FFB8 */ li $t0, -72 /*t0 = 0xB8*/
/* 0EF194 7F0BA664 110E002A */ beq $t0, $t6, .L7F0BA710 /*if t6 = 0xB8 return (B8 = EndDl())*/
.L7F0BA668:
/* 0EF198 7F0BA668 3C098004 */ lui $t1, %hi(ptrDynamic_CC_RM_LUT)
/* 0EF19C 7F0BA66C 25294D88 */ addiu $t1, %lo(ptrDynamic_CC_RM_LUT) # addiu $t1, $t1, 0x4d88
/* 0EF1A0 7F0BA670 00067880 */ sll $t7, $a2, 2 /*t7 = a2 << 2*/
/* 0EF1A4 7F0BA674 012FC021 */ addu $t8, $t1, $t7 /*t8 = t7 + t1*/
/* 0EF1A8 7F0BA678 8F030000 */ lw $v1, ($t8)
/* 0EF1AC 7F0BA67C 3C078004 */ lui $a3, %hi(D_80044DB0)
/* 0EF1B0 7F0BA680 8CE74DB0 */ lw $a3, %lo(D_80044DB0)($a3) # 0x4DB0($a3),
/* 0EF1B4 7F0BA684 8C640000 */ lw $a0, ($v1)
/* 0EF1B8 7F0BA688 2408FFB8 */ li $t0, -72
/* 0EF1BC 7F0BA68C 10800011 */ beqz $a0, .L7F0BA6D4
/* 0EF1C0 7F0BA690 00000000 */ nop
/* 0EF1C4 7F0BA694 8C590000 */ lw $t9, ($v0)
.L7F0BA698:
/* 0EF1C8 7F0BA698 5724000B */ bnel $t9, $a0, .L7F0BA6C8
/* 0EF1CC 7F0BA69C 8C640010 */ lw $a0, 0x10($v1)
/* 0EF1D0 7F0BA6A0 8C4A0004 */ lw $t2, 4($v0)
/* 0EF1D4 7F0BA6A4 8C6B0004 */ lw $t3, 4($v1)
/* 0EF1D8 7F0BA6A8 554B0007 */ bnel $t2, $t3, .L7F0BA6C8
/* 0EF1DC 7F0BA6AC 8C640010 */ lw $a0, 0x10($v1)
/* 0EF1E0 7F0BA6B0 8C610008 */ lw $at, 8($v1)
/* 0EF1E4 7F0BA6B4 24E70001 */ addiu $a3, $a3, 1
/* 0EF1E8 7F0BA6B8 AC410000 */ sw $at, ($v0)
/* 0EF1EC 7F0BA6BC 8C6D000C */ lw $t5, 0xc($v1)
/* 0EF1F0 7F0BA6C0 AC4D0004 */ sw $t5, 4($v0)
/* 0EF1F4 7F0BA6C4 8C640010 */ lw $a0, 0x10($v1)
.L7F0BA6C8:
/* 0EF1F8 7F0BA6C8 24630010 */ addiu $v1, $v1, 0x10
/* 0EF1FC 7F0BA6CC 5480FFF2 */ bnezl $a0, .L7F0BA698
/* 0EF200 7F0BA6D0 8C590000 */ lw $t9, ($v0)
.L7F0BA6D4:
/* 0EF204 7F0BA6D4 10A00006 */ beqz $a1, .L7F0BA6F0
/* 0EF208 7F0BA6D8 24420008 */ addiu $v0, $v0, 8
/* 0EF20C 7F0BA6DC 3C018004 */ lui $at, %hi(D_80044DB0)
/* 0EF210 7F0BA6E0 AC274DB0 */ sw $a3, %lo(D_80044DB0)($at)
/* 0EF214 7F0BA6E4 0045082B */ sltu $at, $v0, $a1
/* 0EF218 7F0BA6E8 1420FFDF */ bnez $at, .L7F0BA668
/* 0EF21C 7F0BA6EC 00000000 */ nop
.L7F0BA6F0:
/* 0EF220 7F0BA6F0 3C018004 */ lui $at, %hi(D_80044DB0)
/* 0EF224 7F0BA6F4 14A00006 */ bnez $a1, .L7F0BA710
/* 0EF228 7F0BA6F8 AC274DB0 */ sw $a3, %lo(D_80044DB0)($at)
/* 0EF22C 7F0BA6FC 3C018004 */ lui $at, %hi(D_80044DB0)
/* 0EF230 7F0BA700 AC274DB0 */ sw $a3, %lo(D_80044DB0)($at)
/* 0EF234 7F0BA704 804E0000 */ lb $t6, ($v0)
/* 0EF238 7F0BA708 150EFFD7 */ bne $t0, $t6, .L7F0BA668
/* 0EF23C 7F0BA70C 00000000 */ nop
.L7F0BA710:
/* 0EF240 7F0BA710 03E00008 */ jr $ra
/* 0EF244 7F0BA714 00000000 */ nop
)
#endif
void bgLoadFromDynamicCCRMLUT(Gfx *arg0, Gfx *arg1, enum CCRMLUT arg2)
{
Gfx *var_v0;
Gfx *var_v1;
static s32 D_80044DB0 = 0;
var_v0 = arg0;
while (((arg1 != NULL) && (var_v0 < arg1)) || ((arg1 == NULL) && (((s8*)var_v0)[0] != (s8)G_ENDDL)))
{
for (var_v1 = ptrDynamic_CC_RM_LUT[(s32)arg2]; var_v1->words.w0 != 0; var_v1 += 2)
{
if ((var_v1->words.w0 == var_v0->words.w0) && (var_v1->words.w1 == var_v0->words.w1))
{
D_80044DB0 += 1;
*var_v0 = *(var_v1+1);
}
}
var_v0++;
}
}
+2 -2
View File
@@ -203,8 +203,8 @@ Gfx *insert_imageDL(Gfx *gdl) {
}
Gfx *sub_GAME_7F01C1A4(Gfx *gdl) {
gSPMatrix(gdl++, osVirtualToPhysical(matrix_buffer_gunbarrel_0), (G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION));
gSPMatrix(gdl++, osVirtualToPhysical(&matrix_buffer_rarelogo_2[D_8002A7D0]), (G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW));
gSPMatrix(gdl++, osVirtualToPhysical(matrixBufferGunbarrel0), (G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION));
gSPMatrix(gdl++, osVirtualToPhysical(&matrixBufferRareLogo2[D_8002A7D0]), (G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW));
gDPPipeSync(gdl++);
gDPSetCycleType(gdl++, G_CYC_1CYCLE);
gDPSetRenderMode(gdl++, G_RM_AA_OPA_SURF, G_RM_AA_OPA_SURF2);
+105 -79
View File
@@ -22,31 +22,6 @@ struct init_bond_anim_unk g_BondMoveAnimationSetup[2] = {
{PTR_ANIM_sprinting, 7.5f, 17.0f, 0.0f, 1.5f, 100.0f}
};
/**
* Address 0x80036B00.
*/
coord3d D_80036B00 = { 0.0f, 0.0f, 0.0f };
/**
* Address 0x80036B0C.
*/
coord3d D_80036B0C = { 0.0f, 0.0f, 1.0f };
/**
* Address 0x80036B18.
*/
coord3d D_80036B18 = { 0.0f, 1.0f, 0.0f };
/**
* Address 0x80036B24.
*/
struct unk_joint_list D_80036B24 = {NULL, 1, 3, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0}, 0};
/**
* Address 0x80036B64.
*/
coord3d D_80036B64 = { 0.0f, 0.0f, 0.0f };
@@ -65,7 +40,7 @@ void bheadSetdamp(f32 headdamp);
void bheadFlipAnimation()
{
g_CurrentPlayer->field_5BC = !g_CurrentPlayer->field_5BC;
g_CurrentPlayer->animFlipFlag = !g_CurrentPlayer->animFlipFlag;
}
void bheadUpdateIdleRoll()
@@ -131,7 +106,7 @@ void bheadUpdateRot(coord3d *lookvel, coord3d *upvel)
g_CurrentPlayer->headlooksum.f[0] = lookvel->f[0] / (1.0f - g_CurrentPlayer->headdamp);
g_CurrentPlayer->headlooksum.f[1] = lookvel->f[1] / (1.0f - g_CurrentPlayer->headdamp);
g_CurrentPlayer->headlooksum.f[2] = lookvel->f[2] / (1.0f - g_CurrentPlayer->headdamp);
g_CurrentPlayer->headupsum.f[0] = upvel->f[0] / (1.0f - g_CurrentPlayer->headdamp);
g_CurrentPlayer->headupsum.f[1] = upvel->f[1] / (1.0f - g_CurrentPlayer->headdamp);
g_CurrentPlayer->headupsum.f[2] = upvel->f[2] / (1.0f - g_CurrentPlayer->headdamp);
@@ -144,7 +119,7 @@ void bheadUpdateRot(coord3d *lookvel, coord3d *upvel)
g_CurrentPlayer->headlooksum.f[0] = g_CurrentPlayer->headdamp * g_CurrentPlayer->headlooksum.f[0] + lookvel->f[0];
g_CurrentPlayer->headlooksum.f[1] = g_CurrentPlayer->headdamp * g_CurrentPlayer->headlooksum.f[1] + lookvel->f[1];
g_CurrentPlayer->headlooksum.f[2] = g_CurrentPlayer->headdamp * g_CurrentPlayer->headlooksum.f[2] + lookvel->f[2];
g_CurrentPlayer->headupsum.f[0] = g_CurrentPlayer->headdamp * g_CurrentPlayer->headupsum.f[0] + upvel->f[0];
g_CurrentPlayer->headupsum.f[1] = g_CurrentPlayer->headdamp * g_CurrentPlayer->headupsum.f[1] + upvel->f[1];
g_CurrentPlayer->headupsum.f[2] = g_CurrentPlayer->headdamp * g_CurrentPlayer->headupsum.f[2] + upvel->f[2];
@@ -153,7 +128,7 @@ void bheadUpdateRot(coord3d *lookvel, coord3d *upvel)
g_CurrentPlayer->headlook.f[0] = g_CurrentPlayer->headlooksum.f[0] * (1.0f - g_CurrentPlayer->headdamp);
g_CurrentPlayer->headlook.f[1] = g_CurrentPlayer->headlooksum.f[1] * (1.0f - g_CurrentPlayer->headdamp);
g_CurrentPlayer->headlook.f[2] = g_CurrentPlayer->headlooksum.f[2] * (1.0f - g_CurrentPlayer->headdamp);
g_CurrentPlayer->headup.f[0] = g_CurrentPlayer->headupsum.f[0] * (1.0f - g_CurrentPlayer->headdamp);
g_CurrentPlayer->headup.f[1] = g_CurrentPlayer->headupsum.f[1] * (1.0f - g_CurrentPlayer->headdamp);
g_CurrentPlayer->headup.f[2] = g_CurrentPlayer->headupsum.f[2] * (1.0f - g_CurrentPlayer->headdamp);
@@ -164,33 +139,79 @@ void bheadSetdamp(f32 headdamp)
if (headdamp != g_CurrentPlayer->headdamp)
{
f32 divisor = 1.0f - headdamp;
g_CurrentPlayer->headlooksum.f[0] = (g_CurrentPlayer->headlooksum.f[0] * (1.0f - g_CurrentPlayer->headdamp)) / divisor;
g_CurrentPlayer->headlooksum.f[1] = (g_CurrentPlayer->headlooksum.f[1] * (1.0f - g_CurrentPlayer->headdamp)) / divisor;
g_CurrentPlayer->headlooksum.f[2] = (g_CurrentPlayer->headlooksum.f[2] * (1.0f - g_CurrentPlayer->headdamp)) / divisor;
g_CurrentPlayer->headupsum.f[0] = (g_CurrentPlayer->headupsum.f[0] * (1.0f - g_CurrentPlayer->headdamp)) / divisor;
g_CurrentPlayer->headupsum.f[1] = (g_CurrentPlayer->headupsum.f[1] * (1.0f - g_CurrentPlayer->headdamp)) / divisor;
g_CurrentPlayer->headupsum.f[2] = (g_CurrentPlayer->headupsum.f[2] * (1.0f - g_CurrentPlayer->headdamp)) / divisor;
g_CurrentPlayer->headdamp = headdamp;
}
}
/**
* Address 0x80036B00.
*/
coord3d initialHeadPosition = { 0.0f, 0.0f, 0.0f };
/**
* Address 0x80036B0C.
*/
coord3d headLookDirection = { 0.0f, 0.0f, 1.0f };
/**
* Address 0x80036B18.
*/
coord3d headUpDirection = { 0.0f, 1.0f, 0.0f };
/**
* Address 0x80036B24.
*/
ModelRenderData headModelRenderData = {NULL,
TRUE,
0x00000003,
NULL,
NULL,
0,
0,
0,
0,
0,
0,
0,
0,
{0, 0, 0, 0},
{0, 0, 0, 0},
CULLMODE_BOTH};
/**
* Address 0x80036B64.
*/
coord3d D_80036B64 = { 0.0f, 0.0f, 0.0f };
/**
* Updates the head movement based on the player's speed and animation state.
*/
void bheadUpdate(f32 percent_speed, f32 speedsideways)
{
coord3d headpos;
coord3d lookvel;
coord3d upvel;
f32 abs_anim_speed;
struct unk_joint_list sp80;
ModelRenderData renderData;
Mtxf sp40;
coord3d sp34;
u32 sp30;
coord3d offset;
u32 isMergable;
headpos = D_80036B00;
lookvel = D_80036B0C;
upvel = D_80036B18;
headpos = initialHeadPosition;
lookvel = headLookDirection;
upvel = headUpDirection;
abs_anim_speed = modelGetAbsAnimSpeed(&g_CurrentPlayer->model);
@@ -222,35 +243,35 @@ void bheadUpdate(f32 percent_speed, f32 speedsideways)
g_CurrentPlayer->sideamplitude = g_CurrentPlayer->headamplitude;
}
sp80 = D_80036B24;
sp34 = D_80036B64;
renderData = headModelRenderData;
offset = D_80036B64;
sp30 = modelIsAnimMergingEnabled();
isMergable = modelIsAnimMergingEnabled();
g_CurrentPlayer->resetheadtick = 0;
g_CurrentPlayer->resetheadtick = FALSE;
modelSetAnimMergingEnabled(0);
modelTickAnimQuarterSpeed(&g_CurrentPlayer->model, g_ClockTimer, 1);
modelSetAnimMergingEnabled((s32) sp30);
modelSetAnimMergingEnabled((s32) isMergable);
subcalcpos(&g_CurrentPlayer->model);
matrix_4x4_set_identity(&sp40);
sp80.unk_matrix = &sp40;
sp80.mtxlist = &g_CurrentPlayer->bondheadmatrices[0];
renderData.unk_matrix = &sp40;
renderData.mtxlist = &g_CurrentPlayer->bondheadmatrices[0];
subcalcmatrices(&sp80, &g_CurrentPlayer->model);
subcalcmatrices(&renderData, &g_CurrentPlayer->model);
g_CurrentPlayer->headbodyoffset.f[0] = g_CurrentPlayer->standbodyoffset.x;
g_CurrentPlayer->headbodyoffset.f[1] = g_CurrentPlayer->standbodyoffset.y;
g_CurrentPlayer->headbodyoffset.f[2] = g_CurrentPlayer->standbodyoffset.z;
getsuboffset(&g_CurrentPlayer->model, (struct float3 *) &sp34);
getsuboffset(&g_CurrentPlayer->model, (struct float3 *) &offset);
sp34.f[0] -= g_CurrentPlayer->bondheadmatrices[0].m[3][0];
sp34.f[2] -= g_CurrentPlayer->bondheadmatrices[0].m[3][2];
setsuboffset(&g_CurrentPlayer->model, (coord3d *) &sp34);
offset.f[0] -= g_CurrentPlayer->bondheadmatrices[0].m[3][0];
offset.f[2] -= g_CurrentPlayer->bondheadmatrices[0].m[3][2];
setsuboffset(&g_CurrentPlayer->model, (coord3d *) &offset);
if (abs_anim_speed > 0.0f)
{
@@ -366,20 +387,20 @@ void bheadUpdate(f32 percent_speed, f32 speedsideways)
/**
* Adjust Bond model based on speed (speedforwards).
* Toggle the currently selected headanim index.
* Address 0x7F08E8BC.
*/
* Adjusts Bond's head animation based on movement speed.
*
* @param speed The movement speed to adjust the animation to.
*/
void bheadAdjustAnimation(f32 speed)
{
s32 i;
f32 startframe;
speed *= g_BondMoveAnimationSetup[1].unk0C;
speed *= g_BondMoveAnimationSetup[1].speedMultiplier;
for (i=0; i<2; i++)
{
if (speed <= g_BondMoveAnimationSetup[i].unk14 * g_BondMoveAnimationSetup[i].unk0C)
if (speed <= g_BondMoveAnimationSetup[i].unk14 * g_BondMoveAnimationSetup[i].speedMultiplier)
{
if (i != g_CurrentPlayer->headanim)
{
@@ -397,7 +418,7 @@ void bheadAdjustAnimation(f32 speed)
&g_CurrentPlayer->model,
// match hack: addu address backwards
(struct ModelAnimation *) ((s32)g_BondMoveAnimationSetup[i].anim_id + (s32)&ptr_animation_table->data),
(s32) g_CurrentPlayer->field_5BC,
(s32) g_CurrentPlayer->animFlipFlag,
startframe,
0.5f,
12.0f);
@@ -408,7 +429,7 @@ void bheadAdjustAnimation(f32 speed)
g_CurrentPlayer->headanim = i;
}
speed /= g_BondMoveAnimationSetup[i].unk0C;
speed /= g_BondMoveAnimationSetup[i].speedMultiplier;
modelSetAnimSpeed(&g_CurrentPlayer->model, speed * 0.5f, 0.0f);
return;
@@ -417,12 +438,14 @@ void bheadAdjustAnimation(f32 speed)
}
/**
* Address 0x7F08EA48.
*/
* Starts a new death animation for Bond's head.
*
* @param animNum The animation to play.
* @param flip Whether to flip the animation.
* @param startFrame The starting frame of the animation.
* @param speed The speed of the animation.
*/
void bheadStartDeathAnimation(struct ModelAnimation *animnum, s32 flip, f32 fstarttime, f32 speed)
{
modelSetAnimation(&g_CurrentPlayer->model, animnum, flip, fstarttime, speed * 0.5f, 12.0f);
@@ -430,37 +453,40 @@ void bheadStartDeathAnimation(struct ModelAnimation *animnum, s32 flip, f32 fsta
}
/**
* Address 0x7F08EAB8.
*/
* Sets the speed of the current head animation.
*
* @param speed The speed to set for the head animation.
*/
void bheadSetSpeed(f32 speed)
{
modelSetAnimSpeed(&g_CurrentPlayer->model, speed * 0.5f, 0.0f);
}
/**
* Calculates the breathing value for Bond's head animation.
*
* @return The calculated breathing value.
*/
f32 bheadGetBreathingValue(void)
{
if (g_CurrentPlayer->headanim >= 0) {
// bondviewGetBondBreathing() * (1/80) + (1/240)
f32 a = bondviewGetBondBreathing() * 0.012500001f + 0.004166667f;
f32 b = modelGetAbsAnimSpeed(&g_CurrentPlayer->model);
f32 baseBreathing = bondviewGetBondBreathing() * 0.012500001f + 0.004166667f;
f32 animSpeed = modelGetAbsAnimSpeed(&g_CurrentPlayer->model);
if (b > 0) {
f32 c = b / (g_BondMoveAnimationSetup[g_CurrentPlayer->headanim].endframe - g_BondMoveAnimationSetup[g_CurrentPlayer->headanim].loopframe);
if (animSpeed > 0) {
f32 calculatedBreathing = animSpeed / (g_BondMoveAnimationSetup[g_CurrentPlayer->headanim].endframe - g_BondMoveAnimationSetup[g_CurrentPlayer->headanim].loopframe);
if (c < a) {
c = a;
if (calculatedBreathing < baseBreathing) {
calculatedBreathing = baseBreathing;
}
return c;
return calculatedBreathing;
}
return a;
return baseBreathing;
}
return 0;
+3 -3
View File
@@ -8,7 +8,7 @@ struct init_bond_anim_unk {
u32 anim_id;
f32 loopframe;
f32 endframe;
f32 unk0C;
f32 speedMultiplier;
f32 unk10;
f32 unk14;
@@ -18,8 +18,8 @@ extern struct init_bond_anim_unk g_BondMoveAnimationSetup[];
s32 waypointFindRoute(waypoint *, waypoint *, waypoint ** arr, s32 arr_len);
waypoint * sub_GAME_7F08FB90(waypoint *, waypoint *);
void bheadFlipAnimation();
void bheadUpdateIdleRoll();
void bheadFlipAnimation(void);
void bheadUpdateIdleRoll(void);
void bheadUpdate(f32 percent_speed, f32 speedsideways);
void bheadAdjustAnimation(f32 arg0);
void bheadStartDeathAnimation(struct ModelAnimation *arg0, s32 arg1, f32 arg2, f32 arg3);
+20 -16
View File
@@ -169,6 +169,10 @@ InvItem *bondinvGetNextAvailItem(void)
}
}
#ifdef DEBUG
osSyncPrintf("equipgetfreeitem: No free equip items!!!!\n");
#endif
return NULL;
}
@@ -1075,9 +1079,9 @@ u16 *bondinvGetNameByIndex(s32 index)
if (override)
{
if (override->unk6)
if (override->shorttext)
{
return langGet(override->unk6);
return langGet(override->shorttext);
}
weaponnum = override->weapon;
@@ -1088,9 +1092,9 @@ u16 *bondinvGetNameByIndex(s32 index)
weaponnum = item->type_inv_item.type_weap.weapon;
override = bondinvGetTextbyWeaponID(weaponnum);
if (override && override->unk6)
if (override && override->shorttext)
{
return langGet(override->unk6);
return langGet(override->shorttext);
}
}
}
@@ -1135,9 +1139,9 @@ u16 *bondinvGetLongNameByIndex(s32 index)
if (override)
{
if (override->unk7)
if (override->longtext)
{
return langGet(override->unk7);
return langGet(override->longtext);
}
weaponnum = override->weapon;
@@ -1148,9 +1152,9 @@ u16 *bondinvGetLongNameByIndex(s32 index)
weaponnum = item->type_inv_item.type_weap.weapon;
override = bondinvGetTextbyWeaponID(weaponnum);
if (override && override->unk7)
if (override && override->longtext)
{
return langGet(override->unk7);
return langGet(override->longtext);
}
}
}
@@ -1215,9 +1219,9 @@ u16 *bondinvGetFirstTitlebyIndex(s32 index)
if (override)
{
if (override->unk4)
if (override->titletext1)
{
return langGet(override->unk4);
return langGet(override->titletext1);
}
weaponnum = override->weapon;
@@ -1228,9 +1232,9 @@ u16 *bondinvGetFirstTitlebyIndex(s32 index)
weaponnum = item->type_inv_item.type_weap.weapon;
override = bondinvGetTextbyWeaponID(weaponnum);
if (override && override->unk4)
if (override && override->titletext1)
{
return langGet(override->unk4);
return langGet(override->titletext1);
}
}
}
@@ -1275,9 +1279,9 @@ u16 *bondinvGetSecondTitlebyIndex(s32 index)
if (override)
{
if (override->unk5)
if (override->titletext2)
{
return langGet(override->unk5);
return langGet(override->titletext2);
}
weaponnum = override->weapon;
@@ -1288,9 +1292,9 @@ u16 *bondinvGetSecondTitlebyIndex(s32 index)
weaponnum = item->type_inv_item.type_weap.weapon;
override = bondinvGetTextbyWeaponID(weaponnum);
if (override && override->unk5)
if (override && override->titletext2)
{
return langGet(override->unk5);
return langGet(override->titletext2);
}
}
}
+1412 -2856
View File
File diff suppressed because it is too large Load Diff
+75 -440
View File
@@ -27,7 +27,7 @@ typedef struct invitem_dual
/** unknown struct, used in `strut player`.
* We know this is a struct from the compiler auto-generated
* code to copy structs in bondview.c bondviewKillCurrentPlayer.
*
*
* sizeof == 84 (0x54)
*/
struct collision434 {
@@ -45,8 +45,8 @@ struct collision434 {
/**
* This affects Bond's movement, but not the viewport.
* This does not affect boost direction.
*
* f[0]: forward component (sin theta) in radians
*
* f[0]: forward component (sin theta) in radians
* f[1]: zero
* f[2]: sideways component (cos theta) in radians.
* Offset 0x10.
@@ -142,18 +142,18 @@ struct hand
s32 field_938;
s32 field_93C;
s32 field_940;
s32 field_944;
f32 field_944;
s32 field_948;
s32 field_94C;
f32 field_94C;
s32 field_950;
s32 field_954;
s32 field_958;
s32 field_95C;
s32 field_960;
s32 field_964;
s32 field_968;
f32 field_968;
s32 field_96C;
s32 field_970;
f32 field_970;
s32 field_974;
coord3d blendpos[4];
coord3d blendlook[4];
@@ -203,7 +203,7 @@ struct hand
// offset 0xad8
Mtxf throw_item_pos_related;
s32 field_B18;
s32 field_B1C;
s32 field_B20;
@@ -286,10 +286,10 @@ typedef struct textoverride {
/*0x00*/ u32 unk1;
/*0x04*/ s32 objoffset;
/*0x08*/ s32 weapon;
/*0x0c*/ u32 unk4;
/*0x10*/ u32 unk5;
/*0x14*/ u32 unk6;
/*0x18*/ u32 unk7;
/*0x0c*/ u32 titletext1; //1st title
/*0x10*/ u32 titletext2;//2nd title
/*0x14*/ u32 shorttext;
/*0x18*/ u32 longtext; //longname
/*0x1c*/ u32 pickuptext;
/*0x20*/ struct textoverride *next;
/*0x24*/ struct ObjectRecord *obj;
@@ -381,7 +381,7 @@ struct player
* Offset 0x007c.
*/
/* 0x007c */ f32 field_7C;
/* 0x0080 */ f32 field_80;
/**
@@ -406,13 +406,13 @@ struct player
* Collision / clipping related.
* When Bond falls off a ladder or similar, will "overshoot" vertical default.
* Current offset is stored in this field.
*
*
* Offset 0x0090.
*/
/* 0x0090 */ f32 vertical_bounce_adjust;
/* 0x0094 */ s32 field_94;
/* 0x0098 */ f32 field_98;
/**
* Flag: 0, 1, 2
*/
@@ -437,7 +437,7 @@ struct player
struct rect4f collision_bounds;
/* 0x00d0 */ s32 field_D0;
/* 0x00d4 */ s32 *ptr_char_objectinstance;
/* 0x00d4 */ struct Model *ptr_char_objectinstance; //canonically bondsub
/* 0x00d8 */ s32 bonddead;
/* 0x00dc */ f32 bondhealth;
/* 0x00e0 */ f32 bondarmour;
@@ -458,7 +458,7 @@ struct player
* 0x00f4
**/
f32 damageshowtime;
/**
* When a non-negative integer:
* - Show health and body armor overlay if Bond isn't dead.
@@ -501,25 +501,25 @@ struct player
/* 0x0144 */ s32 autoxaimtime60;
/* 0x0148 */ f32 vv_theta;
/* 0x014c */ f32 speedtheta;
/**
* Computed value from vv_theta, used to calculate boost direction.
* 0x0150
**/
f32 vv_costheta;
/**
* Computed value from vv_theta, used to calculate boost direction.
* 0x0154
**/
f32 vv_sintheta;
/**
* Vertical look angle.
* 0x0158
**/
f32 vv_verta;
/**
* Vertical look angle. Computed value from vv_verta, should always be between 0 and 360 degrees.
* 0x015c
@@ -527,13 +527,13 @@ struct player
f32 vv_verta360;
/* 0x0160 */ f32 speedverta;
/**
* Computed value from vv_verta360, but otherwise unused?
* 0x0164
**/
f32 vv_cosverta;
/**
* Computed value from vv_verta360, but otherwise unused?
* 0x0168
@@ -555,7 +555,7 @@ struct player
* How long Bond has been running
*/
/* 0x017c */ s32 speedmaxtime60;
coord3d bondshotspeed; //0x180
// offset 0x18c
@@ -572,7 +572,7 @@ struct player
// offset 0x19c
f32 bondbreathing;
s32 field_1A0;
s32 field_1A4;
s32 field_1A8;
@@ -589,8 +589,8 @@ struct player
*/
s32 watch_pause_time;
s32 field_1C4;
s32 watch_animation_state;
/* 0x01c4 */ s32 timer_1C4;
/* 0x01c8 */ s32 watch_animation_state;
/**
* 1 = level is active
@@ -638,7 +638,7 @@ struct player
* Offset 0x022c.
*/
f32 pause_watch_related_scaled;
s32 something_with_watch_object_instance;
s32 field_234;
@@ -779,10 +779,10 @@ struct player
* Offset 0x408.
*/
coord3d bondprevpos; //0x408
f32 thetadie; //0x414
f32 vertadie; //0x418
s32 bondtype;
s32 bondtype;
s32 startnewbonddie; //0x420
/**
@@ -796,7 +796,7 @@ struct player
* Offset 0x428.
*/
s32 deathanimfinished;
s32 field_42c;
s32 field_42c;
s32 controldef; //0x430
struct collision434 previous_collision_info;
@@ -848,11 +848,11 @@ struct player
s32 field_5B0;
s32 field_5B4;
s32 field_5B8;
s8 field_5BC;
s8 animFlipFlag;
s8 field_5BD;
s8 field_5BE;
s8 field_5BF;
f32 field_5C0;
s32 field_5C4;
@@ -946,16 +946,16 @@ struct player
* Offset 0x7f6.
*/
s16 viewtop;
s32 hand_invisible[2]; /* 0x7f8*/
ITEM_IDS hand_item[2]; /* 0x800 */
ModelFileHeader *ptr_hand_weapon_buffer[2]; /* 0x808 */
/**
* Offset 0x810.
*/
ModelFileHeader copy_of_body_obj_header[2];
struct texpool item_related[2]; /* 0x850 */
/**
@@ -972,7 +972,7 @@ struct player
* Offset 0xfcc.
*/
s32 field_FCC;
// Seems to be copy of field_FCC
s32 field_FD0;
@@ -1010,7 +1010,7 @@ struct player
f32 field_1080;
f32 sniper_zoom;
f32 camera_zoom;
s32 field_108C;
s32 curRoomIndex;
/**
* Offset 0x1090.
@@ -1118,7 +1118,7 @@ struct player
* Used during level.
* 0x2: no crosshair
* 0x0: cross hair shown on screen.
*
*
* Offset 0x1128.
*/
s32 gunsightmode;
@@ -1163,378 +1163,12 @@ struct player
/**
* Offset 0x12b4.
*/
u8 something_with_cheat_text;
u8 can_display_cheat_text;
u8 bondinvincible;
u8 field_12B7;
s32 healthdamagetype;
s32 field_12BC;
s32 field_12C0;
s32 field_12C4;
s32 field_12C8;
s32 field_12CC;
s32 field_12D0;
s32 field_12D4;
s32 field_12D8;
s32 field_12DC;
s32 field_12E0;
s32 field_12E4;
s32 field_12E8;
s32 field_12EC;
s32 field_12F0;
s32 field_12F4;
s32 field_12F8;
s32 field_12FC;
s32 field_1300;
s32 field_1304;
s32 field_1308;
s32 field_130C;
s32 field_1310;
s32 field_1314;
s32 field_1318;
s32 field_131C;
s32 field_1320;
s32 field_1324;
s32 field_1328;
s32 field_132C;
s32 field_1330;
s32 field_1334;
s32 field_1338;
s32 field_133C;
s32 field_1340;
s32 field_1344;
s32 field_1348;
s32 field_134C;
s32 field_1350;
s32 field_1354;
s32 field_1358;
s32 field_135C;
s32 field_1360;
s32 field_1364;
s32 field_1368;
s32 field_136C;
s32 field_1370;
s32 field_1374;
s32 field_1378;
s32 field_137C;
s32 field_1380;
s32 field_1384;
s32 field_1388;
s32 field_138C;
s32 field_1390;
s32 field_1394;
s32 field_1398;
s32 field_139C;
s32 field_13A0;
s32 field_13A4;
s32 field_13A8;
s32 field_13AC;
s32 field_13B0;
s32 field_13B4;
s32 field_13B8;
s32 field_13BC;
s32 field_13C0;
s32 field_13C4;
s32 field_13C8;
s32 field_13CC;
s32 field_13D0;
s32 field_13D4;
s32 field_13D8;
s32 field_13DC;
s32 field_13E0;
s32 field_13E4;
s32 field_13E8;
s32 field_13EC;
s32 field_13F0;
s32 field_13F4;
s32 field_13F8;
s32 field_13FC;
s32 field_1400;
s32 field_1404;
s32 field_1408;
s32 field_140C;
s32 field_1410;
s32 field_1414;
s32 field_1418;
s32 field_141C;
s32 field_1420;
s32 field_1424;
s32 field_1428;
s32 field_142C;
s32 field_1430;
s32 field_1434;
s32 field_1438;
s32 field_143C;
s32 field_1440;
s32 field_1444;
s32 field_1448;
s32 field_144C;
s32 field_1450;
s32 field_1454;
s32 field_1458;
s32 field_145C;
s32 field_1460;
s32 field_1464;
s32 field_1468;
s32 field_146C;
s32 field_1470;
s32 field_1474;
s32 field_1478;
s32 field_147C;
s32 field_1480;
s32 field_1484;
s32 field_1488;
s32 field_148C;
s32 field_1490;
s32 field_1494;
s32 field_1498;
s32 field_149C;
s32 field_14A0;
s32 field_14A4;
s32 field_14A8;
s32 field_14AC;
s32 field_14B0;
s32 field_14B4;
s32 field_14B8;
s32 field_14BC;
s32 field_14C0;
s32 field_14C4;
s32 field_14C8;
s32 field_14CC;
s32 field_14D0;
s32 field_14D4;
s32 field_14D8;
s32 field_14DC;
s32 field_14E0;
s32 field_14E4;
s32 field_14E8;
s32 field_14EC;
s32 field_14F0;
s32 field_14F4;
s32 field_14F8;
s32 field_14FC;
s32 field_1500;
s32 field_1504;
s32 field_1508;
s32 field_150C;
s32 field_1510;
s32 field_1514;
s32 field_1518;
s32 field_151C;
s32 field_1520;
s32 field_1524;
s32 field_1528;
s32 field_152C;
s32 field_1530;
s32 field_1534;
s32 field_1538;
s32 field_153C;
s32 field_1540;
s32 field_1544;
s32 field_1548;
s32 field_154C;
s32 field_1550;
s32 field_1554;
s32 field_1558;
s32 field_155C;
s32 field_1560;
s32 field_1564;
s32 field_1568;
s32 field_156C;
s32 field_1570;
s32 field_1574;
s32 field_1578;
s32 field_157C;
s32 field_1580;
s32 field_1584;
s32 field_1588;
s32 field_158C;
s32 field_1590;
s32 field_1594;
s32 related_to_health_display;
s32 field_159C;
s32 field_15A0;
s32 field_15A4;
s32 field_15A8;
s32 field_15AC;
s32 field_15B0;
s32 field_15B4;
s32 field_15B8;
s32 field_15BC;
s32 field_15C0;
s32 field_15C4;
s32 field_15C8;
s32 field_15CC;
s32 field_15D0;
s32 field_15D4;
s32 field_15D8;
s32 field_15DC;
s32 field_15E0;
s32 field_15E4;
s32 field_15E8;
s32 field_15EC;
s32 field_15F0;
s32 field_15F4;
s32 field_15F8;
s32 field_15FC;
s32 field_1600;
s32 field_1604;
s32 field_1608;
s32 field_160C;
s32 field_1610;
s32 field_1614;
s32 field_1618;
s32 field_161C;
s32 field_1620;
s32 field_1624;
s32 field_1628;
s32 field_162C;
s32 field_1630;
s32 field_1634;
s32 field_1638;
s32 field_163C;
s32 field_1640;
s32 field_1644;
s32 field_1648;
s32 field_164C;
s32 field_1650;
s32 field_1654;
s32 field_1658;
s32 field_165C;
s32 field_1660;
s32 field_1664;
s32 field_1668;
s32 field_166C;
s32 field_1670;
s32 field_1674;
s32 field_1678;
s32 field_167C;
s32 field_1680;
s32 field_1684;
s32 field_1688;
s32 field_168C;
s32 field_1690;
s32 field_1694;
s32 field_1698;
s32 field_169C;
s32 field_16A0;
s32 field_16A4;
s32 field_16A8;
s32 field_16AC;
s32 field_16B0;
s32 field_16B4;
s32 field_16B8;
s32 field_16BC;
s32 field_16C0;
s32 field_16C4;
s32 field_16C8;
s32 field_16CC;
s32 field_16D0;
s32 field_16D4;
s32 field_16D8;
s32 field_16DC;
s32 field_16E0;
s32 field_16E4;
s32 field_16E8;
s32 field_16EC;
s32 field_16F0;
s32 field_16F4;
s32 field_16F8;
s32 field_16FC;
s32 field_1700;
s32 field_1704;
s32 field_1708;
s32 field_170C;
s32 field_1710;
s32 field_1714;
s32 field_1718;
s32 field_171C;
s32 field_1720;
s32 field_1724;
s32 field_1728;
s32 field_172C;
s32 field_1730;
s32 field_1734;
s32 field_1738;
s32 field_173C;
s32 field_1740;
s32 field_1744;
s32 field_1748;
s32 field_174C;
s32 field_1750;
s32 field_1754;
s32 field_1758;
s32 field_175C;
s32 field_1760;
s32 field_1764;
s32 field_1768;
s32 field_176C;
s32 field_1770;
s32 field_1774;
s32 field_1778;
s32 field_177C;
s32 field_1780;
s32 field_1784;
s32 field_1788;
s32 field_178C;
s32 field_1790;
s32 field_1794;
s32 field_1798;
s32 field_179C;
s32 field_17A0;
s32 field_17A4;
s32 field_17A8;
s32 field_17AC;
s32 field_17B0;
s32 field_17B4;
s32 field_17B8;
s32 field_17BC;
s32 field_17C0;
s32 field_17C4;
s32 field_17C8;
s32 field_17CC;
s32 field_17D0;
s32 field_17D4;
s32 field_17D8;
s32 field_17DC;
s32 field_17E0;
s32 field_17E4;
s32 field_17E8;
s32 field_17EC;
s32 field_17F0;
s32 field_17F4;
s32 field_17F8;
s32 field_17FC;
s32 field_1800;
s32 field_1804;
s32 field_1808;
s32 field_180C;
s32 field_1810;
s32 field_1814;
s32 field_1818;
s32 field_181C;
s32 field_1820;
s32 field_1824;
s32 field_1828;
s32 field_182C;
s32 field_1830;
s32 field_1834;
s32 field_1838;
s32 field_183C;
s32 field_1840;
s32 field_1844;
s32 field_1848;
s32 field_184C;
s32 field_1850;
s32 field_1854;
s32 field_1858;
s32 field_185C;
s32 field_1860;
s32 field_1864;
s32 field_1868;
s32 field_186C;
s32 field_1870;
s32 field_1874;
/* 0x12B4 */ u8 something_with_cheat_text;
/* 0x12B5 */ u8 can_display_cheat_text;
/* 0x12B6 */ u8 bondinvincible;
/* 0x12B7 */ u8 field_12B7;
/* 0x12B8 */ struct damage_display_parent armor_display_values[23];
/* 0x1598 */ struct damage_display_parent health_display_values[23];
/**
* Offset 0x1878
@@ -1546,12 +1180,12 @@ struct player
* Offset 0x19b8.
*/
struct WatchRectangle buffer_for_watch_static_vertices[1];
/**
* Offset 0x19f8
*/
s32 watch_body_armor_bar_gdl; // used in watch
s32 field_19FC;
s32 field_1A00;
s32 field_1A04;
@@ -2481,7 +2115,7 @@ struct player
* Offset 0x2858
*/
Gfx buffer_for_watch_greenbackdrop_DL[WATCH_NUMBER_SCREENS];
s32 field_2880;
s32 field_2884;
s32 field_2888;
@@ -2552,7 +2186,7 @@ struct player
s32 field_298C;
s32 field_2990;
s32 field_2994;
/**
* Watch static, not "static DL".
* Offset 0x2998
@@ -2598,7 +2232,7 @@ struct player
/**
* Current tile pointer -> room.
*
*
* Offset 0x2a04.
*/
s16 field_2A04;
@@ -2610,10 +2244,10 @@ struct player
s32 field_2A30;
s32 field_2A34;
s32 cur_item_weapon_getname;
f32 actual_health;
f32 actual_armor;
/* 0x2a3c */ f32 actual_health;
/* 0x2a40 */ f32 actual_armor;
ITEM_IDS field_2A44[2];
f32 field_2A4C;
f32 speedgo;
s32 lock_hand_model[2];
s32 cur_player_control_type_0;
s32 cur_player_control_type_1;
@@ -2710,17 +2344,17 @@ extern s32 g_bondviewForceDisarm;
//D:80036428
extern s32 resolution;
//D:8003642C
extern s32 camera_8003642C;
extern s32 cameraBufferToggle;
//D:80036430
extern s32 camera_80036430;
extern s32 cameraFrameCounter1;
//D:80036434
extern s32 camera_80036434;
extern s32 cameraFrameCounter2;
//D:80036438
extern s32 camera_80036438;
//D:8003643C
extern s32 D_8003643C;
extern s32 credits_state;
//D:80036440
extern CreditsEntry *D_80036440;
extern CreditsEntry *credits_pointer;
//D:80036444
extern s32 g_SurroundBondWithExplosionsFlag;
//D:80036448
@@ -2745,7 +2379,7 @@ extern f32 g_TankTurnSpeed;
//D:80036464
extern f32 g_TankOrientationAngle;
//D:80036468
extern f32 D_80036468;
extern f32 tank_turret_unused_angle;
//D:8003646C
extern f32 g_TankTurretVerticalAngle;
//D:80036470
@@ -2753,9 +2387,9 @@ extern f32 g_TankTurretVerticalAngleRelated;
//D:80036474
extern f32 g_TankTurretOrientationAngleRad;
//D:80036478
extern f32 D_80036478;
extern f32 g_TankTurretOrientationAngleDeg;
//D:8003647C
extern f32 D_8003647C;
extern f32 tank_turret_turn_speed;
//D:80036480
extern s32 g_BondCanEnterTank;
//D:80036484
@@ -2771,17 +2405,17 @@ extern enum CAMERAMODE g_CameraMode;
//D:80036498
extern enum CAMERAMODE g_CameraAfterCinema;
//D:8003649C
extern s32 D_8003649C;
extern s32 camera_fade_active;
//D:800364A0
extern s32 stop_time_flag;
//D:800364A4
extern f32 D_800364A4;
extern f32 camera_transition_timer;
//D:800364A8
extern s32 D_800364A8;
extern s32 intro_camera_index;
//D:800364AC
extern struct SetupIntroSwirl *g_IntroSwirl;
//D:800364B0
extern s32 D_800364B0;
extern s32 is_timer_active;
//D:800364B4
extern s32 g_PlayerInvincible;
//D:800364B8
@@ -2806,7 +2440,7 @@ extern s32 g_bondviewBondDeathAnimations[];
//D:8003650C
extern s32 g_bondviewBondDeathAnimationsCount;
//D:80036510
extern enum CAMERAMODE D_80036510;
extern enum CAMERAMODE camera_mode;
//D:80036514
extern s32 g_IntroAnimationIndex;
/*
@@ -2921,7 +2555,7 @@ extern s32 D_80036834;
//D:80036838
extern s32 D_80036838;
//D:8003683C
extern struct unk_joint_list D_8003683C;
extern ModelRenderData D_8003683C;
//D:8003687C
extern s32 D_8003687C;
@@ -2999,8 +2633,8 @@ extern s32 watch_time_0;
#endif
extern f32 watch_transition_time;
extern s32 starting_right_weapon;
extern s32 starting_left_weapon;
// ITEM_IDS
extern ITEM_IDS starting_weapon[2];
extern PadRecord *g_Startpad[];
extern s32 startpadcount;
extern StandTilePoint *dword_CODE_bss_80079DA0;
@@ -3010,7 +2644,7 @@ extern StandTilePoint *dword_CODE_bss_80079DA4;
extern s32 dword_CODE_bss_80079DA8[];
u32 get_camera_mode(void);
u32 bondviewGetCameraMode(void);
void bondviewTriggerWatchZoom(f32 zoominfovy);
@@ -3059,7 +2693,7 @@ s32 bond_pressed_reload_activate(void);
Gfx* write_stan_tiles_in_yellow(Gfx *arg0);
Gfx * maybe_mp_interface(Gfx *arg0);
Gfx * bondviewRemoved7F08BCB8(Gfx *arg0);
s32 sub_GAME_7F078A58(coord3d *vec_scale, f32 norm_scale);
s32 camIsPosInScreen(coord3d *vec_scale, f32 norm_scale);
s32 getMissiontimer(void);
void solo_char_load(void);
void bondviewUpdateYAutoAimTime(struct PropRecord *autoaim_target, f32 auto_aim_y);
@@ -3099,7 +2733,7 @@ void bondviewSetVisibleToGuardsFlag(s32 param_1);
Mtxf *currentPlayerGetMatrix10EC(void);
f32 get_curplay_horizontal_rotation_in_degrees(void);
Mtxf *camGetWorldToScreenMtxf(void);
void sub_GAME_7F077EEC(struct coord2d *in, coord3d *out, f32 value);
void transformAndNormalizeByLength2Dto3D(struct coord2d *in, coord3d *out, f32 value);
s32 camIsPosInScreenBox(coord3d *, f32, struct bbox2d *);
void bondviewTransformManyPosToViewMatrix(RenderPosView *arg0, s32 arg1);
@@ -3112,7 +2746,7 @@ f32 bondviewGetBondBreathing(void);
void bondviewClearUpperTextDisplayFlag(int param_1);
void bondviewSetUpperTextDisplayFlag(PLAYERFLAG flag);
void set_camera_mode(s32 arg0);
void bondviewSetCameraMode(s32 arg0);
bool isBondInTank(void);
void hudmsgTopShow(char* string);
void SurroundWithExplosions(int delay);
@@ -3127,6 +2761,7 @@ void bondviewResetUpperTextDisplay(void);
Mtxf *currentPlayerGetProjectionMatrixF(void);
int redirect_get_BONDdata_autoaim_x(void);
int redirect_get_BONDdata_autoaim_y(void);
void sub_GAME_7F077FF4(coord3d *in, coord3d *out);
void transform3Dto2DCoords(coord3d *in, coord2d *out);
void maybe_solo_intro_camera_handler(void);
#endif
+32 -29
View File
@@ -20,7 +20,7 @@
/**
* Address 0x8002A780.
*/
struct coord3d D_8002A780 = { 0 };
struct coord3d default_start_position = { 0 };
u32 weaponLoadProjectileModels(ITEM_IDS modelid)
{
@@ -107,28 +107,28 @@ void bondviewLoadSetupIntroSection(void)
// done with declarations
start_pos = D_8002A780;
start_pos = default_start_position;
intro_record = (struct SetupIntroEmpty *)g_CurrentSetup.intro;
g_isBondKIA = 0;
g_bondviewForceDisarm = 0;
resolution = 0;
camera_8003642C = 0;
camera_80036430 = 0;
cameraBufferToggle = 0;
cameraFrameCounter1 = 0;
set_starting_weapon = 0;
camera_80036434 = 0;
cameraFrameCounter2 = 0;
start_look_angle = FLOAT_INIT;
if (bossGetStageNum() == LEVELID_CUBA)
{
resolution = (s32)mempAllocBytesInBank(0x46EA0, 4);
resolution = (s32)mempAllocBytesInBank(0x46EA0, MEMPOOL_STAGE);
resolution = (resolution + 0x3f) & ~0x3F;
camera_80036430 = 1;
cameraFrameCounter1 = 1;
}
camera_80036438 = 0;
D_8003643C = 0;
D_80036440 = NULL;
credits_state = 0;
credits_pointer = NULL;
g_ForceBondMoveOffset.f[0] = FLOAT_INIT;
g_ForceBondMoveOffset.f[1] = FLOAT_INIT;
g_ForceBondMoveOffset.f[2] = FLOAT_INIT;
@@ -142,24 +142,24 @@ void bondviewLoadSetupIntroSection(void)
g_TankSfxState[1] = NULL;
g_TankTurnSpeed = FLOAT_INIT;
g_TankOrientationAngle = FLOAT_INIT;
D_80036468 = FLOAT_INIT;
tank_turret_unused_angle = FLOAT_INIT;
g_TankTurretVerticalAngle = FLOAT_INIT;
g_TankTurretVerticalAngleRelated = FLOAT_INIT;
g_TankTurretOrientationAngleRad = FLOAT_INIT;
D_80036478 = FLOAT_INIT;
D_8003647C = FLOAT_INIT;
g_TankTurretOrientationAngleDeg = FLOAT_INIT;
tank_turret_turn_speed = FLOAT_INIT;
g_BondCanEnterTank = 0;
g_TankTurretAngle = FLOAT_INIT;
g_TankTurretTurn = FLOAT_INIT;
g_ExplodeTankOnDeathFlag = 0;
D_800364B0 = 1;
is_timer_active = 1;
g_PlayerInvincible = 0;
g_CameraMode = 0;
g_CameraAfterCinema = 0;
D_8003649C = 0;
camera_fade_active = 0;
stop_time_flag = 0;
D_800364A4 = FLOAT_INIT;
D_800364A8 = 1;
camera_transition_timer = FLOAT_INIT;
intro_camera_index = CAMERAMODE_INTRO;
g_IntroSwirl = NULL;
ptr_random06cam_entry = NULL;
g_CurrentSetupIntroCamera = NULL;
@@ -168,8 +168,8 @@ void bondviewLoadSetupIntroSection(void)
watch_time_0 = 0;
g_IntroAnimationIndex = 0;
watch_transition_time = 0.9090909f;
starting_left_weapon = ITEM_UNARMED;
starting_right_weapon = ITEM_UNARMED;
starting_weapon[GUNLEFT] = ITEM_UNARMED;
starting_weapon[GUNRIGHT] = ITEM_UNARMED;
if (intro_record != NULL)
{
@@ -210,7 +210,7 @@ void bondviewLoadSetupIntroSection(void)
if (set_starting_weapon == 0)
{
starting_right_weapon = intro_item->item_right;
starting_weapon[GUNRIGHT] = intro_item->item_right;
if(intro_item->item_left);
@@ -218,7 +218,7 @@ void bondviewLoadSetupIntroSection(void)
if (intro_item->item_left >= 0)
{
starting_left_weapon = intro_item->item_left;
starting_weapon[GUNLEFT] = intro_item->item_left;
}
}
}
@@ -327,7 +327,7 @@ void bondviewLoadSetupIntroSection(void)
// hack: bad address math
credits = (CreditsEntry*)((s32)g_ptrStageSetupFile + (s32)intro_credits->unk04);
D_80036440 = credits;
credits_pointer = credits;
// what is the point of this?
while (credits->TextId1 != 0 || credits->TextId2 != 0)
@@ -341,6 +341,9 @@ void bondviewLoadSetupIntroSection(void)
default:
{
#ifdef DEBUG
ossyncprintf("unknown bondstart type %d!\n",intro_record->type);
#endif
intro_record = (struct SetupIntroEmpty*)((s32)intro_record + sizeof(struct SetupIntroEmpty));
}
break;
@@ -364,7 +367,7 @@ void bondviewLoadSetupIntroSection(void)
if (set_starting_weapon == 0)
{
starting_right_weapon = ITEM_FIST;
starting_weapon[GUNRIGHT] = ITEM_FIST;
}
g_CurrentPlayer->field_78 = FLOAT_INIT;
@@ -427,7 +430,7 @@ void bondviewLoadSetupIntroSection(void)
bondviewResetIntroCameraMessageDialogs();
bondviewResetUpperTextDisplay();
g_CurrentPlayer->prop = propAllocate();
g_CurrentPlayer->prop = chrpropAllocate();
g_CurrentPlayer->prop->obj = NULL;
g_CurrentPlayer->prop->type = PROP_TYPE_VIEWER;
@@ -450,11 +453,11 @@ void bondviewLoadSetupIntroSection(void)
if (getPlayerCount() == 1)
{
set_camera_mode(CAMERAMODE_INTRO);
bondviewSetCameraMode(CAMERAMODE_INTRO);
}
else
{
set_camera_mode(CAMERAMODE_MP);
bondviewSetCameraMode(CAMERAMODE_MP);
}
g_bondviewBondDeathAnimationsCount = 0;
@@ -463,8 +466,8 @@ void bondviewLoadSetupIntroSection(void)
g_bondviewBondDeathAnimationsCount++;
}
g_CurrentPlayer->startnewbonddie = 1;
g_CurrentPlayer->redbloodfinished = 0;
g_CurrentPlayer->deathanimfinished = 0;
D_80036510 = CAMERAMODE_NONE;
g_CurrentPlayer->startnewbonddie = TRUE;
g_CurrentPlayer->redbloodfinished = FALSE;
g_CurrentPlayer->deathanimfinished = FALSE;
camera_mode = CAMERAMODE_NONE;
}
+2
View File
@@ -2,7 +2,9 @@
#define _BONDVIEW_R_H_
#include <ultra64.h>
#include <bondconstants.h>
void bondviewLoadSetupIntroSection(void);
u32 weaponLoadProjectileModels(ITEM_IDS modelid);
#endif
+69 -27
View File
@@ -1,9 +1,21 @@
#include <ultra64.h>
void sub_GAME_7F06ABB0(Gfx **gdlptr, f32 *arg1, f32 *arg2, s32 width, s32 height, s32 arg5, s32 arg6, s32 arg7)
/**
* Draws a textured rectangle on the screen.
*
* @param gdlptr Pointer to the display list.
* @param position Position coordinates (center) of the rectangle.
* @param size Size (half-width and half-height) of the rectangle.
* @param width Texture width.
* @param height Texture height.
* @param flipXY Flip X and Y flag.
* @param flipX Flip X-axis flag.
* @param flipY Flip Y-axis flag.
*/
void draw_textured_rectangle(Gfx **gdlptr, f32 *position, f32 *size, s32 width, s32 height, s32 flipXY, s32 flipX, s32 flipY)
{
if (arg2[0] > 0.0f && arg2[1] > 0.0f)
// Only proceed if the size values are positive
if (size[0] > 0.0f && size[1] > 0.0f)
{
Gfx *gdl = *gdlptr;
s32 xl;
@@ -15,18 +27,22 @@ void sub_GAME_7F06ABB0(Gfx **gdlptr, f32 *arg1, f32 *arg2, s32 width, s32 height
s32 dsdx;
s32 dtdy;
// Disable texture perspective correction
gDPSetTexturePersp(gdl++, G_TP_NONE);
xl = (arg1[0] - arg2[0]) * 4.0f;
yl = (arg1[1] - arg2[1]) * 4.0f;
xh = (arg1[0] + arg2[0]) * 4.0f;
yh = (arg1[1] + arg2[1]) * 4.0f;
// Compute rectangle coordinates
xl = (position[0] - size[0]) * 4.0f;
yl = (position[1] - size[1]) * 4.0f;
xh = (position[0] + size[0]) * 4.0f;
yh = (position[1] + size[1]) * 4.0f;
// Proceed if the rectangle is within screen bounds
if (xh >= 0 && yh >= 0)
{
// Handle X coordinate adjustment
if (xl < 0)
{
if (arg5)
if (flipXY)
{
t += ((-xl * height) << 5) / (xh - xl);
}
@@ -38,9 +54,10 @@ void sub_GAME_7F06ABB0(Gfx **gdlptr, f32 *arg1, f32 *arg2, s32 width, s32 height
xl = 0;
}
// Handle Y coordinate adjustment
if (yl < 0)
{
if (arg5)
if (flipXY)
{
s += ((-yl * width) << 5) / (yh - yl);
}
@@ -52,30 +69,34 @@ void sub_GAME_7F06ABB0(Gfx **gdlptr, f32 *arg1, f32 *arg2, s32 width, s32 height
yl = 0;
}
if (arg5)
// Calculate texture scaling based on flipXY flag
if (flipXY)
{
dsdx = width / (2.0f * arg2[1]) * 1024.0f;
dtdy = height / (2.0f * arg2[0]) * 1024.0f;
dsdx = width / (2.0f * size[1]) * 1024.0f;
dtdy = height / (2.0f * size[0]) * 1024.0f;
}
else
{
dsdx = width / (2.0f * arg2[0]) * 1024.0f;
dtdy = height / (2.0f * arg2[1]) * 1024.0f;
dsdx = width / (2.0f * size[0]) * 1024.0f;
dtdy = height / (2.0f * size[1]) * 1024.0f;
}
if (arg6)
// Flip texture horizontally if needed
if (flipX)
{
dsdx = 0x10000 - dsdx;
s = ((width - 1) << 5) - s;
}
if (arg7)
// Flip texture vertically if needed
if (flipY)
{
dtdy = 0x10000 - dtdy;
t = ((height - 1) << 5) - t;
}
if (arg5)
// Draw the textured rectangle with optional flipping
if (flipXY)
{
gSPTextureRectangleFlip(gdl++, xl, yl, xh, yh, G_TX_RENDERTILE, s, t, dsdx, dtdy);
}
@@ -85,36 +106,57 @@ void sub_GAME_7F06ABB0(Gfx **gdlptr, f32 *arg1, f32 *arg2, s32 width, s32 height
}
}
// Re-enable texture perspective correction
gDPSetTexturePersp(gdl++, G_TP_PERSP);
*gdlptr = gdl;
}
}
#define G_CC_MODULATEIA_ENV COMBINED, 0, ENVIRONMENT, 0, COMBINED, 0, ENVIRONMENT, 0
void display_image_at_on_screen_coord(Gfx **gdlptr, f32 *arg1, f32 *arg2, s32 twidth, u32 theight, u32 arg5, u32 arg6, u32 arg7, u32 r, u32 g, u32 b, u32 alpha, u32 arg12, u32 arg13)
/**
* Displays an image at a specific on-screen position with color tinting and optional texture flips.
*
* @param gdl Pointer to the display list.
* @param position Position of the image.
* @param size Size (half-width and half-height) of the image.
* @param twidth Texture width.
* @param theight Texture height.
* @param flipXY Flip X and Y flag.
* @param flipX Flip X-axis flag.
* @param flipY Flip Y-axis flag.
* @param r Red tint value.
* @param g Green tint value.
* @param b Blue tint value.
* @param alpha Alpha (transparency) value.
* @param mipmapped_texture Mipmapped rendering mode flag.
* @param highlight_mode Highlight rendering mode flag.
*/
void display_image_at_position(Gfx **gdlptr, f32 *position, f32 *size, s32 twidth, u32 theight, u32 flipXY, u32 flipX, u32 flipY, u32 r, u32 g, u32 b, u32 alpha, u32 mipmapped_texture, u32 highlight_mode)
{
if (arg2[0] > 0.0f && arg2[1] > 0.0f)
if (size[0] > 0.0f && size[1] > 0.0f)
{
Gfx *gdl = *gdlptr;
gDPSetEnvColor(gdl++, r, g, b, alpha);
if (arg12)
if (mipmapped_texture)
{
gDPSetCombineLERP(gdl++, TEXEL1, TEXEL0, LOD_FRACTION, TEXEL0, TEXEL1, TEXEL0, LOD_FRACTION, TEXEL0, COMBINED, 0, ENVIRONMENT, 0, COMBINED, 0, ENVIRONMENT, 0);
gDPSetCombineMode(gdl++, G_CC_TRILERP, G_CC_MODULATEIA_ENV);
}
else if (arg13)
{
gDPSetCombineLERP(gdl++, TEXEL0, 0, ENVIRONMENT, 0, TEXEL0, 0, ENVIRONMENT, 0, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED);
else if (highlight_mode)
{
gDPSetCombineMode(gdl++, G_CC_FADEA, G_CC_PASS2);
}
else
{
gDPSetCombineLERP(gdl++, TEXEL0, 0, ENVIRONMENT, 0, TEXEL0, 0, ENVIRONMENT, 0, TEXEL0, 0, ENVIRONMENT, 0, TEXEL0, 0, ENVIRONMENT, 0);
gDPSetCombineMode(gdl++, G_CC_FADEA, G_CC_FADEA);
}
*gdlptr = gdl;
sub_GAME_7F06ABB0(gdlptr, arg1, arg2, twidth, theight, arg5, arg6, arg7);
draw_textured_rectangle(gdlptr, position, size, twidth, theight, flipXY, flipX, flipY);
}
}
+1 -1
View File
@@ -3,6 +3,6 @@
#include <ultra64.h>
#include "bondview.h"
void display_image_at_on_screen_coord(Gfx **DL, f32 *xypos, f32 *halfedxy, s32 width, s32 height, s32 rotateleft90, s32 fliph, s32 flipv, s32 red, s32 green, s32 blue, s32 alpha, s32 format, s32 param_14);
void display_image_at_position(Gfx **DL, f32 *xypos, f32 *halfedxy, s32 width, s32 height, s32 rotateleft90, s32 fliph, s32 flipv, s32 red, s32 green, s32 blue, s32 alpha, s32 format, s32 param_14);
#endif
+117 -117
View File
@@ -22,10 +22,6 @@
//#include "chraicommands.h" /* needed for ai list commands, remove when moving global ai lists to chraicommands/chrai */
// bss
// This shows up a lot but not quite sure what it represents.
#define CHEAT_20 20
u8 g_CheatPlayerTextRelated[CHEAT_INVALID + 1];
@@ -33,7 +29,7 @@ u8 g_CheatPlayerTextRelated[CHEAT_INVALID + 1];
//D:8003F430
u16 mBtnCheatExtraMPChars[] = {
L_TRIG | R_TRIG | L_CBUTTONS ,
L_TRIG | R_TRIG | L_CBUTTONS ,
L_TRIG | U_CBUTTONS ,
L_TRIG | R_TRIG | L_JPAD,
L_TRIG | R_JPAD,
@@ -56,7 +52,7 @@ u16 mBtnCheatInvincibility[] = {
L_TRIG | R_JPAD,
R_TRIG | D_JPAD,
L_TRIG | L_JPAD,
L_TRIG | R_TRIG | R_CBUTTONS
L_TRIG | R_TRIG | R_CBUTTONS
};
//D:8003F458
@@ -70,7 +66,7 @@ u16 mBtnCheatAllGuns[] = {
R_TRIG | L_CBUTTONS ,
L_TRIG | R_TRIG | R_CBUTTONS ,
R_TRIG | U_JPAD,
L_TRIG | L_CBUTTONS
L_TRIG | L_CBUTTONS
};
//D:8003F46C
@@ -112,7 +108,7 @@ u16 mBtnCheatDeactivateInvincibilityMulti[] = {
L_TRIG | L_CBUTTONS ,
L_TRIG | R_TRIG | R_CBUTTONS ,
L_TRIG | D_JPAD,
L_TRIG | U_CBUTTONS
L_TRIG | U_CBUTTONS
};
//D:8003F4A8
u16 mBtnCheatLineMode[] = {
@@ -125,7 +121,7 @@ u16 mBtnCheatLineMode[] = {
L_TRIG | D_JPAD,
L_TRIG | R_JPAD,
R_TRIG | L_CBUTTONS ,
R_TRIG | U_CBUTTONS
R_TRIG | U_CBUTTONS
};
//D:8003F4BC
@@ -142,7 +138,7 @@ u16 mBtnCheatInvisibility[] = {
R_TRIG | R_JPAD
};
//D:8003F4D0
u16 mBtnCheatInvisibilityMulti[] = {
u16 mBtnCheatBondPhase[] = {
L_TRIG | U_CBUTTONS ,
L_TRIG | R_TRIG | L_CBUTTONS ,
R_TRIG | U_JPAD,
@@ -152,7 +148,7 @@ u16 mBtnCheatInvisibilityMulti[] = {
L_TRIG | R_TRIG | L_CBUTTONS ,
L_TRIG | R_CBUTTONS ,
L_TRIG | U_JPAD,
L_TRIG | R_TRIG | D_CBUTTONS
L_TRIG | R_TRIG | D_CBUTTONS
};
//D:8003F4E4
u16 mBtnCheatDam[] = {
@@ -165,7 +161,7 @@ u16 mBtnCheatDam[] = {
R_TRIG | R_CBUTTONS ,
L_TRIG | R_JPAD,
L_TRIG | R_TRIG | R_JPAD,
R_TRIG | D_CBUTTONS
R_TRIG | D_CBUTTONS
};
//D:8003F4F8
u16 mBtnCheatFacility[] = {
@@ -191,7 +187,7 @@ u16 mBtnCheatRunway[] = {
R_TRIG | R_CBUTTONS ,
R_TRIG | R_JPAD,
L_TRIG | D_JPAD,
R_TRIG | L_CBUTTONS
R_TRIG | L_CBUTTONS
};
//D:8003F520
u16 mBtnCheatSurface[] = {
@@ -230,7 +226,7 @@ u16 mBtnCheatSilo[] = {
L_TRIG | U_CBUTTONS ,
R_TRIG | R_JPAD,
R_TRIG | R_JPAD,
R_TRIG | R_CBUTTONS
R_TRIG | R_CBUTTONS
};
//D:8003F55C
u16 mBtnCheatFrigate[] = {
@@ -256,7 +252,7 @@ u16 mBtnCheatSurface2[] = {
L_TRIG | R_TRIG | U_CBUTTONS ,
L_TRIG | U_CBUTTONS ,
L_TRIG | R_TRIG | D_JPAD,
L_TRIG | R_CBUTTONS
L_TRIG | R_CBUTTONS
};
//D:8003F584
u16 mBtnCheatBunker2[] = {
@@ -269,7 +265,7 @@ u16 mBtnCheatBunker2[] = {
R_TRIG | R_JPAD,
L_TRIG | U_CBUTTONS ,
L_TRIG | L_JPAD,
L_TRIG | D_CBUTTONS
L_TRIG | D_CBUTTONS
};
//D:8003F598
u16 mBtnCheatStatue[] = {
@@ -295,7 +291,7 @@ u16 mBtnCheatArchives[] = {
L_TRIG | R_TRIG | R_JPAD,
L_TRIG | R_TRIG | D_CBUTTONS ,
L_TRIG | U_JPAD,
R_TRIG | D_CBUTTONS
R_TRIG | D_CBUTTONS
};
//D:8003F5C0
u16 mBtnCheatStreets[] = {
@@ -334,7 +330,7 @@ u16 mBtnCheatTrain[] = {
L_TRIG | L_JPAD,
L_TRIG | R_TRIG | L_CBUTTONS ,
L_TRIG | U_JPAD,
L_TRIG | U_CBUTTONS
L_TRIG | U_CBUTTONS
};
//D:8003F5FC
u16 mBtnCheatJungle[] = {
@@ -360,7 +356,7 @@ u16 mBtnCheatControl[] = {
R_TRIG | L_JPAD,
R_TRIG | U_CBUTTONS ,
R_TRIG | L_JPAD,
L_TRIG | R_TRIG | U_CBUTTONS
L_TRIG | R_TRIG | U_CBUTTONS
};
//D:8003F624
u16 mBtnCheatCaverns[] = {
@@ -373,7 +369,7 @@ u16 mBtnCheatCaverns[] = {
R_TRIG | U_JPAD,
L_TRIG | L_CBUTTONS ,
L_TRIG | U_JPAD,
R_TRIG | L_CBUTTONS
R_TRIG | L_CBUTTONS
};
//D:8003F638
u16 mBtnCheatCradle[] = {
@@ -399,7 +395,7 @@ u16 mBtnCheatAztek[] = {
L_TRIG | L_JPAD,
L_TRIG | R_TRIG | U_CBUTTONS ,
L_TRIG | R_TRIG | R_JPAD,
L_TRIG | L_CBUTTONS
L_TRIG | L_CBUTTONS
};
//D:8003F660
u16 mBtnCheatEgypt[] = {
@@ -429,7 +425,7 @@ u16 mBtnCheatPaintballMod[] = {
L_TRIG | D_CBUTTONS ,
L_TRIG | R_TRIG | D_CBUTTONS ,
L_TRIG | R_TRIG | U_JPAD,
L_TRIG | D_CBUTTONS
L_TRIG | D_CBUTTONS
};
//D:8003F690
u16 mBtnCheatInvincible2[] = {
@@ -442,7 +438,7 @@ u16 mBtnCheatInvincible2[] = {
L_TRIG | L_CBUTTONS ,
L_TRIG | R_TRIG | L_JPAD,
L_TRIG | R_TRIG | R_JPAD,
L_TRIG | L_CBUTTONS
L_TRIG | L_CBUTTONS
};
//D:8003F6A4
u16 mBtnCheatDKMode[] = {
@@ -455,7 +451,7 @@ u16 mBtnCheatDKMode[] = {
U_JPAD,
L_TRIG | R_TRIG | D_CBUTTONS ,
L_TRIG | R_TRIG | D_JPAD,
L_TRIG | R_TRIG | L_CBUTTONS
L_TRIG | R_TRIG | L_CBUTTONS
};
//D:8003F6B8
u16 mBtnCheat2xGL[] = {
@@ -468,7 +464,7 @@ u16 mBtnCheat2xGL[] = {
L_JPAD,
D_JPAD,
U_JPAD,
R_TRIG | D_CBUTTONS
R_TRIG | D_CBUTTONS
};
//D:8003F6CC
u16 mBtnCheat2xRL[] = {
@@ -481,7 +477,7 @@ u16 mBtnCheat2xRL[] = {
L_TRIG | L_CBUTTONS ,
R_TRIG | U_JPAD,
R_TRIG | D_JPAD,
R_TRIG | L_CBUTTONS
R_TRIG | L_CBUTTONS
};
//D:8003F6E0
u16 mBtnCheatTurboMode[] = {
@@ -533,7 +529,7 @@ u16 mBtnCheat2xTKnives[] = {
L_TRIG | R_TRIG | L_CBUTTONS ,
R_TRIG | D_JPAD,
R_TRIG | L_JPAD,
R_TRIG | L_CBUTTONS
R_TRIG | L_CBUTTONS
};
//D:8003F730
u16 mBtnCheatFastAnimation[] = {
@@ -611,7 +607,7 @@ u16 mBtnCheat2xHKnives[] = {
L_TRIG | D_JPAD,
R_TRIG | L_JPAD,
L_TRIG | R_JPAD,
L_TRIG | L_CBUTTONS
L_TRIG | L_CBUTTONS
};
//D:8003F7A8
u16 mBtnCheatInfinitAmmo[] = {
@@ -650,7 +646,7 @@ u16 mBtnCheatGoldPPK[] = {
L_TRIG | R_TRIG | R_JPAD,
L_TRIG | L_JPAD,
D_JPAD,
L_TRIG | D_CBUTTONS
L_TRIG | D_CBUTTONS
};
//D:8003F7E4
u16 mBtnCheat2xLaser[] = {
@@ -684,40 +680,40 @@ u16 mBtnCheatUnlockAllGuns[] = {
* Address 0x8003F80C.
*/
CheatInfo g_CheatInfo[] = {
{ CHEAT_EXTRA_MP_CHARS, 0xA, 0, 0, mBtnCheatExtraMPChars, 0, 0, /* 0x31 */ CHEAT_MASK_GLOBAL | CHEAT_MASK_16 | CHEAT_MASK_MENUS},
{ CHEAT_INVINCIBILITY, 0xA, 0, 0, mBtnCheatInvincibility, TEXT(LMISC, MISC_STR_00), 0, /* 0x06 */ CHEAT_MASK_MPGAME | CHEAT_MASK_SPGAME},
{ CHEAT_ALLGUNS, 0xA, 0, 0, mBtnCheatAllGuns, TEXT(LMISC, MISC_STR_01), 0, /* 0x02 */ CHEAT_MASK_SPGAME},
{ CHEAT_MAXAMMO, 0xA, 0, 0, mBtnCheatMaxAmmo, 0, 0, /* 0x16 */ CHEAT_MASK_16 | CHEAT_MASK_MPGAME | CHEAT_MASK_SPGAME},
{ CHEAT_DEBUG_RETURN_SAVED_RA, 0xA, 0, 0, mBtnCheatInvalid, 0, 0, /* 0x16 */ CHEAT_MASK_16 | CHEAT_MASK_MPGAME | CHEAT_MASK_SPGAME},
{CHEAT_DEACTIVATE_INVINCIBILITY, 0xA, 0, 0, mBtnCheatDeactivateInvincibilityMulti, 0, 0, /* 0x34 */ CHEAT_MASK_GLOBAL | CHEAT_MASK_16 | CHEAT_MASK_MPGAME},
{ CHEAT_LINEMODE, 0xA, 0, 0, mBtnCheatLineMode, TEXT(LMISC, MISC_STR_37), 0, /* 0x66 */ CHEAT_MASK_TOGGLE | CHEAT_MASK_GLOBAL | CHEAT_MASK_MPGAME | CHEAT_MASK_SPGAME},
{ CHEAT_2X_HEALTH, 0, 0, 0, 0, 0, 0, /* 0x16 */ CHEAT_MASK_16 | CHEAT_MASK_MPGAME | CHEAT_MASK_SPGAME},
{ CHEAT_2X_ARMOR, 0, 0, 0, 0, 0, 0, /* 0x16 */ CHEAT_MASK_16 | CHEAT_MASK_MPGAME | CHEAT_MASK_SPGAME},
{ CHEAT_INVISIBILITY, 0xA, 0, 0, mBtnCheatInvisibility, TEXT(LMISC, MISC_STR_04), 0, /* 0x62 */ CHEAT_MASK_TOGGLE | CHEAT_MASK_GLOBAL | CHEAT_MASK_SPGAME},
{ CHEAT_INFINITE_AMMO, 0, 0, 0, 0, TEXT(LMISC, MISC_STR_06), 0, /* 0x66 */ CHEAT_MASK_TOGGLE | CHEAT_MASK_GLOBAL | CHEAT_MASK_MPGAME | CHEAT_MASK_SPGAME},
{ CHEAT_DK_MODE, 0, 0, 0, 0, TEXT(LMISC, MISC_STR_07), 0, /* 0x26 */ CHEAT_MASK_GLOBAL | CHEAT_MASK_MPGAME | CHEAT_MASK_SPGAME},
{ CHEAT_EXTRA_WEAPONS, 0, 0, 0, 0, 0, 0, /* 0x12 */ CHEAT_MASK_16 | CHEAT_MASK_SPGAME},
{ CHEAT_TINY_BOND, 0, 0, 0, 0, TEXT(LMISC, MISC_STR_08), 0, /* 0x02 */ CHEAT_MASK_SPGAME},
{ CHEAT_PAINTBALL, 0, 0, 0, 0, TEXT(LMISC, MISC_STR_38), 0, /* 0x66 */ CHEAT_MASK_TOGGLE | CHEAT_MASK_GLOBAL | CHEAT_MASK_MPGAME | CHEAT_MASK_SPGAME},
{ CHEAT_10X_HEALTH, 0, 0, 0, 0, 0, 0, /* 0x16 */ CHEAT_MASK_16 | CHEAT_MASK_MPGAME | CHEAT_MASK_SPGAME},
{ CHEAT_MAGNUM, 0, 0, 0, 0, TEXT(LMISC, MISC_STR_0A), 0, /* 0x12 */ CHEAT_MASK_16 | CHEAT_MASK_SPGAME},
{ CHEAT_LASER, 0, 0, 0, 0, TEXT(LMISC, MISC_STR_0B), 0, /* 0x12 */ CHEAT_MASK_16 | CHEAT_MASK_SPGAME},
{ CHEAT_GOLDEN_GUN, 0, 0, 0, 0, TEXT(LMISC, MISC_STR_0C), 0, /* 0x12 */ CHEAT_MASK_16 | CHEAT_MASK_SPGAME},
{ CHEAT_SILVER_PP7, 0, 0, 0, 0, TEXT(LMISC, MISC_STR_0D), 0, /* 0x12 */ CHEAT_MASK_16 | CHEAT_MASK_SPGAME},
{ CHEAT_GOLD_PP7, 0, 0, 0, 0, TEXT(LMISC, MISC_STR_0E), 0, /* 0x12 */ CHEAT_MASK_16 | CHEAT_MASK_SPGAME},
{ CHEAT_INVISIBILITY_MP, 0xA, 0, 0, mBtnCheatInvisibilityMulti, 0, 0, /* 0x12 */ CHEAT_MASK_MPGAME},
{ CHEAT_NO_RADAR_MP, 0, 0, 0, 0, TEXT(LMISC, MISC_STR_43), 0, /* 0x64 */ CHEAT_MASK_TOGGLE | CHEAT_MASK_GLOBAL | CHEAT_MASK_MPGAME},
{ CHEAT_TURBO_MODE, 0, 0, 0, 0, TEXT(LMISC, MISC_STR_40), 0, /* 0x66 */ CHEAT_MASK_TOGGLE | CHEAT_MASK_GLOBAL | CHEAT_MASK_MPGAME | CHEAT_MASK_SPGAME},
{ CHEAT_DEBUG_POS, 0, 0, 0, 0, 0, 0, /* 0x20 */ CHEAT_MASK_GLOBAL},
{ CHEAT_FAST_ANIMATION, 0, 0, 0, 0, TEXT(LMISC, MISC_STR_41), 0, /* 0x72 */ CHEAT_MASK_TOGGLE | CHEAT_MASK_GLOBAL | CHEAT_MASK_16 | CHEAT_MASK_SPGAME},
{ CHEAT_SLOW_ANIMATION, 0, 0, 0, 0, TEXT(LMISC, MISC_STR_42), 0, /* 0x72 */ CHEAT_MASK_TOGGLE | CHEAT_MASK_GLOBAL | CHEAT_MASK_16 | CHEAT_MASK_SPGAME},
{ CHEAT_ENEMY_ROCKETS, 0, 0, 0, 0, TEXT(LMISC, MISC_STR_39), 0, /* 0x01 */ CHEAT_MASK_MENUS},
{ CHEAT_2X_ROCKET_LAUNCHER, 0, 0, 0, 0, TEXT(LMISC, MISC_STR_3A), 0, /* 0x12 */ CHEAT_MASK_16 | CHEAT_MASK_SPGAME},
{ CHEAT_2X_GRENADE_LAUNCHER, 0, 0, 0, 0, TEXT(LMISC, MISC_STR_3B), 0, /* 0x12 */ CHEAT_MASK_16 | CHEAT_MASK_SPGAME},
{ CHEAT_2X_RCP90, 0, 0, 0, 0, TEXT(LMISC, MISC_STR_3C), 0, /* 0x12 */ CHEAT_MASK_16 | CHEAT_MASK_SPGAME},
{ CHEAT_2X_THROWING_KNIFE, 0, 0, 0, 0, TEXT(LMISC, MISC_STR_3D), 0, /* 0x12 */ CHEAT_MASK_16 | CHEAT_MASK_SPGAME},
{ CHEAT_2X_HUNTING_KNIFE, 0, 0, 0, 0, TEXT(LMISC, MISC_STR_3E), 0, /* 0x12 */ CHEAT_MASK_16 | CHEAT_MASK_SPGAME},
{ CHEAT_2X_LASER, 0, 0, 0, 0, TEXT(LMISC, MISC_STR_3F), 0, /* 0x12 */ CHEAT_MASK_16 | CHEAT_MASK_SPGAME},
{ CHEAT_EXTRA_MP_CHARS, 0xA, 0, 0, mBtnCheatExtraMPChars, 0, 0, /* 0x31 */ CHEAT_MASK_GLOBAL | CHEAT_MASK_16 | CHEAT_MASK_MENUS},
{ CHEAT_INVINCIBILITY, 0xA, 0, 0, mBtnCheatInvincibility, getStringID(LMISC, MISC_STR_00_INVINCIBLE ), 0, /* 0x06 */ CHEAT_MASK_MPGAME | CHEAT_MASK_SPGAME},
{ CHEAT_ALLGUNS, 0xA, 0, 0, mBtnCheatAllGuns, getStringID(LMISC, MISC_STR_01_ALLGUNS ), 0, /* 0x02 */ CHEAT_MASK_SPGAME},
{ CHEAT_MAXAMMO, 0xA, 0, 0, mBtnCheatMaxAmmo, 0, 0, /* 0x16 */ CHEAT_MASK_16 | CHEAT_MASK_MPGAME | CHEAT_MASK_SPGAME},
{ CHEAT_DEBUG_UNK5, 0xA, 0, 0, mBtnCheatInvalid, /*getStringID(LMISC, MISC_STR_UNK5 )*/0, 0, /* 0x16 */ CHEAT_MASK_16 | CHEAT_MASK_MPGAME | CHEAT_MASK_SPGAME},
{CHEAT_DEACTIVATE_INVINCIBILITY, 0xA, 0, 0, mBtnCheatDeactivateInvincibilityMulti, 0, 0, /* 0x34 */ CHEAT_MASK_GLOBAL | CHEAT_MASK_16 | CHEAT_MASK_MPGAME},
{ CHEAT_LINEMODE, 0xA, 0, 0, mBtnCheatLineMode, getStringID(LMISC, MISC_STR_37_LINEMODE ), 0, /* 0x66 */ CHEAT_MASK_TOGGLE | CHEAT_MASK_GLOBAL | CHEAT_MASK_MPGAME | CHEAT_MASK_SPGAME},
{ CHEAT_2X_HEALTH, 0, 0, 0, 0, 0, 0, /* 0x16 */ CHEAT_MASK_16 | CHEAT_MASK_MPGAME | CHEAT_MASK_SPGAME},
{ CHEAT_2X_ARMOR, 0, 0, 0, 0, 0, 0, /* 0x16 */ CHEAT_MASK_16 | CHEAT_MASK_MPGAME | CHEAT_MASK_SPGAME},
{ CHEAT_INVISIBILITY, 0xA, 0, 0, mBtnCheatInvisibility, getStringID(LMISC, MISC_STR_04_BONDINVISIBLE ), 0, /* 0x62 */ CHEAT_MASK_TOGGLE | CHEAT_MASK_GLOBAL | CHEAT_MASK_SPGAME},
{ CHEAT_INFINITE_AMMO, 0, 0, 0, 0, getStringID(LMISC, MISC_STR_06_INFINITAMMO ), 0, /* 0x66 */ CHEAT_MASK_TOGGLE | CHEAT_MASK_GLOBAL | CHEAT_MASK_MPGAME | CHEAT_MASK_SPGAME},
{ CHEAT_DK_MODE, 0, 0, 0, 0, getStringID(LMISC, MISC_STR_07_DKMODE ), 0, /* 0x26 */ CHEAT_MASK_GLOBAL | CHEAT_MASK_MPGAME | CHEAT_MASK_SPGAME},
{ CHEAT_EXTRA_WEAPONS, 0, 0, 0, 0, 0, 0, /* 0x12 */ CHEAT_MASK_16 | CHEAT_MASK_SPGAME},
{ CHEAT_TINY_BOND, 0, 0, 0, 0, getStringID(LMISC, MISC_STR_08_TINYBOND ), 0, /* 0x02 */ CHEAT_MASK_SPGAME},
{ CHEAT_PAINTBALL, 0, 0, 0, 0, getStringID(LMISC, MISC_STR_38_PAINTBALLMODE ), 0, /* 0x66 */ CHEAT_MASK_TOGGLE | CHEAT_MASK_GLOBAL | CHEAT_MASK_MPGAME | CHEAT_MASK_SPGAME},
{ CHEAT_10X_HEALTH, 0, 0, 0, 0, 0, 0, /* 0x16 */ CHEAT_MASK_16 | CHEAT_MASK_MPGAME | CHEAT_MASK_SPGAME},
{ CHEAT_MAGNUM, 0, 0, 0, 0, getStringID(LMISC, MISC_STR_0A_MAGNUM ), 0, /* 0x12 */ CHEAT_MASK_16 | CHEAT_MASK_SPGAME},
{ CHEAT_LASER, 0, 0, 0, 0, getStringID(LMISC, MISC_STR_0B_LASER ), 0, /* 0x12 */ CHEAT_MASK_16 | CHEAT_MASK_SPGAME},
{ CHEAT_GOLDEN_GUN, 0, 0, 0, 0, getStringID(LMISC, MISC_STR_0C_GOLDENGUN ), 0, /* 0x12 */ CHEAT_MASK_16 | CHEAT_MASK_SPGAME},
{ CHEAT_SILVER_PP7, 0, 0, 0, 0, getStringID(LMISC, MISC_STR_0D_SILVERPPK ), 0, /* 0x12 */ CHEAT_MASK_16 | CHEAT_MASK_SPGAME},
{ CHEAT_GOLD_PP7, 0, 0, 0, 0, getStringID(LMISC, MISC_STR_0E_GOLDPPK ), 0, /* 0x12 */ CHEAT_MASK_16 | CHEAT_MASK_SPGAME},
{ CHEAT_BONDPHASE, 0xA, 0, 0, mBtnCheatBondPhase, 0, 0, /* 0x12 */ CHEAT_MASK_MPGAME},
{ CHEAT_NO_RADAR_MP, 0, 0, 0, 0, getStringID(LMISC, MISC_STR_43_NORADAR ), 0, /* 0x64 */ CHEAT_MASK_TOGGLE | CHEAT_MASK_GLOBAL | CHEAT_MASK_MPGAME},
{ CHEAT_TURBO_MODE, 0, 0, 0, 0, getStringID(LMISC, MISC_STR_40_TURBOMODE ), 0, /* 0x66 */ CHEAT_MASK_TOGGLE | CHEAT_MASK_GLOBAL | CHEAT_MASK_MPGAME | CHEAT_MASK_SPGAME},
{ CHEAT_DEBUG_POS, 0, 0, 0, 0, 0, 0, /* 0x20 */ CHEAT_MASK_GLOBAL},
{ CHEAT_FAST_ANIMATION, 0, 0, 0, 0, getStringID(LMISC, MISC_STR_41_FASTANIMATION ), 0, /* 0x72 */ CHEAT_MASK_TOGGLE | CHEAT_MASK_GLOBAL | CHEAT_MASK_16 | CHEAT_MASK_SPGAME},
{ CHEAT_SLOW_ANIMATION, 0, 0, 0, 0, getStringID(LMISC, MISC_STR_42_SLOWANIMATION ), 0, /* 0x72 */ CHEAT_MASK_TOGGLE | CHEAT_MASK_GLOBAL | CHEAT_MASK_16 | CHEAT_MASK_SPGAME},
{ CHEAT_ENEMY_ROCKETS, 0, 0, 0, 0, getStringID(LMISC, MISC_STR_39_ENEMYROCKETS ), 0, /* 0x01 */ CHEAT_MASK_MENUS},
{ CHEAT_2X_ROCKET_LAUNCHER, 0, 0, 0, 0, getStringID(LMISC, MISC_STR_3A_2XROCKETLAUNCHER ), 0, /* 0x12 */ CHEAT_MASK_16 | CHEAT_MASK_SPGAME},
{ CHEAT_2X_GRENADE_LAUNCHER, 0, 0, 0, 0, getStringID(LMISC, MISC_STR_3B_2XGRENADELAUNCHER), 0, /* 0x12 */ CHEAT_MASK_16 | CHEAT_MASK_SPGAME},
{ CHEAT_2X_RCP90, 0, 0, 0, 0, getStringID(LMISC, MISC_STR_3C_2XFNP90 ), 0, /* 0x12 */ CHEAT_MASK_16 | CHEAT_MASK_SPGAME},
{ CHEAT_2X_THROWING_KNIFE, 0, 0, 0, 0, getStringID(LMISC, MISC_STR_3D_2XTHROWINGKNIFE ), 0, /* 0x12 */ CHEAT_MASK_16 | CHEAT_MASK_SPGAME},
{ CHEAT_2X_HUNTING_KNIFE, 0, 0, 0, 0, getStringID(LMISC, MISC_STR_3E_2XHUNTINGKNIFE ), 0, /* 0x12 */ CHEAT_MASK_16 | CHEAT_MASK_SPGAME},
{ CHEAT_2X_LASER, 0, 0, 0, 0, getStringID(LMISC, MISC_STR_3F_2XLASER ), 0, /* 0x12 */ CHEAT_MASK_16 | CHEAT_MASK_SPGAME},
{ CHEAT_UNLOCK_PAINTBALL, 0xA, 0, 0, mBtnCheatPaintballMod, 0, 0, /* 0x11 */ CHEAT_MASK_16 | CHEAT_MASK_MENUS}, //at cheat menu
{ CHEAT_UNLOCK_INVINCIBLE, 0xA, 0, 0, mBtnCheatInvincible2, 0, 0, /* 0x11 */ CHEAT_MASK_16 | CHEAT_MASK_MENUS}, //at cheat menu
@@ -814,7 +810,7 @@ void cheatButtonActivateRelated(void)
s32 id_index;
s32 find_index;
bool isDone = FALSE;
if (lvlGetCurrentStageToLoad() == LEVELID_TITLE)
{
bitmask = CHEAT_MASK_MENUS;
@@ -878,10 +874,10 @@ void cheat_buttons_mp_related(void)
jgb_trig = (jgb & (L_TRIG | R_TRIG));
jgb &= ~(jgb_trig);
jgbptf &= ~(jgb_trig);
if (jgbptf != 0)
{
{
if ((cheatButtonCountBitsSet(jgbptf) == 1) && ((cheatButtonCountBitsSet(jgb) == 1)))
{
g_CurrentPlayer->cheat_display_text_related[g_CurrentPlayer->something_with_cheat_text] = jgbptf | jgb_trig;
@@ -891,13 +887,13 @@ void cheat_buttons_mp_related(void)
{
g_CurrentPlayer->can_display_cheat_text += 1;
}
}
}
else
{
g_CurrentPlayer->can_display_cheat_text = 0;
}
}
cheatButtonActivateRelated();
}
@@ -923,7 +919,7 @@ bool cheatIsEnemyRockets(CHEAT_ID id)
/**
* true if param is MP cheat
*
*
* Address 0x7F091A78.
*/
bool cheatCheckIfMPCheat(CHEAT_ID cheat_id)
@@ -993,7 +989,7 @@ void cheatButtonHandleCheatsTurnedOn(CHEAT_ID cheat_id)
s32 mask;
s32 current_player_number;
s32 player_count;
mask = g_CheatInfo[cheat_id - 1].maskfield;
current_player_number = get_cur_playernum();
player_count = getPlayerCount();
@@ -1019,7 +1015,7 @@ void cheatButtonHandleCheatsTurnedOn(CHEAT_ID cheat_id)
case CHEAT_INVINCIBILITY:
if (!get_bondata_invincible_flag())
{
HUDMESSAGEBOTTOM((char *)langGet(TEXT(LMISC, 0x0F)));
HUDMESSAGEBOTTOM((char *)langGet(getStringID(LMISC, MISC_STR_0F_INVINCIBILITYON_LF)));
set_bondata_invincible_flag(TRUE);
return;
}
@@ -1028,14 +1024,14 @@ void cheatButtonHandleCheatsTurnedOn(CHEAT_ID cheat_id)
case CHEAT_ALLGUNS:
if (!bondinvGetAllGunsFlag())
{
HUDMESSAGEBOTTOM((char *)langGet(TEXT(LMISC, 0x10)));
HUDMESSAGEBOTTOM((char *)langGet(getStringID(LMISC, MISC_STR_10_ALLGUNSON_LF)));
bondinvSetAllGunsFlag(TRUE);
return;
}
return;
case CHEAT_MAXAMMO:
HUDMESSAGEBOTTOM((char *)langGet(TEXT(LMISC, 0x11)));
HUDMESSAGEBOTTOM((char *)langGet(getStringID(LMISC, MISC_STR_11_MAXIMUMAMMO_LF)));
set_max_ammo_for_cur_player();
return;
@@ -1079,7 +1075,7 @@ void cheatButtonHandleCheatsTurnedOn(CHEAT_ID cheat_id)
case CHEAT_2X_HEALTH:
if ((g_CurrentPlayer->actual_health == 1.0f) || (g_CurrentPlayer->bondhealth < 1.0f))
{
HUDMESSAGEBOTTOM((char *)langGet(TEXT(LMISC, 0x12)));
HUDMESSAGEBOTTOM((char *)langGet(getStringID(LMISC, MISC_STR_12_SUPER2XHEALTH_LF)));
g_CurrentPlayer->bondhealth = 1.0f;
g_CurrentPlayer->actual_health = 2.0f;
}
@@ -1088,7 +1084,7 @@ void cheatButtonHandleCheatsTurnedOn(CHEAT_ID cheat_id)
case CHEAT_2X_ARMOR:
if ((g_CurrentPlayer->actual_armor == 1.0f) || (g_CurrentPlayer->bondarmour < 1.0f))
{
HUDMESSAGEBOTTOM((char *)langGet(TEXT(LMISC, 0x13)));
HUDMESSAGEBOTTOM((char *)langGet(getStringID(LMISC, MISC_STR_13_SUPER2XARMOUR_LF)));
#if defined(BUGFIX_R1)
if(TRUE)
{
@@ -1103,21 +1099,21 @@ void cheatButtonHandleCheatsTurnedOn(CHEAT_ID cheat_id)
case CHEAT_INVISIBILITY:
if (bondviewGetVisibleToGuardsFlag())
{
HUDMESSAGEBOTTOM((char *)langGet(TEXT(LMISC, 0x14)));
HUDMESSAGEBOTTOM((char *)langGet(getStringID(LMISC, MISC_STR_14_INVISIBILITYON_LF)));
bondviewSetVisibleToGuardsFlag(FALSE);
return;
}
return;
case CHEAT_INFINITE_AMMO:
HUDMESSAGEBOTTOM((char *)langGet(TEXT(LMISC, 0x16)));
HUDMESSAGEBOTTOM((char *)langGet(getStringID(LMISC, MISC_STR_16_INFINITEAMMOON_LF)));
/**
* Note: the lvlRender in lvl.c checks if infinite ammo is on then calls set_max_ammo_for_cur_player
*/
return;
case CHEAT_DK_MODE:
HUDMESSAGEBOTTOM((char *)langGet(TEXT(LMISC, 0x17)));
HUDMESSAGEBOTTOM((char *)langGet(getStringID(LMISC, MISC_STR_17_DKMODEON_LF)));
cheatButtonSetDkMode(TRUE);
return;
@@ -1138,7 +1134,7 @@ void cheatButtonHandleCheatsTurnedOn(CHEAT_ID cheat_id)
if (vvv > 0)
{
HUDMESSAGEBOTTOM((char *)langGet(TEXT(LMISC, 0x18)));
HUDMESSAGEBOTTOM((char *)langGet(getStringID(LMISC, MISC_STR_18_EXTRAWEAPONS_LF)));
}
return;
}
@@ -1147,7 +1143,7 @@ void cheatButtonHandleCheatsTurnedOn(CHEAT_ID cheat_id)
case CHEAT_TINY_BOND:
if ((player_count == 1) && (g_playerPerm->player_perspective_height == 1.0f))
{
HUDMESSAGEBOTTOM((char *)langGet(TEXT(LMISC, 0x19)));
HUDMESSAGEBOTTOM((char *)langGet(getStringID(LMISC, MISC_STR_19_TINYBONDON_LF)));
g_playerPerm->player_perspective_height = 0.5f;
if (g_CurrentPlayer->ptr_char_objectinstance != NULL)
@@ -1159,13 +1155,13 @@ void cheatButtonHandleCheatsTurnedOn(CHEAT_ID cheat_id)
return;
case CHEAT_PAINTBALL:
HUDMESSAGEBOTTOM((char *)langGet(TEXT(LMISC, 0x1A)));
HUDMESSAGEBOTTOM((char *)langGet(getStringID(LMISC, MISC_STR_1A_PAINTBALMODEON_LF)));
return;
case CHEAT_10X_HEALTH:
if ((g_CurrentPlayer->actual_health == 1.0f) || (g_CurrentPlayer->bondhealth < 1.0f))
{
HUDMESSAGEBOTTOM((char *)langGet(TEXT(LMISC, 0x1B)));
HUDMESSAGEBOTTOM((char *)langGet(getStringID(LMISC, MISC_STR_1B_SUPER10XHEALTH_LF)));
#if defined(BUGFIX_R1)
if(TRUE)
{
@@ -1222,19 +1218,23 @@ void cheatButtonHandleCheatsTurnedOn(CHEAT_ID cheat_id)
}
return;
case CHEAT_INVISIBILITY_MP: /* unknown */
case CHEAT_BONDPHASE:
currentPlayerStartChrFade(300.0f, 0.05f);
return;
case CHEAT_TURBO_MODE:
if (!get_debug_fast_bond_flag())
{
HUDMESSAGEBOTTOM((char *)langGet(TEXT(LMISC, 0x1D)));
HUDMESSAGEBOTTOM((char *)langGet(getStringID(LMISC, MISC_STR_1D_FASTMODEON_LF)));
set_debug_fast_bond_flag(TRUE);
return;
}
return;
/* easter egg leftover, original usage of string mentioned in an interview
case CHEAT_NO_RADAR_MP:
HUDMESSAGEBOTTOM((char *)langGet(getStringID(LMISC, MISC_STR_1C_HAPPYNOWKARL_LF)));
return;
//*/
case CHEAT_DEBUG_POS:
if (!get_debug_testingmanpos_flag())
{
@@ -1246,7 +1246,7 @@ void cheatButtonHandleCheatsTurnedOn(CHEAT_ID cheat_id)
case CHEAT_FAST_ANIMATION:
if (getAnimationRate() < 4.0f)
{
HUDMESSAGEBOTTOM((char *)langGet(TEXT(LMISC, 0x34)));
HUDMESSAGEBOTTOM((char *)langGet(getStringID(LMISC, MISC_STR_34_FASTMOTION_LF)));
setAnimationRate(4.0f);
return;
}
@@ -1255,7 +1255,7 @@ void cheatButtonHandleCheatsTurnedOn(CHEAT_ID cheat_id)
case CHEAT_SLOW_ANIMATION:
if (getAnimationRate() > 0.25f)
{
HUDMESSAGEBOTTOM((char *)langGet(TEXT(LMISC, 0x32)));
HUDMESSAGEBOTTOM((char *)langGet(getStringID(LMISC, MISC_STR_32_SLOWMOTION_LF)));
setAnimationRate(0.25);
return;
}
@@ -1364,13 +1364,13 @@ void cheatButtonHandleCheatsTurnedOn(CHEAT_ID cheat_id)
s32 val = cheat_id - CHEAT_UNLOCK_PAINTBALL;
if ((selected_folder_num >= 0) && (selected_folder_num < 4))
{
sub_GAME_7F01E760(selected_folder_num, val);
fileSaveFolderUnlockCheat(selected_folder_num, val);
sndPlaySfx(g_musicSfxBufferPtr, CAMERA_BEEP1_SFX, 0);
return;
}
}
return;
case CHEAT_UNLOCK_DAM: /* fall through */
case CHEAT_UNLOCK_FACILITY:
case CHEAT_UNLOCK_RUNWAY:
@@ -1398,7 +1398,7 @@ void cheatButtonHandleCheatsTurnedOn(CHEAT_ID cheat_id)
if (selected_folder_num >= 0 && selected_folder_num < 4)
{
unlock_count = 0;
stagenum = 0;
stagenum = 0;
for (; stagenum < max; stagenum++)
{
if (fileIsStageUnlockedAtDifficulty(selected_folder_num, stagenum, DIFFICULTY_AGENT) == 3)
@@ -1414,10 +1414,10 @@ void cheatButtonHandleCheatsTurnedOn(CHEAT_ID cheat_id)
}
}
}
return;
return;
default:
return;
return;
}
}
@@ -1453,16 +1453,16 @@ void cheatButtonHandleCheatsTurnedOff(CHEAT_ID cheat_id)
case CHEAT_INVINCIBILITY:
if (get_bondata_invincible_flag())
{
HUDMESSAGEBOTTOM((char *)langGet(TEXT(LMISC, 0x1e)));
HUDMESSAGEBOTTOM((char *)langGet(getStringID(LMISC, MISC_STR_1E_INVINCIBILITYOFF_LF)));
set_bondata_invincible_flag(FALSE);
return;
}
return;
case CHEAT_ALLGUNS:
if (bondinvGetAllGunsFlag())
{
HUDMESSAGEBOTTOM((char *)langGet(TEXT(LMISC, 0x1F)));
HUDMESSAGEBOTTOM((char *)langGet(getStringID(LMISC, MISC_STR_1F_ALLGUNSOFF_LF)));
bondinvSetAllGunsFlag(FALSE);
return;
}
@@ -1475,25 +1475,25 @@ void cheatButtonHandleCheatsTurnedOff(CHEAT_ID cheat_id)
case CHEAT_INVISIBILITY:
if (!bondviewGetVisibleToGuardsFlag())
{
HUDMESSAGEBOTTOM((char *)langGet(TEXT(LMISC, 0x20)));
HUDMESSAGEBOTTOM((char *)langGet(getStringID(LMISC, MISC_STR_20_INVISIBILITYOFF_LF)));
bondviewSetVisibleToGuardsFlag(TRUE);
return;
}
return;
case CHEAT_INFINITE_AMMO:
HUDMESSAGEBOTTOM((char *)langGet(TEXT(LMISC, 0x22)));
HUDMESSAGEBOTTOM((char *)langGet(getStringID(LMISC, MISC_STR_22_INFINITEAMMOOFF_LF)));
return;
case CHEAT_DK_MODE:
HUDMESSAGEBOTTOM((char *)langGet(TEXT(LMISC, 0x23)));
HUDMESSAGEBOTTOM((char *)langGet(getStringID(LMISC, MISC_STR_23_DKMODEOFF_LF)));
cheatButtonSetDkMode(FALSE);
return;
case CHEAT_TINY_BOND:
if ((player_count == 1) && (g_playerPerm->player_perspective_height != 1.0f))
{
HUDMESSAGEBOTTOM((char *)langGet(TEXT(LMISC, 0x24)));
HUDMESSAGEBOTTOM((char *)langGet(getStringID(LMISC, MISC_STR_24_TINYBONDOFF_LF)));
g_playerPerm->player_perspective_height = 1.0f;
if (g_CurrentPlayer->ptr_char_objectinstance)
{
@@ -1504,17 +1504,17 @@ void cheatButtonHandleCheatsTurnedOff(CHEAT_ID cheat_id)
return;
case CHEAT_PAINTBALL:
HUDMESSAGEBOTTOM((char *)langGet(TEXT(LMISC, 0x25)));
HUDMESSAGEBOTTOM((char *)langGet(getStringID(LMISC, MISC_STR_25_PAINTBALLMODEOFF_LF)));
return;
case CHEAT_INVISIBILITY_MP: /* multiplayer? but the function call is for "fade"? */
case CHEAT_BONDPHASE:
currentPlayerStartChrFade(300.0f, 1.0f);
return;
case CHEAT_TURBO_MODE:
if (get_debug_fast_bond_flag())
{
HUDMESSAGEBOTTOM((char *)langGet(TEXT(LMISC, 0x27)));
HUDMESSAGEBOTTOM((char *)langGet(getStringID(LMISC, MISC_STR_27_FASTMODEOFF_LF)));
set_debug_fast_bond_flag(FALSE);
return;
}
@@ -1527,10 +1527,10 @@ void cheatButtonHandleCheatsTurnedOff(CHEAT_ID cheat_id)
}
return;
case CHEAT_EXTRA_MP_CHARS:
case CHEAT_MAXAMMO:
case CHEAT_DEBUG_RETURN_SAVED_RA:
case CHEAT_DEBUG_UNK5:
case CHEAT_DEACTIVATE_INVINCIBILITY:
case CHEAT_2X_HEALTH:
case CHEAT_2X_ARMOR:
@@ -1591,11 +1591,11 @@ void cheatButtonHandleCheatsTurnedOff(CHEAT_ID cheat_id)
case CHEAT_UNLOCK_CRADLE:
case CHEAT_UNLOCK_AZTEK:
case CHEAT_UNLOCK_EGYPT:
default:
break;
}
}
@@ -1639,16 +1639,16 @@ void cheatDisableAllCheats(void)
*/
char *cheatGetMenuTextPointer(CHEAT_ID cheat_id)
{
u16 temp_v0;
u16 strID;
temp_v0 = g_CheatInfo[cheat_id - 1].text_bank_id;
strID = g_CheatInfo[cheat_id - 1].text_bank_id;
if (temp_v0 != 0)
if (strID != 0)
{
return langGet((s32) temp_v0);
return langGet((s32) strID);
}
return langGet(TEXT(LMISC, MISC_STR_28));
return langGet(getStringID(LMISC, MISC_STR_28_NONAME));
}
@@ -1669,13 +1669,13 @@ bool cheatIsActive(CHEAT_ID cheat)
*/
void cheatButtonSetDkMode(CHEAT_ID cheat_id)
{
s32 g_NumChrSlots;
s32 numslots;
s32 i;
f32 scale;
Model *model;
ChrRecord* guard = g_ChrSlots;
g_NumChrSlots = get_numguards();
numslots = get_numguards();
if (cheat_id)
{
@@ -1686,7 +1686,7 @@ void cheatButtonSetDkMode(CHEAT_ID cheat_id)
scale = 1.25f;
}
for (i=0; i<g_NumChrSlots; i++, guard++)
for (i=0; i<numslots; i++, guard++)
{
#if defined(VERSION_US)
+3
View File
@@ -2,6 +2,9 @@
#define _CHEAT_BUTTONS_H_
#include <ultra64.h>
// This shows up a lot but not quite sure what it represents.
#define CHEAT_20 20
enum CHEAT_MASK {
CHEAT_MASK_0 = 0,
+548 -785
View File
File diff suppressed because it is too large Load Diff
+8 -8
View File
@@ -18,7 +18,7 @@ struct animation_something
s32 field_10;
s32 field_14;
f32 field_18;
struct struck_animation_table *field_1C;
// maybe count of field_1C
@@ -128,7 +128,7 @@ struct unk_joint_list {
u32 unk28;
u32 unk2C;
s32 unk30;
s32 PropType;
s32 unk34;
rgba_u8 unk38;
s32 unk3C;
@@ -232,11 +232,11 @@ extern s32 show_patrols_flag;
extern s32 player1_guardID;
extern ChrRecord *g_ChrSlots;
extern s32 g_NumChrSlots;
extern struct unk_joint_list D_8002CC6C;
extern ModelRenderData D_8002CC6C;
extern s32 D_8002CCAC;
extern s32 D_8002CCB0;
extern s32 D_8002CCB4;
extern rgba_u8 D_8002CCB8;
extern rgba_u8 gBloodColour;
extern f32 D_80030984;
extern f32 D_80030988;
@@ -288,7 +288,7 @@ void chrPositionRelated7F020D94(ChrRecord *);
void chrSetMoving(ChrRecord *guard,s32 param_2);
f32 getAnimationRate(void);
void setAnimationRate(f32);
PropRecord *init_GUARDdata_with_set_values(PropRecord *, Model *, coord3d *, f32 arg2, StandTile * arg3, s32 arg4);
PropRecord *init_GUARDdata_with_set_values(PropRecord *, Model *, coord3d *, f32 arg2, StandTile * arg3, struct AIListRecord *arg4);
PropRecord *chrAllocate(struct Model * arg0, coord3d * arg1, f32 arg2, StandTile * arg3, s32 arg4);
void chrSetHiddenToRandom(ChrRecord *arg0);
void chrRemoved7F022E1C(f32 arg0);
@@ -307,12 +307,12 @@ s32 get_numguards(void);
Gfx *chrRenderProp(PropRecord *arg0, Gfx *arg1, s32 arg2);
void chrAddHealth(ChrRecord *chr, f32 health);
void chrSetMaxDamage(ChrRecord *chr, f32 maxdamage);
s32 sub_GAME_7F03DA50(struct PropRecord *arg0, s32 arg1);
s32 sub_GAME_7F023194(PropRecord *arg0, struct coord3d *arg1, struct coord2d *arg2, struct coord2d *arg3);
s32 propIsOfCdType(PropRecord* prop, s32 cdtypes);
s32 sub_GAME_7F023194(PropRecord *arg0, struct coord3d *arg1, struct coord2d *arg2, struct coord2d *arg3);
//tentative signature
s32 sub_GAME_7F01FC10(Model *, coord3d *, coord3d *, f32 *);
void sub_GAME_7F0221DC(Model *arg0, s32 arg1, ModelNode *arg2, struct coord3d *arg3);
void sub_GAME_7F0221DC(Model *arg0, s32 arg1, ModelNode *arg2, struct coord3d *arg3);
#ifdef BUGFIX_R1
s32 not_in_us_7F0209EC(s32 bodynum, s32 headnum);
+3 -2
View File
@@ -76,11 +76,12 @@ struct Model *makeonebody(s32 body, s32 head, struct ModelFileHeader *bodyHeader
{
model = get_aircraft_obj_instance_controller(bodyHeader);
}
#ifdef DEBUG
assert(chrsub->inst.savesize>=bodyobj->savesize); //bodyHeader = chrsub, model = bodyobj
#endif
#ifdef XBLADEBUG
#error fix XBLADEBUG
//
// if (*&pMStack0000003c->field_0x2 < pMStack00000024->numRecords) {
// assertPrint_8291E690
// (".\\ported\\chrlv.cpp",0xc4,
// "Assertion failed: chrsub->inst.savesize>=bodyobj->savesize");
+119 -84
View File
@@ -40,7 +40,7 @@
//hack? used to match as called with 2 args, but decompiled code takes 1
extern s32 objectiveGetStatus_WEAK(s32 objectiveNum, s32);
extern s32 objectiveGetStatus_WEAK(s32 objectiveNum, s32);
//bss
@@ -52,7 +52,7 @@ sfxRecord sfx_related[SFX_RELATED_LEN];
/**
* Play Audio in slot X from Prop or Pad
* Play Audio in slot X from Prop or Pad
* @param slot: Where audio is loaded
*/
void audioPlayFromProp2(s32 slot)
@@ -63,10 +63,10 @@ void audioPlayFromProp2(s32 slot)
if ((sfx->state ) && (sndGetPlayingState(sfx->state) ))
{
if (sfx->pos )
{
sfx->Volume = sub_GAME_7F0539E4(sfx->pos);
sfx->Volume = sub_GAME_7F0539E4(sfx->pos);
}
else
{
@@ -104,7 +104,7 @@ void audioPlayFromProp2(s32 slot)
/**
Play All Sounds in all slots
Play All Sounds in all slots
*/
void loop_set_sound_effect_all_slots(void)
{
@@ -121,7 +121,7 @@ void loop_set_sound_effect_all_slots(void)
* @param slot: where to load sound
* @param soundIndex: SFX_ID
*/
void audioPlayFromProp(s32 slot, s16 soundIndex)
void audioPlayFromProp(s32 slot, s16 soundIndex)
{
sfxRecord *sfx = NULL; //always added to stack anyway, cleaner to use
//"Existing ai sound number %d!\n"
@@ -137,13 +137,19 @@ void audioPlayFromProp(s32 slot, s16 soundIndex)
sfx->pos = NULL;
sfx->Obj = NULL;
}
#ifdef DEBUG
else
{
osSyncPrintf("Existing ai sound number %d!\n", slot);
}
#endif
}
sndPlaySfx(g_musicSfxBufferPtr, soundIndex, sfx);
}
/**
Stop All Sounds in all slots
Stop All Sounds in all slots
*/
void sub_GAME_7F0349BC(s32 slot)
{
@@ -157,12 +163,12 @@ void sub_GAME_7F0349BC(s32 slot)
/**
/**
* Get AI Command Size in bytes
* @param AIList: u8 Pointer to The AI list containing the command
* @param offset: The offset (in bytes) to the command you want the size of
* @return The number of bytes of AI command
* @canonical name
* @canonical name
*/
s32 chraiitemsize(u8 *AIList, s32 offset)
{
@@ -192,7 +198,7 @@ s32 chraiitemsize(u8 *AIList, s32 offset)
case AI_Yield:
return AI_Yield_LENGTH;
case AI_EndList:
return AI_EndList_LENGTH;
return AI_EndList_LENGTH;
case AI_SetChrAiList:
return AI_SetChrAiList_LENGTH;
case AI_SetReturnAiList:
@@ -227,9 +233,9 @@ s32 chraiitemsize(u8 *AIList, s32 offset)
return AI_TRYFireOrAimAtTarget_LENGTH;
case AI_TRYFireOrAimAtTargetKneel:
return AI_TRYFireOrAimAtTargetKneel_LENGTH;
case AI_IFImFiring:
case AI_IFImFiring: /* enum = 232 despite following enum = 21 in the list */
return AI_IFImFiring_LENGTH;
case AI_IFImFiringAndLockedForward:
case AI_IFImFiringAndLockedForward: /* enum = 231 despite being followed by enum = 22 in the list */
return AI_IFImFiringAndLockedForward_LENGTH;
case AI_TRYFireOrAimAtTargetUpdate:
return AI_TRYFireOrAimAtTargetUpdate_LENGTH;
@@ -361,8 +367,8 @@ s32 chraiitemsize(u8 *AIList, s32 offset)
return AI_IFBondInRoomWithPad_LENGTH;
case AI_IFBondCollectedObject:
return AI_IFBondCollectedObject_LENGTH;
case AI_IFItemIsStationaryWithinLevel:
return AI_IFItemIsStationaryWithinLevel_LENGTH;
case AI_IFKeyDropped:
return AI_IFKeyDropped_LENGTH;
case AI_IFItemIsAttachedToObject:
return AI_IFItemIsAttachedToObject_LENGTH;
case AI_IFBondHasItemEquipped:
@@ -604,7 +610,7 @@ s32 chraiitemsize(u8 *AIList, s32 offset)
case AI_TvChangeScreenBank:
return AI_TvChangeScreenBank_LENGTH;
case AI_IFBondInTank:
return AI_IFBondInTank_LENGTH;
return AI_IFBondInTank_LENGTH;
case AI_EndLevel:
return AI_EndLevel_LENGTH;
case AI_CameraReturnToBond:
@@ -688,9 +694,9 @@ s32 chraiitemsize(u8 *AIList, s32 offset)
case AI_ObjectRocketLaunch:
return AI_ObjectRocketLaunch_LENGTH;
case AI_PRINT:
{
{
s32 pos = offset + 1;
while (AIList[pos] != 0)
while (AIList[pos] != 0)
{
++pos;
}
@@ -706,11 +712,11 @@ s32 chraiitemsize(u8 *AIList, s32 offset)
/**
* Get ID of AIList
* Get ID of AIList
* @param AIList: Ailist to get ID of
* @return ID of AIList
* @return ID of AIList
*/
s32 chraiGetAIListID(AIRecord *AIList, bool *isGlobalAIList)
s32 chraiGetAIListID(AIRecord *AIList, bool *isGlobalAIList)
{
s32 i;
@@ -742,13 +748,13 @@ s32 chraiGetAIListID(AIRecord *AIList, bool *isGlobalAIList)
/**
/**
* GoTo Label
* @param AIlist: AIList containing label
* @param LabelNum: Integer/enum ID to go to
* @return Offset of label from beggining of AIList.
*/
s32 chraiGoToLabel(AIRecord *AIList, s32 Offset, u8 LabelNum)
s32 chraiGoToLabel(AIRecord *AIList, s32 Offset, u8 LabelNum)
{
s32 listID;
char *debAIListTypeString;
@@ -766,7 +772,7 @@ s32 chraiGoToLabel(AIRecord *AIList, s32 Offset, u8 LabelNum)
}
else if (AIList[Offset].cmd == AI_EndList)
{
// restart ai list PC if next label not found - causes infinit loop outside of debug
// restart ai list PC if next label not found - causes infinite loop outside of debug
listID = chraiGetAIListID(AIList, &isGlobalAIList);
# ifdef DEBUG
if (isGlobalAIList)
@@ -789,7 +795,7 @@ s32 chraiGoToLabel(AIRecord *AIList, s32 Offset, u8 LabelNum)
AIRecord *ailistFindById(s32 ID)
AIRecord *ailistFindById(s32 ID)
{
s32 i;
@@ -833,7 +839,7 @@ PathRecord *pathFindById(s32 ID)
{
return &g_CurrentSetup.patrolpaths[i];
}
}
return NULL;
@@ -887,7 +893,7 @@ void ai(PropDefHeaderRecord *Entityp, PROP_TYPE EntityType)
* ai(void) enery tune on (%d, %d, %d)
* ai(void) enery tune off (%d)
*
* Stack requires that each case declair its own AIRecord variable
* Stack requires that each case declare its own AIRecord variable
*
*/
@@ -936,12 +942,12 @@ void ai(PropDefHeaderRecord *Entityp, PROP_TYPE EntityType)
for (;;)
{
/*
* GE uses long Switch/case while PD uses Bool functions and tests
* for TRUE/FALSE if(funcpointer[ai]) break;
* GE uses long Switch/case while PD uses Bool functions and tests
* for TRUE/FALSE if(funcpointer[ai]) break;
*/
switch ((AiListp + Offset)->cmd)
{
//unfortunatly we cannot use the cmdbuilder in matching rom as the ordering is not sequential
//unfortunately we cannot use the cmdbuilder in matching rom as the ordering is not sequential
#ifdef USECMDBUILDER
#define _AI_DEBUG_ID(CMD, AI_NUMBER_OF_PARAMS, PARAM, DESC)
#define _AI_CMD_POLYMORPH(C, N, P1, P2, D)
@@ -996,8 +1002,24 @@ void ai(PropDefHeaderRecord *Entityp, PROP_TYPE EntityType)
}
case AI_EndList:
{
//Not an error to be here, same as yield except without pushing offset past it.
return;
//Not an error to be here, same as yield except without pushing offset past it. (just keeps looping)
# ifdef ENABLE_LOG
# ifdef IS_PD
listID = chraiGetAIListID(AIList, &isGlobalAIList);
if (isGlobalAIList)
{
debAIListTypeString = "global";
}
else
{
debAIListTypeString = "local";
}
osSyncPrintf("AI error: endlist reached %s list=%d!\n", debAIListTypeString, listID);
# endif
osSyncPrintf("AI error: endlist reached!\n");
# endif
return;
}
case AI_SetChrAiList:
{
@@ -1008,7 +1030,7 @@ void ai(PropDefHeaderRecord *Entityp, PROP_TYPE EntityType)
if (CHR_NUM == ((u8)CHR_SELF))
{
AiListp = ailistFindById(AI_LIST_ID);
AiListp = ailistFindById(AI_LIST_ID);
Offset = 0;
}
else
@@ -1643,12 +1665,12 @@ void ai(PropDefHeaderRecord *Entityp, PROP_TYPE EntityType)
case AI_RunToPadPreset:
{
/* PD uses GoTo Pad (speed) which seems better
switch (ai->val[0])
{
case SPEED_WALK:
switch (ai->val[0])
{
case SPEED_WALK:
chrGoToPad(ChrEntityp, ChrEntityp->padpreset1, SPEED_WALK);
break;
case SPEED_RUN:
break;
case SPEED_RUN:
etc...
*/
chrGoToPad(ChrEntityp, ChrEntityp->padpreset1, SPEED_RUN);
@@ -1679,7 +1701,7 @@ void ai(PropDefHeaderRecord *Entityp, PROP_TYPE EntityType)
Offset += AI_StartPatrol_LENGTH;
break;
}
case AI_IFICanHearAlarm:
case AI_IFICanHearAlarm:
{
AIRecord *ai = AiListp + Offset;
if (chrCanHearAlarm(ChrEntityp))
@@ -1852,8 +1874,8 @@ void ai(PropDefHeaderRecord *Entityp, PROP_TYPE EntityType)
case AI_IFMyRoomIsOnScreen:
{
AIRecord *ai = AiListp + Offset;
if (getROOMID_Bitflags(getTileRoom(ChrEntityp->prop->stan))) //embedded func to match, must be s32 not u8
if (getROOMID_isRendered(getTileRoom(ChrEntityp->prop->stan))) //embedded func to match, must be s32 not u8
{
Offset = chraiGoToLabel(AiListp, Offset, ai->val[0]);
}
@@ -2120,7 +2142,7 @@ void ai(PropDefHeaderRecord *Entityp, PROP_TYPE EntityType)
}
else
{
#ifdef DEBUG
#ifdef ENABLE_LOG
osSyncPrintf("bond not in room\n");
#endif
Offset += AI_IFBondInRoomWithPad_LENGTH;
@@ -2141,7 +2163,7 @@ void ai(PropDefHeaderRecord *Entityp, PROP_TYPE EntityType)
}
break;
}
case AI_IFItemIsStationaryWithinLevel:
case AI_IFKeyDropped:
{
AIRecord *ai = AiListp + Offset;
if (weaponFindThrown(ai->val[0]))
@@ -2150,7 +2172,7 @@ void ai(PropDefHeaderRecord *Entityp, PROP_TYPE EntityType)
}
else
{
Offset += AI_IFItemIsStationaryWithinLevel_LENGTH;
Offset += AI_IFKeyDropped_LENGTH;
}
break;
}
@@ -2293,6 +2315,10 @@ void ai(PropDefHeaderRecord *Entityp, PROP_TYPE EntityType)
if (!objGetDestroyedLevel(obj))
{
f32 damage = ((obj->damage - obj->maxdamage) + 1) / 250.0f;
/*
osSyncPrintf("ai_destroyobj 2 : (def->obj == PROP_ELVIS_SAUCER)\n");
osSyncPrintf("Elvis BOOM\n");
*/
#ifdef ENABLE_LOG
osSyncPrintf("ai_destroyobj 3 : adddamageobj\n");
#endif
@@ -2410,7 +2436,7 @@ void ai(PropDefHeaderRecord *Entityp, PROP_TYPE EntityType)
{
matrix_scalar_multiply(obj->model->scale, &matrix);
}
sub_GAME_7F04088C(obj, pad, &matrix, pad->stan, pad);
sub_GAME_7F04088C(obj, &pad->pos, &matrix, pad->stan, &pad->pos);
setupUpdateObjectRoomPosition(obj);
}
Offset += AI_MoveObject_LENGTH;
@@ -2452,20 +2478,20 @@ void ai(PropDefHeaderRecord *Entityp, PROP_TYPE EntityType)
{
if (door->openPosition <= 0)
{
pass = (ai->val[1] & DOOR_STATE_CLOSED) != 0;
pass = (ai->val[1] & AI_DOOR_STATE_CLOSED) != 0;
}
else
{
pass = (ai->val[1] & DOOR_STATE_OPEN) != 0;
pass = (ai->val[1] & AI_DOOR_STATE_OPEN) != 0;
}
}
else if (door->openstate == DOORSTATE_OPENING || door->openstate == DOORSTATE_WAITING)
{
pass = (ai->val[1] & DOOR_STATE_OPENING) != 0;
pass = (ai->val[1] & AI_DOOR_STATE_OPENING) != 0;
}
else if (door->openstate == DOORSTATE_CLOSING)
{
pass = (ai->val[1] & DOOR_STATE_CLOSING) != 0;
pass = (ai->val[1] & AI_DOOR_STATE_CLOSING) != 0;
}
}
if (pass)
@@ -2550,10 +2576,10 @@ void ai(PropDefHeaderRecord *Entityp, PROP_TYPE EntityType)
u8 val;
u8 label;
} *ai = AiListp + Offset;
/* additional PD code for dificulty filtering
/* additional PD code for dificulty filtering
== OBJECTIVE_COMPLETE && objectivelvlGetSelectedDifficultyBits(ai->val[0]) & (1 << lvlGetSelectedDifficulty())) *
*/
if (objectiveGetCount() > ai->val && OBJECTIVESTATUS_COMPLETE == objectiveGetStatus_WEAK(ai->val * 1, ai->val ))
if (objectiveGetCount() > ai->val && OBJECTIVESTATUS_COMPLETE == objectiveGetStatus_WEAK(ai->val * 1, ai->val ))
{
Offset = chraiGoToLabel(AiListp, Offset, ai->label);
}
@@ -3322,8 +3348,17 @@ void ai(PropDefHeaderRecord *Entityp, PROP_TYPE EntityType)
{
#ifdef ENABLE_LOG
AIRecord *ai = AiListp + Offset;
//PD = osSyncPrintf("AI_PRINT(void) [%d] %s\n", ai-val);
osSyncPrintf("AI_PRINT: %s\n", ai->val);
#ifdef IS_PD
if (ChrEntityp)
{
osSyncPrintf("AI_PRINT(void) [%d] %s\n", ChrEntityp->chrnum, ai->val);
}
else if(VehichleEntityp)
{
osSyncPrintf("AI_PRINT(void) [hover vehicle] %s\n", ai->val);
}
#endif
#endif
Offset += chraiitemsize(AiListp, Offset);
break;
@@ -3510,7 +3545,7 @@ void ai(PropDefHeaderRecord *Entityp, PROP_TYPE EntityType)
{
AIRecord *ai = AiListp + Offset;
s32 flags = CharArrayTo32(ai->val,3);
s32 model = CharArrayTo16(ai->val,0);
s32 model = CharArrayTo16(ai->val,0);
PropRecord *prop = NULL;
if (ChrEntityp && ChrEntityp->prop && ChrEntityp->model)
@@ -3745,8 +3780,8 @@ void ai(PropDefHeaderRecord *Entityp, PROP_TYPE EntityType)
{
#ifdef VERSION_EU
sfx_related[ai->slotID].sfxID = (sfxID * 50) / 60;
#else
sfx_related[ai->slotID].sfxID = sfxID;
#else
sfx_related[ai->slotID].sfxID = sfxID;
#endif
sfx_related[ai->slotID].Volume = vol;
sfx_related[ai->slotID].pos = NULL;
@@ -3779,8 +3814,8 @@ void ai(PropDefHeaderRecord *Entityp, PROP_TYPE EntityType)
{
#ifdef VERSION_EU
sfx_related[ai->slotID].sfxID = (sfxID * 50) / 60;
#else
sfx_related[ai->slotID].sfxID = sfxID;
#else
sfx_related[ai->slotID].sfxID = sfxID;
#endif
sfx_related[ai->slotID].Volume = sub_GAME_7F0539B8(vol);
sfx_related[ai->slotID].pos = NULL;
@@ -3807,8 +3842,8 @@ void ai(PropDefHeaderRecord *Entityp, PROP_TYPE EntityType)
{
#ifdef VERSION_EU
sfx_related[ai->slotID].sfxID = (sfxID * 50) / 60;
#else
sfx_related[ai->slotID].sfxID = sfxID;
#else
sfx_related[ai->slotID].sfxID = sfxID;
#endif
sfx_related[ai->slotID].pos = NULL;
sfx_related[ai->slotID].Obj = obj;
@@ -3921,7 +3956,7 @@ void ai(PropDefHeaderRecord *Entityp, PROP_TYPE EntityType)
case AI_IFCameraIsInIntro:
{
AIRecord *ai = AiListp + Offset;
if ((get_camera_mode() == 1) || (get_camera_mode() == 2))
if ((bondviewGetCameraMode() == 1) || (bondviewGetCameraMode() == 2))
{
Offset = chraiGoToLabel(AiListp, Offset, ai->val[0]);
}
@@ -3934,7 +3969,7 @@ void ai(PropDefHeaderRecord *Entityp, PROP_TYPE EntityType)
case AI_IFCameraIsInBondSwirl:
{
AIRecord *ai = AiListp + Offset;
if (get_camera_mode() == 3)
if (bondviewGetCameraMode() == 3)
{
Offset = chraiGoToLabel(AiListp, Offset, ai->val[0]);
}
@@ -3972,8 +4007,8 @@ void ai(PropDefHeaderRecord *Entityp, PROP_TYPE EntityType)
{
AIRecord *ai = AiListp + Offset;
#ifdef ENABLE_LOG
osSyncPrintf("ai_ifbondintank\n");
#endif
osSyncPrintf("ai_ifbondintank\n");
#endif
if (isBondInTank() == TRUE)
{
Offset = chraiGoToLabel(AiListp, Offset, ai->val[0]);
@@ -3987,11 +4022,11 @@ void ai(PropDefHeaderRecord *Entityp, PROP_TYPE EntityType)
case AI_EndLevel: // canonical name
{
/*"aiEndLevel" */
if (camera_8003642C)
if (cameraBufferToggle)
{
if (camera_80036434 == FALSE)
if (cameraFrameCounter2 == FALSE)
{
camera_80036434 = TRUE;
cameraFrameCounter2 = TRUE;
}
}
else
@@ -4003,7 +4038,7 @@ void ai(PropDefHeaderRecord *Entityp, PROP_TYPE EntityType)
}
case AI_CameraReturnToBond:
{
set_camera_mode(CAMERAMODE_FP_NOINPUT);
bondviewSetCameraMode(CAMERAMODE_FP_NOINPUT);
Offset += AI_CameraReturnToBond_LENGTH;
break;
}
@@ -4019,7 +4054,7 @@ void ai(PropDefHeaderRecord *Entityp, PROP_TYPE EntityType)
{
dword_CODE_bss_800799F8 = (PadRecord *)&g_CurrentSetup.boundpads[getBoundPadNum(padnum)];
}
set_camera_mode(CAMERAMODE_POSEND);
bondviewSetCameraMode(CAMERAMODE_POSEND);
Offset += AI_CameraLookAtBondFromPad_LENGTH;
break;
}
@@ -4042,7 +4077,7 @@ void ai(PropDefHeaderRecord *Entityp, PROP_TYPE EntityType)
gBondViewCutscene = cdef;
dword_CODE_bss_80079A18 = CharArrayTo16(ai->val,1);
dword_CODE_bss_80079A1C = CharArrayTo16(ai->val,3);
set_camera_mode(CAMERAMODE_POSEND);
bondviewSetCameraMode(CAMERAMODE_POSEND);
}
}
Offset += AI_CameraSwitch_LENGTH;
@@ -4079,7 +4114,7 @@ void ai(PropDefHeaderRecord *Entityp, PROP_TYPE EntityType)
{
countdownTimerSetVisible(16, FALSE);
}
D_800364B0 = FALSE;
is_timer_active = FALSE;
Offset += AI_BondDisableControl_LENGTH;
break;
}
@@ -4093,7 +4128,7 @@ void ai(PropDefHeaderRecord *Entityp, PROP_TYPE EntityType)
hudmsgsSetOn(PLAYERFLAG_NOCONTROL);
bondviewClearUpperTextDisplayFlag(2);
countdownTimerSetVisible(16, TRUE);
D_800364B0 = TRUE;
is_timer_active = TRUE;
Offset += AI_BondEnableControl_LENGTH;
break;
}
@@ -4128,7 +4163,7 @@ void ai(PropDefHeaderRecord *Entityp, PROP_TYPE EntityType)
stan = pad->stan;
sub_GAME_7F03D058(chr->prop, FALSE);
if (sub_GAME_7F033F48(&pos, &stan, FacingDirection, TRUE))
if (chrAdjustPosForSpawn(&pos, &stan, FacingDirection, TRUE))
{
{
chr->prop->pos.x = pos.x;
@@ -4232,9 +4267,9 @@ void ai(PropDefHeaderRecord *Entityp, PROP_TYPE EntityType)
door->openPosition = door->maxFrac;
door->openedTime = g_GlobalTimer;
door->openstate = DOORSTATE_STATIONARY;
sub_GAME_7F052B00(door);
door7F052B00(door);
doorActivatePortal(door); // doorActivatePortal
sub_GAME_7F053B10(door);
door7F053B10(door);
}
Offset += AI_DoorOpenInstant_LENGTH;
break;
@@ -4402,20 +4437,20 @@ void ai(PropDefHeaderRecord *Entityp, PROP_TYPE EntityType)
flt_CODE_bss_80079A0C = camHeight;
flt_CODE_bss_80079A10 = targetHeight;
dword_CODE_bss_80079A14 = padnum;
set_camera_mode(CAMERAMODE_POSEND);
bondviewSetCameraMode(CAMERAMODE_POSEND);
Offset += AI_CameraOrbitPad_LENGTH;
break;
}
case AI_CreditsRoll:
{
D_8003643C = TRUE;
credits_state = TRUE;
Offset += AI_CreditsRoll_LENGTH;
break;
}
case AI_IFCreditsHasCompleted:
{
AIRecord *ai = AiListp + Offset;
if (D_8003643C == 2)
if (credits_state == 2)
{
Offset = chraiGoToLabel(AiListp, Offset, ai->val[0]);
}
@@ -4442,7 +4477,7 @@ void ai(PropDefHeaderRecord *Entityp, PROP_TYPE EntityType)
case AI_IFFolderActorIsEqual:
{
AIRecord *ai = AiListp + Offset;
if (getSelectedFolderBond() == (s8)ai->val[0])
if (fileGetBondForCurrentFolder() == (s8)ai->val[0])
{
Offset = chraiGoToLabel(AiListp, Offset, ai->val[1]);
}
@@ -4566,14 +4601,14 @@ void ai(PropDefHeaderRecord *Entityp, PROP_TYPE EntityType)
#endif
default:
/*
* No Command found, advance ailist by 1.
* This is attempting to handle situations where the command
* type is invalid by passing over them and continuing
* execution.
* chraiitemsize returns 1 which is pointless really
* could have done it here without a jump
* No Command found, advance ailist by 1.
* This is attempting to handle situations where the command
* type is invalid by passing over them and continuing
* execution.
* chraiitemsize returns 1 which is pointless really
* could have done it here without a jump
*
* Outcome:crash
* Outcome:crash
*/
{
Offset += chraiitemsize(AiListp, Offset);
+9 -6
View File
@@ -218,8 +218,8 @@ extern u32 monAnim00Bond[];
extern u32 monAnim34[];
extern u32 monAnim35Taser[];
extern WeaponObjRecord* temp_mine_table[30];
extern f32 gas_damage_flag;
extern u32 gas_cutoff_flag;
extern f32 gasTimeToFullOpacity;
extern u32 gasDoesDamageFlag;
extern f32 difficulty ;
extern stagesetup g_CurrentSetup;
extern s16 * ptr_list_object_lookup_indices;
@@ -250,6 +250,7 @@ extern struct object_animation_controller g_UnknownAnimController;
extern struct object_animation_controller g_TaserAnimController;
extern stagesetup *g_ptrStageSetupFile;
extern char *setup_text_pointers[];
void alarmDeactivate(void);
s32 chraiitemsize(u8 *AIList, s32 offset);
@@ -262,11 +263,11 @@ void chraiCheckUseHeldItems(void);
bool bond_interact_object(void);
void sub_GAME_7F03D0D4(void);
void chrpropRegisterRoom(PropRecord *, s16);
PropRecord* propAllocate();
PropRecord* chrpropAllocate(void);
void chrpropReparent(PropRecord *newChild, PropRecord *host);
void chrpropDeregisterRooms(PropRecord *);
void sub_GAME_7F03E27C(PropRecord *, coord3d *, coord3d *, f32);
void chrpropRegisterRooms(PropRecord *posData);
void chrpropActivate(PropRecord *);
void chrpropEnable(PropRecord *);
void chrpropActivateThisFrame(PropRecord *);
@@ -280,6 +281,7 @@ void roomGetProps(s32 *roomids);
ObjectRecord *scan_position_data_table_for_normal_object_at_preset(s32 arg0);
Gfx *chrpropsRenderPass(Gfx *arg0, s32 roomid, s32 arg2);
PropRecord *get_ptr_obj_pos_list_current_entry(void);
void propsDefragRoomProps(void);
void chraiGetPropRoomIds(PropRecord *self, s32 *roomids);
void chrpropFree(PropRecord *prop);
void chrpropDisable(PropRecord *prop);
@@ -287,7 +289,7 @@ f32 chrpropBBOXGetXmin(ModelRoData_BoundingBoxRecord *modelBoundingBox
f32 chrpropBBOXGetYmin(ModelRoData_BoundingBoxRecord *modelBoundingBox);
f32 chrpropBBOXGetYmax(ModelRoData_BoundingBoxRecord *modelBoundingBox);
f32 chrpropBBOXGetZmin(ModelRoData_BoundingBoxRecord *modelBoundingBox);
ObjectRecord *sub_GAME_7F03FAB0(PadRecord *pad, s32 RoomID);
ObjectRecord *sub_GAME_7F03FAB0(struct coord3d *pos, s32 RoomID);
void chraiGetCollisionBounds(PropRecord *arg0, struct rect4f **arg1, s32 *arg2, f32 *arg3, f32 *arg4);
void chrpropGetCollisionBounds(PropRecord *arg0, f32 *arg1, f32 *arg2, f32 *arg3);
f32 sub_GAME_7F03CFE8(PropRecord *arg0);
@@ -298,5 +300,6 @@ f32 chrpropSumMatrixNegY(struct ModelRoData_BoundingBoxRecord *bbox, Mtxf *arg1)
f32 chrpropSumMatrixPosZ(struct ModelRoData_BoundingBoxRecord *bbox, Mtxf *arg1);
f32 chrpropSumMatrixNegZ(struct ModelRoData_BoundingBoxRecord *bbox, Mtxf *arg1);
void sub_GAME_7F03F540(struct ModelRoData_BoundingBoxRecord *bbox, Mtxf *arg1, struct rect4f* arg2, struct collision_data *arg3);
void sub_GAME_7F03F948(struct coord3d *arg0, f32 *arg1, f32 *arg2, f32 *arg3, f32 *arg4);
void sub_GAME_7F03F948(struct coord3d *arg0, struct coord2d *arg1, struct coord2d *arg2, struct coord2d *arg3, struct coord2d *arg4);
void sub_GAME_7F03E6A0(PropRecord *prop);
#endif
+156 -143
View File
@@ -2,7 +2,7 @@
* chraidata.c
*
* Global AI Data to be used by any Setup.
*
*
*========================================================================*/
/**************************************************************************
*
@@ -18,7 +18,7 @@
#pragma region Private Members
/*private enum, only accessable from within this file */
/*private enum, only accessible from within this file */
static enum lbl
{
lblZero,
@@ -58,7 +58,7 @@ static enum lbl
Try aiming at bond, otherwise do nothing
@return No Return - AI List can only be changed by a 3rd party via SetChrAiList
*/
u8 m_AimAtBond[] = {
u8 m_AimAtBond[] = {
TRYAimAtBond(lblLoop)
YIELD_FOREVER(lblLoop)
EndList()
@@ -66,21 +66,21 @@ u8 m_AimAtBond[] = {
/*D:8003707C */
/**
Dead or Removed AI.
Dead or Removed AI.
Use when AI has no more to do (or use YIELD_FOREVER)
@return No Return - AI List can only be changed by a 3rd party via SetChrAiList
*/
u8 m_DeadAI[] = {
/*AI_PRINT,'d','y','e','n','g','\0',*/
/*PRINT("dyeng")*/
YIELD_FOREVER(lblDead)
EndList()
};
/*D:80037084 */
/**
Stand Guard and Kill Time or patrol (Not typicaly used for patrolling).
While killing time, play Idle animations
On detecting Bond, Send a clone OR Run to Bond and Attack.
Stand Guard and Kill Time or patrol (Not typicaly used for patrolling).
While killing time, play Idle animations
On detecting Bond, Send a clone OR Run to Bond and Attack.
This AI List is used by nearly all guards either as default or as a result
of detecting Bond or finishing their assigned behaivior.
@return No Return - AI List can only be changed by a 3rd party via SetChrAiList
@@ -91,48 +91,49 @@ u8 m_StandardGuard[] = {
This is the only example available in Global AI where a script will
return to itself - therefor the only example of CALL too.
*/
#define THIS GAILIST_STANDARD_GUARD
#define THIS GAILIST_STANDARD_GUARD
DO(lblLoop)
IFImDyingOrDead(lblDead) /* guard died, safely end list */
IFImOnPatrolOrStopped(lblStoppedMoving) /* guard has stopped moving, safe to continue */
/*ELSE*/
CONTINUE(lblLoop)
Label(lblStoppedMoving)
/*Jump table*/
IFISeeBond(lblSeesBond)
IFIWasShotRecently(lblBuddyShot)
IFIHeardBondRecently(lblCloneContinue)
IFBondMissedMe(lblNearMiss)
IFISeeSomeoneShot(lblBuddyShot)
IFISeeSomeoneDie(lblBuddyShot)
IFIWasShotRecently(lblBuddyShot)
IFIHeardBondRecently(lblCloneContinue)
IFBondMissedMe(lblNearMiss)
IFISeeSomeoneShot(lblBuddyShot)
IFISeeSomeoneDie(lblBuddyShot)
IFPlayingAnimation(lblNext) /*CONTNUE*/
IFNewRandomGreaterThan(1, lblNext) /* 1/255 chance of playing new animation else continue */
/*Default*/
/*Default*/
CALL( GAILIST_PLAY_IDLE_ANIMATION) /* play idle animation and return to list */
Label(lblNext)
Label(lblNext)
LOOP(lblLoop)
Label(lblNearMiss) /* bond shot near guard */
IFNewRandomGreaterThan(127, lblSeesBond) /* 50% chance of playing looking around animation */
CALL( GAILIST_STARTLE_AND_RUN_TO_BOND)
Label(lblSeesBond) /* guard sees bond */
CALL( GAILIST_ATTACK_BOND)
Label(lblBuddyShot) /* guard saw someone shot/die or guard was shot themselves */
CALL( GAILIST_RUN_TO_BOND)
Label(lblCloneContinue) /* guard heard bond, attempt to spawn clone (only if chr has clone flag) */
SetReturnAiList(THIS) // This command is useless
JumpTo(GAILIST_TRY_CLONE_SEND_OR_RUN_TO_BOND)
Label(lblDead) /* guard has died, end routine */
/*PRINT("DIE INSCAN\n")*/
JumpTo( GAILIST_DEAD_AI)
EndList()
@@ -142,8 +143,8 @@ u8 m_StandardGuard[] = {
/*D:800370DC */
/**
Play one random idle animation
@return to caller if called with CALL
Play one random idle animation
@return to caller if called with CALL
-or-
return to List set by SetReturnAiList - If not set will crash
*/
@@ -152,31 +153,31 @@ u8 m_IdleAnimations[] = {
IFNewRandomGreaterThan(50, lblNext) /* generate annd compare random seed to see which animation to play */
PlayAnimation(ANIM_yawning, 0, 193, ANIM_IDLE_POSE_WHEN_COMPLETE | ANIM_PLAY_SFX, ANIM_DEFAULT_INTERPOLATION)
GotoNext(lblDone) /* jump to end, we're done */
Label(lblNext)
IFRandomGreaterThan(100, lblNext)
PlayAnimation(ANIM_swatting_flies, 0, 294, ANIM_IDLE_POSE_WHEN_COMPLETE | ANIM_PLAY_SFX, ANIM_DEFAULT_INTERPOLATION)
GotoNext(lblDone) /* jump to end, we're done */
Label(lblNext)
IFRandomGreaterThan(150, lblNext)
PlayAnimation(ANIM_scratching_leg, 0, 183, ANIM_IDLE_POSE_WHEN_COMPLETE | ANIM_PLAY_SFX, ANIM_DEFAULT_INTERPOLATION)
GotoNext(lblDone) /* jump to end, we're done */
Label(lblNext)
IFRandomGreaterThan(200, lblNext)
PlayAnimation(ANIM_scratching_butt, 0, 123, ANIM_IDLE_POSE_WHEN_COMPLETE | ANIM_PLAY_SFX, ANIM_DEFAULT_INTERPOLATION)
GotoNext(lblDone) /* jump to end, we're done */
Label(lblNext)
IFRandomGreaterThan(250, lblNext)
PlayAnimation(ANIM_adjusting_crotch, 0, 56, ANIM_IDLE_POSE_WHEN_COMPLETE | ANIM_PLAY_SFX, ANIM_DEFAULT_INTERPOLATION)
GotoNext(lblDone) /* jump to end, we're done */
Label(lblNext)
PlayAnimation(ANIM_sneeze, 0, 137, ANIM_IDLE_POSE_WHEN_COMPLETE | ANIM_PLAY_SFX, ANIM_DEFAULT_INTERPOLATION)
GotoNext(lblDone) /* jump to end, we're done */
Label(lblDone)
#else
SWITCH(SetNewRandom(),
@@ -192,7 +193,7 @@ u8 m_IdleAnimations[] = {
IFRandomGreaterThan,100,
PlayAnimation(ANIM_scratching_leg , 0, 183, ANIM_IDLE_POSE_WHEN_COMPLETE | ANIM_PLAY_SFX, ANIM_DEFAULT_INTERPOLATION)
BREAK,
IFRandomGreaterThan,50,
IFRandomGreaterThan,50,
PlayAnimation(ANIM_swatting_flies , 0, 294, ANIM_IDLE_POSE_WHEN_COMPLETE | ANIM_PLAY_SFX, ANIM_DEFAULT_INTERPOLATION)
BREAK,
/*DEFAULT*/,,
@@ -207,7 +208,7 @@ u8 m_IdleAnimations[] = {
/*D:8003713C */
/**
Bash that Keyboard once with a random animation
@return to caller if called with CALL
@return to caller if called with CALL
-or-
return to List set by SetReturnAiList - If not set will crash
*/
@@ -216,17 +217,17 @@ u8 m_BashKeyboard[] = {
IFNewRandomGreaterThan(60, lblNext)
PlayAnimation(ANIM_keyboard_right_hand1, 0, 69, 0x00, ANIM_DEFAULT_INTERPOLATION)
GotoNext(lblDone) /* jump to end, we're done */
Label(lblNext)
IFRandomGreaterThan(120, lblNext)
PlayAnimation(ANIM_keyboard_right_hand2, 0, 74, 0x00, ANIM_DEFAULT_INTERPOLATION)
GotoNext(lblDone) /* jump to end, we're done */
Label(lblNext)
IFRandomGreaterThan(180, lblNext)
PlayAnimation(ANIM_keyboard_left_hand, 0, 79, 0x00, ANIM_DEFAULT_INTERPOLATION)
GotoNext(lblDone) /* jump to end, we're done */
Label(lblNext)
PlayAnimation(ANIM_keyboard_right_hand_tapping, 0, 89, 0x00, ANIM_DEFAULT_INTERPOLATION)
GotoNext(lblDone) /* jump to end, we're done */
@@ -242,7 +243,7 @@ u8 m_BashKeyboard[] = {
IFRandomGreaterThan,60,
PlayAnimation(ANIM_keyboard_right_hand2, 0, 74, 0x00, ANIM_DEFAULT_INTERPOLATION)
BREAK,
/*DEFAULT*/,,
/*DEFAULT*/,,
PlayAnimation(ANIM_keyboard_right_hand1, 0, 69, 0x00, ANIM_DEFAULT_INTERPOLATION)
BREAK,
)
@@ -253,15 +254,15 @@ u8 m_BashKeyboard[] = {
/*D:8003717C */
/**
Stand Guard Statically (No Clones, No animations) or patrol.
On detecting Bond (sight/near-miss only), Act like a Standard Guard.
On detecting Bond (sight/near-miss only), Act like a Standard Guard.
@return to Standard Guard
*/
u8 m_SimpleGuardDeaf[] = {
u8 m_SimpleGuardDeaf[] = {
DO(lblLoop) /* wait for guard to stop moving before branching to next logic */
IFImOnPatrolOrStopped(lblStoppedMoving)
/*ELSE*/
CONTINUE(lblLoop)
Label(lblStoppedMoving)
IFISeeBond(lblSeesBond)
IFIWasShotRecently(lblBuddyShot)
@@ -269,15 +270,15 @@ u8 m_SimpleGuardDeaf[] = {
IFISeeSomeoneShot(lblBuddyShot)
IFISeeSomeoneDie(lblBuddyShot)
LOOP(lblLoop)
Label(lblNearMiss) /* bond shot near guard */
IFNewRandomGreaterThan(127, lblSeesBond) /* 50% chance of playing looking around animation */
JUMPTO_THEN_GUARD( GAILIST_STARTLE_AND_RUN_TO_BOND)
Label(lblSeesBond) /* guard sees bond */
JUMPTO_THEN_GUARD( GAILIST_ATTACK_BOND)
Label(lblBuddyShot) /* guard saw another guard shot/die or guard was shot */
JUMPTO_THEN_GUARD( GAILIST_RUN_TO_BOND)
EndList()
@@ -291,7 +292,7 @@ u8 m_SimpleGuardDeaf[] = {
return to List set by SetReturnAiList - If not set will crash
*/
u8 m_AttackBond[] = {
#if 0 //Doesnt work any simpler
#if 0 //Doesnt work any simpler
IFMyFlags2Has(FLAGS2_DONT_POINT_AT_BOND, lblNext) /* if guard already pointed at bond */
/*ELSE*/
IFNewRandomGreaterThan(32, lblNext) /* 12.5% chance of pointing to bond */
@@ -299,7 +300,7 @@ u8 m_AttackBond[] = {
SetMyFlags2(FLAGS2_DONT_POINT_AT_BOND) /* don't point again, thank you object permanence */
Return() /* guard pointed at bond, return to list */
Label(lblNext)
Label(lblNext)
SetMyFlags2(FLAGS2_DONT_POINT_AT_BOND) /* I am awayer of Bond, set flag so we don't point at bond */
SWITCH(/*SetNewRandom()*/EMPTY,
IFRandomGreaterThan,127,
@@ -315,14 +316,14 @@ u8 m_AttackBond[] = {
TRYSideRunning,
IFNewRandomGreaterThan,10,
TRYSidestepping,
IFNewRandomGreaterThan,10,
IFNewRandomGreaterThan,10,
TRYSideHopping,
/*DEFAULT*/,,
TRYFiringRoll,
,,
TRYThrowingGrenade /* attempt to throw grenade, depends on chr->grenadeprob value */
)
#else
#else
IFMyFlags2Has(FLAGS2_DONT_POINT_AT_BOND, lblNext) /* if guard already pointed at bond */
IFNewRandomGreaterThan(32, lblNext) /* 12.5% chance of pointing to bond */
PointAtBond()
@@ -332,35 +333,35 @@ u8 m_AttackBond[] = {
Label(lblNext) /*Not a switch*/
SetMyFlags2(FLAGS2_DONT_POINT_AT_BOND) /* I am awayer of Bond, set flag so we don't point at bond */
TRYThrowingGrenade(lblDone) /* attempt to throw grenade, depends on chr->grenadeprob value */
Label(lblNext)
IFNewRandomGreaterThan(10, lblNext)
TRYFiringRoll(lblDone)
Label(lblNext)
IFNewRandomGreaterThan(10, lblNext)
TRYSideHopping(lblDone)
Label(lblNext)
IFNewRandomGreaterThan(25, lblNext)
TRYSidestepping(lblDone)
Label(lblNext)
IFNewRandomGreaterThan(50, lblNext)
TRYSideRunning(lblDone)
Label(lblNext)
IFNewRandomGreaterThan(64, lblNext)
TRYFiringWalk(lblDone) /* infinite ammo death sentence ;) */
Label(lblNext)
IFRandomGreaterThan(127, lblNext)
TRYFiringRun(lblDone)
Label(lblNext)
IFNewRandomGreaterThan(127, lblKneel)
TRYFireAtBond(lblDone)
Label(lblKneel)
TRYFireAtBondKneeling(lblDone)
@@ -368,7 +369,7 @@ u8 m_AttackBond[] = {
#endif
Return()
EndList()
EndList()
};
/*D:8003720C */
@@ -378,7 +379,7 @@ u8 m_AttackBond[] = {
-or-
return to List set by SetReturnAiList - If not set will crash
*/
u8 m_RunToBond[] = {
u8 m_RunToBond[] = {
SetMyFlags2(FLAGS2_DONT_POINT_AT_BOND) /* guard is aware of bond, so don't point at him when first spotted */
TRYRunToBond(lblLoop) /* goto loop if bond position is reachable */
Return() /* if guard can't reach bond, return to ai list (read TRYRunToBond command info) */
@@ -387,10 +388,10 @@ u8 m_RunToBond[] = {
IFImOnPatrolOrStopped(lblStoppedMoving)
IFISeeBond(lblSeesBond) /* executes every frame instead of "at ready" state */
LOOP(lblLoop)
Label(lblSeesBond)
JumpTo( GAILIST_ATTACK_BOND)
Label(lblStoppedMoving)
Return()
EndList()
@@ -398,19 +399,19 @@ u8 m_RunToBond[] = {
/*D:80037224 */
/**
If Calling Chr NOT been seen, Send Clone after Bond, otherwise Act like a
If Calling Chr NOT been seen, Send Clone after Bond, otherwise Act like a
Standard Guard
@return to Standard Guard
*/
u8 m_TryCloneSendOrRunToBond[] = {
u8 m_TryCloneSendOrRunToBond[] = {
SetMyFlags2(FLAGS2_DONT_POINT_AT_BOND) /* I am aware of bond, so won't point at him */
IFIveNotBeenSeen(lblCloneContinue)
JumpTo( GAILIST_RUN_TO_BOND)
IFIveNotBeenSeen(lblCloneContinue)
JumpTo( GAILIST_RUN_TO_BOND)
Label(lblCloneContinue)
IFMyCloneDoesNotExist(lblCloneContinue) /* Ive not been seen, test for clone existance */
JumpTo( GAILIST_STANDARD_GUARD) /* we only want 1 clone */
Label(lblCloneContinue) /* clone didnt exist, create one */
TRYCloningMe(GAILIST_STANDARD_CLONE, lblNext) /* Assign AI to clone */
JumpTo( GAILIST_RUN_TO_BOND) /* clone failed to spawn (not enough memory/guard doesn't have clone flag on),
@@ -427,20 +428,20 @@ u8 m_TryCloneSendOrRunToBond[] = {
Run to bond then act like a Standard Guard
@return to Standard Guard
*/
u8 m_StandardClone[] = {
u8 m_StandardClone[] = {
JUMPTO_THEN_GUARD( GAILIST_RUN_TO_BOND)
EndList()
};
/*D:80037250 */
/**
Stand Guard Statically (No Clones, No animations) or patrol (Typical Use of this type).
Stand Guard Statically (No Clones, No animations) or patrol (Typical Use of this type).
On detecting Bond, Act like a Standard Guard.
@return to Standard Guard
*/
u8 m_SimpleGuard[] = {
/* Simple Detection Loop */
DO(lblLoop)
DO(lblLoop)
IFISeeBond(lblSeesBond)
IFIWasShotRecently(lblBuddyShot)
IFIHeardBondRecently(lblBuddyShot)
@@ -448,13 +449,13 @@ u8 m_SimpleGuard[] = {
IFISeeSomeoneShot(lblBuddyShot)
IFISeeSomeoneDie(lblBuddyShot)
LOOP(lblLoop)
Label(lblSeesBond) /* guard sees bond */
JUMPTO_THEN_GUARD( GAILIST_ATTACK_BOND)
Label(lblBuddyShot) /* guard saw another guard shot/die or guard was shot */
JUMPTO_THEN_GUARD( GAILIST_RUN_TO_BOND)
Label(lblCloneContinue) /* unused spawn clone reaction for hearing bond, likely made game too difficult/slow */
JUMPTO_THEN_GUARD( GAILIST_TRY_CLONE_SEND_OR_RUN_TO_BOND)
EndList()
@@ -462,53 +463,66 @@ u8 m_SimpleGuard[] = {
/*D:80037280 */
/**
Stand Guard Statically (No Clones, No animations) or patrol.
On detecting Bond, Run to padpreset1 and activate alarm.
Stand Guard Statically (No Clones, No animations) or patrol.
On detecting Bond, Run to padpreset1 and activate alarm.
Act like a Standard Guard thereafter
@return to Standard Guard
*/
u8 m_SimpleGuardAlarmRaiser[] = {
DO(lblLoop)
IFImOnPatrolOrStopped(lblStoppedMoving)
/*ELSE*/
CONTINUE(lblLoop)
Label(lblStoppedMoving)
IFISeeBond(lblRunToObjective)
IFMyNumCloseArghsGreaterThan(0, lblNearMiss)
IFIHeardBondRecently(lblNearMiss)
IFISeeSomeoneShot(lblNearMiss)
IFISeeSomeoneDie(lblNearMiss)
LOOP(lblLoop)
u8 m_SimpleGuardAlarmRaiser[] = {
Label(lblNearMiss) /* a guard in sight was killed/shot, heard bond or bond shot guard */
IFMyNumArghsGreaterThan(0, lblRunToObjective) /* doesn't make sense why the guard would be mildly curious about getting shot */
LookSurprised()
DO(lblWaiting) /* wait for guard to stop moving before branching to next logic (triggered by look around animation) */
DO(lblLoop)
IFImOnPatrolOrStopped(lblStoppedMoving)
/*ELSE*/
CONTINUE(lblLoop) /* Only process this script if not already running */
/********************
StoppedMoving
*********************/
Label(lblStoppedMoving) /* break loop if any condition is true */
IFISeeBond(lblRunToObjective)
IFMyNumCloseArghsGreaterThan(0, lblNearMiss)
IFIHeardBondRecently(lblNearMiss)
IFISeeSomeoneShot(lblNearMiss)
IFISeeSomeoneDie(lblNearMiss)
LOOP(lblLoop)
/*************
NearMiss
**************/
Label(lblNearMiss) /* a guard in sight was killed/shot, heard bond or bond shot guard */
IFMyNumArghsGreaterThan(0, lblRunToObjective) /* doesn't make sense why the guard would be mildly curious about getting shot */
LookSurprised()
DO(lblWaiting) /* wait for guard to stop moving before branching to next logic (triggered by look around animation) */
IFImOnPatrolOrStopped(lblRunToObjective)
LOOP(lblWaiting)
/********
RUN!
*********/
Label(lblRunToObjective)
RunToPad(PAD_PRESET1)
DO(lblNext) /* wait for guard to stop moving (reached destination/guard was shot) */
RunToPad(PAD_PRESET1)
DO(lblNext) /* wait for guard to stop moving (reached destination/guard was shot) */
IFImOnPatrolOrStopped(lblDone)
LOOP(lblNext)
/*********
DONE
**********/
Label(lblDone)
IFMyDistanceToPadGreaterThanMeter( 1, PAD_PRESET1, lblDone) /* if guard is more than 1 meter away from alarm, skip to attack ai list */
TRYTriggeringAlarmAtPad(PAD_PRESET1, lblAlarmActivated)
GotoNext(lblDone) /* didn't activate alarm (alarm destroyed?) */
DO(lblAlarmActivated) /* wait for guard to finish activating alarm */
IFMyDistanceToPadGreaterThanMeter( 1, PAD_PRESET1, lblDone) /* if guard is more than 1 meter away from alarm, skip to attack ai list */
TRYTriggeringAlarmAtPad(PAD_PRESET1, lblAlarmActivated)
GotoNext(lblDone) /* didn't activate alarm (alarm destroyed?) */
DO(lblAlarmActivated) /* wait for guard to finish activating alarm */
IFImOnPatrolOrStopped(lblDone)
LOOP(lblAlarmActivated)
/*********
DONE
**********/
Label(lblDone)
JUMPTO_THEN_GUARD( GAILIST_RUN_TO_BOND)
JUMPTO_THEN_GUARD( GAILIST_RUN_TO_BOND) /* Come Here!... Meh, Im just doing my job */
EndList()
};
@@ -517,12 +531,12 @@ u8 m_SimpleGuardAlarmRaiser[] = {
Startle character then Run To Bond
@return to caller if called with CALL -or- return to List set by SetReturnAiList - If not set will crash
*/
u8 m_StartleAndRunToBond[] = {
u8 m_StartleAndRunToBond[] = {
LookSurprised() /* trigger animation */
DO(lblLoop)
IFImOnPatrolOrStopped(lblDone) /* wait for chr to stop moving */
LOOP(lblLoop)
Label(lblDone) /* chr stopped moving */
JumpTo( GAILIST_RUN_TO_BOND)
EndList()
@@ -533,35 +547,35 @@ u8 m_StartleAndRunToBond[] = {
Persistently chase Bond and Attack (halt randomly)
@return No Return - AI List can only be changed by a 3rd party via SetChrAiList
*/
u8 m_RunToBondPersistent[] = {
u8 m_RunToBondPersistent[] = {
/*DO*/
Label(lblRun)
TRYRunToBond(lblRunning) /* goto loop if bond position is reachable */
AI_PRINT,'n','o',' ','g','o','!','\n','\0', /* guard can't reach bond */
PRINT("no go!\n") /* guard can't reach bond */
DO(lblRunning)
IFICouldSeeBond(lblStoppedMoving)
IFImOnPatrolOrStopped(lblDone)
LOOP(lblRunning)
DO(lblLoop) /*Check Hits and Stopped/Patrol State*/
IFMyNumArghsLessThan(6, lblCheckDistance2)
/*ELSE*/IFMychrflagsHas(CHRFLAG_INVINCIBLE, lblInvincibleCheck) /*BREAK*/
Label(lblCheckDistance2)
IFImOnPatrolOrStopped(lblStoppedMoving)
/*// BUG - this causes guard to shuffle about uselessly if Bond & guard are within line of sight and over 20 meters */
IFMyDistanceToBondGreaterThanMeter(20, lblNext) /* if guard is further than 20 meters away from bond, break */
LOOP(lblLoop)
Label(lblNext)
CONTINUE(lblRun)
Label(lblStoppedMoving)
IFICouldSeeBond(lblNext) /*If Not invincible, do Attack loop*/
GotoNext(lblDone) /*Goto end of Attack Switch*/
Label(lblCheckDistance)
Yield()
IFMyDistanceToBondLessThanMeter(5, lblNext) /*BREAK*/
@@ -570,25 +584,25 @@ u8 m_RunToBondPersistent[] = {
Label(lblNext)
IFMychrflagsHas(CHRFLAG_INVINCIBLE, lblInvincibleCheck) /*Check Hits, Unset flags and Loop Attack Options*/
/*DO*/
Label(lblMaybeThrowGrenade)
#if 0
IFNewRandomGreaterThan(10, lblNext)
TRYThrowingGrenade(lblDone) /* depends on chr->grenadeprob value */
Label(lblNext)
IFRandomGreaterThan(50, lblNext)
TRYSidestepping(lblDone)
Label(lblNext)
IFRandomGreaterThan(60, lblNext)
TRYFiringRoll(lblDone)
Label(lblNext)
IFRandomGreaterThan(80, lblNext)
TRYFiringRoll(lblDone)
Label(lblNext)
IFRandomGreaterThan(100, lblNext)
TRYFiringWalk(lblDone)
@@ -614,12 +628,12 @@ u8 m_RunToBondPersistent[] = {
IFRandomGreaterThan, 100,
TRYFiringRun,
IFRandomGreaterThan,80,
TRYFiringWalk,
TRYFiringWalk,
IFRandomGreaterThan,60,
TRYFiringRoll,
IFRandomGreaterThan,50,
TRYFiringRoll,
IFRandomGreaterThan,10,
IFRandomGreaterThan,10,
TRYSidestepping,
/*DEFAULT*/,,
TRYThrowingGrenade,
@@ -634,7 +648,7 @@ u8 m_RunToBondPersistent[] = {
GotoNext(lblResetAndRunAgain)
Label(lblNext)
Yield()
Yield()
GotoFirst(lblLoop) /*Check Hits and Stopped/Patrol State*/
Label(lblResetAndRunAgain)
@@ -648,7 +662,7 @@ u8 m_RunToBondPersistent[] = {
Label(lblNext)
Stop()
AI_PRINT,'w','a','i','t','\n','\0',
PRINT("wait\n")
UnsetMyFlags2(FLAGS2_04)
IFNewRandomGreaterThan(160, lblNext)
SetMyFlags2(FLAGS2_04)
@@ -660,7 +674,7 @@ u8 m_RunToBondPersistent[] = {
IFICouldSeeBond(lblNext)/*BREAK*/
IFBondMissedMe(lblNext) /*BREAK*/
Yield()
IFMyTimerLessThanSeconds(10, lblWaiting)
IFMyTimerLessThanSeconds(10, lblWaiting)
IFMyFlags2Has(FLAGS2_04, lblAlarmActivated)
GotoFirst(lblRun)
@@ -684,11 +698,11 @@ u8 m_RunToBondPersistent[] = {
};
/*D : 800373D0 */
/**
/**
Wait for one second then return
@return to caller if called with CALL -or- return to List set by SetReturnAiList - If not set will crash
*/
u8 m_WaitOneSecond[] = {
u8 m_WaitOneSecond[] = {
MyTimerStart()
DO(lblRunning)
IFMyTimerGreaterThanSeconds(1, lblNext) /* wait one second */
@@ -699,12 +713,12 @@ u8 m_WaitOneSecond[] = {
EndList()
};
/*D:800373E0*/
/*D:800373E0*/
/**
Exit level and set BG AI to nothing
@return No Return - AI is Dead
*/
u8 m_EndLevel[] = {
u8 m_EndLevel[] = {
EndLevel()
JumpTo( GAILIST_DEAD_AI)
EndList()
@@ -716,7 +730,7 @@ u8 m_EndLevel[] = {
Act like a Standard Guard thereafter
@return to Standard Guard
*/
u8 m_DrawPistolAndAttackBond[] = {
u8 m_DrawPistolAndAttackBond[] = {
SetMySpeedRating(40) /* fast boi watch out! */
SetMyAccuracyRating(50)
@@ -729,7 +743,7 @@ u8 m_DrawPistolAndAttackBond[] = {
DO(lblRunning)
IFMyTimerGreaterThanTicks(20, lblNext) /* wait 1/3 of a second */
LOOP(lblRunning)
Label(lblNext)
PlayAnimation(ANIM_fire_standing_draw_one_handed_weapon_fast,
0,
@@ -765,7 +779,7 @@ u8 m_DrawPistolAndAttackBond[] = {
Remove Calling chr and set AI to nothing
@return No Return - AI is Dead
*/
u8 m_RemoveSelf[] = {
u8 m_RemoveSelf[] = {
RemoveMeInstantly() /* remove self */
JumpTo( GAILIST_DEAD_AI)
EndList()
@@ -775,7 +789,7 @@ u8 m_RemoveSelf[] = {
/*D:8003744C */
/* global ai lists (glists) */
AIListRecord g_GlobalAILists[] = {
AIListRecord g_GlobalAILists[] = {
{m_AimAtBond , GAILIST_AIM_AT_BOND},
{m_DeadAI , GAILIST_DEAD_AI},
{m_StandardGuard , GAILIST_STANDARD_GUARD},
@@ -793,13 +807,12 @@ AIListRecord g_GlobalAILists[] = {
{m_WaitOneSecond , GAILIST_WAIT_ONE_SECOND},
{m_EndLevel , GAILIST_END_LEVEL},
{m_DrawPistolAndAttackBond , GAILIST_DRAW_TT33_AND_ATTCK_BOND},
{m_RemoveSelf , GAILIST_REMOVE_CHR}
{m_RemoveSelf , GAILIST_REMOVE_CHR},
{NULL, 0}
};
/*D:800374DC */
u32 D_800374DC[] = {0,0};
/*D:800374E4 */
/*D:800374E4 Also happens to be the same indices as levelID */
char *setup_text_pointers[] = {
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "UsetupsevbunkerZ",
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,"UsetupsiloZ",
@@ -813,4 +826,4 @@ char *setup_text_pointers[] = {
};
+365 -343
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -132,7 +132,7 @@ void chrSetChrPreset2(ChrRecord *self, s32 id, s32 id2);
void chrSetPadPreset( ChrRecord *self, s32 padid);
void chrSetPadPresetByChrnum(ChrRecord *self, s32 chrid, s32 padid);
s32 chrIsTargetNearlyInSight(ChrRecord *arg0);
bool sub_GAME_7F033F48(coord3d *pos, StandTile **arg1, f32 facing, bool b);
bool chrAdjustPosForSpawn(coord3d *pos, StandTile **arg1, f32 facing, bool b);
PropRecord *chrSpawnAtPad(ChrRecord *self, s32 bodynum, s32 headnum, s32 padid, AIListRecord *ailist, s32 flags);
PropRecord *chrSpawnAtChr(ChrRecord *self, s32 bodynum, s32 headnum, s32 chrnum, AIListRecord *ailist, s32 flags);
bool chrIfInPadRoom(ChrRecord *self, s32 chrnum, s32 padnum);
+3066 -3103
View File
File diff suppressed because it is too large Load Diff
+13 -7
View File
@@ -110,12 +110,12 @@ void trigger_remote_mine_detonation(void);
void objDetach(PropRecord *prop);
void objFreeEmbedmentOrProjectile(PropRecord *);
bool alarmIsActive();
bool alarmIsActive(void);
void init_trigger_toxic_gas_effect(coord3d *source);
void chrSetWeaponFlag4(ChrRecord *chr, GUNHAND hand);
void sub_GAME_7F053B10(DoorRecord *door);
void door7F053B10(DoorRecord *door);
void doorActivatePortal(DoorRecord *door);
void sub_GAME_7F052B00(DoorRecord *door);
void door7F052B00(DoorRecord *door);
s32 sub_GAME_7F0539B8(f32 vol);
void monitorSetImageByNum(MonitorRecord *mon, s32 monAnimID);
void propweaponSetDual(WeaponObjRecord *leftweapon, WeaponObjRecord *rightweapon);
@@ -124,21 +124,23 @@ bool countdownTimerIsRunning(void);
void countdownTimerSetRunning(bool enable);
void countdownTimerSetValue(f32 time);
void countdownTimerSetVisible(int clocklockbits, bool unset);
void sub_GAME_7F04088C(ObjectRecord *baseobj, PadRecord *pad, Mtxf *matrix, StandTile *stan, PadRecord *pad2);
void sub_GAME_7F04088C(ObjectRecord *baseobj, struct coord3d *pad, Mtxf *matrix, StandTile *stan, struct coord3d *pos2);
void sub_GAME_7F040BA0(ObjectRecord *obj, struct coord3d *pos, Mtxf *arg2, StandTile *stan2, struct coord3d *pos2);
bool chrEquipWeapon(WeaponObjRecord *wep, ChrRecord *chr);
INV_ITEM_TYPE collect_or_interact_object(PropRecord *prop, bool showstring);
INV_ITEM_TYPE propobjInteract(PropRecord *prop);
s32 objGetDestroyedLevel(ObjectRecord *obj);
void doorActivateWrapper(PropRecord *prop);
bool objIsHealthy(ObjectRecord *self);
ObjectRecord *weaponFindThrown(s32 ID);
bool check_if_toxic_gas_activated();
KeyRecord *weaponFindThrown(s32 ID);
bool check_if_toxic_gas_activated(void);
HatRecord *hatCreate(bool musthaveprop, bool musthavemodel, ModelFileHeader *modeldef);
PropRecord* objInitWithAutoModel(ObjectRecord* obj);
PropRecord* objInitWithModelDef(ObjectRecord* object, ModelFileHeader* header);
Embedment *embedmentAllocate(void);
void objDetach(PropRecord *prop);
void sub_GAME_7F043650(struct WeaponObjRecord *arg0);
s32 sub_GAME_7F0446B8(struct rect4f *arg0, s32 arg1, struct rect4f *arg2, s32 arg3);
s32 chrobjTestPolygonsTouchingOrOverlap2D(struct rect4f *arg0, s32 arg1, struct rect4f *arg2, s32 arg3);
s32 chrobjTestPointPolygonCollision(struct coord3d *arg0, f32 arg1, struct rect4f *arg2, s32 arg3);
void maybe_detonate_object_and_its_children(PropRecord *arg0, f32 arg1, struct coord3d *arg2, s32 arg3, s32 owner);
struct ModelRoData_BoundingBoxRecord* chrobjGetBboxFromObjectRecord(ObjectRecord *arg0);
@@ -147,5 +149,9 @@ s32 sub_GAME_7F03F598(coord3d* pos, f32 arg1, BoundPadRecord *boundpads);
void sub_GAME_7F0A1DA0(f32*, f32*, f32*, f32*, f32, f32, f32, f32, f32, f32);
void sub_GAME_7F03F90C(Model *model, f32 *arg1, f32 *arg2, f32 *arg3, f32 *arg4);
s32 sub_GAME_7F0448A8(struct PropRecord *arg0);
PropRecord* sub_GAME_7F051DD8(struct ObjectRecord* arg0, ModelFileHeader* arg1);
void sub_GAME_7F052030(WeaponObjRecord* arg0, ChrRecord* arg1);
void drop_inventory(void);
void sub_GAME_7F056690(void);
#endif
+674 -1568
View File
File diff suppressed because it is too large Load Diff
+13 -13
View File
@@ -7,34 +7,34 @@ void cleanupExplosions(void)
{
s32 i;
numExplosionEntries = 0;
g_NumExplosionEntries = 0;
viShake(0.0);
if (ptr_explosion_buf != NULL)
if (g_ExplosionBuffer != NULL)
{
for (i = 0; i<EXPLOSION_BUFFER_LEN; i++)
{
if (ptr_explosion_buf[i].prop != NULL)
if (g_ExplosionBuffer[i].prop != NULL)
{
chrpropDelist(ptr_explosion_buf[i].prop);
chrpropDisable(ptr_explosion_buf[i].prop);
chrpropFree(ptr_explosion_buf[i].prop);
ptr_explosion_buf[i].prop = NULL;
chrpropDelist(g_ExplosionBuffer[i].prop);
chrpropDisable(g_ExplosionBuffer[i].prop);
chrpropFree(g_ExplosionBuffer[i].prop);
g_ExplosionBuffer[i].prop = NULL;
}
}
}
if (ptr_smoke_buf != NULL)
if (g_SmokeBuffer != NULL)
{
for (i = 0; i<SMOKE_BUFFER_LEN; i++)
{
if (ptr_smoke_buf[i].prop != NULL)
if (g_SmokeBuffer[i].prop != NULL)
{
chrpropDelist(ptr_smoke_buf[i].prop);
chrpropDisable(ptr_smoke_buf[i].prop);
chrpropFree(ptr_smoke_buf[i].prop);
ptr_smoke_buf[i].prop = NULL;
chrpropDelist(g_SmokeBuffer[i].prop);
chrpropDisable(g_SmokeBuffer[i].prop);
chrpropFree(g_SmokeBuffer[i].prop);
g_SmokeBuffer[i].prop = NULL;
}
}
}
+10 -92
View File
@@ -1,99 +1,17 @@
#include <ultra64.h>
#include "chr.h"
void cleanupGuardData(void)
{
int i;
#ifdef NONMATCHING
void cleanupGuardData(void) {
void *temp_v0;
s32 temp_s2;
s32 phi_s0;
s32 phi_s2;
s32 phi_v1;
// Node 0
if (g_NumChrSlots > 0)
{
// Node 1
phi_s0 = 0;
phi_s2 = 0;
phi_v1 = g_NumChrSlots;
loop_2:
// Node 2
temp_v0 = (g_ChrSlots + phi_s0);
if (temp_v0->unk1C != 0)
{
// Node 3
disable_sounds_attached_to_player_then_something(temp_v0->unk18);
chrpropDelist((g_ChrSlots + phi_s0)->unk18);
chrpropDisable((g_ChrSlots + phi_s0)->unk18);
chrpropFree((g_ChrSlots + phi_s0)->unk18);
phi_v1 = g_NumChrSlots;
}
// Node 4
temp_s2 = (phi_s2 + 1);
phi_s0 = (phi_s0 + 0x1dc);
phi_s2 = temp_s2;
phi_v1 = phi_v1;
if (temp_s2 < phi_v1)
{
goto loop_2;
for (i = 0; i < g_NumChrSlots; i++) {
if (g_ChrSlots[i].model != 0) {
disable_sounds_attached_to_player_then_something(g_ChrSlots[i].prop);
chrpropDelist(g_ChrSlots[i].prop);
chrpropDisable(g_ChrSlots[i].prop);
chrpropFree(g_ChrSlots[i].prop);
}
}
// Node 5
return;
}
#else
GLOBAL_ASM(
.text
glabel cleanupGuardData
/* 03BEE0 7F0073B0 3C038003 */ lui $v1, %hi(g_NumChrSlots)
/* 03BEE4 7F0073B4 8C63CC68 */ lw $v1, %lo(g_NumChrSlots)($v1)
/* 03BEE8 7F0073B8 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 03BEEC 7F0073BC AFB20020 */ sw $s2, 0x20($sp)
/* 03BEF0 7F0073C0 AFBF0024 */ sw $ra, 0x24($sp)
/* 03BEF4 7F0073C4 AFB1001C */ sw $s1, 0x1c($sp)
/* 03BEF8 7F0073C8 AFB00018 */ sw $s0, 0x18($sp)
/* 03BEFC 7F0073CC 1860001D */ blez $v1, .L7F007444
/* 03BF00 7F0073D0 00009025 */ move $s2, $zero
/* 03BF04 7F0073D4 3C118003 */ lui $s1, %hi(g_ChrSlots)
/* 03BF08 7F0073D8 2631CC64 */ addiu $s1, %lo(g_ChrSlots) # addiu $s1, $s1, -0x339c
/* 03BF0C 7F0073DC 00008025 */ move $s0, $zero
.L7F0073E0:
/* 03BF10 7F0073E0 8E2E0000 */ lw $t6, ($s1)
/* 03BF14 7F0073E4 01D01021 */ addu $v0, $t6, $s0
/* 03BF18 7F0073E8 8C4F001C */ lw $t7, 0x1c($v0)
/* 03BF1C 7F0073EC 51E00012 */ beql $t7, $zero, .L7F007438
/* 03BF20 7F0073F0 26520001 */ addiu $s2, $s2, 1
/* 03BF24 7F0073F4 0FC08105 */ jal disable_sounds_attached_to_player_then_something
/* 03BF28 7F0073F8 8C440018 */ lw $a0, 0x18($v0)
/* 03BF2C 7F0073FC 8E380000 */ lw $t8, ($s1)
/* 03BF30 7F007400 0310C821 */ addu $t9, $t8, $s0
/* 03BF34 7F007404 0FC0E94E */ jal chrpropDelist
/* 03BF38 7F007408 8F240018 */ lw $a0, 0x18($t9)
/* 03BF3C 7F00740C 8E280000 */ lw $t0, ($s1)
/* 03BF40 7F007410 01104821 */ addu $t1, $t0, $s0
/* 03BF44 7F007414 0FC0E905 */ jal chrpropDisable
/* 03BF48 7F007418 8D240018 */ lw $a0, 0x18($t1)
/* 03BF4C 7F00741C 8E2A0000 */ lw $t2, ($s1)
/* 03BF50 7F007420 01505821 */ addu $t3, $t2, $s0
/* 03BF54 7F007424 0FC0E921 */ jal chrpropFree
/* 03BF58 7F007428 8D640018 */ lw $a0, 0x18($t3)
/* 03BF5C 7F00742C 3C038003 */ lui $v1, %hi(g_NumChrSlots)
/* 03BF60 7F007430 8C63CC68 */ lw $v1, %lo(g_NumChrSlots)($v1)
/* 03BF64 7F007434 26520001 */ addiu $s2, $s2, 1
.L7F007438:
/* 03BF68 7F007438 0243082A */ slt $at, $s2, $v1
/* 03BF6C 7F00743C 1420FFE8 */ bnez $at, .L7F0073E0
/* 03BF70 7F007440 261001DC */ addiu $s0, $s0, 0x1dc
.L7F007444:
/* 03BF74 7F007444 8FBF0024 */ lw $ra, 0x24($sp)
/* 03BF78 7F007448 8FB00018 */ lw $s0, 0x18($sp)
/* 03BF7C 7F00744C 8FB1001C */ lw $s1, 0x1c($sp)
/* 03BF80 7F007450 8FB20020 */ lw $s2, 0x20($sp)
/* 03BF84 7F007454 03E00008 */ jr $ra
/* 03BF88 7F007458 27BD0028 */ addiu $sp, $sp, 0x28
)
#endif
+12 -108
View File
@@ -1,113 +1,17 @@
#include <ultra64.h>
#include "bondtypes.h"
#include "objective_status.h"
void cleanupObjectives(void)
{
int i;
#ifdef NONMATCHING
void cleanupObjectives(s32 stage) {
for (i = 0; i < OBJECTIVES_MAX; i++)
{
if (objective_ptrs[i] != NULL && (objective_ptrs[i]->unkD & 1) && objectiveStatuses[i] != OBJECTIVESTATUS_FAILED)
{
objectiveStatuses[i] = OBJECTIVESTATUS_COMPLETE;
}
}
}
#else
GLOBAL_ASM(
.text
glabel cleanupObjectives
/* 03C0C0 7F007590 3C028007 */ lui $v0, %hi(objective_ptrs)
/* 03C0C4 7F007594 8C425D30 */ lw $v0, %lo(objective_ptrs)($v0)
/* 03C0C8 7F007598 3C048007 */ lui $a0, %hi(objective_ptrs+8)
/* 03C0CC 7F00759C 24845D38 */ addiu $a0, %lo(objective_ptrs+8) # addiu $a0, $a0, 0x5d38
/* 03C0D0 7F0075A0 1040000C */ beqz $v0, .L7F0075D4
/* 03C0D4 7F0075A4 24030008 */ li $v1, 8
/* 03C0D8 7F0075A8 904E000E */ lbu $t6, 0xe($v0)
/* 03C0DC 7F0075AC 3C188007 */ lui $t8, %hi(dword_CODE_bss_80075D58)
/* 03C0E0 7F0075B0 31CF0001 */ andi $t7, $t6, 1
/* 03C0E4 7F0075B4 11E00007 */ beqz $t7, .L7F0075D4
/* 03C0E8 7F0075B8 00000000 */ nop
/* 03C0EC 7F0075BC 8F185D58 */ lw $t8, %lo(dword_CODE_bss_80075D58)($t8)
/* 03C0F0 7F0075C0 24050002 */ li $a1, 2
/* 03C0F4 7F0075C4 24190001 */ li $t9, 1
/* 03C0F8 7F0075C8 10B80002 */ beq $a1, $t8, .L7F0075D4
/* 03C0FC 7F0075CC 3C018007 */ lui $at, %hi(dword_CODE_bss_80075D58)
/* 03C100 7F0075D0 AC395D58 */ sw $t9, %lo(dword_CODE_bss_80075D58)($at)
.L7F0075D4:
/* 03C104 7F0075D4 3C028007 */ lui $v0, %hi(objective_ptrs+4)
/* 03C108 7F0075D8 8C425D34 */ lw $v0, %lo(objective_ptrs+4)($v0)
/* 03C10C 7F0075DC 3C088007 */ lui $t0, %hi(dword_CODE_bss_80075D58)
/* 03C110 7F0075E0 25085D58 */ addiu $t0, %lo(dword_CODE_bss_80075D58) # addiu $t0, $t0, 0x5d58
/* 03C114 7F0075E4 1040000C */ beqz $v0, .L7F007618
/* 03C118 7F0075E8 24050002 */ li $a1, 2
/* 03C11C 7F0075EC 9049000E */ lbu $t1, 0xe($v0)
/* 03C120 7F0075F0 3C0B8007 */ lui $t3, %hi(dword_CODE_bss_80075D58+4)
/* 03C124 7F0075F4 312A0001 */ andi $t2, $t1, 1
/* 03C128 7F0075F8 11400007 */ beqz $t2, .L7F007618
/* 03C12C 7F0075FC 00000000 */ nop
/* 03C130 7F007600 8D6B5D5C */ lw $t3, %lo(dword_CODE_bss_80075D58+4)($t3)
/* 03C134 7F007604 240C0001 */ li $t4, 1
/* 03C138 7F007608 3C018007 */ lui $at, %hi(dword_CODE_bss_80075D58+4)
/* 03C13C 7F00760C 10AB0002 */ beq $a1, $t3, .L7F007618
/* 03C140 7F007610 00000000 */ nop
/* 03C144 7F007614 AC2C5D5C */ sw $t4, %lo(dword_CODE_bss_80075D58+4)($at)
.L7F007618:
/* 03C148 7F007618 3C068007 */ lui $a2, %hi(dword_CODE_bss_80075D58)
/* 03C14C 7F00761C 24C65D58 */ addiu $a2, %lo(dword_CODE_bss_80075D58) # addiu $a2, $a2, 0x5d58
/* 03C150 7F007620 24070001 */ li $a3, 1
.L7F007624:
/* 03C154 7F007624 8C820000 */ lw $v0, ($a0)
/* 03C158 7F007628 5040000B */ beql $v0, $zero, .L7F007658
/* 03C15C 7F00762C 8C820004 */ lw $v0, 4($a0)
/* 03C160 7F007630 904D000E */ lbu $t5, 0xe($v0)
/* 03C164 7F007634 00C31021 */ addu $v0, $a2, $v1
/* 03C168 7F007638 31AE0001 */ andi $t6, $t5, 1
/* 03C16C 7F00763C 51C00006 */ beql $t6, $zero, .L7F007658
/* 03C170 7F007640 8C820004 */ lw $v0, 4($a0)
/* 03C174 7F007644 8C4F0000 */ lw $t7, ($v0)
/* 03C178 7F007648 50AF0003 */ beql $a1, $t7, .L7F007658
/* 03C17C 7F00764C 8C820004 */ lw $v0, 4($a0)
/* 03C180 7F007650 AC470000 */ sw $a3, ($v0)
/* 03C184 7F007654 8C820004 */ lw $v0, 4($a0)
.L7F007658:
/* 03C188 7F007658 5040000B */ beql $v0, $zero, .L7F007688
/* 03C18C 7F00765C 8C820008 */ lw $v0, 8($a0)
/* 03C190 7F007660 9058000E */ lbu $t8, 0xe($v0)
/* 03C194 7F007664 00C31021 */ addu $v0, $a2, $v1
/* 03C198 7F007668 33190001 */ andi $t9, $t8, 1
/* 03C19C 7F00766C 53200006 */ beql $t9, $zero, .L7F007688
/* 03C1A0 7F007670 8C820008 */ lw $v0, 8($a0)
/* 03C1A4 7F007674 8C490004 */ lw $t1, 4($v0)
/* 03C1A8 7F007678 50A90003 */ beql $a1, $t1, .L7F007688
/* 03C1AC 7F00767C 8C820008 */ lw $v0, 8($a0)
/* 03C1B0 7F007680 AC470004 */ sw $a3, 4($v0)
/* 03C1B4 7F007684 8C820008 */ lw $v0, 8($a0)
.L7F007688:
/* 03C1B8 7F007688 5040000B */ beql $v0, $zero, .L7F0076B8
/* 03C1BC 7F00768C 8C82000C */ lw $v0, 0xc($a0)
/* 03C1C0 7F007690 904A000E */ lbu $t2, 0xe($v0)
/* 03C1C4 7F007694 00C31021 */ addu $v0, $a2, $v1
/* 03C1C8 7F007698 314B0001 */ andi $t3, $t2, 1
/* 03C1CC 7F00769C 51600006 */ beql $t3, $zero, .L7F0076B8
/* 03C1D0 7F0076A0 8C82000C */ lw $v0, 0xc($a0)
/* 03C1D4 7F0076A4 8C4C0008 */ lw $t4, 8($v0)
/* 03C1D8 7F0076A8 50AC0003 */ beql $a1, $t4, .L7F0076B8
/* 03C1DC 7F0076AC 8C82000C */ lw $v0, 0xc($a0)
/* 03C1E0 7F0076B0 AC470008 */ sw $a3, 8($v0)
/* 03C1E4 7F0076B4 8C82000C */ lw $v0, 0xc($a0)
.L7F0076B8:
/* 03C1E8 7F0076B8 24840010 */ addiu $a0, $a0, 0x10
/* 03C1EC 7F0076BC 1040000A */ beqz $v0, .L7F0076E8
/* 03C1F0 7F0076C0 00000000 */ nop
/* 03C1F4 7F0076C4 904D000E */ lbu $t5, 0xe($v0)
/* 03C1F8 7F0076C8 00C31021 */ addu $v0, $a2, $v1
/* 03C1FC 7F0076CC 31AE0001 */ andi $t6, $t5, 1
/* 03C200 7F0076D0 11C00005 */ beqz $t6, .L7F0076E8
/* 03C204 7F0076D4 00000000 */ nop
/* 03C208 7F0076D8 8C4F000C */ lw $t7, 0xc($v0)
/* 03C20C 7F0076DC 10AF0002 */ beq $a1, $t7, .L7F0076E8
/* 03C210 7F0076E0 00000000 */ nop
/* 03C214 7F0076E4 AC47000C */ sw $a3, 0xc($v0)
.L7F0076E8:
/* 03C218 7F0076E8 1488FFCE */ bne $a0, $t0, .L7F007624
/* 03C21C 7F0076EC 24630010 */ addiu $v1, $v1, 0x10
/* 03C220 7F0076F0 03E00008 */ jr $ra
/* 03C224 7F0076F4 00000000 */ nop
)
#endif
+57 -138
View File
@@ -2,157 +2,76 @@
#include <bondtypes.h>
#include "chrai.h"
#include "chrobjhandler.h"
#include "cleanup_objects.h"
#include "loadobjectmodel.h"
#ifdef NONMATCHING
/**
* decomp status:
* - compiles: yes
* - stack resize: ok
* - identical instructions: fail
* - identical registers: fail
*
* notes: something wrong with the comparison to 0x38. Also the first compare to NULL is wrong.
*/
void cleanupObjects(s32 stage)
{
object_standard *obj = g_CurrentSetup.propDefs;
if (obj != NULL)
u32 *obj = (u32)g_CurrentSetup.propDefs;
if (obj)
{
for (; obj->type != 0x30;)
while ((u8)obj[0] != PROPDEF_END)
{
switch (obj->type)
switch ((u8)obj[0])
{
case 1:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 10:
case 11:
case 12:
case 13:
case 17:
case 20:
case 21:
case 36:
case 39:
case 40:
case 41:
case 42:
case 43:
case 45:
case 47:
case PROPDEF_DOOR:
case PROPDEF_PROP:
case PROPDEF_KEY:
case PROPDEF_ALARM:
case PROPDEF_CCTV:
case PROPDEF_MAGAZINE:
case PROPDEF_COLLECTABLE:
case PROPDEF_MONITOR:
case PROPDEF_MULTI_MONITOR:
case PROPDEF_RACK:
case PROPDEF_AUTOGUN:
case PROPDEF_HAT:
case PROPDEF_AMMO:
case PROPDEF_ARMOUR:
case PROPDEF_GAS_RELEASING:
case PROPDEF_VEHICHLE:
case PROPDEF_AIRCRAFT:
case PROPDEF_UNK41:
case PROPDEF_GLASS:
case PROPDEF_SAFE:
case PROPDEF_TANK:
case PROPDEF_TINTED_GLASS:
objFreePermanently((ObjectRecord *)obj, 1);
break;
case PROPDEF_DOOR_SCALE:
case PROPDEF_GUARD:
case PROPDEF_LINK:
case PROPDEF_DEBRIS:
case PROPDEF_UNK16:
case PROPDEF_GUARD_ATTRIBUTE:
case PROPDEF_SWITCH:
case PROPDEF_TAG:
case PROPDEF_OBJECTIVE_START:
case PROPDEF_OBJECTIVE_END:
case PROPDEF_OBJECTIVE_DESTROY_OBJECT:
case PROPDEF_OBJECTIVE_COMPLETE_CONDITION:
case PROPDEF_OBJECTIVE_FAIL_CONDITION:
case PROPDEF_OBJECTIVE_COLLECT_OBJECT:
case PROPDEF_OBJECTIVE_DEPOSIT_OBJECT:
case PROPDEF_OBJECTIVE_PHOTOGRAPH:
case PROPDEF_OBJECTIVE_NULL:
case PROPDEF_OBJECTIVE_ENTER_ROOM:
case PROPDEF_OBJECTIVE_DEPOSIT_OBJECT_IN_ROOM:
case PROPDEF_OBJECTIVE_COPY_ITEM:
case PROPDEF_WATCH_MENU_OBJECTIVE_TEXT:
case PROPDEF_RENAME:
case PROPDEF_LOCK_DOOR:
case PROPDEF_SAFE_ITEM:
case PROPDEF_CAMERAPOS:
break;
}
obj = &(((s32*)obj)[sizepropdef(obj)]);
obj = obj + sizepropdef(obj) ;
}
}
}
#else
GLOBAL_ASM(
.rdata
glabel jpt_8004F210
.word .L7F007550
.word .L7F00755C
.word .L7F007550
.word .L7F007550
.word .L7F007550
.word .L7F007550
.word .L7F007550
.word .L7F007550
.word .L7F00755C
.word .L7F007550
.word .L7F007550
.word .L7F007550
.word .L7F007550
.word .L7F00755C
.word .L7F00755C
.word .L7F00755C
.word .L7F007550
.word .L7F00755C
.word .L7F00755C
.word .L7F007550
.word .L7F007550
.word .L7F00755C
.word .L7F00755C
.word .L7F00755C
.word .L7F00755C
.word .L7F00755C
.word .L7F00755C
.word .L7F00755C
.word .L7F00755C
.word .L7F00755C
.word .L7F00755C
.word .L7F00755C
.word .L7F00755C
.word .L7F00755C
.word .L7F00755C
.word .L7F007550
.word .L7F00755C
.word .L7F00755C
.word .L7F007550
.word .L7F007550
.word .L7F007550
.word .L7F007550
.word .L7F007550
.word .L7F00755C
.word .L7F007550
.word .L7F00755C
.word .L7F007550
.text
glabel cleanupObjects
/* 03C030 7F007500 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 03C034 7F007504 AFB00018 */ sw $s0, 0x18($sp)
/* 03C038 7F007508 3C108007 */ lui $s0, %hi(g_CurrentSetup+0x0c)
/* 03C03C 7F00750C 8E105D0C */ lw $s0, %lo(g_CurrentSetup+0x0c)($s0)
/* 03C040 7F007510 AFBF001C */ sw $ra, 0x1c($sp)
/* 03C044 7F007514 AFA40020 */ sw $a0, 0x20($sp)
/* 03C048 7F007518 52000019 */ beql $s0, $zero, .L7F007580
/* 03C04C 7F00751C 8FBF001C */ lw $ra, 0x1c($sp)
/* 03C050 7F007520 92030003 */ lbu $v1, 3($s0)
/* 03C054 7F007524 24010030 */ li $at, 48
/* 03C058 7F007528 10610014 */ beq $v1, $at, .L7F00757C
/* 03C05C 7F00752C 246EFFFF */ addiu $t6, $v1, -1
.L7F007530:
/* 03C060 7F007530 2DC1002F */ sltiu $at, $t6, 0x2f
/* 03C064 7F007534 10200009 */ beqz $at, .L7F00755C
/* 03C068 7F007538 000E7080 */ sll $t6, $t6, 2
/* 03C06C 7F00753C 3C018005 */ lui $at, %hi(jpt_8004F210)
/* 03C070 7F007540 002E0821 */ addu $at, $at, $t6
/* 03C074 7F007544 8C2EF210 */ lw $t6, %lo(jpt_8004F210)($at)
/* 03C078 7F007548 01C00008 */ jr $t6
/* 03C07C 7F00754C 00000000 */ nop
.L7F007550:
/* 03C080 7F007550 02002025 */ move $a0, $s0
/* 03C084 7F007554 0FC10409 */ jal objFreePermanently
/* 03C088 7F007558 24050001 */ li $a1, 1
.L7F00755C:
/* 03C08C 7F00755C 0FC15A3D */ jal sizepropdef
/* 03C090 7F007560 02002025 */ move $a0, $s0
/* 03C094 7F007564 00027880 */ sll $t7, $v0, 2
/* 03C098 7F007568 01F08021 */ addu $s0, $t7, $s0
/* 03C09C 7F00756C 92030003 */ lbu $v1, 3($s0)
/* 03C0A0 7F007570 24010030 */ li $at, 48
/* 03C0A4 7F007574 5461FFEE */ bnel $v1, $at, .L7F007530
/* 03C0A8 7F007578 246EFFFF */ addiu $t6, $v1, -1
.L7F00757C:
/* 03C0AC 7F00757C 8FBF001C */ lw $ra, 0x1c($sp)
.L7F007580:
/* 03C0B0 7F007580 8FB00018 */ lw $s0, 0x18($sp)
/* 03C0B4 7F007584 27BD0020 */ addiu $sp, $sp, 0x20
/* 03C0B8 7F007588 03E00008 */ jr $ra
/* 03C0BC 7F00758C 00000000 */ nop
)
#endif
+5
View File
@@ -146,7 +146,12 @@ void debug_weapon_load_table(void)
for (i = 0; tmp.array[i] >= 0; i++)
{
/*if(*/
modelLoad(tmp.array[i]);
/*){break;}*/
if (1);
#ifdef DEBUG
osSyncPrintf("loaded weapon obj=%d", tmp.array[i]);
#endif
}
}
+30 -8
View File
@@ -39,6 +39,9 @@ void nullsub_32(void) {
#endif
/*
* Address: 0x7f08fe08
*/
void debmenuSetScaleIndex(s32 param_1) {
#if defined(LEFTOVERDEBUG)
g_DMenuScaleIndex = param_1;
@@ -46,7 +49,9 @@ void debmenuSetScaleIndex(s32 param_1) {
}
/*
* Address: 0x7f08fe14
*/
void debmenuSetMenu(char **labels, s32 (*positions)[2], s32 *offsets)
{
#if defined(LEFTOVERDEBUG)
@@ -63,7 +68,9 @@ void debmenuSetMenu(char **labels, s32 (*positions)[2], s32 *offsets)
#endif
}
/*
* Address: 0x7f08fe74
*/
Gfx *debugmenuRender(Gfx *gdl)
{
#if defined (LEFTOVERDEBUG)
@@ -86,7 +93,9 @@ Gfx *debugmenuRender(Gfx *gdl)
return gdl;
}
/*
* Address: 0x7f09000c
*/
void sub_GAME_7F09000C(int a0,int a1,int a2)
{
#if defined (LEFTOVERDEBUG)
@@ -110,7 +119,9 @@ void sub_GAME_7F09000C(int a0,int a1,int a2)
/*
* Address: 0x7f0901b0
*/
s32 get_highlighted_debug_option(void) {
#if defined(LEFTOVERDEBUG)
return g_DMenuSelectedOption;
@@ -119,14 +130,18 @@ s32 get_highlighted_debug_option(void) {
#endif
}
/*
* Address: 0x7f0901bc
*/
void set_highlighted_debug_option(s32 value) {
#if defined(LEFTOVERDEBUG)
g_DMenuSelectedOption = value;
#endif
}
/*
* Address: 0x7f0901c8
*/
void gotoAboveDebugOption(void)
{
#if defined(LEFTOVERDEBUG)
@@ -152,7 +167,9 @@ void gotoAboveDebugOption(void)
#endif
}
/*
* Address: 0x7f090248
*/
void gotoBelowDebugOption(void)
{
#if defined(LEFTOVERDEBUG)
@@ -181,6 +198,9 @@ void gotoBelowDebugOption(void)
/*
* Address: 0x7f0902c0
*/
#if defined(LEFTOVERDEBUG)
void gotoRightDebugOption(void)
{
@@ -233,7 +253,9 @@ void gotoRightDebugOption(void)
#endif
/*
* Address: 0x7f09039c
*/
#if defined(LEFTOVERDEBUG)
void gotoLeftDebugOption(void)
{
+132 -114
View File
@@ -194,13 +194,13 @@ char *mcm_strings[] = {
};
//D:80036F64
s32 debug_render_raster = 2;
s32 debug_render_raster = DEB_BOND_VIEW;
//D:80036F68
s32 debug_freeze_processing = 2;
s32 debug_freeze_processing = DEB_BOND_VIEW;
//D:80036F6C
s32 g_DebugMode = 2;
s32 g_DebugMode = DEB_BOND_VIEW;
//D:80036F70
s32 g_DebugHighlightedOption = 2;
s32 g_DebugHighlightedOption = DEB_BOND_VIEW;
//D:80036F74
s32 memusage_display_flag = FALSE;
//D:80036F78
@@ -304,6 +304,9 @@ coord3d player_pos_x = {0};
#endif
/*
* Address: 0x7f090490
*/
void debugmenuUpdate(void)
{
#if defined(LEFTOVERDEBUG)
@@ -312,15 +315,21 @@ void debugmenuUpdate(void)
}
#if defined(LEFTOVERDEBUG)
/*
* Address: 0x7f0904c4
*/
void debmenuHandleMoveView(void)
{
sub_GAME_7F0916F4();
resetDebugCameraToPlayerPosition();
g_DebugHighlightedOption = get_highlighted_debug_option();
debug_render_raster = debug_freeze_processing = g_DebugHighlightedOption;
}
#endif
#if defined(LEFTOVERDEBUG)
/*
* Address: 0x7f090508
*/
void debmenuHandleStanView(void)
{
maybe_solo_intro_camera_handler();
@@ -330,6 +339,9 @@ void debmenuHandleStanView(void)
#endif
#if defined(LEFTOVERDEBUG)
/*
* Address: 0x7f09054c
*/
void debmenuHandleBondView(void)
{
maybe_solo_intro_camera_handler();
@@ -339,12 +351,18 @@ void debmenuHandleBondView(void)
#endif
#if defined(LEFTOVERDEBUG)
/*
* Address: 0x7f090590
*/
void removed_do_debug_profile_flag_false(void) {
return;
}
#endif
#if defined(LEFTOVERDEBUG)
/*
* Address: 0x7f090598
*/
void removed_do_debug_profile_flag_true(void) {
return;
}
@@ -444,124 +462,124 @@ s32 debug_menu_processor(s8 stick_h, s8 stick_v, u16 button_held, u16 button_pre
{
switch (get_highlighted_debug_option()) {
case 0: // move view
case DEB_MOVE_VIEW: // move view
debmenuHandleMoveView();
break;
case 1: // stan view
case DEB_STAN_VIEW: // stan view
debmenuHandleStanView();
break;
case 2: // bond view
case DEB_BOND_VIEW: // bond view
debmenuHandleBondView();
break;
case 3: // level
case DEB_LEVEL: // level
g_DebugHighlightedOption = get_highlighted_debug_option();
break;
case 4: // region
case DEB_REGION: // region
g_DebugHighlightedOption = get_highlighted_debug_option();
break;
case 5: // scale
case DEB_SCALE: // scale
g_DebugHighlightedOption = get_highlighted_debug_option();
break;
case 8: // select anim
case DEB_SELANIM: // select anim
g_DebugHighlightedOption = get_highlighted_debug_option();
break;
case 9: // gun pos
case DEB_GUNPOS: // gun pos
g_DebugHighlightedOption = get_highlighted_debug_option();
break;
case 10: // flash colour
case DEB_FLASHCOLOR: // flash colour
g_DebugHighlightedOption = get_highlighted_debug_option();
break;
case 11: // hit colour
case DEB_HITCOLOR: // hit colour
g_DebugHighlightedOption = get_highlighted_debug_option();
break;
#ifdef XBLADEBUG
case 50: //marg top
case DEB_MARGTOP: //marg top
/*
printf("Margins: %5.2f.0F %5.2f.0F %5.2f.0F %5.2f.0F\n",
Function_82395958(1.0,0.0,0),
Function_82395958(1.0,(((button_pressed & 1) >> 5 & 1 ^ 1) - ((button_pressed & 2) >> 5 & 1 ^ 1)) * 4.0,1),
Function_82395958(1.0,0.0,2),
Function_82395958(1.0,0.0,3));
bgTimesAddViewRelatedMaybe(1.0,0.0,0),
bgTimesAddViewRelatedMaybe(1.0,(((button_pressed & 1) >> 5 & 1 ^ 1) - ((button_pressed & 2) >> 5 & 1 ^ 1)) * 4.0,1),
bgTimesAddViewRelatedMaybe(1.0,0.0,2),
bgTimesAddViewRelatedMaybe(1.0,0.0,3));
//*/
case 51: //marg bot
case DEB_MARGBOT: //marg bot
/*
printf("Margins: %5.2f.0F %5.2f.0F %5.2f.0F %5.2f.0F\n",
Function_82395958(1.0,0.0,0),
Function_82395958(1.0,0.0,1),
Function_82395958(1.0,0.0,2),
Function_82395958(1.0,(((button_pressed & 1) >> 5 & 1 ^ 1) - ((button_pressed & 2) >> 5 & 1 ^ 1)) * 4.0,3));
bgTimesAddViewRelatedMaybe(1.0,0.0,0),
bgTimesAddViewRelatedMaybe(1.0,0.0,1),
bgTimesAddViewRelatedMaybe(1.0,0.0,2),
bgTimesAddViewRelatedMaybe(1.0,(((button_pressed & 1) >> 5 & 1 ^ 1) - ((button_pressed & 2) >> 5 & 1 ^ 1)) * 4.0,3));
//*/
case 52: //marg left
case DEB_MARGLEFT: //marg left
/*
printf("Margins: %5.2f.0F %5.2f.0F %5.2f.0F %5.2f.0F\n",
Function_82395958(1.0,(((button_pressed & 1) >> 5 & 1 ^ 1) - ((button_pressed & 2) >> 5 & 1 ^ 1)) * 4.0,0),
Function_82395958(1.0,0.0,1),
Function_82395958(1.0,0.0,2),
Function_82395958(1.0,0.0,3));
bgTimesAddViewRelatedMaybe(1.0,(((button_pressed & 1) >> 5 & 1 ^ 1) - ((button_pressed & 2) >> 5 & 1 ^ 1)) * 4.0,0),
bgTimesAddViewRelatedMaybe(1.0,0.0,1),
bgTimesAddViewRelatedMaybe(1.0,0.0,2),
bgTimesAddViewRelatedMaybe(1.0,0.0,3));
//*/
case 53: //marg right
case DEB_MARGRIGHT: //marg right
/*
printf("Margins: %5.2f.0F %5.2f.0F %5.2f.0F %5.2f.0F\n",
Function_82395958(1.0,0.0,0),
Function_82395958(1.0,0.0,1),
Function_82395958(1.0,(((button_pressed & 1) >> 5 & 1 ^ 1) - ((button_pressed & 2) >> 5 & 1 ^ 1)) * 4.0,2),
Function_82395958(1.0,0.0,3));
bgTimesAddViewRelatedMaybe(1.0,0.0,0),
bgTimesAddViewRelatedMaybe(1.0,0.0,1),
bgTimesAddViewRelatedMaybe(1.0,(((button_pressed & 1) >> 5 & 1 ^ 1) - ((button_pressed & 2) >> 5 & 1 ^ 1)) * 4.0,2),
bgTimesAddViewRelatedMaybe(1.0,0.0,3));
//*/
case 54: //marg reset
case DEB_MARGRESET: //marg reset
/*
printf("Margins: %5.2f.0F %5.2f.0F %5.2f.0F %5.2f.0F\n",
Function_82395958(1.0,0.0,0),
Function_82395958(1.0,0.0,1),
Function_82395958(1.0,0.0,2),
Function_82395958(1.0,0.0,3));
bgTimesAddViewRelatedMaybe(1.0,0.0,0),
bgTimesAddViewRelatedMaybe(1.0,0.0,1),
bgTimesAddViewRelatedMaybe(1.0,0.0,2),
bgTimesAddViewRelatedMaybe(1.0,0.0,3));
//*/
break;
#endif
case 55: // screen size
case DEB_SCREENSIZE: // screen size
g_DebugHighlightedOption = get_highlighted_debug_option();
break;
case 56: // screen pos
case DEB_SCREENPOS: // screen pos
g_DebugHighlightedOption = get_highlighted_debug_option();
break;
case 12: // music
case DEB_MUSIC: // music
g_DebugHighlightedOption = get_highlighted_debug_option();
break;
case 26: // port close
case 27: // port inf
case 28: // port approx
case DEB_PORTCLOSE: // port close
case DEB_PORT_INF: // port inf
case DEB_PORT_APPROX: // port approx
debug_portal_flag ^= 1;
break;
case 13: // sfx
case DEB_SFX: // sfx
g_DebugHighlightedOption = get_highlighted_debug_option();
break;
case 14: // invincible
case DEB_INVINCIBLE: // invincible
set_bondata_invincible_flag(get_bondata_invincible_flag() == 0);
break;
case 15: // visible
case DEB_VISIBILE: // visible
bondviewSetVisibleToGuardsFlag(bondviewGetVisibleToGuardsFlag() == 0);
break;
case 16: // collisions
set_obj_collision_flag(get_obj_collision_flag() == 0);
case DEB_COLLISIONS: // collisions
set_obj_collision_flag(get_obj_collision_flag() == FALSE);
break;
case 17: // all guns
case DEB_ALLGUNS: // all guns
{
for (i1 = 0; i1 < getPlayerCount(); i1++)
{
@@ -571,7 +589,7 @@ s32 debug_menu_processor(s8 stick_h, s8 stick_v, u16 button_held, u16 button_pre
break;
}
case 18: // max ammo
case DEB_MAXAMMO: // max ammo
{
sp54 = get_cur_playernum();
for (i2 = 0; i2 < getPlayerCount(); i2++)
@@ -583,7 +601,7 @@ s32 debug_menu_processor(s8 stick_h, s8 stick_v, u16 button_held, u16 button_pre
break;
}
case 19: // display speed
case DEB_DISPSPEED: // display speed
memusage_display_flag ^= 1;
if (memusage_display_flag == 0)
{
@@ -591,148 +609,148 @@ s32 debug_menu_processor(s8 stick_h, s8 stick_v, u16 button_held, u16 button_pre
}
break;
case 20: // background
case DEB_BG: // background
debug_do_draw_bg ^= 1;
break;
case 21: // props
case DEB_PROPS: // props
debug_do_draw_obj ^= 1;
break;
case 22: // stan hit
case DEB_STANHIT: // stan hit
debug_stanhit_flag ^= 1;
break;
case 23: // stan region
case DEB_STANREGION: // stan region
debug_stanregion_flag ^= 1;
break;
case 24: // stan problems
case DEB_STANPROBLEMS: // stan problems
debug_stan_problems_flag ^= 1;
break;
case 25: // print man pos
case DEB_PRTMANPOS: // print man pos
debug_man_pos_flag ^= 1;
break;
case 75: // testing man pos
case DEB_TESTINGMANPOS: // testing man pos
g_DebugManPos ^= 1;
break;
case 6: // play title
case DEB_PLAYTITLE: // play title
bossSetLoadedStage(LEVELID_TITLE);
break;
case 7: // bond die
case DEB_BONDDIE: // bond die
bondviewKillCurrentPlayer();
break;
case 29: // pr room loads
case DEB_PRROOMLOADS: // pr room loads
debug_prroomloads_flag ^= 1;
break;
case 30: // show mem use
case DEB_SHOWMEMUSE: // show mem use
bossEnableShowMemUseFlag();
break;
case 31: // show mem bars
case DEB_SHOWMEMBARS: // show mem bars
bossMemBarsFlagToggle();
break;
case 32: // grab rgb
case DEB_GRABRGB: // grab rgb
pscreehshotFlagRgb->flag = 1;
osViBlack(1);
viSetColorMode32Bit();
break;
case 33: // grab jpeg
case DEB_GRABJPG: // grab jpeg
pscreehshotFlagJpg->flag = 1;
osViBlack(1);
viSetColorMode32Bit();
break;
case 34: // grab task
case DEB_TASKGRAB: // grab task
debug_enable_taskgrab_flag ^= 1;
break;
case 35: //rnd walk
case DEB_RNDWALK: //rnd walk
break;
case 36: // record ramrom
case DEB_RECRAMROM: // record ramrom
setRamRomRecordSlot(0);
break;
case 37: // record 1
case DEB_RECORD1: // record 1
setRamRomRecordSlot(1);
break;
case 38: // record 2
case DEB_RECORD2: // record 2
setRamRomRecordSlot(2);
break;
case 39: // record 3
case DEB_RECORD3: // record 3
setRamRomRecordSlot(3);
break;
case 40: // replay ramrom
case DEB_REPLAYRAMROM: // replay ramrom
replay_recorded_ramrom_from_indy();
break;
case 41: // save ramrom
case DEB_SAVERAMROM: // save ramrom
save_ramrom_to_devtool();
break;
case 42: // load ramrom
case DEB_LOADRAMROM: // load ramrom
load_ramrom_from_devtool();
break;
case 43: // auto y aim
case DEB_AUTOAIMY: // auto y aim
set_BONDdata_autoaim_y(get_BONDdata_autoaim_y() == 0);
break;
case 44: // auto x aim
case DEB_AUTOAIMX: // auto x aim
set_BONDdata_autoaim_x(get_BONDdata_autoaim_x() == 0);
break;
case 45: // 007
case DEB_007: // 007
debug_007_unlock_flag ^= 1;
break;
case 46: // agent
case DEB_AGENT: // agent
debug_enable_agent_levels_flag ^= 1;
break;
case 47: // all
case DEB_ALL: // all
debug_enable_all_levels_flag ^= 1;
break;
case 48: // fast
case DEB_FAST: // fast
debug_fast_bond_flag ^= 1;
break;
case 49: // objectives
case DEB_OBJECTIVES: // objectives
debug_all_obj_complete_flag ^= 1;
break;
case 57: // show patrols
set_show_patrols_flag(get_show_patrols_flag() == 0);
case DEB_SHOWPATROLS: // show patrols
set_show_patrols_flag(get_show_patrols_flag() == FALSE);
break;
case 58: // intro
set_camera_mode(CAMERAMODE_SWIRL);
case DEB_INTRO: // intro
bondviewSetCameraMode(CAMERAMODE_SWIRL);
break;
case 60: // intro pos
if (debug_render_raster == 0)
case DEB_INTRO_POS: // intro pos
if (debug_render_raster == DEB_MOVE_VIEW)
{
handle_debug_intropos();
initializeDebugCameraPosition();
}
break;
case 61: // world pos
if (debug_render_raster == 0)
case DEB_WORLD_POS: // world pos
if (debug_render_raster == DEB_MOVE_VIEW)
{
debugSetWorldPos();
updateDebugCameraWorldPosition();
}
else
{
@@ -765,51 +783,51 @@ s32 debug_menu_processor(s8 stick_h, s8 stick_v, u16 button_held, u16 button_pre
}
break;
case 62: // gun key pos
case DEB_GUNKEYPOS: // gun key pos
g_DebugHighlightedOption = get_highlighted_debug_option();
break;
case 64: // chr num
case DEB_CHRNUM: // chr num
debug_chrnum_flag ^= 1;
break;
case 63: // vis cvg
case DEB_VISCVG: // vis cvg
debug_VisCVG_flag ^= 1;
break;
case 69: // joy2 sky edit
case DEB_JOY2SKYEDIT: // joy2 sky edit
debug_joy2skyedit_flag ^= 1;
break;
case 70: // joy2 hits edit
case DEB_JOY2HITSEDIT: // joy2 hits edit
debug_joy2hitsedit_flag ^= 1;
break;
case 71: // joy2 detail edit
case DEB_JOY2DETAILEDIT: // joy2 detail edit
debug_joy2detailedit_flag ^= 1;
break;
case 72: // explosion info
case DEB_EXPLOSIONINFO: // explosion info
debug_explosioninfo_flag ^= 1;
break;
case 73: // magic fog
case DEB_MAGICFOG: // magic fog
g_DebugHighlightedOption = get_highlighted_debug_option();
break;
case 76: // fog
case DEB_FOG: // fog
g_DebugHighlightedOption = get_highlighted_debug_option();
break;
case 74: // gun watch pos
case DEB_GUNWATCHPOS: // gun watch pos
debug_gunwatchpos_flags ^= 1;
break;
case 65: // room blocks
case DEB_ROOMBLOCKS: // room blocks
removed_debug_roomblocks_feature();
break;
case 66: // profile
case DEB_PROFILE: // profile
{
debug_profile_flag ^= 1;
if (debug_profile_flag)
@@ -823,15 +841,15 @@ s32 debug_menu_processor(s8 stick_h, s8 stick_v, u16 button_held, u16 button_pre
break;
}
case 67: // obj load
case DEB_OBJLOAD: // obj load
debug_object_load_all_models();
break;
case 68: // weapon load
case DEB_WEAPONLOAD: // weapon load
debug_weapon_load_table();
break;
case 59: // intro edit
case DEB_INTRO_EDIT: // intro edit
g_DebugHighlightedOption = get_highlighted_debug_option();
break;
}
@@ -841,11 +859,11 @@ s32 debug_menu_processor(s8 stick_h, s8 stick_v, u16 button_held, u16 button_pre
{
switch (get_highlighted_debug_option()) // switch 2; jump table: jpt_80055830
{
case 50: // marg top
case 51: // marg bot
case 52: // marg left
case 53: // marg right
case 54: // marg reset
case DEB_MARGTOP: // marg top
case DEB_MARGBOT: // marg bot
case DEB_MARGLEFT: // marg left
case DEB_MARGRIGHT: // marg right
case DEB_MARGRESET: // marg reset
break;
}
}
+2 -2
View File
@@ -53,11 +53,11 @@ void dynInitMemory(void) {
g_VtxSizesByPlayerCount[getPlayerCount() - 1] = strtol(tokenFind(1, "-mvtx"), NULL, 0) * 1024;
}
g_GfxBuffers[0] = mempAllocBytesInBank(g_GfxSizesByPlayerCount[getPlayerCount() - 1] * 2, 4);
g_GfxBuffers[0] = mempAllocBytesInBank(g_GfxSizesByPlayerCount[getPlayerCount() - 1] * 2, MEMPOOL_STAGE);
g_GfxBuffers[1] = (g_GfxBuffers[0] + g_GfxSizesByPlayerCount[getPlayerCount() - 1]);
g_GfxBuffers[2] = (g_GfxBuffers[1] + g_GfxSizesByPlayerCount[getPlayerCount() - 1]);
g_VtxBuffers[0] = mempAllocBytesInBank(g_VtxSizesByPlayerCount[getPlayerCount() - 1] * 2, 4);
g_VtxBuffers[0] = mempAllocBytesInBank(g_VtxSizesByPlayerCount[getPlayerCount() - 1] * 2, MEMPOOL_STAGE);
g_VtxBuffers[1] = (g_VtxBuffers[0] + g_VtxSizesByPlayerCount[getPlayerCount() - 1]);
g_VtxBuffers[2] = (g_VtxBuffers[1] + g_VtxSizesByPlayerCount[getPlayerCount() - 1]);
+1 -1
View File
@@ -31,4 +31,4 @@ void init_ejected_cartridges(void) {
fileLoad(ejected_cartridge[i].header, ejected_cartridge[i].text);
i++;
}
}
}
+1725 -5143
View File
File diff suppressed because it is too large Load Diff
+77 -137
View File
@@ -3,11 +3,16 @@
#include <ultra64.h>
#include <bondtypes.h>
// Not sure what this was originally, but it looks like there was a multiplier
// applied that compiler factors out.
#define EXPLOSION_DAMAGE_SCALER 1.0f
#define EXPLOSION_BUFFER_LEN 6
#define EXPLOSION_PARTS_LEN 40
#define SMOKE_BUFFER_LEN 20
#define SMOKE_PARTS_LEN 10
#define SCORCH_BUFFER_LEN 20
#define IMPACT_TYPE_LEN 20
#define BULLET_IMPACT_BUFFER_LEN 100
#define MAX_FLYING_PARTICLES 200
@@ -34,10 +39,10 @@ typedef struct s_explosiontype {
f32 explosion_size;
f32 explosion_range;
f32 dmg_range;
u16 duration;
u16 propagationrate;
s16 duration;
s16 propagationrate;
f32 flareanimspeed;
u16 numshrapnelbits;
s16 numshrapnelbits;
//u16 field_0x26;
f32 shrapnel_size;
f32 shrapnel_scatter_dist;
@@ -60,189 +65,124 @@ typedef struct s_impacttype {
struct ExplosionPart
{
coord3d pos;
u32 size;
u32 rot;
f32 size;
f32 rot;
s16 frame;
u8 bb;
};
struct Explosion {
PropRecord *prop;
u32 unk04;
PropRecord *prop; // maybe explosion prop
PropRecord *source; // maybe source prop (e.g., crate)
struct ExplosionPart parts[EXPLOSION_PARTS_LEN];
u32 unk3C8;
s8 unk3CC;
u8 unk3CD;
u16 unk3CE;
u32 unk3D0;
u32 unk3D4;
u32 unk3D8;
u32 unk3DC;
s16 age; // some kind of current tick + total elapsed?
s16 unk3CA; // total elapsed? Or "next tick" age?
s8 explosion_type;
s8 unk3CD;
s8 player;
s8 unk3CF;
struct coord3d pos;
s16 room;
s16 unk3DE;
};
struct SmokePart
{
coord3d pos; /*0x00*/
f32 size; /*0x0c*/
u32 rot; /*0x10*/
u32 deltarot; /*0x14*/
u32 offset1; /*0x18*/
u32 offset2; /*0x1c*/
u32 alpha; /*0x20*/
u16 count; /*0x24*/
f32 rot; /*0x10*/
f32 deltarot; /*0x14*/
f32 offset1; /*0x18*/
f32 offset2; /*0x1c*/
f32 alpha; /*0x20*/
s16 count; /*0x24*/
};
struct Smoke {
PropRecord *prop;
s16 unk04;
s16 unk06;
s16 duration;
s16 smoke_type;
struct SmokePart parts[SMOKE_PARTS_LEN]; /*0x008*/
};
struct Scorch {
s16 roomid;
s16 unk02;
u32 unk04;
u32 unk08;
u32 unk0C;
u8 unk02;
s8 unk03;
u32 unk10;
u32 unk14;
u32 vertex_list[4];
struct coord3d pos;
f32 explosion_size;
struct Model *model;
u32 unk28;
u32 unk2C;
u32 unk30;
u32 unk34;
u32 unk38;
u32 unk3C;
u32 unk40;
u32 unk44;
u32 unk48;
u32 unk4C;
u32 unk50;
u32 unk54;
Vtx vertex_list[4];
};
struct BulletImpact {
s16 unk00;
s16 unk02;
s16 room;
s16 impact_type;
u32 unk04;
u32 unk08;
u32 unk0C;
u32 unk10;
u16 unk14;
s8 unk16;
s8 unk17;
u32 unk18;
u32 unk1C;
u32 unk20;
u16 unk24;
s8 unk26;
s8 unk27;
u32 unk28;
u32 unk2C;
u32 unk30;
u16 unk34;
s8 unk36;
s8 unk37;
u32 unk38;
u32 unk3C;
u32 unk40;
u16 unk44;
s8 unk46;
s8 unk47;
PropRecord* unk48;
s8 unk4C;
s8 unk4D;
Vtx vertex_list[4];
PropRecord* prop;
s8 model_render_pos_index;
s8 room_clear_flag;
s16 unk4E;
};
struct FlyingParticles_unk38 {
s16 unk00;
s16 unk02;
s16 unk04;
s16 unk06;
s16 unk08;
s16 unk0A;
s8 unk0C;
s8 unk0D;
s8 unk0E;
u8 unk0F;
};
struct FlyingParticles {
s32 unk00;
// coord3d?
f32 x;
f32 y;
f32 z;
// coord3d?
f32 unk10;
f32 unk14;
f32 unk18;
// coord3d?
f32 unk1C;
f32 unk20;
f32 unk24;
// coord3d?
f32 unk28;
f32 unk2C;
f32 unk30;
struct coord3d position; // 0x04
struct coord3d rotation; // 0x10
struct coord3d position_drift; // 0x1c
struct coord3d rotation_drift; // 0x28
s32 unk34;
struct FlyingParticles_unk38 unk38[4];
Vtx vertex_list[4];
};
extern f32 D_80040178;
extern char dword_CODE_bss_8007A100[];
extern struct Smoke *ptr_smoke_buf;
extern struct Explosion *ptr_explosion_buf;
extern f32 g_SpExplosionDamageMult;
extern Mtx dword_CODE_bss_8007A100;
extern struct Smoke *g_SmokeBuffer;
extern struct Explosion *g_ExplosionBuffer;
extern s32 max_particles;
extern struct FlyingParticles *ptr_flying_particles_buf;
extern struct Scorch *ptr_scorch_buf;
extern struct BulletImpact *ptr_bullet_impact_buf;
extern s32 numExplosionEntries;
extern s32 numSmokeEntries;
extern s32 numParticleEntries;
extern s32 numScorchEntries;
extern s32 numImpactEntries;
#if defined(VERSION_JP) || defined(VERSION_EU)
s32 sub_GAME_7F09C250(s32 arg0, struct coord3d *pos, struct StandTile *stan, s16 arg3, s32 flag4, s32 playernum, u8 *rooms, s32 flag7);
#else
void sub_GAME_7F09C250(s32 arg0, struct coord3d *pos, struct StandTile *stan, s16 arg3, s32 flag4, s32 playernum, u8 *rooms, s32 flag7);
#endif
extern struct FlyingParticles *g_FlyingParticlesBuffer;
extern struct Scorch *g_ScorchBuffer;
extern struct BulletImpact *g_BulletImpactBuffer;
extern s32 g_NumExplosionEntries;
extern s32 g_NumSmokeEntries;
extern s32 g_NumParticleEntries;
extern s32 g_NumScorchEntries;
extern s32 g_NumImpactEntries;
s32 explosionSmokeTick(PropRecord *arg0);
void sub_GAME_7F09FD3C(void);
Gfx * sub_GAME_7F0A0034(Gfx *arg0);
Gfx * sub_GAME_7F0A1D78(Gfx *arg0);
Gfx *sub_GAME_7F0A0AB4(Gfx *arg0);
Gfx *unk09c250RenderPropExplosion(PropRecord *arg0, Gfx *arg1);
Gfx *unk09c250RenderPropSmoke(PropRecord *arg0, Gfx *arg1);
Gfx * explosionRenderFlyingParticles(Gfx *arg0);
Gfx * explosionCallRenderBulletImpactOnProp(Gfx *arg0);
Gfx *explosionRenderScorchBuffer(Gfx *arg0);
Gfx *explosionRenderPropExplosion(PropRecord *prop, Gfx *gdl, s32 withalpha);
Gfx *explosionRenderPropSmoke(PropRecord *arg0, Gfx *arg1, s32 withalpha);
Gfx *explosionRenderBulletImpactOnProp(Gfx *arg0, PropRecord *arg1, s32 arg2);
void sub_GAME_7F09E700(coord3d *pos, StandTile *stan, s16 arg2, u8 *rooms, s32 arg4);
void explosionCreateSmoke(coord3d *pos, StandTile *stan, s16 smoke_type, u8 *rooms, s32 flags);
void explosionUpdateFlyingParticles(void);
u8 explosionChrpropSmokeTick(PropRecord* prop);
u8 explosionChrpropExplosionTick(PropRecord* prop);
void explosionScreenShake(coord3d* source_pos, coord3d* source_mag, coord3d* result);
void explosionCreateBulletImpact(struct coord3d *pos, struct coord3d *arg1, s16 impact_type, s16 room, PropRecord *prop, s8 model_render_pos_index, s8 room_clear_flag);
#if defined(VERSION_JP) || defined(VERSION_EU)
s32 explosionCreate(void *, struct coord3d *pos, struct StandTile *stan, s16 /* enum EXPLOSION_DEF */ explosionType, s32 flag, s32 playernum, u8 *rooms, s32 flag2);
s32 explosionCreate(PropRecord *arg0, struct coord3d *target_pos, StandTile *target_stan, s16 /* enum EXPLOSION_DEF */ explosion_type, s32 arg4, s32 player, u8 *rooms, s32 arg7);
s32 sub_GAME_7F09C250(s32 arg0, struct coord3d *pos, struct StandTile *stan, s16 arg3, s32 flag4, s32 playernum, u8 *rooms, s32 flag7);
#else
void explosionCreate(void *, struct coord3d *pos, struct StandTile *stan, s16 /* enum EXPLOSION_DEF */ explosionType, s32 flag, s32 playernum, u8 *rooms, s32 flag2);
void explosionCreate(PropRecord *arg0, struct coord3d *target_pos, StandTile *target_stan, s16 /* enum EXPLOSION_DEF */ explosion_type, s32 arg4, s32 player, u8 *rooms, s32 arg7);
void sub_GAME_7F09C250(s32 arg0, struct coord3d *pos, struct StandTile *stan, s16 arg3, s32 flag4, s32 playernum, u8 *rooms, s32 flag7);
#endif
#endif
+10 -6
View File
@@ -47,7 +47,7 @@ void end_of_mission_briefing(void)
{
if (!fileGetIsCheatUnlocked(fileGetSaveForFoldernum(selected_folder_num), mission_folder_setup_entries[briefingpage].mission_num))
{
sub_GAME_7F01E760(selected_folder_num, mission_folder_setup_entries[briefingpage].mission_num);
fileSaveFolderUnlockCheat(selected_folder_num, mission_folder_setup_entries[briefingpage].mission_num);
g_NewCheatUnlocked = TRUE;
return;
}
@@ -60,7 +60,11 @@ void end_of_mission_briefing(void)
void fileLoadSaveSettingsForSelectedFolder(int stage)
{
if(stage){}
if(stage){
#ifdef DEBUG
#endif
}
fileLoadSettingsForFolder(selected_folder_num);
}
@@ -69,17 +73,17 @@ void deleteCurrentSelectedFolder(void)
fileClearSavefileForFolder(selected_folder_num);
}
void copyCurrentEEPROMtoStack(void)
void fileUpdateBondInCurrentFolder(void)
{
fileCopySaveIfSelectedBondDifferent(selected_folder_num);
fileUpdateSelectedBondInSave(selected_folder_num);
}
s32 getSelectedFolderBond(void)
s32 fileGetBondForCurrentFolder(void)
{
return fileGetBondForFolder(selected_folder_num);
}
void set_selected_folder_num(u32 foldernum)
void fileSetCurrentFolder(u32 foldernum)
{
selected_folder_num = foldernum;
}
+3 -18
View File
@@ -29,24 +29,9 @@ typedef struct smallSave
} smallSave;
extern save_data saves[6];
extern save_data D_8002C520;
extern save_data D_8002C580;
extern save_data D_8002C5E0;
extern smallSave blankSmallSave;
extern save_data D_8002C660;
extern save_data D_8002C6C0;
extern save_data D_8002C720;
extern save_data D_8002C780;
extern save_data D_8002C7E0;
extern save_data D_8002C840;
extern save_data blank_eeprom;
extern s32 save_selected_bond[];
void set_selected_folder_num(u32 foldernum);
void set_selected_difficulty(DIFFICULTY difficulty);
void set_solo_and_ptr_briefing(LEVELID stage);
f32 get_007_reaction_speed(void);
f32 get_007_health_mod(void);
f32 get_007_damage_mod(void);
@@ -54,9 +39,9 @@ f32 get_007_accuracy_mod(void);
void end_of_mission_briefing(void);
void fileLoadSaveSettingsForSelectedFolder(int stage);
void deleteCurrentSelectedFolder(void);
void copyCurrentEEPROMtoStack(void);
s32 getSelectedFolderBond(void);
void set_selected_folder_num(u32 foldernum);
void fileUpdateBondInCurrentFolder(void);
s32 fileGetBondForCurrentFolder(void);
void fileSetCurrentFolder(u32 foldernum);
void set_selected_difficulty(DIFFICULTY difficulty);
void set_solo_and_ptr_briefing(LEVELID stage);
void sub_GAME_7F01D61C(struct save_data *savefile);
+237 -270
View File
File diff suppressed because it is too large Load Diff
+5 -5
View File
@@ -6,7 +6,7 @@
#include <bondtypes.h>
#include "file.h"
#define RAMROM_FOLDERNUM 0x64
/* EEPROM masks for in-game settings */
#define OPTION_INVERTLOOK 0x0001
@@ -26,13 +26,13 @@
u8 fileGetBondForFolder(u32 folder);
void fileValidateSaves(void);
bool fileGetIsCheatUnlocked(save_data *save, s32 cheat);
STAGESTATUS fileIsStageUnlockedAtDifficulty(s32 foldernum, LEVEL_SOLO_SEQUENCE stage, DIFFICULTY difficulty);
void fileUnlockStageInFolderAtDifficulty(s32 foldernum, LEVEL_SOLO_SEQUENCE stage, DIFFICULTY difficulty, s32 newtime);
void sub_GAME_7F01E760(s32 foldernum, s32 cheat);
STAGESTATUS fileIsStageUnlockedAtDifficulty(s32 foldernum, LEVEL_SOLO_SEQUENCE levelid, DIFFICULTY difficulty);
void fileUnlockStageInFolderAtDifficulty(s32 foldernum, LEVEL_SOLO_SEQUENCE levelid, DIFFICULTY difficulty, s32 newtime);
void fileSaveFolderUnlockCheat(s32 foldernum, s32 cheat);
void fileLoadSettingsForFolder(u32 folder);
void fileDeleteSaveForFolder(s32 foldernum);
void fileGetHighestStageDifficultyCompletedForFolder(s32 foldernum, LEVEL_SOLO_SEQUENCE *stage, DIFFICULTY *difficulty);
void fileGetHighestStageDifficultyCompletedForFolder(s32 foldernum, LEVEL_SOLO_SEQUENCE *levelid, DIFFICULTY *difficulty);
bool check_aztec_completed_any_folder_secret_00(void);
bool fileIsEgyptCompletedOn00AnyFolder(void);
LEVEL_SOLO_SEQUENCE fileGetHighestStageUnlockedAnyFolder(void);
+37 -574
View File
@@ -64,8 +64,7 @@ EnvironmentRecord * g_EnvironmentAltp;
s32 D_800825F4;
#if defined(VERSION_EU)
EnvironmentRecord dword_CODE_bss_800825F8;
s32 bss_800825F8_padding[2];
struct NearFogRecordF eu_loadCurrentNearFog;
#endif
/**
@@ -276,7 +275,6 @@ f32 fogGetScaledFarFogIntensitySquared(void)
}
#if defined(VERSION_US) || defined(VERSION_JP)
/**
* Address 0x7F0BA758.
*/
@@ -333,268 +331,32 @@ void fogLoadCurrentEnvironment(EnvironmentRecord *arg0)
g_CurrentEnvironment.WaterBlue = arg0->Sky.WaterBlue;
g_CurrentEnvironment.WaterConcavity = arg0->Sky.WaterConcavity;
if (arg0->Visibility.Nfd.NearFog == 0.0f)
#if defined(VERSION_EU)
#define FOG_ZERO 0
#else
#define FOG_ZERO 0.0f
#endif
if (arg0->Visibility.Nfd.NearFog == FOG_ZERO)
{
g_NearFogValuesP = NULL;
}
else
{
#if defined(VERSION_EU)
eu_loadCurrentNearFog.NearFog = arg0->Visibility.Nfd.NearFog;
eu_loadCurrentNearFog.MaxVisRange = arg0->Visibility.Nfd.MaxVisRange;
eu_loadCurrentNearFog.MaxObfuscationRange = arg0->Visibility.Nfd.MaxObfuscationRange;
g_NearFogValuesP = &eu_loadCurrentNearFog;
#else
g_NearFogValuesP = &arg0->Visibility.Nfd;
#endif
}
#undef FOG_ZERO
g_FogSkyIsEnabled = 1;
}
#endif
#if defined(VERSION_EU)
GLOBAL_ASM(
.text
glabel fogLoadCurrentEnvironment
/* 0EC3E8 7F0B99F8 27BDFFC8 */ addiu $sp, $sp, -0x38
/* 0EC3EC 7F0B99FC AFBF0014 */ sw $ra, 0x14($sp)
/* 0EC3F0 7F0B9A00 848F0004 */ lh $t7, 4($a0)
/* 0EC3F4 7F0B9A04 848E0002 */ lh $t6, 2($a0)
/* 0EC3F8 7F0B9A08 AFA40038 */ sw $a0, 0x38($sp)
/* 0EC3FC 7F0B9A0C 448F3000 */ mtc1 $t7, $f6
/* 0EC400 7F0B9A10 448E2000 */ mtc1 $t6, $f4
/* 0EC404 7F0B9A14 468033A0 */ cvt.s.w $f14, $f6
/* 0EC408 7F0B9A18 0C001028 */ jal viSetZRange
/* 0EC40C 7F0B9A1C 46802320 */ cvt.s.w $f12, $f4
/* 0EC410 7F0B9A20 0C00103F */ jal viGetZRange
/* 0EC414 7F0B9A24 27A40030 */ addiu $a0, $sp, 0x30
/* 0EC418 7F0B9A28 0FC2CEED */ jal bgGetLevelVisibilityScale
/* 0EC41C 7F0B9A2C 00000000 */ nop
/* 0EC420 7F0B9A30 C7A80030 */ lwc1 $f8, 0x30($sp)
/* 0EC424 7F0B9A34 C7A40034 */ lwc1 $f4, 0x34($sp)
/* 0EC428 7F0B9A38 8FA50038 */ lw $a1, 0x38($sp)
/* 0EC42C 7F0B9A3C 46004283 */ div.s $f10, $f8, $f0
/* 0EC430 7F0B9A40 3C01447A */ li $at, 0x447A0000 # 1000.000000
/* 0EC434 7F0B9A44 3C048007 */ lui $a0, %hi(g_DifferenceFromFarFogIntensity) # $a0, 0x8007
/* 0EC438 7F0B9A48 2484CF84 */ addiu $a0, %lo(g_DifferenceFromFarFogIntensity) # addiu $a0, $a0, -0x307c
/* 0EC43C 7F0B9A4C 3C068007 */ lui $a2, %hi(g_FarFogIntensity) # $a2, 0x8007
/* 0EC440 7F0B9A50 24C6CF80 */ addiu $a2, %lo(g_FarFogIntensity) # addiu $a2, $a2, -0x3080
/* 0EC444 7F0B9A54 3C038007 */ lui $v1, %hi(g_CurFogDetails) # $v1, 0x8007
/* 0EC448 7F0B9A58 2463CF68 */ addiu $v1, %lo(g_CurFogDetails) # addiu $v1, $v1, -0x3098
/* 0EC44C 7F0B9A5C 3C028004 */ lui $v0, %hi(g_CurrentEnvironment) # $v0, 0x8004
/* 0EC450 7F0B9A60 2442E2BC */ addiu $v0, %lo(g_CurrentEnvironment) # addiu $v0, $v0, -0x1d44
/* 0EC454 7F0B9A64 46002183 */ div.s $f6, $f4, $f0
/* 0EC458 7F0B9A68 E7AA0030 */ swc1 $f10, 0x30($sp)
/* 0EC45C 7F0B9A6C 44812000 */ mtc1 $at, $f4
/* 0EC460 7F0B9A70 E7A60034 */ swc1 $f6, 0x34($sp)
/* 0EC464 7F0B9A74 84B8000C */ lh $t8, 0xc($a1)
/* 0EC468 7F0B9A78 44984000 */ mtc1 $t8, $f8
/* 0EC46C 7F0B9A7C 00000000 */ nop
/* 0EC470 7F0B9A80 468042A0 */ cvt.s.w $f10, $f8
/* 0EC474 7F0B9A84 46045183 */ div.s $f6, $f10, $f4
/* 0EC478 7F0B9A88 44812000 */ mtc1 $at, $f4
/* 0EC47C 7F0B9A8C 3C018004 */ lui $at, %hi(g_ScaledFarFogIntensity) # $at, 0x8004
/* 0EC480 7F0B9A90 E4860000 */ swc1 $f6, ($a0)
/* 0EC484 7F0B9A94 84B9000E */ lh $t9, 0xe($a1)
/* 0EC488 7F0B9A98 44994000 */ mtc1 $t9, $f8
/* 0EC48C 7F0B9A9C 00000000 */ nop
/* 0EC490 7F0B9AA0 468042A0 */ cvt.s.w $f10, $f8
/* 0EC494 7F0B9AA4 C7A80034 */ lwc1 $f8, 0x34($sp)
/* 0EC498 7F0B9AA8 46045183 */ div.s $f6, $f10, $f4
/* 0EC49C 7F0B9AAC C7AA0030 */ lwc1 $f10, 0x30($sp)
/* 0EC4A0 7F0B9AB0 460A4381 */ sub.s $f14, $f8, $f10
/* 0EC4A4 7F0B9AB4 E4C60000 */ swc1 $f6, ($a2)
/* 0EC4A8 7F0B9AB8 C4D00000 */ lwc1 $f16, ($a2)
/* 0EC4AC 7F0B9ABC 46107102 */ mul.s $f4, $f14, $f16
/* 0EC4B0 7F0B9AC0 46045180 */ add.s $f6, $f10, $f4
/* 0EC4B4 7F0B9AC4 E426E2B4 */ swc1 $f6, %lo(g_ScaledFarFogIntensity)($at)
/* 0EC4B8 7F0B9AC8 C4820000 */ lwc1 $f2, ($a0)
/* 0EC4BC 7F0B9ACC 3C018004 */ lui $at, %hi(g_ScaledDifferenceFromFarFogIntensity) # $at, 0x8004
/* 0EC4C0 7F0B9AD0 46027202 */ mul.s $f8, $f14, $f2
/* 0EC4C4 7F0B9AD4 46085100 */ add.s $f4, $f10, $f8
/* 0EC4C8 7F0B9AD8 E424E2B8 */ swc1 $f4, %lo(g_ScaledDifferenceFromFarFogIntensity)($at)
/* 0EC4CC 7F0B9ADC 84A80002 */ lh $t0, 2($a1)
/* 0EC4D0 7F0B9AE0 3C014300 */ li $at, 0x43000000 # 128.000000
/* 0EC4D4 7F0B9AE4 44883000 */ mtc1 $t0, $f6
/* 0EC4D8 7F0B9AE8 00000000 */ nop
/* 0EC4DC 7F0B9AEC 468032A0 */ cvt.s.w $f10, $f6
/* 0EC4E0 7F0B9AF0 46005203 */ div.s $f8, $f10, $f0
/* 0EC4E4 7F0B9AF4 E4680000 */ swc1 $f8, ($v1)
/* 0EC4E8 7F0B9AF8 84A90004 */ lh $t1, 4($a1)
/* 0EC4EC 7F0B9AFC 46028201 */ sub.s $f8, $f16, $f2
/* 0EC4F0 7F0B9B00 C4720000 */ lwc1 $f18, ($v1)
/* 0EC4F4 7F0B9B04 44892000 */ mtc1 $t1, $f4
/* 0EC4F8 7F0B9B08 E7A80018 */ swc1 $f8, 0x18($sp)
/* 0EC4FC 7F0B9B0C 468021A0 */ cvt.s.w $f6, $f4
/* 0EC500 7F0B9B10 44812000 */ mtc1 $at, $f4
/* 0EC504 7F0B9B14 3C013F00 */ li $at, 0x3F000000 # 0.500000
/* 0EC508 7F0B9B18 44814000 */ mtc1 $at, $f8
/* 0EC50C 7F0B9B1C 3C014380 */ li $at, 0x43800000 # 256.000000
/* 0EC510 7F0B9B20 46003283 */ div.s $f10, $f6, $f0
/* 0EC514 7F0B9B24 C7A60018 */ lwc1 $f6, 0x18($sp)
/* 0EC518 7F0B9B28 E46A0004 */ swc1 $f10, 4($v1)
/* 0EC51C 7F0B9B2C 46062283 */ div.s $f10, $f4, $f6
/* 0EC520 7F0B9B30 C46C0004 */ lwc1 $f12, 4($v1)
/* 0EC524 7F0B9B34 46024101 */ sub.s $f4, $f8, $f2
/* 0EC528 7F0B9B38 E7AA0020 */ swc1 $f10, 0x20($sp)
/* 0EC52C 7F0B9B3C 44815000 */ mtc1 $at, $f10
/* 0EC530 7F0B9B40 3C013F80 */ li $at, 0x3F800000 # 1.000000
/* 0EC534 7F0B9B44 460A2202 */ mul.s $f8, $f4, $f10
/* 0EC538 7F0B9B48 46126281 */ sub.s $f10, $f12, $f18
/* 0EC53C 7F0B9B4C E7AA0018 */ swc1 $f10, 0x18($sp)
/* 0EC540 7F0B9B50 44815000 */ mtc1 $at, $f10
/* 0EC544 7F0B9B54 46064103 */ div.s $f4, $f8, $f6
/* 0EC548 7F0B9B58 C7A80020 */ lwc1 $f8, 0x20($sp)
/* 0EC54C 7F0B9B5C 3C01437F */ li $at, 0x437F0000 # 255.000000
/* 0EC550 7F0B9B60 46004187 */ neg.s $f6, $f8
/* 0EC554 7F0B9B64 460A9200 */ add.s $f8, $f18, $f10
/* 0EC558 7F0B9B68 C7AA0018 */ lwc1 $f10, 0x18($sp)
/* 0EC55C 7F0B9B6C E7A4001C */ swc1 $f4, 0x1c($sp)
/* 0EC560 7F0B9B70 460C3102 */ mul.s $f4, $f6, $f12
/* 0EC564 7F0B9B74 00000000 */ nop
/* 0EC568 7F0B9B78 46082182 */ mul.s $f6, $f4, $f8
/* 0EC56C 7F0B9B7C 44814000 */ mtc1 $at, $f8
/* 0EC570 7F0B9B80 3C013F80 */ li $at, 0x3F800000 # 1.000000
/* 0EC574 7F0B9B84 460A3103 */ div.s $f4, $f6, $f10
/* 0EC578 7F0B9B88 44815000 */ mtc1 $at, $f10
/* 0EC57C 7F0B9B8C 3C01437F */ li $at, 0x437F0000 # 255.000000
/* 0EC580 7F0B9B90 46082183 */ div.s $f6, $f4, $f8
/* 0EC584 7F0B9B94 C7A80020 */ lwc1 $f8, 0x20($sp)
/* 0EC588 7F0B9B98 460A6100 */ add.s $f4, $f12, $f10
/* 0EC58C 7F0B9B9C C7AA0018 */ lwc1 $f10, 0x18($sp)
/* 0EC590 7F0B9BA0 E4660010 */ swc1 $f6, 0x10($v1)
/* 0EC594 7F0B9BA4 46082182 */ mul.s $f6, $f4, $f8
/* 0EC598 7F0B9BA8 C7A8001C */ lwc1 $f8, 0x1c($sp)
/* 0EC59C 7F0B9BAC 460A3103 */ div.s $f4, $f6, $f10
/* 0EC5A0 7F0B9BB0 44815000 */ mtc1 $at, $f10
/* 0EC5A4 7F0B9BB4 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000
/* 0EC5A8 7F0B9BB8 46082180 */ add.s $f6, $f4, $f8
/* 0EC5AC 7F0B9BBC 460A3103 */ div.s $f4, $f6, $f10
/* 0EC5B0 7F0B9BC0 E4640014 */ swc1 $f4, 0x14($v1)
/* 0EC5B4 7F0B9BC4 84AA000C */ lh $t2, 0xc($a1)
/* 0EC5B8 7F0B9BC8 AC4A0000 */ sw $t2, ($v0)
/* 0EC5BC 7F0B9BCC 84AB000E */ lh $t3, 0xe($a1)
/* 0EC5C0 7F0B9BD0 AC4B0004 */ sw $t3, 4($v0)
/* 0EC5C4 7F0B9BD4 90AC0010 */ lbu $t4, 0x10($a1)
/* 0EC5C8 7F0B9BD8 A04C0008 */ sb $t4, 8($v0)
/* 0EC5CC 7F0B9BDC 90AD0011 */ lbu $t5, 0x11($a1)
/* 0EC5D0 7F0B9BE0 A04D0009 */ sb $t5, 9($v0)
/* 0EC5D4 7F0B9BE4 90AE0012 */ lbu $t6, 0x12($a1)
/* 0EC5D8 7F0B9BE8 A04E000A */ sb $t6, 0xa($v0)
/* 0EC5DC 7F0B9BEC 90AF0013 */ lbu $t7, 0x13($a1)
/* 0EC5E0 7F0B9BF0 A04F000B */ sb $t7, 0xb($v0)
/* 0EC5E4 7F0B9BF4 84B80014 */ lh $t8, 0x14($a1)
/* 0EC5E8 7F0B9BF8 44984000 */ mtc1 $t8, $f8
/* 0EC5EC 7F0B9BFC 00000000 */ nop
/* 0EC5F0 7F0B9C00 468041A0 */ cvt.s.w $f6, $f8
/* 0EC5F4 7F0B9C04 E446000C */ swc1 $f6, 0xc($v0)
/* 0EC5F8 7F0B9C08 90B90016 */ lbu $t9, 0x16($a1)
/* 0EC5FC 7F0B9C0C A4590010 */ sh $t9, 0x10($v0)
/* 0EC600 7F0B9C10 90A80017 */ lbu $t0, 0x17($a1)
/* 0EC604 7F0B9C14 44885000 */ mtc1 $t0, $f10
/* 0EC608 7F0B9C18 05010004 */ bgez $t0, .L7F0B9C2C
/* 0EC60C 7F0B9C1C 46805120 */ cvt.s.w $f4, $f10
/* 0EC610 7F0B9C20 44814000 */ mtc1 $at, $f8
/* 0EC614 7F0B9C24 00000000 */ nop
/* 0EC618 7F0B9C28 46082100 */ add.s $f4, $f4, $f8
.L7F0B9C2C:
/* 0EC61C 7F0B9C2C E4440014 */ swc1 $f4, 0x14($v0)
/* 0EC620 7F0B9C30 90A90018 */ lbu $t1, 0x18($a1)
/* 0EC624 7F0B9C34 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000
/* 0EC628 7F0B9C38 44893000 */ mtc1 $t1, $f6
/* 0EC62C 7F0B9C3C 05210004 */ bgez $t1, .L7F0B9C50
/* 0EC630 7F0B9C40 468032A0 */ cvt.s.w $f10, $f6
/* 0EC634 7F0B9C44 44814000 */ mtc1 $at, $f8
/* 0EC638 7F0B9C48 00000000 */ nop
/* 0EC63C 7F0B9C4C 46085280 */ add.s $f10, $f10, $f8
.L7F0B9C50:
/* 0EC640 7F0B9C50 E44A0018 */ swc1 $f10, 0x18($v0)
/* 0EC644 7F0B9C54 90AA0019 */ lbu $t2, 0x19($a1)
/* 0EC648 7F0B9C58 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000
/* 0EC64C 7F0B9C5C 448A2000 */ mtc1 $t2, $f4
/* 0EC650 7F0B9C60 05410004 */ bgez $t2, .L7F0B9C74
/* 0EC654 7F0B9C64 468021A0 */ cvt.s.w $f6, $f4
/* 0EC658 7F0B9C68 44814000 */ mtc1 $at, $f8
/* 0EC65C 7F0B9C6C 00000000 */ nop
/* 0EC660 7F0B9C70 46083180 */ add.s $f6, $f6, $f8
.L7F0B9C74:
/* 0EC664 7F0B9C74 E446001C */ swc1 $f6, 0x1c($v0)
/* 0EC668 7F0B9C78 90AB001A */ lbu $t3, 0x1a($a1)
/* 0EC66C 7F0B9C7C 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000
/* 0EC670 7F0B9C80 240A0001 */ li $t2, 1
/* 0EC674 7F0B9C84 A04B0020 */ sb $t3, 0x20($v0)
/* 0EC678 7F0B9C88 84AC001C */ lh $t4, 0x1c($a1)
/* 0EC67C 7F0B9C8C 448C5000 */ mtc1 $t4, $f10
/* 0EC680 7F0B9C90 00000000 */ nop
/* 0EC684 7F0B9C94 46805120 */ cvt.s.w $f4, $f10
/* 0EC688 7F0B9C98 E4440024 */ swc1 $f4, 0x24($v0)
/* 0EC68C 7F0B9C9C 90AD001E */ lbu $t5, 0x1e($a1)
/* 0EC690 7F0B9CA0 A44D0028 */ sh $t5, 0x28($v0)
/* 0EC694 7F0B9CA4 90AE001F */ lbu $t6, 0x1f($a1)
/* 0EC698 7F0B9CA8 448E4000 */ mtc1 $t6, $f8
/* 0EC69C 7F0B9CAC 05C10004 */ bgez $t6, .L7F0B9CC0
/* 0EC6A0 7F0B9CB0 468041A0 */ cvt.s.w $f6, $f8
/* 0EC6A4 7F0B9CB4 44815000 */ mtc1 $at, $f10
/* 0EC6A8 7F0B9CB8 00000000 */ nop
/* 0EC6AC 7F0B9CBC 460A3180 */ add.s $f6, $f6, $f10
.L7F0B9CC0:
/* 0EC6B0 7F0B9CC0 E446002C */ swc1 $f6, 0x2c($v0)
/* 0EC6B4 7F0B9CC4 90AF0020 */ lbu $t7, 0x20($a1)
/* 0EC6B8 7F0B9CC8 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000
/* 0EC6BC 7F0B9CCC 448F2000 */ mtc1 $t7, $f4
/* 0EC6C0 7F0B9CD0 05E10004 */ bgez $t7, .L7F0B9CE4
/* 0EC6C4 7F0B9CD4 46802220 */ cvt.s.w $f8, $f4
/* 0EC6C8 7F0B9CD8 44815000 */ mtc1 $at, $f10
/* 0EC6CC 7F0B9CDC 00000000 */ nop
/* 0EC6D0 7F0B9CE0 460A4200 */ add.s $f8, $f8, $f10
.L7F0B9CE4:
/* 0EC6D4 7F0B9CE4 E4480030 */ swc1 $f8, 0x30($v0)
/* 0EC6D8 7F0B9CE8 90B80021 */ lbu $t8, 0x21($a1)
/* 0EC6DC 7F0B9CEC 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000
/* 0EC6E0 7F0B9CF0 44983000 */ mtc1 $t8, $f6
/* 0EC6E4 7F0B9CF4 07010004 */ bgez $t8, .L7F0B9D08
/* 0EC6E8 7F0B9CF8 46803120 */ cvt.s.w $f4, $f6
/* 0EC6EC 7F0B9CFC 44815000 */ mtc1 $at, $f10
/* 0EC6F0 7F0B9D00 00000000 */ nop
/* 0EC6F4 7F0B9D04 460A2100 */ add.s $f4, $f4, $f10
.L7F0B9D08:
/* 0EC6F8 7F0B9D08 E4440034 */ swc1 $f4, 0x34($v0)
/* 0EC6FC 7F0B9D0C 90B90022 */ lbu $t9, 0x22($a1)
/* 0EC700 7F0B9D10 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000
/* 0EC704 7F0B9D14 44994000 */ mtc1 $t9, $f8
/* 0EC708 7F0B9D18 07210004 */ bgez $t9, .L7F0B9D2C
/* 0EC70C 7F0B9D1C 468041A0 */ cvt.s.w $f6, $f8
/* 0EC710 7F0B9D20 44815000 */ mtc1 $at, $f10
/* 0EC714 7F0B9D24 00000000 */ nop
/* 0EC718 7F0B9D28 460A3180 */ add.s $f6, $f6, $f10
.L7F0B9D2C:
/* 0EC71C 7F0B9D2C E4460038 */ swc1 $f6, 0x38($v0)
/* 0EC720 7F0B9D30 84A30006 */ lh $v1, 6($a1)
/* 0EC724 7F0B9D34 3C018007 */ lui $at, %hi(g_NearFogValuesP) # $at, 0x8007
/* 0EC728 7F0B9D38 54600004 */ bnezl $v1, .L7F0B9D4C
/* 0EC72C 7F0B9D3C 44832000 */ mtc1 $v1, $f4
/* 0EC730 7F0B9D40 10000012 */ b .L7F0B9D8C
/* 0EC734 7F0B9D44 AC20CF64 */ sw $zero, %lo(g_NearFogValuesP)($at)
/* 0EC738 7F0B9D48 44832000 */ mtc1 $v1, $f4
.L7F0B9D4C:
/* 0EC73C 7F0B9D4C 3C028007 */ lui $v0, %hi(dword_CODE_bss_800825F8) # $v0, 0x8007
/* 0EC740 7F0B9D50 2442CF98 */ addiu $v0, %lo(dword_CODE_bss_800825F8) # addiu $v0, $v0, -0x3068
/* 0EC744 7F0B9D54 46802220 */ cvt.s.w $f8, $f4
/* 0EC748 7F0B9D58 3C018007 */ lui $at, %hi(g_NearFogValuesP) # $at, 0x8007
/* 0EC74C 7F0B9D5C E4480000 */ swc1 $f8, ($v0)
/* 0EC750 7F0B9D60 84A80008 */ lh $t0, 8($a1)
/* 0EC754 7F0B9D64 44885000 */ mtc1 $t0, $f10
/* 0EC758 7F0B9D68 00000000 */ nop
/* 0EC75C 7F0B9D6C 468051A0 */ cvt.s.w $f6, $f10
/* 0EC760 7F0B9D70 E4460004 */ swc1 $f6, 4($v0)
/* 0EC764 7F0B9D74 84A9000A */ lh $t1, 0xa($a1)
/* 0EC768 7F0B9D78 44892000 */ mtc1 $t1, $f4
/* 0EC76C 7F0B9D7C 00000000 */ nop
/* 0EC770 7F0B9D80 46802220 */ cvt.s.w $f8, $f4
/* 0EC774 7F0B9D84 E4480008 */ swc1 $f8, 8($v0)
/* 0EC778 7F0B9D88 AC22CF64 */ sw $v0, %lo(g_NearFogValuesP)($at)
.L7F0B9D8C:
/* 0EC77C 7F0B9D8C 8FBF0014 */ lw $ra, 0x14($sp)
/* 0EC780 7F0B9D90 3C018007 */ lui $at, %hi(g_FogSkyIsEnabled) # $at, 0x8007
/* 0EC784 7F0B9D94 AC2ACF60 */ sw $t2, %lo(g_FogSkyIsEnabled)($at)
/* 0EC788 7F0B9D98 03E00008 */ jr $ra
/* 0EC78C 7F0B9D9C 27BD0038 */ addiu $sp, $sp, 0x38
)
#endif
/**
* Address 0x7F0BA9D0.
@@ -730,7 +492,6 @@ void fogLoadLevelEnvironment(s32 level_id, s32 arg1)
g_EnvironmentFoundp = NULL;
}
#if defined(VERSION_US) || defined(VERSION_JP)
/**
* Address 0x7F0BACA8.
* Switch to next Environment.
@@ -738,13 +499,11 @@ void fogLoadLevelEnvironment(s32 level_id, s32 arg1)
*/
void fogSwitchToSolosky2(f32 arg0)
{
#if defined(VERSION_US) || defined(VERSION_JP)
static EnvironmentRecord dword_CODE_bss_800825F8;
#endif
static EnvironmentRecord static_envr;
dword_CODE_bss_800825F8 = *g_EnvironmentMainp;
static_envr = *g_EnvironmentMainp;
dword_CODE_bss_800825F8.Visibility.BlendMultiplier =
static_envr.Visibility.BlendMultiplier =
g_EnvironmentMainp->Visibility.BlendMultiplier
#if defined(VERSION_EU)
+ (arg0 * ((f32)g_EnvironmentAltp->Visibility.BlendMultiplier - (f32)g_EnvironmentMainp->Visibility.BlendMultiplier));
@@ -752,7 +511,7 @@ void fogSwitchToSolosky2(f32 arg0)
+ (arg0 * (g_EnvironmentAltp->Visibility.BlendMultiplier - g_EnvironmentMainp->Visibility.BlendMultiplier));
#endif
dword_CODE_bss_800825F8.Visibility.FarFog =
static_envr.Visibility.FarFog =
g_EnvironmentMainp->Visibility.FarFog
#if defined(VERSION_EU)
+ (arg0 * ((f32)g_EnvironmentAltp->Visibility.FarFog - (f32)g_EnvironmentMainp->Visibility.FarFog));
@@ -760,329 +519,33 @@ void fogSwitchToSolosky2(f32 arg0)
+ (arg0 * (g_EnvironmentAltp->Visibility.FarFog - g_EnvironmentMainp->Visibility.FarFog));
#endif
dword_CODE_bss_800825F8.Fog.DifferenceFromFarIntensity =
static_envr.Fog.DifferenceFromFarIntensity =
(f32)g_EnvironmentMainp->Fog.DifferenceFromFarIntensity
+ (arg0 * ((f32)g_EnvironmentAltp->Fog.DifferenceFromFarIntensity - (f32)g_EnvironmentMainp->Fog.DifferenceFromFarIntensity));
dword_CODE_bss_800825F8.Fog.FarIntensity =
static_envr.Fog.FarIntensity =
(f32)g_EnvironmentMainp->Fog.FarIntensity
+ (arg0 * ((f32)g_EnvironmentAltp->Fog.FarIntensity - (f32)g_EnvironmentMainp->Fog.FarIntensity));
dword_CODE_bss_800825F8.Sky.Red =
static_envr.Sky.Red =
(f32)g_EnvironmentMainp->Sky.Red
+ (arg0 * ((f32)g_EnvironmentAltp->Sky.Red - (f32)g_EnvironmentMainp->Sky.Red));
dword_CODE_bss_800825F8.Sky.Green =
static_envr.Sky.Green =
(f32)g_EnvironmentMainp->Sky.Green
+ (arg0 * ((f32)g_EnvironmentAltp->Sky.Green - (f32)g_EnvironmentMainp->Sky.Green));
dword_CODE_bss_800825F8.Sky.Blue =
static_envr.Sky.Blue =
(f32)g_EnvironmentMainp->Sky.Blue
+ (arg0 * ((f32)g_EnvironmentAltp->Sky.Blue - (f32)g_EnvironmentMainp->Sky.Blue));
dword_CODE_bss_800825F8.Sky.Red &= 0xf8;
dword_CODE_bss_800825F8.Sky.Green &= 0xf8;
dword_CODE_bss_800825F8.Sky.Blue &= 0xf8;
static_envr.Sky.Red &= 0xf8;
static_envr.Sky.Green &= 0xf8;
static_envr.Sky.Blue &= 0xf8;
fogLoadCurrentEnvironment(&dword_CODE_bss_800825F8);
fogLoadCurrentEnvironment(&static_envr);
}
#else
/**
*
* .bss
glabel dword_CODE_bss_800825F8
.word 0,0,0,0
.word 0,0,0,0
.word 0,0,0,0
*
*/
/**
* hack:
* variables referenced in the following asm are wrong, just used
* to get matching addresses.
*/
GLOBAL_ASM(
.text
glabel fogSwitchToSolosky2
/* 0ECA68 7F0BA078 3C028007 */ lui $v0, %hi(g_EnvironmentMainp) # $v0, 0x8007
/* 0ECA6C 7F0BA07C 8C42CF8C */ lw $v0, %lo(g_EnvironmentMainp)($v0)
/* 0ECA70 7F0BA080 3C048007 */ lui $a0, %hi(g_EnvironmentMainp + 0x1c) # $a0, 0x8007
/* 0ECA74 7F0BA084 2484CFA8 */ addiu $a0, %lo(g_EnvironmentMainp + 0x1c) # addiu $a0, $a0, -0x3058
/* 0ECA78 7F0BA088 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 0ECA7C 7F0BA08C AFBF0014 */ sw $ra, 0x14($sp)
/* 0ECA80 7F0BA090 00804025 */ move $t0, $a0
/* 0ECA84 7F0BA094 0040C825 */ move $t9, $v0
/* 0ECA88 7F0BA098 24580024 */ addiu $t8, $v0, 0x24
.L7F0BA09C:
/* 0ECA8C 7F0BA09C 8B210000 */ lwl $at, ($t9)
/* 0ECA90 7F0BA0A0 9B210003 */ lwr $at, 3($t9)
/* 0ECA94 7F0BA0A4 2739000C */ addiu $t9, $t9, 0xc
/* 0ECA98 7F0BA0A8 2508000C */ addiu $t0, $t0, 0xc
/* 0ECA9C 7F0BA0AC AD01FFF4 */ sw $at, -0xc($t0)
/* 0ECAA0 7F0BA0B0 8B21FFF8 */ lwl $at, -8($t9)
/* 0ECAA4 7F0BA0B4 9B21FFFB */ lwr $at, -5($t9)
/* 0ECAA8 7F0BA0B8 AD01FFF8 */ sw $at, -8($t0)
/* 0ECAAC 7F0BA0BC 8B21FFFC */ lwl $at, -4($t9)
/* 0ECAB0 7F0BA0C0 9B21FFFF */ lwr $at, -1($t9)
/* 0ECAB4 7F0BA0C4 1738FFF5 */ bne $t9, $t8, .L7F0BA09C
/* 0ECAB8 7F0BA0C8 AD01FFFC */ sw $at, -4($t0)
/* 0ECABC 7F0BA0CC 3C038007 */ lui $v1, %hi(g_EnvironmentMainp) # $v1, 0x8007
/* 0ECAC0 7F0BA0D0 8C63CF90 */ lw $v1, %lo(g_EnvironmentMainp+4)($v1)
/* 0ECAC4 7F0BA0D4 84490002 */ lh $t1, 2($v0)
/* 0ECAC8 7F0BA0D8 3C018007 */ lui $at, %hi(g_EnvironmentMainp+4) # $at, 0x8007
/* 0ECACC 7F0BA0DC 846A0002 */ lh $t2, 2($v1)
/* 0ECAD0 7F0BA0E0 44892000 */ mtc1 $t1, $f4
/* 0ECAD4 7F0BA0E4 448A3000 */ mtc1 $t2, $f6
/* 0ECAD8 7F0BA0E8 46802020 */ cvt.s.w $f0, $f4
/* 0ECADC 7F0BA0EC 46803220 */ cvt.s.w $f8, $f6
/* 0ECAE0 7F0BA0F0 46004281 */ sub.s $f10, $f8, $f0
/* 0ECAE4 7F0BA0F4 460A6102 */ mul.s $f4, $f12, $f10
/* 0ECAE8 7F0BA0F8 46040180 */ add.s $f6, $f0, $f4
/* 0ECAEC 7F0BA0FC 4600320D */ trunc.w.s $f8, $f6
/* 0ECAF0 7F0BA100 440C4000 */ mfc1 $t4, $f8
/* 0ECAF4 7F0BA104 00000000 */ nop
/* 0ECAF8 7F0BA108 A42CCFAA */ sh $t4, %lo(g_EnvironmentMainp+0x1e)($at)
/* 0ECAFC 7F0BA10C 844D0004 */ lh $t5, 4($v0)
/* 0ECB00 7F0BA110 846F0004 */ lh $t7, 4($v1)
/* 0ECB04 7F0BA114 448D5000 */ mtc1 $t5, $f10
/* 0ECB08 7F0BA118 448F2000 */ mtc1 $t7, $f4
/* 0ECB0C 7F0BA11C 468050A0 */ cvt.s.w $f2, $f10
/* 0ECB10 7F0BA120 468021A0 */ cvt.s.w $f6, $f4
/* 0ECB14 7F0BA124 46023201 */ sub.s $f8, $f6, $f2
/* 0ECB18 7F0BA128 46086282 */ mul.s $f10, $f12, $f8
/* 0ECB1C 7F0BA12C 460A1100 */ add.s $f4, $f2, $f10
/* 0ECB20 7F0BA130 4600218D */ trunc.w.s $f6, $f4
/* 0ECB24 7F0BA134 44183000 */ mfc1 $t8, $f6
/* 0ECB28 7F0BA138 00000000 */ nop
/* 0ECB2C 7F0BA13C A438CFAC */ sh $t8, %lo(g_EnvironmentMainp+0x20)($at)
/* 0ECB30 7F0BA140 8459000C */ lh $t9, 0xc($v0)
/* 0ECB34 7F0BA144 8468000C */ lh $t0, 0xc($v1)
/* 0ECB38 7F0BA148 3C018007 */ lui $at, %hi(g_EnvironmentMainp+0x20) # $at, 0x8007
/* 0ECB3C 7F0BA14C 44994000 */ mtc1 $t9, $f8
/* 0ECB40 7F0BA150 44885000 */ mtc1 $t0, $f10
/* 0ECB44 7F0BA154 468043A0 */ cvt.s.w $f14, $f8
/* 0ECB48 7F0BA158 46805120 */ cvt.s.w $f4, $f10
/* 0ECB4C 7F0BA15C 460E2181 */ sub.s $f6, $f4, $f14
/* 0ECB50 7F0BA160 46066202 */ mul.s $f8, $f12, $f6
/* 0ECB54 7F0BA164 46087280 */ add.s $f10, $f14, $f8
/* 0ECB58 7F0BA168 4600510D */ trunc.w.s $f4, $f10
/* 0ECB5C 7F0BA16C 440A2000 */ mfc1 $t2, $f4
/* 0ECB60 7F0BA170 00000000 */ nop
/* 0ECB64 7F0BA174 A42ACFB4 */ sh $t2, %lo(g_EnvironmentMainp+0x28)($at)
/* 0ECB68 7F0BA178 844B000E */ lh $t3, 0xe($v0)
/* 0ECB6C 7F0BA17C 846C000E */ lh $t4, 0xe($v1)
/* 0ECB70 7F0BA180 448B3000 */ mtc1 $t3, $f6
/* 0ECB74 7F0BA184 448C4000 */ mtc1 $t4, $f8
/* 0ECB78 7F0BA188 46803420 */ cvt.s.w $f16, $f6
/* 0ECB7C 7F0BA18C 468042A0 */ cvt.s.w $f10, $f8
/* 0ECB80 7F0BA190 46105101 */ sub.s $f4, $f10, $f16
/* 0ECB84 7F0BA194 46046182 */ mul.s $f6, $f12, $f4
/* 0ECB88 7F0BA198 46068200 */ add.s $f8, $f16, $f6
/* 0ECB8C 7F0BA19C 4600428D */ trunc.w.s $f10, $f8
/* 0ECB90 7F0BA1A0 440F5000 */ mfc1 $t7, $f10
/* 0ECB94 7F0BA1A4 00000000 */ nop
/* 0ECB98 7F0BA1A8 A42FCFB6 */ sh $t7, %lo(g_EnvironmentMainp+0x2a)($at)
/* 0ECB9C 7F0BA1AC 904E0010 */ lbu $t6, 0x10($v0)
/* 0ECBA0 7F0BA1B0 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000
/* 0ECBA4 7F0BA1B4 448E2000 */ mtc1 $t6, $f4
/* 0ECBA8 7F0BA1B8 05C10004 */ bgez $t6, .L7F0BA1CC
/* 0ECBAC 7F0BA1BC 468024A0 */ cvt.s.w $f18, $f4
/* 0ECBB0 7F0BA1C0 44813000 */ mtc1 $at, $f6
/* 0ECBB4 7F0BA1C4 00000000 */ nop
/* 0ECBB8 7F0BA1C8 46069480 */ add.s $f18, $f18, $f6
.L7F0BA1CC:
/* 0ECBBC 7F0BA1CC 90780010 */ lbu $t8, 0x10($v1)
/* 0ECBC0 7F0BA1D0 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000
/* 0ECBC4 7F0BA1D4 44984000 */ mtc1 $t8, $f8
/* 0ECBC8 7F0BA1D8 07010004 */ bgez $t8, .L7F0BA1EC
/* 0ECBCC 7F0BA1DC 468042A0 */ cvt.s.w $f10, $f8
/* 0ECBD0 7F0BA1E0 44812000 */ mtc1 $at, $f4
/* 0ECBD4 7F0BA1E4 00000000 */ nop
/* 0ECBD8 7F0BA1E8 46045280 */ add.s $f10, $f10, $f4
.L7F0BA1EC:
/* 0ECBDC 7F0BA1EC 46125181 */ sub.s $f6, $f10, $f18
/* 0ECBE0 7F0BA1F0 24080001 */ li $t0, 1
/* 0ECBE4 7F0BA1F4 3C014F00 */ li $at, 0x4F000000 # 2147483648.000000
/* 0ECBE8 7F0BA1F8 46066202 */ mul.s $f8, $f12, $f6
/* 0ECBEC 7F0BA1FC 46089100 */ add.s $f4, $f18, $f8
/* 0ECBF0 7F0BA200 4459F800 */ cfc1 $t9, $31
/* 0ECBF4 7F0BA204 44C8F800 */ ctc1 $t0, $31
/* 0ECBF8 7F0BA208 00000000 */ nop
/* 0ECBFC 7F0BA20C 460022A4 */ cvt.w.s $f10, $f4
/* 0ECC00 7F0BA210 4448F800 */ cfc1 $t0, $31
/* 0ECC04 7F0BA214 00000000 */ nop
/* 0ECC08 7F0BA218 31080078 */ andi $t0, $t0, 0x78
/* 0ECC0C 7F0BA21C 51000013 */ beql $t0, $zero, .L7F0BA26C
/* 0ECC10 7F0BA220 44085000 */ mfc1 $t0, $f10
/* 0ECC14 7F0BA224 44815000 */ mtc1 $at, $f10
/* 0ECC18 7F0BA228 24080001 */ li $t0, 1
/* 0ECC1C 7F0BA22C 460A2281 */ sub.s $f10, $f4, $f10
/* 0ECC20 7F0BA230 44C8F800 */ ctc1 $t0, $31
/* 0ECC24 7F0BA234 00000000 */ nop
/* 0ECC28 7F0BA238 460052A4 */ cvt.w.s $f10, $f10
/* 0ECC2C 7F0BA23C 4448F800 */ cfc1 $t0, $31
/* 0ECC30 7F0BA240 00000000 */ nop
/* 0ECC34 7F0BA244 31080078 */ andi $t0, $t0, 0x78
/* 0ECC38 7F0BA248 15000005 */ bnez $t0, .L7F0BA260
/* 0ECC3C 7F0BA24C 00000000 */ nop
/* 0ECC40 7F0BA250 44085000 */ mfc1 $t0, $f10
/* 0ECC44 7F0BA254 3C018000 */ lui $at, 0x8000
/* 0ECC48 7F0BA258 10000007 */ b .L7F0BA278
/* 0ECC4C 7F0BA25C 01014025 */ or $t0, $t0, $at
.L7F0BA260:
/* 0ECC50 7F0BA260 10000005 */ b .L7F0BA278
/* 0ECC54 7F0BA264 2408FFFF */ li $t0, -1
/* 0ECC58 7F0BA268 44085000 */ mfc1 $t0, $f10
.L7F0BA26C:
/* 0ECC5C 7F0BA26C 00000000 */ nop
/* 0ECC60 7F0BA270 0500FFFB */ bltz $t0, .L7F0BA260
/* 0ECC64 7F0BA274 00000000 */ nop
.L7F0BA278:
/* 0ECC68 7F0BA278 3C018007 */ lui $at, %hi(g_EnvironmentMainp+0x2c) # $at, 0x8007
/* 0ECC6C 7F0BA27C A028CFB8 */ sb $t0, %lo(g_EnvironmentMainp+0x2c)($at)
/* 0ECC70 7F0BA280 90490011 */ lbu $t1, 0x11($v0)
/* 0ECC74 7F0BA284 44D9F800 */ ctc1 $t9, $31
/* 0ECC78 7F0BA288 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000
/* 0ECC7C 7F0BA28C 44893000 */ mtc1 $t1, $f6
/* 0ECC80 7F0BA290 05210004 */ bgez $t1, .L7F0BA2A4
/* 0ECC84 7F0BA294 46803220 */ cvt.s.w $f8, $f6
/* 0ECC88 7F0BA298 44812000 */ mtc1 $at, $f4
/* 0ECC8C 7F0BA29C 00000000 */ nop
/* 0ECC90 7F0BA2A0 46044200 */ add.s $f8, $f8, $f4
.L7F0BA2A4:
/* 0ECC94 7F0BA2A4 E7A80018 */ swc1 $f8, 0x18($sp)
/* 0ECC98 7F0BA2A8 906A0011 */ lbu $t2, 0x11($v1)
/* 0ECC9C 7F0BA2AC C7A80018 */ lwc1 $f8, 0x18($sp)
/* 0ECCA0 7F0BA2B0 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000
/* 0ECCA4 7F0BA2B4 448A5000 */ mtc1 $t2, $f10
/* 0ECCA8 7F0BA2B8 310900F8 */ andi $t1, $t0, 0xf8
/* 0ECCAC 7F0BA2BC 05410004 */ bgez $t2, .L7F0BA2D0
/* 0ECCB0 7F0BA2C0 468051A0 */ cvt.s.w $f6, $f10
/* 0ECCB4 7F0BA2C4 44812000 */ mtc1 $at, $f4
/* 0ECCB8 7F0BA2C8 00000000 */ nop
/* 0ECCBC 7F0BA2CC 46043180 */ add.s $f6, $f6, $f4
.L7F0BA2D0:
/* 0ECCC0 7F0BA2D0 46083281 */ sub.s $f10, $f6, $f8
/* 0ECCC4 7F0BA2D4 240C0001 */ li $t4, 1
/* 0ECCC8 7F0BA2D8 3C014F00 */ li $at, 0x4F000000 # 2147483648.000000
/* 0ECCCC 7F0BA2DC 460A6102 */ mul.s $f4, $f12, $f10
/* 0ECCD0 7F0BA2E0 46044180 */ add.s $f6, $f8, $f4
/* 0ECCD4 7F0BA2E4 444BF800 */ cfc1 $t3, $31
/* 0ECCD8 7F0BA2E8 44CCF800 */ ctc1 $t4, $31
/* 0ECCDC 7F0BA2EC 00000000 */ nop
/* 0ECCE0 7F0BA2F0 460032A4 */ cvt.w.s $f10, $f6
/* 0ECCE4 7F0BA2F4 444CF800 */ cfc1 $t4, $31
/* 0ECCE8 7F0BA2F8 00000000 */ nop
/* 0ECCEC 7F0BA2FC 318C0078 */ andi $t4, $t4, 0x78
/* 0ECCF0 7F0BA300 51800013 */ beql $t4, $zero, .L7F0BA350
/* 0ECCF4 7F0BA304 440C5000 */ mfc1 $t4, $f10
/* 0ECCF8 7F0BA308 44815000 */ mtc1 $at, $f10
/* 0ECCFC 7F0BA30C 240C0001 */ li $t4, 1
/* 0ECD00 7F0BA310 460A3281 */ sub.s $f10, $f6, $f10
/* 0ECD04 7F0BA314 44CCF800 */ ctc1 $t4, $31
/* 0ECD08 7F0BA318 00000000 */ nop
/* 0ECD0C 7F0BA31C 460052A4 */ cvt.w.s $f10, $f10
/* 0ECD10 7F0BA320 444CF800 */ cfc1 $t4, $31
/* 0ECD14 7F0BA324 00000000 */ nop
/* 0ECD18 7F0BA328 318C0078 */ andi $t4, $t4, 0x78
/* 0ECD1C 7F0BA32C 15800005 */ bnez $t4, .L7F0BA344
/* 0ECD20 7F0BA330 00000000 */ nop
/* 0ECD24 7F0BA334 440C5000 */ mfc1 $t4, $f10
/* 0ECD28 7F0BA338 3C018000 */ lui $at, 0x8000
/* 0ECD2C 7F0BA33C 10000007 */ b .L7F0BA35C
/* 0ECD30 7F0BA340 01816025 */ or $t4, $t4, $at
.L7F0BA344:
/* 0ECD34 7F0BA344 10000005 */ b .L7F0BA35C
/* 0ECD38 7F0BA348 240CFFFF */ li $t4, -1
/* 0ECD3C 7F0BA34C 440C5000 */ mfc1 $t4, $f10
.L7F0BA350:
/* 0ECD40 7F0BA350 00000000 */ nop
/* 0ECD44 7F0BA354 0580FFFB */ bltz $t4, .L7F0BA344
/* 0ECD48 7F0BA358 00000000 */ nop
.L7F0BA35C:
/* 0ECD4C 7F0BA35C 3C018007 */ lui $at, %hi(g_EnvironmentMainp+0x2d) # $at, 0x8007
/* 0ECD50 7F0BA360 A02CCFB9 */ sb $t4, %lo(g_EnvironmentMainp+0x2d)($at)
/* 0ECD54 7F0BA364 904D0012 */ lbu $t5, 0x12($v0)
/* 0ECD58 7F0BA368 44CBF800 */ ctc1 $t3, $31
/* 0ECD5C 7F0BA36C 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000
/* 0ECD60 7F0BA370 448D4000 */ mtc1 $t5, $f8
/* 0ECD64 7F0BA374 318B00F8 */ andi $t3, $t4, 0xf8
/* 0ECD68 7F0BA378 05A10004 */ bgez $t5, .L7F0BA38C
/* 0ECD6C 7F0BA37C 46804120 */ cvt.s.w $f4, $f8
/* 0ECD70 7F0BA380 44813000 */ mtc1 $at, $f6
/* 0ECD74 7F0BA384 00000000 */ nop
/* 0ECD78 7F0BA388 46062100 */ add.s $f4, $f4, $f6
.L7F0BA38C:
/* 0ECD7C 7F0BA38C E7A4001C */ swc1 $f4, 0x1c($sp)
/* 0ECD80 7F0BA390 906F0012 */ lbu $t7, 0x12($v1)
/* 0ECD84 7F0BA394 C7A4001C */ lwc1 $f4, 0x1c($sp)
/* 0ECD88 7F0BA398 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000
/* 0ECD8C 7F0BA39C 448F5000 */ mtc1 $t7, $f10
/* 0ECD90 7F0BA3A0 05E10004 */ bgez $t7, .L7F0BA3B4
/* 0ECD94 7F0BA3A4 46805220 */ cvt.s.w $f8, $f10
/* 0ECD98 7F0BA3A8 44813000 */ mtc1 $at, $f6
/* 0ECD9C 7F0BA3AC 00000000 */ nop
/* 0ECDA0 7F0BA3B0 46064200 */ add.s $f8, $f8, $f6
.L7F0BA3B4:
/* 0ECDA4 7F0BA3B4 46044281 */ sub.s $f10, $f8, $f4
/* 0ECDA8 7F0BA3B8 24180001 */ li $t8, 1
/* 0ECDAC 7F0BA3BC 3C014F00 */ li $at, 0x4F000000 # 2147483648.000000
/* 0ECDB0 7F0BA3C0 460A6182 */ mul.s $f6, $f12, $f10
/* 0ECDB4 7F0BA3C4 46062200 */ add.s $f8, $f4, $f6
/* 0ECDB8 7F0BA3C8 444EF800 */ cfc1 $t6, $31
/* 0ECDBC 7F0BA3CC 44D8F800 */ ctc1 $t8, $31
/* 0ECDC0 7F0BA3D0 00000000 */ nop
/* 0ECDC4 7F0BA3D4 460042A4 */ cvt.w.s $f10, $f8
/* 0ECDC8 7F0BA3D8 4458F800 */ cfc1 $t8, $31
/* 0ECDCC 7F0BA3DC 00000000 */ nop
/* 0ECDD0 7F0BA3E0 33180078 */ andi $t8, $t8, 0x78
/* 0ECDD4 7F0BA3E4 53000013 */ beql $t8, $zero, .L7F0BA434
/* 0ECDD8 7F0BA3E8 44185000 */ mfc1 $t8, $f10
/* 0ECDDC 7F0BA3EC 44815000 */ mtc1 $at, $f10
/* 0ECDE0 7F0BA3F0 24180001 */ li $t8, 1
/* 0ECDE4 7F0BA3F4 460A4281 */ sub.s $f10, $f8, $f10
/* 0ECDE8 7F0BA3F8 44D8F800 */ ctc1 $t8, $31
/* 0ECDEC 7F0BA3FC 00000000 */ nop
/* 0ECDF0 7F0BA400 460052A4 */ cvt.w.s $f10, $f10
/* 0ECDF4 7F0BA404 4458F800 */ cfc1 $t8, $31
/* 0ECDF8 7F0BA408 00000000 */ nop
/* 0ECDFC 7F0BA40C 33180078 */ andi $t8, $t8, 0x78
/* 0ECE00 7F0BA410 17000005 */ bnez $t8, .L7F0BA428
/* 0ECE04 7F0BA414 00000000 */ nop
/* 0ECE08 7F0BA418 44185000 */ mfc1 $t8, $f10
/* 0ECE0C 7F0BA41C 3C018000 */ lui $at, 0x8000
/* 0ECE10 7F0BA420 10000007 */ b .L7F0BA440
/* 0ECE14 7F0BA424 0301C025 */ or $t8, $t8, $at
.L7F0BA428:
/* 0ECE18 7F0BA428 10000005 */ b .L7F0BA440
/* 0ECE1C 7F0BA42C 2418FFFF */ li $t8, -1
/* 0ECE20 7F0BA430 44185000 */ mfc1 $t8, $f10
.L7F0BA434:
/* 0ECE24 7F0BA434 00000000 */ nop
/* 0ECE28 7F0BA438 0700FFFB */ bltz $t8, .L7F0BA428
/* 0ECE2C 7F0BA43C 00000000 */ nop
.L7F0BA440:
/* 0ECE30 7F0BA440 3C018007 */ lui $at, %hi(g_EnvironmentMainp+0x2e) # $at, 0x8007
/* 0ECE34 7F0BA444 A038CFBA */ sb $t8, %lo(g_EnvironmentMainp+0x2e)($at)
/* 0ECE38 7F0BA448 44CEF800 */ ctc1 $t6, $31
/* 0ECE3C 7F0BA44C 330F00F8 */ andi $t7, $t8, 0xf8
/* 0ECE40 7F0BA450 A029CFB8 */ sb $t1, %lo(g_EnvironmentMainp+0x2c)($at)
/* 0ECE44 7F0BA454 A02BCFB9 */ sb $t3, %lo(g_EnvironmentMainp+0x2d)($at)
/* 0ECE48 7F0BA458 0FC2E67E */ jal fogLoadCurrentEnvironment
/* 0ECE4C 7F0BA45C A02FCFBA */ sb $t7, %lo(g_EnvironmentMainp+0x2e)($at)
/* 0ECE50 7F0BA460 8FBF0014 */ lw $ra, 0x14($sp)
/* 0ECE54 7F0BA464 27BD0020 */ addiu $sp, $sp, 0x20
/* 0ECE58 7F0BA468 03E00008 */ jr $ra
/* 0ECE5C 7F0BA46C 00000000 */ nop
)
#endif
/**
* @param gdl:
@@ -1179,28 +642,28 @@ s32 fogGetPropDistColor(PropRecord *prop, rgba_f32 *color)
{
if (g_FogSkyIsEnabled == 0)
{
return 2;
return 2; // No fog, props cannot be obscured by fog
}
if (prop->Unk18 < 0.0f)
if (prop->zDepth < 0.0f)
{
return 2;
return 2; // Prop is behind the camera
}
color->rgba[0] = (f32) g_CurrentEnvironment.Red / 255.0f;
color->rgba[1] = (f32) g_CurrentEnvironment.Green / 255.0f;
color->rgba[2] = (f32) g_CurrentEnvironment.Blue / 255.0f;
color->rgba[3] = (g_CurFogDetails.far_fog_dist_scaled / prop->Unk18) + g_CurFogDetails.near_fog_dist_scaled;
color->rgba[3] = (g_CurFogDetails.far_fog_dist_scaled / prop->zDepth) + g_CurFogDetails.near_fog_dist_scaled;
if (color->rgba[3] < 0.0f)
{
return 2;
return 2; // Prop has no fog effect coloring applied to it
}
if (color->rgba[3] > 1.0f)
{
return 0;
return 0; // Prop is completely obscured by fog (don't render)
}
return 1;
return 1; // Fog color will be applied to prop
}
+1169 -1034
View File
File diff suppressed because it is too large Load Diff
+31 -1
View File
@@ -4,6 +4,36 @@
#include <bondgame.h>
#include <bondconstants.h>
#define TABS_LEFT_EDGE 390.0f
#define TABS_RIGHT_EDGE 411
#define NEXTTAB_CURSOR_HPOS 399.0f
#define NEXTTAB_CURSOR_VPOS 144.0f
#define STARTTAB_TAB_TOP 40.0f
#define STARTTAB_TEXT_TOP 51
//#define STARTTAB_TEXT_HALF 84
#define STARTTAB_TEXT_HALF (STARTTAB_TEXT_TOP + ((STARTTAB_TEXT_BOTTOM-STARTTAB_TEXT_TOP)/2))
#define STARTTAB_TEXT_BOTTOM 117
#define STARTTAB_TAB_BOTTOM 130.5f
#define NEXTTAB_TAB_TOP 130.5f
#define NEXTTAB_TEXT_TOP 144
//#define NEXTTAB_TEXT_HALF 177
#define NEXTTAB_TEXT_HALF (NEXTTAB_TEXT_TOP + ((NEXTTAB_TEXT_BOTTOM-NEXTTAB_TEXT_TOP)/2))
#define NEXTTAB_TEXT_BOTTOM 210
#define NEXTTAB_TAB_BOTTOM 223.0f
#define PREVTAB_TAB_TOP 223.0f
#define PREVTAB_TEXT_TOP 236
//#define PREVTAB_TEXT_HALF 269
#define PREVTAB_TEXT_HALF (PREVTAB_TEXT_TOP + ((PREVTAB_TEXT_BOTTOM-PREVTAB_TEXT_TOP)/2))
#define PREVTAB_TEXT_BOTTOM 302
#define PREVTAB_TAB_BOTTOM 315.0f
struct legal_screen_text {
s32 h_pos;
s32 v_pos;
@@ -311,7 +341,7 @@ int get_mp_timelimit(void);
int get_mp_pointlimit(void);
void reset_mp_options_for_scenario(MPSCENARIOS scenarioid);
void copy_aim_settings_to_playerdata(void);
void menu_init();
void menu_init(void);
Gfx * menu_jump_constructor_handler(Gfx *DL);
void unlock_all_mp_chars(void);
u8 get_player_mp_char_gender(int player);
+183 -146
View File
File diff suppressed because it is too large Load Diff
+4 -1
View File
@@ -274,6 +274,9 @@ struct EarWhistleSounds {
};
extern CasingRecord g_Casings[20];
extern u32 size_item_buffer[];
extern WeaponStats sniperrifle_stats;
extern WeaponStats camera_stats;
f32 bondwalkItemGetForceOfImpact(ITEM_IDS item);
@@ -305,7 +308,7 @@ s32 get_max_ammo_for_type(s32);
void give_cur_player_ammo(s32, s32);
s8 bondwalkItemGetAutomaticFiringRate(ITEM_IDS item);
void inc_cur_civilian_casualties(void);
void increment_num_kills_display_text_in_MP();
void increment_num_kills_display_text_in_MP(void);
f32 bondwalkItemGetDestructionAmount(ITEM_IDS item);
u16 bondwalkItemGetSound(ITEM_IDS item);
u8 bondwalkItemGetSoundTriggerRate(ITEM_IDS item);
+174 -69
View File
@@ -530,9 +530,113 @@ s32 texShrinkPaletted(u8 *src, u8 *dst, s32 srcwidth, s32 srcheight, s32 format,
#ifdef NONMATCHING
void texFindClosestColourIndexRGBA(void) {
// https://decomp.me/scratch/m2ol7 79.87%
s32 texFindClosestColourIndexRGBA(u16 *palette, s32 numcolours, s32 r, s32 g, s32 b, s32 a)
{
s32 var_v1;
u16 temp_t6;
s32 temp_t0;
s32 var_a1;
s32 temp_a0;
s32 loop_start;
s32 loop_end;
s32 bestindex;
s32 bestvalue;
u16 local_color;
s32 local_r;
s32 local_g;
s32 local_b;
s32 local_a;
s32 temp_s4;
temp_t6 = ((r << 11) | (g << 6) | (b << 1) | a);
for (var_v1 = 0; var_v1 < numcolours; var_v1++)
{
if (temp_t6 == palette[var_v1])
{
return var_v1;
}
}
temp_t0 = (r * r) + (g * g) + (b * b) + (a * 0x3C1);
var_v1 = numcolours - 1;
var_a1 = 0;
// binary search for a region
while (var_v1 - var_a1 >= 2)
{
temp_a0 = (s32) (var_v1 + var_a1) >> 1;
local_color = palette[temp_a0 * 4];
local_r = ((s32) local_color >> 0xB) & 0x1F;
local_g = ((s32) local_color >> 0x6) & 0x1F;
local_b = ((s32) local_color >> 0x1) & 0x1F;
local_a = local_color & 1;
temp_s4 = (local_r * local_r) + (local_g * local_g) + (local_b * local_b) + (local_a * 0x3C1);
if (temp_s4 < temp_t0)
{
var_a1 = temp_a0;
}
else
{
if (temp_t0 < temp_s4)
{
var_v1 = temp_a0;
}
else
{
var_v1 = temp_a0;
var_a1 = temp_a0;
}
}
}
loop_start = var_v1 - 4;
if (loop_start < 0)
{
loop_start = 0;
}
loop_end = var_v1 + 4;
if (loop_end >= numcolours)
{
loop_end = numcolours - 1;
}
bestindex = 0;
bestvalue = 999999;
// search for best within the region
for (var_v1 = loop_start; var_v1 < loop_end; var_v1++)
{
local_color = palette[var_v1 * 4];
local_r = (((s32) local_color >> 0xB) & 0x1F) - r;
local_g = (((s32) local_color >> 0x6) & 0x1F) - g;
local_b = (((s32) local_color >> 0x1) & 0x1F) - b;
local_a = 0x3C1;
if (a == (local_color & 1))
{
local_a = 0;
}
temp_s4 = (local_r * local_r) + (local_g * local_g) + (local_b * local_b) + (local_a);
if (temp_s4 < bestvalue)
{
bestindex = var_v1;
bestvalue = temp_s4;
}
}
return bestindex;
}
#else
GLOBAL_ASM(
.text
@@ -839,103 +943,104 @@ glabel texFindClosestColourIndexRGBA
#ifdef NONMATCHING
// 99.38% : regalloc problems
// https://decomp.me/scratch/tmXxj 99.64%
s32 texFindClosestColourIndexIA(u16 *palette, s32 numcolours, s32 intensity, s32 alpha)
{
s32 loop_start;
s32 loop_end;
s32 i;
s32 j;
s32 bestindex;
s32 bestvalue;
s32 low;
s32 colour;
s32 value;
s32 a;
s32 b;
s32 sum;
u32 sum2; // is this real?
// check palette for existing color
colour = (intensity << 8) | alpha;
for (i = 0; i < numcolours; i++)
{
s32 i;
s32 colour;
colour = (intensity << 8) | alpha;
for (i = 0; i < numcolours; i++)
if (palette[i] == (colour & 0xFFFFU))
{
if (palette[i] == (colour & 0xFFFFU))
{
return i;
}
return i;
}
}
// binary search for a region
low = 0;
loop_end = numcolours - 1;
colour = (intensity * intensity) + (alpha * alpha);
while ((loop_end - low) >= 2)
{
s32 low;
s32 colour;
s32 a;
s32 b;
s32 sum;
s32 index;
s32 value;
low = 0;
loop_end = numcolours - 1;
colour = (intensity * intensity) + (alpha * alpha);
while ((loop_end - low) >= 2)
index = (loop_end + low) >> 1;
value = palette[index];
a = (((s32) value) >> 8) & 0xFF;
b = value & 0xFF;
sum = (a * a) + (b * b);
if (sum < colour)
{
index = (loop_end + low) >> 1;
value = palette[index];
a = (((s32) value) >> 8) & 0xFF;
b = value & 0xFF;
sum = (a * a) + (b * b);
if (sum < colour)
{
low = index;
continue;
}
if (colour < sum)
{
loop_end = index;
}
else
{
low = index;
loop_end = index;
}
low = index;
continue;
}
if (colour < sum)
{
loop_end = index;
}
else
{
low = index;
loop_end = index;
}
}
loop_start = loop_end - 4;
if (loop_start < 0) { loop_start = 0; }
loop_start = loop_end - 4;
if (loop_start < 0)
{
loop_start = 0;
}
loop_end += 4;
if (loop_end >= numcolours) { loop_end = numcolours - 1; }
loop_end += 4;
if (loop_end >= numcolours)
{
loop_end = numcolours - 1;
}
// search for best within the region
bestindex = 0;
bestvalue = 999999;
for (j = loop_start; j <= loop_end; j++)
{
s32 bestindex;
s32 bestvalue;
s32 value;
s32 a;
s32 b;
u32 sum2;
s32 sum;
s32 index;
value = palette[j];
a = ((value >> 8) & 0xff) - intensity;
b = (value & 0xff) - alpha;
sum = (a * a) + (b * b);
bestindex = 0;
bestvalue = 999999;
sum2 = sum;
for (index = loop_start; index <= loop_end; index++)
if (sum < bestvalue)
{
value = palette[index];
a = ((value >> 8) & 0xff) - intensity;
b = (value & 0xff) - alpha;
sum2 = (a * a) + (b * b);
sum = sum2;
if (sum < bestvalue)
{
bestindex = index;
bestvalue = sum;
}
bestindex = j;
bestvalue = sum;
}
return bestindex;
// Seems to need to be any variable used in the loop here?
if (j);
}
}
return bestindex;
}
#else
GLOBAL_ASM(
.text
+2
View File
@@ -2,6 +2,7 @@
#define _IMAGE_H_
#include <ultra64.h>
#include <bondconstants.h>
#include <bondtypes.h>
#define TEXFORMAT_RGBA32 0x00 // 32-bit RGBA (8/8/8/8)
#define TEXFORMAT_RGBA16 0x01 // 16-bit RGBA (5/5/5/1)
@@ -92,5 +93,6 @@ s32 texInflateZlib(u8 *src, u8 *dst, s32 arg2, s32 forcenumimages, struct texpoo
void texLoad(s32 *updateword, struct texpool *pool);
void texInitPool(struct texpool *arg0, u8 *arg1, s32 arg2);
void texLoadFromTextureNum(s32 texturenum, struct texpool *arg1);
void texLoadFromModelFileHeader(ModelFileHeader* arg0, struct texpool* arg1);
#endif
+1 -1
View File
@@ -170,7 +170,7 @@ void texReset(void)
s32 i;
size = (u32)&_GlobalimagetableSegmentEnd - (u32)&_GlobalimagetableSegmentStart;
pGlobalimagetable = mempAllocBytesInBank(size + 0x1000, 4U);
pGlobalimagetable = mempAllocBytesInBank(size + 0x1000, MEMPOOL_STAGE);
pGlobalimagetable = ((u32)pGlobalimagetable + 0xFFFU) & 0xFFFFF000;
romCopy(pGlobalimagetable, &_GlobalimagetableSegmentRomStart, size);
+3
View File
@@ -12,9 +12,12 @@ extern struct sImageTableEntry *genericimage;
extern struct sImageTableEntry *skywaterimages;
extern struct sImageTableEntry *monitorimages;
extern struct sImageTableEntry *mpcharselimages;
extern struct sImageTableEntry *mpradarimages;
extern struct sImageTableEntry *impactimages;
extern u8* img_curpos;
extern s32 img_bitcount;
extern s32 *pGlobalimagetable;
void texReset(void);
u32 texReadBits(s32 bitCount);
+252 -337
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -128,7 +128,7 @@ typedef struct indy_resource_entry_type10 {
extern s32 indy_ready;
s32 indycmdSendCommand(struct indy_resource_entry_header *cmd,u32 size);
s32 indycmdSendCommand(u8 *buffer, u32 size);
s32 indycmdSendInitPacket(void);
s32 indycmdSendHostCheckFileExists(char *strptr);
@@ -138,7 +138,7 @@ s32 indycmdSendRamRomLoad(char *strptr,u32 ptarget,u32 filesize);
s32 indycmdSendHostExportFile(char *strptr,u8 *phwaddr,u32 size);
s32 indycmdSendHostCmdPacket(char *strptr);
s32 indycmdRecieveCommand(struct indy_resource_entry_header *resource,u32 size);
s32 indycmdRecieveCommand(u8 *buffer, u32 size);
s32 indycmdAckHostCheckFileExists(u8 *response1,u8 *response2);
s32 indycmdReceiveFile(u8 *response1,u8 *response2,u32 childsize,u8 *child);
+275 -587
View File
@@ -1,6 +1,11 @@
#include <ultra64.h>
#include <memp.h>
#include "initBondDATA.h"
#include "bondtypes.h"
#include "bondconstants.h"
#include "bondview.h"
#include "gun.h"
#include "player.h"
#ifdef REFRESH_PAL
@@ -8,111 +13,274 @@
#else
#define VALUENAME 19.999996
#endif
struct BONDdata_item_control_blocks hand_data_dummy = {
0, 0xFFFFFFFF, 0, 0x100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.0, 0, 0, 0, 0, 1.0, 0, 0, 0, 0, 1.0, 0,
0, 0, 0, 1.0, 0, 0, 0, 0, 0, 0, -1.0, 0, 1.0, 0, 0, 0, 0, 0, 0, -VALUENAME, 0,
VALUENAME, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1.0, 0, 0, -1.0, 0, 0,
-1.0, 0, 0, -1.0, 0, 1.0, 0, 0, 1.0, 0, 0, 1.0, 0, 0, 1.0, 0, 0, 0, 1.0, 1.0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1000.0, 0, 0, 0, 0, 0xFF000000, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0
struct hand hand_data_dummy = {
0, // ITEM_IDS weaponnum;
0xFFFFFFFF, // ITEM_IDS weaponnum_watchmenu;
0, // ITEM_IDS previous_weapon;
0, // s8 weapon_firing_status;
0, // s8 field_87D;
0x1, // s8 field_87E;
0, // s8 field_87F;
0, // s32 weapon_hold_time;
0, // s32 field_884;
0, // s32 field_888;
0, // s32 field_88C;
0, // s32 field_890;
0, // s32 when_detonating_mines_is_0;
0, // s32 weapon_current_animation;
0, // s32 weapon_ammo_in_magazine;
0, // s32 field_8A0;
0, // s32 field_8A4;
0, // s32 field_8A8;
0, // s32 weapon_next_weapon;
0, // s32 field_8B0;
0, // s32 weapon_animation_trigger;
0, // s32 field_8B8;
0, // s32 field_8BC;
0, // s32 field_8C0;
0, // s32 field_8C4;
0, // s32 field_8C8;
0, // s32 field_8CC;
0, // s32 field_8D0;
0, // s32 field_8D4;
0, // s32 field_8D8;
0, // s32 field_8DC;
0, // s32 field_8E0;
0, // s32 field_8E4;
0, // s32 field_8E8;
// Mtxf field_8EC;
1.0f,0,0,0,
0,1.0f,0,0,
0,0,1.0f,0,
0,0,0,1.0f,
0, // s32 field_92C;
0, // s32 field_930;
0, // s32 field_934;
0, // s32 field_938;
0, // s32 field_93C;
0, // s32 field_940;
-1.0f, // s32 field_944;
0, // s32 field_948;
1.0f, // s32 field_94C;
0, // s32 field_950;
0, // s32 field_954;
0, // s32 field_958;
0, // s32 field_95C;
0, // s32 field_960;
0, // s32 field_964;
-VALUENAME, // f32 field_968;
0, // s32 field_96C;
VALUENAME, // f32 field_970;
0, // s32 field_974;
// coord3d blendpos[4];
0,0,0,
0,0,0,
0,0,0,
0,0,0,
// coord3d blendlook[4];
0,0,-1.0f,
0,0,-1.0f,
0,0,-1.0f,
0,0,-1.0f,
// coord3d blendup[4];
0,1.0f,0,
0,1.0f,0,
0,1.0f,0,
0,1.0f,0,
0, // s32 curblendpos;
0, // f32 dampt;
1.0f, // f32 blendscale;
1.0f, // f32 blendscale1;
0, // s32 sideflag;
0, // f32 weapon_theta_displacement;
0, // f32 weapon_verta_displacement;
0, // s32 field_A24;
0, // s32 field_A28;
0, // s32 field_A2C;
0, // f32 field_A30;
0, // f32 field_A34;
0, // f32 field_A38;
0, // f32 field_A3C;
1000.0f, // f32 field_A40;
NULL, // ALSoundState * audioHandle;
0, // s32 field_A48;
0, // s32 field_A4C;
0, // s32 field_A50;
// // struct ChrRecord_f180 {
{
0xff, // s8 unk00;
0, // s8 item_id; // type ITEM_IDS
0, // char unk02;
0, // char unk03;
// coord3d pos;
0,0,0,
// /**
// * Offset 0x10
// */
// struct coord3d delta;
0,0,0,
0, // f32 unk1c;
0, // f32 unk20;
0, // f32 unk24;
0 // f32 unk28;
},
// // }
0, // f32 noise;
0, // f32 field_A84;
0, // f32 field_A88;
0, // s32 field_A8C;
NULL, // ObjectRecord* rocket;
0, // s32 firedrocket;
0, // s32 field_A98;
0, // s32 field_A9C;
0, // s32 field_AA0;
0, // s32 field_AA4;
0, // s32 field_AA8;
0, // s32 field_AAC;
0, // s32 field_AB0;
0, // s32 field_AB4;
0, // s32 field_AB8;
0, // s32 field_ABC;
0, // s32 field_AC0;
0, // s32 field_AC4;
0, // s32 field_AC8;
0, // s32 field_ACC;
0, // s32 field_AD0;
0, // s32 field_AD4;
// // offset 0xad8
// Mtxf throw_item_pos_related;
0,0,0,0,
0,0,0,0,
0,0,0,0,
0,0,0,0,
0, // s32 field_B18;
0, // s32 field_B1C;
0, // s32 field_B20;
0, // s32 field_B24;
0, // s32 field_B28;
0, // s32 field_B2C;
0, // s32 field_B30;
0, // s32 field_B34;
0, // s32 field_B38;
0, // s32 field_B3C;
0, // s32 field_B40;
0, // s32 field_B44;
0, // s32 field_B48;
0, // s32 field_B4C;
0, // s32 field_B50;
0, // s32 field_B54;
// coord3d field_B58;
0,0,0,
0, // f32 field_B64;
0, // s32 field_B68;
0, // s32 field_B6C;
0, // s32 field_B70;
0, // s32 field_B74;
0, // s32 field_B78;
0, // s32 field_B7C;
0, // s32 field_B80;
0, // s32 field_B84;
0, // s32 field_B88;
0, // s32 field_B8C;
0, // s32 field_B90;
0, // s32 field_B94;
0, // s32 field_B98;
0, // s32 field_B9C;
0, // s32 field_BA0;
0, // s32 field_BA4;
0, // s32 field_BA8;
0, // s32 field_BAC;
0, // s32 field_BB0;
0, // s32 field_BB4;
0, // s32 field_BB8;
0, // s32 field_BBC;
0, // s32 field_BC0;
0, // s32 field_BC4;
0, // s32 field_BC8;
0, // s32 field_BCC;
0, // s32 field_BD0;
0, // s32 field_BD4;
0, // s32 field_BD8;
0, // s32 field_BDC;
0, // s32 field_BE0;
0, // s32 field_BE4;
0, // s32 field_BE8;
0, // s32 field_BEC;
0, // s32 field_BF0;
0, // s32 field_BF4;
0, // s32 field_BF8;
0, // s32 field_BFC;
0, // s32 field_C00;
0, // s32 field_C04;
0, // s32 volley; // Number of bullets discharged in a row. For pistols, it's always 1 even if the fire button is held.
// coord3d item_related;
0,0,0
};
void init_player_BONDdata_stats(void)
{
s32 i;
struct hand sp24;
sp24 = hand_data_dummy;
#ifdef NONMATCHING
void init_player_BONDdata_stats(void) {
s32 sp24;
s32 temp_v0;
s32 temp_v0_2;
s32* temp_t0;
s32* temp_t4;
s32* temp_t6;
s32* temp_t7;
void* temp_t1;
void* temp_t5;
s32* phi_t7;
s32* phi_t6;
s32* phi_t4;
void* phi_t1;
s32* phi_t0;
void* phi_t5;
s32 phi_v0;
phi_t7 = &BONDdata_item_control_blocks_initdata;
phi_t6 = &sp24;
do {
temp_t7 = phi_t7 + 0xC;
temp_t6 = phi_t6 + 0xC;
temp_t6->unk-C = (s32) *phi_t7;
temp_t6->unk-8 = (s32) temp_t7->unk-8;
temp_t6->unk-4 = (s32) temp_t7->unk-4;
phi_t7 = temp_t7;
phi_t6 = temp_t6;
} while (temp_t7 != (&BONDdata_item_control_blocks_initdata + 0x3A8));
g_CurrentPlayer->hand_item[0] = mempAllocBytesInBank(size_item_buffer, 4);
if (getPlayerCount() == 1) {
g_CurrentPlayer->hand_item[1] = mempAllocBytesInBank(*(&size_item_buffer + 4), 4);
g_CurrentPlayer->ptr_hand_weapon_buffer[GUNRIGHT] = mempAllocBytesInBank(size_item_buffer[0], MEMPOOL_STAGE);
if (getPlayerCount() == 1)
{
g_CurrentPlayer->ptr_hand_weapon_buffer[GUNLEFT] = mempAllocBytesInBank(size_item_buffer[1], MEMPOOL_STAGE);
}
g_CurrentPlayer->hand_invisible[0] = 0;
g_CurrentPlayer->hand_invisible[1] = 0;
g_CurrentPlayer->hand_item[0] = 0;
g_CurrentPlayer->hand_item[1] = 0;
g_CurrentPlayer->field_2A44[0] = -1;
g_CurrentPlayer->field_2A44[1] = -1;
g_CurrentPlayer->lock_hand_model[0] = 0;
g_CurrentPlayer->lock_hand_model[1] = 0;
phi_t4 = &sp24;
phi_t1 = g_CurrentPlayer;
phi_t0 = &sp24;
phi_v0 = 0;
do {
temp_t4 = phi_t4 + 0xC;
temp_t1 = phi_t1 + 0xC;
temp_t1->right_item_related1 = (s32) *phi_t4;
temp_t1->right_item_related2 = (s32) temp_t4->unk-8;
temp_t1->right_item_related3 = (s32) temp_t4->unk-4;
phi_t4 = temp_t4;
phi_t1 = temp_t1;
} while (temp_t4 != (&sp24 + 0x3A8));
phi_t5 = g_CurrentPlayer;
do {
temp_t0 = phi_t0 + 0xC;
temp_t5 = phi_t5 + 0xC;
temp_t5->item_related1 = (s32) *phi_t0;
temp_t5->item_related2 = (s32) temp_t0->unk-8;
temp_t5->item_related3 = (s32) temp_t0->unk-4;
phi_t0 = temp_t0;
phi_t5 = temp_t5;
} while (temp_t0 != (&sp24 + 0x3A8));
do {
temp_v0 = phi_v0 + 4;
(g_CurrentPlayer + phi_v0)->unk1130 = 0;
phi_v0 = temp_v0;
} while (temp_v0 < 0x78);
temp_v0_2 = 3 * 4;
g_playerPerm->pos[0] = 0;
g_playerPerm->pos[1] = 0;
g_playerPerm->pos[2] = 0;
*(g_playerPerm + temp_v0_2) = 0;
(g_playerPerm + temp_v0_2)->unk4 = 0;
(g_playerPerm + temp_v0_2)->unk8 = 0;
(g_playerPerm + temp_v0_2)->unkC = 0;
g_playerPerm->field_6C = 0;
g_playerPerm->unk1C = 0;
g_playerPerm->unk20 = 0;
g_CurrentPlayer->hand_invisible[GUNRIGHT] = 0;
g_CurrentPlayer->hand_invisible[GUNLEFT] = 0;
g_CurrentPlayer->hand_item[GUNRIGHT] = ITEM_UNARMED;
g_CurrentPlayer->hand_item[GUNLEFT] = ITEM_UNARMED;
g_CurrentPlayer->field_2A44[GUNRIGHT] = -1;
g_CurrentPlayer->field_2A44[GUNLEFT] = -1;
g_CurrentPlayer->lock_hand_model[GUNRIGHT] = 0;
g_CurrentPlayer->lock_hand_model[GUNLEFT] = 0;
g_CurrentPlayer->hands[0] = sp24;
g_CurrentPlayer->hands[1] = sp24;
for (i=0; i<30; i++)
{
g_CurrentPlayer->ammoheldarr[i] = 0;
}
for (i=0; i<7; i++)
{
g_playerPerm->shot_count[i] = 0;
}
g_playerPerm->killed_civilians = 0;
g_playerPerm->kill_count = 0;
g_playerPerm->killed_gg_owner_count = 0;
g_CurrentPlayer->deathcount = 0;
g_CurrentPlayer->num_suicides = 0;
g_CurrentPlayer->gunposamplitude = 1;
g_CurrentPlayer->gunxamplitude = 1;
g_CurrentPlayer->gunposamplitude = 1.0f;
g_CurrentPlayer->gunxamplitude = 1.0f;
g_CurrentPlayer->field_FC8 = 0;
g_CurrentPlayer->field_FCC = 0;
g_CurrentPlayer->field_FD0 = 0;
@@ -122,21 +290,21 @@ void init_player_BONDdata_stats(void) {
g_CurrentPlayer->tileColor.rgba[1] = 0xFF;
g_CurrentPlayer->tileColor.rgba[2] = 0xFF;
g_CurrentPlayer->tileColor.rgba[3] = 0;
g_CurrentPlayer->resetshadecol = 1;
g_CurrentPlayer->resetshadecol = TRUE;
g_CurrentPlayer->aimtype = 0;
g_CurrentPlayer->crosshair_angle[] = 0.0f;
g_CurrentPlayer->crosshair_angle[] = 0.0f;
g_CurrentPlayer->crosshair_angle.f[0] = 0.0f;
g_CurrentPlayer->crosshair_angle.f[1] = 0.0f;
g_CurrentPlayer->crosshair_x_pos = 0.0f;
g_CurrentPlayer->crosshair_y_pos = 0.0f;
g_CurrentPlayer->guncrossdamp = 0.9f;
g_CurrentPlayer->field_FFC.x = 0.0f;
g_CurrentPlayer->field_FFC.y = 0.0f;
g_CurrentPlayer->field_FFC.f[0] = 0.0f;
g_CurrentPlayer->field_FFC.f[1] = 0.0f;
g_CurrentPlayer->gun_azimuth_angle = 0.0f;
g_CurrentPlayer->gun_azimuth_turning = 0.0f;
g_CurrentPlayer->gunaimdamp = 0.9f;
g_CurrentPlayer->field_1010 = 0.0f;
g_CurrentPlayer->holds_neg_pi = -M_PI_F;
g_CurrentPlayer->unk1018 = 0.0f;
g_CurrentPlayer->field_1010.f[0] = 0.0f;
g_CurrentPlayer->field_1010.f[1] = -3.1415927f;
g_CurrentPlayer->field_1010.f[2] = 0.0f;
g_CurrentPlayer->copiedgoldeneye = FALSE;
g_CurrentPlayer->magnetattracttime = -1;
g_CurrentPlayer->gunsync = 0.0f;
@@ -151,488 +319,8 @@ void init_player_BONDdata_stats(void) {
bgunCalculateBlend(GUNLEFT);
bgunCalculateBlend(GUNLEFT);
bgunCalculateBlend(GUNLEFT);
g_CurrentPlayer->gunammooff = 0;
g_CurrentPlayer->gunsightmode = 2; //GUNSIGHTREASON_AIMING
g_CurrentPlayer->gunammooff = FALSE;
g_CurrentPlayer->gunsightmode = 2;
g_CurrentPlayer->sniper_zoom = sniperrifle_stats.Zoom;
g_CurrentPlayer->camera_zoom = camera_stats.Zoom;
}
#else
#if defined(LEFTOVERDEBUG)
GLOBAL_ASM(
.late_rodata
glabel D_8004F0E0
.word 0x3f666666
glabel fl_neg_pi
.word 0xc0490fdb
.text
glabel init_player_BONDdata_stats
/* 039C00 7F0050D0 27BDFC30 */ addiu $sp, $sp, -0x3d0
/* 039C04 7F0050D4 3C0F8003 */ lui $t7, %hi(hand_data_dummy)
/* 039C08 7F0050D8 25EFA3D0 */ addiu $t7, %lo(hand_data_dummy) # addiu $t7, $t7, -0x5c30
/* 039C0C 7F0050DC AFBF001C */ sw $ra, 0x1c($sp)
/* 039C10 7F0050E0 AFB00018 */ sw $s0, 0x18($sp)
/* 039C14 7F0050E4 25E803A8 */ addiu $t0, $t7, 0x3a8
/* 039C18 7F0050E8 27AE0024 */ addiu $t6, $sp, 0x24
.L7F0050EC:
/* 039C1C 7F0050EC 8DE10000 */ lw $at, ($t7)
/* 039C20 7F0050F0 25EF000C */ addiu $t7, $t7, 0xc
/* 039C24 7F0050F4 25CE000C */ addiu $t6, $t6, 0xc
/* 039C28 7F0050F8 ADC1FFF4 */ sw $at, -0xc($t6)
/* 039C2C 7F0050FC 8DE1FFF8 */ lw $at, -8($t7)
/* 039C30 7F005100 ADC1FFF8 */ sw $at, -8($t6)
/* 039C34 7F005104 8DE1FFFC */ lw $at, -4($t7)
/* 039C38 7F005108 15E8FFF8 */ bne $t7, $t0, .L7F0050EC
/* 039C3C 7F00510C ADC1FFFC */ sw $at, -4($t6)
/* 039C40 7F005110 3C048003 */ lui $a0, %hi(size_item_buffer)
/* 039C44 7F005114 8C84245C */ lw $a0, %lo(size_item_buffer)($a0)
/* 039C48 7F005118 0C0025C8 */ jal mempAllocBytesInBank
/* 039C4C 7F00511C 24050004 */ li $a1, 4
/* 039C50 7F005120 3C108008 */ lui $s0, %hi(g_CurrentPlayer)
/* 039C54 7F005124 2610A0B0 */ addiu $s0, %lo(g_CurrentPlayer) # addiu $s0, $s0, -0x5f50
/* 039C58 7F005128 8E090000 */ lw $t1, ($s0)
/* 039C5C 7F00512C 0FC26919 */ jal getPlayerCount
/* 039C60 7F005130 AD220808 */ sw $v0, 0x808($t1)
/* 039C64 7F005134 24010001 */ li $at, 1
/* 039C68 7F005138 14410006 */ bne $v0, $at, .L7F005154
/* 039C6C 7F00513C 3C048003 */ lui $a0, %hi(size_item_buffer+0x4)
/* 039C70 7F005140 8C842460 */ lw $a0, %lo(size_item_buffer+0x4)($a0)
/* 039C74 7F005144 0C0025C8 */ jal mempAllocBytesInBank
/* 039C78 7F005148 24050004 */ li $a1, 4
/* 039C7C 7F00514C 8E0A0000 */ lw $t2, ($s0)
/* 039C80 7F005150 AD42080C */ sw $v0, 0x80c($t2)
.L7F005154:
/* 039C84 7F005154 8E0B0000 */ lw $t3, ($s0)
/* 039C88 7F005158 2405FFFF */ li $a1, -1
/* 039C8C 7F00515C 27A30024 */ addiu $v1, $sp, 0x24
/* 039C90 7F005160 AD6007F8 */ sw $zero, 0x7f8($t3)
/* 039C94 7F005164 8E0C0000 */ lw $t4, ($s0)
/* 039C98 7F005168 246B03A8 */ addiu $t3, $v1, 0x3a8
/* 039C9C 7F00516C 00001025 */ move $v0, $zero
/* 039CA0 7F005170 AD8007FC */ sw $zero, 0x7fc($t4)
/* 039CA4 7F005174 8E0D0000 */ lw $t5, ($s0)
/* 039CA8 7F005178 00606025 */ move $t4, $v1
/* 039CAC 7F00517C ADA00800 */ sw $zero, 0x800($t5)
/* 039CB0 7F005180 8E190000 */ lw $t9, ($s0)
/* 039CB4 7F005184 AF200804 */ sw $zero, 0x804($t9)
/* 039CB8 7F005188 8E180000 */ lw $t8, ($s0)
/* 039CBC 7F00518C AF052A44 */ sw $a1, 0x2a44($t8)
/* 039CC0 7F005190 8E080000 */ lw $t0, ($s0)
/* 039CC4 7F005194 247803A8 */ addiu $t8, $v1, 0x3a8
/* 039CC8 7F005198 AD052A48 */ sw $a1, 0x2a48($t0)
/* 039CCC 7F00519C 8E0F0000 */ lw $t7, ($s0)
/* 039CD0 7F0051A0 00604025 */ move $t0, $v1
/* 039CD4 7F0051A4 3C038008 */ lui $v1, %hi(g_playerPerm)
/* 039CD8 7F0051A8 ADE02A50 */ sw $zero, 0x2a50($t7)
/* 039CDC 7F0051AC 8E0E0000 */ lw $t6, ($s0)
/* 039CE0 7F0051B0 2463A0B4 */ addiu $v1, %lo(g_playerPerm) # addiu $v1, $v1, -0x5f4c
/* 039CE4 7F0051B4 ADC02A54 */ sw $zero, 0x2a54($t6)
/* 039CE8 7F0051B8 8E090000 */ lw $t1, ($s0)
.L7F0051BC:
/* 039CEC 7F0051BC 8D810000 */ lw $at, ($t4)
/* 039CF0 7F0051C0 258C000C */ addiu $t4, $t4, 0xc
/* 039CF4 7F0051C4 2529000C */ addiu $t1, $t1, 0xc
/* 039CF8 7F0051C8 AD210864 */ sw $at, 0x864($t1)
/* 039CFC 7F0051CC 8D81FFF8 */ lw $at, -8($t4)
/* 039D00 7F0051D0 AD210868 */ sw $at, 0x868($t1)
/* 039D04 7F0051D4 8D81FFFC */ lw $at, -4($t4)
/* 039D08 7F0051D8 158BFFF8 */ bne $t4, $t3, .L7F0051BC
/* 039D0C 7F0051DC AD21086C */ sw $at, 0x86c($t1)
/* 039D10 7F0051E0 8E0D0000 */ lw $t5, ($s0)
.L7F0051E4:
/* 039D14 7F0051E4 8D010000 */ lw $at, ($t0)
/* 039D18 7F0051E8 2508000C */ addiu $t0, $t0, 0xc
/* 039D1C 7F0051EC 25AD000C */ addiu $t5, $t5, 0xc
/* 039D20 7F0051F0 ADA10C0C */ sw $at, 0xc0c($t5)
/* 039D24 7F0051F4 8D01FFF8 */ lw $at, -8($t0)
/* 039D28 7F0051F8 ADA10C10 */ sw $at, 0xc10($t5)
/* 039D2C 7F0051FC 8D01FFFC */ lw $at, -4($t0)
/* 039D30 7F005200 1518FFF8 */ bne $t0, $t8, .L7F0051E4
/* 039D34 7F005204 ADA10C14 */ sw $at, 0xc14($t5)
.L7F005208:
/* 039D38 7F005208 8E0F0000 */ lw $t7, ($s0)
/* 039D3C 7F00520C 01E27021 */ addu $t6, $t7, $v0
/* 039D40 7F005210 24420004 */ addiu $v0, $v0, 4
/* 039D44 7F005214 28410078 */ slti $at, $v0, 0x78
/* 039D48 7F005218 1420FFFB */ bnez $at, .L7F005208
/* 039D4C 7F00521C ADC01130 */ sw $zero, 0x1130($t6)
/* 039D50 7F005220 8C6A0000 */ lw $t2, ($v1)
/* 039D54 7F005224 24040003 */ li $a0, 3
/* 039D58 7F005228 00041080 */ sll $v0, $a0, 2
/* 039D5C 7F00522C AD400000 */ sw $zero, ($t2)
/* 039D60 7F005230 8C6B0000 */ lw $t3, ($v1)
/* 039D64 7F005234 3C013F80 */ li $at, 0x3F800000 # 1.000000
/* 039D68 7F005238 44811000 */ mtc1 $at, $f2
/* 039D6C 7F00523C AD600004 */ sw $zero, 4($t3)
/* 039D70 7F005240 8C6C0000 */ lw $t4, ($v1)
/* 039D74 7F005244 3C018005 */ lui $at, %hi(D_8004F0E0)
/* 039D78 7F005248 44800000 */ mtc1 $zero, $f0
/* 039D7C 7F00524C AD800008 */ sw $zero, 8($t4)
/* 039D80 7F005250 8C690000 */ lw $t1, ($v1)
/* 039D84 7F005254 00002025 */ move $a0, $zero
/* 039D88 7F005258 0122C821 */ addu $t9, $t1, $v0
/* 039D8C 7F00525C AF200000 */ sw $zero, ($t9)
/* 039D90 7F005260 8C780000 */ lw $t8, ($v1)
/* 039D94 7F005264 03024021 */ addu $t0, $t8, $v0
/* 039D98 7F005268 AD000004 */ sw $zero, 4($t0)
/* 039D9C 7F00526C 8C6D0000 */ lw $t5, ($v1)
/* 039DA0 7F005270 01A27821 */ addu $t7, $t5, $v0
/* 039DA4 7F005274 ADE00008 */ sw $zero, 8($t7)
/* 039DA8 7F005278 8C6E0000 */ lw $t6, ($v1)
/* 039DAC 7F00527C 01C25021 */ addu $t2, $t6, $v0
/* 039DB0 7F005280 AD40000C */ sw $zero, 0xc($t2)
/* 039DB4 7F005284 8C6B0000 */ lw $t3, ($v1)
/* 039DB8 7F005288 C42CF0E0 */ lwc1 $f12, %lo(D_8004F0E0)($at)
/* 039DBC 7F00528C 240200FF */ li $v0, 255
/* 039DC0 7F005290 AD60006C */ sw $zero, 0x6c($t3)
/* 039DC4 7F005294 8C6C0000 */ lw $t4, ($v1)
/* 039DC8 7F005298 3C018005 */ lui $at, %hi(fl_neg_pi)
/* 039DCC 7F00529C AD80001C */ sw $zero, 0x1c($t4)
/* 039DD0 7F0052A0 8C690000 */ lw $t1, ($v1)
/* 039DD4 7F0052A4 AD200020 */ sw $zero, 0x20($t1)
/* 039DD8 7F0052A8 8E190000 */ lw $t9, ($s0)
/* 039DDC 7F0052AC AF2029D8 */ sw $zero, 0x29d8($t9)
/* 039DE0 7F0052B0 8E180000 */ lw $t8, ($s0)
/* 039DE4 7F0052B4 AF0029DC */ sw $zero, 0x29dc($t8)
/* 039DE8 7F0052B8 8E080000 */ lw $t0, ($s0)
/* 039DEC 7F0052BC E5020FC0 */ swc1 $f2, 0xfc0($t0)
/* 039DF0 7F0052C0 8E0D0000 */ lw $t5, ($s0)
/* 039DF4 7F0052C4 E5A20FC4 */ swc1 $f2, 0xfc4($t5)
/* 039DF8 7F0052C8 8E0F0000 */ lw $t7, ($s0)
/* 039DFC 7F0052CC 240D0001 */ li $t5, 1
/* 039E00 7F0052D0 ADE00FC8 */ sw $zero, 0xfc8($t7)
/* 039E04 7F0052D4 8E0E0000 */ lw $t6, ($s0)
/* 039E08 7F0052D8 ADC00FCC */ sw $zero, 0xfcc($t6)
/* 039E0C 7F0052DC 8E0A0000 */ lw $t2, ($s0)
/* 039E10 7F0052E0 AD400FD0 */ sw $zero, 0xfd0($t2)
/* 039E14 7F0052E4 8E0B0000 */ lw $t3, ($s0)
/* 039E18 7F0052E8 AD600FD4 */ sw $zero, 0xfd4($t3)
/* 039E1C 7F0052EC 8E0C0000 */ lw $t4, ($s0)
/* 039E20 7F0052F0 AD800FD8 */ sw $zero, 0xfd8($t4)
/* 039E24 7F0052F4 8E090000 */ lw $t1, ($s0)
/* 039E28 7F0052F8 A1220FDC */ sb $v0, 0xfdc($t1)
/* 039E2C 7F0052FC 8E190000 */ lw $t9, ($s0)
/* 039E30 7F005300 A3220FDD */ sb $v0, 0xfdd($t9)
/* 039E34 7F005304 8E180000 */ lw $t8, ($s0)
/* 039E38 7F005308 A3020FDE */ sb $v0, 0xfde($t8)
/* 039E3C 7F00530C 8E080000 */ lw $t0, ($s0)
/* 039E40 7F005310 A1000FDF */ sb $zero, 0xfdf($t0)
/* 039E44 7F005314 8E0F0000 */ lw $t7, ($s0)
/* 039E48 7F005318 ADED0FE0 */ sw $t5, 0xfe0($t7)
/* 039E4C 7F00531C 8E0E0000 */ lw $t6, ($s0)
/* 039E50 7F005320 ADC00FE4 */ sw $zero, 0xfe4($t6)
/* 039E54 7F005324 8E0A0000 */ lw $t2, ($s0)
/* 039E58 7F005328 E5400FE8 */ swc1 $f0, 0xfe8($t2)
/* 039E5C 7F00532C 8E0B0000 */ lw $t3, ($s0)
/* 039E60 7F005330 E5600FEC */ swc1 $f0, 0xfec($t3)
/* 039E64 7F005334 8E0C0000 */ lw $t4, ($s0)
/* 039E68 7F005338 E5800FF0 */ swc1 $f0, 0xff0($t4)
/* 039E6C 7F00533C 8E090000 */ lw $t1, ($s0)
/* 039E70 7F005340 E5200FF4 */ swc1 $f0, 0xff4($t1)
/* 039E74 7F005344 8E190000 */ lw $t9, ($s0)
/* 039E78 7F005348 E72C0FF8 */ swc1 $f12, 0xff8($t9)
/* 039E7C 7F00534C 8E180000 */ lw $t8, ($s0)
/* 039E80 7F005350 E7000FFC */ swc1 $f0, 0xffc($t8)
/* 039E84 7F005354 8E080000 */ lw $t0, ($s0)
/* 039E88 7F005358 E5001000 */ swc1 $f0, 0x1000($t0)
/* 039E8C 7F00535C 8E0D0000 */ lw $t5, ($s0)
/* 039E90 7F005360 E5A01004 */ swc1 $f0, 0x1004($t5)
/* 039E94 7F005364 8E0F0000 */ lw $t7, ($s0)
/* 039E98 7F005368 E5E01008 */ swc1 $f0, 0x1008($t7)
/* 039E9C 7F00536C 8E0E0000 */ lw $t6, ($s0)
/* 039EA0 7F005370 E5CC100C */ swc1 $f12, 0x100c($t6)
/* 039EA4 7F005374 8E0A0000 */ lw $t2, ($s0)
/* 039EA8 7F005378 E5401010 */ swc1 $f0, 0x1010($t2)
/* 039EAC 7F00537C 8E0B0000 */ lw $t3, ($s0)
/* 039EB0 7F005380 C424F0E4 */ lwc1 $f4, %lo(fl_neg_pi)($at)
/* 039EB4 7F005384 E5641014 */ swc1 $f4, 0x1014($t3)
/* 039EB8 7F005388 8E0C0000 */ lw $t4, ($s0)
/* 039EBC 7F00538C E5801018 */ swc1 $f0, 0x1018($t4)
/* 039EC0 7F005390 8E090000 */ lw $t1, ($s0)
/* 039EC4 7F005394 AD201060 */ sw $zero, 0x1060($t1)
/* 039EC8 7F005398 8E190000 */ lw $t9, ($s0)
/* 039ECC 7F00539C AF251270 */ sw $a1, 0x1270($t9)
/* 039ED0 7F0053A0 8E180000 */ lw $t8, ($s0)
/* 039ED4 7F0053A4 E700106C */ swc1 $f0, 0x106c($t8)
/* 039ED8 7F0053A8 8E080000 */ lw $t0, ($s0)
/* 039EDC 7F0053AC E5001070 */ swc1 $f0, 0x1070($t0)
/* 039EE0 7F0053B0 8E0D0000 */ lw $t5, ($s0)
/* 039EE4 7F0053B4 E5A01074 */ swc1 $f0, 0x1074($t5)
/* 039EE8 7F0053B8 8E0F0000 */ lw $t7, ($s0)
/* 039EEC 7F0053BC ADE01078 */ sw $zero, 0x1078($t7)
/* 039EF0 7F0053C0 8E0E0000 */ lw $t6, ($s0)
/* 039EF4 7F0053C4 E5C0107C */ swc1 $f0, 0x107c($t6)
/* 039EF8 7F0053C8 8E0A0000 */ lw $t2, ($s0)
/* 039EFC 7F0053CC 0FC17260 */ jal bgunCalculateBlend
/* 039F00 7F0053D0 E5401080 */ swc1 $f0, 0x1080($t2)
/* 039F04 7F0053D4 0FC17260 */ jal bgunCalculateBlend
/* 039F08 7F0053D8 00002025 */ move $a0, $zero
/* 039F0C 7F0053DC 0FC17260 */ jal bgunCalculateBlend
/* 039F10 7F0053E0 00002025 */ move $a0, $zero
/* 039F14 7F0053E4 0FC17260 */ jal bgunCalculateBlend
/* 039F18 7F0053E8 24040001 */ li $a0, 1
/* 039F1C 7F0053EC 0FC17260 */ jal bgunCalculateBlend
/* 039F20 7F0053F0 24040001 */ li $a0, 1
/* 039F24 7F0053F4 0FC17260 */ jal bgunCalculateBlend
/* 039F28 7F0053F8 24040001 */ li $a0, 1
/* 039F2C 7F0053FC 8E0B0000 */ lw $t3, ($s0)
/* 039F30 7F005400 240C0002 */ li $t4, 2
/* 039F34 7F005404 3C018003 */ lui $at, %hi(sniperrifle_stats+52)
/* 039F38 7F005408 AD601064 */ sw $zero, 0x1064($t3)
/* 039F3C 7F00540C 8E090000 */ lw $t1, ($s0)
/* 039F40 7F005410 AD2C1128 */ sw $t4, 0x1128($t1)
/* 039F44 7F005414 8E190000 */ lw $t9, ($s0)
/* 039F48 7F005418 C4262C38 */ lwc1 $f6, %lo(sniperrifle_stats+52)($at)
/* 039F4C 7F00541C 3C018003 */ lui $at, %hi(camera_stats+52)
/* 039F50 7F005420 E7261084 */ swc1 $f6, 0x1084($t9)
/* 039F54 7F005424 8E180000 */ lw $t8, ($s0)
/* 039F58 7F005428 C42836B8 */ lwc1 $f8, %lo(camera_stats+52)($at)
/* 039F5C 7F00542C E7081088 */ swc1 $f8, 0x1088($t8)
/* 039F60 7F005430 8FBF001C */ lw $ra, 0x1c($sp)
/* 039F64 7F005434 8FB00018 */ lw $s0, 0x18($sp)
/* 039F68 7F005438 27BD03D0 */ addiu $sp, $sp, 0x3d0
/* 039F6C 7F00543C 03E00008 */ jr $ra
/* 039F70 7F005440 00000000 */ nop
)
#endif
#if !defined(LEFTOVERDEBUG)
GLOBAL_ASM(
.late_rodata
glabel D_8004F0E0
.word 0x3f666666
glabel fl_neg_pi
.word 0xc0490fdb
.text
glabel init_player_BONDdata_stats
/* 037A60 7F005070 27BDFC30 */ addiu $sp, $sp, -0x3d0
/* 037A64 7F005074 3C0F8002 */ lui $t7, %hi(hand_data_dummy) # $t7, 0x8002
/* 037A68 7F005078 25EF5920 */ addiu $t7, %lo(hand_data_dummy) # addiu $t7, $t7, 0x5920
/* 037A6C 7F00507C AFBF001C */ sw $ra, 0x1c($sp)
/* 037A70 7F005080 AFB00018 */ sw $s0, 0x18($sp)
/* 037A74 7F005084 25E803A8 */ addiu $t0, $t7, 0x3a8
/* 037A78 7F005088 27AE0024 */ addiu $t6, $sp, 0x24
.L7F00508C:
/* 037A7C 7F00508C 8DE10000 */ lw $at, ($t7)
/* 037A80 7F005090 25EF000C */ addiu $t7, $t7, 0xc
/* 037A84 7F005094 25CE000C */ addiu $t6, $t6, 0xc
/* 037A88 7F005098 ADC1FFF4 */ sw $at, -0xc($t6)
/* 037A8C 7F00509C 8DE1FFF8 */ lw $at, -8($t7)
/* 037A90 7F0050A0 ADC1FFF8 */ sw $at, -8($t6)
/* 037A94 7F0050A4 8DE1FFFC */ lw $at, -4($t7)
/* 037A98 7F0050A8 15E8FFF8 */ bne $t7, $t0, .L7F00508C
/* 037A9C 7F0050AC ADC1FFFC */ sw $at, -4($t6)
/* 037AA0 7F0050B0 3C048003 */ lui $a0, %hi(size_item_buffer) # $a0, 0x8003
/* 037AA4 7F0050B4 8C84D9AC */ lw $a0, %lo(size_item_buffer)($a0)
/* 037AA8 7F0050B8 0C0022E0 */ jal mempAllocBytesInBank
/* 037AAC 7F0050BC 24050004 */ li $a1, 4
/* 037AB0 7F0050C0 3C108007 */ lui $s0, %hi(g_CurrentPlayer) # $s0, 0x8007
/* 037AB4 7F0050C4 26108BC0 */ addiu $s0, %lo(g_CurrentPlayer) # addiu $s0, $s0, -0x7440
/* 037AB8 7F0050C8 8E090000 */ lw $t1, ($s0)
/* 037ABC 7F0050CC 0FC26669 */ jal getPlayerCount
/* 037AC0 7F0050D0 AD220808 */ sw $v0, 0x808($t1)
/* 037AC4 7F0050D4 24010001 */ li $at, 1
/* 037AC8 7F0050D8 14410006 */ bne $v0, $at, .L7F0050F4
/* 037ACC 7F0050DC 3C048003 */ lui $a0, %hi(size_item_buffer+0x4) # $a0, 0x8003
/* 037AD0 7F0050E0 8C84D9B0 */ lw $a0, %lo(size_item_buffer+0x4)($a0)
/* 037AD4 7F0050E4 0C0022E0 */ jal mempAllocBytesInBank
/* 037AD8 7F0050E8 24050004 */ li $a1, 4
/* 037ADC 7F0050EC 8E0A0000 */ lw $t2, ($s0)
/* 037AE0 7F0050F0 AD42080C */ sw $v0, 0x80c($t2)
.L7F0050F4:
/* 037AE4 7F0050F4 8E0B0000 */ lw $t3, ($s0)
/* 037AE8 7F0050F8 2405FFFF */ li $a1, -1
/* 037AEC 7F0050FC 27A30024 */ addiu $v1, $sp, 0x24
/* 037AF0 7F005100 AD6007F8 */ sw $zero, 0x7f8($t3)
/* 037AF4 7F005104 8E0C0000 */ lw $t4, ($s0)
/* 037AF8 7F005108 246B03A8 */ addiu $t3, $v1, 0x3a8
/* 037AFC 7F00510C 00001025 */ move $v0, $zero
/* 037B00 7F005110 AD8007FC */ sw $zero, 0x7fc($t4)
/* 037B04 7F005114 8E0D0000 */ lw $t5, ($s0)
/* 037B08 7F005118 00606025 */ move $t4, $v1
/* 037B0C 7F00511C ADA00800 */ sw $zero, 0x800($t5)
/* 037B10 7F005120 8E190000 */ lw $t9, ($s0)
/* 037B14 7F005124 AF200804 */ sw $zero, 0x804($t9)
/* 037B18 7F005128 8E180000 */ lw $t8, ($s0)
/* 037B1C 7F00512C AF052A3C */ sw $a1, 0x2a3c($t8)
/* 037B20 7F005130 8E080000 */ lw $t0, ($s0)
/* 037B24 7F005134 247803A8 */ addiu $t8, $v1, 0x3a8
/* 037B28 7F005138 AD052A40 */ sw $a1, 0x2a40($t0)
/* 037B2C 7F00513C 8E0F0000 */ lw $t7, ($s0)
/* 037B30 7F005140 00604025 */ move $t0, $v1
/* 037B34 7F005144 3C038007 */ lui $v1, %hi(g_playerPerm) # $v1, 0x8007
/* 037B38 7F005148 ADE02A48 */ sw $zero, 0x2a48($t7)
/* 037B3C 7F00514C 8E0E0000 */ lw $t6, ($s0)
/* 037B40 7F005150 24638BC4 */ addiu $v1, %lo(g_playerPerm) # addiu $v1, $v1, -0x743c
/* 037B44 7F005154 ADC02A4C */ sw $zero, 0x2a4c($t6)
/* 037B48 7F005158 8E090000 */ lw $t1, ($s0)
.L7F00515C:
/* 037B4C 7F00515C 8D810000 */ lw $at, ($t4)
/* 037B50 7F005160 258C000C */ addiu $t4, $t4, 0xc
/* 037B54 7F005164 2529000C */ addiu $t1, $t1, 0xc
/* 037B58 7F005168 AD21085C */ sw $at, 0x85c($t1)
/* 037B5C 7F00516C 8D81FFF8 */ lw $at, -8($t4)
/* 037B60 7F005170 AD210860 */ sw $at, 0x860($t1)
/* 037B64 7F005174 8D81FFFC */ lw $at, -4($t4)
/* 037B68 7F005178 158BFFF8 */ bne $t4, $t3, .L7F00515C
/* 037B6C 7F00517C AD210864 */ sw $at, 0x864($t1)
/* 037B70 7F005180 8E0D0000 */ lw $t5, ($s0)
.L7F005184:
/* 037B74 7F005184 8D010000 */ lw $at, ($t0)
/* 037B78 7F005188 2508000C */ addiu $t0, $t0, 0xc
/* 037B7C 7F00518C 25AD000C */ addiu $t5, $t5, 0xc
/* 037B80 7F005190 ADA10C04 */ sw $at, 0xc04($t5)
/* 037B84 7F005194 8D01FFF8 */ lw $at, -8($t0)
/* 037B88 7F005198 ADA10C08 */ sw $at, 0xc08($t5)
/* 037B8C 7F00519C 8D01FFFC */ lw $at, -4($t0)
/* 037B90 7F0051A0 1518FFF8 */ bne $t0, $t8, .L7F005184
/* 037B94 7F0051A4 ADA10C0C */ sw $at, 0xc0c($t5)
.L7F0051A8:
/* 037B98 7F0051A8 8E0F0000 */ lw $t7, ($s0)
/* 037B9C 7F0051AC 01E27021 */ addu $t6, $t7, $v0
/* 037BA0 7F0051B0 24420004 */ addiu $v0, $v0, 4
/* 037BA4 7F0051B4 28410078 */ slti $at, $v0, 0x78
/* 037BA8 7F0051B8 1420FFFB */ bnez $at, .L7F0051A8
/* 037BAC 7F0051BC ADC01128 */ sw $zero, 0x1128($t6)
/* 037BB0 7F0051C0 8C6A0000 */ lw $t2, ($v1)
/* 037BB4 7F0051C4 24040003 */ li $a0, 3
/* 037BB8 7F0051C8 00041080 */ sll $v0, $a0, 2
/* 037BBC 7F0051CC AD400000 */ sw $zero, ($t2)
/* 037BC0 7F0051D0 8C6B0000 */ lw $t3, ($v1)
/* 037BC4 7F0051D4 3C013F80 */ li $at, 0x3F800000 # 1.000000
/* 037BC8 7F0051D8 44811000 */ mtc1 $at, $f2
/* 037BCC 7F0051DC AD600004 */ sw $zero, 4($t3)
/* 037BD0 7F0051E0 8C6C0000 */ lw $t4, ($v1)
/* 037BD4 7F0051E4 3C018004 */ lui $at, %hi(D_8004F0E0) # $at, 0x8004
/* 037BD8 7F0051E8 44800000 */ mtc1 $zero, $f0
/* 037BDC 7F0051EC AD800008 */ sw $zero, 8($t4)
/* 037BE0 7F0051F0 8C690000 */ lw $t1, ($v1)
/* 037BE4 7F0051F4 00002025 */ move $a0, $zero
/* 037BE8 7F0051F8 0122C821 */ addu $t9, $t1, $v0
/* 037BEC 7F0051FC AF200000 */ sw $zero, ($t9)
/* 037BF0 7F005200 8C780000 */ lw $t8, ($v1)
/* 037BF4 7F005204 03024021 */ addu $t0, $t8, $v0
/* 037BF8 7F005208 AD000004 */ sw $zero, 4($t0)
/* 037BFC 7F00520C 8C6D0000 */ lw $t5, ($v1)
/* 037C00 7F005210 01A27821 */ addu $t7, $t5, $v0
/* 037C04 7F005214 ADE00008 */ sw $zero, 8($t7)
/* 037C08 7F005218 8C6E0000 */ lw $t6, ($v1)
/* 037C0C 7F00521C 01C25021 */ addu $t2, $t6, $v0
/* 037C10 7F005220 AD40000C */ sw $zero, 0xc($t2)
/* 037C14 7F005224 8C6B0000 */ lw $t3, ($v1)
/* 037C18 7F005228 C42C7530 */ lwc1 $f12, %lo(D_8004F0E0)($at)
/* 037C1C 7F00522C 240200FF */ li $v0, 255
/* 037C20 7F005230 AD60006C */ sw $zero, 0x6c($t3)
/* 037C24 7F005234 8C6C0000 */ lw $t4, ($v1)
/* 037C28 7F005238 3C018004 */ lui $at, %hi(fl_neg_pi) # $at, 0x8004
/* 037C2C 7F00523C AD80001C */ sw $zero, 0x1c($t4)
/* 037C30 7F005240 8C690000 */ lw $t1, ($v1)
/* 037C34 7F005244 AD200020 */ sw $zero, 0x20($t1)
/* 037C38 7F005248 8E190000 */ lw $t9, ($s0)
/* 037C3C 7F00524C AF2029D0 */ sw $zero, 0x29d0($t9)
/* 037C40 7F005250 8E180000 */ lw $t8, ($s0)
/* 037C44 7F005254 AF0029D4 */ sw $zero, 0x29d4($t8)
/* 037C48 7F005258 8E080000 */ lw $t0, ($s0)
/* 037C4C 7F00525C E5020FB8 */ swc1 $f2, 0xfb8($t0)
/* 037C50 7F005260 8E0D0000 */ lw $t5, ($s0)
/* 037C54 7F005264 E5A20FBC */ swc1 $f2, 0xfbc($t5)
/* 037C58 7F005268 8E0F0000 */ lw $t7, ($s0)
/* 037C5C 7F00526C 240D0001 */ li $t5, 1
/* 037C60 7F005270 ADE00FC0 */ sw $zero, 0xfc0($t7)
/* 037C64 7F005274 8E0E0000 */ lw $t6, ($s0)
/* 037C68 7F005278 ADC00FC4 */ sw $zero, 0xfc4($t6)
/* 037C6C 7F00527C 8E0A0000 */ lw $t2, ($s0)
/* 037C70 7F005280 AD400FC8 */ sw $zero, 0xfc8($t2)
/* 037C74 7F005284 8E0B0000 */ lw $t3, ($s0)
/* 037C78 7F005288 AD600FCC */ sw $zero, 0xfcc($t3)
/* 037C7C 7F00528C 8E0C0000 */ lw $t4, ($s0)
/* 037C80 7F005290 AD800FD0 */ sw $zero, 0xfd0($t4)
/* 037C84 7F005294 8E090000 */ lw $t1, ($s0)
/* 037C88 7F005298 A1220FD4 */ sb $v0, 0xfd4($t1)
/* 037C8C 7F00529C 8E190000 */ lw $t9, ($s0)
/* 037C90 7F0052A0 A3220FD5 */ sb $v0, 0xfd5($t9)
/* 037C94 7F0052A4 8E180000 */ lw $t8, ($s0)
/* 037C98 7F0052A8 A3020FD6 */ sb $v0, 0xfd6($t8)
/* 037C9C 7F0052AC 8E080000 */ lw $t0, ($s0)
/* 037CA0 7F0052B0 A1000FD7 */ sb $zero, 0xfd7($t0)
/* 037CA4 7F0052B4 8E0F0000 */ lw $t7, ($s0)
/* 037CA8 7F0052B8 ADED0FD8 */ sw $t5, 0xfd8($t7)
/* 037CAC 7F0052BC 8E0E0000 */ lw $t6, ($s0)
/* 037CB0 7F0052C0 ADC00FDC */ sw $zero, 0xfdc($t6)
/* 037CB4 7F0052C4 8E0A0000 */ lw $t2, ($s0)
/* 037CB8 7F0052C8 E5400FE0 */ swc1 $f0, 0xfe0($t2)
/* 037CBC 7F0052CC 8E0B0000 */ lw $t3, ($s0)
/* 037CC0 7F0052D0 E5600FE4 */ swc1 $f0, 0xfe4($t3)
/* 037CC4 7F0052D4 8E0C0000 */ lw $t4, ($s0)
/* 037CC8 7F0052D8 E5800FE8 */ swc1 $f0, 0xfe8($t4)
/* 037CCC 7F0052DC 8E090000 */ lw $t1, ($s0)
/* 037CD0 7F0052E0 E5200FEC */ swc1 $f0, 0xfec($t1)
/* 037CD4 7F0052E4 8E190000 */ lw $t9, ($s0)
/* 037CD8 7F0052E8 E72C0FF0 */ swc1 $f12, 0xff0($t9)
/* 037CDC 7F0052EC 8E180000 */ lw $t8, ($s0)
/* 037CE0 7F0052F0 E7000FF4 */ swc1 $f0, 0xff4($t8)
/* 037CE4 7F0052F4 8E080000 */ lw $t0, ($s0)
/* 037CE8 7F0052F8 E5000FF8 */ swc1 $f0, 0xff8($t0)
/* 037CEC 7F0052FC 8E0D0000 */ lw $t5, ($s0)
/* 037CF0 7F005300 E5A00FFC */ swc1 $f0, 0xffc($t5)
/* 037CF4 7F005304 8E0F0000 */ lw $t7, ($s0)
/* 037CF8 7F005308 E5E01000 */ swc1 $f0, 0x1000($t7)
/* 037CFC 7F00530C 8E0E0000 */ lw $t6, ($s0)
/* 037D00 7F005310 E5CC1004 */ swc1 $f12, 0x1004($t6)
/* 037D04 7F005314 8E0A0000 */ lw $t2, ($s0)
/* 037D08 7F005318 E5401008 */ swc1 $f0, 0x1008($t2)
/* 037D0C 7F00531C 8E0B0000 */ lw $t3, ($s0)
/* 037D10 7F005320 C4247534 */ lwc1 $f4, %lo(fl_neg_pi)($at)
/* 037D14 7F005324 E564100C */ swc1 $f4, 0x100c($t3)
/* 037D18 7F005328 8E0C0000 */ lw $t4, ($s0)
/* 037D1C 7F00532C E5801010 */ swc1 $f0, 0x1010($t4)
/* 037D20 7F005330 8E090000 */ lw $t1, ($s0)
/* 037D24 7F005334 AD201058 */ sw $zero, 0x1058($t1)
/* 037D28 7F005338 8E190000 */ lw $t9, ($s0)
/* 037D2C 7F00533C AF251268 */ sw $a1, 0x1268($t9)
/* 037D30 7F005340 8E180000 */ lw $t8, ($s0)
/* 037D34 7F005344 E7001064 */ swc1 $f0, 0x1064($t8)
/* 037D38 7F005348 8E080000 */ lw $t0, ($s0)
/* 037D3C 7F00534C E5001068 */ swc1 $f0, 0x1068($t0)
/* 037D40 7F005350 8E0D0000 */ lw $t5, ($s0)
/* 037D44 7F005354 E5A0106C */ swc1 $f0, 0x106c($t5)
/* 037D48 7F005358 8E0F0000 */ lw $t7, ($s0)
/* 037D4C 7F00535C ADE01070 */ sw $zero, 0x1070($t7)
/* 037D50 7F005360 8E0E0000 */ lw $t6, ($s0)
/* 037D54 7F005364 E5C01074 */ swc1 $f0, 0x1074($t6)
/* 037D58 7F005368 8E0A0000 */ lw $t2, ($s0)
/* 037D5C 7F00536C 0FC1738C */ jal bgunCalculateBlend
/* 037D60 7F005370 E5401078 */ swc1 $f0, 0x1078($t2)
/* 037D64 7F005374 0FC1738C */ jal bgunCalculateBlend
/* 037D68 7F005378 00002025 */ move $a0, $zero
/* 037D6C 7F00537C 0FC1738C */ jal bgunCalculateBlend
/* 037D70 7F005380 00002025 */ move $a0, $zero
/* 037D74 7F005384 0FC1738C */ jal bgunCalculateBlend
/* 037D78 7F005388 24040001 */ li $a0, 1
/* 037D7C 7F00538C 0FC1738C */ jal bgunCalculateBlend
/* 037D80 7F005390 24040001 */ li $a0, 1
/* 037D84 7F005394 0FC1738C */ jal bgunCalculateBlend
/* 037D88 7F005398 24040001 */ li $a0, 1
/* 037D8C 7F00539C 8E0B0000 */ lw $t3, ($s0)
/* 037D90 7F0053A0 240C0002 */ li $t4, 2
/* 037D94 7F0053A4 3C018003 */ lui $at, %hi(sniperrifle_stats+52) # $at, 0x8003
/* 037D98 7F0053A8 AD60105C */ sw $zero, 0x105c($t3)
/* 037D9C 7F0053AC 8E090000 */ lw $t1, ($s0)
/* 037DA0 7F0053B0 AD2C1120 */ sw $t4, 0x1120($t1)
/* 037DA4 7F0053B4 8E190000 */ lw $t9, ($s0)
/* 037DA8 7F0053B8 C426E188 */ lwc1 $f6, %lo(sniperrifle_stats+52)($at)
/* 037DAC 7F0053BC 3C018003 */ lui $at, %hi(camera_stats+52) # $at, 0x8003
/* 037DB0 7F0053C0 E726107C */ swc1 $f6, 0x107c($t9)
/* 037DB4 7F0053C4 8E180000 */ lw $t8, ($s0)
/* 037DB8 7F0053C8 C428EC08 */ lwc1 $f8, %lo(camera_stats+52)($at)
/* 037DBC 7F0053CC E7081080 */ swc1 $f8, 0x1080($t8)
/* 037DC0 7F0053D0 8FBF001C */ lw $ra, 0x1c($sp)
/* 037DC4 7F0053D4 8FB00018 */ lw $s0, 0x18($sp)
/* 037DC8 7F0053D8 27BD03D0 */ addiu $sp, $sp, 0x3d0
/* 037DCC 7F0053DC 03E00008 */ jr $ra
/* 037DD0 7F0053E0 00000000 */ nop
)
#endif
#endif
+1 -1
View File
@@ -117,7 +117,7 @@ struct BONDdata_item_control_blocks {
int field_1B8;
int field_1BC;
int field_1C0;
int field_1C4;
int timer_1C4;
int field_1C8;
int field_1CC;
float field_1D0;
+26 -7
View File
@@ -11,7 +11,26 @@
//data
struct unk_joint_list D_8002A790 = {NULL, 1, 3, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0}, 0};
ModelRenderData D_8002A790 = {
NULL,
TRUE,
0x00000003,
NULL,
NULL,
0,
0,
0,
0,
0,
0,
0,
0,
{0,0,0,0},
{0,0,0,0},
CULLMODE_BOTH};
// forward declarations
@@ -28,7 +47,7 @@ void sub_GAME_7F0062C0(void *anim, s32 arg1, s32 arg2, s32 *arg3);
* @param arg1:
* @param arg2:
* @param arg3: unknown type.
*
*
* Address 0x7F0062C0.
*/
void sub_GAME_7F0062C0(void *anim, s32 arg1, s32 arg2, s32 *arg3)
@@ -66,7 +85,7 @@ void sets_a_bunch_of_BONDdata_values_to_default(void)
{
s32 i;
s32 spD0[3];
struct unk_joint_list sp90;
ModelRenderData sp90;
Mtxf sp50;
#ifdef LEFTOVERDEBUG
@@ -110,9 +129,9 @@ void sets_a_bunch_of_BONDdata_values_to_default(void)
g_CurrentPlayer->headupsum.f[0] = 0.0f;
g_CurrentPlayer->headupsum.f[1] = HEADSUM;
g_CurrentPlayer->headupsum.f[2] = 0.0f;
g_CurrentPlayer->resetheadpos = 1;
g_CurrentPlayer->resetheadrot = 1;
g_CurrentPlayer->resetheadtick = 1;
g_CurrentPlayer->resetheadpos = TRUE;
g_CurrentPlayer->resetheadrot = TRUE;
g_CurrentPlayer->resetheadtick = TRUE;
g_CurrentPlayer->headbodyoffset.f[0] = 0.0f;
g_CurrentPlayer->headbodyoffset.f[1] = 0.0f;
g_CurrentPlayer->headbodyoffset.f[2] = 0.0f;
@@ -144,7 +163,7 @@ void sets_a_bunch_of_BONDdata_values_to_default(void)
(s32)g_BondMoveAnimationSetup[i].endframe,
&spD0);
g_BondMoveAnimationSetup[i].unk0C = (f32) (((f32) spD0[2] * IDO_POINT_ONE) / (g_BondMoveAnimationSetup[i].endframe - g_BondMoveAnimationSetup[i].loopframe));
g_BondMoveAnimationSetup[i].speedMultiplier = (f32) (((f32) spD0[2] * IDO_POINT_ONE) / (g_BondMoveAnimationSetup[i].endframe - g_BondMoveAnimationSetup[i].loopframe));
}
sp90 = D_8002A790;
+3
View File
@@ -3,5 +3,8 @@
#include <ultra64.h>
void sets_a_bunch_of_BONDdata_values_to_default(void);
#ifdef LEFTOVERDEBUG
extern void exit(void);
#endif
#endif
+9 -16
View File
@@ -32,25 +32,18 @@ void reset_counter_rand_body_head(void)
}
u32 sub_GAME_7F0001F0(void *ani,int aniid,int param_3)
{
short asStack8 [4];
u32 uVar1;
u32 i;
i = 0;
while (aniid < param_3) {
uVar1 = sub_GAME_7F06D2E4(0,0,&skeleton_guard,ani,aniid,asStack8);
i = i + uVar1 & 0xffff;
aniid=1+aniid;
}
return i;
u32 sub_GAME_7F0001F0(void *ani, int aniid, int param_3) {
short asStack8[4];
u16 result = 0;
while (aniid < param_3) {
result += sub_GAME_7F06D2E4(0, 0, &skeleton_guard, ani, aniid, asStack8);
aniid++;
}
return result;
}
#ifdef NONMATCHING
void sub_GAME_7F000290(void) {
+64 -71
View File
@@ -2,19 +2,26 @@
#include <memp.h>
#include "initanitable.h"
#include "objecthandler.h"
#include "bondgame.h"
//bss
char dword_CODE_bss_80069170[0x2D0];
// Where animation frames are saved. Can possibly hold as much as nine, but the game will ever store four at maximum.
char animations_frame_buffer[0x2D0];
// Msg Queue stuff (unused)
OSMesgQueue animMsgQ;
char dword_CODE_bss_80069458[0xC0];
char dword_CODE_bss_80069458[0xC0]; // Unused. Possibly meant for unused message queue.
OSMesg animMesg[8];
// Animation table ptr
struct animation_table_data * ptr_animation_table;
//data
struct bondstruct_unk_animation_related D_80029D60 = {
NULL,
&dword_CODE_bss_80069170,
&dword_CODE_bss_80069170
&animations_frame_buffer, // Two pointers. One always points to the start of the buffer, the other can be modified.
&animations_frame_buffer
};
s32 animation_table_ptrs1[] = {
@@ -213,8 +220,47 @@ struct ModelAnimation *animation_table_ptrs2[] = {
#ifdef NONMATCHING
void expand_ani_table_entries(void) {
struct anim_data_entry
{
void *unk00;
s32 unk04;
void *unk08;
s32 unk0C;
void *unk10;
};
/**
* https://decomp.me/scratch/n0qGM 82.91%
*/
void expand_ani_table_entries(s32** arg0)
{
s32 **var_v0;
struct anim_data_entry *temp_t7;
s32 intval;
for (var_v0 = arg0; *var_v0 != 0; var_v0++)
{
//var_v1 = *var_v0;
if (*var_v0 != (s32*)1)
{
temp_t7 = (struct anim_data_entry *)(&ptr_animation_table->data[(s32)*var_v0]);
//temp_t7->unk00 = (s32*)temp_t7;
//*var_v0 = (s32*)temp_t7;
intval = *(s32*)temp_t7->unk08;
temp_t7->unk08 = &ptr_animation_table->data[intval];
intval = *(s32*)temp_t7->unk10;
temp_t7->unk10 = &ptr_animation_table->data[intval];
}
}
for (var_v0 = arg0; *var_v0 != 0; var_v0++)
{
//var_v1 = *var_v0;
if (*var_v0 != (s32*)1)
{
**var_v0 += (s32)&_animation_entriesSegmentRomStart;
}
}
}
#else
GLOBAL_ASM(
@@ -272,71 +318,18 @@ glabel expand_ani_table_entries
)
#endif
extern u8* _animation_dataSegmentRomStart;
extern u8* _animation_dataSegmentStart;
extern u8* _animation_dataSegmentEnd;
#ifdef NONMATCHING
void alloc_load_expand_ani_table(void) {
//u32 sp18;
u32 size;
//void *temp_v0;
osCreateMesgQueue(&animMsgQ, &animMesg, 8);
void alloc_load_expand_ani_table(void)
{
s32 animsDataSegmentSize;
osCreateMesgQueue(&animMsgQ, animMesg, 8);
sub_GAME_7F0009E0(&D_80029D60, &animMsgQ, &dword_CODE_bss_80069458);
size = ((u32)_animation_dataSegmentEnd - (u32)_animation_dataSegmentStart);
//sp18 = size;
//temp_v0 = mempAllocBytesInBank(size, 6U);
ptr_animation_table = mempAllocBytesInBank(size, 6U);
romCopy(ptr_animation_table, &_animation_dataSegmentRomStart, size);
expand_ani_table_entries(&animation_table_ptrs1);
expand_ani_table_entries(&animation_table_ptrs2);
}
#else
GLOBAL_ASM(
.text
glabel alloc_load_expand_ani_table
/* 0355DC 7F000AAC 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 0355E0 7F000AB0 AFBF0014 */ sw $ra, 0x14($sp)
/* 0355E4 7F000AB4 3C048007 */ lui $a0, %hi(animMsgQ)
/* 0355E8 7F000AB8 3C058007 */ lui $a1, %hi(animMesg)
/* 0355EC 7F000ABC 24A59518 */ addiu $a1, %lo(animMesg) # addiu $a1, $a1, -0x6ae8
/* 0355F0 7F000AC0 24849440 */ addiu $a0, %lo(animMsgQ) # addiu $a0, $a0, -0x6bc0
/* 0355F4 7F000AC4 0C0035B4 */ jal osCreateMesgQueue
/* 0355F8 7F000AC8 24060008 */ li $a2, 8
/* 0355FC 7F000ACC 3C048003 */ lui $a0, %hi(D_80029D60)
/* 035600 7F000AD0 3C058007 */ lui $a1, %hi(animMsgQ)
/* 035604 7F000AD4 3C068007 */ lui $a2, %hi(dword_CODE_bss_80069458)
/* 035608 7F000AD8 24C69458 */ addiu $a2, %lo(dword_CODE_bss_80069458) # addiu $a2, $a2, -0x6ba8
/* 03560C 7F000ADC 24A59440 */ addiu $a1, %lo(animMsgQ) # addiu $a1, $a1, -0x6bc0
/* 035610 7F000AE0 0FC00278 */ jal sub_GAME_7F0009E0
/* 035614 7F000AE4 24849D60 */ addiu $a0, %lo(D_80029D60) # addiu $a0, $a0, -0x62a0
/* 035618 7F000AE8 3C0E0001 */ lui $t6, %hi(0x0000E7E0) # $t6, 1
/* 03561C 7F000AEC 3C0F0000 */ lui $t7, 0
/* 035620 7F000AF0 25EF0000 */ addiu $t7, $t7, 0
/* 035624 7F000AF4 25CEE7E0 */ addiu $t6, %lo(0x0000E7E0) # addiu $t6, $t6, -0x1820
/* 035628 7F000AF8 01CF3023 */ subu $a2, $t6, $t7
/* 03562C 7F000AFC 00C02025 */ move $a0, $a2
/* 035630 7F000B00 AFA60018 */ sw $a2, 0x18($sp)
/* 035634 7F000B04 0C0025C8 */ jal mempAllocBytesInBank
/* 035638 7F000B08 24050006 */ li $a1, 6
/* 03563C 7F000B0C 3C038007 */ lui $v1, %hi(ptr_animation_table)
/* 035640 7F000B10 24639538 */ addiu $v1, %lo(ptr_animation_table) # addiu $v1, $v1, -0x6ac8
/* 035644 7F000B14 3C050029 */ lui $a1, %hi(_animation_dataSegmentRomStart) # $a1, 0x29
/* 035648 7F000B18 AC620000 */ sw $v0, ($v1)
/* 03564C 7F000B1C 8FA60018 */ lw $a2, 0x18($sp)
/* 035650 7F000B20 24A5E980 */ addiu $a1, %lo(_animation_dataSegmentRomStart) # addiu $a1, $a1, -0x1680
/* 035654 7F000B24 0C001707 */ jal romCopy
/* 035658 7F000B28 00402025 */ move $a0, $v0
/* 03565C 7F000B2C 3C048003 */ lui $a0, %hi(animation_table_ptrs1)
/* 035660 7F000B30 0FC00280 */ jal expand_ani_table_entries
/* 035664 7F000B34 24849D6C */ addiu $a0, %lo(animation_table_ptrs1) # addiu $a0, $a0, -0x6294
/* 035668 7F000B38 3C048003 */ lui $a0, %hi(animation_table_ptrs2)
/* 03566C 7F000B3C 0FC00280 */ jal expand_ani_table_entries
/* 035670 7F000B40 2484A04C */ addiu $a0, %lo(animation_table_ptrs2) # addiu $a0, $a0, -0x5fb4
/* 035674 7F000B44 8FBF0014 */ lw $ra, 0x14($sp)
/* 035678 7F000B48 27BD0020 */ addiu $sp, $sp, 0x20
/* 03567C 7F000B4C 03E00008 */ jr $ra
/* 035680 7F000B50 00000000 */ nop
)
#endif
animsDataSegmentSize = (s32)&_animation_dataSegmentEnd - (s32)&_animation_dataSegmentStart;
ptr_animation_table = mempAllocBytesInBank(animsDataSegmentSize, MEMPOOL_PERMANENT);
romCopy(ptr_animation_table, &_animation_dataSegmentRomStart, animsDataSegmentSize);
expand_ani_table_entries((s32*)&animation_table_ptrs1);
expand_ani_table_entries((s32*)&animation_table_ptrs2);
}
+18 -18
View File
@@ -10,53 +10,53 @@ void alloc_explosion_smoke_casing_scorch_impact_buffers(void)
s32 i;
s32 j;
numExplosionEntries = 0;
numSmokeEntries = 0;
numParticleEntries = 0;
numScorchEntries = 0;
numImpactEntries = 0;
D_80040178 = 1.0f;
g_NumExplosionEntries = 0;
g_NumSmokeEntries = 0;
g_NumParticleEntries = 0;
g_NumScorchEntries = 0;
g_NumImpactEntries = 0;
g_SpExplosionDamageMult = 1.0f;
ptr_explosion_buf = (struct Explosion*)mempAllocBytesInBank(EXPLOSION_BUFFER_LEN * sizeof(struct Explosion), 4);
g_ExplosionBuffer = (struct Explosion *)mempAllocBytesInBank(EXPLOSION_BUFFER_LEN * sizeof(struct Explosion), MEMPOOL_STAGE);
for (i=0; i<EXPLOSION_BUFFER_LEN; i++)
{
ptr_explosion_buf[i].prop = NULL;
g_ExplosionBuffer[i].prop = NULL;
for (j=0; j<EXPLOSION_PARTS_LEN; j++)
{
ptr_explosion_buf[i].parts[j].frame = 0;
g_ExplosionBuffer[i].parts[j].frame = 0;
}
}
ptr_smoke_buf = (struct Smoke*)mempAllocBytesInBank(SMOKE_BUFFER_LEN * sizeof(struct Smoke), 4);
g_SmokeBuffer = (struct Smoke *)mempAllocBytesInBank(SMOKE_BUFFER_LEN * sizeof(struct Smoke), MEMPOOL_STAGE);
for (i=0; i<SMOKE_BUFFER_LEN; i++)
{
ptr_smoke_buf[i].prop = NULL;
g_SmokeBuffer[i].prop = NULL;
for (j=0; j<SMOKE_PARTS_LEN; j++)
{
ptr_smoke_buf[i].parts[j].size = 0.0f;
g_SmokeBuffer[i].parts[j].size = 0.0f;
}
}
if (getPlayerCount() == 1)
{
// scorches are the circle burn marks left on the ground from explosions
ptr_scorch_buf = (struct Scorch*)mempAllocBytesInBank(SCORCH_BUFFER_LEN * sizeof(struct Scorch), 4);
g_ScorchBuffer = (struct Scorch *)mempAllocBytesInBank(SCORCH_BUFFER_LEN * sizeof(struct Scorch), MEMPOOL_STAGE);
for (i=0; i<SCORCH_BUFFER_LEN; i++)
{
ptr_scorch_buf[i].roomid = -1;
g_ScorchBuffer[i].roomid = -1;
}
}
ptr_bullet_impact_buf = (struct BulletImpact*)mempAllocBytesInBank(BULLET_IMPACT_BUFFER_LEN * sizeof(struct BulletImpact), 4);
g_BulletImpactBuffer = (struct BulletImpact *)mempAllocBytesInBank(BULLET_IMPACT_BUFFER_LEN * sizeof(struct BulletImpact), MEMPOOL_STAGE);
for (i=0; i<BULLET_IMPACT_BUFFER_LEN; i++)
{
ptr_bullet_impact_buf[i].unk00 = -1;
g_BulletImpactBuffer[i].room = -1;
}
max_particles = MAX_FLYING_PARTICLES / getPlayerCount();
@@ -66,10 +66,10 @@ void alloc_explosion_smoke_casing_scorch_impact_buffers(void)
max_particles = (s32) max_particles >> 1;
}
ptr_flying_particles_buf = (struct FlyingParticles*)mempAllocBytesInBank(((max_particles * sizeof(struct FlyingParticles)) + 0xF) & ~0xF, 4);
g_FlyingParticlesBuffer = (struct FlyingParticles *)mempAllocBytesInBank(((max_particles * sizeof(struct FlyingParticles)) + 0xF) & ~0xF, MEMPOOL_STAGE);
for (i=0; i<max_particles; i++)
{
ptr_flying_particles_buf[i].unk00 = 0;
g_FlyingParticlesBuffer[i].unk00 = 0;
}
}
+12 -12
View File
@@ -7,30 +7,30 @@
**/
void initGameData(void) {
current_menu = MENU_INVALID;
menu_update = 0;
menu_update = MENU_LEGAL_SCREEN;
maybe_prev_menu = MENU_INVALID;
g_MenuTimer = 0;
selected_stage = -1;
selected_stage = LEVELID_NONE;
briefingpage = BRIEFING_INVALID;
selected_difficulty = DIFFICULTY_MULTI;
screen_size = 0;
screen_size = SCREEN_SIZE_320x240;
folder_selection_screen_option_icon = 0;
selected_folder_num = 0;
mission_failed_or_aborted = 0;
is_first_time_on_legal_screen = 1;
is_first_time_on_main_menu = 1;
prev_keypresses = 0;
selected_folder_num = FOLDER1;
mission_failed_or_aborted = FALSE;
is_first_time_on_legal_screen = TRUE;
is_first_time_on_main_menu = TRUE;
prev_keypresses = FALSE;
maybe_is_in_menu = TRUE;
slider_007_mode_reaction = 0.0f;
slider_007_mode_health = 1.0f;
slider_007_mode_accuracy = 1.0f;
slider_007_mode_damage = 1.0f;
intro_character_index = 0;
randomly_selected_intro_animation = 0;
randomly_selected_intro_animation = ANIM_idle;
intro_animation_count = 0;
cast_model = 0;
cast_model_weapon = 0;
full_actor_intro = 0;
cast_model = NULL;
cast_model_weapon = NULL;
full_actor_intro = FALSE;
}
+3 -3
View File
@@ -13,7 +13,7 @@ void init_guards(void) {
D_8002C90C = 0;
D_8002C910 = 0;
D_8002CC58 = 0;
show_patrols_flag = 0;
show_patrols_flag = FALSE;
player1_guardID = 0x1388;
g_ChrSlots = 0;
g_NumChrSlots = 0;
@@ -27,9 +27,9 @@ void alloc_init_GUARDdata_entries(s32 count)
{
s32 i;
g_NumChrSlots = count + 0xA;
g_NumChrSlots = count + 10; //special guards?
g_ChrSlots = mempAllocBytesInBank(align_addr_zero(g_NumChrSlots*sizeof(ChrRecord)), 4);
g_ChrSlots = mempAllocBytesInBank(align_addr_zero(g_NumChrSlots * sizeof(ChrRecord)), MEMPOOL_STAGE);
for(i = 0; g_NumChrSlots > i; i++)
{
g_ChrSlots[i].model = 0;
+21 -75
View File
@@ -1,82 +1,28 @@
#include <ultra64.h>
#include "image.h"
extern g_Textures;
/**
* NTSC address 0x7F000BD0.
*/
void image_entries_load(void)
{
s32 offset;
s32 next_offset;
s32 temp_t3;
struct image_entry *entryp;
#ifdef NONMATCHING
void image_entries_load(void) {
image_entry *piVar1;
image_entry *piVar2;
uint uVar3;
uint uVar4;
uint uVar5;
uint uVar6;
entryp = g_Textures;
offset = 0;
next_offset = entryp->dataoffset;
piVar1 = g_Textures;
uVar3 = 0;
piVar2 = g_Textures;
if (g_Textures[0].size != -1) //this (& 0xFFFFFF) is auto genrated by bitfield
while (entryp->dataoffset != 0xffff)
{
uVar5 = g_Textures[0].size;
uVar4 = g_Textures[0].size;
do
{
uVar6 = (uVar3 ^ uVar4) ^ uVar4;
uVar4 = *(uint *)(piVar1 + 1);
uVar3 += uVar5;
*(uint *)piVar1 = uVar6;
uVar5 = uVar4;
piVar1 = piVar1 + 1;
piVar2 = piVar1;
} while (uVar5 != -1);
temp_t3 = entryp->dataoffset;
entryp->dataoffset = offset;
offset += temp_t3;
entryp++;
next_offset = entryp->dataoffset;
}
*(uint *)piVar2 =
(uVar3 ^ *(uint *)piVar2) ^ *(uint *)piVar2;
return;
}
#else
GLOBAL_ASM(
.text
glabel image_entries_load
/* 035700 7F000BD0 3C048005 */ lui $a0, %hi(g_Textures)
/* 035704 7F000BD4 24829300 */ addiu $v0, $a0, %lo(g_Textures)
/* 035708 7F000BD8 8C4E0000 */ lw $t6, ($v0)
/* 03570C 7F000BDC 3C0100FF */ lui $at, (0x00FFFFFF >> 16) # lui $at, 0xff
/* 035710 7F000BE0 3421FFFF */ ori $at, (0x00FFFFFF & 0xFFFF) # ori $at, $at, 0xffff
/* 035714 7F000BE4 3407FFFF */ li $a3, 65535
/* 035718 7F000BE8 01C17824 */ and $t7, $t6, $at
/* 03571C 7F000BEC 10EF0014 */ beq $a3, $t7, .L7F000C40
/* 035720 7F000BF0 00001825 */ move $v1, $zero
/* 035724 7F000BF4 3C188005 */ lui $t8, %hi(g_Textures)
/* 035728 7F000BF8 27189300 */ addiu $t8, %lo(g_Textures) # addiu $t8, $t8, -0x6d00
/* 03572C 7F000BFC 8F050000 */ lw $a1, ($t8)
/* 035730 7F000C00 3C0100FF */ lui $at, (0x00FFFFFF >> 16) # lui $at, 0xff
/* 035734 7F000C04 3421FFFF */ ori $at, (0x00FFFFFF & 0xFFFF) # ori $at, $at, 0xffff
/* 035738 7F000C08 00A13024 */ and $a2, $a1, $at
.L7F000C0C:
/* 03573C 7F000C0C 3C0100FF */ lui $at, (0x00FFFFFF >> 16) # lui $at, 0xff
/* 035740 7F000C10 3421FFFF */ ori $at, (0x00FFFFFF & 0xFFFF) # ori $at, $at, 0xffff
/* 035744 7F000C14 0061C824 */ and $t9, $v1, $at
/* 035748 7F000C18 03254026 */ xor $t0, $t9, $a1
/* 03574C 7F000C1C 00084A00 */ sll $t1, $t0, 8
/* 035750 7F000C20 00095202 */ srl $t2, $t1, 8
/* 035754 7F000C24 01455826 */ xor $t3, $t2, $a1
/* 035758 7F000C28 8C450008 */ lw $a1, 8($v0)
/* 03575C 7F000C2C 00661821 */ addu $v1, $v1, $a2
/* 035760 7F000C30 AC4B0000 */ sw $t3, ($v0)
/* 035764 7F000C34 00A13024 */ and $a2, $a1, $at
/* 035768 7F000C38 14E6FFF4 */ bne $a3, $a2, .L7F000C0C
/* 03576C 7F000C3C 24420008 */ addiu $v0, $v0, 8
.L7F000C40:
/* 035770 7F000C40 8C450000 */ lw $a1, ($v0)
/* 035774 7F000C44 3C0100FF */ lui $at, (0x00FFFFFF >> 16) # lui $at, 0xff
/* 035778 7F000C48 3421FFFF */ ori $at, (0x00FFFFFF & 0xFFFF) # ori $at, $at, 0xffff
/* 03577C 7F000C4C 00616024 */ and $t4, $v1, $at
/* 035780 7F000C50 01856826 */ xor $t5, $t4, $a1
/* 035784 7F000C54 000D7200 */ sll $t6, $t5, 8
/* 035788 7F000C58 000E7A02 */ srl $t7, $t6, 8
/* 03578C 7F000C5C 01E5C026 */ xor $t8, $t7, $a1
/* 035790 7F000C60 03E00008 */ jr $ra
/* 035794 7F000C64 AC580000 */ sw $t8, ($v0)
)
#endif
entryp->dataoffset = offset;
}
+7 -7
View File
@@ -6,13 +6,13 @@
void alloc_intro_matrices(void)
{
D_8002A7D0 = 0;
matrix_buffer_rarelogo_0 = mempAllocBytesInBank(0x80, 4);
matrix_buffer_gunbarrel_0 = mempAllocBytesInBank(0x40, 4);
matrix_buffer_rarelogo_1 = mempAllocBytesInBank(0x80, 4);
matrix_buffer_rarelogo_2 = mempAllocBytesInBank(0x80, 4);
matrix_buffer_gunbarrel_1 = mempAllocBytesInBank(0x80, 4);
matrix_buffer_intro_backdrop = mempAllocBytesInBank(0x80, 4);
matrix_buffer_intro_bond = mempAllocBytesInBank(0x80, 4);
matrixBufferRareLogo0 = mempAllocBytesInBank(0x80, MEMPOOL_STAGE);
matrixBufferGunbarrel0 = mempAllocBytesInBank(0x40, MEMPOOL_STAGE);
matrixBufferRareLogo1 = mempAllocBytesInBank(0x80, MEMPOOL_STAGE);
matrixBufferRareLogo2 = mempAllocBytesInBank(0x80, MEMPOOL_STAGE);
matrixBufferGunbarrel1 = mempAllocBytesInBank(0x80, MEMPOOL_STAGE);
matrixBufferIntroBackdrop = mempAllocBytesInBank(0x80, MEMPOOL_STAGE);
matrixBufferIntroBond = mempAllocBytesInBank(0x80, MEMPOOL_STAGE);
}
+1 -1
View File
@@ -16,6 +16,6 @@ void reinit_gunheld_totaltime(void) {
void alloc_additional_item_slots(s32 additionalentries) {
g_CurrentPlayer->equipmaxitems = additionalentries + 0x1e;
g_CurrentPlayer->p_itemcur = mempAllocBytesInBank((g_CurrentPlayer->equipmaxitems * 0x14 + 0xfU | 0xf) ^ 0xf,'\x04');
g_CurrentPlayer->p_itemcur = mempAllocBytesInBank((g_CurrentPlayer->equipmaxitems * 0x14 + 0xfU | 0xf) ^ 0xf, MEMPOOL_STAGE);
bondinvReinitInv();
}
+1
View File
@@ -3,5 +3,6 @@
#include <ultra64.h>
void reinit_gunheld_totaltime(void);
void alloc_additional_item_slots(s32 additionalentries);
#endif
+4 -4
View File
@@ -31,12 +31,12 @@ void init_menus_or_reset(void)
menu_update = MENU_FILE_SELECT;
}
ptr_logo_and_walletbond_DL = (u8 *)mempAllocBytesInBank(0x78000, 4);
ptr_logo_and_walletbond_DL = (u8 *)mempAllocBytesInBank(0x78000, MEMPOOL_STAGE);
#if defined(VERSION_EU)
ptr_menu_videobuffer = mempAllocBytesInBank(0x55040, 4);
ptr_menu_videobuffer = mempAllocBytesInBank(0x55040, MEMPOOL_STAGE);
#else
ptr_menu_videobuffer = mempAllocBytesInBank(0x4b040, 4);
ptr_menu_videobuffer = mempAllocBytesInBank(0x4b040, MEMPOOL_STAGE);
#endif
ptr_menu_videobuffer = ALIGN64_V1(ptr_menu_videobuffer);
@@ -47,4 +47,4 @@ void init_menus_or_reset(void)
}
alloc_intro_matrices();
}
}
+2 -2
View File
@@ -9,8 +9,8 @@ void set_mt_tex_alloc(void)
if (tokenFind(1, "-mt"))
{
bytes = strtol(tokenFind(1, "-mt"), 0x0, 0) << 10;
bytes = strtol(tokenFind(1, "-mt"), 0x0, 0) * 1024; //get KB
}
texInitPool(&ptr_texture_alloc_start, mempAllocBytesInBank(bytes, 4), bytes);
texInitPool(&ptr_texture_alloc_start, mempAllocBytesInBank(bytes, MEMPOOL_STAGE), bytes);
}
+8 -8
View File
@@ -69,13 +69,13 @@ void alloc_lookup_buffers(void)
s32 j;
s32 i;
ptr_list_object_lookup_indices = (s16*)mempAllocBytesInBank(PTR_LIST_OBJECT_LOOKUP_INDICES_LEN * sizeof(s16), 4);
RoomPropListChunkIndexes = (s16*)mempAllocBytesInBank((((MaxNumRooms * 4) + 0xF) | 0xF) ^ 0xF, 4);
RoomPropListChunks = (s16*)mempAllocBytesInBank(BSS_8007161C_LEN * sizeof(struct roomproplistchunk), 4);
ptr_list_object_lookup_indices = (s16 *)mempAllocBytesInBank(PTR_LIST_OBJECT_LOOKUP_INDICES_LEN * sizeof(s16), MEMPOOL_STAGE);
RoomPropListChunkIndexes = (s16 *)mempAllocBytesInBank((((g_MaxNumRooms * 4) + 0xF) | 0xF) ^ 0xF, MEMPOOL_STAGE);
RoomPropListChunks = (s16 *)mempAllocBytesInBank(BSS_8007161C_LEN * sizeof(struct roomproplistchunk), MEMPOOL_STAGE);
ptr_list_object_lookup_indices[0] = -1;
for (i=0; i<MaxNumRooms; i++)
for (i=0; i<g_MaxNumRooms; i++)
{
RoomPropListChunkIndexes[i] = -1;
}
@@ -165,9 +165,9 @@ void reinit_between_menus(void)
* Called from proplvreset2 when PROPDEF type is PROPDEF_SWITCH.
* Address 0x7F001910.
*/
void initSetLevelLoadPropSwitch(struct ObjectRecord *arg0)
void initSetLevelLoadPropSwitch(struct LinkRecord *arg0)
{
*((struct ObjectRecord **)&arg0->flags2) = g_LevelLoadPropSwitch;
arg0->next = g_LevelLoadPropSwitch;
g_LevelLoadPropSwitch = arg0;
}
@@ -176,9 +176,9 @@ void initSetLevelLoadPropSwitch(struct ObjectRecord *arg0)
* Called from proplvreset2 when PROPDEF type is PROPDEF_LOCK_DOOR.
* Address 0x7F001928.
*/
void initSetLevelLoadPropLockDoor(struct ObjectRecord *arg0)
void initSetLevelLoadPropLockDoor(struct LockDoorRecord *arg0)
{
*((struct ObjectRecord **)&arg0->flags2) = g_LevelLoadPropLockDoor;
arg0->next = g_LevelLoadPropLockDoor;
g_LevelLoadPropLockDoor = arg0;
}
+3
View File
@@ -8,5 +8,8 @@ void init_load_objpos_table(void);
void reinit_between_menus(void);
void init_sound_effects_registers(void);
void sub_GAME_7F001910(struct ObjectRecord *arg0);
void initSetLevelLoadPropSwitch(struct LinkRecord *arg0);
void initSetLevelLoadPropLockDoor(struct LockDoorRecord *arg0);
void initSetLevelLoadPropSafeItem(struct ObjectRecord *arg0);
#endif
+323 -2
View File
@@ -1,12 +1,333 @@
#include <ultra64.h>
#include "initpathtablelinks.h"
#include "padhalllv.h"
#ifdef NONMATCHING
void init_path_table_links(void) {
/***
* Ryan spent a few minutes looking at this and left some notes about what this function does:
*
* var_s6 is an "error" variable. If set anywhere, the function goes into an infinite loop at the end.
* The first outer loop appears to be verifying that the waypoints don't list themselves as their own neighbour.
* The second outer loop appears to do the same but for waygroups. It also calls sub_GAME_7F08F438, which is a more simple version of PD's waypointFindSegmentIntoGroup, so it's likely verifying that there is a waypoint path between this group and each neighbour.
* The third outer loop is iterating waygroups, then iterating each group's waypoints, and assigning each waypoint's groupNum if it's less than 0. If a value is stored and it's wrong, the error variable is set.
* The fourth outer loop is checking that all waypoints have a groupNum assigned.
* The fifth outer loop I'm not sure about without actually decompiling it and naming stuff. It appears to be using the waypoint->dist property temporary so it can validate something. If it doesn't like it then the error variable is set.
* The final outer loop is the infinite loop which occurs if the error variable is true.
*/
/**
* NTSC address 0x7F006890.
* https://decomp.me/scratch/nSCDd 40.03%
*/
void init_path_table_links(void)
{
waypoint *spA0;
waypoint *sp9C;
s32 var_s6;
waypoint *temp_s0;
waygroup *spD8;
waypoint *var_t5;
s32 var_v0_2;
s32 var_s3;
s32 var_s1;
s32 *temp_a2;
s32 var_a1;
s32 var_a3;
s32 *temp_v0;
s32 var_a0;
s32 *temp_v1;
s32 var_t1;
s32 *var_v1_3;
waypoint *temp_a1_2;
s32 temp_a2_2;
waygroup *var_t3;
s32 *var_v0_4;
s32 var_a3_2;
waypoint *var_a2_2;
s32 var_t4;
s32 var_t0_2;
s32 var_t1_2;
s32 var_v0_5;
s32 var_v1_4;
s32 var_t1_3;
waypoint *temp_a2_3;
s32 var_v1_5;
s32 var_v0_6;
var_s6 = 0;
temp_s0 = g_CurrentSetup.pathwaypoints;
spD8 = g_CurrentSetup.waypointgroups;
if (temp_s0 != NULL)
{
var_a3 = 0;
var_t5 = temp_s0;
while (var_t5->padID >= 0)
{
temp_v0 = var_t5->neighbours;
while (*temp_v0 >= 0)
{
if (*temp_v0 == var_a3)
{
var_s6 = 1;
if (g_CurrentSetup.padnames != NULL)
{
// removed
}
}
else
{
var_a0 = 0;
temp_v1 = temp_s0[*temp_v0].neighbours;
while (*temp_v1 >= 0)
{
var_a0++;
if (var_a3 != *temp_v1)
{
continue;
}
break;
}
if (var_a3 != temp_s0[*temp_v0].neighbours[var_a0])
{
var_s6 = 1;
}
}
temp_v0++;
}
var_a3++;
var_t5 = &temp_s0[var_a3];
}
}
if (spD8 != NULL)
{
var_s1 = 0;
var_s3 = 0;
var_v0_2 = spD8->neighbours[var_s3];
while (var_v0_2 >= 0)
{
if (var_v0_2 == var_s1)
{
var_s6 = 1;
if (g_CurrentSetup.boundpadnames != NULL)
{
// removed
}
}
else
{
var_a1 = 0;
temp_a2 = &spD8->neighbours[var_v0_2];
while (*temp_a2 >= 0)
{
var_a1++;
if (var_s1 != *temp_a2)
{
temp_a2++;
continue;
}
break;
}
if (var_s1 != temp_a2[var_a1])
{
var_s6 = 1;
if (g_CurrentSetup.boundpadnames != NULL)
{
// removed
}
}
else if (g_CurrentSetup.pathwaypoints != NULL)
{
sub_GAME_7F08F438(spD8, &spD8[var_v0_2], &spA0, &sp9C);
if (spA0 == NULL || sp9C == NULL)
{
var_s6 = 1;
}
}
}
var_s3++;
var_v0_2 = spD8->neighbours[var_s3];
}
}
if ((temp_s0 != NULL) && (spD8 != NULL))
{
var_t1 = 0;
var_t3 = spD8;
while (var_t3 != NULL)
{
if (var_t3->neighbours != NULL)
{
var_a3_2 = 0;
var_v1_3 = var_t3->waypoints;
while (*var_v1_3 >= 0)
{
temp_a1_2 = &temp_s0[*var_v1_3];
temp_a2_2 = temp_a1_2->groupNum;
if (temp_a2_2 < 0)
{
temp_a1_2->groupNum = var_t1;
var_v0_4 = &var_t3->waypoints[var_a3_2];
}
else
{
var_v0_4 = &var_t3->waypoints[var_a3_2];
if (var_t1 != temp_a2_2)
{
var_s6 = 1;
}
}
var_a3_2++;
var_v1_3 = var_v0_4 + 1;
}
var_t1 = 0;
}
var_t3++;
}
var_a2_2 = temp_s0;
while (var_a2_2->padID >= 0)
{
var_a2_2 = &temp_s0[var_t1];
if (var_a2_2->groupNum < 0)
{
var_s6 = 1;
}
var_t1++;
}
if (spD8->neighbours != NULL)
{
var_t3 = spD8;
while (var_t3 != NULL)
{
var_v1_4 = 0;
var_t0_2 = 0;
var_t4 = 0;
var_t1_2 = 0;
var_v0_5 = *var_t3->waypoints;
while (var_v0_5 >= 0)
{
if (var_t1_2 == 0)
{
temp_s0[var_v0_5].dist = 1;
}
else
{
temp_s0[var_v0_5].dist = 0;
}
var_v0_5 = var_t3->waypoints[var_t1_2];
var_t1_2++;
}
// loop_57
var_t1_3 = 0;
var_v0_5 = var_t3->waypoints[var_t1_3];
while (var_v0_5 >= 0)
{
temp_a2_3 = &temp_s0[var_v0_5];
if (temp_a2_3->dist == 1)
{
var_v1_5 = 0;
var_v0_6 = temp_a2_3->neighbours[var_v1_5];
while (var_v0_6 >= 0) //var_v0_6 >= 0
{
if (temp_s0[var_v0_6].dist != 1)
{
temp_s0[var_v0_6].dist = 1;
var_t0_2 = 1;
}
var_v1_5++;
var_v0_6 = temp_a2_3->neighbours[var_v1_5];
}
}
var_v0_5 = var_t3->waypoints[var_t1_3];
}
// loop_67
var_v0_5 = *var_t3->waypoints;
while (var_v0_5 >= 0) // var_v0_5 >= 0
{
var_v1_4++;
if (temp_s0[var_v0_5].dist != 1)
{
var_t4 = 1;
break;
}
var_v0_5 = var_t3->waypoints[var_v1_4];
}
//var_v1_4 = 0;
if (var_t0_2 != 0)
{
//var_v0_5 = var_a1_2;
if (var_t4 != 0)
{
//var_t0_2 = 0;
//var_t4 = 0;
continue;
}
}
if (var_t4 != 0)
{
var_s6 = 1;
if (g_CurrentSetup.boundpadnames != NULL)
{
//
}
}
var_t3++;
}
}
}
if (var_s6 != 0)
{
while(1);
}
}
#else
GLOBAL_ASM(
.text
+19 -76
View File
@@ -3,90 +3,33 @@
#include "stan.h"
#ifdef NONMATCHING
typedef coord3d_s32 {
s32 x;
s32 y;
s32 z;
};
s32 init_pathtable_something( coord3d_s32 *tilepos, u8 *tilename, StandTilePoint *tilestack)
/**
* NTSC address 0x7F0067C0.
*/
s32 init_pathtable_something(struct PadRecord *pad, char *tilename, struct StandTile **tile_stack)
{
coord3d coord;
struct coord3d coord;
tilestack = stanMatchTileName(tilename);
if ((tilestack == 0) || (isPointInsideTriStandTileUnscaled_Maybe(tilestack, tilepos->x, tilepos->z) == 0))
*tile_stack = stanMatchTileName(tilename);
if ((*tile_stack == NULL) || (isPointInsideTriStandTileUnscaled_Maybe(*tile_stack, pad->pos.f[0], pad->pos.f[2]) == 0))
{
tilestack = sub_GAME_7F0AFB78(coord.x, coord.y, coord.z, 0);
if ((tilestack != 0) && (walkTilesBetweenPoints_NoCallback(tilestack, tilepos->x, tilepos->z, tilepos->x, tilepos->z) != 0))
coord.f[0] = pad->pos.f[0];
coord.f[1] = pad->pos.f[1];
coord.f[2] = pad->pos.f[2];
*tile_stack = sub_GAME_7F0AFB78(&coord.f[0], &coord.f[1], &coord.f[2], 0);
if ((*tile_stack != NULL) && (walkTilesBetweenPoints_NoCallback(tile_stack, coord.f[0], coord.f[2], pad->pos.f[0], pad->pos.f[2]) != 0))
{
return 2;
}
tilestack = 0;
*tile_stack = NULL;
return 0;
}
return 1;
}
#else
GLOBAL_ASM(
.text
glabel init_pathtable_something
/* 03B2F0 7F0067C0 27BDFFC8 */ addiu $sp, $sp, -0x38
/* 03B2F4 7F0067C4 AFB0001C */ sw $s0, 0x1c($sp)
/* 03B2F8 7F0067C8 00808025 */ move $s0, $a0
/* 03B2FC 7F0067CC AFBF0024 */ sw $ra, 0x24($sp)
/* 03B300 7F0067D0 AFB10020 */ sw $s1, 0x20($sp)
/* 03B304 7F0067D4 00C08825 */ move $s1, $a2
/* 03B308 7F0067D8 0FC2CB96 */ jal stanMatchTileName
/* 03B30C 7F0067DC 00A02025 */ move $a0, $a1
/* 03B310 7F0067E0 10400007 */ beqz $v0, .L7F006800
/* 03B314 7F0067E4 AE220000 */ sw $v0, ($s1)
/* 03B318 7F0067E8 00402025 */ move $a0, $v0
/* 03B31C 7F0067EC 8E050000 */ lw $a1, ($s0)
/* 03B320 7F0067F0 0FC2C0DB */ jal isPointInsideTriStandTileUnscaled_Maybe
/* 03B324 7F0067F4 8E060008 */ lw $a2, 8($s0)
/* 03B328 7F0067F8 5440001D */ bnezl $v0, .L7F006870
/* 03B32C 7F0067FC 24020001 */ li $v0, 1
.L7F006800:
/* 03B330 7F006800 C6040000 */ lwc1 $f4, ($s0)
/* 03B334 7F006804 27A4002C */ addiu $a0, $sp, 0x2c
/* 03B338 7F006808 27A50030 */ addiu $a1, $sp, 0x30
/* 03B33C 7F00680C E7A4002C */ swc1 $f4, 0x2c($sp)
/* 03B340 7F006810 C6060004 */ lwc1 $f6, 4($s0)
/* 03B344 7F006814 27A60034 */ addiu $a2, $sp, 0x34
/* 03B348 7F006818 24070000 */ li $a3, 0
/* 03B34C 7F00681C E7A60030 */ swc1 $f6, 0x30($sp)
/* 03B350 7F006820 C6080008 */ lwc1 $f8, 8($s0)
/* 03B354 7F006824 0FC2BEDE */ jal sub_GAME_7F0AFB78
/* 03B358 7F006828 E7A80034 */ swc1 $f8, 0x34($sp)
/* 03B35C 7F00682C 1040000C */ beqz $v0, .L7F006860
/* 03B360 7F006830 AE220000 */ sw $v0, ($s1)
/* 03B364 7F006834 C60A0008 */ lwc1 $f10, 8($s0)
/* 03B368 7F006838 8E070000 */ lw $a3, ($s0)
/* 03B36C 7F00683C 02202025 */ move $a0, $s1
/* 03B370 7F006840 8FA5002C */ lw $a1, 0x2c($sp)
/* 03B374 7F006844 8FA60034 */ lw $a2, 0x34($sp)
/* 03B378 7F006848 0FC2C2F9 */ jal walkTilesBetweenPoints_NoCallback
/* 03B37C 7F00684C E7AA0010 */ swc1 $f10, 0x10($sp)
/* 03B380 7F006850 50400004 */ beql $v0, $zero, .L7F006864
/* 03B384 7F006854 AE200000 */ sw $zero, ($s1)
/* 03B388 7F006858 10000005 */ b .L7F006870
/* 03B38C 7F00685C 24020002 */ li $v0, 2
.L7F006860:
/* 03B390 7F006860 AE200000 */ sw $zero, ($s1)
.L7F006864:
/* 03B394 7F006864 10000002 */ b .L7F006870
/* 03B398 7F006868 00001025 */ move $v0, $zero
/* 03B39C 7F00686C 24020001 */ li $v0, 1
.L7F006870:
/* 03B3A0 7F006870 8FBF0024 */ lw $ra, 0x24($sp)
/* 03B3A4 7F006874 8FB0001C */ lw $s0, 0x1c($sp)
/* 03B3A8 7F006878 8FB10020 */ lw $s1, 0x20($sp)
/* 03B3AC 7F00687C 03E00008 */ jr $ra
/* 03B3B0 7F006880 27BD0038 */ addiu $sp, $sp, 0x38
)
#endif
+1 -1
View File
@@ -2,6 +2,6 @@
#define _INITPATHTABLESOMETHING_H_
#include <ultra64.h>
void init_pathtable_something(void);
s32 init_pathtable_something(struct PadRecord *pad, char *tilename, struct StandTile **tile_stack);
#endif
+4 -4
View File
@@ -1,9 +1,9 @@
#include <ultra64.h>
#include "objecthandler.h"
void sub_GAME_7F0009E0(struct bondstruct_unk_animation_related* arg0, OSMesgQueue* mq, s32 arg2) {
D_80036414 = arg0;
D_80036418 = mq;
D_8003641C = arg2;
void sub_GAME_7F0009E0(struct bondstruct_unk_animation_related* animBuffer, OSMesgQueue* mq, s32 unused) {
D_80036414 = animBuffer; // Data structure with offset and two tables
D_80036418 = mq; // Unused message queue
D_8003641C = unused; // Some unused array
}
+34 -1
View File
@@ -6,8 +6,41 @@
#ifdef NONMATCHING
void sub_GAME_7F005450(void) {
struct unk_7F005450
{
s32 unk00;
s32 unk04;
s32 unk08;
s32 unk0c; // prev struct unk_7F005450 ?
s32 unk10; // next struct unk_7F005450 ?
};
#define D80076A50_LEN 600
extern struct unk_7F005450 *D_80036060;
struct unk_7F005450 dword_CODE_bss_80076A50[D80076A50_LEN];
// There's some loop unrolling, and the type for D_80036060 / dword_CODE_bss_80076A50 isn't known.
//
// https://decomp.me/scratch/W8anf 69%
void sub_GAME_7F005450(void)
{
s32 i;
D_80036060 = dword_CODE_bss_80076A50;
for (i = 0; i < D80076A50_LEN - 2; i++)
{
dword_CODE_bss_80076A50[i].unk04 = &dword_CODE_bss_80076A50[i+2].unk00;
dword_CODE_bss_80076A50[i].unk0c = &dword_CODE_bss_80076A50[i+2].unk00;
dword_CODE_bss_80076A50[i].unk10 = &dword_CODE_bss_80076A50[i+2].unk00;
}
// target: t8,t8,%lo(dword_CODE_bss_80079908)
// current: t7,t7,%lo(dword_CODE_bss_80076A50+0x2eb8) ----> 0x80076A50 + 0x2eb8 == 0x80079908
dword_CODE_bss_80076A50[599].unk10 = &dword_CODE_bss_80076A50[598].unk00;
}
#else
GLOBAL_ASM(
+54 -143
View File
@@ -1,7 +1,8 @@
#include <ultra64.h>
#include <memp.h>
#include "initunk_005520.h"
#include "objecthandler.h"
#include "memp.h"
extern s32 D_80036070;
extern s32 D_80036074;
@@ -20,151 +21,61 @@ void set_contents_of_80036078(s32 arg0) {
//this may be a file split
#ifdef NONMATCHING
void sub_GAME_7F005540(void) {
/**
* NTSC address 0x7F005540.
*/
void sub_GAME_7F005540(s32 arg0)
{
s32 temp_t6;
s32 var_s1;
D_80036074 = arg0 + 30;
ptr_allocation_1 = mempAllocBytesInBank(D_80036074 * sizeof(struct ptr_1_s), MEMPOOL_STAGE);
for (var_s1 = 0; var_s1 < D_80036074; var_s1++)
{
ptr_allocation_1[var_s1].unk08 = 0;
if (var_s1 < arg0)
{
ptr_allocation_1[var_s1].unk10 = NULL;
}
else
{
ptr_allocation_1[var_s1].unk10 = mempAllocBytesInBank(0x50, MEMPOOL_STAGE);
ptr_allocation_1[var_s1].unk02 = 0x14;
}
}
}
#else
GLOBAL_ASM(
.text
glabel sub_GAME_7F005540
/* 03A070 7F005540 27BDFFD0 */ addiu $sp, $sp, -0x30
/* 03A074 7F005544 AFB40024 */ sw $s4, 0x24($sp)
/* 03A078 7F005548 3C148003 */ lui $s4, %hi(D_80036074)
/* 03A07C 7F00554C AFB50028 */ sw $s5, 0x28($sp)
/* 03A080 7F005550 0080A825 */ move $s5, $a0
/* 03A084 7F005554 26946074 */ addiu $s4, %lo(D_80036074) # addiu $s4, $s4, 0x6074
/* 03A088 7F005558 AFBF002C */ sw $ra, 0x2c($sp)
/* 03A08C 7F00555C 248E001E */ addiu $t6, $a0, 0x1e
/* 03A090 7F005560 AFB30020 */ sw $s3, 0x20($sp)
/* 03A094 7F005564 AFB2001C */ sw $s2, 0x1c($sp)
/* 03A098 7F005568 AFB10018 */ sw $s1, 0x18($sp)
/* 03A09C 7F00556C AFB00014 */ sw $s0, 0x14($sp)
/* 03A0A0 7F005570 AE8E0000 */ sw $t6, ($s4)
/* 03A0A4 7F005574 000E2140 */ sll $a0, $t6, 5
/* 03A0A8 7F005578 0C0025C8 */ jal mempAllocBytesInBank
/* 03A0AC 7F00557C 24050004 */ li $a1, 4
/* 03A0B0 7F005580 8E980000 */ lw $t8, ($s4)
/* 03A0B4 7F005584 3C128008 */ lui $s2, %hi(ptr_allocation_1)
/* 03A0B8 7F005588 26529934 */ addiu $s2, %lo(ptr_allocation_1) # addiu $s2, $s2, -0x66cc
/* 03A0BC 7F00558C AE420000 */ sw $v0, ($s2)
/* 03A0C0 7F005590 1B00001B */ blez $t8, .L7F005600
/* 03A0C4 7F005594 00008825 */ move $s1, $zero
/* 03A0C8 7F005598 00008025 */ move $s0, $zero
/* 03A0CC 7F00559C 24130014 */ li $s3, 20
/* 03A0D0 7F0055A0 8E590000 */ lw $t9, ($s2)
.L7F0055A4:
/* 03A0D4 7F0055A4 0235082A */ slt $at, $s1, $s5
/* 03A0D8 7F0055A8 24040050 */ li $a0, 80
/* 03A0DC 7F0055AC 03304021 */ addu $t0, $t9, $s0
/* 03A0E0 7F0055B0 10200005 */ beqz $at, .L7F0055C8
/* 03A0E4 7F0055B4 AD000008 */ sw $zero, 8($t0)
/* 03A0E8 7F0055B8 8E490000 */ lw $t1, ($s2)
/* 03A0EC 7F0055BC 01305021 */ addu $t2, $t1, $s0
/* 03A0F0 7F0055C0 10000009 */ b .L7F0055E8
/* 03A0F4 7F0055C4 AD400010 */ sw $zero, 0x10($t2)
.L7F0055C8:
/* 03A0F8 7F0055C8 0C0025C8 */ jal mempAllocBytesInBank
/* 03A0FC 7F0055CC 24050004 */ li $a1, 4
/* 03A100 7F0055D0 8E4B0000 */ lw $t3, ($s2)
/* 03A104 7F0055D4 01706021 */ addu $t4, $t3, $s0
/* 03A108 7F0055D8 AD820010 */ sw $v0, 0x10($t4)
/* 03A10C 7F0055DC 8E4D0000 */ lw $t5, ($s2)
/* 03A110 7F0055E0 01B07021 */ addu $t6, $t5, $s0
/* 03A114 7F0055E4 A5D30002 */ sh $s3, 2($t6)
.L7F0055E8:
/* 03A118 7F0055E8 8E8F0000 */ lw $t7, ($s4)
/* 03A11C 7F0055EC 26310001 */ addiu $s1, $s1, 1
/* 03A120 7F0055F0 26100020 */ addiu $s0, $s0, 0x20
/* 03A124 7F0055F4 022F082A */ slt $at, $s1, $t7
/* 03A128 7F0055F8 5420FFEA */ bnezl $at, .L7F0055A4
/* 03A12C 7F0055FC 8E590000 */ lw $t9, ($s2)
.L7F005600:
/* 03A130 7F005600 8FBF002C */ lw $ra, 0x2c($sp)
/* 03A134 7F005604 8FB00014 */ lw $s0, 0x14($sp)
/* 03A138 7F005608 8FB10018 */ lw $s1, 0x18($sp)
/* 03A13C 7F00560C 8FB2001C */ lw $s2, 0x1c($sp)
/* 03A140 7F005610 8FB30020 */ lw $s3, 0x20($sp)
/* 03A144 7F005614 8FB40024 */ lw $s4, 0x24($sp)
/* 03A148 7F005618 8FB50028 */ lw $s5, 0x28($sp)
/* 03A14C 7F00561C 03E00008 */ jr $ra
/* 03A150 7F005620 27BD0030 */ addiu $sp, $sp, 0x30
)
#endif
#ifdef NONMATCHING
void sub_GAME_7F005624(void) {
/**
* NTSC address 0x7F005540.
*/
void sub_GAME_7F005624(s32 arg0)
{
s32 temp_t6;
s32 var_s1;
D_80036070 = arg0 + 10;
// mips2c says: ptr_allocation_0 = mempAllocBytesInBank(temp_t6 * 0xC0, 4);
// however, the pointer is incremented by 0xbc in the loop below.
ptr_allocation_0 = mempAllocBytesInBank(D_80036070 * (4 + sizeof(struct ptr_0_s)), MEMPOOL_STAGE);
for (var_s1 = 0; var_s1 < D_80036070; var_s1++)
{
ptr_allocation_0[var_s1].unk08 = 0;
if (var_s1 < arg0)
{
ptr_allocation_0[var_s1].unk10 = NULL;
}
else
{
ptr_allocation_0[var_s1].unk10 = mempAllocBytesInBank(0x230, MEMPOOL_STAGE);
ptr_allocation_0[var_s1].unk02 = 0x8c;
}
}
}
#else
GLOBAL_ASM(
.text
glabel sub_GAME_7F005624
/* 03A154 7F005624 27BDFFD0 */ addiu $sp, $sp, -0x30
/* 03A158 7F005628 AFB40024 */ sw $s4, 0x24($sp)
/* 03A15C 7F00562C 248E000A */ addiu $t6, $a0, 0xa
/* 03A160 7F005630 3C148003 */ lui $s4, %hi(D_80036070)
/* 03A164 7F005634 AFB50028 */ sw $s5, 0x28($sp)
/* 03A168 7F005638 000E7880 */ sll $t7, $t6, 2
/* 03A16C 7F00563C 0080A825 */ move $s5, $a0
/* 03A170 7F005640 26946070 */ addiu $s4, %lo(D_80036070) # addiu $s4, $s4, 0x6070
/* 03A174 7F005644 AFBF002C */ sw $ra, 0x2c($sp)
/* 03A178 7F005648 01EE7823 */ subu $t7, $t7, $t6
/* 03A17C 7F00564C AFB30020 */ sw $s3, 0x20($sp)
/* 03A180 7F005650 AFB2001C */ sw $s2, 0x1c($sp)
/* 03A184 7F005654 AFB10018 */ sw $s1, 0x18($sp)
/* 03A188 7F005658 AFB00014 */ sw $s0, 0x14($sp)
/* 03A18C 7F00565C AE8E0000 */ sw $t6, ($s4)
/* 03A190 7F005660 000F2180 */ sll $a0, $t7, 6
/* 03A194 7F005664 0C0025C8 */ jal mempAllocBytesInBank
/* 03A198 7F005668 24050004 */ li $a1, 4
/* 03A19C 7F00566C 8E980000 */ lw $t8, ($s4)
/* 03A1A0 7F005670 3C128008 */ lui $s2, %hi(ptr_allocation_0)
/* 03A1A4 7F005674 26529930 */ addiu $s2, %lo(ptr_allocation_0) # addiu $s2, $s2, -0x66d0
/* 03A1A8 7F005678 AE420000 */ sw $v0, ($s2)
/* 03A1AC 7F00567C 1B00001B */ blez $t8, .L7F0056EC
/* 03A1B0 7F005680 00008825 */ move $s1, $zero
/* 03A1B4 7F005684 00008025 */ move $s0, $zero
/* 03A1B8 7F005688 2413008C */ li $s3, 140
/* 03A1BC 7F00568C 8E590000 */ lw $t9, ($s2)
.L7F005690:
/* 03A1C0 7F005690 0235082A */ slt $at, $s1, $s5
/* 03A1C4 7F005694 24040230 */ li $a0, 560
/* 03A1C8 7F005698 03304021 */ addu $t0, $t9, $s0
/* 03A1CC 7F00569C 10200005 */ beqz $at, .L7F0056B4
/* 03A1D0 7F0056A0 AD000008 */ sw $zero, 8($t0)
/* 03A1D4 7F0056A4 8E490000 */ lw $t1, ($s2)
/* 03A1D8 7F0056A8 01305021 */ addu $t2, $t1, $s0
/* 03A1DC 7F0056AC 10000009 */ b .L7F0056D4
/* 03A1E0 7F0056B0 AD400010 */ sw $zero, 0x10($t2)
.L7F0056B4:
/* 03A1E4 7F0056B4 0C0025C8 */ jal mempAllocBytesInBank
/* 03A1E8 7F0056B8 24050004 */ li $a1, 4
/* 03A1EC 7F0056BC 8E4B0000 */ lw $t3, ($s2)
/* 03A1F0 7F0056C0 01706021 */ addu $t4, $t3, $s0
/* 03A1F4 7F0056C4 AD820010 */ sw $v0, 0x10($t4)
/* 03A1F8 7F0056C8 8E4D0000 */ lw $t5, ($s2)
/* 03A1FC 7F0056CC 01B07021 */ addu $t6, $t5, $s0
/* 03A200 7F0056D0 A5D30002 */ sh $s3, 2($t6)
.L7F0056D4:
/* 03A204 7F0056D4 8E8F0000 */ lw $t7, ($s4)
/* 03A208 7F0056D8 26310001 */ addiu $s1, $s1, 1
/* 03A20C 7F0056DC 261000BC */ addiu $s0, $s0, 0xbc
/* 03A210 7F0056E0 022F082A */ slt $at, $s1, $t7
/* 03A214 7F0056E4 5420FFEA */ bnezl $at, .L7F005690
/* 03A218 7F0056E8 8E590000 */ lw $t9, ($s2)
.L7F0056EC:
/* 03A21C 7F0056EC 8FBF002C */ lw $ra, 0x2c($sp)
/* 03A220 7F0056F0 8FB00014 */ lw $s0, 0x14($sp)
/* 03A224 7F0056F4 8FB10018 */ lw $s1, 0x18($sp)
/* 03A228 7F0056F8 8FB2001C */ lw $s2, 0x1c($sp)
/* 03A22C 7F0056FC 8FB30020 */ lw $s3, 0x20($sp)
/* 03A230 7F005700 8FB40024 */ lw $s4, 0x24($sp)
/* 03A234 7F005704 8FB50028 */ lw $s5, 0x28($sp)
/* 03A238 7F005708 03E00008 */ jr $ra
/* 03A23C 7F00570C 27BD0030 */ addiu $sp, $sp, 0x30
)
#endif
+6 -6
View File
@@ -115,7 +115,7 @@ Vtx * return_ptr_vertex_of_entry_room(Gfx * gfx, s32 room_index)
// weird memory checking, not sure what's going on here
if (((s32) ret & 0xFF000000) == 0x0E000000) {
ret = (s32)array_room_info[room_index].ptr_point_index + ((s32) ret & 0xFFFFFF);
ret = (s32)g_BgRoomInfo[room_index].ptr_point_index + ((s32) ret & 0xFFFFFF);
}
return ret;
@@ -185,7 +185,7 @@ void redarken_lights_in_room(s32 room_index)
s32 i;
struct s_darkened_light* unk;
vertex = array_room_info[room_index].ptr_point_index;
vertex = g_BgRoomInfo[room_index].ptr_point_index;
for (i = 0; i < DARKENED_LIGHT_TABLE_MAX; i++)
{
@@ -208,7 +208,7 @@ void darken_vertex_in_room(Vtx * vertex, s32 room_index)
if (darkened_light_table_contains_vertex(vertex, room_index) != 0) { return; }
// weird memory stuff going on here
vtx_index = ((u32)vertex - (u32)array_room_info[room_index].ptr_point_index) >> 4;
vtx_index = ((u32)vertex - (u32)g_BgRoomInfo[room_index].ptr_point_index) >> 4;
darkened_light_table[cur_entry_darkened_light_table].room_index = (u16) room_index;
darkened_light_table[cur_entry_darkened_light_table].vtx_index = vtx_index;
@@ -233,7 +233,7 @@ s32 darkened_light_table_contains_vertex(Vtx * vertex, s32 room_index)
s32 i;
// weird memory stuff going on here
vtx_index = ((u32)vertex - (u32)array_room_info[room_index].ptr_point_index) >> 4;
vtx_index = ((u32)vertex - (u32)g_BgRoomInfo[room_index].ptr_point_index) >> 4;
for (i = 0; i < DARKENED_LIGHT_TABLE_MAX; i++)
{
@@ -298,7 +298,7 @@ s32 sub_GAME_7F0BBCCC(coord16 * coord, s32 room_index)
{
if (room_index == darkened_light_table[i].room_index)
{
vertex = &array_room_info[room_index].ptr_point_index[darkened_light_table[i].vtx_index];
vertex = &g_BgRoomInfo[room_index].ptr_point_index[darkened_light_table[i].vtx_index];
var_s0 = vertex->v.ob[0] - coord->AsArray[0];
var_s1 = vertex->v.ob[1] - coord->AsArray[1];
@@ -382,7 +382,7 @@ void sub_GAME_7F0BBE0C(Gfx * gfx, u32 tri_type, s32 room_index)
dist_nn = sqrtf((diff_x_13 * diff_x_13) + (diff_y_13 * diff_y_13) + (diff_z_13 * diff_z_13));
inv_dist_13 = 10.0f / (get_room_data_float2() * dist_nn);
sub_GAME_7F0BCA34(light_fixture_table[i].room_index, &origin);
getRoomPositionScaledByIndex(light_fixture_table[i].room_index, &origin);
for (dist_tween = 0.0f; dist_tween < 1.0f; dist_tween += inv_dist_12)
{
+25 -15
View File
@@ -8,31 +8,38 @@
/**
* Address 0x7F056850.
* @brief getposstan
*/
s32 sub_GAME_7F056850(PadRecord *arg0, StandTile *arg1, f32 arg2, PadRecord *arg3, StandTile **arg4)
s32 sub_GAME_7F056850(struct coord3d *arg0, StandTile *arg1, f32 arg2, struct coord3d *arg3, StandTile **arg4)
{
arg3->pos.f[0] = arg0->pos.f[0];
arg3->pos.f[1] = arg0->pos.f[1];
arg3->pos.f[2] = arg0->pos.f[2];
arg3->f[0] = arg0->f[0];
arg3->f[1] = arg0->f[1];
arg3->f[2] = arg0->f[2];
*arg4 = arg1;
if (arg1 == 0)
{
#ifdef DEBUG
osSyncPrintf("getposstan: no stan!\n");
#endif
return 0;
}
if ((arg2 > 0.0f) && (stanTestVolume(arg4, arg3->pos.f[0], arg3->pos.f[2], arg2, 0x1F, 0.0f, 1.0f) >= 0))
if ((arg2 > 0.0f) && (stanTestVolume(arg4, arg3->f[0], arg3->f[2], arg2, CDTYPE_OBJS | CDTYPE_DOORS | CDTYPE_PLAYERS | CDTYPE_CHRS | CDTYPE_PATHBLOCKER, 0.0f, 1.0f) >= 0))
{
#ifdef DEBUG
osSyncPrintf("getposstan: circle not legal!\n");
#endif
return 0;
}
return 1;
}
//Todo: finish this func
/**
* Get Size of Prop Definition
* Get Size of Prop Definition
* @param pdef: Prop Defenition to get size of
* @return Size of prop in Words (32bit)
*/
@@ -129,6 +136,9 @@ s32 sizepropdef(PropDefHeaderRecord *pdef)
case PROPDEF_CAMERAPOS:
return 7;//return sizeof(GlassRecord) / 4;
default:
#ifdef DEBUG
osSyncPrintf("sizepropdef: unknown prop def type %d!!\n",pdef->type);
#endif
return sizeof(PropDefHeaderRecord) / 4;;
}
}
@@ -222,9 +232,9 @@ s32 setupGetCommandIndexByProp(struct PropRecord *prop)
s32 modelLoad(s32 modelid)
{
if (PitemZ_entries[modelid].header->RootNode == NULL)
if (PitemZ_entries[modelid].header->RootNode == NULL)
{
fileLoad(PitemZ_entries[modelid].header,PitemZ_entries[modelid].filename);
fileLoad(PitemZ_entries[modelid].header,PitemZ_entries[modelid].filename/*, "prop"*/);
modelCalculateRwDataLen(PitemZ_entries[modelid].header);
return TRUE;
}
@@ -315,9 +325,9 @@ void setupUpdateObjectRoomPosition(ObjectRecord *obj)
/**
* Address 0x7F056EA0.
*/
struct ObjectRecord *setupCommandGetObject(s32 stageID, s32 index)
ObjectRecord *setupCommandGetObject(s32 stageID, s32 index)
{
struct PropDefHeaderRecord *obj;
PropDefHeaderRecord *obj;
obj = setupGetPtrToCommandByIndex(index);
@@ -377,7 +387,7 @@ struct ObjectRecord *setupCommandGetObject(s32 stageID, s32 index)
break;
// not included:
//case PROPDEF_UNK15: //15:
//case PROPDEF_DEBRIS: //15:
//case PROPDEF_UNK16: //16:
// return ???
}
+2 -1
View File
@@ -5,9 +5,10 @@
s32 sizepropdef(PropDefHeaderRecord *pdef);
void setupUpdateObjectRoomPosition(ObjectRecord *);
s32 sub_GAME_7F056850(PadRecord *arg0, StandTile *arg1, f32 arg2, PadRecord *arg3, StandTile **arg4);
s32 sub_GAME_7F056850(struct coord3d *arg0, StandTile *arg1, f32 arg2, struct coord3d *arg3, StandTile **arg4);
ObjectRecord *setupGetPtrToCommandByIndex(s32 index);
s32 tagGetCommandIndex(struct ObjectRecord *arg0);
s32 modelLoad(s32 modelid);
struct ObjectRecord *setupCommandGetObject(s32 stageID, s32 index);
#endif
+145 -141
View File
@@ -176,7 +176,7 @@ f32 g_PowerOnTimeSec = 0;
/**
* Debug variable, seems to track whether user input has changed since
* the last time the method was entered.
*
*
* Addres 0x800483C0.
*/
s32 D_800483C0 = 1;
@@ -237,7 +237,7 @@ void lvInit(void)
debTryAdd(&lvl_c_debug_notice_list, "lv_c_debug");
size = (s32)&_fontdlSegmentRomEnd - (s32)&_fontdlSegmentRomStart;
lvl_c_debug_notice_list = 1;
ptr_font_DL = mempAllocBytesInBank(size, 6);
ptr_font_DL = mempAllocBytesInBank(size, MEMPOOL_PERMANENT);
romCopy(ptr_font_DL, &_fontdlSegmentRomStart, size);
}
@@ -293,7 +293,7 @@ void lvlMusicPlayStageTrackOrRandom(void)
* Title screen is handled as a special case.
* First half of method resets stage and player values (including mutliplayer values) to defaults.
* Second part loads stage data (init guards, init guard heads, etc).
*
*
* NTSC Address: 0x7F0BDAB0.
* NTSC-J Address: 7F0BE660.
* PAL Address: 7F0BCE60.
@@ -302,7 +302,7 @@ void lvlStageLoad(s32 stage)
{
s32 i;
struct player_data *player_data;
g_CurrentStageToLoad = stage;
// this if block pushes where g_CurrentStageToLoad gets loaded to the
@@ -332,7 +332,7 @@ void lvlStageLoad(s32 stage)
g_GlobalTimerDelta = 1.f;
#endif
#if defined(VERSION_EU)
g_GlobalTimerDelta = 1.20000004768f;
g_GlobalTimerDelta = 1.20000004768f;
#endif
D_80048388 = 0;
@@ -359,7 +359,7 @@ void lvlStageLoad(s32 stage)
texReset();
load_font_tables();
/* If title screen, initialize screen and folder setup.
/* If title screen, initialize screen and folder setup.
* Otherwise:
* - enable cheats for player
* - init watch
@@ -392,7 +392,7 @@ void lvlStageLoad(s32 stage)
load_bg_file(g_CurrentStageToLoad);
skySetStageNum(g_CurrentStageToLoad);
// HACK: This method call is wrong. The function takes one argument, but the asm calls it without
// any arguments here.
init_watch_at_start_of_stage();
@@ -427,7 +427,7 @@ void lvlStageLoad(s32 stage)
{
g_playerPlayerData[s3].handicap = get_player_mp_handicap(s3);
}
g_playerPlayerData[s3].player_perspective_height = get_player_mp_char_height(s3);
}
@@ -481,7 +481,7 @@ void lvlStageLoad(s32 stage)
else
{
s32 s0;
init_path_table_links();
init_ejected_cartridges();
@@ -502,7 +502,7 @@ void lvlStageLoad(s32 stage)
set_contents_of_80036078(0);
zbufDeallocate();
viSetVideoMode(1);
viSetVideoMode(MD_NORMAL);
D_80048368 = 1.0f;
lvlSetControlsLockedFlag(0);
}
@@ -521,9 +521,9 @@ s32 lvlGetCurrentStageToLoad(void)
* on controller 1 and 2 are used for control flow.
*
* address 0x7F0BDF10.
*
*
* https://decomp.me/scratch/C83v8 90.47%
*
*
* decomp status:
* - compiles: yes
* - stack resize: wrong
@@ -594,7 +594,7 @@ Gfx * lvlPortalDebug7F0BDF10(Gfx * arg0)
else if (joyGetButtons(PLAYER_1, R_TRIG) | joyGetButtons(PLAYER_2, R_TRIG))
{
if (
(joyGetButtonsPressedThisFrame(PLAYER_1, D_JPAD) | joyGetButtonsPressedThisFrame(PLAYER_2, D_JPAD))
(joyGetButtonsPressedThisFrame(PLAYER_1, D_JPAD) | joyGetButtonsPressedThisFrame(PLAYER_2, D_JPAD))
&& (bgGetDataPortalsControlBytes1Bit1(g_DebugPortalsD_800483CC) == 0))
{
bgToggleDataPortalsContrlBytes1Bit1(g_DebugPortalsD_800483CC, 0);
@@ -932,7 +932,7 @@ glabel lvlPortalDebug7F0BDF10
/**
* Graphics render method.
* Also sets player max ammo if infinite ammo cheat is enabled.
*
*
* Address 0x7F0BE30C (VERSION_US).
*/
@@ -941,8 +941,8 @@ Gfx* lvlRender(Gfx* DL)
gSPSegment(DL++, SPSEGMENT_PHYSICAL, NULL);
gSPSegment(DL++, SPSEGMENT_UNKNOWN, osVirtualToPhysical(ptr_font_DL));
gSPDisplayList(DL++, &fontDL_0x040);
gSPDisplayList(DL++, &fontDL_0x020);
gSPDisplayList(DL++, &dlFastPipelineSetup);
gSPDisplayList(DL++, &dlZBufferGeometry);
if (g_CurrentStageToLoad == LEVELID_TITLE)
{
@@ -971,7 +971,7 @@ Gfx* lvlRender(Gfx* DL)
DL = viClearZBufCurrentPlayer(DL);
DL = video_related_F(DL);
if (get_debug_render_raster() == DEB_MOVE_VIEW)
{
DL = sub_GAME_7F091580(DL);
@@ -989,7 +989,7 @@ Gfx* lvlRender(Gfx* DL)
DL = viSetupScreensForNumPlayers(DL);
DL = skyRender(DL);
sub_GAME_7F0B4884();
bgRoomVisibilityRelated();
determing_type_of_object_and_detection();
chraiUpdateOnscreenPropCount();
chrpropUpdateAutoaimTarget();
@@ -1065,7 +1065,7 @@ Gfx* lvlRender(Gfx* DL)
sub_GAME_7F0A4824(&DL, 1);
#endif
DL = sub_GAME_7F0A2C44(DL);
DL = sub_GAME_7F0A0034(DL);
DL = explosionRenderFlyingParticles(DL);
if (
@@ -1105,7 +1105,7 @@ Gfx* lvlRender(Gfx* DL)
/**
* Sets the modifier values for the level being loaded.
* This covers the enemy accuracy, reaction speed, and similar values.
*
*
* address 0x7F0BE8D0
*/
void lvlSetMultipliersForDifficulty(void)
@@ -1132,7 +1132,7 @@ void lvlSetMultipliersForDifficulty(void)
g_AiAccuracyModifier = DEFAULT_AGENT_AI_ACCURACY_MODIFIER;
g_AiDamageModifier = (DEFAULT_AGENT_AI_DAMAGE_MODIFIER * damageMultiplier);
g_AiHealthModifier = 2.0f;
D_80040178 = (f32) (0.25f * damageMultiplier);
g_SpExplosionDamageMult = (f32) (0.25f * damageMultiplier);
difficulty = 1.5f;
g_SoloAmmoMultiplier = DEFAULT_AGENT_SOLO_AMMO_MULTIPLIER;
g_AiReactionSpeed = DEFAULT_AGENT_AI_REACTION_SPEED;
@@ -1147,7 +1147,7 @@ void lvlSetMultipliersForDifficulty(void)
g_AiAccuracyModifier = DEFAULT_SECRET_AGENT_AI_ACCURACY_MODIFIER;
g_AiDamageModifier = DEFAULT_SECRET_AGENT_AI_DAMAGE_MODIFIER;
g_AiHealthModifier = 1.0f;
D_80040178 = 0.75f;
g_SpExplosionDamageMult = 0.75f;
#if defined(BUGFIX_R1)
if (j_text_trigger)
@@ -1176,7 +1176,7 @@ void lvlSetMultipliersForDifficulty(void)
g_AiAccuracyModifier = DEFAULT_00_AGENT_AI_ACCURACY_MODIFIER;
g_AiDamageModifier = DEFAULT_00_AGENT_AI_DAMAGE_MODIFIER;
g_AiHealthModifier = 1.0f;
D_80040178 = 1.0f;
g_SpExplosionDamageMult = 1.0f;
#if defined(BUGFIX_R1)
if (j_text_trigger)
@@ -1205,7 +1205,7 @@ void lvlSetMultipliersForDifficulty(void)
g_AiAccuracyModifier = DEFAULT_007_AI_ACCURACY_MODIFIER;
g_AiDamageModifier = DEFAULT_007_AI_DAMAGE_MODIFIER;
g_AiHealthModifier = 1.0f;
D_80040178 = 1.0f;
g_SpExplosionDamageMult = 1.0f;
difficulty = 1.0f;
g_SoloAmmoMultiplier = DEFAULT_007_SOLO_AMMO_MULTIPLIER;
g_AiReactionSpeed = DEFAULT_007_AI_REACTION_SPEED;
@@ -1218,17 +1218,21 @@ void lvlSetMultipliersForDifficulty(void)
* Multiplayer method.
* Tracks you-only-live-twice kills/deaths.
* Lots of debug code.
*
*
* Address: 0x7F0BEB88 (NTSC).
*
*
* decomp status:
* - compiles: yes
* - stack resize: fail
* - identical instructions: fail
* - identical registers: fail
*
*
* notes: there is one big `if` block that is very wrong. A few places where two instructions are swapped.
* Otherwise just lots of regalloc.
*
* mismatch section is probably Perfect Dark void mpCalculateAwards(void)
*
* https://decomp.me/scratch/YWqVR 63.28%
*/
void lvlManageMpGame(void)
{
@@ -1305,10 +1309,10 @@ void lvlManageMpGame(void)
{
p = g_playerPointers[i];
if (p->bonddead != 0)
if (p->bonddead != FALSE)
{
mp_alive_count++;
if (p->redbloodfinished != 0)
if (p->redbloodfinished)
{
mp_player_field424_count++;
}
@@ -1376,8 +1380,8 @@ void lvlManageMpGame(void)
{
p = g_playerPointers[i];
if (p->bonddead != 0 &&
(p->redbloodfinished == 0 || p->deathanimfinished == 0 || p->colourfadetimemax60 >= 0.0f))
if (p->bonddead != FALSE &&
(p->redbloodfinished == FALSE || p->deathanimfinished == FALSE || p->colourfadetimemax60 >= 0.0f))
{
mp_player_currently_in_dying_animation++;
}
@@ -1427,7 +1431,7 @@ void lvlManageMpGame(void)
{
for (j=0; j<var_player_count2_again; j++)
{
if (g_playerPointers[j]->bonddead == 0)
if (g_playerPointers[j]->bonddead == FALSE)
{
not_dead_count++;
}
@@ -1439,28 +1443,28 @@ void lvlManageMpGame(void)
{
for (j=0; j<var_player_count2_again; j++)
{
if (g_playerPointers[0]->bonddead == 0)
if (g_playerPointers[PLAYER_1]->bonddead == FALSE)
{
not_dead_count++;
}
if (g_playerPointers[1]->bonddead == 0)
if (g_playerPointers[PLAYER_2]->bonddead == FALSE)
{
not_dead_count++;
}
if (g_playerPointers[2]->bonddead == 0)
if (g_playerPointers[PLAYER_3]->bonddead == FALSE)
{
not_dead_count++;
}
if (g_playerPointers[3]->bonddead == 0)
if (g_playerPointers[PLAYER_4]->bonddead == FALSE)
{
not_dead_count++;
}
killed_count =
g_playerPlayerData[0].killed_p1 +
g_playerPlayerData[1].killed_p1 +
g_playerPlayerData[2].killed_p1 +
g_playerPlayerData[3].killed_p1;
g_playerPlayerData[PLAYER_1].killed_p1 +
g_playerPlayerData[PLAYER_2].killed_p1 +
g_playerPlayerData[PLAYER_3].killed_p1 +
g_playerPlayerData[PLAYER_4].killed_p1;
}
}
}
@@ -1472,14 +1476,14 @@ void lvlManageMpGame(void)
g_playerPlayerData[i].order_out_in_yolt = (u8) (phi_a2_5 + 1);
}
if ((g_playerPointers[i]->redbloodfinished != 0) && (g_playerPointers[i]->deathanimfinished != 0) && (g_playerPointers[i]->colourfadetimemax60 < 0.0f))
if ((g_playerPointers[i]->redbloodfinished) && (g_playerPointers[i]->deathanimfinished) && (g_playerPointers[i]->colourfadetimemax60 < 0.0f))
{
phi_ra_2 = phi_ra_3 + 1;
}
}
}
//}
temp_v1_7 = var_player_count2 - 1;
if (not_dead_count >= temp_v1_7)
{
@@ -1539,13 +1543,13 @@ void lvlManageMpGame(void)
{
sub_GAME_7F09BBBC();
lvlSetMultipliersForDifficulty();
sub_GAME_7F0BC7D4();
updateRoomStatusFlags();
sub_GAME_7F092E50();
sub_GAME_7F094438();
update_bullet_sparks_and_dust_clouds();
update_bullet_casings();
update_broken_windows();
update_gray_flying_particles();
explosionUpdateFlyingParticles();
handle_mp_respawn_and_some_things();
reset_all_music_slots();
langTick();
@@ -1553,7 +1557,7 @@ void lvlManageMpGame(void)
if ((get_debug_joy2detailedit_flag() != 0) && (D_800483C8 == 0))
{
s32 i;
D_800483C8 = (struct LvlMpUnknown*)mempAllocBytesInBank(0x3000, 4);
D_800483C8 = (struct LvlMpUnknown *)mempAllocBytesInBank(0x3000, MEMPOOL_STAGE);
if (D_800483C8 != 0)
{
for (i=0; i<3000; i++)
@@ -1577,13 +1581,13 @@ void lvlManageMpGame(void)
if (joyGetButtonsPressedThisFrame(PLAYER_1, L_CBUTTONS))
{
sub_GAME_7F0AF630(-1);
sub_GAME_7F0B2D38(0, 0, 0);
debugStanView(0, 0, 0);
}
if (joyGetButtonsPressedThisFrame(PLAYER_1, R_CBUTTONS))
{
sub_GAME_7F0AF630(1);
sub_GAME_7F0B2D38(0, 0, 0);
debugStanView(0, 0, 0);
}
}
break;
@@ -2274,7 +2278,7 @@ glabel lvlManageMpGame
/* 0F3E90 7F0BF360 00000000 */ nop
/* 0F3E94 7F0BF364 0FC2FA34 */ jal lvlSetMultipliersForDifficulty
/* 0F3E98 7F0BF368 00000000 */ nop
/* 0F3E9C 7F0BF36C 0FC2F1F5 */ jal sub_GAME_7F0BC7D4
/* 0F3E9C 7F0BF36C 0FC2F1F5 */ jal updateRoomStatusFlags
/* 0F3EA0 7F0BF370 00000000 */ nop
/* 0F3EA4 7F0BF374 0FC24B94 */ jal sub_GAME_7F092E50
/* 0F3EA8 7F0BF378 00000000 */ nop
@@ -2286,7 +2290,7 @@ glabel lvlManageMpGame
/* 0F3EC0 7F0BF390 00000000 */ nop
/* 0F3EC4 7F0BF394 0FC28A35 */ jal update_broken_windows
/* 0F3EC8 7F0BF398 00000000 */ nop
/* 0F3ECC 7F0BF39C 0FC27F4F */ jal update_gray_flying_particles
/* 0F3ECC 7F0BF39C 0FC27F4F */ jal explosionUpdateFlyingParticles
/* 0F3ED0 7F0BF3A0 00000000 */ nop
/* 0F3ED4 7F0BF3A4 0FC0F192 */ jal handle_mp_respawn_and_some_things
/* 0F3ED8 7F0BF3A8 00000000 */ nop
@@ -2402,7 +2406,7 @@ glabel lvlManageMpGame
/* 0F4080 7F0BF550 2404FFFF */ li $a0, -1
/* 0F4084 7F0BF554 00002025 */ move $a0, $zero
/* 0F4088 7F0BF558 00002825 */ move $a1, $zero
/* 0F408C 7F0BF55C 0FC2CB4E */ jal sub_GAME_7F0B2D38
/* 0F408C 7F0BF55C 0FC2CB4E */ jal debugStanView
/* 0F4090 7F0BF560 00003025 */ move $a2, $zero
/* 0F4094 7F0BF564 00002025 */ move $a0, $zero
.L7F0BF568:
@@ -2414,7 +2418,7 @@ glabel lvlManageMpGame
/* 0F40AC 7F0BF57C 24040001 */ li $a0, 1
/* 0F40B0 7F0BF580 00002025 */ move $a0, $zero
/* 0F40B4 7F0BF584 00002825 */ move $a1, $zero
/* 0F40B8 7F0BF588 0FC2CB4E */ jal sub_GAME_7F0B2D38
/* 0F40B8 7F0BF588 0FC2CB4E */ jal debugStanView
/* 0F40BC 7F0BF58C 00003025 */ move $a2, $zero
/* 0F40C0 7F0BF590 1000001A */ b .L7F0BF5FC
/* 0F40C4 7F0BF594 00000000 */ nop
@@ -3165,7 +3169,7 @@ glabel lvlManageMpGame
/* 0F4B08 7F0BFF98 00000000 */ nop
/* 0F4B0C 7F0BFF9C 0FC2FD2D */ jal lvlSetMultipliersForDifficulty
/* 0F4B10 7F0BFFA0 00000000 */ nop
/* 0F4B14 7F0BFFA4 0FC2F4E1 */ jal sub_GAME_7F0BC7D4
/* 0F4B14 7F0BFFA4 0FC2F4E1 */ jal updateRoomStatusFlags
/* 0F4B18 7F0BFFA8 00000000 */ nop
/* 0F4B1C 7F0BFFAC 0FC24E7C */ jal sub_GAME_7F092E50
/* 0F4B20 7F0BFFB0 00000000 */ nop
@@ -3177,7 +3181,7 @@ glabel lvlManageMpGame
/* 0F4B38 7F0BFFC8 00000000 */ nop
/* 0F4B3C 7F0BFFCC 0FC28D1D */ jal update_broken_windows
/* 0F4B40 7F0BFFD0 00000000 */ nop
/* 0F4B44 7F0BFFD4 0FC28238 */ jal update_gray_flying_particles
/* 0F4B44 7F0BFFD4 0FC28238 */ jal explosionUpdateFlyingParticles
/* 0F4B48 7F0BFFD8 00000000 */ nop
/* 0F4B4C 7F0BFFDC 0FC0F252 */ jal handle_mp_respawn_and_some_things
/* 0F4B50 7F0BFFE0 00000000 */ nop
@@ -3293,7 +3297,7 @@ glabel lvlManageMpGame
/* 0F4CF8 7F0C0188 2404FFFF */ li $a0, -1
/* 0F4CFC 7F0C018C 00002025 */ move $a0, $zero
/* 0F4D00 7F0C0190 00002825 */ move $a1, $zero
/* 0F4D04 7F0C0194 0FC2CE3A */ jal sub_GAME_7F0B2D38
/* 0F4D04 7F0C0194 0FC2CE3A */ jal debugStanView
/* 0F4D08 7F0C0198 00003025 */ move $a2, $zero
/* 0F4D0C 7F0C019C 00002025 */ move $a0, $zero
.Ljp7F0C01A0:
@@ -3305,7 +3309,7 @@ glabel lvlManageMpGame
/* 0F4D24 7F0C01B4 24040001 */ li $a0, 1
/* 0F4D28 7F0C01B8 00002025 */ move $a0, $zero
/* 0F4D2C 7F0C01BC 00002825 */ move $a1, $zero
/* 0F4D30 7F0C01C0 0FC2CE3A */ jal sub_GAME_7F0B2D38
/* 0F4D30 7F0C01C0 0FC2CE3A */ jal debugStanView
/* 0F4D34 7F0C01C4 00003025 */ move $a2, $zero
/* 0F4D38 7F0C01C8 1000001A */ b .Ljp7F0C0234
/* 0F4D3C 7F0C01CC 00000000 */ nop
@@ -3508,17 +3512,17 @@ glabel lvlManageMpGame
/* 0F099C 7F0BDFAC 27BDFE68 */ addiu $sp, $sp, -0x198
/* 0F09A0 7F0BDFB0 AFBF0014 */ sw $ra, 0x14($sp)
/* 0F09A4 7F0BDFB4 0C000744 */ jal tlbmanageResetCurrentEntriesCount
/* 0F09A8 7F0BDFB8 00000000 */ nop
/* 0F09A8 7F0BDFB8 00000000 */ nop
/* 0F09AC 7F0BDFBC 3C0E8004 */ lui $t6, %hi(g_ControlsLockedFlag) # $t6, 0x8004
/* 0F09B0 7F0BDFC0 8DCE0FF0 */ lw $t6, %lo(g_ControlsLockedFlag)($t6)
/* 0F09B4 7F0BDFC4 3C018004 */ lui $at, %hi(g_ClockTimer) # $at, 0x8004
/* 0F09B8 7F0BDFC8 11C00003 */ beqz $t6, .L7F0BDFD8
/* 0F09BC 7F0BDFCC 00000000 */ nop
/* 0F09BC 7F0BDFCC 00000000 */ nop
/* 0F09C0 7F0BDFD0 10000010 */ b .L7F0BE014
/* 0F09C4 7F0BDFD4 AC200FF4 */ sw $zero, %lo(g_ClockTimer)($at)
.L7F0BDFD8:
/* 0F09C8 7F0BDFD8 0FC31565 */ jal checkGamePaused
/* 0F09CC 7F0BDFDC 00000000 */ nop
/* 0F09CC 7F0BDFDC 00000000 */ nop
/* 0F09D0 7F0BDFE0 10400004 */ beqz $v0, .L7F0BDFF4
/* 0F09D4 7F0BDFE4 3C0F8004 */ lui $t7, %hi(speedgraphframes) # $t7, 0x8004
/* 0F09D8 7F0BDFE8 3C018004 */ lui $at, %hi(g_ClockTimer) # $at, 0x8004
@@ -3557,10 +3561,10 @@ glabel lvlManageMpGame
/* 0F0A54 7F0BE064 AC8F0000 */ sw $t7, ($a0)
/* 0F0A58 7F0BE068 8F180FE4 */ lw $t8, %lo(g_CurrentStageToLoad)($t8)
/* 0F0A5C 7F0BE06C 1301001D */ beq $t8, $at, .L7F0BE0E4
/* 0F0A60 7F0BE070 00000000 */ nop
/* 0F0A60 7F0BE070 00000000 */ nop
/* 0F0A64 7F0BE074 8F391018 */ lw $t9, %lo(D_80048394)($t9)
/* 0F0A68 7F0BE078 1720001A */ bnez $t9, .L7F0BE0E4
/* 0F0A6C 7F0BE07C 00000000 */ nop
/* 0F0A6C 7F0BE07C 00000000 */ nop
/* 0F0A70 7F0BE080 18400018 */ blez $v0, .L7F0BE0E4
/* 0F0A74 7F0BE084 3C0E8002 */ lui $t6, %hi(g_AppendCheatSinglePlayer) # $t6, 0x8002
/* 0F0A78 7F0BE088 8DCE5E50 */ lw $t6, %lo(g_AppendCheatSinglePlayer)($t6)
@@ -3591,19 +3595,19 @@ glabel lvlManageMpGame
/* 0F0AD0 7F0BE0E0 24630001 */ addiu $v1, $v1, 1
.L7F0BE0E4:
/* 0F0AD4 7F0BE0E4 0FC26669 */ jal getPlayerCount
/* 0F0AD8 7F0BE0E8 00000000 */ nop
/* 0F0AD8 7F0BE0E8 00000000 */ nop
/* 0F0ADC 7F0BE0EC 28410002 */ slti $at, $v0, 2
/* 0F0AE0 7F0BE0F0 1420014C */ bnez $at, .L7F0BE624
/* 0F0AE4 7F0BE0F4 3C188004 */ lui $t8, %hi(g_CurrentStageToLoad) # $t8, 0x8004
/* 0F0AE8 7F0BE0F8 8F180FE4 */ lw $t8, %lo(g_CurrentStageToLoad)($t8)
/* 0F0AEC 7F0BE0FC 2401005A */ li $at, 90
/* 0F0AF0 7F0BE100 13010148 */ beq $t8, $at, .L7F0BE624
/* 0F0AF4 7F0BE104 00000000 */ nop
/* 0F0AF4 7F0BE104 00000000 */ nop
/* 0F0AF8 7F0BE108 0FC3003C */ jal get_mission_state
/* 0F0AFC 7F0BE10C 00000000 */ nop
/* 0F0AFC 7F0BE10C 00000000 */ nop
/* 0F0B00 7F0BE110 24010006 */ li $at, 6
/* 0F0B04 7F0BE114 14410029 */ bne $v0, $at, .L7F0BE1BC
/* 0F0B08 7F0BE118 00000000 */ nop
/* 0F0B08 7F0BE118 00000000 */ nop
/* 0F0B0C 7F0BE11C AFA00190 */ sw $zero, 0x190($sp)
/* 0F0B10 7F0BE120 AFA0018C */ sw $zero, 0x18c($sp)
/* 0F0B14 7F0BE124 0FC26669 */ jal getPlayerCount
@@ -3642,9 +3646,9 @@ glabel lvlManageMpGame
/* 0F0B90 7F0BE1A0 8FA60188 */ lw $a2, 0x188($sp)
.L7F0BE1A4:
/* 0F0B94 7F0BE1A4 18A00005 */ blez $a1, .L7F0BE1BC
/* 0F0B98 7F0BE1A8 00000000 */ nop
/* 0F0B98 7F0BE1A8 00000000 */ nop
/* 0F0B9C 7F0BE1AC 14A60003 */ bne $a1, $a2, .L7F0BE1BC
/* 0F0BA0 7F0BE1B0 00000000 */ nop
/* 0F0BA0 7F0BE1B0 00000000 */ nop
/* 0F0BA4 7F0BE1B4 0FC3003F */ jal set_missionstate
/* 0F0BA8 7F0BE1B8 24040001 */ li $a0, 1
.L7F0BE1BC:
@@ -3653,7 +3657,7 @@ glabel lvlManageMpGame
/* 0F0BB4 7F0BE1C4 3C028004 */ lui $v0, %hi(D_80048394) # $v0, 0x8004
/* 0F0BB8 7F0BE1C8 3C198004 */ lui $t9, %hi(g_ClockTimer) # $t9, 0x8004
/* 0F0BBC 7F0BE1CC 1860004A */ blez $v1, .Leu7F0BE2F8
/* 0F0BC0 7F0BE1D0 00000000 */ nop
/* 0F0BC0 7F0BE1D0 00000000 */ nop
/* 0F0BC4 7F0BE1D4 8C421018 */ lw $v0, %lo(D_80048394)($v0)
/* 0F0BC8 7F0BE1D8 8F390FF4 */ lw $t9, %lo(g_ClockTimer)($t9)
/* 0F0BCC 7F0BE1DC 2464F448 */ addiu $a0, $v1, -0xbb8
@@ -3664,11 +3668,11 @@ glabel lvlManageMpGame
/* 0F0BE0 7F0BE1F0 AFA20184 */ sw $v0, 0x184($sp)
/* 0F0BE4 7F0BE1F4 01C4082A */ slt $at, $t6, $a0
/* 0F0BE8 7F0BE1F8 14200013 */ bnez $at, .L7F0BE248
/* 0F0BEC 7F0BE1FC 00000000 */ nop
/* 0F0BEC 7F0BE1FC 00000000 */ nop
/* 0F0BF0 7F0BE200 0FC26669 */ jal getPlayerCount
/* 0F0BF4 7F0BE204 AFA0017C */ sw $zero, 0x17c($sp)
/* 0F0BF8 7F0BE208 1840000F */ blez $v0, .L7F0BE248
/* 0F0BFC 7F0BE20C 00000000 */ nop
/* 0F0BFC 7F0BE20C 00000000 */ nop
.L7F0BE210:
/* 0F0C00 7F0BE210 0FC26993 */ jal set_cur_player
/* 0F0C04 7F0BE214 8FA4017C */ lw $a0, 0x17c($sp)
@@ -3683,7 +3687,7 @@ glabel lvlManageMpGame
/* 0F0C28 7F0BE238 8FB9017C */ lw $t9, 0x17c($sp)
/* 0F0C2C 7F0BE23C 0322082A */ slt $at, $t9, $v0
/* 0F0C30 7F0BE240 1420FFF3 */ bnez $at, .L7F0BE210
/* 0F0C34 7F0BE244 00000000 */ nop
/* 0F0C34 7F0BE244 00000000 */ nop
.L7F0BE248:
/* 0F0C38 7F0BE248 3C0F8004 */ lui $t7, %hi(g_MpTime) # $t7, 0x8004
/* 0F0C3C 7F0BE24C 8DEF101C */ lw $t7, %lo(g_MpTime)($t7)
@@ -3692,12 +3696,12 @@ glabel lvlManageMpGame
/* 0F0C48 7F0BE258 25F8FE0C */ addiu $t8, $t7, -0x1f4
/* 0F0C4C 7F0BE25C 01D8082A */ slt $at, $t6, $t8
/* 0F0C50 7F0BE260 1420000D */ bnez $at, .L7F0BE298
/* 0F0C54 7F0BE264 00000000 */ nop
/* 0F0C54 7F0BE264 00000000 */ nop
/* 0F0C58 7F0BE268 8F391024 */ lw $t9, %lo(g_MpSoundStateRelated)($t9)
/* 0F0C5C 7F0BE26C 1720000A */ bnez $t9, .L7F0BE298
/* 0F0C60 7F0BE270 00000000 */ nop
/* 0F0C60 7F0BE270 00000000 */ nop
/* 0F0C64 7F0BE274 0FC2FC1E */ jal lvlGetControlsLockedFlag
/* 0F0C68 7F0BE278 00000000 */ nop
/* 0F0C68 7F0BE278 00000000 */ nop
/* 0F0C6C 7F0BE27C 14400006 */ bnez $v0, .L7F0BE298
/* 0F0C70 7F0BE280 3C048005 */ lui $a0, %hi(g_musicSfxBufferPtr) # $a0, 0x8005
/* 0F0C74 7F0BE284 3C068004 */ lui $a2, %hi(g_MpSoundStateRelated) # $a2, 0x8004
@@ -3707,14 +3711,14 @@ glabel lvlManageMpGame
/* 0F0C84 7F0BE294 240500A1 */ li $a1, 161
.L7F0BE298:
/* 0F0C88 7F0BE298 0FC2FC1E */ jal lvlGetControlsLockedFlag
/* 0F0C8C 7F0BE29C 00000000 */ nop
/* 0F0C8C 7F0BE29C 00000000 */ nop
/* 0F0C90 7F0BE2A0 1040000A */ beqz $v0, .L7F0BE2CC
/* 0F0C94 7F0BE2A4 3C048004 */ lui $a0, %hi(g_MpSoundStateRelated) # $a0, 0x8004
/* 0F0C98 7F0BE2A8 8C841024 */ lw $a0, %lo(g_MpSoundStateRelated)($a0)
/* 0F0C9C 7F0BE2AC 10800007 */ beqz $a0, .L7F0BE2CC
/* 0F0CA0 7F0BE2B0 00000000 */ nop
/* 0F0CA0 7F0BE2B0 00000000 */ nop
/* 0F0CA4 7F0BE2B4 0C002094 */ jal sndGetPlayingState
/* 0F0CA8 7F0BE2B8 00000000 */ nop
/* 0F0CA8 7F0BE2B8 00000000 */ nop
/* 0F0CAC 7F0BE2BC 10400003 */ beqz $v0, .L7F0BE2CC
/* 0F0CB0 7F0BE2C0 3C048004 */ lui $a0, %hi(g_MpSoundStateRelated) # $a0, 0x8004
/* 0F0CB4 7F0BE2C4 0C002120 */ jal sndDeactivate
@@ -3728,7 +3732,7 @@ glabel lvlManageMpGame
/* 0F0CD0 7F0BE2E0 10200005 */ beqz $at, .Leu7F0BE2F8
/* 0F0CD4 7F0BE2E4 01C3082A */ slt $at, $t6, $v1
/* 0F0CD8 7F0BE2E8 14200003 */ bnez $at, .Leu7F0BE2F8
/* 0F0CDC 7F0BE2EC 00000000 */ nop
/* 0F0CDC 7F0BE2EC 00000000 */ nop
/* 0F0CE0 7F0BE2F0 0FC30684 */ jal mpCalculateAwards
/* 0F0CE4 7F0BE2F4 00002025 */ move $a0, $zero
.Leu7F0BE2F8:
@@ -3736,12 +3740,12 @@ glabel lvlManageMpGame
/* 0F0CEC 7F0BE2FC 8F181020 */ lw $t8, %lo(g_MpPoint)($t8)
/* 0F0CF0 7F0BE300 3C198004 */ lui $t9, %hi(g_ClockTimer) # $t9, 0x8004
/* 0F0CF4 7F0BE304 1B00003D */ blez $t8, .L7F0BE3FC
/* 0F0CF8 7F0BE308 00000000 */ nop
/* 0F0CF8 7F0BE308 00000000 */ nop
/* 0F0CFC 7F0BE30C 8F390FF4 */ lw $t9, %lo(g_ClockTimer)($t9)
/* 0F0D00 7F0BE310 1320003A */ beqz $t9, .L7F0BE3FC
/* 0F0D04 7F0BE314 00000000 */ nop
/* 0F0D04 7F0BE314 00000000 */ nop
/* 0F0D08 7F0BE318 0FC26669 */ jal getPlayerCount
/* 0F0D0C 7F0BE31C 00000000 */ nop
/* 0F0D0C 7F0BE31C 00000000 */ nop
/* 0F0D10 7F0BE320 00403825 */ move $a3, $v0
/* 0F0D14 7F0BE324 00002825 */ move $a1, $zero
/* 0F0D18 7F0BE328 00003025 */ move $a2, $zero
@@ -3763,7 +3767,7 @@ glabel lvlManageMpGame
/* 0F0D54 7F0BE364 24A50001 */ addiu $a1, $a1, 1
/* 0F0D58 7F0BE368 C45203E4 */ lwc1 $f18, 0x3e4($v0)
/* 0F0D5C 7F0BE36C 4612003E */ c.le.s $f0, $f18
/* 0F0D60 7F0BE370 00000000 */ nop
/* 0F0D60 7F0BE370 00000000 */ nop
/* 0F0D64 7F0BE374 45020003 */ bc1fl .L7F0BE384
/* 0F0D68 7F0BE378 AFA3001C */ sw $v1, 0x1c($sp)
/* 0F0D6C 7F0BE37C 24A50001 */ addiu $a1, $a1, 1
@@ -3793,27 +3797,27 @@ glabel lvlManageMpGame
/* 0F0DC0 7F0BE3D0 24630004 */ addiu $v1, $v1, 4
.L7F0BE3D4:
/* 0F0DC4 7F0BE3D4 18C00009 */ blez $a2, .L7F0BE3FC
/* 0F0DC8 7F0BE3D8 00000000 */ nop
/* 0F0DC8 7F0BE3D8 00000000 */ nop
/* 0F0DCC 7F0BE3DC 14A00005 */ bnez $a1, .L7F0BE3F4
/* 0F0DD0 7F0BE3E0 00000000 */ nop
/* 0F0DD0 7F0BE3E0 00000000 */ nop
/* 0F0DD4 7F0BE3E4 0FC30684 */ jal mpCalculateAwards
/* 0F0DD8 7F0BE3E8 00002025 */ move $a0, $zero
/* 0F0DDC 7F0BE3EC 10000003 */ b .L7F0BE3FC
/* 0F0DE0 7F0BE3F0 00000000 */ nop
/* 0F0DE0 7F0BE3F0 00000000 */ nop
.L7F0BE3F4:
/* 0F0DE4 7F0BE3F4 0FC30680 */ jal mpwatchSetStopPlayFlag
/* 0F0DE8 7F0BE3F8 00000000 */ nop
/* 0F0DE8 7F0BE3F8 00000000 */ nop
.L7F0BE3FC:
/* 0F0DEC 7F0BE3FC 0FC051B2 */ jal get_scenario
/* 0F0DF0 7F0BE400 00000000 */ nop
/* 0F0DF0 7F0BE400 00000000 */ nop
/* 0F0DF4 7F0BE404 24010001 */ li $at, 1
/* 0F0DF8 7F0BE408 14410086 */ bne $v0, $at, .L7F0BE624
/* 0F0DFC 7F0BE40C 3C0F8004 */ lui $t7, %hi(g_ClockTimer) # $t7, 0x8004
/* 0F0E00 7F0BE410 8DEF0FF4 */ lw $t7, %lo(g_ClockTimer)($t7)
/* 0F0E04 7F0BE414 11E00083 */ beqz $t7, .L7F0BE624
/* 0F0E08 7F0BE418 00000000 */ nop
/* 0F0E08 7F0BE418 00000000 */ nop
/* 0F0E0C 7F0BE41C 0FC26669 */ jal getPlayerCount
/* 0F0E10 7F0BE420 00000000 */ nop
/* 0F0E10 7F0BE420 00000000 */ nop
/* 0F0E14 7F0BE424 44800000 */ mtc1 $zero, $f0
/* 0F0E18 7F0BE428 00405025 */ move $t2, $v0
/* 0F0E1C 7F0BE42C 00006825 */ move $t5, $zero
@@ -3932,7 +3936,7 @@ glabel lvlManageMpGame
/* 0F0FB4 7F0BE5C4 258C0001 */ addiu $t4, $t4, 1
/* 0F0FB8 7F0BE5C8 C46403E4 */ lwc1 $f4, 0x3e4($v1)
/* 0F0FBC 7F0BE5CC 4600203C */ c.lt.s $f4, $f0
/* 0F0FC0 7F0BE5D0 00000000 */ nop
/* 0F0FC0 7F0BE5D0 00000000 */ nop
/* 0F0FC4 7F0BE5D4 45020003 */ bc1fl .L7F0BE5E4
/* 0F0FC8 7F0BE5D8 258C0001 */ addiu $t4, $t4, 1
/* 0F0FCC 7F0BE5DC 27FF0001 */ addiu $ra, $ra, 1
@@ -3950,13 +3954,13 @@ glabel lvlManageMpGame
/* 0F0FF0 7F0BE600 0FC30684 */ jal mpCalculateAwards
/* 0F0FF4 7F0BE604 00002025 */ move $a0, $zero
/* 0F0FF8 7F0BE608 10000006 */ b .L7F0BE624
/* 0F0FFC 7F0BE60C 00000000 */ nop
/* 0F0FFC 7F0BE60C 00000000 */ nop
/* 0F1000 7F0BE610 01A3082A */ slt $at, $t5, $v1
.L7F0BE614:
/* 0F1004 7F0BE614 14200003 */ bnez $at, .L7F0BE624
/* 0F1008 7F0BE618 00000000 */ nop
/* 0F1008 7F0BE618 00000000 */ nop
/* 0F100C 7F0BE61C 0FC30680 */ jal mpwatchSetStopPlayFlag
/* 0F1010 7F0BE620 00000000 */ nop
/* 0F1010 7F0BE620 00000000 */ nop
.L7F0BE624:
/* 0F1014 7F0BE624 3C028004 */ lui $v0, %hi(g_ClockTimer) # $v0, 0x8004
/* 0F1018 7F0BE628 3C0F8004 */ lui $t7, %hi(D_80048394) # $t7, 0x8004
@@ -4015,7 +4019,7 @@ glabel lvlManageMpGame
/* 0F10E4 7F0BE6F4 3C038004 */ lui $v1, %hi(D_8004838C) # $v1, 0x8004
/* 0F10E8 7F0BE6F8 24631010 */ addiu $v1, %lo(D_8004838C) # addiu $v1, $v1, 0x1010
/* 0F10EC 7F0BE6FC 11C00005 */ beqz $t6, .L7F0BE714
/* 0F10F0 7F0BE700 00000000 */ nop
/* 0F10F0 7F0BE700 00000000 */ nop
/* 0F10F4 7F0BE704 8C790000 */ lw $t9, ($v1)
/* 0F10F8 7F0BE708 0322C021 */ addu $t8, $t9, $v0
/* 0F10FC 7F0BE70C 10000015 */ b .L7F0BE764
@@ -4048,49 +4052,49 @@ glabel lvlManageMpGame
/* 0F1160 7F0BE770 8F390FE4 */ lw $t9, %lo(g_CurrentStageToLoad)($t9)
/* 0F1164 7F0BE774 2401005A */ li $at, 90
/* 0F1168 7F0BE778 17210009 */ bne $t9, $at, .L7F0BE7A0
/* 0F116C 7F0BE77C 00000000 */ nop
/* 0F116C 7F0BE77C 00000000 */ nop
/* 0F1170 7F0BE780 0FC2436F */ jal cheat_buttons_mp_related
/* 0F1174 7F0BE784 00000000 */ nop
/* 0F1174 7F0BE784 00000000 */ nop
/* 0F1178 7F0BE788 0FC06920 */ jal menu_init
/* 0F117C 7F0BE78C 00000000 */ nop
/* 0F117C 7F0BE78C 00000000 */ nop
/* 0F1180 7F0BE790 0FC30388 */ jal langTick
/* 0F1184 7F0BE794 00000000 */ nop
/* 0F1184 7F0BE794 00000000 */ nop
/* 0F1188 7F0BE798 100000A9 */ b .L7F0BEA40
/* 0F118C 7F0BE79C 00000000 */ nop
/* 0F118C 7F0BE79C 00000000 */ nop
.L7F0BE7A0:
/* 0F1190 7F0BE7A0 0FC26C3F */ jal sub_GAME_7F09BBBC
/* 0F1194 7F0BE7A4 00000000 */ nop
/* 0F1194 7F0BE7A4 00000000 */ nop
/* 0F1198 7F0BE7A8 0FC2F72D */ jal lvlSetMultipliersForDifficulty
/* 0F119C 7F0BE7AC 00000000 */ nop
/* 0F11A0 7F0BE7B0 0FC2EEF5 */ jal sub_GAME_7F0BC7D4
/* 0F11A4 7F0BE7B4 00000000 */ nop
/* 0F119C 7F0BE7AC 00000000 */ nop
/* 0F11A0 7F0BE7B0 0FC2EEF5 */ jal updateRoomStatusFlags
/* 0F11A4 7F0BE7B4 00000000 */ nop
/* 0F11A8 7F0BE7B8 0FC248E4 */ jal sub_GAME_7F092E50
/* 0F11AC 7F0BE7BC 00000000 */ nop
/* 0F11AC 7F0BE7BC 00000000 */ nop
/* 0F11B0 7F0BE7C0 0FC24E5E */ jal sub_GAME_7F094438
/* 0F11B4 7F0BE7C4 00000000 */ nop
/* 0F11B4 7F0BE7C4 00000000 */ nop
/* 0F11B8 7F0BE7C8 0FC28ECE */ jal sub_GAME_7F0A4600
/* 0F11BC 7F0BE7CC 00000000 */ nop
/* 0F11BC 7F0BE7CC 00000000 */ nop
/* 0F11C0 7F0BE7D0 0FC1A580 */ jal update_bullet_casings
/* 0F11C4 7F0BE7D4 00000000 */ nop
/* 0F11C4 7F0BE7D4 00000000 */ nop
/* 0F11C8 7F0BE7D8 0FC28785 */ jal update_broken_windows
/* 0F11CC 7F0BE7DC 00000000 */ nop
/* 0F11D0 7F0BE7E0 0FC27CA0 */ jal update_gray_flying_particles
/* 0F11D4 7F0BE7E4 00000000 */ nop
/* 0F11CC 7F0BE7DC 00000000 */ nop
/* 0F11D0 7F0BE7E0 0FC27CA0 */ jal explosionUpdateFlyingParticles
/* 0F11D4 7F0BE7E4 00000000 */ nop
/* 0F11D8 7F0BE7E8 0FC0F1C2 */ jal handle_mp_respawn_and_some_things
/* 0F11DC 7F0BE7EC 00000000 */ nop
/* 0F11DC 7F0BE7EC 00000000 */ nop
/* 0F11E0 7F0BE7F0 0FC3022A */ jal reset_all_music_slots
/* 0F11E4 7F0BE7F4 00000000 */ nop
/* 0F11E4 7F0BE7F4 00000000 */ nop
/* 0F11E8 7F0BE7F8 0FC30388 */ jal langTick
/* 0F11EC 7F0BE7FC 00000000 */ nop
/* 0F11EC 7F0BE7FC 00000000 */ nop
/* 0F11F0 7F0BE800 0FC24116 */ jal get_debug_joy2detailedit_flag
/* 0F11F4 7F0BE804 00000000 */ nop
/* 0F11F4 7F0BE804 00000000 */ nop
/* 0F11F8 7F0BE808 1040004D */ beqz $v0, .L7F0BE940
/* 0F11FC 7F0BE80C 3C068004 */ lui $a2, %hi(D_800483C8) # $a2, 0x8004
/* 0F1200 7F0BE810 24C6104C */ addiu $a2, %lo(D_800483C8) # addiu $a2, $a2, 0x104c
/* 0F1204 7F0BE814 8CD80000 */ lw $t8, ($a2)
/* 0F1208 7F0BE818 24043000 */ li $a0, 12288
/* 0F120C 7F0BE81C 17000048 */ bnez $t8, .L7F0BE940
/* 0F1210 7F0BE820 00000000 */ nop
/* 0F1210 7F0BE820 00000000 */ nop
/* 0F1214 7F0BE824 0C0022E0 */ jal mempAllocBytesInBank
/* 0F1218 7F0BE828 24050004 */ li $a1, 4
/* 0F121C 7F0BE82C 3C068004 */ lui $a2, %hi(D_800483C8) # $a2, 0x8004
@@ -4165,14 +4169,14 @@ glabel lvlManageMpGame
/* 0F132C 7F0BE93C A04F000D */ sb $t7, 0xd($v0)
.L7F0BE940:
/* 0F1330 7F0BE940 0FC2413C */ jal get_debug_portal_flag
/* 0F1334 7F0BE944 00000000 */ nop
/* 0F1334 7F0BE944 00000000 */ nop
/* 0F1338 7F0BE948 10400003 */ beqz $v0, .L7F0BE958
/* 0F133C 7F0BE94C 00000000 */ nop
/* 0F133C 7F0BE94C 00000000 */ nop
/* 0F1340 7F0BE950 0FC2F4B4 */ jal lvlPortalDebug7F0BDF10
/* 0F1344 7F0BE954 00002025 */ move $a0, $zero
.L7F0BE958:
/* 0F1348 7F0BE958 0FC240FC */ jal getDebugMode
/* 0F134C 7F0BE95C 00000000 */ nop
/* 0F134C 7F0BE95C 00000000 */ nop
/* 0F1350 7F0BE960 24010004 */ li $at, 4
/* 0F1354 7F0BE964 10410006 */ beq $v0, $at, .L7F0BE980
/* 0F1358 7F0BE968 00002025 */ move $a0, $zero
@@ -4180,7 +4184,7 @@ glabel lvlManageMpGame
/* 0F1360 7F0BE970 1041001A */ beq $v0, $at, .L7F0BE9DC
/* 0F1364 7F0BE974 00002025 */ move $a0, $zero
/* 0F1368 7F0BE978 10000031 */ b .L7F0BEA40
/* 0F136C 7F0BE97C 00000000 */ nop
/* 0F136C 7F0BE97C 00000000 */ nop
.L7F0BE980:
/* 0F1370 7F0BE980 0C002C48 */ jal joyGetButtonsPressedThisFrame
/* 0F1374 7F0BE984 24050002 */ li $a1, 2
@@ -4190,29 +4194,29 @@ glabel lvlManageMpGame
/* 0F1384 7F0BE994 2404FFFF */ li $a0, -1
/* 0F1388 7F0BE998 00002025 */ move $a0, $zero
/* 0F138C 7F0BE99C 00002825 */ move $a1, $zero
/* 0F1390 7F0BE9A0 0FC2C7FE */ jal sub_GAME_7F0B2D38
/* 0F1390 7F0BE9A0 0FC2C7FE */ jal debugStanView
/* 0F1394 7F0BE9A4 00003025 */ move $a2, $zero
/* 0F1398 7F0BE9A8 00002025 */ move $a0, $zero
.L7F0BE9AC:
/* 0F139C 7F0BE9AC 0C002C48 */ jal joyGetButtonsPressedThisFrame
/* 0F13A0 7F0BE9B0 24050001 */ li $a1, 1
/* 0F13A4 7F0BE9B4 10400022 */ beqz $v0, .L7F0BEA40
/* 0F13A8 7F0BE9B8 00000000 */ nop
/* 0F13A8 7F0BE9B8 00000000 */ nop
/* 0F13AC 7F0BE9BC 0FC2BA3C */ jal sub_GAME_7F0AF630
/* 0F13B0 7F0BE9C0 24040001 */ li $a0, 1
/* 0F13B4 7F0BE9C4 00002025 */ move $a0, $zero
/* 0F13B8 7F0BE9C8 00002825 */ move $a1, $zero
/* 0F13BC 7F0BE9CC 0FC2C7FE */ jal sub_GAME_7F0B2D38
/* 0F13BC 7F0BE9CC 0FC2C7FE */ jal debugStanView
/* 0F13C0 7F0BE9D0 00003025 */ move $a2, $zero
/* 0F13C4 7F0BE9D4 1000001A */ b .L7F0BEA40
/* 0F13C8 7F0BE9D8 00000000 */ nop
/* 0F13C8 7F0BE9D8 00000000 */ nop
.L7F0BE9DC:
/* 0F13CC 7F0BE9DC 0C002C48 */ jal joyGetButtonsPressedThisFrame
/* 0F13D0 7F0BE9E0 24050002 */ li $a1, 2
/* 0F13D4 7F0BE9E4 50400004 */ beql $v0, $zero, .L7F0BE9F8
/* 0F13D8 7F0BE9E8 00002025 */ move $a0, $zero
/* 0F13DC 7F0BE9EC 0FC08B7E */ jal chrDecrementAnimationTablePointerCount
/* 0F13E0 7F0BE9F0 00000000 */ nop
/* 0F13E0 7F0BE9F0 00000000 */ nop
/* 0F13E4 7F0BE9F4 00002025 */ move $a0, $zero
.L7F0BE9F8:
/* 0F13E8 7F0BE9F8 0C002C48 */ jal joyGetButtonsPressedThisFrame
@@ -4220,7 +4224,7 @@ glabel lvlManageMpGame
/* 0F13F0 7F0BEA00 50400004 */ beql $v0, $zero, .L7F0BEA14
/* 0F13F4 7F0BEA04 00002025 */ move $a0, $zero
/* 0F13F8 7F0BEA08 0FC08B96 */ jal chrIncrementAnimationTablePointerCount
/* 0F13FC 7F0BEA0C 00000000 */ nop
/* 0F13FC 7F0BEA0C 00000000 */ nop
/* 0F1400 7F0BEA10 00002025 */ move $a0, $zero
.L7F0BEA14:
/* 0F1404 7F0BEA14 0C002C48 */ jal joyGetButtonsPressedThisFrame
@@ -4228,7 +4232,7 @@ glabel lvlManageMpGame
/* 0F140C 7F0BEA1C 50400004 */ beql $v0, $zero, .L7F0BEA30
/* 0F1410 7F0BEA20 00002025 */ move $a0, $zero
/* 0F1414 7F0BEA24 0FC08BA4 */ jal chrToggleD_8002C90C
/* 0F1418 7F0BEA28 00000000 */ nop
/* 0F1418 7F0BEA28 00000000 */ nop
/* 0F141C 7F0BEA2C 00002025 */ move $a0, $zero
.L7F0BEA30:
/* 0F1420 7F0BEA30 0C002C20 */ jal joyGetButtons
@@ -4237,7 +4241,7 @@ glabel lvlManageMpGame
/* 0F142C 7F0BEA3C 0002202B */ sltu $a0, $zero, $v0
.L7F0BEA40:
/* 0F1430 7F0BEA40 0FC240FC */ jal getDebugMode
/* 0F1434 7F0BEA44 00000000 */ nop
/* 0F1434 7F0BEA44 00000000 */ nop
/* 0F1438 7F0BEA48 2401000C */ li $at, 12
/* 0F143C 7F0BEA4C 1041002E */ beq $v0, $at, .L7F0BEB08
/* 0F1440 7F0BEA50 00002025 */ move $a0, $zero
@@ -4248,7 +4252,7 @@ glabel lvlManageMpGame
/* 0F1454 7F0BEA64 54410074 */ bnel $v0, $at, .L7F0BEC38
/* 0F1458 7F0BEA68 8FBF0014 */ lw $ra, 0x14($sp)
/* 0F145C 7F0BEA6C 0C000F7E */ jal viGetHorizontalOffset
/* 0F1460 7F0BEA70 00000000 */ nop
/* 0F1460 7F0BEA70 00000000 */ nop
/* 0F1464 7F0BEA74 0C000F78 */ jal viGet800232A0
/* 0F1468 7F0BEA78 AFA20030 */ sw $v0, 0x30($sp)
/* 0F146C 7F0BEA7C AFA2002C */ sw $v0, 0x2c($sp)
@@ -4296,7 +4300,7 @@ glabel lvlManageMpGame
/* 0F1500 7F0BEB10 50400004 */ beql $v0, $zero, .L7F0BEB24
/* 0F1504 7F0BEB14 00002025 */ move $a0, $zero
/* 0F1508 7F0BEB18 0FC2F37A */ jal lvlMusicAppendPlayEndTheme
/* 0F150C 7F0BEB1C 00000000 */ nop
/* 0F150C 7F0BEB1C 00000000 */ nop
/* 0F1510 7F0BEB20 00002025 */ move $a0, $zero
.L7F0BEB24:
/* 0F1514 7F0BEB24 0C002C48 */ jal joyGetButtonsPressedThisFrame
@@ -4304,7 +4308,7 @@ glabel lvlManageMpGame
/* 0F151C 7F0BEB2C 50400004 */ beql $v0, $zero, .L7F0BEB40
/* 0F1520 7F0BEB30 00002025 */ move $a0, $zero
/* 0F1524 7F0BEB34 0FC2F367 */ jal lvlMusicAppendPlaySoloDeathShort
/* 0F1528 7F0BEB38 00000000 */ nop
/* 0F1528 7F0BEB38 00000000 */ nop
/* 0F152C 7F0BEB3C 00002025 */ move $a0, $zero
.L7F0BEB40:
/* 0F1530 7F0BEB40 0C002C48 */ jal joyGetButtonsPressedThisFrame
@@ -4312,7 +4316,7 @@ glabel lvlManageMpGame
/* 0F1538 7F0BEB48 50400004 */ beql $v0, $zero, .L7F0BEB5C
/* 0F153C 7F0BEB4C 00002025 */ move $a0, $zero
/* 0F1540 7F0BEB50 0C00190C */ jal musicTrack1Stop
/* 0F1544 7F0BEB54 00000000 */ nop
/* 0F1544 7F0BEB54 00000000 */ nop
/* 0F1548 7F0BEB58 00002025 */ move $a0, $zero
.L7F0BEB5C:
/* 0F154C 7F0BEB5C 0C002C48 */ jal joyGetButtonsPressedThisFrame
@@ -4320,7 +4324,7 @@ glabel lvlManageMpGame
/* 0F1554 7F0BEB64 50400034 */ beql $v0, $zero, .L7F0BEC38
/* 0F1558 7F0BEB68 8FBF0014 */ lw $ra, 0x14($sp)
/* 0F155C 7F0BEB6C 0C001940 */ jal musicTrack1SaveCurrentVolumeAsTrackDefault
/* 0F1560 7F0BEB70 00000000 */ nop
/* 0F1560 7F0BEB70 00000000 */ nop
/* 0F1564 7F0BEB74 10000030 */ b .L7F0BEC38
/* 0F1568 7F0BEB78 8FBF0014 */ lw $ra, 0x14($sp)
.L7F0BEB7C:
@@ -4361,7 +4365,7 @@ glabel lvlManageMpGame
/* 0F15EC 7F0BEBFC 50400004 */ beql $v0, $zero, .L7F0BEC10
/* 0F15F0 7F0BEC00 00002025 */ move $a0, $zero
/* 0F15F4 7F0BEC04 0C002161 */ jal sndDeactivateAllSfxByFlag_1
/* 0F15F8 7F0BEC08 00000000 */ nop
/* 0F15F8 7F0BEC08 00000000 */ nop
/* 0F15FC 7F0BEC0C 00002025 */ move $a0, $zero
.L7F0BEC10:
/* 0F1600 7F0BEC10 0C002C48 */ jal joyGetButtonsPressedThisFrame
@@ -4378,7 +4382,7 @@ glabel lvlManageMpGame
.L7F0BEC38:
/* 0F1628 7F0BEC38 27BD0198 */ addiu $sp, $sp, 0x198
/* 0F162C 7F0BEC3C 03E00008 */ jr $ra
/* 0F1630 7F0BEC40 00000000 */ nop
/* 0F1630 7F0BEC40 00000000 */ nop
)
#endif
@@ -4389,10 +4393,10 @@ glabel lvlManageMpGame
* Assumes a debug mode is present, and handles debug edit intro, debug stan edit, debug bond "view."
* By default, the DEB_BOND_VIEW path is chosen without debug info.
* This updates the player viewport(s), and handles player movement.
*
*
* Multiplayer:
* Updates distance_traveled and possibly (depending on scenario) have_token_or_goldengun.
*
*
* US Address 0x7F0BF800.
* EU address 7F0BEC44.
*/
@@ -4412,11 +4416,11 @@ void lvlViewMoveTick(void)
{
if ((getDebugMode() == DEB_MOVE_VIEW) || ((getDebugMode() == DEB_INTRO_EDIT) && (D_80036ABC < 0)))
{
sub_GAME_7F091080(joyGetStickX(local_player_number), joyGetStickY(local_player_number), joyGetButtons(local_player_number, ANY_BUTTON));
debugFreeCamera(joyGetStickX(local_player_number), joyGetStickY(local_player_number), joyGetButtons(local_player_number, ANY_BUTTON));
}
else
{
sub_GAME_7F091080(joyGetStickX(local_player_number), joyGetStickY(local_player_number), 0);
debugFreeCamera(joyGetStickX(local_player_number), joyGetStickY(local_player_number), 0);
}
}
break;
@@ -4425,11 +4429,11 @@ void lvlViewMoveTick(void)
{
if (getDebugMode() == DEB_STAN_VIEW)
{
sub_GAME_7F0B2D38(joyGetStickX(local_player_number), joyGetStickY(local_player_number), joyGetButtons(local_player_number, ANY_BUTTON));
debugStanView(joyGetStickX(local_player_number), joyGetStickY(local_player_number), joyGetButtons(local_player_number, ANY_BUTTON));
}
else
{
sub_GAME_7F0B2D38(joyGetStickX(local_player_number), joyGetStickY(local_player_number), 0);
debugStanView(joyGetStickX(local_player_number), joyGetStickY(local_player_number), 0);
}
}
break;
@@ -4464,13 +4468,13 @@ void lvlViewMoveTick(void)
currentPlayerEquipWeaponWrapper(GUNRIGHT, ITEM_TOKEN);
if(1);
if (g_CurrentPlayer->hands[GUNRIGHT].when_detonating_mines_is_0 == 2)
{
g_CurrentPlayer->hands[GUNRIGHT].when_detonating_mines_is_0 = 5;
}
}
g_playerPerm->flag_counter += g_ClockTimer;
g_playerPerm->have_token_or_goldengun = 1;
}
+28 -10
View File
@@ -11,7 +11,7 @@ s32 g_LangBanks[45];
//CODE.bss:8008C6F4
struct jpncharpixels* g_JpnCharCachePixels;
//CODE.bss:8008C6F8
//CODE.bss:8008C6F8 canonically jloaddata
struct jpncacheitem *g_JpnCacheCacheItems;
@@ -125,6 +125,7 @@ void *LnameX_lookuptable[45][2] = {
{"LmiscP", "LmiscJ"}}; /* Cheat options */
#endif
// cannonically gettextloadnum
LEVELID langGetLangBankIndexFromStagenum(LEVELID level)
{
LEVELID return_id;
@@ -214,6 +215,9 @@ LEVELID langGetLangBankIndexFromStagenum(LEVELID level)
break;
default:
{
#ifdef DEBUG
osSyncPrintf("gettextloadnum: level %d unknown. (HANG now.)\n",level);
#endif
/* infinite loop on invalid text bank */
while(1) {};
}
@@ -248,15 +252,22 @@ void langInit(void) {
}
void langTick(void) {
//assert here reveals this file is language.c
void langTick(void)
{
s32 i;
if (j_text_trigger) {
for (i = 0; i < 0x7c; i++) {
if (g_JpnCacheCacheItems[i].ttl) {
g_JpnCacheCacheItems[i].ttl--;
}
if (j_text_trigger)
{
for (i = 0; i < 0x7c; i++)
{
if (g_JpnCacheCacheItems[i].ttl)
{
g_JpnCacheCacheItems[i].ttl--;
}
#ifdef DEBUG
assert(jloaddata[i].timeleft<=3);
#endif
}
}
}
@@ -356,7 +367,11 @@ void langClearBank(s32 textBank) {
g_LangBanks[textBank] = 0;
}
/**
* Get pointer of a string based on language of game (E/J)
* @param slotID: UniqueID of string (a combination of Bank ID and string index)
* @return char* string.
*/
u8 * langGet(s32 slotID)
{
u32 * textbank_ptr = g_LangBanks[slotID >> 10]; /* get the text file bank ID index the text ptr table */
@@ -364,5 +379,8 @@ u8 * langGet(s32 slotID)
u32 output_slot = textslot_offset; /* add the text slot offset to the base ptr to get the ptr to text file's slot */
output_slot += (u32)textbank_ptr;
#ifdef DEBUG
return (textslot_offset != 0) ? (u8 *)output_slot : "Sorry, string not loaded.";
#endif
return (textslot_offset != 0) ? (u8*)output_slot : NULL;
}
}
+2 -1
View File
@@ -10,13 +10,14 @@ struct jpncharpixels {
};
struct jpncacheitem {
u16 ttl : 2;
u16 ttl : 2; //cannonically timeleft
u16 codepoint : 14;
};
extern s32 j_text_trigger;
void langLoadToAddr(u32 id);
void langTick(void);
u8 * langGet(s32 slotID);
void langLoadToBank(int id, u8 *target, int size);
+2 -2
View File
@@ -46,7 +46,7 @@ glabel cosf
/* 08C9D0 7F057EA0 3C018005 */ lui $at, %hi(D_800536C0)
/* 08C9D4 7F057EA4 C42A36C0 */ lwc1 $f10, %lo(D_800536C0)($at)
/* 08C9D8 7F057EA8 460A6300 */ add.s $f12, $f12, $f10
.size cosf, . - cosf
# ################################################################
glabel sinf
@@ -125,4 +125,4 @@ glabel sinf
.L7F057FC4:
/* 08CAF4 7F057FC4 03E00008 */ jr $ra
/* 08CAF8 7F057FC8 00000000 */ nop
.size sinf, . - sinf
+6 -4
View File
@@ -68,9 +68,11 @@ void sub_GAME_7F05AEFC(coord3d *arg0, coord3d *arg1, coord3d *arg2, coord3d *arg
* - stack resize: fail
* - identical instructions: fail
* - identical registers: fail
*
* https://decomp.me/scratch/EHA1A 74.55 %
*/
#ifdef NONMATCHING
void sub_GAME_7F05B024(f32 *arg0, f32 *arg1, f32 *arg2, f32 *arg3, f32 arg4, f32 arg5, f32 *result)
void sub_GAME_7F05B024(coord3d *arg0, coord3d *arg1, coord3d *arg2, coord3d *arg3, f32 arg4, f32 arg5, coord3d *result)
{
f32 square;
f32 cube;
@@ -86,9 +88,9 @@ void sub_GAME_7F05B024(f32 *arg0, f32 *arg1, f32 *arg2, f32 *arg3, f32 arg4, f32
temp_f18 = ((2.0f - arg5) * cube) + (square * (arg5 - 3.0f)) + 1.0f;
temp_f8 = ((arg5 - 2.0f) * cube) + (square * (3.0f - (2.0f * arg5))) + (arg4 * arg5);
result[0] = (arg3[0] * temp_f6) + ((temp_f16 * arg0[0]) + (temp_f18 * arg1[0]) + (temp_f8 * arg2[0]));
result[1] = (arg3[1] * temp_f6) + ((temp_f16 * arg0[1]) + (temp_f18 * arg1[1]) + (temp_f8 * arg2[1]));
result[2] = (arg3[2] * temp_f6) + ((temp_f16 * arg0[2]) + (temp_f18 * arg1[2]) + (temp_f8 * arg2[2]));
result->f[0] = temp_f16 * arg0->f[0] + temp_f18 * arg1->f[0] + temp_f8 * arg2->f[0] + temp_f6 * arg3->f[0];
result->f[1] = temp_f16 * arg0->f[1] + temp_f18 * arg1->f[1] + temp_f8 * arg2->f[1] + temp_f6 * arg3->f[1];
result->f[2] = temp_f16 * arg0->f[2] + temp_f18 * arg1->f[2] + temp_f8 * arg2->f[2] + temp_f6 * arg3->f[2];
}
#else
GLOBAL_ASM(

Some files were not shown because too many files have changed in this diff Show More