mirror of
https://github.com/pmret/papermario.git
synced 2024-11-09 12:32:38 +01:00
some pause BSS, some api deduplication (#363)
* move some pause bss out of undefined_syms * dedup LoadPartyImage * dedup StashVars.inc.c a bit * put BSS attribute at start of line
This commit is contained in:
parent
25dcbe4b92
commit
bd529b6edb
@ -176,7 +176,10 @@ extern s32 gPauseMenuHeldButtons;
|
||||
extern s32 gPauseMenuPressedButtons;
|
||||
extern s32 gPauseMenuCurrentDescString;
|
||||
extern s32* gPauseMenuCurrentDescIconScript;
|
||||
extern s32 D_802700D0;
|
||||
extern s8 gPauseMenuCurrentTab;
|
||||
extern char D_802700D[8];
|
||||
extern s32 D_802700E0;
|
||||
extern s32 gPauseMenuCommonIconIDs[8];
|
||||
extern s32 gPauseMenuTabIconIDs[6];
|
||||
extern s32 gPauseMenuStrings[348];
|
||||
|
@ -38,7 +38,7 @@ Gfx D_80074230[] = {
|
||||
};
|
||||
|
||||
// BSS
|
||||
extern s32 timeFreezeMode BSS;
|
||||
extern BSS s32 timeFreezeMode;
|
||||
|
||||
extern s16 D_8009A690;
|
||||
|
||||
|
@ -1,7 +1,17 @@
|
||||
#include "common.h"
|
||||
|
||||
BSS s32 gPauseMenuHeldButtons;
|
||||
BSS s32 gPauseMenuPressedButtons;
|
||||
BSS s32 gPauseMenuCurrentDescString;
|
||||
BSS s32* gPauseMenuCurrentDescIconScript;
|
||||
BSS s32 D_802700D0;
|
||||
BSS s8 gPauseMenuCurrentTab;
|
||||
BSS char D_802700D[8];
|
||||
BSS s32 D_802700E0;
|
||||
#define BSS_END 0x802700E4
|
||||
|
||||
// TODO this is the bss for the whole segment - break it up
|
||||
static char bss[0x8580];
|
||||
static char bss[0x80278640 - BSS_END];
|
||||
|
||||
// Need data segment and vars declared above
|
||||
#ifdef NON_MATCHING
|
||||
|
@ -91,7 +91,209 @@ NpcSettings N(npcSettings_80241C3C) = {
|
||||
.level = 99,
|
||||
};
|
||||
|
||||
s32** N(D_80241C68_BE09F8) = NULL;
|
||||
#include "world/common/UnkNpcAIFunc24.inc.c"
|
||||
|
||||
#include "world/common/UnkFunc13.inc.c"
|
||||
|
||||
#include "world/common/UnkNpcAIFunc1.inc.c"
|
||||
|
||||
#include "world/common/UnkFunc14.inc.c"
|
||||
|
||||
#include "world/common/UnkNpcAIFunc25.inc.c"
|
||||
|
||||
#include "world/common/NpcJumpFunc2.inc.c"
|
||||
|
||||
#include "world/common/NpcJumpFunc.inc.c"
|
||||
|
||||
#include "world/common/UnkNpcAIFunc13.inc.c"
|
||||
|
||||
#include "world/common/UnkFunc15.inc.c"
|
||||
|
||||
#include "world/common/UnkNpcDurationFlagFunc.inc.c"
|
||||
|
||||
#include "world/common/UnkFunc16.inc.c"
|
||||
|
||||
ApiStatus N(func_80240B94_BDF924)(ScriptInstance* script, s32 isInitialCall) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
||||
Bytecode* args = script->ptrReadPos;
|
||||
EnemyTerritoryThing territory;
|
||||
EnemyTerritoryThing* territoryPtr = &territory;
|
||||
NpcAISettings* npcAISettings = (NpcAISettings*)get_variable(script, *args++);
|
||||
f32 posX, posY, posZ, posW;
|
||||
|
||||
territory.unk_00 = 0;
|
||||
territory.shape = enemy->territory->patrol.detectShape;
|
||||
territory.pointX = enemy->territory->patrol.detect.x;
|
||||
territory.pointZ = enemy->territory->patrol.detect.z;
|
||||
territory.sizeX = enemy->territory->patrol.detectSizeX;
|
||||
territory.sizeZ = enemy->territory->patrol.detectSizeZ;
|
||||
territory.unk_18 = 65.0f;
|
||||
territory.unk_1C = 0;
|
||||
|
||||
if (isInitialCall || enemy->unk_B0 & 4) {
|
||||
script->functionTemp[0] = 0;
|
||||
npc->duration = 0;
|
||||
npc->currentAnim.w = enemy->animList[0];
|
||||
npc->flags &= ~0x800;
|
||||
if (!enemy->territory->patrol.isFlying) {
|
||||
npc->flags = (npc->flags | 0x200) & ~8;
|
||||
} else {
|
||||
npc->flags = (npc->flags & ~0x200) | 8;
|
||||
}
|
||||
|
||||
if (enemy->unk_B0 & 4) {
|
||||
script->functionTemp[0] = 99;
|
||||
script->functionTemp[1] = 0;
|
||||
enemy->unk_B0 &= ~4;
|
||||
} else if (enemy->flags & 0x40000000) {
|
||||
script->functionTemp[0] = 12;
|
||||
enemy->flags &= ~0x40000000;
|
||||
}
|
||||
|
||||
posX = npc->pos.x;
|
||||
posY = npc->pos.y + npc->collisionHeight;
|
||||
posZ = npc->pos.z;
|
||||
posW = 100.0f;
|
||||
|
||||
if (npc_raycast_down_sides(npc->unk_80, &posX, &posY, &posZ, &posW)) {
|
||||
npc->pos.y = posY;
|
||||
}
|
||||
}
|
||||
|
||||
switch (script->functionTemp[0]) {
|
||||
case 0:
|
||||
N(UnkNpcAIFunc24)(script, npcAISettings, territoryPtr);
|
||||
case 1:
|
||||
N(UnkFunc13)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 2:
|
||||
N(UnkNpcAIFunc1)(script, npcAISettings, territoryPtr);
|
||||
case 3:
|
||||
N(UnkFunc14)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 4:
|
||||
N(UnkNpcAIFunc25)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 10:
|
||||
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
||||
case 11:
|
||||
N(NpcJumpFunc)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 12:
|
||||
N(UnkNpcAIFunc13)(script, npcAISettings, territoryPtr);
|
||||
case 13:
|
||||
N(UnkFunc15)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 14:
|
||||
N(UnkNpcDurationFlagFunc)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 15:
|
||||
N(UnkFunc16)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 99:
|
||||
func_8004A73C(script);
|
||||
}
|
||||
return ApiStatus_BLOCK;
|
||||
}
|
||||
|
||||
void N(func_80240E90_BDFC20)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
||||
f32 posX, posY, posZ, posW;
|
||||
f32 temp_f20;
|
||||
f32 temp_f22;
|
||||
|
||||
posX = npc->pos.x;
|
||||
posZ = npc->pos.z;
|
||||
temp_f22 = (*(enemy->territory->patrol.points + script->functionTemp[2])).x;
|
||||
temp_f20 = (*(enemy->territory->patrol.points + script->functionTemp[2])).z;
|
||||
|
||||
npc->yaw = atan2(posX, posZ, temp_f22, temp_f20);
|
||||
npc_move_heading(npc, npc->moveSpeed, npc->yaw);
|
||||
|
||||
posX = npc->pos.x;
|
||||
posY = npc->pos.y + (*(enemy->territory->patrol.points + script->functionTemp[2])).y;
|
||||
posZ = npc->pos.z;
|
||||
posW = 1000.0f;
|
||||
npc_raycast_down_sides(npc->unk_80, &posX, &posY, &posZ, &posW);
|
||||
posY += (*(enemy->territory->patrol.points + script->functionTemp[2])).y;
|
||||
posW = posY - npc->pos.y;
|
||||
if (posW > 2.0) {
|
||||
npc->pos.y += 2.0;
|
||||
} else if (posW < -2.0) {
|
||||
npc->pos.y -= 2.0;
|
||||
} else {
|
||||
npc->pos.y = posY;
|
||||
}
|
||||
|
||||
posW = dist2D(npc->pos.x, npc->pos.z, temp_f22, temp_f20);
|
||||
if (!(posW > npc->moveSpeed)) {
|
||||
script->functionTemp[0] = 2;
|
||||
}
|
||||
}
|
||||
|
||||
void N(func_80241068_BDFDF8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
||||
|
||||
npc->duration--;
|
||||
if (npc->duration < 0) {
|
||||
script->functionTemp[1]--;
|
||||
if (script->functionTemp[1] >= 0) {
|
||||
npc->yaw = clamp_angle(npc->yaw + 180.0f);
|
||||
npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1);
|
||||
} else {
|
||||
script->functionTemp[0] = 4;
|
||||
npc->currentAnim.w = enemy->animList[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ApiStatus N(func_8024113C_BDFECC)(ScriptInstance* script, s32 isInitialCall) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Bytecode* args = script->ptrReadPos;
|
||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
||||
EnemyTerritoryThing territory;
|
||||
EnemyTerritoryThing* territoryPtr = &territory;
|
||||
NpcAISettings* npcAISettings = (NpcAISettings*)get_variable(script, *args++);
|
||||
|
||||
territory.unk_00 = 0;
|
||||
territory.shape = enemy->territory->patrol.detectShape;
|
||||
territory.pointX = enemy->territory->patrol.detect.x;
|
||||
territory.pointZ = enemy->territory->patrol.detect.z;
|
||||
territory.sizeX = enemy->territory->patrol.detectSizeX;
|
||||
territory.sizeZ = enemy->territory->patrol.detectSizeZ;
|
||||
territory.unk_18 = 100.0f;
|
||||
territory.unk_1C = 0;
|
||||
|
||||
if (isInitialCall) {
|
||||
script->functionTemp[0] = 0;
|
||||
npc->duration = 0;
|
||||
npc->flags &= ~0x800;
|
||||
}
|
||||
|
||||
switch (script->functionTemp[0]) {
|
||||
case 0:
|
||||
N(UnkNpcAIFunc24)(script, npcAISettings, territoryPtr);
|
||||
case 1:
|
||||
N(func_80240E90_BDFC20)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 2:
|
||||
N(UnkNpcAIFunc1)(script, npcAISettings, territoryPtr);
|
||||
case 3:
|
||||
N(func_80241068_BDFDF8)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 4:
|
||||
N(UnkNpcAIFunc25)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
}
|
||||
|
||||
enemy->varTable[0] = npc->pos.y;
|
||||
return ApiStatus_BLOCK;
|
||||
}
|
||||
|
||||
#include "world/common/StashVars.inc.c"
|
||||
|
||||
Script N(80241C6C) = SCRIPT({
|
||||
ShowGotItem(SI_VAR(0), 1, 0);
|
||||
@ -857,227 +1059,6 @@ Script N(makeEntities) = SCRIPT({
|
||||
MakeEntity(0x802E9A18, 250, 237, 125, 0, MAKE_ENTITY_END);
|
||||
});
|
||||
|
||||
#include "world/common/UnkNpcAIFunc24.inc.c"
|
||||
|
||||
#include "world/common/UnkFunc13.inc.c"
|
||||
|
||||
#include "world/common/UnkNpcAIFunc1.inc.c"
|
||||
|
||||
#include "world/common/UnkFunc14.inc.c"
|
||||
|
||||
#include "world/common/UnkNpcAIFunc25.inc.c"
|
||||
|
||||
#include "world/common/NpcJumpFunc2.inc.c"
|
||||
|
||||
#include "world/common/NpcJumpFunc.inc.c"
|
||||
|
||||
#include "world/common/UnkNpcAIFunc13.inc.c"
|
||||
|
||||
#include "world/common/UnkFunc15.inc.c"
|
||||
|
||||
#include "world/common/UnkNpcDurationFlagFunc.inc.c"
|
||||
|
||||
#include "world/common/UnkFunc16.inc.c"
|
||||
|
||||
ApiStatus N(func_80240B94_BDF924)(ScriptInstance* script, s32 isInitialCall) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
||||
Bytecode* args = script->ptrReadPos;
|
||||
EnemyTerritoryThing territory;
|
||||
EnemyTerritoryThing* territoryPtr = &territory;
|
||||
NpcAISettings* npcAISettings = (NpcAISettings*)get_variable(script, *args++);
|
||||
f32 posX, posY, posZ, posW;
|
||||
|
||||
territory.unk_00 = 0;
|
||||
territory.shape = enemy->territory->patrol.detectShape;
|
||||
territory.pointX = enemy->territory->patrol.detect.x;
|
||||
territory.pointZ = enemy->territory->patrol.detect.z;
|
||||
territory.sizeX = enemy->territory->patrol.detectSizeX;
|
||||
territory.sizeZ = enemy->territory->patrol.detectSizeZ;
|
||||
territory.unk_18 = 65.0f;
|
||||
territory.unk_1C = 0;
|
||||
|
||||
if (isInitialCall || enemy->unk_B0 & 4) {
|
||||
script->functionTemp[0] = 0;
|
||||
npc->duration = 0;
|
||||
npc->currentAnim.w = enemy->animList[0];
|
||||
npc->flags &= ~0x800;
|
||||
if (!enemy->territory->patrol.isFlying) {
|
||||
npc->flags = (npc->flags | 0x200) & ~8;
|
||||
} else {
|
||||
npc->flags = (npc->flags & ~0x200) | 8;
|
||||
}
|
||||
|
||||
if (enemy->unk_B0 & 4) {
|
||||
script->functionTemp[0] = 99;
|
||||
script->functionTemp[1] = 0;
|
||||
enemy->unk_B0 &= ~4;
|
||||
} else if (enemy->flags & 0x40000000) {
|
||||
script->functionTemp[0] = 12;
|
||||
enemy->flags &= ~0x40000000;
|
||||
}
|
||||
|
||||
posX = npc->pos.x;
|
||||
posY = npc->pos.y + npc->collisionHeight;
|
||||
posZ = npc->pos.z;
|
||||
posW = 100.0f;
|
||||
|
||||
if (npc_raycast_down_sides(npc->unk_80, &posX, &posY, &posZ, &posW)) {
|
||||
npc->pos.y = posY;
|
||||
}
|
||||
}
|
||||
|
||||
switch (script->functionTemp[0]) {
|
||||
case 0:
|
||||
N(UnkNpcAIFunc24)(script, npcAISettings, territoryPtr);
|
||||
case 1:
|
||||
N(UnkFunc13)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 2:
|
||||
N(UnkNpcAIFunc1)(script, npcAISettings, territoryPtr);
|
||||
case 3:
|
||||
N(UnkFunc14)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 4:
|
||||
N(UnkNpcAIFunc25)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 10:
|
||||
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
||||
case 11:
|
||||
N(NpcJumpFunc)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 12:
|
||||
N(UnkNpcAIFunc13)(script, npcAISettings, territoryPtr);
|
||||
case 13:
|
||||
N(UnkFunc15)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 14:
|
||||
N(UnkNpcDurationFlagFunc)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 15:
|
||||
N(UnkFunc16)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 99:
|
||||
func_8004A73C(script);
|
||||
}
|
||||
return ApiStatus_BLOCK;
|
||||
}
|
||||
|
||||
void N(func_80240E90_BDFC20)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
||||
f32 posX, posY, posZ, posW;
|
||||
f32 temp_f20;
|
||||
f32 temp_f22;
|
||||
|
||||
posX = npc->pos.x;
|
||||
posZ = npc->pos.z;
|
||||
temp_f22 = (*(enemy->territory->patrol.points + script->functionTemp[2])).x;
|
||||
temp_f20 = (*(enemy->territory->patrol.points + script->functionTemp[2])).z;
|
||||
|
||||
npc->yaw = atan2(posX, posZ, temp_f22, temp_f20);
|
||||
npc_move_heading(npc, npc->moveSpeed, npc->yaw);
|
||||
|
||||
posX = npc->pos.x;
|
||||
posY = npc->pos.y + (*(enemy->territory->patrol.points + script->functionTemp[2])).y;
|
||||
posZ = npc->pos.z;
|
||||
posW = 1000.0f;
|
||||
npc_raycast_down_sides(npc->unk_80, &posX, &posY, &posZ, &posW);
|
||||
posY += (*(enemy->territory->patrol.points + script->functionTemp[2])).y;
|
||||
posW = posY - npc->pos.y;
|
||||
if (posW > 2.0) {
|
||||
npc->pos.y += 2.0;
|
||||
} else if (posW < -2.0) {
|
||||
npc->pos.y -= 2.0;
|
||||
} else {
|
||||
npc->pos.y = posY;
|
||||
}
|
||||
|
||||
posW = dist2D(npc->pos.x, npc->pos.z, temp_f22, temp_f20);
|
||||
if (!(posW > npc->moveSpeed)) {
|
||||
script->functionTemp[0] = 2;
|
||||
}
|
||||
}
|
||||
|
||||
void N(func_80241068_BDFDF8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
||||
|
||||
npc->duration--;
|
||||
if (npc->duration < 0) {
|
||||
script->functionTemp[1]--;
|
||||
if (script->functionTemp[1] >= 0) {
|
||||
npc->yaw = clamp_angle(npc->yaw + 180.0f);
|
||||
npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1);
|
||||
} else {
|
||||
script->functionTemp[0] = 4;
|
||||
npc->currentAnim.w = enemy->animList[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ApiStatus N(func_8024113C_BDFECC)(ScriptInstance* script, s32 isInitialCall) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Bytecode* args = script->ptrReadPos;
|
||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
||||
EnemyTerritoryThing territory;
|
||||
EnemyTerritoryThing* territoryPtr = &territory;
|
||||
NpcAISettings* npcAISettings = (NpcAISettings*)get_variable(script, *args++);
|
||||
|
||||
territory.unk_00 = 0;
|
||||
territory.shape = enemy->territory->patrol.detectShape;
|
||||
territory.pointX = enemy->territory->patrol.detect.x;
|
||||
territory.pointZ = enemy->territory->patrol.detect.z;
|
||||
territory.sizeX = enemy->territory->patrol.detectSizeX;
|
||||
territory.sizeZ = enemy->territory->patrol.detectSizeZ;
|
||||
territory.unk_18 = 100.0f;
|
||||
territory.unk_1C = 0;
|
||||
|
||||
if (isInitialCall) {
|
||||
script->functionTemp[0] = 0;
|
||||
npc->duration = 0;
|
||||
npc->flags &= ~0x800;
|
||||
}
|
||||
|
||||
switch (script->functionTemp[0]) {
|
||||
case 0:
|
||||
N(UnkNpcAIFunc24)(script, npcAISettings, territoryPtr);
|
||||
case 1:
|
||||
N(func_80240E90_BDFC20)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 2:
|
||||
N(UnkNpcAIFunc1)(script, npcAISettings, territoryPtr);
|
||||
case 3:
|
||||
N(func_80241068_BDFDF8)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 4:
|
||||
N(UnkNpcAIFunc25)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
}
|
||||
|
||||
enemy->varTable[0] = npc->pos.y;
|
||||
return ApiStatus_BLOCK;
|
||||
}
|
||||
|
||||
/// Pushes/pops script local variables to D_80241C68_BE09F8
|
||||
ApiStatus N(func_802412B0_BE0040)(ScriptInstance* script, s32 isInitialCall) {
|
||||
s32 i;
|
||||
|
||||
if (N(D_80241C68_BE09F8) == NULL) {
|
||||
N(D_80241C68_BE09F8) = heap_malloc(16 * sizeof(s32));
|
||||
for (i = 0; i < 16; i++) {
|
||||
N(D_80241C68_BE09F8)[i] = script->varTable[i];
|
||||
}
|
||||
} else {
|
||||
for (i = 0; i < 16; i++) {
|
||||
script->varTable[i] = N(D_80241C68_BE09F8)[i];
|
||||
}
|
||||
heap_free(N(D_80241C68_BE09F8));
|
||||
N(D_80241C68_BE09F8) = NULL;
|
||||
}
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
#include "world/common/GetItemName.inc.c"
|
||||
|
||||
#include "world/common/GetNpcCollisionHeight.inc.c"
|
||||
|
@ -80,7 +80,7 @@ Script N(main) = SCRIPT({
|
||||
spawn N(enterSingleDoor_80240474);
|
||||
});
|
||||
|
||||
s32** N(D_80240620_C3D6A0) = NULL;
|
||||
#include "world/common/StashVars.inc.c"
|
||||
|
||||
Script N(80240624) = SCRIPT({
|
||||
group 0;
|
||||
@ -191,24 +191,6 @@ NpcGroupList N(npcGroupList_80240B44) = {
|
||||
{},
|
||||
};
|
||||
|
||||
ApiStatus N(func_80240000_C3D080)(ScriptInstance* script, s32 isInitialCall) {
|
||||
s32 i;
|
||||
|
||||
if (N(D_80240620_C3D6A0) == NULL) {
|
||||
N(D_80240620_C3D6A0) = heap_malloc(16 * sizeof(s32));
|
||||
for (i = 0; i < 16; i++) {
|
||||
N(D_80240620_C3D6A0)[i] = script->varTable[i];
|
||||
}
|
||||
} else {
|
||||
for (i = 0; i < 16; i++) {
|
||||
script->varTable[i] = N(D_80240620_C3D6A0)[i];
|
||||
}
|
||||
heap_free(N(D_80240620_C3D6A0));
|
||||
N(D_80240620_C3D6A0) = NULL;
|
||||
}
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
#include "world/common/GetItemName.inc.c"
|
||||
|
||||
#include "world/common/SomeItemEntityFunc.inc.c"
|
||||
|
@ -123,7 +123,7 @@ static s32 N(pad_868)[] = {
|
||||
0x00000000, 0x00000000,
|
||||
};
|
||||
|
||||
s32** N(D_80240870_C4E760) = NULL;
|
||||
#include "world/common/StashVars.inc.c"
|
||||
|
||||
Script N(80240874) = SCRIPT({
|
||||
group 0;
|
||||
@ -168,24 +168,6 @@ Script N(makeEntities) = SCRIPT({
|
||||
AssignScript(N(802409BC));
|
||||
});
|
||||
|
||||
ApiStatus N(func_80240000_C4DEF0)(ScriptInstance* script, s32 isInitialCall) {
|
||||
s32 i;
|
||||
|
||||
if (N(D_80240870_C4E760) == NULL) {
|
||||
N(D_80240870_C4E760) = heap_malloc(16 * sizeof(s32));
|
||||
for (i = 0; i < 16; i++) {
|
||||
N(D_80240870_C4E760)[i] = script->varTable[i];
|
||||
}
|
||||
} else {
|
||||
for (i = 0; i < 16; i++) {
|
||||
script->varTable[i] = N(D_80240870_C4E760)[i];
|
||||
}
|
||||
heap_free(N(D_80240870_C4E760));
|
||||
N(D_80240870_C4E760) = NULL;
|
||||
}
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
#include "world/common/GetItemName.inc.c"
|
||||
|
||||
#include "world/common/SomeItemEntityFunc.inc.c"
|
||||
|
@ -639,7 +639,7 @@ static s32 N(pad_36D8)[] = {
|
||||
0x00000000, 0x00000000,
|
||||
};
|
||||
|
||||
s32** N(D_802436E0_C59620) = NULL;
|
||||
s32** N(D_802436E0_C59620) = NULL; // StashVars.inc.c data
|
||||
|
||||
Script N(802436E4) = SCRIPT({
|
||||
group 0;
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include "dgb_18.h"
|
||||
|
||||
// TODO: StashVars.inc.c
|
||||
ApiStatus N(func_80240FB0_C56EF0)(ScriptInstance* script, s32 isInitialCall) {
|
||||
s32 i;
|
||||
|
||||
|
@ -709,7 +709,7 @@ Script N(80245444) = SCRIPT({
|
||||
SetNpcSpeed(NPC_WORLD_LAKILESTER, 3.5);
|
||||
NpcMoveTo(NPC_WORLD_LAKILESTER, SI_VAR(0), 60, 0);
|
||||
N(UnkFunc41)(0, 8);
|
||||
N(func_802435D0_CC6DE0)();
|
||||
N(LoadPartyImage)();
|
||||
spawn N(802438CC);
|
||||
sleep 15;
|
||||
ShowMessageAtScreenPos(MESSAGE_ID(0x1D, 0x0190), 160, 40);
|
||||
|
@ -1,31 +1,4 @@
|
||||
#include "flo_13.h"
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ s32* unk_00;
|
||||
/* 0x04 */ s32* unk_04;
|
||||
/* 0x08 */ s16 unk_08;
|
||||
/* 0x0A */ s16 unk_0A;
|
||||
/* 0x0C */ s32 unk_0C;
|
||||
/* 0x10 */ s32 unk_10;
|
||||
} N(Unk_bss_struct);
|
||||
|
||||
static s8 N(D_80247B00)[0x200];
|
||||
static s8 N(D_80247D00)[0x3D90];
|
||||
static N(Unk_bss_struct) N(D_8024BA90);
|
||||
|
||||
ApiStatus N(func_802435D0_CC6DE0)(ScriptInstance* script, s32 isInitialCall) {
|
||||
s32 var;
|
||||
void* temp_s0 = load_asset_by_name("party_pokopi", &var);
|
||||
|
||||
decode_yay0(temp_s0, N(D_80247B00));
|
||||
general_heap_free(temp_s0);
|
||||
|
||||
N(D_8024BA90).unk_00 = N(D_80247D00);
|
||||
N(D_8024BA90).unk_08 = 0x96;
|
||||
N(D_8024BA90).unk_0A = 0x69;
|
||||
N(D_8024BA90).unk_0C = 2;
|
||||
N(D_8024BA90).unk_04 = N(D_80247B00);
|
||||
N(D_8024BA90).unk_10 = 1;
|
||||
set_message_images(&N(D_8024BA90));
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
#define PARTY_IMAGE "party_pokopi"
|
||||
#include "world/common/LoadPartyImage.inc.c"
|
||||
|
@ -10,7 +10,7 @@ ApiStatus N(func_80242A6C_CC627C)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(UnkFunc42)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_802433C0_CC6BD0)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_802434D4_CC6CE4)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_802435D0_CC6DE0)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(LoadPartyImage)(ScriptInstance* script, s32 isInitialCall);
|
||||
|
||||
extern NpcGroupList N(npcGroupList_80247984);
|
||||
extern Script N(main);
|
@ -7,7 +7,7 @@ enum {
|
||||
NPC_BZZAP,
|
||||
};
|
||||
|
||||
s32 N(D_802453B0_EF79C0)[91] BSS;
|
||||
BSS s32 N(D_802453B0_EF79C0)[91];
|
||||
|
||||
f32 N(D_802444C0_CCF7D0)[] = {
|
||||
4.5f, 3.5f, 2.6f, 2.0f,
|
||||
|
@ -1,21 +1,6 @@
|
||||
#include "iwa_10.h"
|
||||
|
||||
// TODO(data)
|
||||
//#define PARTY_IMAGE "party_pareta"
|
||||
//#include "world/common/LoadPartyImage.inc.c"
|
||||
INCLUDE_ASM(s32, "world/area_iwa/iwa_10/91FA80", func_80241510_91FA80);
|
||||
/*
|
||||
ApiStatus N(func_80241510_91FA80)(ScriptInstance *script, s32 isInitialCall) {
|
||||
s32 var;
|
||||
void* temp_s0 = load_asset_by_name("party_pokopi", &var);
|
||||
|
||||
decode_yay0(temp_s0, N(D_80247B00));
|
||||
general_heap_free(temp_s0);
|
||||
|
||||
N(D_8024BA90).unk_00 = N(D_80247D00);
|
||||
N(D_8024BA90).unk_08 = 0x96;
|
||||
N(D_8024BA90).unk_0A = 0x69;
|
||||
N(D_8024BA90).unk_0C = 2;
|
||||
N(D_8024BA90).unk_04 = N(D_80247B00);
|
||||
N(D_8024BA90).unk_10 = 1;
|
||||
set_message_images(&N(D_8024BA90));
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
*/
|
||||
|
@ -1,21 +1,6 @@
|
||||
#include "jan_04.h"
|
||||
|
||||
// TODO(data)
|
||||
//#define PARTY_IMAGE "party_opuku"
|
||||
//#include "world/common/LoadPartyImage.inc.c"
|
||||
INCLUDE_ASM(s32, "world/area_jan/jan_04/B45150", func_802409E0_B45150);
|
||||
/*
|
||||
ApiStatus N(func_802409E0_B45150)(ScriptInstance *script, s32 isInitialCall) {
|
||||
s32 var;
|
||||
void* temp_s0 = load_asset_by_name("party_pokopi", &var);
|
||||
|
||||
decode_yay0(temp_s0, N(D_80247B00));
|
||||
general_heap_free(temp_s0);
|
||||
|
||||
N(D_8024BA90).unk_00 = N(D_80247D00);
|
||||
N(D_8024BA90).unk_08 = 0x96;
|
||||
N(D_8024BA90).unk_0A = 0x69;
|
||||
N(D_8024BA90).unk_0C = 2;
|
||||
N(D_8024BA90).unk_04 = N(D_80247B00);
|
||||
N(D_8024BA90).unk_10 = 1;
|
||||
set_message_images(&N(D_8024BA90));
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
*/
|
||||
|
@ -1,21 +1,6 @@
|
||||
#include "nok_04.h"
|
||||
|
||||
// TODO(data)
|
||||
//#define PARTY_IMAGE "party_kameki"
|
||||
//#include "world/common/LoadPartyImage.inc.c"
|
||||
INCLUDE_ASM(s32, "world/area_nok/nok_04/9EEA80", func_80240E90_9EEA80);
|
||||
/*
|
||||
ApiStatus N(func_80240E90_9EEA80)(ScriptInstance *script, s32 isInitialCall) {
|
||||
s32 var;
|
||||
void* temp_s0 = load_asset_by_name("party_pokopi", &var);
|
||||
|
||||
decode_yay0(temp_s0, N(D_80247B00));
|
||||
general_heap_free(temp_s0);
|
||||
|
||||
N(D_8024BA90).unk_00 = N(D_80247D00);
|
||||
N(D_8024BA90).unk_08 = 0x96;
|
||||
N(D_8024BA90).unk_0A = 0x69;
|
||||
N(D_8024BA90).unk_0C = 2;
|
||||
N(D_8024BA90).unk_04 = N(D_80247B00);
|
||||
N(D_8024BA90).unk_10 = 1;
|
||||
set_message_images(&N(D_8024BA90));
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
*/
|
||||
|
@ -2,22 +2,7 @@
|
||||
|
||||
static char* N(exit_str_0) = "omo_11\0";
|
||||
|
||||
// TODO(data)
|
||||
//#define PARTY_IMAGE "party_akari"
|
||||
//#include "world/common/LoadPartyImage.inc.c"
|
||||
INCLUDE_ASM(s32, "world/area_omo/omo_12/DDF730", func_80240420_DDF730);
|
||||
/*
|
||||
ApiStatus N(func_80240420_DDF730)(ScriptInstance *script, s32 isInitialCall) {
|
||||
s32 var;
|
||||
void* temp_s0 = load_asset_by_name("party_pokopi", &var);
|
||||
|
||||
decode_yay0(temp_s0, N(D_80247B00));
|
||||
general_heap_free(temp_s0);
|
||||
|
||||
N(D_8024BA90).unk_00 = N(D_80247D00);
|
||||
N(D_8024BA90).unk_08 = 0x96;
|
||||
N(D_8024BA90).unk_0A = 0x69;
|
||||
N(D_8024BA90).unk_0C = 2;
|
||||
N(D_8024BA90).unk_04 = N(D_80247B00);
|
||||
N(D_8024BA90).unk_10 = 1;
|
||||
set_message_images(&N(D_8024BA90));
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
*/
|
||||
|
@ -1,21 +1,6 @@
|
||||
#include "trd_06.h"
|
||||
|
||||
// TODO(data)
|
||||
//#define PARTY_IMAGE "party_pinki"
|
||||
//#include "world/common/LoadPartyImage.inc.c"
|
||||
INCLUDE_ASM(s32, "world/area_trd/trd_06/9B2410", func_80240C80_9B2410);
|
||||
/*
|
||||
ApiStatus N(func_80240C80_9B2410)(ScriptInstance *script, s32 isInitialCall) {
|
||||
s32 var;
|
||||
void* temp_s0 = load_asset_by_name("party_pokopi", &var);
|
||||
|
||||
decode_yay0(temp_s0, N(D_80247B00));
|
||||
general_heap_free(temp_s0);
|
||||
|
||||
N(D_8024BA90).unk_00 = N(D_80247D00);
|
||||
N(D_8024BA90).unk_08 = 0x96;
|
||||
N(D_8024BA90).unk_0A = 0x69;
|
||||
N(D_8024BA90).unk_0C = 2;
|
||||
N(D_8024BA90).unk_04 = N(D_80247B00);
|
||||
N(D_8024BA90).unk_10 = 1;
|
||||
set_message_images(&N(D_8024BA90));
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
*/
|
||||
|
36
src/world/common/LoadPartyImage.inc.c
Normal file
36
src/world/common/LoadPartyImage.inc.c
Normal file
@ -0,0 +1,36 @@
|
||||
#include "common.h"
|
||||
#include "map.h"
|
||||
|
||||
#ifndef PARTY_IMAGE
|
||||
#error "Define PARTY_IMAGE to the asset name to use LoadPartyImage."
|
||||
#endif
|
||||
|
||||
ApiStatus N(LoadPartyImage)(ScriptInstance* script, s32 isInitialCall) {
|
||||
static u16 palette[256];
|
||||
static u8 raster[0x3D90];
|
||||
static struct {
|
||||
/* 0x00 */ void* raster;
|
||||
/* 0x04 */ void* palette;
|
||||
/* 0x08 */ s16 width;
|
||||
/* 0x0A */ s16 height;
|
||||
/* 0x0C */ s32 unk_0C;
|
||||
/* 0x10 */ s32 unk_10;
|
||||
} images[1];
|
||||
|
||||
u32 decompressedSize;
|
||||
void* compressed = load_asset_by_name(PARTY_IMAGE, &decompressedSize);
|
||||
|
||||
decode_yay0(compressed, &palette);
|
||||
general_heap_free(compressed);
|
||||
|
||||
images[0].raster = &raster;
|
||||
images[0].width = 150;
|
||||
images[0].height = 105;
|
||||
images[0].unk_0C = 2;
|
||||
images[0].palette = &palette;
|
||||
images[0].unk_10 = 1;
|
||||
set_message_images(images);
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
#undef PARTY_IMAGE
|
24
src/world/common/StashVars.inc.c
Normal file
24
src/world/common/StashVars.inc.c
Normal file
@ -0,0 +1,24 @@
|
||||
#include "common.h"
|
||||
#include "map.h"
|
||||
|
||||
ApiStatus N(StashVars)(ScriptInstance* script, s32 isInitialCall) {
|
||||
static s32** varTable = NULL;
|
||||
s32 i;
|
||||
|
||||
if (varTable == NULL) {
|
||||
varTable = heap_malloc(sizeof(script->varTable));
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(script->varTable); i++) {
|
||||
varTable[i] = script->varTable[i];
|
||||
}
|
||||
} else {
|
||||
for (i = 0; i < ARRAY_COUNT(script->varTable); i++) {
|
||||
script->varTable[i] = varTable[i];
|
||||
}
|
||||
|
||||
heap_free(varTable);
|
||||
varTable = NULL;
|
||||
}
|
||||
|
||||
return ApiStatus_DONE2;
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
#include "common.h"
|
||||
#include "map.h"
|
||||
|
||||
ApiStatus N(UnkFunc46)(ScriptInstance* script, s32 isInitialCall) {
|
||||
s32 i;
|
||||
|
||||
if (UNK_FUNC46_VAR == NULL) {
|
||||
UNK_FUNC46_VAR = heap_malloc(16 * sizeof(s32));
|
||||
for (i = 0; i < ARRAY_COUNT(script->varTable); i++) {
|
||||
UNK_FUNC46_VAR[i] = script->varTable[i];
|
||||
}
|
||||
} else {
|
||||
for (i = 0; i < ARRAY_COUNT(script->varTable); i++) {
|
||||
script->varTable[i] = UNK_FUNC46_VAR[i];
|
||||
}
|
||||
heap_free(UNK_FUNC46_VAR);
|
||||
UNK_FUNC46_VAR = NULL;
|
||||
}
|
||||
return ApiStatus_DONE2;
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
.include "macro.inc"
|
||||
|
||||
.section .data
|
||||
|
||||
glabel D_80243670_CC6E80
|
||||
.word 0x440E8000, 0x00000000, 0x00000000, 0x43870000, 0xC40E8000, 0x00000000, 0x00000000, 0x42B40000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x80243DEC, D_80243670_CC6E80, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, func_80200000, 0x0019011D
|
||||
|
||||
glabel D_802436D0_CC6EE0
|
||||
.word 0x00000043, 0x00000004, GetPlayerPos, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x0000000C, 0x00000002, 0xFE363C80, 0xFFFFFE0C, 0x00000004, 0x00000001, 0x0000000A, 0x00000013, 0x00000000, 0x00000003, 0x00000001, 0x00000000, 0x00000014, 0x00000001, 0xF5DE0180, 0x00000018, 0x00000001, 0x00000035, 0x00000043, 0x00000005, SetMusicTrack, 0x00000000, 0x00000030, 0x00000000, 0x00000008, 0x0000001C, 0x00000000, 0x00000043, 0x00000005, SetMusicTrack, 0x00000000, 0x00000031, 0x00000000, 0x00000008, 0x00000023, 0x00000000, 0x00000005, 0x00000001, 0x00000000, 0x00000043, 0x00000004, GetPlayerPos, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x0000000C, 0x00000002, 0xFE363C80, 0xFFFFFE0C, 0x00000007, 0x00000000, 0x00000013, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x00000006, 0x00000000, 0x00000003, 0x00000001, 0x0000000A, 0x00000014, 0x00000001, 0xF5DE0180, 0x00000018, 0x00000001, 0x00000035, 0x00000043, 0x00000005, SetMusicTrack, 0x00000000, 0x00000034, 0x00000000, 0x00000008, 0x0000001C, 0x00000000, 0x00000043, 0x00000005, SetMusicTrack, 0x00000000, 0x00000035, 0x00000000, 0x00000008, 0x00000023, 0x00000000, 0x00000005, 0x00000001, 0x00000000, 0x00000043, 0x00000004, GetPlayerPos, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x0000000D, 0x00000002, 0xFE363C80, 0xFFFFFE0C, 0x00000007, 0x00000000, 0x00000013, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x00000006, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000044, 0x00000001, D_802436D0_CC6EE0, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000005, SetMusicTrack, 0x00000000, 0x00000082, 0x00000000, 0x00000008, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000003, FadeOutMusic, 0x00000000, 0x000001F4, 0x00000008, 0x00000001, 0x0000000F, 0x00000043, 0x00000005, SetMusicTrack, 0x00000000, 0x00000030, 0x00000000, 0x00000008, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000
|
@ -1,6 +0,0 @@
|
||||
.include "macro.inc"
|
||||
|
||||
.section .data
|
||||
|
||||
glabel D_80243950_CC7160
|
||||
.word 0x00000043, 0x00000004, ModifyColliderFlags, 0x00000000, 0x0000000E, 0x7FFFFE00, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000007, MakeItemEntity, 0x00000126, 0xFFFFFFC3, 0x0000003C, 0xFFFFFFAB, 0x00000011, 0xF84060E9, 0x00000043, 0x00000007, MakeItemEntity, 0x00000083, 0x00000080, 0x00000000, 0x0000009D, 0x00000011, 0xF84060EA, 0x0000000A, 0x00000002, 0xF84060E9, 0x00000000, 0x00000043, 0x00000007, MakeEntity, 0x802BCF00, 0xFFFFFF60, 0x000000A0, 0xFFFFFFA6, 0x00000000, D_80000000, 0x00000043, 0x00000002, AssignScript, D_80243950_CC7160, 0x00000012, 0x00000000, 0x00000043, 0x00000004, ModifyColliderFlags, 0x00000000, 0x0000000E, 0x7FFFFE00, 0x00000013, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000000
|
File diff suppressed because one or more lines are too long
@ -15261,7 +15261,7 @@ flo_13_func_80242A6C_CC627C = 0x80242A6C; // type:func rom:0xCC627C
|
||||
flo_13_UnkFunc42 = 0x80243368; // type:func rom:0xCC6B78
|
||||
flo_13_func_802433C0_CC6BD0 = 0x802433C0; // type:func rom:0xCC6BD0
|
||||
flo_13_func_802434D4_CC6CE4 = 0x802434D4; // type:func rom:0xCC6CE4
|
||||
flo_13_func_802435D0_CC6DE0 = 0x802435D0; // type:func rom:0xCC6DE0
|
||||
flo_13_LoadPartyImage = 0x802435D0; // type:func rom:0xCC6DE0
|
||||
flo_13_entryList = 0x80243670; // type:data rom:0xCC6E80
|
||||
flo_13_config = 0x80243690; // type:data rom:0xCC6EA0
|
||||
flo_13_802436D0 = 0x802436D0; // type:data rom:0xCC6EE0
|
||||
@ -19747,7 +19747,6 @@ D_802700A0 = 0x802700A0; // type:data
|
||||
D_802700A8 = 0x802700A8; // type:data
|
||||
D_802700B0 = 0x802700B0; // type:data
|
||||
D_802700B8 = 0x802700B8; // type:data
|
||||
bss = 0x802700C0; // type:data
|
||||
gPauseMenuHeldButtons = 0x802700C0; // type:data
|
||||
gPauseMenuPressedButtons = 0x802700C4; // type:data
|
||||
gPauseMenuCurrentDescString = 0x802700C8; // type:data
|
||||
|
@ -660,13 +660,6 @@ D_80262C34 = 0x80262C34;
|
||||
D_80262C38 = 0x80262C38;
|
||||
D_80262F68 = 0x80262F68;
|
||||
D_80268000 = 0x80268000;
|
||||
gPauseMenuHeldButtons = 0x802700C0;
|
||||
gPauseMenuPressedButtons = 0x802700C4;
|
||||
gPauseMenuCurrentDescString = 0x802700C8;
|
||||
gPauseMenuCurrentDescIconScript = 0x802700CC;
|
||||
D_802700D0 = 0x802700D0;
|
||||
gPauseMenuCurrentTab = 0x802700D4;
|
||||
D_802700E0 = 0x802700E0;
|
||||
gPauseMenuCommonIconIDs = 0x802700E8;
|
||||
D_80270108 = 0x80270108;
|
||||
D_8027010C = 0x8027010C;
|
||||
|
Loading…
Reference in New Issue
Block a user