Hi all!

I need to write a program which periodically saves the screen contents into a 
file. What I have done is trapping int $1C, and every 30 secs, run a 2nd 
procedure which opens a file and saves $B800:0000 to it. The problem is (that 
I am stupid and forgot to pushf before calling the original handler :) that 
when I open a file, and start writing to it, the emulator dies. 

For those who lost me, I am compiling using the "free" French version of TP7 
under DOSEMU and sometimes XP.

The relevant code is, the failure point is (as far as I know) the point marked 
by {*}:

<code>
Procedure save_screen; far;
Var
   F: file;
   x,y: integer;
Begin

     Assign( f, 'f:\screen.txt' );
     ReWrite( f, 1 );

     For y:=0 to 24 do
        For x:=0 to 79 do
{*}
           BlockWrite( f, screen[y][x].letter, 1  );

     Close(f);

End;

Procedure my_timer; Interrupt;
Begin

  PUSHF;
  Call(old_timer);

  If (tics mod 18) = 0
     Then Case (tics div 18) mod 3 of
            0: do_something;
            1: save_screen;
          End;
End;

var
  x,y: integer;
begin
     old_timer := get_int( TIMER_INT );
     set_int( TIMER_INT, @my_timer );
     readln;
     set_int( TIMER_INT, old_timer );
end.
</code>


If anyone knows what I am doing wrong, please tell me. 

PS:
does the license of the FTP7 let you use it for commercial products? Can I 
compile something with it and sell it?


TIA

-- 

diego, kde-il translation team

Please avoid sending me Word or PowerPoint attachments.
See http://www.fsf.org/philosophy/no-word-attachments.html



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Freedos-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to