2007-01-06 04:10:23 +03:00
|
|
|
encoding_raw:
|
2007-01-08 22:28:20 +03:00
|
|
|
DEBUGF 1,'RAW\n'
|
2007-01-06 04:10:23 +03:00
|
|
|
|
2007-01-08 22:28:20 +03:00
|
|
|
mov ax,[frame.y] ;
|
|
|
|
mov bx,[screen.width] ;
|
2007-01-06 04:10:23 +03:00
|
|
|
mul bx ;
|
|
|
|
shl edx,16 ;
|
2007-01-08 22:28:20 +03:00
|
|
|
mov dx,ax ; [screen.width]*[frame.y]
|
|
|
|
movzx eax,[frame.x]
|
|
|
|
add edx,eax ; [screen.width]*[frame.y]+[frame.x]
|
|
|
|
|
|
|
|
mov eax,3 ;
|
|
|
|
mul edx ; ([screen.width]*[frame.y]+[frame.x])*3
|
|
|
|
|
|
|
|
add eax,framebuffer_data ;
|
|
|
|
push eax ; framebuffer_data+([screen.width]*[frame.y]+[frame.x])*3
|
2007-01-06 04:10:23 +03:00
|
|
|
|
|
|
|
mov ax,[frame.width] ;
|
|
|
|
mov bx,3 ;
|
|
|
|
mul bx ;
|
|
|
|
shl edx,16 ;
|
2007-01-08 22:28:20 +03:00
|
|
|
mov dx,ax ; [frame.width]*3
|
2007-01-06 04:10:23 +03:00
|
|
|
|
2007-01-08 22:28:20 +03:00
|
|
|
pop eax ;
|
|
|
|
add edx,eax ; framebuffer_data+([screen.width]*[frame.y]+[frame.x])*3+[frame.width]*3
|
|
|
|
push eax ;
|
2007-01-06 04:10:23 +03:00
|
|
|
push edx ;
|
2007-01-08 22:28:20 +03:00
|
|
|
|
2007-01-06 04:10:23 +03:00
|
|
|
mov ax,[frame.height] ;
|
2007-01-08 22:28:20 +03:00
|
|
|
dec ax ;
|
2007-01-06 04:10:23 +03:00
|
|
|
mov bx,3 ;
|
|
|
|
mul bx ;
|
|
|
|
mov bx,[screen.width] ;
|
|
|
|
mul bx ;
|
|
|
|
shl edx,16 ;
|
|
|
|
mov dx,ax ;
|
|
|
|
mov ecx,edx ;
|
|
|
|
pop edx ;
|
2007-01-08 22:28:20 +03:00
|
|
|
add ecx,edx ; mov ecx,edx+([frame.height]-1)*[screen.width]*3
|
2007-01-06 04:10:23 +03:00
|
|
|
pop ebx
|
|
|
|
|
|
|
|
.pixelloop32:
|
|
|
|
cmp ebx,ecx
|
|
|
|
jge next_rectangle
|
|
|
|
|
2007-01-08 22:28:20 +03:00
|
|
|
; add esi,2 ; 32 bit code RAW - OK
|
|
|
|
; mov al,[esi] ;
|
|
|
|
; mov [ebx],al ;
|
2007-01-06 04:10:23 +03:00
|
|
|
; inc ebx ;
|
2007-01-08 22:28:20 +03:00
|
|
|
; dec esi ;
|
2007-01-06 04:10:23 +03:00
|
|
|
; ;
|
|
|
|
; mov al,[esi] ;
|
|
|
|
; mov [ebx],al ;
|
|
|
|
; inc ebx ;
|
2007-01-08 22:28:20 +03:00
|
|
|
; dec esi ;
|
2007-01-06 04:10:23 +03:00
|
|
|
; ;
|
|
|
|
; mov al,[esi] ;
|
|
|
|
; mov [ebx],al ;
|
|
|
|
; inc ebx ;
|
2007-01-08 22:28:20 +03:00
|
|
|
; add esi,4 ;
|
|
|
|
|
|
|
|
; push ecx ; 16 bit code RAW
|
|
|
|
; mov cl,51
|
|
|
|
;
|
|
|
|
; mov ax,[esi] ;
|
|
|
|
; xchg al,ah
|
|
|
|
; and al,00011111b ;
|
|
|
|
; xchg al,ah
|
|
|
|
; mul cl
|
|
|
|
; mov [ebx],al ;
|
|
|
|
; inc ebx ;
|
|
|
|
;
|
|
|
|
; mov ax,[esi] ;
|
|
|
|
; xchg al,ah
|
|
|
|
; shr ax,5 ;
|
|
|
|
; xchg al,ah
|
|
|
|
; and al,00011111b ;
|
|
|
|
; mul cl
|
|
|
|
; mov [ebx],al ;
|
|
|
|
; inc ebx ;
|
|
|
|
;
|
|
|
|
; mov ax,[esi] ;
|
|
|
|
; xchg al,ah
|
|
|
|
; shr ax,10 ;
|
|
|
|
; and al,00011111b ;
|
|
|
|
; mul cl
|
|
|
|
; mov [ebx],al ;
|
|
|
|
; inc ebx ;
|
|
|
|
;
|
|
|
|
; inc esi ;
|
2007-01-06 04:10:23 +03:00
|
|
|
; inc esi ;
|
2007-01-08 22:28:20 +03:00
|
|
|
; pop ecx
|
|
|
|
|
|
|
|
push ecx ; 8 bit code RAW - OK
|
|
|
|
mov cl,85 ;
|
|
|
|
;
|
|
|
|
mov al,[esi] ;
|
|
|
|
shr al,4 ;
|
|
|
|
and al,3 ;
|
|
|
|
mul cl ;
|
|
|
|
mov [ebx],al ;
|
|
|
|
inc ebx ;
|
|
|
|
;
|
|
|
|
mov al,[esi] ;
|
|
|
|
shr al,2 ;
|
|
|
|
and al,3 ;
|
|
|
|
mul cl ;
|
|
|
|
mov [ebx],al ;
|
|
|
|
inc ebx ;
|
|
|
|
;
|
|
|
|
mov al,[esi] ;
|
|
|
|
and al,3 ;
|
|
|
|
mul cl ;
|
|
|
|
mov byte[ebx],al ;
|
|
|
|
inc ebx ;
|
|
|
|
inc esi ;
|
|
|
|
pop ecx ;
|
2007-01-06 04:10:23 +03:00
|
|
|
|
|
|
|
|
|
|
|
cmp ebx,edx
|
|
|
|
jl .pixelloop32
|
|
|
|
|
|
|
|
push edx
|
|
|
|
push ebx
|
|
|
|
mov ax,[screen.width]
|
|
|
|
mov bx,3
|
|
|
|
mul bx
|
|
|
|
shl edx,16
|
|
|
|
mov dx,ax
|
|
|
|
mov eax,edx
|
|
|
|
pop ebx
|
|
|
|
pop edx
|
|
|
|
|
|
|
|
add ebx,eax ; eax = [screen.width]*3
|
|
|
|
add edx,eax
|
|
|
|
|
|
|
|
push edx
|
|
|
|
push ebx
|
|
|
|
mov ax,[frame.width]
|
|
|
|
mov bx,3
|
|
|
|
mul bx
|
|
|
|
shl edx,16
|
|
|
|
mov dx,ax
|
|
|
|
mov eax,edx
|
|
|
|
pop ebx
|
|
|
|
pop edx
|
|
|
|
|
|
|
|
sub ebx,eax ; eax = [frame.width]*3
|
|
|
|
|
|
|
|
jmp .pixelloop32
|
|
|
|
|
|
|
|
|
|
|
|
|