packed file IO -------------- These are io functions that are used to load multiple files which were previously compiled into one massive file. The utility to create the massive file (no compression) is included, called "packit.c". To make a packed file just use the packit.exe within a directory of files to pack. Give it a parameter of a file to output to, but don't put this file in the current dir or it will be packed up also (that would be fatal). EG: packit ..\data.000 Then use the following functions to load in data.000 and the files within. pack_init,nooffiles:word - initalizes the system. You must give a # specifing how many files can be loaded within the packed files which will be opened pack_open - loads a packed file so that the files within can be opened Once you've inited and opened data files just simple use open() to open the files within. What happens is that if open cannot find the file in the packed file it then allows DOS to attempt to open the file as usually. If it does find it, it returns the already open handle and lseeks the file to the begining of that file within the pack file. If an attempt is made to close the file it is just ignored and returned successful. This is very useful because you can use other routines such as 'gloadfnt' with a file within a packed file and it will use it just like any other file. One last note, the packed files are opened in read only mode with Pack_open and there is a current limit of opening 16 packed files (you set the limit of how many files within the pack files can be loaded with pack_init). Therefore: -pack_open can be called only 16 times (or more if you change pack.asm in the lib\src dir. and recompile the libs) -the total # of files within all packed files opened must be less than the number given to pack_init NOTE: Pack.asm keeps internal vars set to the current file opened and therefore only one file can be opened at a time from with in the packed files. The actual handles for each packed file are kept open. When anything tries to open one of them pack.asm just returns the handle and lseeks the pack file to the proper position. Plus any lseek done on the file is handled properly. If a file is contained in two or more packed files the most recently opened pack file will be used instead. This is good for adding patches to games and other stuff. (like how DOOM adds wads which simple overides files) If a file exists within a packed file and this file also exists in the current directory then you will only be able to load the one in the packed file. (unless you have not called pack_init)