Ega/Vga

 BBS: Inland Empire Archive
Date: 12-07-92 (17:08)             Number: 364
From: LEE MADAJCZYK                Refer#: NONE
  To: STEVE DEMO                    Recvd: NO  
Subj: Ega/Vga                        Conf: (2) Quik_Bas
On 12-03-92 Steve Demo uttered to Lee Madajczyk...

 SD>LM> Hope this helps. After you load your file, just BSAVE it. If you
 SD>LM> want the PCX saving routine, or anyone else for that matter, give
 SD>LM> me a ring!

   <...deleted...>

 SD>  But I am very intrested in Graphics. If you would please post the PCX
 SD>  Saveing routine.



>----------------------------SNIP HERE------------------------------<

Sub PCXLoad(File$)
'  .PCX Saving Routine - Perfected by Lee Madajcyk / Quantum Software
'  Released into Public Domain on December 7, 1992
'
--
OPEN File$ FOR BINARY AS #1 A$ = CHR$(10) + CHR$(5) + CHR$(1) + CHR$(1): PUT #1, , A$ A% = 0: PUT #1, , A%: PUT #1, , A%: A% = 639: PUT #1, , A% A% = 349: PUT #1, , A%: A% = 640: PUT #1, , A%: A% = 350: PUT #1, , A% FOR I% = 0 TO 15 red% = (((Pal.Array%(I%) AND 32) \ 32) OR ((Pal.Array%(I%) AND 4) \ 2)) * 85 green% = (((Pal.Array%(I%) AND 16) \ 16) OR (Pal.Array%(I%) AND 2)) * 85 Blue% = (((Pal.Array%(I%) AND 8) \ 8) OR ((Pal.Array%(I%) AND 1) * 2)) * 85 A$ = CHR$(red%) + CHR$(green%) + CHR$(Blue%): PUT #1, , A$ NEXT A$ = CHR$(0) + CHR$(4): PUT #1, , A$: A% = 80: PUT #1, , A% A% = 0: PUT #1, , A%: A% = 0 FOR I% = 70 TO 127 STEP 2 PUT #1, , A% NEXT I% DEF SEG = &HA000 FOR k% = 0 TO 349 'Total Lines to load (GRAPHICS) SCREEN 9, , 0: Add1% = 80 * k%: Number% = 1: J% = 0 OUT &H3CE, 4: OUT &H3CF, 0: OUT &H3CE, 5: OUT &H3CF, 0 Old% = PEEK(Add1%): Add2% = 1 FOR I% = 1 TO 320 IF I% = 320 THEN IF Old% <> 1 THEN New% = 1 ELSE New% = 0 ELSE IF Add2% = 80 THEN J% = J% + 1: Add2% = 0 OUT &H3CE, 4: OUT &H3CF, J%: OUT &H3CE, 5: OUT &H3CF, 0 New% = PEEK(Add1% + Add2%) END IF IF New% = Old% AND Number% < 63 THEN Number% = Number% + 1 ELSE Num.Out% = (Number% OR 192) IF (Number% <> 1) OR ((Old% AND 192) = 192) THEN A$ = CHR$(Num.Out%): PUT #1, , A$ END IF A$ = CHR$(Old%): PUT #1, , A$: Old% = New%: Number% = 1 END IF Add2% = Add2% + 1 NEXT PSET (0, k%), 13: PSET (639, k%), 13 NEXT OUT &H3CE, 4: OUT &H3CF, 0: DEF SEG : CLOSE #1 END SUB >----------------------------SNIP HERE------------------------------< That's it I commented the code halfway about lines-to-load. Lee Madajczyk Quantum Software ... OFFLINE 1.40 * Quantum Software: Custom Software Written! NET: Infinity (1:280/5) --- GEcho 1.00/beta+ * Origin: Infinity -=[HST]=- (1:280/5)
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