Bring in CubeE sources

Resource forks are included only for .rsrc files. These are DeRezzed into their data fork. 'ckid' resources, from the Projector VCS, are not included.

The Tools directory, containing mostly junk, is also excluded.
This commit is contained in:
Elliot Nunn 2017-09-17 17:09:04 +08:00
commit 5b0f0cc134
1820 changed files with 1351740 additions and 0 deletions

138
DeclData/DeclData.make Normal file
View File

@ -0,0 +1,138 @@
#
# File DeclData.make
#
# Contains: Makefile for Declaration ROM.
#
# Written by: Kurt Clark, Chas Spillar, and Tim Nichols
#
# Copyright: © 1992-1993 by Apple Computer, Inc., all rights reserved.
#
# Change History (most recent first):
#
# <SM5> 12/13/93 PN Roll in Kaos and Horrors code to support AJ and Malcom machines.
# <SM4> 9/9/93 pdw Added slots.a to dependencies.
# <SM3> 08-03-93 jmp Added various necessary dependencies that werenÕt previously
# spelled out.
# <SM2> 3/4/93 dwc Added DeclDataPDMMace definition for PDM ENET.
# <1> 2/21/93 kc first checked in
# <SM2> 12-04-92 jmp Added the rules for building VSC (Keystone) DeclData.
EthernetDir = {DeclDir}DeclNet:
SonicDir = {EthernetDir}Sonic:
MaceDir = {EthernetDir}Mace:
VideoDir = {DeclDir}DeclVideo:
GammaDir = {VideoDir}Gamma:
PDMMaceDir = {MaceDir}PDMMaceEnet:
#include {MaceDir}Mace.Make
#include {SonicDir}Sonic.Make
#include {VideoDir}VideoDrivers.Make
#include {PDMMaceDir}PDMEnet.Make
DeclResources = "{RsrcDir}DeclData.rsrc" ¶
"{RsrcDir}PrimaryInit.rsrc" ¶
"{RsrcDir}SecondaryInit.rsrc" ¶
"{RsrcDir}SuperInit.rsrc" ¶
"{RsrcDir}DeclDataMace.rsrc" ¶
"{RsrcDir}DeclDataPDMMace.rsrc" ¶
"{RsrcDir}DeclDataSonic.rsrc" ¶
"{RsrcDir}DeclDataVideo.rsrc" ¶
"{RsrcDir}Gamma.rsrc"
DeclHeaders = "{ObjDir}StandardEqu.d" ¶
"{AIncludes}GestaltEqu.a" ¶
"{AIncludes}ShutDown.a" ¶
"{AIncludes}ROMEqu.a" ¶
"{AIncludes}Video.a" ¶
"{IntAIncludes}DockingEqu.a" ¶
"{IntAIncludes}EgretEqu.a" ¶
"{IntAIncludes}GestaltPrivateEqu.a" ¶
"{IntAIncludes}HardwarePrivateEqu.a" ¶
"{IntAIncludes}IOPrimitiveEqu.a" ¶
"{IntAIncludes}PowerPrivEqu.a" ¶
"{AIncludes}Slots.a" ¶
"{IntAIncludes}SlotMgrEqu.a" ¶
"{IntAIncludes}UniversalEqu.a" ¶
"{IntAIncludes}DepVideoEqu.a" ¶
"{SonicDir}SonicEqu.a"
#
# DeclData
#
"{RsrcDir}DeclData" Ä {DeclResources} "{RsrcDir}RomLink"
"{RsrcDir}RomLink" {DeclResources} -o "{Targ}"
"{RsrcDir}DeclData.rsrc" Ä "{RIncludes}Types.r" ¶
"{IntRIncludes}DepVideoEqu.r" ¶
"{IntRIncludes}HardwarePrivateEqu.r" ¶
"{IntRIncludes}InternalOnlyEqu.r" ¶
"{IntRIncludes}QuickDraw.r" ¶
"{IntRIncludes}ROMLink.r" ¶
"{DeclDir}DeclData.r"
Rez {StdROpts} "{DeclDir}DeclData.r" -o "{Targ}"
# The ROMLinkHeaderBuilder tool is not used.
#"{IntRIncludes}ROMLink.r" Ä "{RsrcDir}ROMLinkHeaderBuilder"
# "{RsrcDir}ROMLinkHeaderBuilder" > {Targ} #This is kinky
#
# PrimaryInit
#
"{RsrcDir}PrimaryInit.rsrc" Ä "{ObjDir}PrimaryInit.a.o"
Link {StdLOpts} {StdAlign} -rt decl=200 "{ObjDir}PrimaryInit.a.o" -o "{Targ}"
"{ObjDir}PrimaryInit.a.o" Ä "{DeclDir}PrimaryInit.a" ¶
{DeclHeaders}
Asm {StdAOpts} -d ForEclipseROM=0,sonic32=1,ctlpad=0,mmu=1 -i "{SonicDir}" "{DeclDir}PrimaryInit.a" -o "{Targ}"
#
# SecondaryInit
#
"{RsrcDir}SecondaryInit.rsrc" Ä "{ObjDir}SecondaryInit.a.o"
Link {StdLOpts} {StdAlign} -rt decl=210 "{ObjDir}SecondaryInit.a.o" -o "{Targ}"
"{ObjDir}SecondaryInit.a.o" Ä "{DeclDir}SecondaryInit.a" ¶
{DeclHeaders}
Asm {StdAOpts} -d ForEclipseROM=0,sonic32=1,ctlpad=0,mmu=1 -i "{SonicDir}" "{DeclDir}SecondaryInit.a" -o "{Targ}"
#
# SuperInit
#
"{RsrcDir}SuperInit.rsrc" Ä "{ObjDir}SuperInit.a.o"
Link {StdLOpts} {StdAlign} -rt decl=220 "{ObjDir}SuperInit.a.o" -o "{Targ}"
"{ObjDir}SuperInit.a.o" Ä "{DeclDir}SuperInit.a" ¶
{DeclHeaders}
Asm {StdAOpts} -d ForEclipseROM=0,sonic32=1,ctlpad=0,mmu=1 -i "{SonicDir}" "{DeclDir}SuperInit.a" -o "{Targ}"
#
# Ethernet
#
"{ObjDir}Loopback.c.o" Ä "{EthernetDir}Loopback.c" ¶
"{CIncludes}TextUtils.h" ¶
"{CIncludes}Memory.h" ¶
"{CIncludes}Devices.h" ¶
"{CIncludes}Files.h" ¶
"{CIncludes}AppleTalk.h" ¶
"{CIncludes}OSUtils.h"
C {StdCOpts} -b -o "{Targ}" "{EthernetDir}Loopback.c"
#
# Gamma Resource
#
"{RsrcDir}Gamma.rsrc" Ä "{RIncludes}Types.r" ¶
"{IntRIncludes}ROMLink.r" ¶
"{GammaDir}Gamma.r"
Rez {StdROpts} "{GammaDir}Gamma.r" -o "{Targ}"

9518
DeclData/DeclData.r Normal file

File diff suppressed because it is too large Load Diff

97
DeclData/DeclNet/802Equ.a Normal file
View File

@ -0,0 +1,97 @@
;
; File: 802Equ.a
;
; Contains: Equates for IEEE network standards
;
; Written by: Kerry E. Lynn, Sean Findley
;
; Copyright: © 1990, 1992 by Apple Computer, Inc., all rights reserved.
;
; Change History (most recent first):
;
; <1> 10/6/92 GDW New location for ROMLink tool.
; <1> 3/26/92 FM first checked in
; <1> 12/14/90 JK Added to build
;
; To Do:
;
;-----------=-----------=-------------------------------=---------------------------------------
; 802Equ.a - Equates for IEEE network standards
;
; Kerry E. Lynn
; Feb 1989
;
; Copyright (C) 1989 by:
;
; Apple Computer, Inc.
; 20525 Mariani Ave.
; Cupertino, CA 95014
;
; All Rights Reserved.
;-----------=-----------=-------------------------------=---------------------------------------
; 24-bit quantities, left justified
AppleCode EQU $08000700 ; Apple's vendor code for 802.2 Individual addr
MultiCode EQU $09000700 ; Apple's vendor code for 802.2 Group addr
; Size of a MAC addr
MACAddrSz EQU 6 ; max size (in bytes) for data link addr
MaxMCastSz EQU MACAddrSz ; max size (in bytes) for multicast addr
;---------------------------------------
; 802.3 MAC packet header
;---------------------------------------
MDstAddr EQU 0 ; Offset to destination address
MSrcAddr EQU MDstAddr+MACAddrSz ; Offset to source address
MLength EQU MSrcAddr+MACAddrSz ; Offset to LLC length
MHdrSize EQU MLength+2 ; 802.3 MAC header size
;---------------------------------------
; 802.2 LLC (Type 1) packet header
;---------------------------------------
LDSAP EQU 0 ; Offset to destination Service Access Point (SAP)
IGBIT EQU 0 ; I/G = 0 if Individual DSAP, = 1 if Group DSAP
LSSAP EQU LDSAP+1 ; Offset to source SAP
CRBIT EQU 0 ; C/R = 0 if Command, = 1 if Response
LCtrl EQU LSSAP+1 ; Offset to LLC CONTROL field (see below)
LHdrSize EQU LCtrl+1
LInfo EQU LHdrSize ; Offset to LLC Information
GlobalSAP EQU $FF
NullSAP EQU 0
;---------------------------------------
; CONTROL field bits for 802.2 Type 1 LLC Protocol Data Units (PDUs)
;---------------------------------------
UI EQU %00000011 ; value for "Unnumbered Information" (P/F bit must be 0)
XID EQU %10101111 ; mask for "Exchange Identification" (P/F bit may be 0 or 1)
TEST EQU %11100011 ; mask for "Test" (P/F bit may be 0 or 1)
PFBIT EQU 4 ; P/F = 0 if Poll (command), = 1 if Final (response)
;---------------------------------------
; XID information field
;---------------------------------------
XIDformat EQU %10000001 ; indicates IEEE basic format
XIDinfo1 EQU %00000001 ; indicates Type 1 AND Class I LLC
XIDinfo2 EQU %00000000 ; receive window size = N/A
XIDinfoSz EQU 3 ; number of bytes in an XID response
;---------------------------------------
; Sub-Network Access Protocol (SNAP) packet header
;---------------------------------------
SType EQU 0 ; 5-byte protocol discriminator
SHdrSize EQU SType+5

View File

@ -0,0 +1,397 @@
;
; File: ATMacros.a
;
; Contains: Assembly macros used by AppleTalk
;
; Written by: Mike Shoemaker
;
; Copyright: © 1990-1993 by Apple Computer, Inc., all rights reserved.
;
; Change History (most recent first):
;
; <SM2> 12/13/93 PN Roll in KAOS and Horror to add support for Malcom and AJ
; <1> 10/6/92 GDW New location for ROMLink tool.
; <SM2> 6/22/92 mal Added some labels to VERSION macro and added VMImmumebit equate.
; <SM3> 5/4/92 CSS moved to ethernet folder to get build to work
; <2> 3/19/92 kc Roll in Terror/Horror Changes.
; <SM1> 2/??/92 kc first checked in
; ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
; Pre-SuperMario ROM comments begin here.
; ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
; <H2> 01/22/92 jmp (BG,Z2) Added some additional macros for new ethernet changes.
; ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
; Pre-Horror ROM comments begin here.
; ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
; <T1> 3/27/91 jmp first checked in
; ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
; Pre-TERROR ROM comments begin here.
; ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
; <8> 1/30/91 mbs cj,#82011: Move years after company name in copyright message.
; <7> 12/17/90 mbs The ALIGN directive does not work for the IIGS assembler. Use
; IF ENDIF to generate an extra dc.b 0 if necessary. Yes except
; for the ALIGN, the entire macro worked under the IIGS
; assembler!.
; <6> 11/28/90 mbs In the VERSION macro, when the release stage is 'released', pad
; the version with two trailing spaces so that the length remains
; the same when changing from an f1 to a Golden Master build.
; <5> 11/26/90 mbs Did not handle 3-digit major version number
; <4> 11/12/90 mbs Steven pointed out that verUs is zero, not 1.
; <3> 11/10/90 mbs Add optional parameter to set the label at the front of the
; version structure.
; <2> 11/09/90 mbs Add 'v' in front of version number in long string
; 11/9/90 mbs First written
;
; To Do:
;
; WARNING -- CAN'T USE IF (__IncludingATalkMacros__ == 'UNDEFINED') because
; 6502 assember barfs and doesn't include the file.
PRINT PUSH, OFF
;==========================================================================================
; VERSION
;
; USAGE:
; VERSION <Name>, <Major Version>, <Minor Version>,
; <release stage>, <Revision level>,
; <Copyright Years> [, <Engineering Suffix> [, <Version Label> ] ]
;
; The name field should be quoted if more than one word.
; The copyright years field may or may not be quoted. The macro works either way
; It is OK to leave the engineering suffix field empty.
;
; The start of the version information is given the Label 'VersionInfo', unless
; you specify the last parameter; then it will be used. It must not be quoted.
;
; Example for EtherTalk 1.2a3q1 copyrighted 1987-1990
;
; VERSION 'EtherTalk', 1, 2, 0, alpha, 3, '1987-1990', 'q1'
;==========================================================================================
ATM_development EQU $20 ; These are used in the 3rd byte of the 4-byte version #
ATM_alpha EQU $40 ; .. to indicate release stage
ATM_beta EQU $60
ATM_final EQU $80
ATM_release EQU $80
ATM_verUS EQU 0
MACRO
VERSION &sName, &nMajor, &nMinor, &nBug, \
&sStage, &nRevision, &sCopyright, &sEngr='', &sLabel0=VersionInfo,&sLabel1=End
&sLabel0 ;Make label for this version information
LCLA &nStage ;Numeric representation of stage
LCLC &cStage ;Character representation of stage
LCLA &nPadBytes ;Add padding at end of record to <K2>
;allow room for expansion if we <K2>
;have to add bug release digits <K2>
;to the version # <K2>
LCLC &StrSetting ;To save current string setting
&StrSetting SETC &SETTING('STRING') ;Save current string setting
STRING PASCAL ;Set string state to Pascal
;
; Do some error checking
;
IF &UPCASE(&sStage)='ALPHA' THEN
&nStage SETA ATM_alpha
&cStage SETC 'a'
ELSEIF &UPCASE(&sStage)='BETA' THEN
&nStage SETA ATM_beta
&cStage SETC 'b'
ELSEIF &UPCASE(&sStage)='DEVELOPMENT' THEN
&nStage SETA ATM_development
&cStage SETC 'd'
ELSEIF &UPCASE(&sStage)='FINAL' THEN
&nStage SETA ATM_final
&cStage SETC 'f'
ELSEIF &UPCASE(&sStage)='RELEASE' THEN
&nStage SETA ATM_release
&cStage SETC 'x'
ELSE
AERROR 'The stage parameter to VERSION must be: development, alpha, beta, final or release'
ENDIF
IF (&nMinor > 15) THEN
AERROR 'The Minor version must be less than 16'
ENDIF
IF (&nBug > 15) THEN
AERROR 'The Bug fix version must be less than 16'
ENDIF
;
; Generate the 4-byte version numbers
;
dc.b &nMajor ;Major version number
dc.b (&nMinor * 16) + &nBug ;Build 2nd byte of version
dc.b &nStage, &nRevision ;stage and revision level
;
; Generate the integer country code
;
dc.w ATM_verUS ;Country Code
;
; Build Version string from major/minor version string
;
LCLC &lShortVer
;
; Make 1st digit of version string
;
IF (&nMajor >= 100) THEN
&lShortVer SETC &CONCAT(&CHR(&nMajor / 100 + $30), \
&CHR((&nMajor MOD 100) / 10 + $30), \
&CHR(&nMajor MOD 10 + $30))
ELSE
IF (&nMajor >= 10) THEN
&lShortVer SETC &CONCAT(&CHR(&nMajor / 10 + $30), &CHR(&nMajor MOD 10 + $30))
ELSE
&lShortVer SETC &CHR(&nMajor + $30)
ENDIF
ENDIF
;
; Append 2nd digit of version number (ie: 1.0)
;
IF (&nMinor >= 10) THEN
&lShortVer SETC &CONCAT(&lShortVer,'.',&CONCAT(&CHR(&nMinor / 10 + $30), &CHR(&nMinor MOD 10 + $30)))
ELSE
&lShortVer SETC &CONCAT(&lShortVer,'.',&CHR(&nMinor + $30))
ENDIF
;
; Append third digit of version number if non-zero (ie: 1.0.2). If zero, leave <K2>
; room for the extra characters at the end of the record <K2>
;
IF (&nBug <> 0) THEN
&nPadBytes SETA 0 ; Will not need padding <K2>
IF (&nBug >= 10) THEN
&lShortVer SETC &CONCAT(&lShortVer,'.',&CONCAT(&CHR(&nBug / 10 + $30), &CHR(&nBug MOD 10 + $30)))
ELSE
&lShortVer SETC &CONCAT(&lShortVer,'.',&CHR(&nBug + $30))
ENDIF
ELSE
&nPadBytes SETA 1 ; Leave room for padding <K2>
ENDIF
; Append stage letter and revision if not a release version.
; For release version, append two spaces. This way the string does not change length
; between an 'f1' build and a GM build.
IF (&cStage <> 'x') THEN
&lShortVer SETC &CONCAT(&lShortVer,&cStage)
IF (&nRevision >= 10) THEN
&lShortVer SETC &CONCAT(&lShortVer,&CONCAT(&CHR(&nRevision / 10 + $30), &CHR(&nRevision MOD 10 + $30)))
ELSE
&lShortVer SETC &CONCAT(&lShortVer,&CHR(&nRevision + $30))
ENDIF
ELSE
&lShortVer SETC &CONCAT(&lShortVer, ' ') ; Append two spaces if release
ENDIF
;
; Emit the short string
;
dc.b '&lShortVer'
; ALIGN directive doesn't exist on IIGS assembler so do it the hard way...
IF ((&LEN(&lShortVer) +1) MOD 2) = 1 THEN
dc.b 0
ENDIF
;
; Trim the beginning and ending quotes from the name, copyright years, and
; engineering suffix if present
;
LCLC &lName
LCLC &lCopyright
LCLC &lEngr
IF &SUBSTR(&sName, 1, 1) = &CHR($27) THEN
&lName SETC &SUBSTR(&sName, 2, &LEN(&sName) - 2)
ELSE
&lName SETC &sName
ENDIF
IF &SUBSTR(&sCopyright, 1, 1) = &CHR($27) THEN
&lCopyright SETC &SUBSTR(&sCopyright, 2, &LEN(&sCopyright) - 2)
ELSE
&lCopyright SETC &sCopyright
ENDIF
IF &SUBSTR(&sEngr, 1, 1) = &CHR($27) THEN
&lEngr SETC &SUBSTR(&sEngr, 2, &LEN(&sEngr) - 2)
ELSE
&lEngr SETC &sEngr
ENDIF
;
; Build the long string
;
LCLC &lLongVer ; Define a local variable to hold it
&lLongVer SETC &CONCAT(&lName,' v',&lShortVer,&lEngr,'; © Apple Computer, Inc. ',&lCopyright)
;
; Emit the long string
;
LCLC &sLongVerLabel ;<K2 start>
LCLC &sLongVerLabelEnd ;
&sLongVerLabel SETC &CONCAT(&sLabel0, 'LongStr') ;
&sLongVerLabel ;
dc.b '&lLongVer' ;
IF ((&LEN(&lLongVer) +1) MOD 2) = 1 THEN ; Align things
dc.b 0
ENDIF
;
; If this is an "xx.x" release rather than an "xx.x.x" release, leave room so that
; if we have to rev the version # to x.x.x, the size of the record will not change.
;
IF (&nPadBytes) THEN
dc.b 0,0,0,0
ENDIF
&sLongVerLabelEnd SETC &CONCAT(&sLongVerLabel, 'End')
&sLongVerLabelEnd
;
; Clean up and we're done
;
LCLC &sEndLabel ;Make label for end of version information
&sEndLabel SETC &CONCAT(&sLabel0, &sLabel1)
&sEndLabel
STRING &StrSetting ;Restore string setting
ENDM
EJECT
;==========================================================================================
; SCCLOCKOUT
;
; Macro for disabling interrupts.
;==========================================================================================
SRIntMaskBits EQU $0700 ; The 3 interrupt level bit in the SR
SRIntMaskBitsCMP EQU $F8FF ; The 3 interrupt level bit in the SR
SRIntLevel6 EQU $0600 ; Level 6 interrupt mask
SRIntLevel6MASK EQU $FEFF ; Level 6 interrupt AND value
SRIntLevel5MASK EQU $FDFF ; Level 5 interrupt AND value <K2>
MACRO
_SCCLOCKOUT
ORI.W #SRIntMaskBits,SR ; Set all of the INT bits
ANDI.W #SRIntLevel6MASK,SR ; Set to priority 6
ENDM
;==========================================================================================
; _SETINTMASK
;
; Macro for setting the interrupt level to an arbitrary level. Pass the level in
; a Data register.
;==========================================================================================
MACRO
_SETINTMASK &sReg
move.w SR,-(SP)
andi.w #SRIntMaskBitsCMP,(SP)
or.w &sReg,(SP)
move.w (SP)+,SR
ENDM
;==========================================================================================
; VSCCEnable
;
; Macro for disabling interrupts.
; Pass address register holding MPP vars, and a temporary Data register
;==========================================================================================
MACRO
_VSCCENABLE &sMPPVarsReg, &tmpReg
MOVE.W SR, &tmpReg
ANDI.W #SRIntMaskBitsCMP,&tmpReg ; Clear all of the INT bits
EORI.W #$2000, &tmpReg ; Toggle the 2000 bit
move.w vSCCEnable(&sMPPVarsReg),-(SP) ; Push vscc enable
EOR.W &tmpReg, (SP) ; Or in the int bits (and toggles 2000)
; Stupid machine won't let memory be the source on an XOR instruction
MOVE.W (SP)+,SR ; Set SR
ENDM
;==========================================================================================
; These Macros & Equates are used to call the multipurpose function dispatcher in the
; Lap Manager. None of these functionn have jack to do with the Lap Manager, but they
; provide a way for code to get the functions without having to link with the library
; containing them. Of course, they require that a Lap Manager be present.
;==========================================================================================
;
; Macro used in following macros
;
MACRO
_L21Common &nVal
LCLC &cLabel ; Used to make a semi-unique label
&cLabel SETC &CONCAT('@L21Ret',&nVal)
pea &cLabel ; Want to return to here
move.l LAPMgrPtr,D0 ; Ptr to Lap Manager
add.l #LAPMgrCall,D0 ; Ptr to dispatch entry point
move.l D0,-(SP) ; Put on stack
move.l #((&nVal << 16) + LInt21Dispatch),D0
rts ; Call Lap Manager
&cLabel
ENDM
;
; Macros to call Lap Manager Dispatch routines
;
; Returns non-zero in D0.L if Extensions are disabled at boot time. Always returns zero on
; System 6. Sets condition codes
MACRO
_LExtensionsDisabled
_L21Common L21ExtensionsDisabled
ENDM
; pascal Handle GetBestResource(OSType theType, short theID)
MACRO
_LGetBestResource
_L21Common L21GetBestResource
ENDM
; pascal Boolean TrapAvailable(short theTrap)
MACRO
_LTrapAvailable
_L21Common L21TrapAvailable
ENDM
;==========================================================================================
; New Macros go here
;==========================================================================================
;
; MACROS for SNMP counters <K2>
;
MACRO
_IncrCount &SNMPCounter
ADDQ.L #1, SNMPVars.&SNMPCounter(A2) ; increment whatever SNMP counter
ENDM
VMImmuneBit EQU 0 ; bit in driver DCE flags to tell VM to leave paramblocks alone
PRINT POP
; END ATMacros.a

View File

@ -0,0 +1,94 @@
;
; File: ENETEqu.a
;
; Contains: Equates for the Ethernet driver
;
; Written by: Sean Findley (Version 1.1a1)
;
; Copyright: © 1990, 1992 by Apple Computer, Inc., all rights reserved.
;
; This file is used in these builds: Mac32
;
; Change History (most recent first):
;
; <SM2> 10/26/92 mal Updated SNMP control codes.
; <1> 10/6/92 GDW New location for ROMLink tool.
; <2> 3/26/92 FM Rolled into reality
; <2> 1/9/91 JK Cleaned up to simplify N&C support.
; <1> 12/14/90 JK Added to build
;
; To Do:
;
IF (&TYPE('MHdrSize') = 'UNDEFINED') THEN
INCLUDE '802Equ.a' ; IEEE equates
ENDIF
; Control codes.
ESetGeneral EQU 253 ; Set "general" mode
EGetInfo EQU 252 ; Get info
ERdCancel EQU 251 ; Cancel read
ERead EQU 250 ; Read
EWrite EQU 249 ; Write
EDetachPH EQU 248 ; Detach protocol handler
EAttachPH EQU 247 ; Attach protocol handler
EAddMulti EQU 246 ; Add a multicast address
EDelMulti EQU 245 ; Delete a multicast address
EOpenSAP EQU 244 ; Open an 802.2 SAP
ECloseSAP EQU 243 ; Close an 802.2 SAP
ELapGetLinkStatus EQU 242 ; Get interface statistics, RFC 1213
EGetDot3CollStats EQU 241 ; Get 802.3 collision statistics, RFC 1284
EGetDot3Statistics EQU 240 ; Get 802.3 statistics, RFC 1284
ESetDot3Entry EQU 239 ; Set 802.3 status & control information
EGetDot3Entry EQU 238 ; Get 802.3 status & control information
FirstENET EQU EGetDot3Entry ; First ENET command
LastENET EQU ESetGeneral ; Last ENET command
; ENET queue element standard structure: arguments passed in the CSParam area
EProtType EQU CSParam ; Offset to protocol type code
EMultiAddr EQU CSParam ; Multicast address (EAddMulti,EDelMulti)
EHandler EQU EProtType+2 ; Offset to protocol handler
EWDSPointer EQU EHandler ; WDS pointer (EWrite)
EBuffPtr EQU EHandler ; Buffer pointer (ERead,EGetInfo)
EKillQEl EQU EHandler ; QEl pointer (ERdCancel)
EBuffSize EQU EBuffPtr+4 ; Buffer size (ERead,EGetInfo)
EDataSize EQU EBuffSize+2 ; Actual data size (Eread)
;---------------------------------------
; Ethernet packet header
;---------------------------------------
EDestAddr EQU 0 ; Offset to destination address
ESrcAddr EQU 6 ; Offset to source address
EType EQU 12 ; Offset to data link type
EHdrSize EQU 14 ; Ethernet header size
EMinDataSz EQU 46 ; Minimum data size
EMaxDataSz EQU 1500 ; Maximum data size
EAddrSz EQU 6 ; Size of an ethernet node address
MAddrSz EQU 8 ; Size of an ethernet multicast address (?)
; These are defined in 802Equ.a
;
ETHdrSize EQU MHdrSize+LHdrSize+SHdrSize
;
; Errors and misc.
;
eLenErr EQU ddpLenErr ; Length error
eMultiErr EQU ddpSktErr ; Multicast address error
EAddrRType EQU 'eadr' ; Alternate address resource type
;
; Link specific 'atlk' AGetInfo call
;
ESpeed EQU 10000000 ; Link speed in bits/sec

157
DeclData/DeclNet/Loopback.c Normal file
View File

@ -0,0 +1,157 @@
/*
File: Loopback.c
Contains: Ethernet loopback test code
Written by: Sean Findley
Copyright: © 1990, 1992 by Apple Computer, Inc., all rights reserved.
Change History (most recent first):
<1> 10/6/92 GDW New location for ROMLink tool.
<SM5> 6/22/92 mal Modified so ptr and size to loopback test data is passed from
the driver since shared by Sonic and Mace drivers.
<SM1> 6/11/92 CS Roll-in changes from Reality:
<2> 6/1/92 DTY Include TextUtils.h for the new home of EqualString.
TextUtils now contains the EqualString prototype, so include it.
<3> 3/26/92 FM Rolled into reality
<2> 2/11/92 RB Use the real EqualString to avoid having to link old C libraries
with this code.
<2> 4/21/91 CCH Rolled in Sean Findley's changes.
<1> 12/14/90 JK Added to build
To Do:
*/
#include <TextUtils.h>
#include "memory.h"
#include "devices.h"
#include "files.h"
#include "appletalk.h"
#include "OSUtils.h"
typedef struct
{
char Addr[6];
} Enet;
typedef struct
{
Enet Destination; /* Ethernet destination */
Enet Source; /* Ethernet source */
unsigned short EProtocoltype; /* Ethernet protocol type */
char testdata[255];
} LBpacket;
typedef union /* parameter block for calling .ENET */
{
CntrlParam ctl; /* for ctl calls */
struct
{
char filler[28];
unsigned short EprotType;
Ptr EBuffPtr;
unsigned short EBuffSize;
unsigned short EDataSize;
} info;
MPPParamBlock ecall;
} Edrvrparms;
#define Ehandler DDP.DDPptrs.listener
#define EWdsPointer DDP.DDPptrs.wdsPointer
#define EKillQEl EBuffPtr
#define ERdCancel 251
#define ERead 250
#define EWrite 249
#define EDetachPH 248
#define EAttachPH 247
#define Ethhdrsz 14
Boolean cmpdata(char *p1, char *p2, short len) /* true = data equal, false = data not equal */
{
short i;
for(i=0;i<len;i++)
{
if(p1[i] != p2[i])
return(false);
}
return(true);
}
killtest(Edrvrparms *pbw, Edrvrparms *pb)
{
pbw->ctl.csCode = ERdCancel;
pbw->info.EKillQEl = (Ptr) pb;
PBControl((ParmBlkPtr) pbw,false);
pbw->ctl.csCode = EDetachPH;
PBControl((ParmBlkPtr) pbw,false);
}
Boolean LOOPBACKTEST(short refnum,Enet *enetaddr, int AppleData, short AppleDataSz)
{
LBpacket LBPR,LBPW;
Edrvrparms pb,pbw;
WDSElement wds[2];
unsigned long secs1,secs2;
pb.ctl.ioCRefNum = refnum;
pb.ctl.ioCompletion = nil;
pb.ctl.csCode = EAttachPH;
pb.info.EprotType = 0x809B;
pb.ecall.Ehandler = nil;
if (PBControl((ParmBlkPtr) &pb,false)) /* attach special protocol using default handler */
return(false);
pb.ctl.csCode = ERead;
pb.info.EBuffPtr = (Ptr) &LBPR;
pb.info.EBuffSize = sizeof(LBpacket);
if (PBControl((ParmBlkPtr) &pb,true)) /* setup a read using default handler */
{
pb.ctl.csCode = EDetachPH;
PBControl((ParmBlkPtr) &pb,false);
return(false);
}
pbw = pb;
wds[0].entryLength = Ethhdrsz + AppleDataSz;
wds[0].entryPtr = (Ptr) &LBPW;
wds[1].entryLength = 0;
LBPW.Destination = *enetaddr;
LBPW.Source = *enetaddr;
LBPW.EProtocoltype = 0x809B;
BlockMove((Ptr)AppleData,LBPW.testdata,AppleDataSz);
pbw.ecall.EWdsPointer = (Ptr) wds;
pbw.ctl.csCode = EWrite;
if (PBControl((ParmBlkPtr) &pbw,false)) /* write a packet to ourself */
{
killtest(&pbw,&pb);
return(false);
}
GetDateTime(&secs1);
while (pb.ctl.ioResult == 1) /* wait for default read to complete or timeout */
{
GetDateTime(&secs2);
if (secs2 - secs1 > 3)
{
killtest(&pbw,&pb);
return(false);
}
}
pbw.ctl.csCode = EDetachPH;
PBControl((ParmBlkPtr) &pbw,false);
if (!cmpdata(LBPR.testdata,LBPW.testdata,AppleDataSz)) /* check data looped back */
return(false);
return(true);
}

View File

@ -0,0 +1,89 @@
/*
File: MACEecfg.r
Contains: 'ecfg' resource templates for MACE built-in ethernet systems
Written by: Mark A. Law
Copyright: © 1992-1993 by Apple Computer, Inc., all rights reserved.
Change History (most recent first):
<1> 6/7/93 kc first checked in
<LW2> 3/21/93 mal Versioned MACE 'ecfg' rsrc record and removed 24-bit MACEBase
field.
To Do:
*/
Type 'ecfg'
{
unsigned integer; /* Record version */
unsigned hex longint; /* 32-bit MACE address */
unsigned hex longint; /* Ethernet PROM address */
unsigned hex byte; /* MACE transmit frame control */
unsigned hex byte; /* MACE receive frame control */
unsigned hex byte; /* MACE xmit/recv fifo config control */
unsigned hex byte; /* MACE MAC config control */
hex string [6]; /* Alternate ethernet address */
unsigned integer; /* Alternate # transmit buffers */
unsigned integer; /* Alternate # receive buffers */
unsigned integer; /* Alternate # receive chains */
};
Resource 'ecfg' (43, "Cyclone33") {
1,
0x50F1C000,
0x50F08000,
0x1,
0,
0x2C,
0x3,
$"",
0,
0,
0
};
Resource 'ecfg' (78, "Cyclone40") {
1,
0x50F1C000,
0x50F08000,
0x1,
0,
0x2C,
0x3,
$"",
0,
0,
0
};
Resource 'ecfg' (60, "Tempest25") {
1,
0x50F1C000,
0x50F08000,
0x1,
0,
0x2C,
0x3,
$"",
0,
0,
0
};
Resource 'ecfg' (79, "Tempest33") {
1,
0x50F1C000,
0x50F08000,
0x1,
0,
0x2C,
0x3,
$"",
0,
0,
0
};

