Blitz (392/459)

From:David McMinn
Date:25 Jan 2000 at 18:34:31
Subject:Re: Using .fd converted libs

Hi George

I've cleaned up your code a bit, I think some of the commands for
freeing things were in the wrong place. They should only be called if
you are successful in getting them, apart from CloseDevice which
according to the autodocs should always be done to match with
opendevice. Hmm, don't know if thats right though. Apart from that it
all looks fine. Don't have the docs to check the way you've used the
library though.

The real problem is probably in the IOStdReq newtype. I'm sure there
are unions in it that hasn't been converted properly in the latest
version of amigalibs.res, so the size will be wrong. James Boyd has a
fixed version, or its in one of his archives on Aminet (for playing
aroung setting the mouse position).

; amigalibs.res is resident
INCLUDE "cdplayer.h.bb2" ;contains some structures,changed to blitz
format

DEFTYPE .Library *CDPlayerBase
DEFTYPE .IOStdReq *CD_Request
DEFTYPE .MsgPort *CD_Port

*CDPlayerBase=OpenLibrary_("cdplayer.library",0)
If *CDPlayerBase
NPrint "lib ok" : VWait 5
*CD_Port.MsgPort=CreateMsgPort_

If *CD_Port
*CD_Request.IOStdReq=CreateIORequest_(*CD_Port,(SizeOf .IOStdReq))
NPrint "port ok" : VWait 5

If *CD_Request
NPrint "IO request ok" : VWait 5
err.l=OpenDevice_("atapi.device",2,*CD_Request,0)
If err=0

;command from the converted cdplayer.library .fd file
; \/ \/
CDEject_ *CD_Request ;GURU! Line 1111 emulator ,or
;GURU! Address error. :(
MouseWait
EndIf
CloseDevice_ *CD_Request
DeleteIORequest_ *CD_Request
EndIf
DeleteMsgPort_ *CD_Port
EndIf
CloseLibrary_ *CDPlayerBase
EndIf



|) /\ \/ ][ |) |\/| c |\/| ][ |\| |\| | dave@satanicdreams.com
http://members.xoom.com/David_McMinn | ICQ=16827694
This is your father's lightsaber. When you absolutely, positively, have to
kill every motherfuckin' stormtrooper in the room... accept no substitutes.
- Samuel L. Jackson, Jedi

---------------------------------------------------------------------
To unsubscribe, e-mail: blitz-list-unsubscribe@netsoc.ucd.ie
For additional commands, e-mail: blitz-list-help@netsoc.ucd.ie