move-related things

This commit is contained in:
YamaArashi 2015-02-08 00:17:03 -08:00
parent 72bbaed99f
commit 1347023128
10 changed files with 58 additions and 50 deletions

View file

@ -2533,14 +2533,14 @@ MoveSelectionMenu: ; 3d219 (f:5219)
jr .regularmenu jr .regularmenu
.loadmoves .loadmoves
ld de, wd0dc ld de, wMoves
ld bc, $4 ld bc, NUM_MOVES
call CopyData call CopyData
callab Func_39b87 callab FormatMovesString
ret ret
.writemoves .writemoves
ld de, wd0e1 ld de, wMovesString
ld a, [hFlags_0xFFF6] ld a, [hFlags_0xFFF6]
set 2, a set 2, a
ld [hFlags_0xFFF6], a ld [hFlags_0xFFF6], a

View file

@ -577,14 +577,15 @@ TrainerPicAndMoneyPointers: ; 39914 (e:5914)
INCLUDE "text/trainer_names.asm" INCLUDE "text/trainer_names.asm"
Func_39b87: ; 39b87 (e:5b87) ; formats a string at wMovesString that lists the moves at wMoves
ld hl, wd0dc FormatMovesString: ; 39b87 (e:5b87)
ld de, wd0e1 ld hl, wMoves
ld de, wMovesString
ld b, $0 ld b, $0
.asm_39b8f .printMoveNameLoop
ld a, [hli] ld a, [hli]
and a and a ; end of move list?
jr z, .asm_39bc1 jr z, .printDashLoop ; print dashes when no moves are left
push hl push hl
ld [wd0b5], a ld [wd0b5], a
ld a, BANK(MoveNames) ld a, BANK(MoveNames)
@ -593,38 +594,38 @@ Func_39b87: ; 39b87 (e:5b87)
ld [W_LISTTYPE], a ld [W_LISTTYPE], a
call GetName call GetName
ld hl, wcd6d ld hl, wcd6d
.asm_39ba7 .copyNameLoop
ld a, [hli] ld a, [hli]
cp $50 cp $50
jr z, .asm_39bb0 jr z, .doneCopyingName
ld [de], a ld [de], a
inc de inc de
jr .asm_39ba7 jr .copyNameLoop
.asm_39bb0 .doneCopyingName
ld a, b ld a, b
ld [wcd6c], a ld [wcd6c], a
inc b inc b
ld a, $4e ld a, $4e ; line break
ld [de], a ld [de], a
inc de inc de
pop hl pop hl
ld a, b ld a, b
cp $4 cp NUM_MOVES
jr z, .asm_39bd1 jr z, .done
jr .asm_39b8f jr .printMoveNameLoop
.asm_39bc1 .printDashLoop
ld a, "-" ld a, "-"
ld [de], a ld [de], a
inc de inc de
inc b inc b
ld a, b ld a, b
cp $4 cp NUM_MOVES
jr z, .asm_39bd1 jr z, .done
ld a, $4e ld a, $4e ; line break
ld [de], a ld [de], a
inc de inc de
jr .asm_39bc1 jr .printDashLoop
.asm_39bd1 .done
ld a, "@" ld a, "@"
ld [de], a ld [de], a
ret ret

View file

@ -364,7 +364,7 @@ LearnMoveFromLevelUp: ; 3af5b (e:6f5b)
dec b dec b
jr nz, .checkCurrentMovesLoop jr nz, .checkCurrentMovesLoop
ld a, d ld a, d
ld [wd0e0], a ld [wMoveNum], a
ld [wd11e], a ld [wd11e], a
call GetMoveName call GetMoveName
call CopyStringToCF4B call CopyStringToCF4B

View file

@ -2084,7 +2084,7 @@ ItemUseTMHM: ; e479 (3:6479)
ld [wd11e],a ld [wd11e],a
predef TMToMove ; get move ID from TM/HM ID predef TMToMove ; get move ID from TM/HM ID
ld a,[wd11e] ld a,[wd11e]
ld [wd0e0],a ld [wMoveNum],a
call GetMoveName call GetMoveName
call CopyStringToCF4B ; copy name to wcf4b call CopyStringToCF4B ; copy name to wcf4b
pop af pop af

View file

@ -1,12 +1,12 @@
; checks if the mon in wWhichPokemon already knows the move in wd0e0 ; checks if the mon in [wWhichPokemon] already knows the move in [wMoveNum]
CheckIfMoveIsKnown: ; 2fe18 (b:7e18) CheckIfMoveIsKnown: ; 2fe18 (b:7e18)
ld a, [wWhichPokemon] ld a, [wWhichPokemon]
ld hl, wPartyMon1Moves ld hl, wPartyMon1Moves
ld bc, $2c ld bc, wPartyMon2 - wPartyMon1
call AddNTimes call AddNTimes
ld a, [wd0e0] ld a, [wMoveNum]
ld b, a ld b, a
ld c, $4 ; nubmer of moves ld c, NUM_MOVES
.loop .loop
ld a, [hli] ld a, [hli]
cp b cp b

