©2003 Adigun Azikiwe Polack.  All Rights Reserved.

___________________________________________________________________________



                                       DESIGNED FOR THE

 


___________________________________________________________________________




(Note: this HTML documentation is *best* viewed with a minimum resolution of 800x600, 16-bit color.)


___________________________________________________________________________________

Feel free to use this add-on for your project.  If you do use ANY of these routines within this add-on, then please give me and Richard Eric M. Lope credit for them, otherwise DO NOT EVEN USE THEM AT ALL, *PERIOD*.  Thank you so rather much for your honest patronage and cooperation!!  ;) !

___________________________________________________________________________________




This add-on for Future.Library (for QuickBASIC 4.5 and 7.1) *VASTLY* extends on the 8-bit palette routines for the lib itself!!!  :D !  Hey, if you have ever wanted to do a lot MORE with palette manipulation for the many 256-color graphics modes (including SVGA!) using Future.Library, well, you are truly right at home here.  DEFINITELY!!!  ;) !!

***EXTRA*** Special Thanks to Almighty Jehovah God (ESPECIALLY!!!  :*D !! ), and, Special Thanks to Richard Eric M. Lope for the many of the original routines, too!!!  ;*) !!

 



___________________________________________________________________________________

REQUIREMENTS:




   • QuickBASIC 4.5 or 7.1

   • Future.Library (the recommended version for this lib is 3.5!)

___________________________________________________________________________________

BEFORE YOU GET STARTED...........




   Here is what you need to do in order for you to begin using this add-on:

1.  If you have Future.Library, go to Future.Library Builder (found in Flbuild.exe).

2.  Go to Setup, and choose Program.

3.  Ensure that the compiler and library paths on QuickBASIC 4.5 and/or 7.1 *do* match up with the exact paths of the compiler and library files for either version of QuickBASIC, please.  ;)

4.  If you are all done and set, click Ok.

5.  Next, go to Setup, and choose Library.

6.  If you have QuickBASIC 4.5 and you would like to use this add-on with Future.Library with it, then in one of the “Paths” boxes, please type in the *exact* path (where the lib is placed on QuickBASIC 4.5), plus this one too:
       Flpal45.obj

7.  If you have QuickBASIC 7.1 and you would like to use this add-on with Future.Library with it, then in one of the “Paths” boxes, please type in the *exact* path (where the lib is placed on QuickBASIC 7.1), plus this one too:
       Flpal71.obj

8.  When you are all done, please click Ok.

9.  If you are all ready to make a QuickBASIC 4.5 library version of Future.Library with this add-on, please go to File and select Build Qbasic 4.5 Library (but first, make sure Flpal45.obj is in one of the paths boxes *ONLY*, NOT Flpal71.obj).

10.  If you are all ready to make a QuickBASIC 7.1 library version of Future.Library with this add-on, please go to File and select Build Qbasic 7.1 Library (but first, make sure Flpal71.obj is in one of the paths boxes *ONLY*, NOT Flpal45.obj).

11.  If all goes well without ANY errors, please exit the Future.Library Builder.

12.  Now, access Qbfuture.bat if you have QuickBASIC 4.5.  For users of QuickBASIC 7.1, please access Qbfutu71.bat.

13.  If everything is working both correctly and properly, the QuickBASIC IDE should well be up, with Future.Library fully loaded along with The 8-Bit Palette Machine!!!  :D !!

14.  To use this add-on, please add these two lines at the *very* start of your program:

              REM $INCLUDE: 'future.bi'

              REM $INCLUDE: 'flpal.bi'


___________________________________________________________________________________





COMMANDS LIST:

 

 

______________________________________________________

    • FL.ReadRGB
    • FL.WriteRGB
    • FL.ReadPal
    • FL.Fade
    • FL.FadeX
    • FL.FadeStep
    • FL.FadeToPal
    • FL.FadeToPalX
    • FL.FadeToPalStep
    • FL.FadeToNegative
    • FL.FadeToNegativeX
    • FL.NegativePal
    • FL.NegativePalX
    • FL.SavePal
    • FL.LoadPal
    • FL.LoadPalPP256
    • FL.SwitchToPal
    • FL.RotatePalB
    • FL.RotatePalF

(Note: those commands *ONLY* work in 8-bit graphics modes.  They will NOT work in 16-bit, 24-bit, or 32-bit graphics modes.)












FL.ReadRGB


________________________________________________________________________


________________________________________________________________________

Sub Description:

DECLARE SUB FL.ReadRGB (ColorVal%, R%, G%, B%)

