aboutsummaryrefslogtreecommitdiffstats
path: root/home
diff options
context:
space:
mode:
authordannye <33dannye@gmail.com>2025-01-30 21:40:19 -0600
committerdannye <33dannye@gmail.com>2025-01-30 21:40:19 -0600
commit6cb885a9f68b9f445d7fa45279731336fe0247d4 (patch)
tree39736ab1dd8ebcc57f8e981db6103285743d5530 /home
parentIdentify unnamed functions in map_sprites.asm (#126) (diff)
parentFix some label typos, and add some constants instead of raw numbers (#492) (diff)
downloadpokeyellow-6cb885a9f68b9f445d7fa45279731336fe0247d4.tar.gz
pokeyellow-6cb885a9f68b9f445d7fa45279731336fe0247d4.tar.xz
pokeyellow-6cb885a9f68b9f445d7fa45279731336fe0247d4.zip
Merge branch 'master' of https://github.com/pret/pokered
Diffstat (limited to 'home')
-rw-r--r--home/cgb_palettes.asm34
-rw-r--r--home/fade.asm18
-rw-r--r--home/list_menu.asm4
-rw-r--r--home/overworld.asm32
-rw-r--r--home/palettes.asm12
-rw-r--r--home/pokemon.asm6
-rw-r--r--home/start.asm8
-rw-r--r--home/text.asm2
-rw-r--r--home/text_script.asm2
-rw-r--r--home/yes_no.asm2
10 files changed, 60 insertions, 60 deletions
diff --git a/home/cgb_palettes.asm b/home/cgb_palettes.asm
index b8cc92c6..86d28ece 100644
--- a/home/cgb_palettes.asm
+++ b/home/cgb_palettes.asm
@@ -1,8 +1,8 @@
-UpdateGBCPal_BGP::
+UpdateCGBPal_BGP::
push af
- ldh a, [hGBC]
+ ldh a, [hOnCGB]
and a
- jr z, .notGBC
+ jr z, .notCGB
push bc
push de
push hl
@@ -11,20 +11,20 @@ UpdateGBCPal_BGP::
ld a, [wLastBGP]
cp b
jr z, .noChangeInBGP
- farcall _UpdateGBCPal_BGP
+ farcall _UpdateCGBPal_BGP
.noChangeInBGP
pop hl
pop de
pop bc
-.notGBC
+.notCGB
pop af
ret
-UpdateGBCPal_OBP0::
+UpdateCGBPal_OBP0::
push af
- ldh a, [hGBC]
+ ldh a, [hOnCGB]
and a
- jr z, .notGBC
+ jr z, .notCGB
push bc
push de
push hl
@@ -33,23 +33,23 @@ UpdateGBCPal_OBP0::
ld a, [wLastOBP0]
cp b
jr z, .noChangeInOBP0
- ld b, BANK(_UpdateGBCPal_OBP)
- ld hl, _UpdateGBCPal_OBP
+ ld b, BANK(_UpdateCGBPal_OBP)
+ ld hl, _UpdateCGBPal_OBP
ld c, CONVERT_OBP0
call Bankswitch
.noChangeInOBP0
pop hl
pop de
pop bc
-.notGBC
+.notCGB
pop af
ret
-UpdateGBCPal_OBP1::
+UpdateCGBPal_OBP1::
push af
- ldh a, [hGBC]
+ ldh a, [hOnCGB]
and a
- jr z, .notGBC
+ jr z, .notCGB
push bc
push de
push hl
@@ -58,15 +58,15 @@ UpdateGBCPal_OBP1::
ld a, [wLastOBP1]
cp b
jr z, .noChangeInOBP1
- ld b, BANK(_UpdateGBCPal_OBP)
- ld hl, _UpdateGBCPal_OBP
+ ld b, BANK(_UpdateCGBPal_OBP)
+ ld hl, _UpdateCGBPal_OBP
ld c, CONVERT_OBP1
call Bankswitch
.noChangeInOBP1
pop hl
pop de
pop bc
-.notGBC
+.notCGB
pop af
ret
diff --git a/home/fade.asm b/home/fade.asm
index 3180db7b..313284ce 100644
--- a/home/fade.asm
+++ b/home/fade.asm
@@ -16,9 +16,9 @@ LoadGBPal::
ldh [rOBP0], a
ld a, [hli]
ldh [rOBP1], a
- call UpdateGBCPal_BGP
- call UpdateGBCPal_OBP0
- call UpdateGBCPal_OBP1
+ call UpdateCGBPal_BGP
+ call UpdateCGBPal_OBP0
+ call UpdateCGBPal_OBP1
ret
GBFadeInFromBlack::
@@ -37,9 +37,9 @@ GBFadeIncCommon:
ldh [rOBP0], a
ld a, [hli]
ldh [rOBP1], a
- call UpdateGBCPal_BGP
- call UpdateGBCPal_OBP0
- call UpdateGBCPal_OBP1
+ call UpdateCGBPal_BGP
+ call UpdateCGBPal_OBP0
+ call UpdateCGBPal_OBP1
ld c, 8
call DelayFrames
dec b
@@ -62,9 +62,9 @@ GBFadeDecCommon:
ldh [rOBP0], a
ld a, [hld]
ldh [rBGP], a
- call UpdateGBCPal_BGP
- call UpdateGBCPal_OBP0
- call UpdateGBCPal_OBP1
+ call UpdateCGBPal_BGP
+ call UpdateCGBPal_OBP0
+ call UpdateCGBPal_OBP1
ld c, 8
call DelayFrames
dec b
diff --git a/home/list_menu.asm b/home/list_menu.asm
index 095cae27..49ef07ea 100644
--- a/home/list_menu.asm
+++ b/home/list_menu.asm
@@ -129,7 +129,7 @@ DisplayListMenuIDLoop::
and a ; PCPOKEMONLISTMENU?
jr z, .pokemonList
; if it's an item menu
- assert wCurListMenuItem == wCurItem
+ ASSERT wCurListMenuItem == wCurItem
push hl
call GetItemPrice
pop hl
@@ -147,7 +147,7 @@ DisplayListMenuIDLoop::
call GetName
jr .storeChosenEntry
.pokemonList
- assert wCurListMenuItem == wCurPartySpecies
+ ASSERT wCurListMenuItem == wCurPartySpecies
ld hl, wPartyCount
ld a, [wListPointer]
cp l ; is it a list of party pokemon or box pokemon?
diff --git a/home/overworld.asm b/home/overworld.asm
index a661ec04..4fe60f0f 100644
--- a/home/overworld.asm
+++ b/home/overworld.asm
@@ -1359,12 +1359,12 @@ LoadCurrentMapView::
ld e, a
ld a, [wCurrentTileBlockMapViewPointer + 1]
ld d, a
- ld hl, wTileMapBackup
- ld b, $05
+ ld hl, wSurroundingTiles
+ ld b, SCREEN_BLOCK_HEIGHT
.rowLoop ; each loop iteration fills in one row of tile blocks
push hl
push de
- ld c, $06
+ ld c, SCREEN_BLOCK_WIDTH
.rowInnerLoop ; loop to draw each tile block of the current row
push bc
push de
@@ -1393,7 +1393,7 @@ LoadCurrentMapView::
.noCarry
; update tile map pointer to next row's address
pop hl
- ld a, $60
+ ld a, SURROUNDING_WIDTH * BLOCK_HEIGHT
add l
ld l, a
jr nc, .noCarry2
@@ -1401,19 +1401,19 @@ LoadCurrentMapView::
.noCarry2
dec b
jr nz, .rowLoop
- ld hl, wTileMapBackup
- ld bc, $0
+ ld hl, wSurroundingTiles
+ ld bc, 0
.adjustForYCoordWithinTileBlock
ld a, [wYBlockCoord]
and a
jr z, .adjustForXCoordWithinTileBlock
- ld bc, $30
+ ld bc, SURROUNDING_WIDTH * 2
add hl, bc
.adjustForXCoordWithinTileBlock
ld a, [wXBlockCoord]
and a
jr z, .copyToVisibleAreaBuffer
- ld bc, $2
+ ld bc, BLOCK_WIDTH / 2
add hl, bc
.copyToVisibleAreaBuffer
decoord 0, 0 ; base address for the tiles that are directly transferred to VRAM during V-blank
@@ -1426,7 +1426,7 @@ LoadCurrentMapView::
inc de
dec c
jr nz, .rowInnerLoop2
- ld a, $04
+ ld a, SURROUNDING_WIDTH - SCREEN_WIDTH
add l
ld l, a
jr nc, .noCarry3
@@ -1520,7 +1520,7 @@ ScheduleColumnRedrawHelper::
ld a, [hl]
ld [de], a
inc de
- ld a, 19
+ ld a, SCREEN_WIDTH - 1
add l
ld l, a
jr nc, .noCarry
@@ -1561,22 +1561,18 @@ DrawTileBlock::
ld d, h
ld e, l ; de = address of the tile block's tiles
pop hl
- ld c, $04 ; 4 loop iterations
+ ld c, BLOCK_HEIGHT ; 4 loop iterations
.loop ; each loop iteration, write 4 tile numbers
push bc
+REPT BLOCK_WIDTH - 1
ld a, [de]
ld [hli], a
inc de
- ld a, [de]
- ld [hli], a
- inc de
- ld a, [de]
- ld [hli], a
- inc de
+ENDR
ld a, [de]
ld [hl], a
inc de
- ld bc, $15
+ ld bc, SURROUNDING_WIDTH - (BLOCK_WIDTH - 1)
add hl, bc
pop bc
dec c
diff --git a/home/palettes.asm b/home/palettes.asm
index af66e74b..967b05a5 100644
--- a/home/palettes.asm
+++ b/home/palettes.asm
@@ -26,9 +26,9 @@ GBPalNormal::
ldh [rBGP], a
ld a, %11010000 ; 3100
ldh [rOBP0], a
- call UpdateGBCPal_BGP
- call UpdateGBCPal_OBP0
- call UpdateGBCPal_OBP1
+ call UpdateCGBPal_BGP
+ call UpdateCGBPal_OBP0
+ call UpdateCGBPal_OBP1
ret
GBPalWhiteOut::
@@ -37,9 +37,9 @@ GBPalWhiteOut::
ldh [rBGP], a
ldh [rOBP0], a
ldh [rOBP1], a
- call UpdateGBCPal_BGP
- call UpdateGBCPal_OBP0
- call UpdateGBCPal_OBP1
+ call UpdateCGBPal_BGP
+ call UpdateCGBPal_OBP0
+ call UpdateCGBPal_OBP1
ret
RunDefaultPaletteCommand::
diff --git a/home/pokemon.asm b/home/pokemon.asm
index 5d2c1a24..b66fe72d 100644
--- a/home/pokemon.asm
+++ b/home/pokemon.asm
@@ -112,7 +112,11 @@ LoadFrontSpriteByMonIndex::
cp NUM_POKEMON + 1
jr c, .validDexNumber ; dex >#151 invalid
.invalidDexNumber
- ld a, RHYDON ; $1
+ ; This is the so-called "Rhydon trap" or "Rhydon glitch"
+ ; to fail-safe invalid dex numbers
+ ; (see https://glitchcity.wiki/wiki/Rhydon_trap
+ ; or https://bulbapedia.bulbagarden.net/wiki/Rhydon_glitch)
+ ld a, RHYDON
ld [wCurPartySpecies], a
ret
.validDexNumber
diff --git a/home/start.asm b/home/start.asm
index 366806e9..2b284647 100644
--- a/home/start.asm
+++ b/home/start.asm
@@ -1,10 +1,10 @@
_Start::
- cp GBC
- jr z, .gbc
+ cp CGB
+ jr z, .cgb
xor a
jr .ok
-.gbc
+.cgb
ld a, TRUE
.ok
- ldh [hGBC], a
+ ldh [hOnCGB], a
jp Init
diff --git a/home/text.asm b/home/text.asm
index 9bc7f3cf..7c3589fd 100644
--- a/home/text.asm
+++ b/home/text.asm
@@ -111,7 +111,7 @@ NextChar::
inc de
jp PlaceNextChar
-NullChar:: ; unused
+NullChar::
ld b, h
ld c, l
pop hl
diff --git a/home/text_script.asm b/home/text_script.asm
index af89a043..097c1028 100644
--- a/home/text_script.asm
+++ b/home/text_script.asm
@@ -5,7 +5,7 @@ UnknownText_2812:: ; unreferenced
; this function is used to display sign messages, sprite dialog, etc.
; INPUT: [hSpriteIndex] = sprite ID or [hTextID] = text ID
DisplayTextID::
- assert hSpriteIndex == hTextID ; these are at the same memory location
+ ASSERT hSpriteIndex == hTextID ; these are at the same memory location
ldh a, [hLoadedROMBank]
push af
farcall DisplayTextIDInit ; initialization
diff --git a/home/yes_no.asm b/home/yes_no.asm
index 3f5a5a45..8d995832 100644
--- a/home/yes_no.asm
+++ b/home/yes_no.asm
@@ -26,7 +26,7 @@ YesNoChoicePokeCenter::
lb bc, 8, 12
jr DisplayYesNoChoice
-WideYesNoChoice:: ; unused
+WideYesNoChoice:: ; unreferenced
call SaveScreenTilesToBuffer1
ld a, WIDE_YES_NO_MENU
ld [wTwoOptionMenuID], a