supermario/base/SuperMarioProj.1994-02-09/Internal/Asm/SCSIDiskModeEqu.a

176 lines
7.6 KiB
Plaintext
Raw Normal View History

2019-06-29 15:17:50 +00:00
;
; File: SCSIDiskModeEqu.a
;
; Contains: SCSI Disk Mode Transfer Equates
;
; Written by: James Blair
;
; Copyright: © 1992-1993 by Apple Computer, Inc. All rights reserved.
;
; This file is used in these builds: ROM
;
; Change History (most recent first):
;
; <SM2> 12/13/93 PN Roll in KAOs and Horror changes to support Malcom and AJ
; machines
; <SM1> 11/20/92 SWC Added to SuperMario from Horror. Horror changes below.
; <H4> 7/13/92 SWC jab/Fine tune low power display toggling.
; <H3> 7/13/92 SWC jab/Drawing extension for external video SDM.
; <H2> 6/25/92 SWC jab/Added DMA support.
; <H1> 3/4/92 jab First checked in.
;
; picture IDs
DiskModePICT EQU 95 ; SCSI symbol
Arrow1 EQU 96 ; these arrows mark data in motion - position 1
Arrow2 EQU 97 ; animated position 2
Arrow3 EQU 98 ; animated position 3
BattPICT EQU 99 ; low battery
DiskId_Base EQU 100 ; base resource number SCSI IDs
; bounding rectangle topLefts, relative to the topLeft of the DiskModePICT
ArrowsTop EQU 60 ; Arrows PICT DestRect Top
ArrowsLeft EQU 74 ; Arrows PICT DestRect Left
IDTop EQU 53 ; SCSI ID PICT DestRect Top
IDLeft EQU 43 ; SCSI ID PICT DestRect Left
BattTop EQU 62 ; SCSI Battery PICT DestRect Top
BattLeft EQU 36 ; SCSI Battery PICT DestRect Left
; miscellaneous
defaultID EQU 2 ; default SCSI ID for DiskMode if PRAM is weird
DimLevel EQU 1 ; minimum dimming level
horizDelta EQU 40 ; how many pixels the PICT moves each time
iconDelay EQU 3000 ; timing values for drawing delay <H2> <H3>
sbArrowDelay EQU 100 ; single bus timing values for drawing delay <H2> <H3>
dbArrowDelay EQU 2 ; dual bus timing values for drawing delay <H2> <H3>
transThres EQU 5000 ; threshold count value for low power warning <H4>
; ••••••• Stack Storage ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
DiskModeVars RECORD 0,DECREMENT
saveA5 ds.l 1
localA5 ds.l 1
thePort ds.l 1 ; my own QuickDraw (required!)
ds.b grafSize-4 ; other QuickDraw globals (except thePort)
myQDProcs ds.b qdProcsRec ; storage for QD bottleneck procs <H3>
oldBitsProcPtr ds.l 1 ; address of original bitsProc QD bottleneck proc <H3>
arrow3PictHndl ds.l 1 ; handle to third motion arrow
arrow2PictHndl ds.l 1 ; handle to second motion arrow
arrow1PictHndl ds.l 1 ; handle to first motion arrow
scsiIDPictHndl ds.l 1 ; handle to SCSI ID picture
battPICTHndl ds.l 1 ; handle to battery picture
scsiPictHndl ds.l 1 ; handle to SCSI symbol picture
arrowRect ds.w 4 ; bounds of motion arrows
scsiIDRect ds.w 4 ; bounds of SCSI ID
battRect ds.w 4 ; bounds of battery
scsiRect ds.w 4 ; bounds of SCSI symbol
ArrowDelay ds.l 1 ; how often to draw the arrows, in 500 usec intervals <H2>
maxRightX ds.w 1 ; the maximum X coordinate for the PICT drawing
deltaX ds.w 1 ; signed offset of how far to move each time
diskID ds.w 1 ; holds the virtual SCSI id of our DiskMode drive
whichArrow ds.w 1 ; which arrow to draw
diskStat ds.w 1 ; this word holds our DiskMode status
SavedSR ds.w 1 ; holds saved SR value <H2>
SBLvl2Hndlr ds.l 1 ; holds the old level 2 handler <H2>
drawTimerTsk ds.b 22 ; timer task for drawing the icon <H2>
backliteRefNum ds.w 1 ; Backlight driver's refNum
backliteMin ds.w 1 ; minimum backlight level
backliteMax ds.w 1 ; maximum backlight level
transCount ds.l 1 ; determines the state of the backlight <H2>
DrawCount ds.l 1 ; counter to tell us when it is ok to draw <H2>
SavedCDB ds.b 12 ; stored CDB for xfer specification <H2>
MyPort ds.b portRec
DiskModeVarsSize EQU *
ENDR
; ••••••• Backlight driver equates •••••••••••••••••••••••••••••••••••••••••••••••••••••
SetBrightness EQU $4301 ; set screen brightness
DisableSlideCtl EQU $4303 ; enable/disable slider control of brightness
GetBrightRange EQU $5303 ; get brightness range
; ••••••• DiskStat Bits and Equates ••••••••••••••••••••••••••••••••••••••••••••••••••••
ArrowMask EQU 3 ; bits 0-1 contain which arrow to draw
LowPower EQU 2 ; bit 2: draw low battery picture <H2>
DrawWarning EQU 3 ; bit 3: draw battery picture this time (alternate with SCSI ID)
BackLiteOff EQU 4 ; bit 4: backlight is currently off
DoingXfer EQU 5 ; bit 5: we are in a xfer routine <H2>
bitSEL EQU 6 ; bit 6: a SEL interrupt has occurred on diskID <H2>
; ••••••• SCSI Equates •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
a1_Int EQU a1
a2_Ext EQU a2
d3_IntStat EQU d3
IntSELMask EQU (1<<7)+(1<<0) ; mask for selecting internal ID 0
IntArbMask EQU (1<<7)
bitATN EQU 1
bitREQ EQU 3 ; REQ/ is bit 3 in sTCR
scsiBlkB EQU 512 ; number of bytes/block <H2>
; phase mask when CSR contents are shifted right 2 bits
phDO EQU ((0<<bMSG) | (0<<bCD) | (0<<bIO))>>2 ; data out
phDI EQU ((0<<bMSG) | (0<<bCD) | (1<<bIO))>>2 ; data in
phCMD EQU ((0<<bMSG) | (1<<bCD) | (0<<bIO))>>2 ; command
phStat EQU ((0<<bMSG) | (1<<bCD) | (1<<bIO))>>2 ; status
phMsgOut EQU ((1<<bMSG) | (1<<bCD) | (0<<bIO))>>2 ; message out
phMsgIn EQU ((1<<bMSG) | (1<<bCD) | (1<<bIO))>>2 ; message in
;•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• <H2>
;
; This stuff is only good until we turn off interrupts in Config ROM when it determines that we are
; going into DiskMode. It should be able to determine that we are going into SDM...it knows that
; we need interrupts turned off if the cable is attached.
;
;--------------------------------------------------------------------
; VSC Temporary Equates
;--------------------------------------------------------------------
vscBase EQU $FEE00000 ; base of the VSC on Deskbar/Gemini
slotIER EQU $12 ; Slot interrupt enable register
slotCIRQ EQU $03 ; 1=interrupts enabled from Slot C
slotDIRQ EQU $04 ; 1=interrupts enabled from Slot D
VBLIRQ EQU $06 ; 1=interrupts enabled from VBL
setEnable EQU $07 ; /1=set interrupt enables corresponding to 1's in bits 0-6
; \0=clear interrupt enables corresponding to 1's in bits 0-6
vscIER EQU $13 ; VSC interrupt enable register
scsiDRQEn EQU $00 ; 1=interrupts enabled from SCSI DMA Requests
anySlotEn EQU $01 ; 1=interrupts enabled from VBL or NuBus slot
ejectEn EQU $02 ; 1=interrupts enabled from eject mechanism
scsiEn EQU $03 ; 1=interrupts enabled from SCSI chip
enetEn EQU $04 ; 1=interrupts enabled from SONIC
;•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• <H2>