From 471492b775fc2a0f5162f3d1c13c5472359beb14 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 20 Jul 2015 22:18:18 -0400 Subject: [PATCH] Reverted ld_hl_pointer macro --- audio/engine.asm | 34 +- audio/music/goldenrodcity.asm | 3 +- audio/music/johtowildbattle.asm | 3 +- audio/music/kantowildbattle.asm | 17 +- battle/ai/items.asm | 7 +- battle/ai/scoring.asm | 190 ++++--- battle/anim_commands.asm | 41 +- battle/anim_objects.asm | 111 +++-- battle/bg_effects.asm | 29 +- battle/core.asm | 83 ++-- battle/effect_commands.asm | 92 ++-- battle/hidden_power.asm | 6 +- battle/magikarp_length.asm | 3 +- data/wild/fish.asm | 7 +- engine/color.asm | 67 ++- engine/credits.asm | 17 +- engine/events.asm | 3 +- engine/events_2.asm | 4 +- engine/fruit_trees.asm | 4 +- engine/landmarks.asm | 6 +- engine/map_objects.asm | 13 +- engine/map_setup.asm | 7 +- engine/pack.asm | 6 +- engine/pokedex.asm | 23 +- engine/scripting.asm | 20 +- engine/title.asm | 7 +- event/dratini.asm | 3 +- event/poke_seer.asm | 3 +- gfx/pics/animation.asm | 18 +- home.asm | 21 +- home/audio.asm | 7 +- home/battle.asm | 6 +- home/copy.asm | 7 +- home/cry.asm | 7 +- home/joypad.asm | 13 +- home/map.asm | 23 +- home/map_objects.asm | 6 +- home/menu.asm | 17 +- home/movement.asm | 10 +- home/text.asm | 24 +- home/tilemap.asm | 12 +- home/vblank.asm | 3 +- home/video.asm | 3 +- items/item_descriptions.asm | 3 +- items/item_effects.asm | 28 +- lib/mobile/main.asm | 192 ++++--- main.asm | 856 ++++++++++++++++++-------------- maps/Route24.asm | 2 +- misc/crystal_misc.asm | 14 +- misc/mobile_40.asm | 29 +- misc/mobile_42.asm | 15 +- misc/mobile_45.asm | 298 ++++++----- misc/mobile_5f.asm | 115 +++-- misc/unused_title.asm | 4 +- predef/cgb.asm | 15 +- predef/sgb.asm | 21 +- rst.asm | 3 +- text/types.asm | 3 +- tilesets/animations.asm | 30 +- trainers/dvs.asm | 3 +- 60 files changed, 1538 insertions(+), 1079 deletions(-) diff --git a/audio/engine.asm b/audio/engine.asm index 2842288b2..7a907bccc 100644 --- a/audio/engine.asm +++ b/audio/engine.asm @@ -413,10 +413,9 @@ UpdateChannels: ; e8125 ; hl << 4 ; each wavepattern is $0f bytes long ; so seeking is done in $10s +rept 4 add hl, hl - add hl, hl - add hl, hl - add hl, hl +endr ld de, WaveSamples add hl, de ; load wavepattern into $ff30-$ff3f @@ -1292,8 +1291,9 @@ GetNoiseSample: ; e86c5 ld d, $00 ; load ptr to noise sample set in hl ld hl, Drumkits +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld h, [hl] ld l, a @@ -1306,8 +1306,9 @@ GetNoiseSample: ; e86c5 ; use 'pitch' to seek noise sample set ld e, a ld d, $00 +rept 2 add hl, de - add hl, de +endr ; load sample pointer into NoiseSampleAddress ld a, [hli] ld [NoiseSampleAddressLo], a @@ -1328,8 +1329,9 @@ ParseMusicCommand: ; e870f ld d, $00 ; seek command pointer ld hl, MusicCommands +rept 2 add hl, de - add hl, de +endr ; jump to the new pointer ld a, [hli] ld h, [hl] @@ -1572,8 +1574,9 @@ MusicFB: ; e8817 inc hl ld d, [hl] ; skip pointer +rept 2 inc de - inc de +endr ; update address ld [hl], d dec hl @@ -1623,8 +1626,9 @@ MusicEE; e883e inc hl ld d, [hl] ; skip pointer +rept 2 inc de - inc de +endr ; update address ld [hl], d dec hl @@ -2378,9 +2382,9 @@ _PlayCryHeader:: ; e8b79 ; 3-byte pointers (bank, address) ld hl, Cries +rept 3 add hl, de - add hl, de - add hl, de +endr ld a, [hli] ld [MusicBank], a @@ -2595,9 +2599,9 @@ PlayStereoSFX:: ; e8ca6 ; get sfx ptr ld hl, SFX +rept 3 add hl, de - add hl, de - add hl, de +endr ; bank ld a, [hli] @@ -2692,8 +2696,9 @@ LoadChannel: ; e8d1b ld c, a ld b, $00 ld hl, ChannelPointers +rept 2 add hl, bc - add hl, bc +endr ld c, [hl] inc hl ld b, [hl] ; bc = channel pointer @@ -3157,8 +3162,9 @@ ClearChannels:: ; e8fe9 ; doesn't seem to be used, but functionally identical to SoundRestart ld hl, rNR50 xor a +rept 2 ld [hli], a - ld [hli], a +endr ld a, $80 ld [hli], a ld hl, rNR10 diff --git a/audio/music/goldenrodcity.asm b/audio/music/goldenrodcity.asm index e0e919d5c..cf92246b6 100644 --- a/audio/music/goldenrodcity.asm +++ b/audio/music/goldenrodcity.asm @@ -275,8 +275,9 @@ Music_GoldenrodCity_Ch3: ; eb584 vibrato $8, $23 notetype $c, $25 Music_GoldenrodCity_branch_eb58c: ; eb58c +rept 2 callchannel Music_GoldenrodCity_branch_eb5aa - callchannel Music_GoldenrodCity_branch_eb5aa +endr callchannel Music_GoldenrodCity_branch_eb5d2 note __, 3 octave 3 diff --git a/audio/music/johtowildbattle.asm b/audio/music/johtowildbattle.asm index 505687382..ac53dac2a 100644 --- a/audio/music/johtowildbattle.asm +++ b/audio/music/johtowildbattle.asm @@ -492,8 +492,9 @@ Music_JohtoWildBattle_branch_f5fdb: ; f5fdb note G_, 2 loopchannel 7, Music_JohtoWildBattle_branch_f5fdb note F#, 4 +rept 2 callchannel Music_JohtoWildBattle_branch_f6055 - callchannel Music_JohtoWildBattle_branch_f6055 +endr Music_JohtoWildBattle_branch_f5fe8: ; f5fe8 note D_, 2 note G_, 2 diff --git a/audio/music/kantowildbattle.asm b/audio/music/kantowildbattle.asm index c23a867e3..8eccf2e6b 100644 --- a/audio/music/kantowildbattle.asm +++ b/audio/music/kantowildbattle.asm @@ -325,22 +325,25 @@ Music_KantoWildBattle_branch_ed1c8: ; ed1c8 note F_, 1 note F#, 1 notetype $6, $b7 +rept 2 callchannel Music_KantoWildBattle_branch_ed307 - callchannel Music_KantoWildBattle_branch_ed307 +endr forceoctave $1 +rept 2 callchannel Music_KantoWildBattle_branch_ed307 - callchannel Music_KantoWildBattle_branch_ed307 +endr forceoctave $0 +rept 4 callchannel Music_KantoWildBattle_branch_ed307 - callchannel Music_KantoWildBattle_branch_ed307 - callchannel Music_KantoWildBattle_branch_ed307 - callchannel Music_KantoWildBattle_branch_ed307 +endr forceoctave $1 +rept 2 callchannel Music_KantoWildBattle_branch_ed307 - callchannel Music_KantoWildBattle_branch_ed307 +endr forceoctave $0 +rept 2 callchannel Music_KantoWildBattle_branch_ed307 - callchannel Music_KantoWildBattle_branch_ed307 +endr note __, 16 octave 3 note A#, 16 diff --git a/battle/ai/items.asm b/battle/ai/items.asm index 3a880a00c..5cd3fd7fc 100644 --- a/battle/ai/items.asm +++ b/battle/ai/items.asm @@ -193,9 +193,9 @@ AI_TryItem: ; 38105 jr z, .has_item dec de +rept 3 inc hl - inc hl - inc hl +endr jr .loop .has_item @@ -213,8 +213,9 @@ AI_TryItem: ; 38105 pop de pop hl +rept 2 inc hl - inc hl +endr jr c, .loop .used_item diff --git a/battle/ai/scoring.asm b/battle/ai/scoring.asm index d382011a6..101d4e188 100644 --- a/battle/ai/scoring.asm +++ b/battle/ai/scoring.asm @@ -133,16 +133,18 @@ AI_Setup: ; 385e0 call AI_50_50 jr c, .checkmove +rept 2 dec [hl] - dec [hl] +endr jr .checkmove .discourage call Random cp 30 jr c, .checkmove +rept 2 inc [hl] - inc [hl] +endr jr .checkmove ; 38635 @@ -262,8 +264,9 @@ AI_Offensive: ; 386a2 and a jr nz, .checkmove +rept 2 inc [hl] - inc [hl] +endr jr .checkmove ; 386be @@ -417,8 +420,9 @@ AI_Smart_Sleep: ; 387e3 .asm_387f0 call AI_50_50 ret c +rept 2 dec [hl] - dec [hl] +endr ret ; 387f7 @@ -529,8 +533,9 @@ AI_Smart_LockOn: ; 3881d call AI_50_50 ret c +rept 2 dec [hl] - dec [hl] +endr ret .asm_38882 @@ -555,8 +560,9 @@ AI_Smart_LockOn: ; 3881d cp 180 jr nc, .asm_3888b +rept 2 dec [hl] - dec [hl] +endr jr .asm_3888b .asm_388a2 @@ -596,9 +602,9 @@ AI_Smart_Explosion: ; 388a6 ret c .asm_388c6 +rept 3 inc [hl] - inc [hl] - inc [hl] +endr ret ; 388ca @@ -610,9 +616,9 @@ AI_Smart_DreamEater: ; 388ca call Random cp 25 ret c +rept 3 dec [hl] - dec [hl] - dec [hl] +endr ret ; 388d4 @@ -639,8 +645,9 @@ AI_Smart_EvasionUp: ; 388d4 jr nc, .asm_38911 .asm_388ef +rept 2 dec [hl] - dec [hl] +endr ret .asm_388f2 @@ -669,8 +676,9 @@ AI_Smart_EvasionUp: ; 388d4 jr c, .asm_38911 .asm_3890f +rept 2 inc [hl] - inc [hl] +endr ; 30% chance to end up here if enemy's HP is full and player is not badly poisoned. ; 77% chance to end up here if enemy's HP is above 50% but not full. @@ -714,8 +722,9 @@ AI_Smart_EvasionUp: ; 388d4 call Random cp $50 ret c +rept 2 dec [hl] - dec [hl] +endr ret ; Player is seeded. @@ -747,8 +756,9 @@ AI_Smart_AlwaysHit: ; 38947 call AI_80_20 ret c +rept 2 dec [hl] - dec [hl] +endr ret ; 3895b @@ -818,8 +828,9 @@ AI_Smart_AccuracyDown: ; 38985 jr nc, .asm_389bf .asm_3899d +rept 2 dec [hl] - dec [hl] +endr ret .asm_389a0 @@ -848,8 +859,9 @@ AI_Smart_AccuracyDown: ; 38985 jr c, .asm_389bf .asm_389bd +rept 2 inc [hl] - inc [hl] +endr ; We only end up here if the move has not been already encouraged. .asm_389bf @@ -888,8 +900,9 @@ AI_Smart_AccuracyDown: ; 38985 call Random cp $50 ret c +rept 2 dec [hl] - dec [hl] +endr ret ; Player is seeded. @@ -997,8 +1010,9 @@ AI_Smart_Moonlight: ; 38a3a call Random cp $19 ret c +rept 2 dec [hl] - dec [hl] +endr ret ; 38a4e @@ -1079,8 +1093,9 @@ AI_Smart_Bind: ; 38a71 ret nc call AI_50_50 ret c +rept 2 dec [hl] - dec [hl] +endr ret ; 38a9c @@ -1185,8 +1200,9 @@ AI_Smart_SpDefenseUp2: ; 38aed .asm_38b09 call AI_80_20 ret c +rept 2 dec [hl] - dec [hl] +endr ret .asm_38b10 @@ -1208,9 +1224,9 @@ AI_Smart_Fly: ; 38b12 call AICompareSpeed ret nc +rept 3 dec [hl] - dec [hl] - dec [hl] +endr ret ; 38b20 @@ -1239,8 +1255,9 @@ AI_Smart_Paralyze: ; 38b26 ret nc call AI_80_20 ret c +rept 2 dec [hl] - dec [hl] +endr ret .asm_38b3a @@ -1272,8 +1289,9 @@ AI_Smart_SpeedDownHit: ; 38b40 call Random cp 30 ret c +rept 2 dec [hl] - dec [hl] +endr ret ; 38b5c @@ -1510,14 +1528,15 @@ AI_Smart_Encore: ; 38c3b call Random cp $46 ret c +rept 2 dec [hl] - dec [hl] +endr ret .asm_38c81 +rept 3 inc [hl] - inc [hl] - inc [hl] +endr ret .EncoreMoves: @@ -1587,15 +1606,15 @@ AI_Smart_SleepTalk: ; 38cba cp $1 jr z, .asm_38cc7 +rept 3 dec [hl] - dec [hl] - dec [hl] +endr ret .asm_38cc7 +rept 3 inc [hl] - inc [hl] - inc [hl] +endr ret ; 38ccb @@ -1607,9 +1626,9 @@ AI_Smart_DefrostOpponent: ; 38ccb ld a, [EnemyMonStatus] and $20 ret z +rept 3 dec [hl] - dec [hl] - dec [hl] +endr ret ; 38cd5 @@ -1666,8 +1685,9 @@ AI_Smart_Spite: ; 38cd5 call Random cp $64 ret c +rept 2 dec [hl] - dec [hl] +endr ret ; 38d16 @@ -1708,9 +1728,9 @@ AI_Smart_HealBell: ; 38d1f jr z, .next ; status +rept 3 dec hl - dec hl - dec hl +endr ld a, [hl] or c ld c, a @@ -1735,8 +1755,9 @@ AI_Smart_HealBell: ; 38d1f ret z call AI_50_50 ret c +rept 2 dec [hl] - dec [hl] +endr ret .no_status @@ -1774,9 +1795,9 @@ AI_Smart_PriorityHit: ; 38d5a ld a, [BattleMonHP] sbc b ret nc +rept 3 dec [hl] - dec [hl] - dec [hl] +endr ret ; 38d93 @@ -1900,9 +1921,9 @@ AI_Smart_MeanLook: ; 38dfb .asm_38e26 call AI_80_20 ret c +rept 3 dec [hl] - dec [hl] - dec [hl] +endr ret ; 38e2e @@ -1952,11 +1973,9 @@ AI_Smart_FlameWheel: ; 38e50 ld a, [EnemyMonStatus] bit FRZ, a ret z +rept 5 dec [hl] - dec [hl] - dec [hl] - dec [hl] - dec [hl] +endr ret ; 38e5c @@ -1988,13 +2007,15 @@ AI_Smart_Curse: ; 38e5c ret nc call AI_80_20 ret c +rept 2 dec [hl] - dec [hl] +endr ret .asm_38e90 +rept 2 inc [hl] - inc [hl] +endr .asm_38e92 inc [hl] .asm_38e93 @@ -2044,8 +2065,9 @@ AI_Smart_Curse: ; 38e5c call AI_50_50 ret c +rept 2 dec [hl] - dec [hl] +endr ret ; 38ed2 @@ -2097,8 +2119,9 @@ AI_Smart_Protect: ; 38ed2 call Random cp 20 ret c +rept 2 inc [hl] - inc [hl] +endr ret ; 38f1d @@ -2128,8 +2151,9 @@ AI_Smart_Foresight: ; 38f1d call Random cp 100 ret c +rept 2 dec [hl] - dec [hl] +endr ret ; 38f4a @@ -2235,9 +2259,9 @@ AI_Smart_Endure: ; 38fac call AI_80_20 ret c +rept 3 dec [hl] - dec [hl] - dec [hl] +endr ret .asm_38fcb @@ -2248,8 +2272,9 @@ AI_Smart_Endure: ; 38fac call AI_50_50 ret c +rept 2 dec [hl] - dec [hl] +endr ret .asm_38fd8 @@ -2271,14 +2296,15 @@ AI_Smart_FuryCutter: ; 38fdb cp 2 jr c, .end +rept 2 dec [hl] - dec [hl] +endr cp 3 jr c, .end +rept 3 dec [hl] - dec [hl] - dec [hl] +endr .end @@ -2318,8 +2344,9 @@ AI_Smart_Rollout: ; 38fef call Random cp 200 ret nc +rept 2 dec [hl] - dec [hl] +endr ret .asm_39020 @@ -2379,8 +2406,9 @@ AI_Smart_Earthquake: ; 39044 call AICompareSpeed ret nc +rept 2 dec [hl] - dec [hl] +endr ret .could_dig @@ -2427,8 +2455,9 @@ AI_Smart_Pursuit: ; 39072 .asm_3907d call AI_50_50 ret c +rept 2 dec [hl] - dec [hl] +endr ret ; 39084 @@ -2453,8 +2482,9 @@ AI_Smart_RapidSpin: ; 39084 call AI_80_20 ret c +rept 2 dec [hl] - dec [hl] +endr ret ; 3909e @@ -2581,9 +2611,9 @@ AI_Smart_WeatherMove: ; 3910d ; 3911e AIBadWeatherType: ; 3911e +rept 3 inc [hl] - inc [hl] - inc [hl] +endr ret ; 39122 @@ -2606,8 +2636,9 @@ AIGoodWeatherType: ; 39122 ret nz .good +rept 2 dec [hl] - dec [hl] +endr ret ; 39134 @@ -2702,8 +2733,9 @@ AI_Smart_PsychUp: ; 39152 ret .asm_39188 +rept 2 inc [hl] - inc [hl] +endr ret ; 3918b @@ -2788,8 +2820,9 @@ AI_Smart_Gust: ; 391d5 call AICompareSpeed ret nc +rept 2 dec [hl] - dec [hl] +endr ret ; Try to predict if the player will use Fly this turn. @@ -2816,8 +2849,9 @@ AI_Smart_FutureSight: ; 391f3 and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND ret z +rept 2 dec [hl] - dec [hl] +endr ret ; 39200 @@ -2852,16 +2886,18 @@ AI_Smart_Solarbeam: ; 3920b cp 25 ; 1/10 ret c +rept 2 inc [hl] - inc [hl] +endr ret .asm_3921e call AI_80_20 ret c +rept 2 dec [hl] - dec [hl] +endr ret ; 39225 @@ -2955,8 +2991,9 @@ AICheckPlayerHalfHP: ; 3926e ld c, [hl] sla c rl b +rept 2 inc hl - inc hl +endr ld a, [hld] cp c ld a, [hl] @@ -2976,8 +3013,9 @@ AICheckEnemyHalfHP: ; 39281 ld c, [hl] sla c rl b +rept 2 inc hl - inc hl +endr ld a, [hld] cp c ld a, [hl] @@ -3001,8 +3039,9 @@ AICheckEnemyQuarterHP: ; 39298 rl b sla c rl b +rept 2 inc hl - inc hl +endr ld a, [hld] cp c ld a, [hl] @@ -3024,8 +3063,9 @@ AICheckPlayerQuarterHP: ; 392b3 rl b sla c rl b +rept 2 inc hl - inc hl +endr ld a, [hld] cp c ld a, [hl] @@ -3529,11 +3569,9 @@ AI_Risky: ; 394a9 jr nc, .nextmove pop hl +rept 5 dec [hl] - dec [hl] - dec [hl] - dec [hl] - dec [hl] +endr push hl .nextmove diff --git a/battle/anim_commands.asm b/battle/anim_commands.asm index f5b895d0f..07dece5f7 100644 --- a/battle/anim_commands.asm +++ b/battle/anim_commands.asm @@ -265,9 +265,9 @@ Functioncc23d: ; cc23d ld a, [hl] and $f0 ld [hli], a +rept 3 inc hl - inc hl - inc hl +endr dec c jr nz, .asm_cc249 ret @@ -341,8 +341,9 @@ Functioncc293: ; cc293 ld e, a ld d, 0 ld hl, BattleAnimCommands +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld h, [hl] @@ -488,8 +489,9 @@ BattleAnimCmd_FD: ; cc348 (33:4348) ld e, [hl] inc hl ld d, [hl] +rept 2 inc de - inc de +endr ld [hl], d dec hl ld [hl], e @@ -517,8 +519,9 @@ BattleAnimCmd_EF: ; cc383 (33:4383) ld e, [hl] inc hl ld d, [hl] +rept 2 inc de - inc de +endr ld [hl], d dec hl ld [hl], e @@ -544,8 +547,9 @@ BattleAnimCmd_FB: ; cc3b2 (33:43b2) ld e, [hl] inc hl ld d, [hl] +rept 2 inc de - inc de +endr ld [hl], d dec hl ld [hl], e @@ -572,8 +576,9 @@ BattleAnimCmd_F8: ; cc3d6 (33:43d6) ld e, [hl] inc hl ld d, [hl] +rept 2 inc de - inc de +endr ld [hl], d dec hl ld [hl], e @@ -601,8 +606,9 @@ BattleAnimCmd_EE: ; cc3fa (33:43fa) ld e, [hl] inc hl ld d, [hl] +rept 2 inc de - inc de +endr ld [hl], d dec hl ld [hl], e @@ -700,10 +706,9 @@ BattleAnimCmd_D5: ; cc485 (33:4485) push hl ld l, a ld h, $0 +rept 4 add hl, hl - add hl, hl - add hl, hl - add hl, hl +endr ld de, $8310 add hl, de ld a, [BattleAnimByte] @@ -797,8 +802,9 @@ BattleAnimCmd_D9: ; cc52c (33:452c) ld a, [hl] and a jr z, .asm_cc537 +rept 2 inc hl - inc hl +endr jr .asm_cc52f .asm_cc537 @@ -852,8 +858,9 @@ BattleAnimCmd_DA: ; cc57e (33:457e) ld a, [hl] and a jr z, .asm_cc589 +rept 2 inc hl - inc hl +endr jr .asm_cc581 .asm_cc589 @@ -1243,10 +1250,9 @@ BattleAnimCmd_E1: ; cc807 (33:4807) ld e, a ld d, 0 ld hl, Datacc871 +rept 4 add hl, de - add hl, de - add hl, de - add hl, de +endr ld a, [rSVBK] ; $ff00+$70 push af @@ -1392,8 +1398,9 @@ Functioncc8d3: ; cc8d3 inc hl ld d, [hl] ld hl, BattleAnimations +rept 2 add hl, de - add hl, de +endr call Function3ae1 call BattleAnimAssignPals call BattleAnimDelayFrame diff --git a/battle/anim_objects.asm b/battle/anim_objects.asm index 4f32bd932..5bf3e7c01 100644 --- a/battle/anim_objects.asm +++ b/battle/anim_objects.asm @@ -36,12 +36,9 @@ Functioncc9c4: ; cc9c4 (33:49c4) ld e, a ld d, 0 ld hl, BattleAnimObjects +rept 6 add hl, de - add hl, de - add hl, de - add hl, de - add hl, de - add hl, de +endr ld e, l ld d, h ld hl, $0 @@ -71,8 +68,9 @@ Functioncc9c4: ; cc9c4 (33:49c4) ld a, [BattleAnimTemps + 2] ld [hli], a xor a +rept 2 ld [hli], a - ld [hli], a +endr ld a, [BattleAnimTemps + 3] ld [hli], a xor a @@ -80,8 +78,9 @@ Functioncc9c4: ; cc9c4 (33:49c4) dec a ld [hli], a xor a +rept 2 ld [hli], a - ld [hli], a +endr ld [hl], a ret @@ -516,8 +515,9 @@ Functionccfbe: ; ccfbe ld e, [hl] ld d, 0 ld hl, Jumptable_ccfce +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld h, [hl] ld l, a @@ -670,10 +670,9 @@ Functioncd0a6: ; cd0a6 (33:50a6) ld hl, $f add hl, bc ld a, [hl] +rept 4 inc [hl] - inc [hl] - inc [hl] - inc [hl] +endr ld d, $10 push af push de @@ -937,8 +936,9 @@ Functioncd232: ; cd232 (33:5232) ld [hl], a ld hl, $7 add hl, bc +rept 2 dec [hl] - dec [hl] +endr ret .asm_cd245 call Functioncc9bd @@ -1739,8 +1739,9 @@ Functioncd687: ; cd687 (33:5687) ld [hl], a ld hl, $f add hl, bc +rept 2 inc [hl] - inc [hl] +endr Functioncd6c5: ; cd6c5 (33:56c5) ret @@ -1760,8 +1761,9 @@ Functioncd6d6: ; cd6d6 (33:56d6) call Functioncc9bd ret asm_cd6da: ; cd6da (33:56da) +rept 2 inc a - inc a +endr ld [hl], a sub $10 ret c @@ -2128,8 +2130,9 @@ Functioncd8cc: ; cd8cc (33:58cc) call Functionce7bf ld hl, $f add hl, bc +rept 2 inc [hl] - inc [hl] +endr ld a, [hl] and $1f ret nz @@ -2550,8 +2553,9 @@ Functioncdb28: ; cdb28 (33:5b28) ld a, [hl] cp $98 ret nc +rept 2 inc [hl] - inc [hl] +endr ld hl, $1 add hl, bc set 0, [hl] @@ -2587,8 +2591,9 @@ Functioncdb65: ; cdb65 (33:5b65) ld a, [hl] cp $98 ret nc +rept 2 inc [hl] - inc [hl] +endr ld hl, $f add hl, bc ld a, [hl] @@ -2722,8 +2727,9 @@ Functioncdc27: ; cdc27 (33:5c27) ld hl, $f add hl, bc ld a, [hl] +rept 2 inc [hl] - inc [hl] +endr ld d, $2 call Functionce734 ld hl, $9 @@ -2871,8 +2877,9 @@ Functioncdcfe: ; cdcfe (33:5cfe) ld hl, $10 add hl, bc ld a, [hl] +rept 2 inc [hl] - inc [hl] +endr ld d, $10 call Functionce734 ld d, a @@ -3083,8 +3090,9 @@ Functioncde28: ; cde28 (33:5e28) ld hl, $f add hl, bc ld a, [hl] +rept 2 inc [hl] - inc [hl] +endr ld d, $4 call Functionce734 ld hl, $9 @@ -3112,8 +3120,9 @@ Functioncde54: ; cde54 (33:5e54) ld hl, $f add hl, bc ld a, [hl] +rept 2 dec [hl] - dec [hl] +endr ld d, $10 call Functionce734 ld hl, $a @@ -3353,8 +3362,9 @@ Functioncdf8c: ; cdf8c (33:5f8c) ld [hl], a ld hl, $b add hl, bc +rept 2 inc [hl] - inc [hl] +endr ld a, [hl] and $7 ret nz @@ -3394,8 +3404,9 @@ Functioncdfcb: ; cdfcb (33:5fcb) ld [hl], a ld hl, $b add hl, bc +rept 2 inc [hl] - inc [hl] +endr ld a, [hl] and $3 ret nz @@ -3404,8 +3415,9 @@ Functioncdfcb: ; cdfcb (33:5fcb) ld a, [hl] cp $d0 jr z, .asm_ce007 +rept 2 dec [hl] - dec [hl] +endr ret .asm_ce007 call Functioncc9bd @@ -3930,8 +3942,9 @@ Functionce2cc: ; ce2cc (33:62cc) ld [hl], a ld hl, $10 add hl, bc +rept 2 dec [hl] - dec [hl] +endr ret Functionce2fd: ; ce2fd (33:62fd) @@ -4077,8 +4090,9 @@ Functionce3b4: ; ce3b4 (33:63b4) ld hl, $f add hl, bc ld a, [hl] +rept 2 inc [hl] - inc [hl] +endr push af ld d, $2 call Functionce734 @@ -4317,8 +4331,9 @@ Functionce508: ; ce508 (33:6508) ld a, [hl] cp $10 jr nc, .asm_ce52e +rept 2 inc [hl] - inc [hl] +endr ld d, a ld hl, $b add hl, bc @@ -4428,12 +4443,14 @@ Functionce59a: ; ce59a (33:659a) jr c, .asm_ce5b0 ld hl, $7 add hl, bc +rept 2 dec [hl] - dec [hl] +endr ld hl, $8 add hl, bc +rept 2 inc [hl] - inc [hl] +endr ret .asm_ce5b0 call Functioncc9bd @@ -4446,8 +4463,9 @@ Functionce5b4: ; ce5b4 (33:65b4) ld hl, $b add hl, bc ld a, [hl] +rept 2 inc [hl] - inc [hl] +endr push af push de call Functionce734 @@ -4474,10 +4492,9 @@ Functionce5dc: ; ce5dc (33:65dc) ld a, [hl] cp $d0 jr z, .asm_ce5ea +rept 4 dec [hl] - dec [hl] - dec [hl] - dec [hl] +endr ret .asm_ce5ea call Functioncc9bd @@ -4510,10 +4527,9 @@ Functionce60a: ; ce60a (33:660a) ld a, [hl] cp $4 jr z, Functionce618 +rept 4 inc [hl] - inc [hl] - inc [hl] - inc [hl] +endr ret Functionce618: ; ce618 (33:6618) @@ -4529,10 +4545,9 @@ Functionce622: ; ce622 (33:6622) ld a, [hl] cp $d8 ret z +rept 4 dec [hl] - dec [hl] - dec [hl] - dec [hl] +endr ret Functionce62f: ; ce62f (33:662f) @@ -4567,8 +4582,9 @@ Functionce648: ; ce648 (33:6648) ld [hl], a ld hl, $9 add hl, bc +rept 2 inc [hl] - inc [hl] +endr ret Functionce65c: ; ce65c (33:665c) @@ -4754,8 +4770,9 @@ Functionce749: ; ce749 (33:6749) ld a, d ld d, 0 ld hl, Unknown_ce77f +rept 2 add hl, de - add hl, de +endr ld e, [hl] inc hl ld d, [hl] @@ -4864,8 +4881,9 @@ Functionce7d1: ; ce7d1 ld [hl], a ld hl, $000d add hl, bc +rept 2 dec [hl] - dec [hl] +endr jr .asm_ce7d1 .asm_ce815 @@ -4886,8 +4904,9 @@ Functionce823: ; ce823 ld e, [hl] ld d, 0 ld hl, Unknown_ce85e +rept 2 add hl, de - add hl, de +endr ld e, [hl] inc hl ld d, [hl] @@ -4904,8 +4923,9 @@ Functionce83c: ; ce83c ld l, a ld h, 0 ld de, Unknown_ceeae +rept 2 add hl, hl - add hl, hl +endr add hl, de ret ; ce846 @@ -4915,8 +4935,9 @@ Functionce846: ; ce846 (33:6846) push hl ld l, a ld h, 0 +rept 2 add hl, hl - add hl, hl +endr ld de, AnimObjGFX add hl, de ld c, [hl] diff --git a/battle/bg_effects.asm b/battle/bg_effects.asm index 8dfe30db6..a2fd9f731 100644 --- a/battle/bg_effects.asm +++ b/battle/bg_effects.asm @@ -61,8 +61,9 @@ Functionc804a: ; c804a (32:404a) ld e, [hl] ld d, 0 ld hl, BattleBGEffects +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld h, [hl] ld l, a @@ -708,9 +709,9 @@ Functionc83fa: ; c83fa (32:43fa) ld l, a ld a, [BattleAnimTemps + 2] ld h, a +rept 3 add hl, de - add hl, de - add hl, de +endr ld a, [hl] cp $ff jr z, Functionc8434 @@ -756,8 +757,9 @@ Functionc843b: ; c843b (32:443b) ld e, [hl] ld d, 0 ld hl, Unknown_c849c +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld h, [hl] ld l, a @@ -771,9 +773,9 @@ Functionc8458: ; c8458 (32:4458) ld e, [hl] ld d, 0 ld hl, Unknown_c84a8 +rept 3 add hl, de - add hl, de - add hl, de +endr ld a, [hli] ld b, a and $f @@ -793,8 +795,9 @@ Functionc8458: ; c8458 (32:4458) ld e, [hl] ld d, 0 ld hl, Unknown_c849c +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld h, [hl] ld l, a @@ -1012,8 +1015,9 @@ Functionc85ce: ; c85ce (32:45ce) ld a, [hl] cp $20 jr nc, .asm_c85fc +rept 2 inc [hl] - inc [hl] +endr call Functionc8f9a ret .asm_c85fc @@ -1388,8 +1392,9 @@ Functionc87de: ; c87de (32:47de) call Functionc901b ld hl, $2 add hl, bc +rept 2 inc [hl] - inc [hl] +endr ret Functionc8801: ; c8801 (32:4801) @@ -1792,8 +1797,9 @@ Functionc8a14: ; c8a14 (32:4a14) call Functionc901b ld hl, $3 add hl, bc +rept 2 inc [hl] - inc [hl] +endr ret Functionc8a36: ; c8a36 (32:4a36) @@ -1877,8 +1883,9 @@ Functionc8a9a: ; c8a9a (32:4a9a) ld h, $d2 .asm_c8aa5 ld [hl], e +rept 2 inc hl - inc hl +endr dec a jr nz, .asm_c8aa5 ret diff --git a/battle/core.asm b/battle/core.asm index 44ed0e588..367af1754 100644 --- a/battle/core.asm +++ b/battle/core.asm @@ -1840,8 +1840,9 @@ HandleWeather: ; 3cb9e dec a ld c, a ld b, 0 +rept 2 add hl, bc - add hl, bc +endr ld a, [hli] ld h, [hl] ld l, a @@ -2552,8 +2553,9 @@ Function3d02b: ; 3d02b dec a ld c, a ld b, 0 +rept 2 add hl, bc - add hl, bc +endr ld a, [hli] ld h, [hl] ld l, a @@ -2591,8 +2593,9 @@ Function3d099: ; 3d099 rl [hl] ret nc ld a, $ff +rept 2 ld [hli], a - ld [hli], a +endr ld [hl], a ret ; 3d0ab @@ -3756,10 +3759,9 @@ NewEnemyMonStatus: ; 3d834 ld [LastPlayerCounterMove], a ld [LastEnemyMove], a ld hl, EnemySubStatus1 +rept 4 ld [hli], a - ld [hli], a - ld [hli], a - ld [hli], a +endr ld [hl], a ld [EnemyDisableCount], a ld [EnemyFuryCutterCount], a @@ -4033,9 +4035,9 @@ Function3da0d: ; 3da0d ld de, BattleMonDVs ld bc, 2 + NUM_MOVES + 1 ; DVs, PP, happiness ; BattleMonLevel - BattleMonDVs call CopyBytes +rept 3 inc hl - inc hl - inc hl +endr ld de, BattleMonLevel ld bc, 1 + 1 + 1 + 2 + 2 * 6 ; level, status, unused, stats call CopyBytes @@ -4125,9 +4127,9 @@ Function3dabd: ; 3dabd ld de, EnemyMonDVs ld bc, 2 + NUM_MOVES + 1 call CopyBytes +rept 3 inc hl - inc hl - inc hl +endr ld de, EnemyMonLevel ld bc, 1 + 1 + 1 + 2 + 2 * 6 call CopyBytes @@ -4250,15 +4252,14 @@ NewBattleMonStatus: ; 3dbde ld [LastPlayerCounterMove], a ld [LastPlayerMove], a ld hl, PlayerSubStatus1 +rept 4 ld [hli], a - ld [hli], a - ld [hli], a - ld [hli], a +endr ld [hl], a ld hl, PlayerUsedMoves +rept 3 ld [hli], a - ld [hli], a - ld [hli], a +endr ld [hl], a ld [PlayerDisableCount], a ld [PlayerFuryCutterCount], a @@ -4694,16 +4695,18 @@ Function3deb6: ; 3deb6 ld a, [hli] cp $ff jr z, .asm_3def9 +rept 2 inc hl - inc hl +endr cp b jr nz, .asm_3dec7 pop bc ld a, [bc] ld [wd265], a push bc +rept 2 dec hl - dec hl +endr ld a, [hli] ld h, [hl] ld l, a @@ -5769,8 +5772,9 @@ Function3e4bc: ; 3e4bc ld a, [wcfa9] ld b, a ld a, [wd0eb] +rept 2 inc a - inc a +endr cp b jp nz, .asm_3e57a ld a, $1 @@ -5953,8 +5957,9 @@ Function3e75f: ; 3e75f ld bc, $0102 call PrintNum pop hl +rept 2 inc hl - inc hl +endr ld [hl], "/" inc hl ld de, wd265 @@ -6583,9 +6588,9 @@ LoadEnemyMon: ; 3e8eb xor a ld h, d ld l, e +rept 3 ld [hli], a - ld [hli], a - ld [hli], a +endr ld [hl], a ; Make sure the predef knows this isn't a partymon ld [MagikarpLength], a @@ -6758,8 +6763,9 @@ CheckUnownLetter: ; 3eb75 .next ; Make sure we haven't gone past the end of the table +rept 2 inc e - inc e +endr ld a, e cp a, .Set1 - .LetterSets jr c, .loop @@ -7109,8 +7115,9 @@ BadgeStatBoosts: ; 3ed45 ; Swap badges 3 (PlainBadge) and 5 (MineralBadge). ld d, a and %00000100 +rept 2 add a - add a +endr ld b, a ld a, d and %00010000 @@ -7129,8 +7136,9 @@ BadgeStatBoosts: ; 3ed45 ld a, b srl b call c, BoostStat +rept 2 inc hl - inc hl +endr ; Check every other badge. srl b dec c @@ -7259,8 +7267,9 @@ _BattleRandom:: ; 3edd8 ; a * 5 + 1 ld c, a +rept 2 add a - add a +endr add c inc a @@ -7392,8 +7401,9 @@ Function3ee3b: ; 3ee3b ld [de], a .asm_3eea9 +rept 2 inc de - inc de +endr dec c jr nz, .asm_3ee7c xor a @@ -7468,8 +7478,9 @@ Function3ee3b: ; 3ee3b inc [hl] jr nz, .asm_3ef3d ld a, $ff +rept 2 ld [hli], a - ld [hli], a +endr ld [hl], a .asm_3ef3d @@ -7797,8 +7808,9 @@ Function3f136: ; 3f136 inc [hl] jr nz, .asm_3f186 ld a, $ff +rept 2 ld [hli], a - ld [hli], a +endr ld [hl], a .asm_3f186 @@ -8690,8 +8702,9 @@ Function3f71d: ; 3f71d rl [hl] jr nc, .asm_3f73d ld a, $ff +rept 2 ld [hli], a - ld [hli], a +endr ld [hl], a .asm_3f73d @@ -9083,11 +9096,13 @@ Function3fa42: ; 3fa42 ld d, $5 .asm_3fa62 push hl +rept 2 inc hl - inc hl +endr ld a, [hl] +rept 2 dec hl - dec hl +endr and a jr z, .asm_3fa85 push de @@ -9187,16 +9202,18 @@ Function3fac8: ; 3fac8 ld c, $1 .asm_3faed ld a, b +rept 2 add b - add b +endr ld e, a ld d, $0 ld hl, DefaultFlypoint add hl, de push hl ld a, c +rept 2 add c - add c +endr ld e, a ld d, $0 ld hl, DefaultFlypoint diff --git a/battle/effect_commands.asm b/battle/effect_commands.asm index 30376ea98..d162e1c37 100644 --- a/battle/effect_commands.asm +++ b/battle/effect_commands.asm @@ -50,8 +50,9 @@ DoMove: ; 3402c ld c, a ld b, 0 ld hl, MoveEffectsPointers +rept 2 add hl, bc - add hl, bc +endr ld a, BANK(MoveEffectsPointers) call GetFarHalfword @@ -100,8 +101,9 @@ DoMove: ; 3402c ld c, a ld b, 0 ld hl, BattleCommandPointers +rept 2 add hl, bc - add hl, bc +endr pop bc ld a, BANK(BattleCommandPointers) @@ -1062,8 +1064,9 @@ BattleCommand04: ; 34555 jp nz, EndMoveEffect ; SubStatus5 +rept 2 inc de - inc de +endr ld a, [de] bit SUBSTATUS_TRANSFORMED, a @@ -1259,8 +1262,9 @@ BattleCommand05: ; 34631 jr nc, .ScopeLens ; +2 critical level +rept 2 inc c - inc c +endr .ScopeLens push bc @@ -1500,8 +1504,9 @@ BattleCommand07: ; 346d2 pop hl .asm_347b3 +rept 2 inc hl - inc hl +endr jr .asm_34743 .end @@ -1746,11 +1751,9 @@ Function348de: ; 348de jr c, .loop ; neutral +rept 5 inc c - inc c - inc c - inc c - inc c +endr cp 10 jr z, .loop @@ -2239,8 +2242,9 @@ Function34b77: ; 34b77 ld b, [hl] inc hl ld c, [hl] +rept 2 inc hl - inc hl +endr srl c rl b srl c @@ -3344,8 +3348,9 @@ EndMoveEffect: ; 352a3 ld a, [BattleScriptBufferLoc + 1] ld h, a ld a, $ff +rept 2 ld [hli], a - ld [hli], a +endr ld [hl], a ret ; 352b1 @@ -3983,9 +3988,9 @@ Function355dd: ; 355dd sla c rl b .asm_35604 +rept 3 dec hl - dec hl - dec hl +endr ld a, [hli] ld l, [hl] ld h, a @@ -4039,8 +4044,9 @@ BattleCommand62: ; 35612 xor a ld hl, hDividend +rept 2 ld [hli], a - ld [hli], a +endr ld [hl], a ; Level * 2 @@ -4061,8 +4067,9 @@ BattleCommand62: ; 35612 pop bc ; + 2 +rept 2 inc [hl] - inc [hl] +endr ; * bp inc hl @@ -4523,9 +4530,9 @@ BattleCommand41: ; 35864 set SUBSTATUS_ENCORED, [hl] call BattleRandom and $3 +rept 3 inc a - inc a - inc a +endr ld [de], a call Function36abf jr nz, .asm_3591a @@ -4650,8 +4657,9 @@ BattleCommand42: ; 35926 ld [wd1ec], a ld a, [hl] ld [wd1ed], a +rept 2 dec de - dec de +endr ld a, [de] dec de add b @@ -4664,12 +4672,12 @@ BattleCommand42: ; 35926 ld a, [CurDamage + 1] rr a ld [CurDamage + 1], a +rept 3 inc hl - inc hl - inc hl - inc de - inc de +endr +rept 3 inc de +endr ; fallthrough ; 359ac @@ -5142,8 +5150,9 @@ BattleCommand4a: ; 35c0f call GetMoveName call BattleRandom and 3 +rept 2 inc a - inc a +endr ld b, a ld a, [hl] and $3f @@ -6854,8 +6863,9 @@ Function3661d: ; 3661d dec c ld b, 0 ld hl, Table0x364e6 +rept 2 add hl, bc - add hl, bc +endr xor a ld [hMultiplicand], a @@ -7009,8 +7019,9 @@ BattleCommand22: ; 366e5 ld [wEnemyMoveStruct + MOVE_EFFECT], a call BattleRandom and 1 +rept 2 inc a - inc a +endr ld [bc], a ld a, 1 ld [wc689], a @@ -7046,8 +7057,9 @@ BattleCommand3e: ; 3671a set 7, [hl] call BattleRandom and $1 +rept 2 inc a - inc a +endr inc de ld [de], a .asm_3674c @@ -7885,9 +7897,9 @@ BattleCommand3b: ; 36c2d ret nz call BattleRandom and 3 +rept 3 inc a - inc a - inc a +endr ld [hl], a ld a, BATTLE_VARS_MOVE_ANIM call GetBattleVar @@ -7899,8 +7911,9 @@ BattleCommand3b: ; 36c2d ld a, [hli] cp b jr z, .asm_36c69 +rept 2 inc hl - inc hl +endr jr .asm_36c61 .asm_36c69 @@ -7981,8 +7994,9 @@ BattleCommand27: ; 36cb2 ld [Buffer2], a ld a, [hl] ld [Buffer1], a +rept 2 dec hl - dec hl +endr ld a, [hl] ld [wd1ec], a sub c @@ -8083,8 +8097,9 @@ Function36d70: ; 36d70 set SUBSTATUS_CONFUSED, [hl] call BattleRandom and 3 +rept 2 inc a - inc a +endr ld [bc], a ld a, BATTLE_VARS_MOVE_EFFECT @@ -8263,8 +8278,9 @@ BattleCommand31: ; 36e7c rr b srl a rr b +rept 2 dec hl - dec hl +endr ld a, b ld [de], a ld a, [hld] @@ -8853,8 +8869,9 @@ BattleCommand2d: ; 371cd ld a, [hli] ld [de], a inc hl +rept 2 inc de - inc de +endr ld bc, NUM_MOVES call CopyBytes ld a, [hBattleTurn] @@ -9655,8 +9672,9 @@ BattleCommand66: ; 37991 ld a, [hli] cp b jr nc, .ok +rept 2 inc hl - inc hl +endr jr .loop .ok ld d, [hl] @@ -10045,14 +10063,16 @@ BattleCommand6a6c: ; 37b7e inc c cp WEATHER_SUN jr z, .Heal +rept 2 dec c - dec c +endr .Heal ld b, 0 ld hl, .Multipliers +rept 2 add hl, bc - add hl, bc +endr ld a, [hli] ld h, [hl] diff --git a/battle/hidden_power.asm b/battle/hidden_power.asm index 58e4599dd..7eb720401 100644 --- a/battle/hidden_power.asm +++ b/battle/hidden_power.asm @@ -45,8 +45,9 @@ HiddenPowerDamage: ; fbced ; Multiply by 5 ld b, a +rept 2 add a - add a +endr add b ; Add Special & 3 @@ -74,8 +75,9 @@ HiddenPowerDamage: ; fbced ld a, [hl] and 3 << 4 swap a +rept 2 add a - add a +endr or b ; Skip Normal diff --git a/battle/magikarp_length.asm b/battle/magikarp_length.asm index 160912c53..237450928 100644 --- a/battle/magikarp_length.asm +++ b/battle/magikarp_length.asm @@ -141,8 +141,9 @@ CalcMagikarpLength: ; fbbfc ; hl = de * 10 ld h, d ld l, e +rept 2 add hl, hl - add hl, hl +endr add hl, de add hl, hl diff --git a/data/wild/fish.asm b/data/wild/fish.asm index 844629201..c44e23937 100644 --- a/data/wild/fish.asm +++ b/data/wild/fish.asm @@ -60,9 +60,9 @@ endr jr c, .ReadMon ; Next monster... +rept 3 inc hl - inc hl - inc hl +endr jr .CheckEncounter .ReadMon @@ -98,8 +98,9 @@ endr and 3 cp NITE jr c, .TimeSpecies +rept 2 inc hl - inc hl +endr .TimeSpecies ld d, [hl] diff --git a/engine/color.asm b/engine/color.asm index eb789ed0f..de318e54c 100644 --- a/engine/color.asm +++ b/engine/color.asm @@ -262,10 +262,9 @@ Function8bc6: bit 7, a jr z, .asm_8bd7 and $7f +rept 4 inc hl - inc hl - inc hl - inc hl +endr .asm_8bd7 asm_8bd7 @@ -361,8 +360,9 @@ Function8c43: ; 8c43 .asm_8c5a ld l, c ld h, $0 +rept 2 add hl, hl - add hl, hl +endr ld bc, Palettes_a8be add hl, bc ld bc, $0004 @@ -398,8 +398,9 @@ Function8c8a: ; 8c8a ld hl, Unknown_8f6a ld b, 0 dec c +rept 2 add hl, bc - add hl, bc +endr ld a, [rSVBK] push af ld a, $5 @@ -420,9 +421,9 @@ Function8c8a: ; 8c8a Function8cb4: ; 8cb4 ld l, e ld h, 0 +rept 3 add hl, hl - add hl, hl - add hl, hl +endr ld de, Palettes_8d05 add hl, de call CheckCGB @@ -433,8 +434,9 @@ Function8cb4: ; 8cb4 ld bc, $0010 call CopyBytes pop hl +rept 2 inc hl - inc hl +endr ld a, [hli] ld [wcda9 + 3], a ld a, [hli] @@ -556,9 +558,9 @@ Function9615: ; 9615 Function9625: ; 9625 ld l, a ld h, $0 +rept 3 add hl, hl - add hl, hl - add hl, hl +endr ld bc, Palettes_9df6 add hl, bc ret @@ -639,15 +641,13 @@ Function9673: ; 9673 ld c, $8 .asm_9683 ld a, $ff +rept 4 ld [hli], a - ld [hli], a - ld [hli], a - ld [hli], a +endr xor a +rept 4 ld [hli], a - ld [hli], a - ld [hli], a - ld [hli], a +endr dec c jr nz, .asm_9683 pop af @@ -897,9 +897,9 @@ Function97e5: ; 97e5 Function97ee: ; 97ee ld l, a ld h, $0 +rept 3 add hl, hl - add hl, hl - add hl, hl +endr ld bc, PokemonPalettes add hl, bc ret @@ -913,10 +913,9 @@ Function97f9: ; 97f9 call CheckShininess pop hl ret nc +rept 4 inc hl - inc hl - inc hl - inc hl +endr ret ; 9809 @@ -1140,8 +1139,9 @@ Function994a: ; 994a jr nz, .asm_99a6 ld a, $20 ld [rJOYP], a +rept 2 ld a, [rJOYP] - ld a, [rJOYP] +endr call Function9a7a call Function9a7a ld a, $30 @@ -1150,19 +1150,16 @@ Function994a: ; 994a call Function9a7a ld a, $10 ld [rJOYP], a +rept 6 ld a, [rJOYP] - ld a, [rJOYP] - ld a, [rJOYP] - ld a, [rJOYP] - ld a, [rJOYP] - ld a, [rJOYP] +endr call Function9a7a call Function9a7a ld a, $30 ld [rJOYP], a +rept 3 ld a, [rJOYP] - ld a, [rJOYP] - ld a, [rJOYP] +endr call Function9a7a call Function9a7a ld a, [rJOYP] @@ -1949,16 +1946,17 @@ Functionb1de: ; b1de ld e, a ld d, 0 ld hl, Unknown_b279 +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld h, [hl] ld l, a ld a, [TimeOfDayPal] and 3 +rept 3 add a - add a - add a +endr ld e, a ld d, 0 add hl, de @@ -2027,10 +2025,9 @@ endr and 3 cp NITE jr c, .asm_b26d +rept 4 inc hl - inc hl - inc hl - inc hl +endr .asm_b26d ld de, Unkn1Pals + 8 * 6 + 2 ld bc, 4 diff --git a/engine/credits.asm b/engine/credits.asm index 727dbb9b0..2be947bf3 100644 --- a/engine/credits.asm +++ b/engine/credits.asm @@ -260,8 +260,9 @@ Function109926: ; 109926 ld e, a ld d, 0 ld hl, Jumptable_109937 +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld h, [hl] ld l, a @@ -326,8 +327,9 @@ Function109986: ; 109986 (42:5986) cp $30 jr c, Function109986 ld a, [wcf66] +rept 2 dec a - dec a +endr ld [wcf66], a ld hl, LYOverrides + $1f call Function1099a3 @@ -397,8 +399,9 @@ ParseCredits: ; 1099aa ld e, a ld d, 0 ld hl, CreditsStrings +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld d, [hl] ld e, a @@ -582,10 +585,9 @@ Function109aff: ; 109aff (42:5aff) dec c jr nz, .asm_109b08 pop hl +rept 4 inc hl - inc hl - inc hl - inc hl +endr dec b jr nz, .asm_109b01 ret @@ -735,8 +737,9 @@ Function109bca: ; 109bca (42:5bca) ld [hl], a ld a, [wcf65] and 3 +rept 2 add a - add a +endr add e add a ld e, a diff --git a/engine/events.asm b/engine/events.asm index e63d24b4f..5849d6774 100644 --- a/engine/events.asm +++ b/engine/events.asm @@ -794,8 +794,9 @@ TryReadSign: ; 96a38 push hl call PlayTalkObject pop hl +rept 2 inc hl - inc hl +endr call GetMapScriptHeaderBank call GetFarHalfword call GetMapScriptHeaderBank diff --git a/engine/events_2.asm b/engine/events_2.asm index a5112eba3..cbcbaebb7 100644 --- a/engine/events_2.asm +++ b/engine/events_2.asm @@ -439,9 +439,9 @@ Function97e79: ; 97e79 ld e, a ld d, 0 ld hl, Table97e94 +rept 3 add hl, de - add hl, de - add hl, de +endr ld a, [hli] push af ld a, [hli] diff --git a/engine/fruit_trees.asm b/engine/fruit_trees.asm index 2dd43eda1..9404a5564 100644 --- a/engine/fruit_trees.asm +++ b/engine/fruit_trees.asm @@ -66,9 +66,9 @@ PickedFruitTree: ; 4405f ResetFruitTrees: ; 4406a xor a ld hl, FruitTreeFlags +rept 3 ld [hli], a - ld [hli], a - ld [hli], a +endr ld [hl], a ld hl, DailyFlags set 4, [hl] diff --git a/engine/landmarks.asm b/engine/landmarks.asm index 831709514..e9b1c3668 100644 --- a/engine/landmarks.asm +++ b/engine/landmarks.asm @@ -3,8 +3,9 @@ GetLandmarkCoords: ; 0x1ca896 push hl ld l, e ld h, 0 +rept 2 add hl, hl - add hl, hl +endr ld de, Landmarks add hl, de ld a, [hli] @@ -23,8 +24,9 @@ GetLandmarkName:: ; 0x1ca8a5 ld l, e ld h, 0 +rept 2 add hl, hl - add hl, hl +endr ld de, Landmarks + 2 add hl, de ld a, [hli] diff --git a/engine/map_objects.asm b/engine/map_objects.asm index a5749c277..6cbdc87aa 100644 --- a/engine/map_objects.asm +++ b/engine/map_objects.asm @@ -656,9 +656,9 @@ Function467b: ; 467b ld [hl], a ld hl, OBJECT_27 add hl, bc +rept 3 ld [hli], a - ld [hli], a - ld [hli], a +endr ld [hl], a ld hl, OBJECT_DIRECTION_WALKING add hl, bc @@ -675,8 +675,9 @@ Function4690: ; 4690 bit 2, [hl] jr nz, .ok +rept 2 add a - add a +endr and %00001100 ld hl, OBJECT_FACING add hl, bc @@ -750,8 +751,9 @@ GetStepVector: ; 46e9 add hl, bc ld a, [hl] and %00001111 +rept 2 add a - add a +endr ld l, a ld h, 0 ld de, StepVectors @@ -3079,8 +3081,9 @@ Function57ca: ; 57ca ret z ld a, [wd45b] and 3 +rept 2 add a - add a +endr jr Function57db ; 57d9 diff --git a/engine/map_setup.asm b/engine/map_setup.asm index 0324e1408..78849d989 100644 --- a/engine/map_setup.asm +++ b/engine/map_setup.asm @@ -6,8 +6,9 @@ RunMapSetupScript:: ; 15363 ld c, a ld b, 0 ld hl, MapSetupScripts +rept 2 add hl, bc - add hl, bc +endr ld a, [hli] ld h, [hl] ld l, a @@ -259,9 +260,9 @@ ReadMapSetupScript: ; 1541d ld c, a ld b, 0 ld hl, MapSetupCommands +rept 3 add hl, bc - add hl, bc - add hl, bc +endr ; bank ld b, [hl] diff --git a/engine/pack.asm b/engine/pack.asm index 7e1dc4939..62796ed3f 100644 --- a/engine/pack.asm +++ b/engine/pack.asm @@ -1235,8 +1235,9 @@ Function10866: ; 10866 (4:4866) Function1086b: ; 1086b ld e, a ld d, 0 +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld h, [hl] ld l, a @@ -1285,8 +1286,9 @@ Function1089d: ; 1089d .asm_108b3 ld hl, PackGFXPointers +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld e, a ld d, [hl] diff --git a/engine/pokedex.asm b/engine/pokedex.asm index 5bf01fb8e..25b291ffb 100644 --- a/engine/pokedex.asm +++ b/engine/pokedex.asm @@ -899,10 +899,9 @@ asm_4065d: ; 4065d (10:465d) ld e, a ld d, 0 ld hl, Unknown_40a3e + 2 +rept 4 add hl, de - add hl, de - add hl, de - add hl, de +endr ld a, [hli] ld h, [hl] ld l, a @@ -1339,10 +1338,9 @@ Function409f1: ; 409f1 (10:49f1) jr z, .asm_40a39 push af ld hl, Unknown_40a3e +rept 4 add hl, de - add hl, de - add hl, de - add hl, de +endr ld a, [hli] ld h, [hl] ld l, a @@ -1883,15 +1881,9 @@ Function40fcd: ; 40fcd (10:4fcd) ld e, a ld d, 0 ld hl, Strings_40fe4 +rept 9 add hl, de - add hl, de - add hl, de - add hl, de - add hl, de - add hl, de - add hl, de - add hl, de - add hl, de +endr ld e, l ld d, h pop hl @@ -2406,8 +2398,9 @@ Function41427: ; 41427 Function41432: ; 41432 ld e, a ld d, 0 +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld h, [hl] ld l, a diff --git a/engine/scripting.asm b/engine/scripting.asm index 5185518e4..709a75c25 100644 --- a/engine/scripting.asm +++ b/engine/scripting.asm @@ -861,8 +861,9 @@ Script_trainertext: ; 0x9710f ld c, a ld b, 0 ld hl, WalkingX +rept 2 add hl, bc - add hl, bc +endr ld a, [hli] ld h, [hl] ld l, a @@ -1121,8 +1122,9 @@ Script_faceplayer: ; 0x9722e ld e, a callba GetRelativeFacing ld a, d +rept 2 add a - add a +endr ld e, a ld a, [$ffe0] ld d, a @@ -1155,8 +1157,9 @@ Script_faceperson: ; 0x97248 pop bc ret c ld a, d +rept 2 add a - add a +endr ld e, a ld d, c call ApplyPersonFacing @@ -1177,8 +1180,9 @@ Script_spriteface: ; 0x97274 .asm_97280 ld d, a call GetScriptByte +rept 2 add a - add a +endr ld e, a call ApplyPersonFacing ret @@ -1638,9 +1642,9 @@ ScriptCall: ; 0x974cb inc [hl] ld d, $0 ld hl, wd43d +rept 3 add hl, de - add hl, de - add hl, de +endr pop de ld a, [ScriptBank] ld [hli], a @@ -1811,9 +1815,9 @@ StdScript: ; 0x9757b call GetScriptByte ld d, a ld hl, StdScripts +rept 3 add hl, de - add hl, de - add hl, de +endr ld a, BANK(StdScripts) call GetFarByte ld b, a diff --git a/engine/title.asm b/engine/title.asm index a5ce99f20..2e151c389 100644 --- a/engine/title.asm +++ b/engine/title.asm @@ -345,8 +345,9 @@ Function10ef1c: ; 10ef1c ld b, a ld a, e ld [hli], a +rept 2 inc e - inc e +endr ld a, $80 ld [hli], a dec c @@ -371,9 +372,9 @@ AnimateTitleCrystal: ; 10ef32 ld a, [hl] add 2 ld [hli], a +rept 3 inc hl - inc hl - inc hl +endr dec c jr nz, .loop diff --git a/event/dratini.asm b/event/dratini.asm index 1352492ca..7e82dc1b8 100644 --- a/event/dratini.asm +++ b/event/dratini.asm @@ -37,8 +37,9 @@ SpecialDratini: ; 0x8b170 ; get address of mon's first move pop de +rept 2 inc de - inc de +endr .GiveMoves ld a, [hl] diff --git a/event/poke_seer.asm b/event/poke_seer.asm index 514b40443..3cb3806ca 100644 --- a/event/poke_seer.asm +++ b/event/poke_seer.asm @@ -287,8 +287,9 @@ PrintSeerText: ; 4f26d ld e, a ld d, 0 ld hl, SeerTexts +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld h, [hl] ld l, a diff --git a/gfx/pics/animation.asm b/gfx/pics/animation.asm index c2ab2626e..d736ef37e 100644 --- a/gfx/pics/animation.asm +++ b/gfx/pics/animation.asm @@ -110,8 +110,9 @@ Functiond00a3: ; d00a3 ld c, e ld b, 0 ld hl, PokeAnims +rept 2 add hl, bc - add hl, bc +endr ld a, [hli] ld b, [hl] ld c, a @@ -507,8 +508,9 @@ Functiond02f8: ; d02f8 ld a, [hli] ld h, [hl] ld l, a +rept 2 add hl, de - add hl, de +endr ld a, [w2_d174] call GetFarHalfword ld a, l @@ -530,8 +532,9 @@ Functiond031b: ; d031b ld a, [hli] ld h, [hl] ld l, a +rept 2 add hl, bc - add hl, bc +endr ld a, [w2_d177] call GetFarHalfword ld a, [w2_d177] @@ -948,8 +951,9 @@ Functiond055c: ; d055c dec a ld e, a ld d, 0 +rept 2 add hl, de - add hl, de +endr ld a, c ld [w2_d174], a call GetFarHalfword @@ -1018,8 +1022,9 @@ Functiond05ce: ; d05ce dec a ld e, a ld d, 0 +rept 2 add hl, de - add hl, de +endr ld a, b call GetFarHalfword ld a, l @@ -1057,8 +1062,9 @@ Functiond061b: ; d061b dec a ld e, a ld d, 0 +rept 2 add hl, de - add hl, de +endr ld a, [w2_d17a] call GetFarHalfword ld a, l diff --git a/home.asm b/home.asm index c1805e0fe..47ea6d370 100644 --- a/home.asm +++ b/home.asm @@ -967,8 +967,9 @@ GetPokemonName:: ; 343b ld e, a ld h, 0 ld l, a +rept 2 add hl, hl - add hl, hl +endr add hl, de add hl, hl ld de, PokemonNames @@ -1342,8 +1343,9 @@ Function35de:: ; 35de inc hl .asm_35f8 +rept 2 inc hl - inc hl +endr jr .asm_35e6 .asm_35fc @@ -2108,10 +2110,12 @@ Function3eea:: ; 3eea push bc ld de, AttrMap - TileMap add hl, de +rept 2 inc b - inc b - inc c +endr +rept 2 inc c +endr call Function3f35 pop bc pop hl @@ -2135,10 +2139,12 @@ Function3f0d:: ; 3f0d push bc ld de, AttrMap - TileMap add hl, de +rept 2 inc b - inc b - inc c +endr +rept 2 inc c +endr call Function3f35 pop bc pop hl @@ -2259,8 +2265,9 @@ Function3f9f:: ; 3f9f ld c, $8 .asm_3fa5 ld a, [de] +rept 2 inc de - inc de +endr cpl ld [hl], $0 inc hl diff --git a/home/audio.asm b/home/audio.asm index 859ace116..610117715 100644 --- a/home/audio.asm +++ b/home/audio.asm @@ -158,12 +158,9 @@ PlayCryHeader:: ; 3be3 ld [MBC3RomBank], a ld hl, CryHeaders +rept 6 add hl, de - add hl, de - add hl, de - add hl, de - add hl, de - add hl, de +endr ld e, [hl] inc hl diff --git a/home/battle.asm b/home/battle.asm index fa72d75a0..832792d88 100644 --- a/home/battle.asm +++ b/home/battle.asm @@ -153,8 +153,9 @@ GetBattleVarAddr:: ; 39e7 ld hl, .battlevarpairs ld c, a ld b, 0 +rept 2 add hl, bc - add hl, bc +endr ld a, [hli] ld h, [hl] @@ -174,8 +175,9 @@ GetBattleVarAddr:: ; 39e7 ld b, 0 ld hl, .vars +rept 2 add hl, bc - add hl, bc +endr ld a, [hli] ld h, [hl] diff --git a/home/copy.asm b/home/copy.asm index d0bc1983f..f18b12802 100644 --- a/home/copy.asm +++ b/home/copy.asm @@ -195,8 +195,9 @@ FarCopyBytesDouble:: ; e9b .loop ld a, [de] inc de +rept 2 ld [hli], a - ld [hli], a +endr .dec dec c jr nz, .loop @@ -406,9 +407,9 @@ Copy1bpp:: ; fa4 push af ld h, 0 ld l, c +rept 3 add hl, hl - add hl, hl - add hl, hl +endr ld b, h ld c, l pop af diff --git a/home/cry.asm b/home/cry.asm index 456037db4..ac9ac8029 100644 --- a/home/cry.asm +++ b/home/cry.asm @@ -66,12 +66,9 @@ LoadCryHeader:: ; 37f3 rst Bankswitch ld hl, CryHeaders +rept 6 add hl, bc - add hl, bc - add hl, bc - add hl, bc - add hl, bc - add hl, bc +endr ld e, [hl] inc hl diff --git a/home/joypad.asm b/home/joypad.asm index 42a61cd5d..78a1ac143 100644 --- a/home/joypad.asm +++ b/home/joypad.asm @@ -42,8 +42,9 @@ Joypad:: ; 935 ld a, D_PAD ld [rJOYP], a ; Read twice to give the request time to take. +rept 2 ld a, [rJOYP] - ld a, [rJOYP] +endr ; The Joypad register output is in the lo nybble (inversed). ; We make the hi nybble of our new container d-pad input. @@ -59,12 +60,9 @@ Joypad:: ; 935 ld a, BUTTONS ld [rJOYP], a ; Wait for input to stabilize. +rept 6 ld a, [rJOYP] - ld a, [rJOYP] - ld a, [rJOYP] - ld a, [rJOYP] - ld a, [rJOYP] - ld a, [rJOYP] +endr ; Buttons take the lo nybble. cpl and $f @@ -211,8 +209,9 @@ GetJoypad:: ; 984 jr nz, .next ; The current input is overwritten. +rept 2 dec hl - dec hl +endr ld b, NO_INPUT jr .finishauto diff --git a/home/map.asm b/home/map.asm index b93435517..2954c7d41 100644 --- a/home/map.asm +++ b/home/map.asm @@ -303,8 +303,9 @@ Function2266:: ; 2266 ; 22a3 Function22a3:: ; 22a3 +rept 2 inc hl - inc hl +endr scf ret ; 22a7 @@ -420,8 +421,9 @@ Function2336:: ; 2336 ld a, [hli] ld h, [hl] ld l, a +rept 2 inc hl - inc hl +endr call Function23da call Function23f1 call Function2408 @@ -672,9 +674,9 @@ RestoreFacingAfterWarp:: ; 248a ld a, [hli] ld h, [hl] ld l, a +rept 3 inc hl - inc hl - inc hl +endr ld a, [WarpNumber] dec a ld c, a @@ -730,9 +732,9 @@ ChangeMap:: ; 24e4 ld [hConnectionStripLength], a ld c, a ld b, 0 +rept 3 add hl, bc - add hl, bc - add hl, bc +endr ld c, 3 add hl, bc ld a, [MapBlockDataBank] @@ -1324,8 +1326,9 @@ Function27d3:: ; 27d3 ld a, d ld [hli], a ld a, e +rept 2 inc a - inc a +endr and $1f ld b, a ld a, e @@ -1764,8 +1767,9 @@ endr .nocarry rr e jr nc, .nocarry2 +rept 2 inc hl - inc hl +endr .nocarry2 ld a, [TilesetCollisionBank] @@ -2062,8 +2066,9 @@ GetAnyMapHeaderPointer:: ; 0x2bed ld c, b ld b, 0 ld hl, MapGroupPointers +rept 2 add hl, bc - add hl, bc +endr ld a, [hli] ld h, [hl] diff --git a/home/map_objects.asm b/home/map_objects.asm index 7c686e122..2b7bd9a92 100644 --- a/home/map_objects.asm +++ b/home/map_objects.asm @@ -28,8 +28,9 @@ Function180e:: ; 180e .loop cp [hl] jr z, .found +rept 2 inc hl - inc hl +endr dec c jr nz, .loop ld a, [UsedSprites + 1] @@ -511,8 +512,9 @@ rept OBJECT_STRUCT_3_DATA_WIDTH endr ld a, BANK(ObjectStruct3_Data) call GetFarByte +rept 2 add a - add a +endr and $c pop de pop bc diff --git a/home/menu.asm b/home/menu.asm index 26d47490b..2b9885834 100644 --- a/home/menu.asm +++ b/home/menu.asm @@ -111,8 +111,9 @@ Function1db8:: ; 0x1db8 ld a, [hli] ld h, [hl] ld l, a +rept 2 inc hl - inc hl +endr pop af call GetNthString ld d, h @@ -439,8 +440,9 @@ Function1f8d:: ; 1f8d push de ld a, [MenuSelection] call Function1fb1 +rept 2 inc hl - inc hl +endr ld a, [hli] ld d, [hl] ld e, a @@ -451,8 +453,9 @@ Function1f8d:: ; 1f8d Function1f9e:: ; 1f9e call Function1fb1 +rept 2 inc hl - inc hl +endr ld a, [hli] ld d, [hl] ld e, a @@ -475,10 +478,9 @@ Function1fb1:: ; 1fb1 ld a, [hli] ld h, [hl] ld l, a +rept 4 add hl, de - add hl, de - add hl, de - add hl, de +endr ret ; 1fbf @@ -497,8 +499,9 @@ Function1fbf:: ; 1fbf ld [rSVBK], a xor a ld hl, $dfff +rept 2 ld [hld], a - ld [hld], a +endr ld a, l ld [wcf71], a ld a, h diff --git a/home/movement.asm b/home/movement.asm index eb59c0525..e6e2e1025 100644 --- a/home/movement.asm +++ b/home/movement.asm @@ -102,8 +102,9 @@ Function1b92:: ; 1b92 push hl ld l, b ld h, 0 +rept 2 add hl, hl - add hl, hl +endr ld e, a ld d, 0 add hl, de @@ -131,12 +132,13 @@ Function1bb1:: ; 1bb1 dec b jr nz, .asm_1bb8 ld a, $1 +rept 2 ld [hli], a - ld [hli], a +endr xor a +rept 3 ld [hli], a - ld [hli], a - ld [hli], a +endr pop bc pop hl ret diff --git a/home/text.asm b/home/text.asm index 4cb581bcb..98ca87051 100644 --- a/home/text.asm +++ b/home/text.asm @@ -126,10 +126,12 @@ TextBoxPalette:: ; 1024 ; Fill text box width c height b at hl with pal 7 ld de, AttrMap - TileMap add hl, de +rept 2 inc b - inc b - inc c +endr +rept 2 inc c +endr ld a, TEXTBOX_PAL .col push bc @@ -626,10 +628,12 @@ Function138c:: ; 138c inc de dec c jr nz, .row +rept 2 inc de - inc de - inc hl +endr +rept 2 inc hl +endr pop af dec a jr nz, .col @@ -719,8 +723,9 @@ Function13f6:: ; 13f6 ld c, a ld b, 0 ld hl, TextCommands +rept 2 add hl, bc - add hl, bc +endr ld e, [hl] inc hl ld d, [hl] @@ -992,8 +997,9 @@ Text_PlaySound:: ; 1500 jr z, .done cp b jr z, .play +rept 2 inc hl - inc hl +endr jr .loop .play @@ -1088,8 +1094,9 @@ Text_14:: ; 156a ld e, a ld d, 0 ld hl, Unknown_24000 +rept 2 add hl, de - add hl, de +endr ld a, BANK(Unknown_24000) call GetFarHalfword ld d, h @@ -1110,8 +1117,9 @@ Text_15:: ; 1582 ld c, a ld b, 0 ld hl, .Days +rept 2 add hl, bc - add hl, bc +endr ld a, [hli] ld h, [hl] ld l, a diff --git a/home/tilemap.asm b/home/tilemap.asm index ceda55dd2..c9eaaba67 100644 --- a/home/tilemap.asm +++ b/home/tilemap.asm @@ -175,11 +175,13 @@ GetTileCoord:: ; 1d05 ld a, c ld b, h ld c, l +rept 2 add hl, hl - add hl, hl +endr add hl, bc +rept 2 add hl, hl - add hl, hl +endr ld c, a xor a ld b, a @@ -203,11 +205,13 @@ GetAttrCoord:: ; 1d21 ld a, c ld b, h ld c, l +rept 2 add hl, hl - add hl, hl +endr add hl, bc +rept 2 add hl, hl - add hl, hl +endr ld c, a xor a ld b, a diff --git a/home/vblank.asm b/home/vblank.asm index 501da9382..b8b8b0efb 100644 --- a/home/vblank.asm +++ b/home/vblank.asm @@ -19,8 +19,9 @@ VBlank:: ; 283 ld e, a ld d, 0 ld hl, .VBlanks +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld h, [hl] ld l, a diff --git a/home/video.asm b/home/video.asm index 7392d6e0f..440c90307 100644 --- a/home/video.asm +++ b/home/video.asm @@ -77,8 +77,9 @@ endr ; We've done 2 16x8 blocks ld a, [$ffdc] +rept 2 dec a - dec a +endr ld [$ffdc], a jr nz, .next diff --git a/items/item_descriptions.asm b/items/item_descriptions.asm index 40e91b2c9..7ff574d11 100644 --- a/items/item_descriptions.asm +++ b/items/item_descriptions.asm @@ -21,8 +21,9 @@ PrintItemDescription: ; 0x1c8955 dec a ld c, a ld b, 0 +rept 2 add hl, bc - add hl, bc +endr ld e, [hl] inc hl ld d, [hl] diff --git a/items/item_effects.asm b/items/item_effects.asm index b65183ca2..5cffc6afb 100644 --- a/items/item_effects.asm +++ b/items/item_effects.asm @@ -253,8 +253,9 @@ ParkBall: ; e8a2 jr z, .asm_e906 cp c jr z, .asm_e8fe +rept 2 inc hl - inc hl +endr jr .asm_e8f2 .asm_e8fe @@ -287,8 +288,9 @@ ParkBall: ; e8a2 ld h, d ld l, e +rept 2 add hl, de - add hl, de +endr ld d, h ld e, l ld a, d @@ -802,8 +804,9 @@ HeavyBallMultiplier: dec a ld e, a ld d, 0 +rept 2 add hl, de - add hl, de +endr ld a, BANK(PokedexDataPointerTable) call GetFarHalfword @@ -816,8 +819,9 @@ HeavyBallMultiplier: call GetPokedexEntryBank push bc +rept 2 inc hl - inc hl +endr call GetFarHalfword srl h @@ -863,8 +867,9 @@ HeavyBallMultiplier: ld a, c cp [hl] jr c, .heavymon +rept 2 inc hl - inc hl +endr jr .lookup .heavymon @@ -923,8 +928,9 @@ GLOBAL EvosAttacksPointers ld c, a ld b, 0 ld hl, EvosAttacksPointers +rept 2 add hl, bc - add hl, bc +endr ld a, BANK(EvosAttacksPointers) call GetFarHalfword pop bc @@ -936,9 +942,9 @@ GLOBAL EvosAttacksPointers pop bc ret nz +rept 3 inc hl - inc hl - inc hl +endr ; Moon Stone's constant from Pokémon Red is used. ; No Pokémon evolve with Burn Heal, @@ -2119,8 +2125,9 @@ Functionf395: ; f395 (3:7395) jr z, .asm_f3a9 cp d jr z, .done +rept 2 inc hl - inc hl +endr jr .next .asm_f3a9 @@ -2322,8 +2329,9 @@ XSpecial: ; f4c5 .asm_f4ce cp [hl] jr z, .asm_f4d5 +rept 2 inc hl - inc hl +endr jr .asm_f4ce .asm_f4d5 diff --git a/lib/mobile/main.asm b/lib/mobile/main.asm index 8ab169815..739e12641 100644 --- a/lib/mobile/main.asm +++ b/lib/mobile/main.asm @@ -665,8 +665,9 @@ Function1103ac: ; 1103ac ld hl, Unknown_112037 ld de, $cb74 call Function110000 +rept 2 inc de - inc de +endr pop hl ld bc, $0000 call Function110007 @@ -724,9 +725,9 @@ Function110438: ; 110438 ld a, $c8 ld [hli], a xor a +rept 3 ld [hli], a - ld [hli], a - ld [hli], a +endr ld [hl], a ld a, $ff ld [$c86e], a @@ -947,9 +948,9 @@ Function1105dd: ; 1105dd ld a, $c8 ld [hli], a xor a +rept 3 ld [hli], a - ld [hli], a - ld [hli], a +endr ld [hl], a ld a, $ff ld [$c86e], a @@ -1110,8 +1111,9 @@ Function1106ef: ; 1106ef ld hl, Unknown_112072 ld b, $5 call Function110000 +rept 2 inc de - inc de +endr ld bc, $0001 ld hl, Unknown_11209e call Function110007 @@ -1377,8 +1379,9 @@ Function110905: ; 110905 ld hl, Unknown_112072 ld b, $5 call Function110000 +rept 2 inc de - inc de +endr ld hl, Unknown_1120c8 call Function110007 pop hl @@ -1542,10 +1545,12 @@ Function110a5b: ; 110a5b ld [hli], a ld a, d ld [hli], a +rept 2 inc de - inc de - dec bc +endr +rept 2 dec bc +endr ld hl, $c98f ld a, e ld [hli], a @@ -1565,8 +1570,9 @@ Function110a5b: ; 110a5b xor a ld [hli], a xor a +rept 2 ld [hli], a - ld [hli], a +endr xor a ld [$c86b], a ld de, $cb47 @@ -1606,8 +1612,9 @@ Function110af4: ; 110af4 ld [hli], a ld a, d ld [hli], a +rept 2 inc de - inc de +endr ld a, e ld [hli], a ld a, d @@ -1618,8 +1625,9 @@ Function110af4: ; 110af4 ld [$c86e], a ld [$c86f], a jr z, .asm_110b5c +rept 2 dec bc - dec bc +endr ld a, [$c993] or a jp nz, .asm_110bd5 @@ -1885,10 +1893,12 @@ Function110c9e: ; 110c9e ld [hli], a ld a, d ld [hli], a +rept 2 inc de - inc de - dec bc +endr +rept 2 dec bc +endr ld hl, $c98f ld a, e ld [hli], a @@ -1908,8 +1918,9 @@ Function110c9e: ; 110c9e xor a ld [hli], a xor a +rept 2 ld [hli], a - ld [hli], a +endr xor a ld [$c86b], a ld de, $cb47 @@ -2124,14 +2135,16 @@ Function110ddd: ; 110ddd ld [$c833], a ld a, [hli] ld [$c834], a +rept 2 inc hl - inc hl +endr ld a, l ld [$c97f], a ld a, h ld [$c980], a +rept 2 dec hl - dec hl +endr ld a, [hli] ld h, [hl] ld l, a @@ -2253,9 +2266,9 @@ Function110ddd: ; 110ddd .asm_110ee3 ld hl, $c98b xor a +rept 3 ld [hli], a - ld [hli], a - ld [hli], a +endr ld [hl], a pop bc pop de @@ -2273,8 +2286,9 @@ Function110ddd: ; 110ddd ld [hli], a ld a, d ld [hli], a +rept 2 inc hl - inc hl +endr xor a ld [$c994], a @@ -2320,8 +2334,9 @@ Function110f07: ; 110f07 ld hl, $c866 ld b, $4 call Function110000 +rept 2 inc de - inc de +endr ld b, $6 call Function111f63 ld a, [$cabc] @@ -2393,8 +2408,9 @@ Function111044: ; 111044 ld [hli], a ld a, d ld [hli], a +rept 2 inc de - inc de +endr ld a, e ld [hli], a ld a, d @@ -2404,8 +2420,9 @@ Function111044: ; 111044 or c ld [$c86e], a ld [$c86f], a +rept 2 dec bc - dec bc +endr jp z, Function1111ca ld a, [$c991] or a @@ -2701,22 +2718,23 @@ Function1111fe: ; 1111fe push de push bc push hl +rept 4 inc hl - inc hl - inc hl - inc hl +endr ld a, [hli] ld [$c833], a ld a, [hli] ld [$c834], a +rept 2 inc hl - inc hl +endr ld a, l ld [$c97f], a ld a, h ld [$c980], a +rept 2 dec hl - dec hl +endr ld a, [hli] ld h, [hl] ld l, a @@ -2794,8 +2812,9 @@ Function1111fe: ; 1111fe ld a, [hld] cp $2f jr nz, .asm_1112a4 +rept 2 inc hl - inc hl +endr ld a, [hl] cp $30 jr c, .asm_1112cc @@ -2849,8 +2868,9 @@ Function1111fe: ; 1111fe ld [hli], a ld a, d ld [hli], a +rept 2 inc hl - inc hl +endr ld a, e ld [hli], a ld a, d @@ -2868,8 +2888,9 @@ Function1111fe: ; 1111fe ld [$c9ac], a ld a, [hli] ld [$c9ad], a +rept 2 inc hl - inc hl +endr ld a, [hli] ld [$c876], a ld a, [hl] @@ -2885,8 +2906,9 @@ Function111335: ; 111335 ld a, [hli] ld h, [hl] ld l, a +rept 2 inc hl - inc hl +endr ld a, [hli] ld h, [hl] ld l, a @@ -3061,9 +3083,9 @@ Function1113fe: ; 1113fe push hl ld hl, $c829 xor a +rept 3 ld [hli], a - ld [hli], a - ld [hli], a +endr ld [hl], a ld de, $cb47 ld hl, Unknown_112072 @@ -3076,8 +3098,9 @@ Function1113fe: ; 1113fe cp $81 jr nc, .asm_111485 ld c, a +rept 2 inc a - inc a +endr ld [de], a inc de ld a, $ff @@ -3089,8 +3112,9 @@ Function1113fe: ; 1113fe ld b, c call Function110000 ld b, c +rept 2 inc b - inc b +endr call Function111f63 ld hl, $c822 set 7, [hl] @@ -3417,8 +3441,9 @@ Function11164f: ; 11164f (44:564f) ld a, b srl a srl a +rept 2 add b - add b +endr ld [hl], a ret @@ -3558,9 +3583,9 @@ Function1116c5:: ; 1116c5 (44:56c5) ld [$c800], a xor a ld hl, $c80a +rept 3 ld [hli], a - ld [hli], a - ld [hli], a +endr ld hl, $c81f ld a, [hli] ld b, a @@ -4087,8 +4112,9 @@ Function111abd: ; 111abd (44:5abd) ld [$c800], a xor a ld hl, $c80a +rept 2 ld [hli], a - ld [hli], a +endr ld [hl], a ld hl, $c815 ld a, [$c820] @@ -4291,8 +4317,9 @@ Function111c17: ; 111c17 (44:5c17) .asm_111c52 ld b, a ld a, [$ca3f] +rept 2 dec a - dec a +endr cp b jr c, .asm_111c6e .asm_111c5b @@ -5563,8 +5590,9 @@ Function112451: ; 112451 xor a ld [hli], a xor a +rept 2 ld [hli], a - ld [hli], a +endr pop de ld a, $1 ld [$c994], a @@ -5689,21 +5717,24 @@ Function1125c7: ; 1125c7 ld [hli], a ld a, d ld [hli], a +rept 2 inc de - inc de +endr ld a, $80 ld [hli], a ld a, $c8 ld [hli], a +rept 2 dec bc - dec bc +endr ld a, $fa ld [hli], a ld a, $0 ld [hli], a xor a +rept 2 ld [hli], a - ld [hli], a +endr ld de, $cb47 ld hl, Unknown_112072 ld b, $6 @@ -6191,8 +6222,9 @@ Function1128db: ; 1128db ld de, $cb4c ld a, $1 ld [de], a +rept 2 inc de - inc de +endr ld b, $1 call Function111f63 jr .asm_112941 @@ -6425,8 +6457,9 @@ Function112a56: ; 112a56 ld a, [hli] ld h, [hl] ld l, a +rept 2 inc hl - inc hl +endr ld a, e ld [hli], a ld a, d @@ -6923,8 +6956,9 @@ Function112d33: ; 112d33 ld hl, $c821 res 2, [hl] ld hl, $c86b +rept 2 dec [hl] - dec [hl] +endr .asm_112d82 ld hl, $c86b @@ -7083,8 +7117,9 @@ Function112d33: ; 112d33 cp $1 ld a, $32 jr z, .asm_112e95 +rept 2 inc de - inc de +endr inc a .asm_112e95 @@ -7463,8 +7498,9 @@ Function113095: ; 113095 .asm_1130d6 ld a, [$c82b] ld c, a +rept 2 dec b - dec b +endr ld a, b ld [$c82d], a jr z, .asm_11310d @@ -7472,8 +7508,9 @@ Function113095: ; 113095 ld d, a ld a, [$c872] ld e, a +rept 2 dec de - dec de +endr xor a or d jr nz, .asm_1130f5 @@ -7492,8 +7529,9 @@ Function113095: ; 113095 ld e, a ld a, [$c875] ld d, a +rept 2 inc de - inc de +endr call Function110000 .asm_11310d @@ -7606,8 +7644,9 @@ Function113197: ; 113197 ld a, b ld [de], a inc de +rept 2 dec b - dec b +endr call Function110000 xor a ld [de], a @@ -7629,8 +7668,9 @@ Function1131a9: ; 1131a9 inc b cp $a jr nz, .asm_1131b7 +rept 2 inc hl - inc hl +endr dec b ld c, b call Function110000 @@ -7674,8 +7714,9 @@ Function1131a9: ; 1131a9 ld hl, $c821 res 2, [hl] ld hl, $c86b +rept 2 dec [hl] - dec [hl] +endr ld a, $4 ret ; 113206 @@ -7698,8 +7739,9 @@ Function113206: ; 113206 ld e, a ld a, [$c875] ld d, a +rept 2 inc de - inc de +endr call Function110000 ld a, [$c991] ld [$c993], a @@ -7970,8 +8012,9 @@ Function1133fe: ; 1133fe ld a, [hli] ld h, [hl] ld l, a +rept 2 inc hl - inc hl +endr ld a, [hli] ld h, [hl] ld l, a @@ -7982,8 +8025,9 @@ Function1133fe: ; 1133fe ld a, [hld] cp $2f jr nz, .asm_11344c +rept 2 inc hl - inc hl +endr ld e, l ld d, h .asm_113455 @@ -8001,8 +8045,9 @@ Function1133fe: ; 1133fe ld a, [hli] ld h, [hl] ld l, a +rept 2 inc hl - inc hl +endr ld a, [hli] ld h, [hl] ld l, a @@ -8099,8 +8144,9 @@ Function1134cb: ; 1134cb ret .asm_1134f0 +rept 2 inc [hl] - inc [hl] +endr jr .asm_1134fc .asm_1134f4 @@ -8585,10 +8631,9 @@ Function1136c1: ; 1136c1 ld a, [hli] ld h, [hl] ld l, a +rept 4 inc hl - inc hl - inc hl - inc hl +endr ld a, h ld [$cc0d], a ld a, l @@ -9126,9 +9171,9 @@ Function113c8e: ; 113c8e ld bc, $0003 .asm_113ccf +rept 3 dec bc - dec bc - dec bc +endr ld a, c ld [$cc10], a ld a, b @@ -9164,8 +9209,9 @@ Function113c8e: ; 113c8e ld a, $3f and c ld [hld], a +rept 2 dec hl - dec hl +endr pop de ld b, h ld c, l @@ -9276,10 +9322,9 @@ Function113d66: ; 113d66 ld c, a ld a, [$cc11] ld b, a +rept 4 dec bc - dec bc - dec bc - dec bc +endr ld a, b or c jr z, .asm_113dae @@ -9513,8 +9558,9 @@ Function113ec7: ; 113ec7 ld a, [hli] ld h, [hl] ld l, a +rept 2 inc hl - inc hl +endr ld a, [hld] dec hl xor $80 @@ -9555,8 +9601,9 @@ Function113ef2: ; 113ef2 ld l, a ld e, l ld d, h +rept 2 add hl, de - add hl, de +endr ld e, l ld d, h ld hl, $c815 @@ -9616,8 +9663,9 @@ Function113f2d: ; 113f2d ld l, a ld e, l ld d, h +rept 2 add hl, de - add hl, de +endr ld e, l ld d, h ld hl, $c815 diff --git a/main.asm b/main.asm index e67531cb0..bda70c9a7 100644 --- a/main.asm +++ b/main.asm @@ -3108,9 +3108,9 @@ Function7420: ; 7420 .loop sub [hl] jr c, .ok +rept 3 inc hl - inc hl - inc hl +endr jr .loop .ok @@ -4443,8 +4443,9 @@ HealPartyMon: ; c677 ; bc = PartyMon1HP - PartyMon1Species ld b, h ld c, l +rept 2 dec bc - dec bc +endr ld a, [hli] ld [bc], a @@ -6880,8 +6881,9 @@ endr dec hl ld b, h ld c, l +rept 2 inc hl - inc hl +endr .loop2 ld a, [hli] ld [bc], a @@ -7746,8 +7748,9 @@ Functiond784: ; d784 push hl add hl, de ld a, " " +rept 2 ld [hli], a - ld [hli], a +endr ld [hld], a dec hl ld a, [wd1ec] @@ -8030,10 +8033,9 @@ Functiond906: ; d906 .asm_d950 pop de +rept 4 inc de - inc de - inc de - inc de +endr ld a, [PlayerID] ld [de], a inc de @@ -8100,15 +8102,15 @@ Functiond906: ; d906 inc de push hl push de +rept 2 inc hl - inc hl +endr call FillPP pop de pop hl +rept 4 inc de - inc de - inc de - inc de +endr ld a, $46 ld [de], a inc de @@ -8522,8 +8524,9 @@ Functiondb3f: ; db3f ld a, [CurPartySpecies] cp EGG jr z, .asm_dc9e +rept 2 inc hl - inc hl +endr ld a, [hli] ld [de], a ld a, [hl] @@ -9271,8 +9274,9 @@ Functione17b: ; e17b ld a, c cp $6 jr nz, .asm_e193 +rept 2 dec hl - dec hl +endr .asm_e193 sla c @@ -9309,14 +9313,15 @@ Functione17b: ; e17b ld a, [hl] swap a and $1 +rept 3 add a - add a - add a +endr ld b, a ld a, [hli] and $1 +rept 2 add a - add a +endr add b ld b, a ld a, [hl] @@ -9518,8 +9523,9 @@ GivePoke:: ; e277 ld a, [ScriptBank] call FarCopyBytes pop hl +rept 2 inc hl - inc hl +endr ld a, [ScriptBank] call GetFarHalfword pop bc @@ -10371,25 +10377,22 @@ Function11452:: ; 11452 ret nc xor a ld hl, DailyFlags +rept 3 ld [hli], a - ld [hli], a - ld [hli], a +endr ld [hl], a ld hl, wdc4c +rept 4 ld [hli], a - ld [hli], a - ld [hli], a - ld [hli], a +endr ld hl, wdc50 +rept 4 ld [hli], a - ld [hli], a - ld [hli], a - ld [hli], a +endr ld hl, wdc54 +rept 4 ld [hli], a - ld [hli], a - ld [hli], a - ld [hli], a +endr ld hl, wdc58 ld a, [hl] and a @@ -10644,16 +10647,17 @@ Function115d2: ; 115d2 ; 115d6 Function115d6: ; 115d6 +rept 2 inc hl - inc hl +endr xor a jr Function115eb ; 115db Function115db: ; 115db +rept 3 inc hl - inc hl - inc hl +endr ld a, [hSeconds] ld c, a sub [hl] @@ -11484,8 +11488,9 @@ Function11a8b: ; 11a8b (4:5a8b) jr nz, .asm_11ade ld a, $4 .asm_11ade +rept 2 dec a - dec a +endr ld e, a add a add e @@ -12177,8 +12182,9 @@ Function1210c: ; 1210c (4:610c) jr nz, .asm_1215f ld a, $4 .asm_1215f +rept 2 dec a - dec a +endr ld e, a add a add e @@ -12253,8 +12259,9 @@ Function121b2: ; 121b2 jr nz, .asm_121c3 push hl ld hl, wc6d2 +rept 2 dec [hl] - dec [hl] +endr jr .asm_121c8 .asm_121c3 @@ -12582,9 +12589,9 @@ Function12469: ; 12469 ld [hld], a ld a, e ld [hli], a +rept 3 inc hl - inc hl - inc hl +endr dec c jr nz, .asm_12486 pop de @@ -13079,8 +13086,9 @@ endr push de ld a, [MenuSelection] call .GetMenuAccountTextPointer +rept 2 inc hl - inc hl +endr ld a, [hli] ld d, [hl] ld e, a @@ -13095,10 +13103,9 @@ endr cp $ff jr z, .none call .GetMenuAccountTextPointer +rept 4 inc hl - inc hl - inc hl - inc hl +endr ld a, [hli] ld d, [hl] ld e, a @@ -15063,8 +15070,9 @@ Function1347d: ; 1347d call GetFarByte cp $ff jr z, .asm_134be +rept 2 inc hl - inc hl +endr ld a, [EngineBuffer1] call GetFarByte inc hl @@ -15765,8 +15773,9 @@ Function138b0: ; 138b0 pop de jr nz, .done ld a, e +rept 2 inc a - inc a +endr ld [wd00e], a dec a ld c, a @@ -15778,8 +15787,9 @@ endr ld a, [hli] ld h, [hl] ld l, a +rept 2 inc hl - inc hl +endr .loop2 call Random and 3 @@ -15855,8 +15865,9 @@ ContestScore: ; 13900 ld a, [wContestMonDVs + 0] ld b, a and 2 +rept 2 add a - add a +endr ld c, a swap b @@ -15875,10 +15886,12 @@ ContestScore: ; 13900 ld a, b and 2 srl a +rept 2 add c - add c - add d +endr +rept 2 add d +endr call .AddContestStat @@ -15956,8 +15969,9 @@ Special_SelectRandomBugContestContestants: ; 139a8 ld b, RESET_FLAG call EventFlagAction pop hl +rept 2 inc hl - inc hl +endr pop bc dec c jr nz, .loop1 @@ -16378,8 +16392,9 @@ GetTimeOfDay:: ; 14032 cp [hl] jr c, .match ; else, get the next entry +rept 2 inc hl - inc hl +endr ; try again jr .check @@ -16917,8 +16932,9 @@ AddSpriteGFX: ; 142e5 jr z, .exists and a jr z, .new +rept 2 inc hl - inc hl +endr dec c jr nz, .loop @@ -16980,8 +16996,9 @@ SortUsedSprites: ; 1431e ld a, [de] and a jr nz, .FoundLastSprite +rept 2 dec de - dec de +endr dec c jr nz, .FindLastSprite .FoundLastSprite @@ -17023,14 +17040,16 @@ SortUsedSprites: ; 1431e ; Keep doing this until everything's in order. .loop +rept 2 dec de - dec de +endr dec c jr nz, .CheckFollowing pop hl +rept 2 inc hl - inc hl +endr pop de pop bc dec c @@ -20436,8 +20455,9 @@ endr Function15c91: ; 15c91 call Function15ca3 +rept 2 inc hl - inc hl +endr ld a, [hl] and a jp z, Function15d83 @@ -21387,8 +21407,9 @@ Function162e0: ; 162e0 call PrintText xor a ld hl, StringBuffer2 +rept 2 ld [hli], a - ld [hli], a +endr ld [hl], a ld a, $5 ld [wcf64], a @@ -21454,8 +21475,9 @@ Function16373: ; 16373 call PrintText xor a ld hl, StringBuffer2 +rept 2 ld [hli], a - ld [hli], a +endr ld [hl], a ld a, $5 ld [wcf64], a @@ -22748,8 +22770,9 @@ Function16a66: ; 16a66 ld hl, wEggMonHappiness ld [hli], a xor a +rept 2 ld [hli], a - ld [hli], a +endr ld [hl], a ld a, [CurPartyLevel] ld [wEggMonLevel], a @@ -25135,9 +25158,9 @@ Function2446d:: ; 2446d ld a, $1 ld [hli], a xor a +rept 3 ld [hli], a - ld [hli], a - ld [hli], a +endr ret ; 244c3 @@ -26338,8 +26361,9 @@ Function24c64: ; 24c64 ld a, [hl] call Function24c94 .asm_24c89 +rept 2 inc hl - inc hl +endr jr .asm_24c73 .asm_24c8d @@ -27142,9 +27166,9 @@ Function2513b: ; 2513b (9:513b) call WaitBGMap ld hl, wcf63 xor a +rept 3 ld [hli], a - ld [hli], a - ld [hli], a +endr ld [hl], a ret @@ -27398,10 +27422,9 @@ Function2536c: ; 2536c (9:536c) ld c, $4 .asm_2537c call Function253f4 +rept 4 inc hl - inc hl - inc hl - inc hl +endr dec c jr nz, .asm_2537c hlcoord 2, 13 @@ -27409,10 +27432,9 @@ Function2536c: ; 2536c (9:536c) ld c, $4 .asm_2538d call Function253f4 +rept 4 inc hl - inc hl - inc hl - inc hl +endr dec c jr nz, .asm_2538d xor a @@ -27782,10 +27804,9 @@ FindOakRating: ; 0x2666b ld a, [hli] cp c jr nc, .match +rept 4 inc hl - inc hl - inc hl - inc hl +endr jr .loop .match @@ -30101,9 +30122,9 @@ Function28434: ; 28434 jr nz, .asm_28441 ld hl, wc608 ld a, $fd +rept 3 ld [hli], a - ld [hli], a - ld [hli], a +endr ld b, $c8 xor a .asm_28457 @@ -30607,12 +30628,14 @@ Function286ba: ; 286ba ld a, $46 ld [hli], a xor a +rept 2 ld [hli], a - ld [hli], a +endr ld [hl], a pop hl +rept 2 inc de - inc de +endr ret ; 28771 @@ -30722,9 +30745,9 @@ Function287e3: ; 287e3 callba Function16d673 xor a ld hl, wcf51 +rept 3 ld [hli], a - ld [hli], a - ld [hli], a +endr ld [hl], a ld a, $1 ld [wcfa9], a @@ -33656,13 +33679,15 @@ LoadWildMonData: ; 29ff8 jr c, .asm_2a006 ld hl, wd25a xor a +rept 2 ld [hli], a - ld [hli], a +endr ld [hl], a jr .asm_2a011 .asm_2a006 +rept 2 inc hl - inc hl +endr ld de, wd25a ld bc, $3 call CopyBytes @@ -33670,8 +33695,9 @@ LoadWildMonData: ; 29ff8 call Function2a21d ld a, $0 jr nc, .asm_2a01b +rept 2 inc hl - inc hl +endr ld a, [hl] .asm_2a01b ld [wd25d], a @@ -33712,9 +33738,9 @@ Function2a052: ; 2a052 ld b, a ld a, [hli] ld c, a +rept 3 inc hl - inc hl - inc hl +endr ld a, $15 call Function2a088 jr nc, .asm_2a067 @@ -33759,8 +33785,9 @@ Function2a088: ; 2a088 ld a, [wd265] cp [hl] jr z, .asm_2a098 +rept 2 inc hl - inc hl +endr pop af dec a jr nz, .asm_2a089 @@ -33918,14 +33945,15 @@ Function2a14f: ; 2a14f call Function2a2ce jp c, .asm_2a1c9 +rept 3 inc hl - inc hl - inc hl +endr call Function1852 ld de, Unknown_2a1d9 jr z, .asm_2a174 +rept 2 inc hl - inc hl +endr ld a, [TimeOfDay] ld bc, $e call AddNTimes @@ -34035,10 +34063,9 @@ Function2a1df:: ; 2a1df .asm_2a1f2 ; to PartyMonLevel +rept 4 dec hl - dec hl - dec hl - dec hl +endr ld a, [CurPartyLevel] cp [hl] @@ -34235,9 +34262,9 @@ Function2a2ce: ; 2a2ce ld a, e cp [hl] jr nz, .asm_2a30a +rept 3 dec hl - dec hl - dec hl +endr ld a, [hli] ld [wd22e], a ld a, [hl] @@ -34955,9 +34982,9 @@ Function2c075: ; 2c075 jr z, .asm_2c08b .asm_2c07f +rept 3 dec hl - dec hl - dec hl +endr ld a, [hl] and a ld b, $32 @@ -34966,9 +34993,9 @@ Function2c075: ; 2c075 jr .asm_2c08e .asm_2c08b +rept 3 dec hl - dec hl - dec hl +endr .asm_2c08e ld a, b @@ -36010,9 +36037,9 @@ Function2c9e2: ; 2c9e2 (b:49e2) jr .asm_2ca85 .asm_2ca77 call Function2ca86 +rept 3 inc hl - inc hl - inc hl +endr push de ld de, String_2caae call PlaceString @@ -36493,9 +36520,9 @@ ClearBattleRAM: ; 2ef18 ld [wd0ee], a ld hl, wd0d8 +rept 3 ld [hli], a - ld [hli], a - ld [hli], a +endr ld [hl], a ld [wd0e4], a @@ -37000,9 +37027,9 @@ TrainerType4: ; 3989d Function3991b: ; 3991b (e:591b) ld hl, $ffb3 xor a +rept 3 ld [hli], a - ld [hli], a - ld [hli], a +endr ld a, [wc652] ; base reward ld [hli], a ld a, [CurPartyLevel] @@ -37884,9 +37911,9 @@ AIChooseMove: ; 440ce ; The default score is 20. Unusable moves are given a score of 80. ld a, 20 ld hl, Buffer1 +rept 3 ld [hli], a - ld [hli], a - ld [hli], a +endr ld [hl], a ; Don't pick disabled moves. @@ -38205,8 +38232,9 @@ Function4424d: ; 4424d ld d, l ld e, h pop hl +rept 2 inc hl - inc hl +endr ld a, d or e jr z, .asm_442b0 @@ -38350,10 +38378,9 @@ Function44355: ; 44355 inc hl cp $50 jr nz, .asm_4435b +rept 4 inc hl - inc hl - inc hl - inc hl +endr dec c jr z, .asm_44374 .asm_4436b @@ -39503,8 +39530,9 @@ Function48444: ; 48444 (12:4444) .asm_4844b and a jr z, .asm_48453 +rept 2 inc hl - inc hl +endr dec a jr .asm_4844b .asm_48453 @@ -39729,12 +39757,13 @@ Function486bf: ; 486bf (12:46bf) pop af ld [hli], a ld a, $1 +rept 2 ld [hli], a - ld [hli], a +endr xor a +rept 3 ld [hli], a - ld [hli], a - ld [hli], a +endr ret Function48725: ; 48725 (12:4725) @@ -39785,9 +39814,9 @@ Function4873c: ; 4873c (12:473c) ld a, $1 ld [hli], a xor a +rept 3 ld [hli], a - ld [hli], a - ld [hli], a +endr ret Function4876f: ; 4876f (12:476f) @@ -39854,10 +39883,9 @@ Function487ec: ; 487ec (12:47ec) ld de, wd473 call Function487ff pop hl +rept 4 inc hl - inc hl - inc hl - inc hl +endr ld de, String_4880d call PlaceString ret @@ -40655,10 +40683,12 @@ Function48cdc: ; 48cdc (12:4cdc) pop bc ld de, AttrMap - TileMap add hl, de +rept 2 inc b - inc b - inc c +endr +rept 2 inc c +endr ld a, $0 .asm_48ced push bc @@ -41594,9 +41624,9 @@ Function49797: ; 49797 hlcoord 2, 16, AttrMap ld [hli], a ld a, $7 +rept 3 ld [hli], a - ld [hli], a - ld [hli], a +endr ld a, $2 ld [hl], a hlcoord 2, 17, AttrMap @@ -41718,9 +41748,9 @@ Function498f9: ; 498f9 ld c, $4 .loop ld [hli], a +rept 3 inc hl - inc hl - inc hl +endr inc a dec c jr nz, .loop @@ -42544,8 +42574,9 @@ Function4a071: ; 4a071 (12:6071) add $2 ld [hli], a ld a, $1 +rept 2 ld [hli], a - ld [hli], a +endr ret Function4a098: ; 4a098 (12:6098) @@ -42627,8 +42658,9 @@ Function4a118: ; 4a118 (12:6118) add $2 ld [hli], a ld a, $1 +rept 2 ld [hli], a - ld [hli], a +endr ret Function4a13b: ; 4a13b (12:613b) @@ -42902,8 +42934,9 @@ Function4a373: ; 4a373 (12:6373) add $2 ld [hli], a ld a, $1 +rept 2 ld [hli], a - ld [hli], a +endr ret ; 4a39a (12:639a) @@ -43214,12 +43247,13 @@ Function4a680: ; 4a680 (12:6680) add $2 ld [hli], a ld a, $1 +rept 2 ld [hli], a - ld [hli], a +endr xor a +rept 3 ld [hli], a - ld [hli], a - ld [hli], a +endr ret Function4a6ab: ; 4a6ab (12:66ab) @@ -44159,8 +44193,9 @@ Function4abc3: ; 4abc3 ld a, [wcfa9] ld [wcfa9], a ld a, [PartyCount] +rept 2 inc a - inc a +endr ld b, a ld a, [wcfa9] cp b @@ -44890,8 +44925,9 @@ Function4d15b:: ; 4d15b ld a, [wd197] and a jr z, .asm_4d170 +rept 2 inc hl - inc hl +endr .asm_4d170 decoord 0, 0 @@ -45115,10 +45151,12 @@ Function4d35b: ; 4d35b pop bc ld de, AttrMap - TileMap add hl, de +rept 2 inc b - inc b - inc c +endr +rept 2 inc c +endr ld a, $7 .asm_4d36e push bc @@ -46894,8 +46932,9 @@ Function4e0e7: ; 4e0e7 (13:60e7) inc a ld d, a callba Function50e47 +rept 2 ld hl, TempMonExp + 2 - ld hl, TempMonExp + 2 +endr ld a, [$ffb6] sub [hl] dec hl @@ -46911,8 +46950,9 @@ Function4e0e7: ; 4e0e7 (13:60e7) .asm_4e111 ld hl, Buffer1 ; wd1ea (aliases: MagikarpLength) xor a +rept 2 ld [hli], a - ld [hli], a +endr ld [hl], a ret ; 4e119 (13:6119) @@ -47488,8 +47528,9 @@ Function4e5b7: ; 4e5b7 (13:65b7) ld a, $1 ld [hli], a ld a, $5 +rept 2 ld [hli], a - ld [hli], a +endr ld [hl], $ff ret ; 4e5da (13:65da) @@ -47692,8 +47733,9 @@ Function4e726: ; 4e726 call Function4e741 pop bc inc b +rept 2 dec c - dec c +endr jr nz, .asm_4e72c and a ret @@ -47849,8 +47891,9 @@ Function4e80c: ; 4e80c ld a, [$ff9b] and $e srl a +rept 2 inc a - inc a +endr and $7 ld b, a ld hl, Sprites + 3 @@ -47859,9 +47902,9 @@ Function4e80c: ; 4e80c ld a, [hl] or b ld [hli], a +rept 3 inc hl - inc hl - inc hl +endr dec c jr nz, .asm_4e823 pop bc @@ -48091,10 +48134,12 @@ Function4e9ab: ; 4e9ab ld a, d ld [hSCX], a call Function4e9f1 +rept 2 inc e - inc e - dec d +endr +rept 2 dec d +endr pop af push af cp $1 @@ -48116,8 +48161,9 @@ Function4e9d6: ; 4e9d6 ld c, $12 ld de, $0004 .asm_4e9de +rept 2 dec [hl] - dec [hl] +endr add hl, de dec c jr nz, .asm_4e9de @@ -48356,8 +48402,9 @@ Function5009b: ; 5009b jr nz, .asm_500a7 .asm_500bf +rept 2 dec hl - dec hl +endr ld de, String_500c8 call PlaceString ret @@ -48465,8 +48512,9 @@ Function50138: ; 50138 pop de ld a, $f3 ld [hli], a +rept 2 inc de - inc de +endr ld bc, $0203 call PrintNum @@ -48669,16 +48717,19 @@ Function50268: ; 50268 ld a, [hli] and a jr z, .asm_5029f +rept 2 inc hl - inc hl +endr cp EVOLVE_ITEM jr nz, .asm_50287 +rept 2 dec hl - dec hl +endr ld a, [CurItem] cp [hl] +rept 2 inc hl - inc hl +endr jr nz, .asm_50287 ld de, String_502a3 ret @@ -50116,9 +50167,9 @@ Function50c50: ; 50c50 .asm_50c6f pop hl +rept 3 inc hl - inc hl - inc hl +endr ld d, h ld e, l ld hl, TempMonMoves @@ -50230,8 +50281,9 @@ Function50cdb: ; 50cdb Function50d0a: ; 50d0a push de +rept 2 inc de - inc de +endr ld a, [de] ld b, a inc de @@ -50451,8 +50503,9 @@ Function50e1b: ; 50e1b Function50e47: ; 50e47 ld a, [BaseGrowthRate] +rept 2 add a - add a +endr ld c, a ld b, 0 ld hl, GrowthRates @@ -53080,8 +53133,9 @@ Function81c33: ; 81c33 ld a, [wc608 + 3] ld [hli], a xor a +rept 2 ld [hli], a - ld [hli], a +endr ld [hl], a ld hl, wcda9 call Function81f0c @@ -53097,9 +53151,9 @@ Function81c33: ; 81c33 ; 81ca7 Function81ca7: ; 81ca7 +rept 3 inc hl - inc hl - inc hl +endr ld a, [de] call Function81cbc ld a, [de] @@ -53376,8 +53430,9 @@ String_81e4d: db "おぼえられない@" ; cannot be taught Function81e55: ; 81e55 cp $32 jr c, .asm_81e5b +rept 2 inc a - inc a +endr .asm_81e5b add $bf @@ -53490,8 +53545,9 @@ Function81ee3: ; 81ee3 inc de ld [hli], a xor a +rept 2 ld [hli], a - ld [hli], a +endr dec c jr nz, .asm_81ee3 ret @@ -53626,8 +53682,9 @@ Function81f5e: ; 81f5e ld a, b ld [hli], a ld a, [de] +rept 2 add a - add a +endr add $18 ld [hli], a xor a @@ -53718,22 +53775,19 @@ Function821d8: ; 821d8 Function821de: ; 821de add hl, de +rept 4 ld [hli], a - ld [hli], a - ld [hli], a - ld [hli], a +endr ld bc, $0010 add hl, bc +rept 4 ld [hli], a - ld [hli], a - ld [hli], a - ld [hli], a +endr ld bc, $0010 add hl, bc +rept 4 ld [hli], a - ld [hli], a - ld [hli], a - ld [hli], a +endr ret ; 821f4 @@ -54332,9 +54386,9 @@ Function841e2: ; 841e2 (21:41e2) Function841fb: ; 841fb (21:41fb) xor a ld hl, wca82 +rept 3 ld [hli], a - ld [hli], a - ld [hli], a +endr ld [hl], a ld hl, wca86 ld [hli], a @@ -55762,8 +55816,9 @@ Function865b5: ; 865b5 ld a, [hli] ld [TempMonSpecies], a ld [CurPartySpecies], a +rept 2 inc hl - inc hl +endr ld a, [hli] ld [TempMonDVs], a ld a, [hli] @@ -55824,8 +55879,9 @@ Function86643: ; 86643 ld a, [hSCX] and a ret z +rept 2 dec a - dec a +endr ld [hSCX], a call DelayFrame jr .asm_86643 @@ -57892,8 +57948,9 @@ Function896eb: ; 896eb Function896f5: ; 896f5 call Function8971f call Function89736 +rept 2 inc hl - inc hl +endr ld b, 2 ClearScreenArea: ; 0x896ff @@ -57919,8 +57976,9 @@ ClearScreenArea: ; 0x896ff jr nz, .loop dec hl +rept 2 inc c - inc c +endr .asm_89713 ld a, $36 ld [hli], a @@ -57954,8 +58012,9 @@ Function8971f: ; 8971f Function89736: ; 89736 push hl +rept 2 inc hl - inc hl +endr ld e, c ld d, $0 add hl, de @@ -57991,8 +58050,9 @@ Function8975b: ; 8975b ld [hli], a ld a, $d ld [hl], a +rept 2 dec hl - dec hl +endr ld a, $4 ld e, $3 .asm_89769 @@ -58757,8 +58817,9 @@ Function89b97: ; 89b97 (22:5b97) and a jr z, .asm_89bae .asm_89ba9 +rept 2 inc hl - inc hl +endr dec a jr nz, .asm_89ba9 .asm_89bae @@ -59274,10 +59335,9 @@ Function89efd: ; 89efd (22:5efd) ld a, $ff ld [hli], a xor a +rept 4 ld [hli], a - ld [hli], a - ld [hli], a - ld [hli], a +endr ld [hl], a .asm_89f09 ld hl, wd012 @@ -59368,8 +59428,9 @@ Function89f77: ; 89f77 (22:5f77) ld [hli], a ld a, c ld [hli], a +rept 2 inc hl - inc hl +endr ld a, $8 add c ld c, a @@ -59500,9 +59561,9 @@ Function8a055: ; 8a055 (22:6055) ld a, $5 call Function8a5a3 pop hl +rept 3 inc hl - inc hl - inc hl +endr ld a, $6 call Function8a5a3 call Function3238 @@ -61478,8 +61539,9 @@ Function8aee9: ; 8aee9 .asm_8aef5 call Function8aefd +rept 2 inc hl - inc hl +endr inc de jr .asm_8aee9 ; 8aefd @@ -61506,8 +61568,9 @@ Function8af09: ; 8af09 jr z, .asm_8af19 ld c, a call Function8af1c +rept 2 inc hl - inc hl +endr inc de jr .asm_8af0b @@ -62081,9 +62144,9 @@ Function8b27a: ; 8b27a ; 8b281 Function8b281: ; 8b281 +rept 3 inc de - inc de - inc de +endr ld a, [de] ld l, a inc de @@ -62124,8 +62187,9 @@ Function8b29d: ; 8b29d Function8b2a9: ; 8b2a9 push bc call Function8b281 +rept 2 inc hl - inc hl +endr ld b, $0 rept 2 add hl, bc @@ -62578,8 +62642,9 @@ Function8b4d8: ; 8b4d8 (22:74d8) ld hl, Unknown_8b529 call Function8b50a push hl +rept 2 inc hl - inc hl +endr ld a, [hli] ld b, a ld a, [hl] @@ -62594,8 +62659,9 @@ Function8b4ea: ; 8b4ea (22:74ea) ld hl, Unknown_8b529 call Function8b50a push hl +rept 2 inc hl - inc hl +endr ld a, [hli] ld b, a ld a, [hl] @@ -62963,10 +63029,12 @@ Function8b73e: ; 8b73e Function8b744: ; 8b744 ld de, AttrMap - TileMap add hl, de +rept 2 inc b - inc b - inc c +endr +rept 2 inc c +endr xor a .asm_8b74d push bc @@ -63565,9 +63633,9 @@ Special_BattleTowerFade: ; 8c092 ld b, $4 .asm_8c09c call DmgToCgbTimePals +rept 3 inc hl - inc hl - inc hl +endr ld c, $7 call DelayFrames dec b @@ -63609,12 +63677,9 @@ Function8c0c1: ; 8c0c1 ld [hli], a ld a, d ld [hli], a +rept 6 inc hl - inc hl - inc hl - inc hl - inc hl - inc hl +endr dec c jr nz, .asm_8c0d4 pop af @@ -63725,9 +63790,9 @@ DmgToCgbTimePals: ; 8c14e Function8c15e: ; 8c15e .asm_8c15e call DmgToCgbTimePals +rept 3 inc hl - inc hl - inc hl +endr ld c, $2 call DelayFrames dec b @@ -63738,9 +63803,9 @@ Function8c15e: ; 8c15e Function8c16d: ; 8c16d .asm_8c16d call DmgToCgbTimePals +rept 3 dec hl - dec hl - dec hl +endr ld c, $2 call DelayFrames dec b @@ -63909,8 +63974,9 @@ Function8c26d: ; 8c26d ld [hBGMapMode], a ld hl, wcf63 xor a +rept 2 ld [hli], a - ld [hli], a +endr ld [hl], a call Function8c6d8 ret @@ -64849,8 +64915,9 @@ Function8ca23: ; 8ca23 (23:4a23) ld a, $20 ld [wcf64], a ld hl, wcf63 +rept 2 inc [hl] - inc [hl] +endr ret Function8ca3c: ; 8ca3c (23:4a3c) @@ -65048,9 +65115,9 @@ Function8cb82: ; 8cb82 (23:4b82) ld c, $4 .asm_8cb88 ld [hli], a +rept 3 inc hl - inc hl - inc hl +endr inc a dec c jr nz, .asm_8cb88 @@ -65217,8 +65284,9 @@ Function8cc99: ; 8cc99 ld d, a ld hl, wcf64 ld a, [hl] +rept 2 add d - add d +endr ld [hl], a ret ; 8ccc4 @@ -65267,9 +65335,9 @@ Function8ccc9: ; 8ccc9 xor a ld [hli], a ld a, [wd192] +rept 3 ld [hli], a - ld [hli], a - ld [hli], a +endr ld de, MUSIC_MAGNET_TRAIN call PlayMusic2 ret @@ -65514,15 +65582,17 @@ Function8ce7a: ; 8ce7a inc a ld d, a ld a, e +rept 2 add d - add d +endr ld [wcf65], a ld hl, wc3c0 ld a, [wd191] ld d, a ld a, [hl] +rept 2 add d - add d +endr ld [hl], a ret @@ -65754,18 +65824,19 @@ endr ld a, d ld [hli], a xor a +rept 2 ld [hli], a - ld [hli], a +endr xor a +rept 2 ld [hli], a - ld [hli], a +endr dec a ld [hli], a xor a +rept 4 ld [hli], a - ld [hli], a - ld [hli], a - ld [hli], a +endr ld [hl], a ld a, c ld [wc3b8], a @@ -66024,8 +66095,9 @@ Function8d132: ; 8d132 ld [hl], a ld hl, $000a add hl, bc +rept 2 dec [hl] - dec [hl] +endr jr .asm_8d132 .asm_8d17b @@ -66360,8 +66432,9 @@ Function8d381: ; 8d381 (23:5381) ld a, [hl] and a jr z, .asm_8d3ba +rept 2 dec [hl] - dec [hl] +endr ld d, a and $1f jr nz, .asm_8d395 @@ -66644,8 +66717,9 @@ Function8d52a: ; 8d52a (23:552a) ld hl, $4 add hl, bc ld a, [hl] +rept 2 inc [hl] - inc [hl] +endr cp $b0 jr nc, .asm_8d53f and $3 @@ -66714,9 +66788,9 @@ Function8d57f: ; 8d57f (23:557f) ld hl, $c add hl, bc ld a, [hl] +rept 3 inc [hl] - inc [hl] - inc [hl] +endr push af push de call Function8d6de @@ -66745,8 +66819,9 @@ Function8d5b0: ; 8d5b0 (23:55b0) ret c ld hl, $5 add hl, bc +rept 2 dec [hl] - dec [hl] +endr ld hl, $f add hl, bc ld a, [hl] @@ -66772,8 +66847,9 @@ Function8d5e2: ; 8d5e2 (23:55e2) ld a, [hl] cp $b8 jr nc, .asm_8d603 +rept 2 inc [hl] - inc [hl] +endr ld hl, $5 add hl, bc dec [hl] @@ -66799,8 +66875,9 @@ Function8d607: ; 8d607 (23:5607) ret z ld hl, $5 add hl, bc +rept 2 inc [hl] - inc [hl] +endr ld hl, $f add hl, bc ld a, [hl] @@ -66875,9 +66952,9 @@ Function8d680: ; 8d680 (23:5680) ld hl, $b add hl, bc ld d, [hl] +rept 3 inc [hl] - inc [hl] - inc [hl] +endr ld hl, $c add hl, bc ld a, [hl] @@ -68387,8 +68464,9 @@ Function8e79d: ; 8e79d call Function8e7c6 call DelayFrame pop bc +rept 2 inc d - inc d +endr dec c jr nz, .asm_8e7b5 call ClearSprites @@ -68624,10 +68702,9 @@ Function8e908: ; 8e908 (23:6908) ld [CurIcon], a call Function8e9db ld a, [$ffb0] +rept 4 add a - add a - add a - add a +endr add $1c ld d, a ld e, $10 @@ -69163,8 +69240,9 @@ Function90136:: ; 90136 (24:4136) call _hl_ jr nc, .asm_90171 call Function90178 +rept 2 inc hl - inc hl +endr ld a, [hli] ld e, a push hl @@ -69411,8 +69489,9 @@ Phone_CallerTextboxWithName2: ; 902c9 call Phone_CallerTextbox hlcoord 1, 2 ld [hl], $62 +rept 2 inc hl - inc hl +endr ld a, [PhoneScriptBank] ld b, a ld a, [PhoneCallerLo] @@ -69511,8 +69590,9 @@ Function90363: ; 90363 (24:4363) call Phone_CallerTextbox hlcoord 1, 1 ld [hl], $62 +rept 2 inc hl - inc hl +endr ld d, h ld e, l pop bc @@ -69962,8 +70042,9 @@ Function907f1: ; 907f1 push hl call Function907de pop de +rept 2 inc de - inc de +endr ld a, $9c ld [de], a inc de @@ -69977,9 +70058,9 @@ Function907f1: ; 907f1 ld [hl], a pop hl call Function90859 +rept 3 inc hl - inc hl - inc hl +endr ret ; 90810 @@ -71586,8 +71667,9 @@ Function912d8: ; 912d8 (24:52d8) ld [hli], a dec c jr nz, .asm_912e1 +rept 2 inc hl - inc hl +endr dec b jr nz, .asm_912df ld a, [wc6d2] @@ -71979,8 +72061,9 @@ Function9164e: ; 9164e (24:564e) ld a, [hl] and a ret z +rept 2 dec [hl] - dec [hl] +endr jr .update .up @@ -71988,8 +72071,9 @@ Function9164e: ; 9164e (24:564e) ld a, [hl] cp 80 ret nc +rept 2 inc [hl] - inc [hl] +endr .update @@ -72003,8 +72087,9 @@ UpdateRadioStation: ; 9166f (24:566f) jr z, .asm_91682 cp d jr z, .asm_91686 +rept 2 inc hl - inc hl +endr jr .asm_91676 .asm_91682 @@ -73874,9 +73959,9 @@ Function9282c: ; 9282c ld a, [hl] xor $20 ld [hli], a +rept 3 inc hl - inc hl - inc hl +endr dec c jr nz, .asm_92839 ret @@ -74364,9 +74449,9 @@ Function92b22: ; 92b22 (24:6b22) ld a, [hl] add d ld [hli], a +rept 3 inc hl - inc hl - inc hl +endr dec e jr nz, .asm_92b49 ret @@ -74426,8 +74511,9 @@ Function92b83: ; 92b83 (24:6b83) add $8 ld [hli], a ld a, [de] +rept 2 inc a - inc a +endr ld [hli], a srl a srl a @@ -74846,8 +74932,9 @@ Function92dca: ; 92dca ld [hl], $0 ld hl, $0000 add hl, bc +rept 2 dec [hl] - dec [hl] +endr ld a, $1 ld [wcf64], a ret @@ -75530,10 +75617,9 @@ Function931ba: ; 931ba hlcoord 18, 17 ld [hl], $ee ld hl, UnknownText_0x931db +rept 4 inc bc - inc bc - inc bc - inc bc +endr ret ; 931db @@ -75662,8 +75748,9 @@ Function93289: ; 93289 (24:7289) ld hl, $6 add hl, bc ld a, [hl] +rept 2 inc [hl] - inc [hl] +endr cp $48 jr nc, .asm_932a3 and $3 @@ -76019,10 +76106,12 @@ Functionb8101: ; b8101 (2e:4101) Functionb8115: ; b8115 ld de, AttrMap - TileMap add hl, de +rept 2 inc b - inc b - inc c +endr +rept 2 inc c +endr ld a, $87 .asm_b811f push bc @@ -76082,13 +76171,15 @@ Functionb8164: ; b8164 jr .asm_b816a .asm_b8168 +rept 2 ld [hli], a - ld [hli], a +endr .asm_b816a inc a +rept 2 ld [hli], a - ld [hli], a +endr dec a dec c jr nz, .asm_b8168 @@ -76515,9 +76606,9 @@ SelectTreeMon: ; b841f .loop sub [hl] jr c, .ok +rept 3 inc hl - inc hl - inc hl +endr jr .loop .ok @@ -76897,10 +76988,9 @@ endr jr .loop .done +rept 4 inc hl - inc hl - inc hl - inc hl +endr .not3 call Random @@ -77477,10 +77567,9 @@ endr pop hl pop af call Functionb8b11 +rept 4 inc hl - inc hl - inc hl - inc hl +endr ld a, l ld [wd26b], a ld a, h @@ -78881,8 +78970,9 @@ Functionb92b8: ; b92b8 cp $ff jr z, .asm_b92e6 inc c +rept 2 inc hl - inc hl +endr jr .asm_b92d9 .asm_b92e6 @@ -79710,8 +79800,9 @@ Functionb991e: ; b991e .asm_b991e ld a, [de] inc de +rept 2 ld [hli], a - ld [hli], a +endr dec c jr nz, .asm_b991e ret @@ -80304,13 +80395,13 @@ _CardFlip: ; e00ee (38:40ee) ld [wcf65], a ld de, MUSIC_GAME_CORNER call PlayMusic -.asm_e0170 +.MasterLoop ld a, [wcf63] bit 7, a - jr nz, .asm_e017c - call Functione0191 - jr .asm_e0170 -.asm_e017c + jr nz, .leavethegame + call .CardFlip + jr .MasterLoop +.leavethegame call WaitSFX ld de, SFX_QUIT_SLOTS call PlaySFX @@ -80320,11 +80411,11 @@ _CardFlip: ; e00ee (38:40ee) res 4, [hl] ret -Functione0191: ; e0191 (38:4191) +.CardFlip: ; e0191 (38:4191) ld a, [wcf63] ld e, a ld d, 0 - ld hl, Jumptable_e01a0 + ld hl, .Jumptable rept 2 add hl, de endr @@ -80334,62 +80425,62 @@ endr jp [hl] ; e01a0 (38:41a0) -Jumptable_e01a0: ; e01a0 - dw Functione01b5 - dw Functione01d2 - dw Functione0217 - dw Functione02b7 - dw Functione02da - dw Functione0314 - dw Functione031e - dw Functione0360 +.Jumptable: ; e01a0 + dw .AskPlayWithThree + dw .DeductCoins + dw .ChooseACard + dw .PlaceYourBet + dw .CheckTheCard + dw .TabulateTheResult + dw .PlayAgain + dw .Quit ; e01b0 -Functione01b0: ; e01b0 +.Increment: ; e01b0 ld hl, wcf63 inc [hl] ret ; e01b5 -Functione01b5: ; e01b5 - ld hl, UnknownText_0xe01cd +.AskPlayWithThree: ; e01b5 + ld hl, .PlayWithThreeCoinsText call Functione0489 call YesNoBox - jr c, .asm_e01c7 + jr c, .SaidNo call Functione0366 - call Functione01b0 + call .Increment ret -.asm_e01c7 +.SaidNo ld a, $7 ld [wcf63], a ret ; e01cd -UnknownText_0xe01cd: ; 0xe01cd +.PlayWithThreeCoinsText: ; 0xe01cd ; Play with three coins? text_jump UnknownText_0x1c5793 db "@" ; 0xe01d2 -Functione01d2: ; e01d2 +.DeductCoins: ; e01d2 ld a, [Coins] ld h, a ld a, [Coins + 1] ld l, a ld a, h and a - jr nz, .asm_e01ef + jr nz, .deduct ; You have at least 256 coins. ld a, l cp 3 - jr nc, .asm_e01ef - ld hl, UnknownText_0xe0212 + jr nc, .deduct ; You have at least 3 coins. + ld hl, .NotEnoughCoinsText call Functione0489 ld a, $7 ld [wcf63], a ret -.asm_e01ef +.deduct ld de, -3 add hl, de ld a, h @@ -80404,17 +80495,17 @@ Functione01d2: ; e01d2 ld a, $1 ld [hBGMapMode], a call WaitSFX - call Functione01b0 + call .Increment ret ; e0212 -UnknownText_0xe0212: ; 0xe0212 +.NotEnoughCoinsText: ; 0xe0212 ; Not enough coins… text_jump UnknownText_0x1c57ab db "@" ; 0xe0217 -Functione0217: ; e0217 +.ChooseACard: ; e0217 xor a ld [hBGMapMode], a hlcoord 0, 0 @@ -80438,15 +80529,15 @@ Functione0217: ; e0217 hlcoord 2, 6 call Functione03c1 call WaitBGMap - ld hl, UnknownText_0xe02b2 + ld hl, .ChooseACardText call Functione0489 xor a ld [wcf66], a -.asm_e025c +.loop call Functiona57 ld a, [$ffa9] and $1 - jr nz, .asm_e027c + jr nz, .next ld de, SFX_KINESIS call PlaySFX call Functione0849 @@ -80456,13 +80547,13 @@ Functione0217: ; e0217 ld a, [hl] xor $1 ld [hl], a - jr .asm_e025c + jr .loop -.asm_e027c +.next ld de, SFX_SLOT_MACHINE_START call PlaySFX ld a, $3 -.asm_e0284 +.loop2 push af call Functione0849 ld c, $4 @@ -80472,7 +80563,7 @@ Functione0217: ; e0217 call DelayFrames pop af dec a - jr nz, .asm_e0284 + jr nz, .loop2 ld hl, wcf66 ld a, [hl] push af @@ -80483,41 +80574,41 @@ Functione0217: ; e0217 call Functione04e5 pop af ld [wcf66], a - call Functione01b0 + call .Increment ret ; e02b2 -UnknownText_0xe02b2: ; 0xe02b2 +.ChooseACardText: ; 0xe02b2 ; Choose a card. text_jump UnknownText_0x1c57be db "@" ; 0xe02b7 -Functione02b7: ; e02b7 - ld hl, UnknownText_0xe02d5 +.PlaceYourBet: ; e02b7 + ld hl, .PlaceYourBetText call Functione0489 -.asm_e02bd +.betloop call Functiona57 ld a, [$ffa9] and $1 - jr nz, .asm_e02d1 + jr nz, .betdone call Functione089c call Functione0960 call DelayFrame - jr .asm_e02bd + jr .betloop -.asm_e02d1 - call Functione01b0 +.betdone + call .Increment ret ; e02d5 -UnknownText_0xe02d5: ; 0xe02d5 +.PlaceYourBetText: ; 0xe02d5 ; Place your bet. text_jump UnknownText_0x1c57ce db "@" ; 0xe02da -Functione02da: ; e02da +.CheckTheCard: ; e02da xor a ld [$ff9b], a call Functione0960 @@ -80544,62 +80635,62 @@ endr call Functione03ac call Functione03ec call Function3200 - call Functione01b0 + call .Increment ret ; e0314 -Functione0314: ; e0314 +.TabulateTheResult: ; e0314 call Functione0637 call Functiona80 - call Functione01b0 + call .Increment ret ; e031e -Functione031e: ; e031e +.PlayAgain: ; e031e call ClearSprites - ld hl, UnknownText_0xe0356 + ld hl, .PlayAgainText call Functione0489 call YesNoBox - jr nc, .asm_e0330 - call Functione01b0 + jr nc, .Continue + call .Increment ret -.asm_e0330 +.Continue ld a, [wc6e8] inc a ld [wc6e8], a cp $c - jr c, .asm_e034d + jr c, .KeepTheCurrentDeck call Functione04c1 ld a, $1 ld [hBGMapMode], a call Functione0366 - ld hl, UnknownText_0xe035b + ld hl, .CardsShuffledText call PrintText - jr .asm_e0350 + jr .LoopAround -.asm_e034d +.KeepTheCurrentDeck call Functione0534 -.asm_e0350 +.LoopAround ld a, $1 ld [wcf63], a ret ; e0356 -UnknownText_0xe0356: ; 0xe0356 +.PlayAgainText: ; 0xe0356 ; Want to play again? text_jump UnknownText_0x1c57df db "@" ; 0xe035b -UnknownText_0xe035b: ; 0xe035b +.CardsShuffledText: ; 0xe035b ; The cards have been shuffled. text_jump UnknownText_0x1c57f4 db "@" ; 0xe0360 -Functione0360: ; e0360 +.Quit: ; e0360 ld hl, wcf63 set 7, [hl] ret @@ -81519,8 +81610,9 @@ Functione08b8: ; e08b8 ld [hl], a cp $3 jr c, .asm_e08e2 +rept 2 dec [hl] - dec [hl] +endr jp Functione0959 .asm_e08e2 @@ -81548,8 +81640,9 @@ Functione08ef: ; e08ef ld [hl], a cp $4 ret nc +rept 2 inc [hl] - inc [hl] +endr jr Functione0959 Functione090a: ; e090a @@ -81578,8 +81671,9 @@ Functione090a: ; e090a ld [hl], a cp $3 jr c, .asm_e0931 +rept 2 dec [hl] - dec [hl] +endr jr Functione0959 .asm_e0931 @@ -81607,8 +81701,9 @@ Functione093d: ; e093d ld [hl], a cp $6 ret nc +rept 2 inc [hl] - inc [hl] +endr Functione0959: ; e0959 ld de, SFX_POKEBALLS_PLACED_ON_TABLE @@ -82720,10 +82815,9 @@ Functione16c7: ; e16c7 ld l, a call Functione16e2 pop hl +rept 4 inc hl - inc hl - inc hl - inc hl +endr pop af dec a jr nz, .asm_e16cc @@ -82920,10 +83014,9 @@ Functione1efb: ; e1efb xor a ld [wc708], a ld hl, wc703 +rept 4 ld [hli], a - ld [hli], a - ld [hli], a - ld [hli], a +endr ld [hl], a ld [wc709], a @@ -83116,8 +83209,9 @@ Functione2010: ; e2010 ld [wc6fd], a ld hl, wc709 ld e, [hl] +rept 2 inc [hl] - inc [hl] +endr ld d, $0 hlcoord 5, 0 add hl, de @@ -83150,9 +83244,9 @@ Functione2084: ; e2084 call Functione2128 ld hl, UnknownText_0xe2093 pop bc +rept 3 inc bc - inc bc - inc bc +endr ret ; e2093 @@ -84709,9 +84803,9 @@ endr ld de, $28 add hl, de pop de +rept 3 inc de - inc de - inc de +endr pop af dec a jr nz, .asm_e2c53 @@ -87625,8 +87719,9 @@ Functione4d36: ; e4d36 (39:4d36) ret z cp c jr z, .asm_e4d48 +rept 2 inc hl - inc hl +endr jr .asm_e4d3d .asm_e4d48 ld a, [hli] @@ -88295,15 +88390,16 @@ Functione51dc: ; e51dc (39:51dc) ret Functione5223: ; e5223 (39:5223) +rept 3 add a - add a - add a +endr ld e, a ld d, $0 ld hl, BGPals add hl, de +rept 2 inc hl - inc hl +endr ld a, [wcf65] and $3f cp $1f @@ -88410,9 +88506,9 @@ Functione5348: ; e5348 (39:5348) .asm_e5353 ld a, [wcf65] and $7 +rept 3 add a - add a - add a +endr ld c, a ld a, [rSVBK] ; $ff00+$70 push af @@ -88460,17 +88556,16 @@ Palette_e5395: ; e5395 ; e539d Functione539d: ; e539d (39:539d) +rept 3 add a - add a - add a +endr ld e, a ld d, $0 ld hl, BGPals add hl, de +rept 4 inc hl - inc hl - inc hl - inc hl +endr ld a, [wcf65] add a ld c, a @@ -88718,8 +88813,9 @@ Functione552f: ; e552f (39:552f) .asm_e5548 ld hl, LYOverrides + $5f ld a, [hl] +rept 2 inc a - inc a +endr ld bc, $31 call ByteFill ld a, [LYOverrides + 0] @@ -90409,8 +90505,9 @@ DoWeatherModifiers: ; fbda4 jr z, .ApplyModifier .NextWeatherType +rept 2 inc de - inc de +endr jr .CheckWeatherType @@ -90435,8 +90532,9 @@ DoWeatherModifiers: ; fbda4 jr z, .ApplyModifier .NextWeatherMove +rept 2 inc de - inc de +endr jr .CheckWeatherMove .ApplyModifier @@ -93579,20 +93677,18 @@ Function105033: ; 105033 (41:5033) Function105038: ; 105038 (41:5038) ld a, $20 ld [rJOYP], a ; $ff00+$0 +rept 2 ld a, [rJOYP] ; $ff00+$0 - ld a, [rJOYP] ; $ff00+$0 +endr cpl and $f swap a ld b, a ld a, $10 ld [rJOYP], a ; $ff00+$0 +rept 6 ld a, [rJOYP] ; $ff00+$0 - ld a, [rJOYP] ; $ff00+$0 - ld a, [rJOYP] ; $ff00+$0 - ld a, [rJOYP] ; $ff00+$0 - ld a, [rJOYP] ; $ff00+$0 - ld a, [rJOYP] ; $ff00+$0 +endr cpl and $f or b @@ -93953,20 +94049,18 @@ Function1056eb: ; 1056eb (41:56eb) ld b, $8 .asm_1056f2 dec [hl] +rept 4 inc hl - inc hl - inc hl - inc hl +endr dec b jr nz, .asm_1056f2 ld hl, Sprites + $20 ld b, $8 .asm_1056ff inc [hl] +rept 4 inc hl - inc hl - inc hl - inc hl +endr dec b jr nz, .asm_1056ff dec c @@ -94762,9 +94856,9 @@ Function105fe3: mobile ; 105fe3 inc [hl] jr nz, .asm_106001 ld a, $ff +rept 3 ld [hli], a - ld [hli], a - ld [hli], a +endr ld [hl], a .asm_106001 @@ -94792,9 +94886,9 @@ Function106008: mobile ; 106008 inc [hl] jr nz, .asm_106027 ld a, $ff +rept 3 ld [hli], a - ld [hli], a - ld [hli], a +endr ld [hl], a .asm_106027 @@ -95179,19 +95273,19 @@ Function1061ef:: ; 1061ef ld de, ._9 .asm_106256 +rept 3 inc de - inc de - inc de - dec a +endr +rept 2 dec a +endr .asm_10625b push af call Function1062b2 call Function1062ff +rept 4 inc de - inc de - inc de - inc de +endr pop af dec a jr nz, .asm_10625b @@ -95262,9 +95356,9 @@ Function1062b2: ; 1062b2 sbc b ld [hMathBuffer], a ld a, [de] +rept 3 inc de - inc de - inc de +endr ld b, a ld a, [hProduct] sbc b diff --git a/maps/Route24.asm b/maps/Route24.asm index 06ba45bf9..693efa355 100644 --- a/maps/Route24.asm +++ b/maps/Route24.asm @@ -12,7 +12,7 @@ RocketScript_0x1adbfa: writetext UnknownText_0x1adc2e closetext loadmovesprites - winlosstext UnknownText_0x1add67, $ffff + winlosstext UnknownText_0x1add67, -1 loadtrainer GRUNTM, 31 startbattle reloadmapmusic diff --git a/misc/crystal_misc.asm b/misc/crystal_misc.asm index d4f0b66ec..9dbbea79c 100644 --- a/misc/crystal_misc.asm +++ b/misc/crystal_misc.asm @@ -552,16 +552,16 @@ Function17aa22: ; 17aa22 (5e:6a22) push de ld a, $3 call Function17aae0 +rept 3 add a - add a - add a +endr add $0 push af ld a, $4 call Function17aae0 +rept 3 add a - add a - add a +endr add $8 ld c, a pop af @@ -658,13 +658,15 @@ Function17aaa9: ; 17aaa9 (5e:6aa9) Function17aac3: ; 17aac3 (5e:6ac3) ld a, $b push hl +rept 2 ld [hli], a - ld [hli], a +endr pop hl ld de, $14 add hl, de +rept 2 ld [hli], a - ld [hli], a +endr ret Function17aad0: ; 17aad0 (5e:6ad0) diff --git a/misc/mobile_40.asm b/misc/mobile_40.asm index b591592f2..49a81f06d 100644 --- a/misc/mobile_40.asm +++ b/misc/mobile_40.asm @@ -114,8 +114,9 @@ Function1000ba: ; 1000ba ld a, [wcd25] ld e, a ld d, $0 +rept 2 add hl, de - add hl, de +endr ld a, [CreditsTimer] call GetFarHalfword ld a, [CreditsTimer] @@ -1157,9 +1158,9 @@ Function1006fd: ; 1006fd ld hl, $a800 call GetSRAMBank xor a +rept 3 ld [hli], a - ld [hli], a - ld [hli], a +endr call CloseSRAM ret ; 10070d @@ -1892,8 +1893,9 @@ Function100bc2: ; 100bc2 ld a, [wcfa9] ld b, a ld a, [wd0eb] +rept 2 inc a - inc a +endr cp b jp nz, .asm_100bcb ld a, $1 @@ -2513,8 +2515,9 @@ Unknown_10102c: ; 10102c Function101050: ; 101050 call Function10107d ld a, [OTPartyCount] +rept 2 ld hl, $c608 - ld hl, $c608 +endr ld bc, $01b3 call Function1010de ld hl, wc7bb @@ -4696,8 +4699,9 @@ Function101ee2: ; 101ee2 Function101ee4: ; 101ee4 ld d, 0 ld hl, Unknown_101ef5 +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld d, [hl] ld e, a @@ -7143,9 +7147,9 @@ Function1030cd: ; 1030cd ld a, [wcf44] ld l, a ld h, 0 +rept 3 add hl, hl - add hl, hl - add hl, hl +endr ld bc, Unknown_103112 add hl, bc ld b, $30 @@ -7164,8 +7168,9 @@ Function1030cd: ; 1030cd inc hl push hl +rept 2 add a - add a +endr add Unknown_10327a % $100 ld l, a @@ -7628,8 +7633,9 @@ Function1035c6: ; 1035c6 callba Function10138b ld b, 0 ld hl, Unknown_1035d7 +rept 2 add hl, bc - add hl, bc +endr ld a, [hli] ld h, [hl] ld l, a @@ -8030,8 +8036,9 @@ Function10383c: ; 10383c ld [wdc60], a xor a ld hl, wdc5c +rept 2 ld [hli], a - ld [hli], a +endr ld [hl], a ld hl, UnknownText_0x103876 call PrintText diff --git a/misc/mobile_42.asm b/misc/mobile_42.asm index 3fc90d836..634ea3a57 100644 --- a/misc/mobile_42.asm +++ b/misc/mobile_42.asm @@ -339,8 +339,9 @@ Function10827b: ; 10827b ld e, a ld d, 0 ld hl, Jumptable_10828a +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld h, [hl] ld l, a @@ -920,8 +921,9 @@ Function108763: ; 108763 ld a, [hSCX] cp $e0 jr z, .asm_108791 +rept 2 dec a - dec a +endr ld [hSCX], a cp $f8 jr nz, .asm_10878a @@ -938,8 +940,9 @@ Function108763: ; 108763 ld a, [hSCY] cp $f8 jr z, .asm_1087cb +rept 2 dec a - dec a +endr ld [hSCY], a cp $40 jr z, .asm_1087a9 @@ -1089,8 +1092,9 @@ Function108894: ; 108894 ld a, [hSCY] cp $78 jr z, .asm_1088ee +rept 2 inc a - inc a +endr ld [hSCY], a cp $30 jr z, .asm_1088c5 @@ -1129,8 +1133,9 @@ Function108894: ; 108894 ld a, [hSCX] cp $c jr z, .asm_108906 +rept 2 inc a - inc a +endr ld [hSCX], a cp $f8 jr nz, .asm_1088e7 diff --git a/misc/mobile_45.asm b/misc/mobile_45.asm index 0c64898a6..c959452ad 100644 --- a/misc/mobile_45.asm +++ b/misc/mobile_45.asm @@ -152,8 +152,9 @@ Function114243:: ; 114243 Function11425c: ; 11425c ld [wdc02], a pop af +rept 2 ld [$ff8c], a - ld [$ff8c], a +endr ld [$4000], a ret ; 114268 @@ -622,12 +623,13 @@ Function1144c8: ; 1144c8 Function1144d1: ; 1144d1 call Function114561 +rept 2 dec de - dec de +endr push de +rept 3 inc de - inc de - inc de +endr inc hl ld a, [de] ld [hli], a @@ -989,8 +991,9 @@ Function1146a4: ; 1146a4 and a jr nz, .asm_1146e8 .asm_1146da +rept 2 dec bc - dec bc +endr call Function1149cc and a jr nz, .asm_1146e4 @@ -1076,8 +1079,9 @@ Function1146fa: ; 1146fa ld a, [wdc0e] cp $3 jr nz, .asm_114773 +rept 2 dec bc - dec bc +endr .asm_114773 call Function1149cc @@ -1861,12 +1865,9 @@ Function114b55: ; 114b55 .asm_114b8c pop hl xor a +rept 6 ld [hli], a - ld [hli], a - ld [hli], a - ld [hli], a - ld [hli], a - ld [hli], a +endr jr .asm_114b82 .asm_114b96 @@ -2030,8 +2031,9 @@ Function114c5e: ; 114c5e inc de cp $3f jr nz, .asm_114c62 +rept 2 dec de - dec de +endr .asm_114c75 ld a, [hli] cp $3f @@ -2051,8 +2053,9 @@ Function114c5e: ; 114c5e ld a, [hli] cp $3d jr nz, .asm_114c84 +rept 2 dec bc - dec bc +endr ld a, l ld [wdc03], a ld a, h @@ -2141,10 +2144,9 @@ Function114cd9: ; 114cd9 call Function114d99 pop hl push hl +rept 4 inc hl - inc hl - inc hl - inc hl +endr ld a, [hld] cp b jr c, .asm_114d2d @@ -2317,8 +2319,9 @@ Function114d99: ; 114d99 add hl, de ld b, h ld c, l +rept 2 inc bc - inc bc +endr xor a ret ; 114df1 @@ -2513,8 +2516,9 @@ Function114ee9: ; 114ee9 ld a, b ld [hli], a ld a, c +rept 2 ld [hli], a - ld [hli], a +endr ld a, [de] ld [hli], a inc de @@ -2912,8 +2916,9 @@ Function1150b3: ; 1150b3 .asm_11510b pop hl +rept 2 dec hl - dec hl +endr push de call Function1158c2 pop de @@ -3429,8 +3434,9 @@ Function1153b5: ; 1153b5 ld e, [hl] inc hl ld d, [hl] +rept 2 inc hl - inc hl +endr ld a, [de] ld [hli], a inc de @@ -4388,9 +4394,9 @@ Function1158c2: ; 1158c2 ld bc, $0003 .asm_115914 +rept 3 dec bc - dec bc - dec bc +endr ld a, c ld [wdc19], a ld a, b @@ -4404,10 +4410,9 @@ Function1158c2: ; 1158c2 ld e, [hl] inc hl ld d, [hl] +rept 4 inc de - inc de - inc de - inc de +endr ld [hl], d dec hl ld [hl], e @@ -4442,8 +4447,9 @@ Function1158c2: ; 1158c2 ld a, $3f and c ld [hld], a +rept 2 dec hl - dec hl +endr pop de ld b, h ld c, l @@ -4499,8 +4505,9 @@ Function1158c2: ; 1158c2 ld a, [hli] ld c, a ld b, [hl] +rept 2 inc bc - inc bc +endr ld a, b ld [hld], a ld [hl], c @@ -4776,8 +4783,9 @@ Function115b00: ; 115b00 ld a, [wdc23] cp $4 jr z, .asm_115b43 +rept 2 inc hl - inc hl +endr jr .asm_115b43 .asm_115b36 @@ -4958,8 +4966,9 @@ Function115bc8: ; 115bc8 ret .asm_115c33 +rept 2 dec hl - dec hl +endr xor a ld [hl], a ld a, $1 @@ -5027,10 +5036,9 @@ Function115c49: ; 115c49 ld c, a ld a, [wdc1a] ld b, a +rept 4 dec bc - dec bc - dec bc - dec bc +endr .asm_115c8c ld a, [de] cp $d @@ -5062,9 +5070,9 @@ Function115c49: ; 115c49 ld e, [hl] inc hl ld d, [hl] +rept 3 inc de - inc de - inc de +endr ld [hl], d dec hl ld [hl], e @@ -5627,8 +5635,9 @@ Function1161b8: ; 1161b8 ld e, a ld d, 0 ld hl, Jumptable_1161c7 +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld h, [hl] ld l, a @@ -6210,8 +6219,9 @@ Function11659d: ; 11659d ld e, a ld d, 0 ld hl, Jumptable_1165af +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld h, [hl] ld l, a @@ -7726,8 +7736,9 @@ Function117719: ; 117719 (45:7719) ld e, a ld d, 0 ld hl, Jumptable_117728 +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld h, [hl] ld l, a @@ -8195,8 +8206,9 @@ Function117ae9: ; 0x117ae9 ld e, a ld d, $0 ld hl, Pointers117af8 +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld h, [hl] ld l, a @@ -9023,8 +9035,9 @@ Function1184a5: ; 1184a5 ld e, a ld d, 0 ld hl, Jumptable_1184b4 +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld h, [hl] ld l, a @@ -9067,8 +9080,9 @@ Function1184ec: ; 1184ec ld e, a ld d, 0 ld hl, Jumptable_1184fb +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld h, [hl] ld l, a @@ -9124,8 +9138,9 @@ Function11854d: ; 11854d ld e, a ld d, 0 ld hl, Jumptable_11855c +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld h, [hl] ld l, a @@ -9156,8 +9171,9 @@ Function11857c: ; 11857c ld e, a ld d, 0 ld hl, Jumptable_11858b +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld h, [hl] ld l, a @@ -9200,8 +9216,9 @@ Function1185c3: ; 1185c3 ld e, a ld d, 0 ld hl, Jumptable_1185d2 +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld h, [hl] ld l, a @@ -9257,8 +9274,9 @@ Function118624: ; 118624 ld e, a ld d, 0 ld hl, Jumptable_118633 +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld h, [hl] ld l, a @@ -9304,8 +9322,9 @@ Function118671: ; 118671 ld e, a ld d, 0 ld hl, Jumptable_118680 +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld h, [hl] ld l, a @@ -9345,8 +9364,9 @@ Function1186b2: ; 1186b2 ld e, a ld d, 0 ld hl, Jumptable_1186c1 +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld h, [hl] ld l, a @@ -9387,8 +9407,9 @@ Function1186f5: ; 1186f5 (46:46f5) ld e, a ld d, 0 ld hl, Jumptable_118704 +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld h, [hl] ld l, a @@ -9436,8 +9457,9 @@ Function118746: ; 118746 ld e, a ld d, 0 ld hl, Jumptable_118755 +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld h, [hl] ld l, a @@ -10071,8 +10093,9 @@ Function118b8c: ; 118b8c jr nz, .asm_118b8c dec hl xor a +rept 2 ld [hli], a - ld [hli], a +endr ret ; 118b9a @@ -10272,8 +10295,9 @@ asm_118e3e ld a, [hld] cp $2f jr nz, .asm_118e3e +rept 2 inc hl - inc hl +endr ld de, wcd85 ld c, $4 .asm_118e4a @@ -11132,8 +11156,9 @@ Function119413: ; 119413 ld c, a ld a, [wd001] ld b, a +rept 2 dec bc - dec bc +endr ld hl, wd002 ld a, [hli] ld e, a @@ -11298,10 +11323,9 @@ Function119471: ; 119471 (46:5471) ld a, $10 cp b jr z, .asm_119536 +rept 4 inc hl - inc hl - inc hl - inc hl +endr jr .asm_11957a .asm_119536 ld a, [hli] @@ -11324,8 +11348,9 @@ Function119471: ; 119471 (46:5471) .asm_119552 inc hl .asm_119553 +rept 2 inc hl - inc hl +endr jr .asm_11955b .asm_119557 ld de, $14 @@ -11670,8 +11695,9 @@ Function1196f2: ; 1196f2 ld a, [hld] cp $58 jr z, .asm_11975b +rept 2 inc hl - inc hl +endr ld a, d dec a jr z, .asm_11978e @@ -12253,8 +12279,9 @@ Function119b6b: ; 119b6b ld a, [de] cp $d jr nz, .asm_119b85 +rept 2 inc de - inc de +endr .asm_119b93 ld a, [de] inc de @@ -12310,9 +12337,9 @@ Function119b6b: ; 119b6b ld [hld], a dec hl pop de +rept 3 inc hl - inc hl - inc hl +endr ld a, h cp $e0 jr c, .asm_119b93 @@ -12792,8 +12819,9 @@ Function119eee: ; 119eee (46:5eee) ld e, a ld d, 0 ld hl, Jumptable_119efd +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld h, [hl] ld l, a @@ -13987,8 +14015,9 @@ Function11a8fa: ; 11a8fa ld e, a ld d, 0 ld hl, Jumptable_11a909 +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld h, [hl] ld l, a @@ -14758,8 +14787,9 @@ asm_11afbd: dec a ld c, a ld b, 0 +rept 2 add hl, bc - add hl, bc +endr ld a, e ld e, [hl] inc hl @@ -15229,8 +15259,9 @@ Function11b236: ; 11b236 Function11b239: ; 11b239 ld e, a ld d, 0 +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld h, [hl] ld l, a @@ -15583,8 +15614,9 @@ Function11b46a: ; 11b46a ld e, a ld d, 0 ld hl, Jumptable_11b479 +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld h, [hl] ld l, a @@ -15657,8 +15689,9 @@ Function11b483: ; 11b483 pop de ld h, d ld l, e +rept 2 dec hl - dec hl +endr ld a, [de] ld [hli], a inc de @@ -15890,8 +15923,9 @@ Function11b65a: ; 11b65a ld e, a ld d, 0 ld hl, Jumptable_11b669 +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld h, [hl] ld l, a @@ -16520,8 +16554,9 @@ ENDC .asm_11c040 push af +rept 2 add hl, bc - add hl, bc +endr ld a, [hli] ld c, a ld a, [hl] @@ -16530,8 +16565,9 @@ ENDC pop af ld c, a ld b, 0 +rept 2 add hl, bc - add hl, bc +endr ld a, [hli] ld c, a ld a, [hl] @@ -16920,8 +16956,9 @@ Function11c2ac: ; 11c2ac ld e, a ld d, 0 ld hl, Jumptable_11c2bb +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld h, [hl] ld l, a @@ -17012,10 +17049,12 @@ Function11c346: ; 11c346 (47:4346) Function11c35f: ; 11c35f (47:435f) ld hl, wcd2f +rept 2 inc [hl] - inc [hl] - dec hl +endr +rept 2 dec hl +endr dec [hl] push af ld de, wcd2d @@ -17026,10 +17065,12 @@ Function11c35f: ; 11c35f (47:435f) Function11c373: ; 11c373 (47:4373) ld hl, wcd30 +rept 2 inc [hl] - inc [hl] - dec hl +endr +rept 2 dec hl +endr dec [hl] push af ld de, wcd2d @@ -17672,8 +17713,9 @@ Function11c770: ; 11c770 (47:4770) ld a, [CreditsTimer] ld c, a ld b, 0 +rept 2 add hl, bc - add hl, bc +endr ld a, [hl] ld [wcd28], a jr .asm_11c79f @@ -17748,8 +17790,9 @@ Function11c7bc: ; 11c7bc (47:47bc) ld a, [wcd22] ld e, a ld d, $0 +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld e, a ld a, [hl] @@ -17759,8 +17802,9 @@ Function11c7bc: ; 11c7bc (47:47bc) ld a, [wcd26] ld e, a ld d, $0 +rept 2 add hl, de - add hl, de +endr ld a, [wcd26] ld e, a .asm_11c831 @@ -17927,8 +17971,9 @@ Function11c8f6: ; 11c8f6 (47:48f6) ld c, a ld b, $0 ld hl, wcd36 +rept 2 add hl, bc - add hl, bc +endr ld [hl], e inc hl ld [hl], d @@ -17948,8 +17993,9 @@ Function11c8f6: ; 11c8f6 (47:48f6) ld a, [wcd22] ld e, a ld d, $0 +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld e, a ld a, [hl] @@ -17959,12 +18005,14 @@ Function11c8f6: ; 11c8f6 (47:48f6) ld a, [wcd26] ld e, a ld d, $0 +rept 2 add hl, de - add hl, de +endr ld a, [wcd25] ld e, a +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld e, a ld a, [hl] @@ -18152,8 +18200,9 @@ Function11ca6a: ; 11ca6a (47:4a6a) ld hl, wcd36 ld c, a ld b, $0 +rept 2 add hl, bc - add hl, bc +endr ld [hl], b inc hl ld [hl], b @@ -18267,8 +18316,9 @@ Function11cb52: ; 11cb52 (47:4b52) .asm_11cb58 dec a jr z, .asm_11cb5f +rept 2 inc hl - inc hl +endr jr .asm_11cb58 .asm_11cb5f ld a, [hli] @@ -18327,8 +18377,9 @@ Function11cb66: ; 11cb66 (47:4b66) .asm_11cbba dec a jr z, .asm_11cbc1 +rept 2 inc hl - inc hl +endr jr .asm_11cbba .asm_11cbc1 ld a, [hli] @@ -18776,8 +18827,9 @@ Function11cfce: ; 11cfce (47:4fce) ld [hli], a ld a, [de] inc de +rept 2 dec a - dec a +endr jr z, .asm_11cff6 ld c, a ld a, $7a @@ -18793,8 +18845,9 @@ Function11cfce: ; 11cfce (47:4fce) add hl, bc ld a, [de] dec de +rept 2 dec a - dec a +endr jr z, .asm_11d022 ld b, a .asm_11d005 @@ -18802,8 +18855,9 @@ Function11cfce: ; 11cfce (47:4fce) ld a, $7c ld [hli], a ld a, [de] +rept 2 dec a - dec a +endr jr z, .asm_11d015 ld c, a ld a, $7f @@ -18825,8 +18879,9 @@ Function11cfce: ; 11cfce (47:4fce) ld a, $7d ld [hli], a ld a, [de] +rept 2 dec a - dec a +endr jr z, .asm_11d031 ld c, a ld a, $7a @@ -18888,8 +18943,9 @@ Function11d035: ; 11d035 (47:5035) ld a, [de] cp $2 jr z, .asm_11d082 +rept 2 dec a - dec a +endr .asm_11d078 push af ld a, $7a @@ -18915,8 +18971,9 @@ Function11d035: ; 11d035 (47:5035) cp $2 ret z push bc +rept 2 dec a - dec a +endr ld c, a ld b, a ld de, $14 @@ -18952,8 +19009,9 @@ Function11d0b6: ; 11d0b6 (47:50b6) ld e, a ld d, 0 ld hl, Jumptable_11d0c7 +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld h, [hl] ld l, a @@ -19588,8 +19646,9 @@ Function11d4aa: ; 11d4aa ld hl, $0005 add hl, de ld a, [bc] +rept 2 inc bc - inc bc +endr push bc .asm_11d4cf push af @@ -21592,8 +21651,9 @@ Function16c943: ; 16c943 call Function16cae8 .asm_16c9e1 +rept 2 inc e - inc e +endr ld a, e cp $8 jr nz, .asm_16c969 @@ -21694,8 +21754,9 @@ Function16ca11: ; 16ca11 call Function16cae8 .asm_16ca88 +rept 2 inc e - inc e +endr ld a, e cp $8 jr nz, .asm_16ca28 @@ -22149,10 +22210,12 @@ Function16d61d: ; 16d61d pop bc ld de, AttrMap - TileMap add hl, de +rept 2 inc b - inc b - inc c +endr +rept 2 inc c +endr ld a, $7 .asm_16d630 push bc @@ -22753,8 +22816,9 @@ Function17023a: ; 17023a ld e, a ld d, 0 ld hl, Jumptable_170249 +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld h, [hl] ld l, a @@ -22980,8 +23044,9 @@ Function170394: ; 170394 ld a, $1 ld [hli], a xor a +rept 2 ld [hli], a - ld [hli], a +endr ld [hl], a jr .asm_1703ff @@ -23009,8 +23074,9 @@ Function170394: ; 170394 predef Functione167 pop de pop hl +rept 2 dec de - dec de +endr ld a, [hli] ld [de], a inc de @@ -23172,8 +23238,9 @@ Function170510: ; 170510 ld e, a ld d, 0 ld hl, Jumptable_17051f +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld h, [hl] ld l, a @@ -23383,8 +23450,9 @@ Function17064b: ; 17064b ld [hli], a dec c jr nz, .asm_170653 +rept 2 inc hl - inc hl +endr dec b jr nz, .asm_170651 ret @@ -23421,8 +23489,9 @@ Function170687: ; 170687 ld e, a ld d, 0 ld hl, Jumptable_170696 +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld h, [hl] ld l, a @@ -23852,13 +23921,13 @@ Function17093c: ; 17093c (5c:493c) pop af dec a jr nz, .asm_17096e +rept 4 dec hl - dec hl - dec hl - dec hl +endr ld a, $50 +rept 2 ld [hli], a - ld [hli], a +endr pop hl ld a, EGG_TICKET ld [CurItem], a @@ -23908,8 +23977,9 @@ Function1709bb: ; 1709bb (5c:49bb) ld e, a ld d, 0 ld hl, Jumptable_1709e7 +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld h, [hl] ld l, a @@ -24213,8 +24283,9 @@ Function170c06: ; 170c06 inc [hl] .asm_170c15 +rept 2 inc hl - inc hl +endr ld a, [$a89b] add [hl] ld [hld], a @@ -24239,8 +24310,9 @@ Function170c06: ; 170c06 ld a, [hli] ld b, a ld c, [hl] +rept 2 inc hl - inc hl +endr ld a, [hld] sub c ld c, a @@ -24464,8 +24536,9 @@ Function171a36: ; 171a36 (5c:5a36) ld e, a ld d, 0 ld hl, Jumptable_171a45 +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld h, [hl] ld l, a @@ -24589,9 +24662,9 @@ Function171aec: ; 171aec (5c:5aec) .asm_171b34 pop hl ld bc, $14 +rept 3 add hl, bc - add hl, bc - add hl, bc +endr pop af dec a jr nz, .asm_171b1b @@ -24820,8 +24893,9 @@ Function171ccd: ; 171ccd (5c:5ccd) Function171cf0: ; 171cf0 (5c:5cf0) xor a hlcoord 4, 15 +rept 2 ld [hli], a - ld [hli], a +endr ld a, [wcd4b] xor $1 ld [wcd4b], a diff --git a/misc/mobile_5f.asm b/misc/mobile_5f.asm index 3df99b33f..4b780cbce 100644 --- a/misc/mobile_5f.asm +++ b/misc/mobile_5f.asm @@ -723,8 +723,9 @@ Function17d474: ; 17d474 ld e, a ld d, 0 ld hl, Jumptable_17d483 +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld h, [hl] ld l, a @@ -905,14 +906,16 @@ Function17d48d: ; 17d48d ld a, [wcd42] ld c, a ld b, $0 +rept 2 add hl, bc - add hl, bc +endr ld a, l ld [wcd4b], a ld a, h ld [wcd4c], a +rept 2 add hl, bc - add hl, bc +endr ld a, l ld [wcd4d], a ld a, h @@ -938,8 +941,9 @@ Function17d5c4: .asm_17d5ce srl a jr c, .asm_17d5d6 +rept 2 inc c - inc c +endr jr .asm_17d5ce .asm_17d5d6 @@ -1026,10 +1030,12 @@ Function17d60b: ; 17d60b ld [wcd4c], a pop de pop hl +rept 2 inc b - inc b - dec c +endr +rept 2 dec c +endr jr z, .asm_17d684 push bc push de @@ -1075,15 +1081,17 @@ Function17d6a1: ; 17d6a1 ld a, $5 call GetSRAMBank ld hl, $b1d3 +rept 2 add hl, bc - add hl, bc +endr ld a, [hli] ld [wcd47], a ld a, [hl] ld [BGMapPalBuffer], a ld hl, $b1b3 +rept 2 add hl, bc - add hl, bc +endr ld a, [hli] ld c, a ld a, [hl] @@ -1099,8 +1107,9 @@ Function17d6a1: ; 17d6a1 ld de, wcd60 ld bc, $0004 call CopyBytes +rept 2 inc hl - inc hl +endr ld de, wcd64 ld bc, $0004 call CopyBytes @@ -1136,8 +1145,9 @@ Function17d711: ld e, a ld d, 0 ld hl, Jumptable_17d72a +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld h, [hl] ld l, a @@ -1991,8 +2001,9 @@ Function17dccf: ; 17dccf ld a, [wcd2e] ld c, a ld b, $0 +rept 2 add hl, bc - add hl, bc +endr ld a, [hli] ld c, a ld a, [hl] @@ -2407,8 +2418,9 @@ Function17ded9: ; 17ded9 jr .asm_17df7b .asm_17df79 +rept 2 inc hl - inc hl +endr .asm_17df7b bit 4, b @@ -2461,8 +2473,9 @@ Function17ded9: ; 17ded9 jr .asm_17dfd2 .asm_17dfd0 +rept 2 inc hl - inc hl +endr .asm_17dfd2 bit 5, b @@ -2587,8 +2600,9 @@ Function17e026: ; 17e026 jr .asm_17e0a4 .asm_17e0a2 +rept 2 inc hl - inc hl +endr .asm_17e0a4 bit 4, b @@ -2604,8 +2618,9 @@ Function17e026: ; 17e026 jr .asm_17e0b6 .asm_17e0b4 +rept 2 inc hl - inc hl +endr .asm_17e0b6 bit 5, b @@ -2627,8 +2642,9 @@ Function17e026: ; 17e026 call CloseSRAM pop hl pop bc +rept 2 inc hl - inc hl +endr jr asm_17e0ee .asm_17e0e1 @@ -2673,8 +2689,9 @@ Function17e0fd: ; 17e0fd call ReceiveItem pop hl jr c, .asm_17e127 +rept 2 inc hl - inc hl +endr .asm_17e127 ld a, [hli] @@ -2704,8 +2721,9 @@ Function17e133: ; 17e133 callba MobileCheckOwnMonAnywhere pop hl jr c, .asm_17e159 +rept 2 inc hl - inc hl +endr .asm_17e159 ld a, [hli] @@ -2741,8 +2759,9 @@ Function17e165: ; 17e165 call CheckItem pop hl jr c, .asm_17e195 +rept 2 inc hl - inc hl +endr .asm_17e195 ld a, [hli] @@ -3207,8 +3226,9 @@ Function17e451: ; 17e451 ld [wcd2e], a ld c, a ld b, $0 +rept 2 add hl, bc - add hl, bc +endr push hl ld hl, TileMap ld bc, $0014 @@ -3433,8 +3453,9 @@ Function17e5af: ; 17e5af ld l, a ld a, [wcd4e] ld h, a +rept 2 add hl, bc - add hl, bc +endr ld a, [hli] ld e, a ld a, [hli] @@ -3499,8 +3520,9 @@ Function17e613: ; 17e613 ld [hli], a ld a, [de] inc de +rept 2 dec a - dec a +endr jr z, .asm_17e63f ld c, a ld a, [wcd53] @@ -3519,8 +3541,9 @@ Function17e613: ; 17e613 add hl, bc ld a, [de] dec de +rept 2 dec a - dec a +endr jr z, .asm_17e674 ld b, a .asm_17e651 @@ -3529,8 +3552,9 @@ Function17e613: ; 17e613 add $3 ld [hli], a ld a, [de] +rept 2 dec a - dec a +endr jr z, .asm_17e664 ld c, a ld a, $7f @@ -3556,8 +3580,9 @@ Function17e613: ; 17e613 add $5 ld [hli], a ld a, [de] +rept 2 dec a - dec a +endr jr z, .asm_17e689 ld c, a ld a, [wcd53] @@ -3583,8 +3608,9 @@ Function17e691: ; 17e691 inc de push af ld a, [de] +rept 2 inc de - inc de +endr and a .asm_17e69f jr z, .asm_17e6a5 @@ -3736,8 +3762,9 @@ Function17f047: ; 17f047 ld e, a ld d, 0 ld hl, Jumptable_17f061 +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld h, [hl] ld l, a @@ -3774,8 +3801,9 @@ Function17f081: ; 17f081 ld de, $0004 add hl, de ld a, [hli] +rept 2 inc hl - inc hl +endr ld e, l ld d, h ld l, c @@ -3918,8 +3946,9 @@ Function17f154: ; 17f154 pop hl call Function17f524 jr c, .asm_17f167 +rept 2 inc hl - inc hl +endr ld e, l ld d, h ld a, [de] @@ -4107,8 +4136,9 @@ Function17f220: ; 17f220 ld e, a ld d, 0 ld hl, .Genders +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld e, a ld a, [hl] @@ -4370,8 +4400,9 @@ Function17f3f0: ; 17f3f0 ld a, [de] ld c, a ld b, $0 +rept 2 add hl, bc - add hl, bc +endr ld a, [hli] ld e, a ld a, [hli] @@ -4386,11 +4417,12 @@ Function17f3f0: ; 17f3f0 ld e, a ld d, $0 pop hl +rept 2 add hl, de - add hl, de - inc hl - inc hl +endr +rept 3 inc hl +endr ld e, l ld d, h ld l, c @@ -4451,8 +4483,9 @@ Function17f44f: ; 17f44f ld de, $0005 add hl, de ld a, [hli] +rept 2 inc hl - inc hl +endr ld e, l ld d, h ld l, c @@ -4695,8 +4728,9 @@ Function17f5ae: ; 17f5ae ld e, a ld d, 0 ld hl, Table17f5bd +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld h, [hl] ld l, a @@ -4770,8 +4804,9 @@ Function17f5e4: ; 17f5e4 ld e, a ld d, $0 ld hl, Table_17f706 +rept 2 add hl, de - add hl, de +endr ld a, [wc301] ld e, a ld a, [wc302] @@ -4809,8 +4844,9 @@ Function17f5e4: ; 17f5e4 jr .asm_17f67d .asm_17f674 +rept 2 inc hl - inc hl +endr dec c jr nz, .asm_17f65d @@ -4828,8 +4864,9 @@ Function17f5e4: ; 17f5e4 ld e, a ld d, 0 ld hl, Table_17f699 +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld e, a ld a, [hl] diff --git a/misc/unused_title.asm b/misc/unused_title.asm index 36337edaf..327eef45c 100644 --- a/misc/unused_title.asm +++ b/misc/unused_title.asm @@ -10,9 +10,9 @@ UnusedTitleScreen: ; 10c000 ld [hBGMapMode], a ld hl, wcf63 +rept 3 ld [hli], a - ld [hli], a - ld [hli], a +endr ld [hl], a ld hl, UnusedTitleBG_GFX diff --git a/predef/cgb.asm b/predef/cgb.asm index 3f2bcb230..89b8cee99 100644 --- a/predef/cgb.asm +++ b/predef/cgb.asm @@ -93,16 +93,18 @@ Function8ddb: ; 8ddb ld a, [EnemyHPPal] ld l, a ld h, $0 +rept 2 add hl, hl - add hl, hl +endr ld bc, Palettes_a8be add hl, bc call Function9643 ld a, [PlayerHPPal] ld l, a ld h, $0 +rept 2 add hl, hl - add hl, hl +endr ld bc, Palettes_a8be add hl, bc call Function9643 @@ -213,8 +215,9 @@ Function8edb: ; 8edb ld a, [wcda1] ld l, a ld h, $0 +rept 2 add hl, hl - add hl, hl +endr ld bc, Palettes_a8be add hl, bc call Function9643 @@ -488,8 +491,9 @@ Function90f8: ; 90f8 Function9122: ; 9122 ld b, 0 ld hl, Jumptable_912d +rept 2 add hl, bc - add hl, bc +endr ld a, [hli] ld h, [hl] ld l, a @@ -797,8 +801,9 @@ Function9373: ; 9373 ld a, [PlayerHPPal] ld l, a ld h, 0 +rept 2 add hl, hl - add hl, hl +endr ld bc, Palettes_a8be add hl, bc call Function9643 diff --git a/predef/sgb.asm b/predef/sgb.asm index b63f81db3..d870af2a6 100644 --- a/predef/sgb.asm +++ b/predef/sgb.asm @@ -74,8 +74,9 @@ Function86b4: ; 86b4 ld a, [PlayerHPPal] ld l, a ld h, 0 +rept 2 add hl, hl - add hl, hl +endr ld de, Palettes_a8be add hl, de ld a, [hli] @@ -89,8 +90,9 @@ Function86b4: ; 86b4 ld a, [EnemyHPPal] ld l, a ld h, $0 +rept 2 add hl, hl - add hl, hl +endr ld de, Palettes_a8be add hl, de ld a, [hli] @@ -137,8 +139,9 @@ Function873c: ; 873c call CopyBytes ld hl, wcda9 + 1 ld [hl], $10 +rept 2 inc hl - inc hl +endr ld a, [PlayerHPPal] add $2f ld [hl], a @@ -161,8 +164,9 @@ Function8763: ; 8763 ld a, [wcda1] ld l, a ld h, $0 +rept 2 add hl, hl - add hl, hl +endr ld de, Palettes_a8be add hl, de ld a, [hli] @@ -303,10 +307,9 @@ Function8860: ; 8860 Function8867: ; 8867 ld b, 0 ld hl, Unknown_8878 +rept 4 add hl, bc - add hl, bc - add hl, bc - add hl, bc +endr ld e, [hl] inc hl ld d, [hl] @@ -461,9 +464,9 @@ Function8969: ; 8969 ld a, [CurPartySpecies] ld l, a ld h, 0 +rept 3 add hl, hl - add hl, hl - add hl, hl +endr ld de, PokemonPalettes add hl, de ld a, [wcf65] diff --git a/rst.asm b/rst.asm index c54dc83e2..ae9158b51 100644 --- a/rst.asm +++ b/rst.asm @@ -22,8 +22,9 @@ SECTION "rst28",ROM0[JumpTable] push de ld e, a ld d, 0 +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld h, [hl] ld l, a diff --git a/text/types.asm b/text/types.asm index b04cab7f7..824e7e746 100644 --- a/text/types.asm +++ b/text/types.asm @@ -85,8 +85,9 @@ GetTypeName: ; 50964 ld hl, TypeNames ld e, a ld d, 0 +rept 2 add hl, de - add hl, de +endr ld a, [hli] ld h, [hl] ld l, a diff --git a/tilesets/animations.asm b/tilesets/animations.asm index 1a43f02b4..8353cac30 100644 --- a/tilesets/animations.asm +++ b/tilesets/animations.asm @@ -16,8 +16,9 @@ _AnimateTileset:: ; fc000 ld [hTileAnimFrame], a ld h, 0 +rept 2 add hl, hl - add hl, hl +endr add hl, de ; 2-byte parameter @@ -488,9 +489,9 @@ AnimateWaterTile: ; fc402 and 3 << 1 ; 2 x 8 = 16 bytes per tile +rept 3 add a - add a - add a +endr add WaterTileFrames % $100 ld l, a @@ -527,9 +528,9 @@ ForestTreeLeftAnimation: ; fc45c .asm_fc46c ld a, [TileAnimationTimer] call GetForestTreeFrame +rept 3 add a - add a - add a +endr add ForestTreeLeftFrames % $100 ld l, a ld a, 0 @@ -569,9 +570,9 @@ ForestTreeRightAnimation: ; fc4c4 .asm_fc4d4 ld a, [TileAnimationTimer] call GetForestTreeFrame +rept 3 add a - add a - add a +endr add ForestTreeLeftFrames % $100 ld l, a ld a, 0 @@ -605,9 +606,9 @@ ForestTreeLeftAnimation2: ; fc4f2 ld a, [TileAnimationTimer] call GetForestTreeFrame xor 2 +rept 3 add a - add a - add a +endr add ForestTreeLeftFrames % $100 ld l, a ld a, 0 @@ -637,9 +638,9 @@ ForestTreeRightAnimation2: ; fc51c ld a, [TileAnimationTimer] call GetForestTreeFrame xor 2 +rept 3 add a - add a - add a +endr add ForestTreeLeftFrames % $100 ld l, a ld a, 0 @@ -729,8 +730,9 @@ SafariFountainAnim1: ; fc5cc ld a, [TileAnimationTimer] and 6 srl a +rept 2 inc a - inc a +endr and 3 swap a ld e, a @@ -750,9 +752,9 @@ SafariFountainAnim2: ; fc5eb ld c, l ld a, [TileAnimationTimer] and 6 +rept 3 add a - add a - add a +endr ld e, a ld d, 0 ld hl, SafariFountainFrames diff --git a/trainers/dvs.asm b/trainers/dvs.asm index 2975d60fe..1169785d6 100644 --- a/trainers/dvs.asm +++ b/trainers/dvs.asm @@ -8,8 +8,9 @@ GetTrainerDVs: ; 270c4 ld b, 0 ld hl, TrainerClassDVs +rept 2 add hl, bc - add hl, bc +endr ld a, [hli] ld b, a