Beispiel #1
0
  public void write(int address, int data) {

    if (address >= 0x0000 && address < 0x2000) {
      /* Writing to this address is supposed to enable/disable RAM. However, Pan Docs
       * fails to explain which specific values enable and disable RAM. Therefore, RAM
       * is treated as always ON.
       */
      // TODO Find information on this.
    } else if (address >= 0x2000 && address < 0x4000) {
      if ((data & 0x10) == 0) {
        setRomBank(data & 0x0F);
      }
    } else if (address >= ADDRESS_ERAM_START && address < ADDRESS_ERAM_4BIT_END && ramEnable) {
      eram.write(address, data);
    }
  }