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

View File

@@ -172,7 +172,7 @@ Function3c12f: ; 3c12f
ld [$c73f], a ld [$c73f], a
ld [$c740], a ld [$c740], a
ld [CurDamage], a ld [CurDamage], a
ld [$d257], a ld [CurDamage + 1], a
call Function3c27c call Function3c27c
call UpdateBattleMonInParty call UpdateBattleMonInParty
callba AIChooseMove callba AIChooseMove
@@ -723,7 +723,7 @@ Function3c4df: ; 3c4df
dec a dec a
ld [PlayerEncoreCount], a ld [PlayerEncoreCount], a
jr z, .asm_3c50a jr z, .asm_3c50a
ld hl, BattleMonPPMove1 ld hl, BattleMonPP
ld a, [CurMoveNum] ld a, [CurMoveNum]
ld c, a ld c, a
ld b, $0 ld b, $0
@@ -747,7 +747,7 @@ Function3c4df: ; 3c4df
dec a dec a
ld [EnemyEncoreCount], a ld [EnemyEncoreCount], a
jr z, .asm_3c535 jr z, .asm_3c535
ld hl, EnemyMonPPMove1 ld hl, EnemyMonPP
ld a, [CurEnemyMoveNum] ld a, [CurEnemyMoveNum]
ld c, a ld c, a
ld b, $0 ld b, $0
@@ -1390,14 +1390,14 @@ Function3c93c: ; 3c93c
.asm_3c957 .asm_3c957
callab GetUserItem callab GetUserItem
ld a, b ld a, b
cp $6 cp HELD_RESTORE_PP
jr nz, .asm_3c9ae jr nz, .asm_3c9ae
ld hl, PartyMon1PP ld hl, PartyMon1PP
ld a, [CurBattleMon] ld a, [CurBattleMon]
call GetPartyLocation call GetPartyLocation
ld d, h ld d, h
ld e, l ld e, l
ld hl, PartyMon1Move1 ld hl, PartyMon1Moves
ld a, [CurBattleMon] ld a, [CurBattleMon]
call GetPartyLocation call GetPartyLocation
ld a, [hBattleTurn] ld a, [hBattleTurn]
@@ -1408,12 +1408,12 @@ Function3c93c: ; 3c93c
ld a, [IsInBattle] ld a, [IsInBattle]
dec a dec a
jr z, .asm_3c99b jr z, .asm_3c99b
ld hl, OTPartyMon1PPMove1 ld hl, OTPartyMon1PP
ld a, [CurOTMon] ld a, [CurOTMon]
call GetPartyLocation call GetPartyLocation
ld d, h ld d, h
ld e, l ld e, l
ld hl, OTPartyMon1Move1 ld hl, OTPartyMon1Moves
ld a, [CurOTMon] ld a, [CurOTMon]
call GetPartyLocation call GetPartyLocation
@@ -1430,18 +1430,19 @@ Function3c93c: ; 3c93c
inc de inc de
inc c inc c
ld a, c ld a, c
cp $4 cp NUM_MOVES
jr nz, .asm_3c99d jr nz, .asm_3c99d
.asm_3c9ae .asm_3c9ae
ret ret
.asm_3c9af .asm_3c9af
; lousy hack
ld a, [hl] ld a, [hl]
cp $a6 cp SKETCH
ld b, $1 ld b, 1
jr z, .asm_3c9b8 jr z, .asm_3c9b8
ld b, $5 ld b, 5
.asm_3c9b8 .asm_3c9b8
ld a, [de] ld a, [de]
@@ -1451,18 +1452,18 @@ Function3c93c: ; 3c93c
push bc push bc
ld a, [hl] ld a, [hl]
ld [$d265], a ld [$d265], a
ld de, BattleMonItem ld de, BattleMonMoves - 1
ld hl, BattleMonPPMove1 ld hl, BattleMonPP
ld a, [hBattleTurn] ld a, [hBattleTurn]
and a and a
jr z, .asm_3c9d2 jr z, .asm_3c9d2
ld de, EnemyMonItem ld de, EnemyMonMoves - 1
ld hl, EnemyMonPPMove1 ld hl, EnemyMonPP
.asm_3c9d2 .asm_3c9d2
inc de inc de
pop bc pop bc
ld b, $0 ld b, 0
add hl, bc add hl, bc
push hl push hl
ld h, d ld h, d
@@ -1542,27 +1543,32 @@ Function3ca26: ; 3ca26
ld [hl], a ld [hl], a
cp $1 cp $1
ret nz ret nz
ld hl, BattleText_0x808b6 ld hl, BattleText_0x808b6
call StdBattleTextBox call StdBattleTextBox
ld a, $10
ld a, BATTLE_VARS_MOVE
call _GetBattleVar call _GetBattleVar
push af push af
ld a, $f8 ld a, FUTURE_SIGHT
ld [hl], a ld [hl], a
callab UpdateMoveData callab UpdateMoveData
xor a xor a
ld [AttackMissed], a ld [AttackMissed], a
ld [AlreadyDisobeyed], a ld [AlreadyDisobeyed], a
ld a, $a ld a, 10
ld [TypeModifier], a ld [TypeModifier], a
callab DoMove callab DoMove
xor a xor a
ld [CurDamage], a ld [CurDamage], a
ld [$d257], a ld [CurDamage + 1], a
ld a, $10
ld a, BATTLE_VARS_MOVE
call _GetBattleVar call _GetBattleVar
pop af pop af
ld [hl], a ld [hl], a
call UpdateBattleMonInParty call UpdateBattleMonInParty
jp UpdateEnemyMonInParty jp UpdateEnemyMonInParty
; 3ca8f ; 3ca8f
@@ -1635,24 +1641,24 @@ Function3cafb: ; 3cafb
call .asm_3cb1c call .asm_3cb1c
.asm_3cb09 .asm_3cb09
ld a, [PlayerScreens] ld a, [PlayerScreens]
bit 2, a bit SCREENS_SAFEGUARD, a
ret z ret z
ld hl, $c701 ld hl, $c701
dec [hl] dec [hl]
ret nz ret nz
res 2, a res SCREENS_SAFEGUARD, a
ld [PlayerScreens], a ld [PlayerScreens], a
xor a xor a
jr .asm_3cb2e jr .asm_3cb2e
.asm_3cb1c .asm_3cb1c
ld a, [EnemyScreens] ld a, [EnemyScreens]
bit 2, a bit SCREENS_SAFEGUARD, a
ret z ret z
ld hl, $c705 ld hl, $c705
dec [hl] dec [hl]
ret nz ret nz
res 2, a res SCREENS_SAFEGUARD, a
ld [EnemyScreens], a ld [EnemyScreens], a
ld a, $1 ld a, $1
@@ -1676,7 +1682,7 @@ Function3cb36: ; 3cb36
.CheckPlayer .CheckPlayer
call SetPlayerTurn call SetPlayerTurn
ld de, .Your ld de, .Your
call .asm_3cb6f call .Copy
ld hl, PlayerScreens ld hl, PlayerScreens
ld de, PlayerLightScreenCount ld de, PlayerLightScreenCount
jr .FadeScreens jr .FadeScreens
@@ -1684,7 +1690,7 @@ Function3cb36: ; 3cb36
.CheckEnemy .CheckEnemy
call SetEnemyTurn call SetEnemyTurn
ld de, .Enemy ld de, .Enemy
call .asm_3cb6f call .Copy
ld hl, EnemyScreens ld hl, EnemyScreens
ld de, EnemyLightScreenCount ld de, EnemyLightScreenCount
@@ -1695,7 +1701,7 @@ Function3cb36: ; 3cb36
call nz, FadeReflect call nz, FadeReflect
ret ret
.asm_3cb6f .Copy
ld hl, StringBuffer1 ld hl, StringBuffer1
jp CopyName2 jp CopyName2
; 3cb75 ; 3cb75
@@ -1852,7 +1858,7 @@ Function3cc45: ; 3cc45
ld a, [hBattleTurn] ld a, [hBattleTurn]
and a and a
jr z, .asm_3cc50 jr z, .asm_3cc50
ld hl, EnemyMonHPHi ld hl, EnemyMonHP
.asm_3cc50 .asm_3cc50
inc hl inc hl
@@ -2099,7 +2105,7 @@ Function3cd55: ; 3cd55
call nz, Function3df48 call nz, Function3df48
ld a, $1 ld a, $1
ld [hBGMapMode], a ld [hBGMapMode], a
ld c, $3c ld c, 60
call DelayFrames call DelayFrames
ld a, [IsInBattle] ld a, [IsInBattle]
dec a dec a
@@ -2147,7 +2153,7 @@ Function3cdca: ; 3cdca
jr z, .asm_3cde6 jr z, .asm_3cde6
call ClearSprites call ClearSprites
hlcoord 1, 0 hlcoord 1, 0
ld bc, $040a lb bc, 4, 10
call ClearBox call ClearBox
call Function3d2b3 call Function3d2b3
ld a, $1 ld a, $1
@@ -2264,27 +2270,29 @@ Function3ce01: ; 3ce01
Function3ceaa: ; 3ceaa Function3ceaa: ; 3ceaa
ld a, [PartyCount] ld a, [PartyCount]
ld b, a ld b, a
ld hl, PartyMon1Species ld hl, PartyMon1
ld c, $1 ld c, $1
ld d, $0 ld d, $0
.asm_3ceb5 .asm_3ceb5
push hl push hl
push bc push bc
ld bc, $0022 ld bc, PartyMon1HP - PartyMon1
add hl, bc add hl, bc
ld a, [hli] ld a, [hli]
or [hl] or [hl]
pop bc pop bc
pop hl pop hl
jr z, .asm_3ced1 jr z, .asm_3ced1
push hl push hl
push bc push bc
ld bc, $0001 ld bc, PartyMon1Item - PartyMon1
add hl, bc add hl, bc
pop bc pop bc
ld a, [hl] ld a, [hl]
pop hl pop hl
cp $39
cp EXP_SHARE
jr nz, .asm_3ced1 jr nz, .asm_3ced1
ld a, d ld a, d
or c or c
@@ -2293,7 +2301,7 @@ Function3ceaa: ; 3ceaa
.asm_3ced1 .asm_3ced1
sla c sla c
push de push de
ld de, $0030 ld de, PartyMon2 - PartyMon1
add hl, de add hl, de
pop de pop de
dec b dec b
@@ -2331,7 +2339,7 @@ Function3cef1: ; 3cef1
call Function37b6 call Function37b6
call Function3d43b call Function3d43b
hlcoord 9, 7 hlcoord 9, 7
ld bc, $050b lb bc, 5, 11
call ClearBox call ClearBox
ld hl, BattleText_0x80a75 ld hl, BattleText_0x80a75
jp StdBattleTextBox jp StdBattleTextBox
@@ -2345,7 +2353,7 @@ Function3cf14: ; 3cf14
ld de, SFX_UNKNOWN_2A ld de, SFX_UNKNOWN_2A
call PlaySFX call PlaySFX
hlcoord 1, 0 hlcoord 1, 0
ld bc, $040a lb bc, 4, 10
call ClearBox call ClearBox
ld hl, BattleText_0x809a8 ld hl, BattleText_0x809a8
jp StdBattleTextBox jp StdBattleTextBox
@@ -2356,7 +2364,7 @@ Function3cf35: ; 3cf35
ld b, a ld b, a
xor a xor a
ld hl, OTPartyMon1HP ld hl, OTPartyMon1HP
ld de, $0030 ld de, PartyMon2 - PartyMon1
.asm_3cf40 .asm_3cf40
or [hl] or [hl]
inc hl inc hl
@@ -2494,7 +2502,7 @@ Function3d02b: ; 3d02b
push af push af
ld a, $0 ld a, $0
jr nc, .asm_3d044 jr nc, .asm_3d044
ld a, [$d854] ld a, [wMomSavingMoney]
and $7 and $7
cp $3 cp $3
jr nz, .asm_3d044 jr nz, .asm_3d044
@@ -2525,7 +2533,7 @@ Function3d02b: ; 3d02b
call Function3d099 call Function3d099
pop af pop af
jr nc, .asm_3d07b jr nc, .asm_3d07b
ld a, [$d854] ld a, [wMomSavingMoney]
and $7 and $7
jr z, .asm_3d07b jr z, .asm_3d07b
ld hl, SentToMomTexts ld hl, SentToMomTexts
@@ -2547,7 +2555,7 @@ Function3d02b: ; 3d02b
Function3d081: ; 3d081 Function3d081: ; 3d081
push bc push bc
ld hl, $c688 ld hl, $c688
ld de, $d853 ld de, wMomsMoney + 2
call Function3d0be call Function3d0be
pop bc pop bc
ret ret
@@ -2556,7 +2564,7 @@ Function3d081: ; 3d081
Function3d08d: ; 3d08d Function3d08d: ; 3d08d
push bc push bc
ld hl, $c688 ld hl, $c688
ld de, $d850 ld de, Money + 2
call Function3d0be call Function3d0be
pop bc pop bc
ret ret
@@ -2585,13 +2593,13 @@ SentToMomTexts: ; 3d0ab
Function3d0b1: ; 3d0b1 Function3d0b1: ; 3d0b1
ld hl, $d853 ld hl, wMomsMoney + 2
ld a, [hld] ld a, [hld]
cp $3f cp 999999 % $100
ld a, [hld] ld a, [hld]
sbc $42 sbc 999999 / $100 % $100
ld a, [hl] ld a, [hl]
sbc $f sbc 999999 / $10000 % $100
ret ret
; 3d0be ; 3d0be
@@ -2616,17 +2624,17 @@ Function3d0be: ; 3d0be
jr nz, .asm_3d0ce jr nz, .asm_3d0ce
pop hl pop hl
ld a, [hld] ld a, [hld]
cp $3f cp 999999 % $100
ld a, [hld] ld a, [hld]
sbc $42 sbc 999999 / $100 % $100
ld a, [hl] ld a, [hl]
sbc $f sbc 999999 / $10000 % $100
ret c ret c
ld [hl], $f ld [hl], 999999 / $10000 % $100
inc hl inc hl
ld [hl], $42 ld [hl], 999999 / $100 % $100
inc hl inc hl
ld [hl], $3f ld [hl], 999999 % $100
ret ret
; 3d0ea ; 3d0ea
@@ -3412,7 +3420,7 @@ Function3d599: ; 3d599
Function3d5d7: ; 3d5d7 Function3d5d7: ; 3d5d7
push bc push bc
ld hl, OTPartyMon1Move1 ld hl, OTPartyMon1Moves
ld a, b ld a, b
call GetPartyLocation call GetPartyLocation
pop bc pop bc
@@ -5531,7 +5539,7 @@ Function3e4bc: ; 3e4bc
ret ret
.asm_3e4c8 .asm_3e4c8
ld hl, EnemyMonMove1 ld hl, EnemyMonMoves
ld a, [$d235] ld a, [$d235]
dec a dec a
jr z, .asm_3e4e2 jr z, .asm_3e4e2
@@ -5539,49 +5547,50 @@ Function3e4bc: ; 3e4bc
jr z, .asm_3e4dd jr z, .asm_3e4dd
call Function3e786 call Function3e786
ret z ret z
ld hl, BattleMonMove1 ld hl, BattleMonMoves
jr .asm_3e4e2 jr .asm_3e4e2
.asm_3e4dd .asm_3e4dd
ld a, $2 ld a, PartyMon1Moves - PartyMon1
call GetPartyParamLocation call GetPartyParamLocation
.asm_3e4e2 .asm_3e4e2
ld de, $d25e ld de, $d25e
ld bc, $0004 ld bc, NUM_MOVES
call CopyBytes call CopyBytes
xor a xor a
ld [hBGMapMode], a ld [hBGMapMode], a
hlcoord 4, 12
ld b, $4 hlcoord 4, 17 - NUM_MOVES - 1
ld c, $e ld b, 4
ld c, 14
ld a, [$d235] ld a, [$d235]
cp $2 cp $2
jr nz, .asm_3e503 jr nz, .asm_3e503
hlcoord 4, 8 hlcoord 4, 17 - NUM_MOVES - 1 - 4
ld b, $4 ld b, 4
ld c, $e ld c, 14
.asm_3e503 .asm_3e503
call TextBox call TextBox
hlcoord 6, 13
hlcoord 6, 17 - NUM_MOVES
ld a, [$d235] ld a, [$d235]
cp $2 cp $2
jr nz, .asm_3e513 jr nz, .asm_3e513
hlcoord 6, 9 hlcoord 6, 17 - NUM_MOVES - 4
.asm_3e513 .asm_3e513
ld a, $14 ld a, SCREEN_WIDTH
ld [Buffer1], a ld [Buffer1], a
ld a, $20 ld a, PREDEF_LIST_MOVES
call Predef call Predef
ld b, $5
ld b, 5
ld a, [$d235] ld a, [$d235]
cp $2 cp $2
ld a, $d ld a, 17 - NUM_MOVES
jr nz, .asm_3e52c jr nz, .asm_3e52c
ld b, $5 ld b, 5
ld a, $9 ld a, 17 - NUM_MOVES - 4
.asm_3e52c .asm_3e52c
ld [$cfa1], a ld [$cfa1], a
@@ -5641,10 +5650,10 @@ Function3e4bc: ; 3e4bc
and a and a
jr z, .asm_3e5a3 jr z, .asm_3e5a3
hlcoord 5, 13 hlcoord 5, 13
ld bc, $0014 ld bc, SCREEN_WIDTH
dec a dec a
call AddNTimes call AddNTimes
ld [hl], $ec ld [hl], "▷"
.asm_3e5a3 .asm_3e5a3
ld a, $1 ld a, $1
@@ -5681,10 +5690,10 @@ Function3e4bc: ; 3e4bc
.asm_3e5d9 .asm_3e5d9
pop af pop af
ret nz ret nz
ld hl, BattleMonPPMove1 ld hl, BattleMonPP
ld a, [$cfa9] ld a, [$cfa9]
ld c, a ld c, a
ld b, $0 ld b, 0
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
and $3f and $3f
@@ -5699,9 +5708,9 @@ Function3e4bc: ; 3e4bc
and a and a
jr nz, .asm_3e606 jr nz, .asm_3e606
ld a, [$cfa9] ld a, [$cfa9]
ld hl, BattleMonMove1 ld hl, BattleMonMoves
ld c, a ld c, a
ld b, $0 ld b, 0
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
@@ -6018,8 +6027,8 @@ Function3e7c1: ; 3e7c1
bit 4, [hl] bit 4, [hl]
ld a, [LastEnemyMove] ld a, [LastEnemyMove]
jp nz, .asm_3e87f jp nz, .asm_3e87f
ld hl, EnemyMonMove1 ld hl, EnemyMonMoves
ld b, $0 ld b, 0
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
jp .asm_3e87f jp .asm_3e87f
@@ -6041,9 +6050,9 @@ Function3e7c1: ; 3e7c1
jr .asm_3e87f jr .asm_3e87f
.asm_3e830 .asm_3e830
ld hl, EnemyMonMove1 ld hl, EnemyMonMoves
ld de, EnemyMonPPMove1 ld de, EnemyMonPP
ld b, $4 ld b, NUM_MOVES
.asm_3e838 .asm_3e838
ld a, [hl] ld a, [hl]
and a and a
@@ -6067,11 +6076,11 @@ Function3e7c1: ; 3e7c1
dec a dec a
jr nz, .asm_3e882 jr nz, .asm_3e882
.asm_3e855 .asm_3e855
ld hl, EnemyMonMove1 ld hl, EnemyMonMoves
call BattleRandom call BattleRandom
and $3 and 3 ; TODO factor in NUM_MOVES
ld c, a ld c, a
ld b, $0 ld b, 0
add hl, bc add hl, bc
ld a, [EnemyDisableCount] ld a, [EnemyDisableCount]
swap a swap a
@@ -6082,7 +6091,7 @@ Function3e7c1: ; 3e7c1
ld a, [hl] ld a, [hl]
and a and a
jr z, .asm_3e855 jr z, .asm_3e855
ld hl, EnemyMonPPMove1 ld hl, EnemyMonPP
add hl, bc add hl, bc
ld b, a ld b, a
ld a, [hl] ld a, [hl]
@@ -6105,25 +6114,25 @@ Function3e7c1: ; 3e7c1
.asm_3e894 .asm_3e894
ld a, [EnemyMoveEffect] ld a, [EnemyMoveEffect]
cp $77 cp EFFECT_FURY_CUTTER
jr z, .asm_3e89f jr z, .asm_3e89f
xor a xor a
ld [EnemyFuryCutterCount], a ld [EnemyFuryCutterCount], a
.asm_3e89f .asm_3e89f
ld a, [EnemyMoveEffect] ld a, [EnemyMoveEffect]
cp $51 cp EFFECT_RAGE
jr z, .asm_3e8af jr z, .asm_3e8af
ld hl, EnemySubStatus4 ld hl, EnemySubStatus4
res 6, [hl] res SUBSTATUS_RAGE, [hl]
xor a xor a
ld [$c72c], a ld [$c72c], a
.asm_3e8af .asm_3e8af
ld a, [EnemyMoveEffect] ld a, [EnemyMoveEffect]
cp $6f cp EFFECT_PROTECT
ret z ret z
cp $74 cp EFFECT_ENDURE
ret z ret z
xor a xor a
ld [$c681], a ld [$c681], a
@@ -6140,20 +6149,20 @@ Function3e8c1: ; 3e8c1
ld [$c681], a ld [$c681], a
ld [$c72c], a ld [$c72c], a
ld hl, EnemySubStatus4 ld hl, EnemySubStatus4
res 6, [hl] res SUBSTATUS_RAGE, [hl]
ret ret
; 3e8d1 ; 3e8d1
Function3e8d1: ; 3e8d1 Function3e8d1: ; 3e8d1
ld a, [EnemySubStatus4] ld a, [EnemySubStatus4]
and $20 and 1 << SUBSTATUS_RECHARGE
ret nz ret nz
ld hl, EnemySubStatus3 ld hl, EnemySubStatus3
ld a, [hl] ld a, [hl]
and $13 and 1 << SUBSTATUS_CHARGED | 1 << SUBSTATUS_ROLLOUT | 1 << SUBSTATUS_BIDE
ret nz ret nz
ld hl, EnemySubStatus1 ld hl, EnemySubStatus1
bit 6, [hl] bit SUBSTATUS_ENCORED, [hl]
ret ret
; 3e8e4 ; 3e8e4
@@ -8520,19 +8529,19 @@ Function3f607: ; 3f607
ld [IsInBattle], a ld [IsInBattle], a
callba Function10605d callba Function10605d
call LoadEnemyMon call LoadEnemyMon
ld hl, EnemyMonMove1 ld hl, EnemyMonMoves
ld de, $c735 ld de, $c735
ld bc, $0004 ld bc, NUM_MOVES
call CopyBytes call CopyBytes
ld hl, EnemyMonPPMove1 ld hl, EnemyMonPP
ld de, $c739 ld de, $c739
ld bc, $0004 ld bc, NUM_MOVES
call CopyBytes call CopyBytes
ld hl, EnemyMonAtkDefDV ld hl, EnemyMonAtkDefDV
ld a, $2d ld a, $2d
call Predef call Predef
ld a, [CurPartySpecies] ld a, [CurPartySpecies]
cp $c9 cp UNOWN
jr nz, .asm_3f648 jr nz, .asm_3f648
ld a, [$def4] ld a, [$def4]
and a and a
@@ -8555,9 +8564,9 @@ Function3f607: ; 3f607
; 3f662 ; 3f662
Function3f662: ; 3f662 Function3f662: ; 3f662
ld hl, EnemyMonMove1 ld hl, EnemyMonMoves
ld de, $d25e ld de, $d25e
ld b, 4 ld b, NUM_MOVES
.loop .loop
ld a, [de] ld a, [de]
inc de inc de
@@ -8618,7 +8627,7 @@ Function3f6a5: ; 3f6a5
and a and a
jr z, .asm_3f6b7 jr z, .asm_3f6b7
call Function3f759 call Function3f759
ld c, $96 ld c, 150
call DelayFrames call DelayFrames
call Function3f77c call Function3f77c
ret ret
@@ -8693,7 +8702,7 @@ Function3f71d: ; 3f71d
.asm_3f73d .asm_3f73d
ld hl, $c6ee ld hl, $c6ee
ld de, $d850 ld de, Money + 2
call Function3d0be call Function3d0be
ld hl, BattleText_0x80730 ld hl, BattleText_0x80730
call StdBattleTextBox call StdBattleTextBox

