home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 109 / EnigmaAmiga109CD.iso / software / testi / corsoasm / sorgenti8 / lezione14-10c.s < prev    next >
Text File  |  1995-09-29  |  4KB  |  144 lines

  1.  
  2. ;  Lezione14-10c.s - Uso della routine player6.1a per un modulo non compresso
  3.  
  4. ; VERSIONE CIA! La routine P61_Music non va mai chiamata!
  5.  
  6.     SECTION    Usoplay61a,CODE
  7.  
  8. ;    Include    "DaWorkBench.s"    ; togliere il ; prima di salvare con "WO"
  9.  
  10. *****************************************************************************
  11.     include    "startup2.s" ; Salva Copperlist Etc.
  12. *****************************************************************************
  13.  
  14.         ;5432109876543210
  15. DMASET    EQU    %1000001111000000    ; solo copper DMA
  16.  
  17. WaitDisk    EQU    30    ; 50-150 al salvataggio (secondo i casi)
  18.  
  19. START:
  20.  
  21. ;­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  22. ;­ Call P61_Init to initialize the playroutine    ­
  23. ;­ D0 --> Timer detection (for CIA-version)    ­
  24. ;­ A0 --> Address to the module            ­
  25. ;­ A1 --> Address to samples/0            ­
  26. ;­ A2 --> Address to sample buffer        ­
  27. ;­ D0 <-- 0 if succeeded            ­
  28. ;­ A6 <-- $DFF000                ­
  29. ;­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  30.  
  31.     movem.l    d0-d7/a0-a6,-(SP)
  32.     moveq    #0,d0        ; Timer Detection: Autodetect
  33. ;    moveq    #1,d0        ; Timer Detection: PAL
  34. ;    moveq    #2,d0        ; Timer Detection: NTSC
  35.     lea    P61_data,a0    ; Indirizzo del modulo in a0
  36.     lea    $dff000,a6    ; Ricordiamoci il $dff000 in a6!
  37.     sub.l    a1,a1        ; I samples non sono a parte, mettiamo zero
  38.     sub.l    a2,a2        ; no samples -> modulo non compattato
  39.     bsr.w    P61_Init
  40.     movem.l    (SP)+,d0-d7/a0-a6
  41.  
  42.     lea    $dff000,a5
  43.     MOVE.W    #DMASET,$96(a5)        ; DMACON - abilita bitplane, copper
  44.                     ; e sprites.
  45.  
  46.     move.w    #$e000,$9a(a5)        ; INTENA - Abilito Master and lev6
  47.     move.l    #COPPERLIST,$80(a5)    ; Puntiamo la nostra COP
  48.     move.w    d0,$88(a5)        ; Facciamo partire la COP
  49.     move.w    #0,$1fc(a5)        ; Disattiva l'AGA
  50.     move.w    #$c00,$106(a5)        ; Disattiva l'AGA
  51.     move.w    #$11,$10c(a5)        ; Disattiva l'AGA
  52.  
  53. mouse:
  54.     MOVE.L    #$1ff00,d1    ; bit per la selezione tramite AND
  55.     MOVE.L    #$08000,d2    ; linea da aspettare = $80
  56. Waity1:
  57.     MOVE.L    4(A5),D0    ; VPOSR e VHPOSR - $dff004/$dff006
  58.     ANDI.L    D1,D0        ; Seleziona solo i bit della pos. verticale
  59.     CMPI.L    D2,D0        ; aspetta la linea $12c
  60.     BNE.S    Waity1
  61. Aspetta:
  62.     MOVE.L    4(A5),D0    ; VPOSR e VHPOSR - $dff004/$dff006
  63.     ANDI.L    D1,D0        ; Seleziona solo i bit della pos. verticale
  64.     CMPI.L    D2,D0        ; aspetta la linea $12c
  65.     BEQ.S    Aspetta
  66.  
  67. ; versione CIA, non occorre chiamare P61_music...
  68.  
  69.     btst    #6,$bfe001    ; mouse premuto?
  70.     bne.s    mouse
  71.  
  72. ;­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  73. ;­ Call P61_End to stop the music        ­
  74. ;­   A6 --> Customchip baseaddress ($DFF000)    ­
  75. ;­        Uses D0/D1/A0/A1/A3        ­
  76. ;­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  77.  
  78.     lea    $dff000,a6    ; Ricordiamoci il $dff000 in a6!
  79.     bsr.w    P61_End
  80.  
  81.     rts
  82.  
  83.  
  84. *****************************************************************************
  85. *         The Player 6.1A for Asm-One 1.09 and later             *
  86. *****************************************************************************
  87.  
  88. fade  = 0    ;0 = Normal, NO master volume control possible
  89.         ;1 = Use master volume (P61_Master)
  90.  
  91. jump = 0    ;0 = do NOT include position jump code (P61_SetPosition)
  92.         ;1 = Include
  93.  
  94. system = 0    ;0 = killer
  95.         ;1 = friendly
  96.  
  97. CIA = 1        ;0 = CIA disabled
  98.         ;1 = CIA enabled
  99.  
  100. exec = 1    ;0 = ExecBase destroyed
  101.         ;1 = ExecBase valid
  102.  
  103. opt020 = 0    ;0 = MC680x0 code
  104.         ;1 = MC68020+ or better
  105.  
  106. use = $2009559    ; Usecode (mettete il valore dato dal p61con al salvataggio
  107.         ; diverso per ogni modulo!)
  108.  
  109. *****************************************************************************
  110.     include    "play.s"    ; La routine vera e propria!
  111. *****************************************************************************
  112.  
  113.  
  114. *****************************************************************************
  115. ;    Copperlist
  116. *****************************************************************************
  117.  
  118.     SECTION    COP,DATA_C
  119.  
  120. COPPERLIST:
  121.     dc.w    $100,$200    ; bplcon0 - no bitplanes
  122.     DC.W    $180,$003    ; color0 nero
  123.     dc.W    $FFFF,$FFFE    ; fine della copperlist
  124.  
  125. *****************************************************************************
  126. ;    Modulo musicale convertito in formato P61, non compresso
  127. *****************************************************************************
  128.  
  129.     Section    modulozzo,data_C
  130.  
  131. ; Il modulo e' di DreamFish. Originale 42684, convertito 31628 (non packed!)
  132.  
  133. P61_data:
  134.     incbin    "P61.technochild"    ; non compresso, solo convertito.
  135.  
  136.     end
  137.  
  138. Questo e' un esempio di come usare l'opzione che usa interamente i timer
  139. CIA per temporizzare... per cui non occorre chiamare P61_Music ad ogni
  140. vertical blank. Comunque, vi consiglio di usare il sistema normale di
  141. chiamata a P61_Music ad ogni frame, almeno sapete con certezza "quando" viene
  142. eseguita.
  143.  
  144.