________________________________________________________________________


ColorVal% = the color value to read from the R% (Red), G% (Green), and B% (Blue) variables (0 to 255).

R% = the red shade-level (0 to 63).

G% = the green shade-level (0 to 63).

B% = the blue shade-level (0 to 63).

 

________________________________________________________________________

















FL.WriteRGB


________________________________________________________________________


________________________________________________________________________

Sub Description:

DECLARE SUB FL.WriteRGB (ColorNum%, R%, G%, B%)

________________________________________________________________________


ColorNum% = the color number (0 to 255) to change into any RGB color combination (within the R%, G%, and B% variables).

R% = the red shade-level (0 to 63).

G% = the green shade-level (0 to 63).

B% = the blue shade-level (0 to 63).


________________________________________________________________________

Example Usage #1:

FL.WriteRGB 7,63,0,63


Changes the RGB values of color #7 to make it purple.



Example Usage #2:

FL.WriteRGB 139,0,63,63


Changes the RGB values of color #139 to make it cyan.



Example Usage #3:

FL.WriteRGB 62,63,63,0


Changes the RGB values of color #62 to make it yellow.

________________________________________________________________________

 

________________________________________________________________________

















FL.ReadPal


________________________________________________________________________


________________________________________________________________________

Sub Description:

DECLARE SUB FL.ReadPal (PalString$)

________________________________________________________________________


Palstring$ = the string ($) statement that reads and even stores your current palette for future use (must be 768-bytes long!).


________________________________________________________________________

Sample Required Usage:

REM $INCLUDE: 'future.bi'

REM $INCLUDE: 'flpal.bi'

DIM SHARED Pal AS STRING * 768

FL.ReadPal Pal


After those four (4) lines, you can THEN use all of the palette fading manipulations of The 8-Bit Palette Machine (with the whole 256-color palette being read and stored in the string “Pal”)!  ;)

________________________________________________________________________

 

________________________________________________________________________

















FL.Fade


________________________________________________________________________


________________________________________________________________________

Sub Description:

DECLARE SUB FL.Fade (R%, G%, B%, Counts%)

________________________________________________________________________


R% = the red shade-level (0 to 63).

G% = the green shade-level (0 to 63).

B% = the blue shade-level (0 to 63).

Counts% = the number of steps that it takes to fade the *ENTIRE* screen to any RGB color combination that was created using the R% (Red), G% (Green), and B% (Blue) variables.


________________________________________________________________________

Example Usage #1:

FL.Fade 63,32,0,63


Fades the whole screen to orange in just 63 fade-based steps.



Example Usage #2:

FL.Fade 0,32,0,132


Fades the whole screen to dark green in 132 fade-based steps.



Example Usage #3:

FL.Fade 63,48,48,0


Turns the whole screen pink, INSTANTLY.

________________________________________________________________________

 

________________________________________________________________________

















FL.FadeX


________________________________________________________________________


________________________________________________________________________

Sub Description:

DECLARE SUB FL.FadeX (Startcol%, Endcol%, R%, G%, B%, Counts%)

________________________________________________________________________


Startcol% = the starting color (0 to 255) within the color-order range.

Endcol% = the ending color (0 to 255) within the color-order range.

R% = the red shade-level (0 to 63).

G% = the green shade-level (0 to 63).

B% = the blue shade-level (0 to 63).

Counts% = the number of steps that it takes to fade the color-order range within your screen to any RGB color combination that was created using the R% (Red), G% (Green), and B% (Blue) variables.



________________________________________________________________________

Notes on this Command:

Very much the same as FL.Fade, but it lets you fade ANY part of the screen to whatever RGB color combination you like, rather than just the whole screen alone.  And, you can even do it in any number of fade-steps you wish, too!  :D

________________________________________________________________________

 

________________________________________________________________________

















FL.FadeStep


________________________________________________________________________


________________________________________________________________________

Sub Description:

DECLARE SUB FL.FadeStep (Startcol%, Endcol%, R%, G%, B%)

________________________________________________________________________


Startcol% = the starting color (0 to 255) within the color-order range.

Endcol% = the ending color (0 to 255) within the color-order range.

R% = the red shade-level (0 to 63).

G% = the green shade-level (0 to 63).

B% = the blue shade-level (0 to 63).


________________________________________________________________________

Notes on this Command:

In order to fade the color-order range COMPLETELY to whatever RGB color combination (created using the R%, G%, and B% variables) you like, you must call this command 64 times in a row.  *HIGHLY USEFUL* for fading any part of the screen while the other on-screen action is still moving, really!!  ;D !

