From 01e6fb6dd0e4880b3ebac3c9a5287daf6c60fba3 Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Wed, 6 Nov 2019 18:18:11 -0600 Subject: [PATCH] Document some battle_bg-related things --- .../text.pal | 0 include/battle_bg.h | 4 +- include/battle_message.h | 2 +- include/graphics.h | 4 +- src/battle_bg.c | 123 +++++++++--------- src/battle_dome.c | 4 +- src/battle_main.c | 14 +- src/battle_script_commands.c | 2 +- src/evolution_scene.c | 4 +- src/graphics.c | 4 +- 10 files changed, 79 insertions(+), 82 deletions(-) rename graphics/{battle_frontier => battle_interface}/text.pal (100%) mode change 100644 => 100755 diff --git a/graphics/battle_frontier/text.pal b/graphics/battle_interface/text.pal old mode 100644 new mode 100755 similarity index 100% rename from graphics/battle_frontier/text.pal rename to graphics/battle_interface/text.pal diff --git a/include/battle_bg.h b/include/battle_bg.h index dac41c992..167ea5cf7 100644 --- a/include/battle_bg.h +++ b/include/battle_bg.h @@ -2,11 +2,11 @@ #define GUARD_BATTLE_BG_H void BattleInitBgsAndWindows(void); -void sub_80356D0(void); +void InitBattleBgsVideo(void); void LoadBattleMenuWindowGfx(void); void DrawMainBattleBackground(void); void LoadBattleTextboxAndBackground(void); -void sub_8035D74(u8 taskId); +void InitLinkBattleVsScreen(u8 taskId); void DrawBattleEntryBackground(void); bool8 LoadChosenBattleElement(u8 caseId); diff --git a/include/battle_message.h b/include/battle_message.h index 88ccbb90f..1157fbfae 100644 --- a/include/battle_message.h +++ b/include/battle_message.h @@ -213,7 +213,7 @@ struct BattleMsgData void BufferStringBattle(u16 stringID); u32 BattleStringExpandPlaceholdersToDisplayedString(const u8* src); u32 BattleStringExpandPlaceholders(const u8* src, u8* dst); -void BattlePutTextOnWindow(const u8* text, u8 arg1); +void BattlePutTextOnWindow(const u8* text, u8 windowId); void SetPpNumbersPaletteInMoveSelection(void); u8 GetCurrentPpToMaxPpState(u8 currentPp, u8 maxPp); diff --git a/include/graphics.h b/include/graphics.h index 37dd77e89..831b202f8 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -3208,7 +3208,7 @@ extern const u32 gBattleTextboxTiles[]; extern const u32 gBattleTextboxTilemap[]; extern const u32 gBattleTextboxPalette[]; extern const u32 gUnknown_08D778F0[]; -extern const u32 gUnknown_08D77B0C[]; +extern const u32 gVsLettersGfx[]; extern const u32 gUnknown_08D77AE4[]; extern const u32 gUnknown_08D779D8[]; extern const u32 gUnknown_08D857A8[]; @@ -4122,7 +4122,7 @@ extern const u32 gUnknown_08D84970[]; extern const u32 gUnknown_08D84F00[]; extern const u32 gUnknown_08D85444[]; extern const u32 gUnknown_08D85358[]; -extern const u32 gUnknown_08D85600[]; +extern const u32 gBattleWindowTextPalette[]; extern const u32 gUnknown_08D854C8[]; extern const u32 gUnknown_08D82F10[]; extern const u32 gUnknown_08D834FC[]; diff --git a/src/battle_bg.c b/src/battle_bg.c index a08873857..567625a99 100644 --- a/src/battle_bg.c +++ b/src/battle_bg.c @@ -36,7 +36,7 @@ struct BattleBackground // .rodata static const u16 sUnrefArray[] = {0x0300, 0x0000}; //OamData? -static const struct OamData gUnknown_0831A988 = +static const struct OamData sVsLetter_V_OamData = { .y = 0, .affineMode = 3, @@ -53,7 +53,7 @@ static const struct OamData gUnknown_0831A988 = .affineParam = 0, }; -static const struct OamData gUnknown_0831A990 = +static const struct OamData sVsLetter_S_OamData = { .y = 0, .affineMode = 3, @@ -70,13 +70,13 @@ static const struct OamData gUnknown_0831A990 = .affineParam = 0, }; -static const union AffineAnimCmd gUnknown_0831A998[] = +static const union AffineAnimCmd sVsLetterAffineAnimCmds0[] = { AFFINEANIMCMD_FRAME(0x0080, 0x0080, 0x00, 0x00), AFFINEANIMCMD_END, }; -static const union AffineAnimCmd gUnknown_0831A9A8[] = +static const union AffineAnimCmd sVsLetterAffineAnimCmds1[] = { AFFINEANIMCMD_FRAME(0x0080, 0x0080, 0x00, 0x00), AFFINEANIMCMD_FRAME(0x0018, 0x0018, 0x00, 0x80), @@ -84,37 +84,39 @@ static const union AffineAnimCmd gUnknown_0831A9A8[] = AFFINEANIMCMD_END, }; -static const union AffineAnimCmd * const gUnknown_0831A9C8[] = +static const union AffineAnimCmd *const sVsLetterAffineAnimTable[] = { - gUnknown_0831A998, - gUnknown_0831A9A8, + sVsLetterAffineAnimCmds0, + sVsLetterAffineAnimCmds1, }; -static const struct SpriteTemplate gUnknown_0831A9D0 = +#define TAG_VS_LETTERS 10000 + +static const struct SpriteTemplate sVsLetter_V_SpriteTemplate = { - .tileTag = 0x2710, - .paletteTag = 0x2710, - .oam = &gUnknown_0831A988, + .tileTag = TAG_VS_LETTERS, + .paletteTag = TAG_VS_LETTERS, + .oam = &sVsLetter_V_OamData, .anims = gDummySpriteAnimTable, .images = NULL, - .affineAnims = gUnknown_0831A9C8, + .affineAnims = sVsLetterAffineAnimTable, .callback = nullsub_17 }; -static const struct SpriteTemplate gUnknown_0831A9E8 = +static const struct SpriteTemplate sVsLetter_S_SpriteTemplate = { - .tileTag = 0x2710, - .paletteTag = 0x2710, - .oam = &gUnknown_0831A990, + .tileTag = TAG_VS_LETTERS, + .paletteTag = TAG_VS_LETTERS, + .oam = &sVsLetter_S_OamData, .anims = gDummySpriteAnimTable, .images = NULL, - .affineAnims = gUnknown_0831A9C8, + .affineAnims = sVsLetterAffineAnimTable, .callback = nullsub_17 }; -static const struct CompressedSpriteSheet gUnknown_0831AA00 = +static const struct CompressedSpriteSheet sVsLettersSpriteSheet = { - gUnknown_08D77B0C, 0x1000, 0x2710 + gVsLettersGfx, 0x1000, TAG_VS_LETTERS }; const struct BgTemplate gBattleBgTemplates[] = @@ -689,7 +691,6 @@ static const struct BattleBackground gBattleTerrainTable[] = }, }; -// .text void BattleInitBgsAndWindows(void) { ResetBgsAndClearDma3BusyFlags(0); @@ -710,7 +711,7 @@ void BattleInitBgsAndWindows(void) DeactivateAllTextPrinters(); } -void sub_80356D0(void) +void InitBattleBgsVideo(void) { DisableInterrupts(INTR_FLAG_HBLANK); EnableInterrupts(INTR_FLAG_VBLANK | INTR_FLAG_VCOUNT | INTR_FLAG_TIMER3 | INTR_FLAG_SERIAL); @@ -725,10 +726,11 @@ void LoadBattleMenuWindowGfx(void) { LoadUserWindowBorderGfx(2, 0x12, 0x10); LoadUserWindowBorderGfx(2, 0x22, 0x10); - LoadCompressedPalette(gUnknown_08D85600, 0x50, 0x20); + LoadCompressedPalette(gBattleWindowTextPalette, 0x50, 0x20); if (gBattleTypeFlags & BATTLE_TYPE_ARENA) { + // Load graphics for the Battle Arena referee's mid-battle messages. Menu_LoadStdPalAt(0x70); LoadMessageBoxGfx(0, 0x30, 0x70); gPlttBufferUnfaded[0x76] = 0; @@ -837,86 +839,81 @@ void DrawMainBattleBackground(void) void LoadBattleTextboxAndBackground(void) { - LZDecompressVram(gBattleTextboxTiles, (void*)(VRAM)); + LZDecompressVram(gBattleTextboxTiles, (void*)(BG_CHAR_ADDR(0))); CopyToBgTilemapBuffer(0, gBattleTextboxTilemap, 0, 0); CopyBgTilemapBufferToVram(0); LoadCompressedPalette(gBattleTextboxPalette, 0, 0x40); LoadBattleMenuWindowGfx(); - DrawMainBattleBackground(); } -static void sub_8035AE4(u8 taskId, u8 battlerId, u8 bgId, u8 destX, u8 destY) +static void DrawLinkBattleParticipantPokeballs(u8 taskId, u8 multiplayerId, u8 bgId, u8 destX, u8 destY) { s32 i; - u16 var = 0; - u16 src[6]; + u16 pokeballStatuses = 0; + u16 tiles[6]; if (gBattleTypeFlags & BATTLE_TYPE_MULTI) { if (gTasks[taskId].data[5] != 0) { - switch (battlerId) + switch (multiplayerId) { case 0: - var = 0x3F & gTasks[taskId].data[3]; + pokeballStatuses = 0x3F & gTasks[taskId].data[3]; break; case 1: - var = (0xFC0 & gTasks[taskId].data[4]) >> 6; + pokeballStatuses = (0xFC0 & gTasks[taskId].data[4]) >> 6; break; case 2: - var = (0xFC0 & gTasks[taskId].data[3]) >> 6; + pokeballStatuses = (0xFC0 & gTasks[taskId].data[3]) >> 6; break; case 3: - var = 0x3F & gTasks[taskId].data[4]; + pokeballStatuses = 0x3F & gTasks[taskId].data[4]; break; } } else { - switch (battlerId) + switch (multiplayerId) { case 0: - var = 0x3F & gTasks[taskId].data[3]; + pokeballStatuses = 0x3F & gTasks[taskId].data[3]; break; case 1: - var = 0x3F & gTasks[taskId].data[4]; + pokeballStatuses = 0x3F & gTasks[taskId].data[4]; break; case 2: - var = (0xFC0 & gTasks[taskId].data[3]) >> 6; + pokeballStatuses = (0xFC0 & gTasks[taskId].data[3]) >> 6; break; case 3: - var = (0xFC0 & gTasks[taskId].data[4]) >> 6; + pokeballStatuses = (0xFC0 & gTasks[taskId].data[4]) >> 6; break; } } for (i = 0; i < 3; i++) - { - src[i] = ((var & (3 << (i * 2))) >> (i * 2)) + 0x6001; - } + tiles[i] = ((pokeballStatuses & (3 << (i * 2))) >> (i * 2)) + 0x6001; - CopyToBgTilemapBufferRect_ChangePalette(bgId, src, destX, destY, 3, 1, 0x11); + CopyToBgTilemapBufferRect_ChangePalette(bgId, tiles, destX, destY, 3, 1, 0x11); CopyBgTilemapBufferToVram(bgId); } else { - if (battlerId == gBattleScripting.multiplayerId) - var = gTasks[taskId].data[3]; + if (multiplayerId == gBattleScripting.multiplayerId) + pokeballStatuses = gTasks[taskId].data[3]; else - var = gTasks[taskId].data[4]; + pokeballStatuses = gTasks[taskId].data[4]; for (i = 0; i < 6; i++) - { - src[i] = ((var & (3 << (i * 2))) >> (i * 2)) + 0x6001; - } + tiles[i] = ((pokeballStatuses & (3 << (i * 2))) >> (i * 2)) + 0x6001; - CopyToBgTilemapBufferRect_ChangePalette(bgId, src, destX, destY, 6, 1, 0x11); + CopyToBgTilemapBufferRect_ChangePalette(bgId, tiles, destX, destY, 6, 1, 0x11); CopyBgTilemapBufferToVram(bgId); } } -static void sub_8035C4C(void) +static void DrawLinkBattleVsScreenOutcomeText(void) { if (gBattleOutcome == B_OUTCOME_DREW) { @@ -997,7 +994,7 @@ static void sub_8035C4C(void) } } -void sub_8035D74(u8 taskId) +void InitLinkBattleVsScreen(u8 taskId) { struct LinkPlayer *linkPlayer; u8 *name; @@ -1017,19 +1014,19 @@ void sub_8035D74(u8 taskId) { case 0: BattlePutTextOnWindow(name, 0x11); - sub_8035AE4(taskId, linkPlayer->id, 1, 2, 4); + DrawLinkBattleParticipantPokeballs(taskId, linkPlayer->id, 1, 2, 4); break; case 1: BattlePutTextOnWindow(name, 0x12); - sub_8035AE4(taskId, linkPlayer->id, 2, 2, 4); + DrawLinkBattleParticipantPokeballs(taskId, linkPlayer->id, 2, 2, 4); break; case 2: BattlePutTextOnWindow(name, 0x13); - sub_8035AE4(taskId, linkPlayer->id, 1, 2, 8); + DrawLinkBattleParticipantPokeballs(taskId, linkPlayer->id, 1, 2, 8); break; case 3: BattlePutTextOnWindow(name, 0x14); - sub_8035AE4(taskId, linkPlayer->id, 2, 2, 8); + DrawLinkBattleParticipantPokeballs(taskId, linkPlayer->id, 2, 2, 8); break; } } @@ -1049,16 +1046,16 @@ void sub_8035D74(u8 taskId) name = gLinkPlayers[opponentId].name; BattlePutTextOnWindow(name, 0x10); - sub_8035AE4(taskId, playerId, 1, 2, 7); - sub_8035AE4(taskId, opponentId, 2, 2, 7); + DrawLinkBattleParticipantPokeballs(taskId, playerId, 1, 2, 7); + DrawLinkBattleParticipantPokeballs(taskId, opponentId, 2, 2, 7); } gTasks[taskId].data[0]++; break; case 1: - palId = AllocSpritePalette(0x2710); + palId = AllocSpritePalette(TAG_VS_LETTERS); gPlttBufferUnfaded[palId * 16 + 0x10F] = gPlttBufferFaded[palId * 16 + 0x10F] = 0x7FFF; - gBattleStruct->linkBattleVsSpriteId_V = CreateSprite(&gUnknown_0831A9D0, 111, 80, 0); - gBattleStruct->linkBattleVsSpriteId_S = CreateSprite(&gUnknown_0831A9E8, 129, 80, 0); + gBattleStruct->linkBattleVsSpriteId_V = CreateSprite(&sVsLetter_V_SpriteTemplate, 111, 80, 0); + gBattleStruct->linkBattleVsSpriteId_S = CreateSprite(&sVsLetter_S_SpriteTemplate, 129, 80, 0); gSprites[gBattleStruct->linkBattleVsSpriteId_V].invisible = TRUE; gSprites[gBattleStruct->linkBattleVsSpriteId_S].invisible = TRUE; gTasks[taskId].data[0]++; @@ -1087,7 +1084,7 @@ void sub_8035D74(u8 taskId) else { if (gTasks[taskId].data[5] != 0) - sub_8035C4C(); + DrawLinkBattleVsScreenOutcomeText(); PlaySE(SE_W231); DestroyTask(taskId); @@ -1110,7 +1107,7 @@ void DrawBattleEntryBackground(void) if (gBattleTypeFlags & BATTLE_TYPE_LINK) { LZDecompressVram(gUnknown_08D778F0, (void*)(BG_CHAR_ADDR(1))); - LZDecompressVram(gUnknown_08D77B0C, (void*)(VRAM + 0x10000)); + LZDecompressVram(gVsLettersGfx, (void*)(VRAM + 0x10000)); LoadCompressedPalette(gUnknown_08D77AE4, 0x60, 0x20); SetBgAttribute(1, BG_ATTR_SCREENSIZE, 1); SetGpuReg(REG_OFFSET_BG1CNT, 0x5C04); @@ -1122,7 +1119,7 @@ void DrawBattleEntryBackground(void) SetGpuReg(REG_OFFSET_WINOUT, 0x36); gBattle_BG1_Y = 0xFF5C; gBattle_BG2_Y = 0xFF5C; - LoadCompressedSpriteSheetUsingHeap(&gUnknown_0831AA00); + LoadCompressedSpriteSheetUsingHeap(&sVsLettersSpriteSheet); } else if (gBattleTypeFlags & (BATTLE_TYPE_FRONTIER | BATTLE_TYPE_LINK | BATTLE_TYPE_x2000000 | BATTLE_TYPE_EREADER_TRAINER)) { @@ -1195,7 +1192,7 @@ bool8 LoadChosenBattleElement(u8 caseId) switch (caseId) { case 0: - LZDecompressVram(gBattleTextboxTiles, (void*)(VRAM)); + LZDecompressVram(gBattleTextboxTiles, (void*)(BG_CHAR_ADDR(0))); break; case 1: CopyToBgTilemapBuffer(0, gBattleTextboxTilemap, 0, 0); diff --git a/src/battle_dome.c b/src/battle_dome.c index a7d7a92f1..9c63bba42 100644 --- a/src/battle_dome.c +++ b/src/battle_dome.c @@ -3414,7 +3414,7 @@ static void Task_ShowOpponentInfo(u8 taskId) LoadCompressedSpriteSheet(sDomeOptionsSpriteSheet); LoadCompressedPalette(gUnknown_08D85358, 0, 0x200); LoadCompressedPalette(gUnknown_08D85444, 0x100, 0x200); - LoadCompressedPalette(gUnknown_08D85600, 0xF0, 0x20); + LoadCompressedPalette(gBattleWindowTextPalette, 0xF0, 0x20); if (r9 == 2) LoadCompressedPalette(gUnknown_08D854C8, 0x50, 0x20); CpuFill32(0, gPlttBufferFaded, 0x400); @@ -5574,7 +5574,7 @@ static void Task_ShowTourneyTree(u8 taskId) DecompressAndLoadBgGfxUsingHeap(3, gUnknown_08D83C3C, 0x2000, 0, 1); LoadCompressedPalette(gUnknown_08D85358, 0, 0x200); LoadCompressedPalette(gUnknown_08D85444, 0x100, 0x200); - LoadCompressedPalette(gUnknown_08D85600, 0xF0, 0x20); + LoadCompressedPalette(gBattleWindowTextPalette, 0xF0, 0x20); CpuFill32(0, gPlttBufferFaded, 0x400); ShowBg(0); ShowBg(1); diff --git a/src/battle_main.c b/src/battle_main.c index ab8c73ed4..196053ad2 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -687,7 +687,7 @@ static void CB2_InitBattleInternal(void) if (gBattleTypeFlags & BATTLE_TYPE_RECORDED) gBattleTerrain = BATTLE_TERRAIN_BUILDING; - sub_80356D0(); + InitBattleBgsVideo(); LoadBattleTextboxAndBackground(); ResetSpriteData(); ResetTasks(); @@ -1024,7 +1024,7 @@ static void CB2_HandleStartBattle(void) ResetBlockReceivedFlags(); sub_8036EB8(2, playerMultiplayerId); SetAllPlayersBerryData(); - taskId = CreateTask(sub_8035D74, 0); + taskId = CreateTask(InitLinkBattleVsScreen, 0); gTasks[taskId].data[1] = 0x10E; gTasks[taskId].data[2] = 0x5A; gTasks[taskId].data[5] = 0; @@ -1226,7 +1226,7 @@ static void CB2_HandleStartMultiPartnerBattle(void) ResetBlockReceivedFlags(); sub_8036EB8(2, playerMultiplayerId); SetAllPlayersBerryData(); - taskId = CreateTask(sub_8035D74, 0); + taskId = CreateTask(InitLinkBattleVsScreen, 0); gTasks[taskId].data[1] = 0x10E; gTasks[taskId].data[2] = 0x5A; gTasks[taskId].data[5] = 0; @@ -1612,7 +1612,7 @@ static void CB2_HandleStartMultiBattle(void) sub_8036EB8(4, playerMultiplayerId); SetAllPlayersBerryData(); SetDeoxysStats(); - var = CreateTask(sub_8035D74, 0); + var = CreateTask(InitLinkBattleVsScreen, 0); gTasks[var].data[1] = 0x10E; gTasks[var].data[2] = 0x5A; gTasks[var].data[5] = 0; @@ -2250,7 +2250,7 @@ void sub_8038D64(void) gBattle_BG3_X = 0; gBattle_BG3_Y = 0; - sub_80356D0(); + InitBattleBgsVideo(); LoadCompressedPalette(gBattleTextboxPalette, 0, 64); LoadBattleMenuWindowGfx(); ResetSpriteData(); @@ -2261,7 +2261,7 @@ void sub_8038D64(void) gReservedSpritePaletteCount = 4; SetVBlankCallback(VBlankCB_Battle); - taskId = CreateTask(sub_8035D74, 0); + taskId = CreateTask(InitLinkBattleVsScreen, 0); gTasks[taskId].data[1] = 0x10E; gTasks[taskId].data[2] = 0x5A; gTasks[taskId].data[5] = 1; @@ -2446,7 +2446,7 @@ static void sub_80392A8(void) gBattle_BG2_Y = 0; gBattle_BG3_X = 0; gBattle_BG3_Y = 0; - sub_80356D0(); + InitBattleBgsVideo(); SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP); LoadBattleMenuWindowGfx(); diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index a6c0f1ee7..33c5f661b 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -10279,7 +10279,7 @@ static void Cmd_displaydexinfo(void) } break; case 3: - sub_80356D0(); + InitBattleBgsVideo(); LoadBattleTextboxAndBackground(); gBattle_BG3_X = 0x100; gBattleCommunication[0]++; diff --git a/src/evolution_scene.c b/src/evolution_scene.c index 929539d30..019d48416 100644 --- a/src/evolution_scene.c +++ b/src/evolution_scene.c @@ -235,7 +235,7 @@ void EvolutionScene(struct Pokemon* mon, u16 speciesToEvolve, bool8 canStopEvo, gBattleTerrain = BATTLE_TERRAIN_PLAIN; - sub_80356D0(); + InitBattleBgsVideo(); LoadBattleTextboxAndBackground(); ResetSpriteData(); ScanlineEffect_Stop(); @@ -341,7 +341,7 @@ static void CB2_EvolutionSceneLoadGraphics(void) gBattleTerrain = BATTLE_TERRAIN_PLAIN; - sub_80356D0(); + InitBattleBgsVideo(); LoadBattleTextboxAndBackground(); ResetSpriteData(); FreeAllSpritePalettes(); diff --git a/src/graphics.c b/src/graphics.c index 06bfeed17..17d9a03cb 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -960,7 +960,7 @@ const u32 gUnknown_08D778F0[] = INCBIN_U32("graphics/battle_transitions/vs_frame const u32 gUnknown_08D779D8[] = INCBIN_U32("graphics/battle_transitions/vs_frame.bin.lz"); const u32 gUnknown_08D77AE4[] = INCBIN_U32("graphics/battle_transitions/vs_frame.gbapal.lz"); -const u32 gUnknown_08D77B0C[] = INCBIN_U32("graphics/battle_transitions/vs.4bpp.lz"); +const u32 gVsLettersGfx[] = INCBIN_U32("graphics/battle_transitions/vs.4bpp.lz"); #include "data/graphics/battle_terrain.h" @@ -987,7 +987,7 @@ const u32 gUnknown_08D854C8[] = INCBIN_U32("graphics/battle_frontier/options_pal const u32 gBattleArenaJudgementSymbolsGfx[] = INCBIN_U32("graphics/battle_frontier/arena_judgement_symbols.4bpp.lz"); const u32 gBattleArenaJudgementSymbolsPalette[] = INCBIN_U32("graphics/battle_frontier/arena_judgement_symbols.gbapal.lz"); -const u32 gUnknown_08D85600[] = INCBIN_U32("graphics/battle_frontier/text.gbapal.lz"); +const u32 gBattleWindowTextPalette[] = INCBIN_U32("graphics/battle_interface/text.gbapal.lz"); const u16 gUnknown_08D85620[] = INCBIN_U16("graphics/battle_frontier/text_pp.gbapal"); const u16 gTilesetAnims_BattleDomePals0_0[] = INCBIN_U16("graphics/battle_frontier/dome_anim1.gbapal");