2729
DeclData/DeclNet/Mace/Mace.a Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,77 @@
#
# File Mace.Make
#
# Contains: Makefile for Mace.
#
# Written by: Kurt Clark, Chas Spillar, and Tim Nichols
#
# Copyright: © 1992-1993 by Apple Computer, Inc. All rights reserved.
#
# Change History (most recent first):
#
# <SM2> 6/14/93 kc Roll in Ludwig.
# <LW3> 3/16/93 chp Added a dependency on SysPrivateEqu.a for Mace.a.o.
# <LW2> 1/27/93 mal Add MACE ecfg rsrc.
# <SM2> 11/30/92 SWC Changed TimeEqu.a->Timer.a.
#
"{RsrcDir}DeclDataMace.rsrc" Ä "{ObjDir}MaceEnet.a.o" ¶
"{ObjDir}Mace.a.o" ¶
"{ObjDir}Loopback.c.o" ¶
"{IfObjDir}interface.o"
Link {StdLOpts} {StdAlign} -rt decl=1 -o "{Targ}" ¶
"{ObjDir}MaceEnet.a.o" ¶
"{ObjDir}Mace.a.o" ¶
"{ObjDir}Loopback.c.o" ¶
"{IfObjDir}interface.o"
"{RsrcDir}MACEecfg.rsrc" Ä {MaceDir}MACEecfg.r
Rez {StdROpts} -t rsrc -c RSED "{MaceDir}MACEecfg.r" -o "{Targ}"
"{ObjDir}Enet61.rsrc" Ä "{ObjDir}MaceEnet.a.o" ¶
"{ObjDir}Mace.a.o" ¶
"{ObjDir}Loopback.c.o"
Link {StdLOpts} {StdAlign} -rt enet=61 -o "{Targ}" ¶
-sn Main="Cyclone MACE Ethernet Driver" ¶
-ra "Cyclone MACE Ethernet Driver"=resSysHeap,resPurgeable,resLocked ¶
"{ObjDir}MaceEnet.a.o" ¶
"{ObjDir}Mace.a.o" ¶
"{ObjDir}Loopback.c.o" ¶
"{IfObjDir}interface.o"
"{ObjDir}MaceEnet.a.o" Ä "{MaceDir}MaceEnet.a" ¶
"{MaceDir}MaceEqu.a" ¶
"{MaceDir}VersionMaceEnet.a" ¶
"{EthernetDir}AtalkMacros.a" ¶
"{EthernetDir}ENETEqu.a" ¶
"{EthernetDir}SNMPLAP.a" ¶
"{AIncludes}GestaltEqu.a" ¶
"{AIncludes}Slots.a" ¶
"{AIncludes}SysEqu.a" ¶
"{AIncludes}SysErr.a" ¶
"{AIncludes}Timer.a" ¶
"{AIncludes}Traps.a" ¶
"{IntAIncludes}HardwarePrivateEqu.a"¶
"{IntAIncludes}InternalOnlyEqu.a" ¶
"{IntAIncludes}PSCEqu.a" ¶
"{IntAIncludes}UniversalEqu.a"
Asm {StdAOpts} -i "{MaceDir}" -i "{EthernetDir}" -o "{Targ}" "{MaceDir}MaceEnet.a"
"{ObjDir}Mace.a.o" Ä "{MaceDir}Mace.a" ¶
"{MaceDir}MaceEqu.a" ¶
"{EthernetDir}AtalkMacros.a" ¶
"{EthernetDir}ENETEqu.a" ¶
"{EthernetDir}SNMPLAP.a" ¶
"{AIncludes}GestaltEqu.a" ¶
"{AIncludes}SysEqu.a" ¶
"{AIncludes}SysErr.a" ¶
"{AIncludes}Traps.a" ¶
"{IntAIncludes}SysPrivateEqu.a" ¶
"{IntAIncludes}HardwarePrivateEqu.a"¶
"{IntAIncludes}InternalOnlyEqu.a" ¶
"{IntAIncludes}PSCEqu.a" ¶
"{IntAIncludes}UniversalEqu.a"
Asm {StdAOpts} -i "{MaceDir}" -i "{EthernetDir}" -o "{Targ}" "{MaceDir}Mace.a"

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,336 @@
;
; File: MaceEqu.a
;
; Contains: Equates for accessing the Ethernet Media Access
; Controller (MACE)
;
; Written by: Mark A. Law
;
; Copyright: © 1991-1993 by Apple Computer, Inc. All rights reserved.
;
; This file is used in these builds: Mac32
;
; Change History (most recent first):
;
; <SM6> 6/14/93 kc Roll in Ludwig.
; <LW4> 5/1/93 mal #1082434 Added records for new GetMem & FreeMem rtns.
; <LW3> 3/21/93 mal Versioned record for MACE 'ecfg' rsrc.
; <LW2> 1/27/93 mal Added MACEecfg rsrc support.
; <SM5> 12/4/92 mal Removed OFLO bit from recv pkt status.
; <SM4> 11/19/92 mal Added equ for yet another bit AMD didn't tell us about.
; <SM3> 10/30/92 mal MaceInitParms record change.
; <SM2> 10/13/92 mal -changed status thats passed to RecvRtn to lw
; <1> 10/6/92 GDW New location for ROMLink tool.
; <SM2> 6/22/92 mal Changes to support PSC2's (EVT2) Ethernet DMA receive model.
; <P4> 4/30/92 mal Expanded MaceInitParms record.
; <P3> 4/27/92 mal Added MaceInit parameters record.
; <P2> 3/23/92 mal Added MACE MAC config reg bit defines
;
; ---------------------------------------------------------
; MACE Registers
; ---------------------------------------------------------
MACERegBase EQU $50F1C000 ; Mace Reg Base on Cyclone
MACERegs RECORD 0
MACE_RX_FIFO DS.W 1 ;RD RXData -Read Status first
ORG *+$e
MACE_XMIT_FIFO DS.W 1 ;TX TXData
ORG *+$e
MACE_TX_FRM_CNTRL DS.B 1 ;RD/WR 01=Retry,XMTFCS,AUTOPAD
ORG *+$f
MACE_TX_FRM_STAT DS.B 1 ;RD
ORG *+$f
MACE_TX_RETRY_CNT DS.B 1 ;RD
ORG *+$f
MACE_RX_FRM_CNTRL DS.B 1 ;RD/WR 00 = Not_AutoStripPad
ORG *+$f
MACE_RX_FRM_STAT DS.B 1 ;RD Read 4x to get RX Status of packet
ORG *+$f
MACE_FIFO_FRM_CNT DS.B 1 ;RD Number of frames in FIFO
ORG *+$f
MACE_INT DS.B 1 ;RD_1 Interupt Source bits
ORG *+$f
MACE_INT_MSK DS.B 1 ;RD/WR Interupt Enables
ORG *+$f
MACE_POLL DS.B 1 ;RD Yet another status location
ORG *+$f
MACE_BIU_CNFG DS.B 1 ;RD/WR 20 = normal mode 01 = Soft Reset
ORG *+$f
MACE_FIFO_CNFG DS.B 1
ORG *+$f
MACE_MAC_CNFG DS.B 1 ;Enables
ORG *+$f
MACE_PLS_CNFG DS.B 1 ;RD/WR 0=Normal Mode
ORG *+$f
MACE_PHY_CNFG DS.B 1 ;RD/WR Reserved,Dude.
ORG *+$f
MACE_CHIP_ID_LOW DS.B 1 ;RD Just Reads ID
ORG *+$f
MACE_CHIP_ID_HIGH DS.B 1 ;RD Just Reads ID
ORG *+$f
MACE_ADDR_CNFG DS.B 1 ;RD/WR 04=Phy_Addr, 02=Log_Addr
ORG *+$1f
MACE_LOG_ADDR DS.B 1 ;Load with 6 Zeros
ORG *+$f
MACE_PHY_ADDR DS.B 1 ;Load with Address
ORG *+$2f
MACE_MISSED_PKT_CNT DS.B 1 ;RD
ORG *+$4f
MACE_USER_TEST_REG DS.B 1 ;
ENDR
;
; MACE Interrupt Reg. & Int. Reg. Mask Bit defines
; MACE Int. Reg - Read/Clear; MACE Int. Mask Reg. - Read/Write
;
BABL EQU 6 ; Babble, Xmit timeout error
CERR EQU 5 ; Signal Quality Error (SQE), xmit
RCVCO EQU 4 ; Receive Collision Cnt Overflow
MPCO EQU 2 ; Missed Pkt Cnt Overflow
RCVINT EQU 1 ; Rcv int
XMTINT EQU 0 ; Xmit int
; mask to disable all MACE ints
MaceIntMask EQU (1<<BABL)+(1<<CERR)+(1<<RCVCO)+(1<<MPCO)+(1<<RCVINT)+(1<<XMTINT)
OurIntsMask EQU (1<<RCVINT) ; ignore recv ints
;
; MACE Transmit Frame Status Reg. Bit defines
; Note: ONE and MORE are swapped prior to CURIO B0 MACE
;
XMTSV EQU 7 ; transmit status field valid when 1
UFLO EQU 6 ; underflow - xmit fifo
LCOL EQU 5 ; late collision
MORE EQU 4 ; more than 1 retry needed to xmit
ONE EQU 3 ; exactly 1 retry needed to xmit
DEFER EQU 2 ; transmission defered at least once
LCAR EQU 1 ; loss of carrier
RTRY EQU 0 ; retry
;
; MACE Transmit Frame Control Reg. Bit defines (byte)
;
DRTRY EQU 7 ; disable retry
DXMTFCS EQU 3 ; disable xmit fcs
APADXMT EQU 0 ; enable xmt autopad
; -forces generation of fcs
;
; MACE Receive Frame Control Reg. Bit defines (byte)
;
ASTRIPRCV EQU 0 ; enable rcv autopad stripping
; -forces stripping of fcs
;
; MACE Receive Status Reg. Bit defines (long)
;
; Receive Message Byte Count (byte0)
; Bits 7-0 : Recv Message Byte Count bits 7-0
; Receive Status (byte1)
; Bits 3-0 : Recv Message Byte Count bits 11-8
; Bits 7-4 : Recv Message Status bits
RcvOFLO EQU 7 ; receive fifo overflow
RcvCLSN EQU 6 ; late collision during recv
RcvFRAM EQU 5 ; frame error, non-integer # of bytes
RcvFCS EQU 4 ; frame check sequence error
; Receive Runt Packet Count (byte2)
; -number of runts recv'd since last successfully recv'd pkt
; -maxs at 255
; Receive Collision Count (byte3)
; -number of collisions since last successfully recv'd pkt
; -maxs at 255
;
; MACE Bus Interface Unit Reg. Bit defines (byte)
;
BSWAP EQU 7 ; byte swap mode, 0-Intel, 1-Motorola
; Transmit start point Bits 5-4
XMSTP EQU 4 ; bit shift offset
MACERESET EQU 0 ; software reset
; Transmit start point equates
; -controls when preamble xmit starts
XMTS4 EQU $00 ; start when 4 bytes in FIFO
XMTS16 EQU $10 ; start when 16 bytes in FIFO
XMTS64 EQU $20 ; start when 64 bytes in FIFO
XMTS112 EQU $30 ; start when 112 bytes in FIFO
;
; MACE FIFO Configuration Reg. Bit defines (byte)
; -fifo water mark changes ignored until fw reset bit set
; Transmit FIFO water mark Bits 7-6
XMTFW EQU 6 ; bit shift offset
; Receive FIFO water mark Bits 5-4
RCVFW EQU 4 ; bit shift offset
XMTFWR EQU 3 ; xmit fifo water mark reset
RCVFWR EQU 2 ; recv fifo water mark reset
XMTBRST EQU 1 ; xmit burst
RCVBRST EQU 0 ; recv burst
; FIFO watermark equates
RFW16 EQU $00 ; 16 byte recv FIFO watermark
RFW32 EQU $10 ; 32 byte recv FIFO watermark
RFW64 EQU $20 ; 64 byte recv FIFO watermark
TFW16 EQU $00 ; 16 byte xmit FIFO watermark
TFW32 EQU $40 ; 32 byte xmit FIFO watermark
TFW64 EQU $80 ; 64 byte xmit FIFO watermark
;
; MACE MAC Configuration Reg. Bit defines (byte)
;
PROMISC EQU 7 ; promiscuous mode, recv all valid frames
DXMT2PD EQU 6 ; disable xmit 2-part deferral algorithm
EMBA EQU 5 ; enable modified back-off algorithm
ENXMT EQU 1 ; enable xmit
ENRCV EQU 0 ; enable recv
;
; MACE Physical Layer Signaling Reg. Bit defines (byte)
;
XMTSEL EQU 3 ; xmit mode select
; Port Select Bits 2-1
PORTSEL EQU 1 ; bit shift offset
ENSTS EQU 0 ; enable optional I/O function status
;
; MACE Internal Address Configuration Reg. Bit defines (byte)
;
ADDRCHG EQU 7 ; address change enable
PHYADDR EQU 2 ; physical address select
LOGADDR EQU 1 ; logical address select
;
; MACE User Test Reg. Bit defines (byte)
;
;¥¥¥¥¥ WARNING: DO NOT EVER SET BIT 7 or you'll fry the MACE!!!! ¥¥¥¥¥
; Bit 6 (disable) is set during MACE init to disallow an erroneous and/or
; malicious setting of RTRE.
RTRE EQU 7 ; reserved test register enable
RTRD EQU 6 ; reserved test register disable
;¥¥¥¥¥
RPA EQU 5 ; runt packet accept
FCOLL EQU 4 ; force a collision, use with loopback
RCVFCSE EQU 3 ; receive fcs enable, use with loopback
; Loopback control Bits 2-1, %XX0 ¥¥¥ NOT FOR BIT SHIFTS!
NOLPB EQU %000 ; disable loopback mode
EXTLPB EQU %010 ; external loopback mode
INTLPB EQU %100 ; internal loopback, no MENDEC
MENDECLPB EQU %110 ; internal loopback, with MENDEC
;
; Misc. equates
;
MondoPkt EQU 2000 ; Value > max pkt, used for Recv DMA cnt
CntRegMask EQU $0001ffff ; Ignore upper 15 bits
nobuff EQU -2 ; no xmit buffer available
;¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥ Network Statistics
NetStats RECORD 0 ; network management stats.
TxOK DS.L 1 ; frames transmitted OK
sCollFrame DS.L 1 ; single collision frames
mCollFrame DS.L 1 ; multiple collision frames
CollFrame DS.L 1 ; collision frames
DefTx DS.L 1 ; deferred transmissions
LateColl DS.L 1 ; late collisions
ExcessColl DS.L 1 ; excessive collisions
ExcessDef DS.L 1 ; excessive defferals
InMACTxErr DS.L 1 ; internal MAC transmit errors
RxOK DS.L 1 ; frames received OK
MultiRxOK DS.L 1 ; multicast frames recd OK
BroadRxOK DS.L 1 ; broadcast frames recd OK
FCSerr DS.L 1 ; frame check sequence errors
FAerr DS.L 1 ; frame alignment errors
MPerr DS.L 1 ; missed packet errors
Size EQU *
ENDR
;¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥ General Equates
TalliesPerSec EQU 5000000 ; number of timer ticks/second
TxMaxRetries EQU 4 ; max attempts to retry aborted xmits
Max_Tx_Packets EQU 16 ; maximum # of chained Tx packets
Min_Pkt_Size EQU 60 ; minimum packet size
Min_Rx_Buffs EQU 2 ; minimum # of recv descriptors/buffers
Max_Pkt_Size EQU 1518 ; maximum packet size (inc. CRC)
EOL_Bit EQU 0 ; end-of-link bit
;¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥ For GetMemory call
GetMem RECORD 0
memsize DS.l 1 ; requested size
memoptions DS.l 1 ; requested options
memhndl DS.l 1 ; handle to memory mgr block
memhndla DS.l 1 ; handle to 4 or 8k aligned memory
memhndlasz DS.l 1 ; ptr to 4 or 8k aligned memory size
GetMemSz EQU *
ENDR
Locked EQU 0 ; want locked memory
Contig EQU 1 ; want contiguous memory
CacheOff EQU 2 ; want non-cacheable memory
;¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥ For FreeMemory call
FreeMem RECORD 0
memoptions DS.l 1 ; requested options
memptr DS.l 1 ; ptr to memory mgr block
memptra DS.l 1 ; ptr to 4 or 8k aligned memory
memptrasz DS.l 1 ; 4 or 8k aligned memory size
FreeMemSz EQU *
ENDR
;¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥ Initialization Parameters
MACEInitParms RECORD 0
RecvRtn DS.l 1 ; address of Ethernet receive routine
RecvPrms DS.l 1 ; parms to pass @ receive
XmitRtn DS.l 1 ; address of Ethernet xmit complete routine
XmitPrms DS.l 1 ; parms to pass @ xmit complete
MACECfgPtr DS.l 1 ; ptr to MACE config record
Dot3NetStats DS.l 1 ; ptr to 802.3 statistics array
LAPMIBNetStats DS.l 1 ; ptr to LAP MIB statistics array
EnetAddr DS.l 1 ; ptr to ethernet address
FastMoveRtn DS.l 1 ; ->proc to move memory FAST
IPSize EQU *
ENDR
;¥¥¥¥ Parms passed to .ENET "RecvRtn"
RcvParms RECORD {A6Link}
Size EQU * ; no local vars
A6Link DS.l 2 ; saved A6 and return addr
Parm DS.l 1 ; parm passed to MaceInit
Buff DS.l 1 ; ptr to Mace's buffer containing pkt
Pkt DS.l 1 ; ptr to packet data
Len DS.w 1 ; pkt length
Stat DS.l 1 ; pkt status
; Stat definition:
; Byte 0: Receive Runt Packet Count (Bits 31-24)
; -number of runts recv'd since last successfully recv'd pkt
; -maxs at 255
; Byte 1: Receive Collision Count (Bits 23-16)
; -number of collisions since last successfully recv'd pkt
; -maxs at 255
; Byte 2-3: Receive Status (Bits 15-0)
; Bits 15-7,3-0 : reserved, read as 0's
; Bits 6-4 : Recv Message Status bits
; RcvCLSN EQU 6 ; late collision during recv
; RcvFRAM EQU 5 ; frame error, non-integer # of bytes
; RcvFCS EQU 4 ; frame check sequence error
ParmsSz EQU * - Parm ; len of passed parms
ENDR
Configrsrc EQU 'ecfg' ; rsrc type for MACE config data rsrc
; Mace Configuration Record
MACECfg RECORD 0 ; Config values from config rsrc
MACECfgVers DS.w 1 ; record version
MACEBase DS.l 1 ; Base address of MACE
EnetPROM DS.l 1 ; base address of Address Prom
XmitFrmCtl DS.b 1 ; MACE transmit frame control register value
RecvFrmCtl DS.b 1 ; MACE receive frame control register value
FIFOCfgCtl DS.b 1 ; MACE xmit/recv fifo config control register value
MACCfgCtl DS.b 1 ; MACE MAC config control register value
; The following are optional values; ignored if zero
EnetAddr DS.b 6 ; Alternate Ethernet Address, overrides Address PROM
XmitBuffs DS.w 1 ; Alternate number of transmit buffers
RecvBuffs DS.w 1 ; Alternate number of receive buffers
RecvChains DS.w 1 ; Alternate number of receive "chains"
CfgSize EQU *
ENDR

View File

