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.
44 lines
567 B
44 lines
567 B
include "defines.inc"
|
|
include "hardware.inc"
|
|
|
|
section "home/vblank.asm@hram", hram
|
|
h_vblank: db
|
|
|
|
section "home/vblank.asm@int40", rom0[$40]
|
|
push af
|
|
ld a, 1
|
|
ldh [h_vblank], a
|
|
jp vblank
|
|
|
|
section "home/vblank.asm", rom0
|
|
|
|
vblank:
|
|
push hl
|
|
push bc
|
|
push de
|
|
|
|
call joypad_read
|
|
|
|
pop de
|
|
pop bc
|
|
pop hl
|
|
pop af
|
|
reti
|
|
|
|
vblank_wait::
|
|
xor a
|
|
ldh [h_vblank], a
|
|
.loop
|
|
halt
|
|
ld a, [h_vblank]
|
|
and a
|
|
jr z, .loop
|
|
ret
|
|
|
|
vblank_wait_frames::
|
|
ld c, a
|
|
.loop
|
|
call vblank_wait
|
|
dec c
|
|
jr nz, .loop
|
|
ret
|
|
|