More splitting of main.asm; remove unneeded rept 2

This commit is contained in:
pikalaxalt
2016-05-04 11:46:23 -04:00
parent 82f1534925
commit 3713b71d9e
107 changed files with 1222 additions and 1610 deletions

View File

@@ -200,13 +200,11 @@ endr
.PrintNthText: ; 8b2a9
push bc
call .GetTextPointers
rept 2
inc hl
endr
inc hl
ld b, $0
rept 2
add hl, bc
endr
add hl, bc
call .LoadTextPointer
call PrintText
pop bc

View File

@@ -322,9 +322,8 @@ Buena_getprize: ; 8b154
ld hl, .prizes
ld b, 0
ld c, a
rept 2
add hl, bc
endr
add hl, bc
ret
; 8b15e

View File

@@ -13,9 +13,8 @@ Special_SelectRandomBugContestContestants: ; 139a8
ld b, RESET_FLAG
call EventFlagAction
pop hl
rept 2
inc hl
endr
inc hl
pop bc
dec c
jr nz, .loop1
@@ -34,9 +33,8 @@ endr
ld e, b
ld d, 0
ld hl, BugCatchingContestantEventFlagTable
rept 2
add hl, de
endr
add hl, de
ld e, [hl]
inc hl
ld d, [hl]
@@ -66,9 +64,8 @@ Special_CheckBugContestContestantFlag: ; 139ed
ld hl, BugCatchingContestantEventFlagTable
ld e, a
ld d, 0
rept 2
add hl, de
endr
add hl, de
ld e, [hl]
inc hl
ld d, [hl]

View File

@@ -85,9 +85,8 @@ LoadContestantName: ; 13730
ld c, a
ld b, 0
ld hl, BugContestantPointers
rept 2
add hl, bc
endr
add hl, bc
ld a, [hli]
ld h, [hl]
ld l, a
@@ -320,23 +319,20 @@ ComputeAIContestantScores: ; 138b0
pop de
jr nz, .done
ld a, e
rept 2
inc a
endr
inc a
ld [wBugContestTempPersonID], a
dec a
ld c, a
ld b, 0
ld hl, BugContestantPointers
rept 2
add hl, bc
endr
add hl, bc
ld a, [hli]
ld h, [hl]
ld l, a
rept 2
inc hl
endr
inc hl
.loop2
call Random
and 3
@@ -412,9 +408,8 @@ ContestScore: ; 13900
ld a, [wContestMonDVs + 0]
ld b, a
and 2
rept 2
add a
endr
add a
ld c, a
swap b
@@ -433,12 +428,10 @@ endr
ld a, b
and 2
srl a
rept 2
add c
endr
rept 2
add c
add d
add d
endr
call .AddContestStat

View File

@@ -259,9 +259,8 @@ CelebiEvent_Cosine: ; 49b3b (12:5b3b)
ld a, d
ld d, $0
ld hl, .sinewave
rept 2
add hl, de
endr
add hl, de
ld e, [hl]
inc hl
ld d, [hl]

View File

@@ -37,9 +37,8 @@ SpecialDratini: ; 0x8b170
; get address of mon's first move
pop de
rept 2
inc de
endr
inc de
.GiveMoves:
ld a, [hl]

View File

@@ -70,9 +70,8 @@ Elevator:: ; 1342d
call GetFarByte
cp -1
jr z, .fail
rept 2
inc hl
endr
inc hl
ld a, [wElevatorPointerBank]
call GetFarByte
inc hl
@@ -222,9 +221,8 @@ FloorToString: ; 13575
ld e, a
ld d, 0
ld hl, .floors
rept 2
add hl, de
endr
add hl, de
ld a, [hli]
ld h, [hl]
ld l, a

View File

