Thread View: comp.msdos.programmer
2 messages
2 total messages
Started by Thomas Jensen
Thu, 14 Dec 1995 09:43
[Q] PC VGA Attribute Controller
Author: Thomas Jensen
Date: Thu, 14 Dec 1995 09:43
Date: Thu, 14 Dec 1995 09:43
38 lines
2051 bytes
2051 bytes
Goal:
The following code is supposed to switch a standard VGA
display on my PC (running DOS, but that shouldn't matter)
between blinking text and light background colors.
Problem:
Reading the contents of attribute controller (ATC)
register 10h doesn't seem to work. Line graphics mode
always gets turned off.
Question:
Can you tell me what changes I have to make to make the ATC read work?
C-Code:
void blink (int on) {
/* 0 -> allow light background attributes */
/* 1 -> make text blink instead */
unsigned char reg10;
reg10 = inportb (0x3da); /* set ATC to index mode */
outportb (0x3c0, 0x10|32); /* select mode control register */
reg10 = inportb (0x3c1); /* read current status (!) */
if (on) reg10 = reg10 | 8; /* set bit 3 (blink on) */
else asm {and reg10, 11110111b}; /* clear bit 3 (blink off) */
outportb (0x3c0, 0x10|32); /* reg select */
outportb (0x3c0, reg10|32); /* write changes */
}
When I set the register contents manually, it works fine, so
I believe that the write operation poses no problem.
Please reply by e-mail, too. Any help would be most appreciated!
Thanks!
--
Thomas Jensen <fi136@fim.uni-erlangen.de> 2B |! 2B W.S.
Sign my guest book at <<http://home.pages.de/~Murphy/>>!
Re: [Q] PC VGA Attribute Controller
Author: Lawrence Kirby
Date: Sat, 16 Dec 1995 16:29
Date: Sat, 16 Dec 1995 16:29
21 lines
1344 bytes
1344 bytes
In article <4aorkp$i1j@rznews.rrze.uni-erlangen.de>
tsjensen@cip.informatik.uni-erlangen.de "Thomas Jensen" writes:
>Goal:
> The following code is supposed to switch a standard VGA
> display on my PC (running DOS, but that shouldn't matter)
> between blinking text and light background colors.
>
>Problem:
> Reading the contents of attribute controller (ATC)
> register 10h doesn't seem to work. Line graphics mode
> always gets turned off.
Details of VGA programming have nothing to do with the C language. Please
take this to a newsgroup appropriate to your platform.
--
-----------------------------------------
Lawrence Kirby | fred@genesis.demon.co.uk
Wilts, England | 70734.126@compuserve.com
-----------------------------------------
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads