mirror of
https://github.com/pret/pokegold-spaceworld.git
synced 2026-10-02 06:40:29 -04:00
e88fe24e15
This uses catch-all files like main.asm to reduce the total quantity and size of build objects (from 1.1 GB to 70 MB). --------- Co-authored-by: Rangi <35663410+Rangi42@users.noreply.github.com>
40 lines
694 B
NASM
40 lines
694 B
NASM
; 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.asm"
|