diff options
Diffstat (limited to 'src/pokemon')
-rw-r--r-- | src/pokemon/mon_markings.c | 3 | ||||
-rw-r--r-- | src/pokemon/pokeblock_feed.c | 2 | ||||
-rw-r--r-- | src/pokemon/pokedex.c | 48 | ||||
-rw-r--r-- | src/pokemon/pokemon_menu.c | 6 | ||||
-rw-r--r-- | src/pokemon/pokemon_summary_screen.c | 22 |
5 files changed, 30 insertions, 51 deletions
diff --git a/src/pokemon/mon_markings.c b/src/pokemon/mon_markings.c index 3734856b8..66c82a706 100644 --- a/src/pokemon/mon_markings.c +++ b/src/pokemon/mon_markings.c @@ -631,6 +631,5 @@ struct Sprite *sub_80F7960(u16 tileTag, u16 paletteTag, const u16 *palette, u16 void sub_80F7A10(u8 markings, void *dest) { - const void *src = gUnknown_083E4A14 + markings * 0x80; - DmaCopy16(3, src, dest, 0x80); + DmaCopy16Defvars(3, gUnknown_083E4A14 + markings * 0x80, dest, 0x80); } diff --git a/src/pokemon/pokeblock_feed.c b/src/pokemon/pokeblock_feed.c index 194636e4d..2f2ce2f8f 100644 --- a/src/pokemon/pokeblock_feed.c +++ b/src/pokemon/pokeblock_feed.c @@ -511,7 +511,7 @@ static bool8 TransitionToPokeblockFeedScene(void) switch (gMain.state) { case 0: - sub_80F9438(); + ClearVideoCallbacks(); sub_80F9368(); sub_8147B04(); gMain.state++; diff --git a/src/pokemon/pokedex.c b/src/pokemon/pokedex.c index 4fb6a4920..cbd816206 100644 --- a/src/pokemon/pokedex.c +++ b/src/pokemon/pokedex.c @@ -1394,29 +1394,12 @@ void CB2_InitPokedex(void) { case 0: default: - { - u8 *addr; - u32 size; - - SetVBlankCallback(NULL); - sub_8091060(0); - addr = (u8 *)VRAM; - size = VRAM_SIZE; - while (1) - { - DmaFill16(3, 0, addr, 0x1000); - addr += 0x1000; - size -= 0x1000; - if (size <= 0x1000) - { - DmaFill16(3, 0, addr, size); - break; - } - } - DmaClear32(3, OAM, OAM_SIZE); - DmaClear16(3, PLTT, PLTT_SIZE); - gMain.state = 1; - } + SetVBlankCallback(NULL); + sub_8091060(0); + DmaFill16Large(3, 0, (void *)(VRAM + 0x0), VRAM_SIZE, 0x1000); + DmaClear32(3, OAM, OAM_SIZE); + DmaClear16(3, PLTT, PLTT_SIZE); + gMain.state = 1; break; case 1: ScanlineEffect_Stop(); @@ -4121,26 +4104,35 @@ bool8 CompletedHoennPokedex(void) return TRUE; } -u16 sub_8090FF4(void) +bool16 CompletedNationalPokedex(void) { u16 i; + // BUG: This function indexes pokemon checks by 0, but adds + // 1 before passing to GetSetPokedexFlag. Normally, this is + // fine, because GetSetPokedexFlag subtracts by 1 to get the + // array index value, but since the array is 0 indexed + // starting with Bulbasaur, values passed actually means that + // dex entries 152 (Chikorita) and 252 (Treecko) are skipped. + // Because an earlier Hoenn Dex check prevented Treecko from + // being skippable, it means that Chikorita is not required + // to obtain the National Diploma. This was fixed in Emerald. for (i = 0; i < 150; i++) { if (GetSetPokedexFlag(i + 1, 1) == 0) - return 0; + return FALSE; } for (i = 152; i < 250; i++) { if (GetSetPokedexFlag(i + 1, 1) == 0) - return 0; + return FALSE; } for (i = 252; i < 384; i++) { if (GetSetPokedexFlag(i + 1, 1) == 0) - return 0; + return FALSE; } - return 1; + return TRUE; } static void sub_8091060(u16 a) diff --git a/src/pokemon/pokemon_menu.c b/src/pokemon/pokemon_menu.c index 70234ac48..a41e197f2 100644 --- a/src/pokemon/pokemon_menu.c +++ b/src/pokemon/pokemon_menu.c @@ -51,7 +51,7 @@ extern u8 gUnknown_0202E8F5; extern u8 gUnknown_0202E8F6; extern u8 gUnknown_02038561; extern u16 gUnknown_0202E8F8; -extern void (*gUnknown_03004AE4)(u8 taskID, u16 itemID, TaskFunc func); +extern void (*gPokemonItemUseCallback)(u8 taskID, u16 itemID, TaskFunc func); extern TaskFunc gUnknown_03005CF0; void sub_808A520(void); @@ -1013,7 +1013,7 @@ void sub_808B0C0(u8 taskID) { sub_806D5A4(); if (gUnknown_02038561 == 0) - gUnknown_03004AE4(taskID, gSpecialVar_ItemId, sub_808B224); + gPokemonItemUseCallback(taskID, gSpecialVar_ItemId, sub_808B224); if (gUnknown_02038561 == 1) { PlaySE(SE_SELECT); @@ -1042,7 +1042,7 @@ void sub_808B0C0(u8 taskID) static void sub_808B1EC(u8 taskID) { if (!gPaletteFade.active) - gUnknown_03004AE4(taskID, gSpecialVar_ItemId, sub_808B224); + gPokemonItemUseCallback(taskID, gSpecialVar_ItemId, sub_808B224); } static void sub_808B224(u8 taskID) diff --git a/src/pokemon/pokemon_summary_screen.c b/src/pokemon/pokemon_summary_screen.c index 7b40918e9..96f9c44f9 100644 --- a/src/pokemon/pokemon_summary_screen.c +++ b/src/pokemon/pokemon_summary_screen.c @@ -691,9 +691,6 @@ void sub_809DA1C(void) bool8 sub_809DA84(void) { - const u16 *src; - void *dest; - switch (gMain.state) { case 0: @@ -710,8 +707,7 @@ bool8 sub_809DA84(void) gMain.state++; break; case 3: - dest = (void *)VRAM; - DmaClearLarge(3, dest, 0x10000, 0x1000, 32); + DmaClearLarge(3, (void *)(VRAM + 0x0), 0x10000, 0x1000, 32); gMain.state++; break; case 4: @@ -737,14 +733,8 @@ bool8 sub_809DA84(void) gMain.state++; break; case 9: - src = gSummaryScreenTextTiles; - dest = (void *)VRAM + 0xD000; - DmaCopy16(3, src, dest, 320); - - src = sSummaryScreenButtonTiles; - dest = (void *)VRAM + 0xD140; - DmaCopy16(3, src, dest, 256); - + DmaCopy16Defvars(3, gSummaryScreenTextTiles, (void *)(VRAM + 0xD000), 320); + DmaCopy16Defvars(3, sSummaryScreenButtonTiles, (void *)(VRAM + 0xD140), 256); pssData.loadGfxState = 0; gMain.state++; break; @@ -3623,16 +3613,14 @@ static void DrawSummaryScreenNavigationDots(void) } } - dest = (void *)(VRAM + 0xE016); - DmaCopy16(3, arr, dest, 16); + DmaCopy16Defvars(3, arr, (void *)(VRAM + 0xE016), 16); for (i = 0; i < 8; i++) { arr[i] += 0x10; } - dest = (void *)(VRAM + 0xE056); - DmaCopy16(3, arr, dest, 16); + DmaCopy16Defvars(3, arr, (void *)(VRAM + 0xE056), 16); } #else __attribute__((naked)) |