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

  1.  
  2.  Include "equ.h"
  3.  Include "impequ.h"
  4.  
  5.  
  6.  SECTION CLIPS,CODE,PUBLIC
  7.  
  8. ***************************************************
  9. ***                        ***
  10. ***************************************************
  11. dumbentry:
  12.     clr.l    d0
  13.     rts
  14.  
  15.     dc.l    "IMPO"        ; magik number for pic import
  16.     dc.w    201
  17.     dc.l    0
  18.  
  19. table:    dc.l    0
  20.     dc.l    name,special,check,CLIPS
  21.  
  22.  
  23. *********************************
  24. *  Is it really ProDraw Clips?  *
  25. *********************************
  26. check:    move.l    table,a0
  27.     move.l    buff1(a0),a1
  28.     move.l    (a1),a1
  29.     cmp.l    #"PDPF",(a1)
  30.     bne    never
  31.         move.w  #23,d0
  32.         lea     special,a0
  33.         move.w  #1,(a0)                 ;reset special count
  34.         addq.l  #6,a0
  35. check1: clr.l   (a0)+                   ;clear out special table 
  36.         dbf     d0,check1
  37.         bra     getclips        
  38.  
  39. ***********************************
  40. ***                             ***
  41. ***********************************
  42. getclips:
  43.         move.l    table,a1                ;get actual length of file
  44.     move.l    flen(a1),a0
  45.     move.l    (a0),length
  46.         move.l  length,length2          ;save for later
  47.         
  48.         move.l    table,a0
  49.     move.l    f_openr(a0),a0
  50.     jsr    (a0)
  51.     beq    never        
  52.         
  53.         lea     strtab,a0
  54.         move.l  a0,strtabptr
  55.         
  56.         bsr     pgetl           ;skip the first 8 bytes
  57.         bsr     pgetl
  58.         subq.l  #8,length       ;adjust for the previous bytes
  59.  
  60. getclip:
  61.     bsr    pgetl        ;get chunk type in temp
  62.     move.l    d0,temp
  63.     bsr    pgetl           ;get chunk length in clength
  64.     move.l    d0,clength
  65.     subq.l    #8,length       ;sub 8 from length of file left
  66.         move.l  length,d0
  67.         tst.l   clength         ;is there any data in this chunk?
  68.         beq     gt2             ;no
  69.         
  70.     move.l    temp,d0
  71.         cmp.l   #'CLNM',d0      ;did i find a clip name chunk?
  72.         beq     gt1             ;yes!
  73.         bsr     skip
  74.         bra     getclip
  75.         
  76. gt1:    jsr     clnm            ;do clip name chunk stuff
  77.  
  78. gt2:    tst.l    length          ;is there any data left in the CLIP?
  79.         bmi     gt3
  80.     bne    getclip         ;yes - so look for more CLNM chunks
  81.         
  82. gt3:    move.l    table,a0        ;no more data so close file and return
  83.     move.l    f_closer(a0),a0
  84.     jsr    (a0)
  85.         
  86.         bra     right
  87.  
  88.  
  89. ***********************************
  90. ***                             ***
  91. ***********************************
  92. CLIPS:    move.l    sp,savesp
  93.         
  94.         move.l    table,a0
  95.     move.l    f_openr(a0),a0
  96.     jsr    (a0)
  97.     bne    impobj
  98.         
  99.         rts
  100.  
  101.  
  102. *********************************
  103. *                               *
  104. *********************************
  105. impobj:    
  106.         move.l    table,a0
  107.     move.l    o_open(a0),a0
  108.     jsr    (a0)
  109.     beq    abort0
  110.  
  111.         clr.l   flag                    ;set flag to 0
  112.         move.w  #0,coltabindex          ;reset the color tab index to the beg.
  113.         move.l  #76800,xscale
  114.         move.l  #76800,yscale
  115.  
  116.         move.l  table,a0
  117.         move.l  spclnum(a0),a0
  118.         move.w  (a0),clipnum            ;get the clip they want to import
  119.         tst.w   clipnum
  120.         beq     imob0
  121.         
  122.         bset    #2,flag                 ;do only 1 clip
  123.         
  124. imob0:  bsr     getpicinfo
  125.         
  126. imob1:    move.l    table,a0
  127.     move.l    o_close(a0),a0
  128.     jsr    (a0)
  129.  
  130.     move.l    table,a0
  131.     move.l    f_closer(a0),a0
  132.         jsr     (a0)
  133.         rts
  134.  
  135. ***********************************
  136. ***                             ***
  137. ***********************************
  138. abortobj:
  139.     move.l    table,a0
  140.     move.l    o_abort(a0),a0
  141.     jsr    (a0)
  142.  
  143. abort0:    move.l    table,a0
  144.     move.l    f_closer(a0),a0
  145.     jmp    (a0)
  146.  
  147.         
  148. *********************************
  149. *                               *
  150. *********************************
  151. getpicinfo:
  152.         move.l  length2,length  ;get actual length of file
  153.         
  154.         bsr    pgetl        ;"PDPF"
  155.     bsr    pgetl        ;length of clip file (not always correct)
  156.         subq.l  #8,length       ;adjust for prev 8 bytes
  157.  
  158. getchunk:
  159.     bsr    pgetl        ;get chunk type in temp
  160.     move.l    d0,temp
  161.     bsr    pgetl           ;get chunk length in clength
  162.     move.l    d0,clength
  163.     subq.l  #8,length       ;sub 8 from length of file left
  164.         tst.l   clength         ;is there any data in this chunk?
  165.         bne     gc0             ;yes
  166.         
  167.         move.l  temp,d0         ;handle special chunks (0 length) here
  168.         cmp.l   #'CFIN',d0
  169.         beq     cfin
  170.         cmp.l   #'CLIP',d0
  171.         beq     clip
  172.         cmp.l   #'COLR',d0
  173.         beq     colr
  174.         cmp.l   #'OFIN',d0
  175.         beq     ofin
  176.         bra     gc2             ;ignore ones I do not deal with
  177.         
  178. gc0:    move.l    temp,d0
  179.         
  180.     lea    chunks-4,a0     ;get address of chunk table
  181.     move.w    numchunks,d1    ;number of chunks in table
  182.  
  183. gc1:    lea    4(a0),a0        ;get address of next chunk type
  184.     cmp.l    (a0)+,d0        
  185.     dbeq    d1,gc1          ;loop until end of table or a match
  186.         
  187.     move.l    (a0),a0         ;get address of routine to use for this chunk
  188.     jsr    (a0)            ;do it
  189.  
  190. gc2:    tst.l    length          ;is there any data left in the CLIP?
  191.         ;bmi     rrts
  192.     bne    getchunk        ;yes
  193.                 
  194. rrts:    rts                     ;everything is OK
  195.  
  196.  
  197. ***********************************
  198. ***    SPECIAL CHUNK        ***
  199. ***********************************
  200. cfin:   btst    #4,flag                 ;is there a color to be defined still?
  201.         beq     gc2
  202.         
  203.         bsr     addcolor
  204.         bra     gc2
  205.          
  206. ***********************************
  207. ***                ***
  208. ***********************************
  209. cflg:   bsr     skip
  210.         rts
  211.                 
  212. ***********************************
  213. ***    SPECIAL CHUNK       ***
  214. ***********************************
  215. clip:   btst    #2,flag                 ;do i want all or just one obj?
  216.         beq     clip1                   ;all
  217.         
  218.         subq.w  #1,clipnum              ;decrement the clip count
  219.         tst.w   clipnum                 ;have i found the one i want yet?
  220.         bne     clip2                   ;no
  221.         
  222. clip1:  move.l  table,a0
  223.         move.l  o_begingroup(a0),a0
  224.         jsr     (a0)
  225.         
  226. clip2:  ;bset    #7,flag                 ;get the  clips bounding box
  227.         bra     gc2
  228.         
  229. ***********************************
  230. ***    SPECIAL CHUNK       ***
  231. ***********************************
  232. clnm:   lea     special,a2
  233.         addq.l  #6,a2                   ;move a2 to first opening in special
  234.         
  235.         move.w  #25,d0                  ;find next opening in table
  236. clnm1:  tst.l   (a2)+
  237.         beq     clnm2
  238.         dbf     d0,clnm1
  239.         
  240.         bra     skip                    ;skip the data if no more room
  241.               
  242. clnm2:  move.l  strtabptr,a0            ;store the actual addr of the memory 
  243.         move.l  a0,-4(a2)
  244.         
  245.         lea     special,a2
  246.         addq.w  #1,(a2)                 ;add 1 to special count
  247.         
  248.         move.l  clength,d1
  249.         subq.l  #1,d1
  250.         
  251. clnm3:  move.l  a0,-(sp)                ;get name into allocated memory
  252.         move.w  d1,-(sp)
  253.         bsr     pget
  254.         move.w  (sp)+,d1
  255.         move.l  (sp)+,a0
  256.         move.b  d0,(a0)+
  257.         dbf     d1,clnm3
  258.         
  259.         clr.b   (a0)+                    ;null terminate the string
  260.         move.l  a0,strtabptr
  261.         bra     adjlen 
  262.         
  263. ***********************************
  264. ***                ***
  265. ***********************************
  266. cnam:   btst    #4,flag                 ;is there a color to be defined still?
  267.         beq     cnam0                   ;no
  268.         bsr     addcolor
  269.  
  270. cnam0:  lea     colorname,a0
  271.         move.l  clength,d1
  272.         move.w  d1,cnamlen
  273.                 
  274. cnam1:  move.l  a0,-(sp)
  275.         move.w  d1,-(sp)
  276.         bsr     pget
  277.         move.w  (sp)+,d1
  278.         move.l  (sp)+,a0
  279.         move.b  d0,(a0)+
  280.         subq.l  #1,d1
  281.         bne     cnam1
  282.         bra     adjlen
  283.         
  284. ***********************************
  285. ***    SPECIAL CHUNK        ***
  286. ***********************************
  287. colr:   btst    #4,flag                 ;is there a color to be defined still?
  288.         beq     gc2                     ;no
  289.         
  290.         bsr     addcolor
  291.         bra     gc2
  292.         
  293. ***********************************
  294. ***                ***
  295. ***********************************
  296. data:   tst.w   clipnum                 ;have i found the clip i want yet?
  297.         bne     skip                    ;no
  298.         
  299.         btst    #0,flag                 ;do i deal with this obj?
  300.         beq     skip                    ;no
  301.         
  302.         move.l  objtype,d0              ;test for obj types I do deal with
  303.         cmp.l   #'BEZ4',d0              ;is it a BEZ4 obj?
  304.         beq     bez4                    ;yes
  305.  
  306.         cmp.l   #'CIRC',d0              ;is it a CIRC obj
  307.         beq     circ                    ;yes
  308.         
  309.         bra     skip
  310.         
  311. ***********************************
  312. ***                ***
  313. ***********************************        
  314. dbox:   tst.w   clipnum                 ;have i found the clip i want yet?
  315.         bne     skip                    ;no
  316.         
  317.         btst    #5,flag                 ;I am doing a compound obj?
  318.         bne     dbox3                   ;yes, so store this data for later
  319.         
  320.         bsr     xgetppi
  321.         move.l  d0,object+ob_Left
  322.         move.l  d0,leftoffset
  323.         bsr     ygetppi
  324.         move.l  d0,object+ob_Top
  325.         move.l  d0,topoffset
  326.         bsr     xgetppi
  327.         move.l  d0,object+ob_Right
  328.         bsr     ygetppi
  329.         move.l  d0,object+ob_Bottom      
  330.         bra     dbox4
  331.         
  332. dbox3:  bsr     xgetppi
  333.         move.l  d0,leftoffset
  334.         bsr     ygetppi
  335.         move.l  d0,topoffset
  336.         bsr     pgetl
  337.         bsr     pgetl
  338.                 
  339. dbox4:  bra     adjlen
  340.  
  341.         
  342. ***********************************
  343. ***                ***
  344. ***********************************
  345. fill:   tst.w   clipnum
  346.         bne     skip
  347.         
  348.         btst    #5,flag                 ;am I in a compound obj?
  349.         bne     skip                    ;yes!
  350.         
  351.         bsr     pgetw
  352.         move.w  d0,fillcolor
  353.         bsr     pgetw
  354.         move.w  d0,fillflags
  355.         bra     adjlen
  356.         
  357. ***********************************
  358. ***                ***
  359. ***********************************
  360. line:   tst.w   clipnum
  361.         bne     skip
  362.         
  363.         btst    #5,flag                 ;am I im a compound object?
  364.         bne     skip                    ;yes!
  365.                 
  366.         bsr     pget                    ;skip this byte (?)
  367.         bsr     pget                    ;get the color of the object
  368.         lea     colortab,a0
  369.         and.l   #$000000ff,d0           ;get rid of extra garbage
  370.         move.b  0(a0,d0.w),d1
  371.         move.b  d1,object+ob_LColor
  372.         move.b  #1,object+ob_LType
  373.         
  374.         bsr     pget                    ;skip the line join type
  375.         cmp.b   #1,d0
  376.         bne     ln0
  377.         move.b  #2,object+ob_LBegin
  378.         move.b  #2,object+ob_LEnd
  379.         
  380. ln0:    bsr     pget                    ;skip this byte (?)
  381.         bsr     pgetl                   ;get the line weight and scale it
  382.         clr.l   d1
  383.         clr.l   d2
  384.         move.w  #100,d1
  385.         bsr     Mulu1632
  386.         move.w  #1067,d2
  387.         bsr     Divu1648
  388.         move.w  d0,object+ob_LWidth
  389.         
  390.         cmp.l   #8,clength
  391.         beq     line1
  392.         
  393.         move.l  clength,d2
  394.         sub.l   #9,d2
  395.         
  396. line0:  move.w  d2,-(sp)
  397.         bsr     pget
  398.         move.w  (sp)+,d2
  399.         dbf     d2,line0
  400.         
  401. line1:  bra     adjlen
  402.  
  403. ***********************************
  404. ***                ***
  405. ***********************************
  406. obj:    tst.w   clipnum                 ;have i found the clip i want yet?
  407.         bne     skip                    ;no
  408.  
  409.         btst    #5,flag                 ;am I inside a compound object?
  410.         bne     obj0                    ;yes
  411.         bsr     setobjdef               ;set up objects default values
  412.  
  413. obj0:   bsr     pgetl
  414.         move.l  d0,objtype
  415.         cmp.l   #'BEZ4',d0
  416.         bne     obj1
  417.         bset    #0,flag                 ;bit0 - do i deal with the object
  418.         bra     adjlen
  419.         
  420. obj1:   cmp.l   #'CIRC',d0
  421.         bne     obj2
  422.         bset    #0,flag
  423.         bra     adjlen
  424.         
  425. obj2:   bra     adjlen                
  426.  
  427. ***********************************
  428. ***    SPECIAL CHUNK        ***
  429. ***********************************
  430. ofin:   tst.w   clipnum                 ;have i found the clip i want yet?
  431.         bne     gc2                     ;no
  432.         
  433.         move.l  table,a0
  434.         move.l  o_endgroup(a0),a0
  435.         jsr     (a0)
  436.         bra     gc2
  437.  
  438. ***********************************
  439. ***                ***
  440. ***********************************        
  441. oflg:   tst.w   clipnum                 ;have i found the clip i want yet?
  442.         bne     skip                    ;no
  443.         
  444.         bsr     pgetl
  445.         move.l  d0,oflgdata
  446.         bra     adjlen
  447.  
  448. ***********************************
  449. ***                ***
  450. ***********************************
  451. pymc:   bset    #4,flag
  452.         bsr     pgetw
  453.         move.w  d0,yellow
  454.         bsr     pgetw
  455.         move.w  d0,magenta
  456.         bsr     pgetw
  457.         move.w  d0,cyan
  458.         bsr     pgetw
  459.         move.w  d0,black
  460.         bra     adjlen
  461.  
  462. ***********************************
  463. ***                ***
  464. ***********************************
  465. sclf:
  466.         bsr     pgetl
  467.         move.l  d0,xscale
  468.         bsr     pgetl
  469.         move.l  d0,yscale
  470.         bra     adjlen
  471.         
  472. ***********************************
  473. ***                ***
  474. ***********************************
  475. stxt:   tst.w   clipnum
  476.         bne     skip
  477.         
  478.         bsr     pgetl                   ;skip the first 4 long words
  479.         bsr     pgetl
  480.         bsr     pgetl
  481.         bsr     pgetl
  482.         bsr     pgetw
  483.         cmp.w   #$2000,d0               ;the character is in the top
  484.         bne     stxt1                   ;check for a space ($20)
  485.         bclr    #0,flag                 ;do not deal with spaces
  486.         
  487. stxt1:  bra     adjlen
  488.  
  489. ***********************************
  490. ***                ***
  491. ***********************************
  492. vbox:   bsr     skip
  493.         rts
  494.  
  495.  
  496. ***********************************
  497. ***                ***
  498. ***********************************
  499. ymck:   bset    #4,flag                 ;need to define color
  500.         bsr     pgetw
  501.         move.w  d0,yellow
  502.         bsr     pgetw
  503.         move.w  d0,magenta
  504.         bsr     pgetw
  505.         move.w  d0,cyan
  506.         bsr     pgetw
  507.         move.w  d0,black
  508.         bra     adjlen
  509.  
  510.  
  511. ***********************************
  512. ***                ***
  513. ***********************************        
  514. addcolor:
  515.         bclr    #4,flag                 ;color has been defined
  516.         move.w  yellow,d0
  517.         mulu    #10000,d0
  518.         divu    #$3ff,d0
  519.         move.w  d0,color+cl_Yellow
  520.         
  521.         move.w  magenta,d0
  522.         mulu    #10000,d0
  523.         divu    #$3ff,d0
  524.         move.w  d0,color+cl_Magenta
  525.         
  526.         move.w  cyan,d0
  527.         mulu    #10000,d0
  528.         divu    #$3ff,d0
  529.         move.w  d0,color+cl_Cyan
  530.         
  531.         move.w  black,d0
  532.         mulu    #10000,d0
  533.         divu    #$3ff,d0
  534.         move.w  d0,color+cl_Black
  535.         
  536.         clr.w   color+cl_Type
  537.         clr.w   color+cl_Map
  538.         
  539.         lea     colorname,a0            ;copy the color name into cl_Name
  540.         lea     color+cl_Name,a1
  541.         move.w  cnamlen,d0
  542.         subq.b  #1,d0
  543.         cmp.w   #24,d0                  ;can only have a 24 char name
  544.         bcs     addc1
  545.         move.w  #23,d0
  546. addc1:  move.b  (a0)+,(a1)+
  547.         dbf     d0,addc1
  548.       
  549.         clr.b   (a1)                    ;null terminate name
  550.         lea     color,a0
  551.         move.l  table,a1
  552.         move.l  newcolor(a1),a1
  553.         jsr     (a1)
  554.         move.l  d0,saved0
  555.         
  556.         lea     color,a0
  557.         move.l  table,a1
  558.         move.l  findcolorname(a1),a1
  559.         jsr     (a1)
  560.         cmp.w   #$ffff,d0
  561.         bne     addc2
  562.         
  563.         move.l  saved0,d0
  564.  
  565. addc2:  move.w  coltabindex,d1
  566.         lea     colortab,a1
  567.         move.b  d0,0(a1,d1.w)           ;store pgs color equiv
  568.         addq.w  #1,coltabindex
  569.         rts
  570.         
  571. ***********************************
  572. ***                ***
  573. ***********************************
  574. skip:    move.l    clength,d0
  575.     add.l    #1,d0
  576.     bclr    #0,d0
  577.     sub.l    d0,length
  578.  
  579. sk1:    move.l    d0,-(sp)
  580.     bsr    pgetw
  581.     move.l    (sp)+,d0
  582.     sub.l    #2,d0
  583.     bgt    sk1
  584.     rts
  585.  
  586.         
  587. ***********************************
  588. ***                ***
  589. ***********************************
  590. adjlen:    move.l    clength,d0
  591.     btst    #0,d0
  592.     beq    al1
  593.     bsr    pget
  594.     move.l    clength,d0
  595.     add.l    #1,d0
  596.  
  597. al1:    sub.l    d0,length
  598.     rts
  599.  
  600. *********************************
  601. *                               *
  602. *********************************
  603. pgetl:    move.l    table,a1
  604.     move.l    f_getl(a1),a1
  605.     jsr    (a1)
  606.     beq    errrts
  607.     rts
  608.  
  609. *********************************
  610. *                               *
  611. *********************************
  612. pgetw:    move.l    table,a1
  613.     move.l    f_getw(a1),a1
  614.     jsr    (a1)
  615.     beq    errrts
  616.         and.l   #$0000ffff,d0           ;clean up d0
  617.     rts
  618.  
  619. *********************************
  620. *                               *
  621. *********************************
  622. pget:    move.l    table,a1
  623.     move.l    f_get(a1),a1
  624.     jsr    (a1)
  625.     beq    errrts
  626.         and.l   #$000000ff,d0           ;clean up d0
  627.     rts
  628.  
  629. ***********************************
  630. ***                             ***
  631. ***********************************
  632. xgetppi:
  633.         movem.l a0/a1,-(sp)
  634.         bsr     pgetl
  635.         btst    #31,d0
  636.         beq     xgt1
  637.         neg.l   d0
  638.         move.l  #7200,d1
  639.         bsr     Muls1632
  640.         move.l  xscale,d2
  641.         bsr     Divs3248
  642.         neg.l   d0
  643.         bra     xgt2
  644.  
  645. xgt1:   move.l  #7200,d1
  646.         bsr     Muls1632
  647.         move.l  xscale,d2
  648.         bsr     Divs3248
  649.  
  650. xgt2:   movem.l (sp)+,a0/a1
  651.         rts
  652.  
  653.  
  654. ***********************************
  655. ***                             ***
  656. ***********************************
  657. ygetppi:
  658.         movem.l a0/a1,-(sp)
  659.         bsr     pgetl
  660.         btst    #31,d0
  661.         beq     ygt1
  662.         neg.l   d0
  663.         move.l  #7200,d1
  664.         bsr     Muls1632
  665.         move.l  yscale,d2
  666.         bsr     Divs3248
  667.         neg.l   d0
  668.         bra     ygt2
  669.         
  670. ygt1:   move.l  #7200,d1
  671.         bsr     Muls1632
  672.         move.l  yscale,d2
  673.         bsr     Divs3248
  674.         
  675. ygt2:   movem.l (sp)+,a0/a1
  676.         rts
  677.  
  678. ***********************************
  679. ***                             ***
  680. ***********************************
  681. getppix:
  682.         bsr     xgetppi
  683.         
  684.         btst    #5,flag
  685.         beq     gtpix1
  686.         
  687.         move.l  leftoffset,d1
  688.         add.l   d1,d0
  689.         ;sub.l   object+ob_Left,d0
  690.         bsr     checkLR
  691.         
  692.         btst    #31,d0
  693.         beq     gtpix2
  694.         clr.l   d0
  695.         bra     gtpix2
  696.         
  697. gtpix1: bsr     checkR
  698.  
  699. gtpix2: rts
  700.        
  701. ***********************************
  702. ***                             ***
  703. ***********************************
  704. getppiy:
  705.         bsr     ygetppi
  706.         
  707.         btst    #5,flag
  708.         beq     gtpiy1
  709.         
  710.         move.l  topoffset,d1
  711.         add.l   d1,d0
  712.         ;sub.l   object+ob_Top,d0
  713.         bsr     checkTB
  714.         
  715.         btst    #31,d0
  716.         beq     gtpiy2
  717.         clr.l   d0
  718.         bra     gtpiy2
  719.         
  720. gtpiy1: bsr     checkB
  721.  
  722. gtpiy2: rts
  723.         
  724. ***************************
  725. ***                     ***
  726. ***************************
  727. putobj:    move.l    table,a1
  728.     move.l    o_obj(a1),a1
  729.     lea    object,a0
  730.     jsr    (a1)
  731.         beq     errrts
  732.                 
  733.         rts
  734.         
  735. ***************************
  736. ***                     ***
  737. ***************************
  738. setobjdef:
  739.         clr.b   object+ob_Flag
  740.         clr.w   object+ob_Slant
  741.         clr.w   object+ob_Twist
  742.         
  743.         move.b  #1,object+ob_LColor     ;black line
  744.         move.b  #1,object+ob_LType      ;line type = solid
  745.         move.w  #50,object+ob_LWidth    ;line width (0.5 point)
  746.         
  747.         move.b  #1,object+ob_FColor     ;set color to black
  748.         move.b  #0,object+ob_FType      ;fill type 0 = none
  749.         
  750.         clr.b   object+ob_LBegin
  751.         clr.b   object+ob_LEnd
  752.         clr.w   object+ob_HStandOff   
  753.         clr.w   object+ob_VStandOff
  754.         rts
  755.  
  756.    
  757. ***********************************
  758. ***                ***
  759. ***********************************        
  760. bez4:   
  761.         bclr    #0,flag                 ;clear the ok obj flag for next obj
  762.         bsr     pgetw                   ;skip this word (number of things)
  763.         move.l  clength,d0
  764.         subq.l  #2,d0
  765.         lsr.l   #3,d0                   ;divide by 8 to get number of points
  766.         move.w  d0,count
  767.         clr.l   prevptx                 ;clear the previous point
  768.         clr.l   prevpty
  769.         clr.l   prevctx                 ;clear the previous control point
  770.         clr.l   prevcty
  771.         clr.w   curvecount              ;clear the CURVETO counter
  772.         
  773.     mulu    #20,d0                ;max bytes per line = 20, min = 10
  774.         
  775.         move.l  oflgdata,d1             ;is this the start of a compound obj?
  776.         btst    #13,d1
  777.         bne     bez0                    ;yes!
  778.         
  779.         btst    #5,flag                 ;am I doing a compound object?
  780.         beq     bez01                   ;no
  781.         
  782.         move.l  mptr,a0                 ;get address of memory into a0
  783.         move.l  table,a1                ;d0 = amount to grow by (see above)
  784.         move.l  m_grow(a1),a1
  785.         jsr     (a1)
  786.         beq     errrts                  ;get out if could not get memory
  787.         
  788.         move.l  mptr,a0
  789.         move.l  (a0),a0
  790.         add.l   len,a0                  ;set a0 to end of last object
  791.         move.l  a0,pptr
  792.         bclr    #1,flag                 ;set first point flag to NOT FOUND
  793.         bset    #6,flag                 ;set up to use leftoffset and topoffset        
  794.         bra     bez10                   ;start doing next set of points
  795.         
  796. bez0:   bset    #5,flag                 ;set up flag for a compound object
  797.         bset    #6,flag
  798.         
  799. bez01:  btst    #3,flag                 ;is this a close poly?
  800.         bne     bez1                    ;yes
  801.         tst.w   fillflags               ;is the oply filled?
  802.         bne     bez1                    ;yes
  803.         
  804.         add.l   #ply_Sizeof+4,d0        ;4 = newpath+strokepath
  805.         bra     bez2
  806.         
  807. bez1:   add.l    #ply_Sizeof+6,d0    ;6 = new+close+(fill or stroke)
  808.  
  809. bez2:    clr.w    d1                      ;m_alloc memory for object data
  810.     clr.w    d2
  811.     move.l    table,a0
  812.     move.l    m_alloc(a0),a0
  813.     jsr    (a0)
  814.     beq    errrts
  815.  
  816.     move.l    a0,mptr
  817.     move.l    (a0),a4
  818.     lea    ply_Sizeof(a4),a4
  819.     move.l    a4,pptr
  820.  
  821.         move.b  #tpoly,object+ob_Type
  822.         move.w  count,d0
  823.         move.l  pptr,a0
  824.         move.w  #NEWPATH,(a0)+
  825.         bclr    #1,flag                 ;clear first point flag - not found
  826.         move.l  #ply_Sizeof+2,len       ;set starting length of poly stuff
  827.         move.w  #1,numcom               ;set poly command counter to 1
  828.         
  829. bez10:  clr.l   d7
  830.  
  831.         btst    #1,flag                 ;is this the first point?
  832.         bne     bez14                   ;no
  833.                   
  834. bez13:  move.w  #MOVETO,(a0)+
  835.         bsr     getppix
  836.         move.l  d0,(a0)+
  837.         bsr     getppiy
  838.         move.l  d0,(a0)+
  839.         
  840.         bsr     getppix                  ;skip the first point
  841.         bsr     getppiy
  842.         
  843.         move.w  #CURVETO,(a0)+          ;bezier curve - first control point
  844.         bsr     getppix
  845.         move.l  d0,(a0)+
  846.         bsr     getppiy
  847.         move.l  d0,(a0)+
  848.         
  849.         subq.w  #2,count
  850.         add.l   #10,len                 ;add in for moveto command
  851.         addq.w  #1,numcom
  852.         bset    #1,flag                 ;I found the first point
  853.         bra     bez15
  854.         
  855. bez14:  move.w  #CURVETO,(a0)+          ;bezier curve - first control point
  856.         bsr     getppix
  857.         move.l  d0,(a0)+
  858.         bsr     getppiy
  859.         move.l  d0,(a0)+
  860.  
  861. bez15:  bsr     getppix                 ;get the end point of the curve
  862.         move.l  d0,point2x
  863.         bsr     getppiy
  864.         move.l  d0,point2y
  865.         
  866.         bsr     getppix                 ;second control point
  867.         move.l  d0,(a0)+ 
  868.         bsr     getppiy
  869.         move.l  d0,(a0)+
  870.                 
  871.         move.l  point2x,(a0)+           ;store the end point
  872.         move.l  point2y,(a0)+
  873.         
  874.         addq.w  #1,curvecount
  875.         subq.w  #3,count
  876.         add.l   #26,len                 ;uses three points in pagestream
  877.         addq.w  #1,numcom               ; and 1 command
  878.         
  879. bez19:  cmp.w   #2,count                ;if 1 or 0 I am done
  880.         bcc     bez10                   ;not done yet...
  881.         
  882.         btst    #5,flag                 ;is this part of a compound object?
  883.         beq     bez198                  ;no
  884.        
  885.         move.l  oflgdata,d0
  886.         btst    #10,d0                  ;if yes - is this the last object?
  887.         bne     bez198                  ;yes, finish obj off
  888.         
  889.         cmp.w   #0,count
  890.         beq     bez191
  891.         bsr     getppix                  ;skip the last point
  892.         bsr     getppiy
  893. bez191: bra     adjlen                  ;set up for next obj
  894.         
  895. bez198: cmp.w   #1,count
  896.         bne     bez200
  897.         
  898.         bsr     xgetppi                    ;the last point is the control point
  899.         move.l  d0,prevctx
  900.         bsr     ygetppi                 ;of the next curve
  901.         move.l  d0,prevcty
  902.  
  903. bez200: move.l  oflgdata,d0             ;move flag into d0 for 32 bit testing
  904.         btst    #4,d0                   ;is it a close poly?
  905.         beq     bez201                  ;no!
  906.         
  907.         move.w  #CLOSEPATH,(a0)+
  908.         addq.w  #1,numcom
  909.         addq.l  #2,len
  910.  
  911. bez201: tst.w   fillflags               ;is it filled?
  912.         beq     bez202                  ;no
  913.  
  914.         lea     colortab,a1
  915.         move.w  fillcolor,d0
  916.         move.b  0(a1,d0.w),d1
  917.         move.b  d1,object+ob_FColor     ;set the objects color
  918.         move.b  #9,object+ob_FType      ;yes - set fill type to #9 (solid)
  919.         move.w  #FILLPATH,(a0)+
  920.         addq.w  #1,numcom
  921.         addq.l  #2,len
  922.         
  923.         bra     bez203
  924.         
  925.         ;move.b  #1,object+ob_FColor     ;set the objects color to 1 (Black)
  926.         ;move.b  #0,object+ob_FType      ;yes - set fill type to 0 (none)
  927.         ; 
  928.         ;move.w  #STROKEPATH,(a0)+
  929.         ;addq.w  #1,numcom
  930.         ;addq.l  #2,len
  931.         ; 
  932.         ;bra     bez203
  933.   
  934. bez202: move.w  #STROKEPATH,(a0)+
  935.         addq.w  #1,numcom
  936.         addq.l  #2,len
  937.         
  938. bez203: move.l  mptr,a0
  939.         move.l  (a0),a0
  940.         clr.l   d0
  941.         move.l  len,d0
  942.         move.l  d0,ply_Length(a0)
  943.         
  944.         move.l  object+ob_Right,d0
  945.         sub.l   object+ob_Left,d0
  946.         move.l  d0,ply_Width(a0)
  947.         
  948.         move.l  object+ob_Bottom,d0
  949.         sub.l   object+ob_Top,d0
  950.         move.l  d0,ply_Height(a0)
  951.         
  952.         move.w  #100,ply_XScale(a0)
  953.         move.w  #100,ply_YScale(a0)
  954.         move.w  numcom,ply_Count(a0)
  955.         
  956.         tst.w   object+ob_LWidth
  957.         bne     bez204
  958.         
  959.         move.b  #1,object+ob_LColor
  960.         move.b  #0,object+ob_LType
  961.                 
  962. bez204: cmp.w   #1,curvecount           ;2 curves could mean a line
  963.         bne     bez210
  964.         
  965.         move.l  pptr,a0                 ;get address of poly data
  966.         
  967.         move.l  4(a0),d0                ;x coord of MOVETO
  968.         move.l  8(a0),d1                ;y coord of MOVETO
  969.         cmp.l   14(a0),d0               ;compare to control point 1 of CURVETO
  970.         ;beq     bez205
  971.         bne     bez210
  972.         cmp.l   18(a0),d1
  973.         ;beq     bez205
  974.         bne     bez210
  975.         ;bra     bez210
  976.         
  977. bez205: move.l  30(a0),d2               ;x coord of end point
  978.         move.l  34(a0),d3               ;y coord of end point
  979.         cmp.l   22(a0),d2               ;compare to control point 2 of CURVETO
  980.         ;beq     bez206
  981.         bne     bez210
  982.         cmp.l   26(a0),d3
  983.         ;beq     bez206
  984.         bne     bez210
  985.         ;bra     bez210
  986.         
  987. bez206: move.b  #thvln,object+ob_Type   ;force a hori/vert line to start with
  988.         cmp.l   d2,d0                   ;is it a horizontal line?
  989.         beq     bez207                  ;yes
  990.         cmp.l   d3,d1                   ;is it a vertical line?
  991.         beq     bez207                  ;yes
  992.         
  993.         move.b  #tdln,object+ob_Type    ;object is a diag line
  994.     
  995. bez207: cmp.l   d2,d0                   ;is end point x > moveto point x
  996.         bcs     bez208                  ;yes
  997.         move.l  object+ob_Left,d4
  998.         move.l  object+ob_Right,object+ob_Left
  999.         move.l  d4,object+ob_Right
  1000.         
  1001. bez208: cmp.l   d3,d1                   ;is the end point y > moveto point y 
  1002.         bcs     bez209                  ;yes
  1003.         move.l  object+ob_Top,d4
  1004.         move.l  object+ob_Bottom,object+ob_Top
  1005.         move.l  d4,object+ob_Bottom
  1006.         
  1007. bez209: bsr     putobj
  1008.         bra     bez23
  1009.         
  1010. bez210: btst    #5,flag
  1011.         beq     bez211
  1012.         
  1013.         move.l  mptr,a0
  1014.         move.l  (a0),a0
  1015.         lea     ply_Sizeof(a0),a0
  1016.         clr.l   d0
  1017.         move.w  numcom,d0
  1018.         bsr     adjcoords
  1019.  
  1020. bez211: bsr     putobj
  1021.  
  1022.     move.l    mptr,a0
  1023.     move.l    (a0),a0
  1024.     move.l    (a0),d0
  1025.     move.l    table,a0
  1026.     move.l    o_malloc(a0),a0
  1027.     jsr    (a0)
  1028.     beq    errrts
  1029.  
  1030.     move.l    mptr,a1
  1031.     move.l    (a1),a1
  1032.     move.l    (a1),d0
  1033.     lsr.l    #1,d0
  1034.         move.l  d0,d1
  1035.         swap    d1
  1036.     bra    bez22
  1037. bez21:    move.w    (a1)+,(a0)+
  1038. bez22:    dbf    d0,bez21
  1039.         dbf     d1,bez21
  1040.         
  1041. bez23:  move.l  mptr,a0
  1042.         move.l  table,a1
  1043.         move.l  m_delete(a1),a1
  1044.         jsr     (a1)
  1045.  
  1046.         bclr    #5,flag                 ;clear the compound object flag
  1047.         bra     adjlen
  1048.  
  1049.    
  1050. ***********************************
  1051. ***                ***
  1052. ***********************************        
  1053. circ:   bsr     xgetppi                 ;get the box width
  1054.         move.l  d0,w
  1055.         bsr     ygetppi                 ;get the box height
  1056.         move.l  d0,h
  1057.         
  1058.         bsr     xgetppi
  1059.         lsl.l   #1,d0
  1060.         move.l  d0,cw                   ;circle width (Diameter)
  1061.         lsr.l   #1,d0
  1062.         move.l  d0,cw2
  1063.         lsr.l   #1,d0
  1064.         move.l  d0,cw4
  1065.         add.l   cw2,d0
  1066.         move.l  d0,cw34
  1067.         move.l  #0,cw0
  1068.         
  1069.         bsr     ygetppi
  1070.         lsl.l   #1,d0
  1071.         move.l  d0,ch                   ;circle height (Diameter)
  1072.         lsr.l   #1,d0
  1073.         move.l  d0,ch2
  1074.         lsr.l   #1,d0
  1075.         move.l  d0,ch4
  1076.         add.l   ch2,d0
  1077.         move.l  d0,ch34
  1078.         move.l  #0,ch0
  1079.         
  1080.         bsr     pgetl
  1081.         move.l  d0,rotation
  1082.         bsr     pgetl
  1083.         bsr     pgetl
  1084.         
  1085.         move.l  oflgdata,d1             ;is this the start of a compound obj?
  1086.         btst    #13,d1
  1087.         beq     circ0                   ;no
  1088.         
  1089.         bset    #5,flag
  1090.         
  1091. circ0:  btst    #5,flag
  1092.         beq     cir00
  1093.                 
  1094.         move.l  leftoffset,d0           ;if yes, adjust coords
  1095.         ;sub.l   object+ob_Left,d0
  1096.         add.l   d0,cw
  1097.         add.l   d0,cw2
  1098.         add.l   d0,cw4
  1099.         add.l   d0,cw34
  1100.         add.l   d0,cw0
  1101.         move.l  cw0,d0
  1102.         bsr     checkR
  1103.         move.l  cw,d0
  1104.         bsr     checkR
  1105.         
  1106.         move.l  topoffset,d0
  1107.         ;sub.l   object+ob_Top,d0
  1108.         add.l   d0,ch
  1109.         add.l   d0,ch2
  1110.         add.l   d0,ch4
  1111.         add.l   d0,ch34
  1112.         add.l   d0,ch0
  1113.         move.l  ch0,d0
  1114.         bsr     checkB
  1115.         move.l  ch,d0
  1116.         bsr     checkB
  1117.         bra     circ1
  1118.  
  1119. cir00:  move.l  object+ob_Left,d0       ;calculate PgS bounding box
  1120.         add.l   cw,d0
  1121.         move.l  d0,object+ob_Right
  1122.         move.l  object+ob_Top,d0
  1123.         add.l   ch,d0
  1124.         move.l  d0,object+ob_Bottom
  1125.         
  1126.         move.l  h,d0                    ;adjust Top down
  1127.         move.l  ch2,d1
  1128.         sub.l   d1,d0
  1129.         add.l   d0,object+ob_Top
  1130.         
  1131.         move.l  w,d0                    ;adjust the Right left
  1132.         move.l  cw2,d1
  1133.         sub.l   d0,d1
  1134.         sub.l   d1,object+ob_Right
  1135.         
  1136.         move.l  object+ob_Right,d0       ;calculate PgS new bounding box
  1137.         sub.l   cw,d0
  1138.         move.l  d0,object+ob_Left
  1139.         move.l  object+ob_Top,d0
  1140.         add.l   ch,d0
  1141.         move.l  d0,object+ob_Bottom
  1142.         
  1143.         bclr    #0,flag                 ;clear the ok obj flag for next obj
  1144.         clr.l   prevptx                 ;clear the previous point
  1145.         clr.l   prevpty
  1146.         clr.l   prevctx                 ;clear the previous control point
  1147.         clr.l   prevcty
  1148.         
  1149. circ1:  move.l  #114,d0                 ;amount of memory needed
  1150.         
  1151.         move.l  oflgdata,d1             ;is this the start of a compound obj?
  1152.         btst    #13,d1
  1153.         bne     cir0                    ;yes!
  1154.         
  1155.         btst    #5,flag                 ;am I doing a compound object?
  1156.         beq     cir01                   ;no
  1157.         
  1158.         move.l  mptr,a0                 ;get address of memory into a0
  1159.         move.l  table,a1                ;d0 = amount to grow by (see above)
  1160.         move.l  m_grow(a1),a1
  1161.         jsr     (a1)
  1162.         beq     errrts                  ;get out if could not get memory
  1163.         
  1164.         move.l  mptr,a0
  1165.         move.l  (a0),a0
  1166.         add.l   len,a0                  ;set a0 to end of last object
  1167.         move.l  a0,pptr
  1168.         bset    #6,flag                 ;set up to use leftoffset and topoffset        
  1169.         bra     cir10                   ;start doing next set of points
  1170.         
  1171. cir0:   bset    #5,flag                 ;set up flag for a compound object
  1172.         bset    #6,flag
  1173.         
  1174. cir01:  add.l    #ply_Sizeof+6,d0    ;6 = new+close+(fill or stroke)
  1175.  
  1176. cir2:    clr.w    d1                      ;m_alloc memory for object data
  1177.     clr.w    d2
  1178.     move.l    table,a0
  1179.     move.l    m_alloc(a0),a0
  1180.     jsr    (a0)
  1181.     beq    errrts
  1182.  
  1183.     move.l    a0,mptr
  1184.     move.l    (a0),a4
  1185.     lea    ply_Sizeof(a4),a4
  1186.     move.l    a4,pptr
  1187.  
  1188.         move.b  #tpoly,object+ob_Type
  1189.         move.l  pptr,a0
  1190.         move.w  #NEWPATH,(a0)+
  1191.         move.w  #1,numcom
  1192.         move.l  #ply_Sizeof+2,len       ;set starting length of poly stuff
  1193.         
  1194. cir10:  move.w  #MOVETO,(a0)+
  1195.         move.l  cw0,(a0)+
  1196.         move.l  ch2,(a0)+
  1197.  
  1198.         move.w  #CURVETO,(a0)+
  1199.         move.l  cw0,(a0)+
  1200.         move.l  ch4,(a0)+
  1201.         move.l  cw4,(a0)+
  1202.         move.l  ch0,(a0)+
  1203.         move.l  cw2,(a0)+
  1204.         move.l  ch0,(a0)+
  1205.  
  1206.         move.w  #CURVETO,(a0)+
  1207.         move.l  cw34,(a0)+
  1208.         move.l  ch0,(a0)+
  1209.         move.l  cw,(a0)+
  1210.         move.l  ch4,(a0)+
  1211.         move.l  cw,(a0)+
  1212.         move.l  ch2,(a0)+
  1213.  
  1214.         move.w  #CURVETO,(a0)+
  1215.         move.l  cw,(a0)+
  1216.         move.l  ch34,(a0)+
  1217.         move.l  cw34,(a0)+
  1218.         move.l  ch,(a0)+
  1219.         move.l  cw2,(a0)+
  1220.         move.l  ch,(a0)+
  1221.  
  1222.         move.w  #CURVETO,(a0)+          ;bezier curve - first control point
  1223.         move.l  cw4,(a0)+
  1224.         move.l  ch,(a0)+
  1225.         move.l  cw0,(a0)+
  1226.         move.l  ch34,(a0)+
  1227.         move.l  cw0,(a0)+
  1228.         move.l  ch2,(a0)+
  1229.                 
  1230.         add.l   #114,len                ;add in for moveto & curveto commands
  1231.         addq.w  #5,numcom
  1232.         bclr    #6,flag                 ;do not use leftoffset and topoffset
  1233.         btst    #5,flag                 ;is this part of a compound object?
  1234.         beq     cir200                  ;no
  1235.        
  1236.         move.l  oflgdata,d0
  1237.         btst    #10,d0                  ;if yes - is this the last object?
  1238.         beq     adjlen                  ;yes, so end object
  1239.         
  1240. cir200: move.l  oflgdata,d0             ;move flag into d0 for 32 bit testing
  1241.         btst    #4,d0                   ;is it a close poly?
  1242.         beq     cir201                  ;no, so check for fill
  1243.         
  1244.         move.w  #CLOSEPATH,(a0)+
  1245.         addq.w  #1,numcom
  1246.         addq.l  #2,len
  1247.         move.b  #1,object+ob_FColor     ;set the objects color to 1 (Black)
  1248.         move.b  #0,object+ob_FType      ;yes - set fill type to 0 (none)
  1249.         
  1250. cir201: tst.w   fillflags               ;is it filled?
  1251.         beq     cir202                  ;no, so stroke it
  1252.   
  1253.         lea     colortab,a1
  1254.         move.w  fillcolor,d0
  1255.         move.b  0(a1,d0.w),d1
  1256.         move.b  d1,object+ob_FColor     ;set the objects color
  1257.         move.b  #9,object+ob_FType      ;yes - set fill type to #9 (solid)
  1258.         move.w  #FILLPATH,(a0)+
  1259.         addq.w  #1,numcom
  1260.         addq.l  #2,len
  1261.         
  1262.         bra     cir203
  1263.         
  1264. cir202: move.w  #STROKEPATH,(a0)+
  1265.         addq.w  #1,numcom
  1266.         addq.l  #2,len
  1267.         
  1268. cir203: move.l  mptr,a0
  1269.         move.l  (a0),a0
  1270.         move.l  len,d0
  1271.         move.l  d0,ply_Length(a0)
  1272.         
  1273.         move.l  object+ob_Right,d0
  1274.         sub.l   object+ob_Left,d0
  1275.         move.l  d0,ply_Width(a0)
  1276.         
  1277.         move.l  object+ob_Bottom,d0
  1278.         sub.l   object+ob_Top,d0
  1279.         move.l  d0,ply_Height(a0)
  1280.         
  1281.         move.w  #100,ply_XScale(a0)
  1282.         move.w  #100,ply_YScale(a0)
  1283.         move.w  numcom,ply_Count(a0)
  1284.         
  1285.         tst.w   object+ob_LWidth
  1286.         bne     cir210
  1287.         
  1288.         move.b  #1,object+ob_LColor
  1289.         move.b  #0,object+ob_LType
  1290.  
  1291. cir210: move.l  rotation,d0             ;get the rotation in radians
  1292.         beq     cirt1
  1293.         mulu    #18000,d0               ;convert to degress
  1294.         clr.l   d1   
  1295.         move.l  #31415,d2
  1296.         bsr     Divu1648
  1297.         move.w  #36000,d1               ;reverse the rotation
  1298.         sub.w   d0,d1
  1299.         move.w  d1,object+ob_Twist
  1300.         move.w  d1,object+ob_Slant
  1301.         
  1302. cirt1:  btst    #5,flag
  1303.         beq     cir211
  1304.         
  1305.         move.l  mptr,a0
  1306.         move.l  (a0),a0
  1307.         lea     ply_Sizeof(a0),a0
  1308.         clr.l   d0
  1309.         move.w  numcom,d0
  1310.         bsr     adjcoords
  1311.  
  1312. cir211: bsr     putobj
  1313.  
  1314.     move.l    mptr,a0
  1315.     move.l    (a0),a0
  1316.     move.l    (a0),d0
  1317.     move.l    table,a0
  1318.     move.l    o_malloc(a0),a0
  1319.     jsr    (a0)
  1320.     beq    errrts
  1321.  
  1322.     move.l    mptr,a1
  1323.     move.l    (a1),a1
  1324.     move.l    (a1),d0
  1325.     lsr.l    #1,d0
  1326.         move.l  d0,d1
  1327.         swap    d1
  1328.     bra    cir22
  1329. cir21:    move.w    (a1)+,(a0)+
  1330. cir22:    dbf    d0,cir21
  1331.         dbf     d1,cir21
  1332.  
  1333.  
  1334. cir23:  move.l  mptr,a0
  1335.         move.l  table,a1
  1336.         move.l  m_delete(a1),a1
  1337.         jsr     (a1)
  1338.  
  1339.         bclr    #5,flag                 ;clear compound object flag
  1340.         bra     adjlen
  1341.  
  1342.  
  1343. ***********************************
  1344. ***                ***
  1345. ***********************************
  1346. errrts:
  1347.         move.l    savesp,sp
  1348.         jmp     abortobj
  1349.         
  1350.  
  1351. ***********************************
  1352. ***                ***
  1353. ***********************************
  1354. Mulu1632:
  1355.     move.l    table,a0
  1356.     move.l    mulu1632(a0),a0
  1357.     jmp    (a0)
  1358.  
  1359. ***********************************
  1360. ***                ***
  1361. ***********************************
  1362. Muls1632:
  1363.     move.l    table,a0
  1364.     move.l    muls1632(a0),a0
  1365.     jmp    (a0)
  1366.  
  1367.  
  1368. ***********************************
  1369. ***                ***
  1370. ***********************************
  1371. Mulu3232:
  1372.     move.l    table,a0
  1373.     move.l    mulu3232(a0),a0
  1374.     jmp    (a0)
  1375.  
  1376.  
  1377. ***********************************
  1378. ***                ***
  1379. ***********************************
  1380. Divu1648:
  1381.     move.l    table,a0
  1382.     move.l    divu1648(a0),a0
  1383.     jmp    (a0)
  1384.  
  1385. ***********************************
  1386. ***                ***
  1387. ***********************************
  1388. Divs3248:
  1389.     move.l    table,a0
  1390.     move.l    divs3248(a0),a0
  1391.     jmp    (a0)
  1392.  
  1393. *******************************************************************
  1394. ***    called when the import routine choosen finds something    ***
  1395. ***    wrong with the file loaded.                ***
  1396. *******************************************************************
  1397. never:    clr.w    d0
  1398.     rts
  1399.  
  1400. maybe:    move.w    #1,d0
  1401.     rts
  1402.  
  1403. right:    move.w    #2,d0
  1404.     rts
  1405.  
  1406.  
  1407. ;************************** TEMP *********************************
  1408.         
  1409. ***************************
  1410. ***                     ***
  1411. ***************************
  1412. checkLR:
  1413.         cmp.l   object+ob_Left,d0
  1414.         bge     checkR
  1415.         move.l  d0,object+ob_Left
  1416.         
  1417. checkR: cmp.l   object+ob_Right,d0
  1418.         ble     cklr2
  1419.         move.l  d0,object+ob_Right          
  1420. cklr2:  rts
  1421.         
  1422. ***************************
  1423. ***                     ***
  1424. ***************************
  1425. checkTB:
  1426.         cmp.l   object+ob_Top,d0
  1427.         bge     checkB
  1428.         move.l  d0,object+ob_Top
  1429.         
  1430. checkB: cmp.l   object+ob_Bottom,d0
  1431.         ble     cktb2
  1432.         move.l  d0,object+ob_Bottom
  1433. cktb2:  rts
  1434.  
  1435.  
  1436. ***************************
  1437. ***                     ***
  1438. ***************************
  1439. adjcoords:                              ;a0 = start address
  1440.         move.l  object+ob_Left,d1       ;d0 = number of 'commands'
  1441.         move.l  object+ob_Top,d2
  1442.         bra     adjc3
  1443.         
  1444. adjc1:  move.w  (a0)+,d3
  1445.         cmp.w   #STROKEPATH,d3          ;skip STROKEPATH
  1446.         beq     adjc3
  1447.         
  1448.         cmp.w   #FILLPATH,d3            ;skip FILLPATH
  1449.         beq     adjc3    
  1450.         
  1451.         cmp.w   #NEWPATH,d3             ;skip NEWPATH
  1452.         beq     adjc3
  1453.         
  1454.         cmp.w   #CLOSEPATH,d3           ;skip CLOSEPATH
  1455.         beq     adjc3
  1456.         
  1457.         cmp.w   #CURVETO,d3
  1458.         beq     adjc2
  1459.         
  1460.         sub.l   d1,(a0)+                ;LINETO & MOVETO have 1 point
  1461.         sub.l   d2,(a0)+
  1462.         bra     adjc3        
  1463.         
  1464. adjc2:  sub.l   d1,(a0)+                ;CURVETO has 3 points
  1465.         sub.l   d2,(a0)+
  1466.         sub.l   d1,(a0)+
  1467.         sub.l   d2,(a0)+
  1468.         sub.l   d1,(a0)+
  1469.         sub.l   d2,(a0)+
  1470.         
  1471. adjc3:  dbf     d0,adjc1
  1472.         rts
  1473.  
  1474.  
  1475. *************************************************************
  1476. *************************************************************
  1477.  SECTION DR2D,DATA,PUBLIC
  1478.  
  1479. chunks: dc.l    "CFIN",cfin
  1480.         dc.l    "CFLG",cflg
  1481.         dc.l    "CNAM",cnam
  1482.         dc.l    "COLR",colr
  1483.         dc.l    "DATA",data
  1484.         dc.l    "DBOX",dbox
  1485.         dc.l    "FILL",fill
  1486.         dc.l    "LINE",line
  1487.         dc.l    "OBJ ",obj
  1488.         dc.l    "OFLG",oflg
  1489.         dc.l    "PYMC",pymc
  1490.         dc.l    "SCLF",sclf
  1491.         dc.l    "STXT",stxt
  1492.         dc.l    "VBOX",vbox
  1493.         dc.l    "YMCK",ymck
  1494.         dc.l    0,skip
  1495.                 
  1496. numchunks:      
  1497.         dc.w    15
  1498.  
  1499. special:
  1500.     dc.w    1
  1501.     dc.l    spcl1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  1502.  
  1503. version:        dc.b    "$VER: "
  1504. name:            dc.b    "ProDraw Clips v2.1.6",0
  1505.  
  1506. spcl1:    dc.b    "All Clips",0
  1507.  
  1508.  
  1509.  SECTION DR2D,BSS,PUBLIC
  1510. savesp:        ds.l    1
  1511. length:        ds.l    1
  1512. clength:    ds.l    1
  1513. temp:        ds.l    1
  1514. object:        ds.w    ob_SizeOf/2
  1515. color:          ds.w    cl_Sizeof/2
  1516.  
  1517.  
  1518. flag:           ds.l    1   
  1519. colortab:       ds.b    256
  1520. strtab:         ds.b    1024
  1521. colorname:      ds.b    64
  1522. cnamlen:        ds.w    1
  1523. clipnum:        ds.w    1
  1524. strtabptr:      ds.l    1
  1525. count:          ds.w    1
  1526. numcom:         ds.w    1
  1527. prevptx:        ds.l    1
  1528. prevpty:        ds.l    1
  1529. prevctx:        ds.l    1
  1530. prevcty:        ds.l    1
  1531. point2x:        ds.l    1
  1532. point2y:        ds.l    1
  1533. mptr:           ds.l    1
  1534. pptr:           ds.l    1
  1535. oflgdata:       ds.l    1
  1536. len:            ds.l    1
  1537. linewidth:      ds.w    1
  1538. fillcolor:      ds.w    1
  1539. fillflags:      ds.w    1
  1540. coltabindex:    ds.w    1
  1541. objtype:        ds.l    1
  1542. curvecount:     ds.w    1
  1543. yellow:         ds.w    1
  1544. magenta:        ds.w    1
  1545. cyan:           ds.w    1
  1546. black:          ds.w    1
  1547. leftoffset:     ds.l    1
  1548. topoffset:      ds.l    1
  1549. cw:             ds.l    1
  1550. cw0:            ds.l    1
  1551. cw2:            ds.l    1
  1552. cw4:            ds.l    1
  1553. cw34:           ds.l    1
  1554. ch:             ds.l    1
  1555. ch0:            ds.l    1
  1556. ch2:            ds.l    1
  1557. ch4:            ds.l    1
  1558. ch34:           ds.l    1
  1559. rotation:       ds.l    1
  1560. xscale:         ds.l    1
  1561. yscale:         ds.l    1
  1562. saved0:         ds.l    1
  1563. savea0:         ds.l    1
  1564. w:              ds.l    1
  1565. h:              ds.l    1
  1566. length2:        ds.l    1
  1567.  
  1568. ************************** CHANGES ******************************************
  1569. ;
  1570. ;       version 2.1.6
  1571. ;
  1572. ;       - fixed a bug when "growing" memory. It was using the return value when
  1573. ;         the function was not supposed to be returning anything valid.
  1574. ;
  1575. ;       - added a version string so "version prodraw.import" will report the
  1576. ;         version of the module.
  1577. ;
  1578. ;       - fixed a bug that would cause PgS to crash when the object was pasted.
  1579. ;         (the o_end call was never made to match the o_begingroup call)
  1580. ;       
  1581. ;       - changed the way the various implementaions of the PDRF chunk length
  1582. ;         is handle - it is now ignored. The module uses the length of the 
  1583. ;         file instead.
  1584. ;
  1585. ;       - added "clean up" code the pget? calls for d0
  1586. ;
  1587. ;
  1588. ;       version 2.1.5   (uploaded 4/19/91)
  1589. ;
  1590. ;       - fixed bug when importing compound object. the default object defs
  1591. ;         were getting set each time a new part of the compound obj came in.
  1592. ;         this means object data such as line color and width were being set to
  1593. ;         the defaults instead of the actual values wanted.
  1594. ;
  1595. ;       - added support for rounded ends on lines
  1596. ;
  1597. ;
  1598. ;       version 2.1.4  (uploaded 3/29/91 ?)
  1599. ;
  1600. ;       - syndesis files are now imported. they were writing their files a
  1601. ;         little differently than ProDraw. they did not include a COLR "chunk"
  1602. ;         at the start of each color - only the color section. also the PDPF
  1603. ;         length did not include the entire file as prodraw does - it was 4
  1604. ;         bytes short. (it did not include the PDPF tag).
  1605. ;
  1606. ;       - bug fix: sometimes a clip would exit without getting to the paste
  1607. ;         cursor, this was due to a routine corrupting the counting register
  1608. ;         used to skip extra data not needed. This has been fixed.
  1609. ;
  1610. ;       - changed the way compound objects are delt with, this fixed several
  1611. ;         problems with them.
  1612. ;
  1613. ;       - bug fix: if a circle object started a compound object it was not
  1614. ;         detected and problems would result. This has been fixed.
  1615. ;
  1616. ;       - objects are now better aligned with other objects.
  1617. ;
  1618. ;       - filled open polygons are now supported.
  1619. ;
  1620. ;       - rotated circles are placed correctly now.
  1621. ;
  1622. ;
  1623. ;       version 2.1.3   (shipped with PgS2.1  12/7/90)
  1624. ;
  1625. ;       - bug fixes: when importing older clips
  1626. ;
  1627. ;       - misc bugs when importing a bitmap traced object
  1628. ;         (not completly fixed yet)
  1629. ;
  1630. ;
  1631. ;       version 2.1.2   (uploaded 11/15/90 ?)
  1632. ;
  1633. ;       - added support for compound objects (holes&cutouts now supported)
  1634. ;
  1635. ;       - circles are now converted into 4 bezier curves
  1636. ;
  1637. ;
  1638. ;       version 2.1.1   (uploaded 11/2/90)
  1639. ;
  1640. ;       - the size is closer to the size in prodraw
  1641. ;
  1642. ;
  1643. ;       version 2.1.0   (uploaded w/ pagestream2.1.3)
  1644. ;
  1645. ;       - initial release
  1646.