BBS: Inland Empire Archive
Date: 12-21-92 (11:46)             Number: 378
From: PETER BARNEY                 Refer#: NONE
  To: IAN BUTLER                    Recvd: NO  
Subj: GIF to BASIC                   Conf: (2) Quik_Bas
 > OPEN "filename.MAP" FOR INPUT AS #1
 > SCREEN 13
 > FOR A%=1 TO 63
 >         INPUT #1,BLUE%
 >         INPUT #1,GREEN%
 >         INPUT #1,RED%
 >         PALETTE A%,RED%*65536+GREEN%*256+BLUE%
 > NEXT A%
 > BLOAD "filename.BAS"
 > END

I saw your program, and I thought you ight be interested in
some faster code for changing the palettes.  Try:


'$INCLUDE: 'QBX.BI'    'or QB.BI


OPEN "filename.MAP" FOR INPUT AS #1
    INPUT #1, b
    INPUT #1, g
    INPUT #1, r
    pal$ = pal$ + CHR$(r) + CHR$(g) + CHR$(b)

DIM Regs AS RegTypeX = &H1012
Regs.bx = 0 = LEN(pal$) / 3      '# of colors to change
Regs.dx = SADD(pal$) 'varptr = SSEG(pal$) 'varseg
InterruptX &H10, Regs, Regs


If you replace this with your palette color-changing code,
you'll see a dramatic increase in speed.

(Note: some programs that output MAP files use 8-bit values (0-255) for the
color instead of 0-63 like QB wants.  If your MAP color
values range from 0-255, change the last line in the
DO..LOOP block to read:
  pal$ = pal$ + CHR$(r \ 4) + CHR$(g \ 4) + CHR$(b \ 4)

--- FMail 0.92
 * Origin: Pete's Place - Toledo, Ohio (1:234/35.1)
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