;_______________________________________________________________________ ; ; File: SonySWIM3AMIC.a ; ; Written by: Gary Rensberger 1-Feb-93 ; Broken out of SonySWIM3.a by Monte Benaresh 1/4/94. ; ; Copyright: © 1993-94 by Apple Computer, Inc., all rights reserved. ; ; Change History (most recent first): ; ; 1/31/94 LB Changed SWIM3 register accesses to use the new address table in ; SWIM3Vars. See comments in SonySWIM3.a. ; <1> 1/4/94 LB first checked in ;_______________________________________________________________________ ; ; AMIC DMA routines for Sony SWIM3 driver ; ; This file contains the hardware-specific routines for the AMIC DMA ; controller, used on PDM. These routines are installed into vectors ; which are called by the Sony SWIM3 floppy driver. ; ; To do: ;_______________________________________________________________________ with SWIM3Vars ;_______________________________________________________________________ ; ; Routine: jsr StartDMAAction ; Inputs: d0.l- DMA timeout value ; d1 - drive# ; a1 - Globals ; Outputs: none ; Destroys: d0,a0 ; Calls: none ; Called by: RawTrackRead, ReadRawHeader ; ; Function: This routine saves state in the DMARegSave area, and starts ; the DMA, returning to the caller's caller. ;_______________________________________________________________________ jStartAMICDMAAction movem.l a3/d1-d3,DMARegSave(a1) ; save state move.l (sp)+,DMACompletionPtr(a1) ; stuff the completion routine bsr.s StartDMATimeout ; start a time-out for the DMA movea.l DMABaseAddr(a1),a0 ; get ptr to DMA controller ori.b #(1< read ; = 1 -> write ; bits 0-30 -> transfer count ; Outputs: none ; Destroys: d0 ; Calls: ; Called by: ; ; Function: Sets up address, count, and direction for a DMA ; transfer. ;_______________________________________________________________________ jSetUpAMICDMAXfer move.l a2,-(sp) ; use a2 for DMA regs ptr movea.l DMABaseAddr(a1),a2 ; get ptr to DMA controller move.b d0,DMAFloppyCount+1(a2) lsr.w #8,d0 move.b d0,DMAFloppyCount(a2) ; setup the count move.w a0,d0 ; get 16-bit address move.b d0,DMAFloppyBase+3(a2) ; set floppy DMA buffer addr lsr.w #8,d0 move.b d0,DMAFloppyBase+2(a2) nop move.b DMAFloppyCS(a2),d0 ; get current reg value bclr #DMADIR,d0 ; assume DMA direction is 'read' btst.l #31,d0 ; test direction bit beq.s @read @write ori.b #(1<