Skip to content

Commit

Permalink
Remove gDecompressionBuffer from battle_main.c
Browse files Browse the repository at this point in the history
  • Loading branch information
DizzyEggg committed Jan 15, 2025
1 parent c46f854 commit c3ea79e
Showing 1 changed file with 0 additions and 67 deletions.
67 changes: 0 additions & 67 deletions src/battle_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,6 @@ static void HandleEndTurn_BattleLost(void);
static void HandleEndTurn_RanFromBattle(void);
static void HandleEndTurn_MonFled(void);
static void HandleEndTurn_FinishBattle(void);
static void SpriteCB_UnusedBattleInit(struct Sprite *sprite);
static void SpriteCB_UnusedBattleInit_Main(struct Sprite *sprite);
static u32 Crc32B (const u8 *data, u32 size);
static u32 GeneratePartyHash(const struct Trainer *trainer, u32 i);
static s32 Factorial(s32);
Expand Down Expand Up @@ -255,17 +253,6 @@ static const struct ScanlineEffectParams sIntroScanlineParams32Bit =
&REG_BG3HOFS, SCANLINE_EFFECT_DMACNT_32BIT, 1
};

const struct SpriteTemplate gUnusedBattleInitSprite =
{
.tileTag = 0,
.paletteTag = 0,
.oam = &gDummyOamData,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCB_UnusedBattleInit,
};

static const u8 sText_ShedinjaJpnName[] = _("ヌケニン"); // Nukenin

const struct OamData gOamData_BattleSpriteOpponentSide =
Expand Down Expand Up @@ -1788,60 +1775,6 @@ void CB2_QuitRecordedBattle(void)
}
}

#define sState data[0]
#define sDelay data[4]

static void SpriteCB_UnusedBattleInit(struct Sprite *sprite)
{
sprite->sState = 0;
sprite->callback = SpriteCB_UnusedBattleInit_Main;
}

static void SpriteCB_UnusedBattleInit_Main(struct Sprite *sprite)
{
u16 *arr = (u16 *)gDecompressionBuffer;

switch (sprite->sState)
{
case 0:
sprite->sState++;
sprite->data[1] = 0;
sprite->data[2] = 0x281;
sprite->data[3] = 0;
sprite->sDelay = 1;
// fall through
case 1:
sprite->sDelay--;
if (sprite->sDelay == 0)
{
s32 i;
s32 r2;
s32 r0;

sprite->sDelay = 2;
r2 = sprite->data[1] + sprite->data[3] * 32;
r0 = sprite->data[2] - sprite->data[3] * 32;
for (i = 0; i < 29; i += 2)
{
arr[r2 + i] = 0x3D;
arr[r0 + i] = 0x3D;
}
sprite->data[3]++;
if (sprite->data[3] == 21)
{
sprite->sState++;
sprite->data[1] = 32;
}
}
break;
case 2:
sprite->data[1]--;
if (sprite->data[1] == 20)
SetMainCallback2(CB2_InitBattle);
break;
}
}

static u32 Crc32B (const u8 *data, u32 size)
{
s32 i, j;
Expand Down

0 comments on commit c3ea79e

Please sign in to comment.