Merge pull request #106 from YamaArashi/master

jpab/jpba macros
This commit is contained in:
Daniel Harding 2015-07-20 17:40:25 -05:00
commit 13e28b0ece
59 changed files with 360 additions and 394 deletions

View file

@ -121,6 +121,24 @@ BOX_DATA EQU 2
DAYCARE_DATA EQU 3 DAYCARE_DATA EQU 3
BATTLE_MON_DATA EQU 4 BATTLE_MON_DATA EQU 4
; player direction constants
PLAYER_DIR_BIT_RIGHT EQU 0
PLAYER_DIR_BIT_LEFT EQU 1
PLAYER_DIR_BIT_DOWN EQU 2
PLAYER_DIR_BIT_UP EQU 3
PLAYER_DIR_RIGHT EQU (1 << PLAYER_DIR_BIT_RIGHT)
PLAYER_DIR_LEFT EQU (1 << PLAYER_DIR_BIT_LEFT)
PLAYER_DIR_DOWN EQU (1 << PLAYER_DIR_BIT_DOWN)
PLAYER_DIR_UP EQU (1 << PLAYER_DIR_BIT_UP)
; flag operations
FLAG_RESET EQU 0
FLAG_SET EQU 1
FLAG_TEST EQU 2
; serial ; serial
ESTABLISH_CONNECTION_WITH_INTERNAL_CLOCK EQU $01 ESTABLISH_CONNECTION_WITH_INTERNAL_CLOCK EQU $01

View file

@ -29,7 +29,7 @@ HallOfFamePC: ; 7405c (1d:405c)
ld c, 128 ld c, 128
call DelayFrames call DelayFrames
xor a xor a
ld [wNumCreditsMonsDisplayed - 1], a ; not read ld [wUnusedCD3D], a ; not read
ld [wNumCreditsMonsDisplayed], a ld [wNumCreditsMonsDisplayed], a
jp Credits jp Credits

View file

@ -187,9 +187,7 @@ SlidePlayerAndEnemySilhouettesOnScreen: ; 3c04c (f:404c)
ld b, $1 ld b, $1
call GoPAL_SET call GoPAL_SET
call HideSprites call HideSprites
ld hl, PrintBeginningBattleText jpab PrintBeginningBattleText
ld b, BANK(PrintBeginningBattleText)
jp Bankswitch
; when a battle is starting, silhouettes of the player's pic and the enemy's pic are slid onto the screen ; when a battle is starting, silhouettes of the player's pic and the enemy's pic are slid onto the screen
; the lower of the player's pic (his body) is part of the background, but his head is a sprite ; the lower of the player's pic (his body) is part of the background, but his head is a sprite
@ -330,7 +328,7 @@ StartBattle: ; 3c11e (f:411e)
call SaveScreenTilesToBuffer1 call SaveScreenTilesToBuffer1
ld a, [wWhichPokemon] ld a, [wWhichPokemon]
ld c, a ld c, a
ld b, $1 ld b, FLAG_SET
push bc push bc
ld hl, wPartyGainExpFlags ld hl, wPartyGainExpFlags
predef FlagActionPredef predef FlagActionPredef
@ -359,9 +357,7 @@ EnemyRan: ; 3c202 (f:4202)
call PlaySoundWaitForCurrent call PlaySoundWaitForCurrent
xor a xor a
ld [H_WHOSETURN], a ld [H_WHOSETURN], a
ld hl, AnimationSlideEnemyMonOut jpab AnimationSlideEnemyMonOut
ld b, BANK(AnimationSlideEnemyMonOut)
jp Bankswitch
WildRanText: ; 3c229 (f:4229) WildRanText: ; 3c229 (f:4229)
TX_FAR _WildRanText TX_FAR _WildRanText
@ -938,9 +934,7 @@ FaintEnemyPokemon: ; 0x3c567
jr nz, .gainExpFlagsLoop jr nz, .gainExpFlagsLoop
ld a, b ld a, b
ld [wPartyGainExpFlags], a ld [wPartyGainExpFlags], a
ld hl, GainExperience jpab GainExperience
ld b, BANK(GainExperience)
jp Bankswitch
EnemyMonFaintedText: ; 0x3c63e EnemyMonFaintedText: ; 0x3c63e
TX_FAR _EnemyMonFaintedText TX_FAR _EnemyMonFaintedText
@ -1087,7 +1081,7 @@ RemoveFaintedPlayerMon: ; 3c741 (f:4741)
ld a, [wPlayerMonNumber] ld a, [wPlayerMonNumber]
ld c, a ld c, a
ld hl, wPartyGainExpFlags ld hl, wPartyGainExpFlags
ld b, $0 ld b, FLAG_RESET
predef FlagActionPredef ; clear gain exp flag for fainted mon predef FlagActionPredef ; clear gain exp flag for fainted mon
ld hl, W_ENEMYBATTSTATUS1 ld hl, W_ENEMYBATTSTATUS1
res 2, [hl] ; reset "attacking multiple times" flag res 2, [hl] ; reset "attacking multiple times" flag
@ -1187,7 +1181,7 @@ ChooseNextMon: ; 3c7d8 (f:47d8)
ld [wPlayerMonNumber], a ld [wPlayerMonNumber], a
ld c, a ld c, a
ld hl, wPartyGainExpFlags ld hl, wPartyGainExpFlags
ld b, $1 ld b, FLAG_SET
push bc push bc
predef FlagActionPredef predef FlagActionPredef
pop bc pop bc
@ -1356,7 +1350,7 @@ EnemySendOut: ; 3c90e (f:490e)
ld [hl],a ld [hl],a
ld a,[wPlayerMonNumber] ld a,[wPlayerMonNumber]
ld c,a ld c,a
ld b,1 ld b,FLAG_SET
push bc push bc
predef FlagActionPredef predef FlagActionPredef
ld hl,wPartyFoughtCurrentEnemyFlags ld hl,wPartyFoughtCurrentEnemyFlags
@ -2496,7 +2490,7 @@ SwitchPlayerMon: ; 3d1ba (f:51ba)
ld a, [wWhichPokemon] ld a, [wWhichPokemon]
ld [wPlayerMonNumber], a ld [wPlayerMonNumber], a
ld c, a ld c, a
ld b, $1 ld b, FLAG_SET
push bc push bc
ld hl, wPartyGainExpFlags ld hl, wPartyGainExpFlags
predef FlagActionPredef predef FlagActionPredef
@ -6302,7 +6296,7 @@ LoadEnemyMonData: ; 3eb01 (f:6b01)
predef WriteMonMoves ; get moves based on current level predef WriteMonMoves ; get moves based on current level
.loadMovePPs .loadMovePPs
ld hl, wEnemyMonMoves ld hl, wEnemyMonMoves
ld de, wEnemyMonSpecial + 1 ld de, wEnemyMonPP - 1
predef LoadMovePPs predef LoadMovePPs
ld hl, W_MONHBASESTATS ld hl, W_MONHBASESTATS
ld de, wEnemyMonBaseStats ld de, wEnemyMonBaseStats
@ -6332,7 +6326,7 @@ LoadEnemyMonData: ; 3eb01 (f:6b01)
ld a, [wd11e] ld a, [wd11e]
dec a dec a
ld c, a ld c, a
ld b, $1 ld b, FLAG_SET
ld hl, wPokedexSeen ld hl, wPokedexSeen
predef FlagActionPredef ; mark this mon as seen in the pokedex predef FlagActionPredef ; mark this mon as seen in the pokedex
ld hl, wEnemyMonLevel ld hl, wEnemyMonLevel
@ -6462,14 +6456,10 @@ LoadPlayerBackPic: ; 3ec92 (f:6c92)
; does nothing since no stats are ever selected (barring glitches) ; does nothing since no stats are ever selected (barring glitches)
DoubleOrHalveSelectedStats: ; 3ed02 (f:6d02) DoubleOrHalveSelectedStats: ; 3ed02 (f:6d02)
callab DoubleSelectedStats callab DoubleSelectedStats
ld hl, HalveSelectedStats jpab HalveSelectedStats
ld b, BANK(HalveSelectedStats)
jp Bankswitch
ScrollTrainerPicAfterBattle: ; 3ed12 (f:6d12) ScrollTrainerPicAfterBattle: ; 3ed12 (f:6d12)
ld hl, _ScrollTrainerPicAfterBattle jpab _ScrollTrainerPicAfterBattle
ld b, BANK(_ScrollTrainerPicAfterBattle)
jp Bankswitch
ApplyBurnAndParalysisPenaltiesToPlayer: ; 3ed1a (f:6d1a) ApplyBurnAndParalysisPenaltiesToPlayer: ; 3ed1a (f:6d1a)
ld a, $1 ld a, $1
@ -6967,7 +6957,7 @@ InitBattle_Common: ; 3efeb (f:6feb)
ld [wLetterPrintingDelayFlags], a ld [wLetterPrintingDelayFlags], a
pop af pop af
ld [wMapPalOffset], a ld [wMapPalOffset], a
ld a, [wd0d4] ld a, [wSavedTilesetType]
ld [hTilesetType], a ld [hTilesetType], a
scf scf
ret ret
@ -7372,9 +7362,7 @@ BadlyPoisonedText: ; 3f2e4 (f:72e4)
db "@" db "@"
DrainHPEffect: ; 3f2e9 (f:72e9) DrainHPEffect: ; 3f2e9 (f:72e9)
ld hl, DrainHPEffect_ jpab DrainHPEffect_
ld b, BANK(DrainHPEffect_)
jp Bankswitch
ExplodeEffect: ; 3f2f1 (f:72f1) ExplodeEffect: ; 3f2f1 (f:72f1)
ld hl, wBattleMonHP ld hl, wBattleMonHP
@ -8209,9 +8197,7 @@ FlinchSideEffect: ; 3f85b (f:785b)
ret ret
OneHitKOEffect: ; 3f884 (f:7884) OneHitKOEffect: ; 3f884 (f:7884)
ld hl, OneHitKOEffect_ jpab OneHitKOEffect_
ld b, BANK(OneHitKOEffect_)
jp Bankswitch
ChargeEffect: ; 3f88c (f:788c) ChargeEffect: ; 3f88c (f:788c)
ld hl, W_PLAYERBATTSTATUS1 ld hl, W_PLAYERBATTSTATUS1
@ -8321,19 +8307,13 @@ TrappingEffect: ; 3f917 (f:7917)
ret ret
MistEffect: ; 3f941 (f:7941) MistEffect: ; 3f941 (f:7941)
ld hl, MistEffect_ jpab MistEffect_
ld b, BANK(MistEffect_)
jp Bankswitch
FocusEnergyEffect: ; 3f949 (f:7949) FocusEnergyEffect: ; 3f949 (f:7949)
ld hl, FocusEnergyEffect_ jpab FocusEnergyEffect_
ld b, BANK(FocusEnergyEffect_)
jp Bankswitch
RecoilEffect: ; 3f951 (f:7951) RecoilEffect: ; 3f951 (f:7951)
ld hl, RecoilEffect_ jpab RecoilEffect_
ld b, BANK(RecoilEffect_)
jp Bankswitch
ConfusionSideEffect: ; 3f959 (f:7959) ConfusionSideEffect: ; 3f959 (f:7959)
call BattleRandom call BattleRandom
@ -8387,14 +8367,10 @@ ConfusionEffectFailed: ; 3f9a6 (f:79a6)
jp ConditionalPrintButItFailed jp ConditionalPrintButItFailed
ParalyzeEffect: ; 3f9b1 (f:79b1) ParalyzeEffect: ; 3f9b1 (f:79b1)
ld hl, ParalyzeEffect_ jpab ParalyzeEffect_
ld b, BANK(ParalyzeEffect_)
jp Bankswitch
SubstituteEffect: ; 3f9b9 (f:79b9) SubstituteEffect: ; 3f9b9 (f:79b9)
ld hl, SubstituteEffect_ jpab SubstituteEffect_
ld b, BANK(SubstituteEffect_)
jp Bankswitch
HyperBeamEffect: ; 3f9c1 (f:79c1) HyperBeamEffect: ; 3f9c1 (f:79c1)
ld hl, W_PLAYERBATTSTATUS2 ld hl, W_PLAYERBATTSTATUS2
@ -8505,9 +8481,7 @@ MimicLearnedMoveText: ; 3fa77 (f:7a77)
db "@" db "@"
LeechSeedEffect: ; 3fa7c (f:7a7c) LeechSeedEffect: ; 3fa7c (f:7a7c)
ld hl, LeechSeedEffect_ jpab LeechSeedEffect_
ld b, BANK(LeechSeedEffect_)
jp Bankswitch
SplashEffect: ; 3fa84 (f:7a84) SplashEffect: ; 3fa84 (f:7a84)
call PlayCurrentMoveAnimation call PlayCurrentMoveAnimation
@ -8601,34 +8575,22 @@ MoveWasDisabledText: ; 3fb09 (f:7b09)
db "@" db "@"
PayDayEffect: ; 3fb0e (f:7b0e) PayDayEffect: ; 3fb0e (f:7b0e)
ld hl, PayDayEffect_ jpab PayDayEffect_
ld b, BANK(PayDayEffect_)
jp Bankswitch
ConversionEffect: ; 3fb16 (f:7b16) ConversionEffect: ; 3fb16 (f:7b16)
ld hl, ConversionEffect_ jpab ConversionEffect_
ld b, BANK(ConversionEffect_)
jp Bankswitch
HazeEffect: ; 3fb1e (f:7b1e) HazeEffect: ; 3fb1e (f:7b1e)
ld hl, HazeEffect_ jpab HazeEffect_
ld b, BANK(HazeEffect_)
jp Bankswitch
HealEffect: ; 3fb26 (f:7b26) HealEffect: ; 3fb26 (f:7b26)
ld hl, HealEffect_ jpab HealEffect_
ld b, BANK(HealEffect_)
jp Bankswitch
TransformEffect: ; 3fb2e (f:7b2e) TransformEffect: ; 3fb2e (f:7b2e)
ld hl, TransformEffect_ jpab TransformEffect_
ld b, BANK(TransformEffect_)
jp Bankswitch
ReflectLightScreenEffect: ; 3fb36 (f:7b36) ReflectLightScreenEffect: ; 3fb36 (f:7b36)
ld hl, ReflectLightScreenEffect_ jpab ReflectLightScreenEffect_
ld b, BANK(ReflectLightScreenEffect_)
jp Bankswitch
NothingHappenedText: ; 3fb3e (f:7b3e) NothingHappenedText: ; 3fb3e (f:7b3e)
TX_FAR _NothingHappenedText TX_FAR _NothingHappenedText

