Fix text display for rows other than the first

Because the calculation of the byte offset within the framebuffer was
wrong, the framebuffer could only be written to on the first line.
That is now fixed.
This commit is contained in:
Eric-Paul Ickhorn 2024-07-21 05:59:41 +02:00
parent 4acf6f3a44
commit 6ce831bbeb
Signed by: epickh
GPG Key ID: 1358818BAA38B104
1 changed files with 8 additions and 7 deletions

View File

@ -33,20 +33,21 @@ write_hexadecimal_string:
; character uses 2 bytes and there are 3 characters per byte ; character uses 2 bytes and there are 3 characters per byte
; written; the upper nibble, the lower nibble and the padding. ; written; the upper nibble, the lower nibble and the padding.
; Multiply the row with 80, the number of cells per row ; Multiply the row with 160, the number of bytes per row
mov eax, [ebp - 16] mov eax, [ebp - 16]
mov edx, 80 mov edx, 160
mul edx mul edx
mov [esi + 4], eax
; Add the offset within the row ontop ; Get the byte offset within the row
add eax, [ebp - 12] mov eax, [ebp - 12]
add eax, ecx add eax, ecx
; Multiply with 2 to get the byte offset
; from the character index
mov edx, 6 mov edx, 6
mul edx mul edx
; Add the start offset of the line
add eax, [esi + 4]
; Point into the framebuffer ; Point into the framebuffer
add eax, FRAMEBUFFER_ADDRESS add eax, FRAMEBUFFER_ADDRESS