mov ebx, pSource ;; this is only here so the assembler doesn't tell me about un-used parameters. (I'm to lazy to figure out how to turn the warning off)
mov ebx, Count ;; ebx = number of times to copy the buffers
mov eax, Pitch ;; eax = the pitch of the dest
top_o_loop1:
mov edx, pDest ;; edx = pointer to the dest
mov ecx, sWidth
VerLine1:
mov edi, edx ;; load the pDest
mov esi, Height
pixel1:
mov byte ptr[edi],0 ;; store the byte (zeros are nice)
add edi, eax ;; skip to the next line
dec esi ;; are we done with this colum?
jnz pixel1
inc edx ;; we did the colum. increment the pDest by one
dec ecx ;; are we done with all the colums?
jnz VerLine1
dec ebx ;; did we do it the correct number of times?
jnz top_o_loop1
mov eax, Count ;; return the number of bytes we filled
mov ebx, pSource ;; this is only here so the assembler doesn't tell me about un-used parameters. (I'm to lazy to figure out how to turn the warning off)
mov ebx, Count
xor eax, eax
mov edx, sWidth ;; we want a dword count
shr edx, 2
screen4:
mov esi, pDest ;; re-load the dest
push ebx
mov ebx, Height ;; re-load the height
push ebp
mov ebp, Pitch ;; put this in a register
line4:
mov edi, esi ;; get the new line
mov ecx, edx ;; load the count
rep stosd ;; store the data (eax = 0)
add esi, ebp ;; add the pitch into the pDest
dec ebx ;; are we done with the screen?
jnz line4
pop ebp
pop ebx
dec ebx ;; did we do it the requested number of times?
jnz screen4
mov eax, Count ;; return how many bytes we filled
imul eax, sWidth
imul eax, Height
}
}
// fill memory (video or system) with 0s (DOWRD fill)
// same thing as above, just do it in bytes.
// only 2 lines change. Whata waste of code space.