2023-09-06 19:58:40 +03:00
|
|
|
;; x, y, brightness
|
2023-08-02 20:16:43 +03:00
|
|
|
putpixel:
|
|
|
|
push ebp
|
|
|
|
mov ebp, esp
|
|
|
|
|
|
|
|
push eax
|
|
|
|
push ebx
|
|
|
|
push ecx
|
|
|
|
push edi
|
|
|
|
|
2023-09-06 19:58:40 +03:00
|
|
|
cld
|
2023-08-02 20:16:43 +03:00
|
|
|
|
|
|
|
; Destination
|
|
|
|
mov edi, [mbootinfo.fb_addr]
|
|
|
|
mov eax, [mbootinfo.fb_pitch]
|
|
|
|
mul dword [ebp+12] ;y
|
|
|
|
add edi, eax
|
|
|
|
|
|
|
|
mov eax, [ebp+8] ;x
|
|
|
|
mul byte [mbootinfo.fb_bytespp]
|
|
|
|
add edi, eax
|
|
|
|
|
|
|
|
|
2023-09-06 19:58:40 +03:00
|
|
|
; Brightness
|
|
|
|
mov eax, [ebp + 16]
|
|
|
|
|
|
|
|
; Poke videomemory
|
|
|
|
stosb
|
|
|
|
stosb
|
|
|
|
stosb
|
2023-08-02 20:16:43 +03:00
|
|
|
|
|
|
|
cmp [mbootinfo.fb_bpp], 24
|
2023-09-06 19:58:40 +03:00
|
|
|
je .done
|
|
|
|
stosb
|
2023-08-02 20:16:43 +03:00
|
|
|
.done:
|
|
|
|
pop edi
|
|
|
|
pop ecx
|
|
|
|
pop ebx
|
|
|
|
pop eax
|
|
|
|
|
|
|
|
pop ebp
|
|
|
|
ret
|