mirror of
https://github.com/pmret/papermario.git
synced 2024-11-08 12:02:30 +01:00
SetEntityPosition + co
This commit is contained in:
parent
c4acc92579
commit
c2d7449287
@ -1,53 +0,0 @@
|
||||
.set noat # allow manual use of $at
|
||||
.set noreorder # don't insert nops after branches
|
||||
|
||||
glabel func_80240000_BC4280
|
||||
/* BC4280 80240000 27BDFFD8 */ addiu $sp, $sp, -0x28
|
||||
/* BC4284 80240004 AFB10014 */ sw $s1, 0x14($sp)
|
||||
/* BC4288 80240008 0080882D */ daddu $s1, $a0, $zero
|
||||
/* BC428C 8024000C AFBF0020 */ sw $ra, 0x20($sp)
|
||||
/* BC4290 80240010 AFB3001C */ sw $s3, 0x1c($sp)
|
||||
/* BC4294 80240014 AFB20018 */ sw $s2, 0x18($sp)
|
||||
/* BC4298 80240018 AFB00010 */ sw $s0, 0x10($sp)
|
||||
/* BC429C 8024001C 8E30000C */ lw $s0, 0xc($s1)
|
||||
/* BC42A0 80240020 8E050000 */ lw $a1, ($s0)
|
||||
/* BC42A4 80240024 0C0B1EAF */ jal get_variable
|
||||
/* BC42A8 80240028 26100004 */ addiu $s0, $s0, 4
|
||||
/* BC42AC 8024002C 8E050000 */ lw $a1, ($s0)
|
||||
/* BC42B0 80240030 26100004 */ addiu $s0, $s0, 4
|
||||
/* BC42B4 80240034 0220202D */ daddu $a0, $s1, $zero
|
||||
/* BC42B8 80240038 0C0B1EAF */ jal get_variable
|
||||
/* BC42BC 8024003C 0040982D */ daddu $s3, $v0, $zero
|
||||
/* BC42C0 80240040 8E050000 */ lw $a1, ($s0)
|
||||
/* BC42C4 80240044 26100004 */ addiu $s0, $s0, 4
|
||||
/* BC42C8 80240048 0220202D */ daddu $a0, $s1, $zero
|
||||
/* BC42CC 8024004C 0C0B1EAF */ jal get_variable
|
||||
/* BC42D0 80240050 0040902D */ daddu $s2, $v0, $zero
|
||||
/* BC42D4 80240054 0220202D */ daddu $a0, $s1, $zero
|
||||
/* BC42D8 80240058 8E050000 */ lw $a1, ($s0)
|
||||
/* BC42DC 8024005C 0C0B1EAF */ jal get_variable
|
||||
/* BC42E0 80240060 0040882D */ daddu $s1, $v0, $zero
|
||||
/* BC42E4 80240064 0260202D */ daddu $a0, $s3, $zero
|
||||
/* BC42E8 80240068 0C04417A */ jal get_entity_by_index
|
||||
/* BC42EC 8024006C 0040802D */ daddu $s0, $v0, $zero
|
||||
/* BC42F0 80240070 0040182D */ daddu $v1, $v0, $zero
|
||||
/* BC42F4 80240074 44920000 */ mtc1 $s2, $f0
|
||||
/* BC42F8 80240078 00000000 */ nop
|
||||
/* BC42FC 8024007C 46800020 */ cvt.s.w $f0, $f0
|
||||
/* BC4300 80240080 E4600048 */ swc1 $f0, 0x48($v1)
|
||||
/* BC4304 80240084 44910000 */ mtc1 $s1, $f0
|
||||
/* BC4308 80240088 00000000 */ nop
|
||||
/* BC430C 8024008C 46800020 */ cvt.s.w $f0, $f0
|
||||
/* BC4310 80240090 E460004C */ swc1 $f0, 0x4c($v1)
|
||||
/* BC4314 80240094 44900000 */ mtc1 $s0, $f0
|
||||
/* BC4318 80240098 00000000 */ nop
|
||||
/* BC431C 8024009C 46800020 */ cvt.s.w $f0, $f0
|
||||
/* BC4320 802400A0 E4600050 */ swc1 $f0, 0x50($v1)
|
||||
/* BC4324 802400A4 8FBF0020 */ lw $ra, 0x20($sp)
|
||||
/* BC4328 802400A8 8FB3001C */ lw $s3, 0x1c($sp)
|
||||
/* BC432C 802400AC 8FB20018 */ lw $s2, 0x18($sp)
|
||||
/* BC4330 802400B0 8FB10014 */ lw $s1, 0x14($sp)
|
||||
/* BC4334 802400B4 8FB00010 */ lw $s0, 0x10($sp)
|
||||
/* BC4338 802400B8 24020002 */ addiu $v0, $zero, 2
|
||||
/* BC433C 802400BC 03E00008 */ jr $ra
|
||||
/* BC4340 802400C0 27BD0028 */ addiu $sp, $sp, 0x28
|
@ -1,33 +0,0 @@
|
||||
.set noat # allow manual use of $at
|
||||
.set noreorder # don't insert nops after branches
|
||||
|
||||
glabel func_80240000_9A4650
|
||||
/* 9A4650 80240000 27BDFFE8 */ addiu $sp, $sp, -0x18
|
||||
/* 9A4654 80240004 3C038016 */ lui $v1, 0x8016
|
||||
/* 9A4658 80240008 8463A550 */ lh $v1, -0x5ab0($v1)
|
||||
/* 9A465C 8024000C 24020023 */ addiu $v0, $zero, 0x23
|
||||
/* 9A4660 80240010 AFBF0010 */ sw $ra, 0x10($sp)
|
||||
/* 9A4664 80240014 8C85000C */ lw $a1, 0xc($a0)
|
||||
/* 9A4668 80240018 14620005 */ bne $v1, $v0, .L80240030
|
||||
/* 9A466C 8024001C 0000302D */ daddu $a2, $zero, $zero
|
||||
/* 9A4670 80240020 3C028007 */ lui $v0, %hi(gGameStatusPtr)
|
||||
/* 9A4674 80240024 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
|
||||
/* 9A4678 80240028 80420040 */ lb $v0, 0x40($v0)
|
||||
/* 9A467C 8024002C 000237C2 */ srl $a2, $v0, 0x1f
|
||||
.L80240030:
|
||||
/* 9A4680 80240030 24020025 */ addiu $v0, $zero, 0x25
|
||||
/* 9A4684 80240034 14620006 */ bne $v1, $v0, .L80240050
|
||||
/* 9A4688 80240038 00000000 */ nop
|
||||
/* 9A468C 8024003C 3C028007 */ lui $v0, %hi(gGameStatusPtr)
|
||||
/* 9A4690 80240040 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
|
||||
/* 9A4694 80240044 80420040 */ lb $v0, 0x40($v0)
|
||||
/* 9A4698 80240048 5C400001 */ bgtzl $v0, .L80240050
|
||||
/* 9A469C 8024004C 24060002 */ addiu $a2, $zero, 2
|
||||
.L80240050:
|
||||
/* 9A46A0 80240050 8CA50000 */ lw $a1, ($a1)
|
||||
/* 9A46A4 80240054 0C0B2026 */ jal set_variable
|
||||
/* 9A46A8 80240058 00000000 */ nop
|
||||
/* 9A46AC 8024005C 8FBF0010 */ lw $ra, 0x10($sp)
|
||||
/* 9A46B0 80240060 24020002 */ addiu $v0, $zero, 2
|
||||
/* 9A46B4 80240064 03E00008 */ jr $ra
|
||||
/* 9A46B8 80240068 27BD0018 */ addiu $sp, $sp, 0x18
|
@ -1,17 +0,0 @@
|
||||
.set noat # allow manual use of $at
|
||||
.set noreorder # don't insert nops after branches
|
||||
|
||||
glabel func_8024006C_9A46BC
|
||||
/* 9A46BC 8024006C 27BDFFE8 */ addiu $sp, $sp, -0x18
|
||||
/* 9A46C0 80240070 AFBF0010 */ sw $ra, 0x10($sp)
|
||||
/* 9A46C4 80240074 8C82000C */ lw $v0, 0xc($a0)
|
||||
/* 9A46C8 80240078 3C038007 */ lui $v1, %hi(gGameStatusPtr)
|
||||
/* 9A46CC 8024007C 8C63419C */ lw $v1, %lo(gGameStatusPtr)($v1)
|
||||
/* 9A46D0 80240080 8C450000 */ lw $a1, ($v0)
|
||||
/* 9A46D4 80240084 0C0B2026 */ jal set_variable
|
||||
/* 9A46D8 80240088 94660134 */ lhu $a2, 0x134($v1)
|
||||
/* 9A46DC 8024008C 8FBF0010 */ lw $ra, 0x10($sp)
|
||||
/* 9A46E0 80240090 24020002 */ addiu $v0, $zero, 2
|
||||
/* 9A46E4 80240094 03E00008 */ jr $ra
|
||||
/* 9A46E8 80240098 27BD0018 */ addiu $sp, $sp, 0x18
|
||||
/* 9A46EC 8024009C 00000000 */ nop
|
@ -1,53 +0,0 @@
|
||||
.set noat # allow manual use of $at
|
||||
.set noreorder # don't insert nops after branches
|
||||
|
||||
glabel func_80240344_9A8734
|
||||
/* 9A8734 80240344 27BDFFD8 */ addiu $sp, $sp, -0x28
|
||||
/* 9A8738 80240348 AFB10014 */ sw $s1, 0x14($sp)
|
||||
/* 9A873C 8024034C 0080882D */ daddu $s1, $a0, $zero
|
||||
/* 9A8740 80240350 AFBF0020 */ sw $ra, 0x20($sp)
|
||||
/* 9A8744 80240354 AFB3001C */ sw $s3, 0x1c($sp)
|
||||
/* 9A8748 80240358 AFB20018 */ sw $s2, 0x18($sp)
|
||||
/* 9A874C 8024035C AFB00010 */ sw $s0, 0x10($sp)
|
||||
/* 9A8750 80240360 8E30000C */ lw $s0, 0xc($s1)
|
||||
/* 9A8754 80240364 8E050000 */ lw $a1, ($s0)
|
||||
/* 9A8758 80240368 0C0B1EAF */ jal get_variable
|
||||
/* 9A875C 8024036C 26100004 */ addiu $s0, $s0, 4
|
||||
/* 9A8760 80240370 8E050000 */ lw $a1, ($s0)
|
||||
/* 9A8764 80240374 26100004 */ addiu $s0, $s0, 4
|
||||
/* 9A8768 80240378 0220202D */ daddu $a0, $s1, $zero
|
||||
/* 9A876C 8024037C 0C0B1EAF */ jal get_variable
|
||||
/* 9A8770 80240380 0040982D */ daddu $s3, $v0, $zero
|
||||
/* 9A8774 80240384 8E050000 */ lw $a1, ($s0)
|
||||
/* 9A8778 80240388 26100004 */ addiu $s0, $s0, 4
|
||||
/* 9A877C 8024038C 0220202D */ daddu $a0, $s1, $zero
|
||||
/* 9A8780 80240390 0C0B1EAF */ jal get_variable
|
||||
/* 9A8784 80240394 0040902D */ daddu $s2, $v0, $zero
|
||||
/* 9A8788 80240398 0220202D */ daddu $a0, $s1, $zero
|
||||
/* 9A878C 8024039C 8E050000 */ lw $a1, ($s0)
|
||||
/* 9A8790 802403A0 0C0B1EAF */ jal get_variable
|
||||
/* 9A8794 802403A4 0040882D */ daddu $s1, $v0, $zero
|
||||
/* 9A8798 802403A8 0260202D */ daddu $a0, $s3, $zero
|
||||
/* 9A879C 802403AC 0C04417A */ jal get_entity_by_index
|
||||
/* 9A87A0 802403B0 0040802D */ daddu $s0, $v0, $zero
|
||||
/* 9A87A4 802403B4 0040182D */ daddu $v1, $v0, $zero
|
||||
/* 9A87A8 802403B8 44920000 */ mtc1 $s2, $f0
|
||||
/* 9A87AC 802403BC 00000000 */ nop
|
||||
/* 9A87B0 802403C0 46800020 */ cvt.s.w $f0, $f0
|
||||
/* 9A87B4 802403C4 E4600048 */ swc1 $f0, 0x48($v1)
|
||||
/* 9A87B8 802403C8 44910000 */ mtc1 $s1, $f0
|
||||
/* 9A87BC 802403CC 00000000 */ nop
|
||||
/* 9A87C0 802403D0 46800020 */ cvt.s.w $f0, $f0
|
||||
/* 9A87C4 802403D4 E460004C */ swc1 $f0, 0x4c($v1)
|
||||
/* 9A87C8 802403D8 44900000 */ mtc1 $s0, $f0
|
||||
/* 9A87CC 802403DC 00000000 */ nop
|
||||
/* 9A87D0 802403E0 46800020 */ cvt.s.w $f0, $f0
|
||||
/* 9A87D4 802403E4 E4600050 */ swc1 $f0, 0x50($v1)
|
||||
/* 9A87D8 802403E8 8FBF0020 */ lw $ra, 0x20($sp)
|
||||
/* 9A87DC 802403EC 8FB3001C */ lw $s3, 0x1c($sp)
|
||||
/* 9A87E0 802403F0 8FB20018 */ lw $s2, 0x18($sp)
|
||||
/* 9A87E4 802403F4 8FB10014 */ lw $s1, 0x14($sp)
|
||||
/* 9A87E8 802403F8 8FB00010 */ lw $s0, 0x10($sp)
|
||||
/* 9A87EC 802403FC 24020002 */ addiu $v0, $zero, 2
|
||||
/* 9A87F0 80240400 03E00008 */ jr $ra
|
||||
/* 9A87F4 80240404 27BD0028 */ addiu $sp, $sp, 0x28
|
@ -857,7 +857,7 @@ typedef struct GameStatus {
|
||||
/* 0x028 */ char unk_28[8];
|
||||
/* 0x030 */ u32 prevButtons; /* from previous frame */
|
||||
/* 0x034 */ char unk_34[12];
|
||||
/* 0x040 */ u8 stickX; /* with deadzone */
|
||||
/* 0x040 */ s8 stickX; /* with deadzone */
|
||||
/* 0x041 */ u8 altStickX; /* input used for batte when flag 80000 set */
|
||||
/* 0x042 */ char unk_42[2];
|
||||
/* 0x044 */ u8 stickY; /* with deadzone */
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "obk_03.h"
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_obk/obk_03/BC4280", func_80240000_BC4280);
|
||||
#include "world/common/SetEntityPosition.inc.c"
|
||||
|
||||
#include "world/common/GetEntityPosition.inc.c"
|
||||
|
@ -1,5 +1,22 @@
|
||||
#include "trd_03.h"
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_trd/trd_03/9A4650", func_80240000_9A4650);
|
||||
static ApiStatus func_80240000_9A4650(ScriptInstance* script, s32 isInitialCall) {
|
||||
Bytecode* args = script->ptrReadPos;
|
||||
u32 stickX;
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_trd/trd_03/9A4650", func_8024006C_9A46BC);
|
||||
stickX = 0;
|
||||
if (gCollisionStatus.pushingAgainstWall == 35) {
|
||||
stickX = ((u32)GAME_STATUS->stickX) >> 0x1F;
|
||||
}
|
||||
if ((gCollisionStatus.pushingAgainstWall == 37) && (GAME_STATUS->stickX > 0)) {
|
||||
stickX = 2;
|
||||
}
|
||||
|
||||
set_variable(script, *args, stickX);
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
static ApiStatus GetFrameCounter(ScriptInstance* script, s32 isInitialCall) {
|
||||
set_variable(script, *script->ptrReadPos, GAME_STATUS->frameCounter);
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
@ -2,6 +2,6 @@
|
||||
|
||||
#include "world/common/SetEntityFlags100000.inc.c"
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_trd/trd_04/9A8700", func_80240344_9A8734);
|
||||
#include "world/common/SetEntityPosition.inc.c"
|
||||
|
||||
#include "world/common/GetEntityPosition.inc.c"
|
||||
|
15
src/world/common/SetEntityPosition.inc.c
Normal file
15
src/world/common/SetEntityPosition.inc.c
Normal file
@ -0,0 +1,15 @@
|
||||
#include "common.h"
|
||||
|
||||
static ApiStatus SetEntityPosition(ScriptInstance* script, s32 isInitialCall) {
|
||||
Bytecode* args = script->ptrReadPos;
|
||||
s32 entityIndex = get_variable(script, *args++);
|
||||
s32 x = get_variable(script, *args++);
|
||||
s32 y = get_variable(script, *args++);
|
||||
s32 z = get_variable(script, *args++);
|
||||
Entity* entity = get_entity_by_index(entityIndex);
|
||||
|
||||
entity->position.x = x;
|
||||
entity->position.y = y;
|
||||
entity->position.z = z;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
@ -1883,6 +1883,7 @@ gMoveScriptTable;0x80293E80
|
||||
gStaticScriptCounter;0x802D9CA0
|
||||
D_80156954;0x80156954
|
||||
D_802D9CA4;0x802D9CA4
|
||||
gCollisionStatus;0x8015A550
|
||||
gGlobalTimeSpace;0x802D9CA8
|
||||
gBattleState;0x800DC068
|
||||
gBattleDmaDest;0x80284000
|
||||
|
Loading…
Reference in New Issue
Block a user