View file

@ -15,7 +15,7 @@ GainExperience: ; 5524f (15:524f)
ld hl, wPartyGainExpFlags ld hl, wPartyGainExpFlags
ld a, [wWhichPokemon] ld a, [wWhichPokemon]
ld c, a ld c, a
ld b, $2 ld b, FLAG_TEST
predef FlagActionPredef predef FlagActionPredef
ld a, c ld a, c
and a ; is mon's gain exp flag set? and a ; is mon's gain exp flag set?
@ -257,7 +257,7 @@ GainExperience: ; 5524f (15:524f)
ld hl, wCanEvolveFlags ld hl, wCanEvolveFlags
ld a, [wWhichPokemon] ld a, [wWhichPokemon]
ld c, a ld c, a
ld b, $1 ld b, FLAG_SET
predef FlagActionPredef predef FlagActionPredef
pop hl pop hl
pop af pop af
@ -281,7 +281,7 @@ GainExperience: ; 5524f (15:524f)
ld [hl], a ; clear gain exp flags ld [hl], a ; clear gain exp flags
ld a, [wPlayerMonNumber] ld a, [wPlayerMonNumber]
ld c, a ld c, a
ld b, $1 ld b, FLAG_SET
push bc push bc
predef FlagActionPredef ; set the gain exp flag for the mon that is currently out predef FlagActionPredef ; set the gain exp flag for the mon that is currently out
ld hl, wPartyFoughtCurrentEnemyFlags ld hl, wPartyFoughtCurrentEnemyFlags

View file

@ -1,6 +1,6 @@
InitBattleVariables: ; 525af (14:65af) InitBattleVariables: ; 525af (14:65af)
ld a, [hTilesetType] ld a, [hTilesetType]
ld [wd0d4], a ld [wSavedTilesetType], a
xor a xor a
ld [wActionResultOrTookBattleTurn], a ld [wActionResultOrTookBattleTurn], a
ld [wBattleResult], a ld [wBattleResult], a
@ -35,6 +35,4 @@ InitBattleVariables: ; 525af (14:65af)
ld a, $2 ; safari battle ld a, $2 ; safari battle
ld [W_BATTLETYPE], a ld [W_BATTLETYPE], a
.notSafariBattle .notSafariBattle
ld hl, PlayBattleMusic jpab PlayBattleMusic
ld b, BANK(PlayBattleMusic)
jp Bankswitch

View file

@ -14,9 +14,7 @@ FocusEnergyEffect_: ; 27f86 (9:7f86)
.alreadyUsing .alreadyUsing
ld c, 50 ld c, 50
call DelayFrames call DelayFrames
ld hl, PrintButItFailedText_ jpab PrintButItFailedText_
ld b, BANK(PrintButItFailedText_)
jp Bankswitch
GettingPumpedText: ; 27fb3 (9:7fb3) GettingPumpedText: ; 27fb3 (9:7fb3)
db $0a db $0a

View file

@ -12,9 +12,7 @@ MistEffect_: ; 33f2b (c:7f2b)
ld hl, ShroudedInMistText ld hl, ShroudedInMistText
jp PrintText jp PrintText
.mistAlreadyInUse .mistAlreadyInUse
ld hl, PrintButItFailedText_ jpab PrintButItFailedText_
ld b, BANK(PrintButItFailedText_)
jp Bankswitch
ShroudedInMistText: ; 33f52 (c:7f52) ShroudedInMistText: ; 33f52 (c:7f52)
TX_FAR _ShroudedInMistText TX_FAR _ShroudedInMistText

View file

@ -36,18 +36,12 @@ ParalyzeEffect_: ; 52601 (14:6601)
ld c, 30 ld c, 30
call DelayFrames call DelayFrames
callab PlayCurrentMoveAnimation callab PlayCurrentMoveAnimation
ld hl, PrintMayNotAttackText jpab PrintMayNotAttackText
ld b, BANK(PrintMayNotAttackText)
jp Bankswitch
.didntAffect .didntAffect
ld c, 50 ld c, 50
call DelayFrames call DelayFrames
ld hl, PrintDidntAffectText jpab PrintDidntAffectText
ld b, BANK(PrintDidntAffectText)
jp Bankswitch
.doesntAffect .doesntAffect
ld c, 50 ld c, 50
call DelayFrames call DelayFrames
ld hl, PrintDoesntAffectText jpab PrintDoesntAffectText
ld b, BANK(PrintDoesntAffectText)
jp Bankswitch

View file

@ -55,9 +55,7 @@ SubstituteEffect_: ; 17dad (5:7dad)
call Bankswitch ; jump to routine depending on animation setting call Bankswitch ; jump to routine depending on animation setting
ld hl, SubstituteText ld hl, SubstituteText
call PrintText call PrintText
ld hl, DrawHUDsAndHPBars jpab DrawHUDsAndHPBars
ld b, BANK(DrawHUDsAndHPBars)
jp Bankswitch
.alreadyHasSubstitute .alreadyHasSubstitute
ld hl, HasSubstituteText ld hl, HasSubstituteText
jr .printText jr .printText

View file

@ -5,7 +5,7 @@ TryEvolvingMon: ; 3ad0e (e:6d0e)
ld [hl], a ld [hl], a
ld a, [wWhichPokemon] ld a, [wWhichPokemon]
ld c, a ld c, a
ld b, $1 ld b, FLAG_SET
call Evolution_FlagAction call Evolution_FlagAction
; this is only called after battle ; this is only called after battle
@ -36,7 +36,7 @@ Evolution_PartyMonLoop: ; loop over party mons
ld a, [wWhichPokemon] ld a, [wWhichPokemon]
ld c, a ld c, a
ld hl, wCanEvolveFlags ld hl, wCanEvolveFlags
ld b, $2 ld b, FLAG_TEST
call Evolution_FlagAction call Evolution_FlagAction
ld a, c ld a, c
and a ; is the mon's bit set? and a ; is the mon's bit set?
@ -217,7 +217,7 @@ Evolution_PartyMonLoop: ; loop over party mons
ld a, [wd11e] ld a, [wd11e]
dec a dec a
ld c, a ld c, a
ld b, $1 ld b, FLAG_SET
ld hl, wPokedexOwned ld hl, wPokedexOwned
push bc push bc
call Evolution_FlagAction call Evolution_FlagAction

View file

@ -60,7 +60,7 @@ SetPokedexOwnedFlag: ; 4fe11 (13:7e11)
dec a dec a
ld c, a ld c, a
ld hl, wPokedexOwned ld hl, wPokedexOwned
ld b, $1 ld b, FLAG_SET
predef FlagActionPredef predef FlagActionPredef
pop af pop af
ld [wd11e], a ld [wd11e], a

View file

@ -34,9 +34,7 @@ PrintBookshelfText: ; fb50 (3:7b50)
.noMatch .noMatch
ld a, $ff ld a, $ff
ld [$ffdb], a ld [$ffdb], a
ld b, BANK(PrintCardKeyText) jpba PrintCardKeyText
ld hl, PrintCardKeyText
jp Bankswitch
; format: db tileset id, bookshelf tile id, text id ; format: db tileset id, bookshelf tile id, text id
BookshelfTileIDs: ; fb8b (3:7b8b) BookshelfTileIDs: ; fb8b (3:7b8b)

View file

@ -78,7 +78,7 @@ SafariZoneGameOver: ; 1e9b0 (7:69b0)
ld [H_DOWNARROWBLINKCNT2], a ld [H_DOWNARROWBLINKCNT2], a
call DisplayTextID call DisplayTextID
xor a xor a
ld [wd528], a ld [wPlayerMovingDirection], a
ld a, SAFARI_ZONE_ENTRANCE ld a, SAFARI_ZONE_ENTRANCE
ld [H_DOWNARROWBLINKCNT1], a ld [H_DOWNARROWBLINKCNT1], a
ld a, $3 ld a, $3
@ -209,7 +209,7 @@ CinnabarGymQuiz_1ea92: ; 1ea92 (7:6a92)
call PrintText call PrintText
ld a, [$ffe0] ld a, [$ffe0]
ld c, a ld c, a
ld b, $1 ld b, FLAG_SET
call CinnabarGymQuiz_1ea8a call CinnabarGymQuiz_1ea8a
jp CinnabarGymQuiz_1eb0a jp CinnabarGymQuiz_1eb0a
.asm_1eab8 .asm_1eab8
@ -222,7 +222,7 @@ CinnabarGymQuiz_1ea92: ; 1ea92 (7:6a92)
ld a, [$ffdb] ld a, [$ffdb]
add $2 add $2
ld c, a ld c, a
ld b, $2 ld b, FLAG_TEST
ld hl, wd79a ld hl, wd79a
predef FlagActionPredef predef FlagActionPredef
ld a, c ld a, c
@ -241,7 +241,7 @@ CinnabarGymQuizCorrectText: ; 1eae3 (7:6ae3)
ld a, [$ffe0] ld a, [$ffe0]
ld c, a ld c, a
ld b, $2 ld b, FLAG_TEST
call CinnabarGymQuiz_1ea8a call CinnabarGymQuiz_1ea8a
ld a, c ld a, c
and a and a
@ -278,7 +278,7 @@ CinnabarGymQuiz_1eb0a: ; 1eb0a (7:6b0a)
ld a, [$ffdb] ld a, [$ffdb]
ld [$ffe0], a ld [$ffe0], a
ld c, a ld c, a
ld b, $2 ld b, FLAG_TEST
call CinnabarGymQuiz_1ea8a call CinnabarGymQuiz_1ea8a
ld a, c ld a, c
and a and a

View file

@ -38,7 +38,7 @@ DoInGameTradeDialogue: ; 71ad9 (1c:5ad9)
ld hl,wCompletedInGameTradeFlags ld hl,wCompletedInGameTradeFlags
ld a,[wWhichTrade] ld a,[wWhichTrade]
ld c,a ld c,a
ld b,$2 ld b,FLAG_TEST
predef FlagActionPredef predef FlagActionPredef
ld a,c ld a,c
and a and a
@ -112,7 +112,7 @@ InGameTrade_DoTrade: ; 71c07 (1c:5c07)
ld hl,wCompletedInGameTradeFlags ld hl,wCompletedInGameTradeFlags
ld a,[wWhichTrade] ld a,[wWhichTrade]
ld c,a ld c,a
ld b,$1 ld b,FLAG_SET
predef FlagActionPredef predef FlagActionPredef
ld hl, ConnectCableText ld hl, ConnectCableText
call PrintText call PrintText
@ -159,9 +159,7 @@ InGameTrade_RestoreScreen: ; 71ca2 (1c:5ca2)
call LoadGBPal call LoadGBPal
ld c, 10 ld c, 10
call DelayFrames call DelayFrames
ld b, BANK(LoadWildData) jpba LoadWildData
ld hl, LoadWildData
jp Bankswitch
InGameTrade_PrepareTradeData: ; 71cc1 (1c:5cc1) InGameTrade_PrepareTradeData: ; 71cc1 (1c:5cc1)
ld hl, wTradedPlayerMonSpecies ld hl, wTradedPlayerMonSpecies

View file

@ -10,7 +10,7 @@ HiddenItemNear: ; 7481f (1d:481f)
push hl push hl
ld hl, wObtainedHiddenItemsFlags ld hl, wObtainedHiddenItemsFlags
ld c, b ld c, b
ld b, $2 ld b, FLAG_TEST
predef FlagActionPredef predef FlagActionPredef
ld a, c ld a, c
pop hl pop hl

View file

