# File: prog_focus30_v01.src
#
program "%Z% MODULE: %M% RELEASE: %R%.%L% CREATED: %G% %U%"
source "/mdisw/cfl/prep/src/prog_focus30_v01.src"
descr "Loads IP queue instructions"
#=======================================================
#
#
#;
#; FILE:    prog_focus30.ips
#; PURPOSE: Extract three pieces out of 8 of 10 filtergrams and se
#;	   down.
#; RESTRICTION:
#;	   The frame list used with this program must have 10 frames.
#;	   Frame 1 and 10 are ignored. 
#;	   Downlink is shifted to start as late as possible (set up so 
#;	   the last downlink starts on callback frame 10 -- 2 pages dow
#;	   every 5 frames).
#; PAGE USE:
#;	   Page 0 is where the data is written to from the camera
#;	   Page 13 is where the data is extracted 1024x1024
#;	   page 17 is where the 3 strip extract is written
#;	   Page 1,2,3,4,  15,15.5,18,19 are where the data are stored f
#; HISTORY: Written 25-Apr-96 by M.Morrison
#;	   2-May-96 (MDM) - Added square-root compression
#;
#;
#QPROG_FOCUS30::
#
#;---------------- Optional Downlink Portion
#OPTIONAL_DL:
#    BRANCHEQ R3072   5 &DL_FRM05
tcblock mbipmacl 0x1981    0x01AE 0x0C00 0x0005 0x198B 
#    BRANCHEQ R3072  10 &DL_FRM10
tcblock mbipmacl 0x1985    0x01AE 0x0C00 0x000A 0x1994 
#    GOTO &INCOMING_IMG
tcblock mbipmacl 0x1989    0x0156 0x199D 
#
#DL_FRM05:
#    SETREGS $IPRL_DL_PARAM 2 0x0800 0x1000                      ;
tcblock mbipmacl 0x198B    0x01B2 0x11D0 0x0002 0x0800 \
                                0x1000 
#    CALLQUE $QSR_DL_2PAGE
tcblock mbipmacl 0x1990    0x01F8 0x0DA5 
#    GOTO &INCOMING_IMG
tcblock mbipmacl 0x1992    0x0156 0x199D 
#
#DL_FRM10:
#    SETREGS $IPRL_DL_PARAM 2 0x1800 0x2000                      ;
tcblock mbipmacl 0x1994    0x01B2 0x11D0 0x0002 0x1800 \
                                0x2000 
#    CALLQUE $QSR_DL_2PAGE
tcblock mbipmacl 0x1999    0x01F8 0x0DA5 
#    GOTO &INCOMING_IMG
tcblock mbipmacl 0x199B    0x0156 0x199D 
#
#
#;----------------------------- Process incoming image
#INCOMING_IMG:
#    SETREG $IPRL_CB_ADDR &QCB_FOCUS3                            ;
tcblock mbipmacl 0x199D    0x0140 0x0C20 0x19D7 
#
#    BRANCHEQ R3072   1  &INIT_PAGE_POINTER
tcblock mbipmacl 0x19A0    0x01AE 0x0C00 0x0001 0x19D3 
#    BRANCHEQ R3072   10 &DONE
tcblock mbipmacl 0x19A4    0x01AE 0x0C00 0x000A 0x19D2 
#
#    ;---- Step #1: Making the observable and save the data
#    SETREGS  $IPRL_FLTGRAM_PARAM 4 0:0x0000 13:0x0726           ;
tcblock mbipmacl 0x19A8    0x01B2 0x1238 0x0004 0x0000 \
                                0x0000 0x0726 0x6800 
#    COPYRD2D $IPRL_EXTRACT3_PARAM+2 $IPRL_FLTGRAM_PARAM+8 3	;last
tcblock mbipmacl 0x19AF    0x0144 0x1452 0x1240 0x0003 
#    CALLQUE  $QSR_MK_FLTGRAM
tcblock mbipmacl 0x19B3    0x01F8 0x11E3 
#
#    ;---- Step #2: Extracting the three strips
#    SETREGS $IPRL_EXTRACT3_INSTR 4 13:0x0726 17:0x0726		;source a
tcblock mbipmacl 0x19B5    0x01B2 0x1448 0x0004 0x0726 \
                                0x6800 0x0726 0x8800 
