pokecrystal-board/engine/time_capsule_2.asm
Remy Oukaour 5c28d05bb4 Merge branch 'master' of https://github.com/xCrystal/pokecrystal (resolve PR #459)
# Conflicts:
#	data/items/descriptions.asm
#	data/sprite_anims/framesets.asm
#	engine/crystal_colors.asm
#	engine/events/kurt.asm
#	engine/events/special.asm
#	engine/events/std_scripts.asm
#	engine/events_3.asm
#	engine/item_effects.asm
#	engine/namingscreen.asm
#	engine/scripting.asm
#	engine/stats_screen.asm
#	engine/trade_animation.asm
#	home/audio.asm
#	main.asm
#	maps/BattleTower1F.asm
#	maps/BattleTowerBattleRoom.asm
#	maps/BurnedTowerB1F.asm
#	maps/ElmsLab.asm
#	maps/GoldenrodDeptStore5F.asm
#	maps/GoldenrodUnderground.asm
#	maps/HallOfFame.asm
#	maps/MahoganyTown.asm
#	maps/ManiasHouse.asm
#	maps/MobileBattleRoom.asm
#	maps/MobileTradeRoomMobile.asm
#	maps/RadioTower2F.asm
#	maps/Route35NationalParkGate.asm
#	maps/Route36NationalParkGate.asm
#	maps/Route39Farmhouse.asm
#	tilesets/palette_maps.asm
2018-01-14 22:56:36 -05:00

40 lines
670 B
NASM

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
Predef_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/rby_order.asm"