Skip to content

Set VGA 8 colour mode pallete to match the first 8 colours of vga 16 colour mode. #21

@avalonbits

Description

@avalonbits

Currently the default pallete for 8 colour mode is rather boring (black, dark red, dark green, dark blue, red, green, blue, white).
We should set it to match the first 8 colours of the vga 16 colour mode pallete.

This needs to be done after a resolution change because as part of chaning the resolution the default pallete is always set.

So, within change_resolution, after the call to setResolution, we can add:

if (colours == 8) {
        VGAController->setPaletteItem(0, RGB888(0x00, 0x00, 0x00));
	VGAController->setPaletteItem(1, RGB888(0xAA, 0x00, 0x00));
	VGAController->setPaletteItem(2, RGB888(0x00, 0xAA, 0x00));
	VGAController->setPaletteItem(3, RGB888(0xAA, 0xAA, 0x00));
	VGAController->setPaletteItem(4, RGB888(0x00, 0x00, 0xAA));
	VGAController->setPaletteItem(5, RGB888(0xAA, 0x00, 0xAA));
	VGAController->setPaletteItem(6, RGB888(0x00, 0xAA, 0xAA));
	VGAController->setPaletteItem(7, RGB888(0xAA, 0xAA, 0xAA));
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    Status

    Released

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions