pokecrystal-board/engine/pokemon/types.asm

93 lines
1.3 KiB
NASM
Raw Normal View History

2018-06-24 07:09:41 -07:00
PrintMonTypes:
2018-01-23 14:39:09 -08:00
; Print one or both types of [wCurSpecies]
; on the stats screen at hl.
push hl
call GetBaseData
pop hl
push hl
2018-01-23 14:39:09 -08:00
ld a, [wBaseType1]
call .Print
; Single-typed monsters really
; have two of the same type.
2018-01-23 14:39:09 -08:00
ld a, [wBaseType1]
ld b, a
2018-01-23 14:39:09 -08:00
ld a, [wBaseType2]
cp b
pop hl
jr z, .hide_type_2
ld bc, SCREEN_WIDTH
add hl, bc
.Print:
ld b, a
jr PrintType
.hide_type_2
; Erase any type name that was here before.
; Seems to be pointless in localized versions.
ld a, " "
ld bc, SCREEN_WIDTH - 3
add hl, bc
ld [hl], a
inc bc
add hl, bc
2018-01-16 15:07:06 -08:00
ld bc, NAME_LENGTH_JAPANESE - 1
jp ByteFill
2018-06-24 07:09:41 -07:00
PrintMoveType:
; Print the type of move b at hl.
push hl
ld a, b
dec a
ld bc, MOVE_LENGTH
ld hl, Moves
call AddNTimes
2018-01-23 14:39:09 -08:00
ld de, wStringBuffer1
ld a, BANK(Moves)
call FarCopyBytes
2018-01-23 14:39:09 -08:00
ld a, [wStringBuffer1 + MOVE_TYPE]
pop hl
ld b, a
2018-06-24 07:09:41 -07:00
PrintType:
; Print type b at hl.
ld a, b
push hl
add a
ld hl, TypeNames
ld e, a
ld d, 0
add hl, de
ld a, [hli]
ld e, a
ld d, [hl]
pop hl
jp PlaceString
2018-06-24 07:09:41 -07:00
GetTypeName:
2018-01-23 14:39:09 -08:00
; Copy the name of type [wd265] to wStringBuffer1.
ld a, [wd265]
ld hl, TypeNames
ld e, a
ld d, 0
add hl, de
add hl, de
ld a, [hli]
ld h, [hl]
ld l, a
2018-01-23 14:39:09 -08:00
ld de, wStringBuffer1
2018-01-16 15:07:06 -08:00
ld bc, MOVE_NAME_LENGTH
jp CopyBytes
2018-01-10 22:45:27 -08:00
INCLUDE "data/types/names.asm"