ref: cd649184f556db777d592671a7274bfa4a8423d7
parent: ae420a4d8f24d4c4290b7b2e7ccc02f363272548
author: U-Daniel-PC\Daniel <corrnondacqb@yahoo.com>
date: Fri Jul 3 10:37:53 EDT 2015
Rename/organize part 1 of 4 rename functions, clean up address/wram comments, other misc only broken up so that all changes are viewable on github
--- a/constants/item_constants.asm
+++ b/constants/item_constants.asm
@@ -78,7 +78,6 @@
OLD_ROD EQU $4C
GOOD_ROD EQU $4D
SUPER_ROD EQU $4E
-; XXX todo: compare this to $32
PP_UP EQU $4F
ETHER EQU $50
MAX_ETHER EQU $51
--- a/data/mapObjects/redshouse2f.asm
+++ b/data/mapObjects/redshouse2f.asm
@@ -1,4 +1,4 @@
-RedsHouse2FObject: ; 0x5c0d0 ?
+RedsHouse2FObject: ; 0x5c0d0
db $0A ; border block
db $1 ; warps
--- a/data/mon_party_sprites.asm
+++ b/data/mon_party_sprites.asm
@@ -13,8 +13,8 @@
dn SPRITE_SNAKE, SPRITE_SNAKE ;Ekans/Arbok
dn SPRITE_FAIRY, SPRITE_FAIRY ;Pikachu/Raichu
dn SPRITE_MON, SPRITE_MON ;Sandshrew/Sandslash
- dn SPRITE_MON, SPRITE_MON ;Nidoran?/Nidorina
- dn SPRITE_MON, SPRITE_MON ;Nidoqueen/Nidoran?
+ dn SPRITE_MON, SPRITE_MON ;NidoranF/Nidorina
+ dn SPRITE_MON, SPRITE_MON ;Nidoqueen/NidoranM
dn SPRITE_MON, SPRITE_MON ;Nidorino/Nidoking
dn SPRITE_FAIRY, SPRITE_FAIRY ;Clefairy/Clefable
dn SPRITE_QUADRUPED, SPRITE_QUADRUPED ;Vulpix/Ninetales
--- a/engine/HoF_room_pc.asm
+++ b/engine/HoF_room_pc.asm
@@ -1,7 +1,7 @@
HallOfFamePC: ; 7405c (1d:405c)
callba AnimateHallOfFame
call ClearScreen
- ld c, $64
+ ld c, 100
call DelayFrames
call DisableLCD
ld hl, vFont
@@ -19,7 +19,7 @@
hlCoord 0, 14
call Func_7417b
ld a, $c0
- ld [rBGP], a ; $ff47
+ ld [rBGP], a
call EnableLCD
ld a, $ff
call PlaySoundWaitForCurrent
@@ -26,20 +26,20 @@
ld c, BANK(Music_Credits)
ld a, MUSIC_CREDITS
call PlayMusic
- ld c, $80
+ ld c, 128
call DelayFrames
xor a
- ld [wWhichTrade], a ; wWhichTrade
+ ld [wWhichTrade], a
ld [wTrainerEngageDistance], a
jp Credits
Func_740ba: ; 740ba (1d:40ba)
- ld hl, DataTable_74160 ; $4160
+ ld hl, DataTable_74160
ld b, $4
.asm_740bf
ld a, [hli]
- ld [rBGP], a ; $ff47
- ld c, $5
+ ld [rBGP], a
+ ld c, 5
call DelayFrames
dec b
jr nz, .asm_740bf
@@ -116,7 +116,7 @@
cp l
jr nz, Func_74152
ld a, h
- ld [rSCX], a ; $ff43
+ ld [rSCX], a
.asm_7415a
ld a, [$ff44]
cp h
@@ -128,11 +128,11 @@
Func_74164: ; 74164 (1d:4164)
ld a, l
- ld [H_AUTOBGTRANSFERDEST], a ; $ffbc
+ ld [H_AUTOBGTRANSFERDEST], a
ld a, h
ld [$ffbd], a
ld a, $1
- ld [H_AUTOBGTRANSFERENABLED], a ; $ffba
+ ld [H_AUTOBGTRANSFERENABLED], a
jp Delay3
Func_74171: ; 74171 (1d:4171)
@@ -157,7 +157,7 @@
jp FillMemory
Credits: ; 7418e (1d:418e)
- ld de, CreditsOrder ; $4243
+ ld de, CreditsOrder
push de
.asm_74192
pop de
@@ -183,7 +183,7 @@
jr z, .showTheEnd
push hl
push hl
- ld hl, CreditsTextPointers ; $42c3
+ ld hl, CreditsTextPointers
add a
ld c, a
ld b, $0
@@ -205,10 +205,10 @@
jr .asm_7419b
.asm_741d5
call Func_740ba
- ld c, $5a
+ ld c, 90
jr .asm_741de
.asm_741dc
- ld c, $6e
+ ld c, 110
.asm_741de
call DelayFrames
call DisplayCreditsMon
@@ -215,10 +215,10 @@
jr .asm_74192
.asm_741e6
call Func_740ba
- ld c, $78
+ ld c, 120
jr .asm_741ef
.asm_741ed
- ld c, $8c
+ ld c, 140
.asm_741ef
call DelayFrames
jr .asm_74192
@@ -229,7 +229,7 @@
pop de
jr .asm_7419b
.showTheEnd
- ld c, $10
+ ld c, 16
call DelayFrames
call FillMiddleOfScreenWithWhite
pop de
--- a/engine/battle/animations.asm
+++ b/engine/battle/animations.asm
@@ -170,7 +170,7 @@
ld l,a
ld h,0
add hl,hl
- ld de,AttackAnimationPointers ; $607d ; animation command stream pointers
+ ld de,AttackAnimationPointers ; animation command stream pointers
add hl,de
ld a,[hli]
ld h,[hl]
@@ -199,7 +199,7 @@
ld [wAnimSoundID],a ; store sound
push hl
push de
- call Func_7986f
+ call GetMoveSound
call PlaySound
pop de
pop hl
@@ -383,7 +383,7 @@
push bc
push af
call WaitForSoundToFinish
- call Func_78e23
+ call SetAnimationPalette
ld a,[W_ANIMATIONID]
and a
jr z,.AnimationFinished
@@ -500,19 +500,19 @@
push bc
push bc
.asm_78e03
- ld a, [rWX] ; $ff4b
+ ld a, [rWX]
inc a
- ld [rWX], a ; $ff4b
- ld c, $2
+ ld [rWX], a
+ ld c, 2
call DelayFrames
dec b
jr nz, .asm_78e03
pop bc
.asm_78e11
- ld a, [rWX] ; $ff4b
+ ld a, [rWX]
dec a
- ld [rWX], a ; $ff4b
- ld c, $2
+ ld [rWX], a
+ ld c, 2
call DelayFrames
dec b
jr nz, .asm_78e11
@@ -521,7 +521,7 @@
jr nz, AnimationShakeScreenHorizontallySlow
ret
-Func_78e23: ; 78e23 (1e:4e23)
+SetAnimationPalette: ; 78e23 (1e:4e23)
ld a, [wOnSGB]
and a
ld a, $e4
@@ -529,7 +529,7 @@
ld a, $f0
ld [wcc79], a
ld b, $e4
- ld a, [W_ANIMATIONID] ; W_ANIMATIONID
+ ld a, [W_ANIMATIONID]
cp TRADE_BALL_DROP_ANIM
jr c, .asm_78e3f
cp TRADE_BALL_POOF_ANIM + 1
@@ -537,16 +537,16 @@
ld b, $f0
.asm_78e3f
ld a, b
- ld [rOBP0], a ; $ff48
+ ld [rOBP0], a
ld a, $6c
- ld [rOBP1], a ; $ff49
+ ld [rOBP1], a
ret
.asm_78e47
ld a, $e4
ld [wcc79], a
- ld [rOBP0], a ; $ff48
+ ld [rOBP0], a
ld a, $6c
- ld [rOBP1], a ; $ff49
+ ld [rOBP1], a
ret
PlaySubanimation: ; 78e53 (1e:4e53)
@@ -553,8 +553,8 @@
ld a,[wAnimSoundID]
cp a,$FF
jr z,.skipPlayingSound
- call Func_7986f
- call PlaySound ; play sound effect
+ call GetMoveSound
+ call PlaySound
.skipPlayingSound
ld hl,wOAMBuffer ; base address of OAM buffer
ld a,l
@@ -581,7 +581,7 @@
push hl
ld e,[hl] ; base coordinate ID
ld d,0
- ld hl,FrameBlockBaseCoords ; $7c85 ; base coordinate table
+ ld hl,FrameBlockBaseCoords ; base coordinate table
add hl,de
add hl,de
ld a,[hli]
@@ -667,7 +667,7 @@
dw AnimationFlashScreen
db TAIL_WHIP
- dw Func_790d0
+ dw TailWhipAnimationUnused
db GROWL
dw DoGrowlSpecialEffects
@@ -703,13 +703,13 @@
dw DoRockSlideSpecialEffects
db TRADE_BALL_DROP_ANIM
- dw Func_79041
+ dw TradeHidePokemon
db TRADE_BALL_SHAKE_ANIM
- dw Func_7904c
+ dw TradeShakePokeball
db TRADE_BALL_TILT_ANIM
- dw Func_7907c
+ dw TradeJumpPokeball
db TOSS_ANIM
dw DoBallTossSpecialEffects
@@ -742,7 +742,7 @@
jr nz,.skipPlayingSound
; if it is the beginning of the subanimation, play a sound
ld a,(SFX_08_41 - SFX_Headers_08) / 3
- call PlaySound ; play sound
+ call PlaySound
.skipPlayingSound
ld a,[W_ISINBATTLE]
cp a,02 ; is it a trainer battle?
@@ -788,7 +788,7 @@
jr nz,.skipPlayingSound
; if it is the beginning of a shake, play a sound and wait 2/3 of a second
ld a,(SFX_08_3c - SFX_Headers_08) / 3
- call PlaySound ; play sound
+ call PlaySound
ld c,40
call DelayFrames
.skipPlayingSound
@@ -875,8 +875,8 @@
ret
; flashes the screen at 3 points in the subanimation
-; XXX is this unused?
-Func_7902e: ; 7902e (1e:502e)
+; unused
+FlashScreenUnused: ; 7902e (1e:502e)
ld a,[W_SUBANIMCOUNTER]
cp a,14
jp z,AnimationFlashScreen
@@ -887,8 +887,7 @@
ret
; function to make the pokemon disappear at the beginning of the animation
-; XXX probably a trade-related animation
-Func_79041: ; 79041 (1e:5041)
+TradeHidePokemon: ; 79041 (1e:5041)
ld a,[W_SUBANIMCOUNTER]
cp a,6
ret nz
@@ -896,8 +895,7 @@
jp Func_7980c ; make pokemon disappear
; function to make a shaking pokeball jump up at the end of the animation
-; XXX probably a trade-related animation
-Func_7904c: ; 7904c (1e:504c)
+TradeShakePokeball: ; 7904c (1e:504c)
ld a,[W_SUBANIMCOUNTER]
cp a,1
ret nz
@@ -924,7 +922,7 @@
.done
call AnimationCleanOAM
ld a,(SFX_02_44 - SFX_Headers_02) / 3
- jp PlaySound ; play sound
+ jp PlaySound
BallMoveDistances1: ; 79078 (1e:5078)
db -12,-12,-8
@@ -931,8 +929,7 @@
db $ff ; terminator
; function to make the pokeball jump up
-; XXX probably a trade-related animation
-Func_7907c ; 507C
+TradeJumpPokeball: ; 507C
ld de,BallMoveDistances2
.loop
ld hl,wOAMBuffer ; OAM buffer
@@ -985,7 +982,7 @@
ret
; this is associated with Tail Whip, but Tail Whip doesn't use any subanimations
-Func_790d0: ; 790d0 (1e:50d0)
+TailWhipAnimationUnused: ; 790d0 (1e:50d0)
ld a,1
ld [W_SUBANIMCOUNTER],a
ld c,20
@@ -1183,39 +1180,39 @@
AnimationDarkScreenPalette: ; 791d6 (1e:51d6)
; Changes the screen's palette to a dark palette.
ld bc, $6f6f
- jr Func_791fc
+ jr SetAnimationBGPalette
AnimationDarkenMonPalette: ; 791db (1e:51db)
; Darkens the mon sprite's palette.
ld bc, $f9f4
- jr Func_791fc
+ jr SetAnimationBGPalette
-Func_791e0: ; 791e0 (1e:51e0)
+AnimationUnusedPalette1: ; 791e0 (1e:51e0)
ld bc, $fef8
- jr Func_791fc
+ jr SetAnimationBGPalette
-Func_791e5: ; 791e5 (1e:51e5)
+AnimationUnusedPalette2: ; 791e5 (1e:51e5)
ld bc, $ffff
- jr Func_791fc
+ jr SetAnimationBGPalette
AnimationResetScreenPalette: ; 791ea (1e:51ea)
; Restores the screen's palette to the normal palette.
ld bc, $e4e4
- jr Func_791fc
+ jr SetAnimationBGPalette
-Func_791ef: ; 791ef (1e:51ef)
+AnimationUnusedPalette3: ; 791ef (1e:51ef)
ld bc, $0000
- jr Func_791fc
+ jr SetAnimationBGPalette
AnimationLightScreenPalette: ; 791f4 (1e:51f4)
; Changes the screen to use a palette with light colors.
ld bc, $9090
- jr Func_791fc
+ jr SetAnimationBGPalette
-Func_791f9: ; 791f9 (1e:51f9)
+AnimationUnusedPalette4: ; 791f9 (1e:51f9)
ld bc, $4040
-Func_791fc: ; 791fc (1e:51fc)
+SetAnimationBGPalette: ; 791fc (1e:51fc)
ld a, [wOnSGB]
and a
ld a, b
@@ -1222,7 +1219,7 @@
jr z, .asm_79204
ld a, c
.asm_79204
- ld [rBGP], a ; $ff47
+ ld [rBGP], a
ret
ld b, $5
@@ -1246,45 +1243,45 @@
call LoadAnimationTileset
ld d, $20
ld a, $f0
- ld [W_BASECOORDX], a ; wd081
+ ld [W_BASECOORDX], a
ld a, $71
ld [wd09f], a
.asm_79228
ld a, $10
- ld [W_BASECOORDY], a ; wd082
+ ld [W_BASECOORDY], a
ld a, $0
ld [wd08a], a
- call Func_79246
+ call _AnimationWaterDroplets
ld a, $18
- ld [W_BASECOORDY], a ; wd082
+ ld [W_BASECOORDY], a
ld a, $20
ld [wd08a], a
- call Func_79246
+ call _AnimationWaterDroplets
dec d
jr nz, .asm_79228
ret
-Func_79246: ; 79246 (1e:5246)
+_AnimationWaterDroplets: ; 79246 (1e:5246)
ld hl, wOAMBuffer
.asm_79249
- ld a, [W_BASECOORDY] ; wd082
+ ld a, [W_BASECOORDY]
ld [hli], a
- ld a, [W_BASECOORDX] ; wd081
+ ld a, [W_BASECOORDX]
add $1b
- ld [W_BASECOORDX], a ; wd081
+ ld [W_BASECOORDX], a
ld [hli], a
ld a, [wd09f]
ld [hli], a
xor a
ld [hli], a
- ld a, [W_BASECOORDX] ; wd081
+ ld a, [W_BASECOORDX]
cp $90
jr c, .asm_79249
sub $a8
- ld [W_BASECOORDX], a ; wd081
- ld a, [W_BASECOORDY] ; wd082
+ ld [W_BASECOORDX], a
+ ld a, [W_BASECOORDY]
add $10
- ld [W_BASECOORDY], a ; wd082
+ ld [W_BASECOORDY], a
cp $70
jr c, .asm_79249
call AnimationCleanOAM
@@ -1304,7 +1301,7 @@
ld a, $ff
.asm_79291
ld [wd09f], a
- jp Func_792bf
+ jp _AnimationSlideMonUp
AnimationSlideMonDown: ; 79297 (1e:5297)
; Slides the mon's sprite down out of the screen.
@@ -1314,7 +1311,7 @@
call GetMonSpriteTileMapPointerFromRowCount
push bc
push de
- call Func_79aae
+ call CopyPicTiles
call Delay3
call AnimationHideMonPic
pop de
@@ -1327,15 +1324,15 @@
; Slides the mon's sprite out of the screen horizontally.
ld e, $8
ld a, $3
- ld [W_SUBANIMTRANSFORM], a ; W_SUBANIMTRANSFORM
- jp Func_795f8
+ ld [W_SUBANIMTRANSFORM], a
+ jp AnimationSlideMonLeft
AnimationSlideEnemyMonOut: ; 792b9 (1e:52b9)
; Slides the enemy mon out of the screen horizontally.
- ld hl, AnimationSlideMonOut ; $52af
+ ld hl, AnimationSlideMonOut
jp CallWithTurnFlipped
-Func_792bf: ; 792bf (1e:52bf)
+_AnimationSlideMonUp: ; 792bf (1e:52bf)
push de
push hl
push bc
@@ -1368,16 +1365,16 @@
add $7
dec c
jr nz, .asm_792eb
- ld c, $2
+ ld c, 2
call DelayFrames
pop bc
pop hl
pop de
dec c
- jr nz, Func_792bf
+ jr nz, _AnimationSlideMonUp
ret
-Func_792fd: ; 792fd (1e:52fd)
+_AnimationShakeEnemyHUD: ; 792fd (1e:52fd)
ld a, $10
ld [W_BASECOORDX], a
ld a, $30
@@ -1390,7 +1387,7 @@
ld e, a
ld b, $5
.asm_79314
- call Func_79329
+ call Animations_79329
inc d
dec b
jr nz, .asm_79314
@@ -1403,12 +1400,12 @@
ld [W_BASECOORDX], a
jr .asm_7930e
-Func_79329: ; 79329 (1e:5329)
+Animations_79329: ; 79329 (1e:5329)
ld a, e
add $8
ld e, a
ld [hli], a
- ld a, [W_BASECOORDX] ; wd081
+ ld a, [W_BASECOORDX]
ld [hli], a
ld a, d
ld [hli], a
@@ -1464,7 +1461,7 @@
AnimationBlinkEnemyMon: ; 79369 (1e:5369)
; Make the enemy mon's sprite blink on and off for a second or two
- ld hl, AnimationBlinkMon ; $536f
+ ld hl, AnimationBlinkMon
jp CallWithTurnFlipped
AnimationBlinkMon: ; 7936f (1e:536f)
@@ -1474,10 +1471,10 @@
.asm_79372
push bc
call AnimationHideMonPic
- ld c, $5
+ ld c, 5
call DelayFrames
call AnimationShowMonPic
- ld c, $5
+ ld c, 5
call DelayFrames
pop bc
dec c
@@ -1502,7 +1499,7 @@
xor a
call GetTileIDList
call GetMonSpriteTileMapPointerFromRowCount
- call Func_79aae
+ call CopyPicTiles
jp Delay3
AnimationShowEnemyMonPic: ; 793ab (1e:53ab)
@@ -1537,7 +1534,7 @@
push hl
call GetTileIDList
pop hl
- call Func_79aae
+ call CopyPicTiles
call Delay3
pop hl
ld bc, $0709
@@ -1545,7 +1542,7 @@
pop af
call GetTileIDList
pop hl
- call Func_79aae
+ call CopyPicTiles
call Delay3
pop hl
ld bc, $0709
@@ -1562,7 +1559,7 @@
; Shifts the mon's sprite horizontally to a fixed location. Used by lots of
; animations like Tackle/Body Slam.
call AnimationHideMonPic
- ld a, [H_WHOSETURN] ; $fff3
+ ld a, [H_WHOSETURN]
and a
hlCoord 2, 5
jr z, .asm_79407
@@ -1572,13 +1569,13 @@
push hl
call GetTileIDList
pop hl
- call Func_79aae
- ld c, $3
+ call CopyPicTiles
+ ld c, 3
jp DelayFrames
AnimationResetMonPosition: ; 79415 (1e:5415)
; Resets the mon's sprites to be located at the normal coordinates.
- ld a, [H_WHOSETURN] ; $fff3
+ ld a, [H_WHOSETURN]
and a
ld a, $66
jr z, .asm_7941e
@@ -1590,24 +1587,24 @@
AnimationSpiralBallsInward: ; 79424 (1e:5424)
; Creates an effect that looks like energy balls sprialing into the
; player mon's sprite. Used in Focus Energy, for example.
- ld a, [H_WHOSETURN] ; $fff3
+ ld a, [H_WHOSETURN]
and a
jr z, .asm_79435
ld a, $d8
ld [wd08a], a
ld a, $50
- ld [W_SUBANIMTRANSFORM], a ; W_SUBANIMTRANSFORM
+ ld [W_SUBANIMTRANSFORM], a
jr .asm_7943c
.asm_79435
xor a
ld [wd08a], a
- ld [W_SUBANIMTRANSFORM], a ; W_SUBANIMTRANSFORM
+ ld [W_SUBANIMTRANSFORM], a
.asm_7943c
ld d, $7a
ld c, $3
xor a
call Func_797e8
- ld hl, SpiralBallAnimationCoordinates ; $5476
+ ld hl, SpiralBallAnimationCoordinates
.asm_79447
push hl
ld c, $3
@@ -1621,7 +1618,7 @@
ld [de], a
inc de
inc hl
- ld a, [W_SUBANIMTRANSFORM] ; W_SUBANIMTRANSFORM
+ ld a, [W_SUBANIMTRANSFORM]
add [hl]
ld [de], a
inc hl
@@ -1630,7 +1627,7 @@
inc de
dec c
jr nz, .asm_7944d
- ld c, $5
+ ld c, 5
call DelayFrames
pop hl
inc hl
@@ -1674,7 +1671,7 @@
ld c, $4
.asm_794a3
push bc
- ld a, [H_WHOSETURN] ; $fff3
+ ld a, [H_WHOSETURN]
and a
jr z, .asm_794b1
hlCoord 16, 0
@@ -1687,11 +1684,11 @@
push de
xor a
ld [wd09f], a
- call Func_794d4
+ call _AnimationSquishMonPic
pop hl
ld a, $1
ld [wd09f], a
- call Func_794d4
+ call _AnimationSquishMonPic
pop bc
dec c
jr nz, .asm_794a3
@@ -1699,7 +1696,7 @@
ld c, $2
jp DelayFrame
-Func_794d4: ; 794d4 (1e:54d4)
+_AnimationSquishMonPic: ; 794d4 (1e:54d4)
ld c, $7
.asm_794d6
push bc
@@ -1727,7 +1724,7 @@
AnimationShootBallsUpward: ; 794f9 (1e:54f9)
; Shoots one pillar of "energy" balls upwards. Used in Teleport/Sky Attack
; animations.
- ld a, [H_WHOSETURN] ; $fff3
+ ld a, [H_WHOSETURN]
and a
jr z, .asm_79503
ld bc, $80
@@ -1736,14 +1733,14 @@
ld bc, $3028
.asm_79506
ld a, b
- ld [W_BASECOORDY], a ; wd082
+ ld [W_BASECOORDY], a
ld a, c
- ld [W_BASECOORDX], a ; wd081
+ ld [W_BASECOORDX], a
ld bc, $501
- call Func_79517
+ call _AnimationShootBallsUpward
jp AnimationCleanOAM
-Func_79517: ; 79517 (1e:5517)
+_AnimationShootBallsUpward: ; 79517 (1e:5517)
push bc
xor a
ld [wd09f], a
@@ -1752,10 +1749,10 @@
ld d, $7a
ld hl, wOAMBuffer
push bc
- ld a, [W_BASECOORDY] ; wd082
+ ld a, [W_BASECOORDY]
ld e, a
.asm_7952a
- call Func_79329
+ call Animations_79329
dec b
jr nz, .asm_7952a
call DelayFrame
@@ -1766,7 +1763,7 @@
push bc
ld hl, wOAMBuffer
.asm_7953c
- ld a, [W_BASECOORDY] ; wd082
+ ld a, [W_BASECOORDY]
add $8
ld e, a
ld a, [hl]
@@ -1812,7 +1809,7 @@
ld [W_BASECOORDX], a
ld bc, $0401
push hl
- call Func_79517
+ call _AnimationShootBallsUpward
pop hl
jr .loop
@@ -1839,7 +1836,7 @@
pop hl
ld de, $194
add hl, de
- ld de, MinimizedMonSprite ; $55c4
+ ld de, MinimizedMonSprite
ld c, $5
.asm_795b4
ld a, [de]
@@ -1867,8 +1864,8 @@
push af
call GetTileIDList
call GetMonSpriteTileMapPointerFromRowCount
- call Func_79aae
- ld c, $8
+ call CopyPicTiles
+ ld c, 8
call DelayFrames
pop af
inc a
@@ -1882,8 +1879,8 @@
call FillMemory
jp Func_79652
-Func_795f8: ; 795f8 (1e:55f8)
- ld a, [H_WHOSETURN] ; $fff3
+AnimationSlideMonLeft: ; 795f8 (1e:55f8)
+ ld a, [H_WHOSETURN]
and a
jr z, .asm_79602
hlCoord 12, 0
@@ -1898,7 +1895,7 @@
.asm_7960a
ld c, $8
.asm_7960c
- ld a, [H_WHOSETURN] ; $fff3
+ ld a, [H_WHOSETURN]
and a
jr z, .asm_79616
call Func_7963c
@@ -1915,7 +1912,7 @@
pop de
dec b
jr nz, .asm_7960a
- ld a, [W_SUBANIMTRANSFORM] ; W_SUBANIMTRANSFORM
+ ld a, [W_SUBANIMTRANSFORM]
ld c, a
call DelayFrames
pop hl
@@ -1945,11 +1942,11 @@
ld e, $4
ld a, $4
ld [W_SUBANIMTRANSFORM], a
- call Func_795f8
+ call AnimationSlideMonLeft
jp Delay3
Func_79652: ; 79652 (1e:5652)
- ld a, [H_WHOSETURN] ; $fff3
+ ld a, [H_WHOSETURN]
and a
ld hl, vBackPic
jr z, .asm_7965d
@@ -2028,7 +2025,7 @@
call FillMemory
ld a, [$fff3]
and a
- jr z, .asm_79715 ; 0x796ed $26
+ jr z, .asm_79715
ld hl, SlowbroSprite ; facing down sprite
ld de, wTempPic + $120
call CopySlowbroSpriteData
@@ -2065,13 +2062,13 @@
jp FarCopyData2
Func_79747: ; 79747 (1e:5747)
- ld a, [H_WHOSETURN] ; $fff3
+ ld a, [H_WHOSETURN]
and a
ld hl, wccf7
- ld a, [W_PLAYERBATTSTATUS2] ; W_PLAYERBATTSTATUS2
+ ld a, [W_PLAYERBATTSTATUS2]
jr z, .asm_79758
ld hl, wccf3
- ld a, [W_ENEMYBATTSTATUS2] ; W_ENEMYBATTSTATUS2
+ ld a, [W_ENEMYBATTSTATUS2]
.asm_79758
push hl
bit 4, a
@@ -2102,7 +2099,7 @@
call AnimationSlideMonDown
pop bc
dec c
- jr nz, .asm_7977c ; 0x79782 $f8
+ jr nz, .asm_7977c
jp AnimationShowMonPic
AnimationTransformMon: ; 79787 (1e:5787)
@@ -2114,7 +2111,7 @@
ld [wHPBarMaxHP], a
Func_79793: ; 79793 (1e:5793)
- ld a, [H_WHOSETURN] ; $fff3
+ ld a, [H_WHOSETURN]
and a
jr z, .asm_797b0
ld a, [wHPBarMaxHP]
@@ -2137,7 +2134,7 @@
xor a
call GetTileIDList
call GetMonSpriteTileMapPointerFromRowCount
- call Func_79aae
+ call CopyPicTiles
pop af
ld [wBattleMonSpecies2], a
.asm_797d3
@@ -2147,11 +2144,11 @@
AnimationHideEnemyMonPic: ; 797d8 (1e:57d8)
; Hides the enemy mon's sprite
xor a
- ld [H_AUTOBGTRANSFERENABLED], a ; $ffba
- ld hl, AnimationHideMonPic ; $5801
+ ld [H_AUTOBGTRANSFERENABLED], a
+ ld hl, AnimationHideMonPic
call CallWithTurnFlipped
ld a, $1
- ld [H_AUTOBGTRANSFERENABLED], a ; $ffba
+ ld [H_AUTOBGTRANSFERENABLED], a
jp Delay3
Func_797e8: ; 797e8 (1e:57e8)
@@ -2163,10 +2160,10 @@
pop bc
xor a
ld e, a
- ld [W_BASECOORDX], a ; wd081
+ ld [W_BASECOORDX], a
ld hl, wOAMBuffer
.asm_797fa
- call Func_79329
+ call Animations_79329
dec c
jr nz, .asm_797fa
ret
@@ -2173,7 +2170,7 @@
AnimationHideMonPic: ; 79801 (1e:5801)
; Hides the mon's sprite.
- ld a, [H_WHOSETURN] ; $fff3
+ ld a, [H_WHOSETURN]
and a
jr z, .asm_7980a
ld a, $c
@@ -2269,13 +2266,15 @@
jr nz, Func_79862
ret
-Func_79869: ; 79869 (1e:5869)
+; get the sound of the move id in b
+GetMoveSoundB: ; 79869 (1e:5869)
ld a, b
- call Func_7986f
+ call GetMoveSound
ld b, a
ret
-Func_7986f: ; 7986f (1e:586f)
+; get the sound of the move id in a
+GetMoveSound: ; 7986f (1e:586f)
ld hl,MoveSoundTable
ld e,a
ld d,0
@@ -2496,7 +2495,7 @@
db (SFX_08_4b - SFX_Headers_08) / 3,$00,$80
db (SFX_08_4b - SFX_Headers_08) / 3,$00,$80
-Func_79aae: ; 79aae (1e:5aae)
+CopyPicTiles: ; 79aae (1e:5aae)
ld a, [H_WHOSETURN]
and a
ld a, $31 ; base tile ID of player mon sprite
@@ -2507,15 +2506,17 @@
ld [hBaseTileID], a
jr asm_79acb
-Func_79aba: ; 79aba (1e:5aba)
+; copy the tiles used when a mon is being sent out
+; and "growing" out of the pokeball
+CopyGrowingMonTiles: ; 79aba (1e:5aba)
call GetPredefRegisters
ld a, [wcd6c]
and a
jr nz, .asm_79ac8
- ld de, Unknown_79b02 ; $5b02
+ ld de, Unknown_79b02 ; 5x5
jr asm_79acb
.asm_79ac8
- ld de, Unknown_79b1b ; $5b1b
+ ld de, Unknown_79b1b ; 3x3
asm_79acb: ; 79acb (1e:5acb)
xor a
ld [H_AUTOBGTRANSFERENABLED], a
@@ -2811,7 +2812,7 @@
call Func_79e0d
ld a, $38
ld [hWY], a
- call Func_792fd
+ call _AnimationShakeEnemyHUD
ld hl, vBGMap0
call Func_79e0d
call AnimationHideMonPic
@@ -2854,12 +2855,12 @@
ld a, [wTrainerSpriteOffset]
add d
ld [hSCX], a
- ld c, $2
+ ld c, 2
call DelayFrames
ld a, [wTrainerSpriteOffset]
sub d
ld [hSCX], a
- ld c, $2
+ ld c, 2
call DelayFrames
dec e
jr nz, .asm_79dee
@@ -2926,7 +2927,7 @@
ld [W_ANIMATIONID],a
call PlayAnimation
ld a,(SFX_08_43 - SFX_Headers_08) / 3
- call PlaySound ; play sound effect
+ call PlaySound
ld a,BLOCKBALL_ANIM
ld [W_ANIMATIONID],a
jp PlayAnimation
--- a/engine/battle/bank_e_misc.asm
+++ b/engine/battle/bank_e_misc.asm
@@ -52,40 +52,40 @@
ret
; XXX this is called in a few places, but it doesn't appear to do anything useful
-Func_39bd5: ; 39bd5 (e:5bd5)
+InitList: ; 39bd5 (e:5bd5)
ld a, [wd11b]
cp $1
- jr nz, .asm_39be6
+ jr nz, .notEnemy
ld hl, wEnemyPartyCount
ld de, wEnemyMonOT
ld a, ENEMYOT_NAME
- jr .asm_39c18
-.asm_39be6
+ jr .done
+.notEnemy
cp $4
- jr nz, .calcAttackStat4
+ jr nz, .notPlayer
ld hl, wPartyCount
ld de, wPartyMonOT
ld a, PLAYEROT_NAME
- jr .asm_39c18
-.calcAttackStat4
+ jr .done
+.notPlayer
cp $5
- jr nz, .asm_39c02
+ jr nz, .notMonster
ld hl, wStringBuffer2 + 11
ld de, MonsterNames
ld a, MONSTER_NAME
- jr .asm_39c18
-.asm_39c02
+ jr .done
+.notMonster
cp $2
- jr nz, .asm_39c10
+ jr nz, .notBag
ld hl, wNumBagItems
ld de, ItemNames
ld a, ITEM_NAME
- jr .asm_39c18
-.asm_39c10
+ jr .done
+.notBag
ld hl, wStringBuffer2 + 11
ld de, ItemNames
ld a, ITEM_NAME
-.asm_39c18
+.done
ld [wNameListType], a
ld a, l
ld [wList], a
--- a/engine/battle/battle_transitions.asm
+++ b/engine/battle/battle_transitions.asm
@@ -352,7 +352,7 @@
cp $1
jr z, .done
ld [rBGP], a
- ld c, $2
+ ld c, 2
call DelayFrames
jr .loop
.done
@@ -389,13 +389,13 @@
call BattleTransition_CopyTiles2
ld a, $1
ld [H_AUTOBGTRANSFERENABLED], a
- ld c, $6
+ ld c, 6
call DelayFrames
pop bc
dec c
jr nz, .loop
call BattleTransition_BlackScreen
- ld c, $a
+ ld c, 10
jp DelayFrames
; used for high level trainer dungeon battles
@@ -427,7 +427,7 @@
dec c
jr nz, .loop
call BattleTransition_BlackScreen
- ld c, $a
+ ld c, 10
jp DelayFrames
BattleTransition_CopyTiles1: ; 70c12 (1c:4c12)
--- a/engine/battle/common_text.asm
+++ b/engine/battle/common_text.asm
@@ -1,8 +1,8 @@
PrintBeginningBattleText: ; 58d99 (16:4d99)
- ld a, [W_ISINBATTLE] ; W_ISINBATTLE
+ ld a, [W_ISINBATTLE]
dec a
jr nz, .trainerBattle
- ld a, [W_CURMAP] ; W_CURMAP
+ ld a, [W_CURMAP]
cp POKEMONTOWER_3
jr c, .notPokemonTower
cp LAVENDER_HOUSE_1
@@ -11,7 +11,7 @@
ld a, [wEnemyMonSpecies2]
call PlayCry
ld hl, WildMonAppearedText
- ld a, [W_MOVEMISSED] ; W_MOVEMISSED
+ ld a, [W_MOVEMISSED]
and a
jr z, .notFishing
ld hl, HookedMonAttackedText
@@ -19,7 +19,7 @@
jr .wildBattle
.trainerBattle
call .playSFX
- ld c, $14
+ ld c, 20
call DelayFrames
ld hl, TrainerWantsToFightText
.wildBattle
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -177,7 +177,7 @@
ld a, $31
ld [$ffe1], a
hlCoord 1, 5
- predef Func_3f0c6
+ predef CopyUncompressedPicToTilemap
xor a
ld [hWY], a
ld [rWY], a
@@ -620,7 +620,7 @@
or [hl]
ret nz ; test if fainted
call DrawHUDsAndHPBars
- ld c, $14
+ ld c, 20
call DelayFrames
xor a
ret
@@ -823,7 +823,7 @@
ld [wcd6a], a
jp MainInBattleLoop
-FaintEnemyPokemon ; 0x3c567
+FaintEnemyPokemon: ; 0x3c567
call ReadPlayerMonCurHPAndStatus
ld a, [W_ISINBATTLE]
dec a
@@ -1020,7 +1020,7 @@
cp LINK_STATE_BATTLING
ret z
call ScrollTrainerPicAfterBattle
- ld c, $28
+ ld c, 40
call DelayFrames
call PrintEndBattleText
; win money
@@ -1218,7 +1218,7 @@
ld bc, $815
call ClearScreenArea
call ScrollTrainerPicAfterBattle
- ld c, $28
+ ld c, 40
call DelayFrames
ld hl, Sony1WinText
call PrintText
@@ -1506,7 +1506,7 @@
ld a,$CF
ld [$FFE1],a
hlCoord 15, 6
- predef Func_3f073
+ predef AnimateSendingOutMon
ld a,[wEnemyMonSpecies2]
call PlayCry
call DrawEnemyHUDAndHPBar
@@ -1836,7 +1836,7 @@
ld a, POOF_ANIM
call PlayMoveAnimation
hlCoord 4, 11
- predef Func_3f073
+ predef AnimateSendingOutMon
ld a, [wcf91]
call PlayCry
call PrintEmptyString
@@ -1852,8 +1852,8 @@
xor a
ld [wcd6c], a
ld [H_DOWNARROWBLINKCNT1], a
- predef Func_79aba
- ld c, $4
+ predef CopyGrowingMonTiles
+ ld c, 4
call DelayFrames
call .clearScreenArea
hlCoord 4, 9
@@ -1862,7 +1862,7 @@
ld [wcd6c], a
xor a
ld [H_DOWNARROWBLINKCNT1], a
- predef Func_79aba
+ predef CopyGrowingMonTiles
call Delay3
call .clearScreenArea
ld a, $4c
@@ -2110,12 +2110,12 @@
; the following simulates the keystrokes by drawing menus on screen
hlCoord 9, 14
ld [hl], "▶"
- ld c, $50
+ ld c, 80
call DelayFrames
ld [hl], $7f
hlCoord 9, 16
ld [hl], "▶"
- ld c, $32
+ ld c, 50
call DelayFrames
ld [hl], $ec
ld a, $2 ; select the "ITEM" menu
@@ -2490,7 +2490,7 @@
SwitchPlayerMon: ; 3d1ba (f:51ba)
callab RetreatMon
- ld c, $32
+ ld c, 50
call DelayFrames
call AnimateRetreatingPlayerMon
ld a, [wWhichPokemon]
@@ -2815,7 +2815,7 @@
.asm_3d423
ld hl, NoMovesLeftText
call PrintText
- ld c, $3c
+ ld c, 60
call DelayFrames
xor a
ret
@@ -3232,7 +3232,7 @@
call nz,Bankswitch
jr MirrorMoveCheck
playerCheckIfFlyOrChargeEffect
- ld c,$1E
+ ld c,30
call DelayFrames
ld a,[W_PLAYERMOVEEFFECT]
cp a,FLY_EFFECT
@@ -3869,7 +3869,7 @@
; if the move being used is in set [1-4] from ExclamationPointMoveSets,
; use ExclamationPoint[1-4]Text
; otherwise, use ExclamationPoint5Text
-; but all five text strings are identical
+; but all five text strings are identical
; this likely had to do with Japanese grammar that got translated,
; but the functionality didn't get removed
DetermineExclamationPointTextNum: ; 3db85 (f:5b85)
@@ -4004,7 +4004,7 @@
xor a
ld [wCriticalHitOrOHKO], a
.done
- ld c, $14
+ ld c, 20
jp DelayFrames
CriticalOHKOTextPointers: ; 3dc7a (f:5c7a)
@@ -4691,7 +4691,7 @@
jr z, .calcCriticalHitProbability
ld hl, W_ENEMYMOVEPOWER
ld de, W_ENEMYBATTSTATUS2
-.calcCriticalHitProbability ; 0x3e04f
+.calcCriticalHitProbability
ld a, [hld] ; read base power from RAM
and a
ret z ; do nothing if zero
@@ -5579,7 +5579,7 @@
; the second iteration multiplies by the evasion ratio
.loop
push bc
- ld hl, StatModifierRatios ; $76cb ; stat modifier ratios
+ ld hl, StatModifierRatios ; stat modifier ratios
dec b
sla b
ld c,b
@@ -5785,7 +5785,7 @@
EnemyCheckIfFlyOrChargeEffect: ; 3e7d1 (f:67d1)
call SwapPlayerAndEnemyLevels
- ld c, $1e
+ ld c, 30
call DelayFrames
ld a, [W_ENEMYMOVEEFFECT]
cp FLY_EFFECT
@@ -6456,7 +6456,7 @@
ld a, $31
ld [$ffe1], a
hlCoord 1, 5
- predef_jump Func_3f0c6
+ predef_jump CopyUncompressedPicToTilemap
; does nothing since no stats are ever selected (barring glitches)
DoubleOrHalveSelectedStats: ; 3ed02 (f:6d02)
@@ -6796,11 +6796,11 @@
HandleExplodingAnimation: ; 3eed3 (f:6ed3)
ld a, [H_WHOSETURN]
and a
- ld hl, wEnemyMonType1 ; wcfea
+ ld hl, wEnemyMonType1
ld de, W_ENEMYBATTSTATUS1
ld a, [W_PLAYERMOVENUM]
jr z, .asm_3eeea
- ld hl, wBattleMonType1 ; wd019
+ ld hl, wBattleMonType1
ld de, W_ENEMYBATTSTATUS1
ld a, [W_ENEMYMOVENUM]
.asm_3eeea
@@ -6832,14 +6832,15 @@
InitBattle: ; 3ef12 (f:6f12)
ld a, [W_CUROPPONENT]
and a
- jr z, asm_3ef23
+ jr z, DetermineWildOpponent
InitOpponent: ; 3ef18 (f:6f18)
ld a, [W_CUROPPONENT]
ld [wcf91], a
ld [wEnemyMonSpecies2], a
- jr asm_3ef3d
-asm_3ef23: ; 3ef23 (f:6f23)
+ jr InitBattleCommon
+
+DetermineWildOpponent: ; 3ef23 (f:6f23)
ld a, [wd732]
bit 1, a
jr z, .asm_3ef2f
@@ -6852,7 +6853,7 @@
ret nz
callab TryDoWildEncounter
ret nz
-asm_3ef3d: ; 3ef3d (f:6f3d)
+InitBattleCommon: ; 3ef3d (f:6f3d)
ld a, [wMapPalOffset]
push af
ld hl, wd358
@@ -6874,7 +6875,7 @@
dec a
ld [wAICount], a
hlCoord 12, 0
- predef Func_3f0c6
+ predef CopyUncompressedPicToTilemap
ld a, $ff
ld [wEnemyMonPartyPos], a
ld a, $2
@@ -6928,7 +6929,7 @@
ld [W_TRAINERCLASS], a
ld [$ffe1], a
hlCoord 12, 0
- predef Func_3f0c6
+ predef CopyUncompressedPicToTilemap
; common code that executes after init battle code specific to trainer or wild battles
InitBattle_Common: ; 3efeb (f:6feb)
@@ -6974,9 +6975,9 @@
_LoadTrainerPic: ; 3f04b (f:704b)
; wd033-wd034 contain pointer to pic
- ld a, [wTrainerPicPointer] ; wd033
+ ld a, [wTrainerPicPointer]
ld e, a
- ld a, [wTrainerPicPointer + 1] ; wd034
+ ld a, [wTrainerPicPointer + 1]
ld d, a ; de contains pointer to trainer pic
ld a, [wLinkState]
and a
@@ -6991,13 +6992,14 @@
jp LoadUncompressedSpriteData
; unreferenced
-Func_3f069: ; 3f069 (f:7069)
+ResetCryModifiers: ; 3f069 (f:7069)
xor a
ld [wc0f1], a
ld [wc0f2], a
jp PlaySound
-Func_3f073: ; 3f073 (f:7073)
+; animtes the mon "growing" out of the pokeball
+AnimateSendingOutMon: ; 3f073 (f:7073)
ld a, [wPredefRegisters]
ld h, a
ld a, [wPredefRegisters + 1]
@@ -7016,8 +7018,8 @@
ld a, $1
ld [wcd6c], a
ld bc, $303
- predef Func_79aba
- ld c, $4
+ predef CopyGrowingMonTiles
+ ld c, 4
call DelayFrames
ld bc, -41
add hl, bc
@@ -7024,8 +7026,8 @@
xor a
ld [wcd6c], a
ld bc, $505
- predef Func_79aba
- ld c, $5
+ predef CopyGrowingMonTiles
+ ld c, 5
call DelayFrames
ld bc, -41
jr .asm_3f0bf
@@ -7035,15 +7037,15 @@
add hl, bc
ld a, [H_DOWNARROWBLINKCNT1]
add $31
- jr asm_3f0d0
+ jr CopyUncompressedPicToHL
-Func_3f0c6: ; 3f0c6 (f:70c6)
+CopyUncompressedPicToTilemap: ; 3f0c6 (f:70c6)
ld a, [wPredefRegisters]
ld h, a
ld a, [wPredefRegisters + 1]
ld l, a
ld a, [$ffe1]
-asm_3f0d0: ; 3f0d0 (f:70d0)
+CopyUncompressedPicToHL: ; 3f0d0 (f:70d0)
ld bc, $707
ld de, $14
push af
@@ -7356,7 +7358,7 @@
cp POISON_EFFECT
ret nz
.didntAffect
- ld c, $32
+ ld c, 50
call DelayFrames
jp PrintDidntAffectText
@@ -7652,7 +7654,7 @@
UpdateStatDone: ; 3f4ca (f:74ca)
ld b, c
inc b
- call Func_3f688
+ call PrintStatText
ld hl, W_PLAYERBATTSTATUS2
ld de, W_PLAYERMOVENUM
ld bc, wccf7
@@ -7822,7 +7824,7 @@
jr nz, .recalculateStat
ld a, [hl]
and a
- jp z, Func_3f64d
+ jp z, CantLowerAnymore_Pop
.recalculateStat
; recalculate affected stat
; paralysis and burn penalties, as well as badge boosts are ignored
@@ -7870,7 +7872,7 @@
ld b, c
inc b
push de
- call Func_3f688
+ call PrintStatText
pop de
ld a, [de]
cp $44
@@ -7890,7 +7892,7 @@
call QuarterSpeedDueToParalysis
jp HalveAttackDueToBurn
-Func_3f64d: ; 3f64d (f:764d)
+CantLowerAnymore_Pop: ; 3f64d (f:764d)
pop de
pop hl
inc [hl]
@@ -7933,7 +7935,7 @@
TX_FAR _FellText
db "@"
-Func_3f688: ; 3f688 (f:7688)
+PrintStatText: ; 3f688 (f:7688)
ld hl, StatsTextStrings
ld c, $50
.asm_3f68d
@@ -8042,7 +8044,7 @@
srl b
cp b
jr nc, .asm_3f76e
- ld c, $32
+ ld c, 50
call DelayFrames
ld a, [W_PLAYERMOVENUM]
cp TELEPORT
@@ -8057,7 +8059,7 @@
ld a, [W_PLAYERMOVENUM]
jr .asm_3f7e4
.asm_3f77e
- ld c, $32
+ ld c, 50
call DelayFrames
ld hl, IsUnaffectedText
ld a, [W_PLAYERMOVENUM]
@@ -8084,7 +8086,7 @@
srl b
cp b
jr nc, .asm_3f7c1
- ld c, $32
+ ld c, 50
call DelayFrames
ld a, [W_ENEMYMOVENUM]
cp TELEPORT
@@ -8099,7 +8101,7 @@
ld a, [W_ENEMYMOVENUM]
jr .asm_3f7e4
.asm_3f7d1
- ld c, $32
+ ld c, 50
call DelayFrames
ld hl, IsUnaffectedText
ld a, [W_ENEMYMOVENUM]
@@ -8109,7 +8111,7 @@
.asm_3f7e4
push af
call PlayBattleAnimation
- ld c, $14
+ ld c, 20
call DelayFrames
pop af
ld hl, RanFromBattleText
@@ -8377,7 +8379,7 @@
ConfusionEffectFailed: ; 3f9a6 (f:79a6)
cp CONFUSION_SIDE_EFFECT
ret z
- ld c, $32
+ ld c, 50
call DelayFrames
jp ConditionalPrintButItFailed
@@ -8424,7 +8426,7 @@
ret
MimicEffect: ; 3f9ed (f:79ed)
- ld c, $32
+ ld c, 50
call DelayFrames
call MoveHitTest
ld a, [W_MOVEMISSED]
--- a/engine/battle/draw_hud_pokeball_gfx.asm
+++ b/engine/battle/draw_hud_pokeball_gfx.asm
@@ -1,7 +1,7 @@
DrawAllPokeballs: ; 3a849 (e:6849)
call LoadPartyPokeballGfx
call SetupOwnPartyPokeballs
- ld a, [W_ISINBATTLE] ; W_ISINBATTLE
+ ld a, [W_ISINBATTLE]
dec a
ret z ; return if wild pokémon
jp SetupEnemyPartyPokeballs
@@ -11,7 +11,7 @@
jp SetupEnemyPartyPokeballs
LoadPartyPokeballGfx: ; 3a85d (e:685d)
- ld de, PokeballTileGraphics ; $697e
+ ld de, PokeballTileGraphics
ld hl, vSprites + $310
ld bc, (BANK(PokeballTileGraphics) << 8) + $04
jp CopyVideoData
@@ -19,10 +19,10 @@
SetupOwnPartyPokeballs: ; 3a869 (e:6869)
call PlacePlayerHUDTiles
ld hl, wPartyMon1
- ld de, wPartyCount ; wPartyCount
+ ld de, wPartyCount
call SetupPokeballs
ld a, $60
- ld hl, W_BASECOORDX ; wd081
+ ld hl, W_BASECOORDX
ld [hli], a
ld [hl], a
ld a, $8
@@ -33,9 +33,9 @@
SetupEnemyPartyPokeballs: ; 3a887 (e:6887)
call PlaceEnemyHUDTiles
ld hl, wEnemyMons
- ld de, wEnemyPartyCount ; wEnemyPartyCount
+ ld de, wEnemyPartyCount
call SetupPokeballs
- ld hl, W_BASECOORDX ; wd081
+ ld hl, W_BASECOORDX
ld a, $48
ld [hli], a
ld [hl], $20
@@ -98,19 +98,19 @@
ld de, wBuffer
ld c, PARTY_LENGTH
.loop
- ld a, [W_BASECOORDY] ; wd082
+ ld a, [W_BASECOORDY]
ld [hli], a
- ld a, [W_BASECOORDX] ; wd081
+ ld a, [W_BASECOORDX]
ld [hli], a
ld a, [de]
ld [hli], a
xor a
ld [hli], a
- ld a, [W_BASECOORDX] ; wd081
+ ld a, [W_BASECOORDX]
ld b, a
ld a, [wTrainerEngageDistance]
add b
- ld [W_BASECOORDX], a ; wd081
+ ld [W_BASECOORDX], a
inc de
dec c
jr nz, .loop
@@ -117,12 +117,12 @@
ret
PlacePlayerHUDTiles: ; 3a902 (e:6902)
- ld hl, PlayerBattleHUDGraphicsTiles ; $6916
+ ld hl, PlayerBattleHUDGraphicsTiles
ld de, wTrainerFacingDirection
ld bc, $3
call CopyData
hlCoord 18, 10
- ld de, rIE ; $ffff
+ ld de, rIE
jr PlaceHUDTiles
PlayerBattleHUDGraphicsTiles: ; 3a916 (e:6916)
@@ -132,7 +132,7 @@
db $6F ; lower-left triangle tile of the HUD
PlaceEnemyHUDTiles: ; 3a919 (e:6919)
- ld hl, EnemyBattleHUDGraphicsTiles ; $692d
+ ld hl, EnemyBattleHUDGraphicsTiles
ld de, wTrainerFacingDirection
ld bc, $3
call CopyData
@@ -165,10 +165,10 @@
SetupPlayerAndEnemyPokeballs: ; 3a948 (e:6948)
call LoadPartyPokeballGfx
- ld hl, wPartyMon1Species ; wPartyMon1Species (aliases: wPartyMon1)
- ld de, wPartyCount ; wPartyCount
+ ld hl, wPartyMons
+ ld de, wPartyCount
call SetupPokeballs
- ld hl, W_BASECOORDX ; wd081
+ ld hl, W_BASECOORDX
ld a, $50
ld [hli], a
ld [hl], $40
@@ -176,10 +176,10 @@
ld [wTrainerEngageDistance], a
ld hl, wOAMBuffer
call WritePokeballOAMData
- ld hl, wEnemyMons ; wEnemyMon1Species
- ld de, wEnemyPartyCount ; wEnemyPartyCount
+ ld hl, wEnemyMons
+ ld de, wEnemyPartyCount
call SetupPokeballs
- ld hl, W_BASECOORDX ; wd081
+ ld hl, W_BASECOORDX
ld a, $50
ld [hli], a
ld [hl], $68
--- a/engine/battle/end_of_battle.asm
+++ b/engine/battle/end_of_battle.asm
@@ -21,7 +21,7 @@
.placeWinOrLoseString
hlCoord 6, 8
call PlaceString
- ld c, $c8
+ ld c, 200
call DelayFrames
jr .evolution
.notLinkBattle
--- a/engine/battle/moveEffects/focus_energy_effect.asm
+++ b/engine/battle/moveEffects/focus_energy_effect.asm
@@ -12,7 +12,7 @@
ld hl, GettingPumpedText
jp PrintText
.alreadyUsing
- ld c, $32
+ ld c, 50
call DelayFrames
ld hl, PrintButItFailedText_
ld b, BANK(PrintButItFailedText_)
--- a/engine/battle/moveEffects/leech_seed_effect.asm
+++ b/engine/battle/moveEffects/leech_seed_effect.asm
@@ -23,12 +23,12 @@
jr nz, .moveMissed
set Seeded, [hl]
callab PlayCurrentMoveAnimation
- ld hl, WasSeededText ; $7ef2
+ ld hl, WasSeededText
jp PrintText
.moveMissed
- ld c, $32
+ ld c, 50
call DelayFrames
- ld hl, EvadedAttackText ; $7ef7
+ ld hl, EvadedAttackText
jp PrintText
WasSeededText: ; 2bef2 (a:7ef2)
--- a/engine/battle/moveEffects/reflect_light_screen_effect.asm
+++ b/engine/battle/moveEffects/reflect_light_screen_effect.asm
@@ -27,7 +27,7 @@
pop hl
jp PrintText
.moveFailed
- ld c, $32
+ ld c, 50
call DelayFrames
ld hl, PrintButItFailedText_
jp BankswitchEtoF
--- a/engine/battle/scale_sprites.asm
+++ b/engine/battle/scale_sprites.asm
@@ -41,16 +41,16 @@
ScaleLastSpriteColumnByTwo: ; 2fe7d (b:7e7d)
ld a, 4*8 - 4 ; $1c, 4 tiles minus 4 unused rows
- ld [H_SPRITEINTERLACECOUNTER], a ; $ff8b
- ld bc, -1 ; $ffff
+ ld [H_SPRITEINTERLACECOUNTER], a
+ ld bc, -1
.columnInnerLoop
ld a, [de]
dec de
swap a ; only high nybble contains information
call ScalePixelsByTwo
- ld a, [H_SPRITEINTERLACECOUNTER] ; $ff8b
+ ld a, [H_SPRITEINTERLACECOUNTER]
dec a
- ld [H_SPRITEINTERLACECOUNTER], a ; $ff8b
+ ld [H_SPRITEINTERLACECOUNTER], a
jr nz, .columnInnerLoop
dec de ; skip last 4 rows of new column
dec de
--- a/engine/battle/trainer_ai.asm
+++ b/engine/battle/trainer_ai.asm
@@ -40,7 +40,7 @@
and a
jr z, .loopFindMinimumEntries
push hl
- ld hl, AIMoveChoiceModificationFunctionPointers ; $57a3
+ ld hl, AIMoveChoiceModificationFunctionPointers
dec a
add a
ld c, a
@@ -81,7 +81,7 @@
.filterMinimalEntries ; all minimal entries now have value 1. All other slots will be disabled (move set to 0)
ld a, [de]
and a
- jr nz, .moveExisting ; 0x3978a $1
+ jr nz, .moveExisting
ld [hl], a
.moveExisting
ld a, [hl]
@@ -145,7 +145,7 @@
ld [hl], a
jr .nextMove
-StatusAilmentMoveEffects ; 57e2
+StatusAilmentMoveEffects: ; 57e2
db $01 ; unused sleep effect
db SLEEP_EFFECT
db POISON_EFFECT
@@ -337,7 +337,6 @@
INCLUDE "data/trainer_parties.asm"
TrainerAI: ; 3a52e (e:652e)
-;XXX called at 34964, 3c342, 3c398
and a
ld a,[W_ISINBATTLE]
dec a
@@ -553,7 +552,7 @@
scf
ret
-Func_3a69b: ; 3a69b (e:669b)
+AIPlayRestoringSFX: ; 3a69b (e:669b)
ld a,(SFX_08_3e - SFX_Headers_08) / 3
jp PlaySoundWaitForCurrent
@@ -712,7 +711,7 @@
db "@"
AIUseFullHeal: ; 3a786 (e:6786)
- call Func_3a69b
+ call AIPlayRestoringSFX
call AICureStatus
ld a,FULL_HEAL
jp AIPrintItemUse
@@ -731,7 +730,7 @@
ret
AIUseXAccuracy: ; 0x3a7a8 unused
- call Func_3a69b
+ call AIPlayRestoringSFX
ld hl,W_ENEMYBATTSTATUS2
set 0,[hl]
ld a,X_ACCURACY
@@ -738,7 +737,7 @@
jp AIPrintItemUse
AIUseGuardSpec: ; 3a7b5 (e:67b5)
- call Func_3a69b
+ call AIPlayRestoringSFX
ld hl,W_ENEMYBATTSTATUS2
set 1,[hl]
ld a,GUARD_SPEC_
@@ -745,7 +744,7 @@
jp AIPrintItemUse
AIUseDireHit: ; 0x3a7c2 unused
- call Func_3a69b
+ call AIPlayRestoringSFX
ld hl,W_ENEMYBATTSTATUS2
set 2,[hl]
ld a,DIRE_HIT
--- a/engine/cable_club.asm
+++ b/engine/cable_club.asm
@@ -2,7 +2,7 @@
; In the Colosseum, it starts a battle. In the Trade Centre, it displays the trade selection screen.
; Before doing either action, it swaps random numbers, trainer names and party data with the other gameboy.
CableClub_DoBattleOrTrade: ; 5317 (1:5317)
- ld c, $50
+ ld c, 80
call DelayFrames
call ClearScreen
call UpdateSprites
@@ -359,7 +359,7 @@
.displayEnemyMonStats
ld a, $1
ld [wd11b], a
- callab Func_39bd5
+ callab InitList
ld hl, wEnemyMons
call TradeCenter_DisplayStats
jp .getNewInput
@@ -418,7 +418,7 @@
; unreachable code
ld a, $4
ld [wd11b], a
- callab Func_39bd5
+ callab InitList
call TradeCenter_DisplayStats
jp .getNewInput
.playerMonMenu_ANotPressed
@@ -513,7 +513,7 @@
ld [wCurrentMenuItem], a
ld a, $4
ld [wd11b], a
- callab Func_39bd5
+ callab InitList
call TradeCenter_DisplayStats
call LoadScreenTilesFromBuffer1
jp .playerMonMenu
--- a/engine/evolution.asm
+++ b/engine/evolution.asm
@@ -1,4 +1,4 @@
-Func_7bde9: ; 7bde9 (1e:7de9)
+EvolveMon: ; 7bde9 (1e:7de9)
push hl
push de
push bc
@@ -13,17 +13,17 @@
ld [wc0ee], a
call PlaySound
ld a, $1
- ld [H_AUTOBGTRANSFERENABLED], a ; $ffba
+ ld [H_AUTOBGTRANSFERENABLED], a
ld a, (SFX_08_3c - SFX_Headers_08) / 3
call PlaySound
call Delay3
xor a
- ld [H_AUTOBGTRANSFERENABLED], a ; $ffba
+ ld [H_AUTOBGTRANSFERENABLED], a
ld [hTilesetType], a
ld a, [wHPBarMaxHP]
ld [wcf1d], a
ld c, $0
- call Func_7beb4
+ call EvolutionSetWholeScreenPalette
ld a, [wHPBarMaxHP + 1]
ld [wcf91], a
ld [wd0b5], a
@@ -37,7 +37,7 @@
ld [wd0b5], a
call Func_7beb9
ld a, $1
- ld [H_AUTOBGTRANSFERENABLED], a ; $ffba
+ ld [H_AUTOBGTRANSFERENABLED], a
ld a, [wHPBarMaxHP]
call PlayCry
call WaitForSoundToFinish
@@ -44,16 +44,16 @@
ld c, BANK(Music_SafariZone)
ld a, MUSIC_SAFARI_ZONE
call PlayMusic
- ld c, $50
+ ld c, 80
call DelayFrames
ld c, $1
- call Func_7beb4
+ call EvolutionSetWholeScreenPalette
ld bc, $110
.asm_7be63
push bc
- call asm_7befa
+ call Func_7befa
jr c, .asm_7bea9
- call asm_7bec2
+ call Func_7bec2
pop bc
inc b
dec c
@@ -73,7 +73,7 @@
ld a, [wcf1d]
call PlayCry
ld c, $0
- call Func_7beb4
+ call EvolutionSetWholeScreenPalette
pop af
ld [wd0b5], a
pop af
@@ -93,7 +93,7 @@
ld a, [wHPBarMaxHP]
jr .asm_7be81
-Func_7beb4: ; 7beb4 (1e:7eb4)
+EvolutionSetWholeScreenPalette: ; 7beb4 (1e:7eb4)
ld b, $b
jp GoPAL_SET
@@ -101,7 +101,8 @@
call GetMonHeader
hlCoord 7, 2
jp LoadFlippedFrontSpriteByMonIndex
-asm_7bec2: ; 7bec2 (1e:7ec2)
+
+Func_7bec2: ; 7bec2 (1e:7ec2)
ld a, $31
ld [wHPBarOldHP], a
call Func_7bed6
@@ -109,13 +110,13 @@
ld [wHPBarOldHP], a
call Func_7bed6
dec b
- jr nz, asm_7bec2
+ jr nz, Func_7bec2
ret
Func_7bed6: ; 7bed6 (1e:7ed6)
push bc
xor a
- ld [H_AUTOBGTRANSFERENABLED], a ; $ffba
+ ld [H_AUTOBGTRANSFERENABLED], a
hlCoord 7, 2
ld bc, $707
ld de, $d
@@ -132,11 +133,12 @@
dec b
jr nz, .asm_7bee3
ld a, $1
- ld [H_AUTOBGTRANSFERENABLED], a ; $ffba
+ ld [H_AUTOBGTRANSFERENABLED], a
call Delay3
pop bc
ret
-asm_7befa: ; 7befa (1e:7efa)
+
+Func_7befa: ; 7befa (1e:7efa)
call DelayFrame
push bc
call JoypadLowSensitivity
@@ -146,7 +148,7 @@
jr nz, .asm_7bf0d
.asm_7bf08
dec c
- jr nz, asm_7befa
+ jr nz, Func_7befa
and a
ret
.asm_7bf0d
--- a/engine/evolve_trade.asm
+++ b/engine/evolve_trade.asm
@@ -31,9 +31,9 @@
ret nz
.ok
- ld a, [wPartyCount] ; wPartyCount
+ ld a, [wPartyCount]
dec a
- ld [wWhichPokemon], a ; wWhichPokemon
+ ld [wWhichPokemon], a
ld a, $1
ld [wccd4], a
ld a, LINK_STATE_TRADING
--- a/engine/evos_moves.asm
+++ b/engine/evos_moves.asm
@@ -117,7 +117,7 @@
call CopyStringToCF4B
ld hl, IsEvolvingText
call PrintText
- ld c, $32
+ ld c, 50
call DelayFrames
xor a
ld [H_AUTOBGTRANSFERENABLED], a
@@ -129,7 +129,7 @@
ld a, $ff
ld [wUpdateSpritesEnabled], a
call ClearSprites
- callab Func_7bde9
+ callab EvolveMon
jp c, CancelledEvolution
ld hl, EvolvedText
call PrintText
@@ -149,7 +149,7 @@
ld a, (SFX_02_3b - SFX_Headers_02) / 3
call PlaySoundWaitForCurrent
call WaitForSoundToFinish
- ld c, $28
+ ld c, 40
call DelayFrames
call ClearScreen
call RenameEvolvedMon
@@ -407,13 +407,13 @@
and a
jp z, .done ; end of list
ld b, a
- ld a, [W_CURENEMYLVL] ; W_CURENEMYLVL
+ ld a, [W_CURENEMYLVL]
cp b
jp c, .done ; mon level < move level (assumption: learnset is sorted by level)
ld a, [wHPBarMaxHP]
and a
jr z, .skipMinLevelCheck
- ld a, [wWhichTrade] ; wWhichTrade (min move level)
+ ld a, [wWhichTrade] ; min move level)
cp b
jr nc, .nextMove2 ; min level >= move level
.skipMinLevelCheck
--- a/engine/experience.asm
+++ b/engine/experience.asm
@@ -38,19 +38,19 @@
add hl, bc
call CalcDSquared
ld a, d
- ld [H_MULTIPLIER], a ; $ff99
+ ld [H_MULTIPLIER], a
call Multiply
ld a, [hl]
and $f0
swap a
- ld [H_MULTIPLIER], a ; $ff99
+ ld [H_MULTIPLIER], a
call Multiply
ld a, [hli]
and $f
- ld [H_DIVISOR], a ; $ff99
+ ld [H_DIVISOR], a
ld b, $4
call Divide
- ld a, [H_MULTIPLICAND] ; $ff96 (aliases: H_NUMTOPRINT)
+ ld a, [H_MULTIPLICAND] ; (aliases: H_NUMTOPRINT)
push af
ld a, [H_MULTIPLICAND+1]
push af
@@ -59,9 +59,9 @@
call CalcDSquared
ld a, [hl]
and $7f
- ld [H_MULTIPLIER], a ; $ff99
+ ld [H_MULTIPLIER], a
call Multiply
- ld a, [H_MULTIPLICAND] ; $ff96 (aliases: H_NUMTOPRINT)
+ ld a, [H_MULTIPLICAND] ; (aliases: H_NUMTOPRINT)
push af
ld a, [H_MULTIPLICAND+1]
push af
@@ -70,7 +70,7 @@
ld a, [hli]
push af
xor a
- ld [H_MULTIPLICAND], a ; $ff96
+ ld [H_MULTIPLICAND], a
ld [H_MULTIPLICAND+1], a
ld a, d
ld [H_MULTIPLICAND+2], a
@@ -85,9 +85,9 @@
ld a, [H_MULTIPLICAND+1]
sbc b
ld [H_MULTIPLICAND+1], a
- ld a, [H_MULTIPLICAND] ; $ff96
+ ld a, [H_MULTIPLICAND]
sbc b
- ld [H_MULTIPLICAND], a ; $ff96
+ ld [H_MULTIPLICAND], a
pop af
and $80
jr nz, .subtractSquaredTerm ; check sign
@@ -135,11 +135,11 @@
; calculates d*d
CalcDSquared: ; 59010 (16:5010)
xor a
- ld [H_MULTIPLICAND], a ; $ff96 (aliases: H_NUMTOPRINT)
+ ld [H_MULTIPLICAND], a ; (aliases: H_NUMTOPRINT)
ld [H_MULTIPLICAND+1], a
ld a, d
ld [H_MULTIPLICAND+2], a
- ld [H_MULTIPLIER], a ; $ff99 (aliases: H_DIVISOR, H_REMAINDER, H_POWEROFTEN)
+ ld [H_MULTIPLIER], a ; (aliases: H_DIVISOR, H_REMAINDER, H_POWEROFTEN)
jp Multiply
; each entry has the following scheme:
--- a/engine/gamefreak.asm
+++ b/engine/gamefreak.asm
@@ -1,25 +1,25 @@
LoadShootingStarGraphics: ; 70000 (1c:4000)
ld a, $f9
- ld [rOBP0], a ; $ff48
+ ld [rOBP0], a
ld a, $a4
- ld [rOBP1], a ; $ff49
- ld de, AnimationTileset2 + $30 ; $471e ; star tile (top left quadrant)
+ ld [rOBP1], a
+ ld de, AnimationTileset2 + $30 ; star tile (top left quadrant)
ld hl, vChars1 + $200
ld bc, (BANK(AnimationTileset2) << 8) + $01
call CopyVideoData
- ld de, AnimationTileset2 + $130 ; $481e ; star tile (bottom left quadrant)
+ ld de, AnimationTileset2 + $130 ; star tile (bottom left quadrant)
ld hl, vChars1 + $210
ld bc, (BANK(AnimationTileset2) << 8) + $01
call CopyVideoData
- ld de, FallingStar ; $4190
+ ld de, FallingStar
ld hl, vChars1 + $220
ld bc, (BANK(FallingStar) << 8) + $01
call CopyVideoData
- ld hl, GameFreakLogoOAMData ; $4140
+ ld hl, GameFreakLogoOAMData
ld de, wOAMBuffer + $60
ld bc, $40
call CopyData
- ld hl, GameFreakShootingStarOAMData ; $4180
+ ld hl, GameFreakShootingStarOAMData
ld de, wOAMBuffer
ld bc, $10
jp CopyData
@@ -66,7 +66,7 @@
jr nz, .asm_7007b
ld b, $3
.asm_70083
- ld hl, rOBP0 ; $ff48
+ ld hl, rOBP0
rrc [hl]
rrc [hl]
ld c, $a
@@ -78,7 +78,7 @@
ld a, $18
.asm_70098
push af
- ld hl, OAMData_700ee ; $40ee
+ ld hl, OAMData_700ee
ld bc, $4
call CopyData
pop af
@@ -85,8 +85,8 @@
dec a
jr nz, .asm_70098
xor a
- ld [wWhichTrade], a ; wWhichTrade
- ld hl, PointerTable_700f2 ; $40f2
+ ld [wWhichTrade], a
+ ld hl, PointerTable_700f2
ld c, $6
.asm_700af
ld a, [hli]
@@ -110,11 +110,11 @@
inc hl
dec c
jr nz, .asm_700ba
- ld a, [wWhichTrade] ; wWhichTrade
+ ld a, [wWhichTrade]
cp $18
jr z, .asm_700d5
add $6
- ld [wWhichTrade], a ; wWhichTrade
+ ld [wWhichTrade], a
.asm_700d5
call Func_7011f
push af
@@ -174,7 +174,7 @@
ld b, $8
.asm_70121
ld hl, wOAMBuffer + $5c
- ld a, [wWhichTrade] ; wWhichTrade
+ ld a, [wWhichTrade]
ld de, $fffc
ld c, a
.asm_7012b
@@ -182,9 +182,9 @@
add hl, de
dec c
jr nz, .asm_7012b
- ld a, [rOBP1] ; $ff49
+ ld a, [rOBP1]
xor $a0
- ld [rOBP1], a ; $ff49
+ ld [rOBP1], a
ld c, $3
call CheckForUserInterruption
ret c
--- a/engine/give_pokemon.asm
+++ b/engine/give_pokemon.asm
@@ -2,14 +2,14 @@
call EnableAutoTextBoxDrawing
xor a
ld [wccd3], a
- ld a, [wPartyCount] ; wPartyCount
+ ld a, [wPartyCount]
cp PARTY_LENGTH
jr c, .asm_4fe01
- ld a, [W_NUMINBOX] ; wda80
+ ld a, [W_NUMINBOX]
cp MONS_PER_BOX
jr nc, .asm_4fdf9
xor a
- ld [W_ENEMYBATTSTATUS3], a ; W_ENEMYBATTSTATUS3
+ ld [W_ENEMYBATTSTATUS3], a
ld a, [wcf91]
ld [wEnemyMonSpecies2], a
callab LoadEnemyMonData
@@ -56,7 +56,7 @@
ld a, [wd11e]
dec a
ld c, a
- ld hl, wPokedexOwned ; wPokedexOwned
+ ld hl, wPokedexOwned
ld b, $1
predef FlagActionPredef
pop af
--- a/engine/hall_of_fame.asm
+++ b/engine/hall_of_fame.asm
@@ -11,7 +11,7 @@
ld a, $7f
call FillMemory
call EnableLCD
- ld hl, rLCDC ; $ff40
+ ld hl, rLCDC
set 3, [hl]
xor a
ld hl, wHallOfFame
@@ -24,7 +24,7 @@
ld [wd358], a
ld [wTrainerScreenY], a
inc a
- ld [H_AUTOBGTRANSFERENABLED], a ; $ffba
+ ld [H_AUTOBGTRANSFERENABLED], a
ld hl, wd5a2
ld a, [hl]
inc a
@@ -45,10 +45,10 @@
inc c
push hl
push bc
- ld [wWhichTrade], a ; wWhichTrade
+ ld [wWhichTrade], a
ld a, c
ld [wTrainerEngageDistance], a
- ld hl, wPartyMon1Level ; wPartyMon1Level
+ ld hl, wPartyMon1Level
ld bc, wPartyMon2 - wPartyMon1
call AddNTimes
ld a, [hl]
@@ -55,7 +55,7 @@
ld [wTrainerFacingDirection], a
call Func_70278
call Func_702e1
- ld c, $50
+ ld c, 80
call DelayFrames
hlCoord 2, 13
ld b, $3
@@ -79,15 +79,15 @@
ld [hl], $ff
call SaveHallOfFameTeams
xor a
- ld [wWhichTrade], a ; wWhichTrade
+ ld [wWhichTrade], a
inc a
ld [wTrainerScreenY], a
call Func_70278
- call Func_70377
+ call HoFDisplayPlayerStats
call Func_70423
xor a
ld [hWY], a
- ld hl, rLCDC ; $ff40
+ ld hl, rLCDC
res 3, [hl]
ret
@@ -100,7 +100,7 @@
ld [hSCY], a
ld a, $c0
ld [hSCX], a
- ld a, [wWhichTrade] ; wWhichTrade
+ ld a, [wWhichTrade]
ld [wcf91], a
ld [wd0b5], a
ld [wBattleMonSpecies2], a
@@ -108,7 +108,7 @@
ld a, [wTrainerScreenY]
and a
jr z, .asm_7029d
- call Func_7033e
+ call HoFLoadPlayerPics
jr .asm_702ab
.asm_7029d
hlCoord 12, 5
@@ -120,7 +120,7 @@
ld c, $0
call GoPAL_SET
ld a, $e4
- ld [rBGP], a ; $ff47
+ ld [rBGP], a
ld c, $31
call Func_7036d
ld d, $a0
@@ -148,7 +148,7 @@
Func_702e1: ; 702e1 (1c:42e1)
ld a, [wTrainerEngageDistance]
- ld hl, wPartyMonNicks ; wPartyMonNicks
+ ld hl, wPartyMonNicks
call GetPartyMonName
call Func_702f0
jp Func_70404
@@ -167,11 +167,11 @@
ld a, [wTrainerFacingDirection]
hlCoord 8, 7
call PrintLevelCommon
- ld a, [wWhichTrade] ; wWhichTrade
+ ld a, [wWhichTrade]
ld [wd0b5], a
hlCoord 3, 9
predef PrintMonType
- ld a, [wWhichTrade] ; wWhichTrade
+ ld a, [wWhichTrade]
jp PlayCry
HoFMonInfoText: ; 70329 (1c:4329)
@@ -179,8 +179,8 @@
next "TYPE1/"
next "TYPE2/@"
-Func_7033e: ; 7033e (1c:433e)
- ld de, RedPicFront ; $6ede
+HoFLoadPlayerPics: ; 7033e (1c:433e)
+ ld de, RedPicFront
ld a, BANK(RedPicFront)
call UncompressSpriteFromDE
ld hl, S_SPRITEBUFFER1
@@ -189,7 +189,7 @@
call CopyData
ld de, vFrontPic
call InterlaceMergeSpriteBuffers
- ld de, RedPicBack ; $7e0a
+ ld de, RedPicBack
ld a, BANK(RedPicBack)
call UncompressSpriteFromDE
predef ScaleSpriteByTwo
@@ -202,7 +202,7 @@
hlCoord 12, 5
predef_jump CopyTileIDsFromList
-Func_70377: ; 70377 (1c:4377)
+HoFDisplayPlayerStats: ; 70377 (1c:4377)
ld hl, wd747
set 3, [hl]
predef DisplayDexRating
@@ -215,7 +215,7 @@
ld c, $9
call TextBoxBorder
hlCoord 7, 2
- ld de, wPlayerName ; wd158
+ ld de, wPlayerName
call PlaceString
hlCoord 1, 6
ld de, HoFPlayTimeText
@@ -233,18 +233,18 @@
ld de, HoFMoneyText
call PlaceString
hlCoord 4, 10
- ld de, wPlayerMoney ; wPlayerMoney
+ ld de, wPlayerMoney
ld c, $a3
call PrintBCDNumber
ld hl, DexSeenOwnedText
- call Func_703e2
+ call HoFPrintTextAndDelay
ld hl, DexRatingText
- call Func_703e2
+ call HoFPrintTextAndDelay
ld hl, wcc5d
-Func_703e2: ; 703e2 (1c:43e2)
+HoFPrintTextAndDelay: ; 703e2 (1c:43e2)
call PrintText
- ld c, $78
+ ld c, 120
jp DelayFrames
HoFPlayTimeText: ; 703ea (1c:43ea)
@@ -266,7 +266,7 @@
ld bc, HOF_MON
ld a, [wTrainerEngageDistance]
call AddNTimes
- ld a, [wWhichTrade] ; wWhichTrade
+ ld a, [wWhichTrade]
ld [hli], a
ld a, [wTrainerFacingDirection]
ld [hli], a
--- a/engine/hidden_object_functions17.asm
+++ b/engine/hidden_object_functions17.asm
@@ -61,7 +61,7 @@
; Displays a pokemon's front sprite in a pop-up window.
; [wcf91] = pokemon interal id number
ld a, $1
- ld [H_AUTOBGTRANSFERENABLED], a ; $ffba
+ ld [H_AUTOBGTRANSFERENABLED], a
call Delay3
xor a
ld [hWY], a
@@ -78,7 +78,7 @@
ld a, $80
ld [$ffe1], a
hlCoord 10, 11
- predef Func_3f073
+ predef AnimateSendingOutMon
call WaitForTextScrollButtonPress
call LoadScreenTilesFromBuffer1
call Delay3
@@ -125,10 +125,10 @@
call PrintText
call HandleMenuInput
bit 1, a
- jr nz, .asm_5dc93 ; 0x5dc74 $1d
+ jr nz, .asm_5dc93
ld a, [wCurrentMenuItem]
cp $3
- jr z, .asm_5dc93 ; 0x5dc7b $16
+ jr z, .asm_5dc93
ld hl, wd730
res 6, [hl]
ld hl, LinkCableInfoTexts
@@ -316,7 +316,7 @@
GymTrashScript: ; 5ddfc (17:5dfc)
call EnableAutoTextBoxDrawing
- ld a, [wWhichTrade] ; wWhichTrade
+ ld a, [wWhichTrade]
ld [wcd5b], a
; Don't do the trash can puzzle if it's already been done.
@@ -345,7 +345,7 @@
ld hl, wd773
set 1, [hl]
- ld hl, GymTrashCans ; $5e7d
+ ld hl, GymTrashCans
ld a, [wcd5b]
; * 5
ld b, a
--- a/engine/hidden_object_functions18.asm
+++ b/engine/hidden_object_functions18.asm
@@ -14,9 +14,9 @@
cp $ff
ret z
cp b
- jr z, .asm_62433 ; 0x6242e $3
+ jr z, .asm_62433
inc hl
- jr .asm_62429 ; 0x62431 $f6
+ jr .asm_62429
.asm_62433
ld b, [hl]
ld a, [wd72a]
@@ -23,7 +23,7 @@
and b
cp b
ld a, $d
- jr z, .asm_6243f ; 0x6243b $2
+ jr z, .asm_6243f
ld a, $c
.asm_6243f
jp PrintPredefTextID
@@ -143,7 +143,7 @@
ld a, [wd838]
bit 7, a
ld hl, SaffronCityPokecenterBenchGuyText2
- jr nz, .asm_624f2 ; 0x624ed $3
+ jr nz, .asm_624f2
ld hl, SaffronCityPokecenterBenchGuyText1
.asm_624f2
call PrintText
--- a/engine/hidden_object_functions7.asm
+++ b/engine/hidden_object_functions7.asm
@@ -40,29 +40,29 @@
SafariZoneCheck: ; 1e988 (7:6988)
ld hl, wd790
bit 7, [hl]
- jr z, asm_1e9ab
- ld a, [W_NUMSAFARIBALLS] ; W_NUMSAFARIBALLS
+ jr z, SafariZoneGameOver
+ ld a, [W_NUMSAFARIBALLS]
and a
- jr z, asm_1e9b0
- jr asm_1e9ab
+ jr z, SafariZoneGameStillGoing
+ jr SafariZoneGameOver
SafariZoneCheckSteps: ; 1e997 (7:6997)
- ld a, [wSafariSteps] ; wd70d
+ ld a, [wSafariSteps]
ld b, a
- ld a, [wSafariSteps + 1] ; wd70e
+ ld a, [wSafariSteps + 1]
ld c, a
or b
- jr z, asm_1e9b0
+ jr z, SafariZoneGameStillGoing
dec bc
ld a, b
- ld [wSafariSteps], a ; wd70d
+ ld [wSafariSteps], a
ld a, c
- ld [wSafariSteps + 1], a ; wd70e
-asm_1e9ab: ; 1e9ab (7:69ab)
+ ld [wSafariSteps + 1], a
+SafariZoneGameOver: ; 1e9ab (7:69ab)
xor a
ld [wSafariZoneGameOver], a
ret
-asm_1e9b0: ; 1e9b0 (7:69b0)
+SafariZoneGameStillGoing: ; 1e9b0 (7:69b0)
call EnableAutoTextBoxDrawing
xor a
ld [wMusicHeaderPointer], a
@@ -76,12 +76,12 @@
cp $b9
jr nz, .asm_1e9c2
ld a, $d3
- ld [H_DOWNARROWBLINKCNT2], a ; $ff8c
+ ld [H_DOWNARROWBLINKCNT2], a
call DisplayTextID
xor a
ld [wd528], a
ld a, SAFARI_ZONE_ENTRANCE
- ld [H_DOWNARROWBLINKCNT1], a ; $ff8b
+ ld [H_DOWNARROWBLINKCNT1], a
ld a, $3
ld [wDestinationWarpID], a
ld a, $5
@@ -100,7 +100,7 @@
SafariGameOverText: ; 1e9f7 (7:69f7)
db $08 ; asm
- ld a, [W_NUMSAFARIBALLS] ; W_NUMSAFARIBALLS
+ ld a, [W_NUMSAFARIBALLS]
and a
jr z, .asm_1ea04
ld hl, TimesUpText
@@ -130,7 +130,7 @@
db $08 ; asm
xor a
ld [wda38], a
- ld a, [wWhichTrade] ; wWhichTrade
+ ld a, [wWhichTrade]
push af
and $f
ld [$ffdb], a
@@ -200,7 +200,7 @@
call YesNoChoice
ld a, [$ffdc]
ld c, a
- ld a, [wCurrentMenuItem] ; wCurrentMenuItem
+ ld a, [wCurrentMenuItem]
cp c
jr nz, .asm_1eab8
ld hl, wd126
@@ -267,7 +267,7 @@
add a
ld d, $0
ld e, a
- ld hl, CinnabarGymGateCoords ; $6b48
+ ld hl, CinnabarGymGateCoords
add hl, de
ld a, [hli]
ld b, [hl]
@@ -337,22 +337,22 @@
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ld a, $2e
call PrintPredefTextID
- ld c, $20
+ ld c, 32
call DelayFrames
ld a, (SFX_02_3c - SFX_Headers_02) / 3
call PlaySound
call WaitForSoundToFinish
- ld c, $50
+ ld c, 80
call DelayFrames
ld a, (SFX_02_48 - SFX_Headers_02) / 3
call PlaySound
call WaitForSoundToFinish
- ld c, $30
+ ld c, 48
call DelayFrames
ld a, (SFX_02_3c - SFX_Headers_02) / 3
call PlaySound
call WaitForSoundToFinish
- ld c, $20
+ ld c, 32
call DelayFrames
ld a, (SFX_02_3a - SFX_Headers_02) / 3
call PlaySound
@@ -379,12 +379,12 @@
ld a, $ff
ld [wc0ee], a
call PlaySound
- ld c, $10
+ ld c, 16
call DelayFrames
ld a, (SFX_02_49 - SFX_Headers_02) / 3
call PlaySound
call WaitForSoundToFinish
- ld c, $3c
+ ld c, 60
call DelayFrames
jp TextScriptEnd
--- a/engine/hp_bar.asm
+++ b/engine/hp_bar.asm
@@ -143,7 +143,7 @@
push de
ld d, $6
call DrawHPBar
- ld c, $2
+ ld c, 2
call DelayFrames
pop de
ld a, [wHPBarDelta] ; +1 or -1
--- a/engine/in_game_trades.asm
+++ b/engine/in_game_trades.asm
@@ -22,7 +22,7 @@
pop af
ld l,a
ld h,$0
- ld de,InGameTradeTextPointers ; $5d64
+ ld de,InGameTradeTextPointers
add hl,hl
add hl,de
ld a,[hli]
--- a/engine/intro.asm
+++ b/engine/intro.asm
@@ -106,12 +106,12 @@
call PlaySound
xor a
ld [wd09f], a
- ld de, IntroNidorinoAnimation4 ; $5931
+ ld de, IntroNidorinoAnimation4
call AnimateIntroNidorino
; hop
ld a, (SFX_1f_60 - SFX_Headers_1f) / 3
call PlaySound
- ld de, IntroNidorinoAnimation5 ; $593c
+ ld de, IntroNidorinoAnimation5
call AnimateIntroNidorino
ld c, $14
call CheckForUserInterruption
@@ -119,7 +119,7 @@
ld a, $24
ld [wd09f], a
- ld de, IntroNidorinoAnimation6 ; $5947
+ ld de, IntroNidorinoAnimation6
call AnimateIntroNidorino
ld c, $1e
call CheckForUserInterruption
@@ -130,7 +130,7 @@
call PlaySound
ld a, $48
ld [wd09f], a
- ld de, IntroNidorinoAnimation7 ; $5950
+ ld de, IntroNidorinoAnimation7
jp AnimateIntroNidorino
AnimateIntroNidorino: ; 41793 (10:5793)
@@ -137,10 +137,10 @@
ld a, [de]
cp $50
ret z
- ld [W_BASECOORDY], a ; wd082
+ ld [W_BASECOORDY], a
inc de
ld a, [de]
- ld [W_BASECOORDX], a ; wd081
+ ld [W_BASECOORDX], a
push de
ld c, $24
call Func_417ae
@@ -155,10 +155,10 @@
ld a, [wd09f]
ld d, a
.asm_417b5
- ld a, [W_BASECOORDY] ; wd082
+ ld a, [W_BASECOORDY]
add [hl]
ld [hli], a
- ld a, [W_BASECOORDX] ; wd081
+ ld a, [W_BASECOORDX]
add [hl]
ld [hli], a
ld a, d
@@ -174,7 +174,7 @@
ld d, $0
.asm_417cc
push bc
- ld a, [W_BASECOORDY] ; wd082
+ ld a, [W_BASECOORDY]
ld e, a
.asm_417d1
ld a, e
@@ -181,7 +181,7 @@
add $8
ld e, a
ld [hli], a
- ld a, [W_BASECOORDX] ; wd081
+ ld a, [W_BASECOORDX]
ld [hli], a
ld a, d
ld [hli], a
@@ -190,9 +190,9 @@
inc d
dec c
jr nz, .asm_417d1
- ld a, [W_BASECOORDX] ; wd081
+ ld a, [W_BASECOORDX]
add $8
- ld [W_BASECOORDX], a ; wd081
+ ld [W_BASECOORDX], a
pop bc
dec b
jr nz, .asm_417cc
@@ -236,9 +236,9 @@
.asm_4181d
push de
ld a, $2
- ld [W_BASECOORDX], a ; wd081
+ ld [W_BASECOORDX], a
xor a
- ld [W_BASECOORDY], a ; wd082
+ ld [W_BASECOORDY], a
ld c, $24
call Func_417ae
pop de
@@ -265,27 +265,27 @@
predef_jump CopyTileIDsFromList
Func_41849: ; 41849 (10:5849)
- predef Func_79869
+ predef GetMoveSoundB
ld a, b
jp PlaySound
LoadIntroGraphics: ; 41852 (10:5852)
- ld hl, FightIntroBackMon ; $5a99
+ ld hl, FightIntroBackMon
ld de, vChars2
ld bc, $600
ld a, BANK(FightIntroBackMon)
call FarCopyData2
- ld hl, GameFreakIntro ; $5959
+ ld hl, GameFreakIntro
ld de, vChars2 + $600
ld bc, $140
ld a, BANK(GameFreakIntro)
call FarCopyData2
- ld hl, GameFreakIntro ; $5959
+ ld hl, GameFreakIntro
ld de, vChars1
ld bc, $140
ld a, BANK(GameFreakIntro)
call FarCopyData2
- ld hl, FightIntroFrontMon ; $6099
+ ld hl, FightIntroFrontMon
ld de, vChars0
ld bc, $6c0
ld a, BANK(FightIntroFrontMon)
@@ -296,26 +296,26 @@
call GoPAL_SET
callba LoadCopyrightAndTextBoxTiles
ld a, $e4
- ld [rBGP], a ; $ff47
- ld c, $b4
+ ld [rBGP], a
+ ld c, 180
call DelayFrames
call ClearScreen
call DisableLCD
xor a
- ld [W_CUROPPONENT], a ; wd059
+ ld [W_CUROPPONENT], a
call Func_418e9
call LoadIntroGraphics
call EnableLCD
- ld hl, rLCDC ; $ff40
+ ld hl, rLCDC
res 5, [hl]
set 3, [hl]
- ld c, $40
+ ld c, 64
call DelayFrames
callba AnimateShootingStar
push af
pop af
jr c, .asm_418d0
- ld c, $28
+ ld c, 40
call DelayFrames
.asm_418d0
ld a, BANK(Music_IntroBattle)
--- a/engine/items/itemfinder.asm
+++ b/engine/items/itemfinder.asm
@@ -22,23 +22,23 @@
inc hl
ld e, [hl]
inc hl
- jr nz, .asm_74824 ; 0x74845 $dd
+ jr nz, .asm_74824
ld a, [W_YCOORD]
call Func_7486b
cp d
- jr nc, .asm_74824 ; 0x7484e $d4
+ jr nc, .asm_74824
ld a, [W_YCOORD]
add $4
cp d
- jr c, .asm_74824 ; 0x74856 $cc
+ jr c, .asm_74824
ld a, [W_XCOORD]
call Func_7486b
cp e
- jr nc, .asm_74824 ; 0x7485f $c3
+ jr nc, .asm_74824
ld a, [W_XCOORD]
add $5
cp e
- jr c, .asm_74824 ; 0x74867 $bb
+ jr c, .asm_74824
scf
ret
--- a/engine/items/items.asm
+++ b/engine/items/items.asm
@@ -115,7 +115,7 @@
ld a,[W_NUMINBOX] ;is Box full?
cp a,MONS_PER_BOX
jp z,BoxFullCannotThrowBall
-.UseBall ;$56a7
+.UseBall
;ok, you can use a ball
xor a
ld [wd11c],a
@@ -126,7 +126,7 @@
; remove a Safari Ball from inventory
ld hl,W_NUMSAFARIBALLS
dec [hl]
-.skipSafariZoneCode ;$56b6
+.skipSafariZoneCode
call GoPAL_SET_CF1C
ld a,$43
ld [wd11e],a
@@ -144,8 +144,8 @@
ld de,wPlayerName
ld bc,11
call CopyData ; save the player's name in the Wild Monster data (part of the Cinnabar Island Missingno glitch)
- jp .BallSuccess ;$578b
-.notOldManBattle ;$56e9
+ jp .BallSuccess
+.notOldManBattle
ld a,[W_CURMAP]
cp a,POKEMONTOWER_6
jr nz,.loop
@@ -155,13 +155,13 @@
jp z,.next12
; if not fighting ghost Marowak, loop until a random number in the current
; pokeball's allowed range is found
-.loop ;$56fa
+.loop
call Random
ld b,a
ld hl,wcf91
ld a,[hl]
cp a,MASTER_BALL
- jp z,.BallSuccess ;$578b
+ jp z,.BallSuccess
cp a,POKE_BALL
jr z,.checkForAilments
ld a,200
@@ -173,7 +173,7 @@
ld a,150 ;get only numbers <= 150 for Ultra Ball
cp b
jr c,.loop
-.checkForAilments ;$571a
+.checkForAilments
; pokemon can be caught more easily with any (primary) status ailment
; Frozen/Asleep pokemon are relatively even easier to catch
; for Frozen/Asleep pokemon, any random number from 0-24 ensures a catch.
@@ -185,12 +185,12 @@
ld c,12
jr z,.notFrozenOrAsleep
ld c,25
-.notFrozenOrAsleep ;$5728
+.notFrozenOrAsleep
ld a,b
sub c
- jp c,.BallSuccess ;$578b
+ jp c,.BallSuccess
ld b,a
-.noAilments ;$572e
+.noAilments
push bc ;save RANDOM number
xor a
ld [H_MULTIPLICAND],a
@@ -207,7 +207,7 @@
ld a,12 ;any other BallFactor
jr nz,.next7
ld a,8
-.next7 ;$574d
+.next7
ld [H_DIVISOR],a
ld b,4 ; number of bytes in dividend
call Divide
@@ -226,7 +226,7 @@
and a
jr nz,.next8
inc a
-.next8 ;$5766
+.next8
ld [H_DIVISOR],a
ld b,4
call Divide ; ((MaxHP * 255) / BallFactor) / (CurHP / 4)
@@ -235,7 +235,7 @@
jr z,.next9
ld a,255
ld [H_QUOTIENT + 3],a
-.next9 ;$5776
+.next9
pop bc
ld a,[wEnemyMonCatchRate] ;enemy: Catch Rate
cp b
@@ -248,9 +248,9 @@
ld a,[H_QUOTIENT + 3]
cp b
jr c,.next10
-.BallSuccess ;$578b
+.BallSuccess
jr .BallSuccess2
-.next10 ;$578d
+.next10
ld a,[H_QUOTIENT + 3]
ld [wd11e],a
xor a
@@ -271,7 +271,7 @@
ld b,150
cp a,ULTRA_BALL
jr z,.next11
-.next11 ;$57b8
+.next11
ld a,b
ld [H_DIVISOR],a
ld b,4
@@ -294,11 +294,11 @@
ld b,5
jr z,.next14
ld b,10
-.next14 ;$57e6
+.next14
ld a,[H_QUOTIENT + 3]
add b
ld [H_QUOTIENT + 3],a
-.next13 ;$57eb
+.next13
ld a,[H_QUOTIENT + 3]
cp a,10
ld b,$20
@@ -310,10 +310,10 @@
ld b,$62
jr c,.next12
ld b,$63
-.next12 ;$5801
+.next12
ld a,b
ld [wd11e],a
-.BallSuccess2 ;$5805
+.BallSuccess2
ld c,20
call DelayFrames
ld a,TOSS_ANIM
@@ -362,7 +362,7 @@
ld a,$4c
ld [wEnemyMonSpecies2],a
jr .next16
-.next15 ;$5871
+.next15
set Transformed,[hl]
ld hl,wcceb
ld a,[wEnemyMonDVs]
@@ -369,7 +369,7 @@
ld [hli],a
ld a,[wEnemyMonDVs + 1]
ld [hl],a
-.next16 ;$587e
+.next16
ld a,[wcf91]
push af
ld a,[wEnemyMonSpecies2]
@@ -419,7 +419,7 @@
ld a,[wEnemyMonSpecies] ;caught mon_ID
ld [wd11e],a
predef ShowPokedexData
-.checkParty ;$58f4
+.checkParty
ld a,[wPartyCount]
cp a,PARTY_LENGTH ;is party full?
jr z,.sendToBox
@@ -428,7 +428,7 @@
call ClearSprites
call AddPartyMon ;add mon to Party
jr .End
-.sendToBox ;$5907
+.sendToBox
call ClearSprites
call SendNewMonToBox
ld hl,ItemUseBallText07
@@ -436,15 +436,15 @@
bit 0,a ;already met Bill?
jr nz,.sendToBox2
ld hl,ItemUseBallText08
-.sendToBox2 ;$591a
+.sendToBox2
call PrintText
jr .End
-.printText1 ;$591f
+.printText1
ld hl,ItemUseBallText05
-.printText0 ;$5922
+.printText0
call PrintText
call ClearSprites
-.End ;$5928
+.End
ld a,[W_BATTLETYPE]
and a
ret nz
@@ -451,7 +451,7 @@
ld hl,wNumBagItems
inc a
ld [wcf96],a
- jp RemoveItemFromInventory ;remove ITEM (XXX)
+ jp RemoveItemFromInventory
ItemUseBallText00: ; d937 (3:5937)
;"It dodged the thrown ball!"
;"This pokemon can't be caught"
@@ -645,8 +645,8 @@
ld a,$01
ld [wccd4],a
ld a,(SFX_02_3e - SFX_Headers_02) / 3
- call PlaySoundWaitForCurrent ; play sound
- call WaitForSoundToFinish ; wait for sound to end
+ call PlaySoundWaitForCurrent
+ call WaitForSoundToFinish
callab TryEvolvingMon ; try to evolve pokemon
ld a,[wd121]
and a
@@ -918,7 +918,7 @@
ld bc,2 * 20
call AddNTimes ; calculate coordinates of HP bar of pokemon that used Softboiled
ld a,(SFX_02_3d - SFX_Headers_02) / 3
- call PlaySoundWaitForCurrent ; play sound
+ call PlaySoundWaitForCurrent
ld a,[hFlags_0xFFF6]
set 0,a
ld [hFlags_0xFFF6],a
@@ -1068,7 +1068,7 @@
cp a,FULL_HEAL
jr z,.playStatusAilmentCuringSound
ld a,(SFX_02_3d - SFX_Headers_02) / 3 ; HP healing sound
- call PlaySoundWaitForCurrent ; play sound
+ call PlaySoundWaitForCurrent
ld a,[hFlags_0xFFF6]
set 0,a
ld [hFlags_0xFFF6],a
@@ -1179,7 +1179,7 @@
ld bc,10
call CopyData ; copy the stat's name to wcf4b
ld a,(SFX_02_3e - SFX_Headers_02) / 3
- call PlaySound ; play sound
+ call PlaySound
ld hl,VitaminStatRoseText
call PrintText
jp RemoveUsedItem
@@ -1722,7 +1722,7 @@
call PlaySound ; turn off music
ld a, (SFX_02_5e - SFX_Headers_02) / 3
ld c, BANK(SFX_02_5e)
- call PlayMusic ; play music
+ call PlayMusic
.musicWaitLoop ; wait for music to finish playing
ld a,[wc028]
cp a,$b8
@@ -1747,7 +1747,7 @@
jp c, ItemUseNotTime
ld bc, (5 << 8) | MAGIKARP
ld a, $1 ; set bite
- jr RodResponse ; 0xe257 $34
+ jr RodResponse
GoodRodCode: ; e259 (3:6259)
call FishingInit
@@ -1780,7 +1780,7 @@
SuperRodCode: ; e283 (3:6283)
call FishingInit
jp c, ItemUseNotTime
- call ReadSuperRodData ; 0xe8ea
+ call ReadSuperRodData
ld a, e
RodResponse: ; e28d (3:628d)
ld [wWhichTrade], a
@@ -1825,7 +1825,7 @@
ld hl,ItemUseText00
call PrintText
ld a,(SFX_02_3e - SFX_Headers_02) / 3
- call PlaySound ; play sound
+ call PlaySound
ld c,80
call DelayFrames
and a
@@ -1848,9 +1848,9 @@
ld c,4
.loop
ld a,(SFX_02_4a - SFX_Headers_02) / 3
- call PlaySoundWaitForCurrent ; play sound
+ call PlaySoundWaitForCurrent
ld a,(SFX_02_5a - SFX_Headers_02) / 3
- call PlaySoundWaitForCurrent ; play sound
+ call PlaySoundWaitForCurrent
dec c
jr nz,.loop
ld hl,ItemfinderFoundItemText
@@ -2147,7 +2147,7 @@
jr nz,.checkIfAlreadyLearnedMove
; if the pokemon can't learn the move
ld a,(SFX_02_51 - SFX_Headers_02) / 3
- call PlaySoundWaitForCurrent ; play sound
+ call PlaySoundWaitForCurrent
ld hl,MonCannotLearnMachineMoveText
call PrintText
jr .chooseMon
@@ -2187,7 +2187,7 @@
ld hl,ItemUseText00
call PrintText
ld a,(SFX_02_3e - SFX_Headers_02) / 3
- call PlaySound ; play sound
+ call PlaySound
call WaitForTextScrollButtonPress ; wait for button press
RemoveUsedItem: ; e571 (3:6571)
@@ -2568,7 +2568,7 @@
INCLUDE "data/key_items.asm"
SendNewMonToBox: ; e7a4 (3:67a4)
- ld de, W_NUMINBOX ; wda80
+ ld de, W_NUMINBOX
ld a, [de]
inc a
ld [de], a
@@ -2587,7 +2587,7 @@
call GetMonHeader
ld hl, wBoxMonOT
ld bc, $b
- ld a, [W_NUMINBOX] ; wda80
+ ld a, [W_NUMINBOX]
dec a
jr z, .asm_e7ee
dec a
@@ -2598,7 +2598,7 @@
ld d, h
ld e, l
pop hl
- ld a, [W_NUMINBOX] ; wda80
+ ld a, [W_NUMINBOX]
dec a
ld b, a
.asm_e7db
@@ -2615,11 +2615,11 @@
dec b
jr nz, .asm_e7db
.asm_e7ee
- ld hl, wPlayerName ; wd158
+ ld hl, wPlayerName
ld de, wBoxMonOT
ld bc, $b
call CopyData
- ld a, [W_NUMINBOX] ; wda80
+ ld a, [W_NUMINBOX]
dec a
jr z, .asm_e82a
ld hl, wBoxMonNicks
@@ -2632,7 +2632,7 @@
ld d, h
ld e, l
pop hl
- ld a, [W_NUMINBOX] ; wda80
+ ld a, [W_NUMINBOX]
dec a
ld b, a
.asm_e817
@@ -2653,7 +2653,7 @@
ld a, $2
ld [wd07d], a
predef AskName
- ld a, [W_NUMINBOX] ; wda80
+ ld a, [W_NUMINBOX]
dec a
jr z, .asm_e867
ld hl, wBoxMons
@@ -2666,7 +2666,7 @@
ld d, h
ld e, l
pop hl
- ld a, [W_NUMINBOX] ; wda80
+ ld a, [W_NUMINBOX]
dec a
ld b, a
.asm_e854
@@ -2683,13 +2683,13 @@
dec b
jr nz, .asm_e854
.asm_e867
- ld a, [wEnemyMonLevel] ; wEnemyMonLevel
+ ld a, [wEnemyMonLevel]
ld [wEnemyMonBoxLevel], a
ld hl, wEnemyMon
ld de, wBoxMon1
ld bc, $c
call CopyData
- ld hl, wPlayerID ; wPlayerID
+ ld hl, wPlayerID
ld a, [hli]
ld [de], a
inc de
@@ -2697,11 +2697,11 @@
ld [de], a
inc de
push de
- ld a, [W_CURENEMYLVL] ; W_CURENEMYLVL
+ ld a, [W_CURENEMYLVL]
ld d, a
callab CalcExperience
pop de
- ld a, [H_NUMTOPRINT] ; $ff96 (aliases: H_MULTIPLICAND)
+ ld a, [H_NUMTOPRINT] ; (aliases: H_MULTIPLICAND)
ld [de], a
inc de
ld a, [$ff97]
@@ -2723,7 +2723,7 @@
inc de
ld a, [hli]
ld [de], a
- ld hl, wEnemyMonPP ; wcffe
+ ld hl, wEnemyMonPP
ld b, $4
.asm_e8b1
ld a, [hli]
@@ -2777,7 +2777,7 @@
ld e, $2 ; $2 if no fishing groups found
ret
-.ReadFishingGroup ; 0xe8f6
+.ReadFishingGroup
; hl points to the fishing group entry in the index
inc hl ; skip map id
@@ -2790,7 +2790,7 @@
inc hl ; point to data
ld e, $0 ; no bite yet
-.RandomLoop ; 0xe90c
+.RandomLoop
call Random
srl a
ret c ; 50% chance of no battle
--- a/engine/items/tm_prices.asm
+++ b/engine/items/tm_prices.asm
@@ -6,7 +6,7 @@
sub TM_01
ret c
ld d, a
- ld hl, TechnicalMachinePrices ; $7fa7
+ ld hl, TechnicalMachinePrices
srl a
ld c, a
ld b, 0
@@ -17,9 +17,9 @@
swap a
.highNybbleIsPrice
and $f0
- ld [H_DOWNARROWBLINKCNT2], a ; $ff8c
+ ld [H_DOWNARROWBLINKCNT2], a
xor a
- ld [H_DOWNARROWBLINKCNT1], a ; $ff8b
+ ld [H_DOWNARROWBLINKCNT1], a
ld [$ff8d], a
ret
--- a/engine/load_pokedex_tiles.asm
+++ b/engine/load_pokedex_tiles.asm
@@ -1,11 +1,11 @@
; Loads tile patterns for tiles used in the pokedex.
LoadPokedexTilePatterns: ; 17840 (5:7840)
call LoadHpBarAndStatusTilePatterns
- ld de,PokedexTileGraphics ; $6488
+ ld de,PokedexTileGraphics
ld hl,vChars2 + $600
ld bc,(BANK(PokedexTileGraphics) << 8) + $12
call CopyVideoData
- ld de,PokeballTileGraphics ; $697e
+ ld de,PokeballTileGraphics
ld hl,vChars2 + $720
ld bc,(BANK(PokeballTileGraphics) << 8) + $01
jp CopyVideoData ; load pokeball tile for marking caught mons
--- a/engine/menu/bills_pc.asm
+++ b/engine/menu/bills_pc.asm
@@ -357,7 +357,7 @@
Func_2171b:: ; 2171b (8:571b)
ld hl, wPartyMon1Moves
ld bc, wPartyMon2 - wPartyMon1
- jr .asm_21729 ; 0x21721 $6
+ jr .asm_21729
ld hl, wBoxMon1Moves
ld bc, wBoxMon2 - wBoxMon1
.asm_21729
@@ -375,7 +375,7 @@
pop hl
ret c
dec b
- jr nz, .asm_21731 ; 0x21741 $ee
+ jr nz, .asm_21731
and a
ret
--- a/engine/menu/diploma.asm
+++ b/engine/menu/diploma.asm
@@ -7,7 +7,7 @@
ld hl, wd730
set 6, [hl]
call DisableLCD
- ld hl, CircleTile ; $7d88
+ ld hl, CircleTile
ld de, vChars2 + $700
ld bc, $0010
ld a, BANK(CircleTile)
@@ -15,7 +15,7 @@
ld hl, wTileMap
ld bc, $1012
predef Diploma_TextBoxBorder
- ld hl, DiplomaTextPointersAndCoords ; $6784
+ ld hl, DiplomaTextPointersAndCoords
ld c, $5
.asm_56715
push bc
@@ -32,7 +32,7 @@
inc hl
pop bc
dec c
- jr nz, .asm_56715 ; 0x56725 $ee
+ jr nz, .asm_56715
hlCoord 10, 4
ld de, wPlayerName
call PlaceString
@@ -48,7 +48,7 @@
ld [hli], a
inc hl
dec c
- jr nz, .asm_5673e ; 0x56747 $f5
+ jr nz, .asm_5673e
call EnableLCD
callba LoadTrainerInfoTextBoxTiles
ld b, $8
@@ -73,7 +73,7 @@
cp $50
ret z
dec c
- jr .asm_5677d ; 0x56782 $f9
+ jr .asm_5677d
DiplomaTextPointersAndCoords: ; 56784 (15:6784)
dw DiplomaText
--- a/engine/menu/main_menu.asm
+++ b/engine/menu/main_menu.asm
@@ -52,7 +52,7 @@
.next2
ld hl,wd730
res 6,[hl]
- call UpdateSprites ; OAM?
+ call UpdateSprites
xor a
ld [wCurrentMenuItem],a
ld [wLastMenuItem],a
@@ -208,7 +208,7 @@
ld a, b
ld [wLinkMenuSelectionSendBuffer], a
and $3
- ld [wCurrentMenuItem], a ; wCurrentMenuItem
+ ld [wCurrentMenuItem], a
.doneChoosingMenuSelection
ld a, [hSerialConnectionStatus]
cp USING_INTERNAL_CLOCK
@@ -261,7 +261,7 @@
ld [wd72d], a
ld hl, PleaseWaitText
call PrintText
- ld c, $32
+ ld c, 50
call DelayFrames
ld hl, wd732
res 1, [hl]
@@ -268,7 +268,7 @@
ld a, [W_ANIMATIONID]
ld [wDestinationMap], a
call SpecialWarpIn
- ld c, $14
+ ld c, 20
call DelayFrames
xor a
ld [wMenuJoypadPollCount], a
@@ -304,7 +304,7 @@
ld hl, wd732
res 1, [hl]
call OakSpeech
- ld c, $14
+ ld c, 20
call DelayFrames
; enter map after using a special warp or loading the game from the main menu
@@ -338,7 +338,7 @@
ContinueGame: ; 5db5 (1:5db5)
xor a
- ld [H_AUTOBGTRANSFERENABLED], a ; $ffba
+ ld [H_AUTOBGTRANSFERENABLED], a
hlCoord 4, 7
ld b, $8
ld c, $e
@@ -347,7 +347,7 @@
ld de, SaveScreenInfoText
call PlaceString
hlCoord 12, 9
- ld de, wPlayerName ; wd158
+ ld de, wPlayerName
call PlaceString
hlCoord 17, 11
call Func_5e2f
@@ -356,8 +356,8 @@
hlCoord 13, 15
call Func_5e55
ld a, $1
- ld [H_AUTOBGTRANSFERENABLED], a ; $ffba
- ld c, $1e
+ ld [H_AUTOBGTRANSFERENABLED], a
+ ld c, 30
jp DelayFrames
PrintSaveScreenText: ; 5def (1:5def)
@@ -383,7 +383,7 @@
call Func_5e55
ld a, $1
ld [H_AUTOBGTRANSFERENABLED], a
- ld c, $1e
+ ld c, 30
jp DelayFrames
Func_5e2f: ; 5e2f (1:5e2f)
@@ -398,7 +398,7 @@
Func_5e42: ; 5e42 (1:5e42)
push hl
- ld hl, wPokedexOwned ; wPokedexOwned
+ ld hl, wPokedexOwned
ld b, wPokedexOwnedEnd - wPokedexOwned
call CountSetBits
pop hl
@@ -481,7 +481,7 @@
jr nz,.loop
.exitMenu
ld a,(SFX_02_40 - SFX_Headers_02) / 3
- call PlaySound ; play sound
+ call PlaySound
ret
.eraseOldMenuCursor
ld [wTopMenuItemX],a
--- a/engine/menu/naming_screen.asm
+++ b/engine/menu/naming_screen.asm
@@ -195,7 +195,7 @@
.asm_667e
pop de
- ld de, .asm_65ed ; $65ed
+ ld de, .asm_65ed
push de
.asm_6683
ld a, [wHPBarOldHP]
@@ -231,10 +231,10 @@
call CalcStringLength
ld a, [wHPBarNewHP]
cp $e5
- ld de, Dakutens ; $6885
+ ld de, Dakutens
jr z, .asm_66e3
cp $e4
- ld de, Handakutens ; $68d6
+ ld de, Handakutens
jr z, .asm_66e3
ld a, [wd07d]
cp $2
@@ -332,12 +332,12 @@
PrintAlphabet: ; 676f (1:676f)
xor a
- ld [H_AUTOBGTRANSFERENABLED], a ; $ffba
+ ld [H_AUTOBGTRANSFERENABLED], a
ld a, [wHPBarOldHP]
and a
- ld de, LowerCaseAlphabet ; $679e
+ ld de, LowerCaseAlphabet
jr nz, .asm_677e
- ld de, UpperCaseAlphabet ; $67d6
+ ld de, UpperCaseAlphabet
.asm_677e
hlCoord 2, 5
ld bc, $509
@@ -357,7 +357,7 @@
jr nz, .asm_6784
call PlaceString
ld a, $1
- ld [H_AUTOBGTRANSFERENABLED], a ; $ffba
+ ld [H_AUTOBGTRANSFERENABLED], a
jp Delay3
LowerCaseAlphabet: ; 679e (1:679e)
--- a/engine/menu/oaks_pc.asm
+++ b/engine/menu/oaks_pc.asm
@@ -5,7 +5,7 @@
ld hl, GetDexRatedText
call PrintText
call YesNoChoice
- ld a, [wCurrentMenuItem] ; wCurrentMenuItem
+ ld a, [wCurrentMenuItem]
and a
jr nz, .asm_1e932
predef DisplayDexRating
--- a/engine/menu/party_menu.asm
+++ b/engine/menu/party_menu.asm
@@ -21,7 +21,7 @@
xor a
ld [H_AUTOBGTRANSFERENABLED],a
call ClearScreen
- call UpdateSprites ; move sprites
+ call UpdateSprites
callba LoadMonPartySpriteGfxWithLCDDisabled ; load pokemon icon graphics
RedrawPartyMenu_: ; 12ce3 (4:6ce3)
--- a/engine/menu/pc.asm
+++ b/engine/menu/pc.asm
@@ -1,13 +1,13 @@
ActivatePC: ; 17e2c (5:7e2c)
- call SaveScreenTilesToBuffer2 ;XXX: copy background from wTileMap to wTileMapBackup2
+ call SaveScreenTilesToBuffer2
ld a, (SFX_02_45 - SFX_Headers_02) / 3
- call PlaySound ;XXX: play sound or stop music
+ call PlaySound
ld hl, TurnedOnPC1Text
call PrintText
- call WaitForSoundToFinish ;XXX: wait for sound to be done
+ call WaitForSoundToFinish
ld hl, wFlags_0xcd60
set 3, [hl]
- call LoadScreenTilesFromBuffer2 ;XXX: restore saved screen
+ call LoadScreenTilesFromBuffer2
call Delay3
PCMainMenu: ; 17e48 (5:7e48)
callba Func_213c8
@@ -52,8 +52,8 @@
res 5, [hl]
set 3, [hl]
ld a, (SFX_02_47 - SFX_Headers_02) / 3
- call PlaySound ;XXX: play sound or stop music
- call WaitForSoundToFinish ;XXX: wait for sound to be done
+ call PlaySound
+ call WaitForSoundToFinish
ld hl, AccessedMyPCText
call PrintText
callba PlayerPC
@@ -60,20 +60,20 @@
jr ReloadMainMenu
OaksPC: ; 17ec0 (5:7ec0)
ld a, (SFX_02_47 - SFX_Headers_02) / 3
- call PlaySound ;XXX: play sound or stop music
- call WaitForSoundToFinish ;XXX: wait for sound to be done
+ call PlaySound
+ call WaitForSoundToFinish
callba OpenOaksPC
jr ReloadMainMenu
PKMNLeague: ; 17ed2 (5:7ed2)
ld a, (SFX_02_47 - SFX_Headers_02) / 3
- call PlaySound ;XXX: play sound or stop music
- call WaitForSoundToFinish ;XXX: wait for sound to be done
+ call PlaySound
+ call WaitForSoundToFinish
callba PKMNLeaguePC
jr ReloadMainMenu
BillsPC: ; 17ee4 (5:7ee4)
ld a, (SFX_02_47 - SFX_Headers_02) / 3
- call PlaySound ;XXX: play sound or stop music
- call WaitForSoundToFinish ;XXX: wait for sound to be done
+ call PlaySound
+ call WaitForSoundToFinish
ld a, [wd7f1] ;has to do with having met Bill
bit 0, a
jr nz, .billsPC ;if you've met bill, use that bill's instead of someone's
@@ -88,12 +88,12 @@
xor a
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
call ReloadMapData
- call UpdateSprites ;XXX: moves sprites
+ call UpdateSprites
jp PCMainMenu
LogOff: ; 17f13 (5:7f13)
ld a, (SFX_02_46 - SFX_Headers_02) / 3
- call PlaySound ;XXX: play sound or stop music
- call WaitForSoundToFinish ;XXX: wait for sound to be done
+ call PlaySound
+ call WaitForSoundToFinish
ld hl, wFlags_0xcd60
res 3, [hl]
res 5, [hl]
@@ -117,7 +117,7 @@
; removes one of the specified item ID [$FFdb] from bag (if existent)
RemoveItemByID: ; 17f37 (5:7f37)
- ld hl, wBagItems ; wd31e
+ ld hl, wBagItems
ld a, [$ffdb]
ld b, a
xor a
@@ -137,6 +137,6 @@
ld a, $1
ld [wcf96], a
ld a, [$ffdc]
- ld [wWhichPokemon], a ; wWhichPokemon
- ld hl, wNumBagItems ; wNumBagItems
+ ld [wWhichPokemon], a
+ ld hl, wNumBagItems
jp RemoveItemFromInventory
--- a/engine/menu/pokedex.asm
+++ b/engine/menu/pokedex.asm
@@ -1,7 +1,7 @@
ShowPokedexMenu: ; 40000 (10:4000)
call GBPalWhiteOut
call ClearScreen
- call UpdateSprites ; move sprites
+ call UpdateSprites
ld a,[wListScrollOffset]
push af
xor a
@@ -140,7 +140,7 @@
.choseCry
ld a,[wd11e]
call GetCryData ; get cry data
- call PlaySound ; play sound
+ call PlaySound
jr .handleMenuInput
.choseArea
predef LoadTownMap_Nest ; display pokemon areas
--- a/engine/menu/prize_menu.asm
+++ b/engine/menu/prize_menu.asm
@@ -79,7 +79,7 @@
inc hl
push hl
ld hl,W_PRIZE1
- call CopyString ; XXX what does this do
+ call CopyString
pop hl
ld a,[hli]
ld h,[hl]
@@ -152,7 +152,7 @@
ld b,$01
ld c,$07
call TextBoxBorder
- call UpdateSprites ; XXX save OAM?
+ call UpdateSprites
hlCoord 12, 0
ld de,.CoinText
call PlaceString
--- a/engine/menu/start_menu.asm
+++ b/engine/menu/start_menu.asm
@@ -1,7 +1,7 @@
DisplayStartMenu:: ; 2acd (0:2acd)
- ld a,$04 ; hardcoded Bank, not sure what's it refers to
+ ld a,BANK(StartMenu_Pokedex)
ld [H_LOADEDROMBANK],a
- ld [$2000],a ; ROM bank 4
+ ld [MBC1RomBank],a
ld a,[wWalkBikeSurfState] ; walking/biking/surfing
ld [wWalkBikeSurfStateCopy],a
ld a, (SFX_02_3f - SFX_Headers_02) / 3 ; Start menu sound
@@ -10,7 +10,7 @@
RedisplayStartMenu:: ; 2adf (0:2adf)
callba DrawStartMenu
callba PrintSafariZoneSteps ; print Safari Zone info, if in Safari Zone
- call UpdateSprites ; move sprites
+ call UpdateSprites
.loop
call HandleMenuInput
ld b,a
--- a/engine/menu/start_sub_menus.asm
+++ b/engine/menu/start_sub_menus.asm
@@ -325,7 +325,7 @@
.exitMenu
call LoadScreenTilesFromBuffer2 ; restore saved screen
call LoadTextBoxTilePatterns
- call UpdateSprites ; move sprites
+ call UpdateSprites
jp RedisplayStartMenu
.choseItem
; erase menu cursor (blank each tile in front of an item name)
@@ -499,7 +499,7 @@
StartMenu_TrainerInfo: ; 13460 (4:7460)
call GBPalWhiteOut
call ClearScreen
- call UpdateSprites ; move sprites
+ call UpdateSprites
ld a,[hTilesetType]
push af
xor a
@@ -535,25 +535,25 @@
ld de,vChars2
ld bc,$70 * 4
call CopyData
- ld hl,TrainerInfoTextBoxTileGraphics ; $7b98 ; trainer info text box tile patterns
+ ld hl,TrainerInfoTextBoxTileGraphics ; trainer info text box tile patterns
ld de,vChars2 + $770
ld bc,$0080
push bc
call TrainerInfo_FarCopyData
- ld hl,BlankLeaderNames ; $7c28
+ ld hl,BlankLeaderNames
ld de,vChars2 + $600
ld bc,$0170
call TrainerInfo_FarCopyData
pop bc
- ld hl,BadgeNumbersTileGraphics ; $7d98 ; badge number tile patterns
+ ld hl,BadgeNumbersTileGraphics ; badge number tile patterns
ld de,vChars1 + $580
call TrainerInfo_FarCopyData
- ld hl,GymLeaderFaceAndBadgeTileGraphics ; $6a9e ; gym leader face and badge tile patterns
+ ld hl,GymLeaderFaceAndBadgeTileGraphics ; gym leader face and badge tile patterns
ld de,vChars2 + $200
ld bc,$0400
ld a,$03
call FarCopyData2
- ld hl,TextBoxGraphics ; $6288
+ ld hl,TextBoxGraphics
ld de,$00d0
add hl,de ; hl = colon tile pattern
ld de,vChars1 + $560
@@ -562,7 +562,7 @@
push bc
call FarCopyData2
pop bc
- ld hl,TrainerInfoTextBoxTileGraphics + $80 ; $7c18 ; background tile pattern
+ ld hl,TrainerInfoTextBoxTileGraphics + $80 ; background tile pattern
ld de,vChars1 + $570
call TrainerInfo_FarCopyData
call EnableLCD
@@ -705,9 +705,9 @@
SwitchPartyMon: ; 13613 (4:7613)
call SwitchPartyMon_Stats
- ld a, [wWhichTrade] ; wWhichTrade
+ ld a, [wWhichTrade]
call SwitchPartyMon_OAM
- ld a, [wCurrentMenuItem] ; wCurrentMenuItem
+ ld a, [wCurrentMenuItem]
call SwitchPartyMon_OAM
jp RedrawPartyMenu_
@@ -741,7 +741,7 @@
ld a, [wMenuItemToSwap]
and a
jr nz, .asm_13661
- ld a, [wWhichPokemon] ; wWhichPokemon
+ ld a, [wWhichPokemon]
inc a
ld [wMenuItemToSwap], a
ret
@@ -751,8 +751,8 @@
ld a, [wMenuItemToSwap]
dec a
ld b, a
- ld a, [wCurrentMenuItem] ; wCurrentMenuItem
- ld [wWhichTrade], a ; wWhichTrade
+ ld a, [wCurrentMenuItem]
+ ld [wWhichTrade], a
cp b
jr nz, .asm_1367b
xor a
@@ -767,7 +767,7 @@
ld hl, wPartySpecies
ld d, h
ld e, l
- ld a, [wCurrentMenuItem] ; wCurrentMenuItem
+ ld a, [wCurrentMenuItem]
add l
ld l, a
jr nc, .asm_1368e
@@ -780,14 +780,14 @@
inc d
.asm_13696
ld a, [hl]
- ld [H_DIVIDEND], a ; $ff95 (aliases: H_PRODUCT, H_PASTLEADINGZEROES, H_QUOTIENT)
+ ld [H_DIVIDEND], a ; (aliases: H_PRODUCT, H_PASTLEADINGZEROES, H_QUOTIENT)
ld a, [de]
ld [hl], a
- ld a, [H_DIVIDEND] ; $ff95 (aliases: H_PRODUCT, H_PASTLEADINGZEROES, H_QUOTIENT)
+ ld a, [H_DIVIDEND] ; (aliases: H_PRODUCT, H_PASTLEADINGZEROES, H_QUOTIENT)
ld [de], a
ld hl, wPartyMons
ld bc, wPartyMon2 - wPartyMon1
- ld a, [wCurrentMenuItem] ; wCurrentMenuItem
+ ld a, [wCurrentMenuItem]
call AddNTimes
push hl
ld de, wSwitchPartyMonTempBuffer
@@ -805,14 +805,14 @@
ld hl, wSwitchPartyMonTempBuffer
ld bc, $2c
call CopyData
- ld hl, wPartyMonOT ; wd273
- ld a, [wCurrentMenuItem] ; wCurrentMenuItem
+ ld hl, wPartyMonOT
+ ld a, [wCurrentMenuItem]
call SkipFixedLengthTextEntries
push hl
ld de, wSwitchPartyMonTempBuffer
ld bc, $b
call CopyData
- ld hl, wPartyMonOT ; wd273
+ ld hl, wPartyMonOT
ld a, [wMenuItemToSwap]
call SkipFixedLengthTextEntries
pop de
@@ -823,14 +823,14 @@
ld hl, wSwitchPartyMonTempBuffer
ld bc, $b
call CopyData
- ld hl, wPartyMonNicks ; wPartyMonNicks
- ld a, [wCurrentMenuItem] ; wCurrentMenuItem
+ ld hl, wPartyMonNicks
+ ld a, [wCurrentMenuItem]
call SkipFixedLengthTextEntries
push hl
ld de, wSwitchPartyMonTempBuffer
ld bc, $b
call CopyData
- ld hl, wPartyMonNicks ; wPartyMonNicks
+ ld hl, wPartyMonNicks
ld a, [wMenuItemToSwap]
call SkipFixedLengthTextEntries
pop de
@@ -842,7 +842,7 @@
ld bc, $b
call CopyData
ld a, [wMenuItemToSwap]
- ld [wWhichTrade], a ; wWhichTrade
+ ld [wWhichTrade], a
xor a
ld [wMenuItemToSwap], a
ld [wd07d], a
--- a/engine/menu/status_screen.asm
+++ b/engine/menu/status_screen.asm
@@ -67,7 +67,7 @@
call LoadMonData
ld a, [wcc49]
cp $2 ; 2 means we're in a PC box
- jr c, .DontRecalculate ; 0x1295b $14
+ jr c, .DontRecalculate
ld a, [wLoadedMonBoxLevel]
ld [wLoadedMonLevel], a
ld [W_CURENEMYLVL], a
@@ -82,17 +82,17 @@
ld [$ff24], a ; Reduce the volume
call GBPalWhiteOutWithDelay3
call ClearScreen
- call UpdateSprites ; move sprites (?)
+ call UpdateSprites
call LoadHpBarAndStatusTilePatterns
- ld de, BattleHudTiles1 ; $6080 ; source
+ ld de, BattleHudTiles1 ; source
ld hl, vChars2 + $6d0 ; dest
ld bc, (BANK(BattleHudTiles1) << 8) + $03 ; bank bytes/8
call CopyVideoDataDouble ; ·│ :L and halfarrow line end
- ld de, BattleHudTiles2 ; $6098
+ ld de, BattleHudTiles2
ld hl, vChars2 + $780
ld bc, (BANK(BattleHudTiles2) << 8) + $01
call CopyVideoDataDouble ; │
- ld de, BattleHudTiles3 ; $60b0
+ ld de, BattleHudTiles3
ld hl, vChars2 + $760
ld bc, (BANK(BattleHudTiles3) << 8) + $02
call CopyVideoDataDouble ; ─┘
@@ -127,7 +127,7 @@
hlCoord 16, 6
ld de, wLoadedMonStatus
call PrintStatusCondition
- jr nz, .StatusWritten ; 0x129fc $9
+ jr nz, .StatusWritten
hlCoord 16, 6
ld de, OKText
call PlaceString ; "OK"
@@ -147,14 +147,14 @@
call PrintNumber ; Pokémon no.
hlCoord 11, 10
predef PrintMonType
- ld hl, NamePointers2 ; $6a9d
- call .unk_12a7e
+ ld hl, NamePointers2
+ call .asm_12a7e
ld d, h
ld e, l
hlCoord 9, 1
call PlaceString ; Pokémon name
- ld hl, OTPointers ; $6a95
- call .unk_12a7e
+ ld hl, OTPointers
+ call .asm_12a7e
ld d, h
ld e, l
hlCoord 12, 16
@@ -175,7 +175,7 @@
pop af
ld [hTilesetType], a
ret
-.unk_12a7e ; 0x12a7e ; I don't know what this does, iterates over pointers?
+.asm_12a7e ; I don't know what this does, iterates over pointers?
ld a, [wcc49]
add a
ld c, a
@@ -221,13 +221,13 @@
db "OK@"
; Draws a line starting from hl high b and wide c
-DrawLineBox ; 0x12ac7
+DrawLineBox: ; 0x12ac7
ld de, $0014 ; New line
.PrintVerticalLine
ld [hl], $78 ; │
add hl, de
dec b
- jr nz, .PrintVerticalLine ; 0x12ace $fa
+ jr nz, .PrintVerticalLine
ld [hl], $77 ; ┘
dec hl
.PrintHorizLine
@@ -234,7 +234,7 @@
ld [hl], $76 ; ─
dec hl
dec c
- jr nz, .PrintHorizLine ; 0x12ad7 $fa
+ jr nz, .PrintHorizLine
ld [hl], $6f ; ← (halfarrow ending)
ret
@@ -244,7 +244,7 @@
PrintStatsBox: ; 12ae4 (4:6ae4)
ld a, d
and a ; a is 0 from the status screen
- jr nz, .DifferentBox ; 0x12ae6 $12
+ jr nz, .DifferentBox
hlCoord 0, 8
ld b, $8
ld c, $8
@@ -251,7 +251,7 @@
call TextBoxBorder ; Draws the box
hlCoord 1, 9 ; Start printing stats from here
ld bc, $0019 ; Number offset
- jr .PrintStats ; 0x12af8 $10
+ jr .PrintStats
.DifferentBox
hlCoord 9, 2
ld b, $8
@@ -328,7 +328,7 @@
call Func_12ccb ; Print "PP"
ld a, b
and a
- jr z, .InitPP ; 0x12bb3 $6
+ jr z, .InitPP
ld c, a
ld a, "-"
call Func_12ccb ; Fill the rest with --
@@ -339,7 +339,7 @@
.PrintPP ; 12bc3
ld a, [hli]
and a
- jr z, .PPDone ; 0x12bc5 $4a
+ jr z, .PPDone
push bc
push hl
push de
@@ -382,7 +382,7 @@
inc b
ld a, b
cp $4
- jr nz, .PrintPP ; 0x12c0f $b2
+ jr nz, .PrintPP
.PPDone
hlCoord 9, 3
ld de, EXPPointsText
@@ -390,7 +390,7 @@
ld a, [wLoadedMonLevel] ; level
push af
cp MAX_LEVEL
- jr z, .Level100 ; 0x12c20 $4
+ jr z, .Level100
inc a
ld [wLoadedMonLevel], a ; Increase temporarily if not 100
.Level100
@@ -434,7 +434,7 @@
.asm_12c86 ; This does some magic with lvl/exp?
ld a, [wLoadedMonLevel] ; Load level
cp MAX_LEVEL
- jr z, .asm_12ca7 ; 0x12c8b $1a ; If 100
+ jr z, .asm_12ca7 ; If 100
inc a
ld d, a
callab CalcExperience
--- a/engine/menu/vending_machine.asm
+++ b/engine/menu/vending_machine.asm
@@ -52,9 +52,9 @@
ld c, 1
call GiveItem
jr nc, .BagFull
- ld b, $3c ; number of times to play the "brrrrr" sound
-.playDeliverySound ; 0x74f63
- ld c, $2
+ ld b, 60 ; number of times to play the "brrrrr" sound
+.playDeliverySound
+ ld c, 2
call DelayFrames
push bc
ld a, (SFX_02_53 - SFX_Headers_02) / 3
--- a/engine/multiply_divide.asm
+++ b/engine/multiply_divide.asm
@@ -2,15 +2,15 @@
ld a, $8
ld b, a
xor a
- ld [H_DIVIDEND], a ; $ff95 (aliases: H_PRODUCT, H_PASTLEADINGZEROES, H_QUOTIENT)
+ ld [H_DIVIDEND], a ; (aliases: H_PRODUCT, H_PASTLEADINGZEROES, H_QUOTIENT)
ld [$ff9b], a
- ld [H_SAVEDNUMTOPRINT], a ; $ff9c
+ ld [H_SAVEDNUMTOPRINT], a
ld [$ff9d], a
ld [$ff9e], a
.asm_37d4f
- ld a, [H_REMAINDER] ; $ff99 (aliases: H_DIVISOR, H_MULTIPLIER, H_POWEROFTEN)
+ ld a, [H_REMAINDER] ; (aliases: H_DIVISOR, H_MULTIPLIER, H_POWEROFTEN)
srl a
- ld [H_REMAINDER], a ; $ff99 (aliases: H_DIVISOR, H_MULTIPLIER, H_POWEROFTEN)
+ ld [H_REMAINDER], a ; (aliases: H_DIVISOR, H_MULTIPLIER, H_POWEROFTEN)
jr nc, .asm_37d77
ld a, [$ff9e]
ld c, a
@@ -22,14 +22,14 @@
ld a, [$ff97]
adc c
ld [$ff9d], a
- ld a, [H_SAVEDNUMTOPRINT] ; $ff9c
+ ld a, [H_SAVEDNUMTOPRINT]
ld c, a
- ld a, [H_NUMTOPRINT] ; $ff96 (aliases: H_MULTIPLICAND)
+ ld a, [H_NUMTOPRINT] ; (aliases: H_MULTIPLICAND)
adc c
- ld [H_SAVEDNUMTOPRINT], a ; $ff9c
+ ld [H_SAVEDNUMTOPRINT], a
ld a, [$ff9b]
ld c, a
- ld a, [H_DIVIDEND] ; $ff95 (aliases: H_PRODUCT, H_PASTLEADINGZEROES, H_QUOTIENT)
+ ld a, [H_DIVIDEND] ; (aliases: H_PRODUCT, H_PASTLEADINGZEROES, H_QUOTIENT)
adc c
ld [$ff9b], a
.asm_37d77
@@ -41,12 +41,12 @@
ld a, [$ff97]
rl a
ld [$ff97], a
- ld a, [H_NUMTOPRINT] ; $ff96 (aliases: H_MULTIPLICAND)
+ ld a, [H_NUMTOPRINT] ; (aliases: H_MULTIPLICAND)
rl a
- ld [H_NUMTOPRINT], a ; $ff96 (aliases: H_MULTIPLICAND)
- ld a, [H_DIVIDEND] ; $ff95 (aliases: H_PRODUCT, H_PASTLEADINGZEROES, H_QUOTIENT)
+ ld [H_NUMTOPRINT], a ; (aliases: H_MULTIPLICAND)
+ ld a, [H_DIVIDEND] ; (aliases: H_PRODUCT, H_PASTLEADINGZEROES, H_QUOTIENT)
rl a
- ld [H_DIVIDEND], a ; $ff95 (aliases: H_PRODUCT, H_PASTLEADINGZEROES, H_QUOTIENT)
+ ld [H_DIVIDEND], a ; (aliases: H_PRODUCT, H_PASTLEADINGZEROES, H_QUOTIENT)
jr .asm_37d4f
.asm_37d94
ld a, [$ff9e]
@@ -53,10 +53,10 @@
ld [$ff98], a
ld a, [$ff9d]
ld [$ff97], a
- ld a, [H_SAVEDNUMTOPRINT] ; $ff9c
- ld [H_NUMTOPRINT], a ; $ff96 (aliases: H_MULTIPLICAND)
+ ld a, [H_SAVEDNUMTOPRINT]
+ ld [H_NUMTOPRINT], a ; (aliases: H_MULTIPLICAND)
ld a, [$ff9b]
- ld [H_DIVIDEND], a ; $ff95 (aliases: H_PRODUCT, H_PASTLEADINGZEROES, H_QUOTIENT)
+ ld [H_DIVIDEND], a ; (aliases: H_PRODUCT, H_PASTLEADINGZEROES, H_QUOTIENT)
ret
_Divide: ; 37da5 (d:7da5)
@@ -63,7 +63,7 @@
xor a
ld [$ff9a], a
ld [$ff9b], a
- ld [H_SAVEDNUMTOPRINT], a ; $ff9c
+ ld [H_SAVEDNUMTOPRINT], a
ld [$ff9d], a
ld [$ff9e], a
ld a, $9
@@ -71,17 +71,17 @@
.asm_37db3
ld a, [$ff9a]
ld c, a
- ld a, [H_NUMTOPRINT] ; $ff96 (aliases: H_MULTIPLICAND)
+ ld a, [H_NUMTOPRINT] ; (aliases: H_MULTIPLICAND)
sub c
ld d, a
- ld a, [H_REMAINDER] ; $ff99 (aliases: H_DIVISOR, H_MULTIPLIER, H_POWEROFTEN)
+ ld a, [H_REMAINDER] ; (aliases: H_DIVISOR, H_MULTIPLIER, H_POWEROFTEN)
ld c, a
- ld a, [H_DIVIDEND] ; $ff95 (aliases: H_PRODUCT, H_PASTLEADINGZEROES, H_QUOTIENT)
+ ld a, [H_DIVIDEND] ; (aliases: H_PRODUCT, H_PASTLEADINGZEROES, H_QUOTIENT)
sbc c
jr c, .asm_37dce
- ld [H_DIVIDEND], a ; $ff95 (aliases: H_PRODUCT, H_PASTLEADINGZEROES, H_QUOTIENT)
+ ld [H_DIVIDEND], a ; (aliases: H_PRODUCT, H_PASTLEADINGZEROES, H_QUOTIENT)
ld a, d
- ld [H_NUMTOPRINT], a ; $ff96 (aliases: H_MULTIPLICAND)
+ ld [H_NUMTOPRINT], a ; (aliases: H_MULTIPLICAND)
ld a, [$ff9e]
inc a
ld [$ff9e], a
@@ -96,9 +96,9 @@
ld a, [$ff9d]
rl a
ld [$ff9d], a
- ld a, [H_SAVEDNUMTOPRINT] ; $ff9c
+ ld a, [H_SAVEDNUMTOPRINT]
rl a
- ld [H_SAVEDNUMTOPRINT], a ; $ff9c
+ ld [H_SAVEDNUMTOPRINT], a
ld a, [$ff9b]
rl a
ld [$ff9b], a
@@ -107,13 +107,13 @@
ld a, $8
ld e, a
ld a, [$ff9a]
- ld [H_REMAINDER], a ; $ff99 (aliases: H_DIVISOR, H_MULTIPLIER, H_POWEROFTEN)
+ ld [H_REMAINDER], a ; (aliases: H_DIVISOR, H_MULTIPLIER, H_POWEROFTEN)
xor a
ld [$ff9a], a
- ld a, [H_NUMTOPRINT] ; $ff96 (aliases: H_MULTIPLICAND)
- ld [H_DIVIDEND], a ; $ff95 (aliases: H_PRODUCT, H_PASTLEADINGZEROES, H_QUOTIENT)
+ ld a, [H_NUMTOPRINT] ; (aliases: H_MULTIPLICAND)
+ ld [H_DIVIDEND], a ; (aliases: H_PRODUCT, H_PASTLEADINGZEROES, H_QUOTIENT)
ld a, [$ff97]
- ld [H_NUMTOPRINT], a ; $ff96 (aliases: H_MULTIPLICAND)
+ ld [H_NUMTOPRINT], a ; (aliases: H_MULTIPLICAND)
ld a, [$ff98]
ld [$ff97], a
.asm_37e04
@@ -122,22 +122,22 @@
jr nz, .asm_37e0a
dec b
.asm_37e0a
- ld a, [H_REMAINDER] ; $ff99 (aliases: H_DIVISOR, H_MULTIPLIER, H_POWEROFTEN)
+ ld a, [H_REMAINDER] ; (aliases: H_DIVISOR, H_MULTIPLIER, H_POWEROFTEN)
srl a
- ld [H_REMAINDER], a ; $ff99 (aliases: H_DIVISOR, H_MULTIPLIER, H_POWEROFTEN)
+ ld [H_REMAINDER], a ; (aliases: H_DIVISOR, H_MULTIPLIER, H_POWEROFTEN)
ld a, [$ff9a]
rr a
ld [$ff9a], a
jr .asm_37db3
.asm_37e18
- ld a, [H_NUMTOPRINT] ; $ff96 (aliases: H_MULTIPLICAND)
- ld [H_REMAINDER], a ; $ff99 (aliases: H_DIVISOR, H_MULTIPLIER, H_POWEROFTEN)
+ ld a, [H_NUMTOPRINT] ; (aliases: H_MULTIPLICAND)
+ ld [H_REMAINDER], a ; (aliases: H_DIVISOR, H_MULTIPLIER, H_POWEROFTEN)
ld a, [$ff9e]
ld [$ff98], a
ld a, [$ff9d]
ld [$ff97], a
- ld a, [H_SAVEDNUMTOPRINT] ; $ff9c
- ld [H_NUMTOPRINT], a ; $ff96 (aliases: H_MULTIPLICAND)
+ ld a, [H_SAVEDNUMTOPRINT]
+ ld [H_NUMTOPRINT], a ; (aliases: H_MULTIPLICAND)
ld a, [$ff9b]
- ld [H_DIVIDEND], a ; $ff95 (aliases: H_PRODUCT, H_PASTLEADINGZEROES, H_QUOTIENT)
+ ld [H_DIVIDEND], a ; (aliases: H_PRODUCT, H_PASTLEADINGZEROES, H_QUOTIENT)
ret
--- a/engine/oak_speech.asm
+++ b/engine/oak_speech.asm
@@ -1,11 +1,11 @@
SetDefaultNames: ; 60ca (1:60ca)
ld a, [wd358]
push af
- ld a, [W_OPTIONS] ; W_OPTIONS
+ ld a, [W_OPTIONS]
push af
ld a, [wd732]
push af
- ld hl, wPlayerName ; wd158
+ ld hl, wPlayerName
ld bc, $d8a
xor a
call FillMemory
@@ -16,7 +16,7 @@
pop af
ld [wd732], a
pop af
- ld [W_OPTIONS], a ; W_OPTIONS
+ ld [W_OPTIONS], a
pop af
ld [wd358], a
ld a, [wd08a]
@@ -23,11 +23,11 @@
and a
call z, Func_5bff
ld hl, NintenText
- ld de, wPlayerName ; wd158
+ ld de, wPlayerName
ld bc, $b
call CopyData
ld hl, SonyText
- ld de, W_RIVALNAME ; wd34a
+ ld de, W_RIVALNAME
ld bc, $b
jp CopyData
@@ -37,7 +37,7 @@
ld a, BANK(Music_Routes2) ; bank of song
ld c,a
ld a, MUSIC_ROUTES2 ; song #
- call PlayMusic ; plays music
+ call PlayMusic
call ClearScreen
call LoadTextBoxTilePatterns
call SetDefaultNames
@@ -111,10 +111,10 @@
call PlaySound
pop af
ld [H_LOADEDROMBANK],a
- ld [$2000],a
+ ld [MBC1RomBank],a
ld c,4
call DelayFrames
- ld de,RedSprite ; $4180
+ ld de,RedSprite
ld hl,vSprites
ld bc,(BANK(RedSprite) << 8) | $0C
call CopyVideoData
@@ -139,8 +139,8 @@
call PlaySound ; stop music
pop af
ld [H_LOADEDROMBANK],a
- ld [$2000],a
- ld c,$14
+ ld [MBC1RomBank],a
+ ld c,20
call DelayFrames
hlCoord 6, 5
ld b,7
@@ -149,7 +149,7 @@
call LoadTextBoxTilePatterns
ld a,1
ld [wUpdateSpritesEnabled],a
- ld c,$32
+ ld c,50
call DelayFrames
call GBFadeOutToWhite
jp ClearScreen
@@ -229,4 +229,4 @@
.next
xor a
ld [$FFE1],a
- predef_jump Func_3f0c6
+ predef_jump CopyUncompressedPicToTilemap
--- a/engine/oak_speech2.asm
+++ b/engine/oak_speech2.asm
@@ -1,17 +1,17 @@
LoadDefaultNamesPlayer: ; 695d (1:695d)
call Func_6a12
- ld de, DefaultNamesPlayer ; $6aa8
+ ld de, DefaultNamesPlayer
call DisplayIntroNameTextBox
- ld a, [wCurrentMenuItem] ; wCurrentMenuItem
+ ld a, [wCurrentMenuItem]
and a
jr z, .asm_697a
- ld hl, DefaultNamesPlayerList ; $6af2
+ ld hl, DefaultNamesPlayerList
call Func_6ad6
- ld de, wPlayerName ; wd158
+ ld de, wPlayerName
call Func_69ec
jr .asm_6999
.asm_697a
- ld hl, wPlayerName ; wd158
+ ld hl, wPlayerName
xor a
ld [wd07d], a
call DisplayNamingScreen
@@ -20,7 +20,7 @@
jr z, .asm_697a
call ClearScreen
call Delay3
- ld de, RedPicFront ; $6ede
+ ld de, RedPicFront
ld b, BANK(RedPicFront)
call IntroPredef3B
.asm_6999
@@ -32,19 +32,19 @@
db "@"
LoadDefaultNamesRival: ; 69a4 (1:69a4)
- call Func_6a12 ; 0x69a4 call 0x6a12
+ call Func_6a12
ld de, DefaultNamesRival
call DisplayIntroNameTextBox
- ld a, [wCurrentMenuItem] ; wCurrentMenuItem
+ ld a, [wCurrentMenuItem]
and a
jr z, .asm_69c1
ld hl, DefaultNamesRivalList
call Func_6ad6
- ld de, W_RIVALNAME ; wd34a
+ ld de, W_RIVALNAME
call Func_69ec
jr .asm_69e1
.asm_69c1
- ld hl, W_RIVALNAME ; wd34a
+ ld hl, W_RIVALNAME
ld a, $1
ld [wd07d], a
call DisplayNamingScreen
@@ -53,7 +53,7 @@
jr z, .asm_69c1
call ClearScreen
call Delay3
- ld de, Rival1Pic ; $6049
+ ld de, Rival1Pic
ld b, $13
call IntroPredef3B
.asm_69e1
@@ -69,7 +69,7 @@
ld hl, wTileMap
ld bc, $c0b
call ClearScreenArea
- ld c, $a
+ ld c, 10
call DelayFrames
pop de
ld hl, wcd6d
@@ -91,9 +91,9 @@
push bc
ld [$ff8d], a
ld a, d
- ld [H_DOWNARROWBLINKCNT1], a ; $ff8b
+ ld [H_DOWNARROWBLINKCNT1], a
ld a, e
- ld [H_DOWNARROWBLINKCNT2], a ; $ff8c
+ ld [H_DOWNARROWBLINKCNT2], a
ld c, a
ld a, [$ff8d]
and a
@@ -105,7 +105,7 @@
ld e, l
.asm_6a2f
xor a
- ld [H_AUTOBGTRANSFERENABLED], a ; $ffba
+ ld [H_AUTOBGTRANSFERENABLED], a
ld a, [$ff8d]
and a
jr nz, .asm_6a3c
@@ -128,9 +128,9 @@
ld [hl], a
.asm_6a4a
ld a, $1
- ld [H_AUTOBGTRANSFERENABLED], a ; $ffba
+ ld [H_AUTOBGTRANSFERENABLED], a
call Delay3
- ld a, [H_DOWNARROWBLINKCNT2] ; $ff8c
+ ld a, [H_DOWNARROWBLINKCNT2]
ld c, a
ld h, d
ld l, e
@@ -144,9 +144,9 @@
.asm_6a5f
ld d, h
ld e, l
- ld a, [H_DOWNARROWBLINKCNT1] ; $ff8b
+ ld a, [H_DOWNARROWBLINKCNT1]
dec a
- ld [H_DOWNARROWBLINKCNT1], a ; $ff8b
+ ld [H_DOWNARROWBLINKCNT1], a
jr nz, .asm_6a2f
pop bc
pop de
@@ -160,7 +160,7 @@
ld c, $9
call TextBoxBorder
hlCoord 3, 0
- ld de, .namestring ; $6aa3
+ ld de, .namestring
call PlaceString
pop de
hlCoord 2, 2
@@ -167,15 +167,15 @@
call PlaceString
call UpdateSprites
xor a
- ld [wCurrentMenuItem], a ; wCurrentMenuItem
- ld [wLastMenuItem], a ; wLastMenuItem
+ ld [wCurrentMenuItem], a
+ ld [wLastMenuItem], a
inc a
- ld [wTopMenuItemX], a ; wTopMenuItemX
- ld [wMenuWatchedKeys], a ; wMenuWatchedKeys
+ ld [wTopMenuItemX], a
+ ld [wMenuWatchedKeys], a
inc a
- ld [wTopMenuItemY], a ; wTopMenuItemY
+ ld [wTopMenuItemY], a
inc a
- ld [wMaxMenuItem], a ; wMaxMenuItem
+ ld [wMaxMenuItem], a
jp HandleMenuInput
.namestring ; 6aa3 (1:6aa3)
--- a/engine/overworld/cable_club_npc.asm
+++ b/engine/overworld/cable_club_npc.asm
@@ -5,7 +5,7 @@
bit 5, a ; received pokedex?
jp nz, .receivedPokedex
; if the player hasn't received the pokedex
- ld c, $3c
+ ld c, 60
call DelayFrames
ld hl, CableClubNPCMakingPreparationsText
call PrintText
@@ -72,24 +72,24 @@
ld hl, wUnknownSerialCounter
ld a, [hli]
inc a
- jr nz, Func_72a8 ; 0x726b $3b
+ jr nz, Func_72a8
ld a, [hl]
inc a
- jr nz, Func_72a8 ; 0x726f $37
+ jr nz, Func_72a8
ld b, $a
.asm_7273
call DelayFrame
call Serial_SendZeroByte
dec b
- jr nz, .asm_7273 ; 0x727a $f7
+ jr nz, .asm_7273
call CloseLinkConnection
ld hl, CableClubNPCLinkClosedBecauseOfInactivityText
call PrintText
- jr Func_7298 ; 0x7285 $11
+ jr Func_7298
.failedToEstablishConnection
ld hl, CableClubNPCAreaReservedFor2FriendsLinkedByCableText
call PrintText
- jr Func_7298 ; 0x728d $9
+ jr Func_7298
.choseNo
call CloseLinkConnection
ld hl, CableClubNPCPleaseComeAgainText
--- a/engine/overworld/cinnabar_lab.asm
+++ b/engine/overworld/cinnabar_lab.asm
@@ -2,16 +2,16 @@
ld hl, wd730
set 6, [hl]
xor a
- ld [wCurrentMenuItem], a ; wCurrentMenuItem
+ ld [wCurrentMenuItem], a
ld a, $3
- ld [wMenuWatchedKeys], a ; wMenuWatchedKeys
+ ld [wMenuWatchedKeys], a
ld a, [wcd37]
dec a
- ld [wMaxMenuItem], a ; wMaxMenuItem
+ ld [wMaxMenuItem], a
ld a, $2
- ld [wTopMenuItemY], a ; wTopMenuItemY
+ ld [wTopMenuItemY], a
ld a, $1
- ld [wTopMenuItemX], a ; wTopMenuItemX
+ ld [wTopMenuItemX], a
ld a, [wcd37]
dec a
ld bc, $2
@@ -30,7 +30,7 @@
bit 1, a
jr nz, .asm_610a7
ld hl, wcc5b
- ld a, [wCurrentMenuItem] ; wCurrentMenuItem
+ ld a, [wCurrentMenuItem]
ld d, $0
ld e, a
add hl, de
@@ -55,7 +55,7 @@
ld hl, LabFossil_610ae
call PrintText
call YesNoChoice
- ld a, [wCurrentMenuItem] ; wCurrentMenuItem
+ ld a, [wCurrentMenuItem]
and a
jr nz, .asm_610a7
ld hl, LabFossil_610b3
--- a/engine/overworld/cut.asm
+++ b/engine/overworld/cut.asm
@@ -1,7 +1,7 @@
UsedCut: ; ef54 (3:6f54)
xor a
ld [wcd6a], a
- ld a, [W_CURMAPTILESET] ; W_CURMAPTILESET
+ ld a, [W_CURMAPTILESET]
and a ; OVERWORLD
jr z, .asm_ef6b
cp GYM
@@ -9,28 +9,28 @@
ld a, [wTileInFrontOfPlayer]
cp $50 ; gym cut tree
jr nz, .asm_ef77
- jr asm_ef82
+ jr .asm_ef82
.asm_ef6b
dec a
ld a, [wTileInFrontOfPlayer]
cp $3d ; cut tree
- jr z, asm_ef82
+ jr z, .asm_ef82
cp $52 ; grass
- jr z, asm_ef82
+ jr z, .asm_ef82
.asm_ef77
- ld hl, NothingToCutText
+ ld hl, .NothingToCutText
jp PrintText
-NothingToCutText: ; ef7d (3:6f7d)
+.NothingToCutText
TX_FAR _NothingToCutText
db "@"
-asm_ef82: ; ef82 (3:6f82)
+.asm_ef82
ld [wcd4d], a
ld a, $1
ld [wcd6a], a
- ld a, [wWhichPokemon] ; wWhichPokemon
- ld hl, wPartyMonNicks ; wPartyMonNicks
+ ld a, [wWhichPokemon]
+ ld hl, wPartyMonNicks
call GetPartyMonName
ld hl, wd730
set 6, [hl]
@@ -54,7 +54,7 @@
ld a, $ff
ld [wUpdateSpritesEnabled], a
call AnimateCutTree
- ld de, CutTreeBlockSwaps ; $7100
+ ld de, CutTreeBlockSwaps
call Func_f09f
call RedrawMapView
callba Func_79e96
@@ -75,15 +75,15 @@
xor a
ld [wcd50], a
ld a, $e4
- ld [rOBP1], a ; $ff49
+ ld [rOBP1], a
ld a, [wcd4d]
cp $52
jr z, .asm_f020
- ld de, Overworld_GFX + $2d0 ; $42d0 ; cuttable tree sprite top row
+ ld de, Overworld_GFX + $2d0 ; cuttable tree sprite top row
ld hl, vChars1 + $7c0
ld bc, (BANK(Overworld_GFX) << 8) + $02
call CopyVideoData
- ld de, Overworld_GFX + $3d0 ; $43d0 ; cuttable tree sprite bottom row
+ ld de, Overworld_GFX + $3d0 ; cuttable tree sprite bottom row
ld hl, vChars1 + $7e0
ld bc, (BANK(Overworld_GFX) << 8) + $02
call CopyVideoData
@@ -111,7 +111,7 @@
ret
LoadCutTreeAnimationTilePattern: ; f04c (3:704c)
- ld de, AnimationTileset2 + $60 ; $474e ; tile depicting a leaf
+ ld de, AnimationTileset2 + $60 ; tile depicting a leaf
ld bc, (BANK(AnimationTileset2) << 8) + $01
jp CopyVideoData
@@ -173,7 +173,7 @@
Func_f09f: ; f09f (3:709f)
push de
- ld a, [W_CURMAPWIDTH] ; wd369
+ ld a, [W_CURMAPWIDTH]
add $6
ld c, a
ld b, $0
@@ -190,22 +190,22 @@
jr z, .asm_f0cf
cp $8
jr z, .asm_f0d7
- ld a, [W_XBLOCKCOORD] ; wd364
+ ld a, [W_XBLOCKCOORD]
and a
jr z, .asm_f0e0
jr .asm_f0ec
.asm_f0c7
- ld a, [W_YBLOCKCOORD] ; wd363
+ ld a, [W_YBLOCKCOORD]
and a
jr z, .asm_f0e0
jr .asm_f0df
.asm_f0cf
- ld a, [W_YBLOCKCOORD] ; wd363
+ ld a, [W_YBLOCKCOORD]
and a
jr z, .asm_f0e1
jr .asm_f0e0
.asm_f0d7
- ld a, [W_XBLOCKCOORD] ; wd364
+ ld a, [W_XBLOCKCOORD]
and a
jr z, .asm_f0e6
jr .asm_f0e0
--- a/engine/overworld/cut2.asm
+++ b/engine/overworld/cut2.asm
@@ -15,9 +15,9 @@
ld [wd08a], a
ld c, $2
call AdjustOAMBlockXPos2
- ld a, [rOBP1] ; $ff49
+ ld a, [rOBP1]
xor $64
- ld [rOBP1], a ; $ff49
+ ld [rOBP1], a
call DelayFrame
pop bc
dec c
@@ -65,9 +65,9 @@
ld [wd08a], a
ld c, $1
call AdjustOAMBlockXPos2
- ld a, [rOBP1] ; $ff49
+ ld a, [rOBP1]
xor $64
- ld [rOBP1], a ; $ff49
+ ld [rOBP1], a
call DelayFrame
pop bc
dec c
--- a/engine/overworld/doors.asm
+++ b/engine/overworld/doors.asm
@@ -1,8 +1,8 @@
; returns whether the player is standing on a door tile in carry
IsPlayerStandingOnDoorTile: ; 1a609 (6:6609)
push de
- ld hl, DoorTileIDPointers ; $662c
- ld a, [W_CURMAPTILESET] ; W_CURMAPTILESET
+ ld hl, DoorTileIDPointers
+ ld a, [W_CURMAPTILESET]
ld de, $3
call IsInArray
pop de
--- a/engine/overworld/elevator.asm
+++ b/engine/overworld/elevator.asm
@@ -10,7 +10,7 @@
ld d, a
ld e, $1
; number of times to play collision sfx
- ld b, $64
+ ld b, 100
.asm_7bf30
ld a, e
xor $fe
@@ -22,7 +22,7 @@
ld a, (SFX_02_5b - SFX_Headers_02) / 3
call PlayMusic
pop bc
- ld c, $2
+ ld c, 2
call DelayFrames
dec b
jr nz, .asm_7bf30
--- a/engine/overworld/emotion_bubbles.asm
+++ b/engine/overworld/emotion_bubbles.asm
@@ -2,7 +2,7 @@
ld a, [wcd50]
ld c, a
ld b, $0
- ld hl, EmotionBubblesPointerTable ; $7caf
+ ld hl, EmotionBubblesPointerTable
add hl, bc
add hl, bc
ld e, [hl]
@@ -45,10 +45,10 @@
ld a, [hl]
add $8
ld c, a
- ld de, EmotionBubblesOAM ; $7cb5
+ ld de, EmotionBubblesOAM
xor a
call WriteOAMBlock
- ld c, $3c
+ ld c, 60
call DelayFrames
pop af
ld [wUpdateSpritesEnabled], a
--- a/engine/overworld/healing_machine.asm
+++ b/engine/overworld/healing_machine.asm
@@ -1,5 +1,5 @@
AnimateHealingMachine: ; 70433 (1c:4433)
- ld de, PokeCenterFlashingMonitorAndHealBall ; $44b7
+ ld de, PokeCenterFlashingMonitorAndHealBall
ld hl, vChars0 + $7c0
ld bc, (BANK(PokeCenterFlashingMonitorAndHealBall) << 8) + $03
call CopyVideoData
@@ -8,12 +8,12 @@
push af
ld [hl], $ff
push hl
- ld a, [rOBP1] ; $ff49
+ ld a, [rOBP1]
push af
ld a, $e0
- ld [rOBP1], a ; $ff49
+ ld [rOBP1], a
ld hl, wOAMBuffer + $84
- ld de, PokeCenterOAMData ; $44d7
+ ld de, PokeCenterOAMData
call Func_70503
ld a, $4
ld [wMusicHeaderPointer], a
@@ -24,13 +24,13 @@
ld a, [wMusicHeaderPointer]
and a
jr nz, .asm_70464
- ld a, [wPartyCount] ; wPartyCount
+ ld a, [wPartyCount]
ld b, a
.asm_7046e
call Func_70503
ld a, (SFX_02_4a - SFX_Headers_02) / 3
call PlaySound
- ld c, $1e
+ ld c, 30
call DelayFrames
dec b
jr nz, .asm_7046e
@@ -53,10 +53,10 @@
ld a, [wc026]
cp MUSIC_PKMN_HEALED
jr z, .asm_704a2
- ld c, $20
+ ld c, 32
call DelayFrames
pop af
- ld [rOBP1], a ; $ff49
+ ld [rOBP1], a
pop hl
pop af
ld [hl], a
--- a/engine/overworld/hidden_items.asm
+++ b/engine/overworld/hidden_items.asm
@@ -22,7 +22,6 @@
INCLUDE "data/hidden_item_coords.asm"
FoundHiddenItemText: ; 7675b (1d:675b)
-; XXX where is the pointer to this?
TX_FAR _FoundHiddenItemText
db $8
ld a, [wWhichTrade] ; item ID
@@ -36,8 +35,8 @@
ld b, $1
predef FlagActionPredef
ld a, (SFX_02_3b - SFX_Headers_02) / 3
- call PlaySoundWaitForCurrent ; play sound
- call WaitForSoundToFinish ; wait for sound to finish playing
+ call PlaySoundWaitForCurrent
+ call WaitForSoundToFinish
jp TextScriptEnd
.BagFull
call WaitForTextScrollButtonPress ; wait for button press
@@ -146,10 +145,10 @@
cp $ff ; end of the list?
ret z ; if so, we're done here
cp b
- jr nz, .asm_76877 ; 0x7686b $a
+ jr nz, .asm_76877
ld a, [hli]
cp d
- jr nz, .asm_76878 ; 0x7686f $7
+ jr nz, .asm_76878
ld a, [hli]
cp e
jr nz, .loop
--- a/engine/overworld/item.asm
+++ b/engine/overworld/item.asm
@@ -1,7 +1,7 @@
PickupItem:
call EnableAutoTextBoxDrawing
- ld a, [H_DOWNARROWBLINKCNT2] ; $ff8c
+ ld a, [H_DOWNARROWBLINKCNT2]
ld b, a
ld hl, W_MISSABLEOBJECTLIST
.missableObjectsListLoop
@@ -18,7 +18,7 @@
ld [$ffdb], a
ld hl, W_MAPSPRITEEXTRADATA
- ld a, [H_DOWNARROWBLINKCNT2] ; $ff8c
+ ld a, [H_DOWNARROWBLINKCNT2]
dec a
add a
ld d, 0
--- a/engine/overworld/ledges.asm
+++ b/engine/overworld/ledges.asm
@@ -2,7 +2,7 @@
ld a, [wd736]
bit 6, a ; already jumping down ledge
ret nz
- ld a, [W_CURMAPTILESET] ; W_CURMAPTILESET
+ ld a, [W_CURMAPTILESET]
and a ; OVERWORLD
ret nz
predef GetTileAndCoordsInFrontOfPlayer
--- a/engine/overworld/movement.asm
+++ b/engine/overworld/movement.asm
@@ -22,7 +22,7 @@
.lowerLeftTileIsMapTile
call DetectCollisionBetweenSprites
ld h, $c1
- ld a, [wWalkCounter] ; wcfc5
+ ld a, [wWalkCounter]
and a
jr nz, .asm_4e90
ld a, [wd528]
@@ -108,7 +108,7 @@
swap a
dec a
add a
- ld hl, W_MAPSPRITEDATA ; wd4e4
+ ld hl, W_MAPSPRITEDATA
add l
ld l, a
ld a, [hl] ; read movement byte 2
@@ -138,7 +138,7 @@
jp z, UpdateSpriteMovementDelay ; c1x1 == 2
cp $3
jp z, UpdateSpriteInWalkingAnimation ; c1x1 == 3
- ld a, [wWalkCounter] ; wcfc5
+ ld a, [wWalkCounter]
and a
ret nz ; don't do anything yet if player is currently moving (redundant, already tested in CheckSpriteAvailability)
call InitializeSpriteScreenPosition
@@ -212,7 +212,7 @@
cp $2
jr z, .moveRight ; movement byte 2 = $2 only allows left or right
.moveUp
- ld de, -2*20 ; $ffd8
+ ld de, -2*20
add hl, de ; move tile pointer two rows up
ld de, $ff00
ld bc, $804
@@ -440,7 +440,7 @@
ld a, [H_CURRENTSPRITEOFFSET]
add $4
ld l, a
- ld a, [W_YCOORD] ; wd361
+ ld a, [W_YCOORD]
ld b, a
ld a, [hl] ; c2x4 (Y position + 4)
sub b ; relative to player position
@@ -449,7 +449,7 @@
dec h
ld [hli], a ; c1x4 (screen Y position)
inc h
- ld a, [W_XCOORD] ; wd362
+ ld a, [W_XCOORD]
ld b, a
ld a, [hli] ; c2x6 (X position + 4)
sub b ; relative to player position
@@ -475,7 +475,7 @@
add $4
ld l, a
ld b, [hl] ; c2x4: Y pos (+4)
- ld a, [W_YCOORD] ; wd361
+ ld a, [W_YCOORD]
cp b
jr z, .skipYVisibilityTest
jr nc, .spriteInvisible ; above screen region
@@ -485,7 +485,7 @@
.skipYVisibilityTest
inc l
ld b, [hl] ; c2x5: X pos (+4)
- ld a, [W_XCOORD] ; wd362
+ ld a, [W_XCOORD]
cp b
jr z, .skipXVisibilityTest
jr nc, .spriteInvisible ; left of screen region
@@ -503,7 +503,7 @@
ld a, [hld]
cp d
jr nc, .spriteInvisible ; standing on tile with ID >=$60 (bottom right tile)
- ld bc, -20 ; $ffec
+ ld bc, -20
add hl, bc ; go back one row of tiles
ld a, [hli]
cp d
@@ -521,7 +521,7 @@
jr .done
.spriteVisible
ld c, a
- ld a, [wWalkCounter] ; wcfc5
+ ld a, [wWalkCounter]
and a
jr nz, .done ; if player is currently walking, we're done
call UpdateSpriteImage
--- a/engine/overworld/npc_movement.asm
+++ b/engine/overworld/npc_movement.asm
@@ -52,7 +52,7 @@
dw Func_1a4f4
Func_1a44c: ; 1a44c (6:644c)
- ld a, [W_XCOORD] ; wd362
+ ld a, [W_XCOORD]
sub $a
ld [wcca1], a
jr z, .asm_1a475
@@ -63,7 +63,7 @@
call FillMemory
ld [hl], $ff
ld a, [wSpriteIndex]
- ld [H_DOWNARROWBLINKCNT2], a ; $ff8c
+ ld [H_DOWNARROWBLINKCNT2], a
ld de, wNPCMovementDirections2
call MoveSprite
ld a, $1
--- a/engine/overworld/oaks_aide.asm
+++ b/engine/overworld/oaks_aide.asm
@@ -1,10 +1,10 @@
-OaksAideScript ; 0x59035
+OaksAideScript: ; 0x59035
ld hl, OaksAideHiText
call PrintText
call YesNoChoice
ld a, [wCurrentMenuItem]
and a
- jr nz, .asm_59086 ; 0x59042 $42
+ jr nz, .asm_59086
ld hl, wPokedexOwned
ld b, wPokedexOwnedEnd - wPokedexOwned
call CountSetBits
@@ -13,8 +13,8 @@
ld b, a
ld a, [$ffdb]
cp b
- jr z, .asm_59059 ; 0x59055 $2
- jr nc, .asm_5907c ; 0x59057 $23
+ jr z, .asm_59059
+ jr nc, .asm_5907c
.asm_59059
ld hl, OaksAideHereYouGoText
call PrintText
@@ -26,17 +26,17 @@
ld hl, OaksAideGotItemText
call PrintText
ld a, $1
- jr .asm_5908e ; 0x59071 $1b
+ jr .asm_5908e
.BagFull
ld hl, OaksAideNoRoomText
call PrintText
xor a
- jr .asm_5908e ; 0x5907a $12
+ jr .asm_5908e
.asm_5907c
ld hl, OaksAideUhOhText
call PrintText
ld a, $80
- jr .asm_5908e ; 0x59084 $8
+ jr .asm_5908e
.asm_59086
ld hl, OaksAideComeBackText
call PrintText
--- a/engine/overworld/player_animations.asm
+++ b/engine/overworld/player_animations.asm
@@ -58,7 +58,7 @@
ld a, 12
ld [hli], a ; wFlyAnimCounter
ld [hl], $8 ; wFlyAnimBirdSpriteImageIndex (facing right)
- ld de, FlyAnimationEnterScreenCoords ; $4592
+ ld de, FlyAnimationEnterScreenCoords
call DoFlyAnimation
call LoadPlayerSpriteGraphics
jr .restoreDefaultMusic
@@ -154,7 +154,7 @@
ld a, $c
ld [hli], a ; wFlyAnimCounter
ld [hl], $c ; wFlyAnimBirdSpriteImageIndex (facing right)
- ld de, FlyAnimationScreenCoords1 ; $464f
+ ld de, FlyAnimationScreenCoords1
call DoFlyAnimation
ld c, 40
call DelayFrames
@@ -162,7 +162,7 @@
ld a, 11
ld [hli], a ; wFlyAnimCounter
ld [hl], $8 ; wFlyAnimBirdSpriteImageIndex (facing left)
- ld de, FlyAnimationScreenCoords2 ; $4667
+ ld de, FlyAnimationScreenCoords2
call DoFlyAnimation
call GBFadeOutToWhite
jp RestoreFacingDirectionAndYScreenPos
@@ -248,11 +248,11 @@
ret
LoadBirdSpriteGraphics: ; 706d7 (1c:46d7)
- ld de, BirdSprite ; $4d80
+ ld de, BirdSprite
ld hl, vNPCSprites
ld bc, (BANK(BirdSprite) << 8) + $0c
call CopyVideoData
- ld de, BirdSprite + $c0 ; $4e40 ; moving amination sprite
+ ld de, BirdSprite + $c0 ; moving amination sprite
ld hl, vNPCSprites2
ld bc, (BANK(BirdSprite) << 8) + $0c
jp CopyVideoData
@@ -379,28 +379,28 @@
db $FF
Func_707b6: ; 707b6 (1c:47b6)
- ld c, $a
+ ld c, 10
call DelayFrames
ld hl, wd736
set 6, [hl]
- ld de, RedSprite ; $4180
+ ld de, RedSprite
ld hl, vNPCSprites
ld bc, (BANK(RedSprite) << 8) + $0c
call CopyVideoData
ld a, $4
- ld hl, RedFishingTiles ; $4866
+ ld hl, RedFishingTiles
call LoadAnimSpriteGfx
ld a, [wSpriteStateData1 + 2]
ld c, a
ld b, $0
- ld hl, FishingRodGfxProperties ; $4856
+ ld hl, FishingRodGfxProperties
add hl, bc
ld de, wOAMBuffer + $9c
ld bc, $4
call CopyData
- ld c, $64
+ ld c, 100
call DelayFrames
- ld a, [wWhichTrade] ; wWhichTrade
+ ld a, [wWhichTrade]
and a
ld hl, NoNibbleText
jr z, .asm_70836
--- a/engine/overworld/pokecenter.asm
+++ b/engine/overworld/pokecenter.asm
@@ -43,7 +43,7 @@
.done
ld hl, PokemonCenterFarewellText
call PrintText
- jp UpdateSprites ; move sprites
+ jp UpdateSprites
PokemonCenterWelcomeText: ; 705d (1:705d)
TX_FAR _PokemonCenterWelcomeText
--- a/engine/overworld/pokemart.asm
+++ b/engine/overworld/pokemart.asm
@@ -1,7 +1,7 @@
DisplayPokemartDialogue_: ; 6c20 (1:6c20)
ld a,[wListScrollOffset]
ld [wd07e],a
- call UpdateSprites ; move sprites
+ call UpdateSprites
xor a
ld [wcf0a],a ; flag that is set if something is sold or bought
.loop
@@ -36,7 +36,7 @@
ld [wcf93],a
ld a,$02
ld [wd11b],a
- callab Func_39bd5
+ callab InitList
ld a,[wNumBagItems]
and a
jp z,.bagEmpty
@@ -113,7 +113,7 @@
ld [wcf93],a
ld a,$03
ld [wd11b],a
- callab Func_39bd5
+ callab InitList
ld hl,PokemartBuyingGreetingText
call PrintText
call SaveScreenTilesToBuffer1 ; save screen
@@ -204,7 +204,7 @@
call PrintText
ld a,$01
ld [wUpdateSpritesEnabled],a
- call UpdateSprites ; move sprites
+ call UpdateSprites
ld a,[wd07e]
ld [wListScrollOffset],a
ret
--- a/engine/overworld/ssanne.asm
+++ b/engine/overworld/ssanne.asm
@@ -84,7 +84,7 @@
ret
LoadSmokeTile: ; 79fd4 (1e:5fd4)
- ld de, SSAnneSmokePuffTile ; $5fdd
+ ld de, SSAnneSmokePuffTile
ld bc, (BANK(SSAnneSmokePuffTile) << 8) + $01
jp CopyVideoData
--- a/engine/overworld/trainers.asm
+++ b/engine/overworld/trainers.asm
@@ -77,7 +77,7 @@
TrainerWalkUpToPlayer: ; 56881 (15:6881)
ld a, [wSpriteIndex]
swap a
- ld [wTrainerSpriteOffset], a ; wWhichTrade
+ ld [wTrainerSpriteOffset], a
call ReadTrainerScreenPosition
ld a, [wTrainerFacingDirection]
and a
@@ -164,7 +164,7 @@
TrainerEngage: ; 5690f (15:690f)
push hl
push de
- ld a, [wTrainerSpriteOffset] ; wWhichTrade
+ ld a, [wTrainerSpriteOffset]
add $2
ld d, $0
ld e, a
@@ -175,7 +175,7 @@
jr nz, .spriteOnScreen ; test if sprite is on screen
jp .noEngage
.spriteOnScreen
- ld a, [wTrainerSpriteOffset] ; wWhichTrade
+ ld a, [wTrainerSpriteOffset]
add $9
ld d, $0
ld e, a
@@ -218,7 +218,7 @@
jp .noEngage
.engage
call CheckPlayerIsInFrontOfSprite
- ld a, [wTrainerSpriteOffset] ; wWhichTrade
+ ld a, [wTrainerSpriteOffset]
and a
jr z, .noEngage
ld hl, wFlags_0xcd60
@@ -226,7 +226,7 @@
call EngageMapTrainer
ld a, $ff
.noEngage: ; 56988 (15:6988)
- ld [wTrainerSpriteOffset], a ; wWhichTrade
+ ld [wTrainerSpriteOffset], a
pop de
pop hl
ret
@@ -233,7 +233,7 @@
; reads trainer's Y position to wTrainerScreenY and X position to wTrainerScreenX
ReadTrainerScreenPosition: ; 5698e (15:698e)
- ld a, [wTrainerSpriteOffset] ; wWhichTrade
+ ld a, [wTrainerSpriteOffset]
add $4
ld d, $0
ld e, a
@@ -241,7 +241,7 @@
add hl, de
ld a, [hl]
ld [wTrainerScreenY], a
- ld a, [wTrainerSpriteOffset] ; wWhichTrade
+ ld a, [wTrainerSpriteOffset]
add $6
ld d, $0
ld e, a
@@ -291,10 +291,10 @@
; tests if the player is in front of the sprite (rather than behind it)
CheckPlayerIsInFrontOfSprite: ; 569e3 (15:69e3)
- ld a, [W_CURMAP] ; W_CURMAP
+ ld a, [W_CURMAP]
cp POWER_PLANT
- jp z, .engage ; XXX not sure why bypass this for power plant (maybe to get voltorb fake items to work?)
- ld a, [wTrainerSpriteOffset] ; wWhichTrade
+ jp z, .engage ; bypass this for power plant to get voltorb fake items to work
+ ld a, [wTrainerSpriteOffset]
add $4
ld d, $0
ld e, a
@@ -306,7 +306,7 @@
ld a, $c
.notOnTopmostTile
ld [wTrainerScreenY], a
- ld a, [wTrainerSpriteOffset] ; wWhichTrade
+ ld a, [wTrainerSpriteOffset]
add $6
ld d, $0
ld e, a
@@ -345,5 +345,5 @@
.noEngage
xor a
.done
- ld [wTrainerSpriteOffset], a ; wWhichTrade
+ ld [wTrainerSpriteOffset], a
ret
--- a/engine/palettes.asm
+++ b/engine/palettes.asm
@@ -280,7 +280,7 @@
ret
SendBlkPacket_PartyMenu: ; 71fb6 (1c:5fb6)
- ld hl, BlkPacket_PartyMenu ; $62f4
+ ld hl, BlkPacket_PartyMenu
ld de, wcf2e
ld bc, $30
jp CopyData
@@ -501,7 +501,7 @@
push de
call DisableLCD
ld a, $e4
- ld [rBGP], a ; $ff47
+ ld [rBGP], a
ld de, vChars1
ld a, [wcf2d]
and a
@@ -527,11 +527,11 @@
dec c
jr nz, .asm_72132
ld a, $e3
- ld [rLCDC], a ; $ff40
+ ld [rLCDC], a
pop hl
call SendSGBPacket
xor a
- ld [rBGP], a ; $ff47
+ ld [rBGP], a
ei
ret
--- a/engine/pokedex_rating.asm
+++ b/engine/pokedex_rating.asm
@@ -33,7 +33,7 @@
call PrintText
pop hl
call PrintText
- callba Func_7d13b
+ callba PlayPokedexRatingSfx
jp WaitForTextScrollButtonPress ; wait for button press
.label3
ld de, wcc5b
--- a/engine/predefs.asm
+++ b/engine/predefs.asm
@@ -53,11 +53,11 @@
; these are pointers to ASM routines.
; they appear to be used in overworld map scripts.
add_predef DrawPlayerHUDAndHPBar
- add_predef Func_3f0c6
- add_predef Func_3f073
+ add_predef CopyUncompressedPicToTilemap
+ add_predef AnimateSendingOutMon
add_predef ScaleSpriteByTwo
add_predef LoadMonBackPic
- add_predef Func_79aba
+ add_predef CopyGrowingMonTiles
add_predef LoadMissableObjects
add_predef HealParty
add_predef MoveAnimation; 08 play move animation
@@ -103,7 +103,7 @@
add_predef BattleTransition
add_predef CopyTileIDsFromList
add_predef PlayIntro
- add_predef Func_79869
+ add_predef GetMoveSoundB
add_predef FlashScreen
add_predef GetTileAndCoordsInFrontOfPlayer
add_predef StatusScreen
--- a/engine/predefs12.asm
+++ b/engine/predefs12.asm
@@ -4,7 +4,7 @@
ld a, [rBGP]
or b
ld [rBGP], a
- ld c, $4
+ ld c, 4
call DelayFrames
ld a, [rBGP]
and %11111100
@@ -17,7 +17,7 @@
ld [wd0a0], a
xor a
.asm_48108
- ld [H_NUMTOPRINT], a ; $ff96 (aliases: H_MULTIPLICAND)
+ ld [H_NUMTOPRINT], a ; (aliases: H_MULTIPLICAND)
call Func_48119
call Func_48119
dec b
@@ -28,11 +28,11 @@
ret
Func_48119: ; 48119 (12:4119)
- ld a, [H_NUMTOPRINT] ; $ff96 (aliases: H_MULTIPLICAND)
+ ld a, [H_NUMTOPRINT] ; (aliases: H_MULTIPLICAND)
xor b
- ld [H_NUMTOPRINT], a ; $ff96 (aliases: H_MULTIPLICAND)
- ld [rWY], a ; $ff4a
- ld c, $3
+ ld [H_NUMTOPRINT], a ; (aliases: H_MULTIPLICAND)
+ ld [rWY], a
+ ld c, 3
jp DelayFrames
Func_48125: ; 48125 (12:4125)
@@ -41,7 +41,7 @@
.asm_48129
ld [$ff97], a
call Func_4813f
- ld c, $1
+ ld c, 1
call DelayFrames
call Func_4813f
dec b
@@ -48,7 +48,7 @@
ld a, b
jr nz, .asm_48129
ld a, $7
- ld [rWX], a ; $ff4b
+ ld [rWX], a
ret
Func_4813f: ; 4813f (12:413f)
@@ -60,6 +60,6 @@
xor a
.asm_48149
add $7
- ld [rWX], a ; $ff4b
- ld c, $4
+ ld [rWX], a
+ ld c, 4
jp DelayFrames
--- a/engine/predefs17.asm
+++ b/engine/predefs17.asm
@@ -2,8 +2,8 @@
; so that the full Pokedex information gets displayed in Oak's lab
StarterDex: ; 5c0dc (17:40dc)
ld a, %01001011 ; set starter flags
- ld [wPokedexOwned], a ; wPokedexOwned
+ ld [wPokedexOwned], a
predef ShowPokedexData
xor a ; unset starter flags
- ld [wPokedexOwned], a ; wPokedexOwned
+ ld [wPokedexOwned], a
ret
--- a/engine/save.asm
+++ b/engine/save.asm
@@ -18,7 +18,7 @@
set 6, [hl]
ld hl, FileDataDestroyedText
call PrintText
- ld c, $64
+ ld c, 100
call DelayFrames
pop hl
res 6, [hl]
@@ -54,7 +54,7 @@
.Func_73652 ; 73652 (1c:7652)
ld hl, $a598
- ld de, wPlayerName ; wd158
+ ld de, wPlayerName
ld bc, $b
call CopyData
ld hl, $a5a3
@@ -110,11 +110,11 @@
cp c
jp nz, SAVBadCheckSum
ld hl, $af2c
- ld de, wPartyCount ; wPartyCount
+ ld de, wPartyCount
ld bc, $194
call CopyData
ld hl, $a5a3
- ld de, wPokedexOwned ; wPokedexOwned
+ ld de, wPokedexOwned
ld bc, wPokedexSeenEnd - wPokedexOwned
call CopyData
and a
@@ -129,12 +129,12 @@
ld [MBC1SRamEnable], a
ret
-Func_73701: ; 0x73701
+Func_73701: ; 73701 (1c:7701)
call LoadSAVCheckSum
call LoadSAVCheckSum1
jp LoadSAVCheckSum2
-SaveSAV: ;$770a
+SaveSAV: ; 7370a (1c:770a)
callba PrintSaveScreenText
ld hl,WouldYouLikeToSaveText
call SaveSAVConfirm
@@ -149,8 +149,8 @@
call SaveSAVConfirm
and a
ret nz
-.save ;$772d
- call SaveSAVtoSRAM ;$7848
+.save
+ call SaveSAVtoSRAM
hlCoord 1, 13
ld bc,$0412
call ClearScreenArea ; clear area 4x12 starting at 13,1
@@ -157,7 +157,7 @@
hlCoord 1, 14
ld de,NowSavingString
call PlaceString
- ld c,$78
+ ld c,120
call DelayFrames
ld hl,GameSavedText
call PrintText
@@ -164,7 +164,7 @@
ld a, (SFX_02_5d - SFX_Headers_02) / 3 ;sound for saved game
call PlaySoundWaitForCurrent
call WaitForSoundToFinish
- ld c,$1e
+ ld c,30
jp DelayFrames
NowSavingString:
@@ -308,7 +308,7 @@
ret
Func_7387b: ; 7387b (1c:787b)
- ld hl, PointerTable_73895 ; $7895
+ ld hl, PointerTable_73895
ld a, [wd5a0]
and $7f
cp $6
@@ -411,21 +411,21 @@
Func_7393f: ; 7393f (1c:793f)
xor a
- ld [H_AUTOBGTRANSFERENABLED], a ; $ffba
+ ld [H_AUTOBGTRANSFERENABLED], a
ld a, $3
- ld [wMenuWatchedKeys], a ; wMenuWatchedKeys
+ ld [wMenuWatchedKeys], a
ld a, $b
- ld [wMaxMenuItem], a ; wMaxMenuItem
+ ld [wMaxMenuItem], a
ld a, $1
- ld [wTopMenuItemY], a ; wTopMenuItemY
+ ld [wTopMenuItemY], a
ld a, $c
- ld [wTopMenuItemX], a ; wTopMenuItemX
+ ld [wTopMenuItemX], a
xor a
ld [wcc37], a
ld a, [wd5a0]
and $7f
- ld [wCurrentMenuItem], a ; wCurrentMenuItem
- ld [wLastMenuItem], a ; wLastMenuItem
+ ld [wCurrentMenuItem], a
+ ld [wLastMenuItem], a
ld hl, wTileMap
ld b, $2
ld c, $9
@@ -438,7 +438,7 @@
call TextBoxBorder
ld hl, hFlags_0xFFF6
set 2, [hl]
- ld de, BoxNames ; $79d9
+ ld de, BoxNames
hlCoord 13, 1
call PlaceString
ld hl, hFlags_0xFFF6
@@ -461,7 +461,7 @@
call PlaceString
call Func_73a84
hlCoord 18, 1
- ld de, wWhichTrade ; wWhichTrade
+ ld de, wWhichTrade
ld bc, $14
ld a, $c
.asm_739c2
@@ -477,7 +477,7 @@
dec a
jr nz, .asm_739c2
ld a, $1
- ld [H_AUTOBGTRANSFERENABLED], a ; $ffba
+ ld [H_AUTOBGTRANSFERENABLED], a
ret
ChooseABoxText: ; 739d4 (1c:79d4)
@@ -545,7 +545,7 @@
ret
Func_73a84: ; 73a84 (1c:7a84)
- ld hl, wWhichTrade ; wWhichTrade
+ ld hl, wWhichTrade
push hl
ld a, SRAM_ENABLE
ld [MBC1SRamEnable], a
@@ -566,7 +566,7 @@
ld c, a
ld b, $0
add hl, bc
- ld a, [W_NUMINBOX] ; wda80
+ ld a, [W_NUMINBOX]
ld [hl], a
ret
@@ -585,7 +585,7 @@
ld [hli], a
ret
-SAVCheckRandomID: ;$7ad1
+SAVCheckRandomID: ; 73ad1 (1c:7ad1)
;checks if Sav file is the same by checking player's name 1st letter ($a598)
; and the two random numbers generated at game beginning
;(which are stored at wPlayerID)
@@ -646,7 +646,7 @@
LoadHallOfFameTeams: ; 73b3f (1c:7b3f)
ld hl, sHallOfFame
ld bc, HOF_TEAM
- ld a, [wWhichTrade] ; wWhichTrade
+ ld a, [wWhichTrade]
call AddNTimes
ld de, wcc5b
ld bc, HOF_TEAM
--- a/engine/slot_machine.asm
+++ b/engine/slot_machine.asm
@@ -128,7 +128,7 @@
jr nz, .skip2
ld hl, OutOfCoinsSlotMachineText
call PrintText
- ld c, $3c
+ ld c, 60
jp DelayFrames
.skip2
ld hl, OneMoreGoSlotMachineText
@@ -202,13 +202,13 @@
ret
SlotMachine_374ad: ; 374ad (d:74ad)
- ld c, $14
+ ld c, 20
.loop1
push bc
call SlotMachine_37813
call SlotMachine_37823
call SlotMachine_37833
- ld c, $2
+ ld c, 2
call DelayFrames
pop bc
dec c
@@ -437,7 +437,7 @@
ld a, [$ff47]
xor $40
ld [$ff47], a
- ld c, $5
+ ld c, 5
call DelayFrames
dec b
jr nz, .asm_37638
@@ -674,7 +674,7 @@
ld [W_SUBANIMTRANSFORM], a
ld a, [wTrainerScreenX]
cp $7
- ld c, $8
+ ld c, 8
jr nc, .skip2
srl c
.skip2
--- a/engine/titlescreen.asm
+++ b/engine/titlescreen.asm
@@ -5,10 +5,10 @@
SetDefaultNamesBeforeTitlescreen: ; 42b7 (1:42b7)
ld hl, NintenText
- ld de, wPlayerName ; wd158
+ ld de, wPlayerName
call CopyFixedLengthText
ld hl, SonyText
- ld de, W_RIVALNAME ; wd34a
+ ld de, W_RIVALNAME
call CopyFixedLengthText
xor a
ld [hWY], a
@@ -24,7 +24,7 @@
LoadTitlescreenGraphics: ; 42dd (1:42dd)
call GBPalWhiteOut
ld a, $1
- ld [H_AUTOBGTRANSFERENABLED], a ; $ffba
+ ld [H_AUTOBGTRANSFERENABLED], a
xor a
ld [hTilesetType], a
ld [hSCX], a
@@ -35,27 +35,27 @@
call ClearScreen
call DisableLCD
call LoadFontTilePatterns
- ld hl, NintendoCopyrightLogoGraphics ; $60c8
+ ld hl, NintendoCopyrightLogoGraphics
ld de, vTitleLogo2 + $100
ld bc, $50
ld a, BANK(NintendoCopyrightLogoGraphics)
call FarCopyData2
- ld hl, GamefreakLogoGraphics ; $61f8
+ ld hl, GamefreakLogoGraphics
ld de, vTitleLogo2 + $100 + $50
ld bc, $90
ld a, BANK(GamefreakLogoGraphics)
call FarCopyData2
- ld hl, PokemonLogoGraphics ; $5380
+ ld hl, PokemonLogoGraphics
ld de, vTitleLogo
ld bc, $600
ld a, BANK(PokemonLogoGraphics)
call FarCopyData2 ; first chunk
- ld hl, PokemonLogoGraphics+$600 ; $5980
+ ld hl, PokemonLogoGraphics+$600
ld de, vTitleLogo2
ld bc, $100
ld a, BANK(PokemonLogoGraphics)
call FarCopyData2 ; second chunk
- ld hl, Version_GFX ; $402f
+ ld hl, Version_GFX
IF DEF(_RED)
ld de,vChars2 + $600
ld bc,$50
@@ -97,7 +97,7 @@
ld a, $74
ld [hl], a
hlCoord 2, 17
- ld de, .titlescreenTilemap ; $437f
+ ld de, .titlescreenTilemap
ld b, $10
.asm_4377
ld a, [de]
@@ -121,7 +121,7 @@
ld a,SQUIRTLE ; which Pokemon to show first on the title screen
ENDC
- ld [wWhichTrade], a ; wWhichTrade
+ ld [wWhichTrade], a
call Func_4524
ld a, $9b
call Func_4533
@@ -135,9 +135,9 @@
call GoPAL_SET
call GBPalNormal
ld a, $e4
- ld [rOBP0], a ; $ff48
+ ld [rOBP0], a
ld bc, $ffaf ; background scroll Y
- ld hl, .TitleScreenPokemonLogoYScrolls ; $43db
+ ld hl, .TitleScreenPokemonLogoYScrolls
.asm_43c6
ld a, [hli]
and a
@@ -176,7 +176,7 @@
ret
.asm_43f4
call LoadScreenTilesFromBuffer1
- ld c, $24
+ ld c, 36
call DelayFrames
ld a, (SFX_1f_63 - SFX_Headers_1f) / 3
call PlaySound
@@ -219,7 +219,7 @@
call Func_4496
jr .asm_443b
.asm_4459
- ld a, [wWhichTrade] ; wWhichTrade
+ ld a, [wWhichTrade]
call PlayCry
call WaitForSoundToFinish
call GBPalWhiteOutWithDelay3
@@ -227,7 +227,7 @@
xor a
ld [hWY], a
inc a
- ld [H_AUTOBGTRANSFERENABLED], a ; $ffba
+ ld [H_AUTOBGTRANSFERENABLED], a
call ClearScreen
ld a, $98
call Func_4533
@@ -260,7 +260,7 @@
ld hl, TitleMons
add hl, bc
ld a, [hl]
- ld hl, wWhichTrade ; wWhichTrade
+ ld hl, wWhichTrade
; Can't be the same as before.
cp [hl]
@@ -289,7 +289,7 @@
jr nz, .wait
ld a, h
- ld [rSCX], a ; $ff43
+ ld [rSCX], a
.wait2
ld a, [$ff44] ; rLY
@@ -298,7 +298,7 @@
ret
Func_44dd: ; 44dd (1:44dd)
- ld hl, PlayerCharacterTitleGraphics ; $66a8
+ ld hl, PlayerCharacterTitleGraphics
ld de, vSprites
ld bc, $230
ld a, BANK(PlayerCharacterTitleGraphics)
@@ -305,7 +305,7 @@
call FarCopyData2
call ClearSprites
xor a
- ld [wWhichTrade], a ; wWhichTrade
+ ld [wWhichTrade], a
ld hl, wOAMBuffer
ld de, $605a
ld b, $7
@@ -319,10 +319,10 @@
ld [hli], a
add $8
ld e, a
- ld a, [wWhichTrade] ; wWhichTrade
+ ld a, [wWhichTrade]
ld [hli], a
inc a
- ld [wWhichTrade], a ; wWhichTrade
+ ld [wWhichTrade], a
inc hl
dec c
jr nz, .asm_44fd
@@ -358,12 +358,12 @@
call LoadTextBoxTilePatterns
LoadCopyrightTiles: ; 4541 (1:4541)
- ld de, NintendoCopyrightLogoGraphics ; $60c8
+ ld de, NintendoCopyrightLogoGraphics
ld hl, vChars2 + $600
ld bc, (BANK(NintendoCopyrightLogoGraphics) << 8) + $1c
call CopyVideoData
hlCoord 2, 7
- ld de, CopyrightTextString ; $4556
+ ld de, CopyrightTextString
jp PlaceString
CopyrightTextString: ; 4556 (1:4556)
--- a/engine/titlescreen2.asm
+++ b/engine/titlescreen2.asm
@@ -74,7 +74,7 @@
jr nz, .wait
ld a, h
- ld [rSCX], a ; $ff43
+ ld [rSCX], a
.wait2
ld a, [$ff44] ; rLY
@@ -89,7 +89,7 @@
Func_372ac: ; 372ac (d:72ac)
; Animate the TitleBall if a starter just got scrolled out.
- ld a, [wWhichTrade] ; wWhichTrade
+ ld a, [wWhichTrade]
cp STARTER1
jr z, .ok
cp STARTER2
--- a/engine/town_map.asm
+++ b/engine/town_map.asm
@@ -7,7 +7,7 @@
push hl
ld a, $1
ld [hJoy7], a
- ld a, [W_CURMAP] ; W_CURMAP
+ ld a, [W_CURMAP]
push af
ld b, $0
call Func_711c4
@@ -19,11 +19,11 @@
ld bc, $10
call CopyData
ld hl, vSprites + $40
- ld de, TownMapCursor ; $4f40
+ ld de, TownMapCursor
ld bc, (BANK(TownMapCursor) << 8) + $04
call CopyVideoDataDouble
xor a
- ld [wWhichTrade], a ; wWhichTrade
+ ld [wWhichTrade], a
pop af
jr Func_70e92
@@ -31,8 +31,8 @@
ld hl, wTileMap
ld bc, $114
call ClearScreenArea
- ld hl, TownMapOrder ; $4f11
- ld a, [wWhichTrade] ; wWhichTrade
+ ld hl, TownMapOrder
+ ld a, [wWhichTrade]
ld c, a
ld b, $0
add hl, bc
@@ -86,22 +86,22 @@
ld [hl], a
ret
.asm_70ef2
- ld a, [wWhichTrade] ; wWhichTrade
+ ld a, [wWhichTrade]
inc a
cp $2f
jr nz, .asm_70efb
xor a
.asm_70efb
- ld [wWhichTrade], a ; wWhichTrade
+ ld [wWhichTrade], a
jp Func_70e7e
.asm_70f01
- ld a, [wWhichTrade] ; wWhichTrade
+ ld a, [wWhichTrade]
dec a
cp $ff
jr nz, .asm_70f0b
ld a, $2e
.asm_70f0b
- ld [wWhichTrade], a ; wWhichTrade
+ ld [wWhichTrade], a
jp Func_70e7e
INCLUDE "data/town_map_order.asm"
@@ -139,11 +139,11 @@
call LoadTownMap
call LoadPlayerSpriteGraphics
call LoadFontTilePatterns
- ld de, BirdSprite ; $4d80
+ ld de, BirdSprite
ld hl, vSprites + $40
ld bc, (BANK(BirdSprite) << 8) + $0c
call CopyVideoData
- ld de, TownMapUpArrow ; $5093
+ ld de, TownMapUpArrow
ld hl, vChars1 + $6d0
ld bc, (BANK(TownMapUpArrow) << 8) + $01
call CopyVideoDataDouble
@@ -156,7 +156,7 @@
ld hl, wTileMap
ld de, ToText
call PlaceString
- ld a, [W_CURMAP] ; W_CURMAP
+ ld a, [W_CURMAP]
ld b, $0
call Func_711c4
ld hl, wTrainerEngageDistance
@@ -177,7 +177,7 @@
hlCoord 3, 0
ld de, wcd6d
call PlaceString
- ld c, $f
+ ld c, 15
call DelayFrames
hlCoord 18, 0
ld [hl], $ed
@@ -248,7 +248,7 @@
db "To@"
Func_71070: ; 71070 (1c:5070)
- ld hl, wWhichTrade ; wWhichTrade
+ ld hl, wWhichTrade
ld [hl], $ff
inc hl
ld a, [W_TOWNVISITEDFLAG]
@@ -283,18 +283,18 @@
ld c, $12
call TextBoxBorder
call DisableLCD
- ld hl, WorldMapTileGraphics ; $65a8
+ ld hl, WorldMapTileGraphics
ld de, vChars2 + $600
ld bc, $100
ld a, BANK(WorldMapTileGraphics)
call FarCopyData2
- ld hl, MonNestIcon ; $56be
+ ld hl, MonNestIcon
ld de, vSprites + $40
ld bc, $8
ld a, BANK(MonNestIcon)
call FarCopyDataDouble
ld hl, wTileMap
- ld de, CompressedMap ; $5100
+ ld de, CompressedMap
.asm_710d3
ld a, [de]
and a
@@ -401,7 +401,7 @@
call PlaceString
jr .asm_7123e
.asm_71236
- ld a, [W_CURMAP] ; W_CURMAP
+ ld a, [W_CURMAP]
ld b, $0
call Func_711c4
.asm_7123e
@@ -545,7 +545,7 @@
cp REDS_HOUSE_1F
jr c, .asm_71304
ld bc, $4
- ld hl, InternalMapEntries ; $5382
+ ld hl, InternalMapEntries
.asm_712fb
cp [hl]
jr c, .asm_71301
@@ -555,7 +555,7 @@
inc hl
jr .asm_7130d
.asm_71304
- ld hl, ExternalMapEntries ; $5313
+ ld hl, ExternalMapEntries
ld c, a
ld b, $0
add hl, bc
--- a/engine/trade.asm
+++ b/engine/trade.asm
@@ -662,7 +662,7 @@
.loop
call Trade_AddOffsetsToOAMCoords
call Trade_AnimCircledMon
- ld c, $8
+ ld c, 8
call DelayFrames
dec d
jr nz, .loop
--- a/home.asm
+++ b/home.asm
@@ -154,7 +154,7 @@
push af
ld a,[wPredefParentBank]
ld [H_LOADEDROMBANK],a
- ld [$2000],a
+ ld [MBC1RomBank],a
ld a,b
add a
add a
@@ -166,7 +166,7 @@
call CopyData
pop af
ld [H_LOADEDROMBANK],a
- ld [$2000],a
+ ld [MBC1RomBank],a
ret
@@ -258,7 +258,7 @@
jp Bankswitch
-Func_137a:: ; 137a (0:137a)
+OverwritewMoves:: ; 137a (0:137a)
; Write c to [wMoves + b]. Unused.
ld hl, wMoves
ld e, b
@@ -299,17 +299,17 @@
pop hl
ld a, [H_LOADEDROMBANK]
push af
- ld a, Bank(asm_3f0d0)
+ ld a, Bank(CopyUncompressedPicToHL)
ld [H_LOADEDROMBANK], a
- ld [$2000], a
+ ld [MBC1RomBank], a
xor a
ld [$ffe1], a
- call asm_3f0d0
+ call CopyUncompressedPicToHL
xor a
ld [W_SPRITEFLIPPED], a
pop af
ld [H_LOADEDROMBANK], a
- ld [$2000], a
+ ld [MBC1RomBank], a
ret
@@ -499,17 +499,17 @@
ld [hl],"T"
and a
ret
-PrintStatusConditionNotFainted ; 14f6
+PrintStatusConditionNotFainted: ; 14f6
ld a,[H_LOADEDROMBANK]
push af
ld a,BANK(PrintStatusAilment)
ld [H_LOADEDROMBANK],a
- ld [$2000],a
+ ld [MBC1RomBank],a
call PrintStatusAilment ; print status condition
pop bc
ld a,b
ld [H_LOADEDROMBANK],a
- ld [$2000],a
+ ld [MBC1RomBank],a
ret
; function to print pokemon level, leaving off the ":L" if the level is at least 100
@@ -544,8 +544,8 @@
ld b,$41 ; no leading zeroes, left-aligned, one byte
jp PrintNumber
-Func_152e:: ; 152e (0:152e)
-; Unused.
+GetwMoves:: ; 152e (0:152e)
+; Unused. Returns the move at index a from wMoves in a
ld hl,wMoves
ld c,a
ld b,0
@@ -561,7 +561,7 @@
push af
ld a,BANK(BaseStats)
ld [H_LOADEDROMBANK],a
- ld [$2000],a
+ ld [MBC1RomBank],a
push bc
push de
push hl
@@ -616,7 +616,7 @@
pop bc
pop af
ld [H_LOADEDROMBANK],a
- ld [$2000],a
+ ld [MBC1RomBank],a
ret
; copy party pokemon's name to wcd6d
@@ -800,7 +800,7 @@
add a
add a
add a ; 8*tiles is height in bytes
- ld [H_SPRITEHEIGHT], a ; $ff8c
+ ld [H_SPRITEHEIGHT], a
ld a, $7
sub b ; 7-h ; skip for vertical center (in tiles, relative to current column)
ld b, a
@@ -832,11 +832,11 @@
ld b, $0
ld c, a
add hl, bc
- ld a, [H_SPRITEWIDTH] ; $ff8b
+ ld a, [H_SPRITEWIDTH]
.columnLoop
push af
push hl
- ld a, [H_SPRITEHEIGHT] ; $ff8c
+ ld a, [H_SPRITEHEIGHT]
ld c, a
.columnInnerLoop
ld a, [de]
@@ -875,7 +875,7 @@
ld de, S_SPRITEBUFFER1 + (SPRITEBUFFERSIZE - 1) ; source 2: end of buffer 1
ld bc, S_SPRITEBUFFER0 + (SPRITEBUFFERSIZE - 1) ; source 1: end of buffer 0
ld a, SPRITEBUFFERSIZE/2 ; $c4
- ld [H_SPRITEINTERLACECOUNTER], a ; $ff8b
+ ld [H_SPRITEINTERLACECOUNTER], a
.interlaceLoop
ld a, [de]
dec de
@@ -889,9 +889,9 @@
ld a, [bc]
dec bc
ld [hld], a ; write byte of source 1
- ld a, [H_SPRITEINTERLACECOUNTER] ; $ff8b
+ ld a, [H_SPRITEINTERLACECOUNTER]
dec a
- ld [H_SPRITEINTERLACECOUNTER], a ; $ff8b
+ ld [H_SPRITEINTERLACECOUNTER], a
jr nz, .interlaceLoop
ld a, [W_SPRITEFLIPPED]
and a
@@ -934,11 +934,11 @@
push af
ld a, Bank(_UpdateSprites)
ld [H_LOADEDROMBANK], a
- ld [$2000], a
+ ld [MBC1RomBank], a
call _UpdateSprites
pop af
ld [H_LOADEDROMBANK], a
- ld [$2000], a
+ ld [MBC1RomBank], a
ret
INCLUDE "data/mart_inventories.asm"
@@ -1130,7 +1130,7 @@
jp z,FuncTX_PokemonCenterPC
cp a,$f5 ; Vending Machine
jr nz,.notVendingMachine
- callba VendingMachineMenu ; jump banks to vending machine routine
+ callba VendingMachineMenu ; jump banks to vending machine routine
jr AfterDisplayingTextID
.notVendingMachine
cp a,$f7 ; slot machine
@@ -1181,7 +1181,7 @@
jr nz,.restoreSpriteFacingDirectionLoop
ld a,BANK(InitMapSprites)
ld [H_LOADEDROMBANK],a
- ld [$2000],a
+ ld [MBC1RomBank],a
call InitMapSprites ; reload sprite tile pattern data (since it was partially overwritten by text tile patterns)
ld hl,wFontLoaded
res 0,[hl]
@@ -1191,7 +1191,7 @@
call LoadCurrentMapView
pop af
ld [H_LOADEDROMBANK],a
- ld [$2000],a
+ ld [MBC1RomBank],a
jp UpdateSprites
DisplayPokemartDialogue:: ; 2a2e (0:2a2e)
@@ -1207,11 +1207,11 @@
push af
ld a,Bank(DisplayPokemartDialogue_)
ld [H_LOADEDROMBANK],a
- ld [$2000],a
+ ld [MBC1RomBank],a
call DisplayPokemartDialogue_
pop af
ld [H_LOADEDROMBANK],a
- ld [$2000],a
+ ld [MBC1RomBank],a
jp AfterDisplayingTextID
PokemartGreetingText:: ; 2a55 (0:2a55)
@@ -1244,11 +1244,11 @@
push af
ld a,Bank(DisplayPokemonCenterDialogue_)
ld [H_LOADEDROMBANK],a
- ld [$2000],a
+ ld [MBC1RomBank],a
call DisplayPokemonCenterDialogue_
pop af
ld [H_LOADEDROMBANK],a
- ld [$2000],a
+ ld [MBC1RomBank],a
jp AfterDisplayingTextID
DisplaySafariGameOverText:: ; 2a90 (0:2a90)
@@ -1329,8 +1329,8 @@
ld [wTextBoxID],a
call DisplayTextBoxID ; redraw money text box
ld a, (SFX_02_5a - SFX_Headers_02) / 3
- call PlaySoundWaitForCurrent ; play sound
- jp WaitForSoundToFinish ; wait until sound is done playing
+ call PlaySoundWaitForCurrent
+ jp WaitForSoundToFinish
; function to remove an item (in varying quantities) from the player's bag or PC box
; INPUT:
@@ -1342,11 +1342,11 @@
push af
ld a,BANK(RemoveItemFromInventory_)
ld [H_LOADEDROMBANK],a
- ld [$2000],a
+ ld [MBC1RomBank],a
call RemoveItemFromInventory_
pop af
ld [H_LOADEDROMBANK],a
- ld [$2000],a
+ ld [MBC1RomBank],a
ret
; function to add an item (in varying quantities) to the player's bag or PC box
@@ -1361,12 +1361,12 @@
push af
ld a,BANK(AddItemToInventory_)
ld [H_LOADEDROMBANK],a
- ld [$2000],a
+ ld [MBC1RomBank],a
call AddItemToInventory_
pop bc
ld a,b
ld [H_LOADEDROMBANK],a
- ld [$2000],a
+ ld [MBC1RomBank],a
pop bc
ret
@@ -1408,7 +1408,7 @@
ld a,[wListMenuID]
and a ; is it a PC pokemon list?
jr nz,.skipMovingSprites
- call UpdateSprites ; move sprites
+ call UpdateSprites
.skipMovingSprites
ld a,1 ; max menu item ID is 1 if the list has less than 2 entries
ld [wcc37],a
@@ -1900,7 +1900,7 @@
push af
ld a,BANK(MonsterNames) ; 07
ld [H_LOADEDROMBANK],a
- ld [$2000],a
+ ld [MBC1RomBank],a
ld a,[wd11e]
dec a
ld hl,MonsterNames ; 421E
@@ -1916,7 +1916,7 @@
pop de
pop af
ld [H_LOADEDROMBANK],a
- ld [$2000],a
+ ld [MBC1RomBank],a
pop hl
ret
@@ -2051,7 +2051,7 @@
call EnableLCD
pop af
ld [H_LOADEDROMBANK],a
- ld [$2000],a
+ ld [MBC1RomBank],a
ret
; reloads tileset tile patterns
@@ -2065,7 +2065,7 @@
call EnableLCD
pop af
ld [H_LOADEDROMBANK],a
- ld [$2000],a
+ ld [MBC1RomBank],a
ret
; shows the town map and lets the player choose a destination to fly to
@@ -2109,12 +2109,12 @@
push af
ld a,BANK(TossItem_)
ld [H_LOADEDROMBANK],a
- ld [$2000],a
+ ld [MBC1RomBank],a
call TossItem_
pop de
ld a,d
ld [H_LOADEDROMBANK],a
- ld [$2000],a
+ ld [MBC1RomBank],a
ret
; checks if an item is a key item
@@ -2142,12 +2142,12 @@
push af
ld a,BANK(DisplayTextBoxID_)
ld [H_LOADEDROMBANK],a
- ld [$2000],a
+ ld [MBC1RomBank],a
call DisplayTextBoxID_
pop bc
ld a,b
ld [H_LOADEDROMBANK],a
- ld [$2000],a
+ ld [MBC1RomBank],a
ret
; not zero if an NPC movement script is running, the player character is
@@ -2184,12 +2184,12 @@
push af
ld a, [wNPCMovementScriptBank]
ld [H_LOADEDROMBANK], a
- ld [$2000], a
+ ld [MBC1RomBank], a
ld a, [wNPCMovementScriptFunctionNum]
call CallFunctionInTable
pop af
ld [H_LOADEDROMBANK], a
- ld [$2000], a
+ ld [MBC1RomBank], a
ret
.NPCMovementScriptPointerTables
dw ProfOakMovementScriptPointerTable
@@ -2312,7 +2312,7 @@
ld a, $6
call ReadTrainerHeaderInfo ; print after battle text
jp PrintText
-.trainerNotYetFought ; 0x31ed
+.trainerNotYetFought
ld a, $4
call ReadTrainerHeaderInfo ; print before battle text
call PrintText
@@ -2392,7 +2392,7 @@
res 7, [hl]
ld hl, wFlags_0xcd60
res 0, [hl] ; player is no longer engaged by any trainer
- ld a, [W_ISINBATTLE] ; W_ISINBATTLE
+ ld a, [W_ISINBATTLE]
cp $ff
jp z, ResetButtonPressedAndMapScript
ld a, $2
@@ -2436,32 +2436,32 @@
; sets opponent type and mon set/lvl based on the engaging trainer data
InitBattleEnemyParameters:: ; 32d7 (0:32d7)
ld a, [wEngagedTrainerClass]
- ld [W_CUROPPONENT], a ; wd059
+ ld [W_CUROPPONENT], a
ld [W_ENEMYMONORTRAINERCLASS], a
cp $c8
- ld a, [wEngagedTrainerSet] ; wcd2e
+ ld a, [wEngagedTrainerSet]
jr c, .noTrainer
- ld [W_TRAINERNO], a ; wd05d
+ ld [W_TRAINERNO], a
ret
.noTrainer
- ld [W_CURENEMYLVL], a ; W_CURENEMYLVL
+ ld [W_CURENEMYLVL], a
ret
GetSpritePosition1:: ; 32ef (0:32ef)
ld hl, _GetSpritePosition1
- jr asm_3301
+ jr SpritePositionBankswitch
GetSpritePosition2:: ; 32f4 (0:32f4)
ld hl, _GetSpritePosition2
- jr asm_3301 ; 0x32f7 $8
+ jr SpritePositionBankswitch
SetSpritePosition1:: ; 32f9 (0:32f9)
ld hl, _SetSpritePosition1
- jr asm_3301
+ jr SpritePositionBankswitch
SetSpritePosition2:: ; 32fe (0:32fe)
ld hl, _SetSpritePosition2
-asm_3301:: ; 3301 (0:3301)
+SpritePositionBankswitch:: ; 3301 (0:3301)
ld b, BANK(_GetSpritePosition1) ; BANK(_GetSpritePosition2), BANK(_SetSpritePosition1), BANK(_SetSpritePosition2)
jp Bankswitch ; indirect jump to one of the four functions
@@ -2497,11 +2497,11 @@
ld [wTrainerEngageDistance], a
ld a, [wSpriteIndex]
swap a
- ld [wTrainerSpriteOffset], a ; wWhichTrade
+ ld [wTrainerSpriteOffset], a
predef TrainerEngage
pop de
pop hl
- ld a, [wTrainerSpriteOffset] ; wWhichTrade
+ ld a, [wTrainerSpriteOffset]
and a
ret nz ; break if the trainer is engaging
.trainerAlreadyFought
@@ -2539,7 +2539,7 @@
ld a, [hli] ; load trainer class
ld [wEngagedTrainerClass], a
ld a, [hl] ; load trainer mon set
- ld [wEnemyMonAttackMod], a ; wcd2e
+ ld [wEnemyMonAttackMod], a
jp PlayTrainerMusic
PrintEndBattleText:: ; 3381 (0:3381)
@@ -2589,8 +2589,10 @@
call TextCommandProcessor
jp TextScriptEnd
+; only engage withe trainer if the player is not already
+; engaged with another trainer
; XXX unused?
-Func_33dd:: ; 33dd (0:33dd)
+CheckIfAlreadyEngaged:: ; 33dd (0:33dd)
ld a, [wFlags_0xcd60]
bit 0, a
ret nz
@@ -2606,13 +2608,13 @@
ret z
cp $c8 + SONY3
ret z
- ld a, [W_GYMLEADERNO] ; W_GYMLEADERNO
+ ld a, [W_GYMLEADERNO]
and a
ret nz
xor a
ld [wMusicHeaderPointer], a
ld a, $ff
- call PlaySound ; stop music
+ call PlaySound
ld a, BANK(Music_MeetEvilTrainer)
ld [wc0ef], a
ld [wc0f0], a
@@ -2719,13 +2721,13 @@
DisplayPokedex:: ; 349b (0:349b)
ld [wd11e], a
- ld b, BANK(Func_7c18)
- ld hl, Func_7c18
+ ld b, BANK(_DisplayPokedex)
+ ld hl, _DisplayPokedex
jp Bankswitch
SetSpriteFacingDirectionAndDelay:: ; 34a6 (0:34a6)
call SetSpriteFacingDirection
- ld c, $6
+ ld c, 6
jp DelayFrames
SetSpriteFacingDirection:: ; 34ae (0:34ae)
@@ -2842,7 +2844,7 @@
ld a, [wRLEByteCount]
add c
ld [wRLEByteCount], a ; update total number of written bytes
- ld a, [H_DOWNARROWBLINKCNT1] ; $ff8b
+ ld a, [H_DOWNARROWBLINKCNT1]
call FillMemory ; write a c-times to output
inc de
jr .listLoop
@@ -2903,7 +2905,7 @@
jr nz, .linkBattle
ld a, Bank(TrainerPicAndMoneyPointers)
call BankswitchHome
- ld a, [W_TRAINERCLASS] ; wd031
+ ld a, [W_TRAINERCLASS]
dec a
ld hl, TrainerPicAndMoneyPointers
ld bc, $5
@@ -2960,7 +2962,7 @@
ld [wcf08],a
ld a,[wcf09]
ld [H_LOADEDROMBANK],a
- ld [$2000],a
+ ld [MBC1RomBank],a
ret
BankswitchBack:: ; 35cd (0:35cd)
@@ -2967,7 +2969,7 @@
; returns from BankswitchHome
ld a,[wcf08]
ld [H_LOADEDROMBANK],a
- ld [$2000],a
+ ld [MBC1RomBank],a
ret
Bankswitch:: ; 35d6 (0:35d6)
@@ -2977,7 +2979,7 @@
push af
ld a,b
ld [H_LOADEDROMBANK],a
- ld [$2000],a
+ ld [MBC1RomBank],a
ld bc,.Return
push bc
jp [hl]
@@ -2985,7 +2987,7 @@
pop bc
ld a,b
ld [H_LOADEDROMBANK],a
- ld [$2000],a
+ ld [MBC1RomBank],a
ret
; displays yes/no choice
@@ -3178,13 +3180,13 @@
LoadScreenTilesFromBuffer2:: ; 3701 (0:3701)
call LoadScreenTilesFromBuffer2DisableBGTransfer
ld a, $1
- ld [H_AUTOBGTRANSFERENABLED], a ; $ffba
+ ld [H_AUTOBGTRANSFERENABLED], a
ret
; loads screen tiles stored in wTileMapBackup2 but leaves H_AUTOBGTRANSFERENABLED disabled
LoadScreenTilesFromBuffer2DisableBGTransfer:: ; 3709 (0:3709)
xor a
- ld [H_AUTOBGTRANSFERENABLED], a ; $ffba
+ ld [H_AUTOBGTRANSFERENABLED], a
ld hl, wTileMapBackup2
ld de, wTileMap
ld bc, $168
@@ -3199,13 +3201,13 @@
LoadScreenTilesFromBuffer1:: ; 3725 (0:3725)
xor a
- ld [H_AUTOBGTRANSFERENABLED], a ; $ffba
+ ld [H_AUTOBGTRANSFERENABLED], a
ld hl, wTileMapBackup
ld de, wTileMap
ld bc, $168
call CopyData
ld a, $1
- ld [H_AUTOBGTRANSFERENABLED], a ; $ffba
+ ld [H_AUTOBGTRANSFERENABLED], a
ret
DelayFrames:: ; 3739 (0:3739)
@@ -3279,11 +3281,11 @@
ld e,l
ld d,h
jr .gotPtr
-.otherEntries ; $378d
+.otherEntries
;2-7 = OTHER ENTRIES
ld a,[wPredefBank]
ld [H_LOADEDROMBANK],a
- ld [$2000],a
+ ld [MBC1RomBank],a
ld a,[wNameListType] ;VariousNames' entryID
dec a
add a
@@ -3291,7 +3293,7 @@
ld e,a
jr nc,.skip
inc d
-.skip ; $37a0
+.skip
ld hl,NamePointers
add hl,de
ld a,[hli]
@@ -3321,7 +3323,7 @@
ld de,wcd6d
ld bc,$0014
call CopyData
-.gotPtr ; $37cd
+.gotPtr
ld a,e
ld [wcf8d],a
ld a,d
@@ -3331,7 +3333,7 @@
pop hl
pop af
ld [H_LOADEDROMBANK],a
- ld [$2000],a
+ ld [MBC1RomBank],a
ret
GetItemPrice:: ; 37df (0:37df)
@@ -3346,7 +3348,7 @@
ld a, $f ; hardcoded Bank
.asm_37ed
ld [H_LOADEDROMBANK], a
- ld [$2000], a
+ ld [MBC1RomBank], a
ld hl, wItemPrices
ld a, [hli]
ld h, [hl]
@@ -3370,13 +3372,13 @@
.getTMPrice
ld a, Bank(GetMachinePrice)
ld [H_LOADEDROMBANK], a
- ld [$2000], a
+ ld [MBC1RomBank], a
call GetMachinePrice
.asm_381c
ld de, hItemPrice
pop af
ld [H_LOADEDROMBANK], a
- ld [$2000], a
+ ld [MBC1RomBank], a
ret
; copies a string from [de] to [wcf4b]
@@ -3486,7 +3488,7 @@
ld a, (SFX_02_40 - SFX_Headers_02) / 3
jp PlaySound
.inLinkBattle
- ld c, $41
+ ld c, 65
jp DelayFrames
; function to do multiplication
@@ -3521,11 +3523,11 @@
push af
ld a,Bank(_Divide)
ld [H_LOADEDROMBANK],a
- ld [$2000],a
+ ld [MBC1RomBank],a
call _Divide
pop af
ld [H_LOADEDROMBANK],a
- ld [$2000],a
+ ld [MBC1RomBank],a
pop bc
pop de
pop hl
@@ -3753,7 +3755,7 @@
ld [H_MULTIPLICAND+1], a
xor a
ld [H_MULTIPLICAND], a
- ld a, [W_CURENEMYLVL] ; W_CURENEMYLVL
+ ld a, [W_CURENEMYLVL]
ld [H_MULTIPLIER], a
call Multiply ; ((Base + IV) * 2 + ceil(Sqrt(stat exp)) / 4) * Level
ld a, [H_MULTIPLICAND]
@@ -3771,7 +3773,7 @@
cp $1
ld a, $5
jr nz, .notHPStat
- ld a, [W_CURENEMYLVL] ; W_CURENEMYLVL
+ ld a, [W_CURENEMYLVL]
ld b, a
ld a, [H_MULTIPLICAND+2]
add b
@@ -3816,25 +3818,25 @@
push af
ld a, BANK(_AddEnemyMonToPlayerParty)
ld [H_LOADEDROMBANK], a
- ld [$2000], a
+ ld [MBC1RomBank], a
call _AddEnemyMonToPlayerParty
pop bc
ld a, b
ld [H_LOADEDROMBANK], a
- ld [$2000], a
+ ld [MBC1RomBank], a
ret
Func_3a68:: ; 3a68 (0:3a68)
ld a, [H_LOADEDROMBANK]
push af
- ld a, BANK(Func_f51e)
+ ld a, BANK(MoveMon)
ld [H_LOADEDROMBANK], a
- ld [$2000], a
- call Func_f51e
+ ld [MBC1RomBank], a
+ call MoveMon
pop bc
ld a, b
ld [H_LOADEDROMBANK], a
- ld [$2000], a
+ ld [MBC1RomBank], a
ret
; skips a text entries, each of size $b (like trainer name, OT name, rival name, ...)
@@ -4010,7 +4012,7 @@
pop hl
jr nz,.skipPlayingSound
ld a,(SFX_02_40 - SFX_Headers_02) / 3
- call PlaySound ; play sound
+ call PlaySound
.skipPlayingSound
pop af
ld [H_DOWNARROWBLINKCNT2],a
@@ -4648,7 +4650,7 @@
ret
PrintPredefTextID:: ; 3ef5 (0:3ef5)
- ld [H_DOWNARROWBLINKCNT2], a ; $ff8c
+ ld [H_DOWNARROWBLINKCNT2], a
ld hl, TextPredefs
call SetMapTextPointer
ld hl, wcf11
--- a/home/audio.asm
+++ b/home/audio.asm
@@ -4,7 +4,7 @@
ld c, a
ld d, a
ld [wcfca], a
- jr asm_2324
+ jr Func_2324
Func_2312:: ; 2312 (0:2312)
ld c, $a
@@ -11,12 +11,12 @@
ld d, $0
ld a, [wd72e]
bit 5, a
- jr z, asm_2324
+ jr z, Func_2324
xor a
ld [wcfca], a
ld c, $8
ld d, c
-asm_2324:: ; 2324 (0:2324)
+Func_2324:: ; 2324 (0:2324)
ld a, [wWalkBikeSurfState]
and a
jr z, .asm_2343
@@ -146,27 +146,27 @@
ld [$ffb9], a
ld a, [wc0ef]
ld [H_LOADEDROMBANK], a
- ld [$2000], a
- cp BANK(Func_9876)
+ ld [MBC1RomBank], a
+ cp BANK(Music2_9876)
jr nz, .checkForBank08
.bank02
ld a, b
- call Func_9876
+ call Music2_9876
jr .asm_240b
.checkForBank08
- cp BANK(Func_22035)
+ cp BANK(Music8_22035)
jr nz, .bank1F
.bank08
ld a, b
- call Func_22035
+ call Music8_22035
jr .asm_240b
.bank1F
ld a, b
- call Func_7d8ea
+ call Music1f_7d8ea
.asm_240b
ld a, [$ffb9]
ld [H_LOADEDROMBANK], a
- ld [$2000], a
+ ld [MBC1RomBank], a
jr .asm_2425
.asm_2414
ld a, b
--- a/home/init.asm
+++ b/home/init.asm
@@ -1,7 +1,7 @@
SoftReset::
call StopAllSounds
call GBPalWhiteOut
- ld c, $20
+ ld c, 32
call DelayFrames
; fallthrough
--- a/home/overworld.asm
+++ b/home/overworld.asm
@@ -257,7 +257,7 @@
jr z,.noSpinning
callba LoadSpinnerArrowTiles ; spin while moving
.noSpinning
- call UpdateSprites ; move sprites
+ call UpdateSprites
.moveAhead2
ld hl,wFlags_0xcd60
res 2,[hl]
@@ -335,7 +335,7 @@
and a
jr z,.allPokemonFainted
.noFaintCheck
- ld c,$0a
+ ld c,10
call DelayFrames
jp EnterMap
.allPokemonFainted
@@ -778,7 +778,7 @@
call LeaveMapAnim
ld a, Bank(SpecialWarpIn)
ld [H_LOADEDROMBANK], a
- ld [$2000], a
+ ld [MBC1RomBank], a
call SpecialWarpIn
jp SpecialEnterMap
@@ -1358,7 +1358,7 @@
push af
ld a,[W_TILESETBANK] ; tile data ROM bank
ld [H_LOADEDROMBANK],a
- ld [$2000],a ; switch to ROM bank that contains tile data
+ ld [MBC1RomBank],a ; switch to ROM bank that contains tile data
ld a,[wCurrentTileBlockMapViewPointer] ; address of upper left corner of current map view
ld e,a
ld a,[wCurrentTileBlockMapViewPointer + 1]
@@ -1440,7 +1440,7 @@
jr nz,.rowLoop2
pop af
ld [H_LOADEDROMBANK],a
- ld [$2000],a ; restore previous ROM bank
+ ld [MBC1RomBank],a ; restore previous ROM bank
ret
AdvancePlayerSprite:: ; 0d27 (0:0d27)
@@ -1981,7 +1981,7 @@
ret
LoadWalkingPlayerSpriteGraphics:: ; 104d (0:104d)
- ld de,RedSprite ; $4180
+ ld de,RedSprite
ld hl,vNPCSprites
jr LoadPlayerSpriteGraphicsCommon
@@ -2276,7 +2276,7 @@
push af
ld a, BANK(MapSongBanks)
ld [H_LOADEDROMBANK],a
- ld [$2000],a
+ ld [MBC1RomBank],a
ld hl, MapSongBanks
add hl,bc
add hl,bc
@@ -2286,7 +2286,7 @@
ld [wd35c],a ; music 2
pop af
ld [H_LOADEDROMBANK],a
- ld [$2000],a
+ ld [MBC1RomBank],a
ret
; function to copy map connection data from ROM to WRAM
@@ -2359,7 +2359,7 @@
.restoreRomBank
pop af
ld [H_LOADEDROMBANK],a
- ld [$2000],a
+ ld [MBC1RomBank],a
ret
; function to switch to the ROM bank that a map is stored in
@@ -2378,7 +2378,7 @@
call BankswitchBack
ld a,[$ffe8]
ld [H_LOADEDROMBANK],a
- ld [$2000],a ; switch to map ROM bank
+ ld [MBC1RomBank],a ; switch to map ROM bank
pop bc
pop hl
ret
--- a/home/pic.asm
+++ b/home/pic.asm
@@ -6,7 +6,7 @@
push af
ld a, b
ld [H_LOADEDROMBANK], a
- ld [$2000], a
+ ld [MBC1RomBank], a
ld a, $a
ld [$0], a
xor a
@@ -14,7 +14,7 @@
call _UncompressSpriteData
pop af
ld [H_LOADEDROMBANK], a
- ld [$2000], a
+ ld [MBC1RomBank], a
ret
; initializes necessary data to load a sprite and runs UncompressSpriteDataLoop
@@ -31,7 +31,7 @@
xor a
ld [W_SPRITECURPOSX], a
ld [W_SPRITECURPOSY], a
- ld [W_SPRITELOADFLAGS], a ; wd0a8
+ ld [W_SPRITELOADFLAGS], a
call ReadNextInputByte ; first byte of input determines sprite width (high nybble) and height (low nybble) in tiles (8x8 pixels)
ld b, a
and $f
@@ -57,13 +57,13 @@
; note that this is an endless loop which is terminated during a call to MoveToNextBufferPosition by manipulating the stack
UncompressSpriteDataLoop:: ; 2556 (0:2556)
ld hl, S_SPRITEBUFFER1
- ld a, [W_SPRITELOADFLAGS] ; wd0a8
+ ld a, [W_SPRITELOADFLAGS]
bit 0, a
jr z, .useSpriteBuffer1 ; check which buffer to use
ld hl, S_SPRITEBUFFER2
.useSpriteBuffer1
call StoreSpriteOutputPointer
- ld a, [W_SPRITELOADFLAGS] ; wd0a8
+ ld a, [W_SPRITELOADFLAGS]
bit 1, a
jr z, .startDecompression ; check if last iteration
call ReadNextInputBit ; if last chunk, read 1-2 bit unpacking mode
@@ -195,12 +195,12 @@
pop hl
xor a
ld [W_SPRITECURPOSX], a
- ld a, [W_SPRITELOADFLAGS] ; wd0a8
+ ld a, [W_SPRITELOADFLAGS]
bit 1, a
jr nz, .done ; test if there is one more sprite to go
xor $1
set 1, a
- ld [W_SPRITELOADFLAGS], a ; wd0a8
+ ld [W_SPRITELOADFLAGS], a
jp UncompressSpriteDataLoop
.done
jp UnpackSprite
@@ -539,7 +539,7 @@
; resets sprite buffer pointers to buffer 1 and 2, depending on W_SPRITELOADFLAGS
ResetSpriteBufferPointers:: ; 2841 (0:2841)
- ld a, [W_SPRITELOADFLAGS] ; wd0a8
+ ld a, [W_SPRITELOADFLAGS]
bit 0, a
jr nz, .buffer2Selected
ld de, S_SPRITEBUFFER1
--- a/home/predef.asm
+++ b/home/predef.asm
@@ -14,13 +14,13 @@
push af
ld a, BANK(GetPredefPointer)
ld [H_LOADEDROMBANK], a
- ld [$2000], a
+ ld [MBC1RomBank], a
call GetPredefPointer
ld a, [wPredefBank]
ld [H_LOADEDROMBANK], a
- ld [$2000], a
+ ld [MBC1RomBank], a
ld de, .done
push de
@@ -29,7 +29,7 @@
pop af
ld [H_LOADEDROMBANK], a
- ld [$2000], a
+ ld [MBC1RomBank], a
ret
GetPredefRegisters::
--- a/home/text.asm
+++ b/home/text.asm
@@ -293,7 +293,7 @@
hlCoord 1, 13
ld bc,$0412
call ClearScreenArea
- ld c,$14
+ ld c,20
call DelayFrames
pop de
hlCoord 1, 14
@@ -308,7 +308,7 @@
hlCoord 1, 10
ld bc,$0712
call ClearScreenArea
- ld c,$14
+ ld c,20
call DelayFrames
pop de
pop hl
@@ -690,7 +690,7 @@
ld d,a
ld a,[hli]
ld [H_LOADEDROMBANK],a
- ld [$2000],a
+ ld [MBC1RomBank],a
push hl
ld l,e
ld h,d
@@ -698,7 +698,7 @@
pop hl
pop af
ld [H_LOADEDROMBANK],a
- ld [$2000],a
+ ld [MBC1RomBank],a
jp NextTextCommand
TextCommandJumpTable:: ; 1cc1 (0:1cc1)
--- a/main.asm
+++ b/main.asm
@@ -588,7 +588,7 @@
INCLUDE "engine/cable_club.asm"
LoadTrainerInfoTextBoxTiles: ; 5ae6 (1:5ae6)
- ld de, TrainerInfoTextBoxTileGraphics ; $7b98
+ ld de, TrainerInfoTextBoxTileGraphics
ld hl, vChars2 + $760
ld bc, (BANK(TrainerInfoTextBoxTileGraphics) << 8) +$09
jp CopyVideoData
@@ -1028,7 +1028,7 @@
bit 4,[hl]
res 4,[hl]
jr nz,.skipMovingSprites
- call UpdateSprites ; move sprites
+ call UpdateSprites
.skipMovingSprites
; loop to copy C1X9 (direction the sprite is facing) to C2X9 for each sprite
; this is done because when you talk to an NPC, they turn to look your way
@@ -1210,7 +1210,7 @@
call PlaceString
pop af
ld [wd730],a
- call UpdateSprites ; move sprites
+ call UpdateSprites
ret
; function to search a table terminated with $ff for a byte matching c in increments of de
@@ -1912,16 +1912,16 @@
INCLUDE "engine/menu/players_pc.asm"
_RemovePokemon: ; 7b68 (1:7b68)
- ld hl, wPartyCount ; wPartyCount
+ ld hl, wPartyCount
ld a, [wcf95]
and a
jr z, .asm_7b74
- ld hl, W_NUMINBOX ; wda80
+ ld hl, W_NUMINBOX
.asm_7b74
ld a, [hl]
dec a
ld [hli], a
- ld a, [wWhichPokemon] ; wWhichPokemon
+ ld a, [wWhichPokemon]
ld c, a
ld b, $0
add hl, bc
@@ -1934,7 +1934,7 @@
ld [hli], a
inc a
jr nz, .asm_7b81
- ld hl, wPartyMonOT ; wd273
+ ld hl, wPartyMonOT
ld d, $5
ld a, [wcf95]
and a
@@ -1942,9 +1942,9 @@
ld hl, wBoxMonOT
ld d, $13
.asm_7b97
- ld a, [wWhichPokemon] ; wWhichPokemon
+ ld a, [wWhichPokemon]
call SkipFixedLengthTextEntries
- ld a, [wWhichPokemon] ; wWhichPokemon
+ ld a, [wWhichPokemon]
cp d
jr nz, .asm_7ba6
ld [hl], $ff
@@ -1954,7 +1954,7 @@
ld e, l
ld bc, $b
add hl, bc
- ld bc, wPartyMonNicks ; wPartyMonNicks
+ ld bc, wPartyMonNicks
ld a, [wcf95]
and a
jr z, .asm_7bb8
@@ -1969,7 +1969,7 @@
ld hl, wBoxMons
ld bc, wBoxMon2 - wBoxMon1
.asm_7bcd
- ld a, [wWhichPokemon] ; wWhichPokemon
+ ld a, [wWhichPokemon]
call AddNTimes
ld d, h
ld e, l
@@ -1983,10 +1983,10 @@
.asm_7be4
ld bc, wPartyMon2 - wPartyMon1
add hl, bc
- ld bc, wPartyMonOT ; wd273
+ ld bc, wPartyMonOT
.asm_7beb
call CopyDataUntil
- ld hl, wPartyMonNicks ; wPartyMonNicks
+ ld hl, wPartyMonNicks
ld a, [wcf95]
and a
jr z, .asm_7bfa
@@ -1993,13 +1993,13 @@
ld hl, wBoxMonNicks
.asm_7bfa
ld bc, $b
- ld a, [wWhichPokemon] ; wWhichPokemon
+ ld a, [wWhichPokemon]
call AddNTimes
ld d, h
ld e, l
ld bc, $b
add hl, bc
- ld bc, wPokedexOwned ; wPokedexOwned
+ ld bc, wPokedexOwned
ld a, [wcf95]
and a
jr z, .asm_7c15
@@ -2007,7 +2007,7 @@
.asm_7c15
jp CopyDataUntil
-Func_7c18: ; 7c18 (1:7c18)
+_DisplayPokedex: ; 7c18 (1:7c18)
ld hl, wd730
set 6, [hl]
predef ShowPokedexData
@@ -2014,7 +2014,7 @@
ld hl, wd730
res 6, [hl]
call ReloadMapData
- ld c, $a
+ ld c, 10
call DelayFrames
predef IndexToPokedex
ld a, [wd11e]
@@ -2043,7 +2043,7 @@
xor a
ld [H_AUTOBGTRANSFERENABLED], a
ld [wStepCounter], a
- ld [W_LONEATTACKNO], a ; W_GYMLEADERNO
+ ld [W_LONEATTACKNO], a
ld [hJoyPressed], a
ld [hJoyReleased], a
ld [hJoyHeld], a
@@ -2293,7 +2293,7 @@
INCLUDE "data/warp_tile_ids.asm"
PrintSafariZoneSteps: ; c52f (3:452f)
- ld a, [W_CURMAP] ; W_CURMAP
+ ld a, [W_CURMAP]
cp SAFARI_ZONE_EAST
ret c
cp UNKNOWN_DUNGEON_2
@@ -2303,16 +2303,16 @@
ld c, $7
call TextBoxBorder
hlCoord 1, 1
- ld de, wSafariSteps ; wd70d
+ ld de, wSafariSteps
ld bc, $203
call PrintNumber
hlCoord 4, 1
- ld de, SafariSteps ; $4579
+ ld de, SafariSteps
call PlaceString
hlCoord 1, 3
ld de, SafariBallText
call PlaceString
- ld a, [W_NUMSAFARIBALLS] ; W_NUMSAFARIBALLS
+ ld a, [W_NUMSAFARIBALLS]
cp $a
jr nc, .asm_c56d
hlCoord 5, 3
@@ -2320,7 +2320,7 @@
ld [hl], a
.asm_c56d
hlCoord 6, 3
- ld de, W_NUMSAFARIBALLS ; W_NUMSAFARIBALLS
+ ld de, W_NUMSAFARIBALLS
ld bc, $102
jp PrintNumber
@@ -2742,7 +2742,7 @@
ld a, [wd732]
bit 5, a
jr nz, .asm_cdec
- ld a, [W_CURMAP] ; W_CURMAP
+ ld a, [W_CURMAP]
cp SEAFOAM_ISLANDS_5
ret nz
ld a, [wd881]
@@ -2749,7 +2749,7 @@
and $3
cp $3
ret z
- ld hl, CoordsData_cdf7 ; $4df7
+ ld hl, CoordsData_cdf7
call ArePlayerCoordsInArray
ret nc
ld hl, wd728
@@ -3132,7 +3132,7 @@
ret c ; return if the replaced tile block is above the map view in memory
RedrawMapView: ; eedc (3:6edc)
- ld a, [W_ISINBATTLE] ; W_ISINBATTLE
+ ld a, [W_ISINBATTLE]
inc a
ret z
ld a, [H_AUTOBGTRANSFERENABLED]
@@ -3255,7 +3255,7 @@
ld [H_DIVISOR], a
ld b, $2
call Divide ; divide difference by 3, resulting in the global offset (number of missable items before ours)
- ld a, [W_CURMAP] ; W_CURMAP
+ ld a, [W_CURMAP]
ld b, a
ld a, [H_DIVIDEND+3]
ld c, a ; store global offset in c
@@ -3535,11 +3535,11 @@
ret
_AddPartyMon: ; f2e5 (3:72e5)
- ld de, wPartyCount ; wPartyCount
+ ld de, wPartyCount
ld a, [wcc49]
and $f
jr z, .asm_f2f2
- ld de, wEnemyPartyCount ; wEnemyPartyCount
+ ld de, wEnemyPartyCount
.asm_f2f2
ld a, [de]
inc a
@@ -3558,7 +3558,7 @@
inc de
ld a, $ff
ld [de], a
- ld hl, wPartyMonOT ; wd273
+ ld hl, wPartyMonOT
ld a, [wcc49]
and $f
jr z, .asm_f315
@@ -3569,13 +3569,13 @@
call SkipFixedLengthTextEntries
ld d, h
ld e, l
- ld hl, wPlayerName ; wd158
+ ld hl, wPlayerName
ld bc, $b
call CopyData
ld a, [wcc49]
and a
jr nz, .asm_f33f
- ld hl, wPartyMonNicks ; wPartyMonNicks
+ ld hl, wPartyMonNicks
ld a, [$ffe4]
dec a
call SkipFixedLengthTextEntries
@@ -3619,7 +3619,7 @@
dec a
ld c, a
ld b, $2
- ld hl, wPokedexOwned ; wPokedexOwned
+ ld hl, wPokedexOwned
call FlagAction
ld a, c
ld [wd153], a
@@ -3630,11 +3630,11 @@
push bc
call FlagAction
pop bc
- ld hl, wPokedexSeen ; wd30a
+ ld hl, wPokedexSeen
call FlagAction
pop hl
push hl
- ld a, [W_ISINBATTLE] ; W_ISINBATTLE
+ ld a, [W_ISINBATTLE]
and a
jr nz, .copyEnemyMonData
call Random ; generate random IVs
@@ -3749,13 +3749,13 @@
pop hl
call AddPartyMon_WriteMovePP
inc de
- ld a, [W_CURENEMYLVL] ; W_CURENEMYLVL
+ ld a, [W_CURENEMYLVL]
ld [de], a
inc de
- ld a, [W_ISINBATTLE] ; W_ISINBATTLE
+ ld a, [W_ISINBATTLE]
dec a
jr nz, .calcFreshStats
- ld hl, wEnemyMonMaxHP ; wEnemyMonMaxHP
+ ld hl, wEnemyMonMaxHP
ld bc, $a
call CopyData ; copy stats of cur enemy mon
pop hl
@@ -3863,7 +3863,7 @@
and a
ret ; return success
-Func_f51e: ; f51e (3:751e)
+MoveMon: ; f51e (3:751e)
ld a, [wcf95]
and a
jr z, .checkPartyMonSlots
@@ -3872,13 +3872,13 @@
cp $3
ld hl, wDayCareMon
jr z, .asm_f575
- ld hl, W_NUMINBOX ; wda80
+ ld hl, W_NUMINBOX
ld a, [hl]
cp MONS_PER_BOX
jr nz, .partyOrBoxNotFull
jr .boxFull
.checkPartyMonSlots
- ld hl, wPartyCount ; wPartyCount
+ ld hl, wPartyCount
ld a, [hl]
cp PARTY_LENGTH
jr nz, .partyOrBoxNotFull
@@ -3903,11 +3903,11 @@
dec a
ld hl, wPartyMons
ld bc, wPartyMon2 - wPartyMon1 ; $2c
- ld a, [wPartyCount] ; wPartyCount
+ ld a, [wPartyCount]
jr nz, .skipToNewMonEntry
ld hl, wBoxMons
ld bc, wBoxMon2 - wBoxMon1 ; $21
- ld a, [W_NUMINBOX] ; wda80
+ ld a, [W_NUMINBOX]
.skipToNewMonEntry
dec a
call AddNTimes
@@ -3926,7 +3926,7 @@
ld hl, wPartyMons
ld bc, wPartyMon2 - wPartyMon1 ; $2c
.asm_f591
- ld a, [wWhichPokemon] ; wWhichPokemon
+ ld a, [wWhichPokemon]
call AddNTimes
.asm_f597
push hl
@@ -3953,11 +3953,11 @@
ld de, W_DAYCAREMONOT
jr z, .asm_f5d3
dec a
- ld hl, wPartyMonOT ; wd273
- ld a, [wPartyCount] ; wPartyCount
+ ld hl, wPartyMonOT
+ ld a, [wPartyCount]
jr nz, .asm_f5cd
ld hl, wBoxMonOT
- ld a, [W_NUMINBOX] ; wda80
+ ld a, [W_NUMINBOX]
.asm_f5cd
dec a
call SkipFixedLengthTextEntries
@@ -3971,9 +3971,9 @@
ld hl, W_DAYCAREMONOT
cp $2
jr z, .asm_f5ec
- ld hl, wPartyMonOT ; wd273
+ ld hl, wPartyMonOT
.asm_f5e6
- ld a, [wWhichPokemon] ; wWhichPokemon
+ ld a, [wWhichPokemon]
call SkipFixedLengthTextEntries
.asm_f5ec
ld bc, $b
@@ -3983,11 +3983,11 @@
ld de, W_DAYCAREMONNAME
jr z, .asm_f611
dec a
- ld hl, wPartyMonNicks ; wPartyMonNicks
- ld a, [wPartyCount] ; wPartyCount
+ ld hl, wPartyMonNicks
+ ld a, [wPartyCount]
jr nz, .asm_f60b
ld hl, wBoxMonNicks
- ld a, [W_NUMINBOX] ; wda80
+ ld a, [W_NUMINBOX]
.asm_f60b
dec a
call SkipFixedLengthTextEntries
@@ -4001,9 +4001,9 @@
ld hl, W_DAYCAREMONNAME
cp $2
jr z, .asm_f62a
- ld hl, wPartyMonNicks ; wPartyMonNicks
+ ld hl, wPartyMonNicks
.asm_f624
- ld a, [wWhichPokemon] ; wWhichPokemon
+ ld a, [wWhichPokemon]
call SkipFixedLengthTextEntries
.asm_f62a
ld bc, $b
@@ -4021,7 +4021,7 @@
call LoadMonData
callba CalcLevelFromExperience
ld a, d
- ld [W_CURENEMYLVL], a ; W_CURENEMYLVL
+ ld [W_CURENEMYLVL], a
pop hl
ld bc, wBoxMon2 - wBoxMon1
add hl, bc
@@ -4256,7 +4256,7 @@
.asm_f75b
push de
push de
- call Func_f800
+ call DivideBCD_f800
pop de
ld a, b
swap a
@@ -4265,8 +4265,8 @@
dec d
jr z, .asm_f7bc
push de
- call Func_f7d7
- call Func_f800
+ call DivideBCD_f7d7
+ call DivideBCD_f800
pop de
ld a, [$ffa5]
or b
@@ -4274,8 +4274,8 @@
dec d
jr z, .asm_f7bc
push de
- call Func_f7d7
- call Func_f800
+ call DivideBCD_f7d7
+ call DivideBCD_f800
pop de
ld a, b
swap a
@@ -4284,8 +4284,8 @@
dec d
jr z, .asm_f7bc
push de
- call Func_f7d7
- call Func_f800
+ call DivideBCD_f7d7
+ call DivideBCD_f800
pop de
ld a, [$ffa6]
or b
@@ -4293,8 +4293,8 @@
dec d
jr z, .asm_f7bc
push de
- call Func_f7d7
- call Func_f800
+ call DivideBCD_f7d7
+ call DivideBCD_f800
pop de
ld a, b
swap a
@@ -4303,8 +4303,8 @@
dec d
jr z, .asm_f7bc
push de
- call Func_f7d7
- call Func_f800
+ call DivideBCD_f7d7
+ call DivideBCD_f800
pop de
ld a, [$ffa7]
or b
@@ -4323,13 +4323,13 @@
ret z
.asm_f7ce
push af
- call Func_f7d7
+ call DivideBCD_f7d7
pop af
dec a
jr nz, .asm_f7ce
ret
-Func_f7d7: ; f7d7 (3:77d7)
+DivideBCD_f7d7: ; f7d7 (3:77d7)
ld a, [$ffa4]
swap a
and $f
@@ -4354,7 +4354,7 @@
ld [$ffa2], a
ret
-Func_f800: ; f800 (3:7800)
+DivideBCD_f800: ; f800 (3:7800)
ld bc, $3
.asm_f803
ld de, $ff9f
@@ -4486,7 +4486,7 @@
IsItemInBag_: ; f8a5 (3:78a5)
call GetPredefRegisters
- ld hl, wNumBagItems ; wNumBagItems
+ ld hl, wNumBagItems
.asm_f8ab
inc hl
ld a, [hli]
@@ -4697,7 +4697,7 @@
db NPC_MOVEMENT_RIGHT, D_RIGHT
db $ff
-Func_f9db: ; f9db (3:79db)
+; unreferenced
ret
INCLUDE "engine/hp_bar.asm"
--- a/text.asm
+++ b/text.asm
@@ -1122,7 +1122,7 @@
_TrainerDefeatedText:: ; 896f9 (22:56f9)
text $52, " defeated"
line "@"
- TX_RAM W_TRAINERNAME ; 0x89706
+ TX_RAM W_TRAINERNAME
text "!"
prompt
@@ -1152,7 +1152,7 @@
_LinkBattleLostText:: ; 89772 (22:5772)
text $52, " lost to"
line "@"
- TX_RAM W_TRAINERNAME ; 0x8977e
+ TX_RAM W_TRAINERNAME
text "!"
prompt
--- a/wram.asm
+++ b/wram.asm
@@ -953,7 +953,7 @@
ds 1
-wTrainerPicPointer:: ; wd033
+wTrainerPicPointer:: ; d033
ds 2
ds 1
wd036:: ds 16 ; used as a temporary buffer to print "XXX learned YYY"
@@ -1071,7 +1071,7 @@
; when the player is attacking multiple times, the number of attacks left
ds 1
-W_PLAYERCONFUSEDCOUNTER:: ; wd06b
+W_PLAYERCONFUSEDCOUNTER:: ; d06b
ds 1
W_PLAYERTOXICCOUNTER:: ; d06c
@@ -1087,7 +1087,7 @@
; when the enemy is attacking multiple times, the number of attacks left
ds 1
-W_ENEMYCONFUSEDCOUNTER:: ; wd070
+W_ENEMYCONFUSEDCOUNTER:: ; d070
ds 1
W_ENEMYTOXICCOUNTER:: ; d071
@@ -1332,10 +1332,10 @@
ds 2
-wRepelRemainingSteps:: ; wd0db
+wRepelRemainingSteps:: ; d0db
ds 1
-wMoves:: ; wd0dc
+wMoves:: ; d0dc
; list of moves for FormatMovesString
ds 4