@ -0,0 +1,83 @@
# Contains: Makefile for PDM MACE Ethernet driver.
#
# Written by: Dave Calvert
#
# Copyright: © 1993 by Apple Computer, Inc., all rights reserved.
#
# Change History (most recent first):
#
# <SM6> 3/5/93 dwc Changed DeclDataPDMMace.rsrc ID to be unique from
# DeclDataMace.rsrc.
# <SM3> 3/4/93 dwc Added DeclDataPDMMace definition for PDM ENET.
# <SM2> 2/25/93 dwc Re-enable loopbacktests and include Interface.o for them.
# <SM2> 2/4/93 RC Took out Loopback.c.o link and fixed {make} to {makedir}
#
#===============================================================================
# Create DeclData Resource for PDM Declaration ROM
#===============================================================================
"{RsrcDir}DeclDataPDMMace.rsrc" Ä "{ObjDir}PDMMaceEnet.a.o" ¶
"{ObjDir}PDMMace.a.o" ¶
"{ObjDir}Loopback.c.o" ¶
"{IfObjDir}interface.o"
Link {StdLOpts} {StdAlign} -rt decl=1 -o "{Targ}" ¶
"{ObjDir}PDMMaceEnet.a.o" ¶
"{ObjDir}PDMMace.a.o" ¶
"{ObjDir}Loopback.c.o" ¶
"{IfObjDir}Interface.o"
"{RsrcDir}PDMENET.rsrc" Ä "{ObjDir}PDMMaceEnet.a.o" ¶
"{ObjDir}PDMMace.a.o" ¶
"{PDMMaceDir}PDMEnet.make" ¶
"{ObjDir}Loopback.c.o" ¶
"{IfObjDir}Interface.o"
Link -t rsrc -c RSED -sn Main="PDM MACE Ethernet Driver" ¶
-ra "PDM MACE Ethernet Driver"=resSysHeap,resPurgeable,resLocked ¶
-rt enet=57 -o {Targ} ¶
"{ObjDir}PDMMaceEnet.a.o" ¶
"{ObjDir}PDMMace.a.o" ¶
"{ObjDir}Loopback.c.o" ¶
"{IfObjDir}Interface.o"
"{RsrcDir}PDMENET57.rsrc" Ä "{ObjDir}PDMMaceEnet.a.o" ¶
"{ObjDir}PDMMace.a.o" ¶
# "{ObjDir}Loopback.c.o" ¶
"{PDMMaceDir}PDMEnet.make"
Link -t rsrc -c RSED -sn Main="PDM MACE Ethernet Driver" ¶
-ra "PDMENET"=resSysHeap,resPurgeable,resLocked ¶
-rt enet=57 -o {Targ} ¶
"{ObjDir}PDMMaceEnet.a.o" ¶
# "{ObjDir}Loopback.c.o" ¶
"{ObjDir}PDMMace.a.o"
#===============================================================================
# Assemble Stuff
#===============================================================================
"{ObjDir}PDMMace.a.o" Ä "{PDMMaceDir}PDMMace.a" ¶
"{PDMMaceDir}PDMMaceEqu.a" ¶
"{IntAIncludes}AMICEqu.a" ¶
"{IntAIncludes}UniversalEqu.a" ¶
"{EthernetDir}ATalkMacros.a" ¶
"{PDMMaceDir}PDMEnet.make"
Asm {StdAOpts} {Defs} -i "{PDMMaceDir}" -i "{EthernetDir}" -o "{Targ}" "{PDMMaceDir}PDMMace.a"
"{ObjDir}PDMMaceEnet.a.o" Ä "{PDMMaceDir}PDMMaceEnet.a" ¶
"{PDMMaceDir}PDMMaceEqu.a" ¶
"{PDMMaceDir}VersionPDMMaceEnet.a" ¶
"{EthernetDir}802Equ.a" ¶
"{EthernetDir}ATalkMacros.a" ¶
"{EthernetDir}ENETEqu.a" ¶
"{EthernetDir}SNMPLAP.a" ¶
"{IntAIncludes}UniversalEqu.a" ¶
"{IntAIncludes}AMICEqu.a" ¶
"{AIncludes}GestaltEqu.a" ¶
"{AIncludes}SysEqu.a" ¶
"{AIncludes}SysErr.a" ¶
"{AIncludes}Traps.a" ¶
"{AIncludes}Slots.a" ¶
"{PDMMaceDir}PDMEnet.make"
Asm {StdAOpts} {Defs} -i "{PDMMaceDir}" -i "{EthernetDir}" -o "{Targ}" "{PDMMaceDir}PDMMaceEnet.a"

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,335 @@
;
; File: PDMMaceEqu.a
;
; Contains: Equates for accessing the Ethernet Media Access
; Controller (MACE) for the PDM ENET driver
;
; Written by: Dave Calvert
;
; Copyright: © 1992-1993 by Apple Computer, Inc. All rights reserved.
;
; This file is used in these builds: ROM RISC (PDM ENET)
;
; Change History (most recent first):
;
; <SM10> 6/2/93 GMR Changed some of the init parameters (back to Mark's equates),
; modified the receive record/status definitions.
; <SM9> 5/27/93 dwc Added support for AMIC work-around code.
; <SM8> 5/25/93 dwc Clean up for Alpha.
; <SM7> 5/4/93 dwc Added debug code to work around AMIC's returning FF's on the
; first read.
; <SM6> 4/6/93 dwc Added status/packet logging equate.
; <SM5> 3/24/93 dwc Remove obsolete code and added code to try to recover from
; lowered interrupt level during packet handling.
; <SM4> 3/5/93 dwc Removed some more debugging code.
; <SM3> 2/25/93 dwc Enable receive, remove some debug equates.
; <SM2> 2/24/93 dwc Cleaned up some debug equates, added some more debug equates,
; disabled receive for the PDM D5 ROM build.
; <SM1> 2/4/93 dwc first checked in
;
;
; ---------------------------------------------------------
; MACE Registers
; ---------------------------------------------------------
MACERegBase EQU $50F1C000 ; Mace Reg Base on Cyclone
MACERegs RECORD 0
MACE_RX_FIFO DS.W 1 ;RD RXData -Read Status first
ORG *+$e
MACE_XMIT_FIFO DS.W 1 ;TX TXData
ORG *+$e
MACE_TX_FRM_CNTRL DS.B 1 ;RD/WR 01=Retry,XMTFCS,AUTOPAD
ORG *+$f
MACE_TX_FRM_STAT DS.B 1 ;RD
ORG *+$f
MACE_TX_RETRY_CNT DS.B 1 ;RD
ORG *+$f
MACE_RX_FRM_CNTRL DS.B 1 ;RD/WR 00 = Not_AutoStripPad
ORG *+$f
MACE_RX_FRM_STAT DS.B 1 ;RD Read 4x to get RX Status of packet
ORG *+$f
MACE_FIFO_FRM_CNT DS.B 1 ;RD Number of frames in FIFO
ORG *+$f
MACE_INT DS.B 1 ;RD_1 Interupt Source bits
ORG *+$f
MACE_INT_MSK DS.B 1 ;RD/WR Interupt Enables
ORG *+$f
MACE_POLL DS.B 1 ;RD Yet another status location
ORG *+$f
MACE_BIU_CNFG DS.B 1 ;RD/WR 20 = normal mode 01 = Soft Reset
ORG *+$f
MACE_FIFO_CNFG DS.B 1
ORG *+$f
MACE_MAC_CNFG DS.B 1 ;Enables
ORG *+$f
MACE_PLS_CNFG DS.B 1 ;RD/WR 0=Normal Mode
ORG *+$f
MACE_PHY_CNFG DS.B 1 ;RD/WR Reserved,Dude.
ORG *+$f
MACE_CHIP_ID_LOW DS.B 1 ;RD Just Reads ID
ORG *+$f
MACE_CHIP_ID_HIGH DS.B 1 ;RD Just Reads ID
ORG *+$f
MACE_ADDR_CNFG DS.B 1 ;RD/WR 04=Phy_Addr, 02=Log_Addr
ORG *+$1f
MACE_LOG_ADDR DS.B 1 ;Load with 6 Zeros
ORG *+$f
MACE_PHY_ADDR DS.B 1 ;Load with Address
ORG *+$2f
MACE_MISSED_PKT_CNT DS.B 1 ;RD
ORG *+$4f
MACE_USER_TEST_REG DS.B 1 ;
ENDR
;
; MACE Interrupt Reg. & Int. Reg. Mask Bit defines
; MACE Int. Reg - Read/Clear; MACE Int. Mask Reg. - Read/Write
;
BABL EQU 6 ; Babble, Xmit timeout error
CERR EQU 5 ; Signal Quality Error (SQE), xmit
RCVCO EQU 4 ; Receive Collision Cnt Overflow
MPCO EQU 2 ; Missed Pkt Cnt Overflow
RCVINT EQU 1 ; Rcv int
XMTINT EQU 0 ; Xmit int
; mask to disable all MACE ints
;
; MACE Poll register bits
;
TDTREQ EQU 6 ; Transmit data request
RTDREQ EQU 5 ; Receive data request
;==========================================================================================
; _SETTHEINTMASK
;
; Macro for setting the interrupt level to an arbitrary level. Pass the level in
; a Data register.
;==========================================================================================
MACRO
_SETTHEINTMASK &sReg
move.w SR,-(SP)
or.w &sReg,(SP)
move.w (SP)+,SR
ENDM
MaceIntMask EQU (1<<BABL)+(1<<CERR)+(1<<RCVCO)+(1<<MPCO)+(1<<RCVINT)+(1<<XMTINT)
OurIntsMask EQU (1<<RCVINT) ; Ignore only these interrupts from MACE
;
; MACE Transmit Frame Status Reg. Bit defines
; Note: ONE and MORE are swapped prior to CURIO B0 MACE
;
XMTSV EQU 7 ; transmit status field valid when 1
UFLO EQU 6 ; underflow - xmit fifo
LCOL EQU 5 ; late collision
MORE EQU 4 ; more than 1 retry needed to xmit
ONE EQU 3 ; exactly 1 retry needed to xmit
DEFER EQU 2 ; transmission defered at least once
LCAR EQU 1 ; loss of carrier
RTRY EQU 0 ; retry
;
; MACE Transmit Frame Control Reg. Bit defines (byte)
;
DRTRY EQU 7 ; disable retry
DXMTFCS EQU 3 ; disable xmit fcs
APADXMT EQU 0 ; enable xmt autopad
; -forces generation of fcs
;
; MACE Receive Frame Control Reg. Bit defines (byte)
;
ASTRIPRCV EQU 0 ; enable rcv autopad stripping
; -forces stripping of fcs
;
; MACE Receive Status Reg. Bit defines (long)
;
; Receive Message Byte Count (byte0)
; Bits 7-0 : Recv Message Byte Count bits 7-0
; Receive Status (byte1)
; Bits 3-0 : Recv Message Byte Count bits 11-8
; Bits 7-4 : Recv Message Status bits
RcvOFLO EQU 7 ; receive fifo overflow
RcvCLSN EQU 6 ; late collision during recv
RcvFRAM EQU 5 ; frame error, non-integer # of bytes
RcvFCS EQU 4 ; frame check sequence error
; Receive Runt Packet Count (byte2)
; -number of runts recv'd since last successfully recv'd pkt
; -maxs at 255
; Receive Collision Count (byte3)
; -number of collisions since last successfully recv'd pkt
; -maxs at 255
;
; MACE Bus Interface Unit Reg. Bit defines (byte)
;
BSWAP EQU 7 ; byte swap mode, 0-Intel, 1-Motorola
; Transmit start point Bits 5-4
XMSTP EQU 4 ; bit shift offset
MACERESET EQU 0 ; software reset
; Transmit start point equates
; -controls when preamble xmit starts
XMTS4 EQU $00 ; start when 4 bytes in FIFO
XMTS16 EQU $10 ; start when 16 bytes in FIFO
XMTS64 EQU $20 ; start when 64 bytes in FIFO
XMTS112 EQU $30 ; start when 112 bytes in FIFO
;
; MACE FIFO Configuration Reg. Bit defines (byte)
; -fifo water mark changes ignored until fw reset bit set
; Transmit FIFO water mark Bits 7-6
XMTFW EQU 6 ; bit shift offset
; Receive FIFO water mark Bits 5-4
RCVFW EQU 4 ; bit shift offset
XMTFWR EQU 3 ; xmit fifo water mark reset
RCVFWR EQU 2 ; recv fifo water mark reset
XMTBRST EQU 1 ; xmit burst
RCVBRST EQU 0 ; recv burst
; FIFO watermark equates
RFW16 EQU $00 ; 16 byte recv FIFO watermark
RFW32 EQU $10 ; 32 byte recv FIFO watermark
RFW64 EQU $20 ; 64 byte recv FIFO watermark
TFW16 EQU $00 ; 16 byte xmit FIFO watermark
TFW32 EQU $40 ; 32 byte xmit FIFO watermark
TFW64 EQU $80 ; 64 byte xmit FIFO watermark
;
; MACE MAC Configuration Reg. Bit defines (byte)
;
PROMISC EQU 7 ; promiscuous mode, recv all valid frames
DXMT2PD EQU 6 ; disable xmit 2-part deferral algorithm
EMBA EQU 5 ; enable modified back-off algorithm
ENXMT EQU 1 ; enable xmit
ENRCV EQU 0 ; enable recv
;
; MACE Physical Layer Signaling Reg. Bit defines (byte)
;
XMTSEL EQU 3 ; xmit mode select
; Port Select Bits 2-1
PORTSEL EQU 1 ; bit shift offset
ENSTS EQU 0 ; enable optional I/O function status
;
; MACE Internal Address Configuration Reg. Bit defines (byte)
;
ADDRCHG EQU 7 ; address change enable
PHYADDR EQU 2 ; physical address select
LOGADDR EQU 1 ; logical address select
;
; MACE User Test Reg. Bit defines (byte)
;
;¥¥¥¥¥ WARNING: DO NOT EVER SET BIT 7 or you'll fry the MACE!!!! ¥¥¥¥¥
; Bit 6 (disable) is set during MACE init to disallow an erroneous and/or
; malicious setting of RTRE.
RTRE EQU 7 ; reserved test register enable
RTRD EQU 6 ; reserved test register disable
;¥¥¥¥¥
RPA EQU 5 ; runt packet accept
FCOLL EQU 4 ; force a collision, use with loopback
RCVFCSE EQU 3 ; receive fcs enable, use with loopback
; Loopback control Bits 2-1, %XX0 ¥¥¥ NOT FOR BIT SHIFTS!
NOLPB EQU %000 ; disable loopback mode
EXTLPB EQU %010 ; external loopback mode
INTLPB EQU %100 ; internal loopback, no MENDEC
MENDECLPB EQU %110 ; internal loopback, with MENDEC
;
; Misc. equates
;
MondoPkt EQU 2000 ; Value > max pkt, used for Recv DMA cnt
AddrPROM EQU $50F08000 ; 32 bit address of address PROM
CntRegMask EQU $0001ffff ; Ignore upper 15 bits
nobuff EQU -2 ; no xmit buffer available
;¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥ Network Statistics
NetStats RECORD 0 ; network management stats.
TxOK DS.L 1 ; frames transmitted OK
sCollFrame DS.L 1 ; single collision frames
mCollFrame DS.L 1 ; multiple collision frames
CollFrame DS.L 1 ; collision frames
DefTx DS.L 1 ; deferred transmissions
LateColl DS.L 1 ; late collisions
ExcessColl DS.L 1 ; excessive collisions
ExcessDef DS.L 1 ; excessive defferals
InMACTxErr DS.L 1 ; internal MAC transmit errors
RxOK DS.L 1 ; frames received OK
MultiRxOK DS.L 1 ; multicast frames recd OK
BroadRxOK DS.L 1 ; broadcast frames recd OK
FCSerr DS.L 1 ; frame check sequence errors
FAerr DS.L 1 ; frame alignment errors
MPerr DS.L 1 ; missed packet errors
Size EQU *
ENDR
;¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥ General Equates
TalliesPerSec EQU 5000000 ; number of timer ticks/second
TxMaxRetries EQU 4 ; max attempts to retry aborted xmits
Max_Tx_Packets EQU 16 ; maximum # of chained Tx packets
Min_Pkt_Size EQU 60 ; minimum packet size
Min_Rx_Buffs EQU 2 ; minimum # of recv descriptors/buffers
Max_Pkt_Size EQU 1518 ; maximum packet size (inc. CRC)
EOL_Bit EQU 0 ; end-of-link bit
;¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥ For GetMemory call
Locked EQU 0 ; want locked memory
Contig EQU 1 ; want contiguous memory
CacheOff EQU 2 ; want non-cacheable memory
;¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥ Initialization Parameters
MACEInitParms RECORD 0
RecvRtn DS.l 1 ; address of Ethernet receive routine
RecvPrms DS.l 1 ; parms to pass @ receive
XmitRtn DS.l 1 ; address of Ethernet xmit complete routine
XmitPrms DS.l 1 ; parms to pass @ xmit complete
MACECfgPtr DS.l 1 ; ptr to MACE config record
Dot3NetStats DS.l 1 ; ptr to 802.3 statistics array
LAPMIBNetStats DS.l 1 ; ptr to LAP MIB statistics array
EnetAddr DS.l 1 ; ptr to ethernet address
FastMoveRtn DS.l 1 ; ->proc to move memory FAST
IPSize EQU *
ENDR
;¥¥¥¥ Parms passed to .ENET "RecvRtn"
RcvParms RECORD {A6Link}
Size EQU * ; no local vars
A6Link DS.L 2 ; saved A6 and return addr
Parm DS.L 1 ; parm passed to MaceInit
PktLen DS.L 1 ; pkt length
PktStat DS.L 1 ; pkt status
PktData DS.L 1 ; ptr to packet data
; Byte 0-1: Receive Status (Bits 15-0)
; Bits 15-7,3-0 : reserved, read as 0's
; Bits 6-4 : Recv Message Status bits
; RcvCLSN EQU 6 ; late collision during recv
; RcvFRAM EQU 5 ; frame error, non-integer # of bytes
; RcvFCS EQU 4 ; frame check sequence error
ParmsSz EQU * - Parm ; len of passed parms
ENDR
Configrsrc EQU 'ecfg' ; rsrc type for MACE config data rsrc
; Mace Configuration Record
MACECfg RECORD 0 ; Config values from config rsrc
MACECfgVers DS.w 1 ; record version
MACEBase DS.l 1 ; Base address of MACE
EnetPROM DS.l 1 ; base address of Address Prom
XmitFrmCtl DS.b 1 ; MACE transmit frame control register value
RecvFrmCtl DS.b 1 ; MACE receive frame control register value
FIFOCfgCtl DS.b 1 ; MACE xmit/recv fifo config control register value
MACCfgCtl DS.b 1 ; MACE MAC config control register value
; The following are optional values; ignored if zero
EnetAddr DS.b 6 ; Alternate Ethernet Address, overrides Address PROM
XmitBuffs DS.w 1 ; Alternate number of transmit buffers
RecvBuffs DS.w 1 ; Alternate number of receive buffers
RecvChains DS.w 1 ; Alternate number of receive "chains"
CfgSize EQU *
ENDR

View File

@ -0,0 +1,25 @@
;
; File: VersionMaceEnet.a
;
; Contains: Version information for Mace Ethernet driver for PDM
;
; Written by: Dave Calvert
;
; Copyright: © 1992-1993 by Apple Computer, Inc., all rights reserved.
;
; Change History (most recent first):
;
; <SM3> 5/27/93 dwc Make Rev D8.
; <SM2> 2/24/93 dwc Made version zero for the ROM based version.
; <SM1> 2/4/93 dwc first checked in
;
; To Do:
;
PRINT PUSH, GEN, NOMDIR
;
; ¥¥¥ DO NOT CHANGE parm 9, "MaceEnet", driver code depends on that string!
;
VERSION 'PDM MACE DMA Ethernet Driver', 0, 0, 0, development, 8, '1993', 'q4', MaceEnet
PRINT POP

View File

@ -0,0 +1,45 @@
;
; File: VersionMaceEnet.a
;
; Contains: Version information for Mace Ethernet driver for Cyclone
;
; Written by: Mark A. Law
;
; Copyright: © 1991-1993 by Apple Computer, Inc., all rights reserved.
;
; Change History (most recent first):
;
; <SM10> 7/26/93 mal Changed vers to 1.0.1d1 for first bug fix after 1.0 release.
; <SM9> 6/17/93 kc Roll in Ludwig.
; <LW8> 6/14/93 mal Changed version to 1.0.
; <SM8> 6/14/93 kc Roll in Ludwig.
; <LW7> 5/22/93 mal Change vers to 1.0b7q1 since drvr did change since b6.
; <LW6> 5/3/93 mal Updated to 1.0b6q4
; <LW5> 5/1/93 mal Changed name to 'Built-In Ethernet Driver' and vers to 1.0b6q1.
; <LW4> 3/21/93 mal Updated to b3q2
; <LW3> 2/17/93 mal Updated to 1.0a10q4
; <2> 1/27/93 mal Updated to 1.0a9q3
; <SM7> 12/4/92 mal Updated to 1.0a8q3.
; <SM6> 11/19/92 mal Updated to 1.0a7.
; <SM5> 11/10/92 mal Updated to 1.0a6q1.
; <SM4> 10/30/92 mal Updated to 1.0a5
; <SM3> 10/26/92 mal Updated to 1.0a4q4
; <SM2> 10/13/92 mal changed to 1.0d10q4
; <1> 10/6/92 GDW New location for ROMLink tool.
; <SM4> 9/14/92 mal changed to 1.0d9q6
; <SM3> 7/25/92 mal Changed to 1.0d9q4
; <SM2> 6/22/92 mal Updated to 1.0d8q1.
; <P4> 4/30/92 mal
; <P3> 4/28/92 mal Chg to 1.0D5q1
; <P2> 3/23/92 mal Chg to 1.0d3q4 for 1.0D3 ROM bld.
;
; To Do:
;
PRINT PUSH, GEN, NOMDIR
;
; ¥¥¥ DO NOT CHANGE parm 9, "MaceEnet", driver code depends on that string!
;
VERSION 'Built-In Ethernet Driver', 1, 0, 1, development, 1, '1992-1993', '', MaceEnet
PRINT POP

227
DeclData/DeclNet/SNMPLAP.a Normal file
View File

@ -0,0 +1,227 @@
;
; File: SNMPLAP.a
;
; Contains: Simple Network Management Protocol equates for
; Link Access Protocols
;
; Written by: Mark A. Law and Brad Suinn
;
; Copyright: © 1992 by Apple Computer, Inc. All rights reserved.
;
; Change History (most recent first):
;
; <SM3> 10/26/92 mal Updated to ESD's latest version.
; <SM2> 10/26/92 mal Updated SNMP statistic arrays to latest versions.
; <1> 10/6/92 GDW New location for ROMLink tool.
;
LAPMIBStats RECORD 0,increment
ifVersion DS.L 1 ; Version of LinkStats we support
ifDescr DS.B 256 ; String with info about interface
ifType DS.L 1 ; <8> Change to a Long. Code with type of interface
ifMaxMTU DS.L 1 ; <8> Change to a Long. Largest size of IP datagram that can be tx/recv
ifSpeed DS.L 1 ; Bandwidth in bits/second
ifPhysAddress DS.B 32 ; Interface address
ifAdminStatus DS.L 1 ; <8> Change to a Long. Desired state (1 = up, 2 = down, 3 = testing)
ifOperStatus DS.L 1 ; <8> Change to a Long. Current state (1 = up, 2 = down, 3 = testing)
ifLastChange DS.L 1 ; SysTicks when interface entered current operation state
ifInOctets DS.L 1 ; Total nbr bytes received including framing chars
ifInUcastPkts DS.L 1 ; Nbr of unicast packets received
ifInNUcastPkts DS.L 1 ; Nbr of broad/multi cast packets received
ifInDiscards DS.L 1 ; Nbr of overwrites that occured (NOT USED)
ifInErrors DS.L 1 ; Nbr of pkts recv which contain error
ifInUnknownProtos DS.L 1 ; Nbr of pkts recv discarded cuz of unknown protocol
ifOutOctets DS.L 1 ; Total nbr bytes tx including framing chars
ifOutUcastPkts DS.L 1 ; Nbr of unicast packets tx
ifOutNUcastPkts DS.L 1 ; Nbr of broad/multi cast packets tx
ifOutDiscards DS.L 1 ; Nbr tx pkts discarded (NOT USED)
ifOutErrors DS.L 1 ; Nbr tx pkts not sent due to error
ifOutQLen DS.L 1 ; Current nbr of packets in output queue
LAPMIBStatsSz EQU *
ENDR
; ifAdminStatus and ifOperStatus
ifStatusUp EQU 1
ifStatusDown EQU 2
ifStatusTesting EQU 3
; IfTypes
other EQU 1 ; none of the following
regular1822 EQU 2
hdh1822 EQU 3
ddn_x25 EQU 4
rfc877_x25 EQU 5
ethernet_csmacd EQU 6
iso88023_csmacd EQU 7
iso88024_tokenBus EQU 8
iso88025_tokenRing EQU 9
iso88026_man EQU 10
starLan EQU 11
proteon_10Mbit EQU 12
proteon_80Mbit EQU 13
hyperchannel EQU 14
fddi EQU 15
lapb EQU 16
sdlc EQU 17
ds1 EQU 18 ; T-1
e1 EQU 19 ; european equivalent of T-1
basicISDN EQU 20
primaryISDN EQU 21
propPointToPointSerial EQU 22 ; proprietary serial
ppp EQU 23
softwareLoopback EQU 24
eon EQU 25 ; CLNP over IP
ethernet_3Mbit EQU 26
nsip EQU 27 ; XMS over IP
slip EQU 28 ; generic SLIP
ultra EQU 29 ; ULTRA technologies
ds3 EQU 30 ; T-3
sip EQU 31 ; SMDS
frame_relay EQU 32
;
; EtherNet (802.3) SNMP equates
;
Dot3Entry Record 0,increment
dot3Version DS.l 1 ; Version of LapDot3 entry that we support
dot3Index DS.l 1 ; ifIndex for this driver
dot3InitializeMac DS.l 1 ; Init status (1 = inited, 2 = uninited)
dot3SubLayerStatus DS.l 1 ; Op status of the MAC sublayer (1 = enabled, 2 = disabled)
dot3MulticastReceiveStatus DS.l 1 ; Multicast receive status (1 = enabled, 2 = disabled)
dot3TxEnabled DS.l 1 ; MAC frame tx state (1 = enabled, 2 = disabled)
dot3TestTdrValue DS.l 1 ; Time between TDR start/end
Dot3EntrySz EQU * ; End of Dot3Entry
ENDR
Dot3StatsEntry RECORD 0,increment
dot3StatsVersion DS.l 1 ; Version number
dot3StatsIndex DS.l 1 ; Same as ifIndex (to be left at zero)
dot3StatsAlignmentErrors DS.l 1
dot3StatsFCSErrors DS.l 1
dot3StatsSingleCollisionFrames DS.l 1
dot3StatsMultipleCollisionFrames DS.l 1
dot3StatsSQETestErrors DS.l 1
dot3StatsDeferredTransmissions DS.l 1
dot3StatsLateCollisions DS.l 1
dot3StatsExcessiveCollisions DS.l 1
dot3StatsInternalMacTransmitErrors DS.l 1
dot3StatsCarrierSenseErrors DS.l 1
dot3StatsExcessiveDeferrals DS.l 1
dot3StatsFrameTooLongs DS.l 1
dot3StatsInRangeLengthErrors DS.l 1
dot3StatsOutOfRangeLengthFields DS.l 1
dot3StatsInternalMacReceiveErrors DS.l 1
Dot3StatsEntrySz EQU *
ENDR
Dot3CollEntry RECORD 0,increment
dot3CollVersion DS.l 1 ; Version number
dot3CollIndex DS.l 1 ; Same as ifIndex (to be left at zero)
dot3CollCount DS.l 1
dot3CollFrequencies DS.l 1
Dot3CollEntrySz EQU *
ENDR
;
; TokenRing (802.5) SNMP equates
;
Dot5Entry Record 0,increment
dot5Version DS.l 1 ; Version of LapDot5 entry that we support
dot5Index DS.l 1 ; ifIndex for this driver
dot5Commands DS.l 1 ; always reads as no_op (1)
dot5RingStatus DS.l 1
dot5RingState DS.l 1
dot5RingOpenStatus DS.l 1
dot5RingSpeed DS.l 1
dot5UpStream DS.l 1
dot5ActMonParticipate DS.l 1
dot5Functional DS.l 1
Dot5EntrySz EQU * ; End of Dot5Entry
ENDR
Dot5StatsEntry RECORD 0,increment ; ¥¥
dot5StatsVersion DS.l 1 ; Version number
dot5StatsIndex DS.l 1 ; Same as ifIndex (to be left at zero)
dot5StatsLineErrors DS.l 1
dot5StatsBurstErrors DS.l 1
dot5StatsACErrors DS.l 1
dot5StatsAbortTransErrors DS.l 1
dot5StatsInternalErrors DS.l 1
dot5StatsLostFrameErrors DS.l 1
dot5StatsReceiveCongestions DS.l 1
dot5StatsFrameCopiedErrors DS.l 1
dot5StatsTokenErrors DS.l 1
dot5StatsSoftErrors DS.l 1
dot5StatsHardErrors DS.l 1
dot5StatsSignalLoss DS.l 1
dot5StatsTransmitBeacons DS.l 1
dot5StatsRecoverys DS.l 1
dot5StatsLobeWires DS.l 1
dot5StatsRemoves DS.l 1
dot5StatsSingles DS.l 1
dot5StatsFreqErrors DS.l 1
Dot5StatsEntrySz EQU *
ENDR
Dot5TimerEntry RECORD 0,increment ; ¥¥
dot5TimerVersion DS.l 1 ; Version number
dot5TimerIndex DS.l 1 ; Same as ifIndex (to be left at zero)
dot5TimerReturnRepeat DS.l 1
dot5TimerHolding DS.l 1
dot5TimerQueuePDU DS.l 1
dot5TimerValidTransmit DS.l 1
dot5TimerNoToken DS.l 1
dot5TimerActiveMon DS.l 1
dot5TimerStandbyMon DS.l 1
dot5TimerErrorReport DS.l 1
dot5TimerBeaconTransmit DS.l 1
dot5TimerBeaconReceive DS.l 1
Dot5TimerEntrySz EQU *
ENDR
; dot3InitializeMac
dot3initialized EQU 1
dot3uninitialized EQU 2
; dot3SubLayerStatus, dot3MulticastReceiveStatus
dot3enabled EQU 1
dot3disabled EQU 2
; dot3TxEnabled, dot5ActMonParticipate
dot_true EQU 1
dot_false EQU 2
; dot5Commands
dot5no_op EQU 1
dot5open EQU 2
dot5reset EQU 3
dot5close EQU 4
; dot5RingState
opened EQU 1
closed EQU 2
opening EQU 3
closing EQU 4
openFailure EQU 5
ringFailure EQU 6
; dot5RingOpenStatus
noOpen EQU 1
badParam EQU 2
lobeFailed EQU 3
signalLoss EQU 4
insertionTimeout EQU 5
ringFailed EQU 6
beaconing EQU 7
duplicateMAC EQU 8
requestFailed EQU 9
removeReceived EQU 10
ringopen EQU 11
; dot5RingSpeed
unknown EQU 1
oneMegabit EQU 2
fourMegabit EQU 3
sixteenMegabit EQU 4
SNMPVersion EQU $100 ; used for LAPMIBStats, Dot3Stats, Dot3Entry

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,39 @@
#
# File: Sonic.make
#
# Contains: Makefile for Sonic.
#
# Written by: Kurt Clark, Chas Spillar, and Tim Nichols
#
# Copyright: © 1992 by Apple Computer, Inc., all rights reserved.
#
# Change History (most recent first):
#
"{RsrcDir}DeclDataSonic.rsrc" Ä "{ObjDir}SonicEnet.a.o" ¶
"{ObjDir}Sonic.a.o" ¶
"{ObjDir}Loopback.c.o" ¶
"{IfObjDir}interface.o"
Link {StdLOpts} {StdAlign} -rt decl=1 -o "{Targ}" "{ObjDir}SonicEnet.a.o" ¶
"{ObjDir}Sonic.a.o" ¶
"{ObjDir}Loopback.c.o" ¶
"{IfObjDir}interface.o"
"{ObjDir}SonicEnet.a.o" Ä "{SonicDir}SonicEnet.a" ¶
"{SonicDir}SonicEqu.a" ¶
"{SonicDir}VersionEclipse.a" ¶
"{EthernetDir}AtalkMacros.a" ¶
"{EthernetDir}ENETEqu.a" ¶
"{AIncludes}GestaltEqu.a" ¶
"{AIncludes}Slots.a" ¶
"{AIncludes}SysEqu.a" ¶
"{AIncludes}SysErr.a" ¶
"{AIncludes}ToolUtils.a" ¶
"{AIncludes}Traps.a"
Asm {StdAOpts} -d ForEclipseROM=0,sonic32=1,ctlpad=0,mmu=1 -i "{SonicDir}" -i "{EthernetDir}" -o "{Targ}" "{SonicDir}SonicEnet.a"
"{ObjDir}Sonic.a.o" Ä "{SonicDir}Sonic.a" ¶
"{SonicDir}SonicEqu.a"
Asm {StdAOpts} -d sonic32=1,mmu=1 -i "{SonicDir}" -i "{EthernetDir}" -o "{Targ}" "{SonicDir}Sonic.a"

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,501 @@
;
; File: SonicEqu.a
;
; Contains: Sonic-specific equates
;
; Written by: Sean Findley
;
; Copyright: © 1990, 1992 by Apple Computer, Inc., all rights reserved.
;
; This file is used in these builds: Mac32
;
; Change History (most recent first):
;
; <1> 10/6/92 GDW New location for ROMLink tool.
; <1> 6/12/92 RLM first checked in
; <P2> 02/07/92 jmp (jmp,H2/BG/SJF,Z4) Rolled in SMOVE macro def and SonicAddress
; def.
; <1> 2/4/92 mal first checked in
; ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
; Pre-Pandora ROM comments begin here.
; ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
; <3> 2/26/91 JK Added extended Motorola mode equates.
; <2> 1/30/91 JK Added code review changes.
; <1> 12/14/90 JK Added to build
;
; To Do:
;
; SonicEqu.a - Equates for SONIC
; written by Sean J. Findley Jan. 1990
; Copyright (c) 1990 Apple Computer, Inc.
MACRO
CtlRegPad
IF CTLPAD THEN
ORG *+2
ENDIF
ENDM
MACRO ; <Z4> thru next <Z4>
SMOVE &src,&dest
IF SONIC32 THEN
MOVE.L &src,&dest
ELSE
MOVE.W &src,&dest
ENDIF
ENDM ; <Z4>
;¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥ SONIC Registers
SONICRegs RECORD 0
IF SONIC32 THEN
Command DS.L 1 ; (CR) SONIC control
Data_Config DS.L 1 ; (DCR) packet configuration
Recv_Control DS.L 1 ; (RCR) pkt reception control
Trans_Control DS.L 1 ; (TCR) Transmission control
Int_Mask DS.L 1 ; (IMR) interrupt mask
Int_Status DS.L 1 ; (ISR) interrupts status bits
Upper_TDA DS.L 1 ; (UTDA) upper 16 bits of TDA address
Current_TDA DS.L 1 ; (CTDA) 16 bit ptr to current TDA
Trans_PktSize DS.L 1 ; (TPS) total size of outbound pkt
Trans_FragCount DS.L 1 ; (TFC) transmit fragment count
Trans_PktStart0 DS.L 1 ; (TSA0) lower 16 bit of pkt addr
Trans_PktStart1 DS.L 1 ; (TSA1) upper "
Trans_FragSize DS.L 1 ; (TFS) current fragment size
Upper_RDA DS.L 1 ; (URDA) upper 16 bits of RDA address
Current_RDA DS.L 1 ; (CRDA) 16 bit ptr to current RDA
Recv_RBA0 DS.L 1 ; (CRBA0) lower 16 bit receive addr in RBA
Recv_RBA1 DS.L 1 ; (CRBA1) upper 16 bit recive addr in RBA
Buff_Cnt0 DS.L 1 ; (RBWC0) lower 16 bit of word count in RBA
Buff_Cnt1 DS.L 1 ; (RBWC1) upper "
End_Buff DS.L 1 ; (EOBC) end of buffer word count
Upper_RRA DS.L 1 ; (URRA) upper 16 bits of RRA address
RRA_Start DS.L 1 ; (RSA) 16 bit ptr to RRA
RRA_End DS.L 1 ; (REA) 16 bit ptr to end of RRA
RRA_Read DS.L 1 ; (RRP) where SONIC gets next read resource
RRA_Write DS.L 1 ; (RWP) where host puts new read resources
TRBA0 DS.L 1 ; (TRBA0) used by SONIC
TRBA1 DS.L 1 ; (TRBA1) "
TBWC0 DS.L 1 ; (TBWC0) "
TBWC1 DS.L 1 ; (TBWC1) "
ADDR0 DS.L 1 ; (ADDR0) "
ADDR1 DS.L 1 ; (ADDR1) "
LLFA DS.L 1 ; (LLFA) "
TTDA DS.L 1 ; (TTDA) "
CAM_EntryPtr DS.L 1 ; (CEP) points to CAM cell
CAM_Port2 DS.L 1 ; (CAP2) selects upper 16 bits of CAM cell
CAM_Port1 DS.L 1 ; (CAP1) selects middle 16 bits of CAM cell
CAM_Port0 DS.L 1 ; (CAP0) selects lower 16 bits of CAM cell
CAM_Enable DS.L 1 ; (CE) CAM enable register turns cells on/off
CAM_DescPtr DS.L 1 ; (CDP) 16 bit ptr to current CAM descriptor
CAM_Count DS.L 1 ; (CDC) count of CAM descriptors
Silicon_Rev DS.L 1 ; (SR) rev info on SONIC chip
Timer0 DS.L 1 ; (WT0) lower 16 bits of SONCIC timer
Timer1 DS.L 1 ; (WT1) upper 16 "
Recv_SeqCnt DS.L 1 ; (RSC) receive sequence counter
CRC_Err DS.L 1 ; (CRCT) CRC error count
FAE_Err DS.L 1 ; (FAET) frame alignment error count
MissedPkt_Err DS.L 1 ; (MPT) missed packet error count
MDT DS.L 1 ; (MDT) max. deferral timer
RTC DS.L 1 ; (RTC) receive test control
TTC DS.L 1 ; (TTC) transmit test control
DTC DS.L 1 ; (DTC) DMA test control
CC0 DS.L 1 ; (CC0) CAM comparison 0
CC1 DS.L 1 ; (CC1) CAM comparison 1
CC2 DS.L 1 ; (CC2) CAM comparison 2
CM DS.L 1 ; (CM) CAM match
res1 DS.L 2 ; reserved by National Semiconductor
RBC DS.L 1 ; (RBC) receiver byte count
res2 DS.L 1 ; reserved by National Semiconductor
TBO DS.L 1 ; (TBO) transmit backoff counter
TRC DS.L 1 ; (TRC) transmit random counter
TBM DS.L 1 ; (TBM) transmit backoff mask
res3 DS.L 1 ; reserved by National Semiconductor
Data_Config2 DS.L 1 ; extended data configiguration
ELSE
Command DS.W 1 ; (CR) SONIC control
CtlRegPad
Data_Config DS.W 1 ; (DCR) packet configuration
CtlRegPad
Recv_Control DS.W 1 ; (RCR) pkt reception control
CtlRegPad
Trans_Control DS.W 1 ; (TCR) Transmission control
CtlRegPad
Int_Mask DS.W 1 ; (IMR) interrupt mask
CtlRegPad
Int_Status DS.W 1 ; (ISR) interrupts status bits
CtlRegPad
Upper_TDA DS.W 1 ; (UTDA) upper 16 bits of TDA address
CtlRegPad
Current_TDA DS.W 1 ; (CTDA) 16 bit ptr to current TDA
CtlRegPad
Trans_PktSize DS.W 1 ; (TPS) total size of outbound pkt
CtlRegPad
Trans_FragCount DS.W 1 ; (TFC) transmit fragment count
CtlRegPad
Trans_PktStart0 DS.W 1 ; (TSA0) lower 16 bit of pkt addr
CtlRegPad
Trans_PktStart1 DS.W 1 ; (TSA1) upper "
CtlRegPad
Trans_FragSize DS.W 1 ; (TFS) current fragment size
CtlRegPad
Upper_RDA DS.W 1 ; (URDA) upper 16 bits of RDA address
CtlRegPad
Current_RDA DS.W 1 ; (CRDA) 16 bit ptr to current RDA
CtlRegPad
Recv_RBA0 DS.W 1 ; (CRBA0) lower 16 bit receive addr in RBA
CtlRegPad
Recv_RBA1 DS.W 1 ; (CRBA1) upper 16 bit recive addr in RBA
CtlRegPad
Buff_Cnt0 DS.W 1 ; (RBWC0) lower 16 bit of word count in RBA
CtlRegPad
Buff_Cnt1 DS.W 1 ; (RBWC1) upper "
CtlRegPad
End_Buff DS.W 1 ; (EOBC) end of buffer word count
CtlRegPad
Upper_RRA DS.W 1 ; (URRA) upper 16 bits of RRA address
CtlRegPad
RRA_Start DS.W 1 ; (RSA) 16 bit ptr to RRA
CtlRegPad
RRA_End DS.W 1 ; (REA) 16 bit ptr to end of RRA
CtlRegPad
RRA_Read DS.W 1 ; (RRP) where SONIC gets next read resource
CtlRegPad
RRA_Write DS.W 1 ; (RWP) where host puts new read resources
CtlRegPad
TRBA0 DS.W 1 ; (TRBA0) used by SONIC
CtlRegPad
TRBA1 DS.W 1 ; (TRBA1) "
CtlRegPad
TBWC0 DS.W 1 ; (TBWC0) "
CtlRegPad
TBWC1 DS.W 1 ; (TBWC1) "
CtlRegPad
ADDR0 DS.W 1 ; (ADDR0) "
CtlRegPad
ADDR1 DS.W 1 ; (ADDR1) "
CtlRegPad
LLFA DS.W 1 ; (LLFA) "
CtlRegPad
TTDA DS.W 1 ; (TTDA) "
CtlRegPad
CAM_EntryPtr DS.W 1 ; (CEP) points to CAM cell
CtlRegPad
CAM_Port2 DS.W 1 ; (CAP2) selects upper 16 bits of CAM cell
CtlRegPad
CAM_Port1 DS.W 1 ; (CAP1) selects middle 16 bits of CAM cell
CtlRegPad
CAM_Port0 DS.W 1 ; (CAP0) selects lower 16 bits of CAM cell
CtlRegPad
CAM_Enable DS.W 1 ; (CE) CAM enable register turns cells on/off
CtlRegPad
CAM_DescPtr DS.W 1 ; (CDP) 16 bit ptr to current CAM descriptor
CtlRegPad
CAM_Count DS.W 1 ; (CDC) count of CAM descriptors
CtlRegPad
Silicon_Rev DS.W 1 ; (SR) rev info on SONIC chip
CtlRegPad
Timer0 DS.W 1 ; (WT0) lower 16 bits of SONCIC timer
CtlRegPad
Timer1 DS.W 1 ; (WT1) upper 16 "
CtlRegPad
Recv_SeqCnt DS.W 1 ; (RSC) receive sequence counter
CtlRegPad
CRC_Err DS.W 1 ; (CRCT) CRC error count
CtlRegPad
FAE_Err DS.W 1 ; (FAET) frame alignment error count
CtlRegPad
MissedPkt_Err DS.W 1 ; (MPT) missed packet error count
CtlRegPad
MDT DS.W 1 ; (MDT) max. deferral timer
CtlRegPad
RTC DS.W 1 ; (RTC) receive test control
CtlRegPad
TTC DS.W 1 ; (TTC) transmit test control
CtlRegPad
DTC DS.W 1 ; (DTC) DMA test control
CtlRegPad
CC0 DS.W 1 ; (CC0) CAM comparison 0
CtlRegPad
CC1 DS.W 1 ; (CC1) CAM comparison 1
CtlRegPad
CC2 DS.W 1 ; (CC2) CAM comparison 2
CtlRegPad
CM DS.W 1 ; (CM) CAM match
CtlRegPad
res1 DS.W 2 ; reserved by National Semiconductor
CtlRegPad
RBC DS.W 1 ; (RBC) receiver byte count
CtlRegPad
res2 DS.W 1 ; reserved by National Semiconductor
CtlRegPad
TBO DS.W 1 ; (TBO) transmit backoff counter
CtlRegPad
TRC DS.W 1 ; (TRC) transmit random counter
CtlRegPad
TBM DS.W 1 ; (TBM) transmit backoff mask
CtlRegPad
res3 DS.W 1 ; reserved by National Semiconductor
CtlRegPad
Data_Config2 DS.W 1 ; extended data configiguration
ENDIF
ENDR
;¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥ Content Addressable Memory (CAM) Descriptor Area CDA
CAMDesc RECORD 0
IF SONIC32 THEN
Entry_ptr DS.L 1 ; base zero index to CAM cell
Port2 DS.L 1 ; lower 16 bits in cell
Port1 DS.L 1 ; middle 16 bits in cell
Port0 DS.L 1 ; upper 16 bits in cell
enable DS.L 1 ; CAM cell enable mask
ELSE
Entry_ptr DS.W 1 ; base zero index to CAM cell
Port2 DS.W 1 ; lower 16 bits in cell
Port1 DS.W 1 ; middle 16 bits in cell
Port0 DS.W 1 ; upper 16 bits in cell
enable DS.W 1 ; CAM cell enable mask
ENDIF
CAMDescSz EQU *
ENDR
;¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥ Receive Resource Descriptor Area RRA
RRArec RECORD 0
IF SONIC32 THEN
buff_ptr0 DS.L 1 ; lower 16 bits of RBA address
buff_ptr1 DS.L 1 ; upper 16 bits of RBA address
buff_wc0 DS.L 1 ; lower 16 bits of RBA word count
buff_wc1 DS.L 1 ; upper 16 bits of RBA word count
ELSE
buff_ptr0 DS.W 1 ; lower 16 bits of RBA address
buff_ptr1 DS.W 1 ; upper 16 bits of RBA address
buff_wc0 DS.W 1 ; lower 16 bits of RBA word count
buff_wc1 DS.W 1 ; upper 16 bits of RBA word count
ENDIF
RRArecSz EQU *
ENDR
;¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥ Receive Descriptor Area RDA
Rxpkt RECORD 0
; this link is used to keep rx descriptors on our own list(s) when SONIC is not using them
nextRD DS.L 1 ; internal ptr to next descriptor
isFree DS.B 1 ; = true if desc has been freed
ORG nextRD
IF SONIC32 THEN
status DS.L 1 ; receive status
byte_count DS.L 1 ; size of packet read
pkt_ptr0 DS.L 1 ; lower 16 bits of packet addr. in RBA
pkt_ptr1 DS.L 1 ; upper 16 bits of packet addr. in RBA
seq_no DS.L 1 ; sequence number
link DS.L 1 ; link to other RD
in_use DS.L 1 ; use flag
ELSE
status DS.W 1 ; receive status
byte_count DS.W 1 ; size of packet read
pkt_ptr0 DS.W 1 ; lower 16 bits of packet addr. in RBA
pkt_ptr1 DS.W 1 ; upper 16 bits of packet addr. in RBA
seq_no DS.W 1 ; sequence number
link DS.W 1 ; link to other RD
in_use DS.W 1 ; use flag
ENDIF
RxRDAsize EQU *
ENDR
;¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥ Transmit Descriptor Area TDA
Max_Tx_Frags EQU 16 ; maximum fragments supported for a transmit
Txpkt RECORD 0 ; Transmit Descriptor
; this link is used to keep tx descriptors on our own list when SONIC is not using them
nextTD DS.L 1 ; internal ptr to next descriptor
ORG nextTD
IF SONIC32 THEN
status DS.L 1 ; status info written by SONIC
config DS.L 1 ; pre-transmit config data
pkt_size DS.L 1 ; size of packet
frag_count DS.L 1 ; fragment count
frag_start EQU * ; start of individual fragments
; the following 3 fields are repeated 1..frag_count
frag_ptr0 DS.L 1 ; lower 16 bits of address
frag_ptr1 DS.L 1 ; upper "
frag_size DS.L 1 ; fragment size
frag_esize EQU * - frag_start ; size of individual fragments
ORG * + (Max_Tx_Frags-1) * frag_esize
; allocate rest of fragments
link DS.L 1 ; lower 16 bits of next TD (if any)
ELSE
status DS.W 1 ; status info written by SONIC
config DS.W 1 ; pre-transmit config data
pkt_size DS.W 1 ; size of packet
frag_count DS.W 1 ; fragment count
frag_start EQU * ; start of individual fragments
; the following 3 fields are repeated 1..frag_count
frag_ptr0 DS.W 1 ; lower 16 bits of address
frag_ptr1 DS.W 1 ; upper "
frag_size DS.W 1 ; fragment size
frag_esize EQU * - frag_start ; size of individual fragments
ORG * + (Max_Tx_Frags-1) * frag_esize
; allocate rest of fragments
link DS.W 1 ; lower 16 bits of next TD (if any)
ENDIF
TxTDAsize EQU * ; size of a single frame TD
ENDR
;¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥ Initialization Parameters
SONICinitParms RECORD 0
SONICbase DS.L 1 ; base address of SONIC registers
IntInstall DS.L 1 ; addr of proc that installs interrupt handler
RECVRtn DS.L 1 ; address of receive routine
RECVPrms DS.L 1 ; parms to pass @ receive
TRANRtn DS.L 1 ; address of xmit complete routine
TRANPrms DS.L 1 ; parms to pass @ xmit complete
MemStart DS.L 1 ; address of memory usage area
MemSize DS.L 1 ; size of memory usage area
NumRxBuffs DS.L 1 ; proposed # of receive buffers
IntDisable DS.L 1 ; proc to disable interrupts
IntEnable DS.L 1 ; proc to reenable interrupts
NetStatArray DS.L 1 ; ptr to network statistics array
DataConfig DS.L 1 ; data configuration value
TransAddr DS.L 1 ; ->proc to translate logical->physical address
ParmSize EQU *
ENDR
;¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥ CAM Parameters
CAMparms RECORD 0
SONICPtr DS.L 1 ; SONIC base address <Z4>
EAddr DS.B 6 ; Ethernet address
LoadorClear DS.L 1 ; ­ 0 if adding CAM entry
ParmSize EQU *
ENDR
;¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥ (CR) Command Register Bits
LoadCAM EQU 9 ; load content addressable memory
ReadRRA EQU 8 ; read next read resource descriptor
SoftReset EQU 7 ; do a software reset
StartTimer EQU 5 ; start watchdog timer
StopTimer EQU 4 ; stop "
RxEnable EQU 3 ; receive packets
RxDisable EQU 2 ; stop receiving packets
TxEnable EQU 1 ; transmit packets
TxDisable EQU 0 ; stop transmitting packets
;¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥ (RCR) Receive Control/Status Register Bits
RecvErrors EQU 15 ; accept/reject packets with errors
RecvRunts EQU 14 ; accept/reject runt packets
RecvBroadCast EQU 13 ; accept/reject broadcasts
RecvAll EQU 12 ; turn on/off promiscuious mode
RecvMultiCast EQU 11 ; accept/reject multicasts
NoLoopBack EQU $0000 ; mask for no loopback
MACLoopBack EQU $0200 ; mask for MAC loopback
ENDECLoopBack EQU $0400 ; mask for ENDEC loopback
TxRxLoopBack EQU $0600 ; mask for Transceiver loopback
MultiRecd EQU 8 ; set when multicast is received
BroadRecd EQU 7 ; set when broadcast is received
RBAEmpty EQU 6 ; set when out of buffers in RBA
CarrierSense EQU 5 ; set when net busy and CRS is active
CollisionSense EQU 4 ; set when collision occurs if COL active
CRCErr EQU 3 ; set if packet has CRC error
FramAlignErr EQU 2 ; set if frame not aligned
LoopBackRecd EQU 1 ; set when loopback is received
ReceivedOK EQU 0 ; set upon successful packet reception
;¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥ (TCR) Transmit Control/Status Register Bits
TxProgInt EQU 15 ; generate a software interrupt
OWCTimer EQU 14 ; "out of window collision" timer control
CRCInhibit EQU 13 ; turn on/off FCS field
ExDeferTimer EQU 12 ; turn on/off excessive defer timer
ExcessDefer EQU 10 ; excessive deferrals detected
DeferredTx EQU 9 ; set when packet is being deferred
NoCRS EQU 8 ; CRS not present during transmission
CRSLost EQU 7 ; bad CRS during transmission
ExcessColl EQU 6 ; > 16 collisions detected
OutWindow EQU 5 ; "out of window" collision detected
PktMonitorBad EQU 3 ; packet monitored as bad
FIFOUnderRun EQU 2 ; Tx FIFO underrun
BCMismatch EQU 1 ; TxPkt_size ­ sum(TxFrag_size)
TransmitOK EQU 0 ; packet transmitted successfuly
;¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥ (DCR) Data Configuration Register Bits
EXBUS EQU 15 ; extended bus mode
LatchBusRetry EQU 13 ; LBR
DConfig_Usr1 EQU 12 ; sets/resets pin USR1
DConfig_Usr0 EQU 11 ; sets/resets pin USR0
SynchTerm EQU 10 ; select sync/async input to DMA
WaitCtl0 EQU $0000 ; 0 bus cycles added to DMA
WaitCtl1 EQU $0040 ; 1 bus cycle added to DMA
WaitCtl2 EQU $0080 ; 2 bus cycles added to DMA
WaitCtl3 EQU $00C0 ; 3 bus cycles added to DMA
DataWidth EQU 5 ; 16/32 bit path width for DMA
BlockMode EQU 4 ; DMA block mode selection
RFT2 EQU $0000 ; 2 word recv FIFO threshold
RFT4 EQU $0004 ; 4 word recv FIFO threshold
RFT8 EQU $0008 ; 8 word recv FIFO threshold
RFT12 EQU $000C ; 12 word recv FIFO threshold
TFT4 EQU $0000 ; 4 word trans FIFO threshold
TFT8 EQU $0001 ; 8 word trans FIFO threshold
TFT12 EQU $0002 ; 12 word trans FIFO threshold
TFT14 EQU $0003 ; 14 word trans FIFO threshold
;¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥ (DCR2) Extended Data Configuration Register Bits
EXUSR3 EQU 15 ; extended user bits
EXUSR2 EQU 14
EXUSR1 EQU 13
EXUSR0 EQU 12
;¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥ (ISR) Interrupt Status Register Bits
BusRetry EQU 14 ; set when bus needed retry
LostHeartBeat EQU 13 ; set when heartbeat is lost
DoneLoadCAM EQU 12 ; set when load CAM operation is done
GetProgInt EQU 11 ; set when programmable int. occurs
RecdPkt EQU 10 ; set when a packet has been recd.
TransDone EQU 9 ; set when trans is finished
TransError EQU 8 ; set when trans finished with an error
TimerElapsed EQU 7 ; set when timer reaches zero
EmptyRDA EQU 6 ; set when receive descriptors exhausted
EmptyRRA EQU 5 ; set when receive resources exhausted
RBAOverFLow EQU 4 ; set when buffer area is full
CRCRollover EQU 3 ; set when CRC tally has reached $FFFF
FAERollover EQU 2 ; set when FAE tally has reached $FFFF
MPRollover EQU 1 ; set when MP tally has reached $FFFF
RxFIFORollover EQU 0 ; set when Rx FIFO overflows
OurIntsMask EQU (1 << BusRetry) + \
(1 << RecdPkt) + \
(1 << TransDone) + \
(1 << TimerElapsed) + \
(1 << RxFIFORollover) + \
(1 << RBAOverFlow) + \
(1 << EmptyRRA)
;¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥ Network Statistics
NetStats RECORD 0 ; network management stats.
TxOK DS.L 1 ; frames transmitted OK
sCollFrame DS.L 1 ; single collision frames
mCollFrame DS.L 1 ; multiple collision frames
CollFrame DS.L 1 ; collision frames
DefTx DS.L 1 ; deferred transmissions
LateColl DS.L 1 ; late collisions
ExcessColl DS.L 1 ; excessive collisions
ExcessDef DS.L 1 ; excessive defferals
InMACTxErr DS.L 1 ; internal MAC transmit errors
RxOK DS.L 1 ; frames received OK
MultiRxOK DS.L 1 ; multicast frames recd OK
BroadRxOK DS.L 1 ; broadcast frames recd OK
FCSerr DS.L 1 ; frame check sequence errors
FAerr DS.L 1 ; frame alignment errors
MPerr DS.L 1 ; missed packet errors
Size EQU *
ENDR
;¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥ General Equates
TalliesPerSec EQU 5000000 ; number of timer ticks/second
TxMaxRetries EQU 4 ; max attempts to retry aborted xmits
Max_Tx_Packets EQU 16 ; maximum # of chained Tx packets
Min_Pkt_Size EQU 60 ; minimum packet size
Min_Rx_Buffs EQU 2 ; minimum # of recv descriptors/buffers
Max_Pkt_Size EQU 1518 ; maximum packet size (inc. CRC)
EOL_Bit EQU 0 ; end-of-link bit
Ctl_Mem_Size EQU Txpkt.TxTDAsize*Max_Tx_Packets+ \; up to Max_Tx_Packets chained transmits
RRArec.RRArecSz+ \; 1 RRA descriptor
CAMDesc.CAMDescSz ; 1 CAM descriptor
Min_Mem_Size EQU Ctl_Mem_Size+ \
Max_Pkt_Size*Min_Rx_Buffs+ \; max. size packets
Rxpkt.RxRDAsize*Min_Rx_Buffs; recv. descriptors

View File

@ -0,0 +1,38 @@
;
; File: VersionEclipse.a
;
; Contains: Version information for Eclipse
;
; Written by: Mike Quinn
;
; Copyright: © 1991-1992 by Apple Computer, Inc., all rights reserved.
;
; This file is used in these builds: Mac32
;
; Change History (most recent first):
;
; <SM2> 2/2/92 CSS Rollin Horror stuff:
; <H6> 10/17/92 BG Changed version to final release version.
; <1> 10/6/92 GDW New location for ROMLink tool.
; <SM2> 6/22/92 mal Updated to 1.0.4d3.
; <1> 6/12/92 RLM first checked in
; <P3> 5/13/92 KW (JC,H4) Change driver to support configuration information
; obtained from ecfg resource rather than from using boxflag
; driven tables.
; <P2> 02/07/92 jmp (jmp,H3/BG,6) Updated version numbers for Zydeco.
; <1> 2/4/92 mal first checked in
; ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
; Pre-Pandora ROM comments begin here.
; ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
; <5> 10/22/91 BG/SAM Changed release version number.
; <4> 5/22/91 BG Updated version to reflect ROM beta.
; <3> 4/21/91 CCH Rolled in Sean Findley's changes.
; <2> 3/14/91 BG (actually sf) Updated driver version information.
; <1> 2/11/91 mjq first checked in
;
PRINT PUSH, GEN, NOMDIR
VERSION 'Quadra Ethernet Driver', 1, 0, 4, final, 1, '1990-1992', '', SonicEnet
PRINT POP

View File

@ -0,0 +1,247 @@
/*
File: ATIDeclGamma.r
Contains: xxx put contents here xxx
Written by: xxx put writers here xxx
Copyright: © 1993 by Apple Computer, Inc., all rights reserved.
Change History (most recent first):
<1> 11/5/93 fau first checked in
<1> 10/27/93 fau first checked in
<1> 10/19/93 fau first checked in
*/
//--------------------------------------------------------------------------
//start
//
//Name: ATIDeclGamma.r
//Creator: George D. Wilson Jr.
//Date: 5/19/92
//
//Purpose: Gamma table declarations
//
//Category: Gamma Tables
//File: ATIDeclGamma.r
//
//Detailed: This file contains gamma table definitions for standard
// Apple monitors.
//
//Note:
//
//History:
//
// Date Programmer Modification
// -------- ---------- -----------------------------------------
//
//stop
//------------------------------------------------------------------------*/
#include "ROMLink.r"
#include "Types.r"
//=====================================================================
// Gamma resource tables
//=====================================================================
#define ColorGammaID 2000
#define HiResGammaID 2001
#define GrayGammaID 2002
#define RubikGammaID 2003
resource 'gdir' (700, "_GammaDirHiRes") {{
128, l{"HiResGamma"};
}};
resource 'gdir' (710, "_GammaDir_16") {{
128, l{"HiResGamma"};
129, l{"ColorGamma"};
}};
resource 'node' (720, "ColorGamma") {{
blocksize{};
word {ColorGammaID}; // gamma res ID
cstring{"Page-White Gamma"};
align {2};
word {$0000}; // gVersion
word {$0000}; // gType
word {$0000}; // gFormulaSize
word {$0003}; // gChanCnt
word {$0100}; // gDataCnt
word {$0008}; // gChanWidth
longs{{
$00030609;$0C101012;$13151616;$181B1C1E; // red channel
$1F222326;$282B2C2F;$3234373A;$3C3F4041;
$42434445;$46474749;$4A4B4C4D;$4E4F5051;
$52535454;$56565758;$595A5B5C;$5D5E5F60;
$61626364;$65666768;$696A6B6C;$6D6E6F70;
$71727273;$74757677;$78797A7A;$7B7C7D7E;
$7F818283;$83848586;$8788898A;$8A8B8C8D;
$8E8F9091;$92939394;$95969798;$98999A9B;
$9C9D9E9F;$A0A1A1A2;$A3A4A4A5;$A6A7A8A8;
$A9AAABAC;$ADADAEAF;$B0B1B2B2;$B3B4B5B5;
$B6B7B8B8;$B9BABBBC;$BCBDBEBF;$C0C0C1C2;
$C3C3C4C5;$C6C6C7C8;$C9C9CACB;$CCCDCDCE;
$CFD0D1D1;$D2D3D4D4;$D5D6D7D7;$D8D9DADA;
$DBDCDDDE;$DEDFE0E1;$E1E2E3E4;$E4E5E6E7;
$E7E8E9EA;$EAEBECED;$EEEEEFF0;$F1F1F2F3;
$F4F4F5F6;$F7F8F8F9;$FAFBFBFC;$FDFEFFFF;
}};
longs{{
$00030609;$0C101018;$20202223;$24252728; // green channel
$292C2D2E;$30323437;$383A3D3F;$40414242;
$43444445;$46474849;$4A4A4B4C;$4D4E4F50;
$51525354;$55565758;$595B5C5D;$5E5F6061;
$62636465;$65666768;$696A6B6C;$6D6E6F70;
$71717273;$74747576;$77787979;$7A7B7C7D;
$7E7F8081;$82838484;$85868788;$88898A8B;
$8C8D8E8E;$8F909192;$93939495;$96969798;
$999A9A9B;$9C9D9E9E;$9FA0A1A2;$A2A3A4A5;
$A5A6A7A8;$A8A9AAAB;$ABACADAE;$AFAFB0B1;
$B2B2B3B4;$B5B5B6B7;$B7B8B9BA;$BABBBCBD;
$BDBEBFC0;$C1C1C2C3;$C3C4C5C6;$C6C7C8C9;
$C9CACBCC;$CCCDCECF;$CFD0D1D2;$D2D3D4D4;
$D5D6D6D7;$D8D9D9DA;$DBDCDCDD;$DEDEDFE0;
$E1E1E2E3;$E4E4E5E6;$E6E7E8E9;$E9EAEBEC;
$ECEDEEEF;$EFF0F1F2;$F2F3F4F4;$F5F6F7F7;
}};
longs{{
$00020508;$0A0D1010;$10202022;$23232425; // blue channel
$25272829;$2A2C2D2E;$2F303233;$34363738;
$3A3C3D3F;$40414142;$42434444;$45454647;
$4748494A;$4A4B4C4D;$4D4E4F4F;$51515253;
$54555656;$5758595A;$5B5C5D5E;$5F606061;
$62626364;$64656666;$67686969;$6A6B6C6C;
$6D6E6F6F;$70717272;$73747475;$76777778;
$79797A7B;$7C7C7D7E;$7F808182;$82838484;
$85868687;$8888898A;$8A8B8C8D;$8D8E8F90;
$90919192;$93939495;$95969797;$9899999A;
$9B9B9C9D;$9D9E9FA0;$A0A1A1A2;$A3A3A4A4;
$A5A6A6A7;$A7A8A9A9;$AAABABAC;$ADADAEAF;
$AFB0B0B1;$B2B2B3B3;$B4B5B5B6;$B6B7B8B8;
$B9BABABB;$BBBCBDBD;$BEBFBFC0;$C0C1C2C2;
$C3C3C4C5;$C5C6C6C7;$C8C8C9C9;$CACBCBCC;
$CCCDCECE;$CFD0D0D1;$D1D2D3D3;$D4D4D5D6;
}};
}};
resource 'node' (730, "HiResGamma") {{
blocksize{};
word {HiResGammaID}; // gamma res ID
cstring{"Mac Std Gamma"};
align {2};
word{$0000}; // gVersion
word{$0000}; // gType
word{$0000}; // gFormulaSize
word{$0001}; // gChanCnt
word{$0100}; // gDataCnt
word{$0008}; // gChanWidth
longs{{
$0005090B;$0E101315;$17191B1D;$1E202224;
$2527282A;$2C2D2F30;$31333436;$37383A3B;
$3C3E3F40;$42434445;$4748494A;$4B4D4E4F;
$50515254;$55565758;$595A5B5C;$5E5F6061;
$62636465;$66676869;$6A6B6C6D;$6E6F7071;
$72737475;$76777879;$7A7B7C7D;$7E7F8081;
$81828384;$85868788;$898A8B8C;$8C8D8E8F;
$90919293;$94959596;$9798999A;$9B9B9C9D;
$9E9FA0A1;$A1A2A3A4;$A5A6A6A7;$A8A9AAAB;
$ABACADAE;$AFB0B0B1;$B2B3B4B4;$B5B6B7B8;
$B8B9BABB;$BCBCBDBE;$BFC0C0C1;$C2C3C3C4;
$C5C6C7C7;$C8C9CACA;$CBCCCDCD;$CECFD0D0;
$D1D2D3D3;$D4D5D6D6;$D7D8D9D9;$DADBDCDC;
$DDDEDFDF;$E0E1E1E2;$E3E4E4E5;$E6E7E7E8;
$E9E9EAEB;$ECECEDEE;$EEEFF0F1;$F1F2F3F3;
$F4F5F5F6;$F7F8F8F9;$FAFAFBFC;$FCFDFEFF;
}};
}};
resource 'node' (740, "GrayGamma") {{
blocksize{};
word {GrayGammaID}; // gamma res ID
cstring{"Mac Gray Gamma"};
align {2};
word{$0000}; // gVersion
word{$0000}; // gType
word{$0000}; // gFormulaSize
word{$0001}; // gChanCnt
word{$0100}; // gDataCnt
word{$0008}; // gChanWidth
longs{{
$000A141D;$23262B2E;$30323437;$393B3C3E;
$40414244;$4547484A;$4B4D4E4F;$50515254;
$55565758;$5A5B5C5D;$5E5F6061;$63646566;
$6768696A;$6B6C6D6E;$6F707171;$72737475;
$76777879;$7A7B7C7D;$7E7F8080;$81828384;
$84858687;$88898A8A;$8B8C8D8E;$8F909091;
$92929394;$95969797;$98999A9A;$9B9C9D9E;
$9E9FA0A1;$A1A2A3A3;$A4A5A6A7;$A7A8A9AA;
$AAABACAD;$ADAEAFAF;$B0B1B2B2;$B3B4B4B5;
$B6B6B7B7;$B8B9B9BA;$BBBCBCBD;$BEBEBFC0;
$C0C1C2C2;$C3C4C5C5;$C6C6C7C8;$C8C9CACB;
$CCCDCDCE;$CFCFD0D0;$D1D2D2D3;$D3D4D5D6;
$D6D7D7D8;$D9D9DADA;$DBDCDDDD;$DEDFDFE0;
$E0E1E2E3;$E3E4E5E5;$E6E6E7E7;$E8E8E9EA;
$EAEBEBEC;$EDEDEEEF;$F0F0F1F2;$F2F3F4F4;
$F5F5F6F7;$F7F8F9FA;$FAFBFCFC;$FDFEFEFF;
}};
}};
resource 'node' (750, "RubikGamma") {{
blocksize{};
word {RubikGammaID}; // gamma res ID
cstring{"Mac RGB Gamma"};
align {2};
word{$0000}; // gVersion
word{$0000}; // gType
word{$0000}; // gFormulaSize
word{$0001}; // gChanCnt
word{$0100}; // gDataCnt
word{$0008}; // gChanWidth
longs{{
$05070809;$0B0C0D0F;$10111214;$15161819;
$1A1C1D1E;$20212223;$24262829;$2A2C2D2F;
$30313334;$36373839;$3A3C3D3E;$40414243;
$44454648;$494B4C4D;$4E4F5051;$52535455;
$5758595A;$5B5C5D5E;$5F606163;$63656567;
$67696A6B;$6C6D6E6F;$70717273;$74757677;
$78797A7A;$7B7C7D7E;$7F818283;$83848586;
$8788898A;$8B8C8D8E;$8E909091;$92939394;
$95969798;$999A9B9C;$9D9E9FA0;$A0A1A2A3;
$A4A4A5A6;$A7A8A9AA;$AAACADAD;$AEAEB0B1;
$B2B3B3B4;$B5B6B7B8;$B9B9BABB;$BCBDBEBF;
$BFC0C1C2;$C2C3C4C5;$C6C7C8C9;$CACBCCCD;
$CDCECECF;$D0D1D2D3;$D3D4D5D6;$D6D7D8D8;
$D9DADBDC;$DDDEDEDF;$E0E1E1E2;$E3E4E4E5;
$E6E7E7E8;$E9EAEBEC;$EDEEEEEF;$EFF0F1F2;
$F3F3F4F5;$F6F7F8F8;$F9F9FAFB;$FCFDFEFF;
}};
}};

View File

@ -0,0 +1,168 @@
/*
File: ATIDeclMonitors.r
Contains: xxx put contents here xxx
Written by: xxx put writers here xxx
Copyright: © 1993 by Apple Computer, Inc., all rights reserved.
Change History (most recent first):
<1> 11/5/93 fau first checked in
<1> 10/27/93 fau first checked in
<1> 10/19/93 fau first checked in
*/
//--------------------------------------------------------------------------
//start
//
//Name: ATIDeclMonitors.r
//Creator: George D. Wilson Jr.
//Date: 9/19/92
//
//Purpose: Defintions for ATI monitors declaration ROM
//
//Category: Gamma Tables
//File: ATIDeclMonitors.r
//
//Detailed: This file contains definitions for video modes for the ATI
// VRAM PCI card.
//
//Note:
//
//History:
//
// Date Programmer Modification
// -------- ---------- -----------------------------------------
//
//stop
//------------------------------------------------------------------------*/
#include "ROMLink.r"
#include "Types.r"
#include "InternalOnlyEqu.r" //skanky stuff
#include "ATIDefROM.r"
//=====================================================================
// _VideoType
//=====================================================================
resource 'styp' (520, "_VideoType") {
catDisplay, //Video sResource : <Category>
typVideo, // <Type>
drSwApple, // <DrvrSw>
drHwATI // <DrvrHw>
};
//=====================================================================
// _VideoName
//=====================================================================
resource 'cstr' (530, "_VideoName") {
"Display_Video_Apple_ATI"
};
//=====================================================================
// Driver directory
//=====================================================================
resource 'ddir' (530, "_VidDrvrDir") {{
sMacOS68020, l{"_sATIDrvrDir"}; //References the Macintosh-OS 68020 driver.
}};
resource 'node' (535, "_sATIDrvrDir") {{
blocksize{};
include{match{{file{$$Shell("RsrcDir")"DeclDataVideo.rsrc"};
type{'decl'};
id{112};}}};
}};
//=====================================================================
// _sRsrc_VideoHR_ATI for Hi-Res monitor
//=====================================================================
resource 'srsc' (500, "_sRsrc_VideoHR_ATI") {{
sRsrcType, l{"_VideoType"}; //References the sResource Type.
sRsrcName, l{"_VideoName"}; //References the sResource Name.
sRsrcDrvrDir, l{"_VidDrvrDir"}; //References the driver directory.
sRsrcFlags, d{6};
sRsrcHWDevId, d{1}; //The hardware device Id.
minorBaseOS, long{defMinorBase}; //References the Minor Base Offset.
minorLength, long{defMinorLength}; //References the Minor Base Length.
sGammaDir, a{"_GammaDir_HR"}; //References the Gamma resource for 13"
oneBitMode, l{"_EightBitModeHR1024"}; //References the first mode parameters.
}};
//=====================================================================
// _sRsrc_VideoHR_Diamond for Hi-Res monitor for Diamond
//=====================================================================
resource 'srsc' (505, "_sRsrc_VideoHR_Diamond") {{
sRsrcType, l{"_VideoType"}; //References the sResource Type.
sRsrcName, l{"_VideoName"}; //References the sResource Name.
sRsrcDrvrDir, l{"_VidDrvrDir"}; //References the driver directory.
sRsrcFlags, d{6};
sRsrcHWDevId, d{1}; //The hardware device Id.
minorBaseOS, long{defMinorBase}; //References the Minor Base Offset.
minorLength, long{defMinorLength}; //References the Minor Base Length.
sGammaDir, a{"_GammaDir_HR"}; //References the Gamma resource for 13"
oneBitMode, l{"_EightBitModeHR640"}; //References the first mode parameters.
}};
//=====================================================================
//=====================================================================
// Hi-Res vidParms records
//=====================================================================
//=====================================================================
//=====================================================================
// Eight-Bit per pixel parameter list for Hi-Res
//=====================================================================
resource 'vmod' (550, "_EightBitModeHR1024") {{
mVidParams, l{"_EightVidParamsHR1024"}; //References the eight-bit mode parameter record.
mPageCnt, d{1}; //The page count.
mDevType, d{clutType}; //The device type.
}};
resource 'vdev' (550, "_EightVidParamsHR1024") {
eightmBaseOffset,
1024, //RowBytes
{eightmBounds_THR,eightmBounds_LHR,eightmBounds_BHR,eightmBounds_RHR},
eightVersion, //bmVersion
0, //packType not used
0, //packSize not used
eightmHRes, //bmHRes
eightmVRes, //bmVRes
eightPixelType, //bmPixelType
eightPixelSize, //bmPixelSize
eightCmpCount, //bmCmpCount
eightCmpSize, //bmCmpSize
eightmPlaneBytes //bmPlaneBytes
};
resource 'vmod' (555, "_EightBitModeHR640") {{
mVidParams, l{"_EightVidParamsHR640"}; //References the eight-bit mode parameter record.
mPageCnt, d{1}; //The page count.
mDevType, d{clutType}; //The device type.
}};
resource 'vdev' (555, "_EightVidParamsHR640") {
eightmBaseOffset,
640, //RowBytes
{eightmBounds_THR,eightmBounds_LHR,eightmBounds_BHR,eightmBounds_RHR},
eightVersion, //bmVersion
0, //packType not used
0, //packSize not used
eightmHRes, //bmHRes
eightmVRes, //bmVRes
eightPixelType, //bmPixelType
eightPixelSize, //bmPixelSize
eightCmpCount, //bmCmpCount
eightCmpSize, //bmCmpSize
eightmPlaneBytes //bmPlaneBytes
};

View File

@ -0,0 +1,133 @@
/*
File: ATIVideoROM.r
Contains: xxx put contents here xxx
Written by: xxx put writers here xxx
Copyright: © 1993 by Apple Computer, Inc., all rights reserved.
Change History (most recent first):
<1> 11/5/93 fau first checked in
<1> 10/27/93 fau first checked in
<1> 10/19/93 fau first checked in
*/
//--------------------------------------------------------------------------
//start
//
//Name: ATIVideoROM.r
//Creator: George D. Wilson Jr.
//Date: 9/19/92
//
//Purpose: Declaration ROM for ATI system
//
//Category: DeclROM
//File: ATIVideoROM.r
//
//Detailed: This file defines the declaration information for the ATI
// mother board. Currently this system defines only the video display
// portion of the system.
//
//Note:
//
//History:
//
// Date Programmer Modification
// -------- ---------- -----------------------------------------
// 10/13/93 George W. Cleaned up some not used resources.
//
//stop
//------------------------------------------------------------------------*/
#include "ROMLink.r"
#include "Types.r"
#include "InternalOnlyEqu.r" //skanky stuff
#include "DepVideoEqu.r"
#include "ATIDefROM.r" //Video driver equates
//
//=====================================================================
// BEGIN Declaration ROM
//=====================================================================
//*************************************************************
//Constants
//*************************************************************
#define TheBoardId $0575 //the Board Id (Special ATI Mother board)
//----------- sResource Directory //<Id OF>
#define sRsrc_Board 1 //Board sResource {May be any number in [0..127]}
#define sRsrc_Video 128 //Video sResource {May be any number in [128..254]}
//=====================================================================
// Directory
//=====================================================================
resource 'sdir' (270, "_sRsrcATIDir") {{
sRsrc_Board, l{"_sRsrc_BdATI"}; //References the board sResource.
sRsrc_VideoHR_ATI, a{"_sRsrc_VideoHR_ATI"}; //References the video sResource Hi-Res
sRsrc_VideoHR_Diamond, a{"_sRsrc_VideoHR_Diamond"}; //References the video sResource Hi-Res
}};
//=============================================================
// sRsrc_Board List - the Board sResource
//=============================================================
resource 'boar' (280, "_sRsrc_BdATI") {{
sRsrcType, l{"_BoardType"}; //References the sResource type
sRsrcName, c{"PCI Video"}; //Official product name
sRsrcIcon, a{"_VidICONCyclone"}; //A new icon
boardId, d{TheBoardId}; //The board Id.
primaryInit, l{"_sPInitRec"}; //References the Primary init record.
vendorInfo, l{"_VendorInfo"}; //References the OPTIONAL Vendor information list.
}};
//=============================================================
// _BoardType - Board type and category
//=============================================================
resource 'styp' (290, "_BoardType") {
catBoard, //<Category> CatBoard ALWAYS = $0001 for bd srsrc
typBoard, //<Type> TypBoard ALWAYS = $0000 for bd srsrc
0, //<DrvrSw> CatBoard ALWAYS = $0000 for bd srsrc
0 //<DrvrHw> CatBoard ALWAYS = $0000 for bd srsrc
};
//=====================================================================
// Primary Init Record
//=====================================================================
resource 'node' (418, "_sPInitRec") {{
blocksize{};
include{match{{file{$$Shell("RsrcDir")"DeclDataVideo.rsrc"};
type{'decl'};
id{110};}}};
}};
//=====================================================================
// Vendor Info record
//=====================================================================
resource 'vend' (420, "_VendorInfo") {{
vendorId, c{"Apple Computer, Inc."};
revLevel, c{"1.0D1x02"};
partNum, c{"0010"};
}};
//=====================================================================
// Format/Header Block
//=====================================================================
resource 'form' (128, "Root") {
l{"_sRsrcDir"},
1, // Should put "romRevision = 1" in ROMLink.r
appleFormat,
0,
$0F
};

View File

@ -0,0 +1,238 @@
/*
File: ATIDefROM.r
Contains: xxx put contents here xxx
Written by: xxx put writers here xxx
Copyright: © 1993 by Apple Computer, Inc., all rights reserved.
Change History (most recent first):
<1> 11/5/93 fau first checked in
<1> 10/27/93 fau first checked in
<1> 10/19/93 fau first checked in
*/
//--------------------------------------------------------------------------
//start
//
//Name: ATIDefROM.r
//Creator: George D. Wilson Jr.
//Date: 9/19/92
//
//Purpose: Defintions for ATI monitors declaration ROM.
//
//Category: Header File
//File: ATIDefROM.r
//
//Detailed: This file contains definitions for video modes for the Apple
// 13" and 16" monitors.
//
//Note:
//
//History:
//
// Date Programmer Modification
// -------- ---------- -----------------------------------------
//
//stop
//------------------------------------------------------------------------*/
#define clutType 0 // 0 if lookup table
#define fixedType 1 // 1 if fixed table
#define directType 2 // 2 if direct values
#define defPixelType 0 // pixeltype=chunky
#define ChunkyDirect 16 // pixelType=ChunkyDirect
#define defmDevType clutType // clutType = 0
#define sRsrc_VideoHR_ATI $80 // Video parameter sResource id
#define sRsrc_Video16 $81 // Video parameter sResource id
#define sRsrc_VideoHR_Diamond $90
//*************************************************************
//Constants
//*************************************************************
//
// Parameter definitions {For Primary init}
//
#define defScrnRow $0080 //Bytes per pixel line
#define defMinorBase 0 //Video RAM Offset is 0
#define defMinorLength $4B000 //Video RAM length is $40000
#define defBaseOffset $00000000 //Offset for ROM
//=============================================================================
// Parameter definitions One bit-per-pixel Hi-Res 13"
//=============================================================================
#define onemBaseOffset defBaseOffset //Offset to base of video RAM
#define onemRowBytesHR $0050 //Rowbytes
#define onemBounds_THR 0 //Bounds.Top
#define onemBounds_LHR 0 //Bounds.Left
#define onemBounds_BHR 480 //Bounds.Bottom
#define onemBounds_RHR 640 //Bounds.Right
#define oneVersion 0 //Version = 0
#define onemHRes $480000 //Horizontal Pixels/inch
#define onemVRes $480000 //Vertical pixels/inch
#define onePixelType clutType //0 = Chunky
#define onePixelSize 1 //Number of bits per pixel
#define oneCmpCount 1 //Number of components in pixel
#define oneCmpSize 1 //Number of bits per component
#define onemPlaneBytes 0 //Offset from one plane to the next.
#define onemPageCnt 1 //Total number of pages
#define onemVertRefRate 67 //Vert refresh rate
#define onemDevType 0 //0 = CLUTType
//=============================================================================
// Parameter definitions Two bit-per-pixel
//=============================================================================
#define twomBaseOffset defBaseOffset //Offset to base of video RAM
#define twomRowBytesHR $00A0 //Rowbytes
#define twomBounds_THR 0 //Bounds.Top
#define twomBounds_LHR 0 //Bounds.Left
#define twomBounds_BHR 480 //Bounds.Bottom
#define twomBounds_RHR 640 //Bounds.Right
#define twoVersion 0 //Version = 0
#define twomHRes $480000 //Horizontal Pixels/inch
#define twomVRes $480000 //Vertical pixels/inch
#define twoPixelType clutType //0 = Chunky
#define twoPixelSize 2 //Number of bits per pixel
#define twoCmpCount 1 //Number of components in pixel
#define twoCmpSize 2 //Number of bits per component
#define twomPlaneBytes 0 //Offset from one plane to the next.
#define twomPageCnt 1 //Total number of pages
#define twomVertRefRate 67 //Vert refresh rate
#define twomDevType 0 //0 = CLUTType
//=============================================================================
// Parameter definitions Four bit-per-pixel
//=============================================================================
#define fourmBaseOffset defBaseOffset //Offset to base of video RAM
#define fourmRowBytesHR $0140 //Rowbytes
#define fourmBounds_THR 0 //Bounds.Top
#define fourmBounds_LHR 0 //Bounds.Left
#define fourmBounds_BHR 480 //Bounds.Bottom
#define fourmBounds_RHR 640 //Bounds.Right
#define fourVersion 0 //Version = 0
#define fourmHRes $480000 //Horizontal Pixels/inch
#define fourmVRes $480000 //Vertical pixels/inch
#define fourPixelType clutType //0 = Chunky
#define fourPixelSize 4 //Number of bits per pixel
#define fourCmpCount 1 //Number of components in pixel
#define fourCmpSize 4 //Number of bits per component
#define fourmPlaneBytes 0 //Offset from one plane to the next.
#define fourmPageCnt 1 //Total number of pages
#define fourmVertRefRate 67 //Vert refresh rate
#define onemDevType 0 //0 = CLUTType
//=============================================================================
// Parameter definitions Eight bit-per-pixel
//=============================================================================
#define eightmBaseOffset defBaseOffset //Offset to base of video RAM
#define eightmRowBytesHR $0400 //Rowbytes
#define eightmBounds_THR 0 //Bounds.Top
#define eightmBounds_LHR 0 //Bounds.Left
#define eightmBounds_BHR 480 //Bounds.Bottom
#define eightmBounds_RHR 640 //Bounds.Right
#define eightVersion 0 //Version = 0
#define eightmHRes $480000 //Horizontal Pixels/inch
#define eightmVRes $480000 //Vertical pixels/inch
#define eightPixelType clutType //0 = Chunky
#define eightPixelSize 8 //Number of bits per pixel
#define eightCmpCount 1 //Number of components in pixel
#define eightCmpSize 8 //Number of bits per component
#define eightmPlaneBytes 0 //Offset from one plane to the next.
#define eightmPageCnt 1 //Total number of pages
#define eightmVertRefRate 67 //Vert refresh rate
#define onemDevType 0 //0 = CLUTType
//=============================================================================
// Parameter definitions Sixteen bit-per-pixel
//=============================================================================
#define sixteenmBaseOffset defBaseOffset //Offset to base of video RAM
#define sixteenmRowBytesHR $0500 //Rowbytes
#define sixteenmBounds_THR 0 //Bounds.Top
#define sixteenmBounds_LHR 0 //Bounds.Left
#define sixteenmBounds_BHR 480 //Bounds.Bottom
#define sixteenmBounds_RHR 640 //Bounds.Right
#define sixteenVersion 0 //Version = 0
#define sixteenmHRes $480000 //Horizontal Pixels/inch
#define sixteenmVRes $480000 //Vertical pixels/inch
#define sixteenPixelType $10 //0 = Chunky $10 = Direct
#define sixteenPixelSize 16 //Number of bits per in pixel
#define sixteenCmpCount 3 //Number of components in pixel
#define sixteenCmpSize 5 //Number of bits per component
#define sixteenmPlaneBytes 0 //Offset from one plane to the next.
#define sixteenmPageCnt 1 //Total number of pages
#define sixteenmVertRefRate 67 //Vert refresh rate
#define sixteenmDevType ChunkyDirect //0 = CLUTType
//=============================================================================
// Parameter definitions One bit-per-pixel
//=============================================================================
#define onemRowBytes16 104 //Rowbytes
#define onemBounds_T16 0 //Bounds.Top
#define onemBounds_L16 0 //Bounds.Left
#define onemBounds_B16 624 //Bounds.Bottom
#define onemBounds_R16 832 //Bounds.Right
//=============================================================================
// Parameter definitions Two bit-per-pixel
//=============================================================================
#define twomRowBytes16 208 //Rowbytes
#define twomBounds_T16 0 //Bounds.Top
#define twomBounds_L16 0 //Bounds.Left
#define twomBounds_B16 624 //Bounds.Bottom
#define twomBounds_R16 832 //Bounds.Right
//=============================================================================
// Parameter definitions Four bit-per-pixel
//=============================================================================
#define fourmRowBytes16 416 //Rowbytes
#define fourmBounds_T16 0 //Bounds.Top
#define fourmBounds_L16 0 //Bounds.Left
#define fourmBounds_B16 624 //Bounds.Bottom
#define fourmBounds_R16 832 //Bounds.Right
//=============================================================================
// Parameter definitions Eight bit-per-pixel
//=============================================================================
#define eightmRowBytes16 832 //Rowbytes
#define eightmBounds_T16 0 //Bounds.Top
#define eightmBounds_L16 0 //Bounds.Left
#define eightmBounds_B16 624 //Bounds.Bottom
#define eightmBounds_R16 832 //Bounds.Right
//=====================================================================
// Video parameter sRsrc resource IDs
//=====================================================================
#define sRsrcVidATIHR $80 // Hi-Res 1,2,4,8,16bpp
#define sRsrcVidATI16 $81 // 16" 1,2,4,8bpp
#define sRsrcVidATIFP $82 // 15" full page
#define sRsrcVidATI12 $83 // 12" monochrome?????
//=====================================================================
// Special defines for SuperMario Build
//=====================================================================
//#define sRsrcUnknownDir 1 // sRsrc Directory for unknown CPUs.
//#define sRsrcUnknownBd 1 // Unknown board sRsrc.
//#define sRsrcBFBasedDir $7F // CPUs supported (or thought about) in the Zydeco ROM.
//#define sRsrc_Vid_DAFB_HRa $C8 // HiRes 8,16,32
//#define sRsrc_Vid_DAFB_LPa $C6 // GoldFish 8,16,32
//#define BoardspIDShift 1 // board spID shift value
//#define sRsrc_BdSpike boxQuadra700+BoardspIDShift // (16+BoardspIDShift)

View File

@ -0,0 +1,464 @@
;
; File: ATIDrvr.a
;
; Contains: xxx put contents here xxx
;
; Written by: xxx put writers here xxx
;
; Copyright: © 1993 by Apple Computer, Inc., all rights reserved.
;
; Change History (most recent first):
;
; <1> 11/5/93 fau first checked in
; <1> 10/27/93 fau first checked in
; <1> 10/19/93 fau first checked in
;
;
;--------------------------------------------------------------------------
;start
;
;Name: ATIDrvr.a
;Creator: George D. Wilson Jr.
;Date: 4/24/92
;
;Purpose: Driver header for the ATI graphics driver.
;
;Category: Driver Header
;File: ATIDrvr.a
;
;Exports: Open - Driver open routine.
; Control - Driver control routine.
; Status - Driver status routine.
; Close - Driver close routine.
; intHandler - ATI VBL interrupt handler.
;
;Locals: done - Common driver exit routine.
;
;Detailed: This file is the assembly front end to the high level
; ATI driver routines. Most routines within this module
; simply setup a call to a high level routine of the same type.
; The only exception to this "Open". Open performs almost
; all the driver and variable initalization.
;
;Note:
;
;History:
;
; Date Programmer Modification
; -------- ---------- -----------------------------------------
;
;stop
;------------------------------------------------------------------------*/
;--------------------------------------------------------------------------
;
; Includes
;
;------------------------------------------------------------------------*/
include 'QuickDraw.a'
include 'Traps.a'
include 'SysEqu.a'
include 'ToolUtils.a'
include 'SysErr.a'
include 'ATIHdr.a'
;--------------------------------------------------------------------------
;
; Imported Variables
;
;------------------------------------------------------------------------*/
globals RECORD 0,INCREMENT
ALIGN 2
globalsSize EQU *-globals
ENDR
Enable EQU 1 ; Turn ATI interrupts on
true EQU 1 ; Boolean true
false EQU 0 ; Boolean false
;--------------------------------------------------------------------------
;
; Imported Procedures
;
;------------------------------------------------------------------------*/
IMPORT OpenDRVR ; High level 'C' open routine
IMPORT ControlDRVR ; High level 'C' control routine
IMPORT StatusDRVR ; High level 'C' status routine
IMPORT CloseDRVR ; High level 'C' close routine
IMPORT DrvrSlotIntHandlerNuBus ; High level 'C' interrupt handler
;--------------------------------------------------------------------------
;
; Local Equates
;
;------------------------------------------------------------------------*/
rSave reg d1-d7/a0-a6 ; Saved registers
;--------------------------------------------------------------------------
;
; Exported Procedures
;
;------------------------------------------------------------------------*/
;--------------------------------------------------------------------------
;
; Driver Headers
;
; *** WARNING: No code must be placed before these headers. ***
;
;------------------------------------------------------------------------*/
ATI MAIN EXPORT
IMPORT Open
IMPORT Close
IMPORT Control
IMPORT Status
ATIDrvr
dc.w $4C00 ; Flags: locked,bye,stat,ctl
dc.w 0 ; Periodic call interval
dc.w 0 ; Not an ornament
dc.w 0 ; No menu
dc.w Open-ATIDrvr ; Open routine offset
dc.w 0 ; Prime routine offset
dc.w Control-ATIDrvr ; Control routine offset
dc.w Status-ATIDrvr ; Status routine offset
dc.w Close-ATIDrvr ; Close routine offset
STRING PASCAL
_DCB_DriverNameATI ; Name of driver
ALIGN 2
_DCW_Version ; Version number of driver
ENDP
;--------------------------------------------------------------------------
;
; Beginning of Procedure Definitions
;
;------------------------------------------------------------------------*/
;--------------------------------------------------------------------------
;start
;
;Name: done
;Creator: George D. Wilson Jr.
;Date: 4/24/92
;
;Purpose: Common exit routine.
;
;Category: Driver Done Handler
;File: ATIDrvr.a
;
;Calls: none
;
;Called By: Open, Close, Status, Control
;
;Entry: A0 - Parameter block pointer.
; A1 - Driver DCE pointer.
;
;Alters: ioResult - In parameter block will be altered.
;
;Exit: D0 - Result code (also copied into parameter block)
;
;Algorithm: If the "noQueueBit" bit is set in the ioTrap field of the
; parameter block, the I/O call is immediate, and exit via
; an RTS instruction. Immediate calls don't go through IODone,
; since the parameter block isn't queued.
;
; If ioResult is less than or equal to zero, return via a
; jump to the Device Manager's IODone routine.
;
; If ioResult is greater than zero, indicating that the I/O
; call is not yet done, return is via an RTS instruction.
;
;History:
;
; Date Programmer Modification
; -------- ---------- ---------------------------------------
;
;stop
;------------------------------------------------------------------------*/
done PROC
bclr #drvrActive,dCtlFlags+1(a1) ; always clear busy bit
move.w ioResult(a0),d0 ; get ioResult
tst.w d0 ; is the call done?
bgt.s @byRts ; no - exit via RTS instr.
btst #noQueueBit-8,ioTrap(a0) ; is the call immediate?
bne.s @byRts ; br if so - exit via RTS instr.
move.l JIODone,-(sp) ; call is done; return to IODone
@byRts
; _Debugger ; MacsBug
rts ;
ENDP
;--------------------------------------------------------------------------
;start
;
;Name: IntHandlerNuBus
;Creator: George D. Wilson Jr.
;Date: 4/24/92
;
;Purpose: ATI interrupt handler.
;
;Category: Slot Interrupt Handler
;File: ATIDrvr.a
;
;Called By: Mac exception handler
;
;Alters:
;
;Detailed: This is the low level entry point for the interrupt generated
; by the cursor VBL.
;
; Currently this routine is called by the 'intMeister' interrupt
; system. It determines which ATI interrupt generated the
; exception and calls the appropriate routine registered.
;
;Note: Keep a eye on this routine if the hardware or the 'intMeister'
; change.
;
;History:
;
; Date Programmer Modification
; -------- ---------- ----------------------------------------
;
;stop
;------------------------------------------------------------------------*/
IntHandlerNuBus PROC EXPORT
; _Debugger
moveq #kOurSlotNum,d0
move.l JVBLTask,a0 ; Make the cursor move
jsr (a0)
moveq #1,d0
@noVBL rts
ENDP
;--------------------------------------------------------------------------
;start
;
;Name: Open
;Creator: George D. Wilson Jr.
;Date: 4/24/92
;
;Purpose: Performs low level driver open functions.
;
;Category: Driver Entry Point.
;File: ATIDrvr.c
;
;Calls: OpenDRVR, done
;
;Entry: a1 - Our driver DCE.
;
;Alters: dCtlStorage - Will be set to the global data storage
; for our driver if everything is OK.
;
; ioResult(a0) - The ioResult field of the parameter
; block will contain a driver error code
; or 'noErr' if everything went OK.
;
;Exit: d0 - Contains a driver error code or 'noErr'
; if everything went OK.
;
;Detailed: This routine leaves all the hard work to the high level routine.
; It expects the high level to indicate the success or failure by
; leaving a result code in D0.
;
;History:
;
; Date Programmer Modification
; -------- ---------- -----------------------------------------
;
;stop
;------------------------------------------------------------------------*/
Open PROC
WITH globals
movem.l rSave,-(sp) ; Save regs
move.l a1,-(sp) ; push DCE pointer
move.l a0,-(sp) ; push parm block pointrt
jsr OpenDRVR ; call C code
add #8,sp ; drop arguments
movem.l (sp)+,rSave ; Restore registers
move.w d0,ioResult(a0) ; Store the result code
bra done
ENDP
;--------------------------------------------------------------------------
;start
;
;Name: Close
;Creator: George D. Wilson Jr.
;Date: 4/24/92
;
;Purpose: Performs driver close function.
;
;Category: Driver Entry Point.
;File: ATIDrvr.c
;
;Calls: close, done
;
;Entry: a0 - Pointer to callers parameter block.
;
; a1 - Pointer to our driver DCE.
;
;Alters: ioResult(a0) - The result field of the parameter block
; is set to the value returned from the
; high level call. The high level routine
; leaves its result in D0.
;
;Exit: d0 - Has a driver error code left by the high level routine.
;
;Detailed: When a driver close call is made this routine passes the
; callers parameter block in A0 and the driver DCE in A1 and
; calls the high level routine. The high routine handles everything.
;
; The high level routine should return a driver error code in D0.
;
;History:
;
; Date Programmer Modification
; -------- ---------- -----------------------------------------
;
;stop
;------------------------------------------------------------------------*/
Close PROC
; _Debugger ; MacsBug
movem.l rSave,-(sp) ; Save regs
move.l a1,-(sp) ; push DCE pointer
move.l a0,-(sp) ; push parm block pointer
jsr CloseDRVR ; call C code
add #8,sp ; drop arguments
movem.l (sp)+,rSave ; Restore registers
move.w d0,ioResult(a0) ; Store the result code
bra done
ENDP
;--------------------------------------------------------------------------
;start
;
;Name: Status
;Creator: George D. Wilson Jr.
;Date: 4/24/92
;
;Purpose: Performs driver status functions.
;
;Category: Driver Entry Point.
;File: ATIDrvr.c
;
;Calls: status, done
;
;Entry: a0 - Pointer to callers parameter block.
;
; a1 - Pointer to our driver DCE.
;
;Alters: ioResult(a0) - The result field of the parameter block
; is set to the value returned from the
; high level call. The high level routine
; leaves its result in D0.
;
;Exit: d0 - Has a driver error code or 'noErr'.
;
;Detailed: This routine is simply an assembly language interface
; to the higher level status routine. It pushs a
; pointer to the callers parameter and then pushs
; a pointer to the driver DCE onto the stack.
;
; The high level routine should return a driver error
; code in D0.
;
;History:
;
; Date Programmer Modification
; -------- ---------- -----------------------------------------
;
;stop
;------------------------------------------------------------------------*/
Status PROC
movem.l rSave,-(sp) ; Save regs
move.l a1,-(sp) ; push DCE pointer
move.l a0,-(sp) ; push parm block pointer
jsr StatusDRVR ; call C code
add #8,sp ; drop arguments
movem.l (sp)+,rSave ; Restore registers
move.w d0,ioResult(a0) ; Store the result code
bra done
ENDP
;--------------------------------------------------------------------------
;start
;
;Name: Control
;Creator: George D. Wilson Jr.
;Date: 4/24/92
;
;Purpose: Performs driver control functions.
;
;Category: Driver Entry Point.
;File: ATIDrvr.c
;
;Calls: control, done
;
;Entry: a0 - Pointer to callers parameter block.
;
; a1 - Pointer to our driver DCE.
;
;Alters: ioResult(a0) - The result field of the parameter block
; is set to the value returned from the
; high level call. The high level routine
; leaves its result in D0.
;
;Exit: d0 - Has a driver error code or 'noErr'.
;
;Detailed: This routine is simply an assembly language interface
; to the higher level control routine. It pushs a
; pointer to the callers parameter and then pushs
; a pointer to the driver DCE onto the stack.
;
; The high level routine should return a driver error
; code in D0.
;
;History:
;
; Date Programmer Modification
; -------- ---------- -----------------------------------------
;
;stop
;------------------------------------------------------------------------*/
Control PROC
movem.l rSave,-(sp) ; Save regs
move.l a1,-(sp) ; push DCE pointer
move.l a0,-(sp) ; push parm block pointrt
jsr ControlDRVR ; call C code
add #8,sp ; drop arguments
movem.l (sp)+,rSave ; Restore registers
move.w d0,ioResult(a0) ; Store the result code
bra done
ENDP
END
;--------------------------------------------------------------------------
;
; End of Module
;
;------------------------------------------------------------------------*/

View File

@ -0,0 +1,610 @@
/*
File: ATIDrvr.c
Contains: xxx put contents here xxx
Written by: xxx put writers here xxx
Copyright: © 1993 by Apple Computer, Inc., all rights reserved.
Change History (most recent first):
<1> 11/5/93 fau first checked in
<1> 10/27/93 fau first checked in
<1> 10/19/93 fau first checked in
*/
/*-------------------------------------------------------------------------
*start
*
*Name: ATIDriver.c
*Creator: George D. Wilson Jr.
*Date: 8/15/93
*
*Purpose: Main interface file for ATI video driver.
*
*Category: Macintosh driver
*File: ATIDrvr.c
*
*Exports: OpenDRVR - Handles initialization of driver.
* CloseDRVR - Handles shutdown of driver.
* ControlDRVR - Handles driver control calls.
* StatusDRVR - Handles driver status calls.
* WaitForVBL - Returns when vertical blanking is active.
*
*Locals:
*
*Detailed:
*
*Note:
*
*History:
*
* Date Programmer Modification
* -------- ---------- -----------------------------------------
*
*stop
*-----------------------------------------------------------------------*/
/*-------------------------------------------------------------------------
*
* Includes
*
*-----------------------------------------------------------------------*/
#include <Types.h>
#include <Video.h>
#include <Devices.h>
#include <Errors.h>
#include <OSUtils.h>
#include <Slots.h>
#include <Memory.h>
#include <Retrace.h>
#include "ATIStdTypes.h"
#include "ATI.h"
#include "ATIDrvr.h"
#include "ATIVideo.h"
#include "NubEqu.h"
/*-------------------------------------------------------------------------
*
* Imported Procedures
*
*-----------------------------------------------------------------------*/
extern UInt16 GetRowBytes(UInt8 monitorID, UInt8 videoMode, UInt8 theSlot);
extern void IntHandlerNuBus();
/*-------------------------------------------------------------------------
*
* Exported Procedures
*
*-----------------------------------------------------------------------*/
UInt16 OpenDRVR (CntrlParam *pb, AuxDCEPtr dce);
UInt16 CloseDRVR (CntrlParam *pb, DCtlPtr dce);
UInt16 ControlDRVR (CntrlParam *pb, DCtlPtr dce);
UInt16 StatusDRVR (CntrlParam *pb, DCtlPtr dce);
/*-------------------------------------------------------------------------
*
* Beginning of Procedure Definitions
*
*-----------------------------------------------------------------------*/
/*-------------------------------------------------------------------------
*start
*
*Name: WaitForVBL
*Creator: George D. Wilson Jr.
*Date: 3/20/92
*
*Purpose:
*
*Category:
*File:
*
*Calls:
*
*Called By:
*
*Entry:
*
*Alters:
*
*Exit:
*
*Detailed:
*
*Algorithm:
*
*Note:
*
*History:
*
* Date Programmer Modification
* -------- ---------- -----------------------------------------
*
*stop
*-----------------------------------------------------------------------*/
void WaitForVBL()
{
short i=0;
i = i+1;
// DebugStr("\pWaitForVBL");
} /* End of WaitForVBL */
/*-------------------------------------------------------------------------
*start
*
*Name: InstallInterruptRoutine
*Creator: George D. Wilson Jr.
*Date: 3/20/92
*
*Purpose:
*
*Category:
*File:
*
*Calls:
*
*Called By:
*
*Entry:
*
*Alters:
*
*Exit:
*
*Detailed:
*
*Algorithm:
*
*Note:
*
*History:
*
* Date Programmer Modification
* -------- ---------- -----------------------------------------
*
*stop
*-----------------------------------------------------------------------*/
void InstallInterruptRoutine(DCtlPtr dce)
{
// OSErr err;
globalsPtr g;
// UInt32 intHi;
// DebugStr("\pInstallInterruptRoutine");
g = (globalsPtr) *(dce->dCtlStorage);
// RegisterNubInt(kVideoLineInt,(InterruptHdlr) IntHandlerNuBus,(long) dce);
g->gInterruptsEnabled = kVBLInterruptEnabled;
} /* End of InstallInterruptRoutine */
/*-------------------------------------------------------------------------
*start
*
*Name: RemoveInterruptRoutine
*Creator: George D. Wilson Jr.
*Date: 3/20/92
*
*Purpose:
*
*Category:
*File:
*
*Calls:
*
*Called By:
*
*Entry:
*
*Alters:
*
*Exit:
*
*Detailed:
*
*Algorithm:
*
*Note:
*
*History:
*
* Date Programmer Modification
* -------- ---------- -----------------------------------------
*
*stop
*-----------------------------------------------------------------------*/
void RemoveInterruptRoutine(DCtlPtr dce)
{
// OSErr err;
globalsPtr g;
// DebugStr("\pRemoveInterruptRoutine");
g = (globalsPtr) *(dce->dCtlStorage);
if ( g->gInterruptsEnabled ) {
WaitForVBL();
if ( *(long*)(kMySlot | kNMRQDisable) );
// RemoveNubInt(kVideoLineInt);
g->gInterruptsEnabled = kVBLInterruptDisabled;
}
}
/*-------------------------------------------------------------------------
*start
*
*Name: OpenDRVR
*Creator: George D. Wilson Jr.
*Date: 3/20/92
*
*Purpose:
*
*Category:
*File:
*
*Calls:
*
*Called By:
*
*Entry:
*
*Alters:
*
*Exit:
*
*Detailed:
*
*Algorithm:
*
*Note:
*
*History:
*
* Date Programmer Modification
* -------- ---------- -----------------------------------------
*
*stop
*-----------------------------------------------------------------------*/
UInt16 OpenDRVR (CntrlParam *pb, AuxDCEPtr dce)
{
#pragma unused(pb)
globalsPtr g;
Handle globs;
UInt16 i;
SpBlock spPb;
// OSErr err;
SPRAMRecord sPRAM;
UInt8 videoMode;
// DebugStr("\pOpenDRVR");
globs = nil;
ResrvMem(GLOBALSSIZE);
globs = NewHandleSysClear(GLOBALSSIZE);
if ( globs == nil ) return(openErr);
dce->dCtlStorage = globs;
HLock(globs);
g = (globalsPtr) *(globs);
//==========================================================================
// Zero all global data stuff
//==========================================================================
g->gGammaPtr = nil;
g->gCurrentPage = kOurVidPage;
g->gCurrentMode = kFirstVideoMode; // 8 bpp Fix this later ¥¥¥
g->gBaseAddr = (Ptr) (kATIVRAMAddr);
g->gFBBaseAddr = (Ptr) (kATIVRAMAddr);
g->gInterruptsEnabled = kVBLInterruptEnabled;
g->gMonoOnly = false; // Device supports color ¥¥¥
g->gLuminanceMode = false; // Current mode is color ¥¥¥
g->gDirectMode = false;
g->gNumLines = kNumLines480; // 13" is 480 ¥¥¥
g->gBigSlotNum = dce->dCtlSlot;
g->gSlotNum = dce->dCtlSlot;
videoMode = kFirstVideoMode;
spPb.spSlot = g->gSlotNum;
spPb.spResult = &sPRAM;
#if 0
err = SReadPRAMRec(&spPb);
if ( err == noErr ) { // Did we get our PRAM?
g->gMonitorID = sPRAM.vendorUse4; // No save the monitor ID
g->gCurrentMode = sPRAM.vendorUse1; // Use the first video mode
if ( g->gCurrentMode > kFirstVideoMode ) {
g->gDirectMode = true;
}
}
#else
g->gDirectMode = false;
g->gMonitorID = kRGB1312; // No save the monitor ID
g->gCurrentMode = kFirstVideoMode;
#endif
g->gRowBytes = GetRowBytes(g->gMonitorID,g->gCurrentMode,g->gSlotNum);
//==========================================================================
// Get or build gamma table
//==========================================================================
g->gGammaPtr = (GammaTablePtr) NewPtrSysClear(sizeof(GammaTable));
if ( g->gGammaPtr ) {
g->gGammaPtr->gFormulaSize = 0;
g->gGammaPtr->gChanCnt = 1;
g->gGammaPtr->gDataCnt = 3;
g->gGammaPtr->gDataCnt = 256;
g->gGammaPtr->gDataWidth = 0x0008;
for ( i = 0; i < kNumCLUTEntries; i++ ) {
g->gGammaPtr->gFormulaData[i] = i;
}
}
#ifndef ROM
// InitNubInts();
// InitNubIntMgr();
#endif
// InstallInterruptRoutine(dce);
#ifdef ROM
// err = AttachVBL(0x0E);
#endif
return(noErr); // Say open was successful
}
/*-------------------------------------------------------------------------
*start
*
*Name: CloseDRVR
*Creator: George D. Wilson Jr.
*Date: 3/20/92
*
*Purpose:
*
*Category:
*File:
*
*Calls:
*
*Called By:
*
*Entry:
*
*Alters:
*
*Exit:
*
*Detailed:
*
*Algorithm:
*
*Note:
*
*History:
*
* Date Programmer Modification
* -------- ---------- -----------------------------------------
*
*stop
*-----------------------------------------------------------------------*/
UInt16 CloseDRVR (CntrlParam *pb, DCtlPtr dce)
{
#pragma unused(pb)
globalsPtr g;
UInt8 mmuMode;
// DebugStr("\pCloseDRVR");
g = (globalsPtr) *(dce->dCtlStorage);
mmuMode = true32b;
SwapMMUMode(&mmuMode);
DoDisableVideo(g->gBigSlotNum); // Turn the video system off
if ( g->gGammaPtr ) { // If we have a gamma table
DisposPtr((Ptr) (g->gGammaPtr)); // Release the memory
}
if ( g->gInterruptsEnabled ) { // If cursor interrupts are enabled
// RemoveInterruptRoutine(dce); // Disable them
}
SwapMMUMode(&mmuMode);
DisposHandle(dce->dCtlStorage); // Release driver globals storage
return(noErr); // Say open was successful
}
/*-------------------------------------------------------------------------
*start
*
*Name: ControlDRVR
*Creator: George D. Wilson Jr.
*Date: 3/20/92
*
*Purpose:
*
*Category:
*File:
*
*Calls:
*
*Called By:
*
*Entry:
*
*Alters:
*
*Exit:
*
*Detailed:
*
*Algorithm:
*
*Note:
*
*History:
*
* Date Programmer Modification
* -------- ---------- -----------------------------------------
*
*stop
*-----------------------------------------------------------------------*/
UInt16 ControlDRVR (CntrlParam *pb, DCtlPtr dce)
{
Int16 message; // The control call being made
OSErr err;
globalsPtr g;
UInt8 mmuMode;
// DebugStr("\pControlDRVR");
g = (globalsPtr) *(dce->dCtlStorage);
mmuMode = true32b;
SwapMMUMode(&mmuMode);
message = pb->csCode;
switch ( message ) {
case cscReset:
err = DoVideoReset((VDPgInfoPtr) *((UInt32 *) &(pb->csParam[0])), dce);
break;
// case cscKillIO:
// err = DoKillIO((VDPgInfoPtr) *((UInt32 *) &(pb->csParam[0])), dce);
// break;
case cscSetMode:
err = DoSetVideoMode((VDPgInfoPtr) *((UInt32 *) &(pb->csParam[0])), dce);
break;
case cscSetEntries:
err = DoSetEntries((VDSetEntryPtr) *((UInt32 *) &(pb->csParam[0])), dce);
break;
case cscSetGamma:
err = DoSetGamma((VDGamRecPtr) *((UInt32 *) &(pb->csParam[0])), dce);
break;
case cscGrayScreen:
err = DoGrayPage((VDPgInfoPtr) *((UInt32 *) &(pb->csParam[0])), dce);
break;
case cscSetGray:
err = DoSetGray((VDGrayPtr) *((UInt32 *) &(pb->csParam[0])), dce);
break;
case cscSetInterrupt:
err = DoSetInterrupt((VDPgInfoPtr) *((UInt32 *) &(pb->csParam[0])), dce);
break;
case cscDirectSetEntries:
err = DoDirectSetEntries((VDSetEntryPtr) *((UInt32 *) &(pb->csParam[0])), dce);
break;
case cscSetDefaultMode:
err = DoSetDefaultMode((VDDefModePtr) *((UInt32 *) &(pb->csParam[0])), dce);
break;
case 200:
err = noErr;
break;
default: err = controlErr;
} // End switch
pb->ioResult = err;
SwapMMUMode(&mmuMode);
return(err);
}
/*-------------------------------------------------------------------------
*start
*
*Name: StatusDRVR
*Creator: George D. Wilson Jr.
*Date: 3/20/92
*
*Purpose:
*
*Category:
*File:
*
*Calls:
*
*Called By:
*
*Entry:
*
*Alters:
*
*Exit:
*
*Detailed:
*
*Algorithm:
*
*Note:
*
*History:
*
* Date Programmer Modification
* -------- ---------- -----------------------------------------
*
*stop
*-----------------------------------------------------------------------*/
UInt16 StatusDRVR (CntrlParam *pb, DCtlPtr dce)
{
Int16 message; // The control call being made
OSErr err; // Error code returned from routine
globalsPtr g;
UInt8 mmuMode;
// DebugStr("\pStatusDRVR");
g = (globalsPtr) *(dce->dCtlStorage);
mmuMode = true32b;
SwapMMUMode(&mmuMode);
message = pb->csCode;
err = statusErr; // Standard error code
switch ( message ) {
case cscGetMode:
err = DoGetMode((VDPgInfoPtr) *((UInt32 *) &(pb->csParam[0])), dce);
break;
case cscGetEntries:
err = DoGetEntries((VDSetEntryPtr) *((UInt32 *) &(pb->csParam[0])), dce);
break;
case cscGetPageCnt:
err = DoGetPages((VDPgInfoPtr) *((UInt32 *) &(pb->csParam[0])), dce);
break;
case cscGetBaseAddr:
err = DoGetBaseAddr((VDPgInfoPtr) *((UInt32 *) &(pb->csParam[0])), dce);
break;
case cscGetGray:
err = DoGetGray((VDGrayPtr) *((UInt32 *) &(pb->csParam[0])), dce);
break;
case cscGetInterrupt:
err = DoGetInterrupt((VDPgInfoPtr) *((UInt32 *) &(pb->csParam[0])), dce);
break;
case cscGetGamma:
err = DoGetGamma((VDGamRecPtr) *((UInt32 *) &(pb->csParam[0])), dce);
break;
case cscGetDefaultMode:
err = DoGetDefaultMode((VDDefModePtr) *((UInt32 *) &(pb->csParam[0])), dce);
break;
} // End switch
pb->ioResult = err; // Pass result code on
SwapMMUMode(&mmuMode);
return(err);
}
/*-------------------------------------------------------------------------
*
* End of Module
*
*-----------------------------------------------------------------------*/

View File

@ -0,0 +1,304 @@
/*
File: ATIDrvr.h
Contains: xxx put contents here xxx
Written by: xxx put writers here xxx
Copyright: © 1993 by Apple Computer, Inc., all rights reserved.
Change History (most recent first):
<1> 11/5/93 fau first checked in
<1> 10/27/93 fau first checked in
<1> 10/19/93 fau first checked in
*/
/*-------------------------------------------------------------------------
*start
*
*Name: ATIDrvr.h
*Creator: George D. Wilson Jr.
*Date: 3/17/92
*
*Purpose: Contains structures and defines for the RISC video driver.
*
*Category: Header File
*File: ATIDrvr.h
*
*Detailed:
*
*Note:
*
*History:
*
* Date Programmer Modification
* -------- ---------- -----------------------------------------
*
*stop
*-----------------------------------------------------------------------*/
#define ATI 1 // Indicate we are for ATI hardware
#define kNumPages 1 // Number of video pages
#define kOurVidPage 0 // The video page we use Always 0 on Quadra
#define kVBLInterruptEnabled 0 // VBL interrupts enabled return value
#define kVBLInterruptDisabled 1 // VBL interrupts disenabled return value
#define kDAFBHWID 0x001C // DAFB hardware device ID
#define kRowBytes138bpp 0x400 // Apple 13" rowbytes 8bpp
// #define kRowBytes1316bpp 0x500 // Apple 13" rowbytes 16bpp
// #define kRowBytes1324bpp 0xA00 // Apple 13" rowbytes 24bpp
#define kNumLines480 480 //
#define kNumCLUTEntries 256 // Number of entries in the CLUT
#define kSuper9 0x90000000
#define kSuperA 0xA0000000
#define kSuperB 0xB0000000
#define kSuperC 0xC0000000
#define kSuperD 0xD0000000
#define kSuperE 0xE0200000
#define kSlot9 0x09000000
#define kSlotA 0x0A000000
#define kSlotB 0x0B000000
#define kSlotC 0x0C000000
#define kSlotD 0x0D000000
#define kSlotE 0x0E000000
#define kMySlot kSlotE // Used to access ATI with Nub601
#ifdef ROM
#define kMySlot8 0x00 // Used to access ATI sResource structs
#else
#define kMySlot8 0x0E // Used to access ATI with Nub601
#endif
#define kMySuperSlot kSuperE // Used to access ATI with Nub601
#define kFirstVideoMode 0x80
#define kSecondVideoMode 0x81
#define kThirdVideoMode 0x82
#define kFourthVideoMode 0x83
#define kFifthVideoMode 0x84
#define kSixthVideoMode 0x85
//===============================================================================
// Below are the bit patterns to write into memory for each of the supported
// bit depths.
//===============================================================================
#define kOneBitPattern 0xAAAAAAAA
#define kTwoBitPattern 0xCCCCCCCC
#define kFourBitPattern 0xF0F0F0F0
#define kEightBitPattern 0xFF00FF00
#define kSixTeenBitPattern 0xFFFF0000
#define kThirtyTwoBitPattern 0xFFFFFFFF
#define kGrayCLUTValue 0x00808080 // Value to gray the CLUT
#define kRedLumValue 0x4CCC
#define kGreenLumValue 0x970A
#define kBlueLumValue 0x1C29
//===============================================================================
// The following definitions define the number of long word writes to
// to do to fill one line of video on the 13" monitor.
// This should be changed later to be monitor indepentent.
//===============================================================================
#define kOneBitBytes 0x14 // Number of long writes for one bpp
#define kTwoBitBytes 0x28 // Number of long writes for two bpp
#define kFourBitBytes 0x50 // Number of long writes for four bpp
#define kEightBitBytes 0xA0 // Number of long writes for eight bpp
#define kSixTeenBitBytes 0x140 // Number of long writes for sixteen bpp
#define kThirtyTwoBitBytes 0x280 // Number of long writes for thirty two bpp
#define kMonoDevice 0x01 // Monochrome device
#define kNonMonoDevice 0x00 // Non luminance mapping device
// #define kNumLines 480 // Number of lines on a 13"
//==========================================================================
// Sense line decode values
//==========================================================================
#define kSenseLineReset 0x00000007 // Drives all lines low
#define kSenseLineAMask 0x00000006 // Drives the A bit
#define kSenseLineBMask 0x00000005 // Drives the B bit
#define kSenseLineCMask 0x00000003 // Drives the C bit
#define kSenseLineMask 0x00000070 // Only the first three bits are used
#define kMonitorNotConnected 0x07 // No monitor or extended value
#define kRGB21 0x00 // 21" RGB display 1152x870 100.0 MHz
#define kFullPage 0x01 // Full page display 640x870 57.28 MHz
#define kRGB12 0x02 // 12" RGB display 512x384 15.67 MHz
#define kTwoPage 0x03 // Two page display 1152x870 100.0 MHz
#define kNTSC 0x04 // NTSC display varxvar 12.27 MHz
#define kRGB15 0x05 // 15" RGB display 640x870 57.28 MHz
#define kRGB1312 0x06 // Hi-Res 13" & 12" displays 30.24 MHz
#define k16SenseACode 0x02 // Value received from A mask
#define k16SenseBCode 0x05 // Value received from B mask
#define k16SenseCCode 0x02 // Value received from C mask
//==========================================================================
// Slot manager defines for the timing sResources
//==========================================================================
#define kATIVidParmSpId 0x7E // Resource id for the all ATI video systems
#define kNoMonitorConnected 0xFF // No Monitor connected to system
#define kRGB1312Connected 0x80 // Hi-Res sRsrc ID
#define kRGB16Connected 0x81 // 16" sRsrc ID
#define kRGB21Connected 0x82 // sRsrc ID
#define kFullPageConnected 0x83 // sRsrc ID
#define kRGB12Connected 0x84 // sRsrc ID
#define kTwoPageConnected 0x85 // sRsrc ID
#define kNTSCConnected 0x86 // sRsrc ID
#define kRGB15Connected 0x87 // sRsrc ID
#define kEndeavorParmSpId 0x80 // Resource id of Endeavor SBlock
#define kACDCParmSpId 0x81 // Resource id of ACDC SBlock
#define kSwatchParmSpId 0x82 // Resource id of Swatch SBlock
//==========================================================================
// Definition of default mode data structure
//==========================================================================
struct VDDefMode {
UInt8 csID;
};
typedef struct VDDefMode VDDefMode;
typedef VDDefMode *VDDefModePtr, **VDDefModeHandle;
#define kVDDefModeSize (sizeof(VDDefMode))
//==========================================================================
// Exported status routines
//==========================================================================
OSErr DoGetBaseAddr(VDPgInfoPtr pgPtr, DCtlPtr dce);
OSErr DoGetDefaultMode(VDDefModePtr dfPtr, DCtlPtr dce);
OSErr DoGetEntries(VDSetEntryPtr pgPtr, DCtlPtr dce);
OSErr DoGetGamma(VDGamRecPtr gPtr, DCtlPtr dce);
OSErr DoGetGray(VDGrayPtr pgPtr, DCtlPtr dce);
OSErr DoGetInterrupt(VDPgInfoPtr flgPtr, DCtlPtr dce);
OSErr DoGetMode(VDPgInfoPtr pgPtr, DCtlPtr dce);
OSErr DoGetPages(VDPgInfoPtr pgPtr, DCtlPtr dce);
//==========================================================================
// Exported control routines
//==========================================================================
OSErr DoVideoReset(VDPgInfoPtr pgPtr, DCtlPtr dce);
OSErr DoSetVideoMode(VDPgInfoPtr pgPtr, DCtlPtr dce);
OSErr DoSetEntries(VDSetEntryPtr pgPtr, DCtlPtr dce);
OSErr DoSetGamma(VDGamRecPtr pgPtr, DCtlPtr dce);
OSErr DoGrayPage(VDPgInfoPtr pgPtr, DCtlPtr dce);
OSErr DoSetGray(VDGrayPtr pgPtr, DCtlPtr dce);
OSErr DoSetInterrupt(VDPgInfoPtr pgPtr, DCtlPtr dce);
OSErr DoDirectSetEntries(VDSetEntryPtr pgPtr, DCtlPtr dce);
OSErr DoSetDefaultMode(VDDefModePtr dfPtr, DCtlPtr dce);
//==========================================================================
// Definition of slot manager vendor PRAM data structure
//==========================================================================
struct SPRAMRecord {
UInt16 boardID;
UInt8 vendorUse1;
UInt8 vendorUse2;
UInt8 vendorUse3;
UInt8 vendorUse4;
UInt8 vendorUse5;
UInt8 vendorUse6;
};
typedef struct SPRAMRecord SPRAMRecord;
typedef SPRAMRecord *SPRAMRecordPtr, **SPRAMRecordHandle;
#define kSPRAMRecordSize (sizeof(SPRAMRecord))
//==========================================================================
// Definition of gamma table data structure
//==========================================================================
struct GammaTable {
short gVersion; // gamma version number
short gType; // gamma data type
short gFormulaSize; // Formula data size
short gChanCnt; // number of channels of data
short gDataCnt; // number of values/channel
short gDataWidth; // bits/corrected value (data packed to next larger byte size)
char gFormulaData[255*3]; // data for formulas followed by gamma values
};
typedef struct GammaTable GammaTable;
typedef GammaTable *GammaTablePtr, **GammaTableHandle;
#define kGammaTableSize (sizeof(GammaTable))
struct ACDCVidParms {
UInt8 pbcr0ValueFirstMode;
UInt8 pbcr1ValueFirstMode;
UInt8 pbcr0ValueSecondMode;
UInt8 pbcr1ValueSecondMode;
UInt8 pbcr0ValueThirdMode;
UInt8 pbcr1ValueThirdMode;
};
typedef struct ACDCVidParms ACDCVidParms;
typedef struct ACDCVidParms *ACDCVidParmsPtr;
typedef struct ACDCVidParms **ACDCVidParmsHdl;
#define ACDCVIDPARMSSIZE ((UInt32) sizeof(ACDCVidParms))
struct endeavorVidParms {
UInt8 MRegValue;
UInt8 NRegValue;
};
typedef struct endeavorVidParms endeavorVidParms;
typedef struct endeavorVidParms *endeavorVidParmsPtr;
typedef struct endeavorVidParms **endeavorVidParmsHdl;
#define ENDEAVORVIDPARMSSIZE ((UInt32) sizeof(endeavorVidParms))
struct globals {
GammaTablePtr gGammaPtr;
Ptr gBaseAddr;
Ptr gFBBaseAddr;
Boolean gInterruptsEnabled;
Boolean gMonoOnly;
Boolean gLuminanceMode;
Boolean gDirectMode;
UInt16 gNumLines;
UInt16 gRowBytes;
UInt16 gCurrentPage;
UInt32 gBigSlotNum;
UInt8 gMonitorID;
UInt8 gSlotNum;
UInt8 gCurrentMode;
SlotIntQElement qElem;
};
typedef struct globals globals;
typedef struct globals *globalsPtr;
typedef struct globals **globalsH;
#define GLOBALSSIZE ((UInt32) sizeof(globals))
//==========================================================================
// Utility routines
//==========================================================================
void RemoveInterruptRoutine(DCtlPtr dce);
void InstallInterruptRoutine(DCtlPtr dce);
void DoDisableVideo(UInt32 theSlot);
/*-------------------------------------------------------------------------
*
* End of Module
*
*-----------------------------------------------------------------------*/

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,84 @@
;
; File: ATIHdr.a
;
; Contains: xxx put contents here xxx
;
; Written by: xxx put writers here xxx
;
; Copyright: © 1993 by Apple Computer, Inc., all rights reserved.
;
; Change History (most recent first):
;
; <1> 11/5/93 fau first checked in
; <1> 10/27/93 fau first checked in
; <1> 10/19/93 fau first checked in
;
;
;--------------------------------------------------------------------------
;start
;
;Name: ATIHdr.a
;Creator: George D. Wilson Jr.
;Date: 4/24/92
;
;Purpose: Common equates and defines for ATI driver.
;
;Category: Driver Header include file
;File: ATIHdr.a
;
;Detailed: This assembly include file contains common equates for
; the version information of the ATI video driver
; and PrimaryInit.
;
;History:
;
; Date Programmer Modification
; -------- ---------- -----------------------------------------
;
;stop
;------------------------------------------------------------------------*/
kOurSlotNum EQU $E ;; The slot of the Nub Card
; -------------------------------------------------------------------
; +++++++++++++++++++++++ Version Control Constants +++++++++++++++++
; -------------------------------------------------------------------
gbla &numericVersion ; Numeric Version Number
&numericVersion seta $1000
gblc &textVersion ; Textual Version Number
&textVersion setc '1.0D1x1'
gblc &driverName
&driverName setc 'Display_Video_Apple_ATI' ; Driver name
; -------------------------------------------------------------------
; Macros for Accessing Version and Name Constants
; -------------------------------------------------------------------
MACRO
_DCB_RevLevel
gblc &textVersion
DC.B '&textVersion'
ENDM
MACRO
_DCB_DriverNameATI
gblc &driverName
DC.B '.&driverName'
ENDM
MACRO
_DCW_Version
gbla &numericVersion
DC.W &numericVersion
ENDM
;--------------------------------------------------------------------------
;
; End of Module
;
;------------------------------------------------------------------------*/

View File

@ -0,0 +1,87 @@
;
; File: ATIPrimaryInit.a
;
; Contains: xxx put contents here xxx
;
; Written by: xxx put writers here xxx
;
; Copyright: © 1993 by Apple Computer, Inc., all rights reserved.
;
; Change History (most recent first):
;
; <1> 11/5/93 fau first checked in
; <1> 10/27/93 fau first checked in
; <1> 10/19/93 fau first checked in
;
;
;--------------------------------------------------------------------------
;start
;
;Name: PrimaryInit.a
;Creator: George D. Wilson Jr.
;Date: 8/10/93
;
;Purpose: Does the jump into the high C PrimaryInit code.
;
;Category: INIT Point.
;File: PrimaryInit.a
;
;Calls: REALMAIN
;
;Entry: a0 - Pointer to slot exec parameter block.
;
;Alters: See high level code for alters.
;
;Detailed: This entry point pushes the slot exec parameter block
; onto the stack and jumps to the high level C. It upon
; returning from the C routine simply returns with an rts.
;
;History:
;
; Date Programmer Modification
; -------- ---------- -----------------------------------------
;
;stop
;------------------------------------------------------------------------*/
;--------------------------------------------------------------------------
;
; Includes
;
;------------------------------------------------------------------------*/
INCLUDE 'ROMEqu.a' ;Declaration ROM equates
INCLUDE 'Slots.a' ;Declaration ROM equates
;--------------------------------------------------------------------------
;
; Main Entry Point
;
;------------------------------------------------------------------------*/
Begin MAIN EXPORT
IMPORT REALMAIN
DC.B sExec2
DC.B sCPU68020
DC.W 0
DC.L theCode-* ; Offset to executable
theCode
WITH SEBlock,SpBlock
move.l a0,-(sp) ; Move the SEBlock on stack
jsr REALMAIN ; Call high level C code
addq.l #4,sp ; Drop arguments
rts
ENDP
END
;--------------------------------------------------------------------------
;
; End of Module
;
;------------------------------------------------------------------------*/

View File

@ -0,0 +1,546 @@
/*
File: ATIPrimaryInit.c
Contains: xxx put contents here xxx
Written by: xxx put writers here xxx
Copyright: © 1993 by Apple Computer, Inc., all rights reserved.
Change History (most recent first):
<1> 11/5/93 fau first checked in
<1> 10/27/93 fau first checked in
<1> 10/19/93 fau first checked in
*/
/*-------------------------------------------------------------------------
*start
*
*Name: PrimaryInit.c
*Creator: George D. Wilson Jr.
*Date: 4/23/92
*
*Purpose: Main interface file for ATI video driver primary init.
*
*Category: Macintosh driver
*File: PrimaryInit.c
*
*Exports: main - Main entry point for primary init.
*
*Detailed:
*
*Note:
*
*History:
*
* Date Programmer Modification
* -------- ---------- -----------------------------------------
*
*stop
*-----------------------------------------------------------------------*/
/*-------------------------------------------------------------------------
*
* Includes
*
*-----------------------------------------------------------------------*/
#include <Types.h>
#include <Video.h>
#include <Devices.h>
#include <Errors.h>
#include <OSUtils.h>
#include <Slots.h>
#include <Memory.h>
#include "ATIStdTypes.h"
#include "ATI.h"
#include "ATIDrvr.h"
#include "ATIVideo.h"
/*-------------------------------------------------------------------------
*
* Imported Procedures
*
*-----------------------------------------------------------------------*/
extern void PruneMonitors(UInt16 cardType, UInt8 theSlot);
extern UInt16 GetRowBytes(UInt8 monitorID, UInt8 videoMode, UInt8 theSlot);
extern UInt16 GetNumLines(UInt8 monitorID, UInt8 videoMode, UInt8 theSlot);
extern void DoProgramTiming(UInt32 slotNum, Ptr baseAddr, UInt8 monitorID,
UInt8 videoMode, UInt8 ourSlot, UInt16 rowBytes,
Boolean enableInterrupts);
extern void DoEnableVideo(UInt32 theSlot);
/*-------------------------------------------------------------------------
*start
*
*Name: SenseLineCheck
*Creator: George D. Wilson Jr.
*Date: 5/21/92
*
*Purpose: Returns the currently connected monitor code.
*
*Category:
*File: PrimaryInit.c
*
*Calls:
*
*Called By:
*
*Entry:
*
*Alters:
*
*Exit: UInt8 - Returns the sRsrc id of the monitor family connected.
*
*Detailed:
*
*Algorithm:
*
*Note:
*
*History:
*
* Date Programmer Modification
* -------- ---------- -----------------------------------------
* 9/28/93 George W. Added default return of 13" display.
*
*stop
*-----------------------------------------------------------------------*/
UInt8
SenseLineCheck(UInt32 theSlot)
{
UInt32 *SenseRegPtr;
UInt32 senseLineVal1,senseLineVal2,senseLineVal3;
// DebugStr("\pSenseLineCheck");
return(kRGB1312Connected); // ¥¥¥ ATI hack
SenseRegPtr = (UInt32 *) (theSlot | kATISenseLineBase);
senseLineVal1 = *SenseRegPtr; // Read the sense lines
senseLineVal1 &= kSenseLineMask; // Mask off the sense line bits
senseLineVal1 >= kSenseLineShift;
switch ( senseLineVal1 ) {
case kMonitorNotConnected:
*SenseRegPtr = (kSenseLineAMask); // Set all lines to ones
// *SenseRegPtr = (kSenseLinesReg); // Causes sense lines to be read
senseLineVal1 = *SenseRegPtr; // Read the sense lines
senseLineVal1 &= kSenseLineMask; // Mask off the sense line bits
senseLineVal1 >= kSenseLineShift; // Move bits to bottom
*SenseRegPtr = (kSenseLineBMask); // Set all lines to ones
// *SenseRegPtr = (kSenseLinesReg); // Causes sense lines to be read
senseLineVal2 = *SenseRegPtr; // Read the sense lines
senseLineVal2 &= kSenseLineMask; // Mask off the sense line bits
senseLineVal2 >= kSenseLineShift; // Move bits to bottom
*SenseRegPtr = (kSenseLineCMask); // Set all lines to ones
// *SenseRegPtr = (kSenseLinesReg); // Causes sense lines to be read
senseLineVal3 = *SenseRegPtr; // Read the sense lines
senseLineVal3 &= kSenseLineMask; // Mask off the sense line bits
senseLineVal3 >= kSenseLineShift; // Move bits to bottom
if ( (senseLineVal1 == kSenseLineAMask) &&
(senseLineVal2 == kSenseLineBMask) &&
(senseLineVal3 == kSenseLineCMask) ) {
return(kMonitorNotConnected);
}
if ( (senseLineVal1 == k16SenseACode) &&
(senseLineVal2 == k16SenseBCode) &&
(senseLineVal3 == k16SenseCCode) ) {
return(kRGB16Connected);
}
return(kMonitorNotConnected);
break;
case kRGB1312:
return(kRGB1312Connected);
break;
default: return(kMonitorNotConnected);
}
} /* End of SenseLineCheck */
void RampCLUT (UInt8 devID, UInt16 cardType)
{
UInt32 i;
UInt8 *clutAddrReg;
UInt8 *clutData;
// UInt32 dummy;
// DebugStr("\pRampClut");
IOLongWrite(0xF2800000, (devID << 12) | 4);
*(unsigned char *)(0xF2C00000) = 0x3;
PerformPCIHack();
if (cardType == kATIVendorID) {
clutAddrReg = (UInt8 *) kDAC_W_INDEX;
clutData = (UInt8 *) kDAC_DATA; // Point to data register
*clutAddrReg = 0; // Point to the first entry
PerformPCIHack();
for ( i = 0; i < 256; i++ ) {
*clutData = kGrayCLUTValue;
PerformPCIHack();
*clutData = kGrayCLUTValue;
PerformPCIHack();
*clutData = kGrayCLUTValue;
PerformPCIHack();
}
}
if (cardType == kDiamondVendorID) {
unsigned char *writeReg;
unsigned char *dataReg;
writeReg = (unsigned char *)(0xF20003C8); // kRamWrite
dataReg = (unsigned char *)(0xF20003C9); // kPaletteData
*writeReg = 0;
PerformPCIHack();
for (i = 0; i < 256; i++) {
*dataReg = (unsigned char)i; // red
PerformPCIHack();
*dataReg = (unsigned char)i; // green
PerformPCIHack();
*dataReg = (unsigned char)i; // blue
PerformPCIHack();
}
}
IOLongWrite(0xF2800000, (devID << 12) | 4);
*(unsigned char *)(0xF2C00000) = 0x2;
PerformPCIHack();
} /* End of RampClut */
/*-------------------------------------------------------------------------
*start
*
*Name: GrayPage
*Creator: George D. Wilson Jr.
*Date: 3/30/92
*
*Purpose:
*
*Category:
*File: PrimaryInit.c
*
*Calls:
*
*Called By:
*
*Entry:
*
*Alters:
*
*Exit:
*
*Detailed:
*
*Algorithm:
*
*Note:
*
*History:
*
* Date Programmer Modification
* -------- ---------- -----------------------------------------
*
*stop
*-----------------------------------------------------------------------*/
OSErr GrayPage(Ptr baseAddr, UInt16 rowBytes, UInt8 depth, UInt16 numLines)
{
UInt32 grayPattern;
UInt32 numWrites;
Ptr linePtr;
UInt32 *dumbPtr;
UInt16 i,j;
#if 0
Ptr myPtr;
UInt16 k, huh, huh1;
#endif
// DebugStr("\pGrayPage");
switch ( depth ) {
case 1: grayPattern = kOneBitPattern; break;
case 2: grayPattern = kTwoBitPattern; break;
case 4: grayPattern = kFourBitPattern; break;
case 8: grayPattern = kEightBitPattern; break;
case 16: grayPattern = kSixTeenBitPattern; break;
case 32: grayPattern = kThirtyTwoBitPattern; break;
}
numWrites = rowBytes / 4;
linePtr = (Ptr) baseAddr;
if ( depth == 32 ) {
for ( i = 0; i < numLines; i++ ) {
dumbPtr = (UInt32 *) linePtr;
for ( j = 0; j < numWrites; j++ ) {
*dumbPtr++ = grayPattern;
grayPattern = ~grayPattern;
}
linePtr += rowBytes;
grayPattern = ~grayPattern;
}
} else {
for ( i = 0; i < numLines; i++ ) {
dumbPtr = (UInt32 *) linePtr;
for ( j = 0; j < numWrites; j++ ) {
*dumbPtr++ = grayPattern;
}
linePtr += rowBytes;
grayPattern = ~grayPattern;
}
}
// code to dump the DACs into the frame buffer.
// 16x16 rectangles each with a different pixel value.
#if 0
huh = 0;
for (i = 0; i < numLines; i++) {
linePtr = (Ptr) baseAddr + (i * rowBytes);
myPtr = linePtr;
huh1 = huh;
for (j = 0; j < 16; j++) {
for (k = 0; k < 40; k++) {
*myPtr = huh1;
myPtr++;
}
huh1++;
}
if (i % 30 == 0 && i > 0) {
huh += 16;
}
}
#endif
return(noErr);
} /* End of GrayPage */
void CalcSlotBaseAddr (UInt8 slot, UInt32 *baseAddr32, UInt32 *baseAddrFB32)
{
UInt8 slotNum;
slotNum = slot;
*baseAddr32 = ((UInt32) (0x0F0 | slotNum) << 24);
*baseAddrFB32 = (UInt32) ((0x0F00 | (slotNum << 4) | slotNum) << 20);
}
/*-------------------------------------------------------------------------
*start
*
*Name: REALMAIN
*Creator: George D. Wilson Jr.
*Date: 5/21/92
*
*Purpose: Main entry point for the ATI primary init.
*
*Category: Entry Point
*File: PrimaryInit.c
*
*Calls:
*
*Called By:
*
*Entry:
*
*Alters:
*
*Exit: UInt8
*
*Detailed:
*
*Algorithm:
*
*Note:
*
*History:
*
* Date Programmer Modification
* -------- ---------- -----------------------------------------
* 5/21/92 George W. Added sense line logic.
*
*stop
*-----------------------------------------------------------------------*/
void REALMAIN (SEBlock *aSEBlockPtr)
{
Ptr baseAddr=0;
Ptr baseAddrFB;
UInt16 rowBytes;
UInt32 slotNum;
UInt8 slot;
UInt8 mmuMode;
UInt8 theMonitorID;
SpBlock spPb;
OSErr err;
SPRAMRecord sPRAM;
UInt8 videoMode=0;
UInt16 numLines;
UInt16 depth;
UInt16 cardType;
mmuMode = true32b;
SwapMMUMode(&mmuMode);
slot = aSEBlockPtr->seSlot; // Get out slot number
slotNum = kMySuperSlot;
#if 0
PruneMonitors(theMonitorID,slot);
if ( (theMonitorID < kRGB1312Connected) ||
(theMonitorID > kRGB16Connected) ) { // We only support 13"
aSEBlockPtr->seStatus = -1;
return; // All done get out
}
// CalcSlotBaseAddr(slot,&baseAddr,&baseAddrFB);
baseAddr = (Ptr) (kBaseAddress | kMySuperSlot);
baseAddrFB = (Ptr) (kBaseAddress | kMySlot | 0xF0000000);
videoMode = kFirstVideoMode;
spPb.spSlot = slot;
spPb.spResult = &sPRAM;
err = SReadPRAMRec(&spPb);
if ( err == noErr ) { // Did we get our PRAM?
if ( sPRAM.vendorUse4 != theMonitorID ) { // Is this the same monitor as last time?
sPRAM.vendorUse4 = theMonitorID; // No save the monitor ID
spPb.spsPointer = (Ptr) &sPRAM; // Heres the PRAM record to save
err = SPutPRAMRec(&spPb); // Save it for ever
} else { // Yes
if ( (sPRAM.vendorUse1 >= kFirstVideoMode) || // Range check mode value
(sPRAM.vendorUse1 >= kFifthVideoMode) ) {
videoMode = sPRAM.vendorUse1; // If mode value is funny save default.
}
}
}
rowBytes = GetRowBytes(theMonitorID,videoMode,slot);
numLines = GetNumLines(theMonitorID,videoMode,slot);
DoProgramTiming(kMySuperSlot,(Ptr) kBaseAddress,
theMonitorID,videoMode,slot, rowBytes,false);
depth = GetBitDepth(theMonitorID,videoMode,slot);
GrayPage(baseAddrFB,rowBytes,8,numLines);
RampCLUT();
DoEnableVideo(slotNum);
#else
//====================================================
// New funky code for ATI card
//====================================================
slot = FindPCICard(&cardType); // Search some slots for ATI
if ( slot == 0x00 ) {
aSEBlockPtr->seStatus = -1;
return; // All done get out
}
err = EnableIOAccess(slot, true, cardType);
if ( err != noErr ) {
aSEBlockPtr->seStatus = -1;
return; // All done get out
}
{
OSErr err;
SpBlock spPb;
char *p;
short i;
p = (char *) &spPb;
for ( i = 0; i < sizeof(SpBlock); i++ ) *p++ = 0;
spPb.spSlot = 0x00;
if ( cardType == kATIVendorID) { // look for ATI
spPb.spID = 0x90; // id of board sRsrc to delete
}
if ( cardType == kDiamondVendorID) { // look for Diamond
spPb.spID = 0x80; // The id of the board sRsrc
}
err = SDeleteSRTRec(&spPb);
}
theMonitorID = SenseLineCheck(slotNum);
if ( theMonitorID == kNoMonitorConnected ) { // No monitor
aSEBlockPtr->seStatus = -1;
return; // All done get out
}
videoMode = kFirstVideoMode;
spPb.spSlot = slot;
spPb.spResult = &sPRAM;
#if 0
err = SReadPRAMRec(&spPb);
if ( err == noErr ) { // Did we get our PRAM?
if ( sPRAM.vendorUse4 != theMonitorID ) { // Is this the same monitor as last time?
sPRAM.vendorUse4 = theMonitorID; // No save the monitor ID
spPb.spsPointer = (Ptr) &sPRAM; // Heres the PRAM record to save
err = SPutPRAMRec(&spPb); // Save it for ever
} else { // Yes
if ( (sPRAM.vendorUse1 >= kFirstVideoMode) || // Range check mode value
(sPRAM.vendorUse1 >= kFifthVideoMode) ) {
videoMode = sPRAM.vendorUse1; // If mode value is funny save default.
}
}
}
#endif
if (cardType == kATIVendorID) {
UInt32 data;
UInt16 *ioReg;
ioReg = (UInt16 *) kMEM_CFG; // Memory config IO register
data = WByteSwap(*ioReg); // Get existing data
data |= (kATIVRAMAddr >> 16) | k4MegAperture; // Set the VRAM base address
data &= 0x0000FFFF;
*ioReg = WByteSwap(data); // Write new stuff
PerformPCIHack();
ioReg = (UInt16 *) kLOCAL_CNTL; //
*ioReg = WByteSwap(0x00A2); // Write new stuff
PerformPCIHack();
baseAddr = (Ptr) kATIVRAMAddr; // should equal kDiamondFBBase
baseAddrFB = (Ptr) kATIVRAMAddr;
depth = 8; // Default for now is 8bpp
rowBytes = 1024;
numLines = 480;
GrayPage(baseAddrFB,rowBytes,depth,numLines);
RampCLUT(slot,kATIVendorID);
SlamRegisters(slot);
}
else {
baseAddr = (Ptr) kDiamondFBBase; // should equal kATIVRAMAddr
baseAddrFB = (Ptr) kDiamondFBBase;
depth = 8; // Default for now is 8bpp
rowBytes = 640;
numLines = 480;
GoDiamond640x480x8Apple(slot);
GrayPage(baseAddrFB,rowBytes,depth,numLines);
}
#endif
aSEBlockPtr->seStatus = noErr;
SwapMMUMode(&mmuMode);
}

View File

@ -0,0 +1,616 @@
/*
File: ATISlotUtils.c
Contains: xxx put contents here xxx
Written by: xxx put writers here xxx
Copyright: © 1993 by Apple Computer, Inc., all rights reserved.
Change History (most recent first):
<1> 11/5/93 fau first checked in
<1> 10/27/93 fau first checked in
<1> 10/19/93 fau first checked in
*/
/*-------------------------------------------------------------------------
*start
*
*Name: ATISlotUtils.c
*Creator: George D. Wilson Jr.
*Date: 6/19/92
*
*Purpose: Contains routines to works with video slot resources
*
*Category:
*File: ATISlotUtils.c
*
*Exports: MonitorIDToSpID
* FindVideoTimingStruct
* GetTimingSBlock
* GetBitDepth
* GetRowBytes
* GetNumLines
* PruneMonitors
*
*Locals:
*
*Detailed:
*
*Note:
*
*History:
*
* Date Programmer Modification
* -------- ---------- -----------------------------------------
*
*stop
*-----------------------------------------------------------------------*/
/*-------------------------------------------------------------------------
*
* Includes
*
*-----------------------------------------------------------------------*/
#include <Types.h>
#include <Video.h>
#include <Devices.h>
#include <Errors.h>
#include <OSUtils.h>
#include <Slots.h>
#include <Memory.h>
#include "NubEqu.h"
#include "ATIStdTypes.h"
#include "ATIDrvr.h"
/*-------------------------------------------------------------------------
*
* Imported Variables
*
*-----------------------------------------------------------------------*/
/*-------------------------------------------------------------------------
*
* Imported Procedures
*
*-----------------------------------------------------------------------*/
/*-------------------------------------------------------------------------
*
* Local Typedefs and Defines
*
*-----------------------------------------------------------------------*/
/*-------------------------------------------------------------------------
*
* Exported Variables
*
*-----------------------------------------------------------------------*/
/*-------------------------------------------------------------------------
*
* Exported Procedures
*
*-----------------------------------------------------------------------*/
/*-------------------------------------------------------------------------
*
* Local Variables
*
*-----------------------------------------------------------------------*/
/*-------------------------------------------------------------------------
*
* Beginning of Procedure Definitions
*
*-----------------------------------------------------------------------*/
/*-------------------------------------------------------------------------
*start
*
*Name: MonitorIDToSpID
*Creator: George D. Wilson Jr.
*Date: 6/12/92
*
*Purpose: Transforms a monitor id into the appropriate slot resource id.
*
*Category:
*File: ATISlotUtils.c
*
*Calls:
*
*Called By:
*
*Entry:
*
*Alters:
*
*Exit: UInt8
*
*Detailed:
*
*Algorithm:
*
*Note: Today the monitor identification is the slot manager spId.
* You must be careful not get the header file used here out of
* sync with the declaration ROM assembler file.
*
* We only have values for the 13" RGB currently.
*
*History:
*
* Date Programmer Modification
* -------- ---------- -----------------------------------------
*
*stop
*-----------------------------------------------------------------------*/
UInt8
MonitorIDToSpID(UInt8 monitorId)
{
// UInt8 spId;
// DebugStr("\pMonitorIDToSpID");
return(monitorId);
} /* End of MonitorIDToSpID */
/*-------------------------------------------------------------------------
*start
*
*Name: GetNumLines
*Creator: George D. Wilson Jr.
*Date: 6/22/92
*
*Purpose: Returns the number of vertical lines for the specified monitor/mode.
*
*Category:
*File: ATISlotUtils.c
*
*Calls:
*
*Called By:
*
*Entry: rowBytes - If the video parameters structure couldn't be
* located zero is returned. Otherwise a 16 bit
* value indicating the number of vertical lines
* is returned.
*
*Alters:
*
*Exit: UInt16
*
*Detailed:
*
*Algorithm:
*
*Note:
*
*History:
*
* Date Programmer Modification
* -------- ---------- -----------------------------------------
*
*stop
*-----------------------------------------------------------------------*/
UInt16
GetNumLines(UInt8 monitorID, UInt8 videoMode, UInt8 theSlot)
{
OSErr err;
// UInt8 spId;
SpBlock spPb;
char *p;
short i;
VPBlockPtr vpPtr;
Rect bounds;
// DebugStr("\pGetNumLines");
return(kNumLines480);
p = (char *) &spPb;
for ( i = 0; i < sizeof(SpBlock); i++ ) *p++ = 0;
spPb.spSlot = theSlot;
spPb.spID = MonitorIDToSpID(monitorID); // The id of the monitor sRsrc
err = SRsrcInfo(&spPb); // Find it, it better be there
if ( err != noErr ) return(0); // Something bad has happened
spPb.spID = videoMode; // Find the structure for the mode
err = SFindStruct(&spPb); // Go find it
if ( err != noErr ) return(0); // Couldn't structure
spPb.spID = mVidParams; // Get the video mode structure
err = SGetBlock(&spPb);
if ( err != noErr ) return(0); // Couldn't structure
vpPtr = (VPBlockPtr) spPb.spResult;
bounds = vpPtr->vpBounds; // Save screen bounds value
DisposPtr((Ptr) spPb.spResult);
return(bounds.bottom-bounds.top);
} /* End of GetNumLines */
/*-------------------------------------------------------------------------
*start
*
*Name: GetBitDepth
*Creator: George D. Wilson Jr.
*Date: 6/22/92
*
*Purpose: Returns the bit depth for the specified monitor/mode.
*
*Category:
*File: ATISlotUtils.c
*
*Calls:
*
*Called By:
*
*Entry:
*
*Alters:
*
*Exit: UInt16
*
*Detailed:
*
*Algorithm:
*
*Note:
*
*History:
*
* Date Programmer Modification
* -------- ---------- -----------------------------------------
*
*stop
*-----------------------------------------------------------------------*/
UInt16
GetBitDepth(UInt8 monitorID, UInt8 videoMode, UInt8 theSlot)
{
OSErr err;
// UInt8 spId;
SpBlock spPb;
char *p;
short i;
VPBlockPtr vpPtr;
UInt16 depth;
// DebugStr("\pGetBitDepth");
return(8);
p = (char *) &spPb;
for ( i = 0; i < sizeof(SpBlock); i++ ) *p++ = 0;
spPb.spSlot = theSlot;
spPb.spID = MonitorIDToSpID(monitorID); // The id of the monitor sRsrc
err = SRsrcInfo(&spPb); // Find it, it better be there
if ( err != noErr ) return(0); // Something bad has happened
spPb.spID = videoMode; // Find the structure for the mode
err = SFindStruct(&spPb); // Go find it
if ( err != noErr ) return(0); // Couldn't structure
spPb.spID = mVidParams; // Get the video mode structure
err = SGetBlock(&spPb);
if ( err != noErr ) return(0); // Couldn't structure
vpPtr = (VPBlockPtr) spPb.spResult;
depth = vpPtr->vpPixelSize; // Save depth
DisposPtr((Ptr) spPb.spResult);
return(depth);
} /* End of GetBitDepth */
/*-------------------------------------------------------------------------
*start
*
*Name: GetRowBytes
*Creator: George D. Wilson Jr.
*Date: 6/22/92
*
*Purpose: Returns the rowBytes value for the specified monitor and mode.
*
*Category:
*File: ATISlotUtils.c
*
*Calls:
*
*Called By:
*
*Entry: rowBytes - If the video parameters structure couldn't be
* located zero is returned. Otherwise a 16 bit
* value indicating the rowbytes for the mode is
* returned.
*
*Alters:
*
*Exit: UInt16
*
*Detailed:
*
*Algorithm:
*
*Note:
*
*History:
*
* Date Programmer Modification
* -------- ---------- -----------------------------------------
*
*stop
*-----------------------------------------------------------------------*/
UInt16
GetRowBytes(UInt8 monitorID, UInt8 videoMode, UInt8 theSlot)
{
OSErr err;
// UInt8 spId;
SpBlock spPb;
char *p;
short i;
VPBlockPtr vpPtr;
UInt16 rowBytes;
unsigned long data;
IOLongWrite(0xF2800000, 0x02 << 12);
data = LByteSwap(*(unsigned long *)0xF2C00000); // Get Vendor ID
if ( data == (0x1002 | (0x4158 << 16)) ) { // look for ATI
return(1024);
}
if ( data == (0x100E | (0x9001 << 16)) ) { // look for Diamond
return(640);
}
return(640);
p = (char *) &spPb;
for ( i = 0; i < sizeof(SpBlock); i++ ) *p++ = 0;
spPb.spSlot = theSlot;
spPb.spID = MonitorIDToSpID(monitorID); // The id of the monitor sRsrc
err = SRsrcInfo(&spPb); // Find it, it better be there
if ( err != noErr ) return(0); // Something bad has happened
spPb.spID = videoMode; // Find the structure for the mode
err = SFindStruct(&spPb); // Go find it
if ( err != noErr ) return(0); // Couldn't structure
spPb.spID = mVidParams; // Get the video mode structure
err = SGetBlock(&spPb);
if ( err != noErr ) return(0); // Couldn't structure
vpPtr = (VPBlockPtr) spPb.spResult;
rowBytes = vpPtr->vpRowBytes; // Save rowBytes value
DisposPtr((Ptr) spPb.spResult);
return(rowBytes);
} /* End of GetRowBytes */
/*-------------------------------------------------------------------------
*start
*
*Name: FindVideoTimingStruct
*Creator: George D. Wilson Jr.
*Date: 6/12/92
*
*Purpose: Locates the proper sRsrc for the given monitor.
*
*Category:
*File: ATISlotUtils.c
*
*Calls:
*
*Called By:
*
*Entry:
*
*Alters:
*
*Exit: Ptr
*
*Detailed:
*
*Algorithm:
*
*Note:
*
*History:
*
* Date Programmer Modification
* -------- ---------- -----------------------------------------
*
*stop
*-----------------------------------------------------------------------*/
Ptr
FindVideoTimingStruct(UInt8 monitorID, UInt8 theSlot)
{
OSErr err;
// UInt8 spId;
SpBlock spPb;
char *p;
short i;
// DebugStr("\pFindVideoTimingStruct");
p = (char *) &spPb;
for ( i = 0; i < sizeof(SpBlock); i++ ) *p++ = 0;
spPb.spSlot = theSlot;
#ifdef ROM
spPb.spID = 0x11; // The id of the board sRsrc
#else
spPb.spID = 0x01;
#endif
err = SRsrcInfo(&spPb); // Find it, it better be there
if ( err != noErr ) return(nil); // Something bad has happened
spPb.spID = kATIVidParmSpId; // So far we only know about this one
err = SFindStruct(&spPb); // Go find it
if ( err != noErr ) return(nil); // Couldn't locate ATI video tree
spPb.spID = MonitorIDToSpID(monitorID); // Point to a specific monitor timimg set
err = SFindStruct(&spPb); // Go find it
if ( err != noErr ) return(nil); // There is no monitor of that type
return((Ptr) spPb.spsPointer); // Return slot pointer
} /* End of FindVideoTimingStruct */
/*-------------------------------------------------------------------------
*start
*
*Name: GetTimingSBlock
*Creator: George D. Wilson Jr.
*Date: 6/12/92
*
*Purpose: Returns a pointer to the SBlock with all timing parameters.
*
*Category:
*File: ATISlotUtils.c
*
*Calls:
*
*Called By:
*
*Entry:
*
*Alters:
*
*Exit: Ptr - If the proper SBlock is located a pointer to the
* block of data is returned. If the block chould
* not be located nil is returned.
*
*Detailed: It is the responsibility of the caller of this routine to
* dispose of the pointer returned.
*
*Algorithm:
*
*Note:
*
*History:
*
* Date Programmer Modification
* -------- ---------- -----------------------------------------
*
*stop
*-----------------------------------------------------------------------*/
Ptr
GetTimingSBlock(UInt8 monitorID, UInt8 videoMode, UInt8 timingSelector, UInt8 ourSlot)
{
OSErr err;
Ptr vidParmPtr;
SpBlock spPb;
char *p;
short i;
// DebugStr("\pGetTimingSBlock");
p = (char *) &spPb;
for ( i = 0; i < sizeof(SpBlock); i++ ) *p++ = 0;
vidParmPtr = FindVideoTimingStruct(monitorID,ourSlot);
if ( vidParmPtr ) {
spPb.spsPointer = vidParmPtr;
spPb.spID = timingSelector;
if ( timingSelector == kSwatchParmSpId ) {
spPb.spID = kSwatchParmSpId;
err = SFindStruct(&spPb);
if ( err != noErr ) return(nil);
spPb.spID = videoMode;
}
err = SGetBlock(&spPb);
if ( err == noErr ) {
return((Ptr) spPb.spResult);
}
}
return(nil);
} /* End of GetTimingSBlock */
/*-------------------------------------------------------------------------
*start
*
*Name: PruneMonitors
*Creator: George D. Wilson Jr.
*Date: 6/19/92
*
*Purpose: Removes the unused monitors timing sResources
*
*Category:
*File: ATISlotUtils.c
*
*Calls:
*
*Called By:
*
*Entry: monitorID - The monitor identifer to keep around.
*
* theSlot - The slot we are operating out of
*
*Alters:
*
*Exit: void
*
*Detailed:
*
*Algorithm:
*
*Note:
*
*History:
*
* Date Programmer Modification
* -------- ---------- -----------------------------------------
*
*stop
*-----------------------------------------------------------------------*/
void
PruneMonitors(UInt16 cardType, UInt8 theSlot)
{
OSErr err;
// UInt8 spId;
SpBlock spPb;
char *p;
short i;
p = (char *) &spPb;
for ( i = 0; i < sizeof(SpBlock); i++ ) *p++ = 0;
spPb.spSlot = theSlot; // should be 0x00
if ( cardType == 0x1002) { // look for ATI
spPb.spID = 0x90;
}
if ( cardType == 0x100E) { // look for Diamond
spPb.spID = 0x80; // The id of the board sRsrc
}
err = SDeleteSRTRec(&spPb);
} /* End of PruneMonitors */
/*-------------------------------------------------------------------------
*
* End of Module
*
*-----------------------------------------------------------------------*/

View File

@ -0,0 +1,174 @@
/*
File: ATIStdTypes.h
Contains: xxx put contents here xxx
Written by: xxx put writers here xxx
Copyright: © 1993 by Apple Computer, Inc., all rights reserved.
Change History (most recent first):
<1> 11/5/93 fau first checked in
<1> 10/27/93 fau first checked in
<1> 10/19/93 fau first checked in
*/
//==================================================================================
//
// File: ATIStdTypes
//
// Description: This file defines standard types, constants and macros that can
// be used to produce portable C code. The following is a list of suggested
// coding style guidelines:
//
// ¥ Precede constant names with a "k": kMyConstant
// ¥ Precede global names with a "g": gMyGlobal
// ¥ Capitalize macro names: MY_NEAT_MACRO
// ¥ Capitalize the first letter of each word in typedefs, filenames and
// subroutines: MyTypedef, MyFile.c, MySuperSubroutine()
// ¥ Capitalize the first letter of each word except the first in variables:
// myWindowPtr
// ¥ Avoid using C's ambiguous intrinsic types like "int", use these instead:
// Uint8, Int32, etc., or define your own for clarity
// ¥ Include a copyright notice (see below)
// ¥ Define function prototypes and include argument names in prototypes:
// void MyFooBar(Int32 refCon, const Ptr string, Boolean *success);
// ¥ Use enums for a set of constants:
// typedef enum { kRed = 1, kGreen = 2, kBlue = 3 } ColorComponent;
// ¥ Ensure that header files cannot be included more than once, so use:
// #ifndef __MYHEADERFILE__
// #define __MYHEADERFILE__
// header body
// #endif __MYHEADERFILE__
//
// ¥ Put clear headers at the top of every file and before every subroutine
// ¥ Write in ANSI C! (only caveat - it's okay to use // for comments)
//
// Creator: Brian Heaney
//
// Copyright: © 1992-1993 by Apple Computer, Inc., all rights reserved.
//
// Change History (most recent first):
//
// Date Programmer Modification
// ------- ---------- -----------------------------------------------
// 5/5/92 B. Heaney Created file
//
//==================================================================================
#ifndef __StdTypes__
#define __StdTypes__
#ifndef __TYPES__
#include <Types.h> // Just to make sure we get the basics
#endif
//==================================================================================
//
// Substitutes for Instrinsic Types
//
//==================================================================================
typedef char Int8; // Signed 8-bit integer
typedef short Int16; // Signed 16-bit integer
typedef long Int32; // Signed 32-bit integer
typedef unsigned char UInt8; // Unsigned 8-bit integer
typedef unsigned short UInt16; // Unsigned 16-bit integer
typedef unsigned long UInt32; // Unsigned 32-bit integer
typedef float Float32; // Single-precision floating point
typedef double Float64; // Double-precision floating point
typedef Int8 *Int8Ptr, **Int8Handle;
typedef Int16 *Int16Ptr, **Int16Handle;
typedef Int32 *Int32Ptr, **Int32Handle;
typedef UInt8 *UInt8Ptr, **UInt8Handle;
typedef UInt16 *UInt16Ptr, **UInt16Handle;
typedef UInt32 *UInt32Ptr, **UInt32Handle;
typedef Float32 *Float32Ptr, **Float32Handle;
typedef Float64 *Float64Ptr, **Float64Handle;
//==================================================================================
//
// Useful Constants
//
//==================================================================================
typedef enum { kIsOk = false, kNotOk = true };
typedef enum { kSuccess = 0, kFailure = -1 }; // Function return codes
//==================================================================================
//
// Range limits of each type of integer
//
//==================================================================================
#define kMinInt8 ((Int8) (1<<7))
#define kMaxInt8 (~kMinInt8)
#define kMaxUInt8 ((UInt8) -1)
#define kMinInt16 ((Int16) (1<<15))
#define kMaxInt16 (~kMinInt8)
#define kMaxUInt16 ((UInt16) -1)
#define kMinInt32 ((Int32) (1<<31))
#define kMaxInt32 (~kMinInt8)
#define kMaxUInt32 ((UInt32) -1)
//==================================================================================
//
// Useful Arithmetic Macros
//
//==================================================================================
#define ABS(x) ( (x) < 0 ? -(x) : (x) )
#define MAX(x,y) ( (x) > (y) ? (x) : (y) )
#define MIN(x,y) ( (x) < (y) ? (x) : (y) )
#define SQR(x) ( (x) * (x) )
#define CLAMP(x,min,max) ( ((x) > (max)) ? (max) : ((x) < (min)) ? (min) : (x) )
// ASR(operand,shift): Arithmetic Shift Right Macro
// C does not guarrantee that '>>' on a negative operaand will
// perform an arithmetic shift (i.e., preserve the sign bit).
// Note: "shift" must be positive.
#define ASR(operand,shift) ( ((operand) >= 0) ? ((operand) >> (shift)) : \
(~((~(operand)) >> (shift))) )
//==================================================================================
//
// Useful Bit-Field Macros
//
// Note that the "bit" argument refers to a bit number and
// he "mask" argument refers to a maskword, ie.,
// #define kDMADoneBit 7
// #define kDMADoneMask 1<<kDMADoneBit
//
//==================================================================================
#define MAKEMASK(bit) ( 1<<(bit) )
#define ANDMASK(word,mask) ( (word) & (mask) )
#define ANDBIT(word,bit) ( ANDMASK(word,MAKEMASK(bit)) )
#define SETMASK(word,mask) ( (word) | (mask) )
#define SETBIT(word,bit) ( SETMASK(word,MAKEMASK(bit)) )
#define CLEARMASK(word,mask) ( (word) & ~(mask) )
#define CLEARBIT(word,bit) ( CLEARMASK(word,MAKEMASK(bit)) )
#define LSB(mask,bit) { \
for (bit=0; !ANDBIT(mask,bit) && bit < 31; bit++ ) ; \
}
#define MSB(mask,bit) { \
for (bit=31; !ANDBIT(mask,bit) && bit > 0; bit-- ) ; \
}
#endif __StdTypes__