@ -400,15 +400,15 @@ ItemUseBall: ; d687 (3:5687)
ld a,[wd11e] ld a,[wd11e]
dec a dec a
ld c,a ld c,a
ld b,2 ld b,FLAG_TEST
ld hl,wPokedexOwned ;Dex_own_flags (pokemon) ld hl,wPokedexOwned
predef FlagActionPredef predef FlagActionPredef
ld a,c ld a,c
push af push af
ld a,[wd11e] ld a,[wd11e]
dec a dec a
ld c,a ld c,a
ld b,1 ld b,FLAG_SET
predef FlagActionPredef predef FlagActionPredef
pop af pop af
and a and a
@ -499,9 +499,7 @@ ItemUseTownMap: ; d968 (3:5968)
ld a,[W_ISINBATTLE] ld a,[W_ISINBATTLE]
and a and a
jp nz,ItemUseNotTime jp nz,ItemUseNotTime
ld b, BANK(DisplayTownMap) jpba DisplayTownMap
ld hl, DisplayTownMap
jp Bankswitch ; display Town Map
ItemUseBicycle: ; d977 (3:5977) ItemUseBicycle: ; d977 (3:5977)
ld a,[W_ISINBATTLE] ld a,[W_ISINBATTLE]
@ -593,14 +591,14 @@ ItemUseSurfboard: ; d9b4 (3:59b4)
jp LoadWalkingPlayerSpriteGraphics jp LoadWalkingPlayerSpriteGraphics
; uses a simulated button press to make the player move forward ; uses a simulated button press to make the player move forward
.makePlayerMoveForward .makePlayerMoveForward
ld a,[wd52a] ; direction the player is going ld a,[wPlayerDirection] ; direction the player is going
bit 3,a bit PLAYER_DIR_BIT_UP,a
ld b,D_UP ld b,D_UP
jr nz,.storeSimulatedButtonPress jr nz,.storeSimulatedButtonPress
bit 2,a bit PLAYER_DIR_BIT_DOWN,a
ld b,D_DOWN ld b,D_DOWN
jr nz,.storeSimulatedButtonPress jr nz,.storeSimulatedButtonPress
bit 1,a bit PLAYER_DIR_BIT_LEFT,a
ld b,D_LEFT ld b,D_LEFT
jr nz,.storeSimulatedButtonPress jr nz,.storeSimulatedButtonPress
ld b,D_RIGHT ld b,D_RIGHT
@ -806,7 +804,7 @@ ItemUseMedicine: ; dabb (3:5abb)
ld a,[wUsedItemOnWhichPokemon] ld a,[wUsedItemOnWhichPokemon]
ld c,a ld c,a
ld hl,wPartyFoughtCurrentEnemyFlags ld hl,wPartyFoughtCurrentEnemyFlags
ld b,$02 ld b,FLAG_TEST
predef FlagActionPredef predef FlagActionPredef
ld a,c ld a,c
and a and a
@ -814,7 +812,7 @@ ItemUseMedicine: ; dabb (3:5abb)
ld a,[wUsedItemOnWhichPokemon] ld a,[wUsedItemOnWhichPokemon]
ld c,a ld c,a
ld hl,wPartyGainExpFlags ld hl,wPartyGainExpFlags
ld b,$01 ld b,FLAG_SET
predef FlagActionPredef predef FlagActionPredef
.next .next
pop bc pop bc
@ -2552,8 +2550,8 @@ IsKeyItem_: ; e764 (3:6764)
dec a dec a
ld c,a ld c,a
ld hl,wHPBarMaxHP ld hl,wHPBarMaxHP
ld b,$02 ; test bit ld b,FLAG_TEST
predef FlagActionPredef ; bitfield operation function predef FlagActionPredef
ld a,c ld a,c
and a and a
ret nz ret nz

View file

@ -17,7 +17,7 @@ CanLearnTM: ; 1373e (4:773e)
jr .findTMloop jr .findTMloop
.TMfoundLoop .TMfoundLoop
pop hl pop hl
ld b, $2 ; read corresponding bit from TM compatibility array ld b, FLAG_TEST
predef_jump FlagActionPredef predef_jump FlagActionPredef
; converts TM/HM number in wd11e into move number ; converts TM/HM number in wd11e into move number

View file

@ -110,9 +110,7 @@ LeaguePCShowMon: ; 76610 (1d:6610)
ld de, wHoFTeamNo ld de, wHoFTeamNo
ld bc, $0103 ld bc, $0103
call PrintNumber call PrintNumber
ld b, BANK(HoFDisplayMonInfo) jpba HoFDisplayMonInfo
ld hl, HoFDisplayMonInfo
jp Bankswitch
HallOfFameNoText: ; 76670 (1d:6670) HallOfFameNoText: ; 76670 (1d:6670)
db "HALL OF FAME No @" db "HALL OF FAME No @"

View file

@ -107,8 +107,8 @@ MainMenu: ; 5af2 (1:5af2)
.pressedA .pressedA
call GBPalWhiteOutWithDelay3 call GBPalWhiteOutWithDelay3
call ClearScreen call ClearScreen
ld a,4 ld a,PLAYER_DIR_DOWN
ld [wd52a],a ld [wPlayerDirection],a
ld c,10 ld c,10
call DelayFrames call DelayFrames
ld a,[wNumHoFTeams] ld a,[wNumHoFTeams]

View file

@ -172,9 +172,7 @@ DisplayNamingScreen: ; 6596 (1:6596)
ld a, [W_ISINBATTLE] ld a, [W_ISINBATTLE]
and a and a
jp z, LoadTextBoxTilePatterns jp z, LoadTextBoxTilePatterns
ld hl, LoadHudTilePatterns jpab LoadHudTilePatterns
ld b, BANK(LoadHudTilePatterns)
jp Bankswitch
.namingScreenButtonFunctions .namingScreenButtonFunctions
dw .dPadReturnPoint dw .dPadReturnPoint

View file

@ -379,7 +379,7 @@ IsPokemonBitSet: ; 402c2 (10:42c2)
ld a,[wd11e] ld a,[wd11e]
dec a dec a
ld c,a ld c,a
ld b,2 ld b,FLAG_TEST
predef FlagActionPredef predef FlagActionPredef
ld a,c ld a,c
and a and a

View file

@ -179,7 +179,7 @@ LoadCoinsToSubtract: ; 528b1 (14:68b1)
ld hl,wd141 ; first prize's price ld hl,wd141 ; first prize's price
add hl,de ; get selected prize's price add hl,de ; get selected prize's price
xor a xor a
ld [hCoins - 1],a ld [hUnusedCoinsByte],a
ld a,[hli] ld a,[hli]
ld [hCoins],a ld [hCoins],a
ld a,[hl] ld a,[hl]

View file

@ -111,9 +111,7 @@ Func_72a8: ; 72a8 (1:72a8)
xor a xor a
ld [hld], a ld [hld], a
ld [hl], a ld [hl], a
ld hl, LinkMenu jpab LinkMenu
ld b, BANK(LinkMenu)
jp Bankswitch
CableClubNPCAreaReservedFor2FriendsLinkedByCableText: ; 72b3 (1:72b3) CableClubNPCAreaReservedFor2FriendsLinkedByCableText: ; 72b3 (1:72b3)
TX_FAR _CableClubNPCAreaReservedFor2FriendsLinkedByCableText TX_FAR _CableClubNPCAreaReservedFor2FriendsLinkedByCableText

View file

@ -5,7 +5,7 @@ HiddenItems: ; 76688 (1d:6688)
ld hl, wObtainedHiddenItemsFlags ld hl, wObtainedHiddenItemsFlags
ld a, [wHiddenItemOrCoinsIndex] ld a, [wHiddenItemOrCoinsIndex]
ld c, a ld c, a
ld b, $2 ld b, FLAG_TEST
predef FlagActionPredef predef FlagActionPredef
ld a, c ld a, c
and a and a
@ -31,7 +31,7 @@ FoundHiddenItemText: ; 7675b (1d:675b)
ld hl, wObtainedHiddenItemsFlags ld hl, wObtainedHiddenItemsFlags
ld a, [wTrainerScreenX] ld a, [wTrainerScreenX]
ld c, a ld c, a
ld b, $1 ld b, FLAG_SET
predef FlagActionPredef predef FlagActionPredef
ld a, SFX_GET_ITEM_2 ld a, SFX_GET_ITEM_2
call PlaySoundWaitForCurrent call PlaySoundWaitForCurrent
@ -61,13 +61,13 @@ HiddenCoins: ; 76799 (1d:6799)
ld hl, wObtainedHiddenCoinsFlags ld hl, wObtainedHiddenCoinsFlags
ld a, [wHiddenItemOrCoinsIndex] ld a, [wHiddenItemOrCoinsIndex]
ld c, a ld c, a
ld b, $2 ld b, FLAG_TEST
predef FlagActionPredef predef FlagActionPredef
ld a, c ld a, c
and a and a
ret nz ret nz
xor a xor a
ld [hCoins - 1], a ld [hUnusedCoinsByte], a
ld [hCoins], a ld [hCoins], a
ld [hCoins + 1], a ld [hCoins + 1], a
ld a, [wHiddenObjectFunctionArgument] ld a, [wHiddenObjectFunctionArgument]
@ -102,7 +102,7 @@ HiddenCoins: ; 76799 (1d:6799)
ld hl, wObtainedHiddenCoinsFlags ld hl, wObtainedHiddenCoinsFlags
ld a, [wTrainerScreenX] ld a, [wTrainerScreenX]
ld c, a ld c, a
ld b, $1 ld b, FLAG_SET
predef FlagActionPredef predef FlagActionPredef
call EnableAutoTextBoxDrawing call EnableAutoTextBoxDrawing
ld a, [wPlayerCoins] ld a, [wPlayerCoins]

View file

@ -25,24 +25,24 @@ UpdatePlayerSprite: ; 4e31 (1:4e31)
ld a, [wWalkCounter] ld a, [wWalkCounter]
and a and a
jr nz, .moving jr nz, .moving
ld a, [wd528] ld a, [wPlayerMovingDirection]
; check if down ; check if down
bit 2, a bit PLAYER_DIR_BIT_DOWN, a
jr z, .checkIfUp jr z, .checkIfUp
xor a ; ld a, SPRITE_FACING_DOWN xor a ; ld a, SPRITE_FACING_DOWN
jr .next jr .next
.checkIfUp .checkIfUp
bit 3, a bit PLAYER_DIR_BIT_UP, a
jr z, .checkIfLeft jr z, .checkIfLeft
ld a, SPRITE_FACING_UP ld a, SPRITE_FACING_UP
jr .next jr .next
.checkIfLeft .checkIfLeft
bit 1, a bit PLAYER_DIR_BIT_LEFT, a
jr z, .checkIfRight jr z, .checkIfRight
ld a, SPRITE_FACING_LEFT ld a, SPRITE_FACING_LEFT
jr .next jr .next
.checkIfRight .checkIfRight
bit 0, a bit PLAYER_DIR_BIT_RIGHT, a
jr z, .notMoving jr z, .notMoving
ld a, SPRITE_FACING_RIGHT ld a, SPRITE_FACING_RIGHT
jr .next jr .next
@ -405,23 +405,23 @@ InitializeSpriteFacingDirection: ; 507f (1:507f)
bit 5, a bit 5, a
jr nz, notYetMoving jr nz, notYetMoving
res 7, [hl] res 7, [hl]
ld a, [wd52a] ld a, [wPlayerDirection]
bit 3, a bit PLAYER_DIR_BIT_UP, a
jr z, .notFacingDown jr z, .notFacingDown
ld c, $0 ; make sprite face down ld c, SPRITE_FACING_DOWN
jr .facingDirectionDetermined jr .facingDirectionDetermined
.notFacingDown .notFacingDown
bit 2, a bit PLAYER_DIR_BIT_DOWN, a
jr z, .notFacingUp jr z, .notFacingUp
ld c, $4 ; make sprite face up ld c, SPRITE_FACING_UP
jr .facingDirectionDetermined jr .facingDirectionDetermined
.notFacingUp .notFacingUp
bit 1, a bit PLAYER_DIR_BIT_LEFT, a
jr z, .notFacingRight jr z, .notFacingRight
ld c, $c ; make sprite face right ld c, SPRITE_FACING_RIGHT
jr .facingDirectionDetermined jr .facingDirectionDetermined
.notFacingRight .notFacingRight
ld c, $8 ; make sprite face left ld c, SPRITE_FACING_LEFT
.facingDirectionDetermined .facingDirectionDetermined
ld a, [H_CURRENTSPRITEOFFSET] ld a, [H_CURRENTSPRITEOFFSET]
add $9 add $9

View file

@ -10,9 +10,7 @@ RemoveGuardDrink: ; 5a59f (16:659f)
call IsItemInBag call IsItemInBag
pop hl pop hl
jr z, .drinkLoop jr z, .drinkLoop
ld b, BANK(RemoveItemByID) jpba RemoveItemByID
ld hl, RemoveItemByID
jp Bankswitch
GuardDrinksList: ; 5a5b7 (16:65b7) GuardDrinksList: ; 5a5b7 (16:65b7)
db FRESH_WATER, SODA_POP, LEMONADE, $00 db FRESH_WATER, SODA_POP, LEMONADE, $00

View file

