Replace raw hex values with HRAM constants

To do: turn constants into labels and use ldh
This commit is contained in:
Rangi 2020-07-03 22:11:35 -04:00
parent 35deb77113
commit 6ef36800b0
65 changed files with 311 additions and 248 deletions

View file

@ -63,7 +63,7 @@ RedrawMapView:
ld a, [hli]
ld h, [hl]
ld l, a
ld de, -2 * 32
ld de, -2 * BG_MAP_WIDTH
add hl, de
ld a, h
and $3
@ -73,23 +73,23 @@ RedrawMapView:
ld a, h
ld [wBuffer + 1], a ; this copy of the address is not used
ld a, 2
ld [$ffbe], a
ld c, 9 ; number of rows of 2x2 tiles (this covers the whole screen)
ld [hRedrawMapViewRowOffset], a
ld c, SCREEN_HEIGHT / 2 ; number of rows of 2x2 tiles (this covers the whole screen)
.redrawRowLoop
push bc
push hl
push hl
ld hl, wTileMap - 2 * SCREEN_WIDTH
ld de, SCREEN_WIDTH
ld a, [$ffbe]
ld a, [hRedrawMapViewRowOffset]
.calcWRAMAddrLoop
add hl, de
dec a
jr nz, .calcWRAMAddrLoop
call CopyToRedrawRowOrColumnSrcTiles
pop hl
ld de, $20
ld a, [$ffbe]
ld de, BG_MAP_WIDTH
ld a, [hRedrawMapViewRowOffset]
ld c, a
.calcVRAMAddrLoop
add hl, de
@ -104,7 +104,7 @@ RedrawMapView:
ld a, REDRAW_ROW
ld [hRedrawRowOrColumnMode], a
call DelayFrame
ld hl, $ffbe
ld hl, hRedrawMapViewRowOffset
inc [hl]
inc [hl]
pop hl