More WRAM tidying

This commit is contained in:
PikalaxALT 2016-01-12 12:46:18 -05:00
parent 35f687b536
commit 2ed6c357af
42 changed files with 1309 additions and 1365 deletions

View File

@ -549,7 +549,7 @@ AIUpdateHUD: ; 38387
callba UpdateEnemyHUD
ld a, $1
ld [hBGMapMode], a
ld hl, wc6e6
ld hl, wEnemyItemState
dec [hl]
scf
ret

View File

@ -982,7 +982,7 @@ AI_Smart_Whirlwind: ; 38a2a
push hl
callab CheckPlayerMoveTypeMatchups
ld a, [wc716]
ld a, [wEnemyAISwitchScore]
cp 10 ; neutral
pop hl
ret c
@ -1909,7 +1909,7 @@ AI_Smart_MeanLook: ; 38dfb
; Otherwise, discourage this move unless the player only has not very effective moves against the enemy.
push hl
callab CheckPlayerMoveTypeMatchups
ld a, [wc716]
ld a, [wEnemyAISwitchScore]
cp $b ; not very effective
pop hl
ret nc
@ -2170,7 +2170,7 @@ AI_Smart_PerishSong: ; 38f4a
push hl
callab CheckPlayerMoveTypeMatchups
ld a, [wc716]
ld a, [wEnemyAISwitchScore]
cp 10 ; 1.0
pop hl
ret c
@ -2432,7 +2432,7 @@ AI_Smart_BatonPass: ; 39062
push hl
callab CheckPlayerMoveTypeMatchups
ld a, [wc716]
ld a, [wEnemyAISwitchScore]
cp 10 ; neutral
pop hl
ret c

View File

@ -6,7 +6,7 @@ CheckPlayerMoveTypeMatchups: ; 3484e
push de
push bc
ld a, 10
ld [wc716], a
ld [wEnemyAISwitchScore], a
ld hl, PlayerUsedMoves
ld a, [hl]
and a
@ -167,17 +167,17 @@ endr
.DecreaseScore: ; 34931
ld a, [wc716]
ld a, [wEnemyAISwitchScore]
dec a
ld [wc716], a
ld [wEnemyAISwitchScore], a
ret
; 34939
.IncreaseScore: ; 34939
ld a, [wc716]
ld a, [wEnemyAISwitchScore]
inc a
ld [wc716], a
ld [wEnemyAISwitchScore], a
ret
; 34941
@ -206,7 +206,7 @@ CheckAbleToSwitch: ; 34941
cp 2
jr nz, .not_2
ld a, [wc716]
ld a, [wEnemyAISwitchScore]
add $30
ld [wEnemySwitchMonParam], a
ret
@ -230,7 +230,7 @@ CheckAbleToSwitch: ; 34941
.no_perish
call CheckPlayerMoveTypeMatchups
ld a, [wc716]
ld a, [wEnemyAISwitchScore]
cp 11
ret nc
@ -239,13 +239,13 @@ CheckAbleToSwitch: ; 34941
jr z, .no_last_counter_move
call Function34a2a
ld a, [wc716]
ld a, [wEnemyAISwitchScore]
and a
jr z, .no_last_counter_move
ld c, a
call Function34aa7
ld a, [wc716]
ld a, [wEnemyAISwitchScore]
cp $ff
ret z
@ -255,7 +255,7 @@ CheckAbleToSwitch: ; 34941
jr z, .not_2_again
call CheckPlayerMoveTypeMatchups
ld a, [wc716]
ld a, [wEnemyAISwitchScore]
cp 10
ret nc
@ -267,7 +267,7 @@ CheckAbleToSwitch: ; 34941
.not_2_again
ld c, $10
call CheckPlayerMoveTypeMatchups
ld a, [wc716]
ld a, [wEnemyAISwitchScore]
cp 10
jr nc, .okay
ld c, $20
@ -280,7 +280,7 @@ CheckAbleToSwitch: ; 34941
.no_last_counter_move
call CheckPlayerMoveTypeMatchups
ld a, [wc716]
ld a, [wEnemyAISwitchScore]
cp 10
ret nc
@ -293,7 +293,7 @@ CheckAbleToSwitch: ; 34941
cp $2
ret nz
ld a, [wc716]
ld a, [wEnemyAISwitchScore]
add $10
ld [wEnemySwitchMonParam], a
ret
@ -359,7 +359,7 @@ Function34a2a: ; 34a2a
ld c, 1 << (PARTY_LENGTH - 1)
ld d, 0
xor a
ld [wc716], a
ld [wEnemyAISwitchScore], a
.asm_34a39
ld a, [CurOTMon]
@ -395,9 +395,9 @@ Function34a2a: ; 34a2a
and a
jr nz, .asm_34a77
ld a, [wc716]
ld a, [wEnemyAISwitchScore]
or c
ld [wc716], a
ld [wEnemyAISwitchScore], a
.asm_34a77
pop hl
dec b
@ -451,7 +451,7 @@ Function34a85: ; 34a85
Function34aa7: ; 34aa7
ld a, $ff
ld [wc716], a
ld [wEnemyAISwitchScore], a
ld hl, OTPartyMon1Moves
ld b, 1 << (PARTY_LENGTH - 1)
ld d, 0
@ -540,7 +540,7 @@ Function34aa7: ; 34aa7
jr nc, .loop2
ld a, c
ld [wc716], a
ld [wEnemyAISwitchScore], a
pop bc
ret
; 34b20

View File

@ -748,7 +748,7 @@ endr
jr z, .clear
cp -3
jr z, .skip
call .FillBox
call .PlaceGraphic
.skip
call BattleBGEffects_IncrementJumptable
ld a, $1
@ -798,7 +798,7 @@ endr
pop bc
ret
.FillBox
.PlaceGraphic
; get dims
push bc
push hl

View File

