Add member constants for the base data struct, same as most other structs

This commit is contained in:
Remy Oukaour 2017-12-11 17:35:35 -05:00
parent 8c2c9e91b5
commit 4afc2f01ef
9 changed files with 75 additions and 48 deletions

View File

@ -3484,8 +3484,8 @@ IsThePlayerPkmnTypesEffectiveAgainstOTPkmn: ; 3d618
add hl, bc
ld a, [hl]
dec a
ld hl, BaseData + 7 ; type
ld bc, BaseData1 - BaseData0
ld hl, BaseData + BASE_TYPES
ld bc, BASE_DATA_SIZE
call AddNTimes
ld de, EnemyMonType
ld bc, 2

View File

@ -1,3 +1,30 @@
; base data struct members (see data/base_stats/*.asm)
BASE_DEX_NO EQUS "(BaseDexNo - CurBaseData)"
BASE_STATS EQUS "(BaseStats - CurBaseData)"
BASE_HP EQUS "(BaseHP - CurBaseData)"
BASE_ATK EQUS "(BaseAttack - CurBaseData)"
BASE_SPD EQUS "(BaseSpeed - CurBaseData)"
BASE_SAT EQUS "(BaseSpecialAttack - CurBaseData)"
BASE_SDF EQUS "(BaseSpecialDefense - CurBaseData)"
BASE_TYPES EQUS "(BaseType - CurBaseData)"
BASE_TYPE_1 EQUS "(BaseType1 - CurBaseData)"
BASE_TYPE_2 EQUS "(BaseType2 - CurBaseData)"
BASE_CATCH_RATE EQUS "(BaseCatchRate - CurBaseData)"
BASE_EXP EQUS "(BaseExp - CurBaseData)"
BASE_ITEMS EQUS "(BaseItems - CurBaseData)"
BASE_ITEM_1 EQUS "(BaseItem1 - CurBaseData)"
BASE_ITEM_2 EQUS "(BaseItem2 - CurBaseData)"
BASE_GENDER EQUS "(BaseGender - CurBaseData)"
BASE_UNKNOWN_1 EQUS "(BaseUnknown1 - CurBaseData)"
BASE_EGG_STEPS EQUS "(BaseEggSteps - CurBaseData)"
BASE_UNKNOWN_2 EQUS "(BaseUnknown2 - CurBaseData)"
BASE_PIC_SIZE EQUS "(BasePicSize - CurBaseData)"
BASE_PADDING EQUS "(BasePadding - CurBaseData)"
BASE_GROWTH_RATE EQUS "(BaseGrowthRate - CurBaseData)"
BASE_EGG_GROUPS EQUS "(BaseEggGroups - CurBaseData)"
BASE_TMHM EQUS "(BaseTMHM - CurBaseData)"
BASE_DATA_SIZE EQUS "(CurBaseDataEnd - CurBaseData)"
; BaseGrowthRate values
; GrowthRates indexes (see main.asm)
const_def
@ -28,37 +55,37 @@ const_value SET 1
; party_struct members (see macros/wram.asm)
MON_SPECIES EQUS "(PartyMon1Species - PartyMon1)"
MON_ITEM EQUS "(PartyMon1Item - PartyMon1)"
MON_MOVES EQUS "(PartyMon1Moves - PartyMon1)"
MON_ID EQUS "(PartyMon1ID - PartyMon1)"
MON_EXP EQUS "(PartyMon1Exp - PartyMon1)"
MON_STAT_EXP EQUS "(PartyMon1StatExp - PartyMon1)"
MON_HP_EXP EQUS "(PartyMon1HPExp - PartyMon1)"
MON_ATK_EXP EQUS "(PartyMon1AtkExp - PartyMon1)"
MON_DEF_EXP EQUS "(PartyMon1DefExp - PartyMon1)"
MON_SPD_EXP EQUS "(PartyMon1SpdExp - PartyMon1)"
MON_SPC_EXP EQUS "(PartyMon1SpcExp - PartyMon1)"
MON_DVS EQUS "(PartyMon1DVs - PartyMon1)"
MON_PP EQUS "(PartyMon1PP - PartyMon1)"
MON_HAPPINESS EQUS "(PartyMon1Happiness - PartyMon1)"
MON_PKRUS EQUS "(PartyMon1PokerusStatus - PartyMon1)"
MON_CAUGHTDATA EQUS "(PartyMon1CaughtData - PartyMon1)"
MON_CAUGHTLEVEL EQUS "(PartyMon1CaughtLevel - PartyMon1)"
MON_CAUGHTTIME EQUS "(PartyMon1CaughtTime - PartyMon1)"
MON_CAUGHTGENDER EQUS "(PartyMon1CaughtGender - PartyMon1)"
MON_CAUGHTLOCATION EQUS "(PartyMon1CaughtLocation - PartyMon1)"
MON_LEVEL EQUS "(PartyMon1Level - PartyMon1)"
MON_STATUS EQUS "(PartyMon1Status - PartyMon1)"
MON_HP EQUS "(PartyMon1HP - PartyMon1)"
MON_MAXHP EQUS "(PartyMon1MaxHP - PartyMon1)"
MON_ATK EQUS "(PartyMon1Attack - PartyMon1)"
MON_DEF EQUS "(PartyMon1Defense - PartyMon1)"
MON_SPD EQUS "(PartyMon1Speed - PartyMon1)"
MON_SAT EQUS "(PartyMon1SpclAtk - PartyMon1)"
MON_SDF EQUS "(PartyMon1SpclDef - PartyMon1)"
BOXMON_STRUCT_LENGTH EQUS "(PartyMon1End - PartyMon1)"
PARTYMON_STRUCT_LENGTH EQUS "(PartyMon1StatsEnd - PartyMon1)"
MON_SPECIES EQUS "(PartyMon1Species - PartyMon1)"
MON_ITEM EQUS "(PartyMon1Item - PartyMon1)"
MON_MOVES EQUS "(PartyMon1Moves - PartyMon1)"
MON_ID EQUS "(PartyMon1ID - PartyMon1)"
MON_EXP EQUS "(PartyMon1Exp - PartyMon1)"
MON_STAT_EXP EQUS "(PartyMon1StatExp - PartyMon1)"
MON_HP_EXP EQUS "(PartyMon1HPExp - PartyMon1)"
MON_ATK_EXP EQUS "(PartyMon1AtkExp - PartyMon1)"
MON_DEF_EXP EQUS "(PartyMon1DefExp - PartyMon1)"
MON_SPD_EXP EQUS "(PartyMon1SpdExp - PartyMon1)"
MON_SPC_EXP EQUS "(PartyMon1SpcExp - PartyMon1)"
MON_DVS EQUS "(PartyMon1DVs - PartyMon1)"
MON_PP EQUS "(PartyMon1PP - PartyMon1)"
MON_HAPPINESS EQUS "(PartyMon1Happiness - PartyMon1)"
MON_PKRUS EQUS "(PartyMon1PokerusStatus - PartyMon1)"
MON_CAUGHTDATA EQUS "(PartyMon1CaughtData - PartyMon1)"
MON_CAUGHTLEVEL EQUS "(PartyMon1CaughtLevel - PartyMon1)"
MON_CAUGHTTIME EQUS "(PartyMon1CaughtTime - PartyMon1)"
MON_CAUGHTGENDER EQUS "(PartyMon1CaughtGender - PartyMon1)"
MON_CAUGHTLOCATION EQUS "(PartyMon1CaughtLocation - PartyMon1)"
MON_LEVEL EQUS "(PartyMon1Level - PartyMon1)"
MON_STATUS EQUS "(PartyMon1Status - PartyMon1)"
MON_HP EQUS "(PartyMon1HP - PartyMon1)"
MON_MAXHP EQUS "(PartyMon1MaxHP - PartyMon1)"
MON_ATK EQUS "(PartyMon1Attack - PartyMon1)"
MON_DEF EQUS "(PartyMon1Defense - PartyMon1)"
MON_SPD EQUS "(PartyMon1Speed - PartyMon1)"
MON_SAT EQUS "(PartyMon1SpclAtk - PartyMon1)"
MON_SDF EQUS "(PartyMon1SpclDef - PartyMon1)"
BOXMON_STRUCT_LENGTH EQUS "(PartyMon1End - PartyMon1)"
PARTYMON_STRUCT_LENGTH EQUS "(PartyMon1StatsEnd - PartyMon1)"
REDMON_STRUCT_LENGTH EQU 44

View File

@ -1,6 +1,4 @@
BaseData0::
INCLUDE "data/base_stats/bulbasaur.asm"
BaseData1::
INCLUDE "data/base_stats/ivysaur.asm"
INCLUDE "data/base_stats/venusaur.asm"
INCLUDE "data/base_stats/charmander.asm"

View File

@ -737,8 +737,8 @@ Link_PrepPartyData_Gen1: ; 28499
.skip_steel
push bc
dec a
ld hl, BaseData + 7 ; type
ld bc, BaseData1 - BaseData0
ld hl, BaseData + BASE_TYPES
ld bc, BASE_DATA_SIZE
call AddNTimes
ld bc, 2
ld a, BANK(BaseData)

View File

@ -1704,11 +1704,11 @@ GetBaseData:: ; 3856
; Get BaseData
dec a
ld bc, BaseData1 - BaseData0
ld bc, BASE_DATA_SIZE
ld hl, BaseData
call AddNTimes
ld de, CurBaseData
ld bc, BaseData1 - BaseData0
ld bc, BASE_DATA_SIZE
call CopyBytes
jr .end
@ -1881,8 +1881,8 @@ Function392d:: ; 392d
dec a
ld b, 0
add hl, bc
ld hl, BaseData + 0
ld bc, BaseData1 - BaseData0
ld hl, BaseData + BASE_DEX_NO
ld bc, BASE_DATA_SIZE
call AddNTimes
ld a, BANK(BaseData)
call GetFarHalfword

View File

@ -2374,12 +2374,12 @@ LoadTilesetHeader:: ; 2d27
push bc
ld hl, Tilesets
ld bc, Tileset1 - Tileset0
ld bc, TilesetHeaderEnd - TilesetHeader
ld a, [wTileset]
call AddNTimes
ld de, TilesetBank
ld bc, Tileset1 - Tileset0
ld bc, TilesetHeaderEnd - TilesetHeader
ld a, BANK(Tilesets)
call FarCopyBytes

View File

@ -3919,8 +3919,8 @@ GetGender: ; 50bdd
push bc
ld a, [CurPartySpecies]
dec a
ld hl, BaseData + BaseGender - CurBaseData
ld bc, BaseData1 - BaseData
ld hl, BaseData + BASE_GENDER
ld bc, BASE_DATA_SIZE
call AddNTimes
pop bc

View File

@ -7,9 +7,7 @@ tileset: macro
dw \1PalMap
endm
Tileset0::
tileset Tileset0
Tileset1::
tileset TilesetJohto1
tileset TilesetJohto2
tileset TilesetKanto

View File

@ -1997,6 +1997,7 @@ TilesetCollisionAddress:: dw ; d1e0
TilesetAnim:: dw ; bank 3f ; d1e2
ds 2 ; unused ; d1e4
TilesetPalettes:: dw ; bank 3f ; d1e6
TilesetHeaderEnd::
EvolvableFlags:: flag_array PARTY_LENGTH ; d1e8
@ -2109,7 +2110,9 @@ BaseType1:: db ; d23d
BaseType2:: db ; d23e
BaseCatchRate:: db ; d23f
BaseExp:: db ; d240
BaseItems:: dw ; d241
BaseItems:: ; d241
BaseItem1:: db ; d241
BaseItem2:: db ; d242
BaseGender:: db ; d243
BaseUnknown1:: db ; d244
BaseEggSteps:: db ; d245
@ -2119,6 +2122,7 @@ BasePadding:: ds 4 ; d248
BaseGrowthRate:: db ; d24c
BaseEggGroups:: db ; d24d
BaseTMHM:: flag_array NUM_TM_HM_TUTOR ; d24e
CurBaseDataEnd::
CurDamage:: dw ; d256