From dba4644ee74851fe2ac969c0e3abb0d2b67cf396 Mon Sep 17 00:00:00 2001 From: maelstrom Date: Fri, 26 Jul 2024 12:15:20 +0300 Subject: [PATCH] Forgot about transparency --- boot.asm | 2 +- gfx_util.asm | 5 ++++- main.asm | 21 +++++++++++++-------- run.sh | 5 ++++- 4 files changed, 22 insertions(+), 11 deletions(-) diff --git a/boot.asm b/boot.asm index c4c96df..999af75 100644 --- a/boot.asm +++ b/boot.asm @@ -7,7 +7,7 @@ OS_SEGMENT equ 0x100 boot: ; Load from disk mov ah, 0x02 ; read - mov al, 0x02 ; No of sectors (1) + mov al, 0x02 ; No of sectors (2) mov cl, 0x02 ; Sector start (1 = boot sector, 2 = OS) mov ch, 0x00 ; Cylinder 0 mov dh, 0x00 ; Head 0 diff --git a/gfx_util.asm b/gfx_util.asm index 87475cb..a6d2ddb 100644 --- a/gfx_util.asm +++ b/gfx_util.asm @@ -79,7 +79,7 @@ gfx_rect: ret -; di = y*32+x +; di = y*320+x ; si = source color data ; ax = width ; bl = height @@ -104,7 +104,10 @@ _gfx_blit0: add cx, 1 mov dh, [si] + cmp dh, 0xFF + jz .ncp mov [es:di], dh + .ncp: add di, 1 add si, 1 diff --git a/main.asm b/main.asm index d8cd368..3581f20 100644 --- a/main.asm +++ b/main.asm @@ -18,9 +18,7 @@ section KERNEL follows=BOOTSECTOR vstart=1000h %endmacro main: - ; Video mode - mov ax, 0x13 - int 0x10 + call gfx_init_vga13 ; Important for mouse stuff definitely jmp 0x000:.setcs @@ -31,18 +29,25 @@ main: lp: + ; mov cx, 0 + ; mov al, 0 + ; mov dx, 320 + ; mov bl, 200 + ; mov bh, 0 + + ;call gfx_rect cli mov bx, [mouseX] mov ax, [mouseY] sti - mov dx, 0 - mov cx, 320 - mul cx - add ax, bx + mov dx, 0 + mov cx, 320 + mul cx + add ax, bx - mov di, ax + mov di, ax mov si, gfxd_cursor mov ax, 11 mov bl, 18 diff --git a/run.sh b/run.sh index 3a62e0b..8219531 100755 --- a/run.sh +++ b/run.sh @@ -1,2 +1,5 @@ nasm -f bin main.asm -o main.bin -qemu-system-x86_64 main.bin \ No newline at end of file +qemu-system-x86_64 main.bin + + +dfkjjgodifjgodifj \ No newline at end of file