@ -3,7 +3,7 @@ BattleCore:
DoBattle: ; 3c000
xor a
ld [wBattleParticipantsNotFainted], a
ld [wc6fc], a
ld [wBattleParticipantsIncludingFainted], a
ld [wPlayerAction], a
ld [BattleEnded], a
inc a
@ -2110,8 +2110,8 @@ HandleEnemyMonFaint: ; 3cd55
or [hl]
call z, FaintYourPokemon
xor a
ld [wc6f7], a
call Function3ce01
ld [wWhichMonFaintedFirst], a
call UpdateBattleStateAndExperienceAfterEnemyFaint
call CheckPlayerPartyForFitPkmn
ld a, d
and a
@ -2202,7 +2202,7 @@ DoubleSwitch: ; 3cdca
ret
; 3ce01
Function3ce01: ; 3ce01
UpdateBattleStateAndExperienceAfterEnemyFaint: ; 3ce01
call UpdateBattleMonInParty
ld a, [wBattleMode]
dec a
@ -2231,14 +2231,14 @@ Function3ce01: ; 3ce01
.wild2
call StopDangerSound
ld a, $1
ld [wc6fd], a
ld [wDanger], a
.trainer
ld hl, BattleMonHP
ld a, [hli]
or [hl]
jr nz, .player_mon_did_not_faint
ld a, [wc6f7]
ld a, [wWhichMonFaintedFirst]
and a
jr nz, .player_mon_did_not_faint
call PlayerMonFaintHappinessMod
@ -2256,10 +2256,10 @@ Function3ce01: ; 3ce01
ld a, [wBattleResult]
and $c0
ld [wBattleResult], a
call DoOthersShareExperience
call IsAnyMonHoldingExpShare
jr z, .skip_exp
ld hl, EnemyMonBaseStats
ld b, $7
ld b, EnemyMonEnd - EnemyMonBaseStats
.loop
srl [hl]
inc hl
@ -2268,32 +2268,32 @@ Function3ce01: ; 3ce01
.skip_exp
ld hl, EnemyMonBaseStats
ld de, wc720
ld de, wBackupEnemyMonBaseStats
ld bc, EnemyMonEnd - EnemyMonBaseStats
call CopyBytes
xor a
ld [wc71f], a
ld [wGivingExperienceToExpShareHolders], a
call GiveExperiencePoints
call DoOthersShareExperience
call IsAnyMonHoldingExpShare
ret z
ld a, [wBattleParticipantsNotFainted]
push af
ld a, d
ld [wBattleParticipantsNotFainted], a
ld hl, wc720
ld hl, wBackupEnemyMonBaseStats
ld de, EnemyMonBaseStats
ld bc, EnemyMonEnd - EnemyMonBaseStats
call CopyBytes
ld a, $1
ld [wc71f], a
ld [wGivingExperienceToExpShareHolders], a
call GiveExperiencePoints
pop af
ld [wBattleParticipantsNotFainted], a
ret
; 3ceaa
DoOthersShareExperience: ; 3ceaa
IsAnyMonHoldingExpShare: ; 3ceaa
ld a, [PartyCount]
ld b, a
ld hl, PartyMon1
@ -2465,7 +2465,7 @@ WinTrainerBattle: ; 3cfa4
; Player won the battle
call StopDangerSound
ld a, $1
ld [wc6fd], a
ld [wDanger], a
ld [BattleEnded], a
ld a, [wLinkMode]
and a
@ -2682,7 +2682,7 @@ PlayVictoryMusic: ; 3d0ea
dec a
jr nz, .trainer_victory
push de
call DoOthersShareExperience
call IsAnyMonHoldingExpShare
pop de
jr nz, .play_music
ld hl, wPayDayMoney
@ -2771,7 +2771,7 @@ HandlePlayerMonFaint: ; 3d14e
or [hl]
call z, FaintEnemyPokemon
ld a, $1
ld [wc6f7], a
ld [wWhichMonFaintedFirst], a
call PlayerMonFaintHappinessMod
call CheckPlayerPartyForFitPkmn
ld a, d
@ -2781,7 +2781,7 @@ HandlePlayerMonFaint: ; 3d14e
ld a, [hli]
or [hl]
jr nz, .notfainted
call Function3ce01
call UpdateBattleStateAndExperienceAfterEnemyFaint
ld a, [wBattleMode]
dec a
jr nz, .trainer
@ -2847,7 +2847,7 @@ PlayerMonFaintHappinessMod: ; 3d1aa
and %11000000
add $1
ld [wBattleResult], a
ld a, [wc6f7]
ld a, [wWhichMonFaintedFirst]
and a
ret z
ret ; ??????????
@ -3338,7 +3338,7 @@ EnemySwitch: ; 3d4e1
; If we're here, then we're switching too
xor a
ld [wBattleParticipantsNotFainted], a
ld [wc6fc], a
ld [wBattleParticipantsIncludingFainted], a
ld [wPlayerAction], a
inc a
ld [wEnemyIsSwitching], a
@ -3403,7 +3403,7 @@ ResetEnemyBattleVars: ; 3d557
ld [LastEnemyMove], a
ld [CurEnemyMove], a
dec a
ld [wc6e6], a
ld [wEnemyItemState], a
xor a
ld [wPlayerWrapCount], a
hlcoord 18, 0
@ -3416,7 +3416,7 @@ ResetEnemyBattleVars: ; 3d557
ResetBattleParticipants: ; 3d57a
xor a
ld [wBattleParticipantsNotFainted], a
ld [wc6fc], a
ld [wBattleParticipantsIncludingFainted], a
AddBattleParticipant: ; 3d581
ld a, [CurBattleMon]
ld c, a
@ -3425,7 +3425,7 @@ AddBattleParticipant: ; 3d581
push bc
predef FlagPredef
pop bc
ld hl, wc6fc
ld hl, wBattleParticipantsIncludingFainted
predef_jump FlagPredef
; 3d599
@ -4250,7 +4250,7 @@ SendOutPlayerMon: ; 3db5f
ld [hBGMapMode], a
call GetMonBackpic
xor a
ld [hFillBox], a
ld [hGraphicStartTile], a
ld [wd0d2], a
ld [CurMoveNum], a
ld [TypeModifier], a
@ -4418,7 +4418,7 @@ PursuitSwitch: ; 3dc5b
ld [CryTracks], a
ld a, [BattleMonSpecies]
call PlayStereoCry
ld a, [wc71a]
ld a, [LastPlayerMon]
ld c, a
ld hl, wBattleParticipantsNotFainted
ld b, RESET_FLAG
@ -4887,7 +4887,7 @@ CheckDanger: ; 3df9e
ld a, [hli]
or [hl]
jr z, .no_danger
ld a, [wc6fd]
ld a, [wDanger]
and a
jr nz, .done
ld a, [PlayerHPPal]
@ -5771,7 +5771,7 @@ MoveSelectionScreen: ; 3e4bc
dec a
cp c
jr z, .move_disabled
ld a, [wc6e1]
ld a, [wUnusedPlayerLockedMove]
and a
jr nz, .skip2
ld a, [wMenuCursorY]
@ -7383,7 +7383,7 @@ GiveExperiencePoints: ; 3ee3b
bit 0, a
ret nz
call Function3f0d4
call .EvenlyDivideExpAmongParticipants
xor a
ld [CurPartyMon], a
ld bc, PartyMon1Species
@ -7407,6 +7407,7 @@ GiveExperiencePoints: ; 3ee3b
pop bc
jp z, .skip_stats
; give stat exp
ld hl, MON_STAT_EXP + 1
add hl, bc
ld d, h
@ -7472,6 +7473,7 @@ GiveExperiencePoints: ; 3ee3b
ld [hDivisor], a
ld b, 4
call Divide
; Boost Experience for traded Pokemon
pop bc
ld hl, MON_ID
add hl, bc
@ -7489,10 +7491,12 @@ GiveExperiencePoints: ; 3ee3b
ld a, $1
.no_boost
; Boost experience for a Trainer Battle
ld [StringBuffer2 + 2], a
ld a, [wBattleMode]
dec a
call nz, BoostExp
; Boost experience for Lucky Egg
push bc
ld a, MON_ITEM
call GetPartyParamLocation
@ -7513,7 +7517,7 @@ GiveExperiencePoints: ; 3ee3b
ld a, [StringBuffer2]
ld [hQuotient + 1], a
pop bc
call Function3f136
call AnimateExpBar
push bc
call LoadTileMapToTempTileMap
pop bc
@ -7748,26 +7752,26 @@ GiveExperiencePoints: ; 3ee3b
jp ResetBattleParticipants
; 3f0d4
Function3f0d4: ; 3f0d4
.EvenlyDivideExpAmongParticipants
; count number of battle participants
ld a, [wBattleParticipantsNotFainted]
ld b, a
ld c, PARTY_LENGTH
ld d, 0
.loop
.count_loop
xor a
srl b
adc d
ld d, a
dec c
jr nz, .loop
jr nz, .count_loop
cp 2
ret c
ld [wd265], a
ld hl, EnemyMonBaseStats
ld c, EnemyMonEnd - EnemyMonBaseStats
.loop2
.count_loop2
xor a
ld [hDividend + 0], a
ld a, [hl]
@ -7779,7 +7783,7 @@ Function3f0d4: ; 3f0d4
ld a, [hQuotient + 2]
ld [hli], a
dec c
jr nz, .loop2
jr nz, .count_loop2
ret
; 3f106
@ -7827,7 +7831,7 @@ TextJump_StringBuffer2ExpPoints: ; 3f131
; 3f136
Function3f136: ; 3f136
AnimateExpBar: ; 3f136
push bc
ld hl, CurPartyMon
@ -7864,15 +7868,15 @@ Function3f136: ; 3f136
ld a, [wd003]
adc [hl]
ld [hld], a
jr nc, .asm_3f186
jr nc, .NoOverflow
inc [hl]
jr nz, .asm_3f186
jr nz, .NoOverflow
ld a, $ff
ld [hli], a
ld [hli], a
ld [hl], a
.asm_3f186
.NoOverflow
ld d, MAX_LEVEL
callab CalcExpAtLevel
ld a, [hProduct + 1]
@ -7888,7 +7892,7 @@ Function3f136: ; 3f136
sbc c
ld a, [hl]
sbc b
jr c, .asm_3f1a8
jr c, .AlreadyAtMaxExp
ld a, b
ld [hli], a
ld a, c
@ -7896,37 +7900,37 @@ Function3f136: ; 3f136
ld a, d
ld [hld], a
.asm_3f1a8
.AlreadyAtMaxExp
callab CalcLevel
ld a, d
pop bc
pop de
ld d, a
cp e
jr nc, .asm_3f1b7
jr nc, .LoopLevels
ld a, e
ld d, a
.asm_3f1b7
.LoopLevels
ld a, e
cp MAX_LEVEL
jr nc, .asm_3f1ff
jr nc, .FinishExpBar
cp d
jr z, .asm_3f1ff
jr z, .FinishExpBar
inc a
ld [TempMonLevel], a
ld [CurPartyLevel], a
ld [BattleMonLevel], a
push de
call Function3f21b
call .PlayExpBarSound
ld c, $40
call Function3f22c
call .LoopBarAnimation
call PrintPlayerHUD
ld hl, BattleMonNick
ld de, StringBuffer1
ld bc, PKMN_NAME_LENGTH
call CopyBytes
call Function3dfe
call TerminateExpBarSound
ld de, SFX_HIT_END_OF_EXP_BAR
call PlaySFX
callba AnimateEndOfExpBar
@ -7936,9 +7940,9 @@ Function3f136: ; 3f136
pop de
inc e
ld b, $0
jr .asm_3f1b7
jr .LoopLevels
.asm_3f1ff
.FinishExpBar
push bc
ld b, d
ld de, TempMonExp + 2
@ -7946,9 +7950,9 @@ Function3f136: ; 3f136
ld a, b
pop bc
ld c, a
call Function3f21b
call Function3f22c
call Function3dfe
call .PlayExpBarSound
call .LoopBarAnimation
call TerminateExpBarSound
pop af
ld [hProduct + 2], a
pop af
@ -7957,9 +7961,8 @@ Function3f136: ; 3f136
.finish
pop bc
ret
; 3f21b
Function3f21b: ; 3f21b
.PlayExpBarSound
push bc
call WaitSFX
ld de, SFX_EXP_BAR
@ -7968,12 +7971,11 @@ Function3f21b: ; 3f21b
call DelayFrames
pop bc
ret
; 3f22c
Function3f22c: ; 3f22c
ld d, $3
.LoopBarAnimation
ld d, 3
dec b
.asm_3f22f
.anim_loop
inc b
push bc
push de
@ -7989,7 +7991,7 @@ Function3f22c: ; 3f22c
pop bc
ld a, c
cp b
jr z, .asm_3f268
jr z, .end_animation
inc b
push bc
push de
@ -8003,16 +8005,14 @@ Function3f22c: ; 3f22c
xor a
ld [hBGMapMode], a
dec d
jr nz, .asm_3f263
ld d, $1
.asm_3f263
jr nz, .min_number_of_frames
ld d, 1
.min_number_of_frames
pop bc
ld a, c
cp b
jr nz, .asm_3f22f
.asm_3f268
jr nz, .anim_loop
.end_animation
ld a, $1
ld [hBGMapMode], a
ret
@ -8575,12 +8575,12 @@ InitEnemyTrainer: ; 3f594
ld de, VTiles2
callab GetTrainerPic
xor a
ld [hFillBox], a
ld [hGraphicStartTile], a
dec a
ld [wc6e6], a
ld [wEnemyItemState], a
hlcoord 12, 0
lb bc, 7, 7
predef FillBox
predef PlaceGraphic
ld a, -1
ld [CurOTMon], a
ld a, TRAINER_BATTLE
@ -8640,10 +8640,10 @@ InitEnemyWildmon: ; 3f607
predef FrontpicPredef
xor a
ld [TrainerClass], a
ld [hFillBox], a
ld [hGraphicStartTile], a
hlcoord 12, 0
lb bc, 7, 7
predef FillBox
predef PlaceGraphic
ret
; 3f662
@ -9402,10 +9402,10 @@ InitBattleDisplay: ; 3fb6c
ld a, $1
ld [hBGMapMode], a
ld a, $31
ld [hFillBox], a
ld [hGraphicStartTile], a
hlcoord 2, 6
lb bc, 6, 6
predef FillBox
predef PlaceGraphic
xor a
ld [hWY], a
ld [rWY], a
@ -9499,10 +9499,10 @@ CopyBackpic: ; 3fc30
ld [rSVBK], a
call Function3fc5b
ld a, $31
ld [hFillBox], a
ld [hGraphicStartTile], a
hlcoord 2, 6
lb bc, 6, 6
predef FillBox
predef PlaceGraphic
ret
; 3fc5b

View File

@ -3155,7 +3155,7 @@ BattleCommand_BeatUp: ; 35461
xor a
ld [PlayerRolloutCount], a
ld [wd002], a
ld [wc72d], a
ld [wBeatUpHitAtLeastOnce], a
jr .got_mon
.next_mon
@ -3188,7 +3188,7 @@ BattleCommand_BeatUp: ; 35461
jp nz, .beatup_fail
ld a, $1
ld [wc72d], a
ld [wBeatUpHitAtLeastOnce], a
ld hl, BeatUpAttackText
call StdBattleTextBox
ld a, [EnemyMonSpecies]
@ -3223,7 +3223,7 @@ BattleCommand_BeatUp: ; 35461
xor a
ld [EnemyRolloutCount], a
ld [wd002], a
ld [wc72d], a
ld [wBeatUpHitAtLeastOnce], a
jr .enemy_continue
.not_first_enemy_beatup
@ -3283,7 +3283,7 @@ BattleCommand_BeatUp: ; 35461
jr nz, .beatup_fail
ld a, $1
ld [wc72d], a
ld [wBeatUpHitAtLeastOnce], a
jr .finish_beatup
.wild
@ -3332,7 +3332,7 @@ BattleCommand_BeatUp: ; 35461
BattleCommanda8: ; 355b5
ld a, [wc72d]
ld a, [wBeatUpHitAtLeastOnce]
and a
ret nz

View File

@ -32,8 +32,8 @@ AppearUser: ; fbd77 (3e:7d77)
call GetPlayerBackpicCoords
ld a, $31
.okay
ld [hFillBox], a
predef FillBox
ld [hGraphicStartTile], a
predef PlaceGraphic
FinishAppearDisappearUser: ; fbd91 (3e:7d91)
ld a, $1
ld [hBGMapMode], a

View File

@ -668,36 +668,37 @@ EMOTE_OBJECT EQU 7
; fruit trees
const_value SET 1
const FRUITTREE_ROUTE_29
const FRUITTREE_ROUTE_30_1
const FRUITTREE_ROUTE_38
const FRUITTREE_ROUTE_46_1
const FRUITTREE_ROUTE_30_2
const FRUITTREE_ROUTE_33
const FRUITTREE_ROUTE_31
const FRUITTREE_ROUTE_43
const FRUITTREE_VIOLET_CITY
const FRUITTREE_ROUTE_46_2
const FRUITTREE_ROUTE_35
const FRUITTREE_ROUTE_45
const FRUITTREE_ROUTE_36
const FRUITTREE_ROUTE_26
const FRUITTREE_ROUTE_39
const FRUITTREE_ROUTE_44
const FRUITTREE_ROUTE_37_1
const FRUITTREE_ROUTE_37_2
const FRUITTREE_ROUTE_37_3
const FRUITTREE_AZALEA_TOWN
const FRUITTREE_ROUTE_42_1
const FRUITTREE_ROUTE_42_2
const FRUITTREE_ROUTE_42_3
const FRUITTREE_ROUTE_11
const FRUITTREE_ROUTE_2
const FRUITTREE_ROUTE_1
const FRUITTREE_ROUTE_8
const FRUITTREE_PEWTER_CITY_1
const FRUITTREE_PEWTER_CITY_2
const FRUITTREE_FUCHSIA_CITY
const FRUITTREE_ROUTE_29 ; 01
const FRUITTREE_ROUTE_30_1 ; 02
const FRUITTREE_ROUTE_38 ; 03
const FRUITTREE_ROUTE_46_1 ; 04
const FRUITTREE_ROUTE_30_2 ; 05
const FRUITTREE_ROUTE_33 ; 06
const FRUITTREE_ROUTE_31 ; 07
const FRUITTREE_ROUTE_43 ; 08
const FRUITTREE_VIOLET_CITY ; 09
const FRUITTREE_ROUTE_46_2 ; 0a
const FRUITTREE_ROUTE_35 ; 0b
const FRUITTREE_ROUTE_45 ; 0c
const FRUITTREE_ROUTE_36 ; 0d
const FRUITTREE_ROUTE_26 ; 0e
const FRUITTREE_ROUTE_39 ; 0f
const FRUITTREE_ROUTE_44 ; 10
const FRUITTREE_ROUTE_37_1 ; 11
const FRUITTREE_ROUTE_37_2 ; 12
const FRUITTREE_ROUTE_37_3 ; 13
const FRUITTREE_AZALEA_TOWN ; 14
const FRUITTREE_ROUTE_42_1 ; 15
const FRUITTREE_ROUTE_42_2 ; 16
const FRUITTREE_ROUTE_42_3 ; 17
const FRUITTREE_ROUTE_11 ; 18
const FRUITTREE_ROUTE_2 ; 19
const FRUITTREE_ROUTE_1 ; 1a
const FRUITTREE_ROUTE_8 ; 1b
const FRUITTREE_PEWTER_CITY_1 ; 1c
const FRUITTREE_PEWTER_CITY_2 ; 1d
const FRUITTREE_FUCHSIA_CITY ; 1e
NUM_FRUIT_TREES EQU const_value +- 1
CMDQUEUE_TYPE EQU 0
CMDQUEUE_ADDR EQU 1

