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

  1.  
  2.  Include "equ.h"
  3.  Include "impequ.h"
  4.  
  5. CR      equ    $d
  6. LF      equ    $a
  7.  
  8.  SECTION ADOBEILL,CODE,PUBLIC
  9.  
  10. ***************************************************
  11. ***                        ***
  12. ***************************************************
  13. dumbentry:
  14.     clr.l    d0
  15.     rts
  16.  
  17.     dc.l    "IMPO"        ; magik number for pic import
  18.     dc.w    201
  19.     dc.l    0
  20.  
  21. table:    dc.l    0
  22.     dc.l    name,special,check,ADOBEILL
  23.  
  24.  
  25. **********************************************
  26. *  Is it really an AdobeIllustator Document  *
  27. **********************************************
  28. check:    move.l    table,a0
  29.     move.l    buff1(a0),a1
  30.     move.l    (a1),a1
  31.         
  32.         clr.l   estart                  ;incase it is not an IBM EPS file
  33.         
  34.         lea    ibmepsfhdr,a2           ;check for IBMEPS file
  35. ck1:    cmp.b    (a2)+,(a1)+
  36.     bne    ck11                    ;if not, next check (ascii eps)
  37.     tst.b    (a2)
  38.     bne    ck1
  39.         
  40.         move.b  (a1)+,estart+3 
  41.         move.b  (a1)+,estart+2 
  42.         move.b  (a1)+,estart+1 
  43.         move.b  (a1)+,estart
  44.         move.l  estart,d0
  45.         cmp.l   #4096,d0                ;is eps start outside of buffer range?
  46.         bcc     never                   ;yes, so I can't bring it in.
  47.         bra     ck21                    ;go for it!
  48.  
  49. ck11:   move.l    table,a0                ;check for MacBinary EPS file
  50.     move.l    buff1(a0),a1
  51.     move.l    (a1),a1
  52.         add.l   #65,a1
  53.         
  54.         lea     test,a0
  55.         moveq   #3,d0
  56. ck12:   cmp.b   (a1)+,(a0)+
  57.         bne     ck21
  58.         dbf     d0,ck12
  59.         move.l  #128,estart             ;point to the data fork
  60.  
  61. ck21:   move.l  table,a0
  62.         move.l  buff1(a0),a1            ;move to start of EPS data
  63.         move.l  (a1),a1
  64.         add.l   estart,a1
  65.         
  66.         lea    epsfhdr,a2              ;check for "%!PS-Adobe"
  67. ck2:    cmp.b    (a2)+,(a1)+
  68.     bne    never                   ;if not, get out
  69.     tst.b    (a2)
  70.     bne    ck2
  71. ck3:    cmp.b   #"%",(a1)+
  72.         bne     ck3
  73.         move.l  a1,a0
  74.         
  75.         lea     signature1,a2           ;check for "%%Creator: Adobe Illustrator"
  76. ck4:    cmp.b    (a2)+,(a1)+
  77.     bne    ck5
  78.     tst.b    (a2)
  79.     bne    ck4
  80.         bra     right
  81.         
  82. ck5:    lea     signature2,a2           ;check for "%%Creator:Adobe Illustrator"
  83. ck6:    cmp.b    (a2)+,(a0)+
  84.     bne    never
  85.     tst.b    (a2)
  86.     bne    ck6
  87.         bra     right
  88.  
  89.  
  90. ***********************************
  91. ***                             ***
  92. ***********************************
  93. ADOBEILL:
  94.     move.l    sp,savesp        
  95.     move.l    table,a0
  96.     move.l    f_openr(a0),a0
  97.     jsr    (a0)
  98.     bne    impobj
  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.         move.l  table,a0
  112.         move.l  o_begingroup(a0),a0
  113.         jsr     (a0)
  114.         
  115.         clr.l   mptr
  116.         move.b  #0,object+ob_LColor
  117.         move.b  #0,object+ob_LType
  118.         move.w  #0,object+ob_LWidth
  119.         move.b  #0,object+ob_FColor
  120.         move.b  #0,object+ob_FType
  121.         bsr     getpic
  122.         
  123.         move.l  table,a0
  124.         move.l  o_endgroup(a0),a0
  125.         jsr     (a0)
  126.     
  127.         move.l    table,a0
  128.     move.l    o_close(a0),a0
  129.     jsr    (a0)
  130.  
  131.     move.l    table,a0
  132.     move.l    f_closer(a0),a0
  133.         jsr     (a0)
  134.         rts
  135.  
  136. ***********************************
  137. ***                             ***
  138. ***********************************
  139. abortobj:
  140.     move.l    table,a0
  141.     move.l    o_abort(a0),a0
  142.     jsr    (a0)
  143.  
  144. abort0:    move.l    table,a0
  145.     move.l    f_closer(a0),a0
  146.     jmp    (a0)
  147.  
  148.         
  149. *********************************
  150. *                               *
  151. *********************************
  152. getpic:
  153.         move.l  estart,d0       ;f_skip kludge for PgS2.0 (fixed in 2.1)
  154.         beq     gp1             ;if 0 do not skip anything
  155.         
  156.         move.l  d0,d1
  157.         swap    d1
  158.         and.l   #$0000ffff,d0   ;clear out upper word in d0
  159. ekldg1: move.w  d1,-(sp)
  160.         move.l  table,a0
  161.         move.l  f_skip(a0),a0   ;seek start of eps data in disk file
  162.         jsr     (a0)
  163.         beq     errrts
  164.         move.w  (sp)+,d1
  165.         move.l  #$0000ffff,d0
  166.         dbf     d1,ekldg1
  167.         
  168.         cmp.l   #$00010000,estart
  169.         bcs     gp1
  170.         move.w  #1,d0
  171.         move.l  table,a0
  172.         move.l  f_skip(a0),a0 
  173.         jsr     (a0)
  174.         beq     errrts
  175.         
  176. gp1:    bsr     pget            ;look for the "%%BoundingBox:"
  177.         cmp.b   #"%",d0
  178.         bne     gp1
  179.         lea     bbox,a0
  180. gp2:    bsr     pget
  181.         move.b  (a0)+,d1
  182.         cmp.b   d0,d1
  183.         bne     gp1
  184.         tst.b   (a0)
  185.         bne     gp2
  186.         bsr     getnum
  187.         move.l  d0,xleft
  188.         bsr     getnum
  189.         move.l  d0,ybottom
  190.         bsr     getnum
  191.         move.l  d0,xright
  192.         bsr     getnum
  193.         move.l  d0,ytop
  194.         
  195. gp3:    bsr     pget            ;look for the "%%EndSetup"
  196.         cmp.b   #"%",d0
  197.         bne     gp3
  198.         lea     endsetup,a0
  199. gp4:    bsr     pget
  200.         move.b  (a0)+,d1
  201.         cmp.b   d0,d1
  202.         bne     gp3
  203.         tst.b   (a0)
  204.         bne     gp4
  205.         bsr     setobjdef
  206.         clr.l   numindex
  207.         bsr     newobj          ;start up with a new obj
  208.         
  209. gp5:    bsr     getnum
  210.         cmp.l   #0,d1           ;did I get a number?
  211.         bne     gp6             ;no
  212.         lea     numtable,a0
  213.         move.l  numindex,d1
  214.         move.l  d0,0(a0,d1.l)
  215.         addq.l  #4,numindex
  216.         bra     gp5
  217.  
  218. gp6:    cmp.l   #1,d1           ;did I get a drawing command?
  219.         bne     gp7             ;no, so it must the end of the data
  220.         lea     routines,a0     ;yes, so get address of command and do it
  221.         lsl.l   #2,d0
  222.         move.l  0(a0,d0.l),a0
  223.         jsr     (a0)
  224.         clr.l   numindex
  225.         bra     gp5
  226.         
  227. gp7:    tst.l   mptr
  228.         beq     rrts
  229.         
  230.         move.l  mptr,a0
  231.         move.l  table,a1
  232.         move.l  m_delete(a1),a1
  233.         jsr     (a1)
  234.         move.l  #0,mptr
  235.         
  236. rrts:   rts
  237.  
  238. **********************************
  239. **                              **
  240. **********************************
  241. getnum:    bsr     fget
  242.         bsr     checkcom        ;did I get a postscript command?
  243.         beq     gt0             ;no
  244.         move.b  d1,d0
  245.         moveq   #1,d1           ;d1=1 means a command is in d0
  246.         rts
  247.         
  248. gt0:    bsr     checkend        ;check for end of data "%%Trailer"
  249.         beq     gt1             ;no
  250.         moveq   #2,d1           ;d1=2 means end of data
  251.         rts
  252.         
  253. gt1:    moveq    #0,d0           ;check for a number
  254.     moveq    #1,d2
  255.     cmp.b    #"-",d1
  256.     beq    gtnm2
  257.     cmp.b    #"0",d1
  258.     bcs    gt2
  259.     cmp.b    #"9",d1
  260.     bls    gtnm1
  261.         
  262. gt2:    cmp.b   #"(",d1         ;check for a string marker
  263.         bne     gt4             ;no
  264.         lea     chartable,a0
  265.         moveq   #0,d2
  266. gt3:    bsr     fget
  267.         cmp.b   #")",d1
  268.         beq     gt39
  269.         move.b  d1,0(a0,d2.l)
  270.         addq.l  #1,d2
  271.         bra     gt3
  272.         
  273. gt39:   clr.b   0(a0,d2.l)      ;null terminate string
  274.         move.l  d2,charcount    ;store the length of the string
  275.         bra     getnum
  276.         
  277. gt4:    cmp.b   #"[",d1         ;check for a array marker
  278.         bne     gt6             ;no
  279. gt5:    bsr     getarray        ;yes, so get the array
  280.         bra     getnum
  281.         
  282. gt6:    cmp.b   #"]",d1         ;check for end of array
  283.         bne     gt7             ;nope
  284.         rts                     ;yes, so return to caller (getarray)
  285.  
  286. gt7:    cmp.b   #"/",d1         ;check for a literal name 
  287.         bne     getnum          ;nope
  288. gt8:    bsr     fget            ;read chars until a space
  289.         cmp.b   #" ",d1
  290.         bne     gt8
  291.         bra     getnum
  292.  
  293. gtnm1:    moveq    #0,d0           ;got a number
  294.     moveq    #0,d2           ;clear negative number flag
  295.         bra     gtnm21
  296.         
  297. gtnm2:    bsr     fget
  298. gtnm21: tst.b   d1
  299.         beq    gtnm9
  300.     cmp.b    #"-",d1
  301.     bne    gtnm3
  302.     moveq    #1,d2
  303.     bra    gtnm2
  304. gtnm3:    cmp.b    #" ",d1
  305.     beq    gtnm9
  306.     cmp.b    #CR,d1
  307.     beq    gtnm9
  308.     cmp.b    #LF,d1
  309.     beq    gtnm9
  310.     cmp.b    #".",d1
  311.     beq    gtnm11          ;get decimal part
  312.     sub.b    #"0",d1
  313.     bcs    gtnm9
  314.     cmp.b    #9,d1
  315.     bhi    gtnm9
  316.     move.l    d0,-(sp)
  317.     lsl.l    #2,d0        ;*4
  318.     add.l    (sp)+,d0    ;*5
  319.     lsl.l    #1,d0        ;*10
  320.     and.l    #$ff,d1
  321.     add.l    d1,d0
  322.     bra    gtnm2
  323.  
  324. gtnm9:    mulu    #100,d0
  325.         tst.w    d2              ;is it a negative number
  326.     beq    gtnm10          ;no
  327.     neg.l    d0
  328. gtnm10: clr.l   d1              ;d1=0 means a number is in d0
  329.     rts
  330.  
  331. gtnm11: mulu    #100,d0
  332.         move.l  d0,fint         ;save integer part for later
  333.         moveq   #0,d0
  334.         move.l  #2,dcount
  335.         
  336. gtnm12: bsr     fget
  337.         tst.b   d1
  338.         beq    gtnm19
  339.     cmp.b    #" ",d1
  340.     beq    gtnm19
  341.     cmp.b    #CR,d1
  342.     beq    gtnm19
  343.     cmp.b    #LF,d1
  344.     beq    gtnm19
  345.     sub.b    #"0",d1
  346.     bcs    gtnm19
  347.     cmp.b    #9,d1
  348.     bhi    gtnm19
  349.     move.l    d0,-(sp)
  350.     lsl.l    #2,d0        ;*4
  351.     add.l    (sp)+,d0    ;*5
  352.     lsl.l    #1,d0        ;*10
  353.     and.l    #$ff,d1
  354.     add.l    d1,d0
  355.         subq.l  #1,dcount       ;decrement decimal counter (only need 2)
  356.         bne     gtnm12          ;if not done, keep going
  357.         
  358. gtnm13: bsr     fget            ;skip numbers until a non-number
  359.     beq    gtnm19
  360.     sub.b    #"0",d1
  361.     bcs    gtnm19
  362.     cmp.w    #9,d1
  363.     bhi    gtnm19
  364.     bra    gtnm13
  365.         
  366. gtnm19: tst.l   dcount
  367.         beq     gtnm20
  368.         move.l    d0,-(sp)
  369.     lsl.l    #2,d0        ;*4
  370.     add.l    (sp)+,d0    ;*5
  371.     lsl.l    #1,d0        ;*10
  372.         subq.l  #1,dcount       ;decrement decimal counter (only need 2)
  373.         bne     gtnm19          ;if not done, keep going
  374.  
  375. gtnm20: add.l   d0,fint         ;add decimnal part to the integer part
  376.         move.l  fint,d0         ;get number into d0
  377.         tst.w   d2              ;is this a negative number?
  378.         beq     gtnm22          ;no
  379.         neg.l   d0 
  380. gtnm22: moveq   #0,d1           ;d1=0 means a number is in d0
  381.         rts
  382.  
  383. ***********************************
  384. ***                ***
  385. ***********************************
  386. checkcom:
  387.         lea    commands,a0             ;check for any drawing command 
  388.         clr.l   d3
  389. cc1:    move.b  (a0)+,d2
  390.         cmp.b   d1,d2
  391.         beq     cc2
  392.         addq.l  #1,d3
  393.         tst.b   (a0)
  394.         bne     cc1
  395.         moveq   #0,d0                   ;return no
  396.         rts
  397.  
  398. cc2:    move.l  d3,d1
  399.         moveq   #1,d0                   ;return yes
  400.         rts
  401.         
  402. ***********************************
  403. ***                ***
  404. ***********************************        
  405. checkend:
  406.         cmp.b   #"%",d1
  407.         bne     ce7
  408.         
  409.         lea    dataend,a0              ;check for "%%Trailer"
  410. ce1:    bsr     pget
  411.         move.b  (a0)+,d2
  412.         cmp.b   d0,d2
  413.         bne     ce5
  414.         tst.b   (a0)
  415.         bne     ce1
  416.         moveq   #1,d0                   ;return yes
  417.         rts
  418.         
  419. ce5:    cmp.b   #CR,d0                  ;skip until end of line
  420.         beq     ce7
  421.         cmp.b   #LF,d0
  422.         beq     ce7
  423.         bsr     pget
  424.         bra     ce5
  425.         
  426. ce7:    moveq   #0,d0                   ;return no
  427.         rts
  428.         
  429. *********************************
  430. *                               *
  431. *********************************
  432. getarray:
  433.         bsr     getnum
  434.         tst.l   d1
  435.         bne     gta1
  436.         lea     array,a0
  437.         move.l  d0,0(a0)
  438.         bsr     getnum
  439.         tst.l   d1
  440.         bne     gta1
  441.         lea     array,a0
  442.         move.l  d0,4(a0)
  443.         bsr     getnum
  444.         tst.l   d1
  445.         bne     gta1
  446.         lea     array,a0
  447.         move.l  d0,8(a0)
  448.         bsr     getnum
  449.         tst.l   d1
  450.         bne     gta1
  451.         lea     array,a0
  452.         move.l  d0,12(a0)
  453.         bsr     getnum
  454.         tst.l   d1
  455.         bne     gta1
  456.         lea     array,a0
  457.         move.l  d0,16(a0)
  458.         bsr     getnum
  459.         tst.l   d1
  460.         bne     gta1
  461.         lea     array,a0
  462.         move.l  d0,20(a0)
  463.         
  464. gta1:   rts
  465.         
  466. *********************************
  467. *                               *
  468. *********************************
  469. newobj:
  470.         move.l    #ply_Sizeof+2,d0
  471.     clr.w    d1                      ;m_alloc memory for object data
  472.     clr.w    d2
  473.     move.l    table,a0
  474.     move.l    m_alloc(a0),a0
  475.     jsr    (a0)
  476.     beq    errrts
  477.     move.l    a0,mptr
  478.         move.l  (a0),a1
  479.         lea     ply_Sizeof(a1),a1
  480.         move.b  #tpoly,object+ob_Type
  481.         move.w  #NEWPATH,(a1)+
  482.         move.l  #ply_Sizeof+2,len       ;set starting length of poly stuff
  483.         move.w  #1,numcom               ;set poly command counter to 1
  484.         move.l  #$7fffffff,object+ob_Left
  485.         move.l  #$7fffffff,object+ob_Top
  486.         move.l  #$80000000,object+ob_Right
  487.         move.l  #$80000000,object+ob_Bottom
  488.         bclr    #0,flag                 ;new obj has no data (yet...)
  489.         rts
  490.  
  491. *********************************
  492. *                               *
  493. *********************************
  494. d:
  495.         rts
  496.  
  497. *********************************
  498. *                               *
  499. *********************************
  500. g:
  501.         lea     numtable,a0
  502.         move.l  (a0),d0
  503.         move.l  #100,d1
  504.         sub.l   d0,d1
  505.         move.l  d1,d0
  506.         tst.l   d0                      ;check for 0% black (white)
  507.         bne     g1                      ;nope
  508.         move.b  #9,object+ob_FType
  509.         move.b  #0,object+ob_FColor
  510.         rts
  511.         
  512. g1:     cmp.l   #100,d0                 ;check for 100% black (black)
  513.         bne     g2
  514.         move.b  #9,object+ob_FType
  515.         move.b  #1,object+ob_FColor
  516.         rts
  517.         
  518. g2:     bset    #7,d0
  519.         move.b  d0,object+ob_FType      ;percentage fill type
  520.         move.b  #1,object+ob_FColor     ;set color to black
  521.         rts
  522.  
  523. *********************************
  524. *                               *
  525. *********************************
  526. G:
  527.         lea     numtable,a0
  528.         move.l  (a0),d0
  529.         cmp.l   #100,d0                 ;check for 100% black (black)
  530.         beq     G1                      ;yes
  531.         
  532.         cmp.l   #0,d0                   ;check for 0% black (white)
  533.         beq     G2                      ;yes
  534.         
  535.         move.l  d0,12(a0)               ;else add a new color
  536.         clr.l   (a0)
  537.         clr.l   4(a0)
  538.         clr.l   8(a0)
  539.         bsr     addcolor                ;returns PGScolor in d0
  540.         move.b  d0,object+ob_LColor     ;set the line color
  541.         move.b  #1,object+ob_LType      ;line type = solid
  542.         bra     G3
  543.         
  544. G1:     move.b  #1,object+ob_LType      ;fill type = solid
  545.         move.b  #0,object+ob_LColor     ;fill color = black
  546.         bra     G3
  547.         
  548. G2:     move.b  #1,object+ob_LType      ;fill type = solid
  549.         move.b  #1,object+ob_LColor     ;fill color = white
  550.         
  551. G3:     rts
  552.  
  553. *********************************
  554. *                               *
  555. *********************************
  556. i:
  557.         rts
  558.  
  559. *********************************
  560. *                               *
  561. *********************************
  562. j:
  563.         lea     numtable,a0
  564.         move.l  (a0),d0
  565.         cmp.l   #100,d0                 ;check for rouned ends
  566.         bne     j1                      ;no
  567.         move.b   #2,object+ob_LBegin
  568.         move.b   #2,object+ob_LEnd
  569.         rts
  570.  
  571. j1:     move.b   #0,object+ob_LBegin
  572.         move.b   #0,object+ob_LEnd
  573.         rts
  574.  
  575. *********************************
  576. *                               *
  577. *********************************
  578. J:
  579.         lea     numtable,a0
  580.         move.l  (a0),d0
  581.         cmp.l   #100,d0                 ;check for rounded ends
  582.         bne     J1                      ;no
  583.         move.b   #2,object+ob_LBegin
  584.         move.b   #2,object+ob_LEnd
  585.         rts
  586.  
  587. J1:     move.b   #0,object+ob_LBegin
  588.         move.b   #0,object+ob_LEnd
  589.         rts
  590.  
  591. *********************************
  592. *                               *
  593. *********************************
  594. k:      bsr     addcolor                        ;returns Pgscolor in d0
  595.         move.b  #9,object+ob_FType
  596.         move.b  d0,object+ob_FColor
  597.         rts
  598.         
  599. *********************************
  600. *                               *
  601. *********************************
  602. K:      bsr     addcolor                        ;returns Pgscolor in d0
  603.         move.b  #1,object+ob_LType
  604.         move.b  d0,object+ob_LColor
  605.         rts
  606.  
  607. *********************************
  608. *                               *
  609. *********************************
  610. M:
  611.         rts
  612.  
  613. *********************************
  614. *                               *
  615. *********************************
  616. w:
  617.         lea     numtable,a0
  618.         move.l  (a0),d0
  619.         move.w  d0,object+ob_LWidth    ;line width
  620.         rts
  621.  
  622. *********************************
  623. *                               *
  624. *********************************
  625. z:
  626.         rts
  627.  
  628. *********************************
  629. *                               *
  630. *********************************
  631. Z:
  632.         rts
  633.  
  634. *********************************
  635. *                               *
  636. *********************************
  637. C:
  638. c:
  639.         bset    #0,flag                 ;this obj has data
  640.         bset    #2,flag                 ;set the line flag ignore bit
  641.         move.l  #26,d0                  ;need to grow memory by 26
  642.         move.l  mptr,a0                 ;get address of memory into a0
  643.         move.l  table,a1                ;d0 = amount to grow by (see above)
  644.         move.l  m_grow(a1),a1
  645.         jsr     (a1)
  646.         beq     errrts                  ;get out if could not get memory
  647.         
  648.         move.l  mptr,a0
  649.         move.l  (a0),a0
  650.         add.l   len,a0                  ;set a0 to end of last object
  651.         lea     numtable,a1
  652.         
  653.         move.w  #CURVETO,(a0)+          ;put the command
  654.         
  655.         move.l  0(a1),d0
  656.         bsr     checkLR
  657.         move.l  d0,(a0)+
  658.         
  659.         move.l  4(a1),d0
  660.         bsr     checkTB
  661.         move.l  d0,(a0)+
  662.         
  663.         move.l  8(a1),d0
  664.         bsr     checkLR
  665.         move.l  d0,(a0)+
  666.         
  667.         move.l  12(a1),d0
  668.         bsr     checkTB
  669.         move.l  d0,(a0)+
  670.         
  671.         move.l  16(a1),d0
  672.         move.l  d0,curx
  673.         bsr     checkLR
  674.         move.l  d0,(a0)+
  675.         
  676.         move.l  20(a1),d0
  677.         move.l  d0,cury
  678.         bsr     checkTB
  679.         move.l  d0,(a0)+
  680.         
  681.         add.l   #26,len                 ;adjust the counters
  682.         addq.w  #1,numcom
  683.         rts
  684.  
  685. *********************************
  686. *                               *
  687. *********************************
  688. L:
  689. l:
  690.         bset    #0,flag                 ;this obj has data
  691.         btst    #1,flag                 ;has the line flag been set yet?
  692.         bne     l1                      ;yes, so set the line flag ignore bit
  693.         bset    #1,flag                 ;else, set the line flag
  694.         bra     l2
  695. l1:     bset    #2,flag                 ;set the line flag ignore bit
  696. l2:     move.l  #10,d0                  ;need to grow memory by 8
  697.         move.l  mptr,a0                 ;get address of memory into a0
  698.         move.l  table,a1                ;d0 = amount to grow by (see above)
  699.         move.l  m_grow(a1),a1
  700.         jsr     (a1)
  701.         beq     errrts                  ;get out if could not get memory
  702.         
  703.         move.l  mptr,a0
  704.         move.l  (a0),a0
  705.         add.l   len,a0                  ;set a0 to end of last object
  706.         lea     numtable,a1
  707.         
  708.         move.w  #LINETO,(a0)+           ;put the command
  709.         
  710.         move.l  (a1),d0
  711.         move.l  d0,curx
  712.         bsr     checkLR
  713.         move.l  d0,(a0)+
  714.         
  715.         move.l  4(a1),d0
  716.         move.l  d0,cury
  717.         bsr     checkTB
  718.         move.l  d0,(a0)+
  719.         
  720.         add.l   #10,len                 ;adjust the counters
  721.         addq.w  #1,numcom
  722.         rts
  723.  
  724. *********************************
  725. *                               *
  726. *********************************
  727. m:
  728.         move.l  #10,d0                   ;need to grow memory by 8
  729.         move.l  mptr,a0                 ;get address of memory into a0
  730.         move.l  table,a1                ;d0 = amount to grow by (see above)
  731.         move.l  m_grow(a1),a1
  732.         jsr     (a1)
  733.         beq     errrts                  ;get out if could not get memory
  734.         
  735.         move.l  mptr,a0
  736.         move.l  (a0),a0
  737.         add.l   len,a0                  ;set a0 to end of last object
  738.         lea     numtable,a1
  739.         
  740.         move.w  #MOVETO,(a0)+           ;put the command
  741.         
  742.         move.l  0(a1),d0
  743.         move.l  d0,curx
  744.         bsr     checkLR
  745.         move.l  d0,(a0)+
  746.         
  747.         move.l  4(a1),d0
  748.         move.l  d0,cury
  749.         bsr     checkTB
  750.         move.l  d0,(a0)+
  751.         
  752.         add.l   #10,len                 ;adjust the counters
  753.         addq.w  #1,numcom
  754.         rts
  755.  
  756. *********************************
  757. *                               *
  758. *********************************
  759. t:
  760.         rts
  761. *********************************
  762. *                               *
  763. *********************************
  764. T:
  765.         rts
  766.         
  767. *********************************
  768. *                               *
  769. *********************************
  770. V:
  771. v:
  772.         bset    #0,flag                 ;this obj has data
  773.         bset    #2,flag                 ;set the line flag ignore bit
  774.         move.l  #26,d0                  ;need to grow memory by 26
  775.         move.l  mptr,a0                 ;get address of memory into a0
  776.         move.l  table,a1                ;d0 = amount to grow by (see above)
  777.         move.l  m_grow(a1),a1
  778.         jsr     (a1)
  779.         beq     errrts                  ;get out if could not get memory
  780.         
  781.         move.l  mptr,a0
  782.         move.l  (a0),a0
  783.         add.l   len,a0                  ;set a0 to end of last object
  784.         lea     numtable,a1
  785.         
  786.         move.w  #CURVETO,(a0)+          ;put the command
  787.         
  788.         move.l  curx,(a0)+
  789.         move.l  cury,(a0)+
  790.         
  791.         move.l  0(a1),d0
  792.         bsr     checkLR
  793.         move.l  d0,(a0)+
  794.         
  795.         move.l  4(a1),d0
  796.         bsr     checkTB
  797.         move.l  d0,(a0)+
  798.         
  799.         move.l  8(a1),d0
  800.         move.l  d0,curx
  801.         bsr     checkLR
  802.         move.l  d0,(a0)+
  803.         
  804.         move.l  12(a1),d0
  805.         move.l  d0,cury
  806.         bsr     checkTB
  807.         move.l  d0,(a0)+
  808.         
  809.         add.l   #26,len                 ;adjust the counters
  810.         addq.w  #1,numcom
  811.         rts
  812.  
  813.  
  814. *********************************
  815. *                               *
  816. *********************************
  817. Y:
  818. y:
  819.         bset    #0,flag                 ;this obj has data
  820.         bset    #2,flag                 ;set the line flag ignore bit
  821.         move.l  #26,d0                  ;need to grow memory by 26
  822.         move.l  mptr,a0                 ;get address of memory into a0
  823.         move.l  table,a1                ;d0 = amount to grow by (see above)
  824.         move.l  m_grow(a1),a1
  825.         jsr     (a1)
  826.         beq     errrts                  ;get out if could not get memory
  827.         
  828.         move.l  mptr,a0
  829.         move.l  (a0),a0
  830.         add.l   len,a0                  ;set a0 to end of last object
  831.         lea     numtable,a1
  832.         
  833.         move.w  #CURVETO,(a0)+          ;put the command
  834.         
  835.         move.l  0(a1),d0
  836.         bsr     checkLR
  837.         move.l  d0,(a0)+
  838.         
  839.         move.l  4(a1),d0
  840.         bsr     checkTB
  841.         move.l  d0,(a0)+
  842.         
  843.         move.l  8(a1),(a0)+
  844.         move.l  12(a1),(a0)+
  845.         
  846.         move.l  8(a1),d0
  847.         move.l  d0,curx
  848.         bsr     checkLR
  849.         move.l  d0,(a0)+
  850.         
  851.         move.l  12(a1),d0
  852.         move.l  d0,cury
  853.         bsr     checkTB
  854.         move.l  d0,(a0)+        
  855.         
  856.         add.l   #26,len                 ;adjust the counters
  857.         addq.w  #1,numcom
  858.         rts
  859.  
  860. *********************************
  861. *                               *
  862. *********************************
  863. b:
  864.         move.l  #4,d0                   ;need to grow memory by 4
  865.         move.l  mptr,a0                 ;get address of memory into a0
  866.         move.l  table,a1                ;d0 = amount to grow by (see above)
  867.         move.l  m_grow(a1),a1
  868.         jsr     (a1)
  869.         beq     errrts                  ;get out if could not get memory
  870.         
  871.         move.l  mptr,a0
  872.         move.l  (a0),a0
  873.         add.l   len,a0                  ;set a0 to end of last object
  874.         move.w  #CLOSEPATH,(a0)+        ;put the command
  875.         move.w  #FILLPATH,(a0)+
  876.         add.l   #4,len                  ;adjust the counters
  877.         addq.w  #2,numcom
  878.         bsr     finishobj
  879.         rts
  880.  
  881. *********************************
  882. *                               *
  883. *********************************
  884. B:
  885.         move.l  #2,d0                   ;need to grow memory by 2
  886.         move.l  mptr,a0                 ;get address of memory into a0
  887.         move.l  table,a1                ;d0 = amount to grow by (see above)
  888.         move.l  m_grow(a1),a1
  889.         jsr     (a1)
  890.         beq     errrts                  ;get out if could not get memory
  891.         
  892.         move.l  mptr,a0
  893.         move.l  (a0),a0
  894.         add.l   len,a0                  ;set a0 to end of last object
  895.         move.w  #FILLPATH,(a0)+
  896.         add.l   #2,len                  ;adjust the counters
  897.         addq.w  #1,numcom
  898.         bsr     finishobj
  899.         rts
  900.  
  901. *********************************
  902. *                               *
  903. *********************************
  904. f:
  905.         move.l  #4,d0                   ;need to grow memory by 2
  906.         move.l  mptr,a0                 ;get address of memory into a0
  907.         move.l  table,a1                ;d0 = amount to grow by (see above)
  908.         move.l  m_grow(a1),a1
  909.         jsr     (a1)
  910.         beq     errrts                  ;get out if could not get memory
  911.         
  912.         move.l  mptr,a0
  913.         move.l  (a0),a0
  914.         add.l   len,a0                  ;set a0 to end of last object
  915.         move.w  #CLOSEPATH,(a0)+        ;put the command
  916.         move.w  #FILLPATH,(a0)+
  917.         add.l   #4,len                  ;adjust the counters
  918.         addq.w  #2,numcom
  919.         
  920.         move.b  object+ob_LType,holdbyte
  921.         clr.b   object+ob_LType
  922.         bsr     finishobj
  923.         move.b  holdbyte,object+ob_LType
  924.         rts
  925.  
  926. *********************************
  927. *                               *
  928. *********************************
  929. F:
  930.         move.l  #2,d0                   ;need to grow memory by 2
  931.         move.l  mptr,a0                 ;get address of memory into a0
  932.         move.l  table,a1                ;d0 = amount to grow by (see above)
  933.         move.l  m_grow(a1),a1
  934.         jsr     (a1)
  935.         beq     errrts                  ;get out if could not get memory
  936.         
  937.         move.l  mptr,a0
  938.         move.l  (a0),a0
  939.         add.l   len,a0                  ;set a0 to end of last object
  940.         move.w  #FILLPATH,(a0)+
  941.         add.l   #2,len                  ;adjust the counters
  942.         addq.w  #1,numcom
  943.         
  944.         move.b  object+ob_LType,holdbyte
  945.         clr.b   object+ob_LType
  946.         bsr     finishobj
  947.         move.b  holdbyte,object+ob_LType
  948.         rts
  949.  
  950. *********************************
  951. *                               *
  952. *********************************
  953. h:
  954. n:
  955.         move.l  #2,d0                   ;need to grow memory by 2
  956.         move.l  mptr,a0                 ;get address of memory into a0
  957.         move.l  table,a1                ;d0 = amount to grow by (see above)
  958.         move.l  m_grow(a1),a1
  959.         jsr     (a1)
  960.         beq     errrts                  ;get out if could not get memory
  961.         
  962.         move.l  mptr,a0
  963.         move.l  (a0),a0
  964.         add.l   len,a0                  ;set a0 to end of last object
  965.         move.w  #CLOSEPATH,(a0)+
  966.         add.l   #2,len                  ;adjust the counters
  967.         addq.w  #1,numcom
  968.         
  969.         move.b  object+ob_LType,holdbyte
  970.         move.b  object+ob_FType,holdbyte2
  971.         clr.b   object+ob_LType
  972.         clr.b   object+ob_FType
  973.         bsr     finishobj
  974.         move.b  holdbyte,object+ob_LType
  975.         move.b  holdbyte2,object+ob_FType
  976.         rts
  977.  
  978. *********************************
  979. *                               *
  980. *********************************
  981. H:
  982. N:
  983.         bsr     finishobj
  984.         rts
  985.  
  986. *********************************
  987. *                               *
  988. *********************************
  989. s:
  990.         move.l  #4,d0                   ;need to grow memory by 4
  991.         move.l  mptr,a0                 ;get address of memory into a0
  992.         move.l  table,a1                ;d0 = amount to grow by (see above)
  993.         move.l  m_grow(a1),a1
  994.         jsr     (a1)
  995.         beq     errrts                  ;get out if could not get memory
  996.         
  997.         move.l  mptr,a0
  998.         move.l  (a0),a0
  999.         add.l   len,a0                  ;set a0 to end of last object
  1000.         move.w  #CLOSEPATH,(a0)+        ;put the command
  1001.         move.w  #STROKEPATH,(a0)+
  1002.         add.l   #4,len                  ;adjust the counters
  1003.         addq.w  #2,numcom
  1004.         
  1005.         move.b  object+ob_FType,holdbyte
  1006.         clr.b   object+ob_FType
  1007.         bsr     finishobj
  1008.         move.b  holdbyte,object+ob_FType
  1009.         rts
  1010.  
  1011. *********************************
  1012. *                               *
  1013. *********************************
  1014. S:
  1015.         move.l  #2,d0                   ;need to grow memory by 2
  1016.         move.l  mptr,a0                 ;get address of memory into a0
  1017.         move.l  table,a1                ;d0 = amount to grow by (see above)
  1018.         move.l  m_grow(a1),a1
  1019.         jsr     (a1)
  1020.         beq     errrts                  ;get out if could not get memory
  1021.         
  1022.         move.l  mptr,a0
  1023.         move.l  (a0),a0
  1024.         add.l   len,a0                  ;set a0 to end of last object
  1025.         move.w  #STROKEPATH,(a0)+
  1026.         add.l   #2,len                  ;adjust the counters
  1027.         addq.w  #1,numcom
  1028.         
  1029.         move.b  object+ob_FType,holdbyte
  1030.         clr.b   object+ob_FType
  1031.         bsr     finishobj
  1032.         move.b  holdbyte,object+ob_FType
  1033.         rts
  1034.  
  1035. *********************************
  1036. *                               *
  1037. *********************************
  1038. u:
  1039.         ;move.l  table,a0
  1040.         ;move.l  o_begingroup(a0),a0
  1041.         ;jsr     (a0)
  1042.         rts
  1043.  
  1044. *********************************
  1045. *                               *
  1046. *********************************
  1047. U:
  1048.         ;move.l  table,a0
  1049.         ;move.l  o_endgroup(a0),a0
  1050.         ;jsr     (a0)
  1051.         rts
  1052.  
  1053. *********************************
  1054. *                               *
  1055. *********************************
  1056. p:
  1057.         rts
  1058.  
  1059. *********************************
  1060. *                               *
  1061. *********************************
  1062. O:
  1063.         rts
  1064.  
  1065. *********************************
  1066. *                               *
  1067. *********************************
  1068. Q:
  1069.         rts
  1070.         
  1071. *********************************
  1072. *                               *
  1073. *********************************
  1074. q:
  1075.         rts
  1076.  
  1077.         
  1078. ***************************
  1079. ***                     ***
  1080. ***************************
  1081. checkLR:
  1082.         cmp.l   object+ob_Left,d0
  1083.         bge     checkR
  1084.         move.l  d0,object+ob_Left
  1085.         
  1086. checkR: cmp.l   object+ob_Right,d0
  1087.         ble     cklr2
  1088.         move.l  d0,object+ob_Right          
  1089. cklr2:  rts
  1090.         
  1091. ***************************
  1092. ***                     ***
  1093. ***************************
  1094. checkTB:
  1095.         cmp.l   object+ob_Top,d0
  1096.         bge     checkB
  1097.         move.l  d0,object+ob_Top
  1098.         
  1099. checkB: cmp.l   object+ob_Bottom,d0
  1100.         ble     cktb2
  1101.         move.l  d0,object+ob_Bottom
  1102. cktb2:  rts
  1103.  
  1104.  
  1105. ***************************
  1106. ***                     ***
  1107. ***************************
  1108. adjcoords:                              ;a0 = start address
  1109.         move.l  a0,savea0
  1110.         move.l  d0,saved0
  1111.         move.l  object+ob_Left,d1       ;d0 = number of 'commands'
  1112.         move.l  object+ob_Top,d2
  1113.         bra     adjc3
  1114.         
  1115. adjc1:  move.w  (a0)+,d3
  1116.         cmp.w   #STROKEPATH,d3          ;skip STROKEPATH
  1117.         beq     adjc3
  1118.         
  1119.         cmp.w   #FILLPATH,d3            ;skip FILLPATH
  1120.         beq     adjc3    
  1121.         
  1122.         cmp.w   #NEWPATH,d3             ;skip NEWPATH
  1123.         beq     adjc3
  1124.         
  1125.         cmp.w   #CLOSEPATH,d3           ;skip CLOSEPATH
  1126.         beq     adjc3
  1127.         
  1128.         cmp.w   #CURVETO,d3
  1129.         beq     adjc2
  1130.         
  1131.         sub.l   d1,(a0)+                ;LINETO & MOVETO have 1 point
  1132.         sub.l   d2,(a0)+
  1133.         bra     adjc3        
  1134.         
  1135. adjc2:  sub.l   d1,(a0)+                ;CURVETO has 3 points
  1136.         sub.l   d2,(a0)+
  1137.         sub.l   d1,(a0)+
  1138.         sub.l   d2,(a0)+
  1139.         sub.l   d1,(a0)+
  1140.         sub.l   d2,(a0)+
  1141.         
  1142. adjc3:  dbf     d0,adjc1
  1143.  
  1144.         move.l  saved0,d0
  1145.         move.l  savea0,a0
  1146.         
  1147.         move.l  object+ob_Bottom,d1
  1148.         sub.l   object+ob_Top,d1
  1149.         bra     adjc19
  1150.  
  1151. adjc11: move.w  (a0)+,d3                ;get the command
  1152.         
  1153.         cmp.w   #STROKEPATH,d3          ;skip STROKEPATH
  1154.         beq     adjc19
  1155.         
  1156.         cmp.w   #FILLPATH,d3            ;skip FILLPATH
  1157.         beq     adjc19   
  1158.         
  1159.         cmp.w   #NEWPATH,d3             ;skip NEWPATH
  1160.         beq     adjc19
  1161.         
  1162.         cmp.w   #CLOSEPATH,d3           ;skip CLOSEPATH
  1163.         beq     adjc19
  1164.         
  1165.         cmp.w   #CURVETO,d3
  1166.         beq     adjc12
  1167.         
  1168.         add.l   #4,a0                   ;skip the X coord
  1169.         move.l  (a0),d2                 ;adjust the Y coord
  1170.         neg.l   d2
  1171.         add.l   d1,d2
  1172.         move.l  d2,(a0)+
  1173.         bra     adjc19
  1174.         
  1175. adjc12: add.l   #4,a0                   ;skip over the X coord
  1176.         move.l  (a0),d2                 ;adjust the Y coord
  1177.         neg.l   d2
  1178.         add.l   d1,d2
  1179.         move.l  d2,(a0)+
  1180.         
  1181.         add.l   #4,a0                   ;skip over the X coord
  1182.         move.l  (a0),d2                 ;adjust the Y coord
  1183.         neg.l   d2
  1184.         add.l   d1,d2
  1185.         move.l  d2,(a0)+
  1186.         
  1187.         add.l   #4,a0                   ;skip over the X coord
  1188.         move.l  (a0),d2                 ;adjust the Y coord
  1189.         neg.l   d2
  1190.         add.l   d1,d2
  1191.         move.l  d2,(a0)+
  1192.         
  1193. adjc19: dbf     d0,adjc11        
  1194.         
  1195. adjc20: rts
  1196.  
  1197. ***********************************
  1198. ***                ***
  1199. ***********************************
  1200. adjobj:
  1201.         move.l  object+ob_Top,d1
  1202.         move.l  object+ob_Bottom,object+ob_Top
  1203.         move.l  d1,object+ob_Bottom
  1204.         
  1205.         move.l  ytop,d1
  1206.         sub.l   ybottom,d1
  1207.         move.l  object+ob_Top,d2
  1208.         neg.l   d2
  1209.         add.l   d1,d2
  1210.         move.l  d2,object+ob_Top
  1211.         
  1212.         move.l  object+ob_Bottom,d2
  1213.         neg.l   d2
  1214.         add.l   d1,d2
  1215.         move.l  d2,object+ob_Bottom
  1216.         
  1217. adjo2:  rts
  1218.  
  1219. ***************************
  1220. ***                     ***
  1221. ***************************
  1222. setobjdef:
  1223.         clr.b   object+ob_Flag
  1224.         clr.w   object+ob_Slant
  1225.         clr.w   object+ob_Twist        
  1226.         clr.w   object+ob_HStandOff   
  1227.         clr.w   object+ob_VStandOff
  1228.         rts
  1229.         
  1230. ***********************************
  1231. ***                             ***
  1232. ***********************************
  1233. finishobj:
  1234.         btst    #0,flag                 ;does this obj have any data?
  1235.         beq     fini4                   ;no, so get out
  1236.  
  1237.         btst    #2,flag                 ;should I ignore the line flag bit?
  1238.         bne     fini0                   ;yes
  1239.         
  1240.         btst    #1,flag                 ;is the data only 1 lineto command?
  1241.         beq     fini0                   ;no, so handle object as a poly
  1242.         
  1243.         ;handle object as a line object
  1244. lin1:   move.b  #thvln,object+ob_Type   ;force a hori/vert line to start with
  1245.         move.l  object+ob_Left,d0
  1246.         move.l  object+ob_Right,d2
  1247.         move.l  object+ob_Top,d1
  1248.         move.l  object+ob_Bottom,d3
  1249.         cmp.l   d2,d0                   ;is it a horizontal line?
  1250.         beq     lin2                    ;yes
  1251.         cmp.l   d3,d1                   ;is it a vertical line?
  1252.         beq     lin2                    ;yes
  1253.         move.b  #tdln,object+ob_Type    ;object is a diag line
  1254.  
  1255. lin2:   cmp.l   d2,d0                   ;is right edge > left edge
  1256.         bcs     lin3                    ;yes, so do nothing
  1257.         move.l  d2,object+ob_Left       ;else, switch 'em
  1258.         move.l  d0,object+ob_Right
  1259.         
  1260. lin3:   cmp.l   d3,d1                   ;is bottom edge > top edge 
  1261.         bcs     lin4                    ;yes, so do nothing
  1262.         move.l  d3,object+ob_Top        ;else switch 'em
  1263.         move.l  d1,object+ob_Bottom
  1264.         
  1265. lin4:   bsr     putobj
  1266.         bra     fini4                   ;free mem for object and exit
  1267.  
  1268. fini0:  move.l  mptr,a0
  1269.         move.l  (a0),a0
  1270.         clr.l   d0
  1271.         move.l  len,d0
  1272.         move.l  d0,ply_Length(a0)
  1273.         
  1274.         move.l  object+ob_Right,d1
  1275.         sub.l   object+ob_Left,d1
  1276.         move.l  d1,ply_Width(a0)
  1277.         
  1278.         move.l  object+ob_Bottom,d0
  1279.         sub.l   object+ob_Top,d0
  1280.         move.l  d0,ply_Height(a0)
  1281.         
  1282.         add.l   d1,d0                   ;does the objetc have any dimension?
  1283.         tst.l   d0                      ;
  1284.         beq     fini4                   ;no, so throw it away
  1285.                 
  1286.         move.w  #100,ply_XScale(a0)
  1287.         move.w  #100,ply_YScale(a0)
  1288.         move.w  numcom,ply_Count(a0)
  1289.         
  1290.         tst.w   object+ob_LWidth
  1291.         bne     fini1
  1292.         
  1293.         move.b  #1,object+ob_LColor
  1294.         move.b  #0,object+ob_LType
  1295.      
  1296. fini1:  move.l  mptr,a0
  1297.         move.l  (a0),a0
  1298.         lea     ply_Sizeof(a0),a0
  1299.         clr.l   d0
  1300.         move.w  numcom,d0
  1301.         bsr     adjcoords
  1302.         bsr     putobj
  1303.  
  1304.     move.l    mptr,a0
  1305.     move.l    (a0),a0
  1306.     move.l    (a0),d0
  1307.     move.l    table,a0
  1308.     move.l    o_malloc(a0),a0
  1309.     jsr    (a0)
  1310.     beq    errrts
  1311.  
  1312.     move.l    mptr,a1
  1313.     move.l    (a1),a1
  1314.     move.l    (a1),d0
  1315.     lsr.l    #1,d0
  1316.         move.l  d0,d1
  1317.         swap    d1
  1318.     bra    fini3
  1319. fini2:    move.w    (a1)+,(a0)+
  1320. fini3:    dbf    d0,fini2
  1321.         dbf     d1,fini3
  1322.  
  1323. fini4:  move.l  mptr,a0
  1324.         move.l  table,a1
  1325.         move.l  m_delete(a1),a1
  1326.         jsr     (a1)
  1327.         move.l  #0,mptr
  1328.         bsr     newobj          ;set up for next object
  1329.         bclr    #1,flag         ;clear the bit flags
  1330.         bclr    #2,flag
  1331.         rts
  1332.  
  1333. ***********************************
  1334. ***                ***
  1335. ***********************************
  1336. addcolor:
  1337.         clr.l   d3
  1338.         lea     numtable,a0
  1339. addc4:  move.l  0(a0),d0
  1340.         mulu    #100,d0
  1341.         move.w  d0,color+cl_Cyan
  1342.         move.l  4(a0),d0
  1343.         mulu    #100,d0
  1344.         move.w  d0,color+cl_Magenta
  1345.         move.l  8(a0),d0
  1346.         mulu    #100,d0
  1347.         move.w  d0,color+cl_Yellow
  1348.         move.l  12(a0),d0
  1349.         mulu    #100,d0
  1350.         move.w  d0,color+cl_Black
  1351.         clr.w   color+cl_Type
  1352.         clr.w   color+cl_Map
  1353.         
  1354.         move.w  color+cl_Cyan,d0
  1355.         mulu    #255,d0
  1356.         divu    #10000,d0
  1357.         and.l   #$0000ffff,d0
  1358.         bsr     hex2ascii
  1359.         move.b  d0,colorname+5
  1360.         move.b  d1,colorname+6
  1361.         
  1362.         move.w  color+cl_Magenta,d0
  1363.         mulu    #255,d0
  1364.         divu    #10000,d0
  1365.         and.l   #$0000ffff,d0
  1366.         bsr     hex2ascii
  1367.         move.b  d0,colorname+7
  1368.         move.b  d1,colorname+8
  1369.         
  1370.         move.w  color+cl_Yellow,d0
  1371.         mulu    #255,d0
  1372.         divu    #10000,d0
  1373.         and.l   #$0000ffff,d0
  1374.         bsr     hex2ascii
  1375.         move.b  d0,colorname+9
  1376.         move.b  d1,colorname+10
  1377.         
  1378.         move.w  color+cl_Black,d0
  1379.         mulu    #255,d0
  1380.         divu    #10000,d0
  1381.         and.l   #$0000ffff,d0
  1382.         bsr     hex2ascii
  1383.         move.b  d0,colorname+11
  1384.         move.b  d1,colorname+12
  1385.  
  1386.         lea     colorname,a0            ;copy the color name into cl_Name
  1387.         lea     color+cl_Name,a1
  1388.         move.w  #13,d0
  1389. addc5:  move.b  (a0)+,(a1)+
  1390.         dbf     d0,addc5
  1391.       
  1392.         lea     color,a0                ;add the color to the global color tab
  1393.         move.l  table,a1
  1394.         move.l  newcolor(a1),a1
  1395.         jsr     (a1)
  1396.         move.l  d0,saved0
  1397.         
  1398.         lea     color,a0                ;add the color to the doc color tab
  1399.         move.l  table,a1
  1400.         move.l  findcolorname(a1),a1
  1401.         jsr     (a1)
  1402.         cmp.w   #$ffff,d0
  1403.         bne     addc51
  1404.         
  1405.         move.l  saved0,d0
  1406.         
  1407. addc51: 
  1408. addc6:  rts
  1409.  
  1410.  
  1411. ***********************************
  1412. ***                ***
  1413. ***********************************
  1414. hex2ascii:
  1415.         move.b  d0,d1
  1416.         and.b   #$f0,d0                 ;d0 = upper nibble
  1417.         lsr.b   #4,d0
  1418.         and.b   #$0f,d1                 ;d1 = lower nibble
  1419.         
  1420.         cmp.b   #$0a,d0                 ;is d0 greater or equal to 10
  1421.         bcc     h2a1                    ;yes
  1422.         or.b    #$30,d0                 ;if not make it into the ascii of 0-9
  1423.         bra     h2a2
  1424. h2a1:   add.b   #55,d0                  ;make it ascii A-F
  1425.  
  1426. h2a2:   cmp.b   #$0a,d1
  1427.         bcc     h2a3
  1428.         or.b    #$30,d1
  1429.         bra     h2a4
  1430. h2a3:   add.b   #55,d1
  1431.  
  1432. h2a4:   rts
  1433.  
  1434.  
  1435. *********************************
  1436. *                               *
  1437. *********************************
  1438. pgetl:    move.l    table,a1
  1439.     move.l    f_getl(a1),a1
  1440.     jsr    (a1)
  1441.     beq    errrts
  1442.     rts
  1443.  
  1444. *********************************
  1445. *                               *
  1446. *********************************
  1447. pgetw:    move.l    table,a1
  1448.     move.l    f_getw(a1),a1
  1449.     jsr    (a1)
  1450.     beq    errrts
  1451.         and.l   #$0000ffff,d0                   ;clean up d0
  1452.     rts
  1453.  
  1454. *********************************
  1455. *                               *
  1456. *********************************
  1457. pget:    move.l  a0,-(sp)
  1458.         move.l    table,a0
  1459.     move.l    f_get(a0),a0
  1460.     jsr    (a0)
  1461.     beq    errrts
  1462.         and.l   #$000000ff,d0                   ;clean up d0
  1463.         move.l  (sp)+,a0
  1464.     rts
  1465.  
  1466. *********************************
  1467. *                               *
  1468. *********************************
  1469. fget:    movem.l d0/d2-d4/a0-a2,-(sp)
  1470.         move.l    table,a0
  1471.     move.l    f_get(a0),a0
  1472.     jsr    (a0)
  1473.     beq    errrts
  1474.         and.l   #$000000ff,d0
  1475.         move.l  d0,d1
  1476.         movem.l (sp)+,d0/d2-d4/a0-a2
  1477.     rts
  1478.  
  1479. ***************************
  1480. ***                     ***
  1481. ***************************
  1482. putobj:    bsr     adjobj
  1483.         move.l    table,a1
  1484.     move.l    o_obj(a1),a1
  1485.     lea    object,a0
  1486.     jsr    (a1)
  1487.         beq     errrts
  1488.                 
  1489.         rts
  1490.         
  1491. ***********************************
  1492. ***                ***
  1493. ***********************************
  1494. errrts:
  1495.         move.l    savesp,sp
  1496.         tst.l   mptr
  1497.         beq     er1
  1498.         
  1499.         move.l  mptr,a0
  1500.         move.l  table,a1
  1501.         move.l  m_delete(a1),a1
  1502.         jsr     (a1)
  1503.         move.l  #0,mptr
  1504.         
  1505. er1:    jmp     abortobj
  1506.         
  1507.  
  1508. *******************************************************************
  1509. ***    called when the import routine choosen finds something    ***
  1510. ***    wrong with the file loaded.                ***
  1511. *******************************************************************
  1512. never:    clr.w    d0
  1513.     rts
  1514.  
  1515. maybe:    move.w    #1,d0
  1516.     rts
  1517.  
  1518. right:    move.w    #2,d0
  1519.     rts
  1520.         
  1521. *************************************************************
  1522. *************************************************************
  1523.  SECTION ADOBEILL,DATA,PUBLIC
  1524.  
  1525. special:
  1526.     dc.w    1
  1527.     dc.l    spcl1,0
  1528.  
  1529. routines:       dc.l    d,g,G,i,j,J,k,K,M,w,z,Z,c,C,l,L,m,t,T,v,V,y,Y
  1530.                 dc.l    b,B,f,F,n,N,s,S,u,U,p,H,h,O,Q,q,0
  1531.  
  1532. version:        dc.b    0,"$VER: "
  1533. name:            dc.b    "Illustrator v2.1.2",0
  1534.  
  1535. spcl1:    dc.b    "Object",0
  1536.  
  1537. holdbyte:       dc.b    0
  1538. holdbyte2:      dc.b    0
  1539.  
  1540. colorname:      dc.b    "Adobe00000000",0
  1541.  
  1542. bbox:        dc.b    "%BoundingBox:",0
  1543. epsfhdr:        dc.b    "%!PS-Adobe",0
  1544. signature1:     dc.b    "%Creator: Adobe Illustrator",0
  1545. signature2:     dc.b    "%Creator:Adobe Illustrator",0
  1546. endsetup:       dc.b    "%EndSetup",0
  1547. note:           dc.b    "%Note:",0
  1548. dataend:        dc.b    "%Trailer",0
  1549. commands:       dc.b    "dgGijJkKMwzZcClLmtTvVyYbBfFnNsSuUpHhOQq",0
  1550. ibmepsfhdr:    dc.b    $c5,$d0,$d3,$c6,0
  1551. test:           dc.b    "EPSF",0
  1552.  
  1553.  
  1554. *************************************************************
  1555. *************************************************************
  1556.  SECTION ADOBEILL,BSS,PUBLIC
  1557. savesp:        ds.l    1
  1558. temp:        ds.l    1
  1559. object:        ds.w    ob_SizeOf/2
  1560. color:          ds.w    cl_Sizeof/2
  1561. xleft:          ds.l    1
  1562. xright:         ds.l    1
  1563. ybottom:        ds.l    1
  1564. ytop:           ds.l    1
  1565. numindex:       ds.l    1
  1566. numcom:         ds.w    1
  1567. mptr:           ds.l    1
  1568. len:            ds.l    1
  1569. curx:           ds.l    1
  1570. cury:           ds.l    1
  1571. flag:           ds.l    1
  1572. savea0:         ds.l    1
  1573. saved0:         ds.l    1
  1574. fint:           ds.l    1
  1575. dcount:         ds.l    1
  1576. estart:         ds.l    1
  1577. numtable:       ds.l    64
  1578. array:          ds.l    6
  1579. charcount:      ds.l    1
  1580. chartable:      ds.b    256
  1581.  
  1582. ************************** CHANGES ******************************************
  1583. ;
  1584. ;       version 2.1.2
  1585. ;
  1586. ;       - added "clean up" code to pget? for d0
  1587. ;
  1588. ;
  1589. ;       version 2.1.1
  1590. ;
  1591. ;       - added support for the H and h commands
  1592. ;
  1593. ;       - added ability to skip the Q,q,O commands
  1594. ;
  1595. ;       - added a version string for 'version illustrator.import' to work
  1596. ;
  1597. ;       - added support for Mac Eps files (w/ mac file headers)
  1598. ;
  1599. ;       - fixed a bug when "growing" memory - did not matter in Amiga verison
  1600. ;         but caused crashes on the Atari.
  1601. ;
  1602. ;       - fixed bug when importing line objects - I now change them to actaul
  1603. ;         line objects and not poly objects that are only 1 line.
  1604. ;
  1605.  
  1606. ;
  1607. ;
  1608. ;       version 2.1.0
  1609. ;
  1610. ;       - initial release
  1611.