# File: mk_ff.src
#
program "%Z% MODULE: %M% RELEASE: %R%.%L% CREATED: %G% %U%"
source "/mdisw/cfl/eof/src/mk_ff.src"
descr  "mk_ff   - load flat field test macros"
#
# DSBQUE                ; Disable Queue
tcblock mbipldin 0x0154 
#
#=======================================================
#
#
# ; IP instructions for constructing a FLAT FIELD table.
# ;
# ; Raw Data:
# ;   0 - Image
# ;   1 - CAL image
# ;
# ; Reciprocal Table: 16:0xA0000
# ;
# ; Extract CAL mode image from page 1:1300 to Page 2:0x00000
# ;
# ; Construct Flat Field Data in 3:00000 by using the LOOKUP instruction
# ; on the CAL image with the Reciprocal table.
# ; 
# ;   SETREGS R800  8 2:0x00514  3:0x00000  0x10000L  4  10
# ;   LOOKUP  R800
# ;   LOOKUP  R800
# ;
# ; Construct a Flat Field data (all 8's)
#     FILLBLK  3:0x00000  0x0000  0x0010  0x0008
tcblock mbipcmd 0x0091 0x0100   0x016C 0x0000 0x1800 0x0000 \
                                0x0010 0x0008 
# ;
# ; Now poke holes in it to simulate bad pixels
#     FILLBLK  3:0x00000  0x100L  0
tcblock mbipcmd 0x0091 0x0106   0x016C 0x0000 0x1800 0x0100 \
                                0x0000 0x0000 
#     FILLBLK  3:0x02020  0x100L  0
tcblock mbipcmd 0x0091 0x010C   0x016C 0x2020 0x1800 0x0100 \
                                0x0000 0x0000 
#     FILLBLK  3:0x04040  0x100L  0
tcblock mbipcmd 0x0091 0x0112   0x016C 0x4040 0x1800 0x0100 \
                                0x0000 0x0000 
#     FILLBLK  3:0x06060  0x100L  0
tcblock mbipcmd 0x0091 0x0118   0x016C 0x6060 0x1800 0x0100 \
                                0x0000 0x0000 
#     FILLBLK  3:0x08080  0x100L  0
tcblock mbipcmd 0x0091 0x011E   0x016C 0x8080 0x1800 0x0100 \
                                0x0000 0x0000 
#     FILLBLK  3:0x0A0A0  0x100L  0
tcblock mbipcmd 0x0091 0x0124   0x016C 0xA0A0 0x1800 0x0100 \
                                0x0000 0x0000 
#     FILLBLK  3:0x0C0C0  0x100L  0
tcblock mbipcmd 0x0091 0x012A   0x016C 0xC0C0 0x1800 0x0100 \
                                0x0000 0x0000 
#     FILLBLK  3:0x0E0E0  0x100L  0
tcblock mbipcmd 0x0091 0x0130   0x016C 0xE0E0 0x1800 0x0100 \
                                0x0000 0x0000 
# ;
# ; Move FF data to list memory (Page 11)
#     SETREGS R808 6  3:0x00000  11:0x00000  0x100000L  
tcblock mbipcmd 0x0091 0x0136   0x01B2 0x0328 0x0006 0x0000 \
                                0x1800 0x0000 0x5800 0x0000 \
                                0x0010 
#     DAT2LST R808
tcblock mbipcmd 0x0091 0x013F   0x01C4 0x0328 
# ;
# ; Move FF data from list memory (Page 12) to output page (8)
#     SETREGS R816  6  11:0x00000   8:0x00226  0x0000  0x0010
tcblock mbipcmd 0x0091 0x0141   0x01B2 0x0330 0x0006 0x0000 \
                                0x5800 0x0226 0x4000 0x0000 \
                                0x0010 
#     LST2DAT R816
tcblock mbipcmd 0x0091 0x014A   0x01C6 0x0330 
# ;
#     SETREGS R824  6   2:0x00000   0x4000  0  0xFFFF 0xFF04
tcblock mbipcmd 0x0091 0x014C   0x01B2 0x0338 0x0006 0x0000 \
                                0x1000 0x4000 0x0000 0xFFFF \
                                0xFF04 
#     HRDINIT R824
tcblock mbipcmd 0x0091 0x0155   0x019C 0x0338 
# ;
#     SETREGS R512  2   0x0000  0x0010
tcblock mbipcmd 0x0091 0x0157   0x01B2 0x0200 0x0002 0x0000 \
                                0x0010 
#     START1HR  3  0x4000  R512
tcblock mbipcmd 0x0091 0x015C   0x0174 0x0003 0x4000 0x0200 
# ;   
#     END
tcblock mbipcmd 0x0091 0x0160   0x01FC 
# ;.....................................
# ;
# ; Move Reciprocal Table from 17:0xA0000 to 8:0x00226
# ;
#     MOVBLK  16:0xA0000   8:0x00226  0x8000  0x0000
tcblock mbipcmd 0x0091 0x0161   0x0164 0x0000 0x800A 0x0226 \
                                0x4000 0x8000 0x0000 
# ;
#     SETREGS R824  6   2:0x00000   0x4000  0  0xFFFF 0xFF71
tcblock mbipcmd 0x0091 0x0168   0x01B2 0x0338 0x0006 0x0000 \
                                0x1000 0x4000 0x0000 0xFFFF \
                                0xFF71 
#     HRDINIT R824
tcblock mbipcmd 0x0091 0x0171   0x019C 0x0338 
# ;
#     SETREGS R512 2  0x8000  0x0000
tcblock mbipcmd 0x0091 0x0173   0x01B2 0x0200 0x0002 0x8000 \
                                0x0000 
