sys7.1-doc-wip/Drivers/Sony/SonyHdr.a
2019-07-27 22:37:48 +08:00

244 lines
10 KiB
Plaintext

;
; File: SonyHdr.a
;
; Written by: Larry Kenyon 4-May-82
;
; Copyright: © 1982-1990, 1992-1994 by Apple Computer, Inc., all rights reserved.
;
; Change History (most recent first):
;
; <SM9> 1/4/94 LB Added INCLUDEs of the files SonySWIM3AMIC.a and SonySWIM3GC.a,
; which contain vectorized hardware-specific DMA access routines.
; <SM8> 2/5/93 GMR Added universal checks for SWIM3Exists to header, to support
; SWIM3 on PDM.
; <SM7> 12/14/92 RC Restore Pre-PDM d2 with Horror Roll-in
; <SM5> 12/8/92 rab Removed a couple of PadForOverpatch conditionals that I missed.
; <SM4> 12/7/92 rab Roll in Horror changes. Comments follow…
; <H6> 6/3/92 SWC Added an include of DockingEqu.a.
; <H5> 11/14/91 SWC Added "WITH SonyDriveRec, SonyDriverVars" since driver and drive
; variables are now defined in record format.
; <H4> 11/14/91 SWC Added _SCCPoll macro to make it easier to change the code to
; handle the SCC modem port polling. Also cleaned up the comments.
; <H2> 10/18/91 CMP Added support for SWIM2. Also moved SonyRawTrack.a and SonyPatches.a
; so they were included before SonyRAM.a. Otherwise they don't get
; included into the RAM driver.
; <SM3> 5/17/92 kc Include PowerPrivEqu.
; <SM2> 4/27/92 JSM Get rid of conditionals: supportsDCD is always false,
; hasIopSwim, forROM, supportsMFM, forDiskDup, isUniversal are
; always true, this obsoletes the files SonyDCD.a and SonyRAM.a;
; left in the padForOverpatch conditional for now.
; <3> 6/12/91 LN removed #include 'HardwareEqu.a'
; <2> 1/11/90 CCH Added include of “HardwarePrivateEqu.a”.
; <2.5> 12/11/89 GGD Optimized universal Prime and Control dispatching to just jump
; through the vector, since both IOP and Classic drivers now use
; the same vectors.
; <2.4> 5/23/89 GGD Re-organized to allow assembly of both standard and IOP versions
; for universal ROM. Added driver header, and version equates from
; Sony.a
; <2.3> 4/29/89 GGD No changes to this file, entire Sony Driver is checked out and
; in as a group.
; <2.2> 4/10/89 gmr No changes to this file, entire Sony Driver is checked out and
; in as a group.
; <2.1> 2/21/89 GGD SWC/Added TimeVIADB conditionally if undefined.
; <2.0> 12/15/88 GGD No changes to this file, entire Sony Driver is checked out and
; in as a group.
; <1.2> 11/21/88 CCH Changed ForRam equates to ForRom.
; <1.1> 11/11/88 CCH Fixed Header.
; <1.0> 11/9/88 CCH Adding to EASE.
; <2.0> 10/7/88 rwh added support for IOP based sony driver
; <•1.9> 9/23/88 CCH Got rid of inc.sum.d and empty nFiles
; <1.8> 9/19/88 GGD SWC Added forDiskDup conditional and SonyDup.a include
; <1.7> 8/16/88 GGD No changes to this file, entire Sony Driver is checked out and
; in as a group.
; <1.6> 7/15/88 GGD No changes to this file, entire Sony Driver is checked out and
; in as a group.
; <1.5> 6/15/88 GGD No changes to this file, entire Sony Driver is checked out and
; in as a group.
; <1.4> 5/25/88 GGD No changes to this file, entire Sony Driver is checked out and
; in as a group.
; <1.3> 5/23/88 GGD No changes, entire sony driver checked out and in as a group.
; <1.2> 5/3/88 GGD No changes, entire sony driver checked out and in as a group.
; <1.1> 4/18/88 GGD Merged in MFM support <C437> by Steve Christensen Updated
; INCLUDEs / LOADs to eleminate xFiles and nFiles that are no
; longer used, in favor of the official Files from AIncludes
; <1.0> 2/12/88 BBM Adding file for the first time into EASE…
; <C437> 11/21/86 SWC Added supportsMFM conditional and SonyMFM.a include
; (conditionally) for MFM/SuperDrive support.
; <A351> 11/5/86 TJ Removed a few years worth of comments, added missing END
; statement ...
; <A216> 10/16/86 TJ Added nFSPrivate.a include so SonyRAM can get at HFSDebug.
; <C206> 10/12/86 bbm made changes to get mpw aincludes to work
; <C123> 10/1/86 TJ Swapped over to MPW type includes; added SONYICON.A source file
; include. (Sonyutil.a was getting ridiculuous.)
; 5/4/83 LAK Adapted from Twiggy driver.
;
;_______________________________________________________________________
;
; MacIntosh OS Sony Disk Driver
;
; written by Larry Kenyon 4-May-82
;
; Copyright © Apple Computer, Inc. 1982-1989
;
; This is the official Mac disk driver. It supports a
; Sony-type (16 us/nybble) 3-1/2 inch disk drive in both the internal
; and external ports. It is fully asynchronous to
; allow processing during power-up, seek and rotational
; latency times.
;
; Some of the lower level routines in this driver are
; very timing sensitive and therefore cannot be changed
; very easily.
;
; Seek, Eject, and PowerOn wait times are returned to the
; caller; the VIA timer 2 is used exclusively by this disk driver to
; measure these times and cause an interrupt back to this driver to
; continue or complete a task. To do this, the code is very
; "level-specific".
;
; A VBL task is used to look for disk-in-place and to power down
; disk drives after a couple second delay when they are no longer in
; use.
;
; Modification History:
;
; 04 May 83 LAK Adapted from Twiggy driver.
;
;<C37/3Jun86> LAK/CSL Support 2nd internal floppy drive for Aladdin.
;
;<C123/01oct86> TJ Swapped over to MPW type includes; added SONYICON.A
; source file include. (Sonyutil.a was getting ridiculuous.)
;
;<C206/12oct86> bbm made changes to get mpw aincludes to work
;
;<A216/16oct86> TJ Added nFSPrivate.a include so SonyRAM can get
; at HFSDebug.
;
;<A351/05nov86> TJ Removed a few years worth of comments, added
; missing END statement ...
;
;<C437/21nov86> SWC Added supportsMFM conditional and SonyMFM.a include
; (conditionally) for MFM/SuperDrive support.
;<1.8> SWC Added forDiskDup conditional and SonyDup.a include
; (conditionally) for building a RAM-based version
; of the driver for the Disk Duplicator program.
;_______________________________________________________________________
BLANKS ON
STRING ASIS
PRINT OFF
LOAD 'StandardEqu.d'
INCLUDE 'HardwarePrivateEqu.a' ; <1.1/12feb88>
INCLUDE 'PowerPrivEqu.a' ; <1.1/12feb88>
INCLUDE 'SonyEqu.a' ; <1.1/12feb88>
INCLUDE 'UniversalEqu.a' ; <2.4>
INCLUDE 'IOPequ.a' ; <2.4>
INCLUDE 'DockingEqu.a' ; <H6><SM4>
PRINT ON
PRINT NOGEN
BLANKS ON
STRING ASIS
DCDRfN EQU -2 ; use a different driver refnum
SonyRfN EQU -5 ; for direct-connect drives
Version SET 2 ; versions 2 supports MFM <1.1/29feb88>
; ————————————————————————————————————————————————————————————————————————————— <H4><SM4>
; _PollSCC handles polling the SCC modem port. The polling code is being <SM4>
; dropped into a macro so we can handle polling differently if needed, and <SM4>
; to handle overpatching. The macro expects A5 to point to the VIA1 register <SM4>
; containing the SCC's WR/REQ bit, and A6 to point to channel A's data register. <SM4>
MACRO ; <SM4>
_PollSCC ; <SM4>
TST.B (A5) ; throttle execution speed with a VIA access <SM4>
BSR.W PollSCC ; call patch code to do the polling <SM4>
ENDM ; <SM4>
DiskDrvr PROC EXPORT
; Here is the driver header
SonyHeader DC.W $4F00 ; read, write, control, status, needs lock
DC.W 0,0 ; no delay or EMask
DC.W 0 ; no menu
; Entry point offset table
DC.W UniDiskOpen-SonyHeader ; open <2.4>
DC.W UniDiskPrime-SonyHeader ; prime <2.4>
DC.W UniDiskControl-SonyHeader; control <2.4>
DC.W UniDiskStatus-SonyHeader; status <2.4>
DC.W UniDiskClose-SonyHeader ; close -- (NOT CLOSABLE) <2.4>
DC.B 5
DC.B '.Sony'
UniDiskOpen ; open <2.4>
TestFor SWIMIOPExists ; see if we have a SWIM IOP <2.4>
beq.w @chkSWIM3 ; if not, see if SWIM3 <2.4>
bra IopDiskOpen ; if SWIM IOP exists, use it <2.4>
@chkSWIM3 TestFor SWIM3Exists ; see if we have a SWIM3 <sm8>
beq.w DiskOpen ; if not, use old version <sm8>
bra SWIM3DiskOpen ; if SWIM3 exists, use it <sm8>
UniDiskPrime ; prime <2.4>
move.l JDiskPrime,-(sp) ; <2.5>
rts ; <2.5>
UniDiskControl ; control <2.4>
move.l JControl,-(sp) ; <2.5>
rts ; <2.5>
UniDiskStatus ; status <2.4>
TestFor SWIMIOPExists ; see if we have a SWIM IOP <2.4>
beq.w @chkSWIM3 ; if not, use non-IOP version <2.4>
bra IopDiskStatus ; if SWIM IOP exists, use it <2.4>
@chkSWIM3 TestFor SWIM3Exists ; see if we have a SWIM3 <sm8>
beq.w DiskStatus ; if not, use old version <sm8>
bra SWIM3DiskStatus ; if SWIM3 exists, use it <sm8>
UniDiskClose ; close -- (NOT CLOSABLE) <2.4>
TestFor SWIMIOPExists ; see if we have a SWIM IOP <2.4>
beq.w @chkSWIM3 ; if not, see if SWIM3 <2.4>
bra IopDiskClose ; if SWIM IOP exists, use it <2.4>
@chkSWIM3 TestFor SWIM3Exists ; see if we have a SWIM3 <sm8>
beq.w DiskClose ; if not, use old version <sm8>
bra SWIM3DiskClose ; if SWIM3 exists, use it <sm8>
INCLUDE 'SonyIOP.a'
INCLUDE 'SonySWIM3.a'
INCLUDE 'SonySWIM3AMIC.a' ; HW-specific DMA access routines for AMIC
INCLUDE 'SonySWIM3GC.a' ; HW-specific DMA access routines for Grand Central
INCLUDE 'Sony.a' ; Open, Control, Status calls
INCLUDE 'SonyRWT.a' ; Prime (high-level read/write)
INCLUDE 'SonyUtil.a' ; utility routines
include 'SonyIcon.a' ; icon & info support <C123/01oct86>
INCLUDE 'SonyRead.a' ; floppy read data, read addr marks
INCLUDE 'SonyWrite.a' ; floppy write data
INCLUDE 'SonyFormat.a' ; floppy format code
INCLUDE 'SonyMFM.a' ; MFM/SuperDrive support <C437/21nov86>
INCLUDE 'SonyDup.a' ; Disk Duplicator support <19aug88>
INCLUDE 'SonyRawTrack.a' ; Raw Track Dump control call <3> HJR <H2><SM4>
END ; <A351/05Nov86>