From 6ce831bbeb811010289a6f62e0d5a4374a63690f Mon Sep 17 00:00:00 2001 From: Eric-Paul Ickhorn Date: Sun, 21 Jul 2024 05:59:41 +0200 Subject: [PATCH] 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. --- i386/loader/src-asm/utility/display.asm | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/i386/loader/src-asm/utility/display.asm b/i386/loader/src-asm/utility/display.asm index 9b913c3..3046dee 100644 --- a/i386/loader/src-asm/utility/display.asm +++ b/i386/loader/src-asm/utility/display.asm @@ -33,20 +33,21 @@ write_hexadecimal_string: ; character uses 2 bytes and there are 3 characters per byte ; 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 edx, 80 + mov edx, 160 mul edx + mov [esi + 4], eax - ; Add the offset within the row ontop - add eax, [ebp - 12] + ; Get the byte offset within the row + mov eax, [ebp - 12] add eax, ecx - - ; Multiply with 2 to get the byte offset - ; from the character index mov edx, 6 mul edx + ; Add the start offset of the line + add eax, [esi + 4] + ; Point into the framebuffer add eax, FRAMEBUFFER_ADDRESS