pokeemerald/src/unk_pokedex_area_screen_helper.c

69 lines
2.1 KiB
C
Raw Normal View History

2018-08-15 06:56:11 +02:00
#include "global.h"
#include "main.h"
#include "menu.h"
#include "bg.h"
#include "malloc.h"
2018-08-15 06:56:11 +02:00
#include "palette.h"
2018-11-30 17:41:03 +01:00
#include "unk_pokedex_area_screen_helper.h"
2018-08-15 06:56:11 +02:00
EWRAM_DATA u8 *gUnknown_0203CF28 = NULL;
static const u16 gUnknown_0861D140[] = INCBIN_U16("graphics/interface/region_map.gbapal");
2018-10-21 09:24:57 +02:00
static const u32 gUnknown_0861D1A0[] = INCBIN_U32("graphics/interface/region_map.8bpp.lz");
static const u32 gUnknown_0861DEF4[] = INCBIN_U32("graphics/interface/region_map.bin.lz");
static const u32 gUnknown_0861E208[] = INCBIN_U32("graphics/interface/region_map_affine.8bpp.lz");
static const u32 gUnknown_0861EF64[] = INCBIN_U32("graphics/interface/region_map_affine.bin.lz");
2018-08-15 06:56:11 +02:00
2018-11-30 17:41:03 +01:00
void sub_81C4D70(const struct UnkStruct_1C4D70 *template)
2018-08-15 06:56:11 +02:00
{
u8 unk;
gUnknown_0203CF28 = Alloc(4);
unk = template->unk10;
if (unk == 0)
{
2018-12-26 13:05:02 +01:00
SetBgAttribute(template->bg, BG_ATTR_METRIC, 0);
2018-08-15 06:56:11 +02:00
decompress_and_copy_tile_data_to_vram(template->bg, gUnknown_0861D1A0, 0, template->unk2, unk);
sub_8199D3C(decompress_and_copy_tile_data_to_vram(template->bg, gUnknown_0861DEF4, 0, 0, 1), template->unk2, 32, 32, unk);
}
else
{
2018-12-26 13:05:02 +01:00
SetBgAttribute(template->bg, BG_ATTR_METRIC, 2);
SetBgAttribute(template->bg, BG_ATTR_TYPE, 1);
2018-08-15 06:56:11 +02:00
decompress_and_copy_tile_data_to_vram(template->bg, gUnknown_0861E208, 0, template->unk2, 0);
sub_8199D3C(decompress_and_copy_tile_data_to_vram(template->bg, gUnknown_0861EF64, 0, 0, 1), template->unk2, 64, 64, 1);
}
ChangeBgX(template->bg, 0, 0);
ChangeBgY(template->bg, 0, 0);
2018-12-26 13:05:02 +01:00
SetBgAttribute(template->bg, BG_ATTR_PALETTEMODE, 1);
2018-08-15 06:56:11 +02:00
CpuCopy32(gUnknown_0861D140, &gPlttBufferUnfaded[0x70], 0x60);
*gUnknown_0203CF28 = template->bg;
}
bool32 sub_81C4E90(void)
{
if (!free_temp_tile_data_buffers_if_possible())
{
ShowBg(*gUnknown_0203CF28);
return FALSE;
}
else
{
return TRUE;
}
}
void sub_81C4EB4(void)
{
if (gUnknown_0203CF28 != NULL)
{
FREE_AND_SET_NULL(gUnknown_0203CF28);
}
}
void sub_81C4ED0(u32 a0)
{
ChangeBgY(*gUnknown_0203CF28, a0 * 0x100, 0);
}