@@ -164,9 +164,8 @@ OWCutJumptable: ; 8ca0c
ld e, a
ld d, 0
ld hl, .dw
rept 2
add hl, de
endr
add hl, de
ld a, [hli]
ld h, [hl]
ld l, a
@@ -192,9 +191,8 @@ Cut_SpawnAnimateTree: ; 8ca23 (23:4a23)
ld [wcf64], a
; Cut_StartWaiting
ld hl, wJumptableIndex
rept 2
inc [hl]
endr
inc [hl]
ret
Cut_SpawnAnimateLeaves: ; 8ca3c (23:4a3c)
@@ -269,9 +267,8 @@ Cut_GetLeafSpawnCoords: ; 8ca8e (23:4a8e)
add e
ld e, a
ld hl, .Coords
rept 2
add hl, de
endr
add hl, de
ld e, [hl]
inc hl
ld d, [hl]

View File

@@ -235,9 +235,8 @@ AnimateHOFMonEntrance: ; 865b5
ld a, [hli]
ld [TempMonSpecies], a
ld [CurPartySpecies], a
rept 2
inc hl
endr
inc hl
ld a, [hli]
ld [TempMonDVs], a
ld a, [hli]
@@ -298,9 +297,8 @@ HOF_SlideFrontpic:
ld a, [hSCX]
and a
ret z
rept 2
dec a
endr
dec a
ld [hSCX], a
call DelayFrame
jr .frontpicloop

View File

@@ -362,9 +362,8 @@ Kurt_GetAddressOfApricornQuantity: ; 88201
inc hl
ld c, a
ld b, $0
rept 2
add hl, bc
endr
add hl, bc
inc hl
ld a, [hl]
pop bc
@@ -379,9 +378,8 @@ Kurt_GetRidOfItem: ; 88211
ld c, a
ld b, $0
inc hl
rept 2
add hl, bc
endr
add hl, bc
ld a, [CurItem]
ld c, a
ld a, [hli]

View File

@@ -250,9 +250,8 @@ CalcMagikarpLength: ; fbbfc
; hl = de × 10
ld h, d
ld l, e
rept 2
add hl, hl
endr
add hl, hl
add hl, de
add hl, hl

View File

@@ -101,9 +101,8 @@ MagnetTrain_UpdateLYOverrides: ; 8cc99
ld d, a
ld hl, wcf64
ld a, [hl]
rept 2
add d
endr
add d
ld [hl], a
ret
@@ -211,9 +210,8 @@ GetMagnetTrainBGTiles: ; 8cd74
ld e, a
ld d, 0
ld hl, MagnetTrainBGTiles
rept 2
add hl, de
endr
add hl, de
ld e, [hl]
inc hl
ld d, [hl]
@@ -296,9 +294,8 @@ MagnetTrain_Jumptable: ; 8cdf7
ld e, a
ld d, 0
ld hl, .Jumptable
rept 2
add hl, de
endr
add hl, de
ld a, [hli]
ld h, [hl]
ld l, a
@@ -398,17 +395,15 @@ endr
inc a
ld d, a
ld a, e
rept 2
add d
endr
add d
ld [wcf65], a
ld hl, wGlobalAnimXOffset
ld a, [wMagnetTrainDirection]
ld d, a
ld a, [hl]
rept 2
add d
endr
add d
ld [hl], a
ret

View File

@@ -23,9 +23,8 @@ Special_BankOfMom: ; 16218
ld e, a
ld d, 0
ld hl, .dw
rept 2
add hl, de
endr
add hl, de
ld a, [hli]
ld h, [hl]
ld l, a
@@ -143,9 +142,8 @@ endr
call PrintText
xor a
ld hl, StringBuffer2
rept 2
ld [hli], a
endr
ld [hli], a
ld [hl], a
ld a, $5
ld [wcf64], a
@@ -211,9 +209,8 @@ endr
call PrintText
xor a
ld hl, StringBuffer2
rept 2
ld [hli], a
endr
ld [hli], a
ld [hl], a
ld a, $5
ld [wcf64], a

View File

@@ -298,9 +298,8 @@ PrintSeerText: ; 4f26d
ld e, a
ld d, 0
ld hl, SeerTexts
rept 2
add hl, de
endr
add hl, de
ld a, [hli]
ld h, [hl]
ld l, a