Compiler's Worst Nightmare (#278)

* 25.00%

* remove __naked__ and name printContext->unk_4E8

* change rodata strings to []

* actually remove

* fix headers

* git subrepo pull --force tools/splat

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

* progress

* .

* .

* some stuff

* git subrepo pull --force tools/splat

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

* :OK:

* 2 graphics funcs!

* woo

* more

* match func_802A15A0_733670 (#276)

* .

* gfx_draw_frame, other fixes

* macros begone!

Co-authored-by: pixel-stuck <mathmcclintic@gmail.com>
This commit is contained in:
Ethan Roseman 2021-04-23 20:55:30 +09:00 committed by GitHub
parent b786f3860b
commit 011a957985
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
105 changed files with 1105 additions and 1844 deletions

View File

@ -30,12 +30,13 @@ s32 get_area_byte(s32 index);
s32 get_area_flag(s32 index);
Shadow* get_shadow_by_index(s32 index);
s32 get_time_freeze_mode(void);
void render_player_model();
f32 integrate_gravity(void);
f32 get_clamped_angle_diff(f32, f32);
void _render_transition_stencil(s32, f32, s32);
u32 get_entity_type(s32 arg0);
Entity* get_entity_by_index(s32 index);
s32 create_entity(StaticEntityData*, s32, s32, s32, s32, s32);

View File

@ -8,7 +8,17 @@
#ifndef INCLUDE_ASM
#define INCLUDE_ASM(TYPE, FOLDER, NAME, ARGS...) \
TYPE NAME(ARGS); \
TYPE __attribute__((naked)) NAME(ARGS) { __asm__( ".section .text\n.include \"ver/"STRINGIFY(VERSION)"/asm/nonmatchings/"FOLDER"/"#NAME".s\"\n.set reorder\n.set at"); }
__asm__( \
".section .text\n" \
"\t.align\t2\n" \
"\t.globl\t"#NAME"\n" \
"\t.ent\t"#NAME"\n" \
#NAME ":\n" \
"\t.include \"ver/"STRINGIFY(VERSION)"/asm/nonmatchings/"FOLDER"/"#NAME".s\"\n" \
"\t.set reorder\n" \
"\t.set at\n" \
"\t.end\t"#NAME \
);
#endif
__asm__(".include \"include/macro.inc\"\n");
#ifdef MOVE_ADDU

View File

@ -20,15 +20,10 @@
#define CAM(id) (&gCameras[id])
#define CAM2(id) ({ Camera* c = gCameras; &c[id]; })
#define CURRENT_CAM (&gCameras[gCurrentCameraID])
#define BADGE_MENU_PAGE(index) (&gBadgeMenuPages[index])
#define ITEM_MENU_PAGE(index) (&gItemMenuPages[index])
#define OVERRIDE_FLAG_SET(flag) { s32* overrideFlags = &gOverrideFlags; *overrideFlags |= flag; }
#define OVERRIDE_FLAG_UNSET(flag) { s32* overrideFlags = &gOverrideFlags; *overrideFlags &= ~flag; }
#define OVERRIDE_FLAG_CHECK(flag) ({ s32* overrideFlags = &gOverrideFlags; *overrideFlags & flag; })
#define MAX_MAPVARS 16
#define MAX_MAPFLAGS 3
@ -53,10 +48,8 @@
//NOTE: SCRIPT_ALLOC is probably not quite correct, but this is the closest thing to matching for the functions its used in. Needs more work.
#define SCRIPT_ALLOC(new, index) \
{ \
ScriptList** temp = &gCurrentScriptListPtr; \
s32 *numScripts = &gNumScripts; \
(**temp)[index] = new = heap_malloc(sizeof(ScriptInstance)); \
(*numScripts)++; \
(*gCurrentScriptListPtr)[index] = new = heap_malloc(sizeof(ScriptInstance)); \
gNumScripts++; \
ASSERT(new != NULL); \
}
@ -79,8 +72,4 @@
#define ASCII_TO_U32(a, b, c, d) ((u32)((a << 24) | (b << 16) | (c << 8) | (d << 0)))
#define CLAMP(x, min, max) ((x) < (min) ? (min) : (x) > (max) ? (max) : (x))
#define CLAMP_MAX(x, max) ((x) > (max) ? (max) : (x))
#define CLAMP_MIN(x, min) ((x) < (min) ? (min) : (x))
#endif

View File

@ -77,7 +77,7 @@ extern "C" {
#define NU_SC_UCODE_XBUS 0x0004 /* XBUS Ucode */
#define NU_SC_TASK_YIELDED (OS_TASK_YIELEDE<<16)
#define NU_SC_TASK_DP_WAIT (OS_TASK_DP_WAIT<<16) /* RDP WAIT */
#define NU_SC_TASK_LODABLE (OS_TASK_LOADBLE<<16) /* LOADABLE */
#define NU_SC_TASK_LODABLE (OS_TASK_LOADABLE<<16) /* LOADABLE */
#define NU_SC_TASK_SP_ONLY (OS_TASK_SP_ONLY<<16) /* SP ONLY */

View File

@ -99,7 +99,7 @@ extern s32 D_802E99DC;
extern Entity* D_802EB3A0;
extern s32 D_8015C7D0[3]; // not size 3
extern f32 D_800F7B70[];
extern f32 D_800F7B70[4];
extern UNK_TYPE D_0A0031E0;
extern UNK_TYPE D_0A001508;

View File

@ -43,7 +43,7 @@ void state_init_file_select(void) {
cameras[0].unk_1C = 0;
cameras[0].unk_20 = 100;
cameras[0].unk_22 = 0;
OVERRIDE_FLAG_SET(0x10000);
gOverrideFlags |= 0x10000;
}
INCLUDE_ASM(s32, "10400_len_d30", state_step_language_select);
@ -65,7 +65,7 @@ void func_800355D4(void) {
set_transition_stencil_zoom_0(0, D_800A0932[0]);
}
D_800A0930 = 1;
OVERRIDE_FLAG_UNSET(0x40);
gOverrideFlags &= ~0x40;
}
void func_80035660(void) {
@ -77,10 +77,10 @@ void func_80035660(void) {
set_map_transition_effect(7);
} else {
set_map_transition_effect(8);
OVERRIDE_FLAG_UNSET(0x0010000);
gOverrideFlags &= ~0x0010000;
bgm_set_song(0, -1, 0, 1000, 8);
}
OVERRIDE_FLAG_UNSET(0x40);
gOverrideFlags &= ~0x40;
}
INCLUDE_ASM(s32, "10400_len_d30", func_80035704);

View File

@ -100,7 +100,7 @@ void func_802E54CC(Entity* entity) {
*ptr = 0;
load_string(0x1D0001, ptr);
set_time_freeze_mode(1);
OVERRIDE_FLAG_SET(0x40);
gOverrideFlags |= 0x40;
disable_player_input();
set_global_flag(SI_SAVE_FLAG(96));
return;
@ -112,7 +112,7 @@ void func_802E555C(Entity* entity) {
if (D_802EB3C0) {
exec_entity_updatecmd(entity);
set_time_freeze_mode(0);
OVERRIDE_FLAG_UNSET(0x40);
gOverrideFlags &= ~0x40;
enable_player_input();
}
}

View File

@ -37,15 +37,14 @@ u32 func_80025D74(void* arg0, const unsigned char* str, s32 count) {
s32 pos;
s32 start;
s32 end;
OSPiHandle** handle = &carthandle;
osEPiReadIo(*handle, 0xB3FF0000, &data);
osEPiReadIo(carthandle, 0xB3FF0000, &data);
if (data != ASCII_TO_U32('I', 'S', '6', '4')) {
return 1;
}
osEPiReadIo(*handle, 0xB3FF0004, &data);
osEPiReadIo(carthandle, 0xB3FF0004, &data);
pos = data;
osEPiReadIo(*handle, 0xB3FF0014, &data);
osEPiReadIo(carthandle, 0xB3FF0014, &data);
start = data;
end = start + count;
if (end >= 0xffe0) {
@ -62,10 +61,9 @@ u32 func_80025D74(void* arg0, const unsigned char* str, s32 count) {
if (*str) {
u32 addr = 0xB3FF0020 + (start & 0xffffffc);
s32 shift = ((3 - (start & 3)) * 8);
OSPiHandle** handle2 = &carthandle;
osEPiReadIo(*handle2, addr, &data);
osEPiWriteIo(*handle2, addr, (data & ~(0xff << shift)) | (*str << shift));
osEPiReadIo(carthandle, addr, &data);
osEPiWriteIo(carthandle, addr, (data & ~(0xff << shift)) | (*str << shift));
start++;
if (start >= 0xffe0) {

View File

@ -61,7 +61,7 @@ void func_802E8ADC(Entity* entity) {
PlayerStatus* playerStatus = &gPlayerStatus;
if ((entity->unk_06 & 1) != 0) {
OVERRIDE_FLAG_SET(0x40);
gOverrideFlags |= 0x40;
if (!(playerStatus->flags & 0x3000)) {
s32 stickAxis0 = abs(playerStatus->stickAxis[0]);
@ -74,13 +74,12 @@ void func_802E8ADC(Entity* entity) {
}
}
} else {
OVERRIDE_FLAG_UNSET(0x40);
gOverrideFlags &= ~0x40;
}
}
void func_802E8BC0(Entity* entity) {
PlayerStatus* playerStatus = &gPlayerStatus;
PlayerStatus* playerStatus2 = &gPlayerStatus;
struct802E89B0* temp = entity->dataBuf;
MapConfig* mapConfig = get_current_map_header();
f32 temp_f20;
@ -96,10 +95,10 @@ void func_802E8BC0(Entity* entity) {
entryX = (*mapConfig->entryList)[temp->unk_0C].x;
entryZ = (*mapConfig->entryList)[temp->unk_0C].z;
temp_f20 = atan2(playerStatus2->position.x, playerStatus2->position.z, entryX, entryZ);
temp_f20 = atan2(playerStatus->position.x, playerStatus->position.z, entryX, entryZ);
disable_player_input();
disable_player_static_collisions();
move_player(temp->unk_04, temp_f20, playerStatus2->runSpeed);
move_player(temp->unk_04, temp_f20, playerStatus->runSpeed);
}
void func_802E8C94(Entity* entity) {
@ -114,7 +113,7 @@ void player_enter_blue_pipe(Entity* bluePipe) {
PlayerStatus* playerStatus = &gPlayerStatus;
Trigger* pipeTrigger = (Trigger*)bluePipe->dataBuf; // TODO: is Trigger correct?
playerStatus->targetYaw = CURRENT_CAM->currentYaw + 180.0f;
playerStatus->targetYaw = gCameras[gCurrentCameraID].currentYaw + 180.0f;
pipeTrigger->params1 = 0x19;
playerStatus->renderMode = 0xD;
@ -141,7 +140,7 @@ void func_802E8D74(Entity* entity) {
void func_802E8E10(Entity* entity) {
Bytecode* triggerScriptStart = ((Trigger*)entity->dataBuf)->scriptStart;
OVERRIDE_FLAG_UNSET(0x40);
gOverrideFlags &= ~0x40;
entity->boundScript = triggerScriptStart;
func_80110678(entity);
}

View File

@ -31,7 +31,7 @@ void func_80035E54(void) {
nuContRmbForceStopEnd();
func_801382AC(mapTransitonAlpha);
OVERRIDE_FLAG_SET(0x8);
gOverrideFlags |= 0x8;
set_variable(0, SI_SAVE_VAR(1), (*gameStatus)->unk_A9);
timeFreezeMode = 0;

View File

@ -1,20 +1,130 @@
#include "common.h"
void title_draw_copyright(f32);
s16 D_800779C0[] = {0, 0};
s32 D_800779C4 = 0;
s8 D_800779C8[] = {0, 0};
s8 D_800779CA = 0;
s8 D_800779CB = 0x45;
s32 D_800779CC = 0x52524F52;
s32 D_800779D0 = 0xF7F7F700;
s32 D_800779D4 = 0;
s32 D_800779D8[] = { 0x00000000, 0x00000000, 0x00000045, 0x52524F52, 0xF7F7F700, 0x00000000, 0x00000000, 0x00000000,
0x00000045, 0x52524F52, 0xF7F7F700, 0x00000000, 0x00000000, 0x00000000, 0x00000045, 0x52524F52,
0xF7F7F700, 0x00000000, 0x00000000, };
s32 D_80077A24 = 0x01010101;
s32 D_80077A28 = 0;
s32 D_80077A2C = 0;
s32 D_80077A30 = 0;
s32 D_80077A34[] = {0x00000000, 0xFFFFFF00, 0xFFFFFF00};
s32 D_80077A40[] = {0, 0, 0, 0};
Gfx D_80077A50[] = {
gsDPPipeSync(),
gsDPSetCycleType(G_CYC_1CYCLE),
gsDPSetRenderMode(G_RM_CLD_SURF, G_RM_CLD_SURF2),
gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA),
gsDPSetTextureFilter(G_TF_POINT),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetTexturePersp(G_TP_NONE),
gsDPSetColorDither(G_CD_DISABLE),
gsDPSetAlphaDither(G_AD_DISABLE),
gsDPSetTextureLOD(G_TL_TILE),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureDetail(G_TD_CLAMP),
gsDPSetTextureConvert(G_TC_FILT),
gsDPSetCombineKey(G_CK_NONE),
gsDPSetAlphaCompare(G_AC_NONE),
gsDPNoOp(),
gsDPSetScissor(G_SC_NON_INTERLACE, 0, 0, 320, 240),
gsSPEndDisplayList(),
};
extern s32 D_80077A2B;
extern s32 D_800A0980;
INCLUDE_ASM(s32, "121f0_len_1290", begin_state_title_screen);
INCLUDE_ASM(s32, "121f0_len_1290", step_title_screen);
INCLUDE_ASM(s32, "121f0_len_1290", func_800375A4);
void func_800375A4(void) {
switch (gGameStatusPtr->loadMenuState) {
case 0:
D_80077A28 = 0;
D_80077A2C = 0;
D_80077A30 = 0;
func_80037960();
break;
case 2:
func_80037960();
if (gGameStatusPtr->contBitPattern & 1) {
title_draw_press_start();
}
default:
break;
case 1:
case 4:
case 5:
func_80037960();
break;
}
}
INCLUDE_ASM(s32, "121f0_len_1290", title_append_gfx);
void func_80037960(void) {
}
INCLUDE_ASM(s32, "121f0_len_1290", title_draw_images);
void title_draw_images(f32 arg0, f32 arg1) {
title_draw_logo();
title_draw_copyright(arg1);
}
INCLUDE_ASM(s32, "121f0_len_1290", title_draw_logo);
INCLUDE_ASM(void, "121f0_len_1290", title_draw_logo);
INCLUDE_ASM(s32, "121f0_len_1290", title_draw_press_start);
void title_draw_press_start(void) {
switch (D_80077A2C) {
case 0:
D_80077A28 -= 128;
if (D_80077A28 < 0) {
D_80077A28 = 0;
}
INCLUDE_ASM(s32, "121f0_len_1290", title_draw_copyright);
D_80077A30++;
if (D_80077A30 >= 16) {
D_80077A30 = 0;
D_80077A2C = 1;
}
break;
case 1:
D_80077A28 += 128;
if (D_80077A28 > 255) {
D_80077A28 = 255;
}
D_80077A30++;
if (D_80077A30 >= 16) {
D_80077A30 = 0;
D_80077A2C = 0;
}
}
gSPDisplayList(gMasterGfxPos++, D_80077A50);
gDPSetCombineMode(gMasterGfxPos++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM);
gDPSetPrimColor(gMasterGfxPos++, 0, 0, 0xF8, 0xF0, 0x98, D_80077A28);
gDPPipeSync(gMasterGfxPos++);
gDPSetTextureImage(gMasterGfxPos++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, D_800A0980);
gDPSetTile(gMasterGfxPos++, G_IM_FMT_IA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
gDPLoadSync(gMasterGfxPos++);
gDPLoadBlock(gMasterGfxPos++, G_TX_LOADTILE, 0, 0, 2047, 128);
gDPPipeSync(gMasterGfxPos++);
gDPSetTile(gMasterGfxPos++, G_IM_FMT_IA, G_IM_SIZ_8b, 16, 0x0000, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
gDPSetTileSize(gMasterGfxPos++, G_TX_RENDERTILE, 0, 0, 0x01FC, 0x007C);
gSPTextureRectangle(gMasterGfxPos++, 0x0180, 0x0224, 0x0380, 0x02A4, G_TX_RENDERTILE, 0, 0, 0x0400, 0x0400);
gDPPipeSync(gMasterGfxPos++);
}
INCLUDE_ASM(void, "121f0_len_1290", title_draw_copyright, f32 arg0);

View File

@ -1,16 +1,14 @@
#include "common.h"
void init_demo_data(void) {
GameStatus** gameStatus = &gGameStatusPtr;
if ((*gameStatus)->demoState == 0) {
(*gameStatus)->nextDemoScene = 0;
(*gameStatus)->demoState = 1;
if (gGameStatusPtr->demoState == 0) {
gGameStatusPtr->nextDemoScene = 0;
gGameStatusPtr->demoState = 1;
}
(*gameStatus)->demoButtonInput = 0;
(*gameStatus)->demoStickX = 0;
(*gameStatus)->demoStickY = 0;
gGameStatusPtr->demoButtonInput = 0;
gGameStatusPtr->demoStickX = 0;
gGameStatusPtr->demoStickY = 0;
func_80056228();
set_map_transition_effect(2);

View File

@ -80,6 +80,7 @@ INCLUDE_ASM(s32, "16F740", func_80242FE0);
void func_80243910(void) {
}
#ifdef NON_MATCHING
void switch_order(void) {
BattleStatus* battleStatus = &gBattleStatus;
@ -96,19 +97,21 @@ void switch_order(void) {
dma_copy(_415D90_ROM_START, _415D90_ROM_END, _415D90_VRAM);
// TODO Needed to match
if (0) { s32 new_var; do { } while (new_var); }
// // TODO Needed to match
// if (0) { s32 new_var; do { } while (new_var); }
if (battleStatus->flags1 & 0x80000) {
func_80241190(14);
} else if (gBattleStatus.battleState == 70) {
s32 oldBattleState = gBattleStatus.battleState;
} else if (battleStatus->battleState == 70) {
func_80241190(13);
gBattleStatus.battleState = oldBattleState;
battleStatus->battleState = 70;
} else {
func_80241190(13);
}
}
#else
INCLUDE_ASM(s32, "16F740", switch_order);
#endif
void func_802439D0(void) {
}
@ -236,17 +239,15 @@ INCLUDE_ASM(s32, "16F740", func_80248190);
void func_802485FC(void) {
if (D_8029F254 != 0) {
s32* temp_v0 = &D_80280A30;
if (*temp_v0 == 0) {
if (D_80280A30 == 0) {
set_transition_stencil_zoom_0(255, -1.0f);
} else {
*temp_v0 -= 20;
if (*temp_v0 < 0) {
*temp_v0 = 0;
D_80280A30 -= 20;
if (D_80280A30 < 0) {
D_80280A30 = 0;
}
set_transition_stencil_zoom_0(0, *temp_v0);
set_transition_stencil_zoom_0(0, D_80280A30);
}
}
}
@ -255,17 +256,15 @@ INCLUDE_ASM(s32, "16F740", func_80248660);
void func_80248AA4(void) {
if (D_8029F254 != 0) {
s32* temp_v0 = &D_80280A30;
if (*temp_v0 == 0) {
if (D_80280A30 == 0) {
set_transition_stencil_zoom_0(255, -1.0f);
} else {
*temp_v0 -= 20;
if (*temp_v0 < 0) {
*temp_v0 = 0;
D_80280A30 -= 20;
if (D_80280A30 < 0) {
D_80280A30 = 0;
}
set_transition_stencil_zoom_0(0, *temp_v0);
set_transition_stencil_zoom_0(0, D_80280A30);
}
}
}

View File

@ -59,7 +59,7 @@ ApiStatus ActorSpeak(ScriptInstance* script, s32 isInitialCall) {
clamp_printer_coords(gSpeakingActorPrintCtx, screenX, screenY);
script->functionTemp[0].s = 0;
OVERRIDE_FLAG_SET(0x10);
gOverrideFlags |= 0x10;
if (gSpeakingActorTalkAnim >= 0) {
func_80263E08(actor, part, gSpeakingActorTalkAnim);
}
@ -100,7 +100,7 @@ ApiStatus ActorSpeak(ScriptInstance* script, s32 isInitialCall) {
if (gSpeakingActorPrintIsDone == 1) {
decrement_status_menu_disabled();
OVERRIDE_FLAG_UNSET(0x10);
gOverrideFlags &= ~0x10;
return ApiStatus_DONE1;
}
}
@ -150,14 +150,13 @@ INCLUDE_ASM(s32, "181810", LoadBattleDmaData);
ApiStatus func_802536A8(ScriptInstance* script, s32 isInitialCall) {
BattleStatus* battleStatus = &gBattleStatus;
BattleStatus* battleStatus2 = battleStatus;
if (get_variable(script, *script->ptrReadPos) != 0) {
battleStatus2->unk_92 |= 1;
OVERRIDE_FLAG_SET(0x80);
battleStatus->unk_92 |= 1;
gOverrideFlags |= 0x80;
} else {
battleStatus2->unk_92 &= ~1;
OVERRIDE_FLAG_UNSET(0x80);
battleStatus->unk_92 &= ~1;
gOverrideFlags &= ~0x80;
}
return ApiStatus_DONE2;

View File

@ -1472,6 +1472,27 @@ void remove_player_buffs(PlayerBuff buffs) {
INCLUDE_ASM(s32, "190B20", func_8026777C);
INCLUDE_ASM(s32, "190B20", func_8026787C);
// extern s32 D_80293970;
// void func_8026787C(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s16 arg4, s16 arg5, s16 arg6, s16 arg7) {
// gDPPipeSync(gMasterGfxPos++);
// gSPDisplayList(gMasterGfxPos++, &D_80293970);
// if ((arg3 & 0xFF) == 0xFF) {
// gDPSetRenderMode(gMasterGfxPos++, G_RM_OPA_SURF, G_RM_OPA_SURF2);
// gDPSetCombineLERP(gMasterGfxPos++, 0, 0, 0, PRIMITIVE, 0, 0, 0, 1, 0, 0, 0, PRIMITIVE, 0, 0, 0, 1);
// } else {
// gDPSetRenderMode(gMasterGfxPos++, G_RM_XLU_SURF, G_RM_XLU_SURF2);
// gDPSetCombineMode(gMasterGfxPos++, G_CC_PRIMITIVE, G_CC_PRIMITIVE);
// }
// gDPSetPrimColor(gMasterGfxPos++, 0, 0, arg0, arg1, arg2, arg3);
// gDPFillRectangle(gMasterGfxPos++, arg4, arg5, arg6, arg7);
// gDPPipeSync(gMasterGfxPos++);
// gDPSetRenderMode(gMasterGfxPos++, G_RM_TEX_EDGE, G_RM_TEX_EDGE2);
// gDPSetCombineMode(gMasterGfxPos++, G_CC_DECALRGBA, G_CC_DECALRGBA);
// }
INCLUDE_ASM(s32, "190B20", func_80267A3C);

View File

@ -109,9 +109,9 @@ ApiStatus MerleeStopFX(ScriptInstance* script, s32 isInitialCall) {
}
ApiStatus GetCamLookAtObjVector(ScriptInstance* script, s32 isInitialCall) {
script->varTable[0] = CURRENT_CAM->lookAt_obj.x;
script->varTable[1] = CURRENT_CAM->lookAt_obj.y;
script->varTable[2] = CURRENT_CAM->lookAt_obj.z;
script->varTable[0] = gCameras[gCurrentCameraID].lookAt_obj.x;
script->varTable[1] = gCameras[gCurrentCameraID].lookAt_obj.y;
script->varTable[2] = gCameras[gCurrentCameraID].lookAt_obj.z;
return ApiStatus_DONE2;
}

View File

@ -47,10 +47,6 @@ void gfx_draw_background(void);
void step_game_loop(void) {
PlayerData* playerData = &gPlayerData;
s8* temp80074021;
s16* temp80074182;
s16* temp800741A0;
s16* temp8009A690;
update_input();
@ -63,11 +59,10 @@ void step_game_loop(void) {
update_max_rumble_duration();
temp80074021 = &D_80074021;
if (*temp80074021 != 0) {
(*temp80074021)-- ;
if (*temp80074021 == 0) {
*temp80074021 = D_80074020;
if (D_80074021 != 0) {
D_80074021-- ;
if (D_80074021 == 0) {
D_80074021 = D_80074020;
} else {
return;
}
@ -89,32 +84,29 @@ void step_game_loop(void) {
update_windows();
update_curtains();
if (OVERRIDE_FLAG_CHECK(0x20)) {
temp80074182 = &D_800741A2;
switch (*temp80074182) {
if (gOverrideFlags & 0x20) {
switch (D_800741A2) {
case 0:
OVERRIDE_FLAG_SET(0x200);
gOverrideFlags |= 0x200;
disable_player_input();
temp800741A0 = &D_800741A0;
if (*temp800741A0 == 255) {
*temp80074182 = 1;
if (D_800741A0 == 255) {
D_800741A2 = 1;
D_8009A690 = 3;
} else {
*temp800741A0 += 10;
if (*temp800741A0 > 255) {
*temp800741A0 = 255;
D_800741A0 += 10;
if (D_800741A0 > 255) {
D_800741A0 = 255;
}
}
break;
case 1:
OVERRIDE_FLAG_SET(0x8);
temp8009A690 = &D_8009A690;
(*temp8009A690)--;
if (*temp8009A690 == 0) {
gOverrideFlags |= 0x8;
D_8009A690--;
if (D_8009A690 == 0) {
sfx_stop_env_sounds();
set_game_mode(0);
OVERRIDE_FLAG_UNSET(0x20);
gOverrideFlags &= ~0x20;
}
break;
}
@ -123,59 +115,126 @@ void step_game_loop(void) {
D_800741A2 = 0;
}
if (OVERRIDE_FLAG_CHECK(0x100)) {
OVERRIDE_FLAG_SET(0x1000);
if (gOverrideFlags & 0x100) {
gOverrideFlags |= 0x1000;
} else {
OVERRIDE_FLAG_UNSET(0x1000);
gOverrideFlags &= ~0x1000;
}
if (OVERRIDE_FLAG_CHECK(0x200)) {
OVERRIDE_FLAG_SET(0x2000);
if (gOverrideFlags & 0x200) {
gOverrideFlags |= 0x2000;
} else {
OVERRIDE_FLAG_UNSET(0x2000);
gOverrideFlags &= ~0x2000;
}
if (OVERRIDE_FLAG_CHECK(0x400)) {
OVERRIDE_FLAG_SET(0x4000);
if (gOverrideFlags & 0x400) {
gOverrideFlags |= 0x4000;
} else {
OVERRIDE_FLAG_UNSET(0x4000);
gOverrideFlags &= ~0x4000;
}
if (OVERRIDE_FLAG_CHECK(0x800)) {
OVERRIDE_FLAG_SET(0x8000);
if (gOverrideFlags & 0x800) {
gOverrideFlags |= 0x8000;
} else {
OVERRIDE_FLAG_UNSET(0x8000);
gOverrideFlags &= ~0x8000;
}
rand_int(1);
}
void gfx_task_background(void) {
DisplayContext** gDisplayContextPtr = &gDisplayContext;
Gfx** gfx = &gMasterGfxPos;
DisplayContext* dispContexts = D_80164000;
*gDisplayContextPtr = &dispContexts[gCurrentDisplayContextIndex];
*gfx = &(*gDisplayContextPtr)->backgroundGfx[0];
gDisplayContext = &D_80164000[gCurrentDisplayContextIndex];
gMasterGfxPos = &gDisplayContext->backgroundGfx[0];
gfx_init_state();
gfx_draw_background();
gDPFullSync((*gfx)++);
gSPEndDisplayList((*gfx)++);
gDPFullSync(gMasterGfxPos++);
gSPEndDisplayList(gMasterGfxPos++);
// TODO these << 3 >> 3 shouldn't be necessary. There's almost definitely something we're missing here...
ASSERT((s32)((u32)((*gfx) - (*gDisplayContextPtr)->backgroundGfx) << 3 >> 3) < ARRAY_COUNT((
*gDisplayContextPtr)->backgroundGfx));
ASSERT((s32)((u32)((gMasterGfxPos - gDisplayContext->backgroundGfx) << 3) >> 3) < ARRAY_COUNT(gDisplayContext->backgroundGfx))
nuGfxTaskStart(&gDisplayContext->backgroundGfx[0], (gMasterGfxPos - gDisplayContext->backgroundGfx) << 3,
nuGfxTaskStart(&gDisplayContext->backgroundGfx[0], (u32)(gMasterGfxPos - gDisplayContext->backgroundGfx) * 8,
NU_GFX_UCODE_F3DEX2, NU_SC_NOSWAPBUFFER);
}
INCLUDE_ASM(s32, "1b40_len_20b0", gfx_draw_frame);
void gfx_draw_frame(void) {
gMatrixListPos = 0;
gMasterGfxPos = &gDisplayContext->mainGfx[0];
if (gOverrideFlags & 8) {
gCurrentDisplayContextIndex = gCurrentDisplayContextIndex ^ 1;
return;
}
gSPMatrix(gMasterGfxPos++, D_800741A8, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
func_802DDA60(gDisplayContext, &gMasterGfxPos);
if (!(gOverrideFlags & 2)) {
render_frame(0);
}
func_800E0260();
func_802C3EE4();
render_transition_stencil_lower();
render_dynamic_entities_backUI();
func_80142210();
func_80059F94();
render_ui();
if (!(gOverrideFlags & 0x10000)) {
render_window_root();
}
if (!(gOverrideFlags & 2) && gGameStatusPtr->disableScripts == 0) {
render_frame(1);
}
if (!(gOverrideFlags & 0x100010)) {
render_messages();
}
render_dynamic_entities_frontUI();
func_8014271C();
render_transition_stencil_upper();
if ((gOverrideFlags & 0x100010) == 0x10) {
render_messages();
}
render_curtains();
if (gOverrideFlags & 0x100000) {
render_messages();
}
if (gOverrideFlags & 0x10000) {
render_window_root();
}
func_80112FC4();
if (gOverrideFlags & 0x20) {
switch (D_800741A2) {
case 0:
case 1:
_render_transition_stencil(7, D_800741A0, 0);
break;
}
}
ASSERT((s32)(((u32)(gMasterGfxPos - gDisplayContext->mainGfx) << 3) >> 3) < ARRAY_COUNT(gDisplayContext->mainGfx));
gDPFullSync(gMasterGfxPos++);
gSPEndDisplayList(gMasterGfxPos++);
nuGfxTaskStart(gDisplayContext->mainGfx, (u32)(gMasterGfxPos - gDisplayContext->mainGfx) * 8, NU_GFX_UCODE_F3DEX2,
NU_SC_TASK_LODABLE | NU_SC_SWAPBUFFER);
gCurrentDisplayContextIndex = gCurrentDisplayContextIndex ^ 1;
func_8002C890(D_8009A64C, 0x140, 0xF0);
}
void load_engine_data(void) {
GameStatus** gameStatus = &gGameStatusPtr;
s32 i;
dma_copy(FEE30_ROM_START, FEE30_ROM_END, FEE30_VRAM);
@ -186,19 +245,19 @@ void load_engine_data(void) {
dma_copy(_10CC10_ROM_START, _10CC10_ROM_END, _10CC10_VRAM);
gOverrideFlags = 0;
(*gameStatus)->unk_79 = 0;
(*gameStatus)->enableBackground = 0;
(*gameStatus)->musicEnabled = 1;
(*gameStatus)->unk_7C = 1;
(*gameStatus)->unk_A8 = -1;
(*gameStatus)->unk_AA = 0;
(*gameStatus)->unk_81 = 0;
(*gameStatus)->unk_82 = -8;
(*gameStatus)->unk_83 = 4;
gGameStatusPtr->unk_79 = 0;
gGameStatusPtr->enableBackground = 0;
gGameStatusPtr->musicEnabled = 1;
gGameStatusPtr->unk_7C = 1;
gGameStatusPtr->unk_A8 = -1;
gGameStatusPtr->unk_AA = 0;
gGameStatusPtr->unk_81 = 0;
gGameStatusPtr->unk_82 = -8;
gGameStatusPtr->unk_83 = 4;
timeFreezeMode = 0;
(*gameStatus)->unk_75 = (*gameStatus)->unk_13C = 0;
gGameStatusPtr->unk_75 = gGameStatusPtr->unk_13C = 0;
D_80074021 = 5;
(*gameStatus)->saveCount = 0;
gGameStatusPtr->saveCount = 0;
fio_init_flash();
func_80028838();
general_heap_create();
@ -234,11 +293,11 @@ void load_engine_data(void) {
poll_rumble();
for (i = 0; i < 4; i++) {
(*gameStatus)->unk_50[i] = 3;
(*gameStatus)->unk_48[i] = 12;
gGameStatusPtr->unk_50[i] = 3;
gGameStatusPtr->unk_48[i] = 12;
}
OVERRIDE_FLAG_SET(0x8);
gOverrideFlags |= 0x8;
set_game_mode(0);
}
@ -252,30 +311,30 @@ void set_time_freeze_mode(s32 mode) {
switch (mode) {
case 0:
timeFreezeMode = mode;
OVERRIDE_FLAG_UNSET(0xF00);
gOverrideFlags &= ~0xF00;
resume_all_group(3);
break;
case 1:
timeFreezeMode = mode;
OVERRIDE_FLAG_UNSET(0xE00);
OVERRIDE_FLAG_SET(0x100);
gOverrideFlags &= ~0xE00;
gOverrideFlags |= 0x100;
suspend_all_group(1);
break;
case 2:
timeFreezeMode = mode;
OVERRIDE_FLAG_UNSET(0xC00);
OVERRIDE_FLAG_SET(0x300);
gOverrideFlags &= ~0xC00;
gOverrideFlags |= 0x300;
suspend_all_group(2);
break;
case 3:
timeFreezeMode = mode;
OVERRIDE_FLAG_UNSET(0x800);
OVERRIDE_FLAG_SET(0x700);
gOverrideFlags &= ~0x800;
gOverrideFlags |= 0x700;
suspend_all_group(2);
break;
case 4:
timeFreezeMode = mode;
OVERRIDE_FLAG_SET(0xF00);
gOverrideFlags |= 0xF00;
break;
}
}
@ -284,18 +343,11 @@ s32 get_time_freeze_mode(void) {
return timeFreezeMode;
}
#ifdef NON_MATCHING
void gfx_init_state(void) {
Gfx* temp;
gSPSegment(gMasterGfxPos++, 0x00, 0x0);
gSPDisplayList(gMasterGfxPos++, OS_K0_TO_PHYSICAL(&D_80074230));
//temp = gMasterGfxPos++;
gSPDisplayList(gMasterGfxPos++, OS_K0_TO_PHYSICAL(&D_80074210));
gSPDisplayList(gMasterGfxPos++, OS_K0_TO_PHYSICAL(D_80074230));
gSPDisplayList(gMasterGfxPos++, OS_K0_TO_PHYSICAL(D_80074210));
}
#else
INCLUDE_ASM(void, "1b40_len_20b0", gfx_init_state);
#endif
INCLUDE_ASM(s32, "1b40_len_20b0", func_800271FC);
@ -307,6 +359,34 @@ INCLUDE_ASM(s32, "1b40_len_20b0", func_80027774);
INCLUDE_ASM(s32, "1b40_len_20b0", func_800279B4);
INCLUDE_ASM(s32, "1b40_len_20b0", func_80027BAC);
void func_80027BAC(s32 arg0, s32 arg1) {
s32 i;
s32 temp = 24; // todo figure out why this is needed and can't be used elsewhere
gDPPipeSync(gMasterGfxPos++);
gSPTexture(gMasterGfxPos++, -1, -1, 0, G_TX_RENDERTILE, G_ON);
gDPSetColorImage(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 320, arg1);
gDPSetCycleType(gMasterGfxPos++, G_CYC_COPY);
gDPSetTexturePersp(gMasterGfxPos++, G_TP_NONE);
gDPSetTextureLUT(gMasterGfxPos++, G_TT_NONE);
gDPSetRenderMode(gMasterGfxPos++, G_RM_NOOP, G_RM_NOOP2);
gDPSetTextureFilter(gMasterGfxPos++, G_TF_POINT);
for (i = 0; i < 40; i++) {
gDPSetTextureImage(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 320, arg0 + (0xF00 * i));
gDPSetTile(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 80, 0x0000, G_TX_LOADTILE, 0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
G_TX_NOLOD);
gDPLoadSync(gMasterGfxPos++);
gDPLoadTile(gMasterGfxPos++, G_TX_LOADTILE, 0, 0, 0x04FC, 0x0014);
gDPPipeSync(gMasterGfxPos++);
gDPSetTile(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 80, 0x0000, G_TX_RENDERTILE, 0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
G_TX_NOLOD);
gDPSetTileSize(gMasterGfxPos++, G_TX_RENDERTILE, 0, 0, 0x04FC, 0x0014);
gSPTextureRectangle(gMasterGfxPos++, 0, i * temp, 0x04FC, (i * 24) + 20, G_TX_RENDERTILE, 0, 0, 0x1000, 0x0400);
gDPPipeSync(gMasterGfxPos++);
}
}
INCLUDE_ASM(void, "1b40_len_20b0", gfx_draw_background);

View File

@ -4,13 +4,12 @@
ApiStatus SetEncounterStatusFlags(ScriptInstance* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
EncounterStatus* currentEncounter = &gCurrentEncounter;
EncounterStatus* currentEncounter2 = &gCurrentEncounter;
s32 a0 = *args++;
if (get_variable(script, *args)) {
currentEncounter->flags |= a0;
} else {
currentEncounter2->flags &= ~a0;
currentEncounter->flags &= ~a0;
}
return ApiStatus_DONE2;

View File

@ -97,7 +97,7 @@ void func_8005513C(u32 arg0) {
}
void snd_start_sound(s32 soundID, u8 volume, s8 pan) {
SoundManager* sym = D_8009A640;
SoundManager* soundManager = D_8009A640;
s16 a1temp = volume * 256;
if (a1temp != 0) {
@ -108,11 +108,11 @@ void snd_start_sound(s32 soundID, u8 volume, s8 pan) {
pan = 0x7F;
}
snd_enqueue_sfx_event(sym, soundID, a1temp, 0, pan);
snd_enqueue_sfx_event(soundManager, soundID, a1temp, 0, pan);
}
void snd_start_sound_with_shift(s32 soundID, u8 volume, s8 pan, s16 pitchShift) {
SoundManager* sym = D_8009A640;
SoundManager* soundManager = D_8009A640;
s16 a1temp = volume * 256;
if (a1temp != 0) {
@ -129,11 +129,11 @@ void snd_start_sound_with_shift(s32 soundID, u8 volume, s8 pan, s16 pitchShift)
pitchShift = -0x960;
}
snd_enqueue_sfx_event(sym, soundID, a1temp, pitchShift, pan);
snd_enqueue_sfx_event(soundManager, soundID, a1temp, pitchShift, pan);
}
void snd_adjust_sound(s32 soundID, u8 volume, s8 pan) {
SoundManager* sym = D_8009A640;
SoundManager* soundManager = D_8009A640;
s16 a1temp = volume * 256;
if (a1temp != 0) {
@ -144,11 +144,11 @@ void snd_adjust_sound(s32 soundID, u8 volume, s8 pan) {
pan = 0x7F;
}
snd_enqueue_sfx_event(sym, soundID | 0x1000, a1temp, 0, pan);
snd_enqueue_sfx_event(soundManager, soundID | 0x1000, a1temp, 0, pan);
}
void snd_adjust_sound_with_shift(s32 soundID, u8 volume, s8 pan, s16 pitchShift) {
SoundManager* sym = D_8009A640;
SoundManager* soundManager = D_8009A640;
s16 a1temp = volume * 256;
if (a1temp != 0) {
@ -165,11 +165,13 @@ void snd_adjust_sound_with_shift(s32 soundID, u8 volume, s8 pan, s16 pitchShift)
pitchShift = -0x960;
}
snd_enqueue_sfx_event(sym, soundID | 0x1000, a1temp, pitchShift, pan);
snd_enqueue_sfx_event(soundManager, soundID | 0x1000, a1temp, pitchShift, pan);
}
void snd_stop_sound(s32 soundID) {
snd_enqueue_sfx_event(D_8009A640, soundID | 0x8000, 0, 0, 0);
SoundManager* soundManager = D_8009A640;
snd_enqueue_sfx_event(soundManager, soundID | 0x8000, 0, 0, 0);
}
void func_800553F4(void) {
@ -177,7 +179,9 @@ void func_800553F4(void) {
}
void snd_start_sound_raw(s32 soundID, s16 volume, s16 pitchShift, s32 pan) {
snd_enqueue_sfx_event(D_8009A640, soundID, volume, pitchShift, pan);
SoundManager* soundManager = D_8009A640;
snd_enqueue_sfx_event(soundManager, soundID, volume, pitchShift, pan);
}
s32 func_80055448(s32 arg0) {

View File

@ -34,7 +34,7 @@ ApiStatus func_802BD26C(ScriptInstance* script, s32 isInitialCall) {
ApiStatus func_802BD32C(ScriptInstance* script, s32 isInitialCall) {
PlayerData* playerData = &gPlayerData;
PlayerData* playerData2 = &gPlayerData;
s32 newHP = playerData->curHP + get_variable(script, *script->ptrReadPos);
if (newHP > playerData->curMaxHP) {
@ -45,13 +45,13 @@ ApiStatus func_802BD32C(ScriptInstance* script, s32 isInitialCall) {
newHP = 1;
}
playerData2->curHP = newHP;
playerData->curHP = newHP;
return ApiStatus_DONE2;
}
ApiStatus func_802BD388(ScriptInstance* script, s32 isInitialCall) {
PlayerData* playerData = &gPlayerData;
PlayerData* playerData2 = &gPlayerData;
s32 newFP = playerData->curFP + get_variable(script, *script->ptrReadPos);
if (newFP > playerData->curMaxFP) {
@ -62,19 +62,19 @@ ApiStatus func_802BD388(ScriptInstance* script, s32 isInitialCall) {
newFP = 1;
}
playerData2->curFP = newFP;
playerData->curFP = newFP;
return ApiStatus_DONE2;
}
ApiStatus func_802BD3E4(ScriptInstance* script, s32 isInitialCall) {
set_time_freeze_mode(2);
OVERRIDE_FLAG_SET(0x200000);
gOverrideFlags |= 0x200000;
return ApiStatus_DONE2;
}
ApiStatus func_802BD41C(ScriptInstance* script, s32 isInitialCall) {
set_time_freeze_mode(0);
OVERRIDE_FLAG_UNSET(0x200000);
gOverrideFlags &= ~0x200000;
return ApiStatus_DONE2;
}

View File

@ -12,7 +12,6 @@ void func_E011A398(void) {
INCLUDE_ASM(s32, "404220", func_E011A3A0);
#ifdef NON_MATCHING // gfx gbi macro issue
void func_E011A3BC(s16 alpha) {
if (alpha == 255) {
gDPSetRenderMode(gMasterGfxPos++, AA_EN | CVG_DST_FULL | ZMODE_OPA | CVG_X_ALPHA | GBL_c1(G_BL_CLR_IN, G_BL_A_IN,
@ -25,9 +24,6 @@ void func_E011A3BC(s16 alpha) {
gDPSetPrimColor(gMasterGfxPos++, 0, 0, 0x00, 0x00, 0x00, alpha);
}
}
#else
INCLUDE_ASM(s32, "404220", func_E011A3BC);
#endif
INCLUDE_ASM(s32, "404220", func_E011A48C);

View File

@ -306,12 +306,11 @@ f32 get_player_normal_yaw(void) {
}
f32 get_player_normal_pitch(void) {
GameStatus** gameStatus = &gGameStatusPtr;
f32 traceNormalX = (*gameStatus)->playerTraceNormal.x;
f32 traceNormalZ = (*gameStatus)->playerTraceNormal.z;
f32 traceNormalX = gGameStatusPtr->playerTraceNormal.x;
f32 traceNormalZ = gGameStatusPtr->playerTraceNormal.z;
f32 sqrt = sqrtf(SQ(traceNormalX) + SQ(traceNormalZ));
return atan2(0.0f, 0.0f, sqrt, -(*gameStatus)->playerTraceNormal.y);
return atan2(0.0f, 0.0f, sqrt, -gGameStatusPtr->playerTraceNormal.y);
}
f32 dist2D(f32 ax, f32 ay, f32 bx, f32 by) {

View File

@ -129,7 +129,6 @@ void update_player(void) {
void check_input_use_partner(void) {
PlayerStatus* playerStatus = &gPlayerStatus;
PlayerStatus* playerStatus2 = &gPlayerStatus;
PlayerData* playerData = &gPlayerData;
u32 actionState = playerStatus->actionState;
@ -140,7 +139,7 @@ void check_input_use_partner(void) {
actionState <= ACTION_STATE_RUN) {
if (playerData->currentPartner == PARTNER_GOOMBARIO) {
D_802BDF60 = playerStatus2->unk_C6;
D_802BDF60 = playerStatus->unk_C6;
}
partner_use_ability();
}

View File

@ -15,7 +15,6 @@ extern s32 D_8010C990;
void update_player_input(void) {
PlayerStatus* playerStatus = &gPlayerStatus;
PlayerStatus* playerStatus2 = &gPlayerStatus; // needed for some macro - not sure what yet
s32 inputBufPos = playerStatus->inputBufPos;
playerStatus->stickAxis[0] = gGameStatusPtr->stickX;
@ -46,15 +45,14 @@ void update_player_input(void) {
if (playerStatus->animFlags & 8) {
playerStatus->animFlags |= 0x200000;
playerStatus2->pressedButtons |= 4;
playerStatus->pressedButtons |= 4;
}
}
#ifdef NON_MATCHING
void func_800E205C(void) {
s32* temp8010C92C = &D_8010C92C;
PlayerStatus* playerStatus = &gPlayerStatus;
GameStatus** gameStatus;
GameStatus *gameStatus2;
MapConfig* mapConfig;
f32 one;
f32* floatsTemp;
@ -74,27 +72,26 @@ void func_800E205C(void) {
playerStatus->unk_0D = 1;
playerStatus->renderMode = 0xD;
gameStatus = &gGameStatusPtr;
playerStatus->alpha1 = 255;
playerStatus->alpha2 = 255;
(*gameStatus)->peachFlags &= ~0x8;
(*gameStatus)->peachFlags &= ~0x10;
gGameStatusPtr->peachFlags &= ~0x8;
gGameStatusPtr->peachFlags &= ~0x10;
one = 1.0f;
if ((*gameStatus)->peachFlags & 1) {
if (gGameStatusPtr->peachFlags & 1) {
playerStatus->colliderHeight = 55;
playerStatus->colliderDiameter = 38;
playerStatus->animFlags |= 0x1000;
if ((*gameStatus)->peachFlags & 2) {
if (gGameStatusPtr->peachFlags & 2) {
*temp8010C92C = 2;
playerStatus->peachDisguise = (*gameStatus)->peachDisguise;
playerStatus->peachDisguise = gGameStatusPtr->peachDisguise;
}
} else {
playerStatus->colliderHeight = 37;
playerStatus->colliderDiameter = 26;
(*gameStatus)->peachAnimIdx = 0;
gGameStatusPtr->peachAnimIdx = 0;
}
// This grossness is needed for matching
@ -105,7 +102,6 @@ void func_800E205C(void) {
set_action_state(ACTION_STATE_IDLE);
gameStatus2 = gGameStatusPtr;
playerStatus->currentSpeed = 0.0f;
playerStatus->targetYaw = 0.0f;
playerStatus->unk_64 = 0.0f;
@ -121,14 +117,14 @@ void func_800E205C(void) {
playerStatus->unk_98 = 0;
playerStatus->unk_9C = 0;
mapConfig = gAreas[gameStatus2->areaID].maps[gameStatus2->mapID].config;
mapConfig = gAreas[gGameStatusPtr->areaID].maps[gGameStatusPtr->mapID].config;
if (mapConfig->entryList != NULL) {
if (gameStatus2->entryID < mapConfig->entryCount) {
playerStatus->position.x = (*mapConfig->entryList)[gameStatus2->entryID].x;
playerStatus->position.y = (*mapConfig->entryList)[gameStatus2->entryID].y;
playerStatus->position.z = (*mapConfig->entryList)[gameStatus2->entryID].z;
playerStatus->currentYaw = (*mapConfig->entryList)[gameStatus2->entryID].yaw;
if (gGameStatusPtr->entryID < mapConfig->entryCount) {
playerStatus->position.x = (*mapConfig->entryList)[gGameStatusPtr->entryID].x;
playerStatus->position.y = (*mapConfig->entryList)[gGameStatusPtr->entryID].y;
playerStatus->position.z = (*mapConfig->entryList)[gGameStatusPtr->entryID].z;
playerStatus->currentYaw = (*mapConfig->entryList)[gGameStatusPtr->entryID].yaw;
}
}
@ -139,6 +135,9 @@ void func_800E205C(void) {
func_800E59A0(mapConfig);
mem_clear(&D_8010F250, sizeof(Temp8010F250));
}
#else
INCLUDE_ASM(s32, "7B440", func_800E205C);
#endif
void func_800E22E4(s32* arg0) {
PlayerStatus* playerStatus = &gPlayerStatus;
@ -148,15 +147,14 @@ void func_800E22E4(s32* arg0) {
void input_to_move_vector(f32* angle, f32* magnitude) {
PlayerStatus* playerStatus = &gPlayerStatus;
PlayerStatus* playerStatus2 = playerStatus;
f32 stickAxisX;
f32 stickAxisY;
f32 ang;
f32 mag;
f32 magMax = 70.0f;
stickAxisX = playerStatus2->stickAxis[0];
stickAxisY = -playerStatus2->stickAxis[1];
stickAxisX = playerStatus->stickAxis[0];
stickAxisY = -playerStatus->stickAxis[1];
mag = dist2D(0.0f, 0.0f, stickAxisX, stickAxisY);
if (mag >= magMax) {
@ -165,7 +163,7 @@ void input_to_move_vector(f32* angle, f32* magnitude) {
ang = clamp_angle(atan2(0.0f, 0.0f, stickAxisX, stickAxisY) + gCameras[0].currentYaw);
if (mag == 0.0f) {
ang = playerStatus2->targetYaw;
ang = playerStatus->targetYaw;
}
*angle = ang;

View File

@ -74,26 +74,42 @@ INCLUDE_ASM(s32, "7bb60_len_41b0", update_fall_state);
INCLUDE_ASM(s32, "7bb60_len_41b0", func_800E2F60);
#ifdef NON_MATCHING
// void gravity_use_fall_params(void) {
// f32* floats = D_800F7B60;
// do { } while (0);
// if (gPlayerStatus.flags & 0x40000) {
// gPlayerStatus.gravityIntegrator[0] = *floats++ / 12.0f;
// gPlayerStatus.gravityIntegrator[1] = *floats++ / 12.0f;
// gPlayerStatus.gravityIntegrator[2] = *floats++ / 12.0f;
// gPlayerStatus.gravityIntegrator[3] = *floats++ / 12.0f;
// } else {
// gPlayerStatus.gravityIntegrator[0] = *floats++;
// gPlayerStatus.gravityIntegrator[1] = *floats++;
// gPlayerStatus.gravityIntegrator[2] = *floats++;
// gPlayerStatus.gravityIntegrator[3] = *floats++;
// }
// }
void gravity_use_fall_params(void) {
f32* floats = D_800F7B60;
PlayerStatus* playerStatus2;
PlayerStatus* playerStatus;
PlayerStatus *playerStatus;
f32 *floats = D_800F7B60;
do {} while (0);
playerStatus = &gPlayerStatus;
playerStatus2 = &gPlayerStatus;
if (playerStatus->flags & 0x40000) {
playerStatus->gravityIntegrator[0] = *floats++ / 12.0f;
playerStatus->gravityIntegrator[1] = *floats++ / 12.0f;
playerStatus->gravityIntegrator[2] = *floats++ / 12.0f;
playerStatus->gravityIntegrator[3] = *floats++ / 12.0f;
playerStatus->gravityIntegrator[0] = (*(floats++)) / 12.0f;
playerStatus->gravityIntegrator[1] = (*(floats++)) / 12.0f;
playerStatus->gravityIntegrator[2] = (*(floats++)) / 12.0f;
playerStatus->gravityIntegrator[3] = (*(floats++)) / 12.0f;
} else {
playerStatus2->gravityIntegrator[0] = *floats++;
playerStatus2->gravityIntegrator[1] = *floats++;
playerStatus2->gravityIntegrator[2] = *floats++;
playerStatus2->gravityIntegrator[3] = *floats++;
playerStatus->gravityIntegrator[0] = *(floats++);
playerStatus->gravityIntegrator[1] = *(floats++);
playerStatus->gravityIntegrator[2] = *(floats++);
playerStatus->gravityIntegrator[3] = *(floats++);
}
}
#else
INCLUDE_ASM(s32, "7bb60_len_41b0", gravity_use_fall_params);
#endif
void func_800E3100(void) {
PlayerStatus* playerStatus = &gPlayerStatus;
@ -147,18 +163,17 @@ s32 collision_check_player_intersecting_world(s32 arg0, s32 arg1, f32 arg2) {
s32 i;
for (i = 0; i < 4; i++) {
PlayerStatus** playerStatus = &gPlayerStatusPtr;
f32 x = (*playerStatus)->position.x;
f32 y = (*playerStatus)->position.y + arg1;
f32 z = (*playerStatus)->position.z;
s32 hitID = do_lateral_collision(arg0, *playerStatus, &x, &y, &z, 0, angle);
f32 x = gPlayerStatusPtr->position.x;
f32 y = gPlayerStatusPtr->position.y + arg1;
f32 z = gPlayerStatusPtr->position.z;
s32 hitID = do_lateral_collision(arg0, gPlayerStatusPtr, &x, &y, &z, 0, angle);
if (hitID >= 0) {
ret = hitID;
}
(*playerStatus)->position.x = x;
(*playerStatus)->position.z = z;
gPlayerStatusPtr->position.x = x;
gPlayerStatusPtr->position.z = z;
angle += 90.0f;
}
@ -282,7 +297,6 @@ void func_800E5098(s32 arg0) {
u8 colliderType = get_collider_type_by_id(gCollisionStatus.currentFloor);
s32 soundID;
s32 soundID2;
s16* temp_800F7B80;
if (colliderType == 6 || colliderType == 9) {
soundID = 0x143;
@ -292,14 +306,12 @@ void func_800E5098(s32 arg0) {
soundID2 = SOUND_STEP2;
}
temp_800F7B80 = &D_800F7B80;
if (*temp_800F7B80 == 0) {
if (D_800F7B80 == 0) {
soundID = soundID2;
}
sfx_play_sound_at_player(soundID, 0);
*temp_800F7B80 ^= 1;
D_800F7B80 ^= 1;
}
}
@ -377,10 +389,7 @@ void set_action_state(s32 actionState) {
playerStatus->prevActionState = playerStatus->actionState;
playerStatus->actionState = actionState;
playerStatus->flags |= 0x80000000;
#ifdef NON_MATCHING
}
#endif
}
return;
}
@ -476,14 +485,14 @@ void start_bounce_b(void) {
playerStatus->flags |= 0x800000;
}
// TODO playerData isn't used
s32 check_input_hammer(void) {
PlayerStatus* playerStatus = &gPlayerStatus;
PlayerData* playerData = &gPlayerData;
if (playerStatus->pressedButtons & BUTTON_B) {
if (!(playerStatus->flags & 4)) {
if (D_8010EBB0.unk_00 != 1 || playerData->currentPartner != PARTNER_WATT) {
if (playerData->hammerLevel != -1) {
if (gPlayerStatus.pressedButtons & BUTTON_B) {
if (!(gPlayerStatus.flags & 4)) {
if (D_8010EBB0.unk_00 != 1 || gPlayerData.currentPartner != PARTNER_WATT) {
if (gPlayerData.hammerLevel != -1) {
set_action_state(ACTION_STATE_HAMMER);
return TRUE;
}
@ -557,7 +566,6 @@ void func_800E63A4(s32 arg0) {
void func_800E6428(void) {
PlayerStatus* playerStatus = &gPlayerStatus;
PlayerStatus* playerStatus2 = playerStatus;
s32 actionState = playerStatus->actionState;
Npc* disguiseNpc;
@ -578,7 +586,7 @@ void func_800E6428(void) {
}
}
}
} else if (gGameStatusPtr->peachFlags & 4 && playerStatus2->pressedButtons & B_BUTTON) {
} else if (gGameStatusPtr->peachFlags & 4 && playerStatus->pressedButtons & B_BUTTON) {
set_action_state(ACTION_STATE_SNEAKY_PARASOL);
}
}

View File

@ -453,10 +453,9 @@ void update_coin_counter(void) {
void show_coin_counter(void) {
UiStatus* uiStatus = &gUIStatus;
s16* coinCounterUnk = &D_8010CD10;
s32 index;
if ((*coinCounterUnk != 0) || (D_8010CD12 != 0)) {
if ((D_8010CD10 != 0) || (D_8010CD12 != 0)) {
set_window_update(0x14, 2);
if (uiStatus->iconIndex12 > -1) {
free_icon(uiStatus->iconIndex10);
@ -465,7 +464,7 @@ void show_coin_counter(void) {
}
uiStatus->unk_6C[0] = 0;
uiStatus->unk_6C[1] = 0;
*coinCounterUnk = 0;
D_8010CD10 = 0;
D_8010CD12 = 0;
}
@ -584,13 +583,13 @@ void func_800E984C(void) {
s32 func_800E9860(void) {
UiStatus* uiStatus = &gUIStatus;
UiStatus* uiStatus2 = &gUIStatus;
s32 ret = 1 - uiStatus->unk_45[0];
if (uiStatus->unk_45[1] != 0) {
ret = 0;
}
if (uiStatus2->ignoreChanges) {
if (uiStatus->ignoreChanges) {
ret = 0;
}
return ret;
@ -631,15 +630,14 @@ s32 is_status_menu_visible(void) {
void status_menu_start_blinking_hp(void) {
UiStatus* uiStatus = &gUIStatus;
UiStatus* uiStatus2 = &gUIStatus;
if (gGameStatusPtr->isBattle == 0) {
uiStatus->hpBlinkTimer = 120;
}
if (uiStatus2->hpBlinking != 1) {
uiStatus2->hpBlinking = 1;
uiStatus2->hpBlinkCounter = 0;
if (uiStatus->hpBlinking != 1) {
uiStatus->hpBlinking = 1;
uiStatus->hpBlinkCounter = 0;
}
}
@ -655,15 +653,14 @@ void status_menu_stop_blinking_hp(void) {
void status_menu_start_blinking_fp(void) {
UiStatus* uiStatus = &gUIStatus;
UiStatus* uiStatus2 = &gUIStatus;
if (gGameStatusPtr->isBattle == 0) {
uiStatus->fpBlinkTimer = 120;
}
if (uiStatus2->fpBlinking != 1) {
uiStatus2->fpBlinking = 1;
uiStatus2->fpBlinkCounter = 0;
if (uiStatus->fpBlinking != 1) {
uiStatus->fpBlinking = 1;
uiStatus->fpBlinkCounter = 0;
}
}
@ -678,15 +675,14 @@ void status_menu_stop_blinking_fp(void) {
void status_menu_start_blinking_coins(void) {
UiStatus* uiStatus = &gUIStatus;
UiStatus* uiStatus2 = &gUIStatus;
if (gGameStatusPtr->isBattle == 0) {
uiStatus->coinsBlinkTimer = 120;
}
if (uiStatus2->coinsBlinking != 1) {
uiStatus2->coinsBlinking = 1;
uiStatus2->coinsBlinkCounter = 0;
if (uiStatus->coinsBlinking != 1) {
uiStatus->coinsBlinking = 1;
uiStatus->coinsBlinkCounter = 0;
}
}
@ -1110,19 +1106,18 @@ s32 add_coins(s32 amt) {
s8 add_star_points(s32 amt) {
PlayerData* playerData = &gPlayerData;
PlayerData* playerData2 = &gPlayerData;
s8 newSP = playerData->starPoints + amt;
// TODO: probably a macro!
playerData2->starPoints = newSP;
playerData->starPoints = newSP;
if (newSP > 100) {
playerData2->starPoints = 100;
playerData->starPoints = 100;
}
// TODO: probably a macro!
newSP = playerData2->starPoints;
newSP = playerData->starPoints;
if (newSP < 0) {
playerData2->starPoints = 0;
playerData->starPoints = 0;
}
return gPlayerData.starPoints;
}
@ -1268,14 +1263,13 @@ s8 add_fortress_keys(s32 amt) {
s8 subtract_fortress_keys(s8 amt) {
PlayerData* playerData = &gPlayerData;
PlayerData* playerData2 = &gPlayerData; // required to match
playerData->fortressKeyCount -= amt;
if (playerData->fortressKeyCount < 0) {
playerData->fortressKeyCount = 0;
}
return playerData2->fortressKeyCount; // required to use playerData2 here to match
return playerData->fortressKeyCount;
}
s8 get_fortress_key_count(void) {

View File

@ -60,7 +60,7 @@ void do_animation(ItemEntity* itemEntity) {
itemEntity->framesLeft--;
if (itemEntity->framesLeft <= 0) {
while (next_sequence_step(itemEntity) != 0) {
}
}
}
@ -135,7 +135,7 @@ void clear_item_entity_flags(s32 index, s32 flags) {
void func_801341B0(s32 index) {
ItemEntity* itemEntity = D_801565A0[index];
OVERRIDE_FLAG_SET(0x40);
gOverrideFlags |= 0x40;
itemEntity->flags |= 0x100;
}

View File

@ -649,24 +649,23 @@ INCLUDE_ASM(s32, "a5dd0_len_114e0", func_8011CFBC);
void func_8011D72C(Gfx** arg0, u16 treeIndex) {
Model* model = get_model_from_list_index(get_model_list_index_from_tree_index(treeIndex));
Model copied = *model;
Gfx** gfxPos = &gMasterGfxPos;
Gfx* oldGfxPos;
s32 flag;
if (*arg0 == *gfxPos) {
if (*arg0 == gMasterGfxPos) {
flag = 1;
}
oldGfxPos = *gfxPos;
*gfxPos = *arg0;
oldGfxPos = gMasterGfxPos;
gMasterGfxPos = *arg0;
copied.flags = 0x81;
appendGfx_model(&copied);
*arg0 = *gfxPos;
*arg0 = gMasterGfxPos;
if (flag == 0) {
*gfxPos = oldGfxPos;
gMasterGfxPos = oldGfxPos;
}
}

View File

@ -105,7 +105,7 @@ ApiStatus N(func_802A1450_7309F0)(ScriptInstance* script, s32 isInitialCall) {
ApiStatus N(AddFP)(ScriptInstance* script, s32 isInitialCall) {
PlayerData* playerData = &gPlayerData;
PlayerData* playerData2 = &gPlayerData;
s32 amt = get_variable(script, *script->ptrReadPos);
// @bug Should be playerData->curFP
s32 newFP = playerData->curHP + amt;
@ -114,7 +114,7 @@ ApiStatus N(AddFP)(ScriptInstance* script, s32 isInitialCall) {
newFP = playerData->curMaxFP;
}
playerData2->curFP = newFP;
playerData->curFP = newFP;
return ApiStatus_DONE2;
}

View File

@ -121,10 +121,10 @@ ApiStatus N(func_802A1438_733508)(ScriptInstance* script, s32 isInitialCall) {
#include "common/AddFP.inc.c"
ApiStatus N(func_802A15A0_733670)(ScriptInstance* script, s32 isInitialCall) {
StaticItem* itemTable = gItemTable;
Bytecode* args = script->ptrReadPos;
s32 itemIdx = get_variable(script, *args++);
StaticItem* item = &itemTable[itemIdx];
StaticItem* item = &gItemTable[itemIdx];
s32 temp;
script->varTable[11] = item->potencyA;
script->varTable[12] = item->potencyB;
@ -134,8 +134,12 @@ ApiStatus N(func_802A15A0_733670)(ScriptInstance* script, s32 isInitialCall) {
script->varTable[13] = 1;
}
script->varTable[15] = script->varTable[11] < 0 ||
(script->varTable[11] <= 0 && script->varTable[12] < 0);
temp = 0;
if((script->varTable[11] < 0) || (script->varTable[11] <= 0 && script->varTable[12] < 0)) {
temp = 1;
}
script->varTable[15] = temp;
return ApiStatus_DONE2;
}

View File

@ -9,7 +9,6 @@ extern MessageID bActorTattles[ACTOR_TYPE_COUNT];
ApiStatus func_80238000_6F10E0(ScriptInstance* script, s32 isInitialCall) {
BattleStatus* battleStatus = &gBattleStatus;
BattleStatus* secondBattleStatus = &gBattleStatus;
Actor* partnerActor = battleStatus->partnerActor;
f32 posX = partnerActor->currentPos.x;
f32 posY = partnerActor->currentPos.y;
@ -24,7 +23,7 @@ ApiStatus func_80238000_6F10E0(ScriptInstance* script, s32 isInitialCall) {
script->varTable[0] = 20;
}
if (secondBattleStatus->unk_83 != 0) {
if (battleStatus->unk_83 != 0) {
if (script->varTable[0] < 10) {
script->varTable[0] = 10;
}
@ -41,7 +40,7 @@ INCLUDE_ASM(s32, "battle/partner/6F10E0", func_8023817C_6F125C);
ApiStatus func_80238A20_6F1B00(ScriptInstance* script, s32 isInitialCall) {
BattleStatus* battleStatus = &gBattleStatus;
Actor* partnerActor = battleStatus->partnerActor;
Actor* partnerActor = gBattleStatus.partnerActor;
Vec3f* pos = &partnerActor->walk.currentPos;
if (isInitialCall) {
@ -121,16 +120,15 @@ ApiStatus func_8023903C_6F211C(ScriptInstance* script, s32 isInitialCall) {
}
ApiStatus func_80239068_6F2148(ScriptInstance* script, s32 isInitialCall) {
BattleStatus* battleStatus = &gBattleStatus;
Actor* partnerActor = battleStatus->partnerActor;
Actor* partnerActor = gBattleStatus.partnerActor;
if (!(battleStatus->flags1 & 0x40000000)) {
if (!(gBattleStatus.flags1 & 0x40000000)) {
partnerActor->isGlowing = FALSE;
}
script->varTable[0] = partnerActor->isGlowing;
partnerActor->isGlowing = FALSE;
battleStatus->flags1 &= ~0x40000000;
gBattleStatus.flags1 &= ~0x40000000;
return ApiStatus_DONE2;
}

View File

@ -16,7 +16,6 @@ INCLUDE_ASM(s32, "battle/star/focus/789E60", func_802A1494_78A2F4);
ApiStatus func_802A1518_78A378(ScriptInstance* script, s32 isInitialCall) {
PlayerData* playerData = &gPlayerData;
PlayerData* playerData2 = &gPlayerData;
s32 deepFocusSP;
s32 superFocusSP;
@ -32,7 +31,7 @@ ApiStatus func_802A1518_78A378(ScriptInstance* script, s32 isInitialCall) {
add_SP(deepFocusSP + superFocusSP + 128);
if (playerData2->specialBarsFilled == playerData2->maxStarPower * 256) {
if (playerData->specialBarsFilled == playerData->maxStarPower * 256) {
script->varTable[0] = 2;
}
@ -41,7 +40,6 @@ ApiStatus func_802A1518_78A378(ScriptInstance* script, s32 isInitialCall) {
ApiStatus func_802A15B0_78A410(ScriptInstance* script, s32 isInitialCall) {
PlayerData* playerData = &gPlayerData;
PlayerData* playerData2 = &gPlayerData;
script->varTable[0] = 0;
@ -52,7 +50,7 @@ ApiStatus func_802A15B0_78A410(ScriptInstance* script, s32 isInitialCall) {
add_SP(128);
if (playerData2->specialBarsFilled == playerData2->maxStarPower * 256) {
if (playerData->specialBarsFilled == playerData->maxStarPower * 256) {
script->varTable[0] = 2;
}

View File

@ -1,6 +1,6 @@
#include "common.h"
INCLUDE_ASM(s32, "cd180_len_38f0", _render_transition_stencil);
INCLUDE_ASM(void, "cd180_len_38f0", _render_transition_stencil, s32 arg0, f32 arg1, s32 arg2);
INCLUDE_ASM(void, "cd180_len_38f0", set_transition_stencil_zoom_0, s32 arg0, f32 arg1);

View File

@ -2,7 +2,7 @@
ApiStatus N(AddFP)(ScriptInstance* script, s32 isInitialCall) {
PlayerData* playerData = &gPlayerData;
PlayerData* playerData2 = &gPlayerData;
s32 amt = get_variable(script, *script->ptrReadPos);
s32 newFP = playerData->curFP + amt;
@ -10,7 +10,7 @@ ApiStatus N(AddFP)(ScriptInstance* script, s32 isInitialCall) {
newFP = playerData->curMaxFP;
}
playerData2->curFP = newFP;
playerData->curFP = newFP;
return ApiStatus_DONE2;
}

View File

@ -2,7 +2,7 @@
ApiStatus N(AddHP)(ScriptInstance* script, s32 isInitialCall) {
PlayerData* playerData = &gPlayerData;
PlayerData* playerData2 = &gPlayerData;
s32 amt = get_variable(script, *script->ptrReadPos);
s32 newHP = playerData->curHP + amt;
@ -10,7 +10,7 @@ ApiStatus N(AddHP)(ScriptInstance* script, s32 isInitialCall) {
newHP = playerData->curMaxHP;
}
playerData2->curHP = newHP;
playerData->curHP = newHP;
return ApiStatus_DONE2;
}

View File

@ -289,8 +289,8 @@ void bgm_pop_battle_song(void) {
MusicSettings* musicSetting = &gMusicSettings[0];
if (gGameStatusPtr->demoState == 0) {
if (OVERRIDE_FLAG_CHECK(0x20000)) {
OVERRIDE_FLAG_UNSET(0x20000);
if (gOverrideFlags & 0x20000) {
gOverrideFlags &= ~0x20000;
} else {
musicSetting->flags |= 8;
_bgm_set_song(0, musicSetting->unk_24, musicSetting->unk_28, 0, 8);
@ -302,7 +302,7 @@ void bgm_pop_battle_song(void) {
void bgm_push_battle_song(void) {
MusicSettings* musicSetting = &gMusicSettings[0];
if (gGameStatusPtr->demoState == 0 && !OVERRIDE_FLAG_CHECK(0x20000)) {
if (gGameStatusPtr->demoState == 0 && !(gOverrideFlags & 0x20000)) {
func_8005553C(0, 250);
musicSetting->unk_24 = musicSetting->songID;
musicSetting->unk_28 = musicSetting->variation;

View File

@ -1,7 +1,7 @@
#include "common.h"
void begin_state_init(void) {
OVERRIDE_FLAG_SET(0x8);
gOverrideFlags |= 0x8;
gGameStatusPtr->loadMenuState = 3;
}
@ -77,7 +77,7 @@ void step_init_state(void) {
func_80056180();
}
OVERRIDE_FLAG_UNSET(0x8);
gOverrideFlags &= ~0x8;
set_game_mode(1);
}

View File

@ -58,25 +58,22 @@ void begin_state_battle(void) {
#ifdef NON_MATCHING
void step_battle(void) {
s8* temp800A0900 = &D_800A0900;
s32 phi_a0;
if (*temp800A0900 == 5) {
if (D_800A0900 == 5) {
if (D_8009A658[1] != D_8009A64C) {
return;
}
(*temp800A0900)--;
OVERRIDE_FLAG_SET(0x8);
(D_800A0900)--;
gOverrideFlags |= 0x8;
nuContRmbForceStop();
}
if (*temp800A0900 >= 0) {
if (*temp800A0900 > 0) {
(*temp800A0900)--;
if (D_800A0900 >= 0) {
if (D_800A0900 > 0) {
(D_800A0900)--;
} else {
GameStatus* gameStatus;
*temp800A0900 = -1;
D_800A0900 = -1;
nuGfxSetCfb(&D_800778A0, 2);
nuContRmbForceStopEnd();
sfx_stop_env_sounds();
@ -87,18 +84,16 @@ void step_battle(void) {
func_802B20B4();
func_80149670(0);
gameStatus = gGameStatusPtr;
// This part sucks
if (!(gameStatus->peachFlags & 1)) {
if ((gGameStatusPtr->peachFlags & 1)) {
if (gBattleStatus.currentBattleSection != 0x26 || gBattleStatus.unk_47B != 0) {
phi_a0 = 5;
} else {
gameStatus->peachFlags |= 1;
gGameStatusPtr->peachFlags |= 1;
phi_a0 = 6;
}
} else {
gameStatus->peachFlags |= 1;
gGameStatusPtr->peachFlags |= 1;
phi_a0 = 6;
}
@ -118,15 +113,15 @@ void step_battle(void) {
npc_list_clear();
clear_entity_data(1);
clear_trigger_data();
dma_copy(&code_code_16C8E0_ROM_START, &code_code_16C8E0_ROM_END, &code_code_16C8E0_VRAM);
dma_copy(&_16C8E0_ROM_START, &_16C8E0_ROM_END, &_16C8E0_VRAM);
initialize_battle();
func_802409F4();
load_battle_section();
D_800A0904 = gPlayerStatusPtr->animFlags;
gPlayerStatusPtr->animFlags &= ~0x40;
D_800A0908 = get_time_freeze_mode(gPlayerStatusPtr);
D_800A0908 = get_time_freeze_mode();
set_time_freeze_mode(0);
OVERRIDE_FLAG_UNSET(0x8);
gOverrideFlags &= ~0x8;
if (D_800A0900 >= 0) {
return;
@ -155,7 +150,7 @@ void func_80033B54(void) {
}
void func_80033B88(void) {
OVERRIDE_FLAG_SET(0x8);
gOverrideFlags |= 0x8;
nuContRmbForceStop();
D_800A0900 = 5;
}

View File

@ -244,8 +244,7 @@ EntityModel* get_entity_model(s32 listIndex) {
void free_entity_model_by_index(s32 idx) {
s32 index = idx & ~0x800;
EntityModelList** entityModelList = &gCurrentEntityModelList;
EntityModel* entityModel = (**entityModelList)[index];
EntityModel* entityModel = (*gCurrentEntityModelList)[index];
if (entityModel != NULL && entityModel->flags) {
if (entityModel->flags & 0x400) {
@ -253,8 +252,8 @@ void free_entity_model_by_index(s32 idx) {
}
{
s32* modelCount = &gEntityModelCount;
heap_free((**entityModelList)[index]);
(**entityModelList)[index] = NULL;
heap_free((*gCurrentEntityModelList)[index]);
(*gCurrentEntityModelList)[index] = NULL;
(*modelCount)--;
}
}

View File

@ -400,9 +400,9 @@ ApiStatus func_802D585C(ScriptInstance* script, s32 initialCall) {
s32 flags = get_variable(script, *ptrReadPos++);
if (setMode) {
OVERRIDE_FLAG_SET(flags);
gOverrideFlags |= flags;
} else {
OVERRIDE_FLAG_UNSET(flags);
gOverrideFlags &= ~flags;
}
return ApiStatus_DONE2;

View File

@ -1,13 +1,15 @@
#include "common.h"
s32 D_802D9D30 = 0;
s32 func_802D5B10();
INCLUDE_ASM(s32, "evt/fa4c0_len_3bf0", func_802D5B10);
s32 D_802D9D30 = 0;
Script D_802D9D34 = SCRIPT({
func_802D5B10();
});
INCLUDE_ASM(s32, "evt/fa4c0_len_3bf0", func_802D5B10);
INCLUDE_ASM(s32, "evt/fa4c0_len_3bf0", func_802D5C70);
ApiStatus FadeOutMusic(ScriptInstance* script, s32 isInitialCall) {
@ -225,7 +227,7 @@ ApiStatus func_802D6954(ScriptInstance* script, s32 isInitialCall) {
enable_player_input();
enable_player_static_collisions();
func_800EF600();
OVERRIDE_FLAG_UNSET(0x40);
gOverrideFlags &= ~0x40;
return ApiStatus_DONE2;
}

View File

@ -155,9 +155,9 @@ ApiStatus SetMessageImages(ScriptInstance* script, s32 isInitialCall) {
ApiStatus func_802D0C94(ScriptInstance* script, s32 initialCall) {
if (get_variable(script, *script->ptrReadPos) == 0) {
OVERRIDE_FLAG_SET(0x10);
gOverrideFlags |= 0x10;
} else {
OVERRIDE_FLAG_UNSET(0x10);
gOverrideFlags &= ~0x10;
}
return ApiStatus_DONE2;
}

View File

@ -57,12 +57,12 @@ ApiStatus DisablePlayerInput(ScriptInstance* script, s32 isInitialCall) {
if (playerStatus->actionState == ACTION_STATE_SPIN) {
playerStatus->animFlags |= 0x40000;
}
OVERRIDE_FLAG_SET(0x40);
gOverrideFlags |= 0x40;
} else {
enable_player_input();
func_800EF600();
func_800E01DC();
OVERRIDE_FLAG_UNSET(0x40);
gOverrideFlags &= ~0x40;
func_800E983C();
}
return ApiStatus_DONE2;
@ -241,14 +241,13 @@ ApiStatus GetPlayerTargetYaw(ScriptInstance* script, s32 isInitialCall) {
ApiStatus SetPlayerFlagBits(ScriptInstance* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
PlayerStatus* playerStatus = &gPlayerStatus;
PlayerStatus* playerStatus2 = &gPlayerStatus;
Bytecode bits = *args++;
Bytecode a1 = *args;
if (get_variable(script, a1)) {
playerStatus->flags |= bits;
} else {
playerStatus2->flags &= ~bits;
playerStatus->flags &= ~bits;
}
return ApiStatus_DONE2;
@ -367,12 +366,11 @@ INCLUDE_ASM(s32, "evt/player_api", func_802D2884);
ApiStatus DisablePulseStone(ScriptInstance* script, s32 isInitialCall) {
PlayerStatus* playerStatus = &gPlayerStatus;
PlayerStatus* playerStatus2 = &gPlayerStatus;
if (get_variable(script, *script->ptrReadPos)) {
playerStatus->animFlags &= ~0x80;
} else {
playerStatus2->animFlags |= 0x80;
playerStatus->animFlags |= 0x80;
}
return ApiStatus_DONE2;
@ -409,16 +407,15 @@ ApiStatus func_802D2B6C(ScriptInstance* script, s32 isInitialCall) {
ApiStatus Disable8bitMario(ScriptInstance* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
PlayerStatus* playerStatus = &gPlayerStatus;
PlayerStatus* playerStatus2 = &gPlayerStatus;
if (get_variable(script, *args)) {
playerStatus->colliderHeight = 37;
playerStatus->colliderDiameter = 26;
playerStatus->animFlags &= ~0x4000;
} else {
playerStatus2->colliderHeight = 19;
playerStatus2->colliderDiameter = 26;
playerStatus2->animFlags |= 0x44004;
playerStatus->colliderHeight = 19;
playerStatus->colliderDiameter = 26;
playerStatus->animFlags |= 0x44004;
}
return ApiStatus_DONE2;

View File

@ -152,7 +152,6 @@ void func_802C3390(ScriptInstance* script) {
suspend_all_group(arg);
}
#ifdef NON_MATCHING
ScriptInstance* start_script(Bytecode* initialLine, s32 priority, s32 initialState) {
ScriptInstance* newScript;
s32 curScriptIndex;
@ -209,18 +208,13 @@ ScriptInstance* start_script(Bytecode* initialLine, s32 priority, s32 initialSta
gScriptIdList[scriptListCount] = newScript->id;
}
func_802C3390(newScript);
{
s32* tempCounter = &gStaticScriptCounter;
if (*tempCounter == 0) {
*tempCounter = 1;
}
if (gStaticScriptCounter == 0) {
gStaticScriptCounter = 1;
}
return newScript;
}
#else
INCLUDE_ASM(ScriptInstance*, "evt/script_list", start_script, Bytecode* initialLine, s32 priority,
s32 initialState);
#endif
ScriptInstance* start_script_in_group(Bytecode* initialLine, u8 priority, u8 initialState, u8 groupFlags) {
ScriptInstance* newScript;
@ -296,11 +290,8 @@ ScriptInstance* start_script_in_group(Bytecode* initialLine, u8 priority, u8 ini
INCLUDE_ASM(s32, "evt/script_list", start_child_script);
#ifdef NON_MATCHING
// appears to be functionally equivalent, some ordering and regalloc issues
ScriptInstance* func_802C39F8(ScriptInstance* parentScript, Bytecode* nextLine, s32 newState) {
ScriptInstance* child;
s32* temp6;
s32 curScriptIndex;
s32 i;
s32 scriptListCount;
@ -355,17 +346,13 @@ ScriptInstance* func_802C39F8(ScriptInstance* parentScript, Bytecode* nextLine,
gScriptIdList[scriptListCount] = child->id;
}
temp6 = &gStaticScriptCounter;
if (*temp6 == 0) {
*temp6 = 1;
if (gStaticScriptCounter == 0) {
gStaticScriptCounter = 1;
}
func_802C3390(child);
return child;
}
#else
INCLUDE_ASM(ScriptInstance*, "evt/script_list", func_802C39F8, ScriptInstance* parentScript, Bytecode* nextLine,
s32 newState);
#endif
ScriptInstance* func_802C3C10(ScriptInstance* script, Bytecode* line, s32 arg2) {
ScriptInstance* curScript;

View File

@ -41,16 +41,15 @@ extern s8 D_800A0910[];
void state_init_logos(void) {
Camera* cameras = &gCameras;
GameStatus** gameStatus = &gGameStatusPtr;
s8* romStart;
s8* romEnd;
s32* logoRam;
s32* temp_800A0910;
general_heap_create();
(*gameStatus)->loadMenuState = 0;
(*gameStatus)->menuCounter = 0;
(*gameStatus)->bSkipIntro = FALSE;
gGameStatusPtr->loadMenuState = 0;
gGameStatusPtr->menuCounter = 0;
gGameStatusPtr->bSkipIntro = FALSE;
intro_logos_set_fade_alpha(255);
intro_logos_set_fade_color(0);
@ -105,9 +104,9 @@ void state_init_logos(void) {
use_default_background_settings();
clear_entity_data(1);
clear_effect_data();
OVERRIDE_FLAG_SET(0x2);
gOverrideFlags |= 0x2;
intro_logos_update_fade();
(*gameStatus)->enableBackground = FALSE;
gGameStatusPtr->enableBackground = FALSE;
}
//INCLUDE_ASM(s32, "f270_len_1190", state_step_logos);
@ -315,12 +314,9 @@ void state_init_pause(void) {
}
void state_step_pause(void) {
s8* temp800A0921 = &D_800A0921;
s32 temp800A0921_2 = *temp800A0921;
s8* temp800A0920;
s8* temp800A0920_2;
s32 temp800A0921_2 = D_800A0921;
switch (temp800A0921_2) {
switch (D_800A0921) {
case 0:
update_counters();
npc_list_update();
@ -328,30 +324,26 @@ void state_step_pause(void) {
update_effects();
if (D_8009A658[1] == D_8009A64C) {
D_800A0920 = 4;
*temp800A0921 = 2;
OVERRIDE_FLAG_SET(0x8);
D_800A0921 = 2;
gOverrideFlags |= 0x8;
gGameStatusPtr->enableBackground &= ~0xF0;
gGameStatusPtr->enableBackground |= 0x10;
}
break;
case 2:
temp800A0920 = &D_800A0920;
if (*temp800A0920 >= 0) {
GameStatus** gameStatus;
if (*temp800A0920 != 0) {
(*temp800A0920)--;
if (D_800A0920 >= 0) {
if (D_800A0920 != 0) {
(D_800A0920)--;
}
if (*temp800A0920 == 0) {
*temp800A0920 = -1;
if (D_800A0920 == 0) {
D_800A0920 = -1;
nuGfxSetCfb(&D_80077950, 2);
gameStatus = &gGameStatusPtr;
(*gameStatus)->unk_15E = (*gameStatus)->unk_15C;
gGameStatusPtr->unk_15E = gGameStatusPtr->unk_15C;
sfx_stop_env_sounds();
func_8003B1A8();
(*gameStatus)->isBattle = temp800A0921_2;
gGameStatusPtr->isBattle = temp800A0921_2;
allocate_hit_tables();
battle_heap_create();
nuContRmbForceStop();
@ -376,7 +368,7 @@ void state_step_pause(void) {
bgm_quiet_max_volume();
nuPiReadRomOverlay(&D_8007795C);
pause_init();
OVERRIDE_FLAG_UNSET(0x8);
gOverrideFlags &= ~0x8;
}
if (D_800A0920 >= 0) {
@ -384,10 +376,9 @@ void state_step_pause(void) {
}
}
temp800A0920_2 = &D_800A0920;
if (*temp800A0920_2 >= -10) {
if (D_800A0920 >= -10) {
pause_handle_input(0, 0);
(*temp800A0920_2)--;
D_800A0920--;
} else {
pause_handle_input(gGameStatusPtr->pressedButtons, gGameStatusPtr->heldButtons);
}
@ -409,48 +400,39 @@ void state_init_unpause(void) {
}
void state_step_unpause(void) {
s8* temp800A0921 = &D_800A0921;
switch (*temp800A0921) {
s8* temp800A0920;
s16* temp800A0922;
s16* temp800A0922_2;
switch (D_800A0921) {
case 0:
case 1:
temp800A0920 = &D_800A0920;
if (*temp800A0920 == 4) {
OVERRIDE_FLAG_SET(0x8);
if (D_800A0920 == 4) {
gOverrideFlags |= 0x8;
}
if (*temp800A0920 >= 0) {
if (*temp800A0920 != 0) {
(*temp800A0920)--;
if (D_800A0920 >= 0) {
if (D_800A0920 != 0) {
(D_800A0920)--;
}
if (*temp800A0920 == 0) {
if (*temp800A0920 == 0) {
GameStatus** gameStatus = &gGameStatusPtr;
if (D_800A0920 == 0) {
if (D_800A0920 == 0) {
PlayerStatus* playerStatus;
MapConfig* mapConfig;
Map* map;
s32 assetData;
s32 assetSize;
*temp800A0920 = -1;
D_800A0920 = -1;
nuGfxSetCfb(&D_80077950, ARRAY_COUNT(D_80077950));
pause_cleanup();
OVERRIDE_FLAG_UNSET(0x8);
gOverrideFlags &= ~0x8;
mapConfig = get_current_map_header();
map = &gAreas[(*gameStatus)->areaID].maps[(*gameStatus)->mapID];
(*gameStatus)->isBattle = FALSE;
(*gameStatus)->enableBackground &= ~0xF0;
map = &gAreas[gGameStatusPtr->areaID].maps[gGameStatusPtr->mapID];
gGameStatusPtr->isBattle = FALSE;
gGameStatusPtr->enableBackground &= ~0xF0;
func_8005AF84();
func_8002ACDC();
nuContRmbForceStopEnd();
func_80149670(1);
spr_init_sprites((*gameStatus)->unk_84);
spr_init_sprites(gGameStatusPtr->unk_84);
init_model_data();
func_801480F0();
init_entity_models();
@ -499,10 +481,9 @@ void state_step_unpause(void) {
update_player();
update_effects();
temp800A0922_2 = &D_800A0922;
*temp800A0922_2 -= 20;
if (*temp800A0922_2 < 0) {
*temp800A0922_2 = 0;
D_800A0922 -= 20;
if (D_800A0922 < 0) {
D_800A0922 = 0;
}
}
}
@ -514,13 +495,12 @@ void state_step_unpause(void) {
update_player();
update_effects();
temp800A0922 = &D_800A0922;
if (*temp800A0922 == 0) {
*temp800A0921 = 4;
if (D_800A0922 == 0) {
D_800A0921 = 4;
} else {
*temp800A0922 -= 20;
if (*temp800A0922 < 0) {
*temp800A0922 = 0;
D_800A0922 -= 20;
if (D_800A0922 < 0) {
D_800A0922 = 0;
}
}
break;

View File

@ -37,15 +37,14 @@ u32 func_80025D74(void* arg0, const unsigned char* str, s32 count) {
s32 pos;
s32 start;
s32 end;
OSPiHandle** handle = &carthandle;
osEPiReadIo(*handle, 0xB3FF0000, &data);
osEPiReadIo(carthandle, 0xB3FF0000, &data);
if (data != ASCII_TO_U32('I', 'S', '6', '4')) {
return 1;
}
osEPiReadIo(*handle, 0xB3FF0004, &data);
osEPiReadIo(carthandle, 0xB3FF0004, &data);
pos = data;
osEPiReadIo(*handle, 0xB3FF0014, &data);
osEPiReadIo(carthandle, 0xB3FF0014, &data);
start = data;
end = start + count;
if (end >= 0xffe0) {
@ -62,10 +61,9 @@ u32 func_80025D74(void* arg0, const unsigned char* str, s32 count) {
if (*str) {
u32 addr = 0xB3FF0020 + (start & 0xffffffc);
s32 shift = ((3 - (start & 3)) * 8);
OSPiHandle** handle2 = &carthandle;
osEPiReadIo(*handle2, addr, &data);
osEPiWriteIo(*handle2, addr, (data & ~(0xff << shift)) | (*str << shift));
osEPiReadIo(carthandle, addr, &data);
osEPiWriteIo(carthandle, addr, (data & ~(0xff << shift)) | (*str << shift));
start++;
if (start >= 0xffe0) {

View File

@ -220,10 +220,10 @@ s32 N(func_80240000_BDD1B0)(ScriptInstance* script, NpcAISettings* aiSettings, E
playerStatus = &gPlayerStatusPtr;
if (fabsf(get_clamped_angle_diff(phi_f20,
atan2(npc->pos.x, npc->pos.z,
(*playerStatus)->position.x, (*playerStatus)->position.z))) > 75.0) {
gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z))) > 75.0) {
ret = FALSE;
}
if (fabsf(npc->pos.y - (*playerStatus)->position.y) >= 40.0f) {
if (fabsf(npc->pos.y - gPlayerStatusPtr->position.y) >= 40.0f) {
ret = FALSE;
}
if (D_8010EBB0.unk_03 == 9) {
@ -260,14 +260,12 @@ void N(func_802401D4_BDD384)(ScriptInstance* script, NpcAISettings* aiSettings,
#include "world/common/UnkNpcAIFunc22.inc.c"
void N(func_802404D0_BDD680)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
PlayerStatus** playerStatus;
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
s32 var;
if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) {
playerStatus = &gPlayerStatusPtr;
npc->yaw = atan2(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z);
npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
script->functionTemp[0].s = 12;
} else {
npc->duration--;
@ -290,23 +288,20 @@ void N(func_802404D0_BDD680)(ScriptInstance* script, NpcAISettings* aiSettings,
void N(func_80240694_BDD844)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
PlayerStatus** playerStatus = &gPlayerStatusPtr;
npc->yaw = atan2(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z);
npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
if (npc->duration % 3 == 0) {
fx_walk_normal(2, npc->pos.x, npc->pos.y, npc->pos.z + 2.0f, 0, 0);
}
npc->duration--;
if (npc->duration <= 0) {
playerStatus = &gPlayerStatusPtr;
enemy->unk_10.x = npc->pos.x;
enemy->unk_10.y = npc->pos.y;
enemy->unk_10.z = npc->pos.z;
enemy->unk_07 = 1;
npc->moveSpeed = aiSettings->chaseSpeed;
npc->duration = dist2D(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z) / npc->moveSpeed + 0.9;
npc->duration = dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) / npc->moveSpeed + 0.9;
if (npc->duration < 15) {
npc->duration = 15;
}
@ -369,10 +364,9 @@ void N(func_80240984_BDDB34)(ScriptInstance* script, NpcAISettings* aiSettings,
void N(func_80240A30_BDDBE0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
PlayerStatus** playerStatus = &gPlayerStatusPtr;
if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z);
npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
script->functionTemp[0].s = 12;
} else if (dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z) <= npc->moveSpeed) {
npc->duration = 10;

View File

@ -1264,29 +1264,21 @@ ApiStatus N(func_80241648_BE03D8)(ScriptInstance* script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
#ifdef NON_MATCHING
ApiStatus func_80241680_BE0410(ScriptInstance* script, s32 isInitialCall) {
ApiStatus N(func_80241680_BE0410)(ScriptInstance* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32* temp_v0 = get_variable(script, *args);
s32* ptr = temp_v0;
s32* var1 = get_variable(script, *args++);
s32 i;
i = 0;
if (ptr != NULL) {
s32 new_var;
for (new_var = ptr[0]; new_var != 0; i++) {
*(D_80244A20 + i) = ptr[i];
if (var1 != NULL) {
for (i = 0; var1[i] != 0; i++) {
D_80244A20[i] = var1[i];
}
D_80244A20[i] = 0;
} else {
for (; i < 0x70; i++) {
*(D_80244A20 + i) = i + 16;
for (i = 0; i < 0x70; i++) {
D_80244A20[i] = i + 16;
D_80244A20[0x70] = 0;
}
}
return ApiStatus_DONE2;
}
#else
INCLUDE_ASM(s32, "world/area_arn/arn_03/BDED90", arn_03_func_80241680_BE0410, ScriptInstance* script, s32 isInitialCall);
#endif

View File

@ -984,10 +984,10 @@ s32 N(func_80242388_BE5B38)(ScriptInstance* script, NpcAISettings *aiSettings, E
playerStatus = &gPlayerStatusPtr;
if (fabsf(get_clamped_angle_diff(phi_f20,
atan2(npc->pos.x, npc->pos.z,
(*playerStatus)->position.x, (*playerStatus)->position.z))) > 75.0) {
gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z))) > 75.0) {
ret = FALSE;
}
if (fabsf(npc->pos.y - (*playerStatus)->position.y) >= 40.0f) {
if (fabsf(npc->pos.y - gPlayerStatusPtr->position.y) >= 40.0f) {
ret = FALSE;
}
if (D_8010EBB0.unk_03 == 9) {
@ -1024,14 +1024,12 @@ void N(func_8024255C_BE5D0C)(ScriptInstance* script, NpcAISettings* aiSettings,
#include "world/common/UnkNpcAIFunc22.inc.c"
void N(func_80242858_BE6008)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
PlayerStatus** playerStatus;
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
s32 var;
if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) {
playerStatus = &gPlayerStatusPtr;
npc->yaw = atan2(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z);
npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
script->functionTemp[0].s = 12;
} else {
npc->duration--;
@ -1054,23 +1052,21 @@ void N(func_80242858_BE6008)(ScriptInstance* script, NpcAISettings* aiSettings,
void N(func_80242A1C_BE61CC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
PlayerStatus** playerStatus = &gPlayerStatusPtr;
npc->yaw = atan2(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z);
npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
if (npc->duration % 3 == 0) {
fx_walk_normal(2, npc->pos.x, npc->pos.y, npc->pos.z + 2.0f, 0, 0);
}
npc->duration--;
if (npc->duration <= 0) {
playerStatus = &gPlayerStatusPtr;
enemy->unk_10.x = npc->pos.x;
enemy->unk_10.y = npc->pos.y;
enemy->unk_10.z = npc->pos.z;
enemy->unk_07 = 1;
npc->moveSpeed = aiSettings->chaseSpeed;
npc->duration = dist2D(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z) / npc->moveSpeed + 0.9;
npc->duration = dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) / npc->moveSpeed + 0.9;
if (npc->duration < 15) {
npc->duration = 15;
}
@ -1133,10 +1129,9 @@ void N(func_80242D0C_BE64BC)(ScriptInstance* script, NpcAISettings* aiSettings,
void N(func_80242DB8_BE6568)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
PlayerStatus** playerStatus = &gPlayerStatusPtr;
if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z);
npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
script->functionTemp[0].s = 12;
} else if (dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z) <= npc->moveSpeed) {
npc->duration = 10;

View File

@ -422,7 +422,6 @@ NpcGroupList N(npcGroupList_802425C8) = {
#include "world/common/UnkNpcAIFunc5.inc.c"
s32 N(func_80240208_C2EDA8)(ScriptInstance *script) {
PlayerStatus** playerStatus = &gPlayerStatusPtr;
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Camera* camera = CAM2(gCurrentCamID);
@ -430,7 +429,7 @@ s32 N(func_80240208_C2EDA8)(ScriptInstance *script) {
f32 phi_f20;
s32 ret = TRUE;
if (dist2D(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z) > enemy2->varTable[2]) {
if (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) > enemy2->varTable[2]) {
ret = FALSE;
}
@ -440,11 +439,11 @@ s32 N(func_80240208_C2EDA8)(ScriptInstance *script) {
phi_f20 = 270.0f;
}
if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z))) > enemy2->varTable[3]) {
if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z))) > enemy2->varTable[3]) {
ret = FALSE;
}
if ((2.0 * npc->collisionHeight) <= fabsf(npc->pos.y - (*playerStatus)->position.y)) {
if ((2.0 * npc->collisionHeight) <= fabsf(npc->pos.y - gPlayerStatusPtr->position.y)) {
ret = FALSE;
}

View File

@ -747,7 +747,6 @@ NpcGroupList N(npcGroupList_80244988) = {
#include "world/common/UnkNpcAIFunc5.inc.c"
s32 N(func_80240458_C31938)(ScriptInstance *script) {
PlayerStatus** playerStatus = &gPlayerStatusPtr;
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Camera* camera = CAM2(gCurrentCamID);
@ -755,7 +754,7 @@ s32 N(func_80240458_C31938)(ScriptInstance *script) {
f32 phi_f20;
s32 ret = TRUE;
if (dist2D(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z) > enemy2->varTable[2]) {
if (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) > enemy2->varTable[2]) {
ret = FALSE;
}
@ -765,11 +764,11 @@ s32 N(func_80240458_C31938)(ScriptInstance *script) {
phi_f20 = 270.0f;
}
if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z))) > enemy2->varTable[3]) {
if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z))) > enemy2->varTable[3]) {
ret = FALSE;
}
if ((2.0 * npc->collisionHeight) <= fabsf(npc->pos.y - (*playerStatus)->position.y)) {
if ((2.0 * npc->collisionHeight) <= fabsf(npc->pos.y - gPlayerStatusPtr->position.y)) {
ret = FALSE;
}

View File

@ -1131,7 +1131,7 @@ ApiStatus N(func_80242154_C38684)(ScriptInstance *script, s32 isInitialCall) {
#include "world/common/SetOverrideFlags_40.inc.c"
ApiStatus N(func_802423EC_C3891C)(ScriptInstance *script, s32 isInitialCall) {
OVERRIDE_FLAG_UNSET(0x40)
gOverrideFlags &= ~0x40;
return ApiStatus_DONE2;
}

View File

@ -357,7 +357,6 @@ ApiStatus N(func_80240030_C3AA40)(ScriptInstance *script, s32 isInitialCall) {
#include "world/common/UnkNpcAIFunc5.inc.c"
s32 N(func_80240268_C3AC78)(ScriptInstance *script) {
PlayerStatus** playerStatus = &gPlayerStatusPtr;
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Camera* camera = CAM2(gCurrentCamID);
@ -365,7 +364,7 @@ s32 N(func_80240268_C3AC78)(ScriptInstance *script) {
f32 phi_f20;
s32 ret = TRUE;
if (dist2D(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z) > enemy2->varTable[2]) {
if (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) > enemy2->varTable[2]) {
ret = FALSE;
}
@ -375,11 +374,11 @@ s32 N(func_80240268_C3AC78)(ScriptInstance *script) {
phi_f20 = 270.0f;
}
if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z))) > enemy2->varTable[3]) {
if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z))) > enemy2->varTable[3]) {
ret = FALSE;
}
if ((2.0 * npc->collisionHeight) <= fabsf(npc->pos.y - (*playerStatus)->position.y)) {
if ((2.0 * npc->collisionHeight) <= fabsf(npc->pos.y - gPlayerStatusPtr->position.y)) {
ret = FALSE;
}

View File

@ -266,7 +266,6 @@ static const s32 N(pad_1E74)[] = {
#include "world/common/UnkNpcAIFunc5.inc.c"
s32 N(func_80240208_C3DDF8)(ScriptInstance *script) {
PlayerStatus** playerStatus = &gPlayerStatusPtr;
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Camera* camera = CAM2(gCurrentCamID);
@ -274,7 +273,7 @@ s32 N(func_80240208_C3DDF8)(ScriptInstance *script) {
f32 phi_f20;
s32 ret = TRUE;
if (dist2D(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z) > enemy2->varTable[2]) {
if (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) > enemy2->varTable[2]) {
ret = FALSE;
}
@ -284,11 +283,11 @@ s32 N(func_80240208_C3DDF8)(ScriptInstance *script) {
phi_f20 = 270.0f;
}
if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z))) > enemy2->varTable[3]) {
if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z))) > enemy2->varTable[3]) {
ret = FALSE;
}
if ((2.0 * npc->collisionHeight) <= fabsf(npc->pos.y - (*playerStatus)->position.y)) {
if ((2.0 * npc->collisionHeight) <= fabsf(npc->pos.y - gPlayerStatusPtr->position.y)) {
ret = FALSE;
}

View File

@ -1228,7 +1228,6 @@ ApiStatus N(func_80240B94_C40944)(ScriptInstance *script, s32 isInitialCall) {
#include "world/common/UnkNpcAIFunc5.inc.c"
s32 N(func_80241098_C40E48)(ScriptInstance *script) {
PlayerStatus** playerStatus = &gPlayerStatusPtr;
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Camera* camera = CAM2(gCurrentCamID);
@ -1236,7 +1235,7 @@ s32 N(func_80241098_C40E48)(ScriptInstance *script) {
f32 phi_f20;
s32 ret = TRUE;
if (dist2D(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z) > enemy2->varTable[2]) {
if (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) > enemy2->varTable[2]) {
ret = FALSE;
}
@ -1246,11 +1245,11 @@ s32 N(func_80241098_C40E48)(ScriptInstance *script) {
phi_f20 = 270.0f;
}
if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z))) > enemy2->varTable[3]) {
if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z))) > enemy2->varTable[3]) {
ret = FALSE;
}
if ((2.0 * npc->collisionHeight) <= fabsf(npc->pos.y - (*playerStatus)->position.y)) {
if ((2.0 * npc->collisionHeight) <= fabsf(npc->pos.y - gPlayerStatusPtr->position.y)) {
ret = FALSE;
}
@ -1935,8 +1934,8 @@ void N(func_80242F94_C42D44)(ScriptInstance *script, NpcAISettings *aiSettings,
} else {
PlayerStatus** playerStatus = &gPlayerStatusPtr;
npc->pos.x = (*playerStatus)->position.x;
npc->pos.z = (*playerStatus)->position.z + 2.0f;
npc->pos.x = gPlayerStatusPtr->position.x;
npc->pos.z = gPlayerStatusPtr->position.z + 2.0f;
npc->rotation.y += 25.0f;
if (npc->rotation.y > 360.0) {
npc->rotation.y -= 360.0;
@ -1944,9 +1943,9 @@ void N(func_80242F94_C42D44)(ScriptInstance *script, NpcAISettings *aiSettings,
temp_f8_2 = 255.0f - (cosine((s32)npc->rotation.y % 180) * 56.0f);
func_802DE894(npc->spriteInstanceID, 6, temp_f8_2, temp_f8_2, temp_f8_2, 255, 0);
posX = (*playerStatus)->position.x;
posY = (*playerStatus)->position.y;
posZ = (*playerStatus)->position.z;
posX = gPlayerStatusPtr->position.x;
posY = gPlayerStatusPtr->position.y;
posZ = gPlayerStatusPtr->position.z;
posW = 1000.0f;
func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW);
if (fabsf(npc->pos.y - posY) > 24.0) {

View File

@ -607,7 +607,6 @@ NpcGroupList N(npcGroupList_8024533C) = {
#include "world/common/UnkNpcAIFunc5.inc.c"
s32 N(func_80240208_C46DE8)(ScriptInstance *script) {
PlayerStatus** playerStatus = &gPlayerStatusPtr;
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Camera* camera = CAM2(gCurrentCamID);
@ -615,7 +614,7 @@ s32 N(func_80240208_C46DE8)(ScriptInstance *script) {
f32 phi_f20;
s32 ret = TRUE;
if (dist2D(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z) > enemy2->varTable[2]) {
if (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) > enemy2->varTable[2]) {
ret = FALSE;
}
@ -625,11 +624,11 @@ s32 N(func_80240208_C46DE8)(ScriptInstance *script) {
phi_f20 = 270.0f;
}
if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z))) > enemy2->varTable[3]) {
if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z))) > enemy2->varTable[3]) {
ret = FALSE;
}
if ((2.0 * npc->collisionHeight) <= fabsf(npc->pos.y - (*playerStatus)->position.y)) {
if ((2.0 * npc->collisionHeight) <= fabsf(npc->pos.y - gPlayerStatusPtr->position.y)) {
ret = FALSE;
}
@ -1587,8 +1586,8 @@ void N(func_80242C1C_C497FC)(ScriptInstance *script, NpcAISettings *aiSettings,
} else {
PlayerStatus** playerStatus = &gPlayerStatusPtr;
npc->pos.x = (*playerStatus)->position.x;
npc->pos.z = (*playerStatus)->position.z + 2.0f;
npc->pos.x = gPlayerStatusPtr->position.x;
npc->pos.z = gPlayerStatusPtr->position.z + 2.0f;
npc->rotation.y += 25.0f;
if (npc->rotation.y > 360.0) {
npc->rotation.y -= 360.0;
@ -1596,9 +1595,9 @@ void N(func_80242C1C_C497FC)(ScriptInstance *script, NpcAISettings *aiSettings,
temp_f8_2 = 255.0f - (cosine((s32)npc->rotation.y % 180) * 56.0f);
func_802DE894(npc->spriteInstanceID, 6, temp_f8_2, temp_f8_2, temp_f8_2, 255, 0);
posX = (*playerStatus)->position.x;
posY = (*playerStatus)->position.y;
posZ = (*playerStatus)->position.z;
posX = gPlayerStatusPtr->position.x;
posY = gPlayerStatusPtr->position.y;
posZ = gPlayerStatusPtr->position.z;
posW = 1000.0f;
func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW);
if (fabsf(npc->pos.y - posY) > 24.0) {

View File

@ -327,16 +327,15 @@ ApiStatus N(func_802400A0_C4C430)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_8024013C_C4C4CC)(ScriptInstance *script, s32 isInitialCall) {
PlayerStatus* playerStatus = &gPlayerStatus;
PlayerStatus* playerStatus2 = playerStatus;
s32 var;
if (playerStatus->position.y >= 0.0f) {
return 0;
}
if (playerStatus2->position.x < 440.0f) {
if (playerStatus->position.x < 440.0f) {
var = 3;
} else if (playerStatus2->position.z < -170.0f) {
} else if (playerStatus->position.z < -170.0f) {
var = 2;
} else {
var = 1;

View File

@ -453,7 +453,6 @@ Script N(makeEntities) = SCRIPT({
#include "world/common/UnkNpcAIFunc5.inc.c"
s32 N(func_80240208_C4F718)(ScriptInstance *script) {
PlayerStatus** playerStatus = &gPlayerStatusPtr;
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Camera* camera = CAM2(gCurrentCamID);
@ -461,7 +460,7 @@ s32 N(func_80240208_C4F718)(ScriptInstance *script) {
f32 phi_f20;
s32 ret = TRUE;
if (dist2D(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z) > enemy2->varTable[2]) {
if (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) > enemy2->varTable[2]) {
ret = FALSE;
}
@ -471,11 +470,11 @@ s32 N(func_80240208_C4F718)(ScriptInstance *script) {
phi_f20 = 270.0f;
}
if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z))) > enemy2->varTable[3]) {
if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z))) > enemy2->varTable[3]) {
ret = FALSE;
}
if ((2.0 * npc->collisionHeight) <= fabsf(npc->pos.y - (*playerStatus)->position.y)) {
if ((2.0 * npc->collisionHeight) <= fabsf(npc->pos.y - gPlayerStatusPtr->position.y)) {
ret = FALSE;
}

View File

@ -623,7 +623,6 @@ NpcGroupList N(npcGroupList_8024318C) = {
#include "world/common/UnkNpcAIFunc5.inc.c"
s32 N(func_80240208_C52748)(ScriptInstance *script) {
PlayerStatus** playerStatus = &gPlayerStatusPtr;
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Camera* camera = CAM2(gCurrentCamID);
@ -631,7 +630,7 @@ s32 N(func_80240208_C52748)(ScriptInstance *script) {
f32 phi_f20;
s32 ret = TRUE;
if (dist2D(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z) > enemy2->varTable[2]) {
if (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) > enemy2->varTable[2]) {
ret = FALSE;
}
@ -641,11 +640,11 @@ s32 N(func_80240208_C52748)(ScriptInstance *script) {
phi_f20 = 270.0f;
}
if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z))) > enemy2->varTable[3]) {
if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z))) > enemy2->varTable[3]) {
ret = FALSE;
}
if ((2.0 * npc->collisionHeight) <= fabsf(npc->pos.y - (*playerStatus)->position.y)) {
if ((2.0 * npc->collisionHeight) <= fabsf(npc->pos.y - gPlayerStatusPtr->position.y)) {
ret = FALSE;
}

View File

@ -952,7 +952,6 @@ ApiStatus N(func_80240B94_C56AD4)(ScriptInstance* script, s32 isInitialCall) {
ApiStatus N(func_80240EBC_C56DFC)(ScriptInstance *script, s32 isInitialCall) {
PlayerStatus* playerStatus = &gPlayerStatus;
PlayerStatus* playerStatus2 = playerStatus;
Npc *npc = get_npc_unsafe(0);
f32 posX, posZ;
@ -967,7 +966,7 @@ ApiStatus N(func_80240EBC_C56DFC)(ScriptInstance *script, s32 isInitialCall) {
if (script->functionTemp[1].s == 0) {
if (npc->duration == 0) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, playerStatus2->position.x, playerStatus2->position.z);
npc->yaw = atan2(npc->pos.x, npc->pos.z, playerStatus->position.x, playerStatus->position.z);
npc->duration = 15;
}
npc->duration--;

View File

@ -5,7 +5,7 @@
INCLUDE_ASM(s32, "world/area_pra/pra_01/D4D060", func_80240F20_D4DF60);
ApiStatus func_80240F60_D4DFA0(ScriptInstance* script, s32 isInitialCall) {
OVERRIDE_FLAG_UNSET(0x80);
gOverrideFlags &= ~0x80;
return ApiStatus_DONE2;
}

View File

@ -12,7 +12,7 @@ ApiStatus N(AddPlayerHandsOffset)(ScriptInstance* script, s32 isInitialCall) {
f32 z = (f32)get_variable(script, zVar);
f32 cameraYaw;
cameraYaw = CURRENT_CAM->currentYaw;
cameraYaw = gCameras[gCurrentCameraID].currentYaw;
if (playerStatus->spriteFacingAngle == 0.0f) {
cameraYaw -= 100.0f;

View File

@ -2,8 +2,6 @@
#include "map.h"
ApiStatus N(GetCurrentCameraYawClamped180)(ScriptInstance* script, s32 isInitialCall) {
Camera* currentCamera = CURRENT_CAM;
script->varTable[0] = clamp_angle(currentCamera->currentYaw + 180.0f);
script->varTable[0] = clamp_angle(gCameras[gCurrentCameraID].currentYaw + 180.0f);
return ApiStatus_DONE2;
}

View File

@ -2,6 +2,6 @@
#include "map.h"
ApiStatus N(SetOverrideFlags_40)(ScriptInstance* script, s32 isInitialCall) {
OVERRIDE_FLAG_SET(0x40);
gOverrideFlags |= 0x40;
return ApiStatus_DONE2;
}

View File

@ -8,7 +8,7 @@ ApiStatus N(UnkCameraFunc)(ScriptInstance* script, s32 isInitialCall) {
s32 var2 = get_variable(script, *args++);
Bytecode out1 = *args++;
Bytecode out2 = *args++;
s32 cameraYaw = CURRENT_CAM->currentYaw;
s32 cameraYaw = gCameras[gCurrentCameraID].currentYaw;
s32 outVal1 = get_variable(script, SI_ARRAY(1)) - (var2 * cos_deg(cameraYaw));
s32 outVal2 = get_variable(script, SI_ARRAY(3)) - (var2 * sin_deg(cameraYaw));

View File

@ -2,6 +2,6 @@
#include "map.h"
ApiStatus N(UnkFunc17)(ScriptInstance *script, s32 isInitialCall) {
OVERRIDE_FLAG_UNSET(0x40)
gOverrideFlags &= ~0x40;
return ApiStatus_DONE2;
}
}

View File

@ -3,7 +3,6 @@
ApiStatus N(UnkMoveFunc1)(ScriptInstance* script, s32 isInitialCall) {
BattleStatus* battleStatus = &gBattleStatus;
BattleStatus* secondBattleStatus = &gBattleStatus;
Actor* playerActor = battleStatus->playerActor;
f32 posX = playerActor->currentPos.x;
f32 posY = playerActor->currentPos.y;
@ -18,7 +17,7 @@ ApiStatus N(UnkMoveFunc1)(ScriptInstance* script, s32 isInitialCall) {
script->varTable[0] = 20;
}
if (secondBattleStatus->unk_83 != 0) {
if (battleStatus->unk_83 != 0) {
if (script->varTable[0] < 6) {
script->varTable[0] = 6;
}

View File

@ -10,7 +10,7 @@ ApiStatus N(UnkYawFunc)(ScriptInstance* script, s32 isInitialCall) {
s32 a2 = *args++;
f32 c = get_variable(script, a2);
Npc* partner = get_npc_unsafe(NPC_PARTNER);
f32 currentCamYaw = clamp_angle(CURRENT_CAM->currentYaw + 180.0f);
f32 currentCamYaw = clamp_angle(gCameras[gCurrentCameraID].currentYaw + 180.0f);
add_vec2D_polar(&a, &c, 15.0f, partner->yaw);
add_vec2D_polar(&a, &c, 10.0f, currentCamYaw);

View File

@ -143,7 +143,7 @@ ApiStatus N(ReflectFloor)(ScriptInstance* script, s32 isInitialCall) {
case REFLECTION_FLOOR_WALL:
case REFLECTION_FLOOR:
script->array[0] = create_dynamic_entity_world(NULL, N(reflection_setup_floor));
OVERRIDE_FLAG_SET(0x80);
gOverrideFlags |= 0x80;
break;
case REFLECTION_WALL:
break;

View File

@ -58,21 +58,18 @@ ApiStatus func_802BDB84(ScriptInstance* script, s32 isInitialCall) {
}
void world_goombario_pre_battle(Npc* partner) {
// TODO fake match nonsense
s8* new_var = &D_8010EBB0.unk_00;
s8* new_var2 = &D_8010EBB0.unk_00;
new_var = new_var2;
Temp8010EBB0* temp = &D_8010EBB0;
if (*new_var != 0) {
if (temp->unk_00 != 0) {
set_time_freeze_mode(0);
enable_player_input();
CancelMessageAndBlock();
clear_partner_move_history(partner);
D_8010EBB0.unk_00 = 0;
D_8010EBB0.unk_03 = 0;
temp->unk_00 = 0;
temp->unk_03 = 0;
disable_npc_blur(partner);
}
D_8010EBB0.unk_03 = 1;
temp->unk_03 = 1;
}
s32 D_802BDC40_317B60[] = {

View File

@ -432,20 +432,14 @@ s32 partner_can_use_ability(void) {
void partner_reset_data(void) {
PlayerStatus* playerStatus = &gPlayerStatus;
s32* temp8010CFD8;
s32* temp8010CFE8;
s32 temp_s0;
s32 currentPartner = gPlayerData.currentPartner;
temp_s0 = gPlayerData.currentPartner;
mem_clear(&D_8010EBB0, sizeof(D_8010EBB0));
get_dynamic_entity(create_dynamic_entity_frontUI(_use_partner_ability, NULL));
temp8010CFD8 = &D_8010CFD8;
temp8010CFE8 = &D_8010CFE8;
D_8010CFE0 = 1;
*temp8010CFE8 = 9;
*temp8010CFD8 = temp_s0;
D_8010CFE8 = 9;
D_8010CFD8 = currentPartner;
if (gGameStatusPtr->unk_7D != 0) {
D_8010EBB0.unk_00 = 1;
@ -457,8 +451,8 @@ void partner_reset_data(void) {
D_800F8340 = playerStatus->position.y;
D_800F8344 = playerStatus->position.z;
if (*temp8010CFD8 == 0) {
*temp8010CFE8 = 1;
if (D_8010CFD8 == 0) {
D_8010CFE8 = 1;
} else {
load_partner_npc();
wPartnerNpc->scale.x = 1.0f;
@ -518,27 +512,25 @@ void partner_handle_before_battle(void) {
}
void partner_handle_after_battle(void) {
s8* temp8010EBB0 = &D_8010EBB0;
Temp8010EBB0* temp8010EBB0 = &D_8010EBB0;
PlayerData* playerData = &gPlayerData;
if (D_8010CFD8 != 0) {
ScriptID* scriptID = &D_8010CFDC;
PlayerData* playerData = &gPlayerData;
if (does_script_exist(*scriptID) != 0) {
kill_script_by_ID(*scriptID);
if (does_script_exist(D_8010CFDC) != 0) {
kill_script_by_ID(D_8010CFDC);
}
D_8010CFD4 = start_script(wPartner->update, 20, 0x20);
D_8010CFD4->owner2.npc = wPartnerNpc;
*scriptID = D_8010CFD4->id;
D_8010CFDC = D_8010CFD4->id;
D_8010CFD4->groupFlags = 0xA;
D_8010CFE8 = 1;
if (playerData->currentPartner != PARTNER_WATT && temp8010EBB0[3] == 6) {
if (playerData->currentPartner != PARTNER_WATT && temp8010EBB0->unk_03 == 6) {
gPlayerStatusPtr->animFlags &= ~1;
gPlayerStatusPtr->animFlags &= ~2;
temp8010EBB0[3] = 0;
temp8010EBB0->unk_03 = 0;
}
if (wPartner->postBattle != NULL) {
@ -646,15 +638,13 @@ void func_800EF314(void) {
}
void enable_partner_ai(void) {
WorldPartner** partner = &wPartnerNpc;
D_8010CFC8 = 0;
clear_partner_move_history(*partner);
clear_partner_move_history(wPartnerNpc);
if (!wPartner->isFlying) {
enable_partner_walking(*partner, FALSE);
enable_partner_walking(wPartnerNpc, FALSE);
} else {
enable_partner_flying(*partner, FALSE);
enable_partner_flying(wPartnerNpc, FALSE);
}
}
@ -700,7 +690,6 @@ INCLUDE_ASM(void, "world/partners", clear_partner_move_history, Npc* partner);
s32 func_800EF4E0(void) {
PlayerStatus* playerStatus = &gPlayerStatus;
Camera* cameras = &gCameras;
Camera* cameras2 = cameras;
f32 yaw;
s32 ret;
@ -714,10 +703,10 @@ s32 func_800EF4E0(void) {
}
} else if (get_clamped_angle_diff(cameras[0].currentYaw, playerStatus->targetYaw) < 0.0f) {
ret = 1;
yaw = clamp_angle(cameras2[0].currentYaw - 90.0f);
yaw = clamp_angle(cameras[0].currentYaw - 90.0f);
} else {
yaw = clamp_angle(cameras2[0].currentYaw + 90.0f);
ret = 0;
yaw = clamp_angle(cameras[0].currentYaw + 90.0f);
}
playerStatus->targetYaw = yaw;

View File

@ -67,18 +67,16 @@ INCLUDE_ASM(s32, "world/script_api/7E2AA0", func_80282414);
#ifdef NON_MATCHING
ApiStatus func_80282594(ScriptInstance* script, s32 isInitialCall) {
Camera* camera;
Camera* camera2;
f32 temp_f0;
temp_f0 = get_float_variable(script, *script->ptrReadPos);
camera = CAM(0);
camera2 = CAM(0);
if (temp_f0 >= 0.0f) {
D_80286540 = camera->moveSpeed;
camera2->moveSpeed = temp_f0;
camera->moveSpeed = temp_f0;
} else {
camera2->moveSpeed = D_80286540;
camera->moveSpeed = D_80286540;
}
return ApiStatus_DONE2;

View File

@ -20,7 +20,6 @@ ApiStatus func_80283810(ScriptInstance* script, s32 isInitialCall) {
ApiStatus TeleportPartnerToPlayer(ScriptInstance* script, s32 isInitialCall) {
PlayerStatus* playerStatus = &gPlayerStatus;
PlayerStatus* playerStatus2 = &gPlayerStatus;
Npc* partner;
if (gPlayerData.currentPartner == PARTNER_NONE) {
@ -35,18 +34,15 @@ ApiStatus TeleportPartnerToPlayer(ScriptInstance* script, s32 isInitialCall) {
partner->pos.y = playerStatus->position.y;
}
set_npc_yaw(partner, playerStatus2->targetYaw);
set_npc_yaw(partner, playerStatus->targetYaw);
clear_partner_move_history(partner);
return ApiStatus_DONE2;
}
// currentPartner is being loaded as unsigned instead of signed
#ifdef NON_MATCHING
ApiStatus func_80283908(ScriptInstance* script, s32 isInitialCall) {
PlayerStatus* playerStatus = &gPlayerStatus;
PlayerStatus* playerStatus2 = &gPlayerStatus;
Camera* camera = CURRENT_CAM;
s8 currentPartner = gPlayerData.currentPartner;
Camera* camera = &gCameras[gCurrentCameraID];
s32 currentPartner = gPlayerData.currentPartner;
playerStatus->position.x = gGameStatusPtr->savedPos.x;
playerStatus->position.y = gGameStatusPtr->savedPos.y;
@ -54,20 +50,18 @@ ApiStatus func_80283908(ScriptInstance* script, s32 isInitialCall) {
if (currentPartner != PARTNER_NONE) {
Npc* partner = get_npc_unsafe(NPC_PARTNER);
f32 angle = clamp_angle((playerStatus2->spriteFacingAngle < 180.0f) ? (90.0f) : (-90.0f));
partner->pos.x = playerStatus2->position.x;
partner->pos.y = playerStatus2->position.y;
partner->pos.z = playerStatus2->position.z;
add_vec2D_polar(&partner->pos.x, &partner->pos.z, playerStatus2->colliderDiameter + 5, angle);
f32 angle = clamp_angle((playerStatus->spriteFacingAngle < 180.0f) ? (90.0f) : (-90.0f));
partner->pos.x = playerStatus->position.x;
partner->pos.y = playerStatus->position.y;
partner->pos.z = playerStatus->position.z;
add_vec2D_polar(&partner->pos.x, &partner->pos.z, playerStatus->colliderDiameter + 5, angle);
enable_partner_ai();
}
camera->unk_08 = 1;
return ApiStatus_DONE2;
}
#else
INCLUDE_ASM(s32, "world/script_api/7E4690", func_80283908);
#endif
INCLUDE_ASM(s32, "world/script_api/7E4690", func_80283A50);

View File

@ -51,8 +51,8 @@ void load_map_by_IDs(s16 areaID, s16 mapID, s16 loadType) {
initStatus = 0;
sfx_stop_env_sounds();
OVERRIDE_FLAG_UNSET(0x40);
OVERRIDE_FLAG_UNSET(0x80);
gOverrideFlags &= ~0x40;
gOverrideFlags &= ~0x80;
gameStatus = &gGameStatusPtr;

View File

@ -9,7 +9,13 @@ from glob import glob
# Configuration:
VERSIONS = ["us", "jp"]
DO_SHA1_CHECK = True
CFLAGS = "-Wuninitialized -Wshadow -Wmissing-braces"
CPPFLAGS = "-w -Iver/$version/build/include -Iinclude -Isrc -D _LANGUAGE_C -D _FINALROM -D VERSION=$version " \
"-ffreestanding -DF3DEX_GBI_2 -D_MIPS_SZLONG=32 -MD -MF $out.d"
CFLAGS = "-O2 -quiet -G0 -mcpu=vr4300 -mfix4300 -mips3 -mgp32 -mfp32 -Wuninitialized -Wshadow -Wmissing-braces -fforce-addr"
CFLAGS_NUSYS = "-O2 -quiet -G0 -mcpu=vr4300 -mfix4300 -mips3 -mgp32 -mfp32 -Wuninitialized -Wshadow -Wmissing-braces"
CFLAGS_LIBULTRA = "-O2 -quiet -G0 -mcpu=vr4300 -mfix4300 -mips3 -mgp32 -mfp32 -Wuninitialized -Wshadow -Wmissing-braces"
# Paths:
ROOT = Path(__file__).parent.parent.parent
@ -77,14 +83,28 @@ def write_ninja_rules(ninja: ninja_syntax.Writer, cpp: str):
ninja.rule("cc",
description="cc($version) $in",
command=f"bash -o pipefail -c '{cpp} -w -Iver/$version/build/include -Iinclude -Isrc -D _LANGUAGE_C -D _FINALROM -D VERSION=$version -ffreestanding -DF3DEX_GBI_2 -D_MIPS_SZLONG=32 -MD -MF $out.d $in -o - | {iconv} | {BUILD_TOOLS}/{os_dir}/cc1 -O2 -quiet -G 0 -mcpu=vr4300 -mfix4300 -mips3 -mgp32 -mfp32 {CFLAGS} -o - | {BUILD_TOOLS}/{os_dir}/mips-nintendo-nu64-as -EB -G 0 - -o $out'",
command=f"bash -o pipefail -c '{cpp} {CPPFLAGS} $in -o - | {iconv} | {BUILD_TOOLS}/{os_dir}/cc1 {CFLAGS} -o - | {BUILD_TOOLS}/{os_dir}/mips-nintendo-nu64-as -EB -G 0 - -o $out'",
depfile="$out.d",
deps="gcc",
)
ninja.rule("cc_nusys",
description="cc($version) $in",
command=f"bash -o pipefail -c '{cpp} {CPPFLAGS} $in -o - | {iconv} | {BUILD_TOOLS}/{os_dir}/cc1 {CFLAGS_NUSYS} -o - | {BUILD_TOOLS}/{os_dir}/mips-nintendo-nu64-as -EB -G 0 - -o $out'",
depfile="$out.d",
deps="gcc",
)
ninja.rule("cc_libultra",
description="cc($version) $in",
command=f"bash -o pipefail -c '{cpp} {CPPFLAGS} $in -o - | {iconv} | {BUILD_TOOLS}/{os_dir}/cc1 {CFLAGS_LIBULTRA} -o - | {BUILD_TOOLS}/{os_dir}/mips-nintendo-nu64-as -EB -G 0 - -o $out'",
depfile="$out.d",
deps="gcc",
)
ninja.rule("cc_dsl",
description="cc_dsl($version) $in",
command=f"bash -o pipefail -c '{cpp} -w -Iver/$version/build/include -Iinclude -Isrc -D _LANGUAGE_C -D _FINALROM -D VERSION=$version -ffreestanding -DF3DEX_GBI_2 -D_MIPS_SZLONG=32 -MD -MF $out.d $in -o - | $python {BUILD_TOOLS}/cc_dsl/compile_script.py | {iconv} | {BUILD_TOOLS}/{os_dir}/cc1 -O2 -quiet -G 0 -mcpu=vr4300 -mfix4300 -mips3 -mgp32 -mfp32 {CFLAGS} -o - | {BUILD_TOOLS}/{os_dir}/mips-nintendo-nu64-as -EB -G 0 - -o $out'",
command=f"bash -o pipefail -c '{cpp} {CPPFLAGS} $in -o - | $python {BUILD_TOOLS}/cc_dsl/compile_script.py | {iconv} | {BUILD_TOOLS}/{os_dir}/cc1 {CFLAGS} -o - | {BUILD_TOOLS}/{os_dir}/mips-nintendo-nu64-as -EB -G 0 - -o $out'",
depfile="$out.d",
deps="gcc",
)
@ -260,7 +280,7 @@ class Configure:
if task == "yay0":
implicit.append(YAY0_COMPRESS_TOOL)
elif task == "cc" or task == "cc_dsl":
elif task in ["cc", "cc_dsl", "cc_nusys", "cc_libultra"]:
order_only.append("generated_headers_" + self.version)
ninja.build(
@ -282,10 +302,15 @@ class Configure:
build(entry.object_path, entry.src_paths, "as")
elif isinstance(seg, segtypes.n64.c.N64SegC) or (isinstance(seg, segtypes.n64.data.N64SegData) and seg.type[0] == "."):
task = "cc"
with entry.src_paths[0].open() as f:
s = f.read()
if "SCRIPT(" in s or "#pragma SCRIPT" in s:
task = "cc_dsl"
if "nusys" in entry.src_paths[0].parts:
task = "cc_nusys"
elif "os" in entry.src_paths[0].parts:
task = "cc_libultra"
else:
with entry.src_paths[0].open() as f:
s = f.read()
if "SCRIPT(" in s or "#pragma SCRIPT" in s:
task = "cc_dsl"
build(entry.object_path, entry.src_paths, task)
elif isinstance(seg, segtypes.n64.bin.N64SegBin):

View File

@ -1,5 +1,8 @@
compiler_command = "cpp -w -Iver/us/build/include -Iinclude -Isrc -DPERMUTER -D _LANGUAGE_C -D _FINALROM -D VERSION=us -ffreestanding -DF3DEX_GBI_2 -D_MIPS_SZLONG=32 -D SCRIPT(...)={} | iconv --from UTF-8 --to SHIFT-JIS | tools/build/linux/cc1 -O2 -quiet -G 0 -mcpu=vr4300 -mfix4300 -mips3 -mgp32 -mfp32 -Wuninitialized -Wshadow -o - | tools/build/linux/mips-nintendo-nu64-as -EB -G 0 -"
compiler_command = "cpp -w -Iver/us/build/include -Iinclude -Isrc -DPERMUTER -D _LANGUAGE_C -D _FINALROM -D VERSION=us -ffreestanding -DF3DEX_GBI_2 -D_MIPS_SZLONG=32 -D SCRIPT(...)={} | iconv --from UTF-8 --to SHIFT-JIS | tools/build/linux/cc1 -O2 -quiet -G 0 -mcpu=vr4300 -mfix4300 -mips3 -mgp32 -mfp32 -Wuninitialized -Wshadow -fforce-addr -o - | tools/build/linux/mips-nintendo-nu64-as -EB -G 0 -"
assembler_command = "mips-linux-gnu-as -march=vr4300 -mabi=32"
[preserve_macros]
"g[DS]P.*" = "void"
"gs?[DS]P.*" = "void"
OVERRIDE_FLAG_CHECK = "int"
OS_K0_TO_PHYSICAL = "int"
"G_.*" = "int"

View File

@ -6,7 +6,7 @@
[subrepo]
remote = https://github.com/ethteck/splat.git
branch = imgflip
commit = 3144dc17f6fd77211e016cfbbc6a705f59b838e0
parent = 70e14bea15b1374095da723425d9b59a2ffb5915
commit = 4e012eaad6bffc4da7aed13d9a7f86bbfddf9150
parent = 8acbae1ea523f217fc6f2780ee83b37f5f2ac05b
method = merge
cmdver = 0.4.3

View File

@ -1,6 +1,6 @@
# splat Release Notes
## 0.7.1
### 0.7.1
* Image segment changes:
* Added `flip_x` and `flip_y` boolean parameters to replace `flip`.

View File

@ -19,7 +19,7 @@ options:
find_file_boundaries: True
compiler: IDO
platform: n64
base_dir: .
base_path: .
target_path: baserom.z64
""".format(rom.name.title(), rom.get_country_name(), basename)

View File

@ -35,8 +35,11 @@ class LinkerEntry:
def __init__(self, segment: Segment, src_paths: List[Path], object_path: Path, section: str):
self.segment = segment
self.src_paths = [clean_up_path(p) for p in src_paths]
self.object_path = path_to_object_path(object_path)
self.section = section
if self.section == "linker":
self.object_path = None
else:
self.object_path = path_to_object_path(object_path)
class LinkerWriter():
def __init__(self):
@ -62,6 +65,7 @@ class LinkerWriter():
if entry.section == "linker": # TODO: isinstance is preferable
self._end_block()
self._begin_segment(entry.segment)
continue
start = entry.segment.rom_start
if isinstance(start, int):
@ -74,8 +78,9 @@ class LinkerWriter():
if start % 0x10 != 0 and i != 0:
do_next = True
path_cname = re.sub(r"[^0-9a-zA-Z_]", "_", str(entry.segment.dir / entry.segment.name) + ".".join(entry.object_path.suffixes[:-1]))
self._write_symbol(path_cname, ".")
if entry.object_path:
path_cname = re.sub(r"[^0-9a-zA-Z_]", "_", str(entry.segment.dir / entry.segment.name) + ".".join(entry.object_path.suffixes[:-1]))
self._write_symbol(path_cname, ".")
if entry.section != "linker":
self._writeln(f"{entry.object_path}({entry.section});")

View File

@ -27,7 +27,7 @@ class N64SegAsm(N64SegCodeSubsegment):
def scan(self, rom_bytes: bytes):
if self.rom_start != "auto" and self.rom_end != "auto" and self.rom_start != self.rom_end:
self.funcs_text = self.disassemble_code(rom_bytes)
self.funcs_text = self.disassemble_code(rom_bytes, options.get("asm_endlabels", False))
def split(self, rom_bytes: bytes):
if not self.rom_start == self.rom_end:

View File

@ -10,7 +10,7 @@ from util import options
class N64SegC(N64SegCodeSubsegment):
defined_funcs: Set[str] = set()
STRIP_C_COMMENTS_RE = re.compile(
r'//.*?$|/\*.*?\*/|\'(?:\\.|[^\\\'])*\'|"(?:\\.|[^\\"])*"',
re.DOTALL | re.MULTILINE
@ -135,7 +135,7 @@ class N64SegC(N64SegCodeSubsegment):
c_lines = self.get_c_preamble()
for func in funcs_text:
func_name = self.get_symbol(func, type="func", local_only=True).name
func_name = self.parent.get_symbol(func, type="func", local_only=True).name
if options.get_compiler() == "GCC":
c_lines.append("INCLUDE_ASM(s32, \"{}\", {});".format(self.name, func_name))
else:

View File

@ -39,7 +39,7 @@ class N64SegCodeSubsegment(Segment):
def is_branch_insn(mnemonic):
return (mnemonic.startswith("b") and not mnemonic.startswith("binsl") and not mnemonic == "break") or mnemonic == "j"
def disassemble_code(self, rom_bytes):
def disassemble_code(self, rom_bytes, addsuffix=False):
insns = [insn for insn in N64SegCodeSubsegment.md.disasm(rom_bytes[self.rom_start : self.rom_end], self.vram_start)]
funcs = self.process_insns(insns, self.rom_start)
@ -50,7 +50,7 @@ class N64SegCodeSubsegment(Segment):
funcs = self.determine_symbols(funcs)
self.gather_jumptable_labels(rom_bytes)
return self.add_labels(funcs)
return self.add_labels(funcs, addsuffix)
def process_insns(self, insns, rom_addr):
assert(isinstance(self.parent, N64SegCode))
@ -243,7 +243,6 @@ class N64SegCodeSubsegment(Segment):
if offset != 0:
offset_str = f"+0x{offset:X}"
if self.parent:
self.parent.check_rodata_sym(func_addr, sym)
@ -257,7 +256,7 @@ class N64SegCodeSubsegment(Segment):
ret[func_addr] = func
return ret
def add_labels(self, funcs):
def add_labels(self, funcs, addsuffix):
ret = {}
for func in funcs:
@ -311,6 +310,9 @@ class N64SegCodeSubsegment(Segment):
if insn[0].mnemonic != "branch" and insn[0].mnemonic.startswith("b") or insn[0].mnemonic.startswith("j"):
indent_next = True
if addsuffix:
func_text.append(f"endlabel {sym.name}")
ret[func] = (func_text, rom_addr)
@ -358,7 +360,7 @@ class N64SegCodeSubsegment(Segment):
rom_offset += 4
def should_scan(self) -> bool:
return self.should_split()
return options.mode_active("code")
def should_split(self) -> bool:
return self.extract and options.mode_active("code")

View File

@ -33,13 +33,6 @@ class N64SegData(N64SegCodeSubsegment):
def get_linker_section(self) -> str:
return ".data"
def get_linker_entries(self):
from segtypes.linker_entry import LinkerEntry
path = self.out_path()
return [LinkerEntry(self, [path], path, self.get_linker_section())]
def get_symbols(self):
ret = []
@ -148,7 +141,7 @@ class N64SegData(N64SegCodeSubsegment):
return sym_str
def disassemble_data(self, rom_bytes):
rodata_encountered = self.type == "rodata"
rodata_encountered = "rodata" in self.type
ret = ".include \"macro.inc\"\n\n"
ret += f'.section {self.get_linker_section()}'
@ -161,9 +154,6 @@ class N64SegData(N64SegCodeSubsegment):
mnemonic = syms[i].access_mnemonic
sym = self.parent.get_symbol(syms[i].vram_start, create=True, define=True, local_only=True)
if sym.vram_start == 0x80097D90:
dog = 5
sym_str = f"\n\nglabel {sym.name}\n"
dis_start = self.parent.ram_to_rom(syms[i].vram_start)
dis_end = self.parent.ram_to_rom(syms[i + 1].vram_start)

View File

@ -24,7 +24,7 @@ class N64SegHeader(N64Segment):
encoding = options.get("header_encoding", "ASCII")
header_lines = []
header_lines.append(f".section .data, \"a\"\n")
header_lines.append(f".section .data\n")
header_lines.append(self.get_line("word", rom_bytes[0x00:0x04], "PI BSB Domain 1 register"))
header_lines.append(self.get_line("word", rom_bytes[0x04:0x08], "Clockrate setting"))
header_lines.append(self.get_line("word", rom_bytes[0x08:0x0C], "Entrypoint address"))

View File

@ -22,12 +22,12 @@ def initialize(config: Dict, config_path: str, base_path=None, target_path=None)
def set(opt, val):
opts[opt] = val
def get(opt, default=None):
return opts.get(opt, default)
def get_platform() -> str:
return opts.get("platform", "N64")
return opts.get("platform", "n64")
def get_compiler() -> str:
return opts.get("compiler", "IDO")

View File

@ -1,4 +1,4 @@
.section .data, "a"
.section .data
.word 0x80371240 /* PI BSB Domain 1 register */
.word 0x0000000F /* Clockrate setting */

View File

@ -10,129 +10,3 @@ glabel D_8007798C
glabel D_800779B0
.word 0x00000000, 0x00000000, 0x00000000, 0x00000000
glabel D_800779C0
.short 0x0000, 0x0000
glabel D_800779C4
.word 0x00000000
glabel D_800779C8
.byte 0x00, 0x00
glabel D_800779CA
.byte 0x00
glabel D_800779CB
.byte 0x45
glabel D_800779CC
.word 0x52524F52
glabel D_800779D0
.word 0xF7F7F700
glabel D_800779D4
.word 0x00000000
glabel D_800779D8
.word 0x00000000, 0x00000000, 0x00000045, 0x52524F52, 0xF7F7F700, 0x00000000, 0x00000000, 0x00000000, 0x00000045, 0x52524F52, 0xF7F7F700, 0x00000000, 0x00000000, 0x00000000, 0x00000045, 0x52524F52, 0xF7F7F700, 0x00000000, 0x00000000
glabel D_80077A24
.word 0x01010101
glabel D_80077A28
.byte 0x00, 0x00, 0x00
glabel D_80077A2B
.byte 0x00
glabel D_80077A2C
.word 0x00000000
glabel D_80077A30
.word 0x00000000
glabel D_80077A34
.word 0x00000000, 0xFFFFFF00, 0xFFFFFF00
glabel D_80077A40
.word 0x00000000, 0x00000000, 0x00000000, 0x00000000
glabel D_80077A50
.word 0xE7000000, 0x00000000, 0xE3000A01, 0x00000000, 0xE200001C, 0x00504340, 0xFCFFFFFF, 0xFFFCF279, 0xE3001201, 0x00000000, 0xD7000002, 0xFFFFFFFF, 0xE3000C00, 0x00000000, 0xE3001801, 0x000000C0, 0xE3001A01, 0x00000030, 0xE3000F00, 0x00000000, 0xE3001001, 0x00000000, 0xE3000D01, 0x00000000, 0xE3001402, 0x00000C00, 0xE3001700, 0x00000000, 0xE2001E01, 0x00000000, 0x00000000, 0x00000000, 0xED000000, 0x005003C0, 0xDF000000, 0x00000000
glabel D_80077AE0
.word 0x00000002, 0x00019D00, 0x80098454, 0x00020000, 0x00000000, 0x00000000, 0x00000005, 0x00049D00, 0x8009844C, 0x00000002, 0x00029D00, 0x80098444, 0x00000002, 0x0004B300, 0x8009843C, 0x00000004, 0x00079D00, 0x80098434, 0x00020001, 0x00000000, 0x00000000, 0x00000006, 0x00039D00, 0x8009842C, 0x00000002, 0x00021B00, 0x80098424, 0x00020002, 0x00000000, 0x00000000, 0x00000003, 0x00039D00, 0x8009841C, 0x00000004, 0x00019D00, 0x80098414, 0x00020003, 0x00000000, 0x00000000, 0x00010008, 0x000B2600, 0x8009840C, 0x00000002, 0x0009E800, 0x80098404, 0x00020004, 0x00000000, 0x00000000, 0x00000003, 0x00019D00, 0x80098454, 0x00010003, 0x00009D00, 0x800983FC, 0x00030000, 0x00000000, 0x800983F8, 0x00000000, 0x00000000, 0x00000000, 0x50726720, 0x5665722E, 0x30302F31, 0x322F3035, 0x2031363A, 0x35340000, 0x00000000, 0x00000000
glabel D_80077BF0
.byte 0x01, 0x02, 0x00, 0x34, 0x01, 0x04, 0x00, 0x36, 0x00, 0x36, 0x01, 0x02, 0x00, 0x1C, 0x01, 0x02, 0x00, 0x06, 0x01, 0x02, 0x00, 0x2C, 0x01, 0x02, 0x00, 0x2C, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00
glabel D_80077C10
.word 0x00000000
glabel D_80077C14
.word 0x00040000
glabel D_80077C18
.word 0x00000000
glabel D_80077C1C
.short 0x0004
glabel D_80077C1E
.short 0x0005
glabel D_80077C20
.word 0x00000000
glabel D_80077C24
.word 0x00000000
glabel D_80077C28
.short 0x0004, 0x0000
glabel D_80077C2C
.word 0x00000000
glabel D_80077C30
.word 0x00040000
glabel D_80077C34
.word 0x00000000
glabel D_80077C38
.short 0x0004
glabel D_80077C3A
.short 0x0004, 0x0000, 0x0000
glabel D_80077C40
.word 0x00000000
glabel D_80077C44
.word 0x00000008, 0x00000001, 0x0000000A, 0x00000043, 0x00000001, FadeBackgroundToBlack, 0x00000008, 0x00000001, 0x0000000A, 0x00000043, 0x00000003, CreateNpc, 0xFFFFFFF6, 0x00BB0001, 0x00000043, 0x00000004, SetNpcFlagBits, 0xFFFFFFF6, 0x00000100, 0x00000001, 0x00000043, 0x00000003, SetNpcYaw, 0xFFFFFFF6, 0x00000000, 0x00000043, 0x00000001, GetCamLookAtObjVector, 0x00000043, 0x00000005, SetNpcPos, 0xFFFFFFF6, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000056, 0x00000000, 0x00000043, 0x00000001, MerleeUpdateFX, 0x00000057, 0x00000000, 0x00000043, 0x00000001, FadeInMerlee, 0x00000008, 0x00000001, 0x0000001E, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFF6, 0x00BB0000, 0x00000043, 0x00000001, MerleeStopFX, 0x00000043, 0x00000001, UnfadeBackgroundFromBlack, 0x00000008, 0x00000001, 0x00000014, 0x00000056, 0x00000000, 0x00000043, 0x00000001, FadeOutMerlee, 0x00000043, 0x00000002, DeleteNpc, 0xFFFFFFF6, 0x00000057, 0x00000000, 0x00000043, 0x00000002, PlaySound, 0x00002075, 0x00000043, 0x00000004, GetPlayerPos, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000004, PlayMerleeGatherFX, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000004, PlayMerleeOrbFX, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000008, 0x00000001, 0x0000000F, 0x00000043, 0x00000001, ShowMerleeCoinMessage, 0x00000008, 0x00000001, 0x0000000F, 0x00000043, 0x00000001, HasMerleeCasts, 0x0000000A, 0x00000002, 0xFE363C80, 0x00000001, 0x00000002, 0x00000000, 0x00000013, 0x00000000, 0x00000043, 0x00000001, ShowMerleeRanOutMessage, 0x00000008, 0x00000001, 0x0000000F, 0x00000002, 0x00000000, 0x00000001, 0x00000000
glabel SCRIPT_NpcDefeat
.word 0x00000043, 0x00000002, GetBattleOutcome, 0xFE363C80, 0x00000014, 0x00000001, 0xFE363C80, 0x00000016, 0x00000001, 0x00000000, 0x00000043, 0x00000001, OnDefeatEnemy, 0x00000016, 0x00000001, 0x00000001, 0x00000016, 0x00000001, 0x00000002, 0x00000023, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000
glabel D_80077E9C
.word 0x00000043, 0x00000001, OnFleeBattleDrops, 0x00000002, 0x00000000, 0x00000001, 0x00000000
glabel D_80077EB8
.word 0x800A008A, 0x0032FFFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00005FFF, 0x7FFF0000, 0x00013FFF, 0x5FFF0000, 0x00021FFF, 0x3FFF0000, 0x00030000, 0x1FFF0000, 0x00040000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00030000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000
glabel EnemyNpcHit
.word 0x00000043, 0x00000002, GetOwnerEncounterTrigger, 0xFE363C80, 0x00000014, 0x00000001, 0xFE363C80, 0x00000016, 0x00000001, 0x00000001, 0x0000001D, 0x00000001, 0x00000002, 0x0000001D, 0x00000001, 0x00000004, 0x0000001D, 0x00000001, 0x00000006, 0x00000043, 0x00000003, GetSelfAnimationFromTable, 0x00000007, 0xFE363C80, 0x00000046, 0x00000001, 0x800936DC, 0x00000016, 0x00000001, 0x00000003, 0x00000056, 0x00000000, 0x00000043, 0x00000002, func_800458CC, 0xFE363C80, 0x0000000A, 0x00000002, 0xFE363C80, 0x00000000, 0x00000024, 0x00000002, 0xFE363C8A, 0x00000000, 0x00000005, 0x00000001, 0x0000001E, 0x00000027, 0x00000002, 0xFE363C8A, 0x00000028, 0x00000043, 0x00000005, SetNpcRotation, 0xFFFFFFFF, 0x00000000, 0xFE363C8A, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x00000006, 0x00000000, 0x00000013, 0x00000000, 0x00000057, 0x00000000, 0x00000020, 0x00000000, 0x00000023, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000
glabel EnemyNpcDefeat
.word 0x00000043, 0x00000005, SetNpcRotation, 0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000, 0x00000043, 0x00000002, GetBattleOutcome, 0xFE363C80, 0x00000014, 0x00000001, 0xFE363C80, 0x00000016, 0x00000001, 0x00000000, 0x00000043, 0x00000001, DoNpcDefeat, 0x00000016, 0x00000001, 0x00000002, 0x00000043, 0x00000002, func_80045900, 0x00000000, 0x00000016, 0x00000001, 0x00000003, 0x00000043, 0x00000004, SetEnemyFlagBits, 0xFFFFFFFF, 0x00000010, 0x00000001, 0x00000043, 0x00000002, RemoveNpc, 0xFFFFFFFF, 0x00000023, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000
glabel D_80078160
.short 0x001C, 0x0028
glabel D_80078164
.short 0x0000, 0xFFFE
glabel D_80078168
.word 0x001D0074, 0x001D0075

View File

@ -0,0 +1,78 @@
.include "macro.inc"
.section .data
glabel D_80077AE0
.word 0x00000002, 0x00019D00, 0x80098454, 0x00020000, 0x00000000, 0x00000000, 0x00000005, 0x00049D00, 0x8009844C, 0x00000002, 0x00029D00, 0x80098444, 0x00000002, 0x0004B300, 0x8009843C, 0x00000004, 0x00079D00, 0x80098434, 0x00020001, 0x00000000, 0x00000000, 0x00000006, 0x00039D00, 0x8009842C, 0x00000002, 0x00021B00, 0x80098424, 0x00020002, 0x00000000, 0x00000000, 0x00000003, 0x00039D00, 0x8009841C, 0x00000004, 0x00019D00, 0x80098414, 0x00020003, 0x00000000, 0x00000000, 0x00010008, 0x000B2600, 0x8009840C, 0x00000002, 0x0009E800, 0x80098404, 0x00020004, 0x00000000, 0x00000000, 0x00000003, 0x00019D00, 0x80098454, 0x00010003, 0x00009D00, 0x800983FC, 0x00030000, 0x00000000, 0x800983F8, 0x00000000, 0x00000000, 0x00000000, 0x50726720, 0x5665722E, 0x30302F31, 0x322F3035, 0x2031363A, 0x35340000, 0x00000000, 0x00000000
glabel D_80077BF0
.byte 0x01, 0x02, 0x00, 0x34, 0x01, 0x04, 0x00, 0x36, 0x00, 0x36, 0x01, 0x02, 0x00, 0x1C, 0x01, 0x02, 0x00, 0x06, 0x01, 0x02, 0x00, 0x2C, 0x01, 0x02, 0x00, 0x2C, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00
glabel D_80077C10
.word 0x00000000
glabel D_80077C14
.word 0x00040000
glabel D_80077C18
.word 0x00000000
glabel D_80077C1C
.short 0x0004
glabel D_80077C1E
.short 0x0005
glabel D_80077C20
.word 0x00000000
glabel D_80077C24
.word 0x00000000
glabel D_80077C28
.short 0x0004, 0x0000
glabel D_80077C2C
.word 0x00000000
glabel D_80077C30
.word 0x00040000
glabel D_80077C34
.word 0x00000000
glabel D_80077C38
.short 0x0004
glabel D_80077C3A
.short 0x0004, 0x0000, 0x0000
glabel D_80077C40
.word 0x00000000
glabel D_80077C44
.word 0x00000008, 0x00000001, 0x0000000A, 0x00000043, 0x00000001, FadeBackgroundToBlack, 0x00000008, 0x00000001, 0x0000000A, 0x00000043, 0x00000003, CreateNpc, 0xFFFFFFF6, 0x00BB0001, 0x00000043, 0x00000004, SetNpcFlagBits, 0xFFFFFFF6, 0x00000100, 0x00000001, 0x00000043, 0x00000003, SetNpcYaw, 0xFFFFFFF6, 0x00000000, 0x00000043, 0x00000001, GetCamLookAtObjVector, 0x00000043, 0x00000005, SetNpcPos, 0xFFFFFFF6, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000056, 0x00000000, 0x00000043, 0x00000001, MerleeUpdateFX, 0x00000057, 0x00000000, 0x00000043, 0x00000001, FadeInMerlee, 0x00000008, 0x00000001, 0x0000001E, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFF6, 0x00BB0000, 0x00000043, 0x00000001, MerleeStopFX, 0x00000043, 0x00000001, UnfadeBackgroundFromBlack, 0x00000008, 0x00000001, 0x00000014, 0x00000056, 0x00000000, 0x00000043, 0x00000001, FadeOutMerlee, 0x00000043, 0x00000002, DeleteNpc, 0xFFFFFFF6, 0x00000057, 0x00000000, 0x00000043, 0x00000002, PlaySound, 0x00002075, 0x00000043, 0x00000004, GetPlayerPos, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000004, PlayMerleeGatherFX, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000004, PlayMerleeOrbFX, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000008, 0x00000001, 0x0000000F, 0x00000043, 0x00000001, ShowMerleeCoinMessage, 0x00000008, 0x00000001, 0x0000000F, 0x00000043, 0x00000001, HasMerleeCasts, 0x0000000A, 0x00000002, 0xFE363C80, 0x00000001, 0x00000002, 0x00000000, 0x00000013, 0x00000000, 0x00000043, 0x00000001, ShowMerleeRanOutMessage, 0x00000008, 0x00000001, 0x0000000F, 0x00000002, 0x00000000, 0x00000001, 0x00000000
glabel SCRIPT_NpcDefeat
.word 0x00000043, 0x00000002, GetBattleOutcome, 0xFE363C80, 0x00000014, 0x00000001, 0xFE363C80, 0x00000016, 0x00000001, 0x00000000, 0x00000043, 0x00000001, OnDefeatEnemy, 0x00000016, 0x00000001, 0x00000001, 0x00000016, 0x00000001, 0x00000002, 0x00000023, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000
glabel D_80077E9C
.word 0x00000043, 0x00000001, OnFleeBattleDrops, 0x00000002, 0x00000000, 0x00000001, 0x00000000
glabel D_80077EB8
.word 0x800A008A, 0x0032FFFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00005FFF, 0x7FFF0000, 0x00013FFF, 0x5FFF0000, 0x00021FFF, 0x3FFF0000, 0x00030000, 0x1FFF0000, 0x00040000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00030000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000
glabel EnemyNpcHit
.word 0x00000043, 0x00000002, GetOwnerEncounterTrigger, 0xFE363C80, 0x00000014, 0x00000001, 0xFE363C80, 0x00000016, 0x00000001, 0x00000001, 0x0000001D, 0x00000001, 0x00000002, 0x0000001D, 0x00000001, 0x00000004, 0x0000001D, 0x00000001, 0x00000006, 0x00000043, 0x00000003, GetSelfAnimationFromTable, 0x00000007, 0xFE363C80, 0x00000046, 0x00000001, 0x800936DC, 0x00000016, 0x00000001, 0x00000003, 0x00000056, 0x00000000, 0x00000043, 0x00000002, func_800458CC, 0xFE363C80, 0x0000000A, 0x00000002, 0xFE363C80, 0x00000000, 0x00000024, 0x00000002, 0xFE363C8A, 0x00000000, 0x00000005, 0x00000001, 0x0000001E, 0x00000027, 0x00000002, 0xFE363C8A, 0x00000028, 0x00000043, 0x00000005, SetNpcRotation, 0xFFFFFFFF, 0x00000000, 0xFE363C8A, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x00000006, 0x00000000, 0x00000013, 0x00000000, 0x00000057, 0x00000000, 0x00000020, 0x00000000, 0x00000023, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000
glabel EnemyNpcDefeat
.word 0x00000043, 0x00000005, SetNpcRotation, 0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000, 0x00000043, 0x00000002, GetBattleOutcome, 0xFE363C80, 0x00000014, 0x00000001, 0xFE363C80, 0x00000016, 0x00000001, 0x00000000, 0x00000043, 0x00000001, DoNpcDefeat, 0x00000016, 0x00000001, 0x00000002, 0x00000043, 0x00000002, func_80045900, 0x00000000, 0x00000016, 0x00000001, 0x00000003, 0x00000043, 0x00000004, SetEnemyFlagBits, 0xFFFFFFFF, 0x00000010, 0x00000001, 0x00000043, 0x00000002, RemoveNpc, 0xFFFFFFFF, 0x00000023, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000
glabel D_80078160
.short 0x001C, 0x0028
glabel D_80078164
.short 0x0000, 0xFFFE
glabel D_80078168
.word 0x001D0074, 0x001D0075

View File

@ -1,4 +1,4 @@
.section .data, "a"
.section .data
.word 0x80371240 /* PI BSB Domain 1 register */
.word 0x0000000F /* Clockrate setting */

View File

@ -1,52 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.section .rodata
glabel jtbl_800983C8
.word L800375D8_129D8, L80037624_12A24, L800375F4_129F4, L8003762C_12A2C, L80037624_12A24, L80037624_12A24
.section .text
glabel func_800375A4
/* 129A4 800375A4 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* 129A8 800375A8 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* 129AC 800375AC 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 129B0 800375B0 AFBF0010 */ sw $ra, 0x10($sp)
/* 129B4 800375B4 804300AC */ lb $v1, 0xac($v0)
/* 129B8 800375B8 2C620006 */ sltiu $v0, $v1, 6
/* 129BC 800375BC 1040001B */ beqz $v0, L8003762C_12A2C
/* 129C0 800375C0 00031080 */ sll $v0, $v1, 2
/* 129C4 800375C4 3C01800A */ lui $at, %hi(jtbl_800983C8)
/* 129C8 800375C8 00220821 */ addu $at, $at, $v0
/* 129CC 800375CC 8C2283C8 */ lw $v0, %lo(jtbl_800983C8)($at)
/* 129D0 800375D0 00400008 */ jr $v0
/* 129D4 800375D4 00000000 */ nop
glabel L800375D8_129D8
/* 129D8 800375D8 3C018007 */ lui $at, %hi(D_80077A28)
/* 129DC 800375DC AC207A28 */ sw $zero, %lo(D_80077A28)($at)
/* 129E0 800375E0 3C018007 */ lui $at, %hi(D_80077A2C)
/* 129E4 800375E4 AC207A2C */ sw $zero, %lo(D_80077A2C)($at)
/* 129E8 800375E8 3C018007 */ lui $at, %hi(D_80077A30)
/* 129EC 800375EC 0800DD89 */ j L80037624_12A24
/* 129F0 800375F0 AC207A30 */ sw $zero, %lo(D_80077A30)($at)
glabel L800375F4_129F4
/* 129F4 800375F4 0C00DE58 */ jal func_80037960
/* 129F8 800375F8 00000000 */ nop
/* 129FC 800375FC 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* 12A00 80037600 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* 12A04 80037604 90420073 */ lbu $v0, 0x73($v0)
/* 12A08 80037608 30420001 */ andi $v0, $v0, 1
/* 12A0C 8003760C 10400007 */ beqz $v0, L8003762C_12A2C
/* 12A10 80037610 00000000 */ nop
/* 12A14 80037614 0C00DEF2 */ jal title_draw_press_start
/* 12A18 80037618 00000000 */ nop
/* 12A1C 8003761C 0800DD8B */ j L8003762C_12A2C
/* 12A20 80037620 00000000 */ nop
glabel L80037624_12A24
/* 12A24 80037624 0C00DE58 */ jal func_80037960
/* 12A28 80037628 00000000 */ nop
glabel L8003762C_12A2C
/* 12A2C 8003762C 8FBF0010 */ lw $ra, 0x10($sp)
/* 12A30 80037630 03E00008 */ jr $ra
/* 12A34 80037634 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,15 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel title_draw_images
/* 12D68 80037968 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 12D6C 8003796C F7B40018 */ sdc1 $f20, 0x18($sp)
/* 12D70 80037970 AFBF0010 */ sw $ra, 0x10($sp)
/* 12D74 80037974 0C00DE65 */ jal title_draw_logo
/* 12D78 80037978 46007506 */ mov.s $f20, $f14
/* 12D7C 8003797C 0C00DF85 */ jal title_draw_copyright
/* 12D80 80037980 4600A306 */ mov.s $f12, $f20
/* 12D84 80037984 8FBF0010 */ lw $ra, 0x10($sp)
/* 12D88 80037988 D7B40018 */ ldc1 $f20, 0x18($sp)
/* 12D8C 8003798C 03E00008 */ jr $ra
/* 12D90 80037990 27BD0020 */ addiu $sp, $sp, 0x20

View File

@ -1,157 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel title_draw_press_start
/* 12FC8 80037BC8 3C048007 */ lui $a0, %hi(D_80077A2C)
/* 12FCC 80037BCC 24847A2C */ addiu $a0, $a0, %lo(D_80077A2C)
/* 12FD0 80037BD0 8C830000 */ lw $v1, ($a0)
/* 12FD4 80037BD4 10600005 */ beqz $v1, .L80037BEC
/* 12FD8 80037BD8 24020001 */ addiu $v0, $zero, 1
/* 12FDC 80037BDC 10620016 */ beq $v1, $v0, .L80037C38
/* 12FE0 80037BE0 3C07FC11 */ lui $a3, 0xfc11
/* 12FE4 80037BE4 0800DF22 */ j .L80037C88
/* 12FE8 80037BE8 34E79623 */ ori $a3, $a3, 0x9623
.L80037BEC:
/* 12FEC 80037BEC 3C038007 */ lui $v1, %hi(D_80077A28)
/* 12FF0 80037BF0 24637A28 */ addiu $v1, $v1, %lo(D_80077A28)
/* 12FF4 80037BF4 8C620000 */ lw $v0, ($v1)
/* 12FF8 80037BF8 2442FF80 */ addiu $v0, $v0, -0x80
/* 12FFC 80037BFC 04410002 */ bgez $v0, .L80037C08
/* 13000 80037C00 AC620000 */ sw $v0, ($v1)
/* 13004 80037C04 AC600000 */ sw $zero, ($v1)
.L80037C08:
/* 13008 80037C08 3C038007 */ lui $v1, %hi(D_80077A30)
/* 1300C 80037C0C 24637A30 */ addiu $v1, $v1, %lo(D_80077A30)
/* 13010 80037C10 8C620000 */ lw $v0, ($v1)
/* 13014 80037C14 24420001 */ addiu $v0, $v0, 1
/* 13018 80037C18 AC620000 */ sw $v0, ($v1)
/* 1301C 80037C1C 28420010 */ slti $v0, $v0, 0x10
/* 13020 80037C20 14400018 */ bnez $v0, .L80037C84
/* 13024 80037C24 3C07FC11 */ lui $a3, 0xfc11
/* 13028 80037C28 24020001 */ addiu $v0, $zero, 1
/* 1302C 80037C2C AC600000 */ sw $zero, ($v1)
/* 13030 80037C30 0800DF21 */ j .L80037C84
/* 13034 80037C34 AC820000 */ sw $v0, ($a0)
.L80037C38:
/* 13038 80037C38 3C038007 */ lui $v1, %hi(D_80077A28)
/* 1303C 80037C3C 24637A28 */ addiu $v1, $v1, %lo(D_80077A28)
/* 13040 80037C40 8C620000 */ lw $v0, ($v1)
/* 13044 80037C44 24420080 */ addiu $v0, $v0, 0x80
/* 13048 80037C48 AC620000 */ sw $v0, ($v1)
/* 1304C 80037C4C 28420100 */ slti $v0, $v0, 0x100
/* 13050 80037C50 14400002 */ bnez $v0, .L80037C5C
/* 13054 80037C54 240200FF */ addiu $v0, $zero, 0xff
/* 13058 80037C58 AC620000 */ sw $v0, ($v1)
.L80037C5C:
/* 1305C 80037C5C 3C038007 */ lui $v1, %hi(D_80077A30)
/* 13060 80037C60 24637A30 */ addiu $v1, $v1, %lo(D_80077A30)
/* 13064 80037C64 8C620000 */ lw $v0, ($v1)
/* 13068 80037C68 24420001 */ addiu $v0, $v0, 1
/* 1306C 80037C6C AC620000 */ sw $v0, ($v1)
/* 13070 80037C70 28420010 */ slti $v0, $v0, 0x10
/* 13074 80037C74 14400003 */ bnez $v0, .L80037C84
/* 13078 80037C78 3C07FC11 */ lui $a3, 0xfc11
/* 1307C 80037C7C AC600000 */ sw $zero, ($v1)
/* 13080 80037C80 AC800000 */ sw $zero, ($a0)
.L80037C84:
/* 13084 80037C84 34E79623 */ ori $a3, $a3, 0x9623
.L80037C88:
/* 13088 80037C88 3C06FF2F */ lui $a2, 0xff2f
/* 1308C 80037C8C 34C6FFFF */ ori $a2, $a2, 0xffff
/* 13090 80037C90 3C08F8F0 */ lui $t0, 0xf8f0
/* 13094 80037C94 35089800 */ ori $t0, $t0, 0x9800
/* 13098 80037C98 3C09077F */ lui $t1, 0x77f
/* 1309C 80037C9C 3529F080 */ ori $t1, $t1, 0xf080
/* 130A0 80037CA0 3C0AF568 */ lui $t2, 0xf568
/* 130A4 80037CA4 354A2000 */ ori $t2, $t2, 0x2000
/* 130A8 80037CA8 3C0B001F */ lui $t3, 0x1f
/* 130AC 80037CAC 356BC07C */ ori $t3, $t3, 0xc07c
/* 130B0 80037CB0 3C0DE438 */ lui $t5, 0xe438
/* 130B4 80037CB4 35AD02A4 */ ori $t5, $t5, 0x2a4
/* 130B8 80037CB8 3C0C0018 */ lui $t4, 0x18
/* 130BC 80037CBC 358C0224 */ ori $t4, $t4, 0x224
/* 130C0 80037CC0 3C0E0400 */ lui $t6, 0x400
/* 130C4 80037CC4 3C05800A */ lui $a1, %hi(gMasterGfxPos)
/* 130C8 80037CC8 24A5A66C */ addiu $a1, $a1, %lo(gMasterGfxPos)
/* 130CC 80037CCC 35CE0400 */ ori $t6, $t6, 0x400
/* 130D0 80037CD0 8CA20000 */ lw $v0, ($a1)
/* 130D4 80037CD4 3C03DE00 */ lui $v1, 0xde00
/* 130D8 80037CD8 0040202D */ daddu $a0, $v0, $zero
/* 130DC 80037CDC 24420008 */ addiu $v0, $v0, 8
/* 130E0 80037CE0 ACA20000 */ sw $v0, ($a1)
/* 130E4 80037CE4 AC830000 */ sw $v1, ($a0)
/* 130E8 80037CE8 3C038007 */ lui $v1, %hi(D_80077A50)
/* 130EC 80037CEC 24637A50 */ addiu $v1, $v1, %lo(D_80077A50)
/* 130F0 80037CF0 AC830004 */ sw $v1, 4($a0)
/* 130F4 80037CF4 24430008 */ addiu $v1, $v0, 8
/* 130F8 80037CF8 ACA30000 */ sw $v1, ($a1)
/* 130FC 80037CFC 24430010 */ addiu $v1, $v0, 0x10
/* 13100 80037D00 3C04FA00 */ lui $a0, 0xfa00
/* 13104 80037D04 AC470000 */ sw $a3, ($v0)
/* 13108 80037D08 AC460004 */ sw $a2, 4($v0)
/* 1310C 80037D0C ACA30000 */ sw $v1, ($a1)
/* 13110 80037D10 3C038007 */ lui $v1, %hi(D_80077A2B)
/* 13114 80037D14 90637A2B */ lbu $v1, %lo(D_80077A2B)($v1)
/* 13118 80037D18 3C06E700 */ lui $a2, 0xe700
/* 1311C 80037D1C AC440008 */ sw $a0, 8($v0)
/* 13120 80037D20 00681825 */ or $v1, $v1, $t0
/* 13124 80037D24 AC43000C */ sw $v1, 0xc($v0)
/* 13128 80037D28 24430018 */ addiu $v1, $v0, 0x18
/* 1312C 80037D2C ACA30000 */ sw $v1, ($a1)
/* 13130 80037D30 24430020 */ addiu $v1, $v0, 0x20
/* 13134 80037D34 AC460010 */ sw $a2, 0x10($v0)
/* 13138 80037D38 AC400014 */ sw $zero, 0x14($v0)
/* 1313C 80037D3C ACA30000 */ sw $v1, ($a1)
/* 13140 80037D40 3C04800A */ lui $a0, %hi(D_800A0980)
/* 13144 80037D44 8C840980 */ lw $a0, %lo(D_800A0980)($a0)
/* 13148 80037D48 3C03FD70 */ lui $v1, 0xfd70
/* 1314C 80037D4C AC430018 */ sw $v1, 0x18($v0)
/* 13150 80037D50 24430028 */ addiu $v1, $v0, 0x28
/* 13154 80037D54 AC44001C */ sw $a0, 0x1c($v0)
/* 13158 80037D58 ACA30000 */ sw $v1, ($a1)
/* 1315C 80037D5C 3C03F570 */ lui $v1, 0xf570
/* 13160 80037D60 AC430020 */ sw $v1, 0x20($v0)
/* 13164 80037D64 3C030700 */ lui $v1, 0x700
/* 13168 80037D68 AC430024 */ sw $v1, 0x24($v0)
/* 1316C 80037D6C 24430030 */ addiu $v1, $v0, 0x30
/* 13170 80037D70 ACA30000 */ sw $v1, ($a1)
/* 13174 80037D74 3C03E600 */ lui $v1, 0xe600
/* 13178 80037D78 AC430028 */ sw $v1, 0x28($v0)
/* 1317C 80037D7C 24430038 */ addiu $v1, $v0, 0x38
/* 13180 80037D80 AC40002C */ sw $zero, 0x2c($v0)
/* 13184 80037D84 ACA30000 */ sw $v1, ($a1)
/* 13188 80037D88 3C03F300 */ lui $v1, 0xf300
/* 1318C 80037D8C AC430030 */ sw $v1, 0x30($v0)
/* 13190 80037D90 24430040 */ addiu $v1, $v0, 0x40
/* 13194 80037D94 AC490034 */ sw $t1, 0x34($v0)
/* 13198 80037D98 ACA30000 */ sw $v1, ($a1)
/* 1319C 80037D9C 24430048 */ addiu $v1, $v0, 0x48
/* 131A0 80037DA0 AC460038 */ sw $a2, 0x38($v0)
/* 131A4 80037DA4 AC40003C */ sw $zero, 0x3c($v0)
/* 131A8 80037DA8 ACA30000 */ sw $v1, ($a1)
/* 131AC 80037DAC 24430050 */ addiu $v1, $v0, 0x50
/* 131B0 80037DB0 AC4A0040 */ sw $t2, 0x40($v0)
/* 131B4 80037DB4 AC400044 */ sw $zero, 0x44($v0)
/* 131B8 80037DB8 ACA30000 */ sw $v1, ($a1)
/* 131BC 80037DBC 3C03F200 */ lui $v1, 0xf200
/* 131C0 80037DC0 AC430048 */ sw $v1, 0x48($v0)
/* 131C4 80037DC4 24430058 */ addiu $v1, $v0, 0x58
/* 131C8 80037DC8 AC4B004C */ sw $t3, 0x4c($v0)
/* 131CC 80037DCC ACA30000 */ sw $v1, ($a1)
/* 131D0 80037DD0 24430060 */ addiu $v1, $v0, 0x60
/* 131D4 80037DD4 AC4D0050 */ sw $t5, 0x50($v0)
/* 131D8 80037DD8 AC4C0054 */ sw $t4, 0x54($v0)
/* 131DC 80037DDC ACA30000 */ sw $v1, ($a1)
/* 131E0 80037DE0 3C03E100 */ lui $v1, 0xe100
/* 131E4 80037DE4 AC430058 */ sw $v1, 0x58($v0)
/* 131E8 80037DE8 24430068 */ addiu $v1, $v0, 0x68
/* 131EC 80037DEC AC40005C */ sw $zero, 0x5c($v0)
/* 131F0 80037DF0 ACA30000 */ sw $v1, ($a1)
/* 131F4 80037DF4 3C03F100 */ lui $v1, 0xf100
/* 131F8 80037DF8 AC430060 */ sw $v1, 0x60($v0)
/* 131FC 80037DFC 24430070 */ addiu $v1, $v0, 0x70
/* 13200 80037E00 AC4E0064 */ sw $t6, 0x64($v0)
/* 13204 80037E04 ACA30000 */ sw $v1, ($a1)
/* 13208 80037E08 AC460068 */ sw $a2, 0x68($v0)
/* 1320C 80037E0C 03E00008 */ jr $ra
/* 13210 80037E10 AC40006C */ sw $zero, 0x6c($v0)

View File

@ -0,0 +1,52 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel switch_order
/* 1721F8 80243918 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 1721FC 8024391C 3C040041 */ lui $a0, 0x41
/* 172200 80243920 24845D90 */ addiu $a0, $a0, 0x5d90
/* 172204 80243924 AFB00010 */ sw $s0, 0x10($sp)
/* 172208 80243928 3C10800E */ lui $s0, %hi(gBattleStatus)
/* 17220C 8024392C 2610C070 */ addiu $s0, $s0, %lo(gBattleStatus)
/* 172210 80243930 2402FFFF */ addiu $v0, $zero, -1
/* 172214 80243934 3C050042 */ lui $a1, 0x42
/* 172218 80243938 24A519F0 */ addiu $a1, $a1, 0x19f0
/* 17221C 8024393C 3C06802A */ lui $a2, %hi(func_802A1000)
/* 172220 80243940 24C61000 */ addiu $a2, $a2, %lo(func_802A1000)
/* 172224 80243944 AFBF0018 */ sw $ra, 0x18($sp)
/* 172228 80243948 AFB10014 */ sw $s1, 0x14($sp)
/* 17222C 8024394C A202004D */ sb $v0, 0x4d($s0)
/* 172230 80243950 A202004E */ sb $v0, 0x4e($s0)
/* 172234 80243954 A202004F */ sb $v0, 0x4f($s0)
/* 172238 80243958 A2020050 */ sb $v0, 0x50($s0)
/* 17223C 8024395C A2020051 */ sb $v0, 0x51($s0)
/* 172240 80243960 A2020052 */ sb $v0, 0x52($s0)
/* 172244 80243964 A2020053 */ sb $v0, 0x53($s0)
/* 172248 80243968 A202005D */ sb $v0, 0x5d($s0)
/* 17224C 8024396C A2020062 */ sb $v0, 0x62($s0)
/* 172250 80243970 0C00A5CF */ jal dma_copy
/* 172254 80243974 A2020063 */ sb $v0, 0x63($s0)
/* 172258 80243978 8E020000 */ lw $v0, ($s0)
/* 17225C 8024397C 3C030008 */ lui $v1, 8
/* 172260 80243980 00431024 */ and $v0, $v0, $v1
/* 172264 80243984 1440000B */ bnez $v0, .L802439B4
/* 172268 80243988 2404000E */ addiu $a0, $zero, 0xe
/* 17226C 8024398C 3C11800E */ lui $s1, %hi(gBattleStatus+0x46C)
/* 172270 80243990 2631C4DC */ addiu $s1, $s1, %lo(gBattleStatus+0x46C)
/* 172274 80243994 8E300000 */ lw $s0, ($s1)
/* 172278 80243998 24020046 */ addiu $v0, $zero, 0x46
/* 17227C 8024399C 16020005 */ bne $s0, $v0, .L802439B4
/* 172280 802439A0 2404000D */ addiu $a0, $zero, 0xd
/* 172284 802439A4 0C090464 */ jal func_80241190
/* 172288 802439A8 2404000D */ addiu $a0, $zero, 0xd
/* 17228C 802439AC 08090E6F */ j .L802439BC
/* 172290 802439B0 AE300000 */ sw $s0, ($s1)
.L802439B4:
/* 172294 802439B4 0C090464 */ jal func_80241190
/* 172298 802439B8 00000000 */ nop
.L802439BC:
/* 17229C 802439BC 8FBF0018 */ lw $ra, 0x18($sp)
/* 1722A0 802439C0 8FB10014 */ lw $s1, 0x14($sp)
/* 1722A4 802439C4 8FB00010 */ lw $s0, 0x10($sp)
/* 1722A8 802439C8 03E00008 */ jr $ra
/* 1722AC 802439CC 27BD0020 */ addiu $sp, $sp, 0x20

View File

@ -1,158 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_80027BAC
/* 2FAC 80027BAC 27BDFFD0 */ addiu $sp, $sp, -0x30
/* 2FB0 80027BB0 3C06D700 */ lui $a2, 0xd700
/* 2FB4 80027BB4 34C60002 */ ori $a2, $a2, 2
/* 2FB8 80027BB8 3C07FF10 */ lui $a3, 0xff10
/* 2FBC 80027BBC 34E7013F */ ori $a3, $a3, 0x13f
/* 2FC0 80027BC0 3C08E300 */ lui $t0, 0xe300
/* 2FC4 80027BC4 35080A01 */ ori $t0, $t0, 0xa01
/* 2FC8 80027BC8 3C09E300 */ lui $t1, 0xe300
/* 2FCC 80027BCC 35290C00 */ ori $t1, $t1, 0xc00
/* 2FD0 80027BD0 3C0AE300 */ lui $t2, 0xe300
/* 2FD4 80027BD4 354A1001 */ ori $t2, $t2, 0x1001
/* 2FD8 80027BD8 3C0BE200 */ lui $t3, 0xe200
/* 2FDC 80027BDC 356B001C */ ori $t3, $t3, 0x1c
/* 2FE0 80027BE0 3C0CE300 */ lui $t4, 0xe300
/* 2FE4 80027BE4 358C1201 */ ori $t4, $t4, 0x1201
/* 2FE8 80027BE8 0000C82D */ daddu $t9, $zero, $zero
/* 2FEC 80027BEC 3C02800A */ lui $v0, %hi(gMasterGfxPos)
/* 2FF0 80027BF0 2442A66C */ addiu $v0, $v0, %lo(gMasterGfxPos)
/* 2FF4 80027BF4 0040682D */ daddu $t5, $v0, $zero
/* 2FF8 80027BF8 AFB5001C */ sw $s5, 0x1c($sp)
/* 2FFC 80027BFC 3C15FD10 */ lui $s5, 0xfd10
/* 3000 80027C00 36B5013F */ ori $s5, $s5, 0x13f
/* 3004 80027C04 AFB00008 */ sw $s0, 8($sp)
/* 3008 80027C08 3C10F510 */ lui $s0, 0xf510
/* 300C 80027C0C 3610A000 */ ori $s0, $s0, 0xa000
/* 3010 80027C10 AFB40018 */ sw $s4, 0x18($sp)
/* 3014 80027C14 3C14074F */ lui $s4, 0x74f
/* 3018 80027C18 3694C014 */ ori $s4, $s4, 0xc014
/* 301C 80027C1C AFB1000C */ sw $s1, 0xc($sp)
/* 3020 80027C20 3C11E700 */ lui $s1, 0xe700
/* 3024 80027C24 AFBE0028 */ sw $fp, 0x28($sp)
/* 3028 80027C28 3C1EF200 */ lui $fp, 0xf200
/* 302C 80027C2C AFB30014 */ sw $s3, 0x14($sp)
/* 3030 80027C30 3C13004F */ lui $s3, 0x4f
/* 3034 80027C34 3673C014 */ ori $s3, $s3, 0xc014
/* 3038 80027C38 AFB20010 */ sw $s2, 0x10($sp)
/* 303C 80027C3C 3C12E44F */ lui $s2, 0xe44f
/* 3040 80027C40 3652C000 */ ori $s2, $s2, 0xc000
/* 3044 80027C44 AFB70024 */ sw $s7, 0x24($sp)
/* 3048 80027C48 3C17E100 */ lui $s7, 0xe100
/* 304C 80027C4C AFB60020 */ sw $s6, 0x20($sp)
/* 3050 80027C50 3C16F100 */ lui $s6, 0xf100
/* 3054 80027C54 0320C02D */ daddu $t8, $t9, $zero
/* 3058 80027C58 240F0014 */ addiu $t7, $zero, 0x14
/* 305C 80027C5C 0080702D */ daddu $t6, $a0, $zero
/* 3060 80027C60 8DA20000 */ lw $v0, ($t5)
/* 3064 80027C64 0220182D */ daddu $v1, $s1, $zero
/* 3068 80027C68 0040202D */ daddu $a0, $v0, $zero
/* 306C 80027C6C 24420008 */ addiu $v0, $v0, 8
/* 3070 80027C70 ADA20000 */ sw $v0, ($t5)
/* 3074 80027C74 AC830000 */ sw $v1, ($a0)
/* 3078 80027C78 24430008 */ addiu $v1, $v0, 8
/* 307C 80027C7C AC800004 */ sw $zero, 4($a0)
/* 3080 80027C80 ADA30000 */ sw $v1, ($t5)
/* 3084 80027C84 2403FFFF */ addiu $v1, $zero, -1
/* 3088 80027C88 AC430004 */ sw $v1, 4($v0)
/* 308C 80027C8C 24430010 */ addiu $v1, $v0, 0x10
/* 3090 80027C90 AC460000 */ sw $a2, ($v0)
/* 3094 80027C94 ADA30000 */ sw $v1, ($t5)
/* 3098 80027C98 24430018 */ addiu $v1, $v0, 0x18
/* 309C 80027C9C AC470008 */ sw $a3, 8($v0)
/* 30A0 80027CA0 AC45000C */ sw $a1, 0xc($v0)
/* 30A4 80027CA4 ADA30000 */ sw $v1, ($t5)
/* 30A8 80027CA8 3C030020 */ lui $v1, 0x20
/* 30AC 80027CAC AC430014 */ sw $v1, 0x14($v0)
/* 30B0 80027CB0 24430020 */ addiu $v1, $v0, 0x20
/* 30B4 80027CB4 AC480010 */ sw $t0, 0x10($v0)
/* 30B8 80027CB8 ADA30000 */ sw $v1, ($t5)
/* 30BC 80027CBC 24430028 */ addiu $v1, $v0, 0x28
/* 30C0 80027CC0 AC490018 */ sw $t1, 0x18($v0)
/* 30C4 80027CC4 AC40001C */ sw $zero, 0x1c($v0)
/* 30C8 80027CC8 ADA30000 */ sw $v1, ($t5)
/* 30CC 80027CCC 24430030 */ addiu $v1, $v0, 0x30
/* 30D0 80027CD0 AC4A0020 */ sw $t2, 0x20($v0)
/* 30D4 80027CD4 AC400024 */ sw $zero, 0x24($v0)
/* 30D8 80027CD8 ADA30000 */ sw $v1, ($t5)
/* 30DC 80027CDC 24430038 */ addiu $v1, $v0, 0x38
/* 30E0 80027CE0 AC4B0028 */ sw $t3, 0x28($v0)
/* 30E4 80027CE4 AC40002C */ sw $zero, 0x2c($v0)
/* 30E8 80027CE8 ADA30000 */ sw $v1, ($t5)
/* 30EC 80027CEC AC4C0030 */ sw $t4, 0x30($v0)
/* 30F0 80027CF0 AC400034 */ sw $zero, 0x34($v0)
.L80027CF4:
/* 30F4 80027CF4 3C061000 */ lui $a2, 0x1000
/* 30F8 80027CF8 34C60400 */ ori $a2, $a2, 0x400
/* 30FC 80027CFC 33050FFF */ andi $a1, $t8, 0xfff
/* 3100 80027D00 27180018 */ addiu $t8, $t8, 0x18
/* 3104 80027D04 31E40FFF */ andi $a0, $t7, 0xfff
/* 3108 80027D08 25EF0018 */ addiu $t7, $t7, 0x18
/* 310C 80027D0C 27390001 */ addiu $t9, $t9, 1
/* 3110 80027D10 8DA20000 */ lw $v0, ($t5)
/* 3114 80027D14 00922025 */ or $a0, $a0, $s2
/* 3118 80027D18 0040182D */ daddu $v1, $v0, $zero
/* 311C 80027D1C 24420008 */ addiu $v0, $v0, 8
/* 3120 80027D20 AC6E0004 */ sw $t6, 4($v1)
/* 3124 80027D24 ADA20000 */ sw $v0, ($t5)
/* 3128 80027D28 AC750000 */ sw $s5, ($v1)
/* 312C 80027D2C 24430008 */ addiu $v1, $v0, 8
/* 3130 80027D30 3C070700 */ lui $a3, 0x700
/* 3134 80027D34 ADA30000 */ sw $v1, ($t5)
/* 3138 80027D38 24430010 */ addiu $v1, $v0, 0x10
/* 313C 80027D3C AC470004 */ sw $a3, 4($v0)
/* 3140 80027D40 3C07E600 */ lui $a3, 0xe600
/* 3144 80027D44 AC500000 */ sw $s0, ($v0)
/* 3148 80027D48 ADA30000 */ sw $v1, ($t5)
/* 314C 80027D4C 24430018 */ addiu $v1, $v0, 0x18
/* 3150 80027D50 AC470008 */ sw $a3, 8($v0)
/* 3154 80027D54 3C07F400 */ lui $a3, 0xf400
/* 3158 80027D58 AC40000C */ sw $zero, 0xc($v0)
/* 315C 80027D5C ADA30000 */ sw $v1, ($t5)
/* 3160 80027D60 24430020 */ addiu $v1, $v0, 0x20
/* 3164 80027D64 AC470010 */ sw $a3, 0x10($v0)
/* 3168 80027D68 AC540014 */ sw $s4, 0x14($v0)
/* 316C 80027D6C ADA30000 */ sw $v1, ($t5)
/* 3170 80027D70 24430028 */ addiu $v1, $v0, 0x28
/* 3174 80027D74 AC510018 */ sw $s1, 0x18($v0)
/* 3178 80027D78 AC40001C */ sw $zero, 0x1c($v0)
/* 317C 80027D7C ADA30000 */ sw $v1, ($t5)
/* 3180 80027D80 24430030 */ addiu $v1, $v0, 0x30
/* 3184 80027D84 AC500020 */ sw $s0, 0x20($v0)
/* 3188 80027D88 AC400024 */ sw $zero, 0x24($v0)
/* 318C 80027D8C ADA30000 */ sw $v1, ($t5)
/* 3190 80027D90 24430038 */ addiu $v1, $v0, 0x38
/* 3194 80027D94 AC5E0028 */ sw $fp, 0x28($v0)
/* 3198 80027D98 AC53002C */ sw $s3, 0x2c($v0)
/* 319C 80027D9C ADA30000 */ sw $v1, ($t5)
/* 31A0 80027DA0 24430040 */ addiu $v1, $v0, 0x40
/* 31A4 80027DA4 AC440030 */ sw $a0, 0x30($v0)
/* 31A8 80027DA8 AC450034 */ sw $a1, 0x34($v0)
/* 31AC 80027DAC ADA30000 */ sw $v1, ($t5)
/* 31B0 80027DB0 24430048 */ addiu $v1, $v0, 0x48
/* 31B4 80027DB4 AC570038 */ sw $s7, 0x38($v0)
/* 31B8 80027DB8 AC40003C */ sw $zero, 0x3c($v0)
/* 31BC 80027DBC ADA30000 */ sw $v1, ($t5)
/* 31C0 80027DC0 24430050 */ addiu $v1, $v0, 0x50
/* 31C4 80027DC4 AC560040 */ sw $s6, 0x40($v0)
/* 31C8 80027DC8 AC460044 */ sw $a2, 0x44($v0)
/* 31CC 80027DCC ADA30000 */ sw $v1, ($t5)
/* 31D0 80027DD0 AC510048 */ sw $s1, 0x48($v0)
/* 31D4 80027DD4 AC40004C */ sw $zero, 0x4c($v0)
/* 31D8 80027DD8 2B220028 */ slti $v0, $t9, 0x28
/* 31DC 80027DDC 1440FFC5 */ bnez $v0, .L80027CF4
/* 31E0 80027DE0 25CE0F00 */ addiu $t6, $t6, 0xf00
/* 31E4 80027DE4 8FBE0028 */ lw $fp, 0x28($sp)
/* 31E8 80027DE8 8FB70024 */ lw $s7, 0x24($sp)
/* 31EC 80027DEC 8FB60020 */ lw $s6, 0x20($sp)
/* 31F0 80027DF0 8FB5001C */ lw $s5, 0x1c($sp)
/* 31F4 80027DF4 8FB40018 */ lw $s4, 0x18($sp)
/* 31F8 80027DF8 8FB30014 */ lw $s3, 0x14($sp)
/* 31FC 80027DFC 8FB20010 */ lw $s2, 0x10($sp)
/* 3200 80027E00 8FB1000C */ lw $s1, 0xc($sp)
/* 3204 80027E04 8FB00008 */ lw $s0, 8($sp)
/* 3208 80027E08 03E00008 */ jr $ra
/* 320C 80027E0C 27BD0030 */ addiu $sp, $sp, 0x30

View File

@ -1,197 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel gfx_draw_frame
/* 1F08 80026B08 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 1F0C 80026B0C 3C04800A */ lui $a0, %hi(gDisplayContext)
/* 1F10 80026B10 8C84A674 */ lw $a0, %lo(gDisplayContext)($a0)
/* 1F14 80026B14 3C05800A */ lui $a1, %hi(gMasterGfxPos)
/* 1F18 80026B18 24A5A66C */ addiu $a1, $a1, %lo(gMasterGfxPos)
/* 1F1C 80026B1C AFB00010 */ sw $s0, 0x10($sp)
/* 1F20 80026B20 3C10800A */ lui $s0, %hi(gOverrideFlags)
/* 1F24 80026B24 2610A650 */ addiu $s0, $s0, %lo(gOverrideFlags)
/* 1F28 80026B28 AFBF0018 */ sw $ra, 0x18($sp)
/* 1F2C 80026B2C AFB10014 */ sw $s1, 0x14($sp)
/* 1F30 80026B30 3C018007 */ lui $at, %hi(gMatrixListPos)
/* 1F34 80026B34 A42041F0 */ sh $zero, %lo(gMatrixListPos)($at)
/* 1F38 80026B38 8E020000 */ lw $v0, ($s0)
/* 1F3C 80026B3C 24830230 */ addiu $v1, $a0, 0x230
/* 1F40 80026B40 30420008 */ andi $v0, $v0, 8
/* 1F44 80026B44 10400007 */ beqz $v0, .L80026B64
/* 1F48 80026B48 ACA30000 */ sw $v1, ($a1)
/* 1F4C 80026B4C 3C038007 */ lui $v1, %hi(gCurrentDisplayContextIndex)
/* 1F50 80026B50 246341F4 */ addiu $v1, $v1, %lo(gCurrentDisplayContextIndex)
/* 1F54 80026B54 8C620000 */ lw $v0, ($v1)
/* 1F58 80026B58 38420001 */ xori $v0, $v0, 1
/* 1F5C 80026B5C 08009B72 */ j .L80026DC8
/* 1F60 80026B60 AC620000 */ sw $v0, ($v1)
.L80026B64:
/* 1F64 80026B64 3C03DA38 */ lui $v1, 0xda38
/* 1F68 80026B68 34630003 */ ori $v1, $v1, 3
/* 1F6C 80026B6C 24820238 */ addiu $v0, $a0, 0x238
/* 1F70 80026B70 ACA20000 */ sw $v0, ($a1)
/* 1F74 80026B74 3C028007 */ lui $v0, %hi(D_800741A8)
/* 1F78 80026B78 244241A8 */ addiu $v0, $v0, %lo(D_800741A8)
/* 1F7C 80026B7C AC830230 */ sw $v1, 0x230($a0)
/* 1F80 80026B80 0C0B7698 */ jal func_802DDA60
/* 1F84 80026B84 AC820234 */ sw $v0, 0x234($a0)
/* 1F88 80026B88 8E020000 */ lw $v0, ($s0)
/* 1F8C 80026B8C 30420002 */ andi $v0, $v0, 2
/* 1F90 80026B90 14400003 */ bnez $v0, .L80026BA0
/* 1F94 80026B94 00000000 */ nop
/* 1F98 80026B98 0C00B5CF */ jal render_frame
/* 1F9C 80026B9C 0000202D */ daddu $a0, $zero, $zero
.L80026BA0:
/* 1FA0 80026BA0 0C038098 */ jal func_800E0260
/* 1FA4 80026BA4 00000000 */ nop
/* 1FA8 80026BA8 0C0B0FB9 */ jal func_802C3EE4
/* 1FAC 80026BAC 00000000 */ nop
/* 1FB0 80026BB0 0C04E088 */ jal render_transition_stencil_lower
/* 1FB4 80026BB4 00000000 */ nop
/* 1FB8 80026BB8 0C048D54 */ jal render_dynamic_entities_backUI
/* 1FBC 80026BBC 00000000 */ nop
/* 1FC0 80026BC0 0C050884 */ jal func_80142210
/* 1FC4 80026BC4 00000000 */ nop
/* 1FC8 80026BC8 0C0167E5 */ jal func_80059F94
/* 1FCC 80026BCC 00000000 */ nop
/* 1FD0 80026BD0 0C044BD6 */ jal render_ui
/* 1FD4 80026BD4 00000000 */ nop
/* 1FD8 80026BD8 8E020000 */ lw $v0, ($s0)
/* 1FDC 80026BDC 3C030001 */ lui $v1, 1
/* 1FE0 80026BE0 00431024 */ and $v0, $v0, $v1
/* 1FE4 80026BE4 14400003 */ bnez $v0, .L80026BF4
/* 1FE8 80026BE8 00000000 */ nop
/* 1FEC 80026BEC 0C051EB1 */ jal render_window_root
/* 1FF0 80026BF0 00000000 */ nop
.L80026BF4:
/* 1FF4 80026BF4 8E020000 */ lw $v0, ($s0)
/* 1FF8 80026BF8 30420002 */ andi $v0, $v0, 2
/* 1FFC 80026BFC 14400009 */ bnez $v0, .L80026C24
/* 2000 80026C00 3C100010 */ lui $s0, 0x10
/* 2004 80026C04 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* 2008 80026C08 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* 200C 80026C0C 80420078 */ lb $v0, 0x78($v0)
/* 2010 80026C10 14400004 */ bnez $v0, .L80026C24
/* 2014 80026C14 00000000 */ nop
/* 2018 80026C18 0C00B5CF */ jal render_frame
/* 201C 80026C1C 24040001 */ addiu $a0, $zero, 1
/* 2020 80026C20 3C100010 */ lui $s0, 0x10
.L80026C24:
/* 2024 80026C24 3C11800A */ lui $s1, %hi(gOverrideFlags)
/* 2028 80026C28 2631A650 */ addiu $s1, $s1, %lo(gOverrideFlags)
/* 202C 80026C2C 8E220000 */ lw $v0, ($s1)
/* 2030 80026C30 36100010 */ ori $s0, $s0, 0x10
/* 2034 80026C34 00501024 */ and $v0, $v0, $s0
/* 2038 80026C38 14400003 */ bnez $v0, .L80026C48
/* 203C 80026C3C 00000000 */ nop
/* 2040 80026C40 0C049081 */ jal render_messages
/* 2044 80026C44 00000000 */ nop
.L80026C48:
/* 2048 80026C48 0C048D38 */ jal render_dynamic_entities_frontUI
/* 204C 80026C4C 00000000 */ nop
/* 2050 80026C50 0C0509C7 */ jal func_8014271C
/* 2054 80026C54 00000000 */ nop
/* 2058 80026C58 0C04E068 */ jal render_transition_stencil_upper
/* 205C 80026C5C 00000000 */ nop
/* 2060 80026C60 8E220000 */ lw $v0, ($s1)
/* 2064 80026C64 24030010 */ addiu $v1, $zero, 0x10
/* 2068 80026C68 00501024 */ and $v0, $v0, $s0
/* 206C 80026C6C 14430003 */ bne $v0, $v1, .L80026C7C
/* 2070 80026C70 00000000 */ nop
/* 2074 80026C74 0C049081 */ jal render_messages
/* 2078 80026C78 00000000 */ nop
.L80026C7C:
/* 207C 80026C7C 0C00AEA0 */ jal render_curtains
/* 2080 80026C80 00000000 */ nop
/* 2084 80026C84 8E220000 */ lw $v0, ($s1)
/* 2088 80026C88 3C030010 */ lui $v1, 0x10
/* 208C 80026C8C 00431024 */ and $v0, $v0, $v1
/* 2090 80026C90 10400003 */ beqz $v0, .L80026CA0
/* 2094 80026C94 00000000 */ nop
/* 2098 80026C98 0C049081 */ jal render_messages
/* 209C 80026C9C 00000000 */ nop
.L80026CA0:
/* 20A0 80026CA0 8E220000 */ lw $v0, ($s1)
/* 20A4 80026CA4 3C030001 */ lui $v1, 1
/* 20A8 80026CA8 00431024 */ and $v0, $v0, $v1
/* 20AC 80026CAC 10400003 */ beqz $v0, .L80026CBC
/* 20B0 80026CB0 00000000 */ nop
/* 20B4 80026CB4 0C051EB1 */ jal render_window_root
/* 20B8 80026CB8 00000000 */ nop
.L80026CBC:
/* 20BC 80026CBC 0C044BF1 */ jal func_80112FC4
/* 20C0 80026CC0 00000000 */ nop
/* 20C4 80026CC4 8E220000 */ lw $v0, ($s1)
/* 20C8 80026CC8 30420020 */ andi $v0, $v0, 0x20
/* 20CC 80026CCC 10400010 */ beqz $v0, .L80026D10
/* 20D0 80026CD0 00000000 */ nop
/* 20D4 80026CD4 3C038007 */ lui $v1, %hi(D_800741A2)
/* 20D8 80026CD8 846341A2 */ lh $v1, %lo(D_800741A2)($v1)
/* 20DC 80026CDC 28620002 */ slti $v0, $v1, 2
/* 20E0 80026CE0 1040000B */ beqz $v0, .L80026D10
/* 20E4 80026CE4 00000000 */ nop
/* 20E8 80026CE8 04600009 */ bltz $v1, .L80026D10
/* 20EC 80026CEC 24040007 */ addiu $a0, $zero, 7
/* 20F0 80026CF0 3C028007 */ lui $v0, %hi(D_800741A0)
/* 20F4 80026CF4 844241A0 */ lh $v0, %lo(D_800741A0)($v0)
/* 20F8 80026CF8 44820000 */ mtc1 $v0, $f0
/* 20FC 80026CFC 00000000 */ nop
/* 2100 80026D00 46800020 */ cvt.s.w $f0, $f0
/* 2104 80026D04 44050000 */ mfc1 $a1, $f0
/* 2108 80026D08 0C04DAA0 */ jal _render_transition_stencil
/* 210C 80026D0C 0000302D */ daddu $a2, $zero, $zero
.L80026D10:
/* 2110 80026D10 3C02800A */ lui $v0, %hi(gMasterGfxPos)
/* 2114 80026D14 8C42A66C */ lw $v0, %lo(gMasterGfxPos)($v0)
/* 2118 80026D18 3C03800A */ lui $v1, %hi(gDisplayContext)
/* 211C 80026D1C 8C63A674 */ lw $v1, %lo(gDisplayContext)($v1)
/* 2120 80026D20 2442FDD0 */ addiu $v0, $v0, -0x230
/* 2124 80026D24 00431023 */ subu $v0, $v0, $v1
/* 2128 80026D28 000210C2 */ srl $v0, $v0, 3
/* 212C 80026D2C 28422080 */ slti $v0, $v0, 0x2080
/* 2130 80026D30 54400003 */ bnel $v0, $zero, .L80026D40
/* 2134 80026D34 0000302D */ daddu $a2, $zero, $zero
.L80026D38:
/* 2138 80026D38 08009B4E */ j .L80026D38
/* 213C 80026D3C 00000000 */ nop
.L80026D40:
/* 2140 80026D40 3C070004 */ lui $a3, 4
/* 2144 80026D44 3C08800A */ lui $t0, %hi(gMasterGfxPos)
/* 2148 80026D48 2508A66C */ addiu $t0, $t0, %lo(gMasterGfxPos)
/* 214C 80026D4C 34E70001 */ ori $a3, $a3, 1
/* 2150 80026D50 8D030000 */ lw $v1, ($t0)
/* 2154 80026D54 3C02800A */ lui $v0, %hi(gDisplayContext)
/* 2158 80026D58 8C42A674 */ lw $v0, %lo(gDisplayContext)($v0)
/* 215C 80026D5C 0060482D */ daddu $t1, $v1, $zero
/* 2160 80026D60 24630008 */ addiu $v1, $v1, 8
/* 2164 80026D64 24440230 */ addiu $a0, $v0, 0x230
/* 2168 80026D68 2465FDD8 */ addiu $a1, $v1, -0x228
/* 216C 80026D6C 00A22823 */ subu $a1, $a1, $v0
/* 2170 80026D70 000528C3 */ sra $a1, $a1, 3
/* 2174 80026D74 000528C0 */ sll $a1, $a1, 3
/* 2178 80026D78 3C02E900 */ lui $v0, 0xe900
/* 217C 80026D7C AD030000 */ sw $v1, ($t0)
/* 2180 80026D80 AD220000 */ sw $v0, ($t1)
/* 2184 80026D84 24620008 */ addiu $v0, $v1, 8
/* 2188 80026D88 AD200004 */ sw $zero, 4($t1)
/* 218C 80026D8C AD020000 */ sw $v0, ($t0)
/* 2190 80026D90 3C02DF00 */ lui $v0, 0xdf00
/* 2194 80026D94 AC620000 */ sw $v0, ($v1)
/* 2198 80026D98 0C00B331 */ jal nuGfxTaskStart
/* 219C 80026D9C AC600004 */ sw $zero, 4($v1)
/* 21A0 80026DA0 24050140 */ addiu $a1, $zero, 0x140
/* 21A4 80026DA4 240600F0 */ addiu $a2, $zero, 0xf0
/* 21A8 80026DA8 3C038007 */ lui $v1, %hi(gCurrentDisplayContextIndex)
/* 21AC 80026DAC 246341F4 */ addiu $v1, $v1, %lo(gCurrentDisplayContextIndex)
/* 21B0 80026DB0 8C620000 */ lw $v0, ($v1)
/* 21B4 80026DB4 3C04800A */ lui $a0, %hi(D_8009A64C)
/* 21B8 80026DB8 8C84A64C */ lw $a0, %lo(D_8009A64C)($a0)
/* 21BC 80026DBC 38420001 */ xori $v0, $v0, 1
/* 21C0 80026DC0 0C00B224 */ jal func_8002C890
/* 21C4 80026DC4 AC620000 */ sw $v0, ($v1)
.L80026DC8:
/* 21C8 80026DC8 8FBF0018 */ lw $ra, 0x18($sp)
/* 21CC 80026DCC 8FB10014 */ lw $s1, 0x14($sp)
/* 21D0 80026DD0 8FB00010 */ lw $s0, 0x10($sp)
/* 21D4 80026DD4 03E00008 */ jr $ra
/* 21D8 80026DD8 27BD0020 */ addiu $sp, $sp, 0x20

View File

@ -1,27 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel gfx_init_state
/* 25A0 800271A0 3C04800A */ lui $a0, %hi(gMasterGfxPos)
/* 25A4 800271A4 2484A66C */ addiu $a0, $a0, %lo(gMasterGfxPos)
/* 25A8 800271A8 8C830000 */ lw $v1, ($a0)
/* 25AC 800271AC 3C02DB06 */ lui $v0, 0xdb06
/* 25B0 800271B0 0060282D */ daddu $a1, $v1, $zero
/* 25B4 800271B4 24630008 */ addiu $v1, $v1, 8
/* 25B8 800271B8 AC830000 */ sw $v1, ($a0)
/* 25BC 800271BC ACA20000 */ sw $v0, ($a1)
/* 25C0 800271C0 24620008 */ addiu $v0, $v1, 8
/* 25C4 800271C4 ACA00004 */ sw $zero, 4($a1)
/* 25C8 800271C8 3C05DE00 */ lui $a1, 0xde00
/* 25CC 800271CC AC820000 */ sw $v0, ($a0)
/* 25D0 800271D0 3C020007 */ lui $v0, 7
/* 25D4 800271D4 24424230 */ addiu $v0, $v0, 0x4230
/* 25D8 800271D8 AC620004 */ sw $v0, 4($v1)
/* 25DC 800271DC 24620010 */ addiu $v0, $v1, 0x10
/* 25E0 800271E0 AC650000 */ sw $a1, ($v1)
/* 25E4 800271E4 AC820000 */ sw $v0, ($a0)
/* 25E8 800271E8 3C020007 */ lui $v0, 7
/* 25EC 800271EC 24424210 */ addiu $v0, $v0, 0x4210
/* 25F0 800271F0 AC650008 */ sw $a1, 8($v1)
/* 25F4 800271F4 03E00008 */ jr $ra
/* 25F8 800271F8 AC62000C */ sw $v0, 0xc($v1)

View File

@ -1,57 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_E011A3BC
/* 4045DC E011A3BC 0080482D */ daddu $t1, $a0, $zero
/* 4045E0 E011A3C0 00091400 */ sll $v0, $t1, 0x10
/* 4045E4 E011A3C4 00021403 */ sra $v0, $v0, 0x10
/* 4045E8 E011A3C8 240300FF */ addiu $v1, $zero, 0xff
/* 4045EC E011A3CC 14430015 */ bne $v0, $v1, .LE011A424
/* 4045F0 E011A3D0 3C07E200 */ lui $a3, 0xe200
/* 4045F4 E011A3D4 34E7001C */ ori $a3, $a3, 0x1c
/* 4045F8 E011A3D8 3C050055 */ lui $a1, 0x55
/* 4045FC E011A3DC 34A51208 */ ori $a1, $a1, 0x1208
/* 404600 E011A3E0 3C08FCFF */ lui $t0, 0xfcff
/* 404604 E011A3E4 3508FFFF */ ori $t0, $t0, 0xffff
/* 404608 E011A3E8 3C06FFFC */ lui $a2, 0xfffc
/* 40460C E011A3EC 3C04800A */ lui $a0, %hi(gMasterGfxPos)
/* 404610 E011A3F0 2484A66C */ addiu $a0, $a0, %lo(gMasterGfxPos)
/* 404614 E011A3F4 8C820000 */ lw $v0, ($a0)
/* 404618 E011A3F8 34C6F279 */ ori $a2, $a2, 0xf279
/* 40461C E011A3FC 0040182D */ daddu $v1, $v0, $zero
/* 404620 E011A400 24420008 */ addiu $v0, $v0, 8
/* 404624 E011A404 AC820000 */ sw $v0, ($a0)
/* 404628 E011A408 AC670000 */ sw $a3, ($v1)
/* 40462C E011A40C AC650004 */ sw $a1, 4($v1)
/* 404630 E011A410 24430008 */ addiu $v1, $v0, 8
/* 404634 E011A414 AC830000 */ sw $v1, ($a0)
/* 404638 E011A418 AC480000 */ sw $t0, ($v0)
/* 40463C E011A41C 03E00008 */ jr $ra
/* 404640 E011A420 AC460004 */ sw $a2, 4($v0)
.LE011A424:
/* 404644 E011A424 34E7001C */ ori $a3, $a3, 0x1c
/* 404648 E011A428 3C050050 */ lui $a1, 0x50
/* 40464C E011A42C 34A54340 */ ori $a1, $a1, 0x4340
/* 404650 E011A430 3C08FCFF */ lui $t0, 0xfcff
/* 404654 E011A434 3508B3FF */ ori $t0, $t0, 0xb3ff
/* 404658 E011A438 3C06FF64 */ lui $a2, 0xff64
/* 40465C E011A43C 3C04800A */ lui $a0, %hi(gMasterGfxPos)
/* 404660 E011A440 2484A66C */ addiu $a0, $a0, %lo(gMasterGfxPos)
/* 404664 E011A444 8C820000 */ lw $v0, ($a0)
/* 404668 E011A448 34C6FE7F */ ori $a2, $a2, 0xfe7f
/* 40466C E011A44C 0040182D */ daddu $v1, $v0, $zero
/* 404670 E011A450 24420008 */ addiu $v0, $v0, 8
/* 404674 E011A454 AC820000 */ sw $v0, ($a0)
/* 404678 E011A458 AC670000 */ sw $a3, ($v1)
/* 40467C E011A45C AC650004 */ sw $a1, 4($v1)
/* 404680 E011A460 24430008 */ addiu $v1, $v0, 8
/* 404684 E011A464 AC830000 */ sw $v1, ($a0)
/* 404688 E011A468 24430010 */ addiu $v1, $v0, 0x10
/* 40468C E011A46C AC480000 */ sw $t0, ($v0)
/* 404690 E011A470 AC460004 */ sw $a2, 4($v0)
/* 404694 E011A474 AC830000 */ sw $v1, ($a0)
/* 404698 E011A478 3C03FA00 */ lui $v1, 0xfa00
/* 40469C E011A47C AC430008 */ sw $v1, 8($v0)
/* 4046A0 E011A480 312300FF */ andi $v1, $t1, 0xff
/* 4046A4 E011A484 03E00008 */ jr $ra
/* 4046A8 E011A488 AC43000C */ sw $v1, 0xc($v0)

View File

@ -0,0 +1,169 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_800E205C
/* 7B50C 800E205C 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 7B510 800E2060 2402FFFF */ addiu $v0, $zero, -1
/* 7B514 800E2064 3C058011 */ lui $a1, %hi(D_8010C92C)
/* 7B518 800E2068 24A5C92C */ addiu $a1, $a1, %lo(D_8010C92C)
/* 7B51C 800E206C AFB00010 */ sw $s0, 0x10($sp)
/* 7B520 800E2070 3C108011 */ lui $s0, %hi(gPlayerStatus)
/* 7B524 800E2074 2610EFC8 */ addiu $s0, $s0, %lo(gPlayerStatus)
/* 7B528 800E2078 3C018011 */ lui $at, %hi(D_8010C96C)
/* 7B52C 800E207C AC22C96C */ sw $v0, %lo(D_8010C96C)($at)
/* 7B530 800E2080 24020001 */ addiu $v0, $zero, 1
/* 7B534 800E2084 AFBF0014 */ sw $ra, 0x14($sp)
/* 7B538 800E2088 3C018011 */ lui $at, %hi(D_8010C954)
/* 7B53C 800E208C AC20C954 */ sw $zero, %lo(D_8010C954)($at)
/* 7B540 800E2090 3C018011 */ lui $at, %hi(D_8010C920)
/* 7B544 800E2094 AC20C920 */ sw $zero, %lo(D_8010C920)($at)
/* 7B548 800E2098 3C018011 */ lui $at, %hi(D_8010C940)
/* 7B54C 800E209C AC20C940 */ sw $zero, %lo(D_8010C940)($at)
/* 7B550 800E20A0 3C018011 */ lui $at, %hi(D_8010C958)
/* 7B554 800E20A4 AC20C958 */ sw $zero, %lo(D_8010C958)($at)
/* 7B558 800E20A8 ACA00000 */ sw $zero, ($a1)
/* 7B55C 800E20AC 3C018011 */ lui $at, %hi(D_8010C95C)
/* 7B560 800E20B0 AC20C95C */ sw $zero, %lo(D_8010C95C)($at)
/* 7B564 800E20B4 3C018011 */ lui $at, %hi(D_8010C980)
/* 7B568 800E20B8 AC20C980 */ sw $zero, %lo(D_8010C980)($at)
/* 7B56C 800E20BC 3C01800F */ lui $at, %hi(D_800F7B40)
/* 7B570 800E20C0 AC207B40 */ sw $zero, %lo(D_800F7B40)($at)
/* 7B574 800E20C4 3C01800F */ lui $at, %hi(D_800F7B44)
/* 7B578 800E20C8 AC207B44 */ sw $zero, %lo(D_800F7B44)($at)
/* 7B57C 800E20CC 3C018011 */ lui $at, %hi(D_8010C938)
/* 7B580 800E20D0 AC20C938 */ sw $zero, %lo(D_8010C938)($at)
/* 7B584 800E20D4 3C018011 */ lui $at, %hi(D_8010C990)
/* 7B588 800E20D8 AC20C990 */ sw $zero, %lo(D_8010C990)($at)
/* 7B58C 800E20DC A202000D */ sb $v0, 0xd($s0)
/* 7B590 800E20E0 2402000D */ addiu $v0, $zero, 0xd
/* 7B594 800E20E4 3C048007 */ lui $a0, %hi(gGameStatusPtr)
/* 7B598 800E20E8 2484419C */ addiu $a0, $a0, %lo(gGameStatusPtr)
/* 7B59C 800E20EC A20200BE */ sb $v0, 0xbe($s0)
/* 7B5A0 800E20F0 8C830000 */ lw $v1, ($a0)
/* 7B5A4 800E20F4 240200FF */ addiu $v0, $zero, 0xff
/* 7B5A8 800E20F8 A202000E */ sb $v0, 0xe($s0)
/* 7B5AC 800E20FC A202000F */ sb $v0, 0xf($s0)
/* 7B5B0 800E2100 9062007E */ lbu $v0, 0x7e($v1)
/* 7B5B4 800E2104 304200F7 */ andi $v0, $v0, 0xf7
/* 7B5B8 800E2108 A062007E */ sb $v0, 0x7e($v1)
/* 7B5BC 800E210C 8C830000 */ lw $v1, ($a0)
/* 7B5C0 800E2110 9062007E */ lbu $v0, 0x7e($v1)
/* 7B5C4 800E2114 304200EF */ andi $v0, $v0, 0xef
/* 7B5C8 800E2118 A062007E */ sb $v0, 0x7e($v1)
/* 7B5CC 800E211C 8C840000 */ lw $a0, ($a0)
/* 7B5D0 800E2120 9082007E */ lbu $v0, 0x7e($a0)
/* 7B5D4 800E2124 3C013F80 */ lui $at, 0x3f80
/* 7B5D8 800E2128 44811000 */ mtc1 $at, $f2
/* 7B5DC 800E212C 30420001 */ andi $v0, $v0, 1
/* 7B5E0 800E2130 1040000F */ beqz $v0, .L800E2170
/* 7B5E4 800E2134 24020037 */ addiu $v0, $zero, 0x37
/* 7B5E8 800E2138 A60200B0 */ sh $v0, 0xb0($s0)
/* 7B5EC 800E213C 8E020004 */ lw $v0, 4($s0)
/* 7B5F0 800E2140 24030026 */ addiu $v1, $zero, 0x26
/* 7B5F4 800E2144 A60300B2 */ sh $v1, 0xb2($s0)
/* 7B5F8 800E2148 34421000 */ ori $v0, $v0, 0x1000
/* 7B5FC 800E214C AE020004 */ sw $v0, 4($s0)
/* 7B600 800E2150 9082007E */ lbu $v0, 0x7e($a0)
/* 7B604 800E2154 30420002 */ andi $v0, $v0, 2
/* 7B608 800E2158 1040000A */ beqz $v0, .L800E2184
/* 7B60C 800E215C 24020002 */ addiu $v0, $zero, 2
/* 7B610 800E2160 ACA20000 */ sw $v0, ($a1)
/* 7B614 800E2164 9082007F */ lbu $v0, 0x7f($a0)
/* 7B618 800E2168 08038861 */ j .L800E2184
/* 7B61C 800E216C A202000C */ sb $v0, 0xc($s0)
.L800E2170:
/* 7B620 800E2170 24020025 */ addiu $v0, $zero, 0x25
/* 7B624 800E2174 A60200B0 */ sh $v0, 0xb0($s0)
/* 7B628 800E2178 2402001A */ addiu $v0, $zero, 0x1a
/* 7B62C 800E217C A60200B2 */ sh $v0, 0xb2($s0)
/* 7B630 800E2180 A0800080 */ sb $zero, 0x80($a0)
.L800E2184:
/* 7B634 800E2184 3C02800F */ lui $v0, %hi(D_800F7B70)
/* 7B638 800E2188 24427B70 */ addiu $v0, $v0, %lo(D_800F7B70)
/* 7B63C 800E218C C4400000 */ lwc1 $f0, ($v0)
/* 7B640 800E2190 46020002 */ mul.s $f0, $f0, $f2
/* 7B644 800E2194 00000000 */ nop
/* 7B648 800E2198 24420004 */ addiu $v0, $v0, 4
/* 7B64C 800E219C E6000058 */ swc1 $f0, 0x58($s0)
/* 7B650 800E21A0 C4400000 */ lwc1 $f0, ($v0)
/* 7B654 800E21A4 46020002 */ mul.s $f0, $f0, $f2
/* 7B658 800E21A8 00000000 */ nop
/* 7B65C 800E21AC E600005C */ swc1 $f0, 0x5c($s0)
/* 7B660 800E21B0 C4400004 */ lwc1 $f0, 4($v0)
/* 7B664 800E21B4 46020002 */ mul.s $f0, $f0, $f2
/* 7B668 800E21B8 00000000 */ nop
/* 7B66C 800E21BC 0000202D */ daddu $a0, $zero, $zero
/* 7B670 800E21C0 0C039769 */ jal set_action_state
/* 7B674 800E21C4 E600006C */ swc1 $f0, 0x6c($s0)
/* 7B678 800E21C8 3C068007 */ lui $a2, %hi(gGameStatusPtr)
/* 7B67C 800E21CC 8CC6419C */ lw $a2, %lo(gGameStatusPtr)($a2)
/* 7B680 800E21D0 AE000054 */ sw $zero, 0x54($s0)
/* 7B684 800E21D4 AE000080 */ sw $zero, 0x80($s0)
/* 7B688 800E21D8 AE000064 */ sw $zero, 0x64($s0)
/* 7B68C 800E21DC AE000088 */ sw $zero, 0x88($s0)
/* 7B690 800E21E0 AE0000B8 */ sw $zero, 0xb8($s0)
/* 7B694 800E21E4 A60000C0 */ sh $zero, 0xc0($s0)
/* 7B698 800E21E8 AE000028 */ sw $zero, 0x28($s0)
/* 7B69C 800E21EC AE00002C */ sw $zero, 0x2c($s0)
/* 7B6A0 800E21F0 AE000030 */ sw $zero, 0x30($s0)
/* 7B6A4 800E21F4 AE000084 */ sw $zero, 0x84($s0)
/* 7B6A8 800E21F8 AE000090 */ sw $zero, 0x90($s0)
/* 7B6AC 800E21FC AE000094 */ sw $zero, 0x94($s0)
/* 7B6B0 800E2200 AE000098 */ sw $zero, 0x98($s0)
/* 7B6B4 800E2204 AE00009C */ sw $zero, 0x9c($s0)
/* 7B6B8 800E2208 84C30086 */ lh $v1, 0x86($a2)
/* 7B6BC 800E220C 84C2008C */ lh $v0, 0x8c($a2)
/* 7B6C0 800E2210 00031900 */ sll $v1, $v1, 4
/* 7B6C4 800E2214 3C018009 */ lui $at, %hi(gAreas+0x4)
/* 7B6C8 800E2218 00230821 */ addu $at, $at, $v1
/* 7B6CC 800E221C 8C2334F4 */ lw $v1, %lo(gAreas+0x4)($at)
/* 7B6D0 800E2220 00021140 */ sll $v0, $v0, 5
/* 7B6D4 800E2224 00431021 */ addu $v0, $v0, $v1
/* 7B6D8 800E2228 8C440004 */ lw $a0, 4($v0)
/* 7B6DC 800E222C 8C850014 */ lw $a1, 0x14($a0)
/* 7B6E0 800E2230 10A0001B */ beqz $a1, .L800E22A0
/* 7B6E4 800E2234 00000000 */ nop
/* 7B6E8 800E2238 84C3008E */ lh $v1, 0x8e($a2)
/* 7B6EC 800E223C 8C820018 */ lw $v0, 0x18($a0)
/* 7B6F0 800E2240 0062102A */ slt $v0, $v1, $v0
/* 7B6F4 800E2244 10400016 */ beqz $v0, .L800E22A0
/* 7B6F8 800E2248 00031100 */ sll $v0, $v1, 4
/* 7B6FC 800E224C 00451021 */ addu $v0, $v0, $a1
/* 7B700 800E2250 C4400000 */ lwc1 $f0, ($v0)
/* 7B704 800E2254 E6000028 */ swc1 $f0, 0x28($s0)
/* 7B708 800E2258 84C2008E */ lh $v0, 0x8e($a2)
/* 7B70C 800E225C 8C830014 */ lw $v1, 0x14($a0)
/* 7B710 800E2260 00021100 */ sll $v0, $v0, 4
/* 7B714 800E2264 00431021 */ addu $v0, $v0, $v1
/* 7B718 800E2268 C4400004 */ lwc1 $f0, 4($v0)
/* 7B71C 800E226C E600002C */ swc1 $f0, 0x2c($s0)
/* 7B720 800E2270 84C2008E */ lh $v0, 0x8e($a2)
/* 7B724 800E2274 8C830014 */ lw $v1, 0x14($a0)
/* 7B728 800E2278 00021100 */ sll $v0, $v0, 4
/* 7B72C 800E227C 00431021 */ addu $v0, $v0, $v1
/* 7B730 800E2280 C4400008 */ lwc1 $f0, 8($v0)
/* 7B734 800E2284 E6000030 */ swc1 $f0, 0x30($s0)
/* 7B738 800E2288 84C2008E */ lh $v0, 0x8e($a2)
/* 7B73C 800E228C 8C830014 */ lw $v1, 0x14($a0)
/* 7B740 800E2290 00021100 */ sll $v0, $v0, 4
/* 7B744 800E2294 00431021 */ addu $v0, $v0, $v1
/* 7B748 800E2298 C440000C */ lwc1 $f0, 0xc($v0)
/* 7B74C 800E229C E6000084 */ swc1 $f0, 0x84($s0)
.L800E22A0:
/* 7B750 800E22A0 C6000028 */ lwc1 $f0, 0x28($s0)
/* 7B754 800E22A4 C602002C */ lwc1 $f2, 0x2c($s0)
/* 7B758 800E22A8 C6040030 */ lwc1 $f4, 0x30($s0)
/* 7B75C 800E22AC 3C02800B */ lui $v0, %hi(gCameras)
/* 7B760 800E22B0 24421D80 */ addiu $v0, $v0, %lo(gCameras)
/* 7B764 800E22B4 E4400060 */ swc1 $f0, 0x60($v0)
/* 7B768 800E22B8 E4420064 */ swc1 $f2, 0x64($v0)
/* 7B76C 800E22BC 0C039668 */ jal func_800E59A0
/* 7B770 800E22C0 E4440068 */ swc1 $f4, 0x68($v0)
/* 7B774 800E22C4 3C048011 */ lui $a0, %hi(D_8010F250)
/* 7B778 800E22C8 2484F250 */ addiu $a0, $a0, %lo(D_8010F250)
/* 7B77C 800E22CC 0C00A580 */ jal mem_clear
/* 7B780 800E22D0 24050034 */ addiu $a1, $zero, 0x34
/* 7B784 800E22D4 8FBF0014 */ lw $ra, 0x14($sp)
/* 7B788 800E22D8 8FB00010 */ lw $s0, 0x10($sp)
/* 7B78C 800E22DC 03E00008 */ jr $ra
/* 7B790 800E22E0 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -0,0 +1,42 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel gravity_use_fall_params
/* 7C51C 800E306C 3C04800F */ lui $a0, %hi(D_800F7B60)
/* 7C520 800E3070 24847B60 */ addiu $a0, $a0, %lo(D_800F7B60)
/* 7C524 800E3074 3C068011 */ lui $a2, %hi(gPlayerStatus)
/* 7C528 800E3078 24C6EFC8 */ addiu $a2, $a2, %lo(gPlayerStatus)
/* 7C52C 800E307C 8CC20000 */ lw $v0, ($a2)
/* 7C530 800E3080 3C030004 */ lui $v1, 4
/* 7C534 800E3084 00431024 */ and $v0, $v0, $v1
/* 7C538 800E3088 10400012 */ beqz $v0, .L800E30D4
/* 7C53C 800E308C 00C0282D */ daddu $a1, $a2, $zero
/* 7C540 800E3090 C4800000 */ lwc1 $f0, ($a0)
/* 7C544 800E3094 3C014140 */ lui $at, 0x4140
/* 7C548 800E3098 44811000 */ mtc1 $at, $f2
/* 7C54C 800E309C 24840004 */ addiu $a0, $a0, 4
/* 7C550 800E30A0 46020003 */ div.s $f0, $f0, $f2
/* 7C554 800E30A4 E4C00070 */ swc1 $f0, 0x70($a2)
/* 7C558 800E30A8 C4800000 */ lwc1 $f0, ($a0)
/* 7C55C 800E30AC 24840004 */ addiu $a0, $a0, 4
/* 7C560 800E30B0 46020003 */ div.s $f0, $f0, $f2
/* 7C564 800E30B4 E4C00074 */ swc1 $f0, 0x74($a2)
/* 7C568 800E30B8 C4800000 */ lwc1 $f0, ($a0)
/* 7C56C 800E30BC 46020003 */ div.s $f0, $f0, $f2
/* 7C570 800E30C0 E4C00078 */ swc1 $f0, 0x78($a2)
/* 7C574 800E30C4 C4800004 */ lwc1 $f0, 4($a0)
/* 7C578 800E30C8 46020003 */ div.s $f0, $f0, $f2
/* 7C57C 800E30CC 03E00008 */ jr $ra
/* 7C580 800E30D0 E4C0007C */ swc1 $f0, 0x7c($a2)
.L800E30D4:
/* 7C584 800E30D4 C4800000 */ lwc1 $f0, ($a0)
/* 7C588 800E30D8 24840004 */ addiu $a0, $a0, 4
/* 7C58C 800E30DC E4A00070 */ swc1 $f0, 0x70($a1)
/* 7C590 800E30E0 C4800000 */ lwc1 $f0, ($a0)
/* 7C594 800E30E4 24840004 */ addiu $a0, $a0, 4
/* 7C598 800E30E8 E4A00074 */ swc1 $f0, 0x74($a1)
/* 7C59C 800E30EC C4800000 */ lwc1 $f0, ($a0)
/* 7C5A0 800E30F0 E4A00078 */ swc1 $f0, 0x78($a1)
/* 7C5A4 800E30F4 C4800004 */ lwc1 $f0, 4($a0)
/* 7C5A8 800E30F8 03E00008 */ jr $ra
/* 7C5AC 800E30FC E4A0007C */ swc1 $f0, 0x7c($a1)

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