use screen size constants directly...

This commit is contained in:
2021-11-30 23:21:47 +01:00
parent bab32fa68d
commit 9c0346bc61
5 changed files with 25 additions and 32 deletions

View File

@@ -1,6 +1,5 @@
INCLUDE "hardware.inc"
INCLUDE "utils.inc"
INCLUDE "automata.inc"
RENDER_IN_HBL EQU 0
@@ -72,7 +71,7 @@ LCDStatInterruptHandler:
; go to next line
ld a, e
add a, SCRN_VX_B - TILE_WIDTH
add a, SCRN_VX_B - SCRN_X_B
ld e, a
jr nc, .nocarry
inc d
@@ -83,7 +82,7 @@ LCDStatInterruptHandler:
jr z, .finish
; reset tile counter
ld c, TILE_WIDTH
ld c, SCRN_X_B
jr .loop
@@ -137,9 +136,9 @@ StartRender:
ld [Rendered + 1], a
; start rendering
ld a, TILE_WIDTH
ld a, SCRN_X_B
ldh [TilesLeft], a
ld a, TILE_HEIGHT
ld a, SCRN_Y_B
ldh [LinesLeft], a
; enable v-blank and lcd stat interrupt for h-blank