#    CALLQUE  $QSR_FMT_EXTRACT3
tcblock mbipmacl 0x19BC    0x01F8 0x1931 
#
#    ;---- Step $3: Square-root compress and save to page
#    SETREGS  $IPRL_SQRT_PARAM    2  17:0x00726			;set source page
tcblock mbipmacl 0x19BE    0x01B2 0x13B5 0x0002 0x0726 \
                                0x8800 
#    COPYRI2D $IPRP_FOCUS3_PAGE $IPRL_FOCUS3_TMP_PAGE 3		;copy pag
tcblock mbipmacl 0x19C3    0x01AC 0x143E 0x143F 0x0003 
#    COPYREG  $IPRL_FOCUS3_TMP_PAGE   $IPRL_SQRT_PARAM+2		;copy pa
tcblock mbipmacl 0x19C7    0x0142 0x143F 0x13B7 
#    COPYREG  $IPRL_FOCUS3_TMP_PAGE+1 $IPRL_SQRT_PARAM+3
tcblock mbipmacl 0x19CA    0x0142 0x1440 0x13B8 
#    CALLQUE  $QSR_SQRT_COMP
tcblock mbipmacl 0x19CD    0x01F8 0x12C2 
#
#    ADDREGD  $IPRP_FOCUS3_PAGE 2				;increment forward to the nex
tcblock mbipmacl 0x19CF    0x01BC 0x143E 0x0002 
#
#DONE:
#    END
tcblock mbipmacl 0x19D2    0x01FC 
#
#INIT_PAGE_POINTER:
#    SETREG $IPRP_FOCUS3_PAGE $IPRL_FOCUS3_PAGES			;set pointer to
tcblock mbipmacl 0x19D3    0x0140 0x143E 0x142D 
#    END
tcblock mbipmacl 0x19D6    0x01FC 
#
#
#;----------------------- Start of callback code
#QCB_FOCUS3::
#    BRANCHEQ R3072   5 &CB_FRM05
tcblock mbipmacl 0x19D7    0x01AE 0x0C00 0x0005 0x19E1 
#    BRANCHEQ R3072  10 &CB_FRM10
tcblock mbipmacl 0x19DB    0x01AE 0x0C00 0x000A 0x19EA 
#    GOTO &QSR_CB_DONE_ADDR
tcblock mbipmacl 0x19DF    0x0156 0x0FFF 
#
#CB_FRM05:
#    SETREGS $IPRL_DL_PARAM 2 0x7800 0x7808                      ;
tcblock mbipmacl 0x19E1    0x01B2 0x11D0 0x0002 0x7800 \
                                0x7808 
#    CALLQUE $QSR_DL_2PAGE
tcblock mbipmacl 0x19E6    0x01F8 0x0DA5 
#    GOTO &QSR_CB_DONE_ADDR
tcblock mbipmacl 0x19E8    0x0156 0x0FFF 
#
#CB_FRM10:
#    SETREGS $IPRL_DL_PARAM 2 0x9000 0x9800                      ;
tcblock mbipmacl 0x19EA    0x01B2 0x11D0 0x0002 0x9000 \
                                0x9800 
#    CALLQUE $QSR_DL_2PAGE
tcblock mbipmacl 0x19EF    0x01F8 0x0DA5 
#    SETREG $IPRL_CB_ADDR 0                                      ;
tcblock mbipmacl 0x19F1    0x0140 0x0C20 0x0000 
#    GOTO &QSR_CB_DONE_ADDR
tcblock mbipmacl 0x19F4    0x0156 0x0FFF 
#
#END
tcblock mbipmacl 0x19F6    0x01FC 
#=======================================================
#
return
#
#=======================================================
