You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
849 B
55 lines
849 B
4 years ago
|
include "video.inc"
|
||
|
include "hardware.inc"
|
||
|
|
||
|
section "home/video.asm@vram", vram[$9800]
|
||
|
v_bgmap1:: ds $400
|
||
|
v_bgmap2:: ds $400
|
||
|
|
||
|
section "home/video.asm", rom0
|
||
|
|
||
|
lcd_vblank_wait::
|
||
|
ldh a, [r_ly]
|
||
|
cp r_ly_vblank + 1
|
||
|
jr nz, lcd_vblank_wait
|
||
|
ret
|
||
|
|
||
|
lcd_blank_wait::
|
||
|
push af
|
||
|
.loop
|
||
|
ldh a, [r_stat]
|
||
|
and r_stat_mode
|
||
|
cp r_stat_mode_vblank + 1
|
||
|
jr nc, .loop
|
||
|
pop af
|
||
|
ret
|
||
|
|
||
|
lcd_disable::
|
||
|
call lcd_vblank_wait
|
||
|
|
||
|
ld hl, r_lcdc
|
||
|
res r_lcdc_on_f, [hl]
|
||
|
|
||
|
ld hl, r_ie
|
||
|
res r_int_vblank_f, [hl]
|
||
|
ret
|
||
|
|
||
|
lcd_enable::
|
||
|
ld hl, r_lcdc
|
||
|
set r_lcdc_on_f, [hl]
|
||
|
|
||
|
ld hl, r_if
|
||
|
res r_int_vblank_f, [hl]
|
||
|
|
||
|
ld hl, r_ie
|
||
|
set r_int_vblank_f, [hl]
|
||
|
ret
|
||
|
|
||
|
vram_clear::
|
||
|
xor a
|
||
|
ld hl, mmap_vram
|
||
|
ld bc, mmap_vram_end - mmap_vram
|
||
|
call memset
|
||
|
ld hl, mmap_oam
|
||
|
ld bc, mmap_oam_end - mmap_oam
|
||
|
jp memset
|