* progress

* Fix modern gcc issue with function call arg evaluation order, shiftability issue with heap, other fixes

* cursed function byebye

* configure cleanup

* Fix configure issue

* MakeShop

Co-authored-by: JoshDuMan <40190173+JoshDuMan@users.noreply.github.com>

* item_entity_load

Co-authored-by: JoshDuMan <40190173+JoshDuMan@users.noreply.github.com>

* closer

* PR comment

---------

Co-authored-by: JoshDuMan <40190173+JoshDuMan@users.noreply.github.com>
This commit is contained in:
Ethan Roseman 2023-02-22 17:22:31 +09:00 committed by GitHub
parent 44fd49ea0b
commit 8f974438a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
24 changed files with 362 additions and 1385 deletions

View File

@ -2448,9 +2448,7 @@ typedef struct LilOinkFXData {
typedef struct SomethingRotatingFXData { typedef struct SomethingRotatingFXData {
/* 0x00 */ s32 unk_00; /* 0x00 */ s32 unk_00;
/* 0x04 */ f32 unk_04; /* 0x04 */ Vec3f pos;
/* 0x08 */ f32 unk_08;
/* 0x0C */ f32 unk_0C;
/* 0x10 */ s32 unk_10; /* 0x10 */ s32 unk_10;
/* 0x14 */ s32 unk_14; /* 0x14 */ s32 unk_14;
/* 0x18 */ f32 unk_18; /* 0x18 */ f32 unk_18;

View File

@ -100,6 +100,7 @@
#define SCREEN_WIDTH 320 #define SCREEN_WIDTH 320
#define SCREEN_HEIGHT 240 #define SCREEN_HEIGHT 240
#define WORLD_ENTITY_HEAP_SIZE 0x17FF0
#define COLLISION_HEAP_SIZE 0x18000 #define COLLISION_HEAP_SIZE 0x18000
#define GENERAL_HEAP_SIZE 0x54000 #define GENERAL_HEAP_SIZE 0x54000
#define SPRITE_HEAP_SIZE 0x40000 #define SPRITE_HEAP_SIZE 0x40000
@ -222,4 +223,8 @@
#define VLA #define VLA
#endif #endif
#ifdef M2CTX
#define VLA 0
#endif
#endif #endif

View File

@ -765,40 +765,35 @@ void init_item_entity_list(void) {
extern s32* gItemEntityScripts[]; extern s32* gItemEntityScripts[];
void item_entity_load(ItemEntity* item);
// WIP
#ifdef NON_MATCHING
void item_entity_load(ItemEntity* item) { void item_entity_load(ItemEntity* item) {
s32* pos; s32* pos;
HudCacheEntry* entry; HudCacheEntry* entry;
s32 cond; s32 cond;
s32 raster; s32 raster;
s32 palette; s32 palette;
s32 capacity; s32 size;
s32 i; s32 i;
pos = gItemEntityScripts[item->itemID]; item->savedReadPos = item->readPos = pos = gItemEntityScripts[item->itemID];
item->readPos = pos;
item->savedReadPos = pos;
while (TRUE) { while (TRUE) {
switch (*pos++) { switch (*pos++) {
case ITEM_SCRIPT_OP_End:
break;
case ITEM_SCRIPT_OP_Restart: case ITEM_SCRIPT_OP_Restart:
case ITEM_SCRIPT_OP_Loop: case ITEM_SCRIPT_OP_Loop:
break; default:
continue;
case ITEM_SCRIPT_OP_RandomRestart: case ITEM_SCRIPT_OP_RandomRestart:
pos += 2; pos += 2;
break; continue;
case ITEM_SCRIPT_OP_SetImage: case ITEM_SCRIPT_OP_SetImage:
pos++; pos++;
raster = *pos++; raster = *pos++;
palette = *pos++; palette = *pos++;
if (item->flags & ITEM_ENTITY_FLAG_40000) {
capacity = 0x200; // 32x32 or 24x24 (divided by 2 because these are ci4 iamges)
} else { size = (item->flags & ITEM_ENTITY_FLAG_40000) ? (32 * 32 / 2) : (24 * 24 / 2);
capacity = 0x120;
}
entry = gHudElementCacheTableRaster; entry = gHudElementCacheTableRaster;
i = 0; i = 0;
@ -807,11 +802,9 @@ void item_entity_load(ItemEntity* item) {
entry->id = raster; entry->id = raster;
entry->data = &gHudElementCacheBuffer[*gHudElementCacheSize]; entry->data = &gHudElementCacheBuffer[*gHudElementCacheSize];
ASSERT(*gHudElementCacheSize + capacity < 0x11000); ASSERT(*gHudElementCacheSize + size < 0x11000);
do { nuPiReadRom((s32)icon_present_ROM_START + raster, entry->data, size);
nuPiReadRom((s32)icon_present_ROM_START + raster, entry->data, capacity); *gHudElementCacheSize += size;
} while (0); // TODO required to match
*gHudElementCacheSize += capacity;
if (!gGameStatusPtr->isBattle) { if (!gGameStatusPtr->isBattle) {
*pos = i; *pos = i;
} else { } else {
@ -820,8 +813,8 @@ void item_entity_load(ItemEntity* item) {
pos++; pos++;
break; break;
} else { } else {
cond = entry->id == raster; cond = entry->id == raster; // TODO required to match
if (cond) { // TODO required to match if (cond) {
if (!gGameStatusPtr->isBattle) { if (!gGameStatusPtr->isBattle) {
*pos = i; *pos = i;
} else { } else {
@ -864,16 +857,12 @@ void item_entity_load(ItemEntity* item) {
entry++; entry++;
i++; i++;
} }
break; continue;
case ITEM_SCRIPT_OP_End:
item_entity_update(item);
return;
} }
break;
} }
item_entity_update(item);
} }
#else
INCLUDE_ASM(s32, "C50A0", item_entity_load);
#endif
s32 make_item_entity(s32 itemID, f32 x, f32 y, f32 z, s32 itemSpawnMode, s32 pickupDelay, s32 facingAngleSign, s32 pickupFlagIndex) { s32 make_item_entity(s32 itemID, f32 x, f32 y, f32 z, s32 itemSpawnMode, s32 pickupDelay, s32 facingAngleSign, s32 pickupFlagIndex) {
s32 i; s32 i;

View File

@ -11,8 +11,9 @@
extern Addr MapTextureMemory; extern Addr MapTextureMemory;
#ifdef SHIFT #ifdef SHIFT
extern Addr WorldEntityHeapBottom;
extern Addr WorldEntityHeapBase; extern Addr WorldEntityHeapBase;
#define WORLD_ENTITY_HEAP_BOTTOM 0x80650000 // TODO shiftability (used only for munchlesia, hacky as hell) #define WORLD_ENTITY_HEAP_BOTTOM (s32) WorldEntityHeapBottom
#define WORLD_ENTITY_HEAP_BASE (s32) WorldEntityHeapBase #define WORLD_ENTITY_HEAP_BASE (s32) WorldEntityHeapBase
// TODO this only refers to one of 3 overlays which happen to share the same address space // TODO this only refers to one of 3 overlays which happen to share the same address space
// but don't necessarily have to // but don't necessarily have to
@ -1890,7 +1891,7 @@ void clear_entity_data(s32 arg0) {
gEntityHeapBottom = WORLD_ENTITY_HEAP_BOTTOM; gEntityHeapBottom = WORLD_ENTITY_HEAP_BOTTOM;
gEntityHeapBase = WORLD_ENTITY_HEAP_BASE; gEntityHeapBase = WORLD_ENTITY_HEAP_BASE;
} else { } else {
gEntityHeapBottom = (s32)BattleEntityHeapBottom; gEntityHeapBottom = (s32) BattleEntityHeapBottom;
gEntityHeapBase = gEntityHeapBottom + 0x3000; gEntityHeapBase = gEntityHeapBottom + 0x3000;
} }
@ -1917,7 +1918,7 @@ void init_entity_data(void) {
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
bEntityBlueprint[i] = 0; bEntityBlueprint[i] = 0;
} }
gEntityHeapBottom = (s32)BattleEntityHeapBottom; gEntityHeapBottom = (s32) BattleEntityHeapBottom;
gEntityHeapBase = gEntityHeapBottom + 0x3000; gEntityHeapBase = gEntityHeapBottom + 0x3000;
} }
gCurrentEntityListPtr = get_entity_list(); gCurrentEntityListPtr = get_entity_list();
@ -3650,6 +3651,8 @@ void appendGfx_model(void* data) {
} }
void func_80114B58(u32 romOffset, TextureHandle* handle, TextureHeader* header, s32 mainSize, s32 mainPalSize, s32 auxSize, s32 auxPalSize) { void func_80114B58(u32 romOffset, TextureHandle* handle, TextureHeader* header, s32 mainSize, s32 mainPalSize, s32 auxSize, s32 auxPalSize) {
Gfx** temp;
handle->raster = (IMG_PTR) mdl_nextTextureAddress; handle->raster = (IMG_PTR) mdl_nextTextureAddress;
if (mainPalSize != 0) { if (mainPalSize != 0) {
handle->palette = (PAL_PTR) (mdl_nextTextureAddress + mainSize); handle->palette = (PAL_PTR) (mdl_nextTextureAddress + mainSize);
@ -3677,12 +3680,8 @@ void func_80114B58(u32 romOffset, TextureHandle* handle, TextureHeader* header,
memcpy(&handle->header, header, sizeof(*header)); memcpy(&handle->header, header, sizeof(*header));
func_801180E8(header, (Gfx**)&mdl_nextTextureAddress, handle->raster, handle->palette, handle->auxRaster, handle->auxPalette, 0, 0, 0, 0); func_801180E8(header, (Gfx**)&mdl_nextTextureAddress, handle->raster, handle->palette, handle->auxRaster, handle->auxPalette, 0, 0, 0, 0);
#ifndef OLD_GCC temp = (Gfx**) &mdl_nextTextureAddress;
gSPEndDisplayList(mdl_nextTextureAddress); gSPEndDisplayList((*temp)++);
mdl_nextTextureAddress += 8;
#else
gSPEndDisplayList(((Gfx*)mdl_nextTextureAddress)++);
#endif
} }
void load_tile_header(ModelNodeProperty* propertyName, s32 romOffset, s32 size) { void load_tile_header(ModelNodeProperty* propertyName, s32 romOffset, s32 size) {

View File

@ -1061,7 +1061,7 @@ void func_8013C048(FoldState* state) {
} }
FoldGfxDescriptor* fold_load_gfx(FoldState* state) { FoldGfxDescriptor* fold_load_gfx(FoldState* state) {
u8* romStart = fold_groupOffsets[state->unk_1C[0][0]] + _24B7F0_ROM_START; u8* romStart = fold_groupOffsets[state->unk_1C[0][0]] + fold_gfx_data_ROM_START;
FoldGfxDescriptor* descriptor = &fold_groupDescriptors[state->arrayIdx]; FoldGfxDescriptor* descriptor = &fold_groupDescriptors[state->arrayIdx];
if (state->unk_64 != romStart) { if (state->unk_64 != romStart) {
@ -1095,7 +1095,7 @@ FoldGfxDescriptor* fold_load_gfx(FoldState* state) {
state->gfxBufs[0] = heap_malloc(descriptor->gfxCount * 8); state->gfxBufs[0] = heap_malloc(descriptor->gfxCount * 8);
state->gfxBufs[1] = heap_malloc(descriptor->gfxCount * 8); state->gfxBufs[1] = heap_malloc(descriptor->gfxCount * 8);
romStart = (s32)descriptor->gfx + _24B7F0_ROM_START; romStart = (s32)descriptor->gfx + fold_gfx_data_ROM_START;
romEnd = &romStart[descriptor->gfxCount * sizeof(*descriptor->gfx)]; romEnd = &romStart[descriptor->gfxCount * sizeof(*descriptor->gfx)];
dma_copy(romStart, romEnd, state->gfxBufs[0]); dma_copy(romStart, romEnd, state->gfxBufs[0]);
dma_copy(romStart, romEnd, state->gfxBufs[1]); dma_copy(romStart, romEnd, state->gfxBufs[1]);
@ -1173,11 +1173,11 @@ void func_8013C3F0(FoldState* state) {
} }
currentAnimState = heap_malloc(descriptor->vtxCount * sizeof(*currentAnimState)); currentAnimState = heap_malloc(descriptor->vtxCount * sizeof(*currentAnimState));
romStart = (u8*)((s32)_24B7F0_ROM_START + (s32)descriptor->vtx + currentStateIdx * descriptor->vtxCount * sizeof(*currentAnimState)); romStart = (u8*)((s32)fold_gfx_data_ROM_START + (s32)descriptor->vtx + currentStateIdx * descriptor->vtxCount * sizeof(*currentAnimState));
dma_copy(romStart, romStart + descriptor->vtxCount * sizeof(*currentAnimState), currentAnimState); dma_copy(romStart, romStart + descriptor->vtxCount * sizeof(*currentAnimState), currentAnimState);
if (animationPeriod >= 2) { if (animationPeriod >= 2) {
nextAnimState = heap_malloc(descriptor->vtxCount * sizeof(*nextAnimState)); nextAnimState = heap_malloc(descriptor->vtxCount * sizeof(*nextAnimState));
romStart = (u8*)((s32)_24B7F0_ROM_START + (s32)descriptor->vtx + nextStateIdx * descriptor->vtxCount * sizeof(*currentAnimState)); romStart = (u8*)((s32)fold_gfx_data_ROM_START + (s32)descriptor->vtx + nextStateIdx * descriptor->vtxCount * sizeof(*currentAnimState));
dma_copy(romStart, romStart + descriptor->vtxCount * sizeof(*nextAnimState), nextAnimState); dma_copy(romStart, romStart + descriptor->vtxCount * sizeof(*nextAnimState), nextAnimState);
} }

View File

@ -279,7 +279,7 @@ void appendGfx_shading_palette(
{ {
Camera* camera = &gCameras[gCurrentCameraID]; Camera* camera = &gCameras[gCurrentCameraID];
f32 temp_f0; f32 temp_f0;
f32 asdasdasd; f32 temp_f1;
f32 temp_f2; f32 temp_f2;
f32 var_f26; f32 var_f26;
f32 temp_f28 = 0; f32 temp_f28 = 0;
@ -288,12 +288,12 @@ void appendGfx_shading_palette(
f32 var_f12; f32 var_f12;
f32 var_f12_2; f32 var_f12_2;
f32 var_f20; f32 var_f20;
f32 var_f2;
f32 var_f30; f32 var_f30;
f32 var_f8;
f32 abc; f32 abc;
f32 ex, ey, ez; f32 ex, ey, ez;
f32 t1; f32 s1, s2, s3;
f32 new_var;
var_f12 = (shadowX * shadowX) + (shadowY * shadowY) + (shadowZ * shadowZ); var_f12 = (shadowX * shadowX) + (shadowY * shadowY) + (shadowZ * shadowZ);
@ -323,27 +323,34 @@ void appendGfx_shading_palette(
ez = mtx[2][2]; ez = mtx[2][2];
} }
temp_f6 = ex * shadowX; s1 = ex * shadowX;
temp_f6_2 = (shadowX * -camera->perspectiveMatrix[2][2]) + (shadowZ * camera->perspectiveMatrix[0][2]);
t1 = temp_f6 + (ey * shadowY) + (ez * shadowZ); new_var = (s1 + (ey * shadowY)) + (ez * shadowZ);
if (t1 > 0.0f) { ex = camera->perspectiveMatrix[2][2];
//temp_f6_2 = (shadowX * (-ex)) + (shadowZ * camera->perspectiveMatrix[0][2]);
temp_f2 = -ex;
temp_f1 = shadowX;
temp_f6_2 = (temp_f1 * temp_f2) + (shadowZ * camera->perspectiveMatrix[0][2]);
if (new_var > 0.0f) {
var_f26 = ambientPower * temp_f6_2; var_f26 = ambientPower * temp_f6_2;
} else { } else {
var_f26 = ambientPower; var_f26 = ambientPower;
var_f26 = ambientPower * temp_f6_2; var_f26 = var_f26 * temp_f6_2;
} }
var_f20 = SQ(shadowX) + SQ(shadowZ); var_f20 = SQ(temp_f1) + SQ(shadowZ);
if (var_f20 != 0.0f) { if (var_f20 != 0.0f) {
var_f20 = sqrtf(var_f20); var_f20 = sqrtf(var_f20);
} }
temp_f0 = -mtx[0][1]; temp_f0 = -mtx[0][1];
asdasdasd = mtx[1][1]; temp_f1 = mtx[1][1];
temp_f2 = mtx[2][1]; temp_f2 = mtx[2][1];
var_f12_2 = SQ(temp_f0) + SQ(temp_f2); var_f12_2 = SQ(temp_f0) + SQ(temp_f2);
if (var_f12_2 != 0.0f) { if (var_f12_2 != 0.0f) {
var_f12_2 = sqrtf(var_f12_2); var_f12_2 = sqrtf(var_f12_2);
} }
temp_f28 = -((var_f20 * var_f12_2) + (shadowY * asdasdasd)) * ambientPower; temp_f28 = -((var_f20 * var_f12_2) + (shadowY * temp_f1)) * ambientPower;
if (shadowR > 255) { if (shadowR > 255) {
shadowR = 255; shadowR = 255;
} }

View File

@ -106,9 +106,9 @@ EffectInstance* something_rotating_main(
} else { } else {
part->unk_10 = arg5; part->unk_10 = arg5;
} }
part->unk_04 = arg1; part->pos.x = arg1;
part->unk_08 = arg2; part->pos.y = arg2;
part->unk_0C = arg3; part->pos.z = arg3;
part->unk_18 = arg4; part->unk_18 = arg4;
part->unk_1C = 30.0f; part->unk_1C = 30.0f;
part->unk_20 = 0; part->unk_20 = 0;
@ -135,9 +135,9 @@ void something_rotating_init(EffectInstance* effect) {
void something_rotating_update(EffectInstance* effect) { void something_rotating_update(EffectInstance* effect) {
SomethingRotatingFXData* part = effect->data.somethingRotating; SomethingRotatingFXData* part = effect->data.somethingRotating;
f32 unk_04 = part->unk_04; f32 x = part->pos.x;
f32 unk_08 = part->unk_08; f32 y = part->pos.y;
f32 unk_0C = part->unk_0C; f32 z = part->pos.z;
s32 unk_14; s32 unk_14;
s32 unk_14_2; s32 unk_14_2;
f32 factor; f32 factor;
@ -170,9 +170,9 @@ void something_rotating_update(EffectInstance* effect) {
f32 temp_f24 = shim_sin_deg(angle2); f32 temp_f24 = shim_sin_deg(angle2);
f32 temp_f22 = part->unk_2C; f32 temp_f22 = part->unk_2C;
part->unk_04 = unk_04 + temp_f22 * shim_sin_deg(angle1) * temp_f24; part->pos.x = x + temp_f22 * shim_sin_deg(angle1) * temp_f24;
part->unk_08 = unk_08 + temp_f22 * shim_cos_deg(angle2); part->pos.y = y + temp_f22 * shim_cos_deg(angle2);
part->unk_0C = unk_0C + temp_f22 * shim_cos_deg(angle1) * temp_f24; part->pos.z = z + temp_f22 * shim_cos_deg(angle1) * temp_f24;
switch (part->state) { switch (part->state) {
case 1: case 1:
@ -264,9 +264,9 @@ void func_E01166E8(s32 arg0, SomethingRotatingFXData* part) {
} }
shim_guPositionF(sp20, 0.0f, part->unk_20 - temp, 0.0f, part->unk_18, shim_guPositionF(sp20, 0.0f, part->unk_20 - temp, 0.0f, part->unk_18,
part->unk_04 + 2.0f, part->pos.x + 2.0f,
part->unk_08, part->pos.y,
part->unk_0C + 2.0f part->pos.z + 2.0f
); );
shim_guRotateF(sp60, part->unk_1C, 0.0f, 0.0f, 1.0f); shim_guRotateF(sp60, part->unk_1C, 0.0f, 0.0f, 1.0f);
shim_guMtxCatF(sp60, sp20, sp20); shim_guMtxCatF(sp60, sp20, sp20);

View File

@ -18,19 +18,24 @@ ApiStatus SetEncounterStatusFlags(Evt* script, s32 isInitialCall) {
} }
ApiStatus IsStartingConversation(Evt* script, s32 isInitialCall) { ApiStatus IsStartingConversation(Evt* script, s32 isInitialCall) {
Bytecode arg1 = *script->ptrReadPos; Bytecode* args = script->ptrReadPos;
s32 outVar = *args++;
evt_set_variable(script, arg1, is_starting_conversation()); evt_set_variable(script, outVar, is_starting_conversation());
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
ApiStatus func_80044238(Evt* script, s32 isInitialCall) { ApiStatus func_80044238(Evt* script, s32 isInitialCall) {
func_80072BCC(evt_get_variable(script, *script->ptrReadPos)); Bytecode* args = script->ptrReadPos;
func_80072BCC(evt_get_variable(script, *args++));
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
ApiStatus LoadDemoBattle(Evt* script, s32 isInitialCall) { ApiStatus LoadDemoBattle(Evt* script, s32 isInitialCall) {
load_demo_battle(evt_get_variable(script, *script->ptrReadPos)); Bytecode* args = script->ptrReadPos;
load_demo_battle(evt_get_variable(script, *args++));
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
@ -144,22 +149,30 @@ ApiStatus RemoveEncounter(Evt* script, s32 isInitialCall) {
} }
ApiStatus GetBattleOutcome(Evt* script, s32 isInitialCall) { ApiStatus GetBattleOutcome(Evt* script, s32 isInitialCall) {
evt_set_variable(script, *script->ptrReadPos, gCurrentEncounter.battleOutcome); Bytecode* args = script->ptrReadPos;
evt_set_variable(script, *args++, gCurrentEncounter.battleOutcome);
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
ApiStatus func_800445A8(Evt* script, s32 isInitialCall) { ApiStatus func_800445A8(Evt* script, s32 isInitialCall) {
evt_set_variable(script, *script->ptrReadPos, script->owner1.enemy->unk_C4); Bytecode* args = script->ptrReadPos;
evt_set_variable(script, *args++, script->owner1.enemy->unk_C4);
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
ApiStatus func_800445D4(Evt* script, s32 isInitialCall) { ApiStatus func_800445D4(Evt* script, s32 isInitialCall) {
evt_set_variable(script, *script->ptrReadPos, script->owner1.enemy->unk_C8); Bytecode* args = script->ptrReadPos;
evt_set_variable(script, *args++, script->owner1.enemy->unk_C8);
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
ApiStatus GetOwnerEncounterTrigger(Evt* script, s32 isInitialCall) { ApiStatus GetOwnerEncounterTrigger(Evt* script, s32 isInitialCall) {
evt_set_variable(script, *script->ptrReadPos, script->owner1.enemy->encountered); Bytecode* args = script->ptrReadPos;
evt_set_variable(script, *args++, script->owner1.enemy->encountered);
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
@ -243,14 +256,17 @@ ApiStatus StartBattle(Evt* script, s32 isInitialCall) {
} }
ApiStatus StartBattleWith(Evt* script, s32 isInitialCall) { ApiStatus StartBattleWith(Evt* script, s32 isInitialCall) {
start_battle(script, evt_get_variable(script, *script->ptrReadPos)); Bytecode* args = script->ptrReadPos;
start_battle(script, evt_get_variable(script, *args++));
return ApiStatus_DONE1; return ApiStatus_DONE1;
} }
ApiStatus StartBossBattle(Evt* script, s32 isInitialCall) { ApiStatus StartBossBattle(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
EncounterStatus* currentEncounter = &gCurrentEncounter; EncounterStatus* currentEncounter = &gCurrentEncounter;
Enemy* enemy = script->owner1.enemy; Enemy* enemy = script->owner1.enemy;
s32 songID = evt_get_variable(script, *script->ptrReadPos); s32 songID = evt_get_variable(script, *args++);
Encounter* encounter; Encounter* encounter;
s32 i; s32 i;
@ -306,7 +322,8 @@ ApiStatus StartBossBattle(Evt* script, s32 isInitialCall) {
} }
ApiStatus SetBattleMusic(Evt* script, s32 isInitialCall) { ApiStatus SetBattleMusic(Evt* script, s32 isInitialCall) {
Bytecode songID = evt_get_variable(script, *script->ptrReadPos); Bytecode* args = script->ptrReadPos;
Bytecode songID = evt_get_variable(script, *args++);
EncounterStatus* currentEncounter = &gCurrentEncounter; EncounterStatus* currentEncounter = &gCurrentEncounter;
currentEncounter->allowFleeing = TRUE; currentEncounter->allowFleeing = TRUE;
@ -689,7 +706,8 @@ ApiStatus SetSelfRotation(Evt* script, s32 isInitialCall) {
} }
ApiStatus SetSelfEnemyFlags(Evt* script, s32 isInitialCall) { ApiStatus SetSelfEnemyFlags(Evt* script, s32 isInitialCall) {
script->owner1.enemy->flags = *script->ptrReadPos; Bytecode* args = script->ptrReadPos;
script->owner1.enemy->flags = *args++;
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
@ -698,7 +716,7 @@ ApiStatus SetSelfEnemyFlagBits(Evt* script, s32 isInitialCall) {
Enemy* owner = script->owner1.enemy; Enemy* owner = script->owner1.enemy;
s32 bits = *args++; s32 bits = *args++;
s32 mode = evt_get_variable(script, *args++); s32 mode = evt_get_variable(script, *args++);
if (mode) { if (mode) {
owner->flags |= bits; owner->flags |= bits;
} else { } else {
@ -769,20 +787,24 @@ ApiStatus func_8004572C(Evt* script, s32 isInitialCall) {
ApiStatus GetSelfAnimationFromTable(Evt* script, s32 isInitialCall) { ApiStatus GetSelfAnimationFromTable(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos; Bytecode* args = script->ptrReadPos;
Enemy* owner = script->owner1.enemy; Enemy* owner = script->owner1.enemy;
s32 animIdx = evt_get_variable(script, *args++);
evt_set_variable(script, *args++, owner->animList[evt_get_variable(script, *args++)]); evt_set_variable(script, *args++, owner->animList[animIdx]);
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
ApiStatus func_80045798(Evt* script, s32 isInitialCall) { ApiStatus func_80045798(Evt* script, s32 isInitialCall) {
gPartnerActionStatus.unk_358 = evt_get_variable(script, *script->ptrReadPos); Bytecode* args = script->ptrReadPos;
gPartnerActionStatus.unk_358 = evt_get_variable(script, *args++);
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
ApiStatus SetOwnerInstigatorValue(Evt* script, s32 isInitialCall) { ApiStatus SetOwnerInstigatorValue(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
Enemy* enemy = script->owner1.enemy; Enemy* enemy = script->owner1.enemy;
enemy->instigatorValue = evt_get_variable(script, *script->ptrReadPos); enemy->instigatorValue = evt_get_variable(script, *args++);
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
@ -792,7 +814,9 @@ ApiStatus SetBattleAsScripted(Evt* script, s32 isInitialCall) {
} }
ApiStatus GetEncounterTriggerHitTier(Evt* script, s32 isInitialCall) { ApiStatus GetEncounterTriggerHitTier(Evt* script, s32 isInitialCall) {
evt_set_variable(script, *script->ptrReadPos, gCurrentEncounter.hitTier); Bytecode* args = script->ptrReadPos;
evt_set_variable(script, *args++, gCurrentEncounter.hitTier);
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
@ -812,7 +836,9 @@ ApiStatus func_80045838(Evt* script, s32 isInitialCall) {
} }
ApiStatus func_800458CC(Evt* script, s32 isInitialCall) { ApiStatus func_800458CC(Evt* script, s32 isInitialCall) {
evt_set_variable(script, *script->ptrReadPos, script->owner1.enemy->npcSettings->actionFlags & AI_ACTION_08); Bytecode* args = script->ptrReadPos;
evt_set_variable(script, *args++, script->owner1.enemy->npcSettings->actionFlags & AI_ACTION_08);
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }

View File

@ -615,22 +615,19 @@ void update_scripts(void) {
} }
} }
// this function is evil // Does nothing, is cursed
#ifdef NON_MATCHING
void func_802C3EE4(void) { void func_802C3EE4(void) {
s32 temp;
s32 i; s32 i;
for (i = 0; i < gScriptListCount; i++) { for (i = 0; i < gScriptListCount; i++) {
do { temp = (s32) (*gCurrentScriptListPtr)[gScriptIndexList[i]];
if ((*gCurrentScriptListPtr)[gScriptIndexList[i]] == gScriptIdList[i]) { temp = *((s32*) temp);
(*gCurrentScriptListPtr)[gScriptIndexList[i]] = gScriptIdList[i]; if (temp == gScriptIdList[i]) {
} temp = 1;
} while (0); }
} }
} }
#else
INCLUDE_ASM(s32, "evt/script_list", func_802C3EE4);
#endif
void kill_script(Evt* instanceToKill) { void kill_script(Evt* instanceToKill) {
Evt* childScript; Evt* childScript;

View File

@ -1,4 +1,7 @@
#include "common.h" #include "common.h"
#ifdef SHIFT
BSS u8 WorldEntityHeapBottom[WORLD_ENTITY_HEAP_SIZE];
#endif
BSS u8 WorldEntityHeapBase[0x10]; BSS u8 WorldEntityHeapBase[0x10];
BSS u8 heap_collisionHead[COLLISION_HEAP_SIZE]; BSS u8 heap_collisionHead[COLLISION_HEAP_SIZE];

View File

@ -788,6 +788,42 @@ BSS f32 N(HoldStarRodCamX);
BSS f32 N(HoldStarRodCamY); BSS f32 N(HoldStarRodCamY);
BSS f32 N(HoldStarRodCamZ); BSS f32 N(HoldStarRodCamZ);
BSS f32 N(FlyToBowserStartX);
BSS f32 N(FlyToBowserStartZ);
BSS f32 N(D_8024F2FC);
BSS f32 N(D_8024F300);
BSS f32 N(D_8024F304);
BSS f32 N(D_8024F308);
BSS f32 N(D_8024F30C);
BSS f32 N(D_8024F310);
BSS char N(D_8024F314)[0x4];
BSS f32 N(StarSpiritsPosX)[7];
BSS char N(D_8024F334)[0x4];
BSS f32 N(StarSpiritsPosY)[7];
BSS char N(D_8024F354)[0x4];
BSS f32 N(StarSpiritsPosZ)[7];
BSS f32 N(AnimBowser_FlyOff_InitialY);
BSS f32 N(AnimKammy_FlyOff_InitialY);
BSS char N(D_8024F37C)[0x4];
BSS s32 N(D_8024F380);
BSS char N(D_8024F384)[0x74];
typedef struct UnkHos05Struct {
/* 0x00 */ Vec3f unk_00;
/* 0x0C */ Vec3f unk_0C;
/* 0x18 */ Vec3f unk_18;
/* 0x24 */ f32 unk_24;
} UnkHos05Struct; // size = 0x28
BSS UnkHos05Struct N(D_8024F3F8)[7];
BSS StoryGraphicData N(StoryGraphics);
API_CALLABLE(N(CamPullBack_BowserHoldingStarRod)) { API_CALLABLE(N(CamPullBack_BowserHoldingStarRod)) {
Camera* camera = &gCameras[gCurrentCameraID]; Camera* camera = &gCameras[gCurrentCameraID];
@ -863,182 +899,166 @@ API_CALLABLE(N(CamMove_OrbitKammy)) {
} }
} }
// lotta work to do // float regalloc stuff
#ifdef WIP #ifdef WIP
API_CALLABLE(func_802428C8_A2CB08) { ApiStatus func_802428C8_A2CB08(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos; Bytecode* args = script->ptrReadPos;
s32 temp_s6 = evt_get_variable(script, *args++); s32 temp_s6 = evt_get_variable(script, *args++);
f32 sp10 = evt_get_float_variable(script, *args++); f32 sp10;
f32 temp_f28 = evt_get_float_variable(script, *args++); f32 temp_f28;
EffectInstance* effect = evt_get_variable(script, ArrayVar(0)); EffectInstance* temp_a0;
f32 temp_f20; f32 xPos, yPos, zPos;
f32 temp_f20_2;
f32 temp_f20_3;
f32 temp_f20_4;
f32 temp_f24; f32 temp_f24;
f32 temp_f24_2; EffectInstance* effect;
f32 var_f0_2; UnkHos05Struct* unkData;
f32 var_f0_3; Vec3f* vec01; // vectors 0, 1
f32 var_f20_2; Vec3f* vec2; // vector 2
f32 var_f26; f32 angle;
f32 var_f2_2; s32 s4;
f64 var_f20; s32 s5;
f64 var_f2;
f64 var_f2_3;
f64 var_f2_4;
f64 var_f2_5;
f64 var_f2_6;
f64 var_f2_7;
f64 var_f2_8;
s32 temp_v0;
s32 temp_v0_2;
s32 temp_v0_3;
s32 temp_v0_4;
s32 temp_v0_5;
s32 temp_v0_6;
s32 temp_v0_7;
f32* temp_s1_2;
f32* temp_s2; sp10 = evt_get_float_variable(script, *args++);
f32* var_s0; temp_f28 = evt_get_float_variable(script, *args++);
f32* var_s2; temp_a0 = evt_get_variable(script, ArrayVar(0));
effect = temp_a0;
switch (temp_s6) { switch (temp_s6) {
case 1: case 1:
var_s0 = N(D_8024F3F8); unkData = &N(D_8024F3F8)[0];
var_s2 = N(D_8024F3F8); vec01 = &unkData->unk_00;
temp_v0 = effect->data.somethingRotating->unk_14 + 30; s5 = 30;
var_f2 = temp_v0; s4 = 3;
if (temp_v0 < 0) { angle = 90.0f;
var_f2 += 4294967296.0; yPos = (u32) (effect->data.somethingRotating->unk_14 + 30);
} yPos = yPos * 4.0f;
var_f20 = var_f2 * 4.0f; temp_f24 = sin_deg(yPos + 51.43);
temp_f20 = var_f20 + 51.43; xPos = effect->data.somethingRotating->pos.x + (sin_deg(angle) * 50.0f * temp_f24);
temp_f24 = sin_deg(temp_f20); yPos = effect->data.somethingRotating->pos.y + (cos_deg(yPos + 51.43) * 50.0f);
var_f26 = effect->data.somethingRotating->unk_04 + (sin_deg(90.0f) * 50.0f * temp_f24); zPos = effect->data.somethingRotating->pos.z + (sin_deg(angle) * 50.0f * temp_f24);
var_f20_2 = effect->data.somethingRotating->unk_08 + (cos_deg(temp_f20) * 50.0f); unkData->unk_18.x = xPos;
var_f0_2 = sin_deg(90.0f) * 50.0f * temp_f24; unkData->unk_18.y = yPos;
var_f2_2 = effect->data.somethingRotating->unk_0C; unkData->unk_18.z = zPos;
break; break;
case 2: case 2:
var_s0 = N(D_8024F420); unkData = &N(D_8024F3F8)[1];
var_s2 = N(D_8024F420); vec01 = &unkData->unk_00;
temp_v0_2 = effect->data.somethingRotating->unk_14 + 30; s5 = 30;
var_f2_3 = temp_v0_2; s4 = 3;
if (temp_v0_2 < 0) { angle = 90.0f;
var_f2_3 += 4294967296.0; yPos = (u32) (effect->data.somethingRotating->unk_14 + 30);
} yPos = yPos * 4.0f;
var_f20 = (var_f2_3 * 4.0f); temp_f24 = sin_deg(yPos + 360.01);
temp_f20 = var_f20 + 360.01; xPos = effect->data.somethingRotating->pos.x + (sin_deg(angle) * 50.0f * temp_f24);
temp_f24 = sin_deg(temp_f20); yPos = effect->data.somethingRotating->pos.y + (cos_deg(yPos + 360.01) * 50.0f);
var_f26 = effect->data.somethingRotating->unk_04 + (sin_deg(90.0f) * 50.0f * temp_f24); zPos = effect->data.somethingRotating->pos.z + (sin_deg(angle) * 50.0f * temp_f24);
var_f20_2 = effect->data.somethingRotating->unk_08 + (cos_deg(temp_f20) * 50.0f); unkData->unk_18.x = xPos;
var_f0_2 = sin_deg(90.0f) * 50.0f * temp_f24; unkData->unk_18.y = yPos;
var_f2_2 = effect->data.somethingRotating->unk_0C; unkData->unk_18.z = zPos;
break; break;
case 3: case 3:
var_s0 = N(D_8024F448); unkData = &N(D_8024F3F8)[2];
var_s2 = N(D_8024F448); vec01 = &unkData->unk_00;
temp_v0_3 = effect->data.somethingRotating->unk_14 + 30; s5 = 30;
var_f2_4 = temp_v0_3; s4 = 3;
if (temp_v0_3 < 0) { angle = 90.0f;
var_f2_4 += 4294967296.0; yPos = (u32) (effect->data.somethingRotating->unk_14 + 30);
} yPos = yPos * 4.0f;
var_f20 = var_f2_4 * 4.0f; temp_f24 = sin_deg(yPos + 154.29);
temp_f20 = var_f20 + 154.29; xPos = effect->data.somethingRotating->pos.x + (sin_deg(angle) * 50.0f * temp_f24);
temp_f24 = sin_deg(temp_f20); yPos = effect->data.somethingRotating->pos.y + (cos_deg(yPos + 154.29) * 50.0f);
var_f26 = effect->data.somethingRotating->unk_04 + (sin_deg(90.0f) * 50.0f * temp_f24); zPos = effect->data.somethingRotating->pos.z + (sin_deg(angle) * 50.0f * temp_f24);
var_f20_2 = effect->data.somethingRotating->unk_08 + (cos_deg(temp_f20) * 50.0f); unkData->unk_18.x = xPos;
var_f0_2 = sin_deg(90.0f) * 50.0f * temp_f24; unkData->unk_18.y = yPos;
var_f2_2 = effect->data.somethingRotating->unk_0C; unkData->unk_18.z = zPos;
break; break;
case 4: case 4:
var_s0 = N(D_8024F470); unkData = &N(D_8024F3F8)->unk_18;
temp_v0_4 = effect->data.somethingRotating->unk_14 + 30; vec01 = &unkData->unk_00;
var_f2_5 = temp_v0_4; s5 = 30;
var_s2 = N(D_8024F470); angle = 90.0f;
if (temp_v0_4 < 0) { yPos = (u32) (effect->data.somethingRotating->unk_14 + 30);
var_f2_5 += 4294967296.0; s4 = 3;
} yPos = yPos * 4.0f;
temp_f20_2 = (var_f2_5 * 4.0f) + 205.72; temp_f24 = sin_deg(yPos + 205.72);
temp_f24_2 = sin_deg(temp_f20_2); xPos = effect->data.somethingRotating->pos.x + (sin_deg(angle) * 50.0f * temp_f24);
var_f26 = effect->data.somethingRotating->unk_04 + (sin_deg(90.0f) * 50.0f * temp_f24_2); yPos = effect->data.somethingRotating->pos.y + (cos_deg(yPos + 205.72) * 50.0f);
var_f20_2 = effect->data.somethingRotating->unk_08 + (cos_deg(temp_f20_2) * 50.0f); zPos = effect->data.somethingRotating->pos.z + (sin_deg(angle) * 50.0f * temp_f24);
var_f0_2 = sin_deg(90.0f) * 50.0f * temp_f24_2; unkData->unk_18.x = xPos;
var_f2_2 = effect->data.somethingRotating->unk_0C; unkData->unk_18.y = yPos;
unkData->unk_18.z = zPos;
break; break;
case 5: case 5:
var_s0 = N(D_8024F498); unkData = &N(D_8024F3F8)[4];
var_s2 = N(D_8024F498); vec01 = &unkData->unk_00;
temp_v0_5 = effect->data.somethingRotating->unk_14 + 30; s5 = 30;
var_f2_6 = temp_v0_5; s4 = 3;
if (temp_v0_5 < 0) { angle = 90.0f;
var_f2_6 += 4294967296.0; yPos = (u32) (effect->data.somethingRotating->unk_14 + 30);
} yPos = yPos * 4.0f;
var_f20 = var_f2_6 * 4.0f; temp_f24 = sin_deg(yPos + 308.58);
temp_f20 = var_f20 + 308.58; xPos = effect->data.somethingRotating->pos.x + (sin_deg(angle) * 50.0f * temp_f24);
temp_f24 = sin_deg(temp_f20); yPos = effect->data.somethingRotating->pos.y + (cos_deg(yPos + 308.58) * 50.0f);
var_f26 = effect->data.somethingRotating->unk_04 + (sin_deg(90.0f) * 50.0f * temp_f24); zPos = effect->data.somethingRotating->pos.z + (sin_deg(angle) * 50.0f * temp_f24);
var_f20_2 = effect->data.somethingRotating->unk_08 + (cos_deg(temp_f20) * 50.0f); unkData->unk_18.x = xPos;
var_f0_2 = sin_deg(90.0f) * 50.0f * temp_f24; unkData->unk_18.y = yPos;
var_f2_2 = effect->data.somethingRotating->unk_0C; unkData->unk_18.z = zPos;
break; break;
case 6: case 6:
var_s0 = N(D_8024F4C0); unkData = &N(D_8024F3F8)[5];
var_s2 = N(D_8024F4C0); vec01 = &unkData->unk_00;
temp_v0_6 = effect->data.somethingRotating->unk_14 + 30; s5 = 30;
var_f2_7 = temp_v0_6; s4 = 3;
if (temp_v0_6 < 0) { angle = 90.0f;
var_f2_7 += 4294967296.0; yPos = (u32) (effect->data.somethingRotating->unk_14 + 30);
} yPos = yPos * 4.0f;
var_f20 = var_f2_7 * 4.0f; temp_f24 = sin_deg(yPos + 102.86);
temp_f20 = var_f20 + 102.86; xPos = effect->data.somethingRotating->pos.x + (sin_deg(angle) * 50.0f * temp_f24);
temp_f24 = sin_deg(temp_f20); yPos = effect->data.somethingRotating->pos.y + (cos_deg(yPos + 102.86) * 50.0f);
var_f26 = effect->data.somethingRotating->unk_04 + (sin_deg(90.0f) * 50.0f * temp_f24); zPos = effect->data.somethingRotating->pos.z + (sin_deg(angle) * 50.0f * temp_f24);
var_f20_2 = effect->data.somethingRotating->unk_08 + (cos_deg(temp_f20) * 50.0f); unkData->unk_18.x = xPos;
var_f0_2 = sin_deg(90.0f) * 50.0f * temp_f24; unkData->unk_18.y = yPos;
var_f2_2 = effect->data.somethingRotating->unk_0C; unkData->unk_18.z = zPos;
break; break;
default: default:
var_s0 = N(D_8024F4E8); unkData = &N(D_8024F3F8)[6];
var_s2 = N(D_8024F4E8); vec01 = &unkData->unk_00;
temp_v0_7 = effect->data.somethingRotating->unk_14 + 30; s5 = 30;
var_f2_8 = temp_v0_7; s4 = 3;
if (temp_v0_7 < 0) { angle = 90.0f;
var_f2_8 += 4294967296.0; yPos = (u32) (effect->data.somethingRotating->unk_14 + 30);
} yPos = yPos * 4.0f;
var_f20 = (var_f2_8 * 4.0f); temp_f24 = sin_deg(yPos + 257.15);
temp_f20 = var_f20 + 257.15; xPos = effect->data.somethingRotating->pos.x + (sin_deg(angle) * 50.0f * temp_f24);
temp_f24 = sin_deg(temp_f20); yPos = effect->data.somethingRotating->pos.y + (cos_deg(yPos + 257.15) * 50.0f);
var_f26 = effect->data.somethingRotating->unk_04 + (sin_deg(90.0f) * 50.0f * temp_f24); zPos = effect->data.somethingRotating->pos.z + (sin_deg(angle) * 50.0f * temp_f24);
var_f20_2 = effect->data.somethingRotating->unk_08 + (cos_deg(temp_f20) * 50.0f); unkData->unk_18.x = xPos;
var_f0_2 = sin_deg(90.0f) * 50.0f * temp_f24; unkData->unk_18.y = yPos;
var_f2_2 = effect->data.somethingRotating->unk_0C; unkData->unk_18.z = zPos;
break; break;
} }
var_s0[6] = var_f26;
var_s0[7] = var_f20_2; vec01->x = evt_get_float_variable(script, LocalVar(0));
var_s0[8] = var_f2_2 + var_f0_2; vec01->y = evt_get_float_variable(script, LocalVar(1));
var_s2[0] = evt_get_float_variable(script, LocalVar(0)); vec01->z = evt_get_float_variable(script, LocalVar(2));
var_s2[1] = evt_get_float_variable(script, LocalVar(1));
temp_s1_2 = var_s2 + 0x18; vec2 = &vec01[2];
var_s2[4] = evt_get_float_variable(script, LocalVar(2)); vec01++;
temp_s2 = var_s2 + 0xC;
if (temp_s6 != 2) { if (temp_s6 != 2) {
temp_f20_3 = 1.0f - temp_f28; vec01->x = (evt_get_float_variable(script, LocalVar(0)) * temp_f28) + (vec2->x * (1.0f - temp_f28));
temp_s2[0] = (evt_get_float_variable(script, LocalVar(0)) * temp_f28) + (temp_s1_2[0] * temp_f20_3); vec01->y = (evt_get_float_variable(script, LocalVar(1)) * temp_f28) + (vec2->y * (1.0f - temp_f28)) + sp10;
temp_s2[1] = (evt_get_float_variable(script, LocalVar(1)) * temp_f28) + (temp_s1_2[1] * temp_f20_3) + sp10; vec01->z = (evt_get_float_variable(script, LocalVar(2)) * temp_f28) + (vec2->z * (1.0f - temp_f28));
var_f0_3 = (evt_get_float_variable(script, LocalVar(2)) * temp_f28) + (temp_s1_2[2] * temp_f20_3);
} else { } else {
temp_f20_4 = 1.0f - temp_f28; vec01->x = ((evt_get_float_variable(script, LocalVar(0)) * temp_f28) + (vec2->x * (1.0f - temp_f28))) - 50.0f;
temp_s2[0] = ((evt_get_float_variable(script, LocalVar(0)) * temp_f28) + (temp_s1_2[0] * temp_f20_4)) - 50.0f; vec01->y = (evt_get_float_variable(script, LocalVar(1)) * temp_f28) + (vec2->y * (1.0f - temp_f28)) + sp10;
temp_s2[1] = (evt_get_float_variable(script, LocalVar(1)) * temp_f28) + (temp_s1_2[1] * temp_f20_4) + sp10; vec01->z = ((evt_get_float_variable(script, LocalVar(2)) * temp_f28) + (vec2->z * (1.0f - temp_f28))) - 50.0f;
var_f0_3 = ((evt_get_float_variable(script, LocalVar(2)) * temp_f28) + (temp_s1_2[2] * temp_f20_4)) - 50.0f;
} }
temp_s2[2] = var_f0_3; script->varTable[0] = s5;
script->varTable[0] = 30; script->varTablePtr[1] = unkData;
script->varTable[1] = var_s0; script->varTable[2] = s4;
script->varTable[2] = 3;
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
#else #else
@ -1249,9 +1269,6 @@ API_CALLABLE(N(CamPullBack_Final)) {
s32 N(FlyToBowserTime) = 0; s32 N(FlyToBowserTime) = 0;
BSS f32 N(FlyToBowserStartX);
BSS f32 N(FlyToBowserStartZ);
API_CALLABLE(N(KammyFlyToBowser)) { API_CALLABLE(N(KammyFlyToBowser)) {
Npc* kammy = resolve_npc(script, NPC_Kammy); Npc* kammy = resolve_npc(script, NPC_Kammy);
@ -1272,36 +1289,6 @@ API_CALLABLE(N(KammyFlyToBowser)) {
return ApiStatus_DONE1; return ApiStatus_DONE1;
} }
BSS f32 N(D_8024F2FC);
BSS f32 N(D_8024F300);
BSS f32 N(D_8024F304);
BSS f32 N(D_8024F308);
BSS f32 N(D_8024F30C);
BSS f32 N(D_8024F310);
BSS char N(D_8024F314)[0x4];
BSS f32 N(StarSpiritsPosX)[7];
BSS char N(D_8024F334)[0x4];
BSS f32 N(StarSpiritsPosY)[7];
BSS char N(D_8024F354)[0x4];
BSS f32 N(StarSpiritsPosZ)[7];
BSS f32 N(AnimBowser_FlyOff_InitialY);
BSS f32 N(AnimKammy_FlyOff_InitialY);
BSS char N(D_8024F37C)[0x4];
BSS s32 N(D_8024F380);
BSS char N(D_8024F384)[0x74];
BSS s32 N(D_8024F3F8)[10];
BSS s32 N(D_8024F420)[10];
BSS s32 N(D_8024F448)[10];
BSS s32 N(D_8024F470)[10];
BSS s32 N(D_8024F498)[10];
BSS s32 N(D_8024F4C0)[10];
BSS s32 N(D_8024F4E8)[10];
BSS StoryGraphicData N(StoryGraphics);
void N(appendGfx_image_strips)( void N(appendGfx_image_strips)(
s32 baseX, s32 baseY, s32 baseX, s32 baseY,
IMG_PTR img, PAL_PTR pal, IMG_PTR img, PAL_PTR pal,

View File

@ -6,7 +6,7 @@
extern u8 MessagePlural[]; extern u8 MessagePlural[];
extern u8 MessageSingular[]; extern u8 MessageSingular[];
extern HudScript* HES_Item_Coin; extern HudScript HES_Item_Coin;
API_CALLABLE(func_802803C8); API_CALLABLE(func_802803C8);
API_CALLABLE(func_80280410); API_CALLABLE(func_80280410);
@ -861,9 +861,6 @@ void draw_shop_items(void) {
} }
} }
// This should be equivalent to the original code but there is some funny business with
// the evt_get_variable's at the beginning that makes absolutely no sense.
#ifdef NON_MATCHING
API_CALLABLE(MakeShop) { API_CALLABLE(MakeShop) {
Bytecode* args = script->ptrReadPos; Bytecode* args = script->ptrReadPos;
ShopItemLocation* itemDataPositions; ShopItemLocation* itemDataPositions;
@ -876,14 +873,23 @@ API_CALLABLE(MakeShop) {
f32 centerX; f32 centerX;
f32 centerY; f32 centerY;
f32 centerZ; f32 centerZ;
s32 var1;
s32 var2;
s32 var3;
s32 var4;
f32 sizeX; f32 sizeX;
f32 sizeY; f32 sizeY;
f32 sizeZ; f32 sizeZ;
itemDataPositions = evt_get_variable(script, *args++); var1 = evt_get_variable(script, *args++);
inventory = evt_get_variable(script, *args++); var2 = evt_get_variable(script, *args++);
prices = evt_get_variable(script, *args++); var3 = evt_get_variable(script, *args++);
inventoryItemFlags = evt_get_variable(script, *args++); var4 = evt_get_variable(script, *args++);
itemDataPositions = (ShopItemLocation*) var1;
inventory = (ShopItemData*) var2;
prices = (ShopSellPriceData*) var3;
inventoryItemFlags = var4;
shop = heap_malloc(sizeof(*shop)); shop = heap_malloc(sizeof(*shop));
@ -894,7 +900,7 @@ API_CALLABLE(MakeShop) {
shop->inventoryItemFlags = inventoryItemFlags; shop->inventoryItemFlags = inventoryItemFlags;
numShopItems = 0; numShopItems = 0;
while (inventory->itemID != 0) { while (inventory->itemID != ITEM_NONE) {
numShopItems++; numShopItems++;
inventory++; inventory++;
} }
@ -902,7 +908,7 @@ API_CALLABLE(MakeShop) {
numShopItems = 0; numShopItems = 0;
if (prices != NULL) { if (prices != NULL) {
while (prices->itemID != 0) { while (prices->itemID != ITEM_NONE) {
numShopItems++; numShopItems++;
prices++; prices++;
} }
@ -926,9 +932,9 @@ API_CALLABLE(MakeShop) {
model->flags |= MODEL_FLAG_FLAG_4; model->flags |= MODEL_FLAG_FLAG_4;
gGameStatusPtr->shopItemEntities[numShopItems].index = gGameStatusPtr->shopItemEntities[numShopItems].index =
make_item_entity_nodelay(inventory->itemID | shop->inventoryItemFlags, centerX, centerY, centerZ, 1, 0); make_item_entity_nodelay(inventory->itemID | shop->inventoryItemFlags, centerX, centerY, centerZ, 1, 0);
set_item_entity_flags(gGameStatusPtr->shopItemEntities[numShopItems].index, 0x4000); set_item_entity_flags(gGameStatusPtr->shopItemEntities[numShopItems].index, ITEM_ENTITY_RESIZABLE);
bind_trigger_1(D_80283F58_7E4DD8, 0x80, itemDataPositions->triggerColliderID, numShopItems, 0, 3); bind_trigger_1(&D_80283F58_7E4DD8, TRIGGER_FLOOR_TOUCH, itemDataPositions->triggerColliderID, numShopItems, 0, 3);
bind_trigger_1(D_80283F58_7E4DD8, 0x800, itemDataPositions->triggerColliderID, numShopItems, 0, 3); bind_trigger_1(&D_80283F58_7E4DD8, TRIGGER_FLOOR_PRESS_A, itemDataPositions->triggerColliderID, numShopItems, 0, 3);
itemDataPositions++; itemDataPositions++;
inventory++; inventory++;
numShopItems++; numShopItems++;
@ -949,9 +955,6 @@ API_CALLABLE(MakeShop) {
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
#else
INCLUDE_ASM(ApiStatus, "world/script_api/shops", MakeShop, Evt* script, s32 isInitialCall);
#endif
API_CALLABLE(MakeShopOwner) { API_CALLABLE(MakeShopOwner) {
Shop* mapShop = gGameStatusPtr->mapShop; Shop* mapShop = gGameStatusPtr->mapShop;

View File

@ -1,6 +1,8 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
from typing import List, Dict, Set, Union import os
import shutil
from typing import TYPE_CHECKING, List, Dict, Set, Union
from pathlib import Path from pathlib import Path
import subprocess import subprocess
import sys import sys
@ -18,22 +20,14 @@ BUILD_TOOLS = TOOLS / "build"
YAY0_COMPRESS_TOOL = f"{BUILD_TOOLS}/yay0/Yay0compress" YAY0_COMPRESS_TOOL = f"{BUILD_TOOLS}/yay0/Yay0compress"
CRC_TOOL = f"{BUILD_TOOLS}/rom/n64crc" CRC_TOOL = f"{BUILD_TOOLS}/rom/n64crc"
def rm_recursive(path: Path): # if TYPE_CHECKING:
if path.exists(): # from
if path.is_dir():
for f in path.iterdir():
rm_recursive(f)
path.rmdir()
else:
path.unlink()
def exec_shell(command: List[str]) -> str: def exec_shell(command: List[str]) -> str:
ret = subprocess.run(command, stdout=subprocess.PIPE, text=True) ret = subprocess.run(command, stdout=subprocess.PIPE, text=True)
return ret.stdout return ret.stdout
def write_ninja_rules(ninja: ninja_syntax.Writer, cpp: str, cppflags: str, extra_cflags: str, use_ccache: bool, def write_ninja_rules(ninja: ninja_syntax.Writer, cpp: str, extra_cppflags: str, extra_cflags: str, use_ccache: bool, shift: bool, debug: bool):
non_matching: bool, shift: bool, debug: bool):
# platform-specific # platform-specific
if sys.platform == "darwin": if sys.platform == "darwin":
iconv = "tools/iconv.py UTF-8 $encoding" iconv = "tools/iconv.py UTF-8 $encoding"
@ -68,7 +62,7 @@ def write_ninja_rules(ninja: ninja_syntax.Writer, cpp: str, cppflags: str, extra
"-DVERSION=$version -DF3DEX_GBI_2 -D_MIPS_SZLONG=32 -nostdinc" "-DVERSION=$version -DF3DEX_GBI_2 -D_MIPS_SZLONG=32 -nostdinc"
cflags = f"-c -G0 -O2 -gdwarf-2 -x c -B {BUILD_TOOLS}/cc/gcc/ {extra_cflags}" cflags = f"-c -G0 -O2 -gdwarf-2 -x c -B {BUILD_TOOLS}/cc/gcc/ {extra_cflags}"
cflags_modern = f"-c -G0 -fno-builtin-bcopy -fno-tree-loop-distribute-patterns -funsigned-char -mabi=32 -mgp32 -mfp32 -mno-gpopt -mabi=32 -mfix4300 -fno-toplevel-reorder -mno-abicalls -fno-pic -fno-exceptions -fno-stack-protector -fno-zero-initialized-in-bss -O2 -march=vr4300 -Wno-builtin-declaration-mismatch -gdwarf-2 -x c {extra_cflags}" cflags_modern = f"-c -G0 -O2 -gdwarf-2 -fno-builtin-bcopy -fno-tree-loop-distribute-patterns -funsigned-char -mgp32 -mfp32 -mabi=32 -mfix4300 -march=vr4300 -mno-gpopt -fno-toplevel-reorder -mno-abicalls -fno-pic -fno-exceptions -fno-stack-protector -fno-zero-initialized-in-bss -Wno-builtin-declaration-mismatch -x c {extra_cflags}"
cflags_272 = f"-c -G0 -mgp32 -mfp32 -mips3 {extra_cflags}" cflags_272 = f"-c -G0 -mgp32 -mfp32 -mips3 {extra_cflags}"
cflags_272 = cflags_272.replace("-ggdb3","-g1") cflags_272 = cflags_272.replace("-ggdb3","-g1")
@ -77,6 +71,7 @@ def write_ninja_rules(ninja: ninja_syntax.Writer, cpp: str, cppflags: str, extra
ld_args = f"-T ver/$version/build/undefined_syms.txt -T ver/$version/undefined_syms_auto.txt -T ver/$version/undefined_funcs_auto.txt -Map $mapfile --no-check-sections -T $in -o $out" ld_args = f"-T ver/$version/build/undefined_syms.txt -T ver/$version/undefined_syms_auto.txt -T ver/$version/undefined_funcs_auto.txt -Map $mapfile --no-check-sections -T $in -o $out"
if shift: if shift:
# For the shiftable build, we link twice to resolve some addresses that gnu ld can't figure out all in one go.
ninja.rule("ld", ninja.rule("ld",
description="link($version) $out", description="link($version) $out",
command=f"{cross}ld $$(tools/build/ld/multilink_calc.py $version hardcode) {ld_args} && \ command=f"{cross}ld $$(tools/build/ld/multilink_calc.py $version hardcode) {ld_args} && \
@ -108,36 +103,36 @@ def write_ninja_rules(ninja: ninja_syntax.Writer, cpp: str, cppflags: str, extra
ninja.rule("cpp", ninja.rule("cpp",
description="cpp $in", description="cpp $in",
command=f"{cpp} $in {cppflags} -P -o $out" command=f"{cpp} $in {extra_cppflags} -P -o $out"
) )
ninja.rule("cc", ninja.rule("cc",
description="gcc $in", description="gcc $in",
command=f"bash -o pipefail -c '{cpp} {CPPFLAGS} {cppflags} $cppflags -MD -MF $out.d $in -o - | {iconv} | {ccache}{cc} {cflags} $cflags - -o $out'", command=f"bash -o pipefail -c '{cpp} {CPPFLAGS} {extra_cppflags} -DOLD_GCC $cppflags -MD -MF $out.d $in -o - | {iconv} | {ccache}{cc} {cflags} $cflags - -o $out'",
depfile="$out.d", depfile="$out.d",
deps="gcc", deps="gcc",
) )
ninja.rule("cc_modern", ninja.rule("cc_modern",
description="gcc $in", description="gcc $in",
command=f"bash -o pipefail -c '{cpp} {CPPFLAGS} {cppflags} $cppflags -MD -MF $out.d $in -o - | {iconv} | {ccache}{cc_modern} {cflags_modern} $cflags - -o $out'", command=f"bash -o pipefail -c '{cpp} {CPPFLAGS} {extra_cppflags} $cppflags -MD -MF $out.d $in -o - | {iconv} | {ccache}{cc_modern} {cflags_modern} $cflags - -o $out'",
depfile="$out.d", depfile="$out.d",
deps="gcc", deps="gcc",
) )
ninja.rule("cc_ido", ninja.rule("cc_ido",
description="ido $in", description="ido $in",
command=f"{ccache}{cc_ido} -w {CPPFLAGS_COMMON} {cppflags} $cppflags -c -mips1 -O0 -G0 -non_shared -Xfullwarn -Xcpluscomm -o $out $in", command=f"{ccache}{cc_ido} -w {CPPFLAGS_COMMON} {extra_cppflags} $cppflags -c -mips1 -O0 -G0 -non_shared -Xfullwarn -Xcpluscomm -o $out $in",
) )
ninja.rule("cc_272", ninja.rule("cc_272",
description="cc_272 $in", description="cc_272 $in",
command=f"bash -o pipefail -c 'COMPILER_PATH={cc_272_dir} {cc_272} {CPPFLAGS_272} {cppflags} $cppflags {cflags_272} $cflags $in -o $out && mips-linux-gnu-objcopy -N $in $out'", command=f"bash -o pipefail -c 'COMPILER_PATH={cc_272_dir} {cc_272} {CPPFLAGS_272} {extra_cppflags} $cppflags {cflags_272} $cflags $in -o $out && mips-linux-gnu-objcopy -N $in $out'",
) )
ninja.rule("cxx", ninja.rule("cxx",
description="cxx $in", description="cxx $in",
command=f"bash -o pipefail -c '{cpp} {CPPFLAGS} {cppflags} $cppflags -MD -MF $out.d $in -o - | {iconv} | {ccache}{cxx} {cflags} $cflags - -o $out'", command=f"bash -o pipefail -c '{cpp} {CPPFLAGS} {extra_cppflags} $cppflags -MD -MF $out.d $in -o - | {iconv} | {ccache}{cxx} {cflags} $cflags - -o $out'",
depfile="$out.d", depfile="$out.d",
deps="gcc", deps="gcc",
) )
@ -269,19 +264,19 @@ class Configure:
if code: if code:
modes.extend(["code", "c", "data", "rodata"]) modes.extend(["code", "c", "data", "rodata"])
splat_file = [str(self.version_path / "splat.yaml")] splat_files = [str(self.version_path / "splat.yaml")]
if debug: if debug:
splat_file += [str(self.version_path / "splat-debug.yaml")] splat_files += [str(self.version_path / "splat-debug.yaml")]
if shift: if shift:
splat_file += [str(self.version_path / "splat-shift.yaml")] splat_files += [str(self.version_path / "splat-shift.yaml")]
split.main( split.main(
splat_file, splat_files,
modes, modes,
verbose=False, verbose=False,
) )
self.linker_entries = split.linker_writer.entries[:] self.linker_entries = split.linker_writer.entries
self.asset_stack = split.config["asset_stack"] self.asset_stack = split.config["asset_stack"]
def build_path(self) -> Path: def build_path(self) -> Path:
@ -333,8 +328,7 @@ class Configure:
# ¯\_(ツ)_/¯ # ¯\_(ツ)_/¯
return path return path
def write_ninja(self, ninja: ninja_syntax.Writer, skip_outputs: Set[str], non_matching: bool, modern_gcc: bool, def write_ninja(self, ninja: ninja_syntax.Writer, skip_outputs: Set[str], non_matching: bool, modern_gcc: bool):
debug: bool):
import segtypes import segtypes
import segtypes.common.data import segtypes.common.data
import segtypes.n64.yay0 import segtypes.n64.yay0
@ -419,8 +413,7 @@ class Configure:
task = "cc_ido" task = "cc_ido"
elif "gcc_272" in cflags: elif "gcc_272" in cflags:
task = "cc_272" task = "cc_272"
cflags = cflags.replace("gcc_272", "")
cflags = cflags.replace("gcc_272", "")
encoding = "SHIFT-JIS" encoding = "SHIFT-JIS"
if version == "cn": if version == "cn":
@ -770,9 +763,8 @@ if __name__ == "__main__":
parser.add_argument("--no-split-assets", action="store_true", help="Don't split assets from the baserom(s)") parser.add_argument("--no-split-assets", action="store_true", help="Don't split assets from the baserom(s)")
parser.add_argument("-d", "--debug", action="store_true", help="Generate debugging information") parser.add_argument("-d", "--debug", action="store_true", help="Generate debugging information")
parser.add_argument("-n", "--non-matching", action="store_true", help="Compile nonmatching code. Combine with --debug for more detailed debug info") parser.add_argument("-n", "--non-matching", action="store_true", help="Compile nonmatching code. Combine with --debug for more detailed debug info")
parser.add_argument("--shift", action="store_true", help="Build a shiftable ROM") parser.add_argument("--shift", action="store_true", help="Build a shiftable version of the game (non-matching)")
parser.add_argument("--modern-gcc", action="store_true", help="Use modern GCC instead of the original compiler") parser.add_argument("--modern-gcc", action="store_true", help="Use modern GCC instead of the original compiler")
parser.add_argument("-w", "--no-warn", action="store_true", help="Inhibit compiler warnings")
parser.add_argument("--ccache", action="store_true", help="Use ccache") parser.add_argument("--ccache", action="store_true", help="Use ccache")
args = parser.parse_args() args = parser.parse_args()
@ -816,31 +808,27 @@ if __name__ == "__main__":
exec_shell(["ninja", "-t", "clean"]) exec_shell(["ninja", "-t", "clean"])
for version in versions: for version in versions:
rm_recursive(ROOT / f"assets/{version}") shutil.rmtree(ROOT / f"assets/{version}", ignore_errors=True)
rm_recursive(ROOT / f"ver/{version}/assets") shutil.rmtree(ROOT / f"ver/{version}/assets", ignore_errors=True)
rm_recursive(ROOT / f"ver/{version}/build") shutil.rmtree(ROOT / f"ver/{version}/build", ignore_errors=True)
rm_recursive(ROOT / f"ver/{version}/.splat_cache") os.remove(ROOT / f"ver/{version}/.splat_cache")
cflags = "" extra_cflags = ""
cppflags = "" extra_cppflags = ""
if args.non_matching: if args.non_matching:
cppflags += " -DNON_MATCHING" extra_cppflags += " -DNON_MATCHING"
if args.debug: if args.debug:
cflags += " -ggdb3" # we can generate more accurate debug info in non-matching mode extra_cflags += " -ggdb3" # we can generate more accurate debug info in non-matching mode
cppflags += " -DDEBUG" # e.g. affects ASSERT macro extra_cppflags += " -DDEBUG" # e.g. affects ASSERT macro
elif args.debug: elif args.debug:
# g1 doesn't affect codegen # g1 doesn't affect codegen
cflags += " -ggdb3" extra_cflags += " -ggdb3"
if args.shift: if args.shift:
cppflags += " -DSHIFT" extra_cppflags += " -DSHIFT"
if not args.modern_gcc: extra_cflags += " -Wmissing-braces -Wimplicit -Wredundant-decls -Wstrict-prototypes"
cppflags += " -DOLD_GCC"
if not args.no_warn:
cflags += " -Wmissing-braces -Wimplicit -Wredundant-decls -Wstrict-prototypes"
# add splat to python import path # add splat to python import path
sys.path.append(str((ROOT / args.splat).resolve())) sys.path.append(str((ROOT / args.splat).resolve()))
@ -849,7 +837,7 @@ if __name__ == "__main__":
non_matching = args.non_matching or args.modern_gcc or args.shift non_matching = args.non_matching or args.modern_gcc or args.shift
write_ninja_rules(ninja, args.cpp or "cpp", cppflags, cflags, args.ccache, args.non_matching, args.shift, args.debug) write_ninja_rules(ninja, args.cpp or "cpp", extra_cppflags, extra_cflags, args.ccache, args.shift, args.debug)
write_ninja_for_tools(ninja) write_ninja_for_tools(ninja)
skip_files = set() skip_files = set()
@ -865,7 +853,7 @@ if __name__ == "__main__":
first_configure = configure first_configure = configure
configure.split(not args.no_split_assets, args.split_code, args.shift, args.debug) configure.split(not args.no_split_assets, args.split_code, args.shift, args.debug)
configure.write_ninja(ninja, skip_files, non_matching, args.modern_gcc, args.debug) configure.write_ninja(ninja, skip_files, non_matching, args.modern_gcc)
all_rom_oks.append(str(configure.rom_ok_path())) all_rom_oks.append(str(configure.rom_ok_path()))

View File

@ -1,212 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.section .rodata
dlabel jtbl_80150A80
.word .L801313BC_C7ABC, .L801311B8_C78B8, .L80131188_C7888, .L80131188_C7888, .L801311B0_C78B0, 0
.section .text
glabel item_entity_load
/* C7828 80131128 27BDFFC8 */ addiu $sp, $sp, -0x38
/* C782C 8013112C AFBE0030 */ sw $fp, 0x30($sp)
/* C7830 80131130 0080F02D */ daddu $fp, $a0, $zero
/* C7834 80131134 AFB7002C */ sw $s7, 0x2c($sp)
/* C7838 80131138 2417FFFF */ addiu $s7, $zero, -1
/* C783C 8013113C AFB50024 */ sw $s5, 0x24($sp)
/* C7840 80131140 3C150001 */ lui $s5, 1
/* C7844 80131144 AFBF0034 */ sw $ra, 0x34($sp)
/* C7848 80131148 AFB60028 */ sw $s6, 0x28($sp)
/* C784C 8013114C AFB40020 */ sw $s4, 0x20($sp)
/* C7850 80131150 AFB3001C */ sw $s3, 0x1c($sp)
/* C7854 80131154 AFB20018 */ sw $s2, 0x18($sp)
/* C7858 80131158 AFB10014 */ sw $s1, 0x14($sp)
/* C785C 8013115C AFB00010 */ sw $s0, 0x10($sp)
/* C7860 80131160 87C20018 */ lh $v0, 0x18($fp)
/* C7864 80131164 36B50FFF */ ori $s5, $s5, 0xfff
/* C7868 80131168 00021080 */ sll $v0, $v0, 2
/* C786C 8013116C 3C108009 */ lui $s0, %hi(gItemEntityScripts)
/* C7870 80131170 02028021 */ addu $s0, $s0, $v0
/* C7874 80131174 8E10DDD4 */ lw $s0, %lo(gItemEntityScripts)($s0)
/* C7878 80131178 3C16001D */ lui $s6, %hi(icon_present_ROM_START)
/* C787C 8013117C 26D6C310 */ addiu $s6, $s6, %lo(icon_present_ROM_START)
/* C7880 80131180 AFD00024 */ sw $s0, 0x24($fp)
/* C7884 80131184 AFD00028 */ sw $s0, 0x28($fp)
.L80131188_C7888:
/* C7888 80131188 8E030000 */ lw $v1, ($s0)
/* C788C 8013118C 2C620005 */ sltiu $v0, $v1, 5
/* C7890 80131190 1040FFFD */ beqz $v0, .L80131188_C7888
/* C7894 80131194 26100004 */ addiu $s0, $s0, 4
/* C7898 80131198 00031080 */ sll $v0, $v1, 2
/* C789C 8013119C 3C018015 */ lui $at, %hi(jtbl_80150A80)
/* C78A0 801311A0 00220821 */ addu $at, $at, $v0
/* C78A4 801311A4 8C220A80 */ lw $v0, %lo(jtbl_80150A80)($at)
/* C78A8 801311A8 00400008 */ jr $v0
/* C78AC 801311AC 00000000 */ nop
.L801311B0_C78B0:
/* C78B0 801311B0 0804C462 */ j .L80131188_C7888
/* C78B4 801311B4 26100008 */ addiu $s0, $s0, 8
.L801311B8_C78B8:
/* C78B8 801311B8 26100004 */ addiu $s0, $s0, 4
/* C78BC 801311BC 8E060000 */ lw $a2, ($s0)
/* C78C0 801311C0 26100004 */ addiu $s0, $s0, 4
/* C78C4 801311C4 8E140000 */ lw $s4, ($s0)
/* C78C8 801311C8 26100004 */ addiu $s0, $s0, 4
/* C78CC 801311CC 8FC20000 */ lw $v0, ($fp)
/* C78D0 801311D0 3C030004 */ lui $v1, 4
/* C78D4 801311D4 00431024 */ and $v0, $v0, $v1
/* C78D8 801311D8 10400002 */ beqz $v0, .L801311E4
/* C78DC 801311DC 24120120 */ addiu $s2, $zero, 0x120
/* C78E0 801311E0 24120200 */ addiu $s2, $zero, 0x200
.L801311E4:
/* C78E4 801311E4 3C038015 */ lui $v1, %hi(gHudElementCacheTableRaster)
/* C78E8 801311E8 8C6312C8 */ lw $v1, %lo(gHudElementCacheTableRaster)($v1)
/* C78EC 801311EC 0000882D */ daddu $s1, $zero, $zero
/* C78F0 801311F0 0220982D */ daddu $s3, $s1, $zero
/* C78F4 801311F4 24650004 */ addiu $a1, $v1, 4
.L801311F8:
/* C78F8 801311F8 8C620000 */ lw $v0, ($v1)
/* C78FC 801311FC 1457001F */ bne $v0, $s7, .L8013127C
/* C7900 80131200 00000000 */ nop
/* C7904 80131204 3C048015 */ lui $a0, %hi(gHudElementCacheSize)
/* C7908 80131208 8C84133C */ lw $a0, %lo(gHudElementCacheSize)($a0)
/* C790C 8013120C 3C028015 */ lui $v0, %hi(gHudElementCacheBuffer)
/* C7910 80131210 8C421314 */ lw $v0, %lo(gHudElementCacheBuffer)($v0)
/* C7914 80131214 AC660000 */ sw $a2, ($v1)
/* C7918 80131218 8C830000 */ lw $v1, ($a0)
/* C791C 8013121C 00431021 */ addu $v0, $v0, $v1
/* C7920 80131220 ACA20000 */ sw $v0, ($a1)
/* C7924 80131224 8C820000 */ lw $v0, ($a0)
/* C7928 80131228 00521021 */ addu $v0, $v0, $s2
/* C792C 8013122C 02A2102A */ slt $v0, $s5, $v0
/* C7930 80131230 10400003 */ beqz $v0, .L80131240
/* C7934 80131234 00D62021 */ addu $a0, $a2, $s6
.L80131238:
/* C7938 80131238 0804C48E */ j .L80131238
/* C793C 8013123C 00000000 */ nop
.L80131240:
/* C7940 80131240 8CA50000 */ lw $a1, ($a1)
/* C7944 80131244 0C017D24 */ jal nuPiReadRom
/* C7948 80131248 0240302D */ daddu $a2, $s2, $zero
/* C794C 8013124C 3C038015 */ lui $v1, %hi(gHudElementCacheSize)
/* C7950 80131250 8C63133C */ lw $v1, %lo(gHudElementCacheSize)($v1)
/* C7954 80131254 8C620000 */ lw $v0, ($v1)
/* C7958 80131258 00521021 */ addu $v0, $v0, $s2
/* C795C 8013125C AC620000 */ sw $v0, ($v1)
/* C7960 80131260 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* C7964 80131264 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* C7968 80131268 80420070 */ lb $v0, 0x70($v0)
/* C796C 8013126C 5040000F */ beql $v0, $zero, .L801312AC
/* C7970 80131270 AE110000 */ sw $s1, ($s0)
/* C7974 80131274 0804C4A8 */ j .L801312A0
/* C7978 80131278 00000000 */ nop
.L8013127C:
/* C797C 8013127C 5446000D */ bnel $v0, $a2, .L801312B4
/* C7980 80131280 24A50008 */ addiu $a1, $a1, 8
/* C7984 80131284 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* C7988 80131288 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* C798C 8013128C 80420070 */ lb $v0, 0x70($v0)
/* C7990 80131290 14400003 */ bnez $v0, .L801312A0
/* C7994 80131294 00000000 */ nop
/* C7998 80131298 0804C4AB */ j .L801312AC
/* C799C 8013129C AE110000 */ sw $s1, ($s0)
.L801312A0:
/* C79A0 801312A0 96020002 */ lhu $v0, 2($s0)
/* C79A4 801312A4 00531025 */ or $v0, $v0, $s3
/* C79A8 801312A8 AE020000 */ sw $v0, ($s0)
.L801312AC:
/* C79AC 801312AC 0804C4B2 */ j .L801312C8
/* C79B0 801312B0 26100004 */ addiu $s0, $s0, 4
.L801312B4:
/* C79B4 801312B4 24630008 */ addiu $v1, $v1, 8
/* C79B8 801312B8 3C020001 */ lui $v0, 1
/* C79BC 801312BC 02629821 */ addu $s3, $s3, $v0
/* C79C0 801312C0 0804C47E */ j .L801311F8
/* C79C4 801312C4 26310001 */ addiu $s1, $s1, 1
.L801312C8:
/* C79C8 801312C8 2A220100 */ slti $v0, $s1, 0x100
/* C79CC 801312CC 14400003 */ bnez $v0, .L801312DC
/* C79D0 801312D0 0000882D */ daddu $s1, $zero, $zero
.L801312D4:
/* C79D4 801312D4 0804C4B5 */ j .L801312D4
/* C79D8 801312D8 00000000 */ nop
.L801312DC:
/* C79DC 801312DC 3C038015 */ lui $v1, %hi(gHudElementCacheTablePalette)
/* C79E0 801312E0 8C6312D0 */ lw $v1, %lo(gHudElementCacheTablePalette)($v1)
/* C79E4 801312E4 0220902D */ daddu $s2, $s1, $zero
/* C79E8 801312E8 24650004 */ addiu $a1, $v1, 4
.L801312EC:
/* C79EC 801312EC 8C620000 */ lw $v0, ($v1)
/* C79F0 801312F0 1457001F */ bne $v0, $s7, .L80131370
/* C79F4 801312F4 00000000 */ nop
/* C79F8 801312F8 3C048015 */ lui $a0, %hi(gHudElementCacheSize)
/* C79FC 801312FC 8C84133C */ lw $a0, %lo(gHudElementCacheSize)($a0)
/* C7A00 80131300 3C028015 */ lui $v0, %hi(gHudElementCacheBuffer)
/* C7A04 80131304 8C421314 */ lw $v0, %lo(gHudElementCacheBuffer)($v0)
/* C7A08 80131308 AC740000 */ sw $s4, ($v1)
/* C7A0C 8013130C 8C830000 */ lw $v1, ($a0)
/* C7A10 80131310 00431021 */ addu $v0, $v0, $v1
/* C7A14 80131314 ACA20000 */ sw $v0, ($a1)
/* C7A18 80131318 8C820000 */ lw $v0, ($a0)
/* C7A1C 8013131C 24420020 */ addiu $v0, $v0, 0x20
/* C7A20 80131320 02A2102A */ slt $v0, $s5, $v0
/* C7A24 80131324 10400003 */ beqz $v0, .L80131334
/* C7A28 80131328 02962021 */ addu $a0, $s4, $s6
.L8013132C:
/* C7A2C 8013132C 0804C4CB */ j .L8013132C
/* C7A30 80131330 00000000 */ nop
.L80131334:
/* C7A34 80131334 8CA50000 */ lw $a1, ($a1)
/* C7A38 80131338 0C017D24 */ jal nuPiReadRom
/* C7A3C 8013133C 24060020 */ addiu $a2, $zero, 0x20
/* C7A40 80131340 3C038015 */ lui $v1, %hi(gHudElementCacheSize)
/* C7A44 80131344 8C63133C */ lw $v1, %lo(gHudElementCacheSize)($v1)
/* C7A48 80131348 8C620000 */ lw $v0, ($v1)
/* C7A4C 8013134C 24420020 */ addiu $v0, $v0, 0x20
/* C7A50 80131350 AC620000 */ sw $v0, ($v1)
/* C7A54 80131354 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* C7A58 80131358 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* C7A5C 8013135C 80420070 */ lb $v0, 0x70($v0)
/* C7A60 80131360 5040000F */ beql $v0, $zero, .L801313A0
/* C7A64 80131364 AE110000 */ sw $s1, ($s0)
/* C7A68 80131368 0804C4E5 */ j .L80131394
/* C7A6C 8013136C 00000000 */ nop
.L80131370:
/* C7A70 80131370 5454000D */ bnel $v0, $s4, .L801313A8
/* C7A74 80131374 24A50008 */ addiu $a1, $a1, 8
/* C7A78 80131378 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* C7A7C 8013137C 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* C7A80 80131380 80420070 */ lb $v0, 0x70($v0)
/* C7A84 80131384 14400003 */ bnez $v0, .L80131394
/* C7A88 80131388 00000000 */ nop
/* C7A8C 8013138C 0804C4E8 */ j .L801313A0
/* C7A90 80131390 AE110000 */ sw $s1, ($s0)
.L80131394:
/* C7A94 80131394 96020002 */ lhu $v0, 2($s0)
/* C7A98 80131398 00521025 */ or $v0, $v0, $s2
/* C7A9C 8013139C AE020000 */ sw $v0, ($s0)
.L801313A0:
/* C7AA0 801313A0 0804C462 */ j .L80131188_C7888
/* C7AA4 801313A4 26100004 */ addiu $s0, $s0, 4
.L801313A8:
/* C7AA8 801313A8 24630008 */ addiu $v1, $v1, 8
/* C7AAC 801313AC 3C020001 */ lui $v0, 1
/* C7AB0 801313B0 02429021 */ addu $s2, $s2, $v0
/* C7AB4 801313B4 0804C4BB */ j .L801312EC
/* C7AB8 801313B8 26310001 */ addiu $s1, $s1, 1
.L801313BC_C7ABC:
/* C7ABC 801313BC 0C04C775 */ jal item_entity_update
/* C7AC0 801313C0 03C0202D */ daddu $a0, $fp, $zero
/* C7AC4 801313C4 8FBF0034 */ lw $ra, 0x34($sp)
/* C7AC8 801313C8 8FBE0030 */ lw $fp, 0x30($sp)
/* C7ACC 801313CC 8FB7002C */ lw $s7, 0x2c($sp)
/* C7AD0 801313D0 8FB60028 */ lw $s6, 0x28($sp)
/* C7AD4 801313D4 8FB50024 */ lw $s5, 0x24($sp)
/* C7AD8 801313D8 8FB40020 */ lw $s4, 0x20($sp)
/* C7ADC 801313DC 8FB3001C */ lw $s3, 0x1c($sp)
/* C7AE0 801313E0 8FB20018 */ lw $s2, 0x18($sp)
/* C7AE4 801313E4 8FB10014 */ lw $s1, 0x14($sp)
/* C7AE8 801313E8 8FB00010 */ lw $s0, 0x10($sp)
/* C7AEC 801313EC 03E00008 */ jr $ra
/* C7AF0 801313F0 27BD0038 */ addiu $sp, $sp, 0x38

View File

@ -1,28 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802C3EE4
/* E8894 802C3EE4 3C02802E */ lui $v0, %hi(gScriptListCount)
/* E8898 802C3EE8 8C42AC98 */ lw $v0, %lo(gScriptListCount)($v0)
/* E889C 802C3EEC 18400011 */ blez $v0, .L802C3F34
/* E88A0 802C3EF0 0000202D */ daddu $a0, $zero, $zero
/* E88A4 802C3EF4 3C08802E */ lui $t0, %hi(gCurrentScriptListPtr)
/* E88A8 802C3EF8 8D08A890 */ lw $t0, %lo(gCurrentScriptListPtr)($t0)
/* E88AC 802C3EFC 0040382D */ daddu $a3, $v0, $zero
/* E88B0 802C3F00 3C06802E */ lui $a2, %hi(gScriptIdList)
/* E88B4 802C3F04 24C6AA98 */ addiu $a2, $a2, %lo(gScriptIdList)
/* E88B8 802C3F08 3C05802E */ lui $a1, %hi(gScriptIndexList)
/* E88BC 802C3F0C 24A5A898 */ addiu $a1, $a1, %lo(gScriptIndexList)
.L802C3F10:
/* E88C0 802C3F10 8CA20000 */ lw $v0, ($a1)
/* E88C4 802C3F14 00021080 */ sll $v0, $v0, 2
/* E88C8 802C3F18 00481021 */ addu $v0, $v0, $t0
/* E88CC 802C3F1C 8C420000 */ lw $v0, ($v0)
/* E88D0 802C3F20 24C60004 */ addiu $a2, $a2, 4
/* E88D4 802C3F24 24840001 */ addiu $a0, $a0, 1
/* E88D8 802C3F28 0087102A */ slt $v0, $a0, $a3
/* E88DC 802C3F2C 1440FFF8 */ bnez $v0, .L802C3F10
/* E88E0 802C3F30 24A50004 */ addiu $a1, $a1, 4
.L802C3F34:
/* E88E4 802C3F34 03E00008 */ jr $ra
/* E88E8 802C3F38 00000000 */ nop

View File

@ -106,8 +106,8 @@ glabel func_802428C8_A2CB08
/* A2CC24 802429E4 08090B41 */ j .L80242D04 /* A2CC24 802429E4 08090B41 */ j .L80242D04
/* A2CC28 802429E8 4600A521 */ cvt.d.s $f20, $f20 /* A2CC28 802429E8 4600A521 */ cvt.d.s $f20, $f20
.L802429EC_A2CC2C: .L802429EC_A2CC2C:
/* A2CC2C 802429EC 3C108025 */ lui $s0, %hi(hos_05_D_8024F420) /* A2CC2C 802429EC 3C108025 */ lui $s0, %hi(hos_05_D_8024F3F8 + 0x28)
/* A2CC30 802429F0 2610F420 */ addiu $s0, $s0, %lo(hos_05_D_8024F420) /* A2CC30 802429F0 2610F420 */ addiu $s0, $s0, %lo(hos_05_D_8024F3F8 + 0x28)
/* A2CC34 802429F4 0200902D */ daddu $s2, $s0, $zero /* A2CC34 802429F4 0200902D */ daddu $s2, $s0, $zero
/* A2CC38 802429F8 2415001E */ addiu $s5, $zero, 0x1e /* A2CC38 802429F8 2415001E */ addiu $s5, $zero, 0x1e
/* A2CC3C 802429FC 8E22000C */ lw $v0, 0xc($s1) /* A2CC3C 802429FC 8E22000C */ lw $v0, 0xc($s1)
@ -136,8 +136,8 @@ glabel func_802428C8_A2CB08
/* A2CC94 80242A54 08090B41 */ j .L80242D04 /* A2CC94 80242A54 08090B41 */ j .L80242D04
/* A2CC98 80242A58 4600A521 */ cvt.d.s $f20, $f20 /* A2CC98 80242A58 4600A521 */ cvt.d.s $f20, $f20
.L80242A5C_A2CC9C: .L80242A5C_A2CC9C:
/* A2CC9C 80242A5C 3C108025 */ lui $s0, %hi(hos_05_D_8024F448) /* A2CC9C 80242A5C 3C108025 */ lui $s0, %hi(hos_05_D_8024F3F8 + 0x50)
/* A2CCA0 80242A60 2610F448 */ addiu $s0, $s0, %lo(hos_05_D_8024F448) /* A2CCA0 80242A60 2610F448 */ addiu $s0, $s0, %lo(hos_05_D_8024F3F8 + 0x50)
/* A2CCA4 80242A64 0200902D */ daddu $s2, $s0, $zero /* A2CCA4 80242A64 0200902D */ daddu $s2, $s0, $zero
/* A2CCA8 80242A68 2415001E */ addiu $s5, $zero, 0x1e /* A2CCA8 80242A68 2415001E */ addiu $s5, $zero, 0x1e
/* A2CCAC 80242A6C 8E22000C */ lw $v0, 0xc($s1) /* A2CCAC 80242A6C 8E22000C */ lw $v0, 0xc($s1)
@ -166,8 +166,8 @@ glabel func_802428C8_A2CB08
/* A2CD04 80242AC4 08090B41 */ j .L80242D04 /* A2CD04 80242AC4 08090B41 */ j .L80242D04
/* A2CD08 80242AC8 4600A521 */ cvt.d.s $f20, $f20 /* A2CD08 80242AC8 4600A521 */ cvt.d.s $f20, $f20
.L80242ACC_A2CD0C: .L80242ACC_A2CD0C:
/* A2CD0C 80242ACC 3C108025 */ lui $s0, %hi(hos_05_D_8024F470) /* A2CD0C 80242ACC 3C108025 */ lui $s0, %hi(hos_05_D_8024F3F8 + 0x78)
/* A2CD10 80242AD0 2610F470 */ addiu $s0, $s0, %lo(hos_05_D_8024F470) /* A2CD10 80242AD0 2610F470 */ addiu $s0, $s0, %lo(hos_05_D_8024F3F8 + 0x78)
/* A2CD14 80242AD4 8E22000C */ lw $v0, 0xc($s1) /* A2CD14 80242AD4 8E22000C */ lw $v0, 0xc($s1)
/* A2CD18 80242AD8 2415001E */ addiu $s5, $zero, 0x1e /* A2CD18 80242AD8 2415001E */ addiu $s5, $zero, 0x1e
/* A2CD1C 80242ADC 8C420014 */ lw $v0, 0x14($v0) /* A2CD1C 80242ADC 8C420014 */ lw $v0, 0x14($v0)
@ -227,8 +227,8 @@ glabel func_802428C8_A2CB08
/* A2CDF0 80242BB0 08090B60 */ j .L80242D80 /* A2CDF0 80242BB0 08090B60 */ j .L80242D80
/* A2CDF4 80242BB4 24140003 */ addiu $s4, $zero, 3 /* A2CDF4 80242BB4 24140003 */ addiu $s4, $zero, 3
.L80242BB8_A2CDF8: .L80242BB8_A2CDF8:
/* A2CDF8 80242BB8 3C108025 */ lui $s0, %hi(hos_05_D_8024F498) /* A2CDF8 80242BB8 3C108025 */ lui $s0, %hi(hos_05_D_8024F3F8 + 0xA0)
/* A2CDFC 80242BBC 2610F498 */ addiu $s0, $s0, %lo(hos_05_D_8024F498) /* A2CDFC 80242BBC 2610F498 */ addiu $s0, $s0, %lo(hos_05_D_8024F3F8 + 0xA0)
/* A2CE00 80242BC0 0200902D */ daddu $s2, $s0, $zero /* A2CE00 80242BC0 0200902D */ daddu $s2, $s0, $zero
/* A2CE04 80242BC4 2415001E */ addiu $s5, $zero, 0x1e /* A2CE04 80242BC4 2415001E */ addiu $s5, $zero, 0x1e
/* A2CE08 80242BC8 8E22000C */ lw $v0, 0xc($s1) /* A2CE08 80242BC8 8E22000C */ lw $v0, 0xc($s1)
@ -257,8 +257,8 @@ glabel func_802428C8_A2CB08
/* A2CE60 80242C20 08090B41 */ j .L80242D04 /* A2CE60 80242C20 08090B41 */ j .L80242D04
/* A2CE64 80242C24 4600A521 */ cvt.d.s $f20, $f20 /* A2CE64 80242C24 4600A521 */ cvt.d.s $f20, $f20
.L80242C28_A2CE68: .L80242C28_A2CE68:
/* A2CE68 80242C28 3C108025 */ lui $s0, %hi(hos_05_D_8024F4C0) /* A2CE68 80242C28 3C108025 */ lui $s0, %hi(hos_05_D_8024F3F8 + 0xC8)
/* A2CE6C 80242C2C 2610F4C0 */ addiu $s0, $s0, %lo(hos_05_D_8024F4C0) /* A2CE6C 80242C2C 2610F4C0 */ addiu $s0, $s0, %lo(hos_05_D_8024F3F8 + 0xC8)
/* A2CE70 80242C30 0200902D */ daddu $s2, $s0, $zero /* A2CE70 80242C30 0200902D */ daddu $s2, $s0, $zero
/* A2CE74 80242C34 2415001E */ addiu $s5, $zero, 0x1e /* A2CE74 80242C34 2415001E */ addiu $s5, $zero, 0x1e
/* A2CE78 80242C38 8E22000C */ lw $v0, 0xc($s1) /* A2CE78 80242C38 8E22000C */ lw $v0, 0xc($s1)
@ -287,8 +287,8 @@ glabel func_802428C8_A2CB08
/* A2CED0 80242C90 08090B41 */ j .L80242D04 /* A2CED0 80242C90 08090B41 */ j .L80242D04
/* A2CED4 80242C94 4600A521 */ cvt.d.s $f20, $f20 /* A2CED4 80242C94 4600A521 */ cvt.d.s $f20, $f20
.L80242C98: .L80242C98:
/* A2CED8 80242C98 3C108025 */ lui $s0, %hi(hos_05_D_8024F4E8) /* A2CED8 80242C98 3C108025 */ lui $s0, %hi(hos_05_D_8024F3F8 + 0xF0)
/* A2CEDC 80242C9C 2610F4E8 */ addiu $s0, $s0, %lo(hos_05_D_8024F4E8) /* A2CEDC 80242C9C 2610F4E8 */ addiu $s0, $s0, %lo(hos_05_D_8024F3F8 + 0xF0)
/* A2CEE0 80242CA0 0200902D */ daddu $s2, $s0, $zero /* A2CEE0 80242CA0 0200902D */ daddu $s2, $s0, $zero
/* A2CEE4 80242CA4 2415001E */ addiu $s5, $zero, 0x1e /* A2CEE4 80242CA4 2415001E */ addiu $s5, $zero, 0x1e
/* A2CEE8 80242CA8 8C82000C */ lw $v0, 0xc($a0) /* A2CEE8 80242CA8 8C82000C */ lw $v0, 0xc($a0)

View File

@ -1,233 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel MakeShop
/* 7E26E0 80281860 27BDFF98 */ addiu $sp, $sp, -0x68
/* 7E26E4 80281864 AFB10044 */ sw $s1, 0x44($sp)
/* 7E26E8 80281868 0080882D */ daddu $s1, $a0, $zero
/* 7E26EC 8028186C AFBF0064 */ sw $ra, 0x64($sp)
/* 7E26F0 80281870 AFBE0060 */ sw $fp, 0x60($sp)
/* 7E26F4 80281874 AFB7005C */ sw $s7, 0x5c($sp)
/* 7E26F8 80281878 AFB60058 */ sw $s6, 0x58($sp)
/* 7E26FC 8028187C AFB50054 */ sw $s5, 0x54($sp)
/* 7E2700 80281880 AFB40050 */ sw $s4, 0x50($sp)
/* 7E2704 80281884 AFB3004C */ sw $s3, 0x4c($sp)
/* 7E2708 80281888 AFB20048 */ sw $s2, 0x48($sp)
/* 7E270C 8028188C AFB00040 */ sw $s0, 0x40($sp)
/* 7E2710 80281890 8E30000C */ lw $s0, 0xc($s1)
/* 7E2714 80281894 8E050000 */ lw $a1, ($s0)
/* 7E2718 80281898 0C0B1EAF */ jal evt_get_variable
/* 7E271C 8028189C 26100004 */ addiu $s0, $s0, 4
/* 7E2720 802818A0 8E050000 */ lw $a1, ($s0)
/* 7E2724 802818A4 26100004 */ addiu $s0, $s0, 4
/* 7E2728 802818A8 0220202D */ daddu $a0, $s1, $zero
/* 7E272C 802818AC 0C0B1EAF */ jal evt_get_variable
/* 7E2730 802818B0 0040A82D */ daddu $s5, $v0, $zero
/* 7E2734 802818B4 8E050000 */ lw $a1, ($s0)
/* 7E2738 802818B8 26100004 */ addiu $s0, $s0, 4
/* 7E273C 802818BC 0220202D */ daddu $a0, $s1, $zero
/* 7E2740 802818C0 0C0B1EAF */ jal evt_get_variable
/* 7E2744 802818C4 0040982D */ daddu $s3, $v0, $zero
/* 7E2748 802818C8 0220202D */ daddu $a0, $s1, $zero
/* 7E274C 802818CC 8E050000 */ lw $a1, ($s0)
/* 7E2750 802818D0 0C0B1EAF */ jal evt_get_variable
/* 7E2754 802818D4 0040882D */ daddu $s1, $v0, $zero
/* 7E2758 802818D8 2404035C */ addiu $a0, $zero, 0x35c
/* 7E275C 802818DC 0C00AB39 */ jal heap_malloc
/* 7E2760 802818E0 0040802D */ daddu $s0, $v0, $zero
/* 7E2764 802818E4 3C038007 */ lui $v1, %hi(gGameStatusPtr)
/* 7E2768 802818E8 8C63419C */ lw $v1, %lo(gGameStatusPtr)($v1)
/* 7E276C 802818EC 0040A02D */ daddu $s4, $v0, $zero
/* 7E2770 802818F0 AC740144 */ sw $s4, 0x144($v1)
/* 7E2774 802818F4 AE950014 */ sw $s5, 0x14($s4)
/* 7E2778 802818F8 AE930018 */ sw $s3, 0x18($s4)
/* 7E277C 802818FC AE91001C */ sw $s1, 0x1c($s4)
/* 7E2780 80281900 AE900024 */ sw $s0, 0x24($s4)
/* 7E2784 80281904 8E620000 */ lw $v0, ($s3)
/* 7E2788 80281908 10400005 */ beqz $v0, .L80281920
/* 7E278C 8028190C 0000902D */ daddu $s2, $zero, $zero
.L80281910:
/* 7E2790 80281910 2673000C */ addiu $s3, $s3, 0xc
/* 7E2794 80281914 8E620000 */ lw $v0, ($s3)
/* 7E2798 80281918 1440FFFD */ bnez $v0, .L80281910
/* 7E279C 8028191C 26520001 */ addiu $s2, $s2, 1
.L80281920:
/* 7E27A0 80281920 A6920002 */ sh $s2, 2($s4)
/* 7E27A4 80281924 12200008 */ beqz $s1, .L80281948
/* 7E27A8 80281928 0000902D */ daddu $s2, $zero, $zero
/* 7E27AC 8028192C 8E220000 */ lw $v0, ($s1)
/* 7E27B0 80281930 10400005 */ beqz $v0, .L80281948
/* 7E27B4 80281934 00000000 */ nop
.L80281938:
/* 7E27B8 80281938 2631000C */ addiu $s1, $s1, 0xc
/* 7E27BC 8028193C 8E220000 */ lw $v0, ($s1)
/* 7E27C0 80281940 1440FFFD */ bnez $v0, .L80281938
/* 7E27C4 80281944 26520001 */ addiu $s2, $s2, 1
.L80281948:
/* 7E27C8 80281948 86840002 */ lh $a0, 2($s4)
/* 7E27CC 8028194C 18800006 */ blez $a0, .L80281968
/* 7E27D0 80281950 A6920004 */ sh $s2, 4($s4)
/* 7E27D4 80281954 0C00AB39 */ jal heap_malloc
/* 7E27D8 80281958 00042100 */ sll $a0, $a0, 4
/* 7E27DC 8028195C 3C038007 */ lui $v1, %hi(gGameStatusPtr)
/* 7E27E0 80281960 8C63419C */ lw $v1, %lo(gGameStatusPtr)($v1)
/* 7E27E4 80281964 AC620140 */ sw $v0, 0x140($v1)
.L80281968:
/* 7E27E8 80281968 8E930018 */ lw $s3, 0x18($s4)
/* 7E27EC 8028196C 8E620000 */ lw $v0, ($s3)
/* 7E27F0 80281970 8E950014 */ lw $s5, 0x14($s4)
/* 7E27F4 80281974 10400055 */ beqz $v0, .L80281ACC
/* 7E27F8 80281978 0000902D */ daddu $s2, $zero, $zero
/* 7E27FC 8028197C 3C1E8007 */ lui $fp, %hi(gGameStatusPtr)
/* 7E2800 80281980 27DE419C */ addiu $fp, $fp, %lo(gGameStatusPtr)
/* 7E2804 80281984 3C178028 */ lui $s7, %hi(D_80283F58_7E4DD8)
/* 7E2808 80281988 26F73F58 */ addiu $s7, $s7, %lo(D_80283F58_7E4DD8)
/* 7E280C 8028198C 24160003 */ addiu $s6, $zero, 3
/* 7E2810 80281990 26B10002 */ addiu $s1, $s5, 2
.L80281994:
/* 7E2814 80281994 27A50028 */ addiu $a1, $sp, 0x28
/* 7E2818 80281998 27A6002C */ addiu $a2, $sp, 0x2c
/* 7E281C 8028199C 27A70030 */ addiu $a3, $sp, 0x30
/* 7E2820 802819A0 96A40000 */ lhu $a0, ($s5)
/* 7E2824 802819A4 27A20034 */ addiu $v0, $sp, 0x34
/* 7E2828 802819A8 AFA20010 */ sw $v0, 0x10($sp)
/* 7E282C 802819AC 27A20038 */ addiu $v0, $sp, 0x38
/* 7E2830 802819B0 AFA20014 */ sw $v0, 0x14($sp)
/* 7E2834 802819B4 27A2003C */ addiu $v0, $sp, 0x3c
/* 7E2838 802819B8 0C046C3B */ jal get_model_center_and_size
/* 7E283C 802819BC AFA20018 */ sw $v0, 0x18($sp)
/* 7E2840 802819C0 00128100 */ sll $s0, $s2, 4
/* 7E2844 802819C4 C7A2002C */ lwc1 $f2, 0x2c($sp)
/* 7E2848 802819C8 8FC30000 */ lw $v1, ($fp)
/* 7E284C 802819CC 3C0140C0 */ lui $at, 0x40c0
/* 7E2850 802819D0 44812000 */ mtc1 $at, $f4
/* 7E2854 802819D4 C7A00028 */ lwc1 $f0, 0x28($sp)
/* 7E2858 802819D8 8C620140 */ lw $v0, 0x140($v1)
/* 7E285C 802819DC 46041080 */ add.s $f2, $f2, $f4
/* 7E2860 802819E0 02021021 */ addu $v0, $s0, $v0
/* 7E2864 802819E4 E4400004 */ swc1 $f0, 4($v0)
/* 7E2868 802819E8 8C620140 */ lw $v0, 0x140($v1)
/* 7E286C 802819EC 02021021 */ addu $v0, $s0, $v0
/* 7E2870 802819F0 E4420008 */ swc1 $f2, 8($v0)
/* 7E2874 802819F4 8C620140 */ lw $v0, 0x140($v1)
/* 7E2878 802819F8 C7A00030 */ lwc1 $f0, 0x30($sp)
/* 7E287C 802819FC 02021021 */ addu $v0, $s0, $v0
/* 7E2880 80281A00 E440000C */ swc1 $f0, 0xc($v0)
/* 7E2884 80281A04 96A40000 */ lhu $a0, ($s5)
/* 7E2888 80281A08 0C046C04 */ jal get_model_list_index_from_tree_index
/* 7E288C 80281A0C E7A2002C */ swc1 $f2, 0x2c($sp)
/* 7E2890 80281A10 0C046B4C */ jal get_model_from_list_index
/* 7E2894 80281A14 0040202D */ daddu $a0, $v0, $zero
/* 7E2898 80281A18 C7A00028 */ lwc1 $f0, 0x28($sp)
/* 7E289C 80281A1C C7A2002C */ lwc1 $f2, 0x2c($sp)
/* 7E28A0 80281A20 94430000 */ lhu $v1, ($v0)
/* 7E28A4 80281A24 44050000 */ mfc1 $a1, $f0
/* 7E28A8 80281A28 44061000 */ mfc1 $a2, $f2
/* 7E28AC 80281A2C C7A00030 */ lwc1 $f0, 0x30($sp)
/* 7E28B0 80281A30 34630004 */ ori $v1, $v1, 4
/* 7E28B4 80281A34 A4430000 */ sh $v1, ($v0)
/* 7E28B8 80281A38 8E630000 */ lw $v1, ($s3)
/* 7E28BC 80281A3C 8E840024 */ lw $a0, 0x24($s4)
/* 7E28C0 80281A40 24020001 */ addiu $v0, $zero, 1
/* 7E28C4 80281A44 AFA20010 */ sw $v0, 0x10($sp)
/* 7E28C8 80281A48 AFA00014 */ sw $zero, 0x14($sp)
/* 7E28CC 80281A4C 44070000 */ mfc1 $a3, $f0
/* 7E28D0 80281A50 0C04C6A5 */ jal make_item_entity_nodelay
/* 7E28D4 80281A54 00642025 */ or $a0, $v1, $a0
/* 7E28D8 80281A58 8FC40000 */ lw $a0, ($fp)
/* 7E28DC 80281A5C 8C830140 */ lw $v1, 0x140($a0)
/* 7E28E0 80281A60 26B50004 */ addiu $s5, $s5, 4
/* 7E28E4 80281A64 02031821 */ addu $v1, $s0, $v1
/* 7E28E8 80281A68 AC620000 */ sw $v0, ($v1)
/* 7E28EC 80281A6C 8C820140 */ lw $v0, 0x140($a0)
/* 7E28F0 80281A70 2673000C */ addiu $s3, $s3, 0xc
/* 7E28F4 80281A74 02028021 */ addu $s0, $s0, $v0
/* 7E28F8 80281A78 8E040000 */ lw $a0, ($s0)
/* 7E28FC 80281A7C 0C04D052 */ jal set_item_entity_flags
/* 7E2900 80281A80 24054000 */ addiu $a1, $zero, 0x4000
/* 7E2904 80281A84 02E0202D */ daddu $a0, $s7, $zero
/* 7E2908 80281A88 24050080 */ addiu $a1, $zero, 0x80
/* 7E290C 80281A8C 96260000 */ lhu $a2, ($s1)
/* 7E2910 80281A90 0240382D */ daddu $a3, $s2, $zero
/* 7E2914 80281A94 AFA00010 */ sw $zero, 0x10($sp)
/* 7E2918 80281A98 0C0B10AA */ jal bind_trigger_1
/* 7E291C 80281A9C AFB60014 */ sw $s6, 0x14($sp)
/* 7E2920 80281AA0 02E0202D */ daddu $a0, $s7, $zero
/* 7E2924 80281AA4 24050800 */ addiu $a1, $zero, 0x800
/* 7E2928 80281AA8 0240382D */ daddu $a3, $s2, $zero
/* 7E292C 80281AAC 96260000 */ lhu $a2, ($s1)
/* 7E2930 80281AB0 26310004 */ addiu $s1, $s1, 4
/* 7E2934 80281AB4 AFA00010 */ sw $zero, 0x10($sp)
/* 7E2938 80281AB8 0C0B10AA */ jal bind_trigger_1
/* 7E293C 80281ABC AFB60014 */ sw $s6, 0x14($sp)
/* 7E2940 80281AC0 8E620000 */ lw $v0, ($s3)
/* 7E2944 80281AC4 1440FFB3 */ bnez $v0, .L80281994
/* 7E2948 80281AC8 26520001 */ addiu $s2, $s2, 1
.L80281ACC:
/* 7E294C 80281ACC 3C048008 */ lui $a0, %hi(HES_Item_Coin)
/* 7E2950 80281AD0 24840868 */ addiu $a0, $a0, %lo(HES_Item_Coin)
/* 7E2954 80281AD4 0C050529 */ jal hud_element_create
/* 7E2958 80281AD8 2410FFFF */ addiu $s0, $zero, -1
/* 7E295C 80281ADC 0040202D */ daddu $a0, $v0, $zero
/* 7E2960 80281AE0 24050080 */ addiu $a1, $zero, 0x80
/* 7E2964 80281AE4 0C051280 */ jal hud_element_set_flags
/* 7E2968 80281AE8 AE840020 */ sw $a0, 0x20($s4)
/* 7E296C 80281AEC 8E840020 */ lw $a0, 0x20($s4)
/* 7E2970 80281AF0 0C05128B */ jal hud_element_clear_flags
/* 7E2974 80281AF4 34058000 */ ori $a1, $zero, 0x8000
/* 7E2978 80281AF8 3C058028 */ lui $a1, %hi(draw_shop_items)
/* 7E297C 80281AFC 24A51524 */ addiu $a1, $a1, %lo(draw_shop_items)
/* 7E2980 80281B00 0C048C8F */ jal create_worker_frontUI
/* 7E2984 80281B04 0000202D */ daddu $a0, $zero, $zero
/* 7E2988 80281B08 0C048D8F */ jal get_worker
/* 7E298C 80281B0C 0040202D */ daddu $a0, $v0, $zero
/* 7E2990 80281B10 2404000A */ addiu $a0, $zero, 0xa
/* 7E2994 80281B14 24050064 */ addiu $a1, $zero, 0x64
/* 7E2998 80281B18 24060042 */ addiu $a2, $zero, 0x42
/* 7E299C 80281B1C 24070078 */ addiu $a3, $zero, 0x78
/* 7E29A0 80281B20 2402001C */ addiu $v0, $zero, 0x1c
/* 7E29A4 80281B24 AFA20010 */ sw $v0, 0x10($sp)
/* 7E29A8 80281B28 3C028028 */ lui $v0, %hi(shop_draw_item_name)
/* 7E29AC 80281B2C 24421434 */ addiu $v0, $v0, %lo(shop_draw_item_name)
/* 7E29B0 80281B30 AFA00014 */ sw $zero, 0x14($sp)
/* 7E29B4 80281B34 AFA20018 */ sw $v0, 0x18($sp)
/* 7E29B8 80281B38 AFA0001C */ sw $zero, 0x1c($sp)
/* 7E29BC 80281B3C 0C051F32 */ jal set_window_properties
/* 7E29C0 80281B40 AFB00020 */ sw $s0, 0x20($sp)
/* 7E29C4 80281B44 2404000B */ addiu $a0, $zero, 0xb
/* 7E29C8 80281B48 24050020 */ addiu $a1, $zero, 0x20
/* 7E29CC 80281B4C 240600B8 */ addiu $a2, $zero, 0xb8
/* 7E29D0 80281B50 24070100 */ addiu $a3, $zero, 0x100
/* 7E29D4 80281B54 00A0102D */ daddu $v0, $a1, $zero
/* 7E29D8 80281B58 AFA20010 */ sw $v0, 0x10($sp)
/* 7E29DC 80281B5C 24020001 */ addiu $v0, $zero, 1
/* 7E29E0 80281B60 AFA20014 */ sw $v0, 0x14($sp)
/* 7E29E4 80281B64 3C028028 */ lui $v0, %hi(shop_draw_item_desc)
/* 7E29E8 80281B68 244214D0 */ addiu $v0, $v0, %lo(shop_draw_item_desc)
/* 7E29EC 80281B6C AFA20018 */ sw $v0, 0x18($sp)
/* 7E29F0 80281B70 AFA0001C */ sw $zero, 0x1c($sp)
/* 7E29F4 80281B74 0C051F32 */ jal set_window_properties
/* 7E29F8 80281B78 AFB00020 */ sw $s0, 0x20($sp)
/* 7E29FC 80281B7C 3C048015 */ lui $a0, %hi(gWindowStyles)
/* 7E2A00 80281B80 2484F150 */ addiu $a0, $a0, %lo(gWindowStyles)
/* 7E2A04 80281B84 24030009 */ addiu $v1, $zero, 9
/* 7E2A08 80281B88 AC830028 */ sw $v1, 0x28($a0)
/* 7E2A0C 80281B8C 24030003 */ addiu $v1, $zero, 3
/* 7E2A10 80281B90 AC83002C */ sw $v1, 0x2c($a0)
/* 7E2A14 80281B94 AE800008 */ sw $zero, 8($s4)
/* 7E2A18 80281B98 AE80000C */ sw $zero, 0xc($s4)
/* 7E2A1C 80281B9C A6800000 */ sh $zero, ($s4)
/* 7E2A20 80281BA0 AE800010 */ sw $zero, 0x10($s4)
/* 7E2A24 80281BA4 8FBF0064 */ lw $ra, 0x64($sp)
/* 7E2A28 80281BA8 8FBE0060 */ lw $fp, 0x60($sp)
/* 7E2A2C 80281BAC 8FB7005C */ lw $s7, 0x5c($sp)
/* 7E2A30 80281BB0 8FB60058 */ lw $s6, 0x58($sp)
/* 7E2A34 80281BB4 8FB50054 */ lw $s5, 0x54($sp)
/* 7E2A38 80281BB8 8FB40050 */ lw $s4, 0x50($sp)
/* 7E2A3C 80281BBC 8FB3004C */ lw $s3, 0x4c($sp)
/* 7E2A40 80281BC0 8FB20048 */ lw $s2, 0x48($sp)
/* 7E2A44 80281BC4 8FB10044 */ lw $s1, 0x44($sp)
/* 7E2A48 80281BC8 8FB00040 */ lw $s0, 0x40($sp)
/* 7E2A4C 80281BCC 24020002 */ addiu $v0, $zero, 2
/* 7E2A50 80281BD0 03E00008 */ jr $ra
/* 7E2A54 80281BD4 27BD0068 */ addiu $sp, $sp, 0x68

View File

@ -1,86 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel spr_init_player_raster_cache
/* 101E50 802DED60 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 101E54 802DED64 AFB10014 */ sw $s1, 0x14($sp)
/* 101E58 802DED68 0080882D */ daddu $s1, $a0, $zero
/* 101E5C 802DED6C AFB20018 */ sw $s2, 0x18($sp)
/* 101E60 802DED70 00A0902D */ daddu $s2, $a1, $zero
/* 101E64 802DED74 3C040194 */ lui $a0, %hi(_1943000_ROM_START + 0x10)
/* 101E68 802DED78 34843010 */ addiu $a0, $a0, %lo(_1943000_ROM_START + 0x10)
/* 101E6C 802DED7C AFB00010 */ sw $s0, 0x10($sp)
/* 101E70 802DED80 3C10802E */ lui $s0, %hi(SpriteDataHeader)
/* 101E74 802DED84 26100C60 */ addiu $s0, $s0, %lo(SpriteDataHeader)
/* 101E78 802DED88 0200282D */ daddu $a1, $s0, $zero
/* 101E7C 802DED8C AFBF001C */ sw $ra, 0x1c($sp)
/* 101E80 802DED90 0C017D24 */ jal nuPiReadRom
/* 101E84 802DED94 2406000C */ addiu $a2, $zero, 0xc
/* 101E88 802DED98 3C060194 */ lui $a2, %hi(_1943000_ROM_START + 0x10)
/* 101E8C 802DED9C 34C63010 */ addiu $a2, $a2, %lo(_1943000_ROM_START + 0x10)
/* 101E90 802DEDA0 3C048035 */ lui $a0, %hi(heap_spriteHead)
/* 101E94 802DEDA4 2484F800 */ addiu $a0, $a0, %lo(heap_spriteHead)
/* 101E98 802DEDA8 8E020000 */ lw $v0, ($s0)
/* 101E9C 802DEDAC 02510018 */ mult $s2, $s1
/* 101EA0 802DEDB0 3C01802E */ lui $at, %hi(PlayerRasterCacheSize)
/* 101EA4 802DEDB4 AC310C58 */ sw $s1, %lo(PlayerRasterCacheSize)($at)
/* 101EA8 802DEDB8 3C11802E */ lui $s1, %hi(PlayerRasterMaxSize)
/* 101EAC 802DEDBC 26310C5C */ addiu $s1, $s1, %lo(PlayerRasterMaxSize)
/* 101EB0 802DEDC0 AE320000 */ sw $s2, ($s1)
/* 101EB4 802DEDC4 8E030008 */ lw $v1, 8($s0)
/* 101EB8 802DEDC8 00461021 */ addu $v0, $v0, $a2
/* 101EBC 802DEDCC AE020000 */ sw $v0, ($s0)
/* 101EC0 802DEDD0 8E020004 */ lw $v0, 4($s0)
/* 101EC4 802DEDD4 00661821 */ addu $v1, $v1, $a2
/* 101EC8 802DEDD8 AE030008 */ sw $v1, 8($s0)
/* 101ECC 802DEDDC 00461021 */ addu $v0, $v0, $a2
/* 101ED0 802DEDE0 00002812 */ mflo $a1
/* 101ED4 802DEDE4 0C00A41B */ jal _heap_malloc
/* 101ED8 802DEDE8 AE020004 */ sw $v0, 4($s0)
/* 101EDC 802DEDEC 0040282D */ daddu $a1, $v0, $zero
/* 101EE0 802DEDF0 0000202D */ daddu $a0, $zero, $zero
/* 101EE4 802DEDF4 240600FF */ addiu $a2, $zero, 0xff
/* 101EE8 802DEDF8 3C03802E */ lui $v1, %hi(PlayerRasterCache)
/* 101EEC 802DEDFC 24630C70 */ addiu $v1, $v1, %lo(PlayerRasterCache)
/* 101EF0 802DEE00 8E310000 */ lw $s1, ($s1)
.L802DEE04:
/* 101EF4 802DEE04 AC65000C */ sw $a1, 0xc($v1)
/* 101EF8 802DEE08 00B12821 */ addu $a1, $a1, $s1
/* 101EFC 802DEE0C AC600000 */ sw $zero, ($v1)
/* 101F00 802DEE10 AC600004 */ sw $zero, 4($v1)
/* 101F04 802DEE14 AC660008 */ sw $a2, 8($v1)
/* 101F08 802DEE18 24840001 */ addiu $a0, $a0, 1
/* 101F0C 802DEE1C 28820012 */ slti $v0, $a0, 0x12
/* 101F10 802DEE20 1440FFF8 */ bnez $v0, .L802DEE04
/* 101F14 802DEE24 24630010 */ addiu $v1, $v1, 0x10
/* 101F18 802DEE28 2404000C */ addiu $a0, $zero, 0xc
/* 101F1C 802DEE2C 3C02802E */ lui $v0, %hi(PlayerRasterBufferSetOffsets+0x30)
/* 101F20 802DEE30 24420080 */ addiu $v0, $v0, %lo(PlayerRasterBufferSetOffsets+0x30)
.L802DEE34:
/* 101F24 802DEE34 AC400000 */ sw $zero, ($v0)
/* 101F28 802DEE38 2484FFFF */ addiu $a0, $a0, -1
/* 101F2C 802DEE3C 0481FFFD */ bgez $a0, .L802DEE34
/* 101F30 802DEE40 2442FFFC */ addiu $v0, $v0, -4
/* 101F34 802DEE44 3C11802E */ lui $s1, %hi(PlayerRasterHeader)
/* 101F38 802DEE48 26310C10 */ addiu $s1, $s1, %lo(PlayerRasterHeader)
/* 101F3C 802DEE4C 0220282D */ daddu $a1, $s1, $zero
/* 101F40 802DEE50 3C10802E */ lui $s0, %hi(SpriteDataHeader)
/* 101F44 802DEE54 26100C60 */ addiu $s0, $s0, %lo(SpriteDataHeader)
/* 101F48 802DEE58 8E040000 */ lw $a0, ($s0)
/* 101F4C 802DEE5C 3C01802E */ lui $at, %hi(PlayerRasterSetsLoaded)
/* 101F50 802DEE60 AC20004C */ sw $zero, %lo(PlayerRasterSetsLoaded)($at)
/* 101F54 802DEE64 0C017D24 */ jal nuPiReadRom
/* 101F58 802DEE68 2406000C */ addiu $a2, $zero, 0xc
/* 101F5C 802DEE6C 3C05802E */ lui $a1, %hi(D_802E0C20)
/* 101F60 802DEE70 24A50C20 */ addiu $a1, $a1, %lo(D_802E0C20)
/* 101F64 802DEE74 8E020000 */ lw $v0, ($s0)
/* 101F68 802DEE78 8E240000 */ lw $a0, ($s1)
/* 101F6C 802DEE7C 24060038 */ addiu $a2, $zero, 0x38
/* 101F70 802DEE80 0C017D24 */ jal nuPiReadRom
/* 101F74 802DEE84 00442021 */ addu $a0, $v0, $a0
/* 101F78 802DEE88 8FBF001C */ lw $ra, 0x1c($sp)
/* 101F7C 802DEE8C 8FB20018 */ lw $s2, 0x18($sp)
/* 101F80 802DEE90 8FB10014 */ lw $s1, 0x14($sp)
/* 101F84 802DEE94 8FB00010 */ lw $s0, 0x10($sp)
/* 101F88 802DEE98 03E00008 */ jr $ra
/* 101F8C 802DEE9C 27BD0020 */ addiu $sp, $sp, 0x20

View File

@ -1,306 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel au_engine_init
/* 2E25C 80052E5C 27BDFFB8 */ addiu $sp, $sp, -0x48
/* 2E260 80052E60 AFB60040 */ sw $s6, 0x40($sp)
/* 2E264 80052E64 0080B02D */ daddu $s6, $a0, $zero
/* 2E268 80052E68 24050001 */ addiu $a1, $zero, 1
/* 2E26C 80052E6C 3C028008 */ lui $v0, %hi(gSynDriverPtr)
/* 2E270 80052E70 8C428E54 */ lw $v0, %lo(gSynDriverPtr)($v0)
/* 2E274 80052E74 240619E0 */ addiu $a2, $zero, 0x19e0
/* 2E278 80052E78 AFBF0044 */ sw $ra, 0x44($sp)
/* 2E27C 80052E7C AFB5003C */ sw $s5, 0x3c($sp)
/* 2E280 80052E80 AFB40038 */ sw $s4, 0x38($sp)
/* 2E284 80052E84 AFB30034 */ sw $s3, 0x34($sp)
/* 2E288 80052E88 AFB20030 */ sw $s2, 0x30($sp)
/* 2E28C 80052E8C AFB1002C */ sw $s1, 0x2c($sp)
/* 2E290 80052E90 AFB00028 */ sw $s0, 0x28($sp)
/* 2E294 80052E94 8C550018 */ lw $s5, 0x18($v0)
/* 2E298 80052E98 0000982D */ daddu $s3, $zero, $zero
/* 2E29C 80052E9C 0C015FE4 */ jal alHeapAlloc
/* 2E2A0 80052EA0 02A0202D */ daddu $a0, $s5, $zero
/* 2E2A4 80052EA4 02A0202D */ daddu $a0, $s5, $zero
/* 2E2A8 80052EA8 24050001 */ addiu $a1, $zero, 1
/* 2E2AC 80052EAC 24060A9C */ addiu $a2, $zero, 0xa9c
/* 2E2B0 80052EB0 3C12800A */ lui $s2, %hi(gSoundGlobals)
/* 2E2B4 80052EB4 2652A5C0 */ addiu $s2, $s2, %lo(gSoundGlobals)
/* 2E2B8 80052EB8 0C015FE4 */ jal alHeapAlloc
/* 2E2BC 80052EBC AE420000 */ sw $v0, ($s2)
/* 2E2C0 80052EC0 02A0202D */ daddu $a0, $s5, $zero
/* 2E2C4 80052EC4 24050001 */ addiu $a1, $zero, 1
/* 2E2C8 80052EC8 24060A9C */ addiu $a2, $zero, 0xa9c
/* 2E2CC 80052ECC 3C11800A */ lui $s1, %hi(gBGMPlayerA)
/* 2E2D0 80052ED0 2631A664 */ addiu $s1, $s1, %lo(gBGMPlayerA)
/* 2E2D4 80052ED4 0C015FE4 */ jal alHeapAlloc
/* 2E2D8 80052ED8 AE220000 */ sw $v0, ($s1)
/* 2E2DC 80052EDC 02A0202D */ daddu $a0, $s5, $zero
/* 2E2E0 80052EE0 24050001 */ addiu $a1, $zero, 1
/* 2E2E4 80052EE4 3C01800A */ lui $at, %hi(gBGMPlayerB)
/* 2E2E8 80052EE8 AC22A5FC */ sw $v0, %lo(gBGMPlayerB)($at)
/* 2E2EC 80052EEC 0C015FE4 */ jal alHeapAlloc
/* 2E2F0 80052EF0 24060A9C */ addiu $a2, $zero, 0xa9c
/* 2E2F4 80052EF4 02A0202D */ daddu $a0, $s5, $zero
/* 2E2F8 80052EF8 24050001 */ addiu $a1, $zero, 1
/* 2E2FC 80052EFC 3C01800A */ lui $at, %hi(gBGMPlayerC)
/* 2E300 80052F00 AC22A5CC */ sw $v0, %lo(gBGMPlayerC)($at)
/* 2E304 80052F04 0C015FE4 */ jal alHeapAlloc
/* 2E308 80052F08 240606CC */ addiu $a2, $zero, 0x6cc
/* 2E30C 80052F0C 02A0202D */ daddu $a0, $s5, $zero
/* 2E310 80052F10 24050001 */ addiu $a1, $zero, 1
/* 2E314 80052F14 24060834 */ addiu $a2, $zero, 0x834
/* 2E318 80052F18 3C10800A */ lui $s0, %hi(gSoundManager)
/* 2E31C 80052F1C 2610A640 */ addiu $s0, $s0, %lo(gSoundManager)
/* 2E320 80052F20 0C015FE4 */ jal alHeapAlloc
/* 2E324 80052F24 AE020000 */ sw $v0, ($s0)
/* 2E328 80052F28 02A0202D */ daddu $a0, $s5, $zero
/* 2E32C 80052F2C 24050001 */ addiu $a1, $zero, 1
/* 2E330 80052F30 8E280000 */ lw $t0, ($s1)
/* 2E334 80052F34 8E070000 */ lw $a3, ($s0)
/* 2E338 80052F38 8E430000 */ lw $v1, ($s2)
/* 2E33C 80052F3C 34068000 */ ori $a2, $zero, 0x8000
/* 2E340 80052F40 3C01800A */ lui $at, %hi(gAuAmbienceManager)
/* 2E344 80052F44 AC22A628 */ sw $v0, %lo(gAuAmbienceManager)($at)
/* 2E348 80052F48 0060A02D */ daddu $s4, $v1, $zero
/* 2E34C 80052F4C AD070004 */ sw $a3, 4($t0)
/* 2E350 80052F50 0C015FE4 */ jal alHeapAlloc
/* 2E354 80052F54 AC430000 */ sw $v1, ($v0)
/* 2E358 80052F58 0280802D */ daddu $s0, $s4, $zero
/* 2E35C 80052F5C 24435000 */ addiu $v1, $v0, 0x5000
/* 2E360 80052F60 AE82005C */ sw $v0, 0x5c($s4)
/* 2E364 80052F64 24427000 */ addiu $v0, $v0, 0x7000
/* 2E368 80052F68 AE830060 */ sw $v1, 0x60($s4)
/* 2E36C 80052F6C AE820064 */ sw $v0, 0x64($s4)
/* 2E370 80052F70 AE830068 */ sw $v1, 0x68($s4)
.L80052F74:
/* 2E374 80052F74 02A0202D */ daddu $a0, $s5, $zero
/* 2E378 80052F78 24050001 */ addiu $a1, $zero, 1
/* 2E37C 80052F7C 0C015FE4 */ jal alHeapAlloc
/* 2E380 80052F80 24060A9C */ addiu $a2, $zero, 0xa9c
/* 2E384 80052F84 AE02006C */ sw $v0, 0x6c($s0)
/* 2E388 80052F88 26730001 */ addiu $s3, $s3, 1
/* 2E38C 80052F8C 1260FFF9 */ beqz $s3, .L80052F74
/* 2E390 80052F90 26100008 */ addiu $s0, $s0, 8
/* 2E394 80052F94 02A0202D */ daddu $a0, $s5, $zero
/* 2E398 80052F98 24050001 */ addiu $a1, $zero, 1
/* 2E39C 80052F9C 0C015FE4 */ jal alHeapAlloc
/* 2E3A0 80052FA0 24065200 */ addiu $a2, $zero, 0x5200
/* 2E3A4 80052FA4 02A0202D */ daddu $a0, $s5, $zero
/* 2E3A8 80052FA8 24050001 */ addiu $a1, $zero, 1
/* 2E3AC 80052FAC 24060030 */ addiu $a2, $zero, 0x30
/* 2E3B0 80052FB0 0C015FE4 */ jal alHeapAlloc
/* 2E3B4 80052FB4 AE8200A0 */ sw $v0, 0xa0($s4)
/* 2E3B8 80052FB8 02A0202D */ daddu $a0, $s5, $zero
/* 2E3BC 80052FBC 24050001 */ addiu $a1, $zero, 1
/* 2E3C0 80052FC0 24060360 */ addiu $a2, $zero, 0x360
/* 2E3C4 80052FC4 0C015FE4 */ jal alHeapAlloc
/* 2E3C8 80052FC8 AE820004 */ sw $v0, 4($s4)
/* 2E3CC 80052FCC 02A0202D */ daddu $a0, $s5, $zero
/* 2E3D0 80052FD0 24050001 */ addiu $a1, $zero, 1
/* 2E3D4 80052FD4 24060200 */ addiu $a2, $zero, 0x200
/* 2E3D8 80052FD8 0C015FE4 */ jal alHeapAlloc
/* 2E3DC 80052FDC AE820054 */ sw $v0, 0x54($s4)
/* 2E3E0 80052FE0 02A0202D */ daddu $a0, $s5, $zero
/* 2E3E4 80052FE4 24050001 */ addiu $a1, $zero, 1
/* 2E3E8 80052FE8 24060040 */ addiu $a2, $zero, 0x40
/* 2E3EC 80052FEC 0C015FE4 */ jal alHeapAlloc
/* 2E3F0 80052FF0 AE820058 */ sw $v0, 0x58($s4)
/* 2E3F4 80052FF4 0000982D */ daddu $s3, $zero, $zero
/* 2E3F8 80052FF8 8E840004 */ lw $a0, 4($s4)
/* 2E3FC 80052FFC 44960000 */ mtc1 $s6, $f0
/* 2E400 80053000 00000000 */ nop
/* 2E404 80053004 46800020 */ cvt.s.w $f0, $f0
/* 2E408 80053008 AE820094 */ sw $v0, 0x94($s4)
/* 2E40C 8005300C 0C014CBD */ jal au_reset_instrument
/* 2E410 80053010 E6800000 */ swc1 $f0, ($s4)
/* 2E414 80053014 0C014CDC */ jal au_reset_drum_entry
/* 2E418 80053018 26840008 */ addiu $a0, $s4, 8
/* 2E41C 8005301C 0C014CEA */ jal au_reset_instrument_entry
/* 2E420 80053020 26840014 */ addiu $a0, $s4, 0x14
/* 2E424 80053024 0C015843 */ jal bgm_clear_music_events
/* 2E428 80053028 00000000 */ nop
/* 2E42C 8005302C 0280102D */ daddu $v0, $s4, $zero
/* 2E430 80053030 AE8000A4 */ sw $zero, 0xa4($s4)
/* 2E434 80053034 AE8000A8 */ sw $zero, 0xa8($s4)
.L80053038:
/* 2E438 80053038 A0400070 */ sb $zero, 0x70($v0)
/* 2E43C 8005303C A0400071 */ sb $zero, 0x71($v0)
/* 2E440 80053040 26730001 */ addiu $s3, $s3, 1
/* 2E444 80053044 1260FFFC */ beqz $s3, .L80053038
/* 2E448 80053048 24420008 */ addiu $v0, $v0, 8
/* 2E44C 8005304C 0000982D */ daddu $s3, $zero, $zero
/* 2E450 80053050 0280182D */ daddu $v1, $s4, $zero
.L80053054:
/* 2E454 80053054 A0600040 */ sb $zero, 0x40($v1)
/* 2E458 80053058 A0600041 */ sb $zero, 0x41($v1)
/* 2E45C 8005305C 26730001 */ addiu $s3, $s3, 1
/* 2E460 80053060 2E620004 */ sltiu $v0, $s3, 4
/* 2E464 80053064 1440FFFB */ bnez $v0, .L80053054
/* 2E468 80053068 24630004 */ addiu $v1, $v1, 4
/* 2E46C 8005306C 0000982D */ daddu $s3, $zero, $zero
/* 2E470 80053070 2416FFFF */ addiu $s6, $zero, -1
/* 2E474 80053074 241200FF */ addiu $s2, $zero, 0xff
/* 2E478 80053078 24111320 */ addiu $s1, $zero, 0x1320
.L8005307C:
/* 2E47C 8005307C 327000FF */ andi $s0, $s3, 0xff
/* 2E480 80053080 0200202D */ daddu $a0, $s0, $zero
/* 2E484 80053084 0C015BB0 */ jal au_pvoice_set_bus
/* 2E488 80053088 0000282D */ daddu $a1, $zero, $zero
/* 2E48C 8005308C 0200202D */ daddu $a0, $s0, $zero
/* 2E490 80053090 8E850004 */ lw $a1, 4($s4)
/* 2E494 80053094 0C015C89 */ jal au_syn_set_wavetable
/* 2E498 80053098 26730001 */ addiu $s3, $s3, 1
/* 2E49C 8005309C 02911021 */ addu $v0, $s4, $s1
/* 2E4A0 800530A0 AC400000 */ sw $zero, ($v0)
/* 2E4A4 800530A4 AC400004 */ sw $zero, 4($v0)
/* 2E4A8 800530A8 A456000C */ sh $s6, 0xc($v0)
/* 2E4AC 800530AC A052000E */ sb $s2, 0xe($v0)
/* 2E4B0 800530B0 A052000F */ sb $s2, 0xf($v0)
/* 2E4B4 800530B4 A0400010 */ sb $zero, 0x10($v0)
/* 2E4B8 800530B8 A0400042 */ sb $zero, 0x42($v0)
/* 2E4BC 800530BC A0400043 */ sb $zero, 0x43($v0)
/* 2E4C0 800530C0 A0400044 */ sh $zero, 0x44($v0)
/* 2E4C4 800530C4 A0400045 */ lui $a1, %hi(SBN_ROM_START)
/* 2E4C8 800530C8 2E620018 */ sltiu $v0, $s3, 0x18
/* 2E4CC 800530CC 1440FFEB */ bnez $v0, .L8005307C
/* 2E4D0 800530D0 26310048 */ addiu $s1, $s1, 0x48
/* 2E4D4 800530D4 0280202D */ daddu $a0, $s4, $zero
/* 2E4D8 800530D8 3C0500F0 */ addiu $a1, %lo(SBN_ROM_START)
/* 2E4DC 800530DC 0C0150AF */ jal au_load_INIT
/* 2E4E0 800530E0 02A0302D */ daddu $a2, $s5, $zero
/* 2E4E4 800530E4 0000982D */ daddu $s3, $zero, $zero
/* 2E4E8 800530E8 0280802D */ daddu $s0, $s4, $zero
.L800530EC:
/* 2E4EC 800530EC 02A0202D */ daddu $a0, $s5, $zero
/* 2E4F0 800530F0 24050001 */ addiu $a1, $zero, 1
/* 2E4F4 800530F4 0C015FE4 */ jal alHeapAlloc
/* 2E4F8 800530F8 24060840 */ addiu $a2, $zero, 0x840
/* 2E4FC 800530FC AE021310 */ sw $v0, 0x1310($s0)
/* 2E500 80053100 26730001 */ addiu $s3, $s3, 1
/* 2E504 80053104 2E620003 */ sltiu $v0, $s3, 3
/* 2E508 80053108 1440FFF8 */ bnez $v0, .L800530EC
/* 2E50C 8005310C 26100004 */ addiu $s0, $s0, 4
/* 2E510 80053110 24050001 */ addiu $a1, $zero, 1
/* 2E514 80053114 0000302D */ daddu $a2, $zero, $zero
/* 2E518 80053118 3C10800A */ lui $s0, %hi(gBGMPlayerA)
/* 2E51C 8005311C 2610A664 */ addiu $s0, $s0, %lo(gBGMPlayerA)
/* 2E520 80053120 8E040000 */ lw $a0, ($s0)
/* 2E524 80053124 0C013856 */ jal au_bgm_player_init
/* 2E528 80053128 0280382D */ daddu $a3, $s4, $zero
/* 2E52C 8005312C 27B20020 */ addiu $s2, $sp, 0x20
/* 2E530 80053130 0240282D */ daddu $a1, $s2, $zero
/* 2E534 80053134 24020003 */ addiu $v0, $zero, 3
/* 2E538 80053138 8E040000 */ lw $a0, ($s0)
/* 2E53C 8005313C 241000FF */ addiu $s0, $zero, 0xff
/* 2E540 80053140 A3A00020 */ sb $zero, 0x20($sp)
/* 2E544 80053144 A3A20021 */ sb $v0, 0x21($sp)
/* 2E548 80053148 A3B00022 */ sb $s0, 0x22($sp)
/* 2E54C 8005314C 0C0138D1 */ jal au_bgm_set_effect_indices
/* 2E550 80053150 A3B00023 */ sb $s0, 0x23($sp)
/* 2E554 80053154 24050002 */ addiu $a1, $zero, 2
/* 2E558 80053158 00A0302D */ daddu $a2, $a1, $zero
/* 2E55C 8005315C 3C11800A */ lui $s1, %hi(gBGMPlayerB)
/* 2E560 80053160 2631A5FC */ addiu $s1, $s1, %lo(gBGMPlayerB)
/* 2E564 80053164 8E240000 */ lw $a0, ($s1)
/* 2E568 80053168 0C013856 */ jal au_bgm_player_init
/* 2E56C 8005316C 0280382D */ daddu $a3, $s4, $zero
/* 2E570 80053170 0240282D */ daddu $a1, $s2, $zero
/* 2E574 80053174 8E240000 */ lw $a0, ($s1)
/* 2E578 80053178 24020002 */ addiu $v0, $zero, 2
/* 2E57C 8005317C A3A20020 */ sb $v0, 0x20($sp)
/* 2E580 80053180 A3B00021 */ sb $s0, 0x21($sp)
/* 2E584 80053184 A3B00022 */ sb $s0, 0x22($sp)
/* 2E588 80053188 0C0138D1 */ jal au_bgm_set_effect_indices
/* 2E58C 8005318C A3B00023 */ sb $s0, 0x23($sp)
/* 2E590 80053190 24050004 */ addiu $a1, $zero, 4
/* 2E594 80053194 24060001 */ addiu $a2, $zero, 1
/* 2E598 80053198 0280382D */ daddu $a3, $s4, $zero
/* 2E59C 8005319C 3C10800A */ lui $s0, %hi(gSoundManager)
/* 2E5A0 800531A0 2610A640 */ addiu $s0, $s0, %lo(gSoundManager)
/* 2E5A4 800531A4 8E040000 */ lw $a0, ($s0)
/* 2E5A8 800531A8 24020010 */ addiu $v0, $zero, 0x10
/* 2E5AC 800531AC 0C012D10 */ jal au_sfx_init
/* 2E5B0 800531B0 AFA20010 */ sw $v0, 0x10($sp)
/* 2E5B4 800531B4 24050006 */ addiu $a1, $zero, 6
/* 2E5B8 800531B8 24060001 */ addiu $a2, $zero, 1
/* 2E5BC 800531BC 3C04800A */ lui $a0, %hi(gAuAmbienceManager)
/* 2E5C0 800531C0 8C84A628 */ lw $a0, %lo(gAuAmbienceManager)($a0)
/* 2E5C4 800531C4 0C0142E4 */ jal au_amb_manager_init
/* 2E5C8 800531C8 0280382D */ daddu $a3, $s4, $zero
/* 2E5CC 800531CC 0C014985 */ jal au_init_voices
/* 2E5D0 800531D0 0280202D */ daddu $a0, $s4, $zero
/* 2E5D4 800531D4 0280202D */ daddu $a0, $s4, $zero
/* 2E5D8 800531D8 0C0153F0 */ jal au_load_BK_headers
/* 2E5DC 800531DC 02A0282D */ daddu $a1, $s5, $zero
/* 2E5E0 800531E0 8E82003C */ lw $v0, 0x3c($s4)
/* 2E5E4 800531E4 24050020 */ addiu $a1, $zero, 0x20
/* 2E5E8 800531E8 94440000 */ lhu $a0, ($v0)
/* 2E5EC 800531EC 0C01511F */ jal au_fetch_SBN_file
/* 2E5F0 800531F0 27A60018 */ addiu $a2, $sp, 0x18
/* 2E5F4 800531F4 14400007 */ bnez $v0, .L80053214
/* 2E5F8 800531F8 3C0200FF */ lui $v0, 0xff
/* 2E5FC 800531FC 3442FFFF */ ori $v0, $v0, 0xffff
/* 2E600 80053200 8FA40018 */ lw $a0, 0x18($sp)
/* 2E604 80053204 8FA6001C */ lw $a2, 0x1c($sp)
/* 2E608 80053208 8E8500A0 */ lw $a1, 0xa0($s4)
/* 2E60C 8005320C 0C015380 */ jal au_read_rom
/* 2E610 80053210 00C23024 */ and $a2, $a2, $v0
.L80053214:
/* 2E614 80053214 8E040000 */ lw $a0, ($s0)
/* 2E618 80053218 0C012D8B */ jal au_sfx_load_groups_from_SEF
/* 2E61C 8005321C 00000000 */ nop
/* 2E620 80053220 8E82003C */ lw $v0, 0x3c($s4)
/* 2E624 80053224 24050040 */ addiu $a1, $zero, 0x40
/* 2E628 80053228 94440002 */ lhu $a0, 2($v0)
/* 2E62C 8005322C 0C01511F */ jal au_fetch_SBN_file
/* 2E630 80053230 27A60018 */ addiu $a2, $sp, 0x18
/* 2E634 80053234 14400004 */ bnez $v0, .L80053248
/* 2E638 80053238 00000000 */ nop
/* 2E63C 8005323C 8FA50018 */ lw $a1, 0x18($sp)
/* 2E640 80053240 0C01513E */ jal au_load_PER
/* 2E644 80053244 0280202D */ daddu $a0, $s4, $zero
.L80053248:
/* 2E648 80053248 8E82003C */ lw $v0, 0x3c($s4)
/* 2E64C 8005324C 24050040 */ addiu $a1, $zero, 0x40
/* 2E650 80053250 94440004 */ lhu $a0, 4($v0)
/* 2E654 80053254 0C01511F */ jal au_fetch_SBN_file
/* 2E658 80053258 27A60018 */ addiu $a2, $sp, 0x18
/* 2E65C 8005325C 54400005 */ bnel $v0, $zero, .L80053274
/* 2E660 80053260 0000202D */ daddu $a0, $zero, $zero
/* 2E664 80053264 8FA50018 */ lw $a1, 0x18($sp)
/* 2E668 80053268 0C01516D */ jal au_load_PRG
/* 2E66C 8005326C 0280202D */ daddu $a0, $s4, $zero
/* 2E670 80053270 0000202D */ daddu $a0, $zero, $zero
.L80053274:
/* 2E674 80053274 268304EC */ addiu $v1, $s4, 0x4ec
/* 2E678 80053278 268205EC */ addiu $v0, $s4, 0x5ec
/* 2E67C 8005327C AE8212F0 */ sw $v0, 0x12f0($s4)
/* 2E680 80053280 268200AC */ addiu $v0, $s4, 0xac
/* 2E684 80053284 AE8212F4 */ sw $v0, 0x12f4($s4)
/* 2E688 80053288 268200EC */ addiu $v0, $s4, 0xec
/* 2E68C 8005328C AE8212F8 */ sw $v0, 0x12f8($s4)
/* 2E690 80053290 268209EC */ addiu $v0, $s4, 0x9ec
/* 2E694 80053294 AE8212FC */ sw $v0, 0x12fc($s4)
/* 2E698 80053298 26820DEC */ addiu $v0, $s4, 0xdec
/* 2E69C 8005329C AE821300 */ sw $v0, 0x1300($s4)
/* 2E6A0 800532A0 268211EC */ addiu $v0, $s4, 0x11ec
/* 2E6A4 800532A4 AE8312EC */ sw $v1, 0x12ec($s4)
/* 2E6A8 800532A8 AE821304 */ sw $v0, 0x1304($s4)
/* 2E6AC 800532AC AE831308 */ sw $v1, 0x1308($s4)
/* 2E6B0 800532B0 A2800053 */ sb $zero, 0x53($s4)
/* 2E6B4 800532B4 A2800052 */ sb $zero, 0x52($s4)
/* 2E6B8 800532B8 A2800051 */ sb $zero, 0x51($s4)
/* 2E6BC 800532BC 0C015FB4 */ jal au_delay_channel
/* 2E6C0 800532C0 A2800050 */ sb $zero, 0x50($s4)
/* 2E6C4 800532C4 0C015414 */ jal func_80055050
/* 2E6C8 800532C8 02A0202D */ daddu $a0, $s5, $zero
/* 2E6CC 800532CC 8FBF0044 */ lw $ra, 0x44($sp)
/* 2E6D0 800532D0 8FB60040 */ lw $s6, 0x40($sp)
/* 2E6D4 800532D4 8FB5003C */ lw $s5, 0x3c($sp)
/* 2E6D8 800532D8 8FB40038 */ lw $s4, 0x38($sp)
/* 2E6DC 800532DC 8FB30034 */ lw $s3, 0x34($sp)
/* 2E6E0 800532E0 8FB20030 */ lw $s2, 0x30($sp)
/* 2E6E4 800532E4 8FB1002C */ lw $s1, 0x2c($sp)
/* 2E6E8 800532E8 8FB00028 */ lw $s0, 0x28($sp)
/* 2E6EC 800532EC 03E00008 */ jr $ra
/* 2E6F0 800532F0 27BD0048 */ addiu $sp, $sp, 0x48

View File

@ -1,38 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel dma_load_msg
addiu $sp,$sp,-40
sw $s0,24($sp)
move $s0,$a0
sw $s2,32($sp)
move $s2,$a1
sw $s1,28($sp)
lui $s1,%hi(msg_ROM_START)
addiu $s1,$s1,%lo(msg_ROM_START)
srl $v0,$s0,0xe
addu $a0,$v0,$s1
addiu $a1,$a0,4
sw $ra,36($sp)
jal dma_copy
addiu $a2,$sp,16
addiu $a2,$sp,16
andi $s0,$s0,0xffff
sll $s0,$s0,0x2
lw $v0,16($sp)
addu $s0,$s0,$s1
addu $a0,$v0,$s0
jal dma_copy
addiu $a1,$a0,8
move $a2,$s2
lw $a0,16($sp)
lw $a1,20($sp)
addu $a0,$a0,$s1
jal dma_copy
addu $a1,$a1,$s1
lw $ra,36($sp)
lw $s2,32($sp)
lw $s1,28($sp)
lw $s0,24($sp)
jr $ra
addiu $sp,$sp,40

View File

@ -1,58 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel get_asset_offset
/* 361D0 8005ADD0 27BDFFB8 */ addiu $sp, $sp, -0x48
/* 361D4 8005ADD4 AFB20038 */ sw $s2, 0x38($sp)
/* 361D8 8005ADD8 0080902D */ daddu $s2, $a0, $zero
/* 361DC 8005ADDC AFB3003C */ sw $s3, 0x3c($sp)
/* 361E0 8005ADE0 00A0982D */ daddu $s3, $a1, $zero
/* 361E4 8005ADE4 3C0401E4 */ lui $a0, %hi(mapfs_ROM_START + 0x20)
/* 361E8 8005ADE8 34840020 */ addiu $a0, $a0, %lo(mapfs_ROM_START + 0x20)
/* 361EC 8005ADEC 3C0501E4 */ lui $a1, %hi(mapfs_ROM_START + 0x3C)
/* 361F0 8005ADF0 34A5003C */ addiu $a1, $a1, %lo(mapfs_ROM_START + 0x3C)
/* 361F4 8005ADF4 27A60010 */ addiu $a2, $sp, 0x10
/* 361F8 8005ADF8 AFBF0040 */ sw $ra, 0x40($sp)
/* 361FC 8005ADFC AFB10034 */ sw $s1, 0x34($sp)
/* 36200 8005AE00 0C00A5CF */ jal dma_copy
/* 36204 8005AE04 AFB00030 */ sw $s0, 0x30($sp)
/* 36208 8005AE08 8FA40020 */ lw $a0, 0x20($sp)
/* 3620C 8005AE0C 0C00AB39 */ jal heap_malloc
/* 36210 8005AE10 00000000 */ nop
/* 36214 8005AE14 0040882D */ daddu $s1, $v0, $zero
/* 36218 8005AE18 0220802D */ daddu $s0, $s1, $zero
/* 3621C 8005AE1C 3C0201E4 */ lui $v0, %hi(mapfs_ROM_START + 0x20)
/* 36220 8005AE20 34420020 */ addiu $v0, $v0, %lo(mapfs_ROM_START + 0x20)
/* 36224 8005AE24 3C0401E4 */ lui $a0, %hi(mapfs_ROM_START + 0x20)
/* 36228 8005AE28 34840020 */ addiu $a0, $a0, %lo(mapfs_ROM_START + 0x20)
/* 3622C 8005AE2C 8FA50020 */ lw $a1, 0x20($sp)
/* 36230 8005AE30 0220302D */ daddu $a2, $s1, $zero
/* 36234 8005AE34 0C00A5CF */ jal dma_copy
/* 36238 8005AE38 00A22821 */ addu $a1, $a1, $v0
.L8005AE3C:
/* 3623C 8005AE3C 0200202D */ daddu $a0, $s0, $zero
/* 36240 8005AE40 0C01BB5C */ jal strcmp
/* 36244 8005AE44 0240282D */ daddu $a1, $s2, $zero
/* 36248 8005AE48 10400003 */ beqz $v0, .L8005AE58
/* 3624C 8005AE4C 3C0301E4 */ lui $v1, %hi(mapfs_ROM_START + 0x20)
/* 36250 8005AE50 08016B8F */ j .L8005AE3C
/* 36254 8005AE54 2610001C */ addiu $s0, $s0, 0x1c
.L8005AE58:
/* 36258 8005AE58 8E020014 */ lw $v0, 0x14($s0)
/* 3625C 8005AE5C 34630020 */ addiu $v1, $v1, %lo(mapfs_ROM_START + 0x20)
/* 36260 8005AE60 AE620000 */ sw $v0, ($s3)
/* 36264 8005AE64 8E100010 */ lw $s0, 0x10($s0)
/* 36268 8005AE68 0220202D */ daddu $a0, $s1, $zero
/* 3626C 8005AE6C 0C00AB4B */ jal heap_free
/* 36270 8005AE70 02038021 */ addu $s0, $s0, $v1
/* 36274 8005AE74 0200102D */ daddu $v0, $s0, $zero
/* 36278 8005AE78 8FBF0040 */ lw $ra, 0x40($sp)
/* 3627C 8005AE7C 8FB3003C */ lw $s3, 0x3c($sp)
/* 36280 8005AE80 8FB20038 */ lw $s2, 0x38($sp)
/* 36284 8005AE84 8FB10034 */ lw $s1, 0x34($sp)
/* 36288 8005AE88 8FB00030 */ lw $s0, 0x30($sp)
/* 3628C 8005AE8C 03E00008 */ jr $ra
/* 36290 8005AE90 27BD0048 */ addiu $sp, $sp, 0x48
/* 36294 8005AE94 00000000 */ nop
/* 36298 8005AE98 00000000 */ nop
/* 3629C 8005AE9C 00000000 */ nop

View File

@ -1,64 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel load_asset_by_name
/* 360E8 8005ACE8 27BDFFB8 */ addiu $sp, $sp, -0x48
/* 360EC 8005ACEC AFB00030 */ sw $s0, 0x30($sp)
/* 360F0 8005ACF0 0080802D */ daddu $s0, $a0, $zero
/* 360F4 8005ACF4 AFB3003C */ sw $s3, 0x3c($sp)
/* 360F8 8005ACF8 00A0982D */ daddu $s3, $a1, $zero
/* 360FC 8005ACFC 3C0401E4 */ lui $a0, %hi(mapfs_ROM_START + 0x20)
/* 36100 8005AD00 34840020 */ addiu $a0, $a0, %lo(mapfs_ROM_START + 0x20)
/* 36104 8005AD04 3C0501E4 */ lui $a1, %hi(mapfs_ROM_START + 0x3C)
/* 36108 8005AD08 34A5003C */ addiu $a1, $a1, %lo(mapfs_ROM_START + 0x3C)
/* 3610C 8005AD0C 27A60010 */ addiu $a2, $sp, 0x10
/* 36110 8005AD10 AFBF0040 */ sw $ra, 0x40($sp)
/* 36114 8005AD14 AFB20038 */ sw $s2, 0x38($sp)
/* 36118 8005AD18 0C00A5CF */ jal dma_copy
/* 3611C 8005AD1C AFB10034 */ sw $s1, 0x34($sp)
/* 36120 8005AD20 8FA40020 */ lw $a0, 0x20($sp)
/* 36124 8005AD24 0C00AB39 */ jal heap_malloc
/* 36128 8005AD28 00000000 */ nop
/* 3612C 8005AD2C 0040902D */ daddu $s2, $v0, $zero
/* 36130 8005AD30 0240882D */ daddu $s1, $s2, $zero
/* 36134 8005AD34 3C0201E4 */ lui $v0, %hi(mapfs_ROM_START + 0x20)
/* 36138 8005AD38 34420020 */ addiu $v0, $v0, %lo(mapfs_ROM_START + 0x20)
/* 3613C 8005AD3C 3C0401E4 */ lui $a0, %hi(mapfs_ROM_START + 0x20)
/* 36140 8005AD40 34840020 */ addiu $a0, $a0, %lo(mapfs_ROM_START + 0x20)
/* 36144 8005AD44 8FA50020 */ lw $a1, 0x20($sp)
/* 36148 8005AD48 0240302D */ daddu $a2, $s2, $zero
/* 3614C 8005AD4C 0C00A5CF */ jal dma_copy
/* 36150 8005AD50 00A22821 */ addu $a1, $a1, $v0
.L8005AD54:
/* 36154 8005AD54 0220202D */ daddu $a0, $s1, $zero
/* 36158 8005AD58 0C01BB5C */ jal strcmp
/* 3615C 8005AD5C 0200282D */ daddu $a1, $s0, $zero
/* 36160 8005AD60 10400003 */ beqz $v0, .L8005AD70
/* 36164 8005AD64 00000000 */ nop
/* 36168 8005AD68 08016B55 */ j .L8005AD54
/* 3616C 8005AD6C 2631001C */ addiu $s1, $s1, 0x1c
.L8005AD70:
/* 36170 8005AD70 8E220018 */ lw $v0, 0x18($s1)
/* 36174 8005AD74 AE620000 */ sw $v0, ($s3)
/* 36178 8005AD78 0C00AB0A */ jal general_heap_malloc
/* 3617C 8005AD7C 8E240014 */ lw $a0, 0x14($s1)
/* 36180 8005AD80 3C0301E4 */ lui $v1, %hi(mapfs_ROM_START + 0x20)
/* 36184 8005AD84 34630020 */ addiu $v1, $v1, %lo(mapfs_ROM_START + 0x20)
/* 36188 8005AD88 0040802D */ daddu $s0, $v0, $zero
/* 3618C 8005AD8C 0040302D */ daddu $a2, $v0, $zero
/* 36190 8005AD90 8E220010 */ lw $v0, 0x10($s1)
/* 36194 8005AD94 8E250014 */ lw $a1, 0x14($s1)
/* 36198 8005AD98 00432021 */ addu $a0, $v0, $v1
/* 3619C 8005AD9C 00A32821 */ addu $a1, $a1, $v1
/* 361A0 8005ADA0 0C00A5CF */ jal dma_copy
/* 361A4 8005ADA4 00452821 */ addu $a1, $v0, $a1
/* 361A8 8005ADA8 0C00AB4B */ jal heap_free
/* 361AC 8005ADAC 0240202D */ daddu $a0, $s2, $zero
/* 361B0 8005ADB0 0200102D */ daddu $v0, $s0, $zero
/* 361B4 8005ADB4 8FBF0040 */ lw $ra, 0x40($sp)
/* 361B8 8005ADB8 8FB3003C */ lw $s3, 0x3c($sp)
/* 361BC 8005ADBC 8FB20038 */ lw $s2, 0x38($sp)
/* 361C0 8005ADC0 8FB10034 */ lw $s1, 0x34($sp)
/* 361C4 8005ADC4 8FB00030 */ lw $s0, 0x30($sp)
/* 361C8 8005ADC8 03E00008 */ jr $ra
/* 361CC 8005ADCC 27BD0048 */ addiu $sp, $sp, 0x48

View File

@ -380,7 +380,7 @@ segments:
type: code type: code
start: 0x759B0 start: 0x759B0
vram: 0x800DC500 vram: 0x800DC500
vram_of_symbol: D_804DC500 vram_of_symbol: overlays_start
#follows_vram: main #follows_vram: main
subsegments: subsegments:
- [0x759B0, hasm, bss2] - [0x759B0, hasm, bss2]
@ -2596,7 +2596,7 @@ segments:
- [0x2435F0, ia8, title/tape, 128, 128] - [0x2435F0, ia8, title/tape, 128, 128]
- [0x2475F0, ci8, title/bowser_silhouette, 128, 128] - [0x2475F0, ci8, title/bowser_silhouette, 128, 128]
- [0x24B5F0, palette, title/bowser_silhouette] - [0x24B5F0, palette, title/bowser_silhouette]
- [0x24B7F0, bin] - [0x24B7F0, bin, fold_gfx_data] # TODO extract into better format?
- [0x315B80, pm_sprite_shading_profiles, sprite_shading_profiles] - [0x315B80, pm_sprite_shading_profiles, sprite_shading_profiles]
- type: code - type: code
start: 0x3169F0 start: 0x3169F0

View File

@ -4,7 +4,7 @@ gMapShapeData = 0x80210000; // needs to be hard-coded atm due to pointers in sha
heap_battleHead = gFrameBuf2; heap_battleHead = gFrameBuf2;
D_804DC500 = 0x804DC500; overlays_start = 0x802DC500;
fx_sun_undeclared = fx_sun; fx_sun_undeclared = fx_sun;