Module Memory.Vmem

vmem.ml - Virtual Memory implementation

type mem_ctrl = {
  1. model : Boot_roms.Device_boot_rom_select.model;
  2. boot_rom_enabled : bool Stdlib.ref;
  3. boot_rom : bytes;
  4. rom : Rom.rom;
  5. vram : Ram.ram_bank;
  6. wram : Ram.ram_bank;
  7. oam : Ram.ram_bank;
  8. hram : Ram.ram_bank;
  9. ppu : Ppu.Pprocessor.ppu;
}

Emulates RAM and ROM state

val _init_mem_ctrl : string -> Rom.rom -> mem_ctrl

Returns an initialized RAM and ROM state

val read : mem_ctrl -> int -> char

Read from memory

val write : mem_ctrl -> int -> char -> unit

Write to memory

val update_hw_cycles : mem_ctrl -> int -> unit

Synchronize cycles across individual components