View File

@ -0,0 +1,99 @@
/*
File: ATIVideo.h
Contains: xxx put contents here xxx
Written by: xxx put writers here xxx
Copyright: © 1993-1994 by Apple Computer, Inc., all rights reserved.
Change History (most recent first):
<SM2> 1/5/94 kc Add Function ProtoTypes to prevent compiler warnings.
<1> 11/5/93 fau first checked in
<1> 10/27/93 fau first checked in
<1> 10/19/93 fau first checked in
*/
/*-------------------------------------------------------------------------
*start
*
*Name: ATIVideo.h
*Creator: George D. Wilson Jr.
*Date: 9/30/92
*
*Purpose: Contains special definitions for the ATI video system.
*
*Category: Header File
*File: ATIVideo.h
*
*Detailed:
*
*Note:
*
*History:
*
* Date Programmer Modification
* -------- ---------- -----------------------------------------
*
*stop
*-----------------------------------------------------------------------*/
//#include "Nub601.h"
#define kBaseAddress 0x00000000 // Base address of frame buffer for ATI
#define k1bppEntries 0x01 // Number of CLUT entries for 1 bpp
#define k2bppEntries 0x03 // Number of CLUT entries for 2 bpp
#define k4bppEntries 0x0F // Number of CLUT entries for 4 bpp
#define k8bppEntries 0xFF // Number of CLUT entries for 8 bpp
#define k16bppEntries 0xFF // Number of CLUT entries for 8 bpp
#define k24bppEntries 0xFF // Number of CLUT entries for 8 bpp
#define kSenseLineShift 0x04 // ATI sense line shift amount
//==========================================================================
// MMIC monitor values
//==========================================================================
#define kMMIC15Code 0x01 // MMIC Video reg value for 15"
#define kMMIC12Code 0x02 // MMIC Video reg value for 12"
#define kMMIC13Code 0x06 // MMIC Video reg value for 13"
#define kMMIC16Code 0x09 // MMIC Video reg value for 16"
//==========================================================================
// Ariel bit depth values
//==========================================================================
#define kArial1BPPCode 0x01 // MMIC Video reg value for 15"
#define kArial2BPPCode 0x02 // MMIC Video reg value for 12"
#define kArial4BPPCode 0x06 // MMIC Video reg value for 13"
#define kArial8BPPCode 0x09 // MMIC Video reg value for 16"
#define kArial16BPPCode 0x09 // MMIC Video reg value for 16"
//==========================================================================
// ATI hardware video defines
//==========================================================================
#define kDACBaseAddr 0xF9800000 // ACDC address
// #define kADDCBaseAddr (kMySuperSlot | kMazdaLowSpeedBase | 0x00400000)
#define kArielBaseAddr (kMySuperSlot | 0x00000000)
#define kMMICBaseAddr (kMySuperSlot | 0x00000000)
#define kDACAddrReg (kArielBaseAddr | 0x18)
#define kDACDataReg (kArielBaseAddr | 0x38)
#define kDACConfigReg (kArielBaseAddr | 0x58)
#define kDACTestReg (kArielBaseAddr | 0x78)
#define kMMICBaseAddr 0x00000000
#define kATISenseLineBase (kMMICBaseAddr )
//==========================================================================
// ATI Function ProtoTypes
//==========================================================================
void WaitForVBL(void);
OSErr SlamRegisters(UInt8);

