flat assembler
Message board for the users of flat assembler.

 Index > OS Construction > Vesa Mode Colors??? - SOLVED
Author
newport

Joined: 08 Jun 2012
Posts: 86
Location: Kentucky, USA
newport
I have currently set up Vesa using the code below . However, this particular mode has a supposed 64k color palette. The problem is, I cannot figure out how to code a specific color. For example.. plotting a pixel with 0xFFFFFF produces a white pixel, 0x000000 produces a black pixel, but 0x00FF00 which should be green, produces a dark yellow color. Am I incorrect in correlating the color scheme to a standard rgb color palette? How can I determine the correct color I want???
Code:
mov  ax, 4f01h
mov  bx, 4114h  ;800x600 - 64k - 16-bit (5:6:5)
mov  di, Mode_Info
mov  cx, bx
int  10h

mov  ax, 4f02h
int  10h

_________________
It's the desire to learn that leads to success...

http://www.webicomp.com

Last edited by newport on 07 Apr 2016, 19:14; edited 2 times in total
07 Apr 2016, 18:49
newport

Joined: 08 Jun 2012
Posts: 86
Location: Kentucky, USA
newport
ok.. as always, i seem to find my answers after posting... lol - this link helped me understand how to convert rgb colors to 5:6:5 colors -

http://www.avrfreaks.net/forum/color-map-ili93401-tft-display

..and excerpt from the page states..
Code:

Pick some colours, for example I like the look of #66FF99 and then convert this 24 bit 8:8:8 value to
5:6:5 or 6:6:6 using the most significant bits. So for this lovely greeney-blue the 66FF99 is:

R: 0x66 = 0b01100110
G: 0xFF = 0b11111111
B: 0x99 = 0b10011001

To convert to 18 bit (6:6:6) just take the top 6 bits of each:

R: 011001
G: 111111
B: 100110

then add them together to make the 18bits

011001 111111 100110

grouping that in fours:

01 1001 1111 1110 0110

which in hex is:

0x19FE6

Doing the same for 16 bit (5:6:5) would be:

R: 01100
G: 111111
B: 10011

which is

0110 0111 1111 0011

0x67F3

So "limey green" is 0x19FE6 in 18 bit mode and 0x67F3 in 16 bit mode.

_________________
It's the desire to learn that leads to success...

http://www.webicomp.com
07 Apr 2016, 19:03
cod3b453

Joined: 25 Aug 2004
Posts: 618
cod3b453
The VBE3 standard (http://www.petesqbsite.com/sections/tutorials/tuts/vbe3.pdf) defines the layouts for preset modes but also provides generic RGB field info in the get mode info function (#1), which could help - though to be honest I went straight to 24/32 bit modes for the simplicity
07 Apr 2016, 20:59
newport

Joined: 08 Jun 2012
Posts: 86
Location: Kentucky, USA
newport
i wanted to use 24or 32 bit, but the only vesa modes that would work with my computer are .. 101h, 111h, 114h, and 117h...

_________________
It's the desire to learn that leads to success...

http://www.webicomp.com
08 Apr 2016, 14:51
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

 Jump to: Select a forum Official----------------AssemblyPeripheria General----------------MainTutorials and ExamplesDOSWindowsLinuxUnixMenuetOS Specific----------------MacroinstructionsOS ConstructionIDE DevelopmentProjects and IdeasNon-x86 architecturesHigh Level LanguagesProgramming Language DesignCompiler Internals Other----------------FeedbackHeapTest Area

Forum Rules:
 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou cannot attach files in this forumYou can download files in this forum