sys7.1-doc-wip/Internal/Asm/AppleDeskBusPriv.a

220 lines
8.8 KiB
Plaintext
Raw Normal View History

2020-03-22 08:44:21 +00:00
;
; Hacks to match MacOS (most recent first):
;
; <Sys7.1> 8/3/92 Reverted <SM2> by uncommenting talkCmd and listenCmd
; 9/2/94 SuperMario ROM source dump (header preserved below)
;
; Clean diff against SuperMario
;
2019-07-27 14:37:48 +00:00
;
; File: AppleDeskBusPriv.a
;
; Contains: This file holds equates private to the ADB implementation. It was separated out from
; Private.a so that feature-based conditionals can be used. As a result, this file
; should NEVER be included into a symbol dump (.d) file.
;
; Written by: Gary Davidian
;
; Copyright: © 1984-1992 by Apple Computer, Inc., all rights reserved.
;
; Change History (most recent first):
;
; <SM3> 7/7/92 CSS Remove includes to ApplDeskBusPriv.a and roll changes
; from that file into this one:
; <SM1> 5/2/92 kc Roll in Horror. Comments follow:
; <2> 8/5/91 SC Added new bits to the PMGR ADB flags.
; Updated from Reality:
; <6> 4/24/92 JF Added comment to let everyone know that one of three unused
; l ongs in ADBVars is now being used.
; <SM2> 5/25/92 RB Commented out the definition of talkCmd and listenCmd since they
; are also defined in EgretEqu.a, which seems to be included
; everywhere.
; <5> 8/21/91 JSM Clean up header.
; <4> 1/30/91 gbm sab, #38: Change the already including this file variable to
; all uppercase (for security reasons)
; <2> 2/28/90 GMR Added data structures for use with the new Egret based ADB
; implementation
; <1.4> 11/19/89 GGD NEEDED FOR ZONE-5 Added 'SetPollEnables' bit definition for IOP
; Based ADBMsg.Flags requests.
; <1.3> 5/15/89 GGD Re-written to support latest ADB manager code.
; <1.2> 5/1/89 GGD Converted data structure definitions to use records instead of
; equates.
; <1.1> 11/17/88 CCH Added stuff from system build.
; <1.0> 11/9/88 CCH Adding to EASE.
; <1.3> 10/14/88 LDC Removed ADB equates used by the ScriptManager
; <1.2> 10/13/88 LDC Added still more equates
; <1.1> 10/13/88 LDC Added more private data structures used by script manager
; <1.0> 10/7/88 rwh new to EASE today
;
IF &TYPE('__INCLUDINGAPPLEDESKBUSPRIV__') = 'UNDEFINED' THEN
__INCLUDINGAPPLEDESKBUSPRIV__ SET 1
;-----
; Other common equates
;-----
maskADBCmd EQU $0C ; Mask for ADB command
resetCmd EQU $00 ; Command for Bus Reset
2020-03-22 08:44:21 +00:00
talkCmd EQU $0C ; Command for Talk R0 ex<SM2> <Sys7.1>
listenCmd EQU $08 ; Command for Listen R0 ex<SM2> <Sys7.1>
2019-07-27 14:37:48 +00:00
kbdAddr EQU $02 ; keyboard type device
mouseAddr EQU $03 ; mouse type device
numFDBAdr EQU 16 ; number of avaiblae FDB address
moveTime EQU 50 ; number of times to move device
IF IopADB THEN
ADBMsg RECORD 0,increment ; format CPU <-> IOP messages
Flags ds.b 1 ; modifier/status flags (bit definitions below)
NoReply equ 1 ; flag for 'command timed out'
SRQReq equ 2 ; int flag for 'device requesting service'
SetPollEnables equ 5 ; Update auto-enable bit mask from ADBData field <1.4>
PollEnable equ 6 ; enable auto polling and auto srq polling
ExplicitCmd equ 7 ; message contains an explicit cmd
DataCount ds.b 1 ; number of bytes of ADBData (0..8) (cmd not included)
ADBCmd ds.b 1 ; ADB command to send / command that replied
ADBData ds.b 8 ; ADB Data to be sent with command, or data received
align 2 ; force even alignment
ADBMsgSize equ *-ADBMsg ; byte length of an ADB message request
ENDR
ADBIopNum EQU SwimIopNum ; SWIM IOP supports ADB too.
ADBMsgNum EQU 3 ; IOP message number 3 is used for ADB
ENDIF ; {IopADB}
;
; FDB varibles (total of 192+112+52= 356 bytes, plus 72 bytes if IOP)
;
; Device table offset
ADBDeviceEntry record 0,increment ; device table entry
fDBDevTy ds.b 1 ; fDB device type (1 byte)
fDBOAddr ds.b 1 ; Original fDB address of device (1 byte)
fDBAddr ds.b 1 ; fDB address (1 byte)
fDBUnused ds.b 1 ; unused (1 byte)
fDBCRA ds.l 1 ; fDB completion routine address (4 bytes)
fDBOpData ds.l 1 ; fDB optional data buffer (4 bytes)
fRecSize equ *-ADBDeviceEntry; record size
endr
; command queue offset
ADBCmdQEntry record 0,increment ; Command Queue entry
fQCmd ds.b 1 ; fDB command (1 byte)
fQUnused ds.b 1 ; not used (1 byte)
fQBuff ds.l 1 ; buffer address (4 bytes)
fQComp ds.l 1 ; completion routine address (4 bytes)
fQData ds.l 1 ; optional data buffer (4 bytes)
fQSize equ *-ADBCmdQEntry ; record size
endr
ADBVars record 0,increment ; private ADB data structures
startDevT ds.b (ADBDeviceEntry.fRecSize)*numFDBAdr ; start of device table
devTSize equ *-startDevT ; device table has 16 entries (192 bytes)
startCQ ds.b (ADBCmdQEntry.fQSize)*8 ; 8 entries in command queue (112 bytes)
endCQ equ * ; mark end of command queue
StartReqProc ds.l 1 ; pointer to HW dependent routine to start a req.
if ViaADB then
ListenBuffPtr ds.l 1 ; pointer into listen buffer
ShiftIntResume ds.l 1 ; address to resume at after shift reg interrupt
else
ds.l 2 ; unused space
endif ; {ViaADB}
fQBegPtr ds.l 1 ; Command queue start pointer (4 bytes)
fQEndPtr ds.l 1 ; command queue end pointer (4 bytes)
fQHeadPtr ds.l 1 ; command queue head pointer (4 bytes)
fQEntPtr ds.l 1 ; command queue entry pointer (4 bytes)
hasDev ds.w 1 ; every bit corresponds to an device address
; 1 = device is present in address (2 bytes)
devMap ds.w 1 ; device address map (2 bytes)
ds.l 1 ; unused space <6>
ds.l 1 ; •• Now Used! •• Pointer to Extended ADB Data (4 bytes) <6>
ds.l 1 ; unused space <6>
fDBCmd ds.b 1 ; last fDB command (1 byte)
fDBFlag ds.b 1 ; fDB Flags (1 byte)
; Common bit definitions in FDBFlag
fDBQEmpty equ 2 ; fDB queue empty flag, 1 = empty
fDBInit equ 5 ; initialization flag
fDBAuFlag ds.b 1 ; fDB Auxillary Flag (1 byte)
; h/w specific bit definitions in FDBAuFlag
If ViaADB then
fDBBusy equ 4 ; fDB busy flag, 1 = busy
fDBNoReply equ 5 ; No data (timeout) in reply, 1 = no reply
fDBSRQ equ 6 ; SRQ active in reply, 1 = SRQ in reply
fDBAPoll equ 7 ; Auto Poll reply, 1 = in auto polling
endif
if PwrMgrADB then
pMgrPollEnable equ 1 ; 1 = autopoll handled by PMGR <H2>
pMgrAutoPoll equ 2 ; 1 = Auto Polling enabled
pMgrSRQ equ 3 ; 1 = SRQ detected
pMgrSetPoll equ 7 ; 1 = will be passing addr bitmap to PMGR <H2>
endif
if IopADB then
fDBUseRcvMsg equ 0 ; send reply in receive message
fDBExpActive equ 1 ; an explicit command is active
endif
if hasEgret then ; <2>
fDBExpInited equ 0 ; initialization for Explicit commands has been done <2>
fDBImpInited equ 1 ; initialization for Implicit commands has been done <2>
fDBExpRunning equ 2 ; an explicit command is active <2>
endif ; <2>
ds.b 2 ; unused space
devTOffset ds.b 1 ; offset into the Device table for polling (1 byte)
fDBMvCnt ds.b 1 ; counter for moving address (1 byte)
; fDBPBuff must be right after fDBCnt, they form a pascal string
fDBCnt ds.b 1 ; poll data count (1 byte)
fDBPBuff ds.b 8 ; internal poll data buffer (8 bytes)
fDBByte0 equ fDBPBuff+0 ; byte0 of data buffer
fDBByte1 equ fDBPBuff+1 ; byte1 of data buffer
pollAddr ds.b 1 ; device address in poll (1 byte)
newAddr ds.b 1 ; new address (1 byte)
pollCmd ds.b 1 ; poll command (1 byte)
InitAddr ds.b 1 ; device address in poll during init (1 byte)
align 4
HWDependentVars equ * ; starting origin for hardware dependent variables <2>
fDBDSize set *-ADBVars ; size of FDB data <2>
if IopADB then
org HWDependentVars ; start at HWDependentVars <2>
XmtRequest ds IOPRequestInfo ; param blk for Host Initiated Xmt Requests
RcvRequest ds IOPRequestInfo ; param blk for IOP Initiated Rcv Requests
XmtMsg ds ADBMsg ; Xmt msg buffer
RcvMsg ds ADBMsg ; Rcv msg buffer
if (*-ADBVars) > fDBDSize then ; <2>
fDBDSize set *-ADBVars ; size of FDB data <2>
endif ; <2>
endif ; {IopADB}
if hasEgret then ; <2>
org HWDependentVars ; start at HWDependentVars
ExplicitEPB ds EgretPB ; param block used for async explicit requests
ImplicitEPB ds EgretPB ; param block used to wait for implicit autopoll data
if (*-ADBVars) > fDBDSize then ;
fDBDSize set *-ADBVars ; size of FDB data
endif ;
endif ; <2>
endr
ENDIF ; ...already included