git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Modules/ISADMA - Removed commented out cli/sti
[tpg/acess2.git]
/
Kernel
/
drvutil.c
diff --git
a/Kernel/drvutil.c
b/Kernel/drvutil.c
index
85d4434
..
e86f9a8
100644
(file)
--- a/
Kernel/drvutil.c
+++ b/
Kernel/drvutil.c
@@
-4,28
+4,29
@@
*/
#define DEBUG 0
#include <acess.h>
*/
#define DEBUG 0
#include <acess.h>
-#include <
tpl
_drv_disk.h>
-#include <
tpl
_drv_video.h>
+#include <
api
_drv_disk.h>
+#include <
api
_drv_video.h>
// === CODE ===
// --- Video Driver Helpers ---
Uint64 DrvUtil_Video_2DStream(void *Ent, void *Buffer, int Length,
tDrvUtil_Video_2DHandlers *Handlers, int SizeofHandlers)
{
// === CODE ===
// --- Video Driver Helpers ---
Uint64 DrvUtil_Video_2DStream(void *Ent, void *Buffer, int Length,
tDrvUtil_Video_2DHandlers *Handlers, int SizeofHandlers)
{
-
Uint8
*stream = Buffer;
+
void
*stream = Buffer;
int rem = Length;
int op;
while( rem )
{
rem --;
int rem = Length;
int op;
while( rem )
{
rem --;
- op = *stream++;
+ op = *(Uint8*)stream;
+ stream = (void*)((tVAddr)stream + 1);
if(op > NUM_VIDEO_2DOPS) {
Log_Warning("DrvUtil", "DrvUtil_Video_2DStream: Unknown"
" operation %i", op);
}
if(op > NUM_VIDEO_2DOPS) {
Log_Warning("DrvUtil", "DrvUtil_Video_2DStream: Unknown"
" 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;
Log_Warning("DrvUtil", "DrvUtil_Video_2DStream: Driver does"
" not support op %i", op);
return Length-rem;
@@
-46,13
+47,13
@@
Uint64 DrvUtil_Video_2DStream(void *Ent, void *Buffer, int Length,
Handlers->Fill(
Ent,
Handlers->Fill(
Ent,
-
*(Uint16*)(&stream[0]), *(Uint16*)(&stream[2])
,
-
*(Uint16*)(&stream[4]), *(Uint16*)(&stream[6])
,
- *(Uint32*)(&stream[8])
+
((Uint16*)stream)[0], ((Uint16*)stream)[1]
,
+
((Uint16*)stream)[2], ((Uint16*)stream)[3]
,
+ ((Uint32*)stream)[2]
);
rem -= 12;
);
rem -= 12;
- stream
+= 12
;
+ stream
= (void*)((tVAddr)stream + 12)
;
break;
case VIDEO_2DOP_BLIT:
break;
case VIDEO_2DOP_BLIT:
@@
-64,21
+65,15
@@
Uint64 DrvUtil_Video_2DStream(void *Ent, void *Buffer, int Length,
return Length-rem;
}
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,
Handlers->Blit(
Ent,
-
*(Uint16*)(&stream[0]), *(Uint16*)(&stream[2])
,
-
*(Uint16*)(&stream[4]), *(Uint16*)(&stream[6])
,
- *(Uint16*)(&stream[8]), *(Uint16*)(&stream[10])
+
((Uint16*)stream)[0], ((Uint16*)stream)[1]
,
+
((Uint16*)stream)[2], ((Uint16*)stream)[3]
,
+ ((Uint16*)stream)[4], ((Uint16*)stream)[5]
);
rem -= 12;
);
rem -= 12;
- stream
+= 12
;
+ stream
= (void*)((tVAddr)stream + 12)
;
break;
}
break;
}
@@
-118,7
+113,7
@@
Uint64 DrvUtil_ReadBlock(Uint64 Start, Uint64 Length, void *Buffer,
return leading;
}
return leading;
}
- Buffer
+=
leading;
+ Buffer
= (Uint8*)Buffer +
leading;
block ++;
num = ( Length - leading ) / BlockSize;
tailings = Length - num * BlockSize - leading;
block ++;
num = ( Length - leading ) / BlockSize;
tailings = Length - num * BlockSize - leading;
@@
-144,7
+139,7
@@
Uint64 DrvUtil_ReadBlock(Uint64 Start, Uint64 Length, void *Buffer,
{
LOG("Reading %i bytes from last block", tailings);
block += num;
{
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);
ret = ReadBlocks(block, 1, tmp, Argument);
if(ret != 1) {
LEAVE('X', leading + num * BlockSize);
@@
-197,7
+192,7
@@
Uint64 DrvUtil_WriteBlock(Uint64 Start, Uint64 Length, void *Buffer,
return leading;
}
return leading;
}
- Buffer
+=
leading;
+ Buffer
= (Uint8*)Buffer +
leading;
block ++;
num = ( Length - leading ) / BlockSize;
tailings = Length - num * BlockSize - leading;
block ++;
num = ( Length - leading ) / BlockSize;
tailings = Length - num * BlockSize - leading;
@@
-223,7
+218,7
@@
Uint64 DrvUtil_WriteBlock(Uint64 Start, Uint64 Length, void *Buffer,
{
LOG("Writing %i bytes to last block", tailings);
block += num;
{
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) {
// Read
ret = ReadBlocks(block, 1, tmp, Argument);
if(ret != 1) {
UCC
git Repository :: git.ucc.asn.au