Hello Ronald,
Thursday, April 29, 2004, 3:41:38 AM, you wrote:
RCA> Although there are some LZ77 compression sources
RCA> available, does anyone knows what kind of
RCA> modifications (or code) does these compressors need to
RCA> be decompressed directly to VRAM? (like the VRAM safe
RCA> option in the GBA Crusher) .
RCA> I know its related tot the fact that the compressed
RCA> data should not reference to the previous byte in the
RCA> uncompressed data because it may not have been written
RCA> yet by 16-bit, VRAM sized BIOS function.
I just made functions to read/write bytes from/to VRAM
static int ReadVRAM(unsigned char *pData)
{
unsigned char *pRead = (unsigned char*)(((int)pData)&0xfffffffe);
unsigned short tmp = *(unsigned short*)pRead;
if (pRead == pData)
{
return (tmp&0xff);
}
return (tmp>>8);
}
static void WriteVRAM(unsigned char *pDest, int byte)
{
//Get aligned address
unsigned short *pVram = (short*)((int)(pDest)&0xfffffffe);
unsigned short tmp = *pVram;
if ((unsigned char*)pVram==pDest)
{
*pVram = ((tmp&0xff00)+byte);
}
else
{
*pVram = (tmp&0xff)+(byte<<8);
}
}
--
Best regards,
Aleksey mailto:vivid@...