Пример #1
0
        partial void ResetMemory()
        {
            // Reallocate the RAM block if the Mapper request more memory than currently allocated
            if (mapper != null && mapper.RamSize > externalRamBlock.Length)
            {
                externalRamBlock.Dispose();
                externalRamBlock = new MemoryBlock(mapper.RamSize);
            }

            // Fill various RAM areas with random data at “boot” time
            // This allows for erasing the previous game residual information.
            unsafe
            {
                // Fill the video RAM.
                RandomFill(videoMemory, videoMemoryBlock.Length);
                // Fill the OAM.
                RandomFill(objectAttributeMemory, objectAttributeMemoryBlock.Length);
                // Fill the “trash” memory. (Invalid memory)
                RandomFill(trashMemory, 256);
            }

            videoRamBank      = 0;
            workRamBank       = 1;
            internalRomMapped = false;

            ResetSegments();
            ResetWriteHandlers();
        }
Пример #2
0
 partial void DisposeMemory()
 {
     paletteMemoryBlock.Dispose();
     externalRamBlock.Dispose();
     videoMemoryBlock.Dispose();
     workMemoryBlock.Dispose();
     segmentMemoryBlock.Dispose();
 }
Пример #3
0
 public void Teardown()
 {
     _memory.Dispose();
     _context.Dispose();
     _ram.Dispose();
     _memory     = null;
     _context    = null;
     _cpuContext = null;
     _unicornEmu = null;
 }
Пример #4
0
 private void Dispose(bool disposing)
 {
     if (disposing)
     {
         MemoryBlock scan0P = Interlocked.Exchange <MemoryBlock>(ref this.scan0, null);
         if (scan0P != null)
         {
             scan0P.Dispose();
             scan0P = null;
         }
     }
 }
Пример #5
0
        public void Teardown()
        {
            _memory.DecrementReferenceCount();
            _context.Dispose();
            _ram.Dispose();

            _memory     = null;
            _context    = null;
            _cpuContext = null;
            _unicornEmu = null;

            _usingMemory = false;
        }
Пример #6
0
 public void Dispose() => _impl.Dispose();
Пример #7
0
 public void Dispose()
 {
     _renderPaletteMemoryBlock.Dispose();
 }
Пример #8
0
 protected override void DisposeManaged()
 {
     _impl.Dispose();
 }
Пример #9
0
 public void Teardown()
 {
     _memoryBlock.Dispose();
 }
Пример #10
0
 public void Dispose()
 {
     _videoMemoryBlock.Dispose();
     _objectAttributeMemoryBlock.Dispose();
     _paletteMemoryBlock.Dispose();
 }