home *** CD-ROM | disk | FTP | other *** search
- /*
- ** RenderAsHAM.fred.pre
- **
- ** $VER: RenderAsHAM.fred.pre 1.3.0 (24.10.93)
- **
- ** If the RenderAsHAM.fred script appears in the InvokeADPro list,
- ** this program will ask the user to select a screen mode and
- ** dither type into which the images will be rendered.
- **
- ** Clips Exported:
- ** FREDScreenType - Screen type to be used
- ** FREDDither - Dither to be used
- ** FREDDitherAmt - Dither amount to be used
- ** FREDHAMType - Use HAM or HAM8
- **
- ** NOTE: Clip names are case sensitive.
- **
- ** This script requires FRED v1.4.0 (or higher) to run. Also required is
- ** ADPro v2.5.0 (or higher).
- **
- ** Copyright © 1992-1993 ASDG, Incorporated
- ** All Rights Reserved
- */
-
-
- ADDRESS "ADPro"
- OPTIONS RESULTS
-
- PARSE ARG NumberOfCells NumberOfFrames
-
- NL = '0A'X
- SQ = '27'X
- DQ = '22'X
- TRUE = 1
- FALSE = 0
-
-
- /*
- ** Ask the user to select the screen mode.
- */
-
-
- /*
- ** Select the horizontal resolution.
- */
-
- HorizSize.1 = "Low Res"
- HorizSize.2 = "High Res"
- HorizSize.3 = "Super High Res"
- MinHorizSize = 1
- MaxHorizSize = 3
- DefHorizSize = 1
-
- String = '"' || HorizSize.DefHorizSize || '"'
- DO LoopCounter = MinHorizSize TO MaxHorizSize
- String = String '"' || HorizSize.LoopCounter || '"'
- END
-
- continue = 0
- DO UNTIL (continue = 1)
- ADPRO_TO_FRONT
-
- LISTVIEW '"Horiz. Resolutions:"' (MaxHorizSize-MinHorizSize+1) ITEMS String
- LISTVIEW_RC = RC
- PARSE VAR ADPRO_RESULT '"'HorizSizeStr'"' scratch
-
- HorizRes = MinHorizSize
- DO WHILE (HorizRes <= MaxHorizSize) & (COMPARE( HorizSizeStr, HorizSize.HorizRes ) ~= 0)
- HorizRes = HorizRes + 1
- END
-
- IF (LISTVIEW_RC ~= 0) & (LISTVIEW_RC ~= 1) THEN DO
- ADPRO_TO_FRONT
-
- OKAYN '"RenderAsHAM.fred"' '"This value is required."' '"Retry|Cancel"'
- IF (RC = 0) THEN
- EXIT 10
- END
- ELSE
- continue = 1
- END
-
- ADPRO_TO_FRONT
-
- OKAYN '"RenderAsHAM.fred"' '"Enable Horizontal Overscan?"' '"Overscan|Non-Overscan|Cancel"'
- IF (RC = 0) THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Process aborted."
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
- ELSE
- HorizOscan = 2 - RC
-
-
- /*
- ** Select the monitor.
- */
-
- GETLIST MONITORS
- String = ADPRO_RESULT
- IF (RC ~= 0) THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Could not retrieve" || NL ||,
- "monitor list."
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
-
- continue = 0
- DO UNTIL (continue = 1)
- ADPRO_TO_FRONT
-
- LISTVIEW '"Monitors Available:"' 10 ITEMS String
- LISTVIEW_RC = RC
- PARSE VAR ADPRO_RESULT '"'Monitor'"' scratch
-
- IF (LISTVIEW_RC ~= 0) & (LISTVIEW_RC ~= 1) THEN DO
- ADPRO_TO_FRONT
-
- OKAYN '"RenderAsHAM.fred"' '"This value is required."' '"Retry|Cancel"'
- IF (RC = 0) THEN
- EXIT 10
- END
- ELSE
- continue = 1
- END
-
- ADPRO_TO_FRONT
-
- OKAYN '"RenderAsHAM.fred"' '"Enable Interlace?"' '"Interlace|Non-Interlace|Cancel"'
- IF (RC = 0) THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Process aborted."
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
- ELSE
- VertLace = 2 - RC
-
- ADPRO_TO_FRONT
-
- OKAYN '"RenderAsHAM.fred"' '"Enable Vertical Overscan?"' '"Overscan|Non-Overscan|Cancel"'
- IF (RC = 0) THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Process aborted."
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
- ELSE
- VertOscan = 2 - RC
-
-
- /*
- ** Now build the SCREEN_TYPE value.
- */
-
- ScreenType = 0
-
- IF (HorizRes = 2) THEN /* High Res */
- ScreenType = ScreenType + 1
- ELSE IF (HorizRes = 3) THEN /* Super High Res */
- ScreenType = ScreenType + 64
-
- IF (HorizOscan = 1) THEN /* Horizontal Overscan */
- ScreenType = ScreenType + 8
-
- IF (Monitor = "DFLT") THEN /* DFLT */
- ScreenType = ScreenType + 256
- ELSE IF (Monitor = "PAL") THEN /* PAL */
- ScreenType = ScreenType + 4
- ELSE IF (Monitor = "VGA") THEN /* VGA */
- ScreenType = ScreenType + 32
- ELSE IF (Monitor = "SUP72") THEN /* SUP72 */
- ScreenType = ScreenType + 128
-
- IF (VertLace = 1) THEN /* Interlace */
- ScreenType = ScreenType + 2
-
- IF (VertOscan = 1) THEN /* Vertical Overscan */
- ScreenType = ScreenType + 16
-
-
- /*
- ** Ask the user to render as HAM(6) or HAM8.
- */
-
- ADPRO_TO_FRONT
-
- OKAYN '"RenderAsHAM.fred"' '"Choose HAM Type"' '"HAM|HAM8|Cancel"'
- IF (RC = 0) THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Process aborted."
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
- ELSE IF (RC = 1) THEN
- HamType = "HAM"
- ELSE IF (RC = 2) THEN
- HamType = "HAM8"
-
-
- /*
- ** Ask the user to select the dither mode to use.
- */
-
- GETLIST DITHERS
- String = ADPRO_RESULT
- IF (RC ~= 0) THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Could not retrieve" || NL ||,
- "dither list."
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
-
- continue = 0
- DO UNTIL (continue = 1)
- ADPRO_TO_FRONT
-
- LISTVIEW '"Dithers Available:"' 10 ITEMS String
- LISTVIEW_RC = RC
- PARSE VAR ADPRO_RESULT '"'DitherModeStr'"' scratch
-
- IF (LISTVIEW_RC ~= 0) & (LISTVIEW_RC ~= 1) THEN DO
- ADPRO_TO_FRONT
-
- OKAYN '"RenderAsHAM.fred"' '"This value is required."' '"Retry|Cancel"'
- IF (RC = 0) THEN
- EXIT 10
- END
- ELSE
- continue = 1
- END
-
- IF (DitherModeStr = "Off") THEN /* Off */
- DitherMode = 0
- ELSE IF (DitherModeStr = "Floyd (1)") THEN /* Floyd (1) */
- DitherMode = 1
- ELSE IF (DitherModeStr = "Burkes (2)") THEN /* Burkes (2) */
- DitherMode = 2
- ELSE IF (DitherModeStr = "Sierra (3)") THEN /* Sierra (3) */
- DitherMode = 3
- ELSE IF (DitherModeStr = "Jarvis (4)") THEN /* Jarvis (4) */
- DitherMode = 4
- ELSE IF (DitherModeStr = "Stucki (5)") THEN /* Stucki (5) */
- DitherMode = 5
- ELSE IF (DitherModeStr = "Random (6)") THEN /* Random (6) */
- DitherMode = 6
- ELSE IF (DitherModeStr = "Lg Ord (7)") THEN /* Lg Ord (7) */
- DitherMode = 7
- ELSE IF (DitherModeStr = "Sm Ord (8)") THEN /* Sm Ord (8) */
- DitherMode = 8
- ELSE
- DitherMode = 0
-
-
- /*
- ** If dither is Random or Ordered, get the Dither Amount.
- */
-
- IF (DitherMode = 6) | (DitherMode = 7) | (DitherMode = 8) THEN DO
- CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Enter Dither Amount"' 16 1 256 TRUE
- IF (RESULT = (1-1)) THEN
- EXIT 10
- DitherAmt = RESULT
-
- SETCLIP( "FREDDitherAmt", DitherAmt )
- END
-
- SCREEN_TO_FRONT "FRED"
-
-
- /*
- ** Update the clips.
- */
-
- SETCLIP( "FREDScreenType", ScreenType )
- SETCLIP( "FREDDither", DitherMode )
- SETCLIP( "FREDHAMType", HamType )
-
- EXIT 0
-