Add interrupt handlers in cpu
This commit is contained in:
parent
4df4aea484
commit
033f63ec42
2 changed files with 69 additions and 12 deletions
|
@ -6,15 +6,16 @@
|
|||
* LICENSE file at the top level directory of this source tree.
|
||||
*)
|
||||
|
||||
(* let IME = ref false;; *)
|
||||
let ime = ref false;;
|
||||
|
||||
type t =
|
||||
| V_Blank
|
||||
| LCD_Stat
|
||||
| Timer
|
||||
| Serial
|
||||
| Joypad
|
||||
| V_Blank
|
||||
| LCD_Stat
|
||||
| Timer
|
||||
| Serial
|
||||
| Joypad
|
||||
|
||||
(** Return the list of interrupt flags sorted by priority. *)
|
||||
let get_flags byte =
|
||||
|
||||
let nth_interrupt i =
|
||||
|
@ -34,6 +35,6 @@ let get_flags byte =
|
|||
get_flag byte (i + 1) (interrupt :: accu)
|
||||
else
|
||||
get_flag byte (i + 1) accu
|
||||
| _ -> accu in
|
||||
| _ -> List.rev accu in
|
||||
|
||||
get_flag byte 0 []
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue