flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > pmode VGA |
Author |
|
windwakr 23 Jul 2009, 03:40
My mistake, but you're post had some very contradicting statements in it. Very hard to understand.
but in this way I enabled background blinking,so how to put Magenta on white without enabling background blinking? He could've just asked "How do I set intensity in PMode?", would've been much easier to understand what he was asking. Original Post below: You enabled background blinking? If you need intensity and still want blinking, then you will have to modify the palette. You just modify it like you modify the palette in mode 13h. In case you don't know, mov dx,03C8h mov al,0 ;Put the color you wish to modify in place of 0 out dx,al inc dx ;Now you out dx,al three times...first for red,green, then blue mov ax,[redvalue] out dx,al mov ax,[greenvalue] out dx,al mov ax,[bluevalue] out dx,al You just need to figure out what color on the palette relates to the text mode colors. Although if you look at the vga palette it would seem to be mapped to colors 0-F, it is not. I know just 2 of the colors right now through experimentation. 0 is black, 39h is bright blue. Last edited by windwakr on 23 Jul 2009, 14:25; edited 4 times in total |
|||
23 Jul 2009, 03:40 |
|
sinsi 23 Jul 2009, 03:43
Code: mov ax,1003h sub bx,bx ;0=background intensity, 1=blink int 10h |
|||
23 Jul 2009, 03:43 |
|
windwakr 23 Jul 2009, 03:44
My mistake, see my first post in this thread.
Original post below: sinsi, he wants to keep background blinking enabled. This file has a program in it called palman.com, it shows what I mean by editing the colors. If running it under windows press alt+enter to make it fullscreen, or else it won't work right. Last edited by windwakr on 23 Jul 2009, 14:18; edited 2 times in total |
|||
23 Jul 2009, 03:44 |
|
sinsi 23 Jul 2009, 04:19
>how to put Magenta on white without enabling background blinking?
|
|||
23 Jul 2009, 04:19 |
|
windwakr 23 Jul 2009, 04:22
My mistake, see my first post in this thread.
Original post below: but in this way I enabled background blinking,so how to put Magenta on white without enabling background blinking? He wants bright white without disabling background blinking. He's not dumb, he knows about the intensity bit. I just explained it to him about a week ago. Last edited by windwakr on 23 Jul 2009, 14:18; edited 2 times in total |
|||
23 Jul 2009, 04:22 |
|
abuashraf 23 Jul 2009, 05:04
Hi,
first, here I'm talking about doing this in protected mode,so I can't use BIOS ints. second point,I want intensity enabled ,and blinking disabled. with Magenta on white,but the problem is ,the same bit is used for enabling intensity and blinking which is the last bit,also if I want to chose white ,it needs four bits which means setting the last bit. Anyway,I figured it out,so here's the code for anybody else this code disables blinking. Code: mov dx,003DAH in al,dx mov dx,003c0h mov al,10h+20h out dx,al inc dx in al,dx dec dx and al,not 008h ; clear blink bit out dx,al Thank you guys very much for your help. |
|||
23 Jul 2009, 05:04 |
|
Anony 05 Sep 2009, 04:00
how to use the video card RAM??
|
|||
05 Sep 2009, 04:00 |
|
Madis731 05 Sep 2009, 09:43
Very cautiously!!!!!!!!!
PS. Sorry, I couldn't resist. Usually the first post of a person starts with an introduction. I don't know where to begin Board rules for example... |
|||
05 Sep 2009, 09:43 |
|
tom tobias 05 Sep 2009, 09:50
Anony wrote: how to use the video card RAM?? an older reference and its companion reasonable starting point @Madis: hahaha!!!! |
|||
05 Sep 2009, 09:50 |
|
revolution 05 Sep 2009, 10:00
Anony wrote: how to use the video card RAM?? |
|||
05 Sep 2009, 10:00 |
|
Dex4u 05 Sep 2009, 12:59
You can do it by setting the Palette, eg: if you want you could have 10 shades of green.
Here is a function to set Palette from pmode. Code: ;----------------------------------------------------; ; PALETTE ; ;----------------------------------------------------; ; al = color number ; bl = red ; bh = green ; cl = blue Palette: pushad mov dx,3c8h out dx,al inc dx mov al,bl out dx,al mov al,bh out dx,al mov al,cl out dx,al popad ret All you have to do is modify so called DAC palette registers which contain RGB values for a palette entries 0-15. You cnnot have more than 16 colors, of course, because of the mode 3 restrictions, but you can modify the basic colors. Say, instead of light gray (#7) you can have pink, if you specify the correct RGB values (You can find it by running simple PAINT program in Windows and see the values when choosing a color). Out the colour number to 3c8h, then the red value (0 to 63) to 3c9h, then green (0 to 63) to 3c9h, then blue (0 to 64) to 3c9h. |
|||
05 Sep 2009, 12:59 |
|
tom tobias 06 Sep 2009, 10:47
Thanks Dex, very helpful post!
It is always better to give genuine code, rather than simple links to articles. I think there may be, going back to Madis' query, a bit of confusion, at least on my part, as to the goal of this newcomer. I assumed, (always a bad idea, as f0dder has tried, in vain, to explain to me!) that his/her goal was to access the video card registers, for the purpose of writing code that would permit svga graphics display (e.g. 1024 x 768) from protected mode, with 16.7 million colors to choose from. Dex's excellent, well explained code, however, works in text mode, i.e. 80 x 25, with maximum 16 colors: black, blue, green, cyan, brown, magenta, white, grey, light blue, light green, light cyan, yellow, light magenta, and light white.) I am a tad color blind, so, for me, 16 colors is just fine! Text mode (80x25) is also good, because as our vision deteriorates, it becomes imperative to use big text characters. |
|||
06 Sep 2009, 10:47 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.