Fix alignment of many data sections (#305)

* generate c includes for img segments

* flatten battle/item/dusty_hammer.c

needs custom splat

* use .inc.c for c incbins

* fixy

* new stuff

* git subrepo pull (merge) --force tools/splat

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

* remove dumb

* git subrepo pull tools/splat

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

* yaml cleaning

* Further yaml cleanup & battle item refactor

* remove rawptr

* git subrepo pull tools/splat

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

* further cleanup

* Further cleanup & match gfx_draw_background

* clean & wip

Co-authored-by: Alex Bates <hi@imalex.xyz>
This commit is contained in:
Ethan Roseman 2021-07-12 05:15:00 -04:00 committed by GitHub
parent 6484e4883d
commit 7cb1790789
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
49 changed files with 1817 additions and 1942 deletions

View File

@ -11,4 +11,7 @@
#include "si.h"
#include "messages.h"
// these are just for the permuter
extern int TEXEL0, TEXEL1, PRIMITIVE, PRIMITIVE_ALPHA;
#endif

View File

@ -534,7 +534,7 @@ typedef struct Camera {
/* 0x026 */ s16 unk_26;
/* 0x028 */ s16 unk_28;
/* 0x02A */ s16 zoomPercent;
/* 0x02C */ s16 backgroundColor[3];
/* 0x02C */ s16 bgColor[3];
/* 0x032 */ s16 targetScreenCoords[3];
/* 0x038 */ s16 perspNorm;
/* 0x03A */ char unk_3A[2];

View File

@ -48,6 +48,8 @@
#define SPRITE_WORLD_SCALE 0.71428573f
#define PACK_FILL_COLOR(r, g, b, a) (GPACK_RGBA5551(r, g, b, a) << 0x10) | GPACK_RGBA5551(r, g, b, a)
//NOTE: SCRIPT_ALLOC is probably not quite correct, but this is the closest thing to matching for the functions its used in. Needs more work.
#define SCRIPT_ALLOC(new, index) \
{ \

View File

@ -278,6 +278,7 @@ ApiStatus InitAnimatedModels(ScriptInstance* script, s32 isInitialCall);
ApiStatus func_8024CE9C(ScriptInstance* script, s32 isInitialCall);
ApiStatus func_802CABE8(ScriptInstance* script, s32 isInitialCall);
ApiStatus func_802CAE50(ScriptInstance* script, s32 isInitialCall);
ApiStatus func_8024ECF8(ScriptInstance* script, s32 isInitialCall);
extern Script PlayerScriptDispatcher;
extern Script PeachScriptDispatcher;

View File

@ -88,7 +88,7 @@ INCLUDE_ASM(s32, "1776B0", SetBattleCamZoom);
INCLUDE_ASM(s32, "1776B0", AddBattleCamZoom);
INCLUDE_ASM(s32, "1776B0", func_8024ECF8);
INCLUDE_ASM(ApiStatus, "1776B0", func_8024ECF8, ScriptInstance* script, s32 isInitialCall);
INCLUDE_ASM(s32, "1776B0", FreezeBattleCam);

View File

@ -313,7 +313,7 @@ Script goomba_turn = SCRIPT({
SetTargetActor(ACTOR_SELF, 0);
UseBattleCamPreset(63);
BattleCamTargetActor(ACTOR_SELF);
0x8024ECF8(-1, 1, 0);
func_8024ECF8(-1, 1, 0);
SetAnimation(ACTOR_SELF, 1, NPC_ANIM(goomba, normal, run));
SetGoalToTarget(ACTOR_SELF);
AddGoalPos(ACTOR_SELF, 50, 0, 0);

View File

@ -1,4 +1,6 @@
#include "coconut.h"
#include "ld_addrs.h"
#include "battle/item/coconut.png.h"
static HudElement* D_802A1E80;
@ -164,3 +166,101 @@ Script N(DrinkItem) = SCRIPT({
SetAnimation(ACTOR_PLAYER, 0, ANIM_DRINK);
sleep 45;
});
static s32 _pad = 0;
#include "battle/item/coconut.png.inc.c"
#include "battle/item/coconut.pal.inc.c"
/// 32x32 square.
Vtx N(model)[] = {
{ .v = { -16, -16, 0, FALSE, 0, 0, 0, 0, 0, 255 } },
{ .v = { 15, -16, 0, FALSE, 1024, 0, 0, 0, 0, 255 } },
{ .v = { 15, 15, 0, FALSE, 1024, 1024, 0, 0, 0, 255 } },
{ .v = { -16, 15, 0, FALSE, 0, 1024, 0, 0, 0, 255 } },
};
Gfx N(displayList)[] = {
gsDPPipeSync(),
gsSPTexture(-1, -1, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA),
gsDPSetTexturePersp(G_TP_PERSP),
gsDPSetTextureDetail(G_TD_CLAMP),
gsDPSetTextureLOD(G_TL_TILE),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureFilter(G_TF_AVERAGE),
gsDPSetTextureConvert(G_TC_FILT),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPLoadTLUT_pal16(0, battle_item_coconut_pal),
gsDPLoadTextureTile_4b(battle_item_coconut_png, G_IM_FMT_CI, battle_item_coconut_png_width, battle_item_coconut_png_height, 0, 0, battle_item_coconut_png_width - 1, battle_item_coconut_png_height - 1, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD),
gsSPClearGeometryMode(G_LIGHTING),
gsSPClearGeometryMode(G_SHADING_SMOOTH),
gsSPVertex(&N(model), ARRAY_COUNT(N(model)), 0),
gsSP1Triangle(0, 1, 2, 0),
gsSP1Triangle(0, 2, 3, 0),
gsDPPipeSync(),
gsSPEndDisplayList(),
};
s32 N(modelCommandList)[] = {
0x00000004, 0x0000000D, 0x00000001, sizeof(N(displayList)) / sizeof(s32), &N(displayList), 0x00000002, 0x00000000,
};
Script N(main) = SCRIPT({
SI_VAR(10) = (const) ITEM_COCONUT;
await N(UseItemWithEffect);
UseBattleCamPreset(3);
MoveBattleCamOver(15);
SetAnimation(ACTOR_PLAYER, 0, ANIM_THROW);
PlaySound(SOUND_THROW);
sleep 3;
CreateVirtualEntity(SI_VAR(10), N(modelCommandList));
$x = 1.0;
MultiplyByActorScale($x);
SetVirtualEntityScale(SI_VAR(10), $x, $x, $x);
GetActorPos(ACTOR_PLAYER, $x, $y, $z);
SI_VAR(3) = 20;
SI_VAR(4) = 42;
SI_VAR(5) = 5;
MultiplyVec3ByActorScale(SI_VAR(3), SI_VAR(4), SI_VAR(5));
$x += SI_VAR(3);
$y += SI_VAR(4);
$z += SI_VAR(5);
SetVirtualEntityPosition(SI_VAR(10), $x, $y, $z);
InitTargetIterator();
SetGoalToTarget(ACTOR_SELF);
GetGoalPos(ACTOR_SELF, $x, $y, $z);
spawn {
$x = 0;
loop 18 {
$x += -60;
SetVirtualEntityRotation(SI_VAR(10), 0, 0, $x);
sleep 1;
}
}
SetVirtualEntityJumpGravity(SI_VAR(10), 0.8);
$z += 5;
VirtualEntityJumpTo(SI_VAR(10), $x, $y, $z, 18);
GetItemPower(ITEM_COCONUT, $damage, SI_VAR(4));
ApplyShrinkFromOwner($damage);
ItemDamageEnemy(SI_VAR(9), 0x18000000, 0, $damage, 32);
// Bounce off
$x += 60;
$y += 0;
VirtualEntityJumpTo(SI_VAR(10), $x, $y, $z, 16);
DeleteVirtualEntity(SI_VAR(10));
await N(PlayerGoHome);
});

View File

@ -1,96 +0,0 @@
#include "coconut.h"
#include "ld_addrs.h"
#include "battle/item/coconut/coconut.png.h"
/// 32x32 square.
Vtx N(model)[] = {
{ .v = { -16, -16, 0, FALSE, 0, 0, 0, 0, 0, 255 } },
{ .v = { 15, -16, 0, FALSE, 1024, 0, 0, 0, 0, 255 } },
{ .v = { 15, 15, 0, FALSE, 1024, 1024, 0, 0, 0, 255 } },
{ .v = { -16, 15, 0, FALSE, 0, 1024, 0, 0, 0, 255 } },
};
Gfx N(displayList)[] = {
gsDPPipeSync(),
gsSPTexture(-1, -1, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA),
gsDPSetTexturePersp(G_TP_PERSP),
gsDPSetTextureDetail(G_TD_CLAMP),
gsDPSetTextureLOD(G_TL_TILE),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureFilter(G_TF_AVERAGE),
gsDPSetTextureConvert(G_TC_FILT),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPLoadTLUT_pal16(0, &N(coconut_pal)),
gsDPLoadTextureTile_4b(&N(coconut_png), G_IM_FMT_CI, N(coconut_png_width), N(coconut_png_height), 0, 0, N(coconut_png_width) - 1, N(coconut_png_height) - 1, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD),
gsSPClearGeometryMode(G_LIGHTING),
gsSPClearGeometryMode(G_SHADING_SMOOTH),
gsSPVertex(&N(model), ARRAY_COUNT(N(model)), 0),
gsSP1Triangle(0, 1, 2, 0),
gsSP1Triangle(0, 2, 3, 0),
gsDPPipeSync(),
gsSPEndDisplayList(),
};
s32 N(modelCommandList)[] = {
0x00000004, 0x0000000D, 0x00000001, sizeof(N(displayList)) / sizeof(s32), &N(displayList), 0x00000002, 0x00000000,
};
Script N(main) = SCRIPT({
SI_VAR(10) = (const) ITEM_COCONUT;
await N(UseItemWithEffect);
UseBattleCamPreset(3);
MoveBattleCamOver(15);
SetAnimation(ACTOR_PLAYER, 0, ANIM_THROW);
PlaySound(SOUND_THROW);
sleep 3;
CreateVirtualEntity(SI_VAR(10), N(modelCommandList));
$x = 1.0;
MultiplyByActorScale($x);
SetVirtualEntityScale(SI_VAR(10), $x, $x, $x);
GetActorPos(ACTOR_PLAYER, $x, $y, $z);
SI_VAR(3) = 20;
SI_VAR(4) = 42;
SI_VAR(5) = 5;
MultiplyVec3ByActorScale(SI_VAR(3), SI_VAR(4), SI_VAR(5));
$x += SI_VAR(3);
$y += SI_VAR(4);
$z += SI_VAR(5);
SetVirtualEntityPosition(SI_VAR(10), $x, $y, $z);
InitTargetIterator();
SetGoalToTarget(ACTOR_SELF);
GetGoalPos(ACTOR_SELF, $x, $y, $z);
spawn {
$x = 0;
loop 18 {
$x += -60;
SetVirtualEntityRotation(SI_VAR(10), 0, 0, $x);
sleep 1;
}
}
SetVirtualEntityJumpGravity(SI_VAR(10), 0.8);
$z += 5;
VirtualEntityJumpTo(SI_VAR(10), $x, $y, $z, 18);
GetItemPower(ITEM_COCONUT, $damage, SI_VAR(4));
ApplyShrinkFromOwner($damage);
ItemDamageEnemy(SI_VAR(9), 0x18000000, 0, $damage, 32);
// Bounce off
$x += 60;
$y += 0;
VirtualEntityJumpTo(SI_VAR(10), $x, $y, $z, 16);
DeleteVirtualEntity(SI_VAR(10));
await N(PlayerGoHome);
});

View File

@ -1,4 +1,6 @@
#include "dusty_hammer.h"
#include "ld_addrs.h"
#include "battle/item/dusty_hammer.png.h"
static HudElement* D_802A1E80;
@ -156,3 +158,85 @@ Script N(DrinkItem) = SCRIPT({
sleep 45;
});
static s32 _pad = 0; // XXX
#include "battle/item/dusty_hammer.png.inc.c"
#include "battle/item/dusty_hammer.pal.inc.c"
Vtx N(model)[] = {
{ .v = { -16, -16, 0, FALSE, 0, 0, 0, 0, 0, 255 } },
{ .v = { 15, -16, 0, FALSE, 1024, 0, 0, 0, 0, 255 } },
{ .v = { 15, 15, 0, FALSE, 1024, 1024, 0, 0, 0, 255 } },
{ .v = { -16, 15, 0, FALSE, 0, 1024, 0, 0, 0, 255 } },
};
Gfx N(displayList)[] = {
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA),
gsDPSetTexturePersp(G_TP_PERSP),
gsDPSetTextureDetail(G_TD_CLAMP),
gsDPSetTextureLOD(G_TL_TILE),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureFilter(G_TF_AVERAGE),
gsDPSetTextureConvert(G_TC_FILT),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPLoadTLUT_pal16(0, battle_item_dusty_hammer_pal),
gsDPLoadTextureTile_4b(battle_item_dusty_hammer_png, G_IM_FMT_CI, battle_item_dusty_hammer_png_width, battle_item_dusty_hammer_png_height, 0, 0, battle_item_dusty_hammer_png_width - 1, battle_item_dusty_hammer_png_height - 1, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD),
gsSPClearGeometryMode(G_LIGHTING),
gsSPClearGeometryMode(G_SHADING_SMOOTH),
gsSPVertex(N(model), ARRAY_COUNT(N(model)), 0),
gsSP1Triangle(0, 1, 2, 0),
gsSP1Triangle(0, 2, 3, 0),
gsDPPipeSync(),
gsSPEndDisplayList(),
};
s32 N(modelCommandList)[] = {
0x00000004, 0x0000000D, 0x00000001, sizeof(N(displayList)) / sizeof(s32), &N(displayList), 0x00000002, 0x00000000,
};
Script N(main) = SCRIPT({
SI_VAR(10) = (const) 0x86;
await N(UseItemWithEffect);
UseBattleCamPreset(3);
MoveBattleCamOver(15);
SetAnimation(ACTOR_PLAYER, 0, ANIM_THROW);
PlaySound(SOUND_THROW);
sleep 3;
CreateVirtualEntity(SI_VAR(10), N(modelCommandList));
SI_VAR(0) = 1.0;
MultiplyByActorScale(SI_VAR(0));
SetVirtualEntityScale(SI_VAR(10), SI_VAR(0), SI_VAR(0), SI_VAR(0));
GetActorPos(ACTOR_PLAYER, SI_VAR(0), SI_VAR(1), SI_VAR(2));
SI_VAR(3) = 20;
SI_VAR(4) = 42;
SI_VAR(5) = 5;
MultiplyVec3ByActorScale(SI_VAR(3), SI_VAR(4), SI_VAR(5));
SI_VAR(0) += SI_VAR(3);
SI_VAR(1) += SI_VAR(4);
SI_VAR(2) += SI_VAR(5);
SetVirtualEntityPosition(SI_VAR(10), SI_VAR(0), SI_VAR(1), SI_VAR(2));
InitTargetIterator();
SetGoalToTarget(ACTOR_SELF);
GetGoalPos(ACTOR_SELF, SI_VAR(0), SI_VAR(1), SI_VAR(2));
spawn {
SI_VAR(0) = 0;
loop 18 {
SI_VAR(0) += 0xFFFFFFC4;
SetVirtualEntityRotation(SI_VAR(10), 0, 0, SI_VAR(0));
sleep 1;
}
}
SetVirtualEntityJumpGravity(SI_VAR(10), 0.80078125);
SI_VAR(2) += 5;
VirtualEntityJumpTo(SI_VAR(10), SI_VAR(0), SI_VAR(1), SI_VAR(2), 18);
GetItemPower(ITEM_DUSTY_HAMMER, SI_VAR(3), SI_VAR(4));
ApplyShrinkFromOwner(SI_VAR(3));
ItemDamageEnemy(SI_VAR(9), 0x18000000, 0, SI_VAR(3), 32);
SI_VAR(0) += 40;
SI_VAR(1) += 10;
VirtualEntityJumpTo(SI_VAR(10), SI_VAR(0), SI_VAR(1), SI_VAR(2), 10);
DeleteVirtualEntity(SI_VAR(10));
await N(PlayerGoHome);
});

View File

@ -1,81 +0,0 @@
#include "dusty_hammer.h"
#include "ld_addrs.h"
#include "battle/item/dusty_hammer/dusty_hammer.png.h"
Vtx N(model)[] = {
{ .v = { -16, -16, 0, FALSE, 0, 0, 0, 0, 0, 255 } },
{ .v = { 15, -16, 0, FALSE, 1024, 0, 0, 0, 0, 255 } },
{ .v = { 15, 15, 0, FALSE, 1024, 1024, 0, 0, 0, 255 } },
{ .v = { -16, 15, 0, FALSE, 0, 1024, 0, 0, 0, 255 } },
};
Gfx N(displayList)[] = {
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA),
gsDPSetTexturePersp(G_TP_PERSP),
gsDPSetTextureDetail(G_TD_CLAMP),
gsDPSetTextureLOD(G_TL_TILE),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureFilter(G_TF_AVERAGE),
gsDPSetTextureConvert(G_TC_FILT),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPLoadTLUT_pal16(0, &N(dusty_hammer_pal)),
gsDPLoadTextureTile_4b(&N(dusty_hammer_png), G_IM_FMT_CI, N(dusty_hammer_png_width), N(dusty_hammer_png_height), 0, 0, N(dusty_hammer_png_width) - 1, N(dusty_hammer_png_height) - 1, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD),
gsSPClearGeometryMode(G_LIGHTING),
gsSPClearGeometryMode(G_SHADING_SMOOTH),
gsSPVertex(N(model), ARRAY_COUNT(N(model)), 0),
gsSP1Triangle(0, 1, 2, 0),
gsSP1Triangle(0, 2, 3, 0),
gsDPPipeSync(),
gsSPEndDisplayList(),
};
s32 N(modelCommandList)[] = {
0x00000004, 0x0000000D, 0x00000001, sizeof(N(displayList)) / sizeof(s32), &N(displayList), 0x00000002, 0x00000000,
};
Script N(main) = SCRIPT({
SI_VAR(10) = (const) 0x86;
await N(UseItemWithEffect);
UseBattleCamPreset(3);
MoveBattleCamOver(15);
SetAnimation(ACTOR_PLAYER, 0, ANIM_THROW);
PlaySound(SOUND_THROW);
sleep 3;
CreateVirtualEntity(SI_VAR(10), N(modelCommandList));
SI_VAR(0) = 1.0;
MultiplyByActorScale(SI_VAR(0));
SetVirtualEntityScale(SI_VAR(10), SI_VAR(0), SI_VAR(0), SI_VAR(0));
GetActorPos(ACTOR_PLAYER, SI_VAR(0), SI_VAR(1), SI_VAR(2));
SI_VAR(3) = 20;
SI_VAR(4) = 42;
SI_VAR(5) = 5;
MultiplyVec3ByActorScale(SI_VAR(3), SI_VAR(4), SI_VAR(5));
SI_VAR(0) += SI_VAR(3);
SI_VAR(1) += SI_VAR(4);
SI_VAR(2) += SI_VAR(5);
SetVirtualEntityPosition(SI_VAR(10), SI_VAR(0), SI_VAR(1), SI_VAR(2));
InitTargetIterator();
SetGoalToTarget(ACTOR_SELF);
GetGoalPos(ACTOR_SELF, SI_VAR(0), SI_VAR(1), SI_VAR(2));
spawn {
SI_VAR(0) = 0;
loop 18 {
SI_VAR(0) += 0xFFFFFFC4;
SetVirtualEntityRotation(SI_VAR(10), 0, 0, SI_VAR(0));
sleep 1;
}
}
SetVirtualEntityJumpGravity(SI_VAR(10), 0.80078125);
SI_VAR(2) += 5;
VirtualEntityJumpTo(SI_VAR(10), SI_VAR(0), SI_VAR(1), SI_VAR(2), 18);
GetItemPower(ITEM_DUSTY_HAMMER, SI_VAR(3), SI_VAR(4));
ApplyShrinkFromOwner(SI_VAR(3));
ItemDamageEnemy(SI_VAR(9), 0x18000000, 0, SI_VAR(3), 32);
SI_VAR(0) += 40;
SI_VAR(1) += 10;
VirtualEntityJumpTo(SI_VAR(10), SI_VAR(0), SI_VAR(1), SI_VAR(2), 10);
DeleteVirtualEntity(SI_VAR(10));
await N(PlayerGoHome);
});

View File

@ -0,0 +1,334 @@
#include "egg_missile.h"
#include "ld_addrs.h"
#include "battle/item/egg_missile1.png.h"
#include "battle/item/egg_missile2.png.h"
#include "battle/item/egg_missile3.png.h"
#include "battle/item/egg_missile4.png.h"
static HudElement* D_802A2890;
ApiStatus N(GiveRefund)(ScriptInstance* script, s32 isInitialCall) {
BattleStatus* battleStatus = &gBattleStatus;
Actor* player = battleStatus->playerActor;
s32 sellValue = gItemTable[battleStatus->selectedItemID].sellValue;
f32 facingAngleSign = 0.0f;
s32 sleepTime = 0;
f32 posX, posY, posZ;
posY = player->currentPos.y + player->size.y;
if (player_team_is_ability_active(player, ABILITY_REFUND) && sellValue > 0) {
s32 i;
s32 iconPosX, iconPosY, iconPosZ;
sellValue = (sellValue * 75 + 99) / 100;
for (i = 0; i < sellValue; i++) {
posX = player->currentPos.x;
posZ = player->currentPos.z;
make_item_entity(ITEM_COIN, posX, posY, posZ, 0x17, (i * 3) + 1, facingAngleSign, 0);
add_coins(1);
facingAngleSign += 30.0f;
}
sleepTime = (i * 3) + 30;
posX = player->currentPos.x;
posY = player->currentPos.y;
posZ = player->currentPos.z;
get_screen_coords(gCurrentCameraID, posX, posY, posZ, &iconPosX, &iconPosY, &iconPosZ);
D_802A2890 = create_hud_element(&D_80108A64);
set_hud_element_render_pos(D_802A2890, iconPosX + 36, iconPosY - 63);
}
script->varTable[0] = sleepTime;
return ApiStatus_DONE2;
}
ApiStatus N(GiveRefundCleanup)(ScriptInstance* script, s32 isInitialCall) {
BattleStatus* battleStatus = &gBattleStatus;
Actor* player = battleStatus->playerActor;
s32 sellValue = gItemTable[battleStatus->selectedItemID].sellValue;
if (player_team_is_ability_active(player, ABILITY_REFUND) && sellValue > 0) {
free_hud_element(D_802A2890);
}
return ApiStatus_DONE2;
}
ApiStatus N(func_802A123C_71CF1C)(ScriptInstance* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 a = get_variable(script, *args++);
s32 b = get_variable(script, *args++);
s32 c = get_variable(script, *args++);
playFX_17(0, a, b, c);
playFX_19(0, a, b + 20, c);
return ApiStatus_DONE2;
}
Script N(UseItemWithEffect) = SCRIPT({
if (SI_VAR(1) == 0) {
UseBattleCamPreset(69);
sleep 10;
PlaySoundAtActor(ACTOR_PLAYER, SOUND_UNKNOWN_208D);
SetAnimation(ACTOR_PLAYER, 0, ANIM_GOT_ITEM);
GetActorPos(ACTOR_PLAYER, $x, $y, $z);
$x += 18;
SetActorSpeed(ACTOR_PLAYER, 4.0);
SetGoalPos(ACTOR_PLAYER, $x, $y, $z);
PlayerRunToGoal(ACTOR_PLAYER);
$y += 45;
$effectY = $y;
$effectY += 10;
$effectY += 2;
PlayEffect(0x33, 1, $x, $effectY, $z, 1.0, 30, 0, 0, 0, 0, 0, 0, 0);
MakeItemEntity(SI_VAR(10), $x, $y, $z, 1, 0);
SI_VAR(10) = $x;
N(GiveRefund)();
sleep $x;
sleep 15;
N(GiveRefundCleanup)();
RemoveItemEntity(SI_VAR(10));
} else {
GetActorPos(ACTOR_PLAYER, $x, $y, $z);
PlaySoundAtActor(ACTOR_PLAYER, SOUND_UNKNOWN_208D);
SetAnimation(ACTOR_PLAYER, 0, ANIM_GOT_ITEM);
sleep 4;
$y += 45;
$effectY = $y;
$effectY += 10;
$effectY += 2;
PlayEffect(0x33, 1, $x, $effectY, $z, 1.0, 30, 0, 0, 0, 0, 0, 0, 0);
MakeItemEntity(SI_VAR(10), $x, $y, $z, 1, 0);
SI_VAR(10) = $x;
sleep 15;
RemoveItemEntity(SI_VAR(10));
}
});
Script N(UseItem) = SCRIPT({
UseBattleCamPreset(19);
SetBattleCamTarget(-85, 1, 0);
SetBattleCamOffsetZ(41);
SetBattleCamZoom(248);
MoveBattleCamOver(30);
sleep 10;
SetAnimation(ACTOR_PLAYER, 0, ANIM_GOT_ITEM);
GetActorPos(ACTOR_PLAYER, $x, $y, $z);
$y += 45;
MakeItemEntity(SI_VAR(10), $x, $y, $z, 1, 0);
SI_VAR(14) = $x;
N(GiveRefund)();
sleep $x;
sleep 15;
N(GiveRefundCleanup)();
RemoveItemEntity(SI_VAR(14));
});
Script N(PlayerGoHome) = SCRIPT({
UseIdleAnimation(ACTOR_PLAYER, 0);
SetGoalToHome(ACTOR_PLAYER);
SetActorSpeed(ACTOR_PLAYER, 8.0);
SetAnimation(ACTOR_PLAYER, 0, ANIM_RUNNING);
PlayerRunToGoal(ACTOR_PLAYER);
SetAnimation(ACTOR_PLAYER, 0, ANIM_10002);
UseIdleAnimation(ACTOR_PLAYER, 1);
});
Script N(EatItem) = SCRIPT({
spawn {
loop 4 {
PlaySoundAtActor(ACTOR_PLAYER, SOUND_UNKNOWN_2095);
sleep 10;
}
}
SetAnimation(ACTOR_PLAYER, 0, ANIM_EAT);
sleep 45;
});
Script N(DrinkItem) = SCRIPT({
spawn {
loop 4 {
PlaySoundAtActor(ACTOR_PLAYER, SOUND_UNKNOWN_2095);
sleep 10;
}
}
SetAnimation(ACTOR_PLAYER, 0, ANIM_DRINK);
sleep 45;
});
static s32 _pad = 0;
#include "battle/item/egg_missile1.png.inc.c"
#include "battle/item/egg_missile1.pal.inc.c"
#include "battle/item/egg_missile2.png.inc.c"
#include "battle/item/egg_missile2.pal.inc.c"
#include "battle/item/egg_missile3.png.inc.c"
#include "battle/item/egg_missile3.pal.inc.c"
#include "battle/item/egg_missile4.png.inc.c"
#include "battle/item/egg_missile4.pal.inc.c"
Vtx N(model)[] = {
{ .v = { -16, -16, 0, FALSE, 0, 0, 0, 0, 0, 255 } },
{ .v = { 15, -16, 0, FALSE, 1024, 0, 0, 0, 0, 255 } },
{ .v = { 15, 15, 0, FALSE, 1024, 1024, 0, 0, 0, 255 } },
{ .v = { -16, 15, 0, FALSE, 0, 1024, 0, 0, 0, 255 } },
};
Gfx N(frame1_displayList)[] = {
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA),
gsDPSetTexturePersp(G_TP_PERSP),
gsDPSetTextureDetail(G_TD_CLAMP),
gsDPSetTextureLOD(G_TL_TILE),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureFilter(G_TF_AVERAGE),
gsDPSetTextureConvert(G_TC_FILT),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPLoadTLUT_pal16(0, battle_item_egg_missile1_pal),
gsDPLoadTextureTile_4b(battle_item_egg_missile1_png, G_IM_FMT_CI, battle_item_egg_missile1_png_width, battle_item_egg_missile1_png_height, 0, 0, battle_item_egg_missile1_png_width - 1, battle_item_egg_missile1_png_height - 1, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD),
gsSPClearGeometryMode(G_LIGHTING),
gsSPClearGeometryMode(G_SHADING_SMOOTH),
gsSPVertex(N(model), ARRAY_COUNT(N(model)), 0),
gsSP1Triangle(0, 1, 2, 0),
gsSP1Triangle(0, 2, 3, 0),
gsDPPipeSync(),
gsSPEndDisplayList(),
};
Gfx N(frame2_displayList)[] = {
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA),
gsDPSetTexturePersp(G_TP_PERSP),
gsDPSetTextureDetail(G_TD_CLAMP),
gsDPSetTextureLOD(G_TL_TILE),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureFilter(G_TF_AVERAGE),
gsDPSetTextureConvert(G_TC_FILT),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPLoadTLUT_pal16(0, battle_item_egg_missile2_pal),
gsDPLoadTextureTile_4b(battle_item_egg_missile2_png, G_IM_FMT_CI, battle_item_egg_missile2_png_width, 0, 0, 0, battle_item_egg_missile2_png_width - 1, battle_item_egg_missile2_png_height - 1, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD),
gsSPClearGeometryMode(G_LIGHTING),
gsSPClearGeometryMode(G_SHADING_SMOOTH),
gsSPVertex(N(model), ARRAY_COUNT(N(model)), 0),
gsSP1Triangle(0, 1, 2, 0),
gsSP1Triangle(0, 2, 3, 0),
gsDPPipeSync(),
gsSPEndDisplayList(),
};
Gfx N(frame3_displayList)[] = {
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA),
gsDPSetTexturePersp(G_TP_PERSP),
gsDPSetTextureDetail(G_TD_CLAMP),
gsDPSetTextureLOD(G_TL_TILE),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureFilter(G_TF_AVERAGE),
gsDPSetTextureConvert(G_TC_FILT),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPLoadTLUT_pal16(0, battle_item_egg_missile3_pal),
gsDPLoadTextureTile_4b(battle_item_egg_missile3_png, G_IM_FMT_CI, battle_item_egg_missile3_png_width, 0, 0, 0, battle_item_egg_missile3_png_width - 1, battle_item_egg_missile3_png_height - 1, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD),
gsSPClearGeometryMode(G_LIGHTING),
gsSPClearGeometryMode(G_SHADING_SMOOTH),
gsSPVertex(N(model), ARRAY_COUNT(N(model)), 0),
gsSP1Triangle(0, 1, 2, 0),
gsSP1Triangle(0, 2, 3, 0),
gsDPPipeSync(),
gsSPEndDisplayList(),
};
Gfx N(frame4_displayList)[] = {
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA),
gsDPSetTexturePersp(G_TP_PERSP),
gsDPSetTextureDetail(G_TD_CLAMP),
gsDPSetTextureLOD(G_TL_TILE),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureFilter(G_TF_AVERAGE),
gsDPSetTextureConvert(G_TC_FILT),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPLoadTLUT_pal16(0, battle_item_egg_missile4_pal),
gsDPLoadTextureTile_4b(battle_item_egg_missile4_png, G_IM_FMT_CI, battle_item_egg_missile4_png_width, 0, 0, 0, battle_item_egg_missile4_png_width - 1, battle_item_egg_missile4_png_height - 1, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD),
gsSPClearGeometryMode(G_LIGHTING),
gsSPClearGeometryMode(G_SHADING_SMOOTH),
gsSPVertex(N(model), ARRAY_COUNT(N(model)), 0),
gsSP1Triangle(0, 1, 2, 0),
gsSP1Triangle(0, 2, 3, 0),
gsDPPipeSync(),
gsSPEndDisplayList(),
};
s32 N(modelCommandList)[] = {
0x00000004, 0x0000000D,
0x00000001, 0x00000002, &N(frame1_displayList),
0x00000001, 0x00000002, &N(frame2_displayList),
0x00000001, 0x00000002, &N(frame3_displayList),
0x00000002, 0x00000000,
0x00000004, 0x0000000D,
0x00000001, sizeof(N(frame4_displayList)) / sizeof(s32), &N(frame4_displayList),
0x00000002, 0x00000000,
};
Script N(main) = SCRIPT({
SI_VAR(10) = (const) ITEM_EGG_MISSILE;
await N(UseItemWithEffect);
UseBattleCamPreset(3);
MoveBattleCamOver(15);
SetAnimation(ACTOR_PLAYER, 0, ANIM_THROW);
PlaySound(SOUND_THROW);
sleep 3;
CreateVirtualEntity(SI_VAR(10), N(modelCommandList));
GetActorPos(ACTOR_PLAYER, SI_VAR(0), SI_VAR(1), SI_VAR(2));
SI_VAR(0) += 20;
SI_VAR(1) += 42;
SI_VAR(2) += 5;
SetVirtualEntityPosition(SI_VAR(10), SI_VAR(0), SI_VAR(1), SI_VAR(2));
InitTargetIterator();
SetGoalToTarget(ACTOR_SELF);
GetGoalPos(ACTOR_SELF, SI_VAR(0), SI_VAR(1), SI_VAR(2));
spawn {
SI_VAR(0) = 0;
loop 18 {
SI_VAR(0) += 60;
SetVirtualEntityRotation(SI_VAR(10), 0, 0, SI_VAR(0));
sleep 1;
}
}
SetVirtualEntityJumpGravity(SI_VAR(10), 1.0);
SI_VAR(2) += 5;
VirtualEntityJumpTo(SI_VAR(10), SI_VAR(0), SI_VAR(1), SI_VAR(2), 18);
DeleteVirtualEntity(SI_VAR(10));
PlaySound(SOUND_UNKNOWN_2010);
N(func_802A123C_71CF1C)(SI_VAR(0), SI_VAR(1), SI_VAR(2));
spawn {
StartRumble(5);
ShakeCam(1, 0, 2, 0.75);
ShakeCam(1, 0, 5, 1.5);
ShakeCam(1, 0, 4, 1.2001953125);
ShakeCam(1, 0, 2, 0.4501953125);
}
GetItemPower(ITEM_EGG_MISSILE, SI_VAR(0), SI_VAR(1));
ItemDamageEnemy(SI_VAR(0), 0x18000202, 0, SI_VAR(0), 32);
await N(PlayerGoHome);
});

