home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 24 / CD_ASCQ_24_0995.iso / vrac / homonlib.zip / SAVESCRN.BAS < prev    next >
BASIC Source File  |  1995-04-13  |  2KB  |  55 lines

  1. DEFINT A-Z
  2.  
  3. DECLARE SUB SaveScreen (filename$)
  4. DECLARE SUB RestScreen (filename$)
  5.  
  6. SUB RestScreen (filename$)
  7. '****************************************************************************
  8. 'Restores a screen saved by SaveScreen().
  9. '
  10. 'You should only pass a filename that you know contains data created by the
  11. ' SaveScreen() sub.  I have no idea what would happen if you used any other
  12. ' kind of data.  Use at your own risk.  If you pass a filename that does not
  13. ' exist, a run-time error will occur.
  14. '
  15. '****************************************************************************
  16.  
  17. VS& = PEEK(&H63) + PEEK(&H64) * 256     'Get CRT controller port
  18.  
  19. IF VS& = &H3B4 THEN
  20.      VS& = &HB000                       'Video RAM segment address (mono)
  21. ELSE
  22.      VS& = &HB800                       'Video RAM segment address (color)
  23. END IF
  24.  
  25. DEF SEG = VS&
  26. BLOAD filename$, 0
  27. DEF SEG
  28.  
  29. END SUB
  30.  
  31. SUB SaveScreen (filename$)
  32. '****************************************************************************
  33. 'Saves the current text screen to the specified binary file.  If the file
  34. ' already exists, it will be overwritten.
  35. '
  36. 'This function was only tested in text mode (SCREEN 0).  I have no idea what
  37. ' it would do in any other screen mode.  Use at your own risk.
  38. '
  39. '****************************************************************************
  40.  
  41. VS& = PEEK(&H63) + PEEK(&H64) * 256     'Get CRT controller port
  42.  
  43. IF VS& = &H3B4 THEN
  44.      VS& = &HB000                       'Video RAM segment address (mono)
  45. ELSE
  46.      VS& = &HB800                       'Video RAM segment address (color)
  47. END IF
  48.  
  49. DEF SEG = VS&
  50. BSAVE filename$, 0, 4000
  51. DEF SEG
  52.  
  53. END SUB
  54.  
  55.