mirror of
https://github.com/pmret/papermario.git
synced 2024-11-23 13:49:51 +00:00
world/area_arn/arn_02 (#236)
* area_arn/arn_02 * Signed StoryProgress enum
This commit is contained in:
parent
c8da41b5e4
commit
a8e5d9b1d9
7
diff.py
7
diff.py
@ -1445,6 +1445,13 @@ class Display:
|
||||
header_lines = [header] if header else []
|
||||
output = "\n".join(header_lines + diff_lines[args.skip_lines :])
|
||||
|
||||
# Windows Terminal does not handle buffers properly
|
||||
# Janky hack to clear its scrollback buffer until it's fixed
|
||||
clear_proc = subprocess.Popen(
|
||||
["echo", "-en", "\"\e[3J\""]
|
||||
)
|
||||
clear_proc.wait()
|
||||
|
||||
# Pipe the output through 'tail' and only then to less, to ensure the
|
||||
# write call doesn't block. ('tail' has to buffer all its input before
|
||||
# it starts writing.) This also means we don't have to deal with pipe
|
||||
|
@ -1704,7 +1704,6 @@ typedef struct struct802E1400 {
|
||||
/* 0x03C */ union {
|
||||
/* */ s16 s;
|
||||
/* */ s8 b[2];
|
||||
/* */
|
||||
} unk_3C;
|
||||
/* 0x03E */ char unk_3E[0x4D];
|
||||
/* 0x08B */ u8 unk_8B[24];
|
||||
|
231
include/enums.h
231
include/enums.h
@ -4,6 +4,237 @@
|
||||
#include "ultra64.h"
|
||||
#include "types.h"
|
||||
|
||||
enum StoryProgress {
|
||||
STORY_INTRO = -128,
|
||||
|
||||
STORY_CH0_WAKE_UP,
|
||||
STORY_CH0_MET_INNKEEPER,
|
||||
STORY_CH0_MET_GOOMPA = -124,
|
||||
STORY_CH0_GATE_CRUSHED,
|
||||
STORY_CH0_FELL_OFF_CLIFF,
|
||||
STORY_CH0_GOOMPA_JOINED_PARTY,
|
||||
STORY_CH0_LOOKING_FOR_HAMMER,
|
||||
STORY_CH0_FOUND_HAMMER,
|
||||
STORY_CH0_DEFEATED_JR_TROOPA,
|
||||
STORY_CH0_LEFT_THE_PLAYGROUND,
|
||||
STORY_CH0_GOOMBARIO_JOINED_PARTY = -115,
|
||||
STORY_CH0_SMASHED_GATE_BLOCK,
|
||||
STORY_CH0_DEFEATED_GOOMBA_BROS,
|
||||
STORY_CH0_DEFEATED_GOOMBA_KING,
|
||||
STORY_CH0_FOUND_GATEHOUSE_SWITCH,
|
||||
STORY_CH0_HIT_GATEHOUSE_SWITCH,
|
||||
STORY_CH0_OPENED_BRIDGE_TO_TOAD_TOWN,
|
||||
STORY_CH0_KAMMY_RETURNED_TO_BOWSER,
|
||||
STORY_CH0_ARRIVED_AT_TOAD_TOWN,
|
||||
STORY_CH0_MET_STAR_SPIRITS,
|
||||
STORY_CH0_BEGAN_PEACH_MISSION,
|
||||
STORY_CH0_TWINK_GAVE_LUCKY_STAR,
|
||||
STORY_CH0_RETURNED_TO_TOAD_TOWN,
|
||||
|
||||
STORY_CH1_SPOKE_WITH_MERLIN,
|
||||
STORY_CH1_TOLD_MERLIN_ABOUT_DARK_TOADS,
|
||||
STORY_CH1_MERLIN_REVEALED_KOOPA_BROS,
|
||||
STORY_CH1_KNOCKED_SWITCH_FROM_TREE,
|
||||
STORY_CH1_MADE_FIRST_BRIDGE,
|
||||
STORY_CH1_ARRIVED_AT_KOOPA_VILLAGE,
|
||||
STORY_CH1_PROMISED_TO_HELP_KOOPER,
|
||||
STORY_CH1_FUZZY_THIEF_LEFT_TOWN,
|
||||
STORY_CH1_FUZZY_THIEF_RAN_AWAY,
|
||||
STORY_CH1_FUZZY_THIEF_HID_IN_TREE,
|
||||
STORY_CH1_KOOPER_JOINED_PARTY,
|
||||
STORY_CH1_MADE_SECOND_BRIDGE,
|
||||
STORY_CH1_ARRIVED_AT_KOOPA_FORTRESS,
|
||||
STORY_CH1_SPOTTED_BY_KOOPA_BROS,
|
||||
STORY_CH1_KOOPA_BROS_HID_KEY,
|
||||
STORY_CH1_DEFEATED_BASEMENT_GUARD,
|
||||
STORY_CH1_LOWERED_FIRST_STAIRS,
|
||||
STORY_CH1_KOOPA_BROS_SET_TRAP,
|
||||
STORY_CH1_MARIO_ACTIVATED_TRAP,
|
||||
STORY_CH1_BOMBETTE_JOINED_PARTY,
|
||||
STORY_CH1_DEFEATED_DUNGEON_GUARDS,
|
||||
STORY_CH1_LOWERED_SECOND_STAIRS,
|
||||
STORY_CH1_RAISED_SUBMERGED_STAIRS,
|
||||
STORY_CH1_KOOPA_BROS_FIRING_BLASTERS,
|
||||
STORY_CH1_DEFEATED_KOOPA_BROS,
|
||||
STORY_CH1_STAR_SPIRIT_RESCUED,
|
||||
STORY_CH1_BEGAN_PEACH_MISSION,
|
||||
STORY_CH1_STAR_SPRIT_DEPARTED,
|
||||
STORY_CH1_DEFEATED_JR_TROOPA,
|
||||
STORY_CH1_RETURNED_TO_TOAD_TOWN,
|
||||
|
||||
STORY_CH2_ARRIVED_AT_MT_RUGGED,
|
||||
STORY_CH2_SPOKE_WITH_PARAKARRY,
|
||||
STORY_CH2_PARAKARRY_JOINED_PARTY,
|
||||
STORY_CH2_ARRIVED_AT_DRY_DRY_DESERT,
|
||||
STORY_CH2_ARRIVED_AT_DRY_DRY_OUTPOST,
|
||||
STORY_CH2_SHADY_MOUSE_LEFT_SHOP,
|
||||
STORY_CH2_SPOKE_WITH_SHEEK,
|
||||
STORY_CH2_SHADY_MOUSE_ENTERED_SHOP,
|
||||
STORY_CH2_BOUGHT_SECRET_ITEMS,
|
||||
STORY_CH2_GOT_PULSE_STONE,
|
||||
STORY_CH2_UNCOVERED_DRY_DRY_RUINS,
|
||||
STORY_CH2_DRAINED_FIRST_SAND_ROOM,
|
||||
STORY_CH2_DRAINED_SECOND_SAND_ROOM,
|
||||
STORY_CH2_GOT_SUPER_HAMMER,
|
||||
STORY_CH2_DRAINED_THIRD_SAND_ROOM,
|
||||
STORY_CH2_SOLVED_ARTIFACT_PUZZLE,
|
||||
STORY_CH2_DEFEATED_TUTANKOOPA,
|
||||
STORY_CH2_STAR_SPIRIT_RESCUED,
|
||||
STORY_CH2_BEGAN_PEACH_MISSION,
|
||||
STORY_CH2_STAR_SPRIT_DEPARTED,
|
||||
|
||||
STORY_CH3_SAW_BOO_ENTER_FOREST = -51,
|
||||
STORY_CH3_INVITED_TO_BOOS_MANSION,
|
||||
STORY_CH3_ALLOWED_INTO_FOREVER_FOREST,
|
||||
STORY_CH3_ARRIVED_AT_BOOS_MANSION,
|
||||
STORY_CH3_OPENED_BOOS_MANSION_GATE,
|
||||
STORY_CH3_ENTERED_BOOS_MANSION,
|
||||
STORY_CH3_TRIGGERED_DOOR_JUMP_SCARE,
|
||||
STORY_CH3_GOT_RECORD,
|
||||
STORY_CH3_PLAYED_THE_RECORD,
|
||||
STORY_CH3_GOT_WEIGHT,
|
||||
STORY_CH3_WEIGHED_DOWN_CHANDELIER,
|
||||
STORY_CH3_GOT_SUPER_BOOTS,
|
||||
STORY_CH3_HIT_HUGE_BLUE_SWITCH,
|
||||
STORY_CH3_GOT_BOO_PORTRAIT,
|
||||
STORY_CH3_RESTORED_BOO_PORTRAIT,
|
||||
STORY_CH3_BOW_JOINED_PARTY,
|
||||
STORY_CH3_UNLOCKED_GUSTY_GULCH,
|
||||
STORY_CH3_ARRIVED_AT_GHOST_TOWN,
|
||||
STORY_CH3_SAW_TUBBA_EAT_BOO,
|
||||
STORY_CH3_ARRIVED_AT_TUBBAS_MANOR,
|
||||
STORY_CH3_TUBBA_BEGAN_NAPPING = -30,
|
||||
STORY_CH3_TUBBA_WOKE_UP,
|
||||
STORY_CH3_TUBBA_SMASHED_THE_BRIDGES,
|
||||
STORY_CH3_TUBBA_CHASED_MARIO_IN_HALL,
|
||||
STORY_CH3_TUBBA_CHASED_MARIO_IN_FOYER,
|
||||
STORY_CH3_ESCAPED_TUBBAS_MANOR,
|
||||
STORY_CH3_UNLOCKED_WINDY_MILL,
|
||||
STORY_CH3_WENT_DOWN_THE_WELL,
|
||||
STORY_CH3_HEART_FLED_FIRST_TUNNEL,
|
||||
STORY_CH3_HEART_FLED_SECOND_TUNNEL = -19,
|
||||
STORY_CH3_HEART_ESCAPED_WELL,
|
||||
STORY_CH3_HEART_ESCAPED_WINDY_MILL,
|
||||
STORY_CH3_DEFEATED_TUBBA_BLUBBA,
|
||||
STORY_CH3_STAR_SPIRIT_RESCUED,
|
||||
STORY_CH3_BEGAN_PEACH_MISSION,
|
||||
STORY_CH3_STAR_SPRIT_DEPARTED,
|
||||
|
||||
STORY_CH4_FRYING_PAN_STOLEN,
|
||||
STORY_CH4_MET_WITH_TWINK,
|
||||
STORY_CH4_FOUND_HIDDEN_DOOR,
|
||||
STORY_CH4_ENTERED_THE_TOY_BOX,
|
||||
STORY_CH4_GOT_STOREROOM_KEY,
|
||||
STORY_CH4_RETURNED_STOREROOM_KEY,
|
||||
STORY_CH4_GOT_TOY_TRAIN,
|
||||
STORY_CH4_RETURNED_TOY_TRAIN,
|
||||
STORY_CH4_GOT_FRYING_PAN,
|
||||
STORY_CH4_GOT_TAYCE_TS_CAKE,
|
||||
STORY_CH4_GAVE_CAKE_TO_GOURMET_GUY,
|
||||
STORY_CH4_PULLED_SWITCH_SWITCH,
|
||||
STORY_CH4_SOLVED_COLOR_PUZZLE,
|
||||
STORY_CH4_DEFEATED_LANTERN_GHOST,
|
||||
STORY_CH4_WATT_JOINED_PARTY,
|
||||
STORY_CH4_OPENED_GENERAL_GUY_ROOM,
|
||||
STORY_CH4_DEFEATED_GENERAL_GUY,
|
||||
STORY_CH4_STAR_SPIRIT_RESCUED,
|
||||
STORY_CH4_BEGAN_PEACH_MISSION,
|
||||
STORY_CH4_STAR_SPRIT_DEPARTED,
|
||||
|
||||
STORY_CH5_WHALE_MOUTH_OPEN,
|
||||
STORY_CH5_ENTERED_WHALE,
|
||||
STORY_CH5_DEFEATED_FUZZIPEDE,
|
||||
STORY_CH5_REACHED_LAVA_LAVA_ISLAND,
|
||||
STORY_CH5_KOLORADO_ESCAPED_FUZZIES,
|
||||
STORY_CH5_KOLORADO_ESCAPED_SPEAR_GUYS,
|
||||
STORY_CH5_YOSHI_CHILDREN_ARE_MISSING,
|
||||
STORY_CH5_SUSHIE_JOINED_PARTY,
|
||||
STORY_CH5_ALL_YOSHI_CHILDREN_RESCUED,
|
||||
STORY_CH5_GOT_JADE_RAVEN,
|
||||
STORY_CH5_MOVED_RAVEN_STATUE,
|
||||
STORY_CH5_DEFEATED_PIRANHAS_MINIBOSS,
|
||||
STORY_CH5_REACHED_RAFAELS_TREE,
|
||||
STORY_CH5_RAFAEL_LEFT_NEST,
|
||||
STORY_CH5_RAFAEL_MOVED_ROOT,
|
||||
STORY_CH5_RAFAEL_WAITING_FOR_MARIO,
|
||||
STORY_CH5_ZIP_LINE_READY,
|
||||
STORY_CH5_ENTERED_MT_LAVA_LAVA,
|
||||
STORY_CH5_KOLORADO_FELL_IN_LAVA,
|
||||
STORY_CH5_LAVA_STREAM_BLOCKED,
|
||||
STORY_CH5_GOT_ULTRA_HAMMER,
|
||||
STORY_CH5_SMASHED_ULTRA_BLOCK,
|
||||
STORY_CH5_KOLORADO_FELL_IN_PIT,
|
||||
STORY_CH5_KOLORADO_AT_DEAD_END,
|
||||
STORY_CH5_HIDDEN_PASSAGE_OPEN,
|
||||
STORY_CH5_KOLORADO_RAN_AHEAD,
|
||||
STORY_CH5_KOLORADO_IN_TREASURE_ROOM,
|
||||
STORY_CH5_DEFEATED_LAVA_PIRANHA,
|
||||
STORY_CH5_MT_LAVA_LAVA_ERUPTING,
|
||||
STORY_CH5_OPENED_ESCAPE_ROUTE,
|
||||
STORY_CH5_BEGAN_PEACH_MISSION,
|
||||
STORY_CH5_STAR_SPRIT_DEPARTED,
|
||||
STORY_CH5_TRADED_VASE_FOR_SEED,
|
||||
STORY_CH5_RETURNED_TO_TOAD_TOWN,
|
||||
|
||||
STORY_CH6_FLOWER_GATE_OPEN,
|
||||
STORY_CH6_ARRIVED_AT_FLOWER_FIELDS,
|
||||
STORY_CH6_ASKED_TO_DEFEAT_MONTY_MOLES,
|
||||
STORY_CH6_GOT_MAGICAL_BEAN,
|
||||
STORY_CH6_GOT_FERTILE_SOIL,
|
||||
STORY_CH6_GOT_CRYSTAL_BERRY,
|
||||
STORY_CH6_GOT_WATER_STONE,
|
||||
STORY_CH6_FILLED_SPRING_WITH_WATER,
|
||||
STORY_CH6_SPOKE_WITH_THE_SUN,
|
||||
STORY_CH6_LAKILESTER_JOINED_PARTY,
|
||||
STORY_CH6_DEFEATED_PUFF_PUFF_GUARDS,
|
||||
STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE,
|
||||
STORY_CH6_WISTERWOOD_GAVE_HINT,
|
||||
STORY_CH6_GREW_MAGIC_BEANSTALK,
|
||||
STORY_CH6_DEFEATED_HUFF_N_PUFF,
|
||||
STORY_CH6_STAR_SPIRIT_RESCUED,
|
||||
STORY_CH6_BEGAN_PEACH_MISSION,
|
||||
STORY_CH6_STAR_SPRIT_DEPARTED,
|
||||
STORY_CH6_RETURNED_TO_TOAD_TOWN,
|
||||
|
||||
STORY_CH7_INVITED_TO_STARBORN_VALLEY,
|
||||
STORY_CH7_ARRIVED_AT_SHIVER_CITY,
|
||||
STORY_CH7_MAYOR_MURDER_MYSTERY,
|
||||
STORY_CH7_SHATTERED_FROZEN_POND,
|
||||
STORY_CH7_SPOKE_WITH_HERRINGWAY,
|
||||
STORY_CH7_HERRINGWAY_AT_MAYORS_HOUSE,
|
||||
STORY_CH7_MAYOR_MURDER_SOLVED,
|
||||
STORY_CH7_DEFEATED_JR_TROOPA,
|
||||
STORY_CH7_DEFEATED_MONSTAR,
|
||||
STORY_CH7_ARRIVED_AT_STARBORN_VALLEY,
|
||||
STORY_CH7_MERLE_APOLOGIZED,
|
||||
STORY_CH7_GOT_SNOWMAN_SCARF,
|
||||
STORY_CH7_GOT_SNOWMAN_BUCKET,
|
||||
STORY_CH7_UNLOCKED_SHIVER_MOUNTAIN,
|
||||
STORY_CH7_DEFEATED_FIRST_DUPLIGHOST,
|
||||
STORY_CH7_GOT_STAR_STONE,
|
||||
STORY_CH7_RAISED_FROZEN_STAIRS,
|
||||
STORY_CH7_ARRIVED_AT_CRYSTAL_PALACE,
|
||||
STORY_CH7_DEFEATED_MIRROR_DUPLIGHOSTS,
|
||||
STORY_CH7_DEFEATED_BOMBETTE_DUPLIGHOSTS,
|
||||
STORY_CH7_DEFEATED_CLUBBAS,
|
||||
STORY_CH7_DEFEATED_KOOPER_DUPLIGHOSTS,
|
||||
STORY_CH7_EXTENDED_PALACE_BRIDGE,
|
||||
STORY_CH7_FOUND_HIDDEN_ROOM_UNDER_STATUE,
|
||||
STORY_CH7_SOLVED_ALBINO_DINO_PUZZLE,
|
||||
STORY_CH7_DEFEATED_CRYSTAL_KING,
|
||||
STORY_CH7_STAR_SPIRIT_RESCUED,
|
||||
STORY_CH7_BEGAN_PEACH_MISSION,
|
||||
STORY_CH7_STAR_SPRIT_DEPARTED,
|
||||
|
||||
STORY_CH8_OPENED_PATH_TO_STAR_WAY,
|
||||
STORY_CH8_REACHED_STAR_HAVEN,
|
||||
STORY_CH8_STAR_SHIP_ACTIVATED,
|
||||
STORY_CH8_REACHED_BOWSERS_CASTLE = 94,
|
||||
STORY_CH8_REACHED_PEACHS_CASTLE,
|
||||
|
||||
STORY_EPILOGUE,
|
||||
};
|
||||
|
||||
typedef UNK_TYPE EncounterTriggerFlags;
|
||||
#define EncounterTriggerFlags_NONE 0x00000001
|
||||
#define EncounterTriggerFlags_JUMP 0x00000002
|
||||
|
@ -5,6 +5,9 @@
|
||||
#include "common_structs.h"
|
||||
#include "enums.h"
|
||||
|
||||
f32 fabsf(f32 f);
|
||||
f32 sqrtf(f32 f);
|
||||
f64 sqrt(f64 d);
|
||||
|
||||
void nuBoot(void);
|
||||
void boot_idle(void);
|
||||
@ -155,7 +158,7 @@ void close_status_menu(void);
|
||||
void func_800EB168(s32);
|
||||
|
||||
Shadow* create_shadow_type(s32 type, f32 x, f32 y, f32 z);
|
||||
|
||||
s32 is_point_within_region(s32 shape, f32 pointX, f32 pointY, f32 centerX, f32 centerY, f32 sizeX, f32 sizeZ);
|
||||
PlayerData* get_player_data(void);
|
||||
|
||||
// Pause
|
||||
|
@ -66,13 +66,13 @@ typedef struct NpcAISettings {
|
||||
/* 0x04 */ s32 moveTime;
|
||||
/* 0x08 */ s32 waitTime;
|
||||
/* 0x0C */ f32 alertRadius;
|
||||
/* 0x10 */ s32 unk_10;
|
||||
/* 0x10 */ X32 unk_10;
|
||||
/* 0x14 */ s32 unk_14;
|
||||
/* 0x18 */ f32 chaseSpeed;
|
||||
/* 0x1C */ s32 unk_1C; // chase turn step?
|
||||
/* 0x20 */ s32 unk_20;
|
||||
/* 0x24 */ f32 chaseRadius;
|
||||
/* 0x28 */ f32 unk_28;
|
||||
/* 0x28 */ X32 unk_28;
|
||||
/* 0x2C */ s32 unk_2C; // bool
|
||||
} NpcAISettings; // size = 0x30
|
||||
|
||||
@ -172,7 +172,7 @@ typedef struct StatDrop {
|
||||
#define OVERRIDE_MOVEMENT_SPEED(speed) (speed * 32767)
|
||||
#define NO_OVERRIDE_MOVEMENT_SPEED OVERRIDE_MOVEMENT_SPEED(-1)
|
||||
|
||||
typedef struct StaticNPC {
|
||||
typedef struct StaticNpc {
|
||||
/* 0x000 */ NpcId id;
|
||||
/* 0x004 */ NpcSettings* settings;
|
||||
/* 0x008 */ Vec3f pos;
|
||||
@ -187,7 +187,6 @@ typedef struct StaticNPC {
|
||||
/* 0x09A */ StatDrop flowerDrops[8];
|
||||
/* 0x0DA */ s16 minCoinBonus;
|
||||
/* 0x0DC */ s16 maxCoinBonus;
|
||||
/* 0x0DE */ char unk_DE[2];
|
||||
/* 0x0E0 */ s32 movement[48]; // TODO: type
|
||||
/* 0x1A0 */ NpcAnimID animations[16];
|
||||
/* 0x1E0 */ char unk_1E0[8];
|
||||
@ -195,9 +194,28 @@ typedef struct StaticNPC {
|
||||
/* 0x1EC */ MessageID tattle;
|
||||
} StaticNpc; // size = 0x1F0
|
||||
|
||||
typedef struct EnemyTerritoryThing {
|
||||
/* 0x00 */ s32 unk_00;
|
||||
/* 0x04 */ s32 shape;
|
||||
/* 0x08 */ s32 pointX;
|
||||
/* 0x0C */ s32 pointZ;
|
||||
/* 0x10 */ s32 sizeX;
|
||||
/* 0x14 */ s32 sizeZ;
|
||||
/* 0x18 */ f32 unk_34;
|
||||
/* 0x1C */ s16 unk_1C;
|
||||
} EnemyTerritoryThing; // size = 0x20
|
||||
|
||||
typedef struct EnemyTerritory {
|
||||
/* 0x00 */ Vec3i unk_00;
|
||||
/* 0x0C */ char unk_0C[0x28];
|
||||
/* 0x0C */ char unk_0C[0x8];
|
||||
/* 0x14 */ s32 unk_14;
|
||||
/* 0x18 */ s32 unk_18;
|
||||
/* 0x1C */ s32 pointX;
|
||||
/* 0x20 */ s32 pointY;
|
||||
/* 0x24 */ s32 pointZ;
|
||||
/* 0x28 */ s32 sizeX;
|
||||
/* 0x2C */ s32 sizeZ;
|
||||
/* 0x30 */ s32 shape;
|
||||
/* 0x34 */ s32 unk_34;
|
||||
} EnemyTerritory; // size = ???
|
||||
|
||||
@ -260,7 +278,7 @@ typedef struct {
|
||||
Enemy* get_enemy(NpcId npcId);
|
||||
MapConfig* get_current_map_header(void);
|
||||
|
||||
s32 func_800490B4(s32 arg0, Enemy* arg1, f32 arg2, s32 arg3, s32 arg4);
|
||||
s32 func_800490B4(EnemyTerritoryThing* arg0, Enemy* arg1, f32 arg2, s32 arg3, s32 arg4);
|
||||
|
||||
/// Zero-terminated.
|
||||
Area gAreas[29];
|
||||
|
@ -11,7 +11,7 @@
|
||||
#define UNK_ARGS
|
||||
|
||||
typedef s32 BattleID;
|
||||
#define BATTLE_ID(area, stage, index) ((area << 16) + (stage << 8) + index)
|
||||
#define BATTLE_ID(unk, area, stage, index) ((unk << 24) + (area << 16) + (stage << 8) + index)
|
||||
|
||||
typedef s32 NpcAnimID;
|
||||
#define NPC_ANIM(sprite, palette, anim) (((_NPC_SPRITE_##sprite << 16) + (_NPC_PALETTE_##sprite##_##palette << 8) + _NPC_ANIM_##sprite##_##anim))
|
||||
|
@ -106,7 +106,7 @@ s32 is_point_within_region(s32 shape, f32 pointX, f32 pointY, f32 centerX, f32 c
|
||||
}
|
||||
}
|
||||
|
||||
INCLUDE_ASM(s32, "code_23680", func_800490B4, s32 arg0, Enemy* arg1, f32 arg2, s32 arg3, s32 arg4);
|
||||
INCLUDE_ASM(s32, "code_23680", func_800490B4, EnemyTerritoryThing* arg0, Enemy* arg1, f32 arg2, s32 arg3, s32 arg4);
|
||||
|
||||
s32 func_800493EC(Enemy* enemy, s32 arg1, f32 arg2, f32 arg3) {
|
||||
PlayerStatus* playerStatus = &gPlayerStatus;
|
||||
|
@ -65,7 +65,7 @@ void check_input_status_menu(void) {
|
||||
PlayerStatus* playerStatus = &gPlayerStatus;
|
||||
s32 pressedButtons;
|
||||
|
||||
if (get_variable(NULL, SI_SAVE_VAR(0)) < 0x60) {
|
||||
if (get_variable(NULL, SI_SAVE_VAR(0)) < STORY_EPILOGUE) {
|
||||
if (playerStatus->actionState != ActionState_RIDE) {
|
||||
pressedButtons = playerStatus->pressedButtons;
|
||||
} else {
|
||||
|
@ -12,8 +12,7 @@ void load_map_bg(char* optAssetName) {
|
||||
u32 assetSize;
|
||||
char* assetName = optAssetName;
|
||||
|
||||
// StoryProgress check
|
||||
if (get_variable(0, SI_SAVE_VAR(0)) >= 0x35) {
|
||||
if (get_variable(0, SI_SAVE_VAR(0)) >= STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE) {
|
||||
// Use sunny Flower Fields bg rather than cloudy
|
||||
if (!strcmp(assetName, gCloudyFlowerFieldsBg)) {
|
||||
assetName = gSunnyFlowerFieldsBg;
|
||||
|
@ -1,33 +0,0 @@
|
||||
#include "arn_02.h"
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_arn/arn_02/BDD1B0", func_80240000_BDD1B0);
|
||||
|
||||
#include "world/common/UnkNpcAIFunc18.inc.c"
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_arn/arn_02/BDD1B0", func_802401D4_BDD384);
|
||||
|
||||
#include "world/common/UnkNpcAIFunc21.inc.c"
|
||||
|
||||
#include "world/common/UnkNpcAIFunc20.inc.c"
|
||||
|
||||
#include "world/common/UnkNpcAIFunc22.inc.c"
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_arn/arn_02/BDD1B0", func_802404D0_BDD680);
|
||||
|
||||
#include "world/common/UnkNpcAIFunc16.inc.c"
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_arn/arn_02/BDD1B0", func_80240694_BDD844);
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_arn/arn_02/BDD1B0", func_80240834_BDD9E4);
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_arn/arn_02/BDD1B0", func_80240984_BDDB34);
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_arn/arn_02/BDD1B0", func_80240A30_BDDBE0);
|
||||
|
||||
#include "world/common/UnkNpcAIFunc19.inc.c"
|
||||
|
||||
#include "world/common/UnkNpcAIFunc17.inc.c"
|
||||
|
||||
#include "world/common/UnkDurationCheck.inc.c"
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_arn/arn_02/BDD1B0", func_80240C90_BDDE40);
|
@ -2,3 +2,13 @@
|
||||
#include "map.h"
|
||||
|
||||
#define NAMESPACE arn_02
|
||||
|
||||
s32 func_800493EC(Enemy* enemy, s32 arg1, f32 arg2, f32 arg3);
|
||||
s32 func_80240C90_BDDE40(ScriptInstance *script, NpcAISettings *aiSettings);
|
||||
|
||||
Script N(Main);
|
||||
Script N(PlayMusic);
|
||||
Script N(MakeEntities);
|
||||
NpcGroupList N(npcGroupList);
|
||||
|
||||
extern s16 D_8009A634;
|
||||
|
537
src/world/area_arn/arn_02/events.c
Normal file
537
src/world/area_arn/arn_02/events.c
Normal file
@ -0,0 +1,537 @@
|
||||
#include "arn_02.h"
|
||||
#include "sprite/npc/cleft.h"
|
||||
#include "sprite/npc/goomba.h"
|
||||
|
||||
Script N(Exit1) = EXIT_WALK_SCRIPT(60, 0, "arn_05", 1);
|
||||
Script N(Exit2) = EXIT_WALK_SCRIPT(60, 1, "arn_04", 0);
|
||||
|
||||
Script N(BindExits) = SCRIPT({
|
||||
bind N(Exit1) to TriggerFlag_FLOOR_ABOVE 1;
|
||||
bind N(Exit2) to TriggerFlag_FLOOR_ABOVE 6;
|
||||
});
|
||||
|
||||
Script N(Main) = SCRIPT({
|
||||
SI_SAVE_VAR(425) = 34;
|
||||
SetSpriteShading(-1);
|
||||
SetCamPerspective(0, 3, 25, 16, 4096);
|
||||
SetCamBGColor(0, 0, 0, 0);
|
||||
SetCamEnabled(0, 1);
|
||||
MakeNpcs(0, N(npcGroupList));
|
||||
await N(MakeEntities);
|
||||
spawn N(PlayMusic);
|
||||
SI_VAR(0) = N(BindExits);
|
||||
spawn EnterWalk;
|
||||
sleep 1;
|
||||
});
|
||||
|
||||
s32 N(padding2)[] = { 0, 0, 0 };
|
||||
|
||||
Script N(MakeEntities) = SCRIPT({
|
||||
MakeItemEntity(ItemId_DIZZY_DIAL, 0xFFFFFF08, 193, 45, 17, SI_SAVE_FLAG(1005));
|
||||
MakeItemEntity(ItemId_LETTER07, 536, 260, 227, 17, SI_SAVE_FLAG(1006));
|
||||
MakeEntity(0x802EA564, 0xFFFFFEA2, 172, 170, 0, ItemId_COIN, 0x80000000);
|
||||
AssignBlockFlag(SI_SAVE_FLAG(1002));
|
||||
MakeEntity(0x802EA564, 225, 265, 30, 0, ItemId_COIN, 0x80000000);
|
||||
AssignBlockFlag(SI_SAVE_FLAG(1003));
|
||||
MakeEntity(0x802EA564, 275, 265, 150, 0, ItemId_REPEL_GEL, 0x80000000);
|
||||
AssignBlockFlag(SI_SAVE_FLAG(1004));
|
||||
});
|
||||
|
||||
NpcAISettings N(goombaAISettings) = {
|
||||
.moveSpeed = 1.8f,
|
||||
.moveTime = 40,
|
||||
.waitTime = 15,
|
||||
.alertRadius = 150.0f,
|
||||
.unk_10 = { .f = 0.0f },
|
||||
.unk_14 = 2,
|
||||
.chaseSpeed = 3.3f,
|
||||
.unk_1C = 70,
|
||||
.unk_20 = 1,
|
||||
.chaseRadius = 180.0f,
|
||||
.unk_28 = { .f = 0.0f },
|
||||
.unk_2C = TRUE,
|
||||
};
|
||||
|
||||
Script N(GoombaAI) = SCRIPT({
|
||||
DoBasicAI(N(goombaAISettings));
|
||||
});
|
||||
|
||||
NpcSettings N(goombaNpcSettings) = {
|
||||
.unk_00 = { 0x00, 0x00, 0x00, 0x00 },
|
||||
.height = 20,
|
||||
.radius = 23,
|
||||
.otherAI = NULL,
|
||||
.onInteract = NULL,
|
||||
.ai = N(GoombaAI),
|
||||
.onHit = EnemyNpcHit,
|
||||
.aux = NULL,
|
||||
.onDefeat = EnemyNpcDefeat,
|
||||
.flags = 0x00000000,
|
||||
.unk_24 = { 0x00, 0x00, 0x00, 0x00 },
|
||||
.level = 12,
|
||||
.unk_2A = 0x0000,
|
||||
};
|
||||
|
||||
NpcAISettings N(cleftAISettings) = {
|
||||
.moveSpeed = 1.0f,
|
||||
.moveTime = 30,
|
||||
.waitTime = 30,
|
||||
.alertRadius = 120.0f,
|
||||
.unk_10 = { .f = 0.0f },
|
||||
.unk_14 = 3,
|
||||
.chaseSpeed = 8.5f,
|
||||
.unk_1C = 60,
|
||||
.unk_20 = 3,
|
||||
.chaseRadius = 100.0f,
|
||||
.unk_28 = { .f = 60.0f },
|
||||
.unk_2C = TRUE,
|
||||
};
|
||||
|
||||
Script N(CleftAI) = SCRIPT({
|
||||
func_80240C90_BDDE40(N(cleftAISettings), 8);
|
||||
});
|
||||
|
||||
NpcSettings N(cleftNpcSettings) = {
|
||||
.unk_00 = { 0x00, 0x00, 0x00, 0x00 },
|
||||
.height = 24,
|
||||
.radius = 24,
|
||||
.otherAI = NULL,
|
||||
.onInteract = NULL,
|
||||
.ai = N(CleftAI),
|
||||
.onHit = EnemyNpcHit,
|
||||
.aux = NULL,
|
||||
.onDefeat = EnemyNpcDefeat,
|
||||
.flags = 0x00000000,
|
||||
.unk_24 = { 0x00, 0x00, 0x00, 0x00 },
|
||||
.level = 15,
|
||||
.unk_2A = 0x0000,
|
||||
};
|
||||
|
||||
StaticNpc N(CleftNPC1) = {
|
||||
.id = 0,
|
||||
.settings = &N(cleftNpcSettings),
|
||||
.pos = { -196.0f, 130.0f, 104.0f },
|
||||
.flags = 0x00000400,
|
||||
.init = NULL,
|
||||
.yaw = 90,
|
||||
.dropFlags = 0x80,
|
||||
.itemDropChance = 0,
|
||||
.heartDrops = STANDARD_HEART_DROPS(3),
|
||||
.flowerDrops = STANDARD_FLOWER_DROPS(2),
|
||||
.minCoinBonus = 1,
|
||||
.maxCoinBonus = 3,
|
||||
.movement = { -196, 130, 104, 50, 30, -32767, 1, -196, 130, 104, 120 },
|
||||
.animations = {
|
||||
NPC_ANIM(cleft, Palette_01, Anim_2),
|
||||
NPC_ANIM(cleft, Palette_01, Anim_6),
|
||||
NPC_ANIM(cleft, Palette_01, Anim_7),
|
||||
NPC_ANIM(cleft, Palette_01, Anim_7),
|
||||
NPC_ANIM(cleft, Palette_01, Anim_2),
|
||||
NPC_ANIM(cleft, Palette_01, Anim_2),
|
||||
NPC_ANIM(cleft, Palette_01, Anim_8),
|
||||
NPC_ANIM(cleft, Palette_01, Anim_8),
|
||||
NPC_ANIM(cleft, Palette_01, Anim_14),
|
||||
NPC_ANIM(cleft, Palette_01, Anim_17),
|
||||
NPC_ANIM(cleft, Palette_01, Anim_13),
|
||||
NPC_ANIM(cleft, Palette_01, Anim_15),
|
||||
NPC_ANIM(cleft, Palette_01, Anim_10),
|
||||
NPC_ANIM(cleft, Palette_01, Anim_11),
|
||||
NPC_ANIM(cleft, Palette_01, Anim_16),
|
||||
NPC_ANIM(cleft, Palette_01, Anim_0),
|
||||
},
|
||||
.unk_1E0 = { 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0 },
|
||||
.extraAnimations = NULL,
|
||||
.tattle = 0,
|
||||
};
|
||||
|
||||
StaticNpc N(CleftNPC2) = {
|
||||
.id = 1,
|
||||
.settings = &N(cleftNpcSettings),
|
||||
.pos = { 641.0f, 268.0f, 202.0f },
|
||||
.flags = 0x00000400,
|
||||
.init = NULL,
|
||||
.yaw = 90,
|
||||
.dropFlags = 0x80,
|
||||
.itemDropChance = 0,
|
||||
.heartDrops = STANDARD_HEART_DROPS(3),
|
||||
.flowerDrops = STANDARD_FLOWER_DROPS(2),
|
||||
.minCoinBonus = 1,
|
||||
.maxCoinBonus = 3,
|
||||
.movement = { 641, 268, 202, 50, 30, -32767, 1, 641, 268, 202, 120 },
|
||||
.animations = {
|
||||
NPC_ANIM(cleft, Palette_01, Anim_2),
|
||||
NPC_ANIM(cleft, Palette_01, Anim_6),
|
||||
NPC_ANIM(cleft, Palette_01, Anim_7),
|
||||
NPC_ANIM(cleft, Palette_01, Anim_7),
|
||||
NPC_ANIM(cleft, Palette_01, Anim_2),
|
||||
NPC_ANIM(cleft, Palette_01, Anim_2),
|
||||
NPC_ANIM(cleft, Palette_01, Anim_8),
|
||||
NPC_ANIM(cleft, Palette_01, Anim_8),
|
||||
NPC_ANIM(cleft, Palette_01, Anim_14),
|
||||
NPC_ANIM(cleft, Palette_01, Anim_17),
|
||||
NPC_ANIM(cleft, Palette_01, Anim_13),
|
||||
NPC_ANIM(cleft, Palette_01, Anim_15),
|
||||
NPC_ANIM(cleft, Palette_01, Anim_10),
|
||||
NPC_ANIM(cleft, Palette_01, Anim_11),
|
||||
NPC_ANIM(cleft, Palette_01, Anim_16),
|
||||
NPC_ANIM(cleft, Palette_01, Anim_0),
|
||||
},
|
||||
.unk_1E0 = { 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0 },
|
||||
.extraAnimations = NULL,
|
||||
.tattle = 0,
|
||||
};
|
||||
|
||||
StaticNpc N(GoombaNPC) = {
|
||||
.id = 2,
|
||||
.settings = &N(goombaNpcSettings),
|
||||
.pos = { 333.0f, 215.0f, 85.0f },
|
||||
.flags = 0x00000400,
|
||||
.init = NULL,
|
||||
.yaw = 90,
|
||||
.dropFlags = 0x80,
|
||||
.itemDropChance = 20,
|
||||
.itemDrops = {
|
||||
{ ItemId_DRIED_SHROOM, 10, 0 },
|
||||
},
|
||||
.heartDrops = STANDARD_HEART_DROPS(2),
|
||||
.flowerDrops = STANDARD_FLOWER_DROPS(2),
|
||||
.minCoinBonus = 0,
|
||||
.maxCoinBonus = 2,
|
||||
.movement = { 333, 215, 85, 40, 30, -32767, 1, 360, 215, 150, 120, 137, 1 },
|
||||
.animations = {
|
||||
NPC_ANIM(goomba, hyper, idle),
|
||||
NPC_ANIM(goomba, hyper, walk),
|
||||
NPC_ANIM(goomba, hyper, run),
|
||||
NPC_ANIM(goomba, hyper, run),
|
||||
NPC_ANIM(goomba, hyper, idle),
|
||||
NPC_ANIM(goomba, hyper, idle),
|
||||
NPC_ANIM(goomba, hyper, pain),
|
||||
NPC_ANIM(goomba, hyper, pain),
|
||||
NPC_ANIM(goomba, hyper, run),
|
||||
NPC_ANIM(goomba, hyper, run),
|
||||
NPC_ANIM(goomba, hyper, run),
|
||||
NPC_ANIM(goomba, hyper, run),
|
||||
NPC_ANIM(goomba, hyper, run),
|
||||
NPC_ANIM(goomba, hyper, run),
|
||||
NPC_ANIM(goomba, hyper, run),
|
||||
NPC_ANIM(goomba, hyper, run),
|
||||
},
|
||||
.unk_1E0 = { 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0 },
|
||||
.extraAnimations = NULL,
|
||||
.tattle = 0,
|
||||
};
|
||||
|
||||
NpcGroupList N(npcGroupList) = {
|
||||
NPC_GROUP(N(CleftNPC1), BATTLE_ID(14, 10, 0, 1)),
|
||||
NPC_GROUP(N(CleftNPC2), BATTLE_ID(14, 13, 0, 1)),
|
||||
NPC_GROUP(N(GoombaNPC), BATTLE_ID(14, 3, 0, 1)),
|
||||
{},
|
||||
};
|
||||
|
||||
// gCameras loading after the offset calculation instead of before
|
||||
#ifdef NON_MATCHING
|
||||
s32 func_80240000_BDD1B0(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing* shape) {
|
||||
PlayerStatus** playerStatus;
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
Camera* camera = CAM(D_8009A634);
|
||||
f32 phi_f20;
|
||||
s32 phi_s0 = 0;
|
||||
|
||||
if (func_800493EC(enemy, 0, aiSettings->alertRadius, aiSettings->unk_10.f)) {
|
||||
phi_s0 = 1;
|
||||
}
|
||||
phi_f20 = 270.0f;
|
||||
if (clamp_angle(get_clamped_angle_diff(camera->currentYaw, npc->yaw)) < 180.0) {
|
||||
phi_f20 = 90.0f;
|
||||
}
|
||||
|
||||
playerStatus = &gPlayerStatusPtr;
|
||||
if (fabsf(get_clamped_angle_diff(phi_f20,
|
||||
atan2(npc->pos.x, npc->pos.z,
|
||||
(*playerStatus)->position.x, (*playerStatus)->position.z))) > 75.0) {
|
||||
phi_s0 = 0;
|
||||
}
|
||||
if (fabsf(npc->pos.y - (*playerStatus)->position.y) >= 40.0f) {
|
||||
phi_s0 = 0;
|
||||
}
|
||||
if (D_8010EBB0.unk_03 == 9) {
|
||||
phi_s0 = 0;
|
||||
}
|
||||
return phi_s0;
|
||||
}
|
||||
#else
|
||||
INCLUDE_ASM(s32, "world/area_arn/arn_02/BDD1B0", func_80240000_BDD1B0, ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing* shape);
|
||||
#endif
|
||||
|
||||
#include "world/common/UnkNpcAIFunc18.inc.c"
|
||||
|
||||
void func_802401D4_BDD384(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing* shape) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
s32 var;
|
||||
|
||||
if (script->functionTemp[1].s <= 0) {
|
||||
script->functionTemp[1].s = aiSettings->unk_14;
|
||||
if (func_800490B4(shape, enemy, aiSettings->alertRadius * 0.85, aiSettings->unk_10.s, 0)) {
|
||||
npc->currentAnim = enemy->animList[9];
|
||||
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var);
|
||||
func_800494C0(npc, 0x2F4, 0x200000);
|
||||
npc->duration = 0xC;
|
||||
script->functionTemp[0].s = 2;
|
||||
}
|
||||
}
|
||||
|
||||
script->functionTemp[1].s--;
|
||||
}
|
||||
|
||||
#include "world/common/UnkNpcAIFunc21.inc.c"
|
||||
|
||||
#include "world/common/UnkNpcAIFunc20.inc.c"
|
||||
|
||||
#include "world/common/UnkNpcAIFunc22.inc.c"
|
||||
|
||||
void func_802404D0_BDD680(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing* shape) {
|
||||
PlayerStatus** playerStatus;
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
s32 var;
|
||||
|
||||
if (func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) {
|
||||
playerStatus = &gPlayerStatusPtr;
|
||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z);
|
||||
script->functionTemp[0].s = 0xC;
|
||||
} else {
|
||||
npc->duration--;
|
||||
if (npc->duration <= 0) {
|
||||
script->functionTemp[1].s--;
|
||||
if (script->functionTemp[1].s > 0) {
|
||||
npc->yaw = clamp_angle(npc->yaw + 180.0f);
|
||||
npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1);
|
||||
} else {
|
||||
fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xC, &var);
|
||||
npc->duration = 0xF;
|
||||
script->functionTemp[0].s = 0x28;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#include "world/common/UnkNpcAIFunc16.inc.c"
|
||||
|
||||
void func_80240694_BDD844(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing* shape) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
PlayerStatus** playerStatus = &gPlayerStatusPtr;
|
||||
|
||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z);
|
||||
if (npc->duration % 3 == 0) {
|
||||
fx_walk_normal(2, npc->pos.x, npc->pos.y, npc->pos.z + 2.0f, 0, 0);
|
||||
}
|
||||
|
||||
npc->duration--;
|
||||
if (npc->duration <= 0) {
|
||||
playerStatus = &gPlayerStatusPtr;
|
||||
|
||||
enemy->unk_10.x = npc->pos.x;
|
||||
enemy->unk_10.y = npc->pos.y;
|
||||
enemy->unk_10.z = npc->pos.z;
|
||||
enemy->unk_07 = 1;
|
||||
npc->moveSpeed = aiSettings->chaseSpeed;
|
||||
npc->duration = dist2D(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z) / npc->moveSpeed + 0.9;
|
||||
if (npc->duration < 15) {
|
||||
npc->duration = 15;
|
||||
}
|
||||
script->functionTemp[0].s = 0x16;
|
||||
}
|
||||
}
|
||||
|
||||
void func_80240834_BDD9E4(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing* shape) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
f32 posX, posY, posZ;
|
||||
s32 phi_s1;
|
||||
|
||||
func_8003D660(npc, 1);
|
||||
npc_move_heading(npc, npc->moveSpeed, npc->yaw);
|
||||
|
||||
phi_s1 = 0;
|
||||
if (is_point_within_region(enemy->territory->shape,
|
||||
enemy->territory->pointX, enemy->territory->pointZ,
|
||||
npc->pos.x, npc->pos.z, enemy->territory->sizeX,
|
||||
enemy->territory->sizeZ)) {
|
||||
phi_s1 = 1;
|
||||
}
|
||||
|
||||
posX = npc->pos.x;
|
||||
posY = npc->pos.y;
|
||||
posZ = npc->pos.z;
|
||||
|
||||
if (func_800DDC44(npc->unk_80, &posX, &posY, &posZ,
|
||||
1.0f, npc->yaw, npc->collisionHeight, npc->collisionRadius)) {
|
||||
phi_s1 = 1;
|
||||
}
|
||||
|
||||
npc->duration--;
|
||||
if (npc->duration <= 0) {
|
||||
phi_s1 = 1;
|
||||
}
|
||||
if (phi_s1) {
|
||||
script->functionTemp[0].s = 4;
|
||||
enemy->unk_07 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void func_80240984_BDDB34(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing* shape) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
|
||||
npc->duration--;
|
||||
if (npc->duration <= 0) {
|
||||
npc->currentAnim = enemy->animList[1];
|
||||
if (enemy->territory->unk_14 < 0) {
|
||||
npc->moveSpeed = aiSettings->moveSpeed;
|
||||
} else {
|
||||
npc->moveSpeed = enemy->territory->unk_14 / 32767.0;
|
||||
}
|
||||
script->functionTemp[0].s = 0x29;
|
||||
}
|
||||
}
|
||||
|
||||
void func_80240A30_BDDBE0(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing* shape) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
PlayerStatus** playerStatus = &gPlayerStatusPtr;
|
||||
|
||||
if (func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) {
|
||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z);
|
||||
script->functionTemp[0].s = 12;
|
||||
} else if (dist2D(npc->pos.x, npc->pos.z, enemy->territory->unk_00.x, enemy->territory->unk_00.z) <= npc->moveSpeed) {
|
||||
npc->duration = 10;
|
||||
script->functionTemp[0].s = 50;
|
||||
} else if (npc->unk_8C == 0) {
|
||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->unk_00.x, enemy->territory->unk_00.z);
|
||||
npc_move_heading(npc, npc->moveSpeed, npc->yaw);
|
||||
}
|
||||
}
|
||||
|
||||
#include "world/common/UnkNpcAIFunc19.inc.c"
|
||||
|
||||
#include "world/common/UnkNpcAIFunc17.inc.c"
|
||||
|
||||
#include "world/common/UnkDurationCheck.inc.c"
|
||||
|
||||
s32 func_80240C90_BDDE40(ScriptInstance *script, NpcAISettings *aiSettings) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
Bytecode* args = script->ptrReadPos;
|
||||
NpcAISettings* npcAI = (NpcAISettings*)get_variable(script, *args++);
|
||||
EnemyTerritoryThing shape;
|
||||
EnemyTerritoryThing* shapePtr = &shape;
|
||||
u32 var;
|
||||
|
||||
enemy->varTable[10] = get_variable(script, *args++);
|
||||
|
||||
shape.unk_00 = 0;
|
||||
shape.shape = enemy->territory->shape;
|
||||
shape.pointX = enemy->territory->pointX;
|
||||
shape.pointZ = enemy->territory->pointZ;
|
||||
shape.sizeX = enemy->territory->sizeX;
|
||||
shape.sizeZ = enemy->territory->sizeZ;
|
||||
shape.unk_34 = 40.0f;
|
||||
shape.unk_1C = 0;
|
||||
|
||||
if (aiSettings != NULL) {
|
||||
script->functionTemp[0].s = NULL;
|
||||
npc->duration = 0;
|
||||
npc->flags &= ~0x800;
|
||||
if (enemy->territory->unk_34 == 0) {
|
||||
npc->flags |= 0x200;
|
||||
npc->flags &= ~0x8;
|
||||
|
||||
} else {
|
||||
npc->flags &= ~0x200;
|
||||
npc->flags |= 0x8;
|
||||
}
|
||||
}
|
||||
|
||||
if (enemy->unk_B0 & 4) {
|
||||
if (enemy->unk_B4 != 0) {
|
||||
return 0;
|
||||
}
|
||||
enemy->unk_B0 &= ~4;
|
||||
}
|
||||
|
||||
if ((u32)script->functionTemp[0].s - 12 < 3 && func_80240000_BDD1B0(script, npcAI, shapePtr)) {
|
||||
script->functionTemp[0].s = 20;
|
||||
}
|
||||
|
||||
switch (script->functionTemp[0].s) {
|
||||
case 0:
|
||||
N(UnkNpcAIFunc18)(script, npcAI, shapePtr);
|
||||
case 1:
|
||||
func_802401D4_BDD384(script, npcAI, shapePtr);
|
||||
if (script->functionTemp[0].s != 2) {
|
||||
return 0;
|
||||
}
|
||||
case 2:
|
||||
N(UnkNpcAIFunc21)(script, npcAI, shapePtr);
|
||||
if (script->functionTemp[0].s != 3) {
|
||||
return 0;
|
||||
}
|
||||
case 3:
|
||||
N(UnkNpcAIFunc20)(script, npcAI, shapePtr);
|
||||
if (script->functionTemp[0].s != 4) {
|
||||
return 0;
|
||||
}
|
||||
case 4:
|
||||
N(UnkNpcAIFunc22)(script, npcAI, shapePtr);
|
||||
case 5:
|
||||
func_802404D0_BDD680(script, npcAI, shapePtr);
|
||||
return 0;
|
||||
case 12:
|
||||
func_80049F7C(script, npcAI, shapePtr);
|
||||
if (script->functionTemp[0].s != 13) {
|
||||
return 0;
|
||||
}
|
||||
case 13:
|
||||
func_8004A124(script, npcAI, shapePtr);
|
||||
if (script->functionTemp[0].s != 14) {
|
||||
return 0;
|
||||
}
|
||||
case 14:
|
||||
npc->duration--;
|
||||
if (npc->duration == 0) {
|
||||
script->functionTemp[0].s = 40;
|
||||
}
|
||||
return 0;
|
||||
case 20:
|
||||
N(UnkNpcAIFunc16)(script, npcAI, shapePtr);
|
||||
case 21:
|
||||
func_80240694_BDD844(script, npcAI, shapePtr);
|
||||
return 0;
|
||||
case 22:
|
||||
func_80240834_BDD9E4(script, npcAI, shapePtr);
|
||||
return 0;
|
||||
case 40:
|
||||
func_80240984_BDDB34(script, npcAI, shapePtr);
|
||||
if (script->functionTemp[0].s != 41) {
|
||||
return 0;
|
||||
}
|
||||
case 41:
|
||||
func_80240A30_BDDBE0(script, npcAI, shapePtr);
|
||||
return 0;
|
||||
case 50:
|
||||
N(UnkNpcAIFunc19)(script, npcAI, shapePtr);
|
||||
case 51:
|
||||
N(UnkNpcAIFunc17)(script, npcAI, shapePtr);
|
||||
if (script->functionTemp[0].s != 52) {
|
||||
return 0;
|
||||
}
|
||||
case 52:
|
||||
N(UnkDurationCheck)(script, npcAI, shapePtr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
30
src/world/area_arn/arn_02/header.c
Normal file
30
src/world/area_arn/arn_02/header.c
Normal file
@ -0,0 +1,30 @@
|
||||
#include "arn_02.h"
|
||||
#include "message_ids.h"
|
||||
|
||||
Vec4f N(entryList)[] = {
|
||||
{ -585.0f, 60.0f, 150.0f, 90.0f },
|
||||
{ 880.0f, 320.0f, 150.0f, 270.0f },
|
||||
};
|
||||
|
||||
MapConfig N(config) = {
|
||||
.main = N(Main),
|
||||
.entryList = N(entryList),
|
||||
.entryCount = ENTRY_COUNT(N(entryList)),
|
||||
.background = &gBackgroundImage,
|
||||
.tattle = MSG_arn_02_tattle,
|
||||
};
|
||||
|
||||
Script N(PlayMusic) = SCRIPT({
|
||||
match SI_SAVE_VAR(0) {
|
||||
< STORY_CH3_TUBBA_WOKE_UP {
|
||||
SetMusicTrack(0, Song_GUSTY_GULCH, 0, 8);
|
||||
}
|
||||
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
|
||||
SetMusicTrack(0, Song_TUBBA_ESCAPE, 0, 8);
|
||||
}
|
||||
else {
|
||||
SetMusicTrack(0, Song_GUSTY_GULCH, 0, 8);
|
||||
}
|
||||
}
|
||||
PlayAmbientSounds(1);
|
||||
});
|
@ -88,7 +88,7 @@ Script N(Script_8024097C) = SCRIPT({
|
||||
Script N(NpcAI_80240B50) = SCRIPT({
|
||||
1:
|
||||
match SI_SAVE_VAR(0) {
|
||||
== 0xFFFFFF86 {
|
||||
== STORY_CH0_FELL_OFF_CLIFF {
|
||||
89:
|
||||
N(UnkPositionFunc)(0xFFFFFF8A, 86, 0xFFFFFFBA, 0xFFFFFFF1);
|
||||
sleep 1;
|
||||
@ -127,7 +127,7 @@ Script N(NpcAI_80240B50) = SCRIPT({
|
||||
sleep 30;
|
||||
SpeakToPlayer(0, 0x9D0008, 0x9D0001, 0, 0xB00A8);
|
||||
func_80240000_8C7F90(0, 5);
|
||||
SI_SAVE_VAR(0) = 0xFFFFFF87;
|
||||
SI_SAVE_VAR(0) = STORY_CH0_GOOMPA_JOINED_PARTY;
|
||||
UseSettingsFrom(0, 0xFFFFFF24, 20, 0xFFFFFFB8);
|
||||
GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
SetPanTarget(0, SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
@ -218,11 +218,11 @@ s32 N(npcGroupList_80241450)[] = {
|
||||
0x00000001, N(npcGroup_80241260), 0x00020000, 0x00000000, 0x00000000, 0x00000000,
|
||||
};
|
||||
|
||||
s32 padding2[] = {0, 0};
|
||||
s32 N(padding2)[] = {0, 0};
|
||||
|
||||
Script N(Script_80241470) = SCRIPT({
|
||||
ModifyColliderFlags(0, 9, 0x7FFFFE00);
|
||||
SI_SAVE_VAR(0) = 0xFFFFFF8B;
|
||||
SI_SAVE_VAR(0) = STORY_CH0_LEFT_THE_PLAYGROUND;
|
||||
});
|
||||
|
||||
Script N(Script_802414A8) = SCRIPT({
|
||||
@ -238,7 +238,7 @@ Script N(Script_802414C8) = SCRIPT({
|
||||
});
|
||||
|
||||
Script N(MakeEntities) = SCRIPT({
|
||||
if (SI_SAVE_VAR(0) < 0xFFFFFF8B) {
|
||||
if (SI_SAVE_VAR(0) < STORY_CH0_LEFT_THE_PLAYGROUND) {
|
||||
MakeEntity(0x802EA10C, 45, 0, 70, 15, 0x80000000);
|
||||
AssignScript(N(Script_80241470));
|
||||
} else {
|
||||
|
@ -6,7 +6,7 @@ Script N(Script_80242340) = SCRIPT({
|
||||
SetCamDistance(0, 700.0);
|
||||
SetCamSpeed(0, 90.0);
|
||||
PanToTarget(0, 0, 1);
|
||||
if (SI_SAVE_VAR(0) >= 0xFFFFFF89) {
|
||||
if (SI_SAVE_VAR(0) >= STORY_CH0_FOUND_HAMMER) {
|
||||
SetPlayerPos(0, 0xFFFFFC18, 0);
|
||||
DisablePlayerInput(1);
|
||||
SetPlayerPos(0xFFFFFF20, 20, 0xFFFFFFB0);
|
||||
|
@ -30,13 +30,13 @@ NpcAISettings N(goombaAISettings) = {
|
||||
.moveTime = 30,
|
||||
.waitTime = 30,
|
||||
.alertRadius = 130.0f,
|
||||
.unk_10 = 0.0f,
|
||||
.unk_10 = { .f = 0.0f },
|
||||
.unk_14 = 1,
|
||||
.chaseSpeed = 2.5f,
|
||||
.unk_1C = 180,
|
||||
.unk_20 = 3,
|
||||
.chaseRadius = 150.0f,
|
||||
.unk_28 = 0.0f,
|
||||
.unk_28 = { .f = 0.0f },
|
||||
.unk_2C = TRUE,
|
||||
};
|
||||
|
||||
@ -188,7 +188,7 @@ StaticNpc N(goombaNpc) = {
|
||||
};
|
||||
|
||||
NpcGroupList N(npcGroupList) = {
|
||||
NPC_GROUP(N(goombaNpc), BATTLE_ID(1, 0, 3)),
|
||||
NPC_GROUP(N(goombaNpc), BATTLE_ID(0, 1, 0, 3)),
|
||||
{},
|
||||
};
|
||||
|
||||
|
@ -44,7 +44,7 @@ Script N(Script_80240198) = SCRIPT({
|
||||
Script N(Main) = SCRIPT({
|
||||
SI_SAVE_VAR(425) = 10;
|
||||
SetSpriteShading(-1);
|
||||
if (SI_SAVE_VAR(0) == 0xFFFFFFC1) {
|
||||
if (SI_SAVE_VAR(0) == STORY_CH2_GOT_PULSE_STONE) {
|
||||
DisablePulseStone(0);
|
||||
}
|
||||
SetCamPerspective(0, 3, 25, 16, 4096);
|
||||
@ -54,7 +54,7 @@ Script N(Main) = SCRIPT({
|
||||
MakeNpcs(0, N(npcGroupList_80240768));
|
||||
await N(MakeEntities);
|
||||
N(SpawnSunEffect)();
|
||||
SetMusicTrack(0, 23, 0, 8);
|
||||
SetMusicTrack(0, Song_DRY_DRY_DESERT, 0, 8);
|
||||
SI_VAR(0) = N(Script_80240198);
|
||||
spawn EnterWalk;
|
||||
});
|
||||
|
@ -53,7 +53,7 @@ Script N(Script_802401F4) = SCRIPT({
|
||||
Script N(Main) = SCRIPT({
|
||||
SI_SAVE_VAR(425) = 10;
|
||||
SetSpriteShading(-1);
|
||||
if (SI_SAVE_VAR(0) == 0xFFFFFFC1) {
|
||||
if (SI_SAVE_VAR(0) == STORY_CH2_GOT_PULSE_STONE) {
|
||||
DisablePulseStone(0);
|
||||
}
|
||||
SetCamPerspective(0, 3, 25, 16, 4096);
|
||||
@ -62,7 +62,7 @@ Script N(Main) = SCRIPT({
|
||||
SetCamLeadPlayer(0, 0);
|
||||
MakeNpcs(0, N(npcGroupList_802407D8));
|
||||
N(SpawnSunEffect)();
|
||||
SetMusicTrack(0, 23, 0, 8);
|
||||
SetMusicTrack(0, Song_DRY_DRY_DESERT, 0, 8);
|
||||
SI_VAR(0) = N(Script_802401F4);
|
||||
spawn EnterWalk;
|
||||
});
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "common.h"
|
||||
#include "map.h"
|
||||
|
||||
void N(UnkDurationCheck)(ScriptInstance* script) {
|
||||
void N(UnkDurationCheck)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing* shape) {
|
||||
Npc* npc = get_npc_unsafe(script->owner1.enemy->npcID);
|
||||
|
||||
npc->duration--;
|
||||
|
@ -14,13 +14,13 @@ void N(UnkNpcAIFunc13_2)(ScriptInstance* script, NpcAISettings* aiSettings, s32
|
||||
tempAngle = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
|
||||
angleDiff = get_clamped_angle_diff(npc->yaw, tempAngle);
|
||||
|
||||
if (aiSettings->unk_10 < fabsf(angleDiff)) {
|
||||
if (aiSettings->unk_10.s < fabsf(angleDiff)) {
|
||||
tempAngle = npc->yaw;
|
||||
|
||||
if (angleDiff < 0.0f) {
|
||||
tempAngle += -aiSettings->unk_10;
|
||||
tempAngle += -aiSettings->unk_10.s;
|
||||
} else {
|
||||
tempAngle += aiSettings->unk_10;
|
||||
tempAngle += aiSettings->unk_10.s;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -297,6 +297,8 @@ class Compile(Transformer):
|
||||
return super().transform(tree)
|
||||
|
||||
def c_identifier(self, tree):
|
||||
if tree.children[0].startswith("STORY_"):
|
||||
return f"{tree.children[0]}"
|
||||
return f"(Bytecode)(&{tree.children[0]})"
|
||||
|
||||
def ESCAPED_STRING(self, str_with_quotes):
|
||||
|
@ -71,16 +71,20 @@ def script_lib(offset):
|
||||
constants = {}
|
||||
def get_constants():
|
||||
global constants
|
||||
valid_enums = { "ItemId", "PlayerAnim", "ActorID", "Event", "SoundId" }
|
||||
valid_defines = { "ItemId", "PlayerAnim", "ActorID", "Event", "SoundId", "Song" }
|
||||
valid_enums = { "StoryProgress" }
|
||||
for enum in valid_defines:
|
||||
constants[enum] = {}
|
||||
for enum in valid_enums:
|
||||
constants[enum] = {}
|
||||
|
||||
include_path = Path(Path(__file__).resolve().parent.parent / "include")
|
||||
enums = Path(include_path / "enums.h").read_text()
|
||||
enums = Path(include_path / "enums.h").read_text().splitlines()
|
||||
|
||||
for line in enums.splitlines():
|
||||
# define stuff
|
||||
for line in enums:
|
||||
this_enum = ""
|
||||
for enum in valid_enums:
|
||||
for enum in valid_defines:
|
||||
if f"#define {enum}_" in line:
|
||||
this_enum = enum
|
||||
break;
|
||||
@ -91,6 +95,32 @@ def get_constants():
|
||||
if " " in id_:
|
||||
id_ = id_.split(" ",1)[0]
|
||||
constants[this_enum][int(id_, 16)] = name
|
||||
|
||||
# enums
|
||||
for i,line in enumerate(enums):
|
||||
if line.startswith("enum "):
|
||||
enum_name = line.split(" ",1)[1].split(" {",1)[0]
|
||||
if enum_name in valid_enums:
|
||||
constants[enum_name] = {}
|
||||
last_num = 0
|
||||
i += 1
|
||||
while "}" not in enums[i]:
|
||||
if not enums[i]:
|
||||
i += 1
|
||||
continue
|
||||
|
||||
name = enums[i].strip()
|
||||
val = last_num+1
|
||||
if "=" in name:
|
||||
name, _, val = name.split(" ")
|
||||
val = int(val[:-1], 0)
|
||||
else:
|
||||
name = name[:-1]
|
||||
|
||||
constants[enum_name][val] = name
|
||||
i += 1
|
||||
last_num = val
|
||||
|
||||
return
|
||||
|
||||
def fix_args(args, info):
|
||||
@ -129,6 +159,9 @@ replace_funcs = {
|
||||
"GetItemPower" :{0:"ItemId"},
|
||||
|
||||
"JumpToGoal" :{0:"ActorID"},
|
||||
|
||||
"MakeEntity" :{5:"ItemId"},
|
||||
"MakeItemEntity" :{0:"ItemId"},
|
||||
|
||||
"PlaySound" :{0:"SoundId"},
|
||||
"PlaySoundAtActor" :{0:"ActorID", 1:"SoundId"},
|
||||
@ -138,10 +171,11 @@ replace_funcs = {
|
||||
"SetActorScale" :{0:"ActorID"},
|
||||
"SetActorYaw" :{0:"ActorID"},
|
||||
"SetAnimation" :{0:"ActorID", 2:"PlayerAnim"},
|
||||
"SetGoalPos" :{0:"ActorID"}
|
||||
"SetGoalPos" :{0:"ActorID"},
|
||||
"SetGoalToHome" :{0:"ActorID"},
|
||||
"SetGoalToTarget" :{0:"ActorID"},
|
||||
"SetJumpAnimations" :{0:"ActorID", 2:"PlayerAnim", 3:"PlayerAnim", 4:"PlayerAnim"},
|
||||
"SetMusicTrack" :{1:"Song"},
|
||||
"SetTargetActor" :{0:"ActorID"},
|
||||
|
||||
"UseIdleAnimation" :{0:"ActorID"},
|
||||
@ -485,7 +519,9 @@ class ScriptDSLDisassembler(ScriptDisassembler):
|
||||
# MULTI: multi-condition(s)
|
||||
# MATCH: match block
|
||||
self.case_stack = []
|
||||
|
||||
# stores the variable type the case is switching on
|
||||
self.case_variable = ""
|
||||
self.save_variable = ""
|
||||
self.was_multi_case = False
|
||||
|
||||
@property
|
||||
@ -501,7 +537,9 @@ class ScriptDSLDisassembler(ScriptDisassembler):
|
||||
if v <= -220000000: return str((v + 230000000) / 1024)
|
||||
elif v <= -200000000: return f"SI_ARRAY_FLAG({v + 210000000})"
|
||||
elif v <= -180000000: return f"SI_ARRAY({v + 190000000})"
|
||||
elif v <= -160000000: return f"SI_SAVE_VAR({v + 170000000})"
|
||||
elif v <= -160000000:
|
||||
self.save_variable = f"SI_SAVE_VAR({v + 170000000})"
|
||||
return self.save_variable
|
||||
elif v <= -140000000: return f"SI_AREA_VAR({v + 150000000})"
|
||||
elif v <= -120000000: return f"SI_SAVE_FLAG({v + 130000000})"
|
||||
elif v <= -100000000: return f"SI_AREA_FLAG({v + 110000000})"
|
||||
@ -524,6 +562,28 @@ class ScriptDSLDisassembler(ScriptDisassembler):
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
def replace_enum(self, var, case=False):
|
||||
varO = self.var(var)
|
||||
if case:
|
||||
self.save_variable = ""
|
||||
|
||||
try:
|
||||
var = int(varO, 0)
|
||||
except Exception:
|
||||
return varO
|
||||
|
||||
if var > 0x10000000:
|
||||
var -= 0x100000000
|
||||
|
||||
if ((case and self.case_variable == "SI_SAVE_VAR(0)") or
|
||||
(not case and self.save_variable == "SI_SAVE_VAR(0)")):
|
||||
|
||||
if var in constants["StoryProgress"]:
|
||||
return constants["StoryProgress"][var]
|
||||
|
||||
|
||||
return varO
|
||||
|
||||
def disassemble_command(self, opcode, argc, argv):
|
||||
# write case block braces
|
||||
if self.in_case == "CASE" or self.in_case == "MULTI":
|
||||
@ -552,6 +612,10 @@ class ScriptDSLDisassembler(ScriptDisassembler):
|
||||
self.indent -= 1
|
||||
self.write_line("}")
|
||||
|
||||
#print(f"Op 0x{opcode:2X} saved_var \"{self.save_variable}\" case_var \"{self.case_variable}\"")
|
||||
if self.in_case and 0x16 <= opcode <= 0x1B and self.case_variable == "SI_SAVE_VAR(0)":
|
||||
argv[0] = self.replace_enum(argv[0], case=True)
|
||||
|
||||
if opcode == 0x01:
|
||||
if self.out.endswith("return;\n"):
|
||||
# implicit return; break
|
||||
@ -584,22 +648,52 @@ class ScriptDSLDisassembler(ScriptDisassembler):
|
||||
elif opcode == 0x08: self.write_line(f"sleep {self.var(argv[0])};")
|
||||
elif opcode == 0x09: self.write_line(f"sleep {self.var(argv[0])} secs;")
|
||||
elif opcode == 0x0A:
|
||||
self.write_line(f"if ({self.var(argv[0])} == {self.var(argv[1])}) {{")
|
||||
varA = self.replace_enum(argv[0])
|
||||
varB = self.replace_enum(argv[1])
|
||||
if varB == "SI_SAVE_VAR(0)":
|
||||
varA = self.replace_enum(argv[0])
|
||||
self.write_line(f"if ({varA} == {varB}) {{")
|
||||
self.save_variable = ""
|
||||
self.indent += 1
|
||||
elif opcode == 0x0B:
|
||||
self.write_line(f"if ({self.var(argv[0])} != {self.var(argv[1])}) {{")
|
||||
varA = self.replace_enum(argv[0])
|
||||
varB = self.replace_enum(argv[1])
|
||||
if varB == "SI_SAVE_VAR(0)":
|
||||
varA = self.replace_enum(argv[0])
|
||||
self.write_line(f"if ({varA} != {varB}) {{")
|
||||
self.save_variable = ""
|
||||
self.indent += 1
|
||||
elif opcode == 0x0C:
|
||||
self.write_line(f"if ({self.var(argv[0])} < {self.var(argv[1])}) {{")
|
||||
varA = self.replace_enum(argv[0])
|
||||
varB = self.replace_enum(argv[1])
|
||||
if varB == "SI_SAVE_VAR(0)":
|
||||
varA = self.replace_enum(argv[0])
|
||||
self.write_line(f"if ({varA} < {varB}) {{")
|
||||
self.save_variable = ""
|
||||
self.indent += 1
|
||||
elif opcode == 0x0D:
|
||||
self.write_line(f"if ({self.var(argv[0])} > {self.var(argv[1])}) {{")
|
||||
varA = self.replace_enum(argv[0])
|
||||
varB = self.replace_enum(argv[1])
|
||||
if varB == "SI_SAVE_VAR(0)":
|
||||
varA = self.replace_enum(argv[0])
|
||||
self.write_line(f"if ({varA} > {varB}) {{")
|
||||
self.save_variable = ""
|
||||
self.indent += 1
|
||||
elif opcode == 0x0E:
|
||||
self.write_line(f"if ({self.var(argv[0])} <= {self.var(argv[1])}) {{")
|
||||
varA = self.replace_enum(argv[0])
|
||||
varB = self.replace_enum(argv[1])
|
||||
if varB == "SI_SAVE_VAR(0)":
|
||||
varA = self.replace_enum(argv[0])
|
||||
self.write_line(f"if ({varA} <= {varB}) {{")
|
||||
self.save_variable = ""
|
||||
self.indent += 1
|
||||
elif opcode == 0x0F:
|
||||
self.write_line(f"if ({self.var(argv[0])} >= {self.var(argv[1])}) {{")
|
||||
varA = self.replace_enum(argv[0])
|
||||
varB = self.replace_enum(argv[1])
|
||||
if varB == "SI_SAVE_VAR(0)":
|
||||
varA = self.replace_enum(argv[0])
|
||||
self.write_line(f"if ({varA} >= {varB}) {{")
|
||||
self.save_variable = ""
|
||||
self.indent += 1
|
||||
elif opcode == 0x10:
|
||||
self.write_line(f"if ({self.var(argv[0])} & {self.var(argv[1])}) {{")
|
||||
@ -617,29 +711,31 @@ class ScriptDSLDisassembler(ScriptDisassembler):
|
||||
elif opcode == 0x14:
|
||||
self.write_line(f"match {self.var(argv[0])} {{")
|
||||
self.indent += 1
|
||||
self.case_variable = self.var(argv[0])
|
||||
self.case_stack.append("MATCH")
|
||||
elif opcode == 0x15:
|
||||
self.write_line(f"matchc {self.var(argv[0])} {{")
|
||||
self.indent += 1
|
||||
self.case_variable = self.var(argv[0])
|
||||
self.case_stack.append("MATCH")
|
||||
elif opcode == 0x16:
|
||||
self.case_stack.append("CASE")
|
||||
self.write(f"== {self.var(argv[0])}")
|
||||
self.write(f"== {argv[0]}")
|
||||
elif opcode == 0x17:
|
||||
self.case_stack.append("CASE")
|
||||
self.write(f"!= {self.var(argv[0])}")
|
||||
self.write(f"!= {argv[0]}")
|
||||
elif opcode == 0x18:
|
||||
self.case_stack.append("CASE")
|
||||
self.write(f"< {self.var(argv[0])}")
|
||||
self.write(f"< {argv[0]}")
|
||||
elif opcode == 0x19:
|
||||
self.case_stack.append("CASE")
|
||||
self.write(f"> {self.var(argv[0])}")
|
||||
self.write(f"> {argv[0]}")
|
||||
elif opcode == 0x1A:
|
||||
self.case_stack.append("CASE")
|
||||
self.write(f"<= {self.var(argv[0])}")
|
||||
self.write(f"<= {argv[0]}")
|
||||
elif opcode == 0x1B:
|
||||
self.case_stack.append("CASE")
|
||||
self.write(f">= {self.var(argv[0])}")
|
||||
self.write(f">= {argv[0]}")
|
||||
elif opcode == 0x1C:
|
||||
self.case_stack.append("CASE")
|
||||
self.write(f"else")
|
||||
@ -677,8 +773,13 @@ class ScriptDSLDisassembler(ScriptDisassembler):
|
||||
assert self.case_stack.pop() == "MATCH"
|
||||
|
||||
self.indent -= 1
|
||||
self.case_variable = ""
|
||||
self.write_line("}")
|
||||
elif opcode == 0x24: self.write_line(f"{self.var(argv[0])} = {self.var(argv[1])};")
|
||||
elif opcode == 0x24:
|
||||
varA = self.replace_enum(argv[0])
|
||||
varB = self.replace_enum(argv[1])
|
||||
self.save_variable = ""
|
||||
self.write_line(f"{varA} = {varB};")
|
||||
elif opcode == 0x25: self.write_line(f"{self.var(argv[0])} =c 0x{argv[1]:X};")
|
||||
elif opcode == 0x26:
|
||||
lhs = self.var(argv[1])
|
||||
@ -766,24 +867,44 @@ class ScriptDSLDisassembler(ScriptDisassembler):
|
||||
raise UnsupportedScript(f"DSL does not support script opcode 0x{opcode:X}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
if len(sys.argv) <= 1:
|
||||
print("usage: ./disasm_script.py <file> [offset]")
|
||||
exit()
|
||||
import argparse
|
||||
|
||||
file = sys.argv[1]
|
||||
offset = eval(sys.argv[2]) if len(sys.argv) >= 3 else 0
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("file", type=str, help="File to dissassemble from")
|
||||
parser.add_argument("--o", "-o", type=lambda x: int(x, 0), default=0, dest="offset", required=False, help="Offset to start dissassembling from")
|
||||
parser.add_argument("--e", "-e", type=lambda x: int(x, 0), default=0, dest="end", required=False, help="End offset to stop dissassembling from.\nOnly used as a way to find valid scripts.")
|
||||
|
||||
with open(file, "rb") as f:
|
||||
get_constants()
|
||||
f.seek(offset)
|
||||
args = parser.parse_args()
|
||||
|
||||
get_constants()
|
||||
|
||||
if args.end > args.offset:
|
||||
with open(args.file, "rb") as f:
|
||||
while args.offset < args.end:
|
||||
f.seek(args.offset)
|
||||
|
||||
script = ScriptDSLDisassembler(f)
|
||||
try:
|
||||
script_text = script.disassemble()
|
||||
if script.instructions > 1:
|
||||
print(f"Valid script found at 0x{args.offset:X}")
|
||||
args.offset = script.end_pos
|
||||
else:
|
||||
args.offset += 4
|
||||
except Exception:
|
||||
args.offset += 4
|
||||
else:
|
||||
with open(args.file, "rb") as f:
|
||||
f.seek(args.offset)
|
||||
|
||||
try:
|
||||
script = ScriptDSLDisassembler(f)
|
||||
script_text = script.disassemble()
|
||||
try:
|
||||
script_text = script.disassemble()
|
||||
|
||||
print(f"Script read from 0x{script.start_pos:X} to 0x{script.end_pos:X} "
|
||||
f"(0x{script.end_pos - script.start_pos:X} bytes, {script.instructions} instructions)")
|
||||
print()
|
||||
print(script_text, end="")
|
||||
except UnsupportedScript:
|
||||
print(ScriptDisassembler(f).disassemble(), end="")
|
||||
print(f"Script read from 0x{script.start_pos:X} to 0x{script.end_pos:X} "
|
||||
f"(0x{script.end_pos - script.start_pos:X} bytes, {script.instructions} instructions)")
|
||||
print()
|
||||
print(script_text, end="")
|
||||
|
||||
except UnsupportedScript:
|
||||
print(ScriptDisassembler(f).disassemble(), end="")
|
||||
|
539
tools/make_npc_structs.py
Normal file
539
tools/make_npc_structs.py
Normal file
@ -0,0 +1,539 @@
|
||||
from pathlib import Path
|
||||
import argparse
|
||||
from struct import unpack_from
|
||||
|
||||
constants = {}
|
||||
def get_constants():
|
||||
global constants
|
||||
valid_enums = { "ItemId", "PlayerAnim", "ActorID", "Event", "SoundId" }
|
||||
for enum in valid_enums:
|
||||
constants[enum] = {}
|
||||
constants["NPC_SPRITE"] = {}
|
||||
|
||||
include_path = Path(Path(__file__).resolve().parent.parent / "include")
|
||||
enums = Path(include_path / "enums.h").read_text()
|
||||
|
||||
for line in enums.splitlines():
|
||||
this_enum = ""
|
||||
for enum in valid_enums:
|
||||
if f"#define {enum}_" in line:
|
||||
this_enum = enum
|
||||
break;
|
||||
|
||||
if this_enum:
|
||||
name = line.split(" ",2)[1]
|
||||
id_ = line.split("0x", 1)[1]
|
||||
if " " in id_:
|
||||
id_ = id_.split(" ",1)[0]
|
||||
constants[this_enum][int(id_, 16)] = name
|
||||
|
||||
sprite_path = Path(Path(__file__).resolve().parent.parent / "ver" / "current" / "build" / "include" / "sprite" / "npc")
|
||||
for file in sprite_path.iterdir():
|
||||
fd = file.read_text()
|
||||
for line in fd.splitlines():
|
||||
if "#define _NPC_SPRITE_" in line:
|
||||
enum = "NPC_SPRITE"
|
||||
elif "#define _NPC_PALETTE_" in line:
|
||||
enum = "NPC_PALETTE"
|
||||
elif "#define _NPC_ANIM_" in line:
|
||||
enum = "NPC_ANIM"
|
||||
else:
|
||||
continue
|
||||
|
||||
name = line.split(" ",2)[1]
|
||||
id_ = line.split("0x", 1)[1]
|
||||
if " " in id_:
|
||||
id_ = id_.split(" ",1)[0]
|
||||
name = name.split(f"_{enum}_", 1)[1]
|
||||
if enum == "NPC_SPRITE":
|
||||
saved_name = name
|
||||
saved_id = id_
|
||||
else:
|
||||
name = name.rsplit(f"{saved_name}_")[1]
|
||||
|
||||
if enum == "NPC_SPRITE":
|
||||
if int(id_, 16) not in constants["NPC_SPRITE"]:
|
||||
constants[enum][int(id_, 16)] = {"name":"", "palettes":{}, "anims":{}}
|
||||
constants[enum][int(id_, 16)]["name"] = name
|
||||
elif enum == "NPC_PALETTE":
|
||||
constants["NPC_SPRITE"][int(saved_id, 16)]["palettes"][int(id_, 16)] = name
|
||||
elif enum == "NPC_ANIM":
|
||||
constants["NPC_SPRITE"][int(saved_id, 16)]["anims"][int(id_, 16)] = name
|
||||
return
|
||||
|
||||
STRUCTS = {}
|
||||
|
||||
def parse_var(line):
|
||||
#print(f"Parsing {line}")
|
||||
if "*/ " in line:
|
||||
line = line.split("*/ ",1)[1]
|
||||
line = line.split(";",1)[0].strip()
|
||||
|
||||
if "," in line or "(*" in line:
|
||||
return (None, None, None, None)
|
||||
elif "union " in line:
|
||||
return ("union", None, None, None)
|
||||
|
||||
#print(f"Parsed {line}")
|
||||
if " " in line:
|
||||
if line.startswith("struct "):
|
||||
struct, type_, name = line.split(" ")
|
||||
else:
|
||||
type_, name = line.split(" ")
|
||||
else:
|
||||
type_ = "function"
|
||||
name = line.split("(", 1)[0]
|
||||
count = 1
|
||||
if "[" in name:
|
||||
name, *count = name.split("[")
|
||||
counts = 1
|
||||
count.reverse()
|
||||
for dim in count:
|
||||
counts *= int(dim[:-1], 0)
|
||||
count = counts
|
||||
|
||||
is_ptr = "*" in type_ or type_ == "UNK_PTR"
|
||||
return (type_, name, count, is_ptr)
|
||||
|
||||
def parse_file(filename):
|
||||
fd = filename.read_text().splitlines()
|
||||
i = 0
|
||||
while i < len(fd):
|
||||
#supported = [f"typedef struct {x}" in fd[i] for x in SUPPORTED_STRUCTS]
|
||||
#if any(supported):
|
||||
if "typedef struct " in fd[i]:
|
||||
#supported_name = [SUPPORTED_STRUCTS[i] for i,x in enumerate(supported) if x][0]
|
||||
supported_name = fd[i].split("typedef struct ", 1)[1].split(" {", 1)[0]
|
||||
if supported_name == "{":
|
||||
supported_name = ""
|
||||
#print(f"Parsing struct \"{supported_name}\"")
|
||||
|
||||
struct_to_add = []
|
||||
i += 1
|
||||
while ("} " + f"{supported_name.upper()}") not in fd[i].split(";",1)[0].upper():
|
||||
type_, name, count, ptr = parse_var(fd[i])
|
||||
|
||||
if type_ == None:
|
||||
i += 1
|
||||
continue
|
||||
|
||||
union = []
|
||||
if type_ == "union":
|
||||
i += 1
|
||||
while "}" not in fd[i]:
|
||||
type_, name, count, ptr = parse_var(fd[i])
|
||||
union.append({"type":type_, "name": name, "num":count, "ptr":ptr})
|
||||
i += 1
|
||||
name = fd[i].split("}", 1)[1].split(";", 1)[0]
|
||||
|
||||
#print(supported_name, type_, name, count)
|
||||
struct_to_add.append({"type":type_, "name": name, "num":count, "ptr":ptr, "union":union})
|
||||
|
||||
i += 1
|
||||
#print(f"Broke on line {fd[i]}")
|
||||
#print()
|
||||
if supported_name == "":
|
||||
supported_name = fd[i].split("} ",1)[1].split(";",1)[0]
|
||||
if "[" in supported_name:
|
||||
supported_name = supported_name[:-2]
|
||||
STRUCTS[supported_name] = struct_to_add
|
||||
i += 1
|
||||
|
||||
def get_structs():
|
||||
parse_file(Path(Path(__file__).parent.parent / "include" / "map.h"))
|
||||
parse_file(Path(Path(__file__).parent.parent / "include" / "common_structs.h"))
|
||||
|
||||
def get_vals(fd, offset, var):
|
||||
out = []
|
||||
arr = []
|
||||
for i in range(var["num"]):
|
||||
if var["type"] in STRUCTS:
|
||||
type_ = "struct"
|
||||
data = []
|
||||
for var2 in STRUCTS[var["type"]]:
|
||||
out3, offset = get_vals(fd, offset, var2)
|
||||
data.extend(out3)
|
||||
#if var["num"] == 1:
|
||||
# out.extend(out2)
|
||||
#else:
|
||||
#out.append(out2)
|
||||
else:
|
||||
type_ = "int"
|
||||
if var["type"] == "s8" or var["type"] == "char":
|
||||
if var["type"] == "char":
|
||||
type_ = "hex"
|
||||
data = unpack_from('>b', fd, offset)[0]
|
||||
offset += 1
|
||||
elif var["type"] == "u8":
|
||||
data = unpack_from('>B', fd, offset)[0]
|
||||
offset += 1
|
||||
elif var["type"] == "s16" or var["type"] in ("ItemId"):
|
||||
offset += offset % 2
|
||||
data = unpack_from('>h', fd, offset)[0]
|
||||
offset += 2
|
||||
elif var["type"] == "u16":
|
||||
offset += offset % 2
|
||||
data = unpack_from('>H', fd, offset)[0]
|
||||
offset += 2
|
||||
elif var["type"] == "s32" or var["type"] in ("NpcId", "NpcAnimID", "MessageID"):
|
||||
poff = offset
|
||||
offset += offset % 4
|
||||
data = unpack_from('>i', fd, offset)[0]
|
||||
offset += 4
|
||||
elif var["type"] == "u32":
|
||||
offset += offset % 4
|
||||
data = unpack_from('>I', fd, offset)[0]
|
||||
offset += 4
|
||||
elif var["type"] == "f32":
|
||||
offset += offset % 4
|
||||
data = unpack_from('>f', fd, offset)[0]
|
||||
type_ = "float"
|
||||
offset += 4
|
||||
elif var["type"] == "X32":
|
||||
offset += offset % 4
|
||||
data = unpack_from('>f', fd, offset)[0]
|
||||
type_ = "float"
|
||||
if data < -1000.0 or data > 1000.0:
|
||||
type_ = "int"
|
||||
data = unpack_from('>i', fd, offset)[0]
|
||||
offset += 4
|
||||
elif var["ptr"]:
|
||||
offset += offset % 4
|
||||
data = unpack_from('>I', fd, offset)[0]
|
||||
type_ = "ptr"
|
||||
offset += 4
|
||||
else:
|
||||
print(f"Unknown data type \"{var['type']}\"")
|
||||
exit()
|
||||
if var["num"] == 1:
|
||||
out.append({"name":var["name"], "type":type_, "data":data})
|
||||
else:
|
||||
arr.append({"name":var["name"], "type":type_, "data":data})
|
||||
|
||||
if var["num"] > 1:
|
||||
out.append(arr)
|
||||
return out, offset
|
||||
|
||||
def INDENT(depth):
|
||||
return f" " * depth
|
||||
|
||||
def print_data(vals, indent, needs_name, is_array=False, is_struct=False):
|
||||
out = []
|
||||
for val in vals:
|
||||
line = ""
|
||||
if needs_name:
|
||||
line = INDENT(indent)
|
||||
#print(val)
|
||||
# array
|
||||
if type(val) is list:
|
||||
line += f".{val[0]['name']} = " + "{ "
|
||||
struct = type(val[0]["data"]) is list
|
||||
line += ", ".join(print_data(val, indent + 1, needs_name=False, is_array=True, is_struct=struct))
|
||||
if struct:
|
||||
line += "\n" + INDENT(indent) + "},"
|
||||
else:
|
||||
line += " },"
|
||||
else:
|
||||
if needs_name:
|
||||
line += f".{val['name']} = "
|
||||
if type(val["data"]) is list:
|
||||
if is_struct:
|
||||
line += "\n"
|
||||
line += INDENT(indent)
|
||||
line += "{ "
|
||||
for x,val2 in enumerate(val["data"]):
|
||||
if x > 0:
|
||||
line += ", "
|
||||
#line += f".{val2['name']} = "
|
||||
if val2["type"] == "float":
|
||||
line += f"{val2['data']:.01f}f"
|
||||
elif val2["type"] == "hex":
|
||||
line += f"0x{val2['data']:X}"
|
||||
elif val2["type"] == "ptr":
|
||||
if val2["data"] == 0:
|
||||
line += f"NULL"
|
||||
else:
|
||||
line += f"0x{val2['data']:08X}"
|
||||
else:
|
||||
line += f"{val2['data']}"
|
||||
line += " }"
|
||||
if not is_array:
|
||||
line += ","
|
||||
else:
|
||||
|
||||
if "flags" in val["name"].lower() or "animations" in val["name"].lower():
|
||||
if val["name"] == "flags":
|
||||
val["type"] = "ptr"
|
||||
elif val["name"] == "dropFlags":
|
||||
val["type"] = "hex"
|
||||
val["data"] = abs(val["data"])
|
||||
|
||||
if val["type"] == "float":
|
||||
line += f"{val['data']:.01f}f"
|
||||
elif val["type"] == "hex":
|
||||
line += f"0x{val['data']:X}"
|
||||
elif val["type"] == "ptr":
|
||||
if val["data"] == 0:
|
||||
line += f"NULL"
|
||||
else:
|
||||
line += f"0x{val['data']:08X}"
|
||||
else:
|
||||
line += f"{val['data']}"
|
||||
|
||||
if not (is_array or is_struct):
|
||||
line += ","
|
||||
|
||||
out.append(line)
|
||||
|
||||
return out
|
||||
|
||||
def output_type2(fd, offset, var):
|
||||
vals = []
|
||||
for var in STRUCTS[args.type]:
|
||||
tmp, offset = get_vals(fd, offset, var)
|
||||
vals.extend(tmp)
|
||||
|
||||
#print(vals)
|
||||
#print()
|
||||
out = [f"{args.type} = " + "{"]
|
||||
out.extend(print_data(vals, 1, True))
|
||||
out.append("};")
|
||||
#print("END======")
|
||||
#print("\n".join(out))
|
||||
return "\n".join(out)
|
||||
|
||||
def check_list(vals, depth = 0):
|
||||
for x,val in enumerate(vals):
|
||||
if type(val) == list:
|
||||
if check_list(val, depth + 1):
|
||||
return True
|
||||
elif val != 0:
|
||||
return True
|
||||
return False
|
||||
|
||||
def recurse_check_list(vals):
|
||||
res = 0
|
||||
for x,val in enumerate(vals):
|
||||
if type(val) == list:
|
||||
if check_list(val, 1):
|
||||
return len(vals) - x
|
||||
elif val != 0:
|
||||
return len(vals) - x
|
||||
return -1
|
||||
|
||||
def get_single_struct_vals(fd, i):
|
||||
vals = []
|
||||
if not fd[i].rstrip().endswith("},"):
|
||||
# must be a sub-struct over multiple lines
|
||||
old_i = i
|
||||
i += 1
|
||||
while not ("}," in fd[i] and "." in fd[i+1]):
|
||||
temp = fd[i].split("{",1)[1].split("}",1)[0].split(", ")
|
||||
a = []
|
||||
for x in temp:
|
||||
x = x.strip()
|
||||
if x != "":
|
||||
a.append(int(x, 0))
|
||||
vals.append(a)
|
||||
i += 1
|
||||
else:
|
||||
# single line
|
||||
temp = fd[i].split("{",1)[1].split("}",1)[0].split(", ")
|
||||
a = []
|
||||
for x in temp:
|
||||
x = x.strip()
|
||||
if x != "":
|
||||
a.append(int(x, 0))
|
||||
vals.extend(a)
|
||||
return vals, i
|
||||
|
||||
def cull_struct(fd, i):
|
||||
out = []
|
||||
vals = []
|
||||
#print(f"Culling Starting at {fd[i]}")
|
||||
if not fd[i].rstrip().endswith("},"):
|
||||
# must be a sub-struct over multiple lines
|
||||
old_i = i
|
||||
vals, i = get_single_struct_vals(fd, i)
|
||||
|
||||
# reverse and cull entries of only zeros
|
||||
x = recurse_check_list(vals[::-1])
|
||||
#print(f"Found first index of empty values at idx {x}, vals: {vals}")
|
||||
if x < 0:
|
||||
#print(f"Ending at {fd[i]}")
|
||||
return None, i
|
||||
|
||||
out.append(fd[old_i])
|
||||
old_i += 1
|
||||
for y in range(x):
|
||||
out.append(fd[old_i])
|
||||
old_i += 1
|
||||
|
||||
#print(f"Ending at {fd[i]}")
|
||||
else:
|
||||
prefix = fd[i].split("{",1)[0] + "{ "
|
||||
suffix = " },"
|
||||
|
||||
vals, i = get_single_struct_vals(fd, i)
|
||||
|
||||
# reverse and cull entries of only zeros
|
||||
x = recurse_check_list(vals[::-1])
|
||||
#print(f"Found first index of empty values at idx {x}, vals: {vals}")
|
||||
if x < 0:
|
||||
#print(f"Ending at {fd[i]}")
|
||||
return None, i
|
||||
|
||||
#out.append(prefix)
|
||||
temp = ""
|
||||
for z,y in enumerate(range(x)):
|
||||
if z > 0:
|
||||
prefix += ", "
|
||||
prefix += f"{vals[y]}"
|
||||
out.append(prefix + suffix)
|
||||
#print(f"Ending at {fd[i]}")
|
||||
return "\n".join(out), i
|
||||
|
||||
def MacroReplaceStaticNPC(fd):
|
||||
replace_cull = { "unk_1C", "movement" }
|
||||
fd = fd.splitlines()
|
||||
out = []
|
||||
i = 0
|
||||
while i < len(fd):
|
||||
if any(f".{x}" in fd[i] for x in replace_cull):
|
||||
vals, i = cull_struct(fd, i)
|
||||
if vals:
|
||||
out.append(vals)
|
||||
|
||||
i += 1
|
||||
continue
|
||||
|
||||
if ".itemDrops" in fd[i]:
|
||||
vals, x = cull_struct(fd, i)
|
||||
|
||||
indent = len(fd[i].split(".",1)[0]) // 4
|
||||
new_line = fd[i].split("{",1)[0] + "{\n"
|
||||
|
||||
if not vals:
|
||||
i = x
|
||||
i += 1
|
||||
continue
|
||||
|
||||
vals += "\n},\n."
|
||||
vals, _ = get_single_struct_vals(vals.splitlines(), 0)
|
||||
|
||||
added_item = False
|
||||
for item in vals:
|
||||
if item[0] == 0:
|
||||
continue
|
||||
|
||||
added_item = True
|
||||
item_name = constants["ItemId"][item[0]]
|
||||
new_line += " " * (indent+1) + "{ " + item_name + f", {item[1]}, {item[2]}" + " },\n"
|
||||
|
||||
if added_item:
|
||||
new_line += " " * indent + "},"
|
||||
|
||||
out.append(new_line)
|
||||
i = x
|
||||
|
||||
elif ".animations" in fd[i]:
|
||||
indent = len(fd[i].split(".",1)[0]) // 4
|
||||
new_line = fd[i].split("{",1)[0] + "{\n"
|
||||
|
||||
vals, x = get_single_struct_vals(fd, i)
|
||||
for val in vals:
|
||||
sprite_id = (val & 0x00FF0000) >> 16
|
||||
palette_id = (val & 0x0000FF00) >> 8
|
||||
anim_id = (val & 0x000000FF) >> 0
|
||||
sprite = constants["NPC_SPRITE"][sprite_id]["name"]
|
||||
palette = constants["NPC_SPRITE"][sprite_id]["palettes"][palette_id]
|
||||
anim = constants["NPC_SPRITE"][sprite_id]["anims"][anim_id]
|
||||
new_line += " " * (indent+1) + f"NPC_ANIM({sprite}, {palette}, {anim}),\n"
|
||||
new_line += " " * indent + "},"
|
||||
out.append(new_line)
|
||||
i = x
|
||||
|
||||
elif ".heartDrops" in fd[i] or ".flowerDrops" in fd[i]:
|
||||
vals, x = get_single_struct_vals(fd, i)
|
||||
|
||||
new_line = fd[i].split("{",1)[0]
|
||||
|
||||
attempts = vals[0][2]
|
||||
|
||||
if ".heartDrops" in fd[i]:
|
||||
if round(vals[0][1] / 327.67, 2) == 70 and round(vals[0][3] / 327.67, 2) == 50:
|
||||
new_line += f"STANDARD_HEART_DROPS({attempts}),"
|
||||
elif round(vals[0][1] / 327.67, 2) == 80 and round(vals[0][3] / 327.67, 2) == 50:
|
||||
new_line += f"GENEROUS_HEART_DROPS({attempts}),"
|
||||
elif round(vals[0][1] / 327.67, 2) == 80 and round(vals[0][3] / 327.67, 2) == 60:
|
||||
new_line += f"GENEROUS_WHEN_LOW_HEART_DROPS({attempts}),"
|
||||
else:
|
||||
print(f"Unknown heart drop macro, values were {round(vals[0][1] / 327.67, 2)} and {round(vals[0][3] / 327.67, 2)}")
|
||||
exit()
|
||||
else:
|
||||
if round(vals[0][1] / 327.67, 2) == 50 and round(vals[0][3] / 327.67, 2) == 40:
|
||||
new_line += f"STANDARD_FLOWER_DROPS({attempts}),"
|
||||
elif round(vals[0][1] / 327.67, 2) == 70 and round(vals[0][3] / 327.67, 2) == 50:
|
||||
new_line += f"GENEROUS_WHEN_LOW_FLOWER_DROPS({attempts}),"
|
||||
elif round(vals[0][1] / 327.67, 2) == 40 and round(vals[0][3] / 327.67, 2) == 40:
|
||||
new_line += f"REDUCED_FLOWER_DROPS({attempts}),"
|
||||
else:
|
||||
print(f"Unknown heart drop macro, values were {round(vals[0][1] / 327.67, 2)} and {round(vals[0][3] / 327.67, 2)}")
|
||||
exit()
|
||||
|
||||
out.append(new_line)
|
||||
i = x
|
||||
|
||||
else:
|
||||
out.append(fd[i])
|
||||
i += 1
|
||||
return "\n".join(out)
|
||||
|
||||
def MacroReplaceNpcSettings(fd):
|
||||
replace_cull = { "unk_00", "unk_24" }
|
||||
fd = fd.splitlines()
|
||||
out = []
|
||||
i = 0
|
||||
while i < len(fd):
|
||||
if any(f".{x}" in fd[i] for x in replace_cull):
|
||||
vals, i = cull_struct(fd, i)
|
||||
if vals:
|
||||
out.append(vals)
|
||||
else:
|
||||
out.append(fd[i])
|
||||
i += 1
|
||||
return "\n".join(out)
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("file", type=str, help="File to decompile struct from")
|
||||
parser.add_argument("offset", type=lambda x: int(x, 0), help="Offset to decompile struct from")
|
||||
parser.add_argument("type", type=str, help="Struct type to decompile")
|
||||
args = parser.parse_args()
|
||||
|
||||
get_constants()
|
||||
get_structs()
|
||||
|
||||
if args.type not in STRUCTS:
|
||||
print(f"Unknown struct type {args.type}")
|
||||
exit()
|
||||
|
||||
'''
|
||||
out = [f"{args.type} = " + "{\n"]
|
||||
offset = args.offset
|
||||
for var in STRUCTS[args.type]:
|
||||
line, offset = output_type(fd, offset, var, 1)
|
||||
out.append(line)
|
||||
out.append("};")
|
||||
'''
|
||||
|
||||
fd = Path(args.file).resolve().read_bytes()
|
||||
out = output_type2(fd, args.offset, STRUCTS[args.type])
|
||||
|
||||
if args.type.lower() == "staticnpc":
|
||||
print(MacroReplaceStaticNPC(out))
|
||||
elif args.type.lower() == "npcaisettings":
|
||||
print(out)
|
||||
elif args.type.lower() == "npcsettings":
|
||||
print(MacroReplaceNpcSettings(out))
|
||||
else:
|
||||
print(f"Add me type: {args.type}")
|
@ -2,5 +2,4 @@
|
||||
|
||||
.section .data
|
||||
|
||||
glabel D_80240FE0_BDE190
|
||||
.word 0xC4124000, 0x42700000, 0x43160000, 0x42B40000, 0x445C0000, 0x43A00000, 0x43160000, 0x43870000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x802411F0, D_80240FE0_BDE190, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, func_80200000, 0x001900BE, 0x00000014, 0x00000001, 0xF5DE0180, 0x00000018, 0x00000001, 0xFFFFFFE3, 0x00000043, 0x00000005, SetMusicTrack, 0x00000000, 0x0000001D, 0x00000000, 0x00000008, 0x00000018, 0x00000001, 0xFFFFFFF0, 0x00000043, 0x00000005, SetMusicTrack, 0x00000000, 0x0000001F, 0x00000000, 0x00000008, 0x0000001C, 0x00000000, 0x00000043, 0x00000005, SetMusicTrack, 0x00000000, 0x0000001D, 0x00000000, 0x00000008, 0x00000023, 0x00000000, 0x00000043, 0x00000002, PlayAmbientSounds, 0x00000001, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000
|
||||
glabel , 0x00000014, 0x00000001, 0xF5DE0180, 0x00000018, 0x00000001, 0xFFFFFFE3, 0x00000043, 0x00000005, SetMusicTrack, 0x00000000, 0x0000001D, 0x00000000, 0x00000008, 0x00000018, 0x00000001, 0xFFFFFFF0, 0x00000043, 0x00000005, SetMusicTrack, 0x00000000, 0x0000001F, 0x00000000, 0x00000008, 0x0000001C, 0x00000000, 0x00000043, 0x00000005, SetMusicTrack, 0x00000000, 0x0000001D, 0x00000000, 0x00000008, 0x00000023, 0x00000000, 0x00000043, 0x00000002, PlayAmbientSounds, 0x00000001, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000
|
||||
|
File diff suppressed because one or more lines are too long
@ -5,20 +5,3 @@
|
||||
glabel D_80241AD0_BDEC80
|
||||
.word 0x61726E5F, 0x30350000, 0x61726E5F, 0x30340000
|
||||
|
||||
glabel D_80241AE0_BDEC90
|
||||
.double 180.0
|
||||
|
||||
glabel D_80241AE8_BDEC98
|
||||
.double 75.0
|
||||
|
||||
glabel D_80241AF0_BDECA0
|
||||
.double 0.85
|
||||
|
||||
glabel D_80241AF8_BDECA8
|
||||
.double 0.9
|
||||
|
||||
glabel D_80241B00_BDECB0
|
||||
.double 32767.0
|
||||
|
||||
glabel jtbl_80241B08_BDECB8
|
||||
.word L80240E04_BDDFB4, L80240E14_BDDFC4, L80240E34_BDDFE4, L80240E54_BDE004, L80240E74_BDE024, L80240E84_BDE034, L80240FB8_BDE168, L80240FB8_BDE168, L80240FB8_BDE168, L80240FB8_BDE168, L80240FB8_BDE168, L80240FB8_BDE168, L80240E9C_BDE04C, L80240EBC_BDE06C, L80240EDC_BDE08C, L80240FB8_BDE168, L80240FB8_BDE168, L80240FB8_BDE168, L80240FB8_BDE168, L80240FB8_BDE168, L80240F00_BDE0B0, L80240F10_BDE0C0, L80240F28_BDE0D8, L80240FB8_BDE168, L80240FB8_BDE168, L80240FB8_BDE168, L80240FB8_BDE168, L80240FB8_BDE168, L80240FB8_BDE168, L80240FB8_BDE168, L80240FB8_BDE168, L80240FB8_BDE168, L80240FB8_BDE168, L80240FB8_BDE168, L80240FB8_BDE168, L80240FB8_BDE168, L80240FB8_BDE168, L80240FB8_BDE168, L80240FB8_BDE168, L80240FB8_BDE168, L80240F40_BDE0F0, L80240F60_BDE110, L80240FB8_BDE168, L80240FB8_BDE168, L80240FB8_BDE168, L80240FB8_BDE168, L80240FB8_BDE168, L80240FB8_BDE168, L80240FB8_BDE168, L80240FB8_BDE168, L80240F78_BDE128, L80240F88_BDE138, L80240FA8_BDE158, 0
|
||||
|
@ -1,6 +1,14 @@
|
||||
.set noat # allow manual use of $at
|
||||
.set noreorder # don't insert nops after branches
|
||||
|
||||
.section .rodata
|
||||
glabel D_80241AE0_BDEC90
|
||||
.double 180.0
|
||||
|
||||
glabel D_80241AE8_BDEC98
|
||||
.double 75.0
|
||||
|
||||
.section .text
|
||||
glabel func_80240000_BDD1B0
|
||||
/* BDD1B0 80240000 27BDFFD8 */ addiu $sp, $sp, -0x28
|
||||
/* BDD1B4 80240004 AFBF001C */ sw $ra, 0x1c($sp)
|
||||
|
@ -1,81 +0,0 @@
|
||||
.set noat # allow manual use of $at
|
||||
.set noreorder # don't insert nops after branches
|
||||
|
||||
glabel func_802401D4_BDD384
|
||||
/* BDD384 802401D4 27BDFFB8 */ addiu $sp, $sp, -0x48
|
||||
/* BDD388 802401D8 AFB3003C */ sw $s3, 0x3c($sp)
|
||||
/* BDD38C 802401DC 0080982D */ daddu $s3, $a0, $zero
|
||||
/* BDD390 802401E0 AFBF0044 */ sw $ra, 0x44($sp)
|
||||
/* BDD394 802401E4 AFB40040 */ sw $s4, 0x40($sp)
|
||||
/* BDD398 802401E8 AFB20038 */ sw $s2, 0x38($sp)
|
||||
/* BDD39C 802401EC AFB10034 */ sw $s1, 0x34($sp)
|
||||
/* BDD3A0 802401F0 AFB00030 */ sw $s0, 0x30($sp)
|
||||
/* BDD3A4 802401F4 8E700148 */ lw $s0, 0x148($s3)
|
||||
/* BDD3A8 802401F8 00A0902D */ daddu $s2, $a1, $zero
|
||||
/* BDD3AC 802401FC 86040008 */ lh $a0, 8($s0)
|
||||
/* BDD3B0 80240200 0C00EABB */ jal get_npc_unsafe
|
||||
/* BDD3B4 80240204 00C0A02D */ daddu $s4, $a2, $zero
|
||||
/* BDD3B8 80240208 8E630074 */ lw $v1, 0x74($s3)
|
||||
/* BDD3BC 8024020C 1C600032 */ bgtz $v1, .L802402D8
|
||||
/* BDD3C0 80240210 0040882D */ daddu $s1, $v0, $zero
|
||||
/* BDD3C4 80240214 8E420014 */ lw $v0, 0x14($s2)
|
||||
/* BDD3C8 80240218 AE620074 */ sw $v0, 0x74($s3)
|
||||
/* BDD3CC 8024021C C640000C */ lwc1 $f0, 0xc($s2)
|
||||
/* BDD3D0 80240220 3C018024 */ lui $at, %hi(D_80241AF0_BDECA0)
|
||||
/* BDD3D4 80240224 D4221AF0 */ ldc1 $f2, %lo(D_80241AF0_BDECA0)($at)
|
||||
/* BDD3D8 80240228 46000021 */ cvt.d.s $f0, $f0
|
||||
/* BDD3DC 8024022C 46220002 */ mul.d $f0, $f0, $f2
|
||||
/* BDD3E0 80240230 00000000 */ nop
|
||||
/* BDD3E4 80240234 0280202D */ daddu $a0, $s4, $zero
|
||||
/* BDD3E8 80240238 AFA00010 */ sw $zero, 0x10($sp)
|
||||
/* BDD3EC 8024023C 8E470010 */ lw $a3, 0x10($s2)
|
||||
/* BDD3F0 80240240 46200020 */ cvt.s.d $f0, $f0
|
||||
/* BDD3F4 80240244 44060000 */ mfc1 $a2, $f0
|
||||
/* BDD3F8 80240248 0C01242D */ jal func_800490B4
|
||||
/* BDD3FC 8024024C 0200282D */ daddu $a1, $s0, $zero
|
||||
/* BDD400 80240250 10400021 */ beqz $v0, .L802402D8
|
||||
/* BDD404 80240254 0000202D */ daddu $a0, $zero, $zero
|
||||
/* BDD408 80240258 0220282D */ daddu $a1, $s1, $zero
|
||||
/* BDD40C 8024025C 0000302D */ daddu $a2, $zero, $zero
|
||||
/* BDD410 80240260 8E0200CC */ lw $v0, 0xcc($s0)
|
||||
/* BDD414 80240264 3C013F80 */ lui $at, 0x3f80
|
||||
/* BDD418 80240268 44810000 */ mtc1 $at, $f0
|
||||
/* BDD41C 8024026C 3C014000 */ lui $at, 0x4000
|
||||
/* BDD420 80240270 44811000 */ mtc1 $at, $f2
|
||||
/* BDD424 80240274 8C430024 */ lw $v1, 0x24($v0)
|
||||
/* BDD428 80240278 862200A8 */ lh $v0, 0xa8($s1)
|
||||
/* BDD42C 8024027C 3C01C1A0 */ lui $at, 0xc1a0
|
||||
/* BDD430 80240280 44812000 */ mtc1 $at, $f4
|
||||
/* BDD434 80240284 44823000 */ mtc1 $v0, $f6
|
||||
/* BDD438 80240288 00000000 */ nop
|
||||
/* BDD43C 8024028C 468031A0 */ cvt.s.w $f6, $f6
|
||||
/* BDD440 80240290 44073000 */ mfc1 $a3, $f6
|
||||
/* BDD444 80240294 2402000F */ addiu $v0, $zero, 0xf
|
||||
/* BDD448 80240298 AE230028 */ sw $v1, 0x28($s1)
|
||||
/* BDD44C 8024029C AFA2001C */ sw $v0, 0x1c($sp)
|
||||
/* BDD450 802402A0 27A20028 */ addiu $v0, $sp, 0x28
|
||||
/* BDD454 802402A4 E7A00010 */ swc1 $f0, 0x10($sp)
|
||||
/* BDD458 802402A8 E7A20014 */ swc1 $f2, 0x14($sp)
|
||||
/* BDD45C 802402AC E7A40018 */ swc1 $f4, 0x18($sp)
|
||||
/* BDD460 802402B0 0C01BFA4 */ jal fx_emote
|
||||
/* BDD464 802402B4 AFA20020 */ sw $v0, 0x20($sp)
|
||||
/* BDD468 802402B8 0220202D */ daddu $a0, $s1, $zero
|
||||
/* BDD46C 802402BC 240502F4 */ addiu $a1, $zero, 0x2f4
|
||||
/* BDD470 802402C0 0C012530 */ jal func_800494C0
|
||||
/* BDD474 802402C4 3C060020 */ lui $a2, 0x20
|
||||
/* BDD478 802402C8 2402000C */ addiu $v0, $zero, 0xc
|
||||
/* BDD47C 802402CC A622008E */ sh $v0, 0x8e($s1)
|
||||
/* BDD480 802402D0 24020002 */ addiu $v0, $zero, 2
|
||||
/* BDD484 802402D4 AE620070 */ sw $v0, 0x70($s3)
|
||||
.L802402D8:
|
||||
/* BDD488 802402D8 8E620074 */ lw $v0, 0x74($s3)
|
||||
/* BDD48C 802402DC 2442FFFF */ addiu $v0, $v0, -1
|
||||
/* BDD490 802402E0 AE620074 */ sw $v0, 0x74($s3)
|
||||
/* BDD494 802402E4 8FBF0044 */ lw $ra, 0x44($sp)
|
||||
/* BDD498 802402E8 8FB40040 */ lw $s4, 0x40($sp)
|
||||
/* BDD49C 802402EC 8FB3003C */ lw $s3, 0x3c($sp)
|
||||
/* BDD4A0 802402F0 8FB20038 */ lw $s2, 0x38($sp)
|
||||
/* BDD4A4 802402F4 8FB10034 */ lw $s1, 0x34($sp)
|
||||
/* BDD4A8 802402F8 8FB00030 */ lw $s0, 0x30($sp)
|
||||
/* BDD4AC 802402FC 03E00008 */ jr $ra
|
||||
/* BDD4B0 80240300 27BD0048 */ addiu $sp, $sp, 0x48
|
@ -1,101 +0,0 @@
|
||||
.set noat # allow manual use of $at
|
||||
.set noreorder # don't insert nops after branches
|
||||
|
||||
glabel func_802404D0_BDD680
|
||||
/* BDD680 802404D0 27BDFFB8 */ addiu $sp, $sp, -0x48
|
||||
/* BDD684 802404D4 AFB3003C */ sw $s3, 0x3c($sp)
|
||||
/* BDD688 802404D8 0080982D */ daddu $s3, $a0, $zero
|
||||
/* BDD68C 802404DC AFBF0040 */ sw $ra, 0x40($sp)
|
||||
/* BDD690 802404E0 AFB20038 */ sw $s2, 0x38($sp)
|
||||
/* BDD694 802404E4 AFB10034 */ sw $s1, 0x34($sp)
|
||||
/* BDD698 802404E8 AFB00030 */ sw $s0, 0x30($sp)
|
||||
/* BDD69C 802404EC 8E700148 */ lw $s0, 0x148($s3)
|
||||
/* BDD6A0 802404F0 00A0902D */ daddu $s2, $a1, $zero
|
||||
/* BDD6A4 802404F4 86040008 */ lh $a0, 8($s0)
|
||||
/* BDD6A8 802404F8 0C00EABB */ jal get_npc_unsafe
|
||||
/* BDD6AC 802404FC 00C0882D */ daddu $s1, $a2, $zero
|
||||
/* BDD6B0 80240500 0220202D */ daddu $a0, $s1, $zero
|
||||
/* BDD6B4 80240504 0200282D */ daddu $a1, $s0, $zero
|
||||
/* BDD6B8 80240508 AFA00010 */ sw $zero, 0x10($sp)
|
||||
/* BDD6BC 8024050C 8E460024 */ lw $a2, 0x24($s2)
|
||||
/* BDD6C0 80240510 8E470028 */ lw $a3, 0x28($s2)
|
||||
/* BDD6C4 80240514 0C01242D */ jal func_800490B4
|
||||
/* BDD6C8 80240518 0040802D */ daddu $s0, $v0, $zero
|
||||
/* BDD6CC 8024051C 1040000B */ beqz $v0, .L8024054C
|
||||
/* BDD6D0 80240520 00000000 */ nop
|
||||
/* BDD6D4 80240524 3C02800F */ lui $v0, %hi(gPlayerStatusPtr)
|
||||
/* BDD6D8 80240528 8C427B30 */ lw $v0, %lo(gPlayerStatusPtr)($v0)
|
||||
/* BDD6DC 8024052C C60C0038 */ lwc1 $f12, 0x38($s0)
|
||||
/* BDD6E0 80240530 C60E0040 */ lwc1 $f14, 0x40($s0)
|
||||
/* BDD6E4 80240534 8C460028 */ lw $a2, 0x28($v0)
|
||||
/* BDD6E8 80240538 0C00A720 */ jal atan2
|
||||
/* BDD6EC 8024053C 8C470030 */ lw $a3, 0x30($v0)
|
||||
/* BDD6F0 80240540 2402000C */ addiu $v0, $zero, 0xc
|
||||
/* BDD6F4 80240544 08090189 */ j .L80240624
|
||||
/* BDD6F8 80240548 E600000C */ swc1 $f0, 0xc($s0)
|
||||
.L8024054C:
|
||||
/* BDD6FC 8024054C 9602008E */ lhu $v0, 0x8e($s0)
|
||||
/* BDD700 80240550 2442FFFF */ addiu $v0, $v0, -1
|
||||
/* BDD704 80240554 A602008E */ sh $v0, 0x8e($s0)
|
||||
/* BDD708 80240558 00021400 */ sll $v0, $v0, 0x10
|
||||
/* BDD70C 8024055C 1C400032 */ bgtz $v0, .L80240628
|
||||
/* BDD710 80240560 00000000 */ nop
|
||||
/* BDD714 80240564 8E620074 */ lw $v0, 0x74($s3)
|
||||
/* BDD718 80240568 2442FFFF */ addiu $v0, $v0, -1
|
||||
/* BDD71C 8024056C 18400014 */ blez $v0, .L802405C0
|
||||
/* BDD720 80240570 AE620074 */ sw $v0, 0x74($s3)
|
||||
/* BDD724 80240574 C600000C */ lwc1 $f0, 0xc($s0)
|
||||
/* BDD728 80240578 3C014334 */ lui $at, 0x4334
|
||||
/* BDD72C 8024057C 44816000 */ mtc1 $at, $f12
|
||||
/* BDD730 80240580 0C00A6C9 */ jal clamp_angle
|
||||
/* BDD734 80240584 460C0300 */ add.s $f12, $f0, $f12
|
||||
/* BDD738 80240588 E600000C */ swc1 $f0, 0xc($s0)
|
||||
/* BDD73C 8024058C 8E440008 */ lw $a0, 8($s2)
|
||||
/* BDD740 80240590 000417C2 */ srl $v0, $a0, 0x1f
|
||||
/* BDD744 80240594 00822021 */ addu $a0, $a0, $v0
|
||||
/* BDD748 80240598 00042043 */ sra $a0, $a0, 1
|
||||
/* BDD74C 8024059C 0C00A67F */ jal rand_int
|
||||
/* BDD750 802405A0 24840001 */ addiu $a0, $a0, 1
|
||||
/* BDD754 802405A4 8E430008 */ lw $v1, 8($s2)
|
||||
/* BDD758 802405A8 000327C2 */ srl $a0, $v1, 0x1f
|
||||
/* BDD75C 802405AC 00641821 */ addu $v1, $v1, $a0
|
||||
/* BDD760 802405B0 00031843 */ sra $v1, $v1, 1
|
||||
/* BDD764 802405B4 00621821 */ addu $v1, $v1, $v0
|
||||
/* BDD768 802405B8 0809018A */ j .L80240628
|
||||
/* BDD76C 802405BC A603008E */ sh $v1, 0x8e($s0)
|
||||
.L802405C0:
|
||||
/* BDD770 802405C0 24040002 */ addiu $a0, $zero, 2
|
||||
/* BDD774 802405C4 0200282D */ daddu $a1, $s0, $zero
|
||||
/* BDD778 802405C8 0000302D */ daddu $a2, $zero, $zero
|
||||
/* BDD77C 802405CC 860300A8 */ lh $v1, 0xa8($s0)
|
||||
/* BDD780 802405D0 3C013F80 */ lui $at, 0x3f80
|
||||
/* BDD784 802405D4 44810000 */ mtc1 $at, $f0
|
||||
/* BDD788 802405D8 3C014000 */ lui $at, 0x4000
|
||||
/* BDD78C 802405DC 44811000 */ mtc1 $at, $f2
|
||||
/* BDD790 802405E0 3C01C1A0 */ lui $at, 0xc1a0
|
||||
/* BDD794 802405E4 44812000 */ mtc1 $at, $f4
|
||||
/* BDD798 802405E8 2402000C */ addiu $v0, $zero, 0xc
|
||||
/* BDD79C 802405EC AFA2001C */ sw $v0, 0x1c($sp)
|
||||
/* BDD7A0 802405F0 44833000 */ mtc1 $v1, $f6
|
||||
/* BDD7A4 802405F4 00000000 */ nop
|
||||
/* BDD7A8 802405F8 468031A0 */ cvt.s.w $f6, $f6
|
||||
/* BDD7AC 802405FC 44073000 */ mfc1 $a3, $f6
|
||||
/* BDD7B0 80240600 27A20028 */ addiu $v0, $sp, 0x28
|
||||
/* BDD7B4 80240604 AFA20020 */ sw $v0, 0x20($sp)
|
||||
/* BDD7B8 80240608 E7A00010 */ swc1 $f0, 0x10($sp)
|
||||
/* BDD7BC 8024060C E7A20014 */ swc1 $f2, 0x14($sp)
|
||||
/* BDD7C0 80240610 0C01BFA4 */ jal fx_emote
|
||||
/* BDD7C4 80240614 E7A40018 */ swc1 $f4, 0x18($sp)
|
||||
/* BDD7C8 80240618 2402000F */ addiu $v0, $zero, 0xf
|
||||
/* BDD7CC 8024061C A602008E */ sh $v0, 0x8e($s0)
|
||||
/* BDD7D0 80240620 24020028 */ addiu $v0, $zero, 0x28
|
||||
.L80240624:
|
||||
/* BDD7D4 80240624 AE620070 */ sw $v0, 0x70($s3)
|
||||
.L80240628:
|
||||
/* BDD7D8 80240628 8FBF0040 */ lw $ra, 0x40($sp)
|
||||
/* BDD7DC 8024062C 8FB3003C */ lw $s3, 0x3c($sp)
|
||||
/* BDD7E0 80240630 8FB20038 */ lw $s2, 0x38($sp)
|
||||
/* BDD7E4 80240634 8FB10034 */ lw $s1, 0x34($sp)
|
||||
/* BDD7E8 80240638 8FB00030 */ lw $s0, 0x30($sp)
|
||||
/* BDD7EC 8024063C 03E00008 */ jr $ra
|
||||
/* BDD7F0 80240640 27BD0048 */ addiu $sp, $sp, 0x48
|
@ -1,111 +0,0 @@
|
||||
.set noat # allow manual use of $at
|
||||
.set noreorder # don't insert nops after branches
|
||||
|
||||
glabel func_80240694_BDD844
|
||||
/* BDD844 80240694 27BDFFD0 */ addiu $sp, $sp, -0x30
|
||||
/* BDD848 80240698 AFB30024 */ sw $s3, 0x24($sp)
|
||||
/* BDD84C 8024069C 0080982D */ daddu $s3, $a0, $zero
|
||||
/* BDD850 802406A0 AFBF002C */ sw $ra, 0x2c($sp)
|
||||
/* BDD854 802406A4 AFB40028 */ sw $s4, 0x28($sp)
|
||||
/* BDD858 802406A8 AFB20020 */ sw $s2, 0x20($sp)
|
||||
/* BDD85C 802406AC AFB1001C */ sw $s1, 0x1c($sp)
|
||||
/* BDD860 802406B0 AFB00018 */ sw $s0, 0x18($sp)
|
||||
/* BDD864 802406B4 8E710148 */ lw $s1, 0x148($s3)
|
||||
/* BDD868 802406B8 86240008 */ lh $a0, 8($s1)
|
||||
/* BDD86C 802406BC 0C00EABB */ jal get_npc_unsafe
|
||||
/* BDD870 802406C0 00A0A02D */ daddu $s4, $a1, $zero
|
||||
/* BDD874 802406C4 0040802D */ daddu $s0, $v0, $zero
|
||||
/* BDD878 802406C8 3C12800F */ lui $s2, %hi(gPlayerStatusPtr)
|
||||
/* BDD87C 802406CC 26527B30 */ addiu $s2, $s2, %lo(gPlayerStatusPtr)
|
||||
/* BDD880 802406D0 C60C0038 */ lwc1 $f12, 0x38($s0)
|
||||
/* BDD884 802406D4 8E420000 */ lw $v0, ($s2)
|
||||
/* BDD888 802406D8 C60E0040 */ lwc1 $f14, 0x40($s0)
|
||||
/* BDD88C 802406DC 8C460028 */ lw $a2, 0x28($v0)
|
||||
/* BDD890 802406E0 0C00A720 */ jal atan2
|
||||
/* BDD894 802406E4 8C470030 */ lw $a3, 0x30($v0)
|
||||
/* BDD898 802406E8 3C025555 */ lui $v0, 0x5555
|
||||
/* BDD89C 802406EC 9603008E */ lhu $v1, 0x8e($s0)
|
||||
/* BDD8A0 802406F0 34425556 */ ori $v0, $v0, 0x5556
|
||||
/* BDD8A4 802406F4 00031C00 */ sll $v1, $v1, 0x10
|
||||
/* BDD8A8 802406F8 00032403 */ sra $a0, $v1, 0x10
|
||||
/* BDD8AC 802406FC 00820018 */ mult $a0, $v0
|
||||
/* BDD8B0 80240700 00031FC3 */ sra $v1, $v1, 0x1f
|
||||
/* BDD8B4 80240704 00004010 */ mfhi $t0
|
||||
/* BDD8B8 80240708 01031823 */ subu $v1, $t0, $v1
|
||||
/* BDD8BC 8024070C 00031040 */ sll $v0, $v1, 1
|
||||
/* BDD8C0 80240710 00431021 */ addu $v0, $v0, $v1
|
||||
/* BDD8C4 80240714 00822023 */ subu $a0, $a0, $v0
|
||||
/* BDD8C8 80240718 00042400 */ sll $a0, $a0, 0x10
|
||||
/* BDD8CC 8024071C 1480000C */ bnez $a0, .L80240750
|
||||
/* BDD8D0 80240720 E600000C */ swc1 $f0, 0xc($s0)
|
||||
/* BDD8D4 80240724 C6020040 */ lwc1 $f2, 0x40($s0)
|
||||
/* BDD8D8 80240728 3C014000 */ lui $at, 0x4000
|
||||
/* BDD8DC 8024072C 44810000 */ mtc1 $at, $f0
|
||||
/* BDD8E0 80240730 AFA00010 */ sw $zero, 0x10($sp)
|
||||
/* BDD8E4 80240734 AFA00014 */ sw $zero, 0x14($sp)
|
||||
/* BDD8E8 80240738 46001080 */ add.s $f2, $f2, $f0
|
||||
/* BDD8EC 8024073C 8E06003C */ lw $a2, 0x3c($s0)
|
||||
/* BDD8F0 80240740 8E050038 */ lw $a1, 0x38($s0)
|
||||
/* BDD8F4 80240744 44071000 */ mfc1 $a3, $f2
|
||||
/* BDD8F8 80240748 0C01BECC */ jal fx_walk_normal
|
||||
/* BDD8FC 8024074C 24040002 */ addiu $a0, $zero, 2
|
||||
.L80240750:
|
||||
/* BDD900 80240750 9602008E */ lhu $v0, 0x8e($s0)
|
||||
/* BDD904 80240754 2442FFFF */ addiu $v0, $v0, -1
|
||||
/* BDD908 80240758 A602008E */ sh $v0, 0x8e($s0)
|
||||
/* BDD90C 8024075C 00021400 */ sll $v0, $v0, 0x10
|
||||
/* BDD910 80240760 1C40002C */ bgtz $v0, .L80240814
|
||||
/* BDD914 80240764 00000000 */ nop
|
||||
/* BDD918 80240768 C6000038 */ lwc1 $f0, 0x38($s0)
|
||||
/* BDD91C 8024076C 4600010D */ trunc.w.s $f4, $f0
|
||||
/* BDD920 80240770 44022000 */ mfc1 $v0, $f4
|
||||
/* BDD924 80240774 00000000 */ nop
|
||||
/* BDD928 80240778 A6220010 */ sh $v0, 0x10($s1)
|
||||
/* BDD92C 8024077C C600003C */ lwc1 $f0, 0x3c($s0)
|
||||
/* BDD930 80240780 4600010D */ trunc.w.s $f4, $f0
|
||||
/* BDD934 80240784 44022000 */ mfc1 $v0, $f4
|
||||
/* BDD938 80240788 00000000 */ nop
|
||||
/* BDD93C 8024078C A6220012 */ sh $v0, 0x12($s1)
|
||||
/* BDD940 80240790 C6000040 */ lwc1 $f0, 0x40($s0)
|
||||
/* BDD944 80240794 24020001 */ addiu $v0, $zero, 1
|
||||
/* BDD948 80240798 A2220007 */ sb $v0, 7($s1)
|
||||
/* BDD94C 8024079C 4600010D */ trunc.w.s $f4, $f0
|
||||
/* BDD950 802407A0 44022000 */ mfc1 $v0, $f4
|
||||
/* BDD954 802407A4 00000000 */ nop
|
||||
/* BDD958 802407A8 A6220014 */ sh $v0, 0x14($s1)
|
||||
/* BDD95C 802407AC C6800018 */ lwc1 $f0, 0x18($s4)
|
||||
/* BDD960 802407B0 C60C0038 */ lwc1 $f12, 0x38($s0)
|
||||
/* BDD964 802407B4 C60E0040 */ lwc1 $f14, 0x40($s0)
|
||||
/* BDD968 802407B8 8E420000 */ lw $v0, ($s2)
|
||||
/* BDD96C 802407BC E6000018 */ swc1 $f0, 0x18($s0)
|
||||
/* BDD970 802407C0 8C460028 */ lw $a2, 0x28($v0)
|
||||
/* BDD974 802407C4 0C00A7B5 */ jal dist2D
|
||||
/* BDD978 802407C8 8C470030 */ lw $a3, 0x30($v0)
|
||||
/* BDD97C 802407CC C6020018 */ lwc1 $f2, 0x18($s0)
|
||||
/* BDD980 802407D0 46020003 */ div.s $f0, $f0, $f2
|
||||
/* BDD984 802407D4 3C018024 */ lui $at, %hi(D_80241AF8_BDECA8)
|
||||
/* BDD988 802407D8 D4221AF8 */ ldc1 $f2, %lo(D_80241AF8_BDECA8)($at)
|
||||
/* BDD98C 802407DC 46000021 */ cvt.d.s $f0, $f0
|
||||
/* BDD990 802407E0 46220000 */ add.d $f0, $f0, $f2
|
||||
/* BDD994 802407E4 4620010D */ trunc.w.d $f4, $f0
|
||||
/* BDD998 802407E8 44022000 */ mfc1 $v0, $f4
|
||||
/* BDD99C 802407EC 00000000 */ nop
|
||||
/* BDD9A0 802407F0 A602008E */ sh $v0, 0x8e($s0)
|
||||
/* BDD9A4 802407F4 00021400 */ sll $v0, $v0, 0x10
|
||||
/* BDD9A8 802407F8 00021403 */ sra $v0, $v0, 0x10
|
||||
/* BDD9AC 802407FC 2842000F */ slti $v0, $v0, 0xf
|
||||
/* BDD9B0 80240800 10400002 */ beqz $v0, .L8024080C
|
||||
/* BDD9B4 80240804 2402000F */ addiu $v0, $zero, 0xf
|
||||
/* BDD9B8 80240808 A602008E */ sh $v0, 0x8e($s0)
|
||||
.L8024080C:
|
||||
/* BDD9BC 8024080C 24020016 */ addiu $v0, $zero, 0x16
|
||||
/* BDD9C0 80240810 AE620070 */ sw $v0, 0x70($s3)
|
||||
.L80240814:
|
||||
/* BDD9C4 80240814 8FBF002C */ lw $ra, 0x2c($sp)
|
||||
/* BDD9C8 80240818 8FB40028 */ lw $s4, 0x28($sp)
|
||||
/* BDD9CC 8024081C 8FB30024 */ lw $s3, 0x24($sp)
|
||||
/* BDD9D0 80240820 8FB20020 */ lw $s2, 0x20($sp)
|
||||
/* BDD9D4 80240824 8FB1001C */ lw $s1, 0x1c($sp)
|
||||
/* BDD9D8 80240828 8FB00018 */ lw $s0, 0x18($sp)
|
||||
/* BDD9DC 8024082C 03E00008 */ jr $ra
|
||||
/* BDD9E0 80240830 27BD0030 */ addiu $sp, $sp, 0x30
|
@ -1,91 +0,0 @@
|
||||
.set noat # allow manual use of $at
|
||||
.set noreorder # don't insert nops after branches
|
||||
|
||||
glabel func_80240834_BDD9E4
|
||||
/* BDD9E4 80240834 27BDFFB8 */ addiu $sp, $sp, -0x48
|
||||
/* BDD9E8 80240838 AFB3003C */ sw $s3, 0x3c($sp)
|
||||
/* BDD9EC 8024083C 0080982D */ daddu $s3, $a0, $zero
|
||||
/* BDD9F0 80240840 AFBF0040 */ sw $ra, 0x40($sp)
|
||||
/* BDD9F4 80240844 AFB20038 */ sw $s2, 0x38($sp)
|
||||
/* BDD9F8 80240848 AFB10034 */ sw $s1, 0x34($sp)
|
||||
/* BDD9FC 8024084C AFB00030 */ sw $s0, 0x30($sp)
|
||||
/* BDDA00 80240850 8E720148 */ lw $s2, 0x148($s3)
|
||||
/* BDDA04 80240854 0C00EABB */ jal get_npc_unsafe
|
||||
/* BDDA08 80240858 86440008 */ lh $a0, 8($s2)
|
||||
/* BDDA0C 8024085C 0040802D */ daddu $s0, $v0, $zero
|
||||
/* BDDA10 80240860 0200202D */ daddu $a0, $s0, $zero
|
||||
/* BDDA14 80240864 0C00F598 */ jal func_8003D660
|
||||
/* BDDA18 80240868 24050001 */ addiu $a1, $zero, 1
|
||||
/* BDDA1C 8024086C 8E050018 */ lw $a1, 0x18($s0)
|
||||
/* BDDA20 80240870 8E06000C */ lw $a2, 0xc($s0)
|
||||
/* BDDA24 80240874 0C00EA95 */ jal npc_move_heading
|
||||
/* BDDA28 80240878 0200202D */ daddu $a0, $s0, $zero
|
||||
/* BDDA2C 8024087C 8E4300D0 */ lw $v1, 0xd0($s2)
|
||||
/* BDDA30 80240880 C6000040 */ lwc1 $f0, 0x40($s0)
|
||||
/* BDDA34 80240884 C462001C */ lwc1 $f2, 0x1c($v1)
|
||||
/* BDDA38 80240888 468010A0 */ cvt.s.w $f2, $f2
|
||||
/* BDDA3C 8024088C C4640024 */ lwc1 $f4, 0x24($v1)
|
||||
/* BDDA40 80240890 46802120 */ cvt.s.w $f4, $f4
|
||||
/* BDDA44 80240894 E7A00010 */ swc1 $f0, 0x10($sp)
|
||||
/* BDDA48 80240898 8E4200D0 */ lw $v0, 0xd0($s2)
|
||||
/* BDDA4C 8024089C 44051000 */ mfc1 $a1, $f2
|
||||
/* BDDA50 802408A0 C4400028 */ lwc1 $f0, 0x28($v0)
|
||||
/* BDDA54 802408A4 46800020 */ cvt.s.w $f0, $f0
|
||||
/* BDDA58 802408A8 E7A00014 */ swc1 $f0, 0x14($sp)
|
||||
/* BDDA5C 802408AC 8E4200D0 */ lw $v0, 0xd0($s2)
|
||||
/* BDDA60 802408B0 44062000 */ mfc1 $a2, $f4
|
||||
/* BDDA64 802408B4 C440002C */ lwc1 $f0, 0x2c($v0)
|
||||
/* BDDA68 802408B8 46800020 */ cvt.s.w $f0, $f0
|
||||
/* BDDA6C 802408BC E7A00018 */ swc1 $f0, 0x18($sp)
|
||||
/* BDDA70 802408C0 8C640030 */ lw $a0, 0x30($v1)
|
||||
/* BDDA74 802408C4 0C0123F5 */ jal is_point_within_region
|
||||
/* BDDA78 802408C8 8E070038 */ lw $a3, 0x38($s0)
|
||||
/* BDDA7C 802408CC C6000038 */ lwc1 $f0, 0x38($s0)
|
||||
/* BDDA80 802408D0 C602003C */ lwc1 $f2, 0x3c($s0)
|
||||
/* BDDA84 802408D4 C6040040 */ lwc1 $f4, 0x40($s0)
|
||||
/* BDDA88 802408D8 3C013F80 */ lui $at, 0x3f80
|
||||
/* BDDA8C 802408DC 44813000 */ mtc1 $at, $f6
|
||||
/* BDDA90 802408E0 E7A00020 */ swc1 $f0, 0x20($sp)
|
||||
/* BDDA94 802408E4 E7A20024 */ swc1 $f2, 0x24($sp)
|
||||
/* BDDA98 802408E8 E7A40028 */ swc1 $f4, 0x28($sp)
|
||||
/* BDDA9C 802408EC E7A60010 */ swc1 $f6, 0x10($sp)
|
||||
/* BDDAA0 802408F0 C600000C */ lwc1 $f0, 0xc($s0)
|
||||
/* BDDAA4 802408F4 0002882B */ sltu $s1, $zero, $v0
|
||||
/* BDDAA8 802408F8 E7A00014 */ swc1 $f0, 0x14($sp)
|
||||
/* BDDAAC 802408FC 860200A8 */ lh $v0, 0xa8($s0)
|
||||
/* BDDAB0 80240900 27A50020 */ addiu $a1, $sp, 0x20
|
||||
/* BDDAB4 80240904 44820000 */ mtc1 $v0, $f0
|
||||
/* BDDAB8 80240908 00000000 */ nop
|
||||
/* BDDABC 8024090C 46800020 */ cvt.s.w $f0, $f0
|
||||
/* BDDAC0 80240910 E7A00018 */ swc1 $f0, 0x18($sp)
|
||||
/* BDDAC4 80240914 860200A6 */ lh $v0, 0xa6($s0)
|
||||
/* BDDAC8 80240918 27A60024 */ addiu $a2, $sp, 0x24
|
||||
/* BDDACC 8024091C 44820000 */ mtc1 $v0, $f0
|
||||
/* BDDAD0 80240920 00000000 */ nop
|
||||
/* BDDAD4 80240924 46800020 */ cvt.s.w $f0, $f0
|
||||
/* BDDAD8 80240928 E7A0001C */ swc1 $f0, 0x1c($sp)
|
||||
/* BDDADC 8024092C 8E040080 */ lw $a0, 0x80($s0)
|
||||
/* BDDAE0 80240930 0C037711 */ jal func_800DDC44
|
||||
/* BDDAE4 80240934 27A70028 */ addiu $a3, $sp, 0x28
|
||||
/* BDDAE8 80240938 54400001 */ bnel $v0, $zero, .L80240940
|
||||
/* BDDAEC 8024093C 24110001 */ addiu $s1, $zero, 1
|
||||
.L80240940:
|
||||
/* BDDAF0 80240940 9602008E */ lhu $v0, 0x8e($s0)
|
||||
/* BDDAF4 80240944 2442FFFF */ addiu $v0, $v0, -1
|
||||
/* BDDAF8 80240948 A602008E */ sh $v0, 0x8e($s0)
|
||||
/* BDDAFC 8024094C 00021400 */ sll $v0, $v0, 0x10
|
||||
/* BDDB00 80240950 58400001 */ blezl $v0, .L80240958
|
||||
/* BDDB04 80240954 24110001 */ addiu $s1, $zero, 1
|
||||
.L80240958:
|
||||
/* BDDB08 80240958 12200003 */ beqz $s1, .L80240968
|
||||
/* BDDB0C 8024095C 24020004 */ addiu $v0, $zero, 4
|
||||
/* BDDB10 80240960 AE620070 */ sw $v0, 0x70($s3)
|
||||
/* BDDB14 80240964 A2400007 */ sb $zero, 7($s2)
|
||||
.L80240968:
|
||||
/* BDDB18 80240968 8FBF0040 */ lw $ra, 0x40($sp)
|
||||
/* BDDB1C 8024096C 8FB3003C */ lw $s3, 0x3c($sp)
|
||||
/* BDDB20 80240970 8FB20038 */ lw $s2, 0x38($sp)
|
||||
/* BDDB24 80240974 8FB10034 */ lw $s1, 0x34($sp)
|
||||
/* BDDB28 80240978 8FB00030 */ lw $s0, 0x30($sp)
|
||||
/* BDDB2C 8024097C 03E00008 */ jr $ra
|
||||
/* BDDB30 80240980 27BD0048 */ addiu $sp, $sp, 0x48
|
@ -1,50 +0,0 @@
|
||||
.set noat # allow manual use of $at
|
||||
.set noreorder # don't insert nops after branches
|
||||
|
||||
glabel func_80240984_BDDB34
|
||||
/* BDDB34 80240984 27BDFFE0 */ addiu $sp, $sp, -0x20
|
||||
/* BDDB38 80240988 AFB20018 */ sw $s2, 0x18($sp)
|
||||
/* BDDB3C 8024098C 0080902D */ daddu $s2, $a0, $zero
|
||||
/* BDDB40 80240990 AFBF001C */ sw $ra, 0x1c($sp)
|
||||
/* BDDB44 80240994 AFB10014 */ sw $s1, 0x14($sp)
|
||||
/* BDDB48 80240998 AFB00010 */ sw $s0, 0x10($sp)
|
||||
/* BDDB4C 8024099C 8E500148 */ lw $s0, 0x148($s2)
|
||||
/* BDDB50 802409A0 86040008 */ lh $a0, 8($s0)
|
||||
/* BDDB54 802409A4 0C00EABB */ jal get_npc_unsafe
|
||||
/* BDDB58 802409A8 00A0882D */ daddu $s1, $a1, $zero
|
||||
/* BDDB5C 802409AC 0040182D */ daddu $v1, $v0, $zero
|
||||
/* BDDB60 802409B0 9462008E */ lhu $v0, 0x8e($v1)
|
||||
/* BDDB64 802409B4 2442FFFF */ addiu $v0, $v0, -1
|
||||
/* BDDB68 802409B8 A462008E */ sh $v0, 0x8e($v1)
|
||||
/* BDDB6C 802409BC 00021400 */ sll $v0, $v0, 0x10
|
||||
/* BDDB70 802409C0 1C400015 */ bgtz $v0, .L80240A18
|
||||
/* BDDB74 802409C4 00000000 */ nop
|
||||
/* BDDB78 802409C8 8E0200CC */ lw $v0, 0xcc($s0)
|
||||
/* BDDB7C 802409CC 8C420004 */ lw $v0, 4($v0)
|
||||
/* BDDB80 802409D0 AC620028 */ sw $v0, 0x28($v1)
|
||||
/* BDDB84 802409D4 8E0200D0 */ lw $v0, 0xd0($s0)
|
||||
/* BDDB88 802409D8 8C420014 */ lw $v0, 0x14($v0)
|
||||
/* BDDB8C 802409DC 04410004 */ bgez $v0, .L802409F0
|
||||
/* BDDB90 802409E0 00000000 */ nop
|
||||
/* BDDB94 802409E4 C6200000 */ lwc1 $f0, ($s1)
|
||||
/* BDDB98 802409E8 08090284 */ j .L80240A10
|
||||
/* BDDB9C 802409EC E4600018 */ swc1 $f0, 0x18($v1)
|
||||
.L802409F0:
|
||||
/* BDDBA0 802409F0 3C018024 */ lui $at, %hi(D_80241B00_BDECB0)
|
||||
/* BDDBA4 802409F4 D4221B00 */ ldc1 $f2, %lo(D_80241B00_BDECB0)($at)
|
||||
/* BDDBA8 802409F8 44820000 */ mtc1 $v0, $f0
|
||||
/* BDDBAC 802409FC 00000000 */ nop
|
||||
/* BDDBB0 80240A00 46800021 */ cvt.d.w $f0, $f0
|
||||
/* BDDBB4 80240A04 46220003 */ div.d $f0, $f0, $f2
|
||||
/* BDDBB8 80240A08 46200020 */ cvt.s.d $f0, $f0
|
||||
/* BDDBBC 80240A0C E4600018 */ swc1 $f0, 0x18($v1)
|
||||
.L80240A10:
|
||||
/* BDDBC0 80240A10 24020029 */ addiu $v0, $zero, 0x29
|
||||
/* BDDBC4 80240A14 AE420070 */ sw $v0, 0x70($s2)
|
||||
.L80240A18:
|
||||
/* BDDBC8 80240A18 8FBF001C */ lw $ra, 0x1c($sp)
|
||||
/* BDDBCC 80240A1C 8FB20018 */ lw $s2, 0x18($sp)
|
||||
/* BDDBD0 80240A20 8FB10014 */ lw $s1, 0x14($sp)
|
||||
/* BDDBD4 80240A24 8FB00010 */ lw $s0, 0x10($sp)
|
||||
/* BDDBD8 80240A28 03E00008 */ jr $ra
|
||||
/* BDDBDC 80240A2C 27BD0020 */ addiu $sp, $sp, 0x20
|
@ -1,85 +0,0 @@
|
||||
.set noat # allow manual use of $at
|
||||
.set noreorder # don't insert nops after branches
|
||||
|
||||
glabel func_80240A30_BDDBE0
|
||||
/* BDDBE0 80240A30 27BDFFD0 */ addiu $sp, $sp, -0x30
|
||||
/* BDDBE4 80240A34 AFB30024 */ sw $s3, 0x24($sp)
|
||||
/* BDDBE8 80240A38 0080982D */ daddu $s3, $a0, $zero
|
||||
/* BDDBEC 80240A3C AFBF0028 */ sw $ra, 0x28($sp)
|
||||
/* BDDBF0 80240A40 AFB20020 */ sw $s2, 0x20($sp)
|
||||
/* BDDBF4 80240A44 AFB1001C */ sw $s1, 0x1c($sp)
|
||||
/* BDDBF8 80240A48 AFB00018 */ sw $s0, 0x18($sp)
|
||||
/* BDDBFC 80240A4C 8E720148 */ lw $s2, 0x148($s3)
|
||||
/* BDDC00 80240A50 00A0882D */ daddu $s1, $a1, $zero
|
||||
/* BDDC04 80240A54 86440008 */ lh $a0, 8($s2)
|
||||
/* BDDC08 80240A58 0C00EABB */ jal get_npc_unsafe
|
||||
/* BDDC0C 80240A5C 00C0802D */ daddu $s0, $a2, $zero
|
||||
/* BDDC10 80240A60 0200202D */ daddu $a0, $s0, $zero
|
||||
/* BDDC14 80240A64 0240282D */ daddu $a1, $s2, $zero
|
||||
/* BDDC18 80240A68 AFA00010 */ sw $zero, 0x10($sp)
|
||||
/* BDDC1C 80240A6C 8E260024 */ lw $a2, 0x24($s1)
|
||||
/* BDDC20 80240A70 8E270028 */ lw $a3, 0x28($s1)
|
||||
/* BDDC24 80240A74 0C01242D */ jal func_800490B4
|
||||
/* BDDC28 80240A78 0040802D */ daddu $s0, $v0, $zero
|
||||
/* BDDC2C 80240A7C 1040000C */ beqz $v0, .L80240AB0
|
||||
/* BDDC30 80240A80 00000000 */ nop
|
||||
/* BDDC34 80240A84 C60C0038 */ lwc1 $f12, 0x38($s0)
|
||||
/* BDDC38 80240A88 3C02800F */ lui $v0, %hi(gPlayerStatusPtr)
|
||||
/* BDDC3C 80240A8C 8C427B30 */ lw $v0, %lo(gPlayerStatusPtr)($v0)
|
||||
/* BDDC40 80240A90 C60E0040 */ lwc1 $f14, 0x40($s0)
|
||||
/* BDDC44 80240A94 8C460028 */ lw $a2, 0x28($v0)
|
||||
/* BDDC48 80240A98 0C00A720 */ jal atan2
|
||||
/* BDDC4C 80240A9C 8C470030 */ lw $a3, 0x30($v0)
|
||||
/* BDDC50 80240AA0 2402000C */ addiu $v0, $zero, 0xc
|
||||
/* BDDC54 80240AA4 E600000C */ swc1 $f0, 0xc($s0)
|
||||
/* BDDC58 80240AA8 080902D3 */ j .L80240B4C
|
||||
/* BDDC5C 80240AAC AE620070 */ sw $v0, 0x70($s3)
|
||||
.L80240AB0:
|
||||
/* BDDC60 80240AB0 C60C0038 */ lwc1 $f12, 0x38($s0)
|
||||
/* BDDC64 80240AB4 8E4200D0 */ lw $v0, 0xd0($s2)
|
||||
/* BDDC68 80240AB8 C60E0040 */ lwc1 $f14, 0x40($s0)
|
||||
/* BDDC6C 80240ABC C4440000 */ lwc1 $f4, ($v0)
|
||||
/* BDDC70 80240AC0 46802120 */ cvt.s.w $f4, $f4
|
||||
/* BDDC74 80240AC4 44062000 */ mfc1 $a2, $f4
|
||||
/* BDDC78 80240AC8 C4440008 */ lwc1 $f4, 8($v0)
|
||||
/* BDDC7C 80240ACC 46802120 */ cvt.s.w $f4, $f4
|
||||
/* BDDC80 80240AD0 44072000 */ mfc1 $a3, $f4
|
||||
/* BDDC84 80240AD4 0C00A7B5 */ jal dist2D
|
||||
/* BDDC88 80240AD8 00000000 */ nop
|
||||
/* BDDC8C 80240ADC C6020018 */ lwc1 $f2, 0x18($s0)
|
||||
/* BDDC90 80240AE0 4602003E */ c.le.s $f0, $f2
|
||||
/* BDDC94 80240AE4 00000000 */ nop
|
||||
/* BDDC98 80240AE8 45000005 */ bc1f .L80240B00
|
||||
/* BDDC9C 80240AEC 2402000A */ addiu $v0, $zero, 0xa
|
||||
/* BDDCA0 80240AF0 A602008E */ sh $v0, 0x8e($s0)
|
||||
/* BDDCA4 80240AF4 24020032 */ addiu $v0, $zero, 0x32
|
||||
/* BDDCA8 80240AF8 080902D3 */ j .L80240B4C
|
||||
/* BDDCAC 80240AFC AE620070 */ sw $v0, 0x70($s3)
|
||||
.L80240B00:
|
||||
/* BDDCB0 80240B00 8602008C */ lh $v0, 0x8c($s0)
|
||||
/* BDDCB4 80240B04 14400011 */ bnez $v0, .L80240B4C
|
||||
/* BDDCB8 80240B08 00000000 */ nop
|
||||
/* BDDCBC 80240B0C C60C0038 */ lwc1 $f12, 0x38($s0)
|
||||
/* BDDCC0 80240B10 8E4200D0 */ lw $v0, 0xd0($s2)
|
||||
/* BDDCC4 80240B14 C60E0040 */ lwc1 $f14, 0x40($s0)
|
||||
/* BDDCC8 80240B18 C4440000 */ lwc1 $f4, ($v0)
|
||||
/* BDDCCC 80240B1C 46802120 */ cvt.s.w $f4, $f4
|
||||
/* BDDCD0 80240B20 44062000 */ mfc1 $a2, $f4
|
||||
/* BDDCD4 80240B24 C4440008 */ lwc1 $f4, 8($v0)
|
||||
/* BDDCD8 80240B28 46802120 */ cvt.s.w $f4, $f4
|
||||
/* BDDCDC 80240B2C 44072000 */ mfc1 $a3, $f4
|
||||
/* BDDCE0 80240B30 0C00A720 */ jal atan2
|
||||
/* BDDCE4 80240B34 00000000 */ nop
|
||||
/* BDDCE8 80240B38 8E050018 */ lw $a1, 0x18($s0)
|
||||
/* BDDCEC 80240B3C 44060000 */ mfc1 $a2, $f0
|
||||
/* BDDCF0 80240B40 0200202D */ daddu $a0, $s0, $zero
|
||||
/* BDDCF4 80240B44 0C00EA95 */ jal npc_move_heading
|
||||
/* BDDCF8 80240B48 AC86000C */ sw $a2, 0xc($a0)
|
||||
.L80240B4C:
|
||||
/* BDDCFC 80240B4C 8FBF0028 */ lw $ra, 0x28($sp)
|
||||
/* BDDD00 80240B50 8FB30024 */ lw $s3, 0x24($sp)
|
||||
/* BDDD04 80240B54 8FB20020 */ lw $s2, 0x20($sp)
|
||||
/* BDDD08 80240B58 8FB1001C */ lw $s1, 0x1c($sp)
|
||||
/* BDDD0C 80240B5C 8FB00018 */ lw $s0, 0x18($sp)
|
||||
/* BDDD10 80240B60 03E00008 */ jr $ra
|
||||
/* BDDD14 80240B64 27BD0030 */ addiu $sp, $sp, 0x30
|
@ -1,240 +0,0 @@
|
||||
.set noat # allow manual use of $at
|
||||
.set noreorder # don't insert nops after branches
|
||||
|
||||
glabel func_80240C90_BDDE40
|
||||
/* BDDE40 80240C90 27BDFFB0 */ addiu $sp, $sp, -0x50
|
||||
/* BDDE44 80240C94 AFB3003C */ sw $s3, 0x3c($sp)
|
||||
/* BDDE48 80240C98 0080982D */ daddu $s3, $a0, $zero
|
||||
/* BDDE4C 80240C9C AFBF0048 */ sw $ra, 0x48($sp)
|
||||
/* BDDE50 80240CA0 AFB50044 */ sw $s5, 0x44($sp)
|
||||
/* BDDE54 80240CA4 AFB40040 */ sw $s4, 0x40($sp)
|
||||
/* BDDE58 80240CA8 AFB20038 */ sw $s2, 0x38($sp)
|
||||
/* BDDE5C 80240CAC AFB10034 */ sw $s1, 0x34($sp)
|
||||
/* BDDE60 80240CB0 AFB00030 */ sw $s0, 0x30($sp)
|
||||
/* BDDE64 80240CB4 8E720148 */ lw $s2, 0x148($s3)
|
||||
/* BDDE68 80240CB8 86440008 */ lh $a0, 8($s2)
|
||||
/* BDDE6C 80240CBC 0C00EABB */ jal get_npc_unsafe
|
||||
/* BDDE70 80240CC0 00A0882D */ daddu $s1, $a1, $zero
|
||||
/* BDDE74 80240CC4 0260202D */ daddu $a0, $s3, $zero
|
||||
/* BDDE78 80240CC8 8E70000C */ lw $s0, 0xc($s3)
|
||||
/* BDDE7C 80240CCC 0040A82D */ daddu $s5, $v0, $zero
|
||||
/* BDDE80 80240CD0 8E050000 */ lw $a1, ($s0)
|
||||
/* BDDE84 80240CD4 0C0B1EAF */ jal get_variable
|
||||
/* BDDE88 80240CD8 26100004 */ addiu $s0, $s0, 4
|
||||
/* BDDE8C 80240CDC 0260202D */ daddu $a0, $s3, $zero
|
||||
/* BDDE90 80240CE0 8E050000 */ lw $a1, ($s0)
|
||||
/* BDDE94 80240CE4 0C0B1EAF */ jal get_variable
|
||||
/* BDDE98 80240CE8 0040A02D */ daddu $s4, $v0, $zero
|
||||
/* BDDE9C 80240CEC AE420094 */ sw $v0, 0x94($s2)
|
||||
/* BDDEA0 80240CF0 AFA00010 */ sw $zero, 0x10($sp)
|
||||
/* BDDEA4 80240CF4 8E4200D0 */ lw $v0, 0xd0($s2)
|
||||
/* BDDEA8 80240CF8 8C420030 */ lw $v0, 0x30($v0)
|
||||
/* BDDEAC 80240CFC AFA20014 */ sw $v0, 0x14($sp)
|
||||
/* BDDEB0 80240D00 8E4200D0 */ lw $v0, 0xd0($s2)
|
||||
/* BDDEB4 80240D04 8C42001C */ lw $v0, 0x1c($v0)
|
||||
/* BDDEB8 80240D08 AFA20018 */ sw $v0, 0x18($sp)
|
||||
/* BDDEBC 80240D0C 8E4200D0 */ lw $v0, 0xd0($s2)
|
||||
/* BDDEC0 80240D10 8C420024 */ lw $v0, 0x24($v0)
|
||||
/* BDDEC4 80240D14 AFA2001C */ sw $v0, 0x1c($sp)
|
||||
/* BDDEC8 80240D18 8E4200D0 */ lw $v0, 0xd0($s2)
|
||||
/* BDDECC 80240D1C 8C420028 */ lw $v0, 0x28($v0)
|
||||
/* BDDED0 80240D20 AFA20020 */ sw $v0, 0x20($sp)
|
||||
/* BDDED4 80240D24 8E4200D0 */ lw $v0, 0xd0($s2)
|
||||
/* BDDED8 80240D28 3C014220 */ lui $at, 0x4220
|
||||
/* BDDEDC 80240D2C 44810000 */ mtc1 $at, $f0
|
||||
/* BDDEE0 80240D30 8C42002C */ lw $v0, 0x2c($v0)
|
||||
/* BDDEE4 80240D34 27B00010 */ addiu $s0, $sp, 0x10
|
||||
/* BDDEE8 80240D38 E7A00028 */ swc1 $f0, 0x28($sp)
|
||||
/* BDDEEC 80240D3C A7A0002C */ sh $zero, 0x2c($sp)
|
||||
/* BDDEF0 80240D40 12200012 */ beqz $s1, .L80240D8C
|
||||
/* BDDEF4 80240D44 AFA20024 */ sw $v0, 0x24($sp)
|
||||
/* BDDEF8 80240D48 AE600070 */ sw $zero, 0x70($s3)
|
||||
/* BDDEFC 80240D4C 8EA30000 */ lw $v1, ($s5)
|
||||
/* BDDF00 80240D50 2402F7FF */ addiu $v0, $zero, -0x801
|
||||
/* BDDF04 80240D54 A6A0008E */ sh $zero, 0x8e($s5)
|
||||
/* BDDF08 80240D58 00621824 */ and $v1, $v1, $v0
|
||||
/* BDDF0C 80240D5C AEA30000 */ sw $v1, ($s5)
|
||||
/* BDDF10 80240D60 8E4200D0 */ lw $v0, 0xd0($s2)
|
||||
/* BDDF14 80240D64 8C420034 */ lw $v0, 0x34($v0)
|
||||
/* BDDF18 80240D68 54400005 */ bnel $v0, $zero, .L80240D80
|
||||
/* BDDF1C 80240D6C 2402FDFF */ addiu $v0, $zero, -0x201
|
||||
/* BDDF20 80240D70 34620200 */ ori $v0, $v1, 0x200
|
||||
/* BDDF24 80240D74 2403FFF7 */ addiu $v1, $zero, -9
|
||||
/* BDDF28 80240D78 08090362 */ j .L80240D88
|
||||
/* BDDF2C 80240D7C 00431024 */ and $v0, $v0, $v1
|
||||
.L80240D80:
|
||||
/* BDDF30 80240D80 00621024 */ and $v0, $v1, $v0
|
||||
/* BDDF34 80240D84 34420008 */ ori $v0, $v0, 8
|
||||
.L80240D88:
|
||||
/* BDDF38 80240D88 AEA20000 */ sw $v0, ($s5)
|
||||
.L80240D8C:
|
||||
/* BDDF3C 80240D8C 8E4300B0 */ lw $v1, 0xb0($s2)
|
||||
/* BDDF40 80240D90 30620004 */ andi $v0, $v1, 4
|
||||
/* BDDF44 80240D94 10400007 */ beqz $v0, .L80240DB4
|
||||
/* BDDF48 80240D98 00000000 */ nop
|
||||
/* BDDF4C 80240D9C 824200B4 */ lb $v0, 0xb4($s2)
|
||||
/* BDDF50 80240DA0 14400086 */ bnez $v0, .L80240FBC
|
||||
/* BDDF54 80240DA4 0000102D */ daddu $v0, $zero, $zero
|
||||
/* BDDF58 80240DA8 2402FFFB */ addiu $v0, $zero, -5
|
||||
/* BDDF5C 80240DAC 00621024 */ and $v0, $v1, $v0
|
||||
/* BDDF60 80240DB0 AE4200B0 */ sw $v0, 0xb0($s2)
|
||||
.L80240DB4:
|
||||
/* BDDF64 80240DB4 8E620070 */ lw $v0, 0x70($s3)
|
||||
/* BDDF68 80240DB8 2442FFF4 */ addiu $v0, $v0, -0xc
|
||||
/* BDDF6C 80240DBC 2C420003 */ sltiu $v0, $v0, 3
|
||||
/* BDDF70 80240DC0 10400007 */ beqz $v0, .L80240DE0
|
||||
/* BDDF74 80240DC4 0260202D */ daddu $a0, $s3, $zero
|
||||
/* BDDF78 80240DC8 0280282D */ daddu $a1, $s4, $zero
|
||||
/* BDDF7C 80240DCC 0C090000 */ jal func_80240000_BDD1B0
|
||||
/* BDDF80 80240DD0 0200302D */ daddu $a2, $s0, $zero
|
||||
/* BDDF84 80240DD4 10400002 */ beqz $v0, .L80240DE0
|
||||
/* BDDF88 80240DD8 24020014 */ addiu $v0, $zero, 0x14
|
||||
/* BDDF8C 80240DDC AE620070 */ sw $v0, 0x70($s3)
|
||||
.L80240DE0:
|
||||
/* BDDF90 80240DE0 8E630070 */ lw $v1, 0x70($s3)
|
||||
/* BDDF94 80240DE4 2C620035 */ sltiu $v0, $v1, 0x35
|
||||
/* BDDF98 80240DE8 10400073 */ beqz $v0, L80240FB8_BDE168
|
||||
/* BDDF9C 80240DEC 00031080 */ sll $v0, $v1, 2
|
||||
/* BDDFA0 80240DF0 3C018024 */ lui $at, %hi(jtbl_80241B08_BDECB8)
|
||||
/* BDDFA4 80240DF4 00220821 */ addu $at, $at, $v0
|
||||
/* BDDFA8 80240DF8 8C221B08 */ lw $v0, %lo(jtbl_80241B08_BDECB8)($at)
|
||||
/* BDDFAC 80240DFC 00400008 */ jr $v0
|
||||
/* BDDFB0 80240E00 00000000 */ nop
|
||||
glabel L80240E04_BDDFB4
|
||||
/* BDDFB4 80240E04 0260202D */ daddu $a0, $s3, $zero
|
||||
/* BDDFB8 80240E08 0280282D */ daddu $a1, $s4, $zero
|
||||
/* BDDFBC 80240E0C 0C090058 */ jal arn_02_UnkNpcAIFunc18
|
||||
/* BDDFC0 80240E10 0200302D */ daddu $a2, $s0, $zero
|
||||
glabel L80240E14_BDDFC4
|
||||
/* BDDFC4 80240E14 0260202D */ daddu $a0, $s3, $zero
|
||||
/* BDDFC8 80240E18 0280282D */ daddu $a1, $s4, $zero
|
||||
/* BDDFCC 80240E1C 0C090075 */ jal func_802401D4_BDD384
|
||||
/* BDDFD0 80240E20 0200302D */ daddu $a2, $s0, $zero
|
||||
/* BDDFD4 80240E24 8E630070 */ lw $v1, 0x70($s3)
|
||||
/* BDDFD8 80240E28 24020002 */ addiu $v0, $zero, 2
|
||||
/* BDDFDC 80240E2C 14620063 */ bne $v1, $v0, .L80240FBC
|
||||
/* BDDFE0 80240E30 0000102D */ daddu $v0, $zero, $zero
|
||||
glabel L80240E34_BDDFE4
|
||||
/* BDDFE4 80240E34 0260202D */ daddu $a0, $s3, $zero
|
||||
/* BDDFE8 80240E38 0280282D */ daddu $a1, $s4, $zero
|
||||
/* BDDFEC 80240E3C 0C0900C1 */ jal arn_02_UnkNpcAIFunc21
|
||||
/* BDDFF0 80240E40 0200302D */ daddu $a2, $s0, $zero
|
||||
/* BDDFF4 80240E44 8E630070 */ lw $v1, 0x70($s3)
|
||||
/* BDDFF8 80240E48 24020003 */ addiu $v0, $zero, 3
|
||||
/* BDDFFC 80240E4C 1462005B */ bne $v1, $v0, .L80240FBC
|
||||
/* BDE000 80240E50 0000102D */ daddu $v0, $zero, $zero
|
||||
glabel L80240E54_BDE004
|
||||
/* BDE004 80240E54 0260202D */ daddu $a0, $s3, $zero
|
||||
/* BDE008 80240E58 0280282D */ daddu $a1, $s4, $zero
|
||||
/* BDE00C 80240E5C 0C0900E8 */ jal arn_02_UnkNpcAIFunc20
|
||||
/* BDE010 80240E60 0200302D */ daddu $a2, $s0, $zero
|
||||
/* BDE014 80240E64 8E630070 */ lw $v1, 0x70($s3)
|
||||
/* BDE018 80240E68 24020004 */ addiu $v0, $zero, 4
|
||||
/* BDE01C 80240E6C 14620053 */ bne $v1, $v0, .L80240FBC
|
||||
/* BDE020 80240E70 0000102D */ daddu $v0, $zero, $zero
|
||||
glabel L80240E74_BDE024
|
||||
/* BDE024 80240E74 0260202D */ daddu $a0, $s3, $zero
|
||||
/* BDE028 80240E78 0280282D */ daddu $a1, $s4, $zero
|
||||
/* BDE02C 80240E7C 0C09010A */ jal arn_02_UnkNpcAIFunc22
|
||||
/* BDE030 80240E80 0200302D */ daddu $a2, $s0, $zero
|
||||
glabel L80240E84_BDE034
|
||||
/* BDE034 80240E84 0260202D */ daddu $a0, $s3, $zero
|
||||
/* BDE038 80240E88 0280282D */ daddu $a1, $s4, $zero
|
||||
/* BDE03C 80240E8C 0C090134 */ jal func_802404D0_BDD680
|
||||
/* BDE040 80240E90 0200302D */ daddu $a2, $s0, $zero
|
||||
/* BDE044 80240E94 080903EF */ j .L80240FBC
|
||||
/* BDE048 80240E98 0000102D */ daddu $v0, $zero, $zero
|
||||
glabel L80240E9C_BDE04C
|
||||
/* BDE04C 80240E9C 0260202D */ daddu $a0, $s3, $zero
|
||||
/* BDE050 80240EA0 0280282D */ daddu $a1, $s4, $zero
|
||||
/* BDE054 80240EA4 0C0127DF */ jal func_80049F7C
|
||||
/* BDE058 80240EA8 0200302D */ daddu $a2, $s0, $zero
|
||||
/* BDE05C 80240EAC 8E630070 */ lw $v1, 0x70($s3)
|
||||
/* BDE060 80240EB0 2402000D */ addiu $v0, $zero, 0xd
|
||||
/* BDE064 80240EB4 14620041 */ bne $v1, $v0, .L80240FBC
|
||||
/* BDE068 80240EB8 0000102D */ daddu $v0, $zero, $zero
|
||||
glabel L80240EBC_BDE06C
|
||||
/* BDE06C 80240EBC 0260202D */ daddu $a0, $s3, $zero
|
||||
/* BDE070 80240EC0 0280282D */ daddu $a1, $s4, $zero
|
||||
/* BDE074 80240EC4 0C012849 */ jal func_8004A124
|
||||
/* BDE078 80240EC8 0200302D */ daddu $a2, $s0, $zero
|
||||
/* BDE07C 80240ECC 8E630070 */ lw $v1, 0x70($s3)
|
||||
/* BDE080 80240ED0 2402000E */ addiu $v0, $zero, 0xe
|
||||
/* BDE084 80240ED4 14620039 */ bne $v1, $v0, .L80240FBC
|
||||
/* BDE088 80240ED8 0000102D */ daddu $v0, $zero, $zero
|
||||
glabel L80240EDC_BDE08C
|
||||
/* BDE08C 80240EDC 96A2008E */ lhu $v0, 0x8e($s5)
|
||||
/* BDE090 80240EE0 2442FFFF */ addiu $v0, $v0, -1
|
||||
/* BDE094 80240EE4 A6A2008E */ sh $v0, 0x8e($s5)
|
||||
/* BDE098 80240EE8 00021400 */ sll $v0, $v0, 0x10
|
||||
/* BDE09C 80240EEC 14400033 */ bnez $v0, .L80240FBC
|
||||
/* BDE0A0 80240EF0 0000102D */ daddu $v0, $zero, $zero
|
||||
/* BDE0A4 80240EF4 24020028 */ addiu $v0, $zero, 0x28
|
||||
/* BDE0A8 80240EF8 080903EE */ j L80240FB8_BDE168
|
||||
/* BDE0AC 80240EFC AE620070 */ sw $v0, 0x70($s3)
|
||||
glabel L80240F00_BDE0B0
|
||||
/* BDE0B0 80240F00 0260202D */ daddu $a0, $s3, $zero
|
||||
/* BDE0B4 80240F04 0280282D */ daddu $a1, $s4, $zero
|
||||
/* BDE0B8 80240F08 0C090191 */ jal arn_02_UnkNpcAIFunc16
|
||||
/* BDE0BC 80240F0C 0200302D */ daddu $a2, $s0, $zero
|
||||
glabel L80240F10_BDE0C0
|
||||
/* BDE0C0 80240F10 0260202D */ daddu $a0, $s3, $zero
|
||||
/* BDE0C4 80240F14 0280282D */ daddu $a1, $s4, $zero
|
||||
/* BDE0C8 80240F18 0C0901A5 */ jal func_80240694_BDD844
|
||||
/* BDE0CC 80240F1C 0200302D */ daddu $a2, $s0, $zero
|
||||
/* BDE0D0 80240F20 080903EF */ j .L80240FBC
|
||||
/* BDE0D4 80240F24 0000102D */ daddu $v0, $zero, $zero
|
||||
glabel L80240F28_BDE0D8
|
||||
/* BDE0D8 80240F28 0260202D */ daddu $a0, $s3, $zero
|
||||
/* BDE0DC 80240F2C 0280282D */ daddu $a1, $s4, $zero
|
||||
/* BDE0E0 80240F30 0C09020D */ jal func_80240834_BDD9E4
|
||||
/* BDE0E4 80240F34 0200302D */ daddu $a2, $s0, $zero
|
||||
/* BDE0E8 80240F38 080903EF */ j .L80240FBC
|
||||
/* BDE0EC 80240F3C 0000102D */ daddu $v0, $zero, $zero
|
||||
glabel L80240F40_BDE0F0
|
||||
/* BDE0F0 80240F40 0260202D */ daddu $a0, $s3, $zero
|
||||
/* BDE0F4 80240F44 0280282D */ daddu $a1, $s4, $zero
|
||||
/* BDE0F8 80240F48 0C090261 */ jal func_80240984_BDDB34
|
||||
/* BDE0FC 80240F4C 0200302D */ daddu $a2, $s0, $zero
|
||||
/* BDE100 80240F50 8E630070 */ lw $v1, 0x70($s3)
|
||||
/* BDE104 80240F54 24020029 */ addiu $v0, $zero, 0x29
|
||||
/* BDE108 80240F58 14620018 */ bne $v1, $v0, .L80240FBC
|
||||
/* BDE10C 80240F5C 0000102D */ daddu $v0, $zero, $zero
|
||||
glabel L80240F60_BDE110
|
||||
/* BDE110 80240F60 0260202D */ daddu $a0, $s3, $zero
|
||||
/* BDE114 80240F64 0280282D */ daddu $a1, $s4, $zero
|
||||
/* BDE118 80240F68 0C09028C */ jal func_80240A30_BDDBE0
|
||||
/* BDE11C 80240F6C 0200302D */ daddu $a2, $s0, $zero
|
||||
/* BDE120 80240F70 080903EF */ j .L80240FBC
|
||||
/* BDE124 80240F74 0000102D */ daddu $v0, $zero, $zero
|
||||
glabel L80240F78_BDE128
|
||||
/* BDE128 80240F78 0260202D */ daddu $a0, $s3, $zero
|
||||
/* BDE12C 80240F7C 0280282D */ daddu $a1, $s4, $zero
|
||||
/* BDE130 80240F80 0C0902DA */ jal arn_02_UnkNpcAIFunc19
|
||||
/* BDE134 80240F84 0200302D */ daddu $a2, $s0, $zero
|
||||
glabel L80240F88_BDE138
|
||||
/* BDE138 80240F88 0260202D */ daddu $a0, $s3, $zero
|
||||
/* BDE13C 80240F8C 0280282D */ daddu $a1, $s4, $zero
|
||||
/* BDE140 80240F90 0C0902F9 */ jal arn_02_UnkNpcAIFunc17
|
||||
/* BDE144 80240F94 0200302D */ daddu $a2, $s0, $zero
|
||||
/* BDE148 80240F98 8E630070 */ lw $v1, 0x70($s3)
|
||||
/* BDE14C 80240F9C 24020034 */ addiu $v0, $zero, 0x34
|
||||
/* BDE150 80240FA0 14620006 */ bne $v1, $v0, .L80240FBC
|
||||
/* BDE154 80240FA4 0000102D */ daddu $v0, $zero, $zero
|
||||
glabel L80240FA8_BDE158
|
||||
/* BDE158 80240FA8 0260202D */ daddu $a0, $s3, $zero
|
||||
/* BDE15C 80240FAC 0280282D */ daddu $a1, $s4, $zero
|
||||
/* BDE160 80240FB0 0C090313 */ jal arn_02_UnkDurationCheck
|
||||
/* BDE164 80240FB4 0200302D */ daddu $a2, $s0, $zero
|
||||
glabel L80240FB8_BDE168
|
||||
/* BDE168 80240FB8 0000102D */ daddu $v0, $zero, $zero
|
||||
.L80240FBC:
|
||||
/* BDE16C 80240FBC 8FBF0048 */ lw $ra, 0x48($sp)
|
||||
/* BDE170 80240FC0 8FB50044 */ lw $s5, 0x44($sp)
|
||||
/* BDE174 80240FC4 8FB40040 */ lw $s4, 0x40($sp)
|
||||
/* BDE178 80240FC8 8FB3003C */ lw $s3, 0x3c($sp)
|
||||
/* BDE17C 80240FCC 8FB20038 */ lw $s2, 0x38($sp)
|
||||
/* BDE180 80240FD0 8FB10034 */ lw $s1, 0x34($sp)
|
||||
/* BDE184 80240FD4 8FB00030 */ lw $s0, 0x30($sp)
|
||||
/* BDE188 80240FD8 03E00008 */ jr $ra
|
||||
/* BDE18C 80240FDC 27BD0050 */ addiu $sp, $sp, 0x50
|
@ -6728,11 +6728,10 @@ segments:
|
||||
start: 0xBDD1B0
|
||||
vram: 0x80240000
|
||||
subsections:
|
||||
- [0xBDD1B0, c]
|
||||
- [0xBDE190, data]
|
||||
- [0xBDE2A0, data]
|
||||
- [0xBDE480, data]
|
||||
- [0xBDEC80, rodata]
|
||||
- [0xBDD1B0, c, events]
|
||||
- [0xBDE190, .data, header]
|
||||
- [0xBDE2A0, .data, events]
|
||||
- [0xBDEC80, .rodata, events]
|
||||
- name: world/area_arn/arn_03/
|
||||
type: code
|
||||
overlay: True
|
||||
@ -9505,6 +9504,7 @@ segments:
|
||||
ids:
|
||||
- [0x19, 0x03B, kmr_03_tattle]
|
||||
- [0x19, 0x040, kmr_12_tattle]
|
||||
- [0x19, 0x0BE, arn_02_tattle]
|
||||
|
||||
- [0x1C, 0x000, actor_goomba_tattle]
|
||||
- [0x1C, 0x001, actor_spiked_goomba_tattle]
|
||||
|
@ -6845,6 +6845,7 @@ battle_item_strange_cake_DrinkItem = 0x802A20F4; // type:data rom:0x7323F4
|
||||
battle_item_strange_cake_data = 0x802A27D0; // type:data rom:0x732AD0
|
||||
battle_item_strange_cake_D_802A2848_732B48 = 0x802A2848; // type:data rom:0x732B48
|
||||
battle_item_strange_cake_D_802A2858_732B58 = 0x802A2858; // type:data rom:0x732B58
|
||||
D_802A285A_732B5A = 0x802A285A; // type:data rom:0x732B5A
|
||||
battle_item_strange_cake_script6 = 0x802A2870; // type:data rom:0x732B70
|
||||
battle_item_strange_cake_script7 = 0x802A2B70; // type:data rom:0x732E70
|
||||
battle_item_strange_cake_script8 = 0x802A2C40; // type:data rom:0x732F40
|
||||
@ -8262,7 +8263,7 @@ kmr_03_Hit_80240F64 = 0x80240F64; // type:data rom:0x8C8EF4
|
||||
kmr_03_Init_802411A8 = 0x802411A8; // type:data rom:0x8C9138
|
||||
kmr_03_npcGroup_80241260 = 0x80241260; // type:data rom:0x8C91F0
|
||||
kmr_03_npcGroupList_80241450 = 0x80241450; // type:data rom:0x8C93E0
|
||||
padding2 = 0x80241468; // type:data rom:0x8C93F8
|
||||
kmr_03_padding2 = 0x80241468; // type:data rom:0x8C93F8
|
||||
kmr_03_Script_80241470 = 0x80241470; // type:data rom:0x8C9400
|
||||
kmr_03_Script_802414A8 = 0x802414A8; // type:data rom:0x8C9438
|
||||
kmr_03_Script_802414C8 = 0x802414C8; // type:data rom:0x8C9458
|
||||
@ -11920,6 +11921,25 @@ arn_02_UnkNpcAIFunc19 = 0x80240B68; // type:func rom:0xBDDD18
|
||||
arn_02_UnkNpcAIFunc17 = 0x80240BE4; // type:func rom:0xBDDD94
|
||||
arn_02_UnkDurationCheck = 0x80240C4C; // type:func rom:0xBDDDFC
|
||||
func_80240C90_BDDE40 = 0x80240C90; // type:func rom:0xBDDE40
|
||||
arn_02_entryList = 0x80240FE0; // type:data rom:0xBDE190
|
||||
arn_02_config = 0x80241000; // type:data rom:0xBDE1B0
|
||||
arn_02_PlayMusic = 0x80241040; // type:data rom:0xBDE1F0
|
||||
arn_02_Exit1 = 0x802410F0; // type:data rom:0xBDE2A0
|
||||
arn_02_Exit2 = 0x8024114C; // type:data rom:0xBDE2FC
|
||||
arn_02_BindExits = 0x802411A8; // type:data rom:0xBDE358
|
||||
arn_02_Main = 0x802411F0; // type:data rom:0xBDE3A0
|
||||
arn_02_padding2 = 0x802412C4; // type:data rom:0xBDE474
|
||||
arn_02_MakeEntities = 0x802412D0; // type:data rom:0xBDE480
|
||||
arn_02_goombaAISettings = 0x802413D0; // type:data rom:0xBDE580
|
||||
arn_02_GoombaAI = 0x80241400; // type:data rom:0xBDE5B0
|
||||
arn_02_goombaNpcSettings = 0x80241420; // type:data rom:0xBDE5D0
|
||||
arn_02_cleftAISettings = 0x8024144C; // type:data rom:0xBDE5FC
|
||||
arn_02_CleftAI = 0x8024147C; // type:data rom:0xBDE62C
|
||||
arn_02_cleftNpcSettings = 0x802414A0; // type:data rom:0xBDE650
|
||||
arn_02_CleftNPC1 = 0x802414CC; // type:data rom:0xBDE67C
|
||||
arn_02_CleftNPC2 = 0x802416BC; // type:data rom:0xBDE86C
|
||||
arn_02_GoombaNPC = 0x802418AC; // type:data rom:0xBDEA5C
|
||||
arn_02_npcGroupList = 0x80241A9C; // type:data rom:0xBDEC4C
|
||||
D_80241AE0_BDEC90 = 0x80241AE0; // type:data rom:0xBDEC90
|
||||
D_80241AE8_BDEC98 = 0x80241AE8; // type:data rom:0xBDEC98
|
||||
D_80241AF0_BDECA0 = 0x80241AF0; // type:data rom:0xBDECA0
|
||||
@ -15178,7 +15198,7 @@ func_802413CC_EBA21C = 0x802413CC; // type:func rom:0xEBA21C
|
||||
func_802413EC_EBA23C = 0x802413EC; // type:func rom:0xEBA23C
|
||||
D_802491F0_EC2040 = 0x802491F0; // type:data rom:0xEC2040
|
||||
D_802491F8_EC2048 = 0x802491F8; // type:data rom:0xEC2048
|
||||
func_80240000_EC2200 = 0x80240000; // type:func rom:0xEC2200
|
||||
code_EC2200_DeadUnk1 = 0x80240000; // type:func rom:0xEC2200
|
||||
func_80240040_EC2240 = 0x80240040; // type:func rom:0xEC2240
|
||||
func_802400F4_EC22F4 = 0x802400F4; // type:func rom:0xEC22F4
|
||||
func_80240158_EC2358 = 0x80240158; // type:func rom:0xEC2358
|
||||
@ -15187,6 +15207,7 @@ func_80240480_EC2680 = 0x80240480; // type:func rom:0xEC2680
|
||||
D_80240F28_EC3128 = 0x80240F28; // type:data rom:0xEC3128
|
||||
D_80244F88_EC7188 = 0x80244F88; // type:data rom:0xEC7188
|
||||
D_80244F90_EC7190 = 0x80244F90; // type:data rom:0xEC7190
|
||||
D_80244F98_EC7198 = 0x80244F98; // type:data rom:0xEC7198
|
||||
code_EC71B0_DeadUnkTexturePanFunc = 0x80240000; // type:func rom:0xEC71B0
|
||||
code_EC71B0_DeadUnkTexturePanFunc2 = 0x80240124; // type:func rom:0xEC72D4
|
||||
func_8024030C_EC74BC = 0x8024030C; // type:func rom:0xEC74BC
|
||||
@ -15214,7 +15235,7 @@ func_80240B38_ECA838 = 0x80240B38; // type:func rom:0xECA838
|
||||
code_EC9D00_DeadUnkPartnerPosFunc = 0x80240C78; // type:func rom:0xECA978
|
||||
code_EC9D00_DeadUnkPartnerPosFunc2 = 0x80240CC0; // type:func rom:0xECA9C0
|
||||
func_80240D08_ECAA08 = 0x80240D08; // type:func rom:0xECAA08
|
||||
func_80240D40_ECAA40 = 0x80240D40; // type:func rom:0xECAA40
|
||||
code_ECAA40_DeadUnk1 = 0x80240D40; // type:func rom:0xECAA40
|
||||
func_80240D80_ECAA80 = 0x80240D80; // type:func rom:0xECAA80
|
||||
func_80241364_ECB064 = 0x80241364; // type:func rom:0xECB064
|
||||
func_802414C8_ECB1C8 = 0x802414C8; // type:func rom:0xECB1C8
|
||||
@ -15236,7 +15257,7 @@ D_80241FF8_ECBCF8 = 0x80241FF8; // type:data rom:0xECBCF8
|
||||
D_80242038_ECBD38 = 0x80242038; // type:data rom:0xECBD38
|
||||
D_802430B8_ECCDB8 = 0x802430B8; // type:data rom:0xECCDB8
|
||||
D_802430BC_ECCDBC = 0x802430BC; // type:data rom:0xECCDBC
|
||||
func_80240000_ECFFF0 = 0x80240000; // type:func rom:0xECFFF0
|
||||
code_ECFFF0_DeadUnk1 = 0x80240000; // type:func rom:0xECFFF0
|
||||
func_80240040_ED0030 = 0x80240040; // type:func rom:0xED0030
|
||||
func_802400E0_ED00D0 = 0x802400E0; // type:func rom:0xED00D0
|
||||
func_80240150_ED0140 = 0x80240150; // type:func rom:0xED0140
|
||||
@ -15256,7 +15277,7 @@ D_802441D0_ED41C0 = 0x802441D0; // type:data rom:0xED41C0
|
||||
D_802441D8_ED41C8 = 0x802441D8; // type:data rom:0xED41C8
|
||||
D_802441E0_ED41D0 = 0x802441E0; // type:data rom:0xED41D0
|
||||
func_80240000_ED4220 = 0x80240000; // type:func rom:0xED4220
|
||||
func_80240040_ED4260 = 0x80240040; // type:func rom:0xED4260
|
||||
code_ED4260_DeadUnk1 = 0x80240040; // type:func rom:0xED4260
|
||||
func_80240080_ED42A0 = 0x80240080; // type:func rom:0xED42A0
|
||||
func_80240134_ED4354 = 0x80240134; // type:func rom:0xED4354
|
||||
func_80240198_ED43B8 = 0x80240198; // type:func rom:0xED43B8
|
||||
@ -15366,7 +15387,7 @@ D_80245380_EEB930 = 0x80245380; // type:data rom:0xEEB930
|
||||
D_80245388_EEB938 = 0x80245388; // type:data rom:0xEEB938
|
||||
D_80245390_EEB940 = 0x80245390; // type:data rom:0xEEB940
|
||||
D_802453E0_EEB990 = 0x802453E0; // type:data rom:0xEEB990
|
||||
func_80240000_EED100 = 0x80240000; // type:func rom:0xEED100
|
||||
code_EED100_DeadUnk1 = 0x80240000; // type:func rom:0xEED100
|
||||
func_80240040_EED140 = 0x80240040; // type:func rom:0xEED140
|
||||
func_802400E0_EED1E0 = 0x802400E0; // type:func rom:0xEED1E0
|
||||
func_802400FC_EED1FC = 0x802400FC; // type:func rom:0xEED1FC
|
||||
@ -15412,7 +15433,7 @@ D_80245450_EF2550 = 0x80245450; // type:data rom:0xEF2550
|
||||
D_80245458_EF2558 = 0x80245458; // type:data rom:0xEF2558
|
||||
D_80245460_EF2560 = 0x80245460; // type:data rom:0xEF2560
|
||||
D_802454A8_EF25A8 = 0x802454A8; // type:data rom:0xEF25A8
|
||||
func_80240000_EF2610 = 0x80240000; // type:func rom:0xEF2610
|
||||
code_EF2610_DeadUnk1 = 0x80240000; // type:func rom:0xEF2610
|
||||
func_80240040_EF2650 = 0x80240040; // type:func rom:0xEF2650
|
||||
func_80240070_EF2680 = 0x80240070; // type:func rom:0xEF2680
|
||||
func_80240220_EF2830 = 0x80240220; // type:func rom:0xEF2830
|
||||
@ -15443,15 +15464,15 @@ D_80245408_EF7A18 = 0x80245408; // type:data rom:0xEF7A18
|
||||
D_80245468_EF7A78 = 0x80245468; // type:data rom:0xEF7A78
|
||||
code_EF7A80_DeadUnkTexturePanFunc = 0x80240000; // type:func rom:0xEF7A80
|
||||
code_EF7A80_DeadUnkTexturePanFunc2 = 0x80240124; // type:func rom:0xEF7BA4
|
||||
func_8024030C_EF7D8C = 0x8024030C; // type:func rom:0xEF7D8C
|
||||
code_EF7A80_DeadUnk1 = 0x8024030C; // type:func rom:0xEF7D8C
|
||||
func_80240340_EF7DC0 = 0x80240340; // type:func rom:0xEF7DC0
|
||||
func_80240394_EF7E14 = 0x80240394; // type:func rom:0xEF7E14
|
||||
code_EF7A80_DeadUnkFloatFunc = 0x80240394; // type:func rom:0xEF7E14
|
||||
func_80240530_EF7FB0 = 0x80240530; // type:func rom:0xEF7FB0
|
||||
func_80240590_EF8010 = 0x80240590; // type:func rom:0xEF8010
|
||||
func_80240600_EF8080 = 0x80240600; // type:func rom:0xEF8080
|
||||
code_EFEB00_DeadUnkTexturePanFunc = 0x80240000; // type:func rom:0xEFEB00
|
||||
code_EFEB00_DeadUnkTexturePanFunc2 = 0x80240124; // type:func rom:0xEFEC24
|
||||
func_8024030C_EFEE0C = 0x8024030C; // type:func rom:0xEFEE0C
|
||||
code_EFEB00_DeadUnk1 = 0x8024030C; // type:func rom:0xEFEE0C
|
||||
func_80240340_EFEE40 = 0x80240340; // type:func rom:0xEFEE40
|
||||
func_802404D0_EFEFD0 = 0x802404D0; // type:func rom:0xEFEFD0
|
||||
func_80240540_EFF040 = 0x80240540; // type:func rom:0xEFF040
|
||||
|
Loading…
Reference in New Issue
Block a user