View File

@ -1,155 +0,0 @@
#include "egg_missile.h"
#include "ld_addrs.h"
#include "battle/item/egg_missile/egg_missile1.png.h"
#include "battle/item/egg_missile/egg_missile2.png.h"
#include "battle/item/egg_missile/egg_missile3.png.h"
#include "battle/item/egg_missile/egg_missile4.png.h"
Vtx N(model)[] = {
{ .v = { -16, -16, 0, FALSE, 0, 0, 0, 0, 0, 255 } },
{ .v = { 15, -16, 0, FALSE, 1024, 0, 0, 0, 0, 255 } },
{ .v = { 15, 15, 0, FALSE, 1024, 1024, 0, 0, 0, 255 } },
{ .v = { -16, 15, 0, FALSE, 0, 1024, 0, 0, 0, 255 } },
};
Gfx N(frame1_displayList)[] = {
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA),
gsDPSetTexturePersp(G_TP_PERSP),
gsDPSetTextureDetail(G_TD_CLAMP),
gsDPSetTextureLOD(G_TL_TILE),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureFilter(G_TF_AVERAGE),
gsDPSetTextureConvert(G_TC_FILT),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPLoadTLUT_pal16(0, &N(egg_missile1_pal)),
gsDPLoadTextureTile_4b(&N(egg_missile1_png), G_IM_FMT_CI, N(egg_missile1_png_width), N(egg_missile1_png_height), 0, 0, N(egg_missile1_png_width) - 1, N(egg_missile1_png_height) - 1, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD),
gsSPClearGeometryMode(G_LIGHTING),
gsSPClearGeometryMode(G_SHADING_SMOOTH),
gsSPVertex(N(model), ARRAY_COUNT(N(model)), 0),
gsSP1Triangle(0, 1, 2, 0),
gsSP1Triangle(0, 2, 3, 0),
gsDPPipeSync(),
gsSPEndDisplayList(),
};
Gfx N(frame2_displayList)[] = {
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA),
gsDPSetTexturePersp(G_TP_PERSP),
gsDPSetTextureDetail(G_TD_CLAMP),
gsDPSetTextureLOD(G_TL_TILE),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureFilter(G_TF_AVERAGE),
gsDPSetTextureConvert(G_TC_FILT),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPLoadTLUT_pal16(0, &N(egg_missile2_pal)),
gsDPLoadTextureTile_4b(&N(egg_missile2_png), G_IM_FMT_CI, N(egg_missile2_png_width), 0, 0, 0, N(egg_missile2_png_width) - 1, N(egg_missile2_png_height) - 1, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD),
gsSPClearGeometryMode(G_LIGHTING),
gsSPClearGeometryMode(G_SHADING_SMOOTH),
gsSPVertex(N(model), ARRAY_COUNT(N(model)), 0),
gsSP1Triangle(0, 1, 2, 0),
gsSP1Triangle(0, 2, 3, 0),
gsDPPipeSync(),
gsSPEndDisplayList(),
};
Gfx N(frame3_displayList)[] = {
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA),
gsDPSetTexturePersp(G_TP_PERSP),
gsDPSetTextureDetail(G_TD_CLAMP),
gsDPSetTextureLOD(G_TL_TILE),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureFilter(G_TF_AVERAGE),
gsDPSetTextureConvert(G_TC_FILT),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPLoadTLUT_pal16(0, &N(egg_missile3_pal)),
gsDPLoadTextureTile_4b(&N(egg_missile3_png), G_IM_FMT_CI, N(egg_missile3_png_width), 0, 0, 0, N(egg_missile3_png_width) - 1, N(egg_missile3_png_height) - 1, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD),
gsSPClearGeometryMode(G_LIGHTING),
gsSPClearGeometryMode(G_SHADING_SMOOTH),
gsSPVertex(N(model), ARRAY_COUNT(N(model)), 0),
gsSP1Triangle(0, 1, 2, 0),
gsSP1Triangle(0, 2, 3, 0),
gsDPPipeSync(),
gsSPEndDisplayList(),
};
Gfx N(frame4_displayList)[] = {
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA),
gsDPSetTexturePersp(G_TP_PERSP),
gsDPSetTextureDetail(G_TD_CLAMP),
gsDPSetTextureLOD(G_TL_TILE),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureFilter(G_TF_AVERAGE),
gsDPSetTextureConvert(G_TC_FILT),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPLoadTLUT_pal16(0, &N(egg_missile4_pal)),
gsDPLoadTextureTile_4b(&N(egg_missile4_png), G_IM_FMT_CI, N(egg_missile4_png_width), 0, 0, 0, N(egg_missile4_png_width) - 1, N(egg_missile4_png_height) - 1, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD),
gsSPClearGeometryMode(G_LIGHTING),
gsSPClearGeometryMode(G_SHADING_SMOOTH),
gsSPVertex(N(model), ARRAY_COUNT(N(model)), 0),
gsSP1Triangle(0, 1, 2, 0),
gsSP1Triangle(0, 2, 3, 0),
gsDPPipeSync(),
gsSPEndDisplayList(),
};
s32 N(modelCommandList)[] = {
0x00000004, 0x0000000D,
0x00000001, 0x00000002, &N(frame1_displayList),
0x00000001, 0x00000002, &N(frame2_displayList),
0x00000001, 0x00000002, &N(frame3_displayList),
0x00000002, 0x00000000,
0x00000004, 0x0000000D,
0x00000001, sizeof(N(frame4_displayList)) / sizeof(s32), &N(frame4_displayList),
0x00000002, 0x00000000,
};
Script N(main) = SCRIPT({
SI_VAR(10) = (const) ITEM_EGG_MISSILE;
await N(UseItemWithEffect);
UseBattleCamPreset(3);
MoveBattleCamOver(15);
SetAnimation(ACTOR_PLAYER, 0, ANIM_THROW);
PlaySound(SOUND_THROW);
sleep 3;
CreateVirtualEntity(SI_VAR(10), N(modelCommandList));
GetActorPos(ACTOR_PLAYER, SI_VAR(0), SI_VAR(1), SI_VAR(2));
SI_VAR(0) += 20;
SI_VAR(1) += 42;
SI_VAR(2) += 5;
SetVirtualEntityPosition(SI_VAR(10), SI_VAR(0), SI_VAR(1), SI_VAR(2));
InitTargetIterator();
SetGoalToTarget(ACTOR_SELF);
GetGoalPos(ACTOR_SELF, SI_VAR(0), SI_VAR(1), SI_VAR(2));
spawn {
SI_VAR(0) = 0;
loop 18 {
SI_VAR(0) += 60;
SetVirtualEntityRotation(SI_VAR(10), 0, 0, SI_VAR(0));
sleep 1;
}
}
SetVirtualEntityJumpGravity(SI_VAR(10), 1.0);
SI_VAR(2) += 5;
VirtualEntityJumpTo(SI_VAR(10), SI_VAR(0), SI_VAR(1), SI_VAR(2), 18);
DeleteVirtualEntity(SI_VAR(10));
PlaySound(SOUND_UNKNOWN_2010);
N(func_802A123C_71CF1C)(SI_VAR(0), SI_VAR(1), SI_VAR(2));
spawn {
StartRumble(5);
ShakeCam(1, 0, 2, 0.75);
ShakeCam(1, 0, 5, 1.5);
ShakeCam(1, 0, 4, 1.2001953125);
ShakeCam(1, 0, 2, 0.4501953125);
}
GetItemPower(ITEM_EGG_MISSILE, SI_VAR(0), SI_VAR(1));
ItemDamageEnemy(SI_VAR(0), 0x18000202, 0, SI_VAR(0), 32);
await N(PlayerGoHome);
});

View File

@ -1,169 +0,0 @@
#include "egg_missile.h"
static HudElement* D_802A2890;
ApiStatus N(GiveRefund)(ScriptInstance* script, s32 isInitialCall) {
BattleStatus* battleStatus = &gBattleStatus;
Actor* player = battleStatus->playerActor;
s32 sellValue = gItemTable[battleStatus->selectedItemID].sellValue;
f32 facingAngleSign = 0.0f;
s32 sleepTime = 0;
f32 posX, posY, posZ;
posY = player->currentPos.y + player->size.y;
if (player_team_is_ability_active(player, ABILITY_REFUND) && sellValue > 0) {
s32 i;
s32 iconPosX, iconPosY, iconPosZ;
sellValue = (sellValue * 75 + 99) / 100;
for (i = 0; i < sellValue; i++) {
posX = player->currentPos.x;
posZ = player->currentPos.z;
make_item_entity(ITEM_COIN, posX, posY, posZ, 0x17, (i * 3) + 1, facingAngleSign, 0);
add_coins(1);
facingAngleSign += 30.0f;
}
sleepTime = (i * 3) + 30;
posX = player->currentPos.x;
posY = player->currentPos.y;
posZ = player->currentPos.z;
get_screen_coords(gCurrentCameraID, posX, posY, posZ, &iconPosX, &iconPosY, &iconPosZ);
D_802A2890 = create_hud_element(&D_80108A64);
set_hud_element_render_pos(D_802A2890, iconPosX + 36, iconPosY - 63);
}
script->varTable[0] = sleepTime;
return ApiStatus_DONE2;
}
ApiStatus N(GiveRefundCleanup)(ScriptInstance* script, s32 isInitialCall) {
BattleStatus* battleStatus = &gBattleStatus;
Actor* player = battleStatus->playerActor;
s32 sellValue = gItemTable[battleStatus->selectedItemID].sellValue;
if (player_team_is_ability_active(player, ABILITY_REFUND) && sellValue > 0) {
free_hud_element(D_802A2890);
}
return ApiStatus_DONE2;
}
ApiStatus N(func_802A123C_71CF1C)(ScriptInstance* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 a = get_variable(script, *args++);
s32 b = get_variable(script, *args++);
s32 c = get_variable(script, *args++);
playFX_17(0, a, b, c);
playFX_19(0, a, b + 20, c);
return ApiStatus_DONE2;
}
Script N(UseItemWithEffect) = SCRIPT({
if (SI_VAR(1) == 0) {
UseBattleCamPreset(69);
sleep 10;
PlaySoundAtActor(ACTOR_PLAYER, SOUND_UNKNOWN_208D);
SetAnimation(ACTOR_PLAYER, 0, ANIM_GOT_ITEM);
GetActorPos(ACTOR_PLAYER, $x, $y, $z);
$x += 18;
SetActorSpeed(ACTOR_PLAYER, 4.0);
SetGoalPos(ACTOR_PLAYER, $x, $y, $z);
PlayerRunToGoal(ACTOR_PLAYER);
$y += 45;
$effectY = $y;
$effectY += 10;
$effectY += 2;
PlayEffect(0x33, 1, $x, $effectY, $z, 1.0, 30, 0, 0, 0, 0, 0, 0, 0);
MakeItemEntity(SI_VAR(10), $x, $y, $z, 1, 0);
SI_VAR(10) = $x;
N(GiveRefund)();
sleep $x;
sleep 15;
N(GiveRefundCleanup)();
RemoveItemEntity(SI_VAR(10));
} else {
GetActorPos(ACTOR_PLAYER, $x, $y, $z);
PlaySoundAtActor(ACTOR_PLAYER, SOUND_UNKNOWN_208D);
SetAnimation(ACTOR_PLAYER, 0, ANIM_GOT_ITEM);
sleep 4;
$y += 45;
$effectY = $y;
$effectY += 10;
$effectY += 2;
PlayEffect(0x33, 1, $x, $effectY, $z, 1.0, 30, 0, 0, 0, 0, 0, 0, 0);
MakeItemEntity(SI_VAR(10), $x, $y, $z, 1, 0);
SI_VAR(10) = $x;
sleep 15;
RemoveItemEntity(SI_VAR(10));
}
});
Script N(UseItem) = SCRIPT({
UseBattleCamPreset(19);
SetBattleCamTarget(-85, 1, 0);
SetBattleCamOffsetZ(41);
SetBattleCamZoom(248);
MoveBattleCamOver(30);
sleep 10;
SetAnimation(ACTOR_PLAYER, 0, ANIM_GOT_ITEM);
GetActorPos(ACTOR_PLAYER, $x, $y, $z);
$y += 45;
MakeItemEntity(SI_VAR(10), $x, $y, $z, 1, 0);
SI_VAR(14) = $x;
N(GiveRefund)();
sleep $x;
sleep 15;
N(GiveRefundCleanup)();
RemoveItemEntity(SI_VAR(14));
});
Script N(PlayerGoHome) = SCRIPT({
UseIdleAnimation(ACTOR_PLAYER, 0);
SetGoalToHome(ACTOR_PLAYER);
SetActorSpeed(ACTOR_PLAYER, 8.0);
SetAnimation(ACTOR_PLAYER, 0, ANIM_RUNNING);
PlayerRunToGoal(ACTOR_PLAYER);
SetAnimation(ACTOR_PLAYER, 0, ANIM_10002);
UseIdleAnimation(ACTOR_PLAYER, 1);
});
Script N(EatItem) = SCRIPT({
spawn {
loop 4 {
PlaySoundAtActor(ACTOR_PLAYER, SOUND_UNKNOWN_2095);
sleep 10;
}
}
SetAnimation(ACTOR_PLAYER, 0, ANIM_EAT);
sleep 45;
});
Script N(DrinkItem) = SCRIPT({
spawn {
loop 4 {
PlaySoundAtActor(ACTOR_PLAYER, SOUND_UNKNOWN_2095);
sleep 10;
}
}
SetAnimation(ACTOR_PLAYER, 0, ANIM_DRINK);
sleep 45;
});

View File

@ -1,4 +1,6 @@
#include "insecticide_herb.h"
#include "ld_addrs.h"
#include "battle/item/insecticide_herb.png.h"
static HudElement* D_802A21C0;
@ -203,3 +205,102 @@ Script N(DrinkItem) = SCRIPT({
SetAnimation(ACTOR_PLAYER, 0, ANIM_DRINK);
sleep 45;
});
static s32 _pad = 0; // XXX
#include "battle/item/insecticide_herb.png.inc.c"
#include "battle/item/insecticide_herb.pal.inc.c"
Vtx N(model)[] = {
{ .v = { -16, -16, 0, FALSE, 0, 0, 0, 0, 0, 255 } },
{ .v = { 15, -16, 0, FALSE, 1024, 0, 0, 0, 0, 255 } },
{ .v = { 15, 15, 0, FALSE, 1024, 1024, 0, 0, 0, 255 } },
{ .v = { -16, 15, 0, FALSE, 0, 1024, 0, 0, 0, 255 } },
};
Gfx N(displayList)[] = {
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA),
gsDPSetTexturePersp(G_TP_PERSP),
gsDPSetTextureDetail(G_TD_CLAMP),
gsDPSetTextureLOD(G_TL_TILE),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureFilter(G_TF_AVERAGE),
gsDPSetTextureConvert(G_TC_FILT),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPLoadTLUT_pal16(0, battle_item_insecticide_herb_pal),
gsDPLoadTextureTile_4b(battle_item_insecticide_herb_png, G_IM_FMT_CI, battle_item_insecticide_herb_png_width, battle_item_insecticide_herb_png_height, 0, 0, battle_item_insecticide_herb_png_width - 1, battle_item_insecticide_herb_png_height - 1, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD),
gsSPClearGeometryMode(G_LIGHTING),
gsSPClearGeometryMode(G_SHADING_SMOOTH),
gsSPVertex(N(model), ARRAY_COUNT(N(model)), 0),
gsSP1Triangle(0, 1, 2, 0),
gsSP1Triangle(0, 2, 3, 0),
gsDPPipeSync(),
gsSPEndDisplayList(),
};
s32 N(modelCommandList)[] = {
0x00000004, 0x0000000D, 0x00000001, sizeof(N(displayList)) / sizeof(s32), &N(displayList), 0x00000002, 0x00000000,
};
Script script = SCRIPT({
SI_VAR(10) = (const) ITEM_INSECTICIDE_HERB;
await N(UseItemWithEffect);
UseBattleCamPreset(3);
MoveBattleCamOver(15);
SetAnimation(ACTOR_PLAYER, 0, ANIM_THROW);
PlaySound(SOUND_THROW);
sleep 3;
CreateVirtualEntity(SI_VAR(10), N(modelCommandList));
SI_VAR(0) = 1.0;
MultiplyByActorScale(SI_VAR(0));
SetVirtualEntityScale(SI_VAR(10), SI_VAR(0), SI_VAR(0), SI_VAR(0));
GetActorPos(ACTOR_PLAYER, SI_VAR(0), SI_VAR(1), SI_VAR(2));
SI_VAR(3) = 20;
SI_VAR(4) = 42;
SI_VAR(5) = 5;
MultiplyVec3ByActorScale(SI_VAR(3), SI_VAR(4), SI_VAR(5));
SI_VAR(0) += SI_VAR(3);
SI_VAR(1) += SI_VAR(4);
SI_VAR(2) += SI_VAR(5);
SetVirtualEntityPosition(SI_VAR(10), SI_VAR(0), SI_VAR(1), SI_VAR(2));
InitTargetIterator();
SetGoalToTarget(ACTOR_SELF);
GetGoalPos(ACTOR_SELF, SI_VAR(0), SI_VAR(1), SI_VAR(2));
spawn {
SI_VAR(0) = 0;
loop 18 {
SI_VAR(0) += 0xFFFFFFC4;
SetVirtualEntityRotation(SI_VAR(10), 0, 0, SI_VAR(0));
sleep 1;
}
}
SetVirtualEntityJumpGravity(SI_VAR(10), 0.80078125);
SI_VAR(2) += 5;
VirtualEntityJumpTo(SI_VAR(10), SI_VAR(0), SI_VAR(1), SI_VAR(2), 18);
PlayEffect(0x7, 3, SI_VAR(0), SI_VAR(1), SI_VAR(2), 0, 0, 0, 0, 0, 0, 0, 0, 0);
SI_VAR(0) -= 10;
PlayEffect(0x7, 3, SI_VAR(0), SI_VAR(1), SI_VAR(2), 0, 0, 0, 0, 0, 0, 0, 0, 0);
SI_VAR(0) += 20;
PlayEffect(0x7, 3, SI_VAR(0), SI_VAR(1), SI_VAR(2), 0, 0, 0, 0, 0, 0, 0, 0, 0);
spawn {
N(func_802A12E0_72AA30)(SI_VAR(0), SI_VAR(1), SI_VAR(2));
sleep 3;
N(func_802A12E0_72AA30)(SI_VAR(0), SI_VAR(1), SI_VAR(2));
sleep 3;
N(func_802A12E0_72AA30)(SI_VAR(0), SI_VAR(1), SI_VAR(2));
}
InitTargetIterator();
SetGoalToTarget(ACTOR_SELF);
N(func_802A123C_72A98C)();
DeleteVirtualEntity(SI_VAR(10));
if (SI_VAR(9) == 0) {
ItemDamageEnemy(SI_VAR(0), 0, 0, 0, 32);
} else {
InitTargetIterator();
SetGoalToTarget(ACTOR_SELF);
N(func_802A1280_72A9D0)();
}
await N(PlayerGoHome);
});

