aboutsummaryrefslogtreecommitdiffstats
path: root/home/vcopy.asm
diff options
context:
space:
mode:
authordannye <33dannye@gmail.com>2026-01-17 22:38:33 -0600
committerdannye <33dannye@gmail.com>2026-01-17 22:38:33 -0600
commitbc2354dd6626ce28bb9561547ed2107cfa56c18e (patch)
tree5902d4c3389253c76b7c3351e0d7dfecb551c28d /home/vcopy.asm
parentIdentify characters in `_OakSpeechText2B` and `Printer_GetMonStats.IDNo` (#144) (diff)
parentUse macros for `WildMonEncounterSlotChances` (#562) (diff)
downloadpokeyellow-bc2354dd6626ce28bb9561547ed2107cfa56c18e.tar.gz
pokeyellow-bc2354dd6626ce28bb9561547ed2107cfa56c18e.tar.xz
pokeyellow-bc2354dd6626ce28bb9561547ed2107cfa56c18e.zip
Merge branch 'master' of https://github.com/pret/pokered
Diffstat (limited to 'home/vcopy.asm')
-rw-r--r--home/vcopy.asm29
1 files changed, 17 insertions, 12 deletions
diff --git a/home/vcopy.asm b/home/vcopy.asm
index 1a67cdb5..c9fcfb34 100644
--- a/home/vcopy.asm
+++ b/home/vcopy.asm
@@ -20,9 +20,14 @@ GetRowColAddressBgMap::
; INPUT: h - high byte of background tile map address in VRAM
ClearBgMap::
ld a, ' '
- jr .next
+ jr FillBgMapCommon
+
+; fills a VRAM background map with tile index in register l
+; INPUT: h - high byte of background tile map address in VRAM
+FillBgMap:: ; unreferenced
ld a, l
-.next
+
+FillBgMapCommon:
ld de, TILEMAP_AREA
ld l, e
.loop
@@ -69,8 +74,8 @@ RedrawRowOrColumn::
.noCarry
; the following 4 lines wrap us from bottom to top if necessary
ld a, d
- and $3
- or $98
+ and HIGH(TILEMAP_AREA - 1)
+ or HIGH(vBGMap0)
ld d, a
dec c
jr nz, .loop1
@@ -86,7 +91,7 @@ RedrawRowOrColumn::
push de
call .DrawHalf ; draw upper half
pop de
- ld a, TILEMAP_WIDTH ; width of VRAM background map
+ ld a, TILEMAP_WIDTH
add e
ld e, a
; fall through and draw lower half
@@ -102,10 +107,10 @@ RedrawRowOrColumn::
ld a, e
inc a
; the following 6 lines wrap us from the right edge to the left edge if necessary
- and $1f
+ and %11111
ld b, a
ld a, e
- and $e0
+ and %11100000
or b
ld e, a
dec c
@@ -130,7 +135,7 @@ AutoBgMapTransfer::
dec a
jr z, .transferMiddleThird
.transferBottomThird
- hlcoord 0, 12
+ hlcoord 0, 2 * SCREEN_HEIGHT / 3
ld sp, hl
ldh a, [hAutoBGTransferDest + 1]
ld h, a
@@ -150,7 +155,7 @@ AutoBgMapTransfer::
ld a, TRANSFERMIDDLE
jr .doTransfer
.transferMiddleThird
- hlcoord 0, 6
+ hlcoord 0, SCREEN_HEIGHT / 3
ld sp, hl
ldh a, [hAutoBGTransferDest + 1]
ld h, a
@@ -161,7 +166,7 @@ AutoBgMapTransfer::
ld a, TRANSFERBOTTOM
.doTransfer
ldh [hAutoBGTransferPortion], a ; store next portion
- ld b, 6
+ ld b, SCREEN_HEIGHT / 3
TransferBgRows::
; unrolled loop and using pop for speed
@@ -364,7 +369,7 @@ UpdateMovingBgTiles::
; water
ld hl, vTileset tile $14
- ld c, $10
+ ld c, TILE_SIZE
ld a, [wMovingBGTilesCounter2]
inc a
@@ -409,7 +414,7 @@ UpdateMovingBgTiles::
ld hl, FlowerTile3
.copy
ld de, vTileset tile $03
- ld c, $10
+ ld c, TILE_SIZE
.loop
ld a, [hli]
ld [de], a