;;-----------------------------------------------------------------------------
;; This example initialise a firmware frame flyback (vsync/50Hz)
;; interrupt.
;; 
;; This kind of interrupt runs with the firmware.
;;

.kl_new_frame_fly equ &bcd7
.kl_init_event equ &bcef

;;-----------------------------------------------------------------------------

org &8000
nolist

;; setup an interrupt to be executed every frame flyback 
;; (50hz)
ld hl,ff_event_block
ld b,&81					;; class (asynchronous, near address)
ld c,0						;; rom select
ld de,ff_event_routine
call kl_new_frame_fly
ret

;;-----------------------------------------------------------------------------

.ff_event_block 
defs 10

;;-----------------------------------------------------------------------------

.ff_event_routine
ret

;;-----------------------------------------------------------------------------