   } else {
     0;
   }) * 1024;
+}
+
+def dump_rom() {
+  // Gather ROM information
+  // Title
+  let rom_title = malloc(16) as str;
+  strncpy(rom_title, (rom + 0x134) as str, 16);
+
+  // Licensee
+  let licensee = *(rom + 0x14B);
+  if licensee == 0x33 {
+    let licensee_0 = *(rom + 0x0144);
+    let licensee_1 = *(rom + 0x0145);
+
+    printf("warn: unexpected (new) licensee code: %02X %02X\n", licensee_0, licensee_1);
+  }
+
+  // CGB Flag
+  let cgb_mode = *(rom + 0x143);
+
+  // SGB Flag
+  let is_sgb = *(rom + 0x146) == 0x03;
+
+  // Cartridge Type
+  let cart = *(rom + 0x147);
+
+  // ROM Size
+  let rom_size = (32 * 1024) << *(rom + 0x148);
+
+  // External RAM Size
+  let ext_ram_size = rom_get_ext_ram_size();
 
   // Destination Code
   let dst_code = *(rom + 0x014A);


// Write 8-bits
def mmu_write8(address: uint16, value: uint8) {
  // ROM: $0000 – $7FFF
  if (address & 0xF000) <= 0x7000 {
    return;
  }


    if mode == 3 { return 0xFF; }

    return *(vram + (address & 0x1FFF));
  }

  // Work RAM: $C000 – $DFFF
