* Fixed mixup of the VGA compatibility layer - if the bit is set, it means the
device is not compatible, after all. * No longer accept color changes if the mode is not an 8 bit one. I think that BWindowScreen does that after changing the mode, so that is messes up the colors, at least that's the theory, will test on real iron now. * Use VGA as a fallback if setting the palette via VBE failed. This brings back the colors for ParticlesII in Qemu (but not in VirtualBox, which seems to be completely broken in this regard). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32359 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
ce17f0d7f9
commit
b2a75cf56c
@ -38,8 +38,8 @@ struct vbe_info_block {
|
||||
} _PACKED;
|
||||
|
||||
// capabilities
|
||||
#define CAPABILITY_DAC_WIDTH 0x01
|
||||
#define CAPABILITY_VGA_COMPATIBLE 0x02
|
||||
#define CAPABILITY_DAC_WIDTH 0x01
|
||||
#define CAPABILITY_NOT_VGA_COMPATIBLE 0x02
|
||||
|
||||
|
||||
/* VBE mode info structure */
|
||||
|
@ -160,26 +160,36 @@ device_ioctl(void* cookie, uint32 msg, void* buffer, size_t bufferLength)
|
||||
|
||||
case VESA_SET_INDEXED_COLORS:
|
||||
{
|
||||
color_space space
|
||||
= (color_space)info->shared_info->current_mode.space;
|
||||
if (space != B_GRAY8 && space != B_CMAP8)
|
||||
return B_ERROR;
|
||||
|
||||
vesa_set_indexed_colors_args args;
|
||||
if (user_memcpy(&args, buffer, sizeof(args)) != B_OK)
|
||||
return B_BAD_ADDRESS;
|
||||
|
||||
if (info->shared_info->current_mode.space == B_GRAY8) {
|
||||
if ((info->vbe_capabilities & CAPABILITY_VGA_COMPATIBLE) == 0)
|
||||
return B_NOT_SUPPORTED;
|
||||
status_t status = B_NOT_SUPPORTED;
|
||||
if (space != B_GRAY8) {
|
||||
status = vesa_set_indexed_colors(*info, args.first, args.colors,
|
||||
args.count);
|
||||
}
|
||||
|
||||
// Try VGA as a fallback
|
||||
if (status != B_OK && (info->vbe_capabilities
|
||||
& CAPABILITY_NOT_VGA_COMPATIBLE) == 0) {
|
||||
return vga_set_indexed_colors(args.first, args.colors,
|
||||
args.count);
|
||||
}
|
||||
|
||||
return vesa_set_indexed_colors(*info, args.first, args.colors,
|
||||
args.count);
|
||||
return status;
|
||||
}
|
||||
|
||||
case VGA_PLANAR_BLIT:
|
||||
{
|
||||
if (info->shared_info->current_mode.space != B_GRAY8
|
||||
&& (info->vbe_capabilities & CAPABILITY_VGA_COMPATIBLE) == 0)
|
||||
|| (info->vbe_capabilities
|
||||
& CAPABILITY_NOT_VGA_COMPATIBLE) != 0)
|
||||
return B_NOT_SUPPORTED;
|
||||
|
||||
vga_planar_blit_args args;
|
||||
|
Loading…
Reference in New Issue
Block a user