View File

@ -0,0 +1,592 @@
/*
File: ATIVideoImp.c
Contains: xxx put contents here xxx
Written by: xxx put writers here xxx
Copyright: © 1993 by Apple Computer, Inc., all rights reserved.
Change History (most recent first):
<1> 11/5/93 fau first checked in
<1> 10/27/93 fau first checked in
<1> 10/19/93 fau first checked in
*/
/*-------------------------------------------------------------------------
*start
*
*Name: ATIVideoImp.c
*Creator: George D. Wilson Jr.
*Date: 6/19/92
*
*Purpose: Contains ATI specific video routines.
*
*Category: Video Hardware Implementation
*File: ATIVideoImp.c
*
*Exports: DoProgramDAC
* DoProgramDACGamma
* DoBuildLinearRamp
* DoGammaCorrectCLUT
* DoProgramEndeavor
* DoProgramACDC
* DoProgramSwatch
* DoEnableVideo
* DoDisableVideo
*
*Locals:
*
*Detailed:
*
*Note:
*
*History:
*
* Date Programmer Modification
* -------- ---------- -----------------------------------------
*
*stop
*-----------------------------------------------------------------------*/
/*-------------------------------------------------------------------------
*
* Includes
*
*-----------------------------------------------------------------------*/
#include <Types.h>
#include <Video.h>
#include <Devices.h>
#include <Errors.h>
#include <OSUtils.h>
#include <Slots.h>
#include <Memory.h>
#include "NubEqu.h"
#include "ATIStdTypes.h"
#include "ATIDrvr.h"
#include "ATIVideo.h"
/*-------------------------------------------------------------------------
*
* Imported Variables
*
*-----------------------------------------------------------------------*/
/*-------------------------------------------------------------------------
*
* Imported Procedures
*
*-----------------------------------------------------------------------*/
extern Ptr FindVideoTimingStruct(UInt8 monitorID, UInt8 theSlot);
extern Ptr GetTimingSBlock(UInt8 monitorID, UInt8 videoMode, UInt8 timingSelector, UInt8 ourSlot);
extern void PruneMonitors(UInt8 monitorID, UInt8 theSlot);
/*-------------------------------------------------------------------------
*
* Local Typedefs and Defines
*
*-----------------------------------------------------------------------*/
/*-------------------------------------------------------------------------
*
* Exported Variables
*
*-----------------------------------------------------------------------*/
/*-------------------------------------------------------------------------
*
* Exported Procedures
*
*-----------------------------------------------------------------------*/
/*-------------------------------------------------------------------------
*
* Local Variables
*
*-----------------------------------------------------------------------*/
/*-------------------------------------------------------------------------
*
* Beginning of Procedure Definitions
*
*-----------------------------------------------------------------------*/
/*-------------------------------------------------------------------------
*start
*
*Name: DoProgramDAC
*Creator: George D. Wilson Jr.
*Date: 5/28/92
*
*Purpose: Sends the specified CLUT to the hardware CLUT.
*
*Category:
*File: ATIDrvrImp.c
*
*Calls:
*
*Called By:
*
*Entry:
*
*Alters:
*
*Exit: void
*
*Detailed:
*
*Algorithm:
*
*Note:
*
*History:
*
* Date Programmer Modification
* -------- ---------- -----------------------------------------
*
*stop
*-----------------------------------------------------------------------*/
void
DoProgramDAC(ColorSpecPtr ctPtr, UInt16 numEntries, UInt16 start, Boolean indexMode)
{
UInt32 i;
UInt32 *clutReg;
UInt32 *clutAddrReg;
UInt32 dummy;
// DebugStr("\pDoProgramDAC");
// bogus code
return;
clutAddrReg = (UInt32 *) kDACAddrReg;
clutReg = (UInt32 *) kDACDataReg; // Point to data register
if ( indexMode ) { // Fill specific CLUT entries
WaitForVBL();
for ( i = 0; i < numEntries; i++ ) {
*clutAddrReg = ctPtr[i].value; // Point to specific CLUT entry
dummy = *clutAddrReg; // HW funnies.
*clutReg = ctPtr[i].rgb.red;
*clutReg = ctPtr[i].rgb.green;
*clutReg = ctPtr[i].rgb.blue;
}
} else { // Fill the CLUT sequencially
*clutAddrReg = start; // Goto the proper clut entry
dummy = *clutAddrReg; // HW funnies.
WaitForVBL();
for ( i = 0; i < numEntries; i++ ) {
*clutReg = ctPtr[i].rgb.red;
*clutReg = ctPtr[i].rgb.green;
*clutReg = ctPtr[i].rgb.blue;
}
}
} /* End of DoProgramDAC */
/*-------------------------------------------------------------------------
*start
*
*Name: DoProgramDACGamma
*Creator: George D. Wilson Jr.
*Date: 5/28/92
*
*Purpose: Programs the specified gamma table into the CLUT DAC.
*
*Category:
*File: ATIDrvrImp.c
*
*Calls:
*
*Called By:
*
*Entry:
*
*Alters:
*
*Exit: void
*
*Detailed:
*
*Algorithm:
*
*Note:
*
*History:
*
* Date Programmer Modification
* -------- ---------- -----------------------------------------
*
*stop
*-----------------------------------------------------------------------*/
void
DoProgramDACGamma(GammaTablePtr gammaPtr)
{
char *redGammaPtr;
UInt32 i;
UInt32 *clutReg;
UInt32 *clutAddrReg;
UInt32 dummy;
UInt16 numEntries;
// DebugStr("\pDoProgramDACGamma");
// bogus
return;
clutAddrReg = (UInt32 *) kDACAddrReg;
clutReg = (UInt32 *) kDACDataReg; // Point to data register
*clutAddrReg = 0; // Point to first CLUT entry
dummy = *clutAddrReg; // HW funnies.
redGammaPtr = gammaPtr->gFormulaData;
redGammaPtr += gammaPtr->gFormulaSize;
numEntries = gammaPtr->gDataCnt;
WaitForVBL();
for ( i = 0; i < numEntries; i++ ) {
*clutReg = redGammaPtr[i];
*clutReg = redGammaPtr[i];
*clutReg = redGammaPtr[i];
}
} /* End of DoProgramDACGamma */
/*-------------------------------------------------------------------------
*start
*
*Name: DoBuildLinearRamp
*Creator: George D. Wilson Jr.
*Date: 5/28/92
*
*Purpose: Sets the specified color spec array to a linear ramp.
*
*Category:
*File: ATIDrvrImp.c
*
*Calls:
*
*Called By:
*
*Entry:
*
*Alters:
*
*Exit: void
*
*Detailed:
*
*Algorithm:
*
*Note:
*
*History:
*
* Date Programmer Modification
* -------- ---------- -----------------------------------------
*
*stop
*-----------------------------------------------------------------------*/
void
DoBuildLinearRamp (ColorSpecPtr ctPtr)
{
UInt16 i;
// DebugStr("\pDoBuildLinearRamp");
for ( i = 0; i < kNumCLUTEntries; i++ ) {
ctPtr[i].value = i;
ctPtr[i].rgb.red = ctPtr[i].rgb.green = ctPtr[i].rgb.blue = i << 8;
}
} /* End of DoBuildLinearRamp */
/*-------------------------------------------------------------------------
*start
*
*Name: DoGammaCorrectCLUT
*Creator: George D. Wilson Jr.
*Date: 5/27/92
*
*Purpose: Applies the specified gamma table to the CLUT passed.
*
*Category:
*File: ATIDrvrImp.c
*
*Calls:
*
*Called By:
*
*Entry:
*
*Alters:
*
*Exit: void
*
*Detailed:
*
*Algorithm:
*
*Note:
*
*History:
*
* Date Programmer Modification
* -------- ---------- -----------------------------------------
*
*stop
*-----------------------------------------------------------------------*/
void
DoGammaCorrectCLUT(UInt16 numEntries, ColorSpecPtr orgCLUTPtr,
ColorSpecPtr corrCLUTPtr,GammaTablePtr gammaPtr)
{
char *redGammaPtr;
char *greenGammaPtr;
char *blueGammaPtr;
UInt16 red,green,blue;
UInt16 i;
// DebugStr("\pDoGammaCorrectCLUT");
for ( i = 0; i < numEntries; i++ ) { // Copy all the needed entries
corrCLUTPtr[i].value = orgCLUTPtr[i].value;
corrCLUTPtr[i].rgb.red = orgCLUTPtr[i].rgb.red;
corrCLUTPtr[i].rgb.green = orgCLUTPtr[i].rgb.green;
corrCLUTPtr[i].rgb.blue = orgCLUTPtr[i].rgb.blue;
}
redGammaPtr = gammaPtr->gFormulaData;
redGammaPtr += gammaPtr->gFormulaSize;
if ( gammaPtr->gChanCnt == 1 ) { // If single channel gamma table
greenGammaPtr = redGammaPtr; // Point all other channels to red
blueGammaPtr = redGammaPtr;
}
if ( gammaPtr->gChanCnt == 3 ) { // If triple channel gamma table
greenGammaPtr = redGammaPtr + gammaPtr->gDataCnt;
blueGammaPtr = greenGammaPtr + gammaPtr->gDataCnt;
}
for ( i = 0; i < numEntries; i++ ) { // Gamma correct each entry
red = corrCLUTPtr[i].rgb.red;
red >>= 8; // Rotate high order bits down
if ( corrCLUTPtr[i].rgb.red & 0x0080 ) { // If low order high bit was set
if ( red != 0x00FF ) red += 1; // If we won't overflow add one
}
green = corrCLUTPtr[i].rgb.green;
green >>= 8; // Rotate high order bits down
if ( corrCLUTPtr[i].rgb.green & 0x0080 ) { // If low order high bit was set
if ( green != 0x00FF ) green += 1; // If we won't overflow add one
}
blue = corrCLUTPtr[i].rgb.blue;
blue >>= 8; // Rotate high order bits down
if ( corrCLUTPtr[i].rgb.blue & 0x0080 ) { // If low order high bit was set
if ( blue != 0x00FF ) blue += 1; // If we won't overflow add one
}
corrCLUTPtr[i].rgb.red = redGammaPtr[red];
corrCLUTPtr[i].rgb.green = greenGammaPtr[green];
corrCLUTPtr[i].rgb.blue = blueGammaPtr[blue];
}
} /* End of DoGammaCorrectCLUT */
//===========================================================================
// Hardware specific routines.
//===========================================================================
/*-------------------------------------------------------------------------
*start
*
*Name: DoProgramTiming
*Creator: George D. Wilson Jr.
*Date: 4/16/92
*
*Purpose: Programs the Arial and MMIC hardware for the ATI video system.
*
*Category:
*File: ATIDrvrImp.c
*
*Calls:
*
*Called By:
*
*Entry:
*
*Alters:
*
*Exit:
*
*Detailed:
*
*Algorithm:
*
*Note:
*
*History:
*
* Date Programmer Modification
* -------- ---------- -----------------------------------------
*
*stop
*-----------------------------------------------------------------------*/
void DoProgramTiming (UInt32 slotNum, Ptr baseAddr, UInt8 monitorID,
UInt8 videoMode, UInt8 ourSlot, UInt16 rowBytes,
Boolean enableInterrupts)
{
#pragma unused (baseAddr, ourSlot, rowBytes, enableInterrupts)
UInt8 *DACRegPtr;
UInt8 *MMICRegPtr;
UInt8 DACValue;
UInt8 MMICValue;
// DebugStr("\pDoProgramTiming");
// bogus
return;
DACRegPtr = (UInt8 *) (slotNum | kArielBaseAddr);
MMICRegPtr = (UInt8 *) (slotNum | kMMICBaseAddr);
switch ( videoMode ) {
case kFirstVideoMode: DACValue = kArial1BPPCode; break;
case kSecondVideoMode: DACValue = kArial2BPPCode; break;
case kThirdVideoMode: DACValue = kArial4BPPCode; break;
case kFourthVideoMode: DACValue = kArial8BPPCode; break;
case kFifthVideoMode: DACValue = kArial16BPPCode; break;
}
switch ( monitorID ) {
case kRGB1312Connected: MMICValue = kMMIC13Code; break;
case kRGB16Connected: MMICValue = kMMIC16Code; break;
case kRGB15Connected: MMICValue = kMMIC15Code; break;
case kRGB12Connected: MMICValue = kMMIC12Code; break;
}
*DACRegPtr = DACValue;
*MMICRegPtr = MMICValue;
} /* End of DoProgramTiming */
/*-------------------------------------------------------------------------
*start
*
*Name: DoEnableVideo
*Creator: George D. Wilson Jr.
*Date: 4/17/92
*
*Purpose: Turns the video curcuitry on for ATI hardware.
*
*Category:
*File: ATIDrvrImp.c
*
*Calls:
*
*Called By:
*
*Entry:
*
*Alters:
*
*Exit:
*
*Detailed:
*
*Algorithm:
*
*Note:
*
*History:
*
* Date Programmer Modification
* -------- ---------- -----------------------------------------
*
*stop
*-----------------------------------------------------------------------*/
void DoEnableVideo(UInt32 theSlot)
{
UInt32 *SashaRegPtr;
// DebugStr("\pDoEnableVideo");
// bogus
return;
SashaRegPtr = (UInt32 *) (theSlot | kSashaBase);
*SashaRegPtr = (kOutputCtl | kPixelDataOutEn |
kAcDcCSYNCEnable | kAcDcCBLANKEnable |
kAcDcSYNCEnable | kAcDcLoadClkEnable);
*SashaRegPtr = (kSwatchSoftReset | kNormal);
*SashaRegPtr = (kVidPipeReset | kNormal);
} /* End of DoEnableVideo */
/*-------------------------------------------------------------------------
*start
*
*Name: DoDisableVideo
*Creator: George D. Wilson Jr.
*Date: 4/17/92
*
*Purpose: Turns the video curcuitry off for ATI hardware.
*
*Category:
*File: ATIDrvrImp.c
*
*Calls:
*
*Called By:
*
*Entry:
*
*Alters:
*
*Exit:
*
*Detailed:
*
*Algorithm:
*
*Note:
*
*History:
*
* Date Programmer Modification
* -------- ---------- -----------------------------------------
*
*stop
*-----------------------------------------------------------------------*/
void DoDisableVideo(UInt32 theSlot)
{
UInt32 *SashaRegPtr;
// DebugStr("\pDoDisableVideo");
// bogus
return;
SashaRegPtr = (UInt32 *) (theSlot | kSashaBase);
*SashaRegPtr = (kOutputCtl |
kAcDcCSYNCDisable | kAcDcCBLANKDisable |
kAcDcSYNCDisable | kAcDcLoadClkDisable);
*SashaRegPtr = (kSwatchSoftReset | kNormal);
*SashaRegPtr = (kVidPipeReset | kNormal);
} /* End of DoDisableVideo */
/*-------------------------------------------------------------------------
*
* End of Module
*
*-----------------------------------------------------------------------*/

