mirror of
https://github.com/pret/pokered.git
synced 2026-09-30 13:08:16 -05:00
Correct wTileMapBackup declared space (#487)
This commit is contained in:
@@ -10,6 +10,13 @@ DEF SCREEN_HEIGHT_PX EQU SCREEN_HEIGHT * TILE_WIDTH ; pixels
|
||||
DEF BG_MAP_WIDTH EQU 32 ; tiles
|
||||
DEF BG_MAP_HEIGHT EQU 32 ; tiles
|
||||
|
||||
DEF BLOCK_WIDTH EQU 4 ; tiles
|
||||
DEF BLOCK_HEIGHT EQU BLOCK_WIDTH ; tiles
|
||||
DEF SCREEN_BLOCK_WIDTH EQU 6 ; blocks
|
||||
DEF SCREEN_BLOCK_HEIGHT EQU 5 ; blocks
|
||||
DEF SURROUNDING_WIDTH EQU SCREEN_BLOCK_WIDTH * BLOCK_WIDTH ; tiles
|
||||
DEF SURROUNDING_HEIGHT EQU SCREEN_BLOCK_HEIGHT * BLOCK_HEIGHT ; tiles
|
||||
|
||||
DEF SPRITEBUFFERSIZE EQU 7 * 7 * LEN_1BPP_TILE
|
||||
|
||||
; HP bar
|
||||
|
||||
@@ -18,9 +18,9 @@ DisplayTownMap:
|
||||
hlcoord 1, 0
|
||||
ld de, wNameBuffer
|
||||
call PlaceString
|
||||
ld hl, wShadowOAM
|
||||
ld de, wTileMapBackup
|
||||
ld bc, $10
|
||||
ld hl, wShadowOAMSprite00
|
||||
ld de, wShadowOAMBackupSprite00
|
||||
ld bc, 4 * 4
|
||||
call CopyData
|
||||
ld hl, vSprites tile BIRD_BASE_TILE
|
||||
ld de, TownMapCursor
|
||||
@@ -63,8 +63,8 @@ DisplayTownMap:
|
||||
ld de, wNameBuffer
|
||||
call PlaceString
|
||||
ld hl, wShadowOAMSprite04
|
||||
ld de, wTileMapBackup + 16
|
||||
ld bc, $10
|
||||
ld de, wShadowOAMBackupSprite04
|
||||
ld bc, 4 * 4
|
||||
call CopyData
|
||||
.inputLoop
|
||||
call TownMapSpriteBlinkingAnimation
|
||||
@@ -366,8 +366,8 @@ DrawPlayerOrBirdSprite:
|
||||
cp "@"
|
||||
jr nz, .loop
|
||||
ld hl, wShadowOAM
|
||||
ld de, wTileMapBackup
|
||||
ld bc, $a0
|
||||
ld de, wShadowOAMBackup
|
||||
ld bc, NUM_SPRITE_OAM_STRUCTS * 4
|
||||
jp CopyData
|
||||
|
||||
DisplayWildLocations:
|
||||
@@ -414,8 +414,8 @@ DisplayWildLocations:
|
||||
call DrawPlayerOrBirdSprite
|
||||
.done
|
||||
ld hl, wShadowOAM
|
||||
ld de, wTileMapBackup
|
||||
ld bc, $a0
|
||||
ld de, wShadowOAMBackup
|
||||
ld bc, NUM_SPRITE_OAM_STRUCTS * 4
|
||||
jp CopyData
|
||||
|
||||
AreaUnknownText:
|
||||
@@ -602,15 +602,15 @@ TownMapSpriteBlinkingAnimation::
|
||||
cp 50
|
||||
jr nz, .done
|
||||
; show sprites when the counter reaches 50
|
||||
ld hl, wTileMapBackup
|
||||
ld hl, wShadowOAMBackup
|
||||
ld de, wShadowOAM
|
||||
ld bc, $90
|
||||
ld bc, (NUM_SPRITE_OAM_STRUCTS - 4) * 4
|
||||
call CopyData
|
||||
xor a
|
||||
jr .done
|
||||
.hideSprites
|
||||
ld hl, wShadowOAM
|
||||
ld b, $24
|
||||
ld b, NUM_SPRITE_OAM_STRUCTS - 4
|
||||
ld de, $4
|
||||
.hideSpritesLoop
|
||||
ld [hl], $a0
|
||||
|
||||
@@ -1357,12 +1357,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
|
||||
@@ -1391,7 +1391,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
|
||||
@@ -1399,19 +1399,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
|
||||
@@ -1424,7 +1424,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
|
||||
@@ -1755,7 +1755,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
|
||||
@@ -1796,22 +1796,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
|
||||
|
||||
15
ram/wram.asm
15
ram/wram.asm
@@ -161,6 +161,19 @@ UNION
|
||||
; (e.g. if menus are drawn on top)
|
||||
wTileMapBackup:: ds SCREEN_WIDTH * SCREEN_HEIGHT
|
||||
|
||||
NEXTU
|
||||
; buffer for the blocks surrounding the player (6 columns by 5 rows of 4x4-tile blocks)
|
||||
wSurroundingTiles:: ds SURROUNDING_WIDTH * SURROUNDING_HEIGHT
|
||||
|
||||
NEXTU
|
||||
; buffer for temporarily saving and restoring shadow OAM
|
||||
wShadowOAMBackup::
|
||||
; wShadowOAMBackupSprite00 - wShadowOAMBackupSprite39
|
||||
FOR n, NUM_SPRITE_OAM_STRUCTS
|
||||
wShadowOAMBackupSprite{02d:n}:: sprite_oam_struct wShadowOAMBackupSprite{02d:n}
|
||||
ENDR
|
||||
wShadowOAMBackupEnd::
|
||||
|
||||
NEXTU
|
||||
; list of indexes to patch with SERIAL_NO_DATA_BYTE after transfer
|
||||
wSerialPartyMonsPatchList:: ds 200
|
||||
@@ -169,8 +182,6 @@ wSerialPartyMonsPatchList:: ds 200
|
||||
wSerialEnemyMonsPatchList:: ds 200
|
||||
ENDU
|
||||
|
||||
ds 80
|
||||
|
||||
|
||||
SECTION "Overworld Map", WRAM0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user