home *** CD-ROM | disk | FTP | other *** search
/ BCI NET / BCI NET Dec 94.iso / archives / utilities / misc / call111.lha / call.s < prev    next >
Encoding:
Text File  |  1994-07-08  |  6.9 KB  |  329 lines

  1. ; ***********************************************************************
  2. ; *                                    *
  3. ; *                  CALL v1.11                *
  4. ; *  by Kafka of BARSK, with some help from CaPTein of BARSK.        *
  5. ; *  Usage: call 0582 13574   (instead of space you could use / or -)   *
  6. ; *  Uses CIAB timer A for timing the length of the tones.        *
  7. ; *                                    *
  8. ; *  Compiled with ASM-One 1.20                        *
  9. ; *  (YES I HAVE V1.25 but that one wount even compile on my        *
  10. ; *   A1200/28MHz/6Mb and V1.20 isn't working very well either...    *
  11. ; *   It's a shame that this great concept isn't well coded.)        *
  12. ; *                                    *
  13. ; *  You may change this source if you send the changed one to me!    *
  14. ; *  And if you are planning to make a commercial or shareware product    *
  15. ; *  out of this then contact me so that we can make an agreement.    *
  16. ; *                                    * 
  17. ; *  And if someone out there has more, AXE-related or not, tonecodes    *
  18. ; *  that you can send then please tell me.                *
  19. ; *                                    * 
  20. ; *  Jonas Elfström                            *
  21. ; *  Smedby                                *
  22. ; *  694 00  HALLSBERG                            *
  23. ; *  voice: (SWEDEN) (0)582 13574                    *
  24. ; *  INTERNET: uka101@suteam.hoe.se                    *
  25. ; *  NANNYMUD: s,e,e,s,s,w,mail kafka    :-)                *
  26. ; *                                    *
  27. ; ***********************************************************************
  28.  
  29.  
  30.     incdir    include:
  31.     include    exec/exec_lib.i
  32.  
  33.     include hardware/custom.i
  34.     include hardware/dmabits.i
  35.     include    hardware/cia.i
  36.     
  37.     SECTION    CALLER,CODE
  38.  
  39. ;************************************************************************
  40. BEGIN
  41.     move.l  a0,arg_pek
  42.     move.w  d0,length
  43. setup    bsr read_args
  44.     cmp.w    #0,d0
  45.     bne.s    .Error
  46.     bsr start
  47. .Error    moveq    #0,d0            ;leave without errormessage
  48.     rts
  49. ;************************************************************************
  50.  
  51. ;************************************************************************
  52. start    lea    $dff000,a0
  53.     lea    sindata,a1
  54.  
  55.     lea    nummer(pc),a2
  56.     lea    tonedata(pc),a3
  57.     lea    komb(pc),a4
  58.     
  59. loop
  60.     move.w    #%11111111,ADKCON(a0)    ; No modulation
  61.  
  62.     move.w    (a2),d0
  63.     add.w    d0,d0    ;2*d0 foer wordstep
  64.     add.w    d0,d0    ;2*d0 foer att det aer 2 data
  65.     move.w    (a4,d0),d1
  66.     move.w    2(a4,d0),d2
  67.  
  68.     add.w    d1,d1
  69.     add.w    d2,d2
  70.  
  71.     move.w    (a3,d1),d1
  72.     move.w    (a3,d2),d2            
  73.     cmp.w    #0,d1
  74.     beq.s    tyst
  75.  
  76.     Move.l    a1,(AUD0+ac_ptr)(a0)
  77.     move.w    #4,(AUD0+ac_len)(a0)
  78.     move.w    #64,(AUD0+ac_vol)(a0)
  79.     move.w    d1,(AUD0+ac_per)(a0)
  80.  
  81.     Move.l    a1,(AUD1+ac_ptr)(a0)
  82.     move.w    #4,(AUD1+ac_len)(a0)
  83.     move.w    #64,(AUD1+ac_vol)(a0)
  84.     move.w    d2,(AUD1+ac_per)(a0)
  85.  
  86.     move.w    #(DMAF_SETCLR!DMAF_AUD0!DMAF_AUD1!DMAF_MASTER),DMACON(a0)
  87.  
  88. tyst    bsr.s    w92ms
  89.  
  90.     move.w    #0,(AUD0+ac_vol)(a0)
  91.     move.w    #0,(AUD1+ac_vol)(a0)
  92.  
  93.     bsr.s    w92ms
  94.  
  95.     addq.l    #2,a2
  96.  
  97.     cmp.w    #$ffff,(a2)
  98.     bne.w    loop
  99.  
  100.     move.w    #0,(AUD0+ac_vol)(a0)
  101.     move.w    #0,(AUD1+ac_vol)(a0)
  102.     move.w    #(DMAF_AUD0!DMAF_AUD1),DMACON(a0)    ;stop sounddma
  103.     rts    ;exit
  104. ;************************************************************************
  105.  
  106. ;************************************************************************
  107. w92ms    lea    $bfd000,a5    ;CIAB 8520
  108.     move.b    ciacra(a5),d0
  109.     and.b    #%11000000,d0    ;Don't trash bits that
  110.     or.b    #%00001000,d0    ;we are not using...
  111.     move.b    d0,ciacra(a5)
  112. ;    move.b    #%01111111,ciaicr(a5)    ;clear all 8520 interupts
  113.  
  114.     move.b    #$ff,ciatalo(a5)    ;write $ffff to lo hi
  115.     move.b    #$ff,ciatahi(a5)    ;gives 91.54 ms...
  116.  
  117. busy_wait
  118.     btst    #0,ciaicr(a5)
  119.     beq.s    busy_wait
  120.     rts
  121. ;************************************************************************
  122.  
  123.     even
  124.  
  125. nummer    blk.w    256,0
  126.     dc.w    $ffff
  127.  
  128. tonedata        ;antal
  129.     dc.w    636    ;0    697 Hz
  130.     dc.w    575    ;1    770 Hz
  131.     dc.w    520    ;2    852 Hz
  132.     dc.w    471    ;3    941 Hz
  133.     dc.w    367    ;4    1209 Hz
  134.     dc.w    331    ;5    1336 Hz
  135.     dc.w    300    ;6    1477 Hz
  136.     dc.w    272    ;7    1633 Hz
  137.     dc.w    000    ;pause
  138.  
  139. komb    dc.w    3,5    ;0
  140.     dc.w    0,4    ;1
  141.     dc.w    0,5    ;2
  142.     dc.w    0,6    ;3
  143.     dc.w    1,4    ;4
  144.     dc.w    1,5    ;5
  145.     dc.w    1,6    ;6
  146.     dc.w    2,4    ;7
  147.     dc.w    2,5    ;8
  148.     dc.w    2,6    ;9
  149.     dc.w    3,4    ;10 *
  150.     dc.w    3,6    ;11 #
  151.     dc.w    8,8    ;pause (space eller / eller- )
  152.  
  153. ;************************************************************************
  154. arg_pek dc.l    0
  155. length    dc.w    0
  156.  
  157. Read_args
  158.     move.l    arg_pek(pc),a0
  159.     lea    nummer(pc),a1
  160.     move.w    #0,d2    
  161.     move.w    length,d0
  162.     cmp.w    #1,d0
  163.     beq.s    Noargs
  164.     cmp.w    #255,d0
  165.     bhi.w    Tomany
  166.     subq.w    #1,d0
  167.     moveq    #0,d1
  168. lop    move.w    d1,d2
  169.     add.w    d2,d2
  170.     addq.w    #1,d2
  171.     subi.b    #$30,(a0,d1.w)
  172.     cmp.b    #9,(a0,d1.w)
  173.     bhi.b    fel
  174.     move.b    (a0,d1.w),(a1,d2.w)
  175.  
  176. vidare    addq.w    #1,d1
  177.     cmp.w    d0,d1
  178.     bne.s    lop    
  179.  
  180.     add.w    d0,d0
  181.     move.w    #$ffff,(a1,d0)
  182.     moveq    #0,d0    
  183.     rts
  184. Noargs
  185.     bsr.w    no_args
  186.     move.w    #1,d0
  187.     rts        
  188. tomany
  189.     bsr    Dos_open
  190.     Move.l    d0,a6
  191.     jsr    -$3c(a6)    ;output
  192.     move.l    d0,d1
  193.     lea    Tomanytxt(pc),a0
  194.     move.l    a0,d2
  195.     move.l    #(Tomanytxtslut-Tomanytxt),d3
  196.     jsr    -$30(a6)    ;write    
  197.     move.w    #1,d0
  198.     rts        
  199.  
  200. fel    
  201.     cmp.b #" "-$30,(a0,d1.w)
  202.     bne.s    inte_space
  203.     move.b    #12,(a1,d2.w)
  204.     bra.s    vidare
  205. inte_space
  206.     cmp.b #"/"-$30,(a0,d1.w)
  207.     bne.s    inte_backslash
  208.     move.b    #12,(a1,d2.w)
  209.     bra.s    vidare
  210. inte_backslash
  211.     cmp.b #"-"-$30,(a0,d1.w)
  212.     bne.s    inte_bindestr
  213.     move.b    #12,(a1,d2.w)
  214.     bra.s    vidare
  215. inte_bindestr
  216.     cmp.b #"*"-$30,(a0,d1.w)
  217.     bne.s    inte_asterisk
  218.     move.b    #10,(a1,d2.w)
  219.     bra.s    vidare
  220. inte_asterisk
  221.     cmp.b #"#"-$30,(a0,d1.w)
  222.     bne.s    inte_hash
  223.     move.b    #11,(a1,d2.w)
  224.     bra.w    vidare
  225. inte_hash
  226.     cmp.b #"?"-$30,(a0,d1.w)
  227.     bne.s    inte_help
  228.     bsr.w    Helptxt
  229.     bra.s    rtsen
  230. inte_help
  231.     add.w    d0,d0
  232.     move.w    #$ffff,(a1,d0)
  233.     bsr.w    inte_bara_siffror
  234. rtsen    move.w    #2,d0
  235.     rts
  236.  
  237. no_args
  238.     bsr    Dos_open
  239.     Move.l    d0,a6
  240.     jsr    -$3c(a6)    ;output
  241.     move.l    d0,d1
  242.     lea    Noargstxt(pc),a0
  243.     move.l    a0,d2
  244.     move.l    #(Noargstxtslut-Noargstxt),d3
  245.     jsr    -$30(a6)    ;write    
  246.     rts
  247. inte_bara_siffror
  248.     bsr    Dos_open
  249.     Move.l    d0,a6
  250.     jsr    -$3c(a6)    ;output
  251.     move.l    d0,d1
  252.     lea    Badargs(pc),a0
  253.     move.l    a0,d2
  254.     move.l    #(Badargsslut-Badargs),d3
  255.     jsr    -$30(a6)    ;write    
  256.     rts
  257. Helptxt
  258.     bsr    Dos_open
  259.     Move.l    d0,a6
  260.     jsr    -$3c(a6)    ;output
  261.     move.l    d0,d1
  262.     lea    Htxt(pc),a0
  263.     move.l    a0,d2
  264.     move.l    #(htxtslut-htxt),d3
  265.     jsr    -$30(a6)    ;write    
  266.     rts
  267.  
  268. DOS_OPEN
  269.     LEA.L    doslib(PC),A1
  270.     MOVEQ    #0,D0
  271.     CALLEXEC OpenLibrary
  272.  
  273.     RTS
  274.     even
  275. doslib:    dc.b    "dos.library",0,0    
  276.     even
  277.         
  278.  
  279. Noargstxt
  280.     dc.b    "No args! Type 'call ?' for help.",$0d,$0a
  281. Noargstxtslut
  282.  
  283. Badargs
  284.     dc.b    "Bad args! Type 'call ?' for help.",$0d,$0a
  285. Badargsslut
  286.  
  287. Tomanytxt
  288.     dc.b    "To many chars in argument string! (max 255)",$0d,$0a
  289. Tomanytxtslut
  290. Htxt
  291.     dc.b    $9b,$33,$32,$6d,$0d,$0a,"Call"
  292.     dc.b    $9b,$33,$31,$6d
  293.     dc.b    " v1.11 (94) by "
  294.     dc.b    $9b,$33,$33,$6d,"Jonas Elfstrom"
  295.     dc.b    $9b,$33,$31,$6d
  296.     dc.b    " 1992",$0d,$0a,$0d,$0a
  297.     dc.b    "Just type 'call 123456' to dial that number!",$0d,$0a
  298.     dc.b    "Use space, backslash or minus for short pause.",$0d,$0a
  299.     dc.b    "For those who got AXE you can also use # and *.",$0d,$0a
  300.     dc.b    "And 'call ?' for this text...",$0d,$0a,$0d,$0a
  301.  
  302.     dc.b    "WARNING: USES CIAB TIMER A DIRECT"
  303.     dc.b    $0d,$0a
  304.     dc.b    "         DOESN'T CHECK IF AUDIOCHANNELS IS ALLOCATED"
  305.     dc.b    $0d,$0a
  306.     dc.b    "This program may not be used with commercial sofware or",$0d,$0a
  307.     dc.b    "in commercial purposes without permission from the author.",$0d,$0a
  308.     dc.b    "The author is not responsible for any damage of any kind"
  309.     dc.b    $0d,$0a
  310.     dc.b    "that this software might cause."
  311.     dc.b    $0d,$0a
  312.     dc.b    $0d,$0a
  313.     dc.b    "Reach author on INTERNET: uka101@suteam.hoe.se"
  314.     dc.b    $0d,$0a
  315.     dc.b    $0d,$0a
  316. Htxtslut
  317.     dc.b    "$VER: call 1.11 (94-06-08)"
  318.  
  319. ;************************************************************************
  320.  
  321.  
  322.     SECTION    Sampling,DATA_C
  323. SINDATA:
  324.     even
  325.     dc.b    0,90,127,90,0,-90,-127,-90
  326.  
  327.     END
  328.     
  329.