X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Fdrvutil.c;h=e86f9a87148a57dc1af34ad24941b0bb0e912226;hb=e6795eb552a6be88b7870dae14a958ab391bfae8;hp=bac78948e0a72a9a42185faa001817257c2ad89b;hpb=82adac267bc089391397b36413bba210a8e7c68f;p=tpg%2Facess2.git diff --git a/Kernel/drvutil.c b/Kernel/drvutil.c index bac78948..e86f9a87 100644 --- a/Kernel/drvutil.c +++ b/Kernel/drvutil.c @@ -4,8 +4,8 @@ */ #define DEBUG 0 #include -#include -#include +#include +#include // === CODE === // --- Video Driver Helpers --- @@ -26,7 +26,7 @@ Uint64 DrvUtil_Video_2DStream(void *Ent, void *Buffer, int Length, " operation %i", op); } - if(op*4 > SizeofHandlers) { + if(op*sizeof(void*) > SizeofHandlers) { Log_Warning("DrvUtil", "DrvUtil_Video_2DStream: Driver does" " not support op %i", op); return Length-rem; @@ -49,7 +49,7 @@ Uint64 DrvUtil_Video_2DStream(void *Ent, void *Buffer, int Length, Ent, ((Uint16*)stream)[0], ((Uint16*)stream)[1], ((Uint16*)stream)[2], ((Uint16*)stream)[3], - ((Uint32*)stream)[4] + ((Uint32*)stream)[2] ); rem -= 12; @@ -57,7 +57,7 @@ Uint64 DrvUtil_Video_2DStream(void *Ent, void *Buffer, int Length, break; case VIDEO_2DOP_BLIT: - if(rem < 16) return Length-rem; + if(rem < 12) return Length-rem; if(!Handlers->Blit) { Log_Warning("DrvUtil", "DrvUtil_Video_2DStream: Driver" @@ -72,8 +72,8 @@ Uint64 DrvUtil_Video_2DStream(void *Ent, void *Buffer, int Length, ((Uint16*)stream)[4], ((Uint16*)stream)[5] ); - rem -= 16; - stream = (void*)((tVAddr)stream + 16); + rem -= 12; + stream = (void*)((tVAddr)stream + 12); break; }