home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 2: PC
/
frozenfish_august_1995.bin
/
bbs
/
d07xx
/
d0744.lha
/
FO2
/
Sources_FO2
/
BitMap.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-10-12
|
859b
|
54 lines
#include "defs.h"
Prototype BitMap();
Prototype SetBinBM(WORD bloc,LONG *adrbm);
BitMap()
{
struct DiskList *dlist;
struct RootB *adr;
WORD n;
LONG *buffbm,SBM=0;
buffbm=BBM;
dlist=whereB(880);
if (dlist==0) NotSet(880,9);
adr=dlist->dl_AdrB;
adr->BitMapTable[0]=881L;
adr->BMvalid=-1;
/*printf("GFree: %d DFree: %d\n",GFree,DFree);*/
for (n=0;n!=56;n++) buffbm[n]=-1L; /* on nettoye le BitMap */
for (n=56;n!=128;n++) buffbm[n]=0L;
if (DFree<880)
{
for (n=0;n<DFree;n++) SetBinBM(n,buffbm);
}
else
{
for (n=0;n!=880;n++) SetBinBM(n,buffbm);
for (n=DFree+1;n!=1761;n++) SetBinBM(n,buffbm);
}
for (n=880;n!=GFree;n++) SetBinBM(n,buffbm);
buffbm[0]=0L;
for (n=0;n!=128;n++)
{
SBM+=buffbm[n];
}
buffbm[0]=-SBM;
}
SetBinBM(bloc,adrbm)
WORD bloc;
LONG *adrbm;
{
adrbm++;
adrbm[(bloc-2)/32] &= ~(1<< ( (bloc-2)%32 ));
}