home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-06-17 | 75.9 KB | 3,205 lines |
- Include "equ.h"
- Include "impequ.h"
-
- TypeBYTE equ 1
- TypeASCII equ 2
- TypeSHORT equ 3
- TypeLONG equ 4
- TypeRATIONAL equ 5
- CR equ $d
- LF equ $a
-
- SECTION ibmeps,CODE,PUBLIC
- *******************************************
- *** ***
- *******************************************
- dumbentry:
- clr.l d0
- rts
-
- dc.l "IMPO"
- dc.w 200
- dc.l 0
-
- table: dc.l 0
- dc.l name,special,check,eps
-
- *
- * IBM Encapsulated PostScript
- *
- check: move.l table,a0
- move.l buff1(a0),a1
- move.l (a1),a1
- lea ibmepsfhdr,a2
- ck1: cmp.b (a2)+,(a1)+
- bne never
- tst.b (a2)
- bne ck1
-
- ;move.b (a1)+,estart+3
- ;move.b (a1)+,estart+2
- ;move.b (a1)+,estart+1
- ;move.b (a1)+,estart
- ;move.l buff1(a0),a1
- ;move.l (a1),a1
- ;add.l estart,a1
- ;lea epsfhdr,a2
- ;ck2: cmp.b (a2)+,(a1)+
- ;bne never
- ;tst.b (a2)
- ;bne ck2
-
- moveq #2,d0
- irts: rts
-
-
- *****************************************
- * *
- *****************************************
- eps: move.l #0,picture ;zero pointer to mem for tiff data
- move.l #0,ehandle ;zero pointer to mem for eps data
- bsr geteps
- bne eps0
-
- cmp.l #0,ehandle
- bne eps01
- rts
-
- eps01: move.l table,a1
- move.l m_delete(a1),a1
- move.l ehandle,a0
- jsr (a1)
- rts
-
- eps0: move.b #teps,object+ob_Type ;set object defaults
- clr.b object+ob_Flag
- clr.w object+ob_Slant
- clr.w object+ob_Twist
- move.w #50,object+ob_LWidth
- clr.b object+ob_LType
- move.b #1,object+ob_LColor
- clr.b object+ob_FType
- move.b #1,object+ob_FColor
- clr.b object+ob_LBegin
- clr.b object+ob_LEnd
- move.w #900,object+ob_HStandOff
- move.w #900,object+ob_VStandOff
-
- clr.l object+ob_Left
- clr.l object+ob_Top
- move.l eright,d0
- sub.l eleft,d0
- bpl eps02
- neg.l d0
- eps02: move.l etop,d1
- sub.l ebottom,d1
- bpl eps03
- neg.l d1
- eps03: mulu #100,d0
- mulu #100,d1
- move.l d0,object+ob_Right
- move.l d1,object+ob_Bottom
-
- move.l table,a0 ;gain access to object - new object
- move.l o_open(a0),a0
- jsr (a0)
-
- move.l table,a1 ;puts object into copy buffer
- move.l o_obj(a1),a1
- lea object,a0
- jsr (a1)
- beq abortobj
-
- move.l elength,d0 ;allocate memory for eps object
- add.l #eps_Sizeof,d0
- add.l #16,d0
- move.l table,a0
- move.l o_malloc(a0),a0
- jsr (a0)
- beq abortobj
-
- move.l table,a1
- move.l copybuf(a1),a1
- move.l (a1),a1
- move.l a0,d0
- sub.l (a1),d0
- move.l d0,eobj
-
- move.w #3,eps_Type(a0)
- move.l object+ob_Right,eps_Width(a0)
- move.l object+ob_Bottom,eps_Height(a0)
- clr.l eps_PicPtr(a0)
- clr.l eps_PlyPtr(a0)
- move.l elength,d0
- add.l #16,d0
- move.l d0,eps_DataLen(a0)
-
- lea eps_Sizeof(a0),a0
- move.l eleft,(a0)+
- move.l ebottom,(a0)+
- move.l eright,(a0)+
- move.l etop,(a0)+
-
- move.l ehandle,a1 ;copy the eps data into object
- move.l (a1),a1
- move.l elength,d0
- move.l d0,d1
- swap d1
- bra ce2
- ce1: move.b (a1)+,(a0)+
- ce2: dbf d0,ce1
- dbf d1,ce2
-
- move.l ehandle,a0 ;delete memory allocated for eps data
- move.l table,a1
- move.l m_delete(a1),a1
- jsr (a1)
-
- clr.l ehandle
- cmp.l #0,tiffstart
- beq eps2 ;no tiff image data so exit
-
- move.l table,a0
- move.l spclnum(a0),a0
- cmp.w #1,(a0)
- beq eps2 ;do NOT show picture - so exit
-
- ***********************************************
- eps1: move.l table,a0
- move.l f_openr(a0),a0
- jsr (a0)
- bne eps101 ;if unable to open file for pict reading exit
-
- bra abortobj
-
- eps101: move.l table,a0
- move.l m_alloc(a0),a0
- move.l tifflen,d0
- clr.l d1
- clr.l d2
- jsr (a0) ;alloc mem to hold disk read
- bne eps11
-
- eps10: move.l table,a0 ;if couldn't m_alloc mem close file and exit
- move.l f_closer(a0),a0
- jsr (a0)
- bra abortobj
-
- eps11: move.l a0,picture
- move.l tiffstart,d0
- move.l d0,d1
- swap d1
- and.l #$0000ffff,d0 ;clear out upper word in d0
- kldg1: move.w d1,-(sp)
- move.l table,a0
- move.l f_skip(a0),a0 ;seek start of tiff data in disk file
- jsr (a0)
- beq eps110
- move.w (sp)+,d1
- move.l #$0000ffff,d0
- dbf d1,kldg1
-
- cmp.l #$00010000,tiffstart
- bcs kldg2
- move.w #1,d0
- move.l table,a0
- move.l f_skip(a0),a0
- jsr (a0)
- beq eps111
-
- kldg2: move.l picture,a0
- move.l (a0),a0
- move.l table,a1 ;read tiff data into memory allocated
- move.l f_getr(a1),a1
- move.l tifflen,d0
- jsr (a1)
- bne eps12
- bra eps111
-
- eps110: addq.l #2,sp
-
- eps111: move.l picture,a0 ;delete memory, close file, and exit
- move.l table,a1
- move.l m_delete(a1),a1
- jsr (a1)
- bra eps10
-
- eps12: move.l table,a0 ;close file
- move.l f_closer(a0),a0
- jsr (a0)
-
- bsr getpicinfo
-
- lea pic,a0
-
- clr.l d0
- clr.l pc_DPtr(a0) ;no screen view allocated
- clr.w pc_DScale(a0) ;screen view needs to be computed
- move.w pc_Palet(a0),d0
- mulu #pl_Sizeof,d0
- add.l #pc_Sizeof,d0
- move.l d0,pc_Ptr(a0) ;picture begins n-bytes from begining
-
- clr.l d0
- clr.l d1
- move.w pc_Width(a0),d0 ;calculate number of bytes
- mulu pc_BitPln(a0),d0
- mulu pc_H(a0),d0
- move.w pc_Palet(a0),d1
- mulu #pl_Sizeof,d1
- move.l d1,palsize
- add.l d1,d0
- add.l #pc_Sizeof,d0
-
- move.l table,a0 ;allocate memory for picture stuff
- move.l o_malloc(a0),a0
- jsr (a0)
- beq abortobj
-
- move.l table,a1
- move.l copybuf(a1),a1
- move.l (a1),a1
- move.l (a1),a1
- add.l eobj,a1
- move.l #1,eps_PicPtr(a1) ;link picture to eps object
-
- lea pic,a1 ;copy data into allocated structure
- move.w #pc_Sizeof/2-1,d0
- tiff1: move.w (a1)+,(a0)+
- dbf d0,tiff1
-
- move.l a0,palptr ;palette data comes after pic struct
- move.l palsize,d0
- add.l d0,a0
-
- move.l a0,picptr ;pic data comes after palette data
- move.l a0,picptrsave
-
- move.w pic+pc_Width,d0 ;for horizontal differencing
- mulu pic+pc_H,d0
- move.w pic+pc_BitPln,d1
- subq.w #1,d1
- mulu d1,d0
- add.l d0,a0
- move.l a0,picptr2
- move.l a0,picptrsave2
-
- move.l sp,spsave
- bsr putpic
-
- eps2: move.l table,a0 ;close object
- move.l o_close(a0),a0
- jmp (a0) ;and exit
-
- ***********************************
- *** ***
- ***********************************
- abortobj:
- move.l ehandle,d0 ;free mem for eps data
- beq ab1
- move.l d0,a0
- move.l table,a1
- move.l m_delete(a1),a1
- jsr (a1)
-
- ab1: move.l picture,d0 ;free mem for tiff data
- beq ab2
- move.l d0,a0
- move.l table,a1
- move.l m_delete(a1),a1
- jsr (a1)
-
- ab2: move.l table,a0
- move.l o_abort(a0),a0
- jmp (a0)
-
-
- ***********************************
- *** ***
- ***********************************
- rtf0: move.l ehandle,a0
- cmp.l #0,a0
- beq rtfail
-
- move.l table,a1
- move.l m_delete(a1),a1
- jsr (a1)
-
- rtfail: moveq #0,d0
- rts
-
- *******************************************
- *** ***
- *******************************************
- geteps: move.l table,a0
- move.l f_openr(a0),a0
- jsr (a0)
- beq irts
-
- move.l table,a1
- move.l buff1(a1),a0
- move.l (a0),a0
- move.l #30,d0 ;read in first 30 bytes
- move.l f_getr(a1),a1
- jsr (a1)
-
- move.l table,a1
- move.l buff1(a1),a0
- move.l (a0),a0
- add.l #4,a0
-
- move.b (a0)+,estart+3 ;read offset to beginning of postscript
- move.b (a0)+,estart+2
- move.b (a0)+,estart+1
- move.b (a0)+,estart
-
- move.b (a0)+,elength+3 ;read length of postscript
- move.b (a0)+,elength+2
- move.b (a0)+,elength+1
- move.b (a0)+,elength
-
- move.b (a0)+,metastart+3 ;read offset to start of metafile
- move.b (a0)+,metastart+2
- move.b (a0)+,metastart+1
- move.b (a0)+,metastart
-
- move.b (a0)+,metalen+3 ;read length of metafile description
- move.b (a0)+,metalen+2
- move.b (a0)+,metalen+1
- move.b (a0)+,metalen
-
- move.b (a0)+,tiffstart+3 ;read offset to start of tiff data
- move.b (a0)+,tiffstart+2
- move.b (a0)+,tiffstart+1
- move.b (a0)+,tiffstart
-
- move.b (a0)+,tifflen+3 ;read length of tiff data
- move.b (a0)+,tifflen+2
- move.b (a0)+,tifflen+1
- move.b (a0)+,tifflen
-
- move.l table,a0 ;close the file
- move.l f_closer(a0),a0
- jsr (a0)
-
- move.l table,a1 ;alloc mem to hold disk postscript stuff
- move.l m_alloc(a1),a1
- move.l elength,d0
- clr.w d1
- clr.w d2
- jsr (a1)
- bne gtep5
-
- moveq.l #0,d0 ;indicate failure
- rts
-
- gtep5: move.l a0,ehandle ;save start address of memory - handle
- move.l table,a0
- move.l f_openr(a0),a0
- jsr (a0)
- beq gtep50
-
- move.l estart,d0 ;f_skip kludge for PgS2.0 (fixed in 2.1)
- move.l d0,d1
- swap d1
- and.l #$0000ffff,d0 ;clear out upper word in d0
- ekldg1: move.w d1,-(sp)
- move.l table,a0
- move.l f_skip(a0),a0 ;seek start of eps data in disk file
- jsr (a0)
- beq ekldg2
- move.w (sp)+,d1
- move.l #$0000ffff,d0
- dbf d1,ekldg1
-
- cmp.l #$00010000,estart
- bcs gtep51
- move.w #1,d0
- move.l table,a0
- move.l f_skip(a0),a0
- jsr (a0)
- bne gtep51
-
- ;move.l estart,d0 ;seek to start of eps data
- ;move.l table,a0
- ;move.l f_skip(a0),a0
- jsr (a0)
- ;bne gtep51 ;if no error continue
-
- ekldg2: move.l table,a0 ;else close the file
- move.l f_closer(a0),a0
- jsr (a0)
-
- gtep50: moveq #0,d0 ;indicate failure
- rts ;and exit
-
- gtep51: move.l ehandle,a0
- move.l (a0),a0
- move.l table,a1 ;read in postscript file
- move.l f_getr(a1),a1
- move.l elength,d0
- jsr (a1)
-
- move.l table,a0 ;close file
- move.l f_closer(a0),a0
- jsr (a0)
-
- move.l ehandle,a0
- move.l (a0),a0
- move.l elength,d0
-
- move.l #0,eleft ;check for bounding box parameter
- move.l #0,etop
- move.l #72,eright
- move.l #72,ebottom
- bra getp8
- getp6: lea bbstr,a1
- getp7: cmp.b (a0)+,(a1)+
- bne getp8
- subq.l #1,d0
- tst.b (a1)
- bne getp7
- bra getp9
-
- getp8: subq.l #1,d0
- bcc getp6
- bra getp10
- *
- * got a match - get actual bounding box parameters
- *
- getp9: bsr getnum
- move.l d0,eleft
- bsr getnum
- move.l d0,ebottom
- bsr getnum
- move.l d0,eright
- bsr getnum
- move.l d0,etop
-
- getp10: bsr putzero
- bne getp11
-
- moveq.l #0,d0 ;indicate failure
- rts
-
- getp11: move.l elength,d0
- btst #0,d0
- beq even
- bsr putzero
- bne even
-
- moveq.l #0,d0 ;indicate failure
- rts
-
- even: moveq.l #1,d0 ;indicate success!!
- rts
-
-
- *******************************************
- *** ***
- *******************************************
- putzero:
- move.l #1,d0
- move.l ehandle,a0
- move.l table,a1
- move.l m_grow(a1),a1
- jsr (a1)
- beq rtf0
-
- move.l ehandle,a0
- move.l (a0),a0
- add.l elength,a0
- clr.b (a0)
- addq.l #1,elength
- rts
-
-
- **********************************
- ** **
- **********************************
- getnum: move.b (a0),d1
- moveq #0,d0
- moveq #1,d2
- cmp.b #"-",d1
- beq gtnm2
- cmp.b #"0",d1
- bcs gtnm0
- cmp.b #"9",d1
- bls gtnm1
- gtnm0: addq.l #1,a0
- bra getnum
- gtnm1: moveq #0,d0
- moveq #0,d2
- gtnm2: move.b (a0)+,d1
- beq gtnm9
- cmp.b #"-",d1
- bne gtnm3
- moveq #1,d2
- bra gtnm2
- gtnm3: cmp.b #" ",d1
- beq gtnm9
- cmp.b #CR,d1
- beq gtnm9
- cmp.b #LF,d1
- beq gtnm9
- cmp.b #".",d1
- beq gtnm10
- sub.b #"0",d1
- bcs gtnm9
- cmp.b #9,d1
- bhi gtnm9
- move.l d0,-(sp)
- lsl.l #2,d0 ;*4
- add.l (sp)+,d0 ;*5
- lsl.l #1,d0 ;*5
- and.l #$ff,d1
- add.l d1,d0
- bra gtnm2
- gtnm9: tst.w d2
- beq irts
- neg.l d0
- rts
-
- gtnm10: move.b (a0)+,d1
- beq gtnm9
- sub.b #"0",d1
- bcs gtnm9
- cmp.w #9,d1
- bhi gtnm9
- bra gtnm10
-
- *****************************************
- * *
- *****************************************
- getpicinfo:
- clr.l picoffset
- clr.b byteorder
-
- bsr pgetw ; FORM - II or MM
- cmp.w #"II",d0
- bne gpi2
- move.b #1,byteorder
- gpi2:
- jsr pgetw ;version number ($42)
- jsr pgetl
- move.l d0,picoffset
- jsr pgetw
- move.w d0,tagcount
- *
- * some defaults set up here!
- *
- move.w #1,bps
- move.l #0,sbc
- move.w #1,compression
- move.w #0,photom
- move.w #1,planar
- move.w #1,predictor
- move.w #1,sppixel
- move.w #2,resunits
- move.w #300,xres
- move.w #300,yres
- move.l #0,rps
- move.l #0,palcount
-
- gptagloop:
- jsr pgetw
- move.w d0,tagid
- jsr pgetw
- move.w d0,tagtype
- jsr pgetl
- move.l d0,taglength
- cmp.l #10,d0
- bcc gptg03
-
- lea typelen,a0
- move.l taglength,d0
- move.w tagtype,d1
- move.b 0(a0,d1.w),d1
- lsl.l d1,d0
- cmp.l #4,d0
- bls gptg01
- gptg03: jsr pgetl
- move.l d0,tagvalue
- bra gptg02
- gptg01: move.l picoffset,tagvalue
- addq.l #4,picoffset
-
- gptg02: lea taglist,a0
- gptg1: move.w (a0)+,d0
- beq gptg9
- cmp.w tagid,d0
- beq gptg8
- lea 4(a0),a0
- bra gptg1
-
- gptg8: move.l (a0),a0
- jsr (a0)
-
- gptg9: subq.w #1,tagcount
- bne gptagloop
-
- lea pic,a0
- lea pctypetbl,a1
- move.w photom,d0
- move.b 0(a1,d0.w),d0
- move.w d0,pc_Type(a0)
- move.w #-1,pc_SFreq(a0)
- move.w #-1,pc_SAngle(a0)
- move.w #0,pc_SSpot(a0)
- move.l #0,pc_SMap(a0)
- move.l #0,pc_SMap+4(a0)
- move.w xres,pc_XDpi(a0)
- move.w yres,pc_YDpi(a0)
- move.w pc_W(a0),d0
- add.w #15,d0
- lsr.w #3,d0
- bclr #0,d0
- move.w d0,pc_Width(a0)
- move.w bps,d0
- mulu sppixel,d0
- move.w d0,pc_BitPln(a0)
- move.l palcount,d0
- divu #3,d0
- move.w d0,pc_Palet(a0)
-
- rts
-
-
- *******************************************
- *** BitsPerSample ***
- *******************************************
- tag_bsample:
- bsr getdata
- move.w d0,bps
- rts
-
-
- *******************************************
- *** ColorMap ***
- *******************************************
- tag_colormap:
- move.l taglength,palcount
- move.l tagvalue,cmapoffset
- rts
-
-
- *******************************************
- *** ColorResponseCurves ***
- *******************************************
- tag_crcurves:
- rts
-
-
- *******************************************
- *** Compression ***
- *******************************************
- tag_compression:
- bsr getdata
- move.w d0,compression
- rts
-
-
- *******************************************
- *** GrayResponseCurve ***
- *******************************************
- tag_grcurve:
- rts
-
-
- *******************************************
- *** GrayResponseUnit ***
- *******************************************
- tag_grunit:
- rts
-
-
- *******************************************
- *** ImageLength (height) ***
- *******************************************
- tag_iheight:
- bsr getdata
- move.w d0,pic+pc_H
- rts
-
-
- *******************************************
- *** ImageWidth ***
- *******************************************
- tag_iwidth:
- bsr getdata
- move.w d0,pic+pc_W
- rts
-
-
- *******************************************
- *** NewSubfileType ***
- *******************************************
- tag_newsftype:
- rts
-
-
- *******************************************
- *** PhotometricInterpretation ***
- *******************************************
- tag_photometric:
- bsr getdata
- move.w d0,photom
- rts
-
-
- *******************************************
- *** PlanarConfiguration ***
- *******************************************
- tag_planar:
- bsr getdata
- move.w d0,planar
- rts
-
-
- *******************************************
- *** Predictor ***
- *******************************************
- tag_predictor:
- bsr getdata
- move.w d0,predictor
- rts
-
-
- *******************************************
- *** ResolutionUnit ***
- *******************************************
- tag_resolution:
- bsr getdata
- move.w d0,resunits
- rts
-
-
- *******************************************
- *** StripByteCount ***
- *******************************************
- tag_stripbytecnt:
- move.l tagvalue,sbc
- move.w tagtype,sbctype
- rts
-
-
- *******************************************
- *** RowsPerStrip ***
- *******************************************
- tag_rpstrip:
- bsr getdata
- move.l d0,rps
- rts
-
-
- *******************************************
- *** SamplesPerPixel ***
- *******************************************
- tag_sppixel:
- bsr getdata
- move.w d0,sppixel
- rts
-
-
- *******************************************
- *** XResolution ***
- *******************************************
- tag_xres:
- bsr getdata
- cmp.w #20,d0
- bcc tagx1
- move.w #75,d0
- tagx1: move.w d0,xres
- rts
-
-
- *******************************************
- *** YResolution ***
- *******************************************
- tag_yres:
- bsr getdata
- cmp.w #20,d0
- bcc tagy1
- move.w #75,d0
- tagy1: move.w d0,yres
- rts
-
-
- *******************************************
- *** ***
- *******************************************
- putpic:
- clr.l picoffset
-
- bsr pgetw ; FORM - II or MM
- jsr pgetw ;version number ($42)
- jsr pgetl
- move.l d0,picoffset
- jsr pgetw
- move.w d0,tagcount
-
- pptagloop:
- jsr pgetw
- move.w d0,tagid
- jsr pgetw
- move.w d0,tagtype
- jsr pgetl
- move.l d0,taglength
- cmp.l #10,d0
- bcc pptg03
-
- lea typelen,a0
- move.l taglength,d0
- move.w tagtype,d1
- move.b 0(a0,d1.w),d1
- lsl.l d1,d0
- cmp.l #4,d0
- bls pptg01
- pptg03: jsr pgetl
- move.l d0,tagvalue
- bra pptg02
- pptg01: move.l picoffset,tagvalue
- addq.l #4,picoffset
-
- pptg02: lea taglist2,a0
- pptg1: move.w (a0)+,d0
- beq pptg9
- cmp.w tagid,d0
- beq pptg8
- lea 4(a0),a0
- bra pptg1
-
- pptg8: move.l (a0),a0
- jsr (a0)
-
- pptg9: subq.w #1,tagcount
- bne pptagloop
-
- bra purgepic
-
-
- *******************************************
- *** StripOffsets ***
- *******************************************
- tag_stripoffset:
- cmp.l #0,rps ;was a rps tag found?
- bne tgso01 ;yes
-
- clr.l d0
- move.w pic+pc_H,d0
- cmp.l taglength,d0
- bne tgso0
- move.l #1,rps
- bra tgso01
-
- tgso0: lea taglength,a0
- addq.l #2,a0
- divu (a0),d0 ;calc how many rows per strip
- move.l d0,rps
-
- tgso01: clr.l d0
- cmp.w #2,compression
- bne tgso02
- move.w #0,hcount ;for faxcomp
- bra tgso03
- tgso02: move.w pic+pc_H,hcount
- tgso03: move.l picptr2,apos1 ;for cpystr
- move.l picptr2,apos2 ; "
- move.w #7,bitcount ; "
- move.w #0,plncnt ; "
- move.w pic+pc_W,d0 ; "
- subq.w #1,d0 ; "
- move.w d0,pixcount ; "
- move.w pic+pc_Width,d0 ; "
- mulu pic+pc_H,d0 ; "
- move.l d0,plnlen ; "
- clr.w flag
-
- bra tgso9
- tgso1: cmp.l #0,sbc ;strip loop (taglength times)
- bne tgso2
- clr.l d0
- move.w pic+pc_W,d0
- add.w #7,d0
- lsr.w #3,d0
- mulu pic+pc_BitPln,d0
- mulu pic+pc_H,d0
- move.l d0,striplength
- bra tgso3
-
- tgso2: move.l tagvalue,-(sp)
- move.w tagtype,-(sp)
- move.l sbc,tagvalue
- move.w sbctype,tagtype
- bsr getdata
- move.l d0,striplength
- move.l tagvalue,sbc
- move.w (sp)+,tagtype
- move.l (sp)+,tagvalue
-
- tgso3: bsr getdata
-
- move.l picture,a0
- move.l (a0),a0
- add.l d0,a0
-
- cmp.w #5,compression ;5=lzw
- bne tgso4
- move.l outcode,a1
- move.l (a1),-(sp)
- move.l suffix,a1
- move.l (a1),-(sp)
- move.l prefix,a1
- move.l (a1),-(sp)
- move.l #$000000ff,-(sp)
- move.l #$00000008,-(sp)
- move.l a0,-(sp)
- jsr _doLZW
- add.l #24,sp
- bra tgso9
-
- tgso4: cmp.w #$8005,compression ;$8005 = packbits
- bne tgso5
- bsr pbrgb
- bra tgso9
-
- tgso5: cmp.w #1,compression ;1=no compression
- bne tgso7
- move.l striplength,d0
- clr.w flag ;clear copy flag (0=inc pointer in a0)
- bsr nocomp
- bra tgso9
-
- tgso7: cmp.w #2,compression ;CCITT compressed?
- bne tgso8
-
- cmp.w #1,photom ;is the photmetricinterpret = 1?
- bne tgso71 ;no
- move.w #0,photom ;reverse it if it is.
- tgso71: bsr faxcomp
- bra tgso9
-
- tgso8: bra abortobj
-
- tgso9: subq.l #1,taglength
- bcc tgso1
- rts
-
- ***********************************
- *** ***
- ***********************************
- nocomp: move.l rps,rowcount
- bsr cpystr
- rts
-
- ***********************************
- *** ***
- ***********************************
- readcode:
- movem.l d2-d7/a2-a3,-(a7)
- movea.l 36(a7),a3
- move.l 40(a7),d7
- move.l 44(a7),d6
- movea.l 48(a7),a2
- move.l (a3),d0
- move.l d0,d1
- lsr.l #3,d1
- move.b 0(a2,d1.l),d2
- move.b 1(a2,d1.l),d3
- move.b 2(a2,d1.l),d4
- add.l d7,(a3)
- moveq #24,d1
- sub.l d7,d1
- moveq #7,d5
- and.l d5,d0
- moveq #0,d5
- move.b d4,d5
- moveq #0,d4
- move.b d3,d4
- asl.l #8,d4
- moveq #0,d3
- move.b d2,d3
- swap d3
- clr.w d3
- add.l d4,d3
- add.l d5,d3
- asl.l d0,d3
- lsr.l d1,d3
- and.l d6,d3
- move.l d3,d0
- movem.l (a7)+,d2-d7/a2-a3
- rts
-
-
- ***********************************
- *** ***
- ***********************************
- _doLZW:
- link a5,#-64
- movem.l d2-d7/a2-a3,-(a7)
- move.l rps,rowcount
- movea.l 28(a5),a3
- move.l 12(a5),d7
- moveq #1,d0
- move.l d0,d1
- asl.l d7,d1
- move.l d1,d2
- addq.l #1,d2
- move.l d1,d3
- addq.l #2,d3
- move.l d7,d4
- addq.l #1,d4
- move.l d1,44(a7)
- move.l d4,d1
- move.l d1,32(a7)
- move.l d0,d1
- asl.l d4,d1
- move.l d1,d6
- move.l d6,d0
- subq.l #1,d0
- moveq #0,d1
- move.l d1,-36(a5)
- move.l d1,d7
- movea.l 8(a5),a2
- move.l a2,-(a7)
- move.l d0,-(a7)
- move.l d4,-(a7)
- pea -36(a5)
- move.l d0,-28(a5)
- move.l d2,56(a7)
- move.l d3,-24(a5)
- move.l d3,52(a7)
- bsr.w readcode
- lea 16(a7),a7
- move.l d0,d5
- moveq #1,d0
- move.l d0,-40(a5)
- bra.w dolzw6
-
- dolzw1: cmp.l 44(a7),d5
- bne.b dolzw2
-
- move.l 32(a7),d4
- moveq #1,d0
- move.l d0,d1
- asl.l d4,d1
- move.l d1,d6
- move.l d6,d0
- subq.l #1,d0
- move.l 36(a7),-24(a5)
- move.l a2,-(a7)
- move.l d0,-(a7)
- move.l d4,-(a7)
- pea -36(a5)
- move.l d0,-28(a5)
- bsr.w readcode
- move.l d0,d5
- move.l d5,d0
- and.l 16(a5),d0
- move.b d0,-45(a5)
- pea 1
- pea -45(a5)
- bsr _cpystr
- lea 24(a7),a7
- bra.w dolzw5
-
- dolzw2: move.l d5,d6
- cmp.l -24(a5),d6
- bcs.b dolzw4
-
- move.l -44(a5),d6
- moveq #1,d7
- move.b -45(a5),(a3)
- bra.b dolzw4
-
- dolzw3: movea.l 24(a5),a0
- move.b 0(a0,d6.l),(a2)
- move.l d6,d0
- asl.l #2,d0
- movea.l 20(a5),a0
- move.l 0(a0,d0.l),d6
- dolzw4: movea.l a3,a2
- adda.l d7,a2
- addq.l #1,d7
- cmp.l 16(a5),d6
- bhi.b dolzw3
-
- move.l d6,d0
- and.l 16(a5),d0
- move.b d0,-45(a5)
- move.b d0,(a2)
- move.l d7,-(a7)
- move.l a3,-(a7)
- bsr _cpystr
- addq.w #8,a7
- moveq #0,d7
- move.l -24(a5),d0
- move.l d0,d1
- asl.l #2,d1
- movea.l 20(a5),a0
- move.l -44(a5),0(a0,d1.l)
- movea.l 24(a5),a0
- move.b -45(a5),0(a0,d0.l)
- addq.l #1,-24(a5)
- move.l -32(a5),d6
- move.l d6,d0
- subq.l #1,d0
- move.l -24(a5),d1
- cmp.l d0,d1
- bcs.b dolzw5
-
- moveq #12,d0
- cmp.l d0,d4
- bcc.b dolzw5
-
- addq.l #1,d4
- add.l d6,d6
- moveq #1,d0
- move.l d0,d1
- asl.l d4,d1
- subq.l #1,d1
- move.l d1,-28(a5)
- dolzw5: move.l d5,-44(a5)
- movea.l 8(a5),a2
- move.l a2,-(a7)
- move.l -28(a5),-(a7)
- move.l d4,-(a7)
- pea -36(a5)
- bsr.w readcode
- lea 16(a7),a7
- move.l d0,d5
- addq.l #1,-40(a5)
- dolzw6: move.l d6,-32(a5)
- cmp.l 40(a7),d5
- bne.w dolzw1
-
- move.l -40(a5),d0
- movem.l (a7)+,d2-d7/a2-a3
- unlk a5
- rts
-
- **********************************
- ** **
- **********************************
- faxcomp:
- move.l #0,rowcount
-
- fc2: clr.l d5 ;white codes are always first in row
- clr.l d6
- move.w pic+pc_W,d6
- move.l picptr,a1
- move.l #0,d0
- move.w #0,pixcount ;zero the pixel counter
- move.w #7,pixpos ;set current pixel postion in amiga bitmap
-
- fc3: move.b (a0),temp
- move.b 1(a0),temp+1
- move.b 2(a0),temp+2
- move.b 3(a0),temp+3
- move.l temp,d0 ;get 4 bytes into d0 for bit testing
- clr.l d1
- move.l #31,d1 ;set the bit pointer
-
- fc4: move.l d1,saved1 ;save d1 for the table switch testing
- move.l a0,savea0 ;save a0 for table switch testing
-
- fc5: move.w #0,d7 ;clear the bit counter
- move.l saved1,d1 ;reset d1
- move.l savea0,a0 ;reset a0
- lea work,a3
- move.l #0,(a3) ;clear out work area
- move.l #0,4(a3)
- move.l #0,8(a3)
- move.l #0,12(a3)
-
- btst d1,d0 ;get the first bit into the work area
- beq.s fc51
- move.b #$31,0(a3)
- bra.s fc52
- fc51: move.b #$30,0(a3)
- fc52: subq.l #1,d1
- move.l #1,d2 ;d2 = index into work area
- addq.w #1,d7 ;d7 = bitcount
- btst #0,d5 ;which color?
- bne ck0 ;smallest black code is 2 bits
-
- btst d1,d0 ;get next 2 bits into the work area
- beq.s fc53 ;smallest white code is 4 bits
- move.b #$31,1(a3)
- bra.s fc54
- fc53: move.b #$30,1(a3)
- fc54: subq.l #1,d1
- btst d1,d0
- beq.s fc55
- move.b #$31,2(a3)
- bra.s fc56
- fc55: move.b #$30,2(a3)
- fc56: subq.l #1,d1
- move.l #3,d2 ;d2 = index into work area
- addq.w #2,d7
-
- btst #1,d5 ;which table are we in? 0=makeup; 1=term
- bne.s fc57 ;
- lea wmindex,a4 ;
- bra ck0 ;
- fc57: lea wtindex,a4 ;
-
-
- ck0: btst d1,d0 ;get next bit into work area
- beq.s ck01
- move.b #$31,0(a3,d2)
- bra.s ck02
- ck01: move.b #$30,0(a3,d2)
- ck02: addq #1,d2 ;update work area index
-
- btst #0,d5 ;which color? 0=white; 1=black.
- bne ckbm
-
- move.l (a4),a2 ;temp
-
- ckw1: move.l (a2),d4 ;compare work area to code in table
- cmp.l (a3),d4 ;if not equal goto ckw2
- bne ckw3 ;temp - used to be ckw2
- move.l 4(a2),d4
- cmp.l 4(a3),d4
- bne ckw2
- move.l 8(a2),d4
- cmp.l 8(a3),d4
- bne ckw2
- move.l 12(a2),d4
- and.l #$ffffff00,d4
- cmp.l 12(a3),d4
- bne ckw2
-
- bra doit0 ;found a code! do something with it!
-
- ckw2: add.l #18,a2 ;get next table entry
- tst.b (a2) ;are we at end of table yet?
- bne.s ckw1 ;if not continue check
- move.l (a4),a2 ;reset a2
- subq.l #1,d1 ;get next bit into work area
- addq.w #1,d7 ;update bit counter
- cmp.w #13,d7 ;have we checked the max possible length?
- bcs ck0 ;if not get next bit
- bchg #1,d5 ;else switch tables
- beq fc5 ;if on first table branch back
-
- clr.l d6
- bra fc7 ;error - could not find code - out of sinc?
-
- ckw3: addq.l #4,a4 ;get next index pointer
- move.l (a4),a2 ;set a2 equal to it
- cmp.l #0,a2 ;is it the end of the index
- bne ckw1 ;if not branch
-
- bchg #1,d5 ;switch tables
- bne fc8 ;if term table exit (used to be: beq fc5)
-
- btst #1,d5 ;which table are we in? 0=makeup; 1=term
- bne.s ckw4 ;
- lea wmindex,a4 ;
- move.l (a4),a2 ;
- bra ckw1 ;
- ckw4: lea wtindex,a4 ;
- move.l (a4),a2 ;
- bra ckw1 ;
-
- ckbm: btst #1,d5 ;are we in the makeup codes or term. codes
- bne.s ckb0 ;0=makeup code table; 1=term code table.
- lea bmakeupcodes,a2 ;check work area against black makeup codes
- bra ckb1
- ckb0: lea btermcodes,a2
-
- ckb1: move.w (a2),d4 ;compare work area to code in table
- cmp.w (a3),d4 ;if not equal goto ckb2
- bne ckb3
- move.w 2(a2),d4
- cmp.w 2(a3),d4
- bne ckb2
- move.l 4(a2),d4
- cmp.l 4(a3),d4
- bne ckb2
- move.l 8(a2),d4
- cmp.l 8(a3),d4
- bne ckb2
- move.l 12(a2),d4
- and.l #$ffffff00,d4
- cmp.l 12(a3),d4
- bne ckb2
-
- bra doit0 ;found a code! do something with it!
-
- ckb2: add.l #18,a2 ;get next table entry
- tst.b (a2) ;are we at end of table yet?
- bne.s ckb1 ;if not continue check
- subq.l #1,d1 ;else get next bit into work area
- addq.w #1,d7
- cmp.w #13,d7
- bcs ck0
- bchg #1,d5 ;switch tables
- beq fc5 ;branch back if on first table
-
- clr.l d6 ;end this row
- bra fc7 ;error - could not find code in table - out of sinc?
-
- ckb3: btst #1,d5
- bne ckb2 ;if term table handle normally
-
- bset #1,d5 ;set it to the term table
- bra fc5
-
- doit0: bclr #3,d5 ;clear term. flag
- move.w 16(a2),d2 ;get run length (in pixels)
- move.w d2,pixcount ;save for updating the picture width
- move.w pixpos,d3 ;get current pixel position in amiga bitmap
- btst #1,d5 ;am i in here on a makeup or term code?
- bne doit1
-
- subq.w #8,d2 ;remove partial pixels
- lsr.w #5,d2 ;d2 = number of long words i need to move
- cmp.w #1,photom ;is it reversed?
- bne doit00 ;no
- cmp.b #0,15(a2) ;which color? 0=Black, 1=White
- bne doWl0
- bra doBl0
-
- doit00: cmp.b #0,15(a2) ;which color? 1=Black, 0=White
- beq doWl0
-
- doBl0: bclr d3,(a1)
- dbf d3,doBl0
- addq.l #1,a1
- bclr #2,d5 ;clear odd address flag
- move.l a1,d3
- btst #0,d3 ;are we on a word boundry (even address)?
- beq.s doBl2 ;yes!
-
- move.b #0,(a1)+ ;no - odd address
- bset #2,d5 ;set flag
- bra.s doBl2
-
- doBl1: move.l #0,(a1)+
- doBl2: dbf d2,doBl1
- move.w #0,(a1)+
- btst #2,d5 ;check odd address flag
- bne.s doBl22 ;yes we started on an odd address
- move.b #0,(a1)+
- doBl22: move.w #7,d3
- move.w pixpos,d4
- doBl3: bclr d3,(a1)
- subq.w #1,d3
- cmp.w d3,d4
- bcs.s doBl3
- bra fc6
-
- doWl0: bset d3,(a1) ;loop bits to next byte boundry
- dbf d3,doWl0
- addq.l #1,a1
- bclr #2,d5 ;clear flag odd address flag
- move.l a1,d3
- btst #0,d3 ;are we on a word boundry (even)?
- beq.s doWl2 ;yes!
-
- move.b #$ff,(a1)+ ;no, so make it that way
- bset #2,d5 ;set flag odd address flag
- bra.s doWl2
-
- doWl1: move.l #$ffffffff,(a1)+ ;white makeup codes
- doWl2: dbf d2,doWl1
- move.w #$ffff,(a1)+
- btst #2,d5
- bne.s doWl22
- move.b #$ff,(a1)+
- doWl22: move.w #7,d3
- move.w pixpos,d4
- doWl3: bset d3,(a1)
- subq.w #1,d3
- cmp.w d3,d4
- bcs.s doWl3
- bra fc6
-
- ;doWl0: add.w #1,d2
- ; lsl.w #2,d2 ;d2 = number of bytes
- ; add.w d2,a1 ;push ahead a1
- ; bra fc6
-
- doit1: bset #3,d5 ;set term. flag
- cmp.w #1,photom ;is it reversed?
- bne doit2 ;no
- tst.b 15(a2) ;which color? 0=Black, 1=White
- bne doWs2
- bra doBs2
-
- doit2: tst.b 15(a2) ;which color? 1=Black, 0=White
- beq doWs2
-
- bra doBs2 ;black bit loop
- doBs1: bclr d3,(a1)
- dbf d3,doBs2
- addq.l #1,a1
- move.w #7,d3
- doBs2: dbf d2,doBs1
- bra doit3
-
- doWs1: bset d3,(a1) ;white bit loop
- dbf d3,doWs2
- addq.l #1,a1
- move.w #7,d3
- doWs2: dbf d2,doWs1
-
- doit3: move.w d3,pixpos
- bchg #0,d5 ;switch colors
- bclr #1,d5 ;set table to makeup table for new color
-
- fc6: move.l #31,d2
- sub.l d1,d2 ;d2=31-d1
- lsr.l #3,d2 ;divide by 8
- add.l d2,a0 ;update memory pointer
- move.b (a0),temp ;reload memory into d0
- move.b 1(a0),temp+1
- move.b 2(a0),temp+2
- move.b 3(a0),temp+3
- move.l temp,d0
- lsl.l #3,d2 ;multiple by 8
- subq.l #1,d1
- add.l d2,d1 ;remap d1 to top of 4 byte input
-
- sub.w pixcount,d6
- btst #3,d5 ;was the last code a term or makeup?
- beq fc4 ;branch if a makeup code
-
- fc7: tst.w d6 ;have we done an entire row yet?
- bne fc4 ;if not branch?
-
- move.l picptr,a1 ;move a1 to the next row in the amiga bitmap
- add.w pic+pc_Width,a1
- move.l a1,picptr
-
- addq.l #1,rowcount ;temp - bump up the row counter
- addq.w #1,hcount ;temp - bump up height counter
- add.l #1,a0 ;temp - new rows start on a byte boundry
-
- fc8: move.w pic+pc_H,d0 ;temp - get the total height of the picture
- sub.w hcount,d0 ;temp - have we done the entire picture?
- beq fc9 ;temp - yes so exit
-
- move.l rps,d0 ;temp - have we done all the rows in this strip?
- sub.l rowcount,d0 ;temp
- bhi fc2 ;temp - (bhi = carry clear & zero clear)
- fc9: rts
-
-
- **********************************
- ** **
- **********************************
- _cpystr:
- move.l 4(sp),a0
- move.l 8(sp),d0
- add.l d0,a0
- subq.l #1,a0
- bset #1,flag
- cpystr:
- movem.l d1-d7/a1-a2,-(sp)
-
- cmp.w #3,predictor ;branch if predictor is greater than 2
- bcs cp0 ;known lzw pre-compression technique so cont.
-
- movem.l (sp)+,d1-d7/a1-a2 ;restore registers
- bra abortobj
-
- cp0: move.l apos2,a2 ;restore place in amiga bitmap - plane x
- move.l apos1,a1 ;restore place in amiga bitmap - plane 1
- move.l plnlen,d7 ;d7 = amiga bitplane length in bytes
- move.w bitcount,d5 ;restore bit place in a2
- move.w plncnt,d1 ;restore plane counter
- move.w pixcount,d6 ;restore pixel counter
- moveq.l #7,d3 ;d3 = bit position in tiff data
-
- cp1: cmp.w #2,predictor ;if horizontal diff. is used - data is normal
- beq.s norm
-
- cmp.w #1,photom
- bne.s norm
-
- btst d3,(a0) ;is the data bit on or off
- beq.s cp2 ;off
- bclr d5,(a2)
- bra.s cp4
- cp2: bset d5,(a2)
- bra.s cp4
-
- norm: btst d3,(a0) ;is the data bit on or off
- beq.s cp3 ;off
- bset d5,(a2)
- bra.s cp4
- cp3: bclr d5,(a2)
-
- cp4: sub.l d7,a2 ;go to next bitplane
- addq.w #1,d1 ;update bitplane counter
-
- cmp.w pic+pc_BitPln,d1
- bcs cp7
-
- moveq.l #0,d1 ;reset bitplane counter
- move.l a1,a2 ;reset a2 to last bitplane
-
- cp5: dbf d5,cp6 ;update amiga bit pos
- addq.l #1,a1 ;move to next amiga bitmap byte
- addq.l #1,a2
- moveq.l #7,d5 ;reset d5 to top of byte
-
- cp6: dbf d6,cp7 ;update pixel width counter
-
- move.l picptr2,a1
- add.w pic+pc_Width,a1
- move.l a1,picptr2
- move.l a1,a2
- move.w #7,d5
- move.w pic+pc_W,d6
- subq.w #1,d6
- subq.w #1,hcount
- beq cp81
- subq.l #1,rowcount
- beq cp81
-
- cmp.w #1,pic+pc_BitPln ;is it b&w?
- beq cp70 ;yes
-
- cmp.w #1,compression ;is it compressed data?
- beq cp70 ;no
-
- cp7: dbf d3,cp1 ;update tiff bit counter
-
- cp70: moveq.l #7,d3 ;reset tiff data bit counter
- btst #0,flag ;check copy flag
- bne.s cp8 ;0=increment from address, 1=no increment
-
- btst #1,flag
- bne.s cp71
- addq.l #1,a0 ;move to next byte
- bra.s cp8
- cp71: subq.l #1,a0 ;move to prev byte
-
- cp8: subq.l #1,d0 ;decrement data byte count
- bne cp1
-
- cp81: move.l a2,apos2 ;save place in amiga bitmap - plane x
- move.l a1,apos1 ;save place in amiga bitmap - plane 1
- move.w d5,bitcount ;save bit place in a2
- move.w d1,plncnt ;save plane counter
- move.w d6,pixcount ;save pixel counter
-
- movem.l (sp)+,d1-d7/a1-a2
- rts
-
- **********************************
- ** **
- **********************************
- horidif2:
- move.l picptrsave2,a1 ;a1 = base address in last bit plane
- move.l a1,picptr2 ;get starting address of row
- move.l a1,a2 ;a2 = address in bitmap row
- move.w pic+pc_W,d0 ;d0 = horizontal pixel counter
- move.w #7,d5 ;d5 = bit counter into bit map
-
- move.w pic+pc_Width,d1
- mulu pic+pc_H,d1 ;d1 = length of amiga bitmap
-
- move.w pic+pc_W,d0 ;d0 = horizontal pixel counter
- subq.w #1,d0
- move.w pic+pc_H,d2 ;d2 = vertical row counter
- move.l #0,lastval ;zero the last pixel value
- bra ho5
-
- ho0: clr.l d3 ;d3 = value of pixel
- move.w pic+pc_BitPln,d6 ;d6 = bit plane counter
- subq.w #1,d6
- move.w d6,d4 ;d4 = bit position in d3
- move.l a1,a2 ;reset a2 to first bitplane
-
- ho1: btst d5,(a2) ;get the pixel's value into d3
- beq ho2
- bset d4,d3
- bra ho3
- ho2: bclr d4,d3
- ho3: subq.w #1,d4 ;sub 1 from the d3 bit postion counter
- sub.l d1,a2 ;move a2 to next amiga bitplane
- dbf d6,ho1 ;decrement amiga bitplane counter
-
- move.l d3,temp
- move.b temp+3,d3
- add.b d3,lastval+3
- move.b temp+2,d3
- add.b d3,lastval+2
- move.b temp+1,d3
- add.b d3,lastval+1
- move.l lastval,d3
-
- cmp.w #1,photom ;is the image reversed?
- bne ho30 ;no
- not.l d3
-
- ho30: move.w pic+pc_BitPln,d4
- subq.w #1,d4
- move.l a1,a2
-
- ho31: btst d4,d3
- beq ho32
- bset d5,(a2)
- bra ho33
- ho32: bclr d5,(a2)
-
- ho33: sub.l d1,a2
- dbf d4,ho31
-
- ho4: dbf d5,ho41
-
- add.l #1,a1 ;move to next byte
- move.w #7,d5 ;reset bit counter
-
- ho41: dbf d0,ho0 ;decrement horizontal counter
-
- move.l picptr2,a1
- add.w pic+pc_Width,a1
- move.l a1,picptr2
- move.w pic+pc_W,d0 ;reset d0 to width in pixels
- subq.w #1,d0
- move.w #7,d5 ;reset bit counter
- move.l #0,lastval ;reset last pixel value to zero
-
- ho5: dbf d2,ho0 ;decrement row counter
- rts
-
-
- ***********************************
- *** ***
- ***********************************
- pbrgb: move.l rps,rowcount
- move.l striplength,d2
- addq.l #2,d2
- tst.l sbc
- beq pb2
- subq.l #2,d2
-
- pb2: tst.w hcount
- beq pb12
- tst.l rowcount
- beq pb12
-
- clr.l d0
- move.b (a0)+,d0 ;d0 = one byte code
- tst.l sbc
- beq pb3
-
- subq.l #1,d2
- beq pb12
- bmi pb11
-
- pb3: cmp.b #128,d0
- beq.s pb2 ;code 128 = do nothing, so get next byte
-
- btst #7,d0 ;check the high bit
- beq.s pb5 ;if 0 copy the next d0+1 bytes as is
-
- neg.b d0 ;else copy the next byte -d0+1 times
- add.b #1,d0
- clr.l d3
- move.b d0,d3
- bset #0,flag ;set the copy flag (1=don't inc ptr in a0)
- bsr cpystr ;copy the byte (a0) into bitmap (a1)
- addq.l #1,a0 ;move to next code
- tst.l sbc
- beq sb4
- moveq.l #1,d3 ;subtract 1 from the striplength
- sb4: sub.l d3,d2
- beq pb12
- bmi pb11
- bra pb2
-
- pb5: bclr #0,flag ;clear the copy flag (0=inc the ptr in a0)
- clr.l d3
- add.b #1,d0
- move.b d0,d3 ;save for later
- bsr cpystr
- sub.l d3,d2
- beq pb12
- bmi pb11
- bra pb2
-
- pb11:
- pb12: rts
-
-
- ***********************************
- *** ***
- ***********************************
- get_colormap:
- movem.l d0-d6/a0-a2,-(sp)
- move.l palptr,a0 ;a0 = start of amiga palette
- move.l palcount,d0 ;d0 = number of entries
- divu #3,d0 ;d0 = number of colors (rgb)
-
- move.l cmapoffset,d1
- move.l picture,a1
- move.l (a1),a1
- add.l d1,a1 ;a1 = start of colormap data in tiff
-
- move.w d0,d2
- lsl.w #1,d2 ;d2 = length of each color's data
- bra gc4
-
- gc0: move.l a1,a2
-
- bsr getcword ;get color word in d4
- move.w d4,(a0) ;red
- add.w d2,a2
- bsr getcword
- move.w d4,2(a0) ;green
- add.w d2,a2
- bsr getcword
- move.w d4,4(a0) ;blue
-
- move.w (a0)+,d4
- move.w (a0)+,d5
- move.w (a0)+,d6
- mulu #19661,d4
- mulu #38666,d5
- mulu #7209,d6
- add.l d5,d4
- add.l d6,d4
- swap d4
- cmp.w #$8000,d4
- bcc gc1
- moveq #1,d4
- bra gc2
- gc1: moveq #0,d4
- gc2: move.w d4,(a0)+ ;screen color
- addq.l #2,a1 ;move to next color word
-
- gc4: dbf d0,gc0
- movem.l (sp)+,d0-d6/a0-a2
- rts ;when done with all colors - exit
-
- ***********************************
- *** ***
- ***********************************
- getcword:
-
- gt1: tst.b byteorder
- bne gt2
-
- move.w (a2),d4 ;Motorola format
- bra gt3
-
- gt2: move.b (a2),temp+1 ;Intel format
- move.b (a2),temp
- move.w temp,d4
-
- gt3: rts
-
-
- ***********************************
- *** ***
- ***********************************
- getdata:
- cmp.w #TypeBYTE,tagtype
- bne getd1
- move.l picture,a0
- move.l (a0),a0
- add.l tagvalue,a0
- clr.l d0
- move.b (a0),d0
- addq.l #1,tagvalue
- rts
-
- getd1: cmp.w #TypeSHORT,tagtype
- bne getd2
- move.l picture,a0
- move.l (a0),a0
- add.l tagvalue,a0
- tst.b byteorder
- bne getd10
- move.b (a0)+,temp
- move.b (a0),temp+1
- bra getd11
- getd10: move.b (a0)+,temp+1
- move.b (a0),temp
- getd11: clr.l d0
- move.w temp,d0
- addq.l #2,tagvalue
- rts
-
- getd2: cmp.w #TypeLONG,tagtype
- bne getd3
- move.l picture,a0
- move.l (a0),a0
- add.l tagvalue,a0
- tst.b byteorder
- bne getd20
- move.b (a0)+,temp
- move.b (a0)+,temp+1
- move.b (a0)+,temp+2
- move.b (a0),temp+3
- bra getd21
- getd20: move.b (a0)+,temp+3
- move.b (a0)+,temp+2
- move.b (a0)+,temp+1
- move.b (a0),temp
- getd21: move.l temp,d0
- addq.l #4,tagvalue
- rts
-
- getd3: cmp.w #TypeRATIONAL,tagtype
- bne rrts
- move.l picture,a0
- move.l (a0),a0
- add.l tagvalue,a0
- tst.b byteorder
- bne getd30
- move.b (a0)+,temp
- move.b (a0)+,temp+1
- move.b (a0)+,temp+2
- move.b (a0)+,temp+3
- move.b (a0)+,temp2
- move.b (a0)+,temp2+1
- move.b (a0)+,temp2+2
- move.b (a0),temp2+3
- bra getd31
- getd30: move.b (a0)+,temp+3
- move.b (a0)+,temp+2
- move.b (a0)+,temp+1
- move.b (a0)+,temp
- move.b (a0)+,temp2+3
- move.b (a0)+,temp2+2
- move.b (a0)+,temp2+1
- move.b (a0),temp2
- getd31: move.l temp,d0
- move.l temp2,d1
- divu d1,d0
- addq.l #8,tagvalue
- rts
-
-
- **********************************
- ** **
- **********************************
- pgetl: move.l picture,a0
- move.l (a0),a0
- add.l picoffset,a0
- tst.b byteorder
- bne pgetl1
- move.b (a0)+,temp
- move.b (a0)+,temp+1
- move.b (a0)+,temp+2
- move.b (a0),temp+3
- bra pgetl2
- pgetl1: move.b (a0)+,temp+3
- move.b (a0)+,temp+2
- move.b (a0)+,temp+1
- move.b (a0),temp
- pgetl2: move.l temp,d0
- addq.l #4,picoffset
- rts
-
- pgetw: move.l picture,a0
- move.l (a0),a0
- add.l picoffset,a0
- tst.b byteorder
- bne pgetw1
- move.b (a0)+,temp
- move.b (a0),temp+1
- bra pgetw2
- pgetw1: move.b (a0)+,temp+1
- move.b (a0),temp
- pgetw2: move.w temp,d0
- addq.l #2,picoffset
- rts
-
- pget: move.l picture,a0
- move.l (a0),a0
- add.l picoffset,a0
- move.b (a0),d0
- addq.l #1,picoffset
- rts
-
-
- ***********************************
- *** ***
- ***********************************
- errrts: bsr purgepic
- move.l savesp,sp
- rrts: rts
-
-
- ***********************************
- *** ***
- ***********************************
- purgepic:
- tst.l picture
- beq pu1
- move.l picture,a0
- move.l table,a1
- move.l m_delete(a1),a1
- jsr (a1)
-
- pu1: tst.l prefix
- beq pu2
- move.l prefix,a0
- move.l table,a1
- move.l m_delete(a1),a1
- jsr (a1)
-
- pu2: tst.l suffix
- beq pu3
- move.l suffix,a0
- move.l table,a1
- move.l m_delete(a1),a1
- jsr (a1)
-
- pu3: tst.l outcode
- beq pu4
- move.l outcode,a0
- move.l table,a1
- move.l m_delete(a1),a1
- jsr (a1)
-
- pu4: rts
-
-
- ***********************************
- *** ***
- ***********************************
- Mulu1632:
- move.l table,a0
- move.l mulu1632(a0),a0
- jmp (a0)
-
- ***********************************
- *** ***
- ***********************************
- Divu1648:
- move.l table,a0
- move.l divu1648(a0),a0
- jmp (a0)
-
- *******************************************************************
- *** called when the import routine choosen finds something ***
- *** wrong with the file loaded. ***
- *******************************************************************
- notcorrect:
- rts
-
- never: moveq #0,d0
- rts
-
- maybe: moveq #1,d0
- rts
-
- correct:
- moveq #2,d0
- rts
-
-
- *******************************************
- *** ***
- *******************************************
- SECTION ibmeps,DATA,PUBLIC
-
- taglist2:
- dc.w $0111
- dc.l tag_stripoffset
- dc.w $8000 ;used by aldus pagemaker
- dc.l tag_stripoffset
- dc.w $0140
- dc.l get_colormap
- dc.w 0
-
- taglist:
- dc.w $0102
- dc.l tag_bsample
- dc.w $0140
- dc.l tag_colormap
- dc.w $012d
- dc.l tag_crcurves
- dc.w $0103
- dc.l tag_compression
- dc.w $0123
- dc.l tag_grcurve
- dc.w $0122
- dc.l tag_grunit
- dc.w $0101
- dc.l tag_iheight
- dc.w $0100
- dc.l tag_iwidth
- dc.w $00fe
- dc.l tag_newsftype
- dc.w $0106
- dc.l tag_photometric
- dc.w $011c
- dc.l tag_planar
- dc.w $013d
- dc.l tag_predictor
- dc.w $0128
- dc.l tag_resolution
- dc.w $0116
- dc.l tag_rpstrip
- dc.w $0115
- dc.l tag_sppixel
- dc.w $0117
- dc.l tag_stripbytecnt
- dc.w $011a
- dc.l tag_xres
- dc.w $011b
- dc.l tag_yres
- dc.w 0
-
- wtindex:
- dc.l wt1,wt2,wt3,wt4,wt5,wt6,wt7,wt8,wt9,wt10
- dc.l wt11,wt12,wt13,wt14,wt15,0
-
- wmindex:
- dc.l wm1,wm2,wm3,wm4,wm5,wm6,wm7,0
-
-
- wtermcodes: ;OPTOMIZED!
-
- wt1: dc.b "00000010",0,0,0,0,0,0,0
- dc.b 1
- dc.w 29
-
- dc.b "00000011",0,0,0,0,0,0,0
- dc.b 1
- dc.w 30
-
- dc.b "00000100",0,0,0,0,0,0,0
- dc.b 1
- dc.w 45
-
- dc.b "00000101",0,0,0,0,0,0,0
- dc.b 1
- dc.w 46
-
- dc.b "0000011",0,0,0,0,0,0,0,0
- dc.b 1
- dc.w 22
-
- dc.b "0000100",0,0,0,0,0,0,0,0
- dc.b 1
- dc.w 23
-
- dc.b "00001010",0,0,0,0,0,0,0
- dc.b 1
- dc.w 47
-
- dc.b "00001011",0,0,0,0,0,0,0
- dc.b 1
- dc.w 48
-
- dc.b "000011",0,0,0,0,0,0,0,0,0
- dc.b 1
- dc.w 13
-
- dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
- dc.b 0
- dc.w 0
-
- wt2: dc.b "0001000",0,0,0,0,0,0,0,0
- dc.b 1
- dc.w 20
-
- dc.b "00010010",0,0,0,0,0,0,0
- dc.b 1
- dc.w 33
-
- dc.b "00010011",0,0,0,0,0,0,0
- dc.b 1
- dc.w 34
-
- dc.b "00010100",0,0,0,0,0,0,0
- dc.b 1
- dc.w 35
-
- dc.b "00010101",0,0,0,0,0,0,0
- dc.b 1
- dc.w 36
-
- dc.b "00010110",0,0,0,0,0,0,0
- dc.b 1
- dc.w 37
-
- dc.b "00010111",0,0,0,0,0,0,0
- dc.b 1
- dc.w 38
-
- dc.b "0001100",0,0,0,0,0,0,0,0
- dc.b 1
- dc.w 19
-
- dc.b "00011010",0,0,0,0,0,0,0
- dc.b 1
- dc.w 31
-
- dc.b "00011011",0,0,0,0,0,0,0
- dc.b 1
- dc.w 32
-
- dc.b "000111",0,0,0,0,0,0,0,0,0
- dc.b 1
- dc.w 1
-
- dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
- dc.b 0
- dc.w 0
-
- wt3: dc.b "001000",0,0,0,0,0,0,0,0,0
- dc.b 1
- dc.w 12
-
- dc.b "00100100",0,0,0,0,0,0,0
- dc.b 1
- dc.w 53
-
- dc.b "00100101",0,0,0,0,0,0,0
- dc.b 1
- dc.w 54
-
- dc.b "0010011",0,0,0,0,0,0,0,0
- dc.b 1
- dc.w 26
-
- dc.b "00101000",0,0,0,0,0,0,0
- dc.b 1
- dc.w 39
-
- dc.b "00101001",0,0,0,0,0,0,0
- dc.b 1
- dc.w 40
-
- dc.b "00101010",0,0,0,0,0,0,0
- dc.b 1
- dc.w 41
-
- dc.b "00101011",0,0,0,0,0,0,0
- dc.b 1
- dc.w 42
-
- dc.b "00101100",0,0,0,0,0,0,0
- dc.b 1
- dc.w 43
-
- dc.b "00101101",0,0,0,0,0,0,0
- dc.b 1
- dc.w 44
-
- dc.b "0010111",0,0,0,0,0,0,0,0
- dc.b 1
- dc.w 21
-
- dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
- dc.b 0
- dc.w 0
-
- wt4: dc.b "0011000",0,0,0,0,0,0,0,0
- dc.b 1
- dc.w 28
-
- dc.b "00110010",0,0,0,0,0,0,0
- dc.b 1
- dc.w 61
-
- dc.b "00110011",0,0,0,0,0,0,0
- dc.b 1
- dc.w 62
-
- dc.b "00110100",0,0,0,0,0,0,0
- dc.b 1
- dc.w 63
-
- dc.b "00110101",0,0,0,0,0,0,0 ;code string null terminated
- dc.b 1 ;color: 1=White, 0=Black
- dc.w 0 ;run length
-
- dc.b "00111",0,0,0,0,0,0,0,0,0,0
- dc.b 1
- dc.w 10
-
- dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
- dc.b 0
- dc.w 0
-
- wt5: dc.b "01000",0,0,0,0,0,0,0,0,0,0
- dc.b 1
- dc.w 11
-
- dc.b "0100100",0,0,0,0,0,0,0,0
- dc.b 1
- dc.w 27
-
- dc.b "01001010",0,0,0,0,0,0,0
- dc.b 1
- dc.w 59
-
- dc.b "01001011",0,0,0,0,0,0,0
- dc.b 1
- dc.w 60
-
- dc.b "0100111",0,0,0,0,0,0,0,0
- dc.b 1
- dc.w 18
-
- dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
- dc.b 0
- dc.w 0
-
- wt6: dc.b "0101000",0,0,0,0,0,0,0,0
- dc.b 1
- dc.w 24
-
- dc.b "01010010",0,0,0,0,0,0,0
- dc.b 1
- dc.w 49
-
- dc.b "01010011",0,0,0,0,0,0,0
- dc.b 1
- dc.w 50
-
- dc.b "01010100",0,0,0,0,0,0,0
- dc.b 1
- dc.w 51
-
- dc.b "01010101",0,0,0,0,0,0,0
- dc.b 1
- dc.w 52
-
- dc.b "0101011",0,0,0,0,0,0,0,0
- dc.b 1
- dc.w 25
-
- dc.b "01011000",0,0,0,0,0,0,0
- dc.b 1
- dc.w 55
-
- dc.b "01011001",0,0,0,0,0,0,0
- dc.b 1
- dc.w 56
-
- dc.b "01011010",0,0,0,0,0,0,0
- dc.b 1
- dc.w 57
-
- dc.b "01011011",0,0,0,0,0,0,0
- dc.b 1
- dc.w 58
-
- dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
- dc.b 0
- dc.w 0
-
- wt7: dc.b "0111",0,0,0,0,0,0,0,0,0,0,0
- dc.b 1
- dc.w 2
-
- dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
- dc.b 0
- dc.w 0
-
- wt8: dc.b "1000",0,0,0,0,0,0,0,0,0,0,0
- dc.b 1
- dc.w 3
-
- dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
- dc.b 0
- dc.w 0
-
- wt9: dc.b "10011",0,0,0,0,0,0,0,0,0,0
- dc.b 1
- dc.w 8
-
- dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
- dc.b 0
- dc.w 0
-
- wt10: dc.b "10100",0,0,0,0,0,0,0,0,0,0
- dc.b 1
- dc.w 9
-
- dc.b "101010",0,0,0,0,0,0,0,0,0
- dc.b 1
- dc.w 16
-
- dc.b "101011",0,0,0,0,0,0,0,0,0
- dc.b 1
- dc.w 17
-
- dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
- dc.b 0
- dc.w 0
-
- wt11: dc.b "1011",0,0,0,0,0,0,0,0,0,0,0
- dc.b 1
- dc.w 4
-
- dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
- dc.b 0
- dc.w 0
-
- wt12: dc.b "1100",0,0,0,0,0,0,0,0,0,0,0
- dc.b 1
- dc.w 5
-
- dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
- dc.b 0
- dc.w 0
-
- wt13: dc.b "110100",0,0,0,0,0,0,0,0,0
- dc.b 1
- dc.w 14
-
- dc.b "110101",0,0,0,0,0,0,0,0,0
- dc.b 1
- dc.w 15
-
- dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
- dc.b 0
- dc.w 0
-
- wt14: dc.b "1110",0,0,0,0,0,0,0,0,0,0,0
- dc.b 1
- dc.w 6
-
- dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
- dc.b 0
- dc.w 0
-
- wt15: dc.b "1111",0,0,0,0,0,0,0,0,0,0,0
- dc.b 1
- dc.w 7
-
- dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
- dc.b 0
- dc.w 0
-
- wmakeupcodes: ;OPTOMIZED!
-
- wm1: ;dc.b "000000000001",0,0,0
- ;dc.b 1
- ;dc.w 0 ;EOL
-
- dc.b "00000001000",0,0,0,0
- dc.b 1
- dc.w 1792
-
- dc.b "000000010010",0,0,0
- dc.b 1
- dc.w 1984
-
- dc.b "000000010011",0,0,0
- dc.b 1
- dc.w 2048
-
- dc.b "000000010100",0,0,0
- dc.b 1
- dc.w 2112
-
- dc.b "000000010101",0,0,0
- dc.b 1
- dc.w 2176
-
- dc.b "000000010110",0,0,0
- dc.b 1
- dc.w 2240
-
- dc.b "000000010111",0,0,0
- dc.b 1
- dc.w 2304
-
- dc.b "00000001100",0,0,0,0
- dc.b 1
- dc.w 1856
-
- dc.b "00000001101",0,0,0,0
- dc.b 1
- dc.w 1920
-
- dc.b "000000011100",0,0,0
- dc.b 1
- dc.w 2368
-
- dc.b "000000011101",0,0,0
- dc.b 1
- dc.w 2432
-
- dc.b "000000011110",0,0,0
- dc.b 1
- dc.w 2496
-
- dc.b "000000011111",0,0,0
- dc.b 1
- dc.w 2560
-
- dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
- dc.b 0
- dc.w 0
-
- wm2: dc.b "00110110",0,0,0,0,0,0,0
- dc.b 1
- dc.w 320
-
- dc.b "00110111",0,0,0,0,0,0,0
- dc.b 1
- dc.w 384
-
- dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
- dc.b 0
- dc.w 0
-
- wm3: dc.b "010011000",0,0,0,0,0,0
- dc.b 1
- dc.w 1472
-
- dc.b "010011001",0,0,0,0,0,0
- dc.b 1
- dc.w 1536
-
- dc.b "010011010",0,0,0,0,0,0
- dc.b 1
- dc.w 1600
-
- dc.b "010011011",0,0,0,0,0,0
- dc.b 1
- dc.w 1728
-
- dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
- dc.b 0
- dc.w 0
-
- wm4: dc.b "010111",0,0,0,0,0,0,0,0,0
- dc.b 1
- dc.w 192
-
- dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
- dc.b 0
- dc.w 0
-
- wm5: dc.b "01100100",0,0,0,0,0,0,0
- dc.b 1
- dc.w 448
-
- dc.b "01100101",0,0,0,0,0,0,0
- dc.b 1
- dc.w 512
-
- dc.b "011001100",0,0,0,0,0,0
- dc.b 1
- dc.w 704
-
- dc.b "011001101",0,0,0,0,0,0
- dc.b 1
- dc.w 768
-
- dc.b "01100111",0,0,0,0,0,0,0
- dc.b 1
- dc.w 640
-
- dc.b "01101000",0,0,0,0,0,0,0
- dc.b 1
- dc.w 576
-
- dc.b "011010010",0,0,0,0,0,0
- dc.b 1
- dc.w 832
-
- dc.b "011010011",0,0,0,0,0,0
- dc.b 1
- dc.w 896
-
- dc.b "011010100",0,0,0,0,0,0
- dc.b 1
- dc.w 960
-
- dc.b "011010101",0,0,0,0,0,0
- dc.b 1
- dc.w 1024
-
- dc.b "011010110",0,0,0,0,0,0
- dc.b 1
- dc.w 1088
-
- dc.b "011010111",0,0,0,0,0,0
- dc.b 1
- dc.w 1152
-
- dc.b "011011000",0,0,0,0,0,0
- dc.b 1
- dc.w 1216
-
- dc.b "011011001",0,0,0,0,0,0
- dc.b 1
- dc.w 1280
-
- dc.b "011011010",0,0,0,0,0,0
- dc.b 1
- dc.w 1344
-
- dc.b "011011011",0,0,0,0,0,0
- dc.b 1
- dc.w 1408
-
- dc.b "0110111",0,0,0,0,0,0,0,0
- dc.b 1
- dc.w 256
-
- dc.b "011000",0,0,0,0,0,0,0,0,0
- dc.b 1
- dc.w 1664
-
- dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
- dc.b 0
- dc.w 0
-
- wm6: dc.b "10010",0,0,0,0,0,0,0,0,0,0
- dc.b 1
- dc.w 128
-
- dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
- dc.b 0
- dc.w 0
-
- wm7: dc.b "11011",0,0,0,0,0,0,0,0,0,0
- dc.b 1
- dc.w 64
-
- dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
- dc.b 1
- dc.w 0
-
-
- btermcodes: ;OPTOMIZED!
-
- dc.b "11",0,0,0,0,0,0,0,0,0,0,0,0,0
- dc.b 0
- dc.w 2
-
- dc.b "10",0,0,0,0,0,0,0,0,0,0,0,0,0
- dc.b 0
- dc.w 3
-
- dc.b "010",0,0,0,0,0,0,0,0,0,0,0,0
- dc.b 0
- dc.w 1
-
- dc.b "011",0,0,0,0,0,0,0,0,0,0,0,0
- dc.b 0
- dc.w 4
-
- dc.b "0011",0,0,0,0,0,0,0,0,0,0,0
- dc.b 0
- dc.w 5
-
- dc.b "0010",0,0,0,0,0,0,0,0,0,0,0
- dc.b 0
- dc.w 6
-
- dc.b "00011",0,0,0,0,0,0,0,0,0,0
- dc.b 0
- dc.w 7
-
- dc.b "000101",0,0,0,0,0,0,0,0,0
- dc.b 0
- dc.w 8
-
- dc.b "000100",0,0,0,0,0,0,0,0,0
- dc.b 0
- dc.w 9
-
- dc.b "0000100",0,0,0,0,0,0,0,0
- dc.b 0
- dc.w 10
-
- dc.b "0000101",0,0,0,0,0,0,0,0
- dc.b 0
- dc.w 11
-
- dc.b "0000111",0,0,0,0,0,0,0,0
- dc.b 0
- dc.w 12
-
- dc.b "00000100",0,0,0,0,0,0,0
- dc.b 0
- dc.w 13
-
- dc.b "00000111",0,0,0,0,0,0,0
- dc.b 0
- dc.w 14
-
- dc.b "000011000",0,0,0,0,0,0
- dc.b 0
- dc.w 15
-
- dc.b "0000010111",0,0,0,0,0
- dc.b 0
- dc.w 16
-
- dc.b "0000110111",0,0,0,0,0
- dc.b 0
- dc.w 0
-
- dc.b "0000011000",0,0,0,0,0
- dc.b 0
- dc.w 17
-
- dc.b "0000001000",0,0,0,0,0
- dc.b 0
- dc.w 18
-
- dc.b "00001100111",0,0,0,0
- dc.b 0
- dc.w 19
-
- dc.b "00001101000",0,0,0,0
- dc.b 0
- dc.w 20
-
- dc.b "00001101100",0,0,0,0
- dc.b 0
- dc.w 21
-
- dc.b "00000110111",0,0,0,0
- dc.b 0
- dc.w 22
-
- dc.b "00000101000",0,0,0,0
- dc.b 0
- dc.w 23
-
- dc.b "00000010111",0,0,0,0
- dc.b 0
- dc.w 24
-
- dc.b "00000011000",0,0,0,0
- dc.b 0
- dc.w 25
-
- dc.b "000011001010",0,0,0
- dc.b 0
- dc.w 26
-
- dc.b "000011001011",0,0,0
- dc.b 0
- dc.w 27
-
- dc.b "000011001100",0,0,0
- dc.b 0
- dc.w 28
-
- dc.b "000011001101",0,0,0
- dc.b 0
- dc.w 29
-
- dc.b "000001101000",0,0,0
- dc.b 0
- dc.w 30
-
- dc.b "000001101001",0,0,0
- dc.b 0
- dc.w 31
-
- dc.b "000001101010",0,0,0
- dc.b 0
- dc.w 32
-
- dc.b "000001101011",0,0,0
- dc.b 0
- dc.w 33
-
- dc.b "000011010010",0,0,0
- dc.b 0
- dc.w 34
-
- dc.b "000011010011",0,0,0
- dc.b 0
- dc.w 35
-
- dc.b "000011010100",0,0,0
- dc.b 0
- dc.w 36
-
- dc.b "000011010101",0,0,0
- dc.b 0
- dc.w 37
-
- dc.b "000011010110",0,0,0
- dc.b 0
- dc.w 38
-
- dc.b "000011010111",0,0,0
- dc.b 0
- dc.w 39
-
- dc.b "000001101100",0,0,0
- dc.b 0
- dc.w 40
-
- dc.b "000001101101",0,0,0
- dc.b 0
- dc.w 41
-
- dc.b "000011011010",0,0,0
- dc.b 0
- dc.w 42
-
- dc.b "000011011011",0,0,0
- dc.b 0
- dc.w 43
-
- dc.b "000001010100",0,0,0
- dc.b 0
- dc.w 44
-
- dc.b "000001010101",0,0,0
- dc.b 0
- dc.w 45
-
- dc.b "000001010110",0,0,0
- dc.b 0
- dc.w 46
-
- dc.b "000001010111",0,0,0
- dc.b 0
- dc.w 47
-
- dc.b "000001100100",0,0,0
- dc.b 0
- dc.w 48
-
- dc.b "000001100101",0,0,0
- dc.b 0
- dc.w 49
-
- dc.b "000001010010",0,0,0
- dc.b 0
- dc.w 50
-
- dc.b "000001010011",0,0,0
- dc.b 0
- dc.w 51
-
- dc.b "000000100100",0,0,0
- dc.b 0
- dc.w 52
-
- dc.b "000000110111",0,0,0
- dc.b 0
- dc.w 53
-
- dc.b "000000111000",0,0,0
- dc.b 0
- dc.w 54
-
- dc.b "000000100111",0,0,0
- dc.b 0
- dc.w 55
-
- dc.b "000000101000",0,0,0
- dc.b 0
- dc.w 56
-
- dc.b "000001011000",0,0,0
- dc.b 0
- dc.w 57
-
- dc.b "000001011001",0,0,0
- dc.b 0
- dc.w 58
-
- dc.b "000000101011",0,0,0
- dc.b 0
- dc.w 59
-
- dc.b "000000101100",0,0,0
- dc.b 0
- dc.w 60
-
- dc.b "000001011010",0,0,0
- dc.b 0
- dc.w 61
-
- dc.b "000001100110",0,0,0
- dc.b 0
- dc.w 62
-
- dc.b "000001100111",0,0,0
- dc.b 0
- dc.w 63
-
- dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
- dc.b 0
- dc.w 0
-
- bmakeupcodes:
-
- dc.b "0000001111",0,0,0,0,0
- dc.b 0
- dc.w 64
-
- dc.b "000011001000",0,0,0
- dc.b 0
- dc.w 128
-
- dc.b "000011001001",0,0,0
- dc.b 0
- dc.w 192
-
- dc.b "000001011011",0,0,0
- dc.b 0
- dc.w 256
-
- dc.b "000000110011",0,0,0
- dc.b 0
- dc.w 320
-
- dc.b "000000110100",0,0,0
- dc.b 0
- dc.w 384
-
- dc.b "000000110101",0,0,0
- dc.b 0
- dc.w 448
-
- dc.b "0000001101100",0,0
- dc.b 0
- dc.w 512
-
- dc.b "0000001101101",0,0
- dc.b 0
- dc.w 576
-
- dc.b "0000001001010",0,0
- dc.b 0
- dc.w 640
-
- dc.b "0000001001011",0,0
- dc.b 0
- dc.w 704
-
- dc.b "0000001001100",0,0
- dc.b 0
- dc.w 768
-
- dc.b "0000001001101",0,0
- dc.b 0
- dc.w 832
-
- dc.b "0000001110010",0,0
- dc.b 0
- dc.w 896
-
- dc.b "0000001110011",0,0
- dc.b 0
- dc.w 960
-
- dc.b "0000001110100",0,0
- dc.b 0
- dc.w 1024
-
- dc.b "0000001110101",0,0
- dc.b 0
- dc.w 1088
-
- dc.b "0000001110110",0,0
- dc.b 0
- dc.w 1152
-
- dc.b "0000001110111",0,0
- dc.b 0
- dc.w 1216
-
- dc.b "0000001010010",0,0
- dc.b 0
- dc.w 1280
-
- dc.b "0000001010011",0,0
- dc.b 0
- dc.w 1344
-
- dc.b "0000001010100",0,0
- dc.b 0
- dc.w 1408
-
- dc.b "0000001010101",0,0
- dc.b 0
- dc.w 1472
-
- dc.b "0000001011010",0,0
- dc.b 0
- dc.w 1536
-
- dc.b "0000001011011",0,0
- dc.b 0
- dc.w 1600
-
- dc.b "0000001100100",0,0
- dc.b 0
- dc.w 1664
-
- dc.b "0000001100101",0,0
- dc.b 0
- dc.w 1728
-
- dc.b "00000001000",0,0,0,0
- dc.b 0
- dc.w 1792
-
- dc.b "00000001100",0,0,0,0
- dc.b 0
- dc.w 1856
-
- dc.b "00000001101",0,0,0,0
- dc.b 0
- dc.w 1920
-
- dc.b "000000010010",0,0,0
- dc.b 0
- dc.w 1984
-
- dc.b "000000010011",0,0,0
- dc.b 0
- dc.w 2048
-
- dc.b "000000010100",0,0,0
- dc.b 0
- dc.w 2112
-
- dc.b "000000010101",0,0,0
- dc.b 0
- dc.w 2176
-
- dc.b "000000010110",0,0,0
- dc.b 0
- dc.w 2240
-
- dc.b "000000010111",0,0,0
- dc.b 0
- dc.w 2304
-
- dc.b "000000011100",0,0,0
- dc.b 0
- dc.w 2368
-
- dc.b "000000011101",0,0,0
- dc.b 0
- dc.w 2432
-
- dc.b "000000011110",0,0,0
- dc.b 0
- dc.w 2496
-
- dc.b "000000011111",0,0,0
- dc.b 0
- dc.w 2560
-
- dc.b "000000000001",0,0,0
- dc.b 0
- dc.w 0 ;EOL
-
- dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
- dc.b 0
- dc.w 0
-
-
- dumcd: dc.w 0
- dc.l 0
- dc.l 1
- dumstr: dc.b 0,0
-
- dumptr: dc.l dumcd
-
-
- dumcd2: dc.w 0
- dc.l 0
- dc.l 1
- dumstr2: dc.b 0,0
-
- dumptr2: dc.l dumcd2
-
- parray: dc.l 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-
- *
- special:
- dc.w 2
- dc.l spcl1,spcl2
- *
- *
- version: dc.b 0,"$VER: "
- name: dc.b "IBM EPSF v2.0.6-beta1",0
- *
- spcl1: dc.b "Show Picture",0
- spcl2: dc.b "Do not Show Picture",0
-
- bbstr: dc.b "%%BoundingBox:",0
- ibmepsfhdr: dc.b $c5,$d0,$d3,$c6,0
- epsfhdr: dc.b "%!PS-Adobe",0
-
-
- typelen: dc.b 0,0,0,1,2,3 ;shift count
-
- pctypetbl: dc.b PC_BW,PC_BW,PC_RGB,PC_PALET,PC_BW
-
-
- SECTION ibmeps,BSS,PUBLIC
-
- data: ds.w 1
- object: ds.w ob_SizeOf/2
- array: ds.w 3
-
- eleft: ds.l 1
- etop: ds.l 1
- eright: ds.l 1
- ebottom: ds.l 1
-
- ehandle: ds.l 1
- elength: ds.l 1
- estart: ds.l 1
- eobj: ds.l 1
- piclenw: ds.l 1
- pichandle: ds.l 1
- tiffstart: ds.l 1
- tifflen: ds.l 1
- metastart: ds.l 1
- metalen: ds.l 1
-
- pic: ds.w pc_Sizeof/2
-
- temp: ds.l 1
- temp2: ds.l 1
- savesp: ds.l 1
- picptr: ds.l 1
- pptr: ds.l 1
- compression: ds.w 1
- byteorder: ds.w 1
- striplength: ds.l 1
-
- bps: ds.w 1
- sbctype: ds.w 1
- sbc: ds.l 1
- photom: ds.w 1
- planar: ds.w 1
- predictor: ds.w 1
- resunits: ds.w 1
- sppixel: ds.w 1
- xres: ds.w 1
- yres: ds.w 1
-
- picture: ds.l 1
- pict1: ds.l 1
- picoffset: ds.l 1
- piclength: ds.l 1
-
- tagcount: ds.w 1
- tagid: ds.w 1
- tagtype: ds.w 1
- taglength: ds.l 1
- tagvalue: ds.l 1
-
- work: ds.l 4
- bytecount: ds.l 1
- pixcount: ds.w 1
- pixpos: ds.w 1
- saved1: ds.l 1
- savea0: ds.l 1
- oddtest: ds.l 1
- rowcount: ds.l 1
- rps: ds.l 1
- hcount: ds.w 1
- maxcode: ds.w 1
- codelength: ds.w 1
- plnlen: ds.l 1
- apos1: ds.l 1
- apos2: ds.l 1
- bitcount: ds.w 1
- plncnt: ds.w 1
- strlen: ds.w 1
- wcount: ds.w 1
- str: ds.l 1
- str2: ds.l 1
- picptrsave: ds.l 1
- lastval: ds.l 1
- picptr2: ds.l 1
- picptrsave2: ds.l 1
- palcount: ds.l 1
- palsize: ds.l 1
- palptr: ds.l 1
- cmapoffset: ds.l 1
- spsave: ds.l 1
- flag: ds.w 1
- prefix: ds.l 1
- suffix: ds.l 1
- outcode: ds.l 1
-
-
- **************************** CHANGES *******************************
- ;
- ; version 2.0.6
- ;
- ; - added a version string for 'version ibmeps.import' to work
- ;
- ; - fixed a bug that would not freemem when the module did a abortobj()
- ; inside the the pic routines.
- ;
- ; - fixed a bug when the module could not o_malloc() the memory for the
- ; pic object (it did not check to be sure it got the OK from o_malloc)
- ;
- ;
- ; version 2.0.5 - public release
- ;
- ; - fixed bug when importing a PALETTE tiff image: the get info routine
- ; would store the 3 times total number of colors in the cmap.
- ;
- ; - fixed bug when tiff image had multiple rows per strip
- ;
- ; - added support for the eps data being after the TIFF header
- ;
- ; - bug fix: I removed the check for the %!-PS-Adobe string because the
- ; eps data can be above the 1K buffer that the check routine has to work
- ; with.
- ;
- ; version 2.0.4 (shipped with PgS 2.1 12/10/90)
- ;
- ; - fixed bug in PackBits de-compression routine that caused
- ; the de-compression to run on past it's boundries.
- ; (which in turn caused system problems w/ NewShell & IconX)
- ;
- ;
- ; version 2.0.3
- ;
- ; - applied TIFF/GIF LZW speed up and code reduction to this module
- ;
- ; - bug fix for f_skip "bug" that occured when f_skip was fixed.
- ; f_skip now sub.l the length in d0, so I need to fix my work around
- ; so it would clear out the upper word of d0 (the length of the file)
- ;
- ; - bug fix when an error condition happened in the f_read, f_skip stuff
- ; I left a value on the stack so when it exited on an error it would
- ; crash.
- ;
- ;
- ; version 2.0.2 (uploaded 9/25/90)
- ;
- ; - bug fix in tiff section (see tiff202.asm for more info)
- ;
- ; - temp fix for f_skip "bug" - now I only seek on word length.
- ;
- ; - added support for packbits compressed multiplane images
- ;
- ;
- ; version 2.0.1
- ;
- ; - shipped with PageStream 2.0
- ;
- ; - added support for tiff image at end of eps stuff
- ;
- ;
- ; version 2.0.0
- ;
- ; - initial release
-