aboutsummaryrefslogtreecommitdiffstats
path: root/home
diff options
context:
space:
mode:
authorNarishma-gb <194818981+Narishma-gb@users.noreply.github.com>2025-09-10 06:31:11 +0200
committerGitHub <noreply@github.com>2025-09-10 00:31:11 -0400
commitd237b01cfb241f417567c964e0df0658cf921570 (patch)
tree799e92e48259443aa6cf4c553ed7adf38bd442d4 /home
parentMerge branch 'master' of https://github.com/pret/pokered (diff)
downloadpokeyellow-d237b01cfb241f417567c964e0df0658cf921570.tar.gz
pokeyellow-d237b01cfb241f417567c964e0df0658cf921570.tar.xz
pokeyellow-d237b01cfb241f417567c964e0df0658cf921570.zip
Misc. naming and cleanup (#139)
* Name some printer/diploma routines * Name `wd434` * Name `NAME_LENGTH_JP` * Rename `callabd`/`calladb` to `farcall`/`callfar`
Diffstat (limited to 'home')
-rw-r--r--home/map_objects.asm4
-rw-r--r--home/overworld.asm29
-rw-r--r--home/pics.asm4
-rw-r--r--home/pokemon.asm2
-rw-r--r--home/uncompress.asm2
5 files changed, 20 insertions, 21 deletions
diff --git a/home/map_objects.asm b/home/map_objects.asm
index 0988abae..2e553371 100644
--- a/home/map_objects.asm
+++ b/home/map_objects.asm
@@ -71,7 +71,7 @@ IsItemInBag::
IsSurfingPikachuInParty::
; set bit 6 of wd471 if any Pikachu with Surf is in party
; set bit 7 of wd471 if starter Pikachu is in party (with or without Surf)
-; also performs a bankswitch to IsStarterPikachuInOurParty
+; also performs a bankswitch to IsStarterPikachuAliveInOurParty
ld a, [wd471]
and $3f
ld [wd471], a
@@ -114,7 +114,7 @@ IsSurfingPikachuInParty::
.checkForStarter
push hl
push bc
- callfar IsStarterPikachuInOurParty
+ callfar IsStarterPikachuAliveInOurParty
pop bc
pop hl
ret nc
diff --git a/home/overworld.asm b/home/overworld.asm
index 473635cc..b5625e9d 100644
--- a/home/overworld.asm
+++ b/home/overworld.asm
@@ -127,7 +127,7 @@ OverworldLoopLessDelay::
ld hl, wMiscFlags
res BIT_TURNING, [hl]
xor a
- ld [wd434], a
+ ld [wPikachuCollisionCounter], a
ld a, 1
ld [wCheckFor180DegreeTurn], a
ld a, [wPlayerMovingDirection] ; the direction that was pressed last time
@@ -170,7 +170,7 @@ OverworldLoopLessDelay::
jr z, .noDirectionButtonsPressed
ld a, 1
ld [wSpritePlayerStateData1XStepVector], a
- ld a, 1
+ ld a, PLAYER_DIR_RIGHT
.handleDirectionButtonPress
ld [wPlayerDirection], a ; new direction
@@ -185,8 +185,8 @@ OverworldLoopLessDelay::
ld a, [wPlayerLastStopDirection] ; old direction
cp b
jr z, .noDirectionChange
- ld a, $8
- ld [wd434], a
+ ld a, 8
+ ld [wPikachuCollisionCounter], a
; unlike in red/blue, yellow does not have the 180 degrees odd code
ld hl, wMiscFlags
set BIT_TURNING, [hl]
@@ -239,7 +239,7 @@ OverworldLoopLessDelay::
ld hl, wMiscFlags
res BIT_TURNING, [hl]
xor a
- ld [wd434], a
+ ld [wPikachuCollisionCounter], a
call DoBikeSpeedup
call AdvancePlayerSprite
ld a, [wWalkCounter]
@@ -1166,7 +1166,7 @@ IsSpriteInFrontOfPlayer2::
ld a, e
ldh [hSpriteIndex], a
ldh a, [hSpriteIndex] ; possible useless read because a already has the value of the read address
- cp $f
+ cp PIKACHU_SPRITE_INDEX
jr nz, .dontwritetowd436
ld a, $FF
ld [wd435], a
@@ -1232,26 +1232,25 @@ CollisionCheckOnLand::
xor a
ldh [hTextID], a
call IsSpriteInFrontOfPlayer ; check for sprite collisions again? when does the above check fail to detect a sprite collision?
- jr nc, .asm_0a5c
+ jr nc, .noSpriteCollision
res BIT_FACE_PLAYER, [hl]
ldh a, [hTextID]
and a ; was there a sprite collision?
- jr z, .asm_0a5c
-; if no sprite collision
- cp $f
+ jr z, .noSpriteCollision
+ cp PIKACHU_SPRITE_INDEX
jr nz, .collision
call CheckPikachuFollowingPlayer
jr nz, .collision
ldh a, [hJoyHeld]
- and $2
- jr nz, .asm_0a5c
- ld hl, wd434
+ and PAD_B
+ jr nz, .noSpriteCollision
+ ld hl, wPikachuCollisionCounter
ld a, [hl]
and a
- jr z, .asm_0a5c
+ jr z, .noSpriteCollision
dec [hl]
jr nz, .collision
-.asm_0a5c
+.noSpriteCollision
ld hl, TilePairCollisionsLand
call CheckForJumpingAndTilePairCollisions
jr c, .collision
diff --git a/home/pics.asm b/home/pics.asm
index 7a58a05e..18d86f2e 100644
--- a/home/pics.asm
+++ b/home/pics.asm
@@ -87,7 +87,7 @@ LoadUncompressedSpriteData::
add a
add a ; 8*(7*((8-w)/2) + 7-h) ; combined overall offset (in bytes)
ldh [hSpriteOffset], a
- ld a, $0
+ ld a, BANK("Sprite Buffers")
call OpenSRAM
ld hl, sSpriteBuffer0
call ZeroSpriteBuffer ; zero buffer 0
@@ -146,7 +146,7 @@ ZeroSpriteBuffer::
; in the resulting sprite, the rows of the two source sprites are interlaced
; de: output address
InterlaceMergeSpriteBuffers::
- ld a, $0
+ ld a, BANK("Sprite Buffers")
call OpenSRAM
push de
ld hl, sSpriteBuffer2 + (SPRITEBUFFERSIZE - 1) ; destination: end of buffer 2
diff --git a/home/pokemon.asm b/home/pokemon.asm
index 54996092..b10861a6 100644
--- a/home/pokemon.asm
+++ b/home/pokemon.asm
@@ -258,7 +258,7 @@ HandlePartyMenuInput::
jr nz, .asm_1258
ld a, [wCurrentMenuItem]
ld [wWhichPokemon], a
- callfar IsThisPartymonStarterPikachu_Party
+ callfar IsThisPartyMonStarterPikachu
jr nc, .asm_1258
call CheckPikachuFollowingPlayer
jr nz, .asm_128f
diff --git a/home/uncompress.asm b/home/uncompress.asm
index 091cf5f8..27e6e35c 100644
--- a/home/uncompress.asm
+++ b/home/uncompress.asm
@@ -11,7 +11,7 @@ UncompressSpriteData::
push af
ld a, b
call BankswitchCommon
- ld a, $0
+ ld a, BANK("Sprite Buffers")
call OpenSRAM
call _UncompressSpriteData
call CloseSRAM