home *** CD-ROM | disk | FTP | other *** search
- /*
- ** SaveToFC24.fred
- **
- ** $VER: SaveToFC24.fred 1.0.0 (31.10.93)
- **
- ** This program can be run from an InvokeADPro list to save images to
- ** the FC24 display board. Including this program automatically
- ** causes a pre script to be executed as well (to select display settings).
- **
- ** Clips Imported:
- ** FREDFC24AmigaDisplay - 1 for on, 0 for off
- ** FREDFC24BoardDisplay - 1 for on, 0 for off
- ** FREDFC24BoardNum - Number of board to use
- ** FREDFC24Resolution - Display resolution to use
- ** FREDFC24DisplayFrom - Which FC24 buffer to display from
- ** FREDFC24ImageTo - Which FC24 buffer will be written
- ** FREDFC24SrcXOff - X Offset into source image
- ** FREDFC24SrcYOff - Y Offset into source image
- ** FREDFC24DestXOff - X Offset into destination buffer
- ** FREDFC24DestYOff - Y Offset into destination buffer
- ** FREDFC24DestWidth - Width in destination buffer
- ** FREDFC24DestHeight - Height in destination buffer
- **
- ** 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 © 1993 ASDG, Incorporated
- ** All Rights Reserved
- */
-
-
- ADDRESS "ADPro"
- OPTIONS RESULTS
-
- PARSE ARG FrameNum FrameFName Length LoadFlag FirstCallSeq FirstCallCell
-
- NL = '0A'X
- SQ = '27'X
- DQ = '22'X
- TRUE = 1
- FALSE = 0
-
-
- /*
- ** Get the required clips.
- */
-
- AmigaDisplay = GETCLIP( "FREDFC24AmigaDisplay" )
- IF (AmigaDisplay = "") THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Required clip, FREDFC24AmigaDisplay," || NL ||,
- "is not specified."
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
-
- BoardDisplay = GETCLIP( "FREDFC24BoardDisplay" )
- IF (BoardDisplay = "") THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Required clip, FREDFC24BoardDisplay," || NL ||,
- "is not specified."
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
-
- BoardNum = GETCLIP( "FREDFC24BoardNum" )
- IF (BoardNum = "") THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Required clip, FREDFC24BoardNum," || NL ||,
- "is not specified."
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
-
- Res = GETCLIP( "FREDFC24Resolution" )
- IF (Res = "") THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Required clip, FREDFC24Resolution," || NL ||,
- "is not specified."
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
-
- DisplayFrom = GETCLIP( "FREDFC24DisplayFrom" )
- IF (DisplayFrom = "") THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Required clip, FREDFC24DisplayFrom," || NL ||,
- "is not specified."
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
-
- ImageTo = GETCLIP( "FREDFC24ImageTo" )
- IF (ImageTo = "") THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Required clip, FREDFC24ImageTo," || NL ||,
- "is not specified."
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
-
- SrcXOff = GETCLIP( "FREDFC24SrcXOff" )
- IF (SrcXOff = "") THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Required clip, FREDFC24SrcXOff," || NL ||,
- "is not specified."
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
-
- SrcYOff = GETCLIP( "FREDFC24SrcYOff" )
- IF (SrcYOff = "") THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Required clip, FREDFC24SrcYOff," || NL ||,
- "is not specified."
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
-
- DestXOff = GETCLIP( "FREDFC24DestXOff" )
- IF (DestXOff = "") THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Required clip, FREDFC24DestXOff," || NL ||,
- "is not specified."
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
-
- DestYOff = GETCLIP( "FREDFC24DestYOff" )
- IF (DestYOff = "") THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Required clip, FREDFC24DestYOff," || NL ||,
- "is not specified."
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
-
- DestWidth = GETCLIP( "FREDFC24DestWidth" )
- IF (DestWidth = "") THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Required clip, FREDFC24DestWidth," || NL ||,
- "is not specified."
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
-
- DestHeight = GETCLIP( "FREDFC24DestHeight" )
- IF (DestHeight = "") THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Required clip, FREDFC24DestHeight," || NL ||,
- "is not specified."
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
-
-
- /*
- ** See what type of data is loaded in ADPro/MorphPlus.
- */
-
- CALL "FREDSCRIPTS:FREDFunctions/CheckForRawImageData" FALSE
- IF (RESULT ~= 0) THEN DO
- CALL "FREDSCRIPTS:FREDFunctions/CheckForRenderedImageData" TRUE
- IF (RESULT ~= 0) THEN
- EXIT 10
- ELSE
- ScreenType = "IMAGE"
- END
- ELSE
- ScreenType = "RAW"
-
-
- /*
- ** Image it to the display board.
- */
-
- SAVER "FC24" "XXX" ScreenType,
- "AMIGA" AmigaDisplay,
- "BOARD" BoardDisplay,
- "BOARD_NO" BoardNum,
- "B_SIZE" Res,
- "DISPLAY_FROM" DisplayFrom,
- "IMAGE_TO" ImageTo,
- "SET_SOX" SrcXOff,
- "SET_SOY" SrcYOff,
- "SET_DOX" DestXOff,
- "SET_DOY" DestYOff,
- "SET_DWX" DestWidth,
- "SET_DWY" DestHeight,
- "CLEAR",
- "CENTER",
- "IMAGE"
- IF (RC ~= 0) THEN DO
- Why = ADPRO_RESULT
- ADPRO_TO_FRONT
- OKAY1 "FC24 save failed:" || NL || Why || NL ||,
- "Argument Information:" || NL ||,
- "Screen Type =" ScreenType || NL ||,
- "Amiga Display =" AmigaDisplay || NL ||,
- "Board Display =" BoardDisplay || NL ||,
- "Board Number =" BoardNum || NL ||,
- "Resolution ID =" Res || NL ||,
- "Display From =" DisplayFrom || NL ||,
- "Image To =" ImageTo || NL ||,
- "Src X Off =" SrcXOff || NL ||,
- "Src Y Off =" SrcYOff || NL ||,
- "Dest X Off =" DestXOff || NL ||,
- "Dest Y Off =" DestYOff || NL ||,
- "Dest Width =" DestWidth || NL ||,
- "Dest Height =" DestHeight
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
-
- EXIT 0
-