diff options
author | PikalaxALT <PikalaxALT@gmail.com> | 2015-07-20 11:28:05 -0400 |
---|---|---|
committer | PikalaxALT <PikalaxALT@gmail.com> | 2015-07-20 11:28:05 -0400 |
commit | d9300a9becc9aa699b7191f87d8b493a93139ba2 (patch) | |
tree | 14f742415c8976596a8d79a6dcdaa040e6b34083 /engine | |
parent | bef792f2d21ccac0127aeffd9e0838aba81f44b6 (diff) |
Fix unnecessary white space and retire add_n_times
Diffstat (limited to 'engine')
-rw-r--r-- | engine/color.asm | 12 | ||||
-rw-r--r-- | engine/events.asm | 8 | ||||
-rw-r--r-- | engine/map_objects.asm | 12 | ||||
-rw-r--r-- | engine/predef.asm | 212 | ||||
-rw-r--r-- | engine/scripting.asm | 4 | ||||
-rw-r--r-- | engine/spawn_points.asm | 4 | ||||
-rw-r--r-- | engine/specials.asm | 4 |
7 files changed, 140 insertions, 116 deletions
diff --git a/engine/color.asm b/engine/color.asm index e922b8849..2ce0d6a4f 100644 --- a/engine/color.asm +++ b/engine/color.asm @@ -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] diff --git a/engine/events.asm b/engine/events.asm index 1b85c7f7c..e63d24b4f 100644 --- a/engine/events.asm +++ b/engine/events.asm @@ -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] diff --git a/engine/map_objects.asm b/engine/map_objects.asm index e9e2d9e5f..a5749c277 100644 --- a/engine/map_objects.asm +++ b/engine/map_objects.asm @@ -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] diff --git a/engine/predef.asm b/engine/predef.asm index f7e00e60f..7ff07e0d4 100644 --- a/engine/predef.asm +++ b/engine/predef.asm @@ -1,106 +1,108 @@ -GetPredefPointer:: ; 854b
-; Return the bank and address of PredefID in a and PredefAddress.
-
-; Save hl for later (back in Predef)
- ld a, h
- ld [PredefTemp], a
- ld a, l
- ld [PredefTemp + 1], a
-
- push de
- ld a, [PredefID]
- ld e, a
- ld d, 0
- ld hl, PredefPointers
- add_n_times hl, de, 3
- pop de
-
- ld a, [hli]
- ld [PredefAddress + 1], a
- ld a, [hli]
- ld [PredefAddress], a
- ld a, [hl]
-
- ret
-; 856b
-
-PredefPointers:: ; 856b
-; $4b Predef pointers
-; address, bank
-
- add_predef LearnMove ; $0
- add_predef Predef1
- add_predef HealParty
- add_predef FlagPredef
- add_predef Functionc699
- add_predef FillPP
- add_predef Functiond88c
- add_predef Functionda96
- add_predef Functiondb3f ; $8
- add_predef Functionde6e
- add_predef GiveEgg
- add_predef Functionc6e0
- add_predef Functione167
- add_predef Functione17b
- add_predef CanLearnTMHMMove
- add_predef GetTMHMMove
- add_predef Function28eef ; $ 10
- add_predef PrintMoveDesc
- add_predef UpdatePlayerHUD
- add_predef FillBox
- add_predef Function3d873
- add_predef UpdateEnemyHUD
- add_predef StartBattle
- add_predef FillInExpBar
- add_predef Function3f43d ; $18
- add_predef Function3f47c
- add_predef LearnLevelMoves
- add_predef FillMoves
- add_predef Function421e6
- add_predef Function28f63
- add_predef Function28f24
- add_predef Function5084a
- add_predef ListMoves ; $20
- add_predef Function50d2e
- add_predef Function50cdb
- add_predef Function50c50
- add_predef GetGender
- add_predef StatsScreenInit
- add_predef DrawPlayerHP
- add_predef DrawEnemyHP
- add_predef PrintTempMonStats ; $28
- add_predef GetTypeName
- add_predef PrintMoveType
- add_predef PrintType
- add_predef PrintMonTypes
- add_predef GetUnownLetter
- add_predef Functioncbcdd
- add_predef Predef2F
- add_predef Function9853 ; $30
- add_predef Function864c
- add_predef Function91d11
- add_predef CheckContestMon
- add_predef Function8c20f
- add_predef Function8c000
- add_predef Function8c000_2
- add_predef PlayBattleAnim
- add_predef Predef38 ; $38
- add_predef Predef39
- add_predef Functionfd1d0
- add_predef PartyMonItemName
- add_predef GetFrontpic
- add_predef GetBackpic
- add_predef Function5108b
- add_predef GetTrainerPic
- add_predef DecompressPredef ; $40
- add_predef Function347d3
- add_predef ConvertMon_1to2
- add_predef Functionfb877
- add_predef Functiond0000
- add_predef Function50d0a
- add_predef Functiond00a3
- add_predef Functiond008e
- add_predef Functiond0669 ; $48
- add_predef Functiond066e
- dbw $ff, Function2d43 ; ????
+GetPredefPointer:: ; 854b +; Return the bank and address of PredefID in a and PredefAddress. + +; Save hl for later (back in Predef) + ld a, h + ld [PredefTemp], a + ld a, l + ld [PredefTemp + 1], a + + push de + ld a, [PredefID] + ld e, a + ld d, 0 + ld hl, PredefPointers +rept 3 + add hl,de +endr + pop de + + ld a, [hli] + ld [PredefAddress + 1], a + ld a, [hli] + ld [PredefAddress], a + ld a, [hl] + + ret +; 856b + +PredefPointers:: ; 856b +; $4b Predef pointers +; address, bank + + add_predef LearnMove ; $0 + add_predef Predef1 + add_predef HealParty + add_predef FlagPredef + add_predef Functionc699 + add_predef FillPP + add_predef Functiond88c + add_predef Functionda96 + add_predef Functiondb3f ; $8 + add_predef Functionde6e + add_predef GiveEgg + add_predef Functionc6e0 + add_predef Functione167 + add_predef Functione17b + add_predef CanLearnTMHMMove + add_predef GetTMHMMove + add_predef Function28eef ; $ 10 + add_predef PrintMoveDesc + add_predef UpdatePlayerHUD + add_predef FillBox + add_predef Function3d873 + add_predef UpdateEnemyHUD + add_predef StartBattle + add_predef FillInExpBar + add_predef Function3f43d ; $18 + add_predef Function3f47c + add_predef LearnLevelMoves + add_predef FillMoves + add_predef Function421e6 + add_predef Function28f63 + add_predef Function28f24 + add_predef Function5084a + add_predef ListMoves ; $20 + add_predef Function50d2e + add_predef Function50cdb + add_predef Function50c50 + add_predef GetGender + add_predef StatsScreenInit + add_predef DrawPlayerHP + add_predef DrawEnemyHP + add_predef PrintTempMonStats ; $28 + add_predef GetTypeName + add_predef PrintMoveType + add_predef PrintType + add_predef PrintMonTypes + add_predef GetUnownLetter + add_predef Functioncbcdd + add_predef Predef2F + add_predef Function9853 ; $30 + add_predef Function864c + add_predef Function91d11 + add_predef CheckContestMon + add_predef Function8c20f + add_predef Function8c000 + add_predef Function8c000_2 + add_predef PlayBattleAnim + add_predef Predef38 ; $38 + add_predef Predef39 + add_predef Functionfd1d0 + add_predef PartyMonItemName + add_predef GetFrontpic + add_predef GetBackpic + add_predef Function5108b + add_predef GetTrainerPic + add_predef DecompressPredef ; $40 + add_predef Function347d3 + add_predef ConvertMon_1to2 + add_predef Functionfb877 + add_predef Functiond0000 + add_predef Function50d0a + add_predef Functiond00a3 + add_predef Functiond008e + add_predef Functiond0669 ; $48 + add_predef Functiond066e + dbw $ff, Function2d43 ; ???? ; 864c
\ No newline at end of file diff --git a/engine/scripting.asm b/engine/scripting.asm index 9cec631ab..5185518e4 100644 --- a/engine/scripting.asm +++ b/engine/scripting.asm @@ -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 " " diff --git a/engine/spawn_points.asm b/engine/spawn_points.asm index 09c66fa54..eb42ab0d1 100644 --- a/engine/spawn_points.asm +++ b/engine/spawn_points.asm @@ -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] diff --git a/engine/specials.asm b/engine/specials.asm index ea3a5a601..e0cb79520 100644 --- a/engine/specials.asm +++ b/engine/specials.asm @@ -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] |