mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-27 14:02:19 +00:00
Fix GetPointColor for VGA
This commit is contained in:
parent
e53eea929e
commit
cf659bbdb8
1 changed files with 5 additions and 4 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
//#define COSMOSDEBUG
|
//#define COSMOSDEBUG
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
|
|
@ -694,7 +694,7 @@ namespace Cosmos.HAL
|
||||||
mDebugger.Send($"GetPixel720x480x4({aX},{aY})");
|
mDebugger.Send($"GetPixel720x480x4({aX},{aY})");
|
||||||
|
|
||||||
uint offset = (uint)(aX / 8 + (PixelWidth / 8) * aY);
|
uint offset = (uint)(aX / 8 + (PixelWidth / 8) * aY);
|
||||||
|
int pixelOffset = (int)(7 - aX % 8);
|
||||||
uint pmask = 1;
|
uint pmask = 1;
|
||||||
|
|
||||||
uint color = 0;
|
uint color = 0;
|
||||||
|
|
@ -703,7 +703,8 @@ namespace Cosmos.HAL
|
||||||
{
|
{
|
||||||
SetPlane(p);
|
SetPlane(p);
|
||||||
|
|
||||||
if (_IO.VGAMemoryBlock.Bytes[offset] == 255)
|
var v = _IO.VGAMemoryBlock.Bytes[offset];
|
||||||
|
if ((v & (1 << pixelOffset)) != 0)
|
||||||
{
|
{
|
||||||
color += pmask;
|
color += pmask;
|
||||||
}
|
}
|
||||||
|
|
@ -711,7 +712,7 @@ namespace Cosmos.HAL
|
||||||
pmask <<= 1;
|
pmask <<= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return color;
|
return (uint)_Palette[color].ToArgb();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue