Consolidate NUM_MOVES usage and monster struct labels.

There turned out to be a lot of instances of NUM_MOVES.
This commit is contained in:
yenatch
2014-06-10 23:08:07 -07:00
parent 0d682e076a
commit 86c1e0feea
6 changed files with 655 additions and 687 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -2,9 +2,18 @@
; strings
PLAYER_NAME_LENGTH EQU 8
PKMN_NAME_LENGTH EQU 11
MOVE_NAME_LENGTH EQU 13
NAME_LENGTH EQU 11
LV_CHAR EQU $6e
; GetName types
PKMN_NAME EQU 1
MOVE_NAME EQU 2
ITEM_NAME EQU 4
PARTY_OT_NAME EQU 5
ENEMY_OT_NAME EQU 6
TRAINER_NAME EQU 7
; boxes
NUM_BOXES EQU 14
@@ -22,6 +31,7 @@ PREDEF_UPDATE_ENEMY_HUD EQU $15
PREDEF_START_BATTLE EQU $16
PREDEF_FILL_IN_EXP_BAR EQU $17
PREDEF_FILLMOVES EQU $1B
PREDEF_LIST_MOVES EQU $20
PREDEF_GET_GENDER EQU $24
PREDEF_STATS_SCREEN EQU $25
PREDEF_DRAW_PLAYER_HP EQU $26

View File

@@ -366,7 +366,7 @@ ParkBall: ; e8a2
.asm_e98e
ld b, a
ld [MagikarpLength], a
ld [Buffer1], a
call Random
cp b
@@ -478,13 +478,13 @@ ParkBall: ; e8a2
bit 3, [hl]
jr nz, .asm_ea67
ld hl, $c735
ld de, EnemyMonMove1
ld bc, $0004
ld de, EnemyMonMoves
ld bc, NUM_MOVES
call CopyBytes
ld hl, $c739
ld de, EnemyMonPPMove1
ld bc, $0004
ld de, EnemyMonPP
ld bc, NUM_MOVES
call CopyBytes
.asm_ea67
@@ -2633,11 +2633,11 @@ Functionf652: ; f652
.asm_f677
ld a, [CurPartyMon]
ld hl, PartyMon1Move1
ld bc, $0030
ld hl, PartyMon1Moves
ld bc, PartyMon2 - PartyMon1
call AddNTimes
ld de, BattleMonMove1
ld b, $4
ld de, BattleMonMoves
ld b, NUM_MOVES
.asm_f688
ld a, [de]
and a
@@ -2647,13 +2647,10 @@ Functionf652: ; f652
push hl
push de
push bc
rept NUM_MOVES + 2 ; BattleMonPP - BattleMonMoves
inc de
inc de
inc de
inc de
inc de
inc de
ld bc, $0015
endr
ld bc, PartyMon1PP - PartyMon1Moves
add hl, bc
ld a, [hl]
ld [de], a
@@ -2682,15 +2679,16 @@ Functionf6af: ; f6af
ld hl, $cfa9
ld [hli], a
ld [hl], a
ld b, $4
ld b, NUM_MOVES
.asm_f6b7
push bc
ld hl, PartyMon1Move1
ld bc, $0030
ld hl, PartyMon1Moves
ld bc, PartyMon2 - PartyMon1
call Functionf963
ld a, [hl]
and a
jr z, .asm_f6ce
call Functionf6e8
jr z, .asm_f6ce
ld hl, $cfaa
@@ -2721,7 +2719,7 @@ Functionf6e8: ; f6e8
ld [MonType], a
call Functionf8ec
ld hl, PartyMon1PP
ld bc, $0030
ld bc, PartyMon2 - PartyMon1
call Functionf963
ld a, [$d265]
ld b, a
@@ -2739,6 +2737,7 @@ Functionf6e8: ; f6e8
ld c, 5
cp MYSTERYBERRY
jr z, .asm_f715
ld c, 10
.asm_f715
@@ -2985,7 +2984,7 @@ WontHaveAnyEffect_NotUsedMessage: ; f7ca
ld hl, WontHaveAnyEffectText
call PrintText
; Item wasn't used.
; Item wasn't used.
ld a, $2
ld [$d0ec], a
ret
@@ -3000,7 +2999,7 @@ Ball_BoxIsFullMessage: ; f7dc
ld hl, Ball_BoxIsFullText
call PrintText
; Item wasn't used.
; Item wasn't used.
ld a, $2
ld [$d0ec], a
ret
@@ -3116,21 +3115,21 @@ GotOffTheItemText: ; 0xf847
Functionf84c: ; f84c
ld a, $2
ld a, PartyMon1Moves - PartyMon1
call GetPartyParamLocation
push hl
ld de, MagikarpLength
ld a, $5
ld de, Buffer1
ld a, PREDEF_FILLPP
call Predef
pop hl
ld bc, $0015
ld bc, PartyMon1PP - PartyMon1Moves
add hl, bc
ld de, MagikarpLength
ld b, $0
ld de, Buffer1
ld b, 0
.asm_f864
inc b
ld a, b
cp $5
cp NUM_MOVES + 1
ret z
ld a, [$d265]
dec a
@@ -3157,14 +3156,14 @@ Functionf84c: ; f84c
Functionf881: ; f881
push bc
ld a, [de]
ld [$ffb6], a
ld [hDividend + 3], a
xor a
ld [hProduct], a
ld [hMultiplicand], a
ld [$ffb5], a
ld a, $5
ld [hMultiplier], a
ld b, $4
ld [hDividend], a
ld [hDividend + 1], a
ld [hDividend + 2], a
ld a, 5
ld [hDivisor], a
ld b, 4
call Divide
ld a, [hl]
ld b, a
@@ -3197,16 +3196,16 @@ Functionf881: ; f881
; f8b9
Functionf8b9: ; f8b9
ld a, $17
ld a, PartyMon1PP - PartyMon1
call GetPartyParamLocation
push hl
ld a, $2
ld a, PartyMon1Moves - PartyMon1
call GetPartyParamLocation
pop de
xor a
ld [$cfa9], a
ld [MonType], a
ld c, $4
ld c, NUM_MOVES
.asm_f8ce
ld a, [hli]
and a
@@ -3265,21 +3264,21 @@ Functionf8ec: ; f8ec
ld a, [hl]
dec a
push hl
ld hl, $5b00
ld bc, $0007
ld hl, Moves + MOVE_PP
ld bc, MOVE_LENGTH
call AddNTimes
ld a, $10
ld a, BANK(Moves)
call GetFarByte
ld b, a
ld de, StringBuffer1
ld [de], a
pop hl
push bc
ld bc, $0015
ld bc, PartyMon1PP - PartyMon1Moves
ld a, [MonType]
cp WILDMON
jr nz, .asm_f942
ld bc, $0006
ld bc, EnemyMonPP - EnemyMonMoves
.asm_f942
add hl, bc
@@ -3310,7 +3309,7 @@ Functionf963: ; f963
Functionf969: ; f969
ld a, [$cfa9]
ld c, a
ld b, $0
ld b, 0
add hl, bc
ret
; f971

