Thread View: alt.msdos.programmer
3 messages
3 total messages
Started by John Eric Sanders
Wed, 26 Aug 1992 14:01
TSR in C
Author: John Eric Sanders
Date: Wed, 26 Aug 1992 14:01
Date: Wed, 26 Aug 1992 14:01
11 lines
930 bytes
930 bytes
I am interested in writing a screensaver program in C, and could use some help. Could someone send me sources of other programs, or tell me some good books to read on the subject? At this point I think I know just enough to crash my computer. Thanx in advance -- The Jester (John E. Sanders) jsanders@symcom.math.uiuc.edu I have finally discovered the method to my madness. Unfortunately, there is more madness to my method than method to my madness.
Re: TSR in C
Author: Stokes Kevin
Date: Wed, 26 Aug 1992 15:52
Date: Wed, 26 Aug 1992 15:52
87 lines
5124 bytes
5124 bytes
>I am interested in writing a screensaver program in C, and could
>use some help.
My serious advice is to give it up, if you plan to distribute it. I have
written a shareware screen saver called InnerMission. I have about 600
registered users. The problem is that almost every one of them has some
odd program which conflicts with IM.
The bottom line is: If you want to write on which just blanks the screen
by disabling the video, it is easy and can be sort of reliable.
If you want one which switches to graphics mode (like mine), and puts up
a cute animation or something, you have a horrendus s**tmess. DOS just isn't
good enough to allow something like this.
( A whirlwind of angry babbling follows: Recommended reading for any person
considering authoring a TSR which must save and restore the screen when done )
Some examples:
So you trap int 16h so see how long it has been since the user pressed the
last key. Then when you are popped up you watch BIOS int 16h to see when
the user wants to pop down. Seems logical.
But in WordPerfect, they bypass the bios by diverting the hardware keyboard
interrupt to their own routine, without calling the old one. Therefore your
TSR doesn't see any activity, so your screen saver pops up. Now the user
has a blank screen which can't be brought back, since your TSR doesn't see
any keys being pressed, even as the frustrated customer is flailing away on
all the keys in the keyboard. He/she has to reboot via the reset switch and
never loads your screen saver again. (may even try to bill you for the lost
time retyping the whole document )
OK so you have your TSR not pop if someone else has grabbed int9. But then,
lots of other programs grab int 9, but still call the old int9. They do this
just to keep track of keyboard activity without diverting keys to the BIOS.
Now your TSR won't work with ANY of theses programs, because you told it to
not pop up if someone else grabs int 9.
So you make your program grab int 9 back if you notice some other program
has taken it from you. Your TSR cleverly then calls the old int9 that you
stole, so the other program is non the wiser. However, then you find that
the other program grabs it back immediately, and you have a runaway loop.
Fine. Now you cleverly save the text mode screen buffer, so that when the
user wants to pop back, you put his old screen back up. Works great.
Now the user runs a program which redines the 'blink' bit to make high-intensity
background color. Your TSR however, didn't realize that the user's program
had twiddled with the standard text mode, so when you pop him back, the whole
screen is blinking. Another pissed off customer who thinks your software
stinks.
OK, so you make your TSR for VGA only, no EGA where you can't tell if blink
bit is on or off. No the users pull up their favorite program which uses
80x43 mode, for more characters on the screen. Your TSR doesn't know about
this, so it only saves the top 25 lines, and when you pop him back, his screen
is no longer in 80x43, and he has to exit his program whilst grumbling about
your poor software.
So you learn how to detect if the user has twiddled the VGA for this, but
then you realize that your screen buffer now has to be almost 7k in order to
store the screen. The TSR is getting bigger. Then along comes a customer
who's program uses all 8 pages of text video ram. And then another one who
has a program which redifines the font. When he pops down, his screen is
filled with gibberish.
So fine. You realize you'll need to save 32k worth of VGA state data
when you popup. No one whats a 45k screen saver TSR, so you have write your
saved screen to disk. So you want to create and write files from a TSR.
Good Luck!
This stuff goes on and on with no end. I have ceased distributing my
screen saver.
If you want to write a screen saver which saves the screen and puts up
and amusing animation, be prepared to write a program which is close to
Desqview in complexity. DV really amazes me. The've managed to handle
least 85% of the stuff like this. However, I think being a Quarterdeck
programmer would be really unfun, because that kind of kludgy workarounds
are just not fun at all.
-Kevin
--
------------------------------------------------------------------------------
| Kevin Stokes | Please direct all pointless |
| Pie in the Sky Software | flames to my mailbox, it's much |
| | more irritating. |
Re: TSR in C
Author: John A. Slagel
Date: Wed, 26 Aug 1992 18:25
Date: Wed, 26 Aug 1992 18:25
15 lines
1162 bytes
1162 bytes
kds@phy.duke.edu (Stokes Kevin) writes:
>( A whirlwind of angry babbling follows: Recommended reading for any person
> considering authoring a TSR which must save and restore the screen when done )
I think that it should be recommended reading for *ANY* DOS
programmer. I have a weird sense of humor, but I laughed my
*ss off while reading it, because I know excactly where you're
coming from.
--
------------------------------------------------------------------------
John A. Slagel "My old man used to tell me, before he left this
j-slagel1@uiuc.edu shitty world, never chase buses or women- you
always get left behind." -The Marlboro Man
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