kernel/src/framebuffer.asm

44 lines
487 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
movzx ebx, byte [mbootinfo.fb_bytespp]
mul ebx
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