File diff suppressed because it is too large Load Diff

View File

@@ -2,9 +2,18 @@
; strings ; strings
PLAYER_NAME_LENGTH EQU 8 PLAYER_NAME_LENGTH EQU 8
PKMN_NAME_LENGTH EQU 11 PKMN_NAME_LENGTH EQU 11
MOVE_NAME_LENGTH EQU 13
NAME_LENGTH EQU 11 NAME_LENGTH EQU 11
LV_CHAR EQU $6e 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 ; boxes
NUM_BOXES EQU 14 NUM_BOXES EQU 14
@@ -22,6 +31,7 @@ PREDEF_UPDATE_ENEMY_HUD EQU $15
PREDEF_START_BATTLE EQU $16 PREDEF_START_BATTLE EQU $16
PREDEF_FILL_IN_EXP_BAR EQU $17 PREDEF_FILL_IN_EXP_BAR EQU $17
PREDEF_FILLMOVES EQU $1B PREDEF_FILLMOVES EQU $1B
PREDEF_LIST_MOVES EQU $20
PREDEF_GET_GENDER EQU $24 PREDEF_GET_GENDER EQU $24
PREDEF_STATS_SCREEN EQU $25 PREDEF_STATS_SCREEN EQU $25
PREDEF_DRAW_PLAYER_HP EQU $26 PREDEF_DRAW_PLAYER_HP EQU $26

