[net.micro.amiga] Aztec C and Basic Libraries

chicken@deepthot.UUCP (Rob Mowat) (06/01/86)

  Hi, this is my first time on the net, I hope it works
 (is this the password to enter the amiga news network or what?,
  if so, I guess I am in!)

  I (we) have the developer's version of Aztec C and bought it with
the intention of using it to build libraries to use with basic programs.
(First, a little background info, I am an undergrad CS student working in
a psych lab. I assist grad students with program development for use in
vision experiments. The amiga was bought for this lab because of its
graphics capabilities.
The grad students all use basic programs to run their experiments but also
need some functions which basic can't (?) provide e.g. a real-time clock
to measure the subjects' response times hence needing microsecond accuracy.)
End of background info.

   I am wondering if anyone can tell me how to produce a .bmap file from
an Aztec C library file. There was a program included with BasicDemos
called ConvertFD but I am not sure what an .FD file is or even how to make
it.
As well, is there any way to access the other Amiga libraries from Basic.
There was a graphics.bmap and a dos.bmap file included with Basic but not
intuition.bmap (to use the mouse's right key for something other than menus
in BASIC) or any of the other amiga libraries. 

As a further request, if someone has Robert Peck's sample program on
Vsprites, Bobs and Double Buffering could you please post it to the
net or reply to me with it.
                         thanks in advance for any help
                                 chicken

carolyn@cbmvax.cbm.UUCP (Carolyn Scheppner) (06/05/86)

In article <778@deepthot.UUCP> chicken@deepthot.UUCP (Rob Mowat) writes:
>
>  I (we) have the developer's version of Aztec C and bought it with
>the intention of using it to build libraries to use with basic programs.
>...
>   I am wondering if anyone can tell me how to produce a .bmap file from
>an Aztec C library file. There was a program included with BasicDemos
>called ConvertFD but I am not sure what an .FD file is or even how to make
>it.
>As well, is there any way to access the other Amiga libraries from Basic.
>

   What do you mean by "Aztec C library file"?  You can't make a .bmap for
the scannable object libraries that you link with.  Each .bmap is basically
an index for an Amiga run-time library.  Most of the run-time libraries
(graphics.library, dos.library, etc) are loaded in with KickStart.  Others
(diskfont.library, icon.library, etc.) reside in the LIBS: directory of
WorkBench and are loaded when required.  You can also create your own
run-time libraries (see 1.1 RKM  Vol.2  Appendix K).

   An FD file is a text file that describes the functions in a run-time
library.  The functions are listed in the same order as they appear
in the library's function table.  Each is followed by information about
the the parameters passed to the function (descriptions)(registers).
This is a listing of diskfont_lib.fd (contains 2 functions):  

##base _DiskfontBase
##bias 30
##public
OpenDiskFont(textAttr)(A0)
AvailFonts(buffer,bufBytes,flags)(A0,D0/D1)
##end

   The 1.1 FD files were distributed on the 1.1 Amiga C disk.  If you
don't have Amiga C, you may be able to get the FD files from a
users group, a commercial network, or possibly on a Fish or Amicus
public domain disk.

   ConvertFD is an AmigaBasic program that converts FD files to the .bmap 
files required by AmigaBasic for interfacing with system library CALLs.
AmigaBasic uses them to convert your C style CALLs to assembler style
parameters-in-the-registers JSRs to an offset from a library base.

   I will post NewConvertFD, a revised ConvertFD which prepends an "x"
to all system function names known to conflict with AmigaBasic tokens.
When using .bmaps made with NewConvertFD, you can, for example, use
the AmigaDos Open(), Read(), Write(), and Close() functions by calling
xOpen(), xRead(), xWrite(), xClose().  This allows you to implement
absolute binary loads and saves to/from one or many areas of memory.

  
-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Carolyn Scheppner -- CBM   >>Amiga Technical Support<<
                     UUCP  ...{allegra,caip,ihnp4,seismo}!cbmvax!carolyn 
                     PHONE 215-431-9180
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=