#     START1HR  3  0x4000  R512
tcblock mbipcmd 0x0091 0x0178   0x0174 0x0003 0x4000 0x0200 
# ;
#     END
tcblock mbipcmd 0x0091 0x017C   0x01FC 
# ;.....................................
# ;
# ; Move CAL Image from 2:0x00514 to 8:0x00226
#     MOVBLK  2:0x00514  8:0x00226  0x100000L
tcblock mbipcmd 0x0091 0x017D   0x0164 0x0514 0x1000 0x0226 \
                                0x4000 0x0000 0x0010 
# ;
#     SETREGS R824  6   2:0x00000   0x4000  0  0xFFFF 0xFF04
tcblock mbipcmd 0x0091 0x0184   0x01B2 0x0338 0x0006 0x0000 \
                                0x1000 0x4000 0x0000 0xFFFF \
                                0xFF04 
#     HRDINIT R824
tcblock mbipcmd 0x0091 0x018D   0x019C 0x0338 
# ;
#     SETREGS R512 2  0x0000  0x0010
tcblock mbipcmd 0x0091 0x018F   0x01B2 0x0200 0x0002 0x0000 \
                                0x0010 
#     START1HR  3  0x4000  R512
tcblock mbipcmd 0x0091 0x0194   0x0174 0x0003 0x4000 0x0200 
# ;
#     END
tcblock mbipcmd 0x0091 0x0198   0x01FC 
# ;.....................................
# ;
# ; === FLATFLD ==
# ;
#     SETREGS  R864 9 2:0x00514 11:0x00000 8:0x00226 0x0000 0x0010 12
tcblock mbipcmd 0x0091 0x0199   0x01B2 0x0360 0x0009 0x0514 \
                                0x1000 0x0000 0x5800 0x0226 \
                                0x4000 0x0000 0x0010 0x000C 
#     FLATFLD  R864
tcblock mbipcmd 0x0091 0x01A5   0x01CC 0x0360 
# ;
#     SETREGS R824  6   2:0x00000   0x4000  0  0xFFFF 0xFF04
tcblock mbipcmd 0x0091 0x01A7   0x01B2 0x0338 0x0006 0x0000 \
                                0x1000 0x4000 0x0000 0xFFFF \
                                0xFF04 
#     HRDINIT R824
tcblock mbipcmd 0x0091 0x01B0   0x019C 0x0338 
# ;
#     SETREGS R512  2   0x0000  0x0010
tcblock mbipcmd 0x0091 0x01B2   0x01B2 0x0200 0x0002 0x0000 \
                                0x0010 
#     START1HR  3  0x4000  R512
tcblock mbipcmd 0x0091 0x01B7   0x0174 0x0003 0x4000 0x0200 
# ;   
#     END
tcblock mbipcmd 0x0091 0x01BB   0x01FC 
# ;
# ;.....................................
# ;
# ; === BADPIX ==
# ;
#     
tcblock mbipcmd 0x0091 0x01BC   0x01D2 0x0001 
#     SETREGS  R864 9 2:0x00514 11:0x00000 8:0x00226 0x0000 0x0010 12
tcblock mbipcmd 0x0091 0x01BE   0x01B2 0x0360 0x0009 0x0514 \
                                0x1000 0x0000 0x5800 0x0226 \
                                0x4000 0x0000 0x0010 0x000C 
#     BADPIX   R864
tcblock mbipcmd 0x0091 0x01CA   0x01D2 0x0360 
# ;
#     SETREGS R824  6   2:0x00000   0x4000  0  0xFFFF 0xFF04
tcblock mbipcmd 0x0091 0x01CC   0x01B2 0x0338 0x0006 0x0000 \
                                0x1000 0x4000 0x0000 0xFFFF \
                                0xFF04 
#     HRDINIT R824
tcblock mbipcmd 0x0091 0x01D5   0x019C 0x0338 
# ;
#     SETREGS R512  2   0x0000  0x0010
tcblock mbipcmd 0x0091 0x01D7   0x01B2 0x0200 0x0002 0x0000 \
                                0x0010 
#     START1HR  3  0x4000  R512
tcblock mbipcmd 0x0091 0x01DC   0x0174 0x0003 0x4000 0x0200 
# ;   
#     END
tcblock mbipcmd 0x0091 0x01E0   0x01FC 
# ;
# ;.....................................
# ;
# ; *** SCALE ***
# ;
#     SETREGS  R880  8  2:0x00514  8:0x00226  0x0000 0x0010  10  12
tcblock mbipcmd 0x0091 0x01E1   0x01B2 0x0370 0x0008 0x0514 \
                                0x1000 0x0226 0x4000 0x0000 \
                                0x0010 0x000A 0x000C 
#     SCALE    R880
tcblock mbipcmd 0x0091 0x01EC   0x01BE 0x0370 
# ;
#     SETREGS R824  6   2:0x00000   0x4000  0  0xFFFF 0xFF04
tcblock mbipcmd 0x0091 0x01EE   0x01B2 0x0338 0x0006 0x0000 \
                                0x1000 0x4000 0x0000 0xFFFF \
                                0xFF04 
#     HRDINIT R824
tcblock mbipcmd 0x0091 0x01F7   0x019C 0x0338 
# ;
#     SETREGS R512  2   0x0000  0x0010
tcblock mbipcmd 0x0091 0x01F9   0x01B2 0x0200 0x0002 0x0000 \
                                0x0010 
#     START1HR  3  0x4000  R512
tcblock mbipcmd 0x0091 0x01FE   0x0174 0x0003 0x4000 0x0200 
# ;   
#     END
tcblock mbipcmd 0x0091 0x0202   0x01FC 
# ;=====================================
#=======================================================
#
# ENBQUE                ; Enable Queue
tcblock mbipldin 0x0136
#
#
return
#
#=======================================================
