diff options
Diffstat (limited to 'engine')
61 files changed, 231 insertions, 247 deletions
diff --git a/engine/battle/ai/items.asm b/engine/battle/ai/items.asm index b375b54c..16e9ef20 100644 --- a/engine/battle/ai/items.asm +++ b/engine/battle/ai/items.asm @@ -25,7 +25,7 @@ AI_SwitchOrTryItem: ld hl, TrainerClassAttributes + TRNATTR_AI_ITEM_SWITCH ld bc, NUM_TRAINER_ATTRIBUTES call AddNTimes -.ok + bit SWITCH_OFTEN_F, [hl] jp nz, SwitchOften bit SWITCH_RARELY_F, [hl] @@ -141,7 +141,7 @@ SwitchSometimes: ld [wEnemySwitchMonIndex], a jp AI_TrySwitch -CheckSubstatusCantRun: +CheckSubstatusCantRun: ; unreferenced ld a, [wEnemySubStatus5] bit SUBSTATUS_CANT_RUN, a ret @@ -204,7 +204,7 @@ AI_TryItem: inc hl jr c, .loop -.used_item +; used item xor a ld [de], a inc a @@ -247,7 +247,7 @@ AI_TryItem: cp e jr nc, .yes -.no +.no ; unreferenced and a ret diff --git a/engine/battle/battle_transition.asm b/engine/battle/battle_transition.asm index 105248f0..611702b3 100644 --- a/engine/battle/battle_transition.asm +++ b/engine/battle/battle_transition.asm @@ -396,7 +396,7 @@ ENDM spin_quadrant LOWER_LEFT, .wedge1, 1, 11 db -1 -.load +.load: ld a, [hli] ld e, a ld a, [hli] diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 4a580aca..24b79b7c 100644 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -1644,7 +1644,7 @@ HandleWeather: cp USING_EXTERNAL_CLOCK jr z, .enemy_first -.player_first +; player first call SetPlayerTurn call .SandstormDamage call SetEnemyTurn @@ -2609,7 +2609,7 @@ AskUseNextPokemon: ForcePlayerMonChoice: call EmptyBattleTextbox call LoadStandardMenuHeader - call SetUpBattlePartyMenu_NoLoop + call SetUpBattlePartyMenu call ForcePickPartyMonInBattle ld a, [wLinkMode] cp LINK_COLOSSEUM @@ -2681,9 +2681,8 @@ PlayerPartyMonEntrance: call SetPlayerTurn jp SpikesDamage -SetUpBattlePartyMenu_NoLoop: +SetUpBattlePartyMenu: call ClearBGPalettes -SetUpBattlePartyMenu: ; switch to fullscreen menu? farcall LoadPartyMenuGFX farcall InitPartyMenuWithCancel farcall InitPartyMenuGFX @@ -3296,7 +3295,7 @@ OfferSwitch: ld a, [wMenuCursorY] dec a jr nz, .said_no - call SetUpBattlePartyMenu_NoLoop + call SetUpBattlePartyMenu call PickSwitchMonInBattle jr c, .canceled_switch ld a, [wCurBattleMon] @@ -8005,7 +8004,7 @@ CheckPayDay: call StdBattleTextbox ret -PlayerPickedUpPayDayMoney: +PlayerPickedUpPayDayMoney: ; unreferenced text_far _PlayerPickedUpPayDayMoney text_end @@ -8180,7 +8179,6 @@ ReadAndPrintLinkBattleRecord: lb bc, 2, 4 call PrintNum -.quit ret .PrintZerosIfNoSaveFileExists: @@ -8556,14 +8554,15 @@ InitBattleDisplay: call OpenSRAM ld hl, sDecompressScratch - ld bc, sScratchAttrmap - sDecompressScratch + ld bc, BG_MAP_WIDTH * BG_MAP_HEIGHT ld a, " " call ByteFill ld de, sDecompressScratch hlbgcoord 0, 0 - lb bc, BANK(.BlankBGMap), $40 + lb bc, BANK(@), (BG_MAP_WIDTH * BG_MAP_HEIGHT) / LEN_2BPP_TILE call Request2bpp + call CloseSRAM ret diff --git a/engine/battle/effect_commands.asm b/engine/battle/effect_commands.asm index a5ae950f..7317407a 100644 --- a/engine/battle/effect_commands.asm +++ b/engine/battle/effect_commands.asm @@ -145,7 +145,7 @@ BattleCommand_CheckTurn: and a jp nz, CheckEnemyTurn -CheckPlayerTurn: +; check player turn ld hl, wPlayerSubStatus4 bit SUBSTATUS_RECHARGE, [hl] jr z, .no_recharge @@ -2592,7 +2592,7 @@ PlayerAttackDamage: cp SPECIAL jr nc, .special -.physical +; physical ld hl, wEnemyMonDefense ld a, [hli] ld b, a @@ -2660,7 +2660,6 @@ PlayerAttackDamage: ret TruncateHL_BC: -.loop ; Truncate 16-bit values hl and bc to 8-bit values b and c respectively. ; b = hl, c = bc @@ -2821,9 +2820,9 @@ EnemyAttackDamage: ld a, [hl] cp SPECIAL - jr nc, .Special + jr nc, .special -.physical +; physical ld hl, wBattleMonDefense ld a, [hli] ld b, a @@ -2847,7 +2846,7 @@ EnemyAttackDamage: ld hl, wEnemyAttack jr .thickclub -.Special: +.special ld hl, wBattleMonSpclDef ld a, [hli] ld b, a @@ -6075,7 +6074,7 @@ INCLUDE "engine/battle/move_effects/conversion.asm" BattleCommand_ResetStats: ; resetstats - ld a, 7 ; neutral + ld a, BASE_STAT_LEVEL ld hl, wPlayerStatLevels call .Fill ld hl, wEnemyStatLevels @@ -6098,7 +6097,7 @@ BattleCommand_ResetStats: jp StdBattleTextbox .Fill: - ld b, wPlayerStatLevelsEnd - wPlayerStatLevels + ld b, NUM_LEVEL_STATS .next ld [hli], a dec b diff --git a/engine/battle/menu.asm b/engine/battle/menu.asm index 6a942f6c..e9a7e593 100644 --- a/engine/battle/menu.asm +++ b/engine/battle/menu.asm @@ -3,8 +3,7 @@ LoadBattleMenu: call LoadMenuHeader jr CommonBattleMenu -SafariBattleMenu: -; untranslated +SafariBattleMenu: ; unreferenced ld hl, SafariBattleMenuHeader call LoadMenuHeader jr CommonBattleMenu @@ -12,7 +11,8 @@ SafariBattleMenu: ContestBattleMenu: ld hl, ContestBattleMenuHeader call LoadMenuHeader -; fallthrough + ; fallthrough + CommonBattleMenu: ld a, [wBattleMenuCursorBuffer] ld [wMenuCursorBuffer], a diff --git a/engine/battle/move_effects/baton_pass.asm b/engine/battle/move_effects/baton_pass.asm index bf9e3235..236acc82 100644 --- a/engine/battle/move_effects/baton_pass.asm +++ b/engine/battle/move_effects/baton_pass.asm @@ -17,7 +17,7 @@ BattleCommand_BatonPass: ; Transition into switchmon menu call LoadStandardMenuHeader - farcall SetUpBattlePartyMenu_NoLoop + farcall SetUpBattlePartyMenu farcall ForcePickSwitchMonInBattle diff --git a/engine/battle_anims/anim_commands.asm b/engine/battle_anims/anim_commands.asm index 7fb80d82..433a8e5e 100644 --- a/engine/battle_anims/anim_commands.asm +++ b/engine/battle_anims/anim_commands.asm @@ -978,7 +978,7 @@ GetMinimizePic: and a jr z, .player - ld de, sScratch + $1a tiles + ld de, sScratch + (3 * 7 + 5) tiles call CopyMinimizePic ld hl, vTiles2 tile $00 ld de, sScratch @@ -987,7 +987,7 @@ GetMinimizePic: jr .done .player - ld de, sScratch + $160 + ld de, sScratch + (3 * 6 + 4) tiles call CopyMinimizePic ld hl, vTiles2 tile $31 ld de, sScratch diff --git a/engine/battle_anims/core.asm b/engine/battle_anims/core.asm index adba64e0..d756a447 100644 --- a/engine/battle_anims/core.asm +++ b/engine/battle_anims/core.asm @@ -263,14 +263,12 @@ InitBattleAnimBuffer: jr nz, .no_sub ld a, [wFXAnimID] cp KINESIS - jr z, .kinesis + jr z, .do_sub cp SOFTBOILED - jr z, .softboiled + jr z, .do_sub cp MILK_DRINK jr nz, .no_sub -.kinesis -.softboiled -.milk_drink +.do_sub pop af sub 1 * 8 jr .done diff --git a/engine/battle_anims/functions.asm b/engine/battle_anims/functions.asm index 95b3a101..2a72cf12 100644 --- a/engine/battle_anims/functions.asm +++ b/engine/battle_anims/functions.asm @@ -4293,14 +4293,14 @@ BattleAnim_Cosine_e: ld e, a ret -BattleAnim_AbsSinePrecise: +BattleAnim_AbsSinePrecise: ; unreferenced ld a, e call BattleAnim_Sine ld e, l ld d, h ret -BattleAnim_AbsCosinePrecise: +BattleAnim_AbsCosinePrecise: ; unreferenced ld a, e call BattleAnim_Cosine ld e, l diff --git a/engine/debug/color_picker.asm b/engine/debug/color_picker.asm index b5d196b1..84e8c207 100644 --- a/engine/debug/color_picker.asm +++ b/engine/debug/color_picker.asm @@ -32,7 +32,7 @@ const DEBUGCOLORMAIN_INITTMHM ; 4 const DEBUGCOLORMAIN_TMHMJOYPAD ; 5 -DebugColorPicker: +DebugColorPicker: ; unreferenced ; A debug menu to test monster and trainer palettes at runtime. ldh a, [hCGB] and a @@ -1053,7 +1053,7 @@ INCBIN "gfx/debug/up_arrow.2bpp" DebugColor_GFX: INCBIN "gfx/debug/color_test.2bpp" -TilesetColorPicker: +TilesetColorPicker: ; unreferenced ; A debug menu to test tileset palettes at runtime. ; dummied out ret diff --git a/engine/debug/debug_room.asm b/engine/debug/debug_room.asm index 12259ce9..19f7f9e0 100644 --- a/engine/debug/debug_room.asm +++ b/engine/debug/debug_room.asm @@ -1147,9 +1147,9 @@ DebugRoom_BoxStructStrings: .Move4: db "MOVE 4@" .ID0: db "ID[0]@" .ID1: db "ID[1]@" -.BaseExp0: db "BASE EXP[0]@" -.BaseExp1: db "BASE EXP[1]@" -.BaseExp2: db "BASE EXP[2]@" +.BaseExp0: db "BASE EXP[0]@" ; unreferenced +.BaseExp1: db "BASE EXP[1]@" ; unreferenced +.BaseExp2: db "BASE EXP[2]@" ; unreferenced .HPExp0: db "HP EXP[0]@" .HPExp1: db "HP EXP[1]@" .AttkExp0: db "ATTK EXP[0]@" diff --git a/engine/events/daycare.asm b/engine/events/daycare.asm index 2edf2def..4648e9d2 100644 --- a/engine/events/daycare.asm +++ b/engine/events/daycare.asm @@ -160,7 +160,7 @@ DayCareAskDepositPokemon: scf ret -.DaycareDummyText: +.DaycareDummyText: ; unreferenced text_far _DaycareDummyText text_end diff --git a/engine/events/engine_flags.asm b/engine/events/engine_flags.asm index aebbacdc..13f9a9a8 100644 --- a/engine/events/engine_flags.asm +++ b/engine/events/engine_flags.asm @@ -57,7 +57,7 @@ EngineFlagAction:: jr z, .set ; b = 1 ; Return the given flag in c. -.check +; check ld a, [de] and c ld c, a diff --git a/engine/events/heal_machine_anim.asm b/engine/events/heal_machine_anim.asm index 7cf2f03a..ae2daa86 100644 --- a/engine/events/heal_machine_anim.asm +++ b/engine/events/heal_machine_anim.asm @@ -56,7 +56,7 @@ HealMachineAnim: .Pointers: ; entries correspond to HEALMACHINE_* constants dw .Pokecenter - dw .ElmLab + dw .ElmsLab dw .HallOfFame healmachineanimseq: MACRO @@ -68,7 +68,7 @@ ENDM .Pokecenter: healmachineanimseq LOADGFX, PCLOADBALLS, PLAYMUSIC, FINISH -.ElmLab: +.ElmsLab: healmachineanimseq LOADGFX, PCLOADBALLS, PLAYMUSIC, FINISH .HallOfFame: healmachineanimseq LOADGFX, HOFLOADBALLS, HOFPLAYSFX, FINISH diff --git a/engine/events/magnet_train.asm b/engine/events/magnet_train.asm index b6b6e995..13b080aa 100644 --- a/engine/events/magnet_train.asm +++ b/engine/events/magnet_train.asm @@ -56,7 +56,7 @@ MagnetTrain: ld [wRequested2bppSource + 1], a ld [wRequested2bppDest], a ld [wRequested2bppDest + 1], a - ld [wRequested2bpp], a + ld [wRequested2bppSize], a call ClearTilemap pop af diff --git a/engine/events/overworld.asm b/engine/events/overworld.asm index 7aaaca90..1f82b3a9 100644 --- a/engine/events/overworld.asm +++ b/engine/events/overworld.asm @@ -284,7 +284,6 @@ FlashFunction: ld a, [wTimeOfDayPalset] cp DARKNESS_PALSET jr nz, .notadarkcave -.useflash call UseFlash ld a, $81 ret @@ -1391,7 +1390,7 @@ HasRockSmash: ld d, ROCK_SMASH call CheckPartyMove jr nc, .yes -.no +; no ld a, 1 jr .done .yes @@ -1596,7 +1595,7 @@ RodNothingText: text_far _RodNothingText text_end -UnusedNothingHereText: ; unused +UnusedNothingHereText: ; unreferenced text_far _UnusedNothingHereText text_end diff --git a/engine/events/poisonstep.asm b/engine/events/poisonstep.asm index e6de6f19..827f6941 100644 --- a/engine/events/poisonstep.asm +++ b/engine/events/poisonstep.asm @@ -149,6 +149,6 @@ DoPoisonStep:: text_far _PoisonFaintText text_end -.PoisonWhiteoutText: +.PoisonWhiteoutText: ; unreferenced text_far _PoisonWhiteoutText text_end diff --git a/engine/events/print_unown_2.asm b/engine/events/print_unown_2.asm index aaeeec76..9c4d1d85 100644 --- a/engine/events/print_unown_2.asm +++ b/engine/events/print_unown_2.asm @@ -30,7 +30,7 @@ RotateUnownFrontpic: cp 7 * 7 jr c, .loop - ld hl, wGameboyPrinterRAM + ld hl, wGameboyPrinter2bppSource ld de, sScratch ld bc, 7 * 7 tiles call CopyBytes @@ -100,7 +100,7 @@ y = 0 rept \1 x = \1 * (\2 - 1) + y rept \2 - dw wGameboyPrinterRAM tile x + dw wGameboyPrinter2bppSource tile x x = x - \2 endr y = y + 1 diff --git a/engine/events/specials.asm b/engine/events/specials.asm index 3cedbf17..06fb7b20 100644 --- a/engine/events/specials.asm +++ b/engine/events/specials.asm @@ -414,17 +414,17 @@ GameboyCheck: ldh a, [hCGB] and a jr nz, .cgb - ldh a, [hSGB] and a jr nz, .sgb - -.gb +; gb xor a ; GBCHECK_GB jr .done + .sgb ld a, GBCHECK_SGB jr .done + .cgb ld a, GBCHECK_CGB .done diff --git a/engine/events/treemons.asm b/engine/events/treemons.asm index c96df83a..42d89d1f 100644 --- a/engine/events/treemons.asm +++ b/engine/events/treemons.asm @@ -208,7 +208,7 @@ GetTreeScore: cp 5 jr c, .good -.bad +; bad xor a ; TREEMON_SCORE_BAD ret diff --git a/engine/games/card_flip.asm b/engine/games/card_flip.asm index ba73f202..ab4ec624 100644 --- a/engine/games/card_flip.asm +++ b/engine/games/card_flip.asm @@ -1,7 +1,8 @@ CARDFLIP_LIGHT_OFF EQU "♂" ; $ef CARDFLIP_LIGHT_ON EQU "♀" ; $f5 -CARDFLIP_DECK_SIZE EQU 4 * 6 +CARDFLIP_DECK_SIZE EQUS "(wDeckEnd - wDeck)" + assert wDiscardPileEnd - wDiscardPile == wDeckEnd - wDeck DummyGameGFX: ; Graphics for an unused Game Corner @@ -577,7 +578,7 @@ CardFlip_CopyOAM: jr nz, .loop ret -CardFlip_ShiftDigitsUpOnePixel: +CardFlip_ShiftDigitsUpOnePixel: ; unreferenced ; The top rows of digits 1-9 become the bottom rows of 0-8, ; so this routine relies on the top rows being blank. ld de, vTiles0 tile "0" diff --git a/engine/games/dummy_game.asm b/engine/games/dummy_game.asm index a1ab49f2..8f03e66c 100644 --- a/engine/games/dummy_game.asm +++ b/engine/games/dummy_game.asm @@ -20,7 +20,7 @@ _DummyGame: ld a, BANK(DummyGameGFX) call FarCopyBytes ld a, $8 - ld hl, wc508 + ld hl, wSpriteAnimDict ld [hli], a ld [hl], $0 hlcoord 0, 0 diff --git a/engine/gfx/cgb_layouts.asm b/engine/gfx/cgb_layouts.asm index 5fb23062..70c4a29c 100644 --- a/engine/gfx/cgb_layouts.asm +++ b/engine/gfx/cgb_layouts.asm @@ -308,7 +308,7 @@ Function95a0: ; unreferenced call LoadHLPaletteIntoDE jr .GotPalette -.GetMonPalette: +.GetMonPalette: ; unreferenced ld bc, wTempMonDVs call GetPlayerOrMonPalettePointer call LoadPalette_White_Col1_Col2_Black diff --git a/engine/gfx/color.asm b/engine/gfx/color.asm index d03724f8..fd42d597 100644 --- a/engine/gfx/color.asm +++ b/engine/gfx/color.asm @@ -15,31 +15,31 @@ CheckShininess: ; Attack ld a, [hl] and 1 << SHINY_ATK_BIT - jr z, .NotShiny + jr z, .not_shiny ; Defense ld a, [hli] and $f cp SHINY_DEF_VAL - jr nz, .NotShiny + jr nz, .not_shiny ; Speed ld a, [hl] and $f0 cp SHINY_SPD_VAL << 4 - jr nz, .NotShiny + jr nz, .not_shiny ; Special ld a, [hl] and $f cp SHINY_SPC_VAL - jr nz, .NotShiny + jr nz, .not_shiny -.Shiny: +; shiny scf ret -.NotShiny: +.not_shiny and a ret @@ -49,30 +49,30 @@ Unused_CheckShininess: ; Attack ld a, [hl] cp 10 << 4 - jr c, .NotShiny + jr c, .not_shiny ; Defense ld a, [hli] and $f cp 10 - jr c, .NotShiny + jr c, .not_shiny ; Speed ld a, [hl] cp 10 << 4 - jr c, .NotShiny + jr c, .not_shiny ; Special ld a, [hl] and $f cp 10 - jr c, .NotShiny + jr c, .not_shiny -.Shiny: +; shiny scf ret -.NotShiny: +.not_shiny and a ret @@ -894,7 +894,7 @@ PushSGBBorder: .LoadSGBBorderPointers: ld hl, SGBBorderGFX - ld de, SGBBorderMap + ld de, SGBBorderMapAndPalettes ret SGB_ClearVRAM: @@ -1091,24 +1091,24 @@ INCLUDE "data/sgb_ctrl_packets.asm" PredefPals: INCLUDE "gfx/sgb/predef.pal" -IF DEF(_GOLD) -SGBBorderMap: +SGBBorderMapAndPalettes: ; interleaved tile ids and palette ids, without the center 20x18 screen area +IF DEF(_GOLD) INCBIN "gfx/sgb/gold_border.sgb.tilemap" -SGBBorderPalettes: -; assumed to come after SGBBorderMap -INCLUDE "gfx/sgb/gold_border.pal" -SGBBorderGFX: -INCBIN "gfx/sgb/gold_border.2bpp" - ELIF DEF(_SILVER) -SGBBorderMap: -; interleaved tile ids and palette ids, without the center 20x18 screen area INCBIN "gfx/sgb/silver_border.sgb.tilemap" -SGBBorderPalettes: -; assumed to come after SGBBorderMap +ENDC +; four SGB palettes of 16 colors each; only the first 4 colors are used +IF DEF(_GOLD) +INCLUDE "gfx/sgb/gold_border.pal" +ELIF DEF(_SILVER) INCLUDE "gfx/sgb/silver_border.pal" +ENDC + SGBBorderGFX: +IF DEF(_GOLD) +INCBIN "gfx/sgb/gold_border.2bpp" +ELIF DEF(_SILVER) INCBIN "gfx/sgb/silver_border.2bpp" ENDC @@ -1225,7 +1225,7 @@ INCLUDE "gfx/diploma/diploma.pal" PartyMenuOBPals: INCLUDE "gfx/stats/party_menu_ob.pal" -UnusedBattleObjectPals: +UnusedBattleObjectPals: ; unreferenced INCLUDE "gfx/battle_anims/unused_battle_anims.pal" GSTitleBGPals: diff --git a/engine/gfx/load_font.asm b/engine/gfx/load_font.asm index f8289ded..b41badc2 100644 --- a/engine/gfx/load_font.asm +++ b/engine/gfx/load_font.asm @@ -94,7 +94,7 @@ LoadStatsScreenPageTilesGFX: call Get2bpp ret -LoadFontsBattleLevel: +LoadFontsBattleLevel: ; unreferenced ld de, FontBattleExtra + 14 tiles ld hl, vTiles2 tile "<LV>" ; $6e lb bc, BANK(FontBattleExtra), 1 diff --git a/engine/gfx/load_pics.asm b/engine/gfx/load_pics.asm index 9109a7f9..563c0d8b 100644 --- a/engine/gfx/load_pics.asm +++ b/engine/gfx/load_pics.asm @@ -69,7 +69,6 @@ GetFrontpic: cp EGG + 1 ret nc -.is_a_pokemon push de call GetBaseData ld a, [wBasePicSize] @@ -133,7 +132,6 @@ GetMonBackpic: cp EGG + 1 ret nc -.is_a_pokemon push de ld a, BANK(sDecompressBuffer) call OpenSRAM diff --git a/engine/items/item_effects.asm b/engine/items/item_effects.asm index a00aee8c..f9eeebec 100644 --- a/engine/items/item_effects.asm +++ b/engine/items/item_effects.asm @@ -1029,14 +1029,13 @@ LevelBallMultiplier: ld b, $ff ret -; These two texts were carried over from gen 1. -; They are not used in gen 2, and are dummied out. +; BallDodgedText and BallMissedText were used in Gen 1. -BallDodgedText: +BallDodgedText: ; unreferenced text_far _BallDodgedText text_end -BallMissedText: +BallMissedText: ; unreferenced text_far _BallMissedText text_end @@ -1864,14 +1863,14 @@ LoadCurHPIntoBuffer5: ld [wBuffer5], a ret -LoadHPIntoBuffer5: +LoadHPIntoBuffer5: ; unreferenced ld a, d ld [wBuffer6], a ld a, e ld [wBuffer5], a ret -LoadHPFromBuffer5: +LoadHPFromBuffer5: ; unreferenced ld a, [wBuffer6] ld d, a ld a, [wBuffer5] @@ -2315,7 +2314,6 @@ RestorePPEffect: jr c, .do_ppup .CantUsePPUpOnSketch: -.pp_is_maxed_out ld hl, PPIsMaxedOutText call PrintText jr .loop2 @@ -2612,16 +2610,17 @@ WontHaveAnyEffectMessage: ld hl, ItemWontHaveEffectText jr CantUseItemMessage -BelongsToSomeoneElseMessage: +BelongsToSomeoneElseMessage: ; unreferenced ld hl, ItemBelongsToSomeoneElseText jr CantUseItemMessage -CyclingIsntAllowedMessage: +CyclingIsntAllowedMessage: ; unreferenced ld hl, NoCyclingText jr CantUseItemMessage -CantGetOnYourBikeMessage: +CantGetOnYourBikeMessage: ; unreferenced ld hl, ItemCantGetOnText + ; fallthrough CantUseItemMessage: ; Item couldn't be used. @@ -2673,11 +2672,11 @@ ItemUsedText: text_far _ItemUsedText text_end -ItemGotOnText: +ItemGotOnText: ; unreferenced text_far _ItemGotOnText text_end -ItemGotOffText: +ItemGotOffText: ; unreferenced text_far _ItemGotOffText text_end diff --git a/engine/items/items.asm b/engine/items/items.asm index 78b0e2cd..42381b41 100644 --- a/engine/items/items.asm +++ b/engine/items/items.asm @@ -481,7 +481,7 @@ GetNumberedTMHM: jr c, .done cp ITEM_DC - (TM01 - 1) - 1 jr c, .skip_one -.skip_two +; skip two inc a .skip_one inc a diff --git a/engine/items/pack.asm b/engine/items/pack.asm index b3e1c5f1..994c7c5a 100644 --- a/engine/items/pack.asm +++ b/engine/items/pack.asm @@ -1520,7 +1520,7 @@ PC_Mart_BallsPocketMenuHeader: dba PlaceMenuItemQuantity dba UpdateItemDescription -PackNoItemText: +PackNoItemText: ; unreferenced text_far _PackNoItemText text_end @@ -1560,7 +1560,7 @@ PackEmptyText: text_far _PackEmptyText text_end -YouCantUseItInABattleText: +YouCantUseItInABattleText: ; unreferenced text_far _YouCantUseItInABattleText text_end diff --git a/engine/items/tmhm.asm b/engine/items/tmhm.asm index e7c622d7..0a14ca50 100644 --- a/engine/items/tmhm.asm +++ b/engine/items/tmhm.asm @@ -76,7 +76,6 @@ ChooseMonToLearnTMHM: ld bc, 12 call CopyBytes call ClearBGPalettes -ChooseMonToLearnTMHM_NoRefresh: farcall LoadPartyMenuGFX farcall InitPartyMenuWithCancel farcall InitPartyMenuGFX @@ -158,7 +157,7 @@ TeachTMHM: and a ret -.unused +.didnt_use ; unreferenced ld a, 2 ld [wItemEffectSucceeded], a .learned_move diff --git a/engine/link/link.asm b/engine/link/link.asm index 789e3d5e..ba2ae115 100644 --- a/engine/link/link.asm +++ b/engine/link/link.asm @@ -105,8 +105,8 @@ Gen2ToGen1LinkComms: ld de, wLinkData ld bc, $1a2 call Link_CopyOTData - ld de, wPlayerTrademonSpecies - ld hl, wTimeCapsulePartyMon1Species + ld de, wPlayerTrademon + ld hl, wTimeCapsulePlayerData ld c, 2 .loop ld a, [de] @@ -160,7 +160,7 @@ Gen2ToGen1LinkComms: .done_party ld [de], a - ld hl, wTimeCapsulePartyMon1Species + ld hl, wTimeCapsulePlayerData call Link_ConvertPartyStruct1to2 ld a, LOW(wOTPartyMonOT) ld [wUnusedCFFE], a @@ -251,8 +251,8 @@ Gen2ToGen2LinkComms: ld de, wLinkData ld bc, $1b9 call Link_CopyOTData - ld de, wPlayerTrademonSpecies - ld hl, wLinkPlayerPartyMon1Species + ld de, wPlayerTrademon + ld hl, wLinkPlayerData ld c, 2 .loop1 ld a, [de] @@ -525,7 +525,7 @@ FixDataForLinkTransfer: ld [hli], a dec b jr nz, .loop3 - ld hl, wTimeCapsulePartyMon1 - 1 + PARTY_LENGTH + ld hl, wTimeCapsulePlayerData - 1 + PARTY_LENGTH ld de, wc512 lb bc, 0, 0 .loop4 diff --git a/engine/link/mystery_gift.asm b/engine/link/mystery_gift.asm index dcea2e8c..0d90ba9d 100644 --- a/engine/link/mystery_gift.asm +++ b/engine/link/mystery_gift.asm @@ -1020,7 +1020,7 @@ MysteryGift_CopyReceivedDecosToPC: .skip inc c ld a, c - cp TrophyIDs - DecorationIDs + cp NUM_NON_TROPHY_DECOS jr c, .loop jp CloseSRAM diff --git a/engine/link/mystery_gift_2.asm b/engine/link/mystery_gift_2.asm index 493db05c..9c524182 100644 --- a/engine/link/mystery_gift_2.asm +++ b/engine/link/mystery_gift_2.asm @@ -2,23 +2,23 @@ PrepMysteryGiftDataToSend: ld de, wMysteryGiftStaging ld a, $1 + GS_VERSION ld [de], a - inc de ; wc701 + inc de ; wMysteryGiftStaging+1 ld a, BANK(sGameData) call OpenSRAM ld hl, sPlayerData + wPlayerID - wPlayerData ld a, [hli] ld [de], a ld b, a - inc de ; wc702 + inc de ; wMysteryGiftStaging+2 ld a, [hl] ld [de], a ld c, a - inc de ; wc703 + inc de ; wMysteryGiftStaging+3 push bc ld hl, sPlayerData + wPlayerName - wPlayerData ld bc, NAME_LENGTH call CopyBytes - push de ; wc70e + push de ; wMysteryGiftStaging+14 ld hl, sPokemonData + wPokedexCaught - wPokemonData ld b, wEndPokedexCaught - wPokedexCaught call CountSetBits @@ -26,21 +26,21 @@ PrepMysteryGiftDataToSend: pop bc ld a, [wNumSetBits] ld [de], a - inc de ; wc70f + inc de ; wMysteryGiftStaging+15 call CloseSRAM call Random and 1 ld [de], a - inc de ; wc710 + inc de ; wMysteryGiftStaging+16 call .RandomSample ld [de], a - inc de ; wc711 + inc de ; wMysteryGiftStaging+17 ld a, c ld c, b ld b, a call .RandomSample ld [de], a - inc de ; wc712 + inc de ; wMysteryGiftStaging+18 ld a, BANK(sBackupMysteryGiftItem) call OpenSRAM ld a, [sBackupMysteryGiftItem] diff --git a/engine/menus/main_menu.asm b/engine/menus/main_menu.asm index 6f8727a7..20c74336 100644 --- a/engine/menus/main_menu.asm +++ b/engine/menus/main_menu.asm @@ -218,20 +218,19 @@ MainMenu_PrintCurrentTimeAndDay: call PrintNum ret -.min -; unused +.minString: ; unreferenced db "min.@" .PrintTimeNotSet: hlcoord 1, 14 - ld de, .TimeNotSet + ld de, .TimeNotSetString call PlaceString ret -.TimeNotSet: +.TimeNotSetString: db "TIME NOT SET@" -.MainMenuTimeUnknownText: +.MainMenuTimeUnknownText: ; unreferenced text_far _MainMenuTimeUnknownText text_end diff --git a/engine/menus/menu_2.asm b/engine/menus/menu_2.asm index 6566e48d..99a0f74b 100644 --- a/engine/menus/menu_2.asm +++ b/engine/menus/menu_2.asm @@ -157,18 +157,18 @@ StartMenu_PrintBugContestStatus: set NO_TEXT_SCROLL, [hl] call StartMenu_DrawBugContestStatusBox hlcoord 1, 5 - ld de, .Balls_EN + ld de, .BallsString call PlaceString hlcoord 8, 5 ld de, wParkBallsRemaining lb bc, PRINTNUM_LEFTALIGN | 1, 2 call PrintNum hlcoord 1, 1 - ld de, .CAUGHT + ld de, .CaughtString call PlaceString ld a, [wContestMon] and a - ld de, .None + ld de, .NoneString jr z, .no_contest_mon ld [wNamedObjectIndexBuffer], a call GetPokemonName @@ -180,7 +180,7 @@ StartMenu_PrintBugContestStatus: and a jr z, .skip_level hlcoord 1, 3 - ld de, .LEVEL + ld de, .LevelString call PlaceString ld a, [wContestMonLevel] ld h, b @@ -194,15 +194,15 @@ StartMenu_PrintBugContestStatus: ld [wOptions], a ret -.Balls_JP: +.BallsJPString: ; unreferenced db "ボール こ@" -.CAUGHT: +.CaughtString: db "CAUGHT@" -.Balls_EN: +.BallsString: db "BALLS:@" -.None: +.NoneString: db "None@" -.LEVEL: +.LevelString: db "LEVEL@" Kurt_SelectApricorn: diff --git a/engine/menus/naming_screen.asm b/engine/menus/naming_screen.asm index a0b5cba3..39d930ab 100644 --- a/engine/menus/naming_screen.asm +++ b/engine/menus/naming_screen.asm @@ -253,6 +253,7 @@ NamingScreen_InitText: NamingScreen_ApplyTextInputMode: call NamingScreen_IsTargetBox jr nz, .not_box + assert BoxNameInputLower - NameInputLower == BoxNameInputUpper - NameInputUpper ld hl, BoxNameInputLower - NameInputLower add hl, de ld d, h @@ -865,7 +866,7 @@ INCBIN "gfx/naming_screen/cursor.2bpp" INCLUDE "data/text/name_input_chars.asm" -NamingScreenGFX_End: ; unused +NamingScreenGFX_End: ; unreferenced INCBIN "gfx/naming_screen/end.1bpp" NamingScreenGFX_MiddleLine: diff --git a/engine/menus/trainer_card.asm b/engine/menus/trainer_card.asm index 6f2ef316..de34057f 100644 --- a/engine/menus/trainer_card.asm +++ b/engine/menus/trainer_card.asm @@ -44,10 +44,10 @@ TrainerCard: call ClearTilemap call DisableLCD - ld hl, ChrisCardPic + ld hl, ChrisPicAndTrainerCardGFX ld de, vTiles2 - ld bc, 41 tiles - ld a, BANK(ChrisCardPic) + ld bc, (35 + 6) tiles + ld a, BANK(ChrisPicAndTrainerCardGFX) call FarCopyBytes ld hl, CardStatusGFX @@ -619,8 +619,10 @@ TrainerCard_JohtoBadgesOAM: db $1c, $20, $24, $20 | (1 << 7) db $1c | (1 << 7), $20, $24, $20 | (1 << 7) -ChrisCardPic: INCBIN "gfx/trainer_card/chris_card.2bpp" -CardGFX: INCBIN "gfx/trainer_card/trainer_card.2bpp" +ChrisPicAndTrainerCardGFX: +INCBIN "gfx/trainer_card/chris_card.2bpp" +INCBIN "gfx/trainer_card/trainer_card.2bpp" + CardStatusGFX: INCBIN "gfx/trainer_card/card_status.2bpp" LeaderGFX: INCBIN "gfx/trainer_card/leaders.2bpp" diff --git a/engine/movie/credits.asm b/engine/movie/credits.asm index 1c8bc31f..a1b91d7e 100644 --- a/engine/movie/credits.asm +++ b/engine/movie/credits.asm @@ -193,7 +193,7 @@ Credits_RequestGFX: xor a ldh [hBGMapMode], a ld a, 8 - ld [wRequested2bpp], a + ld [wRequested2bppSize], a jp Credits_Next Credits_LYOverride: diff --git a/engine/movie/evolution_animation.asm b/engine/movie/evolution_animation.asm index e6d975b0..b3af9a72 100644 --- a/engine/movie/evolution_animation.asm +++ b/engine/movie/evolution_animation.asm @@ -65,7 +65,6 @@ EvolutionAnimation: ld c, TRUE call .GetSGBLayout -.AnimationSequence: call ClearJoypad lb bc, 1, 16 ; flash b times, wait c frames in between .loop diff --git a/engine/overworld/cmd_queue.asm b/engine/overworld/cmd_queue.asm index 6a598438..1994220e 100644 --- a/engine/overworld/cmd_queue.asm +++ b/engine/overworld/cmd_queue.asm @@ -148,7 +148,7 @@ CmdQueues_IncAnonJumptableIndex: inc [hl] ret -CmdQueues_DecAnonJumptableIndex: +CmdQueues_DecAnonJumptableIndex: ; unreferenced ld hl, CMDQUEUE_05 add hl, bc dec [hl] @@ -163,7 +163,7 @@ CmdQueue_Type1: CmdQueue_Type4: call CmdQueues_AnonJumptable - ; anonymous dw +.anon_dw dw .zero dw .one diff --git a/engine/overworld/decorations.asm b/engine/overworld/decorations.asm index e7a882ae..8f8257bc 100644 --- a/engine/overworld/decorations.asm +++ b/engine/overworld/decorations.asm @@ -932,7 +932,7 @@ GetDecorationID: pop hl ret -SetAllDecorationFlags: +SetAllDecorationFlags: ; unreferenced ld hl, DecorationIDs .loop ld a, [hli] diff --git a/engine/overworld/events.asm b/engine/overworld/events.asm index f21ea17b..fda0149e 100644 --- a/engine/overworld/events.asm +++ b/engine/overworld/events.asm @@ -25,76 +25,76 @@ OverworldLoop:: DisableEvents: xor a - ld [wScriptFlags3], a + ld [wScriptFlags2], a ret EnableEvents:: ld a, $ff - ld [wScriptFlags3], a + ld [wScriptFlags2], a ret -CheckBit5_ScriptFlags3: - ld hl, wScriptFlags3 +CheckBit5_ScriptFlags2: + ld hl, wScriptFlags2 bit 5, [hl] ret -DisableWarpsConnxns: - ld hl, wScriptFlags3 +DisableWarpsConnxns: ; unreferenced + ld hl, wScriptFlags2 res 2, [hl] ret -DisableCoordEvents: - ld hl, wScriptFlags3 +DisableCoordEvents: ; unreferenced + ld hl, wScriptFlags2 res 1, [hl] ret -DisableStepCount: - ld hl, wScriptFlags3 +DisableStepCount: ; unreferenced + ld hl, wScriptFlags2 res 0, [hl] ret -DisableWildEncounters: - ld hl, wScriptFlags3 +DisableWildEncounters: ; unreferenced + ld hl, wScriptFlags2 res 4, [hl] ret -EnableWarpsConnxns: - ld hl, wScriptFlags3 +EnableWarpsConnxns: ; unreferenced + ld hl, wScriptFlags2 set 2, [hl] ret -EnableCoordEvents: - ld hl, wScriptFlags3 +EnableCoordEvents: ; unreferenced + ld hl, wScriptFlags2 set 1, [hl] ret -EnableStepCount: - ld hl, wScriptFlags3 +EnableStepCount: ; unreferenced + ld hl, wScriptFlags2 set 0, [hl] ret EnableWildEncounters: - ld hl, wScriptFlags3 + ld hl, wScriptFlags2 set 4, [hl] ret CheckWarpConnxnScriptFlag: - ld hl, wScriptFlags3 + ld hl, wScriptFlags2 bit 2, [hl] ret CheckCoordEventScriptFlag: - ld hl, wScriptFlags3 + ld hl, wScriptFlags2 bit 1, [hl] ret CheckStepCountScriptFlag: - ld hl, wScriptFlags3 + ld hl, wScriptFlags2 bit 0, [hl] ret CheckWildEncountersScriptFlag: - ld hl, wScriptFlags3 + ld hl, wScriptFlags2 bit 4, [hl] ret @@ -133,7 +133,7 @@ EnterMap: ld [wMapStatus], a ret -UnusedWait30Frames: +UnusedWait30Frames: ; unreferenced ld c, 30 call DelayFrames ret @@ -245,7 +245,7 @@ PlayerEvents: and a ret nz - call Dummy_CheckScriptFlags3Bit5 ; This is a waste of time + call Dummy_CheckScriptFlags2Bit5 ; This is a waste of time call CheckTrainerBattle_GetPlayerEvent jr c, .ok @@ -382,8 +382,8 @@ SetMinTwoStepWildEncounterCooldown: ld [wWildEncounterCooldown], a ret -Dummy_CheckScriptFlags3Bit5: - call CheckBit5_ScriptFlags3 +Dummy_CheckScriptFlags2Bit5: + call CheckBit5_ScriptFlags2 ret z call SetXYCompareFlags ret @@ -468,8 +468,8 @@ CheckTimeEvents: scf ret -.unused - ld a, 8 +.unused ; unreferenced + ld a, $8 ; ??? scf ret diff --git a/engine/overworld/load_map_part.asm b/engine/overworld/load_map_part.asm index 4e8e228b..c91d8c98 100644 --- a/engine/overworld/load_map_part.asm +++ b/engine/overworld/load_map_part.asm @@ -136,7 +136,6 @@ ForceApplyFlashlight4: ; unreferenced decoord 8, 8 ld bc, (SURROUNDING_WIDTH + 1) * 8 add hl, bc -.loop ld a, [hli] ld [de], a inc de diff --git a/engine/overworld/map_objects.asm b/engine/overworld/map_objects.asm index db82248e..3d3b1cab 100644 --- a/engine/overworld/map_objects.asm +++ b/engine/overworld/map_objects.asm @@ -2823,18 +2823,17 @@ InitSprites: .InitSprite: xor a -.skip1 ld hl, OBJECT_FLAGS2 add hl, bc ld e, [hl] bit OBJ_FLAGS2_7, e - jr z, .skip2 + jr z, .not_priority or PRIORITY -.skip2 +.not_priority bit USE_OBP1_F, e - jr z, .skip3 + jr z, .not_obp_num or OBP_NUM -.skip3 +.not_obp_num ld hl, OBJECT_PALETTE add hl, bc ld d, a @@ -2844,9 +2843,9 @@ InitSprites: ld d, a xor a bit OVERHEAD_F, e - jr z, .skip4 + jr z, .not_overhead or PRIORITY -.skip4 +.not_overhead ldh [hCurSpriteOAMFlags], a ld hl, OBJECT_SPRITE_TILE add hl, bc diff --git a/engine/overworld/scripting.asm b/engine/overworld/scripting.asm index 19fd15db..295ab35a 100644 --- a/engine/overworld/scripting.asm +++ b/engine/overworld/scripting.asm @@ -1518,8 +1518,6 @@ Script_getcurlandmarkname: ld a, [wMapNumber] ld c, a call GetWorldMapLocation - -ConvertLandmarkToText: ld e, a farcall GetLandmarkName ld de, wStringBuffer1 @@ -2059,8 +2057,7 @@ Script_warpcheck: farcall EnableEvents ret -Script_enableevents: -; unused +Script_enableevents: ; unreferenced farcall EnableEvents ret diff --git a/engine/overworld/time.asm b/engine/overworld/time.asm index a829cd4f..4860c06c 100644 --- a/engine/overworld/time.asm +++ b/engine/overworld/time.asm @@ -158,7 +158,7 @@ CheckPokerusTick:: xor a ret -SetUnusedTwoDayTimer: +SetUnusedTwoDayTimer: ; unreferenced ld a, 2 ld hl, wUnusedTwoDayTimer ld [hl], a @@ -263,7 +263,7 @@ UpdateTimeRemaining: scf ret -GetSecondsSinceIfLessThan60: +GetSecondsSinceIfLessThan60: ; unreferenced ld a, [wDaysSince] and a jr nz, GetTimeElapsed_ExceedsUnitLimit @@ -285,7 +285,7 @@ GetMinutesSinceIfLessThan60: ld a, [wMinutesSince] ret -GetHoursSinceIfLessThan24: +GetHoursSinceIfLessThan24: ; unreferenced ld a, [wDaysSince] and a jr nz, GetTimeElapsed_ExceedsUnitLimit @@ -304,7 +304,7 @@ CalcDaysSince: xor a jr _CalcDaysSince -CalcHoursDaysSince: +CalcHoursDaysSince: ; unreferenced inc hl xor a jr _CalcHoursDaysSince @@ -378,7 +378,7 @@ CopyDayToHL: ld [hl], a ret -CopyDayHourToHL: +CopyDayHourToHL: ; unreferenced ld a, [wCurDay] ld [hli], a ldh a, [hHours] diff --git a/engine/phone/phone.asm b/engine/phone/phone.asm index 00cbec75..91875012 100644 --- a/engine/phone/phone.asm +++ b/engine/phone/phone.asm @@ -444,7 +444,7 @@ Script_SpecialBillCall:: ld e, PHONE_BILL jp LoadCallerScript -LoadElmCallScript: +Script_SpecialElmCall: ; unreferenced callasm .LoadElmScript pause 30 sjump Script_ReceivePhoneCall @@ -723,7 +723,7 @@ PhoneJustTalkToThemText: text_far _PhoneJustTalkToThemText text_end -PhoneThankYouTextScript: +PhoneThankYouTextScript: ; unreferenced writetext PhoneThankYouText end diff --git a/engine/phone/scripts/elm.asm b/engine/phone/scripts/elm.asm index b93bdc22..6a5a37c7 100644 --- a/engine/phone/scripts/elm.asm +++ b/engine/phone/scripts/elm.asm @@ -95,7 +95,7 @@ ElmPhoneCallerScript: specialphonecall SPECIALCALL_NONE end -.unused +.neat ; unreferenced writetext ElmPhoneGotAholdOfSomethingNeatText specialphonecall SPECIALCALL_NONE end diff --git a/engine/phone/scripts/generic.asm b/engine/phone/scripts/generic.asm index 4587c739..82032641 100644 --- a/engine/phone/scripts/generic.asm +++ b/engine/phone/scripts/generic.asm @@ -74,8 +74,8 @@ PhoneScript_GreetPhone_Female: promptbutton end -; Huey Phone_GenericCall_Male_SkipMon: +; only used by HueyPhoneCalleeScript and HueyPhoneCallerScript special RandomPhoneMon scall PhoneScript_Random2 ifequal 0, Phone_LookingAwesome_Male_SkipMon @@ -83,8 +83,7 @@ Phone_GenericCall_Male_SkipMon: promptbutton sjump PhoneScript_SeeYouLater -; unused -Phone_GenericCall_Female_SkipMon: +Phone_GenericCall_Female_SkipMon: ; unreferenced special RandomPhoneMon scall PhoneScript_Random2 ifequal 0, Phone_DressedUp_Female_SkipMon @@ -92,13 +91,11 @@ Phone_GenericCall_Female_SkipMon: promptbutton sjump PhoneScript_ByeBye -; Huey Phone_LookingAwesome_Male_SkipMon: writetext PhoneMaleLookingAwesomeText promptbutton sjump PhoneScript_ByeBye -; unused Phone_DressedUp_Female_SkipMon: writetext PhoneFemaleDressedUpText promptbutton diff --git a/engine/pokedex/pokedex.asm b/engine/pokedex/pokedex.asm index fe89a551..90aa56c4 100644 --- a/engine/pokedex/pokedex.asm +++ b/engine/pokedex/pokedex.asm @@ -1166,7 +1166,7 @@ Pokedex_DrawDexEntryScreenBG: call Pokedex_PlaceFrontpicTopLeftCorner ret -.Unused: +.Number: ; unreferenced db $5c, $5d, -1 ; No. .Height: db "HT ?", $5e, "??", $5f, -1 ; HT ?'??" @@ -2487,14 +2487,14 @@ Pokedex_LoadUnownFont: ld a, BANK(sScratch) call OpenSRAM ld hl, UnownFont - ld de, sScratch + $188 + ld de, sDecompressBuffer ld bc, 39 tiles ld a, BANK(UnownFont) call FarCopyBytes - ld hl, sScratch + $188 + ld hl, sDecompressBuffer ld bc, (NUM_UNOWN + 1) tiles call Pokedex_InvertTiles - ld de, sScratch + $188 + ld de, sDecompressBuffer ld hl, vTiles2 tile FIRST_UNOWN_CHAR lb bc, BANK(Pokedex_LoadUnownFont), NUM_UNOWN + 1 call Request2bpp diff --git a/engine/pokegear/pokegear.asm b/engine/pokegear/pokegear.asm index be155618..f793e52e 100644 --- a/engine/pokegear/pokegear.asm +++ b/engine/pokegear/pokegear.asm @@ -1520,7 +1520,7 @@ RadioChannels: jr z, .johto cp KANTO_LANDMARK jr c, .johto -.kanto +; kanto and a ret @@ -2216,7 +2216,7 @@ FlyMap: ; The first 46 locations are part of Johto. The rest are in Kanto. cp KANTO_LANDMARK jr nc, .KantoFlyMap -.JohtoFlyMap: +; Johto fly map ; Note that .NoKanto should be modified in tandem with this branch push af ld a, JOHTO_FLYPOINT ; first Johto flypoint @@ -2512,7 +2512,7 @@ Pokedex_GetArea: jr z, .johto cp KANTO_LANDMARK jr c, .johto -.kanto +; kanto ld a, [wTownMapCursorLandmark] and a jr z, .clear diff --git a/engine/pokegear/radio.asm b/engine/pokegear/radio.asm index 2cc8c1bb..2238424e 100644 --- a/engine/pokegear/radio.asm +++ b/engine/pokegear/radio.asm @@ -119,7 +119,7 @@ PrintRadioLine: ld [wRadioTextDelay], a ret -ReplacePeriodsWithSpaces: +ReplacePeriodsWithSpaces: ; unreferenced push hl ld b, SCREEN_WIDTH * 2 .loop @@ -127,7 +127,6 @@ ReplacePeriodsWithSpaces: cp "." jr nz, .next ld [hl], " " - .next inc hl dec b @@ -1378,7 +1377,7 @@ CopyRadioTextToRAM: cp TX_FAR jp z, FarCopyRadioText ld de, wRadioText - ld bc, SCREEN_WIDTH * 2 + ld bc, 2 * SCREEN_WIDTH jp CopyBytes StartRadioStation: diff --git a/engine/pokemon/bills_pc.asm b/engine/pokemon/bills_pc.asm index 6e3125db..e02a0463 100644 --- a/engine/pokemon/bills_pc.asm +++ b/engine/pokemon/bills_pc.asm @@ -101,7 +101,7 @@ _DepositPKMN: ld [wJumptableIndex], a ret -.go_back +.go_back ; unreferenced ld hl, wJumptableIndex dec [hl] ret @@ -343,7 +343,7 @@ _WithdrawPKMN: ld [wJumptableIndex], a ret -.unused +.go_back ; unreferenced ld hl, wJumptableIndex dec [hl] ret @@ -594,7 +594,7 @@ _MovePKMNWithoutMail: ld [wJumptableIndex], a ret -.unused +.go_back ; unreferenced ld hl, wJumptableIndex dec [hl] ret @@ -2200,7 +2200,7 @@ PCString_ReleasedPKMN: db "Released <PK><MN>.@" PCString_Bye: db "Bye,@" PCString_Stored: db "Stored @" PCString_Got: db "Got @" -PCString_Non: db "Non.@" +PCString_Non: db "Non.@" ; unreferenced PCString_BoxFull: db "The BOX is full.@" PCString_PartyFull: db "The party's full!@" PCString_NoReleasingEGGS: db "No releasing EGGS!@" @@ -2246,16 +2246,16 @@ _ChangeBox_MenuHeader: dw .MenuData db 1 ; default option -.MenuData +.MenuData: db SCROLLINGMENU_CALL_FUNCTION3_NO_SWITCH | SCROLLINGMENU_ENABLE_FUNCTION3 ; flags db 4, 0 ; rows, columns db SCROLLINGMENU_ITEMS_NORMAL ; item format - dba .boxes - dba .boxnames + dba .Boxes + dba .PrintBoxNames dba NULL dba BillsPC_PrintBoxCountAndCapacity -.boxes +.Boxes: db NUM_BOXES x = 1 rept NUM_BOXES @@ -2264,7 +2264,7 @@ x = x + 1 endr db -1 -.boxnames +.PrintBoxNames: push de ld a, [wMenuSelection] dec a diff --git a/engine/pokemon/breedmon_level_growth.asm b/engine/pokemon/breedmon_level_growth.asm index c6356dd6..f64bd6ca 100644 --- a/engine/pokemon/breedmon_level_growth.asm +++ b/engine/pokemon/breedmon_level_growth.asm @@ -1,5 +1,5 @@ GetBreedMon1LevelGrowth: - ld hl, wBreedMon1Stats + ld hl, wBreedMon1 ld de, wTempMon ld bc, BOXMON_STRUCT_LENGTH call CopyBytes @@ -13,7 +13,7 @@ GetBreedMon1LevelGrowth: ret GetBreedMon2LevelGrowth: - ld hl, wBreedMon2Stats + ld hl, wBreedMon2 ld de, wTempMon ld bc, BOXMON_STRUCT_LENGTH call CopyBytes diff --git a/engine/pokemon/mail.asm b/engine/pokemon/mail.asm index 9da39149..37a5f8f6 100644 --- a/engine/pokemon/mail.asm +++ b/engine/pokemon/mail.asm @@ -8,7 +8,7 @@ SendMailToPC: cp MAILBOX_CAPACITY jr nc, .full ld bc, MAIL_STRUCT_LENGTH - ld hl, sMailbox + ld hl, sMailboxes call AddNTimes ld d, h ld e, l @@ -44,7 +44,7 @@ DeleteMailFromPC: call OpenSRAM ld a, b push bc - ld hl, sMailbox + ld hl, sMailboxes ld bc, MAIL_STRUCT_LENGTH call AddNTimes push hl @@ -73,7 +73,7 @@ DeleteMailFromPC: ReadMailMessage: ld a, b - ld hl, sMailbox + ld hl, sMailboxes ld bc, MAIL_STRUCT_LENGTH call AddNTimes ld d, h @@ -87,7 +87,7 @@ MoveMailFromPCToParty: push bc ld a, b ld bc, MAIL_STRUCT_LENGTH - ld hl, sMailbox + ld hl, sMailboxes call AddNTimes push hl ld a, [wCurPartyMon] @@ -314,19 +314,19 @@ _PlayerMailBoxMenu: text_end InitMail: -; initialize wMailboxCount and beyond with incrementing values, one per mail -; set z if no mail +; return z if no mail ld a, BANK(sMailboxCount) call OpenSRAM ld a, [sMailboxCount] call CloseSRAM + +; initialize wMailboxCount from sMailboxCount ld hl, wMailboxCount - ld [hli], a + ld [hli], a ; now hl = wMailboxItems and a - jr z, .done ; if no mail, we're done - ; load values in memory with incrementing values starting at wMailboxCount +; initialize wMailboxItems with incrementing values starting at 1 ld b, a ld a, 1 .loop @@ -334,6 +334,7 @@ InitMail: inc a dec b jr nz, .loop + .done ld [hl], -1 ; terminate diff --git a/engine/pokemon/mail_2.asm b/engine/pokemon/mail_2.asm index c728b533..b5168580 100644 --- a/engine/pokemon/mail_2.asm +++ b/engine/pokemon/mail_2.asm @@ -385,7 +385,7 @@ LoadBlueSkyMailGFX: ld de, BlueSkyMailGrassGFX ld c, 1 * LEN_1BPP_TILE call LoadMailGFX_Color3 - ld de, MailDragoniteGFX + ld de, MailDragoniteAndSentretGFX ld c, 23 * LEN_1BPP_TILE call LoadMailGFX_Color3 ld de, MailCloudGFX @@ -748,7 +748,7 @@ Mail_Place14TileAlternatingRow: ld b, 14 / 2 jr Mail_PlaceAlternatingRow -Mail_Place16TileAlternatingRow: +Mail_Place16TileAlternatingRow: ; unreferenced push af ld b, 16 / 2 jr Mail_PlaceAlternatingRow @@ -756,6 +756,7 @@ Mail_Place16TileAlternatingRow: Mail_Place18TileAlternatingRow: push af ld b, 18 / 2 + ; fallthrough Mail_PlaceAlternatingRow: .loop @@ -793,16 +794,16 @@ Mail_PlaceAlternatingColumn: pop af ret -Mail_Draw7TileRow: - ld b, $7 +Mail_Draw7TileRow: ; unreferenced + ld b, 7 jr Mail_DrawRowLoop Mail_Draw13TileRow: - ld b, $d + ld b, 13 jr Mail_DrawRowLoop Mail_Draw16TileRow: - ld b, $10 + ld b, 16 jr Mail_DrawRowLoop Mail_DrawTopBottomBorder: @@ -811,6 +812,7 @@ Mail_DrawTopBottomBorder: Mail_DrawFullWidthBorder: ld b, SCREEN_WIDTH + ; fallthrough Mail_DrawRowLoop: .loop diff --git a/engine/pokemon/move_mon.asm b/engine/pokemon/move_mon.asm index 36c74140..585d1e78 100644 --- a/engine/pokemon/move_mon.asm +++ b/engine/pokemon/move_mon.asm @@ -1723,7 +1723,6 @@ GivePoke:: ld d, h ld e, l pop hl -.otnameloop ld a, [wScriptBank] call FarCopyBytes ld a, [wCurPartyMon] diff --git a/engine/pokemon/party_menu.asm b/engine/pokemon/party_menu.asm index 1f63ba12..f10248e4 100644 --- a/engine/pokemon/party_menu.asm +++ b/engine/pokemon/party_menu.asm @@ -680,12 +680,10 @@ TeachWhichPKMNString: MoveToWhereString: db "Move to where?@" -ChooseAFemalePKMNString: -; unused +ChooseAFemalePKMNString: ; unreferenced db "Choose a ♀<PK><MN>.@" -ChooseAMalePKMNString: -; unused +ChooseAMalePKMNString: ; unreferenced db "Choose a ♂<PK><MN>.@" ToWhichPKMNString: diff --git a/engine/printer/printer_serial.asm b/engine/printer/printer_serial.asm index 9d0bd907..f717ad38 100644 --- a/engine/printer/printer_serial.asm +++ b/engine/printer/printer_serial.asm @@ -304,7 +304,7 @@ Printer_ResetData: xor a ld [wPrinterSendByteCounter], a ld [wPrinterSendByteCounter + 1], a - ld hl, wGameboyPrinterRAM + ld hl, wGameboyPrinter2bppSource ld bc, wGameboyPrinter2bppSourceEnd - wGameboyPrinter2bppSource call Printer_ByteFill ret @@ -435,10 +435,10 @@ PrinterDataPacket3: PrinterDataPacket4: db 4, 0, $00, 0 dw 4 -PrinterDataPacket5: ; unused +PrinterDataPacket5: ; unreferenced db 8, 0, $00, 0 dw 8 -PrinterDataPacket6: ; unused +PrinterDataPacket6: ; unreferenced db 15, 0, $00, 0 dw 15 diff --git a/engine/smallflag.asm b/engine/smallflag.asm index 04cbfcc2..316ae6aa 100644 --- a/engine/smallflag.asm +++ b/engine/smallflag.asm @@ -36,9 +36,9 @@ SmallFarFlagAction: jr z, .set ; 1 = SET_FLAG dec b jr z, .check ; 2 = CHECK_FLAG -; 0 = RESET_FLAG + ; 0 = RESET_FLAG -.reset +; reset ld a, c cpl and [hl] diff --git a/engine/tilesets/tileset_anims.asm b/engine/tilesets/tileset_anims.asm index 0cef55bb..578a9eea 100644 --- a/engine/tilesets/tileset_anims.asm +++ b/engine/tilesets/tileset_anims.asm @@ -279,7 +279,7 @@ ScrollTileRightLeft: jr nz, ScrollTileLeft jr ScrollTileRight -ScrollTileUpDown: +ScrollTileUpDown: ; unreferenced ; Scroll up for 4 ticks, then down for 4 ticks. ld a, [wTileAnimationTimer] inc a @@ -665,7 +665,7 @@ AnimateWaterPalette: cp %100 ; frame 4 jr z, .color2 -.color1 +; color1 ld hl, wBGPals1 palette PAL_BG_WATER color 1 ld a, [hli] ldh [rBGPD], a |