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 add hl, bc
ld a, [hl] ld a, [hl]
dec a dec a
ld hl, BaseData + 7 ; type ld hl, BaseData + BASE_TYPES
ld bc, BaseData1 - BaseData0 ld bc, BASE_DATA_SIZE
call AddNTimes call AddNTimes
ld de, EnemyMonType ld de, EnemyMonType
ld bc, 2 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 ; BaseGrowthRate values
; GrowthRates indexes (see main.asm) ; GrowthRates indexes (see main.asm)
const_def const_def

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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