Solved

Greater than 256 colours

Posted on 1998-12-03
16
204 Views
Last Modified: 2010-04-16
Does anyone know how to get into a higher colour mode AND plot a pixel to the screen?  Also, is this higher colour mode able to display ALL the colours at the same time?  
0
Comment
Question by:VIBESPRO
  • 7
  • 6
  • 3
16 Comments
 
LVL 2

Author Comment

by:VIBESPRO
ID: 1216313
Edited text of question
0
 
LVL 2

Author Comment

by:VIBESPRO
ID: 1216314
I know how to get into 256 colour modes.  For example I use
Port[$3C8] like this :

var
 N: Byte;

begin
 for N:= 0 to 255 do Port[$3C8]:= N;
end;

I would like Port[$3C8] to have a greater range like this:

var
 N: Word;

begin
 for N:= 0 to 65535 do Port[$3C8]:= N;
end;

I also used PortW[$3C8] but I can't get red, only green and blue.
0
 
LVL 5

Expert Comment

by:scrapdog
ID: 1216315
Your question is "Greater than 256 colours".  What color mode do you want to go into?  Different modes have different ways of interpretting the colors.  If you are using 24-bit colors, a word can't store this.  The reason you are not getting red is because bits 16-23 are the red component of the color...you are only accessing bits 15-0 with a word...therefore the red component will always be 0.  I need to know what color mode you are in.
0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
LVL 5

Expert Comment

by:scrapdog
ID: 1216316
>Also, is this higher colour mode able to display ALL the
>colours at the same time?  

Any color mode that doesn't use a palette will allow you to display all colors at the same time.  Most likely any mode greater than 256 colors DOESN'T use a palette, so yes, all colors can be displayed at once.
0
 
LVL 2

Author Comment

by:VIBESPRO
ID: 1216317
SCRAPDOG, I am in mode 112h and could you show me how to get
into mode 640x480 with 65535 colours.  Also could you go over the reason why I can't get red.  I don't quit understand.
0
 
LVL 2

Author Comment

by:VIBESPRO
ID: 1216318
Oh yes.  And you said that ALL colours greater than 256 can be displayed at once, BUT WITHOUT A PALETTE.  Explain this.
Do you mean instead of 'palette : array[0..65535, 0..2] of byte'
the colours are stored in the memory.
0
 
LVL 5

Expert Comment

by:scrapdog
ID: 1216319
In 65536 color mode, the colors are stored in 16 bits.  5 bits for red, 6 bits for green, and 5 bits for blue.  The actual color is stored in memory, NOT an index to a palette.

I have tried playing around with different 640x480 modes in DOS but fried my monitor.
0
 
LVL 5

Accepted Solution

by:
scrapdog earned 60 total points
ID: 1216320
Try this site for more info on 640x480x65536.  You can download source code here.

http://kyuss.artis.uni-oldenburg.de/virtual_technologies/index_toolkits.html
0
 
LVL 2

Author Comment

by:VIBESPRO
ID: 1216321
O.K SCRAPDOG.  I found the web-site you gave me and found what I was looking for.   Thank You.
But there was NO procedure that sets a certain colour.  Example:
Port[$3C8]:= ColourNumber;
Port[$3C9]:= R;
Port[$3C9]:= G;
Port[$3C9]:= B;

Could you show how.
Thanx.
0
 
LVL 5

Expert Comment

by:scrapdog
ID: 1216322
Port[$3C8]:= ColourNumber;
Port[$3C9]:= R;
Port[$3C9]:= G;
Port[$3C9]:= B;

This code is to set a palette register.  640x480x65536 doesn't use palettes.

0
 
LVL 2

Author Comment

by:VIBESPRO
ID: 1216323
So what does 640x480x65535 uses?
0
 
LVL 5

Expert Comment

by:scrapdog
ID: 1216324
The color is stored directly in memory.  The value of the pixel IS the color, not a reference to a palette.  To change a pixel's color, you directly alter the memory location which corresponds to that particular pixel.  You don't have to access the ports at all.

I am sure that in the code you downloaded, the Mem or MemW array is used to store the color.
0
 
LVL 4

Expert Comment

by:jack_p50
ID: 1216325
Try this great unit (up-to hi-color in any resolution) :
http://www.geocities.com/SiliconValley/Bay/9553/
0
 
LVL 4

Expert Comment

by:jack_p50
ID: 1216326
Try this great unit (up-to hi-color in any resolution) :
http://www.geocities.com/SiliconValley/Bay/9553/
0
 
LVL 4

Expert Comment

by:jack_p50
ID: 1216327
in hi-color mode screen is divided into 64k "banks". you can do all grafx things by vesa functions, but they are doing only in one bank, so you need to switch banks too. this unit does that, and uses accellerated gfx-card functions for more speed
0
 
LVL 2

Author Comment

by:VIBESPRO
ID: 1216328
Sorry JACK_P50.  SRAPDOG gave me that already.  Thanx any way.
And thank you SCRAPDOG the unit was SUPERB. I did find out all what I needed, so far...
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Employees depend heavily on their PCs, and new threats like ransomware make it even more critical to protect their important data.
Having trouble getting your hands on Dynamics 365 Field Service or Project Service trial? Worry No More!!!
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question