From fcde38e508cd381ad17e0f73946fa551ac683c81 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Sun, 9 Jul 2023 23:21:18 +0100 Subject: Height can be a parameter too --- src/vga.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/vga.c') diff --git a/src/vga.c b/src/vga.c index c78fcec..a82fca9 100644 --- a/src/vga.c +++ b/src/vga.c @@ -197,16 +197,15 @@ void blit_copy(const Rect *dst) } } -void blit_copy16x16(const Rect *dst) +void blit_copy16(const Rect *dst) { uint8_t *src = buffer + dst->x + dst->y * 320; uint8_t *dtarget = screen + dst->x + dst->y * 320; asm volatile ( - "movl $16, %%eax\n\t" "movl $0x130, %%ebx\n\t" "cld\n\t" - "blit_copy16x16_loop:\n\t" + "blit_copy16_loop:\n\t" "movsl\n\t" "movsl\n\t" "movsl\n\t" @@ -215,9 +214,9 @@ void blit_copy16x16(const Rect *dst) "addl %%ebx, %%edi\n\t" "decl %%eax\n\t" "orl %%eax, %%eax\n\t" - "jne blit_copy16x16_loop\n\t" + "jne blit_copy16_loop\n\t" : /* no output */ - : "S" (src), "D" (dtarget) - : "ecx", "ebx", "eax" + : "S" (src), "D" (dtarget), "a" ((uint32_t)dst->h) + : "ecx", "ebx" ); } -- cgit v1.2.3