View File

@ -677,9 +677,9 @@ Hatch_UpdateFrontpicBGMapCenter: ; 17254 (5:7254)
ld a, b
ld [hBGMapAddress + 1], a
ld a, c
ld [hFillBox], a
ld [hGraphicStartTile], a
lb bc, 7, 7
predef FillBox
predef PlaceGraphic
pop af
call Hatch_LoadFrontpicPal
call SetPalettes

View File

@ -401,10 +401,10 @@ Function81adb: ; 81adb
ld de, VTiles2 tile $31
predef GetBackpic
ld a, $31
ld [hFillBox], a
ld [hGraphicStartTile], a
hlcoord 2, 4
lb bc, 6, 6
predef FillBox
predef PlaceGraphic
ld a, [wd003]
and a
jr z, .asm_81b66
@ -433,10 +433,10 @@ Function81adb: ; 81adb
callab GetTrainerPic
xor a
ld [TempEnemyMonSpecies], a
ld [hFillBox], a
ld [hGraphicStartTile], a
hlcoord 2, 3
lb bc, 7, 7
predef FillBox
predef PlaceGraphic
.asm_81ba9
ld a, $1

View File

@ -108,7 +108,7 @@ ENDM
engine_flag wMomSavingMoney, 0 ; mom saving money ; $8
engine_flag wMomSavingMoney, 7 ; dst
engine_flag wdc39, 0 ; unused, possibly related to a 2-day timer
engine_flag wUnusedTwoDayTimerOn, 0 ; unused, possibly related to a 2-day timer
engine_flag StatusFlags, 0 ; pokedex
engine_flag StatusFlags, 1 ; unown dex

View File

@ -124,8 +124,8 @@ StartMap: ; 96724
call ClearJoypad
EnterMap: ; 9673e
xor a
ld [wd453], a
ld [wd454], a
ld [wXYComparePointer], a
ld [wXYComparePointer + 1], a
call SetUpFiveStepWildEncounterCooldown
callba RunMapSetupScript
call DisableEvents

View File

@ -288,7 +288,7 @@ CheckForHiddenItems: ; b8172
add SCREEN_HEIGHT / 4
ld [wd1ec], a
; Get the pointer for the first signpost header in the map...
ld hl, wdc02
ld hl, wCurrentMapSignpostHeaderPointer
ld a, [hli]
ld h, [hl]
ld l, a

View File

@ -6,7 +6,6 @@ EvolvePokemon: ; 421d8
ld c, a
ld b, SET_FLAG
call EvoFlagAction
EvolveAfterBattle: ; 421e6
xor a
ld [wMonTriedToEvolve], a
@ -19,7 +18,7 @@ EvolveAfterBattle: ; 421e6
push hl
CheckForEvolvablePokemon: ; 421f5
EvolveAfterBattle_MasterLoop
ld hl, CurPartyMon
inc [hl]
@ -28,7 +27,7 @@ CheckForEvolvablePokemon: ; 421f5
inc hl
ld a, [hl]
cp $ff
jp z, Evolution_ReturnToMap
jp z, .ReturnToMap
ld [Buffer1], a
@ -40,7 +39,7 @@ CheckForEvolvablePokemon: ; 421f5
call EvoFlagAction
ld a, c
and a
jp z, CheckForEvolvablePokemon
jp z, EvolveAfterBattle_MasterLoop
ld a, [Buffer1]
dec a
@ -63,7 +62,7 @@ endr
.loop
ld a, [hli]
and a
jr z, CheckForEvolvablePokemon
jr z, EvolveAfterBattle_MasterLoop
ld b, a
@ -324,7 +323,7 @@ endr
push hl
ld l, e
ld h, d
jp CheckForEvolvablePokemon
jp EvolveAfterBattle_MasterLoop
; 423f8
.dont_evolve_1
@ -334,12 +333,10 @@ endr
.dont_evolve_3
inc hl
jp .loop
; 423fe
; dummy pop
; XXX
pop hl
Evolution_ReturnToMap: ; 423ff
.ReturnToMap
pop de
pop bc
pop hl
@ -393,7 +390,7 @@ CancelEvolution: ; 42454
call PrintText
call ClearTileMap
pop hl
jp CheckForEvolvablePokemon
jp EvolveAfterBattle_MasterLoop
; 42461
IsMonHoldingEverstone: ; 42461

View File

@ -947,10 +947,10 @@ Intro_PrepTrainerPic: ; 619c
ld de, VTiles2
callba GetTrainerPic
xor a
ld [hFillBox], a
ld [hGraphicStartTile], a
hlcoord 6, 4
lb bc, 7, 7
predef FillBox
predef PlaceGraphic
ret
; 61b4
@ -959,10 +959,10 @@ ShrinkFrame: ; 61b4
ld c, $31
predef DecompressPredef
xor a
ld [hFillBox], a
ld [hGraphicStartTile], a
hlcoord 6, 4
lb bc, 7, 7
predef FillBox
predef PlaceGraphic
ret
; 61cd

View File

@ -430,21 +430,22 @@ GetTradeMonNames: ; fce1b
NPCTrades: ; fce58
npctrade: MACRO
db \1, \2, \3, \4
dw \5
db \6
dw \7
db \8, \9, 0
db \1, \2, \3, \4 ; dialog set, requested mon, offered mon, nickname
db \5, \6 ; dvs
shift
db \6 ; item
dw \7 ; OT ID
db \8, \9, 0 ; OT name, gender requested
ENDM
npctrade 0, ABRA, MACHOP, "MUSCLE@@@@@", $6637, GOLD_BERRY, 37460, "MIKE@@@@@@@", TRADE_EITHER_GENDER
npctrade 0, BELLSPROUT, ONIX, "ROCKY@@@@@@", $6696, BITTER_BERRY, 48926, "KYLE@@@@@@@", TRADE_EITHER_GENDER
npctrade 1, KRABBY, VOLTORB, "VOLTY@@@@@@", $8898, PRZCUREBERRY, 29189, "TIM@@@@@@@@", TRADE_EITHER_GENDER
npctrade 3, DRAGONAIR, DODRIO, "DORIS@@@@@@", $6677, SMOKE_BALL, 00283, "EMY@@@@@@@@", TRADE_FEMALE_ONLY
npctrade 2, HAUNTER, XATU, "PAUL@@@@@@@", $8696, MYSTERYBERRY, 15616, "CHRIS@@@@@@", TRADE_EITHER_GENDER
npctrade 3, CHANSEY, AERODACTYL, "AEROY@@@@@@", $6696, GOLD_BERRY, 26491, "KIM@@@@@@@@", TRADE_EITHER_GENDER
npctrade 0, DUGTRIO, MAGNETON, "MAGGIE@@@@@", $6696, METAL_COAT, 50082, "FOREST@@@@@", TRADE_EITHER_GENDER
npctrade 0, ABRA, MACHOP, "MUSCLE@@@@@", $37, $66, GOLD_BERRY, 37460, "MIKE@@@@@@@", TRADE_EITHER_GENDER
npctrade 0, BELLSPROUT, ONIX, "ROCKY@@@@@@", $96, $66, BITTER_BERRY, 48926, "KYLE@@@@@@@", TRADE_EITHER_GENDER
npctrade 1, KRABBY, VOLTORB, "VOLTY@@@@@@", $98, $88, PRZCUREBERRY, 29189, "TIM@@@@@@@@", TRADE_EITHER_GENDER
npctrade 3, DRAGONAIR, DODRIO, "DORIS@@@@@@", $77, $66, SMOKE_BALL, 00283, "EMY@@@@@@@@", TRADE_FEMALE_ONLY
npctrade 2, HAUNTER, XATU, "PAUL@@@@@@@", $96, $86, MYSTERYBERRY, 15616, "CHRIS@@@@@@", TRADE_EITHER_GENDER
npctrade 3, CHANSEY, AERODACTYL, "AEROY@@@@@@", $96, $66, GOLD_BERRY, 26491, "KIM@@@@@@@@", TRADE_EITHER_GENDER
npctrade 0, DUGTRIO, MAGNETON, "MAGGIE@@@@@", $96, $66, METAL_COAT, 50082, "FOREST@@@@@", TRADE_EITHER_GENDER
; fcf38

View File

@ -1051,14 +1051,14 @@ asm_4073f: ; 4073f (10:473f)
scf
ret
Function40741: ; 40741
Pokedex_FillColumn: ; 40741
push de
ld de, $0014
.asm_40745
ld de, SCREEN_WIDTH
.loop
ld [hl], a
add hl, de
dec b
jr nz, .asm_40745
jr nz, .loop
pop de
ret
; 4074c
@ -1076,7 +1076,7 @@ Function4074c: ; 4074c (10:474c)
lb bc, 7, 7
call Pokedex_PlaceBorder
hlcoord 0, 9
ld bc, $607
lb bc, 6, 7
call Pokedex_PlaceBorder
hlcoord 1, 11
ld de, String_SEEN
@ -1102,13 +1102,13 @@ Function4074c: ; 4074c (10:474c)
ld de, String_SELECT_OPTION
call Pokedex_PlaceString
hlcoord 8, 1
ld b, $7
ld b, 7
ld a, $5a
call Function40741
call Pokedex_FillColumn
hlcoord 8, 10
ld b, $6
ld b, 6
ld a, $5a
call Function40741
call Pokedex_FillColumn
hlcoord 8, 0
ld [hl], $59
hlcoord 8, 8
@ -1134,22 +1134,22 @@ String_START_SEARCH: ; 407f2
Function407fd: ; 407fd
call Pokedex_FillBackgroundColor2
hlcoord 0, 0
ld bc, $0f12
lb bc, 15, 18
call Pokedex_PlaceBorder
hlcoord 19, 0
ld [hl], $34
hlcoord 19, 1
ld a, $7f
ld b, $f
call Function40741
ld a, " "
ld b, 15
call Pokedex_FillColumn
ld [hl], $39
hlcoord 1, 10
ld bc, $0013
ld bc, 19
ld a, $61
call ByteFill
hlcoord 1, 17
ld bc, $0012
ld a, $7f
ld bc, 18
ld a, " "
call ByteFill
hlcoord 9, 7
ld de, Unknown_40852
@ -1218,38 +1218,38 @@ Function408f0: ; 408f0 (10:48f0)
lb bc, 14, 18
call Pokedex_PlaceBorder
hlcoord 0, 1
ld de, Unknown_4092a
ld de, .SEARCH
call Pokedex_PlaceString
hlcoord 8, 4
ld de, Unknown_40935
ld de, .BLANK
call Pokedex_PlaceString
hlcoord 8, 6
ld de, Unknown_40935
ld de, .BLANK
call Pokedex_PlaceString
hlcoord 3, 4
ld de, String_40940
ld de, .Type1Type2
call PlaceString
hlcoord 3, 13
ld de, String_4094c
ld de, BeginSearch_Cancel
call PlaceString
ret
; 4092a (10:492a)
Unknown_4092a: ; 4092a
.SEARCH: ; 4092a
db $3b, " SEARCH ", $3c, $ff
; 40925
Unknown_40935: ; 40935
.BLANK: ; 40935
db $3d, " ", $3e, $ff
; 40940
String_40940: ; 40940
.Type1Type2: ; 40940
db "TYPE1"
next "TYPE2"
db "@"
; 4094c
String_4094c: ; 4094c
BeginSearch_Cancel: ; 4094c
db "BEGIN SEARCH!!"
next "CANCEL"
db "@"
@ -1273,9 +1273,9 @@ Function40962: ; 40962 (10:4962)
hlcoord 8, 0
ld [hl], $59
hlcoord 8, 1
ld b, $7
ld b, 7
ld a, $5a
call Function40741
call Pokedex_FillColumn
hlcoord 8, 8
ld [hl], $53
hlcoord 8, 9
@ -1736,7 +1736,7 @@ Function40e5b: ; 40e5b
xor a
ld [hBGMapMode], a
hlcoord 0, 12
lb bc, 4, SCREEN_WIDTH - 2
lb bc, 4, 18
call Pokedex_PlaceBorder
ld a, [wc7d8]
ld hl, Unknown_40e7d
@ -1781,7 +1781,7 @@ Function40f08: ; 40f08 (10:4f08)
xor a
ld [hBGMapMode], a
hlcoord 0, 12
lb bc, 4, SCREEN_WIDTH - 2
lb bc, 4, 18
call Pokedex_PlaceBorder
ld de, String_ChangingModesPleaseWait
hlcoord 1, 14
@ -2018,7 +2018,7 @@ Function41107: ; 41107
xor a
ld [hBGMapMode], a
hlcoord 0, 12
ld bc, $0412
lb bc, 4, 18
call Pokedex_PlaceBorder
ld de, String_41126
hlcoord 1, 14