View File

@ -1,97 +0,0 @@
#include "insecticide_herb.h"
#include "ld_addrs.h"
#include "battle/item/insecticide_herb/insecticide_herb.png.h"
Vtx N(model)[] = {
{ .v = { -16, -16, 0, FALSE, 0, 0, 0, 0, 0, 255 } },
{ .v = { 15, -16, 0, FALSE, 1024, 0, 0, 0, 0, 255 } },
{ .v = { 15, 15, 0, FALSE, 1024, 1024, 0, 0, 0, 255 } },
{ .v = { -16, 15, 0, FALSE, 0, 1024, 0, 0, 0, 255 } },
};
Gfx N(displayList)[] = {
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA),
gsDPSetTexturePersp(G_TP_PERSP),
gsDPSetTextureDetail(G_TD_CLAMP),
gsDPSetTextureLOD(G_TL_TILE),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureFilter(G_TF_AVERAGE),
gsDPSetTextureConvert(G_TC_FILT),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPLoadTLUT_pal16(0, &N(insecticide_herb_pal)),
gsDPLoadTextureTile_4b(&N(insecticide_herb_png), G_IM_FMT_CI, N(insecticide_herb_png_width), N(insecticide_herb_png_height), 0, 0, N(insecticide_herb_png_width) - 1, N(insecticide_herb_png_height) - 1, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD),
gsSPClearGeometryMode(G_LIGHTING),
gsSPClearGeometryMode(G_SHADING_SMOOTH),
gsSPVertex(N(model), ARRAY_COUNT(N(model)), 0),
gsSP1Triangle(0, 1, 2, 0),
gsSP1Triangle(0, 2, 3, 0),
gsDPPipeSync(),
gsSPEndDisplayList(),
};
s32 N(modelCommandList)[] = {
0x00000004, 0x0000000D, 0x00000001, sizeof(N(displayList)) / sizeof(s32), &N(displayList), 0x00000002, 0x00000000,
};
Script script = SCRIPT({
SI_VAR(10) = (const) ITEM_INSECTICIDE_HERB;
await N(UseItemWithEffect);
UseBattleCamPreset(3);
MoveBattleCamOver(15);
SetAnimation(ACTOR_PLAYER, 0, ANIM_THROW);
PlaySound(SOUND_THROW);
sleep 3;
CreateVirtualEntity(SI_VAR(10), N(modelCommandList));
SI_VAR(0) = 1.0;
MultiplyByActorScale(SI_VAR(0));
SetVirtualEntityScale(SI_VAR(10), SI_VAR(0), SI_VAR(0), SI_VAR(0));
GetActorPos(ACTOR_PLAYER, SI_VAR(0), SI_VAR(1), SI_VAR(2));
SI_VAR(3) = 20;
SI_VAR(4) = 42;
SI_VAR(5) = 5;
MultiplyVec3ByActorScale(SI_VAR(3), SI_VAR(4), SI_VAR(5));
SI_VAR(0) += SI_VAR(3);
SI_VAR(1) += SI_VAR(4);
SI_VAR(2) += SI_VAR(5);
SetVirtualEntityPosition(SI_VAR(10), SI_VAR(0), SI_VAR(1), SI_VAR(2));
InitTargetIterator();
SetGoalToTarget(ACTOR_SELF);
GetGoalPos(ACTOR_SELF, SI_VAR(0), SI_VAR(1), SI_VAR(2));
spawn {
SI_VAR(0) = 0;
loop 18 {
SI_VAR(0) += 0xFFFFFFC4;
SetVirtualEntityRotation(SI_VAR(10), 0, 0, SI_VAR(0));
sleep 1;
}
}
SetVirtualEntityJumpGravity(SI_VAR(10), 0.80078125);
SI_VAR(2) += 5;
VirtualEntityJumpTo(SI_VAR(10), SI_VAR(0), SI_VAR(1), SI_VAR(2), 18);
PlayEffect(0x7, 3, SI_VAR(0), SI_VAR(1), SI_VAR(2), 0, 0, 0, 0, 0, 0, 0, 0, 0);
SI_VAR(0) -= 10;
PlayEffect(0x7, 3, SI_VAR(0), SI_VAR(1), SI_VAR(2), 0, 0, 0, 0, 0, 0, 0, 0, 0);
SI_VAR(0) += 20;
PlayEffect(0x7, 3, SI_VAR(0), SI_VAR(1), SI_VAR(2), 0, 0, 0, 0, 0, 0, 0, 0, 0);
spawn {
N(func_802A12E0_72AA30)(SI_VAR(0), SI_VAR(1), SI_VAR(2));
sleep 3;
N(func_802A12E0_72AA30)(SI_VAR(0), SI_VAR(1), SI_VAR(2));
sleep 3;
N(func_802A12E0_72AA30)(SI_VAR(0), SI_VAR(1), SI_VAR(2));
}
InitTargetIterator();
SetGoalToTarget(ACTOR_SELF);
N(func_802A123C_72A98C)();
DeleteVirtualEntity(SI_VAR(10));
if (SI_VAR(9) == 0) {
ItemDamageEnemy(SI_VAR(0), 0, 0, 0, 32);
} else {
InitTargetIterator();
SetGoalToTarget(ACTOR_SELF);
N(func_802A1280_72A9D0)();
}
await N(PlayerGoHome);
});

View File

@ -1,4 +1,6 @@
#include "mystery.h"
#include "ld_addrs.h"
#include "battle/item/mystery.png.h"
static HudElement* D_802A25C0;
@ -373,3 +375,97 @@ Script N(DrinkItem) = SCRIPT({
SetAnimation(ACTOR_PLAYER, 0, ANIM_DRINK);
sleep 45;
});
static s32 _pad = 0;
#include "battle/item/mystery.png.inc.c"
#include "battle/item/mystery.pal.inc.c"
Vtx N(model)[] = {
{ .v = { -16, -16, 0, FALSE, 0, 0, 0, 0, 0, 255 } },
{ .v = { 15, -16, 0, FALSE, 1024, 0, 0, 0, 0, 255 } },
{ .v = { 15, 15, 0, FALSE, 1024, 1024, 0, 0, 0, 255 } },
{ .v = { -16, 15, 0, FALSE, 0, 1024, 0, 0, 0, 255 } },
};
Gfx N(displayList)[] = {
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA),
gsDPSetTexturePersp(G_TP_PERSP),
gsDPSetTextureDetail(G_TD_CLAMP),
gsDPSetTextureLOD(G_TL_TILE),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureFilter(G_TF_AVERAGE),
gsDPSetTextureConvert(G_TC_FILT),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPLoadTLUT_pal16(0, battle_item_mystery_pal),
gsDPLoadTextureTile_4b(battle_item_mystery_png, G_IM_FMT_CI, battle_item_mystery_png_width, battle_item_mystery_png_height, 0, 0, battle_item_mystery_png_width - 1, battle_item_mystery_png_height - 1, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD),
gsSPClearGeometryMode(G_LIGHTING),
gsSPClearGeometryMode(G_SHADING_SMOOTH),
gsSPVertex(N(model), ARRAY_COUNT(N(model)), 0),
gsSP1Triangle(0, 1, 2, 0),
gsSP1Triangle(0, 2, 3, 0),
gsDPPipeSync(),
gsSPEndDisplayList(),
};
s32 N(modelCommandList)[] = {
0x00000004, 0x0000000D, 0x00000001, sizeof(N(displayList)) / sizeof(s32), &N(displayList), 0x00000002, 0x00000000,
};
s32 N(D_802A227C_72D82C)[8] = {
0x0000008A, 0x0000008C, 0x00000080, 0x00000088,
0x0000009A, 0x00000082, 0x00000085, 0x0000008A
};
s32 N(D_802A229C_72D84C)[8] = {
0x0000008A, 0x0000008C, 0x00000085, 0x00000088,
0x0000008A, 0x0000008C, 0x00000085, 0x0000008A
};
Script N(main) = SCRIPT({
SI_VAR(10) = (const) ITEM_MYSTERY;
await N(UseItemWithEffect);
spawn {
sleep 220;
PlaySoundAtActor(ACTOR_PLAYER, SOUND_UNKNOWN_3F3);
}
PlaySoundAtActor(ACTOR_PLAYER, SOUND_UNKNOWN_368);
N(func_802A13E4_72C994)();
sleep 2;
if (SI_VAR(0) != ITEM_PEBBLE) {
jump UseMystery;
return;
}
CreateVirtualEntity(SI_VAR(10), N(modelCommandList));
GetActorPos(ACTOR_PLAYER, SI_VAR(0), SI_VAR(1), SI_VAR(2));
SI_VAR(1) += 150;
SetVirtualEntityPosition(SI_VAR(10), SI_VAR(0), SI_VAR(1), SI_VAR(2));
SetOwnerTarget(0, 0);
SetGoalToTarget(ACTOR_SELF);
GetGoalPos(ACTOR_SELF, SI_VAR(0), SI_VAR(1), SI_VAR(2));
spawn {
SI_VAR(0) = 0;
loop 18 {
SI_VAR(0) += 0xFFFFFFC4;
SetVirtualEntityRotation(SI_VAR(10), 0, 0, SI_VAR(0));
sleep 1;
}
}
SetVirtualEntityJumpGravity(SI_VAR(10), 0.6005859375);
SI_VAR(2) += 5;
VirtualEntityJumpTo(SI_VAR(10), SI_VAR(0), SI_VAR(1), SI_VAR(2), 12);
spawn {
SI_VAR(0) += 60;
SI_VAR(1) += 0;
VirtualEntityJumpTo(SI_VAR(10), SI_VAR(0), SI_VAR(1), SI_VAR(2), 16);
DeleteVirtualEntity(SI_VAR(10));
}
SetTargetActor(ACTOR_SELF, 0);
SetGoalToTarget(ACTOR_SELF);
GetGoalPos(ACTOR_SELF, SI_VAR(0), SI_VAR(1), SI_VAR(2));
N(func_802A188C_72CE3C)(SI_VAR(0), SI_VAR(1), SI_VAR(2));
SetBattleFlagBits(32, 1);
DispatchDamagePlayerEvent(1, EVENT_HIT);
});

View File

@ -1,92 +0,0 @@
#include "mystery.h"
#include "ld_addrs.h"
#include "battle/item/mystery/mystery.png.h"
Vtx N(model)[] = {
{ .v = { -16, -16, 0, FALSE, 0, 0, 0, 0, 0, 255 } },
{ .v = { 15, -16, 0, FALSE, 1024, 0, 0, 0, 0, 255 } },
{ .v = { 15, 15, 0, FALSE, 1024, 1024, 0, 0, 0, 255 } },
{ .v = { -16, 15, 0, FALSE, 0, 1024, 0, 0, 0, 255 } },
};
Gfx N(displayList)[] = {
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA),
gsDPSetTexturePersp(G_TP_PERSP),
gsDPSetTextureDetail(G_TD_CLAMP),
gsDPSetTextureLOD(G_TL_TILE),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureFilter(G_TF_AVERAGE),
gsDPSetTextureConvert(G_TC_FILT),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPLoadTLUT_pal16(0, &N(mystery_pal)),
gsDPLoadTextureTile_4b(&N(mystery_png), G_IM_FMT_CI, N(mystery_png_width), N(mystery_png_height), 0, 0, N(mystery_png_width) - 1, N(mystery_png_height) - 1, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD),
gsSPClearGeometryMode(G_LIGHTING),
gsSPClearGeometryMode(G_SHADING_SMOOTH),
gsSPVertex(N(model), ARRAY_COUNT(N(model)), 0),
gsSP1Triangle(0, 1, 2, 0),
gsSP1Triangle(0, 2, 3, 0),
gsDPPipeSync(),
gsSPEndDisplayList(),
};
s32 N(modelCommandList)[] = {
0x00000004, 0x0000000D, 0x00000001, sizeof(N(displayList)) / sizeof(s32), &N(displayList), 0x00000002, 0x00000000,
};
s32 N(D_802A227C_72D82C)[8] = {
0x0000008A, 0x0000008C, 0x00000080, 0x00000088,
0x0000009A, 0x00000082, 0x00000085, 0x0000008A
};
s32 N(D_802A229C_72D84C)[8] = {
0x0000008A, 0x0000008C, 0x00000085, 0x00000088,
0x0000008A, 0x0000008C, 0x00000085, 0x0000008A
};
Script N(main) = SCRIPT({
SI_VAR(10) = (const) ITEM_MYSTERY;
await N(UseItemWithEffect);
spawn {
sleep 220;
PlaySoundAtActor(ACTOR_PLAYER, SOUND_UNKNOWN_3F3);
}
PlaySoundAtActor(ACTOR_PLAYER, SOUND_UNKNOWN_368);
N(func_802A13E4_72C994)();
sleep 2;
if (SI_VAR(0) != ITEM_PEBBLE) {
jump UseMystery;
return;
}
CreateVirtualEntity(SI_VAR(10), N(modelCommandList));
GetActorPos(ACTOR_PLAYER, SI_VAR(0), SI_VAR(1), SI_VAR(2));
SI_VAR(1) += 150;
SetVirtualEntityPosition(SI_VAR(10), SI_VAR(0), SI_VAR(1), SI_VAR(2));
SetOwnerTarget(0, 0);
SetGoalToTarget(ACTOR_SELF);
GetGoalPos(ACTOR_SELF, SI_VAR(0), SI_VAR(1), SI_VAR(2));
spawn {
SI_VAR(0) = 0;
loop 18 {
SI_VAR(0) += 0xFFFFFFC4;
SetVirtualEntityRotation(SI_VAR(10), 0, 0, SI_VAR(0));
sleep 1;
}
}
SetVirtualEntityJumpGravity(SI_VAR(10), 0.6005859375);
SI_VAR(2) += 5;
VirtualEntityJumpTo(SI_VAR(10), SI_VAR(0), SI_VAR(1), SI_VAR(2), 12);
spawn {
SI_VAR(0) += 60;
SI_VAR(1) += 0;
VirtualEntityJumpTo(SI_VAR(10), SI_VAR(0), SI_VAR(1), SI_VAR(2), 16);
DeleteVirtualEntity(SI_VAR(10));
}
SetTargetActor(ACTOR_SELF, 0);
SetGoalToTarget(ACTOR_SELF);
GetGoalPos(ACTOR_SELF, SI_VAR(0), SI_VAR(1), SI_VAR(2));
N(func_802A188C_72CE3C)(SI_VAR(0), SI_VAR(1), SI_VAR(2));
SetBattleFlagBits(32, 1);
DispatchDamagePlayerEvent(1, EVENT_HIT);
});

View File

@ -1,4 +1,6 @@
#include "pebble.h"
#include "ld_addrs.h"
#include "battle/item/pebble.png.h"
static HudElement* D_802A1E80;
@ -156,3 +158,85 @@ Script N(DrinkItem) = SCRIPT({
sleep 45;
});
static s32 _pad = 0;
#include "battle/item/pebble.png.inc.c"
#include "battle/item/pebble.pal.inc.c"
Vtx N(model)[] = {
{ .v = { -16, -16, 0, FALSE, 0, 0, 0, 0, 0, 255 } },
{ .v = { 15, -16, 0, FALSE, 1024, 0, 0, 0, 0, 255 } },
{ .v = { 15, 15, 0, FALSE, 1024, 1024, 0, 0, 0, 255 } },
{ .v = { -16, 15, 0, FALSE, 0, 1024, 0, 0, 0, 255 } },
};
Gfx N(displayList)[] = {
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA),
gsDPSetTexturePersp(G_TP_PERSP),
gsDPSetTextureDetail(G_TD_CLAMP),
gsDPSetTextureLOD(G_TL_TILE),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureFilter(G_TF_AVERAGE),
gsDPSetTextureConvert(G_TC_FILT),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPLoadTLUT_pal16(0, N(pal)),
gsDPLoadTextureTile_4b(N(png), G_IM_FMT_CI, battle_item_pebble_png_width, battle_item_pebble_png_height, 0, 0, battle_item_pebble_png_width - 1, battle_item_pebble_png_height - 1, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD),
gsSPClearGeometryMode(G_LIGHTING),
gsSPClearGeometryMode(G_SHADING_SMOOTH),
gsSPVertex(N(model), ARRAY_COUNT(N(model)), 0),
gsSP1Triangle(0, 1, 2, 0),
gsSP1Triangle(0, 2, 3, 0),
gsDPPipeSync(),
gsSPEndDisplayList(),
};
s32 N(modelCommandList)[] = {
0x00000004, 0x0000000D, 0x00000001, sizeof(N(displayList)) / sizeof(s32), &N(displayList), 0x00000002, 0x00000000,
};
Script N(main) = SCRIPT({
SI_VAR(10) = (const) ITEM_PEBBLE;
await N(UseItemWithEffect);
UseBattleCamPreset(3);
MoveBattleCamOver(15);
SetAnimation(ACTOR_PLAYER, 0, ANIM_THROW);
PlaySound(SOUND_THROW);
sleep 3;
CreateVirtualEntity(SI_VAR(10), N(modelCommandList));
SI_VAR(0) = 1.0;
MultiplyByActorScale(SI_VAR(0));
SetVirtualEntityScale(SI_VAR(10), SI_VAR(0), SI_VAR(0), SI_VAR(0));
GetActorPos(ACTOR_PLAYER, SI_VAR(0), SI_VAR(1), SI_VAR(2));
SI_VAR(3) = 20;
SI_VAR(4) = 42;
SI_VAR(5) = 5;
MultiplyVec3ByActorScale(SI_VAR(3), SI_VAR(4), SI_VAR(5));
SI_VAR(0) += SI_VAR(3);
SI_VAR(1) += SI_VAR(4);
SI_VAR(2) += SI_VAR(5);
SetVirtualEntityPosition(SI_VAR(10), SI_VAR(0), SI_VAR(1), SI_VAR(2));
InitTargetIterator();
SetGoalToTarget(ACTOR_SELF);
GetGoalPos(ACTOR_SELF, SI_VAR(0), SI_VAR(1), SI_VAR(2));
spawn {
SI_VAR(0) = 0;
loop 18 {
SI_VAR(0) += 0xFFFFFFC4;
SetVirtualEntityRotation(SI_VAR(10), 0, 0, SI_VAR(0));
sleep 1;
}
}
SetVirtualEntityJumpGravity(SI_VAR(10), 0.80078125);
SI_VAR(2) += 5;
VirtualEntityJumpTo(SI_VAR(10), SI_VAR(0), SI_VAR(1), SI_VAR(2), 18);
GetItemPower(ITEM_PEBBLE, SI_VAR(3), SI_VAR(4));
ApplyShrinkFromOwner(SI_VAR(3));
ItemDamageEnemy(SI_VAR(9), 0x18000000, 0, SI_VAR(3), 32);
SI_VAR(0) += 60;
SI_VAR(1) += 0;
VirtualEntityJumpTo(SI_VAR(10), SI_VAR(0), SI_VAR(1), SI_VAR(2), 16);
DeleteVirtualEntity(SI_VAR(10));
await N(PlayerGoHome);
});

View File

@ -1,81 +0,0 @@
#include "pebble.h"
#include "ld_addrs.h"
#include "battle/item/pebble/pebble.png.h"
Vtx N(model)[] = {
{ .v = { -16, -16, 0, FALSE, 0, 0, 0, 0, 0, 255 } },
{ .v = { 15, -16, 0, FALSE, 1024, 0, 0, 0, 0, 255 } },
{ .v = { 15, 15, 0, FALSE, 1024, 1024, 0, 0, 0, 255 } },
{ .v = { -16, 15, 0, FALSE, 0, 1024, 0, 0, 0, 255 } },
};
Gfx N(displayList)[] = {
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA),
gsDPSetTexturePersp(G_TP_PERSP),
gsDPSetTextureDetail(G_TD_CLAMP),
gsDPSetTextureLOD(G_TL_TILE),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureFilter(G_TF_AVERAGE),
gsDPSetTextureConvert(G_TC_FILT),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPLoadTLUT_pal16(0, &N(pebble_pal)),
gsDPLoadTextureTile_4b(&N(pebble_png), G_IM_FMT_CI, N(pebble_png_width), N(pebble_png_height), 0, 0, N(pebble_png_width) - 1, N(pebble_png_height) - 1, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD),
gsSPClearGeometryMode(G_LIGHTING),
gsSPClearGeometryMode(G_SHADING_SMOOTH),
gsSPVertex(N(model), ARRAY_COUNT(N(model)), 0),
gsSP1Triangle(0, 1, 2, 0),
gsSP1Triangle(0, 2, 3, 0),
gsDPPipeSync(),
gsSPEndDisplayList(),
};
s32 N(modelCommandList)[] = {
0x00000004, 0x0000000D, 0x00000001, sizeof(N(displayList)) / sizeof(s32), &N(displayList), 0x00000002, 0x00000000,
};
Script N(main) = SCRIPT({
SI_VAR(10) = (const) ITEM_PEBBLE;
await N(UseItemWithEffect);
UseBattleCamPreset(3);
MoveBattleCamOver(15);
SetAnimation(ACTOR_PLAYER, 0, ANIM_THROW);
PlaySound(SOUND_THROW);
sleep 3;
CreateVirtualEntity(SI_VAR(10), N(modelCommandList));
SI_VAR(0) = 1.0;
MultiplyByActorScale(SI_VAR(0));
SetVirtualEntityScale(SI_VAR(10), SI_VAR(0), SI_VAR(0), SI_VAR(0));
GetActorPos(ACTOR_PLAYER, SI_VAR(0), SI_VAR(1), SI_VAR(2));
SI_VAR(3) = 20;
SI_VAR(4) = 42;
SI_VAR(5) = 5;
MultiplyVec3ByActorScale(SI_VAR(3), SI_VAR(4), SI_VAR(5));
SI_VAR(0) += SI_VAR(3);
SI_VAR(1) += SI_VAR(4);
SI_VAR(2) += SI_VAR(5);
SetVirtualEntityPosition(SI_VAR(10), SI_VAR(0), SI_VAR(1), SI_VAR(2));
InitTargetIterator();
SetGoalToTarget(ACTOR_SELF);
GetGoalPos(ACTOR_SELF, SI_VAR(0), SI_VAR(1), SI_VAR(2));
spawn {
SI_VAR(0) = 0;
loop 18 {
SI_VAR(0) += 0xFFFFFFC4;
SetVirtualEntityRotation(SI_VAR(10), 0, 0, SI_VAR(0));
sleep 1;
}
}
SetVirtualEntityJumpGravity(SI_VAR(10), 0.80078125);
SI_VAR(2) += 5;
VirtualEntityJumpTo(SI_VAR(10), SI_VAR(0), SI_VAR(1), SI_VAR(2), 18);
GetItemPower(ITEM_PEBBLE, SI_VAR(3), SI_VAR(4));
ApplyShrinkFromOwner(SI_VAR(3));
ItemDamageEnemy(SI_VAR(9), 0x18000000, 0, SI_VAR(3), 32);
SI_VAR(0) += 60;
SI_VAR(1) += 0;
VirtualEntityJumpTo(SI_VAR(10), SI_VAR(0), SI_VAR(1), SI_VAR(2), 16);
DeleteVirtualEntity(SI_VAR(10));
await N(PlayerGoHome);
});

View File

