#include "global.h" #include "decompress.h" #include "palette.h" #include "graphics.h" #include "text.h" #include "menu.h" #include "battle.h" #include "contest.h" #include "link.h" #define ABS(x) ((x) < 0 ? -(x) : (x)) void sub_80C37E4(void); u8 sub_80C3990(u8 a0, u8 a5); s8 sub_80C39E4(u8 a0, u8 a5); void sub_80C2020(void) { REG_DISPCNT = DISPCNT_OBJ_1D_MAP; Text_LoadWindowTemplate(&gWindowTemplate_81E6FA0); Text_InitWindowWithTemplate(&gMenuWindow, &gWindowTemplate_81E6FA0); REG_BG0CNT = BGCNT_WRAP | BGCNT_SCREENBASE(30); REG_BG1CNT = BGCNT_PRIORITY(3) | BGCNT_SCREENBASE(24); REG_BG2CNT = BGCNT_PRIORITY(3) | BGCNT_SCREENBASE(28); REG_BG3CNT = BGCNT_WRAP | BGCNT_PRIORITY(3) | BGCNT_SCREENBASE(26); REG_MOSAIC = 0; REG_WININ = 0x3f3f; REG_WINOUT = 0x3f2e; REG_WIN0H = 0; REG_WIN0V = 0; REG_WIN1H = 0; REG_WIN1V = 0; REG_BLDCNT = 0; REG_BLDALPHA = 0; REG_BLDY = 0; REG_BG0HOFS = 0; REG_BG0VOFS = 0; REG_BG1HOFS = 0; REG_BG1VOFS = 0; REG_BG2HOFS = 0; REG_BG2VOFS = 0; REG_BG3HOFS = 0; REG_BG3VOFS = 0; REG_DISPCNT |= DISPCNT_BG_ALL_ON | DISPCNT_OBJ_ON | DISPCNT_WIN0_ON | DISPCNT_WIN1_ON; gBattle_BG0_X = 0; gBattle_BG0_Y = 0; gBattle_BG1_X = 0; gBattle_BG1_Y = 0; gBattle_BG2_X = 0; gBattle_BG2_Y = 0; gBattle_BG3_X = 0; gBattle_BG3_Y = 0; gBattle_WIN0H = 0; gBattle_WIN0V = 0; gBattle_WIN1H = 0; gBattle_WIN1V = 0; } void sub_80C2144(void) { int i; int j; s8 r7; s8 r4; u16 r6; u16 r3; DmaFill32Large(3, 0, VRAM, VRAM_SIZE, 0x1000); LZDecompressVram(gUnknown_08D1977C, BG_SCREEN_ADDR(0)); LZDecompressVram(gUnknown_08D1A490, BG_SCREEN_ADDR(26)); LZDecompressVram(gUnknown_08D1A364, BG_SCREEN_ADDR(28)); LZDecompressVram(gUnknown_08D1A250, BG_SCREEN_ADDR(30)); sub_80C37E4(); LoadCompressedPalette(gUnknown_08D1A618, 0, 0x200); LoadFontDefaultPalette(&gWindowTemplate_81E6FA0); for (i = 0; i < 4; i++) { r7 = sub_80C3990(i, 1); r4 = sub_80C39E4(i, 1); for (j = 0; j < 10; j++) { r6 = 0x60b2; if (j < r7) r6 = 0x60b4; if (j < ABS(r4)) { r3 = 0x60a4; if (r4 < 0) r3 = 0x60a6; } else r3 = 0x60a2; ((u16 *)BG_VRAM)[i * 0x60 + j + 0x60b3] = r6; ((u16 *)BG_VRAM)[i * 0x60 + j + 0x60d3] = r3; } } }