mirror of
https://github.com/pmret/papermario.git
synced 2024-11-08 12:02:30 +01:00
some more digs
This commit is contained in:
parent
dfbf5a79fc
commit
c2e027729c
@ -1,9 +0,0 @@
|
||||
.set noat # allow manual use of $at
|
||||
.set noreorder # don't insert nops after branches
|
||||
|
||||
glabel func_80218630_6DE3F0
|
||||
/* 6DE3F0 80218630 94820086 */ lhu $v0, 0x86($a0)
|
||||
/* 6DE3F4 80218634 3C018028 */ lui $at, %hi(D_802809F8)
|
||||
/* 6DE3F8 80218638 A42209F8 */ sh $v0, %lo(D_802809F8)($at)
|
||||
/* 6DE3FC 8021863C 03E00008 */ jr $ra
|
||||
/* 6DE400 80218640 24020002 */ addiu $v0, $zero, 2
|
@ -1,43 +0,0 @@
|
||||
.set noat # allow manual use of $at
|
||||
.set noreorder # don't insert nops after branches
|
||||
|
||||
glabel func_80218644_6DE404
|
||||
/* 6DE404 80218644 27BDFFE8 */ addiu $sp, $sp, -0x18
|
||||
/* 6DE408 80218648 3C04800E */ lui $a0, %hi(gBattleStatus)
|
||||
/* 6DE40C 8021864C 2484C070 */ addiu $a0, $a0, %lo(gBattleStatus)
|
||||
/* 6DE410 80218650 24020001 */ addiu $v0, $zero, 1
|
||||
/* 6DE414 80218654 AFBF0014 */ sw $ra, 0x14($sp)
|
||||
/* 6DE418 80218658 AFB00010 */ sw $s0, 0x10($sp)
|
||||
/* 6DE41C 8021865C A0820178 */ sb $v0, 0x178($a0)
|
||||
/* 6DE420 80218660 3C03800B */ lui $v1, %hi(gCurrentEncounter+0x6)
|
||||
/* 6DE424 80218664 90630F16 */ lbu $v1, %lo(gCurrentEncounter+0x6)($v1)
|
||||
/* 6DE428 80218668 8C9000D8 */ lw $s0, 0xd8($a0)
|
||||
/* 6DE42C 8021866C 24020003 */ addiu $v0, $zero, 3
|
||||
/* 6DE430 80218670 A482017C */ sh $v0, 0x17c($a0)
|
||||
/* 6DE434 80218674 3C028009 */ lui $v0, %hi(D_8008F0A0)
|
||||
/* 6DE438 80218678 8C42F0A0 */ lw $v0, %lo(D_8008F0A0)($v0)
|
||||
/* 6DE43C 8021867C 00031E00 */ sll $v1, $v1, 0x18
|
||||
/* 6DE440 80218680 00031E03 */ sra $v1, $v1, 0x18
|
||||
/* 6DE444 80218684 A483017A */ sh $v1, 0x17a($a0)
|
||||
/* 6DE448 80218688 AC820184 */ sw $v0, 0x184($a0)
|
||||
/* 6DE44C 8021868C 0C098C0B */ jal player_create_target_list
|
||||
/* 6DE450 80218690 0200202D */ daddu $a0, $s0, $zero
|
||||
/* 6DE454 80218694 8203040D */ lb $v1, 0x40d($s0)
|
||||
/* 6DE458 80218698 A2000425 */ sb $zero, 0x425($s0)
|
||||
/* 6DE45C 8021869C 00031080 */ sll $v0, $v1, 2
|
||||
/* 6DE460 802186A0 00431021 */ addu $v0, $v0, $v1
|
||||
/* 6DE464 802186A4 00021080 */ sll $v0, $v0, 2
|
||||
/* 6DE468 802186A8 2442022C */ addiu $v0, $v0, 0x22c
|
||||
/* 6DE46C 802186AC 02021021 */ addu $v0, $s0, $v0
|
||||
/* 6DE470 802186B0 94430000 */ lhu $v1, ($v0)
|
||||
/* 6DE474 802186B4 A6030428 */ sh $v1, 0x428($s0)
|
||||
/* 6DE478 802186B8 90420003 */ lbu $v0, 3($v0)
|
||||
/* 6DE47C 802186BC A2020426 */ sb $v0, 0x426($s0)
|
||||
/* 6DE480 802186C0 8FBF0014 */ lw $ra, 0x14($sp)
|
||||
/* 6DE484 802186C4 8FB00010 */ lw $s0, 0x10($sp)
|
||||
/* 6DE488 802186C8 24020002 */ addiu $v0, $zero, 2
|
||||
/* 6DE48C 802186CC 03E00008 */ jr $ra
|
||||
/* 6DE490 802186D0 27BD0018 */ addiu $sp, $sp, 0x18
|
||||
/* 6DE494 802186D4 00000000 */ nop
|
||||
/* 6DE498 802186D8 00000000 */ nop
|
||||
/* 6DE49C 802186DC 00000000 */ nop
|
@ -1,40 +0,0 @@
|
||||
.set noat # allow manual use of $at
|
||||
.set noreorder # don't insert nops after branches
|
||||
|
||||
glabel func_802186E0_6DE4A0
|
||||
/* 6DE4A0 802186E0 27BDFFE8 */ addiu $sp, $sp, -0x18
|
||||
/* 6DE4A4 802186E4 3C04800E */ lui $a0, %hi(gBattleStatus)
|
||||
/* 6DE4A8 802186E8 2484C070 */ addiu $a0, $a0, %lo(gBattleStatus)
|
||||
/* 6DE4AC 802186EC AFBF0014 */ sw $ra, 0x14($sp)
|
||||
/* 6DE4B0 802186F0 AFB00010 */ sw $s0, 0x10($sp)
|
||||
/* 6DE4B4 802186F4 A0800178 */ sb $zero, 0x178($a0)
|
||||
/* 6DE4B8 802186F8 3C03800B */ lui $v1, %hi(gCurrentEncounter+0x6)
|
||||
/* 6DE4BC 802186FC 90630F16 */ lbu $v1, %lo(gCurrentEncounter+0x6)($v1)
|
||||
/* 6DE4C0 80218700 8C9000D8 */ lw $s0, 0xd8($a0)
|
||||
/* 6DE4C4 80218704 24020020 */ addiu $v0, $zero, 0x20
|
||||
/* 6DE4C8 80218708 A482017C */ sh $v0, 0x17c($a0)
|
||||
/* 6DE4CC 8021870C 3C028009 */ lui $v0, %hi(D_8008F2E4)
|
||||
/* 6DE4D0 80218710 8C42F2E4 */ lw $v0, %lo(D_8008F2E4)($v0)
|
||||
/* 6DE4D4 80218714 00031E00 */ sll $v1, $v1, 0x18
|
||||
/* 6DE4D8 80218718 00031E03 */ sra $v1, $v1, 0x18
|
||||
/* 6DE4DC 8021871C A483017A */ sh $v1, 0x17a($a0)
|
||||
/* 6DE4E0 80218720 AC820184 */ sw $v0, 0x184($a0)
|
||||
/* 6DE4E4 80218724 0C098C0B */ jal player_create_target_list
|
||||
/* 6DE4E8 80218728 0200202D */ daddu $a0, $s0, $zero
|
||||
/* 6DE4EC 8021872C 8203040E */ lb $v1, 0x40e($s0)
|
||||
/* 6DE4F0 80218730 24020001 */ addiu $v0, $zero, 1
|
||||
/* 6DE4F4 80218734 A2020425 */ sb $v0, 0x425($s0)
|
||||
/* 6DE4F8 80218738 00031080 */ sll $v0, $v1, 2
|
||||
/* 6DE4FC 8021873C 00431021 */ addu $v0, $v0, $v1
|
||||
/* 6DE500 80218740 00021080 */ sll $v0, $v0, 2
|
||||
/* 6DE504 80218744 2442022C */ addiu $v0, $v0, 0x22c
|
||||
/* 6DE508 80218748 02021021 */ addu $v0, $s0, $v0
|
||||
/* 6DE50C 8021874C 94430000 */ lhu $v1, ($v0)
|
||||
/* 6DE510 80218750 A6030428 */ sh $v1, 0x428($s0)
|
||||
/* 6DE514 80218754 90420003 */ lbu $v0, 3($v0)
|
||||
/* 6DE518 80218758 A2020426 */ sb $v0, 0x426($s0)
|
||||
/* 6DE51C 8021875C 8FBF0014 */ lw $ra, 0x14($sp)
|
||||
/* 6DE520 80218760 8FB00010 */ lw $s0, 0x10($sp)
|
||||
/* 6DE524 80218764 24020002 */ addiu $v0, $zero, 2
|
||||
/* 6DE528 80218768 03E00008 */ jr $ra
|
||||
/* 6DE52C 8021876C 27BD0018 */ addiu $sp, $sp, 0x18
|
@ -1,44 +0,0 @@
|
||||
.set noat # allow manual use of $at
|
||||
.set noreorder # don't insert nops after branches
|
||||
|
||||
glabel func_802187F0_6DE5B0
|
||||
/* 6DE5B0 802187F0 27BDFFE8 */ addiu $sp, $sp, -0x18
|
||||
/* 6DE5B4 802187F4 3C03800E */ lui $v1, %hi(gBattleStatus)
|
||||
/* 6DE5B8 802187F8 2463C070 */ addiu $v1, $v1, %lo(gBattleStatus)
|
||||
/* 6DE5BC 802187FC 24020002 */ addiu $v0, $zero, 2
|
||||
/* 6DE5C0 80218800 AFBF0014 */ sw $ra, 0x14($sp)
|
||||
/* 6DE5C4 80218804 AFB00010 */ sw $s0, 0x10($sp)
|
||||
/* 6DE5C8 80218808 A0620178 */ sb $v0, 0x178($v1)
|
||||
/* 6DE5CC 8021880C 24020082 */ addiu $v0, $zero, 0x82
|
||||
/* 6DE5D0 80218810 A462017A */ sh $v0, 0x17a($v1)
|
||||
/* 6DE5D4 80218814 24020082 */ addiu $v0, $zero, 0x82
|
||||
/* 6DE5D8 80218818 A460017C */ sh $zero, 0x17c($v1)
|
||||
/* 6DE5DC 8021881C AC600188 */ sw $zero, 0x188($v1)
|
||||
/* 6DE5E0 80218820 3C018011 */ lui $at, %hi(gPlayerData+0x1B4)
|
||||
/* 6DE5E4 80218824 A422F444 */ sh $v0, %lo(gPlayerData+0x1B4)($at)
|
||||
/* 6DE5E8 80218828 3C028009 */ lui $v0, %hi(gItemTable+0x1048)
|
||||
/* 6DE5EC 8021882C 8C428928 */ lw $v0, %lo(gItemTable+0x1048)($v0)
|
||||
/* 6DE5F0 80218830 8C7000D8 */ lw $s0, 0xd8($v1)
|
||||
/* 6DE5F4 80218834 34428000 */ ori $v0, $v0, 0x8000
|
||||
/* 6DE5F8 80218838 0200202D */ daddu $a0, $s0, $zero
|
||||
/* 6DE5FC 8021883C 0C098C0B */ jal player_create_target_list
|
||||
/* 6DE600 80218840 AC620184 */ sw $v0, 0x184($v1)
|
||||
/* 6DE604 80218844 8203040D */ lb $v1, 0x40d($s0)
|
||||
/* 6DE608 80218848 A2000425 */ sb $zero, 0x425($s0)
|
||||
/* 6DE60C 8021884C 00031080 */ sll $v0, $v1, 2
|
||||
/* 6DE610 80218850 00431021 */ addu $v0, $v0, $v1
|
||||
/* 6DE614 80218854 00021080 */ sll $v0, $v0, 2
|
||||
/* 6DE618 80218858 2442022C */ addiu $v0, $v0, 0x22c
|
||||
/* 6DE61C 8021885C 02021021 */ addu $v0, $s0, $v0
|
||||
/* 6DE620 80218860 94430000 */ lhu $v1, ($v0)
|
||||
/* 6DE624 80218864 A6030428 */ sh $v1, 0x428($s0)
|
||||
/* 6DE628 80218868 90420003 */ lbu $v0, 3($v0)
|
||||
/* 6DE62C 8021886C A2020426 */ sb $v0, 0x426($s0)
|
||||
/* 6DE630 80218870 8FBF0014 */ lw $ra, 0x14($sp)
|
||||
/* 6DE634 80218874 8FB00010 */ lw $s0, 0x10($sp)
|
||||
/* 6DE638 80218878 24020002 */ addiu $v0, $zero, 2
|
||||
/* 6DE63C 8021887C 03E00008 */ jr $ra
|
||||
/* 6DE640 80218880 27BD0018 */ addiu $sp, $sp, 0x18
|
||||
/* 6DE644 80218884 00000000 */ nop
|
||||
/* 6DE648 80218888 00000000 */ nop
|
||||
/* 6DE64C 8021888C 00000000 */ nop
|
@ -1,12 +0,0 @@
|
||||
.set noat # allow manual use of $at
|
||||
.set noreorder # don't insert nops after branches
|
||||
|
||||
glabel func_80218890_6DE650
|
||||
/* 6DE650 80218890 94820086 */ lhu $v0, 0x86($a0)
|
||||
/* 6DE654 80218894 3C018028 */ lui $at, %hi(D_802809F8)
|
||||
/* 6DE658 80218898 A42209F8 */ sh $v0, %lo(D_802809F8)($at)
|
||||
/* 6DE65C 8021889C 03E00008 */ jr $ra
|
||||
/* 6DE660 802188A0 24020002 */ addiu $v0, $zero, 2
|
||||
/* 6DE664 802188A4 00000000 */ nop
|
||||
/* 6DE668 802188A8 00000000 */ nop
|
||||
/* 6DE66C 802188AC 00000000 */ nop
|
@ -151,6 +151,25 @@ s32 play_sound_at_position(s32 soundID, s32 value2, f32 posX, f32 posY, f32 posZ
|
||||
s32 set_music_track(s32 playerIndex, s32 songID, s32 variation, s32 fadeOutTime, s16 volume);
|
||||
s32 func_8014AA54(s32 playerIndex, s32 arg1, s16 arg2);
|
||||
|
||||
void player_create_target_list(Actor* actor);
|
||||
void enemy_create_target_list(Actor* actor);
|
||||
|
||||
void set_actor_yaw(ActorID actorID, s32 yaw);
|
||||
void set_part_yaw(ActorID actorID, s32 partIndex, s32 value);
|
||||
|
||||
ActorPart* get_actor_part(Actor* actor, s32 partIndex);
|
||||
|
||||
void add_part_decoration(ActorPart* part, s32 decorationIndex, DecorationId decorationType);
|
||||
void add_actor_decoration(Actor* actor, s32 decorationIndex, DecorationId decorationType);
|
||||
void remove_part_decoration(ActorPart* part, s32 decorationIndex);
|
||||
void remove_actor_decoration(Actor* actor, s32 decorationIndex);
|
||||
|
||||
s32 heroes_is_ability_active(Actor* actor, Ability ability);
|
||||
|
||||
void create_part_shadow(ActorID actorID, s32 partIndex);
|
||||
void remove_part_shadow(ActorID actorID, s32 partIndex);
|
||||
void create_part_shadow_by_ref(UNK_TYPE arg0, ActorPart* part); // arg0 unused
|
||||
|
||||
ScriptInstance* get_script_by_index(s32 index);
|
||||
|
||||
void suspend_all_group(s32 groupFlags);
|
||||
|
@ -2,6 +2,25 @@
|
||||
|
||||
#define NAMESPACE b_area_dig
|
||||
|
||||
INCLUDE_ASM(s32, "battle/area_dig/6DE3F0", func_80218630_6DE3F0);
|
||||
#include "common/Set80218630_Var0.inc.c"
|
||||
|
||||
INCLUDE_ASM(s32, "battle/area_dig/6DE3F0", func_80218644_6DE404);
|
||||
extern s32 D_8008F0A0;
|
||||
|
||||
ApiStatus func_80218644_6DE404(ScriptInstance* script, s32 isInitialCall) {
|
||||
BattleStatus* battleStatus = BATTLE_STATUS;
|
||||
Actor* player = battleStatus->playerActor;
|
||||
SelectableTarget* selectableTarget;
|
||||
|
||||
battleStatus->moveCategory = 1;
|
||||
battleStatus->selectedMoveID = 3;
|
||||
battleStatus->selectedItemID = gCurrentEncounter.hitTier;
|
||||
battleStatus->currentTargetListFlags = D_8008F0A0;
|
||||
|
||||
player_create_target_list(player);
|
||||
player->selectedTargetIndex = 0;
|
||||
selectableTarget = &player->targetData[player->targetIndexList[player->selectedTargetIndex]];
|
||||
player->targetActorID = selectableTarget->actorID;
|
||||
player->targetPartIndex = selectableTarget->partID;
|
||||
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
@ -2,8 +2,73 @@
|
||||
|
||||
#define NAMESPACE b_area_dig
|
||||
|
||||
INCLUDE_ASM(s32, "battle/area_dig/6DE4A0", func_802186E0_6DE4A0);
|
||||
extern s32 D_8008F2E4;
|
||||
extern s32 D_8008FC44;
|
||||
|
||||
ApiStatus func_802186E0_6DE4A0(ScriptInstance* script, s32 isInitialCall) {
|
||||
BattleStatus* battleStatus = BATTLE_STATUS;
|
||||
Actor* player = battleStatus->playerActor;
|
||||
SelectableTarget* selectableTarget;
|
||||
|
||||
battleStatus->moveCategory = 0;
|
||||
battleStatus->selectedMoveID = 0x20;
|
||||
battleStatus->selectedItemID = gCurrentEncounter.hitTier;
|
||||
battleStatus->currentTargetListFlags = D_8008F2E4;
|
||||
|
||||
player_create_target_list(player);
|
||||
player->selectedTargetIndex = 1;
|
||||
selectableTarget = &player->targetData[player->targetIndexList[player->selectedTargetIndex]];
|
||||
player->targetActorID = selectableTarget->actorID;
|
||||
player->targetPartIndex = selectableTarget->partID;
|
||||
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
// Reordering near the beginning
|
||||
#ifdef NON_MATCHING
|
||||
ApiStatus func_80218770_6DE530(ScriptInstance* script, s32 isInitialCall) {
|
||||
BattleStatus* battleStatus = BATTLE_STATUS;
|
||||
Actor* partner = battleStatus->partnerActor;
|
||||
SelectableTarget* selectableTarget;
|
||||
|
||||
battleStatus->moveCategory = 6;
|
||||
battleStatus->selectedMoveID = 0x98;
|
||||
battleStatus->selectedItemID = 0;
|
||||
battleStatus->currentTargetListFlags = D_8008FC44;
|
||||
|
||||
player_create_target_list(partner);
|
||||
partner->selectedTargetIndex = 0;
|
||||
selectableTarget = &partner->targetData[partner->targetIndexList[partner->selectedTargetIndex]];
|
||||
partner->targetActorID = selectableTarget->actorID;
|
||||
partner->targetPartIndex = selectableTarget->partID;
|
||||
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
#else
|
||||
INCLUDE_ASM(s32, "battle/area_dig/6DE4A0", func_80218770_6DE530);
|
||||
#endif
|
||||
|
||||
ApiStatus func_802187F0_6DE5B0(ScriptInstance* script, s32 isInitialCall) {
|
||||
BattleStatus* battleStatus = BATTLE_STATUS;
|
||||
PlayerData* playerData = PLAYER_DATA;
|
||||
s32 selectedItemID;
|
||||
Actor* player = battleStatus->playerActor;
|
||||
SelectableTarget* selectableTarget;
|
||||
|
||||
battleStatus->moveCategory = 2;
|
||||
battleStatus->selectedItemID = ItemId_THUNDER_RAGE;
|
||||
selectedItemID = battleStatus->selectedItemID;
|
||||
battleStatus->selectedMoveID = 0;
|
||||
battleStatus->currentAttackElement = 0;
|
||||
playerData->invItems[0] = selectedItemID;
|
||||
battleStatus->currentTargetListFlags = gItemTable[playerData->invItems[0]].targetFlags | 0x8000;
|
||||
|
||||
player_create_target_list(player);
|
||||
player->selectedTargetIndex = 0;
|
||||
selectableTarget = &player->targetData[player->targetIndexList[player->selectedTargetIndex]];
|
||||
player->targetActorID = selectableTarget->actorID;
|
||||
player->targetPartIndex = selectableTarget->partID;
|
||||
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(s32, "battle/area_dig/6DE4A0", func_802187F0_6DE5B0);
|
||||
|
@ -2,4 +2,6 @@
|
||||
|
||||
#define NAMESPACE b_area_dig
|
||||
|
||||
INCLUDE_ASM(s32, "battle/area_dig/6DE650", func_80218890_6DE650);
|
||||
#define NAMESPACE dup_b_area_dig
|
||||
#include "common/Set80218630_Var0.inc.c"
|
||||
#define NAMESPACE b_area_dig
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "code_190B20.h"
|
||||
#include "common.h"
|
||||
|
||||
INCLUDE_ASM(s32, "code_190B20", create_target_list);
|
||||
|
||||
|
@ -1,25 +0,0 @@
|
||||
#ifndef _CODE_190B20_H_
|
||||
#define _CODE_190B20_H_
|
||||
|
||||
#include "common.h"
|
||||
|
||||
void player_create_target_list(Actor* actor);
|
||||
void enemy_create_target_list(Actor* actor);
|
||||
|
||||
void set_actor_yaw(ActorID actorID, s32 yaw);
|
||||
void set_part_yaw(ActorID actorID, s32 partIndex, s32 value);
|
||||
|
||||
ActorPart* get_actor_part(Actor* actor, s32 partIndex);
|
||||
|
||||
void add_part_decoration(ActorPart* part, s32 decorationIndex, DecorationId decorationType);
|
||||
void add_actor_decoration(Actor* actor, s32 decorationIndex, DecorationId decorationType);
|
||||
void remove_part_decoration(ActorPart* part, s32 decorationIndex);
|
||||
void remove_actor_decoration(Actor* actor, s32 decorationIndex);
|
||||
|
||||
s32 heroes_is_ability_active(Actor* actor, Ability ability);
|
||||
|
||||
void create_part_shadow(ActorID actorID, s32 partIndex);
|
||||
void remove_part_shadow(ActorID actorID, s32 partIndex);
|
||||
void create_part_shadow_by_ref(UNK_TYPE arg0, ActorPart* part); // arg0 unused
|
||||
|
||||
#endif
|
9
src/common/Set80218630_Var0.inc.c
Normal file
9
src/common/Set80218630_Var0.inc.c
Normal file
@ -0,0 +1,9 @@
|
||||
#include "common.h"
|
||||
#include "map.h"
|
||||
|
||||
extern s16 D_802809F8;
|
||||
|
||||
ApiStatus N(Set80218630_Var0)(ScriptInstance* script, s32 isInitialCall) {
|
||||
D_802809F8 = script->varTable[0];
|
||||
return ApiStatus_DONE2;
|
||||
}
|
Loading…
Reference in New Issue
Block a user