@ -1,4 +1,8 @@
#include "sleepy_sheep.h"
#include "ld_addrs.h"
#include "battle/item/sleepy_sheep1.png.h"
#include "battle/item/sleepy_sheep2.png.h"
#include "battle/item/sleepy_sheep3.png.h"
static HudElement* D_802A3F50;
@ -59,7 +63,11 @@ extern Vec3f D_802A3F88;
extern s32* D_802A3F58;
s32 N(D_802A3E88_7214D8)[] = {
0x00000000, 0x00000000, 0x00000000,
0, 0
};
s32 N(D_802A3E88_7214E0)[] = {
0x00000000,
0xFFFFFFE2, 0x00000000, 0xFFFFFFCE,
0xFFFFFFE5, 0x00000000, 0x0000001E,
0xFFFFFFBA, 0x00000000, 0xFFFFFFFB,
@ -373,3 +381,260 @@ Script N(DrinkItem) = SCRIPT({
SetAnimation(ACTOR_PLAYER, 0, ANIM_DRINK);
sleep 45;
});
static s32 _pad = 0;
#include "battle/item/sleepy_sheep1.png.inc.c"
#include "battle/item/sleepy_sheep1.pal.inc.c"
#include "battle/item/sleepy_sheep2.png.inc.c"
#include "battle/item/sleepy_sheep2.pal.inc.c"
#include "battle/item/sleepy_sheep3.png.inc.c"
#include "battle/item/sleepy_sheep3.pal.inc.c"
Vtx N(model)[] = {
{ .v = { -28, 0, 0, FALSE, 0, 1536, 0, 0, 0, 255 } },
{ .v = { 27, 0, 0, FALSE, 1792, 1536, 0, 0, 0, 255 } },
{ .v = { 27, 47, 0, FALSE, 1792, 0, 0, 0, 0, 255 } },
{ .v = { -28, 47, 0, FALSE, 0, 0, 0, 0, 0, 255 } },
};
Gfx N(frame1_displayList)[] = {
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA),
gsDPSetTexturePersp(G_TP_PERSP),
gsDPSetTextureDetail(G_TD_CLAMP),
gsDPSetTextureLOD(G_TL_TILE),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureFilter(G_TF_AVERAGE),
gsDPSetTextureConvert(G_TC_FILT),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPLoadTLUT_pal16(0, battle_item_sleepy_sheep1_pal),
gsDPLoadTextureTile_4b(battle_item_sleepy_sheep1_png, G_IM_FMT_CI, battle_item_sleepy_sheep1_png_width, battle_item_sleepy_sheep1_png_height, 0, 0, battle_item_sleepy_sheep1_png_width - 1, battle_item_sleepy_sheep1_png_height - 1, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD),
gsSPClearGeometryMode(G_LIGHTING),
gsSPClearGeometryMode(G_SHADING_SMOOTH),
gsSPVertex(N(model), ARRAY_COUNT(N(model)), 0),
gsSP1Triangle(0, 1, 2, 0),
gsSP1Triangle(0, 2, 3, 0),
gsDPPipeSync(),
gsSPEndDisplayList(),
};
Gfx N(frame2_displayList)[] = {
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA),
gsDPSetTexturePersp(G_TP_PERSP),
gsDPSetTextureDetail(G_TD_CLAMP),
gsDPSetTextureLOD(G_TL_TILE),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureFilter(G_TF_AVERAGE),
gsDPSetTextureConvert(G_TC_FILT),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPLoadTLUT_pal16(0, battle_item_sleepy_sheep2_pal),
gsDPLoadTextureTile_4b(battle_item_sleepy_sheep2_png, G_IM_FMT_CI, battle_item_sleepy_sheep2_png_width, battle_item_sleepy_sheep2_png_height, 0, 0, battle_item_sleepy_sheep2_png_width - 1, battle_item_sleepy_sheep2_png_height - 1, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD),
gsSPClearGeometryMode(G_LIGHTING),
gsSPClearGeometryMode(G_SHADING_SMOOTH),
gsSPVertex(N(model), ARRAY_COUNT(N(model)), 0),
gsSP1Triangle(0, 1, 2, 0),
gsSP1Triangle(0, 2, 3, 0),
gsDPPipeSync(),
gsSPEndDisplayList(),
};
Gfx N(frame3_displayList)[] = {
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA),
gsDPSetTexturePersp(G_TP_PERSP),
gsDPSetTextureDetail(G_TD_CLAMP),
gsDPSetTextureLOD(G_TL_TILE),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureFilter(G_TF_AVERAGE),
gsDPSetTextureConvert(G_TC_FILT),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPLoadTLUT_pal16(0, battle_item_sleepy_sheep3_pal),
gsDPLoadTextureTile_4b(battle_item_sleepy_sheep3_png, G_IM_FMT_CI, battle_item_sleepy_sheep3_png_width, battle_item_sleepy_sheep3_png_height, 0, 0, battle_item_sleepy_sheep3_png_width - 1, battle_item_sleepy_sheep3_png_height - 1, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD),
gsSPClearGeometryMode(G_LIGHTING),
gsSPClearGeometryMode(G_SHADING_SMOOTH),
gsSPVertex(N(model), ARRAY_COUNT(N(model)), 0),
gsSP1Triangle(0, 1, 2, 0),
gsSP1Triangle(0, 2, 3, 0),
gsDPPipeSync(),
gsSPEndDisplayList(),
};
s32 N(modelCommandList)[] = {
0x00000004, 0x0000000D,
0x00000001, 0x00000002, &N(frame1_displayList),
0x00000001, 0x00000003, &N(frame2_displayList),
0x00000001, 0x00000002, &N(frame1_displayList),
0x00000001, 0x00000002, &N(frame3_displayList),
0x00000002, 0x00000000,
0x00000004, 0x0000000D,
0x00000001, 0x00000003, &N(frame2_displayList),
0x00000001, 0x00000002, &N(frame1_displayList),
0x00000001, 0x00000002, &N(frame3_displayList),
0x00000001, 0x00000002, &N(frame1_displayList),
0x00000002, 0x00000000,
0x00000004, 0x0000000D,
0x00000001, 0x00000002, &N(frame1_displayList),
0x00000001, 0x00000002, &N(frame3_displayList),
0x00000001, 0x00000002, &N(frame1_displayList),
0x00000001, 0x00000003, &N(frame2_displayList),
0x00000002, 0x00000000,
};
Script N(main) = SCRIPT({
SI_VAR(10) = (const) ITEM_SLEEPY_SHEEP;
await N(UseItemWithEffect);
UseBattleCamPreset(19);
SetBattleCamTarget(0xFFFFFFBD, 0xFFFFFFF1, 0xFFFFFFFB);
SetBattleCamOffsetZ(45);
SetBattleCamZoom(169);
MoveBattleCamOver(50);
spawn {
PlaySoundAtActor(ACTOR_PLAYER, SOUND_UNKNOWN_364);
loop 7 {
StartRumble(2);
ShakeCam(1, 0, 2, 0.5);
ShakeCam(1, 0, 2, 1.5);
ShakeCam(1, 0, 2, 0.5);
ShakeCam(1, 0, 2, 0.2001953125);
ShakeCam(1, 0, 2, 0.5);
ShakeCam(1, 0, 2, 2.0);
ShakeCam(1, 0, 2, 1.5);
ShakeCam(1, 0, 2, 1.0);
ShakeCam(1, 0, 2, 0.5);
ShakeCam(1, 0, 2, 0.25);
sleep 2;
ShakeCam(1, 0, 2, 0.5);
ShakeCam(1, 0, 2, 1.5);
ShakeCam(1, 0, 2, 0.5);
ShakeCam(1, 0, 2, 0.2001953125);
}
}
sleep 20;
SetAnimation(ACTOR_PLAYER, 0, ANIM_10002);
GetActorPos(ACTOR_PLAYER, SI_VAR(0), SI_VAR(1), SI_VAR(2));
SI_VAR(1) += 32;
ShowEmote(0, EMOTE_QUESTION, -45, 20, 2, SI_VAR(0), SI_VAR(1), SI_VAR(2), 10);
sleep 30;
SetActorYaw(ACTOR_PLAYER, 30);
sleep 1;
SetActorYaw(ACTOR_PLAYER, 60);
sleep 1;
SetActorYaw(ACTOR_PLAYER, 90);
sleep 1;
SetActorYaw(ACTOR_PLAYER, 120);
sleep 1;
SetActorYaw(ACTOR_PLAYER, 150);
sleep 1;
SetActorYaw(ACTOR_PLAYER, 180);
spawn {
N(func_802A123C_71E88C)();
}
InitTargetIterator();
spawn {
sleep 40;
N(func_802A1740_71ED90)();
N(func_802A1848_71EE98)();
}
UseBattleCamPreset(2);
MoveBattleCamOver(20);
sleep 8;
SetJumpAnimations(ACTOR_PLAYER, 0, ANIM_1002B, ANIM_1002B, ANIM_MIDAIR);
SetActorJumpGravity(ACTOR_PLAYER, 1.80078125);
GetActorPos(ACTOR_PLAYER, SI_VAR(0), SI_VAR(1), SI_VAR(2));
SetGoalPos(ACTOR_PLAYER, SI_VAR(0), SI_VAR(1), SI_VAR(2));
func_80273444(15, 0, 0);
spawn {
sleep 5;
SetActorYaw(ACTOR_PLAYER, 150);
sleep 1;
SetActorYaw(ACTOR_PLAYER, 120);
sleep 1;
SetActorYaw(ACTOR_PLAYER, 90);
sleep 1;
SetActorYaw(ACTOR_PLAYER, 60);
sleep 1;
SetActorYaw(ACTOR_PLAYER, 30);
sleep 1;
SetActorYaw(ACTOR_PLAYER, 0);
}
sleep 40;
CreateVirtualEntity(SI_VAR(10), N(modelCommandList));
SI_VAR(7) = 0xFFFFFF38;
SI_VAR(8) = 0;
SI_VAR(9) = 0;
SetVirtualEntityPosition(SI_VAR(10), SI_VAR(7), SI_VAR(8), SI_VAR(9));
SetVirtualEntityScale(SI_VAR(10), 0.7109375, 0.7109375, 0.7109375);
SetVirtualEntityMoveSpeed(SI_VAR(10), 7.0);
SetVirtualEntityJumpGravity(SI_VAR(10), 1.400390625);
SetOwnerTarget(0, 0);
SetGoalToTarget(ACTOR_PLAYER);
GetGoalPos(ACTOR_PLAYER, SI_VAR(0), SI_VAR(1), SI_VAR(2));
SI_VAR(0) -= 60;
VirtualEntityMoveTo(SI_VAR(10), SI_VAR(0), SI_VAR(1), SI_VAR(2), 0);
GetGoalPos(ACTOR_PLAYER, SI_VAR(0), SI_VAR(1), SI_VAR(2));
VirtualEntityJumpTo(SI_VAR(10), SI_VAR(0), SI_VAR(1), SI_VAR(2), 0);
PlaySoundAtActor(ACTOR_PLAYER, SOUND_HIT_BLOCK);
spawn {
SetAnimation(ACTOR_PLAYER, 0, ANIM_SHOCK_STILL);
SetActorScale(ACTOR_PLAYER, 1.2001953125, 0.900390625, 1.0);
sleep 1;
SetActorScale(ACTOR_PLAYER, 1.30078125, 0.80078125, 1.0);
sleep 3;
SetActorScale(ACTOR_PLAYER, 1.2001953125, 0.900390625, 1.0);
sleep 1;
SetActorScale(ACTOR_PLAYER, 1.0, 1.0, 1.0);
}
PlayEffect(0x6, 3, SI_VAR(0), SI_VAR(1), SI_VAR(2), 0, 0, 0, 0, 0, 0, 0, 0, 0);
sleep 2;
SetVirtualEntityJumpGravity(SI_VAR(10), 1.400390625);
GetActorPos(ACTOR_PLAYER, SI_VAR(0), SI_VAR(1), SI_VAR(2));
SI_VAR(0) += 60;
VirtualEntityJumpTo(SI_VAR(10), SI_VAR(0), SI_VAR(1), SI_VAR(2), 0);
PlayEffect(0x6, 2, SI_VAR(0), SI_VAR(1), SI_VAR(2), 0, 0, 0, 0, 0, 0, 0, 0, 0);
SetAnimation(ACTOR_PLAYER, 0, ANIM_10002);
SI_VAR(0) += 20;
VirtualEntityJumpTo(SI_VAR(10), SI_VAR(0), SI_VAR(1), SI_VAR(2), 0);
PlayEffect(0x6, 2, SI_VAR(0), SI_VAR(1), SI_VAR(2), 0, 0, 0, 0, 0, 0, 0, 0, 0);
SI_VAR(0) += 10;
VirtualEntityJumpTo(SI_VAR(10), SI_VAR(0), SI_VAR(1), SI_VAR(2), 0);
PlayEffect(0x6, 2, SI_VAR(0), SI_VAR(1), SI_VAR(2), 0, 0, 0, 0, 0, 0, 0, 0, 0);
sleep 5;
spawn {
GetActorPos(ACTOR_PLAYER, SI_VAR(0), SI_VAR(1), SI_VAR(2));
SI_VAR(0) += 270;
VirtualEntityMoveTo(SI_VAR(10), SI_VAR(0), SI_VAR(1), SI_VAR(2), 0);
DeleteVirtualEntity(SI_VAR(10));
}
sleep 30;
UseBattleCamPreset(3);
MoveBattleCamOver(20);
InitTargetIterator();
0:
SetGoalToTarget(ACTOR_SELF);
ItemCheckHit(SI_VAR(0), 0x10000000, 0, SI_VAR(0), 0);
if (SI_VAR(0) == 6) {
goto 1;
}
GetItemPower(ITEM_SLEEPY_SHEEP, SI_VAR(0), SI_VAR(1));
MakeStatusField(SI_VAR(0), 4096, 100, SI_VAR(0));
func_80252B3C(SI_VAR(0), 0x50000000, SI_VAR(0), 0, 32);
1:
sleep 5;
ChooseNextTarget(0, SI_VAR(0));
if (SI_VAR(0) != -1) {
goto 0;
}
sleep 30;
await N(PlayerGoHome);
});
s32 D_802A3E88_7214D8[] = {
0, 0
};

View File

@ -1,249 +0,0 @@
#include "sleepy_sheep.h"
#include "ld_addrs.h"
#include "battle/item/sleepy_sheep/sleepy_sheep1.png.h"
#include "battle/item/sleepy_sheep/sleepy_sheep2.png.h"
#include "battle/item/sleepy_sheep/sleepy_sheep3.png.h"
Vtx N(model)[] = {
{ .v = { -28, 0, 0, FALSE, 0, 1536, 0, 0, 0, 255 } },
{ .v = { 27, 0, 0, FALSE, 1792, 1536, 0, 0, 0, 255 } },
{ .v = { 27, 47, 0, FALSE, 1792, 0, 0, 0, 0, 255 } },
{ .v = { -28, 47, 0, FALSE, 0, 0, 0, 0, 0, 255 } },
};
Gfx N(frame1_displayList)[] = {
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA),
gsDPSetTexturePersp(G_TP_PERSP),
gsDPSetTextureDetail(G_TD_CLAMP),
gsDPSetTextureLOD(G_TL_TILE),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureFilter(G_TF_AVERAGE),
gsDPSetTextureConvert(G_TC_FILT),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPLoadTLUT_pal16(0, N(sleepy_sheep1_pal)),
gsDPLoadTextureTile_4b(N(sleepy_sheep1_png), G_IM_FMT_CI, N(sleepy_sheep1_png_width), N(sleepy_sheep1_png_height), 0, 0, N(sleepy_sheep1_png_width) - 1, N(sleepy_sheep1_png_height) - 1, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD),
gsSPClearGeometryMode(G_LIGHTING),
gsSPClearGeometryMode(G_SHADING_SMOOTH),
gsSPVertex(N(model), ARRAY_COUNT(N(model)), 0),
gsSP1Triangle(0, 1, 2, 0),
gsSP1Triangle(0, 2, 3, 0),
gsDPPipeSync(),
gsSPEndDisplayList(),
};
Gfx N(frame2_displayList)[] = {
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA),
gsDPSetTexturePersp(G_TP_PERSP),
gsDPSetTextureDetail(G_TD_CLAMP),
gsDPSetTextureLOD(G_TL_TILE),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureFilter(G_TF_AVERAGE),
gsDPSetTextureConvert(G_TC_FILT),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPLoadTLUT_pal16(0, N(sleepy_sheep2_pal)),
gsDPLoadTextureTile_4b(N(sleepy_sheep2_png), G_IM_FMT_CI, N(sleepy_sheep2_png_width), N(sleepy_sheep2_png_height), 0, 0, N(sleepy_sheep2_png_width) - 1, N(sleepy_sheep2_png_height) - 1, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD),
gsSPClearGeometryMode(G_LIGHTING),
gsSPClearGeometryMode(G_SHADING_SMOOTH),
gsSPVertex(N(model), ARRAY_COUNT(N(model)), 0),
gsSP1Triangle(0, 1, 2, 0),
gsSP1Triangle(0, 2, 3, 0),
gsDPPipeSync(),
gsSPEndDisplayList(),
};
Gfx N(frame3_displayList)[] = {
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA),
gsDPSetTexturePersp(G_TP_PERSP),
gsDPSetTextureDetail(G_TD_CLAMP),
gsDPSetTextureLOD(G_TL_TILE),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureFilter(G_TF_AVERAGE),
gsDPSetTextureConvert(G_TC_FILT),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPLoadTLUT_pal16(0, N(sleepy_sheep3_pal)),
gsDPLoadTextureTile_4b(N(sleepy_sheep3_png), G_IM_FMT_CI, N(sleepy_sheep3_png_width), N(sleepy_sheep3_png_height), 0, 0, N(sleepy_sheep3_png_width) - 1, N(sleepy_sheep3_png_height) - 1, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD),
gsSPClearGeometryMode(G_LIGHTING),
gsSPClearGeometryMode(G_SHADING_SMOOTH),
gsSPVertex(N(model), ARRAY_COUNT(N(model)), 0),
gsSP1Triangle(0, 1, 2, 0),
gsSP1Triangle(0, 2, 3, 0),
gsDPPipeSync(),
gsSPEndDisplayList(),
};
s32 N(modelCommandList)[] = {
0x00000004, 0x0000000D,
0x00000001, 0x00000002, &N(frame1_displayList),
0x00000001, 0x00000003, &N(frame2_displayList),
0x00000001, 0x00000002, &N(frame1_displayList),
0x00000001, 0x00000002, &N(frame3_displayList),
0x00000002, 0x00000000,
0x00000004, 0x0000000D,
0x00000001, 0x00000003, &N(frame2_displayList),
0x00000001, 0x00000002, &N(frame1_displayList),
0x00000001, 0x00000002, &N(frame3_displayList),
0x00000001, 0x00000002, &N(frame1_displayList),
0x00000002, 0x00000000,
0x00000004, 0x0000000D,
0x00000001, 0x00000002, &N(frame1_displayList),
0x00000001, 0x00000002, &N(frame3_displayList),
0x00000001, 0x00000002, &N(frame1_displayList),
0x00000001, 0x00000003, &N(frame2_displayList),
0x00000002, 0x00000000,
};
Script N(main) = SCRIPT({
SI_VAR(10) = (const) ITEM_SLEEPY_SHEEP;
await N(UseItemWithEffect);
UseBattleCamPreset(19);
SetBattleCamTarget(0xFFFFFFBD, 0xFFFFFFF1, 0xFFFFFFFB);
SetBattleCamOffsetZ(45);
SetBattleCamZoom(169);
MoveBattleCamOver(50);
spawn {
PlaySoundAtActor(ACTOR_PLAYER, SOUND_UNKNOWN_364);
loop 7 {
StartRumble(2);
ShakeCam(1, 0, 2, 0.5);
ShakeCam(1, 0, 2, 1.5);
ShakeCam(1, 0, 2, 0.5);
ShakeCam(1, 0, 2, 0.2001953125);
ShakeCam(1, 0, 2, 0.5);
ShakeCam(1, 0, 2, 2.0);
ShakeCam(1, 0, 2, 1.5);
ShakeCam(1, 0, 2, 1.0);
ShakeCam(1, 0, 2, 0.5);
ShakeCam(1, 0, 2, 0.25);
sleep 2;
ShakeCam(1, 0, 2, 0.5);
ShakeCam(1, 0, 2, 1.5);
ShakeCam(1, 0, 2, 0.5);
ShakeCam(1, 0, 2, 0.2001953125);
}
}
sleep 20;
SetAnimation(ACTOR_PLAYER, 0, ANIM_10002);
GetActorPos(ACTOR_PLAYER, SI_VAR(0), SI_VAR(1), SI_VAR(2));
SI_VAR(1) += 32;
ShowEmote(0, EMOTE_QUESTION, -45, 20, 2, SI_VAR(0), SI_VAR(1), SI_VAR(2), 10);
sleep 30;
SetActorYaw(ACTOR_PLAYER, 30);
sleep 1;
SetActorYaw(ACTOR_PLAYER, 60);
sleep 1;
SetActorYaw(ACTOR_PLAYER, 90);
sleep 1;
SetActorYaw(ACTOR_PLAYER, 120);
sleep 1;
SetActorYaw(ACTOR_PLAYER, 150);
sleep 1;
SetActorYaw(ACTOR_PLAYER, 180);
spawn {
N(func_802A123C_71E88C)();
}
InitTargetIterator();
spawn {
sleep 40;
N(func_802A1740_71ED90)();
N(func_802A1848_71EE98)();
}
UseBattleCamPreset(2);
MoveBattleCamOver(20);
sleep 8;
SetJumpAnimations(ACTOR_PLAYER, 0, ANIM_1002B, ANIM_1002B, ANIM_MIDAIR);
SetActorJumpGravity(ACTOR_PLAYER, 1.80078125);
GetActorPos(ACTOR_PLAYER, SI_VAR(0), SI_VAR(1), SI_VAR(2));
SetGoalPos(ACTOR_PLAYER, SI_VAR(0), SI_VAR(1), SI_VAR(2));
func_80273444(15, 0, 0);
spawn {
sleep 5;
SetActorYaw(ACTOR_PLAYER, 150);
sleep 1;
SetActorYaw(ACTOR_PLAYER, 120);
sleep 1;
SetActorYaw(ACTOR_PLAYER, 90);
sleep 1;
SetActorYaw(ACTOR_PLAYER, 60);
sleep 1;
SetActorYaw(ACTOR_PLAYER, 30);
sleep 1;
SetActorYaw(ACTOR_PLAYER, 0);
}
sleep 40;
CreateVirtualEntity(SI_VAR(10), N(modelCommandList));
SI_VAR(7) = 0xFFFFFF38;
SI_VAR(8) = 0;
SI_VAR(9) = 0;
SetVirtualEntityPosition(SI_VAR(10), SI_VAR(7), SI_VAR(8), SI_VAR(9));
SetVirtualEntityScale(SI_VAR(10), 0.7109375, 0.7109375, 0.7109375);
SetVirtualEntityMoveSpeed(SI_VAR(10), 7.0);
SetVirtualEntityJumpGravity(SI_VAR(10), 1.400390625);
SetOwnerTarget(0, 0);
SetGoalToTarget(ACTOR_PLAYER);
GetGoalPos(ACTOR_PLAYER, SI_VAR(0), SI_VAR(1), SI_VAR(2));
SI_VAR(0) -= 60;
VirtualEntityMoveTo(SI_VAR(10), SI_VAR(0), SI_VAR(1), SI_VAR(2), 0);
GetGoalPos(ACTOR_PLAYER, SI_VAR(0), SI_VAR(1), SI_VAR(2));
VirtualEntityJumpTo(SI_VAR(10), SI_VAR(0), SI_VAR(1), SI_VAR(2), 0);
PlaySoundAtActor(ACTOR_PLAYER, SOUND_HIT_BLOCK);
spawn {
SetAnimation(ACTOR_PLAYER, 0, ANIM_SHOCK_STILL);
SetActorScale(ACTOR_PLAYER, 1.2001953125, 0.900390625, 1.0);
sleep 1;
SetActorScale(ACTOR_PLAYER, 1.30078125, 0.80078125, 1.0);
sleep 3;
SetActorScale(ACTOR_PLAYER, 1.2001953125, 0.900390625, 1.0);
sleep 1;
SetActorScale(ACTOR_PLAYER, 1.0, 1.0, 1.0);
}
PlayEffect(0x6, 3, SI_VAR(0), SI_VAR(1), SI_VAR(2), 0, 0, 0, 0, 0, 0, 0, 0, 0);
sleep 2;
SetVirtualEntityJumpGravity(SI_VAR(10), 1.400390625);
GetActorPos(ACTOR_PLAYER, SI_VAR(0), SI_VAR(1), SI_VAR(2));
SI_VAR(0) += 60;
VirtualEntityJumpTo(SI_VAR(10), SI_VAR(0), SI_VAR(1), SI_VAR(2), 0);
PlayEffect(0x6, 2, SI_VAR(0), SI_VAR(1), SI_VAR(2), 0, 0, 0, 0, 0, 0, 0, 0, 0);
SetAnimation(ACTOR_PLAYER, 0, ANIM_10002);
SI_VAR(0) += 20;
VirtualEntityJumpTo(SI_VAR(10), SI_VAR(0), SI_VAR(1), SI_VAR(2), 0);
PlayEffect(0x6, 2, SI_VAR(0), SI_VAR(1), SI_VAR(2), 0, 0, 0, 0, 0, 0, 0, 0, 0);
SI_VAR(0) += 10;
VirtualEntityJumpTo(SI_VAR(10), SI_VAR(0), SI_VAR(1), SI_VAR(2), 0);
PlayEffect(0x6, 2, SI_VAR(0), SI_VAR(1), SI_VAR(2), 0, 0, 0, 0, 0, 0, 0, 0, 0);
sleep 5;
spawn {
GetActorPos(ACTOR_PLAYER, SI_VAR(0), SI_VAR(1), SI_VAR(2));
SI_VAR(0) += 270;
VirtualEntityMoveTo(SI_VAR(10), SI_VAR(0), SI_VAR(1), SI_VAR(2), 0);
DeleteVirtualEntity(SI_VAR(10));
}
sleep 30;
UseBattleCamPreset(3);
MoveBattleCamOver(20);
InitTargetIterator();
0:
SetGoalToTarget(ACTOR_SELF);
ItemCheckHit(SI_VAR(0), 0x10000000, 0, SI_VAR(0), 0);
if (SI_VAR(0) == 6) {
goto 1;
}
GetItemPower(ITEM_SLEEPY_SHEEP, SI_VAR(0), SI_VAR(1));
MakeStatusField(SI_VAR(0), 4096, 100, SI_VAR(0));
func_80252B3C(SI_VAR(0), 0x50000000, SI_VAR(0), 0, 32);
1:
sleep 5;
ChooseNextTarget(0, SI_VAR(0));
if (SI_VAR(0) != -1) {
goto 0;
}
sleep 30;
await N(PlayerGoHome);
});

