Graphics

 BBS: Inland Empire Archive
Date: 08-25-92 (12:13)             Number: 376
From: NICK DIETZ                   Refer#: NONE
  To: BILL CAMPBELL                 Recvd: NO  
Subj: Graphics                       Conf: (2) Quik_Bas
BC>The genius is Rich Geldreich. Sounds like he answerred your problem
BC>recently. Try this 'cause I think it answers the question.

BC>___---------------------->8 Cut Here 8<-----------------------------

BC>' From: Rich Geldreich            Subject: 640x480x16

BC>' Try out this code to save and load the 640x480x16 mode:

BC>'Sample code to demonstrate the saving and
BC>'loading of screen mode 12- 640x480x16.

BC>DEFINT A-Z
BC>SCREEN 9 '  <- I'm using EGA so I used SCREEN 9  instead of SCREEN 12

BC> 'draw some garbage
BC> FOR A = 1 TO 50
BC>     X = RND * 640: Y = RND * 480: C = RND * 16
BC>     CIRCLE (X, Y), RND * 100, C: PAINT (X, Y), RND * 16, C
BC> NEXT
BC> 'save the entire screen
BC> DEF SEG = &HA000
BC> OUT &H3CE, 4 'GC Index register 4
BC> 'saves (640*480)/8 bytes for each plane
BC> OUT &H3CF, 0: BSAVE "plane1", 0, 38400 'enable reads from plane 0
BC> OUT &H3CF, 1: BSAVE "plane2", 0, 38400 'plane 1
BC> OUT &H3CF, 2: BSAVE "plane3", 0, 38400 'plane 2
BC> OUT &H3CF, 3: BSAVE "plane4", 0, 38400 'plane 3

BC> CLS

BC> 'load the entire screen
BC> DEF SEG = &HA000
BC> OUT &H3C4, 2 'SC Index register 2
BC> OUT &H3C5, 1: BLOAD "plane1" 'enable writes to plane 0
BC> OUT &H3C5, 2: BLOAD "plane2" 'plane 1
BC> OUT &H3C5, 4: BLOAD "plane3" 'plane 2
BC> OUT &H3C5, 8: BLOAD "plane4" 'plane 3

BC> .
BC> .
BC> .
BC> END

Works pretty well, but it BLOADS the wrong colors sometimes. Thanx.

                                        -Nick Dietz.

===
 * OLX 2.2 * Chemical Engineers Get Better Reactions !!


--- Squish v1.00
 * Origin: Aquila BBS (708)820-8344 (1:115/820)
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