@ -262,9 +262,7 @@ ENDC
jp MainMenu jp MainMenu
.doClearSaveDialogue .doClearSaveDialogue
ld b, BANK(DoClearSaveDialogue) jpba DoClearSaveDialogue
ld hl, DoClearSaveDialogue
jp Bankswitch
TitleScreenPickNewMon: ; 4496 (1:4496) TitleScreenPickNewMon: ; 4496 (1:4496)
ld a, vBGMap0 / $100 ld a, vBGMap0 / $100

View file

@ -199,9 +199,7 @@ LoadTradingGFXAndMonNames: ; 411a1 (10:51a1)
Trade_LoadMonPartySpriteGfx: ; 4120b (10:520b) Trade_LoadMonPartySpriteGfx: ; 4120b (10:520b)
ld a, %11010000 ld a, %11010000
ld [rOBP1], a ld [rOBP1], a
ld b, BANK(LoadMonPartySpriteGfx) jpba LoadMonPartySpriteGfx
ld hl, LoadMonPartySpriteGfx
jp Bankswitch
Trade_SwapNames: ; 41217 (10:5217) Trade_SwapNames: ; 41217 (10:5217)
ld hl, wPlayerName ld hl, wPlayerName

View file

@ -253,9 +253,7 @@ DrawHPBar:: ; 1336 (0:1336)
; wLoadedMon = base address of pokemon data ; wLoadedMon = base address of pokemon data
; W_MONHDEXNUM = base address of base stats ; W_MONHDEXNUM = base address of base stats
LoadMonData:: ; 1372 (0:1372) LoadMonData:: ; 1372 (0:1372)
ld hl, LoadMonData_ jpab LoadMonData_
ld b, BANK(LoadMonData_)
jp Bankswitch
OverwritewMoves:: ; 137a (0:137a) OverwritewMoves:: ; 137a (0:137a)
@ -1317,9 +1315,7 @@ CountSetBits:: ; 2b7f (0:2b7f)
; subtracts the amount the player paid from their money ; subtracts the amount the player paid from their money
; sets carry flag if there is enough money and unsets carry flag if not ; sets carry flag if there is enough money and unsets carry flag if not
SubtractAmountPaidFromMoney:: ; 2b96 (0:2b96) SubtractAmountPaidFromMoney:: ; 2b96 (0:2b96)
ld b,BANK(SubtractAmountPaidFromMoney_) jpba SubtractAmountPaidFromMoney_
ld hl,SubtractAmountPaidFromMoney_
jp Bankswitch
; adds the amount the player sold to their money ; adds the amount the player sold to their money
AddAmountSoldToMoney:: ; 2b9e (0:2b9e) AddAmountSoldToMoney:: ; 2b9e (0:2b9e)
@ -2077,9 +2073,7 @@ ReloadTilesetTilePatterns:: ; 3090 (0:3090)
ChooseFlyDestination:: ; 30a9 (0:30a9) ChooseFlyDestination:: ; 30a9 (0:30a9)
ld hl,wd72e ld hl,wd72e
res 4,[hl] res 4,[hl]
ld b, BANK(LoadTownMap_Fly) jpba LoadTownMap_Fly
ld hl, LoadTownMap_Fly
jp Bankswitch
; causes the text box to close without waiting for a button press after displaying text ; causes the text box to close without waiting for a button press after displaying text
DisableWaitingAfterTextDisplay:: ; 30b6 (0:30b6) DisableWaitingAfterTextDisplay:: ; 30b6 (0:30b6)
@ -2097,9 +2091,7 @@ DisableWaitingAfterTextDisplay:: ; 30b6 (0:30b6)
; 01: successful ; 01: successful
; 02: not able to be used right now, no extra menu displayed (only certain items use this) ; 02: not able to be used right now, no extra menu displayed (only certain items use this)
UseItem:: ; 30bc (0:30bc) UseItem:: ; 30bc (0:30bc)
ld b,BANK(UseItem_) jpba UseItem_
ld hl,UseItem_
jp Bankswitch
; confirms the item toss and then tosses the item ; confirms the item toss and then tosses the item
; INPUT: ; INPUT:
@ -2201,14 +2193,10 @@ RunNPCMovementScript:: ; 310e (0:310e)
dw PewterMuseumGuyMovementScriptPointerTable dw PewterMuseumGuyMovementScriptPointerTable
dw PewterGymGuyMovementScriptPointerTable dw PewterGymGuyMovementScriptPointerTable
.playerStepOutFromDoor .playerStepOutFromDoor
ld b, BANK(PlayerStepOutFromDoor) jpba PlayerStepOutFromDoor
ld hl, PlayerStepOutFromDoor
jp Bankswitch
EndNPCMovementScript:: ; 314e (0:314e) EndNPCMovementScript:: ; 314e (0:314e)
ld b, BANK(_EndNPCMovementScript) jpba _EndNPCMovementScript
ld hl, _EndNPCMovementScript
jp Bankswitch
EmptyFunc2:: ; 3156 (0:3156) EmptyFunc2:: ; 3156 (0:3156)
ret ret
@ -2309,7 +2297,7 @@ TalkToTrainer:: ; 31cc (0:31cc)
call ReadTrainerHeaderInfo ; read flag's byte ptr call ReadTrainerHeaderInfo ; read flag's byte ptr
ld a, [wTrainerHeaderFlagBit] ld a, [wTrainerHeaderFlagBit]
ld c, a ld c, a
ld b, $2 ld b, FLAG_TEST
call TrainerFlagAction ; read trainer's flag call TrainerFlagAction ; read trainer's flag
ld a, c ld a, c
and a and a
@ -2404,7 +2392,7 @@ EndTrainerBattle:: ; 3275 (0:3275)
call ReadTrainerHeaderInfo call ReadTrainerHeaderInfo
ld a, [wTrainerHeaderFlagBit] ld a, [wTrainerHeaderFlagBit]
ld c, a ld c, a
ld b, $1 ld b, FLAG_SET
call TrainerFlagAction ; flag trainer as fought call TrainerFlagAction ; flag trainer as fought
ld a, [W_ENEMYMONORTRAINERCLASS] ld a, [W_ENEMYMONORTRAINERCLASS]
cp $c8 cp $c8
@ -2434,9 +2422,7 @@ ResetButtonPressedAndMapScript:: ; 32c1 (0:32c1)
; calls TrainerWalkUpToPlayer ; calls TrainerWalkUpToPlayer
TrainerWalkUpToPlayer_Bank0:: ; 32cf (0:32cf) TrainerWalkUpToPlayer_Bank0:: ; 32cf (0:32cf)
ld b, BANK(TrainerWalkUpToPlayer) jpba TrainerWalkUpToPlayer
ld hl, TrainerWalkUpToPlayer
jp Bankswitch
; sets opponent type and mon set/lvl based on the engaging trainer data ; sets opponent type and mon set/lvl based on the engaging trainer data
InitBattleEnemyParameters:: ; 32d7 (0:32d7) InitBattleEnemyParameters:: ; 32d7 (0:32d7)
@ -2484,7 +2470,7 @@ CheckForEngagingTrainers:: ; 3306 (0:3306)
ret z ret z
ld a, $2 ld a, $2
call ReadTrainerHeaderInfo ; read trainer flag's byte ptr call ReadTrainerHeaderInfo ; read trainer flag's byte ptr
ld b, $2 ld b, FLAG_TEST
ld a, [wTrainerHeaderFlagBit] ld a, [wTrainerHeaderFlagBit]
ld c, a ld c, a
call TrainerFlagAction ; read trainer flag call TrainerFlagAction ; read trainer flag
@ -2726,9 +2712,7 @@ IsItemInBag:: ; 3493 (0:3493)
DisplayPokedex:: ; 349b (0:349b) DisplayPokedex:: ; 349b (0:349b)
ld [wd11e], a ld [wd11e], a
ld b, BANK(_DisplayPokedex) jpba _DisplayPokedex
ld hl, _DisplayPokedex
jp Bankswitch
SetSpriteFacingDirectionAndDelay:: ; 34a6 (0:34a6) SetSpriteFacingDirectionAndDelay:: ; 34a6 (0:34a6)
call SetSpriteFacingDirection call SetSpriteFacingDirection
@ -2937,9 +2921,7 @@ GetTrainerInformation:: ; 3566 (0:3566)
ret ret
GetTrainerName:: ; 359e (0:359e) GetTrainerName:: ; 359e (0:359e)
ld b, BANK(GetTrainerName_) jpba GetTrainerName_
ld hl, GetTrainerName_
jp Bankswitch
HasEnoughMoney:: HasEnoughMoney::
@ -3604,9 +3586,7 @@ CopyDataUntil:: ; 3913 (0:3913)
; [wRemoveMonFromBox] == 0 specifies the party. ; [wRemoveMonFromBox] == 0 specifies the party.
; [wRemoveMonFromBox] != 0 specifies the current box. ; [wRemoveMonFromBox] != 0 specifies the current box.
RemovePokemon:: ; 391f (0:391f) RemovePokemon:: ; 391f (0:391f)
ld hl, _RemovePokemon jpab _RemovePokemon
ld b, BANK(_RemovePokemon)
jp Bankswitch
AddPartyMon:: ; 3927 (0:3927) AddPartyMon:: ; 3927 (0:3927)
push hl push hl
@ -4590,9 +4570,7 @@ GivePokemon::
ld [W_CURENEMYLVL], a ld [W_CURENEMYLVL], a
xor a ; PLAYER_PARTY_DATA xor a ; PLAYER_PARTY_DATA
ld [wMonDataLocation], a ld [wMonDataLocation], a
ld b, BANK(_GivePokemon) jpba _GivePokemon
ld hl, _GivePokemon
jp Bankswitch
Random:: Random::
@ -4613,9 +4591,7 @@ INCLUDE "home/predef.asm"
Func_3ead:: ; 3ead (0:3ead) Func_3ead:: ; 3ead (0:3ead)
ld b, BANK(CinnabarGymQuiz_1eb0a) jpba CinnabarGymQuiz_1eb0a
ld hl, CinnabarGymQuiz_1eb0a
jp Bankswitch
CheckForHiddenObjectOrBookshelfOrCardKeyDoor:: ; 3eb5 (0:3eb5) CheckForHiddenObjectOrBookshelfOrCardKeyDoor:: ; 3eb5 (0:3eb5)
ld a, [H_LOADEDROMBANK] ld a, [H_LOADEDROMBANK]

View file

