Add more opcodes.

This commit is contained in:
Fabien Freling 2015-03-23 22:38:11 +01:00
parent b3ca33a814
commit b611dfdd49
2 changed files with 38 additions and 5 deletions

View file

@ -1,4 +1,5 @@
open Bytes
open Printf
(** http://bgb.bircd.org/pandocs.htm#memorymap
http://imrannazar.com/GameBoy-Emulation-in-JavaScript:-Memory *)
@ -31,7 +32,8 @@ let get_mem_bank mem addr =
| x when x < 0xFF80 -> mem.io, x - 0xFF00
| x when x < 0xFFFF -> mem.hram, x - 0xFF80
| 0xFFFF -> mem.interrupt, 0
| _ -> failwith "Invalid memory range."
| x -> eprintf "Memory access 0x%08X\n" x;
failwith "Invalid memory range."
let get mem addr =