From 9772c722ac8fc6c41c5427ce7ca0d106a19db36e Mon Sep 17 00:00:00 2001 From: JimB16 Date: Sun, 23 Aug 2015 07:09:36 +0200 Subject: [PATCH] added comments and labels to BattleTower-Code --- data/battle_tower.asm | 12 ++++++++---- misc/mobile_45.asm | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/data/battle_tower.asm b/data/battle_tower.asm index 025807ac8..aea1df2dd 100644 --- a/data/battle_tower.asm +++ b/data/battle_tower.asm @@ -1,4 +1,4 @@ -Function1f8000: ; 1f8000 +Function_LoadOpponentTrainerAndPokemons: ; 1f8000 ld a, [rSVBK] push af ld a, $3 @@ -52,7 +52,7 @@ ENDC call AddNTimes ld bc, 11 call CopyBytes - call Function1f8081 + call Function_LoadRandomBattleTowerPkmn pop af ld hl, Unknown_1f0000 ld bc, $0024 @@ -73,14 +73,16 @@ ENDC ret ; 1f8081 -Function1f8081: ; 1f8081 - ld c, $3 +Function_LoadRandomBattleTowerPkmn: ; 1f8081 + ld c, $3 .loop push bc ld a, BANK(sbe51) call GetSRAMBank .asm_1f8089 + ; From Which LevelGroup are the Pkmn loaded + ; a = 1..10 ld a, [$d800] dec a ld hl, BattleTowerMons @@ -97,7 +99,9 @@ Function1f8081: ; 1f8081 and $1f cp (BattleTowerMons2 - BattleTowerMons1) / ($3b) jr nc, .asm_1f8099 + ; in register 'a' is the chosen Pkmn of the LevelGroup + ; Check if Pkmn was already loaded before ld bc, $3b call AddNTimes ld a, [hli] diff --git a/misc/mobile_45.asm b/misc/mobile_45.asm index fe4729b9c..35fe8287d 100644 --- a/misc/mobile_45.asm +++ b/misc/mobile_45.asm @@ -24179,7 +24179,7 @@ Function170b16: ; 170b16 (5c:4b16) ret Function170b44: ; 170b44 - callba Function1f8000 + callba Function_LoadOpponentTrainerAndPokemons ld a, [rSVBK] push af ld a, $3