Tables & Chairs (sorry no chairs actually) (#800)

* git subrepo pull --force tools/splat

subrepo:
  subdir:   "tools/splat"
  merged:   "ec7bd4868e"
upstream:
  origin:   "https://github.com/ethteck/splat.git"
  branch:   "master"
  commit:   "ec7bd4868e"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo"
  commit:   "2f68596"

* wips

* more

* wipperz

* it workz

* mdl_make_local_vertex_copy

* sleep_bubble finished + gfx

* fire_breath gfx

* func_800F0490

* func_800EFE2C

* 8a860 funcs

* cleanup + dead cod

* dead clean

* git subrepo pull --force tools/splat

subrepo:
  subdir:   "tools/splat"
  merged:   "a1730f38ad"
upstream:
  origin:   "https://github.com/ethteck/splat.git"
  branch:   "master"
  commit:   "a1730f38ad"
git-subrepo:
  version:  "0.4.5"
  origin:   "https://github.com/ingydotnet/git-subrepo"
  commit:   "aa416e4"

* cleanup + splat prep

* git subrepo pull --force tools/splat

subrepo:
  subdir:   "tools/splat"
  merged:   "4e5fca24a5"
upstream:
  origin:   "https://github.com/ethteck/splat.git"
  branch:   "master"
  commit:   "4e5fca24a5"
git-subrepo:
  version:  "0.4.5"
  origin:   "https://github.com/ingydotnet/git-subrepo"
  commit:   "aa416e4"

* bits

* clean

* bss c -> asm

* btl_update_starpoints_display

* is_debug + cleanup

* load_script / 190B20 data

* all the symz

* clean

* cleanup + stuff
This commit is contained in:
Ethan Roseman 2022-10-04 23:09:23 +09:00 committed by GitHub
parent f62c83607e
commit 73af4eb5a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
138 changed files with 4384 additions and 5276 deletions

View File

@ -1,9 +1,6 @@
#ifndef _DEAD_H_
#define _DEAD_H_
// There can be multiple invalid references to a symbol from the dead code,
// so some symbols here have a "2" suffix.
#define gCameras dead_gCameras
#define evt_get_variable dead_evt_get_variable
#define evt_set_variable dead_evt_set_variable
@ -109,7 +106,11 @@
#define destroy_popup_menu dead_destroy_popup_menu
#define heap_free dead_heap_free
#define entity_upgrade_block_hide_content dead_entity_upgrade_block_hide_content
#define func_8003D660 dead_func_80041080
#define fx_misc_particles dead_fx_misc_particles
#define transform_point dead_transform_point
#define gMasterGfxPos dead_gMasterGfxPos
#define osVirtualToPhysical dead_osVirtualToPhysical
#define nuGfxZBuffer dead_nuGfxZBuffer
#define nuGfxCfb_ptr dead_nuGfxCfb_ptr
#endif

View File

@ -1688,7 +1688,7 @@ enum ItemIDs {
ITEM_ATTACK_FX_A = 0x000000F3,
ITEM_ALLOR_NOTHING = 0x000000F4,
ITEM_HP_DRAIN = 0x000000F5,
ITEM_BOOTS_CHARGE0 = 0x000000F6,
ITEM_BOOTS_CHARGE0 = 0x000000F6,
ITEM_SLOW_GO = 0x000000F7,
ITEM_FP_PLUS_A = 0x000000F8,
ITEM_MEGA_RUSH = 0x000000F9,
@ -1708,7 +1708,7 @@ enum ItemIDs {
ITEM_HAMMER_THROW = 0x00000107,
ITEM_MEGA_QUAKE = 0x00000108,
ITEM_SMASH_CHARGE = 0x00000109,
ITEM_BOOTS_CHARGE = 0x0000010A,
ITEM_BOOTS_CHARGE = 0x0000010A,
ITEM_S_SMASH_CHG = 0x0000010B,
ITEM_S_JUMP_CHG = 0x0000010C,
ITEM_POWER_RUSH = 0x0000010D,
@ -3281,7 +3281,8 @@ enum PopupType {
POPUP_MENU_TAKE_FROM_CHEST = 0x9,
POPUP_MENU_READ_DIARY_PAGE = 0xA,
POPUP_MENU_READ_POSTCARD = 0xB,
POPUP_MENU_USEKEY = 0xC
POPUP_MENU_USEKEY = 0xC,
POPUP_MENU_D = 0xD,
};
/// not really

View File

@ -493,7 +493,7 @@ ItemEntity* get_item_entity(s32 itemEntityIndex);
s32 make_item_entity_nodelay(s32 itemID, f32 x, f32 y, f32 z, s32 itemSpawnMode, s32 pickupVar);
void set_item_entity_flags(s32 itemEntityIndex, s32 flag);
s32 create_generic_entity_frontUI(void (*updateFunc)(void), void (*drawFunc)(void));
s32 create_generic_entity_frontUI(s32 (*updateFunc)(void), void (*drawFunc)(void));
DynamicEntity* get_generic_entity(s32 idx);
Trigger* bind_trigger_1(EvtScript* script, s32 flags, s32 triggerFlagIndex, s32 triggerVar0, s32 triggerVar1, s32 priority);

View File

@ -37,8 +37,6 @@ extern ActionCommandStatus gActionCommandStatus;
extern s32 D_802DAC98;
extern s32 gMoveScriptTable[][4];
extern EntityList gWorldEntityList;
extern EntityList gBattleEntityList;
extern EntityList* gCurrentEntityListPtr;

View File

@ -36,11 +36,11 @@ void spr_swizzle_anim_offsets(s32 arg0, s32 base, void* spriteData) {
s32 animOffset;
s32 compOffset;
s32 temp;
// required to match, spriteData->animList would be nicer
animList = (SpriteAnimComponent***) spriteData;
animList += 4;
while (TRUE) {
if (*animList == PTR_LIST_END) {
break;
@ -205,6 +205,7 @@ void spr_update_player_raster_cache(void) {
}
}
void spr_load_npc_extra_anims(SpriteAnimData*, u32*);
INCLUDE_ASM(s32, "101b90_len_8f0", spr_load_npc_extra_anims);
#ifdef NON_MATCHING
@ -239,7 +240,7 @@ SpriteComponent** spr_allocate_components(s32 count) {
component++;
}
*listPos = PTR_LIST_END;
return listStart;
}
#else

View File

@ -13,13 +13,17 @@ s16 D_802809F6 = -1;
s16 D_802809F8 = 0;
u16 D_802809FA = 0;
BSS s32 bSavedPartner;
BSS s32 bSavedOverrideFlags;
BSS s32 D_8029DA38[2]; // unused?
BSS s32 D_8029DA40;
BSS s32 D_8029DA44;
BSS s32 D_8029DA48;
BSS s32 D_8029DA4C;
BSS s32 bSavedPartner = 0;
BSS s32 bSavedOverrideFlags = 0;
BSS s32 D_8029DA38 = 0; // unused?
BSS s32 D_8029DA3C = 0; // unused?
BSS s32 D_8029DA40 = 0;
BSS s32 D_8029DA44 = 0;
BSS s32 D_8029DA48 = 0;
// The following var has a nop issue, and the only way to fix it is by initializing it.
// However, this puts it at the beginning of the BSS section, so all preceeding BSS needs to be initialized as well.
BSS s32 D_8029DA4C = 0;
BSS Camera D_8029DA50[ARRAY_COUNT(gCameras)];
BSS f32 D_8029EFB0;
BSS f32 D_8029EFB4;
@ -810,8 +814,6 @@ void btl_draw_enemy_health_bars(void) {
}
}
// needs insane amount of data migration (1AF2D0.c)
#ifdef NON_MATCHING
void btl_update_starpoints_display(void) {
BattleStatus* battleStatus = &gBattleStatus;
s32 cond;
@ -885,7 +887,7 @@ void btl_update_starpoints_display(void) {
for (i = 0; i < tens; i++) {
id = D_8029EFC0[i];
if (hud_element_get_script(id) != HES_Item_StarPoint) {
if (hud_element_get_script(id) != &HES_Item_StarPoint) {
hud_element_set_script(id, &HES_Item_StarPoint);
}
hud_element_clear_flags(id, 2);
@ -893,7 +895,7 @@ void btl_update_starpoints_display(void) {
hud_element_draw_clipped(id);
id = D_8029EFE8[i];
if (hud_element_get_script(id) != HES_StatusSPShine) {
if (hud_element_get_script(id) != &HES_StatusSPShine) {
hud_element_set_script(id, &HES_StatusSPShine);
}
hud_element_clear_flags(id, 2);
@ -903,8 +905,8 @@ void btl_update_starpoints_display(void) {
}
for (; i < ARRAY_COUNT(D_8029EFC0); i++) {
hud_element_set_flags(D_8029EFC0[i], HUD_ELEMENT_FLAGS_FILTER_TEX);
hud_element_set_flags(D_8029EFE8[i], HUD_ELEMENT_FLAGS_FILTER_TEX);
hud_element_set_flags(D_8029EFC0[i], HUD_ELEMENT_FLAGS_DISABLED);
hud_element_set_flags(D_8029EFE8[i], HUD_ELEMENT_FLAGS_DISABLED);
}
posX = D_8029DA40;
@ -918,7 +920,7 @@ void btl_update_starpoints_display(void) {
for (i = 0; i < ones; i++) {
id = D_8029F010[i];
if (hud_element_get_script(id) != HES_Item_SmallStarPoint) {
if (hud_element_get_script(id) != &HES_Item_SmallStarPoint) {
hud_element_set_script(id, &HES_Item_SmallStarPoint);
}
hud_element_clear_flags(id, 2);
@ -928,14 +930,11 @@ void btl_update_starpoints_display(void) {
}
for (; i < ARRAY_COUNT(D_8029F010); i++) {
hud_element_set_flags(D_8029F010[i], HUD_ELEMENT_FLAGS_FILTER_TEX);
hud_element_set_flags(D_8029F010[i], HUD_ELEMENT_FLAGS_DISABLED);
}
}
}
}
#else
INCLUDE_ASM(s32, "16c8e0", btl_update_starpoints_display);
#endif
void btl_save_world_cameras(void) {
PlayerStatus* playerStatus = &gPlayerStatus;

View File

@ -2,6 +2,7 @@
#include "nu/nusys.h"
#include "effects.h"
#include "battle/battle.h"
#include "script_api/battle.h"
#include "model.h"
#include "sprite.h"
@ -13,20 +14,46 @@ typedef struct PartnerDMAData {
/* 0x10 */ s32 y;
} PartnerDMAData; // size = 0x14
extern EvtScript D_80293820;
extern f32 D_802938A4;
extern s16 D_802938A8;
extern EffectInstance* gDamageCountEffects[24];
extern s32 gDamageCountTimers[24];
extern Gfx D_80293970[];
extern s32 D_802939C0;
extern EvtScript D_802939C4;
extern EvtScript D_80293A10;
extern EvtScript D_80293A34;
extern EvtScript D_80293A58;
extern EvtScript D_80293A7C;
extern EvtScript D_80293AA0;
extern EvtScript D_80293AC4;
EvtScript D_80293820 = {
EVT_WAIT(LocalVar(0))
EVT_LOOP(4)
EVT_CALL(SetBattleCamParam, 4, 11)
EVT_WAIT(1)
EVT_CALL(SetBattleCamParam, 4, 5)
EVT_WAIT(1)
EVT_END_LOOP
EVT_CALL(SetBattleCamParam, 4, 8)
EVT_RETURN
EVT_END
};
f32 D_802938A4 = 0.0f;
s16 D_802938A8 = 4;
EffectInstance* gDamageCountEffects[] = {
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL,
};
s32 gDamageCountTimers[] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
Gfx D_80293970[] = {
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF),
gsDPSetCycleType(G_CYC_1CYCLE),
gsDPSetTexturePersp(G_TP_NONE),
gsDPSetTextureDetail(G_TD_CLAMP),
gsDPSetTextureLOD(G_TL_TILE),
gsDPSetTextureFilter(G_TF_POINT),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureConvert(G_TC_FILT),
gsSPEndDisplayList(),
};
s32 D_802939C0 = 0;
// from 17D6A0
extern s32 bMarioDefenseTable[];
@ -2670,6 +2697,74 @@ void show_foreground_models(void) {
#include "common/StartRumbleWithParams.inc.c"
EvtScript D_802939C4 = {
EVT_CALL(N(StartRumbleWithParams), 256, 30)
EVT_CALL(N(StartRumbleWithParams), 200, 15)
EVT_CALL(N(StartRumbleWithParams), 50, 15)
EVT_RETURN
EVT_END
};
EvtScript D_80293A10 = {
EVT_CALL(N(StartRumbleWithParams), 100, 20)
EVT_RETURN
EVT_END
};
EvtScript D_80293A34 = {
EVT_CALL(N(StartRumbleWithParams), 150, 20)
EVT_RETURN
EVT_END
};
EvtScript D_80293A58 = {
EVT_CALL(N(StartRumbleWithParams), 200, 30)
EVT_RETURN
EVT_END
};
EvtScript D_80293A7C = {
EVT_CALL(N(StartRumbleWithParams), 256, 40)
EVT_RETURN
EVT_END
};
EvtScript D_80293AA0 = {
EVT_CALL(N(StartRumbleWithParams), 256, 60)
EVT_RETURN
EVT_END
};
EvtScript D_80293AC4 = {
EVT_CALL(N(StartRumbleWithParams), 100, 20)
EVT_RETURN
EVT_END
};
EvtScript D_80293AE8 = {
EVT_CALL(N(StartRumbleWithParams), 150, 20)
EVT_RETURN
EVT_END
};
EvtScript D_80293B0C = {
EVT_CALL(N(StartRumbleWithParams), 200, 30)
EVT_RETURN
EVT_END
};
EvtScript D_80293B30 = {
EVT_CALL(N(StartRumbleWithParams), 256, 40)
EVT_RETURN
EVT_END
};
EvtScript D_80293B54 = {
EVT_CALL(N(StartRumbleWithParams), 256, 60)
EVT_RETURN
EVT_END
};
void start_rumble_type(u32 arg0) {
if (D_802939C0 != 0) {
kill_script_by_ID(D_802939C0);

View File

@ -10,7 +10,8 @@ void func_800F0B3C(void);
s32 D_80109480 = 0;
f32 D_80109484 = 0.0f;
s16 D_80109488[] = {4, 0};
s16 D_80109488 = 4;
s16 D_8010948A = 0; // unused?
f32 D_8010948C = 0.0f;
s16 D_80109490 = 4;
s16 D_80109492 = 5;
@ -73,7 +74,96 @@ void func_800EFD08(void) {
}
}
INCLUDE_ASM(s32, "891b0_len_fb0", func_800EFE2C);
void func_800EFE2C(void) {
PlayerStatus* playerStatus = &gPlayerStatus;
f32 sinTheta, cosTheta;
f32 x, y, z;
s32 cond;
cond = FALSE;
if (gGameStatusPtr->areaID == AREA_HOS) {
cond = gGameStatusPtr->mapID == 2;
}
if (playerStatus->actionState == ACTION_STATE_LAND &&
(playerStatus->flags & PS_FLAGS_ACTION_STATE_CHANGED) &&
D_8010CFF4 >= 10)
{
x = playerStatus->position.x;
y = playerStatus->position.y + 0.0f;
z = playerStatus->position.z;
if (!cond) {
fx_landing_dust(0, x, y, z, D_80109484);
} else {
fx_misc_particles(3, x, y, z, 13.0f, 10.0f, 1.0f, 5, 30);
}
} else if (
(playerStatus->actionState == ACTION_STATE_SPIN_POUND || playerStatus->actionState == ACTION_STATE_TORNADO_POUND) && (playerStatus->flags & PS_FLAGS_400))
{
x = playerStatus->position.x;
y = playerStatus->position.y + 0.0f;
z = playerStatus->position.z;
if (!cond) {
fx_landing_dust(0, x, y, z, D_80109484);
} else {
fx_misc_particles(3, x, y, z, playerStatus->colliderDiameter, 10.0f, 1.0f, 5, 40);
}
} else if (playerStatus->actionState == ACTION_STATE_SPIN && playerStatus->currentSpeed != 0.0f) {
if (D_80109488++ >= 4) {
D_80109488 = 2;
if (cond) {
sin_cos_rad(DEG_TO_RAD(clamp_angle(playerStatus->targetYaw)), &sinTheta, &cosTheta);
fx_misc_particles(
3,
playerStatus->position.x + (playerStatus->colliderDiameter * sinTheta),
playerStatus->position.y + 1.5f,
playerStatus->position.z + (playerStatus->colliderDiameter * cosTheta),
13.0f, 10.0f, 1.0f, 5, 30
);
} else {
sin_cos_rad(DEG_TO_RAD(clamp_angle(-playerStatus->currentYaw)), &sinTheta, &cosTheta);
fx_walking_dust(
0,
playerStatus->position.x + (playerStatus->colliderDiameter * sinTheta * 0.2f),
playerStatus->position.y + 1.5f,
playerStatus->position.z + (playerStatus->colliderDiameter * cosTheta * 0.2f),
sinTheta, cosTheta
);
}
}
} else {
if (playerStatus->actionState != ACTION_STATE_RUN &&
!(playerStatus->actionState == ACTION_STATE_SPIN && playerStatus->actionSubstate == 0))
{
D_80109488 = 4;
return;
}
if (D_80109488++ >= 4) {
D_80109488 = 0;
if (!cond) {
sin_cos_rad(DEG_TO_RAD(clamp_angle(-playerStatus->currentYaw)), &sinTheta, &cosTheta);
fx_walking_dust(
0,
playerStatus->position.x + (playerStatus->colliderDiameter * sinTheta * 0.2f),
playerStatus->position.y + 1.5f,
playerStatus->position.z + (playerStatus->colliderDiameter * cosTheta * 0.2f),
sinTheta, cosTheta
);
} else {
sin_cos_rad(DEG_TO_RAD(clamp_angle(playerStatus->targetYaw)), &sinTheta, &cosTheta);
fx_misc_particles(
3,
playerStatus->position.x + (playerStatus->currentSpeed * sinTheta),
playerStatus->position.y + 1.5f,
playerStatus->position.z + (playerStatus->currentSpeed * cosTheta),
13.0f, 10.0f, 1.0f, 5, 30
);
}
}
}
}
void func_800F0248(void) {
PlayerStatus* playerStatus = &gPlayerStatus;
@ -119,7 +209,60 @@ void func_800F0248(void) {
}
}
INCLUDE_ASM(s32, "891b0_len_fb0", func_800F0490);
void func_800F0490(void) {
PlayerStatus* playerStatus = &gPlayerStatus;
f32 sinTheta, cosTheta;
f32 xTemp, xTemp2;
f32 yTemp, yTemp2;
f32 zTemp, zTemp2;
s32 i;
D_801094A0 += 0.1f;
if (((playerStatus->actionState == ACTION_STATE_LAND && (playerStatus->flags & PS_FLAGS_ACTION_STATE_CHANGED)) ||
((playerStatus->actionState == ACTION_STATE_SPIN_POUND || playerStatus->actionState == ACTION_STATE_TORNADO_POUND) && (playerStatus->flags & PS_FLAGS_400))) &&
D_8010CFF4 >= 10)
{
fx_cloud_puff(
playerStatus->position.x,
(playerStatus->position.y + 14.0f) - 5.0f,
playerStatus->position.z, D_80109498
);
D_80109498 = clamp_angle(D_80109498 + 35.0f);
for (i = 0; i < 4; i++) {
xTemp = rand_int(10) - 5;
zTemp = rand_int(10) - 5;
yTemp = -2.0f - ((SQ(xTemp) + SQ(zTemp)) / 5.0f);
D_8010949C = 0;
sin_cos_rad(DEG_TO_RAD(clamp_angle(-playerStatus->currentYaw + (i * 90))), &sinTheta, &cosTheta);
fx_cloud_trail(
0,
playerStatus->position.x + (playerStatus->colliderDiameter * sinTheta * -0.3f) + xTemp,
playerStatus->position.y + 15.5f + yTemp,
playerStatus->position.z + (playerStatus->colliderDiameter * cosTheta * -0.3f) + zTemp
);
}
} else {
if (!(playerStatus->actionState == ACTION_STATE_WALK || playerStatus->actionState == ACTION_STATE_RUN) &&
!(playerStatus->actionState == ACTION_STATE_SPIN && playerStatus->actionSubstate == 0))
{
D_8010949C = 0;
return;
}
xTemp2 = rand_int(10) - 5;
zTemp2 = rand_int(10) - 5;
yTemp2 = -2.0f - ((SQ(xTemp2) + SQ(zTemp2)) / 5.0f);
D_8010949C = 0;
sin_cos_rad(DEG_TO_RAD(clamp_angle(-playerStatus->currentYaw)), &sinTheta, &cosTheta);
fx_cloud_trail(
1,
playerStatus->position.x + (playerStatus->colliderDiameter * sinTheta * -0.3f) + xTemp2,
playerStatus->position.y + 15.5f + yTemp2,
playerStatus->position.z + (playerStatus->colliderDiameter * cosTheta * -0.3f) + zTemp2
);
}
}
void func_800F0864(void) {
PlayerStatus* playerStatus = &gPlayerStatus;

View File

@ -28,7 +28,7 @@ extern s32 D_8010D64C;
extern s32 D_8010D650;
extern s8 D_8010D654;
extern s8 D_8010D655;
extern u8 D_8010D656;
extern s8 D_8010D656;
extern s16 D_8010D658;
extern s16 D_8010D65A;
extern s32 D_8010D65C;
@ -48,11 +48,12 @@ extern s16 D_8010D686;
extern s16 D_8010D688;
extern s16 D_8010D68A;
extern s16 D_8010D68C;
extern s8 D_8010D68E;
extern s8 D_8010D68E; // bool
extern s8 D_8010D68F;
extern s8 D_8010D690;
extern s8 D_8010D691;
extern s8 D_8010D692;
extern s8 D_8010D693;
extern s32 D_8010D694;
extern s8 D_8010D698;
extern s8 D_8010D699;
@ -88,7 +89,68 @@ void func_800F4C6C(PopupMessage* popup, s32 x, s32 y);
void func_800F4CF0(PopupMessage* popup, s32 x, s32 y);
void func_800F4D28(PopupMessage* popup, s32 x, s32 y);
INCLUDE_ASM(s32, "8a860_len_3f30", hide_popup_menu);
void hide_popup_menu(void) {
if (D_8010D68E) {
switch (gPopupMenu->popupType) {
case POPUP_MENU_USE_ITEM:
case POPUP_MENU_SWITCH_PARTNER:
case POPUP_MENU_THROW_AWAY_ITEM:
case POPUP_MENU_TRADE_FOR_BADGE:
case POPUP_MENU_UPGRADE_PARTNER:
case POPUP_MENU_SELL_ITEM:
case POPUP_MENU_CHECK_ITEM:
case POPUP_MENU_CLAIM_ITEM:
case POPUP_MENU_READ_LETTER:
case POPUP_MENU_TAKE_FROM_CHEST:
case POPUP_MENU_USEKEY:
set_window_update(WINDOW_ID_14, (s32) basic_hidden_window_update);
set_window_update(WINDOW_ID_19, (s32) basic_hidden_window_update);
break;
case POPUP_MENU_READ_DIARY_PAGE:
case POPUP_MENU_READ_POSTCARD:
case POPUP_MENU_D:
set_window_update(WINDOW_ID_14, (s32) basic_hidden_window_update);
break;
}
set_window_update(WINDOW_ID_21, 2);
} else {
switch (gPopupMenu->popupType) {
case POPUP_MENU_USE_ITEM:
case POPUP_MENU_SWITCH_PARTNER:
case POPUP_MENU_THROW_AWAY_ITEM:
case POPUP_MENU_TRADE_FOR_BADGE:
case POPUP_MENU_UPGRADE_PARTNER:
case POPUP_MENU_SELL_ITEM:
case POPUP_MENU_CHECK_ITEM:
case POPUP_MENU_CLAIM_ITEM:
case POPUP_MENU_READ_LETTER:
case POPUP_MENU_TAKE_FROM_CHEST:
case POPUP_MENU_USEKEY:
set_window_update(WINDOW_ID_14, 2);
set_window_update(WINDOW_ID_19, 2);
break;
case POPUP_MENU_READ_DIARY_PAGE:
case POPUP_MENU_READ_POSTCARD:
case POPUP_MENU_D:
set_window_update(WINDOW_ID_14, 2);
break;
}
}
if (gPopupMenu->popupType == POPUP_MENU_TRADE_FOR_BADGE) {
set_window_update(WINDOW_ID_16, (s32) basic_hidden_window_update);
set_window_update(WINDOW_ID_20, (s32) basic_hidden_window_update);
}
if (gPopupMenu->popupType == POPUP_MENU_UPGRADE_PARTNER) {
set_window_update(WINDOW_ID_18, (s32) basic_hidden_window_update);
}
if (gPopupMenu->popupType == POPUP_MENU_SELL_ITEM) {
set_window_update(WINDOW_ID_16, (s32) basic_hidden_window_update);
set_window_update(WINDOW_ID_20, (s32) basic_hidden_window_update);
}
D_8010D640 = 10;
D_8010D644 = D_8010D692;
}
void destroy_popup_menu(void) {
hud_element_free(D_8010D65C);
@ -131,7 +193,97 @@ void destroy_popup_menu(void) {
D_8010D640 = -4;
}
INCLUDE_ASM(s32, "8a860_len_3f30", func_800F16CC);
void func_800F16CC(void) {
if (D_8010D68E) {
switch (gPopupMenu->popupType) {
case POPUP_MENU_USE_ITEM:
case POPUP_MENU_THROW_AWAY_ITEM:
case POPUP_MENU_TRADE_FOR_BADGE:
case POPUP_MENU_SELL_ITEM:
case POPUP_MENU_CHECK_ITEM:
case POPUP_MENU_CLAIM_ITEM:
case POPUP_MENU_READ_LETTER:
case POPUP_MENU_TAKE_FROM_CHEST:
case POPUP_MENU_USEKEY:
set_window_update(WINDOW_ID_14, (s32) basic_window_update);
sfx_play_sound(SOUND_1);
set_window_update(WINDOW_ID_19, (s32) basic_window_update);
break;
case POPUP_MENU_SWITCH_PARTNER:
case POPUP_MENU_UPGRADE_PARTNER:
set_window_update(WINDOW_ID_14, (s32) basic_window_update);
sfx_play_sound(SOUND_2);
set_window_update(WINDOW_ID_19, (s32) basic_window_update);
break;
case POPUP_MENU_READ_DIARY_PAGE:
case POPUP_MENU_READ_POSTCARD:
case POPUP_MENU_D:
set_window_update(WINDOW_ID_14, (s32) basic_window_update);
sfx_play_sound(SOUND_1);
break;
}
set_window_update(WINDOW_ID_21, (s32) basic_window_update);
} else {
switch (gPopupMenu->popupType) {
case POPUP_MENU_USE_ITEM:
case POPUP_MENU_THROW_AWAY_ITEM:
case POPUP_MENU_TRADE_FOR_BADGE:
case POPUP_MENU_SELL_ITEM:
case POPUP_MENU_CHECK_ITEM:
case POPUP_MENU_CLAIM_ITEM:
case POPUP_MENU_READ_LETTER:
case POPUP_MENU_TAKE_FROM_CHEST:
case POPUP_MENU_USEKEY:
set_window_update(WINDOW_ID_14, 1);
set_window_update(WINDOW_ID_19, 1);
break;
case POPUP_MENU_SWITCH_PARTNER:
case POPUP_MENU_UPGRADE_PARTNER:
set_window_update(WINDOW_ID_14, 1);
set_window_update(WINDOW_ID_19, 1);
break;
case POPUP_MENU_READ_DIARY_PAGE:
case POPUP_MENU_READ_POSTCARD:
case POPUP_MENU_D:
set_window_update(WINDOW_ID_14, 1);
break;
}
}
if (gPopupMenu->popupType == POPUP_MENU_TRADE_FOR_BADGE) {
set_window_update(WINDOW_ID_16, (s32) basic_window_update);
set_window_update(WINDOW_ID_20, (s32) basic_window_update);
}
if (gPopupMenu->popupType == POPUP_MENU_UPGRADE_PARTNER) {
set_window_update(WINDOW_ID_18, (s32) basic_window_update);
}
if (gPopupMenu->popupType == POPUP_MENU_SELL_ITEM) {
set_window_update(WINDOW_ID_16, (s32) basic_window_update);
}
hud_element_set_tint(D_8010D65C, 255, 255, 255);
hud_element_set_tint(D_8010D678, 255, 255, 255);
hud_element_set_tint(D_8010D66C, 255, 255, 255);
hud_element_set_tint(D_8010D670, 255, 255, 255);
hud_element_set_tint(D_8010D674, 255, 255, 255);
if (gPopupMenu->popupType == POPUP_MENU_TRADE_FOR_BADGE) {
hud_element_set_tint(D_8010D660, 255, 255, 255);
hud_element_set_tint(D_8010D664, 255, 255, 255);
}
if (gPopupMenu->popupType == POPUP_MENU_UPGRADE_PARTNER) {
hud_element_set_tint(D_8010D660, 255, 255, 255);
hud_element_set_tint(D_8010D664, 255, 255, 255);
}
if (gPopupMenu->popupType == POPUP_MENU_SWITCH_PARTNER || gPopupMenu->popupType == POPUP_MENU_UPGRADE_PARTNER) {
hud_element_set_tint(D_8010D668, 255, 255, 255);
}
if (gPopupMenu->popupType == POPUP_MENU_SELL_ITEM) {
hud_element_set_tint(D_8010D660, 255, 255, 255);
}
hud_element_set_script(D_8010D66C, &HES_AnimatedHandPointer);
D_8010D690 = 0xA;
D_8010D640 = 0x14;
}
s32 popup_menu_update(void) {
s32 posX;
@ -154,7 +306,7 @@ s32 popup_menu_update(void) {
D_8010D686 = 88;
D_8010D688 = 32;
D_8010D68A = 164;
if (D_8010D68E != 0) {
if (D_8010D68E) {
D_8010D67C = D_801098A0[gPopupMenu->popupType] + 20;
}
if (D_8010D68F >= 7) {
@ -220,7 +372,7 @@ s32 popup_menu_update(void) {
D_8010D65A = -200;
D_8010D644 = D_8010D691;
if (D_8010D68E == 0) {
if (!D_8010D68E) {
D_8010D644 = 1;
}
D_8010D690 = 0xA;
@ -228,12 +380,12 @@ s32 popup_menu_update(void) {
posX = D_8010D67C;
posY = D_8010D67E;
switch (gPopupMenu->popupType) {
case 0:
case 2:
case 6:
case 7:
case 12:
set_window_properties(WINDOW_ID_14, posX, posY, 0x91, ((s8) D_8010D656 * 0xD) + 0x1A, 0x14, popup_menu_draw_menu_contents, NULL, -1);
case POPUP_MENU_USE_ITEM:
case POPUP_MENU_THROW_AWAY_ITEM:
case POPUP_MENU_CHECK_ITEM:
case POPUP_MENU_CLAIM_ITEM:
case POPUP_MENU_USEKEY:
set_window_properties(WINDOW_ID_14, posX, posY, 0x91, (D_8010D656 * 13) + 0x1A, 0x14, popup_menu_draw_menu_contents, NULL, -1);
if (gPopupMenu->unk_31C == 0) {
set_window_properties(WINDOW_ID_15, 0x19, -6, 0x5F, 0x10, 0x15, popup_menu_draw_title_contents, NULL, 0xE);
} else {
@ -242,56 +394,56 @@ s32 popup_menu_update(void) {
set_window_update(WINDOW_ID_15, WINDOW_UPDATE_SHOW);
set_window_update(WINDOW_ID_17, WINDOW_UPDATE_HIDE);
break;
case 1:
set_window_properties(WINDOW_ID_14, posX, posY, 0x8B, ((s8) D_8010D656 * 0xD) + 0x1A, 0x14, popup_menu_draw_menu_contents, NULL, -1);
case POPUP_MENU_SWITCH_PARTNER:
set_window_properties(WINDOW_ID_14, posX, posY, 0x8B, (D_8010D656 * 13) + 0x1A, 0x14, popup_menu_draw_menu_contents, NULL, -1);
set_window_properties(WINDOW_ID_17, 0xD, -6, 0x72, 0x10, 0x15, popup_menu_draw_title_contents, NULL, 0xE);
set_window_update(WINDOW_ID_15, WINDOW_UPDATE_HIDE);
set_window_update(WINDOW_ID_17, WINDOW_UPDATE_SHOW);
break;
case 3:
set_window_properties(WINDOW_ID_14, posX, posY, 0xA2, ((s8) D_8010D656 * 0xD) + 0x1A, 0x14, popup_menu_draw_menu_contents, NULL, -1);
case POPUP_MENU_TRADE_FOR_BADGE:
set_window_properties(WINDOW_ID_14, posX, posY, 0xA2, (D_8010D656 * 13) + 0x1A, 0x14, popup_menu_draw_menu_contents, NULL, -1);
set_window_properties(WINDOW_ID_15, 0x11, -6, 0x60, 0x10, 0x15, popup_menu_draw_title_contents, NULL, 0xE);
set_window_update(WINDOW_ID_15, WINDOW_UPDATE_SHOW);
set_window_update(WINDOW_ID_17, WINDOW_UPDATE_HIDE);
break;
case 4:
set_window_properties(WINDOW_ID_14, posX, posY, 0x92, ((s8) D_8010D656 * 0xD) + 0x1A, 0x14, popup_menu_draw_menu_contents, NULL, -1);
case POPUP_MENU_UPGRADE_PARTNER:
set_window_properties(WINDOW_ID_14, posX, posY, 0x92, (D_8010D656 * 13) + 0x1A, 0x14, popup_menu_draw_menu_contents, NULL, -1);
set_window_properties(WINDOW_ID_17, 0xC, -6, 0x72, 0x10, 0x15, popup_menu_draw_title_contents, NULL, 0xE);
set_window_update(WINDOW_ID_15, WINDOW_UPDATE_HIDE);
set_window_update(WINDOW_ID_17, WINDOW_UPDATE_SHOW);
break;
case 5:
set_window_properties(WINDOW_ID_14, posX, posY, 0xA7, ((s8) D_8010D656 * 0xD) + 0x1A, 0x14, popup_menu_draw_menu_contents, NULL, -1);
case POPUP_MENU_SELL_ITEM:
set_window_properties(WINDOW_ID_14, posX, posY, 0xA7, (D_8010D656 * 13) + 0x1A, 0x14, popup_menu_draw_menu_contents, NULL, -1);
set_window_properties(WINDOW_ID_15, 0x16, -6, 0x5F, 0x10, 0x15, popup_menu_draw_title_contents, NULL, 0xE);
set_window_update(WINDOW_ID_15, WINDOW_UPDATE_SHOW);
set_window_update(WINDOW_ID_17, WINDOW_UPDATE_HIDE);
break;
case 8:
set_window_properties(WINDOW_ID_14, posX, posY, 0xAA, ((s8) D_8010D656 * 0xD) + 0x1A, 0x14, popup_menu_draw_menu_contents, NULL, -1);
case POPUP_MENU_READ_LETTER:
set_window_properties(WINDOW_ID_14, posX, posY, 0xAA, (D_8010D656 * 13) + 0x1A, 0x14, popup_menu_draw_menu_contents, NULL, -1);
set_window_properties(WINDOW_ID_15, 0x20, -6, 0x68, 0x10, 0x15, popup_menu_draw_title_contents, NULL, 0xE);
set_window_update(WINDOW_ID_15, WINDOW_UPDATE_SHOW);
set_window_update(WINDOW_ID_17, WINDOW_UPDATE_HIDE);
break;
case 9:
set_window_properties(WINDOW_ID_14, posX, posY, 0x91, ((s8) D_8010D656 * 0xD) + 0x1A, 0x14, popup_menu_draw_menu_contents, NULL, -1);
case POPUP_MENU_TAKE_FROM_CHEST:
set_window_properties(WINDOW_ID_14, posX, posY, 0x91, (D_8010D656 * 13) + 0x1A, 0x14, popup_menu_draw_menu_contents, NULL, -1);
set_window_properties(WINDOW_ID_15, 0xC, -6, 0x79, 0x10, 0x15, popup_menu_draw_title_contents, NULL, 0xE);
set_window_update(WINDOW_ID_15, WINDOW_UPDATE_SHOW);
set_window_update(WINDOW_ID_17, WINDOW_UPDATE_HIDE);
break;
case 10:
set_window_properties(WINDOW_ID_14, posX, posY, 0x80, ((s8) D_8010D656 * 0xD) + 0x1A, 0x14, popup_menu_draw_menu_contents, NULL, -1);
case POPUP_MENU_READ_DIARY_PAGE:
set_window_properties(WINDOW_ID_14, posX, posY, 0x80, (D_8010D656 * 13) + 0x1A, 0x14, popup_menu_draw_menu_contents, NULL, -1);
set_window_properties(WINDOW_ID_15, 0xC, -6, 0x68, 0x10, 0x15, popup_menu_draw_title_contents, NULL, 0xE);
set_window_update(WINDOW_ID_15, WINDOW_UPDATE_SHOW);
set_window_update(WINDOW_ID_17, WINDOW_UPDATE_HIDE);
break;
case 11:
set_window_properties(WINDOW_ID_14, posX, posY, 0x95, ((s8) D_8010D656 * 0xD) + 0x1A, 0x14, popup_menu_draw_menu_contents, NULL, -1);
case POPUP_MENU_READ_POSTCARD:
set_window_properties(WINDOW_ID_14, posX, posY, 0x95, (D_8010D656 * 13) + 0x1A, 0x14, popup_menu_draw_menu_contents, NULL, -1);
set_window_properties(WINDOW_ID_15, 6, -6, 0x8B, 0x10, 0x15, popup_menu_draw_title_contents, NULL, 0xE);
set_window_update(WINDOW_ID_15, WINDOW_UPDATE_SHOW);
set_window_update(WINDOW_ID_17, WINDOW_UPDATE_HIDE);
break;
case 13:
set_window_properties(WINDOW_ID_14, posX, posY, 0x83, ((s8) D_8010D656 * 0xD) + 0x1A, 0x14, popup_menu_draw_menu_contents, NULL, -1);
case POPUP_MENU_D:
set_window_properties(WINDOW_ID_14, posX, posY, 0x83, (D_8010D656 * 13) + 0x1A, 0x14, popup_menu_draw_menu_contents, NULL, -1);
set_window_properties(WINDOW_ID_17, 0xA, -6, 0x72, 0x10, 0x15, popup_menu_draw_title_contents, NULL, 0xE);
set_window_update(WINDOW_ID_15, WINDOW_UPDATE_HIDE);
set_window_update(WINDOW_ID_17, WINDOW_UPDATE_SHOW);
@ -299,10 +451,10 @@ s32 popup_menu_update(void) {
}
switch (gPopupMenu->popupType) {
case 3:
case POPUP_MENU_TRADE_FOR_BADGE:
set_window_properties(WINDOW_ID_16, 0x7E, -0xE, 0x20, 0x20, 0x15, func_800F4C6C, NULL, 0xE);
break;
case 5:
case POPUP_MENU_SELL_ITEM:
set_window_properties(WINDOW_ID_16, 0x83, -0xE, 0x20, 0x20, 0x15, func_800F4C6C, NULL, 0xE);
break;
}
@ -327,92 +479,93 @@ s32 popup_menu_update(void) {
} while (cond);
D_8010D655 = D_8010D654 + D_8010D68F;
D_8010D658 = -D_8010D654 * 0xD;
D_8010D658 = -D_8010D654 * 13;
if (gPopupMenu->popupType >= POPUP_MENU_USE_ITEM
&& (gPopupMenu->popupType < POPUP_MENU_READ_DIARY_PAGE || gPopupMenu->popupType == POPUP_MENU_USEKEY)) {
&& (gPopupMenu->popupType < POPUP_MENU_READ_DIARY_PAGE || gPopupMenu->popupType == POPUP_MENU_USEKEY))
{
set_window_properties(WINDOW_ID_19, D_8010D680, D_8010D682, 0x118, 0x20, 0x14, func_800F48F4, NULL, -1);
}
posX = D_8010D684;
posY = D_8010D686;
switch (gPopupMenu->popupType) {
case 0:
case 6:
case 7:
case 9:
case 12:
case POPUP_MENU_USE_ITEM:
case POPUP_MENU_CHECK_ITEM:
case POPUP_MENU_CLAIM_ITEM:
case POPUP_MENU_TAKE_FROM_CHEST:
case POPUP_MENU_USEKEY:
set_window_properties(WINDOW_ID_21, posX, posY, 0x90, 0x20, 0x14, func_800F4944, NULL, -1);
break;
case 1:
case 2:
case 13:
case POPUP_MENU_SWITCH_PARTNER:
case POPUP_MENU_THROW_AWAY_ITEM:
case POPUP_MENU_D:
set_window_properties(WINDOW_ID_21, posX, posY, 0x90, 0x28, 0x14, func_800F4944, NULL, -1);
break;
case 3:
case 10:
case 11:
case POPUP_MENU_TRADE_FOR_BADGE:
case POPUP_MENU_READ_DIARY_PAGE:
case POPUP_MENU_READ_POSTCARD:
set_window_properties(WINDOW_ID_21, posX, posY, 0x80, 0x28, 0x14, func_800F4944, NULL, -1);
break;
case 4:
case POPUP_MENU_UPGRADE_PARTNER:
set_window_properties(WINDOW_ID_21, posX, posY, 0x88, 0x28, 0x14, func_800F4944, NULL, -1);
break;
case 8:
case POPUP_MENU_READ_LETTER:
set_window_properties(WINDOW_ID_21, posX, posY, 0x70, 0x28, 0x14, func_800F4944, NULL, -1);
break;
case 5:
case POPUP_MENU_SELL_ITEM:
set_window_properties(WINDOW_ID_21, posX, posY, 0x78, 0x20, 0x14, func_800F4944, NULL, -1);
break;
}
if (D_8010D68E == 0) {
if (!D_8010D68E) {
switch (gPopupMenu->popupType) {
case 0:
case 2:
case 3:
case 5:
case 6:
case 7:
case 8:
case 9:
case 12:
case POPUP_MENU_USE_ITEM:
case POPUP_MENU_THROW_AWAY_ITEM:
case POPUP_MENU_TRADE_FOR_BADGE:
case POPUP_MENU_SELL_ITEM:
case POPUP_MENU_CHECK_ITEM:
case POPUP_MENU_CLAIM_ITEM:
case POPUP_MENU_READ_LETTER:
case POPUP_MENU_TAKE_FROM_CHEST:
case POPUP_MENU_USEKEY:
set_window_update(WINDOW_ID_14, WINDOW_UPDATE_SHOW);
set_window_update(WINDOW_ID_19, WINDOW_UPDATE_SHOW);
break;
case 1:
case 4:
case POPUP_MENU_SWITCH_PARTNER:
case POPUP_MENU_UPGRADE_PARTNER:
set_window_update(WINDOW_ID_14, WINDOW_UPDATE_SHOW);
set_window_update(WINDOW_ID_19, WINDOW_UPDATE_SHOW);
break;
case 10:
case 11:
case 13:
case POPUP_MENU_READ_DIARY_PAGE:
case POPUP_MENU_READ_POSTCARD:
case POPUP_MENU_D:
set_window_update(WINDOW_ID_14, WINDOW_UPDATE_SHOW);
break;
}
} else {
switch (gPopupMenu->popupType) {
case 0:
case 2:
case 3:
case 5:
case 6:
case 7:
case 8:
case 9:
case 12:
case POPUP_MENU_USE_ITEM:
case POPUP_MENU_THROW_AWAY_ITEM:
case POPUP_MENU_TRADE_FOR_BADGE:
case POPUP_MENU_SELL_ITEM:
case POPUP_MENU_CHECK_ITEM:
case POPUP_MENU_CLAIM_ITEM:
case POPUP_MENU_READ_LETTER:
case POPUP_MENU_TAKE_FROM_CHEST:
case POPUP_MENU_USEKEY:
set_window_update(WINDOW_ID_14, (s32)basic_window_update);
sfx_play_sound(SOUND_1);
set_window_update(WINDOW_ID_19, (s32)basic_window_update);
break;
case 1:
case 4:
case POPUP_MENU_SWITCH_PARTNER:
case POPUP_MENU_UPGRADE_PARTNER:
set_window_update(WINDOW_ID_14, (s32)basic_window_update);
sfx_play_sound(SOUND_2);
set_window_update(WINDOW_ID_19, (s32)basic_window_update);
break;
case 10:
case 11:
case 13:
case POPUP_MENU_READ_DIARY_PAGE:
case POPUP_MENU_READ_POSTCARD:
case POPUP_MENU_D:
set_window_update(WINDOW_ID_14, (s32)basic_window_update);
sfx_play_sound(SOUND_1);
break;
@ -489,17 +642,17 @@ s32 popup_menu_update(void) {
if (gGameStatusPtr->pressedButtons[0] & BUTTON_A) {
switch (gPopupMenu->popupType) {
case 8:
case POPUP_MENU_READ_LETTER:
sfx_play_sound(SOUND_MENU_NEXT);
if (D_8010D68E == 0) {
if (!D_8010D68E) {
D_8010D640 = -1;
} else {
D_8010D640 = -2;
}
break;
case 13:
case POPUP_MENU_D:
sfx_play_sound(SOUND_MENU_NEXT);
if (D_8010D68E == 0) {
if (!D_8010D68E) {
D_8010D640 = -1;
} else {
D_8010D640 = -2;
@ -508,51 +661,51 @@ s32 popup_menu_update(void) {
default:
if (gPopupMenu->enabled[D_8010D648]) {
sfx_play_sound(SOUND_MENU_NEXT);
if (D_8010D68E == 0) {
if (!D_8010D68E) {
D_8010D640 = -1;
} else {
D_8010D640 = -2;
}
break;
}
if (gPopupMenu->popupType == 1) {
if (gPopupMenu->popupType == POPUP_MENU_SWITCH_PARTNER) {
sfx_play_sound(SOUND_MENU_ERROR);
D_8010D640 = 0x1E;
break;
}
if ((D_8010D68E != 0) && (gPopupMenu->popupType == POPUP_MENU_USE_ITEM || gPopupMenu->popupType == POPUP_MENU_TRADE_FOR_BADGE)) {
if (D_8010D68E && (gPopupMenu->popupType == POPUP_MENU_USE_ITEM || gPopupMenu->popupType == POPUP_MENU_TRADE_FOR_BADGE)) {
sfx_play_sound(SOUND_MENU_ERROR);
}
break;
}
} else {
switch (gPopupMenu->popupType) {
case 0:
case 2:
case 3:
case 5:
case 6:
case 7:
case 12:
if (D_8010D68E != 0) {
case POPUP_MENU_USE_ITEM:
case POPUP_MENU_THROW_AWAY_ITEM:
case POPUP_MENU_TRADE_FOR_BADGE:
case POPUP_MENU_SELL_ITEM:
case POPUP_MENU_CHECK_ITEM:
case POPUP_MENU_CLAIM_ITEM:
case POPUP_MENU_USEKEY:
if (D_8010D68E) {
buttons = BUTTON_B | BUTTON_C_LEFT;
} else {
buttons = BUTTON_B;
}
break;
case 1:
case 4:
if (D_8010D68E != 0) {
case POPUP_MENU_SWITCH_PARTNER:
case POPUP_MENU_UPGRADE_PARTNER:
if (D_8010D68E) {
buttons = BUTTON_B | BUTTON_C_RIGHT;
} else {
buttons = BUTTON_B;
}
break;
case 8:
case 9:
case 10:
case 11:
case 13:
case POPUP_MENU_READ_LETTER:
case POPUP_MENU_TAKE_FROM_CHEST:
case POPUP_MENU_READ_DIARY_PAGE:
case POPUP_MENU_READ_POSTCARD:
case POPUP_MENU_D:
buttons = BUTTON_B;
break;
default:
@ -563,7 +716,7 @@ s32 popup_menu_update(void) {
if (gGameStatusPtr->pressedButtons[0] & buttons) {
sfx_play_sound(SOUND_MENU_BACK);
if (D_8010D698 != 0) {
if (D_8010D68E == 0) {
if (!D_8010D68E) {
D_8010D640 = -3;
} else {
D_8010D640 = -7;
@ -582,15 +735,15 @@ s32 popup_menu_update(void) {
default:
buttons = 0;
break;
case 0:
case POPUP_MENU_USE_ITEM:
buttons = BUTTON_C_RIGHT;
break;
case 1:
case POPUP_MENU_SWITCH_PARTNER:
buttons = BUTTON_C_LEFT;
break;
}
if (D_8010D68E != 0 && (gGameStatusPtr->pressedButtons[0] & buttons)) {
if (D_8010D68E && (gGameStatusPtr->pressedButtons[0] & buttons)) {
sfx_play_sound(SOUND_MENU_BACK);
D_8010D640 = -6;
break;
@ -613,7 +766,7 @@ s32 popup_menu_update(void) {
hud_element_set_tint(D_8010D660, 160, 160, 160);
hud_element_set_tint(D_8010D664, 160, 160, 160);
}
if (gPopupMenu->popupType == 1 || gPopupMenu->popupType == POPUP_MENU_UPGRADE_PARTNER) {
if (gPopupMenu->popupType == POPUP_MENU_SWITCH_PARTNER || gPopupMenu->popupType == POPUP_MENU_UPGRADE_PARTNER) {
hud_element_set_tint(D_8010D668, 160, 160, 160);
}
if (gPopupMenu->popupType == POPUP_MENU_SELL_ITEM) {
@ -628,26 +781,26 @@ s32 popup_menu_update(void) {
return D_8010D648 + 1;
case -3:
switch (gPopupMenu->popupType) {
case 0:
case 2:
case 3:
case 5:
case 6:
case 7:
case 8:
case 9:
case 12:
case POPUP_MENU_USE_ITEM:
case POPUP_MENU_THROW_AWAY_ITEM:
case POPUP_MENU_TRADE_FOR_BADGE:
case POPUP_MENU_SELL_ITEM:
case POPUP_MENU_CHECK_ITEM:
case POPUP_MENU_CLAIM_ITEM:
case POPUP_MENU_READ_LETTER:
case POPUP_MENU_TAKE_FROM_CHEST:
case POPUP_MENU_USEKEY:
set_window_update(WINDOW_ID_14, WINDOW_UPDATE_HIDE);
set_window_update(WINDOW_ID_19, WINDOW_UPDATE_HIDE);
break;
case 1:
case 4:
case POPUP_MENU_SWITCH_PARTNER:
case POPUP_MENU_UPGRADE_PARTNER:
set_window_update(WINDOW_ID_14, WINDOW_UPDATE_HIDE);
set_window_update(WINDOW_ID_19, WINDOW_UPDATE_HIDE);
break;
case 10:
case 11:
case 13:
case POPUP_MENU_READ_DIARY_PAGE:
case POPUP_MENU_READ_POSTCARD:
case POPUP_MENU_D:
set_window_update(WINDOW_ID_14, WINDOW_UPDATE_HIDE);
break;
}
@ -691,7 +844,7 @@ s32 popup_menu_update(void) {
case 31:
set_window_update(WINDOW_ID_14, WINDOW_UPDATE_HIDE);
set_window_update(WINDOW_ID_19, WINDOW_UPDATE_HIDE);
if (D_8010D68E != 0) {
if (D_8010D68E) {
set_window_update(WINDOW_ID_21, WINDOW_UPDATE_HIDE);
}
width = get_msg_width(0x1D006B, 0) + 23;
@ -711,7 +864,7 @@ s32 popup_menu_update(void) {
set_window_update(WINDOW_ID_9, WINDOW_UPDATE_HIDE);
set_window_update(WINDOW_ID_14, WINDOW_UPDATE_SHOW);
set_window_update(WINDOW_ID_19, WINDOW_UPDATE_SHOW);
if (D_8010D68E != 0) {
if (D_8010D68E) {
set_window_update(WINDOW_ID_21, WINDOW_UPDATE_SHOW);
}
D_8010D640 = 1;
@ -741,26 +894,26 @@ s32 popup_menu_update(void) {
}
switch (gPopupMenu->popupType) {
case 0:
case 2:
case 3:
case 5:
case 6:
case 7:
case 8:
case 9:
case 12:
case POPUP_MENU_USE_ITEM:
case POPUP_MENU_THROW_AWAY_ITEM:
case POPUP_MENU_TRADE_FOR_BADGE:
case POPUP_MENU_SELL_ITEM:
case POPUP_MENU_CHECK_ITEM:
case POPUP_MENU_CLAIM_ITEM:
case POPUP_MENU_READ_LETTER:
case POPUP_MENU_TAKE_FROM_CHEST:
case POPUP_MENU_USEKEY:
set_window_update(WINDOW_ID_14, WINDOW_UPDATE_HIDE);
set_window_update(WINDOW_ID_19, WINDOW_UPDATE_HIDE);
break;
case 1:
case 4:
case POPUP_MENU_SWITCH_PARTNER:
case POPUP_MENU_UPGRADE_PARTNER:
set_window_update(WINDOW_ID_14, WINDOW_UPDATE_HIDE);
set_window_update(WINDOW_ID_19, WINDOW_UPDATE_HIDE);
break;
case 10:
case 11:
case 13:
case POPUP_MENU_READ_DIARY_PAGE:
case POPUP_MENU_READ_POSTCARD:
case POPUP_MENU_D:
set_window_update(WINDOW_ID_14, WINDOW_UPDATE_HIDE);
break;
}
@ -817,26 +970,26 @@ s32 popup_menu_update(void) {
hud_element_set_script(D_8010D66C, &HES_HandPointer);
switch (gPopupMenu->popupType) {
case 0:
case 2:
case 3:
case 5:
case 6:
case 7:
case 8:
case 9:
case 12:
case POPUP_MENU_USE_ITEM:
case POPUP_MENU_THROW_AWAY_ITEM:
case POPUP_MENU_TRADE_FOR_BADGE:
case POPUP_MENU_SELL_ITEM:
case POPUP_MENU_CHECK_ITEM:
case POPUP_MENU_CLAIM_ITEM:
case POPUP_MENU_READ_LETTER:
case POPUP_MENU_TAKE_FROM_CHEST:
case POPUP_MENU_USEKEY:
set_window_update(WINDOW_ID_14, WINDOW_UPDATE_SHOW);
set_window_update(WINDOW_ID_19, WINDOW_UPDATE_SHOW);
break;
case 1:
case 4:
case POPUP_MENU_SWITCH_PARTNER:
case POPUP_MENU_UPGRADE_PARTNER:
set_window_update(WINDOW_ID_14, WINDOW_UPDATE_SHOW);
set_window_update(WINDOW_ID_19, WINDOW_UPDATE_SHOW);
break;
case 10:
case 11:
case 13:
case POPUP_MENU_READ_DIARY_PAGE:
case POPUP_MENU_READ_POSTCARD:
case POPUP_MENU_D:
set_window_update(WINDOW_ID_14, WINDOW_UPDATE_SHOW);
break;
}
@ -850,13 +1003,141 @@ s32 popup_menu_update(void) {
INCLUDE_ASM(s32, "8a860_len_3f30", popup_menu_draw_menu_contents);
INCLUDE_ASM(s32, "8a860_len_3f30", popup_menu_draw_title_contents);
void popup_menu_draw_title_contents(
s32* userData, s32 baseX, s32 baseY, s32 width, s32 height, s32 opacity, s32 darkening)
{
switch (gPopupMenu->popupType) {
case POPUP_MENU_USE_ITEM:
case POPUP_MENU_THROW_AWAY_ITEM:
case POPUP_MENU_SELL_ITEM:
case POPUP_MENU_CHECK_ITEM:
case POPUP_MENU_CLAIM_ITEM:
switch (gPopupMenu->unk_31C) {
case 0:
draw_msg(0x1D003F, baseX + 26, baseY + 2, D_8010D650, 50, 1);
break;
case 1:
draw_msg(0x1D0041, baseX + 4, baseY + 2, D_8010D650, 50, 1);
draw_number(gPopupMenu->unk_320, baseX + 94, baseY + 2, 1, 50, D_8010D650, 3);
draw_number(2, baseX + 114, baseY + 2, 1, 50, D_8010D650, 3);
break;
case 2:
draw_msg(0x1D0042, baseX + 6, baseY + 2, D_8010D650, 50, 1);
draw_number(gPopupMenu->unk_320, baseX + 94, baseY + 2, 1, 50, D_8010D650, 3);
draw_number(3, baseX + 114, baseY + 2, 1, 50, D_8010D650, 3);
break;
}
break;
case POPUP_MENU_TRADE_FOR_BADGE:
draw_msg(0x1F0032, baseX + 27, baseY + 2, D_8010D650, 50, 1);
break;
case POPUP_MENU_READ_LETTER:
draw_msg(0x1F0033, baseX + 23, baseY + 2, D_8010D650, 50, 1);
break;
case POPUP_MENU_TAKE_FROM_CHEST:
draw_msg(0x1D00D7, baseX + 4, baseY + 2, D_8010D650, 50, 1);
break;
case POPUP_MENU_READ_DIARY_PAGE:
draw_msg(0x1D00CE, baseX + 8, baseY + 2, D_8010D650, 50, 1);
break;
case POPUP_MENU_READ_POSTCARD:
draw_msg(0x1D00D0, baseX + 6, baseY + 2, D_8010D650, 50, 1);
break;
case POPUP_MENU_USEKEY:
draw_msg(0x1D003F, baseX + 27, baseY + 2, D_8010D650, 50, 1);
break;
case POPUP_MENU_SWITCH_PARTNER:
case POPUP_MENU_UPGRADE_PARTNER:
case POPUP_MENU_D:
draw_msg(0x1D003D, baseX + 8, baseY + 2, D_8010D650, 52, 1);
break;
}
}
void func_800F48F4(s32* userData, s32 baseX, s32 baseY, s32 width, s32 height, s32 opacity, s32 darkening) {
draw_msg(gPopupMenu->descMsg[D_8010D648], baseX + 8, baseY, D_8010D650, D_8010D690, 0);
}
INCLUDE_ASM(s32, "8a860_len_3f30", func_800F4944);
void func_800F4944(s32* userData, s32 baseX, s32 baseY, s32 width, s32 height, s32 opacity, s32 darkening) {
s32 msgWidth;
baseY += 7;
if (D_8010D68E) {
switch (gPopupMenu->popupType) {
case POPUP_MENU_USE_ITEM:
msgWidth = get_msg_width(0x1D0061, 0);
baseX += 72 - (msgWidth / 2);
draw_msg(0x1D0061, baseX, baseY, 255, 0xF, 0);
break;
case POPUP_MENU_SWITCH_PARTNER:
msgWidth = get_msg_width(0x1D0063, 0);
baseX += 72 - (msgWidth / 2);
draw_msg(0x1D0063, baseX, baseY - 4, 255, 0xF, 0);
break;
case POPUP_MENU_THROW_AWAY_ITEM:
msgWidth = get_msg_width(0x1D0064, 0);
baseX += 72 - (msgWidth / 2);
draw_msg(0x1D0064, baseX, baseY - 4, 255, 0xF, 0);
break;
case POPUP_MENU_TRADE_FOR_BADGE:
msgWidth = get_msg_width(0x1D0070, 0);
baseX += 64 - (msgWidth / 2);
draw_msg(0x1D0070, baseX, baseY - 4, 255, 0xF, 0);
break;
case POPUP_MENU_UPGRADE_PARTNER:
msgWidth = get_msg_width(0x1D006A, 0);
baseX += 68 - (msgWidth / 2);
draw_msg(0x1D006A, baseX, baseY - 4, 255, 0xF, 0);
break;
case POPUP_MENU_SELL_ITEM:
msgWidth = get_msg_width(0x1D0065, 0);
baseX += 60 - (msgWidth / 2);
draw_msg(0x1D0065, baseX, baseY, 255, 0xF, 0);
break;
case POPUP_MENU_CHECK_ITEM:
msgWidth = get_msg_width(0x1D0066, 0);
baseX += 72 - (msgWidth / 2);
draw_msg(0x1D0066, baseX, baseY, 255, 0xF, 0);
break;
case POPUP_MENU_CLAIM_ITEM:
msgWidth = get_msg_width(0x1D0067, 0);
baseX += 72 - (msgWidth / 2);
draw_msg(0x1D0067, baseX, baseY, 255, 0xF, 0);
break;
case POPUP_MENU_D:
msgWidth = get_msg_width(0x1D006F, 0);
baseX += 72 - (msgWidth / 2);
draw_msg(0x1D006F, baseX, baseY - 4, 255, 0xF, 0);
break;
case POPUP_MENU_READ_LETTER:
msgWidth = get_msg_width(0x1D006D, 0);
baseX += 56 - (msgWidth / 2);
draw_msg(0x1D006D, baseX, baseY - 4, 255, 0xF, 0);
break;
case POPUP_MENU_TAKE_FROM_CHEST:
msgWidth = get_msg_width(0x1D00D6, 0);
baseX += 72 - (msgWidth / 2);
draw_msg(0x1D00D6, baseX, baseY, 255, 0xF, 0);
break;
case POPUP_MENU_READ_DIARY_PAGE:
msgWidth = get_msg_width(0x1D006C, 0);
baseX += 64 - (msgWidth / 2);
draw_msg(0x1D006C, baseX, baseY - 4, 255, 0xF, 0);
break;
case POPUP_MENU_READ_POSTCARD:
msgWidth = get_msg_width(0x1D006D, 0);
baseX += 64 - (msgWidth / 2);
draw_msg(0x1D006D, baseX, baseY - 4, 255, 0xF, 0);
break;
case POPUP_MENU_USEKEY:
msgWidth = get_msg_width(0x1D0062, 0);
baseX += 72 - (msgWidth / 2);
draw_msg(0x1D0062, baseX, baseY, 255, 0xF, 0);
break;
}
}
}
void func_800F4C1C(PopupMessage* popup, s32 x, s32 y) {
s32 msg = 0x1D0069;
@ -940,17 +1221,17 @@ void create_popup_menu(PopupMenu* popup) {
popup->unk_320 = 0;
D_8010D699 = 0;
D_8010D698 = 1;
if (popup->popupType >= 0x64) {
popup->popupType -= 0x64;
if (popup->popupType >= 100) {
popup->popupType -= 100;
D_8010D699 = 1;
if (popup->popupType >= 0x64) {
popup->popupType -= 0x64;
if (popup->popupType >= 100) {
popup->popupType -= 100;
D_8010D699 = 2;
}
D_8010D698 = 0;
}
D_8010D68E = 1;
D_8010D68E = TRUE;
D_8010D68F = 6;
D_8010D640 = 0;
@ -980,9 +1261,94 @@ void create_popup_menu(PopupMenu* popup) {
D_8010D694 = create_generic_entity_frontUI(popup_menu_update, NULL);
}
INCLUDE_ASM(s32, "8a860_len_3f30", func_800F4FC4);
void func_800F4FC4(PopupMenu* popup) {
gPopupMenu = popup;
INCLUDE_ASM(s32, "8a860_len_3f30", func_800F513C);
popup->result = 0;
popup->unk_31C = 0;
popup->unk_320 = 0;
D_8010D69A = func_800E98D4();
D_8010D699 = 0;
D_8010D698 = 1;
if (gPopupMenu->popupType >= 100) {
gPopupMenu->popupType -= 100;
D_8010D699 = 1;
if (gPopupMenu->popupType >= 100) {
gPopupMenu->popupType -= 100;
D_8010D699 = 2;
}
D_8010D698 = 0;
}
D_8010D68E = TRUE;
D_8010D68F = 6;
D_8010D640 = 0;
D_8010D648 = gPopupMenu->initialPos;
if (D_8010D648 >= gPopupMenu->numEntries) {
D_8010D648 = gPopupMenu->numEntries - 1;
}
D_8010D654 = 0;
D_8010D64C = D_8010D648;
D_8010D656 = gPopupMenu->numEntries;
if (D_8010D656 > D_8010D68F) {
D_8010D656 = D_8010D68F;
}
D_8010D655 = D_8010D68F;
if (gPopupMenu->numEntries < D_8010D68F) {
D_8010D655 = gPopupMenu->numEntries;
}
D_8010D650 = 255;
D_8010D691 = 4;
D_8010D692 = 6;
D_8010D694 = create_generic_entity_frontUI(popup_menu_update, NULL);
}
void func_800F513C(PopupMenu* popup) {
gPopupMenu = popup;
popup->result = 0;
D_8010D693 = popup->unk_320;
D_8010D69A = func_800E98D4();
D_8010D699 = 0;
D_8010D698 = 1;
if (gPopupMenu->popupType >= 100) {
gPopupMenu->popupType -= 100;
D_8010D699 = 1;
if (gPopupMenu->popupType >= 100) {
gPopupMenu->popupType -= 100;
D_8010D699 = 2;
}
D_8010D698 = 0;
}
D_8010D68F = 6;
D_8010D68E = FALSE;
D_8010D640 = 0;
D_8010D648 = gPopupMenu->initialPos;
if (D_8010D648 >= gPopupMenu->numEntries) {
D_8010D648 = gPopupMenu->numEntries - 1;
}
D_8010D654 = 0;
D_8010D64C = D_8010D648;
D_8010D656 = gPopupMenu->numEntries;
if (D_8010D656 > D_8010D68F) {
D_8010D656 = D_8010D68F;
}
D_8010D655 = D_8010D68F;
if (gPopupMenu->numEntries < D_8010D68F) {
D_8010D655 = gPopupMenu->numEntries;
}
D_8010D650 = 255;
D_8010D691 = 9;
D_8010D692 = 2;
D_8010D694 = create_generic_entity_frontUI(popup_menu_update, NULL);
}
void func_800F52BC(void) {
popup_menu_update();

View File

@ -25,62 +25,65 @@ void update_camera_mode_unused(Camera* camera) {
f32 lookXDelta;
f32 lookYDelta;
f32 lookZDelta;
f32 zero;
if (camera->unk_06 != 0 || camera->unk_08 != 0) {
if (camera->unk_06 != 0 || camera->changingMap) {
camera->unk_06 = 0;
camera->unk_08 = 0;
camera->unk_1C = 0;
camera->unk_1E = 100;
camera->unk_20 = 100;
camera->unk_22 = 0;
camera->unk_24 = 0;
camera->lookAt_obj.x = camera->unk_54;
camera->lookAt_obj.y = camera->unk_58;
camera->lookAt_obj.z = camera->unk_5C;
camera->changingMap = FALSE;
camera->auxPitch = 0;
camera->auxBoomLength = 100;
camera->lookAt_dist = 100;
camera->auxBoomPitch = 0;
camera->auxBoomYaw = 0;
camera->lookAt_obj.x = camera->lookAt_obj_target.x;
camera->lookAt_obj.y = camera->lookAt_obj_target.y;
camera->lookAt_obj.z = camera->lookAt_obj_target.z;
}
if (!(playerStatus->flags & 6)) {
camera->unk_58 = playerStatus->position.y + 60.0f;
if (!(playerStatus->flags & (PS_FLAGS_FALLING | PS_FLAGS_JUMPING))) {
camera->lookAt_obj_target.y = playerStatus->position.y + 60.0f;
}
camera->unk_54 = playerStatus->position.x;
camera->unk_5C = playerStatus->position.z + 400.0f;
camera->lookAt_obj_target.x = playerStatus->position.x;
camera->lookAt_obj_target.z = playerStatus->position.z + 400.0f;
if (camera->unk_1C == 0) {
s32 fovTemp = 10000 / camera->unk_20;
if (camera->auxPitch == 0) {
s32 fovTemp = 10000 / camera->lookAt_dist;
camera->lookAt_obj.x = camera->unk_54;
camera->lookAt_obj.y = camera->unk_58;
camera->lookAt_obj.z = camera->unk_5C;
camera->trueRotation.x = (f32) camera->unk_24;
camera->currentBoomYaw = (f32) camera->unk_22;
camera->currentBoomLength = (f32) camera->unk_1E;
camera->lookAt_obj.x = camera->lookAt_obj_target.x;
camera->lookAt_obj.y = camera->lookAt_obj_target.y;
camera->lookAt_obj.z = camera->lookAt_obj_target.z;
camera->trueRotation.x = camera->auxBoomYaw;
camera->currentBoomYaw = camera->auxBoomPitch;
camera->currentBoomLength = camera->auxBoomLength;
if (fovTemp < 0) {
fovTemp += 3;
}
camera->vfov = fovTemp >> 2;
zero = camera->currentBoomYaw;
theta = DEG_TO_RAD(camera->currentBoomYaw);
sinTheta1 = sin_rad(theta);
cosTheta1 = cos_rad(theta);
temp_f30 = (cosTheta1 * 0.0f) + (camera->currentBoomLength * sinTheta1);
temp_f24_2 = (sinTheta1 * -0.0f) + (camera->currentBoomLength * cosTheta1);
temp_f30 = (zero * cosTheta1) + (camera->currentBoomLength * sinTheta1);
temp_f24_2 = ( -zero * sinTheta1) + (camera->currentBoomLength * cosTheta1);
theta = DEG_TO_RAD(camera->trueRotation.x);
sinTheta2 = sin_rad(theta);
cosTheta2 = cos_rad(theta);
camera->lookAt_eye.x = camera->lookAt_obj.x + ((cosTheta2 * 0.0f) - (temp_f24_2 * sinTheta2));
camera->lookAt_eye.x = camera->lookAt_obj.x + ((cosTheta2 * zero) - (temp_f24_2 * sinTheta2));
camera->lookAt_eye.y = camera->lookAt_obj.y + temp_f30;
camera->lookAt_eye.z = camera->lookAt_obj.z + ((sinTheta2 * 0.0f) + (temp_f24_2 * cosTheta2));
camera->lookAt_eye.z = camera->lookAt_obj.z + ((sinTheta2 * zero) + (temp_f24_2 * cosTheta2));
}
camera->currentYaw = atan2(camera->lookAt_eye.x, camera->lookAt_eye.z, camera->lookAt_obj.x, camera->lookAt_obj.z);
lookXDelta = camera->lookAt_obj.x - camera->lookAt_eye.x;
lookYDelta = camera->lookAt_obj.y - camera->lookAt_eye.y;
lookZDelta = camera->lookAt_obj.z - camera->lookAt_eye.z;
camera->currentBlendedYawNegated = -atan2(0.0f, 0.0f, lookXDelta, lookZDelta);
camera->currentPitch = atan2(0.0f, 0.0f, lookYDelta, -sqrtf(SQ(lookXDelta) + SQ(lookZDelta)));
camera->currentBlendedYawNegated = -atan2(zero, zero, lookXDelta, lookZDelta);
camera->currentPitch = atan2(zero, zero, lookYDelta, -sqrtf(SQ(lookXDelta) + SQ(lookZDelta)));
}
#else
INCLUDE_ASM(void, "B0E0", update_camera_mode_unused, Camera* camera);

View File

@ -4,16 +4,17 @@
typedef struct TempE20110 {
/* 0x00 */ Vec3f pos;
/* 0x0C */ f32 scale;
/* 0x10 */ f32 unk_10;
/* 0x14 */ char unk_14[0x4];
/* 0x0C */ f32 unk_0C;
/* 0x10 */ f32 scale;
/* 0x14 */ s32 unk_14;
/* 0x18 */ s32 unk_18;
/* 0x1C */ s32 unk_1C;
/* 0x20 */ s8 unk_20;
/* 0x21 */ s8 unk_21;
/* 0x22 */ s8 unk_22;
/* 0x23 */ s8 unk_23;
/* 0x24 */ s32 unk_24;
/* 0x23 */ u8 unk_23;
/* 0x24 */ u8 unk_24;
/* 0x25 */ char unk_25[0x3];
} TempE20110; // size = 0x28
BSS TempE20110 D_802B7DA0;
@ -28,6 +29,7 @@ TempE20110* D_802B7CB8_E20DC8 = &D_802B7DA0;
#include "common/UnkAngleFunc1.inc.c"
void func_802B7728_E20838(void);
void func_802B79C8_E20AD8(void);
// floatz
#ifdef NON_MATCHING
@ -58,8 +60,39 @@ void func_802B70B4_E201C4(void) {
INCLUDE_ASM(s32, "E20110", func_802B70B4_E201C4);
#endif
INCLUDE_ASM(s32, "E20110", func_802B71E8_E202F8);
void func_802B71E8_E202F8(void) {
FoldImageRecPart sp20;
Matrix4f sp38, sp78;
if (gPlayerStatus.animFlags & PA_FLAGS_INTERACT_PROMPT_AVAILABLE) {
guScaleF(sp38, D_802B7CB8_E20DC8->scale, D_802B7CB8_E20DC8->scale, D_802B7CB8_E20DC8->scale);
guRotateF(sp78, D_802B7CB8_E20DC8->unk_0C - gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
guMtxCatF(sp38, sp78, sp38);
guTranslateF(sp78, D_802B7CB8_E20DC8->pos.x, D_802B7CB8_E20DC8->pos.y, D_802B7CB8_E20DC8->pos.z);
guMtxCatF(sp38, sp78, sp78);
guMtxF2L(sp78, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMasterGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gMasterGfxPos++, &D_802B7C40_E20D50);
sp20.raster = D_802B7A20_E20B30;
sp20.palette = D_802B7C20_E20D30;
sp20.width = D_802B7A20_E20B30_width;
sp20.height = D_802B7A20_E20B30_height;
sp20.xOffset = -16;
sp20.yOffset = 26;
sp20.opacity = 255;
fold_update(0, FOLD_TYPE_NONE, 0, 0, 0, 0, 0x440);
fold_update(0, FOLD_TYPE_6,
D_802B7CB8_E20DC8->unk_24, D_802B7CB8_E20DC8->unk_24, D_802B7CB8_E20DC8->unk_24, 0xFF, 0x448);
fold_appendGfx_component(0, &sp20, 0, sp78);
gSPPopMatrix(gMasterGfxPos++, G_MTX_MODELVIEW);
}
}
s32 func_802B7450_E20560(void);
INCLUDE_ASM(s32, "E20110", func_802B7450_E20560);
void func_802B75E8_E206F8(void) {
@ -96,7 +129,75 @@ void func_802B75E8_E206F8(void) {
D_802B7CB8_E20DC8->pos.y += delta;
}
INCLUDE_ASM(s32, "E20110", func_802B7728_E20838);
void func_802B7728_E20838(void) {
PlayerStatus* playerStatus = &gPlayerStatus;
s32 var_s0 = 0xFF;
f32 scale;
s32 actionState;
func_802B75E8_E206F8();
switch (D_802B7CB8_E20DC8->unk_23) {
case 0:
D_802B7CB8_E20DC8->unk_0C = 0.0f;
D_802B7CB8_E20DC8->scale += 0.05;
if (D_802B7CB8_E20DC8->scale >= 0.55) {
D_802B7CB8_E20DC8->scale = 0.55f;
D_802B7CB8_E20DC8->unk_23++;
D_802B7CB8_E20DC8->unk_14 = 12;
}
break;
case 1:
D_802B7CB8_E20DC8->unk_0C = 0.0f;
D_802B7CB8_E20DC8->unk_14--;
if (D_802B7CB8_E20DC8->unk_14 <= 0) {
D_802B7CB8_E20DC8->unk_23++;
}
break;
case 2:
scale = D_802B7CB8_E20DC8->unk_0C;
scale += 10.0f;
if (scale >= 360.0f) {
scale -= 360.0f;
}
D_802B7CB8_E20DC8->unk_0C = scale;
var_s0 = E20110_UnkAngleFunc1(scale);
break;
case 3:
scale = D_802B7CB8_E20DC8->unk_0C;
scale += 25.0f;
if (scale >= 360.0f) {
scale -= 360.0f;
}
D_802B7CB8_E20DC8->unk_0C = scale;
D_802B7CB8_E20DC8->unk_1C -= 25;
if (D_802B7CB8_E20DC8->unk_1C < 0) {
D_802B7CB8_E20DC8->unk_1C = 0;
}
if ((scale >= 70.0f && scale <= 110.0f) || (scale >= 250.0f && scale <= 290.0f)) {
D_8010C958 = func_802B79C8_E20AD8;
}
var_s0 = E20110_UnkAngleFunc1(scale);
break;
}
D_802B7CB8_E20DC8->unk_24 = var_s0;
actionState = playerStatus->actionState;
if ((func_802B7450_E20560() == 0) ||
(playerStatus->inputEnabledCounter != 0) ||
(playerStatus->flags & PS_FLAGS_20) ||
!(actionState == ACTION_STATE_IDLE || actionState == ACTION_STATE_WALK || actionState == ACTION_STATE_RUN))
{
D_802B7CB8_E20DC8->unk_23 = 3;
}
if ((playerStatus->interactingWithID >= 0) &&
(playerStatus->interactingWithID & 0x4000) &&
!(get_entity_by_index(playerStatus->interactingWithID)->flags & ENTITY_FLAGS_SHOWS_INSPECT_PROMPT))
{
D_802B7CB8_E20DC8->unk_23 = 3;
}
}
void func_802B79C8_E20AD8(void) {
func_802B75E8_E206F8();

View File

@ -34,13 +34,12 @@ void func_802B7000_E225B0(void) {
s32 temp;
if (gPlayerStatus.animFlags & PA_FLAGS_100) {
guScaleF(matrix1, D_802B7C78_E23228->scale, D_802B7C78_E23228->scale,
D_802B7C78_E23228->scale);
guScaleF(matrix1, D_802B7C78_E23228->scale, D_802B7C78_E23228->scale, D_802B7C78_E23228->scale);
guRotateF(matrix2, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
guMtxCatF(matrix1, matrix2, matrix1);
guTranslateF(matrix2, D_802B7C78_E23228->pos.x, D_802B7C78_E23228->pos.y, D_802B7C78_E23228->pos.z);
guMtxCatF(matrix1, matrix2, matrix2);
guMtxF2L(matrix2, (Mtx*) &gDisplayContext->matrixStack[gMatrixListPos]);
guMtxF2L(matrix2, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMasterGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], 3);
gSPDisplayList(gMasterGfxPos++, D_802B7C00_E231B0);
@ -121,7 +120,6 @@ void func_802B735C_E2290C(void) {
if (!cond) {
D_802B7C78_E23228->unk_24++;
return;
}
break;
case 1:

View File

@ -1,16 +1,75 @@
#include "dead.h"
#include "common.h"
#include "effects.h"
// Copy of kzn_23 (C9C610.c)
// Copy of kzn_23 (kzn_23_2_extra.c)
#define NAMESPACE EB7540
#include "world/common/SetEntityPositionF.inc.c"
API_CALLABLE(N(SetChestPosition)) {
Bytecode* args = script->ptrReadPos;
s32 entityIndex = evt_get_variable(script, *args++);
f32 x = evt_get_variable(script, *args++);
f32 y = evt_get_variable(script, *args++);
f32 z = evt_get_variable(script, *args++);
Entity* entity = get_entity_by_index(entityIndex);
#include "world/common/GetEntityPosition.inc.c"
entity->position.x = x;
entity->position.y = y;
entity->position.z = z;
return ApiStatus_DONE2;
}
INCLUDE_ASM(s32, "EB7540", func_80240478_EB76A8);
API_CALLABLE(N(GetChestPosition)) {
Bytecode* args = script->ptrReadPos;
Entity* entity = get_entity_by_index(evt_get_variable(script, *args++));
#include "world/common/UnsetCamera0MoveFlag1.inc.c"
evt_set_variable(script, *args++, entity->position.x);
evt_set_variable(script, *args++, entity->position.y);
evt_set_variable(script, *args++, entity->position.z);
return ApiStatus_DONE2;
}
INCLUDE_ASM(s32, "EB7540", func_80240520_EB7750);
API_CALLABLE(N(SetPyroclastPos)) {
Bytecode* args = script->ptrReadPos;
f32 x = evt_get_float_variable(script, *args++);
f32 y = evt_get_float_variable(script, *args++);
f32 z = evt_get_float_variable(script, *args++);
EffectInstance* effect = script->varTablePtr[0xE];
effect->data.unk_65->pos.x = x;
effect->data.unk_65->pos.y = y;
effect->data.unk_65->pos.z = z;
return ApiStatus_DONE2;
}
API_CALLABLE(N(AllowCameraInterpY)) {
Camera* camera = &gCameras[CAM_DEFAULT];
camera->moveFlags &= ~CAMERA_MOVE_IGNORE_PLAYER_Y;
return ApiStatus_DONE2;
}
API_CALLABLE(N(AnimateChestSize)) {
Entity* entity = get_entity_by_index(script->varTable[0xA]);
if (isInitialCall) {
script->functionTemp[0] = 0;
script->functionTemp[1] = 60;
}
entity->scale.x = script->functionTemp[1] / 60.0f;
entity->scale.y = script->functionTemp[1] / 60.0f;
entity->scale.z = script->functionTemp[1] / 60.0f;
entity->rotation.y = (1.0f - cos_rad(entity->scale.y * PI)) * 990.0 / 2.0;
script->functionTemp[1]--;
if (~script->functionTemp[1] == 0) { //TODO remove ~ optimization
return ApiStatus_DONE2;
} else {
return ApiStatus_BLOCK;
}
}
const char* N(exit_str_0) = "jan_04";

View File

@ -1,10 +1,193 @@
#include "dead.h"
#include "common.h",
#include "common.h"
#include "nu/nusys.h"
#include "model.h"
// Copy of flo_10 (CB96B0.c)
#define NAMESPACE ED46D0
INCLUDE_ASM(s32, "ED46D0", func_802404B0_ED46D0);
// rodata
extern char D_80244BB8_ED8DD8[];
extern char D_80244BEC_ED8E0C[];
INCLUDE_ASM(s32, "ED46D0", func_80240B10_ED4D30);
void N(UnkModelFunc000)(s32, s32, s32, s32);
INCLUDE_ASM(s32, "ED46D0", ED46D0_UnkModelFunc000);
s32 func_80066FE0(u16*);
// Similar to the flo_10 counterpart but contains debug code
void N(UnkModelFunc001)(void) {
Camera* camera = &gCameras[gCurrentCameraID];
Model* model = get_model_from_list_index(get_model_list_index_from_tree_index(0x30));
ModelBoundingBox* bb = (ModelBoundingBox*) model->modelNode->propertyList;
f32 bbHalfX = bb->halfSizeX;
f32 bbHalfZ = bb->halfSizeZ;
f32 outX, outY, outZ, outS;
Gfx* new_var;
f32 temp_f24;
f32 temp_f26;
f32 temp_f20;
f32 temp_f22;
transform_point(camera->perspectiveMatrix,
model->center.x - bbHalfX, model->center.y, model->center.z - bbHalfZ, 1.0f,
&outX, &outY, &outZ, &outS);
outX *= 1.0f / outS;
outY *= -(1.0f / outS);
outZ *= 1.0f / outS;
outS = 1.0f / outS;
if (outS < 0.0f) {
outX = 0.0f;
outY = 1.0f;
}
temp_f20 = outX;
temp_f22 = outY;
transform_point(camera->perspectiveMatrix,
model->center.x - bbHalfX, model->center.y, model->center.z + bbHalfZ, 1.0f,
&outX, &outY, &outZ, &outS);
outX *= 1.0f / outS;
outY *= -(1.0f / outS);
outZ *= 1.0f / outS;
outS = 1.0f / outS;
temp_f24 = temp_f20;
temp_f26 = temp_f22;
if (outS < 0.0f) {
outX = 0.0f;
outY = 1.0f;
}
if (temp_f24 > outX) {
temp_f24 = outX;
}
if (temp_f26 > outY) {
temp_f26 = outY;
}
if (temp_f20 < outX) {
temp_f20 = outX;
}
if (temp_f22 < outY) {
temp_f22 = outY;
}
transform_point(camera->perspectiveMatrix,
model->center.x + bbHalfX, model->center.y, model->center.z + bbHalfZ, 1.0f,
&outX, &outY, &outZ, &outS);
outX *= 1.0f / outS;
outY *= -(1.0f / outS);
outZ *= 1.0f / outS;
outS = 1.0f / outS;
if (outS < 0.0f) {
outX = 1.0f;
outY = 1.0f;
}
if (temp_f24 > outX) {
temp_f24 = outX;
}
if (temp_f26 > outY) {
temp_f26 = outY;
}
if (temp_f20 < outX) {
temp_f20 = outX;
}
if (temp_f22 < outY) {
temp_f22 = outY;
}
transform_point(camera->perspectiveMatrix,
model->center.x + bbHalfX, model->center.y, model->center.z - bbHalfZ, 1.0f,
&outX, &outY, &outZ, &outS);
outX *= 1.0f / outS;
outY *= -(1.0f / outS);
outZ *= 1.0f / outS;
outS = 1.0f / outS;
if (outS < 0.0f) {
outX = 1.0f;
outY = 1.0f;
}
if (temp_f24 > outX) {
temp_f24 = outX;
}
if (temp_f26 > outY) {
temp_f26 = outY;
}
if (temp_f20 < outX) {
temp_f20 = outX;
}
if (temp_f22 < outY) {
temp_f22 = outY;
}
if (temp_f24 != temp_f20 || temp_f26 != temp_f22) {
temp_f24 = ((temp_f24 * camera->viewportW) + camera->viewportW) * 0.5f;
temp_f26 = ((temp_f26 * camera->viewportH) + camera->viewportH) * 0.5f;
temp_f20 = ((temp_f20 * camera->viewportW) + camera->viewportW) * 0.5f;
temp_f22 = ((temp_f22 * camera->viewportH) + camera->viewportH) * 0.5f;
temp_f24 += camera->viewportStartX;
temp_f26 += camera->viewportStartY;
temp_f20 += camera->viewportStartX;
temp_f22 += camera->viewportStartY;
gDPSetCycleType(gMasterGfxPos++, G_CYC_1CYCLE);
gDPSetRenderMode(gMasterGfxPos++, Z_CMP | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL | G_RM_PASS,
Z_CMP | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL | GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1));
new_var = gMasterGfxPos++;
if ((func_80066FE0(nuGfxZBuffer) % 8) != 0) {
osSyncPrintf(D_80244BB8_ED8DD8, D_80244BEC_ED8E0C, 175, func_80066FE0(nuGfxZBuffer));
}
gDPSetColorImage(new_var, G_IM_FMT_RGBA, G_IM_SIZ_16b, SCREEN_WIDTH, osVirtualToPhysical(nuGfxZBuffer));
gDPSetCombineLERP(gMasterGfxPos++, 0, 0, 0, PRIMITIVE, 0, 0, 0, 0, 0, 0, 0, PRIMITIVE, 0, 0, 0, 0);
gDPSetPrimColor(gMasterGfxPos++, 0, 0, 248, 240, 240, 0);
gDPPipeSync(gMasterGfxPos++);
gSPDisplayList(gMasterGfxPos++, model->modelNode->displayData->displayList);
gDPPipeSync(gMasterGfxPos++);
new_var = gMasterGfxPos++;
if ((func_80066FE0(nuGfxCfb_ptr) % 8) != 0) {
osSyncPrintf(D_80244BB8_ED8DD8, D_80244BEC_ED8E0C, 186, func_80066FE0(nuGfxCfb_ptr));
}
gDPSetColorImage(new_var, G_IM_FMT_RGBA, G_IM_SIZ_16b, SCREEN_WIDTH, osVirtualToPhysical(nuGfxCfb_ptr));
gDPSetDepthSource(gMasterGfxPos++, G_ZS_PRIM);
gDPSetPrimDepth(gMasterGfxPos++, 32734, 0);
gDPSetRenderMode(gMasterGfxPos++, G_RM_ZB_XLU_DECAL, G_RM_ZB_XLU_DECAL2);
gDPSetTextureFilter(gMasterGfxPos++, G_TF_POINT);
gDPSetTexturePersp(gMasterGfxPos++, G_TP_NONE);
gSPTexture(gMasterGfxPos++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
gDPSetTextureLUT(gMasterGfxPos++, G_TT_NONE);
gDPSetTextureDetail(gMasterGfxPos++, G_TD_CLAMP);
gDPSetTextureLOD(gMasterGfxPos++, G_TL_TILE);
gDPSetCombineLERP(gMasterGfxPos++, 0, 0, 0, TEXEL0, 0, 0, 0, PRIMITIVE, 0, 0, 0, TEXEL0, 0, 0, 0, PRIMITIVE);
gDPPipeSync(gMasterGfxPos++);
N(UnkModelFunc000)(temp_f24, temp_f26, temp_f20, temp_f22);
gDPPipeSync(gMasterGfxPos++);
gDPSetCycleType(gMasterGfxPos++, G_CYC_2CYCLE);
gDPSetDepthSource(gMasterGfxPos++, G_ZS_PIXEL);
}
}

View File

@ -4260,7 +4260,7 @@ void get_model_env_color_parameters(u8* primR, u8* primG, u8* primB, u8* envR, u
*envB = gRenderModelEnvB;
}
void mdl_get_vertex_count(Gfx* gfx, s32* numVertices, s32* baseVtx, s32* gfxCount, Vtx* baseAddr) {
void mdl_get_vertex_count(Gfx* gfx, s32* numVertices, Vtx** baseVtx, s32* gfxCount, Vtx* baseAddr) {
s8 stuff[2];
s32 vtxCount;
@ -4276,7 +4276,7 @@ void mdl_get_vertex_count(Gfx* gfx, s32* numVertices, s32* baseVtx, s32* gfxCoun
if (gfx == NULL) {
*numVertices = maxVtx;
*baseVtx = minVtx;
*baseVtx = (Vtx*)minVtx;
} else {
Gfx* baseGfx = gfx;
@ -4307,23 +4307,58 @@ void mdl_get_vertex_count(Gfx* gfx, s32* numVertices, s32* baseVtx, s32* gfxCoun
} while (cmd != G_ENDDL);
*numVertices = (maxVtx - minVtx) >> 4;
*baseVtx = minVtx;
*baseVtx = (Vtx*)minVtx;
*gfxCount = gfx - baseGfx;
w1 = gfx->words.w1; // TODO required to match
}
}
// void mdl_local_gfx_update_vtx_pointers(Gfx* nodeDlist, Vtx* baseVtx, Gfx* arg2, Vtx* arg3);
INCLUDE_ASM(s32, "a5dd0_len_114e0", mdl_local_gfx_update_vtx_pointers);
void mdl_local_gfx_copy_vertices(u8* from, s32 num, u8* to) {
void mdl_local_gfx_copy_vertices(Vtx* from, s32 num, Vtx* to) {
u32 i;
for (i = 0; i < num * 16; i++) {
to[i] = from[i];
for (i = 0; i < num * sizeof(*from); i++) {
((u8*)to)[i] = ((u8*)from)[i];
}
}
INCLUDE_ASM(s32, "a5dd0_len_114e0", mdl_make_local_vertex_copy);
void mdl_make_local_vertex_copy(s32 arg0, u16 treeIdx, s32 arg2) {
s32 numVertices;
Vtx* baseVtx;
s32 gfxCount;
Gfx* nodeDlist;
Model* model;
ModelLocalVertexCopy* copy;
s32 i;
model = get_model_from_list_index(get_model_list_index_from_tree_index(treeIdx));
nodeDlist = model->modelNode->displayData->displayList;
mdl_get_vertex_count(nodeDlist, &numVertices, &baseVtx, &gfxCount, NULL);
copy = (*gCurrentModelLocalVtxBuffers)[arg0] = heap_malloc(sizeof(*copy));
if (arg2) {
for (i = 0; i < ARRAY_COUNT(copy->gfxCopy); i++) {
copy->gfxCopy[i] = heap_malloc(gfxCount * sizeof(*copy->gfxCopy[i]));
copy->vtxCopy[i] = heap_malloc(numVertices * sizeof(*copy->vtxCopy[i]));
mdl_local_gfx_update_vtx_pointers(nodeDlist, baseVtx, copy->gfxCopy[i], copy->vtxCopy[i]);
mdl_local_gfx_copy_vertices(baseVtx, numVertices, copy->vtxCopy[i]);
}
model->flags |= MODEL_FLAGS_HAS_LOCAL_VERTEX_COPY;
} else {
for (i = 0; i < ARRAY_COUNT(copy->gfxCopy); i++) {
copy->gfxCopy[i] = NULL;
copy->vtxCopy[i] = NULL;
}
model->flags |= MODEL_FLAGS_ENABLED;
}
copy->selector = 0;
copy->numVertices = numVertices;
copy->minVertexAddr = baseVtx;
}
void mdl_get_copied_vertices(s32 copyIndex, Vtx** firstVertex, Vtx** copiedVertices, s32* numCopied) {
ModelLocalVertexCopy* mlvc = (*gCurrentModelLocalVtxBuffers)[copyIndex];

View File

@ -88,7 +88,7 @@ s32 N(modelCommandList)[] = {
0x00000004, 0x0000000D, 0x00000001, sizeof(N(displayList)) / sizeof(s32), &N(displayList), 0x00000002, 0x00000000,
};
EvtScript script = {
EvtScript N(main) = {
EVT_SET_CONST(LVarA, 0x00000087)
EVT_EXEC_WAIT(N(UseItemWithEffect))
EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_D)

View File

@ -262,7 +262,7 @@ s32 N(D_802A2858_732B58)[] = {
0, 1, 2, 0, 1, 0
};
EvtScript N(script6) = {
EvtScript N(main) = {
EVT_CALL(GetMenuSelection, LVar0, LVar1, LVar2)
EVT_IF_EQ(LVar1, ITEM_KOOKY_COOKIE)
EVT_SET_CONST(LVarA, ITEM_KOOKY_COOKIE)

View File

@ -367,7 +367,7 @@ EvtScript D_802A2384 = {
EVT_END
};
EvtScript D_802A2600 = {
EvtScript N(main) = {
EVT_CALL(SetBattleFlagBits, BS_FLAGS1_1000, 1)
EVT_CALL(func_802694A4, 0)
EVT_CALL(SetBattleFlagBits, BS_FLAGS1_100, 1)

View File

@ -367,7 +367,7 @@ EvtScript N(D_802A2384) = {
EVT_END
};
EvtScript N(D_802A2600) = {
EvtScript N(main) = {
EVT_CALL(func_802694A4, 1)
EVT_CALL(SetBattleFlagBits, BS_FLAGS1_1000, 1)
EVT_CALL(GetMenuSelection, LVar0, LVar1, LVar2)

View File

@ -600,7 +600,7 @@ EvtScript D_802A2DA0_00736340 = {
EVT_END
};
EvtScript D_802A3044_007365E4 = {
EvtScript battle_move_hammer_802A3044 = {
EVT_CALL(func_802694A4, 1)
EVT_CALL(GetMenuSelection, LVar0, LVar1, LVar2)
EVT_SWITCH(LVar1)
@ -721,7 +721,7 @@ EvtScript D_802A3168_00736708 = {
EVT_END
};
EvtScript D_802A369C_00736C3C = {
EvtScript battle_move_hammer_802A369C = {
EVT_CALL(GetMenuSelection, LVar0, LVar1, LVar2)
EVT_SWITCH(LVar1)
EVT_CASE_EQ(0)
@ -796,7 +796,7 @@ EvtScript D_802A369C_00736C3C = {
EVT_END
};
EvtScript D_802A3B28_007370C8 = {
EvtScript battle_move_hammer_802A3B28 = {
EVT_CALL(func_802694A4, 1)
EVT_CALL(GetMenuSelection, LVar0, LVar1, LVar2)
EVT_SWITCH(LVar1)

View File

@ -376,7 +376,7 @@ EvtScript D_802A23D4_73EC34 = {
EVT_END
};
EvtScript D_802A2650_73EEB0 = {
EvtScript N(802A2650) = {
EVT_CALL(func_802694A4, 1)
EVT_CALL(GetBattleFlags2, LVar0)
EVT_IF_FLAG(LVar0, BS_FLAGS2_200)
@ -569,7 +569,7 @@ EvtScript D_802A2DE8_73F648 = {
EVT_END
};
EvtScript D_802A30F4_73F954 = {
EvtScript N(802A30F4) = {
EVT_CALL(func_802694A4, 1)
EVT_CALL(GetMenuSelection, LVar0, LVar1, LVar2)
EVT_SWITCH(LVar1)
@ -675,7 +675,7 @@ EvtScript D_802A34EC_73FD4C = {
EVT_END
};
EvtScript D_802A3644_73FEA4 = {
EvtScript N(802A3644) = {
EVT_CALL(func_802694A4, 1)
EVT_CALL(GetMenuSelection, LVar0, LVar1, LVar2)
EVT_SWITCH(LVar1)

View File

@ -599,7 +599,7 @@ EvtScript D_802A2DA0_0073CC70 = {
EVT_END
};
EvtScript D_802A3044_0073CF14 = {
EvtScript battle_move_quake_hammer_main = {
EVT_CALL(func_802694A4, 1)
EVT_CALL(GetMenuSelection, LVar0, LVar1, LVar2)
EVT_SWITCH(LVar1)

View File

@ -625,7 +625,7 @@ EvtScript D_802A2E80_739710 = {
EVT_END
};
EvtScript D_802A3124_7399B4 = {
EvtScript battle_move_spin_smash_main = {
EVT_CALL(func_802694A4, 1)
EVT_CALL(func_80269EAC, 2)
EVT_CALL(GetMenuSelection, LVar0, LVar1, LVar2)

370
src/bss.c
View File

@ -1,370 +0,0 @@
#include "types.h"
// This file exists to enforce the order of BSS symbols, since they were reordered in the original rom.
#ifndef M2CTX
#define BSS __attribute__ ((section (".bss")))
#else
#define BSS static
#endif
BSS u8 nuScPreNMIFlag;
BSS char D_8009A5B4[0x4];
BSS s32 D_8009A5B8;
BSS char D_8009A5BC[0x4];
BSS s32 gSoundGlobals;
BSS char D_8009A5C4[0x4];
BSS s32 __osBaseCounter;
BSS s32 gBGMPlayerC;
BSS s32 D_8009A5D0;
BSS void (*CurrentSefCmdHandler)(void*, void*); // SoundManager*, SoundPlayer*
BSS s32 timeFreezeMode;
BSS s32 nuGfxZBuffer;
BSS u32 nuContDataLockKey;
BSS s32 __osViIntrCount;
BSS s32 BeginSoundUpdateCallback;
BSS float D_8009A5EC;
BSS u32 nuGfxCfbCounter;
BSS s32 mdl_currentModelTreeNodeInfo;
BSS u32 nuGfxDisplay;
BSS s32 gBGMPlayerB;
BSS s32 gGameState;
BSS s16 gNpcCount;
BSS s16 __osMaxControllers;
BSS s32 __osCurrentTime;
BSS s32 D_8009A60C;
BSS s32 nuGfxUcode;
BSS u32 nuContNum;
BSS u32 nuGfxTaskSpool;
BSS u8 __osContLastCmd;
BSS s32 D_8009A620;
BSS char D_8009A624[0x4];
BSS s32 gAuAmbienceManager;
BSS s32 __osTimerCounter;
BSS s32 D_8009A630;
BSS s16 gCurrentCamID;
BSS s32 nuPiCartHandle;
BSS s32 D_8009A63C;
BSS s32 gSoundManager;
BSS char D_8009A644[0x8];
BSS s32 nuGfxCfb_ptr;
BSS s32 gOverrideFlags;
BSS s8 D_8009A654;
BSS s32* nuGfxCfb;
BSS char D_8009A65C[0x4];
BSS s32 D_8009A660;
BSS s32 gBGMPlayerA;
BSS s16 D_8009A668;
BSS s32 gMasterGfxPos;
BSS s32 D_8009A670;
BSS s32 gDisplayContext;
BSS s32 D_8009A678;
BSS char D_8009A67C[0x4];
BSS s32 D_8009A680;
BSS char D_8009A684[0xC];
BSS s16 D_8009A690;
BSS char D_8009A694[0xC];
BSS u16 D_8009A6A0;
BSS u16 D_8009A6A2;
BSS u16 D_8009A6A4;
BSS u16 D_8009A6A6;
BSS char D_8009A6A8[0x8];
BSS s8 D_8009A6B0[0x1380];
BSS s32 logicalSaveInfo[4][2];
BSS s32 physicalSaveInfo[6][2];
BSS s32 nextAvailableSavePage;
BSS char D_8009BA84[0xC];
BSS float gCurtainScale;
BSS float gCurtainScaleGoal;
BSS float gCurtainFade;
BSS float gCurtainFadeGoal;
BSS UNK_FUN_PTR(gCurtainDrawCallback);
BSS char D_8009BAA4[0x4];
BSS s8 D_8009BAA8[0x40 * 2];
BSS char D_8009BA28[0x8];
BSS s8 gCrashScreen[0x9E0];
BSS s32 nuGfxTask_ptr;
BSS s16 taskDoneMsg;
BSS s16 swapBufMsg;
BSS s8 GfxTaskMgrThread[0x21B0];
BSS char D_8009E6C8[0x8];
BSS s32 D_8009E6D0[8];
BSS s32 nuSiMesgBuf[8];
BSS s8 siMgrThread[0x21B0];
BSS s8 blendedCamSettings[0x1C];
BSS float D_800A08DC;
BSS float D_800A08E0;
BSS s32 D_800A08E4;
BSS s32 D_800A08E8;
BSS s32 D_800A08EC;
BSS s16 gameMode;
BSS char D_800A08F4[0xC];
BSS s8 D_800A0900;
BSS s32 D_800A0904;
BSS s32 D_800A0908;
BSS char D_800A090C[0x4];
BSS s32 gLogosImages;
BSS s32 gLogosImage3;
BSS s32 gLogosImage1;
BSS s32 gLogosImage2;
BSS s8 D_800A0920;
BSS s8 D_800A0921;
BSS s16 D_800A0922;
BSS s32 D_800A0924;
BSS char D_800A0928[0x8];
BSS s8 D_800A0930;
BSS s8 D_800A0931;
BSS s16 D_800A0932;
BSS char D_800A0934[0xC];
BSS s16 gMapTransitionAlpha;
BSS s16 D_800A0942;
BSS s16 D_800A0944;
BSS s16 D_800A0946;
BSS s16 D_800A0948;
BSS char D_800A094C[0x4];
BSS s32 D_800A0950;
BSS s16 D_800A0954;
BSS s16 D_800A0956;
BSS s16 D_800A0958;
BSS s8 D_800A095A;
BSS u8 D_800A095B;
BSS s8 D_800A095C;
BSS u8 D_800A095D;
BSS s8 D_800A095E;
BSS u8 D_800A095F;
BSS s8 D_800A0960[3];
BSS u8 D_800A0963;
BSS s32 D_800A0964;
BSS char D_800A0968[0x8];
BSS s32 D_800A0970;
BSS s32 D_800A0974;
BSS s32 D_800A0978;
BSS s32 D_800A097C;
BSS s32 D_800A0980;
BSS char D_800A0984[0x4];
BSS s32 D_800A0988;
BSS char D_800A098C[0x4];
BSS s8 gWorldNpcList[0x100];
BSS s8 gBattleNpcList[0x100];
BSS s32 gCurrentNpcListPtr;
BSS s8 D_800A0B94;
BSS char D_800A0B98[0x8];
BSS s32 D_800A0BA0;
BSS float D_800A0BA4;
BSS s32 WorldMerleeOrbEffect;
BSS s32 WorldMerleeWaveEffect;
BSS s32 D_800A0BB0;
BSS s32 D_800A0BB4;
BSS s16 D_800A0BB8;
BSS char D_800A0BBC[0x4];
BSS s8 D_800A0BC0[32 * 0x1C];
BSS s32 D_800A0F40;
BSS s32 D_800A0F44;
BSS char D_800A0F48[0x8];
BSS u16 D_800A0F50;
BSS char D_800A0F54[0x4];
BSS s8 nuAuMgrThread[0x25B8];
BSS s32 AlCmdListBuffers[3];
BSS char D_800A351C[4];
BSS s32 D_800A3520;
BSS char D_800A3524[0x104];
BSS s8 D_800A3628[0xC];
BSS s32 AlFrameSize;
BSS s32 AlMinFrameSize;
BSS char D_800A363C[0x4];
BSS s32 nuAuDmaMesgQ;
BSS char D_800A3644[0x14];
BSS s8 nuAuDmaMesgBuf[0xC8];
BSS s8 nuAuDmaIOMesgBuf[0x4B0];
BSS s32 nuAuDmaState;
BSS s32 D_800A3BD4;
BSS char D_800A3BD8[0x8];
BSS s8 nuAuDmaBufList[50 * 0x14];
BSS s8 D_800A3FC8[8];
BSS s32 CurrentSeqCmdHandler;
BSS char D_800A3FD4[0xC];
BSS s32 D_800A3FE0;
BSS s32 D_800A3FE4;
BSS s32 D_800A3FE8;
BSS u8 D_800A3FEC;
BSS s16 D_800A3FEE;
BSS s32 D_800A3FF0;
BSS char D_800A3FF4[0xC];
BSS s8 gEffectGraphicsData[15 * 0x1D];
BSS char D_800A41B4[0xC];
BSS s32 D_800A41C0;
BSS char D_800A41C4[0x1C];
BSS s32 gMapConfig;
BSS char D_800A41E4[0x4];
BSS s32 gMapSettings;
BSS char D_800A41EC[0x44];
BSS float gCollisionRayStartX;
BSS float gCollisionRayStartY;
BSS float gCollisionRayStartZ;
BSS float gCollisionRayDirX;
BSS float gCollisionRayDirY;
BSS float gCollisionRayDirZ;
BSS float gCollisionPointX;
BSS float gCollisionPointY;
BSS float gCollisionPointZ;
BSS float gCollisionRayLength;
BSS s32 gCollisionNormalX;
BSS s32 gCollisionNormalY;
BSS s32 gCollisionNormalZ;
BSS s32 gCollisionDataBackup;
BSS s32 gCollisionDataZoneBackup;
BSS char D_800A426C[0x4];
BSS s8 D_800A4270[0x1B0];
BSS s8 D_800A4420[0x21B0];
BSS s8 nuScStack[0x2000];
BSS s8 nuScAudioStack[0x2000];
BSS s8 nuScGraphicsStack[0x2000];
BSS s32 D_800AC5D0;
BSS char D_800AC5D4[0x14];
BSS s8 D_800AC5E8[0xC8];
BSS s8 nuGfxMesgBuf[0x2020];
BSS s32 nuContWaitMesgBuf;
BSS s32 nuContDataMutexBuf;
BSS char D_800AC6D8[0x8];
BSS s8 piMgrThread[0x11B0];
BSS s32 __osPiMesgQueue;
BSS char D_800AF890[0x14];
BSS s32 piMgrMesgBuff;
BSS char D_800AF8AC[0x4];
BSS s32 piAccessBuf;
BSS char D_800AF8B4[0xC];
BSS char tmp_task[0x40];
BSS s32 siAccessBuf;
BSS char D_800AF904[0xC];
BSS s32 D_800AF910;
BSS char D_800AF914[0x4];
BSS s32 D_800AF918;
BSS char D_800AF91C[0x11B4];
BSS s32 D_800B0AD0;
BSS char D_800B0AD4[0x14];
BSS s32 D_800B0AE8;
BSS char D_800B0AEC[0x14];
BSS s16 D_800B0B00;
BSS s16 D_800B0B02;
BSS s32 D_800B0B04;
BSS char D_800B0B08[0x10];
BSS s16 D_800B0B18;
BSS s16 D_800B0B1A;
BSS s32 D_800B0B1C;
BSS char D_800B0B20[0x10];
BSS s32 D_800B0B30;
BSS char D_800B0B34[0x38];
BSS s32 D_800B0B6C;
BSS char D_800B0B70[0xC0];
BSS s32 __osFlashID;
BSS char D_800B0C34[0xC];
BSS s32 __osFlashMsg;
BSS char D_800B0C44[0x14];
BSS s32 __osFlashMessageQ;
BSS char D_800B0C5C[0x14];
BSS s32 __osFlashHandler;
BSS char D_800B0C74[0x70];
BSS s32 __osFlashMsgBuf;
BSS s32 __osFlashVersion;
BSS char D_800B0CEC[0x4];
BSS s32 wMapTexName;
BSS char D_800B0CF4[0x14];
BSS s32 D_800B0D08;
BSS char D_800B0D0C[0x1AC];
BSS s32 nuContWaitMesgQ;
BSS char D_800B0EBC[0x14];
BSS s32 __osContPifRam;
BSS char D_800B0ED4[0x34];
BSS s32 D_800B0F08;
BSS s32 D_800B0F0C;
BSS s8 gCurrentEncounter[0xBF8];
BSS s32 LeoDiskHandle;
BSS s8 D_800B1B0C;
BSS s8 D_800B1B0D;
BSS s8 D_800B1B0E;
BSS s8 D_800B1B0F;
BSS s32 D_800B1B10;
BSS char D_800B1B14[0x68];
BSS s32 nuContStatus[5];
BSS s8 D_800B1B90[0x1B0];
BSS s8 nuContRmbCtl[0x28];
BSS s8 nuContData[0x18];
BSS s8 gCameras[4 * 0x958];
BSS s32 gCollisionData;
BSS char D_800B42E4[0xC];
BSS s32 nuGfxMesgQ;
BSS char D_800B42F4[0x14];
BSS s32 D_800B4308;
BSS s8 D_800B430C;
BSS s8 D_800B430D;
BSS s8 D_800B430E;
BSS s8 D_800B430F;
BSS s8 D_800B4310;
BSS s8 D_800B4311;
BSS s32 D_800B4314;
BSS s32 D_800B4318;
BSS char D_800B431C[0x64];
BSS s32 __osPiAccessQueue;
BSS char D_800B4384[0x14];
BSS s32 gEffectInstances[96];
BSS s32 CartRomHandle;
BSS s8 D_800B451C;
BSS s8 D_800B451D;
BSS s8 D_800B451E;
BSS s8 D_800B451F;
BSS s8 D_800B4520[0x2070];
BSS s8 D_800B6590[0x2000];
BSS u8 nuYieldBuf[0xC10];
BSS s8 auSynDriver[0x30]; // type: AuSynDriver
BSS s8 D_800B91D0[0x20000];
BSS s8 gZoneCollisionData[0x10];
BSS s8 wMapHitName[0x18];
BSS s8 nuSiMgrMesgQ[0x38];
BSS s8 wMapShapeName[0x18];
BSS s8 nuAuHeap[0x30];
BSS s8 nuGfxTask[10 * 0x58];
BSS s8 D_800D95E8[0x38];
BSS s8 D_800D9620[0x48];
BSS s8 D_800D9668[0x18];
BSS s8 __osPfsInodeCache[0x100];
BSS s8 rspbootUcodeBuffer[0x100];
BSS s8 D_800D9880[0x700];
BSS s8 __osEventStateTab[0x80];
BSS s8 __osPfsPifRam[0x3C];
BSS s32 D_800DA03C;
BSS s8 D_800DA040[0x400];
BSS s32 nusched;
BSS s8 D_800DA444[0x38];
BSS s8 D_800DA47C[0x38];
BSS s8 D_800DA4B4[0xA8];
BSS s8 D_800DA55C[0x54C];
BSS s8 D_800DAAA8[0x10];
BSS s32 AlNumFields;
BSS s8 D_800DAABC;
BSS s8 D_800DAABD;
BSS s8 D_800DAAC0[0x18];
BSS s8 nuContPfs[0x1A0];
BSS s8 nuSiMesgQ[0x18];
BSS s8 D_800DAC90[0x18];
BSS s8 __osSiAccessQueue[0x18];
BSS s8 gCurrentSaveFile[0x1380];
BSS s8 nuContDataMutexQ[0x20];
BSS s32 D_800DC060;
BSS s32 D_800DC064;
BSS s32 gBattleState;
BSS char D_800DC06C[0x4];
BSS s8 gBattleStatus[0x460];
BSS s32 D_800DC4D0;
BSS s32 D_800DC4D4;
BSS s32 D_800DC4D8;
BSS s32 gBattleState2;
BSS s32 D_800DC4E0;
BSS s32 D_800DC4E4;
BSS s16 D_800DC4E8;
BSS u8 gCurrentBattleSection;
BSS u8 D_800DC4EB;
BSS s32 D_800DC4EC;
BSS s32 D_800DC4F0;
BSS s32 D_800DC4F4;
BSS s32 D_800DC4F8;
BSS s32 D_800DC4FC;

View File

@ -1,147 +0,0 @@
#include "types.h"
// This file exists to enforce the order of BSS symbols, since they were reordered in the original rom.
#ifndef M2CTX
#define BSS __attribute__ ((section (".bss")))
#else
#define BSS static
#endif
BSS s32 D_8010C920;
BSS void* D_8010C924;
BSS s32 D_8010C928;
BSS s32 D_8010C92C;
BSS s32 wPartnerNpc;
BSS s32* TweesterTouchingPlayer;
BSS s32 D_8010C938;
BSS s32 D_8010C93C;
BSS s32 D_8010C940;
BSS s32 gSpinHistoryBufferPos;
BSS char D_8010C948[0x4];
BSS s32 D_8010C94C;
BSS s32 D_8010C950;
BSS s32 TweesterTouchingPartner;
BSS s32 D_8010C958;
BSS s32 PrevPlayerDirection;
BSS s32 JumpedOnSwitchX;
BSS s32 D_8010C964;
BSS s32 D_8010C968;
BSS s32 PeachDisguiseNpcIndex;
BSS s32 D_8010C970;
BSS s32 D_8010C974;
BSS s16 D_8010C978;
BSS s16 D_8010C97A;
BSS s32 JumpedOnSwitchZ;
BSS s32 D_8010C980;
BSS s32 D_8010C984;
BSS char D_8010C988[0x4];
BSS s32 D_8010C98C;
BSS s32 D_8010C990;
BSS char D_8010C994[0xC];
BSS s32 D_8010C9A0;
BSS char D_8010C9A4[0xC];
BSS s32 D_8010C9B0;
BSS char D_8010C9B4[0xC];
// Moved to 7fd10_len_b40.c
// BSS s32 D_8010C9C0;
// BSS char D_8010C9C4[0x4];
// BSS s32 D_8010C9C8;
// BSS char D_8010C9CC[0x32C];
// BSS s16 D_8010CCF8;
// BSS s16 D_8010CCFA;
// BSS s16 D_8010CCFC;
// BSS s16 D_8010CCFE;
// BSS s32 D_8010CD00;
// BSS char D_8010CD04[0xC];
// BSS s16 D_8010CD10;
// BSS s16 D_8010CD12;
// BSS char D_8010CD14[0xC];
// BSS s32 D_8010CD20;
// BSS char D_8010CD24[0xC];
// Moved to partners.c
// BSS s32 D_8010CD30;
// BSS s32 D_8010CD34;
// BSS s32 gPlayerMoveHistory;
// BSS char D_8010CD3C[0x27C];
// BSS s32 gPlayerMoveHistoryIndex;
// BSS s32 D_8010CFBC;
// BSS s32 wPartnerTetherDistance;
// BSS s32 D_8010CFC4;
// BSS s16 wPartnerFollowState;
// BSS s16 D_8010CFCA;
// BSS s16 D_8010CFCC;
// BSS s16 D_8010CFCE;
// BSS s32 wPartnerNpcIndex;
// BSS s32 wPartnerCurrentScript;
// BSS s32 wCurrentPartnerId;
// BSS s32 wPartnerCurrentScriptID;
// BSS s32 D_8010CFE0;
// BSS s32 D_8010CFE4;
// BSS s32 D_8010CFE8;
// BSS s32 wPartner;
// BSS s32 D_8010CFF0;
// BSS s32 D_8010CFF4;
// BSS char D_8010CFF8[0x8];
// BSS s32 D_8010D000;
// BSS char D_8010D004[0x63C];
// BSS s32 D_8010D640;
// BSS s32 D_8010D644;
// BSS s32 D_8010D648;
// BSS s32 D_8010D64C;
// BSS s32 D_8010D650;
// BSS s8 D_8010D654;
// BSS s8 D_8010D655;
// BSS s16 D_8010D656;
// BSS s16 D_8010D658;
// BSS s16 D_8010D65A;
// BSS s32 D_8010D65C;
// BSS s32 D_8010D660;
// BSS s32 D_8010D664;
// BSS s32 D_8010D668;
// BSS s32 D_8010D66C;
// BSS s32 D_8010D670;
// BSS s32 D_8010D674;
// BSS s32 D_8010D678;
// BSS s16 D_8010D67C;
// BSS s16 D_8010D67E;
// BSS s16 D_8010D680;
// BSS s16 D_8010D682;
// BSS s16 D_8010D684;
// BSS s16 D_8010D686;
// BSS s16 D_8010D688;
// BSS s16 D_8010D68A;
// BSS s16 D_8010D68C;
// BSS s8 D_8010D68E;
// BSS s8 D_8010D68F;
// BSS s8 D_8010D690;
// BSS s8 D_8010D691;
// BSS s8 D_8010D692;
// BSS s8 D_8010D693;
// BSS s32 D_8010D694;
// BSS s8 D_8010D698;
// BSS s8 D_8010D699;
// BSS s16 D_8010D69A;
// BSS s32 gPopupMenu;
// BSS s32 D_8010D6A0;
// BSS s32 D_8010D6A4;
// BSS char D_8010D6A8[0x8];
// BSS char D_8010D6B0[0x1500];
// BSS char gPartnerActionStatus[0x360];
// BSS char gSpinHistoryPosY[0x18];
// BSS char gSpinHistoryPosX[0x18];
// BSS char gSpinHistoryPosZ[0x18];
// BSS char gUIStatus[0x3A];
// BSS s16 D_8010EF92;
// BSS char D_8010EF94[0x8];
// BSS s8 D_8010EF9C;
// BSS s8 D_8010EF9D;
// BSS s8 D_8010EF9E;
// BSS char D_8010EF9F;
// BSS char D_8010EFA0[0x28];
// BSS s8 gPlayerStatus[0x288];
// BSS s8 gPlayerSpinState[0x40];
// BSS s8 gPlayerData[0x428];
// BSS s8 gSpinHistoryPosAngle[0x18];

View File

@ -1,249 +0,0 @@
#include "types.h"
// This file exists to enforce the order of BSS symbols, since they were reordered in the original rom.
#ifndef M2CTX
#define BSS __attribute__ ((section (".bss")))
#else
#define BSS static
#endif
BSS s32 D_801512B0;
BSS s32 gHudElementsNumber;
BSS s32 gCurrentCustomModelGfxBuildersPtr;
BSS s32 D_801512BC;
BSS s32 entity_numEntities;
BSS s32 gEntityHeapBase;
BSS s32 gHudElementCacheTableRaster;
BSS s32 gCurrentModels;
BSS s32 gHudElementCacheTablePalette;
BSS s32 gAnimCount;
BSS s16 gMsgBGScrollAmtX;
BSS s16 D_801512DA;
BSS s32 D_801512DC;
BSS s32 gCurrentTransformGroups;
BSS s32 gMsgGlobalWaveCounter;
BSS s32 gCurrentCustomModelGfxPtr;
BSS s32 gLastCreatedEntityIndex;
BSS s32 D_801512F0;
BSS s32 gMsgVarImages;
BSS s32 ItemEntitiesCreated;
BSS s32 gCurrentModelTreeRoot;
BSS s32 gEntityHeapBottom;
BSS s32 D_80151304;
BSS u32 D_80151308;
BSS s16 gMsgBGScrollAmtY;
BSS s16 D_8015130E;
BSS s32 gEntityHideMode;
BSS s32 gHudElementCacheBuffer;
BSS s32 gEntityModelCount;
BSS s32 D_8015131C;
BSS char D_80151320[0x4];
BSS s32 entity_numShadows;
BSS s32 D_80151328;
BSS s32 entity_area_specific_data_is_loaded;
BSS s32 entity_updateCounter;
BSS s32 gTriggerCount;
BSS s32 D_80151338;
BSS s32 gHudElementCacheSize;
BSS u32 gCurrentDoorSoundsSet;
BSS s32 D_80151344;
BSS char D_80151348[0x38];
BSS s8 gWorldEntityList[0x78];
BSS s8 gBattleEntityList[0x78];
BSS s32 gCurrentEntityListPtr;
BSS char D_80151474[0x4];
BSS s8 gWorldShadowList[0xF0];
BSS s8 gBattleShadowList[0xF0];
BSS s32 gCurrentShadowListPtr;
BSS s32 wEntityDataLoadedSize;
BSS s32 bEntityDataLoadedSize;
BSS char D_80151664[0x4];
BSS s8 wEntityBlueprint[0x74];
BSS s32 D_801516DC;
BSS char D_8015DCE0[0x8];
BSS s8 bEntityBlueprint[0x14];
BSS s32 D_801516FC;
BSS s8 gMainGameState[0x40];
BSS s8 gCurrentTileDescriptor[0x30];
BSS s8 wModelList[0x400];
BSS s8 bModelList[0x400];
BSS s8 wTransformGroups[0x10];
BSS s8 bTransformGroups[0x10];
BSS s8 wModelSpecialDls[0x80];
BSS s8 bModelSpecialDls[0x80];
BSS s8 wCustomModelGfxBuilders[0x80];
BSS s8 bCustomModelGfxBuilders[0x80];
BSS s8 wModelLocalVtxBuffers[0x40];
BSS s8 bModelLocalVtxBuffers[0x40];
BSS s32 gCurrentModelLocalVtxBuffers;
BSS s32 D_80152214;
BSS s32 D_80152218;
BSS char D_8015221C[0x4];
BSS s8 D_80152220[0x800];
BSS s8 D_80152A20[0x800];
BSS s8 wBgRenderType;
BSS s8 bBgRenderType;
BSS s8 D_80153222;
BSS s8 D_80153223;
BSS s16 mdl_treeIterPos;
BSS s16 D_80153226;
BSS s8 wFogSettings[0x20];
BSS s8 bFogSettings[0x1C];
BSS s32 gCurrentFogSettings;
BSS s8 texPannerMainU[0x40];
BSS s8 texPannerMainV[0x40];
BSS s8 texPannerAuxU[0x40];
BSS s8 texPannerAuxV[0x40];
BSS void* mdl_nextTextureAddress;
BSS s16 mdl_currentTransformGroupChildIndex;
BSS s16 D_8015336E;
BSS s32 D_80153370;
BSS s16 D_80153374;
BSS s16 D_80153376;
BSS s8 D_80153378[0x8];
BSS s8 D_80153380[0x20];
BSS s8 mdl_renderTaskLists[0xC];
BSS s32 mdl_renderTaskQueueIdx;
BSS s8 mdl_renderTaskCount[0x10];
BSS s8 D_801533C0[0x300];
BSS s8 D_801536C0[0x300];
BSS s8 D_801539C0[0x40];
BSS s8 D_80153A00[0x40];
BSS s32 gCurrentAnimMeshListPtr;
BSS s32 gAnimModelFogEnabled;
BSS s32 gAnimModelFogR;
BSS s32 gAnimModelFogG;
BSS s32 gAnimModelFogB;
BSS s32 gAnimModelFogA;
BSS s32 gAnimModelFogStart;
BSS s32 gAnimModelFogEnd;
BSS s32 gAnimVtxSegment;
BSS char D_80153A64[0x4];
BSS s8 gAnimRotMtx[0x40];
BSS s8 gAnimScaleMtx[0x40];
BSS s8 gAnimTranslateMtx[0x40];
BSS s8 gAnimRotScaleMtx[0x40];
BSS s8 gAnimTreeRoot[0x8];
BSS s8 gWorldEntityModelList[0x400];
BSS s8 gBattleEntityModelList[0x400];
BSS s32 gCurrentEntityModelList;
BSS s32 D_80154374;
BSS s32 entity_fog_enabled;
BSS s8 entity_fog_red;
BSS char D_8015437D;
BSS char D_8015437E;
BSS s8 D_8015437F;
BSS s8 entity_fog_green;
BSS char D_80154381;
BSS char D_80154382;
BSS s8 D_80154383;
BSS s8 entity_fog_blue;
BSS char D_80154385;
BSS char D_80154386;
BSS s8 D_80154387;
BSS s8 entity_fog_alpha;
BSS char D_80154389;
BSS char D_8015438A;
BSS s8 D_8015438B;
BSS s32 entity_fog_dist_min;
BSS s32 entity_fog_dist_max;
BSS char D_80154394[0xC];
BSS s8 gWorldDynamicEntityList[0x40];
BSS s8 gBattleDynamicEntityList[0x40];
BSS s32 gCurrentDynamicEntityListPtr;
BSS char D_80154424[0xC];
BSS s8 gMessageBuffers[0x800];
BSS s8 gMessagePrinters[0x1008];
BSS s8 gMessageMsgVars[0x60];
BSS s8 D_80155C98[0x8];
BSS s8 gMessageWindowProjMatrix[0x80];
BSS s32 D_80155D20;
BSS char D_8015DD24[0x50];
BSS s32 msg_drawState;
BSS char D_8015DD78[0x8];
BSS s32 D_80155D80;
BSS s32 ItemEntityAlternatingSpawn;
BSS s32 ItemEntityRenderGroup;
BSS s16 D_80155D8C;
BSS s16 D_80155D8E;
BSS s8 D_80155D90[0x10];
BSS s8 WorldItemEntities[0x400];
BSS s8 BattleItemEntities[0x400];
BSS s32 gCurrentItemEntities;
BSS s16 isPickingUpItem;
BSS s16 D_801565A6;
BSS s32 D_801565A8;
BSS char D_801565AC[0x4];
BSS s8 D_801565B0[0x330];
BSS s32 D_801568E0;
BSS s32 D_801568E4;
BSS s32 D_801568E8;
BSS s32 D_801568EC;
BSS s32 D_801568F0;
BSS s32 D_801568F4;
BSS s32 D_801568F8;
BSS char D_801568FC[0x4];
BSS s32 screen_overlay_frontType;
BSS s32 screen_overlay_frontZoom;
BSS s32 screen_overlay_backType;
BSS s32 screen_overlay_backZoom;
BSS s8 D_80156910[0x10];
BSS s8 D_80156920[0x28];
BSS s8 D_80156948[0x8];
BSS s32 fold_vtxBuf;
BSS s32 D_80156954;
BSS s8 D_80156958[0x8];
BSS s8 D_80156960[0x8];
BSS s8 D_80156968[0x8];
BSS s8 D_80156970[0x10];
BSS s8 fold_groupDescriptors[0x5A0];
BSS s8 fold_gfxDataCache[0x40];
BSS s8 gHudElementsWorld[0x500];
BSS s8 gHudElementsBattle[0x500];
BSS s32 gHudElements;
BSS s32 gHudElementCacheBufferWorld;
BSS s32 gHudElementCacheSizeWorld;
BSS char D_8015796C[0x4];
BSS s8 gHudElementCacheTableRasterWorld[0x600];
BSS s8 gHudElementCacheTablePaletteWorld[0x600];
BSS s32 gHudElementCacheBufferBattle;
BSS s32 gHudElementCacheSizeBattle;
BSS char D_80158578[0x8];
BSS s8 gHudElementCacheTableRasterBattle[0x600];
BSS s8 gHudElementCacheTablePaletteBattle[0x600];
BSS s8 D_80159180[0x10];
BSS s8 wTriggerList[0x100];
BSS s8 bTriggerList[0x100];
BSS s32 gCurrentTriggerListPtr;
BSS char D_80159394[0xC];
BSS s8 D_801593A0[0x1FE];
BSS s16 D_8015959E;
BSS s8 D_801595A0[0x20];
BSS s8 D_801595C0[0xB0];
BSS s8 D_80159670[0xB0];
BSS s8 D_80159720[0xB0];
BSS s8 D_801597D0[0xB0];
BSS s8 D_80159880[0x20];
BSS s8 D_801598A0[0x118];
BSS s8 D_801599B8[0x118];
BSS s32 D_80159AD0;
BSS s32 D_80159AD4;
BSS char D_80159AD8[0x8];
BSS s16 MusicDefaultVolume;
BSS s16 MusicTargetVolume;
BSS s16 MusicMaxVolume;
BSS s16 MusicCurrentVolume;
BSS char D_80159AE8[0x8];
BSS s8 gMusicSettings[0x60];
BSS s8 D_80159B50[0x200];
BSS s8 gWindows[0x800];
BSS s8 gCollisionStatus[0x28];
BSS s16 gCurrentHiddenPanels;
BSS s16 D_8015A57A;
BSS char D_8015A57C[0x14];
BSS s8 mdl_textureHandles[0x2200];
BSS s8 D_8015C790[0x30];
BSS s8 AmbientSoundData[0x10];
BSS s32 CreateEntityVarArgBuffer[4];
BSS s32 D_8015C7E0;

View File

@ -8,9 +8,9 @@
typedef struct UnkE20EB0 {
/* 0x00 */ Npc* unk_00;
/* 0x04 */ Vec3f unk_04;
/* 0x04 */ Vec3f pos;
/* 0x10 */ f32 unk_10;
/* 0x14 */ f32 unk_14;
/* 0x14 */ f32 scale;
/* 0x18 */ s32 unk_18;
/* 0x1C */ f32 unk_1C;
/* 0x20 */ s32 unk_20;
@ -38,17 +38,17 @@ void func_802B70B4(void) {
npc = playerStatus->encounteredNPC;
D_802B79A8_E21858->unk_00 = npc;
D_802B79A8_E21858->unk_1C = npc->pos.y + npc->collisionHeight + 8.0f;
D_802B79A8_E21858->unk_04.y = D_802B79A8_E21858->unk_1C;
D_802B79A8_E21858->unk_04.x = npc->pos.x;
D_802B79A8_E21858->unk_04.z = npc->pos.z;
D_802B79A8_E21858->pos.y = D_802B79A8_E21858->unk_1C;
D_802B79A8_E21858->pos.x = npc->pos.x;
D_802B79A8_E21858->pos.z = npc->pos.z;
D_802B79A8_E21858->unk_18 = 0;
D_802B79A8_E21858->unk_2A = 0;
D_802B79A8_E21858->unk_14 = 0.1f;
D_802B79A8_E21858->scale = 0.1f;
D_8010C940 = func_802B742C;
playerStatus->animFlags |= PA_FLAGS_SPEECH_PROMPT_AVAILABLE;
temp = D_802B79A8_E21858;
temp->unk_2A = 0;
temp->unk_14 = 0.4f;
temp->scale = 0.4f;
D_802B79A8_E21858->unk_10 = -gCameras[gCurrentCameraID].currentYaw;
D_802B79A8_E21858->unk_2B = 255;
}
@ -58,10 +58,10 @@ void func_802B71C8(void) {
Matrix4f sp38, sp78;
if (gPlayerStatus.animFlags & PA_FLAGS_SPEECH_PROMPT_AVAILABLE) {
guScaleF(sp38, D_802B79A8_E21858->unk_14, D_802B79A8_E21858->unk_14, D_802B79A8_E21858->unk_14);
guScaleF(sp38, D_802B79A8_E21858->scale, D_802B79A8_E21858->scale, D_802B79A8_E21858->scale);
guRotateF(sp78, D_802B79A8_E21858->unk_10 - gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
guMtxCatF(sp38, sp78, sp38);
guTranslateF(sp78, D_802B79A8_E21858->unk_04.x, D_802B79A8_E21858->unk_04.y, D_802B79A8_E21858->unk_04.z);
guTranslateF(sp78, D_802B79A8_E21858->pos.x, D_802B79A8_E21858->pos.y, D_802B79A8_E21858->pos.z);
guMtxCatF(sp38, sp78, sp78);
guMtxF2L(sp78, &gDisplayContext->matrixStack[gMatrixListPos]);
@ -104,9 +104,9 @@ void func_802B742C(void) {
switch (D_802B79A8_E21858->unk_2A) {
case 0:
D_802B79A8_E21858->unk_10 = 0.0f;
D_802B79A8_E21858->unk_14 += 0.05;
if (D_802B79A8_E21858->unk_14 >= 0.55) {
D_802B79A8_E21858->unk_14 = 0.55f;
D_802B79A8_E21858->scale += 0.05;
if (D_802B79A8_E21858->scale >= 0.55) {
D_802B79A8_E21858->scale = 0.55f;
D_802B79A8_E21858->unk_2A++;
D_802B79A8_E21858->unk_20 = 12;
}
@ -153,7 +153,7 @@ void func_802B742C(void) {
npc = D_802B79A8_E21858->unk_00;
D_802B79A8_E21858->unk_1C = npc->pos.y + npc->collisionHeight + 8.0f;
D_802B79A8_E21858->unk_04.y = D_802B79A8_E21858->unk_1C;
D_802B79A8_E21858->unk_04.x = npc->pos.x;
D_802B79A8_E21858->unk_04.z = npc->pos.z;
D_802B79A8_E21858->pos.y = D_802B79A8_E21858->unk_1C;
D_802B79A8_E21858->pos.x = npc->pos.x;
D_802B79A8_E21858->pos.z = npc->pos.z;
}

View File

@ -68,7 +68,7 @@ EffectTableEntry gEffectTable[] = {
/* 0x26 */ FX_ENTRY(music_note, _35A5E0),
/* 0x27 */ FX_ENTRY(smoke_burst, _328EA0),
/* 0x28 */ FX_ENTRY(sweat, _35C550),
/* 0x29 */ FX_ENTRY(sleep_bubble, _35D510),
/* 0x29 */ FX_ENTRY(sleep_bubble, effect_gfx_sleep_bubble),
/* 0x2A */ {},
/* 0x2B */ FX_ENTRY(windy_leaves, _33D610),
/* 0x2C */ FX_ENTRY(falling_leaves, _35F0E0),
@ -82,7 +82,7 @@ EffectTableEntry gEffectTable[] = {
/* 0x34 */ FX_ENTRY(ending_decals, _36AEE0),
/* 0x35 */ FX_ENTRY(light_rays, _36DF90),
/* 0x36 */ FX_ENTRY(lightning, _36ED60),
/* 0x37 */ FX_ENTRY(fire_breath, _3733E0),
/* 0x37 */ FX_ENTRY(fire_breath, effect_gfx_fire_breath),
/* 0x38 */ FX_ENTRY(shimmer_burst, _337FC0),
/* 0x39 */ FX_ENTRY(energy_shockwave, _375510),
/* 0x3A */ FX_ENTRY(shimmer_wave, _337FC0),

View File

@ -1,13 +1,13 @@
#include "common.h"
#include "effects_internal.h"
extern Gfx D_09000A00[];
extern Gfx D_09000B88[];
extern Gfx D_09000C00[];
extern Gfx D_09000C20[];
extern Gfx D_09000A00_373DE0[];
extern Gfx D_09000B88_373F68[];
extern Gfx D_09000C00_373FE0[];
extern Gfx D_09000C20_374000[];
Gfx* D_E006EC00[] = { D_09000B88, D_09000B88, D_09000B88 };
Gfx* D_E006EC0C[] = { D_09000A00, D_09000A00, D_09000A00 };
Gfx* D_E006EC00[] = { D_09000B88_373F68, D_09000B88_373F68, D_09000B88_373F68 };
Gfx* D_E006EC0C[] = { D_09000A00_373DE0, D_09000A00_373DE0, D_09000A00_373DE0 };
void fire_breath_init(EffectInstance* effect);
void fire_breath_update(EffectInstance* effect);
@ -199,8 +199,8 @@ void fire_breath_appendGfx(void* effect) {
gSPMatrix(gMasterGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gMasterGfxPos++, D_09000C20);
gSPDisplayList(gMasterGfxPos++, D_09000C00);
gSPDisplayList(gMasterGfxPos++, D_09000C20_374000);
gSPDisplayList(gMasterGfxPos++, D_09000C00_373FE0);
gSPPopMatrix(gMasterGfxPos++, G_MTX_MODELVIEW);
}

View File

@ -0,0 +1,12 @@
#include "common.h"
#include "effects/gfx/D_09000000_3733E0.png.inc.c"
#include "effects/gfx/D_09000800_373BE0.png.inc.c"
#include "effects/gfx/D_09000A00_373DE0.gfx.inc.c"
#include "effects/gfx/D_09000AE8_373EC8.vtx.inc.c"
#include "effects/gfx/D_09000B38_373F18.vtx.inc.c"
#include "effects/gfx/D_09000B88_373F68.gfx.inc.c"
#include "effects/gfx/D_09000BA8_373F88.gfx.inc.c"
#include "effects/gfx/D_09000BC0_373FA0.vtx.inc.c"
#include "effects/gfx/D_09000C00_373FE0.gfx.inc.c"
#include "effects/gfx/D_09000C20_374000.gfx.inc.c"

View File

@ -0,0 +1,11 @@
#include "common.h"
#include "effects/gfx/D_09000000_35D510.png.inc.c"
#include "effects/gfx/D_09000080_35D590.png.inc.c"
#include "effects/gfx/D_09000100_35D610.png.inc.c"
#include "effects/gfx/D_09000180_35D690.vtx.inc.c"
#include "effects/gfx/D_090002E0_35D7F0.gfx.inc.c"
#include "effects/gfx/D_09000390_35D8A0.gfx.inc.c"
#include "effects/gfx/D_09000440_35D950.gfx.inc.c"

View File

@ -6,7 +6,17 @@ void sleep_bubble_init(EffectInstance* effect);
void sleep_bubble_update(EffectInstance* effect);
void sleep_bubble_render(EffectInstance* effect);
f32 D_E00529E0[] = { 4.4f, 3.2f, 5.4f, 2.7f, 6.0f, 4.9f, 5.2f, 3.1f, 2.4f, 4.5f, 2.6f, 5.7f, 3.8f, 2.9f, 3.1f, 5.2f, 2.3f, 5.4f, 3.5f, 2.6f, 2.4f, 3.1f, 5.2f, 4.9f, 6.0f, 2.7f, 5.4f, 3.2f, 4.4f, 2.6f, 3.5f, 5.4f, 2.3f, 5.2f, 3.1f, 2.9f, 3.8f, 5.7f, 2.6f, 4.5f };
f32 D_E00529E0[] = {
4.4f, 3.2f, 5.4f, 2.7f, 6.0f, 4.9f, 5.2f, 3.1f, 2.4f, 4.5f,
2.6f, 5.7f, 3.8f, 2.9f, 3.1f, 5.2f, 2.3f, 5.4f, 3.5f, 2.6f,
2.4f, 3.1f, 5.2f, 4.9f, 6.0f, 2.7f, 5.4f, 3.2f, 4.4f, 2.6f,
3.5f, 5.4f, 2.3f, 5.2f, 3.1f, 2.9f, 3.8f, 5.7f, 2.6f, 4.5f
};
extern Vtx D_09000180_35D690[];
extern Gfx D_090002E0_35D7F0[];
extern Gfx D_09000390_35D8A0[];
extern Gfx D_09000440_35D950[];
void sleep_bubble_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, EffectInstance** arg6) {
EffectBlueprint bp;
@ -77,7 +87,7 @@ void sleep_bubble_update(EffectInstance* effect) {
yPtr = &part->points->y;
xAngle = yAngle = i;
do {
for (i = 0; i < ARRAY_COUNT(part->points); i++) {
angle = i * 360.0f / 21.0f + 17.0f;
*xPtr = temp2 * shim_sin_deg(angle);
@ -91,8 +101,7 @@ void sleep_bubble_update(EffectInstance* effect) {
xPtr += 2;
yPtr += 2;
i++;
} while (i < ARRAY_COUNT(part->points));
}
part->unk_C4 = 0.0f;
if (timeLeft < 100) {
@ -115,4 +124,68 @@ void sleep_bubble_render(EffectInstance* effect) {
retTask->renderMode |= RENDER_TASK_FLAG_2;
}
INCLUDE_ASM(s32, "effects/sleep_bubble", sleep_bubble_appendGfx);
void sleep_bubble_appendGfx(void* effect) {
SleepBubbleFXData* data = ((EffectInstance*)effect)->data.sleepBubble;
Matrix4f sp18, sp58;
s32 timeLeft;
s32 i;
gDPPipeSync(gMasterGfxPos++);
gSPSegment(gMasterGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
timeLeft = data->timeLeft;
if (timeLeft == 0) {
gSPDisplayList(gMasterGfxPos++, D_09000440_35D950);
} else if (timeLeft == 1) {
gSPDisplayList(gMasterGfxPos++, D_09000390_35D8A0);
} else {
gSPDisplayList(gMasterGfxPos++, D_090002E0_35D7F0);
}
shim_guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMasterGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPVertex(gMasterGfxPos++, &D_09000180_35D690[1], 1, 0);
shim_guRotateF(sp18, data->unk_10, 0.0f, 0.0f, 1.0f);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMasterGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
shim_guRotateF(sp18, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guTranslateF(sp58, data->unk_C4, data->unk_C8, 0.0f);
shim_guMtxCatF(sp58, sp18, sp18);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMasterGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPVertex(gMasterGfxPos++, &D_09000180_35D690[0], 1, 1);
for (i = 0; i < ARRAY_COUNT(data->points); i++) {
shim_guTranslateF(sp18, data->points[i].x, data->points[i].y, 0.0f);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMasterGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPVertex(gMasterGfxPos++, &D_09000180_35D690[i + 2], 1, i + 2);
gSPPopMatrix(gMasterGfxPos++, G_MTX_MODELVIEW);
}
gSPPopMatrix(gMasterGfxPos++, G_MTX_MODELVIEW);
gSPPopMatrix(gMasterGfxPos++, G_MTX_MODELVIEW);
if (timeLeft < 100) {
gSP1Triangle(gMasterGfxPos++, 21, 2, 1, 0);
for (i = 0; i < ARRAY_COUNT(data->points) - 1; i++) {
gSP1Triangle(gMasterGfxPos++, i + 2, i + 3, 1, 0);
}
} else {
gSP1Triangle(gMasterGfxPos++, 0, 1, 2, 0);
gSP1Triangle(gMasterGfxPos++, 0, 21, 1, 0);
for (i = 0; i < ARRAY_COUNT(data->points) - 1; i++) {
gSP1Triangle(gMasterGfxPos++, i + 2, i + 3, 1, 0);
}
}
}

View File

@ -893,7 +893,7 @@ s32 create_generic_entity_world(void (*updateFunc)(void), void (*drawFunc)(void)
return i;
}
s32 create_generic_entity_frontUI(void (*updateFunc)(void), void (*drawFunc)(void)) {
s32 create_generic_entity_frontUI(s32 (*updateFunc)(void), void (*drawFunc)(void)) {
s32 i;
DynamicEntity* newDynEntity;

View File

@ -13,7 +13,7 @@ typedef struct {
#define gISVDbgPrnAdrs ((ISVDbg*) 0xb3ff0000)
u32 is_debug_print(void* arg0, const unsigned char* str, u32 count);
char* is_debug_print(char* arg0, const char* str, size_t count);
void is_debug_init(void) {
osEPiWriteIo(nuPiCartHandle, (u32) &gISVDbgPrnAdrs->put, 0);
@ -42,7 +42,7 @@ void rmonPrintf(const char* fmt, ...) {
_Printf(is_debug_print, NULL, fmt, args);
}
u32 is_debug_print(void* arg0, const unsigned char* str, u32 count) {
char* is_debug_print(char* arg0, const char* str, size_t count) {
u32 data;
s32 pos;
s32 start;
@ -50,7 +50,7 @@ u32 is_debug_print(void* arg0, const unsigned char* str, u32 count) {
osEPiReadIo(nuPiCartHandle, (u32) &gISVDbgPrnAdrs->magic, &data);
if (data != ASCII_TO_U32('I', 'S', '6', '4')) {
return 1;
return (char*) 1;
}
osEPiReadIo(nuPiCartHandle, (u32) &gISVDbgPrnAdrs->get, &data);
pos = data;
@ -60,20 +60,22 @@ u32 is_debug_print(void* arg0, const unsigned char* str, u32 count) {
if (end >= 0xffe0) {
end -= 0xffe0;
if (pos < end || start < pos) {
return 1;
return (char*) 1;
}
} else {
if (start < pos && pos < end) {
return 1;
return (char*) 1;
}
}
while (count) {
if (*str) {
u8 c = *str;
if (c != 0) {
u32 addr = (u32) &gISVDbgPrnAdrs->data + (start & 0xffffffc);
s32 shift = ((3 - (start & 3)) * 8);
osEPiReadIo(nuPiCartHandle, addr, &data);
osEPiWriteIo(nuPiCartHandle, addr, (data & ~(0xff << shift)) | (*str << shift));
osEPiWriteIo(nuPiCartHandle, addr, (data & ~(0xff << shift)) | ((u8)*str << shift));
start++;
if (start >= 0xffe0) {
@ -84,19 +86,14 @@ u32 is_debug_print(void* arg0, const unsigned char* str, u32 count) {
str++;
}
osEPiWriteIo(nuPiCartHandle, (u32)&gISVDbgPrnAdrs->put, start);
return 1;
return (char*) 1;
}
#ifdef VERSION_US
// Nop issue with the rodata string
#ifdef NON_MATCHING
void func_80025F44(const char* message, char* file, s32 line) {
osSyncPrintf("File:%s Line:%d %s \n", file, line, message);
PANIC();
}
#else
INCLUDE_ASM(void, "is_debug", func_80025F44, char* arg0, char* file, s32 line);
#endif
#elif VERSION_JP
extern const char D_80097D10[]; // "File:%s Line:%d %s \n\0\0\0"
void func_80025F44(char* arg0, char* file, s32 line, char* arg3) {

View File

@ -1,15 +1,119 @@
#include "common.h"
#include "ld_addrs.h"
extern s32 D_80293B80[];
s32 D_80293B80[] = {
-1,
ITEM_MUSHROOM,
ITEM_FIRE_FLOWER,
ITEM_DUSTY_HAMMER,
ITEM_P_O_W_BLOCK,
ITEM_PEBBLE,
ITEM_VOLT_SHROOM,
ITEM_THUNDER_RAGE,
ITEM_SNOWMAN_DOLL,
ITEM_DRIED_SHROOM,
ITEM_SHOOTING_STAR,
ITEM_SLEEPY_SHEEP,
ITEM_STONE_CAP,
ITEM_TASTY_TONIC,
ITEM_THUNDER_BOLT,
ITEM_SUPER_SHROOM,
ITEM_ULTRA_SHROOM,
ITEM_SUPER_SODA,
ITEM_HUSTLE_DRINK,
ITEM_STOP_WATCH,
ITEM_DIZZY_DIAL,
ITEM_PLEASE_COME_BACK,
ITEM_EGG_MISSILE,
ITEM_INSECTICIDE_HERB,
ITEM_FRIGHT_JAR,
ITEM_MYSTERY,
ITEM_REPEL_GEL,
ITEM_LIFE_SHROOM,
ITEM_COCONUT,
ITEM_ELECTRO_POP,
ITEM_STRANGE_CAKE,
ITEM_KOOKY_COOKIE,
ITEM_NONE
};
typedef struct BattleItemTableEntry {
/* 0x0 */ u8* romStart;
/* 0x4 */ u8* romEnd;
/* 0x8 */ u8* vramStart;
/* 0xC */ u8* vramEnd;
} BattleItemTableEntry; // size = 0x10
extern EvtScript battle_item_food_main;
extern EvtScript battle_item_mushroom_main;
extern EvtScript battle_item_fire_flower_main;
extern EvtScript battle_item_dusty_hammer_main;
extern EvtScript battle_item_pow_block_main;
extern EvtScript battle_item_pebble_main;
extern EvtScript battle_item_volt_shroom_main;
extern EvtScript battle_item_thunder_rage_main;
extern EvtScript battle_item_snowman_doll_main;
extern EvtScript battle_item_shooting_star_main;
extern EvtScript battle_item_sleepy_sheep_main;
extern EvtScript battle_item_stone_cap_main;
extern EvtScript battle_item_tasty_tonic_main;
extern EvtScript battle_item_thunder_bolt_main;
extern EvtScript battle_item_super_soda_main;
extern EvtScript battle_item_hustle_drink_main;
extern EvtScript battle_item_stop_watch_main;
extern EvtScript battle_item_dizzy_dial_main;
extern EvtScript battle_item_please_come_back_main;
extern EvtScript battle_item_egg_missile_main;
extern EvtScript battle_item_insecticide_herb_main;
extern EvtScript battle_item_fright_jar_main;
extern EvtScript battle_item_mystery_main;
extern EvtScript battle_item_repel_gel_main;
extern EvtScript battle_item_life_shroom_main;
extern EvtScript battle_item_coconut_main;
extern EvtScript battle_item_electro_pop_main;
extern EvtScript battle_item_strange_cake_main;
extern BattleItemTableEntry gBattleItemTable[];
#define BTL_ITEM_TABLE_ENTRY(name) { name##_ROM_START, name##_ROM_END, name##_VRAM, &battle_item_##name##_main }
typedef struct BattleTableEntry {
/* 0x00 */ u8* romStart;
/* 0x04 */ u8* romEnd;
/* 0x08 */ u8* vramStart;
/* 0x0C */ EvtScript* mainScript;
} BattleTableEntry; // size = 0x10
BattleTableEntry gBattleItemTable[] = {
BTL_ITEM_TABLE_ENTRY(food),
BTL_ITEM_TABLE_ENTRY(mushroom),
BTL_ITEM_TABLE_ENTRY(fire_flower),
BTL_ITEM_TABLE_ENTRY(dusty_hammer),
BTL_ITEM_TABLE_ENTRY(pow_block),
BTL_ITEM_TABLE_ENTRY(pebble),
BTL_ITEM_TABLE_ENTRY(volt_shroom),
BTL_ITEM_TABLE_ENTRY(thunder_rage),
BTL_ITEM_TABLE_ENTRY(snowman_doll),
BTL_ITEM_TABLE_ENTRY(mushroom),
BTL_ITEM_TABLE_ENTRY(shooting_star),
BTL_ITEM_TABLE_ENTRY(sleepy_sheep),
BTL_ITEM_TABLE_ENTRY(stone_cap),
BTL_ITEM_TABLE_ENTRY(tasty_tonic),
BTL_ITEM_TABLE_ENTRY(thunder_bolt),
BTL_ITEM_TABLE_ENTRY(mushroom),
BTL_ITEM_TABLE_ENTRY(mushroom),
BTL_ITEM_TABLE_ENTRY(super_soda),
BTL_ITEM_TABLE_ENTRY(hustle_drink),
BTL_ITEM_TABLE_ENTRY(stop_watch),
BTL_ITEM_TABLE_ENTRY(dizzy_dial),
BTL_ITEM_TABLE_ENTRY(please_come_back),
BTL_ITEM_TABLE_ENTRY(egg_missile),
BTL_ITEM_TABLE_ENTRY(insecticide_herb),
BTL_ITEM_TABLE_ENTRY(fright_jar),
BTL_ITEM_TABLE_ENTRY(mystery),
BTL_ITEM_TABLE_ENTRY(repel_gel),
BTL_ITEM_TABLE_ENTRY(life_shroom),
BTL_ITEM_TABLE_ENTRY(coconut),
BTL_ITEM_TABLE_ENTRY(electro_pop),
BTL_ITEM_TABLE_ENTRY(strange_cake),
BTL_ITEM_TABLE_ENTRY(strange_cake),
};
// Offsets into gBattleItemTable?
u16 D_80293E04[] = {
1, 31, 1, 5, 1, 2, 9, 3, 9, 3, 9, 1, 10, 6, 10, 6, 10, 4, 11, 8, 11, 8, 11, 4, 12, 3, 12, 3, 12, 1,
};
ApiStatus LoadItemScript(Evt* script, s32 isInitialCall) {
PlayerData* playerData = &gPlayerData;
@ -39,7 +143,7 @@ ApiStatus LoadItemScript(Evt* script, s32 isInitialCall) {
deduct_current_move_fp();
}
}
itemPtr = &D_80293B80[0];
for (i = 0; *itemPtr != ITEM_NONE; i++, itemPtr++) {
if (*itemPtr == battleStatus->selectedItemID) {
@ -57,8 +161,8 @@ ApiStatus LoadItemScript(Evt* script, s32 isInitialCall) {
dma_copy(gBattleItemTable[i].romStart, gBattleItemTable[i].romEnd, gBattleItemTable[i].vramStart);
script->varTable[0] = (s32) gBattleItemTable[i].vramEnd;
script->varTable[1] = 0;
script->varTablePtr[0] = gBattleItemTable[i].mainScript;
script->varTable[1] = FALSE;
return ApiStatus_DONE2;
}
@ -96,23 +200,15 @@ ApiStatus LoadFreeItemScript(Evt* script, s32 isInitialCall) {
}
dma_copy(gBattleItemTable[i].romStart, gBattleItemTable[i].romEnd, gBattleItemTable[i].vramStart);
script->varTable[0] = (s32) gBattleItemTable[i].vramEnd;
script->varTable[1] = 1;
script->varTablePtr[0] = gBattleItemTable[i].mainScript;
script->varTable[1] = TRUE;
return ApiStatus_DONE2;
}
ApiStatus LoadMoveScript(Evt* script, s32 isInitialCall) {
BattleStatus* battleStatus = &gBattleStatus;
s32* moveScript = gMoveScriptTable[battleStatus->selectedMoveID];
dma_copy(moveScript[0], moveScript[1], moveScript[2]);
script->varTable[0] = moveScript[3];
deduct_current_move_fp();
if (gBattleStatus.flags2 & 0x8000000) {
enable_player_blur();
}
return ApiStatus_DONE2;
}
EvtScript UseMystery = {
EVT_WAIT(2)
EVT_CALL(LoadFreeItemScript)
EVT_EXEC_WAIT(LocalVar(0))
EVT_RETURN
EVT_END
};

124
src/move_script.c Normal file
View File

@ -0,0 +1,124 @@
#include "common.h"
#include "ld_addrs.h"
typedef struct BattleTableEntry {
/* 0x00 */ u8* romStart;
/* 0x04 */ u8* romEnd;
/* 0x08 */ u8* vramStart;
/* 0x0C */ EvtScript* mainScript;
} BattleTableEntry; // size = 0x10
extern EvtScript battle_move_hammer_802A3044;
extern EvtScript battle_move_hammer_802A369C;
extern EvtScript battle_move_hammer_802A3B28;
extern EvtScript battle_move_spin_smash_main;
extern EvtScript battle_move_quake_hammer_main;
extern EvtScript battle_move_d_down_pound_main;
extern EvtScript battle_move_hammer_charge_0_802A38C4;
extern EvtScript battle_move_hammer_charge_0_802A3234;
extern EvtScript battle_move_hammer_throw_main;
extern EvtScript battle_move_mega_quake_main;
extern EvtScript battle_move_hammer_charge_1_802A3944;
extern EvtScript battle_move_hammer_charge_1_802A32B4;
extern EvtScript battle_move_hammer_charge_2_802A3944;
extern EvtScript battle_move_hammer_charge_2_802A32B4;
extern EvtScript battle_move_auto_smash_main;
extern EvtScript battle_move_power_quake_main;
extern EvtScript battle_move_power_smash_main;
extern EvtScript battle_move_super_smash_main;
extern EvtScript battle_move_mega_smash_main;
extern EvtScript battle_move_shrink_smash_main;
extern EvtScript battle_move_shell_crack_main;
extern EvtScript battle_move_jump_802A2650;
extern EvtScript battle_move_jump_802A30F4;
extern EvtScript battle_move_jump_802A3644;
extern EvtScript battle_move_multibounce_main;
extern EvtScript battle_move_power_bounce_main;
extern EvtScript battle_move_sleep_stomp_main;
extern EvtScript battle_move_dizzy_stomp_main;
extern EvtScript battle_move_jump_charge_0_802A2800;
extern EvtScript battle_move_jump_charge_0_802A27F0;
extern EvtScript battle_move_jump_charge_1_802A2880;
extern EvtScript battle_move_jump_charge_1_802A2870;
extern EvtScript battle_move_jump_charge_2_802A2880;
extern EvtScript battle_move_jump_charge_2_802A2870;
extern EvtScript battle_move_auto_jump_main;
extern EvtScript battle_move_auto_multibounce_main;
extern EvtScript battle_move_power_jump_main;
extern EvtScript battle_move_super_jump_main;
extern EvtScript battle_move_mega_jump_main;
extern EvtScript battle_move_d_down_jump_main;
extern EvtScript battle_move_shrink_stomp_main;
extern EvtScript battle_move_earthquake_jump_main;
// Some moves seem to have multiple entry point methods, in which case the _SCR macro is used
#define BTL_MOVE_TABLE_ENTRY(name) { battle_move_##name##_ROM_START, battle_move_##name##_ROM_END, battle_move_##name##_VRAM, &battle_move_##name##_main }
#define BTL_MOVE_TABLE_ENTRY_SCR(name, script) { battle_move_##name##_ROM_START, battle_move_##name##_ROM_END, battle_move_##name##_VRAM, &script }
BattleTableEntry gMoveScriptTable[] = {
{ NULL, NULL, NULL, NULL },
{ NULL, NULL, NULL, NULL },
{ NULL, NULL, NULL, NULL },
BTL_MOVE_TABLE_ENTRY_SCR(hammer, battle_move_hammer_802A3044),
BTL_MOVE_TABLE_ENTRY_SCR(hammer, battle_move_hammer_802A3044),
BTL_MOVE_TABLE_ENTRY_SCR(hammer, battle_move_hammer_802A3044),
BTL_MOVE_TABLE_ENTRY_SCR(hammer, battle_move_hammer_802A369C),
BTL_MOVE_TABLE_ENTRY_SCR(hammer, battle_move_hammer_802A3B28),
BTL_MOVE_TABLE_ENTRY(spin_smash),
BTL_MOVE_TABLE_ENTRY(quake_hammer),
BTL_MOVE_TABLE_ENTRY(d_down_pound),
BTL_MOVE_TABLE_ENTRY_SCR(hammer_charge_0, battle_move_hammer_charge_0_802A38C4),
BTL_MOVE_TABLE_ENTRY_SCR(hammer_charge_0, battle_move_hammer_charge_0_802A3234),
BTL_MOVE_TABLE_ENTRY(hammer_throw),
BTL_MOVE_TABLE_ENTRY(mega_quake),
BTL_MOVE_TABLE_ENTRY_SCR(hammer_charge_1, battle_move_hammer_charge_1_802A3944),
BTL_MOVE_TABLE_ENTRY_SCR(hammer_charge_1, battle_move_hammer_charge_1_802A32B4),
BTL_MOVE_TABLE_ENTRY_SCR(hammer_charge_2, battle_move_hammer_charge_2_802A3944),
BTL_MOVE_TABLE_ENTRY_SCR(hammer_charge_2, battle_move_hammer_charge_2_802A32B4),
BTL_MOVE_TABLE_ENTRY(auto_smash),
BTL_MOVE_TABLE_ENTRY(power_quake),
BTL_MOVE_TABLE_ENTRY(power_smash),
BTL_MOVE_TABLE_ENTRY(super_smash),
BTL_MOVE_TABLE_ENTRY(mega_smash),
BTL_MOVE_TABLE_ENTRY(shrink_smash),
BTL_MOVE_TABLE_ENTRY(shell_crack),
BTL_MOVE_TABLE_ENTRY_SCR(jump, battle_move_jump_802A2650),
BTL_MOVE_TABLE_ENTRY_SCR(jump, battle_move_jump_802A2650),
BTL_MOVE_TABLE_ENTRY_SCR(jump, battle_move_jump_802A2650),
BTL_MOVE_TABLE_ENTRY_SCR(jump, battle_move_jump_802A30F4),
BTL_MOVE_TABLE_ENTRY_SCR(jump, battle_move_jump_802A3644),
BTL_MOVE_TABLE_ENTRY(multibounce),
BTL_MOVE_TABLE_ENTRY(power_bounce),
BTL_MOVE_TABLE_ENTRY(sleep_stomp),
BTL_MOVE_TABLE_ENTRY(dizzy_stomp),
BTL_MOVE_TABLE_ENTRY_SCR(jump_charge_0, battle_move_jump_charge_0_802A2800),
BTL_MOVE_TABLE_ENTRY_SCR(jump_charge_0, battle_move_jump_charge_0_802A27F0),
BTL_MOVE_TABLE_ENTRY_SCR(jump_charge_1, battle_move_jump_charge_1_802A2880),
BTL_MOVE_TABLE_ENTRY_SCR(jump_charge_1, battle_move_jump_charge_1_802A2870),
BTL_MOVE_TABLE_ENTRY_SCR(jump_charge_2, battle_move_jump_charge_2_802A2880),
BTL_MOVE_TABLE_ENTRY_SCR(jump_charge_2, battle_move_jump_charge_2_802A2870),
BTL_MOVE_TABLE_ENTRY(auto_jump),
BTL_MOVE_TABLE_ENTRY(auto_multibounce),
BTL_MOVE_TABLE_ENTRY(power_jump),
BTL_MOVE_TABLE_ENTRY(super_jump),
BTL_MOVE_TABLE_ENTRY(mega_jump),
BTL_MOVE_TABLE_ENTRY(d_down_jump),
BTL_MOVE_TABLE_ENTRY(shrink_stomp),
BTL_MOVE_TABLE_ENTRY(earthquake_jump),
};
ApiStatus LoadMoveScript(Evt* script, s32 isInitialCall) {
BattleStatus* battleStatus = &gBattleStatus;
BattleTableEntry* moveTableEntry = &gMoveScriptTable[battleStatus->selectedMoveID];
dma_copy(moveTableEntry->romStart, moveTableEntry->romEnd, moveTableEntry->vramStart);
script->varTablePtr[0] = moveTableEntry->mainScript;
deduct_current_move_fp();
if (gBattleStatus.flags2 & BS_FLAGS2_8000000) {
enable_player_blur();
}
return ApiStatus_DONE2;
}

View File

@ -1,9 +1,9 @@
#include "flo_00.h"
// Same as SpawnSunEffect, but doesn't touch float regs like SpawnSunEffect does
void fx_sun();
void fx_sun_undeclared(s32, s32, s32, s32, s32, s32);
ApiStatus N(func_80240000_C9DF20)(Evt* script, s32 isInitialCall) {
fx_sun(0, 0, 0, 0, 0, 0);
fx_sun_undeclared(0, 0, 0, 0, 0, 0);
return ApiStatus_DONE2;
}

View File

@ -2,151 +2,131 @@
#include "nu/nusys.h"
#include "model.h"
void N(func_802404B0_CB96B0)(s32 arg0, s32 arg1, s32 arg2, s32 arg3);
INCLUDE_ASM(void, "world/area_flo/flo_10/CB96B0", flo_10_func_802404B0_CB96B0);
void N(UnkModelFunc000)(s32, s32, s32, s32);
typedef struct {
/* 0x00 */ char unk_00[0x4];
/* 0x04 */ s32 unk_04;
/* 0x08 */ char unk_08[0x14];
/* 0x1C */ s32 unk_1C;
} N(UnkStruct2);
INCLUDE_ASM(void, "world/area_flo/flo_10/CB96B0", flo_10_UnkModelFunc000);
typedef struct {
/* 0x00 */ char unk_00[0xC];
/* 0x0C */ N(UnkStruct2)* unk_0C;
} N(UnkStruct);
void N(func_80240A98_CB9C98)(void) {
void N(UnkModelFunc001)(void) {
Camera* camera = &gCameras[gCurrentCameraID];
Model* model = get_model_from_list_index(get_model_list_index_from_tree_index(0x30));
// modelNode propertylist? Causes too many derefences and conflicts with the modelNode load below
N(UnkStruct2)* unk1 = ((N(UnkStruct)*)model->modelNode)->unk_0C;
ModelBoundingBox* bb = (ModelBoundingBox*) model->modelNode->propertyList;
f32 bbHalfX = bb->halfSizeX;
f32 bbHalfZ = bb->halfSizeZ;
f32 outX, outY, outZ, outS;
f32 temp_f24;
f32 temp_f26;
f32 temp_f20;
f32 temp_f22;
s32 test;
f32 sp3C;
f32 sp38;
f32 sp34;
f32 sp30;
f32 sp2C;
f32 sp28;
sp3C = unk1->unk_04;
sp38 = unk1->unk_1C;
transform_point(camera->perspectiveMatrix,
model->center.x - sp3C, model->center.y, model->center.z - sp38, 1.0f,
&sp28, &sp2C, &sp30, &sp34);
model->center.x - bbHalfX, model->center.y, model->center.z - bbHalfZ, 1.0f,
&outX, &outY, &outZ, &outS);
sp28 = sp28 * (1.0f / sp34);
sp2C = sp2C * -(1.0f / sp34);
sp30 = sp30 * (1.0f / sp34);
sp34 = (1.0f / sp34);
outX *= 1.0f / outS;
outY *= -(1.0f / outS);
outZ *= 1.0f / outS;
outS = 1.0f / outS;
if (sp34 < 0.0f) {
sp28 = 0.0f;
sp2C = 1.0f;
if (outS < 0.0f) {
outX = 0.0f;
outY = 1.0f;
}
temp_f20 = sp28;
temp_f22 = sp2C;
temp_f20 = outX;
temp_f22 = outY;
transform_point(camera->perspectiveMatrix,
model->center.x - sp3C, model->center.y, model->center.z + sp38, 1.0f,
&sp28, &sp2C, &sp30, &sp34);
model->center.x - bbHalfX, model->center.y, model->center.z + bbHalfZ, 1.0f,
&outX, &outY, &outZ, &outS);
sp28 = sp28 * (1.0f / sp34);
sp2C = sp2C * -(1.0f / sp34);
sp30 = sp30 * (1.0f / sp34);
sp34 = 1.0f / sp34;
outX *= 1.0f / outS;
outY *= -(1.0f / outS);
outZ *= 1.0f / outS;
outS = 1.0f / outS;
temp_f24 = temp_f20;
temp_f26 = temp_f22;
if (sp34 < 0.0f) {
sp28 = 0.0f;
sp2C = 1.0f;
if (outS < 0.0f) {
outX = 0.0f;
outY = 1.0f;
}
if (sp28 < temp_f20) {
temp_f24 = sp28;
if (temp_f24 > outX) {
temp_f24 = outX;
}
if (sp2C < temp_f22) {
temp_f26 = sp2C;
if (temp_f26 > outY) {
temp_f26 = outY;
}
if (temp_f20 < sp28) {
temp_f20 = sp28;
if (temp_f20 < outX) {
temp_f20 = outX;
}
if (temp_f22 < sp2C) {
temp_f22 = sp2C;
if (temp_f22 < outY) {
temp_f22 = outY;
}
transform_point(camera->perspectiveMatrix,
model->center.x + sp3C, model->center.y, model->center.z + sp38, 1.0f,
&sp28, &sp2C, &sp30, &sp34);
model->center.x + bbHalfX, model->center.y, model->center.z + bbHalfZ, 1.0f,
&outX, &outY, &outZ, &outS);
sp28 = sp28 * (1.0f / sp34);
sp2C = sp2C * -(1.0f / sp34);
sp30 = sp30 * (1.0f / sp34);
sp34 = (1.0f / sp34);
outX *= 1.0f / outS;
outY *= -(1.0f / outS);
outZ *= 1.0f / outS;
outS = 1.0f / outS;
if (sp34 < 0.0f) {
sp28 = 1.0f;
sp2C = 1.0f;
if (outS < 0.0f) {
outX = 1.0f;
outY = 1.0f;
}
if (sp28 < temp_f24) {
temp_f24 = sp28;
if (temp_f24 > outX) {
temp_f24 = outX;
}
if (sp2C < temp_f26) {
temp_f26 = sp2C;
if (temp_f26 > outY) {
temp_f26 = outY;
}
if (temp_f20 < sp28) {
temp_f20 = sp28;
if (temp_f20 < outX) {
temp_f20 = outX;
}
if (temp_f22 < sp2C) {
temp_f22 = sp2C;
if (temp_f22 < outY) {
temp_f22 = outY;
}
transform_point(camera->perspectiveMatrix,
model->center.x + sp3C, model->center.y, model->center.z - sp38, 1.0f,
&sp28, &sp2C, &sp30, &sp34);
model->center.x + bbHalfX, model->center.y, model->center.z - bbHalfZ, 1.0f,
&outX, &outY, &outZ, &outS);
sp28 = sp28 * (1.0f / sp34);
sp2C = sp2C * -(1.0f / sp34);
sp30 = sp30 * (1.0f / sp34);
sp34 = (1.0f / sp34);
outX *= 1.0f / outS;
outY *= -(1.0f / outS);
outZ *= 1.0f / outS;
outS = 1.0f / outS;
if (sp34 < 0.0f) {
sp28 = 1.0f;
sp2C = 1.0f;
if (outS < 0.0f) {
outX = 1.0f;
outY = 1.0f;
}
if (sp28 < temp_f24) {
temp_f24 = sp28;
if (temp_f24 > outX) {
temp_f24 = outX;
}
if (sp2C < temp_f26) {
temp_f26 = sp2C;
if (temp_f26 > outY) {
temp_f26 = outY;
}
if (temp_f20 < sp28) {
temp_f20 = sp28;
if (temp_f20 < outX) {
temp_f20 = outX;
}
if (temp_f22 < sp2C) {
temp_f22 = sp2C;
if (temp_f22 < outY) {
temp_f22 = outY;
}
if ((temp_f24 != temp_f20) || (temp_f26 != temp_f22)) {
if (temp_f24 != temp_f20 || temp_f26 != temp_f22) {
temp_f24 = ((temp_f24 * camera->viewportW) + camera->viewportW) * 0.5f;
temp_f26 = ((temp_f26 * camera->viewportH) + camera->viewportH) * 0.5f;
temp_f20 = ((temp_f20 * camera->viewportW) + camera->viewportW) * 0.5f;
@ -181,7 +161,7 @@ void N(func_80240A98_CB9C98)(void) {
gDPSetCombineLERP(gMasterGfxPos++, 0, 0, 0, TEXEL0, 0, 0, 0, PRIMITIVE, 0, 0, 0, TEXEL0, 0, 0, 0, PRIMITIVE);
gDPPipeSync(gMasterGfxPos++);
N(func_802404B0_CB96B0)(temp_f24, temp_f26, temp_f20, temp_f22);
N(UnkModelFunc000)(temp_f24, temp_f26, temp_f20, temp_f22);
gDPPipeSync(gMasterGfxPos++);
gDPSetCycleType(gMasterGfxPos++, G_CYC_2CYCLE);

View File

@ -657,9 +657,9 @@ EvtScript N(makeEntities) = {
#include "world/common/atomic/Pipe.inc.c"
void fx_sun();
void fx_sun_undeclared(s32, s32, s32, s32, s32, s32);
ApiStatus N(func_802402E0_CBDFB0)(Evt* script, s32 isInitialCall) {
fx_sun(0, 0, 0, 0, 0, 0);
fx_sun_undeclared(0, 0, 0, 0, 0, 0);
return ApiStatus_DONE2;
}

View File

@ -1,8 +1,8 @@
#include "flo_12.h"
void fx_sun();
void fx_sun_undeclared(s32, s32, s32, s32, s32, s32);
ApiStatus N(func_80240000_CC0E30)(Evt* script, s32 isInitialCall) {
fx_sun(0, 0, 0, 0, 0, 0);
fx_sun_undeclared(0, 0, 0, 0, 0, 0);
return ApiStatus_DONE2;
}

View File

@ -1,8 +1,8 @@
#include "flo_13.h"
void fx_sun();
void fx_sun_undeclared(s32, s32, s32, s32, s32, s32);
ApiStatus N(func_80240000_CC3810)(Evt* script, s32 isInitialCall) {
fx_sun(0, 0, 0, 0, 0, 0);
fx_sun_undeclared(0, 0, 0, 0, 0, 0);
return ApiStatus_DONE2;
}

View File

@ -242,9 +242,7 @@ EvtScript N(80242EAC) = {
EVT_END
};
s32 N(D_802431CC_CCE4DC) = {
0x00000000,
};
s32 N(D_802431CC_CCE4DC) = FALSE;
EvtScript N(802431D0) = {
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
@ -572,10 +570,10 @@ EvtScript N(80243E78) = {
#include "world/common/atomic/TexturePan.inc.c"
void fx_sun();
void fx_sun_undeclared(s32, s32, s32, s32, s32, s32);
ApiStatus N(func_8024030C_CCB61C)(Evt* script, s32 isInitialCall) {
fx_sun(0, 0, 0, 0, 0, 0);
fx_sun_undeclared(0, 0, 0, 0, 0, 0);
return ApiStatus_DONE2;
}
@ -682,9 +680,9 @@ void N(func_802407D4_CCBAE4)(void) {
}
} else {
if (((u32)N(D_80243B18_CCEE28) - 141) < 119) {
N(D_802431CC_CCE4DC) = 1;
N(D_802431CC_CCE4DC) = TRUE;
} else {
N(D_802431CC_CCE4DC) = 0;
N(D_802431CC_CCE4DC) = FALSE;
}
N(D_80243B18_CCEE28) += 5;
}

View File

@ -1,8 +1,8 @@
#include "flo_23.h"
void fx_sun();
void fx_sun_undeclared(s32, s32, s32, s32, s32, s32);
ApiStatus N(func_80240000_CEE260)(Evt* script, s32 isInitialCall) {
fx_sun(0, 0, 0, 0, 0, 0);
fx_sun_undeclared(0, 0, 0, 0, 0, 0);
return ApiStatus_DONE2;
}

View File

@ -1,8 +1,8 @@
#include "flo_25.h"
void fx_sun();
void fx_sun_undeclared(s32, s32, s32, s32, s32, s32);
ApiStatus N(func_80240000_CF2BD0)(Evt* script, s32 isInitialCall) {
fx_sun(0, 0, 0, 0, 0, 0);
fx_sun_undeclared(0, 0, 0, 0, 0, 0);
return ApiStatus_DONE2;
}

View File

@ -5,11 +5,11 @@ static char* N(exit_str_1) = "jan_02";
#include "world/common/atomic/TexturePan.inc.c"
//void fx_sun();
void fx_sun_undeclared(s32, s32, s32, s32, s32, s32);
// will not match with correct function definition
ApiStatus func_8024030C_B2833C(Evt* script, s32 isInitialCall) {
fx_sun(0, 0, 0, 0, 0, 0);
fx_sun_undeclared(0, 0, 0, 0, 0, 0);
return ApiStatus_DONE2;
}

View File

@ -48,18 +48,18 @@ API_CALLABLE(N(AllowCameraInterpY)) {
API_CALLABLE(N(AnimateChestSize)) {
Entity* entity = get_entity_by_index(script->varTable[0xA]);
if (isInitialCall != 0) {
if (isInitialCall) {
script->functionTemp[0] = 0;
script->functionTemp[1] = 60;
}
entity->scale.x = script->functionTemp[1] / 60.0f;
entity->scale.y = script->functionTemp[1] / 60.0f;
entity->scale.z = script->functionTemp[1] / 60.0f;
entity->rotation.y = (1.0f - cos_rad(entity->scale.y * PI)) * 990.0 / 2.0;
script->functionTemp[1]--;
if (~script->functionTemp[1] == 0) { //TODO remove ~ optimization
return ApiStatus_DONE2;

View File

@ -13,19 +13,19 @@ extern s32 D_80241220_AB1210;
// Needs data migrated
#ifdef NON_MATCHING
ApiStatus func_802406A4_AB0694(Evt* script, s32 isInitialCall) {
ApiStatus func_802406A4_AB0694(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
if (isInitialCall != 0) {
if (isInitialCall) {
D_8024121C_AB120C = 0;
}
if (D_8024121C_AB120C != 0) {
D_8024121C_AB120C = 0;
evt_set_variable(script, *args++, D_80241220_AB1210);
return ApiStatus_DONE2;
}
return ApiStatus_BLOCK;
}
#else

215
tools/find_similar_areas.py Executable file
View File

@ -0,0 +1,215 @@
#!/usr/bin/python3
import argparse
from collections import OrderedDict
from dataclasses import dataclass
from pathlib import Path
from typing import Optional
from Levenshtein import ratio
import os
import sys
script_dir = Path(os.path.dirname(os.path.realpath(__file__)))
root_dir = script_dir / ".."
asm_dir = root_dir / "ver/current/asm/nonmatchings/"
map_file_path = root_dir / "ver/current/build/papermario.map"
rom_path = root_dir / "ver/current/baserom.z64"
@dataclass
class Symbol:
name: str
rom_start: int
ram: int
current_file: str
prev_sym: str
is_decompiled: bool
rom_end: Optional[int] = None
def size(self):
assert(self.rom_end is not None)
return self.rom_end - self.rom_start
@dataclass
class Bytes:
offset: int
normalized: str
bytes: list[int]
def read_rom() -> bytes:
with open(rom_path, "rb") as f:
return f.read()
def get_all_unmatched_functions():
ret = set()
for root, dirs, files in os.walk(asm_dir):
for f in files:
if f.endswith(".s"):
ret.add(f[:-2])
return ret
def get_symbol_bytes(func: str) -> Optional[Bytes]:
if func not in syms or syms[func].rom_end is None:
return None
sym = syms[func]
bs = list(rom_bytes[sym.rom_start:sym.rom_end])
while len(bs) > 0 and bs[-1] == 0:
bs.pop()
insns = bs[0::4]
ret = []
for ins in insns:
ret.append(ins >> 2)
return Bytes(0, bytes(ret).decode('utf-8'), bs)
def parse_map() -> OrderedDict[str, Symbol]:
ram_offset = None
cur_file = "<no file>"
syms: OrderedDict[str, Symbol] = OrderedDict()
prev_sym = ""
prev_line = ""
with open(map_file_path) as f:
for line in f:
if "load address" in line:
if "noload" in line or "noload" in prev_line:
ram_offset = None
continue
ram = int(line[16 : 16 + 18], 0)
rom = int(line[59 : 59 + 18], 0)
ram_offset = ram - rom
continue
prev_line = line
if (
ram_offset is None
or "=" in line
or "*fill*" in line
or " 0x" not in line
):
continue
ram = int(line[16 : 16 + 18], 0)
rom = ram - ram_offset
fn = line.split()[-1]
if "0x" in fn:
ram_offset = None
elif "/" in fn:
cur_file = fn
else:
syms[fn] = Symbol(
name=fn,
rom_start=rom,
ram=ram,
current_file=cur_file,
prev_sym=prev_sym,
is_decompiled=not fn in unmatched_functions,
)
prev_sym = fn
# Calc end offsets
for sym in syms:
prev_sym = syms[sym].prev_sym
if prev_sym:
syms[prev_sym].rom_end = syms[sym].rom_start
return syms
@dataclass
class Match:
query_offset: int
target_offset: int
length: int
def __str__(self):
return f"{self.query_offset} {self.target_offset} {self.length}"
def get_pair_matches(query_hashes: list[int], sym_hashes: list[int]) -> list[Match]:
ret = []
matching_hashes = set(query_hashes).intersection(sym_hashes)
for hash in matching_hashes:
ret.append(Match(query_hashes.index(hash), sym_hashes.index(hash), 1))
return ret
def get_hashes(bytes: Bytes, window_size: int) -> list[int]:
ret = []
for i in range(0, len(bytes.normalized) - window_size):
ret.append(bytes.normalized[i : i + window_size])
return ret
def get_matches(query: str, window_size: int):
query_bytes: Optional[Bytes] = get_symbol_bytes(query)
if query_bytes is None:
sys.exit("Symbol '" + query + "' not found")
query_hashes = get_hashes(query_bytes, window_size)
ret: dict[str, float] = {}
for symbol in syms:
if query == symbol:
continue
sym_bytes: Optional[Bytes] = get_symbol_bytes(symbol)
if not sym_bytes:
continue
if len(sym_bytes.bytes) < window_size:
continue
sym_hashes = get_hashes(sym_bytes, window_size)
matches: list[Match] = get_pair_matches(query_hashes, sym_hashes)
for match in matches:
print(f"{query} {symbol} {match}")
return OrderedDict(sorted(ret.items(), key=lambda kv: kv[1], reverse=True))
def do_query(query, window_size):
matches = get_matches(query, window_size)
num_matches = len(matches)
if num_matches == 0:
print(query + " - found no matches")
return
i = 0
more_str = ":"
if args.num_out < num_matches:
more_str = " (showing only " + str(args.num_out) + "):"
print(query + " - found " + str(num_matches) + " matches total" + more_str)
for match in matches:
if i == args.num_out:
break
match_str = "{:.3f} - {}".format(matches[match], match)
if syms[match].is_decompiled:
match_str += " (decompiled)"
print(match_str)
i += 1
print()
parser = argparse.ArgumentParser(description="Tool to find duplicate portions of code from one function in code across the codebase")
parser.add_argument("query", help="function")
parser.add_argument("-t", "--threshold", help="score threshold between 0 and 1 (higher is more restrictive)", type=float, default=0.9, required=False)
parser.add_argument("-n", "--num-out", help="number of results to display", type=int, default=100, required=False)
parser.add_argument("-w", "--window-size", help="number of bytes to compare", type=int, default=20, required=False)
args = parser.parse_args()
if __name__ == "__main__":
rom_bytes = read_rom()
unmatched_functions = get_all_unmatched_functions()
syms = parse_map()
do_query(args.query, args.window_size)

View File

@ -33,7 +33,6 @@ dead_get_npc_safe = 0x8003E534; // get_npc_safe
dead_heap_malloc = 0x8002BFD4;
dead_general_heap_malloc = 0x8002BF18;
dead_heap_free = 0x8002C01C;
dead_func_80041080 = 0x80041080;
dead_evt_set_variable = 0x802D5468;
dead_sin_deg = 0x8002B5DC;
dead_cos_deg = 0x8002B640;

View File

@ -14,6 +14,7 @@ src_dir = root_dir + "src/"
CPP_FLAGS = [
"-Iinclude",
"-Isrc",
"-Iassets/us",
"-Iver/current/build/include",
"-D_LANGUAGE_C",
"-DF3DEX_GBI_2",

View File

@ -6,7 +6,7 @@
[subrepo]
remote = https://github.com/ethteck/splat.git
branch = master
commit = d93b6550c4800a2eb9ef672bf8d17067091e42df
parent = aa495d906bc91dce95c15010852ac62d7ebc12dd
commit = 4e5fca24a53f6ec443ed87a6cb365f7985cd6f3a
parent = 59421ff6eeb64cd96ca3ba0699a6d683febcc047
method = merge
cmdver = 0.4.3
cmdver = 0.4.5

View File

@ -1,5 +1,21 @@
# splat Release Notes
### 0.12.2
* Fixed bug where `given_dir` was possibly not a `Path`
### 0.12.1
* The constructor for `Segment` takes far fewer arguments now, which will affect (and hopefully simplify) any custom segments that are implemented.
* The new option `string_encoding` can be set at the global or segment level and will influence the encoding for strings in rodata during disassembly. The default encoding used is EUC-JP, as it was previously.
## 0.12.0: Performance Boost
In this release, we bring many performance improvements, making splat dramatically faster. We have observed speedups of 10-20x, though your results may vary.
* Linker script `_romPos` alignment statements now take a form that is friendlier to different assemblers.
* Fixed the default value of `use_legacy_include_asm` to be what it was before 0.11.2
### 0.11.2
* The way options are parsed and accessed has been completely refactored. The following option names have changed:

View File

@ -3,7 +3,7 @@ pylibyaml
tqdm
intervaltree
colorama
spimdisasm>=1.5.5
spimdisasm>=1.5.6
rabbitizer>=1.2.0
pygfxd
n64img>=0.1.2

View File

@ -1,9 +1,7 @@
import spimdisasm
from typing import List
from segtypes.common.data import CommonSegData
from segtypes.linker_entry import LinkerEntry
from util import options, symbols
from util import symbols
class CommonSegBss(CommonSegData):
@ -35,13 +33,6 @@ class CommonSegBss(CommonSegData):
self.get_exclusive_ram_id(),
)
for symbol_list in self.seg_symbols.values():
symbols.add_symbol_to_spim_section(self.spim_section, symbol_list[0])
for sym in symbols.all_symbols:
if sym.user_declared:
symbols.add_symbol_to_spim_section(self.spim_section, sym)
self.spim_section.analyze()
self.spim_section.setCommentOffset(self.rom_start)

View File

@ -8,6 +8,7 @@ from pathlib import Path
import spimdisasm
from util import log, options
from util import symbols
from util.compiler import GCC, SN64
from util.symbols import Symbol
@ -112,9 +113,8 @@ class CommonSegC(CommonSegCodeSubsegment):
# TODO run cpp?
self.defined_funcs = self.get_funcs_defined_in_c(path)
self.global_asm_funcs = self.get_global_asm_funcs(path)
self.mark_c_funcs_as_defined(
{*self.defined_funcs, *self.global_asm_funcs}
)
symbols.to_mark_as_defined.update(self.defined_funcs)
symbols.to_mark_as_defined.update(self.global_asm_funcs)
self.scan_code(rom_bytes)
@ -156,18 +156,6 @@ class CommonSegC(CommonSegCodeSubsegment):
return ret
def mark_c_funcs_as_defined(self, c_funcs):
for func_name in c_funcs:
found = False
for symbols in self.seg_symbols.values():
for symbol in symbols:
if symbol.name == func_name:
symbol.defined = True
found = True
break
if found:
break
def create_c_asm_file(
self,
func: spimdisasm.mips.symbols.SymbolFunction,

View File

@ -23,12 +23,6 @@ class CommonSegCode(CommonSegGroup):
type,
name,
vram_start,
extract,
given_subalign,
exclusive_ram_id,
given_dir,
symbol_name_format,
symbol_name_format_no_rom,
args,
yaml,
):
@ -40,12 +34,6 @@ class CommonSegCode(CommonSegGroup):
type,
name,
vram_start,
extract,
given_subalign,
exclusive_ram_id=exclusive_ram_id,
given_dir=given_dir,
symbol_name_format=symbol_name_format,
symbol_name_format_no_rom=symbol_name_format_no_rom,
args=args,
yaml=yaml,
)
@ -102,15 +90,15 @@ class CommonSegCode(CommonSegGroup):
type=rep_type,
name=base[0],
vram_start=vram_start,
extract=False,
given_subalign=self.given_subalign,
exclusive_ram_id=self.get_exclusive_ram_id(),
given_dir=self.given_dir,
symbol_name_format=self.symbol_name_format,
symbol_name_format_no_rom=self.symbol_name_format_no_rom,
args=[],
yaml={},
)
rep.extract = False
rep.given_subalign = self.given_subalign
rep.exclusive_ram_id = self.get_exclusive_ram_id()
rep.given_dir = self.given_dir
rep.given_symbol_name_format = self.symbol_name_format
rep.given_symbol_name_format_no_rom = self.symbol_name_format_no_rom
rep.sibling = base[1]
rep.parent = self
alls.append(rep)
@ -223,21 +211,23 @@ class CommonSegCode(CommonSegGroup):
# Add dummy segments to be expanded later
if typ.startswith("all_"):
ret.append(
Segment(
start,
"auto",
typ,
"",
"auto",
False,
self.given_subalign,
self.exclusive_ram_id,
self.given_dir,
self.symbol_name_format,
self.symbol_name_format_no_rom,
)
dummy_seg = Segment(
rom_start=start,
rom_end="auto",
type=typ,
name="",
vram_start="auto",
args=[],
yaml={},
)
dummy_seg.given_subalign = self.given_subalign
dummy_seg.exclusive_ram_id = self.exclusive_ram_id
dummy_seg.given_dir = self.given_dir
dummy_seg.given_symbol_name_format = self.symbol_name_format
dummy_seg.given_symbol_name_format_no_rom = (
self.symbol_name_format_no_rom
)
ret.append(dummy_seg)
continue
segment_class = Segment.get_class_for_type(typ)
@ -297,24 +287,21 @@ class CommonSegCode(CommonSegGroup):
rom_start = "auto"
vram_start = "auto"
ret.insert(
idx,
(
Segment(
rom_start,
"auto",
"all_" + section,
"",
vram_start,
False,
self.given_subalign,
self.exclusive_ram_id,
self.given_dir,
self.symbol_name_format,
self.symbol_name_format_no_rom,
)
),
new_seg = Segment(
rom_start=rom_start,
rom_end="auto",
type="all_" + section,
name="",
vram_start=vram_start,
args=[],
yaml={},
)
new_seg.given_subalign = self.given_subalign
new_seg.exclusive_ram_id = self.exclusive_ram_id
new_seg.given_dir = self.given_dir
new_seg.given_symbol_name_format = self.symbol_name_format
new_seg.given_symbol_name_format_no_rom = self.symbol_name_format_no_rom
ret.insert(idx, new_seg)
check = True
while check:

View File

@ -21,6 +21,12 @@ class CommonSegCodeSubsegment(Segment):
else False
)
self.str_encoding: Optional[str] = (
self.yaml.get("str_encoding", False)
if isinstance(self.yaml, dict)
else None
)
self.spim_section: Optional[spimdisasm.mips.sections.SectionBase] = None
@property
@ -48,13 +54,6 @@ class CommonSegCodeSubsegment(Segment):
self.get_exclusive_ram_id(),
)
for symbol_list in self.seg_symbols.values():
symbols.add_symbol_to_spim_section(self.spim_section, symbol_list[0])
for sym in symbols.all_symbols:
if sym.user_declared:
symbols.add_symbol_to_spim_section(self.spim_section, sym)
self.spim_section.isHandwritten = is_asm
self.spim_section.analyze()

View File

@ -83,13 +83,6 @@ class CommonSegData(CommonSegCodeSubsegment, CommonSegGroup):
self.get_exclusive_ram_id(),
)
for symbol_list in self.seg_symbols.values():
symbols.add_symbol_to_spim_section(self.spim_section, symbol_list[0])
for sym in symbols.all_symbols:
if sym.user_declared:
symbols.add_symbol_to_spim_section(self.spim_section, sym)
self.spim_section.analyze()
self.spim_section.setCommentOffset(self.rom_start)
@ -108,7 +101,7 @@ class CommonSegData(CommonSegCodeSubsegment, CommonSegGroup):
f"Data segment {self.name}, symbol at vram {symbol.contextSym.vram:X} is a jumptable, indicating the start of the rodata section _may_ be near here."
)
print(
f"Please note the real start of the rodata section may be way before this point."
"Please note the real start of the rodata section may be way before this point."
)
if symbol.contextSym.vromAddress is not None:
print(f" - [0x{symbol.contextSym.vromAddress:X}, rodata]")

View File

@ -12,12 +12,6 @@ class CommonSegGroup(CommonSegment):
type,
name,
vram_start,
extract,
given_subalign,
exclusive_ram_id,
given_dir,
symbol_name_format,
symbol_name_format_no_rom,
args,
yaml,
):
@ -27,12 +21,6 @@ class CommonSegGroup(CommonSegment):
type,
name,
vram_start,
extract,
given_subalign,
exclusive_ram_id=exclusive_ram_id,
given_dir=given_dir,
symbol_name_format=symbol_name_format,
symbol_name_format_no_rom=symbol_name_format_no_rom,
args=args,
yaml=yaml,
)

View File

@ -1,3 +1,4 @@
from pathlib import Path
from segtypes.n64.segment import N64Segment
from segtypes.linker_entry import LinkerEntry
@ -12,12 +13,6 @@ class CommonSegLib(N64Segment):
type,
name,
vram_start,
extract,
given_subalign,
exclusive_ram_id,
given_dir,
symbol_name_format,
symbol_name_format_no_rom,
args,
yaml,
):
@ -27,12 +22,6 @@ class CommonSegLib(N64Segment):
type,
name,
vram_start,
extract,
given_subalign,
exclusive_ram_id=exclusive_ram_id,
given_dir=given_dir,
symbol_name_format=symbol_name_format,
symbol_name_format_no_rom=symbol_name_format_no_rom,
args=args,
yaml=yaml,
)
@ -57,6 +46,6 @@ class CommonSegLib(N64Segment):
def get_linker_entries(self):
path = options.opts.lib_path / self.name
object_path = f"{path}.a:{self.object}.o"
object_path = Path(f"{path}.a:{self.object}.o")
return [LinkerEntry(self, [path], object_path, self.get_linker_section())]

View File

@ -26,12 +26,14 @@ class CommonSegRodata(CommonSegData):
self.get_exclusive_ram_id(),
)
for symbol_list in self.seg_symbols.values():
symbols.add_symbol_to_spim_section(self.spim_section, symbol_list[0])
# Set rodata string encoding
# First check the global configuration
if options.opts.string_encoding is not None:
self.spim_section.stringEncoding = options.opts.string_encoding
for sym in symbols.all_symbols:
if sym.user_declared:
symbols.add_symbol_to_spim_section(self.spim_section, sym)
# Then check the per-segment configuration in case we want to override the global one
if self.str_encoding is not None:
self.spim_section.stringEncoding = self.str_encoding
self.spim_section.analyze()
self.spim_section.setCommentOffset(self.rom_start)

View File

@ -117,7 +117,7 @@ class LinkerWriter:
self._writeln("SECTIONS")
self._begin_block()
self._writeln(f"__romPos = 0;")
self._writeln("__romPos = 0;")
if options.opts.gp is not None:
self._writeln("_gp = " + f"0x{options.opts.gp:X};")
@ -171,7 +171,7 @@ class LinkerWriter:
self._begin_segment(entry.segment)
continue
elif cur_section == "linker_offset":
self._write_symbol(f"{get_segment_cname(entry.segment)}_OFFSET", f".")
self._write_symbol(f"{get_segment_cname(entry.segment)}_OFFSET", ".")
continue
for i, section in enumerate(section_labels.values()):
@ -320,6 +320,8 @@ class LinkerWriter:
def _begin_segment(self, segment: Segment):
if segment.follows_vram_segment:
vram_str = get_segment_cname(segment.follows_vram_segment) + "_VRAM_END "
elif segment.follows_vram_symbol:
vram_str = segment.follows_vram_symbol + " "
else:
vram_str = (
f"0x{segment.vram_start:X} "
@ -339,6 +341,8 @@ class LinkerWriter:
def _begin_bss_segment(self, segment: Segment, is_first: bool = False):
if segment.follows_vram_segment:
vram_str = get_segment_cname(segment.follows_vram_segment) + "_VRAM_END "
elif segment.follows_vram_symbol:
vram_str = segment.follows_vram_symbol + " "
else:
vram_str = (
f"0x{segment.vram_start:X} "
@ -370,9 +374,7 @@ class LinkerWriter:
# Align directive
if segment.align:
self._writeln(
f"__romPos = (__romPos + {segment.align - 1}) & ~{segment.align - 1}; /* align {segment.align} */"
)
self._writeln(f"__romPos = ALIGN(__romPos, {segment.align});")
self._write_symbol(f"{name}_ROM_END", "__romPos")

View File

@ -20,12 +20,6 @@ class N64SegGfx(CommonSegCodeSubsegment):
type,
name,
vram_start,
extract,
given_subalign,
exclusive_ram_id,
given_dir,
symbol_name_format,
symbol_name_format_no_rom,
args,
yaml,
):
@ -35,12 +29,6 @@ class N64SegGfx(CommonSegCodeSubsegment):
type,
name,
vram_start,
extract,
given_subalign,
exclusive_ram_id=exclusive_ram_id,
given_dir=given_dir,
symbol_name_format=symbol_name_format,
symbol_name_format_no_rom=symbol_name_format_no_rom,
args=args,
yaml=yaml,
)

View File

@ -7,7 +7,7 @@ class N64SegHeader(CommonSegHeader):
encoding = options.opts.header_encoding
header_lines = []
header_lines.append(f".section .data\n")
header_lines.append(".section .data\n")
header_lines.append(
self.get_line("word", rom_bytes[0x00:0x04], "PI BSB Domain 1 register")
)
@ -25,7 +25,7 @@ class N64SegHeader(CommonSegHeader):
if encoding != "word":
header_lines.append(
f'.ascii "'
'.ascii "'
+ rom_bytes[0x20:0x34].decode(encoding).strip().ljust(20)
+ '" /* Internal name */'
)

View File

@ -1,5 +1,4 @@
from segtypes.n64.img import N64SegImg
from segtypes.n64.img import N64SegImg
import n64img.image

View File

@ -14,12 +14,6 @@ class N64SegImg(N64Segment):
type,
name,
vram_start,
extract,
given_subalign,
exclusive_ram_id,
given_dir,
symbol_name_format,
symbol_name_format_no_rom,
args,
yaml,
img_cls: Type[Image],
@ -30,12 +24,6 @@ class N64SegImg(N64Segment):
type,
name,
vram_start,
extract,
given_subalign,
exclusive_ram_id=exclusive_ram_id,
given_dir=given_dir,
symbol_name_format=symbol_name_format,
symbol_name_format_no_rom=symbol_name_format_no_rom,
args=args,
yaml=yaml,
)

View File

@ -1,15 +1,20 @@
from itertools import zip_longest
from pathlib import Path
from typing import TYPE_CHECKING, Optional
from segtypes.n64.segment import N64Segment
from util import log, options
from util.color import unpack_color
from util.iter import iter_in_groups
if TYPE_CHECKING:
from segtypes.n64.ci import N64SegCi as Raster
def iter_in_groups(iterable, n, fillvalue=None):
args = [iter(iterable)] * n
return zip_longest(*args, fillvalue=fillvalue)
class N64SegPalette(N64Segment):
require_unique_name = False

View File

@ -5,7 +5,6 @@ Dumps out Vtx as a .inc.c file.
Originally written by Mark Street (https://github.com/mkst)
"""
import re
import struct
from pathlib import Path
from util.log import error
@ -22,12 +21,6 @@ class N64SegVtx(CommonSegCodeSubsegment):
type,
name,
vram_start,
extract,
given_subalign,
exclusive_ram_id,
given_dir,
symbol_name_format,
symbol_name_format_no_rom,
args,
yaml,
):
@ -37,12 +30,6 @@ class N64SegVtx(CommonSegCodeSubsegment):
type,
name,
vram_start,
extract,
given_subalign,
exclusive_ram_id=exclusive_ram_id,
given_dir=given_dir,
symbol_name_format=symbol_name_format,
symbol_name_format_no_rom=symbol_name_format_no_rom,
args=args,
yaml=yaml,
)

View File

@ -1,6 +1,4 @@
from segtypes.common.asm import CommonSegAsm
from typing import Optional
from pathlib import Path
from util import options

View File

@ -6,7 +6,7 @@ class PsxSegHeader(CommonSegHeader):
# breakdown from https://psx-spx.consoledev.net/cdromdrive/#filenameexe-general-purpose-executable
def parse_header(self, rom_bytes):
header_lines = []
header_lines.append(f".section .data\n")
header_lines.append(".section .data\n")
header_lines.append(
self.get_line("ascii", rom_bytes[0x00:0x08], "Magic number")
)

View File

@ -49,6 +49,12 @@ def parse_segment_follows_vram(segment: Union[dict, list]) -> Optional[str]:
return None
def parse_segment_follows_vram_symbol(segment: Union[dict, list]) -> Optional[str]:
if isinstance(segment, dict):
return segment.get("follows_vram_symbol", None)
return None
class Segment:
require_unique_name = True
@ -96,7 +102,9 @@ class Segment:
ext_spec = importlib.util.spec_from_file_location(
f"{platform}.segtypes.{seg_type}", ext_path / f"{seg_type}.py"
)
assert ext_spec is not None
ext_mod = importlib.util.module_from_spec(ext_spec)
assert ext_spec.loader is not None
ext_spec.loader.exec_module(ext_mod)
except Exception as err:
log.write(err, status="error")
@ -159,34 +167,31 @@ class Segment:
type: str,
name: str,
vram_start: Any,
extract: bool,
given_subalign: Optional[int],
exclusive_ram_id: Optional[str],
given_dir: Path,
symbol_name_format: str,
symbol_name_format_no_rom: str,
args=[],
yaml={},
args: list,
yaml,
):
self.rom_start = rom_start
self.rom_end = rom_end
self.type = type
self.name = name
self.vram_start = vram_start
self.extract = extract
self.align: Optional[int] = None
self.given_subalign = given_subalign or options.opts.subalign
self.exclusive_ram_id: Optional[str] = exclusive_ram_id
self.given_dir: Path = given_dir
self.given_seg_symbols: Dict[
int, List[Symbol]
] = {} # Symbols known to be in this segment
self.given_subalign: int = options.opts.subalign
self.exclusive_ram_id: Optional[str] = None
self.given_dir: Path = Path()
# Symbols known to be in this segment
self.given_seg_symbols: Dict[int, List[Symbol]] = {}
self.given_section_order: List[str] = options.opts.section_order
self.follows_vram: Optional[str] = None
self.follows_vram_symbol: Optional[str] = None
self.given_symbol_name_format = symbol_name_format
self.given_symbol_name_format_no_rom = symbol_name_format_no_rom
self.given_symbol_name_format: str = options.opts.symbol_name_format
self.given_symbol_name_format_no_rom: str = (
options.opts.symbol_name_format_no_rom
)
self.parent: Optional[Segment] = None
self.sibling: Optional[Segment] = None
@ -195,10 +200,10 @@ class Segment:
self.args: List[str] = args
self.yaml = yaml
self.extract: bool = True
if self.rom_start == "auto":
self.extract = False
if self.type.startswith("."):
elif self.type.startswith("."):
self.extract = False
self.warnings: List[str] = []
@ -221,16 +226,7 @@ class Segment:
type = Segment.parse_segment_type(yaml)
name = Segment.parse_segment_name(cls, rom_start, yaml)
vram_start = vram if vram is not None else parse_segment_vram(yaml)
extract = bool(yaml.get("extract", True)) if isinstance(yaml, dict) else True
given_subalign = parse_segment_subalign(yaml)
exclusive_ram_id: Optional[str] = (
yaml.get("exclusive_ram_id") if isinstance(yaml, dict) else None
)
given_dir = Path(yaml.get("dir", "")) if isinstance(yaml, dict) else Path()
given_symbol_name_format = Segment.parse_segment_symbol_name_format(yaml)
given_symbol_name_format_no_rom = (
Segment.parse_segment_symbol_name_format_no_rom(yaml)
)
args: List[str] = [] if isinstance(yaml, dict) else yaml[3:]
ret = cls(
@ -239,20 +235,26 @@ class Segment:
type=type,
name=name,
vram_start=vram_start,
extract=extract,
given_subalign=given_subalign,
exclusive_ram_id=exclusive_ram_id,
given_dir=given_dir,
symbol_name_format=given_symbol_name_format,
symbol_name_format_no_rom=given_symbol_name_format_no_rom,
args=args,
yaml=yaml,
)
ret.given_section_order = parse_segment_section_order(yaml)
ret.given_subalign = parse_segment_subalign(yaml)
if isinstance(yaml, dict):
ret.extract = bool(yaml.get("extract", ret.extract))
ret.exclusive_ram_id = yaml.get("exclusive_ram_id")
ret.given_dir = Path(yaml.get("dir", ""))
ret.given_symbol_name_format = Segment.parse_segment_symbol_name_format(yaml)
ret.given_symbol_name_format_no_rom = (
Segment.parse_segment_symbol_name_format_no_rom(yaml)
)
if not ret.follows_vram:
ret.follows_vram = parse_segment_follows_vram(yaml)
if not ret.follows_vram_symbol:
ret.follows_vram_symbol = parse_segment_follows_vram_symbol(yaml)
if not ret.align:
ret.align = parse_segment_align(yaml)
return ret

View File

@ -1,26 +1,22 @@
#! /usr/bin/env python3
import hashlib
from typing import Dict, List, Optional, Union, Set, Any
import argparse
import spimdisasm
import hashlib
import pickle
from typing import Any, Dict, List, Optional, Set, Union
import rabbitizer
import spimdisasm
import tqdm
import yaml
import pickle
from colorama import Style, Fore
from segtypes.segment import Segment
from segtypes.linker_entry import LinkerWriter, to_cname
from util import log
from util import options
from util import symbols
from util import palettes
from util import compiler
from util.symbols import Symbol
from colorama import Fore, Style
from intervaltree import Interval, IntervalTree
VERSION = "0.11.2"
from segtypes.linker_entry import LinkerWriter, to_cname
from segtypes.segment import Segment
from util import compiler, log, options, palettes, symbols
VERSION = "0.12.2"
parser = argparse.ArgumentParser(
description="Split a rom given a rom, a config, and output directory"
@ -106,8 +102,6 @@ def initialize_segments(config_segments: Union[dict, list]) -> List[Segment]:
def assign_symbols_to_segments():
seg_syms: dict[int, list[Symbol]] = {}
for symbol in symbols.all_symbols:
if symbol.rom:
cands = segment_roms[symbol.rom]
@ -357,6 +351,8 @@ def main(config_path, modes, verbose, use_cache=True):
seg_split[typ] += 1
symbols.mark_c_funcs_as_defined()
# Split
for segment in tqdm.tqdm(
all_segments,
@ -469,12 +465,12 @@ def main(config_path, modes, verbose, use_cache=True):
if s.given_size is not None:
f.write(f"0x{s.given_size:X},")
else:
f.write(f"None,")
f.write("None,")
f.write(f"{s.size},")
if s.rom is not None:
f.write(f"0x{s.rom:X},")
else:
f.write(f"None,")
f.write("None,")
f.write(
f"{s.defined},{s.user_declared},{s.referenced},{s.dead},{s.extract}\n"
)

View File

@ -1,100 +0,0 @@
from collections import namedtuple
from typing import Any, Optional
Resolution = namedtuple("Resolution", "x y unit_is_meter")
class Error(Exception): ...
class FormatError(Error): ...
class ProtocolError(Error): ...
class ChunkError(FormatError): ...
class Default: ...
class Writer:
width: Any = ...
height: Any = ...
transparent: Any = ...
background: Any = ...
gamma: Any = ...
greyscale: Any = ...
alpha: Any = ...
colormap: Any = ...
bitdepth: Any = ...
compression: Any = ...
chunk_limit: Any = ...
interlace: Any = ...
palette: Any = ...
x_pixels_per_unit: Any = ...
y_pixels_per_unit: Any = ...
unit_is_meter: Any = ...
color_type: Any = ...
color_planes: Any = ...
planes: Any = ...
psize: Any = ...
def __init__(
self,
width: Optional[Any] = ...,
height: Optional[Any] = ...,
size: Optional[Any] = ...,
greyscale: Any = ...,
alpha: bool = ...,
bitdepth: int = ...,
palette: Optional[Any] = ...,
transparent: Optional[Any] = ...,
background: Optional[Any] = ...,
gamma: Optional[Any] = ...,
compression: Optional[Any] = ...,
interlace: bool = ...,
planes: Optional[Any] = ...,
colormap: Optional[Any] = ...,
maxval: Optional[Any] = ...,
chunk_limit: Any = ...,
x_pixels_per_unit: Optional[Any] = ...,
y_pixels_per_unit: Optional[Any] = ...,
unit_is_meter: bool = ...,
) -> None: ...
def write(self, outfile: Any, rows: Any): ...
def write_passes(self, outfile: Any, rows: Any): ...
def write_packed(self, outfile: Any, rows: Any): ...
def write_preamble(self, outfile: Any) -> None: ...
def write_array(self, outfile: Any, pixels: Any) -> None: ...
def array_scanlines(self, pixels: Any) -> None: ...
def array_scanlines_interlace(self, pixels: Any) -> None: ...
def write_chunks(out: Any, chunks: Any) -> None: ...
def from_array(a: Any, mode: Optional[Any] = ..., info: Any = ...): ...
fromarray = from_array
class Image:
rows: Any = ...
info: Any = ...
def __init__(self, rows: Any, info: Any) -> None: ...
def save(self, file: Any) -> None: ...
def write(self, file: Any) -> None: ...
class Reader:
signature: Any = ...
transparent: Any = ...
atchunk: Any = ...
file: Any = ...
def __init__(
self,
_guess: Optional[Any] = ...,
filename: Optional[Any] = ...,
file: Optional[Any] = ...,
bytes: Optional[Any] = ...,
) -> None: ...
def chunk(self, lenient: bool = ...): ...
def chunks(self) -> None: ...
def undo_filter(self, filter_type: Any, scanline: Any, previous: Any): ...
def validate_signature(self) -> None: ...
def preamble(self, lenient: bool = ...) -> None: ...
def process_chunk(self, lenient: bool = ...) -> None: ...
def read(self, lenient: bool = ...): ...
def read_flat(self): ...
def palette(self, alpha: str = ...): ...
def asDirect(self): ...
def asRGB8(self): ...
def asRGBA8(self): ...
def asRGB(self): ...
def asRGBA(self): ...

View File

@ -1,29 +0,0 @@
from itertools import zip_longest
from math import ceil
def iter_in_groups(iterable, n, fillvalue=None):
args = [iter(iterable)] * n
return zip_longest(*args, fillvalue=fillvalue)
def iter_image_indexes(
width, height, bytes_per_x=1, bytes_per_y=1, flip_h=False, flip_v=False
):
w = int(width * bytes_per_x)
h = int(height * bytes_per_y)
xrange = (
range(w - ceil(bytes_per_x), -1, -ceil(bytes_per_x))
if flip_h
else range(0, w, ceil(bytes_per_x))
)
yrange = (
range(h - ceil(bytes_per_y), -1, -ceil(bytes_per_y))
if flip_v
else range(0, h, ceil(bytes_per_y))
)
for y in yrange:
for x in xrange:
yield x, y, (y * w) + x

View File

@ -23,7 +23,7 @@ def setup_lib():
)
return True
except Exception:
print(f"Failed to load C library; falling back to python method")
print("Failed to load C library; falling back to python method")
tried_loading = True
return False

View File

@ -5,8 +5,6 @@ from typing import Dict, List, Mapping, Optional, Type, TypeVar
from util import compiler
from util.compiler import Compiler
opts: "SplatOpts"
@dataclass
class SplatOpts:
@ -146,6 +144,8 @@ class SplatOpts:
add_set_gp_64: bool
# Generate .asmproc.d dependency files for each C file which still reference functions in assembly files
create_asm_dependencies: bool
# Global option for rodata string encoding. This can be overriden per segment
string_encoding: Optional[str]
################################################################################
# N64-specific options
@ -168,6 +168,9 @@ class SplatOpts:
return mode in self.modes or "all" in self.modes
opts: SplatOpts
def parse_yaml(
yaml: Dict,
basename: str,
@ -198,6 +201,20 @@ def parse_yaml(
raise ValueError(f"Missing required option {opt}")
return yaml_as_type(value, t)
def parse_optional_opt(
yaml: Mapping[str, object],
opt: str,
t: Type[T],
default: Optional[T] = None,
) -> Optional[T]:
value = yaml.get(opt)
if isinstance(value, t):
# Fast path
return value
if value is None and opt not in yaml:
return default
return yaml_as_type(value, t)
def parse_opt_within(
yaml: Mapping[str, object],
opt: str,
@ -340,6 +357,7 @@ def parse_yaml(
),
add_set_gp_64=parse_opt(yaml, "add_set_gp_64", bool, True),
create_asm_dependencies=parse_opt(yaml, "create_asm_dependencies", bool, False),
string_encoding=parse_optional_opt(yaml, "string_encoding", str, None),
header_encoding=parse_opt(yaml, "header_encoding", str, "ASCII"),
gfx_ucode=parse_opt_within(
yaml,
@ -348,7 +366,7 @@ def parse_yaml(
["f3d", "f3db", "f3dex", "f3dexb", "f3dex2"],
"f3dex2",
),
use_legacy_include_asm=parse_opt(yaml, "use_legacy_include_asm", bool, False),
use_legacy_include_asm=parse_opt(yaml, "use_legacy_include_asm", bool, True),
)

View File

@ -1,4 +1,4 @@
from typing import Dict, Union
from typing import Dict
from segtypes.n64.ci import N64SegCi
from segtypes.n64.palette import N64SegPalette as Palette
from segtypes.common.group import CommonSegGroup

View File

@ -1,8 +1,8 @@
import dataclasses
from dataclasses import dataclass
from typing import Optional
@dataclasses.dataclass
@dataclass
class Range:
start: Optional[int] = None
end: Optional[int] = None

View File

@ -1,6 +1,7 @@
from typing import Dict, List, Optional, TYPE_CHECKING, Set
import spimdisasm
import tqdm
from dataclasses import dataclass
# circular import
if TYPE_CHECKING:
@ -12,6 +13,7 @@ all_symbols: List["Symbol"] = []
all_symbols_dict: Dict[int, List["Symbol"]] = {}
ignored_addresses: Set[int] = set()
symbol_ranges: List["Symbol"] = []
to_mark_as_defined: Set[str] = set()
# Initialize a spimdisasm context, used to store symbols and functions
spim_context = spimdisasm.common.Context()
@ -194,48 +196,55 @@ def initialize_spim_context(all_segments: "List[Segment]") -> None:
spim_context.bannedSymbols |= ignored_addresses
from segtypes.common.code import CommonSegCode
for segment in all_segments:
if segment.type == "code":
if not isinstance(segment, CommonSegCode):
# We only care about the VRAMs of code segments
if isinstance(segment.vram_start, int) and isinstance(
segment.vram_end, int
):
ram_id = segment.get_exclusive_ram_id()
if ram_id is None:
if global_vram_start is None:
global_vram_start = segment.vram_start
else:
if segment.vram_start < global_vram_start:
global_vram_start = segment.vram_start
continue
if global_vram_end is None:
global_vram_end = segment.vram_end
else:
if global_vram_end < segment.vram_end:
global_vram_end = segment.vram_end
if (
not isinstance(segment.vram_start, int)
or not isinstance(segment.vram_end, int)
or not isinstance(segment.rom_start, int)
or not isinstance(segment.rom_end, int)
):
continue
if isinstance(segment.rom_start, int):
if global_vrom_start is None:
global_vrom_start = segment.rom_start
else:
if segment.rom_start < global_vrom_start:
global_vrom_start = segment.rom_start
ram_id = segment.get_exclusive_ram_id()
if ram_id is None:
if global_vram_start is None:
global_vram_start = segment.vram_start
elif segment.vram_start < global_vram_start:
global_vram_start = segment.vram_start
if isinstance(segment.rom_end, int):
if global_vrom_end is None:
global_vrom_end = segment.rom_end
else:
if global_vrom_end < segment.rom_end:
global_vrom_end = segment.rom_end
if global_vram_end is None:
global_vram_end = segment.vram_end
elif global_vram_end < segment.vram_end:
global_vram_end = segment.vram_end
else:
spim_context.addOverlaySegment(
ram_id,
segment.rom_start,
segment.rom_end,
segment.vram_start,
segment.vram_end,
)
if global_vrom_start is None:
global_vrom_start = segment.rom_start
elif segment.rom_start < global_vrom_start:
global_vrom_start = segment.rom_start
if global_vrom_end is None:
global_vrom_end = segment.rom_end
elif global_vrom_end < segment.rom_end:
global_vrom_end = segment.rom_end
else:
spim_segment = spim_context.addOverlaySegment(
ram_id,
segment.rom_start,
segment.rom_end,
segment.vram_start,
segment.vram_end,
)
# Add the segment-specific symbols first
for symbols_list in segment.seg_symbols.values():
for sym in symbols_list:
add_symbol_to_spim_segment(spim_segment, sym)
if (
global_vram_start is not None
@ -247,9 +256,62 @@ def initialize_spim_context(all_segments: "List[Segment]") -> None:
global_vrom_start, global_vrom_end, global_vram_start, global_vram_end
)
# pass the global symbols to spimdisasm
for segment in all_segments:
if not isinstance(segment, CommonSegCode):
# We only care about the VRAMs of code segments
continue
ram_id = segment.get_exclusive_ram_id()
if ram_id is not None:
continue
for symbols_list in segment.seg_symbols.values():
for sym in symbols_list:
add_symbol_to_spim_segment(spim_context.globalSegment, sym)
def add_symbol_to_spim_segment(
segment: spimdisasm.common.SymbolsSegment, sym: "Symbol"
) -> spimdisasm.common.ContextSymbol:
if sym.type == "func":
context_sym = segment.addFunction(
sym.vram_start, isAutogenerated=not sym.user_declared, vromAddress=sym.rom
)
elif sym.type == "jtbl":
context_sym = segment.addJumpTable(
sym.vram_start, isAutogenerated=not sym.user_declared, vromAddress=sym.rom
)
elif sym.type == "jtbl_label":
context_sym = segment.addJumpTableLabel(
sym.vram_start, isAutogenerated=not sym.user_declared, vromAddress=sym.rom
)
elif sym.type == "label":
context_sym = segment.addBranchLabel(
sym.vram_start, isAutogenerated=not sym.user_declared, vromAddress=sym.rom
)
else:
context_sym = segment.addSymbol(
sym.vram_start, isAutogenerated=not sym.user_declared, vromAddress=sym.rom
)
if sym.type is not None:
context_sym.type = sym.type
if sym.user_declared:
context_sym.isUserDeclared = True
if sym.defined:
context_sym.isDefined = True
if sym.rom is not None:
context_sym.vromAddress = sym.rom
if sym.given_size is not None:
context_sym.size = sym.size
context_sym.setNameGetCallbackIfUnset(lambda _: sym.name)
return context_sym
def add_symbol_to_spim_section(
section: spimdisasm.common.ElementBase, sym: "Symbol"
section: spimdisasm.mips.sections.SectionBase, sym: "Symbol"
) -> spimdisasm.common.ContextSymbol:
if sym.type == "func":
context_sym = section.addFunction(
@ -271,7 +333,7 @@ def add_symbol_to_spim_section(
context_sym = section.addSymbol(
sym.vram_start, isAutogenerated=not sym.user_declared, symbolVrom=sym.rom
)
if sym.type and sym.type != "unknown":
if sym.type is not None:
context_sym.type = sym.type
if sym.user_declared:
@ -355,27 +417,34 @@ def retrieve_from_ranges(vram, rom=None):
return None
def mark_c_funcs_as_defined():
for symbol in all_symbols:
if len(to_mark_as_defined) == 0:
return
sym_name = symbol.name
if sym_name in to_mark_as_defined:
symbol.defined = True
to_mark_as_defined.remove(sym_name)
@dataclass
class Symbol:
def __init__(
self,
vram: int,
given_name: Optional[str] = None,
rom: Optional[int] = None,
type: Optional[str] = "unknown",
given_size: Optional[int] = None,
segment: Optional["Segment"] = None,
):
self.defined: bool = False
self.referenced: bool = False
self.vram_start = vram
self.rom = rom
self.type = type
self.given_size = given_size
self.given_name = given_name
self.dead: bool = False
self.extract: bool = True
self.user_declared: bool = False
self.segment: Optional["Segment"] = segment
vram_start: int
given_name: Optional[str] = None
rom: Optional[int] = None
type: Optional[str] = None
given_size: Optional[int] = None
segment: Optional["Segment"] = None
defined: bool = False
referenced: bool = False
dead: bool = False
extract: bool = True
user_declared: bool = False
_generated_default_name: Optional[str] = None
_last_type: Optional[str] = None
def __str__(self):
return self.name
@ -403,6 +472,10 @@ class Symbol:
@property
def default_name(self) -> str:
if self._generated_default_name is not None:
if self.type == self._last_type:
return self._generated_default_name
if self.segment:
if isinstance(self.rom, int):
suffix = self.format_name(self.segment.symbol_name_format)
@ -425,7 +498,9 @@ class Symbol:
else:
prefix = "D"
return f"{prefix}_{suffix}"
self._last_type = self.type
self._generated_default_name = f"{prefix}_{suffix}"
return self._generated_default_name
@property
def rom_end(self):

View File

@ -1,6 +1,6 @@
from segtypes.n64.segment import N64Segment
from segtypes.n64.palette import iter_in_groups
from util.color import unpack_color
from util.iter import iter_in_groups
from util import options
import png

View File

@ -53,12 +53,6 @@ glabel {name}
type,
name,
vram_start,
extract,
given_subalign,
exclusive_ram_id,
given_dir,
symbol_name_format,
symbol_name_format_no_rom,
args,
yaml,
):
@ -68,12 +62,6 @@ glabel {name}
type,
name,
vram_start,
extract,
given_subalign,
exclusive_ram_id,
given_dir,
symbol_name_format=symbol_name_format,
symbol_name_format_no_rom=symbol_name_format_no_rom,
args=args,
yaml=yaml,
)

View File

@ -34,12 +34,6 @@ glabel {name}
type,
name,
vram_start,
extract,
given_subalign,
exclusive_ram_id,
given_dir,
symbol_name_format,
symbol_name_format_no_rom,
args,
yaml,
):
@ -49,12 +43,6 @@ glabel {name}
type,
name,
vram_start,
extract,
given_subalign,
exclusive_ram_id,
given_dir,
symbol_name_format=symbol_name_format,
symbol_name_format_no_rom=symbol_name_format_no_rom,
args=args,
yaml=yaml,
)

View File

@ -6,7 +6,7 @@ from segtypes.n64.rgba32 import N64SegRgba32
from segtypes.n64.ci4 import N64SegCi4
from util.n64 import Yay0decompress
from util.color import unpack_color
from util.iter import iter_in_groups
from segtypes.n64.palette import iter_in_groups
from util import options
import png
import yaml as yaml_loader
@ -55,12 +55,6 @@ class N64SegPm_map_data(N64Segment):
type,
name,
vram_start,
extract,
given_subalign,
exclusive_ram_id,
given_dir,
symbol_name_format,
symbol_name_format_no_rom,
args,
yaml,
):
@ -70,12 +64,6 @@ class N64SegPm_map_data(N64Segment):
type,
name,
vram_start,
extract,
given_subalign,
exclusive_ram_id,
given_dir,
symbol_name_format=symbol_name_format,
symbol_name_format_no_rom=symbol_name_format_no_rom,
args=args,
yaml=yaml,
)

View File

@ -374,12 +374,6 @@ class N64SegPm_msg(N64Segment):
type,
name,
vram_start,
extract,
given_subalign,
exclusive_ram_id,
given_dir,
symbol_name_format,
symbol_name_format_no_rom,
args,
yaml,
):
@ -389,12 +383,6 @@ class N64SegPm_msg(N64Segment):
type,
name,
vram_start,
extract,
given_subalign,
exclusive_ram_id,
given_dir,
symbol_name_format=symbol_name_format,
symbol_name_format_no_rom=symbol_name_format_no_rom,
args=args,
yaml=yaml,
)

View File

@ -2,7 +2,7 @@ from segtypes.n64.segment import N64Segment
from pathlib import Path
import struct
from util.n64 import Yay0decompress
from util.iter import iter_in_groups
from segtypes.n64.palette import iter_in_groups
from util.color import unpack_color
from util import options
import png
@ -269,12 +269,6 @@ class N64SegPm_npc_sprites(N64Segment):
type,
name,
vram_start,
extract,
given_subalign,
exclusive_ram_id,
given_dir,
symbol_name_format,
symbol_name_format_no_rom,
args,
yaml,
):
@ -284,12 +278,6 @@ class N64SegPm_npc_sprites(N64Segment):
type,
name,
vram_start,
extract,
given_subalign,
exclusive_ram_id,
given_dir,
symbol_name_format=symbol_name_format,
symbol_name_format_no_rom=symbol_name_format_no_rom,
args=args,
yaml=yaml,
)

1088
ver/us/asm/bss.s Normal file

File diff suppressed because it is too large Load Diff

113
ver/us/asm/bss2.s Normal file
View File

@ -0,0 +1,113 @@
.include "macro.inc"
# assembler directives
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.set gp=64 # allow use of 64-bit general purpose registers
.section .bss
dlabel D_8010C920
.space 4
dlabel D_8010C924
.space 4
dlabel D_8010C928
.space 4
dlabel D_8010C92C
.space 4
dlabel wPartnerNpc
.space 4
dlabel TweesterTouchingPlayer
.space 4
dlabel D_8010C938
.space 4
dlabel D_8010C93C
.space 4
dlabel D_8010C940
.space 4
dlabel gSpinHistoryBufferPos
.space 4
dlabel D_8010C948
.space 4
dlabel D_8010C94C
.space 4
dlabel D_8010C950
.space 4
dlabel TweesterTouchingPartner
.space 4
dlabel D_8010C958
.space 4
dlabel PrevPlayerDirection
.space 4
dlabel JumpedOnSwitchX
.space 4
dlabel D_8010C964
.space 4
dlabel D_8010C968
.space 4
dlabel PeachDisguiseNpcIndex
.space 4
dlabel D_8010C970
.space 4
dlabel D_8010C974
.space 4
dlabel D_8010C978
.space 2
dlabel D_8010C97A
.space 2
dlabel JumpedOnSwitchZ
.space 4
dlabel D_8010C980
.space 4
dlabel D_8010C984
.space 4
dlabel D_8010C988
.space 4
dlabel D_8010C98C
.space 4
dlabel D_8010C990
.space 4
dlabel D_8010C994
.space 0x0000000c
dlabel D_8010C9A0
.space 4
dlabel D_8010C9A4
.space 0x0000000c
dlabel D_8010C9B0
.space 4
dlabel D_8010C9B4
.space 0x0000000c

725
ver/us/asm/bss3.s Normal file
View File

@ -0,0 +1,725 @@
.include "macro.inc"
# assembler directives
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.set gp=64 # allow use of 64-bit general purpose registers
.section .bss
dlabel D_801512B0
.space 4
dlabel gHudElementsNumber
.space 4
dlabel gCurrentCustomModelGfxBuildersPtr
.space 4
dlabel D_801512BC
.space 4
dlabel entity_numEntities
.space 4
dlabel gEntityHeapBase
.space 4
dlabel gHudElementCacheTableRaster
.space 4
dlabel gCurrentModels
.space 4
dlabel gHudElementCacheTablePalette
.space 4
dlabel gAnimCount
.space 4
dlabel gMsgBGScrollAmtX
.space 2
dlabel D_801512DA
.space 2
dlabel D_801512DC
.space 4
dlabel gCurrentTransformGroups
.space 4
dlabel gMsgGlobalWaveCounter
.space 4
dlabel gCurrentCustomModelGfxPtr
.space 4
dlabel gLastCreatedEntityIndex
.space 4
dlabel D_801512F0
.space 4
dlabel gMsgVarImages
.space 4
dlabel ItemEntitiesCreated
.space 4
dlabel gCurrentModelTreeRoot
.space 4
dlabel gEntityHeapBottom
.space 4
dlabel D_80151304
.space 4
dlabel D_80151308
.space 4
dlabel gMsgBGScrollAmtY
.space 2
dlabel D_8015130E
.space 2
dlabel gEntityHideMode
.space 4
dlabel gHudElementCacheBuffer
.space 4
dlabel gEntityModelCount
.space 4
dlabel D_8015131C
.space 4
dlabel D_80151320
.space 4
dlabel entity_numShadows
.space 4
dlabel D_80151328
.space 4
dlabel entity_area_specific_data_is_loaded
.space 4
dlabel entity_updateCounter
.space 4
dlabel gTriggerCount
.space 4
dlabel D_80151338
.space 4
dlabel gHudElementCacheSize
.space 4
dlabel gCurrentDoorSoundsSet
.space 4
dlabel D_80151344
.space 4
dlabel D_80151348
.space 0x00000038
dlabel gWorldEntityList
.space 0x00000078
dlabel gBattleEntityList
.space 0x00000078
dlabel gCurrentEntityListPtr
.space 4
dlabel D_80151474
.space 4
dlabel gWorldShadowList
.space 0x000000f0
dlabel gBattleShadowList
.space 0x000000f0
dlabel gCurrentShadowListPtr
.space 4
dlabel wEntityDataLoadedSize
.space 4
dlabel bEntityDataLoadedSize
.space 4
dlabel D_80151664
.space 4
dlabel wEntityBlueprint
.space 0x00000074
dlabel D_801516DC
.space 4
dlabel D_8015DCE0
.space 8
dlabel bEntityBlueprint
.space 0x00000014
dlabel D_801516FC
.space 4
dlabel gMainGameState
.space 0x00000040
dlabel gCurrentTileDescriptor
.space 0x00000030
dlabel wModelList
.space 0x00000400
dlabel bModelList
.space 0x00000400
dlabel wTransformGroups
.space 0x00000010
dlabel bTransformGroups
.space 0x00000010
dlabel wModelSpecialDls
.space 0x00000080
dlabel bModelSpecialDls
.space 0x00000080
dlabel wCustomModelGfxBuilders
.space 0x00000080
dlabel bCustomModelGfxBuilders
.space 0x00000080
dlabel wModelLocalVtxBuffers
.space 0x00000040
dlabel bModelLocalVtxBuffers
.space 0x00000040
dlabel gCurrentModelLocalVtxBuffers
.space 4
dlabel D_80152214
.space 4
dlabel D_80152218
.space 4
dlabel D_8015221C
.space 4
dlabel D_80152220
.space 0x00000800
dlabel D_80152A20
.space 0x00000800
dlabel wBgRenderType
.space 1
dlabel bBgRenderType
.space 1
dlabel D_80153222
.space 1
dlabel D_80153223
.space 1
dlabel mdl_treeIterPos
.space 2
dlabel D_80153226
.space 2
dlabel wFogSettings
.space 0x00000020
dlabel bFogSettings
.space 0x0000001c
dlabel gCurrentFogSettings
.space 4
dlabel texPannerMainU
.space 0x00000040
dlabel texPannerMainV
.space 0x00000040
dlabel texPannerAuxU
.space 0x00000040
dlabel texPannerAuxV
.space 0x00000040
dlabel mdl_nextTextureAddress
.space 4
dlabel mdl_currentTransformGroupChildIndex
.space 2
dlabel D_8015336E
.space 2
dlabel D_80153370
.space 4
dlabel D_80153374
.space 2
dlabel D_80153376
.space 2
dlabel D_80153378
.space 8
dlabel D_80153380
.space 0x00000020
dlabel mdl_renderTaskLists
.space 0x0000000c
dlabel mdl_renderTaskQueueIdx
.space 4
dlabel mdl_renderTaskCount
.space 0x00000010
dlabel D_801533C0
.space 0x00000300
dlabel D_801536C0
.space 0x00000300
dlabel D_801539C0
.space 0x00000040
dlabel D_80153A00
.space 0x00000040
dlabel gCurrentAnimMeshListPtr
.space 4
dlabel gAnimModelFogEnabled
.space 4
dlabel gAnimModelFogR
.space 4
dlabel gAnimModelFogG
.space 4
dlabel gAnimModelFogB
.space 4
dlabel gAnimModelFogA
.space 4
dlabel gAnimModelFogStart
.space 4
dlabel gAnimModelFogEnd
.space 4
dlabel gAnimVtxSegment
.space 4
dlabel D_80153A64
.space 4
dlabel gAnimRotMtx
.space 0x00000040
dlabel gAnimScaleMtx
.space 0x00000040
dlabel gAnimTranslateMtx
.space 0x00000040
dlabel gAnimRotScaleMtx
.space 0x00000040
dlabel gAnimTreeRoot
.space 8
dlabel gWorldEntityModelList
.space 0x00000400
dlabel gBattleEntityModelList
.space 0x00000400
dlabel gCurrentEntityModelList
.space 4
dlabel D_80154374
.space 4
dlabel entity_fog_enabled
.space 4
dlabel entity_fog_red
.space 1
dlabel D_8015437D
.space 1
dlabel D_8015437E
.space 1
dlabel D_8015437F
.space 1
dlabel entity_fog_green
.space 1
dlabel D_80154381
.space 1
dlabel D_80154382
.space 1
dlabel D_80154383
.space 1
dlabel entity_fog_blue
.space 1
dlabel D_80154385
.space 1
dlabel D_80154386
.space 1
dlabel D_80154387
.space 1
dlabel entity_fog_alpha
.space 1
dlabel D_80154389
.space 1
dlabel D_8015438A
.space 1
dlabel D_8015438B
.space 1
dlabel entity_fog_dist_min
.space 4
dlabel entity_fog_dist_max
.space 4
dlabel D_80154394
.space 0x0000000c
dlabel gWorldDynamicEntityList
.space 0x00000040
dlabel gBattleDynamicEntityList
.space 0x00000040
dlabel gCurrentDynamicEntityListPtr
.space 4
dlabel D_80154424
.space 0x0000000c
dlabel gMessageBuffers
.space 0x00000800
dlabel gMessagePrinters
.space 0x00001008
dlabel gMessageMsgVars
.space 0x00000060
dlabel D_80155C98
.space 8
dlabel gMessageWindowProjMatrix
.space 0x00000080
dlabel D_80155D20
.space 4
dlabel D_8015DD24
.space 0x00000050
dlabel msg_drawState
.space 4
dlabel D_8015DD78
.space 8
dlabel D_80155D80
.space 4
dlabel ItemEntityAlternatingSpawn
.space 4
dlabel ItemEntityRenderGroup
.space 4
dlabel D_80155D8C
.space 2
dlabel D_80155D8E
.space 2
dlabel D_80155D90
.space 0x00000010
dlabel WorldItemEntities
.space 0x00000400
dlabel BattleItemEntities
.space 0x00000400
dlabel gCurrentItemEntities
.space 4
dlabel isPickingUpItem
.space 2
dlabel D_801565A6
.space 2
dlabel D_801565A8
.space 4
dlabel D_801565AC
.space 4
dlabel D_801565B0
.space 0x00000330
dlabel D_801568E0
.space 4
dlabel D_801568E4
.space 4
dlabel D_801568E8
.space 4
dlabel D_801568EC
.space 4
dlabel D_801568F0
.space 4
dlabel D_801568F4
.space 4
dlabel D_801568F8
.space 4
dlabel D_801568FC
.space 4
dlabel screen_overlay_frontType
.space 4
dlabel screen_overlay_frontZoom
.space 4
dlabel screen_overlay_backType
.space 4
dlabel screen_overlay_backZoom
.space 4
dlabel D_80156910
.space 0x00000010
dlabel D_80156920
.space 0x00000028
dlabel D_80156948
.space 8
dlabel fold_vtxBuf
.space 4
dlabel D_80156954
.space 4
dlabel D_80156958
.space 8
dlabel D_80156960
.space 8
dlabel D_80156968
.space 8
dlabel D_80156970
.space 0x00000010
dlabel fold_groupDescriptors
.space 0x000005a0
dlabel fold_gfxDataCache
.space 0x00000040
dlabel gHudElementsWorld
.space 0x00000500
dlabel gHudElementsBattle
.space 0x00000500
dlabel gHudElements
.space 4
dlabel gHudElementCacheBufferWorld
.space 4
dlabel gHudElementCacheSizeWorld
.space 4
dlabel D_8015796C
.space 4
dlabel gHudElementCacheTableRasterWorld
.space 0x00000600
dlabel gHudElementCacheTablePaletteWorld
.space 0x00000600
dlabel gHudElementCacheBufferBattle
.space 4
dlabel gHudElementCacheSizeBattle
.space 4
dlabel D_80158578
.space 8
dlabel gHudElementCacheTableRasterBattle
.space 0x00000600
dlabel gHudElementCacheTablePaletteBattle
.space 0x00000600
dlabel D_80159180
.space 0x00000010
dlabel wTriggerList
.space 0x00000100
dlabel bTriggerList
.space 0x00000100
dlabel gCurrentTriggerListPtr
.space 4
dlabel D_80159394
.space 0x0000000c
dlabel D_801593A0
.space 0x000001fe
dlabel D_8015959E
.space 2
dlabel D_801595A0
.space 0x00000020
dlabel D_801595C0
.space 0x000000b0
dlabel D_80159670
.space 0x000000b0
dlabel D_80159720
.space 0x000000b0
dlabel D_801597D0
.space 0x000000b0
dlabel D_80159880
.space 0x00000020
dlabel D_801598A0
.space 0x00000118
dlabel D_801599B8
.space 0x00000118
dlabel D_80159AD0
.space 4
dlabel D_80159AD4
.space 4
dlabel D_80159AD8
.space 8
dlabel MusicDefaultVolume
.space 2
dlabel MusicTargetVolume
.space 2
dlabel MusicMaxVolume
.space 2
dlabel MusicCurrentVolume
.space 2
dlabel D_80159AE8
.space 8
dlabel gMusicSettings
.space 0x00000060
dlabel D_80159B50
.space 0x00000200
dlabel gWindows
.space 0x00000800
dlabel gCollisionStatus
.space 0x00000028
dlabel gCurrentHiddenPanels
.space 2
dlabel D_8015A57A
.space 2
dlabel D_8015A57C
.space 0x00000014
dlabel mdl_textureHandles
.space 0x00002200
dlabel D_8015C790
.space 0x00000030
dlabel AmbientSoundData
.space 0x00000010
dlabel CreateEntityVarArgBuffer
.space 0x00000010
dlabel D_8015C7E0
.space 4

View File

@ -1,57 +0,0 @@
.include "macro.inc"
.section .data
dlabel D_80293820
.word 0x00000008, 0x00000001, 0xFE363C80, 0x00000005, 0x00000001, 0x00000004, 0x00000043, 0x00000003, SetBattleCamParam, 0x00000004, 0x0000000B, 0x00000008, 0x00000001, 0x00000001, 0x00000043, 0x00000003, SetBattleCamParam, 0x00000004, 0x00000005, 0x00000008, 0x00000001, 0x00000001, 0x00000006, 0x00000000, 0x00000043, 0x00000003, SetBattleCamParam, 0x00000004, 0x00000008, 0x00000002, 0x00000000, 0x00000001, 0x00000000
dlabel D_802938A4
.float 0.0
dlabel D_802938A8
.short 0x0004, 0x0000
dlabel gDamageCountEffects
.word 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000
dlabel gDamageCountTimers
.word 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000
dlabel D_80293970
.word 0xE7000000, 0x00000000, 0xD7000000, 0xFFFFFFFF, 0xE3000A01, 0x00000000, 0xE3000C00, 0x00000000, 0xE3000D01, 0x00000000, 0xE3000F00, 0x00000000, 0xE3001201, 0x00000000, 0xE3001001, 0x00000000, 0xE3001402, 0x00000C00, 0xDF000000, 0x00000000
dlabel D_802939C0
.word 0x00000000
dlabel D_802939C4
.word 0x00000043, 0x00000003, NAMESPACE_StartRumbleWithParams, 0x00000100, 0x0000001E, 0x00000043, 0x00000003, NAMESPACE_StartRumbleWithParams, 0x000000C8, 0x0000000F, 0x00000043, 0x00000003, NAMESPACE_StartRumbleWithParams, 0x00000032, 0x0000000F, 0x00000002, 0x00000000, 0x00000001, 0x00000000
dlabel D_80293A10
.word 0x00000043, 0x00000003, NAMESPACE_StartRumbleWithParams, 0x00000064, 0x00000014, 0x00000002, 0x00000000, 0x00000001, 0x00000000
dlabel D_80293A34
.word 0x00000043, 0x00000003, NAMESPACE_StartRumbleWithParams, 0x00000096, 0x00000014, 0x00000002, 0x00000000, 0x00000001, 0x00000000
dlabel D_80293A58
.word 0x00000043, 0x00000003, NAMESPACE_StartRumbleWithParams, 0x000000C8, 0x0000001E, 0x00000002, 0x00000000, 0x00000001, 0x00000000
dlabel D_80293A7C
.word 0x00000043, 0x00000003, NAMESPACE_StartRumbleWithParams, 0x00000100, 0x00000028, 0x00000002, 0x00000000, 0x00000001, 0x00000000
dlabel D_80293AA0
.word 0x00000043, 0x00000003, NAMESPACE_StartRumbleWithParams, 0x00000100, 0x0000003C, 0x00000002, 0x00000000, 0x00000001, 0x00000000
dlabel D_80293AC4
.word 0x00000043, 0x00000003, NAMESPACE_StartRumbleWithParams, 0x00000064, 0x00000014, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000003, NAMESPACE_StartRumbleWithParams, 0x00000096, 0x00000014, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000003, NAMESPACE_StartRumbleWithParams, 0x000000C8, 0x0000001E, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000003, NAMESPACE_StartRumbleWithParams, 0x00000100, 0x00000028, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000003, NAMESPACE_StartRumbleWithParams, 0x00000100, 0x0000003C, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000
dlabel D_80293B80
.word 0xFFFFFFFF, 0x0000008A, 0x00000080, 0x00000086, 0x00000090, 0x00000085, 0x0000008B, 0x00000082, 0x00000081, 0x0000008D, 0x00000083, 0x0000008F, 0x00000088, 0x00000089, 0x00000084, 0x0000008C, 0x0000008E, 0x0000009B, 0x00000091, 0x00000092, 0x0000009A, 0x00000099, 0x000000C8, 0x00000087, 0x00000098, 0x00000096, 0x00000097, 0x00000095, 0x000000AC, 0x000000CC, 0x000000D2, 0x000000D3, 0x00000000
dlabel gBattleItemTable
.word 0x007330D0, 0x007345A0, func_802A1000, 0x802A20FC, 0x00715850, 0x00716C60, func_802A1000, battle_item_mushroom_main, 0x00716C60, 0x007179D0, func_802A1000, battle_item_fire_flower_main, 0x007179D0, 0x00718850, func_802A1000, battle_item_dusty_hammer_main, 0x00718850, 0x00719970, func_802A1000, battle_item_pow_block_main, 0x00719970, 0x0071A7F0, func_802A1000, battle_item_dusty_hammer_main, 0x0071A7F0, 0x0071B1A0, func_802A1000, battle_item_volt_shroom_main, 0x0071B1A0, 0x0071BE30, func_802A1000, battle_item_thunder_rage_main, 0x0071BE30, 0x0071CCE0, func_802A1000, battle_item_snowman_doll_main, 0x00715850, 0x00716C60, func_802A1000, battle_item_mushroom_main, 0x0071D770, 0x0071E650, func_802A1000, battle_item_shooting_star_main, 0x0071E650, 0x007215A0, func_802A1000, battle_item_sleepy_sheep_main, 0x007215A0, 0x00722000, func_802A1000, battle_item_stone_cap_main, 0x00722000, 0x00722B40, func_802A1000, battle_item_stone_cap_EatItem, 0x00722B40, 0x00723780, func_802A1000, battle_item_thunder_rage_main, 0x00715850, 0x00716C60, func_802A1000, battle_item_mushroom_main, 0x00715850, 0x00716C60, func_802A1000, battle_item_mushroom_main, 0x00724CE0, 0x00725F60, func_802A1000, battle_item_super_soda_main, 0x00725F60, 0x00726DD0, func_802A1000, battle_item_stone_cap_EatItem, 0x00726DD0, 0x00727910, func_802A1000, battle_item_stop_watch_main, 0x00727910, 0x007285E0, func_802A1000, battle_item_stone_cap_main, 0x007285E0, 0x00728EC0, func_802A1000, battle_item_please_come_back_main, 0x00728EC0, 0x0072A750, func_802A1000, battle_item_egg_missile_main, 0x0072A750, 0x0072B910, func_802A1000, script, 0x0072B910, 0x0072C5B0, func_802A1000, battle_item_stop_watch_main, 0x0072C5B0, 0x0072DB70, func_802A1000, battle_item_mystery_main, 0x0072DB70, 0x0072E530, func_802A1000, battle_item_repel_gel_main, 0x0072E530, 0x0072F720, func_802A1000, battle_item_life_shroom_main, 0x0072F720, 0x007305A0, func_802A1000, battle_item_dusty_hammer_main, 0x007305A0, 0x00731300, func_802A1000, battle_item_electro_pop_main, 0x00731300, 0x007330D0, func_802A1000, battle_item_strange_cake_script6, 0x00731300, 0x007330D0, func_802A1000, battle_item_strange_cake_script6, 0x0001001F, 0x00010005, 0x00010002, 0x00090003, 0x00090003, 0x00090001, 0x000A0006, 0x000A0006, 0x000A0004, 0x000B0008, 0x000B0008, 0x000B0004, 0x000C0003, 0x000C0003, 0x000C0001
dlabel UseMystery
.word 0x00000008, 0x00000001, 0x00000002, 0x00000043, 0x00000001, LoadFreeItemScript, 0x00000046, 0x00000001, 0xFE363C80, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000
dlabel gMoveScriptTable
.word 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x007345A0, 0x00737890, func_802A1000, 0x802A3044, 0x007345A0, 0x00737890, func_802A1000, 0x802A3044, 0x007345A0, 0x00737890, func_802A1000, 0x802A3044, 0x007345A0, 0x00737890, func_802A1000, 0x802A369C, 0x007345A0, 0x00737890, func_802A1000, 0x802A3B28, 0x00737890, 0x0073AED0, func_802A1000, 0x802A3124, 0x0073AED0, 0x0073D860, func_802A1000, 0x802A3044, 0x0074AD90, 0x0074D570, func_802A1000, 0x802A3144, 0x0074F130, 0x00752450, func_802A1000, 0x802A38C4, 0x0074F130, 0x00752450, func_802A1000, 0x802A3234, 0x00752450, 0x00756780, func_802A1000, 0x802A3D38, 0x00756780, 0x007595B0, func_802A1000, 0x802A3114, 0x007595B0, 0x0075C980, func_802A1000, 0x802A3944, 0x007595B0, 0x0075C980, func_802A1000, 0x802A32B4, 0x0075E5D0, 0x00761920, func_802A1000, 0x802A3944, 0x0075E5D0, 0x00761920, func_802A1000, 0x802A32B4, 0x00763540, 0x00765C20, func_802A1000, 0x802A3044, 0x00767C90, 0x0076A830, func_802A1000, 0x802A3044, 0x00772BA0, 0x00775100, func_802A1000, 0x802A3044, 0x00775100, 0x00777690, func_802A1000, 0x802A3044, 0x00777690, 0x00779C90, func_802A1000, 0x802A3044, 0x0077CB80, 0x0077F240, func_802A1000, 0x802A3044, 0x0077F240, 0x00781920, func_802A1000, 0x802A3124, 0x0073D860, 0x00740CC0, func_802A1000, 0x802A2650, 0x0073D860, 0x00740CC0, func_802A1000, 0x802A2650, 0x0073D860, 0x00740CC0, func_802A1000, 0x802A2650, 0x0073D860, 0x00740CC0, func_802A1000, 0x802A30F4, 0x0073D860, 0x00740CC0, func_802A1000, 0x802A3644, 0x00740CC0, 0x00743DF0, func_802A1000, 0x802A2620, 0x00743DF0, 0x00746E10, func_802A1000, 0x802A2734, 0x00746E10, 0x00748DD0, func_802A1000, 0x802A2600, 0x00748DD0, 0x0074AD90, func_802A1000, 0x802A2600, 0x0074D570, 0x0074F130, func_802A1000, 0x802A2800, 0x0074D570, 0x0074F130, func_802A1000, 0x802A27F0, 0x0075C980, 0x0075E5D0, func_802A1000, 0x802A2880, 0x0075C980, 0x0075E5D0, func_802A1000, battle_item_strange_cake_script6, 0x00761920, 0x00763540, func_802A1000, 0x802A2880, 0x00761920, 0x00763540, func_802A1000, battle_item_strange_cake_script6, 0x00765C20, 0x00767C90, func_802A1000, 0x802A2600, 0x0076A830, 0x0076D760, func_802A1000, 0x802A2600, 0x0076D760, 0x0076F330, func_802A1000, 0x802A2600, 0x0076F330, 0x00770F30, func_802A1000, 0x802A2600, 0x00770F30, 0x00772BA0, func_802A1000, 0x802A2600, 0x00781920, 0x00783BA0, func_802A1000, 0x802A26E0, 0x00783BA0, 0x00785B20, func_802A1000, 0x802A2600, 0x00785B20, 0x00789E60, func_802A1000, 0x802A2630

File diff suppressed because one or more lines are too long

View File

@ -30,7 +30,10 @@ dlabel D_802A20CC_7829EC
.word 0x00000043, 0x00000006, SetJumpAnimations, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0001000C, 0x00000043, 0x00000001, PlayerLandJump, 0x00000043, 0x00000004, SetAnimation, 0x00000000, 0x00000000, 0x0001000C, 0x00000008, 0x00000001, 0x00000002, 0x00000058, 0x00000000, 0x00000043, 0x00000005, ShakeCam, 0x00000001, 0x00000000, 0x00000005, 0xF24A7E80, 0x00000059, 0x00000000, 0x00000043, 0x00000003, PlaySoundAtActor, 0x00000000, 0x00000162, 0x00000043, 0x00000004, SetAnimation, 0x00000000, 0x00000000, 0x00010030, 0x00000008, 0x00000001, 0x0000000A, 0x00000043, 0x00000004, SetAnimation, 0x00000000, 0x00000000, 0x00010031, 0x00000008, 0x00000001, 0x00000014, 0x00000043, 0x00000003, SetBattleFlagBits, 0x00000100, 0x00000000, 0x00000043, 0x00000002, UseBattleCamPreset, 0x00000003, 0x00000043, 0x00000001, func_802693F0, 0x00000043, 0x00000002, EnablePlayerBlur, 0xFFFFFFFF, 0x00000043, 0x00000001, func_80276EFC, 0x00000043, 0x00000002, SetGoalToHome, 0x00000000, 0x00000043, 0x00000003, SetActorSpeed, 0x00000000, 0xF24A9A80, 0x00000043, 0x00000004, SetAnimation, 0x00000000, 0x00000000, 0x00010005, 0x00000043, 0x00000002, PlayerRunToGoal, 0x00000000, 0x00000043, 0x00000004, SetAnimation, 0x00000000, 0x00000000, 0x00010002, 0x00000002, 0x00000000, 0x00000001, 0x00000000
dlabel D_802A2264_782B84
.word 0x00000043, 0x00000002, LoadActionCommand, 0x00000001, 0x00000043, 0x00000001, action_command_jump_CreateHudElements, 0x00000046, 0x00000001, D_802A128C_781BAC, 0x00000046, 0x00000001, D_802A1400_781D20, 0x00000043, 0x00000003, func_802A9120_421B10, 0xFE363C8A, 0x00000003, 0x00000043, 0x00000002, UseBattleCamPreset, 0x00000022, 0x00000043, 0x00000002, SetGoalToTarget, 0x00000000, 0x00000043, 0x00000006, SetJumpAnimations, 0x00000000, 0x00000000, 0x00010007, 0x00010008, 0x00030000, 0x00000043, 0x00000003, func_80274A18, 0xFE363C8A, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000002, LoadActionCommand, 0x00000001, 0x00000043, 0x00000001, action_command_jump_CreateHudElements, 0x00000046, 0x00000001, D_802A128C_781BAC, 0x00000043, 0x00000001, InitTargetIterator, 0x00000046, 0x00000001, D_802A14E8_781E08, 0x00000024, 0x00000002, 0xFE363C8B, 0xFE363C8A, 0x00000027, 0x00000002, 0xFE363C8B, 0x0000000E, 0x00000027, 0x00000002, 0xFE363C8B, 0xFFFFFFFD, 0x00000043, 0x00000003, func_802A9120_421B10, 0xFE363C8B, 0x00000003, 0x00000043, 0x00000002, UseBattleCamPreset, 0x00000025, 0x00000043, 0x00000002, SetGoalToTarget, 0x00000000, 0x00000043, 0x00000006, SetJumpAnimations, 0x00000000, 0x00000000, 0x00010007, 0x0001000A, 0x0001000B, 0x00000043, 0x00000003, func_802752AC, 0xFE363C8A, 0x00000000, 0x00000008, 0x00000001, 0x00000007, 0x00000043, 0x00000002, DidActionSucceed, 0xFE363C80, 0x00000014, 0x00000001, 0xFE363C80, 0x00000019, 0x00000001, 0x00000000, 0x00000043, 0x00000003, func_802752AC, 0x00000003, 0x00000001, 0x0000001C, 0x00000000, 0x00000043, 0x00000003, func_802752AC, 0x00000005, 0x00000001, 0x00000023, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000002, LoadActionCommand, 0x00000001, 0x00000043, 0x00000001, action_command_jump_CreateHudElements, 0x00000046, 0x00000001, D_802A128C_781BAC, 0x00000046, 0x00000001, D_802A15D0_781EF0, 0x00000043, 0x00000002, func_8026919C, D_802A11D0_781AF0, 0x00000024, 0x00000002, 0xFE363C8B, 0xFE363C8A, 0x00000028, 0x00000002, 0xFE363C8B, 0x00000004, 0x00000027, 0x00000002, 0xFE363C8B, 0xFFFFFFFD, 0x00000043, 0x00000003, func_802A9120_421B10, 0xFE363C8B, 0x00000003, 0x00000043, 0x00000002, UseBattleCamPreset, 0x00000026, 0x00000043, 0x00000002, SetGoalToTarget, 0x00000000, 0x00000043, 0x00000006, SetJumpAnimations, 0x00000000, 0x00000000, 0x00010007, 0x00080000, 0x00030000, 0x00000043, 0x00000003, func_80275F00, 0xFE363C8A, 0x00000000, 0x00000043, 0x00000001, CloseActionCommandInfo, 0x00000024, 0x00000002, 0xFE363C89, 0x00000000, 0x00000043, 0x00000002, DidActionSucceed, 0xFE363C80, 0x0000000D, 0x00000002, 0xFE363C80, 0x00000000, 0x00000024, 0x00000002, 0xFE363C89, 0x00000001, 0x00000043, 0x00000004, SetAnimation, 0x00000000, 0x00000000, 0x00030000, 0x00000043, 0x00000005, SetActorRotation, 0xFFFFFF81, 0x00000000, 0x00000000, 0x00000000, 0x00000043, 0x00000005, SetActorDispOffset, 0xFFFFFF81, 0x00000000, 0xFFFFFFFE, 0x00000000, 0x00000008, 0x00000001, 0x00000002, 0x00000043, 0x00000005, SetActorDispOffset, 0xFFFFFF81, 0x00000000, 0x00000000, 0x00000000, 0x00000043, 0x00000002, LoadActionCommand, 0x00000001, 0x00000043, 0x00000001, action_command_jump_CreateHudElements, 0x00000043, 0x00000003, func_802A9120_421B10, 0x0000000D, 0x00000003, 0x00000043, 0x00000002, UseBattleCamPreset, 0x00000027, 0x00000043, 0x00000003, func_80275F00, 0x0000000F, 0x00000002, 0x00000004, 0x00000001, 0x0000000A, 0x00000012, 0x00000000, 0x00000043, 0x00000002, LoadActionCommand, 0x00000001, 0x00000043, 0x00000001, action_command_jump_CreateHudElements, 0x00000043, 0x00000003, func_802A9120_421B10, 0x00000002, 0x00000003, 0x00000043, 0x00000003, func_80275F00, 0x00000004, 0x00000001, 0x00000004, 0x00000001, 0x0000000A, 0x00000013, 0x00000000, 0x00000003, 0x00000001, 0x0000000A, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000002, func_802694A4, 0x00000001, 0x00000043, 0x00000002, func_80269EAC, 0x00000004, 0x00000043, 0x00000004, GetMenuSelection, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000014, 0x00000001, 0xFE363C81, 0x00000016, 0x00000001, 0x00000000, 0x00000046, 0x00000001, D_802A2784_7830A4, 0x00000016, 0x00000001, 0x00000001, 0x00000046, 0x00000001, D_802A2B24_783444, 0x00000016, 0x00000001, 0x00000002, 0x00000046, 0x00000001, D_802A2EE0_783800, 0x00000023, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000
.word 0x00000043, 0x00000002, LoadActionCommand, 0x00000001, 0x00000043, 0x00000001, action_command_jump_CreateHudElements, 0x00000046, 0x00000001, D_802A128C_781BAC, 0x00000046, 0x00000001, D_802A1400_781D20, 0x00000043, 0x00000003, func_802A9120_421B10, 0xFE363C8A, 0x00000003, 0x00000043, 0x00000002, UseBattleCamPreset, 0x00000022, 0x00000043, 0x00000002, SetGoalToTarget, 0x00000000, 0x00000043, 0x00000006, SetJumpAnimations, 0x00000000, 0x00000000, 0x00010007, 0x00010008, 0x00030000, 0x00000043, 0x00000003, func_80274A18, 0xFE363C8A, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000002, LoadActionCommand, 0x00000001, 0x00000043, 0x00000001, action_command_jump_CreateHudElements, 0x00000046, 0x00000001, D_802A128C_781BAC, 0x00000043, 0x00000001, InitTargetIterator, 0x00000046, 0x00000001, D_802A14E8_781E08, 0x00000024, 0x00000002, 0xFE363C8B, 0xFE363C8A, 0x00000027, 0x00000002, 0xFE363C8B, 0x0000000E, 0x00000027, 0x00000002, 0xFE363C8B, 0xFFFFFFFD, 0x00000043, 0x00000003, func_802A9120_421B10, 0xFE363C8B, 0x00000003, 0x00000043, 0x00000002, UseBattleCamPreset, 0x00000025, 0x00000043, 0x00000002, SetGoalToTarget, 0x00000000, 0x00000043, 0x00000006, SetJumpAnimations, 0x00000000, 0x00000000, 0x00010007, 0x0001000A, 0x0001000B, 0x00000043, 0x00000003, func_802752AC, 0xFE363C8A, 0x00000000, 0x00000008, 0x00000001, 0x00000007, 0x00000043, 0x00000002, DidActionSucceed, 0xFE363C80, 0x00000014, 0x00000001, 0xFE363C80, 0x00000019, 0x00000001, 0x00000000, 0x00000043, 0x00000003, func_802752AC, 0x00000003, 0x00000001, 0x0000001C, 0x00000000, 0x00000043, 0x00000003, func_802752AC, 0x00000005, 0x00000001, 0x00000023, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000002, LoadActionCommand, 0x00000001, 0x00000043, 0x00000001, action_command_jump_CreateHudElements, 0x00000046, 0x00000001, D_802A128C_781BAC, 0x00000046, 0x00000001, D_802A15D0_781EF0, 0x00000043, 0x00000002, func_8026919C, D_802A11D0_781AF0, 0x00000024, 0x00000002, 0xFE363C8B, 0xFE363C8A, 0x00000028, 0x00000002, 0xFE363C8B, 0x00000004, 0x00000027, 0x00000002, 0xFE363C8B, 0xFFFFFFFD, 0x00000043, 0x00000003, func_802A9120_421B10, 0xFE363C8B, 0x00000003, 0x00000043, 0x00000002, UseBattleCamPreset, 0x00000026, 0x00000043, 0x00000002, SetGoalToTarget, 0x00000000, 0x00000043, 0x00000006, SetJumpAnimations, 0x00000000, 0x00000000, 0x00010007, 0x00080000, 0x00030000, 0x00000043, 0x00000003, func_80275F00, 0xFE363C8A, 0x00000000, 0x00000043, 0x00000001, CloseActionCommandInfo, 0x00000024, 0x00000002, 0xFE363C89, 0x00000000, 0x00000043, 0x00000002, DidActionSucceed, 0xFE363C80, 0x0000000D, 0x00000002, 0xFE363C80, 0x00000000, 0x00000024, 0x00000002, 0xFE363C89, 0x00000001, 0x00000043, 0x00000004, SetAnimation, 0x00000000, 0x00000000, 0x00030000, 0x00000043, 0x00000005, SetActorRotation, 0xFFFFFF81, 0x00000000, 0x00000000, 0x00000000, 0x00000043, 0x00000005, SetActorDispOffset, 0xFFFFFF81, 0x00000000, 0xFFFFFFFE, 0x00000000, 0x00000008, 0x00000001, 0x00000002, 0x00000043, 0x00000005, SetActorDispOffset, 0xFFFFFF81, 0x00000000, 0x00000000, 0x00000000, 0x00000043, 0x00000002, LoadActionCommand, 0x00000001, 0x00000043, 0x00000001, action_command_jump_CreateHudElements, 0x00000043, 0x00000003, func_802A9120_421B10, 0x0000000D, 0x00000003, 0x00000043, 0x00000002, UseBattleCamPreset, 0x00000027, 0x00000043, 0x00000003, func_80275F00, 0x0000000F, 0x00000002, 0x00000004, 0x00000001, 0x0000000A, 0x00000012, 0x00000000, 0x00000043, 0x00000002, LoadActionCommand, 0x00000001, 0x00000043, 0x00000001, action_command_jump_CreateHudElements, 0x00000043, 0x00000003, func_802A9120_421B10, 0x00000002, 0x00000003, 0x00000043, 0x00000003, func_80275F00, 0x00000004, 0x00000001, 0x00000004, 0x00000001, 0x0000000A, 0x00000013, 0x00000000, 0x00000003, 0x00000001, 0x0000000A, 0x00000002, 0x00000000, 0x00000001, 0x00000000
dlabel battle_move_d_down_jump_main
.word 0x00000043, 0x00000002, func_802694A4, 0x00000001, 0x00000043, 0x00000002, func_80269EAC, 0x00000004, 0x00000043, 0x00000004, GetMenuSelection, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000014, 0x00000001, 0xFE363C81, 0x00000016, 0x00000001, 0x00000000, 0x00000046, 0x00000001, D_802A2784_7830A4, 0x00000016, 0x00000001, 0x00000001, 0x00000046, 0x00000001, D_802A2B24_783444, 0x00000016, 0x00000001, 0x00000002, 0x00000046, 0x00000001, D_802A2EE0_783800, 0x00000023, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000
dlabel D_802A2784_7830A4
.word 0x00000046, 0x00000001, D_802A2264_782B84, 0x00000043, 0x00000007, PlayerTestEnemy, 0xFE363C80, 0x00000080, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x0000000A, 0x00000002, 0xFE363C80, 0x00000006, 0x00000046, 0x00000001, D_802A20CC_7829EC, 0x00000002, 0x00000000, 0x00000013, 0x00000000, 0x00000043, 0x00000002, DidActionSucceed, 0xFE363C8A, 0x00000043, 0x00000005, GetActorPos, 0x00000000, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000004, func_802A10E4_781A04, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000003, PlaySoundAtActor, 0x00000000, 0x0000210A, 0x00000008, 0x00000001, 0x00000001, 0x00000043, 0x00000002, DidActionSucceed, 0xFE363C80, 0x00000014, 0x00000001, 0xFE363C80, 0x00000019, 0x00000001, 0x00000000, 0x00000043, 0x00000005, SetActorSounds, 0x00000000, 0x00000003, 0x0000015A, 0x00000000, 0x00000043, 0x00000003, PlaySoundAtActor, 0x00000000, 0x0000015A, 0x00000043, 0x00000007, PlayerDamageEnemy, 0xFE363C80, 0x08000080, 0x00000000, 0x00000000, 0x00000001, 0x00000050, 0x0000001C, 0x00000000, 0x00000043, 0x00000005, SetActorSounds, 0x00000000, 0x00000003, 0x0000015A, 0x00000000, 0x00000043, 0x00000007, PlayerDamageEnemy, 0xFE363C80, 0x08000080, 0x00000000, 0x00000000, 0x00000001, 0x00000030, 0x00000023, 0x00000000, 0x00000014, 0x00000001, 0xFE363C80, 0x0000001D, 0x00000001, 0x00000000, 0x0000001D, 0x00000001, 0x00000002, 0x00000046, 0x00000001, D_802A1A90_7823B0, 0x00000002, 0x00000000, 0x00000020, 0x00000000, 0x0000001D, 0x00000001, 0x00000001, 0x0000001D, 0x00000001, 0x00000003, 0x00000020, 0x00000000, 0x00000023, 0x00000000, 0x00000058, 0x00000000, 0x00000043, 0x00000002, UseBattleCamPreset, 0x0000001B, 0x00000008, 0x00000001, 0x00000005, 0x00000043, 0x00000002, SetGoalToTarget, 0x00000000, 0x00000043, 0x00000002, UseBattleCamPreset, 0x00000023, 0x00000059, 0x00000000, 0x00000043, 0x00000002, func_80269524, 0xFE363C8F, 0x00000043, 0x00000001, CloseActionCommandInfo, 0x00000043, 0x00000002, LoadActionCommand, 0x00000001, 0x00000043, 0x00000001, action_command_jump_CreateHudElements, 0x00000043, 0x00000002, func_802694A4, 0x00000000, 0x00000043, 0x00000003, func_802A9120_421B10, 0x00000018, 0x00000003, 0x00000043, 0x00000002, SetGoalToTarget, 0x00000000, 0x00000043, 0x00000006, SetJumpAnimations, 0x00000000, 0x00000000, 0x00010007, 0x00010008, 0x0001000C, 0x00000043, 0x00000003, func_80274A18, 0x00000018, 0x00000003, 0x00000043, 0x00000005, GetActorPos, 0x00000000, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000004, func_802A10E4_781A04, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000003, PlaySoundAtActor, 0x00000000, 0x0000210A, 0x00000008, 0x00000001, 0x00000001, 0x00000043, 0x00000005, SetActorSounds, 0x00000000, 0x00000003, 0x0000015A, 0x00000000, 0x00000043, 0x00000007, PlayerDamageEnemy, 0xFE363C80, 0x08000080, 0x00000000, 0x00000000, 0x00000001, 0x000000E0, 0x00000043, 0x00000002, func_80269550, 0xFE363C8F, 0x00000046, 0x00000001, D_802A16B8_781FD8, 0x00000002, 0x00000000, 0x00000001, 0x00000000

File diff suppressed because one or more lines are too long

View File

@ -30,7 +30,10 @@ dlabel D_802A1FEC_749DBC
.word 0x00000043, 0x00000006, SetJumpAnimations, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0001000C, 0x00000043, 0x00000001, PlayerLandJump, 0x00000043, 0x00000004, SetAnimation, 0x00000000, 0x00000000, 0x0001000C, 0x00000008, 0x00000001, 0x00000002, 0x00000058, 0x00000000, 0x00000043, 0x00000005, ShakeCam, 0x00000001, 0x00000000, 0x00000005, 0xF24A7E80, 0x00000059, 0x00000000, 0x00000043, 0x00000003, PlaySoundAtActor, 0x00000000, 0x00000162, 0x00000043, 0x00000004, SetAnimation, 0x00000000, 0x00000000, 0x00010030, 0x00000008, 0x00000001, 0x0000000A, 0x00000043, 0x00000004, SetAnimation, 0x00000000, 0x00000000, 0x00010031, 0x00000008, 0x00000001, 0x00000014, 0x00000043, 0x00000003, SetBattleFlagBits, 0x00000100, 0x00000000, 0x00000043, 0x00000002, UseBattleCamPreset, 0x00000003, 0x00000043, 0x00000001, func_802693F0, 0x00000043, 0x00000002, EnablePlayerBlur, 0xFFFFFFFF, 0x00000043, 0x00000001, func_80276EFC, 0x00000043, 0x00000002, SetGoalToHome, 0x00000000, 0x00000043, 0x00000003, SetActorSpeed, 0x00000000, 0xF24A9A80, 0x00000043, 0x00000004, SetAnimation, 0x00000000, 0x00000000, 0x00010005, 0x00000043, 0x00000002, PlayerRunToGoal, 0x00000000, 0x00000043, 0x00000004, SetAnimation, 0x00000000, 0x00000000, 0x00010002, 0x00000002, 0x00000000, 0x00000001, 0x00000000
dlabel D_802A2184_749F54
.word 0x00000043, 0x00000002, LoadActionCommand, 0x00000001, 0x00000043, 0x00000001, action_command_jump_CreateHudElements, 0x00000046, 0x00000001, D_802A11AC_748F7C, 0x00000046, 0x00000001, D_802A1320_7490F0, 0x00000043, 0x00000003, func_802A9120_421B10, 0xFE363C8A, 0x00000003, 0x00000043, 0x00000002, UseBattleCamPreset, 0x00000022, 0x00000043, 0x00000002, SetGoalToTarget, 0x00000000, 0x00000043, 0x00000006, SetJumpAnimations, 0x00000000, 0x00000000, 0x00010007, 0x00010008, 0x00030000, 0x00000043, 0x00000003, func_80274A18, 0xFE363C8A, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000002, LoadActionCommand, 0x00000001, 0x00000043, 0x00000001, action_command_jump_CreateHudElements, 0x00000046, 0x00000001, D_802A11AC_748F7C, 0x00000043, 0x00000001, InitTargetIterator, 0x00000046, 0x00000001, D_802A1408_7491D8, 0x00000024, 0x00000002, 0xFE363C8B, 0xFE363C8A, 0x00000027, 0x00000002, 0xFE363C8B, 0x0000000E, 0x00000027, 0x00000002, 0xFE363C8B, 0xFFFFFFFD, 0x00000043, 0x00000003, func_802A9120_421B10, 0xFE363C8B, 0x00000003, 0x00000043, 0x00000002, UseBattleCamPreset, 0x00000025, 0x00000043, 0x00000002, SetGoalToTarget, 0x00000000, 0x00000043, 0x00000006, SetJumpAnimations, 0x00000000, 0x00000000, 0x00010007, 0x0001000A, 0x0001000B, 0x00000043, 0x00000003, func_802752AC, 0xFE363C8A, 0x00000000, 0x00000008, 0x00000001, 0x00000007, 0x00000043, 0x00000002, DidActionSucceed, 0xFE363C80, 0x00000014, 0x00000001, 0xFE363C80, 0x00000019, 0x00000001, 0x00000000, 0x00000043, 0x00000003, func_802752AC, 0x00000003, 0x00000001, 0x0000001C, 0x00000000, 0x00000043, 0x00000003, func_802752AC, 0x00000005, 0x00000001, 0x00000023, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000002, LoadActionCommand, 0x00000001, 0x00000043, 0x00000001, action_command_jump_CreateHudElements, 0x00000046, 0x00000001, D_802A11AC_748F7C, 0x00000046, 0x00000001, D_802A14F0_7492C0, 0x00000043, 0x00000002, func_8026919C, D_802A10F0_748EC0, 0x00000024, 0x00000002, 0xFE363C8B, 0xFE363C8A, 0x00000028, 0x00000002, 0xFE363C8B, 0x00000004, 0x00000027, 0x00000002, 0xFE363C8B, 0xFFFFFFFD, 0x00000043, 0x00000003, func_802A9120_421B10, 0xFE363C8B, 0x00000003, 0x00000043, 0x00000002, UseBattleCamPreset, 0x00000026, 0x00000043, 0x00000002, SetGoalToTarget, 0x00000000, 0x00000043, 0x00000006, SetJumpAnimations, 0x00000000, 0x00000000, 0x00010007, 0x00080000, 0x00030000, 0x00000043, 0x00000003, func_80275F00, 0xFE363C8A, 0x00000000, 0x00000043, 0x00000001, CloseActionCommandInfo, 0x00000024, 0x00000002, 0xFE363C89, 0x00000000, 0x00000043, 0x00000002, DidActionSucceed, 0xFE363C80, 0x0000000D, 0x00000002, 0xFE363C80, 0x00000000, 0x00000024, 0x00000002, 0xFE363C89, 0x00000001, 0x00000043, 0x00000004, SetAnimation, 0x00000000, 0x00000000, 0x00030000, 0x00000043, 0x00000005, SetActorRotation, 0xFFFFFF81, 0x00000000, 0x00000000, 0x00000000, 0x00000043, 0x00000005, SetActorDispOffset, 0xFFFFFF81, 0x00000000, 0xFFFFFFFE, 0x00000000, 0x00000008, 0x00000001, 0x00000002, 0x00000043, 0x00000005, SetActorDispOffset, 0xFFFFFF81, 0x00000000, 0x00000000, 0x00000000, 0x00000043, 0x00000002, LoadActionCommand, 0x00000001, 0x00000043, 0x00000001, action_command_jump_CreateHudElements, 0x00000043, 0x00000003, func_802A9120_421B10, 0x0000000D, 0x00000003, 0x00000043, 0x00000002, UseBattleCamPreset, 0x00000027, 0x00000043, 0x00000003, func_80275F00, 0x0000000F, 0x00000002, 0x00000004, 0x00000001, 0x0000000A, 0x00000012, 0x00000000, 0x00000043, 0x00000002, LoadActionCommand, 0x00000001, 0x00000043, 0x00000001, action_command_jump_CreateHudElements, 0x00000043, 0x00000003, func_802A9120_421B10, 0x00000002, 0x00000003, 0x00000043, 0x00000003, func_80275F00, 0x00000004, 0x00000001, 0x00000004, 0x00000001, 0x0000000A, 0x00000013, 0x00000000, 0x00000003, 0x00000001, 0x0000000A, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000002, func_802694A4, 0x00000001, 0x00000043, 0x00000004, GetMenuSelection, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000014, 0x00000001, 0xFE363C81, 0x00000016, 0x00000001, 0x00000000, 0x00000046, 0x00000001, D_802A2694_74A464, 0x00000016, 0x00000001, 0x00000001, 0x00000046, 0x00000001, D_802A2980_74A750, 0x00000016, 0x00000001, 0x00000002, 0x00000046, 0x00000001, D_802A2CAC_74AA7C, 0x00000023, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000
.word 0x00000043, 0x00000002, LoadActionCommand, 0x00000001, 0x00000043, 0x00000001, action_command_jump_CreateHudElements, 0x00000046, 0x00000001, D_802A11AC_748F7C, 0x00000046, 0x00000001, D_802A1320_7490F0, 0x00000043, 0x00000003, func_802A9120_421B10, 0xFE363C8A, 0x00000003, 0x00000043, 0x00000002, UseBattleCamPreset, 0x00000022, 0x00000043, 0x00000002, SetGoalToTarget, 0x00000000, 0x00000043, 0x00000006, SetJumpAnimations, 0x00000000, 0x00000000, 0x00010007, 0x00010008, 0x00030000, 0x00000043, 0x00000003, func_80274A18, 0xFE363C8A, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000002, LoadActionCommand, 0x00000001, 0x00000043, 0x00000001, action_command_jump_CreateHudElements, 0x00000046, 0x00000001, D_802A11AC_748F7C, 0x00000043, 0x00000001, InitTargetIterator, 0x00000046, 0x00000001, D_802A1408_7491D8, 0x00000024, 0x00000002, 0xFE363C8B, 0xFE363C8A, 0x00000027, 0x00000002, 0xFE363C8B, 0x0000000E, 0x00000027, 0x00000002, 0xFE363C8B, 0xFFFFFFFD, 0x00000043, 0x00000003, func_802A9120_421B10, 0xFE363C8B, 0x00000003, 0x00000043, 0x00000002, UseBattleCamPreset, 0x00000025, 0x00000043, 0x00000002, SetGoalToTarget, 0x00000000, 0x00000043, 0x00000006, SetJumpAnimations, 0x00000000, 0x00000000, 0x00010007, 0x0001000A, 0x0001000B, 0x00000043, 0x00000003, func_802752AC, 0xFE363C8A, 0x00000000, 0x00000008, 0x00000001, 0x00000007, 0x00000043, 0x00000002, DidActionSucceed, 0xFE363C80, 0x00000014, 0x00000001, 0xFE363C80, 0x00000019, 0x00000001, 0x00000000, 0x00000043, 0x00000003, func_802752AC, 0x00000003, 0x00000001, 0x0000001C, 0x00000000, 0x00000043, 0x00000003, func_802752AC, 0x00000005, 0x00000001, 0x00000023, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000002, LoadActionCommand, 0x00000001, 0x00000043, 0x00000001, action_command_jump_CreateHudElements, 0x00000046, 0x00000001, D_802A11AC_748F7C, 0x00000046, 0x00000001, D_802A14F0_7492C0, 0x00000043, 0x00000002, func_8026919C, D_802A10F0_748EC0, 0x00000024, 0x00000002, 0xFE363C8B, 0xFE363C8A, 0x00000028, 0x00000002, 0xFE363C8B, 0x00000004, 0x00000027, 0x00000002, 0xFE363C8B, 0xFFFFFFFD, 0x00000043, 0x00000003, func_802A9120_421B10, 0xFE363C8B, 0x00000003, 0x00000043, 0x00000002, UseBattleCamPreset, 0x00000026, 0x00000043, 0x00000002, SetGoalToTarget, 0x00000000, 0x00000043, 0x00000006, SetJumpAnimations, 0x00000000, 0x00000000, 0x00010007, 0x00080000, 0x00030000, 0x00000043, 0x00000003, func_80275F00, 0xFE363C8A, 0x00000000, 0x00000043, 0x00000001, CloseActionCommandInfo, 0x00000024, 0x00000002, 0xFE363C89, 0x00000000, 0x00000043, 0x00000002, DidActionSucceed, 0xFE363C80, 0x0000000D, 0x00000002, 0xFE363C80, 0x00000000, 0x00000024, 0x00000002, 0xFE363C89, 0x00000001, 0x00000043, 0x00000004, SetAnimation, 0x00000000, 0x00000000, 0x00030000, 0x00000043, 0x00000005, SetActorRotation, 0xFFFFFF81, 0x00000000, 0x00000000, 0x00000000, 0x00000043, 0x00000005, SetActorDispOffset, 0xFFFFFF81, 0x00000000, 0xFFFFFFFE, 0x00000000, 0x00000008, 0x00000001, 0x00000002, 0x00000043, 0x00000005, SetActorDispOffset, 0xFFFFFF81, 0x00000000, 0x00000000, 0x00000000, 0x00000043, 0x00000002, LoadActionCommand, 0x00000001, 0x00000043, 0x00000001, action_command_jump_CreateHudElements, 0x00000043, 0x00000003, func_802A9120_421B10, 0x0000000D, 0x00000003, 0x00000043, 0x00000002, UseBattleCamPreset, 0x00000027, 0x00000043, 0x00000003, func_80275F00, 0x0000000F, 0x00000002, 0x00000004, 0x00000001, 0x0000000A, 0x00000012, 0x00000000, 0x00000043, 0x00000002, LoadActionCommand, 0x00000001, 0x00000043, 0x00000001, action_command_jump_CreateHudElements, 0x00000043, 0x00000003, func_802A9120_421B10, 0x00000002, 0x00000003, 0x00000043, 0x00000003, func_80275F00, 0x00000004, 0x00000001, 0x00000004, 0x00000001, 0x0000000A, 0x00000013, 0x00000000, 0x00000003, 0x00000001, 0x0000000A, 0x00000002, 0x00000000, 0x00000001, 0x00000000
dlabel battle_move_dizzy_stomp_main
.word 0x00000043, 0x00000002, func_802694A4, 0x00000001, 0x00000043, 0x00000004, GetMenuSelection, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000014, 0x00000001, 0xFE363C81, 0x00000016, 0x00000001, 0x00000000, 0x00000046, 0x00000001, D_802A2694_74A464, 0x00000016, 0x00000001, 0x00000001, 0x00000046, 0x00000001, D_802A2980_74A750, 0x00000016, 0x00000001, 0x00000002, 0x00000046, 0x00000001, D_802A2CAC_74AA7C, 0x00000023, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000
dlabel D_802A2694_74A464
.word 0x00000046, 0x00000001, D_802A2184_749F54, 0x00000043, 0x00000007, PlayerTestEnemy, 0xFE363C80, 0x00000080, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x0000000A, 0x00000002, 0xFE363C80, 0x00000006, 0x00000046, 0x00000001, D_802A1FEC_749DBC, 0x00000002, 0x00000000, 0x00000013, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x00000043, 0x00000002, DidActionSucceed, 0xFE363C80, 0x00000014, 0x00000001, 0xFE363C80, 0x00000019, 0x00000001, 0x00000000, 0x00000043, 0x00000005, SetActorSounds, 0x00000000, 0x00000003, 0x0000015A, 0x00000000, 0x00000043, 0x00000007, PlayerDamageEnemy, 0xFE363C80, 0x00000080, 0x00000000, 0x8004034B, 0x00000001, 0x00000050, 0x0000001C, 0x00000000, 0x00000043, 0x00000005, SetActorSounds, 0x00000000, 0x00000003, 0x0000015A, 0x00000000, 0x00000043, 0x00000007, PlayerDamageEnemy, 0xFE363C80, 0x00000080, 0x00000000, 0x8004034B, 0x00000001, 0x00000030, 0x00000023, 0x00000000, 0x00000014, 0x00000001, 0xFE363C80, 0x0000001D, 0x00000001, 0x00000000, 0x0000001D, 0x00000001, 0x00000002, 0x00000046, 0x00000001, D_802A19B0_749780, 0x00000002, 0x00000000, 0x00000020, 0x00000000, 0x0000001D, 0x00000001, 0x00000001, 0x0000001D, 0x00000001, 0x00000003, 0x00000020, 0x00000000, 0x00000023, 0x00000000, 0x00000058, 0x00000000, 0x00000043, 0x00000002, UseBattleCamPreset, 0x0000001B, 0x00000008, 0x00000001, 0x00000005, 0x00000043, 0x00000002, SetGoalToTarget, 0x00000000, 0x00000043, 0x00000002, UseBattleCamPreset, 0x00000023, 0x00000059, 0x00000000, 0x00000043, 0x00000002, func_80269524, 0xFE363C8F, 0x00000043, 0x00000001, CloseActionCommandInfo, 0x00000043, 0x00000002, LoadActionCommand, 0x00000001, 0x00000043, 0x00000001, action_command_jump_CreateHudElements, 0x00000043, 0x00000002, func_802694A4, 0x00000000, 0x00000043, 0x00000003, func_802A9120_421B10, 0x00000018, 0x00000003, 0x00000043, 0x00000002, SetGoalToTarget, 0x00000000, 0x00000043, 0x00000006, SetJumpAnimations, 0x00000000, 0x00000000, 0x00010007, 0x00010008, 0x0001000C, 0x00000043, 0x00000003, func_80274A18, 0x00000018, 0x00000003, 0x00000008, 0x00000001, 0x00000001, 0x00000043, 0x00000005, SetActorSounds, 0x00000000, 0x00000003, 0x0000015A, 0x00000000, 0x00000043, 0x00000007, PlayerDamageEnemy, 0xFE363C80, 0x00000080, 0x00000000, 0x80040364, 0x00000001, 0x000000E0, 0x00000043, 0x00000002, func_80269550, 0xFE363C8F, 0x00000046, 0x00000001, D_802A15D8_7493A8, 0x00000002, 0x00000000, 0x00000001, 0x00000000

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -69,7 +69,10 @@ dlabel D_802A3D00_755150
.word 0x00000004, 0x0000000D, 0x00000001, 0x0000003C, D_802A3AE8_754F38, 0x00000002, 0x00000000
dlabel D_802A3D1C_75516C
.word 0x00000004, 0x0000000D, 0x00000001, 0x0000003C, D_802A3BD8_755028, 0x00000002, 0x00000000, 0x00000043, 0x00000002, func_802694A4, 0x00000001, 0x00000043, 0x00000004, GetMenuSelection, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000014, 0x00000001, 0xFE363C81, 0x00000016, 0x00000001, 0x00000000, 0x00000024, 0x00000002, 0xFE363C8D, 0x00000032, 0x00000024, 0x00000002, 0xFE363C8E, 0x00000001, 0x00000024, 0x00000002, 0xFE363C8F, 0x00000002, 0x00000046, 0x00000001, D_802A42E8_755738, 0x00000016, 0x00000001, 0x00000001, 0x00000024, 0x00000002, 0xFE363C8D, 0x00000032, 0x00000024, 0x00000002, 0xFE363C8E, 0x00000002, 0x00000024, 0x00000002, 0xFE363C8F, 0x00000004, 0x00000046, 0x00000001, D_802A42E8_755738, 0x00000016, 0x00000001, 0x00000002, 0x00000024, 0x00000002, 0xFE363C8D, 0x00000032, 0x00000024, 0x00000002, 0xFE363C8E, 0x00000003, 0x00000024, 0x00000002, 0xFE363C8F, 0x00000006, 0x00000046, 0x00000001, D_802A42E8_755738, 0x00000023, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000
.word 0x00000004, 0x0000000D, 0x00000001, 0x0000003C, D_802A3BD8_755028, 0x00000002, 0x00000000
dlabel battle_move_hammer_throw_main
.word 0x00000043, 0x00000002, func_802694A4, 0x00000001, 0x00000043, 0x00000004, GetMenuSelection, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000014, 0x00000001, 0xFE363C81, 0x00000016, 0x00000001, 0x00000000, 0x00000024, 0x00000002, 0xFE363C8D, 0x00000032, 0x00000024, 0x00000002, 0xFE363C8E, 0x00000001, 0x00000024, 0x00000002, 0xFE363C8F, 0x00000002, 0x00000046, 0x00000001, D_802A42E8_755738, 0x00000016, 0x00000001, 0x00000001, 0x00000024, 0x00000002, 0xFE363C8D, 0x00000032, 0x00000024, 0x00000002, 0xFE363C8E, 0x00000002, 0x00000024, 0x00000002, 0xFE363C8F, 0x00000004, 0x00000046, 0x00000001, D_802A42E8_755738, 0x00000016, 0x00000001, 0x00000002, 0x00000024, 0x00000002, 0xFE363C8D, 0x00000032, 0x00000024, 0x00000002, 0xFE363C8E, 0x00000003, 0x00000024, 0x00000002, 0xFE363C8F, 0x00000006, 0x00000046, 0x00000001, D_802A42E8_755738, 0x00000023, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000
dlabel D_802A3E5C_7552AC
.word 0x00000043, 0x00000002, SetGoalToTarget, 0x00000000, 0x00000043, 0x00000005, AddGoalPos, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000024, 0x00000002, 0xFE363C81, 0x00000000, 0x00000005, 0x00000001, 0x0000000A, 0x00000043, 0x00000003, CheckButtonDown, 0x00040000, 0xFE363C80, 0x0000000A, 0x00000002, 0xFE363C80, 0x00000001, 0x00000043, 0x00000004, SetAnimation, 0x00000000, 0x00000000, 0x00010002, 0x00000007, 0x00000000, 0x00000013, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x00000027, 0x00000002, 0xFE363C81, 0x00000001, 0x00000043, 0x00000004, SetAnimation, 0x00000000, 0x00000000, 0x00040016, 0x00000006, 0x00000000, 0x00000043, 0x00000004, SetAnimation, 0x00000000, 0x00000000, 0x00040016, 0x00000014, 0x00000001, 0xFE363C81, 0x00000018, 0x00000001, 0x00000003, 0x00000008, 0x00000001, 0x00000004, 0x00000018, 0x00000001, 0x00000005, 0x00000008, 0x00000001, 0x00000003, 0x00000018, 0x00000001, 0x00000007, 0x00000008, 0x00000001, 0x00000002, 0x00000018, 0x00000001, 0x00000009, 0x00000008, 0x00000001, 0x00000001, 0x00000018, 0x00000001, 0x0000000B, 0x00000008, 0x00000001, 0x00000000, 0x00000023, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More