flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > OS Construction > Vesa Mode Colors??? - SOLVED

Author
Thread Post new topic Reply to topic
newport



Joined: 08 Jun 2012
Posts: 86
Location: Kentucky, USA
Vesa Mode Colors??? - SOLVED
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  ax4f01h
        mov  bx4114h  ;800x600 - 64k - 16-bit (5:6:5)
        mov  diMode_Info
        mov  cxbx
        int  10h
         
        mov  ax4f02h
        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
Post 07 Apr 2016, 18:49
View user's profile Send private message Visit poster's website Reply with quote
newport



Joined: 08 Jun 2012
Posts: 86
Location: Kentucky, USA
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 coloursfor 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:

    R0x66 = 0b01100110
    G0xFF = 0b11111111
    B0x99 = 0b10011001

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

    R011001
    G111111
    B100110

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:5would be:

    R01100
    G111111
    B10011

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
Post 07 Apr 2016, 19:03
View user's profile Send private message Visit poster's website Reply with quote
cod3b453



Joined: 25 Aug 2004
Posts: 612
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 Laughing
Post 07 Apr 2016, 20:59
View user's profile Send private message Reply with quote
newport



Joined: 08 Jun 2012
Posts: 86
Location: Kentucky, USA
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
Post 08 Apr 2016, 14:51
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >

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


Powered by phpBB © 2001-2005 phpBB Group.

Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2016, Tomasz Grysztar.