View File

@ -199,14 +199,14 @@ TownMap_InitCursorAndPlayerIconPositions: ; 90d70 (24:4d70)
ld c, a
call GetWorldMapLocation
.LoadLandmark
ld [wTownMapPlayerIconLandmark], a
ld [wTownMapCursorLandmark], a
ld [wPokegearMapPlayerIconLandmark], a
ld [wPokegearMapCursorLandmark], a
ret
.FastShip
ld [wTownMapPlayerIconLandmark], a
ld [wPokegearMapPlayerIconLandmark], a
ld a, NEW_BARK_TOWN
ld [wTownMapCursorLandmark], a
ld [wPokegearMapCursorLandmark], a
ret
Pokegear_InitJumptableIndices: ; 90d9e (24:4d9e)
@ -307,7 +307,7 @@ InitPokegearTilemap: ; 90da8 (24:4da8)
; 90e3f
.Map: ; 90e3f
ld a, [wTownMapPlayerIconLandmark]
ld a, [wPokegearMapPlayerIconLandmark]
cp FAST_SHIP
jr z, .johto
cp KANTO_LANDMARK
@ -328,7 +328,7 @@ InitPokegearTilemap: ; 90da8 (24:4da8)
ld [hl], $6
hlcoord 19, 2
ld [hl], $17
ld a, [wTownMapCursorLandmark]
ld a, [wPokegearMapCursorLandmark]
call PokegearMap_UpdateLandmarkName
ret
@ -530,7 +530,7 @@ Pokegear_UpdateClock: ; 90f86 (24:4f86)
; 0x90fb4
PokegearMap_CheckRegion: ; 90fb4 (24:4fb4)
ld a, [wTownMapPlayerIconLandmark]
ld a, [wPokegearMapPlayerIconLandmark]
cp FAST_SHIP
jr z, .johto
cp KANTO_LANDMARK
@ -549,9 +549,9 @@ PokegearMap_CheckRegion: ; 90fb4 (24:4fb4)
PokegearMap_Init: ; 90fcd (24:4fcd)
call InitPokegearTilemap
ld a, [wTownMapPlayerIconLandmark]
ld a, [wPokegearMapPlayerIconLandmark]
call PokegearMap_InitPlayerIcon
ld a, [wTownMapCursorLandmark]
ld a, [wPokegearMapCursorLandmark]
call PokegearMap_InitCursor
ld a, c
ld [wPokegearMapCursorObjectPointer], a
@ -621,7 +621,7 @@ PokegearMap_ContinueMap: ; 90ff2 (24:4ff2)
ret
.up
ld hl, wTownMapCursorLandmark
ld hl, wPokegearMapCursorLandmark
ld a, [hl]
cp d
jr c, .wrap_around_up
@ -633,7 +633,7 @@ PokegearMap_ContinueMap: ; 90ff2 (24:4ff2)
jr .done_dpad
.down
ld hl, wTownMapCursorLandmark
ld hl, wPokegearMapCursorLandmark
ld a, [hl]
cp e
jr nz, .wrap_around_down
@ -643,13 +643,13 @@ PokegearMap_ContinueMap: ; 90ff2 (24:4ff2)
.wrap_around_down
dec [hl]
.done_dpad
ld a, [wTownMapCursorLandmark]
ld a, [wPokegearMapCursorLandmark]
call PokegearMap_UpdateLandmarkName
ld a, [wPokegearMapCursorObjectPointer]
ld c, a
ld a, [wPokegearMapCursorObjectPointer + 1]
ld b, a
ld a, [wTownMapCursorLandmark]
ld a, [wPokegearMapCursorLandmark]
call PokegearMap_UpdateCursorPosition
ret
@ -1552,7 +1552,7 @@ RadioChannels:
jp LoadStation_BuenasPassword
.RuinsOfAlphRadio
ld a, [wTownMapPlayerIconLandmark]
ld a, [wPokegearMapPlayerIconLandmark]
cp RUINS_OF_ALPH
jr nz, .NoSignal
jp LoadStation_UnownRadio
@ -1586,7 +1586,7 @@ RadioChannels:
ld a, [StatusFlags]
bit 4, a
jr z, .NoSignal
ld a, [wTownMapPlayerIconLandmark]
ld a, [wPokegearMapPlayerIconLandmark]
cp MAHOGANY_TOWN
jr z, .ok
cp ROUTE_43
@ -1604,7 +1604,7 @@ RadioChannels:
; if in Johto or on the S.S. Aqua, set carry
; otherwise clear carry
ld a, [wTownMapPlayerIconLandmark]
ld a, [wPokegearMapPlayerIconLandmark]
cp FAST_SHIP
jr z, .johto
cp KANTO_LANDMARK

View File

@ -49,7 +49,7 @@ PredefPointers:: ; 856b
add_predef Predef_LinkTextbox ; $ 10
add_predef PrintMoveDesc
add_predef UpdatePlayerHUD
add_predef FillBox
add_predef PlaceGraphic
add_predef CheckPlayerPartyForFitPkmn
add_predef UpdateEnemyHUD
add_predef StartBattle
@ -88,7 +88,7 @@ PredefPointers:: ; 856b
add_predef PlayBattleAnim
add_predef Predef38 ; $38
add_predef Predef39
add_predef Functionfd1d0
add_predef Predef3A
add_predef PartyMonItemName
add_predef GetFrontpic
add_predef GetBackpic
@ -103,6 +103,6 @@ PredefPointers:: ; 856b
add_predef LoadMonAnimation
add_predef AnimateFrontpic
add_predef Functiond0669 ; $48
add_predef Functiond066e
add_predef HOF_AnimateFrontpic
dbw $ff, Function2d43 ; ????
; 864c

View File

@ -2806,9 +2806,9 @@ Script_xycompare: ; 97a01
; pointer (MultiByteParam)
call GetScriptByte
ld [wd453], a
ld [wXYComparePointer], a
call GetScriptByte
ld [wd454], a
ld [wXYComparePointer + 1], a
ret
; 97a0e

View File

@ -864,9 +864,9 @@ TradeAnim_ShowFrontpic: ; 294c3
call Function297cf
hlcoord 7, 2
xor a
ld [hFillBox], a
ld [hGraphicStartTile], a
lb bc, 7, 7
predef FillBox
predef PlaceGraphic
call WaitBGMap
ret
; 294e7

View File

@ -245,8 +245,8 @@ TrainerCard_PrintTopHalfOfCard: ; 25299 (9:5299)
hlcoord 14, 1
lb bc, 5, 7
xor a
ld [hFillBox], a
predef FillBox
ld [hGraphicStartTile], a
predef PlaceGraphic
ret
; 252ec (9:52ec)

View File

@ -111,7 +111,7 @@ AnimateHallOfFame: ; 864c3
jr .loop
.done
call Function86810
call HOF_AnimatePlayerPic
ld a, $4
ld [MusicFade], a
call RotateThreePalettesRight
@ -128,7 +128,7 @@ AnimateHallOfFame: ; 864c3
call WaitBGMap
decoord 6, 5
ld c, $6
predef Functiond066e
predef HOF_AnimateFrontpic
ld c, 60
call DelayFrames
and a
@ -251,10 +251,10 @@ endr
ld de, VTiles2 tile $31
predef GetBackpic
ld a, $31
ld [hFillBox], a
ld [hGraphicStartTile], a
hlcoord 6, 6
lb bc, 6, 6
predef FillBox
predef PlaceGraphic
ld a, $d0
ld [hSCY], a
ld a, $90
@ -310,21 +310,20 @@ _HallOfFamePC: ; 86650
call LoadFontsBattleExtra
xor a
ld [wJumptableIndex], a
.loop
.MasterLoop
call LoadHOFTeam
ret c
call Function86665
call .DisplayTeam
ret c
ld hl, wJumptableIndex
inc [hl]
jr .loop
; 86665
jr .MasterLoop
Function86665: ; 86665
.DisplayTeam
xor a
ld [wcf64], a
.next
call Function86692
call .DisplayMonAndStrings
jr c, .start_button
.loop
call JoyTextDelay
@ -353,19 +352,18 @@ Function86665: ; 86665
.start_button
and a
ret
; 86692
Function86692: ; 86692
.DisplayMonAndStrings
; Print the number of times the player has entered the Hall of Fame.
; If that number is above 200, print "HOF Master!" instead.
ld a, [wcf64]
cp $6
cp PARTY_LENGTH
jr nc, .fail
ld hl, wHallOfFameTempMon1
ld bc, wHallOfFameTempMon1End - wHallOfFameTempMon1
call AddNTimes
ld a, [hl]
cp $ff
cp -1
jr nz, .okay
.fail
@ -380,14 +378,14 @@ Function86692: ; 86692
ld a, [wHallOfFameTempWinCount]
cp 200 + 1
jr c, .print_num_hof
ld de, String_866fc
ld de, .HOFMaster
hlcoord 1, 2
call PlaceString
hlcoord 13, 2
jr .finish
.print_num_hof
ld de, String_8670c
ld de, .TimeFamer
hlcoord 1, 2
call PlaceString
hlcoord 2, 2
@ -397,7 +395,7 @@ Function86692: ; 86692
hlcoord 11, 2
.finish
ld de, String_866fb
ld de, .EmptyString
call PlaceString
call WaitBGMap
ld b, SCGB_1A
@ -405,24 +403,20 @@ Function86692: ; 86692
call SetPalettes
decoord 6, 5
ld c, $6
predef Functiond066e
predef HOF_AnimateFrontpic
and a
ret
; 866fb
String_866fb:
.EmptyString:
db "@"
; 866fc
String_866fc:
.HOFMaster:
db " HOF Master!@"
; 8670c
String_8670c:
.TimeFamer:
db " -Time Famer@"
; 8671c
LoadHOFTeam: ; 8671c
ld a, [wJumptableIndex]
cp NUM_HOF_TEAMS
@ -537,7 +531,7 @@ DisplayHOFMon: ; 86748
ret
; 86810
Function86810: ; 86810
HOF_AnimatePlayerPic: ; 86810
call ClearBGPalettes
ld hl, VTiles2 tile $63
ld de, FontExtra + 13 tiles
@ -549,10 +543,10 @@ Function86810: ; 86810
call ByteFill
callba GetPlayerBackpic
ld a, $31
ld [hFillBox], a
ld [hGraphicStartTile], a
hlcoord 6, 6
lb bc, 6, 6
predef FillBox
predef PlaceGraphic
ld a, $d0
ld [hSCY], a
ld a, $90
@ -571,12 +565,12 @@ Function86810: ; 86810
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
ld a, " "
call ByteFill
callba Function88840
callba HOF_LoadTrainerFrontpic
xor a
ld [hFillBox], a
ld [hGraphicStartTile], a
hlcoord 12, 5
lb bc, 7, 7
predef FillBox
predef PlaceGraphic
ld a, $c0
ld [hSCX], a
call WaitBGMap

View File

