home *** CD-ROM | disk | FTP | other *** search
- * fxTest.PRG *
- * Copyright (c) Genus Microprogramming, Inc. 1988-89 All Rights Reserved. *
-
- *****************************************************************************
- * *
- * This program demonstrates the usage of an effect. It is an example *
- * Pascal routine for the PCX Effects Toolkit. *
- * *
- * Nantucket Clipper Programmer: Chris Howard 5/07/89 *
- * *
- *****************************************************************************
-
- * Include the PCX Toolkit defines
- SET PROCEDURE TO pcxlib
- DO pcxInit
- * and PCX Effects
- SET PROCEDURE TO fxlib
- DO fxInit
-
- PRIVATE pcximage,pcxtype
-
- * Globals
- pcxtype = pcxVGA_11
- pcximage = "fxTest.PCX"
-
- bufmax = 20000
- buffer = SPACE(bufmax)
-
- vi = SPACE(4)
- header = SPACE(128)
-
- vptr = SPACE(4)
-
- **********
-
- * Main
-
- * Display program header
- ?
- ? "╒══════════════════════════════════════════════════════════════════════════╕"
- ? "│ fxTest: Example Effect Clipper Program PCX Effects 1.0x │"
- ? "│ Copyright (c) Genus Microprogramming, Inc. 1988-89 All Rights Reserved. │"
- ? "╘══════════════════════════════════════════════════════════════════════════╛"
- ?
-
- * Allocate a larger toolkit buffer, to speed up file and display speed.
- retcode = pcxSB(buffer,bufmax);
-
- * Check if we have expanded memory, and display
- IF (PCXEMI() = pcxTRUE)
- vfree = pcxVE(pcxEMM)
- ? "Free EMM: ",vfree
- ENDIF
-
- * Display the amount of conventional memory free
- vfree = pcxVE(pcxCMM)
- ? "Free CMM: ",vfree
-
- * Look at the current hardware, to find a B/W mode
- pcxVI(vi)
-
- adapter = ASC(SUBSTR(vi,1,1))
-
- DO CASE
- CASE adapter = viCGA
- pcxtype = pcxCGA_6
- CASE adapter = viEGA
- IF (ASC(SUBSTR(vi,2,1)) = viMDAdisp)
- pcxtype = pcxEGA_F
- ELSE
- pcxtype = pcxEGA_10
- ENDIF
- CASE adapter = viVGA
- pcxtype = pcxVGA_11
- CASE adapter = viHGC
- pcxtype = pcxHERC
- OTHERWISE
- pcxtype = -1
- ENDCASE
-
- * If we found a mode, continue
- IF (pcxtype <> -1)
-
- * Set the display type
- pcxSD(pcxtype)
-
- * Load the image
- retcode = fxFI(pcxCMM,vptr,pcximage)
- IF (retcode = fxSUCCESS)
-
- * Change to graphics mode
- pcxSM(pcxGRAPHICS)
-
- * Calibrate the delay timer, and play a looping song
- fxCD()
- fxPO(25)
- fxPT("T120 MB O3 L32 C D E F G A B A G F E D ")
-
- * Select our effect
- fxSE(fxRANDOM)
- fxSG(8)
-
- * and do it
- retcode = fxVE(vptr,0,0,fxNONE)
-
- * Kill any remaining background music
- fxPK()
-
- * Wait for a key
- INKEY(0)
-
- * Get back to text mode
- pcxSM(pcxTEXT)
-
- * Were we successful?
- IF (retcode <> fxSUCCESS)
- ? "VirtualEffect Error: ",retcode
- ENDIF
-
- * Free the image
- fxFI(vptr)
-
- ELSE
- * Cold not load image
- ? "Could not load image: ",retcode
- ENDIF
-
- ELSE
- * We could not find a good mode
- ? "Could not find a good mode type . . ."
- ENDIF
-
-
- RETURN && Main
-
-