ref: 471492b775fc2a0f5162f3d1c13c5472359beb14
parent: d1e11f77e525aa7a7751359db4e5380b420e882c
author: PikalaxALT <PikalaxALT@gmail.com>
date: Mon Jul 20 18:18:18 EDT 2015
Reverted ld_hl_pointer macro
--- a/audio/engine.asm
+++ b/audio/engine.asm
@@ -413,10 +413,9 @@
; 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 @@
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 @@
; 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 @@
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 @@
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 @@
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 @@
; 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 @@
; 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 @@
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 @@
; 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
--- a/audio/music/goldenrodcity.asm
+++ b/audio/music/goldenrodcity.asm
@@ -275,8 +275,9 @@
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
--- a/audio/music/johtowildbattle.asm
+++ b/audio/music/johtowildbattle.asm
@@ -492,8 +492,9 @@
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
--- a/audio/music/kantowildbattle.asm
+++ b/audio/music/kantowildbattle.asm
@@ -325,22 +325,25 @@
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
--- a/battle/ai/items.asm
+++ b/battle/ai/items.asm
@@ -193,9 +193,9 @@
jr z, .has_item
dec de
+rept 3
inc hl
- inc hl
- inc hl
+endr
jr .loop
.has_item
@@ -213,8 +213,9 @@
pop de
pop hl
+rept 2
inc hl
- inc hl
+endr
jr c, .loop
.used_item
--- a/battle/ai/scoring.asm
+++ b/battle/ai/scoring.asm
@@ -133,8 +133,9 @@
call AI_50_50
jr c, .checkmove
+rept 2
dec [hl]
- dec [hl]
+endr
jr .checkmove
.discourage
@@ -141,8 +142,9 @@
call Random
cp 30
jr c, .checkmove
+rept 2
inc [hl]
- inc [hl]
+endr
jr .checkmove
; 38635
@@ -262,8 +264,9 @@
and a
jr nz, .checkmove
+rept 2
inc [hl]
- inc [hl]
+endr
jr .checkmove
; 386be
@@ -417,8 +420,9 @@
.asm_387f0
call AI_50_50
ret c
+rept 2
dec [hl]
- dec [hl]
+endr
ret
; 387f7
@@ -529,8 +533,9 @@
call AI_50_50
ret c
+rept 2
dec [hl]
- dec [hl]
+endr
ret
.asm_38882
@@ -555,8 +560,9 @@
cp 180
jr nc, .asm_3888b
+rept 2
dec [hl]
- dec [hl]
+endr
jr .asm_3888b
.asm_388a2
@@ -596,9 +602,9 @@
ret c
.asm_388c6
+rept 3
inc [hl]
- inc [hl]
- inc [hl]
+endr
ret
; 388ca
@@ -610,9 +616,9 @@
call Random
cp 25
ret c
+rept 3
dec [hl]
- dec [hl]
- dec [hl]
+endr
ret
; 388d4
@@ -639,8 +645,9 @@
jr nc, .asm_38911
.asm_388ef
+rept 2
dec [hl]
- dec [hl]
+endr
ret
.asm_388f2
@@ -669,8 +676,9 @@
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 @@
call Random
cp $50
ret c
+rept 2
dec [hl]
- dec [hl]
+endr
ret
; Player is seeded.
@@ -747,8 +756,9 @@
call AI_80_20
ret c
+rept 2
dec [hl]
- dec [hl]
+endr
ret
; 3895b
@@ -818,8 +828,9 @@
jr nc, .asm_389bf
.asm_3899d
+rept 2
dec [hl]
- dec [hl]
+endr
ret
.asm_389a0
@@ -848,8 +859,9 @@
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 @@
call Random
cp $50
ret c
+rept 2
dec [hl]
- dec [hl]
+endr
ret
; Player is seeded.
@@ -997,8 +1010,9 @@
call Random
cp $19
ret c
+rept 2
dec [hl]
- dec [hl]
+endr
ret
; 38a4e
@@ -1079,8 +1093,9 @@
ret nc
call AI_50_50
ret c
+rept 2
dec [hl]
- dec [hl]
+endr
ret
; 38a9c
@@ -1185,8 +1200,9 @@
.asm_38b09
call AI_80_20
ret c
+rept 2
dec [hl]
- dec [hl]
+endr
ret
.asm_38b10
@@ -1208,9 +1224,9 @@
call AICompareSpeed
ret nc
+rept 3
dec [hl]
- dec [hl]
- dec [hl]
+endr
ret
; 38b20
@@ -1239,8 +1255,9 @@
ret nc
call AI_80_20
ret c
+rept 2
dec [hl]
- dec [hl]
+endr
ret
.asm_38b3a
@@ -1272,8 +1289,9 @@
call Random
cp 30
ret c
+rept 2
dec [hl]
- dec [hl]
+endr
ret
; 38b5c
@@ -1510,14 +1528,15 @@
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 @@
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 @@
ld a, [EnemyMonStatus]
and $20
ret z
+rept 3
dec [hl]
- dec [hl]
- dec [hl]
+endr
ret
; 38cd5
@@ -1666,8 +1685,9 @@
call Random
cp $64
ret c
+rept 2
dec [hl]
- dec [hl]
+endr
ret
; 38d16
@@ -1708,9 +1728,9 @@
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 @@
ret z
call AI_50_50
ret c
+rept 2
dec [hl]
- dec [hl]
+endr
ret
.no_status
@@ -1774,9 +1795,9 @@
ld a, [BattleMonHP]
sbc b
ret nc
+rept 3
dec [hl]
- dec [hl]
- dec [hl]
+endr
ret
; 38d93
@@ -1900,9 +1921,9 @@
.asm_38e26
call AI_80_20
ret c
+rept 3
dec [hl]
- dec [hl]
- dec [hl]
+endr
ret
; 38e2e
@@ -1952,11 +1973,9 @@
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 @@
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 @@
call AI_50_50
ret c
+rept 2
dec [hl]
- dec [hl]
+endr
ret
; 38ed2
@@ -2097,8 +2119,9 @@
call Random
cp 20
ret c
+rept 2
inc [hl]
- inc [hl]
+endr
ret
; 38f1d
@@ -2128,8 +2151,9 @@
call Random
cp 100
ret c
+rept 2
dec [hl]
- dec [hl]
+endr
ret
; 38f4a
@@ -2235,9 +2259,9 @@
call AI_80_20
ret c
+rept 3
dec [hl]
- dec [hl]
- dec [hl]
+endr
ret
.asm_38fcb
@@ -2248,8 +2272,9 @@
call AI_50_50
ret c
+rept 2
dec [hl]
- dec [hl]
+endr
ret
.asm_38fd8
@@ -2271,14 +2296,15 @@
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 @@
call Random
cp 200
ret nc
+rept 2
dec [hl]
- dec [hl]
+endr
ret
.asm_39020
@@ -2379,8 +2406,9 @@
call AICompareSpeed
ret nc
+rept 2
dec [hl]
- dec [hl]
+endr
ret
.could_dig
@@ -2427,8 +2455,9 @@
.asm_3907d
call AI_50_50
ret c
+rept 2
dec [hl]
- dec [hl]
+endr
ret
; 39084
@@ -2453,8 +2482,9 @@
call AI_80_20
ret c
+rept 2
dec [hl]
- dec [hl]
+endr
ret
; 3909e
@@ -2581,9 +2611,9 @@
; 3911e
AIBadWeatherType: ; 3911e
+rept 3
inc [hl]
- inc [hl]
- inc [hl]
+endr
ret
; 39122
@@ -2606,8 +2636,9 @@
ret nz
.good
+rept 2
dec [hl]
- dec [hl]
+endr
ret
; 39134
@@ -2702,8 +2733,9 @@
ret
.asm_39188
+rept 2
inc [hl]
- inc [hl]
+endr
ret
; 3918b
@@ -2788,8 +2820,9 @@
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 @@
and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND
ret z
+rept 2
dec [hl]
- dec [hl]
+endr
ret
; 39200
@@ -2852,8 +2886,9 @@
cp 25 ; 1/10
ret c
+rept 2
inc [hl]
- inc [hl]
+endr
ret
.asm_3921e
@@ -2860,8 +2895,9 @@
call AI_80_20
ret c
+rept 2
dec [hl]
- dec [hl]
+endr
ret
; 39225
@@ -2955,8 +2991,9 @@
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 @@
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 @@
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 @@
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 @@
jr nc, .nextmove
pop hl
+rept 5
dec [hl]
- dec [hl]
- dec [hl]
- dec [hl]
- dec [hl]
+endr
push hl
.nextmove
--- a/battle/anim_commands.asm
+++ b/battle/anim_commands.asm
@@ -265,9 +265,9 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
inc hl
ld d, [hl]
ld hl, BattleAnimations
+rept 2
add hl, de
- add hl, de
+endr
call Function3ae1
call BattleAnimAssignPals
call BattleAnimDelayFrame
--- a/battle/anim_objects.asm
+++ b/battle/anim_objects.asm
@@ -36,12 +36,9 @@
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 @@
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 @@
dec a
ld [hli], a
xor a
+rept 2
ld [hli], a
- ld [hli], a
+endr
ld [hl], a
ret
@@ -516,8 +515,9 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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]
--- a/battle/bg_effects.asm
+++ b/battle/bg_effects.asm
@@ -61,8 +61,9 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
call Functionc901b
ld hl, $2
add hl, bc
+rept 2
inc [hl]
- inc [hl]
+endr
ret
Functionc8801: ; c8801 (32:4801)
@@ -1792,8 +1797,9 @@
call Functionc901b
ld hl, $3
add hl, bc
+rept 2
inc [hl]
- inc [hl]
+endr
ret
Functionc8a36: ; c8a36 (32:4a36)
@@ -1877,8 +1883,9 @@
ld h, $d2
.asm_c8aa5
ld [hl], e
+rept 2
inc hl
- inc hl
+endr
dec a
jr nz, .asm_c8aa5
ret
--- a/battle/core.asm
+++ b/battle/core.asm
@@ -1840,8 +1840,9 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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,8 +4695,9 @@
ld a, [hli]
cp $ff
jr z, .asm_3def9
+rept 2
inc hl
- inc hl
+endr
cp b
jr nz, .asm_3dec7
pop bc
@@ -4702,8 +4704,9 @@
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 @@
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 @@
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 @@
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 @@
.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 @@
; 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 @@
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 @@
; a * 5 + 1
ld c, a
+rept 2
add a
- add a
+endr
add c
inc a
@@ -7392,8 +7401,9 @@
ld [de], a
.asm_3eea9
+rept 2
inc de
- inc de
+endr
dec c
jr nz, .asm_3ee7c
xor a
@@ -7468,8 +7478,9 @@
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 @@
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 @@
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 @@
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,8 +9202,9 @@
ld c, $1
.asm_3faed
ld a, b
+rept 2
add b
- add b
+endr
ld e, a
ld d, $0
ld hl, DefaultFlypoint
@@ -9195,8 +9211,9 @@
add hl, de
push hl
ld a, c
+rept 2
add c
- add c
+endr
ld e, a
ld d, $0
ld hl, DefaultFlypoint
--- a/battle/effect_commands.asm
+++ b/battle/effect_commands.asm
@@ -50,8 +50,9 @@
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 @@
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 @@
jp nz, EndMoveEffect
; SubStatus5
+rept 2
inc de
- inc de
+endr
ld a, [de]
bit SUBSTATUS_TRANSFORMED, a
@@ -1259,8 +1262,9 @@
jr nc, .ScopeLens
; +2 critical level
+rept 2
inc c
- inc c
+endr
.ScopeLens
push bc
@@ -1500,8 +1504,9 @@
pop hl
.asm_347b3
+rept 2
inc hl
- inc hl
+endr
jr .asm_34743
.end
@@ -1746,11 +1751,9 @@
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 @@
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 @@
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 @@
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 @@
xor a
ld hl, hDividend
+rept 2
ld [hli], a
- ld [hli], a
+endr
ld [hl], a
; Level * 2
@@ -4061,8 +4067,9 @@
pop bc
; + 2
+rept 2
inc [hl]
- inc [hl]
+endr
; * bp
inc hl
@@ -4523,9 +4530,9 @@
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 @@
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 @@
ld a, [CurDamage + 1]
rr a
ld [CurDamage + 1], a
+rept 3
inc hl
- inc hl
- inc hl
+endr
+rept 3
inc de
- inc de
- inc de
+endr
; fallthrough
; 359ac
@@ -5142,8 +5150,9 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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]
--- a/battle/hidden_power.asm
+++ b/battle/hidden_power.asm
@@ -45,8 +45,9 @@
; Multiply by 5
ld b, a
+rept 2
add a
- add a
+endr
add b
; Add Special & 3
@@ -74,8 +75,9 @@
ld a, [hl]
and 3 << 4
swap a
+rept 2
add a
- add a
+endr
or b
; Skip Normal
--- a/battle/magikarp_length.asm
+++ b/battle/magikarp_length.asm
@@ -141,8 +141,9 @@
; hl = de * 10
ld h, d
ld l, e
+rept 2
add hl, hl
- add hl, hl
+endr
add hl, de
add hl, hl
--- a/data/wild/fish.asm
+++ b/data/wild/fish.asm
@@ -60,9 +60,9 @@
jr c, .ReadMon
; Next monster...
+rept 3
inc hl
- inc hl
- inc hl
+endr
jr .CheckEncounter
.ReadMon
@@ -98,8 +98,9 @@
and 3
cp NITE
jr c, .TimeSpecies
+rept 2
inc hl
- inc hl
+endr
.TimeSpecies
ld d, [hl]
--- a/engine/color.asm
+++ b/engine/color.asm
@@ -262,10 +262,9 @@
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 @@
.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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
call CheckShininess
pop hl
ret nc
+rept 4
inc hl
- inc hl
- inc hl
- inc hl
+endr
ret
; 9809
@@ -1140,8 +1139,9 @@
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 @@
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 @@
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 @@
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
--- a/engine/credits.asm
+++ b/engine/credits.asm
@@ -260,8 +260,9 @@
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 @@
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 @@
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 @@
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 @@
ld [hl], a
ld a, [wcf65]
and 3
+rept 2
add a
- add a
+endr
add e
add a
ld e, a
--- a/engine/events.asm
+++ b/engine/events.asm
@@ -794,8 +794,9 @@
push hl
call PlayTalkObject
pop hl
+rept 2
inc hl
- inc hl
+endr
call GetMapScriptHeaderBank
call GetFarHalfword
call GetMapScriptHeaderBank
--- a/engine/events_2.asm
+++ b/engine/events_2.asm
@@ -439,9 +439,9 @@
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]
--- a/engine/fruit_trees.asm
+++ b/engine/fruit_trees.asm
@@ -66,9 +66,9 @@
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]
--- a/engine/landmarks.asm
+++ b/engine/landmarks.asm
@@ -3,8 +3,9 @@
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 @@
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]
--- a/engine/map_objects.asm
+++ b/engine/map_objects.asm
@@ -656,9 +656,9 @@
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 @@
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 @@
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 @@
ret z
ld a, [wd45b]
and 3
+rept 2
add a
- add a
+endr
jr Function57db
; 57d9
--- a/engine/map_setup.asm
+++ b/engine/map_setup.asm
@@ -6,8 +6,9 @@
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 @@
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]
--- a/engine/pack.asm
+++ b/engine/pack.asm
@@ -1235,8 +1235,9 @@
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 @@
.asm_108b3
ld hl, PackGFXPointers
+rept 2
add hl, de
- add hl, de
+endr
ld a, [hli]
ld e, a
ld d, [hl]
--- a/engine/pokedex.asm
+++ b/engine/pokedex.asm
@@ -899,10 +899,9 @@
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 @@
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 @@
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 @@
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
--- a/engine/scripting.asm
+++ b/engine/scripting.asm
@@ -861,8 +861,9 @@
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 @@
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 @@
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 @@
.asm_97280
ld d, a
call GetScriptByte
+rept 2
add a
- add a
+endr
ld e, a
call ApplyPersonFacing
ret
@@ -1638,9 +1642,9 @@
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 @@
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
--- a/engine/title.asm
+++ b/engine/title.asm
@@ -345,8 +345,9 @@
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 @@
ld a, [hl]
add 2
ld [hli], a
+rept 3
inc hl
- inc hl
- inc hl
+endr
dec c
jr nz, .loop
--- a/event/dratini.asm
+++ b/event/dratini.asm
@@ -37,8 +37,9 @@
; get address of mon's first move
pop de
+rept 2
inc de
- inc de
+endr
.GiveMoves
ld a, [hl]
--- a/event/poke_seer.asm
+++ b/event/poke_seer.asm
@@ -287,8 +287,9 @@
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
--- a/gfx/pics/animation.asm
+++ b/gfx/pics/animation.asm
@@ -110,8 +110,9 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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
--- a/home.asm
+++ b/home.asm
@@ -967,8 +967,9 @@
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 @@
inc hl
.asm_35f8
+rept 2
inc hl
- inc hl
+endr
jr .asm_35e6
.asm_35fc
@@ -2108,10 +2110,12 @@
push bc
ld de, AttrMap - TileMap
add hl, de
+rept 2
inc b
- inc b
+endr
+rept 2
inc c
- inc c
+endr
call Function3f35
pop bc
pop hl
@@ -2135,10 +2139,12 @@
push bc
ld de, AttrMap - TileMap
add hl, de
+rept 2
inc b
- inc b
+endr
+rept 2
inc c
- inc c
+endr
call Function3f35
pop bc
pop hl
@@ -2259,8 +2265,9 @@
ld c, $8
.asm_3fa5
ld a, [de]
+rept 2
inc de
- inc de
+endr
cpl
ld [hl], $0
inc hl
--- a/home/audio.asm
+++ b/home/audio.asm
@@ -158,12 +158,9 @@
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
--- a/home/battle.asm
+++ b/home/battle.asm
@@ -153,8 +153,9 @@
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 @@
ld b, 0
ld hl, .vars
+rept 2
add hl, bc
- add hl, bc
+endr
ld a, [hli]
ld h, [hl]
--- a/home/copy.asm
+++ b/home/copy.asm
@@ -195,8 +195,9 @@
.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 @@
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
--- a/home/cry.asm
+++ b/home/cry.asm
@@ -66,12 +66,9 @@
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
--- a/home/joypad.asm
+++ b/home/joypad.asm
@@ -42,8 +42,9 @@
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 @@
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 @@
jr nz, .next
; The current input is overwritten.
+rept 2
dec hl
- dec hl
+endr
ld b, NO_INPUT
jr .finishauto
--- a/home/map.asm
+++ b/home/map.asm
@@ -303,8 +303,9 @@
; 22a3
Function22a3:: ; 22a3
+rept 2
inc hl
- inc hl
+endr
scf
ret
; 22a7
@@ -420,8 +421,9 @@
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 @@
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 @@
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 @@
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 @@
.nocarry
rr e
jr nc, .nocarry2
+rept 2
inc hl
- inc hl
+endr
.nocarry2
ld a, [TilesetCollisionBank]
@@ -2062,8 +2066,9 @@
ld c, b
ld b, 0
ld hl, MapGroupPointers
+rept 2
add hl, bc
- add hl, bc
+endr
ld a, [hli]
ld h, [hl]
--- a/home/map_objects.asm
+++ b/home/map_objects.asm
@@ -28,8 +28,9 @@
.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 @@
endr
ld a, BANK(ObjectStruct3_Data)
call GetFarByte
+rept 2
add a
- add a
+endr
and $c
pop de
pop bc
--- a/home/menu.asm
+++ b/home/menu.asm
@@ -111,8 +111,9 @@
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 @@
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 @@
Function1f9e:: ; 1f9e
call Function1fb1
+rept 2
inc hl
- inc hl
+endr
ld a, [hli]
ld d, [hl]
ld e, a
@@ -475,10 +478,9 @@
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 @@
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
--- a/home/movement.asm
+++ b/home/movement.asm
@@ -102,8 +102,9 @@
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 @@
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
--- a/home/text.asm
+++ b/home/text.asm
@@ -126,10 +126,12 @@
; 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
+endr
+rept 2
inc c
- inc c
+endr
ld a, TEXTBOX_PAL
.col
push bc
@@ -626,10 +628,12 @@
inc de
dec c
jr nz, .row
+rept 2
inc de
- inc de
+endr
+rept 2
inc hl
- inc hl
+endr
pop af
dec a
jr nz, .col
@@ -719,8 +723,9 @@
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 @@
jr z, .done
cp b
jr z, .play
+rept 2
inc hl
- inc hl
+endr
jr .loop
.play
@@ -1088,8 +1094,9 @@
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 @@
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
--- a/home/tilemap.asm
+++ b/home/tilemap.asm
@@ -175,11 +175,13 @@
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 @@
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
--- a/home/vblank.asm
+++ b/home/vblank.asm
@@ -19,8 +19,9 @@
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
--- a/home/video.asm
+++ b/home/video.asm
@@ -77,8 +77,9 @@
; We've done 2 16x8 blocks
ld a, [$ffdc]
+rept 2
dec a
- dec a
+endr
ld [$ffdc], a
jr nz, .next
--- a/items/item_descriptions.asm
+++ b/items/item_descriptions.asm
@@ -21,8 +21,9 @@
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]
--- a/items/item_effects.asm
+++ b/items/item_effects.asm
@@ -253,8 +253,9 @@
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 @@
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 @@
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 @@
call GetPokedexEntryBank
push bc
+rept 2
inc hl
- inc hl
+endr
call GetFarHalfword
srl h
@@ -863,8 +867,9 @@
ld a, c
cp [hl]
jr c, .heavymon
+rept 2
inc hl
- inc hl
+endr
jr .lookup
.heavymon
@@ -923,8 +928,9 @@
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 @@
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 @@
jr z, .asm_f3a9
cp d
jr z, .done
+rept 2
inc hl
- inc hl
+endr
jr .next
.asm_f3a9
@@ -2322,8 +2329,9 @@
.asm_f4ce
cp [hl]
jr z, .asm_f4d5
+rept 2
inc hl
- inc hl
+endr
jr .asm_f4ce
.asm_f4d5
--- a/lib/mobile/main.asm
+++ b/lib/mobile/main.asm
@@ -665,8 +665,9 @@
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 @@
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 @@
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 @@
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 @@
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 @@
ld [hli], a
ld a, d
ld [hli], a
+rept 2
inc de
- inc de
+endr
+rept 2
dec bc
- dec bc
+endr
ld hl, $c98f
ld a, e
ld [hli], a
@@ -1565,8 +1570,9 @@
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 @@
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 @@
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 @@
ld [hli], a
ld a, d
ld [hli], a
+rept 2
inc de
- inc de
+endr
+rept 2
dec bc
- dec bc
+endr
ld hl, $c98f
ld a, e
ld [hli], a
@@ -1908,8 +1918,9 @@
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 @@
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 @@
.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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
ld a, b
srl a
srl a
+rept 2
add b
- add b
+endr
ld [hl], a
ret
@@ -3558,9 +3583,9 @@
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 @@
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 @@
.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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
cp $1
ld a, $32
jr z, .asm_112e95
+rept 2
inc de
- inc de
+endr
inc a
.asm_112e95
@@ -7463,8 +7498,9 @@
.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 @@
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 @@
ld e, a
ld a, [$c875]
ld d, a
+rept 2
inc de
- inc de
+endr
call Function110000
.asm_11310d
@@ -7606,8 +7644,9 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
ret
.asm_1134f0
+rept 2
inc [hl]
- inc [hl]
+endr
jr .asm_1134fc
.asm_1134f4
@@ -8585,10 +8631,9 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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
--- a/main.asm
+++ b/main.asm
@@ -3108,9 +3108,9 @@
.loop
sub [hl]
jr c, .ok
+rept 3
inc hl
- inc hl
- inc hl
+endr
jr .loop
.ok
@@ -4443,8 +4443,9 @@
; 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 @@
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 @@
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 @@
.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 @@
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 @@
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 @@
ld a, c
cp $6
jr nz, .asm_e193
+rept 2
dec hl
- dec hl
+endr
.asm_e193
sla c
@@ -9309,14 +9313,15 @@
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 @@
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 @@
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 @@
; 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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
ld a, b
and 2
srl a
+rept 2
add c
- add c
+endr
+rept 2
add d
- add d
+endr
call .AddContestStat
@@ -15956,8 +15969,9 @@
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 @@
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 @@
jr z, .exists
and a
jr z, .new
+rept 2
inc hl
- inc hl
+endr
dec c
jr nz, .loop
@@ -16980,8 +16996,9 @@
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 @@
; 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 @@
Function15c91: ; 15c91
call Function15ca3
+rept 2
inc hl
- inc hl
+endr
ld a, [hl]
and a
jp z, Function15d83
@@ -21387,8 +21407,9 @@
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 @@
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 @@
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 @@
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 @@
ld a, [hl]
call Function24c94
.asm_24c89
+rept 2
inc hl
- inc hl
+endr
jr .asm_24c73
.asm_24c8d
@@ -27142,9 +27166,9 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
.asm_2a1f2
; to PartyMonLevel
+rept 4
dec hl
- dec hl
- dec hl
- dec hl
+endr
ld a, [CurPartyLevel]
cp [hl]
@@ -34235,9 +34262,9 @@
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 @@
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 @@
jr .asm_2c08e
.asm_2c08b
+rept 3
dec hl
- dec hl
- dec hl
+endr
.asm_2c08e
ld a, b
@@ -36010,9 +36037,9 @@
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 @@
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 @@
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 @@
; 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 @@
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 @@
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 @@
.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 @@
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 @@
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 @@
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 @@
pop bc
ld de, AttrMap - TileMap
add hl, de
+rept 2
inc b
- inc b
+endr
+rept 2
inc c
- inc c
+endr
ld a, $0
.asm_48ced
push bc
@@ -41594,9 +41624,9 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
pop bc
ld de, AttrMap - TileMap
add hl, de
+rept 2
inc b
- inc b
+endr
+rept 2
inc c
- inc c
+endr
ld a, $7
.asm_4d36e
push bc
@@ -46894,8 +46932,9 @@
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 @@
.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 @@
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 @@
call Function4e741
pop bc
inc b
+rept 2
dec c
- dec c
+endr
jr nz, .asm_4e72c
and a
ret
@@ -47849,8 +47891,9 @@
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 @@
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 @@
ld a, d
ld [hSCX], a
call Function4e9f1
+rept 2
inc e
- inc e
+endr
+rept 2
dec d
- dec d
+endr
pop af
push af
cp $1
@@ -48116,8 +48161,9 @@
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 @@
jr nz, .asm_500a7
.asm_500bf
+rept 2
dec hl
- dec hl
+endr
ld de, String_500c8
call PlaceString
ret
@@ -48465,8 +48512,9 @@
pop de
ld a, $f3
ld [hli], a
+rept 2
inc de
- inc de
+endr
ld bc, $0203
call PrintNum
@@ -48669,16 +48717,19 @@
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 @@
.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 @@
Function50d0a: ; 50d0a
push de
+rept 2
inc de
- inc de
+endr
ld a, [de]
ld b, a
inc de
@@ -50451,8 +50503,9 @@
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 @@
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 @@
; 81ca7
Function81ca7: ; 81ca7
+rept 3
inc hl
- inc hl
- inc hl
+endr
ld a, [de]
call Function81cbc
ld a, [de]
@@ -53376,8 +53430,9 @@
Function81e55: ; 81e55
cp $32
jr c, .asm_81e5b
+rept 2
inc a
- inc a
+endr
.asm_81e5b
add $bf
@@ -53490,8 +53545,9 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
Function896f5: ; 896f5
call Function8971f
call Function89736
+rept 2
inc hl
- inc hl
+endr
ld b, 2
ClearScreenArea: ; 0x896ff
@@ -57919,8 +57976,9 @@
jr nz, .loop
dec hl
+rept 2
inc c
- inc c
+endr
.asm_89713
ld a, $36
ld [hli], a
@@ -57954,8 +58012,9 @@
Function89736: ; 89736
push hl
+rept 2
inc hl
- inc hl
+endr
ld e, c
ld d, $0
add hl, de
@@ -57991,8 +58050,9 @@
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 @@
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 @@
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 @@
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 @@
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 @@
.asm_8aef5
call Function8aefd
+rept 2
inc hl
- inc hl
+endr
inc de
jr .asm_8aee9
; 8aefd
@@ -61506,8 +61568,9 @@
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 @@
; 8b281
Function8b281: ; 8b281
+rept 3
inc de
- inc de
- inc de
+endr
ld a, [de]
ld l, a
inc de
@@ -62124,8 +62187,9 @@
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 @@
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 @@
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 @@
Function8b744: ; 8b744
ld de, AttrMap - TileMap
add hl, de
+rept 2
inc b
- inc b
+endr
+rept 2
inc c
- inc c
+endr
xor a
.asm_8b74d
push bc
@@ -63565,9 +63633,9 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
ld [hl], a
pop hl
call Function90859
+rept 3
inc hl
- inc hl
- inc hl
+endr
ret
; 90810
@@ -71586,8 +71667,9 @@
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 @@
ld a, [hl]
and a
ret z
+rept 2
dec [hl]
- dec [hl]
+endr
jr .update
.up
@@ -71988,8 +72071,9 @@
ld a, [hl]
cp 80
ret nc
+rept 2
inc [hl]
- inc [hl]
+endr
.update
@@ -72003,8 +72087,9 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
Functionb8115: ; b8115
ld de, AttrMap - TileMap
add hl, de
+rept 2
inc b
- inc b
+endr
+rept 2
inc c
- inc c
+endr
ld a, $87
.asm_b811f
push bc
@@ -76082,13 +76171,15 @@
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 @@
.loop
sub [hl]
jr c, .ok
+rept 3
inc hl
- inc hl
- inc hl
+endr
jr .loop
.ok
@@ -76897,10 +76988,9 @@
jr .loop
.done
+rept 4
inc hl
- inc hl
- inc hl
- inc hl
+endr
.not3
call Random
@@ -77477,10 +77567,9 @@
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 @@
cp $ff
jr z, .asm_b92e6
inc c
+rept 2
inc hl
- inc hl
+endr
jr .asm_b92d9
.asm_b92e6
@@ -79710,8 +79800,9 @@
.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 @@
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 @@
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,45 +80425,45 @@
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]
@@ -80379,17 +80470,17 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
ld [hl], a
cp $3
jr c, .asm_e08e2
+rept 2
dec [hl]
- dec [hl]
+endr
jp Functione0959
.asm_e08e2
@@ -81548,8 +81640,9 @@
ld [hl], a
cp $4
ret nc
+rept 2
inc [hl]
- inc [hl]
+endr
jr Functione0959
Functione090a: ; e090a
@@ -81578,8 +81671,9 @@
ld [hl], a
cp $3
jr c, .asm_e0931
+rept 2
dec [hl]
- dec [hl]
+endr
jr Functione0959
.asm_e0931
@@ -81607,8 +81701,9 @@
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 @@
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 @@
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 @@
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 @@
call Functione2128
ld hl, UnknownText_0xe2093
pop bc
+rept 3
inc bc
- inc bc
- inc bc
+endr
ret
; e2093
@@ -84709,9 +84803,9 @@
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 @@
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 @@
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 @@
.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 @@
; 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 @@
.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 @@
jr z, .ApplyModifier
.NextWeatherType
+rept 2
inc de
- inc de
+endr
jr .CheckWeatherType
@@ -90435,8 +90532,9 @@
jr z, .ApplyModifier
.NextWeatherMove
+rept 2
inc de
- inc de
+endr
jr .CheckWeatherMove
.ApplyModifier
@@ -93579,8 +93677,9 @@
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
@@ -93587,12 +93686,9 @@
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,10 +94049,9 @@
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
@@ -93963,10 +94058,9 @@
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 @@
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 @@
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 @@
ld de, ._9
.asm_106256
+rept 3
inc de
- inc de
- inc de
+endr
+rept 2
dec a
- 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 @@
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
--- a/maps/Route24.asm
+++ b/maps/Route24.asm
@@ -12,7 +12,7 @@
writetext UnknownText_0x1adc2e
closetext
loadmovesprites
- winlosstext UnknownText_0x1add67, $ffff
+ winlosstext UnknownText_0x1add67, -1
loadtrainer GRUNTM, 31
startbattle
reloadmapmusic
--- a/misc/crystal_misc.asm
+++ b/misc/crystal_misc.asm
@@ -552,16 +552,16 @@
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 @@
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)
--- a/misc/mobile_40.asm
+++ b/misc/mobile_40.asm
@@ -114,8 +114,9 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
inc hl
push hl
+rept 2
add a
- add a
+endr
add Unknown_10327a % $100
ld l, a
@@ -7628,8 +7633,9 @@
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 @@
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
--- a/misc/mobile_42.asm
+++ b/misc/mobile_42.asm
@@ -339,8 +339,9 @@
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 @@
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 @@
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 @@
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 @@
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
--- a/misc/mobile_45.asm
+++ b/misc/mobile_45.asm
@@ -152,8 +152,9 @@
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 @@
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 @@
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 @@
ld a, [wdc0e]
cp $3
jr nz, .asm_114773
+rept 2
dec bc
- dec bc
+endr
.asm_114773
call Function1149cc
@@ -1861,12 +1865,9 @@
.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 @@
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 @@
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 @@
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 @@
add hl, de
ld b, h
ld c, l
+rept 2
inc bc
- inc bc
+endr
xor a
ret
; 114df1
@@ -2513,8 +2516,9 @@
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 @@
.asm_11510b
pop hl
+rept 2
dec hl
- dec hl
+endr
push de
call Function1158c2
pop de
@@ -3429,8 +3434,9 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
ret
.asm_115c33
+rept 2
dec hl
- dec hl
+endr
xor a
ld [hl], a
ld a, $1
@@ -5027,10 +5036,9 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
jr nz, .asm_118b8c
dec hl
xor a
+rept 2
ld [hli], a
- ld [hli], a
+endr
ret
; 118b9a
@@ -10272,8 +10295,9 @@
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 @@
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 @@
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 @@
.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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
.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 @@
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 @@
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 @@
Function11c35f: ; 11c35f (47:435f)
ld hl, wcd2f
+rept 2
inc [hl]
- inc [hl]
+endr
+rept 2
dec hl
- dec hl
+endr
dec [hl]
push af
ld de, wcd2d
@@ -17026,10 +17065,12 @@
Function11c373: ; 11c373 (47:4373)
ld hl, wcd30
+rept 2
inc [hl]
- inc [hl]
+endr
+rept 2
dec hl
- dec hl
+endr
dec [hl]
push af
ld de, wcd2d
@@ -17672,8 +17713,9 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
.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 @@
.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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
call Function16cae8
.asm_16c9e1
+rept 2
inc e
- inc e
+endr
ld a, e
cp $8
jr nz, .asm_16c969
@@ -21694,8 +21754,9 @@
call Function16cae8
.asm_16ca88
+rept 2
inc e
- inc e
+endr
ld a, e
cp $8
jr nz, .asm_16ca28
@@ -22149,10 +22210,12 @@
pop bc
ld de, AttrMap - TileMap
add hl, de
+rept 2
inc b
- inc b
+endr
+rept 2
inc c
- inc c
+endr
ld a, $7
.asm_16d630
push bc
@@ -22753,8 +22816,9 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
inc [hl]
.asm_170c15
+rept 2
inc hl
- inc hl
+endr
ld a, [$a89b]
add [hl]
ld [hld], a
@@ -24239,8 +24310,9 @@
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 @@
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 @@
.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 @@
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
--- a/misc/mobile_5f.asm
+++ b/misc/mobile_5f.asm
@@ -723,8 +723,9 @@
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 @@
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 @@
.asm_17d5ce
srl a
jr c, .asm_17d5d6
+rept 2
inc c
- inc c
+endr
jr .asm_17d5ce
.asm_17d5d6
@@ -1026,10 +1030,12 @@
ld [wcd4c], a
pop de
pop hl
+rept 2
inc b
- inc b
+endr
+rept 2
dec c
- dec c
+endr
jr z, .asm_17d684
push bc
push de
@@ -1075,15 +1081,17 @@
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 @@
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 @@
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 @@
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 @@
jr .asm_17df7b
.asm_17df79
+rept 2
inc hl
- inc hl
+endr
.asm_17df7b
bit 4, b
@@ -2461,8 +2473,9 @@
jr .asm_17dfd2
.asm_17dfd0
+rept 2
inc hl
- inc hl
+endr
.asm_17dfd2
bit 5, b
@@ -2587,8 +2600,9 @@
jr .asm_17e0a4
.asm_17e0a2
+rept 2
inc hl
- inc hl
+endr
.asm_17e0a4
bit 4, b
@@ -2604,8 +2618,9 @@
jr .asm_17e0b6
.asm_17e0b4
+rept 2
inc hl
- inc hl
+endr
.asm_17e0b6
bit 5, b
@@ -2627,8 +2642,9 @@
call CloseSRAM
pop hl
pop bc
+rept 2
inc hl
- inc hl
+endr
jr asm_17e0ee
.asm_17e0e1
@@ -2673,8 +2689,9 @@
call ReceiveItem
pop hl
jr c, .asm_17e127
+rept 2
inc hl
- inc hl
+endr
.asm_17e127
ld a, [hli]
@@ -2704,8 +2721,9 @@
callba MobileCheckOwnMonAnywhere
pop hl
jr c, .asm_17e159
+rept 2
inc hl
- inc hl
+endr
.asm_17e159
ld a, [hli]
@@ -2741,8 +2759,9 @@
call CheckItem
pop hl
jr c, .asm_17e195
+rept 2
inc hl
- inc hl
+endr
.asm_17e195
ld a, [hli]
@@ -3207,8 +3226,9 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
ld e, a
ld d, $0
pop hl
+rept 2
add hl, de
- add hl, de
+endr
+rept 3
inc hl
- inc hl
- inc hl
+endr
ld e, l
ld d, h
ld l, c
@@ -4451,8 +4483,9 @@
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 @@
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 @@
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 @@
jr .asm_17f67d
.asm_17f674
+rept 2
inc hl
- inc hl
+endr
dec c
jr nz, .asm_17f65d
@@ -4828,8 +4864,9 @@
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]
--- a/misc/unused_title.asm
+++ b/misc/unused_title.asm
@@ -10,9 +10,9 @@
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
--- a/predef/cgb.asm
+++ b/predef/cgb.asm
@@ -93,8 +93,9 @@
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
@@ -101,8 +102,9 @@
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 @@
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 @@
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 @@
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
--- a/predef/sgb.asm
+++ b/predef/sgb.asm
@@ -74,8 +74,9 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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]
--- a/rst.asm
+++ b/rst.asm
@@ -22,8 +22,9 @@
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
--- a/text/types.asm
+++ b/text/types.asm
@@ -85,8 +85,9 @@
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
--- a/tilesets/animations.asm
+++ b/tilesets/animations.asm
@@ -16,8 +16,9 @@
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 @@
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 @@
.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 @@
.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 @@
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 @@
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 @@
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 @@
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
--- a/trainers/dvs.asm
+++ b/trainers/dvs.asm
@@ -8,8 +8,9 @@
ld b, 0
ld hl, TrainerClassDVs
+rept 2
add hl, bc
- add hl, bc
+endr
ld a, [hli]
ld b, a