Display maps from OCaml
This commit is contained in:
parent
d4e753a6e1
commit
35ea1690fe
11 changed files with 121 additions and 10 deletions
|
@ -6,6 +6,7 @@
|
|||
* LICENSE file at the top level directory of this source tree.
|
||||
*)
|
||||
|
||||
open Bigarray
|
||||
open Bytes
|
||||
open Printf
|
||||
|
||||
|
@ -107,3 +108,13 @@ let update_timers mem cycles =
|
|||
(* TODO: INT 50 - Timer interupt *)
|
||||
end
|
||||
end
|
||||
|
||||
let background_map () =
|
||||
let bg_map = Array2.create Bigarray.int8_unsigned Bigarray.c_layout 8 8 in
|
||||
Array2.fill bg_map 0;
|
||||
for j = 0 to (Array2.dim2 bg_map) - 1 do
|
||||
for i = 0 to (Array2.dim1 bg_map) - 1 do
|
||||
bg_map.{i, j} <- (i + j * Array2.dim1 bg_map) mod 4
|
||||
done
|
||||
done;
|
||||
bg_map
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue