Use constants for screen size in metatiles

This commit is contained in:
Rangi 2018-04-04 16:14:48 -04:00
parent aec3802587
commit 145efc1353
3 changed files with 17 additions and 15 deletions

View File

@ -18,8 +18,10 @@ BG_MAP_WIDTH EQU 32 ; tiles
BG_MAP_HEIGHT EQU 32 ; tiles BG_MAP_HEIGHT EQU 32 ; tiles
METATILE_WIDTH EQU 4 ; tiles METATILE_WIDTH EQU 4 ; tiles
SURROUNDING_WIDTH EQU 6 * METATILE_WIDTH ; tiles SCREEN_META_WIDTH EQU 6 ; metatiles
SURROUNDING_HEIGHT EQU 5 * METATILE_WIDTH ; tiles SCREEN_META_HEIGHT EQU 5 ; metatiles
SURROUNDING_WIDTH EQU SCREEN_META_WIDTH * METATILE_WIDTH ; tiles
SURROUNDING_HEIGHT EQU SCREEN_META_HEIGHT * METATILE_WIDTH ; tiles
HP_BAR_LENGTH EQU 6 ; tiles HP_BAR_LENGTH EQU 6 ; tiles

View File

@ -1454,8 +1454,8 @@ BufferScreen:: ; 2879
ld h, [hl] ld h, [hl]
ld l, a ld l, a
ld de, wScreenSave ld de, wScreenSave
ld c, $5 ld c, SCREEN_META_HEIGHT
ld b, $6 ld b, SCREEN_META_WIDTH
.row .row
push bc push bc
push hl push hl
@ -1467,9 +1467,9 @@ BufferScreen:: ; 2879
jr nz, .col jr nz, .col
pop hl pop hl
ld a, [wMapWidth] ld a, [wMapWidth]
add $6 add 6
ld c, a ld c, a
ld b, $0 ld b, 0
add hl, bc add hl, bc
pop bc pop bc
dec c dec c
@ -1498,18 +1498,18 @@ SaveScreen:: ; 289d
ret ret
.up .up
ld de, wScreenSave + 6 ld de, wScreenSave + SCREEN_META_WIDTH
ld a, [hMapObjectIndexBuffer] ld a, [hMapObjectIndexBuffer]
ld c, a ld c, a
ld b, $0 ld b, 0
add hl, bc add hl, bc
jr .vertical jr .vertical
.down .down
ld de, wScreenSave ld de, wScreenSave
.vertical .vertical
ld b, 6 ld b, SCREEN_META_WIDTH
ld c, 4 ld c, SCREEN_META_HEIGHT - 1
jr SaveScreen_LoadNeighbor jr SaveScreen_LoadNeighbor
.left .left
@ -1520,8 +1520,8 @@ SaveScreen:: ; 289d
.right .right
ld de, wScreenSave ld de, wScreenSave
.horizontal .horizontal
ld b, 5 ld b, SCREEN_META_WIDTH - 1
ld c, 5 ld c, SCREEN_META_HEIGHT
jr SaveScreen_LoadNeighbor jr SaveScreen_LoadNeighbor
LoadNeighboringBlockData:: ; 28e3 LoadNeighboringBlockData:: ; 28e3
@ -1533,8 +1533,8 @@ LoadNeighboringBlockData:: ; 28e3
add 6 add 6
ld [hConnectionStripLength], a ld [hConnectionStripLength], a
ld de, wScreenSave ld de, wScreenSave
ld b, 6 ld b, SCREEN_META_WIDTH
ld c, 5 ld c, SCREEN_META_HEIGHT
SaveScreen_LoadNeighbor:: ; 28f7 SaveScreen_LoadNeighbor:: ; 28f7
.row .row

View File

@ -2769,7 +2769,7 @@ wMapGroup:: db ; dcb5 ; map group of current map
wMapNumber:: db ; dcb6 ; map number of current map wMapNumber:: db ; dcb6 ; map number of current map
wYCoord:: db ; dcb7 ; current y coordinate relative to top-left corner of current map wYCoord:: db ; dcb7 ; current y coordinate relative to top-left corner of current map
wXCoord:: db ; dcb8 ; current x coordinate relative to top-left corner of current map wXCoord:: db ; dcb8 ; current x coordinate relative to top-left corner of current map
wScreenSave:: ds 6 * 5 wScreenSave:: ds SCREEN_META_WIDTH * SCREEN_META_HEIGHT
wCurrMapDataEnd:: wCurrMapDataEnd::