X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=AcessNative%2Facesskernel_src%2Fvideo.c;h=b1b65b01e6fdc90ce99cdd98c78f0be5459ef2fa;hb=82be808714198ab884748f14f06abf458a3c5d59;hp=5408b56e3cbe9bbb0aad04dff8efd01a1907efcd;hpb=51ab5f489bc356940c95cc936fd0508e8f07ea97;p=tpg%2Facess2.git diff --git a/AcessNative/acesskernel_src/video.c b/AcessNative/acesskernel_src/video.c index 5408b56e..b1b65b01 100644 --- a/AcessNative/acesskernel_src/video.c +++ b/AcessNative/acesskernel_src/video.c @@ -14,8 +14,8 @@ // === PROTOTYPES === int Video_Install(char **Arguments); -Uint64 Video_Read(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer); -Uint64 Video_Write(tVFS_Node *Node, Uint64 Offset, Uint64 Length, const void *Buffer); +size_t Video_Read(tVFS_Node *Node, Uint64 Offset, size_t Length, void *Buffer, Uint Flags); +size_t Video_Write(tVFS_Node *Node, Uint64 Offset, size_t Length, const void *Buffer, Uint Flags); int Video_IOCtl(tVFS_Node *Node, int ID, void *Data); // --- 2D Acceleration Functions -- void Video_2D_Fill(void *Ent, Uint16 X, Uint16 Y, Uint16 W, Uint16 H, Uint32 Colour); @@ -55,7 +55,7 @@ int Video_Install(char **Arguments) /** * \brief Read from framebuffer (unimplemented) */ -Uint64 Video_Read(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer) +size_t Video_Read(tVFS_Node *Node, Uint64 Offset, size_t Length, void *Buffer, Uint Flags) { return 0; } @@ -63,7 +63,7 @@ Uint64 Video_Read(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer) /** * \brief Write to the framebuffer */ -Uint64 Video_Write(tVFS_Node *Node, Uint64 Offset, Uint64 Length, const void *Buffer) +size_t Video_Write(tVFS_Node *Node, Uint64 Offset, size_t Length, const void *Buffer, Uint Flags) { int i; ENTER("pNode XOffset XLength pBuffer", Node, Offset, Length, Buffer); @@ -166,10 +166,12 @@ Uint64 Video_Write(tVFS_Node *Node, Uint64 Offset, Uint64 Length, const void *Bu LOG("buffer = %p", Buffer); + Offset /= 4; startX = Offset % giUI_Width; startY = Offset / giUI_Width; - - if( Length + startX < giUI_Width ) + Length /= 4; + + if( startX + Length < giUI_Width ) { // Single line UI_BlitBitmap( @@ -177,6 +179,15 @@ Uint64 Video_Write(tVFS_Node *Node, Uint64 Offset, Uint64 Length, const void *Bu Length, 1, Buffer); } + else if( startX == 0 ) + { + int lines = Length / giUI_Width; + int rem = Length % giUI_Width; + UI_BlitBitmap(0, startY, giUI_Width, lines, Buffer); + if( rem ) { + UI_BlitBitmap(0, startY + lines, rem, 1, (Uint32*)Buffer + lines*giUI_Width); + } + } else { // First scanline (partial or full)