bfirsh/jsnes

`load16bit` implement

heroboy opened this issue · 0 comments

Do you think load16bit should be implemented with load?
What if addr is in mem,and addr+1 is in mmap?

  load: function(addr) {
    if (addr < 0x2000) {
      return this.mem[addr & 0x7ff];
    } else {
      return this.nes.mmap.load(addr);
    }
  },

  load16bit: function(addr) {
    if (addr < 0x1fff) {
      return this.mem[addr & 0x7ff] | (this.mem[(addr + 1) & 0x7ff] << 8);
    } else {
      return this.nes.mmap.load(addr) | (this.nes.mmap.load(addr + 1) << 8);
    }
  },