Change of heart, begin is cool
This commit is contained in:
parent
77f7c7bef3
commit
c6106203eb
3 changed files with 14 additions and 17 deletions
|
@ -16,7 +16,7 @@ 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 (
|
||||
if cycles_remaining > 0 then begin
|
||||
printf "\n";
|
||||
let inst, cycles = Cpu.run cpu mem.map in
|
||||
printf "[Instruction] %s\n" inst;
|
||||
|
@ -24,7 +24,7 @@ let rec run (cpu: Cpu.t) (mem: Memory.t) (screen: Screen.t) =
|
|||
Memory.update_timers mem cycles;
|
||||
|
||||
run_for cpu mem (cycles_remaining - cycles)
|
||||
)
|
||||
end
|
||||
in
|
||||
run_for cpu mem cycles_per_frame;
|
||||
|
||||
|
@ -59,11 +59,11 @@ let power_up cartridge =
|
|||
|
||||
|
||||
let () =
|
||||
if Array.length Sys.argv < 2 then (
|
||||
if Array.length Sys.argv < 2 then begin
|
||||
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