diff options
Diffstat (limited to 'src/starter_choose.c')
-rw-r--r-- | src/starter_choose.c | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/src/starter_choose.c b/src/starter_choose.c index 9bd817cce..28dd6a820 100644 --- a/src/starter_choose.c +++ b/src/starter_choose.c @@ -1,17 +1,17 @@ #include "global.h" #include "starter_choose.h" #include "asm.h" +#include "decompress.h" #include "main.h" #include "menu.h" #include "palette.h" #include "pokedex.h" #include "songs.h" #include "sound.h" +#include "sprite.h" #include "string_util.h" #include "task.h" #include "trig.h" -#include "decompress.h" -#include "sprite.h" struct MonCoords { @@ -87,9 +87,9 @@ void CB2_ChooseStarter(void) u16 savedIme; u8 taskId; u8 spriteId; - + SetVBlankCallback(NULL); - + REG_DISPCNT = 0; REG_BG3CNT = 0; REG_BG2CNT = 0; @@ -103,11 +103,11 @@ void CB2_ChooseStarter(void) REG_BG1VOFS = 0; REG_BG0HOFS = 0; REG_BG0VOFS = 0; - + DmaFill16(3, 0, VRAM, VRAM_SIZE); DmaFill32(3, 0, OAM, OAM_SIZE); DmaFill16(3, 0, PLTT, PLTT_SIZE); - + LZ77UnCompVram(&gBirchHelpGfx, (void *)VRAM); LZ77UnCompVram(&gBirchBagTilemap, (void *)(VRAM + 0x3000)); LZ77UnCompVram(&gBirchGrassTilemap, (void *)(VRAM + 0x3800)); @@ -123,16 +123,16 @@ void CB2_ChooseStarter(void) SetUpWindowConfig(&gWindowConfig_81E6C3C); InitMenuWindow(&gWindowConfig_81E6CE4); BeginNormalPaletteFade(-1, 0, 0x10, 0, 0); - + savedIme = REG_IME; REG_IME = 0; REG_IE |= INTR_FLAG_VBLANK; REG_IME = savedIme; REG_DISPSTAT |= DISPSTAT_VBLANK_INTR; - + SetVBlankCallback(VblankCallback); SetMainCallback2(MainCallback2); - + REG_WININ = 0x3F; REG_WINOUT = 0x1F; REG_WIN0H = 0; @@ -144,14 +144,14 @@ void CB2_ChooseStarter(void) REG_BG2CNT = 0x602; REG_BG0CNT = 0x1F08; REG_DISPCNT = DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG0_ON | DISPCNT_BG2_ON | DISPCNT_BG3_ON | DISPCNT_OBJ_ON | DISPCNT_WIN0_ON; - + taskId = CreateTask(Task_StarterChoose1, 0); gTasks[taskId].data[TD_STARTERSELECTION] = 1; - + //Create hand sprite spriteId = CreateSprite(&gSpriteTemplate_83F77CC, 120, 56, 2); gSprites[spriteId].data0 = taskId; - + //Create three Pokeball sprites spriteId = CreateSprite( &gSpriteTemplate_83F77E4, @@ -189,20 +189,20 @@ static void Task_StarterChoose1(u8 taskId) static void Task_StarterChoose2(u8 taskId) { u8 selection = gTasks[taskId].data[TD_STARTERSELECTION]; - + if(gMain.newKeys & A_BUTTON) { u8 spriteId; - + MenuZeroFillWindowRect( gStarterChoose_LabelCoords[selection][0], gStarterChoose_LabelCoords[selection][1], gStarterChoose_LabelCoords[selection][0] + 13, gStarterChoose_LabelCoords[selection][1] + 3); - + REG_WIN0H = 0; REG_WIN0V = 0; - + //Create white circle background spriteId = CreateSprite( &gSpriteTemplate_83F77FC, @@ -210,7 +210,7 @@ static void Task_StarterChoose2(u8 taskId) gStarterChoose_PokeballCoords[selection][1], 1); gTasks[taskId].data[TD_CIRCLE_SPRITE_ID] = spriteId; - + //Create Pokemon sprite spriteId = CreatePokemonFrontSprite( GetStarterPokemon(gTasks[taskId].data[TD_STARTERSELECTION]), @@ -219,7 +219,7 @@ static void Task_StarterChoose2(u8 taskId) gSprites[spriteId].affineAnims = gSpriteAffineAnimTable_83F778C; gSprites[spriteId].callback = StarterPokemonSpriteAnimCallback; gTasks[taskId].data[TD_PKMN_SPRITE_ID] = spriteId; - + gTasks[taskId].func = Task_StarterChoose3; } else @@ -260,7 +260,7 @@ static void Task_StarterChoose4(u8 taskId) static void Task_StarterChoose5(u8 taskId) { u8 spriteId; - + switch(ProcessMenuInputNoWrap_()) { case 0: //YES @@ -272,12 +272,12 @@ static void Task_StarterChoose5(u8 taskId) case -1: //B button PlaySE(SE_SELECT); MenuZeroFillWindowRect(21, 7, 27, 12); - + spriteId = gTasks[taskId].data[TD_PKMN_SPRITE_ID]; FreeSpritePaletteByTag(GetSpritePaletteTagByPaletteNum(gSprites[spriteId].oam.paletteNum)); FreeOamMatrix(gSprites[spriteId].oam.matrixNum); DestroySprite(&gSprites[spriteId]); - + spriteId = gTasks[taskId].data[TD_CIRCLE_SPRITE_ID]; FreeOamMatrix(gSprites[spriteId].oam.matrixNum); DestroySprite(&gSprites[spriteId]); @@ -313,12 +313,12 @@ static void CreateStarterPokemonLabel(u8 prevSelection, u8 selection) u8 srcIndex; u8 dstIndex; u16 species; - + u8 labelLeft; u8 labelRight; u8 labelTop; u8 labelBottom; - + if(prevSelection != 0xFF) { //Remove the old Pokemon label @@ -337,7 +337,7 @@ static void CreateStarterPokemonLabel(u8 prevSelection, u8 selection) SET_CHAR(labelText, 5, EXT_CTRL_CODE_BEGIN); SET_CHAR(labelText, 6, 0x11); SET_CHAR(labelText, 7, dstIndex); - + //Copy category string to label dstIndex = 8; srcIndex = 0; @@ -348,7 +348,7 @@ static void CreateStarterPokemonLabel(u8 prevSelection, u8 selection) dstIndex++; } labelText[dstIndex++] = CHAR_SPACE; - + //Copy POKEMON string to label StringCopy(labelText + dstIndex, gOtherText_Poke); MenuPrint( @@ -356,14 +356,14 @@ static void CreateStarterPokemonLabel(u8 prevSelection, u8 selection) gStarterChoose_LabelCoords[selection][0], gStarterChoose_LabelCoords[selection][1]); AddTextColorCtrlCode(labelText, 0, 15, 8); - + //Copy Pokemon name to label sub_8072C74(labelText + 5, gSpeciesNames[species], 0x6B, 1); MenuPrint( labelText, gStarterChoose_LabelCoords[selection][0], gStarterChoose_LabelCoords[selection][1] + 2); - + labelLeft = gStarterChoose_LabelCoords[selection][0] * 8 + 4; labelRight = (gStarterChoose_LabelCoords[selection][0] + 13) * 8 + 4; labelTop = gStarterChoose_LabelCoords[selection][1] * 8; @@ -374,13 +374,13 @@ static void CreateStarterPokemonLabel(u8 prevSelection, u8 selection) void nullsub_72(struct Sprite *sprite) { - + } static u8 CreatePokemonFrontSprite(u16 species, u8 x, u8 y) { u8 spriteId; - + DecompressPicFromTable_2( &gMonFrontPicTable[species], gMonFrontPicCoords[species].x, gMonFrontPicCoords[species].y, |