MIDAS for FreePascal port
by Udo Giacomozzi (e-mail, home)
(DOS version)
 
 
Sample MP3 player now available - click here

Finally also the MIDAS library can be released as I've got the permission from Housemarque Inc.
For an introduction and to download the files go to my homepage at http://come.to/jampy

IMPORTANT! Before using MIDAS / FPC be sure to read the original MIDAS license. When you download the library you agree you've read the license and you agree to all terms of the license. If you don't you can't download the library files.

Please read this page carefully. It contains inportant information on how to install MIDAS/FPC.

This library is freeware.

Please sign my guestbook if you want use MIDAS/FPC. Thanx :-)


Download

You will need two archives: One for the MIDAS binaries including FPC inport unit and the original MIDAS archive for the documentation.

Download MIDAS/FPC
This includes everything you need to compile a program using MIDAS/FPC:

Download the original MIDAS package
You will need this package for the documentation of the MIDAS functions.

Unpacking
After downloading the files you have to unpack (unzip) the files because they are compressed using the PKZIP utility. Unpack the archives to two different, empty subdirectories, keeping directory structures (switch -d).


Installation

MIDAS/FPC requires special installation steps for use with FPC. This is because it's libraries define functions that are already defined by the FPC RTL. The linker will abort with an error message if this is not fixed. To avoid this problems a file from the FPC RTL must be changed. Don't be afraid! This operation can be undoed very easily.
Now, the file to be altered is v2prt0.asin directory rtl\go32v2. You can download the pre-modified file including batch files here.
The archive contains 3 files:
 
v2prt0c.as altered v2prt0.as file
prt_orig.bat  batch file to restore original prt0.o
prt_new.bat batch file to switch to the altered version
Unpack the files to the rtl\go32v2 directory or wherever your prt0.o file is (no files should be overwritten).

Update: You  need the FPC compiler sources to compile prt0.o. If you don't have the sources, download this little archive that contains the two files need (sbrk16.ah and exit16.ah)

Please keep the following in mind:

If you try to compile a MIDAS/FPC program without calling prt_new before, the FPC linker will abort with a error message like this:
Linking test.exe
.\/libmidas.a(midas.o)(.data+0x98):midas.c: multiple definition of `_crt0_startup_flags'
E:\FPK\rtl\go32v2\prt0.o(.data+0xb2):v2prt0.as: first defined here
test.pp(142,1) Warning: Error while linking
As you can see the function _crt0_startup_flags is defined by the FPC RTL file prt0.o and by the midas library. That's why v2prt0.as has to be modified.
The same happens when compiling a normal program with the altered version of prt0.o:
E:\FPK\rtl\go32v2\prt0.o(.text+0x88):v2prt0.as: undefined reference to `_crt0_startup_flags'


How to use

When you compile a program that uses MIDAS you must tell the compiler/linker where the libraries (*.a) are. You can do that with the -Fl switch.
Example:
ppc386 test -Flmidas\lib
In this example, the libraries (libxa.a, ...) are in the subfolder xaudio\lib. Note that even if the libaries are in the current path you have to that that to the linker:
ppc386 test -Fl.
That's all. Have a look at the sample program(s) to learn how to use MIDAS and read the MIDAS documantation. If you have any questions, feel free to contact me at ugcm@usa.net !


This page is Copyright © Udo Giacomozzi
Last updated: 05.08.1999
Homepage: http://come.to/jampy
e-mail: ugcm@usa.net