[BLUE] Optimize ScrIoControl for speed (#5185)

Optimize IOCTL_CONSOLE_FILL_OUTPUT_ATTRIBUTE and IOCTL_CONSOLE_FILL_OUTPUT_CHARACTER for speed by using cache. CORE-18838
This commit is contained in:
Katayama Hirofumi MZ 2023-03-28 08:12:38 +09:00 committed by GitHub
parent 6084da8c84
commit 3526ffc094
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1073,6 +1073,8 @@ ScrIoControl(
if (DeviceExtension->Enabled && DeviceExtension->VideoMemory)
{
UCHAR attr = Buf->wAttribute;
vidmem = DeviceExtension->VideoMemory;
offset = (Buf->dwCoord.X + Buf->dwCoord.Y * DeviceExtension->Columns) * 2 + 1;
@ -1082,7 +1084,7 @@ ScrIoControl(
for (dwCount = 0; dwCount < nMaxLength; dwCount++)
{
vidmem[offset + (dwCount * 2)] = (char)Buf->wAttribute;
vidmem[offset + (dwCount * 2)] = attr;
}
Buf->dwTransfered = dwCount;
}
@ -1271,6 +1273,8 @@ ScrIoControl(
if (DeviceExtension->Enabled && DeviceExtension->VideoMemory)
{
UCHAR ch = Buf->cCharacter;
vidmem = DeviceExtension->VideoMemory;
offset = (Buf->dwCoord.X + Buf->dwCoord.Y * DeviceExtension->Columns) * 2;
@ -1280,7 +1284,7 @@ ScrIoControl(
for (dwCount = 0; dwCount < nMaxLength; dwCount++)
{
vidmem[offset + (dwCount * 2)] = (char)Buf->cCharacter;
vidmem[offset + (dwCount * 2)] = ch;
}
Buf->dwTransfered = dwCount;
}