16 Color bsave's

 BBS: Inland Empire Archive
Date: 02-05-93 (11:49)             Number: 381
From: RICH GELDREICH               Refer#: NONE
  To: CHAD GUNTER                   Recvd: NO  
Subj: 16 Color bsave's               Conf: (2) Quik_Bas
>      BSAVE "FILE.BSV",0,65535
>      CLS
>      BLOAD "FILE.BSV",0
>      When the picture loads, all the color is gone, except for
>      one, which is turned to 15 (white) . . . it's like I was
>      switched to screen 2 or something . . . (which didn't happen)

    All 16 color modes of the EGA and VGA available to QB arrange the
video data in four seperate planes. Think of a 16 color mode as 4 B&W
images thrown on top of each other... The problem you're having is that
you don't tell the VGA which plane you want to read and write two -
since QB's runtime libraries always leave all planes active for writes
in between calls to graphics statements, the BLOAD you did above simply
wrote to all planes (color 15 = bright white).

    This is off the top of my head- hope I got the OUT indexes right!

    SCREEN 7
    CONST BytesToSave=(320\8)*200 'modify this for other modes
    DEF SEG=&HA000
    OUT &H3CE,4
    OUT &H3CF,0:BSAVE "plane0",0,BytesToSave
    OUT &H3CF,1:BSAVE "plane1",0,BytesToSave
    OUT &H3CF,2:BSAVE "plane2",0,BytesToSave
    OUT &H3CF,3:BSAVE "plane3",0,BytesToSave

    DEF SEG=&HA000
    OUT &H3C4,2
    OUT &H3C5,1:BLOAD "plane0"
    OUT &H3C5,2:BLOAD "plane1"
    OUT &H3C5,4:BLOAD "plane2"
    OUT &H3C5,8:BLOAD "plane3"
    OUT &H3C5,15

    Hope that helps!


--- MsgToss 2.0b
 * Origin: Computer Co-Op - Voorhees, NJ | Ted Hare (1:266/29)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET