Improve wTrainerHUDTiles usage

This commit is contained in:
Rangi 2018-07-29 01:09:12 -04:00
parent 5145d69506
commit 0c746447e7
2 changed files with 13 additions and 10 deletions

View File

@ -101,7 +101,7 @@ StageBallTilesData:
DrawPlayerHUDBorder:
ld hl, .tiles
ld de, wTrainerHUDTiles
ld bc, 4
ld bc, .tiles_end - .tiles
call CopyBytes
hlcoord 18, 10
ld de, -1 ; start on right
@ -112,11 +112,12 @@ DrawPlayerHUDBorder:
db $77 ; bottom right
db $6f ; bottom left
db $76 ; bottom side
.tiles_end
DrawPlayerPartyIconHUDBorder:
ld hl, .tiles
ld de, wTrainerHUDTiles
ld bc, 4
ld bc, .tiles_end - .tiles
call CopyBytes
hlcoord 18, 10
ld de, -1 ; start on right
@ -127,11 +128,12 @@ DrawPlayerPartyIconHUDBorder:
db $5c ; bottom right
db $6f ; bottom left
db $76 ; bottom side
.tiles_end
DrawEnemyHUDBorder:
ld hl, .tiles
ld de, wTrainerHUDTiles
ld bc, 4
ld bc, .tiles_end - .tiles
call CopyBytes
hlcoord 1, 2
ld de, 1 ; start on left
@ -152,23 +154,24 @@ DrawEnemyHUDBorder:
db $74 ; bottom left
db $78 ; bottom right
db $76 ; bottom side
.tiles_end
PlaceHUDBorderTiles:
ld a, [wTrainerHUDTiles]
ld a, [wTrainerHUDTiles+0]
ld [hl], a
ld bc, SCREEN_WIDTH
add hl, bc
ld a, [wStartFlypoint]
ld a, [wTrainerHUDTiles+1]
ld [hl], a
ld b, $8
ld b, 8
.loop
add hl, de
ld a, [wMovementBuffer]
ld a, [wTrainerHUDTiles+3]
ld [hl], a
dec b
jr nz, .loop
add hl, de
ld a, [wEndFlypoint]
ld a, [wTrainerHUDTiles+2]
ld [hl], a
ret
@ -181,7 +184,7 @@ LinkBattle_TrainerHuds:
ld a, 10 * 8
ld [hli], a
ld [hl], 8 * 8
ld a, $8
ld a, 8
ld [wPlaceBallsDirection], a
ld hl, wVirtualOAMSprite00
call LoadTrainerHudOAM

View File

@ -1701,7 +1701,7 @@ NEXTU ; d002
; trainer HUD data
ds 1
wPlaceBallsDirection:: db
wTrainerHUDTiles:: db
wTrainerHUDTiles:: ds 4
NEXTU ; d002
; mobile participant nicknames