Source

OCaml-Chip8 / src / font.ml

Pierre Surply 580b59b 


























































































































(*
** font.ml for OCaml-Chip8 in /home/surply_p
** 
** Made by Pierre Surply
** <pierre.surply@gmail.com>
** 
** Started on  Sun Aug  5 18:19:12 2012 Pierre Surply
** Last update Sun Aug  5 18:34:11 2012 Pierre Surply
*)

open Chip8

let init_font () = 
  (* 0 *)
  chip8.mem.(0) <- 0xF0;
  chip8.mem.(1) <- 0x90;
  chip8.mem.(2) <- 0x90;
  chip8.mem.(3) <- 0x90;
  chip8.mem.(4) <- 0xF0; 
  
  (* 1 *)
  chip8.mem.(5) <- 0x20;
  chip8.mem.(6) <- 0x60;
  chip8.mem.(7) <- 0x20;
  chip8.mem.(8) <- 0x20;
  chip8.mem.(9) <- 0x70; 

  (* 2 *)
  chip8.mem.(10) <- 0xF0;
  chip8.mem.(11) <- 0x10;
  chip8.mem.(12) <- 0xF0;
  chip8.mem.(13) <- 0x80;
  chip8.mem.(14) <- 0xF0; 
  
  (* 3 *)
  chip8.mem.(15) <- 0xF0;
  chip8.mem.(16) <- 0x10;
  chip8.mem.(17) <- 0xF0;
  chip8.mem.(18) <- 0x10;
  chip8.mem.(19) <- 0xF0; 

  (* 4 *)
  chip8.mem.(20) <- 0x90;
  chip8.mem.(21) <- 0x90;
  chip8.mem.(22) <- 0xF0;
  chip8.mem.(23) <- 0x10;
  chip8.mem.(24) <- 0x10; 
  
  (* 5 *)
  chip8.mem.(25) <- 0xF0;
  chip8.mem.(26) <- 0x80;
  chip8.mem.(27) <- 0xF0;
  chip8.mem.(28) <- 0x10;
  chip8.mem.(29) <- 0xF0; 

  (* 6 *)
  chip8.mem.(30) <- 0xF0;
  chip8.mem.(31) <- 0x80;
  chip8.mem.(32) <- 0xF0;
  chip8.mem.(33) <- 0x90;
  chip8.mem.(34) <- 0xF0; 
  
  (* 7 *)
  chip8.mem.(35) <- 0xF0;
  chip8.mem.(36) <- 0x10;
  chip8.mem.(37) <- 0x20;
  chip8.mem.(38) <- 0x40;
  chip8.mem.(39) <- 0x40; 

  (* 8 *)
  chip8.mem.(40) <- 0xF0;
  chip8.mem.(41) <- 0x90;
  chip8.mem.(42) <- 0xF0;
  chip8.mem.(43) <- 0x90;
  chip8.mem.(44) <- 0xF0; 
  
  (* 9 *)
  chip8.mem.(45) <- 0xF0;
  chip8.mem.(46) <- 0x90;
  chip8.mem.(47) <- 0xF0;
  chip8.mem.(48) <- 0x10;
  chip8.mem.(49) <- 0xF0; 

  (* A *)
  chip8.mem.(50) <- 0xF0;
  chip8.mem.(51) <- 0x90;
  chip8.mem.(52) <- 0xF0;
  chip8.mem.(53) <- 0x90;
  chip8.mem.(54) <- 0x90; 
  
  (* B *)
  chip8.mem.(55) <- 0xE0;
  chip8.mem.(56) <- 0x90;
  chip8.mem.(57) <- 0xE0;
  chip8.mem.(58) <- 0x90;
  chip8.mem.(59) <- 0xE0; 

  (* C *)
  chip8.mem.(60) <- 0xF0;
  chip8.mem.(61) <- 0x80;
  chip8.mem.(62) <- 0x80;
  chip8.mem.(63) <- 0x80;
  chip8.mem.(64) <- 0xF0; 
  
  (* D *)
  chip8.mem.(65) <- 0xE0;
  chip8.mem.(66) <- 0x90;
  chip8.mem.(67) <- 0x90;
  chip8.mem.(68) <- 0x90;
  chip8.mem.(69) <- 0xE0; 

  (* E *)
  chip8.mem.(70) <- 0xF0;
  chip8.mem.(71) <- 0x80;
  chip8.mem.(72) <- 0xF0;
  chip8.mem.(73) <- 0x80;
  chip8.mem.(74) <- 0xF0; 
  
  (* F *)
  chip8.mem.(75) <- 0xF0;
  chip8.mem.(76) <- 0x80;
  chip8.mem.(77) <- 0xF0;
  chip8.mem.(78) <- 0x80;
  chip8.mem.(79) <- 0x80; 
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.