@ -275,7 +275,7 @@ _MomText_ItsInRoom: ; 0xfd1ca
db 0 ; XXX
Functionfd1d0: ; fd1d0
Predef3A: ; fd1d0
ret
; fd1d1

View File

@ -144,9 +144,9 @@ UnownPrinter: ; 16be4
call Function16cff
hlcoord 1, 6
xor a
ld [hFillBox], a
ld [hGraphicStartTile], a
lb bc, 7, 7
predef FillBox
predef PlaceGraphic
ld de, VTiles2 tile $31
callba Functione0000
ret
@ -228,9 +228,9 @@ Function16dac: ; 16dac
call ByteFill
hlcoord 7, 11
ld a, $31
ld [hFillBox], a
ld [hGraphicStartTile], a
lb bc, 7, 7
predef FillBox
predef PlaceGraphic
ret
; 16dc7

View File

@ -1115,13 +1115,13 @@ PokeAnim_GetSpeciesOrUnown: ; d065c
ret
; d0669
Functiond0669: ; d0669
Functiond0669: ; d0669 Predef 48
ld a, $1
ld [wBoxAlignment], a
Functiond066e: ; d066e
HOF_AnimateFrontpic: ; d066e Predef 49
call AnimateMon_CheckIfPokemon
jr c, .asm_d068c
jr c, .fail
ld h, d
ld l, e
push bc
@ -1137,7 +1137,7 @@ Functiond066e: ; d066e
ld [wBoxAlignment], a
ret
.asm_d068c
.fail
xor a
ld [wBoxAlignment], a
inc a

View File

@ -1665,9 +1665,9 @@ _PrepMonFrontpic:: ; 378b
predef GetFrontpic
pop hl
xor a
ld [hFillBox], a
ld [hGraphicStartTile], a
lb bc, 7, 7
predef FillBox
predef PlaceGraphic
xor a
ld [wBoxAlignment], a
ret

View File

@ -560,7 +560,7 @@ CheckSFX:: ; 3dde
ret
; 3dfe
Function3dfe:: ; 3dfe
TerminateExpBarSound:: ; 3dfe
xor a
ld [Channel5Flags], a
ld [SoundInput], a

View File

@ -381,7 +381,7 @@ CheckIndoorMap:: ; 22f4
ret
; 2300
Function2300:: ; unreferenced
; XXX
cp INDOOR
ret z
cp GATE
@ -549,11 +549,11 @@ ReadWarps:: ; 23da
ld a, l
ld [wCurrMapWarpHeaderPointer], a
ld a, h
ld [wdbfd], a
ld [wCurrMapWarpHeaderPointer + 1], a
ld a, c
and a
ret z
ld bc, $0005
ld bc, 5
call AddNTimes
ret
; 23f1
@ -765,25 +765,25 @@ endr
ld d, a
ld a, [MapHeight]
ld b, a
.asm_250c
.row
push hl
ld a, [hConnectedMapWidth]
ld c, a
.asm_2510
.col
ld a, [de]
inc de
ld [hli], a
dec c
jr nz, .asm_2510
jr nz, .col
pop hl
ld a, [hConnectionStripLength]
add l
ld l, a
jr nc, .asm_251e
jr nc, .okay
inc h
.asm_251e
.okay
dec b
jr nz, .asm_250c
jr nz, .row
pop af
rst Bankswitch
@ -916,9 +916,9 @@ FillSouthConnectionStrip:: ; 25d3
add 6
add e
ld e, a
jr nc, .asm_25f2
jr nc, .okay
inc d
.asm_25f2
.okay
dec c
jr nz, .y
ret
@ -927,7 +927,7 @@ FillSouthConnectionStrip:: ; 25d3
FillWestConnectionStrip::
FillEastConnectionStrip:: ; 25f6
.asm_25f6
.loop
ld a, [MapWidth]
add 6
ld [hConnectedMapWidth], a
@ -955,11 +955,11 @@ FillEastConnectionStrip:: ; 25f6
ld a, [hConnectedMapWidth]
add e
ld e, a
jr nc, .asm_2617
jr nc, .okay
inc d
.asm_2617
.okay
dec b
jr nz, .asm_25f6
jr nz, .loop
ret
; 261b
@ -1452,15 +1452,15 @@ BufferScreen:: ; 2879
ld de, wScreenSave
ld c, $5
ld b, $6
.asm_2886
.row
push bc
push hl
.asm_2888
.col
ld a, [hli]
ld [de], a
inc de
dec b
jr nz, .asm_2888
jr nz, .col
pop hl
ld a, [MapWidth]
add $6
@ -1469,7 +1469,7 @@ BufferScreen:: ; 2879
add hl, bc
pop bc
dec c
jr nz, .asm_2886
jr nz, .row
ret
; 289d

View File

@ -128,7 +128,7 @@ Timer:: ; 3e93
Function3ed7:: ; 3ed7
; unreferenced
ld [wdc02], a
ld [$dc02], a
ld a, [hROMBank]
push af
ld a, BANK(Function114243)
@ -139,7 +139,7 @@ Function3ed7:: ; 3ed7
ld a, b
rst Bankswitch
ld a, [wdc02]
ld a, [$dc02]
ret
; 3eea

View File

@ -34,7 +34,7 @@ hJoyLast EQU $ffa9
hInMenu EQU $ffaa
hPrinter EQU $ffac
hFillBox EQU $ffad
hGraphicStartTile EQU $ffad
hMoveMon EQU $ffae
hMapObjectIndexBuffer EQU $ffaf
hObjectStructIndexBuffer EQU $ffb0

View File

@ -1665,7 +1665,7 @@ RevivePokemon: ; f0d6
ld a, [CurPartyMon]
ld c, a
ld d, 0
ld hl, wc6fc
ld hl, wBattleParticipantsIncludingFainted
ld b, CHECK_FLAG
predef FlagPredef
ld a, c

View File

@ -5428,9 +5428,9 @@ Pokepic:: ; 244e3
ld c, a
call Coord2Tile
ld a, $80
ld [hFillBox], a
ld [hGraphicStartTile], a
lb bc, 7, 7
predef FillBox
predef PlaceGraphic
call WaitBGMap
ret
@ -6509,9 +6509,9 @@ endr
ld [hl], VBGMap0 / $100
ret
FillBox: ; 2ef6e
PlaceGraphic: ; 2ef6e
; Fill wBoxAlignment-aligned box width b height c
; with iterating tile starting from hFillBox at hl.
; with iterating tile starting from hGraphicStartTile at hl.
; Predef $13
ld de, SCREEN_WIDTH
@ -6520,7 +6520,7 @@ FillBox: ; 2ef6e
and a
jr nz, .right
ld a, [hFillBox]
ld a, [hGraphicStartTile]
.x1
push bc
push hl
@ -6547,7 +6547,7 @@ FillBox: ; 2ef6e
add hl, bc
pop bc
ld a, [hFillBox]
ld a, [hGraphicStartTile]
.x2
push bc
push hl
@ -8973,7 +8973,7 @@ CheckBattleScene: ; 4ea44
.asm_4ea72
ld a, $5
ld hl, wdc00
ld hl, w5_dc00
call GetFarWRAMByte
bit 0, a
jr z, .off
@ -10799,7 +10799,7 @@ MovePlayerPic: ; 88266
xor a
ld [hBGMapMode], a
lb bc, 7, 7
predef FillBox
predef PlaceGraphic
xor a
ld [hBGMapThird], a
call WaitBGMap
@ -10951,7 +10951,7 @@ GetChrisBackpic: ; 88830
predef DecompressPredef
ret
Function88840: ; 88840
HOF_LoadTrainerFrontpic: ; 88840
call WaitBGMap
xor a
ld [hBGMapMode], a
@ -11007,10 +11007,10 @@ DrawIntroPlayerPic: ; 88874
; Draw
xor a
ld [hFillBox], a
ld [hGraphicStartTile], a
hlcoord 6, 4
lb bc, 7, 7
predef FillBox
predef PlaceGraphic
ret
ChrisPic: ; 888a9

View File

@ -1255,10 +1255,10 @@ Function897d5: ; 897d5
.asm_897f3
ld a, $37
ld [hFillBox], a
ld [hGraphicStartTile], a
hlcoord 12, 3
lb bc, 7, 7
predef FillBox
predef PlaceGraphic
call Function8963d
pop bc
ret

File diff suppressed because it is too large Load Diff

View File

@ -1242,9 +1242,9 @@ asm_108966
call MobileTradeAnim_ClearTilemap
hlcoord 7, 2
xor a
ld [hFillBox], a
ld [hGraphicStartTile], a
lb bc, 7, 7
predef FillBox
predef PlaceGraphic
call WaitBGMap
ret
; 10898a
@ -1256,9 +1256,9 @@ Function10898a: ; 10898a
call MobileTradeAnim_ClearTilemap
hlcoord 7, 2
xor a
ld [hFillBox], a
ld [hGraphicStartTile], a
lb bc, 7, 7
predef FillBox
predef PlaceGraphic
call WaitBGMap
ret
; 1089a8

File diff suppressed because it is too large Load Diff

View File

@ -1118,7 +1118,7 @@ Function1188c8: ; 1188c8 (46:48c8)
ld a, $1
ld [wcd65], a
call Function1188e7
ld hl, wc708
ld hl, $c708
.asm_1188d3
ld a, [de]
inc de
@ -1127,7 +1127,7 @@ Function1188c8: ; 1188c8 (46:48c8)
jr nz, .asm_1188d3
call Function119eb4
call Function119ec2
ld hl, wc708
ld hl, $c708
ld a, $6
jp Function119e2b
@ -1908,9 +1908,9 @@ Function118f68:
ld [hli], a
ld a, [wcd4c]
ld [hli], a
ld a, wc708 % $100
ld a, $c708 % $100
ld [hli], a
ld a, wc708 / $100
ld a, $c708 / $100
ld [hli], a
ld a, $60
ld [hli], a
@ -2537,9 +2537,9 @@ Function1193a0:
ld [hli], a
xor a
ld [hli], a
ld a, wc708 % $100
ld a, $c708 % $100
ld [hli], a
ld a, wc708 / $100
ld a, $c708 / $100
ld [hli], a
ld a, $60
ld [hli], a
@ -2975,7 +2975,7 @@ Function119694: ; 119694 (46:5694)
ld b, 0
ld hl, Unknown_1196b8
.asm_119699
ld de, wc708
ld de, $c708
ld a, [de]
inc de
cp [hl]
@ -3018,7 +3018,7 @@ SECTION "bank46_2", ROMX, BANK[$46]
; A hack to use ascii above.
Function1196cd: ; 1196cd (46:56cd)
ld de, wc719
ld de, $c719
call Function1196de
ld [wcd4a], a
inc de
@ -3029,6 +3029,8 @@ Function1196cd: ; 1196cd (46:56cd)
Function1196de: ; 1196de (46:56de)
ld a, [de]
inc de
; b = ([de] - 48) * 2
; c = ([de] - 48) * 10
sub $30
sla a
ld b, a
@ -3362,9 +3364,9 @@ Function1198f7:
ld [hli], a
xor a
ld [hli], a
ld a, wc708 % $100
ld a, $c708 % $100
ld [hli], a
ld a, wc708 / $100
ld a, $c708 / $100
ld [hli], a
ld a, [wcd51]
ld [hli], a
@ -7231,7 +7233,7 @@ Function11b483: ; 11b483
jp Function11ad8a
.InitRAM
ld bc, wc626
ld bc, $c626
ld a, [PlayerID]
ld [wcd2a], a
ld [bc], a
@ -7444,9 +7446,9 @@ Function11b6b4: ; 11b6b4
ld a, $5
call GetSRAMBank
ld a, [wcd30]
ld [wc708], a
ld [$c708], a
ld a, [wcd31]
ld [wc709], a
ld [$c709], a
ld a, $c708 % $100
ld [wMobileMonSpeciesPointerBuffer], a
@ -7735,8 +7737,8 @@ Function11b920: ; 11b920
ld a, $5
call GetSRAMBank
ld hl, $a81f
ld de, wc626
ld bc, $0008
ld de, $c626
ld bc, 8
call CopyBytes
call CloseSRAM
call Function118000

View File

