DenSinH's PR (#269)

This commit is contained in:
Maide 2021-04-18 18:30:54 +01:00 committed by GitHub
parent 8e4df57de7
commit 52ca40f632
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 58 additions and 96 deletions

View File

@ -893,7 +893,15 @@ typedef struct ItemEntity {
/* 0x2E */ u8 unkCounter;
/* 0x2F */ s8 unk_2F;
/* 0x30 */ f32 scale;
/* 0x34 */ char unk_34[40];
/* 0x34 */ char unk_34[8];
/* 0x3C */ s32 framesLeft;
/* 0x40 */ s32* currentState;
/* 0x44 */ s32 unk_44;
/* 0x48 */ s32* sequenceStart;
/* 0x4C */ s32* unk_4C;
/* 0x50 */ s32* unk_50;
/* 0x54 */ s32 unk_54;
/* 0x58 */ s32 unk_58;
} ItemEntity; // size = 0x5C
typedef struct ModelNode {

View File

@ -17,9 +17,53 @@ INCLUDE_ASM(s32, "C50A0", func_8012FE78);
INCLUDE_ASM(s32, "C50A0", func_801309F0);
INCLUDE_ASM(s32, "C50A0", func_80130A04);
s32 next_sequence_step(ItemEntity *itemEntity) {
s32* currentState = itemEntity->currentState;
INCLUDE_ASM(s32, "C50A0", func_80130ACC);
switch (*currentState++) {
case 1:
itemEntity->framesLeft = *currentState++;
itemEntity->unk_44 = *currentState++;
itemEntity->currentState = currentState;
break;
case 2:
itemEntity->currentState = itemEntity->sequenceStart;
return 1;
case 3:
itemEntity->sequenceStart = currentState;
itemEntity->currentState = currentState;
return 1;
case 7:
itemEntity->framesLeft = *currentState++;
itemEntity->unk_4C = *currentState++;
itemEntity->unk_50 = *currentState++;
itemEntity->unk_54 = *currentState++;
itemEntity->unk_58 = *currentState++;
itemEntity->currentState = currentState;
break;
case 4:
itemEntity->currentState = currentState++;
itemEntity->currentState = currentState++;
case 0:
return 1;
}
return 0;
}
void do_animation(ItemEntity* itemEntity) {
itemEntity->framesLeft--;
if (itemEntity->framesLeft <= 0) {
while (next_sequence_step(itemEntity) != 0) {
}
}
}
INCLUDE_ASM(s32, "C50A0", draw_coin_sparkles);

View File

@ -1,68 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.section .rodata
glabel jtbl_80150A60
.word L80130ABC_C71BC, L80130A30_C7130, L80130A50_C7150, L80130A60_C7160, L80130AB4_C71B4, L80130AC4_C71C4, L80130AC4_C71C4, L80130A70_C7170
.section .text
glabel func_80130A04
/* C7104 80130A04 8C830040 */ lw $v1, 0x40($a0)
/* C7108 80130A08 8C650000 */ lw $a1, ($v1)
/* C710C 80130A0C 2CA20008 */ sltiu $v0, $a1, 8
/* C7110 80130A10 1040002C */ beqz $v0, L80130AC4_C71C4
/* C7114 80130A14 24630004 */ addiu $v1, $v1, 4
/* C7118 80130A18 00051080 */ sll $v0, $a1, 2
/* C711C 80130A1C 3C018015 */ lui $at, %hi(jtbl_80150A60)
/* C7120 80130A20 00220821 */ addu $at, $at, $v0
/* C7124 80130A24 8C220A60 */ lw $v0, %lo(jtbl_80150A60)($at)
/* C7128 80130A28 00400008 */ jr $v0
/* C712C 80130A2C 00000000 */ nop
glabel L80130A30_C7130
/* C7130 80130A30 8C620000 */ lw $v0, ($v1)
/* C7134 80130A34 24630004 */ addiu $v1, $v1, 4
/* C7138 80130A38 AC82003C */ sw $v0, 0x3c($a0)
/* C713C 80130A3C 8C620000 */ lw $v0, ($v1)
/* C7140 80130A40 24630004 */ addiu $v1, $v1, 4
/* C7144 80130A44 AC830040 */ sw $v1, 0x40($a0)
/* C7148 80130A48 0804C2B1 */ j L80130AC4_C71C4
/* C714C 80130A4C AC820044 */ sw $v0, 0x44($a0)
glabel L80130A50_C7150
/* C7150 80130A50 8C830048 */ lw $v1, 0x48($a0)
/* C7154 80130A54 24020001 */ addiu $v0, $zero, 1
/* C7158 80130A58 03E00008 */ jr $ra
/* C715C 80130A5C AC830040 */ sw $v1, 0x40($a0)
glabel L80130A60_C7160
/* C7160 80130A60 24020001 */ addiu $v0, $zero, 1
/* C7164 80130A64 AC830048 */ sw $v1, 0x48($a0)
/* C7168 80130A68 03E00008 */ jr $ra
/* C716C 80130A6C AC830040 */ sw $v1, 0x40($a0)
glabel L80130A70_C7170
/* C7170 80130A70 8C620000 */ lw $v0, ($v1)
/* C7174 80130A74 24630004 */ addiu $v1, $v1, 4
/* C7178 80130A78 AC82003C */ sw $v0, 0x3c($a0)
/* C717C 80130A7C 8C620000 */ lw $v0, ($v1)
/* C7180 80130A80 24630004 */ addiu $v1, $v1, 4
/* C7184 80130A84 AC82004C */ sw $v0, 0x4c($a0)
/* C7188 80130A88 8C620000 */ lw $v0, ($v1)
/* C718C 80130A8C 24630004 */ addiu $v1, $v1, 4
/* C7190 80130A90 AC820050 */ sw $v0, 0x50($a0)
/* C7194 80130A94 8C620000 */ lw $v0, ($v1)
/* C7198 80130A98 24630004 */ addiu $v1, $v1, 4
/* C719C 80130A9C AC820054 */ sw $v0, 0x54($a0)
/* C71A0 80130AA0 8C620000 */ lw $v0, ($v1)
/* C71A4 80130AA4 24630004 */ addiu $v1, $v1, 4
/* C71A8 80130AA8 AC830040 */ sw $v1, 0x40($a0)
/* C71AC 80130AAC 0804C2B1 */ j L80130AC4_C71C4
/* C71B0 80130AB0 AC820058 */ sw $v0, 0x58($a0)
glabel L80130AB4_C71B4
/* C71B4 80130AB4 24630004 */ addiu $v1, $v1, 4
/* C71B8 80130AB8 AC830040 */ sw $v1, 0x40($a0)
glabel L80130ABC_C71BC
/* C71BC 80130ABC 03E00008 */ jr $ra
/* C71C0 80130AC0 24020001 */ addiu $v0, $zero, 1
glabel L80130AC4_C71C4
/* C71C4 80130AC4 03E00008 */ jr $ra
/* C71C8 80130AC8 0000102D */ daddu $v0, $zero, $zero

View File

@ -1,22 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_80130ACC
/* C71CC 80130ACC 27BDFFE8 */ addiu $sp, $sp, -0x18
/* C71D0 80130AD0 AFB00010 */ sw $s0, 0x10($sp)
/* C71D4 80130AD4 0080802D */ daddu $s0, $a0, $zero
/* C71D8 80130AD8 AFBF0014 */ sw $ra, 0x14($sp)
/* C71DC 80130ADC 8E02003C */ lw $v0, 0x3c($s0)
/* C71E0 80130AE0 2442FFFF */ addiu $v0, $v0, -1
/* C71E4 80130AE4 1C400005 */ bgtz $v0, .L80130AFC
/* C71E8 80130AE8 AE02003C */ sw $v0, 0x3c($s0)
.L80130AEC:
/* C71EC 80130AEC 0C04C281 */ jal func_80130A04
/* C71F0 80130AF0 0200202D */ daddu $a0, $s0, $zero
/* C71F4 80130AF4 1440FFFD */ bnez $v0, .L80130AEC
/* C71F8 80130AF8 00000000 */ nop
.L80130AFC:
/* C71FC 80130AFC 8FBF0014 */ lw $ra, 0x14($sp)
/* C7200 80130B00 8FB00010 */ lw $s0, 0x10($sp)
/* C7204 80130B04 03E00008 */ jr $ra
/* C7208 80130B08 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -180,7 +180,7 @@ glabel init_got_item
/* C8498 80131D98 24A54AC0 */ addiu $a1, $a1, %lo(D_80104AC0)
/* C849C 80131D9C 0C04C27C */ jal func_801309F0
/* C84A0 80131DA0 0220202D */ daddu $a0, $s1, $zero
/* C84A4 80131DA4 0C04C2B3 */ jal func_80130ACC
/* C84A4 80131DA4 0C04C2B3 */ jal do_animation
/* C84A8 80131DA8 0220202D */ daddu $a0, $s1, $zero
/* C84AC 80131DAC 02A0102D */ daddu $v0, $s5, $zero
.L80131DB0:

View File

@ -471,7 +471,7 @@ glabel L80131A0C_C810C
/* C813C 80131A3C 24A54AC0 */ addiu $a1, $a1, %lo(D_80104AC0)
/* C8140 80131A40 0C04C27C */ jal func_801309F0
/* C8144 80131A44 0200202D */ daddu $a0, $s0, $zero
/* C8148 80131A48 0C04C2B3 */ jal func_80130ACC
/* C8148 80131A48 0C04C2B3 */ jal do_animation
/* C814C 80131A4C 0200202D */ daddu $a0, $s0, $zero
/* C8150 80131A50 86030018 */ lh $v1, 0x18($s0)
/* C8154 80131A54 2402015C */ addiu $v0, $zero, 0x15c

View File

@ -60,7 +60,7 @@ glabel update_item_entities
/* C869C 80131F9C 3C018015 */ lui $at, %hi(D_80155D90)
/* C86A0 80131FA0 A4225D90 */ sh $v0, %lo(D_80155D90)($at)
.L80131FA4:
/* C86A4 80131FA4 0C04C2B3 */ jal func_80130ACC
/* C86A4 80131FA4 0C04C2B3 */ jal do_animation
/* C86A8 80131FA8 0220202D */ daddu $a0, $s1, $zero
.L80131FAC:
/* C86AC 80131FAC 0C04C775 */ jal func_80131DD4