mirror of
https://github.com/pret/pokegold-spaceworld.git
synced 2026-04-25 07:22:04 -05:00
Some checks failed
CI / build (push) Has been cancelled
* Fully labelled bank09.asm, started bank03.asm * Finished labelling bank03.asm and bank0b.asm * Tying up loose ends, splitting most of the completely labelled bank dumps * Moved pokedex letter graphics out of charmap
44 lines
767 B
NASM
44 lines
767 B
NASM
INCLUDE "constants.asm"
|
|
|
|
SECTION "engine/link/time_capsule_2.asm", ROMX
|
|
|
|
; Takes the DEX_* index stored in wTempSpecies,
|
|
; finds its MON_* in the Pokered_MonIndices table,
|
|
; and returns its index in wTempSpecies.
|
|
ConvertMon_2to1::
|
|
push bc
|
|
push hl
|
|
ld a, [wTempSpecies]
|
|
ld b, a
|
|
ld c, $00
|
|
ld hl, Pokered_MonIndices
|
|
.loop
|
|
inc c
|
|
ld a, [hli]
|
|
cp b
|
|
jr nz, .loop
|
|
ld a, c
|
|
ld [wTempSpecies], a
|
|
pop hl
|
|
pop bc
|
|
ret
|
|
|
|
; Takes the MON_* value stored in wTempSpecies
|
|
; and returns the corresponding DEX_* value from Pokered_MonIndices in wTempSpecies.
|
|
ConvertMon_1to2::
|
|
push bc
|
|
push hl
|
|
ld a, [wTempSpecies]
|
|
dec a
|
|
ld hl, Pokered_MonIndices
|
|
ld b, $00
|
|
ld c, a
|
|
add hl, bc
|
|
ld a, [hl]
|
|
ld [wTempSpecies], a
|
|
pop hl
|
|
pop bc
|
|
ret
|
|
|
|
INCLUDE "data/pokemon/gen1_order.inc"
|