Module Mbcs.Mbc

mbc.ml - Definitions for the memory-bank controller type

https://gbdev.gg8.se/wiki/articles/Memory_Bank_Controllers

type mbc =
  1. | Mbc0 of mbc_funcs
  2. | Mbc1 of {
    1. title : string;
    2. rom_bank : Utils.U8.u8;
    3. ram_bank : Utils.U8.u8;
    4. ram_enabled : bool;
    5. ram_selected : bool;
    6. eram : bytes;
    }
  3. | Mbc2 of {
    1. rom_bank : Utils.U8.u8;
    }
  4. | Mbc3 of {
    1. title : string;
    2. rom_bank : Utils.U8.u8;
    3. ram_bank : Utils.U8.u8;
    4. rtc_register : Utils.U8.u8;
    5. ram_timer_enabled : bool;
    6. ram_selected : bool;
    7. eram : bytes;
    }

Constructors for each MBC to implement

and mbc_funcs = {
  1. read : mbc -> bytes -> Utils.U16.u16 -> Utils.U8.u8;
  2. write : mbc -> Utils.U16.u16 -> Utils.U8.u8 -> unit;
  3. set_title : mbc -> string -> unit;
  4. load : mbc -> unit;
}

Common functions shared by all MBCs