Important: The information in this document is obsolete and should not be used for new development.
SFindDevBase
You can use theSFindDevBase
function to determine the base address of a slot device.
FUNCTION SFindDevBase (spBlkPtr: SpBlockPtr): OSErr;
- spBlkPtr
- A pointer to a Slot Manager parameter block.
--> spSlot
SignedByte
The slot number. --> spId
SignedByte The sResource ID. <-- spResult
LongInt The device base address. DESCRIPTION
TheSFindDevBase
function returns the base address of a device, using information contained in the sResource. Use of the base address is optional (except for video cards) and device-specific. For a video card this must be the base address for the pixel map in the card'sGDevice
record (which is described in Inside Macintosh: Imaging With QuickDraw.) For other types of cards, the base address is defined by the card designer. The Slot Manager makes no use of this information.The base address consists of the card's slot address plus an optional offset that the card designer can specify using the
MinorBaseOS
orMajorBaseOS
entries of the sResource. See Table 2-4 on page 2-55 for a description of how the Slot Manager calculates the base address.You specify the slot in the
spSlot
field of the Slot Manager parameter block you point to in thespBlkPtr
parameter, and the sResource ID with thespId
field.
TheSFindDevBase
function returns the base address in thespResult
field of the parameter block.
- Note
- The base address of a slot device is also stored in the
dCtlDevBase
field of the device control entry. TheInsertSRTRec
function automatically updates thedCtlDevBase
field when a new record is added to the slot resource table. You need to callSFindDevBase
only if you used theSUpdateSRTRec
function to update the slot resource table.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for theSFindDevBase
function are
Trap macro Selector _SlotManager $001B You must set up register D0 with the routine selector and register A0 with the address of the Slot Manager parameter block. When
_SlotManager
returns, register D0 contains the result code.
Registers on entry A0 Address of the parameter block D0 $001B
Registers on exit D0 Result code RESULT CODES
noErr 0 No error smEmptySlot
-300 No card in this slot SEE ALSO
For more information about how the device base address is calculated, see the description of theInsertSRTRec
function on page 2-54.