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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -56,7 +56,9 @@ LoadSpawnPoint: ; 1531f
jr z, .spawn_n_a jr z, .spawn_n_a
ld l, a ld l, a
ld h, 0 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 ld de, SpawnPoints
add hl, de add hl, de
ld a, [hli] ld a, [hli]

View File

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

View File

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

View File

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

View File

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

View File

@ -142,9 +142,3 @@ bcd: MACRO
shift shift
endr endr
ENDM 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