You've already forked pokecrystal-board
mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2025-09-08 08:13:02 -07:00
Merge branch 'master' of https://github.com/pret/pokecrystal
# Conflicts: # audio/engine.asm # constants/gfx_constants.asm # constants/map_data_constants.asm # constants/pokemon_data_constants.asm # constants/sprite_constants.asm # constants/wram_constants.asm # data/maps/data.asm # engine/battle/ai/scoring.asm # engine/battle/core.asm # engine/battle/effect_commands.asm # engine/battle/misc.asm # engine/battle_anims/getpokeballwobble.asm # engine/breeding.asm # engine/buy_sell_toss.asm # engine/decorations.asm # engine/events/battle_tower/battle_tower.asm # engine/events/battle_tower/rules.asm # engine/events/buena.asm # engine/events/bug_contest/contest_2.asm # engine/events/daycare.asm # engine/events/dratini.asm # engine/events/halloffame.asm # engine/events/happiness_egg.asm # engine/events/kurt.asm # engine/events/lucky_number.asm # engine/events/magnet_train.asm # engine/events/overworld.asm # engine/events/pokerus/pokerus.asm # engine/events/print_unown.asm # engine/events/print_unown_2.asm # engine/events/unown_walls.asm # engine/item_effects.asm # engine/link.asm # engine/mon_menu.asm # engine/player_object.asm # engine/routines/playslowcry.asm # engine/scripting.asm # engine/search.asm # engine/search2.asm # engine/specials.asm # engine/start_menu.asm # engine/timeset.asm # home/battle_vars.asm # home/map.asm # maps/GoldenrodUndergroundSwitchRoomEntrances.asm # maps/IlexForest.asm # maps/KrissHouse2F.asm # maps/Route39Barn.asm # mobile/mobile_12_2.asm # mobile/mobile_40.asm # mobile/mobile_5f.asm # wram.asm
This commit is contained in:
108
home/audio.asm
108
home/audio.asm
@@ -55,14 +55,14 @@ UpdateSound:: ; 3b6a
|
||||
|
||||
|
||||
_LoadMusicByte:: ; 3b86
|
||||
; CurMusicByte = [a:de]
|
||||
; wCurMusicByte = [a:de]
|
||||
GLOBAL LoadMusicByte
|
||||
|
||||
ld [hROMBank], a
|
||||
ld [MBC3RomBank], a
|
||||
|
||||
ld a, [de]
|
||||
ld [CurMusicByte], a
|
||||
ld [wCurMusicByte], a
|
||||
ld a, BANK(LoadMusicByte)
|
||||
|
||||
ld [hROMBank], a
|
||||
@@ -168,13 +168,13 @@ endr
|
||||
inc hl
|
||||
|
||||
ld a, [hli]
|
||||
ld [CryPitch], a
|
||||
ld [wCryPitch], a
|
||||
ld a, [hli]
|
||||
ld [CryPitch + 1], a
|
||||
ld [wCryPitch + 1], a
|
||||
ld a, [hli]
|
||||
ld [CryLength], a
|
||||
ld [wCryLength], a
|
||||
ld a, [hl]
|
||||
ld [CryLength + 1], a
|
||||
ld [wCryLength + 1], a
|
||||
|
||||
ld a, BANK(_PlayCry)
|
||||
ld [hROMBank], a
|
||||
@@ -208,7 +208,7 @@ PlaySFX:: ; 3c23
|
||||
jr nc, .play
|
||||
|
||||
; Does it have priority?
|
||||
ld a, [CurSFX]
|
||||
ld a, [wCurSFX]
|
||||
cp e
|
||||
jr c, .done
|
||||
|
||||
@@ -220,7 +220,7 @@ PlaySFX:: ; 3c23
|
||||
ld [MBC3RomBank], a
|
||||
|
||||
ld a, e
|
||||
ld [CurSFX], a
|
||||
ld [wCurSFX], a
|
||||
call _PlaySFX
|
||||
|
||||
pop af
|
||||
@@ -249,16 +249,16 @@ WaitSFX:: ; 3c55
|
||||
push hl
|
||||
|
||||
.wait
|
||||
ld hl, Channel5Flags
|
||||
ld hl, wChannel5Flags
|
||||
bit 0, [hl]
|
||||
jr nz, .wait
|
||||
ld hl, Channel6Flags
|
||||
ld hl, wChannel6Flags
|
||||
bit 0, [hl]
|
||||
jr nz, .wait
|
||||
ld hl, Channel7Flags
|
||||
ld hl, wChannel7Flags
|
||||
bit 0, [hl]
|
||||
jr nz, .wait
|
||||
ld hl, Channel8Flags
|
||||
ld hl, wChannel8Flags
|
||||
bit 0, [hl]
|
||||
jr nz, .wait
|
||||
|
||||
@@ -271,16 +271,16 @@ IsSFXPlaying:: ; 3c74
|
||||
; The inverse of CheckSFX.
|
||||
push hl
|
||||
|
||||
ld hl, Channel5Flags
|
||||
ld hl, wChannel5Flags
|
||||
bit 0, [hl]
|
||||
jr nz, .playing
|
||||
ld hl, Channel6Flags
|
||||
ld hl, wChannel6Flags
|
||||
bit 0, [hl]
|
||||
jr nz, .playing
|
||||
ld hl, Channel7Flags
|
||||
ld hl, wChannel7Flags
|
||||
bit 0, [hl]
|
||||
jr nz, .playing
|
||||
ld hl, Channel8Flags
|
||||
ld hl, wChannel8Flags
|
||||
bit 0, [hl]
|
||||
jr nz, .playing
|
||||
|
||||
@@ -296,31 +296,31 @@ IsSFXPlaying:: ; 3c74
|
||||
|
||||
MaxVolume:: ; 3c97
|
||||
ld a, MAX_VOLUME
|
||||
ld [Volume], a
|
||||
ld [wVolume], a
|
||||
ret
|
||||
; 3c9d
|
||||
|
||||
LowVolume:: ; 3c9d
|
||||
ld a, $33 ; 40%
|
||||
ld [Volume], a
|
||||
ld [wVolume], a
|
||||
ret
|
||||
; 3ca3
|
||||
|
||||
VolumeOff:: ; 3ca3
|
||||
xor a
|
||||
ld [Volume], a
|
||||
ld [wVolume], a
|
||||
ret
|
||||
; 3ca8
|
||||
|
||||
Unused_FadeOutMusic:: ; 3ca8
|
||||
ld a, 4
|
||||
ld [MusicFade], a
|
||||
ld [wMusicFade], a
|
||||
ret
|
||||
; 3cae
|
||||
|
||||
FadeInMusic:: ; 3cae
|
||||
ld a, 4 | (1 << MUSIC_FADE_IN_F)
|
||||
ld [MusicFade], a
|
||||
ld [wMusicFade], a
|
||||
ret
|
||||
; 3cb4
|
||||
|
||||
@@ -346,11 +346,11 @@ FadeToMapMusic:: ; 3cbc
|
||||
jr z, .done
|
||||
|
||||
ld a, 8
|
||||
ld [MusicFade], a
|
||||
ld [wMusicFade], a
|
||||
ld a, e
|
||||
ld [MusicFadeID], a
|
||||
ld [wMusicFadeID], a
|
||||
ld a, d
|
||||
ld [MusicFadeID + 1], a
|
||||
ld [wMusicFadeID + 1], a
|
||||
ld a, e
|
||||
ld [wMapMusic], a
|
||||
|
||||
@@ -399,7 +399,7 @@ EnterMapMusic:: ; 3d03
|
||||
xor a
|
||||
ld [wDontPlayMapMusicOnReload], a
|
||||
ld de, MUSIC_BICYCLE
|
||||
ld a, [PlayerState]
|
||||
ld a, [wPlayerState]
|
||||
cp PLAYER_BIKE
|
||||
jr z, .play
|
||||
call GetMapMusic_MaybeSpecial
|
||||
@@ -455,7 +455,7 @@ RestartMapMusic:: ; 3d47
|
||||
; 3d62
|
||||
|
||||
SpecialMapMusic:: ; 3d62
|
||||
ld a, [PlayerState]
|
||||
ld a, [wPlayerState]
|
||||
cp PLAYER_SURF
|
||||
jr z, .surf
|
||||
cp PLAYER_SURF_PIKA
|
||||
@@ -480,10 +480,10 @@ SpecialMapMusic:: ; 3d62
|
||||
ret
|
||||
|
||||
.contest
|
||||
ld a, [MapGroup]
|
||||
ld a, [wMapGroup]
|
||||
cp GROUP_ROUTE_35_NATIONAL_PARK_GATE
|
||||
jr nz, .no
|
||||
ld a, [MapNumber]
|
||||
ld a, [wMapNumber]
|
||||
cp MAP_ROUTE_35_NATIONAL_PARK_GATE
|
||||
jr z, .ranking
|
||||
cp MAP_ROUTE_36_NATIONAL_PARK_GATE
|
||||
@@ -506,15 +506,15 @@ Unreferenced_Function3d9f:: ; 3d9f
|
||||
; Places a BCD number at the
|
||||
; upper center of the screen.
|
||||
ld a, 4 * TILE_WIDTH
|
||||
ld [Sprite39YCoord], a
|
||||
ld [Sprite40YCoord], a
|
||||
ld [wVirtualOAMSprite38YCoord], a
|
||||
ld [wVirtualOAMSprite39YCoord], a
|
||||
ld a, 10 * TILE_WIDTH
|
||||
ld [Sprite39XCoord], a
|
||||
ld [wVirtualOAMSprite38XCoord], a
|
||||
ld a, 11 * TILE_WIDTH
|
||||
ld [Sprite40XCoord], a
|
||||
ld [wVirtualOAMSprite39XCoord], a
|
||||
xor a
|
||||
ld [Sprite39Attributes], a
|
||||
ld [Sprite40Attributes], a
|
||||
ld [wVirtualOAMSprite38Attributes], a
|
||||
ld [wVirtualOAMSprite39Attributes], a
|
||||
ld a, [wc296]
|
||||
cp 100
|
||||
jr nc, .max
|
||||
@@ -524,32 +524,32 @@ Unreferenced_Function3d9f:: ; 3d9f
|
||||
swap a
|
||||
and $f
|
||||
add "0"
|
||||
ld [Sprite39TileID], a
|
||||
ld [wVirtualOAMSprite38TileID], a
|
||||
ld a, b
|
||||
and $f
|
||||
add "0"
|
||||
ld [Sprite40TileID], a
|
||||
ld [wVirtualOAMSprite39TileID], a
|
||||
ret
|
||||
|
||||
.max
|
||||
ld a, "9"
|
||||
ld [Sprite39TileID], a
|
||||
ld [Sprite40TileID], a
|
||||
ld [wVirtualOAMSprite38TileID], a
|
||||
ld [wVirtualOAMSprite39TileID], a
|
||||
ret
|
||||
; 3dde
|
||||
|
||||
CheckSFX:: ; 3dde
|
||||
; Return carry if any SFX channels are active.
|
||||
ld a, [Channel5Flags]
|
||||
ld a, [wChannel5Flags]
|
||||
bit 0, a
|
||||
jr nz, .playing
|
||||
ld a, [Channel6Flags]
|
||||
ld a, [wChannel6Flags]
|
||||
bit 0, a
|
||||
jr nz, .playing
|
||||
ld a, [Channel7Flags]
|
||||
ld a, [wChannel7Flags]
|
||||
bit 0, a
|
||||
jr nz, .playing
|
||||
ld a, [Channel8Flags]
|
||||
ld a, [wChannel8Flags]
|
||||
bit 0, a
|
||||
jr nz, .playing
|
||||
and a
|
||||
@@ -561,8 +561,8 @@ CheckSFX:: ; 3dde
|
||||
|
||||
TerminateExpBarSound:: ; 3dfe
|
||||
xor a
|
||||
ld [Channel5Flags], a
|
||||
ld [SoundInput], a
|
||||
ld [wChannel5Flags], a
|
||||
ld [wSoundInput], a
|
||||
ld [rNR10], a
|
||||
ld [rNR11], a
|
||||
ld [rNR12], a
|
||||
@@ -575,21 +575,21 @@ TerminateExpBarSound:: ; 3dfe
|
||||
ChannelsOff:: ; 3e10
|
||||
; Quickly turn off music channels
|
||||
xor a
|
||||
ld [Channel1Flags], a
|
||||
ld [Channel2Flags], a
|
||||
ld [Channel3Flags], a
|
||||
ld [Channel4Flags], a
|
||||
ld [SoundInput], a
|
||||
ld [wChannel1Flags], a
|
||||
ld [wChannel2Flags], a
|
||||
ld [wChannel3Flags], a
|
||||
ld [wChannel4Flags], a
|
||||
ld [wSoundInput], a
|
||||
ret
|
||||
; 3e21
|
||||
|
||||
SFXChannelsOff:: ; 3e21
|
||||
; Quickly turn off sound effect channels
|
||||
xor a
|
||||
ld [Channel5Flags], a
|
||||
ld [Channel6Flags], a
|
||||
ld [Channel7Flags], a
|
||||
ld [Channel8Flags], a
|
||||
ld [SoundInput], a
|
||||
ld [wChannel5Flags], a
|
||||
ld [wChannel6Flags], a
|
||||
ld [wChannel7Flags], a
|
||||
ld [wChannel8Flags], a
|
||||
ld [wSoundInput], a
|
||||
ret
|
||||
; 3e32
|
||||
|
||||
@@ -25,13 +25,13 @@ OpponentPartyAttr:: ; 3951
|
||||
|
||||
|
||||
BattlePartyAttr:: ; 395d
|
||||
; Get attribute a from the active BattleMon's party struct.
|
||||
; Get attribute a from the party struct of the active battle mon.
|
||||
push bc
|
||||
ld c, a
|
||||
ld b, 0
|
||||
ld hl, PartyMons
|
||||
ld hl, wPartyMons
|
||||
add hl, bc
|
||||
ld a, [CurBattleMon]
|
||||
ld a, [wCurBattleMon]
|
||||
call GetPartyLocation
|
||||
pop bc
|
||||
ret
|
||||
@@ -39,13 +39,13 @@ BattlePartyAttr:: ; 395d
|
||||
|
||||
|
||||
OTPartyAttr:: ; 396d
|
||||
; Get attribute a from the active EnemyMon's party struct.
|
||||
; Get attribute a from the party struct of the active enemy mon.
|
||||
push bc
|
||||
ld c, a
|
||||
ld b, 0
|
||||
ld hl, OTPartyMon1Species
|
||||
ld hl, wOTPartyMon1Species
|
||||
add hl, bc
|
||||
ld a, [CurOTMon]
|
||||
ld a, [wCurOTMon]
|
||||
call GetPartyLocation
|
||||
pop bc
|
||||
ret
|
||||
@@ -54,8 +54,8 @@ OTPartyAttr:: ; 396d
|
||||
|
||||
ResetDamage:: ; 397d
|
||||
xor a
|
||||
ld [CurDamage], a
|
||||
ld [CurDamage + 1], a
|
||||
ld [wCurDamage], a
|
||||
ld [wCurDamage + 1], a
|
||||
ret
|
||||
; 3985
|
||||
|
||||
@@ -89,16 +89,16 @@ UpdateUserInParty:: ; 3995
|
||||
UpdateBattleMonInParty:: ; 399c
|
||||
; Update level, status, current HP
|
||||
|
||||
ld a, [CurBattleMon]
|
||||
ld a, [wCurBattleMon]
|
||||
|
||||
UpdateBattleMon:: ; 399f
|
||||
ld hl, PartyMon1Level
|
||||
ld hl, wPartyMon1Level
|
||||
call GetPartyLocation
|
||||
|
||||
ld d, h
|
||||
ld e, l
|
||||
ld hl, BattleMonLevel
|
||||
ld bc, BattleMonMaxHP - BattleMonLevel
|
||||
ld hl, wBattleMonLevel
|
||||
ld bc, wBattleMonMaxHP - wBattleMonLevel
|
||||
jp CopyBytes
|
||||
; 39b0
|
||||
|
||||
@@ -110,14 +110,14 @@ UpdateEnemyMonInParty:: ; 39b0
|
||||
dec a
|
||||
ret z
|
||||
|
||||
ld a, [CurOTMon]
|
||||
ld hl, OTPartyMon1Level
|
||||
ld a, [wCurOTMon]
|
||||
ld hl, wOTPartyMon1Level
|
||||
call GetPartyLocation
|
||||
|
||||
ld d, h
|
||||
ld e, l
|
||||
ld hl, EnemyMonLevel
|
||||
ld bc, EnemyMonMaxHP - EnemyMonLevel
|
||||
ld hl, wEnemyMonLevel
|
||||
ld bc, wEnemyMonMaxHP - wEnemyMonLevel
|
||||
jp CopyBytes
|
||||
; 39c9
|
||||
|
||||
@@ -200,8 +200,6 @@ BattleTextBox:: ; 3ac3
|
||||
StdBattleTextBox:: ; 3ad5
|
||||
; Open a textbox and print battle text at 20:hl.
|
||||
|
||||
GLOBAL BattleText
|
||||
|
||||
ld a, [hROMBank]
|
||||
push af
|
||||
|
||||
@@ -217,16 +215,13 @@ GLOBAL BattleText
|
||||
|
||||
GetBattleAnimPointer:: ; 3ae1
|
||||
|
||||
GLOBAL BattleAnimations
|
||||
GLOBAL BattleAnimCommands
|
||||
|
||||
ld a, BANK(BattleAnimations)
|
||||
rst Bankswitch
|
||||
|
||||
ld a, [hli]
|
||||
ld [BattleAnimAddress], a
|
||||
ld [wBattleAnimAddress], a
|
||||
ld a, [hl]
|
||||
ld [BattleAnimAddress + 1], a
|
||||
ld [wBattleAnimAddress + 1], a
|
||||
|
||||
ld a, BANK(BattleAnimCommands)
|
||||
rst Bankswitch
|
||||
@@ -239,7 +234,7 @@ GetBattleAnimByte:: ; 3af0
|
||||
push hl
|
||||
push de
|
||||
|
||||
ld hl, BattleAnimAddress
|
||||
ld hl, wBattleAnimAddress
|
||||
ld e, [hl]
|
||||
inc hl
|
||||
ld d, [hl]
|
||||
@@ -248,7 +243,7 @@ GetBattleAnimByte:: ; 3af0
|
||||
rst Bankswitch
|
||||
|
||||
ld a, [de]
|
||||
ld [BattleAnimByte], a
|
||||
ld [wBattleAnimByte], a
|
||||
inc de
|
||||
|
||||
ld a, BANK(BattleAnimCommands)
|
||||
@@ -261,6 +256,6 @@ GetBattleAnimByte:: ; 3af0
|
||||
pop de
|
||||
pop hl
|
||||
|
||||
ld a, [BattleAnimByte]
|
||||
ld a, [wBattleAnimByte]
|
||||
ret
|
||||
; 3b0c
|
||||
|
||||
@@ -50,64 +50,64 @@ GetBattleVarAddr:: ; 39e7
|
||||
|
||||
BattleVarPairs:
|
||||
; entries correspond to BATTLE_VARS_* constants
|
||||
dw .substatus1
|
||||
dw .substatus2
|
||||
dw .substatus3
|
||||
dw .substatus4
|
||||
dw .substatus5
|
||||
dw .substatus1opp
|
||||
dw .substatus2opp
|
||||
dw .substatus3opp
|
||||
dw .substatus4opp
|
||||
dw .substatus5opp
|
||||
dw .status
|
||||
dw .statusopp
|
||||
dw .animation
|
||||
dw .effect
|
||||
dw .power
|
||||
dw .type
|
||||
dw .curmove
|
||||
dw .lastcounter
|
||||
dw .lastcounteropp
|
||||
dw .lastmove
|
||||
dw .lastmoveopp
|
||||
dw .Substatus1
|
||||
dw .Substatus2
|
||||
dw .Substatus3
|
||||
dw .Substatus4
|
||||
dw .Substatus5
|
||||
dw .Substatus1Opp
|
||||
dw .Substatus2Opp
|
||||
dw .Substatus3Opp
|
||||
dw .Substatus4Opp
|
||||
dw .Substatus5Opp
|
||||
dw .Status
|
||||
dw .StatusOpp
|
||||
dw .MoveAnim
|
||||
dw .MoveEffect
|
||||
dw .MovePower
|
||||
dw .MoveType
|
||||
dw .CurMove
|
||||
dw .LastCounter
|
||||
dw .LastCounterOpp
|
||||
dw .LastMove
|
||||
dw .LastMoveOpp
|
||||
|
||||
; player enemy
|
||||
.substatus1: db PLAYER_SUBSTATUS_1, ENEMY_SUBSTATUS_1
|
||||
.substatus1opp: db ENEMY_SUBSTATUS_1, PLAYER_SUBSTATUS_1
|
||||
.substatus2: db PLAYER_SUBSTATUS_2, ENEMY_SUBSTATUS_2
|
||||
.substatus2opp: db ENEMY_SUBSTATUS_2, PLAYER_SUBSTATUS_2
|
||||
.substatus3: db PLAYER_SUBSTATUS_3, ENEMY_SUBSTATUS_3
|
||||
.substatus3opp: db ENEMY_SUBSTATUS_3, PLAYER_SUBSTATUS_3
|
||||
.substatus4: db PLAYER_SUBSTATUS_4, ENEMY_SUBSTATUS_4
|
||||
.substatus4opp: db ENEMY_SUBSTATUS_4, PLAYER_SUBSTATUS_4
|
||||
.substatus5: db PLAYER_SUBSTATUS_5, ENEMY_SUBSTATUS_5
|
||||
.substatus5opp: db ENEMY_SUBSTATUS_5, PLAYER_SUBSTATUS_5
|
||||
.status: db PLAYER_STATUS, ENEMY_STATUS
|
||||
.statusopp: db ENEMY_STATUS, PLAYER_STATUS
|
||||
.animation: db PLAYER_MOVE_ANIMATION, ENEMY_MOVE_ANIMATION
|
||||
.effect: db PLAYER_MOVE_EFFECT, ENEMY_MOVE_EFFECT
|
||||
.power: db PLAYER_MOVE_POWER, ENEMY_MOVE_POWER
|
||||
.type: db PLAYER_MOVE_TYPE, ENEMY_MOVE_TYPE
|
||||
.curmove: db PLAYER_CUR_MOVE, ENEMY_CUR_MOVE
|
||||
.lastcounter: db PLAYER_COUNTER_MOVE, ENEMY_COUNTER_MOVE
|
||||
.lastcounteropp: db ENEMY_COUNTER_MOVE, PLAYER_COUNTER_MOVE
|
||||
.lastmove: db PLAYER_LAST_MOVE, ENEMY_LAST_MOVE
|
||||
.lastmoveopp: db ENEMY_LAST_MOVE, PLAYER_LAST_MOVE
|
||||
.Substatus1: db PLAYER_SUBSTATUS_1, ENEMY_SUBSTATUS_1
|
||||
.Substatus1Opp: db ENEMY_SUBSTATUS_1, PLAYER_SUBSTATUS_1
|
||||
.Substatus2: db PLAYER_SUBSTATUS_2, ENEMY_SUBSTATUS_2
|
||||
.Substatus2Opp: db ENEMY_SUBSTATUS_2, PLAYER_SUBSTATUS_2
|
||||
.Substatus3: db PLAYER_SUBSTATUS_3, ENEMY_SUBSTATUS_3
|
||||
.Substatus3Opp: db ENEMY_SUBSTATUS_3, PLAYER_SUBSTATUS_3
|
||||
.Substatus4: db PLAYER_SUBSTATUS_4, ENEMY_SUBSTATUS_4
|
||||
.Substatus4Opp: db ENEMY_SUBSTATUS_4, PLAYER_SUBSTATUS_4
|
||||
.Substatus5: db PLAYER_SUBSTATUS_5, ENEMY_SUBSTATUS_5
|
||||
.Substatus5Opp: db ENEMY_SUBSTATUS_5, PLAYER_SUBSTATUS_5
|
||||
.Status: db PLAYER_STATUS, ENEMY_STATUS
|
||||
.StatusOpp: db ENEMY_STATUS, PLAYER_STATUS
|
||||
.MoveAnim: db PLAYER_MOVE_ANIMATION, ENEMY_MOVE_ANIMATION
|
||||
.MoveEffect: db PLAYER_MOVE_EFFECT, ENEMY_MOVE_EFFECT
|
||||
.MovePower: db PLAYER_MOVE_POWER, ENEMY_MOVE_POWER
|
||||
.MoveType: db PLAYER_MOVE_TYPE, ENEMY_MOVE_TYPE
|
||||
.CurMove: db PLAYER_CUR_MOVE, ENEMY_CUR_MOVE
|
||||
.LastCounter: db PLAYER_COUNTER_MOVE, ENEMY_COUNTER_MOVE
|
||||
.LastCounterOpp: db ENEMY_COUNTER_MOVE, PLAYER_COUNTER_MOVE
|
||||
.LastMove: db PLAYER_LAST_MOVE, ENEMY_LAST_MOVE
|
||||
.LastMoveOpp: db ENEMY_LAST_MOVE, PLAYER_LAST_MOVE
|
||||
|
||||
BattleVarLocations:
|
||||
; entries correspond to PLAYER_* and ENEMY_* constants
|
||||
dw PlayerSubStatus1, EnemySubStatus1
|
||||
dw PlayerSubStatus2, EnemySubStatus2
|
||||
dw PlayerSubStatus3, EnemySubStatus3
|
||||
dw PlayerSubStatus4, EnemySubStatus4
|
||||
dw PlayerSubStatus5, EnemySubStatus5
|
||||
dw BattleMonStatus, EnemyMonStatus
|
||||
dw wPlayerSubStatus1, wEnemySubStatus1
|
||||
dw wPlayerSubStatus2, wEnemySubStatus2
|
||||
dw wPlayerSubStatus3, wEnemySubStatus3
|
||||
dw wPlayerSubStatus4, wEnemySubStatus4
|
||||
dw wPlayerSubStatus5, wEnemySubStatus5
|
||||
dw wBattleMonStatus, wEnemyMonStatus
|
||||
dw wPlayerMoveStructAnimation, wEnemyMoveStructAnimation
|
||||
dw wPlayerMoveStructEffect, wEnemyMoveStructEffect
|
||||
dw wPlayerMoveStructPower, wEnemyMoveStructPower
|
||||
dw wPlayerMoveStructType, wEnemyMoveStructType
|
||||
dw CurPlayerMove, CurEnemyMove
|
||||
dw LastPlayerCounterMove, LastEnemyCounterMove
|
||||
dw LastPlayerMove, LastEnemyMove
|
||||
dw wCurPlayerMove, wCurEnemyMove
|
||||
dw wLastPlayerCounterMove, wLastEnemyCounterMove
|
||||
dw wLastPlayerMove, wLastEnemyMove
|
||||
; 3a90
|
||||
|
||||
@@ -235,23 +235,23 @@ Request2bpp:: ; eba
|
||||
|
||||
.NotMobile:
|
||||
ld a, e
|
||||
ld [Requested2bppSource], a
|
||||
ld [wRequested2bppSource], a
|
||||
ld a, d
|
||||
ld [Requested2bppSource + 1], a
|
||||
ld [wRequested2bppSource + 1], a
|
||||
ld a, l
|
||||
ld [Requested2bppDest], a
|
||||
ld [wRequested2bppDest], a
|
||||
ld a, h
|
||||
ld [Requested2bppDest + 1], a
|
||||
ld [wRequested2bppDest + 1], a
|
||||
.loop
|
||||
ld a, c
|
||||
ld hl, hTilesPerCycle
|
||||
cp [hl]
|
||||
jr nc, .iterate
|
||||
|
||||
ld [Requested2bpp], a
|
||||
ld [wRequested2bpp], a
|
||||
.wait
|
||||
call DelayFrame
|
||||
ld a, [Requested2bpp]
|
||||
ld a, [wRequested2bpp]
|
||||
and a
|
||||
jr nz, .wait
|
||||
|
||||
@@ -267,11 +267,11 @@ Request2bpp:: ; eba
|
||||
|
||||
.iterate
|
||||
ld a, [hTilesPerCycle]
|
||||
ld [Requested2bpp], a
|
||||
ld [wRequested2bpp], a
|
||||
|
||||
.wait2
|
||||
call DelayFrame
|
||||
ld a, [Requested2bpp]
|
||||
ld a, [wRequested2bpp]
|
||||
and a
|
||||
jr nz, .wait2
|
||||
|
||||
@@ -311,23 +311,23 @@ Request1bpp:: ; f1e
|
||||
|
||||
.NotMobile:
|
||||
ld a, e
|
||||
ld [Requested1bppSource], a
|
||||
ld [wRequested1bppSource], a
|
||||
ld a, d
|
||||
ld [Requested1bppSource + 1], a
|
||||
ld [wRequested1bppSource + 1], a
|
||||
ld a, l
|
||||
ld [Requested1bppDest], a
|
||||
ld [wRequested1bppDest], a
|
||||
ld a, h
|
||||
ld [Requested1bppDest + 1], a
|
||||
ld [wRequested1bppDest + 1], a
|
||||
.loop
|
||||
ld a, c
|
||||
ld hl, hTilesPerCycle
|
||||
cp [hl]
|
||||
jr nc, .iterate
|
||||
|
||||
ld [Requested1bpp], a
|
||||
ld [wRequested1bpp], a
|
||||
.wait
|
||||
call DelayFrame
|
||||
ld a, [Requested1bpp]
|
||||
ld a, [wRequested1bpp]
|
||||
and a
|
||||
jr nz, .wait
|
||||
|
||||
@@ -343,11 +343,11 @@ Request1bpp:: ; f1e
|
||||
|
||||
.iterate
|
||||
ld a, [hTilesPerCycle]
|
||||
ld [Requested1bpp], a
|
||||
ld [wRequested1bpp], a
|
||||
|
||||
.wait2
|
||||
call DelayFrame
|
||||
ld a, [Requested1bpp]
|
||||
ld a, [wRequested1bpp]
|
||||
and a
|
||||
jr nz, .wait2
|
||||
|
||||
|
||||
10
home/cry.asm
10
home/cry.asm
@@ -29,7 +29,7 @@ PlayMonCry2:: ; 37d5
|
||||
push af
|
||||
xor a
|
||||
ld [wStereoPanningMask], a
|
||||
ld [CryTracks], a
|
||||
ld [wCryTracks], a
|
||||
pop af
|
||||
call _PlayMonCry
|
||||
ret
|
||||
@@ -76,13 +76,13 @@ endr
|
||||
inc hl
|
||||
|
||||
ld a, [hli]
|
||||
ld [CryPitch], a
|
||||
ld [wCryPitch], a
|
||||
ld a, [hli]
|
||||
ld [CryPitch + 1], a
|
||||
ld [wCryPitch + 1], a
|
||||
ld a, [hli]
|
||||
ld [CryLength], a
|
||||
ld [wCryLength], a
|
||||
ld a, [hl]
|
||||
ld [CryLength + 1], a
|
||||
ld [wCryLength + 1], a
|
||||
|
||||
pop af
|
||||
rst Bankswitch
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
DelayFrame:: ; 45a
|
||||
; Wait for one frame
|
||||
ld a, 1
|
||||
ld [VBlankOccurred], a
|
||||
ld [wVBlankOccurred], a
|
||||
|
||||
; Wait for the next VBlank, halting to conserve battery
|
||||
.halt
|
||||
halt ; rgbasm adds a nop after this instruction by default
|
||||
ld a, [VBlankOccurred]
|
||||
ld a, [wVBlankOccurred]
|
||||
and a
|
||||
jr nz, .halt
|
||||
ret
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
Unreferenced_Function48c:: ; 48c
|
||||
; TimeOfDayFade
|
||||
ld a, [TimeOfDayPal]
|
||||
ld a, [wTimeOfDayPal]
|
||||
ld b, a
|
||||
ld hl, IncGradGBPalTable_11
|
||||
ld a, l
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
ResetMapBufferEventFlags:: ; 2e50
|
||||
xor a
|
||||
ld hl, EventFlags
|
||||
ld hl, wEventFlags
|
||||
ld [hli], a
|
||||
ret
|
||||
; 2e56
|
||||
@@ -29,7 +29,7 @@ ResetFlashIfOutOfCave:: ; 2e5d
|
||||
|
||||
|
||||
EventFlagAction:: ; 0x2e6f
|
||||
ld hl, EventFlags
|
||||
ld hl, wEventFlags
|
||||
call FlagAction
|
||||
ret
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
ResetGameTime:: ; 208a
|
||||
xor a
|
||||
ld [GameTimeCap], a
|
||||
ld [GameTimeHours], a
|
||||
ld [GameTimeHours + 1], a
|
||||
ld [GameTimeMinutes], a
|
||||
ld [GameTimeSeconds], a
|
||||
ld [GameTimeFrames], a
|
||||
ld [wGameTimeCap], a
|
||||
ld [wGameTimeHours], a
|
||||
ld [wGameTimeHours + 1], a
|
||||
ld [wGameTimeMinutes], a
|
||||
ld [wGameTimeSeconds], a
|
||||
ld [wGameTimeFrames], a
|
||||
ret
|
||||
; 209e
|
||||
|
||||
@@ -16,7 +16,7 @@ GameTimer:: ; 209e
|
||||
|
||||
ld a, [rSVBK]
|
||||
push af
|
||||
ld a, BANK(GameTime)
|
||||
ld a, BANK(wGameTime)
|
||||
ld [rSVBK], a
|
||||
|
||||
call UpdateGameTimer
|
||||
@@ -43,13 +43,13 @@ UpdateGameTimer:: ; 20ad
|
||||
ret z
|
||||
|
||||
; Is the timer already capped?
|
||||
ld hl, GameTimeCap
|
||||
ld hl, wGameTimeCap
|
||||
bit 0, [hl]
|
||||
ret nz
|
||||
|
||||
|
||||
; +1 frame
|
||||
ld hl, GameTimeFrames
|
||||
ld hl, wGameTimeFrames
|
||||
ld a, [hl]
|
||||
inc a
|
||||
|
||||
@@ -65,7 +65,7 @@ UpdateGameTimer:: ; 20ad
|
||||
ld [hl], a
|
||||
|
||||
; +1 second
|
||||
ld hl, GameTimeSeconds
|
||||
ld hl, wGameTimeSeconds
|
||||
ld a, [hl]
|
||||
inc a
|
||||
|
||||
@@ -81,7 +81,7 @@ UpdateGameTimer:: ; 20ad
|
||||
ld [hl], a
|
||||
|
||||
; +1 minute
|
||||
ld hl, GameTimeMinutes
|
||||
ld hl, wGameTimeMinutes
|
||||
ld a, [hl]
|
||||
inc a
|
||||
|
||||
@@ -97,9 +97,9 @@ UpdateGameTimer:: ; 20ad
|
||||
ld [hl], a
|
||||
|
||||
; +1 hour
|
||||
ld a, [GameTimeHours]
|
||||
ld a, [wGameTimeHours]
|
||||
ld h, a
|
||||
ld a, [GameTimeHours + 1]
|
||||
ld a, [wGameTimeHours + 1]
|
||||
ld l, a
|
||||
inc hl
|
||||
|
||||
@@ -113,19 +113,19 @@ UpdateGameTimer:: ; 20ad
|
||||
cp LOW(1000)
|
||||
jr c, .ok
|
||||
|
||||
ld hl, GameTimeCap
|
||||
ld hl, wGameTimeCap
|
||||
set 0, [hl]
|
||||
|
||||
ld a, 59 ; 999:59:59.00
|
||||
ld [GameTimeMinutes], a
|
||||
ld [GameTimeSeconds], a
|
||||
ld [wGameTimeMinutes], a
|
||||
ld [wGameTimeSeconds], a
|
||||
ret
|
||||
|
||||
|
||||
.ok
|
||||
ld a, h
|
||||
ld [GameTimeHours], a
|
||||
ld [wGameTimeHours], a
|
||||
ld a, l
|
||||
ld [GameTimeHours + 1], a
|
||||
ld [wGameTimeHours + 1], a
|
||||
ret
|
||||
; 210f
|
||||
|
||||
@@ -79,7 +79,7 @@ Init:: ; 17d
|
||||
or c
|
||||
jr nz, .ByteFill
|
||||
|
||||
ld sp, Stack
|
||||
ld sp, wStack
|
||||
|
||||
; Clear HRAM
|
||||
ld a, [hCGB]
|
||||
@@ -103,10 +103,10 @@ Init:: ; 17d
|
||||
call ClearsScratch
|
||||
|
||||
|
||||
ld a, BANK(LoadPushOAM)
|
||||
ld a, BANK(WriteOAMDMACodeToHRAM)
|
||||
rst Bankswitch
|
||||
|
||||
call LoadPushOAM
|
||||
call WriteOAMDMACodeToHRAM
|
||||
|
||||
xor a
|
||||
ld [hMapAnims], a
|
||||
|
||||
@@ -129,7 +129,7 @@ GetJoypad:: ; 984
|
||||
|
||||
; The player input can be automated using an input stream.
|
||||
; See more below.
|
||||
ld a, [InputType]
|
||||
ld a, [wInputType]
|
||||
cp AUTO_INPUT
|
||||
jr z, .auto
|
||||
|
||||
@@ -173,22 +173,22 @@ GetJoypad:: ; 984
|
||||
; Read from the input stream.
|
||||
ld a, [hROMBank]
|
||||
push af
|
||||
ld a, [AutoInputBank]
|
||||
ld a, [wAutoInputBank]
|
||||
rst Bankswitch
|
||||
|
||||
ld hl, AutoInputAddress
|
||||
ld hl, wAutoInputAddress
|
||||
ld a, [hli]
|
||||
ld h, [hl]
|
||||
ld l, a
|
||||
|
||||
; We only update when the input duration has expired.
|
||||
ld a, [AutoInputLength]
|
||||
ld a, [wAutoInputLength]
|
||||
and a
|
||||
jr z, .updateauto
|
||||
|
||||
; Until then, don't change anything.
|
||||
dec a
|
||||
ld [AutoInputLength], a
|
||||
ld [wAutoInputLength], a
|
||||
pop af
|
||||
rst Bankswitch
|
||||
jr .quit
|
||||
@@ -203,7 +203,7 @@ GetJoypad:: ; 984
|
||||
|
||||
; A duration of $ff will end the stream indefinitely.
|
||||
ld a, [hli]
|
||||
ld [AutoInputLength], a
|
||||
ld [wAutoInputLength], a
|
||||
cp -1
|
||||
jr nz, .next
|
||||
|
||||
@@ -216,9 +216,9 @@ GetJoypad:: ; 984
|
||||
.next
|
||||
; On to the next input...
|
||||
ld a, l
|
||||
ld [AutoInputAddress], a
|
||||
ld [wAutoInputAddress], a
|
||||
ld a, h
|
||||
ld [AutoInputAddress+1], a
|
||||
ld [wAutoInputAddress+1], a
|
||||
jr .finishauto
|
||||
|
||||
.stopauto
|
||||
@@ -238,14 +238,14 @@ GetJoypad:: ; 984
|
||||
StartAutoInput:: ; 9ee
|
||||
; Start reading automated input stream at a:hl.
|
||||
|
||||
ld [AutoInputBank], a
|
||||
ld [wAutoInputBank], a
|
||||
ld a, l
|
||||
ld [AutoInputAddress], a
|
||||
ld [wAutoInputAddress], a
|
||||
ld a, h
|
||||
ld [AutoInputAddress+1], a
|
||||
ld [wAutoInputAddress+1], a
|
||||
; Start reading the stream immediately.
|
||||
xor a
|
||||
ld [AutoInputLength], a
|
||||
ld [wAutoInputLength], a
|
||||
; Reset input mirrors.
|
||||
xor a
|
||||
ld [hJoyPressed], a ; pressed this frame
|
||||
@@ -253,7 +253,7 @@ StartAutoInput:: ; 9ee
|
||||
ld [hJoyDown], a ; currently pressed
|
||||
|
||||
ld a, AUTO_INPUT
|
||||
ld [InputType], a
|
||||
ld [wInputType], a
|
||||
ret
|
||||
; a0a
|
||||
|
||||
@@ -261,12 +261,12 @@ StartAutoInput:: ; 9ee
|
||||
StopAutoInput:: ; a0a
|
||||
; Clear variables related to automated input.
|
||||
xor a
|
||||
ld [AutoInputBank], a
|
||||
ld [AutoInputAddress], a
|
||||
ld [AutoInputAddress+1], a
|
||||
ld [AutoInputLength], a
|
||||
ld [wAutoInputBank], a
|
||||
ld [wAutoInputAddress], a
|
||||
ld [wAutoInputAddress+1], a
|
||||
ld [wAutoInputLength], a
|
||||
; Back to normal input.
|
||||
ld [InputType], a
|
||||
ld [wInputType], a
|
||||
ret
|
||||
; a1b
|
||||
|
||||
@@ -336,11 +336,11 @@ JoyTextDelay:: ; a57
|
||||
and a
|
||||
jr z, .checkframedelay
|
||||
ld a, 15
|
||||
ld [TextDelayFrames], a
|
||||
ld [wTextDelayFrames], a
|
||||
ret
|
||||
|
||||
.checkframedelay
|
||||
ld a, [TextDelayFrames]
|
||||
ld a, [wTextDelayFrames]
|
||||
and a
|
||||
jr z, .restartframedelay
|
||||
xor a
|
||||
@@ -349,7 +349,7 @@ JoyTextDelay:: ; a57
|
||||
|
||||
.restartframedelay
|
||||
ld a, 5
|
||||
ld [TextDelayFrames], a
|
||||
ld [wTextDelayFrames], a
|
||||
ret
|
||||
; a80
|
||||
|
||||
@@ -411,7 +411,7 @@ ButtonSound:: ; aaf
|
||||
push af
|
||||
ld a, $1
|
||||
ld [hOAMUpdate], a
|
||||
ld a, [InputType]
|
||||
ld a, [wInputType]
|
||||
or a
|
||||
jr z, .input_wait_loop
|
||||
farcall _DudeAutoInput_A
|
||||
|
||||
@@ -6,7 +6,7 @@ Unreferenced_Function547:: ; 547
|
||||
cp rSCX - $ff00
|
||||
ret nz
|
||||
ld c, a
|
||||
ld a, [LYOverrides]
|
||||
ld a, [wLYOverrides]
|
||||
ld [$ff00+c], a
|
||||
ret
|
||||
; 552
|
||||
@@ -22,7 +22,7 @@ LCD:: ; 552
|
||||
push bc
|
||||
ld a, [rLY]
|
||||
ld c, a
|
||||
ld b, HIGH(LYOverrides)
|
||||
ld b, HIGH(wLYOverrides)
|
||||
ld a, [bc]
|
||||
ld b, a
|
||||
ld a, [hLCDCPointer]
|
||||
|
||||
326
home/map.asm
326
home/map.asm
File diff suppressed because it is too large
Load Diff
@@ -18,7 +18,7 @@ GetSpritePalette:: ; 17ff
|
||||
GetSpriteVTile:: ; 180e
|
||||
push hl
|
||||
push bc
|
||||
ld hl, UsedSprites + 2
|
||||
ld hl, wUsedSprites + 2
|
||||
ld c, SPRITE_GFX_LIST_CAPACITY - 1
|
||||
ld b, a
|
||||
ld a, [hMapObjectIndexBuffer]
|
||||
@@ -32,12 +32,12 @@ GetSpriteVTile:: ; 180e
|
||||
inc hl
|
||||
dec c
|
||||
jr nz, .loop
|
||||
ld a, [UsedSprites + 1]
|
||||
ld a, [wUsedSprites + 1]
|
||||
scf
|
||||
jr .done
|
||||
|
||||
.nope
|
||||
ld a, [UsedSprites + 1]
|
||||
ld a, [wUsedSprites + 1]
|
||||
jr .done
|
||||
|
||||
.found
|
||||
@@ -75,14 +75,14 @@ DoesSpriteHaveFacings:: ; 1836
|
||||
; 184a
|
||||
|
||||
GetPlayerStandingTile:: ; 184a
|
||||
ld a, [PlayerStandingTile]
|
||||
ld a, [wPlayerStandingTile]
|
||||
call GetTileCollision
|
||||
ld b, a
|
||||
ret
|
||||
; 1852
|
||||
|
||||
CheckOnWater:: ; 1852
|
||||
ld a, [PlayerStandingTile]
|
||||
ld a, [wPlayerStandingTile]
|
||||
call GetTileCollision
|
||||
sub WATERTILE
|
||||
ret z
|
||||
@@ -204,7 +204,7 @@ CheckWaterfallTile:: ; 18bd
|
||||
; 18c3
|
||||
|
||||
CheckStandingOnEntrance:: ; 18c3
|
||||
ld a, [PlayerStandingTile]
|
||||
ld a, [wPlayerStandingTile]
|
||||
cp COLL_DOOR
|
||||
ret z
|
||||
cp COLL_DOOR_79
|
||||
@@ -217,7 +217,7 @@ CheckStandingOnEntrance:: ; 18c3
|
||||
|
||||
GetMapObject:: ; 18d2
|
||||
; Return the location of map object a in bc.
|
||||
ld hl, MapObjects
|
||||
ld hl, wMapObjects
|
||||
ld bc, OBJECT_LENGTH
|
||||
call AddNTimes
|
||||
ld b, h
|
||||
@@ -256,7 +256,7 @@ CheckObjectTime:: ; 18f5
|
||||
cp -1
|
||||
jr z, .timeofday_always
|
||||
ld hl, .TimeOfDayValues_191e
|
||||
ld a, [TimeOfDay]
|
||||
ld a, [wTimeOfDay]
|
||||
add l
|
||||
ld l, a
|
||||
jr nc, .ok
|
||||
@@ -437,7 +437,7 @@ LoadMovementDataPointer:: ; 19e9
|
||||
add hl, bc
|
||||
ld [hl], STEP_TYPE_00
|
||||
|
||||
ld hl, VramState
|
||||
ld hl, wVramState
|
||||
set 7, [hl]
|
||||
and a
|
||||
ret
|
||||
@@ -449,7 +449,7 @@ FindFirstEmptyObjectStruct:: ; 1a13
|
||||
; Preserves BC and DE.
|
||||
push bc
|
||||
push de
|
||||
ld hl, ObjectStructs
|
||||
ld hl, wObjectStructs
|
||||
ld de, OBJECT_STRUCT_LENGTH
|
||||
ld c, NUM_OBJECT_STRUCTS
|
||||
.loop
|
||||
@@ -607,19 +607,19 @@ _GetMovementByte:: ; 1aae
|
||||
; 1ac6
|
||||
|
||||
SetVramState_Bit0:: ; 1ac6
|
||||
ld hl, VramState
|
||||
ld hl, wVramState
|
||||
set 0, [hl]
|
||||
ret
|
||||
; 1acc
|
||||
|
||||
ResetVramState_Bit0:: ; 1acc
|
||||
ld hl, VramState
|
||||
ld hl, wVramState
|
||||
res 0, [hl]
|
||||
ret
|
||||
; 1ad2
|
||||
|
||||
UpdateSprites:: ; 1ad2
|
||||
ld a, [VramState]
|
||||
ld a, [wVramState]
|
||||
bit 0, a
|
||||
ret z
|
||||
|
||||
@@ -630,7 +630,7 @@ UpdateSprites:: ; 1ad2
|
||||
|
||||
GetObjectStruct:: ; 1ae5
|
||||
ld bc, OBJECT_STRUCT_LENGTH
|
||||
ld hl, ObjectStructs
|
||||
ld hl, wObjectStructs
|
||||
call AddNTimes
|
||||
ld b, h
|
||||
ld c, l
|
||||
|
||||
@@ -315,7 +315,7 @@ RunMenuItemPrintingFunction:: ; 1eda
|
||||
ld a, [de]
|
||||
cp -1
|
||||
ret z
|
||||
ld [MenuSelection], a
|
||||
ld [wMenuSelection], a
|
||||
push de
|
||||
push hl
|
||||
ld d, h
|
||||
@@ -405,7 +405,7 @@ ContinueGettingMenuJoypad:
|
||||
ld h, $0
|
||||
add hl, de
|
||||
ld a, [hl]
|
||||
ld [MenuSelection], a
|
||||
ld [wMenuSelection], a
|
||||
ld a, [wMenuCursorY]
|
||||
ld [wMenuCursorBuffer], a
|
||||
and a
|
||||
@@ -415,7 +415,7 @@ ContinueGettingMenuJoypad:
|
||||
ld a, B_BUTTON
|
||||
ld [wMenuJoypad], a
|
||||
ld a, -1
|
||||
ld [MenuSelection], a
|
||||
ld [wMenuSelection], a
|
||||
scf
|
||||
ret
|
||||
; 1f79
|
||||
@@ -426,7 +426,7 @@ PlaceMenuStrings:: ; 1f79
|
||||
ld a, [hli]
|
||||
ld h, [hl]
|
||||
ld l, a
|
||||
ld a, [MenuSelection]
|
||||
ld a, [wMenuSelection]
|
||||
call GetNthString
|
||||
ld d, h
|
||||
ld e, l
|
||||
@@ -437,7 +437,7 @@ PlaceMenuStrings:: ; 1f79
|
||||
|
||||
PlaceNthMenuStrings:: ; 1f8d
|
||||
push de
|
||||
ld a, [MenuSelection]
|
||||
ld a, [wMenuSelection]
|
||||
call GetMenuDataPointerTableEntry
|
||||
inc hl
|
||||
inc hl
|
||||
@@ -460,7 +460,7 @@ Unreferenced_Function1f9e:: ; 1f9e
|
||||
; 1fa7
|
||||
|
||||
MenuJumptable:: ; 1fa7
|
||||
ld a, [MenuSelection]
|
||||
ld a, [wMenuSelection]
|
||||
call GetMenuDataPointerTableEntry
|
||||
ld a, [hli]
|
||||
ld h, [hl]
|
||||
|
||||
@@ -146,7 +146,7 @@ Unreferenced_Function3ed7:: ; 3ed7
|
||||
Function3eea:: ; 3eea
|
||||
push hl
|
||||
push bc
|
||||
ld de, AttrMap - TileMap
|
||||
ld de, wAttrMap - wTileMap
|
||||
add hl, de
|
||||
inc b
|
||||
inc b
|
||||
@@ -173,7 +173,7 @@ Unreferenced_Function3efd:: ; 3efd
|
||||
.fill_attr
|
||||
push hl
|
||||
push bc
|
||||
ld de, AttrMap - TileMap
|
||||
ld de, wAttrMap - wTileMap
|
||||
add hl, de
|
||||
inc b
|
||||
inc b
|
||||
@@ -187,7 +187,7 @@ Unreferenced_Function3efd:: ; 3efd
|
||||
; 3f20
|
||||
|
||||
Function3f20:: ; 3f20
|
||||
hlcoord 0, 0, AttrMap
|
||||
hlcoord 0, 0, wAttrMap
|
||||
ld b, 6
|
||||
ld c, 20
|
||||
call Function3f35
|
||||
|
||||
@@ -4,9 +4,9 @@ InitMovementBuffer:: ; 1b1e
|
||||
ld [wMovementBufferCount], a
|
||||
ld a, $0 ; useless
|
||||
ld [wUnusedMovementBufferBank], a
|
||||
ld a, LOW(MovementBuffer)
|
||||
ld a, LOW(wMovementBuffer)
|
||||
ld [wUnusedMovementBufferPointer], a
|
||||
ld a, HIGH(MovementBuffer)
|
||||
ld a, HIGH(wMovementBuffer)
|
||||
ld [wUnusedMovementBufferPointer + 1], a
|
||||
ret
|
||||
; 1b35
|
||||
@@ -27,7 +27,7 @@ AppendToMovementBuffer:: ; 1b3f
|
||||
ld e, [hl]
|
||||
inc [hl]
|
||||
ld d, 0
|
||||
ld hl, MovementBuffer
|
||||
ld hl, wMovementBuffer
|
||||
add hl, de
|
||||
ld [hl], a
|
||||
pop de
|
||||
|
||||
@@ -4,14 +4,14 @@ NamesPointers:: ; 33ab
|
||||
dba MoveNames ; MOVE_NAME
|
||||
dbw 0, NULL ; DUMMY_NAME
|
||||
dba ItemNames ; ITEM_NAME
|
||||
dbw 0, PartyMonOT ; PARTY_OT_NAME
|
||||
dbw 0, OTPartyMonOT ; ENEMY_OT_NAME
|
||||
dbw 0, wPartyMonOT ; PARTY_OT_NAME
|
||||
dbw 0, wOTPartyMonOT ; ENEMY_OT_NAME
|
||||
dba TrainerClassNames ; TRAINER_NAME
|
||||
dbw 4, MoveDescriptions ; MOVE_DESC_NAME_BROKEN (wrong bank)
|
||||
; 33c3
|
||||
|
||||
GetName:: ; 33c3
|
||||
; Return name CurSpecies from name list wNamedObjectTypeBuffer in StringBuffer1.
|
||||
; Return name wCurSpecies from name list wNamedObjectTypeBuffer in wStringBuffer1.
|
||||
|
||||
ld a, [hROMBank]
|
||||
push af
|
||||
@@ -23,7 +23,7 @@ GetName:: ; 33c3
|
||||
cp MON_NAME
|
||||
jr nz, .NotPokeName
|
||||
|
||||
ld a, [CurSpecies]
|
||||
ld a, [wCurSpecies]
|
||||
ld [wd265], a
|
||||
call GetPokemonName
|
||||
ld hl, MON_NAME_LENGTH
|
||||
@@ -47,11 +47,11 @@ GetName:: ; 33c3
|
||||
ld h, [hl]
|
||||
ld l, a
|
||||
|
||||
ld a, [CurSpecies]
|
||||
ld a, [wCurSpecies]
|
||||
dec a
|
||||
call GetNthString
|
||||
|
||||
ld de, StringBuffer1
|
||||
ld de, wStringBuffer1
|
||||
ld bc, ITEM_NAME_LENGTH
|
||||
call CopyBytes
|
||||
|
||||
@@ -95,7 +95,7 @@ GetBasePokemonName:: ; 3420
|
||||
push hl
|
||||
call GetPokemonName
|
||||
|
||||
ld hl, StringBuffer1
|
||||
ld hl, wStringBuffer1
|
||||
.loop
|
||||
ld a, [hl]
|
||||
cp "@"
|
||||
@@ -138,11 +138,11 @@ GetPokemonName:: ; 343b
|
||||
add hl, de
|
||||
|
||||
; Terminator
|
||||
ld de, StringBuffer1
|
||||
ld de, wStringBuffer1
|
||||
push de
|
||||
ld bc, MON_NAME_LENGTH - 1
|
||||
call CopyBytes
|
||||
ld hl, StringBuffer1 + MON_NAME_LENGTH - 1
|
||||
ld hl, wStringBuffer1 + MON_NAME_LENGTH - 1
|
||||
ld [hl], "@"
|
||||
pop de
|
||||
|
||||
@@ -162,7 +162,7 @@ GetItemName:: ; 3468
|
||||
cp TM01
|
||||
jr nc, .TM
|
||||
|
||||
ld [CurSpecies], a
|
||||
ld [wCurSpecies], a
|
||||
ld a, ITEM_NAME
|
||||
ld [wNamedObjectTypeBuffer], a
|
||||
call GetName
|
||||
@@ -170,7 +170,7 @@ GetItemName:: ; 3468
|
||||
.TM:
|
||||
call GetTMHMName
|
||||
.Copied:
|
||||
ld de, StringBuffer1
|
||||
ld de, wStringBuffer1
|
||||
pop bc
|
||||
pop hl
|
||||
ret
|
||||
@@ -199,7 +199,7 @@ GetTMHMName:: ; 3487
|
||||
ld bc, .TMTextEnd - .TMText
|
||||
|
||||
.asm_34a1
|
||||
ld de, StringBuffer1
|
||||
ld de, wStringBuffer1
|
||||
call CopyBytes
|
||||
|
||||
; TM/HM number
|
||||
@@ -268,10 +268,10 @@ GetMoveName:: ; 34f8
|
||||
ld [wNamedObjectTypeBuffer], a
|
||||
|
||||
ld a, [wNamedObjectIndexBuffer] ; move id
|
||||
ld [CurSpecies], a
|
||||
ld [wCurSpecies], a
|
||||
|
||||
call GetName
|
||||
ld de, StringBuffer1
|
||||
ld de, wStringBuffer1
|
||||
|
||||
pop hl
|
||||
ret
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
SetSeenAndCaughtMon:: ; 3380
|
||||
push af
|
||||
ld c, a
|
||||
ld hl, PokedexCaught
|
||||
ld hl, wPokedexCaught
|
||||
ld b, SET_FLAG
|
||||
call PokedexFlagAction
|
||||
pop af
|
||||
@@ -10,21 +10,21 @@ SetSeenAndCaughtMon:: ; 3380
|
||||
|
||||
SetSeenMon:: ; 338b
|
||||
ld c, a
|
||||
ld hl, PokedexSeen
|
||||
ld hl, wPokedexSeen
|
||||
ld b, SET_FLAG
|
||||
jr PokedexFlagAction
|
||||
; 3393
|
||||
|
||||
CheckCaughtMon:: ; 3393
|
||||
ld c, a
|
||||
ld hl, PokedexCaught
|
||||
ld hl, wPokedexCaught
|
||||
ld b, CHECK_FLAG
|
||||
jr PokedexFlagAction
|
||||
; 339b
|
||||
|
||||
CheckSeenMon:: ; 339b
|
||||
ld c, a
|
||||
ld hl, PokedexSeen
|
||||
ld hl, wPokedexSeen
|
||||
ld b, CHECK_FLAG
|
||||
; fallthrough
|
||||
; 33a1
|
||||
|
||||
@@ -2,13 +2,13 @@ Predef:: ; 2d83
|
||||
; Call predefined function a.
|
||||
; Preserves bc, de, hl and f.
|
||||
|
||||
ld [PredefID], a
|
||||
ld [wPredefID], a
|
||||
ld a, [hROMBank]
|
||||
push af
|
||||
|
||||
ld a, BANK(GetPredefPointer)
|
||||
rst Bankswitch
|
||||
call GetPredefPointer ; stores hl in PredefTemp
|
||||
call GetPredefPointer ; stores hl in wPredefTemp
|
||||
|
||||
; Switch to the new function's bank
|
||||
rst Bankswitch
|
||||
@@ -20,16 +20,16 @@ Predef:: ; 2d83
|
||||
push hl
|
||||
|
||||
; Call the Predef function
|
||||
ld a, [PredefAddress]
|
||||
ld a, [wPredefAddress]
|
||||
ld h, a
|
||||
ld a, [PredefAddress + 1]
|
||||
ld a, [wPredefAddress + 1]
|
||||
ld l, a
|
||||
push hl
|
||||
|
||||
; Get hl back
|
||||
ld a, [PredefTemp]
|
||||
ld a, [wPredefTemp]
|
||||
ld h, a
|
||||
ld a, [PredefTemp + 1]
|
||||
ld a, [wPredefTemp + 1]
|
||||
ld l, a
|
||||
ret
|
||||
|
||||
@@ -37,17 +37,17 @@ Predef:: ; 2d83
|
||||
; Clean up after the Predef call
|
||||
|
||||
ld a, h
|
||||
ld [PredefTemp], a
|
||||
ld [wPredefTemp], a
|
||||
ld a, l
|
||||
ld [PredefTemp+1], a
|
||||
ld [wPredefTemp+1], a
|
||||
|
||||
pop hl
|
||||
ld a, h
|
||||
rst Bankswitch
|
||||
|
||||
ld a, [PredefTemp]
|
||||
ld a, [wPredefTemp]
|
||||
ld h, a
|
||||
ld a, [PredefTemp + 1]
|
||||
ld a, [wPredefTemp + 1]
|
||||
ld l, a
|
||||
ret
|
||||
; 2dba
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user