@ -1,9 +1,7 @@
HandleMidJump:: HandleMidJump::
; Handle the player jumping down ; Handle the player jumping down
; a ledge in the overworld. ; a ledge in the overworld.
ld b, BANK(_HandleMidJump) jpba _HandleMidJump
ld hl, _HandleMidJump
jp Bankswitch
EnterMap:: EnterMap::
; Load a new map. ; Load a new map.
@ -136,52 +134,52 @@ OverworldLoopLessDelay::
call UpdateSprites call UpdateSprites
ld a,$01 ld a,$01
ld [wcc4b],a ld [wcc4b],a
ld a,[wd528] ; the direction that was pressed last time ld a,[wPlayerMovingDirection] ; the direction that was pressed last time
and a and a
jp z,OverworldLoop jp z,OverworldLoop
; if a direction was pressed last time ; if a direction was pressed last time
ld [wd529],a ; save the last direction ld [wPlayerLastStopDirection],a ; save the last direction
xor a xor a
ld [wd528],a ; zero the direction ld [wPlayerMovingDirection],a ; zero the direction
jp OverworldLoop jp OverworldLoop
.checkIfDownButtonIsPressed .checkIfDownButtonIsPressed
ld a,[hJoyHeld] ; current joypad state ld a,[hJoyHeld] ; current joypad state
bit 7,a ; down button bit 7,a ; down button
jr z,.checkIfUpButtonIsPressed jr z,.checkIfUpButtonIsPressed
ld a,$01 ld a,1
ld [wSpriteStateData1 + 3],a ld [wSpriteStateData1 + 3],a ; delta Y
ld a,$04 ld a,PLAYER_DIR_DOWN
jr .handleDirectionButtonPress jr .handleDirectionButtonPress
.checkIfUpButtonIsPressed .checkIfUpButtonIsPressed
bit 6,a ; up button bit 6,a ; up button
jr z,.checkIfLeftButtonIsPressed jr z,.checkIfLeftButtonIsPressed
ld a,$ff ld a,-1
ld [wSpriteStateData1 + 3],a ld [wSpriteStateData1 + 3],a ; delta Y
ld a,$08 ld a,PLAYER_DIR_UP
jr .handleDirectionButtonPress jr .handleDirectionButtonPress
.checkIfLeftButtonIsPressed .checkIfLeftButtonIsPressed
bit 5,a ; left button bit 5,a ; left button
jr z,.checkIfRightButtonIsPressed jr z,.checkIfRightButtonIsPressed
ld a,$ff ld a,-1
ld [wSpriteStateData1 + 5],a ld [wSpriteStateData1 + 5],a ; delta X
ld a,$02 ld a,PLAYER_DIR_LEFT
jr .handleDirectionButtonPress jr .handleDirectionButtonPress
.checkIfRightButtonIsPressed .checkIfRightButtonIsPressed
bit 4,a ; right button bit 4,a ; right button
jr z,.noDirectionButtonsPressed jr z,.noDirectionButtonsPressed
ld a,$01 ld a,1 ; PLAYER_DIR_RIGHT
ld [wSpriteStateData1 + 5],a ld [wSpriteStateData1 + 5],a ; delta X
.handleDirectionButtonPress .handleDirectionButtonPress
ld [wd52a],a ; new direction ld [wPlayerDirection],a ; new direction
ld a,[wd730] ld a,[wd730]
bit 7,a ; are we simulating button presses? bit 7,a ; are we simulating button presses?
jr nz,.noDirectionChange ; ignore direction changes if we are jr nz,.noDirectionChange ; ignore direction changes if we are
ld a,[wcc4b] ld a,[wcc4b]
and a and a
jr z,.noDirectionChange jr z,.noDirectionChange
ld a,[wd52a] ; new direction ld a,[wPlayerDirection] ; new direction
ld b,a ld b,a
ld a,[wd529] ; old direction ld a,[wPlayerLastStopDirection] ; old direction
cp b cp b
jr z,.noDirectionChange jr z,.noDirectionChange
; the code below is strange ; the code below is strange
@ -189,42 +187,42 @@ OverworldLoopLessDelay::
; also, it does a seemingly pointless loop afterwards ; also, it does a seemingly pointless loop afterwards
swap a ; put old direction in upper half swap a ; put old direction in upper half
or b ; put new direction in lower half or b ; put new direction in lower half
cp a,$48 ; change dir from down to up cp a,(PLAYER_DIR_DOWN << 4) | PLAYER_DIR_UP ; change dir from down to up
jr nz,.notDownToUp jr nz,.notDownToUp
ld a,$02 ld a,PLAYER_DIR_LEFT
ld [wd528],a ld [wPlayerMovingDirection],a
jr .oddLoop jr .oddLoop
.notDownToUp .notDownToUp
cp a,$84 ; change dir from up to down cp a,(PLAYER_DIR_UP << 4) | PLAYER_DIR_DOWN ; change dir from up to down
jr nz,.notUpToDown jr nz,.notUpToDown
ld a,$01 ld a,PLAYER_DIR_RIGHT
ld [wd528],a ld [wPlayerMovingDirection],a
jr .oddLoop jr .oddLoop
.notUpToDown .notUpToDown
cp a,$12 ; change dir from right to left cp a,(PLAYER_DIR_RIGHT << 4) | PLAYER_DIR_LEFT ; change dir from right to left
jr nz,.notRightToLeft jr nz,.notRightToLeft
ld a,$04 ld a,PLAYER_DIR_DOWN
ld [wd528],a ld [wPlayerMovingDirection],a
jr .oddLoop jr .oddLoop
.notRightToLeft .notRightToLeft
cp a,$21 ; change dir from left to right cp a,(PLAYER_DIR_LEFT << 4) | PLAYER_DIR_RIGHT ; change dir from left to right
jr nz,.oddLoop jr nz,.oddLoop
ld a,$08 ld a,PLAYER_DIR_UP
ld [wd528],a ld [wPlayerMovingDirection],a
.oddLoop .oddLoop
ld hl,wFlags_0xcd60 ld hl,wFlags_0xcd60
set 2,[hl] set 2,[hl]
ld hl,wcc4b ld hl,wcc4b
dec [hl] dec [hl]
jr nz,.oddLoop jr nz,.oddLoop
ld a,[wd52a] ld a,[wPlayerDirection]
ld [wd528],a ld [wPlayerMovingDirection],a
call NewBattle call NewBattle
jp c,.battleOccurred jp c,.battleOccurred
jp OverworldLoop jp OverworldLoop
.noDirectionChange .noDirectionChange
ld a,[wd52a] ; current direction ld a,[wPlayerDirection] ; current direction
ld [wd528],a ; save direction ld [wPlayerMovingDirection],a ; save direction
call UpdateSprites call UpdateSprites
ld a,[wWalkBikeSurfState] ld a,[wWalkBikeSurfState]
cp a,$02 ; surfing cp a,$02 ; surfing
@ -355,9 +353,7 @@ NewBattle:: ; 0683 (0:0683)
ld a,[wd72e] ld a,[wd72e]
bit 4,a bit 4,a
jr nz,.noBattle jr nz,.noBattle
ld b, BANK(InitBattle) jpba InitBattle
ld hl, InitBattle
jp Bankswitch
.noBattle .noBattle
and a and a
ret ret
@ -570,7 +566,7 @@ CheckMapConnections:: ; 07ba (0:07ba)
jp .loadNewMap jp .loadNewMap
.checkEastMap .checkEastMap
ld b,a ld b,a
ld a,[wd525] ; map width ld a,[wCurrentMapWidth2] ; map width
cp b cp b
jr nz,.checkNorthMap jr nz,.checkNorthMap
ld a,[W_MAPCONN4PTR] ld a,[W_MAPCONN4PTR]
@ -632,7 +628,7 @@ CheckMapConnections:: ; 07ba (0:07ba)
jp .loadNewMap jp .loadNewMap
.checkSouthMap .checkSouthMap
ld b,a ld b,a
ld a,[wd524] ld a,[wCurrentMapHeight2]
cp b cp b
jr nz,.didNotEnterConnectedMap jr nz,.didNotEnterConnectedMap
ld a,[W_MAPCONN2PTR] ld a,[W_MAPCONN2PTR]
@ -783,9 +779,7 @@ HandleFlyWarpOrDungeonWarp::
jp SpecialEnterMap jp SpecialEnterMap
LeaveMapAnim:: LeaveMapAnim::
ld b, BANK(_LeaveMapAnim) jpba _LeaveMapAnim
ld hl, _LeaveMapAnim
jp Bankswitch
LoadPlayerSpriteGraphics:: LoadPlayerSpriteGraphics::
; Load sprite graphics based on whether the player is standing, biking, or surfing. ; Load sprite graphics based on whether the player is standing, biking, or surfing.
@ -870,7 +864,7 @@ LoadTilesetTilePatternData:: ; 09e8 (0:09e8)
LoadTileBlockMap:: ; 09fc (0:09fc) LoadTileBlockMap:: ; 09fc (0:09fc)
; fill C6E8-CBFB with the background tile ; fill C6E8-CBFB with the background tile
ld hl,wOverworldMap ld hl,wOverworldMap
ld a,[wd3ad] ; background tile number ld a,[wMapBackgroundTile]
ld d,a ld d,a
ld bc,$0514 ld bc,$0514
.backgroundTileLoop .backgroundTileLoop
@ -1063,15 +1057,15 @@ LoadEastWestConnectionsTileMap:: ; 0b02 (0:0b02)
IsSpriteOrSignInFrontOfPlayer:: ; 0b23 (0:0b23) IsSpriteOrSignInFrontOfPlayer:: ; 0b23 (0:0b23)
xor a xor a
ld [hSpriteIndexOrTextID],a ld [hSpriteIndexOrTextID],a
ld a,[wd4b0] ; number of signs in the map ld a,[wNumSigns]
and a and a
jr z,.extendRangeOverCounter jr z,.extendRangeOverCounter
; if there are signs ; if there are signs
predef GetTileAndCoordsInFrontOfPlayer ; get the coordinates in front of the player in de predef GetTileAndCoordsInFrontOfPlayer ; get the coordinates in front of the player in de
ld hl,wd4b1 ; start of sign coordinates ld hl,wSignCoords
ld a,[wd4b0] ; number of signs in the map ld a,[wNumSigns]
ld b,a ld b,a
ld c,$00 ld c,0
.signLoop .signLoop
inc c inc c
ld a,[hli] ; sign Y ld a,[hli] ; sign Y
@ -1087,8 +1081,8 @@ IsSpriteOrSignInFrontOfPlayer:: ; 0b23 (0:0b23)
; found sign ; found sign
push hl push hl
push bc push bc
ld hl,wd4d1 ; start of sign text ID's ld hl,wSignTextIDs
ld b,$00 ld b,0
dec c dec c
add hl,bc add hl,bc
ld a,[hl] ld a,[hl]
@ -1103,7 +1097,7 @@ IsSpriteOrSignInFrontOfPlayer:: ; 0b23 (0:0b23)
.extendRangeOverCounter .extendRangeOverCounter
predef GetTileAndCoordsInFrontOfPlayer ; get the tile in front of the player in c predef GetTileAndCoordsInFrontOfPlayer ; get the tile in front of the player in c
ld hl,W_TILESETTALKINGOVERTILES ; list of tiles that extend talking range (counter tiles) ld hl,W_TILESETTALKINGOVERTILES ; list of tiles that extend talking range (counter tiles)
ld b,$03 ld b,3
ld d,$20 ; talking range in pixels (long range) ld d,$20 ; talking range in pixels (long range)
.counterTilesLoop .counterTilesLoop
ld a,[hli] ld a,[hli]
@ -1117,7 +1111,7 @@ IsSpriteOrSignInFrontOfPlayer:: ; 0b23 (0:0b23)
IsSpriteInFrontOfPlayer:: ; 0b6b (0:0b6b) IsSpriteInFrontOfPlayer:: ; 0b6b (0:0b6b)
ld d,$10 ; talking range in pixels (normal range) ld d,$10 ; talking range in pixels (normal range)
IsSpriteInFrontOfPlayer2:: ; 0b6d (0:0b6d) IsSpriteInFrontOfPlayer2:: ; 0b6d (0:0b6d)
ld bc,$3c40 ; Y and X position of player sprite lb bc, $3c, $40 ; Y and X position of player sprite
ld a,[wSpriteStateData1 + 9] ; direction the player is facing ld a,[wSpriteStateData1 + 9] ; direction the player is facing
.checkIfPlayerFacingUp .checkIfPlayerFacingUp
cp SPRITE_FACING_UP cp SPRITE_FACING_UP
@ -1126,7 +1120,7 @@ IsSpriteInFrontOfPlayer2:: ; 0b6d (0:0b6d)
ld a,b ld a,b
sub d sub d
ld b,a ld b,a
ld a,$08 ld a,PLAYER_DIR_UP
jr .doneCheckingDirection jr .doneCheckingDirection
.checkIfPlayerFacingDown .checkIfPlayerFacingDown
cp SPRITE_FACING_DOWN cp SPRITE_FACING_DOWN
@ -1135,7 +1129,7 @@ IsSpriteInFrontOfPlayer2:: ; 0b6d (0:0b6d)
ld a,b ld a,b
add d add d
ld b,a ld b,a
ld a,$04 ld a,PLAYER_DIR_DOWN
jr .doneCheckingDirection jr .doneCheckingDirection
.checkIfPlayerFacingRight .checkIfPlayerFacingRight
cp SPRITE_FACING_RIGHT cp SPRITE_FACING_RIGHT
@ -1144,16 +1138,16 @@ IsSpriteInFrontOfPlayer2:: ; 0b6d (0:0b6d)
ld a,c ld a,c
add d add d
ld c,a ld c,a
ld a,$01 ld a,PLAYER_DIR_RIGHT
jr .doneCheckingDirection jr .doneCheckingDirection
.playerFacingLeft .playerFacingLeft
; facing left ; facing left
ld a,c ld a,c
sub d sub d
ld c,a ld c,a
ld a,$02 ld a,PLAYER_DIR_LEFT
.doneCheckingDirection .doneCheckingDirection
ld [wd52a],a ld [wPlayerDirection],a
ld a,[W_NUMSPRITES] ; number of sprites ld a,[W_NUMSPRITES] ; number of sprites
and a and a
ret z ret z
@ -1208,7 +1202,7 @@ CollisionCheckOnLand:: ; 0bd1 (0:0bd1)
ld a,[wSimulatedJoypadStatesIndex] ld a,[wSimulatedJoypadStatesIndex]
and a and a
jr nz,.noCollision ; no collisions when the player's movements are being controlled by the game jr nz,.noCollision ; no collisions when the player's movements are being controlled by the game
ld a,[wd52a] ; the direction that the player is trying to go in ld a,[wPlayerDirection] ; the direction that the player is trying to go in
ld d,a ld d,a
ld a,[wSpriteStateData1 + 12] ; the player sprite's collision data (bit field) (set in the sprite movement code) ld a,[wSpriteStateData1 + 12] ; the player sprite's collision data (bit field) (set in the sprite movement code)
and d ; check if a sprite is in the direction the player is trying to go and d ; check if a sprite is in the direction the player is trying to go
@ -1899,7 +1893,7 @@ CollisionCheckOnWater:: ; 0fb7 (0:0fb7)
ld a,[wd730] ld a,[wd730]
bit 7,a bit 7,a
jp nz,.noCollision ; return and clear carry if button presses are being simulated jp nz,.noCollision ; return and clear carry if button presses are being simulated
ld a,[wd52a] ; the direction that the player is trying to go in ld a,[wPlayerDirection] ; the direction that the player is trying to go in
ld d,a ld d,a
ld a,[wSpriteStateData1 + 12] ; the player sprite's collision data (bit field) (set in the sprite movement code) ld a,[wSpriteStateData1 + 12] ; the player sprite's collision data (bit field) (set in the sprite movement code)
and d ; check if a sprite is in the direction the player is trying to go and d ; check if a sprite is in the direction the player is trying to go
@ -2079,17 +2073,17 @@ LoadMapHeader:: ; 107c (0:107c)
call CopyMapConnectionHeader call CopyMapConnectionHeader
.getObjectDataPointer .getObjectDataPointer
ld a,[hli] ld a,[hli]
ld [wd3a9],a ld [wObjectDataPointerTemp],a
ld a,[hli] ld a,[hli]
ld [wd3aa],a ld [wObjectDataPointerTemp + 1],a
push hl push hl
ld a,[wd3a9] ld a,[wObjectDataPointerTemp]
ld l,a ld l,a
ld a,[wd3aa] ld a,[wObjectDataPointerTemp + 1]
ld h,a ; hl = base of object data ld h,a ; hl = base of object data
ld de,wd3ad ; background tile ID ld de,wMapBackgroundTile
ld a,[hli] ld a,[hli]
ld [de],a ; save background tile ID ld [de],a
.loadWarpData .loadWarpData
ld a,[hli] ld a,[hli]
ld [wNumberOfWarps],a ld [wNumberOfWarps],a
@ -2109,16 +2103,16 @@ LoadMapHeader:: ; 107c (0:107c)
jr nz,.warpLoop jr nz,.warpLoop
.loadSignData .loadSignData
ld a,[hli] ; number of signs ld a,[hli] ; number of signs
ld [wd4b0],a ; save the number of signs ld [wNumSigns],a
and a ; are there any signs? and a ; are there any signs?
jr z,.loadSpriteData ; if not, skip this jr z,.loadSpriteData ; if not, skip this
ld c,a ld c,a
ld de,wd4d1 ; base address of sign text IDs ld de,wSignTextIDs
ld a,d ld a,d
ld [$ff95],a ld [hSignCoordPointer],a
ld a,e ld a,e
ld [$ff96],a ld [hSignCoordPointer + 1],a
ld de,wd4b1 ; base address of sign coordinates ld de,wSignCoords
.signLoop .signLoop
ld a,[hli] ld a,[hli]
ld [de],a ld [de],a
@ -2127,17 +2121,17 @@ LoadMapHeader:: ; 107c (0:107c)
ld [de],a ld [de],a
inc de inc de
push de push de
ld a,[$ff95] ld a,[hSignCoordPointer]
ld d,a ld d,a
ld a,[$ff96] ld a,[hSignCoordPointer + 1]
ld e,a ld e,a
ld a,[hli] ld a,[hli]
ld [de],a ld [de],a
inc de inc de
ld a,d ld a,d
ld [$ff95],a ld [hSignCoordPointer],a
ld a,e ld a,e
ld [$ff96],a ld [hSignCoordPointer + 1],a
pop de pop de
dec c dec c
jr nz,.signLoop jr nz,.signLoop
@ -2265,10 +2259,10 @@ LoadMapHeader:: ; 107c (0:107c)
pop hl ; restore hl from before going to the warp/sign/sprite data (this value was saved for seemingly no purpose) pop hl ; restore hl from before going to the warp/sign/sprite data (this value was saved for seemingly no purpose)
ld a,[W_CURMAPHEIGHT] ; map height in 4x4 tile blocks ld a,[W_CURMAPHEIGHT] ; map height in 4x4 tile blocks
add a ; double it add a ; double it
ld [wd524],a ; store map height in 2x2 tile blocks ld [wCurrentMapHeight2],a ; store map height in 2x2 tile blocks
ld a,[W_CURMAPWIDTH] ; map width in 4x4 tile blocks ld a,[W_CURMAPWIDTH] ; map width in 4x4 tile blocks
add a ; double it add a ; double it
ld [wd525],a ; map width in 2x2 tile blocks ld [wCurrentMapWidth2],a ; map width in 2x2 tile blocks
ld a,[W_CURMAP] ld a,[W_CURMAP]
ld c,a ld c,a
ld b,$00 ld b,$00