@ -1,32 +1,32 @@
Function170000: ; 170000
ld a, [$c62b]
ld [$c6d0], a
ld [wPlayerTrademonSpecies], a
ld hl, $c62e
ld de, $c6e7
ld de, wPlayerTrademonSenderName
ld bc, $0005
call CopyBytes
ld a, $50
ld [de], a
ld hl, $c663
ld de, $c6f2
ld de, wPlayerTrademonOTName
ld bc, $0005
call CopyBytes
ld a, $50
ld [de], a
ld hl, $c648
ld a, [hli]
ld [$c6fd], a
ld [wPlayerTrademonDVs], a
ld a, [hl]
ld [$c6fe], a
ld [wPlayerTrademonDVs + 1], a
ld hl, $c639
ld a, [hli]
ld [$c6ff], a
ld [wPlayerTrademonID], a
ld a, [hl]
ld [wc700], a
ld [wPlayerTrademonID + 1], a
ld bc, $c633
callba GetCaughtGender
ld a, c
ld [wc701], a
ld [wPlayerTrademonCaughtData], a
ld a, [wcd81]
ld [wc74e], a
ld hl, $c608
@ -41,33 +41,33 @@ Function17005a: ; 17005a
ld a, $5
call GetSRAMBank
ld a, [$a824]
ld [wc702], a
ld [wOTTrademonSpecies], a
ld hl, $a827
ld de, wc719
ld bc, $0005
ld de, wOTTrademonSenderName
ld bc, 5 ; Japanese Name Length
call CopyBytes
ld a, $50
ld a, "@"
ld [de], a
ld hl, $a85c
ld de, wc724
ld bc, $0005
ld de, wOTTrademonOTName
ld bc, 5 ; Japanese Name Length
call CopyBytes
ld a, $50
ld a, "@"
ld [de], a
ld hl, $a841
ld a, [hli]
ld [wEnemyTrappingMove], a
ld [wOTTrademonDVs], a
ld a, [hl]
ld [wPlayerWrapCount], a
ld [wOTTrademonDVs + 1], a
ld hl, $a832
ld a, [hli]
ld [wEnemyWrapCount], a
ld [wOTTrademonID], a
ld a, [hl]
ld [wPlayerCharging], a
ld [wOTTrademonID + 1], a
ld bc, $a82c
callba GetCaughtGender
ld a, c
ld [wEnemyCharging], a
ld [wOTTrademonCaughtData], a
ld a, [wcd81]
ld [wc74e], a
call CloseSRAM

View File

@ -277,7 +277,7 @@ Function17d0f3: ; 17d0f3
ld [wOTTrademonSpecies], a
ld [CurPartySpecies], a
ld a, [wcd81]
ld [wc74e], a
ld [$c74e], a
ld hl, $c63d
ld de, wOTTrademonOTName
ld bc, 5
@ -1000,7 +1000,7 @@ Function17d60b: ; 17d60b
call CloseSRAM
ld a, $6
call GetSRAMBank
ld de, wc708
ld de, $c708
ld a, c
and a
jr z, .asm_17d684
@ -1060,7 +1060,7 @@ Function17d60b: ; 17d60b
call CloseSRAM
ld a, $5
call GetSRAMBank
ld hl, wc708
ld hl, $c708
ld de, $b1b3
ld a, [$b1b1]
ld c, a
@ -1477,7 +1477,7 @@ Function17d902: ; 17d902
Function17d93a: ; 17d93a
call Function17e415
ld de, wc708
ld de, $c708
ld bc, $0005
call CopyBytes
call Function17e41e
@ -1486,25 +1486,25 @@ Function17d93a: ; 17d93a
push af
ld a, $1
ld [rSVBK], a
ld a, [wc70c]
ld a, [$c70c]
call Function17e6de
ld a, [wc70a]
ld a, [$c70a]
ld [CurPartySpecies], a
ld a, [wc70c]
ld a, [$c70c]
ld e, a
callba Function8bc6
call SetPalettes
ld a, [wc708]
ld a, [$c708]
ld l, a
ld a, [wc709]
ld a, [$c709]
ld h, a
ld a, [wc70b]
ld a, [$c70b]
ld c, a
decoord 0, 0
add hl, de
ld e, l
ld d, h
callba Functiond066e
callba HOF_AnimateFrontpic
pop af
ld [rSVBK], a
call Function17e349
@ -1513,7 +1513,7 @@ Function17d93a: ; 17d93a
Function17d98b: ; 17d98b
call Function17e415
ld de, wc708
ld de, $c708
ld bc, $0004
call CopyBytes
call Function17e41e
@ -1522,17 +1522,17 @@ Function17d98b: ; 17d98b
push af
ld a, $1
ld [rSVBK], a
ld a, [wc70b]
ld a, [$c70b]
call Function17e6de
ld a, [wc70a]
ld a, [$c70a]
ld [TrainerClass], a
ld a, [wc70b]
ld a, [$c70b]
ld e, a
callba Function8bbd
call SetPalettes
ld a, [wc708]
ld a, [$c708]
ld e, a
ld a, [wc709]
ld a, [$c709]
ld d, a
push de
ld de, VTiles2
@ -1541,7 +1541,7 @@ Function17d98b: ; 17d98b
decoord 0, 0
add hl, de
ld bc, $0707
predef FillBox
predef PlaceGraphic
pop af
ld [rSVBK], a
call Function17e349
@ -1550,34 +1550,34 @@ Function17d98b: ; 17d98b
Function17d9e3: ; 17d9e3
call Function17e415
ld de, wc708
ld de, $c708
ld bc, $0007
call CopyBytes
call Function17e41e
ld a, [wc70b]
ld a, [$c70b]
push af
cp $c0
jr c, .asm_17da01
ld a, [wc70c]
ld a, [$c70c]
ld [rSVBK], a
jr .asm_17da07
.asm_17da01
ld a, [wc70c]
ld a, [$c70c]
call GetSRAMBank
.asm_17da07
ld a, [wc708]
ld a, [$c708]
ld l, a
ld a, [wc709]
ld a, [$c709]
ld h, a
ld a, [wc70a]
ld a, [$c70a]
ld e, a
ld a, [wc70b]
ld a, [$c70b]
ld d, a
ld a, [wc70d]
ld a, [$c70d]
ld c, a
ld a, [wc70e]
ld a, [$c70e]
ld b, a
call CopyBytes
pop af
@ -1596,28 +1596,28 @@ Function17d9e3: ; 17d9e3
Function17da31: ; 17da31
call Function17e415
ld de, wc708
ld de, $c708
ld bc, $0004
call CopyBytes
call Function17e41e
ld a, [wc709]
ld a, [$c709]
push af
cp $c0
jr c, .asm_17da4f
ld a, [wc70a]
ld a, [$c70a]
ld [rSVBK], a
jr .asm_17da55
.asm_17da4f
ld a, [wc70a]
ld a, [$c70a]
call GetSRAMBank
.asm_17da55
ld a, [wc708]
ld a, [$c708]
ld e, a
ld a, [wc709]
ld a, [$c709]
ld d, a
ld a, [wc70b]
ld a, [$c70b]
ld c, a
bit 7, c
jr nz, .asm_17da70
@ -1897,22 +1897,22 @@ Function17dc1f: ; 17dc1f
ld [rSVBK], a
ld hl, $c688
ld a, $40
ld [wc708], a
ld [$c708], a
ld a, [hli]
ld [wc70a], a
ld [$c70a], a
add $5
ld [wc70c], a
ld [$c70c], a
ld a, [hli]
ld [wc709], a
ld [$c709], a
add $4
ld [wc70b], a
ld [$c70b], a
ld a, $96
ld [wc70d], a
ld [$c70d], a
ld a, $5c
ld [wc70e], a
ld [$c70e], a
ld a, $1
ld [wEnemyGoesFirst], a
ld hl, wc708
ld [$c70f], a
ld hl, $c708
call LoadMenuDataHeader
call VerticalMenu
jr nc, .asm_17dc6e
@ -2075,112 +2075,112 @@ Function17dd30: ; 17dd30
Function17dd49: ; 17dd49
call Function17e415
ld de, wc708
ld de, $c708
ld bc, $000a
call CopyBytes
ld a, [wc711]
ld a, [$c711]
ld c, a
ld b, $0
call CopyBytes
ld a, [wc70a]
ld a, [$c70a]
cp $c0
jr c, .asm_17dd6c
ld a, [wc708]
jr c, .sram
ld a, [$c708]
ld [rSVBK], a
jr .asm_17dd72
jr .got_bank
.asm_17dd6c
ld a, [wc708]
.sram
ld a, [$c708]
call GetSRAMBank
.asm_17dd72
ld a, [wc709]
.got_bank
ld a, [$c709]
ld l, a
ld a, [wc70a]
ld a, [$c70a]
ld h, a
ld de, $c688
ld a, [wc711]
ld a, [$c711]
ld c, a
ld b, $0
call CopyBytes
ld a, [wc70a]
ld a, [$c70a]
cp $c0
jr c, .asm_17dd93
jr c, .close_sram
ld a, $4
ld [rSVBK], a
jr .asm_17dd96
jr .exited_bank
.asm_17dd93
.close_sram
call CloseSRAM
.asm_17dd96
ld a, [wc711]
.exited_bank
ld a, [$c711]
ld c, a
ld hl, wc712
ld hl, $c712
ld de, $c688
.asm_17dda0
.loop
ld a, [de]
inc de
cp [hl]
inc hl
jr z, .asm_17ddaa
jr c, .asm_17ddc1
jr .asm_17ddb7
jr z, .next
jr c, .load
jr .load2
.asm_17ddaa
.next
dec c
jr nz, .asm_17dda0
ld a, [wc70d]
jr nz, .loop
ld a, [$c70d]
ld l, a
ld a, [wc70e]
ld a, [$c70e]
ld h, a
jr .asm_17ddc9
jr .done
.asm_17ddb7
ld a, [wEnemyGoesFirst]
.load2
ld a, [$c70f]
ld l, a
ld a, [wc710]
ld a, [$c710]
ld h, a
jr .asm_17ddc9
jr .done
.asm_17ddc1
ld a, [wc70b]
.load
ld a, [$c70b]
ld l, a
ld a, [wc70c]
ld a, [$c70c]
ld h, a
.asm_17ddc9
.done
call Function17e40f
ret
; 17ddcd
Function17ddcd: ; 17ddcd
call Function17e415
ld de, wc708
ld de, $c708
ld bc, $0008
call CopyBytes
ld a, [wc70a]
ld a, [$c70a]
cp $c0
jr c, .asm_17dde7
ld a, [wc708]
ld a, [$c708]
ld [rSVBK], a
jr .asm_17dded
.asm_17dde7
ld a, [wc708]
ld a, [$c708]
call GetSRAMBank
.asm_17dded
ld a, [wc709]
ld a, [$c709]
ld e, a
ld a, [wc70a]
ld a, [$c70a]
ld d, a
ld a, [de]
ld [wc710], a
ld a, [wc70b]
ld [$c710], a
ld a, [$c70b]
ld c, a
ld b, $0
ld a, [wc70a]
ld a, [$c70a]
cp $c0
jr c, .asm_17de0c
ld a, $4
@ -2195,20 +2195,20 @@ Function17ddcd: ; 17ddcd
ld hl, Unknown_17da8c
add hl, bc
ld a, [hl]
ld hl, wc710
ld hl, $c710
and [hl]
pop hl
jr nz, .asm_17de26
ld a, [wc70e]
ld a, [$c70e]
ld l, a
ld a, [wEnemyGoesFirst]
ld a, [$c70f]
ld h, a
jr .asm_17de2e
.asm_17de26
ld a, [wc70c]
ld a, [$c70c]
ld l, a
ld a, [wc70d]
ld a, [$c70d]
ld h, a
.asm_17de2e
@ -2218,26 +2218,26 @@ Function17ddcd: ; 17ddcd
Function17de32: ; 17de32
call Function17e415
ld de, wc708
ld de, $c708
ld bc, $0009
call CopyBytes
ld a, [wc710]
ld a, [$c710]
ld c, a
ld b, $0
call CopyBytes
ld a, $6
call GetSRAMBank
call Function17f4f6
ld a, [wc708]
ld a, [$c708]
ld e, a
ld a, [wc709]
ld a, [$c709]
ld d, a
add hl, de
ld e, l
ld d, h
ld a, [wc710]
ld a, [$c710]
ld c, a
ld hl, wc711
ld hl, $c711
.asm_17de61
ld a, [de]
inc de
@ -2250,23 +2250,23 @@ Function17de32: ; 17de32
.asm_17de6b
dec c
jr nz, .asm_17de61
ld a, [wc70c]
ld a, [$c70c]
ld l, a
ld a, [wc70d]
ld a, [$c70d]
ld h, a
jr .asm_17de8a
.asm_17de78
ld a, [wc70e]
ld a, [$c70e]
ld l, a
ld a, [wEnemyGoesFirst]
ld a, [$c70f]
ld h, a
jr .asm_17de8a
.asm_17de82
ld a, [wc70a]
ld a, [$c70a]
ld l, a
ld a, [wc70b]
ld a, [$c70b]
ld h, a
.asm_17de8a
@ -2277,20 +2277,20 @@ Function17de32: ; 17de32
Function17de91: ; 17de91
call Function17e415
ld de, wc708
ld de, $c708
ld bc, $0007
call CopyBytes
ld a, $6
call GetSRAMBank
call Function17f4f6
ld a, [wc708]
ld a, [$c708]
ld e, a
ld a, [wc709]
ld a, [$c709]
ld d, a
add hl, de
ld e, l
ld d, h
ld a, [wc70a]
ld a, [$c70a]
ld c, a
ld b, $0
ld hl, Unknown_17da8c
@ -2300,16 +2300,16 @@ Function17de91: ; 17de91
ld h, d
and [hl]
jr nz, .asm_17deca
ld a, [wc70d]
ld a, [$c70d]
ld l, a
ld a, [wc70e]
ld a, [$c70e]
ld h, a
jr .asm_17ded2
.asm_17deca
ld a, [wc70b]
ld a, [$c70b]
ld l, a
ld a, [wc70c]
ld a, [$c70c]
ld h, a
.asm_17ded2
@ -2320,7 +2320,7 @@ Function17de91: ; 17de91
Function17ded9: ; 17ded9
call Function17e415
ld de, wc708
ld de, $c708
ld bc, $001f
call CopyBytes
call Function17e32b
@ -2328,7 +2328,7 @@ Function17ded9: ; 17ded9
push af
ld a, $1
ld [rSVBK], a
ld hl, wc708
ld hl, $c708
ld a, [hli]
ld [CurPartySpecies], a
ld [TempEnemyMonSpecies], a
@ -2661,14 +2661,14 @@ asm_17e0ee
Function17e0fd: ; 17e0fd
call Function17e415
ld de, wc708
ld de, $c708
ld bc, $0006
call CopyBytes
ld a, [rSVBK]
push af
ld a, $1
ld [rSVBK], a
ld hl, wc708
ld hl, $c708
ld a, [hli]
ld [CurItem], a
ld a, [hli]
@ -2695,14 +2695,14 @@ Function17e0fd: ; 17e0fd
Function17e133: ; 17e133
call Function17e415
ld de, wc708
ld de, $c708
ld bc, $0005
call CopyBytes
ld a, [rSVBK]
push af
ld a, $1
ld [rSVBK], a
ld hl, wc708
ld hl, $c708
ld a, [hli]
ld [ScriptVar], a
push hl
@ -2726,14 +2726,14 @@ Function17e133: ; 17e133
Function17e165: ; 17e165
call Function17e415
ld de, wc708
ld de, $c708
ld bc, $0005
call CopyBytes
ld a, [rSVBK]
push af
ld a, $1
ld [rSVBK], a
ld hl, wc708
ld hl, $c708
ld a, [hli]
ld [CurItem], a
push hl
@ -2763,31 +2763,31 @@ Function17e165: ; 17e165
Function17e1a1: ; 17e1a1
call Function17e415
ld de, wc708
ld de, $c708
ld bc, $000d
call CopyBytes
ld a, [wc70a]
ld a, [$c70a]
cp $c0
jr c, .asm_17e1bb
ld a, [wc708]
ld a, [$c708]
ld [rSVBK], a
jr .asm_17e1c1
.asm_17e1bb
ld a, [wc708]
ld a, [$c708]
call GetSRAMBank
.asm_17e1c1
ld a, [wc709]
ld a, [$c709]
ld l, a
ld a, [wc70a]
ld a, [$c70a]
ld h, a
ld de, $c608
ld a, [wc70b]
ld a, [$c70b]
ld c, a
ld b, $0
call CopyBytes
ld a, [wc70a]
ld a, [$c70a]
cp $c0
jr c, .asm_17e1e2
ld a, $4
@ -2798,28 +2798,28 @@ Function17e1a1: ; 17e1a1
call CloseSRAM
.asm_17e1e5
ld a, [wc70e]
ld a, [$c70e]
cp $c0
jr c, .asm_17e1f3
ld a, [wc70c]
ld a, [$c70c]
ld [rSVBK], a
jr .asm_17e1f9
.asm_17e1f3
ld a, [wc70c]
ld a, [$c70c]
call GetSRAMBank
.asm_17e1f9
ld a, [wc70d]
ld a, [$c70d]
ld l, a
ld a, [wc70e]
ld a, [$c70e]
ld h, a
ld de, $c688
ld a, [wc70b]
ld a, [$c70b]
ld c, a
ld b, $0
call CopyBytes
ld a, [wc70e]
ld a, [$c70e]
cp $c0
jr c, .asm_17e21a
ld a, $4
@ -2830,7 +2830,7 @@ Function17e1a1: ; 17e1a1
call CloseSRAM
.asm_17e21d
ld a, [wc70b]
ld a, [$c70b]
ld c, a
ld hl, $c688
ld de, $c608
@ -2846,23 +2846,23 @@ Function17e1a1: ; 17e1a1
.asm_17e231
dec c
jr nz, .asm_17e227
ld a, [wc711]
ld a, [$c711]
ld l, a
ld a, [wc712]
ld a, [$c712]
ld h, a
jr .asm_17e250
.asm_17e23e
ld a, [wEnemyGoesFirst]
ld a, [$c70f]
ld l, a
ld a, [wc710]
ld a, [$c710]
ld h, a
jr .asm_17e250
.asm_17e248
ld a, [wc712 + 1]
ld a, [$c712 + 1]
ld l, a
ld a, [wc712 + 2]
ld a, [$c712 + 2]
ld h, a
.asm_17e250
@ -3647,9 +3647,9 @@ Function17e691: ; 17e691
Function17e6de: ; 17e6de
push af
ld a, [wc708]
ld a, [$c708]
ld l, a
ld a, [wc709]
ld a, [$c709]
ld h, a
decoord 0, 0, AttrMap
add hl, de
@ -4345,14 +4345,14 @@ Function17f382: ; 17f382
Function17f3c9: ; 17f3c9
push bc
ld hl, wcd36
ld de, wc708
ld de, $c708
ld bc, $000c
call CopyBytes
pop de
ld c, $0
callba Function11c075
push hl
ld hl, wc708
ld hl, $c708
ld de, wcd36
ld bc, $000c
call CopyBytes

