home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d1xx / d101 / psintrp.lha / PsIntrp / files.a < prev    next >
Text File  |  1987-09-05  |  16KB  |  891 lines

  1.  
  2. * file input
  3.  
  4. * in console.o
  5.    xref  start_console
  6.    xref  stop_console
  7.    xref  conmayread
  8.    xref  conputchar
  9.    xref  conputstr
  10.  
  11. * in ps.o
  12.    xref  ihandle,ohandle
  13.    xref  rastport,wbscreen
  14.    xref  intuitionbase
  15.    xref  graphicsbase
  16.    xref  mathffpbase
  17.    xref  mathtransbase
  18.  
  19.    xref  _quit
  20.  
  21.    xref  type_mismatch
  22.    xref  reinterp
  23.    xref  ipop
  24.    xref  r.ipush
  25.  
  26. * in lmath.o
  27.    xref  lmoddivu
  28. * in ffpa.o
  29.    xref  FFPFPA
  30.  
  31.  
  32.    xdef  the_window
  33.    xdef  viewport
  34.    xdef  abortps
  35.  
  36.    xdef  readln
  37.    xdef  runclose    called by _quit
  38.  
  39.    xdef  showreal
  40.    xdef  show8x
  41.    xdef  showdec
  42.    xdef  newline
  43.    xdef  getstr
  44.    xdef  msg,longmsg
  45.    xdef  ioinit
  46.    xdef  endio
  47.  
  48.  
  49.    section  one
  50.  
  51.    include  "ps.h"
  52.  
  53.  
  54.  
  55.    lref     CloseScreen,7
  56.    lref     CloseWindow,8
  57.    lref     OpenScreen,29
  58.    lref     OpenWindow,30
  59.  
  60. intuit   macro
  61.       move.l   A6,-(SP)
  62.       move.l   intuitionbase,A6
  63.       jsr      _LVO\1(A6)
  64.       move.l   (SP)+,A6
  65.       endm
  66.  
  67.  
  68. SysBase  equ   4
  69.  
  70.    lref     OpenLibrary,88
  71.  
  72.  
  73.    lref     Output,6
  74.    lref     Input,5
  75.    lref     Write,4
  76.    lref     Read,3
  77.    lref     DeleteFile,8
  78.    lref     Open,1
  79.    lref     Close,2
  80.    lref     IoErr,18
  81.    lref     LoadSeg,21
  82.    lref     UnLoadSeg,22
  83.    lref     IsInteractive,32
  84.  
  85.  
  86. IbufLen     equ   80
  87. RnameLen    equ   30
  88.  
  89. abortps
  90.    print    leaving
  91.    bra      _quit
  92.  
  93.  
  94.   DEF   run
  95.    bsr      ipop
  96.    cmp.w    #String,D2
  97.    bne      type_mismatch
  98.  
  99.    lea      runflag,A0
  100.    tst.b    (A0)
  101.    bne      .rierr
  102.  
  103.    move.l   D0,A0
  104.    move.w   (A0)+,D3
  105.    beq      .rnerr
  106.    cmp.w    #RnameLen,D3
  107.    bhi      .rnerr
  108.    lea      runname,A1
  109.    move.l   A1,D1
  110.    bra      2$
  111. 1$ move.b   (A0)+,(A1)+
  112. 2$ dbra     D3,1$
  113.    clr.b    (A1)
  114.    move.l   #1005,D2
  115.    call     Open
  116.    tst.l    D0
  117.    beq      .opnerr
  118.  
  119.    move.b   #$FF,runflag
  120.  
  121. * save standard input data
  122.    move.l   ihandle,s_ihandle
  123.    move.l   bufptr,s_bufptr
  124.    move.b   bufchcount,s_bufchcount
  125.    move.w   #IbufLen+4,D3
  126.    lea      ilen,A0
  127.    lea      s_ibuf,A1
  128.    bra      4$
  129. 3$ move.b   (A0)+,(A1)+
  130. 4$ dbra     D3,3$
  131.  
  132. * initialize for run file
  133.    move.l   D0,ihandle
  134.    lea      ibuf,A0
  135.    move.l   A0,bufptr
  136.    clr.b    bufchcount
  137.    rts
  138.  
  139. runclose
  140.    st       D0          signal exhausted
  141.    lea      runflag,A0
  142.    tst.b    (A0)
  143.    bne      1$
  144.    lea      backgroundflag,A0
  145.    tst.b    (A0)
  146.    beq      5$
  147.    clr.b    (A0)
  148.    moveq    #0,D0
  149.    rts
  150.  
  151. 1$ clr.b    (A0)
  152.  
  153.    move.l   ihandle,D1
  154.    call     Close
  155.  
  156. * restore standard input data
  157.    move.l   s_ihandle,ihandle
  158.    move.l   s_bufptr,bufptr
  159.    move.b   s_bufchcount,bufchcount
  160.    move.w   #IbufLen+4,D3
  161.    lea      ilen,A1
  162.    lea      s_ibuf,A0
  163.    bra      4$
  164. 3$ move.b   (A0)+,(A1)+
  165. 4$ dbra     D3,3$
  166.    move.b   bufchcount,D0
  167. 5$ rts
  168.  
  169. .rierr
  170.    print    ri_err
  171.    bra      reinterp
  172. .rnerr
  173.    print    rn_err
  174.    bra      reinterp
  175. .opnerr
  176.    print    op_err
  177.    bra      reinterp
  178.  
  179.    bstr     ri_err,<can''t imbed run files>
  180.    bstr     rn_err,<bad file name>
  181.    bstr     op_err,<can''t open file>
  182.    bstr     leaving,<problem of some sort>
  183.    cnop     0,2
  184.  
  185. * return A0 pointing to line and D3 length of line
  186. readln
  187.    move.l   bufptr,A0
  188.    move.l   A0,-(SP)
  189.    moveq    #0,D3       * no chars in line yet
  190. * back to here when was necessary to read more from file
  191. .rdln.cont
  192.    moveq    #0,D2
  193.    move.b   bufchcount,D2
  194.    bmi      5$          * this means file is exhausted
  195.    beq      .rdln.more
  196.  
  197.    subq.b   #1,D2
  198. 2$ cmp.b    #10,(A0)+
  199.    beq      4$
  200.    addq.b   #1,D3
  201. 3$ dbra     D2,2$
  202. * ran out of chars -- go get more
  203.    bra      .rdln.more
  204. * have one line -- check not empty
  205. 4$ tst.b    D3
  206.    bne      5$
  207.    move.l   A0,(SP)     * replace pointer to ret.
  208.    bra      3$
  209. 5$ move.l   A0,bufptr
  210.    move.b   D2,bufchcount
  211.    move.l   (SP)+,A0
  212.    rts
  213.  
  214.  
  215. .rdln.more
  216. * have partial line in buffer with D3 chars in it
  217.    move.l   (SP)+,A1    * beginning of partial line
  218. * while D3>0 move chars back to beginning of buffer
  219.    lea      ibuf,A0
  220.    move.l   A0,-(SP)    * for ret.
  221.    move.l   D3,-(SP)
  222.    subq.b   #1,D3
  223.    bmi      8$          * if line was of 0 length
  224. 6$ move.b   (A1)+,(A0)+
  225.    dbra     D3,6$
  226.  
  227. * fill remainder of buffer with 80-(D3) chars
  228. 8$ move.l   #IbufLen,D3
  229.    move.l   (SP)+,D0
  230.    sub.b    D0,D3
  231.    move.l   D0,-(SP)
  232.  
  233.    lea      ibuf,A1
  234.    add.l    D0,A1
  235. * save where to continue processing line
  236.    move.l   A1,-(SP)
  237.  
  238.    move.l   ihandle,D1
  239.    move.l   A1,D2
  240. *   call     Read
  241.    bsr      nread
  242.  
  243.    tst.b    D0
  244.    bne      9$
  245.    bsr      runclose
  246. 9$ move.b   D0,bufchcount
  247.  
  248.    move.l   (SP)+,A0       * continue processing here
  249.    move.l   (SP)+,D3       * chars scanned so far
  250.    bra      .rdln.cont
  251.  
  252.  
  253. showreal
  254.    move.l   D0,D7
  255.    jsr      FFPFPA
  256.    lea      olen,A1
  257.    move.l   A1,A0
  258.    move.b   #14,(A1)+
  259.    moveq    #6,D1
  260. 1$ move.w   (SP)+,(A1)+
  261.    dbra     D1,1$
  262.    bsr      fmtfloat
  263. *   bra      msg
  264.    rts
  265.  
  266. fmtfloat
  267.    cmp.b    #'0',13(A0)    would be too many digits?
  268.    bne      10$
  269.    cmp.b    #'4',10(A0)    last digit often wrong
  270.    bhi      89$
  271.    move.b   #'0',10(A0)
  272. 89$
  273.    cmp.b    #'-',12(A0)
  274.    bne      100$
  275.    moveq    #10,D2
  276.    moveq    #0,D1
  277. 90$
  278.    cmp.b    #'0',0(A0,D2.w)
  279.    bne      91$
  280.    subq.l   #1,D2
  281.    addq.l   #1,D1
  282.    bra      90$
  283. 91$
  284.    move.b   14(A0),D3
  285.    sub.b    #'0',D3
  286.    cmp.b    D1,D3
  287.    bgt      10$
  288.    move.l   D2,D1
  289.    add.l    D3,D1
  290. 92$
  291.    move.b   0(A0,D2.w),D0
  292.    cmp.b    #'.',D0
  293.    bne      93$
  294.    move.b   #'0',D0
  295.    addq     #1,D2
  296. 93$
  297.    move.b   D0,0(A0,D1.w)
  298.    subq     #1,D2
  299.    subq     #1,D1
  300.    cmp      #2,D1
  301.    bne      92$
  302.  
  303.    move.b   #'0',14(A0)
  304.  
  305. 100$
  306.    move.b   #'0',11(A0)
  307.    moveq    #0,D3
  308.    move.b   14(A0),D3
  309.    sub.b    #'0',D3
  310.    movem.l  A0/A1,-(SP)
  311.    lea      2(A0),A1
  312.    lea      3(A0),A0
  313.    bra      2$
  314. 1$ move.b   (A0)+,(A1)+
  315. 2$ dbra     D3,1$
  316.    move.b   #'.',(A1)
  317.    movem.l  (SP)+,A0/A1
  318.  
  319.    moveq    #11,D3
  320.    move.b   D3,(A0)
  321. 3$ cmp.b    #'0',0(A0,D3.w)
  322.    bne      4$
  323.    sub.b    #1,(A0)
  324.    subq     #1,D3
  325.    bra      3$
  326.  
  327. 4$ cmp.b    #'.',0(A0,D3.w)
  328.    bne      5$
  329.    sub.b    #1,(A0)
  330.    cmp.b    #1,(A0)
  331.    bne      5$
  332.    move.b   #'0',1(A0)
  333.    rts
  334. 5$
  335.  
  336. 10$
  337.    cmp.b    #'+',1(A0)     remove initial +
  338.    bne      11$
  339.    move.b   (A0)+,D0
  340.    subq.b   #1,D0
  341.    move.b   D0,(A0)
  342. 11$
  343.    rts
  344.  
  345. show8x
  346.    bsr      binhex
  347.    lea      olen,A0
  348.  
  349.    move.l   A0,A1
  350.    move.b   (A1)+,D1
  351. 1$ cmp.b    #'0',(A1)+
  352.    bne      2$         *msg
  353.    subq.b   #1,D1
  354.    beq      2$         *msg
  355.    addq.l   #1,A0
  356.    move.b   D1,(A0)
  357.    bra      1$
  358. 2$ rts
  359.  
  360. showdec
  361.    lea      obuf,A2
  362.    lea      10(A2),A2
  363.    moveq    #8,D3
  364.    move.l   D0,-(SP)
  365.    move.l   D0,D1
  366.    bpl      3$
  367.    neg.l    D1
  368. 3$ moveq    #10,D2
  369.    jsr      lmoddivu    D1/D2->D1, rem in D0
  370.    move.b   D0,-(A2)
  371.    add.b    #'0',(A2)
  372.    dbra     D3,3$
  373.  
  374.    moveq    #9,D1
  375. 4$ cmp.b    #'0',(A2)
  376.    bne      6$
  377.    subq     #1,D1
  378.    beq      5$
  379.    addq.l   #1,A2
  380.    bra      4$
  381. 5$ addq     #1,D1
  382. 6$ move.l   (SP)+,D0
  383.    bpl      7$
  384.    move.b   #'-',-(A2)
  385.    addq     #1,D1
  386. 7$ move.b   D1,-(A2)
  387.    move.l   A2,A0
  388. *   bra      msg
  389.    rts
  390.  
  391. * D0 to hex in obuf
  392. binhex
  393.    move.b   #8,olen
  394.    lea      obuf,A0
  395.    add.l    #8,A0
  396.    lea      hextab,A1
  397.    moveq    #7,D1
  398. 1$ move.l   D0,D2
  399.    and.l    #15,D2
  400.    move.b   0(A1,D2),-(A0)
  401.    lsr.l    #4,D0
  402.    dbra     D1,1$
  403.    rts
  404.  
  405. hextab   dc.b  '0123456789ABCDEF'
  406.  
  407. nread
  408.    tst.w    runflag     i.e., run or background
  409.    beq      conreadln
  410.    call     Read
  411.    rts
  412.  
  413. CSI      equ   $9B
  414.  
  415. conreadln
  416.    move.l   D4,-(SP)
  417.    move.l   D2,A0
  418.    moveq    #0,D1
  419.    move.l   D1,D4
  420.  
  421.    tst.l    D3
  422.    beq      6$
  423.  
  424. 1$ movem.l  D1/A0,-(SP)
  425. 2$ bsr      conmayread
  426.    tst.l    D0
  427.    bmi      2$
  428.    cmp.b    #13,D0
  429.    bne      3$
  430.    move.b   #10,D0
  431. 3$
  432.    bsr      echochar
  433.    movem.l  (SP)+,D1/A0
  434.    bsr      csicheck
  435.    beq      1$
  436.    cmp.b    #10,D0
  437.    beq      41$
  438.    cmp.b    #8,D0
  439.    bne      4$
  440.    tst.l    D1
  441.    beq      5$
  442.    subq.l   #1,A0
  443.    subq.l   #1,D1
  444.    bra      5$
  445. 4$
  446.    cmp.b    #' ',D0
  447.    bcs      5$
  448. 41$
  449.    or.b     D4,D0
  450.    move.b   D0,(A0)+
  451.    addq.l   #1,D1
  452. 5$
  453.    cmp.l    D3,D1
  454.    beq      6$
  455.    cmp.b    #10,D0
  456.    bne      1$
  457. 6$ move.l   (SP)+,D4
  458.    move.l   D1,D0
  459.    rts
  460.  
  461. echochar
  462.    move.w   D0,-(SP)
  463.    cmp.b    #CSI,D0
  464.    beq      8$
  465.    cmp.b    #' ',D0
  466.    bcc      6$
  467.    cmp.b    #10,D0
  468.    beq      6$
  469.    cmp.b    #8,D0
  470.    beq      6$
  471.    cmp.b    #14,D0      shift in
  472.    bne      1$
  473.    move.b   #$80,D4
  474.    bra      6$
  475. 1$
  476.    cmp.b    #15,D0      shift out
  477.    bne      8$
  478.    clr.b    D4
  479. 6$
  480.    bsr      conputchar
  481. 8$
  482.    move.w   (SP)+,D0
  483.    rts
  484.  
  485. csicheck
  486.    cmp.b    #CSI,D0
  487.    bne      100$
  488.    movem.l  D1/A0,-(SP)
  489. 1$ bsr      conmayread
  490.    tst.l    D0
  491.    bmi      1$
  492.    cmp.b    #'A',D0     up
  493.    beq      3$
  494.    cmp.b    #'B',D0     down
  495.    beq      3$
  496.    cmp.b    #'C',D0     left
  497.    beq      3$
  498.    cmp.b    #'D',D0     right
  499.    beq      3$
  500. 2$ bsr      conmayread
  501.    tst.l    D0
  502.    bmi      2$
  503.    cmp.b    #'~',D0
  504.    bne      2$
  505. 3$
  506.    movem.l  (SP)+,D1/A0
  507. 100$
  508.    rts
  509.  
  510. getstr
  511.    bsr      readln
  512.    tst.l    D3
  513.    beq      _quit
  514.    move.l   A0,A1
  515.    lea      -1(A1,D3.W),A0
  516.    cmp.b    #10,(A0)       case of file that does not end w. NL
  517.    beq      1$
  518.    addq.l   #1,A0
  519. 1$ move.b   #0,(A0)
  520.    rts
  521.  
  522.  
  523.   DEF    file
  524.   ARG    String
  525.    move.l   D0,A1
  526.   ARG    String
  527.    move.l   D0,A0
  528.    move.w   (A1)+,D3
  529.    subq.w   #1,D3
  530.    bne      5$
  531.    move.b   (A1),D1
  532.    lea      stdinname,A1
  533.    bsr      st01cmp
  534.    bne      2$
  535.    cmp.b    #'r',D1
  536.    bne      5$
  537.    moveq    #1,D0
  538.    bra      4$
  539. 2$ lea      stdoutname,A1
  540.    bsr      st01cmp
  541.    bne      6$
  542.    cmp.b    #'w',D1
  543.    bne      5$
  544.    moveq    #2,D0
  545. 4$ RETURN    File
  546. 5$ ERR    badfa
  547. 6$ ERR    badfn
  548.  
  549.   DEF    read
  550.   ARG    File
  551.    subq.l   #1,D0
  552.    bne      3$
  553. 1$ bsr      conmayread
  554.    tst.l    D0
  555.    bmi      1$
  556.    bsr      2$
  557.    moveq    #-1,D0
  558.    RETURN    Boolean
  559. 2$ RETURN    Integer
  560. 3$ ERR   filerr
  561.  
  562.  
  563.   DEF    write
  564.   ARG    Integer
  565.    move.l   D0,D1
  566.   ARG    File
  567.    exg      D0,D1
  568.    subq.l   #2,D1
  569.    beq      conputchar
  570.   ERR   filerr
  571.  
  572. st01cmp
  573.    move.l   A0,-(SP)
  574.    move.w   (A0)+,D3
  575.    cmp.b    (A1)+,D3
  576.    bne      2$
  577.    subq.l   #1,D3
  578. 1$ cmp.b    (A0)+,(A1)+
  579.    dbne     D3,1$
  580. 2$ move.l   (SP)+,A0
  581.    rts
  582.  
  583. stdinname   dc.b  6,'%stdin'
  584. stdoutname  dc.b  7,'%stdout'
  585.    cnop     0,2
  586.  
  587. newline
  588.    move.b   #10,D0
  589. prtchr
  590.    move.b   D0,obuf
  591.    move.l   ohandle,D1
  592.    lea      obuf,A1
  593.    move.l   A1,D2
  594.    moveq    #1,D3
  595.    bra      .msg1
  596.  
  597. *  message to console
  598. msg
  599.    clr.l    D3
  600.    move.b   (A0)+,D3
  601. longmsg
  602.    move.l   ohandle,D1
  603.    move.l   A0,D2
  604. .msg1
  605. *   call     Write
  606.    bra      conputstr
  607. *   rts
  608.  
  609. * obtain pointer to AmigaDOS
  610. ioinit
  611.    move.l   SysBase,A6        * ready call to OpenLibrary
  612.  
  613.    lea      ilibname,A1
  614.    moveq    #0,D0
  615.    call     OpenLibrary
  616.    move.l   D0,intuitionbase
  617.    move.l   D0,A0
  618.    lea      $3C(A0),A0
  619.    move.l   (A0),A0
  620.    move.l   A0,wbscreen
  621.  
  622.    lea      $2C(A0),A1
  623.    move.l   A1,viewport
  624.  
  625.    lea      4(A0),A0
  626.  
  627.    move.l   (A0),A0
  628. *   move.l   A0,thiswindow
  629. 1$ move.l   (A0),D0
  630.    beq      2$
  631.    move.l   D0,A0
  632.    bra      1$
  633. 2$
  634. *   move.l   A0,doswindow
  635.  
  636.    lea      $32(A0),A0
  637.    move.l   (A0),rastport
  638.  
  639.    lea      glibname,A1
  640.    moveq    #0,D0
  641.    call     OpenLibrary
  642.    move.l   D0,graphicsbase
  643.  
  644.    lea      mlibname,A1
  645.    moveq    #0,D0
  646.    call     OpenLibrary
  647.    move.l   D0,mathffpbase
  648.  
  649.    lea      tlibname,A1
  650.    moveq    #0,D0
  651.    call     OpenLibrary
  652.    move.l   D0,mathtransbase
  653.  
  654.    lea      libname,A1
  655.    moveq    #0,D0
  656.    call     OpenLibrary
  657.    move.l   D0,A6
  658. *   move.l   D0,DOS_point
  659. * obtain file handles for output and input opened by CLI
  660.    call     Output
  661.    move.l   D0,ohandle
  662.    call     Input
  663.    move.l   D0,ihandle
  664.  
  665.    move.l   D0,D1
  666.    call     IsInteractive
  667.    tst.l    D0
  668.    bne      .ii1
  669.    move.b   #$FF,backgroundflag
  670. .ii1
  671.  
  672.  
  673.    ifne     HiRes
  674.    lea      my_screen,A0
  675.    intuit   OpenScreen
  676.    move.l   D0,the_screen
  677.    move.l   D0,the_screenb
  678.  
  679.    move.l   D0,A0
  680.    lea      $2C(A0),A0
  681.    move.l   A0,viewport
  682.  
  683.    lea      my_bwindow,A0
  684.    intuit   OpenWindow
  685.    move.l   D0,the_bwindow
  686.  
  687. * ShowTitle(FALSE) around here
  688.    move.l   D0,A0
  689.    lea      $32(A0),A0
  690.    move.l   (A0),rastport
  691.  
  692.    lea      my_window,A0
  693.    intuit   OpenWindow
  694.    move.l   D0,the_window
  695.  
  696.    bsr      start_console
  697.  
  698.    endc
  699.  
  700.    rts
  701.  
  702.  
  703. endio
  704.  
  705.    ifne  HiRes
  706.    bsr      stop_console
  707.  
  708.    move.l   the_window,A0
  709.    intuit   CloseWindow
  710.  
  711.    move.l   the_bwindow,A0
  712.    intuit   CloseWindow
  713.  
  714.    move.l   the_screen,A0
  715.    intuit   CloseScreen
  716.    endc
  717.    rts
  718.  
  719.  
  720.  
  721.  
  722.    section  fdata,data
  723.  
  724. bufptr         dc.l  ibuf
  725. bufchcount     dc.b  0,0
  726.  
  727. s_ihandle      dc.l  0
  728. s_bufptr       dc.l  0
  729. s_bufchcount   dc.b  0,0
  730. runflag        dc.b  0
  731. backgroundflag dc.b  0
  732.  
  733. iihandle    dc.l     0
  734. closeit     dc.l     0
  735.  
  736.    bstr  badfa,<unknown file attribute>
  737.    bstr  badfn,<only files %stdin/out>
  738.    bstr  filerr,<file error>
  739.  
  740.  
  741. *wname       dc.b     'CON:0/0/640/40/'
  742. signature    dc.b  ' ps  PostScript emulator, ) Greg Lee, April, 1986 ',0
  743.             cnop     0,2
  744.  
  745.  
  746.  
  747. ; ======================================================================== 
  748. ; === NewScreen ========================================================== 
  749. ; ======================================================================== 
  750. * STRUCTURE NewScreen,0
  751. *
  752. *    WORD ns_LeftEdge      ; initial Screen dimensions
  753. *    WORD ns_TopEdge      ; initial Screen dimensions
  754. *    WORD ns_Width      ; initial Screen dimensions
  755. *    WORD ns_Height      ; initial Screen dimensions
  756. *    WORD ns_Depth      ; initial Screen dimensions
  757. *
  758. *    BYTE ns_DetailPen      ; default rendering pens (for Windows too)
  759. *    BYTE ns_BlockPen      ; default rendering pens (for Windows too)
  760. *
  761. *    WORD ns_ViewModes      ; display "modes" for this Screen
  762. *
  763. *    WORD ns_Type      ; Intuition Screen Type specifier
  764. *
  765. *    APTR ns_Font      ; default font for Screen and Windows
  766. *
  767. *    APTR ns_DefaultTitle   ; Title when Window doesn't care
  768. *
  769. *    APTR ns_Gadgets      ; Your own initial Screen Gadgets
  770. *
  771. *    ; if you are opening a CUSTOMSCREEN and already have a BitMap 
  772. *    ; that you want used for your Screen, you set the flags CUSTOMBITMAP in
  773. *    ; the Types variable and you set this variable to point to your BitMap
  774. *    ; structure.  The structure will be copied into your Screen structure,
  775. *    ; after which you may discard your own BitMap if you want
  776. *    APTR ns_CustomBitMap;
  777. *
  778. * LABEL    ns_SIZEOF
  779. *
  780. *
  781.  
  782.  
  783. viewport       dc.l  0
  784.  
  785.    ifne  HiRes
  786. the_window     dc.l  0
  787.  
  788. my_screen
  789.    dc.w     0,0,640,400
  790.  
  791.    dc.w     NumPlanes         depth
  792.    dc.b     0,1
  793.    dc.w     $C004             modes
  794.    dc.w     $0F               type = custon
  795.    dc.l     screenfont        font
  796.    dc.l     signature         title
  797.    dc.l     0                 no gadgets
  798.    dc.l     0                 no bitmap
  799. *
  800.  
  801. the_bwindow    dc.l  0
  802.  
  803. my_bwindow
  804.  
  805.    dc.w     0,0,640,400
  806.    dc.b     0,1
  807.    dc.l     0
  808.  
  809. * flag req. (backdrop,) borderless, smart refresh, nocarerefresh
  810.    dc.l     $0800+$20000   (+$0100)
  811. *
  812.    dc.l      0             first gadget
  813.    dc.l      0             check mark
  814.    dc.l      signature      title
  815.  
  816. the_screenb
  817.    dc.l      0             screen
  818.  
  819.    dc.l      0             bitmap
  820.    dc.w     0,0         minimum width and height
  821.    dc.w     0,0         maximum width and height
  822.  
  823.    dc.w     $0F            type = customscreen
  824.  
  825.  
  826.  
  827. my_window
  828.  
  829.    dc.w     100,10,300,100
  830.    dc.b     0,2
  831.    dc.l     0              initial IDCMP state
  832.  
  833. * flags req. sizing, drag,
  834. * smart refresh , and activate
  835.    dc.l     $001003+$20000
  836. *
  837.    dc.l      0             first gadget
  838.    dc.l      0             check mark
  839.    dc.l      .amsname      title
  840.  
  841. the_screen
  842.    dc.l      0             screen
  843.  
  844.    dc.l      0             bitmap
  845.    dc.w     100,45         minimum width and height
  846.    dc.w     300,100        maximum width and height
  847.  
  848.    dc.w     $0F            type = customscreen
  849.  
  850. screenfont
  851.    dc.l     dfname
  852.    dc.w     9
  853.    dc.b     0
  854.    dc.b     %01
  855. dfname   dc.b  'topaz.font',0
  856.  
  857. .amsname    dc.b   ' ps'
  858.             dcb.b  30,' '
  859.             dc.b   0
  860.  
  861.  
  862.    endc
  863.  
  864. libname        dc.b  'dos.library',0
  865. ilibname       dc.b  'intuition.library',0
  866. glibname       dc.b  'graphics.library',0
  867. mlibname       dc.b  'mathffp.library',0
  868. tlibname       dc.b  'mathtrans.library',0
  869.  
  870. **************************
  871.  
  872.  
  873.  
  874.    section  fstr,bss
  875.  
  876.             ds.b  1     align ibuf
  877. ilen        ds.b  1
  878. ibuf        ds.b  IbufLen+2
  879.  
  880.  
  881.             ds.b  1     align obuf
  882. olen        ds.b  1
  883. obuf        ds.b  80
  884.  
  885. runname     ds.b  RnameLen+2
  886.  
  887. s_ibuf      ds.b  IbufLen+4
  888.  
  889.    end
  890.  
  891.