diff --git a/source/Cosmos.HAL2/BlockDevice/ATAPI.cs b/source/Cosmos.HAL2/BlockDevice/ATAPI.cs index 403e5c7086..95df0c1825 100644 --- a/source/Cosmos.HAL2/BlockDevice/ATAPI.cs +++ b/source/Cosmos.HAL2/BlockDevice/ATAPI.cs @@ -134,7 +134,7 @@ public override void ReadBlock(ulong SectorNum, ulong SectorCount, ref byte[] aD //Convert the buffer into bytes byte[] array = new byte[SectorSize]; - int counter = 0; + /*int counter = 0; for (int i = 0; i < SectorSize / 2; i++) { var item = buffer[i]; @@ -142,6 +142,15 @@ public override void ReadBlock(ulong SectorNum, ulong SectorCount, ref byte[] aD array[counter++] = bytes[0]; array[counter++] = bytes[1]; + }*/ + + unsafe { + fixed (byte* ptr = array) { + fixed (ushort* ptr2 = buffer) { + byte* ptr3 = (byte*)ptr2; + MemoryOperations.Copy(ptr, ptr3, SectorSize); + } + } } //Return