251
wram.asm
View File

@ -359,23 +359,20 @@ TileMapEnd::
SECTION "Battle", WRAM0
wc608::
wOddEgg:: party_struct OddEgg
wOddEggName:: ds PKMN_NAME_LENGTH
wOddEggOTName:: ds PKMN_NAME_LENGTH
ds wOddEgg - @
ds wc608 - @
wBT_OTTemp:: battle_tower_struct wBT_OTTemp
ds wBT_OTTemp - @
ds wc608 - @
hall_of_fame wHallOfFameTemp
ds wHallOfFameTemp - @
ds wc608 - @
wMisc:: ; ds (SCREEN_WIDTH + 4) * (SCREEN_HEIGHT + 2)
wBattle::
wc608::
ds 7
wc60f::
ds 3
ds 10
wc612::
ds 10
wInitHourBuffer:: ; c61c
@ -383,8 +380,9 @@ wInitHourBuffer:: ; c61c
wc626::
ds wc608 - @
wEnemyMoveStruct:: move_struct wEnemyMoveStruct
wPlayerMoveStruct:: move_struct wPlayerMoveStruct
wBattle::
wEnemyMoveStruct:: move_struct wEnemyMoveStruct ; c608
wPlayerMoveStruct:: move_struct wPlayerMoveStruct ; c60f
EnemyMonNick:: ds PKMN_NAME_LENGTH ; c616
BattleMonNick:: ds PKMN_NAME_LENGTH ; c621
@ -542,17 +540,17 @@ PlayerDamageTaken:: ; c682
EnemyDamageTaken:: ; c684
ds 2
wBattleReward:: ds 3
wBattleReward:: ds 3 ; c686
wBattleAnimParam::
wKickCounter::
wPresentPower:: ds 1
wPresentPower:: ds 1 ; c689
BattleScriptBuffer:: ; c68a
ds 40
BattleScriptBufferLoc:: ; c6b2
ds 2
wTurnEnded:: ds 1
wTurnEnded:: ds 1 ; c6b4
ds 1
PlayerStats:: ; c6b6
@ -592,10 +590,8 @@ EnemyDefLevel:: ; c6d5
ds 1
EnemySpdLevel:: ; c6d6
ds 1
wTownMapCursorLandmark::
EnemySAtkLevel:: ; c6d7
ds 1
wTownMapPlayerIconLandmark::
EnemySDefLevel:: ; c6d8
ds 1
EnemyAccLevel:: ; c6d9
@ -616,7 +612,8 @@ PlayerSubstituteHP:: ; c6df
EnemySubstituteHP:: ; c6e0
ds 1
wc6e1:: ds 2
wUnusedPlayerLockedMove:: ds 1 ; c6e1
ds 1
CurPlayerMove:: ; c6e3
ds 1
CurEnemyMove:: ; c6e4
@ -626,16 +623,12 @@ LinkBattleRNCount:: ; c6e5
; how far through the prng stream
ds 1
wc6e6:: ds 1
wc6e7:: ds 1
wc6e8:: ds 1
wc6e9::
wEnemyItemState:: ds 1 ; c6e6
ds 2
CurEnemyMoveNum:: ; c6e9
ds 1
wEnemyHPAtTimeOfPlayerSwitch::
wc6ea:: ds 1
wc6eb:: ds 1
wEnemyHPAtTimeOfPlayerSwitch:: ds 2 ; c6ea
wPayDayMoney:: ds 3 ; c6ec
wSafariMonAngerCount:: ds 1
@ -649,12 +642,11 @@ DisabledMove:: ; c6f5
ds 1
EnemyDisabledMove:: ; c6f6
ds 1
wc6f7:: ds 1
wWhichMonFaintedFirst:: ds 1
; exists so you can't counter on switch
LastEnemyCounterMove:: ; c6f8
ds 1
wc6f9::
LastPlayerCounterMove:: ; c6f9
ds 1
@ -663,11 +655,9 @@ wEnemyMinimized:: ds 1 ; c6fa
AlreadyFailed:: ; c6fb
ds 1
wc6fc:: ds 1
wc6fd:: ds 1
wc6fe::
wBattleParticipantsIncludingFainted:: ds 1 ; c6fc
wDanger:: ds 1 ; c6fd
wPlayerMinimized:: ds 1 ; c6fe
wc6ff::
PlayerScreens:: ; c6ff
; bit
; 4 reflect
@ -676,34 +666,25 @@ PlayerScreens:: ; c6ff
; 0 spikes
ds 1
wc700::
EnemyScreens:: ; c700
; see PlayerScreens
ds 1
wc701::
PlayerSafeguardCount:: ; c701
ds 1
wc702::
PlayerLightScreenCount:: ; c702
ds 1
wc703::
PlayerReflectCount:: ; c703
ds 1
wc704:: ds 1
wc705::
ds 1
EnemySafeguardCount:: ; c705
ds 1
wc706::
EnemyLightScreenCount:: ; c706
ds 1
EnemyReflectCount:: ; c707
ds 1
wc708:: ds 1
wc709:: ds 1
wc70a::
ds 2
Weather:: ; c70a
; 00 normal
; 01 rain
@ -714,81 +695,62 @@ Weather:: ; c70a
; 06 sandstorm subsided
ds 1
wc70b::
WeatherCount:: ; c70b
; # turns remaining
ds 1
wc70c::
LoweredStat:: ; c70c
ds 1
wc70d::
EffectFailed:: ; c70d
ds 1
wc70e::
FailedMessage:: ; c70e
ds 1
wc70f::
wEnemyGoesFirst::
wEnemyGoesFirst:: ; c70f
ds 1
wc710::
wPlayerIsSwitching:: ds 1 ; c710
wc711::
wEnemyIsSwitching:: ds 1 ; c711
wc712::
PlayerUsedMoves:: ; c712
; add a move that has been used once by the player
; added in order of use
ds NUM_MOVES
wc716:: ds 1
wEnemySwitchMonParam::
wc717:: ds 1
wc718::
wEnemySwitchMonIndex:: ds 1
wTempLevel::
wc719:: ds 1
LastPlayerMon:: ; c71a
wc71a:: ds 1
wEnemyAISwitchScore:: ds 1 ; c716
wEnemySwitchMonParam:: ds 1 ; c717
wEnemySwitchMonIndex:: ds 1 ; c718
wTempLevel:: ds 1 ; c719
LastPlayerMon:: ds 1 ; c71a
LastPlayerMove:: ; c71b
ds 1
LastEnemyMove:: ; c71c
ds 1
wPlayerFutureSightCount:: ds 1
wEnemyFutureSightCount:: ds 1
wc71f:: ds 1
wc720:: ds 4 ; copy from/to EnemyMonBaseStats, length=7
wc724:: ds 3
wPlayerFutureSightDamage:: ds 2
wEnemyFutureSightDamage:: ds 2
wPlayerRageCounter:: ds 1
wEnemyRageCounter:: ds 1
wc72d:: ds 1 ; if 0 then PrintButItFailed
wc72e::
wPlayerTrappingMove:: ds 1
wc72f::
wEnemyTrappingMove:: ds 1
wc730::
wPlayerWrapCount:: ds 1
wc731::
wEnemyWrapCount:: ds 1
wc732::
wPlayerCharging:: ds 1
wEnemyCharging::
wc733:: ds 1
wTradeAnimPointer::
wc734::
wPlayerFutureSightCount:: ds 1 ; c71d
wEnemyFutureSightCount:: ds 1 ; c71e
wGivingExperienceToExpShareHolders:: ds 1 ; c71f
wBackupEnemyMonBaseStats:: ds 5 ; c720
wBackupEnemyMonCatchRate:: db ; c725
wBackupEnemyMonBaseExp:: db ; c726
wPlayerFutureSightDamage:: ds 2 ; c727
wEnemyFutureSightDamage:: ds 2 ; c729
wPlayerRageCounter:: ds 1 ; c72b
wEnemyRageCounter:: ds 1 ; c72c
wBeatUpHitAtLeastOnce:: ds 1 ; c72d
wPlayerTrappingMove:: ds 1 ; c72e
wEnemyTrappingMove:: ds 1 ; c72f
wPlayerWrapCount:: ds 1 ; c730
wEnemyWrapCount:: ds 1 ; c731
wPlayerCharging:: ds 1 ; c732
wEnemyCharging:: ds 1 ; c733
BattleEnded:: ; c734
ds 1
wWildMonMoves:: ds NUM_MOVES
wWildMonPP:: ds NUM_MOVES
wAmuletCoin:: ds 1
wSomeoneIsRampaging:: ds 1
wPlayerJustGotFrozen:: ds 1
wEnemyJustGotFrozen:: ds 1
wWildMonMoves:: ds NUM_MOVES ; c735
wWildMonPP:: ds NUM_MOVES ; c739
wAmuletCoin:: ds 1 ; c73a
wSomeoneIsRampaging:: ds 1 ; c73b
wPlayerJustGotFrozen:: ds 1 ; c73c
wEnemyJustGotFrozen:: ds 1 ; c73d
wBattleEnd::
; Battle RAM
@ -798,6 +760,7 @@ wTrademons::
wPlayerTrademon:: trademon wPlayerTrademon
wOTTrademon:: trademon wOTTrademon
wTrademonsEnd::
wTradeAnimPointer::
ds 2
wLinkPlayer1Name:: ds NAME_LENGTH
wLinkPlayer2Name:: ds NAME_LENGTH
@ -827,7 +790,8 @@ wPokegearPhoneScrollPosition:: ds 1 ; c6d2
wPokegearPhoneSelectedPerson:: ds 1 ; c6d3
wPokegearPhoneSubmenuCursor:: ds 1 ; c6d4
wPokegearMapCursorObjectPointer:: ds 2 ; c6d5
ds 2
wPokegearMapCursorLandmark:: ds 1 ; c6d7
wPokegearMapPlayerIconLandmark:: ds 1 ; c6d8
wPokegearRadioChannelBank:: ds 1 ; c6d9
wPokegearRadioChannelAddr:: ds 2 ; c6da
wPokegearRadioMusicPlaying:: ds 1 ; c6dc
@ -2226,8 +2190,8 @@ wDudeKeyItems:: ds 18
wDudeKeyItemsEnd:: ds 1
wDudeNumBalls:: ds 1 ; d2a6
wDudeBalls:: ds 2 * 4
wDudeBallsEnd:: ds 1
wDudeBalls:: ds 2 * 4 ; d2a7
wDudeBallsEnd:: ds 1 ; d2af
wDudeBagEnd::
ds wDudeBag - @
@ -2286,15 +2250,12 @@ ScriptDelay:: ; d44d
wPriorityScriptBank::
wScriptTextBank::
wd44e:: ds 1
ds 1 ; d44e
wPriorityScriptAddr::
wScriptTextAddr::
wd44f:: ds 1
wd450:: ds 1
wd451:: ds 1
wScriptTextAddr:: ds 2 ; d44f
ds 1
wWildEncounterCooldown:: ds 1
wd453:: ds 1
wd454:: ds 1
wXYComparePointer:: ds 2
ds 4
wBattleScriptFlags:: ds 2
@ -2494,8 +2455,7 @@ CurTimeOfDay:: ; d848
ds 1
wSecretID:: ds 1
wd84b:: ds 1
wSecretID:: ds 2
StatusFlags:: ; d84c
; 0 - pokedex
; 1 - unown dex
@ -2581,7 +2541,8 @@ PlayerState:: ; d95d
ds 1
wHallOfFameCount:: ds 2
wTradeFlags:: ds 2
wTradeFlags:: flag_array 6 ; d960
ds 1
MooMooBerries:: ; d962
ds 1 ; how many berries fed to MooMoo
UndergroundSwitchPositions:: ; d963
@ -2679,8 +2640,8 @@ wMobileBattleRoomTrigger:: ds 1 ; d9c0
;SECTION "Events", WRAMX, BANK [1]
wJackFightCount:: ds 1
ds 1
wJackFightCount:: ds 1 ; d9f2
wBeverlyFightCount:: ds 1 ; unused
wHueyFightCount:: ds 1
wGavenFightCount:: ds 1
wBethFightCount:: ds 1
@ -2693,23 +2654,21 @@ wLizFightCount:: ds 1
wAnthonyFightCount:: ds 1
wToddFightCount:: ds 1
wGinaFightCount:: ds 1
wda00:: ds 1
wIrwinFightCount:: ds 1 ; unused
wArnieFightCount:: ds 1
wAlanFightCount:: ds 1
wDanaFightCount:: ds 1
wChadFightCount:: ds 1
ds 1
wDerekFightCount:: ds 1 ; unused
wTullyFightCount:: ds 1
wBrentFightCount:: ds 1
wTiffanyFightCount:: ds 1
wVanceFightCount:: ds 1
wWiltonFightCount:: ds 1
ds 1
wKenjiFightCount:: ds 1 ; unused
wParryFightCount:: ds 1
wErinFightCount:: ds 1
; da0e
ds 100
EventFlags:: ; da72
@ -2736,32 +2695,22 @@ BikeFlags:: ; dbf5
ds 1
ds 1
wCurrentMapTriggerPointer:: ; dbf7
ds 2
wCurrentMapTriggerPointer:: ds 2 ; dbf7
wCurrentCaller:: ds 2
wCurrMapWarpCount:: ds 1
wCurrMapWarpHeaderPointer:: ds 1
wdbfd:: ds 1
wCurrentMapXYTriggerCount:: ds 1
wCurrentMapXYTriggerHeaderPointer:: ds 1
wdc00:: ds 1
wCurrentMapSignpostCount:: ds 1
wCurrentMapSignpostHeaderPointer::
wdc02:: ds 1
wdc03:: ds 1
wCurrentMapPersonEventCount::
wdc04:: ds 1
wCurrentMapPersonEventHeaderPointer::
wdc05:: ds 1
wdc06:: ds 1
wCurrMapTriggerCount:: ds 1
wCurrMapTriggerHeaderPointer:: ds 1
wdc09:: ds 1
wCurrMapCallbackCount:: ds 1
wCurrMapCallbackHeaderPointer:: ds 2
wdc0d:: ds 1
wdc0e:: ds 1
wCurrentCaller:: ds 2 ; dbf9
wCurrMapWarpCount:: ds 1 ; dbfb
wCurrMapWarpHeaderPointer:: ds 2 ; dbfc
wCurrentMapXYTriggerCount:: ds 1 ; dbfe
wCurrentMapXYTriggerHeaderPointer:: ds 2 ; dbff
wCurrentMapSignpostCount:: ds 1 ; dc01
wCurrentMapSignpostHeaderPointer:: ds 2 ; dc02
wCurrentMapPersonEventCount:: ds 1 ; dc04
wCurrentMapPersonEventHeaderPointer:: ds 2 ; dc05
wCurrMapTriggerCount:: ds 1 ; dc07
wCurrMapTriggerHeaderPointer:: ds 2 ; dc08
wCurrMapCallbackCount:: ds 1 ; dc0a
wCurrMapCallbackHeaderPointer:: ds 2 ; dc0b
ds 2
; Sprite id of each decoration
Bed:: ; dc0f
@ -2782,40 +2731,32 @@ BigDoll:: ; dc16
ds 1
; Items bought from Mom
wWhichMomItem::
wdc17:: ds 1
wWhichMomItemSet::
ds 1
MomItemTriggerBalance::
wdc19:: ds 1
wdc1a:: ds 1
wdc1b:: ds 1
wWhichMomItem:: ds 1 ; dc17
wWhichMomItemSet:: ds 1 ; dc18
MomItemTriggerBalance:: ds 3 ; dc19
wDailyResetTimer:: ds 2
DailyFlags:: ds 1
WeeklyFlags:: ds 1
SwarmFlags:: ds 1
wdc21:: ds 1
wdc22:: ds 1
ds 2
wStartDay:: ds 1
wdc24:: ds 2
wdc26:: ds 1
ds 3
FruitTreeFlags:: ; dc27
ds 1
FruitTreeFlags:: flag_array NUM_FRUIT_TREES ; dc27
ds 5
ds 2
wLuckyNumberDayBuffer:: ds 2
ds 2
wSpecialPhoneCallID:: ds 1
ds 3
wBugContestStartTime:: ds 4 ; day, hour, min, sec
wdc39:: ds 1
wUnusedTwoDayTimerOn:: ds 1 ; dc39
wUnusedTwoDayTimer:: ds 1
wUnusedTwoDayTimerStartDate:: ds 1
ds 4
wdc40:: ds 1
wMobileOrCable_LastSelection:: ds 1
wdc41:: ds 1
wdc42:: ds 8
wBuenasPassword:: ds 1
@ -2842,6 +2783,7 @@ wParkBallsRemaining::
wSafariBallsRemaining:: ds 1 ; dc79
wSafariTimeRemaining:: ds 2 ; dc7a
wPhoneList:: ds CONTACT_LIST_SIZE ; dc7c
; dc86
ds 23
wLuckyNumberShowFlag:: ds 2 ; dc9d
wLuckyIDNumber:: ds 2 ; dc9f
@ -2966,11 +2908,7 @@ wEggNick:: ds PKMN_NAME_LENGTH ; df65
wEggOT:: ds NAME_LENGTH ; df70
wEggMon:: box_struct wEggMon ; df7b
wdf9b::
wBugContestSecondPartySpecies:: ds 1
wdf9c::
wContestMon:: party_struct wContestMon ; df9c
wDunsparceMapGroup:: ds 1
@ -2997,8 +2935,7 @@ wRoamMons_LastMapGroup:: ds 1
wBestMagikarpLengthFeet:: ds 1
wBestMagikarpLengthInches:: ds 1
wMagikarpRecordHoldersName:: ds NAME_LENGTH
wdff5::
; dff5
wPokemonDataEnd::
wGameDataEnd::