View file

@ -82,6 +82,9 @@ hTilePlayerStandingOn EQU $FF93
hSpritePriority EQU $FF94 hSpritePriority EQU $FF94
; 2 bytes
hSignCoordPointer EQU $FF95
hNPCMovementDirections2Index EQU $FF95 hNPCMovementDirections2Index EQU $FF95
; CalcPositionOfPlayerRelativeToNPC ; CalcPositionOfPlayerRelativeToNPC
@ -137,6 +140,9 @@ hNPCPlayerRelativePosPerspective EQU $FF9B
; 1 = target is to the west ; 1 = target is to the west
hNPCPlayerRelativePosFlags EQU $FF9D hNPCPlayerRelativePosFlags EQU $FF9D
; some code zeroes this for no reason when writing a coin amount
hUnusedCoinsByte EQU $FF9F
hMoney EQU $FF9F ; 3-byte BCD number hMoney EQU $FF9F ; 3-byte BCD number
hCoins EQU $FFA0 ; 2-byte BCD number hCoins EQU $FFA0 ; 2-byte BCD number

View file

@ -53,6 +53,18 @@ callab: MACRO
call Bankswitch call Bankswitch
ENDM ENDM
jpba: MACRO
ld b, BANK(\1)
ld hl, \1
jp Bankswitch
ENDM
jpab: MACRO
ld hl, \1
ld b, BANK(\1)
jp Bankswitch
ENDM
bcd2: MACRO bcd2: MACRO
dn ((\1) / 1000) % 10, ((\1) / 100) % 10 dn ((\1) / 1000) % 10, ((\1) / 100) % 10
dn ((\1) / 10) % 10, (\1) % 10 dn ((\1) / 10) % 10, (\1) % 10

View file

@ -2038,7 +2038,7 @@ _DisplayPokedex: ; 7c18 (1:7c18)
ld a, [wd11e] ld a, [wd11e]
dec a dec a
ld c, a ld c, a
ld b, $1 ld b, FLAG_SET
ld hl, wPokedexSeen ld hl, wPokedexSeen
predef FlagActionPredef predef FlagActionPredef
ld a, $1 ld a, $1
@ -3235,7 +3235,7 @@ MarkTownVisitedAndLoadMissableObjects: ; f113 (3:7113)
cp ROUTE_1 cp ROUTE_1
jr nc, .notInTown jr nc, .notInTown
ld c, a ld c, a
ld b, $1 ld b, FLAG_SET
ld hl, W_TOWNVISITEDFLAG ; mark town as visited (for flying) ld hl, W_TOWNVISITEDFLAG ; mark town as visited (for flying)
predef FlagActionPredef predef FlagActionPredef
.notInTown .notInTown
@ -3319,7 +3319,7 @@ InitializeMissableObjectsFlags: ; f175 (3:7175)
ld hl, W_MISSABLEOBJECTFLAGS ld hl, W_MISSABLEOBJECTFLAGS
ld a, [wd048] ld a, [wd048]
ld c, a ld c, a
ld b, $1 ld b, FLAG_SET
call MissableObjectFlagAction ; set flag iff Item is hidden call MissableObjectFlagAction ; set flag iff Item is hidden
.asm_f19d .asm_f19d
ld hl, wd048 ld hl, wd048
@ -3343,7 +3343,7 @@ IsObjectHidden: ; f1a6 (3:71a6)
ld a, [hli] ld a, [hli]
jr nz, .loop jr nz, .loop
ld c, a ld c, a
ld b, $2 ld b, FLAG_TEST
ld hl, W_MISSABLEOBJECTFLAGS ld hl, W_MISSABLEOBJECTFLAGS
call MissableObjectFlagAction call MissableObjectFlagAction
ld a, c ld a, c
@ -3362,7 +3362,7 @@ ShowObject2:
ld hl, W_MISSABLEOBJECTFLAGS ld hl, W_MISSABLEOBJECTFLAGS
ld a, [wcc4d] ld a, [wcc4d]
ld c, a ld c, a
ld b, $0 ld b, FLAG_RESET
call MissableObjectFlagAction ; reset "removed" flag call MissableObjectFlagAction ; reset "removed" flag
jp UpdateSprites jp UpdateSprites
@ -3372,7 +3372,7 @@ HideObject: ; f1d7 (3:71d7)
ld hl, W_MISSABLEOBJECTFLAGS ld hl, W_MISSABLEOBJECTFLAGS
ld a, [wcc4d] ld a, [wcc4d]
ld c, a ld c, a
ld b, $1 ld b, FLAG_SET
call MissableObjectFlagAction ; set "removed" flag call MissableObjectFlagAction ; set "removed" flag
jp UpdateSprites jp UpdateSprites
@ -3642,7 +3642,7 @@ _AddPartyMon: ; f2e5 (3:72e5)
ld a, [wd11e] ld a, [wd11e]
dec a dec a
ld c, a ld c, a
ld b, $2 ld b, FLAG_TEST
ld hl, wPokedexOwned ld hl, wPokedexOwned
call FlagAction call FlagAction
ld a, c ld a, c
@ -3650,7 +3650,7 @@ _AddPartyMon: ; f2e5 (3:72e5)
ld a, [wd11e] ld a, [wd11e]
dec a dec a
ld c, a ld c, a
ld b, $1 ld b, FLAG_SET
push bc push bc
call FlagAction call FlagAction
pop bc pop bc
@ -3882,7 +3882,7 @@ _AddEnemyMonToPlayerParty: ; f49d (3:749d)
ld a, [wd11e] ld a, [wd11e]
dec a dec a
ld c, a ld c, a
ld b, $1 ld b, FLAG_SET
ld hl, wPokedexOwned ld hl, wPokedexOwned
push bc push bc
call FlagAction ; add to owned pokemon call FlagAction ; add to owned pokemon

View file

@ -170,7 +170,7 @@ CeladonGameCornerText2: ; 48ca9 (12:4ca9)
ld c, $3 ld c, $3
predef SubBCDPredef predef SubBCDPredef
xor a xor a
ld [hCoins - 1], a ld [hUnusedCoinsByte], a
ld [hCoins], a ld [hCoins], a
ld a, $50 ld a, $50
ld [hCoins + 1], a ld [hCoins + 1], a
@ -238,7 +238,7 @@ CeladonGameCornerText5: ; 48d4a (12:4d4a)
call Has9990Coins call Has9990Coins
jr nc, .asm_48d8e jr nc, .asm_48d8e
xor a xor a
ld [hCoins - 1], a ld [hUnusedCoinsByte], a
ld [hCoins], a ld [hCoins], a
ld a, $10 ld a, $10
ld [hCoins + 1], a ld [hCoins + 1], a
@ -320,7 +320,7 @@ CeladonGameCornerText9: ; 48dd9 (12:4dd9)
call Has9990Coins call Has9990Coins
jr nc, .asm_48e18 jr nc, .asm_48e18
xor a xor a
ld [hCoins - 1], a ld [hUnusedCoinsByte], a
ld [hCoins], a ld [hCoins], a
ld a, $20 ld a, $20
ld [hCoins + 1], a ld [hCoins + 1], a
@ -373,7 +373,7 @@ CeladonGameCornerText10: ; 48e3b (12:4e3b)
call Has9990Coins call Has9990Coins
jr z, .asm_48e7a jr z, .asm_48e7a
xor a xor a
ld [hCoins - 1], a ld [hUnusedCoinsByte], a
ld [hCoins], a ld [hCoins], a
ld a, $20 ld a, $20
ld [hCoins + 1], a ld [hCoins + 1], a

View file

@ -55,9 +55,7 @@ CeldaonMartElevatorWarpMaps: ; 4864a (12:464a)
db $02, CELADON_MART_5 db $02, CELADON_MART_5
CeladonMartElevatorScript_48654: ; 48654 (12:4654) CeladonMartElevatorScript_48654: ; 48654 (12:4654)
ld b, BANK(ShakeElevator) jpba ShakeElevator
ld hl, ShakeElevator
jp Bankswitch
CeladonMartElevatorTextPointers: ; 4865c (12:465c) CeladonMartElevatorTextPointers: ; 4865c (12:465c)
dw CeladonMartElevatorText1 dw CeladonMartElevatorText1

View file

@ -135,9 +135,7 @@ CeladonMartRoofScript_4840c: ; 4840c (12:440c)
jp PrintText jp PrintText
RemoveItemByIDBank12: ; 484e6 (12:44e6) RemoveItemByIDBank12: ; 484e6 (12:44e6)
ld b, BANK(RemoveItemByID) jpba RemoveItemByID
ld hl, RemoveItemByID
jp Bankswitch
CeladonMartRoofText_484ee: ; 484ee (12:44ee) CeladonMartRoofText_484ee: ; 484ee (12:44ee)
TX_FAR _CeladonMartRoofText_484ee TX_FAR _CeladonMartRoofText_484ee

View file

@ -44,15 +44,15 @@ CeruleanCityScript0: ; 194c8 (6:54c8)
jr nc, .asm_194f7 jr nc, .asm_194f7
ld a, [wCoordIndex] ld a, [wCoordIndex]
cp $1 cp $1
ld a, $8 ld a, PLAYER_DIR_UP
ld b, SPRITE_FACING_DOWN ld b, SPRITE_FACING_DOWN
jr nz, .asm_194e6 jr nz, .asm_194e6
ld a, $4 ld a, PLAYER_DIR_DOWN
ld b, SPRITE_FACING_UP ld b, SPRITE_FACING_UP
.asm_194e6 .asm_194e6
ld [wd528], a ld [wPlayerMovingDirection], a
ld a, b ld a, b
ld [wSpriteStateData1 + $29], a ld [wSpriteStateData1 + 2 * $10 + $9], a
call Delay3 call Delay3
ld a, $2 ld a, $2
ld [hSpriteIndexOrTextID], a ld [hSpriteIndexOrTextID], a

