English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. Blitz Basic

 
 
Thread Tools
Old 10 September 2019, 19:21   #1
peceha
Registered User

peceha's Avatar
 
Join Date: Dec 2017
Location: Poland
Age: 43
Posts: 161
[Blitz] Accessing external library

Hi,
is it possible to use external library in Blitz?
Let's say I'd like to open prisma.library and have some fun with it

so far:
Code:
*prisma.Library = OpenLibrary_("prisma.library",0)
If *prisma
  ;-----------------
  ;what should I write here?
  ;------------------

  CloseLibrary_(*prisma)
EndIf
End
Thanks
peceha is online now  
Old 10 September 2019, 22:40   #2
Daedalus
Registered User

Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 4,123
If you have the .fd file for the library, there's a tool included with Blitz that can make a wrapper Blitz command library containing all the prisma library's functions in it. That's how I've done it in the past, though using the library directly would be nicer...
Daedalus is offline  
Old 10 September 2019, 23:26   #3
peceha
Registered User

peceha's Avatar
 
Join Date: Dec 2017
Location: Poland
Age: 43
Posts: 161
Thanks Daedalus.
In the meantime I found one post (very old) in Prisma Megamix thread about what you just said:

Quote:
Quote:
Originally Posted by amigakit.com View Post
Also Prisma has a nice Arexx interface so programs can control Prisma easily. If you are using Backbone, Blitz or anything that supports Arexx, it can be useful.
Nice, but for Blitz we can happily accept the LVO/FD file and therefore you deliver support for Blitz and AmiBlitz natively!
Unfortunately I don't have such file.
Does it mean .. there is no other way?

Thanks.
peceha is online now  
Old 10 September 2019, 23:42   #4
Daedalus
Registered User

Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 4,123
Well, you need some way to read the function table within the library to determine what's contained in it. Usually if a library is meant for external use there will be various support files including the .fd file and some header files that allow a C compiler to use them. Alternatively you can jump directly to the offsets in the jump table, but even then you need to know the offset values. If you don't have any of that stuff, well then there isn't really a way, no.

Those files would usually be included with the library, or sometimes as a separate developers package. I take it they didn't offer the information in that thread? Seems a shame to keep such information to themselves.
Daedalus is offline  
Old 10 September 2019, 23:48   #5
peceha
Registered User

peceha's Avatar
 
Join Date: Dec 2017
Location: Poland
Age: 43
Posts: 161
I will check what's on floppy that was included with Prisma sound card - but I do not recall seeing anything special there.

And will go through that whole thread, but this is going to be boring task since that thread is soooo long.
peceha is online now  
Old 11 September 2019, 07:42   #6
peceha
Registered User

peceha's Avatar
 
Join Date: Dec 2017
Location: Poland
Age: 43
Posts: 161
There is nothing on the floppy.

While checking the thread about prisma all I found is:
Quote:
Here's what you currently need to do to play an OGG Vorbis file:
Code:
PrismaBase = OpenLibrary( "prisma.library", 0L);
Prisma_Init();
Prisma_PlayFile( "GreatMusic.ogg" );
CloseLibrary( PrismaBase);
..which isn't very helpful, is it?
peceha is online now  
Old 11 September 2019, 09:49   #7
Daedalus
Registered User

Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 4,123
Indeed it's not. You still need the header/stub files etc. for that code to work, otherwise the compiler doesn't know how to access those functions.

Incidentally, I was looking for a Prisma card a while ago to do my own development with, but they can't seem to be found any more I was also thinking of writing a Blitz wrapper for it for my own player, as well as potentially developing add-on hardware...
Daedalus is offline  
Old 11 September 2019, 13:38   #8
peceha
Registered User

peceha's Avatar
 
Join Date: Dec 2017
Location: Poland
Age: 43
Posts: 161
So... prisma.library cannot be used but what about mhiprisma.library?
There is a mhi_dev archive on aminet and it includes blitz2 add-on.
Will try that today.
peceha is online now  
Old 11 September 2019, 14:45   #9
Daedalus
Registered User

Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 4,123
Yep, that should work just fine, though I suspect it will limit the formats supported to MP2/3 as MHI appears to be MPEG-specific.
Daedalus is offline  
Old 12 September 2019, 08:05   #10
E-Penguin
Banana

 
Join Date: Jul 2016
Location: Darmstadt
Posts: 832
I guess you could run the library through a disassembler, add the blitz2 function headers then recompile it as a blitz2 library, similar to what was done for the PTPlayer library.
E-Penguin is offline  
Old 12 September 2019, 09:45   #11
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 3,825
No, that's very pointless and against the point of shared libraries. Just ask for the FD file.
idrougge is offline  
Old 13 September 2019, 19:46   #12
E-Penguin
Banana

 
Join Date: Jul 2016
Location: Darmstadt
Posts: 832
It's not pointless in the slightest given that nobody seems to have an fd file
E-Penguin is offline  
Old 13 September 2019, 20:36   #13
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 3,825
Have you tried even asking for the SDK? If it doesn't have FD or header files, it can't be used from any language.
idrougge is offline  
Old 13 September 2019, 21:19   #14
E-Penguin
Banana

 
Join Date: Jul 2016
Location: Darmstadt
Posts: 832
Documentation seems to be bare, to put it mildly. There's allegedly an Arexx port but no documentation for that either.

Disassembling seems to have worked well enough but without an API to go by I can't work out which JMP corresponds to which function.
E-Penguin is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
EDU - External Disk Unit | External gotek for Commodore Amiga with LCD & Sound arananet Amiga scene 7 02 April 2016 21:06
HELP: Opus5, KingCON, SysInfo.library (Sysmon.library) triangle Michael support.Apps 6 10 March 2014 14:08
Mediator - openpci.library and pci.library mardn78 support.Hardware 1 01 February 2014 11:11
Accessing dos.library during boot time Leffmann Coders. General 9 16 February 2009 19:26
Making a shared library from a gcc .a library JoJo Coders. General 1 10 March 2003 19:06

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 08:40.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Page generated in 0.08737 seconds with 15 queries