I have written a program which acts as a screensaver i.e after 10 seconds all the command prompt screen is cleared if no keyboard button is pressed. In short I have hooked Timer and Keyboard interrupt. But I want the program to show blinking screen i.e alternatively show all the text of command prompt and blank screen. But my current situation is that it keeps on showing a blank screen after 10 seconds if no button is pressed. How can I modify my program to show blinking screen alternating between cleared screen and textual data instead of just cleared screen. Here is my program:
#include <dos.h>
#include <conio.h>
void interrupt (*oldTimer)();
void interrupt (*oldKey)();
void interrupt newTimer();
void interrupt newKey();
char far *scr = (char far*) 0xB8000000;
int i, t=0, m=0;
char charscr[4000];
void main()
{
oldTimer=getvect(8);
oldKey=getvect(9);
setvect(8,newTimer);
setvect(9,newKey);
getch();
keep (0,1000);
}
void interrupt newTimer()
{
t++;
if((t>=182)&&(m==0))
{
for (i=0;i<4000;i++)
charscr [i]=*(scr+i);
for (i=0;i<=4000;i+=2)
{
*(scr+i)=0x20;
*(scr+i+1)=0x07;
}
t=0; m=1;
}
(*oldTimer)();
}
void interrupt newKey()
{
int w;
if(m==1)
{
for (w=0; w<4000;w++)
*(scr+w)=charscr[w];
m=0;
}
(*oldKey)();
}
Sorry for my poor indentation. I find it very hard on this site to indent the code.