View File

@ -1,4 +1,7 @@
#include "strange_cake.h"
#include "battle/item/strange_cake1.png.h"
#include "battle/item/strange_cake2.png.h"
#include "battle/item/strange_cake3.png.h"
static HudElement* D_802A2DD0;
@ -440,3 +443,118 @@ Script N(DrinkItem) = SCRIPT({
SetAnimation(ACTOR_PLAYER, 0, ANIM_DRINK);
sleep 45;
});
static s32 _pad = 0; // XXX
#include "battle/item/strange_cake1.png.inc.c"
#include "battle/item/strange_cake1.pal.inc.c"
#include "battle/item/strange_cake2.png.inc.c"
#include "battle/item/strange_cake2.pal.inc.c"
#include "battle/item/strange_cake3.png.inc.c"
#include "battle/item/strange_cake3.pal.inc.c"
s32 N(data)[] = {
0x00000008, 0x00000005, 0x00000003, 0x00000004,
0x00000002, 0x0000003C, 0x802A2170, 0x802A2370,
0x00000003, 0x00000000, 0x00000008, 0x00000005,
0x00000003, 0x00000004, 0x00000002, 0x0000003C,
0x802A2390, 0x802A2590, 0x00000003, 0x00000000,
0x00000008, 0x00000005, 0x00000003, 0x00000004,
0x00000002, 0x0000003C, 0x802A25B0, 0x802A27B0,
0x00000003, 0x00000000
};
s32 N(D_802A2848_732B48)[] = {
0x802A27F8, 0x802A2820, 0x802A27D0, 0x802A27F8
};
s32 N(D_802A2858_732B58)[] = {
0x00000000, 0x00000001, 0x00000002, 0x00000000, 0x00000001, 0x000000000
};
Script N(script6) = SCRIPT({
GetMenuSelection(SI_VAR(0), SI_VAR(1), SI_VAR(2));
if (SI_VAR(1) == 211) {
SI_VAR(10) = (const) ITEM_KOOKY_COOKIE;
SI_VAR(1) = 0;
await N(UseItemWithEffect);
await N(EatItem);
N(func_802A1A8C_731D8C)();
GetActorPos(ACTOR_PLAYER, SI_VAR(0), SI_VAR(1), SI_VAR(2));
SI_VAR(0) += 20;
SI_VAR(1) += 25;
N(func_802A18D8_731BD8)(SI_VAR(0), SI_VAR(1), SI_VAR(2), SI_VAR(3));
GetActorPos(ACTOR_PLAYER, SI_VAR(0), SI_VAR(1), SI_VAR(2));
SI_VAR(1) += 25;
func_802D7520(SI_VAR(0), SI_VAR(1), SI_VAR(2), SI_VAR(3));
N(AddFP)(SI_VAR(3));
sleep 10;
SetAnimation(ACTOR_PLAYER, 0, ANIM_THUMBS_UP);
sleep 30;
GetActorPos(ACTOR_PLAYER, SI_VAR(0), SI_VAR(1), SI_VAR(2));
func_802D75D8(SI_VAR(0), SI_VAR(1), SI_VAR(2), SI_VAR(3));
SetAnimation(ACTOR_PLAYER, 0, ANIM_10002);
sleep 20;
SetAnimation(ACTOR_PLAYER, 0, ANIM_GOT_ITEM);
} else {
SI_VAR(10) = (const) ITEM_STRANGE_CAKE;
SI_VAR(1) = 0;
await N(UseItemWithEffect);
await N(EatItem);
SetAnimation(ACTOR_PLAYER, 0, ANIM_GOT_ITEM);
}
sleep 10;
spawn {
sleep 220;
PlaySoundAtActor(ACTOR_PLAYER, SOUND_UNKNOWN_3F3);
}
PlaySoundAtActor(ACTOR_PLAYER, SOUND_UNKNOWN_368);
N(func_802A13E4_7316E4)();
sleep 2;
match SI_VAR(0) {
== 0 {
await N(script7);
}
== 1 {
await N(script8);
}
== 2 {
await N(script9);
}
}
await N(PlayerGoHome);
});
Script N(script7) = SCRIPT({
SetAnimation(ACTOR_PLAYER, 0, ANIM_10002);
GetActorPos(ACTOR_PLAYER, SI_VAR(0), SI_VAR(1), SI_VAR(2));
SI_VAR(1) += 20;
PlayEffect(0x57, 0, SI_VAR(0), SI_VAR(1), SI_VAR(2), 1.0, 30, 0, 0, 0, 0, 0, 0, 0);
N(func_802A1AD8_731DD8)();
sleep 20;
ShowMessageBox(16, 60);
WaitForMessageBoxDone();
});
Script N(script8) = SCRIPT({
SetAnimation(ACTOR_PLAYER, 0, ANIM_10002);
GetActorPos(ACTOR_PLAYER, SI_VAR(0), SI_VAR(1), SI_VAR(2));
SI_VAR(1) += 20;
PlayEffect(0x33, 6, SI_VAR(0), SI_VAR(1), SI_VAR(2), 1.0, 30, 0, 0, 0, 0, 0, 0, 0);
N(func_802A1B14_731E14)();
sleep 20;
ShowMessageBox(17, 60);
WaitForMessageBoxDone();
});
Script N(script9) = SCRIPT({
SetAnimation(ACTOR_PLAYER, 0, ANIM_30004);
SetGoalToTarget(ACTOR_PLAYER);
GetGoalPos(ACTOR_PLAYER, SI_VAR(0), SI_VAR(1), SI_VAR(2));
spawn DoSleepHit;
N(func_802A1B68_731E68)();
sleep 20;
ShowMessageBox(11, 60);
WaitForMessageBoxDone();
});

View File

@ -1,110 +0,0 @@
#include "strange_cake.h"
#include "battle/item/strange_cake/strange_cake1.png.h"
#include "battle/item/strange_cake/strange_cake2.png.h"
#include "battle/item/strange_cake/strange_cake3.png.h"
s32 N(data)[] = {
0x00000008, 0x00000005, 0x00000003, 0x00000004,
0x00000002, 0x0000003C, 0x802A2170, 0x802A2370,
0x00000003, 0x00000000, 0x00000008, 0x00000005,
0x00000003, 0x00000004, 0x00000002, 0x0000003C,
0x802A2390, 0x802A2590, 0x00000003, 0x00000000,
0x00000008, 0x00000005, 0x00000003, 0x00000004,
0x00000002, 0x0000003C, 0x802A25B0, 0x802A27B0,
0x00000003, 0x00000000
};
s32 N(D_802A2848_732B48)[] = {
0x802A27F8, 0x802A2820, 0x802A27D0, 0x802A27F8
};
s32 N(D_802A2858_732B58)[] = {
0x00000000, 0x00000001, 0x00000002, 0x00000000, 0x00000001, 0x000000000
};
Script N(script6) = SCRIPT({
GetMenuSelection(SI_VAR(0), SI_VAR(1), SI_VAR(2));
if (SI_VAR(1) == 211) {
SI_VAR(10) = (const) ITEM_KOOKY_COOKIE;
SI_VAR(1) = 0;
await N(UseItemWithEffect);
await N(EatItem);
N(func_802A1A8C_731D8C)();
GetActorPos(ACTOR_PLAYER, SI_VAR(0), SI_VAR(1), SI_VAR(2));
SI_VAR(0) += 20;
SI_VAR(1) += 25;
N(func_802A18D8_731BD8)(SI_VAR(0), SI_VAR(1), SI_VAR(2), SI_VAR(3));
GetActorPos(ACTOR_PLAYER, SI_VAR(0), SI_VAR(1), SI_VAR(2));
SI_VAR(1) += 25;
func_802D7520(SI_VAR(0), SI_VAR(1), SI_VAR(2), SI_VAR(3));
N(AddFP)(SI_VAR(3));
sleep 10;
SetAnimation(ACTOR_PLAYER, 0, ANIM_THUMBS_UP);
sleep 30;
GetActorPos(ACTOR_PLAYER, SI_VAR(0), SI_VAR(1), SI_VAR(2));
func_802D75D8(SI_VAR(0), SI_VAR(1), SI_VAR(2), SI_VAR(3));
SetAnimation(ACTOR_PLAYER, 0, ANIM_10002);
sleep 20;
SetAnimation(ACTOR_PLAYER, 0, ANIM_GOT_ITEM);
} else {
SI_VAR(10) = (const) ITEM_STRANGE_CAKE;
SI_VAR(1) = 0;
await N(UseItemWithEffect);
await N(EatItem);
SetAnimation(ACTOR_PLAYER, 0, ANIM_GOT_ITEM);
}
sleep 10;
spawn {
sleep 220;
PlaySoundAtActor(ACTOR_PLAYER, SOUND_UNKNOWN_3F3);
}
PlaySoundAtActor(ACTOR_PLAYER, SOUND_UNKNOWN_368);
N(func_802A13E4_7316E4)();
sleep 2;
match SI_VAR(0) {
== 0 {
await N(script7);
}
== 1 {
await N(script8);
}
== 2 {
await N(script9);
}
}
await N(PlayerGoHome);
});
Script N(script7) = SCRIPT({
SetAnimation(ACTOR_PLAYER, 0, ANIM_10002);
GetActorPos(ACTOR_PLAYER, SI_VAR(0), SI_VAR(1), SI_VAR(2));
SI_VAR(1) += 20;
PlayEffect(0x57, 0, SI_VAR(0), SI_VAR(1), SI_VAR(2), 1.0, 30, 0, 0, 0, 0, 0, 0, 0);
N(func_802A1AD8_731DD8)();
sleep 20;
ShowMessageBox(16, 60);
WaitForMessageBoxDone();
});
Script N(script8) = SCRIPT({
SetAnimation(ACTOR_PLAYER, 0, ANIM_10002);
GetActorPos(ACTOR_PLAYER, SI_VAR(0), SI_VAR(1), SI_VAR(2));
SI_VAR(1) += 20;
PlayEffect(0x33, 6, SI_VAR(0), SI_VAR(1), SI_VAR(2), 1.0, 30, 0, 0, 0, 0, 0, 0, 0);
N(func_802A1B14_731E14)();
sleep 20;
ShowMessageBox(17, 60);
WaitForMessageBoxDone();
});
Script N(script9) = SCRIPT({
SetAnimation(ACTOR_PLAYER, 0, ANIM_30004);
SetGoalToTarget(ACTOR_PLAYER);
GetGoalPos(ACTOR_PLAYER, SI_VAR(0), SI_VAR(1), SI_VAR(2));
spawn DoSleepHit;
N(func_802A1B68_731E68)();
sleep 20;
ShowMessageBox(11, 60);
WaitForMessageBoxDone();
});

View File

@ -4,9 +4,9 @@ ApiStatus N(UnkFogFunc2)(ScriptInstance* script, s32 isInitialCall) {
enable_world_fog();
set_world_fog_dist(950, 1000);
set_world_fog_color(16, 16, 16, 255);
gCameras[1].backgroundColor[0] = 20;
gCameras[1].backgroundColor[1] = 20;
gCameras[1].backgroundColor[2] = 28;
gCameras[1].bgColor[0] = 20;
gCameras[1].bgColor[1] = 20;
gCameras[1].bgColor[2] = 28;
return ApiStatus_DONE2;
}

View File

@ -153,9 +153,9 @@ ApiStatus SetCamBGColor(ScriptInstance* script, s32 isInitialCall) {
Camera* cameras = gCameras;
Camera* camera = &cameras[id];
camera->backgroundColor[0] = r;
camera->backgroundColor[1] = g;
camera->backgroundColor[2] = b;
camera->bgColor[0] = r;
camera->bgColor[1] = g;
camera->bgColor[2] = b;
return ApiStatus_DONE2;
}

View File

@ -389,4 +389,183 @@ void func_80027BAC(s32 arg0, s32 arg1) {
}
}
INCLUDE_ASM(void, "main_loop", gfx_draw_background);
void gfx_draw_background(void) {
Camera* camera;
s32 bgFlags;
s32 backgroundMinW;
s32 backgroundSumW;
s32 backgroundMinH;
s32 backgroundSumH;
s32 viewportStartX;
s32 i;
s32 a = 0x18;
gDPSetScissor(gMasterGfxPos++, G_SC_NON_INTERLACE, 0, 0, 320, 240);
camera = &gCameras[gCurrentCameraID];
bgFlags = gGameStatusPtr->enableBackground & 0xF0;
switch (bgFlags) {
case 0x10:
gDPPipeSync(gMasterGfxPos++);
gDPSetColorImage(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 320, D_8009A658[1]);
gDPSetCycleType(gMasterGfxPos++, G_CYC_1CYCLE);
gDPSetBlendColor(gMasterGfxPos++, 0x80, 0x80, 0x80, 0xFF);
gDPSetPrimDepth(gMasterGfxPos++, -1, -1);
gDPSetDepthSource(gMasterGfxPos++, G_ZS_PRIM);
gDPSetRenderMode(gMasterGfxPos++, G_RM_VISCVG, G_RM_VISCVG2);
gDPFillRectangle(gMasterGfxPos++, 0, 0, 320, 240);
gDPPipeSync(gMasterGfxPos++);
gDPSetDepthSource(gMasterGfxPos++, G_ZS_PIXEL);
gGameStatusPtr->enableBackground &= ~0xF0;
gGameStatusPtr->enableBackground |= 0x20;
break;
case 0x20:
func_800279B4(D_8009A658[0], D_8009A658[1], nuGfxZBuffer);
D_800741F8 = 0;
gGameStatusPtr->enableBackground &= ~0xF0;
gGameStatusPtr->enableBackground |= 0x30;
case 0x30:
D_800741F8 += 0x10;
if (D_800741F8 > 0x80) {
D_800741F8 = 0x80;
}
gDPPipeSync(gMasterGfxPos++);
gDPSetScissor(gMasterGfxPos++, G_SC_NON_INTERLACE, 0, 0, 320, 240);
gDPSetCycleType(gMasterGfxPos++, G_CYC_FILL);
gDPSetRenderMode(gMasterGfxPos++, G_RM_NOOP, G_RM_NOOP2);
gDPSetColorImage(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 320, D_8009A64C);
gDPSetFillColor(gMasterGfxPos++, 0x00010001);
gDPFillRectangle(gMasterGfxPos++, 0, 0, 319, 239);
gDPSetCycleType(gMasterGfxPos++, G_CYC_1CYCLE);
gDPSetTexturePersp(gMasterGfxPos++, G_TP_NONE);
gDPSetTextureLUT(gMasterGfxPos++, G_TT_NONE);
gDPSetRenderMode(gMasterGfxPos++, G_RM_OPA_SURF, G_RM_OPA_SURF2);
gDPSetCombineLERP(gMasterGfxPos++, PRIMITIVE, TEXEL0, PRIMITIVE_ALPHA, TEXEL0, 0, 0, 0, 1, PRIMITIVE,
TEXEL1, PRIMITIVE_ALPHA, TEXEL1, 0, 0, 0, 1);
gDPSetPrimColor(gMasterGfxPos++, 0, 0, 0x28, 0x28, 0x28, D_800741F8);
gDPSetTextureFilter(gMasterGfxPos++, G_TF_POINT);
for (i = 0; i < 40; i++) {
gDPSetTextureImage(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 320, nuGfxZBuffer + (i * 0x780));
gDPSetTile(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 80, 0x0000, G_TX_LOADTILE, 0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
G_TX_NOLOD);
gDPLoadSync(gMasterGfxPos++);
gDPLoadTile(gMasterGfxPos++, G_TX_LOADTILE, 0, 0, 0x04FC, 0x0014);
gDPPipeSync(gMasterGfxPos++);
gDPSetTile(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 80, 0x0000, G_TX_RENDERTILE, 0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
G_TX_NOLOD);
gDPSetTileSize(gMasterGfxPos++, G_TX_RENDERTILE, 0, 0, 0x04FC, 0x0014);
gSPTextureRectangle(gMasterGfxPos++, 0, i * a, 0x0500, a + (i * 0x18), G_TX_RENDERTILE,
-0x0020, 0, 0x0400, 0x0400);
gDPPipeSync(gMasterGfxPos++);
}
break;
default:
if (gOverrideFlags & 8) {
gDPSetColorImage(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 320, osVirtualToPhysical(D_8009A64C));
return;
}
gDPSetDepthImage(gMasterGfxPos++, OS_PHYSICAL_TO_K0(nuGfxZBuffer)); // TODO: or OS_K0_TO_PHYSICAL
gDPSetCycleType(gMasterGfxPos++, G_CYC_FILL);
gDPSetRenderMode(gMasterGfxPos++, G_RM_NOOP, G_RM_NOOP2);
gDPSetColorImage(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 320, OS_PHYSICAL_TO_K0(nuGfxZBuffer));
gDPSetFillColor(gMasterGfxPos++, 0xFFFCFFFC);
gDPFillRectangle(gMasterGfxPos++, 0, 0, 319, 239);
gDPPipeSync(gMasterGfxPos++);
gDPSetColorImage(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 320, osVirtualToPhysical(D_8009A64C));
gDPSetFillColor(gMasterGfxPos++, PACK_FILL_COLOR(camera->bgColor[0], camera->bgColor[1], camera->bgColor[2], 1));
backgroundMinW = gGameStatusPtr->backgroundMinW;
backgroundSumW = backgroundMinW + gGameStatusPtr->backgroundMaxW;
backgroundMinH = gGameStatusPtr->backgroundMinH;
backgroundSumH = backgroundMinH + gGameStatusPtr->backgroundMaxH;
viewportStartX = camera->viewportStartX;
if (backgroundMinW < viewportStartX) {
backgroundMinW = viewportStartX;
}
if (backgroundMinH < camera->viewportStartY) {
backgroundMinH = camera->viewportStartY;
}
if (backgroundSumW > viewportStartX + camera->viewportW) {
backgroundSumW = viewportStartX + camera->viewportW;
}
if (backgroundSumH > camera->viewportStartY + camera->viewportH) {
backgroundSumH = camera->viewportStartY + camera->viewportH;
}
if (backgroundMinW < 0) {
backgroundMinW = 0;
}
if (backgroundMinH < 0) {
backgroundMinH = 0;
}
if (backgroundSumW < 1) {
backgroundSumW = 1;
}
if (backgroundSumH < 1) {
backgroundSumH = 1;
}
if (backgroundMinW > 319) {
backgroundMinW = 319;
}
if (backgroundMinH > 239) {
backgroundMinH = 239;
}
if (backgroundSumW > 320) {
backgroundSumW = 320;
}
if (backgroundSumH > 240) {
backgroundSumH = 240;
}
if (!(gGameStatusPtr->enableBackground & 1)) {
gDPFillRectangle(gMasterGfxPos++, backgroundMinW, backgroundMinH, backgroundSumW - 1, backgroundSumH - 1);
} else {
appendGfx_background_texture();
}
gDPPipeSync(gMasterGfxPos++);
gDPSetCycleType(gMasterGfxPos++, G_CYC_FILL);
gDPSetRenderMode(gMasterGfxPos++, G_RM_NOOP, G_RM_NOOP2);
gDPSetFillColor(gMasterGfxPos++, 0x00010001);
gDPPipeSync(gMasterGfxPos++);
if (backgroundMinH > 0) {
gDPFillRectangle(gMasterGfxPos++, 0, 0, 319, backgroundMinH - 1);
gDPNoOp(gMasterGfxPos++);
}
if (backgroundMinW > 0) {
gDPFillRectangle(gMasterGfxPos++, 0, backgroundMinH, backgroundMinW - 1, backgroundSumH - 1);
gDPNoOp(gMasterGfxPos++);
}
if (backgroundSumW < 0x140) {
gDPFillRectangle(gMasterGfxPos++, backgroundSumW, backgroundMinH, 319, backgroundSumH - 1);
gDPNoOp(gMasterGfxPos++);
}
if (backgroundSumH < 0xF0) {
gDPFillRectangle(gMasterGfxPos++, 0, backgroundSumH, 319, 239);
gDPNoOp(gMasterGfxPos++);
}
break;
}
gDPPipeSync(gMasterGfxPos++);
}

View File