View file

@ -54,14 +54,14 @@ CinnabarGymScript0: ; 757ae (1d:57ae)
ld [H_SPRITEINDEX], a ld [H_SPRITEINDEX], a
cp $4 cp $4
jr nz, .asm_757c3 jr nz, .asm_757c3
ld a, $4 ld a, PLAYER_DIR_DOWN
ld [wd528], a ld [wPlayerMovingDirection], a
ld de, MovementData_757d7 ld de, MovementData_757d7
jr .asm_757cb jr .asm_757cb
.asm_757c3 .asm_757c3
ld de, MovementData_757da ld de, MovementData_757da
ld a, $1 ld a, PLAYER_DIR_RIGHT
ld [wd528], a ld [wPlayerMovingDirection], a
.asm_757cb .asm_757cb
call MoveSprite call MoveSprite
ld a, $1 ld a, $1
@ -99,7 +99,7 @@ CinnabarGymScript2: ; 757f6 (1d:57f6)
ld a, [wTrainerHeaderFlagBit] ld a, [wTrainerHeaderFlagBit]
ld [$ffdb], a ld [$ffdb], a
ld c, a ld c, a
ld b, $2 ld b, FLAG_TEST
ld hl, wd79a ld hl, wd79a
call CinnabarGymScript_757f1 call CinnabarGymScript_757f1
ld a, c ld a, c
@ -113,13 +113,13 @@ CinnabarGymScript2: ; 757f6 (1d:57f6)
ld a, [wTrainerHeaderFlagBit] ld a, [wTrainerHeaderFlagBit]
ld [$ffdb], a ld [$ffdb], a
ld c, a ld c, a
ld b, $1 ld b, FLAG_SET
ld hl, wd79a ld hl, wd79a
call CinnabarGymScript_757f1 call CinnabarGymScript_757f1
ld a, [wTrainerHeaderFlagBit] ld a, [wTrainerHeaderFlagBit]
sub $2 sub $2
ld c, a ld c, a
ld b, $1 ld b, FLAG_SET
ld hl, wd79c ld hl, wd79c
call CinnabarGymScript_757f1 call CinnabarGymScript_757f1
call Func_3ead call Func_3ead

View file

@ -24,8 +24,8 @@ CinnabarIslandScript0: ; 1ca38 (7:4a38)
ld a, [W_XCOORD] ld a, [W_XCOORD]
cp $12 cp $12
ret nz ret nz
ld a, $8 ld a, PLAYER_DIR_UP
ld [wd528], a ld [wPlayerMovingDirection], a
ld a, $8 ld a, $8
ld [hSpriteIndexOrTextID], a ld [hSpriteIndexOrTextID], a
call DisplayTextID call DisplayTextID

View file

@ -42,8 +42,8 @@ FightingDojoScript1: ; 5cd83 (17:4d83)
ret nz ret nz
ld a, $1 ld a, $1
ld [wcf0d], a ld [wcf0d], a
ld a, $1 ld a, PLAYER_DIR_RIGHT
ld [wd528], a ld [wPlayerMovingDirection], a
ld a, $1 ld a, $1
ld [H_SPRITEINDEX], a ld [H_SPRITEINDEX], a
ld a, SPRITE_FACING_LEFT ld a, SPRITE_FACING_LEFT
@ -61,8 +61,8 @@ FightingDojoScript3: ; 5cdc6 (17:4dc6)
ld a, [wcf0d] ld a, [wcf0d]
and a and a
jr z, .asm_5cde4 jr z, .asm_5cde4
ld a, $1 ld a, PLAYER_DIR_RIGHT
ld [wd528], a ld [wPlayerMovingDirection], a
ld a, $1 ld a, $1
ld [H_SPRITEINDEX], a ld [H_SPRITEINDEX], a
ld a, SPRITE_FACING_LEFT ld a, SPRITE_FACING_LEFT

View file

@ -139,8 +139,8 @@ GaryScript5: ; 7601a (1d:601a)
ld a, [wd730] ld a, [wd730]
bit 0, a bit 0, a
ret nz ret nz
ld a, $2 ld a, PLAYER_DIR_LEFT
ld [wd528], a ld [wPlayerMovingDirection], a
ld a, $1 ld a, $1
ld [H_SPRITEINDEX], a ld [H_SPRITEINDEX], a
ld a, SPRITE_FACING_LEFT ld a, SPRITE_FACING_LEFT

View file

@ -80,19 +80,19 @@ HallofFameRoomScript1: ; 5a52b (16:652b)
ld a, [wSimulatedJoypadStatesIndex] ld a, [wSimulatedJoypadStatesIndex]
and a and a
ret nz ret nz
ld a, $1 ld a, PLAYER_DIR_RIGHT
ld [wd528], a ld [wPlayerMovingDirection], a
ld a, $1 ld a, $1
ld [H_SPRITEINDEX], a ld [H_SPRITEINDEX], a
call SetSpriteMovementBytesToFF call SetSpriteMovementBytesToFF
ld a, $8 ld a, SPRITE_FACING_LEFT
ld [hSpriteFacingDirection], a ld [hSpriteFacingDirection], a
call SetSpriteFacingDirectionAndDelay call SetSpriteFacingDirectionAndDelay
call Delay3 call Delay3
xor a xor a
ld [wJoyIgnore], a ld [wJoyIgnore], a
inc a inc a ; PLAYER_DIR_RIGHT
ld [wd528], a ld [wPlayerMovingDirection], a
ld a, $1 ld a, $1
ld [hSpriteIndexOrTextID], a ld [hSpriteIndexOrTextID], a
call DisplayTextID call DisplayTextID

View file

@ -112,6 +112,4 @@ Lab4Text2: ; 75dda (1d:5dda)
jp TextScriptEnd jp TextScriptEnd
LoadFossilItemAndMonNameBank1D: ; 75de8 (1d:5de8) LoadFossilItemAndMonNameBank1D: ; 75de8 (1d:5de8)
ld b, BANK(LoadFossilItemAndMonName) jpba LoadFossilItemAndMonName
ld hl, LoadFossilItemAndMonName
jp Bankswitch

View file

@ -178,8 +178,8 @@ OaksLabScript6: ; 1cc36 (7:4c36)
ld a, D_UP ld a, D_UP
ld [wSimulatedJoypadStatesEnd], a ld [wSimulatedJoypadStatesEnd], a
call StartSimulatingJoypadStates call StartSimulatingJoypadStates
ld a, $8 ld a, PLAYER_DIR_UP
ld [wd528], a ld [wPlayerMovingDirection], a
ld a, $7 ld a, $7
ld [W_OAKSLABCURSCRIPT], a ld [W_OAKSLABCURSCRIPT], a
@ -354,8 +354,8 @@ OaksLabScript10: ; 1cd6d (7:4d6d)
xor a ; SPRITE_FACING_DOWN xor a ; SPRITE_FACING_DOWN
ld [hSpriteFacingDirection], a ld [hSpriteFacingDirection], a
call SetSpriteFacingDirectionAndDelay call SetSpriteFacingDirectionAndDelay
ld a, $8 ld a, PLAYER_DIR_UP
ld [wd528], a ld [wPlayerMovingDirection], a
ld c, BANK(Music_MeetRival) ld c, BANK(Music_MeetRival)
ld a, MUSIC_MEET_RIVAL ld a, MUSIC_MEET_RIVAL
call PlayMusic call PlayMusic
@ -414,8 +414,8 @@ OaksLabScript11: ; 1cdb9 (7:4db9)
set 7, [hl] set 7, [hl]
xor a xor a
ld [wJoyIgnore], a ld [wJoyIgnore], a
ld a, $8 ld a, PLAYER_DIR_UP
ld [wd528], a ld [wPlayerMovingDirection], a
ld a, $c ld a, $c
ld [W_OAKSLABCURSCRIPT], a ld [W_OAKSLABCURSCRIPT], a
ret ret
@ -423,8 +423,8 @@ OaksLabScript11: ; 1cdb9 (7:4db9)
OaksLabScript12: ; 1ce03 (7:4e03) OaksLabScript12: ; 1ce03 (7:4e03)
ld a, $f0 ld a, $f0
ld [wJoyIgnore], a ld [wJoyIgnore], a
ld a, $8 ld a, PLAYER_DIR_UP
ld [wd528], a ld [wPlayerMovingDirection], a
call UpdateSprites call UpdateSprites
ld a, $1 ld a, $1
ld [wSpriteIndex], a ld [wSpriteIndex], a

View file

@ -28,8 +28,8 @@ PalletTownScript0: ; 18e81 (6:4e81)
ret nz ret nz
xor a xor a
ld [hJoyHeld],a ld [hJoyHeld],a
ld a,4 ld a,PLAYER_DIR_DOWN
ld [wd528],a ld [wPlayerMovingDirection],a
ld a,$FF ld a,$FF
call PlaySound ; stop music call PlaySound ; stop music
ld a, BANK(Music_MeetProfOak) ld a, BANK(Music_MeetProfOak)
@ -190,8 +190,8 @@ OakAppearsText: ; 18fb0 (6:4fb0)
ld [wEmotionBubbleSpriteIndex],a ; player's sprite ld [wEmotionBubbleSpriteIndex],a ; player's sprite
ld [wWhichEmotionBubble],a ; EXCLAMATION_BUBBLE ld [wWhichEmotionBubble],a ; EXCLAMATION_BUBBLE
predef EmotionBubble predef EmotionBubble
ld a,4 ld a,PLAYER_DIR_DOWN
ld [wd528],a ld [wPlayerMovingDirection],a
jp TextScriptEnd jp TextScriptEnd
OakWalksUpText: ; 18fce (6:4fce) OakWalksUpText: ; 18fce (6:4fce)

View file

@ -33,15 +33,15 @@ PokemonTower2Script0: ; 6050f (18:450f)
res 6, [hl] res 6, [hl]
ld a, [wCoordIndex] ld a, [wCoordIndex]
cp $1 cp $1
ld a, $8 ld a, PLAYER_DIR_UP
ld b, SPRITE_FACING_DOWN ld b, SPRITE_FACING_DOWN
jr nz, .asm_60544 jr nz, .asm_60544
ld hl, wd764 ld hl, wd764
set 6, [hl] set 6, [hl]
ld a, $2 ld a, PLAYER_DIR_LEFT
ld b, SPRITE_FACING_RIGHT ld b, SPRITE_FACING_RIGHT
.asm_60544 .asm_60544
ld [wd528], a ld [wPlayerMovingDirection], a
ld a, $1 ld a, $1
ld [H_SPRITEINDEX], a ld [H_SPRITEINDEX], a
ld a, b ld a, b

View file

@ -11,8 +11,8 @@ RedsHouse2FScriptPointers: ; 5c0bc (17:40bc)
RedsHouse2FScript0: ; 5c0c0 (17:40c0) RedsHouse2FScript0: ; 5c0c0 (17:40c0)
xor a xor a
ld [hJoyHeld],a ld [hJoyHeld],a
ld a,8 ld a,PLAYER_DIR_UP
ld [wd528],a ld [wPlayerMovingDirection],a
ld a,1 ld a,1
ld [W_REDSHOUSE2CURSCRIPT],a ld [W_REDSHOUSE2CURSCRIPT],a
ret ret

View file

@ -67,8 +67,8 @@ Route22Script0: ; 50f00 (14:4f00)
ld [hJoyHeld], a ld [hJoyHeld], a
ld a, $f0 ld a, $f0
ld [wJoyIgnore], a ld [wJoyIgnore], a
ld a, $2 ld a, PLAYER_DIR_LEFT
ld [wd528], a ld [wPlayerMovingDirection], a
ld a, [wd7eb] ld a, [wd7eb]
bit 0, a ; is this the rival battle at the beginning of the game? bit 0, a ; is this the rival battle at the beginning of the game?
jr nz, .firstRivalBattle jr nz, .firstRivalBattle
@ -111,8 +111,8 @@ Route22Script1: ; 50f62 (14:4f62)
ld a, [wcf0d] ld a, [wcf0d]
cp $1 cp $1
jr nz, .asm_50f78 jr nz, .asm_50f78
ld a, $4 ld a, PLAYER_DIR_DOWN
ld [wd528], a ld [wPlayerMovingDirection], a
ld a, SPRITE_FACING_UP ld a, SPRITE_FACING_UP
jr .asm_50f7a jr .asm_50f7a
.asm_50f78 .asm_50f78
@ -270,13 +270,13 @@ Route22Script4: ; 51087 (14:5087)
ld a, [wcf0d] ld a, [wcf0d]
cp $1 cp $1
jr nz, .asm_510a1 jr nz, .asm_510a1
ld a, $4 ld a, PLAYER_DIR_DOWN
ld [wd528], a ld [wPlayerMovingDirection], a
ld a, SPRITE_FACING_UP ld a, SPRITE_FACING_UP
jr .asm_510a8 jr .asm_510a8
.asm_510a1 .asm_510a1
ld a, $2 ld a, PLAYER_DIR_LEFT
ld [wd528], a ld [wPlayerMovingDirection], a
ld a, SPRITE_FACING_RIGHT ld a, SPRITE_FACING_RIGHT
.asm_510a8 .asm_510a8
ld [hSpriteFacingDirection], a ld [hSpriteFacingDirection], a
@ -314,13 +314,13 @@ Route22Script5: ; 510df (14:50df)
ld a, [wcf0d] ld a, [wcf0d]
cp $1 cp $1
jr nz, .asm_510fb jr nz, .asm_510fb
ld a, $4 ld a, PLAYER_DIR_DOWN
ld [wd528], a ld [wPlayerMovingDirection], a
ld a, SPRITE_FACING_UP ld a, SPRITE_FACING_UP
jr .asm_51102 jr .asm_51102
.asm_510fb .asm_510fb
ld a, $2 ld a, PLAYER_DIR_LEFT
ld [wd528], a ld [wPlayerMovingDirection], a
ld a, SPRITE_FACING_RIGHT ld a, SPRITE_FACING_RIGHT
.asm_51102 .asm_51102
ld [hSpriteFacingDirection], a ld [hSpriteFacingDirection], a

