Update 'src/field.asm'

This commit is contained in:
villadelfia 2023-10-18 01:32:25 +00:00
parent d05febadac
commit 0c8ed9c424
1 changed files with 11 additions and 8 deletions

View File

@ -25,24 +25,27 @@ FieldClear::
call UnsafeMemSet
ret
; This routine will copy wField onto the screen.
BlitField::
; The first 14 rows can be blitted without checking for vram access.
; What to copy
ld de, wField + 10
DEF row = 0
; Where to put it
ld hl, FIELD_TOP_LEFT
; How much to increment hl after each row
ld bc, 32
; The first 14 rows can be blitted without checking for vram access.
REPT 14
ld hl, FIELD_TOP_LEFT+(32*row)
REPT 10
ld a, [de]
ld [hl+], a
inc de
ENDR
DEF row += 1
add hl, bc
ENDR
; The last 6 rows need some care.
REPT 6
ld hl, FIELD_TOP_LEFT+(32*row)
REPT 2
: ldh a, [rSTAT]
and STATF_LCD
@ -58,11 +61,11 @@ BlitField::
inc de
ENDR
ENDR
DEF row += 1
add hl, bc
ENDR
; This has to finish just before the first LCDC interrupt of the frame or stuff will break in weird ways.
ret
jp EventLoop
ENDC