mirror of
https://github.com/SAT-R/sa2.git
synced 2026-10-28 09:43:38 +00:00
Match Task_Item_Shield_Magnetic
This commit is contained in:
1 parent
97f58bba25
commit
56b65abeda
3 files changed
+22
-312
No files matched your search
@@ -1,149 +0,0 @@
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
.text
|
||||
push {r4, r5, r6, r7, lr}
|
||||
ldr r0, _0804B9FC @ =gCurTask
|
||||
ldr r5, [r0]
|
||||
ldrh r1, [r5, #6]
|
||||
movs r4, #0xc0
|
||||
lsls r4, r4, #0x12
|
||||
ldr r2, _0804BA00 @ =0x03000030
|
||||
adds r0, r1, r2
|
||||
ldrb r2, [r0]
|
||||
orrs r4, r1
|
||||
ldr r0, _0804BA04 @ =gCamera
|
||||
mov ip, r0
|
||||
ldr r0, _0804BA08 @ =gGameMode
|
||||
ldrb r0, [r0]
|
||||
cmp r0, #1
|
||||
bls _0804BA1C
|
||||
ldr r1, _0804BA0C @ =gMultiplayerPlayerTasks
|
||||
lsls r2, r2, #0x18
|
||||
asrs r0, r2, #0x16
|
||||
adds r0, r0, r1
|
||||
ldr r0, [r0]
|
||||
ldrh r3, [r0, #6]
|
||||
movs r1, #0xc0
|
||||
lsls r1, r1, #0x12
|
||||
adds r7, r3, r1
|
||||
adds r1, #0x57
|
||||
adds r0, r3, r1
|
||||
ldrb r1, [r0]
|
||||
movs r0, #8
|
||||
ands r0, r1
|
||||
adds r6, r2, #0
|
||||
cmp r0, #0
|
||||
beq _0804BA36
|
||||
ldr r2, _0804BA10 @ =0x03000050
|
||||
adds r0, r3, r2
|
||||
ldrh r0, [r0]
|
||||
mov r2, ip
|
||||
ldrh r1, [r2]
|
||||
subs r0, r0, r1
|
||||
strh r0, [r4, #0x16]
|
||||
ldr r1, _0804BA14 @ =0x03000052
|
||||
adds r0, r3, r1
|
||||
ldrh r0, [r0]
|
||||
ldrh r1, [r2, #2]
|
||||
subs r0, r0, r1
|
||||
strh r0, [r4, #0x18]
|
||||
ldr r2, [r4, #0x10]
|
||||
ldr r0, _0804BA18 @ =0xFFFFCFFF
|
||||
ands r2, r0
|
||||
str r2, [r4, #0x10]
|
||||
ldr r0, [r7, #0x10]
|
||||
b _0804BA7C
|
||||
.align 2, 0
|
||||
_0804B9FC: .4byte gCurTask
|
||||
_0804BA00: .4byte 0x03000030
|
||||
_0804BA04: .4byte gCamera
|
||||
_0804BA08: .4byte gGameMode
|
||||
_0804BA0C: .4byte gMultiplayerPlayerTasks
|
||||
_0804BA10: .4byte 0x03000050
|
||||
_0804BA14: .4byte 0x03000052
|
||||
_0804BA18: .4byte 0xFFFFCFFF
|
||||
_0804BA1C:
|
||||
lsls r0, r2, #0x18
|
||||
ldr r3, _0804BA40 @ =gPlayer
|
||||
adds r6, r0, #0
|
||||
cmp r6, #0
|
||||
beq _0804BA28
|
||||
ldr r3, _0804BA44 @ =gPartner
|
||||
_0804BA28:
|
||||
adds r0, r3, #0
|
||||
adds r0, #0x26
|
||||
ldrb r1, [r0]
|
||||
movs r0, #8
|
||||
ands r0, r1
|
||||
cmp r0, #0
|
||||
bne _0804BA48
|
||||
_0804BA36:
|
||||
adds r0, r5, #0
|
||||
bl TaskDestroy
|
||||
b _0804BAB6
|
||||
.align 2, 0
|
||||
_0804BA40: .4byte gPlayer
|
||||
_0804BA44: .4byte gPartner
|
||||
_0804BA48:
|
||||
movs r0, #2
|
||||
ands r0, r1
|
||||
cmp r0, #0
|
||||
bne _0804BAB6
|
||||
ldr r0, [r3]
|
||||
asrs r0, r0, #8
|
||||
mov r2, ip
|
||||
ldrh r1, [r2]
|
||||
adds r2, r3, #0
|
||||
adds r2, #0x50
|
||||
subs r0, r0, r1
|
||||
ldrh r2, [r2]
|
||||
adds r0, r0, r2
|
||||
strh r0, [r4, #0x16]
|
||||
ldr r0, [r3, #4]
|
||||
asrs r0, r0, #8
|
||||
mov r2, ip
|
||||
ldrh r1, [r2, #2]
|
||||
subs r0, r0, r1
|
||||
strh r0, [r4, #0x18]
|
||||
ldr r2, [r4, #0x10]
|
||||
ldr r0, _0804BAA4 @ =0xFFFFCFFF
|
||||
ands r2, r0
|
||||
str r2, [r4, #0x10]
|
||||
ldr r0, [r3, #0x64]
|
||||
ldr r0, [r0, #0x1c]
|
||||
_0804BA7C:
|
||||
movs r1, #0xc0
|
||||
lsls r1, r1, #6
|
||||
ands r0, r1
|
||||
orrs r2, r0
|
||||
str r2, [r4, #0x10]
|
||||
adds r0, r4, #0
|
||||
bl UpdateSpriteAnimation
|
||||
asrs r2, r6, #0x18
|
||||
movs r3, #1
|
||||
ands r2, r3
|
||||
ldr r0, _0804BAA8 @ =gStageTime
|
||||
ldr r0, [r0]
|
||||
movs r1, #2
|
||||
ands r0, r1
|
||||
cmp r0, #0
|
||||
beq _0804BAAC
|
||||
cmp r2, r3
|
||||
bne _0804BAB0
|
||||
b _0804BAB6
|
||||
.align 2, 0
|
||||
_0804BAA4: .4byte 0xFFFFCFFF
|
||||
_0804BAA8: .4byte gStageTime
|
||||
_0804BAAC:
|
||||
cmp r2, #0
|
||||
beq _0804BAB6
|
||||
_0804BAB0:
|
||||
adds r0, r4, #0
|
||||
bl DisplaySprite
|
||||
_0804BAB6:
|
||||
pop {r4, r5, r6, r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
|
||||
.syntax divided
|
||||
@@ -1,149 +0,0 @@
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
.text
|
||||
push {r4, r5, r6, r7, lr}
|
||||
ldr r0, _0804B8D4 @ =gCurTask
|
||||
ldr r5, [r0]
|
||||
ldrh r1, [r5, #6]
|
||||
movs r4, #0xc0
|
||||
lsls r4, r4, #0x12
|
||||
ldr r2, _0804B8D8 @ =0x03000030
|
||||
adds r0, r1, r2
|
||||
ldrb r2, [r0]
|
||||
orrs r4, r1
|
||||
ldr r0, _0804B8DC @ =gCamera
|
||||
mov ip, r0
|
||||
ldr r0, _0804B8E0 @ =gGameMode
|
||||
ldrb r0, [r0]
|
||||
cmp r0, #1
|
||||
bls _0804B8F4
|
||||
ldr r1, _0804B8E4 @ =gMultiplayerPlayerTasks
|
||||
lsls r2, r2, #0x18
|
||||
asrs r0, r2, #0x16
|
||||
adds r0, r0, r1
|
||||
ldr r0, [r0]
|
||||
ldrh r3, [r0, #6]
|
||||
movs r1, #0xc0
|
||||
lsls r1, r1, #0x12
|
||||
adds r7, r3, r1
|
||||
adds r1, #0x57
|
||||
adds r0, r3, r1
|
||||
ldrb r1, [r0]
|
||||
movs r0, #1
|
||||
ands r0, r1
|
||||
adds r6, r2, #0
|
||||
cmp r0, #0
|
||||
beq _0804B90E
|
||||
ldr r2, _0804B8E8 @ =0x03000050
|
||||
adds r0, r3, r2
|
||||
ldrh r0, [r0]
|
||||
mov r2, ip
|
||||
ldrh r1, [r2]
|
||||
subs r0, r0, r1
|
||||
strh r0, [r4, #0x16]
|
||||
ldr r1, _0804B8EC @ =0x03000052
|
||||
adds r0, r3, r1
|
||||
ldrh r0, [r0]
|
||||
ldrh r1, [r2, #2]
|
||||
subs r0, r0, r1
|
||||
strh r0, [r4, #0x18]
|
||||
ldr r2, [r4, #0x10]
|
||||
ldr r0, _0804B8F0 @ =0xFFFFCFFF
|
||||
ands r2, r0
|
||||
str r2, [r4, #0x10]
|
||||
ldr r0, [r7, #0x10]
|
||||
b _0804B954
|
||||
.align 2, 0
|
||||
_0804B8D4: .4byte gCurTask
|
||||
_0804B8D8: .4byte 0x03000030
|
||||
_0804B8DC: .4byte gCamera
|
||||
_0804B8E0: .4byte gGameMode
|
||||
_0804B8E4: .4byte gMultiplayerPlayerTasks
|
||||
_0804B8E8: .4byte 0x03000050
|
||||
_0804B8EC: .4byte 0x03000052
|
||||
_0804B8F0: .4byte 0xFFFFCFFF
|
||||
_0804B8F4:
|
||||
lsls r0, r2, #0x18
|
||||
ldr r3, _0804B918 @ =gPlayer
|
||||
adds r6, r0, #0
|
||||
cmp r6, #0
|
||||
beq _0804B900
|
||||
ldr r3, _0804B91C @ =gPartner
|
||||
_0804B900:
|
||||
adds r0, r3, #0
|
||||
adds r0, #0x26
|
||||
ldrb r1, [r0]
|
||||
movs r0, #1
|
||||
ands r0, r1
|
||||
cmp r0, #0
|
||||
bne _0804B920
|
||||
_0804B90E:
|
||||
adds r0, r5, #0
|
||||
bl TaskDestroy
|
||||
b _0804B98E
|
||||
.align 2, 0
|
||||
_0804B918: .4byte gPlayer
|
||||
_0804B91C: .4byte gPartner
|
||||
_0804B920:
|
||||
movs r0, #2
|
||||
ands r0, r1
|
||||
cmp r0, #0
|
||||
bne _0804B98E
|
||||
ldr r0, [r3]
|
||||
asrs r0, r0, #8
|
||||
mov r2, ip
|
||||
ldrh r1, [r2]
|
||||
adds r2, r3, #0
|
||||
adds r2, #0x50
|
||||
subs r0, r0, r1
|
||||
ldrh r2, [r2]
|
||||
adds r0, r0, r2
|
||||
strh r0, [r4, #0x16]
|
||||
ldr r0, [r3, #4]
|
||||
asrs r0, r0, #8
|
||||
mov r2, ip
|
||||
ldrh r1, [r2, #2]
|
||||
subs r0, r0, r1
|
||||
strh r0, [r4, #0x18]
|
||||
ldr r2, [r4, #0x10]
|
||||
ldr r0, _0804B97C @ =0xFFFFCFFF
|
||||
ands r2, r0
|
||||
str r2, [r4, #0x10]
|
||||
ldr r0, [r3, #0x64]
|
||||
ldr r0, [r0, #0x1c]
|
||||
_0804B954:
|
||||
movs r1, #0xc0
|
||||
lsls r1, r1, #6
|
||||
ands r0, r1
|
||||
orrs r2, r0
|
||||
str r2, [r4, #0x10]
|
||||
adds r0, r4, #0
|
||||
bl UpdateSpriteAnimation
|
||||
asrs r2, r6, #0x18
|
||||
movs r3, #1
|
||||
ands r2, r3
|
||||
ldr r0, _0804B980 @ =gStageTime
|
||||
ldr r0, [r0]
|
||||
movs r1, #2
|
||||
ands r0, r1
|
||||
cmp r0, #0
|
||||
beq _0804B984
|
||||
cmp r2, r3
|
||||
bne _0804B988
|
||||
b _0804B98E
|
||||
.align 2, 0
|
||||
_0804B97C: .4byte 0xFFFFCFFF
|
||||
_0804B980: .4byte gStageTime
|
||||
_0804B984:
|
||||
cmp r2, #0
|
||||
beq _0804B98E
|
||||
_0804B988:
|
||||
adds r0, r4, #0
|
||||
bl DisplaySprite
|
||||
_0804B98E:
|
||||
pop {r4, r5, r6, r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
|
||||
.syntax divided
|
||||
+22
-14
@@ -200,20 +200,27 @@ void Task_Item_Shield_Normal(void)
|
||||
}
|
||||
}
|
||||
|
||||
// (99.85%) https://decomp.me/scratch/Ozaza
|
||||
NONMATCH("asm/non_matching/game/stage/Item_Tasks__Task_Item_Shield_Magnetic.inc", void Task_Item_Shield_Magnetic(void))
|
||||
// TODO: Fake-match
|
||||
// (100.00%) https://decomp.me/scratch/zjlaf
|
||||
void Task_Item_Shield_Magnetic(void)
|
||||
{
|
||||
struct Task *t = gCurTask;
|
||||
s8 pid = ITEMTASK_GET_PLAYER_NUM(t);
|
||||
s32 pid2;
|
||||
|
||||
ItemTask *item = TASK_DATA(t);
|
||||
struct Camera *cam = &gCamera;
|
||||
Player *p;
|
||||
#ifndef NON_MATCHING
|
||||
register bool32 b asm("r3");
|
||||
#else
|
||||
bool32 b;
|
||||
#endif
|
||||
|
||||
if (IS_MULTI_PLAYER) {
|
||||
if(IS_MULTI_PLAYER) {
|
||||
MultiplayerPlayer *mpp = TASK_DATA(gMultiplayerPlayerTasks[pid]);
|
||||
|
||||
|
||||
if (!(mpp->unk57 & PLAYER_ITEM_EFFECT__SHIELD_MAGNETIC)) {
|
||||
TaskDestroy(t);
|
||||
return;
|
||||
@@ -221,43 +228,44 @@ NONMATCH("asm/non_matching/game/stage/Item_Tasks__Task_Item_Shield_Magnetic.inc"
|
||||
|
||||
item->s.x = mpp->pos.x - cam->x;
|
||||
item->s.y = mpp->pos.y - cam->y;
|
||||
|
||||
|
||||
item->s.frameFlags &= ~SPRITE_FLAG_MASK_PRIORITY;
|
||||
item->s.frameFlags |= mpp->s.frameFlags & SPRITE_FLAG_MASK_PRIORITY;
|
||||
} else {
|
||||
p = &PLAYER(pid);
|
||||
|
||||
if ((p->itemEffect & (PLAYER_ITEM_EFFECT__SHIELD_NORMAL)) == 0) {
|
||||
if ((p->itemEffect & (PLAYER_ITEM_EFFECT__SHIELD_MAGNETIC)) == 0) {
|
||||
TaskDestroy(t);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(p->itemEffect & PLAYER_ITEM_EFFECT__INVINCIBILITY)) {
|
||||
s32 screenX, screenY;
|
||||
|
||||
|
||||
screenX = I(p->qWorldX) - (u16)cam->x;
|
||||
item->s.x = screenX + p->SA2_LABEL(unk7C);
|
||||
|
||||
|
||||
screenY = I(p->qWorldY) - (u16)cam->y;
|
||||
item->s.y = screenY;
|
||||
|
||||
|
||||
item->s.frameFlags &= ~SPRITE_FLAG_MASK_PRIORITY;
|
||||
|
||||
|
||||
item->s.frameFlags |= p->spriteInfoBody->s.frameFlags & SPRITE_FLAG_MASK_PRIORITY;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
UpdateSpriteAnimation(&item->s);
|
||||
|
||||
b = (pid & 1);
|
||||
|
||||
if (((gStageTime & 0x2) && (pid != b)) || (!(gStageTime & 0x2) && (b != 0))) {
|
||||
pid2 = pid;
|
||||
b = 1;
|
||||
pid2 &= b;
|
||||
|
||||
if (((gStageTime & 0x2) && (pid2 != b)) || (!(gStageTime & 0x2) && (pid2 != 0))) {
|
||||
DisplaySprite(&item->s);
|
||||
}
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
void sub_804BABC(void)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user