kernel/src/framebuffer.asm

43 lines
471 B
NASM
Raw Normal View History

;; x, y, brightness
putpixel:
push ebp
mov ebp, esp
push eax
push ebx
push ecx
push edi
cld
; 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
; Brightness
mov eax, [ebp + 16]
; Poke videomemory
stosb
stosb
stosb
cmp [mbootinfo.fb_bpp], 24
je .done
stosb
.done:
pop edi
pop ecx
pop ebx
pop eax
pop ebp
ret