Load cartridge
This commit is contained in:
parent
2f31756be8
commit
d197159f5a
7 changed files with 40 additions and 9 deletions
|
@ -1,9 +1,16 @@
|
|||
(* State of the world, contains all the required information at any point *)
|
||||
type t = {
|
||||
cartridge : option Cartridge.t;
|
||||
mutable cartridge : Cartridge.t option;
|
||||
}
|
||||
|
||||
(* Global reference *)
|
||||
let state = ref {
|
||||
cartridge = None
|
||||
}
|
||||
|
||||
let load_cartridge file =
|
||||
let cartridge = Cartridge.read_cartridge file in
|
||||
!state.cartridge <- cartridge;
|
||||
match cartridge with
|
||||
| Some _ -> true
|
||||
| None -> false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue