Replace begin .. end with ( .. )
This commit is contained in:
parent
033f63ec42
commit
77f7c7bef3
3 changed files with 25 additions and 31 deletions
12
src/oboy.ml
12
src/oboy.ml
|
@ -16,16 +16,15 @@ let rec run (cpu: Cpu.t) (mem: Memory.t) (screen: Screen.t) =
|
|||
printf "start %f\n" start;
|
||||
|
||||
let rec run_for cpu (mem: Memory.t) cycles_remaining =
|
||||
if cycles_remaining > 0 then
|
||||
begin
|
||||
if cycles_remaining > 0 then (
|
||||
printf "\n";
|
||||
let inst, cycles = Cpu.run cpu mem.map in
|
||||
printf "[Instruction] %s\n" inst;
|
||||
|
||||
Memory.update_timers mem cycles;
|
||||
|
||||
|
||||
run_for cpu mem (cycles_remaining - cycles)
|
||||
end
|
||||
)
|
||||
in
|
||||
run_for cpu mem cycles_per_frame;
|
||||
|
||||
|
@ -60,12 +59,11 @@ let power_up cartridge =
|
|||
|
||||
|
||||
let () =
|
||||
if Array.length Sys.argv < 2 then
|
||||
begin
|
||||
if Array.length Sys.argv < 2 then (
|
||||
prerr_endline "Please specify a ROM.";
|
||||
eprintf "Usage: %s path/to/rom\n" Sys.argv.(0);
|
||||
exit 1;
|
||||
end;
|
||||
);
|
||||
|
||||
let cartridge = Cartridge.read_cartridge Sys.argv.(1) in
|
||||
match cartridge with
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue