Compare commits

..

No commits in common. "9ef19730e3cae2d5420cc38a3b21c64281887b85" and "e9eaf218a1b4c76064953e2392708fb78171e7c7" have entirely different histories.

3 changed files with 23 additions and 19 deletions

View file

@ -8,23 +8,17 @@ putpixel:
push ecx push ecx
push edi push edi
; check pixel is in screen cld
mov ebx, [ebp+12] ;y
cmp ebx, [mbootinfo.fb_height]
jge .done
mov ecx, [ebp+8] ;x
cmp ecx, [mbootinfo.fb_width]
jge .done
; Destination ; Destination
mov edi, [mbootinfo.fb_addr] mov edi, [mbootinfo.fb_addr]
mov eax, [mbootinfo.fb_pitch] mov eax, [mbootinfo.fb_pitch]
mul dword ebx ;y mul dword [ebp+12] ;y
add edi, eax add edi, eax
mov eax, ecx ;x mov eax, [ebp+8] ;x
movzx ecx, byte [mbootinfo.fb_bytespp] movzx ebx, byte [mbootinfo.fb_bytespp]
mul ecx mul ebx
add edi, eax add edi, eax
@ -32,8 +26,13 @@ putpixel:
mov eax, [ebp + 16] mov eax, [ebp + 16]
; Poke videomemory ; Poke videomemory
cld stosb
rep stosb stosb
stosb
cmp [mbootinfo.fb_bpp], 24
je .done
stosb
.done: .done:
pop edi pop edi
pop ecx pop ecx

View file

@ -45,6 +45,12 @@ mbootgetinfo:
add esi, 4 add esi, 4
mov al, [esi] mov al, [esi]
cmp al, 32
je .bppokay
cmp al, 24
je .bppokay
jmp mbootunsupportedfbbpp
.bppokay:
mov [mbootinfo.fb_bpp], al mov [mbootinfo.fb_bpp], al
inc esi inc esi

View file

@ -11,9 +11,8 @@ MB_HEADER_FLAGS equ MB_PAGE_ALIGN or MB_MEMORY_INFO or MB_VIDEO_REQUEST
MB_HEADER_FLAGS equ MB_PAGE_ALIGN or MB_MEMORY_INFO or MB_VIDEO_REQUEST or MB_AOUT_KLUDGE MB_HEADER_FLAGS equ MB_PAGE_ALIGN or MB_MEMORY_INFO or MB_VIDEO_REQUEST or MB_AOUT_KLUDGE
MB_CHECKSUM equ -(MB_HEADER_MAGIC + MB_HEADER_FLAGS) MB_CHECKSUM equ -(MB_HEADER_MAGIC + MB_HEADER_FLAGS)
VWIDTH equ 640 VWIDTH equ 1024
VHEIGHT equ 480 VHEIGHT equ 768
VDEPTH equ 24
multiboot: multiboot:
dd MB_HEADER_MAGIC dd MB_HEADER_MAGIC
@ -27,7 +26,7 @@ multiboot:
dd 0 ; video mode_type (0:fb, 1:txt) (set flags[2]!) dd 0 ; video mode_type (0:fb, 1:txt) (set flags[2]!)
dd VWIDTH ; video width dd VWIDTH ; video width
dd VHEIGHT ; video height dd VHEIGHT ; video height
dd VDEPTH ; video depth dd 24 ; video depth
start: start:
; Setup stack ; Setup stack
@ -104,8 +103,8 @@ start:
mov ebx, 767 mov ebx, 767
mov ecx, 1023 mov ecx, 1023
push 0xff push 0xff
push 479 push 767
push 639 push 1023
call putpixel call putpixel
add esp, 3*4 add esp, 3*4