imgtools/romtools/rombuild/r_rom.cpp
changeset 631 9435b9008a58
parent 617 3a747a240983
child 694 c3fbb20e86f0
equal deleted inserted replaced
630:31ef8a13d4f4 631:9435b9008a58
   561 	aAddr += pageInfoSize;
   561 	aAddr += pageInfoSize;
   562 	}
   562 	}
   563 
   563 
   564 TInt E32Rom::SetupPages()
   564 TInt E32Rom::SetupPages()
   565 	{
   565 	{
   566 	iHeader->iPageableRomStart = 0;
   566 	iHeader->iPageableRomStart = iSizeUsed;
   567 	iHeader->iPageableRomSize = 0;
   567 	iHeader->iPageableRomSize = 0;
   568 	iHeader->iDemandPagingConfig = gDemandPagingConfig;
   568 	iHeader->iDemandPagingConfig = gDemandPagingConfig;
   569 
   569 
   570 	if(!gPagedRom)
   570 	if(!gPagedRom)
   571 		return KErrNone;
   571 		return KErrNone;
   635 		TUint8* src = (TUint8*) iHeader + pi->iDataStart;
   635 		TUint8* src = (TUint8*) iHeader + pi->iDataStart;
   636 		memcpy(dest, src, pi->iDataSize);
   636 		memcpy(dest, src, pi->iDataSize);
   637 		pi->iDataStart = prev->iDataStart + prev->iDataSize;
   637 		pi->iDataStart = prev->iDataStart + prev->iDataSize;
   638 		}
   638 		}
   639 	TInt relSize = pi->iDataStart + pi->iDataSize;
   639 	TInt relSize = pi->iDataStart + pi->iDataSize;
       
   640 	if (relSize == 0)//no page is compressed
       
   641 		relSize = iSizeUsed;
   640 
   642 
   641 	memset((TUint8*)iHeader + relSize, 0xff, iSizeUsed - relSize);
   643 	memset((TUint8*)iHeader + relSize, 0xff, iSizeUsed - relSize);
   642 	TInt compression = (iSizeUsed >= 1000) ? (relSize*10)/(iSizeUsed/1000) : (relSize*10000)/iSizeUsed;
   644 	TInt compression = (iSizeUsed >= 1000) ? (relSize*10)/(iSizeUsed/1000) : (relSize*10000)/iSizeUsed;
   643 	Print(EAlways, "%d.%02d%%\n", compression/100, compression%100);
   645 	Print(EAlways, "%d.%02d%%\n", compression/100, compression%100);
   644 	iSizeUsed = relSize;
   646 	iSizeUsed = relSize;