@ -2,6 +2,7 @@
#include "nu/nusys.h"
NUGfxFunc nuGfxFunc = NULL;
NUGfxPreNMIFunc nuGfxPreNMIFunc = NULL;
void nuGfxFuncSet(NUGfxFunc func) {
OSIntMask intMask;

View File

@ -1,8 +1,6 @@
#include "common.h"
#include "nu/nusys.h"
NUGfxPreNMIFunc nuGfxPreNMIFunc = NULL;
void nuGfxPreNMIFuncSet(NUGfxPreNMIFunc func) {
OSIntMask intMask = osSetIntMask(OS_IM_NONE);

View File

@ -16,6 +16,19 @@ Gfx D_800778C8[] = {
gsSPEndDisplayList(),
};
// Should maybe be in state_logos.c but creates an 0x8 data split
Gfx D_80077908[] = {
gsDPPipeSync(),
gsDPSetCycleType(G_CYC_1CYCLE),
gsDPSetTexturePersp(G_TP_NONE),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetCombineMode(G_CC_DECALRGB, G_CC_DECALRGB),
gsDPSetRenderMode(G_RM_OPA_SURF, G_RM_OPA_SURF2),
gsDPSetTextureFilter(G_TF_POINT),
gsSPEndDisplayList(),
};
// BSS
extern s32 D_800A0904;
extern s32 D_800A0908;

View File

@ -55,9 +55,9 @@ void state_init_file_select(void) {
gCameras[0].lookAt_eye.y = 1000.0f;
gCameras[0].lookAt_eye.z = 1500.0f;
gCameras[0].unk_5C = 150.0f;
gCameras[0].backgroundColor[0] = 0;
gCameras[0].backgroundColor[1] = 0;
gCameras[0].backgroundColor[2] = 0;
gCameras[0].bgColor[0] = 0;
gCameras[0].bgColor[1] = 0;
gCameras[0].bgColor[2] = 0;
gCameras[0].unk_54 = 25.0f;
gCameras[0].unk_58 = 25.0f;
gCameras[0].unk_1C = 0;

View File

@ -1,5 +1,7 @@
#include "common.h"
extern s32 D_800A0950;
void state_init_intro(void) {
s8 unk_A8;
@ -68,7 +70,184 @@ void state_init_intro(void) {
intro_logos_update_fade();
}
// WIP
#ifdef NON_MATCHING
void state_step_intro(void) {
PlayerData* playerData = &gPlayerData;
s32 loadMenuState;
s32 viewportMode;
s32 i;
if (gGameStatusPtr->creditsViewportMode != -1) {
if (D_800A0964 == 0 && gGameStatusPtr->pressedButtons & (BUTTON_A | BUTTON_B | BUTTON_START | BUTTON_Z)) {
D_800A0964 = 1;
}
if (D_800A0964 == 1) {
viewportMode = 100;
if (gGameStatusPtr->loadMenuState >= 2U) {
if (gGameStatusPtr->loadMenuState == 4) {
block_13:
gGameStatusPtr->creditsViewportMode = viewportMode;
state_init_intro();
return;
}
block_9:
if ((D_800A0964 == 2) && ((gGameStatusPtr->loadMenuState < 2U) || (gGameStatusPtr->loadMenuState == 4))) {
viewportMode = gGameStatusPtr->creditsViewportMode + 1;
goto block_13;
}
block_14:
loadMenuState = gGameStatusPtr->loadMenuState;
switch (gGameStatusPtr->loadMenuState) {
case 0:
update_effects();
update_cameras();
if (gGameStatusPtr->creditsViewportMode == -1) {
set_curtain_fade_goal(0.0f);
if (intro_logos_fade_out(D_800A0956) != 0) {
gGameStatusPtr->loadMenuState = 1;
set_curtain_draw_callback(NULL);
}
} else {
D_800A0954 += D_800A0956;
if (D_800A0954 >= 0xFF) {
D_800A0954 = 0xFF;
gGameStatusPtr->loadMenuState = 1;
set_curtain_draw_callback(NULL);
}
}
break;
case 21:
D_800A0950--;
if (D_800A0950 <= 0) {
gOverrideFlags &= -9;
gGameStatusPtr->loadMenuState = 2;
}
goto block_39;
case 1:
D_800A0950 = 4;
gOverrideFlags |= 8;
if (D_800A0960 != 0xE) {
gGameStatusPtr->loadMenuState = 2;
}
goto block_39;
case 2:
set_curtain_draw_callback(NULL);
gGameStatusPtr->isBattle = 0;
gGameStatusPtr->unk_76 = 0;
gGameStatusPtr->disableScripts = 0;
gGameStatusPtr->unk_7D = 0;
if (gGameStatusPtr->creditsViewportMode == -1) {
general_heap_create();
clear_render_tasks();
clear_generic_entity_list();
clear_script_list();
create_cameras_a();
spr_init_sprites(0);
clear_entity_models();
clear_animator_list();
clear_model_data();
clear_sprite_shading_data();
reset_background_settings();
clear_hud_element_cache();
clear_trigger_data();
clear_printers();
clear_entity_data(0);
clear_screen_overlays();
clear_player_status();
clear_npcs();
clear_player_data();
reset_battle_status();
init_encounter_status();
clear_effect_data();
clear_item_entity_data();
clear_saved_variables();
initialize_collision();
set_game_mode(2);
return;
}
playerData->curHP = 10;
playerData->curMaxHP = 10;
playerData->hardMaxHP = 10;
playerData->curFP = 5;
playerData->curMaxFP = 5;
playerData->hardMaxFP = 5;
playerData->maxBP = 2;
playerData->bootsLevel = 0;
playerData->hammerLevel = -1;
playerData->fortressKeyCount = 0;
playerData->level = 0;
for (i = 0; i < ARRAY_COUNT(playerData->partners); i++) {
playerData->partners[i].enabled = 0;
}
playerData->currentPartner = 0;
load_map_by_IDs(gGameStatusPtr->areaID, gGameStatusPtr->mapID, 0);
gGameStatusPtr->loadMenuState = 3;
disable_player_input();
goto block_39;
case 3:
if (D_800A0960 == 0xE) {
D_800A0960 = 0xF;
}
D_800A0954 = 0xFF - D_800A0958;
gOverrideFlags &= ~0x8;
gCameras->flags &= ~0x2;
gOverrideFlags &= ~0x2;
update_player(&gOverrideFlags, -9, gCameras);
update_encounters();
update_npcs();
update_effects();
update_cameras();
if (!does_script_exist(gGameStatusPtr->mainScriptID)) {
gGameStatusPtr->loadMenuState = 4;
gGameStatusPtr->prevArea = gGameStatusPtr->areaID;
goto block_39;
}
// Duplicate return node #40. Try simplifying control flow for better match
return;
case 4:
update_effects();
update_cameras();
update_npcs();
if (D_800A0954 == 0) {
set_screen_overlay_params_front(0xFF, -1.0f);
set_screen_overlay_params_back(0xFF, -1.0f);
} else {
D_800A0954 -= D_800A0958;
if (D_800A0954 & 0x8000) {
D_800A0954 = 0;
}
}
goto block_39;
default:
block_39:
set_screen_overlay_params_back(D_800A0963, D_800A0954);
set_screen_overlay_color(1, D_800A095B, D_800A095D, D_800A095F);
intro_logos_update_fade();
return;
}
} else {
goto block_13;
}
} else {
goto block_9;
}
} else {
goto block_14;
}
}
#else
INCLUDE_ASM(void, "state_intro", state_step_intro, void);
#endif
void state_drawUI_intro(void) {
}

View File

@ -3,17 +3,6 @@
void appendGfx_intro_logos();
Gfx D_80077908[] = {
gsDPPipeSync(),
gsDPSetCycleType(G_CYC_1CYCLE),
gsDPSetTexturePersp(G_TP_NONE),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetCombineMode(G_CC_DECALRGB, G_CC_DECALRGB),
gsDPSetRenderMode(G_RM_OPA_SURF, G_RM_OPA_SURF2),
gsDPSetTextureFilter(G_TF_POINT),
gsSPEndDisplayList(),
};
// bss?
extern s8* D_800A0910;
@ -58,9 +47,9 @@ void state_init_logos(void) {
gCameras[3].flags |= 0x2;
set_cam_viewport(0, 12, 28, 296, 184);
gCameras[0].unk_1E = 0x28;
gCameras[0].backgroundColor[0] = 0;
gCameras[0].backgroundColor[1] = 0;
gCameras[0].backgroundColor[2] = 0;
gCameras[0].bgColor[0] = 0;
gCameras[0].bgColor[1] = 0;
gCameras[0].bgColor[2] = 0;
gCameras[0].unk_54 = 25.0f;
gCameras[0].unk_58 = 25.0f;
gCameras[0].unk_1C = 0;

25
tools/build/bin_inc_c.py Normal file
View File

@ -0,0 +1,25 @@
#! /usr/bin/python3
from sys import argv
import re
import png
if __name__ == "__main__":
infile, outfile = argv[1:]
cname = re.sub(r"[^0-9a-zA-Z_]", "_", outfile)
if cname.startswith("ver_"):
cname = "_".join(cname.split("_")[2:])
cname = re.sub(r"^build_include_", "", cname)
cname = re.sub(r"_inc_c$", "", cname)
with open(outfile, "w") as f:
f.write(f"unsigned char {cname}[] = {{")
with open(infile, "rb") as i:
for char in i.read():
f.write(f"{char},")
f.write(f"}};\n")

View File

@ -128,6 +128,11 @@ def write_ninja_rules(ninja: ninja_syntax.Writer, cpp: str):
command=f"$python {BUILD_TOOLS}/img/header.py $in $out",
)
ninja.rule("bin_inc_c",
description="bin_inc_c $out",
command=f"$python {BUILD_TOOLS}/bin_inc_c.py $in $out",
)
ninja.rule("yay0",
description="yay0 $in",
command=f"{BUILD_TOOLS}/yay0/Yay0compress $in $out",
@ -269,7 +274,7 @@ class Configure:
for object_path in object_paths:
if object_path.suffixes[-1] == ".o":
built_objects.add(str(object_path))
elif object_path.suffixes[-1] == ".h":
elif object_path.suffixes[-1] == ".h" or task == "bin_inc_c":
generated_headers.append(str(object_path))
# don't rebuild objects if we've already seen all of them
@ -317,6 +322,38 @@ class Configure:
task = "cc_dsl"
build(entry.object_path, entry.src_paths, task)
# images embedded inside data aren't linked, but they do need to be built into .inc.c files
if isinstance(seg, segtypes.n64.group.N64SegGroup):
for seg in seg.subsegments:
if isinstance(seg, segtypes.n64.img.N64SegImg):
flags = ""
if seg.flip_horizontal:
flags += "--flip-x "
if seg.flip_vertical:
flags += "--flip-y "
src_paths = [seg.out_path()]
inc_dir = self.build_path() / "include" / seg.dir
bin_path = self.build_path() / seg.dir / (seg.name + ".png.bin")
build(bin_path, src_paths, "img", variables={
"img_type": seg.type,
"img_flags": flags,
})
build(inc_dir / (seg.name + ".png.h"), src_paths, "img_header")
build(inc_dir / (seg.name + ".png.inc.c"), [bin_path], "bin_inc_c")
elif isinstance(seg, segtypes.n64.palette.N64SegPalette):
src_paths = [seg.out_path()]
inc_dir = self.build_path() / "include" / seg.dir
bin_path = self.build_path() / seg.dir / (seg.name + ".pal.bin")
build(bin_path, src_paths, "img", variables={
"img_type": seg.type,
"img_flags": "",
})
build(inc_dir / (seg.name + ".pal.inc.c"), [bin_path], "bin_inc_c")
elif isinstance(seg, segtypes.n64.bin.N64SegBin):
build(entry.object_path, entry.src_paths, "bin")
elif isinstance(seg, segtypes.n64.Yay0.N64SegYay0):
@ -330,19 +367,24 @@ class Configure:
if seg.flip_vertical:
flags += "--flip-y "
build(entry.object_path.with_suffix(".bin"), entry.src_paths, "img", variables={
bin_path = entry.object_path.with_suffix(".bin")
inc_dir = self.build_path() / "include" / seg.dir
build(bin_path, entry.src_paths, "img", variables={
"img_type": seg.type,
"img_flags": flags,
})
build(entry.object_path, [entry.object_path.with_suffix(".bin")], "bin")
build(entry.object_path, [bin_path], "bin")
build(self.build_path() / "include" / seg.dir / (seg.name + ".png.h"), entry.src_paths, "img_header")
build(inc_dir / (seg.name + ".png.h"), entry.src_paths, "img_header")
elif isinstance(seg, segtypes.n64.palette.N64SegPalette):
build(entry.object_path.with_suffix(".bin"), entry.src_paths, "img", variables={
bin_path = entry.object_path.with_suffix(".bin")
build(bin_path, entry.src_paths, "img", variables={
"img_type": seg.type,
"img_flags": "",
})
build(entry.object_path, [entry.object_path.with_suffix(".bin")], "bin")
build(entry.object_path, [bin_path], "bin")
elif seg.type == "PaperMarioNpcSprites":
sprite_yay0s = []

View File

@ -6,7 +6,7 @@
[subrepo]
remote = https://github.com/ethteck/splat.git
branch = master
commit = 21bf3a381c86478c64ecb04f0a552dd39a1a9ac3
parent = 692243523917233b13679c5e00d4adcb94cf0e3d
commit = fe30b60b75cd2660c45915e781599ccce9103246
parent = 28af7909768f4379f103ef590b33196353da84e1
method = merge
cmdver = 0.4.3

View File

@ -1,10 +1,11 @@
from segtypes.n64.codesubsegment import N64SegCodeSubsegment
from segtypes.n64.group import N64SegGroup
from pathlib import Path
from typing import List, Optional
from util.symbols import Symbol
from util import floats, options
class N64SegData(N64SegCodeSubsegment):
class N64SegData(N64SegCodeSubsegment, N64SegGroup):
def out_path(self) -> Optional[Path]:
if self.type.startswith("."):
if self.sibling:
@ -18,9 +19,16 @@ class N64SegData(N64SegCodeSubsegment):
return options.get_asm_path() / "data" / self.dir / f"{self.name}.{self.type}.s"
def scan(self, rom_bytes: bytes):
N64SegGroup.scan(self, rom_bytes)
if super().should_scan():
self.file_text = self.disassemble_data(rom_bytes)
else:
self.file_text = None
def split(self, rom_bytes: bytes):
N64SegGroup.split(self, rom_bytes)
if self.file_text:
path = self.out_path()
@ -30,9 +38,21 @@ class N64SegData(N64SegCodeSubsegment):
with open(path, "w", newline="\n") as f:
f.write(self.file_text)
def should_split(self) -> bool:
return True
def should_scan(self) -> bool:
return True
def cache(self):
return [N64SegCodeSubsegment.cache(self), N64SegGroup.cache(self)]
def get_linker_section(self) -> str:
return ".data"
def get_linker_entries(self):
return N64SegCodeSubsegment.get_linker_entries(self)
def check_jtbls(self, rom_bytes, syms: List[Symbol]):
for i, sym in enumerate(syms):
if sym.type == "jtbl":

View File

@ -13,10 +13,16 @@ class N64SegGroup(N64Segment):
self.rodata_syms: Dict[int, List[Symbol]] = {}
# TODO: move this to N64SegCode
if isinstance(yaml, dict):
# TODO Note: These start/end vram options don't really do anything yet
data_vram = Range(yaml.get("data_vram_start"), yaml.get("data_vram_end"))
rodata_vram = Range(yaml.get("rodata_vram_start"), yaml.get("rodata_vram_end"))
bss_vram = Range(yaml.get("bss_vram_start"), yaml.get("bss_vram_end"))
else:
data_vram = Range()
rodata_vram = Range()
bss_vram = Range()
self.section_boundaries = {
"data": data_vram,
@ -47,7 +53,7 @@ class N64SegGroup(N64Segment):
vram_start = elem.rom_start - self.rom_start + self.vram_start
else:
vram_start = "auto"
rep = replace_class(elem.rom_start, elem.rom_end, rep_type, base[0], vram_start, extract=False)
rep = replace_class(elem.rom_start, elem.rom_end, rep_type, base[0], vram_start, False, self.given_subalign, self.given_is_overlay, self.given_dir, [], {})
rep.sibling = base[1]
rep.parent = self
alls.append(rep)
@ -88,8 +94,7 @@ class N64SegGroup(N64Segment):
found_sections = {"data": Range(), "rodata": Range(), "bss": Range()} # Stores yaml index where a section was first found
if "subsegments" not in segment_yaml:
print(f"Error: Group segment {self.name} is missing a 'subsegments' field")
sys.exit(2)
return []
# Mark any manually added dot types
if options.get("auto_all_sections"):
@ -182,11 +187,12 @@ class N64SegGroup(N64Segment):
prev_start = start
# Add the automatic all_ sections
orig_len = len(ret)
for section in reversed(inserts):
idx = inserts[section]
if idx == -1:
idx = len(ret)
idx = orig_len
# bss hack TODO maybe rethink
if section == "bss" and self.vram_start is not None:

View File

@ -45,7 +45,7 @@ def get_base_path() -> Path:
return Path(opts["base_path"])
def get_asset_path() -> Path:
return get_base_path() / opts.get("asset_path", "assets")
return Path(get_base_path() / opts.get("asset_path", "assets")).relative_to(get_base_path())
def get_target_path() -> Path:
return get_base_path() / opts["target_path"]

View File

@ -3,8 +3,8 @@
.section .rodata
glabel D_802A3E88_7214D8
.word 0x00000000, 0x00000000, 0x00000000, 0xFFFFFFE2, 0x00000000, 0xFFFFFFCE, 0xFFFFFFE5, 0x00000000, 0x0000001E, 0xFFFFFFBA, 0x00000000, 0xFFFFFFFB, 0xFFFFFF97, 0x00000000, 0x0000001E, 0xFFFFFF92, 0x00000000, 0xFFFFFFCE, 0xFFFFFF6F, 0x00000000, 0xFFFFFFFB, 0xFFFFFF56, 0x00000000, 0xFFFFFFCE, 0xFFFFFF42, 0x00000000, 0xFFFFFFE2, 0xFFFFFF2E, 0x00000000, 0xFFFFFFF6
glabel D_802A3E88_7214E0
.word 0x00000000, 0xFFFFFFE2, 0x00000000, 0xFFFFFFCE, 0xFFFFFFE5, 0x00000000, 0x0000001E, 0xFFFFFFBA, 0x00000000, 0xFFFFFFFB, 0xFFFFFF97, 0x00000000, 0x0000001E, 0xFFFFFF92, 0x00000000, 0xFFFFFFCE, 0xFFFFFF6F, 0x00000000, 0xFFFFFFFB, 0xFFFFFF56, 0x00000000, 0xFFFFFFCE, 0xFFFFFF42, 0x00000000, 0xFFFFFFE2, 0xFFFFFF2E, 0x00000000, 0xFFFFFFF6
glabel D_802A3F00_721550
.word 0x3F800000, 0x3F800000, 0x3F400000, 0x3F800000, 0x3F800000, 0x3F800000, 0x3F800000, 0x3F800000, 0x3F400000, 0x3F400000

View File

@ -1,663 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel gfx_draw_background
/* 3210 80027E10 27BDFFB8 */ addiu $sp, $sp, -0x48
/* 3214 80027E14 3C040050 */ lui $a0, 0x50
/* 3218 80027E18 3C0C800A */ lui $t4, %hi(gMasterGfxPos)
/* 321C 80027E1C 258CA66C */ addiu $t4, $t4, %lo(gMasterGfxPos)
/* 3220 80027E20 348403C0 */ ori $a0, $a0, 0x3c0
/* 3224 80027E24 3C02ED00 */ lui $v0, 0xed00
/* 3228 80027E28 AFBF0044 */ sw $ra, 0x44($sp)
/* 322C 80027E2C AFBE0040 */ sw $fp, 0x40($sp)
/* 3230 80027E30 AFB7003C */ sw $s7, 0x3c($sp)
/* 3234 80027E34 AFB60038 */ sw $s6, 0x38($sp)
/* 3238 80027E38 AFB50034 */ sw $s5, 0x34($sp)
/* 323C 80027E3C AFB40030 */ sw $s4, 0x30($sp)
/* 3240 80027E40 AFB3002C */ sw $s3, 0x2c($sp)
/* 3244 80027E44 AFB20028 */ sw $s2, 0x28($sp)
/* 3248 80027E48 AFB10024 */ sw $s1, 0x24($sp)
/* 324C 80027E4C AFB00020 */ sw $s0, 0x20($sp)
/* 3250 80027E50 8D8B0000 */ lw $t3, ($t4)
/* 3254 80027E54 3C108007 */ lui $s0, %hi(gGameStatusPtr)
/* 3258 80027E58 2610419C */ addiu $s0, $s0, %lo(gGameStatusPtr)
/* 325C 80027E5C 0160182D */ daddu $v1, $t3, $zero
/* 3260 80027E60 256B0008 */ addiu $t3, $t3, 8
/* 3264 80027E64 AD8B0000 */ sw $t3, ($t4)
/* 3268 80027E68 AC640004 */ sw $a0, 4($v1)
/* 326C 80027E6C 3C04800B */ lui $a0, %hi(gCameras)
/* 3270 80027E70 24841D80 */ addiu $a0, $a0, %lo(gCameras)
/* 3274 80027E74 AC620000 */ sw $v0, ($v1)
/* 3278 80027E78 3C038007 */ lui $v1, %hi(gCurrentCameraID)
/* 327C 80027E7C 8C637410 */ lw $v1, %lo(gCurrentCameraID)($v1)
/* 3280 80027E80 8E0D0000 */ lw $t5, ($s0)
/* 3284 80027E84 00031080 */ sll $v0, $v1, 2
/* 3288 80027E88 00431021 */ addu $v0, $v0, $v1
/* 328C 80027E8C 00021080 */ sll $v0, $v0, 2
/* 3290 80027E90 00431023 */ subu $v0, $v0, $v1
/* 3294 80027E94 000218C0 */ sll $v1, $v0, 3
/* 3298 80027E98 00431021 */ addu $v0, $v0, $v1
/* 329C 80027E9C 000210C0 */ sll $v0, $v0, 3
/* 32A0 80027EA0 00449821 */ addu $s3, $v0, $a0
/* 32A4 80027EA4 95A30148 */ lhu $v1, 0x148($t5)
/* 32A8 80027EA8 24020020 */ addiu $v0, $zero, 0x20
/* 32AC 80027EAC 306300F0 */ andi $v1, $v1, 0xf0
/* 32B0 80027EB0 1062004E */ beq $v1, $v0, .L80027FEC
/* 32B4 80027EB4 28620021 */ slti $v0, $v1, 0x21
/* 32B8 80027EB8 10400005 */ beqz $v0, .L80027ED0
/* 32BC 80027EBC 24020010 */ addiu $v0, $zero, 0x10
/* 32C0 80027EC0 10620008 */ beq $v1, $v0, .L80027EE4
/* 32C4 80027EC4 3C03FF10 */ lui $v1, 0xff10
/* 32C8 80027EC8 0800A0CB */ j .L8002832C
/* 32CC 80027ECC 00000000 */ nop
.L80027ED0:
/* 32D0 80027ED0 24020030 */ addiu $v0, $zero, 0x30
/* 32D4 80027ED4 10620053 */ beq $v1, $v0, .L80028024
/* 32D8 80027ED8 00000000 */ nop
/* 32DC 80027EDC 0800A0CB */ j .L8002832C
/* 32E0 80027EE0 00000000 */ nop
.L80027EE4:
/* 32E4 80027EE4 3463013F */ ori $v1, $v1, 0x13f
/* 32E8 80027EE8 3C06E300 */ lui $a2, 0xe300
/* 32EC 80027EEC 34C60A01 */ ori $a2, $a2, 0xa01
/* 32F0 80027EF0 3C078080 */ lui $a3, 0x8080
/* 32F4 80027EF4 34E780FF */ ori $a3, $a3, 0x80ff
/* 32F8 80027EF8 3C05E200 */ lui $a1, 0xe200
/* 32FC 80027EFC 34A51D00 */ ori $a1, $a1, 0x1d00
/* 3300 80027F00 3C0AE200 */ lui $t2, 0xe200
/* 3304 80027F04 354A001C */ ori $t2, $t2, 0x1c
/* 3308 80027F08 3C090FA5 */ lui $t1, 0xfa5
/* 330C 80027F0C 35294040 */ ori $t1, $t1, 0x4040
/* 3310 80027F10 3C08F650 */ lui $t0, 0xf650
/* 3314 80027F14 350803C0 */ ori $t0, $t0, 0x3c0
/* 3318 80027F18 25620008 */ addiu $v0, $t3, 8
/* 331C 80027F1C 3C04E700 */ lui $a0, 0xe700
/* 3320 80027F20 AD820000 */ sw $v0, ($t4)
/* 3324 80027F24 25620010 */ addiu $v0, $t3, 0x10
/* 3328 80027F28 AD640000 */ sw $a0, ($t3)
/* 332C 80027F2C AD600004 */ sw $zero, 4($t3)
/* 3330 80027F30 AD820000 */ sw $v0, ($t4)
/* 3334 80027F34 25620018 */ addiu $v0, $t3, 0x18
/* 3338 80027F38 AD630008 */ sw $v1, 8($t3)
/* 333C 80027F3C AD820000 */ sw $v0, ($t4)
/* 3340 80027F40 25620020 */ addiu $v0, $t3, 0x20
/* 3344 80027F44 AD820000 */ sw $v0, ($t4)
/* 3348 80027F48 25620028 */ addiu $v0, $t3, 0x28
/* 334C 80027F4C AD820000 */ sw $v0, ($t4)
/* 3350 80027F50 25620030 */ addiu $v0, $t3, 0x30
/* 3354 80027F54 AD820000 */ sw $v0, ($t4)
/* 3358 80027F58 25620038 */ addiu $v0, $t3, 0x38
/* 335C 80027F5C AD820000 */ sw $v0, ($t4)
/* 3360 80027F60 3C03800A */ lui $v1, %hi(D_8009A658)
/* 3364 80027F64 8C63A658 */ lw $v1, %lo(D_8009A658)($v1)
/* 3368 80027F68 25620040 */ addiu $v0, $t3, 0x40
/* 336C 80027F6C AD820000 */ sw $v0, ($t4)
/* 3370 80027F70 8C630004 */ lw $v1, 4($v1)
/* 3374 80027F74 25620048 */ addiu $v0, $t3, 0x48
/* 3378 80027F78 AD820000 */ sw $v0, ($t4)
/* 337C 80027F7C 3C02F900 */ lui $v0, 0xf900
/* 3380 80027F80 AD620018 */ sw $v0, 0x18($t3)
/* 3384 80027F84 3C02EE00 */ lui $v0, 0xee00
/* 3388 80027F88 AD620020 */ sw $v0, 0x20($t3)
/* 338C 80027F8C 2402FFFF */ addiu $v0, $zero, -1
/* 3390 80027F90 AD620024 */ sw $v0, 0x24($t3)
/* 3394 80027F94 24020004 */ addiu $v0, $zero, 4
/* 3398 80027F98 AD660010 */ sw $a2, 0x10($t3)
/* 339C 80027F9C AD600014 */ sw $zero, 0x14($t3)
/* 33A0 80027FA0 AD67001C */ sw $a3, 0x1c($t3)
/* 33A4 80027FA4 AD650028 */ sw $a1, 0x28($t3)
/* 33A8 80027FA8 AD62002C */ sw $v0, 0x2c($t3)
/* 33AC 80027FAC AD6A0030 */ sw $t2, 0x30($t3)
/* 33B0 80027FB0 AD690034 */ sw $t1, 0x34($t3)
/* 33B4 80027FB4 AD680038 */ sw $t0, 0x38($t3)
/* 33B8 80027FB8 AD60003C */ sw $zero, 0x3c($t3)
/* 33BC 80027FBC AD640040 */ sw $a0, 0x40($t3)
/* 33C0 80027FC0 AD600044 */ sw $zero, 0x44($t3)
/* 33C4 80027FC4 AD650048 */ sw $a1, 0x48($t3)
/* 33C8 80027FC8 AD60004C */ sw $zero, 0x4c($t3)
/* 33CC 80027FCC AD63000C */ sw $v1, 0xc($t3)
/* 33D0 80027FD0 95A20148 */ lhu $v0, 0x148($t5)
/* 33D4 80027FD4 25630050 */ addiu $v1, $t3, 0x50
/* 33D8 80027FD8 AD830000 */ sw $v1, ($t4)
/* 33DC 80027FDC 3042FF0F */ andi $v0, $v0, 0xff0f
/* 33E0 80027FE0 34420020 */ ori $v0, $v0, 0x20
/* 33E4 80027FE4 0800A1E4 */ j .L80028790
/* 33E8 80027FE8 A5A20148 */ sh $v0, 0x148($t5)
.L80027FEC:
/* 33EC 80027FEC 3C02800A */ lui $v0, %hi(D_8009A658)
/* 33F0 80027FF0 8C42A658 */ lw $v0, %lo(D_8009A658)($v0)
/* 33F4 80027FF4 3C06800A */ lui $a2, %hi(nuGfxZBuffer)
/* 33F8 80027FF8 8CC6A5DC */ lw $a2, %lo(nuGfxZBuffer)($a2)
/* 33FC 80027FFC 8C440000 */ lw $a0, ($v0)
/* 3400 80028000 0C009E6D */ jal func_800279B4
/* 3404 80028004 8C450004 */ lw $a1, 4($v0)
/* 3408 80028008 8E030000 */ lw $v1, ($s0)
/* 340C 8002800C 94620148 */ lhu $v0, 0x148($v1)
/* 3410 80028010 3C018007 */ lui $at, %hi(D_800741F8)
/* 3414 80028014 AC2041F8 */ sw $zero, %lo(D_800741F8)($at)
/* 3418 80028018 3042FF0F */ andi $v0, $v0, 0xff0f
/* 341C 8002801C 34420030 */ ori $v0, $v0, 0x30
/* 3420 80028020 A4620148 */ sh $v0, 0x148($v1)
.L80028024:
/* 3424 80028024 3C168007 */ lui $s6, %hi(D_800741F8)
/* 3428 80028028 26D641F8 */ addiu $s6, $s6, %lo(D_800741F8)
/* 342C 8002802C 8EC20000 */ lw $v0, ($s6)
/* 3430 80028030 24420010 */ addiu $v0, $v0, 0x10
/* 3434 80028034 AEC20000 */ sw $v0, ($s6)
/* 3438 80028038 28420081 */ slti $v0, $v0, 0x81
/* 343C 8002803C 14400003 */ bnez $v0, .L8002804C
/* 3440 80028040 3C060050 */ lui $a2, 0x50
/* 3444 80028044 24020080 */ addiu $v0, $zero, 0x80
/* 3448 80028048 AEC20000 */ sw $v0, ($s6)
.L8002804C:
/* 344C 8002804C 34C603C0 */ ori $a2, $a2, 0x3c0
/* 3450 80028050 3C05E300 */ lui $a1, 0xe300
/* 3454 80028054 34A50A01 */ ori $a1, $a1, 0xa01
/* 3458 80028058 3C07E200 */ lui $a3, 0xe200
/* 345C 8002805C 34E7001C */ ori $a3, $a3, 0x1c
/* 3460 80028060 3C08FF10 */ lui $t0, 0xff10
/* 3464 80028064 3508013F */ ori $t0, $t0, 0x13f
/* 3468 80028068 3C090001 */ lui $t1, 1
/* 346C 8002806C 35290001 */ ori $t1, $t1, 1
/* 3470 80028070 3C0AF64F */ lui $t2, 0xf64f
/* 3474 80028074 354AC3BC */ ori $t2, $t2, 0xc3bc
/* 3478 80028078 3C0BE300 */ lui $t3, 0xe300
/* 347C 8002807C 356B0C00 */ ori $t3, $t3, 0xc00
/* 3480 80028080 3C0CE300 */ lui $t4, 0xe300
/* 3484 80028084 358C1001 */ ori $t4, $t4, 0x1001
/* 3488 80028088 3C0D0F0A */ lui $t5, 0xf0a
/* 348C 8002808C 35AD4000 */ ori $t5, $t5, 0x4000
/* 3490 80028090 3C0FFC35 */ lui $t7, 0xfc35
/* 3494 80028094 35EF7E6A */ ori $t7, $t7, 0x7e6a
/* 3498 80028098 3C0E12FC */ lui $t6, 0x12fc
/* 349C 8002809C 35CEFCBE */ ori $t6, $t6, 0xfcbe
/* 34A0 800280A0 3C112828 */ lui $s1, 0x2828
/* 34A4 800280A4 36312800 */ ori $s1, $s1, 0x2800
/* 34A8 800280A8 3C10E300 */ lui $s0, 0xe300
/* 34AC 800280AC 36101201 */ ori $s0, $s0, 0x1201
/* 34B0 800280B0 0000C82D */ daddu $t9, $zero, $zero
/* 34B4 800280B4 3C02800A */ lui $v0, %hi(gMasterGfxPos)
/* 34B8 800280B8 2442A66C */ addiu $v0, $v0, %lo(gMasterGfxPos)
/* 34BC 800280BC 0040902D */ daddu $s2, $v0, $zero
/* 34C0 800280C0 AFAE0018 */ sw $t6, 0x18($sp)
/* 34C4 800280C4 3C0EFD10 */ lui $t6, 0xfd10
/* 34C8 800280C8 35CE013F */ ori $t6, $t6, 0x13f
/* 34CC 800280CC 3C15F510 */ lui $s5, 0xf510
/* 34D0 800280D0 36B5A000 */ ori $s5, $s5, 0xa000
/* 34D4 800280D4 AFAE0010 */ sw $t6, 0x10($sp)
/* 34D8 800280D8 3C0E074F */ lui $t6, 0x74f
/* 34DC 800280DC 35CEC014 */ ori $t6, $t6, 0xc014
/* 34E0 800280E0 3C17E700 */ lui $s7, 0xe700
/* 34E4 800280E4 3C1E004F */ lui $fp, 0x4f
/* 34E8 800280E8 37DEC014 */ ori $fp, $fp, 0xc014
/* 34EC 800280EC 0320C02D */ daddu $t8, $t9, $zero
/* 34F0 800280F0 24140018 */ addiu $s4, $zero, 0x18
/* 34F4 800280F4 0320982D */ daddu $s3, $t9, $zero
/* 34F8 800280F8 AFAE0014 */ sw $t6, 0x14($sp)
/* 34FC 800280FC 8E420000 */ lw $v0, ($s2)
/* 3500 80028100 02E0182D */ daddu $v1, $s7, $zero
/* 3504 80028104 0040202D */ daddu $a0, $v0, $zero
/* 3508 80028108 24420008 */ addiu $v0, $v0, 8
/* 350C 8002810C AE420000 */ sw $v0, ($s2)
/* 3510 80028110 AC830000 */ sw $v1, ($a0)
/* 3514 80028114 24430008 */ addiu $v1, $v0, 8
/* 3518 80028118 AC800004 */ sw $zero, 4($a0)
/* 351C 8002811C AE430000 */ sw $v1, ($s2)
/* 3520 80028120 3C03ED00 */ lui $v1, 0xed00
/* 3524 80028124 AC430000 */ sw $v1, ($v0)
/* 3528 80028128 24430010 */ addiu $v1, $v0, 0x10
/* 352C 8002812C AC460004 */ sw $a2, 4($v0)
/* 3530 80028130 AE430000 */ sw $v1, ($s2)
/* 3534 80028134 3C030030 */ lui $v1, 0x30
/* 3538 80028138 AC43000C */ sw $v1, 0xc($v0)
/* 353C 8002813C 00541821 */ addu $v1, $v0, $s4
/* 3540 80028140 AC450008 */ sw $a1, 8($v0)
/* 3544 80028144 AE430000 */ sw $v1, ($s2)
/* 3548 80028148 3C04800A */ lui $a0, %hi(D_8009A64C)
/* 354C 8002814C 8C84A64C */ lw $a0, %lo(D_8009A64C)($a0)
/* 3550 80028150 24430020 */ addiu $v1, $v0, 0x20
/* 3554 80028154 AC470010 */ sw $a3, 0x10($v0)
/* 3558 80028158 AC400014 */ sw $zero, 0x14($v0)
/* 355C 8002815C AE430000 */ sw $v1, ($s2)
/* 3560 80028160 24430028 */ addiu $v1, $v0, 0x28
/* 3564 80028164 AC480018 */ sw $t0, 0x18($v0)
/* 3568 80028168 AC44001C */ sw $a0, 0x1c($v0)
/* 356C 8002816C AE430000 */ sw $v1, ($s2)
/* 3570 80028170 3C03F700 */ lui $v1, 0xf700
/* 3574 80028174 AC430020 */ sw $v1, 0x20($v0)
/* 3578 80028178 24430030 */ addiu $v1, $v0, 0x30
/* 357C 8002817C AC490024 */ sw $t1, 0x24($v0)
/* 3580 80028180 AE430000 */ sw $v1, ($s2)
/* 3584 80028184 24430038 */ addiu $v1, $v0, 0x38
/* 3588 80028188 AC4A0028 */ sw $t2, 0x28($v0)
/* 358C 8002818C AC40002C */ sw $zero, 0x2c($v0)
/* 3590 80028190 AE430000 */ sw $v1, ($s2)
/* 3594 80028194 24430040 */ addiu $v1, $v0, 0x40
/* 3598 80028198 AC450030 */ sw $a1, 0x30($v0)
/* 359C 8002819C AC400034 */ sw $zero, 0x34($v0)
/* 35A0 800281A0 AE430000 */ sw $v1, ($s2)
/* 35A4 800281A4 24430048 */ addiu $v1, $v0, 0x48
/* 35A8 800281A8 AC4B0038 */ sw $t3, 0x38($v0)
/* 35AC 800281AC AC40003C */ sw $zero, 0x3c($v0)
/* 35B0 800281B0 AE430000 */ sw $v1, ($s2)
/* 35B4 800281B4 24430050 */ addiu $v1, $v0, 0x50
/* 35B8 800281B8 AC4C0040 */ sw $t4, 0x40($v0)
/* 35BC 800281BC AC400044 */ sw $zero, 0x44($v0)
/* 35C0 800281C0 AE430000 */ sw $v1, ($s2)
/* 35C4 800281C4 24430058 */ addiu $v1, $v0, 0x58
/* 35C8 800281C8 AC470048 */ sw $a3, 0x48($v0)
/* 35CC 800281CC AC4D004C */ sw $t5, 0x4c($v0)
/* 35D0 800281D0 AE430000 */ sw $v1, ($s2)
/* 35D4 800281D4 AC4F0050 */ sw $t7, 0x50($v0)
/* 35D8 800281D8 8FAE0018 */ lw $t6, 0x18($sp)
/* 35DC 800281DC 24430060 */ addiu $v1, $v0, 0x60
/* 35E0 800281E0 AC4E0054 */ sw $t6, 0x54($v0)
/* 35E4 800281E4 AE430000 */ sw $v1, ($s2)
/* 35E8 800281E8 3C03FA00 */ lui $v1, 0xfa00
/* 35EC 800281EC AC430058 */ sw $v1, 0x58($v0)
/* 35F0 800281F0 92C40003 */ lbu $a0, 3($s6)
/* 35F4 800281F4 24430068 */ addiu $v1, $v0, 0x68
/* 35F8 800281F8 AE430000 */ sw $v1, ($s2)
/* 35FC 800281FC AC500060 */ sw $s0, 0x60($v0)
/* 3600 80028200 AC400064 */ sw $zero, 0x64($v0)
/* 3604 80028204 00912025 */ or $a0, $a0, $s1
/* 3608 80028208 AC44005C */ sw $a0, 0x5c($v0)
.L8002820C:
/* 360C 8002820C 3C070400 */ lui $a3, 0x400
/* 3610 80028210 34E70400 */ ori $a3, $a3, 0x400
/* 3614 80028214 33060FFF */ andi $a2, $t8, 0xfff
/* 3618 80028218 27180018 */ addiu $t8, $t8, 0x18
/* 361C 8002821C 32850FFF */ andi $a1, $s4, 0xfff
/* 3620 80028220 26940018 */ addiu $s4, $s4, 0x18
/* 3624 80028224 27390001 */ addiu $t9, $t9, 1
/* 3628 80028228 8E430000 */ lw $v1, ($s2)
/* 362C 8002822C 3C02800A */ lui $v0, %hi(nuGfxZBuffer)
/* 3630 80028230 8C42A5DC */ lw $v0, %lo(nuGfxZBuffer)($v0)
/* 3634 80028234 0060202D */ daddu $a0, $v1, $zero
/* 3638 80028238 24630008 */ addiu $v1, $v1, 8
/* 363C 8002823C 00531021 */ addu $v0, $v0, $s3
/* 3640 80028240 AE430000 */ sw $v1, ($s2)
/* 3644 80028244 8FAE0010 */ lw $t6, 0x10($sp)
/* 3648 80028248 26730F00 */ addiu $s3, $s3, 0xf00
/* 364C 8002824C AC820004 */ sw $v0, 4($a0)
/* 3650 80028250 24620008 */ addiu $v0, $v1, 8
/* 3654 80028254 AC8E0000 */ sw $t6, ($a0)
/* 3658 80028258 3C0E0700 */ lui $t6, 0x700
/* 365C 8002825C AE420000 */ sw $v0, ($s2)
/* 3660 80028260 24620010 */ addiu $v0, $v1, 0x10
/* 3664 80028264 AC6E0004 */ sw $t6, 4($v1)
/* 3668 80028268 3C0EE600 */ lui $t6, 0xe600
/* 366C 8002826C AC750000 */ sw $s5, ($v1)
/* 3670 80028270 AE420000 */ sw $v0, ($s2)
/* 3674 80028274 24620018 */ addiu $v0, $v1, 0x18
/* 3678 80028278 AC6E0008 */ sw $t6, 8($v1)
/* 367C 8002827C 3C0EF400 */ lui $t6, 0xf400
/* 3680 80028280 AC60000C */ sw $zero, 0xc($v1)
/* 3684 80028284 AE420000 */ sw $v0, ($s2)
/* 3688 80028288 AC6E0010 */ sw $t6, 0x10($v1)
/* 368C 8002828C 8FAE0014 */ lw $t6, 0x14($sp)
/* 3690 80028290 24620020 */ addiu $v0, $v1, 0x20
/* 3694 80028294 AC6E0014 */ sw $t6, 0x14($v1)
/* 3698 80028298 AE420000 */ sw $v0, ($s2)
/* 369C 8002829C 24620028 */ addiu $v0, $v1, 0x28
/* 36A0 800282A0 AC770018 */ sw $s7, 0x18($v1)
/* 36A4 800282A4 AC60001C */ sw $zero, 0x1c($v1)
/* 36A8 800282A8 AE420000 */ sw $v0, ($s2)
/* 36AC 800282AC 24620030 */ addiu $v0, $v1, 0x30
/* 36B0 800282B0 3C0EF200 */ lui $t6, 0xf200
/* 36B4 800282B4 AC750020 */ sw $s5, 0x20($v1)
/* 36B8 800282B8 AC600024 */ sw $zero, 0x24($v1)
/* 36BC 800282BC AE420000 */ sw $v0, ($s2)
/* 36C0 800282C0 24620038 */ addiu $v0, $v1, 0x38
/* 36C4 800282C4 AC6E0028 */ sw $t6, 0x28($v1)
/* 36C8 800282C8 3C0EE450 */ lui $t6, 0xe450
/* 36CC 800282CC 00AE2825 */ or $a1, $a1, $t6
/* 36D0 800282D0 AC7E002C */ sw $fp, 0x2c($v1)
/* 36D4 800282D4 AE420000 */ sw $v0, ($s2)
/* 36D8 800282D8 24620040 */ addiu $v0, $v1, 0x40
/* 36DC 800282DC AC650030 */ sw $a1, 0x30($v1)
/* 36E0 800282E0 AC660034 */ sw $a2, 0x34($v1)
/* 36E4 800282E4 AE420000 */ sw $v0, ($s2)
/* 36E8 800282E8 3C02E100 */ lui $v0, 0xe100
/* 36EC 800282EC AC620038 */ sw $v0, 0x38($v1)
/* 36F0 800282F0 3C02FFE0 */ lui $v0, 0xffe0
/* 36F4 800282F4 AC62003C */ sw $v0, 0x3c($v1)
/* 36F8 800282F8 24620048 */ addiu $v0, $v1, 0x48
/* 36FC 800282FC AE420000 */ sw $v0, ($s2)
/* 3700 80028300 3C02F100 */ lui $v0, 0xf100
/* 3704 80028304 AC620040 */ sw $v0, 0x40($v1)
/* 3708 80028308 24620050 */ addiu $v0, $v1, 0x50
/* 370C 8002830C AC670044 */ sw $a3, 0x44($v1)
/* 3710 80028310 AE420000 */ sw $v0, ($s2)
/* 3714 80028314 2B220028 */ slti $v0, $t9, 0x28
/* 3718 80028318 AC770048 */ sw $s7, 0x48($v1)
/* 371C 8002831C 1440FFBB */ bnez $v0, .L8002820C
/* 3720 80028320 AC60004C */ sw $zero, 0x4c($v1)
/* 3724 80028324 0800A1E4 */ j .L80028790
/* 3728 80028328 00000000 */ nop
.L8002832C:
/* 372C 8002832C 3C02800A */ lui $v0, %hi(gOverrideFlags)
/* 3730 80028330 8C42A650 */ lw $v0, %lo(gOverrideFlags)($v0)
/* 3734 80028334 30420008 */ andi $v0, $v0, 8
/* 3738 80028338 1040000E */ beqz $v0, .L80028374
/* 373C 8002833C 3C05FF10 */ lui $a1, 0xff10
/* 3740 80028340 34A5013F */ ori $a1, $a1, 0x13f
/* 3744 80028344 3C03800A */ lui $v1, %hi(gMasterGfxPos)
/* 3748 80028348 2463A66C */ addiu $v1, $v1, %lo(gMasterGfxPos)
/* 374C 8002834C 8C620000 */ lw $v0, ($v1)
/* 3750 80028350 3C04800A */ lui $a0, %hi(D_8009A64C)
/* 3754 80028354 8C84A64C */ lw $a0, %lo(D_8009A64C)($a0)
/* 3758 80028358 0040802D */ daddu $s0, $v0, $zero
/* 375C 8002835C 24420008 */ addiu $v0, $v0, 8
/* 3760 80028360 AC620000 */ sw $v0, ($v1)
/* 3764 80028364 0C0187A4 */ jal osVirtualToPhysical
/* 3768 80028368 AE050000 */ sw $a1, ($s0)
/* 376C 8002836C 0800A1ED */ j .L800287B4
/* 3770 80028370 AE020004 */ sw $v0, 4($s0)
.L80028374:
/* 3774 80028374 3C06E300 */ lui $a2, 0xe300
/* 3778 80028378 34C60A01 */ ori $a2, $a2, 0xa01
/* 377C 8002837C 3C07E200 */ lui $a3, 0xe200
/* 3780 80028380 34E7001C */ ori $a3, $a3, 0x1c
/* 3784 80028384 3C08FF10 */ lui $t0, 0xff10
/* 3788 80028388 3508013F */ ori $t0, $t0, 0x13f
/* 378C 8002838C 3C09FFFC */ lui $t1, 0xfffc
/* 3790 80028390 3529FFFC */ ori $t1, $t1, 0xfffc
/* 3794 80028394 3C0AF64F */ lui $t2, 0xf64f
/* 3798 80028398 354AC3BC */ ori $t2, $t2, 0xc3bc
/* 379C 8002839C 3C11800A */ lui $s1, %hi(gMasterGfxPos)
/* 37A0 800283A0 2631A66C */ addiu $s1, $s1, %lo(gMasterGfxPos)
/* 37A4 800283A4 3C02FE00 */ lui $v0, 0xfe00
/* 37A8 800283A8 8E300000 */ lw $s0, ($s1)
/* 37AC 800283AC 3C04800A */ lui $a0, %hi(D_8009A64C)
/* 37B0 800283B0 8C84A64C */ lw $a0, %lo(D_8009A64C)($a0)
/* 37B4 800283B4 0200282D */ daddu $a1, $s0, $zero
/* 37B8 800283B8 26100008 */ addiu $s0, $s0, 8
/* 37BC 800283BC AE300000 */ sw $s0, ($s1)
/* 37C0 800283C0 3C03800A */ lui $v1, %hi(nuGfxZBuffer)
/* 37C4 800283C4 8C63A5DC */ lw $v1, %lo(nuGfxZBuffer)($v1)
/* 37C8 800283C8 3C12F700 */ lui $s2, 0xf700
/* 37CC 800283CC ACA20000 */ sw $v0, ($a1)
/* 37D0 800283D0 3C028000 */ lui $v0, 0x8000
/* 37D4 800283D4 00621821 */ addu $v1, $v1, $v0
/* 37D8 800283D8 26020008 */ addiu $v0, $s0, 8
/* 37DC 800283DC ACA30004 */ sw $v1, 4($a1)
/* 37E0 800283E0 AE220000 */ sw $v0, ($s1)
/* 37E4 800283E4 3C020030 */ lui $v0, 0x30
/* 37E8 800283E8 AE020004 */ sw $v0, 4($s0)
/* 37EC 800283EC 26020010 */ addiu $v0, $s0, 0x10
/* 37F0 800283F0 AE060000 */ sw $a2, ($s0)
/* 37F4 800283F4 AE220000 */ sw $v0, ($s1)
/* 37F8 800283F8 26020018 */ addiu $v0, $s0, 0x18
/* 37FC 800283FC AE070008 */ sw $a3, 8($s0)
/* 3800 80028400 AE00000C */ sw $zero, 0xc($s0)
/* 3804 80028404 AE220000 */ sw $v0, ($s1)
/* 3808 80028408 26020020 */ addiu $v0, $s0, 0x20
/* 380C 8002840C AE080010 */ sw $t0, 0x10($s0)
/* 3810 80028410 AE030014 */ sw $v1, 0x14($s0)
/* 3814 80028414 AE220000 */ sw $v0, ($s1)
/* 3818 80028418 26020028 */ addiu $v0, $s0, 0x28
/* 381C 8002841C AE120018 */ sw $s2, 0x18($s0)
/* 3820 80028420 AE09001C */ sw $t1, 0x1c($s0)
/* 3824 80028424 AE220000 */ sw $v0, ($s1)
/* 3828 80028428 26020030 */ addiu $v0, $s0, 0x30
/* 382C 8002842C AE0A0020 */ sw $t2, 0x20($s0)
/* 3830 80028430 AE000024 */ sw $zero, 0x24($s0)
/* 3834 80028434 AE220000 */ sw $v0, ($s1)
/* 3838 80028438 3C02E700 */ lui $v0, 0xe700
/* 383C 8002843C AE020028 */ sw $v0, 0x28($s0)
/* 3840 80028440 26020038 */ addiu $v0, $s0, 0x38
/* 3844 80028444 AE00002C */ sw $zero, 0x2c($s0)
/* 3848 80028448 AE220000 */ sw $v0, ($s1)
/* 384C 8002844C 0C0187A4 */ jal osVirtualToPhysical
/* 3850 80028450 AE080030 */ sw $t0, 0x30($s0)
/* 3854 80028454 8E230000 */ lw $v1, ($s1)
/* 3858 80028458 AE020034 */ sw $v0, 0x34($s0)
/* 385C 8002845C 0060282D */ daddu $a1, $v1, $zero
/* 3860 80028460 ACB20000 */ sw $s2, ($a1)
/* 3864 80028464 8664002C */ lh $a0, 0x2c($s3)
/* 3868 80028468 24630008 */ addiu $v1, $v1, 8
/* 386C 8002846C AE230000 */ sw $v1, ($s1)
/* 3870 80028470 8663002E */ lh $v1, 0x2e($s3)
/* 3874 80028474 96620030 */ lhu $v0, 0x30($s3)
/* 3878 80028478 00042200 */ sll $a0, $a0, 8
/* 387C 8002847C 3084F800 */ andi $a0, $a0, 0xf800
/* 3880 80028480 000318C0 */ sll $v1, $v1, 3
/* 3884 80028484 306307C0 */ andi $v1, $v1, 0x7c0
/* 3888 80028488 00832025 */ or $a0, $a0, $v1
/* 388C 8002848C 00021082 */ srl $v0, $v0, 2
/* 3890 80028490 3042003E */ andi $v0, $v0, 0x3e
/* 3894 80028494 00822025 */ or $a0, $a0, $v0
/* 3898 80028498 34820001 */ ori $v0, $a0, 1
/* 389C 8002849C 00021400 */ sll $v0, $v0, 0x10
/* 38A0 800284A0 34420001 */ ori $v0, $v0, 1
/* 38A4 800284A4 3C038007 */ lui $v1, %hi(gGameStatusPtr)
/* 38A8 800284A8 8C63419C */ lw $v1, %lo(gGameStatusPtr)($v1)
/* 38AC 800284AC 00441025 */ or $v0, $v0, $a0
/* 38B0 800284B0 ACA20004 */ sw $v0, 4($a1)
/* 38B4 800284B4 8470014A */ lh $s0, 0x14a($v1)
/* 38B8 800284B8 8462014E */ lh $v0, 0x14e($v1)
/* 38BC 800284BC 8471014C */ lh $s1, 0x14c($v1)
/* 38C0 800284C0 0202A021 */ addu $s4, $s0, $v0
/* 38C4 800284C4 84620150 */ lh $v0, 0x150($v1)
/* 38C8 800284C8 8663000E */ lh $v1, 0xe($s3)
/* 38CC 800284CC 02229021 */ addu $s2, $s1, $v0
/* 38D0 800284D0 0203102A */ slt $v0, $s0, $v1
/* 38D4 800284D4 54400001 */ bnel $v0, $zero, .L800284DC
/* 38D8 800284D8 0060802D */ daddu $s0, $v1, $zero
.L800284DC:
/* 38DC 800284DC 86640010 */ lh $a0, 0x10($s3)
/* 38E0 800284E0 0224102A */ slt $v0, $s1, $a0
/* 38E4 800284E4 54400001 */ bnel $v0, $zero, .L800284EC
/* 38E8 800284E8 0080882D */ daddu $s1, $a0, $zero
.L800284EC:
/* 38EC 800284EC 8662000A */ lh $v0, 0xa($s3)
/* 38F0 800284F0 00621821 */ addu $v1, $v1, $v0
/* 38F4 800284F4 0074102A */ slt $v0, $v1, $s4
/* 38F8 800284F8 54400001 */ bnel $v0, $zero, .L80028500
/* 38FC 800284FC 0060A02D */ daddu $s4, $v1, $zero
.L80028500:
/* 3900 80028500 8662000C */ lh $v0, 0xc($s3)
/* 3904 80028504 00821821 */ addu $v1, $a0, $v0
/* 3908 80028508 0072102A */ slt $v0, $v1, $s2
/* 390C 8002850C 54400001 */ bnel $v0, $zero, .L80028514
/* 3910 80028510 0060902D */ daddu $s2, $v1, $zero
.L80028514:
/* 3914 80028514 06020001 */ bltzl $s0, .L8002851C
/* 3918 80028518 0000802D */ daddu $s0, $zero, $zero
.L8002851C:
/* 391C 8002851C 06220001 */ bltzl $s1, .L80028524
/* 3920 80028520 0000882D */ daddu $s1, $zero, $zero
.L80028524:
/* 3924 80028524 5A800001 */ blezl $s4, .L8002852C
/* 3928 80028528 24140001 */ addiu $s4, $zero, 1
.L8002852C:
/* 392C 8002852C 5A400001 */ blezl $s2, .L80028534
/* 3930 80028530 24120001 */ addiu $s2, $zero, 1
.L80028534:
/* 3934 80028534 2A020140 */ slti $v0, $s0, 0x140
/* 3938 80028538 50400001 */ beql $v0, $zero, .L80028540
/* 393C 8002853C 2410013F */ addiu $s0, $zero, 0x13f
.L80028540:
/* 3940 80028540 2A2200F0 */ slti $v0, $s1, 0xf0
/* 3944 80028544 50400001 */ beql $v0, $zero, .L8002854C
/* 3948 80028548 241100EF */ addiu $s1, $zero, 0xef
.L8002854C:
/* 394C 8002854C 2A820141 */ slti $v0, $s4, 0x141
/* 3950 80028550 50400001 */ beql $v0, $zero, .L80028558
/* 3954 80028554 24140140 */ addiu $s4, $zero, 0x140
.L80028558:
/* 3958 80028558 2A4200F1 */ slti $v0, $s2, 0xf1
/* 395C 8002855C 50400001 */ beql $v0, $zero, .L80028564
/* 3960 80028560 241200F0 */ addiu $s2, $zero, 0xf0
.L80028564:
/* 3964 80028564 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* 3968 80028568 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* 396C 8002856C 94420148 */ lhu $v0, 0x148($v0)
/* 3970 80028570 30420001 */ andi $v0, $v0, 1
/* 3974 80028574 14400017 */ bnez $v0, .L800285D4
/* 3978 80028578 3C04F600 */ lui $a0, 0xf600
/* 397C 8002857C 3C03800A */ lui $v1, %hi(gMasterGfxPos)
/* 3980 80028580 2463A66C */ addiu $v1, $v1, %lo(gMasterGfxPos)
/* 3984 80028584 8C620000 */ lw $v0, ($v1)
/* 3988 80028588 0040282D */ daddu $a1, $v0, $zero
/* 398C 8002858C 24420008 */ addiu $v0, $v0, 8
/* 3990 80028590 AC620000 */ sw $v0, ($v1)
/* 3994 80028594 2683FFFF */ addiu $v1, $s4, -1
/* 3998 80028598 306303FF */ andi $v1, $v1, 0x3ff
/* 399C 8002859C 00031B80 */ sll $v1, $v1, 0xe
/* 39A0 800285A0 2642FFFF */ addiu $v0, $s2, -1
/* 39A4 800285A4 304203FF */ andi $v0, $v0, 0x3ff
/* 39A8 800285A8 00021080 */ sll $v0, $v0, 2
/* 39AC 800285AC 00441025 */ or $v0, $v0, $a0
/* 39B0 800285B0 00621825 */ or $v1, $v1, $v0
/* 39B4 800285B4 ACA30000 */ sw $v1, ($a1)
/* 39B8 800285B8 320303FF */ andi $v1, $s0, 0x3ff
/* 39BC 800285BC 00031B80 */ sll $v1, $v1, 0xe
/* 39C0 800285C0 322203FF */ andi $v0, $s1, 0x3ff
/* 39C4 800285C4 00021080 */ sll $v0, $v0, 2
/* 39C8 800285C8 00621825 */ or $v1, $v1, $v0
/* 39CC 800285CC 0800A177 */ j .L800285DC
/* 39D0 800285D0 ACA30004 */ sw $v1, 4($a1)
.L800285D4:
/* 39D4 800285D4 0C0517B0 */ jal appendGfx_background_texture
/* 39D8 800285D8 00000000 */ nop
.L800285DC:
/* 39DC 800285DC 3C04E300 */ lui $a0, 0xe300
/* 39E0 800285E0 34840A01 */ ori $a0, $a0, 0xa01
/* 39E4 800285E4 3C05E200 */ lui $a1, 0xe200
/* 39E8 800285E8 34A5001C */ ori $a1, $a1, 0x1c
/* 39EC 800285EC 3C060001 */ lui $a2, 1
/* 39F0 800285F0 3C08800A */ lui $t0, %hi(gMasterGfxPos)
/* 39F4 800285F4 2508A66C */ addiu $t0, $t0, %lo(gMasterGfxPos)
/* 39F8 800285F8 34C60001 */ ori $a2, $a2, 1
/* 39FC 800285FC 8D070000 */ lw $a3, ($t0)
/* 3A00 80028600 3C03E700 */ lui $v1, 0xe700
/* 3A04 80028604 00E0102D */ daddu $v0, $a3, $zero
/* 3A08 80028608 24E70008 */ addiu $a3, $a3, 8
/* 3A0C 8002860C AD070000 */ sw $a3, ($t0)
/* 3A10 80028610 AC430000 */ sw $v1, ($v0)
/* 3A14 80028614 AC400004 */ sw $zero, 4($v0)
/* 3A18 80028618 24E20008 */ addiu $v0, $a3, 8
/* 3A1C 8002861C AD020000 */ sw $v0, ($t0)
/* 3A20 80028620 3C020030 */ lui $v0, 0x30
/* 3A24 80028624 ACE20004 */ sw $v0, 4($a3)
/* 3A28 80028628 24E20010 */ addiu $v0, $a3, 0x10
/* 3A2C 8002862C ACE40000 */ sw $a0, ($a3)
/* 3A30 80028630 AD020000 */ sw $v0, ($t0)
/* 3A34 80028634 24E20018 */ addiu $v0, $a3, 0x18
/* 3A38 80028638 ACE50008 */ sw $a1, 8($a3)
/* 3A3C 8002863C ACE0000C */ sw $zero, 0xc($a3)
/* 3A40 80028640 AD020000 */ sw $v0, ($t0)
/* 3A44 80028644 3C02F700 */ lui $v0, 0xf700
/* 3A48 80028648 ACE20010 */ sw $v0, 0x10($a3)
/* 3A4C 8002864C 24E20020 */ addiu $v0, $a3, 0x20
/* 3A50 80028650 ACE60014 */ sw $a2, 0x14($a3)
/* 3A54 80028654 AD020000 */ sw $v0, ($t0)
/* 3A58 80028658 ACE30018 */ sw $v1, 0x18($a3)
/* 3A5C 8002865C 1A20000F */ blez $s1, .L8002869C
/* 3A60 80028660 ACE0001C */ sw $zero, 0x1c($a3)
/* 3A64 80028664 3C03F64F */ lui $v1, 0xf64f
/* 3A68 80028668 3463C000 */ ori $v1, $v1, 0xc000
/* 3A6C 8002866C 24E20028 */ addiu $v0, $a3, 0x28
/* 3A70 80028670 AD020000 */ sw $v0, ($t0)
/* 3A74 80028674 2622FFFF */ addiu $v0, $s1, -1
/* 3A78 80028678 304203FF */ andi $v0, $v0, 0x3ff
/* 3A7C 8002867C 00021080 */ sll $v0, $v0, 2
/* 3A80 80028680 00431025 */ or $v0, $v0, $v1
/* 3A84 80028684 ACE20020 */ sw $v0, 0x20($a3)
/* 3A88 80028688 24E20030 */ addiu $v0, $a3, 0x30
/* 3A8C 8002868C ACE00024 */ sw $zero, 0x24($a3)
/* 3A90 80028690 AD020000 */ sw $v0, ($t0)
/* 3A94 80028694 ACE00028 */ sw $zero, 0x28($a3)
/* 3A98 80028698 ACE0002C */ sw $zero, 0x2c($a3)
.L8002869C:
/* 3A9C 8002869C 1A000015 */ blez $s0, .L800286F4
/* 3AA0 800286A0 2603FFFF */ addiu $v1, $s0, -1
/* 3AA4 800286A4 306303FF */ andi $v1, $v1, 0x3ff
/* 3AA8 800286A8 00031B80 */ sll $v1, $v1, 0xe
/* 3AAC 800286AC 2642FFFF */ addiu $v0, $s2, -1
/* 3AB0 800286B0 304203FF */ andi $v0, $v0, 0x3ff
/* 3AB4 800286B4 00021080 */ sll $v0, $v0, 2
/* 3AB8 800286B8 3C04F600 */ lui $a0, 0xf600
/* 3ABC 800286BC 00441025 */ or $v0, $v0, $a0
/* 3AC0 800286C0 00621825 */ or $v1, $v1, $v0
/* 3AC4 800286C4 322203FF */ andi $v0, $s1, 0x3ff
/* 3AC8 800286C8 8D050000 */ lw $a1, ($t0)
/* 3ACC 800286CC 00021080 */ sll $v0, $v0, 2
/* 3AD0 800286D0 00A0302D */ daddu $a2, $a1, $zero
/* 3AD4 800286D4 24A50008 */ addiu $a1, $a1, 8
/* 3AD8 800286D8 AD050000 */ sw $a1, ($t0)
/* 3ADC 800286DC ACC20004 */ sw $v0, 4($a2)
/* 3AE0 800286E0 24A20008 */ addiu $v0, $a1, 8
/* 3AE4 800286E4 ACC30000 */ sw $v1, ($a2)
/* 3AE8 800286E8 AD020000 */ sw $v0, ($t0)
/* 3AEC 800286EC ACA00000 */ sw $zero, ($a1)
/* 3AF0 800286F0 ACA00004 */ sw $zero, 4($a1)
.L800286F4:
/* 3AF4 800286F4 2A820140 */ slti $v0, $s4, 0x140
/* 3AF8 800286F8 10400015 */ beqz $v0, .L80028750
/* 3AFC 800286FC 3C03F64F */ lui $v1, 0xf64f
/* 3B00 80028700 3463C000 */ ori $v1, $v1, 0xc000
/* 3B04 80028704 2642FFFF */ addiu $v0, $s2, -1
/* 3B08 80028708 304203FF */ andi $v0, $v0, 0x3ff
/* 3B0C 8002870C 00021080 */ sll $v0, $v0, 2
/* 3B10 80028710 00431025 */ or $v0, $v0, $v1
/* 3B14 80028714 328303FF */ andi $v1, $s4, 0x3ff
/* 3B18 80028718 8D040000 */ lw $a0, ($t0)
/* 3B1C 8002871C 00031B80 */ sll $v1, $v1, 0xe
/* 3B20 80028720 0080282D */ daddu $a1, $a0, $zero
/* 3B24 80028724 24840008 */ addiu $a0, $a0, 8
/* 3B28 80028728 AD040000 */ sw $a0, ($t0)
/* 3B2C 8002872C ACA20000 */ sw $v0, ($a1)
/* 3B30 80028730 322203FF */ andi $v0, $s1, 0x3ff
/* 3B34 80028734 00021080 */ sll $v0, $v0, 2
/* 3B38 80028738 00621825 */ or $v1, $v1, $v0
/* 3B3C 8002873C 24820008 */ addiu $v0, $a0, 8
/* 3B40 80028740 ACA30004 */ sw $v1, 4($a1)
/* 3B44 80028744 AD020000 */ sw $v0, ($t0)
/* 3B48 80028748 AC800000 */ sw $zero, ($a0)
/* 3B4C 8002874C AC800004 */ sw $zero, 4($a0)
.L80028750:
/* 3B50 80028750 2A4200F0 */ slti $v0, $s2, 0xf0
/* 3B54 80028754 1040000E */ beqz $v0, .L80028790
/* 3B58 80028758 3C02F64F */ lui $v0, 0xf64f
/* 3B5C 8002875C 8D030000 */ lw $v1, ($t0)
/* 3B60 80028760 3442C3BC */ ori $v0, $v0, 0xc3bc
/* 3B64 80028764 0060202D */ daddu $a0, $v1, $zero
/* 3B68 80028768 24630008 */ addiu $v1, $v1, 8
/* 3B6C 8002876C AD030000 */ sw $v1, ($t0)
/* 3B70 80028770 AC820000 */ sw $v0, ($a0)
/* 3B74 80028774 324203FF */ andi $v0, $s2, 0x3ff
/* 3B78 80028778 00021080 */ sll $v0, $v0, 2
/* 3B7C 8002877C AC820004 */ sw $v0, 4($a0)
/* 3B80 80028780 24620008 */ addiu $v0, $v1, 8
/* 3B84 80028784 AD020000 */ sw $v0, ($t0)
/* 3B88 80028788 AC600000 */ sw $zero, ($v1)
/* 3B8C 8002878C AC600004 */ sw $zero, 4($v1)
.L80028790:
/* 3B90 80028790 3C03800A */ lui $v1, %hi(gMasterGfxPos)
/* 3B94 80028794 2463A66C */ addiu $v1, $v1, %lo(gMasterGfxPos)
/* 3B98 80028798 8C620000 */ lw $v0, ($v1)
/* 3B9C 8002879C 0040202D */ daddu $a0, $v0, $zero
/* 3BA0 800287A0 24420008 */ addiu $v0, $v0, 8
/* 3BA4 800287A4 AC620000 */ sw $v0, ($v1)
/* 3BA8 800287A8 3C02E700 */ lui $v0, 0xe700
/* 3BAC 800287AC AC820000 */ sw $v0, ($a0)
/* 3BB0 800287B0 AC800004 */ sw $zero, 4($a0)
.L800287B4:
/* 3BB4 800287B4 8FBF0044 */ lw $ra, 0x44($sp)
/* 3BB8 800287B8 8FBE0040 */ lw $fp, 0x40($sp)
/* 3BBC 800287BC 8FB7003C */ lw $s7, 0x3c($sp)
/* 3BC0 800287C0 8FB60038 */ lw $s6, 0x38($sp)
/* 3BC4 800287C4 8FB50034 */ lw $s5, 0x34($sp)
/* 3BC8 800287C8 8FB40030 */ lw $s4, 0x30($sp)
/* 3BCC 800287CC 8FB3002C */ lw $s3, 0x2c($sp)
/* 3BD0 800287D0 8FB20028 */ lw $s2, 0x28($sp)
/* 3BD4 800287D4 8FB10024 */ lw $s1, 0x24($sp)
/* 3BD8 800287D8 8FB00020 */ lw $s0, 0x20($sp)
/* 3BDC 800287DC 03E00008 */ jr $ra
/* 3BE0 800287E0 27BD0048 */ addiu $sp, $sp, 0x48
/* 3BE4 800287E4 00000000 */ nop
/* 3BE8 800287E8 00000000 */ nop
/* 3BEC 800287EC 00000000 */ nop

View File

@ -38,7 +38,6 @@ segments:
- type: code
start: 0x1000
vram: 0x80025C00
subalign: 4
subsegments:
- [0x1000, hasm, entry_point]
- [0x1060, c, 1060_len_310]
@ -263,7 +262,6 @@ segments:
- [0x52810, .data, camera]
- [0x52820, .data, game_modes]
- [0x52CA0, .data, state_battle]
- [0x52D08, .data, state_logos]
- [0x52D50, .data, state_pause]
- [0x52D80, .data, state_file_select]
- [0x52DC0, .data, state_title_screen]
@ -277,7 +275,6 @@ segments:
- [0x6EAC0, data] # has scripts
- [0x6F0E0, .data, os/nusys/nuContRmbMgr]
- [0x6F110, .data, os/nusys/nuGfxFuncSet]
- [0x6F114, .data, os/nusys/nuGfxPreNMIFuncSet]
- [0x6F120, .data, os/nuContMgr]
- [0x6F120, .data, os/osCreatePiManager]
- [0x6F180, .data, os/osCartRomInit]
@ -3443,7 +3440,7 @@ segments:
overlay: True
subsegments:
- [0x715850, c, mushroom] # TODO fix auto_all for .data
- [0x715E50, .data, mushroom]
- [0x715E50]
- name: fire_flower
dir: battle/item
type: code
@ -3452,19 +3449,22 @@ segments:
overlay: True
subsegments:
- [0x716C60, c, fire_flower]
- [0x717060, .data, fire_flower]
- dir: battle/item/dusty_hammer
- [0x717060]
- name: dusty_hammer
dir: battle/item
type: code
start: 0x7179D0
vram: 0x802A1000
overlay: True
subsegments:
- [0x7179D0, c, lib] # TODO consolidate into one file and add image to data
- [0x717C10, c, dusty_hammer] # DUMMY ROM
- [0x717C10, .data, lib]
- [0x7179D0, c, dusty_hammer]
- start: 0x717C10
type: .data
name: dusty_hammer
subsegments:
- [0x7181D0, ci4, dusty_hammer, 32, 32]
- [0x7183D0, palette, dusty_hammer]
- [0x7183F0, .data, dusty_hammer]
- [0x7183F0]
- name: pow_block
dir: battle/item
type: code
@ -3473,18 +3473,22 @@ segments:
overlay: True
subsegments:
- [0x718850, c, pow_block]
- [0x718BF0, .data, pow_block]
- dir: battle/item/pebble
- [0x718BF0]
- name: pebble
dir: battle/item
type: code
start: 0x719970
vram: 0x802A1000
overlay: True
subsegments:
- [0x719970, c, lib]
- [0x719BB0, .data, lib]
- [0x719970, c, pebble]
- start: 0x719BB0
type: .data
name: pebble
subsegments:
- [0x71A170, ci4, pebble, 32, 32]
- [0x71A370, palette, pebble]
- [0x71A390, .data, pebble]
- [0x71A390]
- name: volt_shroom
dir: battle/item
type: code
@ -3493,7 +3497,7 @@ segments:
overlay: True
subsegments:
- [0x71A7F0, c, volt_shroom]
- [0x71AA70, .data, volt_shroom]
- [0x71AA70]
- name: thunder_rage
dir: battle/item
type: code
@ -3502,7 +3506,7 @@ segments:
overlay: True
subsegments:
- [0x71B1A0, c, thunder_rage]
- [0x71B640, .data, thunder_rage]
- [0x71B640]
- name: snowman_doll
dir: battle/item
type: code
@ -3511,7 +3515,7 @@ segments:
overlay: True
subsegments:
- [0x71BE30, c, snowman_doll]
- [0x71C270, .data, snowman_doll]
- [0x71C270]
- name: dried_shroom
dir: battle/item
type: code
@ -3520,7 +3524,7 @@ segments:
overlay: True
subsegments:
- [0x71CCE0, c, dried_shroom]
- [0x71D010, .data, dried_shroom]
- [0x71D010]
- name: shooting_star
dir: battle/item
type: code
@ -3529,23 +3533,27 @@ segments:
overlay: True
subsegments:
- [0x71D770, c, shooting_star]
- [0x71DCC0, .data, shooting_star]
- dir: battle/item/sleepy_sheep
- [0x71DCC0]
- name: sleepy_sheep
dir: battle/item
type: code
start: 0x71E650
vram: 0x802A1000
overlay: True
subsegments:
- [0x71E650, c, lib]
- [0x71EFC0, .data, lib]
- [0x71E650, c, sleepy_sheep]
- start: 0x71EFC0
type: .data
name: sleepy_sheep
subsegments:
- [0x71EFC0, .data, sleepy_sheep]
- [0x71F580, ci4, sleepy_sheep1, 56, 48]
- [0x71FAC0, palette, sleepy_sheep1]
- [0x71FAE0, ci4, sleepy_sheep2, 56, 48]
- [0x720020, palette, sleepy_sheep2]
- [0x720040, ci4, sleepy_sheep3, 56, 48]
- [0x720580, palette, sleepy_sheep3]
- [0x7205A0, .data, sleepy_sheep]
- [0x7214D8, .rodata, lib]
- [0x7205A0]
- name: stone_cap
dir: battle/item
type: code
@ -3554,7 +3562,7 @@ segments:
overlay: True
subsegments:
- [0x7215A0, c, stone_cap]
- [0x721970, .data, stone_cap]
- [0x721970]
- name: tasty_tonic
dir: battle/item
type: code
@ -3563,7 +3571,7 @@ segments:
overlay: True
subsegments:
- [0x722000, c, tasty_tonic]
- [0x7222D0, .data, tasty_tonic]
- [0x7222D0]
- name: thunder_bolt
dir: battle/item
type: code
@ -3572,7 +3580,7 @@ segments:
overlay: True
subsegments:
- [0x722B40, c, thunder_bolt]
- [0x722FE0, .data, thunder_bolt]
- [0x722FE0]
- name: ultra_shroom
dir: battle/item
type: code
@ -3581,7 +3589,7 @@ segments:
overlay: True
subsegments:
- [0x723780, c, ultra_shroom]
- [0x723AB0, .data, ultra_shroom]
- [0x723AB0]
- name: unknown_item
dir: battle/item
type: code
@ -3590,7 +3598,7 @@ segments:
overlay: True
subsegments:
- [0x724240, c, unknown_item]
- [0x724570, .data, unknown_item]
- [0x724570]
- name: super_soda
dir: battle/item
type: code
@ -3599,7 +3607,7 @@ segments:
overlay: True
subsegments:
- [0x724CE0, c, super_soda]
- [0x725210, .data, super_soda]
- [0x725210]
- name: hustle_drink
dir: battle/item
type: code
@ -3608,7 +3616,7 @@ segments:
overlay: True
subsegments:
- [0x725F60, c, hustle_drink]
- [0x726240, .data, hustle_drink]
- [0x726240]
- name: stop_watch
dir: battle/item
type: code
@ -3617,7 +3625,7 @@ segments:
overlay: True
subsegments:
- [0x726DD0, c, stop_watch]
- [0x727120, .data, stop_watch]
- [0x727120]
- name: dizzy_dial
dir: battle/item
type: code
@ -3626,8 +3634,7 @@ segments:
overlay: True
subsegments:
- [0x727910, c, dizzy_dial]
- [0x727CE0, .data, dizzy_dial]
- [0x7285D0, .rodata, dizzy_dial]
- [0x727CE0]
- name: please_come_back
dir: battle/item
type: code
@ -3636,15 +3643,20 @@ segments:
overlay: True
subsegments:
- [0x7285E0, c, please_come_back]
- [0x728820, .data, please_come_back]
- dir: battle/item/egg_missile
- [0x728820]
- name: egg_missile
dir: battle/item
type: code
start: 0x728EC0
vram: 0x802A1000
overlay: True
subsegments:
- [0x728EC0, c, lib]
- [0x7291D0, .data, lib]
- [0x728EC0, c, egg_missile]
- start: 0x7291D0
type: .data
name: egg_missile
subsegments:
- [0x7291D0, .data, egg_missile]
- [0x729790, ci4, egg_missile1, 32, 32]
- [0x729990, palette, egg_missile1]
- [0x7299B0, ci4, egg_missile2, 32, 32]
@ -3653,18 +3665,22 @@ segments:
- [0x729DD0, palette, egg_missile3]
- [0x729DF0, ci4, egg_missile4, 32, 32]
- [0x729FF0, palette, egg_missile4]
- [0x72A010, .data, egg_missile]
- dir: battle/item/insecticide_herb
- [0x72A010]
- name: insecticide_herb
dir: battle/item
type: code
start: 0x72A750
vram: 0x802A1000
overlay: True
subsegments:
- [0x72A750, c, lib]
- [0x72AB70, .data, lib]
- [0x72A750, c, insecticide_herb]
- start: 0x72B130
type: .data
name: insecticide_herb
subsegments:
- [0x72B130, ci4, insecticide_herb, 32, 32]
- [0x72B330, palette, insecticide_herb]
- [0x72B350, .data, insecticide_herb]
- [0x72B350]
- name: fright_jar
dir: battle/item
type: code
@ -3673,19 +3689,23 @@ segments:
overlay: True
subsegments:
- [0x72B910, c, fright_jar]
- [0x72BC60, .data, fright_jar]
- dir: battle/item/mystery
- [0x72BC60]
- name: mystery
dir: battle/item
type: code
start: 0x72C5B0
vram: 0x802A1000
overlay: True
subsegments:
- [0x72C5B0, c, lib]
- [0x72CF00, .data, lib]
- [0x72C5B0, c, mystery]
- start: 0x72CF00
type: .data
name: mystery
subsegments:
- [0x72CF00, .data, mystery]
- [0x72D4C0, ci4, mystery, 32, 32]
- [0x72D6C0, palette, mystery]
- [0x72D6E0, .data, mystery]
- [0x72DB50, .rodata, lib]
- [0x72D6E0]
- name: repel_gel
dir: battle/item
type: code
@ -3694,7 +3714,7 @@ segments:
overlay: True
subsegments:
- [0x72DB70, c, repel_gel]
- [0x72DE00, .data, repel_gel]
- [0x72DE00]
- name: life_shroom
dir: battle/item
type: code
@ -3703,18 +3723,23 @@ segments:
overlay: True
subsegments:
- [0x72E530, c, life_shroom]
- [0x72EA20, .data, life_shroom]
- dir: battle/item/coconut
- [0x72EA20]
- name: coconut
dir: battle/item
type: code
start: 0x72F720
vram: 0x802A1000
overlay: True
subsegments:
- [0x72F720, c, lib]
- [0x72F960, .data, lib]
- [0x72F720, c, coconut]
- start: 0x72F960
type: .data
name: coconut
subsegments:
- [0x72F960, .data, coconut]
- [0x72FF20, ci4, coconut, 32, 32]
- [0x730120, palette, coconut]
- [0x730140, .data, coconut]
- [0x730140]
- name: electro_pop
dir: battle/item
type: code
@ -3723,23 +3748,27 @@ segments:
overlay: True
subsegments:
- [0x7305A0, c, electro_pop]
- [0x730AE0, .data, electro_pop]
- dir: battle/item/strange_cake
- [0x730AE0]
- name: strange_cake
dir: battle/item
type: code
start: 0x731300
vram: 0x802A1000
overlay: True
subsegments:
- [0x731300, c, lib]
- [0x731EA0, .data, lib]
- [0x731300, c, strange_cake]
- start: 0x731EA0
type: .data
name: strange_cake
subsegments:
- [0x731EA0, .data, strange_cake]
- [0x732470, ci4, strange_cake1, 32, 32]
- [0x732670, palette, strange_cake1]
- [0x732690, ci4, strange_cake2, 32, 32]
- [0x732890, palette, strange_cake2]
- [0x7328B0, ci4, strange_cake3, 32, 32]
- [0x732AB0, palette, strange_cake3]
- [0x732AD0, .data, strange_cake]
- [0x7330B0, .rodata, lib]
- [0x732AD0]
- name: food
dir: battle/item
type: code
@ -3748,7 +3777,7 @@ segments:
overlay: True
subsegments:
- [0x7330D0, c, food]
- [0x733700, .data, food]
- [0x733700]
- dir: battle/move/hammer
type: code
start: 0x7345A0
@ -4970,7 +4999,7 @@ segments:
subsegments:
- [0x929270, c]
- [0x9292B0, c]
- [0x9292D0, .data, "929270"]
- [0x9292D0, .data, 929270]
- [0x929A00, .data, 9292B0]
- [0x929A80]
- name: sbk_01
@ -8211,8 +8240,8 @@ segments:
- [0xC20C70]
# rodata seemingly in 3 different parts:
# dgb_00-18, 1x 32767.0, 2 jump tables
# "dgb_00", 2x 32767.0, jump table
# "dgb_08" only
# dgb_00, 2x 32767.0, jump table
# dgb_08 only
- type: code
start: 0xC20F40
vram: 0x80200000
@ -8882,7 +8911,6 @@ segments:
- [0xD07440, data]
- [0xD09570, data]
- [0xD09AD0, data]
#- [0xD0C294, data]
- [0xD10DA0, data]
- [0xD110A0]
- name: sam_03