X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Fdrvutil.c;h=7e5b9b185f8e2483be1c509f3414c00fe7c05840;hb=9d85201216cb35e1b1e051b1d7cdc38eaa5befa4;hp=99d02f6235e0b2a69349e8a0ab16ef815cbf6a5f;hpb=b98fbd4e9c71447d81fc9bd643fb174c76346e0f;p=tpg%2Facess2.git diff --git a/Kernel/drvutil.c b/Kernel/drvutil.c index 99d02f62..7e5b9b18 100644 --- a/Kernel/drvutil.c +++ b/Kernel/drvutil.c @@ -64,6 +64,12 @@ Uint64 DrvUtil_Video_2DStream(void *Ent, void *Buffer, int Length, return Length-rem; } + //Log("Handlers->Blit{%}}(%p, %i,%i, %i,%i, %i,%i)", + // Handlers->Blit, Ent, + // *(Uint16*)(&stream[0]), *(Uint16*)(&stream[2]), + // *(Uint16*)(&stream[4]), *(Uint16*)(&stream[6]), + // *(Uint16*)(&stream[8]), *(Uint16*)(&stream[10]) + // ); Handlers->Blit( Ent, *(Uint16*)(&stream[0]), *(Uint16*)(&stream[2]), @@ -112,7 +118,7 @@ Uint64 DrvUtil_ReadBlock(Uint64 Start, Uint64 Length, void *Buffer, return leading; } - Buffer += leading; + Buffer = (Uint8*)Buffer + leading; block ++; num = ( Length - leading ) / BlockSize; tailings = Length - num * BlockSize - leading; @@ -138,7 +144,7 @@ Uint64 DrvUtil_ReadBlock(Uint64 Start, Uint64 Length, void *Buffer, { LOG("Reading %i bytes from last block", tailings); block += num; - Buffer += num * BlockSize; + Buffer = (Uint8*)Buffer + num * BlockSize; ret = ReadBlocks(block, 1, tmp, Argument); if(ret != 1) { LEAVE('X', leading + num * BlockSize); @@ -191,7 +197,7 @@ Uint64 DrvUtil_WriteBlock(Uint64 Start, Uint64 Length, void *Buffer, return leading; } - Buffer += leading; + Buffer = (Uint8*)Buffer + leading; block ++; num = ( Length - leading ) / BlockSize; tailings = Length - num * BlockSize - leading; @@ -217,7 +223,7 @@ Uint64 DrvUtil_WriteBlock(Uint64 Start, Uint64 Length, void *Buffer, { LOG("Writing %i bytes to last block", tailings); block += num; - Buffer += num * BlockSize; + Buffer = (Uint8*)Buffer + num * BlockSize; // Read ret = ReadBlocks(block, 1, tmp, Argument); if(ret != 1) {