Fix not enough memory being allocated when moves load background in contests (#8284)
This commit is contained in:
parent
0999ca8ff9
commit
9b16204705
@ -13,6 +13,7 @@
|
||||
#include "graphics.h"
|
||||
#include "main.h"
|
||||
#include "malloc.h"
|
||||
#include "menu.h"
|
||||
#include "m4a.h"
|
||||
#include "palette.h"
|
||||
#include "pokemon.h"
|
||||
@ -1568,10 +1569,7 @@ void LoadMoveBg(u16 bgId)
|
||||
{
|
||||
if (IsContest())
|
||||
{
|
||||
void *decompressionBuffer = Alloc(0x800);
|
||||
const u32 *tilemap = gBattleAnimBackgroundTable[bgId].tilemap;
|
||||
|
||||
DecompressDataWithHeaderWram(tilemap, decompressionBuffer);
|
||||
void *decompressionBuffer = malloc_and_decompress(gBattleAnimBackgroundTable[bgId].tilemap, NULL);
|
||||
RelocateBattleBgPal(GetBattleBgPaletteNum(), decompressionBuffer, 0x100, FALSE);
|
||||
DmaCopy32(3, decompressionBuffer, (void *)BG_SCREEN_ADDR(26), 0x800);
|
||||
DecompressDataWithHeaderVram(gBattleAnimBackgroundTable[bgId].image, (void *)BG_SCREEN_ADDR(4));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user