View File

@ -0,0 +1,461 @@
/*
File: Diamond.c
Contains: xxx put contents here xxx
Written by: xxx put writers here xxx
Copyright: © 1994 by Apple Computer, Inc., all rights reserved.
Change History (most recent first):
<1> 1/18/94 CP first checked in
*/
/* Diamond.c */
/*
* C Source Code to drive Diamond board
*/
#include <Types.h>
#include <Quickdraw.h>
#include <Types.h>
#include <Errors.h>
#include <OSUtils.h>
#include "ATIStdTypes.h"
#include "ATI.h"
// vclk = 0x4F349B; // supposedly the value for 39.5 MHz (wrong!)
// vclk = 0x47BCB4; // for a (pre-non-divided) dotclock of 30.24 MHz
// vclk = 0x47BC34; // for a (pre-non-divided) dotclock of 60.48 MHz
// vclk = 0x4D8527; // for a (pre-non-divided) dotclock of 17.457 MHz
void GoDiamond640x480x8VGA(UInt8 devID)
{
unsigned long memSize = 0x2000001; // bing
unsigned long depth = 8; // bing
unsigned long rowBytes = (depth >> 3) * 640; // bing
#if 0
// For now, enable slot D on Bandit 0
*(unsigned long *)0xF2800000 = LByteSwap(0x0848); // Tell Bandit which device
PerformPCIHack();
*(unsigned long *)0xF2C00000 = LByteSwap(0x6000000C); // Set VRAM address in PCI base reg
PerformPCIHack();
#endif
IOLongWrite(0xF2800000, (devID << 12) | 4);
*(unsigned char *)(0xF2C00000) = 0x3;
PerformPCIHack();
IOLongWrite(0xF2800000, (devID << 12) | 0x10);
IOLongWrite(0xF2C00000, kDiamondVRAMAddr);
IOLongWrite(0xF2800000, (devID << 12) | 0x14);
IOLongWrite(0xF2C00000, kDiamondIOAddr);
IOLongWrite(kDiamondInterruptEnable, 0x80); // disable interrupts
IOLongWrite(kDiamondRefreshPeriod, 0x186); // rfperiod
IOLongWrite(kDiamondRasMax, 0xFA); // rlmax
IOLongWrite(kDiamondMemConfig, 0x2); // bing
IOLongWrite(kDiamondSysConfig, 0x563000); // bing
SetupDACDiamond(0x45A8BCD0, depth); // bing
// vga 13"
IOLongWrite(kDiamondHorzLength, 0xC7); // bing
IOLongWrite(kDiamondHorzSyncRisingEdge, 0x17); // bing
IOLongWrite(kDiamondHorzBlankRisingEdge, 0x21); // bing
IOLongWrite(kDiamondHorzBlankFallingEdge, 0xC1); // bing
IOLongWrite(kDiamondHorzCounterPreload, 0x00); // bing
IOLongWrite(kDiamondVertLength, 0x20D); // bing
IOLongWrite(kDiamondVertSyncRisingEdge, 0x01); // bing
IOLongWrite(kDiamondVertBlankRisingEdge, 0x19); // bing
IOLongWrite(kDiamondVertBlankFallingEdge, 0x1F9); // bing
// apple timings
#if 0
IOLongWrite(kDiamondHorzLength, 199); // bing
IOLongWrite(kDiamondHorzSyncRisingEdge, 22); // bing
IOLongWrite(kDiamondHorzBlankRisingEdge, 34); // bing
IOLongWrite(kDiamondHorzBlankFallingEdge, 193); // bing
IOLongWrite(kDiamondHorzCounterPreload, 0x00); // bing
IOLongWrite(kDiamondVertLength, 525); // bing
IOLongWrite(kDiamondVertSyncRisingEdge, 2); // bing
IOLongWrite(kDiamondVertBlankRisingEdge, 34); // bing
IOLongWrite(kDiamondVertBlankFallingEdge, 514); // bing
#endif
IOLongWrite(kDiamondVertCounterPreload, 0x00); // bing
IOLongWrite(kDiamondScreenRepaintTiming, 0x1E5); // bing
// Enable sync's out the connector
*(unsigned char *)(0xF20003C4) = 0x12; // for 0x03C5, offset 0x12
*(unsigned char *)(0xF20003C5) |= 0x10; // bit 4
IOLongWrite(kDiamondPlaneMask, 0xFF);
IOLongWrite(kDiamondDrawMode, 0xA);
// write X and Y minimum (both equal 0)
IOLongWrite(kDiamondWindowMinimum, 0);
// write X maximum (rowBytes - 1) and Y maximum (memSize/rowBytes - 1)
IOLongWrite(kDiamondWindowMaximum,
((rowBytes - 1) << 16) | ((memSize / rowBytes) - 1));
IOLongWrite(0xF2800000, (devID << 12) | 4);
*(unsigned char *)(0xF2C00000) = 0x02;
PerformPCIHack();
}
void GoDiamond640x480x8Apple(UInt8 devID)
{
unsigned long memSize = 0x2000001; // bing
unsigned long depth = 8; // bing
unsigned long rowBytes = (depth >> 3) * 640; // bing
#if 0
// For now, enable slot D on Bandit 0
*(unsigned long *)0xF2800000 = LByteSwap(0x0848); // Tell Bandit which device
PerformPCIHack();
*(unsigned long *)0xF2C00000 = LByteSwap(0x6000000C); // Set VRAM address in PCI base reg
PerformPCIHack();
#endif
IOLongWrite(0xF2800000, (devID << 12) | 4);
*(unsigned char *)(0xF2C00000) = 0x3;
PerformPCIHack();
IOLongWrite(0xF2800000, (devID << 12) | 0x10);
IOLongWrite(0xF2C00000, kDiamondVRAMAddr);
IOLongWrite(0xF2800000, (devID << 12) | 0x14);
IOLongWrite(0xF2C00000, kDiamondIOAddr);
SetupDACDiamond(0x47BCB4D0, depth); // bing
IOLongWrite(kDiamondMemConfig, 0x2); // bing
IOLongWrite(kDiamondSysConfig, 0x563000); // bing
// apple 13"
IOLongWrite(kDiamondHorzSyncRisingEdge, 15); // bing
IOLongWrite(kDiamondHorzBlankRisingEdge, 39); // bing
IOLongWrite(kDiamondHorzBlankFallingEdge, 199); // bing
IOLongWrite(kDiamondHorzLength, 215); // bing
IOLongWrite(kDiamondHorzCounterPreload, 0x00); // bing
IOLongWrite(kDiamondVertSyncRisingEdge, 3); // bing
IOLongWrite(kDiamondVertBlankRisingEdge, 42); // bing
IOLongWrite(kDiamondVertBlankFallingEdge, 522); // bing
IOLongWrite(kDiamondVertLength, 525); // bing
IOLongWrite(kDiamondVertCounterPreload, 0x00); // bing
IOLongWrite(kDiamondScreenRepaintTiming, 0x1E5); // bing
IOLongWrite(kDiamondDrawMode, 0xA);
IOLongWrite(kDiamondPlaneMask, 0xFF);
// write X and Y minimum (both equal 0)
IOLongWrite(kDiamondWindowMinimum, 0);
// write X maximum (rowBytes - 1) and Y maximum (memSize/rowBytes - 1)
IOLongWrite(kDiamondWindowMaximum,
((rowBytes - 1) << 16) | ((memSize / rowBytes) - 1));
IOLongWrite(0xF2800000, (devID << 12) | 4);
*(unsigned char *)(0xF2C00000) = 0x02;
PerformPCIHack();
}
static void SetupDACDiamond(unsigned long vclk, unsigned long depth)
{
short i;
unsigned char *writeReg;
unsigned char *dataReg;
unsigned char cursorCmd;
unsigned char vp, hp; // vertical/horizontal sync polarity
unsigned char getThisDone;
*(unsigned char *)(kBT485Reg0) = 0x82; // 8 bit operation (intead of 6)
PerformPCIHack();
*(unsigned char *)(kBT485Reg2) = 0x30; // PCLK1; data from 32 bit port
PerformPCIHack();
*(unsigned char *)(kRamWrite) = 0x01; // enable command register 3 access
PerformPCIHack();
cursorCmd = (vclk & 0x20) ? 0x08 : 0;
*(unsigned char *)(kBT485Reg3) = cursorCmd;
PerformPCIHack();
switch(depth) {
case 8:
// set DAC into 8 bits per pixel
*(unsigned char *)(kBT485Reg1) = 0x40;
break;
case 16:
// set DAC into 16 bits per pixel
*(unsigned char *)(kBT485Reg1) = 0x30;
break;
case 24:
case 32:
// set DAC into 24/32 bits per pixel
*(unsigned char *)(kBT485Reg1) = 0x10;
break;
}
PerformPCIHack();
*(unsigned char *)(kPixelMask) = 0xFF; // pixel mask register
PerformPCIHack();
// setup up clock bits
vp = (vclk & 0x80) ? NEGATIVE : POSITIVE;
hp = (vclk & 0x40) ? NEGATIVE : POSITIVE;
// Enable sync's out the connector
*(unsigned char *)(0xF20003C4) = 0x12; // for 0x03C5, offset 0x12
getThisDone = *(unsigned char *)0xF20003C5;
PerformPCIHack();
*(unsigned char *)(0xF20003C5) = getThisDone | 0x10;
SetupClockDiamond(vclk >> 8);
#if 0
SetupClockDiamond(0x65D83D); // mem clock = 25Mhz
SetupClockDiamond(0x67B83C);
#endif
SetupClockDiamond(vclk >> 8);
#if 0
*(unsigned char *)(0xF20003C2) = (ReadClockReg()) | (hp << 6) | (vp << 7);
#endif
// a magic number: set bits 6 and 7 to 0 for negative sync polarity
*(unsigned char *)(0xF20003C2) = 0xC;
PerformPCIHack();
if (depth == 8) {
writeReg = (unsigned char *)(0xF20003C8); // kRamWrite
dataReg = (unsigned char *)(0xF20003C9); // kPaletteData
*writeReg = 0;
PerformPCIHack();
for (i = 0; i < 256; i++) {
*dataReg = i; // red
PerformPCIHack();
*dataReg = i; // green
PerformPCIHack();
*dataReg = i; // blue
PerformPCIHack();
}
}
}
unsigned char ReadClockReg(void)
{
unsigned char *ClockSelReg = (unsigned char *)(0xF20003C2);
unsigned char ret;
ret = (*(ClockSelReg + 0xA)); // 0x03C2 is really read from 0x03CC
PerformPCIHack();
return ret;
}
void WriteClockReg(unsigned char whatever, unsigned char serialData, unsigned char serialClock)
{
unsigned char *ClockSelReg = (unsigned char *)(0xF20003C2);
*ClockSelReg = (whatever | (serialData << 3) | (serialClock << 2));
PerformPCIHack();
}
void SetupClockDiamond(unsigned long vclk)
{
short x;
unsigned char whatever;
// Read the current clock reg value to save off bits [7..4] and [1..0]
whatever = ReadClockReg() & 0xF3;
// unlock the clock chip
WriteClockReg(whatever, 1, 1); // Raise the Data bit and the clock bit
for (x = 0; x < 5; x++)
{
WriteClockReg(whatever, 1, 0); // Lower the clock
WriteClockReg(whatever, 1, 1); // Raise the clock
}
// Finish Unlocking
WriteClockReg(whatever, 1, 0);
WriteClockReg(whatever, 0, 0);
WriteClockReg(whatever, 0, 1);
// Start bits
WriteClockReg(whatever, 0, 0); // Clock: hi-lo
WriteClockReg(whatever, 0, 1); // Clock: lo-hi
// Manchester encoding:
// Set SerialData to !vclk[0]; Drop SerialClk to 0; Set SerialData to vclk; Set SerialClock to 1
for (x = 0; x < 24; x++)
{
// write out the inverse of the vclk bit
WriteClockReg(whatever, (vclk & 1) ? 0 : 1, 1);
WriteClockReg(whatever, (vclk & 1) ? 0 : 1, 0);
// write out the vclk bit
WriteClockReg(whatever, (vclk & 1) , 0);
WriteClockReg(whatever, (vclk & 1) , 1);
vclk >>= 1;
}
// Stop bits
WriteClockReg(whatever, 1, 1);
WriteClockReg(whatever, 1, 0);
WriteClockReg(whatever, 1, 1);
}
void GoDiamond640x480x8AppleOld(UInt8 devID);
void GoDiamond640x480x8AppleOld(UInt8 devID)
{
unsigned char *clutData;
unsigned char *clutAddrReg;
unsigned char cursorCmd;
int i;
IOLongWrite(0xF2800000, (devID << 12) | 4);
*(unsigned char *)(0xF2C00000) = 0x3;
PerformPCIHack();
IOLongWrite(0xF2800000, (devID << 12) | 0x10);
IOLongWrite(0xF2C00000, kDiamondVRAMAddr);
IOLongWrite(0xF2800000, (devID << 12) | 0x14);
IOLongWrite(0xF2C00000, kDiamondIOAddr);
// Configure memory space appropriately
IOLongWrite( kDiamondMemConfig, 0x2);
// IOLongWrite( kDiamondSysConfig, (0x6 << 17) | (1 << 13) | (1 << 12));
IOLongWrite( kDiamondSysConfig, (0x563000)); // RowBytes of 640 hardcoded
// Draw Engine parameters
IOLongWrite( kDiamondWindowMinimum, 0);
IOLongWrite( kDiamondWindowMaximum, (639 << 16) | ((0x2000001 / 640) - 1));
IOLongWrite( kDiamondScreenRepaintTiming, 0x1E5);
*(unsigned char *)(0xF2009800) = 0x40; // set DAC into 8 bits per pixel
// set to 0x30 for 16 bpp
// set to 0x10 for 32 bpp
PerformPCIHack();
*(unsigned char *)(0xF2009402) = 0x82; // 8 bit operation (instead of 6)
PerformPCIHack();
*(unsigned char *)(0xF2009801) = 0x32; // PCLK1; data from 32 bit port
PerformPCIHack();
*(unsigned char *)(0xF20003C6) = 0xFF; // pixel mask register
PerformPCIHack();
cursorCmd = 0x04 & !0x08; // 64x64 bit cursor;
// disable 2 times clock
*(unsigned char *)(0xF20003C8) = 0x01; // enable command register 3 access
PerformPCIHack();
*(unsigned char *)(0xF2009802) = cursorCmd;
PerformPCIHack();
clutAddrReg = (UInt8 *)(0xF20003C8); // Point to write-index register
clutData = (UInt8 *)(0xF20003C9); // Point to data register
*clutAddrReg = 0; // Point to the first entry
for ( i = 0; i < 256; i++ ) {
*clutData = i;
PerformPCIHack();
*clutData = i;
PerformPCIHack();
*clutData = i;
PerformPCIHack();
}
// SetupClockW9000();
{
unsigned long data = 0x47BCB4; // for a (pre-non-divided) dotclock of 30.24 MHz
short x;
unsigned char whatever;
// Read the current clock reg value to save off bits [7..4] and [1..0]
whatever = ReadClockReg() & 0xF3;
// unlock the clock chip
WriteClockReg(whatever, 1, 1); // Raise the Data bit and the clock bit
for (x = 0; x < 5; x++)
{
WriteClockReg(whatever, 1, 0); // Lower the clock
WriteClockReg(whatever, 1, 1); // Raise the clock
}
// Finish Unlocking
WriteClockReg(whatever, 1, 0);
WriteClockReg(whatever, 0, 0);
WriteClockReg(whatever, 0, 1);
// Start bits
WriteClockReg(whatever, 0, 0); // Clock: hi-lo
WriteClockReg(whatever, 0, 1); // Clock: lo-hi
// Manchester encoding:
// Set SerialData to !data[0]; Drop SerialClk to 0; Set SerialData to data; Set SerialClock to 1
for (x = 0; x < 24; x++)
{
// write out the inverse of the data bit
WriteClockReg(whatever, (data & 1) ? 0 : 1, 1);
WriteClockReg(whatever, (data & 1) ? 0 : 1, 0);
// write out the data bit
WriteClockReg(whatever, (data & 1) , 0);
WriteClockReg(whatever, (data & 1) , 1);
data >>= 1;
}
// Stop bits
WriteClockReg(whatever, 1, 1);
WriteClockReg(whatever, 1, 0);
WriteClockReg(whatever, 1, 1);
// Enable sync's out the connector
*(unsigned char *)(0xF20003C4) = 0x12; // for 0x03C5, offset 0x12
*(unsigned char *)(0xF20003C5) |= 0x10; // bit 4
}
IOLongWrite( kDiamondHorzSyncRisingEdge, 15);
IOLongWrite( kDiamondHorzBlankRisingEdge, 39);
IOLongWrite( kDiamondHorzBlankFallingEdge, 199);
IOLongWrite( kDiamondHorzLength, 215);
IOLongWrite( kDiamondVertSyncRisingEdge, 3);
IOLongWrite( kDiamondVertBlankRisingEdge, 42);
IOLongWrite( kDiamondVertBlankFallingEdge, 522);
IOLongWrite( kDiamondVertLength, 525);
IOLongWrite(0xF2800000, (devID << 12) | 4);
*(unsigned char *)(0xF2C00000) = 0x2;
PerformPCIHack();
}

