SLB 'devkit' ?

GFA, ASM, STOS, ...

Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team

JeanMars
Atari freak
Atari freak
Posts: 53
Joined: Fri Apr 09, 2010 5:15 pm
Location: France
Contact:

SLB 'devkit' ?

Postby JeanMars » Mon Sep 10, 2018 6:44 am

Hi,

I need to use SLB shared libraries for Mint/Magic but slb.h is missing on my Aranym (comes from EasyMint) install.
So I am wondering how to get the devkit (I'm using PureC) and have SLB available on my install.
Googled that a bit but did not find any valuable information, can someone explain this to me or point me to the web resource I may have missed?

Thanks,
Jean

mikro
Atari God
Atari God
Posts: 1729
Joined: Sat Sep 10, 2005 11:11 am
Location: Kosice, Slovakia
Contact:

Re: SLB 'devkit' ?

Postby mikro » Mon Sep 10, 2018 8:50 am

Look here: http://toshyp.atari.org/en/00b017.html

There you can find not only some information but also the mentioned slb.h

JeanMars
Atari freak
Atari freak
Posts: 53
Joined: Fri Apr 09, 2010 5:15 pm
Location: France
Contact:

Re: SLB 'devkit' ?

Postby JeanMars » Mon Sep 10, 2018 8:50 pm

Hi,

looks like there is everything I need to understand, thanks!

ThorstenOtto
Captain Atari
Captain Atari
Posts: 400
Joined: Sun Aug 03, 2014 5:54 pm

Re: SLB 'devkit' ?

Postby ThorstenOtto » Tue Sep 11, 2018 8:58 am

JeanMars wrote:slb.h is missing on my Aranym (comes from EasyMint) install.


Actually its from mintlib, and rather short. For Pure-C, you can use this one

Code: Select all

/* 
 * Copyright (C) 2000 Konrad Kokoszkiewicz <draco@atari.org.pl>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the Free
 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
 * MA 02111-1307, USA
 *
 */

# ifndef _MINT_SLB_H
# define _MINT_SLB_H 1

/* MagiC 5.20 Share Library Support */

typedef struct _slb_handle { int dummy; } *SLB_HANDLE, *SHARED_LIB;
typedef long  cdecl (*SLB_EXEC)(SLB_HANDLE slb, long fn, short nwords, ...);

typedef struct {
   SLB_HANDLE   handle;
   SLB_EXEC   exec;
} SLB;


long _slbopen (const char *fname, const char *path, long ver, void *hnd, void *exec);


# endif /* mint/slb.h */




The only difference to the original is the "cdecl" keyword. If you get compile errors there, you have to turn off -A (ansi keywords only), but take care that Pure-C then also does not define __STDC__. The _slbopen() function is just a wrapper to the gemdos function, which you may also need:

Code: Select all

            GLOBL   Slbopen      /* Magic 5.20 */
            GLOBL   Slbclose   /* Magic 5.20 */
            
            MODULE   Slbopen
            pea      (a2)
            move.l   12(a7),-(a7)
            move.l   12(a7),-(a7)
            move.l   d0,-(a7)
            move.l   a1,-(a7)
            move.l   a0,-(a7)
            move.w   #$16,-(a7)
            trap #1
            lea      22(a7),a7
            move.l   (a7)+,a2
            rts
            ENDMOD
                        
            MODULE   Slbclose
            pea      (a2)
            move.l   a0,-(a7)
            move.w   #$17,-(a7)
            trap #1
            addq.l   #6,a7
            move.l   (a7)+,a2
            rts
            ENDMOD


and also the declaration somewhere:

Code: Select all

/* MagiC 5.20 Share Library Support */
long Slbopen(const char *name, const char *path, long min_ver, SLB_HANDLE *slb, SLB_EXEC *slbexec); /* GEMDOS 0x16 */
long Slbclose(SLB_HANDLE slb);            /* GEMDOS 0x17 */


how to get the devkit

I'm not aware of any "devkit", there has only been some example code for MagiC.


Social Media

     

Return to “Coding”

Who is online

Users browsing this forum: No registered users and 3 guests