Module Ppu.Pprocessor

pprocessor.ml - PPU Logic

type ppu = {
  1. lcdc : Io.Virtual_register.virtual_register;
  2. stat : Io.Virtual_register.virtual_register;
  3. lyc : Io.Virtual_register.virtual_register;
  4. ly : Io.Virtual_register.virtual_register;
  5. scanline_cycles : int Stdlib.ref;
  6. frame_cycles : int Stdlib.ref;
}

Emulates PPU state

val _init_ppu : unit -> ppu

Returns initialized PPU state

val update_ppu_cycles : ppu -> int -> unit

Synchronizes the PPU with other hardware

type ppu_status =
  1. | Hblank
  2. | Vblank
  3. | OAM
  4. | Transfer

Represents which phase the PPU is in

val get_mode : ppu -> ppu_status

Compute the current PPU phase based on the STAT virtual register

val set_mode : ppu -> int -> unit

Update the current PPU phase