View File

@ -0,0 +1,115 @@
/*
File: Diamond.h
Contains: xxx put contents here xxx
Written by: xxx put writers here xxx
Copyright: © 1994 by Apple Computer, Inc., all rights reserved.
Change History (most recent first):
<1> 1/18/94 CP first checked in
*/
/* Diamond.h */
/*
* Diamond board with Weitek 9000 controller header file
*/
#define NEGATIVE 0
#define POSITIVE 1
#define kDiamondCommandVal (kMemoryAccess | kReadWaitCycle)
#define kDiamondVendorID 0x100E
#define kDiamondDeviceID 0x9001
#define kDiamondIOBaseAddr 0x9000
#define kDiamondIOAddr (0x1 | kDiamondIOBaseAddr)
#define kDiamondVRAMAddr 0xE0000000 // same place as ATI
#define kDiamondFBBase (kDiamondVRAMAddr + (1 << 21)) // page 45 Direct frame buffer
#define kDiamondRegBase (kDiamondVRAMAddr + (0x2 << 19))// page 45 control registers
#define kDiamondDrawRegBase (kDiamondVRAMAddr + (0x3 << 19))// page 45 control registers
#define kDiamondMemConfig (kDiamondRegBase + (0x180 + (1 << 2)))
#define kDiamondRefreshPeriod (kDiamondRegBase + (0x180 + (2 << 2)))
#define kDiamondRasMax (kDiamondRegBase + (0x180 + (4 << 2)))
#define kDiamondSysConfig (kDiamondRegBase + (0x1 << 2))
#define kDiamondInterrupt (kDiamondRegBase + (0x2 << 2))
#define kDiamondInterruptEnable (kDiamondRegBase + (0x3 << 2))
#define kDiamondHorzCounter (kDiamondRegBase + (0x100 + (1 << 2)))
#define kDiamondHorzLength (kDiamondRegBase + (0x100 + (2 << 2)))
#define kDiamondHorzSyncRisingEdge (kDiamondRegBase + (0x100 + (3 << 2)))
#define kDiamondHorzBlankRisingEdge (kDiamondRegBase + (0x100 + (4 << 2)))
#define kDiamondHorzBlankFallingEdge (kDiamondRegBase + (0x100 + (5 << 2)))
#define kDiamondHorzCounterPreload (kDiamondRegBase + (0x100 + (6 << 2)))
#define kDiamondVertCounter (kDiamondRegBase + (0x100 + (7 << 2)))
#define kDiamondVertLength (kDiamondRegBase + (0x100 + (8 << 2)))
#define kDiamondVertSyncRisingEdge (kDiamondRegBase + (0x100 + (9 << 2)))
#define kDiamondVertBlankRisingEdge (kDiamondRegBase + (0x100 + (10 << 2)))
#define kDiamondVertBlankFallingEdge (kDiamondRegBase + (0x100 + (11 << 2)))
#define kDiamondVertCounterPreload (kDiamondRegBase + (0x100 + (12 << 2)))
#define kDiamondScreenRepaintAddress (kDiamondRegBase + (0x100 + (13 << 2)))
#define kDiamondScreenRepaintTiming (kDiamondRegBase + (0x100 + (14 << 2)))
#define kDiamondScreenRefreshTiming (kDiamondRegBase + (0x100 + (15 << 2)))
#define kDiamondStatus (kDiamondDrawRegBase + 0x0)
#define kDiamondStatusIssue_qbN (1 << 31)
#define kDiamondStatusBusy (1 << 30)
#define kDiamondStatusPicked (1 << 7)
#define kDiamondStatusPixelSoftware (1 << 6)
#define kDiamondStatusBlitSoftware (1 << 5)
#define kDiamondStatusQuadSoftware (1 << 4)
#define kDiamondStatusQuadConcave (1 << 3)
#define kDiamondStatusQuadHidden (1 << 2)
#define kDiamondStatusQuadVisible (1 << 1)
#define kDiamondStatusQuadIntersects (1 << 0)
#define kDiamondForegroundColor (kDiamondDrawRegBase + (0x200 + (0 << 2)))
#define kDiamondBackgroundColor (kDiamondDrawRegBase + (0x200 + (1 << 2)))
#define kDiamondPlaneMask (kDiamondDrawRegBase + (0x200 + (2 << 2)))
#define kDiamondDrawMode (kDiamondDrawRegBase + (0x200 + (3 << 2)))
#define kDiamondPatternOriginX (kDiamondDrawRegBase + (0x200 + (4 << 2)))
#define kDiamondPatternOriginY (kDiamondDrawRegBase + (0x200 + (5 << 2)))
#define kDiamondRaster (kDiamondDrawRegBase + (0x200 + (6 << 2)))
#define kDiamondPixel8 (kDiamondDrawRegBase + (0x200 + (7 << 2)))
#define kDiamondWindowMinimum (kDiamondDrawRegBase + (0x200 + (8 << 2)))
#define kDiamondWindowMaximum (kDiamondDrawRegBase + (0x200 + (9 << 2)))
#define kDiamondPattern0_1 (kDiamondDrawRegBase + (0x200 + (21<< 2)))
#define kDiamondPattern2_3 (kDiamondDrawRegBase + (0x200 + (22<< 2)))
#define kDiamondPattern4_5 (kDiamondDrawRegBase + (0x200 + (23<< 2)))
#define kDiamondPattern6_7 (kDiamondDrawRegBase + (0x200 + (24<< 2)))
#define kDiamondPattern8_9 (kDiamondDrawRegBase + (0x200 + (25<< 2)))
#define kDiamondPattern10_11 (kDiamondDrawRegBase + (0x200 + (26<< 2)))
#define kDiamondPattern12_13 (kDiamondDrawRegBase + (0x200 + (27<< 2)))
#define kDiamondPattern14_15 (kDiamondDrawRegBase + (0x200 + (28<< 2)))
#define kBT485Reg0 (kDiamondIOBaseAddr | 0xF2000402)
#define kBT485Reg1 (kDiamondIOBaseAddr | 0xF2000800)
#define kBT485Reg2 (kDiamondIOBaseAddr | 0xF2000801)
#define kBT485Reg3 (kDiamondIOBaseAddr | 0xF2000802)
#define kPixelMask (0xF20003C6)
#define kVgaMisc (0xF20003C2)
#define kVgaIndexRead (0xF20003C4)
#define kVgaIndexWrite (0xF20003C5)
#define kRamRead (0xF20003C7)
#define kRamWrite (0xF20003C8)
#define kPaletteData (0xF20003C9)
void InitDiamond(void);
void SetupDACDiamond(unsigned long, unsigned long);
unsigned char ReadClockReg(void);
void WriteClockReg(unsigned char whatever, unsigned char serialData, unsigned char serialClock);
void SetupClockDiamond(unsigned long);
void GoDiamond640x480x8VGA(UInt8);
void GoDiamond640x480x8Apple(UInt8);

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,707 @@
/*
File: PCIUtil.c
Contains: xxx put contents here xxx
Written by: xxx put writers here xxx
Copyright: © 1993 by Apple Computer, Inc., all rights reserved.
Change History (most recent first):
<1> 11/5/93 fau first checked in
<1> 10/27/93 fau first checked in
<1> 10/19/93 fau first checked in
*/
/*-------------------------------------------------------------------------
*start
*
*Name: PrimaryInit.c
*Creator: George D. Wilson Jr.
*Date: 4/23/92
*
*Purpose: Main interface file for ATI video driver primary init.
*
*Category: Macintosh driver
*File: PrimaryInit.c
*
*Exports: main - Main entry point for primary init.
*
*Detailed:
*
*Note:
*
*History:
*
* Date Programmer Modification
* -------- ---------- -----------------------------------------
*
*stop
*-----------------------------------------------------------------------*/
/*-------------------------------------------------------------------------
*
* Includes
*
*-----------------------------------------------------------------------*/
#include <Types.h>
#include <Errors.h>
#include <OSUtils.h>
#include "ATIStdTypes.h"
#include "ATI.h"
/*-------------------------------------------------------------------------
*
* Imported Procedures
*
*-----------------------------------------------------------------------*/
/*-------------------------------------------------------------------------
*
* Beginning of Procedure Definitions
*
*-----------------------------------------------------------------------*/
/*-------------------------------------------------------------------------
*start
*
*Name: PerformPCIHack
*Creator: George D. Wilson Jr.
*Date: 9/22/93
*
*Purpose: Does a read of the CPU ID for the PCI IO problem.
*
*Category:
*File: PCIUtil.c
*
*Calls:
*
*Called By:
*
*Entry:
*
*Alters:
*
*Exit: void
*
*Detailed:
*
*Algorithm:
*
*Note:
*
*History:
*
* Date Programmer Modification
* -------- ---------- -----------------------------------------
*
*stop
*-----------------------------------------------------------------------*/
void
PerformPCIHack()
{
UInt8 *ioReg;
volatile UInt8 dumb;
// DebugStr("\pPerformPCIHack");
ioReg = (UInt8 *) kCPUIDReg;
dumb = *ioReg; // Read CPU ID for PCI hack
dumb = *ioReg; // Read CPU ID for PCI hack
} /* End of PerformPCIHack */
/*-------------------------------------------------------------------------
*start
*
*Name: LByteSwap
*Creator: George D. Wilson Jr.
*Date: 9/13/93
*
*Purpose: Does bytes swapping for endianess of 32 bits
*
*Category:
*File: PCIUtil.c
*
*Calls:
*
*Called By:
*
*Entry:
*
*Alters:
*
*Exit: UInt32
*
*Detailed:
*
*Algorithm:
*
*Note:
*
*History:
*
* Date Programmer Modification
* -------- ---------- -----------------------------------------
*
*stop
*-----------------------------------------------------------------------*/
UInt32
LByteSwap(UInt32 theLong)
{
UInt32 Temp;
// DebugStr("\pLByteSwap");
Temp = ((theLong & 0x000000ff) << 24);
Temp += (((theLong >> 8) & 0x000000ff) << 16);
Temp += (((theLong >> 16) & 0x000000ff) << 8);
Temp += ((theLong >> 24) & 0x000000ff);
return(Temp);
} /* End of LByteSwap */
/*-------------------------------------------------------------------------
*start
*
*Name: WByteSwap
*Creator: George D. Wilson Jr.
*Date: 9/13/93
*
*Purpose: Does bytes swapping for endianess of 16 bits
*
*Category:
*File: PCIUtil.c
*
*Calls:
*
*Called By:
*
*Entry:
*
*Alters:
*
*Exit: UInt16
*
*Detailed:
*
*Algorithm:
*
*Note:
*
*History:
*
* Date Programmer Modification
* -------- ---------- -----------------------------------------
*
*stop
*-----------------------------------------------------------------------*/
UInt16
WByteSwap(UInt16 theWord)
{
UInt16 Temp;
// DebugStr("\pWByteSwap");
Temp = ((theWord & 0x00ff) << 8);
Temp += ((theWord >> 8) & 0x00ff);
return(Temp);
} /* End of WByteSwap */
/*-------------------------------------------------------------------------
*start
*
*Name: IOByteWrite
*Creator: George D. Wilson Jr.
*Date: 9/13/93
*
*Purpose: Writes a byte to the specified IO register.
*
*Category:
*File: PCIUtil.c
*
*Calls:
*
*Called By:
*
*Entry:
*
*Alters:
*
*Exit: void
*
*Detailed:
*
*Algorithm:
*
*Note:
*
*History:
*
* Date Programmer Modification
* -------- ---------- -----------------------------------------
* 9/22/93 George W. Added PCI IO hack
*
*stop
*-----------------------------------------------------------------------*/
void
IOByteWrite(UInt32 theReg, UInt8 theByte)
{
UInt8 *ioReg;
// DebugStr("\pIOByteWrite");
ioReg = (UInt8 *) theReg;
*ioReg = theByte;
PerformPCIHack();
} /* End of IOByteWrite */
/*-------------------------------------------------------------------------
*start
*
*Name: IOWordWrite
*Creator: George D. Wilson Jr.
*Date: 9/13/93
*
*Purpose: Writes a word to the specified IO register.
*
*Category:
*File: PCIUtil.c
*
*Calls:
*
*Called By:
*
*Entry:
*
*Alters:
*
*Exit: void
*
*Detailed:
*
*Algorithm:
*
*Note:
*
*History:
*
* Date Programmer Modification
* -------- ---------- -----------------------------------------
* 9/22/93 George W. Added PCI IO hack
*
*stop
*-----------------------------------------------------------------------*/
void
IOWordWrite(UInt32 theReg, UInt16 theWord)
{
UInt16 *ioReg;
// DebugStr("\pIOWordWrite");
ioReg = (UInt16 *) theReg;
*ioReg = WByteSwap(theWord);
PerformPCIHack();
} /* End of IOWordWrite */
void IOLongWrite(unsigned long theReg, unsigned long bogus)
{
unsigned long *ioReg;
ioReg = (unsigned long *) theReg;
*ioReg = LByteSwap(bogus);
PerformPCIHack();
}
/*-------------------------------------------------------------------------
*start
*
*Name: FindPCICard
*Creator: George D. Wilson Jr.
*Date: 9/13/93
*
*Purpose: Searches all PCI slots for the ATI graphics card.
*
*Category:
*File: PCIUtil.c
*
*Calls:
*
*Called By:
*
*Entry:
*
*Alters:
*
*Exit: UInt8
*
*Detailed:
*
*Algorithm:
*
*Note:
*
*History:
*
* Date Programmer Modification
* -------- ---------- -----------------------------------------
*
*stop
*-----------------------------------------------------------------------*/
UInt8
FindPCICard(UInt16 *type)
{
UInt32 *configRegPtr;
UInt32 *dataRegPtr;
UInt32 data;
UInt32 someValue;
// DebugStr("\pFindPCICard");
configRegPtr = (UInt32 *) kConfigAddressReg;
dataRegPtr = (UInt32 *) kConfigDataReg;
someValue = kPCIVendorIDOffset | (kSecondPCISlot << 12);
*configRegPtr = LByteSwap(someValue); // Tell Bandit which device
data = LByteSwap(*dataRegPtr); // Get Vendor ID
if ( data == (kATIVendorID | (kATIDeviceID << 16)) ) {
*type = kATIVendorID;
return(kSecondPCISlot);
}
if ( data == (kDiamondVendorID | (kDiamondDeviceID << 16)) ) {
*type = kDiamondVendorID;
return(kSecondPCISlot);
}
return(0); // No card found
} /* End of FindPCICard */
/*-------------------------------------------------------------------------
*start
*
*Name: EnableIOAccess
*Creator: George D. Wilson Jr.
*Date: 9/13/93
*
*Purpose: Enables or disables PCI IO/Mem access for a specific PCI card.
*
*Category:
*File: PCIUtil.c
*
*Calls:
*
*Called By:
*
*Entry:
*
*Alters:
*
*Exit: OSErr
*
*Detailed:
*
*Algorithm:
*
*Note:
*
*History:
*
* Date Programmer Modification
* -------- ------