diff options
author | Rangi <remy.oukaour+rangi42@gmail.com> | 2018-04-04 23:56:40 -0400 |
---|---|---|
committer | Rangi <remy.oukaour+rangi42@gmail.com> | 2018-04-04 23:56:40 -0400 |
commit | 81306889e33c599f8015bc4e653929bb7de00967 (patch) | |
tree | 7a812968ba565a13ef400cdcb5230e6e8185a1ec /engine/link/time_capsule_2.asm | |
parent | 145efc13535fbc9d8ab2786d29209d97aebf0481 (diff) | |
parent | f750d4f4185529cfb440ac7825d202ebcf160766 (diff) |
Merge branch 'master' of https://github.com/pret/pokecrystal
Diffstat (limited to 'engine/link/time_capsule_2.asm')
-rw-r--r-- | engine/link/time_capsule_2.asm | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/engine/link/time_capsule_2.asm b/engine/link/time_capsule_2.asm new file mode 100644 index 000000000..a56e51785 --- /dev/null +++ b/engine/link/time_capsule_2.asm @@ -0,0 +1,39 @@ +ConvertMon_2to1: ; fb8f1 +; Takes the Gen-2 Pokemon number stored in wd265, finds it in the Pokered_MonIndices table, and returns its index in wd265. + push bc + push hl + ld a, [wd265] + ld b, a + ld c, 0 + ld hl, Pokered_MonIndices +.loop + inc c + ld a, [hli] + cp b + jr nz, .loop + ld a, c + ld [wd265], a + pop hl + pop bc + ret +; fb908 + +ConvertMon_1to2: ; fb908 +; Takes the Gen-1 Pokemon number stored in wd265 and returns the corresponding value from Pokered_MonIndices in wd265. + push bc + push hl + ld a, [wd265] + dec a + ld hl, Pokered_MonIndices + ld b, 0 + ld c, a + add hl, bc + ld a, [hl] + ld [wd265], a + pop hl + pop bc + ret +; fb91c + + +INCLUDE "data/pokemon/gen1_order.asm" |