________________________________________________________________________

 

________________________________________________________________________

















FL.FadeToPal


________________________________________________________________________


________________________________________________________________________

Sub Description:

DECLARE SUB FL.FadeToPal (PalString$, Counts%)

________________________________________________________________________


Palstring$ = the string ($) statement that reads your stored 256-color palette (please see FL.ReadPal for more details).

Counts% = the number of steps that it takes to fade in the *ENTIRE* screen to any stored palette string ($) statement (and remember, your palette must be 768 bytes long!)


________________________________________________________________________

Example Program:

REM $INCLUDE: 'future.bi'

REM $INCLUDE: 'flpal.bi'

DIM SHARED Pal AS STRING * 768


Set320x240 8 '<< You can use any graphics mode, but it MUST be an 8-bit one

             '   in order for this program to work!


FL.ReadPal Pal '<< This will store your current palette for future use!  :D


Future.Print 0, 0, "Press any key, please.", 15, 0

SLEEP


Future.CLS 0 '<< Clears the ENTIRE screen to color #0.


FL.Fade 0, 0, 0, 0

FOR Expand = 0 TO 255

 Future.Circle 160, 120, Expand, Expand

NEXT


FL.FadeToPal Pal, 100 '<< This example fades in your stored palette in its

                      '   entirety in just 100 steps.  Not bad, huh?  ;) !


Future.Print 0, 0, "Press any key to end.", 15, -1

SLEEP


ResetScreen

END

________________________________________________________________________

 

________________________________________________________________________

















FL.FadeToPalX


________________________________________________________________________


________________________________________________________________________

Sub Description:

DECLARE SUB FL.FadeToPalX (Startcol%, Endcol%, PalString$, Counts%)

________________________________________________________________________


Startcol% = the starting color (0 to 255) within the color-order range.

Endcol% = the ending color (0 to 255) within the color-order range.

Palstring$ = the string ($) statement that reads your stored 256-color palette (please see FL.ReadPal for more details).

Counts% = the number of steps that it takes to fade in the color-order range within your screen to any stored palette string ($) statement (and remember, your palette must be 768 bytes long!)


________________________________________________________________________

Notes on this Command:

Very much the same as FL.FadeToPal, but it lets you fade ANY part of the screen to any stored palette string ($) statement that you are using, rather than just the entire screen alone.  And, you can even do it in any number of fade-steps you wish — that is, if you so desire to!  :D

________________________________________________________________________

 

________________________________________________________________________

















FL.FadeToPalStep


________________________________________________________________________


________________________________________________________________________

Sub Description:

DECLARE SUB FL.FadeToPalStep (Startcol%, Endcol%, PalString$)

________________________________________________________________________


Startcol% = the starting color (0 to 255) within the color-order range.

Endcol% = the ending color (0 to 255) within the color-order range.

Palstring$ = the string ($) statement — which must be 768 bytes long — that reads your stored 256-color palette (please see FL.ReadPal for more details).


________________________________________________________________________

Notes on this Command:

In order to fade the color-order range COMPLETELY to any stored palette that you are using, you must call this command 64 times in a row, using the *SAME* palette string ($) statement.  *HIGHLY USEFUL* for fading in any part of the screen while the other on-screen action is still moving, really!!  ;D !

________________________________________________________________________

 

________________________________________________________________________

















FL.FadeToNegative


________________________________________________________________________


________________________________________________________________________

Sub Description:

DECLARE SUB FL.FadeToNegative (Counts%)

________________________________________________________________________


Counts% = the number of steps that it takes to fade the *ENTIRE* screen to a “negative”-based effect!  Higher steps equal slower fades, while fewer steps mean faster fades.

 

________________________________________________________________________

















FL.FadeToNegativeX


________________________________________________________________________


________________________________________________________________________

Sub Description:

DECLARE SUB FL.FadeToNegativeX (Startcol%, Endcol%, Counts%)

________________________________________________________________________


Startcol% = the starting color (0 to 255) within the color-order range.

Endcol% = the ending color (0 to 255) within the color-order range.

Counts% = the number of steps that it takes to fade the color-order range within your screen to a “negative”-based effect!  Higher steps equal slower fades, while fewer steps mean faster fades.



________________________________________________________________________

Notes on this Command:

Very much the same as FL.FadeToNegative, only it lets you fade ANY part of the screen to to a “negative”-based effect indeed, rather than just the whole screen alone.  And, you can even do it in any number of fade-steps you wish, too!  VERY ORIGINAL!!  :D !

