pokeemerald/src/berry_fix_graphics.c

50 lines
1.3 KiB
C
Raw Normal View History

2017-11-24 03:04:15 +01:00
#include "global.h"
2017-11-24 03:15:57 +01:00
#include "graphics.h"
2017-11-24 03:04:15 +01:00
2020-02-07 23:12:27 +01:00
// Duplicate of sBerryFixGraphics in berry_fix_program.c
static const struct {
2018-10-21 09:24:57 +02:00
const u32 *gfx;
2020-02-07 23:12:27 +01:00
const u32 *tilemap;
2017-11-24 03:15:57 +01:00
const u16 *pltt;
2020-02-07 23:12:27 +01:00
} sBerryFixGraphics[] = {
2017-11-24 03:15:57 +01:00
{
2017-12-30 07:09:06 +01:00
gBerryFixGameboy_Gfx,
gBerryFixGameboy_Tilemap,
gBerryFixGameboy_Pal
2017-11-24 03:15:57 +01:00
}, {
2017-12-30 07:09:06 +01:00
gBerryFixGameboyLogo_Gfx,
gBerryFixGameboyLogo_Tilemap,
gBerryFixGameboyLogo_Pal
2017-11-24 03:15:57 +01:00
}, {
2017-12-30 07:09:06 +01:00
gBerryFixGbaTransfer_Gfx,
gBerryFixGbaTransfer_Tilemap,
gBerryFixGbaTransfer_Pal
2017-11-24 03:15:57 +01:00
}, {
2017-12-30 07:09:06 +01:00
gBerryFixGbaTransferHighlight_Gfx,
gBerryFixGbaTransferHighlight_Tilemap,
gBerryFixGbaTransferHighlight_Pal
2017-11-24 03:15:57 +01:00
}, {
2017-12-30 07:09:06 +01:00
gBerryFixGbaTransferError_Gfx,
gBerryFixGbaTransferError_Tilemap,
gBerryFixGbaTransferError_Pal
2017-11-24 03:15:57 +01:00
}, {
2017-12-30 07:09:06 +01:00
gBerryFixWindow_Gfx,
gBerryFixWindow_Tilemap,
gBerryFixWindow_Pal
2017-11-24 03:15:57 +01:00
}
};
2017-11-24 03:04:15 +01:00
2020-02-07 23:12:27 +01:00
// Unused. See berry_fix_program.c
static void LoadBerryFixGraphics(u32 idx)
2017-11-24 03:04:15 +01:00
{
2020-02-07 23:12:27 +01:00
REG_DISPCNT = 0;
REG_BG0HOFS = 0;
REG_BG0VOFS = 0;
REG_BLDCNT = 0;
LZ77UnCompVram(sBerryFixGraphics[idx].gfx, (void *)BG_CHAR_ADDR(0));
LZ77UnCompVram(sBerryFixGraphics[idx].tilemap, (void *)BG_SCREEN_ADDR(31));
CpuCopy16(sBerryFixGraphics[idx].pltt, (void *)PLTT, 0x200);
2017-11-24 03:04:15 +01:00
REG_BG0CNT = 0x1f00;
REG_DISPCNT = DISPCNT_BG0_ON;
}