mirror of
https://github.com/thornAvery/kep-hack.git
synced 2025-09-17 02:40:50 +12:00
Recomment LoadMonData_.
This commit is contained in:
parent
41906725d0
commit
6c94ac1248
90
main.asm
90
main.asm
|
@ -3,6 +3,7 @@ INCLUDE "constants.asm"
|
||||||
|
|
||||||
INCLUDE "home.asm"
|
INCLUDE "home.asm"
|
||||||
|
|
||||||
|
|
||||||
SECTION "bank1",ROMX,BANK[$1]
|
SECTION "bank1",ROMX,BANK[$1]
|
||||||
|
|
||||||
INCLUDE "data/facing.asm"
|
INCLUDE "data/facing.asm"
|
||||||
|
@ -56,6 +57,7 @@ Func_40b0::
|
||||||
ld a, $7 ; HealParty
|
ld a, $7 ; HealParty
|
||||||
jp Predef
|
jp Predef
|
||||||
|
|
||||||
|
|
||||||
MewPicFront:: INCBIN "pic/bmon/mew.pic"
|
MewPicFront:: INCBIN "pic/bmon/mew.pic"
|
||||||
MewPicBack:: INCBIN "pic/monback/mewb.pic"
|
MewPicBack:: INCBIN "pic/monback/mewb.pic"
|
||||||
INCLUDE "data/baseStats/mew.asm"
|
INCLUDE "data/baseStats/mew.asm"
|
||||||
|
@ -67,58 +69,62 @@ INCLUDE "engine/titlescreen.asm"
|
||||||
NintenText: db "NINTEN@"
|
NintenText: db "NINTEN@"
|
||||||
SonyText: db "SONY@"
|
SonyText: db "SONY@"
|
||||||
|
|
||||||
; loads pokemon data from one of multiple sources to $cf98
|
|
||||||
; loads base stats to $d0b8
|
LoadMonData_:
|
||||||
; INPUT:
|
; Load monster [wWhichPokemon] from list [$cc49]:
|
||||||
; [$cf92] = index of pokemon within party/box
|
; 0: partymon
|
||||||
; [$cc49] = source
|
; 1: enemymon
|
||||||
; 00: player's party
|
; 2: boxmon
|
||||||
; 01: enemy's party
|
; 3: daycaremon
|
||||||
; 02: current box
|
; Return monster id at $cf91 and its data at $cf98.
|
||||||
; 03: daycare
|
; Also load base stats at $d0b8 for convenience.
|
||||||
; OUTPUT:
|
|
||||||
; [$cf91] = pokemon ID
|
ld a, [W_DAYCAREMONDATA]
|
||||||
; $cf98 = base address of pokemon data
|
ld [$cf91], a
|
||||||
; $d0b8 = base address of base stats
|
ld a, [$cc49]
|
||||||
LoadMonData_: ; 45b6 (1:45b6)
|
cp 3
|
||||||
ld a,[W_DAYCAREMONDATA] ; daycare pokemon ID
|
jr z, .GetMonHeader
|
||||||
ld [$cf91],a
|
|
||||||
ld a,[$cc49]
|
ld a, [wWhichPokemon]
|
||||||
cp a,$03
|
ld e, a
|
||||||
jr z,.GetMonHeader
|
|
||||||
ld a,[wWhichPokemon]
|
|
||||||
ld e,a
|
|
||||||
callab Func_39c37 ; get pokemon ID
|
callab Func_39c37 ; get pokemon ID
|
||||||
|
|
||||||
.GetMonHeader
|
.GetMonHeader
|
||||||
ld a,[$cf91]
|
ld a, [$cf91]
|
||||||
ld [$d0b5],a ; input for GetMonHeader
|
ld [$d0b5], a ; input for GetMonHeader
|
||||||
call GetMonHeader ; load base stats to $d0b8
|
call GetMonHeader
|
||||||
ld hl,W_PARTYMON1DATA
|
|
||||||
ld bc,44
|
ld hl, W_PARTYMON1DATA
|
||||||
ld a,[$cc49]
|
ld bc, 44
|
||||||
cp a,$01
|
ld a, [$cc49]
|
||||||
jr c,.getMonEntry
|
cp 1
|
||||||
ld hl,wEnemyMons ; enemy pokemon 1 data
|
jr c, .getMonEntry
|
||||||
jr z,.getMonEntry
|
|
||||||
cp a,$02
|
ld hl, wEnemyMons
|
||||||
ld hl,W_BOXMON1DATA ; box pokemon 1 data
|
jr z, .getMonEntry
|
||||||
ld bc,33
|
|
||||||
jr z,.getMonEntry
|
cp 2
|
||||||
ld hl, W_DAYCAREMONDATA ; daycare pokemon data
|
ld hl, W_BOXMON1DATA
|
||||||
|
ld bc, 33
|
||||||
|
jr z, .getMonEntry
|
||||||
|
|
||||||
|
ld hl, W_DAYCAREMONDATA
|
||||||
jr .copyMonData
|
jr .copyMonData
|
||||||
.getMonEntry ; add the product of the index and the size of each entry
|
|
||||||
ld a,[wWhichPokemon]
|
.getMonEntry
|
||||||
|
ld a, [wWhichPokemon]
|
||||||
call AddNTimes
|
call AddNTimes
|
||||||
|
|
||||||
.copyMonData
|
.copyMonData
|
||||||
ld de,$cf98
|
ld de, $cf98
|
||||||
ld bc,44
|
ld bc, 44
|
||||||
jp CopyData
|
jp CopyData
|
||||||
|
|
||||||
INCLUDE "data/item_prices.asm"
|
|
||||||
|
|
||||||
|
INCLUDE "data/item_prices.asm"
|
||||||
INCLUDE "text/item_names.asm"
|
INCLUDE "text/item_names.asm"
|
||||||
|
|
||||||
UnusedNames: ; 4a92 (1:4a92)
|
UnusedNames:
|
||||||
db "かみなりバッヂ@"
|
db "かみなりバッヂ@"
|
||||||
db "かいがらバッヂ@"
|
db "かいがらバッヂ@"
|
||||||
db "おじぞうバッヂ@"
|
db "おじぞうバッヂ@"
|
||||||
|
|
Loading…
Reference in a new issue