View file

@ -52,7 +52,7 @@ Route23Script0: ; 51219 (14:5219)
ld [hSpriteIndexOrTextID], a ld [hSpriteIndexOrTextID], a
ld a, c ld a, c
ld [wWhichBadge], a ld [wWhichBadge], a
ld b, $2 ld b, FLAG_TEST
ld hl, wd7ed ld hl, wd7ed
predef FlagActionPredef predef FlagActionPredef
ld a, c ld a, c
@ -193,7 +193,7 @@ Route23Script_51346: ; 51346 (14:5346)
ld a, [wWhichBadge] ld a, [wWhichBadge]
inc a inc a
ld c, a ld c, a
ld b, $2 ld b, FLAG_TEST
ld hl, W_OBTAINEDBADGES ld hl, W_OBTAINEDBADGES
predef FlagActionPredef predef FlagActionPredef
ld a, c ld a, c
@ -210,7 +210,7 @@ Route23Script_51346: ; 51346 (14:5346)
call PrintText call PrintText
ld a, [wWhichBadge] ld a, [wWhichBadge]
ld c, a ld c, a
ld b, $1 ld b, FLAG_SET
ld hl, wd7ed ld hl, wd7ed
predef FlagActionPredef predef FlagActionPredef
ld a, $2 ld a, $2

View file

@ -22,8 +22,8 @@ Route5GateScript0: ; 1df50 (7:5f50)
ld hl, CoordsData_1df8f ld hl, CoordsData_1df8f
call ArePlayerCoordsInArray call ArePlayerCoordsInArray
ret nc ret nc
ld a, $2 ld a, PLAYER_DIR_LEFT
ld [wd528], a ld [wPlayerMovingDirection], a
xor a xor a
ld [hJoyHeld], a ld [hJoyHeld], a
callba RemoveGuardDrink callba RemoveGuardDrink

View file

@ -16,8 +16,8 @@ Route6GateScript0: ; 1e04e (7:604e)
ld hl, CoordsData_1e08c ld hl, CoordsData_1e08c
call ArePlayerCoordsInArray call ArePlayerCoordsInArray
ret nc ret nc
ld a, $1 ld a, PLAYER_DIR_RIGHT
ld [wd528], a ld [wPlayerMovingDirection], a
xor a xor a
ld [hJoyHeld], a ld [hJoyHeld], a
callba RemoveGuardDrink callba RemoveGuardDrink

View file

@ -28,8 +28,8 @@ Route7GateScript0: ; 1e128 (7:6128)
ld hl, CoordsData_1e167 ld hl, CoordsData_1e167
call ArePlayerCoordsInArray call ArePlayerCoordsInArray
ret nc ret nc
ld a, $8 ld a, PLAYER_DIR_UP
ld [wd528], a ld [wPlayerMovingDirection], a
xor a xor a
ld [hJoyHeld], a ld [hJoyHeld], a
callba RemoveGuardDrink callba RemoveGuardDrink

View file

@ -27,8 +27,8 @@ Route8GateScript0: ; 1e1ee (7:61ee)
ld hl, CoordsData_1e22c ld hl, CoordsData_1e22c
call ArePlayerCoordsInArray call ArePlayerCoordsInArray
ret nc ret nc
ld a, $2 ld a, PLAYER_DIR_LEFT
ld [wd528], a ld [wPlayerMovingDirection], a
xor a xor a
ld [hJoyHeld], a ld [hJoyHeld], a
callba RemoveGuardDrink callba RemoveGuardDrink

View file

@ -72,8 +72,8 @@ SafariZoneEntranceScriptPointers: ; 751d9 (1d:51d9)
ret ret
.SafariZoneEntranceScript5 .SafariZoneEntranceScript5
ld a, $4 ld a, PLAYER_DIR_DOWN
ld [wd528], a ld [wPlayerMovingDirection], a
ld hl, wd790 ld hl, wd790
bit 6, [hl] bit 6, [hl]
res 6, [hl] res 6, [hl]

View file

@ -199,7 +199,7 @@ MovementData_62216: ; 62216 (18:6216)
db $FF db $FF
SilphCo11Script_6221a: ; 6221a (18:621a) SilphCo11Script_6221a: ; 6221a (18:621a)
ld [wd528], a ld [wPlayerMovingDirection], a
ld a, $3 ld a, $3
ld [H_SPRITEINDEX], a ld [H_SPRITEINDEX], a
ld a, b ld a, b
@ -213,11 +213,11 @@ SilphCo11Script5: ; 62227 (18:6227)
ld a, [wcf0d] ld a, [wcf0d]
cp $1 cp $1
jr z, .asm_6223c jr z, .asm_6223c
ld a, $2 ld a, PLAYER_DIR_LEFT
ld b, SPRITE_FACING_RIGHT ld b, SPRITE_FACING_RIGHT
jr .asm_62240 jr .asm_62240
.asm_6223c .asm_6223c
ld a, $8 ld a, PLAYER_DIR_UP
ld b, SPRITE_FACING_DOWN ld b, SPRITE_FACING_DOWN
.asm_62240 .asm_62240
call SilphCo11Script_6221a call SilphCo11Script_6221a
@ -247,11 +247,11 @@ SilphCo11Script3: ; 6226a (18:626a)
ld a, [wcf0d] ld a, [wcf0d]
cp $1 cp $1
jr z, .asm_62284 jr z, .asm_62284
ld a, $2 ld a, PLAYER_DIR_LEFT
ld b, SPRITE_FACING_RIGHT ld b, SPRITE_FACING_RIGHT
jr .asm_62288 jr .asm_62288
.asm_62284 .asm_62284
ld a, $8 ld a, PLAYER_DIR_UP
ld b, SPRITE_FACING_DOWN ld b, SPRITE_FACING_DOWN
.asm_62288 .asm_62288
call SilphCo11Script_6221a call SilphCo11Script_6221a

View file

@ -127,8 +127,8 @@ SilphCo7Script0: ; 51c23 (14:5c23)
ld [hJoyHeld], a ld [hJoyHeld], a
ld a, $f0 ld a, $f0
ld [wJoyIgnore], a ld [wJoyIgnore], a
ld a, $4 ld a, PLAYER_DIR_DOWN
ld [wd528], a ld [wPlayerMovingDirection], a
ld a, $ff ld a, $ff
ld [wc0ee], a ld [wc0ee], a
call PlaySound call PlaySound
@ -209,8 +209,8 @@ SilphCo7Script4: ; 51cc8 (14:5cc8)
ld [wJoyIgnore], a ld [wJoyIgnore], a
ld hl, wd82f ld hl, wd82f
set 0, [hl] set 0, [hl]
ld a, $4 ld a, PLAYER_DIR_DOWN
ld [wd528], a ld [wPlayerMovingDirection], a
ld a, $9 ld a, $9
ld [H_SPRITEINDEX], a ld [H_SPRITEINDEX], a
ld a, SPRITE_FACING_UP ld a, SPRITE_FACING_UP

View file

@ -74,8 +74,8 @@ SSAnne2Script_61416: ; 61416 (18:5416)
ld a, [W_XCOORD] ld a, [W_XCOORD]
cp $25 cp $25
jr nz, .asm_61426 jr nz, .asm_61426
ld a, $2 ld a, PLAYER_DIR_LEFT
ld [wd528], a ld [wPlayerMovingDirection], a
ld a, SPRITE_FACING_RIGHT ld a, SPRITE_FACING_RIGHT
jr .asm_61427 jr .asm_61427
.asm_61426 .asm_61426

View file

@ -128,9 +128,7 @@ ViridianGymScript4: ; 7496b (1d:496b)
ld [W_CURMAPSCRIPT], a ld [W_CURMAPSCRIPT], a
ret ret
.asm_74980 .asm_74980
ld b, BANK(LoadSpinnerArrowTiles) jpba LoadSpinnerArrowTiles
ld hl, LoadSpinnerArrowTiles
jp Bankswitch
ViridianGymScript3: ; 74988 (1d:4988) ViridianGymScript3: ; 74988 (1d:4988)
ld a, [W_ISINBATTLE] ld a, [W_ISINBATTLE]

View file

@ -733,6 +733,8 @@ wWhichTrade:: ; cd3d
; which entry from TradeMons to select ; which entry from TradeMons to select
wTrainerSpriteOffset:: ; cd3d wTrainerSpriteOffset:: ; cd3d
wUnusedCD3D:: ; cd3d
ds 1 ds 1
wSSAnneSmokeX:: ; cd3e wSSAnneSmokeX:: ; cd3e
@ -1699,7 +1701,11 @@ W_MONHLEARNSET:: ; d0cc
flag_array 50 + 5 flag_array 50 + 5
ds 1 ds 1
wd0d4:: ds 3 ; temp storage for hTilesetType wSavedTilesetType:: ; d0d4
; saved at the start of a battle and then written back at the end of the battle
ds 1
ds 2
W_MONHPADDING:: ; d0d7 W_MONHPADDING:: ; d0d7
@ -2064,9 +2070,14 @@ W_SPRITESETID:: ; d3a8
; sprite set ID for the current map ; sprite set ID for the current map
ds 1 ds 1
wd3a9:: ds 1 ; used when getting the object data pointer wObjectDataPointerTemp:: ; d3a9
wd3aa:: ds 3 ; second part of the pointer ds 2
wd3ad:: ds 1 ; used as the beginning value for copying warp data
ds 2
wMapBackgroundTile:: ; d3ad
; the tile shown outside the boundaries of the map
ds 1
wNumberOfWarps:: ; d3ae wNumberOfWarps:: ; d3ae
; number of warps in current map ; number of warps in current map
@ -2082,9 +2093,17 @@ wDestinationWarpID:: ; d42f
ds 128 ds 128
wd4b0:: ds 1 ; number of signs on the map wNumSigns:: ; d4b0
wd4b1:: ds 32 ; starting address for sign coords ; number of signs in the current map (up to 16)
wd4d1:: ds 16 ; starting address for sign text IDs ds 1
wSignCoords:: ; d4b1
; 2 bytes each
; Y, X
ds 32
wSignTextIDs:: ; d4d1
ds 16
W_NUMSPRITES:: ; d4e1 W_NUMSPRITES:: ; d4e1
; number of sprites on the current map ; number of sprites on the current map
@ -2105,16 +2124,35 @@ W_MAPSPRITEEXTRADATA:: ; d504
; two bytes per sprite (trainer class/item ID, trainer set ID) ; two bytes per sprite (trainer class/item ID, trainer set ID)
ds 32 ds 32
wd524:: ds 1 ; map height in 2x2 metatiles, also used with checking connections wCurrentMapHeight2:: ; d524
wd525:: ds 1 ; map width in 2x2 metatiles, also used with checking connections ; map height in 2x2 meta-tiles
ds 1
wCurrentMapWidth2:: ; d525
; map width in 2x2 meta-tiles
ds 1
wMapViewVRAMPointer:: ; d526 wMapViewVRAMPointer:: ; d526
; the address of the upper left corner of the visible portion of the BG tile map in VRAM ; the address of the upper left corner of the visible portion of the BG tile map in VRAM
ds 2 ds 2
wd528:: ds 1 ; additional storage for directions ; In the comments for the player direction variables below, "moving" refers to
wd529:: ds 1 ; same case as above, but used differently ; both walking and changing facing direction without taking a step.
wd52a:: ds 1 ; same case as above
wPlayerMovingDirection:: ; d528
; if the player is moving, the current direction
; if the player is not moving, zero
; map scripts write to this in order to change the player's facing direction
ds 1
wPlayerLastStopDirection:: ; d529
; the direction in which the player was moving before the player last stopped
ds 1
wPlayerDirection:: ; d52a
; if the player is moving, the current direction
; if the player is not moving, the last the direction in which the player moved
ds 1
W_TILESETBANK:: ; d52b W_TILESETBANK:: ; d52b
ds 1 ds 1