402
main.asm

File diff suppressed because it is too large Load Diff

145
wram.asm
View File

@@ -6,11 +6,7 @@ party_struct: MACRO
\1Species:: db
\1Item:: db
\1Moves::
\1Move1:: db
\1Move2:: db
\1Move3:: db
\1Move4:: db
\1Moves:: ds NUM_MOVES
\1ID:: dw
\1Exp:: ds 3 ; Big endian
@@ -25,11 +21,7 @@ party_struct: MACRO
\1AtkDefDV:: db
\1SpdSpcDV:: db
\1PP::
\1PPMove1:: db
\1PPMove2:: db
\1PPMove3:: db
\1PPMove4:: db
\1PP:: ds NUM_MOVES
\1Happiness:: db
\1PokerusStatus:: db
@@ -483,15 +475,8 @@ BattleMonSpecies:: ; c62c
BattleMonItem:: ; c62d
ds 1
BattleMonMoves::
BattleMonMove1:: ; c62e
ds 1
BattleMonMove2:: ; c62f
ds 1
BattleMonMove3:: ; c630
ds 1
BattleMonMove4:: ; c631
ds 1
BattleMonMoves:: ; c62e
ds NUM_MOVES
BattleMonDVs::
BattleMonAtkDefDV:: ; c632
@@ -499,15 +484,8 @@ BattleMonAtkDefDV:: ; c632
BattleMonSpdSpclDV:: ; c633
ds 1
BattleMonPP::
BattleMonPPMove1:: ; c634
ds 1
BattleMonPPMove2:: ; c635
ds 1
BattleMonPPMove3:: ; c636
ds 1
BattleMonPPMove4:: ; c637
ds 1
BattleMonPP:: ; c634
ds NUM_MOVES
BattleMonHappiness:: ; c638
ds 1
@@ -736,7 +714,14 @@ EnemyTurnsTaken:: ; c6dc
PlayerTurnsTaken:: ; c6dd
ds 1
ds 5
ds 1
PlayerSubstituteHP:: ; c6df
ds 1
EnemySubstituteHP:: ; c6e0
ds 1
ds 2
CurPlayerMove:: ; c6e3
ds 1
@@ -788,15 +773,17 @@ EnemyScreens:: ; c700
; see PlayerScreens
ds 1
PlayerSafeguardCount:: ; c701
ds 1
PlayerLightScreenCount:: ; c702
ds 1
PlayerReflectCount:: ; c703
ds 1
ds 2
ds 1
EnemySafeguardCount:: ; c705
ds 1
EnemyLightScreenCount:: ; c706
ds 1
EnemyReflectCount:: ; c707
@@ -1083,70 +1070,7 @@ CurPartyMon:: ; d109
ds 4
TempMon::
TempMonSpecies:: ; d10e
ds 1
TempMonItem:: ; d10f
ds 1
TempMonMoves:: ; d110
TempMonMove1:: ; d110
ds 1
TempMonMove2:: ; d111
ds 1
TempMonMove3:: ; d112
ds 1
TempMonMove4:: ; d113
ds 1
TempMonID:: ; d114
ds 2
TempMonExp:: ; d116
ds 3
TempMonHPExp:: ; d119
ds 2
TempMonAtkExp:: ; d11b
ds 2
TempMonDefExp:: ; d11d
ds 2
TempMonSpdExp:: ; d11f
ds 2
TempMonSpclExp:: ; d121
ds 2
TempMonDVs:: ; d123
; hp = %1000 for each dv
ds 1 ; atk/def
ds 1 ; spd/spc
TempMonPP:: ; d125
ds 4
TempMonHappiness:: ; d129
ds 1
TempMonPokerusStatus:: ; d12a
ds 1
TempMonCaughtData:: ; d12b
TempMonCaughtTime:: ; d12b
TempMonCaughtLevel:: ; d12b
ds 1
TempMonCaughtGender:: ; d12c
TempMonCaughtLocation:: ; d12c
ds 1
TempMonLevel:: ; d12d
ds 1
TempMonStatus:: ; d12e
ds 1
; d12f
ds 1
TempMonHP:: ; d130
ds 2
TempMonMaxHP:: ; d132
ds 2
TempMonAtk:: ; d134
ds 2
TempMonDef:: ; d136
ds 2
TempMonSpd:: ; d138
ds 2
TempMonSpclAtk:: ; d13a
ds 2
TempMonSpclDef:: ; d13c
ds 2
party_struct TempMon
TempMonEnd:: ; d13e
ds 3
@@ -1316,15 +1240,8 @@ EnemyMonSpecies:: ; d206
EnemyMonItem:: ; d207
ds 1
EnemyMonMoves::
EnemyMonMove1:: ; d208
ds 1
EnemyMonMove2:: ; d209
ds 1
EnemyMonMove3:: ; d20a
ds 1
EnemyMonMove4:: ; d20b
ds 1
EnemyMonMoves:: ; d208
ds NUM_MOVES
EnemyMonMovesEnd::
EnemyMonDVs::
@@ -1333,16 +1250,9 @@ EnemyMonAtkDefDV:: ; d20c
EnemyMonSpdSpclDV:: ; d20d
ds 1
EnemyMonPP::
EnemyMonPPMove1:: ; d20e
ds 1
EnemyMonPPMove2:: ; d20f
ds 1
EnemyMonPPMove3:: ; d210
ds 1
EnemyMonPPMove4:: ; d211
ds 1
EnemyMonPP:: ; d20e
ds NUM_MOVES
EnemyMonHappiness:: ; d212
ds 1
EnemyMonLevel:: ; d213
@@ -1729,7 +1639,10 @@ StatusFlags2:: ; d84d
Money:: ; d84e
ds 3
ds 4
wMomsMoney:: ; d851
ds 3
wMomSavingMoney:: ; d854
ds 1
Coins:: ; d855
ds 2
@@ -2087,7 +2000,7 @@ EggNick:: ; df65
ds 11
EggOT:: ; df70
ds 11
EggStats::
EggMon::
EggSpecies:: ; df7b
ds 1
ds 31