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