aboutsummaryrefslogtreecommitdiffstats
path: root/engine/battle
diff options
context:
space:
mode:
authorYamaArashi <shadow962@live.com>2015-02-08 00:17:03 -0800
committerYamaArashi <shadow962@live.com>2015-02-08 00:17:03 -0800
commit1347023128e141dc4cfc71ee6bc689f909e96919 (patch)
treee9b5e0db057f8e912f479f7421144091458b2456 /engine/battle
parentfixed hp bar wram label and misc (diff)
downloadpokeyellow-1347023128e141dc4cfc71ee6bc689f909e96919.tar.gz
pokeyellow-1347023128e141dc4cfc71ee6bc689f909e96919.tar.xz
pokeyellow-1347023128e141dc4cfc71ee6bc689f909e96919.zip
move-related things
Diffstat (limited to 'engine/battle')
-rwxr-xr-xengine/battle/core.asm8
-rwxr-xr-xengine/battle/e.asm41
2 files changed, 25 insertions, 24 deletions
diff --git a/engine/battle/core.asm b/engine/battle/core.asm
index d51abb43..5c25e5b0 100755
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -2533,14 +2533,14 @@ MoveSelectionMenu: ; 3d219 (f:5219)
jr .regularmenu
.loadmoves
- ld de, wd0dc
- ld bc, $4
+ ld de, wMoves
+ ld bc, NUM_MOVES
call CopyData
- callab Func_39b87
+ callab FormatMovesString
ret
.writemoves
- ld de, wd0e1
+ ld de, wMovesString
ld a, [hFlags_0xFFF6]
set 2, a
ld [hFlags_0xFFF6], a
diff --git a/engine/battle/e.asm b/engine/battle/e.asm
index 5592702a..d60718cc 100755
--- a/engine/battle/e.asm
+++ b/engine/battle/e.asm
@@ -577,14 +577,15 @@ TrainerPicAndMoneyPointers: ; 39914 (e:5914)
INCLUDE "text/trainer_names.asm"
-Func_39b87: ; 39b87 (e:5b87)
- ld hl, wd0dc
- ld de, wd0e1
+; formats a string at wMovesString that lists the moves at wMoves
+FormatMovesString: ; 39b87 (e:5b87)
+ ld hl, wMoves
+ ld de, wMovesString
ld b, $0
-.asm_39b8f
+.printMoveNameLoop
ld a, [hli]
- and a
- jr z, .asm_39bc1
+ and a ; end of move list?
+ jr z, .printDashLoop ; print dashes when no moves are left
push hl
ld [wd0b5], a
ld a, BANK(MoveNames)
@@ -593,38 +594,38 @@ Func_39b87: ; 39b87 (e:5b87)
ld [W_LISTTYPE], a
call GetName
ld hl, wcd6d
-.asm_39ba7
+.copyNameLoop
ld a, [hli]
cp $50
- jr z, .asm_39bb0
+ jr z, .doneCopyingName
ld [de], a
inc de
- jr .asm_39ba7
-.asm_39bb0
+ jr .copyNameLoop
+.doneCopyingName
ld a, b
ld [wcd6c], a
inc b
- ld a, $4e
+ ld a, $4e ; line break
ld [de], a
inc de
pop hl
ld a, b
- cp $4
- jr z, .asm_39bd1
- jr .asm_39b8f
-.asm_39bc1
+ cp NUM_MOVES
+ jr z, .done
+ jr .printMoveNameLoop
+.printDashLoop
ld a, "-"
ld [de], a
inc de
inc b
ld a, b
- cp $4
- jr z, .asm_39bd1
- ld a, $4e
+ cp NUM_MOVES
+ jr z, .done
+ ld a, $4e ; line break
ld [de], a
inc de
- jr .asm_39bc1
-.asm_39bd1
+ jr .printDashLoop
+.done
ld a, "@"
ld [de], a
ret