View file

@ -1,11 +1,11 @@
; tests if mon [wcf91] can learn move [wd0e0] ; tests if mon [wcf91] can learn move [wMoveNum]
CanLearnTM: ; 1373e (4:773e) CanLearnTM: ; 1373e (4:773e)
ld a, [wcf91] ld a, [wcf91]
ld [wd0b5], a ld [wd0b5], a
call GetMonHeader call GetMonHeader
ld hl, W_MONHLEARNSET ld hl, W_MONHLEARNSET
push hl push hl
ld a, [wd0e0] ld a, [wMoveNum]
ld b, a ld b, a
ld c, $0 ld c, $0
ld hl, TechnicalMachines ld hl, TechnicalMachines

View file

@ -36,7 +36,7 @@ DontAbandonLearning: ; 6e5b (1:6e5b)
pop de pop de
pop hl pop hl
.asm_6e8b .asm_6e8b
ld a, [wd0e0] ld a, [wMoveNum]
ld [hl], a ld [hl], a
ld bc, $15 ld bc, $15
add hl, bc add hl, bc
@ -64,7 +64,7 @@ DontAbandonLearning: ; 6e5b (1:6e5b)
ld h, d ld h, d
ld l, e ld l, e
ld de, wBattleMonMoves ld de, wBattleMonMoves
ld bc, $4 ld bc, NUM_MOVES
call CopyData call CopyData
ld bc, $11 ld bc, $11
add hl, bc add hl, bc
@ -111,10 +111,10 @@ TryingToLearn: ; 6f07 (1:6f07)
ld bc, $fffc ld bc, $fffc
add hl, bc add hl, bc
push hl push hl
ld de, wd0dc ld de, wMoves
ld bc, $4 ld bc, NUM_MOVES
call CopyData call CopyData
callab Func_39b87 callab FormatMovesString
pop hl pop hl
.asm_6f39 .asm_6f39
push hl push hl
@ -125,7 +125,7 @@ TryingToLearn: ; 6f07 (1:6f07)
ld c, $e ld c, $e
call TextBoxBorder call TextBoxBorder
hlCoord 6, 8 hlCoord 6, 8
ld de, wd0e1 ld de, wMovesString
ld a, [hFlags_0xFFF6] ld a, [hFlags_0xFFF6]
set 2, a set 2, a
ld [hFlags_0xFFF6], a ld [hFlags_0xFFF6], a

View file

@ -233,13 +233,13 @@ StatusScreen2: ; 12b57 (4:6b57)
ld [hTilesetType], a ld [hTilesetType], a
ld [$ffba], a ld [$ffba], a
ld bc, $0005 ld bc, $0005
ld hl, wd0dc ld hl, wMoves
call FillMemory call FillMemory
ld hl, wLoadedMonMoves ld hl, wLoadedMonMoves
ld de, wd0dc ld de, wMoves
ld bc, $0004 ld bc, NUM_MOVES
call CopyData call CopyData
callab Func_39b87 callab FormatMovesString
hlCoord 9, 2 hlCoord 9, 2
ld bc, $050a ld bc, $050a
call ClearScreenArea ; Clear under name call ClearScreenArea ; Clear under name
@ -250,7 +250,7 @@ StatusScreen2: ; 12b57 (4:6b57)
ld c, $12 ld c, $12
call TextBoxBorder ; Draw move container call TextBoxBorder ; Draw move container
hlCoord 2, 9 hlCoord 2, 9
ld de, wd0e1 ld de, wMovesString
call PlaceString ; Print moves call PlaceString ; Print moves
ld a, [wcd6c] ld a, [wcd6c]
inc a inc a

View file

@ -259,8 +259,8 @@ LoadMonData:: ; 1372 (0:1372)
Func_137a:: ; 137a (0:137a) Func_137a:: ; 137a (0:137a)
; Write c to [wd0dc + b]. Unused. ; Write c to [wMoves + b]. Unused.
ld hl, wd0dc ld hl, wMoves
ld e, b ld e, b
ld d, 0 ld d, 0
add hl, de add hl, de
@ -546,7 +546,7 @@ PrintLevelCommon:: ; 1523 (0:1523)
Func_152e:: ; 152e (0:152e) Func_152e:: ; 152e (0:152e)
; Unused. ; Unused.
ld hl,wd0dc ld hl,wMoves
ld c,a ld c,a
ld b,0 ld b,0
add hl,bc add hl,bc

View file

@ -1275,10 +1275,17 @@ ds 2
wRepelRemainingSteps:: ; wd0db wRepelRemainingSteps:: ; wd0db
ds 1 ds 1
wd0dc:: ds 4 wMoves:: ; wd0dc
wd0e0:: ds 1 ; list of moves for FormatMovesString
wd0e1:: ds 56 ds 4
wMoveNum:: ; d0e0
ds 1
wMovesString:: ; d0e1
ds 56
wd119:: ds 1 wd119:: ds 1
wWalkBikeSurfStateCopy:: ; d11a wWalkBikeSurfStateCopy:: ; d11a