mirror of
https://github.com/n64decomp/sm64
synced 2026-07-09 21:51:27 -04:00
Refresh 2
This commit is contained in:
@@ -16,8 +16,8 @@
|
||||
static u16 gRandomSeed16;
|
||||
|
||||
// unused
|
||||
static void func_80383B70(u32 segptr) {
|
||||
gBehCommand = segmented_to_virtual((void *) segptr);
|
||||
static void func_80383B70(void *segptr) {
|
||||
gBehCommand = segmented_to_virtual(segptr);
|
||||
gCurrentObject->stackIndex = 0;
|
||||
}
|
||||
|
||||
@@ -72,13 +72,13 @@ void func_80383D68(struct Object *object) {
|
||||
object->header.gfx.angle[2] = object->oFaceAngleRoll & 0xFFFF;
|
||||
}
|
||||
|
||||
static void cur_object_stack_push(u32 value) {
|
||||
static void cur_object_stack_push(uintptr_t value) {
|
||||
gCurrentObject->stack[gCurrentObject->stackIndex] = value;
|
||||
gCurrentObject->stackIndex++;
|
||||
}
|
||||
|
||||
static u32 cur_object_stack_pop(void) {
|
||||
u32 value;
|
||||
static uintptr_t cur_object_stack_pop(void) {
|
||||
uintptr_t value;
|
||||
gCurrentObject->stackIndex--;
|
||||
value = gCurrentObject->stack[gCurrentObject->stackIndex];
|
||||
return value;
|
||||
@@ -117,7 +117,7 @@ static s32 beh_cmd_graph_node(void) {
|
||||
}
|
||||
|
||||
static s32 beh_cmd_obj_load_chill(void) {
|
||||
u32 model = gBehCommand[1];
|
||||
u32 model = (u32) gBehCommand[1];
|
||||
void *arg1 = (void *) gBehCommand[2];
|
||||
|
||||
struct Object *object = spawn_object_at_origin(gCurrentObject, 0, model, arg1);
|
||||
@@ -129,7 +129,7 @@ static s32 beh_cmd_obj_load_chill(void) {
|
||||
}
|
||||
|
||||
static s32 beh_cmd_obj_spawn(void) {
|
||||
u32 model = gBehCommand[1];
|
||||
u32 model = (u32) gBehCommand[1];
|
||||
void *arg1 = (void *) gBehCommand[2];
|
||||
|
||||
struct Object *object = spawn_object_at_origin(gCurrentObject, 0, model, arg1);
|
||||
@@ -144,7 +144,7 @@ static s32 beh_cmd_obj_spawn(void) {
|
||||
|
||||
static s32 beh_cmd_obj_load_chill_param(void) {
|
||||
u32 behParam = (s16)(gBehCommand[0] & 0xFFFF);
|
||||
u32 model = gBehCommand[1];
|
||||
u32 model = (u32) gBehCommand[1];
|
||||
void *arg2 = (void *) gBehCommand[2];
|
||||
|
||||
struct Object *object = spawn_object_at_origin(gCurrentObject, 0, model, arg2);
|
||||
@@ -172,23 +172,23 @@ static s32 beh_cmd_break2(void) {
|
||||
}
|
||||
|
||||
static s32 beh_cmd_call(void) {
|
||||
u32 *jumpAddress;
|
||||
uintptr_t *jumpAddress;
|
||||
|
||||
gBehCommand++;
|
||||
cur_object_stack_push((u32)(gBehCommand + 1));
|
||||
jumpAddress = (u32 *) segmented_to_virtual((void *) gBehCommand[0]);
|
||||
cur_object_stack_push((uintptr_t)(gBehCommand + 1));
|
||||
jumpAddress = segmented_to_virtual((void *) gBehCommand[0]);
|
||||
gBehCommand = jumpAddress;
|
||||
|
||||
return BEH_CONTINUE;
|
||||
}
|
||||
|
||||
static s32 beh_cmd_return(void) {
|
||||
gBehCommand = (u32 *) cur_object_stack_pop();
|
||||
gBehCommand = (uintptr_t *) cur_object_stack_pop();
|
||||
return BEH_CONTINUE;
|
||||
}
|
||||
|
||||
static s32 beh_cmd_delay(void) {
|
||||
s16 arg0 = gBehCommand[0] & 0xFFFF;
|
||||
s16 arg0 = (s16)(gBehCommand[0] & 0xFFFF);
|
||||
|
||||
if (gCurrentObject->unk1F4 < arg0 - 1) {
|
||||
gCurrentObject->unk1F4++;
|
||||
@@ -201,7 +201,7 @@ static s32 beh_cmd_delay(void) {
|
||||
}
|
||||
|
||||
static s32 beh_cmd_delay_var(void) {
|
||||
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF;
|
||||
u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
|
||||
s32 arg0 = cur_object_get_int(objectOffset);
|
||||
|
||||
if (gCurrentObject->unk1F4 < (arg0 - 1)) {
|
||||
@@ -216,7 +216,7 @@ static s32 beh_cmd_delay_var(void) {
|
||||
|
||||
static s32 beh_cmd_goto(void) {
|
||||
gBehCommand++;
|
||||
gBehCommand = (u32 *) segmented_to_virtual((void *) gBehCommand[0]);
|
||||
gBehCommand = segmented_to_virtual((void *) gBehCommand[0]);
|
||||
return BEH_CONTINUE;
|
||||
}
|
||||
|
||||
@@ -224,7 +224,7 @@ static s32 beh_cmd_goto(void) {
|
||||
static s32 Behavior26(void) {
|
||||
s32 value = (u8)(gBehCommand[0] >> 16) & 0xFF;
|
||||
|
||||
cur_object_stack_push((u32)(gBehCommand + 1));
|
||||
cur_object_stack_push((uintptr_t)(gBehCommand + 1));
|
||||
cur_object_stack_push(value);
|
||||
|
||||
gBehCommand++;
|
||||
@@ -235,7 +235,7 @@ static s32 Behavior26(void) {
|
||||
static s32 beh_cmd_begin_repeat(void) {
|
||||
s32 count = (s16)(gBehCommand[0] & 0xFFFF);
|
||||
|
||||
cur_object_stack_push((u32)(gBehCommand + 1));
|
||||
cur_object_stack_push((uintptr_t)(gBehCommand + 1));
|
||||
cur_object_stack_push(count);
|
||||
|
||||
gBehCommand++;
|
||||
@@ -244,12 +244,12 @@ static s32 beh_cmd_begin_repeat(void) {
|
||||
}
|
||||
|
||||
static s32 beh_cmd_end_repeat(void) {
|
||||
u32 count = cur_object_stack_pop();
|
||||
u32 count = (u32) cur_object_stack_pop();
|
||||
|
||||
count--;
|
||||
if (count != 0) {
|
||||
gBehCommand = (u32 *) cur_object_stack_pop();
|
||||
cur_object_stack_push((u32) gBehCommand);
|
||||
gBehCommand = (uintptr_t *) cur_object_stack_pop();
|
||||
cur_object_stack_push((uintptr_t) gBehCommand);
|
||||
cur_object_stack_push(count);
|
||||
} else {
|
||||
cur_object_stack_pop();
|
||||
@@ -260,12 +260,12 @@ static s32 beh_cmd_end_repeat(void) {
|
||||
}
|
||||
|
||||
static s32 beh_cmd_end_repeat_nobreak(void) {
|
||||
u32 count = cur_object_stack_pop();
|
||||
u32 count = (u32) cur_object_stack_pop();
|
||||
|
||||
count--;
|
||||
if (count != 0) {
|
||||
gBehCommand = (u32 *) cur_object_stack_pop();
|
||||
cur_object_stack_push((u32) gBehCommand);
|
||||
gBehCommand = (uintptr_t *) cur_object_stack_pop();
|
||||
cur_object_stack_push((uintptr_t) gBehCommand);
|
||||
cur_object_stack_push(count);
|
||||
} else {
|
||||
cur_object_stack_pop();
|
||||
@@ -276,15 +276,15 @@ static s32 beh_cmd_end_repeat_nobreak(void) {
|
||||
}
|
||||
|
||||
static s32 beh_cmd_begin_loop(void) {
|
||||
cur_object_stack_push((u32)(gBehCommand + 1));
|
||||
cur_object_stack_push((uintptr_t)(gBehCommand + 1));
|
||||
|
||||
gBehCommand++;
|
||||
return BEH_CONTINUE;
|
||||
}
|
||||
|
||||
static s32 beh_cmd_end_loop(void) {
|
||||
gBehCommand = (u32 *) cur_object_stack_pop();
|
||||
cur_object_stack_push((u32) gBehCommand);
|
||||
gBehCommand = (uintptr_t *) cur_object_stack_pop();
|
||||
cur_object_stack_push((uintptr_t) gBehCommand);
|
||||
|
||||
return BEH_BREAK;
|
||||
}
|
||||
@@ -301,7 +301,7 @@ static s32 beh_cmd_callnative(void) {
|
||||
}
|
||||
|
||||
static s32 beh_cmd_obj_set_float(void) {
|
||||
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF;
|
||||
u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
|
||||
f32 value = (s16)(gBehCommand[0] & 0xFFFF);
|
||||
|
||||
cur_object_set_float(objectOffset, value);
|
||||
@@ -311,8 +311,8 @@ static s32 beh_cmd_obj_set_float(void) {
|
||||
}
|
||||
|
||||
static s32 beh_cmd_obj_set_int(void) {
|
||||
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF;
|
||||
s16 value = gBehCommand[0] & 0xFFFF;
|
||||
u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
|
||||
s16 value = (s16)(gBehCommand[0] & 0xFFFF);
|
||||
|
||||
cur_object_set_int(objectOffset, value);
|
||||
|
||||
@@ -322,7 +322,7 @@ static s32 beh_cmd_obj_set_int(void) {
|
||||
|
||||
// unused
|
||||
static s32 Behavior36(void) {
|
||||
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF;
|
||||
u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
|
||||
u32 value = (s16)(gBehCommand[1] & 0xFFFF);
|
||||
|
||||
cur_object_set_int(objectOffset, value);
|
||||
@@ -332,7 +332,7 @@ static s32 Behavior36(void) {
|
||||
}
|
||||
|
||||
static s32 beh_cmd_obj_set_float_rand(void) {
|
||||
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF;
|
||||
u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
|
||||
f32 min = (s16)(gBehCommand[0] & 0xFFFF);
|
||||
f32 max = (s16)(gBehCommand[1] >> 16);
|
||||
|
||||
@@ -343,7 +343,7 @@ static s32 beh_cmd_obj_set_float_rand(void) {
|
||||
}
|
||||
|
||||
static s32 beh_cmd_obj_set_int_rand(void) {
|
||||
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF;
|
||||
u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
|
||||
s32 min = (s16)(gBehCommand[0] & 0xFFFF);
|
||||
s32 max = (s16)(gBehCommand[1] >> 16);
|
||||
|
||||
@@ -354,7 +354,7 @@ static s32 beh_cmd_obj_set_int_rand(void) {
|
||||
}
|
||||
|
||||
static s32 beh_cmd_obj_set_int_rand_rshift(void) {
|
||||
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF;
|
||||
u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
|
||||
s32 min = (s16)(gBehCommand[0] & 0xFFFF);
|
||||
s32 rshift = (s16)(gBehCommand[1] >> 16);
|
||||
|
||||
@@ -365,7 +365,7 @@ static s32 beh_cmd_obj_set_int_rand_rshift(void) {
|
||||
}
|
||||
|
||||
static s32 beh_cmd_obj_add_float_rand(void) {
|
||||
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF;
|
||||
u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
|
||||
f32 min = (s16)(gBehCommand[0] & 0xFFFF);
|
||||
f32 max = (s16)(gBehCommand[1] >> 16);
|
||||
|
||||
@@ -378,7 +378,7 @@ static s32 beh_cmd_obj_add_float_rand(void) {
|
||||
|
||||
// unused
|
||||
static s32 beh_cmd_obj_add_int_rand_rshift(void) {
|
||||
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF;
|
||||
u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
|
||||
s32 min = (s16)(gBehCommand[0] & 0xFFFF);
|
||||
s32 rshift = (s16)(gBehCommand[1] >> 16);
|
||||
s32 rnd = RandomU16();
|
||||
@@ -390,7 +390,7 @@ static s32 beh_cmd_obj_add_int_rand_rshift(void) {
|
||||
}
|
||||
|
||||
static s32 beh_cmd_obj_add_float(void) {
|
||||
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF;
|
||||
u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
|
||||
f32 value = (s16)(gBehCommand[0] & 0xFFFF);
|
||||
|
||||
cur_object_add_float(objectOffset, value);
|
||||
@@ -400,7 +400,7 @@ static s32 beh_cmd_obj_add_float(void) {
|
||||
}
|
||||
|
||||
static s32 beh_cmd_obj_add_int(void) {
|
||||
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF;
|
||||
u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
|
||||
s16 value = gBehCommand[0] & 0xFFFF;
|
||||
|
||||
cur_object_add_int(objectOffset, value);
|
||||
@@ -410,7 +410,7 @@ static s32 beh_cmd_obj_add_int(void) {
|
||||
}
|
||||
|
||||
static s32 beh_cmd_obj_or_int(void) {
|
||||
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF;
|
||||
u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
|
||||
s32 value = (s16)(gBehCommand[0] & 0xFFFF);
|
||||
|
||||
value &= 0xFFFF;
|
||||
@@ -422,7 +422,7 @@ static s32 beh_cmd_obj_or_int(void) {
|
||||
|
||||
// unused
|
||||
static s32 beh_cmd_obj_bit_clear_int(void) {
|
||||
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF;
|
||||
u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
|
||||
s32 value = (s16)(gBehCommand[0] & 0xFFFF);
|
||||
|
||||
value = (value & 0xFFFF) ^ 0xFFFF;
|
||||
@@ -433,7 +433,7 @@ static s32 beh_cmd_obj_bit_clear_int(void) {
|
||||
}
|
||||
|
||||
static s32 beh_cmd_obj_set_int32(void) {
|
||||
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF;
|
||||
u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
|
||||
|
||||
cur_object_set_int(objectOffset, gBehCommand[1]);
|
||||
|
||||
@@ -443,7 +443,7 @@ static s32 beh_cmd_obj_set_int32(void) {
|
||||
|
||||
static s32 beh_cmd_obj_animate(void) {
|
||||
s32 animIndex = (u8)((gBehCommand[0] >> 16) & 0xFF);
|
||||
u32 *animations = gCurrentObject->oAnimations;
|
||||
struct Animation **animations = gCurrentObject->oAnimations;
|
||||
|
||||
geo_obj_init_animation((struct GraphNodeObject *) gCurrentObject, &animations[animIndex]);
|
||||
|
||||
@@ -517,8 +517,8 @@ static s32 beh_cmd_obj_sum_int(void) {
|
||||
}
|
||||
|
||||
static s32 beh_cmd_set_hitbox(void) {
|
||||
s16 colSphereX = gBehCommand[1] >> 16;
|
||||
s16 colSphereY = gBehCommand[1] & 0xFFFF;
|
||||
s16 colSphereX = (s16)(gBehCommand[1] >> 16);
|
||||
s16 colSphereY = (s16)(gBehCommand[1] & 0xFFFF);
|
||||
|
||||
gCurrentObject->hitboxRadius = colSphereX;
|
||||
gCurrentObject->hitboxHeight = colSphereY;
|
||||
@@ -528,8 +528,8 @@ static s32 beh_cmd_set_hitbox(void) {
|
||||
}
|
||||
|
||||
static s32 beh_cmd_obj_set_float2(void) {
|
||||
s16 arg0 = gBehCommand[1] >> 16;
|
||||
s16 arg1 = gBehCommand[1] & 0xFFFF;
|
||||
s16 arg0 = (s16)(gBehCommand[1] >> 16);
|
||||
s16 arg1 = (s16)(gBehCommand[1] & 0xFFFF);
|
||||
|
||||
gCurrentObject->hurtboxRadius = arg0;
|
||||
gCurrentObject->hurtboxHeight = arg1;
|
||||
@@ -539,9 +539,9 @@ static s32 beh_cmd_obj_set_float2(void) {
|
||||
}
|
||||
|
||||
static s32 beh_cmd_collision_sphere(void) {
|
||||
s16 colSphereX = gBehCommand[1] >> 16;
|
||||
s16 colSphereY = gBehCommand[1] & 0xFFFF;
|
||||
s16 unknown = gBehCommand[2] >> 16;
|
||||
s16 colSphereX = (s16)(gBehCommand[1] >> 16);
|
||||
s16 colSphereY = (s16)(gBehCommand[1] & 0xFFFF);
|
||||
s16 unknown = (s16)(gBehCommand[2] >> 16);
|
||||
|
||||
gCurrentObject->hitboxRadius = colSphereX;
|
||||
gCurrentObject->hitboxHeight = colSphereY;
|
||||
@@ -576,7 +576,7 @@ static s32 beh_cmd_begin(void) {
|
||||
}
|
||||
|
||||
static void Unknown8038556C(s32 lastIndex) {
|
||||
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF;
|
||||
u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
|
||||
u32 table[16];
|
||||
s32 i;
|
||||
|
||||
@@ -604,7 +604,7 @@ static s32 beh_cmd_obj_set_pos(void) {
|
||||
}
|
||||
|
||||
static s32 beh_cmd_interact_type(void) {
|
||||
gCurrentObject->oInteractType = gBehCommand[1];
|
||||
gCurrentObject->oInteractType = (u32) gBehCommand[1];
|
||||
|
||||
gBehCommand += 2;
|
||||
return BEH_CONTINUE;
|
||||
@@ -612,14 +612,14 @@ static s32 beh_cmd_interact_type(void) {
|
||||
|
||||
// unused
|
||||
static s32 Behavior31(void) {
|
||||
gCurrentObject->oInteractionSubtype = gBehCommand[1];
|
||||
gCurrentObject->oInteractionSubtype = (u32) gBehCommand[1];
|
||||
|
||||
gBehCommand += 2;
|
||||
return BEH_CONTINUE;
|
||||
}
|
||||
|
||||
static s32 beh_cmd_scale(void) {
|
||||
UNUSED u8 sp1f = (gBehCommand[0] >> 16) & 0xFF;
|
||||
UNUSED u8 sp1f = (u8)((gBehCommand[0] >> 16) & 0xFF);
|
||||
s16 sp1c = gBehCommand[0] & 0xFFFF;
|
||||
|
||||
obj_scale((f32) sp1c / 100.0f);
|
||||
@@ -647,7 +647,7 @@ static s32 beh_cmd_obj_set_gravity(void) {
|
||||
}
|
||||
|
||||
static s32 beh_cmd_obj_bit_clear_int32(void) {
|
||||
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF;
|
||||
u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
|
||||
s32 flags = gBehCommand[1];
|
||||
|
||||
flags = flags ^ 0xFFFFFFFF;
|
||||
@@ -666,7 +666,7 @@ static s32 beh_cmd_spawn_addr(void) {
|
||||
}
|
||||
|
||||
static s32 beh_cmd_text_anim_rate(void) {
|
||||
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF;
|
||||
u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
|
||||
s16 arg1 = (gBehCommand[0] & 0xFFFF);
|
||||
|
||||
if ((gGlobalTimer % arg1) == 0) {
|
||||
|
||||
Reference in New Issue
Block a user