View File

@@ -366,7 +366,7 @@ ParkBall: ; e8a2
.asm_e98e .asm_e98e
ld b, a ld b, a
ld [MagikarpLength], a ld [Buffer1], a
call Random call Random
cp b cp b
@@ -478,13 +478,13 @@ ParkBall: ; e8a2
bit 3, [hl] bit 3, [hl]
jr nz, .asm_ea67 jr nz, .asm_ea67
ld hl, $c735 ld hl, $c735
ld de, EnemyMonMove1 ld de, EnemyMonMoves
ld bc, $0004 ld bc, NUM_MOVES
call CopyBytes call CopyBytes
ld hl, $c739 ld hl, $c739
ld de, EnemyMonPPMove1 ld de, EnemyMonPP
ld bc, $0004 ld bc, NUM_MOVES
call CopyBytes call CopyBytes
.asm_ea67 .asm_ea67
@@ -2633,11 +2633,11 @@ Functionf652: ; f652
.asm_f677 .asm_f677
ld a, [CurPartyMon] ld a, [CurPartyMon]
ld hl, PartyMon1Move1 ld hl, PartyMon1Moves
ld bc, $0030 ld bc, PartyMon2 - PartyMon1
call AddNTimes call AddNTimes
ld de, BattleMonMove1 ld de, BattleMonMoves
ld b, $4 ld b, NUM_MOVES
.asm_f688 .asm_f688
ld a, [de] ld a, [de]
and a and a
@@ -2647,13 +2647,10 @@ Functionf652: ; f652
push hl push hl
push de push de
push bc push bc
rept NUM_MOVES + 2 ; BattleMonPP - BattleMonMoves
inc de inc de
inc de endr
inc de ld bc, PartyMon1PP - PartyMon1Moves
inc de
inc de
inc de
ld bc, $0015
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
ld [de], a ld [de], a
@@ -2682,15 +2679,16 @@ Functionf6af: ; f6af
ld hl, $cfa9 ld hl, $cfa9
ld [hli], a ld [hli], a
ld [hl], a ld [hl], a
ld b, $4 ld b, NUM_MOVES
.asm_f6b7 .asm_f6b7
push bc push bc
ld hl, PartyMon1Move1 ld hl, PartyMon1Moves
ld bc, $0030 ld bc, PartyMon2 - PartyMon1
call Functionf963 call Functionf963
ld a, [hl] ld a, [hl]
and a and a
jr z, .asm_f6ce jr z, .asm_f6ce
call Functionf6e8 call Functionf6e8
jr z, .asm_f6ce jr z, .asm_f6ce
ld hl, $cfaa ld hl, $cfaa
@@ -2721,7 +2719,7 @@ Functionf6e8: ; f6e8
ld [MonType], a ld [MonType], a
call Functionf8ec call Functionf8ec
ld hl, PartyMon1PP ld hl, PartyMon1PP
ld bc, $0030 ld bc, PartyMon2 - PartyMon1
call Functionf963 call Functionf963
ld a, [$d265] ld a, [$d265]
ld b, a ld b, a
@@ -2739,6 +2737,7 @@ Functionf6e8: ; f6e8
ld c, 5 ld c, 5
cp MYSTERYBERRY cp MYSTERYBERRY
jr z, .asm_f715 jr z, .asm_f715
ld c, 10 ld c, 10
.asm_f715 .asm_f715
@@ -2985,7 +2984,7 @@ WontHaveAnyEffect_NotUsedMessage: ; f7ca
ld hl, WontHaveAnyEffectText ld hl, WontHaveAnyEffectText
call PrintText call PrintText
; Item wasn't used. ; Item wasn't used.
ld a, $2 ld a, $2
ld [$d0ec], a ld [$d0ec], a
ret ret
@@ -3000,7 +2999,7 @@ Ball_BoxIsFullMessage: ; f7dc
ld hl, Ball_BoxIsFullText ld hl, Ball_BoxIsFullText
call PrintText call PrintText
; Item wasn't used. ; Item wasn't used.
ld a, $2 ld a, $2
ld [$d0ec], a ld [$d0ec], a
ret ret
@@ -3116,21 +3115,21 @@ GotOffTheItemText: ; 0xf847
Functionf84c: ; f84c Functionf84c: ; f84c
ld a, $2 ld a, PartyMon1Moves - PartyMon1
call GetPartyParamLocation call GetPartyParamLocation
push hl push hl
ld de, MagikarpLength ld de, Buffer1
ld a, $5 ld a, PREDEF_FILLPP
call Predef call Predef
pop hl pop hl
ld bc, $0015 ld bc, PartyMon1PP - PartyMon1Moves
add hl, bc add hl, bc
ld de, MagikarpLength ld de, Buffer1
ld b, $0 ld b, 0
.asm_f864 .asm_f864
inc b inc b
ld a, b ld a, b
cp $5 cp NUM_MOVES + 1
ret z ret z
ld a, [$d265] ld a, [$d265]
dec a dec a
@@ -3157,14 +3156,14 @@ Functionf84c: ; f84c
Functionf881: ; f881 Functionf881: ; f881
push bc push bc
ld a, [de] ld a, [de]
ld [$ffb6], a ld [hDividend + 3], a
xor a xor a
ld [hProduct], a ld [hDividend], a
ld [hMultiplicand], a ld [hDividend + 1], a
ld [$ffb5], a ld [hDividend + 2], a
ld a, $5 ld a, 5
ld [hMultiplier], a ld [hDivisor], a
ld b, $4 ld b, 4
call Divide call Divide
ld a, [hl] ld a, [hl]
ld b, a ld b, a
@@ -3197,16 +3196,16 @@ Functionf881: ; f881
; f8b9 ; f8b9
Functionf8b9: ; f8b9 Functionf8b9: ; f8b9
ld a, $17 ld a, PartyMon1PP - PartyMon1
call GetPartyParamLocation call GetPartyParamLocation
push hl push hl
ld a, $2 ld a, PartyMon1Moves - PartyMon1
call GetPartyParamLocation call GetPartyParamLocation
pop de pop de
xor a xor a
ld [$cfa9], a ld [$cfa9], a
ld [MonType], a ld [MonType], a
ld c, $4 ld c, NUM_MOVES
.asm_f8ce .asm_f8ce
ld a, [hli] ld a, [hli]
and a and a
@@ -3265,21 +3264,21 @@ Functionf8ec: ; f8ec
ld a, [hl] ld a, [hl]
dec a dec a
push hl push hl
ld hl, $5b00 ld hl, Moves + MOVE_PP
ld bc, $0007 ld bc, MOVE_LENGTH
call AddNTimes call AddNTimes
ld a, $10 ld a, BANK(Moves)
call GetFarByte call GetFarByte
ld b, a ld b, a
ld de, StringBuffer1 ld de, StringBuffer1
ld [de], a ld [de], a
pop hl pop hl
push bc push bc
ld bc, $0015 ld bc, PartyMon1PP - PartyMon1Moves
ld a, [MonType] ld a, [MonType]
cp WILDMON cp WILDMON
jr nz, .asm_f942 jr nz, .asm_f942
ld bc, $0006 ld bc, EnemyMonPP - EnemyMonMoves
.asm_f942 .asm_f942
add hl, bc add hl, bc
@@ -3310,7 +3309,7 @@ Functionf963: ; f963
Functionf969: ; f969 Functionf969: ; f969
ld a, [$cfa9] ld a, [$cfa9]
ld c, a ld c, a
ld b, $0 ld b, 0
add hl, bc add hl, bc
ret ret
; f971 ; 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 \1Species:: db
\1Item:: db \1Item:: db
\1Moves:: \1Moves:: ds NUM_MOVES
\1Move1:: db
\1Move2:: db
\1Move3:: db
\1Move4:: db
\1ID:: dw \1ID:: dw
\1Exp:: ds 3 ; Big endian \1Exp:: ds 3 ; Big endian
@@ -25,11 +21,7 @@ party_struct: MACRO
\1AtkDefDV:: db \1AtkDefDV:: db
\1SpdSpcDV:: db \1SpdSpcDV:: db
\1PP:: \1PP:: ds NUM_MOVES
\1PPMove1:: db
\1PPMove2:: db
\1PPMove3:: db
\1PPMove4:: db
\1Happiness:: db \1Happiness:: db
\1PokerusStatus:: db \1PokerusStatus:: db
@@ -483,15 +475,8 @@ BattleMonSpecies:: ; c62c
BattleMonItem:: ; c62d BattleMonItem:: ; c62d
ds 1 ds 1
BattleMonMoves:: BattleMonMoves:: ; c62e
BattleMonMove1:: ; c62e ds NUM_MOVES
ds 1
BattleMonMove2:: ; c62f
ds 1
BattleMonMove3:: ; c630
ds 1
BattleMonMove4:: ; c631
ds 1
BattleMonDVs:: BattleMonDVs::
BattleMonAtkDefDV:: ; c632 BattleMonAtkDefDV:: ; c632
@@ -499,15 +484,8 @@ BattleMonAtkDefDV:: ; c632
BattleMonSpdSpclDV:: ; c633 BattleMonSpdSpclDV:: ; c633
ds 1 ds 1
BattleMonPP:: BattleMonPP:: ; c634
BattleMonPPMove1:: ; c634 ds NUM_MOVES
ds 1
BattleMonPPMove2:: ; c635
ds 1
BattleMonPPMove3:: ; c636
ds 1
BattleMonPPMove4:: ; c637
ds 1
BattleMonHappiness:: ; c638 BattleMonHappiness:: ; c638
ds 1 ds 1
@@ -736,7 +714,14 @@ EnemyTurnsTaken:: ; c6dc
PlayerTurnsTaken:: ; c6dd PlayerTurnsTaken:: ; c6dd
ds 1 ds 1
ds 5 ds 1
PlayerSubstituteHP:: ; c6df
ds 1
EnemySubstituteHP:: ; c6e0
ds 1
ds 2
CurPlayerMove:: ; c6e3 CurPlayerMove:: ; c6e3
ds 1 ds 1
@@ -788,15 +773,17 @@ EnemyScreens:: ; c700
; see PlayerScreens ; see PlayerScreens
ds 1 ds 1
PlayerSafeguardCount:: ; c701
ds 1 ds 1
PlayerLightScreenCount:: ; c702 PlayerLightScreenCount:: ; c702
ds 1 ds 1
PlayerReflectCount:: ; c703 PlayerReflectCount:: ; c703
ds 1 ds 1
ds 2 ds 1
EnemySafeguardCount:: ; c705
ds 1
EnemyLightScreenCount:: ; c706 EnemyLightScreenCount:: ; c706
ds 1 ds 1
EnemyReflectCount:: ; c707 EnemyReflectCount:: ; c707
@@ -1083,70 +1070,7 @@ CurPartyMon:: ; d109
ds 4 ds 4
TempMon:: TempMon::
TempMonSpecies:: ; d10e party_struct TempMon
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
TempMonEnd:: ; d13e TempMonEnd:: ; d13e
ds 3 ds 3
@@ -1316,15 +1240,8 @@ EnemyMonSpecies:: ; d206
EnemyMonItem:: ; d207 EnemyMonItem:: ; d207
ds 1 ds 1
EnemyMonMoves:: EnemyMonMoves:: ; d208
EnemyMonMove1:: ; d208 ds NUM_MOVES
ds 1
EnemyMonMove2:: ; d209
ds 1
EnemyMonMove3:: ; d20a
ds 1
EnemyMonMove4:: ; d20b
ds 1
EnemyMonMovesEnd:: EnemyMonMovesEnd::
EnemyMonDVs:: EnemyMonDVs::
@@ -1333,16 +1250,9 @@ EnemyMonAtkDefDV:: ; d20c
EnemyMonSpdSpclDV:: ; d20d EnemyMonSpdSpclDV:: ; d20d
ds 1 ds 1
EnemyMonPP:: EnemyMonPP:: ; d20e
EnemyMonPPMove1:: ; d20e ds NUM_MOVES
ds 1
EnemyMonPPMove2:: ; d20f
ds 1
EnemyMonPPMove3:: ; d210
ds 1
EnemyMonPPMove4:: ; d211
ds 1
EnemyMonHappiness:: ; d212 EnemyMonHappiness:: ; d212
ds 1 ds 1
EnemyMonLevel:: ; d213 EnemyMonLevel:: ; d213
@@ -1729,7 +1639,10 @@ StatusFlags2:: ; d84d
Money:: ; d84e Money:: ; d84e
ds 3 ds 3
ds 4 wMomsMoney:: ; d851
ds 3
wMomSavingMoney:: ; d854
ds 1
Coins:: ; d855 Coins:: ; d855
ds 2 ds 2
@@ -2087,7 +2000,7 @@ EggNick:: ; df65
ds 11 ds 11
EggOT:: ; df70 EggOT:: ; df70
ds 11 ds 11
EggStats:: EggMon::
EggSpecies:: ; df7b EggSpecies:: ; df7b
ds 1 ds 1
ds 31 ds 31