Forgot about transparency

This commit is contained in:
maelstrom 2024-07-26 12:15:20 +03:00
parent 83c6f1e7b3
commit dba4644ee7
4 changed files with 22 additions and 11 deletions

View file

@ -7,7 +7,7 @@ OS_SEGMENT equ 0x100
boot: boot:
; Load from disk ; Load from disk
mov ah, 0x02 ; read 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 cl, 0x02 ; Sector start (1 = boot sector, 2 = OS)
mov ch, 0x00 ; Cylinder 0 mov ch, 0x00 ; Cylinder 0
mov dh, 0x00 ; Head 0 mov dh, 0x00 ; Head 0

View file

@ -79,7 +79,7 @@ gfx_rect:
ret ret
; di = y*32+x ; di = y*320+x
; si = source color data ; si = source color data
; ax = width ; ax = width
; bl = height ; bl = height
@ -104,7 +104,10 @@ _gfx_blit0:
add cx, 1 add cx, 1
mov dh, [si] mov dh, [si]
cmp dh, 0xFF
jz .ncp
mov [es:di], dh mov [es:di], dh
.ncp:
add di, 1 add di, 1
add si, 1 add si, 1

View file

@ -18,9 +18,7 @@ section KERNEL follows=BOOTSECTOR vstart=1000h
%endmacro %endmacro
main: main:
; Video mode call gfx_init_vga13
mov ax, 0x13
int 0x10
; Important for mouse stuff definitely ; Important for mouse stuff definitely
jmp 0x000:.setcs jmp 0x000:.setcs
@ -31,18 +29,25 @@ main:
lp: lp:
; mov cx, 0
; mov al, 0
; mov dx, 320
; mov bl, 200
; mov bh, 0
;call gfx_rect
cli cli
mov bx, [mouseX] mov bx, [mouseX]
mov ax, [mouseY] mov ax, [mouseY]
sti sti
mov dx, 0 mov dx, 0
mov cx, 320 mov cx, 320
mul cx mul cx
add ax, bx add ax, bx
mov di, ax mov di, ax
mov si, gfxd_cursor mov si, gfxd_cursor
mov ax, 11 mov ax, 11
mov bl, 18 mov bl, 18

5
run.sh
View file

@ -1,2 +1,5 @@
nasm -f bin main.asm -o main.bin nasm -f bin main.asm -o main.bin
qemu-system-x86_64 main.bin qemu-system-x86_64 main.bin
dfkjjgodifjgodifj