Fix the only known remaining (libvgl) bug for 24-bit modes, and enable
support for 24-bit modes. The non-segmented case has worked for a long time, but the segmented case could never have worked since 24-bit accesses may cross a window boundary but the window was not changed in the middle of the specialized 24-bit accesses for writing a single pixel.
This commit is contained in:
parent
a73b15498c
commit
ea0a990509
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=346745
@ -42,8 +42,6 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include <sys/consio.h>
|
#include <sys/consio.h>
|
||||||
#include "vgl.h"
|
#include "vgl.h"
|
||||||
|
|
||||||
/* XXX Direct Color 24bits modes unsupported */
|
|
||||||
|
|
||||||
#define min(x, y) (((x) < (y)) ? (x) : (y))
|
#define min(x, y) (((x) < (y)) ? (x) : (y))
|
||||||
#define max(x, y) (((x) > (y)) ? (x) : (y))
|
#define max(x, y) (((x) > (y)) ? (x) : (y))
|
||||||
|
|
||||||
@ -223,11 +221,9 @@ VGLInit(int mode)
|
|||||||
case 2:
|
case 2:
|
||||||
VGLDisplay->Type = VIDBUF16;
|
VGLDisplay->Type = VIDBUF16;
|
||||||
break;
|
break;
|
||||||
#if notyet
|
|
||||||
case 3:
|
case 3:
|
||||||
VGLDisplay->Type = VIDBUF24;
|
VGLDisplay->Type = VIDBUF24;
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
case 4:
|
case 4:
|
||||||
VGLDisplay->Type = VIDBUF32;
|
VGLDisplay->Type = VIDBUF32;
|
||||||
break;
|
break;
|
||||||
|
@ -51,7 +51,7 @@ static byte VGLSavePaletteBlue[256];
|
|||||||
void
|
void
|
||||||
VGLSetXY(VGLBitmap *object, int x, int y, u_long color)
|
VGLSetXY(VGLBitmap *object, int x, int y, u_long color)
|
||||||
{
|
{
|
||||||
int offset, undermouse;
|
int offset, soffset, undermouse;
|
||||||
|
|
||||||
VGLCheckSwitch();
|
VGLCheckSwitch();
|
||||||
if (x>=0 && x<object->VXsize && y>=0 && y<object->VYsize) {
|
if (x>=0 && x<object->VXsize && y>=0 && y<object->VYsize) {
|
||||||
@ -67,7 +67,6 @@ VGLSetXY(VGLBitmap *object, int x, int y, u_long color)
|
|||||||
switch (object->Type) {
|
switch (object->Type) {
|
||||||
case VIDBUF8S:
|
case VIDBUF8S:
|
||||||
case VIDBUF16S:
|
case VIDBUF16S:
|
||||||
case VIDBUF24S:
|
|
||||||
case VIDBUF32S:
|
case VIDBUF32S:
|
||||||
offset = VGLSetSegment(offset);
|
offset = VGLSetSegment(offset);
|
||||||
/* FALLTHROUGH */
|
/* FALLTHROUGH */
|
||||||
@ -92,6 +91,25 @@ VGLSetXY(VGLBitmap *object, int x, int y, u_long color)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case VIDBUF24S:
|
||||||
|
soffset = VGLSetSegment(offset);
|
||||||
|
color = htole32(color);
|
||||||
|
switch (VGLAdpInfo.va_window_size - soffset) {
|
||||||
|
case 1:
|
||||||
|
memcpy(&object->Bitmap[soffset], &color, 1);
|
||||||
|
soffset = VGLSetSegment(offset + 1);
|
||||||
|
memcpy(&object->Bitmap[soffset], (byte *)&color + 1, 2);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
memcpy(&object->Bitmap[soffset], &color, 2);
|
||||||
|
soffset = VGLSetSegment(offset + 2);
|
||||||
|
memcpy(&object->Bitmap[soffset], (byte *)&color + 2, 1);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
memcpy(&object->Bitmap[soffset], &color, 3);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case VIDBUF8X:
|
case VIDBUF8X:
|
||||||
outb(0x3c4, 0x02);
|
outb(0x3c4, 0x02);
|
||||||
outb(0x3c5, 0x01 << (x&0x3));
|
outb(0x3c5, 0x01 << (x&0x3));
|
||||||
|
Loading…
Reference in New Issue
Block a user