'=========================================================================== ' Subject: READ FRACTINT .MAP COLOUR FILES Date: 05-24-97 (15:20) ' Author: Daniel Davies Code: QB, QBasic, PDS ' Origin: ia53@rapid.co.uk Packet: GRAPHICS.ABC '=========================================================================== 'These routines allow the use of fractint .MAP colour files, without having 'to convert them. 'usemap - reads the file straight to the video card's pallette registers. 'readmap - reads the pallette into three arrays called red, green, and blue ' so that you can use them more easily 'you have permission to use these for whatever you want, just so long as you 'give me credit and tell me about it. 'email me at :- ia53@rapid.co.uk DECLARE SUB usemap (file$) DECLARE SUB readmap (file$) DIM SHARED red%(255) DIM SHARED green%(255) DIM SHARED blue%(255) SUB readmap (file$) file% = FREEFILE OPEN file$ FOR INPUT AS file% col% = 0 DO LINE INPUT #1, lin$ red%(col%) = VAL(LTRIM$(RTRIM$(MID$(lin$, 1, 3)))) / 4 green%(col%) = VAL(LTRIM$(RTRIM$(MID$(lin$, 4, 4)))) / 4 blue%(col%) = VAL(LTRIM$(RTRIM$(MID$(lin$, 8, 4)))) / 4 col% = col% + 1 LOOP UNTIL (EOF(file%)) CLOSE file% END SUB SUB usemap (file$) file% = FREEFILE OPEN file$ FOR INPUT AS file% col% = 0 DO LINE INPUT #1, lin$ red% = VAL(LTRIM$(RTRIM$(MID$(lin$, 1, 3)))) / 4 green% = VAL(LTRIM$(RTRIM$(MID$(lin$, 4, 4)))) / 4 blue% = VAL(LTRIM$(RTRIM$(MID$(lin$, 8, 4)))) / 4 OUT &H3C8, col% OUT &H3C9, red% OUT &H3C9, green% OUT &H3C9, blue% col% = col% + 1 LOOP UNTIL (EOF(file%)) CLOSE file% END SUB