Announcement

Collapse
No announcement yet.

Screen save

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Screen save

    This is how I save and load the contents of screen 0 to disk


    savescreen:
    OldX% = pos(0) : OldY% = csrlin : OldColor% = pbvScrnTxtAttr
    DEF SEG = &hB800 : BSAVE "SCREEN.TMP", 0, 4000

    loadscreen:
    DEF SEG = &hB800 : BLOAD "SCREEN.TMP"
    ct% = OldColor% and 15 : cb% = OldColor% \ 16
    color ct%, cb% : locate OldY%, OldX%

    I'm wondering if this is correct.

    When I use the program from a Win98 dos box, sometimes windows reports that DOS has performed an illegal opperation.

    Thanks

  • #2
    I've never used BLOAD/BSAVE, but I'll point out a couple things that I see here..

    The &hB800 will work fine for VGA, but if the program ever runs on a monochrome adapter, it won't work...you can check this using pbvScrnCard, like this:

    Code:
    Mono = BIT(pbvScrnCard,0)
    IF BIT(pbvScrnCard,0) THEN Addr& = &hB000 ELSE Addr& = &hB800
    Granted, not too many people still use mono stuff, but it's worth taking into consideration


    Also, the 4000 will only work for 25 line screens, what about 43 or 50? You can check this with pbvScrnRows What about 40 column mode? Use pbvScrnCols.
    Code:
    SaveBytes = pbvScrnRows * pbvScrnCols * 2  'there's an attribute byte and a text byte .. two bytes per character

    Another thing you might want to do is a DEF SEG after you're done BLOADing/BSAVEing...

    Code:
    DEF SEG = Addr&
    BSAVE "SCREEN.TMP",0,SaveBytes
    DEF SEG

    I don't see anything really wrong with your code however... But you might at least give the DEF SEG a try.


    Another thing is to make sure you're using $ERROR ALL ON in your code, this will catch many errors and help in debugging your program.


    HTH,
    Jason

    [This message has been edited by Jason McCarver (edited February 10, 2000).]

    Comment


    • #3
      Thanks Jason

      I'll give it a try !

      ------------------

      Comment

      Working...
      X