Fix unnecessary white space and retire add_n_times

This commit is contained in:
PikalaxALT 2015-07-20 11:28:05 -04:00
parent bef792f2d2
commit d9300a9bec
14 changed files with 997 additions and 600 deletions

View File

@ -12,7 +12,9 @@ FishAction: ; 92402
call GetFishGroupHeader
ld hl, FishGroupHeaders
add_n_times hl, de, 7
rept 7
add hl, de
endr
call Fish
@ -42,7 +44,9 @@ Fish: ; 9241a
inc hl
ld e, b
ld d, 0
add_n_times hl, de, 2
rept 2
add hl, de
endr
ld a, [hli]
ld h, [hl]
ld l, a
@ -85,10 +89,9 @@ Fish: ; 9241a
ld e, [hl]
ld d, 0
ld hl, TimeFishGroups
rept 4
add hl, de
add hl, de
add hl, de
add hl, de
endr
; One nightmon, then one daymon
ld a, [TimeOfDay]

View File

@ -806,7 +806,9 @@ Function9764: ; 9764
Function976b: ; 976b
ld l, a
ld h, 0
add_n_times hl, hl, 2
rept 2
add hl,hl
endr
ld bc, TrainerPalettes
add hl, bc
ret
@ -1974,7 +1976,9 @@ Functionb1de: ; b1de
push hl
ld l, a
ld h, 0
add_n_times hl, hl, 3
rept 3
add hl,hl
endr
ld de, TilesetBGPalette
add hl, de
ld e, l
@ -2014,7 +2018,9 @@ Functionb1de: ; b1de
ld a, [MapGroup]
ld l, a
ld h, 0
add_n_times hl, hl, 3
rept 3
add hl,hl
endr
ld de, RoofPals
add hl, de
ld a, [TimeOfDayPal]

View File

@ -472,7 +472,9 @@ Function968ec: ; 968ec
ld a, [hli]
ld h, [hl]
ld l, a
add_n_times hl, de, 4
rept 4
add hl,de
endr
call GetMapScriptHeaderBank
call GetFarHalfword
@ -1043,7 +1045,9 @@ Function96beb: ; 96beb
ld c, a
ld b, 0
ld hl, ScriptPointers96c0c
add_n_times hl, bc, 3
rept 3
add hl,bc
endr
ld a, [hli]
ld [ScriptBank], a
ld a, [hli]

View File

@ -226,7 +226,9 @@ Function444d: ; 444d
ld a, [hl]
ld l, a
ld h, 0
add_n_times hl, hl, 2
rept 2
add hl,hl
endr
add hl, de
ld a, [hli]
ld h, [hl]
@ -1385,7 +1387,9 @@ Function4a46: ; 4a46
ld e, a
ld d, 0
ld hl, .data_4a81
add_n_times hl, de, 2
rept 2
add hl,de
endr
ld d, [hl]
inc hl
ld e, [hl]
@ -3655,7 +3659,9 @@ Function5ac2: ; 5ac2
ld c, a
ld b, 0
ld hl, .Addresses
add_n_times hl, bc, 2
rept 2
add hl,bc
endr
ld c, [hl]
inc hl
ld b, [hl]

View File

@ -12,7 +12,9 @@ GetPredefPointer:: ; 854b
ld e, a
ld d, 0
ld hl, PredefPointers
add_n_times hl, de, 3
rept 3
add hl,de
endr
pop de
ld a, [hli]

View File

@ -3144,7 +3144,9 @@ ExitScriptSubroutine: ; 0x97b9a
ld e, [hl]
ld d, $0
ld hl, wd43d
add_n_times hl, de, 3
rept 3
add hl,de
endr
ld a, [hli]
ld b, a
and " "

View File

@ -56,7 +56,9 @@ LoadSpawnPoint: ; 1531f
jr z, .spawn_n_a
ld l, a
ld h, 0
add_n_times hl, hl, 2 ; multiply hl by 4
rept 2 ; multiply hl by 4
add hl,hl
endr
ld de, SpawnPoints
add hl, de
ld a, [hli]

View File

@ -2,7 +2,9 @@
Special:: ; c01b
; Run script special de.
ld hl, SpecialsPointers
add_n_times hl, de, 3
rept 3
add hl,de
endr
ld b, [hl]
inc hl
ld a, [hli]

View File

@ -872,7 +872,9 @@ GetName:: ; 33c3
ld e, a
ld d, 0
ld hl, NamesPointers
add_n_times hl, de, 3
rept 3
add hl, de
endr
ld a, [hli]
rst Bankswitch
ld a, [hli]

View File

@ -150,7 +150,9 @@ Function2198:: ; 2198
add a
ld l, a
ld h, 0
add_n_times hl, hl, 3
rept 3
add hl,hl
endr
ld a, [TilesetBlocksAddress]
add l
ld l, a
@ -1703,7 +1705,9 @@ GetFacingTileCoord:: ; 2a07
srl a
ld l, a
ld h, 0
add_n_times hl, hl, 2
rept 2
add hl,hl
endr
ld de, .Directions
add hl, de
@ -1745,7 +1749,9 @@ Function2a3c:: ; 2a3c
jr z, .nope
ld l, a
ld h, $0
add_n_times hl, hl, 2
rept 2
add hl,hl
endr
ld a, [TilesetCollisionAddress]
ld c, a
ld a, [TilesetCollisionAddress + 1]

View File

@ -493,7 +493,9 @@ Function1a2f:: ; 1a2f
ld hl, ObjectStruct3_Data
ld e, a
ld d, 0
add_n_times hl, de, OBJECT_STRUCT_3_DATA_WIDTH
rept OBJECT_STRUCT_3_DATA_WIDTH
add hl,de
endr
ld a, [hl]
ret
; 1a47
@ -504,7 +506,9 @@ Function1a47:: ; 1a47
ld e, a
ld d, 0
ld hl, ObjectStruct3_Data + 1
add_n_times hl, de, OBJECT_STRUCT_3_DATA_WIDTH
rept OBJECT_STRUCT_3_DATA_WIDTH
add hl,de
endr
ld a, BANK(ObjectStruct3_Data)
call GetFarByte
add a
@ -542,7 +546,9 @@ Function1a71:: ; 1a71
ld e, a
ld d, 0
ld hl, ObjectStruct3_Data + 1
add_n_times hl, de, OBJECT_STRUCT_3_DATA_WIDTH
rept OBJECT_STRUCT_3_DATA_WIDTH
add hl,de
endr
ld b, h
ld c, l
pop de

View File

@ -142,9 +142,3 @@ bcd: MACRO
shift
endr
ENDM
add_n_times: MACRO
rept \3
add \1, \2
endr
ENDM

724
main.asm

File diff suppressed because it is too large Load Diff