Source

OCaml-Chip8 / src / opcode.ml

Pierre Surply 580b59b 






















































(*
** opcode.ml for OCaml-Chip8 in /home/surply_p
** 
** Made by Pierre Surply
** <pierre.surply@gmail.com>
** 
** Started on  Sat Aug  4 22:45:03 2012 Pierre Surply
** Last update Sun Aug  5 16:40:58 2012 Pierre Surply
*)

let nb_opcode = 35

type t_opcode = 
{
  mask :	int;
  id :		int
}

let opcodes = Array.make 35 {mask = 0; id = 0}

let init_opcodes () =
  opcodes.(0)  <- {mask = 0xF000; id=0x0000};
  opcodes.(1)  <- {mask = 0xFFFF; id=0x00E0};
  opcodes.(2)  <- {mask = 0xFFFF; id=0x00EE};
  opcodes.(3)  <- {mask = 0xF000; id=0x1000};
  opcodes.(4)  <- {mask = 0xF000; id=0x2000};
  opcodes.(5)  <- {mask = 0xF000; id=0x3000};
  opcodes.(6)  <- {mask = 0xF000; id=0x4000};
  opcodes.(7)  <- {mask = 0xF00F; id=0x5000};
  opcodes.(8)  <- {mask = 0xF000; id=0x6000};
  opcodes.(9)  <- {mask = 0xF000; id=0x7000};
  opcodes.(10) <- {mask = 0xF00F; id=0x8000};
  opcodes.(11) <- {mask = 0xF00F; id=0x8001};
  opcodes.(12) <- {mask = 0xF00F; id=0x8002};
  opcodes.(13) <- {mask = 0xF00F; id=0x8003};
  opcodes.(14) <- {mask = 0xF00F; id=0x8004};
  opcodes.(15) <- {mask = 0xF00F; id=0x8005};
  opcodes.(16) <- {mask = 0xF00F; id=0x8006};
  opcodes.(17) <- {mask = 0xF00F; id=0x8007};
  opcodes.(18) <- {mask = 0xF00F; id=0x800E};
  opcodes.(19) <- {mask = 0xF00F; id=0x9000};
  opcodes.(20) <- {mask = 0xF000; id=0xA000};
  opcodes.(21) <- {mask = 0xF000; id=0xB000};
  opcodes.(22) <- {mask = 0xF000; id=0xC000};
  opcodes.(23) <- {mask = 0xF000; id=0xD000};
  opcodes.(24) <- {mask = 0xF0FF; id=0xE09E};
  opcodes.(25) <- {mask = 0xF0FF; id=0xE0A1};
  opcodes.(26) <- {mask = 0xF0FF; id=0xF007};
  opcodes.(27) <- {mask = 0xF0FF; id=0xF00A};
  opcodes.(28) <- {mask = 0xF0FF; id=0xF015};
  opcodes.(29) <- {mask = 0xF0FF; id=0xF018};
  opcodes.(30) <- {mask = 0xF0FF; id=0xF01E};
  opcodes.(31) <- {mask = 0xF0FF; id=0xF029};
  opcodes.(32) <- {mask = 0xF0FF; id=0xF033};
  opcodes.(33) <- {mask = 0xF0FF; id=0xF055};
  opcodes.(34) <- {mask = 0xF0FF; id=0xF065}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.