home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 2 / crawlyvol2.bin / apps / dtp / pgsmodst / atariimp / dr2d.s < prev    next >
Text File  |  1991-06-21  |  62KB  |  2,104 lines

  1.  Include "equ.h"
  2.  Include "impequ.h"
  3.  
  4.  
  5.  
  6.  SECTION DR2D,CODE,PUBLIC
  7. ***************************************************
  8. ***                        ***
  9. ***************************************************
  10. dumbentry:
  11.     clr.l    d0
  12.     rts
  13.  
  14.     dc.l    "IMPO"        ; magik number for pic import
  15.     dc.w    201
  16.     dc.l    0
  17.  
  18. table:    dc.l    0
  19.     dc.l    name,special,check,DR2D
  20.  
  21.  
  22. ***************************************
  23. ***     Is it really IFF DR2D?      ***
  24. ***************************************
  25. check:    move.l    table,a0
  26.     move.l    buff1(a0),a1
  27.     move.l    (a1),a1
  28.     cmp.l    #"FORM",(a1)
  29.     bne    never
  30.     cmp.l    #"DR2D",8(a1)
  31.     bne    never
  32.     bra    right
  33.  
  34. ***********************************
  35. ***                             ***
  36. ***********************************
  37. DR2D:    move.l    sp,savesp
  38.         
  39.     move.l    table,a0                ;open the file
  40.     move.l    f_openr(a0),a0
  41.     jsr    (a0)
  42.     bne    impobj
  43.         
  44.         rts
  45.  
  46. *********************************
  47. *                               *
  48. *********************************
  49. impobj:    
  50.         ;init variables
  51.         clr.l   cmaptab                 ;zero pointers
  52.         clr.l   cmyktab
  53.         clr.l   cnamtab
  54.         clr.w   numcolors               ;numcolors = 0
  55.         clr.l   flag                    ;set flag to 0
  56.         clr.l   gsp                     ;set group stack counter to 0;
  57.         move.l  #$00e10000,fact1        ;default to inch incase no PPRF chunk
  58.         move.w  #72,fact100
  59.         move.l  #36,exp1
  60.         
  61.         move.l    table,a0                ;open the object
  62.     move.l    o_open(a0),a0
  63.     jsr    (a0)
  64.     beq    abort0
  65.  
  66.         move.l  table,a0                ;start a group
  67.         move.l  o_begingroup(a0),a0
  68.         jsr     (a0)
  69.                 
  70.         bsr     getpicinfo              ;get the object's data
  71.         
  72.         move.l  table,a0                ;end the group
  73.         move.l  o_endgroup(a0),a0
  74.         jsr     (a0)
  75.         
  76.         bsr     freemem                 ;free all the memory m_alloc'ed
  77.                 
  78.         move.l    table,a0                ;close the object
  79.     move.l    o_close(a0),a0
  80.     jsr    (a0)
  81.  
  82.     move.l    table,a0                ;close the file
  83.     move.l    f_closer(a0),a0
  84.     jsr    (a0)
  85.         
  86.         rts                             ;finished - return to PageStream
  87.         
  88.  
  89. *********************************
  90. *                               *
  91. *********************************
  92. abortobj:
  93.     move.l    table,a0
  94.     move.l    o_abort(a0),a0
  95.     jsr    (a0)
  96.  
  97. abort0:    move.l    table,a0
  98.     move.l    f_closer(a0),a0
  99.     jmp    (a0)
  100.  
  101.        
  102. *********************************
  103. *                               *
  104. *********************************
  105. getpicinfo:
  106.     bsr    pgetl        ; "FORM"
  107.     bsr    pgetl        ; length of form
  108.     move.l    d0,length
  109.     bsr    pgetl        ; "DR2D"
  110.     sub.l    #4,length
  111.  
  112. getchunk:
  113.     bsr    pgetl        ;get chunk type in temp
  114.     move.l    d0,temp
  115.     bsr    pgetl           ;get chunk length in clength
  116.     move.l    d0,clength
  117.     sub.l    #8,length       ;sub 8 from length of file left
  118.     move.l    temp,d0
  119.         
  120.     lea    chunks-4,a0     ;get address of chunk table
  121.     move.w    numchunks,d1    ;number of chunks in table
  122.  
  123. gc1:    lea    4(a0),a0        ;get address of next chunk type
  124.     cmp.l    (a0)+,d0        
  125.     dbeq    d1,gc1          ;loop until end of table or a match
  126.         
  127.     move.l    (a0),a0         ;get address of routine to use for this chunk
  128.     jsr    (a0)            ;do it
  129.  
  130.     tst.l    length          ;is there any data left in the FORM?
  131.     bne    getchunk        ;yes
  132.                 
  133.         bclr    #2,flag         ;attr is valid only for this form
  134.         
  135. rrts:    rts                     ;everything is OK
  136.  
  137.  
  138. ***********************************
  139. ***                ***
  140. ***********************************
  141. attr:   bset    #2,flag                 ;set attr flag to found
  142.         bsr     pget
  143.         move.b  d0,filltype
  144.         bsr     pget
  145.         move.b  d0,jointype             ;only miter and rounded supported
  146.         bsr     pget
  147.         move.b  d0,edgepattern          ;id of dash pattern to use
  148.         bsr     pget    
  149.         move.b  d0,arrowhead            ;id of arrow head to use
  150.         bsr     pgetw
  151.         move.w  d0,fillvalue            ;color or object to fill with
  152.         bsr     pgetw
  153.         move.w  d0,edgecolor            ;color of edge line
  154.         bsr     pgetw                   ;skip layer info
  155.         bsr     getieee7200
  156.         move.l  d0,linewidth            ;width of edge line
  157.         bra     adjlen
  158.         
  159. ***********************************
  160. ***                ***
  161. ***********************************
  162. arow:   bsr     pget                    ;arrow flags
  163.         move.b  d0,aflags
  164.         bsr     pget                    ;throw away this byte
  165.         bsr     pgetw
  166.         lea     arrowtable,a1
  167.         move.b  aflags,0(a1,d0.w)       ;store arrow flags in table
  168.         
  169. arow1:  subq.l  #4,clength              ;adjust length for what i read
  170.         subq.l  #4,length
  171.         bra     skip                    ;skip the rest
  172.         
  173. ***********************************
  174. ***                ***
  175. ***********************************
  176. bbox:   bset    #0,flag                 ;the next obj has a bounding box
  177.  
  178.         bsr     getieee7200
  179.         move.l  d0,object+ob_Left
  180.         
  181.         bsr     getieee7200
  182.         move.l  d0,object+ob_Top
  183.         
  184.         bsr     getieee7200
  185.         move.l  d0,object+ob_Right
  186.         
  187.         bsr     getieee7200
  188.         move.l  d0,object+ob_Bottom
  189.         
  190.         bra     adjlen
  191.  
  192. ***********************************
  193. ***                ***
  194. ***********************************
  195. cnam:   tst.w   numcolors               ;has a CMAP or CMYK chunk been found?
  196.         beq     skip                    ;no, so skip the names
  197.         
  198.         tst.l   cnamtab                 ;has a cnamtab been allocated yet?
  199.         bne     cnam1                   ;yes, so don't do it again
  200.         clr.l   d0
  201.         move.w  numcolors,d0
  202.         lsl.l   #2,d0
  203.         clr.l   d1
  204.         clr.l   d2
  205.         move.l  table,a0
  206.         move.l  m_alloc(a0),a0
  207.         jsr     (a0)
  208.         beq     errrts
  209.         move.l  a0,cnamtab
  210.         
  211.         move.l  (a0),a0                 ;clear the cnam table pointers
  212.         move.w  numcolors,d0
  213. cnam0:  clr.l   (a0)+
  214.         dbf     d0,cnam0
  215.         
  216. cnam1:  bsr     pgetw                   ;get the starting color index number
  217.         move.l  d0,start
  218.         bsr     pgetw                   ;get the ending color index number
  219.         move.l  d0,end
  220.         
  221.         move.l  clength,d0              ;get memory to read chunk contents into
  222.         subq.l  #4,d0
  223.         move.l  d0,temp
  224.         clr.l   d1
  225.         clr.l   d2
  226.         move.l  table,a0
  227.         move.l  m_alloc(a0),a0
  228.         jsr     (a0)
  229.         beq     errrts
  230.         move.l  a0,cnamchunk
  231.         move.l  (a0),a1
  232.         
  233. cnam2:  move.l  a1,-(sp)
  234.         bsr     pget                    ;read in chunk contents
  235.         move.l  (sp)+,a1
  236.         move.b  d0,(a1)+
  237. cnam3:  sub.l   #1,temp
  238.         bne     cnam2
  239.         
  240.         bsr     putcnam                 ;put the color names into cnamtab
  241.         
  242.         move.l  cnamchunk,a0            ;free memory needed for cnam chunk
  243.         move.l  table,a1
  244.         move.l  m_delete(a1),a1
  245.         jsr     (a1)
  246.         
  247.         bra     adjlen
  248.  
  249. ***********************************
  250. ***                ***
  251. ***********************************
  252. cmap:   move.l  clength,d0
  253.         move.l  d0,d1
  254.         divu    #3,d1                   ;d0 = number of color defs
  255.         move.w  d1,numcolors
  256.         move.w  d1,tempw1
  257.         add.w   d1,d0                   ;d0 = total length of my cmap struct
  258.         clr.l   d1
  259.         clr.l   d2
  260.         move.l  table,a0
  261.         move.l  m_alloc(a0),a0
  262.         jsr     (a0)
  263.         beq     errrts
  264.         
  265.         bset    #6,flag                 ;bit 6 = CMAP found
  266.         move.l  a0,cmaptab
  267.         move.l  (a0),a0
  268.        
  269. cmap1:  move.l  a0,-(sp)
  270.         bsr     pget
  271.         move.b  d0,red
  272.         bsr     pget
  273.         move.b  d0,green
  274.         bsr     pget
  275.         move.b  d0,blue
  276.         move.l  (sp)+,a0
  277.         move.b  #0,(a0)+                ;pagestream equiv color code
  278.         move.b  red,(a0)+               ;red
  279.         move.b  green,(a0)+             ;green
  280.         move.b  blue,(a0)+              ;blue
  281.         
  282.         subq.w  #1,tempw1
  283.         bne     cmap1
  284.  
  285.         bra     adjlen
  286.  
  287. ***********************************
  288. ***                ***
  289. ***********************************
  290. cmyk:   move.l  clength,d0
  291.         move.l  d0,d1
  292.         divu    #4,d1                   ;d0 = number of color defs
  293.         move.w  d1,numcolors
  294.         move.w  d1,tempw1
  295.         add.w   d1,d0                   ;d0 = total length of my cmap struct
  296.         clr.l   d1
  297.         clr.l   d2
  298.         move.l  table,a0
  299.         move.l  m_alloc(a0),a0
  300.         jsr     (a0)
  301.         beq     errrts
  302.         
  303.         bset    #6,flag                 ;bit 6 = CMAP found
  304.         move.l  a0,cmyktab
  305.         move.l  (a0),a0
  306.        
  307. cmyk1:  move.l  a0,-(sp)
  308.         bsr     pget
  309.         move.b  d0,cyan
  310.         bsr     pget
  311.         move.b  d0,magenta
  312.         bsr     pget
  313.         move.b  d0,yellow
  314.         bsr     pget
  315.         move.b  d0,black
  316.         
  317.         move.l  (sp)+,a0
  318.         move.b  #0,(a0)+                ;pagestream equiv color code (0=none)
  319.         move.b  cyan,(a0)+              ;cyan
  320.         move.b  magenta,(a0)+           ;magenta
  321.         move.b  yellow,(a0)+            ;yellow
  322.         move.b  black,(a0)+             ;black
  323.         
  324.         subq.w  #1,tempw1
  325.         bne     cmyk1
  326.  
  327.         bra     adjlen
  328.  
  329. ***********************************
  330. ***                ***
  331. ***********************************
  332. cply:   btst    #4,flag                 ;is this a fill object?
  333.         bne     cply1                   ;yes - so skip
  334.         
  335.         bset    #3,flag                 ;set closed poly flag
  336.         bra     ply                     ;do poly stuff
  337.         
  338. cply1:  bclr    #4,flag                 ;clear the fill flag
  339.         bra     skip        
  340.  
  341. ***********************************
  342. ***                ***
  343. ***********************************
  344. dash:   bsr     pgetw                   ;get id of dash
  345.         move.w  d0,dashid               ;id of 0 means no line at all
  346.         bsr     pgetw
  347.         move.w  d0,numdashes            ;numdashes of 0 means solid line
  348.         
  349.         lea     dashtable,a1
  350.         move.w  dashid,d0
  351.         cmp.w   #0,dashid 
  352.         bne     dash1
  353.         move.b  #0,d1
  354.         bra     dash3
  355.         
  356. dash1:  cmp.w   #0,numdashes
  357.         bne     dash2
  358.         move.b  #1,d1
  359.         bra     dash3
  360.         
  361. dash2:  move.b  #5,d1
  362. dash3:  move.b  d1,0(a1,d0.w)           ;store dash code: 0 = no line
  363.                                         ;1 = solid line, 5 = dashed line
  364.         subq.l  #4,length
  365.         subq.l  #4,clength
  366.         bne     dash4
  367.         rts
  368.         
  369. dash4:  bra     skip
  370.  
  371.                 
  372. ***********************************
  373. ***                ***
  374. ***********************************
  375. drhd:
  376.         clr.l   flag2
  377.         bsr     getieee7200
  378.         move.l  d0,xleft
  379.         bsr     getieee7200
  380.         move.l  d0,ytop
  381.         bsr     getieee7200
  382.         move.l  d0,xright
  383.         bsr     getieee7200
  384.         move.l  d0,ybottom
  385.         
  386.         move.l  xleft,d0                ;is xleft<xright?
  387.         cmp.l   xright,d0
  388.         ble     drhd1                   ;yes
  389.         bset    #0,flag2
  390.  
  391. drhd1:  move.l  ytop,d0                 ;is xtop<xbottom?
  392.         cmp.l   ybottom,d0
  393.         ble     drhd2                   ;yes
  394.         bset    #1,flag2
  395.         
  396. drhd2:  bra     adjlen
  397.  
  398.         
  399. ***********************************
  400. ***                ***
  401. ***********************************
  402. fill:   bset    #4,flag                 ;the next object is a fill object
  403.         bra     skip
  404.  
  405.  
  406. ***********************************
  407. ***                ***
  408. ***********************************
  409. fons:   bsr     pget
  410.         move.b  d0,fontid
  411.         bsr     pgetw                   ;throw away 2 bytes
  412.         bsr     pget
  413.         move.b  d0,serifflag
  414.         move.l  clength,d3              ;get the font name
  415.         subq.l  #4,d3
  416.         
  417.         lea     buffer,a2
  418. fons1:  bsr     pget
  419.         move.b  d0,(a2)+
  420.         subq.l  #1,d3
  421.         bne     fons1
  422.         clr.b   (a2)
  423.         
  424.         lea     buffer,a0
  425.         move.l  table,a1
  426.         clr.l   d0
  427.         move.l  findfontname(a1),a1
  428.         jsr     (a1)
  429.         bne     fons2                   ;found font!
  430.          
  431.         clr.l   d0
  432.         move.b  serifflag,d0            ;serif flag. 1=SERIF; 0=SANSERIF (?)
  433.         or.l   #$ff000000,d0
  434.         
  435. fons2:  lea     fonttable,a0
  436.         clr.w   d1  
  437.         move.b  fontid,d1
  438.         lsl.w   #2,d1
  439.         move.l  d0,0(a0,d1.w)
  440.         bra     fons3
  441.         
  442. fons3: bra      adjlen
  443.         
  444. ***********************************
  445. ***                ***
  446. ***********************************
  447. form:   btst    #4,flag                 ;is this a fill form?
  448.         bne     form1                   ;yes!
  449.         
  450.         move.l  length,-(sp)
  451.         move.l  clength,-(sp)  
  452.         move.l  clength,length
  453.         bsr     pgetl                   ;'DR2D'
  454.         subq.l  #4,length
  455.         
  456.         bsr     getchunk                ;handle nested FORM's
  457.         
  458.         move.l  (sp)+,clength
  459.         move.l  (sp)+,length
  460.         
  461.         btst    #5,flag                 ;did i finish a grup?
  462.         beq     form0                   ;no
  463.         
  464.         move.l  table,a0                ;yes - so end the group
  465.         move.l  o_endgroup(a0),a0
  466.         jsr     (a0)
  467.         
  468.         sub.l   #1,gsp                  ;decrement the group stack counter
  469.         bne     form0                   ;if not zero, I'm still in  a group
  470.         
  471.         bclr    #5,flag                 ;else clear group flag
  472.         
  473. form0:  bra     adjlen
  474.  
  475. form1:  bclr    #4,flag
  476.         bra     skip
  477.         
  478. ***********************************
  479. ***                ***
  480. ***********************************
  481. grup:   bsr     pgetw
  482.         tst.w   d0
  483.         beq     grup1
  484.         
  485.         bset    #5,flag                 ;bit 5 = GRUP chunk
  486.         move.l  table,a0
  487.         move.l  o_begingroup(a0),a0
  488.         jsr     (a0)
  489.         
  490.         add.l   #1,gsp                  ;increment the group stack counter
  491.         
  492. grup1:  bra     adjlen
  493.  
  494. ***********************************
  495. ***                ***
  496. ***********************************
  497. oply:   btst    #4,flag                 ;is this a fill object?
  498.         bne     oply1                   ;yes
  499.         
  500.         bclr    #3,flag                 ;clear closed poly flag
  501.         bra     ply                     ;do poly stuff
  502.  
  503. oply1:  bclr    #4,flag                 ;clear the fill flag
  504.         bra     skip
  505.         
  506.         
  507. ***********************************
  508. ***                ***
  509. ***********************************
  510. pprf:   move.l  clength,d1
  511.         
  512.         lea     buffer,a0
  513.         bra     pprf2
  514. pprf1:  move.l  a0,-(sp)
  515.         move.w  d1,-(sp)
  516.         bsr     pget
  517.         move.w  (sp)+,d1
  518.         move.l  (sp)+,a0
  519.         move.b  d0,(a0)+
  520. pprf2:  dbf     d1,pprf1
  521.       
  522.         lea     buffer,a0               ;is it in inches?
  523.         lea     inch,a1                 ;inches = 7200
  524. pprf3:  cmp.b   (a0)+,(a1)+
  525.         bne     pprf4
  526.         tst.b   (a1)
  527.         bne     pprf3
  528.         move.l  #$00e10000,fact1
  529.         move.w  #72,fact100
  530.         move.l  #36,exp1                ;exponent for 7200 (12) + 24
  531.         bra     adjlen
  532.         
  533. pprf4:  lea     buffer,a0               ;is it in picas?
  534.         lea     pica,a1                 ;pica = 1200
  535. pprf5:  cmp.b   (a0)+,(a1)+
  536.         bne     pprf6
  537.         tst.b   (a1)
  538.         bne     pprf5
  539.         move.l  #$00960000,fact1        
  540.         move.w  #12,fact100
  541.         move.l  #34,exp1                ;exponent for 1200 (10) + 24
  542.         bra     adjlen
  543.         
  544. pprf6:  lea     buffer,a0               ;is it in inches?
  545.         lea     cm,a1                   ;cm = 2835
  546. pprf7:  cmp.b   (a0)+,(a1)+
  547.         bne     pprf8
  548.         tst.b   (a1)
  549.         bne     pprf7
  550.         move.l  #$00b13000,fact1
  551.         move.w  #28,fact100
  552.         move.l  #35,exp1                ;exponent for 2836 (11) + 24
  553.         bra     adjlen
  554.         
  555. pprf8:  move.l  #$00e10000,fact1        ;unknown type so - default to inches
  556.         move.w  #72,fact100
  557.         move.l  #36,exp1
  558.         bra     adjlen  
  559.               
  560. ***********************************
  561. ***                ***
  562. ***********************************
  563. stxt:   bsr     setobjdef
  564.         
  565.         bsr     pgetw
  566.         move.w  d0,fontid
  567.         bsr     getieee7200
  568.         move.l  d0,charw
  569.         bsr     getieee7200
  570.         move.l  d0,charh
  571.         bsr     getieee7200
  572.         move.l  d0,basex
  573.         bsr     getieee7200
  574.         move.l  d0,basey
  575.         bsr     getieee
  576.         move.l  d0,rotation
  577.         bsr     pgetw
  578.         move.w  d0,numchars
  579.  
  580.         move.l  table,a0
  581.         move.l  m_alloc(a0),a0
  582.         clr.l   d1
  583.         clr.l   d2
  584.         clr.l   d0
  585.         move.w  numchars,d0
  586.         jsr     (a0)
  587.         beq     errrts
  588.  
  589.         move.l  a0,string
  590.         move.l  (a0),a0
  591.         move.w  numchars,d1  
  592.         bra     stxt2
  593.                 
  594. stxt1:  move.l  a0,-(sp)
  595.         move.w  d1,-(sp)   
  596.         bsr     pget
  597.         move.w  (sp)+,d1
  598.         move.l  (sp)+,a0
  599.         move.b  d0,(a0)+
  600. stxt2:  dbf     d1,stxt1
  601.  
  602.         btst    #0,flag         ;does this object have a bounding box?
  603.         bne     stxt3           ;yes!
  604.         
  605.         move.l  basex,d0
  606.         move.l  d0,object+ob_Left
  607.         move.l  charw,d1
  608.         mulu    numchars,d1
  609.         add.l   d1,d0
  610.         sub.l   charw,d0
  611.         move.l  d0,object+ob_Right
  612.         
  613.         move.l  basey,d0
  614.         move.l  d0,object+ob_Bottom
  615.         move.l  charh,d1
  616.         mulu    #5,d1
  617.         divu    #26,d1
  618.         and.l   #$0000ffff,d1
  619.         add.l   d1,d0
  620.         move.l  d0,object+ob_Bottom
  621.         sub.l   charh,d0
  622.         move.l  d0,object+ob_Top
  623.         
  624. stxt3:  move.w  #25,object+ob_LWidth
  625.         move.b  #0,object+ob_LType
  626.         move.b  #ttxt,object+ob_Type
  627.         
  628.         btst    #2,flag                 ;was an ATTR chunk found?
  629.         beq     stxt30                  ;no
  630.  
  631.         cmp.b   #1,filltype             ;is it filled with a color?
  632.         bne     stxt30                  ;no
  633.                 
  634.         move.w  fillvalue,d0
  635.         bsr     addcolor
  636.         move.b  d0,object+ob_FColor
  637.         move.w  edgecolor,d0
  638.         bsr     addcolor
  639.         move.b  d0,object+ob_LColor
  640.         
  641. stxt30: bsr     putobj
  642.         
  643.     lea    column,a0
  644.     move.b    #1,cm_LCalc(a0)
  645.     move.b    #1,cm_QCalc(a0)
  646.  
  647.     move.l    object+ob_Left,cm_Left(a0)
  648.     move.l    object+ob_Top,cm_Top(a0)
  649.         move.l    #$7fffff,cm_Right(a0)
  650.     move.l    #$7fffff,cm_Bottom(a0)
  651.  
  652.     clr.w    cm_Flag(a0)
  653.         
  654.         lea     fonttable,a1
  655.         move.w  fontid,d0
  656.         lsl.w   #2,d0
  657.         cmp.b   #$ff,0(a1,d0.w)
  658.         beq     st0
  659.         
  660.         move.l  0(a1,d0.w),d0
  661.         move.l    d0,cm_Font(a0)
  662.         bra     st2
  663.         
  664. st0:    move.l  0(a1,d0.w),d1
  665.         move.l  #1000,d2
  666.         tst.b   d1
  667.         beq     st1
  668.         move.l  #5000,d2
  669. st1:    move.l  d2,cm_Font(a0)
  670.         
  671. st2:    clr.l    cm_Attrb(a0)
  672.     move.l    charw,cm_XPoint(a0)
  673.     move.l    charh,cm_YPoint(a0)
  674.     clr.w    cm_Spacing(a0)
  675.     move.w    #$8000,cm_Lead(a0)
  676.     clr.w    cm_BMod(a0)
  677.     clr.w    cm_PIndent(a0)
  678.     clr.w    cm_LIndent(a0)
  679.     clr.w    cm_RIndent(a0)
  680.     clr.b    cm_Tag(a0)
  681.     clr.b    cm_Justify(a0)        ;block left
  682.     ;move.b    #9,cm_CFill(a0)
  683.         move.b  #9,cm_CFStyle(a0)       ; fill style?
  684.     move.b    #1,cm_CFColor(a0)
  685.         clr.b   cm_CLStyle(a0)
  686.         clr.w   cm_CLWidth(a0)
  687.         clr.b   cm_CLColor(a0)
  688.         
  689.     clr.l    cm_Tabs(a0)
  690.  
  691.         move.l  #cm_Sizeof,d0
  692.     move.l    table,a0
  693.     move.l    o_malloc(a0),a0
  694.     jsr    (a0)
  695.     bne    stxt31
  696.         
  697.         move.l  string,a0
  698.         move.l  table,a1
  699.         move.l  m_delete(a1),a1
  700.         jsr     (a1)
  701.  
  702.         bra     errrts
  703.  
  704. stxt31: lea     column,a1
  705.         move.w  #cm_Sizeof,d0
  706.         lsr.w   #1,d0
  707.         bra     stxt5
  708. stxt4:    move.w    (a1)+,(a0)+
  709. stxt5:    dbf    d0,stxt4
  710.  
  711.         clr.l   d0
  712.         move.w  numchars,d0
  713.         subq.w  #1,d0
  714.         move.l  table,a0
  715.         move.l  o_putl(a0),a0
  716.         jsr     (a0)
  717.         
  718.         move.l  table,a0
  719.         move.l  o_malloc(a0),a0
  720.         clr.l   d0
  721.         move.w  numchars,d0
  722.         bclr    #0,d0
  723.         jsr     (a0)
  724.         bne     stxt6
  725.         
  726.         move.l  string,a0
  727.         move.l  table,a1
  728.         move.l  m_delete(a1),a1
  729.         jsr     (a1)
  730.  
  731.         bra     errrts
  732.         
  733. stxt6:  move.l  string,a1
  734.         move.l  (a1),a1
  735.         clr.l   d0
  736.         move.w  numchars,d0
  737.         subq.w  #1,d0
  738.         bra     stxt8
  739.               
  740. stxt7:  move.b  (a1)+,(a0)+
  741. stxt8:  dbf     d0,stxt7
  742.       
  743.         move.l  string,a0
  744.         move.l  table,a1
  745.         move.l  m_delete(a1),a1
  746.         jsr     (a1)
  747.         
  748.         bra     adjlen
  749.  
  750. ***********************************
  751. ***                ***
  752. ***********************************
  753. skip:    move.l    clength,d0
  754.     add.l    #1,d0
  755.     bclr    #0,d0
  756.     sub.l    d0,length
  757.  
  758. sk1:    move.l    d0,-(sp)
  759.     bsr    pgetw
  760.     move.l    (sp)+,d0
  761.     sub.l    #2,d0
  762.     bgt    sk1
  763.     rts
  764.  
  765.  
  766. ***********************************
  767. ***                ***
  768. ***********************************
  769. ply:
  770.         bsr     setobjdef               ;set up default values for the object
  771.         bsr     pgetw
  772.         move.w  d0,count                ;d4 = number of point pairs to read
  773.         
  774.     mulu    #10,d0                ;max bytes per pair = 10
  775.         btst    #3,flag                 ;is this a close poly?
  776.         bne     ply1                    ;yes!
  777.         add.l   #ply_Sizeof+4,d0        ;4 = newpath+strokepath
  778.         bra     ply2
  779.         
  780. ply1:   add.l    #ply_Sizeof+6,d0    ;6 = new+close+(fill or stroke)
  781.  
  782. ply2:    clr.l    d1                      ;allocate temp memory for object data
  783.     clr.l    d2
  784.     move.l    table,a0
  785.     move.l    m_alloc(a0),a0
  786.     jsr    (a0)
  787.     beq    errrts
  788.  
  789.     move.l    a0,mptr
  790.     move.l    (a0),a4
  791.     lea    ply_Sizeof(a4),a4
  792.     move.l    a4,pptr
  793.  
  794.         cmp.w   #2,count                ;is it a line? (2 points) 
  795.         beq     ply3                    ;no
  796.         move.b  #tpoly,object+ob_Type
  797.         bra     ply4
  798.         
  799. ply3:   move.b  #tdln,object+ob_Type
  800.         
  801. ply4:   move.w  count,d0
  802.         move.l  pptr,a0
  803.         move.w  #NEWPATH,(a0)+
  804.         bclr    #1,flag                 ;clear first point flag - not found
  805.         move.w  #ply_Sizeof+2,len       ;set starting length of poly stuff
  806.         move.w  #1,numcom               ;set poly command counter to 1
  807.  
  808.         btst    #0,flag                 ;is there a bbox for this object
  809.         bne     ply10
  810.         
  811.         move.l  #$7fffffff,object+ob_Left     ;init to very large for checkLR
  812.         move.l  #$7fffffff,object+ob_Top                
  813.         
  814.         move.l  #$80000000,object+ob_Right    ;init to very small for checkTB
  815.         move.l  #$80000000,object+ob_Bottom
  816.         
  817. ply10:  bsr     getieee7200             ;convert fp num in d0 to integer
  818.         bne     ply18                   ;check for INDICATOR
  819.         
  820.         move.l  a0,-(sp)
  821.         bsr     pgetl                   ;get INDICATOR option
  822.         move.l  (sp)+,a0
  823.         subq.w  #1,count
  824.         and.l   #$00000003,d0           ;mask off all but lower 2 bits
  825.         cmp.l   #1,d0                   ;1=CURVETO
  826.         beq     ply15
  827.         cmp.l   #2,d0                   ;2=MOVETO
  828.         beq     ply14
  829.         cmp.l   #3,d0                   ;3=BOTH
  830.         beq     ply13
  831.         
  832.         ;do something if not any of these - should never happen
  833.         
  834. ply13:  move.w  #MOVETO,(a0)+
  835.         bsr     getieee7200
  836.         move.l  d0,(a0)+
  837.         bsr     checkLR                 ;check Left & Right bounds
  838.         bsr     getieee7200
  839.         move.l  d0,(a0)+
  840.         bsr     checkTB                 ;check Top & Bottom bounds
  841.         
  842.         move.w  #CURVETO,(a0)+          ;bezier curve - first control point
  843.         bsr     getieee7200
  844.         move.l  d0,(a0)+
  845.         bsr     checkLR
  846.         bsr     getieee7200
  847.         move.l  d0,(a0)+
  848.         bsr     checkTB    
  849.  
  850.         bsr     getieee7200             ;second control point
  851.         move.l  d0,(a0)+
  852.         bsr     checkLR
  853.         bsr     getieee7200
  854.         move.l  d0,(a0)+
  855.         bsr     checkTB
  856.         
  857.         bsr     getieee7200             ;third is the end point of the curve
  858.         move.l  d0,(a0)+
  859.         move.l  d0,prevx
  860.         bsr     checkLR
  861.         bsr     getieee7200
  862.         move.l  d0,(a0)+
  863.         move.l  d0,prevy
  864.         bsr     checkTB
  865.         
  866.         subq.w  #4,count                ;always uses four points   
  867.         add.w   #36,len    
  868.         addq.w  #2,numcom  
  869.         bra     ply19     
  870.         
  871. ply14:  move.w  #MOVETO,(a0)+
  872.         bsr     getieee7200
  873.         move.l  d0,(a0)+
  874.         move.l  d0,prevx
  875.         bsr     checkLR                 ;check Left & Right bounds
  876.         bsr     getieee7200
  877.         move.l  d0,(a0)+
  878.         move.l  d0,prevy
  879.         bsr     checkTB                 ;check Top & Bottom bounds
  880.         
  881.         subq.w  #1,count                ;adjust counts
  882.         add.w   #10,len
  883.         addq.w  #1,numcom
  884.         bra     ply19
  885.         
  886. ply15:  btst    #1,flag                 ;is this the first point?
  887.         bne     ply16                   ;no
  888.         
  889.         bset    #1,flag                 ;set first point flag to FOUND
  890.         move.w  #MOVETO,(a0)+
  891.         bsr     getieee7200
  892.         move.l  d0,(a0)+
  893.         bsr     checkLR
  894.         bsr     getieee7200
  895.         move.l  d0,(a0)+
  896.         bsr     checkTB
  897.         addq.w  #1,numcom
  898.         add.w   #10,len
  899.         bra     ply17
  900.         
  901. ply16:  bsr     getieee7200             ;get the first point
  902.         move.l  d0,saveX                ;save it incase...
  903.         cmp.l   prevx,d0                ;is it the same as the last X coord?
  904.         beq     ply165                  ;yes, so check the Y coord
  905.         
  906.         move.w  #LINETO,(a0)+           ;if not, do a LINETO
  907.         move.l  d0,(a0)+
  908.         bsr     checkLR                 ;check Left & Right bounds
  909.         bsr     getieee7200
  910.         move.l  d0,(a0)+
  911.         bsr     checkTB                 ;check Top & Bottom bounds
  912.         
  913.         add.w   #10,len
  914.         addq.w  #1,numcom
  915.         bra     ply17
  916.                        
  917. ply165: bsr     getieee7200             ;get the first point
  918.         move.l  d0,saveY                ;save it incase
  919.         cmp.l   prevy,d0                ;is it the same as the last Y coord?
  920.         beq     ply17                   ;yes, so skip it!
  921.         
  922.         move.w  #LINETO,(a0)+           ;if not, do a LINETO
  923.         move.l  saveX,d0
  924.         move.l  d0,(a0)+
  925.         bsr     checkLR                 ;check Left & Right bounds
  926.         move.l  saveY,d0
  927.         move.l  d0,(a0)+
  928.         bsr     checkTB                 ;check Top & Bottom bounds
  929.         
  930.         add.w   #10,len
  931.         addq.w  #1,numcom
  932.         
  933. ply17:  move.w  #CURVETO,(a0)+          ;bezier curve - first control point
  934.         bsr     getieee7200
  935.         move.l  d0,(a0)+
  936.         bsr     checkLR
  937.         bsr     getieee7200
  938.         move.l  d0,(a0)+
  939.         bsr     checkTB
  940.         
  941.         bsr     getieee7200             ;second control point
  942.         move.l  d0,(a0)+
  943.         bsr     checkLR
  944.         bsr     getieee7200
  945.         move.l  d0,(a0)+
  946.         bsr     checkTB
  947.         
  948.         bsr     getieee7200             ;third is the end point of the curve
  949.         move.l  d0,(a0)+   
  950.         move.l  d0,prevx
  951.         bsr     checkLR
  952.         bsr     getieee7200
  953.         move.l  d0,(a0)+
  954.         move.l  d0,prevy
  955.         bsr     checkTB
  956.         
  957.         subq.w  #4,count                ;always uses four points   
  958.         add.w   #26,len    
  959.         addq.w  #1,numcom  
  960.         bra     ply19     
  961.         
  962. ply18:  btst    #1,flag                 ;is this the first point?
  963.         bne     ply181                  ;no
  964.         
  965.         move.w  #MOVETO,(a0)+
  966.         bset    #1,flag                 ;set first point flag to FOUND
  967.         move.l  d0,(a0)+
  968.         move.l  d0,prevx
  969.         bsr     checkLR
  970.         bsr     getieee7200
  971.         move.l  d0,(a0)+
  972.         move.l  d0,prevy
  973.         bsr     checkTB
  974.         bra     ply182
  975.               
  976. ply181: move.w  #LINETO,(a0)+
  977.         move.l  d0,(a0)+
  978.         move.l  d0,prevx
  979.         bsr     checkLR                 ;check Left & Right bounds
  980.         bsr     getieee7200
  981.         move.l  d0,(a0)+
  982.         move.l  d0,prevy
  983.         bsr     checkTB                 ;check Top & Bottom bounds
  984.         
  985. ply182: subq.w  #1,count
  986.         add.w   #10,len
  987.         addq.w  #1,numcom
  988.         
  989. ply19:  tst.w   count
  990.         bne     ply10
  991.  
  992.         btst    #2,flag                 ;was an attr chunk found?
  993.         beq     ply200                  ;no
  994.         
  995.         move.l  linewidth,d0
  996.         beq     ply191
  997.         move.w  d0,object+ob_LWidth     ;set object line width
  998.         
  999.         move.w  edgecolor,d0
  1000.         bsr     addcolor
  1001.         move.b  d0,object+ob_LColor     ;set objects line color
  1002.  
  1003. ply191: lea     dashtable,a1
  1004.         clr.w   d0
  1005.         move.b  edgepattern,d0
  1006.         move.b  0(a1,d0.w),object+ob_LType      ;set objects line type
  1007.         
  1008. ply192: lea     arrowtable,a1
  1009.         clr.w   d0
  1010.         move.b  arrowhead,d0
  1011.         btst    #0,0(a1,d0.w)           ;draw arrow on first point
  1012.         beq     ply193
  1013.         move.b  #1,object+ob_LBegin        
  1014.  
  1015. ply193: btst    #1,0(a1,d0.w)
  1016.         beq     ply200
  1017.         move.b  #1,object+ob_LEnd       ;draw arrow on last point
  1018.         
  1019. ply200: btst    #3,flag                 ;is it a close poly?
  1020.         beq     ply202                  ;no!
  1021.         
  1022.         move.w  #CLOSEPATH,(a0)+
  1023.         addq.w  #1,numcom
  1024.         addq.w  #2,len
  1025.         
  1026.         cmp.b   #tdln,object+ob_Type    ;is it a line?
  1027.         bne     ply201                  ;no
  1028.         move.l  -16(a0),object+ob_Top
  1029.         move.l  -6(a0),object+ob_Bottom
  1030.         bsr     putobj
  1031.         bra     ply23                   ;no poly info for a tdln
  1032.         
  1033. ply201: btst    #2,flag                 ;was an attr chunk found?
  1034.         beq     ply202                  ;no
  1035.         
  1036.         cmp.b   #1,filltype             ;is it filled with a color?
  1037.         bne     ply202                  ;no - so skip fill
  1038.         
  1039.         move.b  #9,object+ob_FType      ;yes - set fill type to #9 (solid)
  1040.         move.w  #FILLPATH,(a0)+
  1041.         addq.w  #1,numcom
  1042.         addq.w  #2,len
  1043.         move.w  fillvalue,d0
  1044.         bsr     addcolor
  1045.         move.b  d0,object+ob_FColor     ;set the objects color
  1046.         
  1047.         bra     ply203
  1048.   
  1049. ply202: move.w  #STROKEPATH,(a0)+
  1050.         addq.w  #1,numcom
  1051.         addq.w  #2,len
  1052.         
  1053.         cmp.b   #tdln,object+ob_Type    ;is it a line?
  1054.         bne     ply203                  ;no
  1055.  
  1056.         move.l  -16(a0),object+ob_Top
  1057.         move.l  -6(a0),object+ob_Bottom
  1058.         
  1059.         bsr     putobj
  1060.         bra     ply23                   ;no poly info for a tdln
  1061.         
  1062. ply203: move.l  mptr,a0
  1063.         move.l  (a0),a0
  1064.         clr.l   d0
  1065.         move.w  len,d0
  1066.         move.l  d0,ply_Length(a0)
  1067.         
  1068.         move.l  object+ob_Right,d0
  1069.         sub.l   object+ob_Left,d0
  1070.         move.l  d0,ply_Width(a0)
  1071.         
  1072.         move.l  object+ob_Bottom,d0
  1073.         sub.l   object+ob_Top,d0
  1074.         move.l  d0,ply_Height(a0)
  1075.         
  1076.         move.w  #100,ply_XScale(a0)
  1077.         move.w  #100,ply_YScale(a0)
  1078.         move.w  numcom,ply_Count(a0)
  1079.         
  1080.         lea     ply_Sizeof(a0),a0       ;set a0 to start of poly data
  1081.         move.w  numcom,d0               ;set d0 to number of 'commands'
  1082.         bsr     adjcoords               ;adjust coords to ob_Left & ob_Top 
  1083.  
  1084.         bsr     putobj
  1085.  
  1086.     move.l    mptr,a0                 ;allocate memory for actual object
  1087.     move.l    (a0),a0
  1088.     move.l    (a0),d0
  1089.     move.l    table,a0
  1090.     move.l    o_malloc(a0),a0
  1091.     jsr    (a0)
  1092.     beq    errrts
  1093.         
  1094.     move.l    mptr,a1                 ;copy data into object
  1095.     move.l    (a1),a1
  1096.     move.l    (a1),d0
  1097.     lsr.w    #1,d0
  1098.     bra    ply22
  1099. ply21:    move.w    (a1)+,(a0)+
  1100. ply22:    dbf    d0,ply21
  1101.  
  1102.  
  1103. ply23:  move.l  mptr,a0                 ;free temp memory for object data
  1104.         move.l  table,a1
  1105.         move.l  m_delete(a1),a1
  1106.         jsr     (a1)
  1107.  
  1108.         bclr    #0,flag                 ;bounding box only for this object
  1109.  
  1110.         bra     adjlen
  1111.         
  1112. ***********************************
  1113. ***                ***
  1114. ***********************************
  1115. adjlen:    move.l    clength,d0
  1116.     btst    #0,d0
  1117.     beq    al1
  1118.     bsr    pget
  1119.     move.l    clength,d0
  1120.     add.l    #1,d0
  1121.  
  1122. al1:    sub.l    d0,length
  1123.     rts
  1124.  
  1125. *********************************
  1126. *                               *
  1127. *********************************
  1128. pgetl:    move.l    table,a0
  1129.     move.l    f_getl(a0),a0
  1130.     jsr    (a0)
  1131.     beq    errrts
  1132.     rts
  1133.  
  1134. *********************************
  1135. *                               *
  1136. *********************************
  1137. pgetw:    move.l    table,a0
  1138.     move.l    f_getw(a0),a0
  1139.     jsr    (a0)
  1140.     beq    errrts
  1141.         and.l   #$0000ffff,d0           ;clean up d0
  1142.         rts
  1143.  
  1144. *********************************
  1145. *                               *
  1146. *********************************
  1147. pget:    move.l    table,a0
  1148.     move.l    f_get(a0),a0
  1149.     jsr    (a0)
  1150.     beq    errrts
  1151.         and.l   #$000000ff,d0           ;clean up d0
  1152.     rts
  1153.  
  1154. ***********************************
  1155. ***                ***
  1156. ***********************************
  1157. Mulu3232:
  1158.     move.l    table,a0
  1159.     move.l    mulu3232(a0),a0
  1160.     jmp    (a0)
  1161.  
  1162.  
  1163. ***********************************
  1164. ***                ***
  1165. ***********************************
  1166. Divu1648:
  1167.     move.l    table,a0
  1168.     move.l    divu1648(a0),a0
  1169.     jmp    (a0)
  1170.  
  1171.  
  1172. ************************************************************
  1173. ***   convert ieee floating point number to an integer   ***
  1174. ************************************************************
  1175. getieee7200:
  1176.         move.l  a0,-(sp)
  1177.         bsr     pgetl
  1178.         clr.l   d1
  1179.         tst.l   d0                      ;is it all zero
  1180.         beq     ftoi3                   ;yes
  1181.         
  1182.         cmp.l   #$ffffffff,d0
  1183.         beq     ftoi4
  1184.         
  1185.         clr.b   sign
  1186.         move.l  d0,d2
  1187.         btst    #31,d2                  ;is the sign bit on?
  1188.         beq     ftoi0                   ;nope
  1189.         
  1190.         move.b  #1,sign
  1191.           
  1192. ftoi0:  move.l  d0,d2           
  1193.         and.l   #$7f800000,d2           ;get exponent into d2
  1194.         move.l  #23,d1
  1195.         lsr.l   d1,d2
  1196.         sub.b   #127,d2
  1197.         ext.w   d2
  1198.         ext.l   d2
  1199.         move.l  d2,-(sp)                ;save for later
  1200.         
  1201.         and.l   #$007fffff,d0           ;get mantissa into d1
  1202.         or.l    #$00800000,d0
  1203.         
  1204.         move.l  fact1,d1                ;inch, pica, or cm conversion factor
  1205.         bsr     Mulu3232
  1206.  
  1207.         move.l  #23,d2                  ;normalize product
  1208. ftoi1:  lsr.l   #1,d1                   ;it will all be in d0 (lower 24 bits)
  1209.         roxr.l  #1,d0
  1210.         dbf     d2,ftoi1
  1211.         
  1212.         move.l  (sp)+,d2                ;get exponent back into d2
  1213.         add.l   exp1,d2                 ;add exponent for fact1
  1214.         
  1215.         move.l  #45,d3
  1216.         sub.l   d2,d3                   ;subtract 45-d2 = number of lsr's -1
  1217.  
  1218. ftoi2:  lsr.l   #1,d0
  1219.         dbf     d3,ftoi2
  1220.         
  1221.         tst.b   sign
  1222.         beq     ftoi3
  1223.         
  1224.         not.l   d0
  1225.         addq    #1,d0
  1226.         
  1227.         
  1228. ftoi3:  moveq.l #1,d1                   ;set cc to not zero for return
  1229.  
  1230. ftoi4:  move.l  (sp)+,a0
  1231.         rts
  1232.         
  1233. ************************************************************
  1234. ***   convert ieee floating point number to an integer   ***
  1235. ************************************************************
  1236. getieee:
  1237.         move.l  a0,-(sp)
  1238.         bsr     pgetl
  1239.         clr.l   d1
  1240.       
  1241.         tst.l   d0                      ;is it all zero
  1242.         beq     gtie3                   ;yes
  1243.       
  1244.         cmp.l   #$ffffffff,d0           ;check for the INDICATOR
  1245.         beq     gtie4
  1246.         
  1247.         clr.b   sign  
  1248.         move.l  d0,d2
  1249.         btst    #31,d2
  1250.         beq     gtie0
  1251.         move.b  #1,sign
  1252.         
  1253. gtie0:  and.l   #$7f800000,d2           ;get exponent into d2
  1254.         move.l  #23,d1
  1255.         lsr.l   d1,d2
  1256.         sub.b   #127,d2
  1257.         ext.w   d2
  1258.         ext.l   d2
  1259.         
  1260.         and.l   #$007fffff,d0           ;get mantissa into d1
  1261.         or.l    #$00800000,d0
  1262.         
  1263.         move.l  #22,d1                  ;d2 = number of lsr's
  1264.         sub.l   d2,d1
  1265.         
  1266. gtie1:  lsr.l   #1,d0                   ;convert to an integer
  1267.         dbf     d1,gtie1
  1268.         
  1269.         tst.b   sign
  1270.         beq     gtie3
  1271.         not.l   d0
  1272.         addq    #1,d0
  1273.         
  1274. gtie3:  moveq.l #1,d1                   ;set cc to not zero for return
  1275.  
  1276. gtie4:  move.l  (sp)+,a0
  1277.         rts
  1278.         
  1279.         
  1280. ***************************
  1281. ***                     ***
  1282. ***************************
  1283. putobj:    bsr     adjobj                  ;adjust object to the page
  1284.         move.l    table,a1
  1285.     move.l    o_obj(a1),a1
  1286.     lea    object,a0
  1287.     jsr    (a1)
  1288.         beq     errrts
  1289.                 
  1290.         rts
  1291.         
  1292. ***************************
  1293. ***                     ***
  1294. ***************************
  1295. checkLR:
  1296.         btst    #0,flag                 ;is there a bounding box?
  1297.         bne     cklr2                   ;yes!
  1298.         
  1299.         cmp.l   object+ob_Left,d0
  1300.         bge     cklr1
  1301.         move.l  d0,object+ob_Left
  1302. cklr1:  cmp.l   object+ob_Right,d0
  1303.         ble     cklr2
  1304.         move.l  d0,object+ob_Right          
  1305. cklr2:  rts
  1306.         
  1307. ***************************
  1308. ***                     ***
  1309. ***************************
  1310. checkTB:
  1311.         btst    #0,flag                 ;is there a boundoing box?
  1312.         bne     cktb2                   ;yes!
  1313.         
  1314.         cmp.l   object+ob_Top,d0
  1315.         bge     cktb1
  1316.         move.l  d0,object+ob_Top
  1317. cktb1:  cmp.l   object+ob_Bottom,d0
  1318.         ble     cktb2
  1319.         move.l  d0,object+ob_Bottom
  1320. cktb2:  rts
  1321.         
  1322. ***************************
  1323. ***                     ***
  1324. ***************************
  1325. setobjdef:
  1326.         clr.b   object+ob_Flag
  1327.         clr.w   object+ob_Slant
  1328.         clr.w   object+ob_Twist
  1329.         
  1330.         move.b  #1,object+ob_LColor     ;black line
  1331.         move.w  #50,object+ob_LWidth    ;line width (1 point)
  1332.         move.b  #1,object+ob_LType      ;line type = solid
  1333.         
  1334.         move.b  #1,object+ob_FColor     ;solid black fill
  1335.         move.b  #0,object+ob_FType      ;fill type 0 = none
  1336.         
  1337.         clr.b   object+ob_LBegin
  1338.         clr.b   object+ob_LEnd
  1339.         clr.w   object+ob_HStandOff   
  1340.         clr.w   object+ob_VStandOff
  1341.         
  1342.         rts
  1343.  
  1344. ***************************
  1345. ***                     ***
  1346. ***************************
  1347. adjcoords:                              ;a0 = start address
  1348.         move.l  object+ob_Left,d1       ;d0 = number of 'commands'
  1349.         move.l  object+ob_Top,d2
  1350.         move.l  d0,saved0
  1351.         move.l  a0,savea0
  1352.         bra     adjc3
  1353.         
  1354. adjc1:  move.w  (a0)+,d3
  1355.         cmp.w   #STROKEPATH,d3          ;skip STROKEPATH
  1356.         beq     adjc3
  1357.         
  1358.         cmp.w   #FILLPATH,d3            ;skip FILLPATH
  1359.         beq     adjc3    
  1360.         
  1361.         cmp.w   #NEWPATH,d3             ;skip NEWPATH
  1362.         beq     adjc3
  1363.         
  1364.         cmp.w   #CLOSEPATH,d3           ;skip CLOSEPATH
  1365.         beq     adjc3
  1366.         
  1367.         cmp.w   #CURVETO,d3
  1368.         beq     adjc2
  1369.         
  1370.         sub.l   d1,(a0)+                ;LINETO & MOVETO have 1 point
  1371.         sub.l   d2,(a0)+
  1372.         bra     adjc3
  1373.         
  1374. adjc2:  sub.l   d1,(a0)+                ;CURVETO has 3 points
  1375.         sub.l   d2,(a0)+
  1376.         sub.l   d1,(a0)+
  1377.         sub.l   d2,(a0)+
  1378.         sub.l   d1,(a0)+
  1379.         sub.l   d2,(a0)+
  1380.         
  1381. adjc3:  dbf     d0,adjc1
  1382.  
  1383.         btst    #0,flag2
  1384.         beq     adjc10
  1385.  
  1386.         move.l  saved0,d0
  1387.         move.l  savea0,a0
  1388.         move.l  object+ob_Right,d1
  1389.         sub.l   object+ob_Left,d1
  1390.         bra     adjc6
  1391.  
  1392. adjc4:  move.w  (a0)+,d3                ;get the command
  1393.         
  1394.         cmp.w   #STROKEPATH,d3          ;skip STROKEPATH
  1395.         beq     adjc6
  1396.         
  1397.         cmp.w   #FILLPATH,d3            ;skip FILLPATH
  1398.         beq     adjc6   
  1399.         
  1400.         cmp.w   #NEWPATH,d3             ;skip NEWPATH
  1401.         beq     adjc6
  1402.         
  1403.         cmp.w   #CLOSEPATH,d3           ;skip CLOSEPATH
  1404.         beq     adjc6
  1405.         
  1406.         cmp.w   #CURVETO,d3
  1407.         beq     adjc5
  1408.         
  1409.         move.l  d1,d2                    ;adjust the X coord
  1410.         sub.l   (a0),d2
  1411.         move.l  d2,(a0)+
  1412.         add.l   #4,a0                    ;skip over the Y coord
  1413.         
  1414.         bra     adjc6
  1415.         
  1416. adjc5:  move.l  d1,d2                    ;adjust the X coord
  1417.         sub.l   (a0),d2
  1418.         move.l  d2,(a0)+
  1419.         add.l   #4,a0                    ;skip over the Y coord
  1420.  
  1421.         move.l  d1,d2                    ;adjust the X coord
  1422.         sub.l   (a0),d2
  1423.         move.l  d2,(a0)+
  1424.         add.l   #4,a0                    ;skip over the Y coord
  1425.  
  1426.         move.l  d1,d2                    ;adjust the X coord
  1427.         sub.l   (a0),d2
  1428.         move.l  d2,(a0)+
  1429.         add.l   #4,a0                    ;skip over the Y coord        
  1430.         
  1431. adjc6:  dbf     d0,adjc4
  1432.         
  1433. adjc10: btst    #1,flag2
  1434.         beq     adjc20
  1435.         
  1436.         move.l  saved0,d0
  1437.         move.l  savea0,a0
  1438.         
  1439.         move.l  object+ob_Bottom,d1
  1440.         sub.l   object+ob_Top,d1
  1441.         bra     adjc19
  1442.  
  1443. adjc11: move.w  (a0)+,d3                ;get the command
  1444.         
  1445.         cmp.w   #STROKEPATH,d3          ;skip STROKEPATH
  1446.         beq     adjc19
  1447.         
  1448.         cmp.w   #FILLPATH,d3            ;skip FILLPATH
  1449.         beq     adjc19   
  1450.         
  1451.         cmp.w   #NEWPATH,d3             ;skip NEWPATH
  1452.         beq     adjc19
  1453.         
  1454.         cmp.w   #CLOSEPATH,d3           ;skip CLOSEPATH
  1455.         beq     adjc19
  1456.         
  1457.         cmp.w   #CURVETO,d3
  1458.         beq     adjc12
  1459.         
  1460.         ;add.l   #4,a0                    ;skip over the X coord
  1461.         ;move.l  d1,d2                    ;adjust the Y coord
  1462.         ;sub.l   (a0),d2
  1463.         ;move.l  d2,(a0)+
  1464.         
  1465.         add.l   #4,a0
  1466.         move.l  (a0),d2
  1467.         neg.l   d2
  1468.         add.l   d1,d2
  1469.         move.l  d2,(a0)+
  1470.         bra     adjc19
  1471.         
  1472. adjc12: add.l   #4,a0                    ;skip over the X coord
  1473.         ;move.l  d1,d2                    ;adjust the Y coord
  1474.         ;sub.l   (a0),d2
  1475.         ;move.l  d2,(a0)+
  1476.         move.l  (a0),d2
  1477.         neg.l   d2
  1478.         add.l   d1,d2
  1479.         move.l  d2,(a0)+
  1480.         
  1481.         add.l   #4,a0                    ;skip over the X coord
  1482.         ;move.l  d1,d2                    ;adjust the Y coord
  1483.         ;sub.l   (a0),d2
  1484.         ;move.l  d2,(a0)+
  1485.         move.l  (a0),d2
  1486.         neg.l   d2
  1487.         add.l   d1,d2
  1488.         move.l  d2,(a0)+
  1489.         
  1490.         add.l   #4,a0                    ;skip over the X coord
  1491.         ;move.l  d1,d2                    ;adjust the Y coord
  1492.         ;sub.l   (a0),d2
  1493.         ;move.l  d2,(a0)+
  1494.         move.l  (a0),d2
  1495.         neg.l   d2
  1496.         add.l   d1,d2
  1497.         move.l  d2,(a0)+
  1498.         
  1499. adjc19: dbf     d0,adjc11        
  1500.         
  1501. adjc20: rts
  1502.  
  1503.  
  1504. ***********************************
  1505. ***                ***
  1506. ***********************************
  1507. adjobj:
  1508.         btst    #0,flag2
  1509.         beq     adjo1
  1510.         
  1511.         move.l  object+ob_Right,d1
  1512.         move.l  object+ob_Left,object+ob_Right
  1513.         move.l  d1,object+ob_Left
  1514.         
  1515.         move.l  xleft,d1
  1516.         sub.l   xright,d1
  1517.         move.l  object+ob_Left,d2
  1518.         neg.l   d2
  1519.         add.l   d1,d2
  1520.         move.l  d2,object+ob_Left
  1521.         
  1522.         move.l  object+ob_Right,d2
  1523.         neg.l   d2
  1524.         add.l   d1,d2
  1525.         move.l  d2,object+ob_Right
  1526.                 
  1527. adjo1:  btst    #1,flag2
  1528.         beq     adjo2
  1529.         
  1530.         move.l  object+ob_Top,d1
  1531.         move.l  object+ob_Bottom,object+ob_Top
  1532.         move.l  d1,object+ob_Bottom
  1533.         
  1534.         move.l  ytop,d1
  1535.         sub.l   ybottom,d1
  1536.         move.l  object+ob_Top,d2
  1537.         neg.l   d2
  1538.         add.l   d1,d2
  1539.         move.l  d2,object+ob_Top
  1540.         
  1541.         move.l  object+ob_Bottom,d2
  1542.         neg.l   d2
  1543.         add.l   d1,d2
  1544.         move.l  d2,object+ob_Bottom
  1545.         
  1546. adjo2:  rts
  1547.         
  1548. ***********************************
  1549. ***                ***
  1550. ***********************************
  1551. addcolor:
  1552.         movem.l a0/a1,-(sp)
  1553.         move.l  d0,d1
  1554.         move.l  d0,curcolor             ;save for getcolorname
  1555.         clr.l   d0                      ;init pgs color to zero
  1556.         
  1557.         tst.l   cmyktab                 ;is there a cmyk definition ?
  1558.         beq     addc0                   ;no, so check for a rgb def
  1559.         and.l   #$0000ffff,d1
  1560.         clr.l   d4
  1561.         mulu    #5,d1
  1562.         move.w  d1,d4
  1563.         move.l  cmyktab,a0
  1564.         move.l  (a0),a0
  1565.         move.b  0(a0,d4.w),d0
  1566.         tst.b   d0                      ;has this color been added already?
  1567.         bne     addc6                   ;yes, so get out d0=pgs color #
  1568.         
  1569.         move.w  d4,-(sp)                ;save color code for later
  1570.         
  1571.         clr.l   d0
  1572.         clr.l   d1
  1573.         clr.l   d2
  1574.         clr.l   d3
  1575.         move.b  1(a0,d4.w),d0           ;cyan
  1576.         move.b  2(a0,d4.w),d1           ;magenta
  1577.         move.b  3(a0,d4.w),d2           ;yellow
  1578.         move.b  4(a0,d4.w),d3           ;black
  1579.         move.b  d0,cyan
  1580.         move.b  d1,magenta
  1581.         move.b  d2,yellow
  1582.         move.b  d3,black
  1583.         
  1584.         mulu    #10000,d0               ;scale 0-255 cmyk to 0-10000 cmyk
  1585.         divu    #255,d0
  1586.         mulu    #10000,d1
  1587.         divu    #255,d1
  1588.         mulu    #10000,d2
  1589.         divu    #255,d2
  1590.         mulu    #10000,d3
  1591.         divu    #255,d3
  1592.         
  1593.         bra     addc4                   ;add the color from the cmyk defs
  1594.         
  1595. addc0:  tst.l   cmaptab                 ;is there a rgb cmap definition?
  1596.         beq     addc6                   ;no, so use default color
  1597.         and.l   #$0000ffff,d1
  1598.         clr.l   d4
  1599.         lsl.w   #2,d1
  1600.         move.w  d1,d4
  1601.         move.l  cmaptab,a0
  1602.         move.l  (a0),a0
  1603.         move.b  0(a0,d4.w),d0          
  1604.         tst.b   d0                      ;has this color been added already?
  1605.         bne     addc6                   ;yes, so get out d0=pgs color #
  1606.         
  1607.         move.w  d4,-(sp)                ;save color code for later
  1608.         
  1609.         clr.l   d0
  1610.         clr.l   d1
  1611.         clr.l   d2
  1612.         clr.l   d3
  1613.         move.b  1(a0,d4.w),d0           ;red
  1614.         move.b  2(a0,d4.w),d1           ;green
  1615.         move.b  3(a0,d4.w),d2           ;blue
  1616.         move.b  d0,red
  1617.         move.b  d1,green
  1618.         move.b  d2,blue
  1619.         
  1620.         mulu    #10000,d0               ;scale 0-255 rgb to 0-10000 rgb
  1621.         divu    #255,d0
  1622.         mulu    #10000,d1
  1623.         divu    #255,d1
  1624.         mulu    #10000,d2
  1625.         divu    #255,d2
  1626.         
  1627. addc03: move.w  d0,d3                   ;find largest rgb value (in d3)
  1628.         cmp.w   d3,d1
  1629.         bls     addc1
  1630.         move.w  d1,d3
  1631. addc1:  cmp.w   d3,d2
  1632.         bls     addc2
  1633.         move.w  d2,d3
  1634. addc2:  tst.w   d3                      ;is the largest value 0?
  1635.         bne     addc3
  1636.         clr.w   d0
  1637.         clr.w   d1
  1638.         clr.w   d2
  1639.         move.w  #10000,d3
  1640.         bra     addc4
  1641.         
  1642. addc3:  mulu    #10000,d0
  1643.         divu    d3,d0
  1644.         mulu    #10000,d1
  1645.         divu    d3,d1
  1646.         mulu    #10000,d2
  1647.         divu    d3,d2
  1648.         
  1649. addc32: neg.w   d0
  1650.         add.w   #10000,d0
  1651.  
  1652.         neg.w   d1
  1653.         add.w   #10000,d1
  1654.  
  1655.         neg.w   d2
  1656.         add.w   #10000,d2
  1657.  
  1658.         neg.w   d3
  1659.         add.w   #10000,d3
  1660.  
  1661. addc4:  move.w  d0,color+cl_Cyan
  1662.         move.w  d1,color+cl_Magenta
  1663.         move.w  d2,color+cl_Yellow
  1664.         move.w  d3,color+cl_Black
  1665.         clr.w   color+cl_Type
  1666.         clr.w   color+cl_Map
  1667.  
  1668.         bsr     getcolorname
  1669.  
  1670.         move.l  colorname,a0            ;copy the color name into cl_Name
  1671.         
  1672.         lea     color+cl_Name,a1
  1673.         move.w  #21,d0
  1674. addc5:  move.b  (a0)+,(a1)+
  1675.         dbf     d0,addc5
  1676.         clr.b   (a1)+                   ;null terminate it
  1677.       
  1678.         lea     color,a0                ;add the color to the global color tab
  1679.         move.l  table,a1
  1680.         move.l  newcolor(a1),a1
  1681.         jsr     (a1)
  1682.         move.l  d0,saved0
  1683.         
  1684.         lea     color,a0                ;add the color to the doc color tab
  1685.         move.l  table,a1
  1686.         move.l  findcolorname(a1),a1
  1687.         jsr     (a1)
  1688.         cmp.w   #$ffff,d0
  1689.         bne     addc51
  1690.         
  1691.         move.l  saved0,d0
  1692.         
  1693. addc51: move.w  (sp)+,d1
  1694.         tst.l   cmyktab                 ;is there a cmyk definition?
  1695.         beq     addc52                  ;no
  1696.         move.l  cmyktab,a0
  1697.         bra     addc53
  1698. addc52: move.l  cmaptab,a0              ;use the rgb definition
  1699. addc53: move.l  (a0),a0
  1700.         move.b  d0,0(a0,d1.w)           ;store the pgscolor in the colortab
  1701.  
  1702. addc6:  movem.l (sp)+,a0/a1
  1703.         rts
  1704.  
  1705. ***********************************
  1706. ***                ***
  1707. ***********************************
  1708. getcolorname:
  1709.         tst.l   cnamtab                 ;is there a cnam chunk to use?
  1710.         beq     gcn10                   ;no
  1711.         move.l  cnamtab,a0
  1712.         move.l  (a0),a0
  1713.         move.l  curcolor,d0
  1714.         lsl.l   #2,d0
  1715.         add.l   d0,a0
  1716.         move.l  (a0),a0                 ;get mem handle for color name pointer
  1717.         move.l  (a0),colorname          ;set it up and rts
  1718.         bra     gcn30
  1719.         
  1720. gcn10:  tst.l   cmyktab                 ;is there a cmyk definition?
  1721.         beq     gcn20                   ;no
  1722.         move.b  cyan,d0                  ;set up colorname for rgb definition
  1723.         bsr     hex2ascii
  1724.         move.b  d0,defcolorname+4
  1725.         move.b  d1,defcolorname+5
  1726.         move.b  magenta,d0
  1727.         bsr     hex2ascii
  1728.         move.b  d0,defcolorname+6
  1729.         move.b  d1,defcolorname+7
  1730.         move.b  yellow,d0
  1731.         bsr     hex2ascii
  1732.         move.b  d0,defcolorname+8
  1733.         move.b  d1,defcolorname+9
  1734.         move.b  black,d0
  1735.         bsr     hex2ascii
  1736.         move.b  d0,defcolorname+10
  1737.         move.b  d1,defcolorname+11
  1738.         clr.b   defcolorname+12
  1739.         lea     defcolorname,a0         ;set the colorname to the default name
  1740.         move.l  a0,colorname
  1741.         bra     gcn30
  1742.         
  1743. gcn20:  tst.l   cmaptab                 ;is there a rgb definition?
  1744.         beq     gcn30                   ;no
  1745.         move.b  red,d0                  ;set up colorname for rgb definition
  1746.         bsr     hex2ascii
  1747.         move.b  d0,defcolorname+4
  1748.         move.b  d1,defcolorname+5
  1749.         move.b  green,d0
  1750.         bsr     hex2ascii
  1751.         move.b  d0,defcolorname+6
  1752.         move.b  d1,defcolorname+7
  1753.         move.b  blue,d0
  1754.         bsr     hex2ascii
  1755.         move.b  d0,defcolorname+8
  1756.         move.b  d1,defcolorname+9
  1757.         clr.b   defcolorname+10
  1758.         lea     defcolorname,a0         ;set the colorname to the default name
  1759.         move.l  a0,colorname
  1760.         
  1761. gcn30:  rts
  1762.         
  1763. ***********************************
  1764. ***                ***
  1765. ***********************************
  1766. hex2ascii:
  1767.         move.b  d0,d1
  1768.         and.b   #$f0,d0                 ;d0 = upper nibble
  1769.         lsr.b   #4,d0
  1770.         and.b   #$0f,d1                 ;d1 = lower nibble
  1771.         
  1772.         cmp.b   #$0a,d0                 ;is d0 greater or equal to 10
  1773.         bcc     h2a1                    ;yes
  1774.         or.b    #$30,d0                 ;if not make it into the ascii of 0-9
  1775.         bra     h2a2
  1776. h2a1:   add.b   #55,d0                  ;make it ascii A-F
  1777.  
  1778. h2a2:   cmp.b   #$0a,d1
  1779.         bcc     h2a3
  1780.         or.b    #$30,d1
  1781.         bra     h2a4
  1782. h2a3:   add.b   #55,d1
  1783.  
  1784. h2a4:   rts
  1785.  
  1786. ***********************************
  1787. ***                ***
  1788. ***********************************
  1789. putcnam:
  1790.         move.l  end,d0                  ;d0 = number of names to deal with
  1791.         sub.l   start,d0
  1792.         
  1793.         move.l  cnamtab,a0              ;find the starting index pointer - a0
  1794.         move.l  (a0),a0
  1795.         move.l  start,d1
  1796.         lsl.l   #2,d1
  1797.         add.l   d1,a0
  1798.         
  1799.         move.l  cnamchunk,a1            ;get the pointer to the chunk data in a1
  1800.         move.l  (a1),a1
  1801.         
  1802. pcn0:   clr.l   d1                      ;get the length of the string into d1
  1803.         move.l  a1,a2
  1804. pcn1:   tst.b   (a2)+
  1805.         beq     pcn2
  1806.         addq    #1,d1
  1807.         bra     pcn1
  1808.  
  1809. pcn2:   bsr     getmem                  ;allocate d1 +1 bytes - return in a2
  1810.         move.l  a2,(a0)+                ;store in table & move to next slot
  1811.         
  1812.         move.l  (a2),a2                 ;strcpy into the table space
  1813. pcn3:   move.b  (a1)+,(a2)+
  1814.         dbf     d1,pcn3
  1815.         
  1816.         dbf     d0,pcn0
  1817.         rts
  1818.         
  1819. ***********************************
  1820. ***                ***
  1821. ***********************************
  1822. getmem:
  1823.         movem.l d0-d1/a0-a1,-(sp)
  1824.         move.l  d1,d0
  1825.         addq    #1,d0
  1826.         clr.l   d1
  1827.         clr.l   d2
  1828.         move.l  table,a0
  1829.         move.l  m_alloc(a0),a0
  1830.         jsr     (a0)
  1831.         beq     errrts
  1832.         move.l  a0,a2
  1833.         movem.l (sp)+,d0-d1/a0-a1
  1834.         rts
  1835.         
  1836. ***********************************
  1837. ***                ***
  1838. ***********************************
  1839. errrts:
  1840.         bsr     freemem
  1841.         move.l    savesp,sp
  1842.         jmp     abortobj
  1843.         
  1844. ***********************************
  1845. ***                ***
  1846. ***********************************
  1847. freemem:
  1848.         tst.l   cmaptab                 ;is there a cmaptab to delete?
  1849.         beq     fm1                     ;no
  1850.         move.l  cmaptab,a0
  1851.         move.l  table,a1
  1852.         move.l  m_delete(a1),a1
  1853.         jsr     (a1)
  1854.         
  1855. fm1:    tst.l   cmyktab                 ;is there a cmyktab to delete?
  1856.         beq     fm2                     ;no
  1857.         move.l  cmyktab,a0
  1858.         move.l  table,a1
  1859.         move.l  m_delete(a1),a1
  1860.         jsr     (a1)
  1861.         
  1862. fm2:    tst.l   cnamtab                 ;is there a cnamtab to delete?
  1863.         beq     fm3                     ;no
  1864.         
  1865.         ;free pointers in table
  1866.         move.w  numcolors,tempw1
  1867.         move.l  cnamtab,a2
  1868.         move.l  (a2),a2
  1869.         
  1870. fm20:   move.l  (a2)+,d0                ;get the next pointer to free
  1871.         beq     fm21                    ;is it zero? yes,so go to the next one
  1872.         move.l  d0,a0
  1873.         move.l  a2,-(sp)
  1874.         move.l  table,a1
  1875.         move.l  m_delete(a1),a1
  1876.         jsr     (a1)
  1877.         move.l  (sp)+,a2
  1878. fm21:   sub.w   #1,tempw1
  1879.         bne     fm20
  1880.         
  1881.         move.l  cnamtab,a0              ;free the table of pointers itself
  1882.         move.l  table,a1
  1883.         move.l  m_delete(a1),a1
  1884.         jsr     (a1)
  1885.  
  1886. fm3:    rts
  1887.  
  1888. *******************************************************************
  1889. ***    called when the import routine choosen finds something    ***
  1890. ***    wrong with the file loaded.                ***
  1891. *******************************************************************
  1892. never:    clr.w    d0
  1893.     rts
  1894.  
  1895. maybe:    move.w    #1,d0
  1896.     rts
  1897.  
  1898. right:    move.w    #2,d0
  1899.     rts
  1900.  
  1901.  
  1902. *************************************************************
  1903. *************************************************************
  1904.  SECTION DR2D,DATA,PUBLIC
  1905.  
  1906. chunks: dc.l    "ATTR",attr
  1907.         dc.l    "AROW",arow
  1908.         dc.l    "BBOX",bbox
  1909.         dc.l    "CMAP",cmap
  1910.         dc.l    "CMYK",cmyk
  1911.         dc.l    "CNAM",cnam
  1912.         dc.l    "CPLY",cply
  1913.         dc.l    "DASH",dash
  1914.         dc.l    "DRHD",drhd
  1915.         dc.l    "FILL",fill
  1916.         dc.l    "FONS",fons
  1917.         dc.l    "FORM",form
  1918.         dc.l    "GRUP",grup
  1919.         dc.l    "OPLY",oply
  1920.         dc.l    "PPRF",pprf
  1921.         dc.l    "STXT",stxt
  1922.         dc.l    0,skip
  1923.                 
  1924. numchunks:      
  1925.         dc.w    16
  1926.  
  1927. special:
  1928.     dc.w    1
  1929.     dc.l    spcl1
  1930.  
  1931. version:        dc.b    0,"$VER: "
  1932. name:            dc.b    "IFF DR2D v2.1.5",0
  1933.  
  1934. spcl1:    dc.b    "Object",0
  1935.  
  1936. inch:   dc.b    "Units=Inch",0
  1937. pica:   dc.b    "Units=Pica",0
  1938. cm:     dc.b    "Units=Cm",0
  1939.  
  1940. defcolorname:   dc.b    "DR2D",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  1941.  
  1942. serifflag:      dc.b    0
  1943.  
  1944.  
  1945. ******************************************************************
  1946. ******************************************************************
  1947.  SECTION DR2D,BSS,PUBLIC
  1948.  
  1949. savesp:        ds.l    1
  1950. length:        ds.l    1
  1951. clength:    ds.l    1
  1952. temp:        ds.l    1
  1953. object:        ds.w    ob_SizeOf/2
  1954. column:         ds.w    cm_Sizeof/2
  1955. color:          ds.w    cl_Sizeof/2
  1956.  
  1957. count:          ds.w    1
  1958. len:            ds.w    1
  1959. flag:           ds.l    1   
  1960. flag2:          ds.l    1
  1961. mptr:           ds.l    1
  1962. pptr:           ds.l    1
  1963. numcom:         ds.w    1
  1964. fillvalue:      ds.w    1
  1965. filltype:       ds.b    1
  1966. jointype:       ds.b    1
  1967. edgepattern:    ds.b    1
  1968. arrowhead:      ds.b    1
  1969. linewidth:      ds.l    1
  1970. edgecolor:      ds.w    1
  1971. numchars:       ds.w    1
  1972. charw:          ds.l    1
  1973. charh:          ds.l    1
  1974. basex:          ds.l    1
  1975. basey:          ds.l    1
  1976. rotation:       ds.l    1
  1977. string:         ds.l    1
  1978. numchars2:      ds.w    1
  1979. aflags:         ds.w    1
  1980. dashid:         ds.w    1
  1981. numdashes:      ds.w    1
  1982. dashtable:      ds.b    256
  1983. arrowtable:     ds.b    256
  1984. buffer:         ds.b    512
  1985. fact1:          ds.l    1
  1986. exp1:           ds.l    1
  1987. fact100:        ds.w    1
  1988. numobjs:        ds.w    1
  1989. gsp:            ds.l    1
  1990. numcolors:      ds.w    1
  1991. tempw1:         ds.w    1
  1992. start:          ds.l    1
  1993. end:            ds.l    1
  1994. red:            ds.b    1
  1995. green:          ds.b    1
  1996. blue:           ds.b    1
  1997. cyan:           ds.b    1
  1998. magenta:        ds.b    1
  1999. yellow:         ds.b    1
  2000. black:          ds.b    1
  2001. white:          ds.b    1
  2002. cmaptab:        ds.l    1
  2003. cmyktab:        ds.l    1
  2004. cnamtab:        ds.l    1
  2005. sign:           ds.w    1
  2006. fontid:         ds.w    1
  2007. prevx:          ds.l    1
  2008. prevy:          ds.l    1
  2009. saveX:          ds.l    1
  2010. saveY:          ds.l    1
  2011. saved0:         ds.l    1
  2012. savea0:         ds.l    1
  2013. xleft:          ds.l    1
  2014. ytop:           ds.l    1
  2015. xright:         ds.l    1
  2016. ybottom:        ds.l    1
  2017. colorname:      ds.l    1
  2018. cnamchunk:      ds.l    1
  2019. curcolor:       ds.l    1
  2020. fonttable:      ds.l    256
  2021.  
  2022. ;***************************** Changes **************************
  2023. ;
  2024. ; version 2.1.5
  2025. ;
  2026. ;       - added a version string, so 'version dr2d.import' will return
  2027. ;         the version number of the module.
  2028. ;
  2029. ;       - added font support - if the font specified in the FONS chunk is 
  2030. ;         available to PageStream it will use it, if not it will use a serif
  2031. ;         or san-serif font (CSTimes or CSTriumvirate) depending on the flag 
  2032. ;         in the FONS chunk.
  2033. ;
  2034. ;       - added support for the new CMYK chunk. The module will use the CMYK
  2035. ;         definition if present, if not it will use the rgb (CMAP) definition
  2036. ;         for the color values.
  2037. ;
  2038. ;       - added support for the new CNAM chunk. The module will use the name
  2039. ;         from the CNAM chunk if present, otherwise it will construct a name
  2040. ;         from the CMYK definition if present, if not, it will construct the 
  2041. ;         name from the rgb (CMAP) definition.
  2042. ;
  2043. ;       - fixed a bug that would cause PgS to crash when the object was pasted.
  2044. ;         this occured because a CPLY was identified as a line at the start of
  2045. ;         the object processing code (it had 2 points) and not at the end - 
  2046. ;         because it was suppose to be filled.
  2047. ;
  2048. ;
  2049. ; version 2.1.4 (uploaded 4/20/91 ?)
  2050. ;
  2051. ;       - fixed bug when placing text objects (stxt chunks). Before it would
  2052. ;         use the baseline as the top of the object, now it uses it as the
  2053. ;         baseline and calculates the top and bottom of the object using the
  2054. ;         baseline as a reference.
  2055. ;
  2056. ;
  2057. ; version 2.1.3  (shipped with PgS2.1 12/7/90)
  2058. ;
  2059. ;       - now handles different coordinate systems (different zero origin)
  2060. ;
  2061. ;
  2062. ; version 2.1.2
  2063. ;
  2064. ;       - fixed color bug that occured when trying to add predefined
  2065. ;         color with a different name (ie. Black = DR2D000000)
  2066. ;
  2067. ;                
  2068. ; version 2.1.1   (uploaded 11/16/90)
  2069. ;
  2070. ;       - fixed bug when first point of the curve is not the same as the
  2071. ;         prev point.
  2072. ;
  2073. ;
  2074. ; version 2.1.0 (needs PgS 2.1.0)
  2075. ;
  2076. ;       - added support for group objects
  2077. ;
  2078. ;       - added suport for color
  2079. ;
  2080. ;       - fixed negative floating point number bug
  2081. ;
  2082. ;       - fixed line width - now no longer divides dr2d line width by 100
  2083. ;
  2084. ;       - fixed text import bug
  2085. ;
  2086. ;       - now detects serif and sanserif text objects
  2087. ;
  2088. ;       - fixed bug in poly stuff - changed tdln dection method
  2089. ;
  2090. ;
  2091. ; version 2.0.1
  2092. ;                               
  2093. ;       - added supported for CURVETO and MOVETO in same case (0x00000003)
  2094. ;       
  2095. ;       - fix bug that caused divide by zero error when an old dr2d file
  2096. ;         was imported. this was caused by a lack of pprf chunk. this in
  2097. ;         turn would never set up the conversion factors so they would
  2098. ;         be zero - hence the divide by zero error!. this has been fixed.
  2099. ;
  2100. ;
  2101. ; version 2.0.0
  2102. ;       
  2103. ;       - first release
  2104.