Important: The information in this document is obsolete and should not be used for new development.
SFindDevBase
You can use theSFindDevBasefunction to determine the base address of a slot device.
FUNCTION SFindDevBase (spBlkPtr: SpBlockPtr): OSErr;
- spBlkPtr
- A pointer to a Slot Manager parameter block.
--> spSlotSignedByteThe slot number. --> spIdSignedByte The sResource ID. <-- spResultLongInt The device base address. DESCRIPTION
TheSFindDevBasefunction 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'sGDevicerecord (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
MinorBaseOSorMajorBaseOSentries 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
spSlotfield of the Slot Manager parameter block you point to in thespBlkPtrparameter, and the sResource ID with thespIdfield.
TheSFindDevBasefunction returns the base address in thespResultfield of the parameter block.
- Note
- The base address of a slot device is also stored in the
dCtlDevBasefield of the device control entry. TheInsertSRTRecfunction automatically updates thedCtlDevBasefield when a new record is added to the slot resource table. You need to callSFindDevBaseonly if you used theSUpdateSRTRecfunction to update the slot resource table.![]()
ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for theSFindDevBasefunction 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
_SlotManagerreturns, 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 theInsertSRTRecfunction on page 2-54.