________________________________________________________________________

 

________________________________________________________________________

















FL.NegativePal


________________________________________________________________________


________________________________________________________________________

Sub Description:

DECLARE SUB FL.NegativePal ()

________________________________________________________________________



________________________________________________________________________

Notes on this Command:

With this command, you can actually switch the screen to a “negative”-based effect INSTANTANEOUSLY!

________________________________________________________________________

 

________________________________________________________________________

















FL.NegativePalX


________________________________________________________________________


________________________________________________________________________

Sub Description:

DECLARE SUB FL.NegativePalX (Startcol%, Endcol%)

________________________________________________________________________


Startcol% = the starting color (0 to 255) within the color-order range.

Endcol% = the ending color (0 to 255) within the color-order range.



________________________________________________________________________

Notes on this Command:

With this command, you can actually switch the color-order range within your screen to a “negative”-based effect INSTANTANEOUSLY!

________________________________________________________________________

 

________________________________________________________________________

















FL.SavePal


________________________________________________________________________


________________________________________________________________________

Sub Description:

DECLARE SUB FL.SavePal (File$)

________________________________________________________________________


File$ = the filename (must be up to 8 characters long followed by a period mark — . — and then an extension that is up to 3 characters long) that you can save as a 768-byte palette file.

 

________________________________________________________________________

















FL.LoadPal


________________________________________________________________________


________________________________________________________________________

Sub Description:

DECLARE SUB FL.LoadPal (File$, PalString$, Switch%)

________________________________________________________________________


File$ = the filename (must be up to 8 characters long followed by a period mark — . — and then an extension that is up to 3 characters long) that is to be loaded.

Palstring$ = the string ($) statement that reads the palette from your filename and even stores it for future use (must be 768-bytes long in order for the command to fully work!).

Switch% = the operation of whether or not to switch the screen to a newly stored palette (from the filename that you have just specified using this *very* command).  Pass 0, and the current screen palette remains unswitched (albeit the new palette is already loaded and stored for further use), but pass 1 and your current palette will be AUTOMATICALLY switched to the newly loaded one.

 

________________________________________________________________________

















FL.LoadPalPP256


________________________________________________________________________


________________________________________________________________________

Sub Description:

DECLARE SUB FL.LoadPalPP256 (File$)

________________________________________________________________________


File$ = the filename (must be up to 8 characters long followed by both a period mark — . — and an extension of either PAL or APF!) that is to be loaded.  Also, your filename must be a “PIXELplus 256”-based one that is 1,024-bytes long, or it will not work!



________________________________________________________________________

Notes on this Command:

You can really load in and INSTANTANEOUSLY switch to a “PIXELplus 256”-based palette using this command!!  :D !  It will not, however, store your palette automatically on its own.  BUT, at least this command does work wonders, EVEN WHEN COMPILED!!!  ;*) !!

________________________________________________________________________

 

________________________________________________________________________

















FL.SwitchToPal


________________________________________________________________________


________________________________________________________________________

Sub Description:

DECLARE SUB FL.SwitchToPal (PalString$)

________________________________________________________________________


Palstring$ = the string ($) statement that — once this command is used — will automatically switch you to the current palette that has already been stored, without any fades whatsoever (please see FL.ReadPal for more info on how to store a palette).

 

________________________________________________________________________

















FL.RotatePalB


________________________________________________________________________


________________________________________________________________________

Sub Description:

DECLARE SUB FL.RotatePalB (Startcol%, Endcol%)

________________________________________________________________________


Startcol% = the starting color (0 to 255) within the color-order range.

Endcol% = the ending color (0 to 255) within the color-order range.



________________________________________________________________________

Notes on this Command:

With this command, you can actually rotate the color-order range within your palette in a backwards motion.  Great for plasmas, graphics demos, or what have you!!  ;*) !

________________________________________________________________________

 

________________________________________________________________________

















FL.RotatePalF


________________________________________________________________________


________________________________________________________________________

Sub Description:

DECLARE SUB FL.RotatePalF (Startcol%, Endcol%)

________________________________________________________________________


Startcol% = the starting color (0 to 255) within the color-order range.

Endcol% = the ending color (0 to 255) within the color-order range.



________________________________________________________________________

Notes on this Command:

With this command, you can actually rotate the color-order range within your palette in a forwards motion.  Great for plasmas, graphics demos, or what have you!!  ;*) !

________________________________________________________________________

 

________________________________________________________________________