2015-04-01 15:27:51 +00:00
|
|
|
; formats a string at wMovesString that lists the moves at wMoves
|
2016-06-12 00:24:04 +00:00
|
|
|
FormatMovesString:
|
2015-04-01 15:27:51 +00:00
|
|
|
ld hl, wMoves
|
|
|
|
ld de, wMovesString
|
|
|
|
ld b, $0
|
|
|
|
.printMoveNameLoop
|
|
|
|
ld a, [hli]
|
|
|
|
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)
|
|
|
|
ld [wPredefBank], a
|
|
|
|
ld a, MOVE_NAME
|
|
|
|
ld [wNameListType], a
|
|
|
|
call GetName
|
|
|
|
ld hl, wcd6d
|
|
|
|
.copyNameLoop
|
|
|
|
ld a, [hli]
|
|
|
|
cp $50
|
|
|
|
jr z, .doneCopyingName
|
|
|
|
ld [de], a
|
|
|
|
inc de
|
|
|
|
jr .copyNameLoop
|
|
|
|
.doneCopyingName
|
|
|
|
ld a, b
|
2015-07-15 06:16:06 +00:00
|
|
|
ld [wNumMovesMinusOne], a
|
2015-04-01 15:27:51 +00:00
|
|
|
inc b
|
|
|
|
ld a, $4e ; line break
|
|
|
|
ld [de], a
|
|
|
|
inc de
|
|
|
|
pop hl
|
|
|
|
ld a, b
|
|
|
|
cp NUM_MOVES
|
|
|
|
jr z, .done
|
|
|
|
jr .printMoveNameLoop
|
|
|
|
.printDashLoop
|
|
|
|
ld a, "-"
|
|
|
|
ld [de], a
|
|
|
|
inc de
|
|
|
|
inc b
|
|
|
|
ld a, b
|
|
|
|
cp NUM_MOVES
|
|
|
|
jr z, .done
|
|
|
|
ld a, $4e ; line break
|
|
|
|
ld [de], a
|
|
|
|
inc de
|
|
|
|
jr .printDashLoop
|
|
|
|
.done
|
|
|
|
ld a, "@"
|
|
|
|
ld [de], a
|
|
|
|
ret
|
|
|
|
|
|
|
|
; XXX this is called in a few places, but it doesn't appear to do anything useful
|
2016-06-12 00:24:04 +00:00
|
|
|
InitList:
|
2015-07-13 06:00:48 +00:00
|
|
|
ld a, [wInitListType]
|
|
|
|
cp INIT_ENEMYOT_LIST
|
2015-07-03 19:37:53 +00:00
|
|
|
jr nz, .notEnemy
|
2015-04-01 15:27:51 +00:00
|
|
|
ld hl, wEnemyPartyCount
|
|
|
|
ld de, wEnemyMonOT
|
|
|
|
ld a, ENEMYOT_NAME
|
2015-07-03 19:37:53 +00:00
|
|
|
jr .done
|
|
|
|
.notEnemy
|
2015-07-13 06:00:48 +00:00
|
|
|
cp INIT_PLAYEROT_LIST
|
2015-07-03 19:37:53 +00:00
|
|
|
jr nz, .notPlayer
|
2015-04-01 15:27:51 +00:00
|
|
|
ld hl, wPartyCount
|
|
|
|
ld de, wPartyMonOT
|
|
|
|
ld a, PLAYEROT_NAME
|
2015-07-03 19:37:53 +00:00
|
|
|
jr .done
|
|
|
|
.notPlayer
|
2015-07-13 06:00:48 +00:00
|
|
|
cp INIT_MON_LIST
|
2015-07-03 19:37:53 +00:00
|
|
|
jr nz, .notMonster
|
2015-07-15 06:16:06 +00:00
|
|
|
ld hl, wItemList
|
2015-04-01 15:27:51 +00:00
|
|
|
ld de, MonsterNames
|
|
|
|
ld a, MONSTER_NAME
|
2015-07-03 19:37:53 +00:00
|
|
|
jr .done
|
|
|
|
.notMonster
|
2015-07-13 06:00:48 +00:00
|
|
|
cp INIT_BAG_ITEM_LIST
|
2015-07-03 19:37:53 +00:00
|
|
|
jr nz, .notBag
|
2015-04-01 15:27:51 +00:00
|
|
|
ld hl, wNumBagItems
|
|
|
|
ld de, ItemNames
|
|
|
|
ld a, ITEM_NAME
|
2015-07-03 19:37:53 +00:00
|
|
|
jr .done
|
|
|
|
.notBag
|
2015-07-15 06:16:06 +00:00
|
|
|
ld hl, wItemList
|
2015-04-01 15:27:51 +00:00
|
|
|
ld de, ItemNames
|
|
|
|
ld a, ITEM_NAME
|
2015-07-03 19:37:53 +00:00
|
|
|
.done
|
2015-04-01 15:27:51 +00:00
|
|
|
ld [wNameListType], a
|
|
|
|
ld a, l
|
2015-07-15 06:16:06 +00:00
|
|
|
ld [wListPointer], a
|
2015-04-01 15:27:51 +00:00
|
|
|
ld a, h
|
2015-07-15 06:16:06 +00:00
|
|
|
ld [wListPointer + 1], a
|
2015-04-01 15:27:51 +00:00
|
|
|
ld a, e
|
2015-08-07 19:39:29 +00:00
|
|
|
ld [wUnusedCF8D], a
|
2015-04-01 15:27:51 +00:00
|
|
|
ld a, d
|
2015-08-07 19:39:29 +00:00
|
|
|
ld [wUnusedCF8D + 1], a
|
2015-04-01 15:27:51 +00:00
|
|
|
ld bc, ItemPrices
|
|
|
|
ld a, c
|
|
|
|
ld [wItemPrices], a
|
|
|
|
ld a, b
|
|
|
|
ld [wItemPrices + 1], a
|
|
|
|
ret
|
|
|
|
|
2015-07-16 03:04:58 +00:00
|
|
|
; get species of mon e in list [wMonDataLocation] for LoadMonData
|
2016-06-12 00:24:04 +00:00
|
|
|
GetMonSpecies:
|
2015-04-01 15:27:51 +00:00
|
|
|
ld hl, wPartySpecies
|
2015-07-16 03:04:58 +00:00
|
|
|
ld a, [wMonDataLocation]
|
2015-04-01 15:27:51 +00:00
|
|
|
and a
|
|
|
|
jr z, .getSpecies
|
|
|
|
dec a
|
|
|
|
jr z, .enemyParty
|
|
|
|
ld hl, wBoxSpecies
|
|
|
|
jr .getSpecies
|
|
|
|
.enemyParty
|
|
|
|
ld hl, wEnemyPartyMons
|
|
|
|
.getSpecies
|
|
|
|
ld d, 0
|
|
|
|
add hl, de
|
|
|
|
ld a, [hl]
|
|
|
|
ld [wcf91], a
|
2015-06-02 03:15:02 +00:00
|
|
|
ret
|