diff options
author | Rangi <remy.oukaour+rangi42@gmail.com> | 2020-10-06 18:09:25 -0400 |
---|---|---|
committer | Rangi <remy.oukaour+rangi42@gmail.com> | 2020-10-06 18:09:25 -0400 |
commit | d2ffdbf7ea6c6c92bd8ccbfd8405ec66e42ffd96 (patch) | |
tree | 7458a786cd585489b31136d389da285851e02540 | |
parent | 5838d479a2859ca17c0a0f2e88e0ead9644343c8 (diff) |
Update battle anim bg function comments, and identify more unnamed labels
-rw-r--r-- | constants/battle_anim_constants.asm | 2 | ||||
-rw-r--r-- | engine/battle/core.asm | 14 | ||||
-rw-r--r-- | engine/battle_anims/bg_effects.asm | 18 | ||||
-rw-r--r-- | engine/debug/color_picker.asm | 78 | ||||
-rw-r--r-- | engine/items/buy_sell_toss.asm | 5 | ||||
-rw-r--r-- | engine/items/mart.asm | 4 | ||||
-rw-r--r-- | engine/overworld/events.asm | 7 | ||||
-rw-r--r-- | engine/pokegear/pokegear.asm | 40 | ||||
-rw-r--r-- | engine/rtc/print_hours_mins.asm | 2 | ||||
-rw-r--r-- | engine/tilesets/tileset_anims.asm | 15 |
10 files changed, 95 insertions, 90 deletions
diff --git a/constants/battle_anim_constants.asm b/constants/battle_anim_constants.asm index 6e75faf7..9f0beea6 100644 --- a/constants/battle_anim_constants.asm +++ b/constants/battle_anim_constants.asm @@ -813,7 +813,7 @@ BATTLEANIM_BASE_TILE EQU 7 * 7 ; Maximum size of a pokemon picture BG_EFFECT_STRUCT_LENGTH EQU const_value NUM_BG_EFFECTS EQU 5 ; see wActiveBGEffects -; anim_bgeffect battle turn values +; anim_bgeffect battle turn values for some effects const_def const BG_EFFECT_TARGET ; 0 const BG_EFFECT_USER ; 1 diff --git a/engine/battle/core.asm b/engine/battle/core.asm index a7524172..666eb9a0 100644 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -2923,7 +2923,7 @@ ForceEnemySwitch: call ClearEnemyMonBox call NewEnemyMonStatus call ResetEnemyStatLevels - call Function_SetEnemyMonAndSendOutAnimation + call ShowSetEnemyMonAndSendOutAnimation call BreakAttraction call ResetBattleParticipants ret @@ -2942,8 +2942,8 @@ EnemySwitch: call OfferSwitch push af call ClearEnemyMonBox - call Function_BattleTextEnemySentOut - call Function_SetEnemyMonAndSendOutAnimation + call ShowBattleTextEnemySentOut + call ShowSetEnemyMonAndSendOutAnimation pop af ret c ; If we're here, then we're switching too @@ -2967,8 +2967,8 @@ EnemySwitch_SetMode: ld a, 1 ld [wEnemyIsSwitching], a call ClearEnemyMonBox - call Function_BattleTextEnemySentOut - jp Function_SetEnemyMonAndSendOutAnimation + call ShowBattleTextEnemySentOut + jp ShowSetEnemyMonAndSendOutAnimation CheckWhetherSwitchmonIsPredetermined: ; returns carry if: ??? @@ -3336,12 +3336,12 @@ ClearEnemyMonBox: call WaitBGMap jp FinishBattleAnim -Function_BattleTextEnemySentOut: +ShowBattleTextEnemySentOut: callfar Battle_GetTrainerName ld hl, BattleText_EnemySentOut jp StdBattleTextbox -Function_SetEnemyMonAndSendOutAnimation: +ShowSetEnemyMonAndSendOutAnimation: ld a, [wTempEnemyMonSpecies] ld [wCurPartySpecies], a ld [wCurSpecies], a diff --git a/engine/battle_anims/bg_effects.asm b/engine/battle_anims/bg_effects.asm index 8282a855..e406653f 100644 --- a/engine/battle_anims/bg_effects.asm +++ b/engine/battle_anims/bg_effects.asm @@ -2082,7 +2082,7 @@ BattleBGEffect_RapidFlash: ; unused db $e4, $6c, $fe BattleBGEffect_FadeMonToLight: -; BG_EFFECT_STRUCT_BATTLE_TURN: 0 = target of animation, 1 = user +; BG_EFFECT_STRUCT_BATTLE_TURN = BG_EFFECT_TARGET or BG_EFFECT_USER ld de, .Pals call BGEffect_RapidCyclePals ret @@ -2091,7 +2091,7 @@ BattleBGEffect_FadeMonToLight: db $e4, $90, $40, $ff BattleBGEffect_FadeMonToBlack: -; BG_EFFECT_STRUCT_BATTLE_TURN: 0 = target of animation, 1 = user +; BG_EFFECT_STRUCT_BATTLE_TURN = BG_EFFECT_TARGET or BG_EFFECT_USER ld de, .Pals call BGEffect_RapidCyclePals ret @@ -2100,7 +2100,7 @@ BattleBGEffect_FadeMonToBlack: db $e4, $f8, $fc, $ff BattleBGEffect_FadeMonToLightRepeating: -; BG_EFFECT_STRUCT_BATTLE_TURN: 0 = target of animation, 1 = user +; BG_EFFECT_STRUCT_BATTLE_TURN = BG_EFFECT_TARGET or BG_EFFECT_USER ld de, .Pals call BGEffect_RapidCyclePals ret @@ -2109,7 +2109,7 @@ BattleBGEffect_FadeMonToLightRepeating: db $e4, $90, $40, $90, $fe BattleBGEffect_FadeMonToBlackRepeating: -; BG_EFFECT_STRUCT_BATTLE_TURN: 0 = target of animation, 1 = user +; BG_EFFECT_STRUCT_BATTLE_TURN = BG_EFFECT_TARGET or BG_EFFECT_USER ld de, .Pals call BGEffect_RapidCyclePals ret @@ -2118,7 +2118,7 @@ BattleBGEffect_FadeMonToBlackRepeating: db $e4, $f8, $fc, $f8, $fe BattleBGEffect_CycleMonLightDarkRepeating: -; BG_EFFECT_STRUCT_BATTLE_TURN: 0 = target of animation, 1 = user +; BG_EFFECT_STRUCT_BATTLE_TURN = BG_EFFECT_TARGET or BG_EFFECT_USER ld de, .Pals call BGEffect_RapidCyclePals ret @@ -2127,7 +2127,7 @@ BattleBGEffect_CycleMonLightDarkRepeating: db $e4, $f8, $fc, $f8, $e4, $90, $40, $90, $fe BattleBGEffect_FlashMonRepeating: ; unused -; BG_EFFECT_STRUCT_BATTLE_TURN: 0 = target of animation, 1 = user +; BG_EFFECT_STRUCT_BATTLE_TURN = BG_EFFECT_TARGET or BG_EFFECT_USER ld de, .Pals call BGEffect_RapidCyclePals ret @@ -2136,7 +2136,7 @@ BattleBGEffect_FlashMonRepeating: ; unused db $e4, $fc, $e4, $00, $fe BattleBGEffect_FadeMonToWhiteWaitFadeBack: -; BG_EFFECT_STRUCT_BATTLE_TURN: 0 = target of animation, 1 = user +; BG_EFFECT_STRUCT_BATTLE_TURN = BG_EFFECT_TARGET or BG_EFFECT_USER ld de, .Pals call BGEffect_RapidCyclePals ret @@ -2145,7 +2145,7 @@ BattleBGEffect_FadeMonToWhiteWaitFadeBack: db $e4, $90, $40, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $40, $90, $e4, $ff BattleBGEffect_FadeMonFromWhite: ; unused -; BG_EFFECT_STRUCT_BATTLE_TURN: 0 = target of animation, 1 = user +; BG_EFFECT_STRUCT_BATTLE_TURN = BG_EFFECT_TARGET or BG_EFFECT_USER ld de, .Pals call BGEffect_RapidCyclePals ret @@ -2155,7 +2155,7 @@ BattleBGEffect_FadeMonFromWhite: ; unused BattleBGEffect_VibrateMon: ; Moves mon back and forth sideways for $20 frames -; BG_EFFECT_STRUCT_BATTLE_TURN: 0 = target of animation, 1 = user +; BG_EFFECT_STRUCT_BATTLE_TURN = BG_EFFECT_TARGET or BG_EFFECT_USER call BattleBGEffects_AnonJumptable .anon_dw dw .zero diff --git a/engine/debug/color_picker.asm b/engine/debug/color_picker.asm index 76308036..146cf5d8 100644 --- a/engine/debug/color_picker.asm +++ b/engine/debug/color_picker.asm @@ -261,7 +261,7 @@ DebugColorMain: .SwitchMon: ld [wce66], a - ld a, 0 ; ScreenInitNo + ld a, 0 ld [wJumptableIndex], a ret @@ -1048,7 +1048,8 @@ INCBIN "gfx/debug/up_arrow.2bpp" DebugColor_GFX: INCBIN "gfx/debug/color_test.2bpp" -TilesetColorTest: +TilesetColorPicker: +; A debug function to test tileset palettes at runtime. ; dummied out ret xor a @@ -1078,21 +1079,21 @@ TilesetColorTest: call ByteFill hlcoord 0, 0, wAttrmap ld bc, SCREEN_WIDTH * SCREEN_HEIGHT - ld a, $07 + ld a, PAL_BG_TEXT call ByteFill - ld de, $15 + decoord 1, 1, 0 ld a, DEBUGTEST_WHITE - call Functionfdbdb - ld de, $1a + call DebugTileset_DrawColorSwatch + decoord 6, 1, 0 ld a, DEBUGTEST_LIGHT - call Functionfdbdb - ld de, $1f + call DebugTileset_DrawColorSwatch + decoord 11, 1, 0 ld a, DEBUGTEST_DARK - call Functionfdbdb - ld de, $24 + call DebugTileset_DrawColorSwatch + decoord 16, 1, 0 ld a, DEBUGTEST_BLACK - call Functionfdbdb - call Functionfdbfd + call DebugTileset_DrawColorSwatch + call DebugTileset_LoadRGBMeter call Functionfdc18 call WaitBGMap2 ld [wJumptableIndex], a @@ -1100,42 +1101,39 @@ TilesetColorTest: ldh [hWY], a ret -Functionfdbdb: +DebugTileset_DrawColorSwatch: hlcoord 0, 0 - call Functionfdbe7 + call _DebugColor_DrawSwatch -Functionfdbe1: +DebugColor_DrawAttributeSwatch: ld a, [wce64] hlcoord 0, 0, wAttrmap -Functionfdbe7: +_DebugColor_DrawSwatch: +; Fills a 4x3 box at de with byte a. add hl, de rept 4 ld [hli], a endr - ld bc, $10 +rept 2 + ld bc, SCREEN_WIDTH - 4 add hl, bc rept 4 ld [hli], a endr - ld bc, $10 - add hl, bc -rept 4 - ld [hli], a endr ret -Functionfdbfd: +DebugTileset_LoadRGBMeter: hlcoord 2, 4 call .Place hlcoord 2, 6 call .Place hlcoord 2, 8 - .Place: ld a, DEBUGTEST_TICKS_1 ld [hli], a - ld bc, $10 - 1 + ld bc, 15 ld a, DEBUGTEST_TICKS_2 call ByteFill ret @@ -1150,7 +1148,7 @@ Functionfdc18: ld de, wBGPals1 add hl, de ld de, wc508 - ld bc, 8 + ld bc, 1 palettes call CopyBytes ld de, wc508 call DebugColor_CalculateRGB @@ -1163,7 +1161,7 @@ DebugColorMain2: ; unreferenced jr nz, .loop7 ld a, [hl] and B_BUTTON - jr nz, .asm_fdc8e + jr nz, .cancel call Functionfdcdb ret @@ -1171,20 +1169,20 @@ DebugColorMain2: ; unreferenced ld hl, wce64 ld a, [hl] inc a - and 7 - cp 7 - jr nz, .asm_fdc52 - xor a -.asm_fdc52 + and PALETTE_MASK + cp PAL_BG_TEXT + jr nz, .palette_ok + xor a ; PAL_BG_GRAY +.palette_ok ld [hl], a - ld de, $15 - call Functionfdbe1 - ld de, $1a - call Functionfdbe1 - ld de, $1f - call Functionfdbe1 - ld de, $24 - call Functionfdbe1 + decoord 1, 1, 0 + call DebugColor_DrawAttributeSwatch + decoord 6, 1, 0 + call DebugColor_DrawAttributeSwatch + decoord 11, 1, 0 + call DebugColor_DrawAttributeSwatch + decoord 16, 1, 0 + call DebugColor_DrawAttributeSwatch ld hl, wBGPals2 ld a, [wce64] ld bc, 1 palettes @@ -1200,7 +1198,7 @@ DebugColorMain2: ; unreferenced ldh [hBGMapMode], a ret -.asm_fdc8e +.cancel call ClearSprites ldh a, [hWY] xor %11010000 diff --git a/engine/items/buy_sell_toss.asm b/engine/items/buy_sell_toss.asm index 45c3dfcf..7a808f61 100644 --- a/engine/items/buy_sell_toss.asm +++ b/engine/items/buy_sell_toss.asm @@ -139,7 +139,8 @@ BuySellToss_UpdateQuantityDisplay: push de ret -ret_24ff3: +NoPriceToDisplay: +; Does nothing. ret DisplayPurchasePrice: @@ -202,7 +203,7 @@ BuySell_DisplaySubtotal: TossItem_MenuHeader: db MENU_BACKUP_TILES ; flags menu_coords 15, 9, SCREEN_WIDTH - 1, TEXTBOX_Y - 1 - dw ret_24ff3 + dw NoPriceToDisplay db 0 ; default option BuyItem_MenuHeader: diff --git a/engine/items/mart.asm b/engine/items/mart.asm index 3e7ffc0e..16bb9c33 100644 --- a/engine/items/mart.asm +++ b/engine/items/mart.asm @@ -750,8 +750,8 @@ MartSellPriceText: text_far _MartSellPriceText text_end -.UnusedString161d2: - db "!ダミー!@" +UnusedDummyString: ; unreferenced + db "!ダミー!@" ; "!Dummy!" MartWelcomeText: text_far _MartWelcomeText diff --git a/engine/overworld/events.asm b/engine/overworld/events.asm index 46811d2f..f21ea17b 100644 --- a/engine/overworld/events.asm +++ b/engine/overworld/events.asm @@ -372,10 +372,9 @@ SetUpFiveStepWildEncounterCooldown: ld [wWildEncounterCooldown], a ret -ret_96804: - ret - SetMinTwoStepWildEncounterCooldown: +; dummied out + ret ld a, [wWildEncounterCooldown] cp 2 ret nc @@ -764,7 +763,7 @@ PlayerMovement: ret .jump: - call ret_96804 + call SetMinTwoStepWildEncounterCooldown xor a ld c, a ret diff --git a/engine/pokegear/pokegear.asm b/engine/pokegear/pokegear.asm index 998cb589..be155618 100644 --- a/engine/pokegear/pokegear.asm +++ b/engine/pokegear/pokegear.asm @@ -2002,7 +2002,7 @@ _FlyMap: ld a, [hl] and A_BUTTON jr nz, .pressedA - call FlyMapScroll + call .HandleDPad call GetMapCursorCoordinates farcall PlaySpriteAnimations call DelayFrame @@ -2035,7 +2035,7 @@ _FlyMap: ld e, a ret -FlyMapScroll: +.HandleDPad: ld a, [wStartFlypoint] ld e, a ld a, [wEndFlypoint] @@ -2724,7 +2724,9 @@ INCBIN "gfx/pokegear/dexmap_nest_icon.2bpp" FlyMapLabelBorderGFX: INCBIN "gfx/pokegear/flymap_label_border.1bpp" -Function92264: ; unreferenced +EntireFlyMap: ; unreferenced +; Similar to _FlyMap, but scrolls through the entire +; Flypoints data of both regions. A debug function? xor a ld [wTownMapPlayerIconLandmark], a call ClearBGPalettes @@ -2777,7 +2779,7 @@ Function92264: ; unreferenced .pressedB ld a, -1 - jr .finished_a_b + jr .exit .pressedA ld a, [wTownMapPlayerIconLandmark] @@ -2787,7 +2789,7 @@ Function92264: ; unreferenced ld de, Flypoints + 1 add hl, de ld a, [hl] -.finished_a_b +.exit ld [wTownMapPlayerIconLandmark], a pop af ldh [hInMenu], a @@ -2806,44 +2808,44 @@ Function92264: ; unreferenced ld hl, hJoyLast ld a, [hl] and D_DOWN | D_RIGHT - jr nz, .down_right + jr nz, .ScrollNext ld a, [hl] and D_UP | D_LEFT - jr nz, .up_left + jr nz, .ScrollPrev ret -.down_right +.ScrollNext: ld hl, wTownMapPlayerIconLandmark ld a, [hl] cp NUM_FLYPOINTS - 1 - jr c, .okay_dr + jr c, .NotAtEndYet ld [hl], -1 -.okay_dr +.NotAtEndYet: inc [hl] - jr .continue + jr .FillMap -.up_left +.ScrollPrev: ld hl, wTownMapPlayerIconLandmark ld a, [hl] and a - jr nz, .okay_ul + jr nz, .NotAtStartYet ld [hl], NUM_FLYPOINTS -.okay_ul +.NotAtStartYet: dec [hl] -.continue +.FillMap: ld a, [wTownMapPlayerIconLandmark] cp KANTO_FLYPOINT - jr c, .johto + jr c, .InJohto call FillKantoMap xor a ld b, HIGH(vBGMap1) - jr .finish + jr .Finally -.johto +.InJohto: call FillJohtoMap ld a, SCREEN_HEIGHT_PX ld b, HIGH(vBGMap0) -.finish +.Finally: ldh [hWY], a ld a, b ldh [hBGMapAddress + 1], a diff --git a/engine/rtc/print_hours_mins.asm b/engine/rtc/print_hours_mins.asm index 83d23736..4aa4925e 100644 --- a/engine/rtc/print_hours_mins.asm +++ b/engine/rtc/print_hours_mins.asm @@ -1,4 +1,4 @@ -Function1c0a0d: ; unreferenced +PrintFiveDigitNumber: ; unreferenced ; Debug function? ; Input: bc = value, de = destination ld a, b diff --git a/engine/tilesets/tileset_anims.asm b/engine/tilesets/tileset_anims.asm index b9bf42a3..0cef55bb 100644 --- a/engine/tilesets/tileset_anims.asm +++ b/engine/tilesets/tileset_anims.asm @@ -72,7 +72,8 @@ TilesetJohtoAnim: dw NULL, StandingTileFrame8 dw NULL, DoneTileAnimation -UnusedTilesetAnim_fc07e: +UnusedTilesetAnim1: ; unreferenced +; Scrolls tile $03 like cave water, but also has the standard $03 flower tile. dw vTiles2 tile $03, WriteTileToBuffer dw wTileAnimBuffer, ScrollTileRightLeft dw vTiles2 tile $03, WriteTileFromBuffer @@ -85,7 +86,8 @@ UnusedTilesetAnim_fc07e: dw NULL, WaitTileAnimation dw NULL, DoneTileAnimation -UnusedTilesetAnim_fc0aa: +UnusedTilesetAnim2: ; unreferenced +; Scrolls tile $14 like cave water. dw vTiles2 tile $14, WriteTileToBuffer dw wTileAnimBuffer, ScrollTileRightLeft dw vTiles2 tile $14, WriteTileFromBuffer @@ -122,7 +124,8 @@ TilesetEliteFourRoomAnim: dw NULL, StandingTileFrame8 dw NULL, DoneTileAnimation -UnusedTilesetAnim_fc126: +UnusedTilesetAnim3: ; unreferenced +; Scrolls tile $53 like a waterfall; scrolls tile $03 like cave water. dw vTiles2 tile $53, WriteTileToBuffer dw wTileAnimBuffer, ScrollTileDown dw wTileAnimBuffer, ScrollTileDown @@ -136,7 +139,8 @@ UnusedTilesetAnim_fc126: dw vTiles2 tile $53, WriteTileFromBuffer dw NULL, DoneTileAnimation -UnusedTilesetAnim_fc156: +UnusedTilesetAnim4: ; unreferenced +; Scrolls tile $54 like a waterfall; scrolls tile $03 like cave water. dw vTiles2 tile $54, WriteTileToBuffer dw wTileAnimBuffer, ScrollTileDown dw wTileAnimBuffer, ScrollTileDown @@ -213,7 +217,8 @@ TilesetTowerAnim: dw NULL, WaitTileAnimation dw NULL, DoneTileAnimation -UnusedTilesetAnim_fc266: +UnusedTilesetAnim5: ; unreferenced +; Scrolls tile $4f like cave water. dw vTiles2 tile $4f, WriteTileToBuffer dw wTileAnimBuffer, ScrollTileRightLeft dw vTiles2 tile $4f, WriteTileFromBuffer |