home *** CD-ROM | disk | FTP | other *** search
- ;; -*- package: NotInROM -*-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; +Sound.Lisp
- ;;
- ;; Copyright ⌐ 1991 Northwestern University Institute for the Learning Sciences
- ;; All Rights Reserved
- ;;
- ;; author: Michael S. Engber
- ;;
- ;; Provides missing Sound Manager Routines
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
- (eval-when (:compile-toplevel :load-toplevel :execute)
- (require :NotInROM-u)
- (in-package :NotInROM))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
- (deftrap-NotInROM _GetSoundVol :none ((level (:pointer :signed-integer)))
- (%put-word level (%get-unsigned-byte (%int-to-ptr #$SdVolume))))
-
-
- (deftrap-NotInROM _SetSoundVol :none ((level :signed-integer))
- (rlet ((pb :ParamBlockRec
- :ioCompletion (%null-ptr)
- :ioRefNum -4
- :csCode 2))
- (%put-word (pref pb :ParamBlockRec.csParam) level)
- (#_PBControl pb)))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
- ;;This one is taken pretty much straight from interfaces.lisp.
- ;;I don't claim to understand how it works.
- ;;
- ;;IM II p.232 outlines an approach, but doesn't say exactly how
- ;;to get the most recent pb. Presumably, #x0AE8 is the address of
- ;;a ptr to ptr to the param block of the most recent sound driver call.
- ;;
- ;;The SoundDriver is considered obsolete now (and at some point will be
- ;;removed), so you probably shouldn't be using this call anyway.
-
- (deftrap-NotInROM _SoundDone :Boolean ()
- (let ((pb (%get-long (%int-to-ptr #x0AE8))))
- (or (= pb -1)
- (<= (pref (%get-ptr (%int-to-ptr pb)) :ParamBlockRec.ioResult) 0))))
-