mac-rom/Drivers/Video/JMFBDepVideoEqu.a
Elliot Nunn 4325cdcc78 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.
2017-12-26 09:52:23 +08:00

512 lines
18 KiB
Plaintext

;
; File: JMFBDepVideoEqu.a
;
; Contains: Hardware-specific equates for the 4¥8/8¥24 Cards.
;
; Written by: Casey King/Mike Puckett
;
; Copyright: © 1986-1993 by Apple Computer, Inc., all rights reserved.
;
; This file is used in these builds: Mac32
;
;
; Change History (most recent first):
;
; <SM2> 6/14/93 kc Roll in Ludwig.
; <LW2> 3/24/93 mal Removed block xfer equ's that are now in ROMEqu.a.
; <1> 1/7/92 RB first checked in
; =============== Terror History ========================
;
; <4> 4/4/91 jmp Cleaned up conditional assembly stuff (i.e., started using
; ForRom instead of PadForOverPatch).
; <3> 2/25/91 jmp Rolled in CaseyÕs latest version, and extracted out the
; TERROR-ROM only stuff (to be INCLUDEÕd from ComVideoEqu.a).
; <2> 1/7/91 jmp Prior to my last full build and checking this file in, I somehow
; deleted the word ÒVersionÓ from ÒRAMVersionÓ in this file
; causing the TERROR build to break. Oops. I guess IÕll do builds
; AFTER I check things back in next time. Sorry BG.
; <1> 1/6/91 jmp Checked into TERROR ROM for first time.
; <0> 11/19/90 jmp Formatted for use with TERROR ROM (as opposed to a
; declaration ROM), removed duplicate equates, etcÉ.
;-------------------------------------------------------------------
;
; (c) Apple Computer, Inc. 1986-1990
; All rights reserved.
;
;-------------------------------------------------------------------
;
; File : ElmerRom.a
; Author : Casey KIng
;
; These are the configuration ROM equates that are specific only to
; the MegaDeth Video Card. This includes mode information such as
; resolution and physical rowbytes, as well as hardware control
; registers on the card itself.
;
;-------------------------------------------------------------------
; Mod History :
;
; Refer to Projetor change history for revision details
;-------------------------------------------------------------------
If ForROM Then
Include 'ComVideoEqu.a'
EndIf
;---------------------------------------------------
;
; Rowbytes and page count constants
;
; These constants are closely interrelated, so check them carefully.
;
;---------------------------------------------------
; Kong rowbytes as a f(mode)
OBM100RB EQU 144
TBM100RB EQU 288
FBM100RB EQU 576
EBM100RB EQU 1152
TFBM100RB EQU 0
; Portrait rowbytes as a f(mode)
OBM57RB EQU 80
TBM57RB EQU 160
FBM57RB EQU 320
EBM57RB EQU 640
TFBM57RB EQU 0
; Standard rowbytes as a f(mode)
OBM30RB EQU 80
TBM30RB EQU 160
FBM30RB EQU 320
EBM30RB EQU 640
TFBM30RB EQU 2560 ; 2560 for quickdraw, 1920 for JMFB
; Rubik rowbytes as a f(mode)
OBM16RB EQU 64
TBM16RB EQU 128
FBM16RB EQU 256
EBM16RB EQU 512
TFBM16RB EQU 2048
; Exact non convolved PAL overscan (768 x 576) rowbytes as a f(mode).
OBM14RB EQU 1024
TBM14RB EQU 1024
FBM14RB EQU 1024
EBM14RB EQU 0
TFBM14RB EQU 0
; Exact non convolved PAL underscan (616 x 518) rowbytes as a f(mode).
OBM14uRB EQU 1024 ; round 77 up to power of 2
TBM14uRB EQU 1024 ; round 154 up to power of 2
FBM14uRB EQU 1024 ; round 308 up to power of 2
EBM14uRB EQU 1024
TFBM14uRB EQU 2560 ; ** use the same value as rs170, because the exact value (2456) is incompatible
; ** with the size of the JMFB rowbytes register (long aligned).
; Convolution cases for PAL rowbytes as a f(mode)
OBM14CRB EQU 1024
TBM14CRB EQU 1024
FBM14CRB EQU 1024
EBM14CRB EQU 1024
TFBM14CRB EQU 0
; Exact NTSC rowbytes as a f(mode). These are not used.
OBM12RB EQU 80
TBM12RB EQU 160
FBM12RB EQU 320
EBM12RB EQU 640
TFBM12RB EQU 2560 ; 2560 for quickdraw, 1920 for JMFB
; NTSC rowbytes as a f(mode)
OBM12CRB EQU 1024
TBM12CRB EQU 1024
FBM12CRB EQU 1024
EBM12CRB EQU 1024
TFBM12CRB EQU 2560
; All page counts are now zero based!!! Only GetPage will return nonzero based counts!
; Kong page counts as a f(mode)
OBMPages100A EQU 3
OBMPages100B EQU 7
TBMPages100A EQU 1
TBMPages100B EQU 3
FBMPages100A EQU 0
FBMPages100B EQU 1
EBMPages100A EQU -1 ; not enough memory so its an invalid mode
EBMPages100B EQU 0
TFBMPages100A EQU -1 ; invalid mode so page count is invalid
TFBMPages100B EQU -1 ; invalid mode so page count is invalid
; Portrait page counts as a f(mode)
OBMPages57A EQU 6
OBMPages57B EQU 14
TBMPages57A EQU 2
TBMPages57B EQU 6
FBMPages57A EQU 0
FBMPages57B EQU 2
EBMPages57A EQU -1
EBMPages57B EQU 0
TFBMPages57A EQU -1
TFBMPages57B EQU -1
; Standard page counts as a f(mode)
OBMPages30A EQU 12
OBMPages30B EQU 26
TBMPages30A EQU 5
TBMPages30B EQU 12
FBMPages30A EQU 2
FBMPages30B EQU 5
EBMPages30A EQU 0
EBMPages30B EQU 2
TFBMPages30A EQU -1
TFBMPages30B EQU 0
; Rubik page counts as a f(mode)
OBMPages16A EQU 20
OBMPages16B EQU 41
TBMPages16A EQU 9
TBMPages16B EQU 20
FBMPages16A EQU 4
FBMPages16B EQU 9
EBMPages16A EQU 1
EBMPages16B EQU 4
TFBMPages16A EQU -1
TFBMPages16B EQU 0
; PAL page counts as a f(mode), u stands for underscan, otherwise overscan
OBMPages14A EQU 0
OBMPages14Au EQU 0
TBMPages14A EQU 0
TBMPages14Au EQU 0
FBMPages14A EQU 0
FBMPages14Au EQU 0
EBMPages14A EQU 0
EBMPages14Au EQU 0
TFBMPages14A EQU -1
TFBMPages14Au EQU -1
TFBMPages14Bu EQU 0 ; there is no overscan PAL 24 bpp!
; PAL Convolution page counts as a f(mode)
OBMPages14CB EQU 0
TBMPages14CB EQU 0
FBMPages14CB EQU 0
EBMPages14CB EQU 0
TFBMPages14CB EQU -1
; NTSC page counts as a f(mode)
OBMPages12A EQU 0 ; use same rowbytes as convolution
OBMPages12B EQU 1
TBMPages12A EQU 0
TBMPages12B EQU 1
FBMPages12A EQU 0
FBMPages12B EQU 1
EBMPages12A EQU 0
EBMPages12B EQU 1
TFBMPages12A EQU -1
TFBMPages12B EQU 0
; Convolution page counts as a f(mode)
OBMPages12CA EQU 0
OBMPages12CB EQU 1
TBMPages12CA EQU 0
TBMPages12CB EQU 1
FBMPages12CA EQU 0
FBMPages12CB EQU 1
EBMPages12CA EQU 0
EBMPages12CB EQU 1
TFBMPages12CA EQU -1
TFBMPages12CB EQU -1
; Invalid page count
InvalPageCnt EQU -1
; Gray Screen Patterns
OneBitGray EQU $AAAAAAAA
TwoBitGray EQU $CCCCCCCC
FourBitGray EQU $F0F0F0F0
EightBitGray EQU $FF00FF00
TwentyFourBitGray EQU $00000000 ; upper byte is padding and is not used
; note 24 bpp dither appears backwards, but it's not!
; Invalid sRsrc ID (used to build up spID for mode to be disabled in interlaced modes)
InvalidSRsrcID EQU $F0
; Flag bits for sResource ID
fSRsrcBigScrnBit EQU 0 ; indicates if Portrait or Kong monitor (bit0 = 1 if true)
fSRsrcRGBBit EQU 2 ; indicates if monitor is BW or RGB (significant for Big Screens only)
fSRsrcOscanBit EQU 3 ; indicates if in interlaced overscan mode (must be interlaced mode)
fSRsrc24Bit EQU 4 ; indicates whether the sRsrc is based on 24 bit address or 32
fSRsrcXMemBit EQU 5 ; indicates whether the sRsrc is extended memory or not
fSRsrcMSBBit EQU 7 ; simply the most significant bit of the 8 bit sResource ID
; Raw Sense Line IDs
RGBKong EQU 0 ; raw sense line combo for RGBKong
Kong EQU 3 ; reformated sense line for all Kongs (x11)
Portrait EQU 1 ; reformated sense line for all Portraits (x01)
Standard EQU 6
_NTSC_ EQU 4
Rubik EQU 2
NoSense EQU 7
Sarnoff EQU $14 ; breakout box xtnd sense = 010100
PAL EQU $00 ; breakout box PAL xtnd sense = 000000
PALmonitor EQU $30 ; PAL monitor xtnded sense code = 110000
; Reformatted Sense Line ID's
rRGBKong EQU 7
rPAL EQU 0
; monitor sense mask for sResource ID (low 3 bits)
monSenseMask EQU 7
; Value for b1:b0 in reformatted sense line ID to signify interlaced monitor connect (low 2 bits)
interlacedScreen EQU 0 ; (bits 0:1 = 0, refer to Karnaugh map in ERS)
; Mode IDs (zero based)
Mode1BPP EQU 0
Mode2BPP EQU 1
Mode4BPP EQU 2
Mode8BPP EQU 3
Mode24BPP EQU 4
; Mode Depth IDs
Depth1BPP EQU 1
Depth2BPP EQU 2
Depth4BPP EQU 4
Depth8BPP EQU 8
Depth24BPP EQU 16
; Miscellaneous
LongDelay EQU 1000 ; long delay used in pinit h/w setup due to natl clk setup
ShortDelay EQU 5 ; short delay used in drvr
sRsrcDisable EQU 1 ; used to tell the slot mgr to disable a sRsrc
readBC EQU 4 ; used in the xtended sense scheme (drive a hi, read b and c)
readAC EQU 2 ; used in the xtended sense scheme (drive b hi, read a and c)
readAB EQU 1 ; used in the xtended sense scheme (drive c hi, read a and b)
;---------------------------------------------------
;
; Screen configuration / Bounds information
;
;---------------------------------------------------
defmBounds_T100 EQU 0 ; top in 100MHz mode
defmBounds_L100 EQU 0 ; left in 100MHz mode
defmBounds_B100 EQU 870 ; bottom in 100MHz mode
defmBounds_R100 EQU 1152 ; right in 100MHz mode
defmBounds_T57 EQU 0 ; top in 58MHz mode
defmBounds_L57 EQU 0 ; left in 58MHz mode
defmBounds_B57 EQU 870 ; bottom in 58MHz mode
defmBounds_R57 EQU 640 ; right in 58MHz mode
defmBounds_T30 EQU 0 ; top in 30MHz mode
defmBounds_L30 EQU 0 ; left in 30MHz mode
defmBounds_B30 EQU 480 ; bottom in 30MHz mode
defmBounds_R30 EQU 640 ; right in 30MHz mode
defmBounds_T16 EQU 0 ; top in 16MHz mode
defmBounds_L16 EQU 0 ; left in 16MHz mode
defmBounds_B16 EQU 384 ; bottom in 16MHz mode
defmBounds_R16 EQU 512 ; right in 16MHz mode
defmBounds_T14 EQU 0 ; top in 14MHz mode
defmBounds_L14 EQU 0 ; left in 14MHz mode
defmBounds_B14 EQU 576 ; bottom in 14MHz mode
defmBounds_R14 EQU 768 ; right in 14MHz mode
defmBounds_T14u EQU 0 ; top in 14MHz mode
defmBounds_L14u EQU 0 ; left in 14MHz mode
defmBounds_B14u EQU 480 ; bottom in 14MHz mode
defmBounds_R14u EQU 640 ; right in 14MHz mode
defmBounds_T12 EQU 0 ; top in 12MHz mode
defmBounds_L12 EQU 0 ; left in 12MHz mode
defmBounds_B12 EQU 480 ; bottom in 12MHz mode
defmBounds_R12 EQU 640 ; right in 12MHz mode
defmBounds_T12u EQU 0 ; top in 12MHz mode
defmBounds_L12u EQU 0 ; left in 12MHz mode
defmBounds_B12u EQU 384 ; bottom in 12MHz mode
defmBounds_R12u EQU 512 ; right in 12MHz mode
defmBounds_T12C EQU 0 ; top in 12MHz mode
defmBounds_L12C EQU 0 ; left in 12MHz mode
defmBounds_B12C EQU 480 ; bottom in 12MHz mode
defmBounds_R12C EQU 640 ; right in 12MHz mode
defVersion EQU 0 ; Version = 0
; The format of the following fields is upper 16 bits = integer part, and lower 16 bits = fractional part
defmHRes12 EQU $480000 ; (72 dpi) Horizontal Pixels/inch
defmVRes12 EQU $480000 ; (72 dpi) Vertical pixels/inch
defmHRes14 EQU $480000 ; (72 dpi) Horizontal Pixels/inch
defmVRes14 EQU $480000 ; (72 dpi) Vertical pixels/inch
defmHRes16 EQU $480000 ; (72 dpi) Horizontal Pixels/inch
defmVRes16 EQU $480000 ; (72 dpi) Vertical pixels/inch
defmHRes30 EQU $480000 ; (72 dpi) Horizontal Pixels/inch
defmVRes30 EQU $480000 ; (72 dpi) Vertical pixels/inch
defmHRes57 EQU $500000 ; (80 dpi) Horizontal Pixels/inch for Portrait Display
defmVRes57 EQU $500000 ; (80 dpi) Vertical pixels/inch for Portrait Display
defmHRes100 EQU $4D0000 ; (77 dpi) Horizontal Pixels/inch for 2-Page Display
defmVRes100 EQU $4D0000 ; (77 dpi) Vertical pixels/inch for 2-Page Display
defPixelType EQU 0 ; pixeltype=chunky
chunkyDirect EQU 16 ; pixeltype=chunky direct
defCmpCount EQU 1 ; Number of components in pixel
defmPlaneBytes EQU 0 ; Offset from one plane to the next
defmVertRefRate EQU 75 ; Vert refresh rate
defmDevType EQU 0 ; 0 = CLUTType
;---------------------------------------------------
;
; Hardware Definitions
;
;---------------------------------------------------
defMinorBase EQU 0 ; Video RAM Offset is 0
defmBaseOffset EQU 2560 ; base offset for the little screens (12,14,16, and 30 MHz)
defmBaseOffset12 EQU $2000 ; Offset to base of vRAM for NTSC/PAL convolution only
convBOfix EQU $1400 ; Base offset correction for interlaced convolution
specBaseOffset12 EQU 2560 ; Special base offset for ntsc to be used in 24 bpp
defmBaseOffsetBS EQU $80 ; Offset to base of vRAM for the big screens (Kong and Portrait)
defMinorLengthA EQU $80000 ; Video RAM length on 512K card
defMinorLengthB EQU $100000 ; Video RAM length on 1024K card
ROMSize EQU $4000 ;16K byte ROM
JMFB EQU $200000 ; Offset to JMFB Control Registers
Stopwatch EQU $200100 ; Offset to Stopwatch Registers
CLUT EQU $200200 ; Offset to CLUT Registers
Endeavor EQU $200300 ; Offset to Endeavor Registers
JMFBCSR EQU $00 ; Offset to Control and Status Register
JMFBLSR EQU $04 ; Offset to Load/Sync Register
JMFBVideoBase EQU $08
JMFBRowWords EQU $0C
SWICReg EQU $3C ; Offset to Stopwatch Interrupt/Control Register
SWStatusReg EQU $C0 ; Offset to Stopwatch Status Registers (used to read Interrupt state)
SWClrVInt EQU $48 ; Offset to Stopwatch Clear Vertical Interrupt
; Special bits in the JMFBCSReg and Stopwatch. Refer to the parameter documentation and the
; software ERS for a description of these flags and their importance in the hardware
; initialization process.
REFEN EQU $8 ; Refresh enable bit in JMFBCSR word
VIDGO EQU $40 ; VideoTransfer Cycle Enable bit in JMFBCSR word
PIXSEL1 EQU $2000 ; Endeavor reset bit (in the Natl board it's used to select 100 MHz or Natl)
VRSTB EQU $8000 ; Master reset bit in JMFBCSR word
MaskSenseLine EQU $F1FF ; Masks off the 3 bit sense line in JMFB CSR
SRST EQU 0 ; soft reset for Stopwatch
ENVERTI EQU 1 ; enable vertical interrupts for Stopwatch
CLRNMRQ EQU 0 ; clear NMRQ~ interrupt for Stopwatch
; Offsets to the CLUT registers
CLUTAddrReg EQU $00 ; Offset to CLUT Address Register
CLUTDataReg EQU $04 ; Offset to CLUT Data Register
CLUTPBCR EQU $08 ; Offset to CLUT Pixel Bus Control Register
; Offsets to the Endeavor registers
EndeavorM EQU $00 ; Offset to Endeavor M register
EndeavorN EQU $04 ; Offset to Endeavor N register
EndeavorExtClkSel EQU $08 ; Offset to Endeavor External Clock Select
EndeavorReserved EQU $0C ; Endeavor Reserved
EndeavorID EQU $00
NationalID EQU $FFFF
ROM EQU $F0000
; RAM test locations
TestPos EQU 1002240 ; Right past 1152x870 first page
; Equates that are used in the driver for offsets to private storage which
; is stored in the dCtlStorage field of the DCE. It must be placed here
; since 2ndInit must patch the DCE if it is the startup screen and we
; would like to use the symbolic reference. The assembler does not do
; forward referencing tho.
saveMode EQU 0 ; the current mode setting
savePage EQU saveMode+2 ; the current page setting
saveBaseAddr EQU savePage+2 ; the current base address
saveSQElPtr EQU saveBaseAddr+4 ; the SQ element pointer (for _SIntRemove).
saveGammaPtr EQU saveSQElPtr+4 ; the pointer to the Gamma correction table
GFlags EQU saveGammaPtr+4 ; flags word
saveVidParms EQU GFlags+2 ; pointer to video configuration data
saveID EQU saveVidParms+4 ; saved sense value
saveHardBase EQU saveID+2 ; hardware base address
saveMonSense EQU saveHardBase+4 ; reformatted sense line combo from videoOpen
moreGFlags EQU saveMonSense+2
saveGammaPtrHead EQU moreGFlags+2
dCtlSize EQU saveGammaPtrHead+4 ; size of dCtlStorage
; Flags within GFlags word
GrayFlag EQU 15 ; luminance mapped if GFlags(GrayFlag) = 1
IntDisFlag EQU 14 ; interrupts disabled if GFlags(IntFlag) =1
RAM512KFlag EQU 13 ; 512K vidRAM if GFlags(RAM512K) = 1
MonoFlag EQU 12 ; true if monochrome monitor
Interlaced EQU 11 ; true if 12MHz NTSC mode
DirectModeFlag EQU 10 ; true if direct mode (24 BPP) otherwise indexed
BigScreen EQU 9 ; true if Kong or Portrait, false otherwise
sRsrc32Bit EQU 8 ; true if the spID indicates it's a 32 bit sRsrc
; Flags within moreGFlags word
UnderScanFlag EQU 15
ConvOnFlag EQU 14
PALFlag EQU 13
NationalFlag EQU 12
;
; Glue for slot manager and 32 BQD
;
UnImplTrapNum EQU $09F ; low 10 bits of trap number for NGetTrapAddress
UnNamedQD32Trap EQU $303 ; low 10 bits of trap number for NGetTrapAddress
; new IDs for NuBus Block Transfer capability
;sBlockTransferInfo EQU 20
;sMaxBlockTransferCount EQU 21 ; Trident doesn't use this one (board and video sRsrc level)
;mBlockTransferInfo EQU 5
;mMaxBlockTransferCount EQU 6 ; Trident doesn't use this one (parameter list level)
allSlaveBlockSizes EQU $0000800F ; has slave block and suports 16,8,4,2 long xfers
noSlaveBlockSizes EQU $00008000
savedMode EQU 2 ; VendorUse1 offset into sPRAM record
savedSRsrcID EQU 3 ; VendorUse2 offset into sPRAM record
savedRawSRsrcID EQU 4 ; VendorUse3 offset into sPRAM record
specialFlag EQU 5
savedClockType EQU 6
;
; card-specific ID's
;
NameMacIIResID EQU 512
NameUScanResID EQU 513
NameOScanResID EQU 514
NamePortraitResID EQU 515
NameKongResID EQU 516
NameRubikResID EQU 517
NamePALUScanResID EQU 518
NamePALOScanResID EQU 519
StdGammaResID EQU 1024
KongGammaResID EQU 1025
PortraitGammaResID EQU 1026
RubikGammaResID EQU 1027
NTSCGammaResID EQU 1028