public void setMemory(int address, byte val, boolean shouldNotify) {
        boolean processed = false;
        if (isCPUMapped(address)) {
            setCPUMappedMemory(address, val);
            processed = true;
        }
        if (_ppu.isWriteMapped(address)) {
            _ppu.setMappedMemory(address, val);
            processed = true;
        }
        if (_controllers.isWriteMapped(address)) {
            _controllers.setMappedMemory(address, val);
            processed = true;
        }
        if (_apu.isWriteMapped(address)) {
            _apu.setMappedMemory(address, val);
            processed = true;
        }
        if (_mapper.isWriteMapped(address)) {
            _mapper.setMappedMemory(address, val);
        }
        if(!processed) {
            _memoryData[address] = val;
        }
        if (shouldNotify && _writeObserver != null) {
            _writeObserver.updateWriteMemory(address, val);
        }
    }